TeamShinkansen / Hakchi2-CE

Tool that allows you to add more games to your NES/SNES Classic Mini
https://discord.gg/UUvqsAR
GNU General Public License v3.0
1.22k stars 114 forks source link

Excitebike rom corruption after extraction #407

Closed ifohancroft closed 3 years ago

ifohancroft commented 3 years ago

Describe the bug
I have used Hakchi to dump kernel, nand and system software. Then I have mounted (I can't remember which of those images) and copied the game roms from there.

All the game roms work on an NES emulator out of the box, except for Excitebike. I had to remove some bytes from the file to make it work.

I am not entirely sure if this is a bug with Hakchi that causes the dump to corrupt the rom (seems a highly specific corruption) but I thought it's worth reporting just in-case. I don't know if I can legally share the Excitebike unfixed rom to show you or if I should just share the bytes I had to remove and their locations in the binary? Let me know.

KMFDManic commented 3 years ago

@ifohancroft Hakchi generally does not have much to with the roms that do or do not run on the default emulator. There are No Intro and Good Sets. Using the wrong rom will cause certain games to have issues. Excitebike works absolutely fine on Fceumm and Nestopia. On default emulator, if on NES Classic, depending on how you add it, or what rom it is, it may not work. Do file, add, as is, and use Fceumm or Nestopia, with retroarch also installed, for best results.

And, no, you can't legally share the rom. You may be dealing with a "header" issue, which would indicate you may be using a good set rom. I'd suggest trying a no intro one.

ifohancroft commented 3 years ago

@ifohancroft Hakchi generally does not have much to with the roms that do or do not run on the default emulator. There are No Intro and Good Sets. Using the wrong rom will cause certain games to have issues. Excitebike works absolutely fine on Fceumm and Nestopia. On default emulator, if on NES Classic, depending on how you add it, or what rom it is, it may not work. Do file, add, as is, and use Fceumm or Nestopia, with retroarch also installed, for best results.

And, no, you can't legally share the rom. You may be dealing with a "header" issue, which would indicate you may be using a good set rom. I'd suggest trying a no intro one.

Just to clarify, I am testing the rom on PC with FCEUX. My point (and the reason for reporting this here) was in the off-chance that the fact the rom isn't playable out of the box has something to do with a bug in Hakchi about dumping the system files. So I thought it's worth reporting/giving you a heads up about it, in-case you didn't know.

KMFDManic commented 3 years ago

@ifohancroft To better clarify, hakchi has zero to do with the actual emulation of any given game. It is merely a front end, which helps run the actual emulators that play these games. Corruption is not possible on a valid rom, when adding to hakchi. BUT, if you are using a game that has a "header" in it, many of those will have issues, depending on the Core. In example, Bloody Wolf for TG-16 will NOT work, at all, if you run the version of the rom that has a header in it.

Headers are leftover remnants from the past, that used to be used in a lot of PC emulators. They are sorta buried infos that can be utilized by said emulators, to know specifics. Nowadays, emulators tend to do crc checks to verify an "exact" rom, to handle some fixes. Another example of this, if you run Fester's Quest for NES, with a header...the 3d stages will crash some emulators! Headers on some Game Boy Color games will have graphical glitches.

So, essentially, the proper way to run a "valid" rom, is make sure you remove the header (unless the game needs a specific patch, like translation, etc...where messing with header may potentially also screw up the integrity of the game, as a whole". Once the header is gone and not accounted for, if the emulator actually supports THAT specific rom set, then the game should function fine.

If running on NES Classic, with default emulator, MANY games will have issues, and/or not run properly, because mapper support is limited (meant for the default games that came with the system, most notably). If running with Fceumm or Nestopia, with hakchi, add file, as is, and that should retain the crc checks that are needed to ensure all is good.

As Is was an option I requested be added, which adds games, exactly as they stand. Adding an Arcade Game, such as Vs Castlevania...with auto detect...it will improperly add the game, as hakchi "thinks" it is a Mega Drive game, based on its .bin extension. There really is no easy way around this, other than the As Is Feature Addition.

So, again, hakchi does not actually handle any emulation. It is a matter of using the proper, "headerless" rom, with the appropriate emulator. Even Fceux may have issues with "headered" roms.

ifohancroft commented 3 years ago

@KMFDManic Very cool nickname btw!

Sorry, I should have explained better.

I am not tryig to play anything on the NES Classic. I am not trying to run an emulator via Hakchi.

I used Hakchi to dump everything from my stock/unmodified NES Classic. Then, on a PC, from those dumps I extracted the stock game roms and there is (not just at the beginning of the file) extra data in the Excitebike ROM that makes Fceux installed on a PC not playing it.

I was saying that there may be a bug in Hakchi's dumping of the NES Classic filesystem or something like that.

KMFDManic commented 3 years ago

@ifohancroft The reason you had issues with the rom is because it is not a known rom dump or proper redump. Usually, roms have to be accounted for within the mappers of any given emulator, pertaining to NES games. Out of all of the games on the default lineup, it seems that Nintendo used preexisting rom dumps for all of them, as they crc match up to known rom dumps! That is, except for Excitebike, which they did "some" custom patch to, which would explain your issues with them on the non default emulator. The "track creation" on the real game is broken, and is unable to be saved! It was a remnant from the famicom "disk" save accessory. But, on other regions, you could create tracks, but would lose them once you shut system off.

I think the patch Nintendo did was so that you COULD save the tracks on the NES Classic. Obviously, suspend states should retain those tracks, as well! But, in any case, the "header", "unsupported mapper", etc, issues, pretty much go hand in hand with byte removal, in the case of what you had to do. Hakchi itself does not change the actual games, and keeps them entirely intact.

Earlier in the Scene, when we analyzed the rom dumps, we definitely found they matched online, known ones, other than Excitebike, which was definitely a new rom!

This post is quite nice as far as explaining some of what I just said! Your extra byte is accounted for in this topic, too:)

http://nerdlypleasures.blogspot.com/2018/08/investigating-games-on-nes-famicom-and.html

What you did, however, is helpful, for people who do wanna try to stay legitimate and run the extracted games. SNES Classic is worse, as you have to jump through additional hoops, due to the "sound" being different! It is severely muffled or missing on several games, if attempting to run on non-default emulator!

impeeza commented 3 years ago

Uff this is great! thanks a lot for your effort and time.

ifohancroft commented 3 years ago

Thank you so much for taking the time to explain this! That explains so much! I had no idea this was the case.

KMFDManic commented 3 years ago

@ifohancroft now that you better understand the intricacies of how this was done, hope that clears your mind:) Let us know if you need anything else!