MAP41 File not found when playing certain games on Powerpak?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
MAP41 File not found when playing certain games on Powerpak?
by on (#172860)
Hey guys, crossposting this from NA forums just incase anyone here can help hopefully!

Basically I just got my HDMI nes and powerpak, however a few games are saying 'MAP41 FILE NOT FOUND', searched everywhere and cannot find this particular mapper, the retrousb site says it is working fine, yet it's not even included in their downloadable mappers file or on the powerpak they sent me?

One example of a game that requires this file is Daiku no Gen San...

Can anyone point me in the right direction?


Thanks!
Re: MAP41 File not found when playing certain games on Power
by on (#172862)
tomwatch wrote:
the retrousb site says it is working fine, yet it's not even included in their downloadable mappers file or on the powerpak they sent me

It's actually marked as "planned" on the website. Mapper files are numbered in hexadecimal (as evidenced by the presence of letters A through F in other files), so "MAP41" actually refers to mapper 65 (decimal).
Re: MAP41 File not found when playing certain games on Power
by on (#172863)
Which game you're playing is vague or incorrect (my vote is on incorrect). Here are the details, with MD5 checksums and all:

2349858821270f769b2876720f927a68 *Daiku no Gen San (J).nes -- uses mapper 4 (TLROM / MMC3)
61dc846d89e3e01b850efbff7ec1d280 *Daiku no Gen San 2 - Akage no Dan no Gyakushuu (J).nes -- uses mapper 65 (Irem H-3001). 65 in decimal = 0x41 in hexadecimal, so odds are "MAP41 file not found" is referring to this game.

The PowerPak has has support for mapper 4, but does not currently support mapper 65. Mappers supported are listed here -- see the chart and the legend near the bottom.

Furthermore:

* loopy's mappers does not include mapper 65
* thefox's mappers also does not include mapper 65

So, in summary: you can currently play Daiku no Gen San but not Daiku no Gen San 2.
Re: MAP41 File not found when playing certain games on Power
by on (#172864)
Unfortunately, the PowerPak's numbers are in hexadecimal, so "MAP41" means mapper 65. (4×16+1). RetroUSB's list says that mapper 65 support is "planned".

On the bright side, it's simple enough that it should be easy for someone to make, if they could be bothered to care.
Re: MAP41 File not found when playing certain games on Power
by on (#172865)
BTW, it appears that the Everdrive N8 does support this mapper.
Re: MAP41 File not found when playing certain games on Power
by on (#172867)
Blimey sorry guys I'm a donut!

It was hammerin harry 2, the powerpak menu cut off the 2! Doh

Got most games working but no mappers for kid Niki 2 or Magical Taruruuto Kun - Fantastic World!! It seems?
Re: MAP41 File not found when playing certain games on Power
by on (#172868)
The other reason you might see file not found errors referencing MAP4x is DiskDude syndrome. Early versions of the iNES and NESticle emulators didn't support mappers higher than 15 and thus didn't check the header byte containing bits 7-4 of the mapper number. So various tools for editing ROM files stored a credit for the tool developer in the bytes that emulators of the time didn't read, despite the spec stating that they should be set to zero. A string used by one popular tool was "DiskDude!". Some ROM site operators also inserted credits in that area. A newer emulator, aware of mappers past 15, is likely to treat the upper nibble (bits 7-4) of the first letter of this credit as the upper nibble of the mapper number. And because the ASCII code for 'D' (the first letter of "DiskDude!") is $44, a ROM using MMC1 (mapper 1, or $01 in hex) with DiskDude syndrome might get misread as mapper 65 ($41). DiskDude syndrome can be treated by opening the ROM in a hex editor and overwriting bytes at offsets $0007 through $000F with $00 bytes.

If NesCartDB weren't down right now, I'd go verify the actual mappers used by the games you mentioned to see if it's DiskDude syndrome or an actual missing mapper.
Re: MAP41 File not found when playing certain games on Power
by on (#172870)
I am concerned about doing the same type of work I did earlier for individual games (checksums + filenames + what mapper they use) when the list keeps getting longer. First it was Daiku no Gen San, which wasn't correct at all, but instead was Daiku no Gen San 2. Now it's Hammerin' Harry 2, Kid Niki 2, or Magical Taruruuto Kun. I sense massive flailing all over the place, which makes me suspicious about helping.

As for concerns over the "DiskDude!" strings: use ROMs from the GoodNES set and none of this is a problem. That is why I provided MD5 checksums. Because they matter. A filename or game name is not enough.
Re: MAP41 File not found when playing certain games on Power
by on (#172873)
lidnariq wrote:
Unfortunately, the PowerPak's numbers are in hexadecimal, so "MAP41" means mapper 65. (4×16+1). RetroUSB's list says that mapper 65 support is "planned".

On the bright side, it's simple enough that it should be easy for someone to make, if they could be bothered to care.

Do we have anywhere where a simple mapper (say GNROM/BNROM/CNROM)'s HDL for the PowerPak is available as a template? Found my copy of Loopy's CNROM source.

I don't see mask values for these registers…

Daiku no Gen San 2 […] == Hammerin' Harry 2, (mapper 41₁₆) "planned" on powerpak
Kid Niki 2 = Kaiketsu Yanchamaru 2, (mapper 20₁₆) "planned" on powerpak [3 uses the 41₁₆ of the topic]
Magical Taruruuto Kun is mapper 9F₁₆, 159, "unused" on powerpak. As it is a Bandai FCG variant, neither is its base mapper 10₁₆ (but that one is "planned")
Re: MAP41 File not found when playing certain games on Power
by on (#172874)
Mask values are very likely $F007 when A12 is high, and $F000 when A12 is low.

BootGod has better things to do right now than trace the pinout for Irem's H3001 to verify the above...



Emulating the 24C01/02 for most of the Bandai FCG variants probably requires putting its memory inside the FPGA's SSRAM.
Re: MAP41 File not found when playing certain games on Power
by on (#172952)
So confused by these posts! Sorry guys hopefully I haven't raised hell with my post!
Re: MAP41 File not found when playing certain games on Power
by on (#172959)
tomwatch wrote:
So confused by these posts! Sorry guys hopefully I haven't raised hell with my post!

People have essentially made a mountain out of a molehill with your question. So I'll summarise the information given, extracting all the technical crap you probably don't care about:

Daiku no Gen San -- supported by PowerPak
Daiku no Gen San 2 (a.k.a. Hammerin' Harry 2) -- not currently supported** by PowerPak
Kid Niki 2 -- not currently supported** by PowerPak
Magical Taruruuto Kun -- not currently supported by PowerPak

** = Can be supported if someone writes the code for the PowerPak to make the mapper work. Someone has to put in the effort for it to happen.

The "technical crap" being discussed is whether or not some of these games (mappers) could be made to work on the PowerPak or not.
Re: MAP41 File not found when playing certain games on Power
by on (#172964)
Also figuring out what technical details I needed to know to put forth that effort, whether those games were also MAP41₁₆ or not.
Re: MAP41 File not found when playing certain games on Power
by on (#172966)
A first attempt at the Verilog, for Mapper 41₁₆.
(@tomwatch: No, this isn't (yet) the file that goes in the powerpak.)

edit: Mednafen's source disagrees with Nintendulator's and Disch-notes. Mednafen triggers on clock counter underflow, Disch/Nintendulator claims no underflow. Mednafen claims mask of $F007, Nintendulator does no masking, Disch is silent.

Mednafen does seem to work. 大工の源さん2 (Daiku no Gen-san 2/Hammerin' Harry 2) writes at lowest addresses anyway.

edit 2: clarification: I don't have a PowerPak chain (yet), so I can't test this myself.

edit3: noticed a bug, pulling (5 downloads??)
Re: MAP41 File not found when playing certain games on Power
by on (#172971)
(looking at the source) but the NES doesn't provide A15 on the cartridge connector?
Re: MAP41 File not found when playing certain games on Power
by on (#172976)
PowerPak seems to handle that in powerpak.v? I copied the module input/output definition from Loopy's sources, so I expect that much works…
powerpak.v wrote:
Code:
    assign prgain[15]=!nesprg_ce;


…though looking over my code I notice I'm calling 16-bit addresses 8-bit. *fixes*

Nintendulator also disagrees with Mednafen/Dischnotes about whether mirroring is on 9001d7 or 9000d6. All three games write to both of those addresses (usu. 0). None of these suggest what the non-mirroring register of the pair is.
Re: MAP41 File not found when playing certain games on Power
by on (#172977)
PRG /CE is M2 NAND A15, delayed by a few ns. So after M2 goes high, A15 = NOT(PRG /CE). But if you're expecting use of WRAM at $6000-$7FFF, you might need to delay M2 by a few nanoseconds so that writes to a mapper port at $E000-$FFFF don't momentarily corrupt WRAM.


[Reflects correction by thefox]
Re: MAP41 File not found when playing certain games on Power
by on (#172979)
tepples wrote:
PRG /CE is M2 NAND A15, delayed by a few ns
This means you might not able to safely use a structure like always @(posedge M2), because /ROMSEL may have not arrived in time to decide what register to write to. You might have to use always @(negedge nesprg_ce), depending.

edit: update quote
Re: MAP41 File not found when playing certain games on Power
by on (#172981)
lidnariq wrote:
tepples wrote:
PRG /CE is M2 AND NOT(A15), delayed by a few ns
This means you probably also can't safely use a structure like always @(posedge M2), because /ROMSEL may have not arrived in time to decide what register to write to. You might have to use always @(negedge nesprg_ce), depending.

powerpak.v generates a delayed+negated m2 ("m2_n") right below that, but doesn't pre-use it.

It's academic here, though, as no registers are in the fixed $Ex/Fx bank, and the wram enables in the mapper DO use m2_n.

In other oddities, sources disagree as to whether mirroring is 9001 d7 (Disch, Mednafen) or 9000 d6 (Nintendulator). Mednafen seems to work fine without scrolling doing something failing for all three, so…
The games write as follows:
Spartan X 2: 40 to 9000, 0 to 9001.
HH2: 0 to 9000, 80 to 9001.
Kid Niki 3: 0 to 9000, 0 to 9001.
I wonder what the other register is/was going to be? None of these sources implement both addresses.
Re: MAP41 File not found when playing certain games on Power
by on (#172984)
tepples wrote:
PRG /CE is M2 AND NOT(A15)

That doesn't sound right, the truth table for that is:
Code:
m2      a15     !a15    prg /ce
0       0       1       0
0       1       0       0
1       0       1       1
1       1       0       0

Should be /CE = !(M2 & A15), I guess. So when M2=1, /CE = !A15, and A15 = !/CE.

EDIT: One more note, the M2 input into PowerPak FPGA is actually inverted externally. I can't remember if loopy's "m2" is the already inverted signal.

EDIT: Added clarification about the table.
Re: MAP41 File not found when playing certain games on Power
by on (#172986)
Thank you for the correction.
Re: MAP41 File not found when playing certain games on Power
by on (#172987)
No, what you diagrammed there is /CE = M2 & !A15, not !(M2 & A15). The wiki's description of /ROMSEL is M2 NAND A15 (or, in this notation, !(M2 & A15)). Not sure which is right; they work the same when M2's high for your conclusion:
thefox wrote:
So when M2=1, /CE = !A15, and A15 = !/CE.

but /CE would be high when M2 = 0, rather than low.

Anyway, fixed the bitwidth problem on addresses.

edit: knocked out 20₁₆, being rather similar to 41₁₆ less the interrupt plus MMC3-like extra fixed/swappable bank, and 6B₁₆ because its wiki article mentioned irem and it was very simple.

edit2: Since I've popped another two out (also unrelated), and Verilog files do not directly solve the problem in this thread, I'm inclined to split off.
Re: MAP41 File not found when playing certain games on Power
by on (#173038)
Myask wrote:
No, what you diagrammed there is /CE = M2 & !A15[/url]

The truth table was there to demonstrate why the equation in question was incorrect.
Re: MAP41 File not found when playing certain games on Power
by on (#174131)
Ah.

So, tomwatch, did you notice that the missing files you need got finished? (MAP41, MAP20, MAP21. Don't use MAP30, it needs fixing still.)