diff --git a/cz80.cpp b/cz80.cpp index 591711b..caf530c 100644 --- a/cz80.cpp +++ b/cz80.cpp @@ -74,7 +74,7 @@ u32 Cz80_Reset(cz80_struc *cpu) { cz80_struc *CPU = cpu; - fast_memset(CPU, 0, (u32)(&(CPU->CycleSup)) - (u32)(&(CPU->BC))); + fast_memset(CPU, 0, (u32*)(&(CPU->CycleSup)) - (u32*)(&(CPU->BC))); Cz80_Set_PC(CPU, 0); zIX = 0xFFFF; diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 181bcf9..5aa0a4d 100755 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -311,8 +311,8 @@ void retro_run(void) memset(sampleBuffer, 0, samplesPerFrame * sizeof(int16_t)); - sound_update(sampleBuffer, samplesPerFrame * sizeof(int16_t)); //Get sound data - dac_update(sampleBuffer, samplesPerFrame * sizeof(int16_t)); + sound_update((unsigned short*)sampleBuffer, samplesPerFrame * sizeof(int16_t)); //Get sound data + dac_update((unsigned short*)sampleBuffer, samplesPerFrame * sizeof(int16_t)); int16_t *p = stereoBuffer; for (int i = 0; i < samplesPerFrame; i++) @@ -341,7 +341,8 @@ bool retro_serialize(void *data, size_t size) bool retro_unserialize(const void *data, size_t size) { - return state_restore_mem(data); + int ret = state_restore_mem((void*)data); + return (ret == 1); } bool retro_load_game(const struct retro_game_info *info) diff --git a/state.cpp b/state.cpp index cba0f72..030bf55 100644 --- a/state.cpp +++ b/state.cpp @@ -171,7 +171,7 @@ static int state_store(race_state_t *rs) extern cz80_struc *RACE_cz80_struc; extern s32 Z80_ICount; int size_of_z80 = - (u32)(&(RACE_cz80_struc->CycleSup)) - (u32)(&(RACE_cz80_struc->BC)); + (u32*)(&(RACE_cz80_struc->CycleSup)) - (u32*)(&(RACE_cz80_struc->BC)); memcpy(&rs->RACE_cz80_struc, RACE_cz80_struc, size_of_z80); rs->Z80_ICount = Z80_ICount; rs->PC_offset = Cz80_Get_PC(RACE_cz80_struc); @@ -245,7 +245,7 @@ static int state_restore(race_state_t *rs) extern cz80_struc *RACE_cz80_struc; extern s32 Z80_ICount; int size_of_z80 = - (u32)(&(RACE_cz80_struc->CycleSup)) - (u32)(&(RACE_cz80_struc->BC)); + (u32*)(&(RACE_cz80_struc->CycleSup)) - (u32*)(&(RACE_cz80_struc->BC)); memcpy(RACE_cz80_struc, &rs->RACE_cz80_struc, size_of_z80); Z80_ICount = rs->Z80_ICount; @@ -411,7 +411,7 @@ static int state_restore_0x10(FILE *stream) extern cz80_struc *RACE_cz80_struc; extern s32 Z80_ICount; int size_of_z80 = - (u32)(&(RACE_cz80_struc->CycleSup)) - (u32)(&(RACE_cz80_struc->BC)); + (u32*)(&(RACE_cz80_struc->CycleSup)) - (u32*)(&(RACE_cz80_struc->BC)); memcpy(RACE_cz80_struc, &rs.RACE_cz80_struc, size_of_z80); Z80_ICount = rs.Z80_ICount;