summaryrefslogtreecommitdiff
path: root/src/core/arm/interpreter/armsupp.cpp
diff options
context:
space:
mode:
authorGravatar archshift2014-05-16 23:21:03 -0700
committerGravatar archshift2014-05-16 23:21:03 -0700
commitb8c8d0903ec9be4c7d580464480a0136277be803 (patch)
tree9280a9f01e1312d0d8aed493282ae65d2384963c /src/core/arm/interpreter/armsupp.cpp
parentAdded FindGLEW to cmake-modules (diff)
parentMerge pull request #17 from bunnei/arm-vfp (diff)
downloadyuzu-b8c8d0903ec9be4c7d580464480a0136277be803.tar.gz
yuzu-b8c8d0903ec9be4c7d580464480a0136277be803.tar.xz
yuzu-b8c8d0903ec9be4c7d580464480a0136277be803.zip
Merge remote-tracking branch 'upstream/master' into issue-7-fix
Diffstat (limited to 'src/core/arm/interpreter/armsupp.cpp')
-rw-r--r--src/core/arm/interpreter/armsupp.cpp95
1 files changed, 47 insertions, 48 deletions
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index b2bbedc18..7816c4c42 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -15,12 +15,10 @@
15 along with this program; if not, write to the Free Software 15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17 17
18#include "armdefs.h" 18#include "core/arm/interpreter/armdefs.h"
19#include "armemu.h" 19#include "core/arm/interpreter/armemu.h"
20 20#include "core/arm/interpreter/skyeye_defs.h"
21//#include "ansidecl.h" 21#include "core/hle/coprocessor.h"
22#include "skyeye_defs.h"
23#include "core/hle/mrc.h"
24#include "core/arm/disassembler/arm_disasm.h" 22#include "core/arm/disassembler/arm_disasm.h"
25 23
26unsigned xscale_cp15_cp_access_allowed (ARMul_State * state, unsigned reg, 24unsigned xscale_cp15_cp_access_allowed (ARMul_State * state, unsigned reg,
@@ -127,8 +125,7 @@ ARMul_GetCPSR (ARMul_State * state)
127{ 125{
128 //chy 2003-08-20: below is from gdb20030716, maybe isn't suitable for system simulator 126 //chy 2003-08-20: below is from gdb20030716, maybe isn't suitable for system simulator
129 //return (CPSR | state->Cpsr); for gdb20030716 127 //return (CPSR | state->Cpsr); for gdb20030716
130 // NOTE(bunnei): Changed this from [now] commented out macro "CPSR" 128 return (CPSR); //had be tested in old skyeye with gdb5.0-5.3
131 return ((ECC | EINT | EMODE | (TFLAG << 5))); //had be tested in old skyeye with gdb5.0-5.3
132} 129}
133 130
134/* This routine sets the value of the CPSR. */ 131/* This routine sets the value of the CPSR. */
@@ -145,7 +142,7 @@ ARMul_SetCPSR (ARMul_State * state, ARMword value)
145 142
146void 143void
147ARMul_FixCPSR (ARMul_State * state, ARMword instr, ARMword rhs) 144ARMul_FixCPSR (ARMul_State * state, ARMword instr, ARMword rhs)
148{ 145{
149 state->Cpsr = ARMul_GetCPSR (state); 146 state->Cpsr = ARMul_GetCPSR (state);
150 //chy 2006-02-16 , should not consider system mode, don't conside 26bit mode 147 //chy 2006-02-16 , should not consider system mode, don't conside 26bit mode
151 if (state->Mode != USER26MODE && state->Mode != USER32MODE ) { 148 if (state->Mode != USER26MODE && state->Mode != USER32MODE ) {
@@ -500,8 +497,8 @@ ARMul_LDC (ARMul_State * state, ARMword instr, ARMword address)
500 return; 497 return;
501 } 498 }
502 499
503 if (ADDREXCEPT (address)) 500 //if (ADDREXCEPT (address))
504 INTERNALABORT (address); 501 // INTERNALABORT (address);
505 502
506 cpab = (state->LDC[CPNum]) (state, ARMul_FIRST, instr, 0); 503 cpab = (state->LDC[CPNum]) (state, ARMul_FIRST, instr, 0);
507 while (cpab == ARMul_BUSY) { 504 while (cpab == ARMul_BUSY) {
@@ -594,8 +591,8 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
594 return; 591 return;
595 } 592 }
596 593
597 if (ADDREXCEPT (address) || VECTORACCESS (address)) 594 //if (ADDREXCEPT (address) || VECTORACCESS (address))
598 INTERNALABORT (address); 595 // INTERNALABORT (address);
599 596
600 cpab = (state->STC[CPNum]) (state, ARMul_FIRST, instr, &data); 597 cpab = (state->STC[CPNum]) (state, ARMul_FIRST, instr, &data);
601 while (cpab == ARMul_BUSY) { 598 while (cpab == ARMul_BUSY) {
@@ -739,39 +736,43 @@ ARMul_MRC (ARMul_State * state, ARMword instr)
739{ 736{
740 unsigned cpab; 737 unsigned cpab;
741 738
742 ARMword result = HLE::CallMRC((HLE::ARM11_MRC_OPERATION)BITS(20, 27)); 739 ARMword result = HLE::CallMRC(instr);
743 740
744 ////printf("SKYEYE ARMul_MRC, CPnum is %x, instr %x\n",CPNum, instr); 741 if (result != -1) {
745 //if (!CP_ACCESS_ALLOWED (state, CPNum)) { 742 return result;
746 // //chy 2004-07-19 should fix in the future????!!!! 743 }
747 // //printf("SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x\n",CPNum, instr); 744
748 // ARMul_UndefInstr (state, instr); 745 //printf("SKYEYE ARMul_MRC, CPnum is %x, instr %x\n",CPNum, instr);
749 // return -1; 746 if (!CP_ACCESS_ALLOWED (state, CPNum)) {
750 //} 747 //chy 2004-07-19 should fix in the future????!!!!
751 748 //printf("SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x\n",CPNum, instr);
752 //cpab = (state->MRC[CPNum]) (state, ARMul_FIRST, instr, &result); 749 ARMul_UndefInstr (state, instr);
753 //while (cpab == ARMul_BUSY) { 750 return -1;
754 // ARMul_Icycles (state, 1, 0); 751 }
755 // if (IntPending (state)) { 752
756 // cpab = (state->MRC[CPNum]) (state, ARMul_INTERRUPT, 753 cpab = (state->MRC[CPNum]) (state, ARMul_FIRST, instr, &result);
757 // instr, 0); 754 while (cpab == ARMul_BUSY) {
758 // return (0); 755 ARMul_Icycles (state, 1, 0);
759 // } 756 if (IntPending (state)) {
760 // else 757 cpab = (state->MRC[CPNum]) (state, ARMul_INTERRUPT,
761 // cpab = (state->MRC[CPNum]) (state, ARMul_BUSY, instr, 758 instr, 0);
762 // &result); 759 return (0);
763 //} 760 }
764 //if (cpab == ARMul_CANT) { 761 else
765 // printf ("SKYEYE ARMul_MRC,CANT UndefInstr CPnum is %x, instr %x\n", CPNum, instr); 762 cpab = (state->MRC[CPNum]) (state, ARMul_BUSY, instr,
766 // ARMul_Abort (state, ARMul_UndefinedInstrV); 763 &result);
767 // /* Parent will destroy the flags otherwise. */ 764 }
768 // result = ECC; 765 if (cpab == ARMul_CANT) {
769 //} 766 printf ("SKYEYE ARMul_MRC,CANT UndefInstr CPnum is %x, instr %x\n", CPNum, instr);
770 //else { 767 ARMul_Abort (state, ARMul_UndefinedInstrV);
771 // BUSUSEDINCPCN; 768 /* Parent will destroy the flags otherwise. */
772 // ARMul_Ccycles (state, 1, 0); 769 result = ECC;
773 // ARMul_Icycles (state, 1, 0); 770 }
774 //} 771 else {
772 BUSUSEDINCPCN;
773 ARMul_Ccycles (state, 1, 0);
774 ARMul_Icycles (state, 1, 0);
775 }
775 776
776 return result; 777 return result;
777} 778}
@@ -906,9 +907,7 @@ ARMul_ScheduleEvent (ARMul_State * state, unsigned int delay,
906 state->Now = ARMul_Time (state); 907 state->Now = ARMul_Time (state);
907 when = (state->Now + delay) % EVENTLISTSIZE; 908 when = (state->Now + delay) % EVENTLISTSIZE;
908 event = (struct EventNode *) malloc (sizeof (struct EventNode)); 909 event = (struct EventNode *) malloc (sizeof (struct EventNode));
909
910 _dbg_assert_msg_(ARM11, event, "SKYEYE:ARMul_ScheduleEvent: malloc event error\n"); 910 _dbg_assert_msg_(ARM11, event, "SKYEYE:ARMul_ScheduleEvent: malloc event error\n");
911
912 event->func = what; 911 event->func = what;
913 event->next = *(state->EventPtr + when); 912 event->next = *(state->EventPtr + when);
914 *(state->EventPtr + when) = event; 913 *(state->EventPtr + when) = event;