News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - patrickmollohan

Pages: [1]
Newcomer's Board / Re: NES Mapper Conversion
« on: March 03, 2020, 02:50:14 pm »
Gotcha, that makes more sense now. Thanks for the clarification of that (and of course for being very patient with me throughout this process)! Should the bad news be the end of this project, I feel like I learned quite a bit already thanks to you.
I do have the games as individual ROMs and confirmed they are MMC3 (mapper 4) and NROM (mapper 0), at least based on their iNES headers. I have also reached out to the source of where I got them from for any potential verification on the matter. However, the games seem to have no issues in emulators. Using Super Mario Bros. as an example of NROM and Dragon Power as an example of GNROM, I changed the mappers of each game to 0, 3, 4, 5, 6, 9, and 66 (numbers selected for no reason in particular) in the iNES header and ran the modified games to see the results. Dragon Power only would display a blank screen on the mappers aside from 66, whereas Super Mario Bros. would still be playable on all of the above, with some minor corruption in a couple of the mappers and fairly major corruption on mapper 9. The games listed as NROM behave exactly the same as Super Mario Bros, and not as Dragon Power. Not saying you or the wiki is wrong by any means, just my observations in the spare time I've had today.
Yeah this project sounds dead, unfortunately. I'm assuming this is less about the games individually and more about how they were stored/swapped. From my source:
That is probably the worst ROM for starting to learn mapper conversion, because mapper 534 has quite a few obfuscatory aspects to it. The "GNROM" term used on the mapper 534 wiki page should be more understood to be "GNROM-like" rather than actual GNROM. Mapper 534 has GNROM-like functionality, meaning that the fixed bank at $E000-$FFFF is overcome by making MMC regs 6 and 7 apply both to $8000-$BFFF and $C000-$FFFF, as described before the "Note" on that wiki page. (In addition, there is also the outer bank register that can switch 128 KiB or 256 KiB PRG, which *also* affects the fixed bank.) The best way to understand this is to make some kind of truth table that tells you which address bit will come from which register (MMC3, mapper outer bank, CPU) depending on the CPU and mapper outer bank mode bits.

The problem with converting this thing to mapper 52 is that mapper 52 has no such GNROM-like functionality, so it's an unsuitable choice for a conversion's target mapper number.
Being realistic, this is sounding beyond my capabilities at this point, even with my hand held. Bit bummed about that, but at least I did learn quite a bit, and perhaps others can as well. At some point, I shall revisit this when I have more knowledge and experience; maybe it would be possible to recreate the menu with a more appropriate mapper. In any case, thank you very much, Disch, for all the knowledge you've shared with myself and everyone here! I hope to still make use of it, just perhaps with a different project.

Newcomer's Board / Re: NES Mapper Conversion
« on: March 03, 2020, 01:05:38 am »
Right! I was debating on whether that was the case or not earlier, but I saw the graphics were slightly fixed and figured I was simply second-guessing myself. Alright, back to the drawingboard I go.
Adding bytes can be tough because you'll have to figure out a way to get some free space.  And that.... well.... that might not be easy.
So as I was typing the reply to this, I doublechecked the code. There are several lines of FF/Undefined in the code immediately after the RTS in the code section I posted above. Shifted the STA and RTS operations down, inserted the EOR, and what do you know? IT WORKED! The menu is perfect! I still might try the other way you mentioned (for practice and to save an EOR operation), but that is still a result.
Now on with the game selection. I will probably continue this tomorrow/throughout the week, but I did give it a try as I was waiting for the mods to approve my post. Wasn't successful yet in getting the individual games to boot. I noticed the ROM writes to two of the mapper's registers at $6800 and $6803, no writes to $6801 or $6802. However, I think in addition to mixing up the immediate and zero page modes again, I was also a touch confused on the information on those registers. The wiki mentions
Mask: $E803

D~7654 3210
Does this denote that the value that gets written to $6800/$6803 is inverted? And where does the mask come in play? I set a breakpoint for any reads/writes/executes to that address, and yet nothing happened. Also the line is seemingly missing from the debugger, as in ROM and RAM, it is the second byte of an operation, and not an operation itself.
The chunk of code when selecting "Adventure" looks like this
Code: [Select]
LDA #$00
STA $0000 = #$00
LDA $0418 = #$E1
STA $6800 = #$E1
LDA $041B = #$97
STA $6803 = #$97

