libsnes - remove pointless registers
This commit is contained in:
parent
f580773342
commit
96aa3e85c0
|
@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
||||||
{
|
{
|
||||||
static LibsnesApi()
|
static LibsnesApi()
|
||||||
{
|
{
|
||||||
if (sizeof(CommStruct) != 376)
|
if (sizeof(CommStruct) != 368)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("sizeof(comm)");
|
throw new InvalidOperationException("sizeof(comm)");
|
||||||
}
|
}
|
||||||
|
@ -208,10 +208,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
||||||
public struct CPURegs
|
public struct CPURegs
|
||||||
{
|
{
|
||||||
public uint pc;
|
public uint pc;
|
||||||
public ushort a, x, y, z, s, d, vector; //7x
|
public ushort a, x, y, s, d, vector; //7x
|
||||||
public byte p, nothing;
|
public byte p, db, nothing, nothing2;
|
||||||
public uint aa, rd;
|
|
||||||
public byte sp, dp, db, mdr;
|
|
||||||
public ushort v, h;
|
public ushort v, h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,15 +344,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
||||||
|
|
||||||
[FieldOffset(320)]
|
[FieldOffset(320)]
|
||||||
public CPURegs cpuregs;
|
public CPURegs cpuregs;
|
||||||
[FieldOffset(356)]
|
[FieldOffset(344)]
|
||||||
public LayerEnables layerEnables;
|
public LayerEnables layerEnables;
|
||||||
|
|
||||||
[FieldOffset(368)]
|
[FieldOffset(356)]
|
||||||
//static configuration-type information which can be grabbed off the core at any time without even needing a QUERY command
|
//static configuration-type information which can be grabbed off the core at any time without even needing a QUERY command
|
||||||
public SNES_REGION region;
|
public SNES_REGION region;
|
||||||
[FieldOffset(372)]
|
[FieldOffset(360)]
|
||||||
public SNES_MAPPER mapper;
|
public SNES_MAPPER mapper;
|
||||||
|
|
||||||
|
[FieldOffset(364)]
|
||||||
|
uint BLANK0;
|
||||||
|
|
||||||
|
|
||||||
//utilities
|
//utilities
|
||||||
//TODO: make internal, wrap on the API instead of the comm
|
//TODO: make internal, wrap on the API instead of the comm
|
||||||
public unsafe string GetAscii() { return _getAscii(str); }
|
public unsafe string GetAscii() { return _getAscii(str); }
|
||||||
|
|
|
@ -26,17 +26,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
||||||
["A"] = regs.a,
|
["A"] = regs.a,
|
||||||
["X"] = regs.x,
|
["X"] = regs.x,
|
||||||
["Y"] = regs.y,
|
["Y"] = regs.y,
|
||||||
["Z"] = regs.z,
|
|
||||||
["S"] = regs.s,
|
["S"] = regs.s,
|
||||||
["D"] = regs.d,
|
["D"] = regs.d,
|
||||||
["Vector"] = regs.vector,
|
["Vector"] = regs.vector,
|
||||||
["P"] = regs.p,
|
["P"] = regs.p,
|
||||||
["AA"] = regs.aa,
|
|
||||||
["RD"] = regs.rd,
|
|
||||||
["SP"] = regs.sp,
|
|
||||||
["DP"] = regs.dp,
|
|
||||||
["DB"] = regs.db,
|
|
||||||
["MDR"] = regs.mdr,
|
|
||||||
["Flag N"] = fn,
|
["Flag N"] = fn,
|
||||||
["Flag V"] = fv,
|
["Flag V"] = fv,
|
||||||
["Flag M"] = fm,
|
["Flag M"] = fm,
|
||||||
|
|
|
@ -134,7 +134,7 @@ void CPU::power() {
|
||||||
|
|
||||||
//zero 01-dec-2012
|
//zero 01-dec-2012
|
||||||
//gotta clear these to something, sometime
|
//gotta clear these to something, sometime
|
||||||
aa.d = rd.d = sp = dp = 0;
|
rd.d = sp = dp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPU::reset() {
|
void CPU::reset() {
|
||||||
|
|
|
@ -109,10 +109,8 @@ enum eStatus : int32
|
||||||
#endif
|
#endif
|
||||||
struct CPURegsComm {
|
struct CPURegsComm {
|
||||||
u32 pc;
|
u32 pc;
|
||||||
u16 a, x, y, s, d, vector; //7x
|
u16 a, x, y, s, d, vector; //6x
|
||||||
u8 p, nothing;
|
u8 p, db, nothing, nothing2;
|
||||||
u32 aa, rd;
|
|
||||||
u8 sp, dp, db, mdr;
|
|
||||||
u16 v, h;
|
u16 v, h;
|
||||||
}
|
}
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
|
@ -174,6 +172,7 @@ struct CommStruct
|
||||||
//static configuration-type information which can be grabbed off the core at any time without even needing a QUERY command
|
//static configuration-type information which can be grabbed off the core at any time without even needing a QUERY command
|
||||||
uint32 region;
|
uint32 region;
|
||||||
uint32 mapper;
|
uint32 mapper;
|
||||||
|
uint32 BLANKO;
|
||||||
|
|
||||||
//===========================================================
|
//===========================================================
|
||||||
|
|
||||||
|
@ -527,15 +526,11 @@ void QUERY_peek_cpu_regs() {
|
||||||
comm.cpuregs.y = SNES::cpu.regs.y;
|
comm.cpuregs.y = SNES::cpu.regs.y;
|
||||||
comm.cpuregs.s = SNES::cpu.regs.s;
|
comm.cpuregs.s = SNES::cpu.regs.s;
|
||||||
comm.cpuregs.d = SNES::cpu.regs.d;
|
comm.cpuregs.d = SNES::cpu.regs.d;
|
||||||
//comm.cpuregs.aa = (u32)SNES::cpu.aa;
|
|
||||||
comm.cpuregs.rd = (u32)SNES::cpu.rd;
|
|
||||||
comm.cpuregs.sp = SNES::cpu.sp;
|
|
||||||
comm.cpuregs.dp = SNES::cpu.dp;
|
|
||||||
comm.cpuregs.db = SNES::cpu.regs.db;
|
comm.cpuregs.db = SNES::cpu.regs.db;
|
||||||
comm.cpuregs.mdr = SNES::cpu.regs.mdr;
|
|
||||||
comm.cpuregs.vector = SNES::cpu.regs.vector;
|
comm.cpuregs.vector = SNES::cpu.regs.vector;
|
||||||
comm.cpuregs.p = SNES::cpu.regs.p;
|
comm.cpuregs.p = SNES::cpu.regs.p;
|
||||||
comm.cpuregs.nothing = 0;
|
comm.cpuregs.nothing = 0;
|
||||||
|
comm.cpuregs.nothing2 = 0;
|
||||||
comm.cpuregs.v = SNES::cpu.vcounter();
|
comm.cpuregs.v = SNES::cpu.vcounter();
|
||||||
comm.cpuregs.h = SNES::cpu.hdot();
|
comm.cpuregs.h = SNES::cpu.hdot();
|
||||||
}
|
}
|
||||||
|
@ -625,11 +620,12 @@ EXPORT void* DllInit()
|
||||||
T(cdl_ptr, 128);
|
T(cdl_ptr, 128);
|
||||||
T(cdl_size, 256);
|
T(cdl_size, 256);
|
||||||
T(cpuregs, 320);
|
T(cpuregs, 320);
|
||||||
T(layerEnables, 356);
|
T(layerEnables, 344);
|
||||||
T(region, 368);
|
T(region, 356);
|
||||||
T(mapper, 372);
|
T(mapper, 360);
|
||||||
|
T(BLANKO, 364);
|
||||||
// start of private stuff
|
// start of private stuff
|
||||||
T(privbuf, 376);
|
T(privbuf, 368);
|
||||||
#undef T
|
#undef T
|
||||||
|
|
||||||
memset(&comm, 0, sizeof(comm));
|
memset(&comm, 0, sizeof(comm));
|
||||||
|
|
Loading…
Reference in New Issue