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 a2dee80e8..be567a12c 100644 Binary files a/res/TITLE.HGR/S2 and b/res/TITLE.HGR/S2 differ diff --git a/res/TITLE.HGR/SPARE.CHANGE b/res/TITLE.HGR/SPARE.CHANGE index 117b7d25a..10db29036 100644 Binary files a/res/TITLE.HGR/SPARE.CHANGE and b/res/TITLE.HGR/SPARE.CHANGE differ 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