////////////////////////////////////////////////////////////////////////// // Mapper083 Nintendo MMC3 // ////////////////////////////////////////////////////////////////////////// void Mapper083::Reset() { for( INT i = 0; i < 3; i++ ) { reg[i] = 0x00; } if( PROM_8K_SIZE >= 32 ) { SetPROM_32K_Bank( 0, 1, 30, 31 ); reg[1] = 0x30; } else { SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); } if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } chr_bank = 0; irq_enable = 0; // Disable irq_counter = 0; patch = 0; if( nes->rom->GetPROM_CRC() == 0x1461D1F8 ) { patch = 1; } }
void Mapper251::SetBank() { INT chr[6]; INT prg[4]; for( INT i = 0; i < 6; i++ ) { chr[i] = (reg[i]|(breg[1]<<4)) & ((breg[2]<<4)|0x0F); } if( reg[8] & 0x80 ) { SetVROM_8K_Bank(chr[2],chr[3],chr[4],chr[5],chr[0],chr[0]+1,chr[1],chr[1]+1); } else { SetVROM_8K_Bank(chr[0],chr[0]+1,chr[1],chr[1]+1,chr[2],chr[3],chr[4],chr[5]); } prg[0] = (reg[6]&((breg[3]&0x3F)^0x3F))|(breg[1]); prg[1] = (reg[7]&((breg[3]&0x3F)^0x3F))|(breg[1]); prg[2] = prg[3] =((breg[3]&0x3F)^0x3F)|(breg[1]); prg[2] &= PROM_8K_SIZE-1; if( reg[8] & 0x40 ) { SetPROM_32K_Bank( prg[2],prg[1],prg[0],prg[3] ); } else { SetPROM_32K_Bank( prg[0],prg[1],prg[2],prg[3] ); } }
////////////////////////////////////////////////////////////////////////// // Mapper188 Bandai Karaoke Studio // ////////////////////////////////////////////////////////////////////////// void Mapper188::Reset() { if( PROM_8K_SIZE > 16 ) { SetPROM_32K_Bank( 0, 1, 14, 15 ); } else { SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); } }
void Mapper004::SetBank_CPU() { if( reg[0] & 0x40 ) { SetPROM_32K_Bank( PROM_8K_SIZE-2, prg1, prg0, PROM_8K_SIZE-1 ); } else { SetPROM_32K_Bank( prg0, prg1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper058 // ////////////////////////////////////////////////////////////////////////// void Mapper058::Reset() { SetPROM_32K_Bank( 0, 1, 0, 1 ); if( 0xbd50a90e == nes->rom->GetPROM_CRC() ) SetPROM_32K_Bank(0); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper025 Konami VRC4(Normal) // ////////////////////////////////////////////////////////////////////////// void Mapper025::Reset() { for( INT i = 0; i < 11; i++ ) { reg[i] = 0; } reg[9] = PROM_8K_SIZE-2; irq_enable = 0; irq_counter = 0; irq_latch = 0; irq_occur = 0; irq_clock = 0; SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } DWORD crc = nes->rom->GetPROM_CRC(); if( crc == 0xc71d4ce7 ) { // Gradius II(J) // nes->SetRenderMethod( NES::POST_RENDER ); } if( crc == 0xa2e68da8 ) { // For Racer Mini Yonku - Japan Cup(J) nes->SetRenderMethod( NES::TILE_RENDER ); } if( crc == 0xea74c587 ) { // For Teenage Mutant Ninja Turtles(J) nes->SetRenderMethod( NES::TILE_RENDER ); } if( crc == 0x5f82cb7d ) { // For Teenage Mutant Ninja Turtles 2(J) } if( crc == 0x0bbd85ff ) { // For Bio Miracle Bokutte Upa(J) nes->SetRenderMethod( NES::PRE_ALL_RENDER ); } }
void Mapper117::Reset() { SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper002 UNROM // ////////////////////////////////////////////////////////////////////////// void Mapper002::Reset() { SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); patch = 0; DWORD crc = nes->rom->GetPROM_CRC(); // if( crc == 0x322c9b09 ) { // Metal Gear (Alt)(J) //// nes->SetFrameIRQmode( FALSE ); // } // if( crc == 0xe7a3867b ) { // Dragon Quest 2(Alt)(J) // nes->SetFrameIRQmode( FALSE ); // } //// if( crc == 0x9622fbd9 ) { // Ballblazer(J) //// patch = 0; //// } if( crc == 0x8c3d54e8 // Ikari(J) || crc == 0x655efeed // Ikari Warriors(U) || crc == 0x538218b2 ) { // Ikari Warriors(E) patch = 1; } if( crc == 0xb20c1030 ) { // Shanghai(J)(original) patch = 2; } }
void Mapper110::WriteLow( WORD addr, BYTE data ) { switch( addr ) { case 0x4100: reg1 = data & 0x07; break; case 0x4101: switch( reg1 ) { case 5: SetPROM_32K_Bank( data ); break; case 0: reg0 = data & 0x01; SetVROM_8K_Bank( reg0 ); break; case 2: reg0 = data; SetVROM_8K_Bank( reg0 ); break; case 4: reg0 = reg0 | (data<<1); SetVROM_8K_Bank( reg0 ); break; case 6: reg0 = reg0 | (data<<2); SetVROM_8K_Bank( reg0 ); break; default: break; } break; default: break; } }
////////////////////////////////////////////////////////////////////////// // Mapper249 MMC3 // ////////////////////////////////////////////////////////////////////////// void Mapper249::Reset() { for( INT i = 0; i < 8; i++ ) { reg[i] = 0x00; } prg0 = 0; prg1 = 1; SetPROM_32K_Bank( 0,1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); chr01 = 0; chr23 = 2; chr4 = 4; chr5 = 5; chr6 = 6; chr7 = 7; SetVROM_8K_Bank( 0 ); we_sram = 0; // Disable irq_enable = 0; // Disable irq_counter = 0; irq_latch = 0; irq_request = 0; // IRQタイプ設定 nes->SetIrqType( NES::IRQ_CLOCK ); spdata = 0; }
////////////////////////////////////////////////////////////////////////// // Mapper058 // ////////////////////////////////////////////////////////////////////////// void Mapper058::Reset() { SetPROM_32K_Bank( 0, 1, 0, 1 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper069 SunSoft FME-7 // ////////////////////////////////////////////////////////////////////////// void Mapper069::Reset() { reg = 0; irq_enable = 0; irq_counter = 0; SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } nes->apu->SelectExSound(32); nes->SetIrqType( NES::IRQ_CLOCK ); patch = 0; DWORD crc = nes->rom->GetPROM_CRC(); if( crc == 0xfeac6916 ) { // Honoo no Toukyuuji - Dodge Danpei 2(J) // nes->SetIrqType( NES::IRQ_HSYNC ); nes->SetRenderMethod( NES::TILE_RENDER ); } if( crc == 0xad28aef6 ) { // Dynamite Batman(J) / Dynamite Batman - Return of the Joker(U) patch = 1; } }
////////////////////////////////////////////////////////////////////////// // Mapper073 Konami VRC3 // ////////////////////////////////////////////////////////////////////////// void Mapper073::Reset() { irq_enable = 0; irq_counter = 0; SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); }
////////////////////////////////////////////////////////////////////////// // Mapper000 // ////////////////////////////////////////////////////////////////////////// void Mapper000::Reset() { switch( PROM_16K_SIZE ) { default: case 1: // 16K only SetPROM_16K_Bank( 4, 0 ); SetPROM_16K_Bank( 6, 0 ); break; case 2: // 32K SetPROM_32K_Bank( 0 ); break; } DWORD crc = nes->rom->GetPROM_CRC(); if( crc == 0x4e7db5af ) { // Circus Charlie(J) nes->SetRenderMethod( NES::POST_RENDER ); } if( crc == 0x57970078 ) { // F-1 Race(J) nes->SetRenderMethod( NES::POST_RENDER ); } if( crc == 0xaf2bbcbc // Mach Rider(JU) || crc == 0x3acd4bf1 ) { // Mach Rider(Alt)(JU) nes->SetRenderMethod( NES::POST_RENDER ); } }
////////////////////////////////////////////////////////////////////////// // Mapper135 SACHEN CHEN // ////////////////////////////////////////////////////////////////////////// void Mapper135::Reset() { cmd = 0; chr0l = chr1l = chr0h = chr1h = chrch = 0; SetPROM_32K_Bank( 0 ); SetBank_PPU(); }
////////////////////////////////////////////////////////////////////////// // Mapper225 72-in-1 // ////////////////////////////////////////////////////////////////////////// void Mapper225::Reset() { SetPROM_32K_Bank( 0, 1, 2, 3 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper079 Nina-3 // ////////////////////////////////////////////////////////////////////////// void Mapper079::Reset() { SetPROM_32K_Bank( 0 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper110 // ////////////////////////////////////////////////////////////////////////// void Mapper110::Reset() { SetPROM_32K_Bank( 0 ); SetVROM_8K_Bank( 0 ); reg0 = 0; reg1 = 0; }
void Mapper201::Write( WORD addr, BYTE data ) { BYTE bank = (BYTE)addr & 0x03; if( !(addr&0x08) ) bank = 0; SetPROM_32K_Bank( bank ); SetVROM_8K_Bank( bank ); }
////////////////////////////////////////////////////////////////////////// // Mapper077 Irem Early Mapper #0 // ////////////////////////////////////////////////////////////////////////// void Mapper077::Reset() { SetPROM_32K_Bank( 0 ); SetVROM_2K_Bank( 0, 0 ); SetCRAM_2K_Bank( 2, 1 ); SetCRAM_2K_Bank( 4, 2 ); SetCRAM_2K_Bank( 6, 3 ); }
void Mapper007::Write( WORD addr, BYTE data ) { SetPROM_32K_Bank( data & 0x07 ); if( !patch ) { if( data & 0x10 ) SetVRAM_Mirror( VRAM_MIRROR4H ); else SetVRAM_Mirror( VRAM_MIRROR4L ); } }
void Mapper244::Write( WORD addr, BYTE data ) { if( addr>=0x8065 && addr<=0x80A4 ) { SetPROM_32K_Bank( (addr-0x8065)&0x3 ); } if( addr>=0x80A5 && addr<=0x80E4 ) { SetVROM_8K_Bank( (addr-0x80A5)&0x7 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper045 1000000-in-1 // ////////////////////////////////////////////////////////////////////////// void Mapper045::Reset() { patch = 0; for( INT i = 0; i < 8; i++ ) { reg[i] = 0; } prg0 = 0; prg1 = 1; prg2 = PROM_8K_SIZE-2; prg3 = PROM_8K_SIZE-1; DWORD crc = nes->rom->GetPROM_CRC(); if( crc == 0x58bcacf6 // Kunio 8-in-1 (Pirate Cart) || crc == 0x9103cfd6 // HIK 7-in-1 (Pirate Cart) || crc == 0xc082e6d3 ) { // Super 8-in-1 (Pirate Cart) patch = 1; prg2 = 62; prg3 = 63; } if( crc == 0xe0dd259d ) { // Super 3-in-1 (Pirate Cart) patch = 2; } SetPROM_32K_Bank( prg0, prg1, prg2, prg3 ); p[0] = prg0; p[1] = prg1; p[2] = prg2; p[3] = prg3; SetVROM_8K_Bank( 0 ); // chr0 = c[0] = 0; // chr1 = c[1] = 0 // chr2 = c[2] = 0; // chr3 = c[3] = 0; // chr4 = c[4] = 0; // chr5 = c[5] = 0; // chr6 = c[6] = 0; // chr7 = c[7] = 0; chr0 = c[0] = 0; chr1 = c[1] = 1; chr2 = c[2] = 2; chr3 = c[3] = 3; chr4 = c[4] = 4; chr5 = c[5] = 5; chr6 = c[6] = 6; chr7 = c[7] = 7; irq_enable = 0; irq_counter = 0; irq_latch = 0; irq_latched = 0; irq_reset = 0; }
////////////////////////////////////////////////////////////////////////// // Mapper255 110-in-1 // ////////////////////////////////////////////////////////////////////////// void Mapper255::Reset() { SetPROM_32K_Bank( 0 ); SetVROM_8K_Bank( 0 ); SetVRAM_Mirror( VRAM_VMIRROR ); reg[0] = 0; reg[1] = 0; reg[2] = 0; reg[3] = 0; }
////////////////////////////////////////////////////////////////////////// // Mapper075 Konami VRC1/Jaleco D65005 // ////////////////////////////////////////////////////////////////////////// void Mapper075::Reset() { SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); if( VROM_8K_SIZE ) { SetVROM_8K_Bank( 0 ); } reg[0] = 0; reg[1] = 1; }
////////////////////////////////////////////////////////////////////////// // Mapper042 Mario Baby // ////////////////////////////////////////////////////////////////////////// void Mapper042::Reset() { irq_enable = 0; irq_counter = 0; SetPROM_8K_Bank( 3, 0 ); SetPROM_32K_Bank( PROM_8K_SIZE-4, PROM_8K_SIZE-3, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
void Mapper090::SetBank_CPU() { if( prg_size == 0 ) { SetPROM_32K_Bank( PROM_8K_SIZE-4, PROM_8K_SIZE-3, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); } else if( prg_size == 1 ) { SetPROM_32K_Bank( prg_reg[1]*2, prg_reg[1]*2+1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); } else if( prg_size == 2 ) { if( prg_E000 ) { SetPROM_32K_Bank( prg_reg[0], prg_reg[1], prg_reg[2], prg_reg[3] ); } else { if( prg_6000 ) { SetPROM_8K_Bank( 3, prg_reg[3] ); } SetPROM_32K_Bank( prg_reg[0], prg_reg[1], prg_reg[2], PROM_8K_SIZE-1 ); } } else { SetPROM_32K_Bank( prg_reg[3], prg_reg[2], prg_reg[1], prg_reg[0] ); } }
////////////////////////////////////////////////////////////////////////// // Mapper040 SMB2J // ////////////////////////////////////////////////////////////////////////// void Mapper040::Reset() { irq_enable = 0; irq_line = 0; SetPROM_8K_Bank( 3, 6 ); SetPROM_32K_Bank( 4, 5, 0, 7 ); if( VROM_1K_SIZE ) { SetVROM_8K_Bank( 0 ); } }
////////////////////////////////////////////////////////////////////////// // Mapper251 // ////////////////////////////////////////////////////////////////////////// void Mapper251::Reset() { SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); SetVRAM_Mirror( VRAM_VMIRROR ); INT i; for( i = 0; i < 11; i++ ) reg[i] = 0; for( i = 0; i < 4; i++ ) breg[i] = 0; }
////////////////////////////////////////////////////////////////////////// // Mapper091 PC-HK-SF3 // ////////////////////////////////////////////////////////////////////////// void Mapper091::Reset() { SetPROM_32K_Bank( PROM_8K_SIZE-2, PROM_8K_SIZE-1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); if( VROM_8K_SIZE ) { SetVROM_8K_Bank( 0, 0, 0, 0, 0, 0, 0, 0 ); } irq_enable = 0; irq_counter = 0; nes->SetRenderMethod( NES::POST_ALL_RENDER ); }