Newcomer's Board / Re: NES Mapper Conversion
« on: March 02, 2020, 02:48:01 pm »
No, JSRs are going to be everywhere in the game.  Just looking for JSRs will get you nowhere.
Oh, okay, yeah I get what you mean. I figured that if it happened towards the beginning of the game, it might be helpful to take a look at the first few JSRs or so, but that makes sense now looking at the debugger.
I do have some progress! According to the Nesdev page for mapper 534, in regards to the $8000-$FFFF range,
These registers function identically to a normal MMC3, except that the scanline counter latch register ($C000) takes the inverted value (XOR $FF) compared to a regular MMC3.
So I set a breakpoint for any writes to $C000 and got the following section of code:
Code: [Select]
LDY #$00
LDA $0040
STA ($43),Y @ $C000 = #$9B
STA ($49),Y @ $C001 = #$00
STA ($45),Y @ $E001 = #$D8
I changed the $0040 to $00BF (which is 40 XOR FF), and now there is less corruption on the menu screen. However, it now doesn't display the top part of the screen correctly.
This is what it used to look like by simply changing the mapper in the iNES header:

And after modifying the value:

I feel like this could be progress, although the "Atari Flashback" logo is now corrupted whereas it wasn't before. Based on my understanding of the $C001 and $E001 registers, it shouldn't matter that I changed the value of A since writing any value to $C001 reloads the IRQ counter and writing any value to $E001 enables interrupts, so nothing should have changed functionally. There doesn't seem to be any further writes to $C000 (though I am still new to the debugger, so maybe there is and I'm not using it properly), but there are reads from $C000 such as
Code: [Select]
LDA ($08),Y @ $C000 = #$9B
Will I need to XOR those as well to fix the logo?
Also, when opening the unmodified ROM in NintendulatorNRS and looking at the PPU viewer, it shows the exact some corruption:

Newcomer's Board / Re: NES Mapper Conversion
« on: February 29, 2020, 11:49:22 am »
Disch, thank you very much for your reply; this is valuable information and I appreciate the time you took to write it all. This does sound like it'll take a bit of effort, but I think I now have a better understanding of what is involved and it doesn't seem like it'll be as difficult as I initially imagined. I think I might attempt a mapper conversion on a game with a simple mapper first, maybe one that already has a mapper conversion so I can double-check my work.
IE, whenever the game wants to swap, it will jump to a common subroutine --- so you really only need to change that one subroutine in order to change swapping for the entire game.
So would looking for JSR operations be a good place to start in terms of finding these mapper interactions?
Also, I am glad to hear the multicart conversion should be much simpler. Would it matter if the individual games are a mix of MMC3 and NROM?
Cyneprepou4uk, thank you for the link. It is an excellent resource to have on hand!

Newcomer's Board / NES Mapper Conversion
« on: February 27, 2020, 10:44:48 pm »
I have acquired an MMC3-based multicart NES ROM that uses a rather obscure mapper (534) and would like to convert it to a more common mapper for use with other emulators. As I am new to ROM hacking in general, a mapper conversion may not be the best place to start learning, but I would love to figure it out anyway.
With this particular ROM, I edited the iNES header to test other MMC3 multicart mappers. I found that mapper 52, which is supported by most emulators, at least somewhat works (although the menu graphics are slightly glitchy, and the individual games are very corrupted). However, in comparison to the other mappers I've tried, this is a much better start, as the others either don't boot at all, or will boot into one of the individual games (with corrupted graphics) as opposed to the menu like it should. Am I at least on the right track to figuring out what mapper to convert to? I assume I wouldn't be able to patch it to straight MMC3 for better compatibility, correct?
After the appropriate mapper is selected, what is the next step in the process? I have opened the original and modified ROM in FCEUX in order to view the debugger, but mapper 534 is not supported in the emulator (and thus produces nothing useful in the debugger), and I'm not sure if it is okay to view the debugger with just the iNES header changed. If it is, what would I be looking for to fully patch the game? What are the steps involved with this process?
Finally, although I have searched high and low, I could not find any tutorials on mapper conversions, but I would greatly appreciate any general tutorials, advice, tips, etc. on the subject. Anything at all would be really useful!
Thank you for your time!

Pages: [1]