add 32bit memory access functions for SH2

This commit is contained in:
kub 2019-03-27 20:24:48 +01:00
parent 1db36a7a07
commit 9031406131
4 changed files with 150 additions and 48 deletions

View file

@ -2906,7 +2906,6 @@ static void sh2_generate_utils(void)
{
int arg0, arg1, arg2, sr, tmp;
sh2_drc_write32 = p32x_sh2_write32;
sh2_drc_read8 = p32x_sh2_read8;
sh2_drc_read16 = p32x_sh2_read16;
sh2_drc_read32 = p32x_sh2_read32;
@ -3015,6 +3014,11 @@ static void sh2_generate_utils(void)
emith_ctx_read_ptr(arg2, offsetof(SH2, write16_tab));
emith_sh2_wcall(arg0, arg2);
// sh2_drc_write32(u32 a, u32 d)
sh2_drc_write32 = (void *)tcache_ptr;
emith_ctx_read_ptr(arg2, offsetof(SH2, write32_tab));
emith_sh2_wcall(arg0, arg2);
#ifdef PDB_NET
// debug
#define MAKE_READ_WRAPPER(func) { \
@ -3053,7 +3057,6 @@ static void sh2_generate_utils(void)
host_dasm_new_symbol(sh2_drc_read8);
host_dasm_new_symbol(sh2_drc_read16);
host_dasm_new_symbol(sh2_drc_read32);
host_dasm_new_symbol(sh2_drc_write32);
#endif
#endif
@ -3065,6 +3068,7 @@ static void sh2_generate_utils(void)
host_dasm_new_symbol(sh2_drc_test_irq);
host_dasm_new_symbol(sh2_drc_write8);
host_dasm_new_symbol(sh2_drc_write16);
host_dasm_new_symbol(sh2_drc_write32);
#endif
}

View file

@ -12,6 +12,7 @@ typedef enum {
typedef struct SH2_
{
// registers. this MUST correlate with enum sh2_reg_e.
unsigned int r[16]; // 00
unsigned int pc; // 40
unsigned int ppc;
@ -21,17 +22,19 @@ typedef struct SH2_
unsigned int mach, macl; // 58
// common
const void *read8_map; // 60
const void *read8_map;
const void *read16_map;
const void *read32_map;
const void **write8_tab;
const void **write16_tab;
const void **write32_tab;
// drc stuff
int drc_tmp; // 70
int drc_tmp;
int irq_cycles;
void *p_bios; // convenience pointers
void *p_da;
void *p_sdram; // 80
void *p_sdram;
void *p_rom;
unsigned int pdb_io_csum[2];