sync, cache prefix

This commit is contained in:
Peter Ferrie 2018-11-05 22:16:35 -08:00
parent 6c2d1e1f5a
commit 3d958303e9
4 changed files with 70 additions and 54 deletions

View File

@ -142,6 +142,20 @@ AttractMode
cmp #$03
bne @Slideshow
+LOAD_PATH kDemoDirectory
ldy gPathname
iny
iny
sty ProDOS_prefix
lda gPathname-2, y
sta ProDOS_prefix, y
dey
bne -
lda #'/'
sta ProDOS_prefix+1
lda #'X'
sta ProDOS_prefix+2
+LOAD_FILE kDemoDirectory, @key
ldx #(@end_prelaunch-@prelaunch-1)
@ -155,23 +169,6 @@ AttractMode
dex
bpl -
jmp $106 ; jump to pre-launch code
@prelaunch ; this runs from main memory
lda $C088 ; entry point used by some self-running demos
jmp Reenter
+READ_ROM_NO_WRITE ; entry point to launch game (called above)
jsr $FE89 ; initialize machine like a cold boot
jsr $FE93 ; (many games assume a 'clean slate')
sta $C000
sta $C002
sta $C004
sta $C00C
sta $C00E
jsr $FB2F
jsr $FC58
ldx #$FF
txs
jmp (ldrlo2) ; jump to game
@end_prelaunch
@Slideshow
pha ; save module type
@ -199,6 +196,24 @@ AttractMode
!word HGRLoad
rts
@prelaunch ; this runs from main memory
lda $C088 ; entry point used by some self-running demos
jmp Reenter
+READ_ROM_NO_WRITE ; entry point to launch game (called above)
jsr $FE89 ; initialize machine like a cold boot
jsr $FE93 ; (many games assume a 'clean slate')
sta $C000
sta $C002
sta $C004
sta $C00C
sta $C00E
jsr $FB2F
jsr $FC58
ldx #$FF
txs
jmp (ldrlo2) ; jump to game
@end_prelaunch
HGRLoad
ldx $C000
bpl +
@ -284,6 +299,8 @@ ProDOS_fatal ;only for debugging, will be removed
jsr $fe89
jsr $fe93
jmp $ff3a
ProDOS_prefix=$bfd0
; !fill $2e
}
end_promote

View File

@ -252,47 +252,15 @@ ProDOS_enter
jsr @imp_seek
jmp ProDOS_exit
PREV_BLOCK_LO = $0 ;ProDOS constant
PREV_BLOCK_HI = $1 ;ProDOS constant
@imp_prefix
ldx #buffer
jsr @setbuffer1
lda gPrefix
sta packet
lda gPrefix+1
sta packet+1
ldy #0
lda (packet), y
tax
inx
!byte $2c
ldy ProDOS_prefix
@copy_prefix
lda (packet), y
iny
iny
iny
cmp #$2e
bcs @skip_slash1
lda #'/'
@skip_slash1
lda ProDOS_prefix, y
sta (buffer), y
bcs @skip_slash2
tya
ldy #0
sta (buffer), y
tay
@skip_slash2
dey
dey
dex
bne @copy_prefix
ldy #1
lda #'/'
sta (buffer), y
iny
lda #'X'
sta (buffer), y
bpl @copy_prefix
rts
@imp_open

View File

@ -93,3 +93,11 @@
jsr LoadFile
!word gPathname
}
!macro LOAD_PATH .subdirectory {
jsr ResetPath
+LDADDR .subdirectory
jsr AddToPath
+LDADDR kPathSeparator
jsr AddToPath
}

View File

@ -29,16 +29,39 @@ if "%1" equ "asm" (
%ACME% -r build\4cade.lst src\4cade.a
%ACME% src\fx\fx.hgr.diagonal.a
%ACME% src\fx\fx.hgr.iris.a
%ACME% src\fx\fx.hgr.interlock.ud.a
%ACME% src\fx\fx.hgr.interlock.lr.a
%ACME% src\fx\fx.hgr.spiral.a
%ACME% src\fx\fx.hgr.fourspiral.a
%ACME% src\fx\fx.hgr.fizzle.a
%ACME% src\fx\fx.hgr.bar.dissolve.a
%ACME% src\fx\fx.hgr.block.fizzle.a
%ACME% src\fx\fx.hgr.block.mosaic.a
%ACME% src\fx\fx.hgr.block.fizzle.white.a
%ACME% src\fx\fx.hgr.2pass.lr.a
%ACME% src\fx\fx.hgr.crystal.a
%ACME% src\fx\fx.hgr.foursquare.white.a
%ACME% src\fx\fx.hgr.onesquare.white.a
%ACME% src\fx\fx.hgr.diamond.a
%ACME% src\fx\fx.hgr.checkerboard.white.a
%ACME% src\fx\fx.hgr.halfblock.fizzle.a
%ACME% src\fx\fx.hgr.halfblock.fizzle.white.a
%ACME% src\fx\fx.hgr.stagger.ud.a
%ACME% src\fx\fx.hgr.stagger.ud.white.a
%ACME% src\fx\fx.hgr.stagger.lr.a
%ACME% src\fx\fx.hgr.stagger.lr.white.a
%ACME% src\fx\fx.hgr.corner.circle.a
%ACME% src\fx\fx.hgr.sunrise.a
%ACME% src\fx\fx.hgr.sunset.a
%ACME% src\fx\fx.hgr.radial.a
%ACME% src\fx\fx.hgr.radial2.a
%ACME% src\fx\fx.hgr.radial3.a
%ACME% src\fx\fx.hgr.radial4.a
%ACME% src\fx\fx.hgr.radial5.a
%ACME% src\fx\fx.hgr.split.ud.intro.a
%ACME% src\fx\fx.hgr.iris.a
%ACME% src\fx\fx.hgr.ripple.a
%ACME% src\fx\fx.hgr.ripple2.a
%ACME% src\fx\fx.hgr.star.a
goto :EOF
)