RPGHacker/asar

Asar doesn't generate checksum for ROM if part of it was assembled in norom

Closed this issue · 3 comments

else if (is0("norom"))
{
//$000000 would be the best snespos for this, but I don't care
mapper=norom;
//fastrom=false;
checksum=false;//we don't know where the header is, so don't set the checksum
}

This disables generating the checksum, but it is never reset when changing to a different mapper, so a checksum is never output for ROMs that switch to norom for writing some large data (like my homebrew), but switch back to lorom/hirom later.

I'm not quite sure how to best solve this. I think not automatically reenabling the checksum fixer can be a good idea in some cases. Even if the last mapping in some code is lorom, it still doesn't necessarily mean that the entire ROM has to be lorom and that the checksum location is known. Maybe a better idea here would be to let users enable or disable checksum fixing as needed? Either via a command line argument or via a command in Asar, not quite sure what's best.

I'd be in favor of a new command here. Ideally checksum off to explicitly disable checksum generation, and checksum on to explicitly enable checksum generation using the last mapper active in the patch. Ideally these should override the automatic mapper-based detection, so checksum on at the start of a file, then norom in the middle, and then lorom at the end would still generate a checksum.

Sounds like a good idea to me.