Program Mapper Change

DLN-003

New member
Is it possible to change which mapper NESMaker uses? I'd like to change it to mapper SUNSOFT5B, but I'm not entirely sure how. I'd settle for FME-7, but I'd prefer 5B for the expansion sound. If anyone knows how to do this, help would be appreciated.
 

Orgia Mode

New member
In my opinion, any mapper other than 030 will be very unlikely and I don't think it will ever happen from what I understand, it would require a major overhaul of the entire program Not to mention the sound engine is pretty bare bones at it's current.
 

RadJunk

Administrator
Staff member
Sure you can! It's easy to change the mapper number, in the header settings...

….and then you have to change the way that banks are set up.
...and the way that data loads.
...and the way bank swaps happen.
...and the way graphics are stored, if it doesn't support RAM.
...basically, write an entirely different engine that won't work with the way NESmaker's front end is set up.

Mapper 30 is probably the most versatile, easy to work with mapper that exists, which is why we picked it specifically. :)
 

Mihoshi20

Member
When one says 'mapper' they're basically talking about the memory management hardware in the NES carts used to help map the program RAM and ROM and work around the NES' limitations. It's not nearly as easy as simply flipping a switch. UxROM, that is UNROM and UOROM use discrete logic from common off the shelf parts while other memory managing chips were custom/proprietary chips and though some of them have been reverse engineered and duplicated for cart reproduction, many have not. Many have been well documented though, least enough to where emulators can mimic them in software.

UNROM-512 assigned as iNES mapper30 is remarkably close to UNROM/Mapper 2, it only needs a couple more chips for the extra banks to function. One could take a standard UNROM game say for instance Castlevania and convert it to a NESmaker game with little effort aside from rudimentary electronics skills. Many emulators and even real hardware will function just fine by simply swapping the iNES header from Mapper 30 to Mapper 2. The PowerPak will do this without issues which is what I use and Mesen. FCEUX however will bawk at the change and throw up a gray screen but it's not an emulator known for it's hardware accuracy it's used more for it's easy to use debug tools which most I enjoy more then Mesen which is better for it's more robust debugger and memory watcher.
 

NAveryW

New member
Quoting from another thread:
chronosv2 said:
Apparently you can modify a ROM's header somehow to make it Mapper 2 (which runs fine in less advanced emulators) but you cut out some of NESMaker's features (Animated tiles and savegame support) and it's a nasty, messy progress you have to do by hand and won't be able to get any support for.
Plenty of NES games used a password-based save system so the limitation doesn't sound too bad to me at all in exchange for making the game more easily portable and playable on more emulators. Is the modification process documented anywhere?
 

Mihoshi20

Member
NAveryW said:
Quoting from another thread:
chronosv2 said:
Apparently you can modify a ROM's header somehow to make it Mapper 2 (which runs fine in less advanced emulators) but you cut out some of NESMaker's features (Animated tiles and savegame support) and it's a nasty, messy progress you have to do by hand and won't be able to get any support for.
Plenty of NES games used a password-based save system so the limitation doesn't sound too bad to me at all in exchange for making the game more easily portable and playable on more emulators. Is the modification process documented anywhere?

I don't think anyone has really documented the process, but I've done a lot of personal research and experimenting during the days of the beta mapping out the banks and converting NESmaker games from mapper 30 to mapper 02 for porting over to other NES based platforms like the Playchoice 10 and Vs. System arcade hardware. I've charted out the banks here http://www.nesmakers.com/viewtopic.php?f=19&t=248&p=1431#p1424 and so long as 4.1.0 doesn't make major changes, the info should be accurate. Truthfully you don't need to do any bank alterations for emulators. A simple change of headers will work as I've been experimenting with which emulators fail with changed headers and which succeed. Using a powerpak cart and real hardware, it works with only a header change so any emulator that doesn't load and boot the rom with only a changed header I consider inaccurate and only use for quick debugging.

