1.1 --- a/src/sh4/sh4dasm.c Mon Jan 21 11:54:47 2008 +0000
1.2 +++ b/src/sh4/sh4dasm.c Tue Jan 22 09:45:21 2008 +0000
1.6 const struct cpu_desc_struct sh4_cpu_desc =
1.7 - { "SH4", sh4_disasm_instruction, sh4_execute_instruction, mem_has_page,
1.8 + { "SH4", sh4_disasm_instruction, sh4_execute_instruction, sh4_has_page,
1.9 sh4_set_breakpoint, sh4_clear_breakpoint, sh4_get_breakpoint, 2,
1.10 (char *)&sh4r, sizeof(sh4r), sh4_reg_map,
1.13 -uint32_t sh4_disasm_instruction( uint32_t pc, char *buf, int len, char *opcode )
1.14 +uint32_t sh4_disasm_instruction( sh4vma_t pc, char *buf, int len, char *opcode )
1.16 - uint16_t ir = sh4_read_word(pc);
1.17 + sh4addr_t addr = mmu_vma_to_phys_disasm(pc);
1.18 + uint16_t ir = sh4_read_word(addr);
1.20 #define UNDEF(ir) snprintf( buf, len, "???? " );
1.21 #define RN(ir) ((ir&0x0F00)>>8)
1.22 @@ -1199,7 +1200,7 @@
1.24 { /* MOV.W @(disp, PC), Rn */
1.25 uint32_t Rn = ((ir>>8)&0xF); uint32_t disp = (ir&0xFF)<<1;
1.26 - snprintf( buf, len, "MOV.W @($%xh), R%d ; <- #%08x", disp + pc + 4, Rn, sh4_read_word(disp+pc+4) );
1.27 + snprintf( buf, len, "MOV.W @($%xh), R%d ; <- #%08x", disp + pc + 4, Rn, sh4_read_word(disp+addr+4) );
1.31 @@ -1317,7 +1318,7 @@
1.33 { /* MOV.L @(disp, PC), Rn */
1.34 uint32_t Rn = ((ir>>8)&0xF); uint32_t disp = (ir&0xFF)<<2;
1.35 - snprintf( buf, len, "MOV.L @($%xh), R%d ; <- #%08x", disp + (pc & 0xFFFFFFFC) + 4, Rn, sh4_read_long(disp+(pc&0xFFFFFFFC)+4) );
1.36 + snprintf( buf, len, "MOV.L @($%xh), R%d ; <- #%08x", disp + (pc & 0xFFFFFFFC) + 4, Rn, sh4_read_long(disp+(addr&0xFFFFFFFC)+4) );