CDL: fix bsnes SGB cdl totally not working (fixes #1344)

This commit is contained in:
zeromus 2020-01-19 18:41:36 -05:00
parent 6377d78098
commit c2c526e84b
3 changed files with 19 additions and 19 deletions

View File

@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
{
static LibsnesApi()
{
if (sizeof(CommStruct) != 232)
if (sizeof(CommStruct) != 280)
{
throw new InvalidOperationException("sizeof(comm)");
}
@ -296,19 +296,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
[FieldOffset(128)]
//bleck. this is a long so that it can be a 32/64bit pointer
public fixed long cdl_ptr[4];
[FieldOffset(160)]
public fixed int cdl_size[4];
[FieldOffset(176)]
public CPURegs cpuregs;
[FieldOffset(212)]
public LayerEnables layerEnables;
public fixed long cdl_ptr[8];
[FieldOffset(192)]
public fixed int cdl_size[8];
[FieldOffset(224)]
public CPURegs cpuregs;
[FieldOffset(260)]
public LayerEnables layerEnables;
[FieldOffset(272)]
//static configuration-type information which can be grabbed off the core at any time without even needing a QUERY command
public SNES_REGION region;
[FieldOffset(228)]
[FieldOffset(276)]
public SNES_MAPPER mapper;
//utilities

View File

@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
cdl["SGB_HRAM"] = new byte[_memoryDomains["SGB HRAM"].Size];
cdl["SGB_WRAM"] = new byte[_memoryDomains["SGB WRAM"].Size];
if (_memoryDomains.Has("SGB_CARTRAM"))
if (_memoryDomains.Has("SGB CARTRAM"))
cdl["SGB_CARTRAM"] = new byte[_memoryDomains["SGB CARTRAM"].Size];
}

View File

@ -165,8 +165,8 @@ struct CommStruct
int32 padding3;
int64 cdl_ptr[4];
int32 cdl_size[4];
int64 cdl_ptr[8];
int32 cdl_size[8];
CPURegsComm cpuregs;
LayerEnablesComm layerEnables;
@ -623,13 +623,13 @@ EXPORT void* DllInit()
T(buf, 88);
T(buf_size, 112);
T(cdl_ptr, 128);
T(cdl_size, 160);
T(cpuregs, 176);
T(layerEnables, 212);
T(region, 224);
T(mapper, 228);
T(cdl_size, 192);
T(cpuregs, 224);
T(layerEnables, 260);
T(region, 272);
T(mapper, 276);
// start of private stuff
T(privbuf, 232);
T(privbuf, 280);
#undef T
memset(&comm, 0, sizeof(comm));