Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining custom_overlay.narc with another modded narc? (SoulSilver) #13

Open
RottingCrow opened this issue May 10, 2024 · 4 comments
Open

Comments

@RottingCrow
Copy link

RottingCrow commented May 10, 2024

Hello again!
I'm trying to patch this mod over soothing silver. After a crap ton of trial and error, I've found the build script does work on the vanilla soul silver rom I'm using and most files can be manually patched without any conflict. The only issue is the 0.bin in the custom_overlay (a/0/2/8) narc. Both mods use the space in that narc for some form of code. I assume the exact offsets of the code is important for everything to work, so my question is which files in the build folder would I need to change the offsets in to attempt to get this to work?

Edit for clarity: I'm going to combine both 0.bin files from the extracted narc, just moving the code from this mod to be after the other one. I want to change any offsets that point to the code in the narc to match the new offsets so everything has the possibility of functioning

@TheGag96
Copy link
Owner

I've found the build script does work on the vanilla soul silver rom I'm using and most files can be manually patched without any conflict

Is that so?? Note that my build script isn't checking the source bytes for being what's expected - it just writes bytes, so finishing without error isn't necessarily a sign of success. I don't know myself whether the code in HG and SS is identical. Let me know how it goes.

However, for inserting this mod into an already-made synthetic overlay, the way I set up my code and build script in this repo is not doing you any favors... You'd have to carefully add an offset to all of the insertion locations and hardcoded addresses in the source files yourself. But, some time ago, I was actually trying to make a tool that would actually help you accomplish exactly what you're wanting called nitromods. It's able to unpack a ROM, assemble code organized into "mods", and insert it all for you dynamically. In theory, you'd be able to have it handle an already-existing synthetic overlay by searching for free space, though I haven't done that in a generic way yet. Maybe I should try to beef this thing up...

As a test, I had ported the code portion of the Platinum version of this mod to work with nitromods. Give me some time and I'll see if I can make all this easier for you (and others). (Or, you can try the manual way in the meantime.)

@RottingCrow
Copy link
Author

Is that so?? Note that my build script isn't checking the source bytes for being what's expected - it just writes bytes, so finishing without error isn't necessarily a sign of success. I don't know myself whether the code in HG and SS is identical. Let me know how it goes.

I did run the patched SS rom and up to the starter choice it ran well and produced color variations. I didn't move past that starter choice so there could be errors/glitches later, but I'll burn that bridge when I get to it.

As a test, I had ported the code portion of the Platinum version of this mod to work with nitromods. Give me some time and I'll see if I can make all this easier for you (and others). (Or, you can try the manual way in the meantime.)

Awesome! I'll probably mess around with nitromods in the mean time too to see if I can get anything to work. Thank you so much for all of your help!

@RottingCrow
Copy link
Author

Managed to patch it by changing the offsets in the build scripts and using the custom overlay from soothing silver as the temp overlay file. Adding extra bytes to the file and putting the code for this mod at the end got it to work for me. Everything was offset by x16000 so the new offsets just had 23C8xxx changed to 23DExxx. Managed to get to starter selection without crashing + starters produced color variation!! Again, might have errors or glitches later on, but for now this is a win! Should I close the issue since I managed to create a patch, or do you want to keep it open for creating a nitromods port that others may use?

@TheGag96
Copy link
Owner

Nicely done! I'll keep this open - I'll try to get a nitromods port uploaded somehow soon.

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

No branches or pull requests

2 participants