This commit is contained in:
David Schmenk 2014-07-08 17:55:56 -07:00
commit 695fef7a15
3 changed files with 80 additions and 4 deletions

View File

@ -1020,8 +1020,25 @@ class PackPartitions
System.exit(1);
}
def m = new ScriptModule()
// Go for it.
new PackPartitions().pack(args[0], args[1], args.size() > 2 ? args[2] : null)
}
}
class ScriptModule
{
def data = []
def funcs = []
def fixups = []
def locationTriggers = []
def addString(str)
{
data.add((byte)str.length)
str.each { ch -> data.add((byte)ch) }
}
}

View File

@ -53,6 +53,8 @@ const CALC_FREE = $19
const CHAIN_LOADER = $1E
const FATAL_ERROR = $1F
const printVec = $300
;==================================================================================================
; Predefined functions, for circular calls
predef moveBackward
@ -66,11 +68,19 @@ const playerY = $60
const backBuf = $6A
const frontBuf = $6B
;==================================================================================================
; Font engine variables
const wndleft = $70 ; left edge of the window
const wndwdth = $71 ; right edge (NOT width) of text window
const wndtop = $72 ; top of text window
const wndbtm = $73 ; bottom+1 of text window
const cursh = $74 ; Cursor H-pos 0-39
const cursv = $75 ; Cursor V-pos 0-23
;==================================================================================================
; Strings.
byte helloStr[] = "Loading Lawless Legends.\n"
byte initFontStr[] = "Initting font engine.\n"
byte initRaycastStr[] = "Initting raycaster.\n"
byte loopStr[] = "Entering keyboard loop.\n"
;==================================================================================================
@ -306,6 +316,21 @@ asm goMon
jmp $FF69
end
; Display a string using the font engine
asm displayStr(str)
txa
pha
bit setROM
ldy evalStkL,x
lda evalStkH,x
tax
jsr printSTR
bit setLcRW+lcBank2
pla
tax
rts
end
;==================================================================================================
; General methods
@ -341,11 +366,9 @@ def initMap()
loader(FINISH_LOAD, MAIN_MEM, 1) ; 1 = keep open
; Start up the font engine
puts(@initFontStr)
initFontEngine(pFont)
; Start up the raycaster
puts(@initRaycastStr)
initRaycaster(pMap)
; Set initial player position
@ -357,6 +380,36 @@ def initMap()
renderFrame()
end
; Window for the map name bar
def setWindow1()
^wndtop = 1
^wndbtm = 2
^wndleft = 4
^wndwdth = 18
^cursv = ^wndtop
^cursh = ^wndleft
end
; Window for the large upper right bar
def setWindow2()
^wndtop = 3
^wndbtm = 17
^wndleft = 23
^wndwdth = 37
^cursv = ^wndtop
^cursh = ^wndleft
end
; Window for the mid-size lower right bar
def setWindow3()
^wndtop = 18
^wndbtm = 23
^wndleft = 23
^wndwdth = 37
^cursv = ^wndtop
^cursh = ^wndleft
end
;==================================================================================================
; Actions
def initCmd(key, func)
@ -488,6 +541,8 @@ initCmd('G', @nextGround)
initMap()
setWindow2()
; Main keyboard loop
puts(@loopStr)
kbdLoop()

View File

@ -1816,6 +1816,10 @@ flip: !zone
stx frontBuf
lda page1,x
}
; Hack for real (not emulated) IIc: sometimes displays only lo-bit graphics
; unless we do this. *HUGE* thanks to Brendan Robert for the fix!
sta $C07E ; disable double-hi-res
lda $C05F ; disable double-hi-res
rts
;-------------------------------------------------------------------------------