Implement main memory domain for NES

This commit is contained in:
andres.delikat 2011-03-05 03:03:47 +00:00
parent a36f39f993
commit 83a8712d5d
3 changed files with 38 additions and 23 deletions

View File

@ -443,17 +443,26 @@ namespace BizHawk.Emulation.Consoles.Nintendo
set { } set { }
} }
private IList<MemoryDomain> memoryDomains;
private void SetupMemoryDomains()
{
var domains = new List<MemoryDomain>(6);
var MainMemoryDomain = new MemoryDomain("Main RAM", ram.Length, Endian.Little,
addr => ram[addr & 0x07FF], (addr, value) => ram[addr & 0x07FF] = value);
//System bus
//PPU 2000-3FFF
//APU 4000-5FFF
//WRAM 6000-7FFF
//PRG RAM 8000-FFFF
domains.Add(MainMemoryDomain);
memoryDomains = domains.AsReadOnly();
}
public string SystemId { get { return "NES"; } } public string SystemId { get { return "NES"; } }
public IList<MemoryDomain> MemoryDomains { get { return new List<MemoryDomain>(); } } public IList<MemoryDomain> MemoryDomains { get { return memoryDomains; } }
public MemoryDomain MainMemory public MemoryDomain MainMemory { get { return memoryDomains[0]; } }
{
get
{
return new MemoryDomain("x", 8, Endian.Little,
addr => 0,
(addr, value) => { });
}
}
public object Query(EmulatorQuery query) public object Query(EmulatorQuery query)
@ -716,10 +725,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo
romInfo.VROM = new byte[romInfo.CHR_Size * 8 * 1024]; romInfo.VROM = new byte[romInfo.CHR_Size * 8 * 1024];
Array.Copy(file, 16 + romInfo.ROM.Length, romInfo.VROM, 0, romInfo.VROM.Length); Array.Copy(file, 16 + romInfo.ROM.Length, romInfo.VROM, 0, romInfo.VROM.Length);
} }
} }
HardReset(); HardReset();
SetupMemoryDomains();
} }
public void SaveStateText(TextWriter writer) public void SaveStateText(TextWriter writer)

View File

@ -29,7 +29,7 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.PalettesGroups = new System.Windows.Forms.GroupBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // groupBox1
@ -41,21 +41,21 @@
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "Pattern Tables"; this.groupBox1.Text = "Pattern Tables";
// //
// groupBox2 // PalettesGroups
// //
this.groupBox2.Location = new System.Drawing.Point(12, 262); this.PalettesGroups.Location = new System.Drawing.Point(12, 262);
this.groupBox2.Name = "groupBox2"; this.PalettesGroups.Name = "PalettesGroups";
this.groupBox2.Size = new System.Drawing.Size(415, 84); this.PalettesGroups.Size = new System.Drawing.Size(415, 84);
this.groupBox2.TabIndex = 1; this.PalettesGroups.TabIndex = 1;
this.groupBox2.TabStop = false; this.PalettesGroups.TabStop = false;
this.groupBox2.Text = "Palettes"; this.PalettesGroups.Text = "Palettes";
// //
// NESPPU // NESPPU
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(443, 359); this.ClientSize = new System.Drawing.Size(443, 359);
this.Controls.Add(this.groupBox2); this.Controls.Add(this.PalettesGroups);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Name = "NESPPU"; this.Name = "NESPPU";
this.Text = "PPU Viewer"; this.Text = "PPU Viewer";
@ -67,6 +67,6 @@
#endregion #endregion
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox PalettesGroups;
} }
} }

View File

@ -6,6 +6,7 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Emulation.Consoles.Nintendo;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
@ -16,9 +17,14 @@ namespace BizHawk.MultiClient
InitializeComponent(); InitializeComponent();
} }
public void UpdateValues()
{
if (!(Global.Emulator is NES)) return;
}
private void NESPPU_Load(object sender, EventArgs e) private void NESPPU_Load(object sender, EventArgs e)
{ {
} }
} }
} }