add memory hooks for cheat/rumble

This commit is contained in:
Sven 2018-08-11 17:14:07 -04:00
parent 406c9856c7
commit 94d20ae9c8
3 changed files with 19 additions and 2 deletions

View File

@ -160,6 +160,8 @@
#include "romExclusion.h"
UInt8* g_mainRam=NULL;
UInt32 g_mainRamSize=0;
static char machinesDir[PROP_MAXPATH] = "";
int toint(char* buffer)
@ -1821,10 +1823,12 @@ int machineInitialize(Machine* machine, UInt8** mainRam, UInt32* mainRamSize, UI
if (mainRam != NULL) {
*mainRam = ram;
g_mainRam = ram ;
}
if (mainRamSize != NULL) {
*mainRamSize = ramSize;
g_mainRamSize = ramSize ;
}
if (mainRamStart != NULL) {

View File

@ -122,5 +122,8 @@ void machineSaveState(Machine* machine);
void machineSetDirectory(const char* dir);
extern UInt8* g_mainRam;
extern UInt32 g_mainRamSize;
#endif

View File

@ -1230,8 +1230,18 @@ void retro_unload_game(void)
image_buffer_height = 0;
}
unsigned retro_get_region(void){return RETRO_REGION_NTSC;}
void *retro_get_memory_data(unsigned id){return NULL;}
size_t retro_get_memory_size(unsigned id){return 0;}
void *retro_get_memory_data(unsigned id)
{
if ( id == RETRO_MEMORY_SYSTEM_RAM )
return g_mainRam;
return NULL;
}
size_t retro_get_memory_size(unsigned id)
{
if ( id == RETRO_MEMORY_SYSTEM_RAM )
return g_mainRamSize;
return 0;
}
unsigned retro_api_version(void){return RETRO_API_VERSION;}
size_t retro_serialize_size(void){return 0;}
void retro_cheat_reset(void){}