From 6c253f1b6d1d598ccc7b0710278a5b55164d5a07 Mon Sep 17 00:00:00 2001 From: Tom Greene Date: Fri, 12 Nov 2021 20:52:25 -0500 Subject: [PATCH] Don't pack titles that have animations (#435) --- bin/packhgrfile.py | 17 ++++++++++++----- res/TITLE.HGR/S2 | Bin 7680 -> 8192 bytes res/TITLE.HGR/SPARE.CHANGE | Bin 7680 -> 8192 bytes src/ui.offscreen.a | 12 +++++++++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/bin/packhgrfile.py b/bin/packhgrfile.py index 5c25f56b7..59480096f 100755 --- a/bin/packhgrfile.py +++ b/bin/packhgrfile.py @@ -8,12 +8,19 @@ i = open(infile,"rb") filedata = i.read() i.close -outdata = bytearray(filedata[0:7680]) +# If the file has a JMP in the last screen hole, the +# game has an animated title, skip packing and copy +# the file as is instead. +if(len(filedata) >= 8192 and filedata[8189] == 0x4c): + print (infile, "has animation, not packing") + outdata = bytearray(filedata[0:8192]) +else: + outdata = bytearray(filedata[0:7680]) -for h in range(60): - oh = h*128+120 - ih = h*8+7680+(int(h/15)*8) - outdata[oh:oh+8] = filedata[ih:ih+8] + for h in range(60): + oh = h*128+120 + ih = h*8+7680+(int(h/15)*8) + outdata[oh:oh+8] = filedata[ih:ih+8] o = open(outfile,"wb") o.write(outdata) diff --git a/res/TITLE.HGR/S2 b/res/TITLE.HGR/S2 index a2dee80e8be69058c9160997d4fcf7ec550753fc..be567a12c85da6cc1663d9ffda46676b5cb7a371 100644 GIT binary patch delta 747 zcmZ9K%}WA76u{M8x7GaI%yiAoLv@yt5(@GU2)y?J;;}=Nr$r22Q4pS5-!&tIK(>Pi zPjwI@qEldybcn!n$4*g)+SwUpXbv-v+4uX+n>P!qkUP^+R}`bV?{<(;bLz4kSQCPi ze4N9iYtvrqWEBE!Nhmo9g;jBPlwEW4q??fvBc*LD3qF*_N+SSa%sv~v@-DT>oXx}A zJj~{0Hg5qB1P@B%pEl_AF@cX0_<4b!2?Cq=6`#k8zy`SpNncqj%dk`<MX4i2-1IRJyV&inQ2@8dmykxwkC znews<>LNgn35#on`BJ@W8qK@YW9T`kvGl}WZ zOP=gRbb&gpLXT>vsdm~p-rj$!nn6!N!($VYW=KG^4AG<~x!R>941{QO9$!7PV# zezJk(B9>~6wNhwROlx)s_*+0kRvtq%kPC^*|hT8+{P`$ZC-BaYzlNX*WbP7h@y&geQfw^^JYw_d*Ed7(&W$PyjNKaN|3ZE#zzqy_16Z1p?zRm4y6^uaXw#ls= zAZ2}%+c=9Sua)83%+B?Nc_JUrW_G?3_K5=Ao7+UII3_o6DKIzuX`IMtH@T9HZ*o4D W#N>9VJCmzLxhL;p>1Xy~U+Y;GY0@e87&V0 diff --git a/src/ui.offscreen.a b/src/ui.offscreen.a index 28d62c853..dc29b379f 100644 --- a/src/ui.offscreen.a +++ b/src/ui.offscreen.a @@ -100,14 +100,24 @@ LoadGameTitleOffscreen jsr ForceHGRMode jsr GetOffscreenAddress sta @addrhi + + eor #$1F + sta @poke+2 + sta @peek+2 +@poke sta $3FFD ; SMC - clear screen hole before load + jsr LoadFile !word kHGRTitleDirectory @fname !word $FDFD ; SMC !byte $00 @addrhi !byte $FD ; SMC +@peek lda $3FFD ; SMC + cmp #$4C ; Check if screen hole now contains a JMP + beq + ; if so, file was not packed, so skip unpack jsr UnpackHGRTitle - rts ++ rts + @dhgr jsr BlankDHGR +LD16 @fname