compress game help

This commit is contained in:
4am
2025-01-27 13:28:27 -05:00
parent 7f59197c20
commit 3a31554dfb
43 changed files with 76 additions and 55 deletions

View File

@@ -57,6 +57,7 @@ ATTRACT.IDX=$(BUILDDIR)/ATTRACT.IDX
HELPTEXT=$(BUILDDIR)/HELPTEXT
CREDITS=$(BUILDDIR)/CREDITS
GAMEHELP=$(BUILDDIR)/GAMEHELP
GAMEHELP.COMPRESSED=$(BUILDDIR)/GAMEHELP.COMPRESSED
GAMES.CONF=$(BUILDDIR)/GAMES.CONF
GAMES.SORTED=$(BUILDDIR)/GAMES.SORTED
PREFS.CONF=$(BUILDDIR)/PREFS.CONF
@@ -163,6 +164,11 @@ $(GAMEHELP): $(GAMEHELP.SOURCES) | $(MD)
$(PARALLEL) 'bin/converthelp.sh "{}" "$@/{/}"' ::: res/GAMEHELP/*
@touch "$@"
$(GAMEHELP.COMPRESSED): $(GAMEHELP) | $(MD)
mkdir -p "$@"
$(PARALLEL) '[ -f "$@/{/}" ] || ${EXOMIZER} "{}"@0x0900 -o "$@/{/}"' ::: "$(GAMEHELP)"/*
@touch "$@"
# precompute binary data structures for slideshow configuration files
$(SS): $(SS.SOURCES) | $(MD) $(GAMES.CONF)
mkdir -p "$@"
@@ -218,7 +224,7 @@ $(TITLE.HGR.LIST): $(TITLE.HGR.SOURCES) | $(MD)
$(TITLE.DHGR.LIST): $(TITLE.DHGR.SOURCES) | $(MD)
(cd res/TITLE.DHGR/ && for f in *; do echo "$$f"; done) > "$@"
$(TOTAL.DATA): $(FX) $(PRELAUNCH) $(DEMO) $(SS) $(X) $(ATTRACT) $(ATTRACT.IDX) $(HELPTEXT) $(CREDITS) $(GAMEHELP) $(GAMES.CONF) $(GAMES.SORTED) $(ACTION.HGR0.LIST) $(ACTION.HGR1.LIST) $(ACTION.HGR2.LIST) $(ACTION.HGR3.LIST) $(ACTION.HGR4.LIST) $(ACTION.HGR5.LIST) $(ACTION.HGR6.LIST) $(ACTION.DGR.LIST) $(ACTION.DHGR.LIST) $(ACTION.GR.LIST) $(ARTWORK.SHR.LIST) $(TITLE.DHGR.LIST) $(TITLE.HGR.LIST) $(CACHE.SOURCES) $(ATTRACT.CONF) $(DFX.CONF) $(FX.CONF) $(SFX.CONF) $(COVER) $(HELP) $(JOYSTICK) $(TITLE)
$(TOTAL.DATA): $(FX) $(PRELAUNCH) $(DEMO) $(SS) $(X) $(ATTRACT) $(ATTRACT.IDX) $(HELPTEXT) $(CREDITS) $(GAMEHELP.COMPRESSED) $(GAMES.CONF) $(GAMES.SORTED) $(ACTION.HGR0.LIST) $(ACTION.HGR1.LIST) $(ACTION.HGR2.LIST) $(ACTION.HGR3.LIST) $(ACTION.HGR4.LIST) $(ACTION.HGR5.LIST) $(ACTION.HGR6.LIST) $(ACTION.DGR.LIST) $(ACTION.DHGR.LIST) $(ACTION.GR.LIST) $(ARTWORK.SHR.LIST) $(TITLE.DHGR.LIST) $(TITLE.HGR.LIST) $(CACHE.SOURCES) $(ATTRACT.CONF) $(DFX.CONF) $(FX.CONF) $(SFX.CONF) $(COVER) $(HELP) $(JOYSTICK) $(TITLE)
#
# precompute indexed files for prelaunch
# note: prelaunch must be first in TOTAL.DATA due to a hack in LoadStandardPrelaunch
@@ -240,9 +246,9 @@ $(TOTAL.DATA): $(FX) $(PRELAUNCH) $(DEMO) $(SS) $(X) $(ATTRACT) $(ATTRACT.IDX) $
"$(HELP)" src/index/res.help.idx.a
#
# precompute indexed files for game help
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
# note: these can not be padded because they are compressed and the decompressor needs the exact size
#
bin/buildindexedfile.py -p "$@" "$(GAMEHELP)" < "$(GAMES.SORTED)" > "$(BUILDDIR)"/GAMEHELP.IDX
bin/buildindexedfile.py "$@" "$(GAMEHELP.COMPRESSED)" < "$(GAMES.SORTED)" > "$(BUILDDIR)"/GAMEHELP.IDX
#
# precompute indexed files for slideshows
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able

View File

@@ -4,10 +4,11 @@
; Exomizer glue functions
;
; Public functions
; - DecompressAuxSHR
; - DecompressGameHelp
; - DecompressSHR
; - DecompressHGR
; - DecompressAuxSHR
; - DecompressDHGR
; - DecompressHGR
; - DecompressAfterLoad
; - ResumeAuxDecompress
;
@@ -15,6 +16,20 @@
kDecompressInMainMem = 0
kDecompressInAuxMem = 1
;------------------------------------------------------------------------------
; DecompressGameHelp
;
; in: compressed game help data at $08F8/main
; file size in sizelo2/sizehi2 as set by ProRWTS2
; out: decompressed game help data at $0900+/main
; also see notes in DecompressAfterLoad
;------------------------------------------------------------------------------
DecompressGameHelp
clv ; V=0 -> always complete decompression
ldx #kDecompressInMainMem ; data is in mainmem
lda #$08 ; target address (hi) -1
bne DecompressAfterLoad ; always branches
;------------------------------------------------------------------------------
; DecompressSHR
;
@@ -84,8 +99,8 @@ DecompressHGR
; in: A = target address (hi) minus 1
; X = 0 if data is in mainmem
; X = 1 if data is in auxmem
; V = 1 if decompression should exit early on keypress (even if incomplete)
; V = 0 if decompression should always run to completion (ignoring keypresses)
; V = 1 if decompression should exit early on keypress (even if incomplete)
; file size in sizelo2/sizehi2 as set by ProRWTS2
; out: decompressed data at target address
; /!\ 8 bytes before target address will be clobbered because compressed

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16150469
!be24 16099979
!le16 5225

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16088079
!be24 16037589
!le16 5807

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16018949
!be24 15968459
!le16 4264

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16033812
!be24 15983322
!le16 4728

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16052789
!be24 16002299
!le16 5698

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16074125
!be24 16023635
!le16 6279

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16155694
!be24 16105204
!le16 410

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16156448
!be24 16105958
!le16 449

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16093886
!be24 16043396
!le16 1757

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16102716
!be24 16052226
!le16 1640

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16156180
!be24 16105690
!le16 67

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16150426
!be24 16099936
!le16 43

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16148762
!be24 16098272
!le16 1510

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16133424
!be24 16082934
!le16 590

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16100076
!be24 16049586
!le16 2640

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16104714
!be24 16054224
!le16 246

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16104960
!be24 16054470
!le16 538

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16105498
!be24 16055008
!le16 7675

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16156104
!be24 16105614
!le16 76

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16150272
!be24 16099782
!le16 154

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16156247
!be24 16105757
!le16 201

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16134014
!be24 16083524
!le16 4352

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16138366
!be24 16087876
!le16 1733

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16140099
!be24 16089609
!le16 1194

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16141293
!be24 16090803
!le16 3454

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16144747
!be24 16094257
!le16 3484

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16148231
!be24 16097741
!le16 404

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16148635
!be24 16098145
!le16 127

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16156897
!be24 16106407
!le16 2370

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16118578
!be24 16068088
!le16 5177

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16123755
!be24 16073265
!le16 2502

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16080404
!be24 16029914
!le16 7675

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16009291
!be24 15958801
!le16 9658

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16023213
!be24 15972723
!le16 10599

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16038540
!be24 15988050
!le16 14249

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16058487
!be24 16007997
!le16 15638

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16104356
!be24 16053866
!le16 358

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16113173
!be24 16062683
!le16 5405

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16126257
!be24 16075767
!le16 7167

View File

@@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 16095643
!be24 16045153
!le16 4433

View File

@@ -30,15 +30,15 @@ Help
+ST16 @indexRecordPtr
jsr LoadIndexedFile
!word $800
!word $8F8
@indexRecordPtr
!word $FDFD ; SMC
clc
bcc .clearAndDisplayHelp ; always branches
jsr DecompressGameHelp
jmp .clearAndDisplayHelp
@global jsr LoadIndexedFile ; load help text into $800
!word $800
@global jsr LoadIndexedFile ; load help text into $900
!word $900
!word kHelpTextRecord
jsr LoadHelpOffscreen ; load fancy backdrop
@@ -54,8 +54,8 @@ Help
; all other flags and registers clobbered
;------------------------------------------------------------------------------
Credits
jsr LoadIndexedFile ; load credits text into $800
!word $800
jsr LoadIndexedFile ; load credits text into $900
!word $900
!word kCreditsRecord
.clearAndDisplayHelp
jsr ForceHGRMode
@@ -63,8 +63,8 @@ Credits
ldx #0 ; left margin (0 for credits, different for global help)
.displayHelp
lda OffscreenPage
ror ; draw on offscreen page
+LDADDR $800
ror ; set C to draw on offscreen page
+LDADDR $900
+ST16 PTR
;DrawPage inlined here
;