Don't pack titles that have animations (#435)

This commit is contained in:
Tom Greene 2021-11-12 20:52:25 -05:00 committed by GitHub
parent e838074cee
commit 6c253f1b6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 6 deletions

View File

@ -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)

Binary file not shown.

Binary file not shown.

View File

@ -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