revision 1103:de9ad2c0cf56
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1103:de9ad2c0cf56 |
parent | 1102:957b76b312cc |
child | 1104:700e16c321e5 |
author | nkeynes |
date | Sun Feb 21 11:19:59 2010 +1000 (14 years ago) |
Update sh4r.pc before doing the syscall - mainly so that debugging etc
statements come out with a useful PC value rather than the syscall id
statements come out with a useful PC value rather than the syscall id
src/bios.c | view | annotate | diff | log | ||
src/sh4/sh4core.in | view | annotate | diff | log | ||
src/sh4/sh4trans.c | view | annotate | diff | log |
1.1 --- a/src/bios.c Sun Feb 21 11:11:30 2010 +10001.2 +++ b/src/bios.c Sun Feb 21 11:19:59 2010 +10001.3 @@ -27,6 +27,8 @@1.4 #include "drivers/cdrom/isoread.h"1.5 #include "gdrom/gdrom.h"1.7 +gboolean bios_boot_gdrom_disc( void );1.8 +1.9 /* Definitions from KOS */1.10 #define COMMAND_QUEUE_LENGTH 161.12 @@ -368,9 +370,7 @@1.13 {1.14 /* Initialize hardware */1.15 /* Boot disc if present */1.16 - if( bios_boot_gdrom_disc() ) {1.17 - sh4r.pr = sh4r.pc; /* Set the syscall return address to the bootstrap entry */1.18 - } else {1.19 + if( !bios_boot_gdrom_disc() ) {1.20 dreamcast_stop();1.21 }1.22 }
2.1 --- a/src/sh4/sh4core.in Sun Feb 21 11:11:30 2010 +10002.2 +++ b/src/sh4/sh4core.in Sun Feb 21 11:19:59 2010 +10002.3 @@ -364,10 +364,10 @@2.4 pc = sh4r.pc;2.5 if( pc > 0xFFFFFF00 ) {2.6 /* SYSCALL Magic */2.7 + sh4r.in_delay_slot = 0;2.8 + sh4r.pc = sh4r.pr;2.9 + sh4r.new_pc = sh4r.pc + 2;2.10 syscall_invoke( pc );2.11 - sh4r.in_delay_slot = 0;2.12 - pc = sh4r.pc = sh4r.pr;2.13 - sh4r.new_pc = sh4r.pc + 2;2.14 return TRUE;2.15 }2.16 CHECKRALIGN16(pc);
3.1 --- a/src/sh4/sh4trans.c Sun Feb 21 11:11:30 2010 +10003.2 +++ b/src/sh4/sh4trans.c Sun Feb 21 11:19:59 2010 +10003.3 @@ -47,9 +47,10 @@3.5 if( code == NULL ) {3.6 if( IS_SYSCALL(sh4r.pc) ) {3.7 - syscall_invoke( sh4r.pc );3.8 + uint32_t pc = sh4r.pc;3.9 + sh4r.pc = sh4r.pr;3.10 sh4r.in_delay_slot = 0;3.11 - sh4r.pc = sh4r.pr;3.12 + syscall_invoke( pc );3.13 }3.15 code = xlat_get_code_by_vma( sh4r.pc );
.