[NES] rename NTARAM to CIRAM, and change output to 256x240 instead of 256x256

This commit is contained in:
zeromus 2011-03-02 04:11:46 +00:00
parent e3cf8aae28
commit a236477c5b
2 changed files with 10 additions and 10 deletions

View File

@ -132,7 +132,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
} }
else else
{ {
NES.NTARAM[ApplyMirroring(addr)] = value; NES.CIRAM[ApplyMirroring(addr)] = value;
} }
} }
@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
} }
else else
{ {
return NES.NTARAM[ApplyMirroring(addr)]; return NES.CIRAM[ApplyMirroring(addr)];
} }
} }
@ -158,7 +158,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
INESBoard board; INESBoard board;
public PPU ppu; public PPU ppu;
byte[] ram; byte[] ram;
protected byte[] NTARAM; protected byte[] CIRAM;
int cpu_accumulate; int cpu_accumulate;
//user configuration //user configuration
@ -272,9 +272,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo
public int[] GetVideoBuffer() public int[] GetVideoBuffer()
{ {
int[] pixels = new int[256 * 256]; int[] pixels = new int[256 * 240];
int i = 0; int i = 0;
for (int y = 0; y < 256; y++) for (int y = 0; y < 240; y++)
for (int x = 0; x < 256; x++) for (int x = 0; x < 256; x++)
{ {
int pixel = emu.ppu.xbuf[i]; int pixel = emu.ppu.xbuf[i];
@ -290,7 +290,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
return pixels; return pixels;
} }
public int BufferWidth { get { return 256; } } public int BufferWidth { get { return 256; } }
public int BufferHeight { get { return 256; } } public int BufferHeight { get { return 240; } }
public int BackgroundColor { get { return 0; } } public int BackgroundColor { get { return 0; } }
} }
public IVideoProvider VideoProvider { get { return new MyVideoProvider(this); } } public IVideoProvider VideoProvider { get { return new MyVideoProvider(this); } }
@ -401,7 +401,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
cpu.WriteMemory = WriteMemory; cpu.WriteMemory = WriteMemory;
ppu = new PPU(this); ppu = new PPU(this);
ram = new byte[0x800]; ram = new byte[0x800];
NTARAM = new byte[0x800]; CIRAM = new byte[0x800];
ports = new IPortDevice[2]; ports = new IPortDevice[2];
ports[0] = new JoypadPortDevice(this); ports[0] = new JoypadPortDevice(this);
ports[1] = new NullPortDevice(); ports[1] = new NullPortDevice();
@ -728,7 +728,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
Util.WriteByteBuffer(bw, System.Text.Encoding.ASCII.GetBytes(sw.ToString())); Util.WriteByteBuffer(bw, System.Text.Encoding.ASCII.GetBytes(sw.ToString()));
} }
Util.WriteByteBuffer(bw, ram); Util.WriteByteBuffer(bw, ram);
Util.WriteByteBuffer(bw, NTARAM); Util.WriteByteBuffer(bw, CIRAM);
bw.Write(cpu_accumulate); bw.Write(cpu_accumulate);
board.SaveStateBinary(bw); board.SaveStateBinary(bw);
ppu.SaveStateBinary(bw); ppu.SaveStateBinary(bw);
@ -740,7 +740,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
using (var sr = new StringReader(System.Text.Encoding.ASCII.GetString(Util.ReadByteBuffer(br, false)))) using (var sr = new StringReader(System.Text.Encoding.ASCII.GetString(Util.ReadByteBuffer(br, false))))
cpu.LoadStateText(sr); cpu.LoadStateText(sr);
ram = Util.ReadByteBuffer(br, false); ram = Util.ReadByteBuffer(br, false);
NTARAM = Util.ReadByteBuffer(br, false); CIRAM = Util.ReadByteBuffer(br, false);
cpu_accumulate = br.ReadInt32(); cpu_accumulate = br.ReadInt32();
board.LoadStateBinary(br); board.LoadStateBinary(br);
ppu.LoadStateBinary(br); ppu.LoadStateBinary(br);

View File

@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
public byte pt_0, pt_1; public byte pt_0, pt_1;
}; };
public short[] xbuf = new short[256*256]; public short[] xbuf = new short[256*240];
void Read_bgdata(ref BGDataRecord bgdata) { void Read_bgdata(ref BGDataRecord bgdata) {
int addr = ppur.get_ntread(); int addr = ppur.get_ntread();