To change header info I simply used the iNES Header Checker and swapped mapper 30 for mapper 2, all other info was left the same.

Here is a quick list of emulators/hardware that passed on doing a header swap only with no other bank adjustments. Real hardware tests were conducted using a Powerpak with Power Mappers and not rewired UNROM carts or available UNROM-512 carts. All emulators are PC versions. I haven't tested NES Classic Edition hakchi or Retropie versions.

Console/Emulator - Mapper30_test - Mapper02_test

Famicom AV (HVC-101) - Pass - Pass

NES Front-Loader (NES-001) - Pass - Pass

aNESePlus 4.0a - Fail - Pass

BizHawk 2.3.0 - Pass - Pass

FCEUX 2.2.3 - Pass - Fail

Mesen 0.9.6 - Pass - Pass

NEStopia 1.49 - Fail - Pass

Nintendulator 0.970 - Fail - Fail

no$nes 1.1 - Fail - Pass

puNES 0.103 WIP - Pass - Fail
 

Kasumi

New member
There's a really short version at the bottom of the post.

In mapper 2/UNROM/UOROM, write a byte to $8000-$FFFF to bank swap.
In mapper 30, write a byte to $8000-$FFFF to bank swap.

Three main differences.
The byte written's format is slightly different. In Mapper 30, the highest bit is a mirroring select, the next two bits control which CHR bank. On mapper 2, the highest four bits are... "implementation defined." On both, the lowest bits are which PRG bank, but Mapper 30 gets one more bit for it that's not "implementation defined".

UNROM/UOROM is subject to bus conflicts, NES Maker's mapper 30 is not. (Since I believe it to be the self flashable board.) What this means is the bank you write is not necessarily the bank you get on UNROM/UOROM. You have to write to a place with the same value in ROM as the bank you want to switch to guarantee that's what you'll get. NES Maker ROMs do not do this (although it's not hard to do so and there is commented out code to make that change).

Most important: The largest size for mapper 2 (as far as actual produced, licensed carts) is 256KB to my knowledge. Any NES Maker game (including mapper 2 Troll Burner, I was surprised to find) is 512KB.

The size/bus conflict parts mean that any emulator/hardware that rejects any NES Maker game with a swapped header totally has a valid reason for doing so. I would not discount things that do not run them as inaccurate by that test, only less permissive than things that do. Permissiveness is the opposite of accuracy. For FCEUX in particular, bus conflicts may be one reason for the failure of header edited NES Maker ROMs working. And it's a valid reason! Commercial flashcarts (Powerpak/Everdrive) run on real hardware, but still value permissiveness to the extent that it's possible. It can help someone play ROM hacks that were never tested (and wouldn't work) on real boards which is a win for the person buying the product, but a purposeful choice against accuracy.

Mapper 30 is similar to Mapper 2 by design. NES Maker's current biggest problem changing to mapper 2 is that all its ROMs are larger than the defined specification which technically leaves how to handle parts of them up to the whims of the emulator/implementation author.

Ignoring the size issue, NES Maker ROMs could be made Mapper 2 by adding 32 bytes, and changing a few lines of code. At least, that's what it looks like.

This code may void your warranty:
Code:
bankswitchY:
	STY currentBank
bankswitchNoSave:
	lda currentBank
	and #%00011111
	tay
	STA banktable,y	
	RTS	
banktable:
	.db $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
	.db $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1A, $1B, $1C, $1D, $1E, $1F
In GameEngineData/Routines/System/BankSwitch.asm.

Edit: Fixed an error! I can confirm this makes a basic test work on FCEUX when it didn't before so the problem was probably indeed bus conflicts. "work" is different than "stable"! if NES Maker tries to bankswitch anywhere that isn't this code, that's a problem. And if anything calls bankswitchNoSave expecting Y not to change, that's also a problem... edit3: You can back up Y to the stack, but that makes bank switching a bit slower...

For puNES, the problem seems to be size. Not even Troll Burner (mapper 2) runs. But Troll Burner (Mapper 30) does.

I didn't check Nintendulator. In the versions I have around, the ROMs work regardless of bus conflicts.

Edit2: Changed one more thing. It wasn't quite... an error, but it's more consistent with how the original version of the routine works in case things expect that.

Edit: tl;dr: NES Maker ROMs are technically too big for "standardized" mapper 2, but most things value user experience over accuracy so this doesn't necessarily matter. puNES seems to be the only emulator that cares about size. (But caring about size IS valid, this doesn't make puNES "wrong".)

