mirror of
https://github.com/a2-4am/4cade.git
synced 2025-02-17 22:30:44 +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()
|
filedata = i.read()
|
||||||
i.close
|
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):
|
for h in range(60):
|
||||||
oh = h*128+120
|
oh = h*128+120
|
||||||
ih = h*8+7680+(int(h/15)*8)
|
ih = h*8+7680+(int(h/15)*8)
|
||||||
outdata[oh:oh+8] = filedata[ih:ih+8]
|
outdata[oh:oh+8] = filedata[ih:ih+8]
|
||||||
|
|
||||||
o = open(outfile,"wb")
|
o = open(outfile,"wb")
|
||||||
o.write(outdata)
|
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 ForceHGRMode
|
||||||
jsr GetOffscreenAddress
|
jsr GetOffscreenAddress
|
||||||
sta @addrhi
|
sta @addrhi
|
||||||
|
|
||||||
|
eor #$1F
|
||||||
|
sta @poke+2
|
||||||
|
sta @peek+2
|
||||||
|
@poke sta $3FFD ; SMC - clear screen hole before load
|
||||||
|
|
||||||
jsr LoadFile
|
jsr LoadFile
|
||||||
!word kHGRTitleDirectory
|
!word kHGRTitleDirectory
|
||||||
@fname !word $FDFD ; SMC
|
@fname !word $FDFD ; SMC
|
||||||
!byte $00
|
!byte $00
|
||||||
@addrhi !byte $FD ; SMC
|
@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
|
jsr UnpackHGRTitle
|
||||||
rts
|
+ rts
|
||||||
|
|
||||||
@dhgr
|
@dhgr
|
||||||
jsr BlankDHGR
|
jsr BlankDHGR
|
||||||
+LD16 @fname
|
+LD16 @fname
|
||||||
|
Loading…
x
Reference in New Issue
Block a user