[NES] clean up mapper 107
This commit is contained in:
parent
db2ba34c01
commit
7705e3f6f1
|
@ -83,7 +83,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an
|
||||||
096 Misc (J) Nothing
|
096 Misc (J) Nothing
|
||||||
097 Misc (J) Nothing (easy)
|
097 Misc (J) Nothing (easy)
|
||||||
105 NES-EVENT ~NEEDED~
|
105 NES-EVENT ~NEEDED~
|
||||||
107 Misc Nothing (easy)
|
107 Unlicensed Complete
|
||||||
112 Misc (CN) Nothing
|
112 Misc (CN) Nothing
|
||||||
113 =USELESS= Junk
|
113 =USELESS= Junk
|
||||||
115 MMC3Variant Nothing
|
115 MMC3Variant Nothing
|
||||||
|
|
|
@ -4,60 +4,66 @@ using System.Diagnostics;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Consoles.Nintendo
|
namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
{
|
{
|
||||||
/*
|
class Mapper107 : NES.NESBoardBase
|
||||||
Registers:
|
{
|
||||||
---------------------------
|
//configuration
|
||||||
I do not know whether or not this mapper suffers from bus conflicts. Use caution!
|
int prg_bank_mask_32k, chr_bank_mask_8k;
|
||||||
|
|
||||||
$8000-FFFF: [PPPP PPP.]
|
//state
|
||||||
[CCCC CCCC]
|
int prg_bank_32k, chr_bank_8k;
|
||||||
P = Selects 32k PRG @ $8000
|
|
||||||
C = Selects 8k CHR @ $0000
|
|
||||||
|
|
||||||
This is very strange. Bits 1-7 seem to be used by both CHR and PRG.
|
public override void SyncState(Serializer ser)
|
||||||
|
{
|
||||||
|
base.SyncState(ser);
|
||||||
|
ser.Sync("prg_bank_32k", ref prg_bank_32k);
|
||||||
|
ser.Sync("chr_bank_8k", ref chr_bank_8k);
|
||||||
|
}
|
||||||
|
|
||||||
Games:
|
public override bool Configure(NES.EDetectionOrigin origin)
|
||||||
Magic Dragon
|
{
|
||||||
*/
|
//configure
|
||||||
|
|
||||||
class Mapper107 : NES.NESBoardBase
|
|
||||||
{
|
|
||||||
int prg, chr;
|
|
||||||
public override bool Configure(NES.EDetectionOrigin origin)
|
|
||||||
{
|
|
||||||
//configure
|
|
||||||
switch (Cart.board_type)
|
switch (Cart.board_type)
|
||||||
{
|
{
|
||||||
case "Mapper107":
|
case "Mapper107":
|
||||||
|
AssertPrg(128); AssertChr(64); AssertWram(8); AssertVram(0); AssertBattery(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
prg_bank_mask_32k = (Cart.prg_size / 32) - 1;
|
||||||
|
chr_bank_mask_8k = (Cart.chr_size / 8) - 1;
|
||||||
|
|
||||||
|
SetMirrorType(Cart.pad_h, Cart.pad_v);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte ReadPPU(int addr)
|
||||||
|
{
|
||||||
|
if (addr < 0x2000)
|
||||||
|
{
|
||||||
|
int ofs = addr & ((1 << 13) - 1);
|
||||||
|
addr = (chr_bank_8k << 13) | ofs;
|
||||||
|
return VROM[addr];
|
||||||
|
}
|
||||||
|
else return base.ReadPPU(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override byte ReadPPU(int addr)
|
public override byte ReadPRG(int addr)
|
||||||
{
|
{
|
||||||
return VRAM[addr + (chr * 0x2000)];
|
int ofs = addr & ((1 << 15) - 1);
|
||||||
}
|
addr = (prg_bank_32k << 15) | ofs;
|
||||||
|
return ROM[addr];
|
||||||
|
}
|
||||||
|
|
||||||
public override byte ReadPRG(int addr)
|
public override void WritePRG(int addr, byte value)
|
||||||
{
|
{
|
||||||
return VROM[addr + (prg * 0x8000)];
|
chr_bank_8k = value;
|
||||||
}
|
prg_bank_32k = value >> 1;
|
||||||
|
chr_bank_8k &= chr_bank_mask_8k;
|
||||||
|
prg_bank_32k &= prg_bank_mask_32k;
|
||||||
|
}
|
||||||
|
|
||||||
public override void WriteWRAM(int addr, byte value)
|
}
|
||||||
{
|
|
||||||
chr = value;
|
|
||||||
prg = addr >> 1;
|
|
||||||
base.WriteWRAM(addr, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
|
||||||
{
|
|
||||||
base.SyncState(ser);
|
|
||||||
ser.Sync("prg", ref prg);
|
|
||||||
ser.Sync("chr", ref chr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2289,5 +2289,8 @@ sha1:0AE47BD83202A5A2235B0BC16278F56D66038AB5 Deathbots (U) NES board=AVE-NINA
|
||||||
;these roms are in goodNES but theyre junk
|
;these roms are in goodNES but theyre junk
|
||||||
sha1:4D6117577CE301BB987C5C32FEEF7B132A21B046 Afro Man (Mega Man 3 Hack) (UNL) NES board=TXROM-HOMEBREW;PRG=256;CHR=128;WRAM=8
|
sha1:4D6117577CE301BB987C5C32FEEF7B132A21B046 Afro Man (Mega Man 3 Hack) (UNL) NES board=TXROM-HOMEBREW;PRG=256;CHR=128;WRAM=8
|
||||||
|
|
||||||
|
;other assorted roms
|
||||||
|
sha1:92D9695FEB774F60965A8303CFE3E6AAEE7B7B62 Magic Dragon (Unl) NES board=Mapper107;PRG=128;CHR=64;WRAM=8;PAD_H=1
|
||||||
|
|
||||||
#include gamedb_neshomebrew.txt
|
#include gamedb_neshomebrew.txt
|
||||||
#include gamedb_user.txt
|
#include gamedb_user.txt
|
||||||
|
|
Loading…
Reference in New Issue