More reworking of title screen. Finished initial version of disk limiting.

This commit is contained in:
Martin Haye 2020-06-17 12:42:43 -07:00
parent 72f9827229
commit d9e2011671
4 changed files with 41 additions and 30 deletions

View File

@ -1924,8 +1924,8 @@ class A2PackPartitions
def day = cal.get(Calendar.DAY_OF_MONTH)
def hour = cal.get(Calendar.HOUR_OF_DAY)
def yearCode = (year-2010 < 10) ? (char) (48+year-2010) : // 0=2010, 1=2011, etc.
(char) (65+year-2020) // A=2020, B=2021, etc.
def yearCode = (year-2020 < 10) ? (char) (48+year-2020) : // 0=2020, 1=2021, etc.
(char) (65+year-2030) // A=2030, B=2031, etc.
def monthCode = (month < 9) ? (char) (48+month+1) : // 1=Jan, 2=Feb...
month == 9 ? 'o' : // o=Oct
month == 10 ? 'n' : // n=Nov
@ -2605,7 +2605,7 @@ class A2PackPartitions
flagSet.sort().each { flg -> gameFlags[flg] = gameFlags.size() }
}
else if (name == "{outlaw}block" &&
(data.@type == "interaction_get_flag" || data.@type == "interaction_set_flag"))
(data.@type == "interaction_get_flag" || data.@type == "interaction_set_flag" || data.@type == "interaction_clr_flag" ))
{
def els = data.field
assert els.size() == 1

View File

@ -660,7 +660,9 @@ def printVersion(windowWidth)#0
puts(p)
// And print in graphics mode too
rightJustifyStr(p, windowWidth)
if windowWidth
rightJustifyStr(p, windowWidth)
fin
end
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -727,6 +729,7 @@ def _newOrLoadGame(ask)#1
loop
// Brand future text screens with the version (adjust window to protect it)
printVersion(0) // not on graphics
^$23 = 23
textHome

View File

@ -41,6 +41,7 @@ import gamelib
predef createItem(itemNum)#1
predef createStruct(moduleID, creationFuncNum)#1
predef crout()#0
predef diskLimitChk(is3d, mapNum)#1
predef displayChar(chr)#0
predef displayf1(fmt, arg1)#0
predef displayf2(fmt, arg1, arg2)#0

View File

@ -120,7 +120,7 @@ export word typeHash = 0
export byte curHeapPct = 0
byte lastMoveDir = $FF
// Queue setMap / teleport / start_encounter, since otherwise script might be replaced while executing
// Queue setMap / teleport, since otherwise script might be replaced while executing
byte q_mapIs3D = 0
byte q_mapNum = 1
word q_x = 0
@ -2362,8 +2362,40 @@ export def setMap(is3D, num, x, y, dir)#0
//NO:scriptEvent(S_ENTER, NULL)
end
///////////////////////////////////////////////////////////////////////////////////////////////////
export def callGlobalFunc(moduleNum, arg1, arg2, arg3)#1
word pModule, pFunc, ret
// First load the module
if renderLoaded; flipToPage1(); fin
mmgr(START_LOAD, 1) // code is in partition 1
pModule = mmgr(QUEUE_LOAD, moduleNum<<8 | RES_TYPE_MODULE)
mmgr(FINISH_LOAD, 0)
// Call the function, passing it the number of args it expects
pFunc = pModule()
when getArgCount(pFunc)
is 0; ret = pFunc(); break
is 1; ret = pFunc(arg1); break
is 2; ret = pFunc(arg1, arg2); break
is 3; ret = pFunc(arg1, arg2, arg3); break
otherwise fatal("maxGlobParams")
wend
// Unload the module and we're done.
mmgr(FREE_MEMORY, pModule)
return ret
end
///////////////////////////////////////////////////////////////////////////////////////////////////
export def queue_setMap(is3D, num, x, y, dir)#0
byte part
part = lookupResourcePart(is3d+1, num)
if part > diskLimit
clearWindow
callGlobalFunc(GS_DISK_LIMIT, 1, 0, 0)
return
fin
q_mapIs3D = is3D
q_mapNum = num
q_x = x
@ -2692,31 +2724,6 @@ def returnFromEngine(render)#0
fin
end
///////////////////////////////////////////////////////////////////////////////////////////////////
export def callGlobalFunc(moduleNum, arg1, arg2, arg3)#1
word pModule, pFunc, ret
// First load the module
if renderLoaded; flipToPage1(); fin
mmgr(START_LOAD, 1) // code is in partition 1
pModule = mmgr(QUEUE_LOAD, moduleNum<<8 | RES_TYPE_MODULE)
mmgr(FINISH_LOAD, 0)
// Call the function, passing it the number of args it expects
pFunc = pModule()
when getArgCount(pFunc)
is 0; ret = pFunc(); break
is 1; ret = pFunc(arg1); break
is 2; ret = pFunc(arg1, arg2); break
is 3; ret = pFunc(arg1, arg2, arg3); break
otherwise fatal("maxGlobParams")
wend
// Unload the module and we're done.
mmgr(FREE_MEMORY, pModule)
return ret
end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Load the automap engine and display the map
def showAutomap()#1