mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-26 04:33:10 +00:00
Don't pack titles that have animations (#435)
This commit is contained in:
parent
e838074cee
commit
6c253f1b6d
@ -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)
|
||||
|
BIN
res/TITLE.HGR/S2
BIN
res/TITLE.HGR/S2
Binary file not shown.
Binary file not shown.
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user