Remove the 2 dead gameboy cores

This commit is contained in:
beirich 2012-09-09 01:31:30 +00:00
parent 7962c6d2cd
commit e8de0327d2
19 changed files with 23 additions and 2889 deletions

View File

@ -111,11 +111,7 @@
<Compile Include="Consoles\Coleco\VDP.ModeTMS.cs" />
<Compile Include="Consoles\Coleco\VDP.Tables.cs" />
<Compile Include="Consoles\Gambatte\Gambatte.cs" />
<Compile Include="Consoles\GB\Graphics.cs" />
<Compile Include="Consoles\GB\Input.cs" />
<Compile Include="Consoles\Gambatte\LibGambatte.cs" />
<Compile Include="Consoles\GB\MemoryMap.cs" />
<Compile Include="Consoles\GB\GB.cs" />
<Compile Include="Consoles\Intellivision\Cartridge.cs" />
<Compile Include="Consoles\Intellivision\ICart.cs" />
<Compile Include="Consoles\Intellivision\Intellicart.cs" />
@ -312,10 +308,6 @@
<Compile Include="CPUs\Z80\Registers.cs" />
<Compile Include="CPUs\Z80\Tables.cs" />
<Compile Include="CPUs\Z80\Z80A.cs" />
<Compile Include="Consoles\Gameboy\Bios.cs" />
<Compile Include="Consoles\Gameboy\Gameboy.cs" />
<Compile Include="Consoles\Gameboy\Input.cs" />
<Compile Include="Consoles\Gameboy\Mappers.cs" />
<Compile Include="Database\CRC32.cs" />
<Compile Include="Database\Database.cs" />
<Compile Include="Database\GameInfo.cs" />

View File

@ -1,93 +0,0 @@
using System;
using System.Collections.Generic;
using BizHawk.Emulation.CPUs.Z80GB;
/*
This Game Boy core was written using Imran Nazar's "GameBoy Emulation in
Javascript" series (http://imrannazar.com/GameBoy-Emulation-in-JavaScript) and
contains several comments from the articles.
*/
namespace BizHawk.Emulation.Consoles.GB
{
public partial class GB : IEmulator, IVideoProvider
{
private Z80 CPU;
private int lagCount = 0;
private bool isLagFrame = false;
private IList<MemoryDomain> memoryDomains = new List<MemoryDomain>();
public GB(GameInfo game, byte[] rom, bool skipBIOS)
{
inBIOS = !skipBIOS;
HardReset();
}
public int VirtualWidth { get { return 160; } }
public int BufferWidth { get { return 160; } }
public int BufferHeight { get { return 144; } }
public int BackgroundColor { get { return 0; } }
public CoreInputComm CoreInputComm { get; set; }
public CoreOutputComm CoreOutputComm { get; private set; }
public bool DeterministicEmulation { get; set; }
public void Dispose() { }
public int Frame { get; set; }
public void FrameAdvance(bool render)
{
throw new NotImplementedException();
}
public void HardReset()
{
CPU = new CPUs.Z80GB.Z80();
CPU.ReadMemory = ReadMemory;
CPU.WriteMemory = WriteMemory;
}
public int[] GetVideoBuffer()
{
throw new NotImplementedException();
}
public IList<MemoryDomain> MemoryDomains { get { return memoryDomains; } }
public bool IsLagFrame { get { return isLagFrame; } }
public int LagCount { get { return lagCount; } set { lagCount = value; } }
public void LoadStateBinary(System.IO.BinaryReader reader)
{
throw new NotImplementedException();
}
public void LoadStateText(System.IO.TextReader reader)
{
throw new NotImplementedException();
}
public MemoryDomain MainMemory { get { return memoryDomains[0]; } }
public void ResetFrameCounter()
{
Frame = 0;
}
public byte[] ReadSaveRam { get { throw new NotImplementedException(); } }
public bool SaveRamModified { get { return false; } set { } }
public void SaveStateBinary(System.IO.BinaryWriter writer)
{
throw new NotImplementedException();
}
public byte[] SaveStateBinary()
{
return new byte[0];
}
public void SaveStateText(System.IO.TextWriter writer)
{
throw new NotImplementedException();
}
public ISoundProvider SoundProvider { get { return new NullEmulator(); } }
public string SystemId { get { return "GB"; } }
public IVideoProvider VideoProvider { get { return this; } }
}
}

View File

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.GB
{
public partial class GB
{
private byte[] OAM = new byte[1];
private byte[] VRAM = new byte[1];
}
}

View File

@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.GB
{
public partial class GB
{
public static readonly ControllerDefinition GbController = new ControllerDefinition
{
Name = "Gameboy Controller",
BoolButtons =
{
"Up", "Down", "Left", "Right", "A", "B", "Select", "Start"
}
};
public ControllerDefinition ControllerDefinition { get { return GbController; } }
public IController Controller { get; set; }
}
}

View File

@ -1,239 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.GB
{
public partial class GB
{
// Flag indicating ig BIOS is mapped in.
private bool inBIOS = true;
// Memory regions (initialised at reset time)
private byte[] BIOS = new byte[1];
private byte[] ROM = new byte[1];
private byte[] WRAM = new byte[1];
private byte[] ERAM = new byte[1];
private byte[] ZRAM = new byte[1];
public byte ReadMemory(ushort addr)
{
switch (addr & 0xF000)
{
/*
[0000-3FFF] Cartridge ROM, bank 0: The first 16,384 bytes of
the cartridge program are always available at this point in the
memory map. Special circumstances apply.
*/
case 0x0000:
/*
[0000-0100] BIOS: When the CPU starts up, PC starts at
0000h, which is the start of the 256-byte GameBoy BIOS
code. Once the BIOS has run, it is removed from the memory
map, and this area of the cartridge rom becomes
addressable.
*/
if (inBIOS)
{
if (addr < 0x0100)
return BIOS[addr];
else if (addr == 0x0100)
inBIOS = false;
}
/*
[0100-014F] Cartridge header: This section of the cartridge
contains data about its name and manufacturer, and must be
written in a specific format.
*/
return ROM[addr];
case 0x1000:
case 0x2000:
case 0x3000:
return ROM[addr];
/*
[4000-7FFF] Cartridge ROM, other banks: Any subsequent 16k
"banks" of the cartridge program can be made available to the
CPU here, one by one; a chip on the cartridge is generally used
to switch between banks, and make a particular area accessible.
The smallest programs are 32k, which means that no
bank-selection chip is required.
*/
case 0x4000:
case 0x5000:
case 0x6000:
case 0x7000:
return ROM[addr];
/*
[8000-9FFF] Graphics RAM: Data required for the backgrounds and
sprites used by the graphics subsystem is held here, and can be
changed by the cartridge program.
*/
case 0x8000:
case 0x9000:
return VRAM[addr & 0x1FFF];
/*
[A000-BFFF] Cartridge (External) RAM: There is a small amount
of writeable memory available in the GameBoy; if a game is
produced that requires more RAM than is available in the
hardware, additional 8k chunks of RAM can be made addressable
here.
*/
case 0xA000:
case 0xB000:
return ERAM[addr & 0x1FFF];
/*
[C000-DFFF] Working RAM: The GameBoy's internal 8k of RAM,
which can be read from or written to by the CPU.
*/
case 0xC000:
case 0xD000:
return WRAM[addr & 0x1FFF];
/*
[E000-FDFF] Working RAM (shadow): Due to the wiring of the
GameBoy hardware, an exact copy of the working RAM is available
8k higher in the memory map. This copy is available up until
the last 512 bytes of the map, where other areas are brought
into access.
*/
case 0xE000:
return WRAM[addr & 0x1FFF];
case 0xF000:
switch (addr & 0x0F00)
{
case 0x000:
case 0x100:
case 0x200:
case 0x300:
case 0x400:
case 0x500:
case 0x600:
case 0x700:
case 0x800:
case 0x900:
case 0xA00:
case 0xB00:
case 0xC00:
case 0xD00:
return WRAM[addr & 0x1FFF];
/*
[FE00-FE9F] Graphics: sprite information: Data about
the sprites rendered by the graphics chip are held
here, including the sprites' positions and attributes.
*/
case 0xE00:
// OAM is 160 bytes, remaining bytes read as 0.
if (addr < 0xFEA0)
return OAM[addr & 0xFF];
else
return 0;
case 0xF00:
/*
[FF00-FF7F] Memory-mapped I/O: Each of the
GameBoy's subsystems (graphics, sound, etc.) has
control values, to allow programs to create effects
and use the hardware. These values are available to
the CPU directly on the address bus, in this area.
*/
if (addr < 0xFF80)
throw new NotImplementedException();
/*
[FF80-FFFF] Zero-page RAM: A high-speed area of 128
bytes of RAM is available at the top of memory.
Oddly, though this is "page" 255 of the memory, it
is referred to as page zero, since
most of the interaction between the program and
the GameBoy hardware occurs through use of this
page of memory.
*/
else
return ZRAM[addr & 0x7F];
default:
throw new ArgumentException();
}
default:
throw new ArgumentException();
}
}
public void WriteMemory(ushort addr, byte val)
{
// Writing is the same as reading with the operations reversed.
switch (addr & 0xF000)
{
case 0x0000:
if (inBIOS)
{
if (addr < 0x0100)
{
BIOS[addr] = val;
break;
}
else if (addr == 0x0100)
inBIOS = false;
}
ROM[addr] = val;
break;
case 0x1000:
case 0x2000:
case 0x3000:
ROM[addr] = val;
break;
case 0x4000:
case 0x5000:
case 0x6000:
case 0x7000:
ROM[addr] = val;
break;
case 0x8000:
case 0x9000:
VRAM[addr & 0x1FFF] = val;
break;
case 0xA000:
case 0xB000:
ERAM[addr & 0x1FFF] = val;
break;
case 0xC000:
case 0xD000:
WRAM[addr & 0x1FFF] = val;
break;
case 0xE000:
WRAM[addr & 0x1FFF] = val;
break;
case 0xF000:
switch (addr & 0x0F00)
{
case 0x000:
case 0x100:
case 0x200:
case 0x300:
case 0x400:
case 0x500:
case 0x600:
case 0x700:
case 0x800:
case 0x900:
case 0xA00:
case 0xB00:
case 0xC00:
case 0xD00:
WRAM[addr & 0x1FFF] = val;
break;
case 0xE00:
if (addr < 0xFEA0)
OAM[addr & 0xFF] = val;
break;
case 0xF00:
if (addr < 0xFF80)
throw new NotImplementedException();
else
{
ZRAM[addr & 0x7F] = val;
break;
}
}
break;
}
}
}
}

View File

@ -1,25 +0,0 @@
namespace BizHawk.Emulation.Consoles.Gameboy
{
public partial class Gameboy
{
public static readonly byte[] Bios =
{
0x31, 0xFE, 0xFF, 0xAF, 0x21, 0xFF, 0x9F, 0x32, 0xCB, 0x7C, 0x20, 0xFB, 0x21, 0x26, 0xFF, 0x0E,
0x11, 0x3E, 0x80, 0x32, 0xE2, 0x0C, 0x3E, 0xF3, 0xE2, 0x32, 0x3E, 0x77, 0x77, 0x3E, 0xFC, 0xE0,
0x47, 0x11, 0x04, 0x01, 0x21, 0x10, 0x80, 0x1A, 0xCD, 0x95, 0x00, 0xCD, 0x96, 0x00, 0x13, 0x7B,
0xFE, 0x34, 0x20, 0xF3, 0x11, 0xD8, 0x00, 0x06, 0x08, 0x1A, 0x13, 0x22, 0x23, 0x05, 0x20, 0xF9,
0x3E, 0x19, 0xEA, 0x10, 0x99, 0x21, 0x2F, 0x99, 0x0E, 0x0C, 0x3D, 0x28, 0x08, 0x32, 0x0D, 0x20,
0xF9, 0x2E, 0x0F, 0x18, 0xF3, 0x67, 0x3E, 0x64, 0x57, 0xE0, 0x42, 0x3E, 0x91, 0xE0, 0x40, 0x04,
0x1E, 0x02, 0x0E, 0x0C, 0xF0, 0x44, 0xFE, 0x90, 0x20, 0xFA, 0x0D, 0x20, 0xF7, 0x1D, 0x20, 0xF2,
0x0E, 0x13, 0x24, 0x7C, 0x1E, 0x83, 0xFE, 0x62, 0x28, 0x06, 0x1E, 0xC1, 0xFE, 0x64, 0x20, 0x06,
0x7B, 0xE2, 0x0C, 0x3E, 0x87, 0xF2, 0xF0, 0x42, 0x90, 0xE0, 0x42, 0x15, 0x20, 0xD2, 0x05, 0x20,
0x4F, 0x16, 0x20, 0x18, 0xCB, 0x4F, 0x06, 0x04, 0xC5, 0xCB, 0x11, 0x17, 0xC1, 0xCB, 0x11, 0x17,
0x05, 0x20, 0xF5, 0x22, 0x23, 0x22, 0x23, 0xC9, 0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B,
0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D, 0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E,
0xDC, 0xCC, 0x6E, 0xE6, 0xDD, 0xDD, 0xD9, 0x99, 0xBB, 0xBB, 0x67, 0x63, 0x6E, 0x0E, 0xEC, 0xCC,
0xDD, 0xDC, 0x99, 0x9F, 0xBB, 0xB9, 0x33, 0x3E, 0x3c, 0x42, 0xB9, 0xA5, 0xB9, 0xA5, 0x42, 0x4C,
0x21, 0x04, 0x01, 0x11, 0xA8, 0x00, 0x1A, 0x13, 0xBE, 0x20, 0xFE, 0x23, 0x7D, 0xFE, 0x34, 0x20,
0xF5, 0x06, 0x19, 0x78, 0x86, 0x23, 0x05, 0x20, 0xFB, 0x86, 0x20, 0xFE, 0x3E, 0x01, 0xE0, 0x50
};
}
}

View File

@ -1,972 +0,0 @@
using System;
using System.Collections.Generic;
using BizHawk.Emulation.CPUs.Z80GB;
namespace BizHawk.Emulation.Consoles.Gameboy
{
public partial class Gameboy : IEmulator, IVideoProvider
{
private bool skipBIOS = false;
private int _lagcount = 0;
private bool islag = false;
public interface IDebuggerAPI
{
void DoEvents();
}
public IDebuggerAPI DebuggerAPI;
public enum ECartType
{
ROM_ONLY = 0x00,
ROM_MBC1 = 0x01,
ROM_MBC1_RAM = 0x02,
ROM_MBC1_RAM_BATT = 0x03,
ROM_MBC2 = 0x05,
ROM_MBC2_BATTERY = 0x06,
ROM_RAM = 0x08,
ROM_RAM_BATTERY = 0x09,
ROM_MMM01 = 0x0B,
ROM_MMM01_SRAM = 0x0C,
ROM_MMM01_SRAM_BATT = 0x0D,
ROM_MBC3_TIMER_BATT = 0x0F,
ROM_MBC3_TIMER_RAM_BATT = 0x10,
ROM_MBC3 = 0x11,
ROM_MBC3_RAM = 0x12,
ROM_MBC3_RAM_BATT = 0x13,
ROM_MBC5 = 0x19,
ROM_MBC5_RAM = 0x1A,
ROM_MBC5_RAM_BATT = 0x1B,
ROM_MBC5_RUMBLE = 0x1C,
ROM_MBC5_RUMBLE_SRAM = 0x1D,
ROM_MBC5_RUMBLE_SRAM_BATT = 0x1E,
PocketCamera = 0x1F,
Bandai_TAMA5 = 0xFD,
Hudson_HuC_3 = 0xFE,
Hudson_HuC_1 = 0xFF,
}
public enum ESystemType
{
GB, //original gameboy
GBP, //gameboy pocket
GBC, //gameboy color
SGB, //super gameboy
GBA, //gameboy advance (emulating old hardware)
}
public ECartType CartType;
public ESystemType SystemType;
public struct TCartFlags
{
public bool GBC; //cart indicates itself as GBC aware
public bool SGB; //cart indicates itself as SGB aware
}
public TCartFlags CartFlags = new TCartFlags();
static byte SetBit8(byte variable, int bit, bool val)
{
int mask = 1 << bit;
int temp = variable;
temp &= ~mask;
if (val) temp |= mask;
return (byte)temp;
}
static byte SetBit8(byte variable, int bit, int val)
{
return SetBit8(variable, bit, val != 0);
}
static bool GetBit8(byte variable, int bit)
{
return (variable & (1 << bit)) != 0;
}
public class TRegisters
{
Gameboy gb;
public TRegisters(Gameboy gb)
{
this.gb = gb;
STAT = new TSTAT(gb);
}
public bool BiosMapped = true;
public class TLCDC
{
byte val;
public bool Enabled { get { return GetBit8(val, 7); } set { val = SetBit8(val, 7, value); } }
public ETileMap WindowTileMap { get { return GetBit8(val, 6) ? ETileMap.Region_9C00_9FFF : ETileMap.Region_9800_9BFF; } set { val = SetBit8(val, 6, (int)value); } }
public ushort WindowTileMapAddr { get { return GetTileMapAddrFor(WindowTileMap); } }
public bool WindowDisplay { get { return GetBit8(val, 5); } set { val = SetBit8(val, 5, value); } }
public ETileData TileData { get { return GetBit8(val, 4) ? ETileData.Region_8000_8FFF : ETileData.Region_8800_97FF; } set { val = SetBit8(val, 4, (int)value); } }
public ushort TileDataAddr { get { return GetTileDataAddrFor(TileData); } }
public ETileMap BgTileMap { get { return GetBit8(val, 3) ? ETileMap.Region_9C00_9FFF : ETileMap.Region_9800_9BFF; } set { val = SetBit8(val, 3, (int)value); } }
public ushort BgTileMapAddr { get { return GetTileMapAddrFor(BgTileMap); } }
public EObjSize ObjSize { get { return GetBit8(val, 2) ? EObjSize.ObjSize_8x16 : EObjSize.ObjSize_8x8; } set { val = SetBit8(val, 2, (int)value); } }
public bool ObjEnabled { get { return GetBit8(val, 1); } set { val = SetBit8(val, 1, value); } }
public bool BgEnabled { get { return GetBit8(val, 0); } set { val = SetBit8(val, 0, value); } }
public byte Read() { return val; }
public void Write(byte value) { val = value; }
public void Poke(byte value) { val = value; }
public enum ETileMap
{
Region_9800_9BFF = 0,
Region_9C00_9FFF = 1,
}
public enum ETileData
{
Region_8800_97FF = 0,
Region_8000_8FFF = 1,
}
public ushort GetTileMapAddrFor(ETileMap tm) { return (ushort)(tm == ETileMap.Region_9800_9BFF ? 0x9800 : 0x9C00); }
public ushort GetTileDataAddrFor(ETileData tm) { return (ushort)(tm == ETileData.Region_8800_97FF ? 0x8800 : 0x8000); }
public enum EObjSize
{
ObjSize_8x8 = 0,
ObjSize_8x16 = 1,
}
}
public TLCDC LCDC = new TLCDC();
public byte SCY, SCX;
public class TSTAT
{
readonly Gameboy gb;
public TSTAT(Gameboy gb) { this.gb = gb; }
public byte Read()
{
//TODO (not done yet)
int mode;
if (gb.Registers.Timing.line >= 160) mode = 1;
else if (gb.Registers.Timing.dot < 80) mode = 2;
else if (gb.Registers.Timing.dot < 172 + 80) mode = 3;
else mode = 0;
return (byte)mode;
}
}
public TSTAT STAT;
public class TTiming
{
public int frame;
public int line;
public int dot;
}
public TTiming Timing = new TTiming();
public class TInput
{
public bool up, down, left, right, a, b, select, start;
int val;
public void Write(byte value)
{
val = value & 0x30;
}
public byte Read()
{
if ((val & 0x10) == 0)
{
int ret = SetBit8(0, 0, right) | SetBit8(0, 1, left) | SetBit8(0, 2, up) | SetBit8(0, 3, down);
return (byte)(~ret);
}
else if ((val & 0x10) == 0)
{
int ret = SetBit8(0, 0, a) | SetBit8(0, 1, b) | SetBit8(0, 2, select) | SetBit8(0, 3, start);
return (byte)(~ret);
}
else return 0xFF;
//TODO return system type???
}
}
public TInput Input = new TInput();
public byte Read_LY() { return (byte)Timing.line; }
};
public TRegisters Registers;
public void SingleStepInto()
{
Cpu.TotalExecutedCycles = 0;
Cpu.SingleStepInto();
int elapsed = Cpu.TotalExecutedCycles;
Timekeeping(elapsed);
}
public bool DebugBreak;
public void RunForever()
{
int sanity = 0;
for (; ; )
{
SingleStepInto();
sanity++;
if (sanity == 100000)
{
if (DebuggerAPI != null) DebuggerAPI.DoEvents();
if (DebugBreak) break;
sanity = 0;
}
}
DebugBreak = false;
}
public void Timekeeping(int elapsed)
{
Registers.Timing.dot += elapsed;
if (Registers.Timing.dot >= 456)
{
Registers.Timing.line++;
Registers.Timing.dot -= 456;
}
if (Registers.Timing.line > 153)
{
Registers.Timing.frame++;
Registers.Timing.line = 0;
}
}
public void DetachBios()
{
Registers.BiosMapped = false;
Cpu.ReadMemory = ReadMemory;
}
public class TSound
{
public byte[] WavePatternRam = new byte[16];
}
public TSound Sound;
public byte[] Rom;
public byte[] WRam;
public byte[] SRam;
public byte[] VRam;
public byte[] HRam;
public byte[] OAM;
public Z80 Cpu;
public MemoryMapper Mapper;
public Gameboy(GameInfo game, byte[] rom, bool SkipBIOS)
{
skipBIOS = SkipBIOS;
CoreOutputComm = new CoreOutputComm();
CartType = (ECartType)rom[0x0147];
Mapper = new MemoryMapper(this);
Rom = rom;
CartFlags.GBC = Rom[0x0143] == 0x80;
CartFlags.SGB = Rom[0x0146] == 0x03;
HardReset();
}
public void HardReset()
{
Cpu = new CPUs.Z80GB.Z80();
if (skipBIOS)
Cpu.ReadMemory = ReadMemory;
else
Cpu.ReadMemory = ReadMemoryBios;
Cpu.WriteMemory = WriteMemory;
Cpu.Reset();
Cpu.LogData();
//setup initial cpu registers. based on no evidence:
//registers which may be used to identify system type are judged to be important; and
//the initial contents of the stack are judged to be unimportant.
switch (SystemType)
{
case ESystemType.GB:
case ESystemType.SGB:
Cpu.RegisterA = 0x01;
break;
case ESystemType.GBP:
Cpu.RegisterA = 0xFF;
break;
case ESystemType.GBC:
Cpu.RegisterA = 0x11;
break;
case ESystemType.GBA:
throw new NotImplementedException(); //decide what to do
}
Cpu.RegisterF = 0xB0;
if (SystemType == ESystemType.GBA)
Cpu.RegisterB = 0x01;
else Cpu.RegisterB = 0x00;
Cpu.RegisterC = 0x13;
Cpu.RegisterDE = 0x00D8;
Cpu.RegisterHL = 0x014D;
Cpu.RegisterSP = 0xFFFE;
if (skipBIOS) Cpu.RegisterPC = 0x0100;
else Cpu.RegisterPC = 0x0000;
WRam = new byte[32 * 1024]; //GB has 4KB of WRam; GBC has 32KB of WRam
SRam = new byte[8 * 1024]; //different carts may have different amounts of this
VRam = new byte[0x2000];
HRam = new byte[128];
OAM = new byte[0xA0];
Sound = new TSound();
Registers = new TRegisters(this);
Registers.LCDC.Poke(0x91);
SetupMemoryDomains();
}
private IList<MemoryDomain> memoryDomains;
private void SetupMemoryDomains()
{
var domains = new List<MemoryDomain>(1);
var SystemBusDomain = new MemoryDomain("System Bus", 0x10000, Endian.Little,
addr => Cpu.ReadMemory((ushort)addr),
(addr, value) => Cpu.WriteMemory((ushort)addr, value));
var WRAM0Domain = new MemoryDomain("WRAM Bank 0", 0x2000, Endian.Little,
addr => WRam[addr & 0x1FFF],
(addr, value) => WRam[addr & 0x1FFF] = value);
var WRAM1Domain = new MemoryDomain("WRAM Bank 1", 0x2000, Endian.Little,
addr => WRam[(addr & 0x1FFF) + 0x2000],
(addr, value) => WRam[addr & 0x1FFF] = value);
var WRAMADomain = new MemoryDomain("WRAM Bank (All)", 0x8000, Endian.Little,
addr => WRam[addr & 0x7FFF],
(addr, value) => WRam[addr & 0x7FFF] = value); //adelikat: Do we want to check for GBC vs GB and limit this domain accordingly?
var SRAMDomain = new MemoryDomain("SRAM", 0x2000, Endian.Little,
addr => SRam[addr & 0x1FFF],
(addr, value) => OAM[addr & 0x1FFF] = value);
var OAMDomain = new MemoryDomain("OAM", 0x00A0, Endian.Little,
addr => OAM[addr & 0x9F],
(addr, value) => OAM[addr & 0x9F] = value);
var HRAMDomain = new MemoryDomain("HRAM", 0x0080, Endian.Little,
addr => HRam[addr & 0x007F],
(addr, value) => HRam[addr & 0x0080] = value);
var VRAMDomain = new MemoryDomain("VRAM", 0x2000, Endian.Little,
addr => VRam[addr & 0x1FFF],
(addr, value) => VRam[addr & 0x1FFF] = value);
domains.Add(WRAM0Domain);
domains.Add(WRAM1Domain);
domains.Add(WRAMADomain);
domains.Add(SRAMDomain);
domains.Add(VRAMDomain);
domains.Add(OAMDomain);
domains.Add(HRAMDomain);
domains.Add(SystemBusDomain);
memoryDomains = domains.AsReadOnly();
}
public IList<MemoryDomain> MemoryDomains { get { return memoryDomains; } }
public MemoryDomain MainMemory { get { return memoryDomains[0]; } }
public byte ReadMemoryBios(ushort addr)
{
//we speculate that the bios unmaps itself after the first read of 0x100
if (addr < 0x100)
return Bios[addr];
else if (addr == 0x100)
DetachBios();
return ReadMemory(addr);
}
public string DescribeParagraph(ushort addr)
{
//todo - later on, this must say "RO1F" for bank 0x1F and etc.
//and so it must call through to the mapper
if (addr < 0x4000)
return "ROM0";
else if (addr < 0x8000)
return "ROM1";
else if (addr < 0xA000)
return "VRA0";
else if (addr < 0xC000)
return "SRA0";
else if (addr < 0xD000)
return "WRA0";
else if (addr < 0xE000)
return "WRA1";
else if (addr < 0xFE00)
return "ECH0";
else if (addr < 0xFEA0)
return "OAM ";
else if (addr < 0xFF00)
return "----";
else if (addr < 0xFF80)
return "I/O ";
else return "HRAM";
}
public byte ReadMemory(ushort addr)
{
if (addr < 0x8000)
return Rom[addr];
else if (addr < 0xA000)
return VRam[addr - 0x8000];
else if (addr < 0xC000)
return SRam[addr - 0xA000];
else if (addr < 0xD000)
return WRam[addr - 0xC000]; //bank 0 of WRam
else if (addr < 0xE000)
return WRam[addr - 0xC000]; //bank 1 of WRam (needs to be switchable)
else if (addr < 0xFE00)
return ReadMemory((ushort)(addr - 0xE000)); //echo of WRam; unusable; reserved ????
else if (addr < 0xFEA0)
return OAM[addr - 0xFE00];
else if (addr < 0xFF00)
return 0xFF; //"unusable memory"
else if (addr < 0xFF80)
return ReadRegister(addr);
else if (addr < 0xFFFF)
return HRam[addr - 0xFF80];
else return ReadRegister(addr);
}
public byte ReadRegister(ushort addr)
{
switch (addr)
{
case 0xFF00: //REG_P1 - Register for reading joy pad info and determining system type. (R/W)
return Registers.Input.Read();
case 0xFF01: //REG_SB - Serial transfer data (R/W)
return 0xFF;
case 0xFF02: //REG_SC - SIO control (R/W)
return 0xFF;
case 0xFF04: //REG_DIV - Divider Register (R/W)
return 0xFF;
case 0xFF05: //REG_TIMA - Timer counter (R/W)
return 0xFF;
case 0xFF06: //REG_TMA - Timer Modulo (R/W)
return 0xFF;
case 0xFF07: //REG_TAC - Timer Control (R/W)
return 0xFF;
case 0xFF0F: //REG_IF - Interrupt Flag (R/W)
return 0xFF;
case 0xFF10: //REG_NR10 - Sound Mode 1 register, Sweep register (R/W)
return 0xFF;
case 0xFF11: //REG_NR11 - Sound Mode 1 register, Sound length/Wave pattern duty (R/W)
return 0xFF;
case 0xFF12: //REG_NR12 - Sound Mode 1 register, Envelope (R/W)
return 0xFF;
case 0xFF13: //REG_NR13 - Sound Mode 1 register, Frequency lo (W)
return 0xFF;
case 0xFF14: //REG_NR14 - Sound Mode 1 register, Frequency hi (R/W)
return 0xFF;
//0xFF15 ???????????????
case 0xFF16: //REG_NR21 - Sound Mode 2 register, Sound Length; Wave Pattern Duty (R/W)
return 0xFF;
case 0xFF17: //REG_NR22 - Sound Mode 2 register, envelope (R/W)
return 0xFF;
case 0xFF18: //REG_NR23 - Sound Mode 2 register, frequency lo data (W)
return 0xFF;
case 0xFF19: //REG_NR24 - Sound Mode 2 register, frequency hi data (R/W)
return 0xFF;
case 0xFF1A: //REG_NR30 - Sound Mode 3 register, Sound on/off (R/W)
return 0xFF;
case 0xFF1B: //REG_NR31 - Sound Mode 3 register, sound length (R/W)
return 0xFF;
case 0xFF1C: //REG_NR32 - Sound Mode 3 register, Select output level (R/W)
return 0xFF;
case 0xFF1D: //REG_NR33 - Sound Mode 3 register, frequency's lower data (W)
return 0xFF;
case 0xFF1E: //REG_NR34 - Sound Mode 3 register, frequency's higher data (R/W)
return 0xFF;
//0xFF1F ???????????????
case 0xFF20: //REG_NR41 - Sound Mode 4 register, sound length (R/W)
return 0xFF;
case 0xFF21: //REG_NR42 - Sound Mode 4 register, envelope (R/W)
return 0xFF;
case 0xFF22: //REG_NR43 - Sound Mode 4 register, polynomial counter (R/W)
return 0xFF;
case 0xFF23: //REG_NR44 - Sound Mode 4 register, counter/consecutive; inital (R/W)
return 0xFF;
case 0xFF24: //REG_NR50 - Channel control / ON-OFF / Volume (R/W)
return 0xFF;
case 0xFF25: //REG_NR51 - Selection of Sound output terminal (R/W)
return 0xFF;
case 0xFF26: //REG_NR52 - Sound on/off (R/W) (Value at reset: $F1-GB, $F0-SGB)
return 0xFF;
case 0xFF30: return Sound.WavePatternRam[0x00];
case 0xFF31: return Sound.WavePatternRam[0x01];
case 0xFF32: return Sound.WavePatternRam[0x02];
case 0xFF33: return Sound.WavePatternRam[0x03];
case 0xFF34: return Sound.WavePatternRam[0x04];
case 0xFF35: return Sound.WavePatternRam[0x05];
case 0xFF36: return Sound.WavePatternRam[0x06];
case 0xFF37: return Sound.WavePatternRam[0x07];
case 0xFF38: return Sound.WavePatternRam[0x08];
case 0xFF39: return Sound.WavePatternRam[0x09];
case 0xFF3A: return Sound.WavePatternRam[0x0A];
case 0xFF3B: return Sound.WavePatternRam[0x0B];
case 0xFF3C: return Sound.WavePatternRam[0x0C];
case 0xFF3D: return Sound.WavePatternRam[0x0D];
case 0xFF3E: return Sound.WavePatternRam[0x0E];
case 0xFF3F: return Sound.WavePatternRam[0x0F];
case 0xFF40: //REG_LCDC - LCD Control (R/W) (value $91 at reset)
return Registers.LCDC.Read();
case 0xFF41: //REG_STAT - LCDC Status (R/W)
return Registers.STAT.Read();
case 0xFF42: //REG_SCY - Scroll Y (R/W)
return Registers.SCY;
case 0xFF43: //REG_SCX - Scroll X (R/W)
return Registers.SCX;
case 0xFF44: //REG_LY - LCDC Y-Coordinate (R)
return Registers.Read_LY();
case 0xFF45: //REG_LYC - LY Compare (R/W)
return 0xFF;
case 0xFF46: //REG_DMA - DMA Transfer and Start Address (W)
return 0xFF;
case 0xFF47: //REG_BGP - BG & Window Palette Data (R/W)
return 0xFF;
case 0xFF48: //REG_OBP0 - Object Palette 0 Data (R/W)
return 0xFF;
case 0xFF49: //REG_OBP1 - Object Palette 1 Data (R/W)
return 0xFF;
case 0xFF4A: //REG_WY - Window Y Position (R/W)
return 0xFF;
case 0xFF4B: //REG_WX - Window X Position (R/W)
return 0xFF;
case 0xFFFF: //REG_IE
return 0xFF;
default:
return 0xFF;
}
}
public void WriteRegister(ushort addr, byte value)
{
switch (addr)
{
case 0xFF00: //REG_P1 - Register for reading joy pad info and determining system type. (R/W)
Registers.Input.Write(value);
break;
case 0xFF01: //REG_SB - Serial transfer data (R/W)
return;
case 0xFF02: //REG_SC - SIO control (R/W)
return;
case 0xFF04: //REG_DIV - Divider Register (R/W)
return;
case 0xFF05: //REG_TIMA - Timer counter (R/W)
return;
case 0xFF06: //REG_TMA - Timer Modulo (R/W)
return;
case 0xFF07: //REG_TAC - Timer Control (R/W)
return;
case 0xFF0F: //REG_IF - Interrupt Flag (R/W)
return;
case 0xFF10: //REG_NR10 - Sound Mode 1 register, Sweep register (R/W)
return;
case 0xFF11: //REG_NR11 - Sound Mode 1 register, Sound length/Wave pattern duty (R/W)
return;
case 0xFF12: //REG_NR12 - Sound Mode 1 register, Envelope (R/W)
return;
case 0xFF13: //REG_NR13 - Sound Mode 1 register, Frequency lo (W)
return;
case 0xFF14: //REG_NR14 - Sound Mode 1 register, Frequency hi (R/W)
return;
//0xFF15 ???????????????
case 0xFF16: //REG_NR21 - Sound Mode 2 register, Sound Length; Wave Pattern Duty (R/W)
return;
case 0xFF17: //REG_NR22 - Sound Mode 2 register, envelope (R/W)
return;
case 0xFF18: //REG_NR23 - Sound Mode 2 register, frequency lo data (W)
return;
case 0xFF19: //REG_NR24 - Sound Mode 2 register, frequency hi data (R/W)
return;
case 0xFF1A: //REG_NR30 - Sound Mode 3 register, Sound on/off (R/W)
return;
case 0xFF1B: //REG_NR31 - Sound Mode 3 register, sound length (R/W)
return;
case 0xFF1C: //REG_NR32 - Sound Mode 3 register, Select output level (R/W)
return;
case 0xFF1D: //REG_NR33 - Sound Mode 3 register, frequency's lower data (W)
return;
case 0xFF1E: //REG_NR34 - Sound Mode 3 register, frequency's higher data (R/W)
return;
//0xFF1F ???????????????
case 0xFF20: //REG_NR41 - Sound Mode 4 register, sound length (R/W)
return;
case 0xFF21: //REG_NR42 - Sound Mode 4 register, envelope (R/W)
return;
case 0xFF22: //REG_NR43 - Sound Mode 4 register, polynomial counter (R/W)
return;
case 0xFF23: //REG_NR44 - Sound Mode 4 register, counter/consecutive; inital (R/W)
return;
case 0xFF24: //REG_NR50 - Channel control / ON-OFF / Volume (R/W)
return;
case 0xFF25: //REG_NR51 - Selection of Sound output terminal (R/W)
return;
case 0xFF26: //REG_NR52 - Sound on/off (R/W) (Value at reset: $F1-GB, $F0-SGB)
return;
case 0xFF30: Sound.WavePatternRam[0x00] = value; break;
case 0xFF31: Sound.WavePatternRam[0x01] = value; break;
case 0xFF32: Sound.WavePatternRam[0x02] = value; break;
case 0xFF33: Sound.WavePatternRam[0x03] = value; break;
case 0xFF34: Sound.WavePatternRam[0x04] = value; break;
case 0xFF35: Sound.WavePatternRam[0x05] = value; break;
case 0xFF36: Sound.WavePatternRam[0x06] = value; break;
case 0xFF37: Sound.WavePatternRam[0x07] = value; break;
case 0xFF38: Sound.WavePatternRam[0x08] = value; break;
case 0xFF39: Sound.WavePatternRam[0x09] = value; break;
case 0xFF3A: Sound.WavePatternRam[0x0A] = value; break;
case 0xFF3B: Sound.WavePatternRam[0x0B] = value; break;
case 0xFF3C: Sound.WavePatternRam[0x0C] = value; break;
case 0xFF3D: Sound.WavePatternRam[0x0D] = value; break;
case 0xFF3E: Sound.WavePatternRam[0x0E] = value; break;
case 0xFF3F: Sound.WavePatternRam[0x0F] = value; break;
case 0xFF40: //REG_LCDC - LCD Control (R/W) (value $91 at reset)
Registers.LCDC.Write(value);
break;
case 0xFF41: //REG_STAT - LCDC Status (R/W)
return;
case 0xFF42: //REG_SCY - Scroll Y (R/W)
Registers.SCY = value;
break;
case 0xFF43: //REG_SCX - Scroll X (R/W)
Registers.SCX = value;
break;
case 0xFF44: //REG_LY - LCDC Y-Coordinate (R)
return;
case 0xFF45: //REG_LYC - LY Compare (R/W)
return;
case 0xFF46: //REG_DMA - DMA Transfer and Start Address (W)
return;
case 0xFF47: //REG_BGP - BG & Window Palette Data (R/W)
return;
case 0xFF48: //REG_OBP0 - Object Palette 0 Data (R/W)
return;
case 0xFF49: //REG_OBP1 - Object Palette 1 Data (R/W)
return;
case 0xFF4A: //REG_WY - Window Y Position (R/W)
return;
case 0xFF4B: //REG_WX - Window X Position (R/W)
return;
case 0xFFFF: //REG_IE
return;
default:
return;
}
}
public void WriteMemory(ushort addr, byte value)
{
if (addr < 0x8000)
return;
else if (addr < 0xA000)
VRam[addr - 0x8000] = value;
else if (addr < 0xC000)
SRam[addr - 0xA000] = value;
else if (addr < 0xD000)
WRam[addr - 0xC000] = value;
else if (addr < 0xE000)
WRam[addr - 0xC000] = value;
else if (addr < 0xFE00)
WriteMemory((ushort)(addr - 0xE000), value);
else if (addr < 0xFEA0)
OAM[addr - 0xFE00] = value;
else if (addr < 0xFF00)
return;
else if (addr < 0xFF80)
WriteRegister(addr, value);
else if (addr < 0xFFFF)
HRam[addr - 0xFF80] = value;
else WriteRegister(addr, value);
}
public void FrameAdvance(bool render)
{
Controller.UpdateControls(Frame++);
for (int i = 0; i < 70224; i++)
SingleStepInto();
//to make sure input is working
Console.WriteLine(Controller.IsPressed("Up"));
}
public CoreInputComm CoreInputComm { get; set; }
public CoreOutputComm CoreOutputComm { get; private set; }
public IVideoProvider VideoProvider
{
get { return this; }
}
public int[] GetVideoBuffer()
{
//TODO - these need to be run once per scanline and accumulated into a 160*144 byte buffer held by the core
//then, in the call to GetVideoBuffer(), it gets adapted to gray according to the palette and returned
//(i.e. no real GB logic happens during GetVideoBuffer())
int[] buf = new int[160 * 144];
var linebuf = new byte[160];
int i = 0;
for (int y = 0; y < 144; y++)
{
RenderBGLine(y, linebuf, true);
RenderOBJLine(y, linebuf, true);
for (int x = 0; x < 160; x++)
{
int gray = 0x000000;
switch (linebuf[x])
{
case 0:
gray = 0xFFFFFF;
break;
case 1:
gray = 0xC0C0C0;
break;
case 2:
gray = 0x606060;
break;
}
buf[i++] = unchecked(gray | (int)0xFF000000);
}
}
return buf;
}
public int VirtualWidth { get { return 160; } }
public int BufferWidth { get { return 160; } }
public int BufferHeight { get { return 144; } }
public int BackgroundColor { get { return 0; } }
public ISoundProvider SoundProvider
{
get { return new NullEmulator(); }
}
public int Frame { get; set; }
public void ResetFrameCounter()
{
Frame = 0;
}
public int LagCount { get { return _lagcount; } set { _lagcount = value; } }
public bool IsLagFrame { get { return islag; } }
public byte[] ReadSaveRam
{
get { throw new NotImplementedException(); }
}
public bool SaveRamModified
{
get
{
return false;
}
set
{
}
}
public void SaveStateText(System.IO.TextWriter writer)
{
throw new NotImplementedException();
}
public void LoadStateText(System.IO.TextReader reader)
{
throw new NotImplementedException();
}
public void SaveStateBinary(System.IO.BinaryWriter writer)
{
}
public void LoadStateBinary(System.IO.BinaryReader reader)
{
throw new NotImplementedException();
}
public byte[] SaveStateBinary()
{
return new byte[0];
}
public void RenderOBJLine(int line, byte[] output, bool limit)
{
int height = Registers.LCDC.ObjSize == TRegisters.TLCDC.EObjSize.ObjSize_8x16 ? 16 : 8;
List<int> sprites = new List<int>();
//1st pass: select sprites to draw
for (int s = 0; s < 40; s++)
{
int y = OAM[s * 4 + 0];
y -= 16;
if (line < y) continue;
if (line < y + height) continue;
sprites.Add(s);
if (sprites.Count == 10 && limit) break; //sprite limit
}
//now render from low priority to high
for (int i = sprites.Count - 1; i >= 0; i--)
{
int s = sprites[i];
int y = OAM[s * 4 + 0];
int x = OAM[s * 4 + 1];
int pat = OAM[s * 4 + 2];
byte flags = OAM[s * 4 + 3];
bool priority = GetBit8(flags, 7);
bool yflip = GetBit8(flags, 6);
bool xflip = GetBit8(flags, 5);
bool pal = GetBit8(flags, 4);
y -= 16;
x -= 8;
int sprline = line - y;
if (yflip)
sprline = height - sprline - 1;
if (height == 16) pat = ~1;
ushort patternAddr = (ushort)(0x8000 + (pat << 4));
patternAddr += (ushort)(sprline << 1);
int _lobits = ReadMemory(patternAddr);
patternAddr += 1;
int _hibits = ReadMemory(patternAddr);
for (int j = 0; j < 8; j++)
{
int px = x + j;
if (px < 0) continue;
if (px >= 160) continue;
int lobits;
int hibits;
if (xflip)
{
lobits = _lobits >> (j);
hibits = _hibits >> (j);
}
else
{
lobits = _lobits >> (7 - j);
hibits = _hibits >> (7 - j);
}
lobits &= 1;
hibits &= 1;
int pixel = lobits | (hibits << 1);
output[x] = (byte)pixel;
}
}
}
public void RenderTileLine(int line, byte[] output, ushort tiledata)
{
int py = line;
int ty = py >> 3;
int tyr = py & 7;
int tileRowOffset = ty << 5;
for (int x = 0; x < 128; x++)
{
int px = x;
px &= 0xFF;
int tx = px >> 3;
int txr = px & 7;
int tileOffset = tileRowOffset + tx;
int tileAddr = tileOffset;
int tileNum = ty * 16 + tx;
tileNum = (tileNum) & 0xFF;
ushort patternAddr = (ushort)(tiledata + (tileNum << 4));
patternAddr += (ushort)(tyr << 1);
int lobits = ReadMemory(patternAddr);
patternAddr += 1;
int hibits = ReadMemory(patternAddr);
lobits >>= (7 - txr);
hibits >>= (7 - txr);
lobits &= 1;
hibits &= 1;
int pixel = lobits | (hibits << 1);
output[x] = (byte)pixel;
}
}
public void RenderBGLine(int line, byte[] output, bool scroll)
{
ushort tilemap = Registers.LCDC.BgTileMapAddr;
ushort tiledata = Registers.LCDC.TileDataAddr;
int tileAdjust = (Registers.LCDC.TileData == TRegisters.TLCDC.ETileData.Region_8800_97FF ? 128 : 0);
int py = line;
if (scroll) line += Registers.SCY;
py &= 0xFF;
int ty = py >> 3;
int tyr = py & 7;
int tileRowOffset = ty << 5;
for (int x = 0; x < 160; x++)
{
int px = x;
if (scroll) px += Registers.SCX;
px &= 0xFF;
int tx = px >> 3;
int txr = px & 7;
int tileOffset = tileRowOffset + tx;
int tileAddr = tilemap + tileOffset;
int tileNum = ReadMemory((ushort)tileAddr);
tileNum = (tileNum + tileAdjust) & 0xFF;
ushort patternAddr = (ushort)(tiledata + (tileNum << 4));
patternAddr += (ushort)(tyr << 1);
int lobits = ReadMemory(patternAddr);
patternAddr += 1;
int hibits = ReadMemory(patternAddr);
lobits >>= (7 - txr);
hibits >>= (7 - txr);
lobits &= 1;
hibits &= 1;
int pixel = lobits | (hibits << 1);
output[x] = (byte)pixel;
}
}
public bool DeterministicEmulation { get; set; }
public string SystemId { get { return "GB"; } }
public void Dispose() { }
}
}

View File

@ -1,17 +0,0 @@
namespace BizHawk.Emulation.Consoles.Gameboy
{
public partial class Gameboy
{
public static readonly ControllerDefinition GbController = new ControllerDefinition
{
Name = "Gameboy Controller",
BoolButtons =
{
"Up", "Down", "Left", "Right", "A", "B", "Select", "Start"
}
};
public ControllerDefinition ControllerDefinition { get { return GbController; } }
public IController Controller { get; set; }
}
}

View File

@ -1,16 +0,0 @@
using System;
namespace BizHawk.Emulation.Consoles.Gameboy
{
partial class Gameboy
{
public class MemoryMapper
{
private readonly Gameboy gb;
public MemoryMapper(Gameboy gb)
{
this.gb = gb;
}
}
}
}

View File

@ -188,12 +188,6 @@
</Compile>
<Compile Include="DisplayManager\DisplayManager.cs" />
<Compile Include="DisplayManager\Filters\Hq2x.cs" />
<Compile Include="Gameboy\Debugger.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Gameboy\Debugger.Designer.cs">
<DependentUpon>Debugger.cs</DependentUpon>
</Compile>
<Compile Include="Global.cs" />
<Compile Include="HawkFile.cs" />
<Compile Include="Input\ControllerBinding.cs" />
@ -388,10 +382,6 @@
<EmbeddedResource Include="config\GifAnimator.resx">
<DependentUpon>GifAnimator.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Gameboy\Debugger.resx">
<DependentUpon>Debugger.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@ -1,838 +0,0 @@
using BizHawk.Core;
namespace BizHawk.Emulation.Consoles.Gameboy
{
partial class Debugger
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.btnRun = new System.Windows.Forms.Button();
this.btnStepInto = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.txtRegAF = new System.Windows.Forms.TextBox();
this.txtRegDE = new System.Windows.Forms.TextBox();
this.txtRegPC = new System.Windows.Forms.TextBox();
this.txtRegSP = new System.Windows.Forms.TextBox();
this.txtRegHL = new System.Windows.Forms.TextBox();
this.txtRegBC = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.checkFlag_Z = new System.Windows.Forms.CheckBox();
this.label8 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.checkFlag_H = new System.Windows.Forms.CheckBox();
this.checkFlag_N = new System.Windows.Forms.CheckBox();
this.checkFlag_C = new System.Windows.Forms.CheckBox();
this.label12 = new System.Windows.Forms.Label();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.viewDisassembly = new BizHawk.Core.ViewportPanel();
this.btnSeekPC = new System.Windows.Forms.Button();
this.btnSeekUser = new System.Windows.Forms.Button();
this.txtSeekUser = new System.Windows.Forms.TextBox();
this.listBreakpoints = new System.Windows.Forms.ListBox();
this.menuContextBreakpoints = new System.Windows.Forms.ContextMenuStrip(this.components);
this.miBreakpointAdd = new System.Windows.Forms.ToolStripMenuItem();
this.miBreakpointDelete = new System.Windows.Forms.ToolStripMenuItem();
this.label10 = new System.Windows.Forms.Label();
this.timerRunUpdate = new System.Windows.Forms.Timer(this.components);
this.btnBreak = new System.Windows.Forms.Button();
this.txtFrame = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.txtLine = new System.Windows.Forms.TextBox();
this.txtDot = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.panelMemory = new BizHawk.Core.ScrollableViewportPanel();
this.checkViewBg = new System.Windows.Forms.CheckBox();
this.checkViewObj = new System.Windows.Forms.CheckBox();
this.label7 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.checkViewObjNoLimit = new System.Windows.Forms.CheckBox();
this.lblInputActive = new System.Windows.Forms.Label();
this.viewTiles0x9000 = new BizHawk.Core.ViewportPanel();
this.viewTiles0x8000 = new BizHawk.Core.ViewportPanel();
this.viewBG = new BizHawk.Core.ViewportPanel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.menuContextBreakpoints.SuspendLayout();
this.panel1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// btnRun
//
this.btnRun.Location = new System.Drawing.Point(377, 27);
this.btnRun.Name = "btnRun";
this.btnRun.Size = new System.Drawing.Size(75, 23);
this.btnRun.TabIndex = 1;
this.btnRun.Text = "Run";
this.btnRun.UseVisualStyleBackColor = true;
this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
//
// btnStepInto
//
this.btnStepInto.Location = new System.Drawing.Point(458, 27);
this.btnStepInto.Name = "btnStepInto";
this.btnStepInto.Size = new System.Drawing.Size(75, 23);
this.btnStepInto.TabIndex = 2;
this.btnStepInto.Text = "Step Into";
this.btnStepInto.UseVisualStyleBackColor = true;
this.btnStepInto.Click += new System.EventHandler(this.btnStepInto_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(376, 90);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(23, 13);
this.label1.TabIndex = 3;
this.label1.Text = "AF:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(435, 90);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 4;
this.label2.Text = "BC:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(374, 110);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(25, 13);
this.label3.TabIndex = 5;
this.label3.Text = "DE:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(435, 110);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(24, 13);
this.label4.TabIndex = 6;
this.label4.Text = "HL:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(435, 131);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(24, 13);
this.label5.TabIndex = 7;
this.label5.Text = "PC:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(374, 131);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(24, 13);
this.label6.TabIndex = 8;
this.label6.Text = "SP:";
//
// txtRegAF
//
this.txtRegAF.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtRegAF.Location = new System.Drawing.Point(399, 87);
this.txtRegAF.MaxLength = 4;
this.txtRegAF.Name = "txtRegAF";
this.txtRegAF.Size = new System.Drawing.Size(34, 20);
this.txtRegAF.TabIndex = 10;
this.txtRegAF.Text = "FFF0";
this.txtRegAF.Validating += new System.ComponentModel.CancelEventHandler(this.reg16_Validating);
//
// txtRegDE
//
this.txtRegDE.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtRegDE.Location = new System.Drawing.Point(399, 107);
this.txtRegDE.MaxLength = 4;
this.txtRegDE.Name = "txtRegDE";
this.txtRegDE.Size = new System.Drawing.Size(34, 20);
this.txtRegDE.TabIndex = 11;
this.txtRegDE.Text = "FFF0";
this.txtRegDE.Validating += new System.ComponentModel.CancelEventHandler(this.reg16_Validating);
//
// txtRegPC
//
this.txtRegPC.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtRegPC.Location = new System.Drawing.Point(459, 127);
this.txtRegPC.MaxLength = 4;
this.txtRegPC.Name = "txtRegPC";
this.txtRegPC.Size = new System.Drawing.Size(34, 20);
this.txtRegPC.TabIndex = 12;
this.txtRegPC.Text = "FFF0";
this.txtRegPC.Validating += new System.ComponentModel.CancelEventHandler(this.reg16_Validating);
//
// txtRegSP
//
this.txtRegSP.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtRegSP.Location = new System.Drawing.Point(399, 127);
this.txtRegSP.MaxLength = 4;
this.txtRegSP.Name = "txtRegSP";
this.txtRegSP.Size = new System.Drawing.Size(34, 20);
this.txtRegSP.TabIndex = 15;
this.txtRegSP.Text = "FFF0";
this.txtRegSP.Validating += new System.ComponentModel.CancelEventHandler(this.reg16_Validating);
//
// txtRegHL
//
this.txtRegHL.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtRegHL.Location = new System.Drawing.Point(459, 107);
this.txtRegHL.MaxLength = 4;
this.txtRegHL.Name = "txtRegHL";
this.txtRegHL.Size = new System.Drawing.Size(34, 20);
this.txtRegHL.TabIndex = 14;
this.txtRegHL.Text = "FFF0";
this.txtRegHL.Validating += new System.ComponentModel.CancelEventHandler(this.reg16_Validating);
//
// txtRegBC
//
this.txtRegBC.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtRegBC.Location = new System.Drawing.Point(459, 87);
this.txtRegBC.MaxLength = 4;
this.txtRegBC.Name = "txtRegBC";
this.txtRegBC.Size = new System.Drawing.Size(34, 20);
this.txtRegBC.TabIndex = 13;
this.txtRegBC.Text = "FFF0";
this.txtRegBC.Validating += new System.ComponentModel.CancelEventHandler(this.reg16_Validating);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.tableLayoutPanel1);
this.groupBox1.Location = new System.Drawing.Point(372, 175);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(96, 59);
this.groupBox1.TabIndex = 16;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "CPU Flags";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanel1.ColumnCount = 4;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Controls.Add(this.checkFlag_Z, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label8, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label11, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label9, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.checkFlag_H, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.checkFlag_N, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.checkFlag_C, 3, 1);
this.tableLayoutPanel1.Controls.Add(this.label12, 3, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 19);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(80, 33);
this.tableLayoutPanel1.TabIndex = 17;
//
// checkFlag_Z
//
this.checkFlag_Z.AutoSize = true;
this.checkFlag_Z.Location = new System.Drawing.Point(3, 16);
this.checkFlag_Z.Name = "checkFlag_Z";
this.checkFlag_Z.Size = new System.Drawing.Size(14, 14);
this.checkFlag_Z.TabIndex = 8;
this.checkFlag_Z.UseVisualStyleBackColor = true;
this.checkFlag_Z.CheckedChanged += new System.EventHandler(this.cpuflag_checkChanged);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(3, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(14, 13);
this.label8.TabIndex = 2;
this.label8.Text = "Z";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(23, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(14, 13);
this.label11.TabIndex = 5;
this.label11.Text = "N";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(43, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(14, 13);
this.label9.TabIndex = 3;
this.label9.Text = "H";
//
// checkFlag_H
//
this.checkFlag_H.AutoSize = true;
this.checkFlag_H.Location = new System.Drawing.Point(43, 16);
this.checkFlag_H.Name = "checkFlag_H";
this.checkFlag_H.Size = new System.Drawing.Size(14, 14);
this.checkFlag_H.TabIndex = 0;
this.checkFlag_H.UseVisualStyleBackColor = true;
this.checkFlag_H.CheckedChanged += new System.EventHandler(this.cpuflag_checkChanged);
//
// checkFlag_N
//
this.checkFlag_N.AutoSize = true;
this.checkFlag_N.Location = new System.Drawing.Point(23, 16);
this.checkFlag_N.Name = "checkFlag_N";
this.checkFlag_N.Size = new System.Drawing.Size(14, 14);
this.checkFlag_N.TabIndex = 10;
this.checkFlag_N.UseVisualStyleBackColor = true;
this.checkFlag_N.CheckedChanged += new System.EventHandler(this.cpuflag_checkChanged);
//
// checkFlag_C
//
this.checkFlag_C.AutoSize = true;
this.checkFlag_C.Location = new System.Drawing.Point(63, 16);
this.checkFlag_C.Name = "checkFlag_C";
this.checkFlag_C.Size = new System.Drawing.Size(14, 14);
this.checkFlag_C.TabIndex = 11;
this.checkFlag_C.UseVisualStyleBackColor = true;
this.checkFlag_C.CheckedChanged += new System.EventHandler(this.cpuflag_checkChanged);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(63, 0);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(14, 13);
this.label12.TabIndex = 6;
this.label12.Text = "C";
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel2.Controls.Add(this.vScrollBar1, 1, 0);
this.tableLayoutPanel2.Controls.Add(this.viewDisassembly, 0, 0);
this.tableLayoutPanel2.Location = new System.Drawing.Point(7, 31);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 205F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(350, 205);
this.tableLayoutPanel2.TabIndex = 19;
//
// vScrollBar1
//
this.vScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.vScrollBar1.Location = new System.Drawing.Point(334, 0);
this.vScrollBar1.Maximum = 65535;
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(16, 205);
this.vScrollBar1.TabIndex = 20;
this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar1_Scroll);
//
// viewDisassembly
//
this.viewDisassembly.Dock = System.Windows.Forms.DockStyle.Fill;
this.viewDisassembly.Location = new System.Drawing.Point(3, 3);
this.viewDisassembly.Name = "viewDisassembly";
this.viewDisassembly.Size = new System.Drawing.Size(328, 199);
this.viewDisassembly.TabIndex = 0;
this.viewDisassembly.Paint += new System.Windows.Forms.PaintEventHandler(this.viewDisassembly_Paint);
//
// btnSeekPC
//
this.btnSeekPC.Location = new System.Drawing.Point(496, 127);
this.btnSeekPC.Name = "btnSeekPC";
this.btnSeekPC.Size = new System.Drawing.Size(52, 20);
this.btnSeekPC.TabIndex = 20;
this.btnSeekPC.Text = "Seek";
this.btnSeekPC.UseVisualStyleBackColor = true;
this.btnSeekPC.Click += new System.EventHandler(this.btnSeekPC_Click);
//
// btnSeekUser
//
this.btnSeekUser.Location = new System.Drawing.Point(496, 151);
this.btnSeekUser.Name = "btnSeekUser";
this.btnSeekUser.Size = new System.Drawing.Size(52, 20);
this.btnSeekUser.TabIndex = 21;
this.btnSeekUser.Text = "Seek";
this.btnSeekUser.UseVisualStyleBackColor = true;
this.btnSeekUser.Click += new System.EventHandler(this.btnSeekUser_Click);
//
// txtSeekUser
//
this.txtSeekUser.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtSeekUser.Location = new System.Drawing.Point(459, 150);
this.txtSeekUser.MaxLength = 4;
this.txtSeekUser.Name = "txtSeekUser";
this.txtSeekUser.Size = new System.Drawing.Size(34, 20);
this.txtSeekUser.TabIndex = 22;
//
// listBreakpoints
//
this.listBreakpoints.ContextMenuStrip = this.menuContextBreakpoints;
this.listBreakpoints.FormattingEnabled = true;
this.listBreakpoints.Location = new System.Drawing.Point(564, 386);
this.listBreakpoints.Name = "listBreakpoints";
this.listBreakpoints.Size = new System.Drawing.Size(120, 95);
this.listBreakpoints.TabIndex = 25;
//
// menuContextBreakpoints
//
this.menuContextBreakpoints.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miBreakpointAdd,
this.miBreakpointDelete});
this.menuContextBreakpoints.Name = "menuContextBreakpoints";
this.menuContextBreakpoints.Size = new System.Drawing.Size(117, 48);
this.menuContextBreakpoints.Opening += new System.ComponentModel.CancelEventHandler(this.menuContextBreakpoints_Opening);
//
// miBreakpointAdd
//
this.miBreakpointAdd.Name = "miBreakpointAdd";
this.miBreakpointAdd.Size = new System.Drawing.Size(116, 22);
this.miBreakpointAdd.Text = "Add";
//
// miBreakpointDelete
//
this.miBreakpointDelete.Name = "miBreakpointDelete";
this.miBreakpointDelete.Size = new System.Drawing.Size(116, 22);
this.miBreakpointDelete.Text = "Delete";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(561, 370);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(63, 13);
this.label10.TabIndex = 26;
this.label10.Text = "Breakpoints";
//
// timerRunUpdate
//
this.timerRunUpdate.Enabled = true;
this.timerRunUpdate.Tick += new System.EventHandler(this.timerRunUpdate_Tick);
//
// btnBreak
//
this.btnBreak.Location = new System.Drawing.Point(377, 56);
this.btnBreak.Name = "btnBreak";
this.btnBreak.Size = new System.Drawing.Size(75, 23);
this.btnBreak.TabIndex = 29;
this.btnBreak.Text = "Break";
this.btnBreak.UseVisualStyleBackColor = true;
this.btnBreak.Click += new System.EventHandler(this.btnBreak_Click);
//
// txtFrame
//
this.txtFrame.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtFrame.Location = new System.Drawing.Point(775, 39);
this.txtFrame.MaxLength = 4;
this.txtFrame.Name = "txtFrame";
this.txtFrame.ReadOnly = true;
this.txtFrame.Size = new System.Drawing.Size(48, 20);
this.txtFrame.TabIndex = 31;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(730, 42);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(39, 13);
this.label13.TabIndex = 32;
this.label13.Text = "Frame:";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(739, 62);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(30, 13);
this.label14.TabIndex = 33;
this.label14.Text = "Line:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(742, 84);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(27, 13);
this.label15.TabIndex = 34;
this.label15.Text = "Dot:";
//
// txtLine
//
this.txtLine.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtLine.Location = new System.Drawing.Point(775, 61);
this.txtLine.MaxLength = 4;
this.txtLine.Name = "txtLine";
this.txtLine.ReadOnly = true;
this.txtLine.Size = new System.Drawing.Size(48, 20);
this.txtLine.TabIndex = 35;
//
// txtDot
//
this.txtDot.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtDot.Location = new System.Drawing.Point(775, 83);
this.txtDot.MaxLength = 4;
this.txtDot.Name = "txtDot";
this.txtDot.ReadOnly = true;
this.txtDot.Size = new System.Drawing.Size(48, 20);
this.txtDot.TabIndex = 36;
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Controls.Add(this.panelMemory);
this.panel1.Location = new System.Drawing.Point(5, 240);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(545, 181);
this.panel1.TabIndex = 38;
//
// panelMemory
//
this.panelMemory.AutoSize = true;
this.panelMemory.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelMemory.Location = new System.Drawing.Point(0, 0);
this.panelMemory.Name = "panelMemory";
this.panelMemory.ScrollLargeChange = 10;
this.panelMemory.ScrollMax = 4095;
this.panelMemory.Size = new System.Drawing.Size(541, 177);
this.panelMemory.TabIndex = 37;
this.panelMemory.Paint += new System.Windows.Forms.PaintEventHandler(this.panelMemory_Paint);
this.panelMemory.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panelMemory_Scroll);
//
// checkViewBg
//
this.checkViewBg.AutoSize = true;
this.checkViewBg.Checked = true;
this.checkViewBg.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkViewBg.Location = new System.Drawing.Point(564, 3);
this.checkViewBg.Name = "checkViewBg";
this.checkViewBg.Size = new System.Drawing.Size(41, 17);
this.checkViewBg.TabIndex = 39;
this.checkViewBg.Text = "BG";
this.checkViewBg.UseVisualStyleBackColor = true;
this.checkViewBg.CheckedChanged += new System.EventHandler(this.checkViewBg_CheckedChanged);
//
// checkViewObj
//
this.checkViewObj.AutoSize = true;
this.checkViewObj.Checked = true;
this.checkViewObj.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkViewObj.Location = new System.Drawing.Point(611, 3);
this.checkViewObj.Name = "checkViewObj";
this.checkViewObj.Size = new System.Drawing.Size(46, 17);
this.checkViewObj.TabIndex = 40;
this.checkViewObj.Text = "OBJ";
this.checkViewObj.UseVisualStyleBackColor = true;
this.checkViewObj.CheckedChanged += new System.EventHandler(this.checkViewObj_CheckedChanged);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(561, 195);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(45, 13);
this.label7.TabIndex = 42;
this.label7.Text = "0x8000:";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(701, 197);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(45, 13);
this.label16.TabIndex = 44;
this.label16.Text = "0x8800:";
//
// checkViewObjNoLimit
//
this.checkViewObjNoLimit.AutoSize = true;
this.checkViewObjNoLimit.Checked = true;
this.checkViewObjNoLimit.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkViewObjNoLimit.Location = new System.Drawing.Point(663, 3);
this.checkViewObjNoLimit.Name = "checkViewObjNoLimit";
this.checkViewObjNoLimit.Size = new System.Drawing.Size(44, 17);
this.checkViewObjNoLimit.TabIndex = 45;
this.checkViewObjNoLimit.Text = ">10";
this.checkViewObjNoLimit.UseVisualStyleBackColor = true;
this.checkViewObjNoLimit.CheckedChanged += new System.EventHandler(this.checkViewObjNoLimit_CheckedChanged);
//
// lblInputActive
//
this.lblInputActive.AutoSize = true;
this.lblInputActive.Location = new System.Drawing.Point(711, 10);
this.lblInputActive.Name = "lblInputActive";
this.lblInputActive.Size = new System.Drawing.Size(13, 13);
this.lblInputActive.TabIndex = 46;
this.lblInputActive.Text = "o";
//
// viewTiles0x9000
//
this.viewTiles0x9000.Location = new System.Drawing.Point(704, 215);
this.viewTiles0x9000.Name = "viewTiles0x9000";
this.viewTiles0x9000.Size = new System.Drawing.Size(128, 128);
this.viewTiles0x9000.TabIndex = 43;
this.viewTiles0x9000.Paint += new System.Windows.Forms.PaintEventHandler(this.viewTiles0x9000_Paint);
//
// viewTiles0x8000
//
this.viewTiles0x8000.Location = new System.Drawing.Point(564, 215);
this.viewTiles0x8000.Name = "viewTiles0x8000";
this.viewTiles0x8000.Size = new System.Drawing.Size(128, 128);
this.viewTiles0x8000.TabIndex = 41;
this.viewTiles0x8000.Paint += new System.Windows.Forms.PaintEventHandler(this.viewTiles0x8000_Paint);
//
// viewBG
//
this.viewBG.Location = new System.Drawing.Point(564, 35);
this.viewBG.Name = "viewBG";
this.viewBG.Size = new System.Drawing.Size(160, 144);
this.viewBG.TabIndex = 23;
this.viewBG.Paint += new System.Windows.Forms.PaintEventHandler(this.viewBG_Paint);
this.viewBG.Leave += new System.EventHandler(this.viewBG_Leave);
this.viewBG.KeyUp += new System.Windows.Forms.KeyEventHandler(this.viewBG_KeyUp);
this.viewBG.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.viewBG_KeyPress);
this.viewBG.Enter += new System.EventHandler(this.viewBG_Enter);
this.viewBG.KeyDown += new System.Windows.Forms.KeyEventHandler(this.viewBG_KeyDown);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.settingsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(867, 24);
this.menuStrip1.TabIndex = 47;
this.menuStrip1.Text = "menuStrip1";
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.autoloadToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem,
this.toolStripSeparator1,
this.restoreWindowSizeToolStripMenuItem});
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(58, 20);
this.settingsToolStripMenuItem.Text = "&Settings";
this.settingsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.settingsToolStripMenuItem_DropDownOpened);
//
// autoloadToolStripMenuItem
//
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.autoloadToolStripMenuItem.Text = "Autoload";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
//
// saveWindowPositionToolStripMenuItem
//
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6);
//
// restoreWindowSizeToolStripMenuItem
//
this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem";
this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.restoreWindowSizeToolStripMenuItem.Text = "Restore Window Size";
//
// Debugger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(867, 483);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.lblInputActive);
this.Controls.Add(this.checkViewObjNoLimit);
this.Controls.Add(this.viewTiles0x9000);
this.Controls.Add(this.label16);
this.Controls.Add(this.label7);
this.Controls.Add(this.checkViewObj);
this.Controls.Add(this.viewTiles0x8000);
this.Controls.Add(this.panel1);
this.Controls.Add(this.checkViewBg);
this.Controls.Add(this.txtDot);
this.Controls.Add(this.label13);
this.Controls.Add(this.btnBreak);
this.Controls.Add(this.txtLine);
this.Controls.Add(this.label15);
this.Controls.Add(this.label14);
this.Controls.Add(this.txtFrame);
this.Controls.Add(this.label10);
this.Controls.Add(this.tableLayoutPanel2);
this.Controls.Add(this.listBreakpoints);
this.Controls.Add(this.txtSeekUser);
this.Controls.Add(this.viewBG);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnSeekUser);
this.Controls.Add(this.btnSeekPC);
this.Controls.Add(this.btnStepInto);
this.Controls.Add(this.txtRegAF);
this.Controls.Add(this.btnRun);
this.Controls.Add(this.txtRegSP);
this.Controls.Add(this.txtRegHL);
this.Controls.Add(this.txtRegBC);
this.Controls.Add(this.txtRegPC);
this.Controls.Add(this.txtRegDE);
this.Controls.Add(this.label2);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label1);
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1;
this.Name = "Debugger";
this.Text = "Game Boy Debugger";
this.Load += new System.EventHandler(this.Debugger_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.menuContextBreakpoints.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private ViewportPanel viewDisassembly;
private System.Windows.Forms.Button btnRun;
private System.Windows.Forms.Button btnStepInto;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtRegAF;
private System.Windows.Forms.TextBox txtRegDE;
private System.Windows.Forms.TextBox txtRegPC;
private System.Windows.Forms.TextBox txtRegSP;
private System.Windows.Forms.TextBox txtRegHL;
private System.Windows.Forms.TextBox txtRegBC;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox checkFlag_H;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.CheckBox checkFlag_Z;
private System.Windows.Forms.CheckBox checkFlag_N;
private System.Windows.Forms.CheckBox checkFlag_C;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.VScrollBar vScrollBar1;
private System.Windows.Forms.Button btnSeekPC;
private System.Windows.Forms.Button btnSeekUser;
private System.Windows.Forms.TextBox txtSeekUser;
private ViewportPanel viewBG;
private System.Windows.Forms.ListBox listBreakpoints;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.ContextMenuStrip menuContextBreakpoints;
private System.Windows.Forms.ToolStripMenuItem miBreakpointAdd;
private System.Windows.Forms.ToolStripMenuItem miBreakpointDelete;
private System.Windows.Forms.Timer timerRunUpdate;
private System.Windows.Forms.Button btnBreak;
private System.Windows.Forms.TextBox txtFrame;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox txtLine;
private System.Windows.Forms.TextBox txtDot;
private ScrollableViewportPanel panelMemory;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.CheckBox checkViewBg;
private System.Windows.Forms.CheckBox checkViewObj;
private ViewportPanel viewTiles0x8000;
private System.Windows.Forms.Label label7;
private ViewportPanel viewTiles0x9000;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.CheckBox checkViewObjNoLimit;
private System.Windows.Forms.Label lblInputActive;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem autoloadToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem restoreWindowSizeToolStripMenuItem;
}
}

View File

@ -1,429 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using BizHawk.Core;
using BizHawk.MultiClient;
namespace BizHawk.Emulation.Consoles.Gameboy
{
public partial class Debugger : Form, Gameboy.IDebuggerAPI
{
Gameboy gb;
public Debugger()
{
InitializeComponent();
}
public void LoadCore(Gameboy gb)
{
this.gb = gb;
gb.DebuggerAPI = this;
Refresh();
}
void Gameboy.IDebuggerAPI.DoEvents()
{
System.Windows.Forms.Application.DoEvents();
}
private void viewDisassembly_Paint(object sender, PaintEventArgs e)
{
e.Graphics.Clear(SystemColors.Control);
StringBuilder sb = new StringBuilder();
ushort addr = (ushort)vScrollBar1.Value;
for (int i = 0; i < 16; i++)
{
ushort size;
string str = BizHawk.Emulation.CPUs.Z80GB.Disassembler.DAsm(addr, gb.Cpu.ReadMemory, out size);
addr += size;
sb.AppendLine(str);
}
using (Font font = new Font("Courier New", 8))
{
e.Graphics.DrawString(sb.ToString(), font, Brushes.Black, 0, 0);
}
}
public override void Refresh()
{
txtRegAF.Text = string.Format("{0:X4}", gb.Cpu.RegisterAF);
txtRegDE.Text = string.Format("{0:X4}", gb.Cpu.RegisterDE);
txtRegPC.Text = string.Format("{0:X4}", gb.Cpu.RegisterPC);
txtRegBC.Text = string.Format("{0:X4}", gb.Cpu.RegisterBC);
txtRegHL.Text = string.Format("{0:X4}", gb.Cpu.RegisterHL);
txtRegSP.Text = string.Format("{0:X4}", gb.Cpu.RegisterSP);
checkFlag_Z.Checked = gb.Cpu.FlagZ;
checkFlag_N.Checked = gb.Cpu.FlagN;
checkFlag_H.Checked = gb.Cpu.FlagH;
checkFlag_C.Checked = gb.Cpu.FlagC;
txtFrame.Text = gb.Registers.Timing.frame.ToString();
txtLine.Text = gb.Registers.Timing.line.ToString();
txtDot.Text = gb.Registers.Timing.dot.ToString();
base.Refresh();
}
void DoStepInto()
{
DoBreak();
gb.SingleStepInto();
vScrollBar1.Value = gb.Cpu.RegisterPC;
Refresh();
}
bool Running = false;
void DoRun()
{
Global.MainForm.UnpauseEmulator();
//Running = true;
//gb.RunForever();
//Running = false;
}
void DoBreak()
{
Global.MainForm.PauseEmulator(); //adelikat: This is probably "rounding" the break to the nearest frame, but without it, break fails
gb.DebugBreak = true;
}
private void btnStepInto_Click(object sender, EventArgs e)
{
DoStepInto();
}
bool TryParse16(string str, out ushort val)
{
return ushort.TryParse(str, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out val);
}
private void reg16_Validating(object sender, CancelEventArgs e)
{
var tb = (TextBox)sender;
ushort val = 0;
TryParse16(tb.Text, out val);
if (sender == txtRegAF) gb.Cpu.RegisterAF = val;
if (sender == txtRegDE) gb.Cpu.RegisterDE = val;
if (sender == txtRegPC) gb.Cpu.RegisterPC = val;
if (sender == txtRegBC) gb.Cpu.RegisterBC = val;
if (sender == txtRegHL) gb.Cpu.RegisterHL = val;
if (sender == txtRegSP) gb.Cpu.RegisterSP = val;
Refresh();
}
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
Refresh();
}
private void btnSeekPC_Click(object sender, EventArgs e)
{
vScrollBar1.Value = gb.Cpu.RegisterPC;
Refresh();
}
private void btnSeekUser_Click(object sender, EventArgs e)
{
ushort val;
if (TryParse16(txtSeekUser.Text, out val))
{
vScrollBar1.Value = val;
Refresh();
}
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.F11:
DoStepInto();
break;
case Keys.F5:
DoRun();
break;
case Keys.Escape:
DoBreak();
break;
default:
return false;
}
return true;
}
private void menuContextBreakpoints_Opening(object sender, CancelEventArgs e)
{
miBreakpointDelete.Enabled = false;
}
private void viewTiles0x8000_Paint(object sender, PaintEventArgs e)
{
using (Bitmap bmp = new Bitmap(160, 144, e.Graphics))
{
var linebuf = new byte[128];
for (int y = 0; y < 144; y++)
{
gb.RenderTileLine(y, linebuf, 0x8000);
for (int x = 0; x < 128; x++)
{
int gray = linebuf[x] << 6;
bmp.SetPixel(x, y, Color.FromArgb(gray, gray, gray));
}
}
e.Graphics.DrawImageUnscaled(bmp, 0, 0);
}
}
private void viewTiles0x9000_Paint(object sender, PaintEventArgs e)
{
using (Bitmap bmp = new Bitmap(160, 144, e.Graphics))
{
var linebuf = new byte[128];
for (int y = 0; y < 144; y++)
{
gb.RenderTileLine(y, linebuf, 0x8800);
for (int x = 0; x < 128; x++)
{
int gray = linebuf[x] << 6;
bmp.SetPixel(x, y, Color.FromArgb(gray, gray, gray));
}
}
e.Graphics.DrawImageUnscaled(bmp, 0, 0);
}
}
private void viewBG_Paint(object sender, PaintEventArgs e)
{
using (Bitmap bmp = new Bitmap(160, 144, e.Graphics))
{
var linebuf = new byte[160];
for (int y = 0; y < 144; y++)
{
if(checkViewBg.Checked) gb.RenderBGLine(y, linebuf, false);
if (checkViewObj.Checked) gb.RenderOBJLine(y, linebuf, !checkViewObjNoLimit.Checked);
for (int x = 0; x < 160; x++)
{
int gray = linebuf[x]<<6;
bmp.SetPixel(x, y, Color.FromArgb(gray, gray, gray));
}
}
e.Graphics.DrawImageUnscaled(bmp, 0, 0);
}
}
private void timerRunUpdate_Tick(object sender, EventArgs e)
{
if(Running)
Refresh();
}
private void btnRun_Click(object sender, EventArgs e)
{
DoRun();
}
private void btnBreak_Click(object sender, EventArgs e)
{
DoBreak();
}
private void checkFlag_Z_CheckedChanged(object sender, EventArgs e)
{
}
private void cpuflag_checkChanged(object sender, EventArgs e)
{
var cb = (CheckBox)sender;
if (sender == checkFlag_Z) gb.Cpu.FlagZ = cb.Checked;
if (sender == checkFlag_N) gb.Cpu.FlagN = cb.Checked;
if (sender == checkFlag_H) gb.Cpu.FlagH = cb.Checked;
if (sender == checkFlag_C) gb.Cpu.FlagC = cb.Checked;
Refresh();
}
static char Remap(byte val)
{
if (val < ' ') return '.';
else if (val >= 0x80) return '.';
else return (char)val;
}
private void panelMemory_Paint(object sender, PaintEventArgs e)
{
e.Graphics.Clear(SystemColors.Control);
StringBuilder sb = new StringBuilder();
ushort addr = (ushort)(panelMemory.Scrollbar.Value * 16);
for (int i = 0; i < 16; i++)
{
sb.AppendFormat("{0}:{1:X4} ", gb.DescribeParagraph(addr),addr);
for (int x = 0; x < 16; x++)
sb.AppendFormat("{0:X2} ", gb.ReadMemory((ushort)(addr+x)));
sb.AppendFormat("| ");
for (int x = 0; x < 16; x++)
sb.Append(Remap(gb.ReadMemory((ushort)(addr + x))));
sb.AppendLine();
addr += 16;
}
using (Font font = new Font("Courier New", 8))
{
e.Graphics.DrawString(sb.ToString(), font, Brushes.Black, 0, 0);
}
}
private void panelMemory_Scroll(object sender, ScrollEventArgs e)
{
Refresh();
}
private void checkViewBg_CheckedChanged(object sender, EventArgs e)
{
Refresh();
}
private void checkViewObj_CheckedChanged(object sender, EventArgs e)
{
Refresh();
}
private void checkViewObjNoLimit_CheckedChanged(object sender, EventArgs e)
{
Refresh();
}
private void viewBG_KeyUp(object sender, KeyEventArgs e)
{
UpdateKeys();
}
private void viewBG_KeyPress(object sender, KeyPressEventArgs e)
{
UpdateKeys();
}
private void viewBG_KeyDown(object sender, KeyEventArgs e)
{
UpdateKeys();
}
protected override bool ProcessDialogKey(Keys keyData)
{
if (viewBG.Focused) return true;
else return base.ProcessDialogKey(keyData);
}
void UpdateKeys()
{
gb.Registers.Input.up = Keyboard.IsKeyDown(Keys.Up);
gb.Registers.Input.down = Keyboard.IsKeyDown(Keys.Down);
gb.Registers.Input.left = Keyboard.IsKeyDown(Keys.Left);
gb.Registers.Input.right = Keyboard.IsKeyDown(Keys.Right);
gb.Registers.Input.a = Keyboard.IsKeyDown(Keys.X);
gb.Registers.Input.b = Keyboard.IsKeyDown(Keys.Z);
gb.Registers.Input.select = Keyboard.IsKeyDown(Keys.E);
gb.Registers.Input.right = Keyboard.IsKeyDown(Keys.R);
}
private void viewBG_Enter(object sender, EventArgs e)
{
lblInputActive.ForeColor = Color.Red;
UpdateKeys();
}
private void viewBG_Leave(object sender, EventArgs e)
{
lblInputActive.ForeColor = SystemColors.ControlText;
gb.Registers.Input.up = false;
gb.Registers.Input.down = false;
gb.Registers.Input.left = false;
gb.Registers.Input.right = false;
gb.Registers.Input.a = false;
gb.Registers.Input.b = false;
gb.Registers.Input.select = false;
gb.Registers.Input.right = false;
}
static class Keyboard
{
[Flags]
private enum KeyStates
{
None = 0,
Down = 1,
Toggled = 2
}
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
private static extern short GetKeyState(int keyCode);
private static KeyStates GetKeyState(Keys key)
{
KeyStates state = KeyStates.None;
short retVal = GetKeyState((int)key);
//If the high-order bit is 1, the key is down
//otherwise, it is up.
if ((retVal & 0x8000) == 0x8000)
state |= KeyStates.Down;
//If the low-order bit is 1, the key is toggled.
if ((retVal & 1) == 1)
state |= KeyStates.Toggled;
return state;
}
public static bool IsKeyDown(Keys key)
{
return KeyStates.Down == (GetKeyState(key) & KeyStates.Down);
}
public static bool IsKeyToggled(Keys key)
{
return KeyStates.Toggled == (GetKeyState(key) & KeyStates.Toggled);
}
}
private void Debugger_Load(object sender, EventArgs e)
{
}
private void autoloadToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.AutoloadGBDebugger ^= true;
}
private void settingsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{
autoloadToolStripMenuItem.Checked = Global.Config.AutoloadGBDebugger;
}
public void UpdateValues()
{
if (!this.IsHandleCreated || this.IsDisposed) return;
Refresh();
}
public void Restart()
{
if (!this.IsHandleCreated || this.IsDisposed) return;
if (Global.Emulator is Gameboy)
{
LoadCore(Global.Emulator as Gameboy);
}
else
{
this.Close();
}
}
}
}

View File

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuContextBreakpoints.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timerRunUpdate.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>193, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>325, 17</value>
</metadata>
</root>

View File

@ -1928,14 +1928,6 @@
this.gBToolStripMenuItem.Text = "GB";
this.gBToolStripMenuItem.DropDownOpened += new System.EventHandler(this.gBToolStripMenuItem_DropDownOpened);
//
// debuggerToolStripMenuItem1
//
this.debuggerToolStripMenuItem1.Image = global::BizHawk.MultiClient.Properties.Resources.Bug;
this.debuggerToolStripMenuItem1.Name = "debuggerToolStripMenuItem1";
this.debuggerToolStripMenuItem1.Size = new System.Drawing.Size(147, 22);
this.debuggerToolStripMenuItem1.Text = "Debugger";
this.debuggerToolStripMenuItem1.Click += new System.EventHandler(this.debuggerToolStripMenuItem1_Click);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";

View File

@ -3,7 +3,6 @@ using System.Drawing;
using System.IO;
using System.Windows.Forms;
using BizHawk.Emulation.Consoles.Calculator;
using BizHawk.Emulation.Consoles.Gameboy;
using System.Drawing.Imaging;
namespace BizHawk.MultiClient
@ -1166,11 +1165,6 @@ namespace BizHawk.MultiClient
}
}
private void debuggerToolStripMenuItem1_Click(object sender, EventArgs e)
{
Global.MainForm.LoadGBDebugger();
}
private void tAStudioToolStripMenuItem_Click(object sender, EventArgs e)
{
LoadTAStudio();

View File

@ -10,7 +10,6 @@ using BizHawk.DiscSystem;
using BizHawk.Emulation.Consoles.Sega;
using BizHawk.Emulation.Consoles.TurboGrafx;
using BizHawk.Emulation.Consoles.Calculator;
using BizHawk.Emulation.Consoles.Gameboy;
using BizHawk.Emulation.Consoles.Nintendo;
using BizHawk.Emulation.Consoles.Nintendo.SNES;
using BizHawk.Emulation.Consoles.Coleco;
@ -79,7 +78,6 @@ namespace BizHawk.MultiClient
public ToolBox ToolBox1 = new ToolBox();
public TI83KeyPad TI83KeyPad1 = new TI83KeyPad();
public TAStudio TAStudio1 = new TAStudio();
public Debugger GBDebugger = new Debugger();
#if WINDOWS
public LuaConsole LuaConsole1 = new LuaConsole();
#endif
@ -774,28 +772,29 @@ namespace BizHawk.MultiClient
}
Global.AutofireNESControls = anesControls;
var gbControls = new Controller(Gameboy.GbController);
gbControls.BindMulti("Up", Global.Config.GBController[0].Up);
gbControls.BindMulti("Down", Global.Config.GBController[0].Down);
gbControls.BindMulti("Left", Global.Config.GBController[0].Left);
gbControls.BindMulti("Right", Global.Config.GBController[0].Right);
gbControls.BindMulti("A", Global.Config.GBController[0].A);
gbControls.BindMulti("B", Global.Config.GBController[0].B);
gbControls.BindMulti("Select", Global.Config.GBController[0].Select);
gbControls.BindMulti("Start", Global.Config.GBController[0].Start);
Global.GBControls = gbControls;
// TODO: wire this up to gambatte instead
//var gbControls = new Controller(Gameboy.GbController);
//gbControls.BindMulti("Up", Global.Config.GBController[0].Up);
//gbControls.BindMulti("Down", Global.Config.GBController[0].Down);
//gbControls.BindMulti("Left", Global.Config.GBController[0].Left);
//gbControls.BindMulti("Right", Global.Config.GBController[0].Right);
//gbControls.BindMulti("A", Global.Config.GBController[0].A);
//gbControls.BindMulti("B", Global.Config.GBController[0].B);
//gbControls.BindMulti("Select", Global.Config.GBController[0].Select);
//gbControls.BindMulti("Start", Global.Config.GBController[0].Start);
//Global.GBControls = gbControls;
var agbControls = new AutofireController(Gameboy.GbController);
agbControls.Autofire = true;
agbControls.BindMulti("Up", Global.Config.GBAutoController[0].Up);
agbControls.BindMulti("Down", Global.Config.GBAutoController[0].Down);
agbControls.BindMulti("Left", Global.Config.GBAutoController[0].Left);
agbControls.BindMulti("Right", Global.Config.GBAutoController[0].Right);
agbControls.BindMulti("A", Global.Config.GBAutoController[0].A);
agbControls.BindMulti("B", Global.Config.GBAutoController[0].B);
agbControls.BindMulti("Select", Global.Config.GBAutoController[0].Select);
agbControls.BindMulti("Start", Global.Config.GBAutoController[0].Start);
Global.AutofireGBControls = agbControls;
//var agbControls = new AutofireController(Gameboy.GbController);
//agbControls.Autofire = true;
//agbControls.BindMulti("Up", Global.Config.GBAutoController[0].Up);
//agbControls.BindMulti("Down", Global.Config.GBAutoController[0].Down);
//agbControls.BindMulti("Left", Global.Config.GBAutoController[0].Left);
//agbControls.BindMulti("Right", Global.Config.GBAutoController[0].Right);
//agbControls.BindMulti("A", Global.Config.GBAutoController[0].A);
//agbControls.BindMulti("B", Global.Config.GBAutoController[0].B);
//agbControls.BindMulti("Select", Global.Config.GBAutoController[0].Select);
//agbControls.BindMulti("Start", Global.Config.GBAutoController[0].Start);
//Global.AutofireGBControls = agbControls;
var genControls = new Controller(Genesis.GenesisController);
genControls.BindMulti("P1 Up", Global.Config.GenesisController[0].Up);
@ -2107,7 +2106,6 @@ namespace BizHawk.MultiClient
NESNameTableViewer1.UpdateValues();
NESPPU1.UpdateValues();
PCEBGViewer1.UpdateValues();
GBDebugger.UpdateValues();
SNESGraphicsDebugger1.UpdateValues();
}
@ -2660,7 +2658,6 @@ namespace BizHawk.MultiClient
PCEBGViewer1.Restart();
TI83KeyPad1.Restart();
Cheats1.Restart();
GBDebugger.Restart();
ToolBox1.Restart();
#if WINDOWS
LuaConsole1.Restart();
@ -3074,20 +3071,6 @@ namespace BizHawk.MultiClient
#endif
}
public void LoadGBDebugger()
{
if (Global.Emulator is Gameboy)
{
if (!GBDebugger.IsHandleCreated || GBDebugger.IsDisposed)
{
GBDebugger.LoadCore(Global.Emulator as Gameboy);
GBDebugger.Show();
}
else
GBDebugger.Focus();
}
}
public void LoadRamPoke()
{
RamPoke r = new RamPoke();

View File

@ -10,7 +10,6 @@ using BizHawk.Core;
using BizHawk.Emulation.Consoles.Sega;
using BizHawk.Emulation.Consoles.TurboGrafx;
using BizHawk.Emulation.Consoles.Calculator;
using BizHawk.Emulation.Consoles.Gameboy;
using BizHawk.Emulation.Consoles.Nintendo;
namespace BizHawk.MultiClient

View File

@ -178,15 +178,7 @@
this.KeypadTool.Size = new System.Drawing.Size(63, 20);
this.KeypadTool.Text = "Keypad";
this.KeypadTool.Click += new System.EventHandler(this.KeyPadTool_Click);
//
// GameboyDebuggerTool
//
this.GameboyDebuggerTool.Image = global::BizHawk.MultiClient.Properties.Resources.Bug;
this.GameboyDebuggerTool.ImageTransparentColor = System.Drawing.Color.Magenta;
this.GameboyDebuggerTool.Name = "GameboyDebuggerTool";
this.GameboyDebuggerTool.Size = new System.Drawing.Size(90, 20);
this.GameboyDebuggerTool.Text = "GB Debugger";
this.GameboyDebuggerTool.Click += new System.EventHandler(this.toolStripButton6_Click);
//
// ToolBox
//

View File

@ -8,7 +8,6 @@ using System.Text;
using System.Windows.Forms;
using BizHawk.Emulation.Consoles.Nintendo;
using BizHawk.Emulation.Consoles.Calculator;
using BizHawk.Emulation.Consoles.Gameboy;
namespace BizHawk.MultiClient
{
@ -57,15 +56,6 @@ namespace BizHawk.MultiClient
{
KeypadTool.Visible = false;
}
if (Global.Emulator is Gameboy)
{
GameboyDebuggerTool.Visible = true;
}
else
{
GameboyDebuggerTool.Visible = false;
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
@ -130,10 +120,5 @@ namespace BizHawk.MultiClient
{
Global.MainForm.LoadTAStudio();
}
private void toolStripButton6_Click(object sender, EventArgs e)
{
Global.MainForm.LoadGBDebugger();
}
}
}