mirror of
https://github.com/AngheloAlf/drmario64.git
synced 2024-11-23 13:09:46 +00:00
Remove cn hack on checksummer
This commit is contained in:
parent
2dd68365e4
commit
81126c77f0
4
Makefile
4
Makefile
@ -313,11 +313,11 @@ tidy:
|
||||
|
||||
$(ROM): $(ELF)
|
||||
$(OBJCOPY) -O binary $< $(@:.z64=.bin)
|
||||
$(CHECKSUMMER) $(@:.z64=.bin) $@ $(VERSION)
|
||||
$(CHECKSUMMER) $(@:.z64=.bin) $@
|
||||
|
||||
$(ROMC): $(ROM) tools/compressor/compress_segments.$(VERSION).csv
|
||||
$(ROM_COMPRESSOR) $(ROM) $(ROMC:.z64=.bin) $(ELF) tools/compressor/compress_segments.$(VERSION).csv $(VERSION)
|
||||
$(CHECKSUMMER) $(ROMC:.z64=.bin) $@ $(VERSION)
|
||||
$(CHECKSUMMER) $(ROMC:.z64=.bin) $@
|
||||
|
||||
$(ELF): $(LINKER_SCRIPTS)
|
||||
$(LD) $(ENDIAN) $(LDFLAGS) -Map $(LD_MAP) $(foreach ld, $(LINKER_SCRIPTS), -T $(ld)) -o $@ $(filter %.o, $^)
|
||||
|
@ -23,7 +23,7 @@ def eprint(*args, **kwargs):
|
||||
print(*args, file=sys.stderr, **kwargs)
|
||||
|
||||
|
||||
def updateChecksum(romBytes: bytearray, version: str, forceChecksum: bool):
|
||||
def updateChecksum(romBytes: bytearray):
|
||||
# Detect CIC
|
||||
cicKind = ipl3checksum.detectCIC(romBytes)
|
||||
if cicKind is None:
|
||||
@ -37,13 +37,6 @@ def updateChecksum(romBytes: bytearray, version: str, forceChecksum: bool):
|
||||
printDebug(f"checksum1: {calculatedChecksum[0]:X}")
|
||||
printDebug(f"checksum2: {calculatedChecksum[1]:X}")
|
||||
|
||||
if version == "cn":
|
||||
# cn has a garbage checksum value, so we just use the orignal one instead of a calculated one
|
||||
if not forceChecksum:
|
||||
printDebug(f"Not updating checksum on cn")
|
||||
return
|
||||
printDebug(f"Updating checksum on cn")
|
||||
|
||||
# Write checksum
|
||||
struct.pack_into(f">II", romBytes, 0x10, calculatedChecksum[0], calculatedChecksum[1])
|
||||
|
||||
@ -53,16 +46,12 @@ def updaterMain():
|
||||
|
||||
parser.add_argument("in_rom", help="input rom filename")
|
||||
parser.add_argument("out_rom", help="output rom filename")
|
||||
parser.add_argument("version", help="version to process")
|
||||
parser.add_argument("-d", "--debug", help="Enable debug prints", action="store_true")
|
||||
parser.add_argument("-c", "--checksum", help="Force always updating the checksum header", action="store_true")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
inPath = Path(args.in_rom)
|
||||
outPath = Path(args.out_rom)
|
||||
version = args.version
|
||||
forceChecksum: bool = args.checksum
|
||||
|
||||
global DEBUGGING
|
||||
DEBUGGING = args.debug
|
||||
@ -72,7 +61,7 @@ def updaterMain():
|
||||
|
||||
romBytes = bytearray(inPath.read_bytes())
|
||||
|
||||
updateChecksum(romBytes, version, forceChecksum)
|
||||
updateChecksum(romBytes)
|
||||
|
||||
outPath.parent.mkdir(parents=True, exist_ok=True)
|
||||
outPath.write_bytes(romBytes)
|
||||
|
Loading…
Reference in New Issue
Block a user