NES - Start Sunsoft3 board (mapper 89), tweak comments of jaleco567, add some missing variables to savestates for bandai-fcg-1

This commit is contained in:
andres.delikat 2011-09-20 01:07:24 +00:00
parent 820d003544
commit ab23cb486c
4 changed files with 106 additions and 43 deletions

View File

@ -43,6 +43,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo
{
base.SyncState(ser);
ser.Sync("chr_bank_mask_1k", ref chr_bank_mask_1k);
ser.Sync("prg_bank_mask_16k", ref prg_bank_mask_16k);
ser.Sync("prg_bank_mask_16k", ref prg_bank_mask_16k);
ser.Sync("regs", ref regs);
ser.Sync("eprom", ref eprom);
ser.Sync("irq_counter", ref irq_counter);
ser.Sync("irq_countdown", ref irq_countdown);
ser.Sync("irq_enabled", ref irq_enabled);

View File

@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
Example Games:
--------------------------
City Connection (J) - JF_05
Ninja Jajamaru Kun
Ninja Jajamaru Kun - JF_06
Argus (J) - JF_07
*/
class JALECO_JF_05 : NES.NESBoardBase

View File

@ -4,8 +4,8 @@ using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
/*
* Life Span: April 1986 - July 1986
/*
* Life Span: April 1986 - July 1986
PCB Class: SUNSOFT-1
iNES Mapper 184
PRG-ROM: 32KB
@ -16,21 +16,21 @@ Battery is not available
Uses vertical mirroring
No CIC present
Other chips used: Sunsoft-1
*
* Games:
* Atlantis no Nazo
* The Wing of Madoola
*/
*
* Games:
* Atlantis no Nazo
* The Wing of Madoola
*/
class Sunsoft1 : NES.NESBoardBase
{
int chr_mask;
int left_piece = 0;
int right_piece = 3;
class Sunsoft1 : NES.NESBoardBase
{
int chr_mask;
int left_piece = 0;
int right_piece = 3;
public override bool Configure(NES.EDetectionOrigin origin)
{
//configure
public override bool Configure(NES.EDetectionOrigin origin)
{
//configure
switch (Cart.board_type)
{
case "SUNSOFT-1":
@ -38,37 +38,37 @@ Other chips used: Sunsoft-1
default:
return false;
}
chr_mask = (Cart.chr_size / 4) - 1;
SetMirrorType(Cart.pad_h, Cart.pad_v);
return true;
}
chr_mask = (Cart.chr_size / 4) - 1;
SetMirrorType(Cart.pad_h, Cart.pad_v);
return true;
}
public override byte ReadPPU(int addr)
{
if (addr < 0x1000)
{
return VROM[(addr & 0xFFF) + (left_piece*0x1000)];
}
else if (addr < 0x2000)
{
return VROM[(addr & 0xFFF) + (right_piece * 0x1000)];
}
public override byte ReadPPU(int addr)
{
return base.ReadPPU(addr);
}
if (addr < 0x1000)
{
return VROM[(addr & 0xFFF) + (left_piece * 0x1000)];
}
else if (addr < 0x2000)
{
return VROM[(addr & 0xFFF) + (right_piece * 0x1000)];
}
public override void WriteWRAM(int addr, byte value)
{
left_piece = value & 7 & chr_mask;
right_piece = (value >> 4) & 7 & chr_mask;
}
return base.ReadPPU(addr);
}
public override void WriteWRAM(int addr, byte value)
{
left_piece = value & 7 & chr_mask;
right_piece = (value >> 4) & 7 & chr_mask;
}
public override void SyncState(Serializer ser)
{
{
base.SyncState(ser);
ser.Sync("left_piece", ref left_piece);
ser.Sync("right_piece", ref right_piece);
}
}
ser.Sync("left_piece", ref left_piece);
ser.Sync("right_piece", ref right_piece);
}
}
}

View File

@ -0,0 +1,59 @@
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
class Sunsoft3 : NES.NESBoardBase
{
int chr, prg;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "SUNSOFT-3":
break;
default:
return false;
}
SetMirrorType(Cart.pad_h, Cart.pad_v);
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("chr", ref chr);
ser.Sync("prg", ref prg);
}
public override void WritePRG(int addr, byte value)
{
if (value.Bit(3))
SetMirrorType(EMirrorType.OneScreenA);
else
SetMirrorType(EMirrorType.OneScreenB);
chr = ((value & 0x07) + (value >> 7 * 0x07));
prg = (value >> 4) & 7;
}
public override byte ReadPRG(int addr)
{
if (addr < 0x4000)
return ROM[addr + (prg * 0x4000)];
else
return base.ReadPRG(addr);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
return VROM[(addr & 0x1FFF) + (chr * 0x2000)];
else
return base.ReadPPU(addr);
}
}
}