As for the mappers DLN-003 first mentioned... let's just say it'd be a much larger change.
 

Mihoshi20

Member
Kasumi said:
There's a really short version at the bottom of the post.

In mapper 2/UNROM/UOROM, write a byte to $8000-$FFFF to bank swap.
In mapper 30, write a byte to $8000-$FFFF to bank swap.

Three main differences.
The byte written's format is slightly different. In Mapper 30, the highest bit is a mirroring select, the next two bits control which CHR bank. On mapper 2, the highest four bits are... "implementation defined." On both, the lowest bits are which PRG bank, but Mapper 30 gets one more bit for it that's not "implementation defined".

UNROM/UOROM is subject to bus conflicts, NES Maker's mapper 30 is not. (Since I believe it to be the self flashable board.) What this means is the bank you write is not necessarily the bank you get on UNROM/UOROM. You have to write to a place with the same value in ROM as the bank you want to switch to guarantee that's what you'll get. NES Maker ROMs do not do this (although it's not hard to do so and there is commented out code to make that change).

Most important: The largest size for mapper 2 (as far as actual produced, licensed carts) is 256KB to my knowledge. Any NES Maker game (including mapper 2 Troll Burner, I was surprised to find) is 512KB.

The size/bus conflict parts mean that any emulator/hardware that rejects any NES Maker game with a swapped header totally has a valid reason for doing so. I would not discount things that do not run them as inaccurate by that test, only less permissive than things that do. Permissiveness is the opposite of accuracy. For FCEUX in particular, bus conflicts may be one reason for the failure of header edited NES Maker ROMs working. And it's a valid reason! Commercial flashcarts (Powerpak/Everdrive) run on real hardware, but still value permissiveness to the extent that it's possible. It can help someone play ROM hacks that were never tested (and wouldn't work) on real boards which is a win for the person buying the product, but a purposeful choice against accuracy.

Mapper 30 is similar to Mapper 2 by design. NES Maker's current biggest problem changing to mapper 2 is that all its ROMs are larger than the defined specification which technically leaves how to handle parts of them up to the whims of the emulator/implementation author.

Ignoring the size issue, NES Maker ROMs could be made Mapper 2 by adding 32 bytes, and changing a few lines of code. At least, that's what it looks like.

This code may void your warranty:
Code:
bankswitchY:
	STY currentBank
bankswitchNoSave:
	lda currentBank
	and #%00011111
	tay
	STA banktable,y	
	RTS	
banktable:
	.db $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
	.db $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1A, $1B, $1C, $1D, $1E, $1F
In GameEngineData/Routines/System/BankSwitch.asm.

Edit: Fixed an error! I can confirm this makes a basic test work on FCEUX when it didn't before so the problem was probably indeed bus conflicts. "work" is different than "stable"! if NES Maker tries to bankswitch anywhere that isn't this code, that's a problem. And if anything calls bankswitchNoSave expecting Y not to change, that's also a problem... edit3: You can back up Y to the stack, but that makes bank switching a bit slower...

For puNES, the problem seems to be size. Not even Troll Burner (mapper 2) runs. But Troll Burner (Mapper 30) does.

I didn't check Nintendulator. In the versions I have around, the ROMs work regardless of bus conflicts.

Edit2: Changed one more thing. It wasn't quite... an error, but it's more consistent with how the original version of the routine works in case things expect that.

Edit: tl;dr: NES Maker ROMs are technically too big for "standardized" mapper 2, but most things value user experience over accuracy so this doesn't necessarily matter. puNES seems to be the only emulator that cares about size. (But caring about size IS valid, this doesn't make puNES "wrong".)

As for the mappers DLN-003 first mentioned... let's just say it'd be a much larger change.

This is one reason why I'll be happy when I get in the INL cart along with some UNROM and UNROM-512 PCBs and start doing direct real hardware tests. I was able to edit/consoldiate the banks and get the rom size down to UNROM specs to work with Playchoice 10 and Vs. System but it was still emulated hardware with rom headers and I wont be fully satisfied until I'm using real PCBs on real hardware to know the exact capabilities.
 

CutterCross

Active member
DLN-003 said:
Is it possible to change which mapper NESMaker uses? I'd like to change it to mapper SUNSOFT5B, but I'm not entirely sure how. I'd settle for FME-7, but I'd prefer 5B for the expansion sound. If anyone knows how to do this, help would be appreciated.
Even if you were able to change the mapper to SUNSOFT5B, you wouldn't be able to even take advantage the expansion sound if you're planning to play your games on an unmodded North American or PAL region NES. The expansion sound was designed exclusively for the Famicom, so systems from other regions besides Japan wouldn't be able to utilize it, seeing as they lack the necessary circuitry for expanded sound.

That and you'd have to write an entirely new sound engine EXCLUSIVLY for the SUNSOFT5B. It's not going to be as simple as exporting from Famitracker.
 

nroflmao

New member
Kudos to Mihoshi20 for the great testing work, that actually helped me solve my issue for running my ROM on Retropie which has FCEUMM, Nestopia, and QuickNES.
Mapper30 won't work with Nestopia or QuickNES, and with FCEUMM it won't let me scroll up (gives me black screen) on adventure module.
Changing my rom to Mapper2 then running it with Nestopia or QuickNES now works, and the scrolling vertical works, so far as I can tell everything is working the same way as it does with Mapper30 using FCEUX (which isn't supported on RetroPie).
Your pass/fail criteria above made me realize i wasn't testing Mapper2 with the other emulators, only FCEUMM and it was just failing so i assumed the others would as well.
 

dale_coop

Moderator
Staff member
You could just modify the header to make it looks like a mapper 2 rom (some emulators would be able to load your game)
Use freeware like "iNES Header Checker", for example, open the game.nes, change the mapper to "2- UnROM PRG 16k swap", and save the modification.
(I use this technique to play my nesmaker roms on my BittBoy handheld device)
 
dale_coop said:
You could just modify the header to make it looks like a mapper 2 rom (some emulators would be able to load your game)
Use freeware like "iNES Header Checker", for example, open the game.nes, change the mapper to "2- UnROM PRG 16k swap", and save the modification.
(I use this technique to play my nesmaker roms on my BittBoy handheld device)

Holy crap Dale, you've saved my life again-- thank you so much!!
This let me convert my game to an SWF flash file, and also an EXE. This means NESMaker games can be converted into flash and PC games!!
 

Attachments

  • NESMAKER PC.zip
    3.5 MB · Views: 119

Gunsac

New member
I tested the age old emulator Nesticle0.42 for Windows and it even plays Mapper 30 games with a Mapper 2 Header Change. lol

Then I was looking at UNROM on the NesDev Mapper Wiki and I found that NesMaker Mapper 30 Games also work on Mapper 71 with just a Header Change. INES Mapper 071 is like a clone of UNROM but it is suppose to only have 256kb of PRG-ROM at max and it only has 8kb CHR-ROM where Mapper 30 supports 32kb. I haven't seen any NesMaker games that use CHR-ROM but it seems that Mapper 71 works in emulators with 512kb of Program or at least it does in FCEUX.. It worked for the Pinky Demo I haven't tried any others yet but all the Mapper 30 games I have seen have the same base header configuration AFAIK and should also work on Mapper 71.. But maybe not on real hardware..
 
Top Bottom