notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
error checking for png
[picodrive.git]
/
cpu
/
Cyclone
/
OpAny.cpp
diff --git
a/cpu/Cyclone/OpAny.cpp
b/cpu/Cyclone/OpAny.cpp
index
cbdf5bb
..
a50114a
100644
(file)
--- a/
cpu/Cyclone/OpAny.cpp
+++ b/
cpu/Cyclone/OpAny.cpp
@@
-1,9
+1,11
@@
\r
#include "app.h"
\r
\r
\r
#include "app.h"
\r
\r
+int opend_op_changes_cycles, opend_check_interrupt, opend_check_trace;
\r
+
\r
static unsigned char OpData[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
\r
\r
static unsigned char OpData[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
\r
\r
-static unsigned short
CPU_CALL
OpRead16(unsigned int a)
\r
+static unsigned short OpRead16(unsigned int a)
\r
{
\r
return (unsigned short)( (OpData[a&15]<<8) | OpData[(a+1)&15] );
\r
}
\r
{
\r
return (unsigned short)( (OpData[a&15]<<8) | OpData[(a+1)&15] );
\r
}
\r
@@
-62,15
+64,17
@@
void OpStart(int op, int sea, int tea, int op_changes_cycles, int supervisor_che
if (last_op_count!=arm_op_count)
\r
ot("\n");
\r
pc_dirty = 1;
\r
if (last_op_count!=arm_op_count)
\r
ot("\n");
\r
pc_dirty = 1;
\r
+ opend_op_changes_cycles = opend_check_interrupt = opend_check_trace = 0;
\r
}
\r
\r
}
\r
\r
-void OpEnd(int sea, int tea
, int op_changes_cycles, int check_interrupt
)
\r
+void OpEnd(int sea, int tea)
\r
{
\r
int did_fetch=0;
\r
{
\r
int did_fetch=0;
\r
+ opend_check_trace = opend_check_trace && EMULATE_TRACE;
\r
#if MEMHANDLERS_CHANGE_CYCLES
\r
if ((sea >= 0x10 && sea != 0x3c) || (tea >= 0x10 && tea != 0x3c))
\r
{
\r
#if MEMHANDLERS_CHANGE_CYCLES
\r
if ((sea >= 0x10 && sea != 0x3c) || (tea >= 0x10 && tea != 0x3c))
\r
{
\r
- if (op_changes_cycles)
\r
+ if (op
end_op
_changes_cycles)
\r
{
\r
ot(" ldr r0,[r7,#0x5c] ;@ Load Cycles\n");
\r
ot(" ldrh r8,[r4],#2 ;@ Fetch next opcode\n");
\r
{
\r
ot(" ldr r0,[r7,#0x5c] ;@ Load Cycles\n");
\r
ot(" ldrh r8,[r4],#2 ;@ Fetch next opcode\n");
\r
@@
-85,12
+89,22
@@
void OpEnd(int sea, int tea, int op_changes_cycles, int check_interrupt)
#endif
\r
if (!did_fetch)
\r
ot(" ldrh r8,[r4],#2 ;@ Fetch next opcode\n");
\r
#endif
\r
if (!did_fetch)
\r
ot(" ldrh r8,[r4],#2 ;@ Fetch next opcode\n");
\r
+ if (opend_check_trace)
\r
+ ot(" ldr r1,[r7,#0x44]\n");
\r
ot(" subs r5,r5,#%d ;@ Subtract cycles\n",Cycles);
\r
ot(" subs r5,r5,#%d ;@ Subtract cycles\n",Cycles);
\r
- if (check_interrupt)
\r
+ if (opend_check_trace)
\r
+ {
\r
+ ot(";@ CheckTrace:\n");
\r
+ ot(" tst r1,#0x80\n");
\r
+ ot(" bne CycloneDoTraceWithChecks\n");
\r
+ ot(" cmp r5,#0\n");
\r
+ }
\r
+ if (opend_check_interrupt)
\r
{
\r
ot(" blt CycloneEnd\n");
\r
ot(";@ CheckInterrupt:\n");
\r
{
\r
ot(" blt CycloneEnd\n");
\r
ot(";@ CheckInterrupt:\n");
\r
- ot(" ldr r1,[r7,#0x44] ;@ Get SR high T_S__III and irq level\n");
\r
+ if (!opend_check_trace)
\r
+ ot(" ldr r1,[r7,#0x44]\n");
\r
ot(" movs r0,r1,lsr #24 ;@ Get IRQ level\n"); // same as ldrb r0,[r7,#0x47]
\r
ot(" ldreq pc,[r6,r8,asl #2] ;@ Jump to next opcode handler\n");
\r
ot(" cmp r0,#6 ;@ irq>6 ?\n");
\r
ot(" movs r0,r1,lsr #24 ;@ Get IRQ level\n"); // same as ldrb r0,[r7,#0x47]
\r
ot(" ldreq pc,[r6,r8,asl #2] ;@ Jump to next opcode handler\n");
\r
ot(" cmp r0,#6 ;@ irq>6 ?\n");
\r
@@
-119,17
+133,17
@@
int OpBase(int op,int size,int sepa)
// Get flags, trashes r2
\r
int OpGetFlags(int subtract,int xbit,int specialz)
\r
{
\r
// Get flags, trashes r2
\r
int OpGetFlags(int subtract,int xbit,int specialz)
\r
{
\r
- if (specialz) ot(" orr r2,r
9
,#0xb0000000 ;@ for old Z\n");
\r
+ if (specialz) ot(" orr r2,r
10
,#0xb0000000 ;@ for old Z\n");
\r
\r
\r
- ot(" mrs r
9,cpsr ;@ r9
=flags\n");
\r
+ ot(" mrs r
10,cpsr ;@ r10
=flags\n");
\r
\r
\r
- if (specialz) ot(" andeq r
9,r9
,r2 ;@ fix Z\n");
\r
+ if (specialz) ot(" andeq r
10,r10
,r2 ;@ fix Z\n");
\r
\r
\r
- if (subtract) ot(" eor r
9,r9
,#0x20000000 ;@ Invert carry\n");
\r
+ if (subtract) ot(" eor r
10,r10
,#0x20000000 ;@ Invert carry\n");
\r
\r
if (xbit)
\r
{
\r
\r
if (xbit)
\r
{
\r
- ot(" str r
9
,[r7,#0x4c] ;@ Save X bit\n");
\r
+ ot(" str r
10
,[r7,#0x4c] ;@ Save X bit\n");
\r
}
\r
return 0;
\r
}
\r
}
\r
return 0;
\r
}
\r