The unaltered ROM image of Diébiàn can be found as "Incantation (Dip Bin) (Joy Van)" in GoodNES v3.23b and is incorrectly set to Mapper 146, causing it to reset when pressing Start because of a simple copy protection.

FCEUX and Nestopia use the value written to $4102 plus three as the 8K CHR ROM bank. That is good enough for Wèilái Xiǎozi, but not for Diébiàn. The actual bank seems to be not $4102 plus a fixed "plus three", but "plus number of previous $4100 writes since the last $4101 write", which just happens to be three in the case of Wèilái Xiǎozi. Attached find a Nintendulator Mapper source file which runs both games in their unaltered form. Edit: See end of thread for updated source files.

Last edited by NewRisingSun on Sun Dec 24, 2017 1:40 pm, edited 2 times in total.

I have updated my Mapper 136 source file on the assumption that it's like Mapper 36, only with CHR. Before, I was applying the RR value to CHR immediately after any $4100-$4103 write, instead of waiting for the $8000-$FFFF write. (This would obviously be fatal for a PRG switch.) Diébiàn and Wèilái Xiǎozi both indeed finish their bankswitching code with a write to $FFFF, which mystified me before I learned about Mapper 36.

If Mapper 36 did not have that simplified CHR ROM switch at $4200, one could maybe even have merged mappers 36 and 136. While the "start RR" value for PRG is loaded into bits 4 and 5 of $4102 in Mapper 36, the "start RR" value for CHR is loaded into bits 0 and 1 of $4102 in Mapper 136.

Edit: Forgot a break in a switch statement.

Last edited by NewRisingSun on Sat May 27, 2017 11:39 am, edited 2 times in total.

Even if the ASIC is the same, the connections to the card edge look like they'll differ in an incompatible way...

But, yeah, I'll take a look at what the other three lines were intended to be. Since both Policeman and Strike Wolf include that write to $4101 I really have to wonder if i made an experimental error in claiming that writes to $4101 had no visible effect, or if it's a difference between the upper and lower nybbles of the IC, or if it's just a different IC altogether.

Debugging Pūkè Jīnglíng (the original version of Peek-a-Boo Poker), it seems that $4101 is a XOR mask that is applied to the value written to $4102 afterwards. I noticed that when I set that game to Mapper 136, my previous emulation selected the correct CHR bank when 00 was written to $4101, and the wrong CHR bank when FF was written to $4101, and the code does EOR the bank number in a similar fashion when writing FF to $4101. Attached find another update to Mapper136.cpp that incorporates this change.

With this $4101 behavior emulated, Pūkè Jīnglíng now runs at mapper 136 as well, though it also had CNROM compatibility code (provided that the CNROM emulation did NOT emulate bus conflicts). The game also writes to $4104, but as I understand the board's address mask, that should just be an alias for $4100 (it writes to $4104 in "direct CHR" mode and to $4104 in "CHR increment" mode). The same applies to the initial AVE release of F-15 City War (overall CRC32 88A6B192), though the address mask before comparison needs to be $E123 rather than $E103 (so that $4120 is NOT an alias for $4100), otherwise the NINA-03 compatibility write will interfere. (That particular ROM is strange --- it reads from $4100 to check if the current register has the correct value, quite similar to the Diébiàn/Wèilái Xiǎozi, but then ignores the result. I wonder if AVE just hacked the NINA-03 compatibility code into the mapper 136-targeted ROM image?)

Can you check whether writing FF to $4101 has a similar effect on the Mapper 36 board?

Edit: I noticed that this $4101-aware emulation of Mapper 136 also covers all games (Xiǎo Mǎlí Nei-Hu version, Mahjong Block Super Mega version) of Mapper 173, including the protection. It seems like FCEUX' mapper 173 emulation is a special case emulation for two games, whereas Mapper 136 as described is the general case, as Diébiàn and Wèilái Xiǎozi do not work under Mapper 173.

Mapper 172 (that silly Horse Racing game)'s protection read is passed as well, but the CHR bank is visibly wrong. Apparently, that game uses bits 4 and 5 instead of bits 0 and 1 for the CHR bank number, and messes up the order a bit. Probably the same IC but connected differently. Lastly, there is also Mapper 132 (Qiwang), which uses bits 0 and 1 for CHR, and bits 2 and 3 for PRG bank. Again, probably just a case of connecting the same IC in a different way.

Last edited by NewRisingSun on Sat May 27, 2017 2:47 pm, edited 7 times in total.

Take my results with a huge grain of salt... only pin 23 acts like CHR A13; pin 22 is always high no matter what I write. It could well be that this instantiation of the IC is buggy, which is why this PCB adds a 74'138 and 74'175. I can see the amount of current being sourced out of pin 22 changing (LED is changing brightness) depending on values written.

Pin 24 is really daft: you can only toggle it by loading the right value into RRR, and incrementing it until PRG A18 toggles. I haven't yet found a way to set it to a known value.

If someone from Taiwan can provide us boards containing the real TCU-02 IC, that would probably be pleasant in figuring out what the hell this thing might actually do and if it's supposedly like your pinout. FYI, there are two versions of Joy Van's Weilaixiaozi; one with fudgy scanline timer code, causing the title screen to jitter, supplied as regular CNROM. The other one appears to be a later revision that uses the supposed TCU-02 board logic. This later revision also fixes the title screen issues.

There's a big, fat "ASLIC AX-24G" IC on my friend's Master Chu cart, and from a glance it doesn't appear to match your supposed pinout though, so that's irrelevant to the whole discussion. I can provide actual pictures if anyone wants to take a look at it, though.

The rest of the PCB's he has of some Sachen stuff is on his flickr page, including Rocman X (which seems to be wired up to a weird CHR ROM and CHR RAM variant, despite not showing any instance of Chinese text boxes in the game at all?)https://www.flickr.com/photos/153392699 ... 2682439086

Back to topic:Perhaps it was originally planned to have a Chinese version, but that was cut late. Or perhaps it shares an engine with a game that uses a combination because it uses Chinese text.

Or the engine uses a combination because it was more convenient. I was lead programmer for The Curse of Possum Hollow, which has a 62256 (32Kx8 SRAM) for CHR RAM. But if only 8Kx8 SRAMs were available, it would probably have used a setup analogous to TQROM. The level backgrounds are in CHR RAM banks 0-7, with the playfield in 0-3 and the repeating parallax strips in 4-7. These have to be in CHR RAM because they're replaced a tile at a time as the camera proceeds through each level. Banks 16-31 are used for sprites, which are always loaded into CHR RAM a whole bank at a time. Banks 8-15 are used for static background things, primarily text fonts.

FYI, there are two versions of Joy Van's Weilaixiaozi; one with fudgy scanline timer code, causing the title screen to jitter, supplied as regular CNROM. The other one appears to be a later revision that uses the supposed TCU-02 board logic. This later revision also fixes the title screen issues.

The opposite is the case: The "CNROM version" is just a mapper hack of the TCU-02 version. You can still see the remnants of the TXC IC writes in it. Because the mapper hardware is written to while the split point is being timed, hacking the mapper code has the side effect of creating a shaky screen split.

kazblox wrote:

There's a big, fat "ASLIC AX-24G" IC on my friend's Master Chu cart, and from a glance it doesn't appear to match your supposed pinout though, so that's irrelevant to the whole discussion.

There is no image of Master Chu with any $4100-$4103 writing code, so that is indeed off-topic. The Joy Van version has code for CNROM and some unknown mapper hardware with two registers at $8000 and $8001 that are not MMC3-compatible, respectively. The Color Dreams version only has support for the Color Dreams latch, and the Sachen version has NINA-03 compatible bankswitching code, plus remnants of Color Dreams' charge pump-driving writes.

Last edited by NewRisingSun on Sun May 28, 2017 6:08 am, edited 2 times in total.

Attached source file txc.cpp for Nintendulator combines code for all known TXC board configurations; they are basically different ways of connecting the various lines around the same IC, plus Mapper 36's extra CHR latch. Mapper 173 is identical to Mapper 136, as mentioned before.

I am assuming that lidnariq's description of Mapper 36 has the CPU data bits shifted by four bits. That's a matter of definition, however; one might as well say that Mapper 36 is not shifted and everything else is. I had to deviate from lidnariq's description (or rather my understanding of it) in one way to make this work:

Code:

write $4100: When M=0, copy (PPP⊕yyy) to RRR; when M=1, RRR++ and also CCC++

The "also CCC++" does not correspond with what any game expects. All the games that read from $4100 and use the increase mode assume that only one of the nibbles is increasing.

The source file also includes a summary of the bits used by the various games.

Note! Mahjong Block sometimes selects the wrong CHR bank when the playfield appears for the first time. This error occasionally occurs in other versions of the game as well, even the ones that only have NINA-03 code in them. I therefore attribute this to a game error, not a mapper emulation error.

Who is online

Users browsing this forum: No registered users and 12 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum