notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
famec: eliminate global context ptr
[picodrive.git]
/
cpu
/
fame
/
famec_opcodes.h
diff --git
a/cpu/fame/famec_opcodes.h
b/cpu/fame/famec_opcodes.h
index
e1e1e45
..
e069e9e
100644
(file)
--- a/
cpu/fame/famec_opcodes.h
+++ b/
cpu/fame/famec_opcodes.h
@@
-1,4
+1,10
@@
+#ifdef PICODRIVE_HACK
+#define NOT_POLLING ctx->not_polling = 1;
+#else
+#define NOT_POLLING
+#endif
+
// ORI
OPCODE(0x0000)
{
// ORI
OPCODE(0x0000)
{
@@
-638,7
+644,7
@@
OPCODE(0x007C)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
#ifdef USE_CYCLONE_TIMING
RET(0)
#else
#ifdef USE_CYCLONE_TIMING
RET(0)
#else
@@
-1296,7
+1302,7
@@
OPCODE(0x027C)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
RET(4)
}
RET(20)
@@
-1946,7
+1952,7
@@
OPCODE(0x0A7C)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(0)
}
RET(20)
RET(0)
}
RET(20)
@@
-3826,7
+3832,7
@@
OPCODE(0x083A)
FETCH_BYTE(src);
src = 1 << (src & 7);
FETCH_BYTE(src);
src = 1 << (src & 7);
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-3843,7
+3849,7
@@
OPCODE(0x083B)
FETCH_BYTE(src);
src = 1 << (src & 7);
FETCH_BYTE(src);
src = 1 << (src & 7);
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-4572,7
+4578,7
@@
OPCODE(0x013A)
src = DREGu8((Opcode >> 9) & 7);
src = 1 << (src & 7);
src = DREGu8((Opcode >> 9) & 7);
src = 1 << (src & 7);
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-4589,7
+4595,7
@@
OPCODE(0x013B)
src = DREGu8((Opcode >> 9) & 7);
src = 1 << (src & 7);
src = DREGu8((Opcode >> 9) & 7);
src = 1 << (src & 7);
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-5478,8
+5484,8
@@
OPCODE(0x1008)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5498,8
+5504,8
@@
OPCODE(0x1088)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5521,8
+5527,8
@@
OPCODE(0x10C8)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5545,8
+5551,8
@@
OPCODE(0x1108)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5569,8
+5575,8
@@
OPCODE(0x1148)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5593,8
+5599,8
@@
OPCODE(0x1188)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5617,8
+5623,8
@@
OPCODE(0x11C8)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5640,8
+5646,8
@@
OPCODE(0x13C8)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5663,8
+5669,8
@@
OPCODE(0x1EC8)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-5687,8
+5693,8
@@
OPCODE(0x1F08)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
/*
goto famec_Exec_End;
flag_C = 0;
@@
-7116,7
+7122,7
@@
OPCODE(0x103A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7135,7
+7141,7
@@
OPCODE(0x10BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7155,7
+7161,7
@@
OPCODE(0x10FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7176,7
+7182,7
@@
OPCODE(0x113A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7197,7
+7203,7
@@
OPCODE(0x117A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7218,7
+7224,7
@@
OPCODE(0x11BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7239,7
+7245,7
@@
OPCODE(0x11FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7259,7
+7265,7
@@
OPCODE(0x13FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7279,7
+7285,7
@@
OPCODE(0x1EFA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7300,7
+7306,7
@@
OPCODE(0x1F3A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, res)
PC++;
PRE_IO
READ_BYTE_F(adr, res)
@@
-7321,7
+7327,7
@@
OPCODE(0x103B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7340,7
+7346,7
@@
OPCODE(0x10BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7360,7
+7366,7
@@
OPCODE(0x10FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7381,7
+7387,7
@@
OPCODE(0x113B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7402,7
+7408,7
@@
OPCODE(0x117B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7423,7
+7429,7
@@
OPCODE(0x11BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7444,7
+7450,7
@@
OPCODE(0x11FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7464,7
+7470,7
@@
OPCODE(0x13FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7484,7
+7490,7
@@
OPCODE(0x1EFB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-7505,7
+7511,7
@@
OPCODE(0x1F3B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = (u
32
)(PC) - BasePC;
+ adr = (u
ptr
)(PC) - BasePC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, res)
@@
-9890,7
+9896,7
@@
OPCODE(0x203A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-9909,7
+9915,7
@@
OPCODE(0x20BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-9929,7
+9935,7
@@
OPCODE(0x20FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-9950,7
+9956,7
@@
OPCODE(0x213A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-9971,7
+9977,7
@@
OPCODE(0x217A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-9992,7
+9998,7
@@
OPCODE(0x21BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-10013,7
+10019,7
@@
OPCODE(0x21FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-10033,7
+10039,7
@@
OPCODE(0x23FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-10053,7
+10059,7
@@
OPCODE(0x2EFA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-10074,7
+10080,7
@@
OPCODE(0x2F3A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, res)
PC++;
PRE_IO
READ_LONG_F(adr, res)
@@
-10095,7
+10101,7
@@
OPCODE(0x203B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10114,7
+10120,7
@@
OPCODE(0x20BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10134,7
+10140,7
@@
OPCODE(0x20FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10155,7
+10161,7
@@
OPCODE(0x213B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10176,7
+10182,7
@@
OPCODE(0x217B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10197,7
+10203,7
@@
OPCODE(0x21BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10218,7
+10224,7
@@
OPCODE(0x21FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10238,7
+10244,7
@@
OPCODE(0x23FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10258,7
+10264,7
@@
OPCODE(0x2EFB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-10279,7
+10285,7
@@
OPCODE(0x2F3B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, res)
@@
-11017,7
+11023,7
@@
OPCODE(0x207A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_LONG_F(adr, res)
PC++;
PRE_IO
READSX_LONG_F(adr, res)
@@
-11032,7
+11038,7
@@
OPCODE(0x207B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, res)
@@
-12859,7
+12865,7
@@
OPCODE(0x303A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-12878,7
+12884,7
@@
OPCODE(0x30BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-12898,7
+12904,7
@@
OPCODE(0x30FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-12919,7
+12925,7
@@
OPCODE(0x313A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-12940,7
+12946,7
@@
OPCODE(0x317A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-12961,7
+12967,7
@@
OPCODE(0x31BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-12982,7
+12988,7
@@
OPCODE(0x31FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-13002,7
+13008,7
@@
OPCODE(0x33FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-13022,7
+13028,7
@@
OPCODE(0x3EFA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-13043,7
+13049,7
@@
OPCODE(0x3F3A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-13064,7
+13070,7
@@
OPCODE(0x303B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13083,7
+13089,7
@@
OPCODE(0x30BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13103,7
+13109,7
@@
OPCODE(0x30FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13124,7
+13130,7
@@
OPCODE(0x313B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13145,7
+13151,7
@@
OPCODE(0x317B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13166,7
+13172,7
@@
OPCODE(0x31BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13187,7
+13193,7
@@
OPCODE(0x31FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13207,7
+13213,7
@@
OPCODE(0x33FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13227,7
+13233,7
@@
OPCODE(0x3EFB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13248,7
+13254,7
@@
OPCODE(0x3F3B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-13986,7
+13992,7
@@
OPCODE(0x307A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_WORD_F(adr, res)
PC++;
PRE_IO
READSX_WORD_F(adr, res)
@@
-14001,7
+14007,7
@@
OPCODE(0x307B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, res)
@@
-16479,7
+16485,7
@@
OPCODE(0x44FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-16494,7
+16500,7
@@
OPCODE(0x44FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-16564,7
+16570,7
@@
OPCODE(0x46C0)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(12)
RET(4)
}
RET(12)
@@
-16593,7
+16599,7
@@
OPCODE(0x46D0)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
RET(4)
}
RET(16)
@@
-16623,7
+16629,7
@@
OPCODE(0x46D8)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
RET(4)
}
RET(16)
@@
-16653,7
+16659,7
@@
OPCODE(0x46E0)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(18)
RET(4)
}
RET(18)
@@
-16683,7
+16689,7
@@
OPCODE(0x46E8)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
RET(4)
}
RET(20)
@@
-16713,7
+16719,7
@@
OPCODE(0x46F0)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(22)
RET(4)
}
RET(22)
@@
-16743,7
+16749,7
@@
OPCODE(0x46F8)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
RET(4)
}
RET(20)
@@
-16772,7
+16778,7
@@
OPCODE(0x46F9)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(24)
RET(4)
}
RET(24)
@@
-16786,7
+16792,7
@@
OPCODE(0x46FA)
if (flag_S)
{
if (flag_S)
{
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, res)
PC++;
PRE_IO
READ_WORD_F(adr, res)
@@
-16802,7
+16808,7
@@
OPCODE(0x46FA)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
RET(4)
}
RET(20)
@@
-16816,7
+16822,7
@@
OPCODE(0x46FB)
if (flag_S)
{
if (flag_S)
{
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, res)
@@
-16832,7
+16838,7
@@
OPCODE(0x46FB)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(22)
RET(4)
}
RET(22)
@@
-16858,7
+16864,7
@@
OPCODE(0x46FC)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
RET(4)
}
RET(16)
@@
-16888,7
+16894,7
@@
OPCODE(0x46DF)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
RET(4)
}
RET(16)
@@
-16918,7
+16924,7
@@
OPCODE(0x46E7)
}
else
{
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(18)
RET(4)
}
RET(18)
@@
-16930,18
+16936,20
@@
OPCODE(0x4800)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
-
res
= DREGu8((Opcode >> 0) & 7);
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+
dst
= DREGu8((Opcode >> 0) & 7);
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- DREGu8((Opcode >> 0) & 7) = res;
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
RET(6)
}
flag_N = res;
RET(6)
}
@@
-16954,18
+16962,20
@@
OPCODE(0x4810)
adr = AREG((Opcode >> 0) & 7);
PRE_IO
adr = AREG((Opcode >> 0) & 7);
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(12)
flag_N = res;
POST_IO
RET(12)
@@
-16980,18
+16990,20
@@
OPCODE(0x4818)
adr = AREG((Opcode >> 0) & 7);
AREG((Opcode >> 0) & 7) += 1;
PRE_IO
adr = AREG((Opcode >> 0) & 7);
AREG((Opcode >> 0) & 7) += 1;
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(12)
flag_N = res;
POST_IO
RET(12)
@@
-17006,18
+17018,20
@@
OPCODE(0x4820)
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
PRE_IO
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(14)
flag_N = res;
POST_IO
RET(14)
@@
-17032,18
+17046,20
@@
OPCODE(0x4828)
FETCH_SWORD(adr);
adr += AREG((Opcode >> 0) & 7);
PRE_IO
FETCH_SWORD(adr);
adr += AREG((Opcode >> 0) & 7);
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(16)
flag_N = res;
POST_IO
RET(16)
@@
-17058,18
+17074,20
@@
OPCODE(0x4830)
adr = AREG((Opcode >> 0) & 7);
DECODE_EXT_WORD
PRE_IO
adr = AREG((Opcode >> 0) & 7);
DECODE_EXT_WORD
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(18)
flag_N = res;
POST_IO
RET(18)
@@
-17083,18
+17101,20
@@
OPCODE(0x4838)
FETCH_SWORD(adr);
PRE_IO
FETCH_SWORD(adr);
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(16)
flag_N = res;
POST_IO
RET(16)
@@
-17108,18
+17128,20
@@
OPCODE(0x4839)
FETCH_LONG(adr);
PRE_IO
FETCH_LONG(adr);
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(20)
flag_N = res;
POST_IO
RET(20)
@@
-17134,18
+17156,20
@@
OPCODE(0x481F)
adr = AREG(7);
AREG(7) += 2;
PRE_IO
adr = AREG(7);
AREG(7) += 2;
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(12)
flag_N = res;
POST_IO
RET(12)
@@
-17160,18
+17184,20
@@
OPCODE(0x4827)
adr = AREG(7) - 2;
AREG(7) = adr;
PRE_IO
adr = AREG(7) - 2;
AREG(7) = adr;
PRE_IO
- READ_BYTE_F(adr,
res
)
- res =
0x9a - res
- ((flag_X >> M68K_SR_X_SFT) & 1);
+ READ_BYTE_F(adr,
dst
)
+ res =
-dst
- ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res != 0
x9a
)
+ if (res != 0)
{
{
- if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
- res &= 0xFF;
- WRITE_BYTE_F(adr, res)
+ flag_V = res;
+ if (((res|dst) & 0x0f) == 0) res = (res & 0xf0) + 6;
+ res = (res + 0x9a) & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_V &= ~res;
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
flag_NotZ |= res;
flag_X = flag_C = M68K_SR_C;
}
- else flag_X = flag_C = 0;
+ else flag_
V = flag_
X = flag_C = 0;
flag_N = res;
POST_IO
RET(14)
flag_N = res;
POST_IO
RET(14)
@@
-17250,7
+17276,7
@@
OPCODE(0x487A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
PUSH_32_F(adr)
PC++;
PRE_IO
PUSH_32_F(adr)
@@
-17264,7
+17290,7
@@
OPCODE(0x487B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
PUSH_32_F(adr)
DECODE_EXT_WORD
PRE_IO
PUSH_32_F(adr)
@@
-17311,7
+17337,7
@@
OPCODE(0x4890)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(8)
#else
#ifdef USE_CYCLONE_TIMING
RET(8)
#else
@@
-17343,7
+17369,7
@@
OPCODE(0x48A0)
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (dst - adr) * 2;
+
ctx->
io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
RET(8)
}
@@
-17371,7
+17397,7
@@
OPCODE(0x48A8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
@@
-17403,7
+17429,7
@@
OPCODE(0x48B0)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(14)
#else
#ifdef USE_CYCLONE_TIMING
RET(14)
#else
@@
-17434,7
+17460,7
@@
OPCODE(0x48B8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
@@
-17465,7
+17491,7
@@
OPCODE(0x48B9)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-17497,7
+17523,7
@@
OPCODE(0x48A7)
} while (res >>= 1);
AREG(7) = adr;
POST_IO
} while (res >>= 1);
AREG(7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (dst - adr) * 2;
+
ctx->
io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
RET(8)
}
@@
-17524,7
+17550,7
@@
OPCODE(0x48D0)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(8)
#else
#ifdef USE_CYCLONE_TIMING
RET(8)
#else
@@
-17556,7
+17582,7
@@
OPCODE(0x48E0)
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (dst - adr) * 2;
+
ctx->
io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
RET(8)
}
@@
-17584,7
+17610,7
@@
OPCODE(0x48E8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
@@
-17616,7
+17642,7
@@
OPCODE(0x48F0)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(14)
#else
#ifdef USE_CYCLONE_TIMING
RET(14)
#else
@@
-17647,7
+17673,7
@@
OPCODE(0x48F8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
@@
-17678,7
+17704,7
@@
OPCODE(0x48F9)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-17710,7
+17736,7
@@
OPCODE(0x48E7)
} while (res >>= 1);
AREG(7) = adr;
POST_IO
} while (res >>= 1);
AREG(7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (dst - adr) * 2;
+
ctx->
io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
RET(8)
}
@@
-18293,7
+18319,7
@@
OPCODE(0x4AD0)
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18323,7
+18349,7
@@
OPCODE(0x4AD8)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18353,7
+18379,7
@@
OPCODE(0x4AE0)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18383,7
+18409,7
@@
OPCODE(0x4AE8)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18413,7
+18439,7
@@
OPCODE(0x4AF0)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18442,7
+18468,7
@@
OPCODE(0x4AF8)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18471,7
+18497,7
@@
OPCODE(0x4AF9)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18501,7
+18527,7
@@
OPCODE(0x4ADF)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18531,7
+18557,7
@@
OPCODE(0x4AE7)
flag_N = res;
#ifdef PICODRIVE_HACK
flag_N = res;
#ifdef PICODRIVE_HACK
- if (
g_m68kcontext
== &PicoCpuFS68k) {
+ if (
ctx
== &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
@@
-18548,21
+18574,25
@@
RET(8)
// ILLEGAL
OPCODE(0x4AFC)
{
// ILLEGAL
OPCODE(0x4AFC)
{
- SET_PC(execute_exception(M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR));
+#ifdef PICODRIVE_HACK
+ extern void SekFinishIdleDet(void);
+ SekFinishIdleDet();
+#endif
+ SET_PC(execute_exception(ctx, M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR));
RET(0)
}
// ILLEGAL A000-AFFF
OPCODE(0xA000)
{
RET(0)
}
// ILLEGAL A000-AFFF
OPCODE(0xA000)
{
- SET_PC(execute_exception(M68K_1010_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_1010_EX, GET_PC-2, GET_SR));
RET(0)
}
// ILLEGAL F000-FFFF
OPCODE(0xF000)
{
RET(0)
}
// ILLEGAL F000-FFFF
OPCODE(0xF000)
{
- SET_PC(execute_exception(M68K_1111_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_1111_EX, GET_PC-2, GET_SR));
RET(0) // 4 already taken by exc. handler
}
RET(0) // 4 already taken by exc. handler
}
@@
-18589,7
+18619,7
@@
OPCODE(0x4C90)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
@@
-18621,7
+18651,7
@@
OPCODE(0x4C98)
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
RET(12)
}
@@
-18649,7
+18679,7
@@
OPCODE(0x4CA8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-18681,7
+18711,7
@@
OPCODE(0x4CB0)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
@@
-18712,7
+18742,7
@@
OPCODE(0x4CB8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-18743,7
+18773,7
@@
OPCODE(0x4CB9)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
@@
-18760,7
+18790,7
@@
OPCODE(0x4CBA)
s32 *psrc;
FETCH_WORD(res);
s32 *psrc;
FETCH_WORD(res);
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
psrc = &DREGs32(0);
dst = adr;
PC++;
psrc = &DREGs32(0);
dst = adr;
@@
-18775,7
+18805,7
@@
OPCODE(0x4CBA)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-18792,7
+18822,7
@@
OPCODE(0x4CBB)
s32 *psrc;
FETCH_WORD(res);
s32 *psrc;
FETCH_WORD(res);
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
psrc = &DREGs32(0);
dst = adr;
DECODE_EXT_WORD
psrc = &DREGs32(0);
dst = adr;
@@
-18807,7
+18837,7
@@
OPCODE(0x4CBB)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
@@
-18839,7
+18869,7
@@
OPCODE(0x4C9F)
} while (res >>= 1);
AREG(7) = adr;
POST_IO
} while (res >>= 1);
AREG(7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
RET(12)
}
@@
-18866,7
+18896,7
@@
OPCODE(0x4CD0)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
@@
-18898,7
+18928,7
@@
OPCODE(0x4CD8)
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
RET(12)
}
@@
-18926,7
+18956,7
@@
OPCODE(0x4CE8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-18958,7
+18988,7
@@
OPCODE(0x4CF0)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
@@
-18989,7
+19019,7
@@
OPCODE(0x4CF8)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-19020,7
+19050,7
@@
OPCODE(0x4CF9)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
@@
-19037,7
+19067,7
@@
OPCODE(0x4CFA)
u32 *psrc;
FETCH_WORD(res);
u32 *psrc;
FETCH_WORD(res);
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
psrc = &DREGu32(0);
dst = adr;
PC++;
psrc = &DREGu32(0);
dst = adr;
@@
-19052,7
+19082,7
@@
OPCODE(0x4CFA)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
@@
-19069,7
+19099,7
@@
OPCODE(0x4CFB)
u32 *psrc;
FETCH_WORD(res);
u32 *psrc;
FETCH_WORD(res);
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
psrc = &DREGu32(0);
dst = adr;
DECODE_EXT_WORD
psrc = &DREGu32(0);
dst = adr;
@@
-19084,7
+19114,7
@@
OPCODE(0x4CFB)
psrc++;
} while (res >>= 1);
POST_IO
psrc++;
} while (res >>= 1);
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
@@
-19116,14
+19146,14
@@
OPCODE(0x4CDF)
} while (res >>= 1);
AREG(7) = adr;
POST_IO
} while (res >>= 1);
AREG(7) = adr;
POST_IO
-
m68kcontext.
io_cycle_counter -= (adr - dst) * 2;
+
ctx->
io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
// TRAP
OPCODE(0x4E40)
{
RET(12)
}
// TRAP
OPCODE(0x4E40)
{
- SET_PC(execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF), GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_TRAP_BASE_EX + (Opcode & 0xF), GET_PC, GET_SR));
RET(4)
}
RET(4)
}
@@
-19194,7
+19224,7
@@
OPCODE(0x4E60)
if (!flag_S)
{
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
res = AREGu32((Opcode >> 0) & 7);
RET(4)
}
res = AREGu32((Opcode >> 0) & 7);
@@
-19210,7
+19240,7
@@
OPCODE(0x4E68)
if (!flag_S)
{
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
res = ASP;
RET(4)
}
res = ASP;
@@
-19226,11
+19256,11
@@
OPCODE(0x4E70)
if (!flag_S)
{
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
PRE_IO
RET(4)
}
PRE_IO
- if (
m68kcontext.reset_handler) m68kcontext.
reset_handler();
+ if (
ctx->reset_handler) ctx->
reset_handler();
// CPU->Reset_CallBack();
POST_IO
RET(132)
// CPU->Reset_CallBack();
POST_IO
RET(132)
@@
-19250,7
+19280,7
@@
OPCODE(0x4E72)
if (!flag_S)
{
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
FETCH_WORD(res);
RET(4)
}
FETCH_WORD(res);
@@
-19262,9
+19292,8
@@
OPCODE(0x4E72)
AREG(7) = ASP;
ASP = res;
}
AREG(7) = ASP;
ASP = res;
}
- m68kcontext.execinfo |= FM68K_HALTED;
- m68kcontext.io_cycle_counter = 0;
-RET(4)
+ ctx->execinfo |= FM68K_HALTED;
+RET0()
}
// RTE
}
// RTE
@@
-19275,7
+19304,7
@@
OPCODE(0x4E73)
if (!flag_S)
{
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
PRE_IO
RET(4)
}
PRE_IO
@@
-19290,7
+19319,7
@@
OPCODE(0x4E73)
ASP = res;
}
POST_IO
ASP = res;
}
POST_IO
-
m68kcontext.
execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
+
ctx->
execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
CHECK_INT_TO_JUMP(20)
RET(20)
}
CHECK_INT_TO_JUMP(20)
RET(20)
}
@@
-19313,7
+19342,7
@@
RET(16)
OPCODE(0x4E76)
{
if (flag_V & 0x80)
OPCODE(0x4E76)
{
if (flag_V & 0x80)
- SET_PC(execute_exception(M68K_TRAPV_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_TRAPV_EX, GET_PC, GET_SR));
RET(4)
}
RET(4)
}
@@
-19343,7
+19372,7
@@
OPCODE(0x4E90)
{
u32 oldPC;
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19364,7
+19393,7
@@
OPCODE(0x4EA8)
{
u32 oldPC;
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19385,7
+19414,7
@@
OPCODE(0x4EB0)
{
u32 oldPC;
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19405,7
+19434,7
@@
OPCODE(0x4EB8)
{
u32 oldPC;
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19425,7
+19454,7
@@
OPCODE(0x4EB9)
{
u32 oldPC;
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19441,12
+19470,12
@@
OPCODE(0x4EBA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
{
u32 oldPC;
PC++;
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19462,12
+19491,12
@@
OPCODE(0x4EBB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
{
u32 oldPC;
DECODE_EXT_WORD
{
u32 oldPC;
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PRE_IO
PUSH_32_F(oldPC)
}
PRE_IO
PUSH_32_F(oldPC)
}
@@
-19545,7
+19574,7
@@
OPCODE(0x4EFA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
SET_PC(adr)
CHECK_BRANCH_EXCEPTION(adr)
PC++;
SET_PC(adr)
CHECK_BRANCH_EXCEPTION(adr)
@@
-19558,7
+19587,7
@@
OPCODE(0x4EFB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
SET_PC(adr)
CHECK_BRANCH_EXCEPTION(adr)
DECODE_EXT_WORD
SET_PC(adr)
CHECK_BRANCH_EXCEPTION(adr)
@@
-19568,15
+19597,14
@@
RET(14)
// CHK
OPCODE(0x4180)
{
// CHK
OPCODE(0x4180)
{
- u32 adr, res;
- u32 src, dst;
+ s32 src, res;
- src = DREG
u
16((Opcode >> 0) & 7);
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ src = DREG
s
16((Opcode >> 0) & 7);
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
RET(10)
}
}
RET(10)
}
@@
-19584,17
+19612,17
@@
RET(10)
// CHK
OPCODE(0x4190)
{
// CHK
OPCODE(0x4190)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
adr = AREG((Opcode >> 0) & 7);
PRE_IO
adr = AREG((Opcode >> 0) & 7);
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
}
POST_IO
RET(14)
@@
-19603,18
+19631,18
@@
RET(14)
// CHK
OPCODE(0x4198)
{
// CHK
OPCODE(0x4198)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
adr = AREG((Opcode >> 0) & 7);
AREG((Opcode >> 0) & 7) += 2;
PRE_IO
adr = AREG((Opcode >> 0) & 7);
AREG((Opcode >> 0) & 7) += 2;
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
}
POST_IO
RET(14)
@@
-19623,18
+19651,18
@@
RET(14)
// CHK
OPCODE(0x41A0)
{
// CHK
OPCODE(0x41A0)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
adr = AREG((Opcode >> 0) & 7) - 2;
AREG((Opcode >> 0) & 7) = adr;
PRE_IO
adr = AREG((Opcode >> 0) & 7) - 2;
AREG((Opcode >> 0) & 7) = adr;
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(16)
}
POST_IO
RET(16)
@@
-19643,18
+19671,18
@@
RET(16)
// CHK
OPCODE(0x41A8)
{
// CHK
OPCODE(0x41A8)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
FETCH_SWORD(adr);
adr += AREG((Opcode >> 0) & 7);
PRE_IO
FETCH_SWORD(adr);
adr += AREG((Opcode >> 0) & 7);
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(18)
}
POST_IO
RET(18)
@@
-19663,18
+19691,18
@@
RET(18)
// CHK
OPCODE(0x41B0)
{
// CHK
OPCODE(0x41B0)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
adr = AREG((Opcode >> 0) & 7);
DECODE_EXT_WORD
PRE_IO
adr = AREG((Opcode >> 0) & 7);
DECODE_EXT_WORD
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(20)
}
POST_IO
RET(20)
@@
-19683,17
+19711,17
@@
RET(20)
// CHK
OPCODE(0x41B8)
{
// CHK
OPCODE(0x41B8)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
FETCH_SWORD(adr);
PRE_IO
FETCH_SWORD(adr);
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(18)
}
POST_IO
RET(18)
@@
-19702,17
+19730,17
@@
RET(18)
// CHK
OPCODE(0x41B9)
{
// CHK
OPCODE(0x41B9)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
FETCH_LONG(adr);
PRE_IO
FETCH_LONG(adr);
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(22)
}
POST_IO
RET(22)
@@
-19721,18
+19749,18
@@
RET(22)
// CHK
OPCODE(0x41BA)
{
// CHK
OPCODE(0x41BA)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
PC++;
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(18)
}
POST_IO
RET(18)
@@
-19741,18
+19769,18
@@
RET(18)
// CHK
OPCODE(0x41BB)
{
// CHK
OPCODE(0x41BB)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
DECODE_EXT_WORD
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(20)
}
POST_IO
RET(20)
@@
-19761,15
+19789,15
@@
RET(20)
// CHK
OPCODE(0x41BC)
{
// CHK
OPCODE(0x41BC)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
- FETCH_WORD(src);
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ FETCH_
S
WORD(src);
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
}
POST_IO
RET(14)
@@
-19778,18
+19806,18
@@
RET(14)
// CHK
OPCODE(0x419F)
{
// CHK
OPCODE(0x419F)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
adr = AREG(7);
AREG(7) += 2;
PRE_IO
adr = AREG(7);
AREG(7) += 2;
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
}
POST_IO
RET(14)
@@
-19798,18
+19826,18
@@
RET(14)
// CHK
OPCODE(0x41A7)
{
// CHK
OPCODE(0x41A7)
{
-
u32 adr
, res;
- u32
src, dst
;
+
s32 src
, res;
+ u32
adr
;
adr = AREG(7) - 2;
AREG(7) = adr;
PRE_IO
adr = AREG(7) - 2;
AREG(7) = adr;
PRE_IO
- READ_WORD_F(adr, src)
- res = DREG
u
16((Opcode >> 9) & 7);
- if ((
(s32)
res < 0) || (res > src))
+ READ
SX
_WORD_F(adr, src)
+ res = DREG
s
16((Opcode >> 9) & 7);
+ if ((res < 0) || (res > src))
{
flag_N = res >> 8;
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(16)
}
POST_IO
RET(16)
@@
-19883,7
+19911,7
@@
OPCODE(0x41FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
res = adr;
AREG((Opcode >> 9) & 7) = res;
PC++;
res = adr;
AREG((Opcode >> 9) & 7) = res;
@@
-19896,7
+19924,7
@@
OPCODE(0x41FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
res = adr;
AREG((Opcode >> 9) & 7) = res;
DECODE_EXT_WORD
res = adr;
AREG((Opcode >> 9) & 7) = res;
@@
-23299,6
+23327,8
@@
OPCODE(0x51C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
res = DREGu16((Opcode >> 0) & 7);
res--;
DREGu16((Opcode >> 0) & 7) = res;
res = DREGu16((Opcode >> 0) & 7);
res--;
DREGu16((Opcode >> 0) & 7) = res;
@@
-23306,7
+23336,7
@@
OPCODE(0x51C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23322,6
+23352,8
@@
OPCODE(0x52C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if ((!flag_NotZ) || (flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
if ((!flag_NotZ) || (flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23331,7
+23363,7
@@
OPCODE(0x52C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23353,6
+23385,8
@@
OPCODE(0x53C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_NotZ && (!(flag_C & 0x100)))
{
res = DREGu16((Opcode >> 0) & 7);
if (flag_NotZ && (!(flag_C & 0x100)))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23362,7
+23396,7
@@
OPCODE(0x53C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23384,6
+23418,8
@@
OPCODE(0x54C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_C & 0x100)
{
res = DREGu16((Opcode >> 0) & 7);
if (flag_C & 0x100)
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23393,7
+23429,7
@@
OPCODE(0x54C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23415,6
+23451,8
@@
OPCODE(0x55C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!(flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
if (!(flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23424,7
+23462,7
@@
OPCODE(0x55C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23446,6
+23484,8
@@
OPCODE(0x56C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
if (!flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23455,7
+23495,7
@@
OPCODE(0x56C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23477,6
+23517,8
@@
OPCODE(0x57C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
if (flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23486,7
+23528,7
@@
OPCODE(0x57C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23508,6
+23550,8
@@
OPCODE(0x58C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_V & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
if (flag_V & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23517,7
+23561,7
@@
OPCODE(0x58C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23539,6
+23583,8
@@
OPCODE(0x59C8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!(flag_V & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
if (!(flag_V & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23548,7
+23594,7
@@
OPCODE(0x59C8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23570,6
+23616,8
@@
OPCODE(0x5AC8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_N & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
if (flag_N & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23579,7
+23627,7
@@
OPCODE(0x5AC8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23601,6
+23649,8
@@
OPCODE(0x5BC8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!(flag_N & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
if (!(flag_N & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23610,7
+23660,7
@@
OPCODE(0x5BC8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23632,6
+23682,8
@@
OPCODE(0x5CC8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if ((flag_N ^ flag_V) & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
if ((flag_N ^ flag_V) & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23641,7
+23693,7
@@
OPCODE(0x5CC8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23663,6
+23715,8
@@
OPCODE(0x5DC8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
if (!((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23672,7
+23726,7
@@
OPCODE(0x5DC8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23694,6
+23748,8
@@
OPCODE(0x5EC8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23703,7
+23759,7
@@
OPCODE(0x5EC8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-23725,6
+23781,8
@@
OPCODE(0x5FC8)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
res = DREGu16((Opcode >> 0) & 7);
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
res = DREGu16((Opcode >> 0) & 7);
@@
-23734,7
+23792,7
@@
OPCODE(0x5FC8)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-24993,7
+25051,7
@@
OPCODE(0x6201)
if (flag_NotZ && (!(flag_C & 0x100)))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (flag_NotZ && (!(flag_C & 0x100)))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25007,7
+25065,7
@@
OPCODE(0x6301)
if ((!flag_NotZ) || (flag_C & 0x100))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if ((!flag_NotZ) || (flag_C & 0x100))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25021,7
+25079,7
@@
OPCODE(0x6401)
if (!(flag_C & 0x100))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (!(flag_C & 0x100))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25035,7
+25093,7
@@
OPCODE(0x6501)
if (flag_C & 0x100)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (flag_C & 0x100)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25049,7
+25107,7
@@
OPCODE(0x6601)
if (flag_NotZ)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (flag_NotZ)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25063,7
+25121,7
@@
OPCODE(0x6701)
if (!flag_NotZ)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (!flag_NotZ)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25077,7
+25135,7
@@
OPCODE(0x6801)
if (!(flag_V & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (!(flag_V & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25091,7
+25149,7
@@
OPCODE(0x6901)
if (flag_V & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (flag_V & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25105,7
+25163,7
@@
OPCODE(0x6A01)
if (!(flag_N & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (!(flag_N & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25119,7
+25177,7
@@
OPCODE(0x6B01)
if (flag_N & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (flag_N & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25133,7
+25191,7
@@
OPCODE(0x6C01)
if (!((flag_N ^ flag_V) & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (!((flag_N ^ flag_V) & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25147,7
+25205,7
@@
OPCODE(0x6D01)
if ((flag_N ^ flag_V) & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if ((flag_N ^ flag_V) & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25161,7
+25219,7
@@
OPCODE(0x6E01)
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25175,7
+25233,7
@@
OPCODE(0x6F01)
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
@@
-25190,7
+25248,7
@@
OPCODE(0x6200)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25210,7
+25268,7
@@
OPCODE(0x6300)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25230,7
+25288,7
@@
OPCODE(0x6400)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25250,7
+25308,7
@@
OPCODE(0x6500)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25270,7
+25328,7
@@
OPCODE(0x6600)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25290,7
+25348,7
@@
OPCODE(0x6700)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25310,7
+25368,7
@@
OPCODE(0x6800)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25330,7
+25388,7
@@
OPCODE(0x6900)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25350,7
+25408,7
@@
OPCODE(0x6A00)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25370,7
+25428,7
@@
OPCODE(0x6B00)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25390,7
+25448,7
@@
OPCODE(0x6C00)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25410,7
+25468,7
@@
OPCODE(0x6D00)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25430,7
+25488,7
@@
OPCODE(0x6E00)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25450,7
+25508,7
@@
OPCODE(0x6F00)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25464,7
+25522,7
@@
RET(12)
OPCODE(0x6001)
{
#ifdef FAMEC_CHECK_BRANCHES
OPCODE(0x6001)
{
#ifdef FAMEC_CHECK_BRANCHES
- u32 newPC =
(u32)(PC) - Base
PC;
+ u32 newPC =
GET_
PC;
s8 offs=Opcode;
newPC += offs;
SET_PC(newPC);
s8 offs=Opcode;
newPC += offs;
SET_PC(newPC);
@@
-25484,7
+25542,7
@@
OPCODE(0x6000)
{
u32 newPC;
{
u32 newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
newPC += GET_SWORD;
SET_PC(newPC);
CHECK_BRANCH_EXCEPTION(newPC)
@@
-25502,7
+25560,7
@@
OPCODE(0x6101)
PRE_IO
PRE_IO
- oldPC =
(u32)(PC) - Base
PC;
+ oldPC =
GET_
PC;
PUSH_32_F(oldPC)
#ifdef FAMEC_CHECK_BRANCHES
offs = Opcode;
PUSH_32_F(oldPC)
#ifdef FAMEC_CHECK_BRANCHES
offs = Opcode;
@@
-25526,7
+25584,7
@@
OPCODE(0x6100)
{
u32 oldPC, newPC;
{
u32 oldPC, newPC;
- newPC =
(u32)(PC) - Base
PC;
+ newPC =
GET_
PC;
oldPC = newPC + 2;
PUSH_32_F(oldPC)
newPC += GET_SWORD;
oldPC = newPC + 2;
PUSH_32_F(oldPC)
newPC += GET_SWORD;
@@
-25717,7
+25775,7
@@
OPCODE(0x803A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, src)
PC++;
PRE_IO
READ_BYTE_F(adr, src)
@@
-25738,7
+25796,7
@@
OPCODE(0x803B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
@@
-25979,7
+26037,7
@@
OPCODE(0x807A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
PC++;
PRE_IO
READ_WORD_F(adr, src)
@@
-26000,7
+26058,7
@@
OPCODE(0x807B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
@@
-26241,7
+26299,7
@@
OPCODE(0x80BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, src)
PC++;
PRE_IO
READ_LONG_F(adr, src)
@@
-26262,7
+26320,7
@@
OPCODE(0x80BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
@@
-26899,19
+26957,19
@@
OPCODE(0x8100)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
src = DREGu8((Opcode >> 0) & 7);
dst = DREGu8((Opcode >> 9) & 7);
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
src = DREGu8((Opcode >> 0) & 7);
dst = DREGu8((Opcode >> 9) & 7);
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res >
9) res -
= 6;
+ if (res >
0xF) corf
= 6;
res += (dst & 0xF0) - (src & 0xF0);
res += (dst & 0xF0) - (src & 0xF0);
- if (res > 0x99)
- {
- res += 0xA0;
- flag_X = flag_C = M68K_SR_C;
- }
- else flag_X = flag_C = 0;
- flag_NotZ |= res & 0xFF;
+ flag_V = res;
+ flag_X = flag_C = (s32)res < (s32)corf ? M68K_SR_C : 0;
+ if (res > 0xff) res += 0xA0;
+ res = (res - corf) & 0xFF;
+ flag_V &= ~res;
+ flag_NotZ |= res;
flag_N = res;
DREGu8((Opcode >> 9) & 7) = res;
RET(6)
flag_N = res;
DREGu8((Opcode >> 9) & 7) = res;
RET(6)
@@
-26922,6
+26980,7
@@
OPCODE(0x8108)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
@@
-26931,15
+26990,14
@@
OPCODE(0x8108)
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res >
9) res -
= 6;
+ if (res >
0xF) corf
= 6;
res += (dst & 0xF0) - (src & 0xF0);
res += (dst & 0xF0) - (src & 0xF0);
- if (res > 0x99)
- {
- res += 0xA0;
- flag_X = flag_C = M68K_SR_C;
- }
- else flag_X = flag_C = 0;
- flag_NotZ |= res & 0xFF;
+ flag_V = res;
+ flag_X = flag_C = (s32)res < (s32)corf ? M68K_SR_C : 0;
+ if (res > 0xff) res += 0xA0;
+ res = (res - corf) & 0xFF;
+ flag_V &= ~res;
+ flag_NotZ |= res;
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
@@
-26951,6
+27009,7
@@
OPCODE(0x810F)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG(7) - 2;
AREG(7) = adr;
adr = AREG(7) - 2;
AREG(7) = adr;
@@
-26960,15
+27019,14
@@
OPCODE(0x810F)
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res >
9) res -
= 6;
+ if (res >
0xF) corf
= 6;
res += (dst & 0xF0) - (src & 0xF0);
res += (dst & 0xF0) - (src & 0xF0);
- if (res > 0x99)
- {
- res += 0xA0;
- flag_X = flag_C = M68K_SR_C;
- }
- else flag_X = flag_C = 0;
- flag_NotZ |= res & 0xFF;
+ flag_V = res;
+ flag_X = flag_C = (s32)res < (s32)corf ? M68K_SR_C : 0;
+ if (res > 0xff) res += 0xA0;
+ res = (res - corf) & 0xFF;
+ flag_V &= ~res;
+ flag_NotZ |= res;
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
@@
-26980,6
+27038,7
@@
OPCODE(0x8F08)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
@@
-26989,15
+27048,14
@@
OPCODE(0x8F08)
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res >
9) res -
= 6;
+ if (res >
0xF) corf
= 6;
res += (dst & 0xF0) - (src & 0xF0);
res += (dst & 0xF0) - (src & 0xF0);
- if (res > 0x99)
- {
- res += 0xA0;
- flag_X = flag_C = M68K_SR_C;
- }
- else flag_X = flag_C = 0;
- flag_NotZ |= res & 0xFF;
+ flag_V = res;
+ flag_X = flag_C = (s32)res < (s32)corf ? M68K_SR_C : 0;
+ if (res > 0xff) res += 0xA0;
+ res = (res - corf) & 0xFF;
+ flag_V &= ~res;
+ flag_NotZ |= res;
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
@@
-27009,6
+27067,7
@@
OPCODE(0x8F0F)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG(7) - 2;
AREG(7) = adr;
adr = AREG(7) - 2;
AREG(7) = adr;
@@
-27018,15
+27077,14
@@
OPCODE(0x8F0F)
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res >
9) res -
= 6;
+ if (res >
0xF) corf
= 6;
res += (dst & 0xF0) - (src & 0xF0);
res += (dst & 0xF0) - (src & 0xF0);
- if (res > 0x99)
- {
- res += 0xA0;
- flag_X = flag_C = M68K_SR_C;
- }
- else flag_X = flag_C = 0;
- flag_NotZ |= res & 0xFF;
+ flag_V = res;
+ flag_X = flag_C = (s32)res < (s32)corf ? M68K_SR_C : 0;
+ if (res > 0xff) res += 0xA0;
+ res = (res - corf) & 0xFF;
+ flag_V &= ~res;
+ flag_NotZ |= res;
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
flag_N = res;
WRITE_BYTE_F(adr, res)
POST_IO
@@
-27042,7
+27100,7
@@
OPCODE(0x80C0)
src = DREGu16((Opcode >> 0) & 7);
if (src == 0)
{
src = DREGu16((Opcode >> 0) & 7);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(140)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(140)
#else
@@
-27090,7
+27148,7
@@
OPCODE(0x80D0)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
@@
-27139,7
+27197,7
@@
OPCODE(0x80D8)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
@@
-27188,7
+27246,7
@@
OPCODE(0x80E0)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(146)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(146)
#else
@@
-27237,7
+27295,7
@@
OPCODE(0x80E8)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
@@
-27286,7
+27344,7
@@
OPCODE(0x80F0)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(150)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(150)
#else
@@
-27334,7
+27392,7
@@
OPCODE(0x80F8)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
@@
-27382,9
+27440,9
@@
OPCODE(0x80F9)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
#ifdef USE_CYCLONE_TIMING_DIV
-RET(1
6
2)
+RET(1
5
2)
#else
RET(22)
#endif
#else
RET(22)
#endif
@@
-27400,7
+27458,7
@@
RET(22)
{
flag_V = M68K_SR_V;
#ifdef USE_CYCLONE_TIMING_DIV
{
flag_V = M68K_SR_V;
#ifdef USE_CYCLONE_TIMING_DIV
-RET(1
6
2)
+RET(1
5
2)
#else
RET(82)
#endif
#else
RET(82)
#endif
@@
-27413,7
+27471,7
@@
RET(162)
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-RET(1
6
2)
+RET(1
5
2)
#else
RET(102)
#endif
#else
RET(102)
#endif
@@
-27425,13
+27483,13
@@
OPCODE(0x80FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
if (src == 0)
{
PC++;
PRE_IO
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
@@
-27474,15
+27532,15
@@
OPCODE(0x80FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
if (src == 0)
{
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
#ifdef USE_CYCLONE_TIMING_DIV
-RET(1
6
0)
+RET(1
5
0)
#else
RET(20)
#endif
#else
RET(20)
#endif
@@
-27498,7
+27556,7
@@
RET(20)
{
flag_V = M68K_SR_V;
#ifdef USE_CYCLONE_TIMING_DIV
{
flag_V = M68K_SR_V;
#ifdef USE_CYCLONE_TIMING_DIV
-RET(1
6
0)
+RET(1
5
0)
#else
RET(80)
#endif
#else
RET(80)
#endif
@@
-27511,7
+27569,7
@@
RET(160)
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-RET(1
6
0)
+RET(1
5
0)
#else
RET(100)
#endif
#else
RET(100)
#endif
@@
-27526,7
+27584,7
@@
OPCODE(0x80FC)
FETCH_WORD(src);
if (src == 0)
{
FETCH_WORD(src);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
@@
-27575,7
+27633,7
@@
OPCODE(0x80DF)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
@@
-27624,7
+27682,7
@@
OPCODE(0x80E7)
READ_WORD_F(adr, src)
if (src == 0)
{
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(146)
#else
#ifdef USE_CYCLONE_TIMING_DIV
RET(146)
#else
@@
-27670,7
+27728,7
@@
OPCODE(0x81C0)
src = (s32)DREGs16((Opcode >> 0) & 7);
if (src == 0)
{
src = (s32)DREGs16((Opcode >> 0) & 7);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81C0;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81C0;
#endif
@@
-27710,7
+27768,7
@@
goto end81C0;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81C0:
m68kcontext.
io_cycle_counter -= 50;
+end81C0:
ctx->
io_cycle_counter -= 50;
#endif
RET(108)
}
#endif
RET(108)
}
@@
-27726,7
+27784,7
@@
OPCODE(0x81D0)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81D0;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81D0;
#endif
@@
-27766,7
+27824,7
@@
goto end81D0;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81D0:
m68kcontext.
io_cycle_counter -= 50;
+end81D0:
ctx->
io_cycle_counter -= 50;
#endif
RET(112)
}
#endif
RET(112)
}
@@
-27783,7
+27841,7
@@
OPCODE(0x81D8)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81D8;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81D8;
#endif
@@
-27823,7
+27881,7
@@
goto end81D8;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81D8:
m68kcontext.
io_cycle_counter -= 50;
+end81D8:
ctx->
io_cycle_counter -= 50;
#endif
RET(112)
}
#endif
RET(112)
}
@@
-27840,7
+27898,7
@@
OPCODE(0x81E0)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E0;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E0;
#endif
@@
-27880,7
+27938,7
@@
goto end81E0;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81E0:
m68kcontext.
io_cycle_counter -= 50;
+end81E0:
ctx->
io_cycle_counter -= 50;
#endif
RET(114)
}
#endif
RET(114)
}
@@
-27897,7
+27955,7
@@
OPCODE(0x81E8)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E8;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E8;
#endif
@@
-27937,7
+27995,7
@@
goto end81E8;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81E8:
m68kcontext.
io_cycle_counter -= 50;
+end81E8:
ctx->
io_cycle_counter -= 50;
#endif
RET(116)
}
#endif
RET(116)
}
@@
-27954,7
+28012,7
@@
OPCODE(0x81F0)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F0;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F0;
#endif
@@
-27994,7
+28052,7
@@
goto end81F0;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81F0:
m68kcontext.
io_cycle_counter -= 50;
+end81F0:
ctx->
io_cycle_counter -= 50;
#endif
RET(118)
}
#endif
RET(118)
}
@@
-28010,7
+28068,7
@@
OPCODE(0x81F8)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F8;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F8;
#endif
@@
-28050,7
+28108,7
@@
goto end81F8;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81F8:
m68kcontext.
io_cycle_counter -= 50;
+end81F8:
ctx->
io_cycle_counter -= 50;
#endif
RET(116)
}
#endif
RET(116)
}
@@
-28066,7
+28124,7
@@
OPCODE(0x81F9)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F9;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F9;
#endif
@@
-28106,7
+28164,7
@@
goto end81F9;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81F9:
m68kcontext.
io_cycle_counter -= 50;
+end81F9:
ctx->
io_cycle_counter -= 50;
#endif
RET(120)
}
#endif
RET(120)
}
@@
-28117,13
+28175,13
@@
OPCODE(0x81FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_WORD_F(adr, src)
if (src == 0)
{
PC++;
PRE_IO
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FA;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FA;
#endif
@@
-28163,7
+28221,7
@@
goto end81FA;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81FA:
m68kcontext.
io_cycle_counter -= 50;
+end81FA:
ctx->
io_cycle_counter -= 50;
#endif
RET(116)
}
#endif
RET(116)
}
@@
-28174,13
+28232,13
@@
OPCODE(0x81FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
if (src == 0)
{
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FB;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FB;
#endif
@@
-28220,7
+28278,7
@@
goto end81FB;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81FB:
m68kcontext.
io_cycle_counter -= 50;
+end81FB:
ctx->
io_cycle_counter -= 50;
#endif
RET(118)
}
#endif
RET(118)
}
@@
-28234,7
+28292,7
@@
OPCODE(0x81FC)
FETCH_SWORD(src);
if (src == 0)
{
FETCH_SWORD(src);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FC;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FC;
#endif
@@
-28274,7
+28332,7
@@
goto end81FC;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81FC:
m68kcontext.
io_cycle_counter -= 50;
+end81FC:
ctx->
io_cycle_counter -= 50;
#endif
RET(112)
}
#endif
RET(112)
}
@@
-28291,7
+28349,7
@@
OPCODE(0x81DF)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81DF;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81DF;
#endif
@@
-28331,7
+28389,7
@@
goto end81DF;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81DF:
m68kcontext.
io_cycle_counter -= 50;
+end81DF:
ctx->
io_cycle_counter -= 50;
#endif
RET(112)
}
#endif
RET(112)
}
@@
-28348,7
+28406,7
@@
OPCODE(0x81E7)
READSX_WORD_F(adr, src)
if (src == 0)
{
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(
ctx,
M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E7;
#endif
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E7;
#endif
@@
-28388,7
+28446,7
@@
goto end81E7;
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81E7:
m68kcontext.
io_cycle_counter -= 50;
+end81E7:
ctx->
io_cycle_counter -= 50;
#endif
RET(114)
}
#endif
RET(114)
}
@@
-28417,8
+28475,8
@@
OPCODE(0x9008)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
@@
-28575,7
+28633,7
@@
OPCODE(0x903A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, src)
PC++;
PRE_IO
READ_BYTE_F(adr, src)
@@
-28595,7
+28653,7
@@
OPCODE(0x903B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
@@
-28840,7
+28898,7
@@
OPCODE(0x907A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
PC++;
PRE_IO
READ_WORD_F(adr, src)
@@
-28860,7
+28918,7
@@
OPCODE(0x907B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
@@
-29114,7
+29172,7
@@
OPCODE(0x90BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, src)
PC++;
PRE_IO
READ_LONG_F(adr, src)
@@
-29135,7
+29193,7
@@
OPCODE(0x90BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
@@
-30242,7
+30300,7
@@
OPCODE(0x90FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_WORD_F(adr, src)
PC++;
PRE_IO
READSX_WORD_F(adr, src)
@@
-30263,7
+30321,7
@@
OPCODE(0x90FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
@@
-30489,7
+30547,7
@@
OPCODE(0x91FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_LONG_F(adr, src)
PC++;
PRE_IO
READSX_LONG_F(adr, src)
@@
-30506,7
+30564,7
@@
OPCODE(0x91FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, src)
@@
-30591,8
+30649,8
@@
OPCODE(0xB008)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
@@
-30741,7
+30799,7
@@
OPCODE(0xB03A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, src)
PC++;
PRE_IO
READ_BYTE_F(adr, src)
@@
-30760,7
+30818,7
@@
OPCODE(0xB03B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
@@
-30992,7
+31050,7
@@
OPCODE(0xB07A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
PC++;
PRE_IO
READ_WORD_F(adr, src)
@@
-31011,7
+31069,7
@@
OPCODE(0xB07B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
@@
-31252,7
+31310,7
@@
OPCODE(0xB0BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, src)
PC++;
PRE_IO
READ_LONG_F(adr, src)
@@
-31272,7
+31330,7
@@
OPCODE(0xB0BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
@@
-32382,7
+32440,7
@@
OPCODE(0xB0FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_WORD_F(adr, src)
PC++;
PRE_IO
READSX_WORD_F(adr, src)
@@
-32402,7
+32460,7
@@
OPCODE(0xB0FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
@@
-32647,7
+32705,7
@@
OPCODE(0xB1FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_LONG_F(adr, src)
PC++;
PRE_IO
READSX_LONG_F(adr, src)
@@
-32667,7
+32725,7
@@
OPCODE(0xB1FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, src)
@@
-32904,7
+32962,7
@@
OPCODE(0xC03A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, src)
PC++;
PRE_IO
READ_BYTE_F(adr, src)
@@
-32925,7
+32983,7
@@
OPCODE(0xC03B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
@@
-33166,7
+33224,7
@@
OPCODE(0xC07A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
PC++;
PRE_IO
READ_WORD_F(adr, src)
@@
-33187,7
+33245,7
@@
OPCODE(0xC07B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
@@
-33428,7
+33486,7
@@
OPCODE(0xC0BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, src)
PC++;
PRE_IO
READ_LONG_F(adr, src)
@@
-33449,7
+33507,7
@@
OPCODE(0xC0BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
@@
-34086,18
+34144,22
@@
OPCODE(0xC100)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
src = DREGu8((Opcode >> 0) & 7);
dst = DREGu8((Opcode >> 9) & 7);
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
src = DREGu8((Opcode >> 0) & 7);
dst = DREGu8((Opcode >> 9) & 7);
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res > 9)
res +
= 6;
+ if (res > 9)
corf
= 6;
res += (dst & 0xF0) + (src & 0xF0);
res += (dst & 0xF0) + (src & 0xF0);
- if (res > 0x99)
+ flag_V = ~res;
+ res += corf;
+ if (res > 0x9F)
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
+ flag_V &= res;
flag_NotZ |= res & 0xFF;
flag_N = res;
DREGu8((Opcode >> 9) & 7) = res;
flag_NotZ |= res & 0xFF;
flag_N = res;
DREGu8((Opcode >> 9) & 7) = res;
@@
-34109,6
+34171,7
@@
OPCODE(0xC108)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
@@
-34118,14
+34181,17
@@
OPCODE(0xC108)
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res > 9)
res +
= 6;
+ if (res > 9)
corf
= 6;
res += (dst & 0xF0) + (src & 0xF0);
res += (dst & 0xF0) + (src & 0xF0);
- if (res > 0x99)
+ flag_V = ~res;
+ res += corf;
+ if (res > 0x9F)
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
+ flag_V &= res;
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
@@
-34138,6
+34204,7
@@
OPCODE(0xC10F)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG(7) - 2;
AREG(7) = adr;
adr = AREG(7) - 2;
AREG(7) = adr;
@@
-34147,14
+34214,17
@@
OPCODE(0xC10F)
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
AREG((Opcode >> 9) & 7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res > 9)
res +
= 6;
+ if (res > 9)
corf
= 6;
res += (dst & 0xF0) + (src & 0xF0);
res += (dst & 0xF0) + (src & 0xF0);
- if (res > 0x99)
+ flag_V = ~res;
+ res += corf;
+ if (res > 0x9F)
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
+ flag_V &= res;
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
@@
-34167,6
+34237,7
@@
OPCODE(0xCF08)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
adr = AREG((Opcode >> 0) & 7) - 1;
AREG((Opcode >> 0) & 7) = adr;
@@
-34176,14
+34247,17
@@
OPCODE(0xCF08)
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res > 9)
res +
= 6;
+ if (res > 9)
corf
= 6;
res += (dst & 0xF0) + (src & 0xF0);
res += (dst & 0xF0) + (src & 0xF0);
- if (res > 0x99)
+ flag_V = ~res;
+ res += corf;
+ if (res > 0x9F)
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
+ flag_V &= res;
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
@@
-34196,6
+34270,7
@@
OPCODE(0xCF0F)
{
u32 adr, res;
u32 src, dst;
{
u32 adr, res;
u32 src, dst;
+ u32 corf = 0;
adr = AREG(7) - 2;
AREG(7) = adr;
adr = AREG(7) - 2;
AREG(7) = adr;
@@
-34205,14
+34280,17
@@
OPCODE(0xCF0F)
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
AREG(7) = adr;
READ_BYTE_F(adr, dst)
res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
- if (res > 9)
res +
= 6;
+ if (res > 9)
corf
= 6;
res += (dst & 0xF0) + (src & 0xF0);
res += (dst & 0xF0) + (src & 0xF0);
- if (res > 0x99)
+ flag_V = ~res;
+ res += corf;
+ if (res > 0x9F)
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
{
res -= 0xA0;
flag_X = flag_C = M68K_SR_C;
}
else flag_X = flag_C = 0;
+ flag_V &= res;
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
flag_NotZ |= res & 0xFF;
flag_N = res;
WRITE_BYTE_F(adr, res)
@@
-34411,7
+34489,7
@@
OPCODE(0xC0FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
PC++;
PRE_IO
READ_WORD_F(adr, src)
@@
-34435,7
+34513,7
@@
OPCODE(0xC0FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
@@
-34712,7
+34790,7
@@
OPCODE(0xC1FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_WORD_F(adr, src)
PC++;
PRE_IO
READSX_WORD_F(adr, src)
@@
-34736,7
+34814,7
@@
OPCODE(0xC1FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
@@
-34888,8
+34966,8
@@
OPCODE(0xD008)
u32 src, dst;
// can't read byte from Ax registers !
u32 src, dst;
// can't read byte from Ax registers !
-
m68kcontext.
execinfo |= M68K_FAULTED;
-
m68kcontext.
io_cycle_counter = 0;
+
ctx->
execinfo |= M68K_FAULTED;
+
ctx->
io_cycle_counter = 0;
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
@@
-35046,7
+35124,7
@@
OPCODE(0xD03A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_BYTE_F(adr, src)
PC++;
PRE_IO
READ_BYTE_F(adr, src)
@@
-35066,7
+35144,7
@@
OPCODE(0xD03B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_BYTE_F(adr, src)
@@
-35311,7
+35389,7
@@
OPCODE(0xD07A)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_WORD_F(adr, src)
PC++;
PRE_IO
READ_WORD_F(adr, src)
@@
-35331,7
+35409,7
@@
OPCODE(0xD07B)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_WORD_F(adr, src)
@@
-35585,7
+35663,7
@@
OPCODE(0xD0BA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READ_LONG_F(adr, src)
PC++;
PRE_IO
READ_LONG_F(adr, src)
@@
-35606,7
+35684,7
@@
OPCODE(0xD0BB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READ_LONG_F(adr, src)
@@
-36713,7
+36791,7
@@
OPCODE(0xD0FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_WORD_F(adr, src)
PC++;
PRE_IO
READSX_WORD_F(adr, src)
@@
-36734,7
+36812,7
@@
OPCODE(0xD0FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_WORD_F(adr, src)
@@
-36960,7
+37038,7
@@
OPCODE(0xD1FA)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr = GET_SWORD +
((u32)(PC) - BasePC)
;
+ adr = GET_SWORD +
GET_PC
;
PC++;
PRE_IO
READSX_LONG_F(adr, src)
PC++;
PRE_IO
READSX_LONG_F(adr, src)
@@
-36977,7
+37055,7
@@
OPCODE(0xD1FB)
u32 adr, res;
u32 src, dst;
u32 adr, res;
u32 src, dst;
- adr =
(u32)(PC) - Base
PC;
+ adr =
GET_
PC;
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, src)
DECODE_EXT_WORD
PRE_IO
READSX_LONG_F(adr, src)
@@
-37048,7
+37126,7
@@
OPCODE(0xE000)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = (s32)DREGs8((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = (s32)DREGs8((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37068,7
+37146,7
@@
OPCODE(0xE040)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = (s32)DREGs16((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = (s32)DREGs16((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37088,7
+37166,7
@@
OPCODE(0xE080)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = (s32)DREGs32((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = (s32)DREGs32((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37108,7
+37186,7
@@
OPCODE(0xE008)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = DREGu8((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37127,7
+37205,7
@@
OPCODE(0xE048)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = DREGu16((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37146,7
+37224,7
@@
OPCODE(0xE088)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = DREGu32((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37165,7
+37243,7
@@
OPCODE(0xE010)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 0;
res = (src >> sft) | (src << (9 - sft));
src = DREGu8((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 0;
res = (src >> sft) | (src << (9 - sft));
@@
-37186,7
+37264,7
@@
OPCODE(0xE050)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 8;
res = (src >> sft) | (src << (17 - sft));
src = DREGu16((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 8;
res = (src >> sft) | (src << (17 - sft));
@@
-37207,7
+37285,7
@@
OPCODE(0xE090)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
src = DREGu32((Opcode >> 0) & 7);
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
@@
-37229,7
+37307,7
@@
OPCODE(0xE018)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37249,7
+37327,7
@@
OPCODE(0xE058)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37269,7
+37347,7
@@
OPCODE(0xE098)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
@@
-37289,7
+37367,7
@@
OPCODE(0xE100)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
if (sft < 8)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft < 8)
{
@@
-37328,7
+37406,7
@@
OPCODE(0xE140)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_X = flag_C = src >> (8 - sft);
res = src << sft;
src = DREGu16((Opcode >> 0) & 7);
flag_X = flag_C = src >> (8 - sft);
res = src << sft;
@@
-37353,7
+37431,7
@@
OPCODE(0xE180)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_X = flag_C = src >> (24 - sft);
res = src << sft;
src = DREGu32((Opcode >> 0) & 7);
flag_X = flag_C = src >> (24 - sft);
res = src << sft;
@@
-37378,7
+37456,7
@@
OPCODE(0xE108)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << (0 + sft);
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << (0 + sft);
@@
-37398,7
+37476,7
@@
OPCODE(0xE148)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src >> (8 - sft);
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src >> (8 - sft);
@@
-37418,7
+37496,7
@@
OPCODE(0xE188)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src >> (24 - sft);
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src >> (24 - sft);
@@
-37438,7
+37516,7
@@
OPCODE(0xE110)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 0;
res = (src << sft) | (src >> (9 - sft));
src = DREGu8((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 0;
res = (src << sft) | (src >> (9 - sft));
@@
-37459,7
+37537,7
@@
OPCODE(0xE150)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 8;
res = (src << sft) | (src >> (17 - sft));
src = DREGu16((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 8;
res = (src << sft) | (src >> (17 - sft));
@@
-37480,7
+37558,7
@@
OPCODE(0xE190)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_C = src >> ((32 - M68K_SR_C_SFT) - sft);
if (sft == 1) res = (src << 1) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - 1));
src = DREGu32((Opcode >> 0) & 7);
flag_C = src >> ((32 - M68K_SR_C_SFT) - sft);
if (sft == 1) res = (src << 1) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - 1));
@@
-37502,7
+37580,7
@@
OPCODE(0xE118)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << (0 + sft);
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << (0 + sft);
@@
-37522,7
+37600,7
@@
OPCODE(0xE158)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src >> (8 - sft);
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src >> (8 - sft);
@@
-37542,7
+37620,7
@@
OPCODE(0xE198)
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src >> (24 - sft);
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src >> (24 - sft);
@@
-37565,7
+37643,7
@@
OPCODE(0xE020)
src = (s32)DREGs8((Opcode >> 0) & 7);
if (sft)
{
src = (s32)DREGs8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 8)
{
flag_V = 0;
if (sft < 8)
{
flag_V = 0;
@@
-37618,7
+37696,7
@@
OPCODE(0xE060)
src = (s32)DREGs16((Opcode >> 0) & 7);
if (sft)
{
src = (s32)DREGs16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 16)
{
flag_V = 0;
if (sft < 16)
{
flag_V = 0;
@@
-37676,7
+37754,7
@@
OPCODE(0xE0A0)
src = (s32)DREGs32((Opcode >> 0) & 7);
if (sft)
{
src = (s32)DREGs32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_V = 0;
if (sft < 32)
{
flag_V = 0;
@@
-37730,7
+37808,7
@@
OPCODE(0xE028)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft <= 8)
{
flag_N = flag_V = 0;
if (sft <= 8)
{
flag_N = flag_V = 0;
@@
-37769,7
+37847,7
@@
OPCODE(0xE068)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft <= 16)
{
flag_N = flag_V = 0;
if (sft <= 16)
{
flag_N = flag_V = 0;
@@
-37813,7
+37891,7
@@
OPCODE(0xE0A8)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_N = flag_V = 0;
if (sft < 32)
{
flag_N = flag_V = 0;
@@
-37855,7
+37933,7
@@
OPCODE(0xE030)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft %= 9;
src |= (flag_X & M68K_SR_X) << 0;
sft %= 9;
src |= (flag_X & M68K_SR_X) << 0;
@@
-37887,7
+37965,7
@@
OPCODE(0xE070)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft %= 17;
src |= (flag_X & M68K_SR_X) << 8;
sft %= 17;
src |= (flag_X & M68K_SR_X) << 8;
@@
-37924,14
+38002,14
@@
OPCODE(0xE0B0)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft %= 33;
if (sft != 0)
{
if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
else res = (src >> sft) | (src << (33 - sft)) | (((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1))) >> (sft - 1));
sft %= 33;
if (sft != 0)
{
if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
else res = (src >> sft) | (src << (33 - sft)) | (((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1))) >> (sft - 1));
- flag_X = (src >> (
32 - sft
)) << M68K_SR_X_SFT;
+ flag_X = (src >> (
sft - 1
)) << M68K_SR_X_SFT;
}
else res = src;
flag_C = flag_X;
}
else res = src;
flag_C = flag_X;
@@
-37962,7
+38040,7
@@
OPCODE(0xE038)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft &= 0x07;
flag_C = src << (M68K_SR_C_SFT - ((sft - 1) & 7));
sft &= 0x07;
flag_C = src << (M68K_SR_C_SFT - ((sft - 1) & 7));
@@
-37993,7
+38071,7
@@
OPCODE(0xE078)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft &= 0x0F;
flag_C = (src >> ((sft - 1) & 15)) << M68K_SR_C_SFT;
sft &= 0x0F;
flag_C = (src >> ((sft - 1) & 15)) << M68K_SR_C_SFT;
@@
-38029,7
+38107,7
@@
OPCODE(0xE0B8)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft &= 0x1F;
flag_C = (src >> ((sft - 1) & 31)) << M68K_SR_C_SFT;
sft &= 0x1F;
flag_C = (src >> ((sft - 1) & 31)) << M68K_SR_C_SFT;
@@
-38061,7
+38139,7
@@
OPCODE(0xE120)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 8)
{
flag_X = flag_C = (src << sft) >> 0;
if (sft < 8)
{
flag_X = flag_C = (src << sft) >> 0;
@@
-38109,7
+38187,7
@@
OPCODE(0xE160)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 16)
{
flag_X = flag_C = (src << sft) >> 8;
if (sft < 16)
{
flag_X = flag_C = (src << sft) >> 8;
@@
-38162,7
+38240,7
@@
OPCODE(0xE1A0)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
if (sft < 32)
{
flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
@@
-38211,7
+38289,7
@@
OPCODE(0xE128)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft <= 8)
{
flag_X = flag_C = (src << sft) >> 0;
if (sft <= 8)
{
flag_X = flag_C = (src << sft) >> 0;
@@
-38251,7
+38329,7
@@
OPCODE(0xE168)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft <= 16)
{
flag_X = flag_C = (src << sft) >> 8;
if (sft <= 16)
{
flag_X = flag_C = (src << sft) >> 8;
@@
-38296,7
+38374,7
@@
OPCODE(0xE1A8)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
if (sft < 32)
{
flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
@@
-38339,7
+38417,7
@@
OPCODE(0xE130)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft %= 9;
src |= (flag_X & M68K_SR_X) << 0;
sft %= 9;
src |= (flag_X & M68K_SR_X) << 0;
@@
-38371,7
+38449,7
@@
OPCODE(0xE170)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft %= 17;
src |= (flag_X & M68K_SR_X) << 8;
sft %= 17;
src |= (flag_X & M68K_SR_X) << 8;
@@
-38408,7
+38486,7
@@
OPCODE(0xE1B0)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
sft %= 33;
if (sft != 0)
sft %= 33;
if (sft != 0)
@@
-38446,7
+38524,7
@@
OPCODE(0xE138)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft &= 0x07)
{
flag_C = (src << sft) >> 0;
if (sft &= 0x07)
{
flag_C = (src << sft) >> 0;
@@
-38484,7
+38562,7
@@
OPCODE(0xE178)
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft &= 0x0F)
{
flag_C = (src << sft) >> 8;
if (sft &= 0x0F)
{
flag_C = (src << sft) >> 8;
@@
-38527,7
+38605,7
@@
OPCODE(0xE1B8)
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
-
m68kcontext.
io_cycle_counter -= sft * 2;
+
ctx->
io_cycle_counter -= sft * 2;
if (sft &= 0x1F)
{
flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
if (sft &= 0x1F)
{
flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
@@
-39962,11
+40040,20
@@
RET(14)
}
#ifdef PICODRIVE_HACK
}
#ifdef PICODRIVE_HACK
+#if 0
+#define UPDATE_IDLE_COUNT { \
+ extern int idle_hit_counter; \
+ idle_hit_counter++; \
+}
+#else
+#define UPDATE_IDLE_COUNT
+#endif
+
// BRA
OPCODE(0x6001_idle)
{
#ifdef FAMEC_CHECK_BRANCHES
// BRA
OPCODE(0x6001_idle)
{
#ifdef FAMEC_CHECK_BRANCHES
- u32 newPC =
(u32)(PC) - Base
PC;
+ u32 newPC =
GET_
PC;
s8 offs=Opcode;
newPC += offs;
SET_PC(newPC);
s8 offs=Opcode;
newPC += offs;
SET_PC(newPC);
@@
-39974,12
+40061,8
@@
OPCODE(0x6001_idle)
#else
PC += ((s8)(Opcode & 0xFE)) >> 1;
#endif
#else
PC += ((s8)(Opcode & 0xFE)) >> 1;
#endif
- {
- extern int idle_hit_counter;
- idle_hit_counter++;
- }
- m68kcontext.io_cycle_counter = 10;
-RET(10)
+ UPDATE_IDLE_COUNT
+RET0()
}
// BCC
}
// BCC
@@
-39987,10
+40070,10
@@
OPCODE(0x6601_idle)
{
if (flag_NotZ)
{
{
if (flag_NotZ)
{
- extern int idle_hit_counter;
- idle_hit_counter++;
+ UPDATE_IDLE_COUNT
PC += ((s8)(Opcode & 0xFE)) >> 1;
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter = 8;
+ //if (idle_hit)
+ RET0()
}
RET(8)
}
}
RET(8)
}
@@
-39999,63
+40082,55
@@
OPCODE(0x6701_idle)
{
if (!flag_NotZ)
{
{
if (!flag_NotZ)
{
- extern int idle_hit_counter;
- idle_hit_counter++;
+ UPDATE_IDLE_COUNT
PC += ((s8)(Opcode & 0xFE)) >> 1;
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter = 8;
+ //if (idle_hit)
+ RET0()
}
RET(8)
}
}
RET(8)
}
+extern int SekIsIdleReady(void);
extern int SekIsIdleCode(unsigned short *dst, int bytes);
extern int SekIsIdleCode(unsigned short *dst, int bytes);
-extern int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop);
+extern int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop
, void *ctx
);
OPCODE(idle_detector_bcc8)
{
OPCODE(idle_detector_bcc8)
{
- extern int idledet_start_frame;
- extern char Pico[];
int frame_count, cond_true, bytes, ret, newop;
u16 *dest_pc;
dest_pc = PC + (((s8)(Opcode & 0xFE)) >> 1);
int frame_count, cond_true, bytes, ret, newop;
u16 *dest_pc;
dest_pc = PC + (((s8)(Opcode & 0xFE)) >> 1);
- frame_count = *(int *)(Pico+0x22208+0x1c); // Pico.m.frame_count
- if (frame_count < idledet_start_frame)
+ if (!SekIsIdleReady())
goto end;
bytes = 0 - (s8)(Opcode & 0xFE) - 2;
ret = SekIsIdleCode(dest_pc, bytes);
newop = (Opcode & 0xfe) | 0x7100;
if (!ret) newop |= 0x200;
goto end;
bytes = 0 - (s8)(Opcode & 0xFE) - 2;
ret = SekIsIdleCode(dest_pc, bytes);
newop = (Opcode & 0xfe) | 0x7100;
if (!ret) newop |= 0x200;
- if (Opcode & 0x0100) newop |= 0x400; // beq
+ if ( Opcode & 0x0100) newop |= 0x400; // beq
+ if (!(Opcode & 0x0f00)) newop |= 0xc00; // bra
- ret = SekRegisterIdlePatch(GET_PC - 2, Opcode, newop);
+ ret = SekRegisterIdlePatch(GET_PC - 2, Opcode, newop
, ctx
);
switch (ret)
{
case 0: PC[-1] = newop; break;
case 1: break;
switch (ret)
{
case 0: PC[-1] = newop; break;
case 1: break;
- case 2: JumpTable[Opcode] = (Opcode & 0x0100) ? CAST_OP(0x6701) : CAST_OP(0x6601); break;
+ case 2: JumpTable[Opcode] = (Opcode & 0x0f00) ?
+ ((Opcode & 0x0100) ? CAST_OP(0x6701) : CAST_OP(0x6601)) :
+ CAST_OP(0x6001); break;
}
end:
}
end:
- cond_true = (Opcode & 0x0100) ? !flag_NotZ : flag_NotZ; // beq?
+ if ((Opcode & 0xff00) == 0x6000) cond_true = 1;
+ else cond_true = (Opcode & 0x0100) ? !flag_NotZ : flag_NotZ; // beq?
if (cond_true)
{
PC = dest_pc;
if (cond_true)
{
PC = dest_pc;
-
m68kcontext.
io_cycle_counter -= 2;
+
ctx->
io_cycle_counter -= 2;
}
RET(8)
}
}
RET(8)
}
-OPCODE(idle_detector_dead)
-{
- // patch without further questions
- int newop = 0x7d00 | (Opcode & 0xff);
- PC[-1] = newop;
- SekRegisterIdlePatch(GET_PC - 2, Opcode, newop);
-
- PC += ((s8)(Opcode & 0xFE)) >> 1;
-RET(10)
-}
#endif // PICODRIVE_HACK
#endif // PICODRIVE_HACK