diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AVE-NINA.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AVE-NINA.cs index 3b8e92d8c9..987b62b935 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AVE-NINA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AVE-NINA.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA half of mapper 034 (the other half is BxROM which is entirely different..) - public sealed class AVE_NINA_001 : NES.NESBoardBase + public sealed class AVE_NINA_001 : NesBoardBase { //configuration int prg_bank_mask_32k, chr_bank_mask_4k; @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -49,18 +49,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int ofs = addr & ((1 << 12) - 1); bank_4k = chr_banks_4k[bank_4k]; addr = (bank_4k << 12) | ofs; - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr |= (prg_bank_32k << 15); - return ROM[addr]; + return Rom[addr]; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { switch (addr) { @@ -78,7 +78,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; default: //apparently these regs are patched in over the WRAM.. - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); break; } } @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // according to the latest on nesdev: // mapper 079: [.... PCCC] @ 4100 // mapper 113: [MCPP PCCC] @ 4100 (no games for this are in bootgod) - class AVE_NINA_006 : NES.NESBoardBase + class AVE_NINA_006 : NesBoardBase { //configuration int prg_bank_mask_32k, chr_bank_mask_8k; @@ -141,7 +141,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } //FCEUX responds to this for PRG writes as well.. ? - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr &= 0x4100; switch (addr) @@ -158,7 +158,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (isMapper79) { @@ -166,33 +166,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr |= (prg_bank_32k << 15); // Some HES games are coming in with only 16 kb of PRG // Othello, and Sidewinder for instance - if (ROM.Length < 0x8000) + if (Rom.Length < 0x8000) { addr &= 0x3FFF; } - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr |= ((chr_bank_8k & chr_bank_mask_8k) << 13); - return VROM[addr]; + return Vrom[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AxROM.cs index 2fbf1b9aa3..c1ba34a1af 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/AxROM.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //generally mapper7 [NES.INESBoardImplPriority] - public sealed class AxROM : NES.NESBoardBase + public sealed class AxROM : NesBoardBase { //configuration bool bus_conflict; @@ -58,30 +58,30 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } prg_mask_32k = Cart.prg_size / 32 - 1; - SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); + SetMirrorType(NesBoardBase.EMirrorType.OneScreenA); return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (Cart.prg_size == 16) { - return ROM[(addr & 0x3FFF) | prg << 15]; + return Rom[(addr & 0x3FFF) | prg << 15]; } - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { - if (ROM != null && bus_conflict) + if (Rom != null && bus_conflict) value = HandleNormalPRGConflict(addr,value); prg = value & prg_mask_32k; if ((value & 0x10) == 0) - SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); + SetMirrorType(NesBoardBase.EMirrorType.OneScreenA); else - SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenB); + SetMirrorType(NesBoardBase.EMirrorType.OneScreenB); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs index 35ffdd48b4..b5cb93290e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Every real instance of [1], [2], [3], [4] had 128K or 256K of each of chr and prg. */ - public sealed class BANDAI_FCG_1 : NES.NESBoardBase + public sealed class BANDAI_FCG_1 : NesBoardBase { //configuration int prg_bank_mask_16k, chr_bank_mask_1k; @@ -222,10 +222,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 9: switch (value & 3) { - case 0: SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); break; - case 1: SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal); break; - case 2: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); break; - case 3: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenB); break; + case 0: SetMirrorType(NesBoardBase.EMirrorType.Vertical); break; + case 1: SetMirrorType(NesBoardBase.EMirrorType.Horizontal); break; + case 2: SetMirrorType(NesBoardBase.EMirrorType.OneScreenA); break; + case 3: SetMirrorType(NesBoardBase.EMirrorType.OneScreenB); break; } break; case 0xA: @@ -233,7 +233,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (jump2) irq_counter = irq_latch; // all write acknolwedge - IRQSignal = false; + IrqSignal = false; break; case 0xB: if (jump2) @@ -267,7 +267,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { //NES.LogLine("writewram {0:X4} = {1:X2}", addr, value); if (regs_wram_enable) @@ -277,10 +277,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (jump2) { - WRAM[addr] = value; + Wram[addr] = value; } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //NES.LogLine("writeprg {0:X4} = {1:X2}", addr, value); if (regs_prg_enable) @@ -305,7 +305,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { // reading any addr in 6000:7fff returns a single bit from the eeprom // in bit 4. @@ -324,17 +324,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - return WRAM[addr]; + return Wram[addr]; } - public override void ClockCPU() + public override void ClockCpu() { if (irq_enabled) { if (irq_counter == 0x0000) { - IRQSignal = true; + IrqSignal = true; irq_counter--; } else @@ -347,7 +347,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); @@ -355,7 +355,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES addr = (bank_16k << 14) | ofs; if (jump2) addr = addr + (jump2_outer_bank << 18); - return ROM[addr]; + return Rom[addr]; } int CalcPPUAddress(int addr) @@ -367,29 +367,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (bank_1k << 10) | ofs; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { if (vram) - return VRAM[addr]; + return Vram[addr]; else - return VROM[CalcPPUAddress(addr)]; + return Vrom[CalcPPUAddress(addr)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { if (vram) - VRAM[addr] = value; + Vram[addr] = value; } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } @@ -404,7 +404,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (jump2) { - return WRAM; + return Wram; } return null; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_02_74.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_02_74.cs index 0763442522..141f7a841f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_02_74.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_02_74.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/INES_Mapper_096 - public sealed class BANDAI_74_161_02_74 : NES.NESBoardBase + public sealed class BANDAI_74_161_02_74 : NesBoardBase { int chr_block; int chr_pos = 0; @@ -35,19 +35,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("prg_bank_16k", ref prg_bank_32k); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_32k = (byte)(value & 0x03); chr_block = (value >> 2) & 0x01; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_32k = prg_bank_32k & prg_bank_mask_32k; - return ROM[(bank_32k << 15) + addr]; + return Rom[(bank_32k << 15) + addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -55,32 +55,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (chr_block == 1) { - return VRAM[(0x1000 * 3 * 2) + addr]; + return Vram[(0x1000 * 3 * 2) + addr]; } else { - return VRAM[(0x1000 * 3) + addr]; + return Vram[(0x1000 * 3) + addr]; } } else { if (chr_block == 1) { - return VRAM[(0x1000 * chr_pos * 2) + addr]; + return Vram[(0x1000 * chr_pos * 2) + addr]; } else { - return VRAM[(0x1000 * chr_pos * 2) + addr]; + return Vram[(0x1000 * chr_pos * 2) + addr]; } } } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -88,31 +88,31 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (chr_block == 1) { - VRAM[(0x1000 * 3 * 2) + addr] = value; + Vram[(0x1000 * 3 * 2) + addr] = value; } else { - VRAM[(0x1000 * 3) + addr] = value; + Vram[(0x1000 * 3) + addr] = value; } } { if (chr_block == 1) { - VRAM[(0x1000 * chr_pos * 2) + addr] = value; + Vram[(0x1000 * chr_pos * 2) + addr] = value; } else { - VRAM[(0x1000 * chr_pos * 2) + addr] = value; + Vram[(0x1000 * chr_pos * 2) + addr] = value; } } } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { byte newpos; if ((addr & 0x3000) != 0x2000) return; @@ -123,7 +123,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_pos = newpos; } - base.AddressPPU(addr); + base.AddressPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_161_32.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_161_32.cs index 6c05e0351e..4128df63a7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_161_32.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI_74_161_161_32.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class BANDAI_74_161_161_32 : NES.NESBoardBase + public sealed class BANDAI_74_161_161_32 : NesBoardBase { //Mapper 70 //Example Games: @@ -48,29 +48,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[0] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_16k = (byte)((value >> 4) & 15); chr = value & 15; SyncPRG(); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x1FFF) + (chr * 0x2000)]; + return Vrom[(addr & 0x1FFF) + (chr * 0x2000)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Bonza.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Bonza.cs index 36842ad2b4..fc9cf806c8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Bonza.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Bonza.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // Magic Jewelry 2 (Unl) - public class Bonza : NES.NESBoardBase + public class Bonza : NesBoardBase { private int _chrReg; private int _prgReg; @@ -33,36 +33,36 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("prgReg", ref _prgReg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _prgReg = addr & 1; _chrReg = (addr >> 1) & 7; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr == 0x1000) { return 0; } - return base.ReadEXP(addr); + return base.ReadExp(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(_prgReg * 0x8000) + (addr & 0x7FFF)]; + return Rom[(_prgReg * 0x8000) + (addr & 0x7FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { // Magic Jewelry has no VROM and does not write chr regs - if (addr < 0x2000 && VROM != null) + if (addr < 0x2000 && Vrom != null) { - return VROM[(_chrReg * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(_chrReg * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BxROM.cs index 39fc42c2ab..f64dc32b49 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BxROM.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA half of mapper 034 (the other half is AVE_NINA_001 which is entirely different..) - public sealed class BxROM : NES.NESBoardBase + public sealed class BxROM : NesBoardBase { //configuration int prg_bank_mask_32k; @@ -47,35 +47,35 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr |= (prg_bank_32k << 15); - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { value = HandleNormalPRGConflict(addr, value); prg_bank_32k = value & prg_bank_mask_32k; chr_bank_8k = ((value >> 4) & 0xF) & chr_bank_mask_8k; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr<0x2000) { - if (VRAM != null) + if (Vram != null) { - return VRAM[addr]; + return Vram[addr]; } else { - return VROM[addr | (chr_bank_8k << 13)]; + return Vrom[addr | (chr_bank_8k << 13)]; } } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs index 1788cf3574..e64fdffd79 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CNROM.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Cybernoid [NES.INESBoardImplPriority] - public sealed class CNROM : NES.NESBoardBase + public sealed class CNROM : NesBoardBase { //configuration int prg_byte_mask, chr_mask; @@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (bus_conflict) value = HandleNormalPRGConflict(addr, value); @@ -135,7 +135,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (chr_enabled == false) { @@ -143,11 +143,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } if (addr < 0x2000) { - return VROM[addr + (chr << 13)]; + return Vrom[addr + (chr << 13)]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } @@ -159,9 +159,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_enabled), ref chr_enabled); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr & prg_byte_mask]; + return Rom[addr & prg_byte_mask]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs index 7045c8c0d1..3bacbf9817 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CPROM.cs @@ -2,7 +2,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class CPROM : NES.NESBoardBase + public sealed class CPROM : NesBoardBase { //generally mapper 13 @@ -32,33 +32,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //TODO - assert that mirror type is vertical? //set it in the cart? - SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); + SetMirrorType(NesBoardBase.EMirrorType.Vertical); return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { value = HandleNormalPRGConflict(addr,value); chr = value&3; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x1000) - return VRAM[addr]; + return Vram[addr]; else if(addr<0x2000) - return VRAM[addr - 0x1000 + (chr << 12)]; - else return base.ReadPPU(addr); + return Vram[addr - 0x1000 + (chr << 12)]; + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x1000) - VRAM[addr] = value; + Vram[addr] = value; else if (addr < 0x2000) - VRAM[addr - 0x1000 + (chr << 12)] = value; - else base.WritePPU(addr,value); + Vram[addr - 0x1000 + (chr << 12)] = value; + else base.WritePpu(addr,value); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs index 562a4e6e35..9ad6b97735 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Camerica.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA mapper 071 //TODO - apparently this mapper contains good nes timing test cases - public sealed class Camerica_Mapper071 : NES.NESBoardBase + public sealed class Camerica_Mapper071 : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -55,7 +55,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0x7000; switch (addr) @@ -76,18 +76,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } } //AKA mapper 232 - class Camerica_Mapper232 : NES.NESBoardBase + class Camerica_Mapper232 : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0x4000; switch (addr) @@ -152,13 +152,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[1] &= prg_bank_mask_16k; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; addr = (bank_16k<<14) | ofs; - return ROM[addr]; + return Rom[addr]; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CamericaGoldenFive.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CamericaGoldenFive.cs index c8047f801e..2a3f82226b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CamericaGoldenFive.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CamericaGoldenFive.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Adapted from - public sealed class CamericaGoldenFive : NES.NESBoardBase + public sealed class CamericaGoldenFive : NesBoardBase { private byte[] regs = new byte[2]; @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("reg", ref regs, false); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x2000) // 80000 { @@ -48,15 +48,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[((regs[0]) << 14) + (addr & 0x3FFF)]; + return Rom[((regs[0]) << 14) + (addr & 0x3FFF)]; } else { - return ROM[((regs[1]) << 14) + (addr & 0x3FFF)]; + return Rom[((regs[1]) << 14) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs index e808c47020..e93328faad 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Cony.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Mapper 83 seems to be a hacky mess that represents 3 different Cony cartridges // http://problemkaputt.de/everynes.htm#mapper83cony - public class ConyA : NES.NESBoardBase + public class ConyA : NesBoardBase { private byte[] prg_regs = new byte[4]; private byte[] low = new byte[4]; // some kind of security feature? @@ -63,7 +63,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 3: SetMirrorType(EMirrorType.OneScreenB); break; } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { @@ -95,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x0200: IRQCount &= 0xFF00; IRQCount |= value; - IRQSignal = false; + IrqSignal = false; break; case 0x0201: IRQCount &= 0xFF; @@ -107,7 +107,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Mirroring(); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -123,7 +123,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank = chr_regs[7]; bank &= chr_bank_mask_2k; - return VROM[(bank << 11) + (addr & 0x7FF)]; + return Vrom[(bank << 11) + (addr & 0x7FF)]; } else { @@ -131,23 +131,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int bank = chr_regs[index]; bank |= ((bank & 0x30) << 4); bank &= 0xFF; - return VROM[(bank << 10) + (addr & 0x3FF)]; + return Vrom[(bank << 10) + (addr & 0x3FF)]; } } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((mode & 0x40) > 0) { if (addr < 0x4000) { - return ROM[(((bank & 0x7) & 0x3F) << 14) + (addr & 0x3FFF)]; + return Rom[(((bank & 0x7) & 0x3F) << 14) + (addr & 0x3FFF)]; } - return ROM[((((bank & 0x7) & 0x30) | 0x7) << 14) + (addr & 0x3FFF)]; + return Rom[((((bank & 0x7) & 0x30) | 0x7) << 14) + (addr & 0x3FFF)]; } else { @@ -157,14 +157,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (index == 3) bank = prg_bank_mask_8k; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } - public override void ClockCPU() + public override void ClockCpu() { if (IRQa) { @@ -172,33 +172,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (IRQCount == 0) { IRQCount = 0xFFFF; - IRQSignal = true; + IrqSignal = true; IRQa = false; } } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1100 && addr <= 0x1103) low[addr & 0x3] = value; else - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr == 0x1000) return (byte)((NES.DB & 0xFC) | 0); else if (addr >= 0x1100 && addr <= 0x1103) return low[addr & 0x3]; else - return base.ReadEXP(addr); + return base.ReadExp(addr); } } - public class ConyB : NES.NESBoardBase + public class ConyB : NesBoardBase { private byte[] prg_regs = new byte[4]; private byte[] low = new byte[4]; // some kind of security feature? @@ -254,7 +254,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 3: SetMirrorType(EMirrorType.OneScreenB); break; } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { @@ -286,7 +286,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x0200: IRQCount &= 0xFF00; IRQCount |= value; - IRQSignal = false; + IrqSignal = false; break; case 0x0201: IRQCount &= 0xFF; @@ -298,7 +298,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Mirroring(); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -313,30 +313,30 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (index == 3) bank = chr_regs[7]; - return VROM[(bank << 11) + (addr & 0x7FF)]; + return Vrom[(bank << 11) + (addr & 0x7FF)]; } else { int index = (addr >> 10) & 0x7; int bank = chr_regs[index]; bank |= ((bank & 0x30) << 4); - return VROM[(bank << 10) + (addr & 0x3FF)]; + return Vrom[(bank << 10) + (addr & 0x3FF)]; } } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((mode & 0x40)>0) { if (addr < 0x4000) { - return ROM[((bank&0x3F) << 14) + (addr & 0x3FFF)]; + return Rom[((bank&0x3F) << 14) + (addr & 0x3FFF)]; } - return ROM[(((bank & 0x30) | 0xF) << 14) + (addr & 0x3FFF)]; + return Rom[(((bank & 0x30) | 0xF) << 14) + (addr & 0x3FFF)]; } else { int index = (addr >> 13) & 0x3; @@ -346,14 +346,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (index == 3) bank = prg_bank_mask_8k; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } - public override void ClockCPU() + public override void ClockCpu() { if (IRQa) { @@ -361,35 +361,35 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (IRQCount==0) { IRQCount = 0xFFFF; - IRQSignal = true; + IrqSignal = true; IRQa = false; } } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1100 && addr <= 0x1103) low[addr & 0x3] = value; else - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr == 0x1000) return (byte)((NES.DB & 0xFC) | 0); else if (addr >= 0x1100 && addr <= 0x1103) return low[addr & 0x3]; else - return base.ReadEXP(addr); + return base.ReadExp(addr); } } - public class ConyC : NES.NESBoardBase + public class ConyC : NesBoardBase { private byte[] prg_regs = new byte[2]; private byte[] chr_regs = new byte[8]; @@ -429,7 +429,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(prg_regs), ref prg_regs, false); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr == 0) { @@ -444,7 +444,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else if (addr == 0x200) { IRQCount &= 0xFF00; IRQCount |= value; - IRQSignal = false; + IrqSignal = false; } else if (addr == 0x201) @@ -459,29 +459,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int index = (addr >> 10) & 0x7; int bank = chr_regs[index]; - return VROM[(bank << 10) + (addr & 0x3FF)]; + return Vrom[(bank << 10) + (addr & 0x3FF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[(prg_regs[0] << 14) + (addr & 0x3FFF)]; + return Rom[(prg_regs[0] << 14) + (addr & 0x3FFF)]; } - return ROM[(prg_regs[1] << 14) + (addr & 0x3FFF)]; + return Rom[(prg_regs[1] << 14) + (addr & 0x3FFF)]; } - public override void ClockCPU() + public override void ClockCpu() { if (IRQa) { @@ -489,7 +489,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (IRQCount == 0) { IRQCount = 0xFFFF; - IRQSignal = IRQ_enable; + IrqSignal = IRQ_enable; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CoolBoy.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CoolBoy.cs index 3f4cc1d502..0a990442ec 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CoolBoy.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/CoolBoy.cs @@ -38,7 +38,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x1000) { @@ -120,7 +120,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(exp), ref exp, false); } - public override void NESSoftReset() + public override void NesSoftReset() { Array.Clear(exp, 0, 4); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs index cb8f951d39..84ff0edd29 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs @@ -18,7 +18,7 @@ using BizHawk.Emulation.Cores.Components; namespace BizHawk.Emulation.Cores.Nintendo.NES { [NES.INESBoardImplPriorityAttribute] - public sealed class ExROM : NES.NESBoardBase + public sealed class ExROM : NesBoardBase { //configuraton int prg_bank_mask_8k, chr_bank_mask_1k; //board setup (to be isolated from mmc5 code later, when we need the separate mmc5 class) @@ -195,14 +195,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { int? bbank = MaskWRAM(bank); if (bbank.HasValue) - WRAM[(int)bbank << 13 | offs] = value; + Wram[(int)bbank << 13 | offs] = value; } byte ReadWRAMActual(int bank, int offs) { int? bbank = MaskWRAM(bank); return bbank.HasValue - ? WRAM[(int)bbank << 13 | offs] + ? Wram[(int)bbank << 13 | offs] : NES.DB; } @@ -268,12 +268,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = MapCHR(addr); - return (VROM ?? VRAM)[addr]; + return (Vrom ?? Vram)[addr]; } addr -= 0x2000; @@ -333,7 +333,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x2000) { addr = MapCHR(addr); - return (VROM ?? VRAM)[addr]; + return (Vrom ?? Vram)[addr]; } addr -= 0x2000; @@ -388,12 +388,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - if (VRAM != null) - VRAM[MapCHR(addr)] = value; + if (Vram != null) + Vram[MapCHR(addr)] = value; } else { @@ -421,11 +421,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteWRAM(int addr, byte value) => WriteWRAMActual(wram_bank, addr & 0x1fff, value); + public override void WriteWram(int addr, byte value) => WriteWRAMActual(wram_bank, addr & 0x1fff, value); - public override byte ReadWRAM(int addr) => ReadWRAMActual(wram_bank, addr & 0x1fff); + public override byte ReadWram(int addr) => ReadWRAMActual(wram_bank, addr & 0x1fff); - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { byte ret; int offs = addr & 0x1fff; @@ -434,7 +434,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (ram) ret = ReadWRAMActual(bank, offs); else - ret = ROM[bank << 13 | offs]; + ret = Rom[bank << 13 | offs]; if (addr < 0x4000) audio.ReadROMTrigger(ret); return ret; @@ -445,7 +445,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr >= 0x8000) return PeekPRG(addr - 0x8000); if (addr >= 0x6000) - return ReadWRAM(addr - 0x6000); + return ReadWram(addr - 0x6000); return PeekEXP(addr - 0x4000); } @@ -458,20 +458,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (ram) ret = ReadWRAMActual(bank, offs); else - ret = ROM[bank << 13 | offs]; + ret = Rom[bank << 13 | offs]; //if (addr < 0x4000) // audio.ReadROMTrigger(ret); return ret; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { int bank = PRGGetBank(addr, out var ram); if (ram) WriteWRAMActual(bank, addr & 0x1fff, value); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { //NES.LogLine("MMC5 WriteEXP: ${0:x4} = ${1:x2}", addr, value); if (addr >= 0x1000 && addr <= 0x1015) @@ -585,7 +585,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES product_high = (byte)((result>>8) & 0xFF); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { byte ret = 0xFF; switch (addr) @@ -663,10 +663,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = (irq_pending && irq_enabled) || irq_audio; + IrqSignal = (irq_pending && irq_enabled) || irq_audio; } - public override void ClockPPU() + public override void ClockPpu() { if (NES.ppu.ppur.status.cycle != 336) return; @@ -703,7 +703,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void ClockCPU() + public override void ClockCpu() { audio.Clock(); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper006.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper006.cs index 5bf1548cf8..31c93bd726 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper006.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper006.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper006 : NES.NESBoardBase + public class Mapper006 : NesBoardBase { private int _reg; @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("irqCount", ref _irqCount); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { // Mirroring if (addr == 0x2FE || addr == 0x2FF) @@ -87,44 +87,44 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr < 0x4000 ? (_reg >> 2) & 0x3F : 7; bank &= _prgMask16k; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VRAM[((_reg & 3) * 0x2000) + (addr & 0x1FFF)]; + return Vram[((_reg & 3) * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - VRAM[((_reg & 3) * 0x2000) + (addr & 0x1FFF)] = value; + Vram[((_reg & 3) * 0x2000) + (addr & 0x1FFF)] = value; } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } - public override void ClockCPU() + public override void ClockCpu() { if (_irqEnable) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs index 63115f0aaf..5695f0504f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FFE/Mapper017.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper017 : NES.NESBoardBase + public class Mapper017 : NesBoardBase { private byte[] prg_regs_8k = new byte[4]; private byte[] chr_regs_1k = new byte[8]; @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr & 0x7FF) { @@ -110,38 +110,38 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(irq_count), ref irq_count); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = prg_regs_8k[addr >> 13]; bank_8k &= prg_mask_8k; int offset = addr & 0x1FFF; - return ROM[bank_8k << 13 | offset]; + return Rom[bank_8k << 13 | offset]; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { - if (addr < 0x2000 && VRAM != null) + if (addr < 0x2000 && Vram != null) { - VRAM[addr] = value; + Vram[addr] = value; } - base.WritePPU(addr, value); + base.WritePpu(addr, value); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - if (VRAM != null) return VRAM[addr]; + if (Vram != null) return Vram[addr]; int bank_1k = chr_regs_1k[addr >> 10]; bank_1k &= chr_mask_1k; int offset = addr & 0x3FF; - return VROM[bank_1k << 10 | offset]; + return Vrom[bank_1k << 10 | offset]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void ClockCPU() + public override void ClockCpu() { if (irq_enable) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs index f0cf13a11c..48c52b42dc 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs @@ -1,6 +1,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class FS304 : NES.NESBoardBase + public class FS304 : NesBoardBase { // waixing? @@ -27,7 +27,7 @@ return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr & 0x1300) { @@ -47,9 +47,9 @@ prg &= prg_mask_32k; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Farid-UNROM-8-in-1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Farid-UNROM-8-in-1.cs index 94c1ae52e2..6178ab4c41 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Farid-UNROM-8-in-1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Farid-UNROM-8-in-1.cs @@ -1,6 +1,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Farid_UNROM_8_in_1 : NES.NESBoardBase + public sealed class Farid_UNROM_8_in_1 : NesBoardBase { // http://forums.nesdev.com/viewtopic.php?f=9&t=11099 @@ -27,7 +27,7 @@ return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prginner = value & 7; int newc = value >> 7; @@ -41,11 +41,11 @@ c = newc; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bnk = addr >= 0x4000 ? 7 : prginner; bnk |= prgouter << 3; - return ROM[bnk << 14 | addr & 0x3fff]; + return Rom[bnk << 14 | addr & 0x3fff]; } public override void SyncState(BizHawk.Common.Serializer ser) @@ -57,7 +57,7 @@ ser.Sync(nameof(prgouter), ref prgouter); } - public override void NESSoftReset() + public override void NesSoftReset() { e = 0; prgouter = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GameGenie.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GameGenie.cs index 116c239fe4..e587cf6655 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GameGenie.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GameGenie.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // this is an internal testing thing, not really for using - public class GameGenie : NES.NESBoardBase + public class GameGenie : NesBoardBase { static byte[] PatternTables = new byte[256]; @@ -49,23 +49,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) return NES.DB; else - return ROM[addr & 0xfff]; + return Rom[addr & 0xfff]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr >= 0x2000) - return base.ReadPPU(addr); + return base.ReadPpu(addr); else return PatternTables[addr & 0xff]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { NES.LogLine("{0:x4}<={1:x2}", addr + 0x8000, value); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GxROM.cs index 1edc25e1f5..f7b84bfd3a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/GxROM.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //TODO - bus conflicts [NES.INESBoardImplPriority] - public sealed class GxROM : NES.NESBoardBase + public sealed class GxROM : NesBoardBase { //configuraton int prg_mask, chr_mask; @@ -55,21 +55,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr + (prg<<15)]; + return Rom[addr + (prg<<15)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr + (chr << 13)]; + return Vrom[addr + (chr << 13)]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { chr = ((value & 7) & chr_mask); prg = (((value>>4) & 3) & prg_mask); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IC_74x377.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IC_74x377.cs index b3765682d6..c28ad54dd0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IC_74x377.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IC_74x377.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Metal Fighter [NES.INESBoardImplPriority] - public sealed class IC_74x377 : NES.NESBoardBase + public sealed class IC_74x377 : NesBoardBase { //configuration int prg_bank_mask_32k, chr_bank_mask_8k; @@ -53,21 +53,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr + (prg_bank_32k << 15)]; + return Rom[addr + (prg_bank_32k << 15)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr + (chr_bank_8k << 13)]; + return Vrom[addr + (chr_bank_8k << 13)]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (bus_conflict_50282) { @@ -75,12 +75,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //if (addr == 0) // return; // this is what nesdev wiki does. seems to give same results as above? - value = (byte)((value | 1) & ReadPRG(addr)); + value = (byte)((value | 1) & ReadPrg(addr)); } if (bus_conflict) { byte old_value = value; - value &= ReadPRG(addr); + value &= ReadPrg(addr); //Bible Adventures (Unl) (V1.3) [o1].nes will exercise this bus conflict, but not really test it. (works without bus conflict emulation Debug.Assert(old_value == value, "Found a test case of Discrete_74x377 bus conflict. please report."); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs new file mode 100644 index 0000000000..a967560813 --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/INesBoard.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using BizHawk.Common; + +namespace BizHawk.Emulation.Cores.Nintendo.NES +{ + public interface INesBoard + { + // base class pre-configuration + void Create(NES nes); + + // one-time inherited classes configuration + bool Configure(NES.EDetectionOrigin origin); + + // one-time base class configuration (which can take advantage of any information setup by the more-informed Configure() method) + void PostConfigure(); + + // gets called once per PPU clock, for boards with complex behaviour which must be monitoring clock (i.e. mmc3 irq counter) + void ClockPpu(); + + // gets called once per CPU clock; typically for boards with M2 counters + void ClockCpu(); + + byte PeekCart(int addr); + + byte ReadPrg(int addr); + byte ReadPpu(int addr); + byte PeekPPU(int addr); + void AddressPpu(int addr); + byte ReadWram(int addr); + byte ReadExp(int addr); + byte ReadReg2xxx(int addr); + byte PeekReg2xxx(int addr); + void WritePrg(int addr, byte value); + void WritePpu(int addr, byte value); + void WriteWram(int addr, byte value); + void WriteExp(int addr, byte value); + void WriteReg2xxx(int addr, byte value); + void NesSoftReset(); + void AtVsyncNmi(); + byte[] SaveRam { get; } + byte[] Wram { get; set; } + byte[] Vram { get; set; } + byte[] Rom { get; set; } + byte[] Vrom { get; set; } + void SyncState(Serializer ser); + bool IrqSignal { get; } + + //mixes the board's custom audio into the supplied sample buffer + void ApplyCustomAudio(short[] samples); + + Dictionary InitialRegisterValues { get; set; } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs index 79b01d0590..1d7a034277 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //the 4screen implementation is a bit of a guess, but it seems to work - public sealed class IREM_74_161_161_21_138 : NES.NESBoardBase + public sealed class IREM_74_161_161_21_138 : NesBoardBase { int chr, prg; public override bool Configure(NES.EDetectionOrigin origin) @@ -36,40 +36,40 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(prg), ref prg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { chr = (value >> 4) & 0x0F; prg = value & 0x0F; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x0800) - return VROM[addr + (chr * 0x0800)]; + return Vrom[addr + (chr * 0x0800)]; else if (addr < 0x2000) - return VRAM[addr]; + return Vram[addr]; else if (addr < 0x2800) - return VRAM[addr & 0x7ff]; - else return base.ReadPPU(addr); + return Vram[addr & 0x7ff]; + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x0800) return; else if (addr < 0x2000) - VRAM[addr] = value; + Vram[addr] = value; else if (addr < 0x2800) - VRAM[addr & 0x7ff] = value; - else base.WritePPU(addr, value); + Vram[addr & 0x7ff] = value; + else base.WritePpu(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x8000) - return ROM[addr + (prg * 0x8000)]; + return Rom[addr + (prg * 0x8000)]; else - return base.ReadPRG(addr); + return base.ReadPrg(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM_TAM_S1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM_TAM_S1.cs index b83326d7f9..9c90c38ab3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM_TAM_S1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/IREM_TAM_S1.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //iNES Mapper 97 //Kaiketsu Yanchamaru (Kid Niki 1) - public sealed class IREM_TAM_S1 : NES.NESBoardBase + public sealed class IREM_TAM_S1 : NesBoardBase { int prg_bank_mask_16k; byte prg_bank_16k; @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[1] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_16k = (byte)(value & 15); SyncPRG(); @@ -64,14 +64,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_G101.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_G101.cs index abee0ef033..d3f3a5212a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_G101.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_G101.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Major League //Kaiketsu Yanchamaru 2 - public sealed class Irem_G101 : NES.NESBoardBase + public sealed class Irem_G101 : NesBoardBase { //configuration int prg_bank_mask, chr_bank_mask; @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else SetMirrorType(EMirrorType.Horizontal); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0xF007; switch (addr) @@ -112,7 +112,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -121,13 +121,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k = chr_regs_1k[bank_1k]; bank_1k &= chr_bank_mask; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); @@ -135,7 +135,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_8k = prg_regs_8k[bank_8k]; bank_8k &= prg_bank_mask; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_H3001.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_H3001.cs index a4f51a96fe..0f604d662f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_H3001.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Irem_H3001.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //NOTE - fceux support for this mapper has some kind of -4 cpu cycle delay built into the timer. not sure yet whether we need that - public sealed class Irem_H3001 : NES.NESBoardBase + public sealed class Irem_H3001 : NesBoardBase { //configuration int prg_bank_mask, chr_bank_mask; @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } }*/ - public override void ClockCPU() + public override void ClockCpu() { if (irq_counter == 0) return; if (!irq_counter_enabled) return; @@ -81,20 +81,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = irq_asserted; + IrqSignal = irq_asserted; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_regs_8k[bank_8k]; bank_8k &= prg_bank_mask; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -103,13 +103,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k = chr_regs_1k[bank_1k]; bank_1k &= chr_bank_mask; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs index 9b9b8db7af..55d4f80f79 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Ninja Jajamaru Kun - JF_06 Argus (J) - JF_07 */ - public sealed class JALECO_JF_05_06_07 : NES.NESBoardBase + public sealed class JALECO_JF_05_06_07 : NesBoardBase { int prg_byte_mask; int chr; @@ -56,24 +56,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr), ref chr); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { // 2 bits, but flipped chr = value << 1 & 2 | value >> 1 & 1; chr &= chr_mask_8k; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr | chr << 13]; + return Vrom[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr & prg_byte_mask]; + return Rom[addr & prg_byte_mask]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs index 333ac7f667..a9c429a457 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_13.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Moero!! Pro Yakyuu (Black) //Moero!! Pro Yakyuu (Red) - public sealed class JALECO_JF_13 : NES.NESBoardBase + public sealed class JALECO_JF_13 : NesBoardBase { //configuration int prg_bank_mask_32k; @@ -39,23 +39,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x8000) - return ROM[addr + (prg * 0x8000)]; + return Rom[addr + (prg * 0x8000)]; else - return base.ReadPRG(addr); + return base.ReadPrg(addr); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x1FFF) + (chr * 0x2000)]; + return Vrom[(addr & 0x1FFF) + (chr * 0x2000)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { switch (addr & 0x1000) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs index e3e09434b7..cc36694d5d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_17.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //when the top 2 bits arent 0, theyre written to the latch //interestingly, this works (for pinball quest) only when bus conflicts are applied, otherwise the game cant get past the title - public sealed class JALECO_JF_17 : NES.NESBoardBase + public sealed class JALECO_JF_17 : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_banks_8k), ref chr_banks_8k, false); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("MAP {0:X4} = {1:X2}", addr, value); @@ -86,20 +86,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(14, prg_banks_16k, addr); - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = ApplyMemoryMap(13, chr_banks_8k, addr); return base.ReadPPUChr(addr); } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_19.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_19.cs index 4103579a6e..df9df2c267 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_19.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_JF_19.cs @@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Near Identical to Jaleco JF 17, except for a slight PRG setup - public sealed class JALECO_JF_19 : NES.NESBoardBase + public sealed class JALECO_JF_19 : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_banks_8k), ref chr_banks_8k, false); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("MAP {0:X4} = {1:X2}", addr, value); @@ -92,20 +92,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SyncMap(); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(14, prg_banks_16k, addr); - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = ApplyMemoryMap(13, chr_banks_8k, addr); return base.ReadPPUChr(addr); } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs index 67b74c1a81..4172c3f03f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/JALECO_SS8806.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class JALECO_SS8806 : NES.NESBoardBase + public sealed class JALECO_SS8806 : NesBoardBase { //http://wiki.nesdev.com/w/index.php/INES_Mapper_018 @@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; //temporary @@ -191,12 +191,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; case 0xF000: // ack irq and reset - IRQSignal = false; + IrqSignal = false; irqclock = irqreload; break; case 0xF001: // ack irq and set values - IRQSignal = false; + IrqSignal = false; irqcountpaused = (value & 1) == 0; if ((value & 8) == 8) irqcountwidth = 4; @@ -216,14 +216,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void ClockCPU() + public override void ClockCpu() { if (!irqcountpaused) { int newclock = irqclock - 1; if (squeeze(newclock) > squeeze(irqclock)) { - IRQSignal = true; + IrqSignal = true; irqclock = irqreload; } else @@ -245,12 +245,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; bank_8k = prg_banks_8k[bank_8k]; bank_8k &= prg_bank_mask_8k; - return ROM[(bank_8k * 0x2000) + (addr & 0x1FFF)]; + return Rom[(bank_8k * 0x2000) + (addr & 0x1FFF)]; } private int MapCHR(int addr) @@ -262,16 +262,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = MapCHR(addr); - if (VROM != null) - return VROM[addr]; - else return VRAM[addr]; + if (Vrom != null) + return Vrom[addr]; + else return Vram[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs index aaf436a29a..d5fa7b2627 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Jaleco-JF_11_14.cs @@ -21,7 +21,7 @@ Other chips used: Sunsoft-1 * Bio Senshi Dan - Increaser Tono Tatakai [allegedly; but it does not work] */ - public sealed class Jaleco_JF_11_14 : NES.NESBoardBase + public sealed class Jaleco_JF_11_14 : NesBoardBase { int chr, prg; @@ -43,23 +43,23 @@ Other chips used: Sunsoft-1 return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x8000) - return ROM[addr + (prg * 0x8000)]; + return Rom[addr + (prg * 0x8000)]; else - return base.ReadPRG(addr); + return base.ReadPrg(addr); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x1FFF) + (chr * 0x2000)]; + return Vrom[(addr & 0x1FFF) + (chr * 0x2000)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { prg = (value >> 4) & 3; chr = (value & 15); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-ACTION52.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-ACTION52.cs index 3686669875..51ae10546e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-ACTION52.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-ACTION52.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_228 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class MLT_ACTION52 : NES.NESBoardBase + public sealed class MLT_ACTION52 : NesBoardBase { [MapperProp] public bool prg_mode = false; @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1800) { @@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1800) { @@ -74,11 +74,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - return base.ReadEXP(addr); + return base.ReadExp(addr); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //$8000-FFFF: [.... ..CC] Low 2 bits of CHR //A~[..MH HPPP PPO. CCCC] @@ -117,25 +117,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((chr_reg & chr_bank_mask_8k) * 0x2000) + addr]; + return Vrom[((chr_reg & chr_bank_mask_8k) * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode == false) { int bank = (prg_reg >> 1) & prg_bank_mask_32k; - return ROM[(bank * 0x8000) + addr + chip_offset]; + return Rom[(bank * 0x8000) + addr + chip_offset]; } else { - return ROM[((prg_reg & prg_bank_mask_16k) * 0x4000) + (addr & 0x3FFF) + chip_offset]; + return Rom[((prg_reg & prg_bank_mask_16k) * 0x4000) + (addr & 0x3FFF) + chip_offset]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs index 408d47daa8..805c6efcd3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MLT-MAX15.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class MLT_MAX15 : NES.NESBoardBase + public sealed class MLT_MAX15 : NesBoardBase { //http://wiki.nesdev.com/w/index.php/INES_Mapper_234 @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { mode = false; block_high = 0; @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_bank = 0; chr_bank_high = 0; reg_0_locked = false; - base.NESSoftReset(); + base.NesSoftReset(); SetMirrorType(EMirrorType.Vertical); } @@ -56,11 +56,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x7F80) { - base.WritePRG(addr, value); + base.WritePrg(addr, value); } else { @@ -106,7 +106,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank; if (mode) @@ -118,18 +118,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank = (block_high << 1) | block_low; } - byte value = ROM[((bank & prg_bank_mask_32k) * 0x8000) + (addr & 0x7FFF)]; + byte value = Rom[((bank & prg_bank_mask_32k) * 0x8000) + (addr & 0x7FFF)]; if (addr >= 0x7F80) { - WritePRG(addr, value); + WritePrg(addr, value); } return value; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -143,9 +143,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank = (block_high << 3) | (block_low << 2) | chr_bank_high; } - return VROM[((bank & chr_bank_mask_8k) * 0x2000) + (addr & 0x1FFF)]; + return Vrom[((bank & chr_bank_mask_8k) * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs index 91aeebdf55..79faedfa62 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/HKROM.cs @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(wram_l_enabled_write), ref wram_l_enabled_write); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0x6001) { @@ -73,10 +73,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } break; } - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x1000) return; @@ -90,10 +90,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bool write_enabled = (block == 1) ? wram_h_enabled_write : wram_l_enabled_write; if (write_enabled && block_enabled) - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { byte open_bus = 0xFF; //open bus if (addr < 0x1000) @@ -110,7 +110,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return open_bus; if (block_enabled) - return base.ReadWRAM(addr); + return base.ReadWram(addr); return 0; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs index 4674b6127c..06659369c6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/MMC3.cs @@ -51,23 +51,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } bool oldIrqType; - public NES.NESBoardBase.EMirrorType MirrorType + public NesBoardBase.EMirrorType MirrorType { get { switch (mirror) { default: - case 0: return NES.NESBoardBase.EMirrorType.Vertical; - case 1: return NES.NESBoardBase.EMirrorType.Horizontal; - case 2: return NES.NESBoardBase.EMirrorType.OneScreenA; - case 3: return NES.NESBoardBase.EMirrorType.OneScreenB; + case 0: return NesBoardBase.EMirrorType.Vertical; + case 1: return NesBoardBase.EMirrorType.Horizontal; + case 2: return NesBoardBase.EMirrorType.OneScreenA; + case 3: return NesBoardBase.EMirrorType.OneScreenB; } } } - protected NES.NESBoardBase board; - public MMC3(NES.NESBoardBase board, int num_prg_banks) + protected NesBoardBase board; + public MMC3(NesBoardBase board, int num_prg_banks) { MirrorMask = 1; this.board = board; @@ -309,19 +309,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public abstract class MMC3Board_Base : NES.NESBoardBase + public abstract class MMC3Board_Base : NesBoardBase { //state public MMC3 mmc3; public int extra_vrom; - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { mmc3.AddressPPU(addr); } - public override void ClockPPU() + public override void ClockPpu() { mmc3.ClockPPU(); } @@ -355,42 +355,42 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = MapCHR(addr); - if (VROM != null) - return VROM[addr + extra_vrom]; - else return VRAM[addr]; + if (Vrom != null) + return Vrom[addr + extra_vrom]; + else return Vram[addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - if (VRAM == null) return; + if (Vram == null) return; addr = MapCHR(addr); - VRAM[addr] = value; + Vram[addr] = value; } - base.WritePPU(addr, value); + base.WritePpu(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { mmc3.WritePRG(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= prg_mask; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } protected virtual void BaseSetup() diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs index dedcae7b0e..63023b48ff 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper012.cs @@ -30,9 +30,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int block0, block1; - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); block0 = value & 1; block1 = (value >> 4) & 1; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper037.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper037.cs index 1e082ecef3..47168b78b2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper037.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper037.cs @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!mmc3.wram_enable || mmc3.wram_write_protect) return; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs index a92224030b..0288816333 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper044.cs @@ -29,9 +29,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int block_select; - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { - base.WritePRG(addr, value); + base.WritePrg(addr, value); switch (addr & 0x6001) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs index 604058dc7d..1939fbc9f9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper049.cs @@ -35,13 +35,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int block, prg; bool mode; - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!mmc3.wram_enable || mmc3.wram_write_protect) return; mode = value.Bit(0); prg = (value >> 4) & 3; block = (value >> 6) & 3; - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper052.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper052.cs index 2cebd03ecb..91b728a267 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper052.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper052.cs @@ -37,21 +37,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void NESSoftReset() + public override void NesSoftReset() { lock_regs = false; prg_block_size = false; chr_block_size = false; prg_or = 0; chr_or = 0; - base.NESSoftReset(); + base.NesSoftReset(); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (lock_regs) { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } else { @@ -68,14 +68,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= PRG_AND(); bank_8k |= PRG_OR(); bank_8k &= prg_mask; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } private int PRG_AND() diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs index da514e8808..e1aacc75d4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper074.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return false; } - VRAM = new byte[2048]; + Vram = new byte[2048]; if (Cart.chr_size == 0 && Cart.board_type == "MAPPER074") throw new Exception("Mapper074 carts MUST have chr rom!"); @@ -30,61 +30,61 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { int bank = Get_CHRBank_1K(addr); if (bank == 0x08) { - VRAM[addr & 0x03FF] = value; + Vram[addr & 0x03FF] = value; } else if (bank == 0x09) { - VRAM[(addr & 0x03FF) + 0x400] = value; + Vram[(addr & 0x03FF) + 0x400] = value; } // Ying Kiong Chuan Qi, no VROM // Nestopia maps this to mapper 224, perhaps we should do the same instead of attempt to account for this scenario here else { addr = MapCHR(addr); - VRAM[addr & (VRAM.Length - 1)] = value; + Vram[addr & (Vram.Length - 1)] = value; } } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = Get_CHRBank_1K(addr); if (bank == 0x08) { - return VRAM[addr & 0x03FF]; + return Vram[addr & 0x03FF]; } if (bank == 0x09) { - return VRAM[(addr & 0x03FF) + 0x400]; + return Vram[(addr & 0x03FF) + 0x400]; } addr = MapCHR(addr); // Ying Kiong Chuan Qi, no VROM // Nestopia maps this to mapper 224, perhaps we should do the same instead of attempt to account for this scenario here - if (VROM == null) + if (Vrom == null) { - return VRAM[addr]; + return Vram[addr]; } - return VROM[addr]; + return Vrom[addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs index b0aae00fa8..21d5557580 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper114.cs @@ -34,7 +34,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("expregs", ref EXPREGS, false); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if ((addr & 0x7) == 0 && addr >= 0x1000) { @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if ((addr & 0x7) == 0) { @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0x6000) { @@ -60,39 +60,39 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x2000: //$A000 value = (byte)((value & 0xC0) | sec[value & 0x07]); EXPREGS[1] = 1; - base.WritePRG(0, value); + base.WritePrg(0, value); break; case 0x4000: //$C000 if(EXPREGS[1] == 1) { EXPREGS[1] = 0; - base.WritePRG(1, value); + base.WritePrg(1, value); } break; case 0x6000: //$E000 if (value > 0) { - base.WritePRG(0x6001, value); - base.WritePRG(0x4000, value); - base.WritePRG(0x4001, value); + base.WritePrg(0x6001, value); + base.WritePrg(0x4000, value); + base.WritePrg(0x4001, value); } else { - base.WritePRG(0x6000, value); + base.WritePrg(0x6000, value); } break; } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((EXPREGS[0] & 0x80) > 0) { var bank = EXPREGS[0] & 0x1F & prg_mask_16; - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } - return base.ReadPRG(addr); + return base.ReadPrg(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs index fd46dacfe8..d899c85a26 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper115.cs @@ -36,9 +36,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bool prg_mode_mapper; int prg_page, chr_block_or; - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); switch (addr & 1) { case 0: diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs index 8fc9104fc9..b344585bb7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper121.cs @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(exRegs), ref exRegs, false); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1000) { @@ -37,11 +37,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - return base.ReadEXP(addr); + return base.ReadExp(addr); } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) // 0x5000-0x5FFF { @@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; @@ -66,10 +66,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_8k &= prg_mask; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x2000) { @@ -91,13 +91,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else if ((addr & 1)>0) - base.WritePRG(addr, value); + base.WritePrg(addr, value); else //if (addr==0) - base.WritePRG(0, value); + base.WritePrg(0, value); } else { - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper123.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper123.cs index f026062e25..27fe4a3f6e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper123.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper123.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("expregs", ref EXPREGS, false); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) { @@ -48,44 +48,44 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x2000) { switch ((addr + 0x8000) & 0x8001) { - case 0x8000: base.WritePRG(0x8000, (byte)((value & 0xC0) | sec[value&7])); break; - case 0x8001: base.WritePRG(0x8001, value); break; + case 0x8000: base.WritePrg(0x8000, (byte)((value & 0xC0) | sec[value&7])); break; + case 0x8001: base.WritePrg(0x8001, value); break; } } else { - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((EXPREGS[0] & 0x40) > 0) { var bank = (EXPREGS[0] & 5) | ((EXPREGS[0] & 8) >> 2) | ((EXPREGS[0] & 0x20) >> 2); if ((EXPREGS[0] & 2) > 0) { - return ROM[((bank >> 1) << 15) + (addr & 0x7FFF)]; + return Rom[((bank >> 1) << 15) + (addr & 0x7FFF)]; } else { - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } } else { //return (byte)(base.ReadPRG(addr) & 0x3F); - return base.ReadPRG(addr); + return base.ReadPrg(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs index f2e5a13f8d..41fc3df9cc 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs @@ -26,14 +26,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(reg), ref reg); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr == 1) // 0x6001 { reg = value; } - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } protected override int Get_PRGBank_8K(int addr) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper165.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper165.cs index ee95bb2214..5d3951d2c9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper165.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper165.cs @@ -45,16 +45,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int bank = mmc3.regs[addr < 0x1000 ? latch0 ? 1 : 0 : latch1 ? 4 : 2]; if (bank == 0) - ret = VRAM[addr & 0xfff]; + ret = Vram[addr & 0xfff]; else - ret = VROM[(addr & 0xfff) + (((bank >> 2) & real_chr_mask) << 12)]; + ret = Vrom[(addr & 0xfff) + (((bank >> 2) & real_chr_mask) << 12)]; } else - ret = base.ReadPPU(addr); + ret = base.ReadPpu(addr); return ret; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { byte ret; if (addr < 0x2000) @@ -62,12 +62,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int bank = mmc3.regs[addr < 0x1000 ? latch0 ? 1 : 0 : latch1 ? 4 : 2]; if (bank == 0) - ret = VRAM[addr & 0xfff]; + ret = Vram[addr & 0xfff]; else - ret = VROM[(addr & 0xfff) + (((bank >> 2) & real_chr_mask) << 12)]; + ret = Vrom[(addr & 0xfff) + (((bank >> 2) & real_chr_mask) << 12)]; } else - ret = base.ReadPPU(addr); + ret = base.ReadPpu(addr); // latch processes for the next read switch (addr & 0x3ff8) @@ -80,16 +80,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { int bank = mmc3.regs[addr < 0x1000 ? latch0 ? 1 : 0 : latch1 ? 4 : 2]; if (bank == 0) - VRAM[addr & 0xfff] = value; + Vram[addr & 0xfff] = value; } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper182.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper182.cs index 1ad33fbf4f..8825f225a5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper182.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper182.cs @@ -18,25 +18,25 @@ return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; switch (addr & 0xE001) { case 0x8000: break; //? - case 0x8001: base.WritePRG(0xA000,value); break; + case 0x8001: base.WritePrg(0xA000,value); break; case 0xA000: value = (byte)scramble_A000(value); - base.WritePRG(0x8000,value); + base.WritePrg(0x8000,value); break; case 0xA001: break; //? - case 0xC000: base.WritePRG(0x8001, value); break; + case 0xC000: base.WritePrg(0x8001, value); break; case 0xC001: - base.WritePRG(0xC000, value); - base.WritePRG(0xC001, value); + base.WritePrg(0xC000, value); + base.WritePrg(0xC001, value); break; default: - base.WritePRG(addr, value); + base.WritePrg(addr, value); break; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs index 2679877c77..fb48f48794 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper187.cs @@ -29,49 +29,49 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("expregs", ref exRegs, false); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr == 0) { exRegs[1] = 1; - base.WritePRG(addr, value); + base.WritePrg(addr, value); } else if ((addr == 0x0001) && (exRegs[1] > 0)) { - base.WritePRG(addr, value); + base.WritePrg(addr, value); } else - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x1000) // 0x5000 { exRegs[0] = value; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr == 0x0000) { exRegs[0] = value; } - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1000) { return prot_data[exRegs[1] & 3]; } - return base.ReadEXP(addr); + return base.ReadExp(addr); } private byte MMc3_cmd => (byte)(mmc3.chr_mode ? 0x80 : 0); @@ -86,7 +86,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return base.Get_CHRBank_1K(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((exRegs[0] & 0x80) > 0) { @@ -95,16 +95,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if ((exRegs[0] & 0x40) > 0) { - return ROM[((bank >> 2) << 15) + addr]; + return Rom[((bank >> 2) << 15) + addr]; } - return ROM[((bank >> 1) << 15) + addr]; // hacky! two mappers in one! need real hw carts to test + return Rom[((bank >> 1) << 15) + addr]; // hacky! two mappers in one! need real hw carts to test } - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } - return base.ReadPRG(addr); + return base.ReadPrg(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper189.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper189.cs index 92ef82768a..a72c9c3bba 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper189.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper189.cs @@ -30,9 +30,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (prg * 4) + block_8k; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); int prg_a = value & 0xF; int prg_b = (value>>4)&0xF; prg = prg_a | prg_b; @@ -44,9 +44,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(prg), ref prg); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { - WriteWRAM(addr, value); + WriteWram(addr, value); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper191.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper191.cs index f4f14be8aa..81906d329d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper191.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper191.cs @@ -25,27 +25,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr >= 0x2000) { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } int bank_1k = Get_CHRBank_1K(addr); if (bank_1k.Bit(7)) { //this is referencing chr ram - return VRAM[addr & 0x7FF]; + return Vram[addr & 0x7FF]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr >= 0x2000) { - base.WritePPU(addr, value); + base.WritePpu(addr, value); return; } @@ -53,9 +53,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (bank_1k.Bit(7)) { //this is referencing chr ram - VRAM[addr & 0x7FF] = value; + Vram[addr & 0x7FF] = value; } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs index d514d4e846..69e664dff2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper192.cs @@ -14,70 +14,70 @@ default: return false; } - VRAM = new byte[4096]; + Vram = new byte[4096]; BaseSetup(); return true; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { int bank = Get_CHRBank_1K(addr); if (bank == 0x08) { - VRAM[addr & 0x03FF] = value; + Vram[addr & 0x03FF] = value; } else if (bank == 0x09) { - VRAM[(addr & 0x03FF) + 0x400] = value; + Vram[(addr & 0x03FF) + 0x400] = value; } if (bank == 0x0A) { - VRAM[addr & 0x03FF + 0x800] = value; + Vram[addr & 0x03FF + 0x800] = value; } else if (bank == 0x0B) { - VRAM[(addr & 0x03FF) + 0xC00] = value; + Vram[(addr & 0x03FF) + 0xC00] = value; } } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = Get_CHRBank_1K(addr); if (bank == 0x08) { - byte value = VRAM[addr & 0x03FF]; + byte value = Vram[addr & 0x03FF]; return value; } else if (bank == 0x09) { - return VRAM[(addr & 0x03FF) + 0x400]; + return Vram[(addr & 0x03FF) + 0x400]; } else if (bank == 0x0A) { - return VRAM[(addr & 0x03FF) + 0x800]; + return Vram[(addr & 0x03FF) + 0x800]; } else if (bank == 0x0B) { - return VRAM[(addr & 0x03FF) + 0xC00]; + return Vram[(addr & 0x03FF) + 0xC00]; } else { addr = MapCHR(addr); - return VROM[addr + extra_vrom]; + return Vrom[addr + extra_vrom]; } } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper194.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper194.cs index 5b742e1ab2..4e67439a46 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper194.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper194.cs @@ -14,20 +14,20 @@ default: return false; } - VRAM = new byte[2048]; + Vram = new byte[2048]; BaseSetup(); return true; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - VRAM[addr & 0x7FF] = value; + Vram[addr & 0x7FF] = value; } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } @@ -38,27 +38,27 @@ return bank_1k; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = GetBankNum(addr); if (bank == 0x00) { - return VRAM[addr & 0x03FF]; + return Vram[addr & 0x03FF]; } else if (bank == 0x01) { - return VRAM[(addr & 0x03FF) + 0x400]; + return Vram[(addr & 0x03FF) + 0x400]; } else { addr = MapCHR(addr); - return VROM[addr + extra_vrom]; + return Vrom[addr + extra_vrom]; } } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs index e25eabab99..464011cea4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195.cs @@ -20,39 +20,39 @@ return true; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1000) { - return WRAM[addr-0x1000]; + return Wram[addr-0x1000]; } - return base.ReadEXP(addr); + return base.ReadExp(addr); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) { - WRAM[addr - 0x1000] = value; + Wram[addr - 0x1000] = value; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!mmc3.wram_enable || mmc3.wram_write_protect) return; - base.WriteWRAM(addr+0x1000, value); + base.WriteWram(addr+0x1000, value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (!mmc3.wram_enable) return NES.DB; - return base.ReadWRAM(addr+0x1000); + return base.ReadWram(addr+0x1000); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -60,19 +60,19 @@ if (bank_1k<=3) { - return VRAM[(bank_1k << 10) + (addr & 0x3FF)]; + return Vram[(bank_1k << 10) + (addr & 0x3FF)]; } else { addr = MapCHR(addr); - return VROM[addr + extra_vrom]; + return Vrom[addr + extra_vrom]; } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -80,7 +80,7 @@ if (bank_1k <= vram_bank_mask_1k) { - VRAM[(bank_1k << 10) + (addr & 0x3FF)] = value; + Vram[(bank_1k << 10) + (addr & 0x3FF)] = value; } else { @@ -88,7 +88,7 @@ } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs index b02866f602..235dc5627a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper195_CW.cs @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -39,19 +39,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (bank_1k<=3) { - return VRAM[(bank_1k << 10) + (addr & 0x3FF)]; + return Vram[(bank_1k << 10) + (addr & 0x3FF)]; } else { addr = MapCHR(addr); - return VROM[addr + extra_vrom]; + return Vrom[addr + extra_vrom]; } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (bank_1k <= vram_bank_mask_1k) { - VRAM[(bank_1k << 10) + (addr & 0x3FF)] = value; + Vram[(bank_1k << 10) + (addr & 0x3FF)] = value; } else { @@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper196.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper196.cs index 3cbe10fd78..ce590d6826 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper196.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper196.cs @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.EndSection(); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x1000) { @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { // addresses are scrambled if (addr >= 0x4000) @@ -65,18 +65,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { addr = (addr & 0xFFFE) | ((addr >> 2) & 1) | ((addr >> 3) & 1) | ((addr >> 1) & 1); } - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prgmode) { - return ROM[addr | prgreg << 15]; + return Rom[addr | prgreg << 15]; } else { - return base.ReadPRG(addr); + return base.ReadPrg(addr); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs index e75f006efa..26dccec577 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper197.cs @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //This board has 512k CHR ROM, so the ByteBuffer in the base class deosn't suffice. public int[] chr_regs_1k_512 = new int[8]; - public Mapper197_MMC3(NES.NESBoardBase board, int num_prg_banks) : base(board, num_prg_banks) + public Mapper197_MMC3(NesBoardBase board, int num_prg_banks) : base(board, num_prg_banks) { } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs index bc313daeea..5b94d1c4f7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper198.cs @@ -29,24 +29,24 @@ return val; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1000) { - return WRAM[addr - 0x1000]; + return Wram[addr - 0x1000]; } - return base.ReadEXP(addr); + return base.ReadExp(addr); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) { - WRAM[addr - 0x1000] = value; + Wram[addr - 0x1000] = value; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs index 88c4a55e79..7f0ad26291 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper199.cs @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(exRegs), ref exRegs, false); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -42,43 +42,43 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (mmc3.regs[0]<8) { - return VRAM[(mmc3.regs[0] << 10) + (addr & 0x3FF)]; + return Vram[(mmc3.regs[0] << 10) + (addr & 0x3FF)]; } else { - return VROM[(mmc3.regs[0] << 10) + (addr & 0x3FF)]; + return Vrom[(mmc3.regs[0] << 10) + (addr & 0x3FF)]; } } else if (addr<0x800) { if (exRegs[2] < 8) { - return VRAM[(exRegs[2] << 10) + (addr & 0x3FF)]; + return Vram[(exRegs[2] << 10) + (addr & 0x3FF)]; } else { - return VROM[(exRegs[2] << 10) + (addr & 0x3FF)]; + return Vrom[(exRegs[2] << 10) + (addr & 0x3FF)]; } } else if (addr < 0xC00) { if (mmc3.regs[1] < 8) { - return VRAM[(mmc3.regs[1] << 10) + (addr & 0x3FF)]; + return Vram[(mmc3.regs[1] << 10) + (addr & 0x3FF)]; } else { - return VROM[(mmc3.regs[1] << 10) + (addr & 0x3FF)]; + return Vrom[(mmc3.regs[1] << 10) + (addr & 0x3FF)]; } } else { if (exRegs[3] < 8) { - return VRAM[(exRegs[3] << 10) + (addr & 0x3FF)]; + return Vram[(exRegs[3] << 10) + (addr & 0x3FF)]; } else { - return VROM[(exRegs[3] << 10) + (addr & 0x3FF)]; + return Vrom[(exRegs[3] << 10) + (addr & 0x3FF)]; } } } @@ -87,19 +87,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int bank_1k = Get_CHRBank_1K(addr); if (bank_1k < 8) { - return VRAM[(bank_1k << 10) + (addr & 0x3FF)]; + return Vram[(bank_1k << 10) + (addr & 0x3FF)]; } else { - return VROM[(bank_1k << 10) + (addr & 0x3FF)]; + return Vrom[(bank_1k << 10) + (addr & 0x3FF)]; } } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -109,7 +109,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (mmc3.regs[0] < 8) { - VRAM[(mmc3.regs[0] << 10) + (addr & 0x3FF)]=value; + Vram[(mmc3.regs[0] << 10) + (addr & 0x3FF)]=value; } else { @@ -120,7 +120,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (exRegs[2] < 8) { - VRAM[(exRegs[2] << 10) + (addr & 0x3FF)]=value; + Vram[(exRegs[2] << 10) + (addr & 0x3FF)]=value; } else { @@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (mmc3.regs[1] < 8) { - VRAM[(mmc3.regs[1] << 10) + (addr & 0x3FF)]=value; + Vram[(mmc3.regs[1] << 10) + (addr & 0x3FF)]=value; } else { @@ -142,7 +142,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (exRegs[3] < 8) { - VRAM[(exRegs[3] << 10) + (addr & 0x3FF)]=value; + Vram[(exRegs[3] << 10) + (addr & 0x3FF)]=value; } else { @@ -155,7 +155,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int bank_1k = Get_CHRBank_1K(addr); if (bank_1k < 8) { - VRAM[(bank_1k << 10) + (addr & 0x3FF)]=value; + Vram[(bank_1k << 10) + (addr & 0x3FF)]=value; } else { @@ -164,7 +164,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } protected override int Get_PRGBank_8K(int addr) @@ -181,14 +181,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return base.Get_PRGBank_8K(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((addr == 1) && ((mmc3.cmd & 0x8) > 0)) { exRegs[mmc3.cmd & 3] = value; } else - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper205.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper205.cs index 77d38091eb..7ba03cdd41 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper205.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper205.cs @@ -31,12 +31,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { block = value & 0x03; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= prg_mask; @@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } int MapCHR2(int addr) @@ -92,22 +92,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = MapCHR2(addr); - if (VROM != null) - return VROM[addr + extra_vrom]; - else return VRAM[addr]; + if (Vrom != null) + return Vrom[addr + extra_vrom]; + else return Vram[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void NESSoftReset() + public override void NesSoftReset() { block = 0; - base.NESSoftReset(); + base.NesSoftReset(); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper208.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper208.cs index 89524b3e31..64c51a4b5d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper208.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper208.cs @@ -45,22 +45,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("expregs", ref exRegs, false); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(exRegs[5] << 15) + addr]; + return Rom[(exRegs[5] << 15) + addr]; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1800) // 0x5800-0x5FFF { return exRegs[addr & 3]; } - return base.ReadEXP(addr); + return base.ReadExp(addr); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x800 && addr < 0x1000) // 0x4800-0x4FFF { @@ -82,11 +82,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr >= 0x800 && addr < 0x1000) // 0x6800 - 0x6FFF { @@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs index b69e430417..12471fe4c6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper215.cs @@ -124,16 +124,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x1000) { exRegs[0] = value; sync_prg_2(); } if (addr == 0x1001) { exRegs[1] = value; } if (addr == 0x1007) { exRegs[2] = value; mmc3.reg_addr = 0; sync_prg_2(); } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!is_mk3) { @@ -142,10 +142,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr == 0x0007) { exRegs[2] = value; mmc3.reg_addr = 0; sync_prg_2(); } } - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; switch (addr &= 0xE001) @@ -153,7 +153,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x8000: if (exRegs[2]==0) { - base.WritePRG(0x0000, value); + base.WritePrg(0x0000, value); sync_prg(0); sync_prg(2); } @@ -164,7 +164,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((exRegs[3]>0) && ((exRegs[0] & 0x80) == 0 || (mmc3.reg_addr & 0x7) < 6)) { exRegs[3] = 0; - base.WritePRG(0x0001, value); + base.WritePrg(0x0001, value); if (mmc3.reg_addr==7) sync_prg(1); else if ((mmc3.reg_addr==6) && mmc3.prg_mode) @@ -175,7 +175,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WritePRG(0x0001, value); + base.WritePrg(0x0001, value); if (mmc3.reg_addr == 7) sync_prg(1); else if ((mmc3.reg_addr == 6) && mmc3.prg_mode) @@ -190,7 +190,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES value = (byte)((value & 0xC0) | regs_sec[value & 0x07]); exRegs[3] = 1; - base.WritePRG(0x0000, value); + base.WritePrg(0x0000, value); sync_prg(0); sync_prg(2); } @@ -207,7 +207,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } break; case 0xA001: - base.WritePRG(0x4001, value); + base.WritePrg(0x4001, value); break; case 0xC000: if (exRegs[2]>0) @@ -220,32 +220,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.Horizontal); } else - base.WritePRG(0x4000, value); + base.WritePrg(0x4000, value); break; case 0xC001: if (exRegs[2]>0) - base.WritePRG(0x6001, value); + base.WritePrg(0x6001, value); else - base.WritePRG(0x4001, value); + base.WritePrg(0x4001, value); break; case 0xE000: - base.WritePRG(0x6000, value); + base.WritePrg(0x6000, value); break; case 0xE001: if (exRegs[2]>0) { - base.WritePRG(0x4000, value); - base.WritePRG(0x4001, value); + base.WritePrg(0x4000, value); + base.WritePrg(0x4001, value); } else { - base.WritePRG(0x6001, value); + base.WritePrg(0x6001, value); } break; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -258,16 +258,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k &= chr_mask_1k; addr = (bank_1k << 10) | (addr & 0x3FF); - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr >> 13; bank = prg_regs_8k[bank]; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs index 981a64512e..44d1d81a58 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper217.cs @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x1000) { @@ -99,21 +99,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES exRegs[2] = value; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch ((addr + 0x8000) & 0xE001) { case 0x8000: if (exRegs[2] > 0) { - base.WritePRG(0x4000, value); + base.WritePrg(0x4000, value); } else { - base.WritePRG(0x0000, value); + base.WritePrg(0x0000, value); sync_prg(); } break; @@ -123,12 +123,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES value = (byte)((value & 0xC0) | regs_sec[value & 0x07]); exRegs[3] = 1; - base.WritePRG(0x0000, value); + base.WritePrg(0x0000, value); sync_prg(); } else { - base.WritePRG(0x0001, value); + base.WritePrg(0x0001, value); sync_prg(); } break; @@ -138,7 +138,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((exRegs[3] > 0) && ((exRegs[0] & 0x80) == 0 || (mmc3.reg_addr & 0x7) < 6)) { exRegs[3] = 0; - base.WritePRG(0x0001, value); + base.WritePrg(0x0001, value); sync_prg(); } } @@ -167,16 +167,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else { - base.WritePRG(0x2001, value); + base.WritePrg(0x2001, value); } break; } if (addr>=0x4000) - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -188,17 +188,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k |= (exRegs[1] << 8 & 0x300); bank_1k &= chr_mask_1k; addr = (bank_1k << 10) | (addr & 0x3FF); - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr >> 13; bank = prg_regs_8k[bank]; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs index 1a38b8cba3..9b4173571c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper219.cs @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr<0x2000) { @@ -105,43 +105,43 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_prg = addr >> 13; bank_prg = prgregs[bank_prg] & prg_mask; - return ROM[((bank_prg << 13) + (addr & 0x1FFF))]; + return Rom[((bank_prg << 13) + (addr & 0x1FFF))]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr<0x2000) { int bank_chr = addr >> 10; bank_chr = chrregs[bank_chr] & chr_mask; - if (VROM != null) + if (Vrom != null) { - return VROM[((bank_chr << 10) + (addr & 0x3FF))]; + return Vrom[((bank_chr << 10) + (addr & 0x3FF))]; } - return VRAM[((bank_chr << 10) + (addr & 0x3FF))]; + return Vram[((bank_chr << 10) + (addr & 0x3FF))]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { int bank_chr = addr >> 10; bank_chr = chrregs[bank_chr]; - VRAM[((bank_chr << 10) + (addr & 0x3FF))]=value; + Vram[((bank_chr << 10) + (addr & 0x3FF))]=value; } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs index f2af9de55f..63335ba339 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper223.cs @@ -20,24 +20,24 @@ return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr>0x1000) { - WRAM[addr + 0x4000 - (0x5000 - 0x2000)] = value; + Wram[addr + 0x4000 - (0x5000 - 0x2000)] = value; } else - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr > 0x1000) { - return WRAM[addr + 0x4000 - (0x5000 - 0x2000)]; + return Wram[addr + 0x4000 - (0x5000 - 0x2000)]; } else - return base.ReadEXP(addr); + return base.ReadExp(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper238.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper238.cs index b51c128d6b..41c5c84299 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper238.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper238.cs @@ -29,32 +29,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(reg), ref reg); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr < 0x20) { - return base.ReadEXP(addr); + return base.ReadExp(addr); } return reg; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { return reg; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr < 0x20) { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } reg = (byte)lut[value & 3]; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { reg = (byte)lut[value & 3]; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper245.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper245.cs index b58c9fb67f..4b2b04a17c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper245.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper245.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= 0x3F; @@ -46,19 +46,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_8k &= prg_mask; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr == 0) { chr_mode = value.Bit(7); } - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -66,25 +66,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x1000) { - return VRAM[addr + 0x1000]; + return Vram[addr + 0x1000]; } else { - return VRAM[addr - 0x1000]; + return Vram[addr - 0x1000]; } } else { - return VRAM[addr]; + return Vram[addr]; } } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -92,21 +92,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x1000) { - VRAM[addr + 0x1000] = value; + Vram[addr + 0x1000] = value; } else { - VRAM[addr - 0x1000] = value; + Vram[addr - 0x1000] = value; } } else { - VRAM[addr] = value; + Vram[addr] = value; } } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper249.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper249.cs index e54d85a944..7b0ca9a453 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper249.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper249.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(piratecrap), ref piratecrap); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { piratecrap = value.Bit(1); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper250.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper250.cs index b9d6e4024b..9da002d9ce 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper250.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper250.cs @@ -18,9 +18,9 @@ return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { - base.WritePRG(addr & 0x6000 | addr >> 10 & 1, (byte)(addr & 0xff)); + base.WritePrg(addr & 0x6000 | addr >> 10 & 1, (byte)(addr & 0xff)); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper254.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper254.cs index d661ad1415..1969fe6bf0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper254.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper254.cs @@ -27,19 +27,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(regs), ref regs, false); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (regs[0] > 0) { - return WRAM[addr]; + return Wram[addr]; } else { - return (byte)(WRAM[addr] ^ regs[1]); + return (byte)(Wram[addr] ^ regs[1]); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; } - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/NES-QJ.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/NES-QJ.cs index 49c7326aae..6cbf820bac 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/NES-QJ.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/NES-QJ.cs @@ -13,9 +13,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(block), ref block); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { - base.WritePRG(addr, value); + base.WritePrg(addr, value); SetMirrorType(mmc3.MirrorType); //often redundant, but gets the job done } @@ -51,11 +51,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (base.Get_CHRBank_1K(addr) & 0x7F) + block * 128; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { return (byte)block; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (mmc3.wram_enable && !mmc3.wram_write_protect) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs index 0289ab376b..d046836b4b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Pocahontas.cs @@ -48,15 +48,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_mask), ref chr_mask_1k); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x1000) { exRegs[0] = value; } if (addr == 0x1001) { exRegs[1] = value; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; @@ -76,30 +76,30 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES value = (byte)((value & 0xC0) | regs_sec[value & 0x07]); exRegs[2] = 1; - base.WritePRG(0x0000, value); + base.WritePrg(0x0000, value); } else if (addr < 0xE000) { if (exRegs[2] >0) { exRegs[2] = 0; - base.WritePRG(0x0001, value); + base.WritePrg(0x0001, value); } } else if (addr < 0xF000) { // nothing - base.WritePRG(0x6000, value); + base.WritePrg(0x6000, value); } else { - base.WritePRG(0x6001, value); - base.WritePRG(0x4000, value); - base.WritePRG(0x4001, value); + base.WritePrg(0x6001, value); + base.WritePrg(0x4000, value); + base.WritePrg(0x4001, value); } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -108,23 +108,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k |= (exRegs[1] << 6 & 0x100); bank_1k &= chr_mask_1k; addr = (bank_1k << 10) | (addr & 0x3FF); - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = exRegs[0] & 0xF; if ((exRegs[0] & 0x80)>0) { if ((exRegs[0] & 0x20)>0) { - return ROM[((bank >> 1) << 15) + (addr & 0x7FFF)]; + return Rom[((bank >> 1) << 15) + (addr & 0x7FFF)]; } else { - return ROM[((bank) << 14) + (addr & 0x3FFF)]; + return Rom[((bank) << 14) + (addr & 0x3FFF)]; } } @@ -132,7 +132,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { bank = mmc3.Get_PRGBank_8K(addr); bank &= prg_mask_8k; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs index 9e8cee9ab7..dd4a3f2e4d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/RexSoftSL1632.cs @@ -36,18 +36,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(exnmt), ref exnmt); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (exmode.Bit(1)) { - return base.ReadPRG(addr); + return base.ReadPrg(addr); } else { int b = addr >> 13; b = exprg[b]; b &= prg_mask; - return ROM[addr & 0x1fff | b << 13]; + return Rom[addr & 0x1fff | b << 13]; } } @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } static readonly byte[] modes = { 5, 5, 3, 1 }; - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -76,17 +76,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank = exchr[addr >> 10]; } bank &= chr_mask; - return VROM[addr & 0x3ff | bank << 10]; + return Vrom[addr & 0x3ff | bank << 10]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } // this is stupid as hell - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("{0:x4}:{1:x2}", addr, value); @@ -103,14 +103,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { switch (addr & 0x6001) { - case 0x0000: base.WritePRG(0x0000, value); break; - case 0x0001: base.WritePRG(0x0001, value); break; + case 0x0000: base.WritePrg(0x0000, value); break; + case 0x0001: base.WritePrg(0x0001, value); break; case 0x2000: SinkMirror(true); break; - case 0x2001: base.WritePRG(0x2001, value); break; - case 0x4000: base.WritePRG(0x4000, value); break; - case 0x4001: base.WritePRG(0x4001, value); break; - case 0x6000: base.WritePRG(0x6000, value); break; - case 0x6001: base.WritePRG(0x6001, value); break; + case 0x2001: base.WritePrg(0x2001, value); break; + case 0x4000: base.WritePrg(0x4000, value); break; + case 0x4001: base.WritePrg(0x4001, value); break; + case 0x6000: base.WritePrg(0x6000, value); break; + case 0x6001: base.WritePrg(0x6001, value); break; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TLSROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TLSROM.cs index a8878d7582..bd60c78ceb 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TLSROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TLSROM.cs @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { int nt = value >> 7; @@ -92,28 +92,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } if ((addr & 0x6001) != 0x2000) - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000) return base.ReadPPU(addr); + if (addr < 0x2000) return base.ReadPpu(addr); else { int nt = ((addr - 0x2000) >> 10) & 0x3; addr = 0x2000 + (addr & 0x3FF) + (nametables[nt] << 10); - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { - if (addr < 0x2000) base.WritePPU(addr, value); + if (addr < 0x2000) base.WritePpu(addr, value); else { int nt = ((addr - 0x2000) >> 10) & 0x3; addr = 0x2000 + (addr & 0x3FF) + (nametables[nt] << 10); - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs index 2382627ed5..93c8062465 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TQROM.cs @@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -34,15 +34,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { addr = ((bank_1k&0x3f) << 10) | (addr & 0x3FF); addr &= 0x1FFF; - return VRAM[addr]; + return Vram[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -52,14 +52,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { addr = ((bank_1k & 0x3f) << 10) | (addr & 0x3FF); addr &= 0x1FFF; - VRAM[addr] = value; + Vram[addr] = value; } //else // if this address is mapped to chrrom and not chrram, the write just does nothing //base.WritePPU(addr, value); } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TVROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TVROM.cs index 6e15546a96..b3185933ab 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TVROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TVROM.cs @@ -33,20 +33,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //and that even though 8KB is really here, only 4KB gets used. //still, purists could validate it. - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { //read patterns from mapper controlled area - return base.ReadPPU(addr); + return base.ReadPpu(addr); } else { - return VRAM[addr & 0xFFF]; + return Vram[addr & 0xFFF]; } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - VRAM[addr & 0xFFF] = value; + Vram[addr & 0xFFF] = value; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs index 4df800e8e2..3559bb7285 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/TxROM.cs @@ -8,9 +8,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES [NES.INESBoardImplPriority] public sealed class TxROM : MMC3Board_Base { - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { - base.WritePRG(addr, value); + base.WritePrg(addr, value); SetMirrorType(mmc3.MirrorType); //often redundant, but gets the job done } @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES get { if (!Cart.wram_battery) return null; - return WRAM; + return Wram; //some boards have a wram that is backed-up or not backed-up. need to handle that somehow //(nestopia splits it into NVWRAM and WRAM but i didnt like that at first.. but it may player better with this architecture) } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper015.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper015.cs index dc60d4da15..fb1ee97290 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper015.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper015.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper015 : NES.NESBoardBase + public sealed class Mapper015 : NesBoardBase { //configuration int prg_bank_mask_8k; @@ -41,13 +41,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(13, prg_banks_8k, addr); - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { int mode = addr & 3; int prg_high = value & 0x3F; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper028.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper028.cs index 9fe341ec84..40d0f6d0bb 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper028.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper028.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/User:Tepples/Multi-discrete_mapper - public sealed class Mapper028 : NES.NESBoardBase + public sealed class Mapper028 : NesBoardBase { // config int chr_mask_8k; @@ -131,13 +131,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) reg = value & 0x81; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (reg) { @@ -162,25 +162,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VRAM[addr | chr << 13]; + return Vram[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) - VRAM[addr | chr << 13] = value; + Vram[addr | chr << 13] = value; else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(addr & 0x3fff) | (addr < 0x4000 ? prglo : prghi) << 14]; + return Rom[(addr & 0x3fff) | (addr < 0x4000 ? prglo : prghi) << 14]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper029.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper029.cs index dbc179a403..c7479e540b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper029.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper029.cs @@ -1,7 +1,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // what is this? - public class Mapper029 : NES.NESBoardBase + public class Mapper029 : NesBoardBase { int prg; int chr; @@ -27,30 +27,30 @@ return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { chr = value & 3; prg = (value >> 2) & prg_bank_mask_16k; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr >= 0x4000 ? prg_bank_mask_16k : prg; - return ROM[bank << 14 | addr & 0x3fff]; + return Rom[bank << 14 | addr & 0x3fff]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VRAM[addr | chr << 13]; + return Vram[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) - VRAM[addr | chr << 13] = value; + Vram[addr | chr << 13] = value; else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs index 24e4e99ff2..d42bd5a29b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper030.cs @@ -4,7 +4,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper030 : NES.NESBoardBase + public class Mapper030 : NesBoardBase { enum flashmode { fm_default, fm_erase, fm_write, fm_id } @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES static readonly int[] addr_bank = new int[5] { 1, 0, 1, 1, 0 }; static readonly byte[] addr_data = new byte[5] { 0xAA, 0x55, 0x80, 0xAA, 0x55 }; - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((!Cart.wram_battery) || (addr >= 0x4000)) { @@ -173,7 +173,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { increment_flash_write_count(addr); for (int i = 0; i < 0x1000; i++) - flash_rom[(prg << 14 | addr & 0x3000) + i + Cart.prg_size] = ROM[(prg << 14 | addr & 0x3000) + i]; + flash_rom[(prg << 14 | addr & 0x3000) + i + Cart.prg_size] = Rom[(prg << 14 | addr & 0x3000) + i]; } flash_rom[Cart.prg_size + (prg << 14 | addr & 0x3fff)] &= value; flash_state = 0; @@ -187,7 +187,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr >= 0x4000 ? prg_bank_mask_16k : prg; if (Cart.wram_battery) @@ -216,23 +216,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (get_flash_write_count(addr) > 0) return flash_rom[Cart.prg_size + (bank << 14 | addr & 0x3fff)]; } - return ROM[bank << 14 | addr & 0x3fff]; + return Rom[bank << 14 | addr & 0x3fff]; } public override byte[] SaveRam => flash_rom; - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VRAM[addr | chr << 13]; - return base.ReadPPU(addr); + return Vram[addr | chr << 13]; + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) - VRAM[addr | chr << 13] = value; + Vram[addr | chr << 13] = value; else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper034.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper034.cs index 1afe551e8c..b74245cd4d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper034.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper034.cs @@ -2,7 +2,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper034 : NES.NESBoardBase + public sealed class Mapper034 : NesBoardBase { // zombie board that tries to handle both bxrom and ave-nina at once @@ -35,25 +35,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return (VROM ?? VRAM)[addr & 0xfff | chr[addr >> 12] << 12]; + return (Vrom ?? Vram)[addr & 0xfff | chr[addr >> 12] << 12]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg = value & prg_bank_mask_32k; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { switch (addr) { @@ -68,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; default: // on NINA, the regs sit on top of WRAM - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); break; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs index 7f2a2e7b2c..db54355050 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper036.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // mapper036 // Strike Wolf (MGC-014) [!].nes // Using https://wiki.nesdev.com/w/index.php/INES_Mapper_036 - public sealed class Mapper036 : NES.NESBoardBase + public sealed class Mapper036 : NesBoardBase { int chr; int prg; @@ -34,31 +34,31 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr | chr << 13]; + return Vrom[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { // either hack emulation of a weird bus conflict, or crappy pirate safeguard prg = (R >> 4) & prg_mask; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { return (byte)(R | (NES.DB & 0xCF)); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { Console.WriteLine(addr); Console.WriteLine(value); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper038.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper038.cs index 53ce1bb7d4..71d980c67a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper038.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper038.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Crime Busters (Brazil) (Unl) - public sealed class Mapper038 : NES.NESBoardBase + public sealed class Mapper038 : NesBoardBase { //configuraton int prg_mask, chr_mask; @@ -29,18 +29,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr + (prg << 15)]; + return Rom[addr + (prg << 15)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr + (chr << 13)]; + return Vrom[addr + (chr << 13)]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } void writereg(byte value) @@ -51,13 +51,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // the standard way to access this register is at 7000:7fff, but due to // hardware design, f000:ffff also works - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //if ((addr & 0x7000) == 0x7000) // writereg(value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if ((addr & 0x1000) == 0x1000) writereg(value); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper040.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper040.cs index 847395cc4b..9556788b66 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper040.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper040.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // smb2j (us pirate) - public sealed class Mapper040 : NES.NESBoardBase + public sealed class Mapper040 : NesBoardBase { int prg = 0; int irqcnt = 0; @@ -23,25 +23,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { // bank 6 fixed - return ROM[addr + 0xc000]; + return Rom[addr + 0xc000]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((addr & 0x6000) == 0x4000) addr += prg; - return ROM[addr + 0x8000]; + return Rom[addr + 0x8000]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0x6000) { case 0x0000: irqcnt = 0; - IRQSignal = false; + IrqSignal = false; irqactive = false; break; case 0x2000: @@ -56,7 +56,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void ClockCPU() + public override void ClockCpu() { if (irqactive) { @@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (irqcnt >= 4096) { irqcnt = 4096; - IRQSignal = true; + IrqSignal = true; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper041.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper041.cs index 28dade5c45..1de349df85 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper041.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper041.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // caltron 6 in 1 - public sealed class Mapper041 : NES.NESBoardBase + public sealed class Mapper041 : NesBoardBase { int prg; int chr; @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x800) { @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (regenable) { @@ -46,17 +46,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr | chr << 13]; + return Vrom[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper042.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper042.cs index 3ae0c2b2e6..aa24fd8ce8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper042.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper042.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // pirate FDS conversion // this is probably two different boards, but they seem to work well enough the same - public sealed class Mapper042 : NES.NESBoardBase + public sealed class Mapper042 : NesBoardBase { int prg = 0; int chr = 0; @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0x6003; switch (addr) @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { irqcnt = 0; irqenable = false; - IRQSignal = false; + IrqSignal = false; } else irqenable = true; @@ -68,16 +68,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | 0x18000]; + return Rom[addr | 0x18000]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[addr | prg << 13]; + return Rom[addr | prg << 13]; } - public override void ClockCPU() + public override void ClockCpu() { if (irqenable) { @@ -86,7 +86,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (irqcnt >= 32768) irqcnt -= 32768; - IRQSignal = irqcnt >= 24576; + IrqSignal = irqcnt >= 24576; } } @@ -99,17 +99,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(irqcnt), ref irqcnt); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - if (VRAM != null) - return VRAM[addr]; + if (Vram != null) + return Vram[addr]; else - return VROM[addr | chr << 13]; + return Vrom[addr | chr << 13]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs index a5502edecc..785941d5f5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper043.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper043 : NES.NESBoardBase + public sealed class Mapper043 : NesBoardBase { int prg = 0; int irqcnt = 0; @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr += 0x4000; @@ -44,74 +44,74 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x4122: irqenable = (value & 1) == 1; - IRQSignal = false; + IrqSignal = false; irqcnt = 0; break; } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; switch (addr & 0xF1FF) { case 0x8122: irqenable = (value & 1) == 1; - IRQSignal = false; + IrqSignal = false; irqcnt = 0; break; } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr > 0x1000) { - return ROM[(addr - 0x1000) + 8 * 0x2000]; + return Rom[(addr - 0x1000) + 8 * 0x2000]; } - else return base.ReadEXP(addr); + else return base.ReadExp(addr); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (swap) { - return ROM[addr]; + return Rom[addr]; } else { - return ROM[addr + 0x4000]; + return Rom[addr + 0x4000]; } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x2000) { - return ROM[addr + 0x2000]; + return Rom[addr + 0x2000]; } else if (addr < 0x4000) { - return ROM[addr - 0x2000]; + return Rom[addr - 0x2000]; } else if (addr < 0x6000) { - return ROM[(addr - 0x4000) + prg * 0x2000]; + return Rom[(addr - 0x4000) + prg * 0x2000]; } else { if (swap) { - return ROM[(addr - 0x6000) + 8 * 0x2000]; + return Rom[(addr - 0x6000) + 8 * 0x2000]; } else { - return ROM[(addr - 0x6000) + 9 * 0x2000]; + return Rom[(addr - 0x6000) + 9 * 0x2000]; } } } - public override void ClockCPU() + public override void ClockCpu() { if (irqenable) { @@ -120,7 +120,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (irqcnt >= 4096) { irqenable = false; - IRQSignal = true; + IrqSignal = true; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs index 22e3c8c9c2..6924a89c6c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper045.cs @@ -37,11 +37,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (lock_regs) { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } else { @@ -68,22 +68,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void NESSoftReset() + public override void NesSoftReset() { lock_regs = false; cur_reg = 0; regs = new byte[4]; - base.NESSoftReset(); + base.NesSoftReset(); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= (regs[3] & 0x3F) ^ 0x3F; bank_8k |= regs[1]; bank_8k &= prg_mask; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } private int CHR_AND() diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs index 14bfd3b6d8..fb8c0e0520 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper046.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper046 : NES.NESBoardBase + public sealed class Mapper046 : NesBoardBase { //Rumblestation 15-in-1 (Unl).nes @@ -23,32 +23,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int prg_bank_32k_H, prg_bank_32k_L, chr_bank_8k_H, chr_bank_8k_L; - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { prg_bank_32k_H = value & 0x0F; chr_bank_8k_H = value >> 4; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_32k_L = value & 0x01; chr_bank_8k_L = (value >> 4) & 0x07; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr + (((chr_bank_8k_H << 3) + chr_bank_8k_L) * 0x2000)]; + return Vrom[addr + (((chr_bank_8k_H << 3) + chr_bank_8k_L) * 0x2000)]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { //TODO: High bits int offset = (prg_bank_32k_H << 1) + prg_bank_32k_L; - return ROM[addr + (offset * 0x8000)]; + return Rom[addr + (offset * 0x8000)]; } public override bool Configure(NES.EDetectionOrigin origin) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper051.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper051.cs index 4a9fe864eb..5b0249f7ad 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper051.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper051.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper051 : NES.NESBoardBase + public sealed class Mapper051 : NesBoardBase { private int _bank; private int _mode = 2; @@ -21,11 +21,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { _bank = 0; _mode = 2; - base.NESSoftReset(); + base.NesSoftReset(); } public override void SyncState(Serializer ser) @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("mode", ref _mode); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { int prgBank8k; if ((_mode & 0x02) > 0) @@ -47,10 +47,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prgBank8k = ((_bank & 4) << 2) | 0x2F; } - return ROM[(prgBank8k * 0x2000) + addr]; + return Rom[(prgBank8k * 0x2000) + addr]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int prgBank16k_8; int prgBank16k_C; @@ -72,15 +72,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x4000) { - return ROM[(prgBank16k_8 * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prgBank16k_8 * 0x4000) + (addr & 0x3FFF)]; } else { - return ROM[(prgBank16k_C * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prgBank16k_C * 0x4000) + (addr & 0x3FFF)]; } } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x2000) { @@ -89,11 +89,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _bank = value & 0x0F; if ((addr & 0x4000) > 0) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper053.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper053.cs index 22abe47c62..221cf7cb4b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper053.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper053.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { // Supervision 16-in-1 [p1].nes - public sealed class Mapper053 : NES.NESBoardBase + public sealed class Mapper053 : NesBoardBase { private byte _reg0; private byte _reg1; @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(mir ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!_reg0.Bit(4)) { @@ -48,16 +48,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg1 = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (Prg16kMode) { @@ -66,24 +66,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ? (((_reg0 & 0xF) << 3) | (_reg1 & 7)) + 2 : (((_reg0 & 0xF) << 3) | 7) + 2; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } - return base.ReadPRG(addr); + return base.ReadPrg(addr); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { // First 32kb of PRG is for the intro game picker, 4 is to offset that int bank = (((_reg0 & 0xF) << 4) | 0xF) + 4; - return ROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Rom[(bank * 0x2000) + (addr & 0x1FFF)]; } } // Supervision 16-in-1 [U][p1][!].unf // Same as Mapper 53, except the 32kb PRG chip is at the end of the ROM space instead of the beginning // These could have been combined to reduce some code, but at the cost of being more convoluted - public sealed class UNIF_BMC_Supervision16in1 : NES.NESBoardBase + public sealed class UNIF_BMC_Supervision16in1 : NesBoardBase { private byte _reg0; private byte _reg1; @@ -118,7 +118,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(mir ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!_reg0.Bit(4)) { @@ -127,16 +127,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg1 = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (Prg16kMode) { @@ -145,18 +145,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ? (((_reg0 & 0xF) << 3) | (_reg1 & 7)) : (((_reg0 & 0xF) << 3) | 7); - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } // Intro screen on the last 512kb chip - return ROM[0x200000 + addr]; + return Rom[0x200000 + addr]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { // First 32kb of PRG is for the intro game picker, 4 is to offset that int bank = (((_reg0 & 0xF) << 4) | 0xF); - return ROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Rom[(bank * 0x2000) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs index 02ef8eb9b6..40c285938e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper057.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper057 : NES.NESBoardBase + public sealed class Mapper057 : NesBoardBase { // http://wiki.nesdev.com/w/index.php/INES_Mapper_057 @@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0x8800; if (addr == 0) @@ -72,28 +72,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Console.WriteLine("chr page = {0}", chr_reg); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode) { - return ROM[((prg_reg >> 1) * 0x8000) + addr]; + return Rom[((prg_reg >> 1) * 0x8000) + addr]; } else { - return ROM[(prg_reg * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prg_reg * 0x4000) + (addr & 0x3FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(chr_reg * 0x2000) + addr]; + return Vrom[(chr_reg * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { return (byte)(Mapper57_DipSwitch & 3); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper058.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper058.cs index b0299a79d8..92ab5b854f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper058.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper058.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_058 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper058 : NES.NESBoardBase + public sealed class Mapper058 : NesBoardBase { bool prg_mode = false; int chr_reg; @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_mode = addr.Bit(6); if (addr.Bit(7)) @@ -51,25 +51,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_reg = (addr >> 3) & 0x07; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode == false) { - return ROM[((prg_reg >> 1) * 0x8000) + addr]; + return Rom[((prg_reg >> 1) * 0x8000) + addr]; } else { - return ROM[(prg_reg * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prg_reg * 0x4000) + (addr & 0x3FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(chr_reg * 0x2000) + addr]; + return Vrom[(chr_reg * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs index 73aa648de6..7a375521d9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper063.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper063 : NES.NESBoardBase + public sealed class Mapper063 : NesBoardBase { int prg0, prg1, prg2, prg3; bool open_bus; @@ -21,11 +21,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // not sure on initial mirroring SetMirrorType(EMirrorType.Vertical); - WritePRG(0, 0); + WritePrg(0, 0); return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { open_bus = ((addr & 0x0300) == 0x0300); @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType((addr & 0x01) > 0 ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x2000) { @@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - return ROM[addr + prg0 * 0x2000]; + return Rom[addr + prg0 * 0x2000]; } } else if (addr < 0x4000) @@ -58,16 +58,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - return ROM[(addr - 0x2000) + prg1 * 0x2000]; + return Rom[(addr - 0x2000) + prg1 * 0x2000]; } } else if (addr < 0x6000) { - return ROM[(addr - 0x4000) + prg2 * 0x2000]; + return Rom[(addr - 0x4000) + prg2 * 0x2000]; } else { - return ROM[(addr - 0x6000) + prg3 * 0x2000]; + return Rom[(addr - 0x6000) + prg3 * 0x2000]; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs index ef2c40980e..e1aebe943f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper069.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { int a = addr & 0xe000; if (a == 0x4000) @@ -38,7 +38,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else if (a == 0x6000) audio.RegWrite(value); else - base.WritePRG(addr, value); + base.WritePrg(addr, value); } public override void SyncState(Serializer ser) @@ -47,14 +47,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES audio.SyncState(ser); } - public override void ClockCPU() + public override void ClockCpu() { audio.Clock(); - base.ClockCPU(); + base.ClockCpu(); } } - public class Sunsoft_FME7 : NES.NESBoardBase + public class Sunsoft_FME7 : NesBoardBase { //configuration int prg_bank_mask_8k, chr_bank_mask_1k, wram_bank_mask_8k; @@ -138,7 +138,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0xE000; switch (addr) @@ -196,10 +196,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIrq() { - IRQSignal = irq_asserted; + IrqSignal = irq_asserted; } - public override void ClockCPU() + public override void ClockCpu() { if (!irq_countdown) return; irq_counter--; @@ -221,14 +221,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } }*/ - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1<<13)-1); bank_8k = prg_banks_8k[bank_8k]; bank_8k &= prg_bank_mask_8k; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } int CalcWRAMAddress(int addr, int bank_mask_8k) @@ -249,37 +249,37 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (bank_1k<<10) | ofs; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[CalcPPUAddress(addr)]; - else return base.ReadPPU(addr); + return Vrom[CalcPPUAddress(addr)]; + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (!wram_ram_selected) { addr = CalcWRAMAddress(addr, prg_bank_mask_8k); - return ROM[addr]; + return Rom[addr]; } else if (!wram_ram_enabled) return 0xFF; //empty bus else { addr = CalcWRAMAddress(addr, wram_bank_mask_8k); - return WRAM[addr]; + return Wram[addr]; } } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!wram_ram_selected) return; else if (!wram_ram_enabled) @@ -287,7 +287,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { addr = CalcWRAMAddress(addr, wram_bank_mask_8k); - WRAM[addr] = value; + Wram[addr] = value; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs index 67c35166b6..ebc23250fe 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper078.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper078 : NES.NESBoardBase + public sealed class Mapper078 : NesBoardBase { bool holydiver; int chr; @@ -49,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[0] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_16k = (byte)(value & 7); SyncPRG(); @@ -72,22 +72,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr = (value >> 4); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x1FFF) + (chr * 0x2000)]; + return Vrom[(addr & 0x1FFF) + (chr * 0x2000)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs index 3e6672f5e7..ee9249bfd3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper090.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper090 : NES.NESBoardBase + public sealed class Mapper090 : NesBoardBase { byte[] prg_regs = new byte[4]; int[] chr_regs = new int[8]; @@ -100,11 +100,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { InitValues(); - base.NESSoftReset(); + base.NesSoftReset(); } private void InitValues() @@ -329,7 +329,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0x7007) { @@ -495,20 +495,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int offset = addr & 0x1FFF; int bank = prg_banks[addr >> 13]; bank &= prg_bank_mask_8k; - return ROM[bank << 13 | offset]; + return Rom[bank << 13 | offset]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return sram_prg ? ROM[ram_bank << 13 | addr & 0x1FFF] : base.ReadWRAM(addr); + return sram_prg ? Rom[ram_bank << 13 | addr & 0x1FFF] : base.ReadWram(addr); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { switch (addr & 0x1807) { @@ -527,11 +527,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x1807: return ram_bytes[addr - 0x1803]; default: - return base.ReadEXP(addr); + return base.ReadExp(addr); } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr) { @@ -553,7 +553,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void ClockCPU() + public override void ClockCpu() { if (irq_source == 0) { @@ -599,7 +599,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SyncIRQ(irq_pending); } - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { int a12 = (addr >> 12) & 1; bool rising_edge = (a12 == 1 && a12_old == 0); @@ -620,7 +620,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank &= chr_bank_mask_1k; int offset = addr & 0x3FF; - return VROM[bank << 10 | offset]; + return Vrom[bank << 10 | offset]; } if (nt_advanced_control) //Read from Nametables @@ -637,7 +637,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - return VROM[nt << 10 | offset]; + return Vrom[nt << 10 | offset]; } else { @@ -645,7 +645,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (irq_source == 2) { @@ -671,7 +671,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; } - return VROM[bank << 10 | offset]; + return Vrom[bank << 10 | offset]; } if (nt_advanced_control) //Read from Nametables @@ -688,11 +688,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - return VROM[nt << 10 | offset]; + return Vrom[nt << 10 | offset]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs index 0b07db0e6a..0a94611c8f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper091.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper91 : NES.NESBoardBase + public sealed class Mapper91 : NesBoardBase { /* *Note: Street Fighter III (Unl) is actually mapper 197. However variations such as Street Fighter III (9 Fighter) and Mari Street Fighter III use this mapper @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { switch (addr & 0x7003) { @@ -84,34 +84,34 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void ClockPPU() + public override void ClockPpu() { mmc3.ClockPPU(); } - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { mmc3.AddressPPU(addr); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank_2k = (addr >> 11); bank_2k = chr_regs_2k[bank_2k]; bank_2k &= chr_bank_mask_2k; - return VROM[(bank_2k * 0x800) + (addr & 0x7ff)]; + return Vrom[(bank_2k * 0x800) + (addr & 0x7ff)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; bank_8k = prg_regs_8k[bank_8k]; bank_8k &= prg_bank_mask_8k; - return ROM[(bank_8k * 0x2000) + (addr & 0x1FFF)]; + return Rom[(bank_8k * 0x2000) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper101.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper101.cs index d877201589..4f71582ed9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper101.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper101.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // good dumps of this rom are on Mapper087; only bad dumps with CHR banks out of order go here // nothing else uses this, other than hypothetical homebrews which might prefer it to CxROM // because of no bus conflicts - public sealed class Mapper101 : NES.NESBoardBase + public sealed class Mapper101 : NesBoardBase { //configuration int chr_bank_mask_8k; @@ -43,18 +43,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int ofs = addr & ((1 << 13) - 1); addr = (chr_bank_8k << 13) | ofs; - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { chr_bank_8k = value & chr_bank_mask_8k; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper103.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper103.cs index 8d7c19f4ba..ec92c77622 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper103.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper103.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Doki Doki Panic (FDS port) // "BTL 2708" - public sealed class Mapper103 : NES.NESBoardBase + public sealed class Mapper103 : NesBoardBase { int prg; bool romenable; @@ -27,32 +27,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { // writes always go to wram, even if rom is mapped in for read - WRAM[addr] = value; + Wram[addr] = value; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (romenable) - return ROM[addr | prg << 13]; + return Rom[addr | prg << 13]; else - return WRAM[addr]; + return Wram[addr]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (!romenable && addr >= 0x3800 && addr < 0x5800) - return WRAM[addr - 0x1800]; + return Wram[addr - 0x1800]; else - return ROM[addr | 0x18000]; + return Rom[addr | 0x18000]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr >= 0x3800 && addr < 0x5800) - WRAM[addr - 0x1800] = value; + Wram[addr - 0x1800] = value; else { switch (addr & 0x7000) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper106.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper106.cs index 9f4e707635..2b9d8aaa20 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper106.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper106.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper106 : NES.NESBoardBase + public sealed class Mapper106 : NesBoardBase { private byte[] regs = new byte[16]; @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { int a = addr & 0xF; switch(a) @@ -56,7 +56,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0xD: IRQa = false; IRQCount = 0; - IRQSignal = false; + IrqSignal = false; break; case 0xE: IRQCount = (IRQCount & 0xFF00) | value; @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(regs[0xC].Bit(0) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -113,20 +113,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } bank &= chr_bank_mask_1k; - return VROM[(bank << 10) + (addr & 0x3FF)]; + return Vrom[(bank << 10) + (addr & 0x3FF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int index = ((addr >> 13) & 3) + 8; int bank = regs[index] & prg_bank_mask_8k; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } - public override void ClockCPU() + public override void ClockCpu() { IrqHook(1); } @@ -138,7 +138,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQCount += a; if (IRQCount > 0x10000) { - IRQSignal = true; + IrqSignal = true; IRQa = false; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper107.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper107.cs index acc558c3ac..3856e7c9be 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper107.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper107.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper107 : NES.NESBoardBase + public sealed class Mapper107 : NesBoardBase { //configuration int prg_bank_mask_32k, chr_bank_mask_8k; @@ -37,25 +37,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int ofs = addr & ((1 << 13) - 1); addr = (chr_bank_8k << 13) | ofs; - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int ofs = addr & ((1 << 15) - 1); addr = (prg_bank_32k << 15) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { chr_bank_8k = value; prg_bank_32k = value >> 1; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper108.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper108.cs index 8a6841a2b1..f53cef3bd0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper108.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper108.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Meikyuu Jiin Dababa (FDS Conversion) - public sealed class Mapper108 : NES.NESBoardBase + public sealed class Mapper108 : NesBoardBase { private int prg; @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0xFFF || addr >= 0x7000) // hack ported from FCEUX to support Bubble Bobble (FDS Conversion, Kaiser Hacked) (Unl) [p1][!] @@ -34,14 +34,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | 0x18000]; + return Rom[addr | 0x18000]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[addr | prg << 13]; + return Rom[addr | prg << 13]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs index 25f1526385..1bcb088e19 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper116.cs @@ -6,14 +6,14 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper116 : NES.NESBoardBase + public sealed class Mapper116 : NesBoardBase { [NES.INESBoardImplCancel] class MMC3_CustomBoard : MMC3Board_Base { - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { - base.WritePRG(addr, value); + base.WritePrg(addr, value); SetMirrorType(mmc3.MirrorType); //often redundant, but gets the job done } @@ -126,12 +126,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncRoms() { - foreach (var board in new NES.NESBoardBase[] { mmc3, vrc2, mmc1 }) + foreach (var board in new NesBoardBase[] { mmc3, vrc2, mmc1 }) { - board.ROM = ROM; - board.VROM = VROM; - board.VRAM = VRAM; - board.WRAM = WRAM; + board.Rom = Rom; + board.Vrom = Vrom; + board.Vram = Vram; + board.Wram = Wram; } } @@ -167,36 +167,36 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (mode == 3) Console.WriteLine("(mmc1)"); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { WriteModeControl(addr + 0x4000, value); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { switch (mode) { - case 0: vrc2.WritePPU(addr, value); break; - case 1: mmc3.WritePPU(addr, value); break; + case 0: vrc2.WritePpu(addr, value); break; + case 1: mmc3.WritePpu(addr, value); break; case 2: - case 3: mmc1.WritePPU(addr, value); break; + case 3: mmc1.WritePpu(addr, value); break; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { switch (mode) { - case 0: return vrc2.ReadPPU(addr); - case 1: return mmc3.ReadPPU(addr); + case 0: return vrc2.ReadPpu(addr); + case 1: return mmc3.ReadPpu(addr); case 2: - case 3: return mmc1.ReadPPU(addr); + case 3: return mmc1.ReadPpu(addr); } return 0; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { Console.WriteLine("{0:X4} = {1:X2}", addr+0x8000, value); switch (mode) @@ -206,39 +206,39 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if((addr & 0xF000) < 0xB000) addr &= 0xF000; //Garou Densetsu Special depends on this addr -= 0x8000; - vrc2.WritePRG(addr, value); + vrc2.WritePrg(addr, value); break; - case 1: mmc3.WritePRG(addr, value); break; + case 1: mmc3.WritePrg(addr, value); break; case 2: - case 3: mmc1.WritePRG(addr, value); break; + case 3: mmc1.WritePrg(addr, value); break; } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { switch (mode) { - case 0: return vrc2.ReadPRG(addr); - case 1: return mmc3.ReadPRG(addr); + case 0: return vrc2.ReadPrg(addr); + case 1: return mmc3.ReadPrg(addr); case 2: - case 3: return mmc1.ReadPRG(addr); + case 3: return mmc1.ReadPrg(addr); } return 0; } - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { - mmc3.AddressPPU(addr); + mmc3.AddressPpu(addr); } - public override void ClockPPU() + public override void ClockPpu() { switch (mode) { case 0: break; - case 1: mmc3.ClockPPU(); break; + case 1: mmc3.ClockPpu(); break; case 2: - case 3: mmc1.ClockPPU(); break; + case 3: mmc1.ClockPpu(); break; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper120.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper120.cs index 3256092829..d198606c95 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper120.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper120.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper120 : NES.NESBoardBase + public sealed class Mapper120 : NesBoardBase { //Used by Tobidase Daisakusen (FDS Conversion). Undocumented by Disch docs, this implementation is based on FCEUX @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x01FF) { @@ -35,14 +35,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[((prg_reg & 7) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((prg_reg & 7) * 0x2000) + (addr & 0x1FFF)]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[0x10000 + addr]; + return Rom[0x10000 + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper125.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper125.cs index c3e44c9ad3..5863dc1c57 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper125.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper125.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper125 : NES.NESBoardBase + public sealed class Mapper125 : NesBoardBase { private byte reg; private int prg_bank_mask_8k; @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr == 0) { @@ -40,15 +40,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((addr >= 0x4000) && (addr < 0x6000)) - WRAM[addr - 0x4000] = value; + Wram[addr - 0x4000] = value; else - base.WritePRG(addr, value); + base.WritePrg(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = 0; if (addr < 0x2000) { bank = prg_bank_mask_8k - 3; } @@ -56,17 +56,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // for some reason WRAM is mapped to here. else if (addr < 0x6000) { - return WRAM[addr - 0x4000]; + return Wram[addr - 0x4000]; } else { bank = prg_bank_mask_8k; } bank &= prg_bank_mask_8k; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[((reg & prg_bank_mask_8k) << 13) + addr]; + return Rom[((reg & prg_bank_mask_8k) << 13) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper132.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper132.cs index 740516532b..a76ca82bdf 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper132.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper132.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Creatom // specs pulled from Nintendulator sources - public sealed class Mapper132 : NES.NESBoardBase + public sealed class Mapper132 : NesBoardBase { private byte[] reg = new byte[4]; @@ -56,12 +56,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr &= chr_mask; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { sync(value); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr <= 0x103 && addr >= 0x100) reg[addr & 0x03] = value; @@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { /*if ((addr & 0x100) != 0) @@ -85,27 +85,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return NES.DB; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { // Xiao Ma Li (Ch) has 16k prg (mapped to both 0x8000 and 0xC000) if (Cart.prg_size == 16) { - return ROM[addr & 0x3FFF]; + return Rom[addr & 0x3FFF]; } else { - return ROM[addr + ((prg & prg_mask) << 15)]; + return Rom[addr + ((prg & prg_mask) << 15)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr + (chr << 13)]; + return Vrom[addr + (chr << 13)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper136.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper136.cs index c7408848c8..d453c4415e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper136.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper136.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Mei Loi Siu Ji (Metal Fighter) (Sachen) [!] - public sealed class Mapper136 : NES.NESBoardBase + public sealed class Mapper136 : NesBoardBase { private int _chrBankMask_8k; private int _chrRegister; @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if ((addr & 0x103) == 0x102) { @@ -31,11 +31,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((addr & 0x103) == 0x102) { @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr == 0x100) { @@ -51,19 +51,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - return base.ReadEXP(addr); + return base.ReadExp(addr); } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = _chrRegister & _chrBankMask_8k; - return VROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(bank * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper142.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper142.cs index 1dd0b39513..33802acf54 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper142.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper142.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper142 : NES.NESBoardBase + public sealed class Mapper142 : NesBoardBase { private byte[] reg = new byte[8]; private byte cmd; @@ -28,32 +28,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[(reg[4] << 13) + (addr & 0x1FFF)]; + return Rom[(reg[4] << 13) + (addr & 0x1FFF)]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - if (addr < 0x2000) { return ROM[(reg[1] << 13) + (addr & 0x1FFF)]; } - if (addr < 0x4000) { return ROM[(reg[2] << 13) + (addr & 0x1FFF)]; } - if (addr < 0x6000) { return ROM[(reg[3] << 13) + (addr & 0x1FFF)]; } + if (addr < 0x2000) { return Rom[(reg[1] << 13) + (addr & 0x1FFF)]; } + if (addr < 0x4000) { return Rom[(reg[2] << 13) + (addr & 0x1FFF)]; } + if (addr < 0x6000) { return Rom[(reg[3] << 13) + (addr & 0x1FFF)]; } - return ROM[(lastBank << 13) + (addr & 0x1FFF)]; + return Rom[(lastBank << 13) + (addr & 0x1FFF)]; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { Write(addr + 0x4000, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { Write(addr + 0x6000, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { Write(addr + 0x8000, value); } @@ -68,12 +68,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQa = 0; IRQCount = 0; - IRQSignal = true; + IrqSignal = true; } } } - public override void ClockPPU() + public override void ClockPpu() { IRQHook(1); } @@ -83,29 +83,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES switch (addr & 0xF000) { case 0x8000: - IRQSignal = false; + IrqSignal = false; IRQCount = (IRQCount & 0x000F) | (value & 0x0F); isirqused = true; break; case 0x9000: - IRQSignal = false; + IrqSignal = false; IRQCount = (IRQCount & 0x00F0) | ((value & 0x0F) << 4); isirqused = true; break; case 0xA000: - IRQSignal = false; + IrqSignal = false; IRQCount = (IRQCount & 0x0F00) | ((value & 0x0F) << 8); isirqused = true; break; case 0xB000: - IRQSignal = false; + IrqSignal = false; IRQCount = (IRQCount & 0xF000) | (value << 12); isirqused = true; break; case 0xC000: if (isirqused) { - IRQSignal = false; + IrqSignal = false; IRQa = 1; } break; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs index 16b6ca2122..508660e358 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper143.cs @@ -4,7 +4,7 @@ // NROM plus random copy protection circuit // dancing blocks refuses to run; see comments below - public sealed class Mapper143 : NES.NESBoardBase + public sealed class Mapper143 : NesBoardBase { public override bool Configure(NES.EDetectionOrigin origin) { @@ -22,7 +22,7 @@ return true; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if ((addr & 0x100) != 0) return (byte)(NES.DB & 0xc0 | ~addr & 0x3f); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper147.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper147.cs index cb2515859d..496a1e83aa 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper147.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper147.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Challenge of the Dragon (Sachen) [!] // Chinese KungFu (Sachen-JAP) [!] - public sealed class Mapper147 : NES.NESBoardBase + public sealed class Mapper147 : NesBoardBase { private int _chrBankMask_8k; private int _prgBankMask_32k; @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if ((addr & 0x103) == 0x102) { @@ -39,11 +39,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((addr & 0x103) == 0x102) { @@ -51,23 +51,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = _chrRegister >> 3 & 0x0F; bank &= _chrBankMask_8k; - return VROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(bank * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = ((_chrRegister & 0x80) >> 6) | ((_chrRegister >> 2) & 1); bank &= _prgBankMask_32k; - return ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper150.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper150.cs index 44cce75b7f..a0e184b66f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper150.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper150.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // basic on FCEUX src - public sealed class Mapper150 : NES.NESBoardBase + public sealed class Mapper150 : NesBoardBase { private byte[] latch = new byte[8]; private int cmd; @@ -34,14 +34,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(cmd), ref cmd); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr += 0x4000; Write(addr, value); SetMirroring(latch[2]); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { addr += 0x6000; Write(addr, value); @@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { byte ret; addr += 0x4000; @@ -114,21 +114,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[((latch[0] & prg_mask) << 15) + addr]; + return Rom[((latch[0] & prg_mask) << 15) + addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = latch[1] | latch[3] | latch[4]; bank &= chr_mask; - return VROM[(bank << 13) + addr]; + return Vrom[(bank << 13) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs index a49935f9e0..7161e80e56 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper156.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES * Buzz and Waldog (K) * General's Son (K) */ - public sealed class Mapper156 : NES.NESBoardBase + public sealed class Mapper156 : NesBoardBase { int prg_mask; int chr_mask; @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { for (int i = 0; i < chr.Length; i++) chr[i] = 0; @@ -39,23 +39,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.OneScreenA); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) - return ROM[addr + (prg << 14)]; + return Rom[addr + (prg << 14)]; else - return ROM[(addr & 0x3fff) + (prg_mask << 14)]; + return Rom[(addr & 0x3fff) + (prg_mask << 14)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x3ff) + (chr[addr >> 10] << 10)]; + return Vrom[(addr & 0x3ff) + (chr[addr >> 10] << 10)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper162.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper162.cs index d7302fd0ad..9bd83253fe 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper162.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper162.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper162 : NES.NESBoardBase + public sealed class Mapper162 : NesBoardBase { private byte[] reg = new byte[8]; private int prg_bank_mask_32k; @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) { @@ -40,11 +40,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = 0; switch (reg[3] & 7) @@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES break; } - return ROM[((bank & prg_bank_mask_32k) << 15) + addr]; + return Rom[((bank & prg_bank_mask_32k) << 15) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs index ed6f380762..d4d08d9922 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper164.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper164 : NES.NESBoardBase + public sealed class Mapper164 : NesBoardBase { // http://wiki.nesdev.com/w/index.php/INES_Mapper_164 @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr = (addr + 0x4000) & 0x7300; switch (addr) @@ -41,11 +41,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = (_prgHigh << 4) | (_prgLow & 0xF); bank &= prg_bank_mask_32k; - return ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } public override void SyncState(Serializer ser) @@ -55,10 +55,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("prgLow", ref _prgLow); } - public override void NESSoftReset() + public override void NesSoftReset() { _prgHigh = 0xFF; - base.NESSoftReset(); + base.NesSoftReset(); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper168.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper168.cs index f41057fc51..33245f5385 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper168.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper168.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // defaults to off, the control regs are write only, and cannot be reenabled. so... // todo: special controller, and IRQ is possibly wrong - public sealed class Mapper168 : NES.NESBoardBase + public sealed class Mapper168 : NesBoardBase { int prg = 0; int chr = 0; @@ -33,11 +33,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { return addr >= 0x4000 - ? ROM[addr + 0x8000] - : ROM[addr + (prg << 14)]; + ? Rom[addr + 0x8000] + : Rom[addr + (prg << 14)]; } // the chr reg on hardware is supposedly bitscrambled and then inverted from @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return chr; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x4000) { @@ -56,31 +56,31 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg = value >> 6 & 3; } else if (addr == 0x7080) // ack - IRQSignal = false; + IrqSignal = false; else if (addr == 0x7000) // start count irqclock = 0; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x1000) - return VRAM[addr | Scramble(0) << 12]; + return Vram[addr | Scramble(0) << 12]; if (addr < 0x2000) - return VRAM[(addr & 0xfff) | Scramble(chr) << 12]; - return base.ReadPPU(addr); + return Vram[(addr & 0xfff) | Scramble(chr) << 12]; + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x1000) - VRAM[addr | Scramble(0) << 12] = value; + Vram[addr | Scramble(0) << 12] = value; else if (addr < 0x2000) - VRAM[(addr & 0xfff) | Scramble(chr) << 12] = value; + Vram[(addr & 0xfff) | Scramble(chr) << 12] = value; else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } - public override byte[] SaveRam => VRAM; + public override byte[] SaveRam => Vram; public override void SyncState(Serializer ser) { @@ -90,12 +90,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(irqclock), ref irqclock); } - public override void ClockCPU() + public override void ClockCpu() { if (irqclock == 2048 - 1) { irqclock++; - IRQSignal = true; + IrqSignal = true; } else if (irqclock < 2048 - 1) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper170.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper170.cs index 11fd6ee818..98d61c096c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper170.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper170.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper170 : NES.NESBoardBase + public sealed class Mapper170 : NesBoardBase { private byte reg; @@ -25,18 +25,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return base.ReadPRG(addr); + return base.ReadPrg(addr); } - int last16kBank = ROM.Length - 0x4000; - return ROM[last16kBank + (addr & 0x3FFF)]; + int last16kBank = Rom.Length - 0x4000; + return Rom[last16kBank + (addr & 0x3FFF)]; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr == 0x502 || addr == 0x1000) { @@ -44,17 +44,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (addr == 0x1001 || addr == 0x1777) { return (byte)(reg | NES.DB & 0x7F); } - return base.ReadWRAM(addr); + return base.ReadWram(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper175.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper175.cs index 9755c01bd9..b58d7bd345 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper175.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper175.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper175 : NES.NESBoardBase + public sealed class Mapper175 : NesBoardBase { private bool delay; @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr == 0) { @@ -73,17 +73,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(chrReg << 13) + addr]; + return Vrom[(chrReg << 13) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr == 0x7FFC) { @@ -93,15 +93,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x4000) { - return ROM[(prgReg8 << 14) + (addr & 0x3FFF)]; + return Rom[(prgReg8 << 14) + (addr & 0x3FFF)]; } else if (addr < 0x6000) { - return ROM[(prgRegC << 13) + (addr & 0x1FFF)]; + return Rom[(prgRegC << 13) + (addr & 0x1FFF)]; } else { - return ROM[(prgRegE << 13) + (addr & 0x1FFF)]; + return Rom[(prgRegE << 13) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper176.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper176.cs index 32c6850eb3..b3f43751f4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper176.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper176.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper176 : NES.NESBoardBase + public sealed class Mapper176 : NesBoardBase { //configuration int prg_bank_mask_8k, chr_bank_mask_8k; @@ -52,13 +52,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(kMirrorTypes[mirror]); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(13,prg_banks_8k,addr); - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { @@ -72,14 +72,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = ApplyMemoryMap(13, chr_banks_8k, addr); return base.ReadPPUChr(addr); } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } void SetPrg32k(int value) @@ -89,7 +89,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ApplyMemoryMapMask(prg_bank_mask_8k, prg_banks_8k); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper177.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper177.cs index 13ab928420..5c88b9d164 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper177.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper177.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // china // behavior from fceux - public sealed class Mapper177 : NES.NESBoardBase + public sealed class Mapper177 : NesBoardBase { private int prg; @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg = value & 0x1f; @@ -32,9 +32,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.Vertical); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper178.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper178.cs index 7af65a6507..559005162f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper178.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper178.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper178 : NES.NESBoardBase + public sealed class Mapper178 : NesBoardBase { //configuration int prg_bank_mask_32k; @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr) { @@ -52,10 +52,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(15, prg_banks_32k, addr); - return ROM[addr]; + return Rom[addr]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper180.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper180.cs index a938e13329..1de39f916b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper180.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper180.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper180 : NES.NESBoardBase + public sealed class Mapper180 : NesBoardBase { //Mapper 180 //Crazy Climber (J) @@ -41,20 +41,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[1] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_16k = (byte)(value & 7); SyncPRG(); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs index 96d1ccf229..97035af078 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper183.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { // Adpated from FCEUX src - public sealed class Mapper183 : NES.NESBoardBase + public sealed class Mapper183 : NesBoardBase { private byte[] prg = new byte[4]; private byte[] chr = new byte[8]; @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void ClockCPU() + public override void ClockCpu() { if (IRQa) { @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQCount++; if (IRQCount == 0xFF) { - IRQSignal = true; + IrqSignal = true; IRQCount = IRQLatch; } } @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQCount++; if (IRQCount >= 0x100) { - IRQSignal = IRQa; + IrqSignal = IRQa; IRQCount = IRQLatch; } } @@ -84,12 +84,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { WriteReg(addr + 0x6000, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { WriteReg(addr + 0x8000, value); } @@ -124,34 +124,34 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQPre = 341; IRQCount = IRQLatch; } - IRQSignal = false; + IrqSignal = false; break; case 0xF00C: - IRQSignal = false; + IrqSignal = false; IRQa = IRQr; break; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int x = (addr >> 10) & 7; int bank = (chr[x] & chr_bank_mask_1k) << 10; - return VROM[bank + (addr & 0x3FF)]; // TODO + return Vrom[bank + (addr & 0x3FF)]; // TODO } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[(((prg[3] & prg_bank_mask_8k)) << 13) + (addr & 0x1FFF)]; + return Rom[(((prg[3] & prg_bank_mask_8k)) << 13) + (addr & 0x1FFF)]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k; if (addr < 0x2000) // 0x8000 @@ -172,7 +172,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_8k = prg_bank_mask_8k; } - return ROM[(bank_8k << 13) + (addr & 0x1FFF)]; + return Rom[(bank_8k << 13) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper186.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper186.cs index 589522ae4a..27569da84e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper186.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper186.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper186 : NES.NESBoardBase + public class Mapper186 : NesBoardBase { private byte[] _SRAM = new byte[3072]; private byte[] regs = new byte[4]; @@ -27,23 +27,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[(regs[1] << 14) + (addr & 0x3FFF)]; + return Rom[(regs[1] << 14) + (addr & 0x3FFF)]; } // C000-FFFF is always bank 0 - return ROM[addr & 0x3FFF]; + return Rom[addr & 0x3FFF]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[(regs[0] >> 6) + addr]; + return Rom[(regs[0] >> 6) + addr]; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x200 && addr < 0x400) { @@ -58,11 +58,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x200 && addr < 0x400) { @@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return _SRAM[addr - 0x400]; } - return base.ReadEXP(addr); + return base.ReadExp(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper188.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper188.cs index b88e89ae81..f809b753a2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper188.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper188.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper188 : NES.NESBoardBase + public sealed class Mapper188 : NesBoardBase { // config int prg_16k_mask; @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg = value; } @@ -39,17 +39,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = prg; if (addr >= 0x4000) bank = 15; bank ^= 8; // bad dumps? bank &= prg_16k_mask; - return ROM[addr & 0x3fff | bank << 14]; + return Rom[addr & 0x3fff | bank << 14]; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { return 3; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs index 1d1364fa4b..05d83d4ff8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper190.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Magic Kid GooGoo - public sealed class Mapper190 : NES.NESBoardBase + public sealed class Mapper190 : NesBoardBase { //state int prg_reg; @@ -34,19 +34,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[(prg_reg * 0x4000) + addr]; + return Rom[(prg_reg * 0x4000) + addr]; } else { - return ROM[addr - 0x4000]; + return Rom[addr - 0x4000]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -54,13 +54,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int ofs = addr & ((1 << 11) - 1); bank = chr_reg[bank]; addr = (bank << 11) | ofs; - return VROM[addr]; + return Vrom[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { int addr_temp = addr & 0xF000; switch (addr_temp) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs index d4c9f0c30c..6e985c8e5c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper193.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/INES_Mapper_193 - public sealed class Mapper193 : NES.NESBoardBase + public sealed class Mapper193 : NesBoardBase { private int prg_bank_mask_8k; private byte[] prg_banks_8k = new byte[4]; @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_banks_2k), ref chr_banks_2k, false); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { addr &= 0x6003; switch (addr) @@ -70,7 +70,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SyncMap(); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -78,13 +78,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return base.ReadPPUChr(addr); } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(13, prg_banks_8k, addr); - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper200.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper200.cs index 9139a179b9..6e0e7043a7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper200.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper200.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // https://wiki.nesdev.com/w/index.php/INES_Mapper_200 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper200 : NES.NESBoardBase + public sealed class Mapper200 : NesBoardBase { int prg_reg_16k, chr_reg_8k; int prg_bank_mask_16k; @@ -34,7 +34,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr.Bit(3)) { @@ -49,25 +49,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_reg_8k = reg & chr_bank_mask_8k; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[(prg_reg_16k * 0x4000) + addr]; + return Rom[(prg_reg_16k * 0x4000) + addr]; } else { - return ROM[(prg_reg_16k * 0x4000) + addr - 0x4000]; + return Rom[(prg_reg_16k * 0x4000) + addr - 0x4000]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(chr_reg_8k * 0x2000) + addr]; + return Vrom[(chr_reg_8k * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper201.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper201.cs index 48549976fa..aac3c31e1a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper201.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper201.cs @@ -3,7 +3,7 @@ // https://wiki.nesdev.com/w/index.php/INES_Mapper_201 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper201 : NES.NESBoardBase + public sealed class Mapper201 : NesBoardBase { public int reg; public int prg_bank_mask_32k; @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((addr & 0x08) > 0) { @@ -42,18 +42,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[((reg & prg_bank_mask_32k) * 0x8000) + addr]; + return Rom[((reg & prg_bank_mask_32k) * 0x8000) + addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((reg & chr_bank_mask_8k) * 0x2000) + addr]; + return Vrom[((reg & chr_bank_mask_8k) * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs index 392fbe4e62..a4dd94e387 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper202.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // 150-in-1 // http://wiki.nesdev.com/w/index.php/INES_Mapper_202 - public class Mapper202 : NES.NESBoardBase + public class Mapper202 : NesBoardBase { private int _reg; private bool _isprg32KMode; @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("isPrg32kMode", ref _isprg32KMode); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = (addr >> 1) & 7; _isprg32KMode = addr.Bit(0) && addr.Bit(3); @@ -38,24 +38,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(addr.Bit(0) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (_isprg32KMode) { - return ROM[((_reg >> 1) * 0x8000) + (addr & 0x7FFF)]; + return Rom[((_reg >> 1) * 0x8000) + (addr & 0x7FFF)]; } - return ROM[(_reg * 0x4000) + (addr & 0x3FFF)]; + return Rom[(_reg * 0x4000) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(_reg * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(_reg * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper203.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper203.cs index 434e460b5c..04ab4038c4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper203.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper203.cs @@ -3,7 +3,7 @@ // https://wiki.nesdev.com/w/index.php/INES_Mapper_203 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper203 : NES.NESBoardBase + public sealed class Mapper203 : NesBoardBase { int prg_reg_16k, chr_reg_8k; int prg_bank_mask_16k; @@ -32,24 +32,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_reg_16k = (value >> 2) & prg_bank_mask_16k; chr_reg_8k = (value & 0x03) & chr_bank_mask_8k; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(prg_reg_16k * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prg_reg_16k * 0x4000) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(chr_reg_8k * 0x2000) + addr]; + return Vrom[(chr_reg_8k * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper204.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper204.cs index 0998cac269..8849c21b9e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper204.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper204.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // 64-in-1 // http://wiki.nesdev.com/w/index.php/INES_Mapper_204 - public class Mapper204 : NES.NESBoardBase + public class Mapper204 : NesBoardBase { private int _reg1, _reg2; @@ -34,7 +34,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("reg2", ref _reg2); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg1 = addr & 0x6; _reg2 = _reg1 + ((_reg1 == 0x6) ? 0 : (addr & 1)); @@ -43,24 +43,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(addr.Bit(0) ? EMirrorType.Vertical : EMirrorType.Horizontal); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[((_reg2 & prg_mask_16k) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((_reg2 & prg_mask_16k) * 0x4000) + (addr & 0x3FFF)]; } - return ROM[((_reg1 & prg_mask_16k) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((_reg1 & prg_mask_16k) * 0x4000) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((_reg2 & chr_mask_8k) * 0x2000) + (addr & 0x1FFF)]; + return Vrom[((_reg2 & chr_mask_8k) * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs index ea1e0cc422..f3a1f7765e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper212.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // 999999-in-1 // 1000000-in-1 // http://wiki.nesdev.com/w/index.php/INES_Mapper_212 - public class Mapper212 : NES.NESBoardBase + public class Mapper212 : NesBoardBase { private int _reg; private int prg_bank_mask_32k, prg_bank_mask_16k, chr_bank_mask_8k; @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(_reg), ref _reg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; @@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(addr.Bit(3) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr += 0x8000; byte ret; @@ -56,13 +56,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { int bank = (_reg >> 1) & 3; bank &= prg_bank_mask_32k; - ret = ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + ret = Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } else { int bank = _reg & 7; bank &= prg_bank_mask_16k; - ret = ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + ret = Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } if ((addr & 0xE010) == 0x6000) @@ -73,16 +73,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return ret; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = _reg & 7; bank &= chr_bank_mask_8k; - return VROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(bank * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper213.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper213.cs index 2b1ef978fa..c68f006a0a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper213.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper213.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // 9999999-in-1 [p2] // http://wiki.nesdev.com/w/index.php/INES_Mapper_213 - public class Mapper213 : NES.NESBoardBase + public class Mapper213 : NesBoardBase { private int _reg; @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(_reg), ref _reg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; @@ -40,21 +40,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(addr.Bit(3) ? EMirrorType.Vertical : EMirrorType.Horizontal); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = (_reg >> 1) & 3; - return ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = (_reg >> 3) & 7; - return VROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(bank * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper214.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper214.cs index 04552df6a8..8806ce0031 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper214.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper214.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Super Gun 20-in-1 // http://wiki.nesdev.com/w/index.php/INES_Mapper_214 - public class Mapper214 : NES.NESBoardBase + public class Mapper214 : NesBoardBase { private int _chrReg, _prgReg; @@ -29,25 +29,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("chrReg", ref _chrReg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _chrReg = addr & 3; _prgReg = (addr >> 2) & 3; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(_prgReg * 0x4000) + (addr & 0x3FFF)]; + return Rom[(_prgReg * 0x4000) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(_chrReg * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(_chrReg * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper218.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper218.cs index 7083b258f1..d5c5223039 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper218.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper218.cs @@ -2,7 +2,7 @@ { // rewires pins to use internal CIRAM as both nametable and pattern data, so // the entire cart is just a single PRGROM chip (plus CIC) - public sealed class Mapper218 : NES.NESBoardBase + public sealed class Mapper218 : NesBoardBase { //configuration int prg_byte_mask; @@ -62,20 +62,20 @@ return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { return NES.CIRAM[TransformPPU(addr)]; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { NES.CIRAM[TransformPPU(addr)] = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr &= prg_byte_mask; - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper220.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper220.cs index 9c761b51a5..a7107f42e3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper220.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper220.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { // Ported from FCEUX - public sealed class Mapper220 : NES.NESBoardBase + public sealed class Mapper220 : NesBoardBase { private byte[] reg = new byte[8]; private int prg_mask_2k; @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; switch (addr & 0xF003) @@ -64,28 +64,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { int i = ((addr >> 11) & 3) + 4; int bank = reg[i] & prg_mask_2k; - return ROM[(bank << 11) + (addr & 0x7FF)]; + return Rom[(bank << 11) + (addr & 0x7FF)]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x2000) { int i = (addr >> 11) & 3; int bank = reg[i] & prg_mask_2k; - return ROM[(bank << 11) + (addr & 0x7FF)]; + return Rom[(bank << 11) + (addr & 0x7FF)]; } else if (addr < 0x4000) { - return ROM[0x1A000 /* bank 0xd*/ + (addr & 0x1FFF)]; + return Rom[0x1A000 /* bank 0xd*/ + (addr & 0x1FFF)]; } else { - return ROM[0x1C000 /* bank 7*/ + (addr & 0x3FFF)]; + return Rom[0x1C000 /* bank 7*/ + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper221.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper221.cs index f8b420dc10..0520fcf20a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper221.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper221.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper221 : NES.NESBoardBase + public class Mapper221 : NesBoardBase { int[] regs = new int[2]; @@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x4000) { @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank; if (addr < 0x4000) @@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank = (regs[0] >> 1 & 0x38) | ((regs[0].Bit(0) ? ((regs[0] & 0x80) > 0) ? 0x7 : (regs[1] & 0x6) | 0x1 : regs[1])); } - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs index 36e0655218..7d0a9f4782 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper222.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Bad Dudes.7z|Dragon Ninja (J) [p1][!].nes // irq doesn't work right; easily seen in any level but level 1 - public sealed class Mapper222 : NES.NESBoardBase + public sealed class Mapper222 : NesBoardBase { int prg_bank_mask_8k; int chr_bank_mask_1k; @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0x7003; switch (addr) @@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //case 0x7001: // this is of course sort of VRC like... except it doesn't work right irq_time = value; - IRQSignal = false; + IrqSignal = false; irq_counting = true; if (value == 0) irq_counting = false; @@ -87,20 +87,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES }*/ } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr & 0x1fff | prg[addr >> 13] << 13]; + return Rom[addr & 0x1fff | prg[addr >> 13] << 13]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr & 0x3ff | chr[addr >> 10] << 10]; + return Vrom[addr & 0x3ff | chr[addr >> 10] << 10]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void ClockCPU() + public override void ClockCpu() { if (irq_counting) { @@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (irq_time >= 240) { //irq_counting = false; - IRQSignal = true; + IrqSignal = true; //irq_time = 0; Console.WriteLine("IRQ TRIG: SL {0}", NES.ppu.ppur.status.sl); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper225.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper225.cs index d87ad661ac..034f30614f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper225.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper225.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/INES_Mapper_225 - public sealed class Mapper225 : NES.NESBoardBase + public sealed class Mapper225 : NesBoardBase { bool prg_mode = false; int chr_reg; @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; prg_mode = addr.Bit(12); @@ -58,29 +58,30 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_reg = addr & 0x3F | high; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode == false) { int bank = (prg_reg >> 1) & prg_bank_mask_32k; - return ROM[(bank * 0x8000) + addr]; + return Rom[(bank * 0x8000) + addr]; } else { - return ROM[((prg_reg & prg_bank_mask_16k) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((prg_reg & prg_bank_mask_16k) * 0x4000) + (addr & 0x3FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((chr_reg & chr_bank_mask_8k) * 0x2000) + addr]; + return Vrom[((chr_reg & chr_bank_mask_8k) * 0x2000) + addr]; } - return base.ReadPPU(addr); + + return base.ReadPpu(addr); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1800) { @@ -88,16 +89,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1800) { - return eRAM[(addr & 0x03)]; - } - else - { - return base.ReadEXP(addr); + return eRAM[addr & 0x03]; } + + return base.ReadExp(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs index 5b26257276..7e6822f94f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper226.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper226 : NES.NESBoardBase + public sealed class Mapper226 : NesBoardBase { // http://wiki.nesdev.com/w/index.php/INES_Mapper_226 public int prg_page; @@ -38,12 +38,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { resetFlag ^= true; prg_page = 0; prg_mode = false; - base.NESSoftReset(); + base.NesSoftReset(); } public override void SyncState(Serializer ser) @@ -55,7 +55,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 1; if (addr == 0) @@ -80,18 +80,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int baseAddr = resetSwitchMode && resetFlag ? 0x80000 : 0; if (prg_mode == false) - { - return ROM[baseAddr + (( ((prg_page >> 1) & prg_mask_32k) << 15) + (addr & 0x7FFF))]; - } - else { - return ROM[baseAddr + (((prg_page & prg_mask_16k) << 14) + (addr & 0x3FFF))]; + return Rom[baseAddr + (( ((prg_page >> 1) & prg_mask_32k) << 15) + (addr & 0x7FFF))]; } + + return Rom[baseAddr + (((prg_page & prg_mask_16k) << 14) + (addr & 0x3FFF))]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs index a50b25d766..4f7aae0b77 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper227.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper227 : NES.NESBoardBase + public sealed class Mapper227 : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -36,17 +36,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { bool S = addr.Bit(0); bool M_horz = addr.Bit(1); @@ -100,15 +100,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { if (vram_protected) return; - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper230.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper230.cs index 057ef5fc35..e1e378bfd8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper230.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper230.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_230 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper230 : NES.NESBoardBase + public sealed class Mapper230 : NesBoardBase { //TODO: soft reset back to contra = fails public int prg_page; @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (contra_mode) { @@ -59,34 +59,34 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (contra_mode) { if (addr < 0x4000) { - return ROM[((prg_page & chip0_prg_bank_mask_16k) * 0x4000) + addr]; + return Rom[((prg_page & chip0_prg_bank_mask_16k) * 0x4000) + addr]; } else { - return ROM[(7 * 0x4000) + (addr & 0x3FFF)]; + return Rom[(7 * 0x4000) + (addr & 0x3FFF)]; } } else { if (prg_mode == false) { - return ROM[((prg_page >> 1) * 0x8000) + addr + chip1_offset]; + return Rom[((prg_page >> 1) * 0x8000) + addr + chip1_offset]; } else { int page = prg_page + 8; - return ROM[(page * 0x4000) + (addr & 0x03FFF)]; + return Rom[(page * 0x4000) + (addr & 0x03FFF)]; } } } - public override void NESSoftReset() + public override void NesSoftReset() { contra_mode ^= true; prg_page = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper231.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper231.cs index 1ba1b0c1bc..413e745977 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper231.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper231.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_231 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper231 : NES.NESBoardBase + public sealed class Mapper231 : NesBoardBase { public int prg_reg; public int prg_bank_mask_16k; @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr.Bit(7)) { @@ -46,10 +46,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_reg &= prg_bank_mask_16k; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = prg_reg; - return ROM[(bank << 14) + addr - 0x4000]; + return Rom[(bank << 14) + addr - 0x4000]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper233.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper233.cs index 1d7abea274..17de36d60d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper233.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper233.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_233 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper233 : NES.NESBoardBase + public sealed class Mapper233 : NesBoardBase { public int prg_page; public bool prg_mode; @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_page = value & 0x1F; prg_mode = value.Bit(5); @@ -53,14 +53,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode == false) { - return ROM[((prg_page >> 1) * 0x8000) + addr]; + return Rom[((prg_page >> 1) * 0x8000) + addr]; } - return ROM[(prg_page * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prg_page * 0x4000) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs index e112589e36..8523a531a0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper235.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper235 : NES.NESBoardBase + public sealed class Mapper235 : NesBoardBase { private int _reg; @@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("reg", ref _reg); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((_reg & 0x800) > 0) { @@ -48,16 +48,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - return ROM[((bank & _prg16BankMask) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((bank & _prg16BankMask) * 0x4000) + (addr & 0x3FFF)]; } else { int bank = ((_reg & 0x300) >> 4) | (_reg & 0x1F); - return ROM[((bank & _prg32BankMask) * 0x8000) + (addr & 0x7FFF)]; + return Rom[((bank & _prg32BankMask) * 0x8000) + (addr & 0x7FFF)]; } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = addr; SyncMirroring(); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs index 6bbb192846..4d165bc058 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper236.cs @@ -3,7 +3,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper236 : NES.NESBoardBase + public sealed class Mapper236 : NesBoardBase { [MapperProp] public byte CartSwitch_70in1 = 0xd; @@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("Cart_Switch", ref CartSwitch_800in1); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; if ((addr & 0x4000) > 0) @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { switch (bank_mode) { @@ -96,22 +96,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { addr = (addr & 0x7FF0) | ((isLargeBanks ? CartSwitch_800in1 : CartSwitch_70in1) & 0xf); } - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; case 0x20: - return ROM[(((large_bank | prg_bank) >> 1) << 15) + addr]; + return Rom[(((large_bank | prg_bank) >> 1) << 15) + addr]; case 0x30: - return ROM[((large_bank | prg_bank) << 14) + (addr & 0x3FFF)]; + return Rom[((large_bank | prg_bank) << 14) + (addr & 0x3FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000 && VROM != null) + if (addr < 0x2000 && Vrom != null) { - return VROM[(chr_bank << 13) + (addr & 0x1FFF)]; + return Vrom[(chr_bank << 13) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper240.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper240.cs index ea32eb0e0e..4989330bf3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper240.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper240.cs @@ -3,7 +3,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper240 : NES.NESBoardBase + public sealed class Mapper240 : NesBoardBase { //MHROM (mapper60) -like but wider regs (4 prg, 4 chr instead of 2 prg, 2 chr) and on EXP bus @@ -42,21 +42,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_bank_8k), ref chr_bank_8k); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr + (chr_bank_8k * 0x2000)]; + return Vrom[addr + (chr_bank_8k * 0x2000)]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr + (prg_bank_32k * 0x8000)]; + return Rom[addr + (prg_bank_32k * 0x8000)]; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { //if (ROM != null && bus_conflict) value = HandleNormalPRGConflict(addr, value); Console.WriteLine("{0:x4} = {1:x2}", addr + 0x4000, value); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper241.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper241.cs index 9192368755..e56e3566b0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper241.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper241.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper241 : NES.NESBoardBase + public sealed class Mapper241 : NesBoardBase { //163 is for nanjing games @@ -31,22 +31,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { //some kind of magic number.. return 0x50; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_banks_32k[0] = value; ApplyMemoryMapMask(prg_bank_mask_32k, prg_banks_32k); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(15, prg_banks_32k, addr); - return ROM[addr]; + return Rom[addr]; } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs index 837d7ec9b8..809fb246b0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper242.cs @@ -17,7 +17,7 @@ mirroring - both * Wai Xing Zhan Shi (Ch) */ - public sealed class Mapper242 : NES.NESBoardBase + public sealed class Mapper242 : NesBoardBase { int prg; @@ -35,12 +35,12 @@ mirroring - both return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr + (prg * 0x8000)]; + return Rom[addr + (prg * 0x8000)]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg = (addr >> 3) & 15; //fceux had different logic here for the mirroring, but that didnt match with experiments on dragon quest 8 nor disch's docs diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs index 99363c7196..2d25a74fe9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper243.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper243 : NES.NESBoardBase + public sealed class Mapper243 : NesBoardBase { // http://wiki.nesdev.com/w/index.php/INES_Mapper_243 @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr & 0x01) { @@ -123,7 +123,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (var_a) { @@ -131,11 +131,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { int chr_bank = regs[4] | (regs[6] << 1) | (regs[2] << 3); - return VROM[((chr_bank & chr_bank_mask_8k) * 0x2000) + addr]; + return Vrom[((chr_bank & chr_bank_mask_8k) * 0x2000) + addr]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } else @@ -144,18 +144,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { int chr_bank = (regs[4] << 2) | (regs[6]) | (regs[2] << 3); - return VROM[((chr_bank & chr_bank_mask_8k) * 0x2000) + addr]; + return Vrom[((chr_bank & chr_bank_mask_8k) * 0x2000) + addr]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[((regs[5] & prg_bank_mask_32k) * 0x8000) + addr]; + return Rom[((regs[5] & prg_bank_mask_32k) * 0x8000) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper244.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper244.cs index f8a15ec954..652acabda0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper244.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper244.cs @@ -3,7 +3,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper244 : NES.NESBoardBase + public class Mapper244 : NesBoardBase { public override bool Configure(NES.EDetectionOrigin origin) { @@ -48,22 +48,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("prgRegister", ref _prgRegister); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(_chrRegister * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(_chrRegister * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(_prgRegister * 0x8000) + (addr & 0x7FFF)]; + return Rom[(_prgRegister * 0x8000) + (addr & 0x7FFF)]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((value & 0x08) > 0) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper246.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper246.cs index b4108eb02d..551d15e785 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper246.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper246.cs @@ -3,7 +3,7 @@ // http://wiki.nesdev.com/w/index.php/INES_Mapper_246 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper246 : NES.NESBoardBase + public sealed class Mapper246 : NesBoardBase { int prg_bank_mask_8k; byte[] prg_banks_8k = new byte[4]; @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_banks_2k), ref chr_banks_2k, false); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x0800) { @@ -78,11 +78,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -90,13 +90,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return base.ReadPPUChr(addr); } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(13, prg_banks_8k, addr); - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs index bb3eb017c3..db0260f433 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper252.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { // Adapted from FCEUX src - public sealed class Mapper252 : NES.NESBoardBase + public sealed class Mapper252 : NesBoardBase { private byte[] preg = new byte[2]; private byte[] creg = new byte[8]; @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(creg), ref creg, false); } - public override void ClockCPU() + public override void ClockCpu() { if (IRQa) { @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQCount++; if (IRQCount==0x100) { - IRQSignal=true; + IrqSignal=true; IRQCount = IRQLatch; } } @@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { WriteReg((addr + 0x8000), value); } @@ -90,15 +90,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES preg[1] = value; break; - case 0xF000: IRQSignal = false; IRQLatch &= 0xF0; IRQLatch |= value & 0xF; break; - case 0xF004: IRQSignal = false; IRQLatch &= 0x0F; IRQLatch |= value << 4; break; - case 0xF008: IRQSignal = false; IRQClock = 0; IRQCount = IRQLatch; IRQa = value.Bit(1); break; + case 0xF000: IrqSignal = false; IRQLatch &= 0xF0; IRQLatch |= value & 0xF; break; + case 0xF004: IrqSignal = false; IRQLatch &= 0x0F; IRQLatch |= value << 4; break; + case 0xF008: IrqSignal = false; IRQClock = 0; IRQCount = IRQLatch; IRQa = value.Bit(1); break; } } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank; @@ -120,10 +120,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -133,25 +133,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (creg[x] == 6 || creg[x] == 7) { bank = creg[x] & 1; - return VRAM[(bank << 10) + (addr & 0x3FF)]; + return Vram[(bank << 10) + (addr & 0x3FF)]; } else { bank = (creg[x] & chr_bank_mask_1k) << 10; - return VROM[bank + (addr & 0x3FF)]; + return Vrom[bank + (addr & 0x3FF)]; } } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - if (VRAM != null) - VRAM[addr&0x7FF] = value; + if (Vram != null) + Vram[addr&0x7FF] = value; } else { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs index 1d53d77c94..5f32bb73aa 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper253.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class Mapper253 : NES.NESBoardBase + public class Mapper253 : NesBoardBase { private byte[] prg = new byte[2]; private byte[] chrlo = new byte[8]; @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chrhi), ref chrhi, false); } - public override void ClockCPU() + public override void ClockCpu() { if (IRQa) { @@ -50,14 +50,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQCount++; if (IRQCount == 0x100) { - IRQSignal = true; + IrqSignal = true; IRQCount = IRQLatch; } } } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; if ((addr >= 0xB000) && (addr <= 0xE00C)) @@ -84,9 +84,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0xA010: prg[1] = value; break; case 0x9400: SetMirroring(value); break; - case 0xF000: IRQSignal = false; IRQLatch &= 0xF0; IRQLatch |= value & 0xF; break; - case 0xF004: IRQSignal = false; IRQLatch &= 0x0F; IRQLatch |= value << 4; break; - case 0xF008: IRQSignal = false; IRQClock = 0; IRQCount = IRQLatch; IRQa = value.Bit(1); break; + case 0xF000: IrqSignal = false; IRQLatch &= 0xF0; IRQLatch |= value & 0xF; break; + case 0xF004: IrqSignal = false; IRQLatch &= 0x0F; IRQLatch |= value << 4; break; + case 0xF008: IrqSignal = false; IRQClock = 0; IRQCount = IRQLatch; IRQa = value.Bit(1); break; } } } @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank; @@ -124,10 +124,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) @@ -139,23 +139,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((chrlo[x] == 4 || chrlo[x] == 5) && !vlock) { bank = chr & 1; - return VRAM[(bank << 10) + (addr & 0x3FF)]; + return Vram[(bank << 10) + (addr & 0x3FF)]; } else { - return VROM[bank + (addr & 0x3FF)]; + return Vrom[bank + (addr & 0x3FF)]; } } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - if (VRAM != null) + if (Vram != null) { int x = (addr >> 10) & 7; var chr = chrlo[x] | (chrhi[x] << 8); @@ -164,7 +164,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((chrlo[x] == 4 || chrlo[x] == 5) && !vlock) { bank = chr & 1; - VRAM[(bank << 10) + (addr & 0x3FF)]=value; + Vram[(bank << 10) + (addr & 0x3FF)]=value; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper50.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper50.cs index 11794ba28b..635444dca8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper50.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper50.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper50 : NES.NESBoardBase + public sealed class Mapper50 : NesBoardBase { //http://wiki.nesdev.com/w/index.php/INES_Mapper_050 @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr &= 0x0120; if (addr == 0x0020) @@ -57,30 +57,30 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x2000) { - return ROM[(0x08 * 0x2000) + (addr & 0x1FFF)]; + return Rom[(0x08 * 0x2000) + (addr & 0x1FFF)]; } else if (addr < 0x4000) { - return ROM[(0x09 * 0x2000) + (addr & 0x1FFF)]; + return Rom[(0x09 * 0x2000) + (addr & 0x1FFF)]; } else if (addr < 0x6000) { int bank = (prg_bank & prg_bank_mask_8k); - return ROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Rom[(bank * 0x2000) + (addr & 0x1FFF)]; } else { - return ROM[(0x0B * 0x2000) + (addr & 0x1FFF)]; + return Rom[(0x0B * 0x2000) + (addr & 0x1FFF)]; } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[(0x0F * 0x2000) + (addr & 0x1FFF)]; + return Rom[(0x0F * 0x2000) + (addr & 0x1FFF)]; } private void IRQ_Ready() @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncIRQ(irq_ready); } - public override void ClockCPU() + public override void ClockCpu() { if (irq_enable) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper60.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper60.cs index 18579bca8d..75e5d09f66 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper60.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper60.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper60 : NES.NESBoardBase + public sealed class Mapper60 : NesBoardBase { // http://wiki.nesdev.com/w/index.php/INES_Mapper_060 @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(_reg), ref _reg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = addr; @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(mirr > 0 ? EMirrorType.Vertical : EMirrorType.Horizontal); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((_reg & 0x100) > 0) { @@ -61,28 +61,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (IsPrg16Mode) { int bank = (_reg >> 4) & 7; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } else { int bank = (_reg >> 5) & 3; - return ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((_reg & 7) * 0x2000) + (addr & 0x1FFF)]; + return Vrom[((_reg & 7) * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public class Reset4in1 : NES.NESBoardBase + public class Reset4in1 : NesBoardBase { private int resetSwitch = 0; @@ -110,25 +110,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void NESSoftReset() + public override void NesSoftReset() { resetSwitch = (resetSwitch + 1) & 3; - base.NESSoftReset(); + base.NesSoftReset(); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(resetSwitch << 14) + (addr & 0x3FFF)]; + return Rom[(resetSwitch << 14) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(resetSwitch << 13) + addr]; + return Vrom[(resetSwitch << 13) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper61.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper61.cs index b0f0dafe3b..344aeac5a1 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper61.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper61.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_061 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper61 : NES.NESBoardBase + public sealed class Mapper61 : NesBoardBase { public int prg_page; public bool prg_mode; @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr.Bit(7)) { @@ -48,15 +48,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_page = ((addr & 0x0F) << 1) | ((addr & 0x20) >> 5); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode == false) { - return ROM[(((prg_page >> 1) * 0x8000) + addr) & prg_byte_mask]; + return Rom[(((prg_page >> 1) * 0x8000) + addr) & prg_byte_mask]; } else { - return ROM[((prg_page * 0x4000) + (addr & 0x03FFF)) & prg_byte_mask]; + return Rom[((prg_page * 0x4000) + (addr & 0x03FFF)) & prg_byte_mask]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs index f9ea67b83b..9fa81bcfa9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Mapper62.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; // http://wiki.nesdev.com/w/index.php/INES_Mapper_062 namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper62 : NES.NESBoardBase + public sealed class Mapper62 : NesBoardBase { bool prg_mode = false; int chr_reg; @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_mode = addr.Bit(5); if (addr.Bit(7)) @@ -49,25 +49,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_reg = ((addr & 0x1F) << 2) | (value & 0x03); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (prg_mode == false) { - return ROM[((prg_reg >> 1) * 0x8000) + addr]; + return Rom[((prg_reg >> 1) * 0x8000) + addr]; } else { - return ROM[(prg_reg * 0x4000) + (addr & 0x3FFF)]; + return Rom[(prg_reg * 0x4000) + (addr & 0x3FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(chr_reg * 0x2000) + addr]; + return Vrom[(chr_reg * 0x2000) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NES-EVENT.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NES-EVENT.cs index f3a8b92827..736865b817 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NES-EVENT.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NES-EVENT.cs @@ -6,7 +6,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA mapper 105 - public sealed class NES_EVENT : NES.NESBoardBase + public sealed class NES_EVENT : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -231,23 +231,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //board.NES.LogLine("mapping.. prg_mode={0}, prg_slot{1}, prg={2}", prg_mode, prg_slot, prg); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!wram_disable) { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return wram_disable ? NES.DB : base.ReadWRAM(addr); + return wram_disable ? NES.DB : base.ReadWram(addr); } - public override void NESSoftReset() + public override void NesSoftReset() { InitValues(); - base.NESSoftReset(); + base.NesSoftReset(); } private void InitValues() @@ -261,22 +261,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Sync(); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { scnt.Write(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override void ClockCPU() + public override void ClockCpu() { if (irq_enable) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs index 17a50c06fc..e1b62e7ed5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NROM.cs @@ -1,7 +1,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { [NES.INESBoardImplPriority] - public sealed class NROM : NES.NESBoardBase + public sealed class NROM : NesBoardBase { //configuration int prg_byte_mask; @@ -85,10 +85,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr &= prg_byte_mask; - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs index 631aef7402..a7a852685d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs @@ -18,7 +18,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { [NES.INESBoardImplCancel] - public sealed class NSFBoard : NES.NESBoardBase + public sealed class NSFBoard : NesBoardBase { //------------------------------ //configuration @@ -130,12 +130,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Patch_Vectors = true; } - public override void NESSoftReset() + public override void NesSoftReset() { ReplayInit(); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr) { @@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //important to NSF standard for ram to be cleared, otherwise replayers are confused on account of not initializing memory themselves var ram = NES.ram; - var wram = this.WRAM; + var wram = this.Wram; int wram_size = wram.Length; for (int i = 0; i < 0x800; i++) ram[i] = 0; @@ -210,7 +210,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //store specified initial bank state if (BankSwitched) for (int i = 0; i < 8; i++) - WriteEXP(0x5FF8 + i - 0x4000, InitBankSwitches[i]); + WriteExp(0x5FF8 + i - 0x4000, InitBankSwitches[i]); return (byte)(CurrentSong - 1); } @@ -291,7 +291,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES 0x90,0xFE, }; - public override void AtVsyncNMI() + public override void AtVsyncNmi() { if(Patch_Vectors) NES.cpu.NMI = true; @@ -349,12 +349,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { return 0; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { //patch in vector reading if (Patch_Vectors) @@ -377,7 +377,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //rom data began at 0x80 of the NSF file addr += 0x80; - return ROM[addr]; + return Rom[addr]; } else { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot129_163.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot129_163.cs index 8d6b99a488..82a8de7a71 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot129_163.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot129_163.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // what we have here should work for everything that's actually a 129 or 163, // and some of the 175/340 (mapper 210) [NES.INESBoardImplPriority] - public sealed class Namcot129_163 : NES.NESBoardBase + public sealed class Namcot129_163 : NesBoardBase { //configuration int prg_bank_mask_8k; @@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { addr &= 0xF800; switch (addr) @@ -103,10 +103,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x1800: return (byte)((irq_counter >> 8) | (irq_enabled ? 0x8000 : 0)); } - return base.ReadEXP(addr); + return base.ReadExp(addr); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr &= 0xF800; switch (addr) @@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr &= 0xF800; switch (addr) @@ -168,17 +168,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { int bank_1k = addr >> 10; if (bank_1k >= 12) @@ -197,7 +197,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // mapped to VROM; nothing to do } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { int bank_1k = addr >> 10; if (bank_1k >= 12) @@ -214,13 +214,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { bank_1k &= chr_bank_mask_1k; - return VROM[bank_1k << 10 | ofs]; + return Vrom[bank_1k << 10 | ofs]; } } void SyncIRQ() { - IRQSignal = (irq_pending && irq_enabled); + IrqSignal = (irq_pending && irq_enabled); } void TriggerIRQ() @@ -241,7 +241,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else irq_counter++; } - public override void ClockCPU() + public override void ClockCpu() { if (irq_enabled) { @@ -264,8 +264,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (Cart.wram_battery) { - if (WRAM != null) - return WRAM; + if (Wram != null) + return Wram; else return audio.GetSaveRam(); } @@ -276,7 +276,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { // top 4 bits must be in this arrangement to write at all if ((prgram_write & 0xf0) == 0x40) @@ -284,7 +284,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // then the bit corresponding to the 2K subsection must be 0 if (!prgram_write.Bit(addr >> 11)) { - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs index 677a8ec5a9..b15cc1016e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot175_340.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { [NES.INESBoardImplPriority] - public class Namcot175_340 : NES.NESBoardBase + public class Namcot175_340 : NesBoardBase { /* * Namcot 175 and 340. Simpler versions of the 129/163. Differences: @@ -78,7 +78,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(wramenable), ref wramenable); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0x7800) { @@ -115,32 +115,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr & 0x3ff | chr[addr >> 10] << 10]; + return Vrom[addr & 0x3ff | chr[addr >> 10] << 10]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr & 0x1fff | prg[addr >> 13] << 13]; + return Rom[addr & 0x1fff | prg[addr >> 13] << 13]; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (wramenable) - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (wramenable) - return base.ReadWRAM(addr); + return base.ReadWram(addr); else return NES.DB; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/DRROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/DRROM.cs index e917a5dd69..27e76b074c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/DRROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/DRROM.cs @@ -27,21 +27,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //but it probably doesnt matter in practice. //still, purists could validate it. - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { //read patterns from mapper controlled area - return base.ReadPPU(addr); + return base.ReadPpu(addr); } else if (addr < 0x2800) { - return VRAM[addr - 0x2000]; + return Vram[addr - 0x2000]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -49,9 +49,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (addr < 0x2800) { - VRAM[addr - 0x2000] = value; + Vram[addr - 0x2000] = value; } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper076.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper076.cs index 91aa4b66ae..8ce4421221 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper076.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper076.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // aka NAMCOT-3446 // just a mapper206 with a few lines changed; // but easiest described in code with a separate, independent class - public sealed class Mapper076 : NES.NESBoardBase + public sealed class Mapper076 : NesBoardBase { // config int chr_bank_mask_2k; @@ -38,7 +38,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 1) { @@ -60,16 +60,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr & 0x1fff | prg[addr >> 13] << 13]; + return Rom[addr & 0x1fff | prg[addr >> 13] << 13]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr & 0x7ff | chr[addr >> 11] << 11]; - return base.ReadPPU(addr); + return Vrom[addr & 0x7ff | chr[addr >> 11] << 11]; + return base.ReadPpu(addr); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs index 953494cb83..92694e8eb7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs @@ -51,15 +51,15 @@ return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000) return VROM[RewireCHR(addr)]; - else return base.ReadPPU(addr); + if (addr < 0x2000) return Vrom[RewireCHR(addr)]; + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs index a6f70b76b7..30c26714a0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper095.cs @@ -36,15 +36,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } //mapper 095's chief unique contribution is to add this nametable rewiring logic: CHR A15 directly controls CIRAM A10 - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000) return base.ReadPPU(addr); - else return base.ReadPPU(RewireNametable(addr, 5)); + if (addr < 0x2000) return base.ReadPpu(addr); + else return base.ReadPpu(RewireNametable(addr, 5)); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { - if (addr < 0x2000) base.WritePPU(addr, value); - else base.WritePPU(RewireNametable(addr, 5), value); + if (addr < 0x2000) base.WritePpu(addr, value); + else base.WritePpu(RewireNametable(addr, 5), value); } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs index 5085f21203..1472654b1d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper112.cs @@ -3,7 +3,7 @@ using System; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper112 : NES.NESBoardBase + public sealed class Mapper112 : NesBoardBase { //configuration int prg_bank_mask_8k, chr_bank_mask_1k, chr_outer_reg; @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Sync(); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0x6001) @@ -125,23 +125,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000) return VROM[RewireCHR(addr)]; - else return base.ReadPPU(addr); + if (addr < 0x2000) return Vrom[RewireCHR(addr)]; + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= prg_bank_mask_8k; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper154.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper154.cs index ed317e3c88..2389c239ce 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper154.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper154.cs @@ -40,18 +40,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000) return VROM[RewireCHR(addr)]; - else return base.ReadPPU(addr); + if (addr < 0x2000) return Vrom[RewireCHR(addr)]; + else return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (value.Bit(6)) { @@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.OneScreenA); } - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs index 21cec1092b..8349a436de 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Namcot1xx/Namcot1xx.cs @@ -20,8 +20,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES byte[] chr_regs_1k = new byte[8]; byte[] prg_regs_8k = new byte[4]; - NES.NESBoardBase board; - public Namcot108Chip(NES.NESBoardBase board) + NesBoardBase board; + public Namcot108Chip(NesBoardBase board) { this.board = board; @@ -87,7 +87,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public abstract class Namcot108Board_Base : NES.NESBoardBase + public abstract class Namcot108Board_Base : NesBoardBase { //state protected Namcot108Chip mapper; @@ -131,18 +131,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = MapCHR(addr); - if (VROM != null) + if (Vrom != null) { addr &= chr_byte_mask; - return VROM[addr]; + return Vrom[addr]; } - return VRAM[addr]; + return Vram[addr]; } if (NES._isVS) @@ -156,16 +156,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return CIRAM_VS[addr - 0x800]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - if (VRAM == null) return; + if (Vram == null) return; addr = MapCHR(addr); - VRAM[addr] = value; + Vram[addr] = value; } else if (NES._isVS) { @@ -184,20 +184,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { mapper.WritePRG(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = Get_PRGBank_8K(addr); bank_8k &= prg_mask; addr = (bank_8k << 13) | (addr & 0x1FFF); - return ROM[addr]; + return Rom[addr]; } // there are 3 namco games which each use their own ICs for security in different ways @@ -205,10 +205,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // 16 = Super Xevious // 32 = TKO Boxing // 48 = RBI Baseball - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (!NES._isVS) - return base.ReadEXP(addr); + return base.ReadExp(addr); if (Cart.vs_security == 16) { @@ -239,7 +239,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else - return base.ReadEXP(addr - 0x4000); + return base.ReadExp(addr - 0x4000); } else if (Cart.vs_security==32) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs index 7229ee1ffe..e8380191d1 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NanJing.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/INES_Mapper_163 - public sealed class NanJing : NES.NESBoardBase + public sealed class NanJing : NesBoardBase { /* * China Pirate Stuff. Not very tested. @@ -44,9 +44,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(prg << 15) | addr]; + return Rom[(prg << 15) | addr]; } /* @@ -54,7 +54,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { }*/ - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr >= 0x1000) { @@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return 0; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x1101) { @@ -118,40 +118,40 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.WriteWRAM(addr, value); }*/ - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { if ((reg1 & 0x80) != 0) { if (NES.ppu.ppur.status.sl <= 128) - return VRAM[addr & 0xfff]; + return Vram[addr & 0xfff]; else - return VRAM[(addr & 0xfff) + 0x1000]; + return Vram[(addr & 0xfff) + 0x1000]; } else - return VRAM[addr]; + return Vram[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { if ((reg1 & 0x80) != 0 && NES.ppu.ppur.status.rendering) { if (NES.ppu.ppur.status.sl <= 128) - VRAM[addr & 0xfff] = value; + Vram[addr & 0xfff] = value; else - VRAM[(addr & 0xfff) + 0x1000] = value; + Vram[(addr & 0xfff) + 0x1000] = value; } else - VRAM[addr] = value; + Vram[addr] = value; } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs new file mode 100644 index 0000000000..5f3f80e7d7 --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NesBoardBase.cs @@ -0,0 +1,297 @@ +using System; +using System.Collections.Generic; +using BizHawk.Common; + +namespace BizHawk.Emulation.Cores.Nintendo.NES +{ + [NES.INESBoardImpl] + public abstract class NesBoardBase : INesBoard + { + /// + /// These are used by SetMirroring() to provide the base class nametable mirroring service. + /// Apparently, these are not used for internal build configuration logic + /// + public enum EMirrorType + { + Vertical, Horizontal, + OneScreenA, OneScreenB + } + + public virtual void Create(NES nes) + { + NES = nes; + } + + public virtual void NesSoftReset() + { + } + + public Dictionary InitialRegisterValues { get; set; } + + public abstract bool Configure(NES.EDetectionOrigin origin); + public virtual void ClockPpu() { } + public virtual void ClockCpu() { } + public virtual void AtVsyncNmi() { } + + public NES.CartInfo Cart => NES.cart; + public NES NES { get; set; } + + //this is set to true when SyncState is called, so that we know the base class SyncState was used + public bool SyncStateFlag; + + public virtual void SyncState(Serializer ser) + { + ser.Sync(nameof(_vram), ref _vram, true); + ser.Sync(nameof(_wram), ref _wram, true); + for (int i = 0; i < 4; i++) ser.Sync("mirroring" + i, ref _mirroring[i]); + ser.Sync(nameof(_irqSignal), ref _irqSignal); + SyncStateFlag = true; + } + + public virtual void SyncIRQ(bool flag) + { + IrqSignal = flag; + } + + private bool _irqSignal; + public bool IrqSignal + { + get => _irqSignal; + set => _irqSignal = value; + } + + private readonly int[] _mirroring = new int[4]; + protected void SetMirroring(int a, int b, int c, int d) + { + _mirroring[0] = a; + _mirroring[1] = b; + _mirroring[2] = c; + _mirroring[3] = d; + } + + protected void ApplyMemoryMapMask(int mask, byte[] map) + { + byte byteMask = (byte)mask; + for (int i = 0; i < map.Length; i++) + { + map[i] &= byteMask; + } + } + + // make sure you have bank-masked the map + protected int ApplyMemoryMap(int blockSizeBits, byte[] map, int addr) + { + int bank = addr >> blockSizeBits; + int ofs = addr & ((1 << blockSizeBits) - 1); + bank = map[bank]; + addr = (bank << blockSizeBits) | ofs; + return addr; + } + + public static EMirrorType CalculateMirrorType(int pad_h, int pad_v) + { + if (pad_h == 0) + { + return pad_v == 0 + ? EMirrorType.OneScreenA + : EMirrorType.Horizontal; + } + + if (pad_v == 0) + { + return EMirrorType.Vertical; + } + + return EMirrorType.OneScreenB; + } + + protected void SetMirrorType(int pad_h, int pad_v) + { + SetMirrorType(CalculateMirrorType(pad_h, pad_v)); + } + + public void SetMirrorType(EMirrorType mirrorType) + { + switch (mirrorType) + { + case EMirrorType.Horizontal: SetMirroring(0, 0, 1, 1); break; + case EMirrorType.Vertical: SetMirroring(0, 1, 0, 1); break; + case EMirrorType.OneScreenA: SetMirroring(0, 0, 0, 0); break; + case EMirrorType.OneScreenB: SetMirroring(1, 1, 1, 1); break; + default: SetMirroring(-1, -1, -1, -1); break; //crash! + } + } + + protected int ApplyMirroring(int addr) + { + int block = (addr >> 10) & 3; + block = _mirroring[block]; + int ofs = addr & 0x3FF; + return (block << 10) | ofs; + } + + protected byte HandleNormalPRGConflict(int addr, byte value) + { + value &= ReadPrg(addr); + + //Debug.Assert(old_value == value, "Found a test case of bus conflict. please report."); + //report: pinball quest (J). also: double dare + return value; + } + + public virtual byte ReadPrg(int addr) => Rom[addr]; + + public virtual void WritePrg(int addr, byte value) + { + } + + public virtual void WriteWram(int addr, byte value) + { + if (_wram != null) + { + _wram[addr & _wramMask] = value; + } + } + + private int _wramMask; + public virtual void PostConfigure() + { + _wramMask = (Cart.wram_size * 1024) - 1; + } + + public virtual byte ReadWram(int addr) + { + return _wram?[addr & _wramMask] ?? NES.DB; + } + + public virtual void WriteExp(int addr, byte value) + { + } + + public virtual byte ReadExp(int addr) + { + return NES.DB; + } + + public virtual byte ReadReg2xxx(int addr) + { + return NES.ppu.ReadReg(addr & 7); + } + + public virtual byte PeekReg2xxx(int addr) + { + return NES.ppu.PeekReg(addr & 7); + } + + public virtual void WriteReg2xxx(int addr, byte value) + { + NES.ppu.WriteReg(addr, value); + } + + public virtual void WritePpu(int addr, byte value) + { + if (addr < 0x2000) + { + if (Vram != null) + { + Vram[addr] = value; + } + } + else + { + NES.CIRAM[ApplyMirroring(addr)] = value; + } + } + + public virtual void AddressPpu(int addr) + { + } + + public virtual byte PeekPPU(int addr) => ReadPpu(addr); + + protected virtual byte ReadPPUChr(int addr) + { + return Vrom?[addr] ?? Vram[addr]; + } + + public virtual byte ReadPpu(int addr) + { + if (addr < 0x2000) + { + return Vrom?[addr] ?? Vram[addr]; + } + + return NES.CIRAM[ApplyMirroring(addr)]; + } + + /// + /// derived classes should override this if they have peek-unsafe logic + /// + public virtual byte PeekCart(int addr) + { + byte ret; + if (addr >= 0x8000) + { + ret = ReadPrg(addr - 0x8000); // easy optimization, since rom reads are so common, move this up (reordering the rest of these else ifs is not easy) + } + else if (addr < 0x6000) + { + ret = ReadExp(addr - 0x4000); + } + else + { + ret = ReadWram(addr - 0x6000); + } + + return ret; + } + + public virtual byte[] SaveRam => Cart.wram_battery ? Wram : null; + + public byte[] Wram + { + get => _wram; + set => _wram = value; + } + public byte[] Vram + { + get => _vram; + set => _vram = value; + } + public byte[] Rom { get; set; } + public byte[] Vrom { get; set; } + + private byte[] _wram, _vram; + + protected void Assert(bool test, string comment, params object[] args) + { + if (!test) throw new Exception(string.Format(comment, args)); + } + + protected void Assert(bool test) + { + if (!test) throw new Exception("assertion failed in board setup!"); + } + + protected void AssertPrg(params int[] prg) => AssertMemType(Cart.prg_size, "prg", prg); + protected void AssertChr(params int[] chr) => AssertMemType(Cart.chr_size, "chr", chr); + protected void AssertWram(params int[] wram) => AssertMemType(Cart.wram_size, "wram", wram); + protected void AssertVram(params int[] vram) => AssertMemType(Cart.vram_size, "vram", vram); + + protected void AssertMemType(int value, string name, int[] valid) + { + // only disable vram and wram asserts, as UNIF knows its prg and chr sizes + if (DisableConfigAsserts && (name == "wram" || name == "vram")) return; + foreach (int i in valid) if (value == i) return; + Assert(false, "unhandled {0} size of {1}", name,value); + } + + protected void AssertBattery(bool hasBattery) => Assert(Cart.wram_battery == hasBattery); + + public virtual void ApplyCustomAudio(short[] samples) + { + } + + public bool DisableConfigAsserts { get; set; } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NovelDiamond.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NovelDiamond.cs index 5f495f9284..7d44a0787d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NovelDiamond.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NovelDiamond.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class NovelDiamond : NES.NESBoardBase + public sealed class NovelDiamond : NesBoardBase { int prg; int chr; @@ -23,20 +23,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr | chr << 13]; + return Vrom[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg = addr & 3; chr = addr & 7; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs index be38b262e8..85d0742081 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/PxROM_FxROM.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA MMC2 Mike Tyson's Punch-Out!! //AKA MMC4 (similar enough to combine in one fle) - public sealed class PxROM_FxROM : NES.NESBoardBase + public sealed class PxROM_FxROM : NesBoardBase { //configuration int prg_bank_mask_8k, chr_bank_mask_4k; @@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr & 0xF000) { @@ -121,13 +121,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int ofs = addr & ((1 << 12) - 1); int bank_4k = chr_banks_4k[reg]; addr = (bank_4k << 12) | ofs; - return VROM[addr]; + return Vrom[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { int side = addr>>12; int tile = (addr>>4)&0xFF; @@ -146,18 +146,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0xFD: chr_latches[side] = 0; break; case 0xFE: chr_latches[side] = 1; break; } - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs index 9deec3db7e..7ca80e5fe4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sachen8259.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // describes Sachen8259A/B/C. D is in a different class // behavior from fceumm - public class Sachen8259ABC : NES.NESBoardBase + public class Sachen8259ABC : NesBoardBase { // config int prg_bank_mask_32k; @@ -60,11 +60,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { Write(addr, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { Write(addr, value); } @@ -121,17 +121,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = prg & prg_bank_mask_32k; - return ROM[addr | bank << 15]; + return Rom[addr | bank << 15]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - if(VROM == null) - return base.ReadPPU(addr); + if(Vrom == null) + return base.ReadPpu(addr); int idx = addr >> 11; // in addition to fixing V-mirroring, simple fixes us to 1 bank @@ -142,11 +142,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank <<= shiftout; bank |= idx & shiftmask; bank &= chr_bank_mask_2k; - return VROM[addr & 0x7ff | bank << 11]; + return Vrom[addr & 0x7ff | bank << 11]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } @@ -173,7 +173,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // i think there's something wrong with the mapper implementation; but the game // sucks so hard, it's hard to tell - public class Sachen8259D : NES.NESBoardBase + public class Sachen8259D : NesBoardBase { // config int prg_bank_mask_32k; @@ -211,11 +211,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { Write(addr, value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { Write(addr, value); } @@ -278,21 +278,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = prg & prg_bank_mask_32k; - return ROM[addr | bank << 15]; + return Rom[addr | bank << 15]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = chr[addr >> 10] & chr_bank_mask_1k; - return VROM[addr & 0x3ff | bank << 10]; + return Vrom[addr & 0x3ff | bank << 10]; } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SachenSimple.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SachenSimple.cs index fc1707b727..ad475b678d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SachenSimple.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SachenSimple.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // 32K prgrom blocks and 8k chrrom blocks // behavior gleamed from FCEUX // "Qi Wang - Chinese Chess (MGC-001) (Ch) [!]" and "Twin Eagle (Sachen) [!]" seem to have problems; the latter needs PAL - public sealed class SachenSimple : NES.NESBoardBase + public sealed class SachenSimple : NesBoardBase { Action ExpWrite = null; Action PrgWrite = null; @@ -81,27 +81,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr = value & 3 & chr_mask; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (ExpWrite != null && (addr & 0x100) != 0) ExpWrite(value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { PrgWrite?.Invoke(value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(addr & prg_addr_mask) + (prg << 15)]; + return Rom[(addr & prg_addr_mask) + (prg << 15)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr + (chr << 13)]; + return Vrom[addr + (chr << 13)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Subor.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Subor.cs index 3c1d69dd01..dd15115ba4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Subor.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Subor.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Subor : NES.NESBoardBase + public sealed class Subor : NesBoardBase { private byte[] regs = new byte[4]; private bool is167; @@ -30,12 +30,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(is167), ref is167); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { regs[(addr >> 13) & 0x03] = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int basea, bank; basea = ((regs[0] ^ regs[1]) & 0x10) << 1; @@ -48,22 +48,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x4000) { - return ROM[((basea + bank + 1) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((basea + bank + 1) * 0x4000) + (addr & 0x3FFF)]; } else { - return ROM[((basea + bank + 0) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((basea + bank + 0) * 0x4000) + (addr & 0x3FFF)]; } } else { if (addr < 0x4000) { - return ROM[((basea + bank + 0) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((basea + bank + 0) * 0x4000) + (addr & 0x3FFF)]; } else { - return ROM[((basea + bank + 1) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((basea + bank + 1) * 0x4000) + (addr & 0x3FFF)]; } } } @@ -73,28 +73,28 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x4000) { - return ROM[(0x1F * 0x4000) + (addr & 0x3FFF)]; + return Rom[(0x1F * 0x4000) + (addr & 0x3FFF)]; } else { - return ROM[((basea + bank) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((basea + bank) * 0x4000) + (addr & 0x3FFF)]; } } else { if (addr < 0x4000) { - return ROM[((basea + bank) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((basea + bank) * 0x4000) + (addr & 0x3FFF)]; } else { if (is167) { - return ROM[(0x20 * 0x4000) + (addr & 0x3FFF)]; + return Rom[(0x20 * 0x4000) + (addr & 0x3FFF)]; } else { - return ROM[(0x07 * 0x4000) + (addr & 0x3FFF)]; + return Rom[(0x07 * 0x4000) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1.cs index 4b10191bb0..491f5f94de 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //AKA mapper 184 //Sunsoft-1 chips, EXCEPT for fantasy zone. //this is confusing. see docs/sunsoft.txt - public sealed class Sunsoft1 : NES.NESBoardBase + public sealed class Sunsoft1 : NesBoardBase { int chr_mask; int left_piece = 0; @@ -34,22 +34,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x1000) { - return VROM[(addr & 0xFFF) + (left_piece * 0x1000)]; + return Vrom[(addr & 0xFFF) + (left_piece * 0x1000)]; } else if (addr < 0x2000) { - return VROM[(addr & 0xFFF) + (right_piece * 0x1000)]; + return Vrom[(addr & 0xFFF) + (right_piece * 0x1000)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { left_piece = value & 7 & chr_mask; // the bank at ppu $1000 has only 2 selection bits. the high bit is frozen to 1 diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs index 3051ec27d8..36648b69ba 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft1_Alt.cs @@ -11,7 +11,7 @@ * In any event, here is how it's actually emulated. */ - public sealed class Sunsoft1_Alt : NES.NESBoardBase + public sealed class Sunsoft1_Alt : NesBoardBase { int prg; @@ -25,17 +25,17 @@ return true; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { prg = value & 7; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr >= 0x4000) - return ROM[addr & 0x3fff | 7 << 14]; + return Rom[addr & 0x3fff | 7 << 14]; else - return ROM[addr & 0x3fff | prg << 14]; + return Rom[addr & 0x3fff | prg << 14]; } public override void SyncState(BizHawk.Common.Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m89.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m89.cs index f49247c724..fe1500be38 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m89.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m89.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //AKA Sunsoft-2 chip (SUNSOFT-3 pcb) //game=Tenka no Goikenban: Mito Koumon ; chip=sunsoft-2 ; pcb = SUNSOFT-3 //this is confusing. see docs/sunsoft.txt - public sealed class Mapper89 : NES.NESBoardBase + public sealed class Mapper89 : NesBoardBase { int chr; int prg_bank_mask_16k; @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[0] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_16k = (byte)((value >> 4) & 7); SyncPRG(); @@ -59,22 +59,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr = ((value & 0x07) + ((value >> 7) * 0x08)); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x1FFF) + (chr * 0x2000)]; + return Vrom[(addr & 0x1FFF) + (chr * 0x2000)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m93.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m93.cs index 9cb70231fd..176772aa0a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m93.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft2_m93.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //game=shanghai ; chip=sunsoft-2 ; pcb=SUNSOFT-3R //this is confusing. see docs/sunsoft.txt - public sealed class Sunsoft2_Mapper93 : NES.NESBoardBase + public sealed class Sunsoft2_Mapper93 : NesBoardBase { int prg_bank_mask_16k; byte prg_bank_16k; @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[0] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg_bank_16k = (byte)((value >> 4) & 15); SyncPRG(); @@ -53,14 +53,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // there is no mirroring control on this board; only a hardwired H\V } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs index b452e14c53..04bddebf06 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft3.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA mapper 67 //this may be confusing due to general chaos with the early sunsoft mappers. see docs/sunsoft.txt - public sealed class Sunsoft3 : NES.NESBoardBase + public sealed class Sunsoft3 : NesBoardBase { //configuration int prg_bank_mask_16k, chr_bank_mask_2k; @@ -87,10 +87,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = irq_asserted; + IrqSignal = irq_asserted; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("{0:X4} = {1:X2}", addr, value); switch (addr & 0xF800) @@ -122,10 +122,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x6800: //0xE800: switch (value & 3) { - case 0: SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); break; - case 1: SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal); break; - case 2: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); break; - case 3: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenB); break; + case 0: SetMirrorType(NesBoardBase.EMirrorType.Vertical); break; + case 1: SetMirrorType(NesBoardBase.EMirrorType.Horizontal); break; + case 2: SetMirrorType(NesBoardBase.EMirrorType.OneScreenA); break; + case 3: SetMirrorType(NesBoardBase.EMirrorType.OneScreenB); break; } break; case 0x7800: //0xF800: @@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void ClockCPU() + public override void ClockCpu() { if (!irq_enable) return; if (irq_counter == 0) @@ -150,13 +150,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else irq_counter--; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr = ApplyMemoryMap(14, prg_banks_16k, addr); - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -178,19 +178,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (NES._isVS) { if (addr < 0x2000) { addr = ApplyMemoryMap(11, chr_banks_2k, addr); - if (VRAM != null) - VRAM[addr] = value; + if (Vram != null) + Vram[addr] = value; } else { @@ -206,7 +206,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } /* diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs index 50cc60df65..5f3e8964f8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Sunsoft4.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //After Burner & After Burner 2 //Maharaja - public sealed class Sunsoft4 : NES.NESBoardBase + public sealed class Sunsoft4 : NesBoardBase { //configuration int prg_bank_mask, chr_bank_mask, nt_bank_mask; @@ -62,17 +62,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_regs_16k[bank_16k]; bank_16k &= prg_bank_mask; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_2k = chr_regs_2k[bank_2k]; bank_2k &= chr_bank_mask; addr = (bank_2k << 11) | ofs; - return VROM[addr]; + return Vrom[addr]; } else { @@ -96,13 +96,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k = nt_regs[bank_1k] + 0x80; bank_1k &= nt_bank_mask; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("W{0:x4} {1:x2}", addr + 0x8000, value); switch (addr & 0xF000) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs index 1545dfc299..cb79a81aa0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/SxROM.cs @@ -70,13 +70,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public int chr_mode; public int prg_mode; public int prg_slot; // complicated - public NES.NESBoardBase.EMirrorType mirror; - static readonly NES.NESBoardBase.EMirrorType[] _mirrorTypes = + public NesBoardBase.EMirrorType mirror; + static readonly NesBoardBase.EMirrorType[] _mirrorTypes = { - NES.NESBoardBase.EMirrorType.OneScreenA, - NES.NESBoardBase.EMirrorType.OneScreenB, - NES.NESBoardBase.EMirrorType.Vertical, - NES.NESBoardBase.EMirrorType.Horizontal + NesBoardBase.EMirrorType.OneScreenA, + NesBoardBase.EMirrorType.OneScreenB, + NesBoardBase.EMirrorType.Vertical, + NesBoardBase.EMirrorType.Horizontal }; //register 1,2: @@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_slot = 1; chr_mode = 1; scnt.Reset(); - mirror = NES.NESBoardBase.EMirrorType.Horizontal; + mirror = NesBoardBase.EMirrorType.Horizontal; SyncCHR(); SyncPRG(); } @@ -236,7 +236,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } [NES.INESBoardImplPriority] - public class SxROM : NES.NESBoardBase + public class SxROM : NesBoardBase { //configuration protected int prg_mask, chr_mask; @@ -258,13 +258,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /// number of cycles since last WritePRG() uint ppuclock; - public override void ClockPPU() + public override void ClockPpu() { if (ppuclock < pputimeout) ppuclock++; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { // mmc1 ignores subsequent writes that are very close together if (ppuclock >= pputimeout) @@ -276,26 +276,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (_is_snrom) { if (!mmc1.wram_disable && chr_wram_enable) - return base.ReadWRAM(addr); + return base.ReadWram(addr); else return NES.DB; } else { - return base.ReadWRAM(addr); + return base.ReadWram(addr); } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = mmc1.Get_PRGBank(addr) & prg_mask; addr = (bank << 14) | (addr & 0x3FFF); - return ROM[addr]; + return Rom[addr]; } int Gen_CHR_Address(int addr) @@ -305,7 +305,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -321,8 +321,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES addr = Gen_CHR_Address(addr); if (Cart.vram_size != 0) - return VRAM[addr & vram_mask]; - else return VROM[addr]; + return Vram[addr & vram_mask]; + else return Vrom[addr]; } else { @@ -339,19 +339,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (NES._isVS) { if (addr < 0x2000) { - if (VRAM != null) - VRAM[Gen_CHR_Address(addr) & vram_mask] = value; + if (Vram != null) + Vram[Gen_CHR_Address(addr) & vram_mask] = value; } else { @@ -378,9 +378,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } if (Cart.vram_size != 0) - VRAM[Gen_CHR_Address(addr) & vram_mask] = value; + Vram[Gen_CHR_Address(addr) & vram_mask] = value; } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } public override void SyncState(Serializer ser) @@ -569,14 +569,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (wram_bank_8k << 13) | ofs; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { - base.WriteWRAM(Map_WRAM(addr), value); + base.WriteWram(Map_WRAM(addr), value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return base.ReadWRAM(Map_WRAM(addr)); + return base.ReadWram(Map_WRAM(addr)); } } @@ -609,14 +609,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (wram_bank_8k << 13) | ofs; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { - base.WriteWRAM(Map_WRAM(addr), value); + base.WriteWram(Map_WRAM(addr), value); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return base.ReadWRAM(Map_WRAM(addr)); + return base.ReadWram(Map_WRAM(addr)); } } @@ -650,7 +650,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = mmc1.Get_PRGBank(addr); int chr_bank = mmc1.Get_CHRBank_4K(0); @@ -658,7 +658,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank |= (bank_bit18 << 4); bank &= prg_mask; addr = (bank << 14) | (addr & 0x3FFF); - return ROM[addr]; + return Rom[addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TAITO_74_161_161_32.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TAITO_74_161_161_32.cs index 8ca4085676..5aee0c972d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TAITO_74_161_161_32.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TAITO_74_161_161_32.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //Arkanoid 2 (J) //Gegege no Kitarou 2 - public sealed class TAITO_74_161_161_32 : NES.NESBoardBase + public sealed class TAITO_74_161_161_32 : NesBoardBase { int chr; int prg_bank_mask_16k; @@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES prg_banks_16k[0] = prg_bank_16k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { chr = (byte)(value & 15); prg_bank_16k = (byte)((value >> 4) & 7); @@ -57,22 +57,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.OneScreenA); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; bank_16k &= prg_bank_mask_16k; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[(addr & 0x1FFF) + (chr * 0x2000)]; + return Vrom[(addr & 0x1FFF) + (chr * 0x2000)]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs index 2b0aaf7298..bdac0b16ed 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN-800032.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA mapper 64 - public sealed class TENGEN_800032 : NES.NESBoardBase + public sealed class TENGEN_800032 : NesBoardBase { //configuration int prg_bank_mask_8k; @@ -135,7 +135,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("mapping {0:X4} = {1:X2}", addr, value); addr &= 0xE001; @@ -182,17 +182,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -200,15 +200,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int ofs = addr & ((1 << 10) - 1); bank_1k = chr_banks_1k[bank_1k]; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } void SyncIRQ() { - IRQSignal = irq_pending; + IrqSignal = irq_pending; } void ClockIRQ() @@ -269,7 +269,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES */ } - public override void ClockCPU() + public override void ClockCpu() { if (irq_mode == true) @@ -292,7 +292,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void ClockPPU() + public override void ClockPpu() { if (separator_counter > 0) separator_counter--; @@ -308,7 +308,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { int a12 = (addr >> 12) & 1; bool rising_edge = (a12 == 1 && a12_old == 0); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN_800008.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN_800008.cs index 0c9023ec8d..5422427659 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN_800008.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/TENGEN_800008.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // tetris (unl) // behaves identically to CNROM for the one board it is on, but supports more (64K prg, 64K chr) // http://kevtris.org/mappers/tengen/800008.html - public sealed class TENGEN_800008 : NES.NESBoardBase + public sealed class TENGEN_800008 : NesBoardBase { int prg_mask; int chr_mask; @@ -32,23 +32,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { value = HandleNormalPRGConflict(addr, value); prg = value >> 3 & prg_mask; chr = value & chr_mask; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr | prg << 15]; + return Rom[addr | prg << 15]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) - return VROM[addr | chr << 13]; + return Vrom[addr | chr << 13]; else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs index e82bb3042b..813568ce11 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_TC0190FMC.cs @@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //also mapper 048 (same as 33 but with an extra chip) - public sealed class TAITO_TC0190FMC : NES.NESBoardBase + public sealed class TAITO_TC0190FMC : NesBoardBase { //configuration int prg_bank_mask, chr_bank_mask; @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES class MMC3Variant : MMC3 { - public MMC3Variant(NES.NESBoardBase board) + public MMC3Variant(NesBoardBase board) : base(board,0) { } @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (!irq_pending) { delay = 0; - board.IRQSignal = false; + board.IrqSignal = false; } pending = irq_pending; } @@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES delay--; if(delay==0 && irq_pending) - board.IRQSignal = true; + board.IrqSignal = true; } } @@ -126,7 +126,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(mirror_mode == 0 ? EMirrorType.Vertical : EMirrorType.Horizontal); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (pal16) addr &= 0xE003; @@ -194,7 +194,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -203,29 +203,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k = chr_regs_1k[bank_1k]; bank_1k &= chr_bank_mask; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_regs_8k[bank_8k]; bank_8k &= prg_bank_mask; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override void ClockPPU() + public override void ClockPpu() { if(pal16) mmc3.ClockPPU(); } - public override void AddressPPU(int addr) + public override void AddressPpu(int addr) { if (pal16) mmc3.AddressPPU(addr); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs index bc34c2b05e..4ee5ee6536 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_005.cs @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES * */ - public sealed class TAITO_X1_005 : NES.NESBoardBase + public sealed class TAITO_X1_005 : NesBoardBase { // config int prg_bank_mask, chr_bank_mask; @@ -88,18 +88,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override void PostConfigure() { - WRAM = new byte[128]; + Wram = new byte[128]; base.PostConfigure(); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { addr &= 0x1f7f; if (addr >= 0x1f00) { if (wramenable) - WRAM[addr & 0x7f] = value; + Wram[addr & 0x7f] = value; return; } @@ -155,25 +155,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (addr >= 0x1f00 && wramenable) - return WRAM[addr & 0x7f]; + return Wram[addr & 0x7f]; else return NES.DB; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_regs_8k[bank_8k]; bank_8k &= prg_bank_mask; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -182,7 +182,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k = chr_regs_1k[bank_1k]; bank_1k &= chr_bank_mask; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } else if (tlsrewire) { @@ -195,11 +195,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr >= 0x2000) { @@ -214,7 +214,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_017.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_017.cs index 3052110441..8c32b97d00 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_017.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/Taito_X1_017.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://wiki.nesdev.com/w/index.php/INES_Mapper_082 - public sealed class Taito_X1_017 : NES.NESBoardBase + public sealed class Taito_X1_017 : NesBoardBase { private int prg_bank_mask, chr_bank_mask; private byte[] prg_regs_8k = new byte[4]; @@ -45,22 +45,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (addr < 0x1400 && wramenable[addr >> 11]) { - return WRAM[addr]; + return Wram[addr]; } return NES.DB; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr < 0x1400) { if (wramenable[addr >> 11]) - WRAM[addr] = value; + Wram[addr] = value; return; } @@ -112,17 +112,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_regs_8k[bank_8k]; bank_8k &= prg_bank_mask; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -133,10 +133,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_1k = chr_regs_1k[bank_1k]; bank_1k &= chr_bank_mask; addr = (bank_1k << 10) | ofs; - return VROM[addr]; + return Vrom[addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF-DREAMTECH01.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF-DREAMTECH01.cs index 724d140003..a0c20d018e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF-DREAMTECH01.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF-DREAMTECH01.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_DREAMTECH01 : NES.NESBoardBase + public class UNIF_DREAMTECH01 : NesBoardBase { // Korean Igo (Unl) [U][!] private int reg; @@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x1020) { @@ -34,10 +34,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr < 0x4000 ? reg : 8; - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs index 83f6c6c5a4..e1beeef777 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-12-IN-1.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_BMC_12_IN_1 : NES.NESBoardBase + public sealed class UNIF_BMC_12_IN_1 : NesBoardBase { private byte[] regs = new byte[2]; private byte ctrl; @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; switch (addr & 0xE000) @@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(horizontal ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -68,13 +68,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank = regs[1] >> 3 | (basebank << 2); } - return VROM[(bank << 12) + (addr & 0xFFF)]; + return Vrom[(bank << 12) + (addr & 0xFFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { var basebank = (ctrl & 3) << 3; int bank = 0; @@ -103,7 +103,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-190in1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-190in1.cs index c5091bfc3f..a4609a02d8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-190in1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-190in1.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_BMC_190in1 : NES.NESBoardBase + public sealed class UNIF_BMC_190in1 : NesBoardBase { private int _reg; @@ -27,25 +27,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = (addr >> 2) & 7; SetMirrorType(addr.Bit(0) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(_reg * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(_reg * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(_reg * 0x4000) + (addr & 0x3FFF)]; + return Rom[(_reg * 0x4000) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-64in1-NR.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-64in1-NR.cs index d59661d68e..342656a76c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-64in1-NR.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-64in1-NR.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Adapted from FCEUX src - public class UNIF_BMC_64in1_NR : NES.NESBoardBase + public class UNIF_BMC_64in1_NR : NesBoardBase { private byte[] regs = new byte[4]; @@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000 && addr <= 0x1003) { @@ -33,51 +33,51 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType((regs[0] & 0x20) > 0 ? EMirrorType.Horizontal : EMirrorType.Vertical); } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { regs[3] = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((regs[0] & 0x80) > 0) { if ((regs[1] & 0x80) > 0) { - return ROM[((regs[1] & 0x1F) * 0x8000) + (addr & 0x7FFF)]; + return Rom[((regs[1] & 0x1F) * 0x8000) + (addr & 0x7FFF)]; } else { int bank = ((regs[1] & 0x1f) << 1) | ((regs[1] >> 6) & 1); - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } } else { if (addr < 0x4000) { - return ROM[(addr & 0x3FFF)]; + return Rom[(addr & 0x3FFF)]; } else { int bank = ((regs[1] & 0x1f) << 1) | ((regs[1] >> 6) & 1); - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = (regs[2] << 2) | ((regs[0] >> 1) & 3); - return VROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(bank * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-810544-C-A1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-810544-C-A1.cs index 3826ec224c..7f0378fba6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-810544-C-A1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-810544-C-A1.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_BMC_810544_C_A1 : NES.NESBoardBase + public sealed class UNIF_BMC_810544_C_A1 : NesBoardBase { private int latche; private int prg_mask_32k, prg_mask_16k; @@ -30,33 +30,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { latche = addr & 65535; SetMirrorType(addr.Bit(3) ? EMirrorType.Vertical : EMirrorType.Horizontal); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = latche >> 7; if (latche.Bit(6)) { - return ROM[((bank & prg_mask_32k) << 15) + addr]; + return Rom[((bank & prg_mask_32k) << 15) + addr]; } int bank16 = (bank << 1) | ((latche >> 5) & 1); bank16 &= prg_mask_16k; - return ROM[(bank16 << 14) + (addr & 0x3FFF)]; + return Rom[(bank16 << 14) + (addr & 0x3FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((latche & 0x0F) << 13) + addr]; + return Vrom[((latche & 0x0F) << 13) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-8157.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-8157.cs index 7b32ea5c39..99e5ef4971 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-8157.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-8157.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // 4-in-1 1993 (CK-001) [U][!].unf - public class UNIF_BMC_8157 : NES.NESBoardBase + public class UNIF_BMC_8157 : NesBoardBase { [MapperProp] public bool _4in1Mode; @@ -36,14 +36,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("4in1Mode", ref _4in1Mode); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _cmdreg = addr; int mir = ((_cmdreg & 2) >> 1) ^ 1; SetMirrorType(mir == 1 ? EMirrorType.Vertical : EMirrorType.Horizontal); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (_4in1Mode) { @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int lbank = ((_cmdreg & 0x200) > 0) ? 7 : (((_cmdreg & 0x80) > 0) ? bank : 0); int final = basei | (addr < 0x4000 ? bank : lbank); - return ROM[((final & _prgMask16k) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((final & _prgMask16k) * 0x4000) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs index f6423166f4..de40fce0ee 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-A65AS.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_BMC_A65AS : NES.NESBoardBase + public class UNIF_BMC_A65AS : NesBoardBase { private int _prgReg; private bool _isPrg32kMode; @@ -34,7 +34,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("isPrg32kMode", ref _isPrg32kMode); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _isPrg32kMode = value.Bit(6); _prgReg = value; @@ -54,13 +54,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (_isPrg32kMode) { int bank = (_prgReg >> 1) & 0xF; bank &= prgMask32k; - return ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } else { @@ -69,13 +69,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { int bank = (_prgReg & 0x30) >> 1 | _prgReg & 7; bank &= prgMask16k; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } else { int bank = (_prgReg & 0x30) >> 1 | 7; bank &= prgMask16k; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-BS-5.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-BS-5.cs index f64744bba2..375b2a6901 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-BS-5.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-BS-5.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_BMC_BS_5 : NES.NESBoardBase + public class UNIF_BMC_BS_5 : NesBoardBase { [MapperProp] public int BMC_BS_5_DipSwitch; @@ -40,14 +40,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { reg_prg[0] = 0xFF; reg_prg[1] = 0xFF; reg_prg[2] = 0xFF; reg_prg[3] = 0xFF; - base.NESSoftReset(); + base.NesSoftReset(); } public override void SyncState(Serializer ser) @@ -58,7 +58,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(BMC_BS_5_DipSwitch), ref BMC_BS_5_DipSwitch); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { // TODO: clean this up addr += 0x8000; @@ -77,47 +77,47 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x2000) { - return ROM[((reg_prg[0] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((reg_prg[0] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; } else if (addr < 0x4000) { - return ROM[((reg_prg[1] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((reg_prg[1] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; } else if (addr < 0x6000) { - return ROM[((reg_prg[2] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((reg_prg[2] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; } - return ROM[((reg_prg[3] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((reg_prg[3] & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { if (addr < 0x800) { - return VROM[((reg_chr[0] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; + return Vrom[((reg_chr[0] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; } if (addr < 0x1000) { - return VROM[((reg_chr[1] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; + return Vrom[((reg_chr[1] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; } if (addr < 0x1800) { - return VROM[((reg_chr[2] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; + return Vrom[((reg_chr[2] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; } - return VROM[((reg_chr[3] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; + return Vrom[((reg_chr[3] & _chrMask2k) * 0x800) + (addr & 0x7FF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-D1038.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-D1038.cs index 7aa0648186..98a69c6dd9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-D1038.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-D1038.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // 65-in-1 (NT766) [p1][U][!] // 74-in-1 (NT886) [p1][U][!] // 77-in-1 (NT141) [p1][U][!] - public sealed class UNIF_BMC_D1038 : NES.NESBoardBase + public sealed class UNIF_BMC_D1038 : NesBoardBase { [MapperProp] public int D1038_Dipswitch; @@ -40,14 +40,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(D1038_Dipswitch), ref D1038_Dipswitch); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = addr; SetMirrorType(_reg.Bit(3) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((_reg & 0x100) > 0) { @@ -57,16 +57,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (Prg16kMode) { int bank = (_reg >> 4) & 7; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } else { int bank = (_reg >> 5) & 3; - return ROM[(bank * 0x8000) + (addr & 0x7FFF)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if ((_reg & 0x100) > 0) { @@ -76,10 +76,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr < 0x2000) { int bank = _reg & 7; - return VROM[(bank * 0x2000) + (addr & 0x1FFF)]; + return Vrom[(bank * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs index fa420c059c..9a28b6a53f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2004.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Tetris Fily 6-in-1 (GS-2004) (U) [!] - public class UNIF_BMC_GS_2004 : NES.NESBoardBase + public class UNIF_BMC_GS_2004 : NesBoardBase { private int _reg = 0xFF; @@ -31,10 +31,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { _reg = 0xFF; - base.NESSoftReset(); + base.NesSoftReset(); } public override void SyncState(Serializer ser) @@ -44,19 +44,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = value; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[_wramOffset + (addr & 0x1FFF)]; + return Rom[_wramOffset + (addr & 0x1FFF)]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[((_reg & _prgMask32k) * 0x8000) + (addr & 0x7FFF)]; + return Rom[((_reg & _prgMask32k) * 0x8000) + (addr & 0x7FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2013.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2013.cs index d91261b218..7886d85b60 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2013.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-GS-2013.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // Tetris Family 12-in-1 (GS-2013) [U][!] // This cart is 2 ROMs in 1 // Pretty much the UNIF_BMC-GS_2004 board, with more Rom tacked on - public class UNIF_BMC_GS_2013 : NES.NESBoardBase + public class UNIF_BMC_GS_2013 : NesBoardBase { private int _reg = 0xFF; private bool _isRom2 = true; @@ -32,11 +32,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void NESSoftReset() + public override void NesSoftReset() { _reg = 0xFF; _isRom2 = true; - base.NESSoftReset(); + base.NesSoftReset(); } public override void SyncState(Serializer ser) @@ -47,21 +47,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _isRom2 = value.Bit(3); _reg = value; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[_wramPage + (addr & 0x1FFF)]; + return Rom[_wramPage + (addr & 0x1FFF)]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = _reg & (_isRom2 ? _prgMaskRom2 : _prgMaskRom1); - return ROM[(bank * 0x8000) + (addr & 0x7FFF) + (_isRom2 ? _rom2Offset : 0)]; + return Rom[(bank * 0x8000) + (addr & 0x7FFF) + (_isRom2 ? _rom2Offset : 0)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs index 17fc25fa48..bbd2976a7f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-Ghostbusters63in1.cs @@ -5,7 +5,7 @@ using System; namespace BizHawk.Emulation.Cores.Nintendo.NES { // Adapted from FCEUX src - public sealed class UNIF_BMC_Ghostbusters63in1 : NES.NESBoardBase + public sealed class UNIF_BMC_Ghostbusters63in1 : NesBoardBase { private byte[] reg = new byte[2]; private readonly int[] banks = { 0, 0, 524288, 1048576 }; @@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { reg[addr & 1] = value; @@ -51,7 +51,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Console.WriteLine(reg[1]); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { //if (bank == 1) //{ @@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES offset = banks[Ghostbusters63in1_chip_22_select]; int b = (reg[0] & 0x1F); - return ROM[offset + (b << 14) + (addr & 0x3FFF)]; + return Rom[offset + (b << 14) + (addr & 0x3FFF)]; } else { @@ -78,7 +78,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES offset = banks[Ghostbusters63in1_chip_22_select]; int b = ((reg[0] >> 1) & 0x0F); - return ROM[offset + (b << 15) + addr]; + return Rom[offset + (b << 15) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-NTD-03.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-NTD-03.cs index 0463013e8b..74a29b50e7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-NTD-03.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-NTD-03.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_BMC_NTD_03 : NES.NESBoardBase + public sealed class UNIF_BMC_NTD_03 : NesBoardBase { private int latche; @@ -27,36 +27,36 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { latche = addr & 65535; SetMirrorType(addr.Bit(10) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = ((latche & 0x0300) >> 5) | (latche & 7); - return VROM[(bank << 13) + addr]; + return Vrom[(bank << 13) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int prg = ((latche >> 10) & 0x1E); if (latche.Bit(7)) { int bank = prg | ((latche >> 6) & 1); - return ROM[(bank << 14) + (addr & 0x3FFF)]; + return Rom[(bank << 14) + (addr & 0x3FFF)]; } else { int bank = prg >> 1; - return ROM[( bank << 15) + addr]; + return Rom[( bank << 15) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-T-262.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-T-262.cs index 6cc941c379..724bdaa11b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-T-262.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-T-262.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_BMC_T_262 : NES.NESBoardBase + public class UNIF_BMC_T_262 : NesBoardBase { private bool _mode; private bool _locked; @@ -38,21 +38,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { int bank = _base | _bank; - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } else { int bank = _base | (_mode ? _bank : 7); - return ROM[(bank * 0x4000) + (addr & 0x3FFF)]; + return Rom[(bank * 0x4000) + (addr & 0x3FFF)]; } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (!_locked) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-WS.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-WS.cs index 2a78d8ce9e..1e56c67a08 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-WS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC-WS.cs @@ -3,7 +3,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Based on Nitnendulator src - public sealed class UNIF_BMC_WS : NES.NESBoardBase + public sealed class UNIF_BMC_WS : NesBoardBase { private byte _reg0; private byte _reg1; @@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("reg1", ref _reg1); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if ((_reg0 & 0x20) > 0) { @@ -55,27 +55,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if ((_reg0 & 0x08) > 0) { - return ROM[((_reg0 & 0x07) * 0x4000) + (addr & 0x3FFF)]; + return Rom[((_reg0 & 0x07) * 0x4000) + (addr & 0x3FFF)]; } else { - return ROM[(((_reg0 & 0x6) >> 1) * 0x8000) + (addr & 0x7FFF)]; + return Rom[(((_reg0 & 0x6) >> 1) * 0x8000) + (addr & 0x7FFF)]; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((_reg1 & 0x07) * 0x2000) + (addr & 0x1FFF)]; + return Vrom[((_reg1 & 0x07) * 0x2000) + (addr & 0x1FFF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs index ebaafec505..4722c8990f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMCFK23C.cs @@ -171,7 +171,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr>0x1000) { @@ -184,10 +184,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if ((exRegs[0] & 0x40)>0) { @@ -196,7 +196,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else switch ((addr+0x8000) & 0xE001) { - case 0x8000: base.WritePRG(addr,value); UpdatePrg(); UpdateChr(); break; + case 0x8000: base.WritePrg(addr,value); UpdatePrg(); UpdateChr(); break; case 0x8001: if (((exRegs[3] << 2) & (mmc3.cmd & 0x8))>0) @@ -208,7 +208,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else { - base.WritePRG(addr, value); + base.WritePrg(addr, value); UpdatePrg(); UpdateChr(); } @@ -224,16 +224,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(EMirrorType.Horizontal); } break; - case 0xA001: base.WritePRG(addr, value); break; - case 0xC000: base.WritePRG(addr, value); break; - case 0xC001: base.WritePRG(addr, value); break; - case 0xE000: base.WritePRG(addr, value); break; - case 0xE001: base.WritePRG(addr, value); break; + case 0xA001: base.WritePrg(addr, value); break; + case 0xC000: base.WritePrg(addr, value); break; + case 0xC001: base.WritePrg(addr, value); break; + case 0xE000: base.WritePrg(addr, value); break; + case 0xE001: base.WritePrg(addr, value); break; } } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -245,16 +245,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else addr = (bank_1k << 10) | (addr & 0x3FF); - return VROM[addr]; + return Vrom[addr]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = addr >> 13; bank = prg_regs_8k[bank]; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC_Super24in1SC03.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC_Super24in1SC03.cs index 883b9b8da9..1d8d314166 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC_Super24in1SC03.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BMC_Super24in1SC03.cs @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(exRegs), ref exRegs, false); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { switch (addr) { @@ -43,10 +43,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES exRegs[2] = value; break; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; bank_8k = mmc3.prg_regs_8k[bank_8k]; @@ -54,10 +54,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int NV= bank_8k & masko8[exRegs[0] & 7]; NV |= (exRegs[1] << 1); - return ROM[(NV << 13) + (addr & 0x1FFF)]; + return Rom[(NV << 13) + (addr & 0x1FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -65,19 +65,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((exRegs[0] & 0x20)>0) { - return VRAM[(bank_1k << 10) + (addr & 0x3FF)]; + return Vram[(bank_1k << 10) + (addr & 0x3FF)]; } else { bank_1k = bank_1k | (exRegs[2] << 3); - return VROM[(bank_1k << 10) + (addr & 0x3FF)]; + return Vrom[(bank_1k << 10) + (addr & 0x3FF)]; } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { @@ -85,7 +85,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if ((exRegs[0] & 0x20) > 0) { - VRAM[(bank_1k << 10) + (addr & 0x3FF)]=value; + Vram[(bank_1k << 10) + (addr & 0x3FF)]=value; } else { @@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BTL-Mario1-MALEE2.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BTL-Mario1-MALEE2.cs index 4f6cdf485b..5df944fe10 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BTL-Mario1-MALEE2.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_BTL-Mario1-MALEE2.cs @@ -1,6 +1,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class Mapper055 : NES.NESBoardBase + public sealed class Mapper055 : NesBoardBase { public override bool Configure(NES.EDetectionOrigin origin) { @@ -13,26 +13,26 @@ return false; } - WRAM = new byte[0x800]; + Wram = new byte[0x800]; SetMirrorType(EMirrorType.Vertical); return true; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (addr < 0x1000) { - return ROM[0x8000 + (addr & 0x7FF)]; + return Rom[0x8000 + (addr & 0x7FF)]; } - return WRAM[(addr & 0x7FF)]; + return Wram[(addr & 0x7FF)]; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (addr >= 0x1000) { - WRAM[(addr & 0x7FF)] = value; + Wram[(addr & 0x7FF)] = value; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs index 424ea572ac..fe9c5b1651 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_UNL_43272 : NES.NESBoardBase + public sealed class UNIF_UNL_43272 : NesBoardBase { private int latche; @@ -25,15 +25,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { latche = addr & 65535; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = (latche & 0x38) >> 3; - return ROM[(bank << 15) + addr]; + return Rom[(bank << 15) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AC08.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AC08.cs index 6c5136a720..9e51f1995e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AC08.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AC08.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_UNL_AC08 : NES.NESBoardBase + public sealed class UNIF_UNL_AC08 : NesBoardBase { private int reg; @@ -26,17 +26,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x25) { SetMirrorType(value.Bit(3) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr == 1) { @@ -48,14 +48,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[(reg << 13) + addr]; + return Rom[(reg << 13) + addr]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[0x20000 + addr]; + return Rom[0x20000 + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AX5705.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AX5705.cs index 09544bb559..b01fb1c9df 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AX5705.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-AX5705.cs @@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // Logic copied from FCEUX // Super Mario Bros. Pocker Mali (Unl) - public class UNIF_UNL_AX5705 : NES.NESBoardBase + public class UNIF_UNL_AX5705 : NesBoardBase { private int[] prg_reg = new int[2]; private int[] chr_reg = new int[8]; @@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(chr_reg), ref chr_reg, false); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; byte V = value; @@ -69,36 +69,36 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetMirrorType(mirr > 0 ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int bank = chr_reg[addr / 0x400]; bank &= _chrMask1k; - return VROM[(bank * 0x400) + (addr & 0x3FF)]; + return Vrom[(bank * 0x400) + (addr & 0x3FF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { addr += 0x8000; if (addr < 0xA000) { - return ROM[(prg_reg[0] * 0x2000) + (addr & 0x1FFF)]; + return Rom[(prg_reg[0] * 0x2000) + (addr & 0x1FFF)]; } else if (addr < 0xC000) { - return ROM[(prg_reg[1] * 0x2000) + (addr & 0x1FFF)]; + return Rom[(prg_reg[1] * 0x2000) + (addr & 0x1FFF)]; } else if (addr < 0xE000) { - return ROM[((0xFE & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((0xFE & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; } else { - return ROM[((0xFF & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; + return Rom[((0xFF & _prgMask8k) * 0x2000) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-BB.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-BB.cs index e058dc781d..2eb9b74cf8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-BB.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-BB.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_UNL_BB : NES.NESBoardBase + public sealed class UNIF_UNL_BB : NesBoardBase { private byte reg, chr; private int prg_mask_32k; @@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; if ((addr & 0x9000) == 0x8000) @@ -44,24 +44,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[((reg & 3) << 13) + addr]; + return Rom[((reg & 3) << 13) + addr]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(prg_mask_32k << 15) + addr]; + return Rom[(prg_mask_32k << 15) + addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[((chr & 3) << 13) + addr]; + return Vrom[((chr & 3) << 13) + addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-CC-21.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-CC-21.cs index 4b5dbd0a08..48ea529e4d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-CC-21.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-CC-21.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_UNL_CC_21 : NES.NESBoardBase + public class UNIF_UNL_CC_21 : NesBoardBase { int _reg; public override bool Configure(NES.EDetectionOrigin origin) @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr == 0) // FCEUX says: another one many-in-1 mapper, there is a lot of similar carts with little different wirings { @@ -39,21 +39,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("reg", ref _reg); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { if (Cart.chr_size == 8192) { - return VROM[((_reg & 1) * 0xFFF) + (addr & 0xFFF)]; + return Vrom[((_reg & 1) * 0xFFF) + (addr & 0xFFF)]; } else // Some bad, overdumped roms made by cah4e3 { - return VROM[((_reg & 1) * 0x2000) + (addr & 0x1FFF)]; + return Vrom[((_reg & 1) * 0x2000) + (addr & 0x1FFF)]; } } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-EDU2000.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-EDU2000.cs index 9f9e9d2687..f3e970c78e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-EDU2000.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-EDU2000.cs @@ -1,7 +1,7 @@ using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_UNL_EDU2000 : NES.NESBoardBase + public class UNIF_UNL_EDU2000 : NesBoardBase { private int _reg; @@ -28,14 +28,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("reg", ref _reg); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { _reg = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[((_reg & _prgMask32) * 0x8000) + (addr & 0x7FFF)]; + return Rom[((_reg & _prgMask32) * 0x8000) + (addr & 0x7FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KOF97.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KOF97.cs index b5785db527..d270a8e947 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KOF97.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KOF97.cs @@ -29,25 +29,25 @@ ); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { value = Unscramble(value); if (addr == 0x1000) // 9000 = 8001 { - base.WritePRG(1, value); + base.WritePrg(1, value); } else if (addr == 0x5000) // D000 = C001 { - base.WritePRG(0x4001, value); + base.WritePrg(0x4001, value); } else if (addr == 0x7000) // F000 = E001 { - base.WritePRG(0x6001, value); + base.WritePrg(0x6001, value); } else { - base.WritePRG(addr, value); + base.WritePrg(addr, value); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7012.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7012.cs index 7b45f1b690..b5c37247e7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7012.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7012.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_UNL_KS7012 : NES.NESBoardBase + public class UNIF_UNL_KS7012 : NesBoardBase { private int reg; @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return false; } - WRAM = new byte[8192]; + Wram = new byte[8192]; reg = 0xFF; SetMirrorType(Cart.pad_h, Cart.pad_v); @@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; switch (addr) @@ -41,9 +41,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[((reg & 1) << 15) + addr]; + return Rom[((reg & 1) << 15) + addr]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7013B.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7013B.cs index 22cff63251..551b8666c7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7013B.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-KS7013B.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_UNL_KS7013B : NES.NESBoardBase + public sealed class UNIF_UNL_KS7013B : NesBoardBase { private byte reg; private int prg_mask_16k; @@ -29,24 +29,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { reg = value; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { SetMirrorType(value.Bit(0) ? EMirrorType.Horizontal : EMirrorType.Vertical); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr < 0x4000) { - return ROM[((reg & prg_mask_16k) << 14) + (addr & 0x3FFF)]; + return Rom[((reg & prg_mask_16k) << 14) + (addr & 0x3FFF)]; } - return ROM[(prg_mask_16k << 14) + (addr & 0x3FFF)]; + return Rom[(prg_mask_16k << 14) + (addr & 0x3FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-LH10.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-LH10.cs index b74016a515..13f0d090a9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-LH10.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-LH10.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_UNL_LH10 : NES.NESBoardBase + public sealed class UNIF_UNL_LH10 : NesBoardBase { private byte[] reg = new byte[8]; private int cmd; @@ -35,11 +35,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES base.SyncState(ser); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr>=0x4000 && addr<0x6000) { - WRAM[addr - 0x4000] = value; + Wram[addr - 0x4000] = value; return; } @@ -54,12 +54,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[ROM.Length - 0x4000 + addr]; + return Rom[Rom.Length - 0x4000 + addr]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank = 0; if (addr < 0x2000) @@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (addr < 0x6000) { - return WRAM[addr - 0x4000]; + return Wram[addr - 0x4000]; } else { @@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } bank &= prg_bank_mask_8; - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs index b913b40f78..36d2026172 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-SHERO.cs @@ -31,55 +31,55 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(RegionAsia), ref RegionAsia); } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr == 0x100) { reg = value; } - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr == 0x100) { return (byte)(RegionAsia ? 0xFF : 00); } - return base.ReadEXP(addr); + return base.ReadExp(addr); } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { if ((reg & 0x40) > 0) { - return VRAM[addr]; + return Vram[addr]; } else { int bank_1k = Get_CHRBank_1K(addr); addr = (bank_1k << 10) | (addr & 0x3FF); - return VROM[addr]; + return Vrom[addr]; } } else - return VRAM[addr]; + return Vram[addr]; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { if ((reg & 0x40) > 0) { - VRAM[addr] = value; + Vram[addr] = value; } else { @@ -88,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else - VRAM[addr] = value; + Vram[addr] = value; } protected override int Get_CHRBank_1K(int addr) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-TF1201.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-TF1201.cs index df9d2ed700..3c08d88fd6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-TF1201.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-TF1201.cs @@ -3,7 +3,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class UNIF_UNL_TF1201 : NES.NESBoardBase + public class UNIF_UNL_TF1201 : NesBoardBase { private byte prg0; private byte prg1; @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync(nameof(IRQpre), ref IRQpre); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { addr += 0x8000; addr = (addr & 0xF003) | ((addr & 0xC) >> 2); @@ -73,14 +73,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0xF001: case 0xF003: IRQa = value.Bit(1); - IRQSignal = false; + IrqSignal = false; if (NES.ppu.ppuphase !=PPU.PPU_PHASE_VBL) IRQCount -= 8; break; } } - public override void ClockPPU() + public override void ClockPpu() { if ((NES.ppu.ppuphase != PPU.PPU_PHASE_VBL))// && IRQa) { @@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES IRQpre = 341; if (IRQCount == 237) { - IRQSignal = IRQa; + IrqSignal = IRQa; } if (IRQCount == 256) IRQCount = 0; @@ -99,7 +99,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank; @@ -135,19 +135,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } - return ROM[(bank << 13) + (addr & 0x1FFF)]; + return Rom[(bank << 13) + (addr & 0x1FFF)]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { int x = (addr >> 10) & 7; - return VROM[(chr[x] << 10) + (addr & 0x3FF)]; + return Vrom[(chr[x] << 10) + (addr & 0x3FF)]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_DripGame.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_DripGame.cs index e36c919a82..69f760c0f1 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_DripGame.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_DripGame.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { // http://www.qmtpro.com/~nes/drip/dripmap.txt // http://wiki.nesdev.com/w/index.php/UNIF/UNL-DripGame - public class UNIF_UNL_DripGame : NES.NESBoardBase + public class UNIF_UNL_DripGame : NesBoardBase { [MapperProp] public bool DripGameDipSwitch; @@ -122,13 +122,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void ClockCPU() + public override void ClockCpu() { if (irqvalue > 0) { irqvalue--; if (irqvalue == 0) - IRQSignal = true; + IrqSignal = true; } if (warmupclock > 0) { @@ -138,7 +138,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES sound1.Clock(); } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { switch (addr & 0xf800) { @@ -157,7 +157,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x4000) // regs { @@ -180,7 +180,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irqbuffer = value; return; case 9: // irqh - IRQSignal = false; // ack + IrqSignal = false; // ack if ((value & 0x80) != 0) // enable { irqvalue = value << 8 & 0x7f00 | irqbuffer; @@ -219,16 +219,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[addr & 0x3fff | prg[addr >> 14] << 14]; + return Rom[addr & 0x3fff | prg[addr >> 14] << 14]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[addr & 0x7ff | chr[addr >> 11] << 11]; + return Vrom[addr & 0x7ff | chr[addr >> 11] << 11]; } int mappedaddr = addr & 0x3ff | nt[addr >> 10 & 3] << 10; @@ -242,16 +242,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return NES.CIRAM[mappedaddr]; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr >= 0x2000) NES.CIRAM[addr & 0x3ff | nt[addr >> 10 & 3] << 10] = value; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (sramwrite) - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); } private class SoundChannel diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs index a32a5d78c2..a4b919a597 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL_SMB2J.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public sealed class UNIF_UNL_SMB2J : NES.NESBoardBase + public sealed class UNIF_UNL_SMB2J : NesBoardBase { int prg = 0; int prg_count; @@ -28,44 +28,44 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { addr += 0x4000; switch (addr) { case 0x4022: - if (ROM.Length > 0x10000) { prg = (value & 0x01) << 2; } + if (Rom.Length > 0x10000) { prg = (value & 0x01) << 2; } break; case 0x4122: irqenable = (value & 3) > 0; - IRQSignal = false; + IrqSignal = false; irqcnt = 0; break; } } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { if (addr > 0x1000) { - return ROM[(addr - 0x1000) + (prg_count - 3) * 0x1000]; + return Rom[(addr - 0x1000) + (prg_count - 3) * 0x1000]; } - else return base.ReadEXP(addr); + else return base.ReadExp(addr); } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return ROM[addr + (prg_count - 2) * 0x1000]; + return Rom[addr + (prg_count - 2) * 0x1000]; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[(addr + prg * 01000)]; + return Rom[(addr + prg * 01000)]; } - public override void ClockCPU() + public override void ClockCpu() { if (irqenable) { @@ -74,7 +74,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (irqcnt >= 4096) { irqenable = false; - IRQSignal = true; + IrqSignal = true; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs index 532ceefcf6..8937757077 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UxROM.cs @@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // why are there no bus conflicts in here??????? [NES.INESBoardImplPriority] - public sealed class UxROM : NES.NESBoardBase + public sealed class UxROM : NesBoardBase { //configuration int prg_mask; @@ -95,23 +95,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int block = addr >> 14; int page = block == 1 ? prg_mask : prg; int ofs = addr & 0x3FFF; - return ROM[(page << 14) | ofs]; + return Rom[(page << 14) | ofs]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { prg = adjust_prg(value) & prg_mask; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VRAM[addr & vram_byte_mask]; + return Vram[addr & vram_byte_mask]; } else { @@ -128,15 +128,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - VRAM[addr & vram_byte_mask] = value; + Vram[addr & vram_byte_mask] = value; } else if (NES._isVS) { @@ -155,7 +155,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr,value); + base.WritePpu(addr,value); } public override void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs index 373499aa97..0c7af15404 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC1.cs @@ -4,7 +4,7 @@ using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA mapper 75 - public sealed class VRC1 : NES.NESBoardBase + public sealed class VRC1 : NesBoardBase { //configuration int prg_bank_mask_8k; @@ -74,16 +74,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { @@ -92,7 +92,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES bank_4k = chr_banks_4k[bank_4k]; bank_4k &= chr_bank_mask_4k; addr = (bank_4k << 12) | ofs; - return VROM[addr]; + return Vrom[addr]; } else { @@ -109,12 +109,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - return base.ReadPPU(addr); + return base.ReadPpu(addr); } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { // The game VS Goonies apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values addr &= 0x2FFF; @@ -123,8 +123,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (addr < 0x2000) { - if (VRAM != null) - VRAM[addr] = value; + if (Vram != null) + Vram[addr] = value; } else { @@ -140,7 +140,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } else - base.WritePPU(addr, value); + base.WritePpu(addr, value); } void SyncCHR() @@ -149,7 +149,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES chr_banks_4k[1] = chr_regs_4k[1] & chr_bank_mask_4k; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { @@ -159,9 +159,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x1000: //[.... .BAM] Mirroring, CHR reg high bits if(value.Bit(0)) - SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal); + SetMirrorType(NesBoardBase.EMirrorType.Horizontal); else - SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); + SetMirrorType(NesBoardBase.EMirrorType.Vertical); chr_regs_4k[0] &= 0x0F; chr_regs_4k[1] &= 0x0F; if (value.Bit(1)) chr_regs_4k[0] |= 0x10; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC2_4.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC2_4.cs index 293a682bc4..e3cdec3754 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC2_4.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC2_4.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //mapper 21 + 22 + 23 + 25 (docs largely in 021.txt for VRC4 and 22.txt for VRC2) //If you change any of the IRQ logic here, be sure to change it in VRC 3/6/7 as well. - public sealed class VRC2_4 : NES.NESBoardBase + public sealed class VRC2_4 : NesBoardBase { #region addressmaps // remaps addresses into vrc2b form @@ -147,7 +147,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = (irq_pending && irq_enabled); + IrqSignal = (irq_pending && irq_enabled); } public override bool Configure(NES.EDetectionOrigin origin) @@ -270,31 +270,31 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; bank_8k &= prg_bank_mask_8k; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { - if (addr < 0x2000 && VROM != null) + if (addr < 0x2000 && Vrom != null) { int bank_1k = addr >> 10; int ofs = addr & ((1 << 10) - 1); bank_1k = chr_banks_1k[bank_1k]; addr = (bank_1k << 10) | ofs; - return VROM[addr + extra_vrom]; + return Vrom[addr + extra_vrom]; } - else return base.ReadPPU(addr); + else return base.ReadPpu(addr); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine("mapping {0:X4} = {1:X2}", addr + 0x8000, value); addr = remap(addr); @@ -349,10 +349,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES case 0x1001: //$9001 switch (value & (type - 1)) // VRC2 only supports V, H, and not A, B { - case 0: SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); break; - case 1: SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal); break; - case 2: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); break; - case 3: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenB); break; + case 0: SetMirrorType(NesBoardBase.EMirrorType.Vertical); break; + case 1: SetMirrorType(NesBoardBase.EMirrorType.Horizontal); break; + case 2: SetMirrorType(NesBoardBase.EMirrorType.OneScreenA); break; + case 3: SetMirrorType(NesBoardBase.EMirrorType.OneScreenB); break; } break; @@ -466,7 +466,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_counter++; } - public override void ClockCPU() + public override void ClockCpu() { if (irq_pending) { @@ -495,20 +495,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // a single bit of data can be read at 6000:6fff on some VRC2 carts without wram // games will lock if they can't do this // this isn't a problem in many emus, because if you put wram at 6000:7fff unconditionally, it works. - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { if (!latch6k_exists) - return base.ReadWRAM(addr); + return base.ReadWram(addr); else if (addr >= 0x1000) return NES.DB; else return (byte)(NES.DB & 0xfe | latch6k_value); } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { if (!latch6k_exists) - base.WriteWRAM(addr, value); + base.WriteWram(addr, value); else if (addr < 0x1000) latch6k_value = value & 1; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC3.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC3.cs index 41ff432d83..98c7dbdc7f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC3.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC3.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //mapper 73 AKA salamander //different IRQ logic than other VRC - public sealed class VRC3 : NES.NESBoardBase + public sealed class VRC3 : NesBoardBase { //configuration int prg_bank_mask_16k; @@ -34,7 +34,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = (irq_pending && irq_enabled); + IrqSignal = (irq_pending && irq_enabled); } public override bool Configure(NES.EDetectionOrigin origin) @@ -58,13 +58,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_16k = addr >> 14; int ofs = addr & ((1 << 14) - 1); bank_16k = prg_banks_16k[bank_16k]; addr = (bank_16k << 14) | ofs; - return ROM[addr]; + return Rom[addr]; } void WriteIrqReload(int bit, byte value) @@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int mask = 0xF << bit; irq_reload = (ushort)((irq_reload & ~mask) | (value << bit)); } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { switch (addr) { @@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void ClockCPU() + public override void ClockCpu() { if (!irq_enabled) return; if (irq_mode) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs index 2ace185160..3ce0b74f9c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC6.cs @@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //mapper 24 + 26 //If you change any of the IRQ logic here, be sure to change it in VRC 4/7 as well. - public sealed class VRC6 : NES.NESBoardBase + public sealed class VRC6 : NesBoardBase { #region CHRLUT // what did i do in a previous life to deserve this? @@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = (irq_pending && irq_enabled); + IrqSignal = (irq_pending && irq_enabled); } public override bool Configure(NES.EDetectionOrigin origin) @@ -199,14 +199,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; bank_8k &= prg_bank_mask_8k; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } int MapPPU(int addr) @@ -221,21 +221,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr & 0x3ff | bank << 10; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr >= 0x2000 && !NTROM) return NES.CIRAM[MapPPU(addr) & 0x7ff]; else - return VROM[MapPPU(addr) & chr_byte_mask]; + return Vrom[MapPPU(addr) & chr_byte_mask]; } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr >= 0x2000 && !NTROM) NES.CIRAM[MapPPU(addr) & 0x7ff] = value; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (newer_variant) { @@ -359,7 +359,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_counter++; } - public override void ClockCPU() + public override void ClockCpu() { VRC6Sound.Clock(); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs index 89bd575d0f..155d425c1f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VRC7.cs @@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { //mapper 85 //If you change any of the IRQ logic here, be sure to change it in VRC 2/3/4/6 as well. - public sealed class VRC7 : NES.NESBoardBase + public sealed class VRC7 : NesBoardBase { //configuration int prg_bank_mask_8k, chr_bank_mask_1k; @@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SyncIRQ() { - IRQSignal = (irq_pending && irq_enabled); + IrqSignal = (irq_pending && irq_enabled); } @@ -128,13 +128,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { int bank_8k = addr >> 13; int ofs = addr & ((1 << 13) - 1); bank_8k = prg_banks_8k[bank_8k]; addr = (bank_8k << 13) | ofs; - return ROM[addr]; + return Rom[addr]; } int Map_PPU(int addr) @@ -146,27 +146,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return addr; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { addr = Map_PPU(addr); if (Cart.vram_size != 0) - return base.ReadPPU(addr); + return base.ReadPpu(addr); - return VROM[addr]; + return Vrom[addr]; } - return base.ReadPPU(addr); + return base.ReadPpu(addr); } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - base.WritePPU(Map_PPU(addr),value); + base.WritePpu(Map_PPU(addr),value); } - else base.WritePPU(addr, value); + else base.WritePpu(addr, value); } public override void ApplyCustomAudio(short[] samples) @@ -185,7 +185,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { //Console.WriteLine(" mapping {0:X4} = {1:X2}", addr, value); addr = remap(addr); @@ -291,7 +291,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES irq_counter++; } - public override void ClockCPU() + public override void ClockCpu() { if (irq_pending) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs index 35b33da5a2..b40eaa5f02 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/VS_M99.cs @@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //VS System Mapper 99 [NES.INESBoardImplPriority] - public sealed class MAPPER99 : NES.NESBoardBase + public sealed class MAPPER99 : NesBoardBase { //configuration int prg_byte_mask, chr_mask; @@ -47,22 +47,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } // this now tracks coins - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { //but we don't actually need to do anything yet } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { //what are we reading? return 0; } - public override byte ReadPPU(int addr) + public override byte ReadPpu(int addr) { if (addr < 0x2000) { - return VROM[(addr & 0x1FFF) + ((NES.VS_chr_reg & chr_mask) << 13)]; + return Vrom[(addr & 0x1FFF) + ((NES.VS_chr_reg & chr_mask) << 13)]; } else { @@ -79,12 +79,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public override void WritePPU(int addr, byte value) + public override void WritePpu(int addr, byte value) { if (addr < 0x2000) { - if (VRAM != null) - VRAM[addr] = value; + if (Vram != null) + Vram[addr] = value; } else { @@ -107,19 +107,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.Sync("VS_CIRAM", ref CIRAM_VS, false); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (Cart.prg_size==48) { if (addr<0x2000) { - return ROM[(addr & 0x1FFF) + ((NES.VS_prg_reg*4) << 13)]; + return Rom[(addr & 0x1FFF) + ((NES.VS_prg_reg*4) << 13)]; } else - return ROM[addr]; + return Rom[addr]; } else { - return ROM[addr]; + return Rom[addr]; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/inlnsf.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/inlnsf.cs index ec87e482e1..ba51043813 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/inlnsf.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/inlnsf.cs @@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { - public class INLNSF : NES.NESBoardBase + public class INLNSF : NesBoardBase { // config @@ -40,17 +40,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return true; } - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { if (addr >= 0x1000) prg[addr & 0x07] = value & prg_bank_mask_4k; else - base.WriteEXP(addr, value); + base.WriteExp(addr, value); } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { - return ROM[prg[(addr & 0x7000) >> 12] << 12 | addr & 0x0fff]; + return Rom[prg[(addr & 0x7000) >> 12] << 12 | addr & 0x0fff]; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs index bc2b849d18..cdabe7f840 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES * http://nesdev.com/diskspec.txt - not useless */ [NES.INESBoardImplCancel] - public class FDS : NES.NESBoardBase + public class FDS : NesBoardBase { #region configuration /// FDS bios image; should be 8192 bytes @@ -229,7 +229,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void SetIRQ() { - IRQSignal = _diskirq || _timerirq; + IrqSignal = _diskirq || _timerirq; } bool diskirq { @@ -244,7 +244,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES int timerirq_cd; bool timer_irq_active; - public override void WriteEXP(int addr, byte value) + public override void WriteExp(int addr, byte value) { //if (addr == 0x0025) // Console.WriteLine("W{0:x4}:{1:x2} {2:x4}", addr + 0x4000, value, NES.cpu.PC); @@ -307,7 +307,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES diskirq = diskdrive.irq; } - public override byte ReadEXP(int addr) + public override byte ReadExp(int addr) { byte ret = NES.DB; @@ -363,7 +363,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return 0; // lazy } - public override void ClockCPU() + public override void ClockCpu() { if ((timerreg & 2) != 0 && diskenable) { @@ -402,34 +402,34 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES audio.Clock(); } - public override void ClockPPU() + public override void ClockPpu() { diskdrive.Clock(); diskirq = diskdrive.irq; } - public override byte ReadWRAM(int addr) + public override byte ReadWram(int addr) { - return WRAM[addr & 0x1fff]; + return Wram[addr & 0x1fff]; } - public override void WriteWRAM(int addr, byte value) + public override void WriteWram(int addr, byte value) { - WRAM[addr & 0x1fff] = value; + Wram[addr & 0x1fff] = value; } - public override byte ReadPRG(int addr) + public override byte ReadPrg(int addr) { if (addr >= 0x6000) return biosrom[addr & 0x1fff]; else - return WRAM[addr + 0x2000]; + return Wram[addr + 0x2000]; } - public override void WritePRG(int addr, byte value) + public override void WritePrg(int addr, byte value) { if (addr < 0x6000) - WRAM[addr + 0x2000] = value; + Wram[addr + 0x2000] = value; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs index be030f11d5..a77dcc190c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs @@ -12,330 +12,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { partial class NES { - public interface INESBoard - { - //base class pre-configuration - void Create(NES nes); - //one-time inherited classes configuration - bool Configure(EDetectionOrigin origin); - //one-time base class configuration (which can take advantage of any information setup by the more-informed Configure() method) - void PostConfigure(); - - //gets called once per PPU clock, for boards with complex behaviour which must be monitoring clock (i.e. mmc3 irq counter) - void ClockPPU(); - //gets called once per CPU clock; typically for boards with M2 counters - void ClockCPU(); - - byte PeekCart(int addr); - - byte ReadPRG(int addr); - byte ReadPPU(int addr); byte PeekPPU(int addr); - void AddressPPU(int addr); - byte ReadWRAM(int addr); - byte ReadEXP(int addr); - byte ReadReg2xxx(int addr); - byte PeekReg2xxx(int addr); - void WritePRG(int addr, byte value); - void WritePPU(int addr, byte value); - void WriteWRAM(int addr, byte value); - void WriteEXP(int addr, byte value); - void WriteReg2xxx(int addr, byte value); - void NESSoftReset(); - void AtVsyncNMI(); - byte[] SaveRam { get; } - byte[] WRAM { get; set; } - byte[] VRAM { get; set; } - byte[] ROM { get; set; } - byte[] VROM { get; set; } - void SyncState(Serializer ser); - bool IRQSignal { get; } - - //mixes the board's custom audio into the supplied sample buffer - void ApplyCustomAudio(short[] samples); - - Dictionary InitialRegisterValues { get; set; } - } - - [INESBoardImpl] - public abstract class NESBoardBase : INESBoard - { - /// - /// These are used by SetMirroring() to provide the base class nametable mirroring service. - /// Apparently, these are not used for internal build configuration logics - /// - public enum EMirrorType - { - Vertical, Horizontal, - OneScreenA, OneScreenB - } - - public virtual void Create(NES nes) - { - this.NES = nes; - } - - public virtual void NESSoftReset() - { - } - - Dictionary _initialRegisterValues = new Dictionary(); - public Dictionary InitialRegisterValues - { - get => _initialRegisterValues; - set => _initialRegisterValues = value; - } - - public abstract bool Configure(EDetectionOrigin origin); - public virtual void ClockPPU() { } - public virtual void ClockCPU() { } - public virtual void AtVsyncNMI() { } - - public CartInfo Cart => NES.cart; - public NES NES { get; set; } - - //this is set to true when SyncState is called, so that we know the base class SyncState was used - public bool SyncStateFlag; - - public virtual void SyncState(Serializer ser) - { - ser.Sync(nameof(vram), ref vram, true); - ser.Sync(nameof(wram), ref wram, true); - for (int i = 0; i < 4; i++) ser.Sync("mirroring" + i, ref mirroring[i]); - ser.Sync(nameof(irq_signal), ref irq_signal); - SyncStateFlag = true; - } - - public virtual void SyncIRQ(bool flag) - { - IRQSignal = flag; - } - - private bool irq_signal; - public bool IRQSignal - { - get => irq_signal; - set => irq_signal = value; - } - - int[] mirroring = new int[4]; - protected void SetMirroring(int a, int b, int c, int d) - { - mirroring[0] = a; - mirroring[1] = b; - mirroring[2] = c; - mirroring[3] = d; - } - - protected void ApplyMemoryMapMask(int mask, byte[] map) - { - byte bmask = (byte)mask; - for (int i = 0; i < map.Length; i++) - map[i] &= bmask; - } - - //make sure you have bank-masked the map - protected int ApplyMemoryMap(int blockSizeBits, byte[] map, int addr) - { - int bank = addr >> blockSizeBits; - int ofs = addr & ((1 << blockSizeBits) - 1); - bank = map[bank]; - addr = (bank << blockSizeBits) | ofs; - return addr; - } - - public static EMirrorType CalculateMirrorType(int pad_h, int pad_v) - { - if (pad_h == 0) - if (pad_v == 0) - return EMirrorType.OneScreenA; - else return EMirrorType.Horizontal; - if (pad_v == 0) - return EMirrorType.Vertical; - return EMirrorType.OneScreenB; - } - - protected void SetMirrorType(int pad_h, int pad_v) - { - SetMirrorType(CalculateMirrorType(pad_h, pad_v)); - } - - public void SetMirrorType(EMirrorType mirrorType) - { - switch (mirrorType) - { - case EMirrorType.Horizontal: SetMirroring(0, 0, 1, 1); break; - case EMirrorType.Vertical: SetMirroring(0, 1, 0, 1); break; - case EMirrorType.OneScreenA: SetMirroring(0, 0, 0, 0); break; - case EMirrorType.OneScreenB: SetMirroring(1, 1, 1, 1); break; - default: SetMirroring(-1, -1, -1, -1); break; //crash! - } - } - - protected int ApplyMirroring(int addr) - { - int block = (addr >> 10) & 3; - block = mirroring[block]; - int ofs = addr & 0x3FF; - return (block << 10) | ofs; - } - - protected byte HandleNormalPRGConflict(int addr, byte value) - { - byte old_value = value; - value &= ReadPRG(addr); - //Debug.Assert(old_value == value, "Found a test case of bus conflict. please report."); - //report: pinball quest (J). also: double dare - return value; - } - - public virtual byte ReadPRG(int addr) { return ROM[addr]; } - public virtual void WritePRG(int addr, byte value) { } - - public virtual void WriteWRAM(int addr, byte value) - { - if(wram != null) - wram[addr & wram_mask] = value; - } - - private int wram_mask; - public virtual void PostConfigure() - { - wram_mask = (Cart.wram_size * 1024) - 1; - } - - public virtual byte ReadWRAM(int addr) - { - if (wram != null) - return wram[addr & wram_mask]; - return NES.DB; - } - - public virtual void WriteEXP(int addr, byte value) { } - public virtual byte ReadEXP(int addr) { - return NES.DB; - } - - public virtual byte ReadReg2xxx(int addr) - { - return NES.ppu.ReadReg(addr & 7); - } - - public virtual byte PeekReg2xxx(int addr) - { - return NES.ppu.PeekReg(addr & 7); - } - - public virtual void WriteReg2xxx(int addr, byte value) - { - NES.ppu.WriteReg(addr, value); - } - - public virtual void WritePPU(int addr, byte value) - { - if (addr < 0x2000) - { - if (VRAM != null) - VRAM[addr] = value; - } - else - { - NES.CIRAM[ApplyMirroring(addr)] = value; - } - } - - public virtual void AddressPPU(int addr) { } - public virtual byte PeekPPU(int addr) { return ReadPPU(addr); } - - protected virtual byte ReadPPUChr(int addr) - { - if (VROM != null) - return VROM[addr]; - return VRAM[addr]; - } - - public virtual byte ReadPPU(int addr) - { - if (addr < 0x2000) - { - if (VROM != null) - return VROM[addr]; - return VRAM[addr]; - } - - return NES.CIRAM[ApplyMirroring(addr)]; - } - - /// - /// derived classes should override this if they have peek-unsafe logic - /// - public virtual byte PeekCart(int addr) - { - byte ret; - if (addr >= 0x8000) - { - ret = ReadPRG(addr - 0x8000); //easy optimization, since rom reads are so common, move this up (reordering the rest of these elseifs is not easy) - } - else if (addr < 0x6000) - { - ret = ReadEXP(addr - 0x4000); - } - else - { - ret = ReadWRAM(addr - 0x6000); - } - - return ret; - } - - public virtual byte[] SaveRam - { - get - { - if (!Cart.wram_battery) return null; - return WRAM; - } - } - - public byte[] WRAM - { - get => wram; - set => wram = value; - } - public byte[] VRAM - { - get => vram; - set => vram = value; - } - public byte[] ROM { get; set; } - public byte[] VROM { get; set; } - byte[] wram, vram; - - protected void Assert(bool test, string comment, params object[] args) - { - if (!test) throw new Exception(string.Format(comment, args)); - } - protected void Assert(bool test) - { - if (!test) throw new Exception("assertion failed in board setup!"); - } - protected void AssertPrg(params int[] prg) { Assert_memtype(Cart.prg_size, "prg", prg); } - protected void AssertChr(params int[] chr) { Assert_memtype(Cart.chr_size, "chr", chr); } - protected void AssertWram(params int[] wram) { Assert_memtype(Cart.wram_size, "wram", wram); } - protected void AssertVram(params int[] vram) { Assert_memtype(Cart.vram_size, "vram", vram); } - protected void Assert_memtype(int value, string name, int[] valid) - { - // only disable vram and wram asserts, as UNIF knows its prg and chr sizes - if (DisableConfigAsserts && (name == "wram" || name == "vram")) return; - foreach (int i in valid) if (value == i) return; - Assert(false, "unhandled {0} size of {1}", name,value); - } - protected void AssertBattery(bool has_bat) { Assert(Cart.wram_battery == has_bat); } - - public virtual void ApplyCustomAudio(short[] samples) { } - - public bool DisableConfigAsserts; - } - //this will be used to track classes that implement boards [AttributeUsage(AttributeTargets.Class)] public sealed class INESBoardImplAttribute : Attribute { } @@ -347,9 +23,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES [AttributeUsage(AttributeTargets.Class)] public sealed class INESBoardImplPriorityAttribute : Attribute { } - static INESBoard CreateBoardInstance(Type boardType) + static INesBoard CreateBoardInstance(Type boardType) { - var board = (INESBoard)Activator.CreateInstance(boardType); + var board = (INesBoard)Activator.CreateInstance(boardType); lock (INESBoardImplementors) { //put the one we chose at the top of the list, for quicker access in the future @@ -366,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES void BoardSystemHardReset() { - INESBoard newboard; + INesBoard newboard; // FDS and NSF have a unique activation setup if (Board is FDS) { @@ -393,12 +69,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // in case the user actually changed something in the UI newboard.InitialRegisterValues = Board.InitialRegisterValues; newboard.Configure(origin); - newboard.ROM = Board.ROM; - newboard.VROM = Board.VROM; - if (Board.WRAM != null) - newboard.WRAM = new byte[Board.WRAM.Length]; - if (Board.VRAM != null) - newboard.VRAM = new byte[Board.VRAM.Length]; + newboard.Rom = Board.Rom; + newboard.Vrom = Board.Vrom; + if (Board.Wram != null) + newboard.Wram = new byte[Board.Wram.Length]; + if (Board.Vram != null) + newboard.Vram = new byte[Board.Vram.Length]; newboard.PostConfigure(); // the old board's sram must be restored if (newboard is FDS) @@ -413,7 +89,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } Board = newboard; - ppu.HasClockPPU = Board.GetType().GetMethod(nameof(INESBoard.ClockPPU)).DeclaringType != typeof(NESBoardBase); + ppu.HasClockPPU = Board.GetType().GetMethod(nameof(INesBoard.ClockPpu)).DeclaringType != typeof(NesBoardBase); } @@ -489,7 +165,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES lock(INESBoardImplementors) foreach (var type in INESBoardImplementors) { - NESBoardBase board = (NESBoardBase)Activator.CreateInstance(type); + NesBoardBase board = (NesBoardBase)Activator.CreateInstance(type); //unif demands that the boards set themselves up with expected legal values based on the board size //except, i guess, for the rom/chr sizes. go figure. //so, disable the asserts here @@ -750,7 +426,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public static class AutoMapperProps { - public static void Populate(NES.INESBoard board, NES.NESSyncSettings settings) + public static void Populate(INesBoard board, NES.NESSyncSettings settings) { var fields = board.GetType().GetFields(); foreach (var field in fields) @@ -766,7 +442,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } } - public static void Apply(NES.INESBoard board) + public static void Apply(INesBoard board) { var fields = board.GetType().GetFields(); foreach (var field in fields) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 7e4d9275a7..82aabf6651 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -19,8 +19,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public byte[] ram; public byte[] CIRAM; //AKA nametables string game_name = ""; //friendly name exposed to user and used as filename base - CartInfo cart; //the current cart prototype. should be moved into the board, perhaps - internal INESBoard Board; //the board hardware that is currently driving things + internal CartInfo cart; //the current cart prototype. should be moved into the board, perhaps + internal INesBoard Board; //the board hardware that is currently driving things EDetectionOrigin origin = EDetectionOrigin.None; int sprdma_countdown; @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /// /// for debugging only! /// - public INESBoard GetBoard() => Board; + public INesBoard GetBoard() => Board; #region Audio @@ -269,11 +269,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (cart.DB_GameInfo.Hash == "00C50062A2DECE99580063777590F26A253AAB6B") // Silva Saga { - for (int i = 0; i < Board.WRAM.Length; i++) + for (int i = 0; i < Board.Wram.Length; i++) { - Board.WRAM[i] = 0xFF; + Board.Wram[i] = 0xFF; } - } + } } } @@ -299,7 +299,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES lagged = true; if (resetSignal) { - Board.NESSoftReset(); + Board.NesSoftReset(); cpu.NESSoftReset(); apu.NESSoftReset(); ppu.NESSoftReset(); @@ -536,16 +536,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (cpu.RDY && !IRQ_delay) { - cpu.IRQ = _irq_apu || Board.IRQSignal; + cpu.IRQ = _irq_apu || Board.IrqSignal; } else if (special_case_delay || apu.dmc_dma_countdown == 3) { - cpu.IRQ = _irq_apu || Board.IRQSignal; + cpu.IRQ = _irq_apu || Board.IrqSignal; special_case_delay = false; } cpu.ExecuteOne(); - Board.ClockCPU(); + Board.ClockCpu(); int s = apu.EmitSample(); @@ -904,8 +904,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (addr >= 0x8000) { - //easy optimization, since rom reads are so common, move this up (reordering the rest of these elseifs is not easy) - ret = Board.ReadPRG(addr - 0x8000); + // easy optimization, since rom reads are so common, move this up (reordering the rest of these else ifs is not easy) + ret = Board.ReadPrg(addr - 0x8000); } else if (addr < 0x0800) { @@ -921,15 +921,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (addr < 0x4020) { - ret = ReadReg(addr); //we're not rebasing the register just to keep register names canonical + ret = ReadReg(addr); // we're not rebasing the register just to keep register names canonical } else if (addr < 0x6000) { - ret = Board.ReadEXP(addr - 0x4000); + ret = Board.ReadExp(addr - 0x4000); } else { - ret = Board.ReadWRAM(addr - 0x6000); + ret = Board.ReadWram(addr - 0x6000); } // handle cheats (currently cheats can only freeze read only areas) @@ -982,15 +982,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } else if (addr < 0x6000) { - Board.WriteEXP(addr - 0x4000, value); + Board.WriteExp(addr - 0x4000, value); } else if (addr < 0x8000) { - Board.WriteWRAM(addr - 0x6000, value); + Board.WriteWram(addr - 0x6000, value); } else { - Board.WritePRG(addr - 0x8000, value); + Board.WritePrg(addr - 0x8000, value); } uint flags = (uint)(MemoryCallbackFlags.CPUZero | MemoryCallbackFlags.AccessWrite | MemoryCallbackFlags.SizeByte); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs index 13f764e8f3..c10c8f7e4b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs @@ -31,27 +31,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES domains.Add(BatteryRam); } - if (Board.ROM != null) + if (Board.Rom != null) { - var PRGROM = new MemoryDomainByteArray("PRG ROM", MemoryDomain.Endian.Little, Board.ROM, true, 1); + var PRGROM = new MemoryDomainByteArray("PRG ROM", MemoryDomain.Endian.Little, Board.Rom, true, 1); domains.Add(PRGROM); } - if (Board.VROM != null) + if (Board.Vrom != null) { - var CHRROM = new MemoryDomainByteArray("CHR VROM", MemoryDomain.Endian.Little, Board.VROM, true, 1); + var CHRROM = new MemoryDomainByteArray("CHR VROM", MemoryDomain.Endian.Little, Board.Vrom, true, 1); domains.Add(CHRROM); } - if (Board.VRAM != null) + if (Board.Vram != null) { - var VRAM = new MemoryDomainByteArray("VRAM", MemoryDomain.Endian.Little, Board.VRAM, true, 1); + var VRAM = new MemoryDomainByteArray("VRAM", MemoryDomain.Endian.Little, Board.Vram, true, 1); domains.Add(VRAM); } - if (Board.WRAM != null) + if (Board.Wram != null) { - var WRAM = new MemoryDomainByteArray("WRAM", MemoryDomain.Endian.Little, Board.WRAM, true, 1); + var WRAM = new MemoryDomainByteArray("WRAM", MemoryDomain.Endian.Little, Board.Wram, true, 1); domains.Add(WRAM); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.INESPPUViewable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.INESPPUViewable.cs index 04942a68c9..4906a3469d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.INESPPUViewable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.INESPPUViewable.cs @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { if (Board is ExROM) { - return Board.VROM ?? Board.VRAM; + return Board.Vrom ?? Board.Vram; } else { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IStatable.cs index b6e2684144..f3c0d2f973 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IStatable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IStatable.cs @@ -49,9 +49,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ser.BeginSection(nameof(Board)); Board.SyncState(ser); - if (Board is NESBoardBase board && !board.SyncStateFlag) + if (Board is NesBoardBase board && !board.SyncStateFlag) { - throw new InvalidOperationException($"the current NES mapper didn't call base.{nameof(INESBoard.SyncState)}"); + throw new InvalidOperationException($"the current NES mapper didn't call base.{nameof(INesBoard.SyncState)}"); } ser.EndSection(); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index 42ed2f56b8..e3cd0c9694 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -360,11 +360,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES cart = new CartInfo(); var nsfboard = new NSFBoard(); nsfboard.Create(this); - nsfboard.ROM = rom; + nsfboard.Rom = rom; nsfboard.InitNSF( nsf); nsfboard.InitialRegisterValues = InitialMapperRegisterValues; nsfboard.Configure(origin); - nsfboard.WRAM = new byte[cart.wram_size * 1024]; + nsfboard.Wram = new byte[cart.wram_size * 1024]; Board = nsfboard; Board.PostConfigure(); AutoMapperProps.Populate(Board, SyncSettings); @@ -400,9 +400,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //create the vram and wram if necessary if (cart.wram_size != 0) - Board.WRAM = new byte[cart.wram_size * 1024]; + Board.Wram = new byte[cart.wram_size * 1024]; if (cart.vram_size != 0) - Board.VRAM = new byte[cart.vram_size * 1024]; + Board.Vram = new byte[cart.vram_size * 1024]; Board.PostConfigure(); AutoMapperProps.Populate(Board, SyncSettings); @@ -673,24 +673,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ms.Read(trainer, 0, 512); } - Board.ROM = new byte[choice.prg_size * 1024]; - ms.Read(Board.ROM, 0, Board.ROM.Length); + Board.Rom = new byte[choice.prg_size * 1024]; + ms.Read(Board.Rom, 0, Board.Rom.Length); if (choice.chr_size > 0) { - Board.VROM = new byte[choice.chr_size * 1024]; - int vrom_copy_size = ms.Read(Board.VROM, 0, Board.VROM.Length); + Board.Vrom = new byte[choice.chr_size * 1024]; + int vrom_copy_size = ms.Read(Board.Vrom, 0, Board.Vrom.Length); - if (vrom_copy_size < Board.VROM.Length) - LoadWriteLine("Less than the expected VROM was found in the file: {0} < {1}", vrom_copy_size, Board.VROM.Length); + if (vrom_copy_size < Board.Vrom.Length) + LoadWriteLine("Less than the expected VROM was found in the file: {0} < {1}", vrom_copy_size, Board.Vrom.Length); } if (choice.prg_size != iNesHeaderInfo.prg_size || choice.chr_size != iNesHeaderInfo.chr_size) LoadWriteLine("Warning: Detected choice has different filesizes than the INES header!"); } else if (unif != null) { - Board.ROM = unif.PRG; - Board.VROM = unif.CHR; + Board.Rom = unif.PRG; + Board.Vrom = unif.CHR; } else { @@ -698,16 +698,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES var ms = new MemoryStream(file, false); ms.Seek(0, SeekOrigin.Begin); - Board.ROM = new byte[choice.prg_size * 1024]; - ms.Read(Board.ROM, 0, Board.ROM.Length); + Board.Rom = new byte[choice.prg_size * 1024]; + ms.Read(Board.Rom, 0, Board.Rom.Length); if (choice.chr_size > 0) { - Board.VROM = new byte[choice.chr_size * 1024]; - int vrom_copy_size = ms.Read(Board.VROM, 0, Board.VROM.Length); + Board.Vrom = new byte[choice.chr_size * 1024]; + int vrom_copy_size = ms.Read(Board.Vrom, 0, Board.Vrom.Length); - if (vrom_copy_size < Board.VROM.Length) - LoadWriteLine("Less than the expected VROM was found in the file: {0} < {1}", vrom_copy_size, Board.VROM.Length); + if (vrom_copy_size < Board.Vrom.Length) + LoadWriteLine("Less than the expected VROM was found in the file: {0} < {1}", vrom_copy_size, Board.Vrom.Length); } } @@ -718,9 +718,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //create the vram and wram if necessary if (cart.wram_size != 0) - Board.WRAM = new byte[cart.wram_size * 1024]; + Board.Wram = new byte[cart.wram_size * 1024]; if (cart.vram_size != 0) - Board.VRAM = new byte[cart.vram_size * 1024]; + Board.Vram = new byte[cart.vram_size * 1024]; Board.PostConfigure(); AutoMapperProps.Populate(Board, SyncSettings); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs index 5e7ad93bee..60393f2b24 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs @@ -161,9 +161,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public void ppubus_write(int addr, byte value) { if (ppur.status.sl >= 241 || !PPUON) - nes.Board.AddressPPU(addr); + nes.Board.AddressPpu(addr); - nes.Board.WritePPU(addr, value); + nes.Board.WritePpu(addr, value); } //when the ppu issues a read it goes through here and into the game board @@ -174,9 +174,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return 0xFF; if (addr_ppu) - nes.Board.AddressPPU(addr); + nes.Board.AddressPpu(addr); - return nes.Board.ReadPPU(addr); + return nes.Board.ReadPpu(addr); } //debug tools peek into the ppu through this @@ -372,7 +372,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //apparently this shoves it on the address bus, too, or else blargg's mmc3 tests don't pass //ONLY if the ppu is not rendering if (ppur.status.sl >= 241 || !PPUON) - nes.Board.AddressPPU(ppur.get_2007access()); + nes.Board.AddressPpu(ppur.get_2007access()); } } @@ -424,7 +424,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (HasClockPPU) { - nes.Board.ClockPPU(); + nes.Board.ClockPpu(); } _totalCycles += 1; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs index dba5936971..20ec85a9a0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs @@ -570,7 +570,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //see comments in $2006 if (ppur.status.sl >= 241 || !PPUON) - nes.Board.AddressPPU(ppur.get_2007access()); + nes.Board.AddressPpu(ppur.get_2007access()); } byte read_2007() { @@ -594,7 +594,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //see comments in $2006 if (ppur.status.sl >= 241 || !PPUON) - nes.Board.AddressPPU(ppur.get_2007access()); + nes.Board.AddressPpu(ppur.get_2007access()); // update open bus here ppu_open_bus = ret; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs index 772af53439..0a0c8c07d6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs @@ -174,7 +174,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else if (ppur.status.cycle == (3 + NMI_offset) && ppur.status.sl == 241 + preNMIlines) { if (nmi_destiny) { nes.cpu.NMI = true; } - nes.Board.AtVsyncNMI(); + nes.Board.AtVsyncNmi(); } if (ppur.status.cycle == 340) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs index a72b0616f9..bad4c7a2a6 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.cs @@ -65,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk private void SoftReset() { - _nesCore.Board.NESSoftReset(); + _nesCore.Board.NesSoftReset(); _nesCore.cpu.NESSoftReset(); _nesCore.apu.NESSoftReset(); _nesCore.ppu.NESSoftReset(); diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings index 84d4da04ba..66e713ee42 100644 --- a/BizHawk.sln.DotSettings +++ b/BizHawk.sln.DotSettings @@ -558,6 +558,7 @@ True True True + True True True True