Skip to content

Commit

Permalink
【rcheevos】RA memory read function
Browse files Browse the repository at this point in the history
  • Loading branch information
OFFTKP committed Sep 3, 2023
1 parent a4a581e commit dff35aa
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,22 @@ void se_draw_emu_stats(){
}
#ifdef ENABLE_RETRO_ACHIEVEMENTS
static uint32_t se_ra_read_memory_callback(uint32_t address, uint8_t* buffer, uint32_t num_bytes, rc_client_t* client){
// TODO: handle reading from consoles
if(emu_state.system==SYSTEM_GB){
for(uint32_t i=0;i<num_bytes;++i){
buffer[i]=sb_read8(&core.gb,address+i);
}
return num_bytes;
}else if(emu_state.system==SYSTEM_GBA){
for(uint32_t i=0;i<num_bytes;++i){
buffer[i]=gba_read8(&core.gba,address+i);
}
return num_bytes;
}else if(emu_state.system==SYSTEM_NDS){
for(uint32_t i=0;i<num_bytes;++i){
buffer[i]=nds9_read8(&core.nds,address+i);
}
return num_bytes;
}
return 0;
}
static void se_ra_login_callback(int result, const char* error_message, rc_client_t* client, void* userdata) {
Expand Down

0 comments on commit dff35aa

Please sign in to comment.