Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Question on .patch files #2

Open
Dark-Jaguar opened this issue Apr 30, 2024 · 4 comments
Open

Question on .patch files #2

Dark-Jaguar opened this issue Apr 30, 2024 · 4 comments

Comments

@Dark-Jaguar
Copy link

I'm currently ripping some very special ROMs off my 3DS, and one of those happens to be Donkey Kong Original Edition, the official... rom hack of NES Donkey Kong. I noticed my own copy says "2010" on the boot screen while the ROM I've downloaded... elsewhere... shows 2008.

I used your script to convert the file's header properly, and it boots fine on both emulator and Everdrive, but oddly it reverts back to 2008 like the other ROMs online. There's another file I found in the title's folder though with the same name as the game's rom, but with a .patch extension. Is this an IPS patch by any chance? I'm mainly curious if Nintendo's own emulator is live-patching the game with this file to alter the title screen and... whatever else it might be doing. If so, would this be something I could simply apply with an IPS patching tool to the ROM and get that specific revision?

Sorry to bother with so many "ifs" in my question, but I wasn't sure who else to ask on something like this.

@win9x-se
Copy link

win9x-se commented May 2, 2024

Alright, kiddo! Imagine you have this super cool toy - let's call it a game. You love playing it every day, but sometimes there are these tiny bugs, like little gremlins that sneak into your game and cause trouble. But no worries! The folks who made your game want you to have the best time ever, so they send you updates, just like when you get a new puzzle piece to fix things up.

Now, picture your 3DS as a magical box that holds all your games. When you turn it on and connect it to the internet, it can talk to the game makers and find out if there are any new updates. If there are, your 3DS says, "Hey, I want that update!" and the game makers send it over.

But here's the fun part: when the update arrives, it's like a superhero swooping in to save the day! It finds those pesky bugs and squashes them so they can't bother you anymore. Then, your game is even better than before! It's like giving your toy a tune-up so it runs smoother and faster.

So, in simple terms, your 3DS live patches a file because it wants to make sure your games are as awesome as can be, fixing any hiccups along the way, just like how grown-ups fix things for you when you need help! Cool, huh?

@Dark-Jaguar
Copy link
Author

I wasn't trying to sound like an idiot but I suppose I came across that way? I apologize for miscommunication on my part. To be clear, I'm aware of what patches are, but I'm asking for a specific case here, which is exactly how the patch files in these 3DS virtual console games are applied, as an IPS modification to the ROM, or perhaps something higher level that only the emulator deals with. That's what I was hoping to get at here.

@Validusername16
Copy link

Had a chance to look into this. It's not a specific type of generic patch format, it's a proprietary plaintext file for the emulator to parse to apply patches to the ROM/RAM on the fly. For Donkey Kong Original Edition it seems to make three patches, A single byte patch to ROM called "PlayerII I" which I couldn't immediately figure out the purpose of, a RAM patch called "Fix Value" that I also couldn't figure out, and a ROM patch called "Copy Right" that seems to be what you're interested in. It has a "Mode" which I assume is determining whether it's a ROM patch or a type of RAM patch, the address to write to, and FixCode which seems to be the bytes to write along with a hex value I'm unsure of the purpose of. Either way, copying the string of bytes there over address 0x12B does overwrite the copyright string with the 1983-2010 version, which seems to be what you're looking to do.

@Dark-Jaguar
Copy link
Author

Dark-Jaguar commented May 6, 2024

Thank you very much for all this! Now I'm a bit curious what RAM values they saw fit to alter and why, but not to the extent I'd ask anyone to dig into that. The key thing is the one immediately visible difference appears to be applied in a rather convoluted way rather than IPS or UPS or any of the standard formats. What you've told me does give me the tools to apply it myself, but frankly all things considered, it's probably not worth it. What's more valuable to me is the learning experience this was, and I thank you for looking into this!

Just a random guess, but the two values it's "fixing" may well have something to do with how the virtual console emulator handles multiplayer code. It may be doing this to keep the game "on hold" on one console while the other player is taking their turn. No clue how accurate that is, just some dull intuition on my part.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants