Fixes for lots of scripts, and for empty script blocks.

This commit is contained in:
Martin Haye 2014-07-19 13:54:41 -07:00
parent 162b53a698
commit d6815eab05
2 changed files with 28 additions and 5 deletions

View File

@ -998,7 +998,7 @@ class PackPartitions
else if (map?.@name =~ /3D/)
pack3DMap(map, dataIn.tile)
else
println "Warning: map name '$name' should contain '2D' or '3D'. Skipping."
println "Warning: map name '${map?.@name}' should contain '2D' or '3D'. Skipping."
}
// Ready to start writing the output file.
@ -1107,6 +1107,9 @@ class ScriptModule
def name = script.name[0].text()
println " Script '$name'"
if (script.block.size() == 0)
return
// Record the function's start address in its corresponding stub
startFunc(scriptNum+1)

View File

@ -78,6 +78,8 @@ const wndbtm = $73 ; bottom+1 of text window
const cursh = $74 ; Cursor H-pos 0-39
const cursv = $75 ; Cursor V-pos 0-23
const MAX_LOC_TRIG = 80
;==================================================================================================
; Strings.
byte helloStr[] = "Loading Lawless Legends.\n"
@ -91,9 +93,9 @@ word pMap
word pScripts
word cmdTbl[64]
word nLocTrig = 0
word locTrig_x[30]
word locTrig_y[30]
word locTrig_func[30]
word locTrig_x[MAX_LOC_TRIG]
word locTrig_y[MAX_LOC_TRIG]
word locTrig_func[MAX_LOC_TRIG]
word prevX
word prevY
@ -323,6 +325,20 @@ asm goMon
jmp $FF69
end
asm fatal
bit setROM
lda #'F'+$80
jsr cout
lda #'#'+$80
jsr cout
lda evalStkH,x
jsr prbyte
lda evalStkL,x
jsr prbyte
jsr crout
jmp $FF65
end
asm clearWindow
bit setROM
txa
@ -391,6 +407,7 @@ def initMap()
if scriptModule
pScripts = loader(QUEUE_LOAD, MAIN_MEM, (scriptModule << 8) | RES_TYPE_MODULE)
loader(FINISH_LOAD, MAIN_MEM, 1) ; 1 = keep open
nLocTrig = 0
*pScripts()
fin
@ -530,7 +547,7 @@ end
def nextMap()
flipToFirstPage()
mapNum = mapNum + 1
if mapNum > 5
if mapNum > 8
mapNum = 1
fin
initMap()
@ -570,6 +587,9 @@ def kbdLoop()
end
def setLocationTrigger(x, y, func)
if nLocTrig == MAX_LOC_TRIG
fatal($101)
fin
locTrig_x[nLocTrig] = x
locTrig_y[nLocTrig] = y
locTrig_func[nLocTrig] = func