From 1a0a725b6725ecf6f19acc23bab1d6fa646fae9c Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 24 Oct 2021 01:36:09 -0400 Subject: [PATCH] shave some bytes --- src/constants.a | 2 +- src/ui.attract.shr.a | 35 ++++++++++++----------------------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/constants.a b/src/constants.a index 8fea09930..70ad4a18c 100644 --- a/src/constants.a +++ b/src/constants.a @@ -7,7 +7,7 @@ ; ; LC RAM BANK 1 ; D000..E7D2 - persistent data structures (gGlobalPrefsStore, gGamesListStore) -; E9D5..FFEE - main program code +; E9ED..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) diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index 3a9bbf5d7..0d683e311 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -41,28 +41,12 @@ SHRSlideshow ; graphics mode reset to display hi-res screen, which is blank ;------------------------------------------------------------------------------ SHRSingle - +ST16 @sfname + +ST16 IndexedSHRFilename lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card and #SUPPORTS_SHR beq SHRRTS jsr BlankSHR - - jsr LoadFile ; load index file into $2000 - !word kRootDirectory - !word kSHRArtworkIndexFile -- !word $2000 - - jsr okvs_find - !word - -@sfname !word $FDFD ; SMC - +ST16 @indexRecordPtr - - jsr LoadIndexedFile ; load compressed SHR artwork at $1FF8/main (not aux) - !word kSHRArtworkDataFile - !word $1FF8 -@indexRecordPtr - !word $FDFD ; SMC - + jsr LoadIndexedSHRFile jsr DecompressSHR jsr LoadSHRTransition jsr ExecuteTransitionAtA000AndWait @@ -100,7 +84,7 @@ SHRArtworkCallback bit KBD bmi SHRRTS - +ST16 @sfname + +ST16 IndexedSHRFilename jsr FindGame ; if game is not found (C will be set here), it means it can't be played on @@ -112,7 +96,13 @@ SHRArtworkCallback +ST16 gGameToLaunch ; while it's visible (we'll launch it) jsr BlankSHR + jsr LoadIndexedSHRFile + jsr DecompressSHR + jmp ExecuteTransitionAtA000AndWait +LoadIndexedSHRFile +; in: caller has populated IndexedSHRFilename +; out: all flags & registers clobbered jsr LoadFile ; load index file into $2000 !word kRootDirectory !word kSHRArtworkIndexFile @@ -120,7 +110,8 @@ SHRArtworkCallback jsr okvs_find !word - -@sfname !word $FDFD ; SMC +IndexedSHRFilename + !word $FDFD ; SMC +ST16 @indexRecordPtr jsr LoadIndexedFile ; load compressed SHR artwork at $1FF8/main (not aux) @@ -128,9 +119,7 @@ SHRArtworkCallback !word $1FF8 @indexRecordPtr !word $FDFD ; SMC - - jsr DecompressSHR - jmp ExecuteTransitionAtA000AndWait + rts ;------------------------------------------------------------------------------ ; BlankSHR [private]