mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 07:38:05 -04:00
libretro, more fixes and cleanups for windows and osx
This commit is contained in:
parent
0198149a72
commit
6b67b6aa13
6 changed files with 61 additions and 96 deletions
|
@ -1273,24 +1273,23 @@ static void dr_flush_tcache(int tcid)
|
|||
blink_free[tcid] = NULL;
|
||||
memset(unresolved_links[tcid], 0, sizeof(*unresolved_links[0]) * HASH_TABLE_SIZE(tcid));
|
||||
memset(hash_tables[tcid], 0, sizeof(*hash_tables[0]) * HASH_TABLE_SIZE(tcid));
|
||||
if (Pico32xMem->sdram != NULL) {
|
||||
if (tcid == 0) { // ROM, RAM
|
||||
memset(Pico32xMem->drcblk_ram, 0, sizeof(Pico32xMem->drcblk_ram));
|
||||
memset(Pico32xMem->drclit_ram, 0, sizeof(Pico32xMem->drclit_ram));
|
||||
memset(sh2s[0].branch_cache, -1, sizeof(sh2s[0].branch_cache));
|
||||
memset(sh2s[1].branch_cache, -1, sizeof(sh2s[1].branch_cache));
|
||||
memset(sh2s[0].rts_cache, -1, sizeof(sh2s[0].rts_cache));
|
||||
memset(sh2s[1].rts_cache, -1, sizeof(sh2s[1].rts_cache));
|
||||
sh2s[0].rts_cache_idx = sh2s[1].rts_cache_idx = 0;
|
||||
} else {
|
||||
memset(Pico32xMem->drcblk_ram, 0, sizeof(Pico32xMem->drcblk_ram));
|
||||
memset(Pico32xMem->drclit_ram, 0, sizeof(Pico32xMem->drclit_ram));
|
||||
memset(Pico32xMem->drcblk_da[tcid - 1], 0, sizeof(Pico32xMem->drcblk_da[tcid - 1]));
|
||||
memset(Pico32xMem->drclit_da[tcid - 1], 0, sizeof(Pico32xMem->drclit_da[tcid - 1]));
|
||||
memset(sh2s[tcid - 1].branch_cache, -1, sizeof(sh2s[0].branch_cache));
|
||||
memset(sh2s[tcid - 1].rts_cache, -1, sizeof(sh2s[0].rts_cache));
|
||||
sh2s[tcid - 1].rts_cache_idx = 0;
|
||||
}
|
||||
|
||||
if (tcid == 0) { // ROM, RAM
|
||||
memset(Pico32xMem->drcblk_ram, 0, sizeof(Pico32xMem->drcblk_ram));
|
||||
memset(Pico32xMem->drclit_ram, 0, sizeof(Pico32xMem->drclit_ram));
|
||||
memset(sh2s[0].branch_cache, -1, sizeof(sh2s[0].branch_cache));
|
||||
memset(sh2s[1].branch_cache, -1, sizeof(sh2s[1].branch_cache));
|
||||
memset(sh2s[0].rts_cache, -1, sizeof(sh2s[0].rts_cache));
|
||||
memset(sh2s[1].rts_cache, -1, sizeof(sh2s[1].rts_cache));
|
||||
sh2s[0].rts_cache_idx = sh2s[1].rts_cache_idx = 0;
|
||||
} else {
|
||||
memset(Pico32xMem->drcblk_ram, 0, sizeof(Pico32xMem->drcblk_ram));
|
||||
memset(Pico32xMem->drclit_ram, 0, sizeof(Pico32xMem->drclit_ram));
|
||||
memset(Pico32xMem->drcblk_da[tcid - 1], 0, sizeof(Pico32xMem->drcblk_da[tcid - 1]));
|
||||
memset(Pico32xMem->drclit_da[tcid - 1], 0, sizeof(Pico32xMem->drclit_da[tcid - 1]));
|
||||
memset(sh2s[tcid - 1].branch_cache, -1, sizeof(sh2s[0].branch_cache));
|
||||
memset(sh2s[tcid - 1].rts_cache, -1, sizeof(sh2s[0].rts_cache));
|
||||
sh2s[tcid - 1].rts_cache_idx = 0;
|
||||
}
|
||||
#if (DRC_DEBUG & 4)
|
||||
tcache_dsm_ptrs[tcid] = tcache_ring[tcid].base;
|
||||
|
|
|
@ -31,7 +31,7 @@ unsigned short scan_block(uint32_t base_pc, int is_slave,
|
|||
unsigned char *op_flags, uint32_t *end_pc,
|
||||
uint32_t *base_literals, uint32_t *end_literals);
|
||||
|
||||
#if defined(DRC_SH2) && defined(__GNUC__)
|
||||
#if defined(DRC_SH2) && defined(__GNUC__) && !defined(__clang__)
|
||||
// direct access to some host CPU registers used by the DRC if gcc is used.
|
||||
// XXX MUST match SHR_SR definitions in cpu/drc/emit_*.c; should be moved there
|
||||
// XXX yuck, there's no portable way to determine register size. Use long long
|
||||
|
|
|
@ -106,7 +106,11 @@ int sh2_execute_interpreter(SH2 *sh2c, int cycles);
|
|||
|
||||
static __inline void sh2_execute_prepare(SH2 *sh2, int use_drc)
|
||||
{
|
||||
#ifdef DRC_SH2
|
||||
sh2->run = use_drc ? sh2_execute_drc : sh2_execute_interpreter;
|
||||
#else
|
||||
sh2->run = sh2_execute_interpreter;
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline int sh2_execute(SH2 *sh2, int cycles)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue