reduce memory copy during launch

This commit is contained in:
4am 2024-05-25 20:51:48 -04:00
parent 5a99dbcc40
commit fd4a0cd7ba
2 changed files with 18 additions and 19 deletions

View File

@ -20,15 +20,15 @@
; LC RAM BANK 2
; D000..D5FF - ProRWTS data
; D600..D8BD - ProRWTS code
; D8BE..DC76 - ProRWTS glue code
; DC77..DC7C - backup of stack (during gameplay and self-running demos)
; DC7D..DC82 - okvs cache (attract state saved across self-running demo)
; D8BE..DCB7 - ProRWTS glue code
; DCB8..DCBD - backup of stack (during gameplay and self-running demos)
; DCBE..DCC2 - okvs cache (attract state saved across self-running demo)
; ...unused...
; DFB4..DFFF - (de)acceleration function
;
; MAIN MEMORY DURING SEARCH/BROWSE MODE
; 6000..9FFF - search index (489 games = $3AEB/$4000)
; A000..BCFF - search cache (489 games = $1957/$1D00)
; 6000..9FFF - search index (499 games = $3C3C/$4000)
; A000..BCFF - search cache (499 games = $1837/$1D00)
; BD00..BEFF - prefs buffer (used to write PREFS.CONF if cheat mode changes)
; BF00..BFFF - ProRWTS glue (supports LoadIndexedFile)
;
@ -237,7 +237,7 @@ ldrhi2 = $65 ; constant
; Columns and Dangerous Dave also call (de)accelerator functions directly
PrelaunchInit = $C9
PrelaunchInit = $EB
_CONSTANTS_=*
}

View File

@ -30,10 +30,7 @@ LaunchInternal
- sta $bf57,y
dey
bne -
jmp PrelaunchInit
PrelaunchInitInternal
!pseudopc PrelaunchInit {
ldx #RNDSEED-1 ; wipe lower part of zero page
txa
- sta $00,x
@ -45,20 +42,22 @@ PrelaunchInitInternal
lda #$02 ; require these to be non-zero. Ask me
sta RNDSEED+1 ; how long that one took to debug.
+READ_ROM_NO_WRITE
sta STOREOFF
sta READMAINMEM
sta WRITEMAINMEM
sta CLR80VID
sta PRIMARYCHARSET
bit CLEARKBD
jmp PrelaunchInit
PrelaunchInitInternal
!pseudopc PrelaunchInit {
+READ_ROM_NO_WRITE
jsr ROM_IN0 ; Initialize machine like a cold boot.
jsr ROM_PR0 ; Many games assume a 'clean slate' and
jsr ROM_NORMAL ; rely on zero page values set by these
sta STOREOFF ; ROM routines,
sta READMAINMEM ; e.g. Wavy Navy just prints out text via
sta WRITEMAINMEM ; $FDED and expects it to work. Having it
sta CLR80VID ; print all null characters is amusing, in
sta PRIMARYCHARSET ; a quiet way, but not really helpful.
jsr ROM_TEXT
jsr ROM_HOME
bit CLEARKBD
jsr ROM_TEXT ; ROM routines, e.g. Wavy Navy prints text
jsr ROM_HOME ; via $FDED and expects it to work.
sei
bvc $106 ; unconditional jump to game-specific pre-launch code
!if * != $100 {