mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-26 17:49:43 +00:00
enable tree files in UI
This commit is contained in:
parent
d9dfe2b64f
commit
ab22c9bc03
@ -7,17 +7,17 @@
|
|||||||
;
|
;
|
||||||
; LC RAM BANK 1
|
; LC RAM BANK 1
|
||||||
; D000..E789 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
|
; D000..E789 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
|
||||||
; E95E..FFF1 - main program code
|
; E95C..FFEE - main program code
|
||||||
; FFF2..FFF9 - API functions and global constants available for main program
|
; FFEF..FFF9 - API functions and global constants available for main program
|
||||||
; code, prelaunchers, transition effects, &c.
|
; code, prelaunchers, transition effects, &c.
|
||||||
; (Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
|
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
|
||||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||||
;
|
;
|
||||||
; LC RAM BANK 2
|
; LC RAM BANK 2
|
||||||
; D000..D3FF - ProRWTS data
|
; D000..D3FF - ProRWTS data
|
||||||
; D400..D66F - ProRWTS code
|
; D400..D6B6 - ProRWTS code
|
||||||
; D670..DB2D - HGR font code & ProRWTS glue code
|
; D6B7..DB84 - HGR font code & ProRWTS glue code
|
||||||
; DB2E..DB3D - backup of stack (during gameplay and self-running demos)
|
; DB85..DB94 - backup of stack (during gameplay and self-running demos)
|
||||||
; ...unused...
|
; ...unused...
|
||||||
; DBB4..DBFF - (de)acceleration function
|
; DBB4..DBFF - (de)acceleration function
|
||||||
; DC00..DFFF - HGR font data
|
; DC00..DFFF - HGR font data
|
||||||
@ -148,12 +148,14 @@ CHEATS_ENABLED = %00001000
|
|||||||
; shared symbols for prelaunch and effects to call ProRWTS2 functions
|
; shared symbols for prelaunch and effects to call ProRWTS2 functions
|
||||||
iCurBlockLo = $D401 ; constant
|
iCurBlockLo = $D401 ; constant
|
||||||
iCurBlockHi = $D403 ; constant
|
iCurBlockHi = $D403 ; constant
|
||||||
launchpatch = $D60E ; glue.launch.a
|
launchpatch = $D655 ; glue.launch.a
|
||||||
iAddToPath = $FE64 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
|
iAddToPath = $FE64 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
|
||||||
itraverse = $D8D8 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
|
itraverse = $D92F ; Roger Rabbit, avoid, use Infiltrator 2 style instead
|
||||||
ldrhi = $56 ; constant
|
ldrhi = $56 ; constant
|
||||||
namlo = $57 ; constant
|
namlo = $57 ; constant
|
||||||
namhi = $58 ; constant
|
namhi = $58 ; constant
|
||||||
|
ldrlo2 = $64 ; constant
|
||||||
|
ldrhi2 = $65 ; constant
|
||||||
|
|
||||||
_CONSTANTS_=*
|
_CONSTANTS_=*
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,10 @@
|
|||||||
!to "build/PRELAUNCH.INDEXED/STANDARD",plain
|
!to "build/PRELAUNCH.INDEXED/STANDARD",plain
|
||||||
*=$106
|
*=$106
|
||||||
|
|
||||||
ldy $5A ; set up game entry point in stack page
|
!source "src/constants.a"
|
||||||
ldx $59 ; (last ProRWTS load address - 1)
|
|
||||||
bne +
|
ldy ldrhi2 ; set up game entry point in stack page
|
||||||
dey
|
ldx ldrlo2 ; (last ProRWTS load address - 1)
|
||||||
+ dex
|
|
||||||
stx $1FE
|
stx $1FE
|
||||||
sty $1FF
|
sty $1FF
|
||||||
|
|
||||||
@ -17,7 +16,8 @@
|
|||||||
|
|
||||||
ldx #$FD ; Jump to game entry point via stack pop.
|
ldx #$FD ; Jump to game entry point via stack pop.
|
||||||
txs
|
txs
|
||||||
rts
|
php
|
||||||
|
rti
|
||||||
|
|
||||||
!if * > $1C0 {
|
!if * > $1C0 {
|
||||||
!error "code is too large, ends at ", *
|
!error "code is too large, ends at ", *
|
||||||
|
@ -315,9 +315,13 @@ resetval=$f0
|
|||||||
stx dirbufpatch7+2
|
stx dirbufpatch7+2
|
||||||
stx dirbufpatch9+2
|
stx dirbufpatch9+2
|
||||||
stx dirbufpatch10+1
|
stx dirbufpatch10+1
|
||||||
|
stx dirbufpatch11+1
|
||||||
|
stx dirbufpatch12+1
|
||||||
|
stx dirbufpatch13+1
|
||||||
inx
|
inx
|
||||||
stx dirbufpatch5+2
|
stx dirbufpatch5+2
|
||||||
stx dirbufpatch8+2
|
stx dirbufpatch8+2
|
||||||
|
stx dirbufpatch14+1
|
||||||
@close_ret
|
@close_ret
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ ver_02 = 1
|
|||||||
;else driver must be running from same memory target
|
;else driver must be running from same memory target
|
||||||
;i.e. running from main if accessing main, running from aux if accessing aux
|
;i.e. running from main if accessing main, running from aux if accessing aux
|
||||||
allow_saplings=1 ;enable support for saplings
|
allow_saplings=1 ;enable support for saplings
|
||||||
allow_trees = 0 ;enable support for tree files, as opposed to only seedlings and saplings
|
allow_trees = 1 ;enable support for tree files, as opposed to only seedlings and saplings
|
||||||
;required in RWTS mode if file > 128kb
|
;required in RWTS mode if file > 128kb
|
||||||
fast_trees = 0 ;keep tree block in memory, requires an additional 512 bytes of RAM
|
fast_trees = 0 ;keep tree block in memory, requires an additional 512 bytes of RAM
|
||||||
always_trees = 0 ;set to 1 if the only file access involves tree files
|
always_trees = 0 ;set to 1 if the only file access involves tree files
|
||||||
@ -132,11 +132,11 @@ ver_02 = 1
|
|||||||
ldrhi = $56 ;set to load address if override_adr=1
|
ldrhi = $56 ;set to load address if override_adr=1
|
||||||
namlo = $57 ;name of file to access
|
namlo = $57 ;name of file to access
|
||||||
namhi = $58 ;name of file to access
|
namhi = $58 ;name of file to access
|
||||||
ldrlo2 = $59 ;original load address read from filesystem
|
!set last_zp = $58 ;highest address to save if swap_zp enabled (max 127 entries later)
|
||||||
ldrhi2 = $5a ;original load address read from filesystem
|
!if write_sparse = 1 {
|
||||||
sizelo2 = $5b ;original file size read from filesystem
|
sparseblk = $59 ;(internal) last-read block was sparse if zero
|
||||||
sizehi2 = $5c ;original file size read from filesystem
|
!set last_zp = $59 ;highest address to save if swap_zp enabled (max 127 entries later)
|
||||||
!set last_zp = $5c ;highest address to save if swap_zp enabled (max 127 entries later)
|
} ;write_sparse = 1
|
||||||
|
|
||||||
!if enable_floppy = 1 {
|
!if enable_floppy = 1 {
|
||||||
tmpsec = $3c ;(internal) sector number read from disk
|
tmpsec = $3c ;(internal) sector number read from disk
|
||||||
@ -194,6 +194,12 @@ ver_02 = 1
|
|||||||
} ;aligned_read = 0
|
} ;aligned_read = 0
|
||||||
} ;mem_swap = 0
|
} ;mem_swap = 0
|
||||||
|
|
||||||
|
ldrlo2 = $64 ;original load address read from filesystem
|
||||||
|
ldrhi2 = $65 ;original load address read from filesystem
|
||||||
|
sizelo2 = $66 ;original file size read from filesystem
|
||||||
|
sizehi2 = $67 ;original file size read from filesystem
|
||||||
|
!set last_zp = $67 ;highest address to save if swap_zp enabled (max 127 entries later)
|
||||||
|
|
||||||
!if enable_floppy = 1 {
|
!if enable_floppy = 1 {
|
||||||
step = $64 ;(internal) state for stepper motor
|
step = $64 ;(internal) state for stepper motor
|
||||||
tmptrk = $65 ;(internal) temporary copy of current track
|
tmptrk = $65 ;(internal) temporary copy of current track
|
||||||
@ -232,7 +238,7 @@ ver_02 = 1
|
|||||||
FILE_COUNT = $25 ;ProDOS constant
|
FILE_COUNT = $25 ;ProDOS constant
|
||||||
DEVADR01HI = $bf11 ;ProDOS constant
|
DEVADR01HI = $bf11 ;ProDOS constant
|
||||||
ROMIN = $c081
|
ROMIN = $c081
|
||||||
LCBANK2 = $c089
|
LCBANK2 = $c08b
|
||||||
CLRAUXRD = $c002
|
CLRAUXRD = $c002
|
||||||
CLRAUXWR = $c004
|
CLRAUXWR = $c004
|
||||||
SETAUXWR = $c005
|
SETAUXWR = $c005
|
||||||
@ -521,8 +527,8 @@ slot ldx $cfff
|
|||||||
sty unrcommand2
|
sty unrcommand2
|
||||||
} ;rwts_mode = 0 and aligned_read = 0 and enable_write = 1
|
} ;rwts_mode = 0 and aligned_read = 0 and enable_write = 1
|
||||||
sty unrbloklo1
|
sty unrbloklo1
|
||||||
lda #>pblock
|
;;lda #>pblock
|
||||||
pblock_enabled=1
|
;;pblock_enabled=1
|
||||||
sta unrbloklo1 + 2
|
sta unrbloklo1 + 2
|
||||||
!if (rwts_mode + write_sparse) > 1 {
|
!if (rwts_mode + write_sparse) > 1 {
|
||||||
sta unrbloklo2 + 2
|
sta unrbloklo2 + 2
|
||||||
@ -600,8 +606,8 @@ iterunit inc unrunit2
|
|||||||
|
|
||||||
bankram
|
bankram
|
||||||
!if load_banked = 1 {
|
!if load_banked = 1 {
|
||||||
lda LCBANK2 - ((lc_bank - 1) * 8)
|
lda LCBANK2 - ((lc_bank - 1) * 8) - (rwts_mode * 2)
|
||||||
lda LCBANK2 - ((lc_bank - 1) * 8)
|
lda LCBANK2 - ((lc_bank - 1) * 8) - (rwts_mode * 2)
|
||||||
} ;load_banked = 1
|
} ;load_banked = 1
|
||||||
!if enable_floppy = 1 {
|
!if enable_floppy = 1 {
|
||||||
ldx #>unrelocdsk
|
ldx #>unrelocdsk
|
||||||
@ -1534,16 +1540,8 @@ noteof2
|
|||||||
!if allow_sparse = 1 {
|
!if allow_sparse = 1 {
|
||||||
pha
|
pha
|
||||||
ora dirbuf, y
|
ora dirbuf, y
|
||||||
tay
|
|
||||||
pla
|
|
||||||
dey
|
|
||||||
iny ;don't affect carry
|
|
||||||
} ;allow_sparse = 1
|
|
||||||
!if aligned_read = 0 {
|
|
||||||
php
|
|
||||||
} ;aligned_read = 0
|
|
||||||
!if allow_sparse = 1 {
|
|
||||||
beq issparse
|
beq issparse
|
||||||
|
pla
|
||||||
} ;allow_sparse = 1
|
} ;allow_sparse = 1
|
||||||
!if (aligned_read and (enable_write or enable_seek)) = 1 {
|
!if (aligned_read and (enable_write or enable_seek)) = 1 {
|
||||||
ldy reqcmd
|
ldy reqcmd
|
||||||
@ -1551,15 +1549,20 @@ noteof2
|
|||||||
beq +
|
beq +
|
||||||
} ;enable_seek = 1
|
} ;enable_seek = 1
|
||||||
} ;aligned_read = 1 and (enable_write = 1 or enable_seek = 1)
|
} ;aligned_read = 1 and (enable_write = 1 or enable_seek = 1)
|
||||||
|
!if aligned_read = 0 {
|
||||||
|
php
|
||||||
|
} ;aligned_read = 0
|
||||||
!if enable_write = 1 {
|
!if enable_write = 1 {
|
||||||
jsr seekrdwr
|
jsr seekrdwr
|
||||||
} else { ;enable_write = 0
|
} else { ;enable_write = 0
|
||||||
jsr seekrd
|
jsr seekrd
|
||||||
} ;enable_write = 1
|
} ;enable_write = 1
|
||||||
|
!if aligned_read = 0 {
|
||||||
|
plp
|
||||||
|
} ;aligned_read = 0
|
||||||
|
|
||||||
resparse
|
resparse
|
||||||
!if aligned_read = 0 {
|
!if aligned_read = 0 {
|
||||||
plp
|
|
||||||
+ bcc +
|
+ bcc +
|
||||||
!if bounds_check = 1 {
|
!if bounds_check = 1 {
|
||||||
dec blefthi
|
dec blefthi
|
||||||
@ -1587,7 +1590,7 @@ setaux sta CLRAUXRD, x
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
!if allow_sparse = 1 {
|
!if allow_sparse = 1 {
|
||||||
issparse
|
issparse pla
|
||||||
- sta (adrlo), y
|
- sta (adrlo), y
|
||||||
iny
|
iny
|
||||||
bne -
|
bne -
|
||||||
@ -2729,6 +2732,7 @@ hddfoundname iny
|
|||||||
} ;one_shot = 0
|
} ;one_shot = 0
|
||||||
} ;enable_write = 1 or aligned_read = 1
|
} ;enable_write = 1 or aligned_read = 1
|
||||||
} ;bounds_check = 1 or return_size = 1 or one_shot = 1
|
} ;bounds_check = 1 or return_size = 1 or one_shot = 1
|
||||||
|
|
||||||
;cache AUX_TYPE (load offset for binary files)
|
;cache AUX_TYPE (load offset for binary files)
|
||||||
|
|
||||||
!if override_adr = 0 {
|
!if override_adr = 0 {
|
||||||
@ -2768,6 +2772,7 @@ attribpatch
|
|||||||
php
|
php
|
||||||
} ;allow_subdir = 1
|
} ;allow_subdir = 1
|
||||||
!if allow_trees = 1 {
|
!if allow_trees = 1 {
|
||||||
|
dirbufpatch11
|
||||||
ldy #>hdddirbuf
|
ldy #>hdddirbuf
|
||||||
bvc +
|
bvc +
|
||||||
!if fast_trees = 1 {
|
!if fast_trees = 1 {
|
||||||
@ -2938,8 +2943,9 @@ encbufpatch1
|
|||||||
clc
|
clc
|
||||||
bne hddrdwrfilei
|
bne hddrdwrfilei
|
||||||
} else { ;no_interrupts = 0
|
} else { ;no_interrupts = 0
|
||||||
beq hddrdwrdone
|
beq +
|
||||||
jmp hddrdwrfilex
|
jmp hddrdwrfilex
|
||||||
|
+ jmp hddrdwrdone
|
||||||
} ;no_interrupts = 1
|
} ;no_interrupts = 1
|
||||||
} ;allow_subdir = 1
|
} ;allow_subdir = 1
|
||||||
!if allow_aux = 0 {
|
!if allow_aux = 0 {
|
||||||
@ -3046,6 +3052,7 @@ encbufpatch2
|
|||||||
!if aligned_read = 0 {
|
!if aligned_read = 0 {
|
||||||
php
|
php
|
||||||
} ;aligned_read = 0
|
} ;aligned_read = 0
|
||||||
|
dirbufpatch12
|
||||||
lda #>hdddirbuf
|
lda #>hdddirbuf
|
||||||
sta adrhi
|
sta adrhi
|
||||||
sty adrlo
|
sty adrlo
|
||||||
@ -3123,7 +3130,9 @@ blkidx = * + 1
|
|||||||
!if rwts_mode = 0 {
|
!if rwts_mode = 0 {
|
||||||
inc treeidx
|
inc treeidx
|
||||||
} ;rwts_mode = 0
|
} ;rwts_mode = 0
|
||||||
|
dirbufpatch13
|
||||||
ldx hdddirbuf, y
|
ldx hdddirbuf, y
|
||||||
|
dirbufpatch14
|
||||||
lda hdddirbuf + 256, y
|
lda hdddirbuf + 256, y
|
||||||
} else { ;fast_trees = 1
|
} else { ;fast_trees = 1
|
||||||
ldy treeidx
|
ldy treeidx
|
||||||
@ -3257,34 +3266,27 @@ dirbufpatch9
|
|||||||
!if write_sparse = 1 {
|
!if write_sparse = 1 {
|
||||||
sta sparseblk
|
sta sparseblk
|
||||||
} ;write_sparse = 1
|
} ;write_sparse = 1
|
||||||
!if (rwts_mode + enable_write) > 1 {
|
!if rwts_mode = 1 {
|
||||||
cmp #1
|
|
||||||
} else { ;rwts_mode = 0 or enable_write = 0
|
|
||||||
tay
|
|
||||||
} ;rwts_mode = 1 and enable_write = 1
|
|
||||||
pla
|
|
||||||
!if rwts_mode = 0 {
|
|
||||||
dey
|
|
||||||
iny ;don't affect carry
|
|
||||||
} else { ;rwts_mode = 1
|
|
||||||
!if enable_write = 1 {
|
!if enable_write = 1 {
|
||||||
|
cmp #1
|
||||||
|
pla
|
||||||
ldy reqcmd
|
ldy reqcmd
|
||||||
bcs hddseekrdwr
|
bcs hddseekrdwr
|
||||||
savebyte
|
savebyte
|
||||||
tay
|
tay
|
||||||
} else { ;enable_write = 0
|
} else { ;enable_write = 0
|
||||||
|
tay
|
||||||
|
pla
|
||||||
dey
|
dey
|
||||||
iny ;don't affect carry
|
iny ;don't affect carry
|
||||||
bne hddseekrd
|
bne hddseekrd
|
||||||
} ;enable_write = 1
|
} ;enable_write = 1
|
||||||
} ;rwts_mode = 0
|
} ;rwts_mode = 1
|
||||||
} ;allow_sparse = 0
|
} ;allow_sparse = 0
|
||||||
!if rwts_mode = 0 {
|
!if rwts_mode = 0 {
|
||||||
!if aligned_read = 0 {
|
|
||||||
php
|
|
||||||
} ;aligned_read = 0
|
|
||||||
!if allow_sparse = 1 {
|
!if allow_sparse = 1 {
|
||||||
beq hddissparse
|
beq hddissparse
|
||||||
|
pla
|
||||||
} ;allow_sparse = 1
|
} ;allow_sparse = 1
|
||||||
!if (aligned_read and (enable_write or enable_seek)) = 1 {
|
!if (aligned_read and (enable_write or enable_seek)) = 1 {
|
||||||
ldy reqcmd
|
ldy reqcmd
|
||||||
@ -3292,15 +3294,20 @@ savebyte
|
|||||||
beq +
|
beq +
|
||||||
} ;enable_seek = 1
|
} ;enable_seek = 1
|
||||||
} ;aligned_read = 1 and (enable_write = 1 or enable_seek = 1)
|
} ;aligned_read = 1 and (enable_write = 1 or enable_seek = 1)
|
||||||
|
!if aligned_read = 0 {
|
||||||
|
php
|
||||||
|
} ;aligned_read = 0
|
||||||
!if enable_write = 1 {
|
!if enable_write = 1 {
|
||||||
jsr hddseekrdwr
|
jsr hddseekrdwr
|
||||||
} else { ;enable_write = 0
|
} else { ;enable_write = 0
|
||||||
jsr hddseekrd
|
jsr hddseekrd
|
||||||
} ;enable_write = 1
|
} ;enable_write = 1
|
||||||
|
!if aligned_read = 0 {
|
||||||
|
plp
|
||||||
|
} ;aligned_read = 0
|
||||||
|
|
||||||
hddresparse
|
hddresparse
|
||||||
!if aligned_read = 0 {
|
!if aligned_read = 0 {
|
||||||
plp
|
|
||||||
+ bcc +
|
+ bcc +
|
||||||
} ;aligned_read = 0
|
} ;aligned_read = 0
|
||||||
inc adrhi
|
inc adrhi
|
||||||
@ -3330,6 +3337,9 @@ hddsetaux sta CLRAUXRD, x
|
|||||||
|
|
||||||
!if allow_sparse = 1 {
|
!if allow_sparse = 1 {
|
||||||
hddissparse
|
hddissparse
|
||||||
|
!if rwts_mode = 0 {
|
||||||
|
pla
|
||||||
|
} ;rwts_mode = 0
|
||||||
- sta (adrlo), y
|
- sta (adrlo), y
|
||||||
inc adrhi
|
inc adrhi
|
||||||
sta (adrlo), y
|
sta (adrlo), y
|
||||||
@ -3445,9 +3455,9 @@ hddreaddirsel
|
|||||||
|
|
||||||
hddreaddirsec
|
hddreaddirsec
|
||||||
!if allow_trees = 0 {
|
!if allow_trees = 0 {
|
||||||
dirbufpatch10
|
|
||||||
hddreaddirsect ldy #>hdddirbuf
|
hddreaddirsect ldy #>hdddirbuf
|
||||||
} else { ;allow_trees = 1
|
} else { ;allow_trees = 1
|
||||||
|
dirbufpatch10
|
||||||
ldy #>hdddirbuf
|
ldy #>hdddirbuf
|
||||||
hddreaddirsect
|
hddreaddirsect
|
||||||
} ;allow_trees = 0
|
} ;allow_trees = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user