Search
lxdream.org :: lxdream :: r1103:de9ad2c0cf56
lxdream 0.9.1
released Jun 29
Download Now
changeset1103:de9ad2c0cf56
parent1102:957b76b312cc
child1104:700e16c321e5
authornkeynes
dateSun Feb 21 11:19:59 2010 +1000 (10 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
src/bios.c
src/sh4/sh4core.in
src/sh4/sh4trans.c
1.1 --- a/src/bios.c Sun Feb 21 11:11:30 2010 +1000
1.2 +++ b/src/bios.c Sun Feb 21 11:19:59 2010 +1000
1.3 @@ -27,6 +27,8 @@
1.4 #include "drivers/cdrom/isoread.h"
1.5 #include "gdrom/gdrom.h"
1.6
1.7 +gboolean bios_boot_gdrom_disc( void );
1.8 +
1.9 /* Definitions from KOS */
1.10 #define COMMAND_QUEUE_LENGTH 16
1.11
1.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 +1000
2.2 +++ b/src/sh4/sh4core.in Sun Feb 21 11:19:59 2010 +1000
2.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 +1000
3.2 +++ b/src/sh4/sh4trans.c Sun Feb 21 11:19:59 2010 +1000
3.3 @@ -47,9 +47,10 @@
3.4
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.14
3.15 code = xlat_get_code_by_vma( sh4r.pc );
.