mirror of
https://github.com/libretro/blueMSX-libretro.git
synced 2024-11-27 02:30:41 +00:00
add memory hooks for cheat/rumble
This commit is contained in:
parent
406c9856c7
commit
94d20ae9c8
@ -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) {
|
||||
|
@ -122,5 +122,8 @@ void machineSaveState(Machine* machine);
|
||||
|
||||
void machineSetDirectory(const char* dir);
|
||||
|
||||
extern UInt8* g_mainRam;
|
||||
extern UInt32 g_mainRamSize;
|
||||
|
||||
#endif
|
||||
|
||||
|
14
libretro.c
14
libretro.c
@ -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){}
|
||||
|
Loading…
Reference in New Issue
Block a user