X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fsh2%2Fsh2.c;h=403c4c70c579c66ca882a7662d1c195c79d37bc7;hb=8fde2033ac268ee9fe198f5d1c9d0b964f2763ab;hp=7b83cf215867eb9917ae81729e9545932207759a;hpb=12da51c27a8d1c1205d8f0f01bbc4814c46e79ce;p=picodrive.git diff --git a/cpu/sh2/sh2.c b/cpu/sh2/sh2.c index 7b83cf2..403c4c7 100644 --- a/cpu/sh2/sh2.c +++ b/cpu/sh2/sh2.c @@ -17,10 +17,15 @@ int sh2_init(SH2 *sh2, int is_slave, SH2 *other_sh2) { int ret = 0; + unsigned int mult_m68k_to_sh2 = sh2->mult_m68k_to_sh2; + unsigned int mult_sh2_to_m68k = sh2->mult_sh2_to_m68k; - memset(sh2, 0, offsetof(SH2, mult_m68k_to_sh2)); + memset(sh2, 0, sizeof(*sh2)); sh2->is_slave = is_slave; sh2->other_sh2 = other_sh2; + sh2->mult_m68k_to_sh2 = mult_m68k_to_sh2; + sh2->mult_sh2_to_m68k = mult_sh2_to_m68k; + pdb_register_cpu(sh2, PDBCT_SH2, is_slave ? "ssh2" : "msh2"); #ifdef DRC_SH2 ret = sh2_drc_init(sh2); @@ -232,7 +237,7 @@ static void dump_regs(SH2 *sh2) printf("%csh2 SR: %03x PR: %08x\n", csh2, sh2->sr, sh2->pr); } -void do_sh2_cmp(SH2 *current) +void REGPARM(1) do_sh2_cmp(SH2 *current) { static int current_slave; static u32 current_val; @@ -246,6 +251,13 @@ void do_sh2_cmp(SH2 *current) int cycles; int i, ret; +#if 0 + sr = current->sr; + current->sr &= 0x3f3; + do_sh2_trace(current, (signed int)sr >> 12); + current->sr = sr; + return; +#endif sh2ref[1].is_slave = 1; while (1) {