J.Y. Company mapper variations

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
J.Y. Company mapper variations
by on (#211897)
I've got three J.Y. Company multicart ROM images that use some variation of mapper 90/209/211. The variation lies in what register $D003 does.

Regular mappers 90/209/211: Used by all single-game releases, as well as the 1998 Super 45-in-1 multicart (JY-120A, Mapper 90). Register $D003:
Code:
 7654 3210
 ---- ----
 M.BC CPPC
 | || |||+- Select 256 KiB outer CHR-ROM bank if M==0
 | || |++-- Select 512/1024 KiB outer PRG-ROM bank
 | |+-+---- Select 512/1024 KiB outer CHR-ROM bank
 | +------- CHR Banking Mode
 |          0=Use outer 256 KiB CHR-ROM bank, masking off the regular CHR bank registers' bits ($9000-$AFFF) that select 256 KiB+ bank numbers
 |          1=Do not use outer 256 KiB CHR-ROM bank; use the regular CHR bank registers' bits ($9000-$AFFF) unmasked
 +--------- MMC2/4 Mode (effective in 4 KiB CHR banking mode, ignored otherwise)
            0=Do not automatically change CHR banks
            1=Automatically change CHR banks when encountering CHR tiles $FD and $FE (same as Nintendo MMC2/4)
Extended Mirroring is always off for Mapper 90, always on for Mapper 211, and selectable for Mapper 209 by register $D000 bit 5. Final Fight 3, Shin Samurai Spirits II and Tekken 2 all set bit 5 to select 256 KiB+ CHR-ROM banks directly, indicating that they are running on hardware that otherwise would mask off the higher-order CHR bank register bits and replace them with the outer bank.

Variation 1: Used by the 1997 Super HIK 4-in-1 multicart (JY-052), which has 512 KiB each of PRG-ROM and CHR-ROM. A single bit in register D003 selects both PRG and CHR outer banks:
Code:
 7654 3210
 ---- ----
 .... ...C
         +- Select 256 KiB outer PRG-ROM bank
         +- Select 256 KiB outer CHR-ROM bank
PRG ($8000-$8FFF) and CHR ($9000-$AFFF) bank select register bits that select 256 KiB banks are masked off. Extended Mirroring is selected by register $D001 (Mirroring) bit 3.

Variation 2: Used the 1997 Super HIK 21-in-1 multicart (JY-105), which has 1 MiB each of PRG-ROM and CHR-ROM, and the 1998 Super HIK 5-in-1 multicart (JY-114), also 1 MiB each of PRG/CHR. Like regular mappers 90/209/211, except that the outer PRG-ROM bank is 256 KiB in size, and Extended Mirroring is selected differently. Register $D003:
Code:
 7654 3210
 ---- ----
 .... CPPC
      |||+- Select 256 KiB outer CHR-ROM bank
      |++-- Select 256/512 KiB outer PRG-ROM bank
      +---- Select 512 KiB outer CHR-ROM bank
PRG ($8000-$8FFF) and CHR ($9000-$AFFF) bank select register bits that select 256 KiB banks are masked off. Extended Mirroring is selected by register $D001 (Mirroring) bit 3, as in Variation 1.

The 1997 Super HIK 4-in-1 multicart (Variation 1) is already in GoodNES 3.23b, tagged as Mapper 90, and to my knowledge does not run in any emulator other than Nestopia Plus which identifies it by CRC. The others were dumped by CaH4e3, who permits release of them once they're emulated. I can assign two submappers of mapper 209 (not 90 since Extended Mirroring is selectable) and write one of those dreaded test ROMs, or assign two entirely new NES 2.0 mapper numbers in the 256-511 range. Which one is preferred?
Re: J.Y. Company mapper variations
by on (#211898)
I tentatively think that submappers were originally intended for "here are two boards that are mostly-but-not-completely-compatible and have been historically emulated using the same code" ...

But that's clearly not true for mapper 78, where I don't think there's a robust way to detect which board variant is desired.

I think I'd lean towards allocating a new mapper number.
Re: J.Y. Company mapper variations
by on (#211904)
NewRisingSun wrote:
I've got three J.Y. Company multicart ROM images that use some variation of mapper 90/209/211. The variation lies in what register $D003 does.

Regular mappers 90/209/211: Used by all single-game releases, as well as the 1998 Super 45-in-1 multicart (JY-120A, Mapper 90). Register $D003:
Code:
 7654 3210
 ---- ----
 M.BC CPPC
 | || |||+- Select 256 KiB outer CHR-ROM bank if M==0
 | || |++-- Select 512/1024 KiB outer PRG-ROM bank
 | |+-+---- Select 512/1024 KiB outer CHR-ROM bank
 | +------- CHR Banking Mode
 |          0=Use outer 256 KiB CHR-ROM bank, masking off the regular CHR bank registers' bits ($9000-$AFFF) that select 256 KiB+ bank numbers
 |          1=Do not use outer 256 KiB CHR-ROM bank; use the regular CHR bank registers' bits ($9000-$AFFF) unmasked
 +--------- MMC2/4 Mode (effective in 4 KiB CHR banking mode, ignored otherwise)
            0=Do not automatically change CHR banks
            1=Automatically change CHR banks when encountering CHR tiles $FD and $FE (same as Nintendo MMC2/4)
Extended Mirroring is always off for Mapper 90, always on for Mapper 211, and selectable for Mapper 209 by register $D000 bit 5. Final Fight 3, Shin Samurai Spirits II and Tekken 2 all set bit 5 to select 256 KiB+ CHR-ROM banks directly, indicating that they are running on hardware that otherwise would mask off the higher-order CHR bank register bits and replace them with the outer bank.

Variation 1: Used by the 1997 Super HIK 4-in-1 multicart (JY-052), which has 512 KiB each of PRG-ROM and CHR-ROM. A single bit in register D003 selects both PRG and CHR outer banks:
Code:
 7654 3210
 ---- ----
 .... ...C
         +- Select 256 KiB outer PRG-ROM bank
         +- Select 256 KiB outer CHR-ROM bank
PRG ($8000-$8FFF) and CHR ($9000-$AFFF) bank select register bits that select 256 KiB banks are masked off. Extended Mirroring is selected by register $D001 (Mirroring) bit 3.

Variation 2: Used the 1997 Super HIK 21-in-1 multicart (JY-105), which has 1 MiB each of PRG-ROM and CHR-ROM, and the 1998 Super HIK 5-in-1 multicart (JY-114), also 1 MiB each of PRG/CHR. Like regular mappers 90/209/211, except that the outer PRG-ROM bank is 256 KiB in size, and Extended Mirroring is selected differently. Register $D003:
Code:
 7654 3210
 ---- ----
 .... CPPC
      |||+- Select 256 KiB outer CHR-ROM bank
      |++-- Select 256/512 KiB outer PRG-ROM bank
      +---- Select 512 KiB outer CHR-ROM bank
PRG ($8000-$8FFF) and CHR ($9000-$AFFF) bank select register bits that select 256 KiB banks are masked off. Extended Mirroring is selected by register $D001 (Mirroring) bit 3, as in Variation 1.

The 1997 Super HIK 4-in-1 multicart (Variation 1) is already in GoodNES 3.23b, tagged as Mapper 90, and to my knowledge does not run in any emulator other than Nestopia Plus which identifies it by CRC. The others were dumped by CaH4e3, who permits release of them once they're emulated. I can assign two submappers of mapper 209 (not 90 since Extended Mirroring is selectable) and write one of those dreaded test ROMs, or assign two entirely new NES 2.0 mapper numbers in the 256-511 range. Which one is preferred?

JY ROM, I DUMP have more variations.
Re: J.Y. Company mapper variations
by on (#211914)
Can you be more specific, please?
Re: J.Y. Company mapper variations
by on (#211927)
The last mapper number that krzysiobal has assigned is 280. I am therefore assigning mapper numbers 281 and 282 for these two variants. Attached find a Nintendulator emulation source.

Related question: If someone could tell me which J.Y. Company game actually uses Mapper 90/209/211's feature of putting PRG-ROM in the $6000-$7FFF range, and in which game situation, it would be much appreciated.
Re: J.Y. Company mapper variations
by on (#211934)
case 281:
name = "BMC NEWSTAR 12-IN-1/76-IN-1";

k.....

PRG-ROM: 512 kB (hovewer A19 is wired to the EPROM)
CHR-RAM: 8 kB

[mvPP .P..] 74*174: $8000-$bfff
|||| |
||++--+--- outer PRG (high to low: D0, D5, D4)
|+-------- mode (0=16kB, 1=32kB)
+--------- mirroring (0=V, 1=H)

[.... uppp] 74*161: $8000-$9fff and $c000-$dfff
||||
|+++- inner PRG
+---- mode (0=UNROM,1=NROM)
yes, it overlaps partially with previous reg, so when wring at $8000-$9fff, botch registers are updated

Power up: both registers set to 0
Reset: no change

PRG Modes:

uv $8000 $bfff
----------------
00 PPPppp PPP111
01 PPPpp0 PPP111
10 PPPppp PPPppp
11 PPPpp0 PPPpp1
------------------------------------

#include "mapinc.h"

static uint8 reg174, reg161;

//shifts bit at position `from` to position `to` in expression
#define shi(exp, from, to) ((((exp) >> (from)) & 1) << (to))

static SFORMAT StateRegs[] =
{
{ 0 }
};

static void Sync(void) {
int uv = shi(reg161, 3, 1) | shi(reg174, 6, 0);
int PPP = shi(reg174, 0, 2) | shi(reg174, 5, 1) | shi(reg174, 4, 0);
int ppp = reg161 & 0x7;

switch (uv) {
case 0: setprg16(0x8000, (PPP << 3) | ppp); setprg16(0xc000, (PPP << 3) | 7); break;
case 1: setprg16(0x8000, ((PPP << 3) | ppp) & (~1)); setprg16(0xc000, (PPP << 3) | 7); break;
case 2: setprg16(0x8000, (PPP << 3) | ppp); setprg16(0xc000, (PPP << 3) | ppp); break;
case 3: setprg32(0x8000, ((PPP << 3) | ppp) >> 1); break;
}
setmirror(((reg174 >> 7) & 1) == 0 ? MI_V : MI_H);

}

static DECLFW(M281Write) {
if ((A >= 0x8000) && (A <= 0xBFFF)) {
reg174 = V;
}
if (((A >= 0x8000) && (A <= 0x9FFF)) || ((A >= 0xC000) && (A <= 0xFFFF))) {
reg161 = V;
}
Sync();
}

static void M281Power(void) {
setchr8(0);
reg174 = reg161 = 0;
SetWriteHandler(0x8000, 0xffff, M281Write);
SetReadHandler(0x8000, 0xFFFF, CartBR);
Sync();
}

static void M281Reset(void) {
Sync();
}


static void StateRestore(int version) {
Sync();
}

void Mapper281_Init(CartInfo *info) {
info->Power = M281Power;
info->Reset = M281Reset;

GameStateRestore = StateRestore;

AddExState(&StateRegs, ~0, 0, 0);
}
Re: J.Y. Company mapper variations
by on (#211955)
I suggest that instead of assigning mapper numbers for your new dumps secretly, you announce them in a way that people can know about them, either by making a forum post or a nesdev wiki stub. I am not changing my assignment of 281.
Re: J.Y. Company mapper variations
by on (#211959)
NewRisingSun wrote:
I suggest that instead of assigning mapper numbers for your new dumps secretly, you announce them in a way that people can know about them, either by making a forum post or a nesdev wiki stub. I am not changing my assignment of 281.


I am not changing. rom test,to public!

282-500,have rom.
Re: J.Y. Company mapper variations
by on (#211973)
As I have just written, the ROM that I have assigned to Mapper 281 has been out there for a long time as part of the GoodNES 3.23b set as "1997 Super HIK 4-in-1 (JY-052) [p1][!]". So no, you are not the first one to publicly release a ROM image for this mapper.

I intend to assign "BMC NEWSTAR 12-IN-1/76-IN-1" to Mapper 293. Since Nestopia Plus identifies ROM images by CRC32 anyway, it should make no difference when using either ROM image.
Re: J.Y. Company mapper variations
by on (#211974)
As far as I remember, the 45-in-1 mapper 90 variation is not 100% compatible with what is shown in nesdev.com (I implemented it in hardware and it worked for signle mapper-90 games but not for 45-in-1). Then I had to see in FCEUX source code what's really going on (as far as I remember upper CHR-lines were used as PRG lines or something that)
Re: J.Y. Company mapper variations
by on (#211975)
The first description of my initial post is based on the FCEUX source code and runs all single games as well as 45-in-1. I agree that it needs to be incorporated into the wiki.

The two Mapper 282 ROMs are now available at the, uh, usual place.