snes: tidy

This commit is contained in:
zeromus 2017-03-06 06:00:17 -06:00
parent c60cb77ee8
commit 598e173d60
5 changed files with 13 additions and 19 deletions

View File

@ -202,7 +202,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public void* ptr;
public uint id, addr, value, size;
public int port, device, index, slot;
public uint width, height;
public int width, height;
public int scanline;
//this should always be used in pairs

View File

@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
} //switch(msg)
Message(eMessage.eMessage_ResumeAfterBRK);
Message(eMessage.eMessage_Resume);
return true;
}
}

View File

@ -10,8 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
{
eMessage_NotSet,
eMessage_ResumeAfterBRK,
eMessage_Shutdown,
eMessage_Resume,
eMessage_QUERY_FIRST,
eMessage_QUERY_get_memory_size,

View File

@ -15,8 +15,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
case eMessage.eMessage_SIG_video_refresh:
{
int width = (int)comm->width;
int height = (int)comm->height;
int width = comm->width;
int height = comm->height;
if (video_refresh != null)
{
video_refresh((int*)comm->ptr, width, height);
@ -127,7 +127,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
}
} //switch(msg)
Message(eMessage.eMessage_ResumeAfterBRK);
Message(eMessage.eMessage_Resume);
return true;
}
}

View File

@ -16,28 +16,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <string>
#include <vector>
extern SNES::Interface *iface;
typedef uint8 u8;
typedef int32 s32;
typedef uint16 u16;
typedef uint64 u64;
typedef uint32 u32;
typedef uint16 u16;
typedef int32 s32;
typedef void(*Action)();
enum eMessage : int32
{
eMessage_NotSet,
eMessage_ResumeAfterBRK,
eMessage_Shutdown,
eMessage_Resume,
eMessage_QUERY_FIRST,
eMessage_QUERY_get_memory_size,
@ -148,14 +145,14 @@ struct CommStruct
void* ptr;
uint32 id, addr, value, size;
int32 port, device, index, slot;
uint32 width, height;
int32 width, height;
int32 scanline;
//always used in pairs
void* buf[2];
int32 buf_size[2];
uint64 cdl_ptr[4];
int64 cdl_ptr[4];
int32 cdl_size[4];
CPURegsComm cpuregs;
@ -291,8 +288,6 @@ public:
HANDLE handle;
};
static std::map<void*,SharedMemoryBlock*> memHandleTable;
void* snes_allocSharedMemory(const char* memtype, size_t amt)
{
//its important that this happen before the message marshaling because allocation/free attempts can happen before the marshaling is setup (or at shutdown time, in case of errors?)
@ -594,7 +589,7 @@ extern "C" dllexport void* __cdecl DllInit()
extern "C" dllexport void __cdecl Message(eMessage msg)
{
if (msg == eMessage_ResumeAfterBRK)
if (msg == eMessage_Resume)
{
cothread_t temp = co_emu_suspended;
co_emu_suspended = NULL;