shave some bytes

This commit is contained in:
4am 2021-10-24 01:29:48 -04:00
parent e7f5308c3f
commit a09816b514
2 changed files with 22 additions and 32 deletions

View File

@ -7,7 +7,7 @@
;
; LC RAM BANK 1
; D000..E7D2 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
; E9E8..FFEE - main program code
; E9D5..FFEE - main program code
; FFEF..FFF9 - API functions and global constants available for main program
; code, prelaunchers, transition effects, &c.
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)

View File

@ -48,21 +48,8 @@ HGRActionSlideshow
; graphics mode still displaying hi-res screen with last picture visible
;------------------------------------------------------------------------------
HGRSingle
+ST16 @fname
jsr LoadHGRActionIndex
jsr okvs_find
!word HGRActionIndexPtr
@fname !word $FDFD ; SMC
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load compressed HGR screenshot at $3FF8
!word kHGRActionDataFile
!word $3FF8
@indexRecordPtr
!word $FDFD ; SMC
+ST16 IndexedHGRFilename
jsr LoadIndexedHGRFile
jsr DecompressHGR
jsr LoadHGRTransition ; load transition effect code at $6000
jmp ExecuteTransitionAt6000AndWait
@ -151,7 +138,7 @@ HGRActionCallback
bit KBD
bmi HGRRTS
+ST16 @fname
+ST16 IndexedHGRFilename
jsr FindGameInActionSlideshow
; if game name is not found (C will be set here), it means the game
@ -165,24 +152,14 @@ HGRActionCallback
+LD16 WINDEX ; save game index in case user hits RETURN
+ST16 gGameToLaunch ; while it's visible (we'll launch it)
+LD16 @fname
jsr LoadHGRActionIndex
jsr okvs_find
!word HGRActionIndexPtr
@fname !word $FDFD ; SMC
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load compressed HGR screenshot at $3FF8
!word kHGRActionDataFile
!word $3FF8
@indexRecordPtr
!word $FDFD ; SMC
jsr LoadIndexedHGRFile
jsr DecompressHGR
jmp DrawGameTitleInActionSlideshow
LoadHGRActionIndex
LoadIndexedHGRFile
; in: caller has set IndexedHGRFilename
; out: all flags & registers clobbered
+LD16 IndexedHGRFilename
+ST16 PTR
ldy #1
lda (PTR), y
@ -193,9 +170,22 @@ LoadHGRActionIndex
clc
adc #$30 ; A = "0".."6" (ASCII)
sta gHGRActionIndexNumber ; part of kHGRActionIndexFile
jsr LoadFile ; load index file into $4000
!word kRootDirectory
!word kHGRActionIndexFile
HGRActionIndexPtr
!word $4000
jsr okvs_find
!word HGRActionIndexPtr
IndexedHGRFilename
!word $FDFD ; SMC
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load compressed HGR screenshot at $3FF8
!word kHGRActionDataFile
!word $3FF8
@indexRecordPtr
!word $FDFD ; SMC
rts