nes: minor cleanup
This commit is contained in:
parent
ea826973d6
commit
121b1edad9
|
@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
public class GameGenie : NES.NESBoardBase
|
||||
{
|
||||
static byte[] NameTables = new byte[256];
|
||||
static byte[] PatternTables = new byte[256];
|
||||
|
||||
static GameGenie()
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
}
|
||||
d |= (byte)(d << 1);
|
||||
d |= (byte)(d << 2);
|
||||
NameTables[addr] = d;
|
||||
PatternTables[addr] = d;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
if (addr >= 0x2000)
|
||||
return base.ReadPPU(addr);
|
||||
else
|
||||
return NameTables[addr & 0xff];
|
||||
return PatternTables[addr & 0xff];
|
||||
}
|
||||
|
||||
public override void WritePRG(int addr, byte value)
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
case "MAPPER018":
|
||||
case "JALECO-JF-23":
|
||||
case "JALECO-JF-24": //TODO: there will be many boards to list here
|
||||
case "JALECO-JF-24":
|
||||
case "JALECO-JF-25":
|
||||
case "JALECO-JF-27":
|
||||
case "JALECO-JF-29":
|
||||
|
@ -225,22 +225,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
public override void ClockCPU()
|
||||
{
|
||||
//ppuclock++;
|
||||
//if (ppuclock == 3)
|
||||
//{
|
||||
//ppuclock = 0;
|
||||
if (!irqcountpaused)
|
||||
if (!irqcountpaused)
|
||||
{
|
||||
int newclock = irqclock - 1;
|
||||
if (squeeze(newclock) > squeeze(irqclock))
|
||||
{
|
||||
int newclock = irqclock - 1;
|
||||
if (squeeze(newclock) > squeeze(irqclock))
|
||||
{
|
||||
IRQSignal = true;
|
||||
irqclock = irqreload;
|
||||
}
|
||||
else
|
||||
irqclock = newclock;
|
||||
IRQSignal = true;
|
||||
irqclock = irqreload;
|
||||
}
|
||||
//}
|
||||
else
|
||||
irqclock = newclock;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
using System;
|
||||
using BizHawk.Common;
|
||||
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
{
|
||||
//aka NAMCOT-3446
|
||||
// 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
|
||||
{
|
||||
// config
|
||||
|
@ -16,10 +19,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
//analyze board type
|
||||
switch (Cart.board_type)
|
||||
{
|
||||
case "NAMCOT-3446": //Megami Tensei: Digital Devil Story
|
||||
case "NAMCOT-3446": // Megami Tensei: Digital Devil Story
|
||||
case "MAPPER076":
|
||||
break;
|
||||
default:
|
||||
|
@ -64,6 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
return ROM[addr & 0x1fff | prg[addr >> 13] << 13];
|
||||
}
|
||||
|
||||
public override byte ReadPPU(int addr)
|
||||
{
|
||||
if (addr < 0x2000)
|
||||
|
@ -71,7 +74,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
else
|
||||
return base.ReadPPU(addr);
|
||||
}
|
||||
public override void SyncState(BizHawk.Common.Serializer ser)
|
||||
|
||||
public override void SyncState(Serializer ser)
|
||||
{
|
||||
base.SyncState(ser);
|
||||
ser.Sync("prg", ref prg, false);
|
||||
|
@ -79,4 +83,4 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ser.Sync("port", ref port);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,19 +169,5 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
irq_counter++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public override void ClockPPU()
|
||||
{
|
||||
if (!irq_enabled) return;
|
||||
|
||||
irq_cycles--;
|
||||
if (irq_cycles == 0)
|
||||
{
|
||||
irq_cycles += 3;
|
||||
ClockIRQ();
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue