unsigned short *pal=HighPal;\r
int len, i, t, dirtyPal = Pico.m.dirtyPal;\r
\r
- if(dirtyPal) {\r
- unsigned short *ppal=Pico.cram;\r
- for(i = 0x3f; i >= 0; i--)\r
- pal[i] = (unsigned short) (((ppal[i]&0x00f)<<12)|((ppal[i]&0x0f0)<<3)|((ppal[i]&0xf00)>>7));\r
+ if (dirtyPal)\r
+ {\r
+ unsigned int *spal=(void *)Pico.cram;\r
+ unsigned int *dpal=(void *)HighPal;\r
+ for (i = 0x3f/2; i >= 0; i--)\r
+#ifdef USE_BGR555\r
+ dpal[i] = ((spal[i]&0x000f000f)<< 1)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)<<4);\r
+#else\r
+ dpal[i] = ((spal[i]&0x000f000f)<<12)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)>>7);\r
+#endif\r
Pico.m.dirtyPal = 0;\r
}\r
\r
- if (Pico.video.reg[12]&1) {\r
- len = 320;\r
- } else {\r
- if(!(PicoOpt&0x100)) pd+=32;\r
- len = 256;\r
- }\r
-\r
- if(sh) {\r
- if(dirtyPal) {\r
+ if (sh)\r
+ {\r
+ if (dirtyPal) {\r
// shadowed pixels\r
- for(i = 0x3f; i >= 0; i--)\r
+ for (i = 0x3f; i >= 0; i--)\r
pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x738e);\r
// hilighted pixels\r
- for(i = 0x3f; i >= 0; i--) {\r
+ for (i = 0x3f; i >= 0; i--) {\r
t=pal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c;\r
pal[0x80|i]=(unsigned short)t;\r
}\r
}\r
}\r
\r
- for(i = 0; i < len; i++)\r
+ if (Pico.video.reg[12]&1) {\r
+ len = 320;\r
+ } else {\r
+ if (!(PicoOpt&0x100)) pd+=32;\r
+ len = 256;\r
+ }\r
+\r
+#ifndef PSP\r
+ for (i = 0; i < len; i++)\r
pd[i] = pal[ps[i]];\r
+#else\r
+ {\r
+ extern void amips_clut(unsigned short *dst, unsigned char *src, unsigned short *pal, int count);\r
+ amips_clut(pd, ps, pal, len);\r
+ }\r
+#endif\r
}\r
#endif\r
\r
+++ /dev/null
-@ assembly "optimized" version of some funtions from draw.c\r
-@ this is highly specialized, be careful if changing related C code!\r
-\r
-@ (c) Copyright 2006, notaz\r
-@ All Rights Reserved\r
-\r
-\r
-.extern Pico\r
-.extern PicoOpt\r
-.extern HighCol\r
-.extern Scanline\r
-.extern HighSprZ\r
-.extern rendstatus\r
-.extern DrawLineDest\r
-.extern DrawStripVSRam\r
-.extern DrawStripInterlace\r
-\r
-\r
-@ helper\r
-.macro TilePixel pat lsrr offs\r
-.if !\lsrr\r
- ands r4, \pat, r2\r
-.else\r
- ands r4, \pat, r2, lsr #\lsrr\r
-.endif\r
- orrne r4, r3, r4\r
- strneb r4, [r1,#\offs]\r
-.endm\r
-\r
-@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileNorm pat\r
- TilePixel \pat, 12, 0 @ #0x0000f000\r
- TilePixel \pat, 8, 1 @ #0x00000f00\r
- TilePixel \pat, 4, 2 @ #0x000000f0\r
- TilePixel \pat, 0, 3 @ #0x0000000f\r
- TilePixel \pat, 28, 4 @ #0xf0000000\r
- TilePixel \pat, 24, 5 @ #0x0f000000\r
- TilePixel \pat, 20, 6 @ #0x00f00000\r
- TilePixel \pat, 16, 7 @ #0x000f0000\r
-.endm\r
-\r
-@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileFlip pat\r
- TilePixel \pat, 16, 0 @ #0x000f0000\r
- TilePixel \pat, 20, 1 @ #0x00f00000\r
- TilePixel \pat, 24, 2 @ #0x0f000000\r
- TilePixel \pat, 28, 3 @ #0xf0000000\r
- TilePixel \pat, 0, 4 @ #0x0000000f\r
- TilePixel \pat, 4, 5 @ #0x000000f0\r
- TilePixel \pat, 8, 6 @ #0x00000f00\r
- TilePixel \pat, 12, 7 @ #0x0000f000\r
-.endm\r
-\r
-@ shadow/hilight mode\r
-\r
-@ this one is for hi priority layer\r
-.macro TilePixelShHP pat lsrr offs\r
- TilePixel \pat, \lsrr, \offs\r
- ldreqb r4, [r1,#\offs]\r
- tsteq r4, #0x80\r
- andeq r4, r4, #0x3f\r
- streqb r4, [r1,#\offs]\r
-.endm\r
-\r
-@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileNormShHP pat\r
- TilePixelShHP \pat, 12, 0 @ #0x0000f000\r
- TilePixelShHP \pat, 8, 1 @ #0x00000f00\r
- TilePixelShHP \pat, 4, 2 @ #0x000000f0\r
- TilePixelShHP \pat, 0, 3 @ #0x0000000f\r
- TilePixelShHP \pat, 28, 4 @ #0xf0000000\r
- TilePixelShHP \pat, 24, 5 @ #0x0f000000\r
- TilePixelShHP \pat, 20, 6 @ #0x00f00000\r
- TilePixelShHP \pat, 16, 7 @ #0x000f0000\r
-.endm\r
-\r
-@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileFlipShHP pat\r
- TilePixelShHP \pat, 16, 0 @ #0x000f0000\r
- TilePixelShHP \pat, 20, 1 @ #0x00f00000\r
- TilePixelShHP \pat, 24, 2 @ #0x0f000000\r
- TilePixelShHP \pat, 28, 3 @ #0xf0000000\r
- TilePixelShHP \pat, 0, 4 @ #0x0000000f\r
- TilePixelShHP \pat, 4, 5 @ #0x000000f0\r
- TilePixelShHP \pat, 8, 6 @ #0x00000f00\r
- TilePixelShHP \pat, 12, 7 @ #0x0000f000\r
-.endm\r
-\r
-\r
-@ TileSingleSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx; r12: helper pattern 0xf\r
-.macro TileSingleSh\r
- tst r0, #1 @ not aligned?\r
- mov r7, #0x00c000\r
- orr r7, r7, #0xc0\r
- ldrneb r4, [r1]\r
- ldreqh r4, [r1]\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- ldrh r4, [r1]\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrneb r4, [r1]\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
-.endm\r
-\r
-@ TileSingleHi (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf\r
-.macro TileSingleHi\r
- tst r1, #1 @ not aligned?\r
- mov r7, #0x008000\r
- orr r7, r7, #0x80\r
- ldrneb r4, [r1]\r
- ldreqh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- ldrh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrneb r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
-.endm\r
-\r
-.macro TileDoShGenPixel shift ofs\r
-.if \shift\r
- ands r4, r12, r2, lsr #\shift\r
-.else\r
- ands r4, r12, r2\r
-.endif\r
- beq 3f\r
- cmp r4, #0xe\r
- beq 2f\r
- bgt 1f\r
- orr r4, r3, r4\r
- strb r4, [r1,#\ofs]\r
- b 3f\r
-1:\r
- ldrb r4, [r1,#\ofs]\r
- orr r4, r4, #0xc0\r
- strb r4, [r1,#\ofs]\r
- b 3f\r
-2:\r
- ldrb r4, [r1,#\ofs]\r
- bic r4, r4, #0xc0\r
- orr r4, r4, #0x80\r
- strb r4, [r1,#\ofs]\r
-3:\r
-.endm\r
-\r
-@ TileFlipSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf\r
-.macro TileFlipSh\r
- TileDoShGenPixel 16, 0 @ #0x000f0000\r
- TileDoShGenPixel 20, 1 @ #0x00f00000\r
- TileDoShGenPixel 24, 2 @ #0x0f000000\r
- TileDoShGenPixel 28, 3 @ #0xf0000000\r
- TileDoShGenPixel 0, 4 @ #0x0000000f\r
- TileDoShGenPixel 4, 5 @ #0x000000f0\r
- TileDoShGenPixel 8, 6 @ #0x00000f00\r
- TileDoShGenPixel 12, 7 @ #0x0000f000\r
-.endm\r
-\r
-@ TileNormSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf\r
-.macro TileNormSh\r
- TileDoShGenPixel 12, 0 @ #0x0000f000\r
- TileDoShGenPixel 8, 1 @ #0x00000f00\r
- TileDoShGenPixel 4, 2 @ #0x000000f0\r
- TileDoShGenPixel 0, 3 @ #0x0000000f\r
- TileDoShGenPixel 28, 4 @ #0xf0000000\r
- TileDoShGenPixel 24, 5 @ #0x0f000000\r
- TileDoShGenPixel 20, 6 @ #0x00f00000\r
- TileDoShGenPixel 16, 7 @ #0x000f0000\r
-.endm\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-@ struct TileStrip\r
-@ {\r
-@ int nametab; // 0x00\r
-@ int line; // 0x04\r
-@ int hscroll; // 0x08\r
-@ int xmask; // 0x0C\r
-@ int *hc; // 0x10 (pointer to cache buffer)\r
-@ int cells; // 0x14\r
-@ };\r
-\r
-@ int DrawLayer(int plane, int *hcache, int maxcells, int sh)\r
-\r
-.global DrawLayer @ int plane, int *hcache, int maxcells, int sh\r
-\r
-DrawLayer:\r
- stmfd sp!, {r4-r11,lr}\r
-\r
- ldr r11, =(Pico+0x22228) @ Pico.video\r
-\r
- mov r6, r1 @ hcache\r
- orr r9, r2, r3, lsl #31 @ r9=maxcells|(sh<<31)\r
-\r
- ldrb r7, [r11, #16] @ ??hh??ww\r
-\r
- mov r1, r7, lsl #4\r
- orr r1, r1, #0x00ff\r
-\r
- and r10, r7, #3\r
- cmp r10, #1\r
- biclt r1, r1, #0xfc00\r
- biceq r1, r1, #0xfe00\r
- bicgt r1, r1, #0xff00 @ r1=ymask=(height<<8)|0xff; ...; // Y Mask in pixels\r
-\r
- add r10, r10, #5\r
- cmp r10, #7\r
- subge r10, r10, #1 @ r10=shift[width] (5,6,6,7)\r
-\r
- @ calculate xmask:\r
- mov r8, #1\r
- mov r5, r8, lsl r10\r
- sub r5, r5, #1 @ r5=xmask\r
-\r
- @ Find name table:\r
- tst r0, r0\r
- ldreqb r12, [r11, #2]\r
- moveq r12, r12, lsl #10\r
- ldrneb r12, [r11, #4]\r
- movne r12, r12, lsl #13\r
- and r12, r12, #(7<<13) @ r12=(ts->nametab<<1) (halfword compliant)\r
-\r
- ldr r2, =Scanline\r
- ldr r2, [r2]\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
-\r
- ldrh r8, [r11, #12]\r
- mov r4, r8, lsr #8 @ pvid->reg[13]\r
- mov r4, r4, lsl #10 @ htab=pvid->reg[13]<<9; (halfwords)\r
- ldrb r7, [r11, #11]\r
- tst r7, #2\r
- addne r4, r4, r2, lsl #2 @ htab+=Scanline<<1; // Offset by line\r
- tst r7, #1\r
- biceq r4, r4, #0x1f @ htab&=~0xf; // Offset by tile\r
- add r4, r4, r0, lsl #1 @ htab+=plane\r
- bic r4, r4, #0x00ff0000 @ just in case\r
- ldrh r3, [lr, r4] @ r3=hscroll\r
-\r
- tst r7, #4\r
- bne .DrawStrip_vsscroll\r
-\r
- @ Get vertical scroll value:\r
- add r7, lr, #0x012000\r
- add r7, r7, #0x000180 @ r7=Pico.vsram (Pico+0x22180)\r
- ldr r7, [r7]\r
-\r
- tst r8, #2\r
- tstne r8, #4\r
- bne .DrawStrip_interlace\r
-\r
- tst r0, r0\r
- movne r7, r7, lsr #16\r
-\r
- @ Find the line in the name table\r
- add r2, r2, r7\r
- and r2, r2, r1\r
- mov r4, r2, lsr #3\r
- add r10, r10, #1 @ shift[width]++\r
- add r12, r12, r4, lsl r10 @ nametab+=(ts.line>>3)<<shift[width];\r
-\r
- @ ldmia r0, {r1,r2,r3,r5,r6,r9} @ r2=line, r3=ts->hscroll, r5=ts->xmask, r6=ts->hc, r9=ts->cells\r
-@ mov r12,r1, lsl #1 @ r12=(ts->nametab<<1) (halfword compliant)\r
-\r
- and r10,r2, #7\r
- mov r10,r10, lsl #1 @ r10=ty=(ts->line&7)<<1;\r
- orr r10,r10, r9, lsl #24\r
-\r
- rsb r8, r3, #0\r
- mov r8, r8, lsr #3 @ r8=tilex=(-ts->hscroll)>>3\r
-\r
- sub r1, r3, #1\r
- and r1, r1, #7\r
- add r7, r1, #1 @ r7=dx=((ts->hscroll-1)&7)+1\r
-\r
- tst r9, #1<<31\r
- mov r3, #0\r
- orrne r10,r10, #1<<23 @ r10=(cells<<24|sh<<23|hi_not_empty<<22|ty)\r
- movne r3, #0x40 @ default to shadowed pal on sh mode\r
-\r
- mvn r9, #0 @ r9=prevcode=-1\r
-\r
- cmp r7, #8\r
- subeq r10,r10, #0x01000000 @ we will loop cells+1 times, so loop less when there is no scroll\r
-\r
- @ cache some stuff to avoid mem access\r
- ldr r11,=HighCol\r
- add r1, r11, r7 @ r1=pdest\r
- mov r0, #0xf\r
- b .dsloop_enter\r
-\r
- @ r4 & r7 are scratch in this loop\r
-.dsloop: @ 40-41 times\r
- add r1, r1, #8\r
-.dsloop_nor1:\r
- subs r10,r10, #0x01000000\r
- add r8, r8, #1\r
- bmi .dsloop_exit\r
-\r
-.dsloop_enter:\r
- and r7, r5, r8\r
- add r7, lr, r7, lsl #1 @ Pico.vram+((tilex&ts->xmask) as halfwords)\r
- ldrh r7, [r7, r12] @ r7=code (int, but from unsigned, no sign extend)\r
-\r
- tst r7, #0x8000\r
- bne .DrawStrip_hiprio\r
-\r
- cmp r7, r9\r
- beq .DrawStrip_samecode @ we know stuff about this tile already\r
-\r
- mov r9, r7 @ remember code\r
-\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
-@ bic r7, r10,#0xff000000\r
-@ add r2, r7, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty\r
- add r2, r2, r10, lsl #17\r
- mov r2, r2, lsr #17\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
-\r
- bic r7, r3, #0x3f\r
- and r3, r9, #0x6000\r
- add r3, r7, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
-.DrawStrip_samecode:\r
- tst r2, r2\r
- beq .dsloop @ tileline blank\r
-\r
- cmp r2, r2, ror #4\r
- beq .DrawStrip_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x0800\r
- beq .DrawStrip_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern\r
- TileFlip r0\r
- b .dsloop\r
-\r
-.DrawStrip_TileNorm:\r
- TileNorm r0\r
- b .dsloop\r
-\r
-.DrawStrip_SingleColor:\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- tst r1, #1 @ not aligned?\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1 @ have a remaining unaligned pixel?\r
- b .dsloop_nor1 @ we incremeted r1 ourselves\r
-\r
-.DrawStrip_hiprio:\r
- tst r10, #0x00c00000\r
- beq .DrawStrip_hiprio_maybempt\r
- sub r0, r1, r11\r
- orr r7, r7, r0, lsl #16\r
- orr r7, r7, r10, lsl #25 @ (ty<<25)\r
- tst r7, #0x1000\r
- eorne r7, r7, #7<<26 @ if(code&0x1000) cval^=7<<26;\r
- str r7, [r6], #4 @ cache hi priority tile\r
- mov r0, #0xf\r
- b .dsloop\r
-\r
-.DrawStrip_hiprio_maybempt:\r
- cmp r7, r9\r
- beq .dsloop @ must've been empty, otherwise we wouldn't get here\r
- mov r9, r7 @ remember code\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
- add r2, r2, r10, lsl #17\r
- mov r2, r2, lsr #17\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- tst r2, r2\r
- orrne r10, r10, #1<<22\r
- bne .DrawStrip_hiprio\r
- b .dsloop\r
-\r
-.dsloop_exit:\r
- mov r0, #0\r
- str r0, [r6] @ terminate the cache list\r
-\r
- ldmfd sp!, {r4-r11,lr}\r
- bx lr\r
-\r
-\r
-.DrawStrip_vsscroll:\r
- @ shit, we have 2-cell column based vscroll\r
- @ let the c code handle this (for now)\r
-\r
- @ int nametab; // 0x00\r
- @ int line; // 0x04\r
- @ int hscroll; // 0x08\r
- @ int xmask; // 0x0C\r
- @ int *hc; // 0x10 (pointer to cache buffer)\r
- @ int cells; // 0x14\r
-\r
- sub sp, sp, #6*4\r
- orr r2, r1, r10, lsl #24 @ ts.line=ymask|(shift[width]<<24); // save some stuff instead of line\r
- mov r1, r0 @ plane\r
- mov r0, r12, lsr #1 @ halfwords\r
- and r9, r9, #0xff\r
- stmia sp, {r0,r2,r3,r5,r6,r9}\r
-\r
- mov r0, sp\r
- bl DrawStripVSRam @ struct TileStrip *ts, int plane\r
-\r
- add sp, sp, #6*4\r
- ldmfd sp!, {r4-r11,lr}\r
- bx lr\r
-\r
-@ interlace mode 2? Sonic 2?\r
-.DrawStrip_interlace:\r
- tst r0, r0\r
- moveq r7, r7, lsl #21\r
- movne r7, r7, lsl #5\r
-\r
- @ Find the line in the name table\r
- add r2, r7, r2, lsl #22 @ r2=(vscroll+(Scanline<<1))<<21 (11 bits);\r
- orr r1, r1, #0x80000000\r
- and r2, r2, r1, ror #10 @ &((ymask<<1)|1)<<21;\r
- mov r2, r2, lsr #21\r
- mov r4, r2, lsr #4\r
- mov r12, r12, lsr #1 @ halfwords\r
- add r0, r12, r4, lsl r10 @ nametab+=(ts.line>>4)<<shift[width];\r
- and r9, r9, #0xff\r
-\r
- sub sp, sp, #6*4\r
- stmia sp, {r0,r2,r3,r5,r6,r9}\r
-\r
- mov r0, sp\r
- bl DrawStripInterlace @ struct TileStrip *ts\r
-\r
- add sp, sp, #6*4\r
- ldmfd sp!, {r4-r11,lr}\r
- bx lr\r
-\r
-.pool\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-.global BackFill @ int reg7, int sh\r
-\r
-BackFill:\r
- stmfd sp!, {r4-r9,lr}\r
-\r
- ldr lr, =(HighCol+8)\r
-\r
- mov r0, r0, lsl #26\r
- mov r0, r0, lsr #26\r
- orr r0, r0, r1, lsl #6\r
- orr r0, r0, r0, lsl #8\r
- orr r0, r0, r0, lsl #16\r
-\r
- mov r1, r0\r
- mov r2, r0\r
- mov r3, r0\r
- mov r4, r0\r
- mov r5, r0\r
- mov r6, r0\r
- mov r7, r0\r
-\r
- @ go go go!\r
- stmia lr!, {r0-r7} @ 10*8*4\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
-\r
- ldmfd sp!, {r4-r9,r12}\r
- bx r12\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-.global DrawTilesFromCache @ int *hc, int sh\r
-\r
-DrawTilesFromCache:\r
- stmfd sp!, {r4-r8,r11,lr}\r
-\r
- mvn r5, #0 @ r5=prevcode=-1\r
- mov r8, r1\r
-\r
- @ cache some stuff to avoid mem access\r
- ldr r11,=HighCol\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
- mov r12,#0xf\r
-\r
- @ scratch: r4, r7\r
-.dtfc_loop:\r
- ldr r6, [r0], #4 @ read code\r
- movs r1, r6, lsr #16 @ r1=dx;\r
- ldmeqfd sp!, {r4-r8,r11,pc} @ dx is never zero, this must be a terminator, return\r
- bic r1, r1, #0xfe00\r
- add r1, r11, r1 @ r1=pdest\r
-\r
-@ tst r8, r8\r
-@ bne .dtfc_shadow @ this is a rare case, so we jump when it happens, not when it doesn't\r
-@.dtfc_shadow_done:\r
-\r
- mov r7, r6, lsl #16\r
- cmp r5, r7, lsr #16\r
- beq .dtfc_samecode @ if (code==prevcode)\r
-\r
- mov r5, r7, lsr #16\r
-\r
- mov r2, r5, lsl #21\r
- mov r2, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4;\r
- add r2, r2, r6, lsr #25 @ addr+=ty\r
-\r
- and r3, r5, #0x6000\r
- mov r3, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
-.dtfc_samecode:\r
- tst r8, r8\r
- bne .dtfc_shadow\r
-\r
- tst r2, r2\r
- beq .dtfc_loop\r
-\r
- cmp r2, r2, ror #4\r
- beq .dtfc_SingleColor @ tileline singlecolor \r
-\r
- tst r5, #0x0800\r
- beq .dtfc_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlip r12\r
- b .dtfc_loop\r
-\r
-.dtfc_TileNorm:\r
- TileNorm r12\r
- b .dtfc_loop\r
-\r
-.dtfc_SingleColor:\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- tst r1, #1 @ not aligned?\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1 @ have a remaining unaligned pixel?\r
- b .dtfc_loop\r
-\r
-.dtfc_shadow:\r
- tst r2, r2\r
- beq .dtfc_shadow_blank\r
-\r
- cmp r2, r2, ror #4\r
- beq .dtfc_SingleColor @ tileline singlecolor \r
-\r
- tst r5, #0x0800\r
- beq .dtfc_TileNormShHP\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlipShHP r12\r
- b .dtfc_loop\r
-\r
-.dtfc_TileNormShHP:\r
- TileNormShHP r12\r
- b .dtfc_loop\r
-\r
-.dtfc_shadow_blank:\r
- ldrb r4, [r1]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1]\r
- ldrb r4, [r1,#1]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#1]\r
- ldrb r4, [r1,#2]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#2]\r
- ldrb r4, [r1,#3]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#3]\r
- ldrb r4, [r1,#4]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#4]\r
- ldrb r4, [r1,#5]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#5]\r
- ldrb r4, [r1,#6]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#6]\r
- ldrb r4, [r1,#7]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#7]\r
- b .dtfc_loop\r
-\r
-.pool\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-.global DrawSpritesFromCache @ int *hc, int sh\r
-\r
-DrawSpritesFromCache:\r
- stmfd sp!, {r4-r11,lr}\r
-\r
- @ cache some stuff to avoid mem access\r
- ldr r11,=HighCol\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
- mov r6, r1, lsl #31\r
- orr r6, r6, #1<<30\r
- mov r12,#0xf\r
-\r
- mov r10, r0\r
-\r
-.dsfc_loop:\r
- ldr r9, [r10], #4 @ read code\r
- tst r9, r9\r
- ldmeqfd sp!, {r4-r11,pc}\r
-\r
- mov r4, r9, lsl #28\r
- bic r6, r6, #7\r
- orr r6, r6, r4, lsr #30\r
- add r6, r6, #1 @ r6=s1cc???? ... ?????www (s=shadow/hilight, cc=pal, w=width)\r
-\r
- and r5, r9, #3\r
- add r5, r5, #1 @ r5=delta\r
- tst r9, #0x10000\r
- rsbne r5, r5, #0 @ Flip X\r
- mov r5, r5, lsl #4\r
-\r
- mov r2, r9, lsr #17\r
- mov r8, r2, lsl #1 @ tile=((unsigned int)code>>17)<<1;\r
-\r
- and r3, r9, #0x30 @ r3=pal=(code&0x30);\r
-\r
- bic r6, r6, #3<<28\r
- orr r6, r6, r3, lsl #24\r
-\r
- mov r0, r9, lsl #16\r
- mov r0, r0, asr #22 @ sx=(code<<16)>>22\r
- adds r0, r0, #0 @ set ZV\r
- b .dsfc_inloop_enter\r
-\r
-@ scratch: r4, r7\r
-.dsfc_inloop:\r
- sub r6, r6, #1\r
- tst r6, #7\r
- beq .dsfc_loop\r
- adds r0, r0, #8\r
- add r8, r8, r5\r
-\r
-.dsfc_inloop_enter:\r
- ble .dsfc_inloop\r
- cmp r0, #328\r
- bge .dsfc_loop\r
-\r
- mov r8, r8, lsl #17\r
- mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address\r
-\r
- ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+tile); // Get 8 pixels\r
- tst r2, r2\r
- beq .dsfc_inloop\r
-\r
- add r1, r11, r0 @ r1=pdest\r
-\r
- cmp r12, r6, lsr #28\r
- beq .dsfc_shadow\r
-\r
- cmp r2, r2, ror #4\r
- beq .dsfc_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x10000\r
- beq .dsfc_TileNorm\r
-\r
- @ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlip r12\r
- b .dsfc_inloop\r
-\r
-.dsfc_TileNorm:\r
- TileNorm r12\r
- b .dsfc_inloop\r
-\r
-.dsfc_SingleColor:\r
- tst r0, #1 @ not aligned?\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1\r
- b .dsfc_inloop\r
-\r
-.dsfc_shadow:\r
- cmp r2, r2, ror #4\r
- beq .dsfc_singlec_sh\r
-\r
- tst r9, #0x10000\r
- beq .dsfc_TileNorm_sh\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlipSh\r
- b .dsfc_inloop\r
-\r
-.dsfc_TileNorm_sh:\r
- TileNormSh\r
- b .dsfc_inloop\r
-\r
-.dsfc_singlec_sh:\r
- cmp r2, #0xe0000000\r
- bcc .dsfc_SingleColor @ normal singlecolor tileline (carry inverted in ARM)\r
- tst r2, #0x10000000\r
- bne .dsfc_sh_sh\r
- TileSingleHi\r
- b .dsfc_inloop\r
-\r
-.dsfc_sh_sh:\r
- TileSingleSh\r
- b .dsfc_inloop\r
-\r
-.pool\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-@ + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size\r
-@ + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-\r
-.global DrawSprite @ unsigned int *sprite, int **hc, int sh\r
-\r
-DrawSprite:\r
- stmfd sp!, {r4-r9,r11,lr}\r
-\r
- ldr r3, [r0] @ sprite[0]\r
- mov r6, r3, lsr #28\r
- sub r6, r6, #1 @ r6=width-1 (inc later)\r
- mov r5, r3, lsr #24\r
- and r5, r5, #7 @ r5=height\r
-\r
- mov r4, r3, lsl #16 @ r4=sy<<16 (tmp)\r
-\r
- ldr r7, =Scanline\r
- ldr r7, [r7]\r
- sub r7, r7, r4, asr #16 @ r7=row=Scanline-sy\r
-\r
- tst r2, r2\r
- ldr r9, [r0, #4]\r
- mov r2, r9, asr #16 @ r2=sx\r
- bic r9, r9, #0xfe000000\r
- orrne r9, r9, #1<<31 @ r9=code|(sh<<31)\r
-\r
- tst r9, #0x1000\r
- movne r4, r5, lsl #3\r
- subne r4, r4, #1\r
- subne r7, r4, r7 @ if (code&0x1000) row=(height<<3)-1-row; // Flip Y\r
-\r
- mov r8, r9, lsl #21\r
- mov r8, r8, lsr #21\r
- add r8, r8, r7, lsr #3 @ tile+=row>>3; // Tile number increases going down\r
- \r
- tst r9, #0x0800\r
- mlane r8, r5, r6, r8 @ if (code&0x0800) { tile+=delta*(width-1);\r
- rsbne r5, r5, #0 @ delta=-delta; } // r5=delta now\r
-\r
- mov r8, r8, lsl #4\r
- and r7, r7, #7\r
- add r8, r8, r7, lsl #1 @ tile+=(row&7)<<1; // Tile address\r
-\r
- tst r9, #0x8000\r
- bne .dspr_cache @ if(code&0x8000) // high priority - cache it\r
-\r
- @ cache some stuff to avoid mem access\r
- ldr r11,=HighCol\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
- mov r12,#0xf\r
-\r
- mov r5, r5, lsl #4 @ delta<<=4; // Delta of address\r
- and r4, r9, #0x6000\r
- orr r9, r9, r4, lsl #16\r
- orr r9, r9, #0x10000000 @ r9=scc1 ???? ... <code> (s=shadow/hilight, cc=pal)\r
-\r
- tst r9, #1<<31\r
- mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30);\r
- orrne r3, r3, #0x40 @ shadow by default\r
-\r
- add r6, r6, #1 @ inc now\r
- adds r0, r2, #0 @ mov sx to r0 and set ZV flags\r
- b .dspr_loop_enter\r
-\r
-.dspr_loop:\r
- subs r6, r6, #1 @ width--\r
- ldmeqfd sp!, {r4-r9,r11,pc}@ return\r
- adds r0, r0, #8 @ sx+=8\r
- add r8, r8, r5 @ tile+=delta\r
-\r
-.dspr_loop_enter:\r
- ble .dspr_loop @ sx <= 0\r
- cmp r0, #328\r
- ldmgefd sp!, {r4-r9,r11,pc}@ return\r
-\r
- mov r8, r8, lsl #17\r
- mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address\r
-\r
- ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- tst r2, r2\r
- beq .dspr_loop\r
-\r
- add r1, r11, r0 @ r1=pdest\r
-\r
- cmp r12, r9, lsr #28\r
- beq .dspr_shadow\r
-\r
- cmp r2, r2, ror #4\r
- beq .dspr_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x0800\r
- beq .dspr_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlip r12\r
- b .dspr_loop\r
-\r
-@ scratch: r4, r7\r
-.dspr_TileNorm:\r
- TileNorm r12\r
- b .dspr_loop\r
-\r
-.dspr_SingleColor:\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- tst r0, #1 @ not aligned?\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1\r
- b .dspr_loop\r
-\r
-.dspr_shadow:\r
- cmp r2, r2, ror #4\r
- beq .dspr_singlec_sh\r
-\r
- tst r9, #0x0800\r
- beq .dspr_TileNorm_sh\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlipSh\r
- b .dspr_loop\r
-\r
-.dspr_TileNorm_sh:\r
- TileNormSh\r
- b .dspr_loop\r
-\r
-.dspr_singlec_sh:\r
- cmp r2, #0xe0000000\r
- bcc .dspr_SingleColor @ normal tileline\r
- tst r2, #0x10000000\r
- bne .dspr_sh_sh\r
- TileSingleHi\r
- b .dspr_loop\r
-\r
-.dspr_sh_sh:\r
- TileSingleSh\r
- b .dspr_loop\r
-\r
-\r
-.dspr_cache:\r
- @ *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf);\r
- mov r4, r8, lsl #16 @ tile\r
- tst r9, #0x0800\r
- orrne r4, r4, #0x10000 @ code&0x0800\r
- mov r2, r2, lsl #22\r
- orr r4, r4, r2, lsr #16 @ (sx<<6)&0x0000ffc0\r
- and r2, r9, #0x6000\r
- orr r4, r4, r2, lsr #9 @ (code>>9)&0x30\r
- mov r2, r3, lsl #12\r
- orr r4, r4, r2, lsr #28 @ (sprite[0]>>24)&0xf\r
-\r
- ldr r2, [r1]\r
- str r4, [r2], #4\r
- str r2, [r1]\r
-\r
- ldmfd sp!, {r4-r9,r11,lr}\r
- bx lr\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-.global DrawWindow @ int tstart, int tend, int prio, int sh // int *hcache\r
-\r
-DrawWindow:\r
- stmfd sp!, {r4-r11,lr}\r
-\r
- ldr r11, =(Pico+0x22228) @ Pico.video\r
- ldrb r12, [r11, #3] @ pvid->reg[3]\r
- mov r12, r12, lsl #10\r
-\r
- ldr r10, =Scanline\r
- ldr r10, [r10]\r
- mov r5, r10, lsr #3\r
- and r10, r10, #7\r
- mov r10, r10, lsl #1 @ r10=ty\r
-\r
- ldr r4, [r11, #12]\r
- tst r4, #1 @ 40 cell mode?\r
- andne r12, r12, #0xf000 @ 0x3c<<10\r
- andeq r12, r12, #0xf800\r
- addne r12, r12, r5, lsl #7\r
- addeq r12, r12, r5, lsl #6 @ nametab\r
- add r12, r12, r0, lsl #2 @ +starttile\r
-\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
-\r
- @ fetch the first code now\r
- ldrh r7, [lr, r12]\r
-\r
- ldr r6, =rendstatus\r
- ldrb r6, [r6]\r
- ands r6, r6, #2 @ we care about bit 1 only\r
- orr r6, r6, r2\r
- bne .dw_no_sameprio\r
-\r
- cmp r2, r7, lsr #15\r
- ldmnefd sp!, {r4-r11,pc} @ assume that whole window uses same priority\r
-\r
-.dw_no_sameprio:\r
- orr r6, r6, r3, lsl #8 @ shadow mode\r
-\r
- sub r8, r1, r0\r
- mov r8, r8, lsl #1 @ cells\r
-\r
- mvn r9, #0 @ r9=prevcode=-1\r
-\r
- @ cache some stuff to avoid mem access\r
- ldr r11,=(HighCol+8)\r
- add r1, r11, r0, lsl #4 @ r1=pdest\r
- mov r0, #0xf\r
- b .dwloop_enter\r
-\r
- @ r4,r5 & r7 are scratch in this loop\r
-.dwloop:\r
- add r1, r1, #8\r
-.dwloop_nor1:\r
- subs r8, r8, #1\r
- add r12, r12, #2 @ halfwords\r
- beq .dwloop_end @ done\r
-\r
- ldrh r7, [lr, r12] @ r7=code (int, but from unsigned, no sign extend)\r
-\r
- eor r5, r6, r7, lsr #15\r
- tst r5, #1\r
- orrne r6, r6, #2 @ wrong pri\r
- bne .dwloop\r
-\r
- cmp r7, r9\r
- beq .dw_samecode @ we know stuff about this tile already\r
-\r
-.dwloop_enter:\r
- mov r9, r7 @ remember code\r
-\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
- add r2, r10, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
-\r
- and r3, r9, #0x6000\r
- mov r3, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
-.dw_samecode:\r
- tst r6, #0x100\r
- bne .dw_shadow\r
-.dw_shadow_done:\r
- tst r2, r2\r
- beq .dwloop @ tileline blank\r
-\r
- cmp r2, r2, ror #4\r
- beq .dw_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x0800\r
- beq .dw_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern\r
- TileFlip r0\r
- b .dwloop\r
-\r
-.dw_TileNorm:\r
- TileNorm r0\r
- b .dwloop\r
-\r
-.dw_SingleColor:\r
- and r4, r0, r2 @ #0x0000000f\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- orr r4, r4, r4, lsl #16\r
- mov r5, r4\r
- stmia r1!, {r4,r5}\r
- b .dwloop_nor1 @ we incremeted r1 ourselves\r
-\r
-.dw_shadow:\r
- tst r6, #1 @ hi pri?\r
- orreq r3, r3, #0x40\r
- beq .dw_shadow_done\r
- ldr r4, [r1]\r
- tst r4, #0x00000080\r
- biceq r4, r4, #0x000000c0\r
- tst r4, #0x00008000\r
- biceq r4, r4, #0x0000c000\r
- tst r4, #0x00800000\r
- biceq r4, r4, #0x00c00000\r
- tst r4, #0x80000000\r
- biceq r4, r4, #0xc0000000\r
- str r4, [r1]\r
- ldr r4, [r1,#4]\r
- tst r4, #0x00000080\r
- biceq r4, r4, #0x000000c0\r
- tst r4, #0x00008000\r
- biceq r4, r4, #0x0000c000\r
- tst r4, #0x00800000\r
- biceq r4, r4, #0x00c00000\r
- tst r4, #0x80000000\r
- biceq r4, r4, #0xc0000000\r
- str r4, [r1,#4]\r
- b .dw_shadow_done\r
-\r
-.dwloop_end:\r
- ldr r0, =rendstatus\r
- ldr r1, [r0]\r
- and r6, r6, #2\r
- orr r1, r1, r6\r
- str r1, [r0]\r
-\r
- ldmfd sp!, {r4-r11,r12}\r
- bx r12\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-@ hilights 2 pixels in RGB444/BGR444 format\r
-.macro TileDoShHi2Pixels444 reg\r
- mov \reg, \reg, ror #12\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #24\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #12\r
-.endm\r
-\r
-\r
-.global FinalizeLineBGR444 @ int sh\r
-\r
-FinalizeLineBGR444:\r
- stmfd sp!, {r4-r6,lr}\r
- mov r6, r0\r
- ldr r0, =DrawLineDest\r
- ldr r0, [r0]\r
- ldr lr, =(Pico+0x22228) @ Pico.video\r
- sub r3, lr, #0x128 @ r3=Pico.cram\r
-\r
- ldrb r12, [lr, #12]\r
- tst r12, #1\r
- movne r2, #320/4 @ len\r
- moveq r2, #256/4\r
- addeq r0, r0, #32*2\r
- ldreq r4, =PicoOpt\r
- ldreq r4, [r4]\r
- tsteq r4, #0x100\r
- addeq r0, r0, #32*2\r
-\r
- tst r6, r6\r
- beq .fl_noshBGR444\r
-\r
- ldr r4, =HighPal\r
-\r
- ldrb r12, [lr, #-0x1a] @ 0x2220e ~ dirtyPal\r
- tst r12, r12\r
- moveq r3, r4\r
- beq .fl_noshBGR444\r
- mov r12, #0\r
- strb r12, [lr, #-0x1a]\r
-\r
- mov lr, #0x40/8\r
- @ copy pal:\r
-.fl_loopcpBGR444:\r
- subs lr, lr, #1\r
- ldmia r3!, {r1,r5,r6,r12}\r
- stmia r4!, {r1,r5,r6,r12}\r
- bne .fl_loopcpBGR444\r
-\r
- @ shadowed pixels:\r
- mov r12, #0x0077\r
- orr r12,r12,#0x0700\r
- orr r12,r12,r12,lsl #16\r
- sub r3, r3, #0x40*2\r
- add r5, r4, #0x80*2\r
- mov lr, #0x40/4\r
-.fl_loopcpBGR444_sh:\r
- subs lr, lr, #1\r
- ldmia r3!, {r1,r6}\r
- and r1, r12, r1, lsr #1\r
- and r6, r12, r6, lsr #1\r
- stmia r4!, {r1,r6}\r
- stmia r5!, {r1,r6}\r
- bne .fl_loopcpBGR444_sh\r
-\r
- @ hilighted pixels:\r
- sub r3, r3, #0x40*2\r
- mov lr, #0x40/2\r
-.fl_loopcpBGR444_hi:\r
- ldr r1, [r3], #4\r
- TileDoShHi2Pixels444 r1\r
- str r1, [r4], #4\r
- subs lr, lr, #1\r
- bne .fl_loopcpBGR444_hi\r
-\r
- sub r3, r4, #0x40*3*2\r
-\r
-\r
-.fl_noshBGR444:\r
- ldr r1, =(HighCol+8)\r
- mov lr, #0xff\r
- mov lr, lr, lsl #1\r
-\r
-.fl_loopBGR444:\r
- subs r2, r2, #1\r
-\r
- ldr r12, [r1], #4\r
-\r
- and r4, lr, r12, lsl #1\r
- ldrh r4, [r3, r4]\r
- and r5, lr, r12, lsr #7\r
- ldrh r5, [r3, r5]\r
- orr r4, r4, r5, lsl #16\r
-\r
- and r5, lr, r12, lsr #15\r
- ldrh r5, [r3, r5]\r
- and r6, lr, r12, lsr #23\r
- ldrh r6, [r3, r6]\r
- orr r5, r5, r6, lsl #16\r
-\r
- stmia r0!, {r4,r5}\r
- bne .fl_loopBGR444\r
-\r
-\r
- ldmfd sp!, {r4-r6,lr}\r
- bx lr\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-@ hilights 2 pixels in RGB555/BGR555 format\r
-.macro TileDoShHi2Pixels555 reg\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #26\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #26\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
-.endm\r
-\r
-\r
-@ Convert 0000bbb0 ggg0rrr0\r
-@ to rrrrrggg gggbbbbb\r
-\r
-@ r2,r3,r9 - scratch, lr = 0x001c001c, r8 = 0x00030003\r
-.macro convRGB565 reg\r
- and r2, lr, \reg,lsl #1\r
- and r9, r8, \reg,lsr #2\r
- orr r2, r2, r9 @ r2=red\r
- and r3, lr, \reg,lsr #7\r
- and r9, r8, \reg,lsr #10\r
- orr r3, r3, r9 @ r3=blue\r
- and \reg, \reg, lr, lsl #3\r
- orr \reg, \reg, \reg,lsl #3 @ green\r
- orr \reg, \reg, r2, lsl #11 @ add red back\r
- orr \reg, \reg, r3 @ add blue back\r
-.endm\r
-\r
-vidConvCpyRGB565: @ void *to, void *from, int pixels\r
- stmfd sp!, {r4-r9,lr}\r
-\r
- mov r12, r2, lsr #3 @ repeats\r
- mov lr, #0x001c0000\r
- orr lr, lr, #0x01c @ lr == pattern 0x001c001c\r
- mov r8, #0x00030000\r
- orr r8, r8, #0x003 @ lr == pattern 0x001c001c\r
-\r
-.loopRGB565:\r
- subs r12, r12, #1\r
-\r
- ldmia r1!, {r4-r7}\r
- convRGB565 r4\r
- str r4, [r0], #4\r
- convRGB565 r5\r
- str r5, [r0], #4\r
- convRGB565 r6\r
- str r6, [r0], #4\r
- convRGB565 r7\r
- str r7, [r0], #4\r
-\r
- bgt .loopRGB565\r
-\r
- ldmfd sp!, {r4-r9,lr}\r
- bx lr\r
-\r
-\r
-\r
-.global FinalizeLineRGB555 @ int sh\r
-\r
-FinalizeLineRGB555:\r
- stmfd sp!, {r4-r8,lr}\r
- ldr r5, =(Pico+0x22228) @ Pico.video\r
- ldr r4, =HighPal\r
- mov r6, r0\r
-\r
- ldrb r7, [r5, #-0x1a] @ 0x2220e ~ dirtyPal\r
- tst r7, r7\r
- beq .fl_noconvRGB555\r
- mov r1, #0\r
- strb r1, [r5, #-0x1a]\r
- sub r1, r5, #0x128 @ r1=Pico.cram\r
- mov r0, r4\r
- mov r2, #0x40\r
- bl vidConvCpyRGB565\r
-\r
-.fl_noconvRGB555:\r
- ldr r0, =DrawLineDest\r
- ldr r0, [r0]\r
-\r
- ldrb r12, [r5, #12]\r
- tst r12, #1\r
- movne r2, #320/8 @ len\r
- moveq r2, #256/8\r
- ldreq r3, =PicoOpt\r
- ldreq r3, [r3]\r
- tsteq r3, #0x100\r
- addeq r0, r0, #32*2\r
-\r
- mov r3, r4\r
- tst r6, r6\r
- beq .fl_noshRGB555\r
- tst r7, r7\r
- beq .fl_noshRGB555\r
-\r
- @ shadowed pixels:\r
- mov r12, #0x008e\r
- orr r12,r12,#0x7300\r
- orr r12,r12,r12,lsl #16\r
- add r4, r3, #0x40*2\r
- add r5, r3, #0xc0*2\r
- mov lr, #0x40/4\r
-.fl_loopcpRGB555_sh:\r
- subs lr, lr, #1\r
- ldmia r3!, {r1,r6}\r
- and r1, r12, r1, lsr #1\r
- and r6, r12, r6, lsr #1\r
- stmia r4!, {r1,r6}\r
- stmia r5!, {r1,r6}\r
- bne .fl_loopcpRGB555_sh\r
-\r
- @ hilighted pixels:\r
- sub r3, r3, #0x40*2\r
- mov lr, #0x40/2\r
-.fl_loopcpRGB555_hi:\r
- ldr r1, [r3], #4\r
- TileDoShHi2Pixels555 r1\r
- str r1, [r4], #4\r
- subs lr, lr, #1\r
- bne .fl_loopcpRGB555_hi\r
-\r
- sub r3, r3, #0x40*2\r
-\r
-\r
-.fl_noshRGB555:\r
- ldr r1, =(HighCol+8)\r
- mov lr, #0xff\r
- mov lr, lr, lsl #1\r
-\r
-.fl_loopRGB555:\r
- subs r2, r2, #1\r
-\r
- ldr r12, [r1], #4\r
- ldr r7, [r1], #4\r
-\r
- and r4, lr, r12, lsl #1\r
- ldrh r4, [r3, r4]\r
- and r5, lr, r12, lsr #7\r
- ldrh r5, [r3, r5]\r
- orr r4, r4, r5, lsl #16\r
-\r
- and r5, lr, r12, lsr #15\r
- ldrh r5, [r3, r5]\r
- and r6, lr, r12, lsr #23\r
- ldrh r6, [r3, r6]\r
- orr r5, r5, r6, lsl #16\r
-\r
- and r8, lr, r7, lsl #1\r
- ldrh r8, [r3, r8]\r
- and r6, lr, r7, lsr #7\r
- ldrh r6, [r3, r6]\r
- orr r8, r8, r6, lsl #16\r
-\r
- and r12,lr, r7, lsr #15\r
- ldrh r12,[r3, r12]\r
- and r6, lr, r7, lsr #23\r
- ldrh r6, [r3, r6]\r
- orr r12,r12, r6, lsl #16\r
-\r
- stmia r0!, {r4,r5,r8,r12}\r
- bne .fl_loopRGB555\r
-\r
-\r
- ldmfd sp!, {r4-r8,lr}\r
- bx lr\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-@ utility\r
-.global blockcpy @ void *dst, void *src, size_t n\r
-\r
-blockcpy:\r
- stmfd sp!, {r4,r5}\r
- mov r2, r2, lsr #4\r
-blockcpy_loop:\r
- subs r2, r2, #1\r
- ldmia r1!, {r3-r5,r12}\r
- stmia r0!, {r3-r5,r12}\r
- bne blockcpy_loop\r
- ldmfd sp!, {r4,r5}\r
- bx lr\r
-\r
-\r
-.global blockcpy_or @ void *dst, void *src, size_t n, int pat\r
-\r
-blockcpy_or:\r
- stmfd sp!, {r4-r6}\r
- orr r3, r3, r3, lsl #8\r
- orr r3, r3, r3, lsl #16\r
- mov r2, r2, lsr #4\r
-blockcpy_loop_or:\r
- subs r2, r2, #1\r
- ldmia r1!, {r4-r6,r12}\r
- orr r4, r4, r3\r
- orr r5, r5, r3\r
- orr r6, r6, r3\r
- orr r12,r12,r3\r
- stmia r0!, {r4-r6,r12}\r
- bne blockcpy_loop_or\r
- ldmfd sp!, {r4-r6}\r
- bx lr\r
-\r
--- /dev/null
+# vim:filetype=mips
+
+# only CLUT for now..
+
+.set noreorder # don't reorder any instructions
+.set noat # don't use $at
+
+
+# void amips_clut(unsigned short *dst, unsigned char *src, unsigned short *pal, int count)
+
+.global amips_clut
+
+amips_clut:
+ srl $a3, 2
+amips_clut_loop:
+ lbu $t0, 0($a1) # tried lw here, no improvement noticed
+ lbu $t1, 1($a1)
+ lbu $t2, 2($a1)
+ lbu $t3, 3($a1)
+ sll $t0, 1
+ sll $t1, 1
+ sll $t2, 1
+ sll $t3, 1
+ addu $t0, $a2
+ addu $t1, $a2
+ addu $t2, $a2
+ addu $t3, $a2
+ lhu $t0, 0($t0)
+ lhu $t1, 0($t1)
+ lhu $t2, 0($t2)
+ lhu $t3, 0($t3)
+ ins $t0, $t1, 16, 16 # ins rt, rs, pos, size - Insert size bits starting
+ ins $t2, $t3, 16, 16 # from the LSB of rs into rt starting at position pos
+ sw $t0, 0($a0)
+ sw $t2, 4($a0)
+ addiu $a0, 8
+ addiu $a3, -1
+ bnez $a3, amips_clut_loop
+ addiu $a1, 4
+ jr $ra
+ nop
+
+++ /dev/null
-// This is part of Pico Library\r
-\r
-// (c) Copyright 2004 Dave, All rights reserved.\r
-// (c) Copyright 2006 notaz, All rights reserved.\r
-// Free for non-commercial use.\r
-\r
-// For commercial use, separate licencing terms must be obtained.\r
-\r
-\r
-#include "PicoInt.h"\r
-#ifndef __GNUC__\r
-#pragma warning (disable:4706) // Disable assignment within conditional\r
-#endif\r
-\r
-int (*PicoScan)(unsigned int num, void *data)=NULL;\r
-\r
-//unsigned short DefOutBuff[320*2];\r
-unsigned char HighCol[320*2];\r
-static int HighCacheA[41+1]; // caches for high layers\r
-static int HighCacheB[41+1];\r
-static int HighCacheS[80+1]; // and sprites\r
-static int HighPreSpr[80*2+1]; // slightly preprocessed sprites\r
-char HighSprZ[320+8+8]; // Z-buffer for accurate sprites and shadow/hilight mode\r
- // (if bit 7 == 0, sh caused by tile; if bit 6 == 0 pixel must be shadowed, else hilighted, if bit5 == 1)\r
-// lsb->msb: moved sprites, all window tiles don't use same priority, accurate sprites (copied from PicoOpt), interlace\r
-// dirty sprites, sonic mode, 16bit mode\r
-int rendstatus=0x40;\r
-void *DrawLineDest=HighCol; // pointer to dest buffer where to draw this line to\r
-unsigned char *DrawLineInt=HighCol; // dest for internal code\r
-int Scanline=0; // Scanline\r
-\r
-static int SpriteBlocks;\r
-//unsigned short ppt[] = { 0x0f11, 0x0ff1, 0x01f1, 0x011f, 0x01ff, 0x0f1f, 0x0f0e, 0x0e7c };\r
-\r
-struct TileStrip\r
-{\r
- int nametab; // Position in VRAM of name table (for this tile line)\r
- int line; // Line number in pixels 0x000-0x3ff within the virtual tilemap \r
- int hscroll; // Horizontal scroll value in pixels for the line\r
- int xmask; // X-Mask (0x1f - 0x7f) for horizontal wraparound in the tilemap\r
- int *hc; // cache for high tile codes and their positions\r
- int cells; // cells (tiles) to draw (32 col mode doesn't need to update whole 320)\r
-};\r
-\r
-// stuff available in asm:\r
-#ifdef _ASM_DRAW_C\r
-void DrawWindow(int tstart, int tend, int prio, int sh);\r
-void BackFill(int reg7, int sh);\r
-void DrawSprite(int *sprite, int **hc, int sh);\r
-void DrawTilesFromCache(int *hc, int sh);\r
-void DrawSpritesFromCache(int *hc, int sh);\r
-void DrawLayer(int plane, int *hcache, int maxcells, int sh);\r
-void FinalizeLineBGR444(int sh);\r
-void FinalizeLineRGB555(int sh);\r
-void blockcpy_or(void *dst, void *src, size_t n, int pat);\r
-#else\r
-// utility\r
-void blockcpy_or(void *dst, void *src, size_t n, int pat)\r
-{\r
- unsigned char *pd = dst, *ps = src;\r
- for (; n; n--)\r
- *pd++ = (unsigned char) (*ps++ | pat);\r
-}\r
-#endif\r
-\r
-\r
-static int TileNorm(int sx,int addr,int pal)\r
-{\r
- unsigned char *pd = DrawLineInt+sx;\r
- unsigned int pack=0; unsigned int t=0;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=pack&0x0000f000; if (t) pd[0]=(unsigned char)(pal|(t>>12));\r
- t=pack&0x00000f00; if (t) pd[1]=(unsigned char)(pal|(t>> 8));\r
- t=pack&0x000000f0; if (t) pd[2]=(unsigned char)(pal|(t>> 4));\r
- t=pack&0x0000000f; if (t) pd[3]=(unsigned char)(pal|(t ));\r
- t=pack&0xf0000000; if (t) pd[4]=(unsigned char)(pal|(t>>28));\r
- t=pack&0x0f000000; if (t) pd[5]=(unsigned char)(pal|(t>>24));\r
- t=pack&0x00f00000; if (t) pd[6]=(unsigned char)(pal|(t>>20));\r
- t=pack&0x000f0000; if (t) pd[7]=(unsigned char)(pal|(t>>16));\r
- return 0;\r
- }\r
-\r
- return 1; // Tile blank\r
-}\r
-\r
-static int TileFlip(int sx,int addr,int pal)\r
-{\r
- unsigned char *pd = DrawLineInt+sx;\r
- unsigned int pack=0; unsigned int t=0;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=pack&0x000f0000; if (t) pd[0]=(unsigned char)(pal|(t>>16));\r
- t=pack&0x00f00000; if (t) pd[1]=(unsigned char)(pal|(t>>20));\r
- t=pack&0x0f000000; if (t) pd[2]=(unsigned char)(pal|(t>>24));\r
- t=pack&0xf0000000; if (t) pd[3]=(unsigned char)(pal|(t>>28));\r
- t=pack&0x0000000f; if (t) pd[4]=(unsigned char)(pal|(t ));\r
- t=pack&0x000000f0; if (t) pd[5]=(unsigned char)(pal|(t>> 4));\r
- t=pack&0x00000f00; if (t) pd[6]=(unsigned char)(pal|(t>> 8));\r
- t=pack&0x0000f000; if (t) pd[7]=(unsigned char)(pal|(t>>12));\r
- return 0;\r
- }\r
- return 1; // Tile blank\r
-}\r
-\r
-\r
-// tile renderers for hacky operator sprite support\r
-#define sh_pix(x) \\r
- if(!t); \\r
- else if(t==0xe) pd[x]=(unsigned char)((pd[x]&0x3f)|0x80); /* hilight */ \\r
- else if(t==0xf) pd[x]=(unsigned char)((pd[x]&0x3f)|0xc0); /* shadow */ \\r
- else pd[x]=(unsigned char)(pal|t);\r
-\r
-#ifndef _ASM_DRAW_C\r
-static int TileNormSH(int sx,int addr,int pal)\r
-{\r
- unsigned int pack=0; unsigned int t=0;\r
- unsigned char *pd = DrawLineInt+sx;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=(pack&0x0000f000)>>12; sh_pix(0);\r
- t=(pack&0x00000f00)>> 8; sh_pix(1);\r
- t=(pack&0x000000f0)>> 4; sh_pix(2);\r
- t=(pack&0x0000000f) ; sh_pix(3);\r
- t=(pack&0xf0000000)>>28; sh_pix(4);\r
- t=(pack&0x0f000000)>>24; sh_pix(5);\r
- t=(pack&0x00f00000)>>20; sh_pix(6);\r
- t=(pack&0x000f0000)>>16; sh_pix(7);\r
- return 0;\r
- }\r
-\r
- return 1; // Tile blank\r
-}\r
-\r
-static int TileFlipSH(int sx,int addr,int pal)\r
-{\r
- unsigned int pack=0; unsigned int t=0;\r
- unsigned char *pd = DrawLineInt+sx;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=(pack&0x000f0000)>>16; sh_pix(0);\r
- t=(pack&0x00f00000)>>20; sh_pix(1);\r
- t=(pack&0x0f000000)>>24; sh_pix(2);\r
- t=(pack&0xf0000000)>>28; sh_pix(3);\r
- t=(pack&0x0000000f) ; sh_pix(4);\r
- t=(pack&0x000000f0)>> 4; sh_pix(5);\r
- t=(pack&0x00000f00)>> 8; sh_pix(6);\r
- t=(pack&0x0000f000)>>12; sh_pix(7);\r
- return 0;\r
- }\r
- return 1; // Tile blank\r
-}\r
-#endif\r
-\r
-static int TileNormZ(int sx,int addr,int pal,int zval)\r
-{\r
- unsigned int pack=0; unsigned int t=0;\r
- unsigned char *pd = DrawLineInt+sx;\r
- char *zb = HighSprZ+sx;\r
- int collision = 0, zb_s;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=pack&0x0000f000; if(t) { zb_s=zb[0]; if(zb_s) collision=1; if(zval>zb_s) { pd[0]=(unsigned char)(pal|(t>>12)); zb[0]=(char)zval; } }\r
- t=pack&0x00000f00; if(t) { zb_s=zb[1]; if(zb_s) collision=1; if(zval>zb_s) { pd[1]=(unsigned char)(pal|(t>> 8)); zb[1]=(char)zval; } }\r
- t=pack&0x000000f0; if(t) { zb_s=zb[2]; if(zb_s) collision=1; if(zval>zb_s) { pd[2]=(unsigned char)(pal|(t>> 4)); zb[2]=(char)zval; } }\r
- t=pack&0x0000000f; if(t) { zb_s=zb[3]; if(zb_s) collision=1; if(zval>zb_s) { pd[3]=(unsigned char)(pal|(t )); zb[3]=(char)zval; } }\r
- t=pack&0xf0000000; if(t) { zb_s=zb[4]; if(zb_s) collision=1; if(zval>zb_s) { pd[4]=(unsigned char)(pal|(t>>28)); zb[4]=(char)zval; } }\r
- t=pack&0x0f000000; if(t) { zb_s=zb[5]; if(zb_s) collision=1; if(zval>zb_s) { pd[5]=(unsigned char)(pal|(t>>24)); zb[5]=(char)zval; } }\r
- t=pack&0x00f00000; if(t) { zb_s=zb[6]; if(zb_s) collision=1; if(zval>zb_s) { pd[6]=(unsigned char)(pal|(t>>20)); zb[6]=(char)zval; } }\r
- t=pack&0x000f0000; if(t) { zb_s=zb[7]; if(zb_s) collision=1; if(zval>zb_s) { pd[7]=(unsigned char)(pal|(t>>16)); zb[7]=(char)zval; } }\r
- if(collision) Pico.video.status|=0x20;\r
- return 0;\r
- }\r
-\r
- return 1; // Tile blank\r
-}\r
-\r
-static int TileFlipZ(int sx,int addr,int pal,int zval)\r
-{\r
- unsigned int pack=0; unsigned int t=0;\r
- unsigned char *pd = DrawLineInt+sx;\r
- char *zb = HighSprZ+sx;\r
- int collision = 0, zb_s;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=pack&0x000f0000; if(t) { zb_s=zb[0]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[0]=(unsigned char)(pal|(t>>16)); zb[0]=(char)zval; } }\r
- t=pack&0x00f00000; if(t) { zb_s=zb[1]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[1]=(unsigned char)(pal|(t>>20)); zb[1]=(char)zval; } }\r
- t=pack&0x0f000000; if(t) { zb_s=zb[2]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[2]=(unsigned char)(pal|(t>>24)); zb[2]=(char)zval; } }\r
- t=pack&0xf0000000; if(t) { zb_s=zb[3]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[3]=(unsigned char)(pal|(t>>28)); zb[3]=(char)zval; } }\r
- t=pack&0x0000000f; if(t) { zb_s=zb[4]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[4]=(unsigned char)(pal|(t )); zb[4]=(char)zval; } }\r
- t=pack&0x000000f0; if(t) { zb_s=zb[5]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[5]=(unsigned char)(pal|(t>> 4)); zb[5]=(char)zval; } }\r
- t=pack&0x00000f00; if(t) { zb_s=zb[6]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[6]=(unsigned char)(pal|(t>> 8)); zb[6]=(char)zval; } }\r
- t=pack&0x0000f000; if(t) { zb_s=zb[7]&0x1f; if(zb_s) collision=1; if(zval>zb_s) { pd[7]=(unsigned char)(pal|(t>>12)); zb[7]=(char)zval; } }\r
- if(collision) Pico.video.status|=0x20;\r
- return 0;\r
- }\r
- return 1; // Tile blank\r
-}\r
-\r
-\r
-#define sh_pixZ(x) \\r
- if(t) { \\r
- if(zb[x]) collision=1; \\r
- if(zval>zb[x]) { \\r
- if (t==0xe) { pd[x]=(unsigned char)((pd[x]&0x3f)|0x80); /* hilight */ } \\r
- else if(t==0xf) { pd[x]=(unsigned char)((pd[x]&0x3f)|0xc0); /* shadow */ } \\r
- else { zb[x]=(char)zval; pd[x]=(unsigned char)(pal|t); } \\r
- } \\r
- }\r
-\r
-static int TileNormZSH(int sx,int addr,int pal,int zval)\r
-{\r
- unsigned int pack=0; unsigned int t=0;\r
- unsigned char *pd = DrawLineInt+sx;\r
- char *zb = HighSprZ+sx;\r
- int collision = 0;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=(pack&0x0000f000)>>12; sh_pixZ(0);\r
- t=(pack&0x00000f00)>> 8; sh_pixZ(1);\r
- t=(pack&0x000000f0)>> 4; sh_pixZ(2);\r
- t=(pack&0x0000000f) ; sh_pixZ(3);\r
- t=(pack&0xf0000000)>>28; sh_pixZ(4);\r
- t=(pack&0x0f000000)>>24; sh_pixZ(5);\r
- t=(pack&0x00f00000)>>20; sh_pixZ(6);\r
- t=(pack&0x000f0000)>>16; sh_pixZ(7);\r
- if(collision) Pico.video.status|=0x20;\r
- return 0;\r
- }\r
-\r
- return 1; // Tile blank\r
-}\r
-\r
-static int TileFlipZSH(int sx,int addr,int pal,int zval)\r
-{\r
- unsigned int pack=0; unsigned int t=0;\r
- unsigned char *pd = DrawLineInt+sx;\r
- char *zb = HighSprZ+sx;\r
- int collision = 0;\r
-\r
- pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- if (pack)\r
- {\r
- t=(pack&0x000f0000)>>16; sh_pixZ(0);\r
- t=(pack&0x00f00000)>>20; sh_pixZ(1);\r
- t=(pack&0x0f000000)>>24; sh_pixZ(2);\r
- t=(pack&0xf0000000)>>28; sh_pixZ(3);\r
- t=(pack&0x0000000f) ; sh_pixZ(4);\r
- t=(pack&0x000000f0)>> 4; sh_pixZ(5);\r
- t=(pack&0x00000f00)>> 8; sh_pixZ(6);\r
- t=(pack&0x0000f000)>>12; sh_pixZ(7);\r
- if(collision) Pico.video.status|=0x20;\r
- return 0;\r
- }\r
- return 1; // Tile blank\r
-}\r
-\r
-// --------------------------------------------\r
-\r
-#ifndef _ASM_DRAW_C\r
-static void DrawStrip(struct TileStrip *ts, int sh)\r
-{\r
- int tilex=0,dx=0,ty=0,code=0,addr=0,cells;\r
- int oldcode=-1,blank=-1; // The tile we know is blank\r
- int pal=0;\r
-\r
- // Draw tiles across screen:\r
- tilex=(-ts->hscroll)>>3;\r
- ty=(ts->line&7)<<1; // Y-Offset into tile\r
- dx=((ts->hscroll-1)&7)+1;\r
- cells = ts->cells;\r
- if(dx != 8) cells++; // have hscroll, need to draw 1 cell more\r
-\r
- for (; cells; dx+=8,tilex++,cells--)\r
- {\r
- int zero=0;\r
-\r
- code=Pico.vram[ts->nametab+(tilex&ts->xmask)];\r
- if (code==blank) continue;\r
- if (code>>15) { // high priority tile\r
- int cval = code | (dx<<16) | (ty<<25);\r
- if(code&0x1000) cval^=7<<26;\r
- *ts->hc++ = cval; // cache it\r
- continue;\r
- }\r
-\r
- if (code!=oldcode) {\r
- oldcode = code;\r
- // Get tile address/2:\r
- addr=(code&0x7ff)<<4;\r
- addr+=ty;\r
- if (code&0x1000) addr^=0xe; // Y-flip\r
-\r
-// pal=Pico.cram+((code>>9)&0x30);\r
- pal=((code>>9)&0x30)|(sh<<6);\r
- }\r
-\r
- if (code&0x0800) zero=TileFlip(dx,addr,pal);\r
- else zero=TileNorm(dx,addr,pal);\r
-\r
- if (zero) blank=code; // We know this tile is blank now\r
- }\r
-\r
- // terminate the cache list\r
- *ts->hc = 0;\r
-}\r
-#endif\r
-\r
-// this is messy\r
-#ifndef _ASM_DRAW_C\r
-static\r
-#endif\r
-void DrawStripVSRam(struct TileStrip *ts, int plane)\r
-{\r
- int tilex=0,dx=0,ty=0,code=0,addr=0,cell=0,nametabadd=0;\r
- int oldcode=-1,blank=-1; // The tile we know is blank\r
- int pal=0,scan=Scanline;\r
-\r
- // Draw tiles across screen:\r
- tilex=(-ts->hscroll)>>3;\r
- dx=((ts->hscroll-1)&7)+1;\r
- if(dx != 8) {\r
- int vscroll, line;\r
- cell--; // have hscroll, start with negative cell\r
- // also calculate intial VS stuff\r
- vscroll=Pico.vsram[plane];\r
-\r
- // Find the line in the name table\r
- line=(vscroll+scan)&ts->line&0xffff; // ts->line is really ymask ..\r
- nametabadd=(line>>3)<<(ts->line>>24); // .. and shift[width]\r
- ty=(line&7)<<1; // Y-Offset into tile\r
- }\r
-\r
- for (; cell < ts->cells; dx+=8,tilex++,cell++)\r
- {\r
- int zero=0;\r
-\r
- if((cell&1)==0) {\r
- int line,vscroll;\r
- vscroll=Pico.vsram[plane+(cell&~1)];\r
-\r
- // Find the line in the name table\r
- line=(vscroll+scan)&ts->line&0xffff; // ts->line is really ymask ..\r
- nametabadd=(line>>3)<<(ts->line>>24); // .. and shift[width]\r
- ty=(line&7)<<1; // Y-Offset into tile\r
- }\r
-\r
- code=Pico.vram[ts->nametab+nametabadd+(tilex&ts->xmask)];\r
- if (code==blank) continue;\r
- if (code>>15) { // high priority tile\r
- int cval = code | (dx<<16) | (ty<<25);\r
- if(code&0x1000) cval^=7<<26;\r
- *ts->hc++ = cval; // cache it\r
- continue;\r
- }\r
-\r
- if (code!=oldcode) {\r
- oldcode = code;\r
- // Get tile address/2:\r
- addr=(code&0x7ff)<<4;\r
- if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip\r
-\r
-// pal=Pico.cram+((code>>9)&0x30);\r
- pal=((code>>9)&0x30);\r
- }\r
-\r
- if (code&0x0800) zero=TileFlip(dx,addr,pal);\r
- else zero=TileNorm(dx,addr,pal);\r
-\r
- if (zero) blank=code; // We know this tile is blank now\r
- }\r
-\r
- // terminate the cache list\r
- *ts->hc = 0;\r
-}\r
-\r
-#ifndef _ASM_DRAW_C\r
-static\r
-#endif\r
-void DrawStripInterlace(struct TileStrip *ts)\r
-{\r
- int tilex=0,dx=0,ty=0,code=0,addr=0,cells;\r
- int oldcode=-1,blank=-1; // The tile we know is blank\r
- int pal=0;\r
-\r
- // Draw tiles across screen:\r
- tilex=(-ts->hscroll)>>3;\r
- ty=(ts->line&15)<<1; // Y-Offset into tile\r
- dx=((ts->hscroll-1)&7)+1;\r
- cells = ts->cells;\r
- if(dx != 8) cells++; // have hscroll, need to draw 1 cell more\r
-\r
- for (; cells; dx+=8,tilex++,cells--)\r
- {\r
- int zero=0;\r
-\r
- code=Pico.vram[ts->nametab+(tilex&ts->xmask)];\r
- if (code==blank) continue;\r
- if (code>>15) { // high priority tile\r
- int cval = (code&0xfc00) | (dx<<16) | (ty<<25);\r
- cval|=(code&0x3ff)<<1;\r
- if(code&0x1000) cval^=0xf<<26;\r
- *ts->hc++ = cval; // cache it\r
- continue;\r
- }\r
-\r
- if (code!=oldcode) {\r
- oldcode = code;\r
- // Get tile address/2:\r
- addr=(code&0x7ff)<<5;\r
- if (code&0x1000) addr+=30-ty; else addr+=ty; // Y-flip\r
-\r
-// pal=Pico.cram+((code>>9)&0x30);\r
- pal=((code>>9)&0x30);\r
- }\r
-\r
- if (code&0x0800) zero=TileFlip(dx,addr,pal);\r
- else zero=TileNorm(dx,addr,pal);\r
-\r
- if (zero) blank=code; // We know this tile is blank now\r
- }\r
-\r
- // terminate the cache list\r
- *ts->hc = 0;\r
-}\r
-\r
-// --------------------------------------------\r
-\r
-#ifndef _ASM_DRAW_C\r
-static void DrawLayer(int plane, int *hcache, int maxcells, int sh)\r
-{\r
- struct PicoVideo *pvid=&Pico.video;\r
- const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid)\r
- struct TileStrip ts;\r
- int width, height, ymask;\r
- int vscroll, htab;\r
-\r
- ts.hc=hcache;\r
- ts.cells=maxcells;\r
-\r
- // Work out the TileStrip to draw\r
-\r
- // Work out the name table size: 32 64 or 128 tiles (0-3)\r
- width=pvid->reg[16];\r
- height=(width>>4)&3; width&=3;\r
-\r
- ts.xmask=(1<<shift[width])-1; // X Mask in tiles (0x1f-0x7f)\r
- ymask=(height<<8)|0xff; // Y Mask in pixels\r
- if(width == 1) ymask&=0x1ff;\r
- else if(width>1) ymask =0x0ff;\r
-\r
- // Find name table:\r
- if (plane==0) ts.nametab=(pvid->reg[2]&0x38)<< 9; // A\r
- else ts.nametab=(pvid->reg[4]&0x07)<<12; // B\r
-\r
- htab=pvid->reg[13]<<9; // Horizontal scroll table address\r
- if ( pvid->reg[11]&2) htab+=Scanline<<1; // Offset by line\r
- if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile\r
- htab+=plane; // A or B\r
-\r
- // Get horizontal scroll value, will be masked later\r
- ts.hscroll=Pico.vram[htab&0x7fff];\r
-\r
- if((pvid->reg[12]&6) == 6) {\r
- // interlace mode 2\r
- vscroll=Pico.vsram[plane]; // Get vertical scroll value\r
-\r
- // Find the line in the name table\r
- ts.line=(vscroll+(Scanline<<1))&((ymask<<1)|1);\r
- ts.nametab+=(ts.line>>4)<<shift[width];\r
-\r
- DrawStripInterlace(&ts);\r
- } else if( pvid->reg[11]&4) {\r
- // shit, we have 2-cell column based vscroll\r
- // luckily this doesn't happen too often\r
- ts.line=ymask|(shift[width]<<24); // save some stuff instead of line\r
- DrawStripVSRam(&ts, plane);\r
- } else {\r
- vscroll=Pico.vsram[plane]; // Get vertical scroll value\r
-\r
- // Find the line in the name table\r
- ts.line=(vscroll+Scanline)&ymask;\r
- ts.nametab+=(ts.line>>3)<<shift[width];\r
-\r
- DrawStrip(&ts, sh);\r
- }\r
-}\r
-\r
-\r
-// --------------------------------------------\r
-\r
-// tstart & tend are tile pair numbers\r
-static void DrawWindow(int tstart, int tend, int prio, int sh) // int *hcache\r
-{\r
- struct PicoVideo *pvid=&Pico.video;\r
- int tilex=0,ty=0,nametab,code=0;\r
- int blank=-1; // The tile we know is blank\r
-\r
- // Find name table line:\r
- if (pvid->reg[12]&1)\r
- {\r
- nametab=(pvid->reg[3]&0x3c)<<9; // 40-cell mode\r
- nametab+=(Scanline>>3)<<6;\r
- }\r
- else\r
- {\r
- nametab=(pvid->reg[3]&0x3e)<<9; // 32-cell mode\r
- nametab+=(Scanline>>3)<<5;\r
- }\r
-\r
- tilex=tstart<<1;\r
- tend<<=1;\r
-\r
- ty=(Scanline&7)<<1; // Y-Offset into tile\r
-\r
- if(!(rendstatus&2)) {\r
- // check the first tile code\r
- code=Pico.vram[nametab+tilex];\r
- // if the whole window uses same priority (what is often the case), we may be able to skip this field\r
- if((code>>15) != prio) return;\r
- }\r
-\r
- // Draw tiles across screen:\r
- for (; tilex < tend; tilex++)\r
- {\r
- int addr=0,zero=0;\r
- int pal;\r
-\r
- code=Pico.vram[nametab+tilex];\r
- if(code==blank) continue;\r
- if((code>>15) != prio) {\r
- rendstatus|=2;\r
- continue;\r
- }\r
-\r
- pal=((code>>9)&0x30);\r
-\r
- if(sh) {\r
- int tmp, *zb = (int *)(DrawLineInt+8+(tilex<<3));\r
- if(prio) {\r
- tmp = *zb;\r
- if(!(tmp&0x00000080)) tmp&=~0x000000c0; if(!(tmp&0x00008000)) tmp&=~0x0000c000;\r
- if(!(tmp&0x00800000)) tmp&=~0x00c00000; if(!(tmp&0x80000000)) tmp&=~0xc0000000;\r
- *zb++=tmp; tmp = *zb;\r
- if(!(tmp&0x00000080)) tmp&=~0x000000c0; if(!(tmp&0x00008000)) tmp&=~0x0000c000;\r
- if(!(tmp&0x00800000)) tmp&=~0x00c00000; if(!(tmp&0x80000000)) tmp&=~0xc0000000;\r
- *zb++=tmp;\r
- } else {\r
- pal |= 0x40;\r
- }\r
- }\r
-\r
- // Get tile address/2:\r
- addr=(code&0x7ff)<<4;\r
- if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip\r
-\r
- if (code&0x0800) zero=TileFlip(8+(tilex<<3),addr,pal);\r
- else zero=TileNorm(8+(tilex<<3),addr,pal);\r
-\r
- if (zero) blank=code; // We know this tile is blank now\r
- }\r
-\r
- // terminate the cache list\r
- //*hcache = 0;\r
-}\r
-\r
-// --------------------------------------------\r
-\r
-static void DrawTilesFromCache(int *hc, int sh)\r
-{\r
- int code, addr, zero, dx;\r
- int pal;\r
- short blank=-1; // The tile we know is blank\r
-\r
- // *ts->hc++ = code | (dx<<16) | (ty<<25); // cache it\r
-\r
- while((code=*hc++)) {\r
- if(!sh && (short)code == blank) continue;\r
-\r
- // Get tile address/2:\r
- addr=(code&0x7ff)<<4;\r
- addr+=(unsigned int)code>>25; // y offset into tile\r
- dx=(code>>16)&0x1ff;\r
- if(sh) {\r
- unsigned char *zb = DrawLineInt+dx;\r
- if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++;\r
- if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++;\r
- if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++;\r
- if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++;\r
- }\r
-\r
- pal=((code>>9)&0x30);\r
-\r
- if (code&0x0800) zero=TileFlip(dx,addr,pal);\r
- else zero=TileNorm(dx,addr,pal);\r
-\r
- if(zero) blank=(short)code;\r
- }\r
-}\r
-\r
-// --------------------------------------------\r
-\r
-// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size\r
-// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-\r
-static void DrawSprite(int *sprite, int **hc, int sh)\r
-{\r
- int width=0,height=0;\r
- int row=0,code=0;\r
- int pal;\r
- int tile=0,delta=0;\r
- int sx, sy;\r
- int (*fTileFunc)(int sx,int addr,int pal);\r
-\r
- // parse the sprite data\r
- sy=sprite[0];\r
- code=sprite[1];\r
- sx=code>>16; // X\r
- width=sy>>28;\r
- height=(sy>>24)&7; // Width and height in tiles\r
- sy=(sy<<16)>>16; // Y\r
-\r
- row=Scanline-sy; // Row of the sprite we are on\r
-\r
- if (code&0x1000) row=(height<<3)-1-row; // Flip Y\r
-\r
- tile=code&0x7ff; // Tile number\r
- tile+=row>>3; // Tile number increases going down\r
- delta=height; // Delta to increase tile by going right\r
- if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X\r
-\r
- tile<<=4; tile+=(row&7)<<1; // Tile address\r
-\r
- if(code&0x8000) { // high priority - cache it\r
- *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>16)&0xf);\r
- } else {\r
- delta<<=4; // Delta of address\r
- pal=((code>>9)&0x30)|(sh<<6);\r
-\r
- if(sh && (code&0x6000) == 0x6000) {\r
- if(code&0x0800) fTileFunc=TileFlipSH;\r
- else fTileFunc=TileNormSH;\r
- } else {\r
- if(code&0x0800) fTileFunc=TileFlip;\r
- else fTileFunc=TileNorm;\r
- }\r
-\r
- for (; width; width--,sx+=8,tile+=delta)\r
- {\r
- if(sx<=0) continue;\r
- if(sx>=328) break; // Offscreen\r
-\r
- tile&=0x7fff; // Clip tile address\r
- fTileFunc(sx,tile,pal);\r
- }\r
- }\r
-}\r
-#endif\r
-\r
-\r
-// Index + 0 : hhhhvvvv s---hhvv yyyyyyyy yyyyyyyy // s: skip flag, h: horiz. size\r
-// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-\r
-static void DrawSpriteZ(int pack, int pack2, int shpri, int sprio)\r
-{\r
- int width=0,height=0;\r
- int row=0;\r
- int pal;\r
- int tile=0,delta=0;\r
- int sx, sy;\r
- int (*fTileFunc)(int sx,int addr,int pal,int zval);\r
-\r
- // parse the sprite data\r
- sx=pack2>>16; // X\r
- sy=(pack <<16)>>16; // Y\r
- width=pack>>28;\r
- height=(pack>>24)&7; // Width and height in tiles\r
-\r
- row=Scanline-sy; // Row of the sprite we are on\r
-\r
- if (pack2&0x1000) row=(height<<3)-1-row; // Flip Y\r
-\r
- tile=pack2&0x7ff; // Tile number\r
- tile+=row>>3; // Tile number increases going down\r
- delta=height; // Delta to increase tile by going right\r
- if (pack2&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X\r
-\r
- tile<<=4; tile+=(row&7)<<1; // Tile address\r
- delta<<=4; // Delta of address\r
- pal=((pack2>>9)&0x30);\r
- if((shpri&1)&&!(shpri&2)) pal|=0x40;\r
-\r
- shpri&=1;\r
- if((pack2&0x6000) != 0x6000) shpri = 0;\r
- shpri |= (pack2&0x0800)>>10;\r
- switch(shpri) {\r
- default:\r
- case 0: fTileFunc=TileNormZ; break;\r
- case 1: fTileFunc=TileNormZSH; break;\r
- case 2: fTileFunc=TileFlipZ; break;\r
- case 3: fTileFunc=TileFlipZSH; break;\r
- }\r
-\r
- for (; width; width--,sx+=8,tile+=delta)\r
- {\r
- if(sx<=0) continue;\r
- if(sx>=328) break; // Offscreen\r
-\r
- tile&=0x7fff; // Clip tile address\r
- fTileFunc(sx,tile,pal,sprio);\r
- }\r
-}\r
-\r
-static void DrawSpriteInterlace(unsigned int *sprite)\r
-{\r
- int width=0,height=0;\r
- int row=0,code=0;\r
- int pal;\r
- int tile=0,delta=0;\r
- int sx, sy;\r
-\r
- // parse the sprite data\r
- sy=sprite[0];\r
- height=sy>>24;\r
- sy=(sy&0x3ff)-0x100; // Y\r
- width=(height>>2)&3; height&=3;\r
- width++; height++; // Width and height in tiles\r
-\r
- row=(Scanline<<1)-sy; // Row of the sprite we are on\r
-\r
- code=sprite[1];\r
- sx=((code>>16)&0x1ff)-0x78; // X\r
-\r
- if (code&0x1000) row^=(16<<height)-1; // Flip Y\r
-\r
- tile=code&0x3ff; // Tile number\r
- tile+=row>>4; // Tile number increases going down\r
- delta=height; // Delta to increase tile by going right\r
- if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X\r
-\r
- tile<<=5; tile+=(row&15)<<1; // Tile address\r
-\r
- delta<<=5; // Delta of address\r
- pal=((code>>9)&0x30); // Get palette pointer\r
-\r
- for (; width; width--,sx+=8,tile+=delta)\r
- {\r
- if(sx<=0) continue;\r
- if(sx>=328) break; // Offscreen\r
-\r
- tile&=0x7fff; // Clip tile address\r
- if (code&0x0800) TileFlip(sx,tile,pal);\r
- else TileNorm(sx,tile,pal);\r
- }\r
-}\r
-\r
-\r
-static void DrawAllSpritesInterlace(int pri, int maxwidth)\r
-{\r
- struct PicoVideo *pvid=&Pico.video;\r
- int i,u,table,link=0,sline=Scanline<<1;\r
- unsigned int *sprites[80]; // Sprite index\r
-\r
- table=pvid->reg[5]&0x7f;\r
- if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode\r
- table<<=8; // Get sprite table address/2\r
-\r
- for (i=u=0; u < 80 && i < 21; u++)\r
- {\r
- unsigned int *sprite;\r
- int code, sx, sy, height;\r
-\r
- sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
-\r
- // get sprite info\r
- code = sprite[0];\r
- sx = sprite[1];\r
- if(((sx>>15)&1) != pri) goto nextsprite; // wrong priority sprite\r
-\r
- // check if it is on this line\r
- sy = (code&0x3ff)-0x100;\r
- height = (((code>>24)&3)+1)<<4;\r
- if(sline < sy || sline >= sy+height) goto nextsprite; // no\r
-\r
- // check if sprite is not hidden offscreen\r
- sx = (sx>>16)&0x1ff;\r
- sx -= 0x78; // Get X coordinate + 8\r
- if(sx <= -8*3 || sx >= maxwidth) goto nextsprite;\r
-\r
- // sprite is good, save it's pointer\r
- sprites[i++]=sprite;\r
-\r
- nextsprite:\r
- // Find next sprite\r
- link=(code>>16)&0x7f;\r
- if(!link) break; // End of sprites\r
- }\r
-\r
- // Go through sprites backwards:\r
- for (i-- ;i>=0; i--)\r
- DrawSpriteInterlace(sprites[i]);\r
-}\r
-\r
-\r
-#ifndef _ASM_DRAW_C\r
-static void DrawSpritesFromCache(int *hc, int sh)\r
-{\r
- int code, tile, sx, delta, width;\r
- int pal;\r
- int (*fTileFunc)(int sx,int addr,int pal);\r
-\r
- // *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf);\r
-\r
- while((code=*hc++)) {\r
- pal=(code&0x30);\r
- delta=code&0xf;\r
- width=delta>>2; delta&=3;\r
- width++; delta++; // Width and height in tiles\r
- if (code&0x10000) delta=-delta; // Flip X\r
- delta<<=4;\r
- tile=((unsigned int)code>>17)<<1;\r
- sx=(code<<16)>>22; // sx can be negative (start offscreen), so sign extend\r
-\r
- if(sh && pal == 0x30) { //\r
- if(code&0x10000) fTileFunc=TileFlipSH;\r
- else fTileFunc=TileNormSH;\r
- } else {\r
- if(code&0x10000) fTileFunc=TileFlip;\r
- else fTileFunc=TileNorm;\r
- }\r
-\r
- for (; width; width--,sx+=8,tile+=delta)\r
- {\r
- if(sx<=0) continue;\r
- if(sx>=328) break; // Offscreen\r
-\r
- tile&=0x7fff; // Clip tile address\r
- fTileFunc(sx,tile,pal);\r
- }\r
- }\r
-}\r
-#endif\r
-\r
-\r
-// Index + 0 : ----hhvv -lllllll -------y yyyyyyyy\r
-// Index + 4 : -------x xxxxxxxx pccvhnnn nnnnnnnn\r
-// v\r
-// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size\r
-// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-\r
-static void PrepareSprites(int full)\r
-{\r
- struct PicoVideo *pvid=&Pico.video;\r
- int u=0,link=0,sblocks=0;\r
- int table=0;\r
- int *pd = HighPreSpr;\r
-\r
- table=pvid->reg[5]&0x7f;\r
- if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode\r
- table<<=8; // Get sprite table address/2\r
-\r
- if (!full)\r
- {\r
- int pack;\r
- // updates: tilecode, sx\r
- for (u=0; u < 80 && (pack = *pd); u++, pd+=2)\r
- {\r
- unsigned int *sprite;\r
- int code, code2, sx, sy, skip=0;\r
-\r
- sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
-\r
- // parse sprite info\r
- code = sprite[0];\r
- code2 = sprite[1];\r
- code2 &= ~0xfe000000;\r
- code2 -= 0x00780000; // Get X coordinate + 8 in upper 16 bits\r
- sx = code2>>16;\r
-\r
- if((sx <= 8-((pack>>28)<<3) && sx >= -0x76) || sx >= 328) skip=1<<23;\r
- else if ((sy = (pack<<16)>>16) < 240 && sy > -32) {\r
- int sbl = (2<<(pack>>28))-1;\r
- sblocks |= sbl<<(sy>>3);\r
- }\r
-\r
- *pd = (pack&~(1<<23))|skip;\r
- *(pd+1) = code2;\r
-\r
- // Find next sprite\r
- link=(code>>16)&0x7f;\r
- if(!link) break; // End of sprites\r
- }\r
- SpriteBlocks |= sblocks;\r
- }\r
- else\r
- {\r
- for (; u < 80; u++)\r
- {\r
- unsigned int *sprite;\r
- int code, code2, sx, sy, hv, height, width, skip=0, sx_min;\r
-\r
- sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
-\r
- // parse sprite info\r
- code = sprite[0];\r
- sy = (code&0x1ff)-0x80;\r
- hv = (code>>24)&0xf;\r
- height = (hv&3)+1;\r
-\r
- if(sy > 240 || sy + (height<<3) <= 0) skip|=1<<22;\r
- \r
- width = (hv>>2)+1;\r
- code2 = sprite[1];\r
- sx = (code2>>16)&0x1ff;\r
- sx -= 0x78; // Get X coordinate + 8\r
- sx_min = 8-(width<<3);\r
- \r
- if((sx <= sx_min && sx >= -0x76) || sx >= 328) skip|=1<<23;\r
- else if (sx > sx_min && !skip) {\r
- int sbl = (2<<height)-1;\r
- int shi = sy>>3;\r
- if(shi < 0) shi=0; // negative sy\r
- sblocks |= sbl<<shi;\r
- }\r
- \r
- *pd++ = (width<<28)|(height<<24)|skip|(hv<<16)|((unsigned short)sy);\r
- *pd++ = (sx<<16)|((unsigned short)code2);\r
- \r
- // Find next sprite\r
- link=(code>>16)&0x7f;\r
- if(!link) break; // End of sprites\r
- }\r
- SpriteBlocks = sblocks;\r
- *pd = 0; // terminate\r
- }\r
-}\r
-\r
-static void DrawAllSprites(int *hcache, int maxwidth, int prio, int sh)\r
-{\r
- int i,u,n;\r
- int sx1seen=0; // sprite with x coord 1 or 0 seen\r
- int ntiles = 0; // tile counter for sprite limit emulation\r
- int *sprites[40]; // Sprites to draw in fast mode\r
- int *ps, pack, rs = rendstatus, scan=Scanline;\r
-\r
- if(rs&8) {\r
- DrawAllSpritesInterlace(prio, maxwidth);\r
- return;\r
- }\r
- if(rs&0x11) {\r
- //dprintf("PrepareSprites(%i) [%i]", (rs>>4)&1, scan);\r
- PrepareSprites(rs&0x10);\r
- rendstatus=rs&~0x11;\r
- }\r
- if (!(SpriteBlocks & (1<<(scan>>3)))) return;\r
-\r
- if(((rs&4)||sh)&&prio==0)\r
- memset(HighSprZ, 0, 328);\r
- if(!(rs&4)&&prio) {\r
- if(hcache[0]) DrawSpritesFromCache(hcache, sh);\r
- return;\r
- }\r
-\r
- ps = HighPreSpr;\r
-\r
- // Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size\r
- // Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-\r
- for(i=u=n=0; (pack = *ps) && n < 20; ps+=2, u++)\r
- {\r
- int sx, sy, row, pack2;\r
-\r
- if(pack & 0x00400000) continue;\r
-\r
- // get sprite info\r
- pack2 = *(ps+1);\r
- sx = pack2>>16;\r
- sy = (pack <<16)>>16;\r
- row = scan-sy;\r
-\r
- //dprintf("x: %i y: %i %ix%i", sx, sy, (pack>>28)<<3, (pack>>21)&0x38);\r
-\r
- if(sx == -0x77) sx1seen|=1; // for masking mode 2\r
-\r
- // check if it is on this line\r
- if(row < 0 || row >= ((pack>>21)&0x38)) continue; // no\r
- n++; // number of sprites on this line (both visible and hidden, max is 20) [broken]\r
-\r
- // sprite limit\r
- ntiles += pack>>28;\r
- if(ntiles > 40) break;\r
-\r
- if(pack & 0x00800000) continue;\r
-\r
- // masking sprite?\r
- if(sx == -0x78) {\r
- if(!(sx1seen&1) || sx1seen==3) {\r
- break; // this sprite is not drawn and remaining sprites are masked\r
- }\r
- if((sx1seen>>8) == 0) sx1seen=(i+1)<<8;\r
- continue;\r
- }\r
- else if(sx == -0x77) {\r
- // masking mode2 (Outrun, Galaxy Force II, Shadow of the beast)\r
- if(sx1seen>>8) { i=(sx1seen>>8)-1; break; } // seen both 0 and 1\r
- sx1seen |= 2;\r
- continue;\r
- }\r
-\r
- // accurate sprites\r
- //dprintf("P:%i",((sx>>15)&1));\r
- if(rs&4) {\r
- // might need to skip this sprite\r
- if((pack2&0x8000) ^ (prio<<15)) continue;\r
- DrawSpriteZ(pack,pack2,sh|(prio<<1),(char)(0x1f-n));\r
- continue;\r
- }\r
-\r
- // sprite is good, save it's pointer\r
- sprites[i++]=ps;\r
- }\r
-\r
- // Go through sprites backwards:\r
- if(!(rs&4)) {\r
- for (i--; i>=0; i--)\r
- DrawSprite(sprites[i],&hcache,sh);\r
-\r
- // terminate cache list\r
- *hcache = 0;\r
- }\r
-}\r
-\r
-\r
-// --------------------------------------------\r
-\r
-#ifndef _ASM_DRAW_C\r
-static void BackFill(int reg7, int sh)\r
-{\r
- unsigned int back=0;\r
- unsigned int *pd=NULL,*end=NULL;\r
-\r
- // Start with a blank scanline (background colour):\r
- back=reg7&0x3f;\r
- back|=sh<<6;\r
- back|=back<<8;\r
- back|=back<<16;\r
-\r
- pd= (unsigned int *)(DrawLineInt+8);\r
- end=(unsigned int *)(DrawLineInt+8+320);\r
-\r
- do { pd[0]=pd[1]=pd[2]=pd[3]=back; pd+=4; } while (pd<end);\r
-}\r
-#endif\r
-\r
-// --------------------------------------------\r
-\r
-unsigned short HighPal[0x100];\r
-\r
-#ifndef _ASM_DRAW_C\r
-static void FinalizeLineBGR444(int sh)\r
-{\r
- unsigned short *pd=DrawLineDest;\r
- unsigned char *ps=DrawLineInt+8;\r
- unsigned short *pal=Pico.cram;\r
- int len, i, t;\r
-\r
- if (Pico.video.reg[12]&1) {\r
- len = 320;\r
- } else {\r
- if(!(PicoOpt&0x100)) pd+=32;\r
- len = 256;\r
- }\r
-\r
- if(sh) {\r
- pal=HighPal;\r
- if(Pico.m.dirtyPal) {\r
- blockcpy(pal, Pico.cram, 0x40*2);\r
- // shadowed pixels\r
- for(i = 0x3f; i >= 0; i--)\r
- pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x0777);\r
- // hilighted pixels\r
- for(i = 0x3f; i >= 0; i--) {\r
- t=pal[i]&0xeee;t+=0x444;if(t&0x10)t|=0xe;if(t&0x100)t|=0xe0;if(t&0x1000)t|=0xe00;t&=0xeee;\r
- pal[0x80|i]=(unsigned short)t;\r
- }\r
- Pico.m.dirtyPal = 0;\r
- }\r
- }\r
-\r
- for(i = 0; i < len; i++)\r
- pd[i] = pal[ps[i]];\r
-}\r
-\r
-\r
-static void FinalizeLineRGB555(int sh)\r
-{\r
- unsigned short *pd=DrawLineDest;\r
- unsigned char *ps=DrawLineInt+8;\r
- unsigned short *pal=HighPal;\r
- int len, i, t, dirtyPal = Pico.m.dirtyPal;\r
-\r
- if(dirtyPal) {\r
- unsigned short *ppal=Pico.cram;\r
- for(i = 0x3f; i >= 0; i--)\r
- pal[i] = (unsigned short) (((ppal[i]&0x00f)<<12)|((ppal[i]&0x0f0)<<3)|((ppal[i]&0xf00)>>7));\r
- Pico.m.dirtyPal = 0;\r
- }\r
-\r
- if (Pico.video.reg[12]&1) {\r
- len = 320;\r
- } else {\r
- if(!(PicoOpt&0x100)) pd+=32;\r
- len = 256;\r
- }\r
-\r
- if(sh) {\r
- if(dirtyPal) {\r
- // shadowed pixels\r
- for(i = 0x3f; i >= 0; i--)\r
- pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x738e);\r
- // hilighted pixels\r
- for(i = 0x3f; i >= 0; i--) {\r
- t=pal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c;\r
- pal[0x80|i]=(unsigned short)t;\r
- }\r
- }\r
- }\r
-\r
- for(i = 0; i < len; i++)\r
- pd[i] = pal[ps[i]];\r
-}\r
-#endif\r
-\r
-static void FinalizeLine8bit(int sh)\r
-{\r
- unsigned char *pd=DrawLineDest;\r
- int len, rs = rendstatus;\r
- static int dirty_count;\r
-\r
- if (!sh && Pico.m.dirtyPal && Scanline < 222) {\r
- // a hack for mid-frame palette changes\r
- if (!(rs & 0x20))\r
- dirty_count = 1;\r
- else dirty_count++;\r
- rs |= 0x20;\r
- rendstatus = rs;\r
- if (dirty_count == 3) {\r
- blockcpy(HighPal, Pico.cram, 0x40*2);\r
- } else if (dirty_count == 11) {\r
- blockcpy(HighPal+0x40, Pico.cram, 0x40*2);\r
- }\r
- }\r
-\r
- if (Pico.video.reg[12]&1) {\r
- len = 320;\r
- } else {\r
- if(!(PicoOpt&0x100)) pd+=32;\r
- len = 256;\r
- }\r
-\r
-/* test\r
- if (!sh && rs & 0x20) {\r
- if (dirty_count >= 11) {\r
- blockcpy_or(pd, HighCol+8, len, 0x80);\r
- } else {\r
- blockcpy_or(pd, HighCol+8, len, 0x40);\r
- }\r
- } else {\r
- blockcpy(pd, HighCol+8, len);\r
- }\r
-*/\r
-}\r
-\r
-void (*FinalizeLine)(int sh) = FinalizeLineBGR444;\r
-\r
-// --------------------------------------------\r
-\r
-static int DrawDisplay(int sh)\r
-{\r
- struct PicoVideo *pvid=&Pico.video;\r
- int win=0,edge=0,hvwind=0;\r
- int maxw, maxcells;\r
-\r
- if(pvid->reg[12]&1) {\r
- maxw = 328; maxcells = 40;\r
- } else {\r
- maxw = 264; maxcells = 32;\r
- }\r
-\r
- // Find out if the window is on this line:\r
- win=pvid->reg[0x12];\r
- edge=(win&0x1f)<<3;\r
-\r
- if (win&0x80) { if (Scanline>=edge) hvwind=1; }\r
- else { if (Scanline< edge) hvwind=1; }\r
-\r
- if(!hvwind) { // we might have a vertical window here \r
- win=pvid->reg[0x11];\r
- edge=win&0x1f;\r
- if(win&0x80) {\r
- if(!edge) hvwind=1;\r
- else if(edge < (maxcells>>1)) hvwind=2;\r
- } else {\r
- if(!edge);\r
- else if(edge < (maxcells>>1)) hvwind=2;\r
- else hvwind=1;\r
- }\r
- }\r
-\r
- DrawLayer(1, HighCacheB, maxcells, sh);\r
- if(hvwind == 1)\r
- DrawWindow(0, maxcells>>1, 0, sh); // HighCacheAW\r
- else if(hvwind == 2) {\r
- // ahh, we have vertical window\r
- DrawLayer(0, HighCacheA, (win&0x80) ? edge<<1 : maxcells, sh);\r
- DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh); // HighCacheW\r
- } else\r
- DrawLayer(0, HighCacheA, maxcells, sh);\r
- DrawAllSprites(HighCacheS, maxw, 0, sh);\r
-\r
- if(HighCacheB[0]) DrawTilesFromCache(HighCacheB, sh);\r
- if(hvwind == 1)\r
- DrawWindow(0, maxcells>>1, 1, sh);\r
- else if(hvwind == 2) {\r
- if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh);\r
- DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 1, sh);\r
- } else\r
- if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh);\r
- DrawAllSprites(HighCacheS, maxw, 1, sh);\r
-\r
- return 0;\r
-}\r
-\r
-\r
-void PicoFrameStart()\r
-{\r
- // prepare to do this frame\r
- rendstatus &= 0x40;\r
- rendstatus |= (PicoOpt&0x80)>>5; // accurate sprites\r
- if(rendstatus)\r
- Pico.video.status &= ~0x0020;\r
- else Pico.video.status |= 0x0020; // sprite collision\r
- if((Pico.video.reg[12]&6) == 6) rendstatus |= 8; // interlace mode\r
-\r
- PrepareSprites(1);\r
-}\r
-\r
-static int Skip=0;\r
-\r
-int PicoLine(int scan)\r
-{\r
- int sh;\r
- if (Skip>0) { Skip--; return 0; } // Skip rendering lines\r
-\r
- if(!(rendstatus&0x40))\r
- DrawLineInt = DrawLineDest;\r
-\r
- Scanline=scan;\r
- sh=(Pico.video.reg[0xC]&8)>>3; // shadow/hilight?\r
-\r
- // Draw screen:\r
- BackFill(Pico.video.reg[7], sh);\r
- if (Pico.video.reg[1]&0x40)\r
- DrawDisplay(sh);\r
-\r
- FinalizeLine(sh);\r
- //if (SpriteBlocks & (1<<(scan>>3))) for (sh=0; sh < 30; sh++) DrawLineDest[sh] = 0xf;\r
-\r
- Skip=PicoScan(Scanline,DrawLineDest);\r
-\r
- return 0;\r
-}\r
-\r
-\r
-void DrawSetColorFormat(int which)\r
-{\r
- rendstatus |= 0x40;\r
- DrawLineInt = HighCol;\r
-\r
- if (which == 2) {\r
- rendstatus &= ~0x40;\r
- FinalizeLine = FinalizeLine8bit;\r
- } else if (which == 1)\r
- FinalizeLine = FinalizeLineRGB555;\r
- else\r
- FinalizeLine = FinalizeLineBGR444;\r
-}\r
+++ /dev/null
-@ assembly "optimized" version of some funtions from draw.c\r
-@ this is highly specialized, be careful if changing related C code!\r
-\r
-@ (c) Copyright 2006, notaz\r
-@ All Rights Reserved\r
-\r
-\r
-.extern Pico\r
-.extern PicoOpt\r
-.extern HighCol\r
-.extern Scanline\r
-.extern HighSprZ\r
-.extern rendstatus\r
-.extern DrawLineInt\r
-.extern DrawLineDest\r
-.extern DrawStripVSRam\r
-.extern DrawStripInterlace\r
-\r
-\r
-@ helper\r
-.macro TilePixel pat lsrr offs\r
-.if !\lsrr\r
- ands r4, \pat, r2\r
-.else\r
- ands r4, \pat, r2, lsr #\lsrr\r
-.endif\r
- orrne r4, r3, r4\r
- strneb r4, [r1,#\offs]\r
-.endm\r
-\r
-@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileNorm pat\r
- TilePixel \pat, 12, 0 @ #0x0000f000\r
- TilePixel \pat, 8, 1 @ #0x00000f00\r
- TilePixel \pat, 4, 2 @ #0x000000f0\r
- TilePixel \pat, 0, 3 @ #0x0000000f\r
- TilePixel \pat, 28, 4 @ #0xf0000000\r
- TilePixel \pat, 24, 5 @ #0x0f000000\r
- TilePixel \pat, 20, 6 @ #0x00f00000\r
- TilePixel \pat, 16, 7 @ #0x000f0000\r
-.endm\r
-\r
-@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileFlip pat\r
- TilePixel \pat, 16, 0 @ #0x000f0000\r
- TilePixel \pat, 20, 1 @ #0x00f00000\r
- TilePixel \pat, 24, 2 @ #0x0f000000\r
- TilePixel \pat, 28, 3 @ #0xf0000000\r
- TilePixel \pat, 0, 4 @ #0x0000000f\r
- TilePixel \pat, 4, 5 @ #0x000000f0\r
- TilePixel \pat, 8, 6 @ #0x00000f00\r
- TilePixel \pat, 12, 7 @ #0x0000f000\r
-.endm\r
-\r
-@ shadow/hilight mode\r
-\r
-@ this one is for hi priority layer\r
-.macro TilePixelShHP pat lsrr offs\r
- TilePixel \pat, \lsrr, \offs\r
- ldreqb r4, [r1,#\offs]\r
- tsteq r4, #0x80\r
- andeq r4, r4, #0x3f\r
- streqb r4, [r1,#\offs]\r
-.endm\r
-\r
-@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileNormShHP pat\r
- TilePixelShHP \pat, 12, 0 @ #0x0000f000\r
- TilePixelShHP \pat, 8, 1 @ #0x00000f00\r
- TilePixelShHP \pat, 4, 2 @ #0x000000f0\r
- TilePixelShHP \pat, 0, 3 @ #0x0000000f\r
- TilePixelShHP \pat, 28, 4 @ #0xf0000000\r
- TilePixelShHP \pat, 24, 5 @ #0x0f000000\r
- TilePixelShHP \pat, 20, 6 @ #0x00f00000\r
- TilePixelShHP \pat, 16, 7 @ #0x000f0000\r
-.endm\r
-\r
-@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
-.macro TileFlipShHP pat\r
- TilePixelShHP \pat, 16, 0 @ #0x000f0000\r
- TilePixelShHP \pat, 20, 1 @ #0x00f00000\r
- TilePixelShHP \pat, 24, 2 @ #0x0f000000\r
- TilePixelShHP \pat, 28, 3 @ #0xf0000000\r
- TilePixelShHP \pat, 0, 4 @ #0x0000000f\r
- TilePixelShHP \pat, 4, 5 @ #0x000000f0\r
- TilePixelShHP \pat, 8, 6 @ #0x00000f00\r
- TilePixelShHP \pat, 12, 7 @ #0x0000f000\r
-.endm\r
-\r
-\r
-@ TileSingleSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx; r12: helper pattern 0xf\r
-.macro TileSingleSh\r
- tst r0, #1 @ not aligned?\r
- mov r7, #0x00c000\r
- orr r7, r7, #0xc0\r
- ldrneb r4, [r1]\r
- ldreqh r4, [r1]\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- ldrh r4, [r1]\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrneb r4, [r1]\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
-.endm\r
-\r
-@ TileSingleHi (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf\r
-.macro TileSingleHi\r
- tst r1, #1 @ not aligned?\r
- mov r7, #0x008000\r
- orr r7, r7, #0x80\r
- ldrneb r4, [r1]\r
- ldreqh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- ldrh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrh r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strh r4, [r1], #2\r
- ldrneb r4, [r1]\r
- bic r4, r4, r7, lsr #1\r
- orr r4, r4, r7\r
- strneb r4, [r1], #1\r
-.endm\r
-\r
-.macro TileDoShGenPixel shift ofs\r
-.if \shift\r
- ands r4, r12, r2, lsr #\shift\r
-.else\r
- ands r4, r12, r2\r
-.endif\r
- beq 3f\r
- cmp r4, #0xe\r
- beq 2f\r
- bgt 1f\r
- orr r4, r3, r4\r
- strb r4, [r1,#\ofs]\r
- b 3f\r
-1:\r
- ldrb r4, [r1,#\ofs]\r
- orr r4, r4, #0xc0\r
- strb r4, [r1,#\ofs]\r
- b 3f\r
-2:\r
- ldrb r4, [r1,#\ofs]\r
- bic r4, r4, #0xc0\r
- orr r4, r4, #0x80\r
- strb r4, [r1,#\ofs]\r
-3:\r
-.endm\r
-\r
-@ TileFlipSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf\r
-.macro TileFlipSh\r
- TileDoShGenPixel 16, 0 @ #0x000f0000\r
- TileDoShGenPixel 20, 1 @ #0x00f00000\r
- TileDoShGenPixel 24, 2 @ #0x0f000000\r
- TileDoShGenPixel 28, 3 @ #0xf0000000\r
- TileDoShGenPixel 0, 4 @ #0x0000000f\r
- TileDoShGenPixel 4, 5 @ #0x000000f0\r
- TileDoShGenPixel 8, 6 @ #0x00000f00\r
- TileDoShGenPixel 12, 7 @ #0x0000f000\r
-.endm\r
-\r
-@ TileNormSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf\r
-.macro TileNormSh\r
- TileDoShGenPixel 12, 0 @ #0x0000f000\r
- TileDoShGenPixel 8, 1 @ #0x00000f00\r
- TileDoShGenPixel 4, 2 @ #0x000000f0\r
- TileDoShGenPixel 0, 3 @ #0x0000000f\r
- TileDoShGenPixel 28, 4 @ #0xf0000000\r
- TileDoShGenPixel 24, 5 @ #0x0f000000\r
- TileDoShGenPixel 20, 6 @ #0x00f00000\r
- TileDoShGenPixel 16, 7 @ #0x000f0000\r
-.endm\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-@ struct TileStrip\r
-@ {\r
-@ int nametab; // 0x00\r
-@ int line; // 0x04\r
-@ int hscroll; // 0x08\r
-@ int xmask; // 0x0C\r
-@ int *hc; // 0x10 (pointer to cache buffer)\r
-@ int cells; // 0x14\r
-@ };\r
-\r
-@ int DrawLayer(int plane, int *hcache, int maxcells, int sh)\r
-\r
-.global DrawLayer @ int plane, int *hcache, int maxcells, int sh\r
-\r
-DrawLayer:\r
- stmfd sp!, {r4-r11,lr}\r
-\r
- ldr r11, =(Pico+0x22228) @ Pico.video\r
-\r
- mov r6, r1 @ hcache\r
- orr r9, r2, r3, lsl #31 @ r9=maxcells|(sh<<31)\r
-\r
- ldrb r7, [r11, #16] @ ??hh??ww\r
-\r
- mov r1, r7, lsl #4\r
- orr r1, r1, #0x00ff\r
-\r
- and r10, r7, #3\r
- cmp r10, #1\r
- biclt r1, r1, #0xfc00\r
- biceq r1, r1, #0xfe00\r
- bicgt r1, r1, #0xff00 @ r1=ymask=(height<<8)|0xff; ...; // Y Mask in pixels\r
-\r
- add r10, r10, #5\r
- cmp r10, #7\r
- subge r10, r10, #1 @ r10=shift[width] (5,6,6,7)\r
-\r
- @ calculate xmask:\r
- mov r8, #1\r
- mov r5, r8, lsl r10\r
- sub r5, r5, #1 @ r5=xmask\r
-\r
- @ Find name table:\r
- tst r0, r0\r
- ldreqb r12, [r11, #2]\r
- moveq r12, r12, lsl #10\r
- ldrneb r12, [r11, #4]\r
- movne r12, r12, lsl #13\r
- and r12, r12, #(7<<13) @ r12=(ts->nametab<<1) (halfword compliant)\r
-\r
- ldr r2, =Scanline\r
- ldr r2, [r2]\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
-\r
- ldrh r8, [r11, #12]\r
- mov r4, r8, lsr #8 @ pvid->reg[13]\r
- mov r4, r4, lsl #10 @ htab=pvid->reg[13]<<9; (halfwords)\r
- ldrb r7, [r11, #11]\r
- tst r7, #2\r
- addne r4, r4, r2, lsl #2 @ htab+=Scanline<<1; // Offset by line\r
- tst r7, #1\r
- biceq r4, r4, #0x1f @ htab&=~0xf; // Offset by tile\r
- add r4, r4, r0, lsl #1 @ htab+=plane\r
- bic r4, r4, #0x00ff0000 @ just in case\r
- ldrh r3, [lr, r4] @ r3=hscroll\r
-\r
- tst r7, #4\r
- bne .DrawStrip_vsscroll\r
-\r
- @ Get vertical scroll value:\r
- add r7, lr, #0x012000\r
- add r7, r7, #0x000180 @ r7=Pico.vsram (Pico+0x22180)\r
- ldr r7, [r7]\r
-\r
- tst r8, #2\r
- tstne r8, #4\r
- bne .DrawStrip_interlace\r
-\r
- tst r0, r0\r
- movne r7, r7, lsr #16\r
-\r
- @ Find the line in the name table\r
- add r2, r2, r7\r
- and r2, r2, r1\r
- mov r4, r2, lsr #3\r
- add r10, r10, #1 @ shift[width]++\r
- add r12, r12, r4, lsl r10 @ nametab+=(ts.line>>3)<<shift[width];\r
-\r
- @ ldmia r0, {r1,r2,r3,r5,r6,r9} @ r2=line, r3=ts->hscroll, r5=ts->xmask, r6=ts->hc, r9=ts->cells\r
-@ mov r12,r1, lsl #1 @ r12=(ts->nametab<<1) (halfword compliant)\r
-\r
- and r10,r2, #7\r
- mov r10,r10, lsl #1 @ r10=ty=(ts->line&7)<<1;\r
- orr r10,r10, r9, lsl #24\r
-\r
- rsb r8, r3, #0\r
- mov r8, r8, lsr #3 @ r8=tilex=(-ts->hscroll)>>3\r
-\r
- sub r1, r3, #1\r
- and r1, r1, #7\r
- add r4, r1, #1 @ r4=dx=((ts->hscroll-1)&7)+1\r
-\r
- tst r9, #1<<31\r
- mov r3, #0\r
- orrne r10,r10, #1<<23 @ r10=(cells<<24|sh<<23|hi_not_empty<<22|ty)\r
- movne r3, #0x40 @ default to shadowed pal on sh mode\r
-\r
- mvn r9, #0 @ r9=prevcode=-1\r
-\r
- @ cache some stuff to avoid mem access\r
-@ ldr r11,=HighCol\r
- ldr r11,=DrawLineInt\r
- ldr r11,[r11]\r
- add r1, r11, r4 @ r1=pdest\r
- mov r0, #0xf\r
-\r
- cmp r4, #8\r
- subeq r10,r10, #0x01000000 @ we will loop cells+1 times, so loop less when there is no scroll\r
- beq .dsloop_enter\r
-\r
- @ do first iteration with clipping\r
- and r7, r5, r8\r
- add r7, lr, r7, lsl #1 @ Pico.vram+((tilex&ts->xmask) as halfwords)\r
- ldrh r7, [r7, r12] @ r7=code (int, but from unsigned, no sign extend)\r
-\r
- tst r7, #0x8000\r
- bne .DrawStrip_hiprio\r
-\r
- mov r9, r7 @ remember code\r
-\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
- add r2, r2, r10, lsl #17\r
- mov r2, r2, lsr #17\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
- bic r7, r3, #0x3f\r
- and r3, r9, #0x6000\r
- add r3, r7, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- tst r2, r2\r
- beq .dsloop @ tileline blank\r
-\r
- tst r9, #0x0800\r
- addne r4, r4, #8\r
-\r
- ldr pc, [pc, r4, lsl #2]\r
- nop\r
- .word .ds_tn1_px1 @ should not happen\r
- .word .ds_tn1_px1\r
- .word .ds_tn1_px2\r
- .word .ds_tn1_px3\r
- .word .ds_tn1_px4\r
- .word .ds_tn1_px5\r
- .word .ds_tn1_px6\r
- .word .ds_tn1_px7\r
- .word .dsloop @ should not happen\r
-\r
- .word .ds_tf1_px1 @ ...\r
- .word .ds_tf1_px1\r
- .word .ds_tf1_px2\r
- .word .ds_tf1_px3\r
- .word .ds_tf1_px4\r
- .word .ds_tf1_px5\r
- .word .ds_tf1_px6\r
- .word .ds_tf1_px7\r
- .word .dsloop @ ...\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern\r
-.ds_tn1_px1:\r
- TilePixel r0, 8, 1 @ #0x00000f00\r
-.ds_tn1_px2:\r
- TilePixel r0, 4, 2 @ #0x000000f0\r
-.ds_tn1_px3:\r
- TilePixel r0, 0, 3 @ #0x0000000f\r
-.ds_tn1_px4:\r
- TilePixel r0, 28, 4 @ #0xf0000000\r
-.ds_tn1_px5:\r
- TilePixel r0, 24, 5 @ #0x0f000000\r
-.ds_tn1_px6:\r
- TilePixel r0, 20, 6 @ #0x00f00000\r
-.ds_tn1_px7:\r
- TilePixel r0, 16, 7 @ #0x000f0000\r
- b .dsloop\r
-\r
-.ds_tf1_px1:\r
- TilePixel r0, 20, 1 @ #0x00f00000\r
-.ds_tf1_px2:\r
- TilePixel r0, 24, 2 @ #0x0f000000\r
-.ds_tf1_px3:\r
- TilePixel r0, 28, 3 @ #0xf0000000\r
-.ds_tf1_px4:\r
- TilePixel r0, 0, 4 @ #0x0000000f\r
-.ds_tf1_px5:\r
- TilePixel r0, 4, 5 @ #0x000000f0\r
-.ds_tf1_px6:\r
- TilePixel r0, 8, 6 @ #0x00000f00\r
-.ds_tf1_px7:\r
- TilePixel r0, 12, 7 @ #0x0000f000\r
-\r
-\r
- @ r4 & r7 are scratch in this loop\r
-.dsloop: @ 40-41 times\r
- add r1, r1, #8\r
-.dsloop_nor1:\r
- subs r10,r10, #0x01000000\r
- add r8, r8, #1\r
- bmi .dsloop_exit\r
-\r
-.dsloop_enter:\r
- and r7, r5, r8\r
- add r7, lr, r7, lsl #1 @ Pico.vram+((tilex&ts->xmask) as halfwords)\r
- ldrh r7, [r7, r12] @ r7=code (int, but from unsigned, no sign extend)\r
-\r
- tst r7, #0x8000\r
- bne .DrawStrip_hiprio\r
-\r
- cmp r7, r9\r
- beq .DrawStrip_samecode @ we know stuff about this tile already\r
-\r
- mov r9, r7 @ remember code\r
-\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
-@ bic r7, r10,#0xff000000\r
-@ add r2, r7, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty\r
- add r2, r2, r10, lsl #17\r
- mov r2, r2, lsr #17\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
-\r
- bic r7, r3, #0x3f\r
- and r3, r9, #0x6000\r
- add r3, r7, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
-.DrawStrip_samecode:\r
- tst r2, r2\r
- beq .dsloop @ tileline blank\r
-\r
- cmp r2, r2, ror #4\r
- beq .DrawStrip_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x0800\r
- beq .DrawStrip_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern\r
- TileFlip r0\r
- b .dsloop\r
-\r
-.DrawStrip_TileNorm:\r
- TileNorm r0\r
- b .dsloop\r
-\r
-.DrawStrip_SingleColor:\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- tst r1, #1 @ not aligned?\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1 @ have a remaining unaligned pixel?\r
- b .dsloop_nor1 @ we incremeted r1 ourselves\r
-\r
-.DrawStrip_hiprio:\r
- tst r10, #0x00c00000\r
- beq .DrawStrip_hiprio_maybempt\r
- sub r0, r1, r11\r
- orr r7, r7, r0, lsl #16\r
- orr r7, r7, r10, lsl #25 @ (ty<<25)\r
- tst r7, #0x1000\r
- eorne r7, r7, #7<<26 @ if(code&0x1000) cval^=7<<26;\r
- str r7, [r6], #4 @ cache hi priority tile\r
- mov r0, #0xf\r
- b .dsloop\r
-\r
-.DrawStrip_hiprio_maybempt:\r
- cmp r7, r9\r
- beq .dsloop @ must've been empty, otherwise we wouldn't get here\r
- mov r9, r7 @ remember code\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
- add r2, r2, r10, lsl #17\r
- mov r2, r2, lsr #17\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- tst r2, r2\r
- orrne r10, r10, #1<<22\r
- bne .DrawStrip_hiprio\r
- b .dsloop\r
-\r
-.dsloop_exit:\r
- mov r0, #0\r
- str r0, [r6] @ terminate the cache list\r
-\r
- ldmfd sp!, {r4-r11,lr}\r
- bx lr\r
-\r
-\r
-.DrawStrip_vsscroll:\r
- @ shit, we have 2-cell column based vscroll\r
- @ let the c code handle this (for now)\r
-\r
- @ int nametab; // 0x00\r
- @ int line; // 0x04\r
- @ int hscroll; // 0x08\r
- @ int xmask; // 0x0C\r
- @ int *hc; // 0x10 (pointer to cache buffer)\r
- @ int cells; // 0x14\r
-\r
- sub sp, sp, #6*4\r
- orr r2, r1, r10, lsl #24 @ ts.line=ymask|(shift[width]<<24); // save some stuff instead of line\r
- mov r1, r0 @ plane\r
- mov r0, r12, lsr #1 @ halfwords\r
- and r9, r9, #0xff\r
- stmia sp, {r0,r2,r3,r5,r6,r9}\r
-\r
- mov r0, sp\r
- bl DrawStripVSRam @ struct TileStrip *ts, int plane\r
-\r
- add sp, sp, #6*4\r
- ldmfd sp!, {r4-r11,lr}\r
- bx lr\r
-\r
-@ interlace mode 2? Sonic 2?\r
-.DrawStrip_interlace:\r
- tst r0, r0\r
- moveq r7, r7, lsl #21\r
- movne r7, r7, lsl #5\r
-\r
- @ Find the line in the name table\r
- add r2, r7, r2, lsl #22 @ r2=(vscroll+(Scanline<<1))<<21 (11 bits);\r
- orr r1, r1, #0x80000000\r
- and r2, r2, r1, ror #10 @ &((ymask<<1)|1)<<21;\r
- mov r2, r2, lsr #21\r
- mov r4, r2, lsr #4\r
- mov r12, r12, lsr #1 @ halfwords\r
- add r0, r12, r4, lsl r10 @ nametab+=(ts.line>>4)<<shift[width];\r
- and r9, r9, #0xff\r
-\r
- sub sp, sp, #6*4\r
- stmia sp, {r0,r2,r3,r5,r6,r9}\r
-\r
- mov r0, sp\r
- bl DrawStripInterlace @ struct TileStrip *ts\r
-\r
- add sp, sp, #6*4\r
- ldmfd sp!, {r4-r11,lr}\r
- bx lr\r
-\r
-.pool\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-.global BackFill @ int reg7, int sh\r
-\r
-BackFill:\r
- stmfd sp!, {r4-r9,lr}\r
-\r
-@ ldr lr, =(HighCol+8)\r
- ldr lr,=DrawLineInt\r
- ldr lr,[lr]\r
- add lr, lr, #8\r
-\r
- mov r0, r0, lsl #26\r
- mov r0, r0, lsr #26\r
- orr r0, r0, r1, lsl #6\r
- orr r0, r0, r0, lsl #8\r
- orr r0, r0, r0, lsl #16\r
-\r
- mov r1, r0\r
- mov r2, r0\r
- mov r3, r0\r
- mov r4, r0\r
- mov r5, r0\r
- mov r6, r0\r
- mov r7, r0\r
-\r
- @ go go go!\r
- stmia lr!, {r0-r7} @ 10*8*4\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
- stmia lr!, {r0-r7}\r
-\r
- ldmfd sp!, {r4-r9,r12}\r
- bx r12\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-.global DrawTilesFromCache @ int *hc, int sh\r
-\r
-DrawTilesFromCache:\r
- stmfd sp!, {r4-r8,r11,lr}\r
-\r
- mvn r5, #0 @ r5=prevcode=-1\r
- mov r8, r1\r
-\r
- @ cache some stuff to avoid mem access\r
-@ ldr r11,=HighCol\r
- ldr r11,=DrawLineInt\r
- ldr r11,[r11]\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
- mov r12,#0xf\r
-\r
- @ scratch: r4, r7\r
-.dtfc_loop:\r
- ldr r6, [r0], #4 @ read code\r
- movs r1, r6, lsr #16 @ r1=dx;\r
- ldmeqfd sp!, {r4-r8,r11,pc} @ dx is never zero, this must be a terminator, return\r
- bic r1, r1, #0xfe00\r
- add r1, r11, r1 @ r1=pdest\r
-\r
-@ tst r8, r8\r
-@ bne .dtfc_shadow @ this is a rare case, so we jump when it happens, not when it doesn't\r
-@.dtfc_shadow_done:\r
-\r
- mov r7, r6, lsl #16\r
- cmp r5, r7, lsr #16\r
- beq .dtfc_samecode @ if (code==prevcode)\r
-\r
- mov r5, r7, lsr #16\r
-\r
- mov r2, r5, lsl #21\r
- mov r2, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4;\r
- add r2, r2, r6, lsr #25 @ addr+=ty\r
-\r
- and r3, r5, #0x6000\r
- mov r3, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
-.dtfc_samecode:\r
- tst r8, r8\r
- bne .dtfc_shadow\r
-\r
- tst r2, r2\r
- beq .dtfc_loop\r
-\r
- cmp r2, r2, ror #4\r
- beq .dtfc_SingleColor @ tileline singlecolor \r
-\r
- tst r5, #0x0800\r
- beq .dtfc_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlip r12\r
- b .dtfc_loop\r
-\r
-.dtfc_TileNorm:\r
- TileNorm r12\r
- b .dtfc_loop\r
-\r
-.dtfc_SingleColor:\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- tst r1, #1 @ not aligned?\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1 @ have a remaining unaligned pixel?\r
- b .dtfc_loop\r
-\r
-.dtfc_shadow:\r
- tst r2, r2\r
- beq .dtfc_shadow_blank\r
-\r
- cmp r2, r2, ror #4\r
- beq .dtfc_SingleColor @ tileline singlecolor \r
-\r
- tst r5, #0x0800\r
- beq .dtfc_TileNormShHP\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlipShHP r12\r
- b .dtfc_loop\r
-\r
-.dtfc_TileNormShHP:\r
- TileNormShHP r12\r
- b .dtfc_loop\r
-\r
-.dtfc_shadow_blank:\r
- ldrb r4, [r1]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1]\r
- ldrb r4, [r1,#1]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#1]\r
- ldrb r4, [r1,#2]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#2]\r
- ldrb r4, [r1,#3]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#3]\r
- ldrb r4, [r1,#4]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#4]\r
- ldrb r4, [r1,#5]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#5]\r
- ldrb r4, [r1,#6]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#6]\r
- ldrb r4, [r1,#7]\r
- tst r4, #0x80\r
- andeq r4, r4,#0x3f\r
- streqb r4, [r1,#7]\r
- b .dtfc_loop\r
-\r
-.pool\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-.global DrawSpritesFromCache @ int *hc, int sh\r
-\r
-DrawSpritesFromCache:\r
- stmfd sp!, {r4-r11,lr}\r
-\r
- @ cache some stuff to avoid mem access\r
-@ ldr r11,=HighCol\r
- ldr r11,=DrawLineInt\r
- ldr r11,[r11]\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
- mov r6, r1, lsl #31\r
- orr r6, r6, #1<<30\r
- mov r12,#0xf\r
-\r
- mov r10, r0\r
-\r
-.dsfc_loop:\r
- ldr r9, [r10], #4 @ read code\r
- tst r9, r9\r
- ldmeqfd sp!, {r4-r11,pc}\r
-\r
- mov r4, r9, lsl #28\r
- bic r6, r6, #7\r
- orr r6, r6, r4, lsr #30\r
- add r6, r6, #1 @ r6=s1cc???? ... ?????www (s=shadow/hilight, cc=pal, w=width)\r
-\r
- and r5, r9, #3\r
- add r5, r5, #1 @ r5=delta\r
- tst r9, #0x10000\r
- rsbne r5, r5, #0 @ Flip X\r
- mov r5, r5, lsl #4\r
-\r
- mov r2, r9, lsr #17\r
- mov r8, r2, lsl #1 @ tile=((unsigned int)code>>17)<<1;\r
-\r
- and r3, r9, #0x30 @ r3=pal=(code&0x30);\r
-\r
- bic r6, r6, #3<<28\r
- orr r6, r6, r3, lsl #24\r
-\r
- mov r0, r9, lsl #16\r
- mov r0, r0, asr #22 @ sx=(code<<16)>>22\r
- adds r0, r0, #0 @ set ZV\r
- b .dsfc_inloop_enter\r
-\r
-@ scratch: r4, r7\r
-.dsfc_inloop:\r
- sub r6, r6, #1\r
- tst r6, #7\r
- beq .dsfc_loop\r
- adds r0, r0, #8\r
- add r8, r8, r5\r
-\r
-.dsfc_inloop_enter:\r
- ble .dsfc_inloop\r
- cmp r0, #328\r
- bge .dsfc_loop\r
-\r
- mov r8, r8, lsl #17\r
- mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address\r
-\r
- ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+tile); // Get 8 pixels\r
- tst r2, r2\r
- beq .dsfc_inloop\r
-\r
- add r1, r11, r0 @ r1=pdest\r
-\r
- cmp r12, r6, lsr #28\r
- beq .dsfc_shadow\r
-\r
- cmp r2, r2, ror #4\r
- beq .dsfc_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x10000\r
- beq .dsfc_TileNorm\r
-\r
- @ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlip r12\r
- b .dsfc_inloop\r
-\r
-.dsfc_TileNorm:\r
- TileNorm r12\r
- b .dsfc_inloop\r
-\r
-.dsfc_SingleColor:\r
- tst r0, #1 @ not aligned?\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1\r
- b .dsfc_inloop\r
-\r
-.dsfc_shadow:\r
- cmp r2, r2, ror #4\r
- beq .dsfc_singlec_sh\r
-\r
- tst r9, #0x10000\r
- beq .dsfc_TileNorm_sh\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlipSh\r
- b .dsfc_inloop\r
-\r
-.dsfc_TileNorm_sh:\r
- TileNormSh\r
- b .dsfc_inloop\r
-\r
-.dsfc_singlec_sh:\r
- cmp r2, #0xe0000000\r
- bcc .dsfc_SingleColor @ normal singlecolor tileline (carry inverted in ARM)\r
- tst r2, #0x10000000\r
- bne .dsfc_sh_sh\r
- TileSingleHi\r
- b .dsfc_inloop\r
-\r
-.dsfc_sh_sh:\r
- TileSingleSh\r
- b .dsfc_inloop\r
-\r
-.pool\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-@ + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size\r
-@ + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-\r
-.global DrawSprite @ unsigned int *sprite, int **hc, int sh\r
-\r
-DrawSprite:\r
- stmfd sp!, {r4-r9,r11,lr}\r
-\r
- ldr r3, [r0] @ sprite[0]\r
- mov r6, r3, lsr #28\r
- sub r6, r6, #1 @ r6=width-1 (inc later)\r
- mov r5, r3, lsr #24\r
- and r5, r5, #7 @ r5=height\r
-\r
- mov r4, r3, lsl #16 @ r4=sy<<16 (tmp)\r
-\r
- ldr r7, =Scanline\r
- ldr r7, [r7]\r
- sub r7, r7, r4, asr #16 @ r7=row=Scanline-sy\r
-\r
- tst r2, r2\r
- ldr r9, [r0, #4]\r
- mov r2, r9, asr #16 @ r2=sx\r
- bic r9, r9, #0xfe000000\r
- orrne r9, r9, #1<<31 @ r9=code|(sh<<31)\r
-\r
- tst r9, #0x1000\r
- movne r4, r5, lsl #3\r
- subne r4, r4, #1\r
- subne r7, r4, r7 @ if (code&0x1000) row=(height<<3)-1-row; // Flip Y\r
-\r
- mov r8, r9, lsl #21\r
- mov r8, r8, lsr #21\r
- add r8, r8, r7, lsr #3 @ tile+=row>>3; // Tile number increases going down\r
- \r
- tst r9, #0x0800\r
- mlane r8, r5, r6, r8 @ if (code&0x0800) { tile+=delta*(width-1);\r
- rsbne r5, r5, #0 @ delta=-delta; } // r5=delta now\r
-\r
- mov r8, r8, lsl #4\r
- and r7, r7, #7\r
- add r8, r8, r7, lsl #1 @ tile+=(row&7)<<1; // Tile address\r
-\r
- tst r9, #0x8000\r
- bne .dspr_cache @ if(code&0x8000) // high priority - cache it\r
-\r
- @ cache some stuff to avoid mem access\r
-@ ldr r11,=HighCol\r
- ldr r11,=DrawLineInt\r
- ldr r11,[r11]\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
- mov r12,#0xf\r
-\r
- mov r5, r5, lsl #4 @ delta<<=4; // Delta of address\r
- and r4, r9, #0x6000\r
- orr r9, r9, r4, lsl #16\r
- orr r9, r9, #0x10000000 @ r9=scc1 ???? ... <code> (s=shadow/hilight, cc=pal)\r
-\r
- tst r9, #1<<31\r
- mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30);\r
- orrne r3, r3, #0x40 @ shadow by default\r
-\r
- add r6, r6, #1 @ inc now\r
- adds r0, r2, #0 @ mov sx to r0 and set ZV flags\r
- b .dspr_loop_enter\r
-\r
-.dspr_loop:\r
- subs r6, r6, #1 @ width--\r
- ldmeqfd sp!, {r4-r9,r11,pc}@ return\r
- adds r0, r0, #8 @ sx+=8\r
- add r8, r8, r5 @ tile+=delta\r
-\r
-.dspr_loop_enter:\r
- ble .dspr_loop @ sx <= 0\r
- cmp r0, #328\r
- ldmgefd sp!, {r4-r9,r11,pc}@ return\r
-\r
- mov r8, r8, lsl #17\r
- mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address\r
-\r
- ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
- tst r2, r2\r
- beq .dspr_loop\r
-\r
- add r1, r11, r0 @ r1=pdest\r
-\r
- cmp r12, r9, lsr #28\r
- beq .dspr_shadow\r
-\r
- cmp r2, r2, ror #4\r
- beq .dspr_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x0800\r
- beq .dspr_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlip r12\r
- b .dspr_loop\r
-\r
-@ scratch: r4, r7\r
-.dspr_TileNorm:\r
- TileNorm r12\r
- b .dspr_loop\r
-\r
-.dspr_SingleColor:\r
- and r4, r2, #0xf\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- tst r0, #1 @ not aligned?\r
- strneb r4, [r1], #1\r
- streqh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strh r4, [r1], #2\r
- strneb r4, [r1], #1\r
- b .dspr_loop\r
-\r
-.dspr_shadow:\r
- cmp r2, r2, ror #4\r
- beq .dspr_singlec_sh\r
-\r
- tst r9, #0x0800\r
- beq .dspr_TileNorm_sh\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
- TileFlipSh\r
- b .dspr_loop\r
-\r
-.dspr_TileNorm_sh:\r
- TileNormSh\r
- b .dspr_loop\r
-\r
-.dspr_singlec_sh:\r
- cmp r2, #0xe0000000\r
- bcc .dspr_SingleColor @ normal tileline\r
- tst r2, #0x10000000\r
- bne .dspr_sh_sh\r
- TileSingleHi\r
- b .dspr_loop\r
-\r
-.dspr_sh_sh:\r
- TileSingleSh\r
- b .dspr_loop\r
-\r
-\r
-.dspr_cache:\r
- @ *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf);\r
- mov r4, r8, lsl #16 @ tile\r
- tst r9, #0x0800\r
- orrne r4, r4, #0x10000 @ code&0x0800\r
- mov r2, r2, lsl #22\r
- orr r4, r4, r2, lsr #16 @ (sx<<6)&0x0000ffc0\r
- and r2, r9, #0x6000\r
- orr r4, r4, r2, lsr #9 @ (code>>9)&0x30\r
- mov r2, r3, lsl #12\r
- orr r4, r4, r2, lsr #28 @ (sprite[0]>>24)&0xf\r
-\r
- ldr r2, [r1]\r
- str r4, [r2], #4\r
- str r2, [r1]\r
-\r
- ldmfd sp!, {r4-r9,r11,lr}\r
- bx lr\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-.global DrawWindow @ int tstart, int tend, int prio, int sh // int *hcache\r
-\r
-DrawWindow:\r
- stmfd sp!, {r4-r11,lr}\r
-\r
- ldr r11, =(Pico+0x22228) @ Pico.video\r
- ldrb r12, [r11, #3] @ pvid->reg[3]\r
- mov r12, r12, lsl #10\r
-\r
- ldr r10, =Scanline\r
- ldr r10, [r10]\r
- mov r5, r10, lsr #3\r
- and r10, r10, #7\r
- mov r10, r10, lsl #1 @ r10=ty\r
-\r
- ldr r4, [r11, #12]\r
- tst r4, #1 @ 40 cell mode?\r
- andne r12, r12, #0xf000 @ 0x3c<<10\r
- andeq r12, r12, #0xf800\r
- addne r12, r12, r5, lsl #7\r
- addeq r12, r12, r5, lsl #6 @ nametab\r
- add r12, r12, r0, lsl #2 @ +starttile\r
-\r
- ldr lr, =(Pico+0x10000) @ lr=Pico.vram\r
-\r
- @ fetch the first code now\r
- ldrh r7, [lr, r12]\r
-\r
- ldr r6, =rendstatus\r
- ldrb r6, [r6]\r
- ands r6, r6, #2 @ we care about bit 1 only\r
- orr r6, r6, r2\r
- bne .dw_no_sameprio\r
-\r
- cmp r2, r7, lsr #15\r
- ldmnefd sp!, {r4-r11,pc} @ assume that whole window uses same priority\r
-\r
-.dw_no_sameprio:\r
- orr r6, r6, r3, lsl #8 @ shadow mode\r
-\r
- sub r8, r1, r0\r
- mov r8, r8, lsl #1 @ cells\r
-\r
- mvn r9, #0 @ r9=prevcode=-1\r
-\r
- @ cache some stuff to avoid mem access\r
-@ ldr r11,=(HighCol+8)\r
- ldr r11,=DrawLineInt\r
- ldr r11,[r11]\r
- add r11,r11, #8\r
- add r1, r11, r0, lsl #4 @ r1=pdest\r
- mov r0, #0xf\r
- b .dwloop_enter\r
-\r
- @ r4,r5 & r7 are scratch in this loop\r
-.dwloop:\r
- add r1, r1, #8\r
-.dwloop_nor1:\r
- subs r8, r8, #1\r
- add r12, r12, #2 @ halfwords\r
- beq .dwloop_end @ done\r
-\r
- ldrh r7, [lr, r12] @ r7=code (int, but from unsigned, no sign extend)\r
-\r
- eor r5, r6, r7, lsr #15\r
- tst r5, #1\r
- orrne r6, r6, #2 @ wrong pri\r
- bne .dwloop\r
-\r
- cmp r7, r9\r
- beq .dw_samecode @ we know stuff about this tile already\r
-\r
-.dwloop_enter:\r
- mov r9, r7 @ remember code\r
-\r
- movs r2, r9, lsl #20 @ if (code&0x1000)\r
- mov r2, r2, lsl #1\r
- add r2, r10, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty\r
- eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe;\r
-\r
- and r3, r9, #0x6000\r
- mov r3, r3, lsr #9 @ r3=pal=((code&0x6000)>>9);\r
-\r
- ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
-\r
-.dw_samecode:\r
- tst r6, #0x100\r
- bne .dw_shadow\r
-.dw_shadow_done:\r
- tst r2, r2\r
- beq .dwloop @ tileline blank\r
-\r
- cmp r2, r2, ror #4\r
- beq .dw_SingleColor @ tileline singlecolor \r
-\r
- tst r9, #0x0800\r
- beq .dw_TileNorm\r
-\r
- @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern\r
- TileFlip r0\r
- b .dwloop\r
-\r
-.dw_TileNorm:\r
- TileNorm r0\r
- b .dwloop\r
-\r
-.dw_SingleColor:\r
- and r4, r0, r2 @ #0x0000000f\r
- orr r4, r3, r4\r
- orr r4, r4, r4, lsl #8\r
- orr r4, r4, r4, lsl #16\r
- mov r5, r4\r
- stmia r1!, {r4,r5}\r
- b .dwloop_nor1 @ we incremeted r1 ourselves\r
-\r
-.dw_shadow:\r
- tst r6, #1 @ hi pri?\r
- orreq r3, r3, #0x40\r
- beq .dw_shadow_done\r
- ldr r4, [r1]\r
- tst r4, #0x00000080\r
- biceq r4, r4, #0x000000c0\r
- tst r4, #0x00008000\r
- biceq r4, r4, #0x0000c000\r
- tst r4, #0x00800000\r
- biceq r4, r4, #0x00c00000\r
- tst r4, #0x80000000\r
- biceq r4, r4, #0xc0000000\r
- str r4, [r1]\r
- ldr r4, [r1,#4]\r
- tst r4, #0x00000080\r
- biceq r4, r4, #0x000000c0\r
- tst r4, #0x00008000\r
- biceq r4, r4, #0x0000c000\r
- tst r4, #0x00800000\r
- biceq r4, r4, #0x00c00000\r
- tst r4, #0x80000000\r
- biceq r4, r4, #0xc0000000\r
- str r4, [r1,#4]\r
- b .dw_shadow_done\r
-\r
-.dwloop_end:\r
- ldr r0, =rendstatus\r
- ldr r1, [r0]\r
- and r6, r6, #2\r
- orr r1, r1, r6\r
- str r1, [r0]\r
-\r
- ldmfd sp!, {r4-r11,r12}\r
- bx r12\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-@ hilights 2 pixels in RGB444/BGR444 format\r
-.macro TileDoShHi2Pixels444 reg\r
- mov \reg, \reg, ror #12\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #24\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #28\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #12\r
-.endm\r
-\r
-\r
-.global FinalizeLineBGR444 @ int sh\r
-\r
-FinalizeLineBGR444:\r
- stmfd sp!, {r4-r6,lr}\r
- mov r6, r0\r
- ldr r0, =DrawLineDest\r
- ldr r0, [r0]\r
- ldr lr, =(Pico+0x22228) @ Pico.video\r
- sub r3, lr, #0x128 @ r3=Pico.cram\r
-\r
- ldrb r12, [lr, #12]\r
- tst r12, #1\r
- movne r2, #320/4 @ len\r
- moveq r2, #256/4\r
- addeq r0, r0, #32*2\r
- ldreq r4, =PicoOpt\r
- ldreq r4, [r4]\r
- tsteq r4, #0x100\r
- addeq r0, r0, #32*2\r
-\r
- tst r6, r6\r
- beq .fl_noshBGR444\r
-\r
- ldr r4, =HighPal\r
-\r
- ldrb r12, [lr, #-0x1a] @ 0x2220e ~ dirtyPal\r
- tst r12, r12\r
- moveq r3, r4\r
- beq .fl_noshBGR444\r
- mov r12, #0\r
- strb r12, [lr, #-0x1a]\r
-\r
- mov lr, #0x40/8\r
- @ copy pal:\r
-.fl_loopcpBGR444:\r
- subs lr, lr, #1\r
- ldmia r3!, {r1,r5,r6,r12}\r
- stmia r4!, {r1,r5,r6,r12}\r
- bne .fl_loopcpBGR444\r
-\r
- @ shadowed pixels:\r
- mov r12, #0x0077\r
- orr r12,r12,#0x0700\r
- orr r12,r12,r12,lsl #16\r
- sub r3, r3, #0x40*2\r
- add r5, r4, #0x80*2\r
- mov lr, #0x40/4\r
-.fl_loopcpBGR444_sh:\r
- subs lr, lr, #1\r
- ldmia r3!, {r1,r6}\r
- and r1, r12, r1, lsr #1\r
- and r6, r12, r6, lsr #1\r
- stmia r4!, {r1,r6}\r
- stmia r5!, {r1,r6}\r
- bne .fl_loopcpBGR444_sh\r
-\r
- @ hilighted pixels:\r
- sub r3, r3, #0x40*2\r
- mov lr, #0x40/2\r
-.fl_loopcpBGR444_hi:\r
- ldr r1, [r3], #4\r
- TileDoShHi2Pixels444 r1\r
- str r1, [r4], #4\r
- subs lr, lr, #1\r
- bne .fl_loopcpBGR444_hi\r
-\r
- sub r3, r4, #0x40*3*2\r
-\r
-\r
-.fl_noshBGR444:\r
-@ ldr r1, =(HighCol+8)\r
- ldr r1, =DrawLineInt\r
- ldr r1, [r1]\r
- add r1, r1, #8\r
- mov lr, #0xff\r
- mov lr, lr, lsl #1\r
-\r
-.fl_loopBGR444:\r
- subs r2, r2, #1\r
-\r
- ldr r12, [r1], #4\r
-\r
- and r4, lr, r12, lsl #1\r
- ldrh r4, [r3, r4]\r
- and r5, lr, r12, lsr #7\r
- ldrh r5, [r3, r5]\r
- orr r4, r4, r5, lsl #16\r
-\r
- and r5, lr, r12, lsr #15\r
- ldrh r5, [r3, r5]\r
- and r6, lr, r12, lsr #23\r
- ldrh r6, [r3, r6]\r
- orr r5, r5, r6, lsl #16\r
-\r
- stmia r0!, {r4,r5}\r
- bne .fl_loopBGR444\r
-\r
-\r
- ldmfd sp!, {r4-r6,lr}\r
- bx lr\r
-\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-\r
-@ hilights 2 pixels in RGB555/BGR555 format\r
-.macro TileDoShHi2Pixels555 reg\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #26\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #26\r
- adds \reg, \reg, #0x40000000\r
- orrcs \reg, \reg, #0xf0000000\r
- mov \reg, \reg, ror #27\r
-.endm\r
-\r
-\r
-@ Convert 0000bbb0 ggg0rrr0\r
-@ to rrrrrggg gggbbbbb\r
-\r
-@ r2,r3,r9 - scratch, lr = 0x001c001c, r8 = 0x00030003\r
-.macro convRGB565 reg\r
- and r2, lr, \reg,lsl #1\r
- and r9, r8, \reg,lsr #2\r
- orr r2, r2, r9 @ r2=red\r
- and r3, lr, \reg,lsr #7\r
- and r9, r8, \reg,lsr #10\r
- orr r3, r3, r9 @ r3=blue\r
- and \reg, \reg, lr, lsl #3\r
- orr \reg, \reg, \reg,lsl #3 @ green\r
- orr \reg, \reg, r2, lsl #11 @ add red back\r
- orr \reg, \reg, r3 @ add blue back\r
-.endm\r
-\r
-vidConvCpyRGB565: @ void *to, void *from, int pixels\r
- stmfd sp!, {r4-r9,lr}\r
-\r
- mov r12, r2, lsr #3 @ repeats\r
- mov lr, #0x001c0000\r
- orr lr, lr, #0x01c @ lr == pattern 0x001c001c\r
- mov r8, #0x00030000\r
- orr r8, r8, #0x003 @ lr == pattern 0x001c001c\r
-\r
-.loopRGB565:\r
- subs r12, r12, #1\r
-\r
- ldmia r1!, {r4-r7}\r
- convRGB565 r4\r
- str r4, [r0], #4\r
- convRGB565 r5\r
- str r5, [r0], #4\r
- convRGB565 r6\r
- str r6, [r0], #4\r
- convRGB565 r7\r
- str r7, [r0], #4\r
-\r
- bgt .loopRGB565\r
-\r
- ldmfd sp!, {r4-r9,lr}\r
- bx lr\r
-\r
-\r
-\r
-.global FinalizeLineRGB555 @ int sh\r
-\r
-FinalizeLineRGB555:\r
- stmfd sp!, {r4-r8,lr}\r
- ldr r5, =(Pico+0x22228) @ Pico.video\r
- ldr r4, =HighPal\r
- mov r6, r0\r
-\r
- ldrb r7, [r5, #-0x1a] @ 0x2220e ~ dirtyPal\r
- tst r7, r7\r
- beq .fl_noconvRGB555\r
- mov r1, #0\r
- strb r1, [r5, #-0x1a]\r
- sub r1, r5, #0x128 @ r1=Pico.cram\r
- mov r0, r4\r
- mov r2, #0x40\r
- bl vidConvCpyRGB565\r
-\r
-.fl_noconvRGB555:\r
- ldr r0, =DrawLineDest\r
- ldr r0, [r0]\r
-\r
- ldrb r12, [r5, #12]\r
- tst r12, #1\r
- movne r2, #320/8 @ len\r
- moveq r2, #256/8\r
- ldreq r3, =PicoOpt\r
- ldreq r3, [r3]\r
- tsteq r3, #0x100\r
- addeq r0, r0, #32*2\r
-\r
- mov r3, r4\r
- tst r6, r6\r
- beq .fl_noshRGB555\r
- tst r7, r7\r
- beq .fl_noshRGB555\r
-\r
- @ shadowed pixels:\r
- mov r12, #0x008e\r
- orr r12,r12,#0x7300\r
- orr r12,r12,r12,lsl #16\r
- add r4, r3, #0x40*2\r
- add r5, r3, #0xc0*2\r
- mov lr, #0x40/4\r
-.fl_loopcpRGB555_sh:\r
- subs lr, lr, #1\r
- ldmia r3!, {r1,r6}\r
- and r1, r12, r1, lsr #1\r
- and r6, r12, r6, lsr #1\r
- stmia r4!, {r1,r6}\r
- stmia r5!, {r1,r6}\r
- bne .fl_loopcpRGB555_sh\r
-\r
- @ hilighted pixels:\r
- sub r3, r3, #0x40*2\r
- mov lr, #0x40/2\r
-.fl_loopcpRGB555_hi:\r
- ldr r1, [r3], #4\r
- TileDoShHi2Pixels555 r1\r
- str r1, [r4], #4\r
- subs lr, lr, #1\r
- bne .fl_loopcpRGB555_hi\r
-\r
- sub r3, r3, #0x40*2\r
-\r
-\r
-.fl_noshRGB555:\r
-@ ldr r1, =(HighCol+8)\r
- ldr r1, =DrawLineInt\r
- ldr r1, [r1]\r
- add r1, r1, #8\r
- mov lr, #0xff\r
- mov lr, lr, lsl #1\r
-\r
-.fl_loopRGB555:\r
- subs r2, r2, #1\r
-\r
- ldr r12, [r1], #4\r
- ldr r7, [r1], #4\r
-\r
- and r4, lr, r12, lsl #1\r
- ldrh r4, [r3, r4]\r
- and r5, lr, r12, lsr #7\r
- ldrh r5, [r3, r5]\r
- orr r4, r4, r5, lsl #16\r
-\r
- and r5, lr, r12, lsr #15\r
- ldrh r5, [r3, r5]\r
- and r6, lr, r12, lsr #23\r
- ldrh r6, [r3, r6]\r
- orr r5, r5, r6, lsl #16\r
-\r
- and r8, lr, r7, lsl #1\r
- ldrh r8, [r3, r8]\r
- and r6, lr, r7, lsr #7\r
- ldrh r6, [r3, r6]\r
- orr r8, r8, r6, lsl #16\r
-\r
- and r12,lr, r7, lsr #15\r
- ldrh r12,[r3, r12]\r
- and r6, lr, r7, lsr #23\r
- ldrh r6, [r3, r6]\r
- orr r12,r12, r6, lsl #16\r
-\r
- stmia r0!, {r4,r5,r8,r12}\r
- bne .fl_loopRGB555\r
-\r
-\r
- ldmfd sp!, {r4-r8,lr}\r
- bx lr\r
-\r
-@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-\r
-@ utility\r
-.global blockcpy @ void *dst, void *src, size_t n\r
-\r
-blockcpy:\r
- stmfd sp!, {r4,r5}\r
- mov r2, r2, lsr #4\r
-blockcpy_loop:\r
- subs r2, r2, #1\r
- ldmia r1!, {r3-r5,r12}\r
- stmia r0!, {r3-r5,r12}\r
- bne blockcpy_loop\r
- ldmfd sp!, {r4,r5}\r
- bx lr\r
-\r
-\r
-.global blockcpy_or @ void *dst, void *src, size_t n, int pat\r
-\r
-blockcpy_or:\r
- stmfd sp!, {r4-r6}\r
- orr r3, r3, r3, lsl #8\r
- orr r3, r3, r3, lsl #16\r
- mov r2, r2, lsr #4\r
-blockcpy_loop_or:\r
- subs r2, r2, #1\r
- ldmia r1!, {r4-r6,r12}\r
- orr r4, r4, r3\r
- orr r5, r5, r3\r
- orr r6, r6, r3\r
- orr r12,r12,r3\r
- stmia r0!, {r4-r6,r12}\r
- bne blockcpy_loop_or\r
- ldmfd sp!, {r4-r6}\r
- bx lr\r
-\r
#define log_io(...)\r
#endif\r
\r
-#if defined(EMU_C68K) || defined(EMU_A68K)\r
+#if defined(EMU_C68K)\r
static __inline int PicoMemBase(u32 pc)\r
{\r
int membase=0;\r
#endif\r
\r
\r
-#ifdef EMU_A68K\r
-extern u8 *OP_ROM=NULL,*OP_RAM=NULL;\r
-#endif\r
-\r
static u32 CPU_CALL PicoCheckPc(u32 pc)\r
{\r
u32 ret=0;\r
PicoCpu.membase-=pc&0xff000000;\r
\r
ret = PicoCpu.membase+pc;\r
-#elif defined(EMU_A68K)\r
- OP_ROM=(u8 *)PicoMemBase(pc);\r
-\r
- // don't bother calling us back unless it's outside the 64k segment\r
- M68000_regs.AsmBank=(pc>>16);\r
#endif\r
return ret;\r
}\r
// -----------------------------------------------------------------\r
PICO_INTERNAL void PicoMemSetup(void)\r
{\r
-#ifdef EMU_C68K\r
// Setup memory callbacks:\r
+#ifdef EMU_C68K\r
PicoCpu.checkpc=PicoCheckPc;\r
PicoCpu.fetch8 =PicoCpu.read8 =PicoRead8;\r
PicoCpu.fetch16=PicoCpu.read16=PicoRead16;\r
PicoCpu.write16=PicoWrite16;\r
PicoCpu.write32=PicoWrite32;\r
#endif\r
+#ifdef EMU_F68K\r
+ PicoCpuM68k.read_byte =PicoRead8;\r
+ PicoCpuM68k.read_word =PicoRead16;\r
+ PicoCpuM68k.read_long =PicoRead32;\r
+ PicoCpuM68k.write_byte=PicoWrite8;\r
+ PicoCpuM68k.write_word=PicoWrite16;\r
+ PicoCpuM68k.write_long=PicoWrite32;\r
+#endif\r
}\r
\r
-#ifdef EMU_A68K\r
-struct A68KInter\r
-{\r
- u32 unknown;\r
- u8 (__fastcall *Read8) (u32 a);\r
- u16 (__fastcall *Read16)(u32 a);\r
- u32 (__fastcall *Read32)(u32 a);\r
- void (__fastcall *Write8) (u32 a,u8 d);\r
- void (__fastcall *Write16) (u32 a,u16 d);\r
- void (__fastcall *Write32) (u32 a,u32 d);\r
- void (__fastcall *ChangePc)(u32 a);\r
- u8 (__fastcall *PcRel8) (u32 a);\r
- u16 (__fastcall *PcRel16)(u32 a);\r
- u32 (__fastcall *PcRel32)(u32 a);\r
- u16 (__fastcall *Dir16)(u32 a);\r
- u32 (__fastcall *Dir32)(u32 a);\r
-};\r
-\r
-struct A68KInter a68k_memory_intf=\r
-{\r
- 0,\r
- PicoRead8,\r
- PicoRead16,\r
- PicoRead32,\r
- PicoWrite8,\r
- PicoWrite16,\r
- PicoWrite32,\r
- PicoCheckPc,\r
- PicoRead8,\r
- PicoRead16,\r
- PicoRead32,\r
- PicoRead16, // unused\r
- PicoRead32, // unused\r
-};\r
-#endif\r
\r
#ifdef EMU_M68K\r
unsigned int m68k_read_pcrelative_CD8 (unsigned int a);\r
\r
\r
#ifndef _ASM_MISC_C\r
+typedef struct\r
+{\r
+ int b0;\r
+ int b1;\r
+ int b2;\r
+ int b3;\r
+ int b4;\r
+ int b5;\r
+ int b6;\r
+ int b7;\r
+} intblock;\r
+\r
PICO_INTERNAL_ASM void memcpy16(unsigned short *dest, unsigned short *src, int count)\r
{\r
+ if (((int)dest & (int)src & 3) == 0)\r
+ {\r
+ if (count >= 32) {\r
+ memcpy32((int *)dest, (int *)src, count/2);\r
+ count&=1;\r
+ } else {\r
+ for (; count >= 2; count -= 2, dest+=2, src+=2)\r
+ *(int *)dest = *(int *)src;\r
+ }\r
+ }\r
while (count--)\r
*dest++ = *src++;\r
}\r
\r
PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count)\r
{\r
+ intblock *bd = (intblock *) dest, *bs = (intblock *) src;\r
+\r
+ for (; count >= sizeof(*bd)/4; count -= sizeof(*bd)/4)\r
+ *bd++ = *bs++;\r
+\r
+ dest = (int *)bd; src = (int *)bs;\r
while (count--)\r
*dest++ = *src++;\r
}\r
\r
PICO_INTERNAL_ASM void memset32(int *dest, int c, int count)\r
{\r
+ for (; count >= 8; count -= 8, dest += 8)\r
+ dest[0] = dest[1] = dest[2] = dest[3] =\r
+ dest[4] = dest[5] = dest[6] = dest[7] = c;\r
+\r
while (count--)\r
*dest++ = c;\r
}\r
PicoCpu.cycles=cyc_do;\r
CycloneRun(&PicoCpu);\r
SekCycleCnt+=cyc_do-PicoCpu.cycles;\r
-#elif defined(EMU_A68K)\r
- m68k_ICount=cyc_do;\r
- M68000_RUN();\r
- SekCycleCnt+=cyc_do-m68k_ICount;\r
#elif defined(EMU_M68K)\r
SekCycleCnt+=m68k_execute(cyc_do);\r
+#elif defined(EMU_F68K)\r
+ SekCycleCnt+=m68k_emulate(cyc_do);\r
#endif\r
}\r
\r
PicoCpu.cycles=1;\r
CycloneRun(&PicoCpu);\r
SekCycleCnt+=1-PicoCpu.cycles;\r
-#elif defined(EMU_A68K)\r
- m68k_ICount=1;\r
- M68000_RUN();\r
- SekCycleCnt+=1-m68k_ICount;\r
#elif defined(EMU_M68K)\r
SekCycleCnt+=m68k_execute(1);\r
+#elif defined(EMU_F68K)\r
+ SekCycleCnt+=m68k_emulate(1);\r
#endif\r
SekCycleAim=realaim;\r
}\r
}\r
#elif defined(EMU_M68K)\r
sprintf(dstrp, "M68k: PC: %06x, cycles: %u, irql: %i\n", SekPc, SekCyclesDoneT(), PicoM68kCPU.int_level>>8); dstrp+=strlen(dstrp);\r
+#elif defined(EMU_F68K)\r
+ sprintf(dstrp, "M68k: PC: %06x, cycles: %u, irql: %i\n", SekPc, SekCyclesDoneT(), PicoCpuM68k.interrupts[0]); dstrp+=strlen(dstrp);\r
#endif\r
sprintf(dstrp, "z80Run: %i, pal: %i, frame#: %i\n", Pico.m.z80Run, Pico.m.pal, Pico.m.frame_count); dstrp+=strlen(dstrp);\r
z80_debug(dstrp); dstrp+=strlen(dstrp);\r
#define PICO_INTERNAL_ASM\r
#endif\r
\r
-// to select core, define EMU_C68K, EMU_M68K or EMU_A68K in your makefile or project\r
+// to select core, define EMU_C68K, EMU_M68K or EMU_F68K in your makefile or project\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#define SekSetStopS68k(x) { PicoCpuS68k.state_flags&=~1; if (x) { PicoCpuS68k.state_flags|=1; PicoCpuS68k.cycles=0; } }\r
#endif\r
\r
-#ifdef EMU_A68K\r
-void __cdecl M68000_RUN();\r
-// The format of the data in a68k.asm (at the _M68000_regs location)\r
-struct A68KContext\r
-{\r
- unsigned int d[8],a[8];\r
- unsigned int isp,srh,ccr,xc,pc,irq,sr;\r
- int (*IrqCallback) (int nIrq);\r
- unsigned int ppc;\r
- void *pResetCallback;\r
- unsigned int sfc,dfc,usp,vbr;\r
- unsigned int AsmBank,CpuVersion;\r
-};\r
-struct A68KContext M68000_regs;\r
-extern int m68k_ICount;\r
-#define SekCyclesLeft m68k_ICount\r
-#define SekSetCyclesLeft(c) m68k_ICount=c\r
-#define SekPc M68000_regs.pc\r
+#ifdef EMU_F68K\r
+#include "../cpu/fame/fame.h"\r
+M68K_CONTEXT PicoCpuM68k, PicoCpuS68k;\r
+#define SekCyclesLeftNoMCD PicoCpuM68k.io_cycle_counter\r
+#define SekCyclesLeft \\r
+ (((PicoMCD&1) && (PicoOpt & 0x2000)) ? (SekCycleAim-SekCycleCnt) : SekCyclesLeftNoMCD)\r
+#define SekCyclesLeftS68k \\r
+ ((PicoOpt & 0x2000) ? (SekCycleAimS68k-SekCycleCntS68k) : PicoCpuS68k.io_cycle_counter)\r
+#define SekSetCyclesLeftNoMCD(c) PicoCpuM68k.io_cycle_counter=c\r
+#define SekSetCyclesLeft(c) { \\r
+ if ((PicoMCD&1) && (PicoOpt & 0x2000)) SekCycleCnt=SekCycleAim-(c); else SekSetCyclesLeftNoMCD(c); \\r
+}\r
+#define SekPc m68k_get_pc(&PicoCpuM68k)\r
+#define SekPcS68k m68k_get_pc(&PicoCpuS68k)\r
+#define SekSetStop(x) { \\r
+ PicoCpuM68k.execinfo &= ~M68K_HALTED; \\r
+ if (x) { PicoCpuM68k.execinfo |= M68K_HALTED; PicoCpuM68k.io_cycle_counter = 0; } \\r
+}\r
+#define SekSetStopS68k(x) { \\r
+ PicoCpuS68k.execinfo &= ~M68K_HALTED; \\r
+ if (x) { PicoCpuS68k.execinfo |= M68K_HALTED; PicoCpuS68k.io_cycle_counter = 0; } \\r
+}\r
#endif\r
\r
#ifdef EMU_M68K\r
#define SekEndRun(c)\r
#endif\r
\r
-extern int PicoMCD;\r
-\r
// ---------------------------------------------------------\r
\r
+extern int PicoMCD;\r
+\r
// main oscillator clock which controls timing\r
#define OSC_NTSC 53693100\r
// seems to be accurate, see scans from http://www.hot.ee/tmeeco/\r
int SekCycleAim=0; // cycle aim\r
unsigned int SekCycleCntT=0;\r
\r
+\r
+/* context */\r
+// Cyclone 68000\r
#ifdef EMU_C68K\r
-// ---------------------- Cyclone 68000 ----------------------\r
struct Cyclone PicoCpu;\r
#endif\r
-\r
+// MUSASHI 68000\r
#ifdef EMU_M68K\r
-// ---------------------- MUSASHI 68000 ----------------------\r
-m68ki_cpu_core PicoM68kCPU; // MD's CPU\r
+m68ki_cpu_core PicoM68kCPU;\r
#endif\r
-\r
-#ifdef EMU_A68K\r
-// ---------------------- A68K ----------------------\r
-\r
-void __cdecl M68000_RESET();\r
-int m68k_ICount=0;\r
-unsigned int mem_amask=0xffffff; // 24-bit bus\r
-unsigned int mame_debug=0,cur_mrhard=0,m68k_illegal_opcode=0,illegal_op=0,illegal_pc=0,opcode_entry=0; // filler\r
-\r
-static int IrqCallback(int i) { i; return -1; }\r
-static int DoReset() { return 0; }\r
-static int (*ResetCallback)()=DoReset;\r
-\r
-#pragma warning (disable:4152)\r
+// FAME 68000\r
+#ifdef EMU_F68K\r
+M68K_CONTEXT PicoCpuM68k;\r
#endif\r
\r
\r
-\r
+/* callbacks */\r
#ifdef EMU_C68K\r
// interrupt acknowledgment\r
static int SekIntAck(int level)\r
have_illegal = 1;\r
}\r
#endif\r
- //exit(1);\r
return 0;\r
}\r
#endif\r
#endif\r
\r
\r
+#ifdef EMU_F68K\r
+static void setup_fame_fetchmap(void)\r
+{\r
+ int i;\r
+\r
+ // be default, point everything to fitst 64k of ROM\r
+ for (i = 0; i < M68K_FETCHBANK1; i++)\r
+ PicoCpuM68k.Fetch[i] = (unsigned int)Pico.rom - (i<<(24-FAMEC_FETCHBITS));\r
+ // now real ROM\r
+ for (i = 0; i < M68K_FETCHBANK1 && (i<<(24-FAMEC_FETCHBITS)) < Pico.romsize; i++)\r
+ PicoCpuM68k.Fetch[i] = (unsigned int)Pico.rom;\r
+ elprintf(EL_ANOMALY, "ROM end @ #%i %06x", i, (i<<(24-FAMEC_FETCHBITS)));\r
+ // .. and RAM (TODO)\r
+ for (i = M68K_FETCHBANK1*14/16; i < M68K_FETCHBANK1; i++)\r
+ PicoCpuM68k.Fetch[i] = (unsigned int)Pico.ram - (i<<(24-FAMEC_FETCHBITS));\r
+\r
+ elprintf(EL_ANOMALY, "rom = %p, ram = %p", Pico.rom, Pico.ram);\r
+ for (i = 0; i < M68K_FETCHBANK1; i++)\r
+ elprintf(EL_ANOMALY, "Fetch[%i] = %p", i, PicoCpuM68k.Fetch[i]);\r
+}\r
+\r
+void SekIntAckF68K(unsigned level)\r
+{\r
+ if (level == 4) { Pico.video.pending_ints = 0; elprintf(EL_INTS, "hack: @ %06x [%i]", SekPc, SekCycleCnt); }\r
+ else if(level == 6) { Pico.video.pending_ints &= ~0x20; elprintf(EL_INTS, "vack: @ %06x [%i]", SekPc, SekCycleCnt); }\r
+ PicoCpuM68k.interrupts[0] = 0;\r
+}\r
+#endif\r
+\r
\r
PICO_INTERNAL int SekInit()\r
{\r
PicoCpu.ResetCallback=SekResetAck;\r
PicoCpu.UnrecognizedCallback=SekUnrecognizedOpcode;\r
#endif\r
-#ifdef EMU_A68K\r
- memset(&M68000_regs,0,sizeof(M68000_regs));\r
- M68000_regs.IrqCallback=IrqCallback;\r
- M68000_regs.pResetCallback=ResetCallback;\r
- M68000_RESET(); // Init cpu emulator\r
-#endif\r
#ifdef EMU_M68K\r
{\r
void *oldcontext = m68ki_cpu_p;\r
m68k_set_context(oldcontext);\r
}\r
#endif\r
+#ifdef EMU_F68K\r
+ {\r
+ void *oldcontext = g_m68kcontext;\r
+ g_m68kcontext = &PicoCpuM68k;\r
+ memset(&PicoCpuM68k, 0, sizeof(PicoCpuM68k));\r
+ m68k_init();\r
+ PicoCpuM68k.iack_handler = SekIntAckF68K;\r
+ g_m68kcontext = oldcontext;\r
+ }\r
+#endif\r
\r
return 0;\r
}\r
\r
+\r
// Reset the 68000:\r
PICO_INTERNAL int SekReset()\r
{\r
PicoCpu.membase=0;\r
PicoCpu.pc=PicoCpu.checkpc(PicoCpu.read32(4)); // Program Counter\r
#endif\r
-#ifdef EMU_A68K\r
- // Reset CPU: fetch SP and PC\r
- M68000_regs.srh=0x27; // Supervisor mode\r
- M68000_regs.a[7]=PicoRead32(0);\r
- M68000_regs.pc =PicoRead32(4);\r
- PicoInitPc(M68000_regs.pc);\r
-#endif\r
#ifdef EMU_M68K\r
m68k_set_context(&PicoM68kCPU); // if we ever reset m68k, we always need it's context to be set\r
m68ki_cpu.sp[0]=0;\r
m68k_set_irq(0);\r
m68k_pulse_reset();\r
#endif\r
+#ifdef EMU_F68K\r
+ {\r
+ unsigned ret;\r
+ g_m68kcontext = &PicoCpuM68k;\r
+ setup_fame_fetchmap();\r
+ ret = m68k_reset();\r
+ /*if (ret)*/ elprintf(EL_ANOMALY, "m68k_reset returned %u", ret);\r
+ }\r
+#endif\r
\r
return 0;\r
}\r
#ifdef EMU_C68K\r
PicoCpu.irq=irq;\r
#endif\r
-#ifdef EMU_A68K\r
- M68000_regs.irq=irq; // raise irq (gets lowered after taken)\r
-#endif\r
#ifdef EMU_M68K\r
{\r
void *oldcontext = m68ki_cpu_p;\r
m68k_set_context(oldcontext);\r
}\r
#endif\r
+#ifdef EMU_F68K\r
+ PicoCpuM68k.interrupts[0]=irq;\r
+#endif\r
+\r
return 0;\r
}\r
\r
-//int SekPc() { return PicoCpu.pc-PicoCpu.membase; }\r
-//int SekPc() { return M68000_regs.pc; }\r
-//int SekPc() { return m68k_get_reg(NULL, M68K_REG_PC); }\r
-\r
PICO_INTERNAL void SekState(unsigned char *data)\r
{\r
#ifdef EMU_C68K\r
memcpy(data,PicoCpu.d,0x44);\r
-#elif defined(EMU_A68K)\r
- memcpy(data, M68000_regs.d, 0x40);\r
- memcpy(data+0x40,&M68000_regs.pc,0x04);\r
#elif defined(EMU_M68K)\r
- memcpy(data, PicoM68kCPU.dar,0x40);\r
- memcpy(data+0x40,&PicoM68kCPU.pc, 0x04);\r
+ memcpy(data, PicoM68kCPU.dar, 0x40);\r
+ *(int *)(data+0x40) = PicoM68kCPU.pc;\r
+#elif defined(EMU_F68K)\r
+ memcpy(data, PicoCpuM68k.dreg, 0x40);\r
+ *(int *)(data+0x40) = PicoCpuM68k.pc;\r
#endif\r
}\r
\r
#ifdef EMU_C68K\r
CycloneSetRealTAS(use_real);\r
#endif\r
+#ifdef EMU_F68K\r
+ // TODO\r
+#endif\r
}\r
\r
--- /dev/null
+/*****************************************************************************/\r
+/* FAME Fast and Accurate Motorola 68000 Emulation Core */\r
+/* (c) 2005 Oscar Orallo Pelaez */\r
+/* Version: 1.24 */\r
+/* Date: 08-20-2005 */\r
+/* See FAME.HTML for documentation and license information */\r
+/*****************************************************************************/\r
+\r
+#ifndef __FAME_H__\r
+#define __FAME_H__\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+// PicoDrive hacks\r
+#define FAMEC_FETCHBITS 8\r
+#define M68K_FETCHBANK1 (1 << FAMEC_FETCHBITS)\r
+\r
+//#define M68K_RUNNING 0x01\r
+#define M68K_HALTED 0x80\r
+#define M68K_WAITING 0x04\r
+#define M68K_DISABLE 0x20\r
+#define M68K_FAULTED 0x40\r
+#define M68K_EMULATE_GROUP_0 0x02\r
+#define M68K_EMULATE_TRACE 0x08\r
+#define M68K_DO_TRACE 0x10\r
+\r
+\r
+/************************************/\r
+/* General library defines */\r
+/************************************/\r
+\r
+#ifndef M68K_OK\r
+ #define M68K_OK 0\r
+#endif\r
+#ifndef M68K_RUNNING\r
+ #define M68K_RUNNING 1\r
+#endif\r
+#ifndef M68K_NO_SUP_ADDR_SPACE\r
+ #define M68K_NO_SUP_ADDR_SPACE 2\r
+#endif\r
+#ifndef M68K_DOUBLE_BUS_FAULT\r
+ #define M68K_DOUBLE_BUS_FAULT -1\r
+#endif\r
+#ifndef M68K_INV_REG\r
+ #define M68K_INV_REG -1\r
+#endif\r
+\r
+/* Hardware interrupt state */\r
+\r
+#ifndef M68K_IRQ_LEVEL_ERROR\r
+ #define M68K_IRQ_LEVEL_ERROR -1\r
+#endif\r
+#ifndef M68K_IRQ_INV_PARAMS\r
+ #define M68K_IRQ_INV_PARAMS -2\r
+#endif\r
+\r
+/* Defines to specify hardware interrupt type */\r
+\r
+#ifndef M68K_AUTOVECTORED_IRQ\r
+ #define M68K_AUTOVECTORED_IRQ -1\r
+#endif\r
+#ifndef M68K_SPURIOUS_IRQ\r
+ #define M68K_SPURIOUS_IRQ -2\r
+#endif\r
+\r
+#ifndef M68K_AUTO_LOWER_IRQ\r
+ #define M68K_AUTO_LOWER_IRQ 1\r
+#endif\r
+#ifndef M68K_MANUAL_LOWER_IRQ\r
+ #define M68K_MANUAL_LOWER_IRQ 0\r
+#endif\r
+\r
+/* Defines to specify address space */\r
+\r
+#ifndef M68K_SUP_ADDR_SPACE\r
+ #define M68K_SUP_ADDR_SPACE 0\r
+#endif\r
+#ifndef M68K_USER_ADDR_SPACE\r
+ #define M68K_USER_ADDR_SPACE 2\r
+#endif\r
+#ifndef M68K_PROG_ADDR_SPACE\r
+ #define M68K_PROG_ADDR_SPACE 0\r
+#endif\r
+#ifndef M68K_DATA_ADDR_SPACE\r
+ #define M68K_DATA_ADDR_SPACE 1\r
+#endif\r
+\r
+\r
+/*******************/\r
+/* Data definition */\r
+/*******************/\r
+\r
+/* M68K registers */\r
+typedef enum {\r
+ M68K_REG_D0=0,\r
+ M68K_REG_D1,\r
+ M68K_REG_D2,\r
+ M68K_REG_D3,\r
+ M68K_REG_D4,\r
+ M68K_REG_D5,\r
+ M68K_REG_D6,\r
+ M68K_REG_D7,\r
+ M68K_REG_A0,\r
+ M68K_REG_A1,\r
+ M68K_REG_A2,\r
+ M68K_REG_A3,\r
+ M68K_REG_A4,\r
+ M68K_REG_A5,\r
+ M68K_REG_A6,\r
+ M68K_REG_A7,\r
+ M68K_REG_ASP,\r
+ M68K_REG_PC,\r
+ M68K_REG_SR\r
+} m68k_register;\r
+\r
+typedef union\r
+{\r
+ unsigned char B;\r
+ signed char SB;\r
+ unsigned short W;\r
+ signed short SW;\r
+ unsigned int D;\r
+ signed int SD;\r
+} famec_union32;\r
+\r
+/* The memory blocks must be in native (Motorola) format */\r
+struct M68K_PROGRAM {\r
+ unsigned low_addr;\r
+ unsigned high_addr;\r
+ unsigned offset;\r
+};\r
+\r
+/* The memory blocks must be in native (Motorola) format */\r
+struct M68K_DATA {\r
+ unsigned low_addr;\r
+ unsigned high_addr;\r
+ void *mem_handler;\r
+ void *data;\r
+};\r
+\r
+/* M68K CPU CONTEXT */\r
+typedef struct\r
+{\r
+ unsigned int (*read_byte )(unsigned int a);\r
+ unsigned int (*read_word )(unsigned int a);\r
+ unsigned int (*read_long )(unsigned int a);\r
+ void (*write_byte)(unsigned int a,unsigned char d);\r
+ void (*write_word)(unsigned int a,unsigned short d);\r
+ void (*write_long)(unsigned int a,unsigned int d);\r
+ void (*reset_handler)(void);\r
+ void (*iack_handler)(unsigned level);\r
+ famec_union32 dreg[8];\r
+ famec_union32 areg[8];\r
+ unsigned asp;\r
+ unsigned pc;\r
+ unsigned char interrupts[8];\r
+ unsigned short sr;\r
+ unsigned short execinfo;\r
+ // PD extension\r
+ int io_cycle_counter; // cycles left\r
+ unsigned int Fetch[M68K_FETCHBANK1];\r
+} M68K_CONTEXT;\r
+\r
+extern M68K_CONTEXT *g_m68kcontext;\r
+\r
+/************************/\r
+/* Function definition */\r
+/************************/\r
+\r
+/* General purpose functions */\r
+void m68k_init(void);\r
+int m68k_reset(void);\r
+int m68k_emulate(int n);\r
+\r
+unsigned m68k_get_pc(M68K_CONTEXT *context);\r
+unsigned m68k_get_register(M68K_CONTEXT *context, m68k_register reg);\r
+unsigned m68k_set_register(M68K_CONTEXT *context, m68k_register reg, unsigned value);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
--- /dev/null
+/****************************************************************************/\r
+/* FAME (Fast and Accurate Motorola 68000 Emulation Library) */\r
+/* Emulador de 68000 en C */\r
+/* Autor: Oscar Orallo Pelaez */\r
+/* Fecha de comienzo: 03-10-2006 */\r
+/* Ultima actualizacion: 08-10-2006 */\r
+/* Based on the excellent FAMEC emulator by Stèphane Dallongueville */\r
+/****************************************************************************/\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <string.h>\r
+\r
+#include "fame.h"\r
+\r
+\r
+// Options //\r
+#define FAMEC_ROLL_INLINE\r
+#define FAMEC_EMULATE_TRACE\r
+#define FAMEC_IRQ_CYCLES\r
+#define FAMEC_CHECK_BRANCHES\r
+// #define FAMEC_USE_DATA_BANKS\r
+// #define FAMEC_EXTRA_INLINE\r
+// #define FAMEC_DEBUG\r
+#define FAMEC_NO_GOTOS\r
+#define FAMEC_ADR_BITS 24\r
+// #define FAMEC_FETCHBITS 8\r
+#define FAMEC_DATABITS 8\r
+\r
+#define USE_CYCLONE_TIMING\r
+#define USE_CYCLONE_TIMING_DIV\r
+// Options //\r
+\r
+\r
+#undef INLINE\r
+#ifndef INLINE\r
+#define INLINE __inline__\r
+#endif\r
+\r
+#ifndef FAMEC_EXTRA_INLINE\r
+#define FAMEC_EXTRA_INLINE\r
+#else\r
+#define FAMEC_EXTRA_INLINE INLINE\r
+#endif\r
+\r
+#ifdef u8\r
+#undef u8\r
+#endif\r
+\r
+#ifdef s8\r
+#undef s8\r
+#endif\r
+\r
+#ifdef u16\r
+#undef u16\r
+#endif\r
+\r
+#ifdef s16\r
+#undef s16\r
+#endif\r
+\r
+#ifdef u32\r
+#undef u32\r
+#endif\r
+\r
+#ifdef s32\r
+#undef s32\r
+#endif\r
+\r
+#define u8 unsigned char\r
+#define s8 signed char\r
+#define u16 unsigned short\r
+#define s16 signed short\r
+#define u32 unsigned int\r
+#define s32 signed int\r
+\r
+/*\r
+typedef unsigned char u8;\r
+typedef signed char s8;\r
+typedef unsigned short u16;\r
+typedef signed short s16;\r
+typedef unsigned int u32;\r
+typedef signed int s32;\r
+*/\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+static u32 flag_T;\r
+#endif\r
+static u32 flag_C;\r
+static u32 flag_V;\r
+static u32 flag_NotZ;\r
+static u32 flag_N;\r
+static u32 flag_X; // 16 bytes aligned\r
+static u32 flag_S;\r
+static u32 flag_I;\r
+\r
+#ifndef M68K_OK\r
+ #define M68K_OK 0\r
+#endif\r
+\r
+#ifndef M68K_RUNNING\r
+ #define M68K_RUNNING 1\r
+#endif\r
+\r
+#ifndef M68K_NO_SUP_ADDR_SPACE\r
+ #define M68K_NO_SUP_ADDR_SPACE 2\r
+#endif\r
+\r
+#ifndef M68K_INV_REG\r
+ #define M68K_INV_REG -1\r
+#endif\r
+\r
+/* Hardware interrupt state */\r
+\r
+#ifndef M68K_IRQ_LEVEL_ERROR\r
+ #define M68K_IRQ_LEVEL_ERROR -1\r
+#endif\r
+\r
+#ifndef M68K_IRQ_INV_PARAMS\r
+ #define M68K_IRQ_INV_PARAMS -2\r
+#endif\r
+\r
+/* Defines to specify hardware interrupt type */\r
+\r
+#ifndef M68K_AUTOVECTORED_IRQ\r
+ #define M68K_AUTOVECTORED_IRQ -1\r
+#endif\r
+\r
+#ifndef M68K_SPURIOUS_IRQ\r
+ #define M68K_SPURIOUS_IRQ -2\r
+#endif\r
+\r
+/* Defines to specify address space */\r
+\r
+#ifndef M68K_SUP_ADDR_SPACE\r
+ #define M68K_SUP_ADDR_SPACE 0\r
+#endif\r
+\r
+#ifndef M68K_USER_ADDR_SPACE\r
+ #define M68K_USER_ADDR_SPACE 2\r
+#endif\r
+\r
+#ifndef M68K_PROG_ADDR_SPACE\r
+ #define M68K_PROG_ADDR_SPACE 0\r
+#endif\r
+\r
+#ifndef M68K_DATA_ADDR_SPACE\r
+ #define M68K_DATA_ADDR_SPACE 1\r
+#endif\r
+\r
+\r
+\r
+/******************************/\r
+/* 68K core types definitions */\r
+/******************************/\r
+\r
+#if FAMEC_ADR_BITS < 32\r
+#define M68K_ADR_MASK ((1 << FAMEC_ADR_BITS)-1)\r
+#else\r
+#define M68K_ADR_MASK 0xFFFFFFFF\r
+#endif\r
+#define M68K_FETCHSFT (FAMEC_ADR_BITS - FAMEC_FETCHBITS)\r
+#define M68K_FETCHBANK (1 << FAMEC_FETCHBITS)\r
+#define M68K_FETCHMASK (M68K_FETCHBANK - 1)\r
+\r
+#define M68K_DATASFT (FAMEC_ADR_BITS - FAMEC_DATABITS)\r
+#define M68K_DATABANK (1 << FAMEC_DATABITS)\r
+#define M68K_DATAMASK (M68K_DATABANK - 1)\r
+\r
+#define M68K_SR_C_SFT 8\r
+#define M68K_SR_V_SFT 7\r
+#define M68K_SR_Z_SFT 0\r
+#define M68K_SR_N_SFT 7\r
+#define M68K_SR_X_SFT 8\r
+\r
+#define M68K_SR_S_SFT 13\r
+#define M68K_SR_T_SFT 15\r
+\r
+#define M68K_SR_C (1 << M68K_SR_C_SFT)\r
+#define M68K_SR_V (1 << M68K_SR_V_SFT)\r
+#define M68K_SR_Z 0\r
+#define M68K_SR_N (1 << M68K_SR_N_SFT)\r
+#define M68K_SR_X (1 << M68K_SR_X_SFT)\r
+\r
+#define M68K_SR_S (1 << M68K_SR_S_SFT)\r
+#define M68K_SR_T (1 << M68K_SR_T_SFT)\r
+\r
+#define M68K_CCR_MASK 0x1F\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+#define M68K_SR_MASK (M68K_SR_T | M68K_SR_S | 0x0700 | M68K_CCR_MASK)\r
+#else\r
+#define M68K_SR_MASK (M68K_SR_S | 0x0700 | M68K_CCR_MASK)\r
+#endif\r
+\r
+// exception defines taken from musashi core\r
+#define M68K_RESET_EX 1\r
+#define M68K_BUS_ERROR_EX 2\r
+#define M68K_ADDRESS_ERROR_EX 3\r
+#define M68K_ILLEGAL_INSTRUCTION_EX 4\r
+#define M68K_ZERO_DIVIDE_EX 5\r
+#define M68K_CHK_EX 6\r
+#define M68K_TRAPV_EX 7\r
+#define M68K_PRIVILEGE_VIOLATION_EX 8\r
+#define M68K_TRACE_EX 9\r
+#define M68K_1010_EX 10\r
+#define M68K_1111_EX 11\r
+#define M68K_FORMAT_ERROR_EX 14\r
+#define M68K_UNINITIALIZED_INTERRUPT_EX 15\r
+#define M68K_SPURIOUS_INTERRUPT_EX 24\r
+#define M68K_INTERRUPT_AUTOVECTOR_EX 24\r
+#define M68K_TRAP_BASE_EX 32\r
+\r
+#define M68K_INT_ACK_AUTOVECTOR -1\r
+\r
+\r
+// internals core macros\r
+/////////////////////////\r
+\r
+#define DREG(X) (m68kcontext.dreg[(X)].D)\r
+#define DREGu32(X) (m68kcontext.dreg[(X)].D)\r
+#define DREGs32(X) (m68kcontext.dreg[(X)].SD)\r
+#define DREGu16(X) (m68kcontext.dreg[(X)].W)\r
+#define DREGs16(X) (m68kcontext.dreg[(X)].SW)\r
+#define DREGu8(X) (m68kcontext.dreg[(X)].B)\r
+#define DREGs8(X) (m68kcontext.dreg[(X)].SB)\r
+\r
+#define AREG(X) (m68kcontext.areg[(X)].D)\r
+#define AREGu32(X) (m68kcontext.areg[(X)].D)\r
+#define AREGs32(X) (m68kcontext.areg[(X)].SD)\r
+#define AREGu16(X) (m68kcontext.areg[(X)].W)\r
+#define AREGs16(X) (m68kcontext.areg[(X)].SW)\r
+\r
+#define ASP (m68kcontext.asp)\r
+\r
+#define LSL(A, C) ((A) << (C))\r
+#define LSR(A, C) ((A) >> (C))\r
+\r
+#define LSR_32(A, C) ((C) < 32 ? (A) >> (C) : 0)\r
+#define LSL_32(A, C) ((C) < 32 ? (A) << (C) : 0)\r
+\r
+#define ROL_8(A, C) (LSL(A, C) | LSR(A, 8-(C)))\r
+#define ROL_9(A, C) (LSL(A, C) | LSR(A, 9-(C)))\r
+#define ROL_16(A, C) (LSL(A, C) | LSR(A, 16-(C)))\r
+#define ROL_17(A, C) (LSL(A, C) | LSR(A, 17-(C)))\r
+#define ROL_32(A, C) (LSL_32(A, C) | LSR_32(A, 32-(C)))\r
+#define ROL_33(A, C) (LSL_32(A, C) | LSR_32(A, 33-(C)))\r
+\r
+#define ROR_8(A, C) (LSR(A, C) | LSL(A, 8-(C)))\r
+#define ROR_9(A, C) (LSR(A, C) | LSL(A, 9-(C)))\r
+#define ROR_16(A, C) (LSR(A, C) | LSL(A, 16-(C)))\r
+#define ROR_17(A, C) (LSR(A, C) | LSL(A, 17-(C)))\r
+#define ROR_32(A, C) (LSR_32(A, C) | LSL_32(A, 32-(C)))\r
+#define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C)))\r
+\r
+#ifndef FAMEC_NO_GOTOS\r
+#define NEXT \\r
+ FETCH_WORD(Opcode); \\r
+ goto *JumpTable[Opcode];\r
+\r
+#ifdef FAMEC_ROLL_INLINE\r
+#define RET(A) \\r
+ m68kcontext.io_cycle_counter -= (A); \\r
+ if (m68kcontext.io_cycle_counter <= 0) goto famec_Exec_End; \\r
+ NEXT\r
+#else\r
+#define RET(A) \\r
+ m68kcontext.io_cycle_counter -= (A); \\r
+ if (m68kcontext.io_cycle_counter <= 0) goto famec_Exec_End; \\r
+ goto famec_Exec;\r
+#endif\r
+\r
+#else\r
+\r
+#define NEXT \\r
+ do{ \\r
+ FETCH_WORD(Opcode); \\r
+ JumpTable[Opcode](); \\r
+ }while(m68kcontext.io_cycle_counter>0);\r
+\r
+#define RET(A) \\r
+ m68kcontext.io_cycle_counter -= (A); \\r
+ return;\r
+\r
+#endif\r
+\r
+#define M68K_PPL (m68kcontext.sr >> 8) & 7\r
+\r
+#define GET_PC \\r
+ (u32)PC - BasePC;\r
+\r
+#define SET_PC(A) \\r
+ BasePC = g_m68kcontext->Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
+ /* BasePC -= (A) & 0xFF000000; */ \\r
+ PC = (u16*)(((A) & M68K_ADR_MASK) + BasePC);\r
+\r
+#define SET_PC_BASE(P,B,A) \\r
+ (B) = g_m68kcontext->Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
+ /* (B) -= (A) & 0xFF000000; */ \\r
+ (P) = (u16*)(((A) & M68K_ADR_MASK) + (B));\r
+\r
+\r
+#define PRE_IO \\r
+// io_cycle_counter = CCnt;\r
+\r
+#define POST_IO \\r
+// CCnt = io_cycle_counter;\r
+\r
+#ifndef FAME_BIG_ENDIAN\r
+\r
+ #define READ_BYTE_F(A, D) \\r
+ D = m68kcontext.read_byte(A) & 0xFF;\r
+\r
+ #define READ_WORD_F(A, D) \\r
+ D = m68kcontext.read_word(A) & 0xFFFF;\r
+\r
+ #define READ_LONG_F(A, D) \\r
+ D = m68kcontext.read_word((A)) << 16; \\r
+ D |= m68kcontext.read_word((A) + 2) & 0xFFFF;\r
+\r
+ #define READSX_LONG_F(A, D) \\r
+ D = m68kcontext.read_word((A)) << 16; \\r
+ D |= m68kcontext.read_word((A) + 2) & 0xFFFF;\r
+\r
+ #define WRITE_LONG_F(A, D) \\r
+ m68kcontext.write_word((A), (D) >> 16); \\r
+ m68kcontext.write_word((A) + 2, (D) & 0xFFFF);\r
+\r
+ #define WRITE_LONG_DEC_F(A, D) \\r
+ m68kcontext.write_word((A), (D) >> 16); \\r
+ m68kcontext.write_word((A) + 2, (D) & 0xFFFF);\r
+\r
+ #define FETCH_LONG(A) \\r
+ (A) = PC[1] | (PC[0] << 16); \\r
+ PC += 2;\r
+\r
+ #define PUSH_32_F(D) \\r
+ AREG(7) -= 4; \\r
+ m68kcontext.write_word(AREG(7), (D) >> 16); \\r
+ m68kcontext.write_word(AREG(7) + 2, (D) & 0xFFFF);\r
+\r
+ #define POP_32_F(D) \\r
+ D = m68kcontext.read_word(AREG(7)) << 16; \\r
+ D |= m68kcontext.read_word(AREG(7) + 2) & 0xFFFF; \\r
+ AREG(7) += 4;\r
+\r
+ #define GET_SWORD \\r
+ (s16)(*PC)\r
+\r
+ #define FETCH_BYTE(A) \\r
+ (A) = (*PC++) & 0xFF;\r
+\r
+ #define FETCH_SBYTE(A) \\r
+ (A) = (s8)((*PC++) & 0xFF);\r
+\r
+ #define FETCH_WORD(A) \\r
+ (A) = *PC++;\r
+\r
+ #define FETCH_SWORD(A) \\r
+ (A) = (s16)(*PC++);\r
+\r
+ #define DECODE_EXT_WORD \\r
+ { \\r
+ u32 ext; \\r
+ \\r
+ ext = *PC++; \\r
+ \\r
+ adr += (s8)(ext); \\r
+ if (ext & 0x0800) adr += DREGs32(ext >> 12); \\r
+ else adr += DREGs16(ext >> 12); \\r
+ }\r
+\r
+#else\r
+\r
+ #define READ_BYTE_F(A, D) \\r
+ D = m68kcontext.read_byte(A) & 0xFF;\r
+\r
+ #define READ_WORD_F(A, D) \\r
+ D = m68kcontext.read_word(A) & 0xFFFF;\r
+\r
+ #define READ_LONG_F(A, D) \\r
+ D = m68kcontext.read_long(A);\r
+\r
+ #define READSX_LONG_F(A, D) \\r
+ D = m68kcontext.read_long(A);\r
+\r
+ #define WRITE_LONG_F(A, D) \\r
+ m68kcontext.write_long(A, D);\r
+\r
+ #define WRITE_LONG_DEC_F(A, D) \\r
+ m68kcontext.write_word((A) + 2, (D) >> 16); \\r
+ m68kcontext.write_word((A), (D) & 0xFFFF);\r
+\r
+ #define FETCH_LONG(A) \\r
+ (A) = PC[0] | (PC[1] << 16); \\r
+ PC += 2;\r
+\r
+ #define PUSH_32_F(D) \\r
+ AREG(7) -= 4; \\r
+ m68kcontext.write_long(AREG(7), D);\r
+\r
+ #define POP_32_F(D) \\r
+ D = m68kcontext.read_long(AREG(7)); \\r
+ AREG(7) += 4;\r
+\r
+ #define GET_SWORD \\r
+ ((s16)(((*PC & 0xFF) << 8) | (*PC >> 8)))\r
+\r
+ #define FETCH_BYTE(A) \\r
+ (A) = (*PC++) >> 8;\r
+\r
+ #define FETCH_SBYTE(A) \\r
+ (A) = (s8)((*PC++) >> 8);\r
+\r
+ #define FETCH_WORD(A) \\r
+ (A) = ((*PC & 0xFF) << 8) | (*PC >> 8); \\r
+ PC++;\r
+\r
+ #define FETCH_SWORD(A) \\r
+ (A) = (s16)(((*PC & 0xFF) << 8) | (*PC >> 8)); \\r
+ PC++;\r
+\r
+ #define DECODE_EXT_WORD \\r
+ { \\r
+ u32 ext; \\r
+ \\r
+ ext = *PC++; \\r
+ \\r
+ adr += (s8)(ext >> 8); \\r
+ if (ext & 0x0008) adr += DREGs32((ext >> 4) & 0x000F); \\r
+ else adr += DREGs16((ext >> 4) & 0x000F); \\r
+ }\r
+\r
+#endif\r
+\r
+#define READSX_BYTE_F(A, D) \\r
+ D = (s8)m68kcontext.read_byte(A);\r
+\r
+#define READSX_WORD_F(A, D) \\r
+ D = (s16)m68kcontext.read_word(A);\r
+\r
+\r
+#define WRITE_BYTE_F(A, D) \\r
+ m68kcontext.write_byte(A, D);\r
+\r
+#define WRITE_WORD_F(A, D) \\r
+ m68kcontext.write_word(A, D);\r
+\r
+#define PUSH_16_F(D) \\r
+ m68kcontext.write_word(AREG(7) -= 2, D); \\r
+\r
+#define POP_16_F(D) \\r
+ D = (u16)m68kcontext.read_word(AREG(7)); \\r
+ AREG(7) += 2;\r
+\r
+#define GET_CCR \\r
+ (((flag_C >> (M68K_SR_C_SFT - 0)) & 1) | \\r
+ ((flag_V >> (M68K_SR_V_SFT - 1)) & 2) | \\r
+ (((!flag_NotZ) & 1) << 2) | \\r
+ ((flag_N >> (M68K_SR_N_SFT - 3)) & 8) | \\r
+ ((flag_X >> (M68K_SR_X_SFT - 4)) & 0x10))\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+#define GET_SR \\r
+ ((flag_S << 0) | \\r
+ (flag_I << 8) | \\r
+ (flag_T ) | \\r
+ GET_CCR)\r
+#else\r
+#define GET_SR \\r
+ ((flag_S << 0) | \\r
+ (flag_I << 8) | \\r
+ GET_CCR)\r
+#endif\r
+\r
+#define SET_CCR(A) \\r
+ flag_C = (A) << (M68K_SR_C_SFT - 0); \\r
+ flag_V = (A) << (M68K_SR_V_SFT - 1); \\r
+ flag_NotZ = ~(A) & 4; \\r
+ flag_N = (A) << (M68K_SR_N_SFT - 3); \\r
+ flag_X = (A) << (M68K_SR_X_SFT - 4);\r
+\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+#define SET_SR(A) \\r
+ SET_CCR(A) \\r
+ flag_T = (A) & M68K_SR_T; \\r
+ flag_S = (A) & M68K_SR_S; \\r
+ flag_I = ((A) >> 8) & 7;\r
+#else\r
+#define SET_SR(A) \\r
+ SET_CCR(A) \\r
+ flag_S = (A) & M68K_SR_S; \\r
+ flag_I = ((A) >> 8) & 7;\r
+#endif\r
+\r
+#define CHECK_INT_TO_JUMP(CLK) \\r
+ if (interrupt_chk__()) \\r
+ { \\r
+ cycles_needed=m68kcontext.io_cycle_counter-(CLK); \\r
+ m68kcontext.io_cycle_counter= (CLK); \\r
+ }\r
+\r
+\r
+#ifdef FAMEC_CHECK_BRANCHES\r
+\r
+#ifdef FAMEC_NO_GOTOS\r
+#define CHECK_BRANCH_EXCEPTION_GOTO_END m68kcontext.io_cycle_counter=0; return;\r
+#else\r
+#define CHECK_BRANCH_EXCEPTION_GOTO_END goto famec_Exec_End;\r
+#endif\r
+\r
+#define CHECK_BRANCH_EXCEPTION(_PC_) \\r
+ if ((_PC_)&1) \\r
+ { \\r
+ u32 pr_PC=GET_PC; \\r
+ m68kcontext.execinfo |= M68K_EMULATE_GROUP_0; \\r
+ execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \\r
+ CHECK_BRANCH_EXCEPTION_GOTO_END \\r
+ }\r
+#else\r
+#define CHECK_BRANCH_EXCEPTION(_PC_)\r
+#endif\r
+\r
+\r
+static void init_jump_table(void);\r
+\r
+/* Custom function handler */\r
+typedef void (*icust_handler_func)(u32 vector);\r
+\r
+// global variable\r
+///////////////////\r
+\r
+/* Current CPU context */\r
+M68K_CONTEXT *g_m68kcontext;\r
+#define m68kcontext (*g_m68kcontext)\r
+\r
+/* static s32 io_cycle_counter; */\r
+static s32 cycles_needed=0;\r
+static u16 *PC;\r
+static u32 BasePC;\r
+// static u32 Fetch[M68K_FETCHBANK];\r
+\r
+/* Custom function handler */\r
+typedef void (*opcode_func)(void);\r
+\r
+static opcode_func JumpTable[0x10000];\r
+\r
+\r
+static u32 initialised = 0;\r
+\r
+// exception cycle table (taken from musashi core)\r
+static const s32 exception_cycle_table[256] =\r
+{\r
+ 4, // 0: Reset - Initial Stack Pointer\r
+ 4, // 1: Reset - Initial Program Counter\r
+ 50, // 2: Bus Error\r
+ 50, // 3: Address Error\r
+ 34, // 4: Illegal Instruction\r
+ 38, // 5: Divide by Zero\r
+ 40, // 6: CHK\r
+ 34, // 7: TRAPV\r
+ 34, // 8: Privilege Violation\r
+ 34, // 9: Trace\r
+ 4, // 10:\r
+ 4, // 11:\r
+ 4, // 12: RESERVED\r
+ 4, // 13: Coprocessor Protocol Violation\r
+ 4, // 14: Format Error\r
+ 44, // 15: Uninitialized Interrupt\r
+ 4, // 16: RESERVED\r
+ 4, // 17: RESERVED\r
+ 4, // 18: RESERVED\r
+ 4, // 19: RESERVED\r
+ 4, // 20: RESERVED\r
+ 4, // 21: RESERVED\r
+ 4, // 22: RESERVED\r
+ 4, // 23: RESERVED\r
+ 44, // 24: Spurious Interrupt\r
+ 44, // 25: Level 1 Interrupt Autovector\r
+ 44, // 26: Level 2 Interrupt Autovector\r
+ 44, // 27: Level 3 Interrupt Autovector\r
+ 44, // 28: Level 4 Interrupt Autovector\r
+ 44, // 29: Level 5 Interrupt Autovector\r
+ 44, // 30: Level 6 Interrupt Autovector\r
+ 44, // 31: Level 7 Interrupt Autovector\r
+ 34, // 32: TRAP #0\r
+ 34, // 33: TRAP #1\r
+ 34, // 34: TRAP #2\r
+ 34, // 35: TRAP #3\r
+ 34, // 36: TRAP #4\r
+ 34, // 37: TRAP #5\r
+ 34, // 38: TRAP #6\r
+ 34, // 39: TRAP #7\r
+ 34, // 40: TRAP #8\r
+ 34, // 41: TRAP #9\r
+ 34, // 42: TRAP #10\r
+ 34, // 43: TRAP #11\r
+ 34, // 44: TRAP #12\r
+ 34, // 45: TRAP #13\r
+ 34, // 46: TRAP #14\r
+ 34, // 47: TRAP #15\r
+ 4, // 48: FP Branch or Set on Unknown Condition\r
+ 4, // 49: FP Inexact Result\r
+ 4, // 50: FP Divide by Zero\r
+ 4, // 51: FP Underflow\r
+ 4, // 52: FP Operand Error\r
+ 4, // 53: FP Overflow\r
+ 4, // 54: FP Signaling NAN\r
+ 4, // 55: FP Unimplemented Data Type\r
+ 4, // 56: MMU Configuration Error\r
+ 4, // 57: MMU Illegal Operation Error\r
+ 4, // 58: MMU Access Level Violation Error\r
+ 4, // 59: RESERVED\r
+ 4, // 60: RESERVED\r
+ 4, // 61: RESERVED\r
+ 4, // 62: RESERVED\r
+ 4, // 63: RESERVED\r
+ // 64-255: User Defined\r
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\r
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\r
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\r
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\r
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\r
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4\r
+};\r
+\r
+\r
+/********************/\r
+/* helper functions */\r
+/********************/\r
+\r
+\r
+#if 0\r
+static void famec_SetFetch(u32 low_adr, u32 high_adr, u32 fetch_adr)\r
+{\r
+ u32 i, j;\r
+\r
+ i = (low_adr >> M68K_FETCHSFT) & M68K_FETCHMASK;\r
+ j = (high_adr >> M68K_FETCHSFT) & M68K_FETCHMASK;\r
+\r
+ while (i <= j)\r
+ g_m68kcontext->Fetch[i++] = fetch_adr;\r
+}\r
+\r
+static void famec_SetBanks(void)\r
+{\r
+ u32 i=0;\r
+ while(m68kcontext.fetch[i].low_addr != (u32)-1)\r
+ {\r
+ famec_SetFetch(m68kcontext.fetch[i].low_addr,m68kcontext.fetch[i].high_addr,m68kcontext.fetch[i].offset);\r
+ i++;\r
+ }\r
+}\r
+#endif\r
+\r
+\r
+/***********************/\r
+/* core main functions */\r
+/***********************/\r
+\r
+/***************************************************************************/\r
+/* m68k_init() */\r
+/* Debe ser llamado para inicializar la tabla de saltos de instruccion */\r
+/* No recibe parametros y no devuelve nada */\r
+/***************************************************************************/\r
+void m68k_init(void)\r
+{\r
+#ifdef FAMEC_DEBUG\r
+ puts("Initializing FAME...");\r
+#endif\r
+\r
+ if (!initialised)\r
+ m68k_emulate(0);\r
+\r
+#ifdef FAMEC_DEBUG\r
+ puts("FAME initialized.");\r
+#endif\r
+}\r
+\r
+/******************************************************************************/\r
+/* m68k_reset() */\r
+/* Parametros: Ninguno */\r
+/* Retorno: Exito de la operacion */\r
+/* M68K_OK (0): La funcion se ha ejecutado satisfactoriamente */\r
+/* M68K_RUNNING (1): No se puede resetear porque la CPU esta en ejecucion */\r
+/* M68K_NO_SUP_ADDR_SPACE (2): No se puede resetear porque no hay mapa */\r
+/* de memoria supervisor de extraccion de opcodes */\r
+/******************************************************************************/\r
+int m68k_reset(void)\r
+{\r
+ if (!initialised)\r
+ m68k_emulate(0);\r
+\r
+ // Si la CPU esta en ejecucion, salir con M68K_RUNNING\r
+ if (m68kcontext.execinfo & M68K_RUNNING)\r
+ return M68K_RUNNING;\r
+\r
+ // Resetear registros\r
+ memset(&m68kcontext.dreg[0], 0, 16*4);\r
+\r
+ // Resetear interrupts, execinfo y ASP\r
+ m68kcontext.interrupts[0] = 0;\r
+ m68kcontext.execinfo = 0;\r
+ ASP = 0;\r
+\r
+ // Fijar registro de estado\r
+ m68kcontext.sr = 0x2700;\r
+\r
+ // Obtener puntero de pila inicial y PC\r
+ AREG(7) = m68kcontext.read_long(0);\r
+ m68kcontext.pc = m68kcontext.read_long(4);\r
+\r
+#ifdef FAMEC_DEBUG\r
+ puts("Reset 68k done!\n");\r
+ printf("PC = 0x%08X\n",m68kcontext.pc);\r
+#endif\r
+\r
+ return M68K_OK;\r
+}\r
+\r
+\r
+/****************************************************************************/\r
+/* m68k_get_pc() */\r
+/* No recibe parametros */\r
+/* Retorna 68k PC */\r
+/****************************************************************************/\r
+u32 m68k_get_pc(M68K_CONTEXT *context)\r
+{\r
+ return (context->execinfo & M68K_RUNNING)?(u32)PC-BasePC:context->pc;\r
+}\r
+\r
+\r
+/***************************************************************************/\r
+/* m68k_get_register(register) */\r
+/* Parametro: Registro a obtener valor (indice) */\r
+/* Retorno: Valor del registro requerido */\r
+/* Observacion: En caso de que el indice no sea correcto */\r
+/* la funcion devolvera -1 */\r
+/***************************************************************************/\r
+u32 m68k_get_register(M68K_CONTEXT *context, m68k_register reg)\r
+{\r
+ M68K_CONTEXT *oldcontext = g_m68kcontext;\r
+ s32 ret;\r
+\r
+ g_m68kcontext = context;\r
+\r
+ switch (reg)\r
+ {\r
+ case M68K_REG_D0:\r
+ case M68K_REG_D1:\r
+ case M68K_REG_D2:\r
+ case M68K_REG_D3:\r
+ case M68K_REG_D4:\r
+ case M68K_REG_D5:\r
+ case M68K_REG_D6:\r
+ case M68K_REG_D7:\r
+ ret = DREG(reg - M68K_REG_D0);\r
+ break;\r
+\r
+ case M68K_REG_A0:\r
+ case M68K_REG_A1:\r
+ case M68K_REG_A2:\r
+ case M68K_REG_A3:\r
+ case M68K_REG_A4:\r
+ case M68K_REG_A5:\r
+ case M68K_REG_A6:\r
+ case M68K_REG_A7:\r
+ ret = AREG(reg - M68K_REG_A0);\r
+ break;\r
+\r
+ case M68K_REG_ASP:\r
+ ret = ASP;\r
+ break;\r
+\r
+ case M68K_REG_PC:\r
+ ret = m68k_get_pc(context);\r
+ break;\r
+\r
+ case M68K_REG_SR:\r
+ ret = m68kcontext.sr;\r
+ break;\r
+\r
+ default:\r
+ ret = M68K_INV_REG;\r
+ break;\r
+ }\r
+\r
+ g_m68kcontext = oldcontext;\r
+ return ret;\r
+}\r
+\r
+/***********************************************************************/\r
+/* m68k_set_register(register,value) */\r
+/* Parametros: Registro (indice) y valor a asignar */\r
+/* Retorno: Exito de la operacion */\r
+/* 0 La operacion se ha realizado satisfactoriamente */\r
+/* 1 El indice del registro no es valido (fuera de limites) */\r
+/***********************************************************************/\r
+u32 m68k_set_register(M68K_CONTEXT *context, m68k_register reg, u32 value)\r
+{\r
+ M68K_CONTEXT *oldcontext = g_m68kcontext;\r
+ s32 ret = M68K_OK;\r
+\r
+ g_m68kcontext = context;\r
+\r
+ switch (reg)\r
+ {\r
+ case M68K_REG_D0:\r
+ case M68K_REG_D1:\r
+ case M68K_REG_D2:\r
+ case M68K_REG_D3:\r
+ case M68K_REG_D4:\r
+ case M68K_REG_D5:\r
+ case M68K_REG_D6:\r
+ case M68K_REG_D7:\r
+ DREG(reg - M68K_REG_D0) = value;\r
+ break;\r
+\r
+ case M68K_REG_A0:\r
+ case M68K_REG_A1:\r
+ case M68K_REG_A2:\r
+ case M68K_REG_A3:\r
+ case M68K_REG_A4:\r
+ case M68K_REG_A5:\r
+ case M68K_REG_A6:\r
+ case M68K_REG_A7:\r
+ AREG(reg - M68K_REG_A0) = value;\r
+ break;\r
+\r
+ case M68K_REG_ASP:\r
+ ASP = value;\r
+ break;\r
+\r
+ case M68K_REG_PC:\r
+ if (m68kcontext.execinfo & M68K_RUNNING)\r
+ {\r
+ SET_PC(value & M68K_ADR_MASK);\r
+ }\r
+ else\r
+ {\r
+ m68kcontext.pc = value;\r
+ }\r
+ break;\r
+\r
+ case M68K_REG_SR:\r
+ m68kcontext.sr = value & 0xFFFF;\r
+ break;\r
+\r
+ default:\r
+ ret = M68K_INV_REG;\r
+ break;\r
+ }\r
+\r
+ g_m68kcontext = oldcontext;\r
+ return ret;\r
+}\r
+\r
+\r
+//////////////////////////\r
+// Chequea las interrupciones y las inicia\r
+static FAMEC_EXTRA_INLINE s32 interrupt_chk__(void)\r
+{\r
+ if (m68kcontext.interrupts[0] > flag_I)\r
+ return m68kcontext.interrupts[0];\r
+\r
+ return 0;\r
+}\r
+\r
+\r
+static FAMEC_EXTRA_INLINE void execute_exception(s32 vect)\r
+{\r
+ extern u32 flag_S;\r
+#ifndef FAMEC_IRQ_CYCLES\r
+ if ((vect<24)||(vect>31))\r
+#endif\r
+ m68kcontext.io_cycle_counter -= exception_cycle_table[vect];\r
+ {\r
+ u32 newPC;\r
+ u32 oldPC;\r
+ u32 oldSR = GET_SR;\r
+\r
+ PRE_IO\r
+\r
+ READ_LONG_F(vect * 4, newPC)\r
+\r
+ /* swap A7 and USP */\r
+ if (!flag_S)\r
+ {\r
+ u32 tmpSP;\r
+\r
+ tmpSP = ASP;\r
+ ASP = AREG(7);\r
+ AREG(7) = tmpSP;\r
+ }\r
+\r
+ oldPC = (u32)(PC) - BasePC;\r
+ PUSH_32_F(oldPC)\r
+ PUSH_16_F(oldSR)\r
+\r
+ /* adjust SR */\r
+ flag_S = M68K_SR_S;\r
+\r
+ newPC&=M68K_ADR_MASK;\r
+\r
+ SET_PC(newPC)\r
+\r
+ POST_IO\r
+ }\r
+}\r
+\r
+static FAMEC_EXTRA_INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, s32 addr, u16 spec_info)\r
+{\r
+ execute_exception(vect);\r
+ //if (!(m68kcontext.icust_handler && m68kcontext.icust_handler[vect]))\r
+ {\r
+ PUSH_16_F(inst_reg);\r
+ PUSH_32_F(addr);\r
+ PUSH_16_F(spec_info);\r
+ }\r
+}\r
+\r
+\r
+static void setup_jumptable(void);\r
+static u32 Opcode;\r
+\r
+#ifdef FAMEC_NO_GOTOS\r
+\r
+#define OPCODE(N_OP) static void OP_##N_OP(void)\r
+#define CAST_OP(N_OP) (opcode_func)&OP_##N_OP\r
+#include "famec_opcodes.h"\r
+#endif\r
+\r
+\r
+// main exec function\r
+//////////////////////\r
+\r
+int m68k_emulate(s32 cycles)\r
+{\r
+ if (!initialised)\r
+ {\r
+ init_jump_table();\r
+ return 0;\r
+ }\r
+\r
+ /* Comprobar si la CPU esta detenida debido a un doble error de bus */\r
+ if (m68kcontext.execinfo & M68K_FAULTED) return -1;\r
+\r
+ if (m68kcontext.execinfo & M68K_HALTED)\r
+ {\r
+ if (interrupt_chk__() <= 0)\r
+ {\r
+ return cycles;\r
+ }\r
+ m68kcontext.execinfo &= ~M68K_HALTED;\r
+ }\r
+\r
+#ifdef FAMEC_DEBUG\r
+ printf("Ciclos a ejecutar: %d\n",cycles);\r
+#endif\r
+\r
+ /* Poner la CPU en estado de ejecucion */\r
+ m68kcontext.execinfo |= M68K_RUNNING;\r
+\r
+ // Cache SR\r
+ SET_SR(m68kcontext.sr)\r
+\r
+ // Cache PPL\r
+ flag_I = M68K_PPL;\r
+\r
+ // Fijar PC\r
+ SET_PC(m68kcontext.pc)\r
+\r
+#ifdef FAMEC_DEBUG\r
+ printf("PC: %p\n",PC);\r
+ printf("BasePC: 0x%08x\n",BasePC);\r
+#endif\r
+\r
+ /* guardar ciclos de ejecucion solicitados */\r
+ m68kcontext.io_cycle_counter = cycles;\r
+ cycles_needed = 0;\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+ if (!(m68kcontext.execinfo & M68K_EMULATE_TRACE))\r
+#endif\r
+ {\r
+ s32 line=interrupt_chk__();\r
+ if (line>0)\r
+ {\r
+ /* comprobar si hay rutina de acknowledge */\r
+ if (m68kcontext.iack_handler != NULL)\r
+ m68kcontext.iack_handler(line);\r
+ else\r
+ m68kcontext.interrupts[0] = 0;\r
+\r
+ execute_exception(line + 0x18);\r
+ flag_I = (u32)line;\r
+ }\r
+#ifdef FAMEC_EMULATE_TRACE\r
+ else\r
+ if (flag_T)\r
+ {\r
+ m68kcontext.execinfo |= M68K_EMULATE_TRACE;\r
+ cycles_needed= m68kcontext.io_cycle_counter;\r
+ m68kcontext.io_cycle_counter=0;\r
+ }\r
+#endif\r
+ }\r
+\r
+\r
+#ifndef FAMEC_NO_GOTOS\r
+famec_Exec:\r
+#endif\r
+\r
+#ifdef FAMEC_DEBUG\r
+ printf("Antes de NEXT... PC = %p\n", PC);\r
+#endif\r
+\r
+ NEXT\r
+\r
+#ifndef FAMEC_NO_GOTOS\r
+\r
+#define OPCODE(N_OP) OP_##N_OP:\r
+#define CAST_OP(N_OP) (opcode_func)&&OP_##N_OP\r
+#include "famec_opcodes.h"\r
+\r
+ famec_Exec_End:\r
+#endif\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+ if (m68kcontext.execinfo & M68K_EMULATE_TRACE)\r
+ {\r
+ m68kcontext.io_cycle_counter= cycles_needed;\r
+ m68kcontext.execinfo &= ~M68K_EMULATE_TRACE;\r
+ m68kcontext.execinfo |= M68K_DO_TRACE;\r
+ execute_exception(M68K_TRACE_EX);\r
+ flag_T=0;\r
+ if (m68kcontext.io_cycle_counter > 0)\r
+ {\r
+ NEXT\r
+ }\r
+ }\r
+ else\r
+#endif\r
+ if (cycles_needed>0)\r
+ {\r
+ s32 line=interrupt_chk__();\r
+ m68kcontext.io_cycle_counter= cycles_needed;\r
+ if (line>0)\r
+ {\r
+ if (m68kcontext.iack_handler != NULL)\r
+ m68kcontext.iack_handler(line);\r
+ else\r
+ m68kcontext.interrupts[0] = 0;\r
+\r
+ execute_exception(line + 0x18);\r
+ flag_I = (u32)line;\r
+ }\r
+#ifdef FAMEC_EMULATE_TRACE\r
+ else if (!(flag_T))\r
+#endif\r
+ if (m68kcontext.io_cycle_counter > 0)\r
+ {\r
+ NEXT\r
+ }\r
+ }\r
+\r
+ m68kcontext.sr = GET_SR;\r
+ m68kcontext.pc = GET_PC;\r
+\r
+ m68kcontext.execinfo &= ~M68K_RUNNING;\r
+\r
+#ifdef FAMEC_DEBUG\r
+ printf("En really end...\n");\r
+ printf("PC: %p\n",PC);\r
+ printf("BasePC: 0x%08x\n",BasePC);\r
+ printf("pc: 0x%08x\n",m68kcontext.pc);\r
+#endif\r
+\r
+ return cycles - m68kcontext.io_cycle_counter;\r
+}\r
+\r
+\r
+\r
+static void init_jump_table(void)\r
+{\r
+ u32 i, j;\r
+\r
+ for(i = 0x0000; i <= 0xFFFF; i += 0x0001)\r
+ JumpTable[0x0000 + i] = CAST_OP(0x4AFC);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0000 + i] = CAST_OP(0x0000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0010 + i] = CAST_OP(0x0010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0018 + i] = CAST_OP(0x0018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0020 + i] = CAST_OP(0x0020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0028 + i] = CAST_OP(0x0028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0030 + i] = CAST_OP(0x0030);\r
+ JumpTable[0x0038] = CAST_OP(0x0038);\r
+ JumpTable[0x0039] = CAST_OP(0x0039);\r
+ JumpTable[0x001F] = CAST_OP(0x001F);\r
+ JumpTable[0x0027] = CAST_OP(0x0027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0040 + i] = CAST_OP(0x0040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0050 + i] = CAST_OP(0x0050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0058 + i] = CAST_OP(0x0058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0060 + i] = CAST_OP(0x0060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0068 + i] = CAST_OP(0x0068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0070 + i] = CAST_OP(0x0070);\r
+ JumpTable[0x0078] = CAST_OP(0x0078);\r
+ JumpTable[0x0079] = CAST_OP(0x0079);\r
+ JumpTable[0x005F] = CAST_OP(0x005F);\r
+ JumpTable[0x0067] = CAST_OP(0x0067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0080 + i] = CAST_OP(0x0080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0090 + i] = CAST_OP(0x0090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0098 + i] = CAST_OP(0x0098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x00A0 + i] = CAST_OP(0x00A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x00A8 + i] = CAST_OP(0x00A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x00B0 + i] = CAST_OP(0x00B0);\r
+ JumpTable[0x00B8] = CAST_OP(0x00B8);\r
+ JumpTable[0x00B9] = CAST_OP(0x00B9);\r
+ JumpTable[0x009F] = CAST_OP(0x009F);\r
+ JumpTable[0x00A7] = CAST_OP(0x00A7);\r
+ JumpTable[0x003C] = CAST_OP(0x003C);\r
+ JumpTable[0x007C] = CAST_OP(0x007C);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0200 + i] = CAST_OP(0x0200);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0210 + i] = CAST_OP(0x0210);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0218 + i] = CAST_OP(0x0218);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0220 + i] = CAST_OP(0x0220);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0228 + i] = CAST_OP(0x0228);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0230 + i] = CAST_OP(0x0230);\r
+ JumpTable[0x0238] = CAST_OP(0x0238);\r
+ JumpTable[0x0239] = CAST_OP(0x0239);\r
+ JumpTable[0x021F] = CAST_OP(0x021F);\r
+ JumpTable[0x0227] = CAST_OP(0x0227);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0240 + i] = CAST_OP(0x0240);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0250 + i] = CAST_OP(0x0250);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0258 + i] = CAST_OP(0x0258);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0260 + i] = CAST_OP(0x0260);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0268 + i] = CAST_OP(0x0268);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0270 + i] = CAST_OP(0x0270);\r
+ JumpTable[0x0278] = CAST_OP(0x0278);\r
+ JumpTable[0x0279] = CAST_OP(0x0279);\r
+ JumpTable[0x025F] = CAST_OP(0x025F);\r
+ JumpTable[0x0267] = CAST_OP(0x0267);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0280 + i] = CAST_OP(0x0280);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0290 + i] = CAST_OP(0x0290);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0298 + i] = CAST_OP(0x0298);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x02A0 + i] = CAST_OP(0x02A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x02A8 + i] = CAST_OP(0x02A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x02B0 + i] = CAST_OP(0x02B0);\r
+ JumpTable[0x02B8] = CAST_OP(0x02B8);\r
+ JumpTable[0x02B9] = CAST_OP(0x02B9);\r
+ JumpTable[0x029F] = CAST_OP(0x029F);\r
+ JumpTable[0x02A7] = CAST_OP(0x02A7);\r
+ JumpTable[0x023C] = CAST_OP(0x023C);\r
+ JumpTable[0x027C] = CAST_OP(0x027C);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A00 + i] = CAST_OP(0x0A00);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A10 + i] = CAST_OP(0x0A10);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0A18 + i] = CAST_OP(0x0A18);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0A20 + i] = CAST_OP(0x0A20);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A28 + i] = CAST_OP(0x0A28);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A30 + i] = CAST_OP(0x0A30);\r
+ JumpTable[0x0A38] = CAST_OP(0x0A38);\r
+ JumpTable[0x0A39] = CAST_OP(0x0A39);\r
+ JumpTable[0x0A1F] = CAST_OP(0x0A1F);\r
+ JumpTable[0x0A27] = CAST_OP(0x0A27);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A40 + i] = CAST_OP(0x0A40);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A50 + i] = CAST_OP(0x0A50);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0A58 + i] = CAST_OP(0x0A58);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0A60 + i] = CAST_OP(0x0A60);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A68 + i] = CAST_OP(0x0A68);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A70 + i] = CAST_OP(0x0A70);\r
+ JumpTable[0x0A78] = CAST_OP(0x0A78);\r
+ JumpTable[0x0A79] = CAST_OP(0x0A79);\r
+ JumpTable[0x0A5F] = CAST_OP(0x0A5F);\r
+ JumpTable[0x0A67] = CAST_OP(0x0A67);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A80 + i] = CAST_OP(0x0A80);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0A90 + i] = CAST_OP(0x0A90);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0A98 + i] = CAST_OP(0x0A98);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0AA0 + i] = CAST_OP(0x0AA0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0AA8 + i] = CAST_OP(0x0AA8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0AB0 + i] = CAST_OP(0x0AB0);\r
+ JumpTable[0x0AB8] = CAST_OP(0x0AB8);\r
+ JumpTable[0x0AB9] = CAST_OP(0x0AB9);\r
+ JumpTable[0x0A9F] = CAST_OP(0x0A9F);\r
+ JumpTable[0x0AA7] = CAST_OP(0x0AA7);\r
+ JumpTable[0x0A3C] = CAST_OP(0x0A3C);\r
+ JumpTable[0x0A7C] = CAST_OP(0x0A7C);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0400 + i] = CAST_OP(0x0400);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0410 + i] = CAST_OP(0x0410);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0418 + i] = CAST_OP(0x0418);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0420 + i] = CAST_OP(0x0420);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0428 + i] = CAST_OP(0x0428);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0430 + i] = CAST_OP(0x0430);\r
+ JumpTable[0x0438] = CAST_OP(0x0438);\r
+ JumpTable[0x0439] = CAST_OP(0x0439);\r
+ JumpTable[0x041F] = CAST_OP(0x041F);\r
+ JumpTable[0x0427] = CAST_OP(0x0427);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0440 + i] = CAST_OP(0x0440);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0450 + i] = CAST_OP(0x0450);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0458 + i] = CAST_OP(0x0458);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0460 + i] = CAST_OP(0x0460);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0468 + i] = CAST_OP(0x0468);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0470 + i] = CAST_OP(0x0470);\r
+ JumpTable[0x0478] = CAST_OP(0x0478);\r
+ JumpTable[0x0479] = CAST_OP(0x0479);\r
+ JumpTable[0x045F] = CAST_OP(0x045F);\r
+ JumpTable[0x0467] = CAST_OP(0x0467);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0480 + i] = CAST_OP(0x0480);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0490 + i] = CAST_OP(0x0490);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0498 + i] = CAST_OP(0x0498);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x04A0 + i] = CAST_OP(0x04A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x04A8 + i] = CAST_OP(0x04A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x04B0 + i] = CAST_OP(0x04B0);\r
+ JumpTable[0x04B8] = CAST_OP(0x04B8);\r
+ JumpTable[0x04B9] = CAST_OP(0x04B9);\r
+ JumpTable[0x049F] = CAST_OP(0x049F);\r
+ JumpTable[0x04A7] = CAST_OP(0x04A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0600 + i] = CAST_OP(0x0600);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0610 + i] = CAST_OP(0x0610);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0618 + i] = CAST_OP(0x0618);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0620 + i] = CAST_OP(0x0620);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0628 + i] = CAST_OP(0x0628);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0630 + i] = CAST_OP(0x0630);\r
+ JumpTable[0x0638] = CAST_OP(0x0638);\r
+ JumpTable[0x0639] = CAST_OP(0x0639);\r
+ JumpTable[0x061F] = CAST_OP(0x061F);\r
+ JumpTable[0x0627] = CAST_OP(0x0627);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0640 + i] = CAST_OP(0x0640);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0650 + i] = CAST_OP(0x0650);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0658 + i] = CAST_OP(0x0658);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0660 + i] = CAST_OP(0x0660);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0668 + i] = CAST_OP(0x0668);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0670 + i] = CAST_OP(0x0670);\r
+ JumpTable[0x0678] = CAST_OP(0x0678);\r
+ JumpTable[0x0679] = CAST_OP(0x0679);\r
+ JumpTable[0x065F] = CAST_OP(0x065F);\r
+ JumpTable[0x0667] = CAST_OP(0x0667);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0680 + i] = CAST_OP(0x0680);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0690 + i] = CAST_OP(0x0690);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0698 + i] = CAST_OP(0x0698);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x06A0 + i] = CAST_OP(0x06A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x06A8 + i] = CAST_OP(0x06A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x06B0 + i] = CAST_OP(0x06B0);\r
+ JumpTable[0x06B8] = CAST_OP(0x06B8);\r
+ JumpTable[0x06B9] = CAST_OP(0x06B9);\r
+ JumpTable[0x069F] = CAST_OP(0x069F);\r
+ JumpTable[0x06A7] = CAST_OP(0x06A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C00 + i] = CAST_OP(0x0C00);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C10 + i] = CAST_OP(0x0C10);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0C18 + i] = CAST_OP(0x0C18);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0C20 + i] = CAST_OP(0x0C20);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C28 + i] = CAST_OP(0x0C28);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C30 + i] = CAST_OP(0x0C30);\r
+ JumpTable[0x0C38] = CAST_OP(0x0C38);\r
+ JumpTable[0x0C39] = CAST_OP(0x0C39);\r
+ JumpTable[0x0C1F] = CAST_OP(0x0C1F);\r
+ JumpTable[0x0C27] = CAST_OP(0x0C27);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C40 + i] = CAST_OP(0x0C40);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C50 + i] = CAST_OP(0x0C50);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0C58 + i] = CAST_OP(0x0C58);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0C60 + i] = CAST_OP(0x0C60);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C68 + i] = CAST_OP(0x0C68);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C70 + i] = CAST_OP(0x0C70);\r
+ JumpTable[0x0C78] = CAST_OP(0x0C78);\r
+ JumpTable[0x0C79] = CAST_OP(0x0C79);\r
+ JumpTable[0x0C5F] = CAST_OP(0x0C5F);\r
+ JumpTable[0x0C67] = CAST_OP(0x0C67);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C80 + i] = CAST_OP(0x0C80);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0C90 + i] = CAST_OP(0x0C90);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0C98 + i] = CAST_OP(0x0C98);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0CA0 + i] = CAST_OP(0x0CA0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0CA8 + i] = CAST_OP(0x0CA8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0CB0 + i] = CAST_OP(0x0CB0);\r
+ JumpTable[0x0CB8] = CAST_OP(0x0CB8);\r
+ JumpTable[0x0CB9] = CAST_OP(0x0CB9);\r
+ JumpTable[0x0C9F] = CAST_OP(0x0C9F);\r
+ JumpTable[0x0CA7] = CAST_OP(0x0CA7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0800 + i] = CAST_OP(0x0800);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0810 + i] = CAST_OP(0x0810);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0818 + i] = CAST_OP(0x0818);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0820 + i] = CAST_OP(0x0820);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0828 + i] = CAST_OP(0x0828);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0830 + i] = CAST_OP(0x0830);\r
+ JumpTable[0x0838] = CAST_OP(0x0838);\r
+ JumpTable[0x0839] = CAST_OP(0x0839);\r
+ JumpTable[0x083A] = CAST_OP(0x083A);\r
+ JumpTable[0x083B] = CAST_OP(0x083B);\r
+ JumpTable[0x081F] = CAST_OP(0x081F);\r
+ JumpTable[0x0827] = CAST_OP(0x0827);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0840 + i] = CAST_OP(0x0840);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0850 + i] = CAST_OP(0x0850);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0858 + i] = CAST_OP(0x0858);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0860 + i] = CAST_OP(0x0860);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0868 + i] = CAST_OP(0x0868);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0870 + i] = CAST_OP(0x0870);\r
+ JumpTable[0x0878] = CAST_OP(0x0878);\r
+ JumpTable[0x0879] = CAST_OP(0x0879);\r
+ JumpTable[0x085F] = CAST_OP(0x085F);\r
+ JumpTable[0x0867] = CAST_OP(0x0867);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0880 + i] = CAST_OP(0x0880);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x0890 + i] = CAST_OP(0x0890);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x0898 + i] = CAST_OP(0x0898);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x08A0 + i] = CAST_OP(0x08A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x08A8 + i] = CAST_OP(0x08A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x08B0 + i] = CAST_OP(0x08B0);\r
+ JumpTable[0x08B8] = CAST_OP(0x08B8);\r
+ JumpTable[0x08B9] = CAST_OP(0x08B9);\r
+ JumpTable[0x089F] = CAST_OP(0x089F);\r
+ JumpTable[0x08A7] = CAST_OP(0x08A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x08C0 + i] = CAST_OP(0x08C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x08D0 + i] = CAST_OP(0x08D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x08D8 + i] = CAST_OP(0x08D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x08E0 + i] = CAST_OP(0x08E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x08E8 + i] = CAST_OP(0x08E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x08F0 + i] = CAST_OP(0x08F0);\r
+ JumpTable[0x08F8] = CAST_OP(0x08F8);\r
+ JumpTable[0x08F9] = CAST_OP(0x08F9);\r
+ JumpTable[0x08DF] = CAST_OP(0x08DF);\r
+ JumpTable[0x08E7] = CAST_OP(0x08E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0100 + i + j] = CAST_OP(0x0100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0110 + i + j] = CAST_OP(0x0110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0118 + i + j] = CAST_OP(0x0118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0120 + i + j] = CAST_OP(0x0120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0128 + i + j] = CAST_OP(0x0128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0130 + i + j] = CAST_OP(0x0130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x0138 + i] = CAST_OP(0x0138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x0139 + i] = CAST_OP(0x0139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x013A + i] = CAST_OP(0x013A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x013B + i] = CAST_OP(0x013B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x013C + i] = CAST_OP(0x013C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x011F + i] = CAST_OP(0x011F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x0127 + i] = CAST_OP(0x0127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0140 + i + j] = CAST_OP(0x0140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0150 + i + j] = CAST_OP(0x0150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0158 + i + j] = CAST_OP(0x0158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0160 + i + j] = CAST_OP(0x0160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0168 + i + j] = CAST_OP(0x0168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0170 + i + j] = CAST_OP(0x0170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x0178 + i] = CAST_OP(0x0178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x0179 + i] = CAST_OP(0x0179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x015F + i] = CAST_OP(0x015F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x0167 + i] = CAST_OP(0x0167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0180 + i + j] = CAST_OP(0x0180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0190 + i + j] = CAST_OP(0x0190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0198 + i + j] = CAST_OP(0x0198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01A0 + i + j] = CAST_OP(0x01A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01A8 + i + j] = CAST_OP(0x01A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01B0 + i + j] = CAST_OP(0x01B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01B8 + i] = CAST_OP(0x01B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01B9 + i] = CAST_OP(0x01B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x019F + i] = CAST_OP(0x019F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01A7 + i] = CAST_OP(0x01A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01C0 + i + j] = CAST_OP(0x01C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01D0 + i + j] = CAST_OP(0x01D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01D8 + i + j] = CAST_OP(0x01D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01E0 + i + j] = CAST_OP(0x01E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01E8 + i + j] = CAST_OP(0x01E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01F0 + i + j] = CAST_OP(0x01F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01F8 + i] = CAST_OP(0x01F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01F9 + i] = CAST_OP(0x01F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01DF + i] = CAST_OP(0x01DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x01E7 + i] = CAST_OP(0x01E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0108 + i + j] = CAST_OP(0x0108);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0148 + i + j] = CAST_OP(0x0148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x0188 + i + j] = CAST_OP(0x0188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x01C8 + i + j] = CAST_OP(0x01C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1000 + i + j] = CAST_OP(0x1000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1080 + i + j] = CAST_OP(0x1080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10C0 + i + j] = CAST_OP(0x10C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1100 + i + j] = CAST_OP(0x1100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1140 + i + j] = CAST_OP(0x1140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1180 + i + j] = CAST_OP(0x1180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x11C0 + i] = CAST_OP(0x11C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x13C0 + i] = CAST_OP(0x13C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1EC0 + i] = CAST_OP(0x1EC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1F00 + i] = CAST_OP(0x1F00);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1008 + i + j] = CAST_OP(0x1008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1088 + i + j] = CAST_OP(0x1088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10C8 + i + j] = CAST_OP(0x10C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1108 + i + j] = CAST_OP(0x1108);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1148 + i + j] = CAST_OP(0x1148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1188 + i + j] = CAST_OP(0x1188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x11C8 + i] = CAST_OP(0x11C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x13C8 + i] = CAST_OP(0x13C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1EC8 + i] = CAST_OP(0x1EC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1F08 + i] = CAST_OP(0x1F08);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1010 + i + j] = CAST_OP(0x1010);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1090 + i + j] = CAST_OP(0x1090);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10D0 + i + j] = CAST_OP(0x10D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1110 + i + j] = CAST_OP(0x1110);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1150 + i + j] = CAST_OP(0x1150);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1190 + i + j] = CAST_OP(0x1190);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x11D0 + i] = CAST_OP(0x11D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x13D0 + i] = CAST_OP(0x13D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1ED0 + i] = CAST_OP(0x1ED0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1F10 + i] = CAST_OP(0x1F10);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1018 + i + j] = CAST_OP(0x1018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1098 + i + j] = CAST_OP(0x1098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10D8 + i + j] = CAST_OP(0x10D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1118 + i + j] = CAST_OP(0x1118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1158 + i + j] = CAST_OP(0x1158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1198 + i + j] = CAST_OP(0x1198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x11D8 + i] = CAST_OP(0x11D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x13D8 + i] = CAST_OP(0x13D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x1ED8 + i] = CAST_OP(0x1ED8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x1F18 + i] = CAST_OP(0x1F18);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1020 + i + j] = CAST_OP(0x1020);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x10A0 + i + j] = CAST_OP(0x10A0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10E0 + i + j] = CAST_OP(0x10E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1120 + i + j] = CAST_OP(0x1120);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1160 + i + j] = CAST_OP(0x1160);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x11A0 + i + j] = CAST_OP(0x11A0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x11E0 + i] = CAST_OP(0x11E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x13E0 + i] = CAST_OP(0x13E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x1EE0 + i] = CAST_OP(0x1EE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x1F20 + i] = CAST_OP(0x1F20);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1028 + i + j] = CAST_OP(0x1028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x10A8 + i + j] = CAST_OP(0x10A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10E8 + i + j] = CAST_OP(0x10E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1128 + i + j] = CAST_OP(0x1128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1168 + i + j] = CAST_OP(0x1168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x11A8 + i + j] = CAST_OP(0x11A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x11E8 + i] = CAST_OP(0x11E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x13E8 + i] = CAST_OP(0x13E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1EE8 + i] = CAST_OP(0x1EE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1F28 + i] = CAST_OP(0x1F28);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1030 + i + j] = CAST_OP(0x1030);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x10B0 + i + j] = CAST_OP(0x10B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x10F0 + i + j] = CAST_OP(0x10F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x1130 + i + j] = CAST_OP(0x1130);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x1170 + i + j] = CAST_OP(0x1170);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x11B0 + i + j] = CAST_OP(0x11B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x11F0 + i] = CAST_OP(0x11F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x13F0 + i] = CAST_OP(0x13F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1EF0 + i] = CAST_OP(0x1EF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x1F30 + i] = CAST_OP(0x1F30);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x1038 + i] = CAST_OP(0x1038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x10B8 + i] = CAST_OP(0x10B8);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10F8 + i] = CAST_OP(0x10F8);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x1138 + i] = CAST_OP(0x1138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x1178 + i] = CAST_OP(0x1178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x11B8 + i] = CAST_OP(0x11B8);\r
+ JumpTable[0x11F8] = CAST_OP(0x11F8);\r
+ JumpTable[0x13F8] = CAST_OP(0x13F8);\r
+ JumpTable[0x1EF8] = CAST_OP(0x1EF8);\r
+ JumpTable[0x1F38] = CAST_OP(0x1F38);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x1039 + i] = CAST_OP(0x1039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x10B9 + i] = CAST_OP(0x10B9);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10F9 + i] = CAST_OP(0x10F9);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x1139 + i] = CAST_OP(0x1139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x1179 + i] = CAST_OP(0x1179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x11B9 + i] = CAST_OP(0x11B9);\r
+ JumpTable[0x11F9] = CAST_OP(0x11F9);\r
+ JumpTable[0x13F9] = CAST_OP(0x13F9);\r
+ JumpTable[0x1EF9] = CAST_OP(0x1EF9);\r
+ JumpTable[0x1F39] = CAST_OP(0x1F39);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x103A + i] = CAST_OP(0x103A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x10BA + i] = CAST_OP(0x10BA);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10FA + i] = CAST_OP(0x10FA);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x113A + i] = CAST_OP(0x113A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x117A + i] = CAST_OP(0x117A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x11BA + i] = CAST_OP(0x11BA);\r
+ JumpTable[0x11FA] = CAST_OP(0x11FA);\r
+ JumpTable[0x13FA] = CAST_OP(0x13FA);\r
+ JumpTable[0x1EFA] = CAST_OP(0x1EFA);\r
+ JumpTable[0x1F3A] = CAST_OP(0x1F3A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x103B + i] = CAST_OP(0x103B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x10BB + i] = CAST_OP(0x10BB);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10FB + i] = CAST_OP(0x10FB);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x113B + i] = CAST_OP(0x113B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x117B + i] = CAST_OP(0x117B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x11BB + i] = CAST_OP(0x11BB);\r
+ JumpTable[0x11FB] = CAST_OP(0x11FB);\r
+ JumpTable[0x13FB] = CAST_OP(0x13FB);\r
+ JumpTable[0x1EFB] = CAST_OP(0x1EFB);\r
+ JumpTable[0x1F3B] = CAST_OP(0x1F3B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x103C + i] = CAST_OP(0x103C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x10BC + i] = CAST_OP(0x10BC);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10FC + i] = CAST_OP(0x10FC);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x113C + i] = CAST_OP(0x113C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x117C + i] = CAST_OP(0x117C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x11BC + i] = CAST_OP(0x11BC);\r
+ JumpTable[0x11FC] = CAST_OP(0x11FC);\r
+ JumpTable[0x13FC] = CAST_OP(0x13FC);\r
+ JumpTable[0x1EFC] = CAST_OP(0x1EFC);\r
+ JumpTable[0x1F3C] = CAST_OP(0x1F3C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x101F + i] = CAST_OP(0x101F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x109F + i] = CAST_OP(0x109F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10DF + i] = CAST_OP(0x10DF);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x111F + i] = CAST_OP(0x111F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x115F + i] = CAST_OP(0x115F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x119F + i] = CAST_OP(0x119F);\r
+ JumpTable[0x11DF] = CAST_OP(0x11DF);\r
+ JumpTable[0x13DF] = CAST_OP(0x13DF);\r
+ JumpTable[0x1EDF] = CAST_OP(0x1EDF);\r
+ JumpTable[0x1F1F] = CAST_OP(0x1F1F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x1027 + i] = CAST_OP(0x1027);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x10A7 + i] = CAST_OP(0x10A7);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x10E7 + i] = CAST_OP(0x10E7);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x1127 + i] = CAST_OP(0x1127);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x1167 + i] = CAST_OP(0x1167);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x11A7 + i] = CAST_OP(0x11A7);\r
+ JumpTable[0x11E7] = CAST_OP(0x11E7);\r
+ JumpTable[0x13E7] = CAST_OP(0x13E7);\r
+ JumpTable[0x1EE7] = CAST_OP(0x1EE7);\r
+ JumpTable[0x1F27] = CAST_OP(0x1F27);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2000 + i + j] = CAST_OP(0x2000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2080 + i + j] = CAST_OP(0x2080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20C0 + i + j] = CAST_OP(0x20C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2100 + i + j] = CAST_OP(0x2100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2140 + i + j] = CAST_OP(0x2140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2180 + i + j] = CAST_OP(0x2180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x21C0 + i] = CAST_OP(0x21C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x23C0 + i] = CAST_OP(0x23C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2EC0 + i] = CAST_OP(0x2EC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2F00 + i] = CAST_OP(0x2F00);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2008 + i + j] = CAST_OP(0x2008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2088 + i + j] = CAST_OP(0x2088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20C8 + i + j] = CAST_OP(0x20C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2108 + i + j] = CAST_OP(0x2108);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2148 + i + j] = CAST_OP(0x2148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2188 + i + j] = CAST_OP(0x2188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x21C8 + i] = CAST_OP(0x21C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x23C8 + i] = CAST_OP(0x23C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2EC8 + i] = CAST_OP(0x2EC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2F08 + i] = CAST_OP(0x2F08);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2010 + i + j] = CAST_OP(0x2010);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2090 + i + j] = CAST_OP(0x2090);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20D0 + i + j] = CAST_OP(0x20D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2110 + i + j] = CAST_OP(0x2110);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2150 + i + j] = CAST_OP(0x2150);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2190 + i + j] = CAST_OP(0x2190);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x21D0 + i] = CAST_OP(0x21D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x23D0 + i] = CAST_OP(0x23D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2ED0 + i] = CAST_OP(0x2ED0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2F10 + i] = CAST_OP(0x2F10);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2018 + i + j] = CAST_OP(0x2018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2098 + i + j] = CAST_OP(0x2098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20D8 + i + j] = CAST_OP(0x20D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2118 + i + j] = CAST_OP(0x2118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2158 + i + j] = CAST_OP(0x2158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2198 + i + j] = CAST_OP(0x2198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x21D8 + i] = CAST_OP(0x21D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x23D8 + i] = CAST_OP(0x23D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x2ED8 + i] = CAST_OP(0x2ED8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x2F18 + i] = CAST_OP(0x2F18);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2020 + i + j] = CAST_OP(0x2020);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x20A0 + i + j] = CAST_OP(0x20A0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20E0 + i + j] = CAST_OP(0x20E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2120 + i + j] = CAST_OP(0x2120);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2160 + i + j] = CAST_OP(0x2160);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x21A0 + i + j] = CAST_OP(0x21A0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x21E0 + i] = CAST_OP(0x21E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x23E0 + i] = CAST_OP(0x23E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x2EE0 + i] = CAST_OP(0x2EE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x2F20 + i] = CAST_OP(0x2F20);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2028 + i + j] = CAST_OP(0x2028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x20A8 + i + j] = CAST_OP(0x20A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20E8 + i + j] = CAST_OP(0x20E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2128 + i + j] = CAST_OP(0x2128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2168 + i + j] = CAST_OP(0x2168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x21A8 + i + j] = CAST_OP(0x21A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x21E8 + i] = CAST_OP(0x21E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x23E8 + i] = CAST_OP(0x23E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2EE8 + i] = CAST_OP(0x2EE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2F28 + i] = CAST_OP(0x2F28);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2030 + i + j] = CAST_OP(0x2030);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x20B0 + i + j] = CAST_OP(0x20B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x20F0 + i + j] = CAST_OP(0x20F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x2130 + i + j] = CAST_OP(0x2130);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2170 + i + j] = CAST_OP(0x2170);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x21B0 + i + j] = CAST_OP(0x21B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x21F0 + i] = CAST_OP(0x21F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x23F0 + i] = CAST_OP(0x23F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2EF0 + i] = CAST_OP(0x2EF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x2F30 + i] = CAST_OP(0x2F30);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2038 + i] = CAST_OP(0x2038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x20B8 + i] = CAST_OP(0x20B8);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20F8 + i] = CAST_OP(0x20F8);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x2138 + i] = CAST_OP(0x2138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2178 + i] = CAST_OP(0x2178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x21B8 + i] = CAST_OP(0x21B8);\r
+ JumpTable[0x21F8] = CAST_OP(0x21F8);\r
+ JumpTable[0x23F8] = CAST_OP(0x23F8);\r
+ JumpTable[0x2EF8] = CAST_OP(0x2EF8);\r
+ JumpTable[0x2F38] = CAST_OP(0x2F38);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2039 + i] = CAST_OP(0x2039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x20B9 + i] = CAST_OP(0x20B9);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20F9 + i] = CAST_OP(0x20F9);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x2139 + i] = CAST_OP(0x2139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2179 + i] = CAST_OP(0x2179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x21B9 + i] = CAST_OP(0x21B9);\r
+ JumpTable[0x21F9] = CAST_OP(0x21F9);\r
+ JumpTable[0x23F9] = CAST_OP(0x23F9);\r
+ JumpTable[0x2EF9] = CAST_OP(0x2EF9);\r
+ JumpTable[0x2F39] = CAST_OP(0x2F39);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x203A + i] = CAST_OP(0x203A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x20BA + i] = CAST_OP(0x20BA);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20FA + i] = CAST_OP(0x20FA);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x213A + i] = CAST_OP(0x213A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x217A + i] = CAST_OP(0x217A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x21BA + i] = CAST_OP(0x21BA);\r
+ JumpTable[0x21FA] = CAST_OP(0x21FA);\r
+ JumpTable[0x23FA] = CAST_OP(0x23FA);\r
+ JumpTable[0x2EFA] = CAST_OP(0x2EFA);\r
+ JumpTable[0x2F3A] = CAST_OP(0x2F3A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x203B + i] = CAST_OP(0x203B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x20BB + i] = CAST_OP(0x20BB);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20FB + i] = CAST_OP(0x20FB);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x213B + i] = CAST_OP(0x213B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x217B + i] = CAST_OP(0x217B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x21BB + i] = CAST_OP(0x21BB);\r
+ JumpTable[0x21FB] = CAST_OP(0x21FB);\r
+ JumpTable[0x23FB] = CAST_OP(0x23FB);\r
+ JumpTable[0x2EFB] = CAST_OP(0x2EFB);\r
+ JumpTable[0x2F3B] = CAST_OP(0x2F3B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x203C + i] = CAST_OP(0x203C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x20BC + i] = CAST_OP(0x20BC);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20FC + i] = CAST_OP(0x20FC);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x213C + i] = CAST_OP(0x213C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x217C + i] = CAST_OP(0x217C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x21BC + i] = CAST_OP(0x21BC);\r
+ JumpTable[0x21FC] = CAST_OP(0x21FC);\r
+ JumpTable[0x23FC] = CAST_OP(0x23FC);\r
+ JumpTable[0x2EFC] = CAST_OP(0x2EFC);\r
+ JumpTable[0x2F3C] = CAST_OP(0x2F3C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x201F + i] = CAST_OP(0x201F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x209F + i] = CAST_OP(0x209F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20DF + i] = CAST_OP(0x20DF);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x211F + i] = CAST_OP(0x211F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x215F + i] = CAST_OP(0x215F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x219F + i] = CAST_OP(0x219F);\r
+ JumpTable[0x21DF] = CAST_OP(0x21DF);\r
+ JumpTable[0x23DF] = CAST_OP(0x23DF);\r
+ JumpTable[0x2EDF] = CAST_OP(0x2EDF);\r
+ JumpTable[0x2F1F] = CAST_OP(0x2F1F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2027 + i] = CAST_OP(0x2027);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x20A7 + i] = CAST_OP(0x20A7);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x20E7 + i] = CAST_OP(0x20E7);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x2127 + i] = CAST_OP(0x2127);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2167 + i] = CAST_OP(0x2167);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x21A7 + i] = CAST_OP(0x21A7);\r
+ JumpTable[0x21E7] = CAST_OP(0x21E7);\r
+ JumpTable[0x23E7] = CAST_OP(0x23E7);\r
+ JumpTable[0x2EE7] = CAST_OP(0x2EE7);\r
+ JumpTable[0x2F27] = CAST_OP(0x2F27);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3000 + i + j] = CAST_OP(0x3000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3080 + i + j] = CAST_OP(0x3080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30C0 + i + j] = CAST_OP(0x30C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3100 + i + j] = CAST_OP(0x3100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3140 + i + j] = CAST_OP(0x3140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3180 + i + j] = CAST_OP(0x3180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x31C0 + i] = CAST_OP(0x31C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x33C0 + i] = CAST_OP(0x33C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3EC0 + i] = CAST_OP(0x3EC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3F00 + i] = CAST_OP(0x3F00);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3008 + i + j] = CAST_OP(0x3008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3088 + i + j] = CAST_OP(0x3088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30C8 + i + j] = CAST_OP(0x30C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3108 + i + j] = CAST_OP(0x3108);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3148 + i + j] = CAST_OP(0x3148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3188 + i + j] = CAST_OP(0x3188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x31C8 + i] = CAST_OP(0x31C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x33C8 + i] = CAST_OP(0x33C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3EC8 + i] = CAST_OP(0x3EC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3F08 + i] = CAST_OP(0x3F08);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3010 + i + j] = CAST_OP(0x3010);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3090 + i + j] = CAST_OP(0x3090);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30D0 + i + j] = CAST_OP(0x30D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3110 + i + j] = CAST_OP(0x3110);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3150 + i + j] = CAST_OP(0x3150);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3190 + i + j] = CAST_OP(0x3190);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x31D0 + i] = CAST_OP(0x31D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x33D0 + i] = CAST_OP(0x33D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3ED0 + i] = CAST_OP(0x3ED0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3F10 + i] = CAST_OP(0x3F10);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3018 + i + j] = CAST_OP(0x3018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3098 + i + j] = CAST_OP(0x3098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30D8 + i + j] = CAST_OP(0x30D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3118 + i + j] = CAST_OP(0x3118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3158 + i + j] = CAST_OP(0x3158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3198 + i + j] = CAST_OP(0x3198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x31D8 + i] = CAST_OP(0x31D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x33D8 + i] = CAST_OP(0x33D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x3ED8 + i] = CAST_OP(0x3ED8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x3F18 + i] = CAST_OP(0x3F18);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3020 + i + j] = CAST_OP(0x3020);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x30A0 + i + j] = CAST_OP(0x30A0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30E0 + i + j] = CAST_OP(0x30E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3120 + i + j] = CAST_OP(0x3120);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3160 + i + j] = CAST_OP(0x3160);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x31A0 + i + j] = CAST_OP(0x31A0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x31E0 + i] = CAST_OP(0x31E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x33E0 + i] = CAST_OP(0x33E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x3EE0 + i] = CAST_OP(0x3EE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x3F20 + i] = CAST_OP(0x3F20);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3028 + i + j] = CAST_OP(0x3028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x30A8 + i + j] = CAST_OP(0x30A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30E8 + i + j] = CAST_OP(0x30E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3128 + i + j] = CAST_OP(0x3128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3168 + i + j] = CAST_OP(0x3168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x31A8 + i + j] = CAST_OP(0x31A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x31E8 + i] = CAST_OP(0x31E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x33E8 + i] = CAST_OP(0x33E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3EE8 + i] = CAST_OP(0x3EE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3F28 + i] = CAST_OP(0x3F28);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3030 + i + j] = CAST_OP(0x3030);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x30B0 + i + j] = CAST_OP(0x30B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x30F0 + i + j] = CAST_OP(0x30F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x3130 + i + j] = CAST_OP(0x3130);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3170 + i + j] = CAST_OP(0x3170);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x31B0 + i + j] = CAST_OP(0x31B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x31F0 + i] = CAST_OP(0x31F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x33F0 + i] = CAST_OP(0x33F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3EF0 + i] = CAST_OP(0x3EF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x3F30 + i] = CAST_OP(0x3F30);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3038 + i] = CAST_OP(0x3038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x30B8 + i] = CAST_OP(0x30B8);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30F8 + i] = CAST_OP(0x30F8);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x3138 + i] = CAST_OP(0x3138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3178 + i] = CAST_OP(0x3178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x31B8 + i] = CAST_OP(0x31B8);\r
+ JumpTable[0x31F8] = CAST_OP(0x31F8);\r
+ JumpTable[0x33F8] = CAST_OP(0x33F8);\r
+ JumpTable[0x3EF8] = CAST_OP(0x3EF8);\r
+ JumpTable[0x3F38] = CAST_OP(0x3F38);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3039 + i] = CAST_OP(0x3039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x30B9 + i] = CAST_OP(0x30B9);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30F9 + i] = CAST_OP(0x30F9);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x3139 + i] = CAST_OP(0x3139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3179 + i] = CAST_OP(0x3179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x31B9 + i] = CAST_OP(0x31B9);\r
+ JumpTable[0x31F9] = CAST_OP(0x31F9);\r
+ JumpTable[0x33F9] = CAST_OP(0x33F9);\r
+ JumpTable[0x3EF9] = CAST_OP(0x3EF9);\r
+ JumpTable[0x3F39] = CAST_OP(0x3F39);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x303A + i] = CAST_OP(0x303A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x30BA + i] = CAST_OP(0x30BA);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30FA + i] = CAST_OP(0x30FA);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x313A + i] = CAST_OP(0x313A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x317A + i] = CAST_OP(0x317A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x31BA + i] = CAST_OP(0x31BA);\r
+ JumpTable[0x31FA] = CAST_OP(0x31FA);\r
+ JumpTable[0x33FA] = CAST_OP(0x33FA);\r
+ JumpTable[0x3EFA] = CAST_OP(0x3EFA);\r
+ JumpTable[0x3F3A] = CAST_OP(0x3F3A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x303B + i] = CAST_OP(0x303B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x30BB + i] = CAST_OP(0x30BB);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30FB + i] = CAST_OP(0x30FB);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x313B + i] = CAST_OP(0x313B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x317B + i] = CAST_OP(0x317B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x31BB + i] = CAST_OP(0x31BB);\r
+ JumpTable[0x31FB] = CAST_OP(0x31FB);\r
+ JumpTable[0x33FB] = CAST_OP(0x33FB);\r
+ JumpTable[0x3EFB] = CAST_OP(0x3EFB);\r
+ JumpTable[0x3F3B] = CAST_OP(0x3F3B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x303C + i] = CAST_OP(0x303C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x30BC + i] = CAST_OP(0x30BC);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30FC + i] = CAST_OP(0x30FC);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x313C + i] = CAST_OP(0x313C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x317C + i] = CAST_OP(0x317C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x31BC + i] = CAST_OP(0x31BC);\r
+ JumpTable[0x31FC] = CAST_OP(0x31FC);\r
+ JumpTable[0x33FC] = CAST_OP(0x33FC);\r
+ JumpTable[0x3EFC] = CAST_OP(0x3EFC);\r
+ JumpTable[0x3F3C] = CAST_OP(0x3F3C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x301F + i] = CAST_OP(0x301F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x309F + i] = CAST_OP(0x309F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30DF + i] = CAST_OP(0x30DF);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x311F + i] = CAST_OP(0x311F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x315F + i] = CAST_OP(0x315F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x319F + i] = CAST_OP(0x319F);\r
+ JumpTable[0x31DF] = CAST_OP(0x31DF);\r
+ JumpTable[0x33DF] = CAST_OP(0x33DF);\r
+ JumpTable[0x3EDF] = CAST_OP(0x3EDF);\r
+ JumpTable[0x3F1F] = CAST_OP(0x3F1F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3027 + i] = CAST_OP(0x3027);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x30A7 + i] = CAST_OP(0x30A7);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x30E7 + i] = CAST_OP(0x30E7);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x3127 + i] = CAST_OP(0x3127);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3167 + i] = CAST_OP(0x3167);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x31A7 + i] = CAST_OP(0x31A7);\r
+ JumpTable[0x31E7] = CAST_OP(0x31E7);\r
+ JumpTable[0x33E7] = CAST_OP(0x33E7);\r
+ JumpTable[0x3EE7] = CAST_OP(0x3EE7);\r
+ JumpTable[0x3F27] = CAST_OP(0x3F27);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2040 + i + j] = CAST_OP(0x2040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2048 + i + j] = CAST_OP(0x2048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2050 + i + j] = CAST_OP(0x2050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2058 + i + j] = CAST_OP(0x2058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2060 + i + j] = CAST_OP(0x2060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2068 + i + j] = CAST_OP(0x2068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x2070 + i + j] = CAST_OP(0x2070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2078 + i] = CAST_OP(0x2078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2079 + i] = CAST_OP(0x2079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x207A + i] = CAST_OP(0x207A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x207B + i] = CAST_OP(0x207B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x207C + i] = CAST_OP(0x207C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x205F + i] = CAST_OP(0x205F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x2067 + i] = CAST_OP(0x2067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3040 + i + j] = CAST_OP(0x3040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3048 + i + j] = CAST_OP(0x3048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3050 + i + j] = CAST_OP(0x3050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3058 + i + j] = CAST_OP(0x3058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3060 + i + j] = CAST_OP(0x3060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3068 + i + j] = CAST_OP(0x3068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x3070 + i + j] = CAST_OP(0x3070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3078 + i] = CAST_OP(0x3078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3079 + i] = CAST_OP(0x3079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x307A + i] = CAST_OP(0x307A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x307B + i] = CAST_OP(0x307B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x307C + i] = CAST_OP(0x307C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x305F + i] = CAST_OP(0x305F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x3067 + i] = CAST_OP(0x3067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4000 + i] = CAST_OP(0x4000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4010 + i] = CAST_OP(0x4010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4018 + i] = CAST_OP(0x4018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4020 + i] = CAST_OP(0x4020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4028 + i] = CAST_OP(0x4028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4030 + i] = CAST_OP(0x4030);\r
+ JumpTable[0x4038] = CAST_OP(0x4038);\r
+ JumpTable[0x4039] = CAST_OP(0x4039);\r
+ JumpTable[0x401F] = CAST_OP(0x401F);\r
+ JumpTable[0x4027] = CAST_OP(0x4027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4040 + i] = CAST_OP(0x4040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4050 + i] = CAST_OP(0x4050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4058 + i] = CAST_OP(0x4058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4060 + i] = CAST_OP(0x4060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4068 + i] = CAST_OP(0x4068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4070 + i] = CAST_OP(0x4070);\r
+ JumpTable[0x4078] = CAST_OP(0x4078);\r
+ JumpTable[0x4079] = CAST_OP(0x4079);\r
+ JumpTable[0x405F] = CAST_OP(0x405F);\r
+ JumpTable[0x4067] = CAST_OP(0x4067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4080 + i] = CAST_OP(0x4080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4090 + i] = CAST_OP(0x4090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4098 + i] = CAST_OP(0x4098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x40A0 + i] = CAST_OP(0x40A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x40A8 + i] = CAST_OP(0x40A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x40B0 + i] = CAST_OP(0x40B0);\r
+ JumpTable[0x40B8] = CAST_OP(0x40B8);\r
+ JumpTable[0x40B9] = CAST_OP(0x40B9);\r
+ JumpTable[0x409F] = CAST_OP(0x409F);\r
+ JumpTable[0x40A7] = CAST_OP(0x40A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4200 + i] = CAST_OP(0x4200);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4210 + i] = CAST_OP(0x4210);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4218 + i] = CAST_OP(0x4218);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4220 + i] = CAST_OP(0x4220);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4228 + i] = CAST_OP(0x4228);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4230 + i] = CAST_OP(0x4230);\r
+ JumpTable[0x4238] = CAST_OP(0x4238);\r
+ JumpTable[0x4239] = CAST_OP(0x4239);\r
+ JumpTable[0x421F] = CAST_OP(0x421F);\r
+ JumpTable[0x4227] = CAST_OP(0x4227);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4240 + i] = CAST_OP(0x4240);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4250 + i] = CAST_OP(0x4250);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4258 + i] = CAST_OP(0x4258);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4260 + i] = CAST_OP(0x4260);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4268 + i] = CAST_OP(0x4268);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4270 + i] = CAST_OP(0x4270);\r
+ JumpTable[0x4278] = CAST_OP(0x4278);\r
+ JumpTable[0x4279] = CAST_OP(0x4279);\r
+ JumpTable[0x425F] = CAST_OP(0x425F);\r
+ JumpTable[0x4267] = CAST_OP(0x4267);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4280 + i] = CAST_OP(0x4280);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4290 + i] = CAST_OP(0x4290);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4298 + i] = CAST_OP(0x4298);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x42A0 + i] = CAST_OP(0x42A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x42A8 + i] = CAST_OP(0x42A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x42B0 + i] = CAST_OP(0x42B0);\r
+ JumpTable[0x42B8] = CAST_OP(0x42B8);\r
+ JumpTable[0x42B9] = CAST_OP(0x42B9);\r
+ JumpTable[0x429F] = CAST_OP(0x429F);\r
+ JumpTable[0x42A7] = CAST_OP(0x42A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4400 + i] = CAST_OP(0x4400);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4410 + i] = CAST_OP(0x4410);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4418 + i] = CAST_OP(0x4418);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4420 + i] = CAST_OP(0x4420);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4428 + i] = CAST_OP(0x4428);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4430 + i] = CAST_OP(0x4430);\r
+ JumpTable[0x4438] = CAST_OP(0x4438);\r
+ JumpTable[0x4439] = CAST_OP(0x4439);\r
+ JumpTable[0x441F] = CAST_OP(0x441F);\r
+ JumpTable[0x4427] = CAST_OP(0x4427);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4440 + i] = CAST_OP(0x4440);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4450 + i] = CAST_OP(0x4450);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4458 + i] = CAST_OP(0x4458);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4460 + i] = CAST_OP(0x4460);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4468 + i] = CAST_OP(0x4468);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4470 + i] = CAST_OP(0x4470);\r
+ JumpTable[0x4478] = CAST_OP(0x4478);\r
+ JumpTable[0x4479] = CAST_OP(0x4479);\r
+ JumpTable[0x445F] = CAST_OP(0x445F);\r
+ JumpTable[0x4467] = CAST_OP(0x4467);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4480 + i] = CAST_OP(0x4480);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4490 + i] = CAST_OP(0x4490);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4498 + i] = CAST_OP(0x4498);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x44A0 + i] = CAST_OP(0x44A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x44A8 + i] = CAST_OP(0x44A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x44B0 + i] = CAST_OP(0x44B0);\r
+ JumpTable[0x44B8] = CAST_OP(0x44B8);\r
+ JumpTable[0x44B9] = CAST_OP(0x44B9);\r
+ JumpTable[0x449F] = CAST_OP(0x449F);\r
+ JumpTable[0x44A7] = CAST_OP(0x44A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4600 + i] = CAST_OP(0x4600);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4610 + i] = CAST_OP(0x4610);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4618 + i] = CAST_OP(0x4618);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4620 + i] = CAST_OP(0x4620);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4628 + i] = CAST_OP(0x4628);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4630 + i] = CAST_OP(0x4630);\r
+ JumpTable[0x4638] = CAST_OP(0x4638);\r
+ JumpTable[0x4639] = CAST_OP(0x4639);\r
+ JumpTable[0x461F] = CAST_OP(0x461F);\r
+ JumpTable[0x4627] = CAST_OP(0x4627);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4640 + i] = CAST_OP(0x4640);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4650 + i] = CAST_OP(0x4650);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4658 + i] = CAST_OP(0x4658);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4660 + i] = CAST_OP(0x4660);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4668 + i] = CAST_OP(0x4668);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4670 + i] = CAST_OP(0x4670);\r
+ JumpTable[0x4678] = CAST_OP(0x4678);\r
+ JumpTable[0x4679] = CAST_OP(0x4679);\r
+ JumpTable[0x465F] = CAST_OP(0x465F);\r
+ JumpTable[0x4667] = CAST_OP(0x4667);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4680 + i] = CAST_OP(0x4680);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4690 + i] = CAST_OP(0x4690);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4698 + i] = CAST_OP(0x4698);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x46A0 + i] = CAST_OP(0x46A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x46A8 + i] = CAST_OP(0x46A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x46B0 + i] = CAST_OP(0x46B0);\r
+ JumpTable[0x46B8] = CAST_OP(0x46B8);\r
+ JumpTable[0x46B9] = CAST_OP(0x46B9);\r
+ JumpTable[0x469F] = CAST_OP(0x469F);\r
+ JumpTable[0x46A7] = CAST_OP(0x46A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x40C0 + i] = CAST_OP(0x40C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x40D0 + i] = CAST_OP(0x40D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x40D8 + i] = CAST_OP(0x40D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x40E0 + i] = CAST_OP(0x40E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x40E8 + i] = CAST_OP(0x40E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x40F0 + i] = CAST_OP(0x40F0);\r
+ JumpTable[0x40F8] = CAST_OP(0x40F8);\r
+ JumpTable[0x40F9] = CAST_OP(0x40F9);\r
+ JumpTable[0x40DF] = CAST_OP(0x40DF);\r
+ JumpTable[0x40E7] = CAST_OP(0x40E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x44C0 + i] = CAST_OP(0x44C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x44D0 + i] = CAST_OP(0x44D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x44D8 + i] = CAST_OP(0x44D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x44E0 + i] = CAST_OP(0x44E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x44E8 + i] = CAST_OP(0x44E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x44F0 + i] = CAST_OP(0x44F0);\r
+ JumpTable[0x44F8] = CAST_OP(0x44F8);\r
+ JumpTable[0x44F9] = CAST_OP(0x44F9);\r
+ JumpTable[0x44FA] = CAST_OP(0x44FA);\r
+ JumpTable[0x44FB] = CAST_OP(0x44FB);\r
+ JumpTable[0x44FC] = CAST_OP(0x44FC);\r
+ JumpTable[0x44DF] = CAST_OP(0x44DF);\r
+ JumpTable[0x44E7] = CAST_OP(0x44E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x46C0 + i] = CAST_OP(0x46C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x46D0 + i] = CAST_OP(0x46D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x46D8 + i] = CAST_OP(0x46D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x46E0 + i] = CAST_OP(0x46E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x46E8 + i] = CAST_OP(0x46E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x46F0 + i] = CAST_OP(0x46F0);\r
+ JumpTable[0x46F8] = CAST_OP(0x46F8);\r
+ JumpTable[0x46F9] = CAST_OP(0x46F9);\r
+ JumpTable[0x46FA] = CAST_OP(0x46FA);\r
+ JumpTable[0x46FB] = CAST_OP(0x46FB);\r
+ JumpTable[0x46FC] = CAST_OP(0x46FC);\r
+ JumpTable[0x46DF] = CAST_OP(0x46DF);\r
+ JumpTable[0x46E7] = CAST_OP(0x46E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4800 + i] = CAST_OP(0x4800);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4810 + i] = CAST_OP(0x4810);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4818 + i] = CAST_OP(0x4818);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4820 + i] = CAST_OP(0x4820);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4828 + i] = CAST_OP(0x4828);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4830 + i] = CAST_OP(0x4830);\r
+ JumpTable[0x4838] = CAST_OP(0x4838);\r
+ JumpTable[0x4839] = CAST_OP(0x4839);\r
+ JumpTable[0x481F] = CAST_OP(0x481F);\r
+ JumpTable[0x4827] = CAST_OP(0x4827);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4850 + i] = CAST_OP(0x4850);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4868 + i] = CAST_OP(0x4868);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4870 + i] = CAST_OP(0x4870);\r
+ JumpTable[0x4878] = CAST_OP(0x4878);\r
+ JumpTable[0x4879] = CAST_OP(0x4879);\r
+ JumpTable[0x487A] = CAST_OP(0x487A);\r
+ JumpTable[0x487B] = CAST_OP(0x487B);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4840 + i] = CAST_OP(0x4840);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4890 + i] = CAST_OP(0x4890);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x48A0 + i] = CAST_OP(0x48A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x48A8 + i] = CAST_OP(0x48A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x48B0 + i] = CAST_OP(0x48B0);\r
+ JumpTable[0x48B8] = CAST_OP(0x48B8);\r
+ JumpTable[0x48B9] = CAST_OP(0x48B9);\r
+ JumpTable[0x48A7] = CAST_OP(0x48A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x48D0 + i] = CAST_OP(0x48D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x48E0 + i] = CAST_OP(0x48E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x48E8 + i] = CAST_OP(0x48E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x48F0 + i] = CAST_OP(0x48F0);\r
+ JumpTable[0x48F8] = CAST_OP(0x48F8);\r
+ JumpTable[0x48F9] = CAST_OP(0x48F9);\r
+ JumpTable[0x48E7] = CAST_OP(0x48E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4880 + i] = CAST_OP(0x4880);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x48C0 + i] = CAST_OP(0x48C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A00 + i] = CAST_OP(0x4A00);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A10 + i] = CAST_OP(0x4A10);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4A18 + i] = CAST_OP(0x4A18);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4A20 + i] = CAST_OP(0x4A20);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A28 + i] = CAST_OP(0x4A28);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A30 + i] = CAST_OP(0x4A30);\r
+ JumpTable[0x4A38] = CAST_OP(0x4A38);\r
+ JumpTable[0x4A39] = CAST_OP(0x4A39);\r
+ JumpTable[0x4A1F] = CAST_OP(0x4A1F);\r
+ JumpTable[0x4A27] = CAST_OP(0x4A27);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A40 + i] = CAST_OP(0x4A40);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A50 + i] = CAST_OP(0x4A50);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4A58 + i] = CAST_OP(0x4A58);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4A60 + i] = CAST_OP(0x4A60);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A68 + i] = CAST_OP(0x4A68);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A70 + i] = CAST_OP(0x4A70);\r
+ JumpTable[0x4A78] = CAST_OP(0x4A78);\r
+ JumpTable[0x4A79] = CAST_OP(0x4A79);\r
+ JumpTable[0x4A5F] = CAST_OP(0x4A5F);\r
+ JumpTable[0x4A67] = CAST_OP(0x4A67);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A80 + i] = CAST_OP(0x4A80);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4A90 + i] = CAST_OP(0x4A90);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4A98 + i] = CAST_OP(0x4A98);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4AA0 + i] = CAST_OP(0x4AA0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4AA8 + i] = CAST_OP(0x4AA8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4AB0 + i] = CAST_OP(0x4AB0);\r
+ JumpTable[0x4AB8] = CAST_OP(0x4AB8);\r
+ JumpTable[0x4AB9] = CAST_OP(0x4AB9);\r
+ JumpTable[0x4A9F] = CAST_OP(0x4A9F);\r
+ JumpTable[0x4AA7] = CAST_OP(0x4AA7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4AC0 + i] = CAST_OP(0x4AC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4AD0 + i] = CAST_OP(0x4AD0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4AD8 + i] = CAST_OP(0x4AD8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4AE0 + i] = CAST_OP(0x4AE0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4AE8 + i] = CAST_OP(0x4AE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4AF0 + i] = CAST_OP(0x4AF0);\r
+ JumpTable[0x4AF8] = CAST_OP(0x4AF8);\r
+ JumpTable[0x4AF9] = CAST_OP(0x4AF9);\r
+ JumpTable[0x4ADF] = CAST_OP(0x4ADF);\r
+ JumpTable[0x4AE7] = CAST_OP(0x4AE7);\r
+ JumpTable[0x4AFC] = CAST_OP(0x4AFC);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4C90 + i] = CAST_OP(0x4C90);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4C98 + i] = CAST_OP(0x4C98);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4CA8 + i] = CAST_OP(0x4CA8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4CB0 + i] = CAST_OP(0x4CB0);\r
+ JumpTable[0x4CB8] = CAST_OP(0x4CB8);\r
+ JumpTable[0x4CB9] = CAST_OP(0x4CB9);\r
+ JumpTable[0x4CBA] = CAST_OP(0x4CBA);\r
+ JumpTable[0x4CBB] = CAST_OP(0x4CBB);\r
+ JumpTable[0x4C9F] = CAST_OP(0x4C9F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4CD0 + i] = CAST_OP(0x4CD0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x4CD8 + i] = CAST_OP(0x4CD8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4CE8 + i] = CAST_OP(0x4CE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4CF0 + i] = CAST_OP(0x4CF0);\r
+ JumpTable[0x4CF8] = CAST_OP(0x4CF8);\r
+ JumpTable[0x4CF9] = CAST_OP(0x4CF9);\r
+ JumpTable[0x4CFA] = CAST_OP(0x4CFA);\r
+ JumpTable[0x4CFB] = CAST_OP(0x4CFB);\r
+ JumpTable[0x4CDF] = CAST_OP(0x4CDF);\r
+ for(i = 0x0000; i <= 0x000F; i += 0x0001)\r
+ JumpTable[0x4E40 + i] = CAST_OP(0x4E40);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4E50 + i] = CAST_OP(0x4E50);\r
+ JumpTable[0x4E57] = CAST_OP(0x4E57);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4E58 + i] = CAST_OP(0x4E58);\r
+ JumpTable[0x4E5F] = CAST_OP(0x4E5F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4E60 + i] = CAST_OP(0x4E60);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4E68 + i] = CAST_OP(0x4E68);\r
+ JumpTable[0x4E70] = CAST_OP(0x4E70);\r
+ JumpTable[0x4E71] = CAST_OP(0x4E71);\r
+ JumpTable[0x4E72] = CAST_OP(0x4E72);\r
+ JumpTable[0x4E73] = CAST_OP(0x4E73);\r
+ JumpTable[0x4E75] = CAST_OP(0x4E75);\r
+ JumpTable[0x4E76] = CAST_OP(0x4E76);\r
+ JumpTable[0x4E77] = CAST_OP(0x4E77);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4E90 + i] = CAST_OP(0x4E90);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4EA8 + i] = CAST_OP(0x4EA8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4EB0 + i] = CAST_OP(0x4EB0);\r
+ JumpTable[0x4EB8] = CAST_OP(0x4EB8);\r
+ JumpTable[0x4EB9] = CAST_OP(0x4EB9);\r
+ JumpTable[0x4EBA] = CAST_OP(0x4EBA);\r
+ JumpTable[0x4EBB] = CAST_OP(0x4EBB);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4ED0 + i] = CAST_OP(0x4ED0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4EE8 + i] = CAST_OP(0x4EE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x4EF0 + i] = CAST_OP(0x4EF0);\r
+ JumpTable[0x4EF8] = CAST_OP(0x4EF8);\r
+ JumpTable[0x4EF9] = CAST_OP(0x4EF9);\r
+ JumpTable[0x4EFA] = CAST_OP(0x4EFA);\r
+ JumpTable[0x4EFB] = CAST_OP(0x4EFB);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x4180 + i + j] = CAST_OP(0x4180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x4190 + i + j] = CAST_OP(0x4190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x4198 + i + j] = CAST_OP(0x4198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x41A0 + i + j] = CAST_OP(0x41A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x41A8 + i + j] = CAST_OP(0x41A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x41B0 + i + j] = CAST_OP(0x41B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41B8 + i] = CAST_OP(0x41B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41B9 + i] = CAST_OP(0x41B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41BA + i] = CAST_OP(0x41BA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41BB + i] = CAST_OP(0x41BB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41BC + i] = CAST_OP(0x41BC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x419F + i] = CAST_OP(0x419F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41A7 + i] = CAST_OP(0x41A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x41D0 + i + j] = CAST_OP(0x41D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x41E8 + i + j] = CAST_OP(0x41E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x41F0 + i + j] = CAST_OP(0x41F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41F8 + i] = CAST_OP(0x41F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41F9 + i] = CAST_OP(0x41F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41FA + i] = CAST_OP(0x41FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x41FB + i] = CAST_OP(0x41FB);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x50C0 + i] = CAST_OP(0x50C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x51C0 + i] = CAST_OP(0x51C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x52C0 + i] = CAST_OP(0x52C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x53C0 + i] = CAST_OP(0x53C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x54C0 + i] = CAST_OP(0x54C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x55C0 + i] = CAST_OP(0x55C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x56C0 + i] = CAST_OP(0x56C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x57C0 + i] = CAST_OP(0x57C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x58C0 + i] = CAST_OP(0x58C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x59C0 + i] = CAST_OP(0x59C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5AC0 + i] = CAST_OP(0x5AC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5BC0 + i] = CAST_OP(0x5BC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5CC0 + i] = CAST_OP(0x5CC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5DC0 + i] = CAST_OP(0x5DC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5EC0 + i] = CAST_OP(0x5EC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5FC0 + i] = CAST_OP(0x5FC0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x50D0 + i] = CAST_OP(0x50D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x51D0 + i] = CAST_OP(0x51D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x52D0 + i] = CAST_OP(0x52D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x53D0 + i] = CAST_OP(0x53D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x54D0 + i] = CAST_OP(0x54D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x55D0 + i] = CAST_OP(0x55D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x56D0 + i] = CAST_OP(0x56D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x57D0 + i] = CAST_OP(0x57D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x58D0 + i] = CAST_OP(0x58D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x59D0 + i] = CAST_OP(0x59D0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5AD0 + i] = CAST_OP(0x5AD0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5BD0 + i] = CAST_OP(0x5BD0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5CD0 + i] = CAST_OP(0x5CD0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5DD0 + i] = CAST_OP(0x5DD0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5ED0 + i] = CAST_OP(0x5ED0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5FD0 + i] = CAST_OP(0x5FD0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x50D8 + i] = CAST_OP(0x50D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x51D8 + i] = CAST_OP(0x51D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x52D8 + i] = CAST_OP(0x52D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x53D8 + i] = CAST_OP(0x53D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x54D8 + i] = CAST_OP(0x54D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x55D8 + i] = CAST_OP(0x55D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x56D8 + i] = CAST_OP(0x56D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x57D8 + i] = CAST_OP(0x57D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x58D8 + i] = CAST_OP(0x58D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x59D8 + i] = CAST_OP(0x59D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5AD8 + i] = CAST_OP(0x5AD8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5BD8 + i] = CAST_OP(0x5BD8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5CD8 + i] = CAST_OP(0x5CD8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5DD8 + i] = CAST_OP(0x5DD8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5ED8 + i] = CAST_OP(0x5ED8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5FD8 + i] = CAST_OP(0x5FD8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x50E0 + i] = CAST_OP(0x50E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x51E0 + i] = CAST_OP(0x51E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x52E0 + i] = CAST_OP(0x52E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x53E0 + i] = CAST_OP(0x53E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x54E0 + i] = CAST_OP(0x54E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x55E0 + i] = CAST_OP(0x55E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x56E0 + i] = CAST_OP(0x56E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x57E0 + i] = CAST_OP(0x57E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x58E0 + i] = CAST_OP(0x58E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x59E0 + i] = CAST_OP(0x59E0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5AE0 + i] = CAST_OP(0x5AE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5BE0 + i] = CAST_OP(0x5BE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5CE0 + i] = CAST_OP(0x5CE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5DE0 + i] = CAST_OP(0x5DE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5EE0 + i] = CAST_OP(0x5EE0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x5FE0 + i] = CAST_OP(0x5FE0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x50E8 + i] = CAST_OP(0x50E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x51E8 + i] = CAST_OP(0x51E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x52E8 + i] = CAST_OP(0x52E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x53E8 + i] = CAST_OP(0x53E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x54E8 + i] = CAST_OP(0x54E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x55E8 + i] = CAST_OP(0x55E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x56E8 + i] = CAST_OP(0x56E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x57E8 + i] = CAST_OP(0x57E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x58E8 + i] = CAST_OP(0x58E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x59E8 + i] = CAST_OP(0x59E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5AE8 + i] = CAST_OP(0x5AE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5BE8 + i] = CAST_OP(0x5BE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5CE8 + i] = CAST_OP(0x5CE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5DE8 + i] = CAST_OP(0x5DE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5EE8 + i] = CAST_OP(0x5EE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5FE8 + i] = CAST_OP(0x5FE8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x50F0 + i] = CAST_OP(0x50F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x51F0 + i] = CAST_OP(0x51F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x52F0 + i] = CAST_OP(0x52F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x53F0 + i] = CAST_OP(0x53F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x54F0 + i] = CAST_OP(0x54F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x55F0 + i] = CAST_OP(0x55F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x56F0 + i] = CAST_OP(0x56F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x57F0 + i] = CAST_OP(0x57F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x58F0 + i] = CAST_OP(0x58F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x59F0 + i] = CAST_OP(0x59F0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5AF0 + i] = CAST_OP(0x5AF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5BF0 + i] = CAST_OP(0x5BF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5CF0 + i] = CAST_OP(0x5CF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5DF0 + i] = CAST_OP(0x5DF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5EF0 + i] = CAST_OP(0x5EF0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5FF0 + i] = CAST_OP(0x5FF0);\r
+ JumpTable[0x50F8] = CAST_OP(0x50F8);\r
+ JumpTable[0x51F8] = CAST_OP(0x51F8);\r
+ JumpTable[0x52F8] = CAST_OP(0x52F8);\r
+ JumpTable[0x53F8] = CAST_OP(0x53F8);\r
+ JumpTable[0x54F8] = CAST_OP(0x54F8);\r
+ JumpTable[0x55F8] = CAST_OP(0x55F8);\r
+ JumpTable[0x56F8] = CAST_OP(0x56F8);\r
+ JumpTable[0x57F8] = CAST_OP(0x57F8);\r
+ JumpTable[0x58F8] = CAST_OP(0x58F8);\r
+ JumpTable[0x59F8] = CAST_OP(0x59F8);\r
+ JumpTable[0x5AF8] = CAST_OP(0x5AF8);\r
+ JumpTable[0x5BF8] = CAST_OP(0x5BF8);\r
+ JumpTable[0x5CF8] = CAST_OP(0x5CF8);\r
+ JumpTable[0x5DF8] = CAST_OP(0x5DF8);\r
+ JumpTable[0x5EF8] = CAST_OP(0x5EF8);\r
+ JumpTable[0x5FF8] = CAST_OP(0x5FF8);\r
+ JumpTable[0x50F9] = CAST_OP(0x50F9);\r
+ JumpTable[0x51F9] = CAST_OP(0x51F9);\r
+ JumpTable[0x52F9] = CAST_OP(0x52F9);\r
+ JumpTable[0x53F9] = CAST_OP(0x53F9);\r
+ JumpTable[0x54F9] = CAST_OP(0x54F9);\r
+ JumpTable[0x55F9] = CAST_OP(0x55F9);\r
+ JumpTable[0x56F9] = CAST_OP(0x56F9);\r
+ JumpTable[0x57F9] = CAST_OP(0x57F9);\r
+ JumpTable[0x58F9] = CAST_OP(0x58F9);\r
+ JumpTable[0x59F9] = CAST_OP(0x59F9);\r
+ JumpTable[0x5AF9] = CAST_OP(0x5AF9);\r
+ JumpTable[0x5BF9] = CAST_OP(0x5BF9);\r
+ JumpTable[0x5CF9] = CAST_OP(0x5CF9);\r
+ JumpTable[0x5DF9] = CAST_OP(0x5DF9);\r
+ JumpTable[0x5EF9] = CAST_OP(0x5EF9);\r
+ JumpTable[0x5FF9] = CAST_OP(0x5FF9);\r
+ JumpTable[0x50DF] = CAST_OP(0x50DF);\r
+ JumpTable[0x51DF] = CAST_OP(0x51DF);\r
+ JumpTable[0x52DF] = CAST_OP(0x52DF);\r
+ JumpTable[0x53DF] = CAST_OP(0x53DF);\r
+ JumpTable[0x54DF] = CAST_OP(0x54DF);\r
+ JumpTable[0x55DF] = CAST_OP(0x55DF);\r
+ JumpTable[0x56DF] = CAST_OP(0x56DF);\r
+ JumpTable[0x57DF] = CAST_OP(0x57DF);\r
+ JumpTable[0x58DF] = CAST_OP(0x58DF);\r
+ JumpTable[0x59DF] = CAST_OP(0x59DF);\r
+ JumpTable[0x5ADF] = CAST_OP(0x5ADF);\r
+ JumpTable[0x5BDF] = CAST_OP(0x5BDF);\r
+ JumpTable[0x5CDF] = CAST_OP(0x5CDF);\r
+ JumpTable[0x5DDF] = CAST_OP(0x5DDF);\r
+ JumpTable[0x5EDF] = CAST_OP(0x5EDF);\r
+ JumpTable[0x5FDF] = CAST_OP(0x5FDF);\r
+ JumpTable[0x50E7] = CAST_OP(0x50E7);\r
+ JumpTable[0x51E7] = CAST_OP(0x51E7);\r
+ JumpTable[0x52E7] = CAST_OP(0x52E7);\r
+ JumpTable[0x53E7] = CAST_OP(0x53E7);\r
+ JumpTable[0x54E7] = CAST_OP(0x54E7);\r
+ JumpTable[0x55E7] = CAST_OP(0x55E7);\r
+ JumpTable[0x56E7] = CAST_OP(0x56E7);\r
+ JumpTable[0x57E7] = CAST_OP(0x57E7);\r
+ JumpTable[0x58E7] = CAST_OP(0x58E7);\r
+ JumpTable[0x59E7] = CAST_OP(0x59E7);\r
+ JumpTable[0x5AE7] = CAST_OP(0x5AE7);\r
+ JumpTable[0x5BE7] = CAST_OP(0x5BE7);\r
+ JumpTable[0x5CE7] = CAST_OP(0x5CE7);\r
+ JumpTable[0x5DE7] = CAST_OP(0x5DE7);\r
+ JumpTable[0x5EE7] = CAST_OP(0x5EE7);\r
+ JumpTable[0x5FE7] = CAST_OP(0x5FE7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x50C8 + i] = CAST_OP(0x50C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x51C8 + i] = CAST_OP(0x51C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x52C8 + i] = CAST_OP(0x52C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x53C8 + i] = CAST_OP(0x53C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x54C8 + i] = CAST_OP(0x54C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x55C8 + i] = CAST_OP(0x55C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x56C8 + i] = CAST_OP(0x56C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x57C8 + i] = CAST_OP(0x57C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x58C8 + i] = CAST_OP(0x58C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x59C8 + i] = CAST_OP(0x59C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5AC8 + i] = CAST_OP(0x5AC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5BC8 + i] = CAST_OP(0x5BC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5CC8 + i] = CAST_OP(0x5CC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5DC8 + i] = CAST_OP(0x5DC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5EC8 + i] = CAST_OP(0x5EC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0x5FC8 + i] = CAST_OP(0x5FC8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5000 + i + j] = CAST_OP(0x5000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5010 + i + j] = CAST_OP(0x5010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5018 + i + j] = CAST_OP(0x5018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5020 + i + j] = CAST_OP(0x5020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5028 + i + j] = CAST_OP(0x5028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5030 + i + j] = CAST_OP(0x5030);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5038 + i] = CAST_OP(0x5038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5039 + i] = CAST_OP(0x5039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x501F + i] = CAST_OP(0x501F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5027 + i] = CAST_OP(0x5027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5040 + i + j] = CAST_OP(0x5040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5048 + i + j] = CAST_OP(0x5048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5050 + i + j] = CAST_OP(0x5050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5058 + i + j] = CAST_OP(0x5058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5060 + i + j] = CAST_OP(0x5060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5068 + i + j] = CAST_OP(0x5068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5070 + i + j] = CAST_OP(0x5070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5078 + i] = CAST_OP(0x5078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5079 + i] = CAST_OP(0x5079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x505F + i] = CAST_OP(0x505F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5067 + i] = CAST_OP(0x5067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5080 + i + j] = CAST_OP(0x5080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5088 + i + j] = CAST_OP(0x5088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5090 + i + j] = CAST_OP(0x5090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5098 + i + j] = CAST_OP(0x5098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x50A0 + i + j] = CAST_OP(0x50A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x50A8 + i + j] = CAST_OP(0x50A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x50B0 + i + j] = CAST_OP(0x50B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x50B8 + i] = CAST_OP(0x50B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x50B9 + i] = CAST_OP(0x50B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x509F + i] = CAST_OP(0x509F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x50A7 + i] = CAST_OP(0x50A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5100 + i + j] = CAST_OP(0x5100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5110 + i + j] = CAST_OP(0x5110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5118 + i + j] = CAST_OP(0x5118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5120 + i + j] = CAST_OP(0x5120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5128 + i + j] = CAST_OP(0x5128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5130 + i + j] = CAST_OP(0x5130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5138 + i] = CAST_OP(0x5138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5139 + i] = CAST_OP(0x5139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x511F + i] = CAST_OP(0x511F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5127 + i] = CAST_OP(0x5127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5140 + i + j] = CAST_OP(0x5140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5148 + i + j] = CAST_OP(0x5148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5150 + i + j] = CAST_OP(0x5150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5158 + i + j] = CAST_OP(0x5158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5160 + i + j] = CAST_OP(0x5160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5168 + i + j] = CAST_OP(0x5168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5170 + i + j] = CAST_OP(0x5170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5178 + i] = CAST_OP(0x5178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5179 + i] = CAST_OP(0x5179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x515F + i] = CAST_OP(0x515F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x5167 + i] = CAST_OP(0x5167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5180 + i + j] = CAST_OP(0x5180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5188 + i + j] = CAST_OP(0x5188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5190 + i + j] = CAST_OP(0x5190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x5198 + i + j] = CAST_OP(0x5198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x51A0 + i + j] = CAST_OP(0x51A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x51A8 + i + j] = CAST_OP(0x51A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x51B0 + i + j] = CAST_OP(0x51B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x51B8 + i] = CAST_OP(0x51B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x51B9 + i] = CAST_OP(0x51B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x519F + i] = CAST_OP(0x519F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x51A7 + i] = CAST_OP(0x51A7);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6200 + i] = CAST_OP(0x6201);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6300 + i] = CAST_OP(0x6301);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6400 + i] = CAST_OP(0x6401);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6500 + i] = CAST_OP(0x6501);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6600 + i] = CAST_OP(0x6601);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6700 + i] = CAST_OP(0x6701);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6800 + i] = CAST_OP(0x6801);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6900 + i] = CAST_OP(0x6901);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6A00 + i] = CAST_OP(0x6A01);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6B00 + i] = CAST_OP(0x6B01);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6C00 + i] = CAST_OP(0x6C01);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6D00 + i] = CAST_OP(0x6D01);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6E00 + i] = CAST_OP(0x6E01);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6F00 + i] = CAST_OP(0x6F01);\r
+ JumpTable[0x6200] = CAST_OP(0x6200);\r
+ JumpTable[0x6300] = CAST_OP(0x6300);\r
+ JumpTable[0x6400] = CAST_OP(0x6400);\r
+ JumpTable[0x6500] = CAST_OP(0x6500);\r
+ JumpTable[0x6600] = CAST_OP(0x6600);\r
+ JumpTable[0x6700] = CAST_OP(0x6700);\r
+ JumpTable[0x6800] = CAST_OP(0x6800);\r
+ JumpTable[0x6900] = CAST_OP(0x6900);\r
+ JumpTable[0x6A00] = CAST_OP(0x6A00);\r
+ JumpTable[0x6B00] = CAST_OP(0x6B00);\r
+ JumpTable[0x6C00] = CAST_OP(0x6C00);\r
+ JumpTable[0x6D00] = CAST_OP(0x6D00);\r
+ JumpTable[0x6E00] = CAST_OP(0x6E00);\r
+ JumpTable[0x6F00] = CAST_OP(0x6F00);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6000 + i] = CAST_OP(0x6001);\r
+ JumpTable[0x6000] = CAST_OP(0x6000);\r
+ for(i = 0x0001; i <= 0x00FF; i += 0x0001)\r
+ JumpTable[0x6100 + i] = CAST_OP(0x6101);\r
+ JumpTable[0x6100] = CAST_OP(0x6100);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ for(j = 0x0000; j <= 0x00FF; j += 0x0001)\r
+ JumpTable[0x7000 + i + j] = CAST_OP(0x7000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8000 + i + j] = CAST_OP(0x8000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8010 + i + j] = CAST_OP(0x8010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8018 + i + j] = CAST_OP(0x8018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8020 + i + j] = CAST_OP(0x8020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8028 + i + j] = CAST_OP(0x8028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8030 + i + j] = CAST_OP(0x8030);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8038 + i] = CAST_OP(0x8038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8039 + i] = CAST_OP(0x8039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x803A + i] = CAST_OP(0x803A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x803B + i] = CAST_OP(0x803B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x803C + i] = CAST_OP(0x803C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x801F + i] = CAST_OP(0x801F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8027 + i] = CAST_OP(0x8027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8040 + i + j] = CAST_OP(0x8040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8050 + i + j] = CAST_OP(0x8050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8058 + i + j] = CAST_OP(0x8058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8060 + i + j] = CAST_OP(0x8060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8068 + i + j] = CAST_OP(0x8068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8070 + i + j] = CAST_OP(0x8070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8078 + i] = CAST_OP(0x8078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8079 + i] = CAST_OP(0x8079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x807A + i] = CAST_OP(0x807A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x807B + i] = CAST_OP(0x807B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x807C + i] = CAST_OP(0x807C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x805F + i] = CAST_OP(0x805F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8067 + i] = CAST_OP(0x8067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8080 + i + j] = CAST_OP(0x8080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8090 + i + j] = CAST_OP(0x8090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8098 + i + j] = CAST_OP(0x8098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80A0 + i + j] = CAST_OP(0x80A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80A8 + i + j] = CAST_OP(0x80A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80B0 + i + j] = CAST_OP(0x80B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80B8 + i] = CAST_OP(0x80B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80B9 + i] = CAST_OP(0x80B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80BA + i] = CAST_OP(0x80BA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80BB + i] = CAST_OP(0x80BB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80BC + i] = CAST_OP(0x80BC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x809F + i] = CAST_OP(0x809F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80A7 + i] = CAST_OP(0x80A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8110 + i + j] = CAST_OP(0x8110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8118 + i + j] = CAST_OP(0x8118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8120 + i + j] = CAST_OP(0x8120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8128 + i + j] = CAST_OP(0x8128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8130 + i + j] = CAST_OP(0x8130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8138 + i] = CAST_OP(0x8138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8139 + i] = CAST_OP(0x8139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x811F + i] = CAST_OP(0x811F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8127 + i] = CAST_OP(0x8127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8150 + i + j] = CAST_OP(0x8150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8158 + i + j] = CAST_OP(0x8158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8160 + i + j] = CAST_OP(0x8160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8168 + i + j] = CAST_OP(0x8168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8170 + i + j] = CAST_OP(0x8170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8178 + i] = CAST_OP(0x8178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8179 + i] = CAST_OP(0x8179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x815F + i] = CAST_OP(0x815F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x8167 + i] = CAST_OP(0x8167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8190 + i + j] = CAST_OP(0x8190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8198 + i + j] = CAST_OP(0x8198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81A0 + i + j] = CAST_OP(0x81A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81A8 + i + j] = CAST_OP(0x81A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81B0 + i + j] = CAST_OP(0x81B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81B8 + i] = CAST_OP(0x81B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81B9 + i] = CAST_OP(0x81B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x819F + i] = CAST_OP(0x819F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81A7 + i] = CAST_OP(0x81A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x8100 + i + j] = CAST_OP(0x8100);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x8108 + i + j] = CAST_OP(0x8108);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x810F + i] = CAST_OP(0x810F);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x8F08 + i] = CAST_OP(0x8F08);\r
+ JumpTable[0x8F0F] = CAST_OP(0x8F0F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80C0 + i + j] = CAST_OP(0x80C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80D0 + i + j] = CAST_OP(0x80D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80D8 + i + j] = CAST_OP(0x80D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80E0 + i + j] = CAST_OP(0x80E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80E8 + i + j] = CAST_OP(0x80E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x80F0 + i + j] = CAST_OP(0x80F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80F8 + i] = CAST_OP(0x80F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80F9 + i] = CAST_OP(0x80F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80FA + i] = CAST_OP(0x80FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80FB + i] = CAST_OP(0x80FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80FC + i] = CAST_OP(0x80FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80DF + i] = CAST_OP(0x80DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x80E7 + i] = CAST_OP(0x80E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81C0 + i + j] = CAST_OP(0x81C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81D0 + i + j] = CAST_OP(0x81D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81D8 + i + j] = CAST_OP(0x81D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81E0 + i + j] = CAST_OP(0x81E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81E8 + i + j] = CAST_OP(0x81E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x81F0 + i + j] = CAST_OP(0x81F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81F8 + i] = CAST_OP(0x81F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81F9 + i] = CAST_OP(0x81F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81FA + i] = CAST_OP(0x81FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81FB + i] = CAST_OP(0x81FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81FC + i] = CAST_OP(0x81FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81DF + i] = CAST_OP(0x81DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x81E7 + i] = CAST_OP(0x81E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9000 + i + j] = CAST_OP(0x9000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9008 + i + j] = CAST_OP(0x9008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9010 + i + j] = CAST_OP(0x9010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9018 + i + j] = CAST_OP(0x9018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9020 + i + j] = CAST_OP(0x9020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9028 + i + j] = CAST_OP(0x9028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9030 + i + j] = CAST_OP(0x9030);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9038 + i] = CAST_OP(0x9038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9039 + i] = CAST_OP(0x9039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x903A + i] = CAST_OP(0x903A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x903B + i] = CAST_OP(0x903B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x903C + i] = CAST_OP(0x903C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x901F + i] = CAST_OP(0x901F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9027 + i] = CAST_OP(0x9027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9040 + i + j] = CAST_OP(0x9040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9048 + i + j] = CAST_OP(0x9048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9050 + i + j] = CAST_OP(0x9050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9058 + i + j] = CAST_OP(0x9058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9060 + i + j] = CAST_OP(0x9060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9068 + i + j] = CAST_OP(0x9068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9070 + i + j] = CAST_OP(0x9070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9078 + i] = CAST_OP(0x9078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9079 + i] = CAST_OP(0x9079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x907A + i] = CAST_OP(0x907A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x907B + i] = CAST_OP(0x907B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x907C + i] = CAST_OP(0x907C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x905F + i] = CAST_OP(0x905F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9067 + i] = CAST_OP(0x9067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9080 + i + j] = CAST_OP(0x9080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9088 + i + j] = CAST_OP(0x9088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9090 + i + j] = CAST_OP(0x9090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9098 + i + j] = CAST_OP(0x9098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90A0 + i + j] = CAST_OP(0x90A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90A8 + i + j] = CAST_OP(0x90A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90B0 + i + j] = CAST_OP(0x90B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90B8 + i] = CAST_OP(0x90B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90B9 + i] = CAST_OP(0x90B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90BA + i] = CAST_OP(0x90BA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90BB + i] = CAST_OP(0x90BB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90BC + i] = CAST_OP(0x90BC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x909F + i] = CAST_OP(0x909F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90A7 + i] = CAST_OP(0x90A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9110 + i + j] = CAST_OP(0x9110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9118 + i + j] = CAST_OP(0x9118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9120 + i + j] = CAST_OP(0x9120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9128 + i + j] = CAST_OP(0x9128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9130 + i + j] = CAST_OP(0x9130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9138 + i] = CAST_OP(0x9138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9139 + i] = CAST_OP(0x9139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x911F + i] = CAST_OP(0x911F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9127 + i] = CAST_OP(0x9127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9150 + i + j] = CAST_OP(0x9150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9158 + i + j] = CAST_OP(0x9158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9160 + i + j] = CAST_OP(0x9160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9168 + i + j] = CAST_OP(0x9168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9170 + i + j] = CAST_OP(0x9170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9178 + i] = CAST_OP(0x9178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9179 + i] = CAST_OP(0x9179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x915F + i] = CAST_OP(0x915F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x9167 + i] = CAST_OP(0x9167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9190 + i + j] = CAST_OP(0x9190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9198 + i + j] = CAST_OP(0x9198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91A0 + i + j] = CAST_OP(0x91A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91A8 + i + j] = CAST_OP(0x91A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91B0 + i + j] = CAST_OP(0x91B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91B8 + i] = CAST_OP(0x91B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91B9 + i] = CAST_OP(0x91B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x919F + i] = CAST_OP(0x919F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91A7 + i] = CAST_OP(0x91A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9100 + i + j] = CAST_OP(0x9100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9140 + i + j] = CAST_OP(0x9140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x9180 + i + j] = CAST_OP(0x9180);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x9108 + i + j] = CAST_OP(0x9108);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x9148 + i + j] = CAST_OP(0x9148);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0x9188 + i + j] = CAST_OP(0x9188);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x910F + i] = CAST_OP(0x910F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x914F + i] = CAST_OP(0x914F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0x918F + i] = CAST_OP(0x918F);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x9F08 + i] = CAST_OP(0x9F08);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x9F48 + i] = CAST_OP(0x9F48);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0x9F88 + i] = CAST_OP(0x9F88);\r
+ JumpTable[0x9F0F] = CAST_OP(0x9F0F);\r
+ JumpTable[0x9F4F] = CAST_OP(0x9F4F);\r
+ JumpTable[0x9F8F] = CAST_OP(0x9F8F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90C0 + i + j] = CAST_OP(0x90C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90C8 + i + j] = CAST_OP(0x90C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90D0 + i + j] = CAST_OP(0x90D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90D8 + i + j] = CAST_OP(0x90D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90E0 + i + j] = CAST_OP(0x90E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90E8 + i + j] = CAST_OP(0x90E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x90F0 + i + j] = CAST_OP(0x90F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90F8 + i] = CAST_OP(0x90F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90F9 + i] = CAST_OP(0x90F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90FA + i] = CAST_OP(0x90FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90FB + i] = CAST_OP(0x90FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90FC + i] = CAST_OP(0x90FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90DF + i] = CAST_OP(0x90DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x90E7 + i] = CAST_OP(0x90E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91C0 + i + j] = CAST_OP(0x91C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91C8 + i + j] = CAST_OP(0x91C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91D0 + i + j] = CAST_OP(0x91D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91D8 + i + j] = CAST_OP(0x91D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91E0 + i + j] = CAST_OP(0x91E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91E8 + i + j] = CAST_OP(0x91E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0x91F0 + i + j] = CAST_OP(0x91F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91F8 + i] = CAST_OP(0x91F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91F9 + i] = CAST_OP(0x91F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91FA + i] = CAST_OP(0x91FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91FB + i] = CAST_OP(0x91FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91FC + i] = CAST_OP(0x91FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91DF + i] = CAST_OP(0x91DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0x91E7 + i] = CAST_OP(0x91E7);\r
+ for(i = 0x0000; i <= 0x0FFF; i += 0x0001)\r
+ JumpTable[0xA000 + i] = CAST_OP(0xA000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB000 + i + j] = CAST_OP(0xB000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB008 + i + j] = CAST_OP(0xB008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB010 + i + j] = CAST_OP(0xB010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB018 + i + j] = CAST_OP(0xB018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB020 + i + j] = CAST_OP(0xB020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB028 + i + j] = CAST_OP(0xB028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB030 + i + j] = CAST_OP(0xB030);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB038 + i] = CAST_OP(0xB038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB039 + i] = CAST_OP(0xB039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB03A + i] = CAST_OP(0xB03A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB03B + i] = CAST_OP(0xB03B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB03C + i] = CAST_OP(0xB03C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB01F + i] = CAST_OP(0xB01F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB027 + i] = CAST_OP(0xB027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB040 + i + j] = CAST_OP(0xB040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB048 + i + j] = CAST_OP(0xB048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB050 + i + j] = CAST_OP(0xB050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB058 + i + j] = CAST_OP(0xB058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB060 + i + j] = CAST_OP(0xB060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB068 + i + j] = CAST_OP(0xB068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB070 + i + j] = CAST_OP(0xB070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB078 + i] = CAST_OP(0xB078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB079 + i] = CAST_OP(0xB079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB07A + i] = CAST_OP(0xB07A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB07B + i] = CAST_OP(0xB07B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB07C + i] = CAST_OP(0xB07C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB05F + i] = CAST_OP(0xB05F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB067 + i] = CAST_OP(0xB067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB080 + i + j] = CAST_OP(0xB080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB088 + i + j] = CAST_OP(0xB088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB090 + i + j] = CAST_OP(0xB090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB098 + i + j] = CAST_OP(0xB098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0A0 + i + j] = CAST_OP(0xB0A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0A8 + i + j] = CAST_OP(0xB0A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0B0 + i + j] = CAST_OP(0xB0B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0B8 + i] = CAST_OP(0xB0B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0B9 + i] = CAST_OP(0xB0B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0BA + i] = CAST_OP(0xB0BA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0BB + i] = CAST_OP(0xB0BB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0BC + i] = CAST_OP(0xB0BC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB09F + i] = CAST_OP(0xB09F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0A7 + i] = CAST_OP(0xB0A7);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xB108 + i + j] = CAST_OP(0xB108);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xB148 + i + j] = CAST_OP(0xB148);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xB188 + i + j] = CAST_OP(0xB188);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xB10F + i] = CAST_OP(0xB10F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xB14F + i] = CAST_OP(0xB14F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xB18F + i] = CAST_OP(0xB18F);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xBF08 + i] = CAST_OP(0xBF08);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xBF48 + i] = CAST_OP(0xBF48);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xBF88 + i] = CAST_OP(0xBF88);\r
+ JumpTable[0xBF0F] = CAST_OP(0xBF0F);\r
+ JumpTable[0xBF4F] = CAST_OP(0xBF4F);\r
+ JumpTable[0xBF8F] = CAST_OP(0xBF8F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB100 + i + j] = CAST_OP(0xB100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB110 + i + j] = CAST_OP(0xB110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB118 + i + j] = CAST_OP(0xB118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB120 + i + j] = CAST_OP(0xB120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB128 + i + j] = CAST_OP(0xB128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB130 + i + j] = CAST_OP(0xB130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB138 + i] = CAST_OP(0xB138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB139 + i] = CAST_OP(0xB139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB11F + i] = CAST_OP(0xB11F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB127 + i] = CAST_OP(0xB127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB140 + i + j] = CAST_OP(0xB140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB150 + i + j] = CAST_OP(0xB150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB158 + i + j] = CAST_OP(0xB158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB160 + i + j] = CAST_OP(0xB160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB168 + i + j] = CAST_OP(0xB168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB170 + i + j] = CAST_OP(0xB170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB178 + i] = CAST_OP(0xB178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB179 + i] = CAST_OP(0xB179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB15F + i] = CAST_OP(0xB15F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB167 + i] = CAST_OP(0xB167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB180 + i + j] = CAST_OP(0xB180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB190 + i + j] = CAST_OP(0xB190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB198 + i + j] = CAST_OP(0xB198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1A0 + i + j] = CAST_OP(0xB1A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1A8 + i + j] = CAST_OP(0xB1A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1B0 + i + j] = CAST_OP(0xB1B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1B8 + i] = CAST_OP(0xB1B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1B9 + i] = CAST_OP(0xB1B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB19F + i] = CAST_OP(0xB19F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1A7 + i] = CAST_OP(0xB1A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0C0 + i + j] = CAST_OP(0xB0C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0C8 + i + j] = CAST_OP(0xB0C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0D0 + i + j] = CAST_OP(0xB0D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0D8 + i + j] = CAST_OP(0xB0D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0E0 + i + j] = CAST_OP(0xB0E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0E8 + i + j] = CAST_OP(0xB0E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB0F0 + i + j] = CAST_OP(0xB0F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0F8 + i] = CAST_OP(0xB0F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0F9 + i] = CAST_OP(0xB0F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0FA + i] = CAST_OP(0xB0FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0FB + i] = CAST_OP(0xB0FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0FC + i] = CAST_OP(0xB0FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0DF + i] = CAST_OP(0xB0DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB0E7 + i] = CAST_OP(0xB0E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1C0 + i + j] = CAST_OP(0xB1C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1C8 + i + j] = CAST_OP(0xB1C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1D0 + i + j] = CAST_OP(0xB1D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1D8 + i + j] = CAST_OP(0xB1D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1E0 + i + j] = CAST_OP(0xB1E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1E8 + i + j] = CAST_OP(0xB1E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xB1F0 + i + j] = CAST_OP(0xB1F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1F8 + i] = CAST_OP(0xB1F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1F9 + i] = CAST_OP(0xB1F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1FA + i] = CAST_OP(0xB1FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1FB + i] = CAST_OP(0xB1FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1FC + i] = CAST_OP(0xB1FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1DF + i] = CAST_OP(0xB1DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xB1E7 + i] = CAST_OP(0xB1E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC000 + i + j] = CAST_OP(0xC000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC010 + i + j] = CAST_OP(0xC010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC018 + i + j] = CAST_OP(0xC018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC020 + i + j] = CAST_OP(0xC020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC028 + i + j] = CAST_OP(0xC028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC030 + i + j] = CAST_OP(0xC030);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC038 + i] = CAST_OP(0xC038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC039 + i] = CAST_OP(0xC039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC03A + i] = CAST_OP(0xC03A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC03B + i] = CAST_OP(0xC03B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC03C + i] = CAST_OP(0xC03C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC01F + i] = CAST_OP(0xC01F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC027 + i] = CAST_OP(0xC027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC040 + i + j] = CAST_OP(0xC040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC050 + i + j] = CAST_OP(0xC050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC058 + i + j] = CAST_OP(0xC058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC060 + i + j] = CAST_OP(0xC060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC068 + i + j] = CAST_OP(0xC068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC070 + i + j] = CAST_OP(0xC070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC078 + i] = CAST_OP(0xC078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC079 + i] = CAST_OP(0xC079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC07A + i] = CAST_OP(0xC07A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC07B + i] = CAST_OP(0xC07B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC07C + i] = CAST_OP(0xC07C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC05F + i] = CAST_OP(0xC05F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC067 + i] = CAST_OP(0xC067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC080 + i + j] = CAST_OP(0xC080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC090 + i + j] = CAST_OP(0xC090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC098 + i + j] = CAST_OP(0xC098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0A0 + i + j] = CAST_OP(0xC0A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0A8 + i + j] = CAST_OP(0xC0A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0B0 + i + j] = CAST_OP(0xC0B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0B8 + i] = CAST_OP(0xC0B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0B9 + i] = CAST_OP(0xC0B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0BA + i] = CAST_OP(0xC0BA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0BB + i] = CAST_OP(0xC0BB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0BC + i] = CAST_OP(0xC0BC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC09F + i] = CAST_OP(0xC09F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0A7 + i] = CAST_OP(0xC0A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC110 + i + j] = CAST_OP(0xC110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC118 + i + j] = CAST_OP(0xC118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC120 + i + j] = CAST_OP(0xC120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC128 + i + j] = CAST_OP(0xC128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC130 + i + j] = CAST_OP(0xC130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC138 + i] = CAST_OP(0xC138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC139 + i] = CAST_OP(0xC139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC11F + i] = CAST_OP(0xC11F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC127 + i] = CAST_OP(0xC127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC150 + i + j] = CAST_OP(0xC150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC158 + i + j] = CAST_OP(0xC158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC160 + i + j] = CAST_OP(0xC160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC168 + i + j] = CAST_OP(0xC168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC170 + i + j] = CAST_OP(0xC170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC178 + i] = CAST_OP(0xC178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC179 + i] = CAST_OP(0xC179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC15F + i] = CAST_OP(0xC15F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC167 + i] = CAST_OP(0xC167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC190 + i + j] = CAST_OP(0xC190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC198 + i + j] = CAST_OP(0xC198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1A0 + i + j] = CAST_OP(0xC1A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1A8 + i + j] = CAST_OP(0xC1A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1B0 + i + j] = CAST_OP(0xC1B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1B8 + i] = CAST_OP(0xC1B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1B9 + i] = CAST_OP(0xC1B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC19F + i] = CAST_OP(0xC19F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1A7 + i] = CAST_OP(0xC1A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC100 + i + j] = CAST_OP(0xC100);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xC108 + i + j] = CAST_OP(0xC108);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xC10F + i] = CAST_OP(0xC10F);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xCF08 + i] = CAST_OP(0xCF08);\r
+ JumpTable[0xCF0F] = CAST_OP(0xCF0F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0C0 + i + j] = CAST_OP(0xC0C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0D0 + i + j] = CAST_OP(0xC0D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0D8 + i + j] = CAST_OP(0xC0D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0E0 + i + j] = CAST_OP(0xC0E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0E8 + i + j] = CAST_OP(0xC0E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC0F0 + i + j] = CAST_OP(0xC0F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0F8 + i] = CAST_OP(0xC0F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0F9 + i] = CAST_OP(0xC0F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0FA + i] = CAST_OP(0xC0FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0FB + i] = CAST_OP(0xC0FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0FC + i] = CAST_OP(0xC0FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0DF + i] = CAST_OP(0xC0DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC0E7 + i] = CAST_OP(0xC0E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1C0 + i + j] = CAST_OP(0xC1C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1D0 + i + j] = CAST_OP(0xC1D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1D8 + i + j] = CAST_OP(0xC1D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1E0 + i + j] = CAST_OP(0xC1E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1E8 + i + j] = CAST_OP(0xC1E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC1F0 + i + j] = CAST_OP(0xC1F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1F8 + i] = CAST_OP(0xC1F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1F9 + i] = CAST_OP(0xC1F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1FA + i] = CAST_OP(0xC1FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1FB + i] = CAST_OP(0xC1FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1FC + i] = CAST_OP(0xC1FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1DF + i] = CAST_OP(0xC1DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xC1E7 + i] = CAST_OP(0xC1E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC140 + i + j] = CAST_OP(0xC140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC148 + i + j] = CAST_OP(0xC148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xC188 + i + j] = CAST_OP(0xC188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD000 + i + j] = CAST_OP(0xD000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD008 + i + j] = CAST_OP(0xD008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD010 + i + j] = CAST_OP(0xD010);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD018 + i + j] = CAST_OP(0xD018);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD020 + i + j] = CAST_OP(0xD020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD028 + i + j] = CAST_OP(0xD028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD030 + i + j] = CAST_OP(0xD030);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD038 + i] = CAST_OP(0xD038);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD039 + i] = CAST_OP(0xD039);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD03A + i] = CAST_OP(0xD03A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD03B + i] = CAST_OP(0xD03B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD03C + i] = CAST_OP(0xD03C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD01F + i] = CAST_OP(0xD01F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD027 + i] = CAST_OP(0xD027);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD040 + i + j] = CAST_OP(0xD040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD048 + i + j] = CAST_OP(0xD048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD050 + i + j] = CAST_OP(0xD050);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD058 + i + j] = CAST_OP(0xD058);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD060 + i + j] = CAST_OP(0xD060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD068 + i + j] = CAST_OP(0xD068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD070 + i + j] = CAST_OP(0xD070);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD078 + i] = CAST_OP(0xD078);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD079 + i] = CAST_OP(0xD079);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD07A + i] = CAST_OP(0xD07A);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD07B + i] = CAST_OP(0xD07B);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD07C + i] = CAST_OP(0xD07C);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD05F + i] = CAST_OP(0xD05F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD067 + i] = CAST_OP(0xD067);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD080 + i + j] = CAST_OP(0xD080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD088 + i + j] = CAST_OP(0xD088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD090 + i + j] = CAST_OP(0xD090);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD098 + i + j] = CAST_OP(0xD098);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0A0 + i + j] = CAST_OP(0xD0A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0A8 + i + j] = CAST_OP(0xD0A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0B0 + i + j] = CAST_OP(0xD0B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0B8 + i] = CAST_OP(0xD0B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0B9 + i] = CAST_OP(0xD0B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0BA + i] = CAST_OP(0xD0BA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0BB + i] = CAST_OP(0xD0BB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0BC + i] = CAST_OP(0xD0BC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD09F + i] = CAST_OP(0xD09F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0A7 + i] = CAST_OP(0xD0A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD110 + i + j] = CAST_OP(0xD110);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD118 + i + j] = CAST_OP(0xD118);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD120 + i + j] = CAST_OP(0xD120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD128 + i + j] = CAST_OP(0xD128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD130 + i + j] = CAST_OP(0xD130);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD138 + i] = CAST_OP(0xD138);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD139 + i] = CAST_OP(0xD139);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD11F + i] = CAST_OP(0xD11F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD127 + i] = CAST_OP(0xD127);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD150 + i + j] = CAST_OP(0xD150);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD158 + i + j] = CAST_OP(0xD158);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD160 + i + j] = CAST_OP(0xD160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD168 + i + j] = CAST_OP(0xD168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD170 + i + j] = CAST_OP(0xD170);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD178 + i] = CAST_OP(0xD178);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD179 + i] = CAST_OP(0xD179);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD15F + i] = CAST_OP(0xD15F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD167 + i] = CAST_OP(0xD167);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD190 + i + j] = CAST_OP(0xD190);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD198 + i + j] = CAST_OP(0xD198);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1A0 + i + j] = CAST_OP(0xD1A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1A8 + i + j] = CAST_OP(0xD1A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1B0 + i + j] = CAST_OP(0xD1B0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1B8 + i] = CAST_OP(0xD1B8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1B9 + i] = CAST_OP(0xD1B9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD19F + i] = CAST_OP(0xD19F);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1A7 + i] = CAST_OP(0xD1A7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD100 + i + j] = CAST_OP(0xD100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD140 + i + j] = CAST_OP(0xD140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD180 + i + j] = CAST_OP(0xD180);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xD108 + i + j] = CAST_OP(0xD108);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xD148 + i + j] = CAST_OP(0xD148);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0C00; j += 0x0200)\r
+ JumpTable[0xD188 + i + j] = CAST_OP(0xD188);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xD10F + i] = CAST_OP(0xD10F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xD14F + i] = CAST_OP(0xD14F);\r
+ for(i = 0x0000; i <= 0x0C00; i += 0x0200)\r
+ JumpTable[0xD18F + i] = CAST_OP(0xD18F);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xDF08 + i] = CAST_OP(0xDF08);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xDF48 + i] = CAST_OP(0xDF48);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xDF88 + i] = CAST_OP(0xDF88);\r
+ JumpTable[0xDF0F] = CAST_OP(0xDF0F);\r
+ JumpTable[0xDF4F] = CAST_OP(0xDF4F);\r
+ JumpTable[0xDF8F] = CAST_OP(0xDF8F);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0C0 + i + j] = CAST_OP(0xD0C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0C8 + i + j] = CAST_OP(0xD0C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0D0 + i + j] = CAST_OP(0xD0D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0D8 + i + j] = CAST_OP(0xD0D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0E0 + i + j] = CAST_OP(0xD0E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0E8 + i + j] = CAST_OP(0xD0E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD0F0 + i + j] = CAST_OP(0xD0F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0F8 + i] = CAST_OP(0xD0F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0F9 + i] = CAST_OP(0xD0F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0FA + i] = CAST_OP(0xD0FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0FB + i] = CAST_OP(0xD0FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0FC + i] = CAST_OP(0xD0FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0DF + i] = CAST_OP(0xD0DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD0E7 + i] = CAST_OP(0xD0E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1C0 + i + j] = CAST_OP(0xD1C0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1C8 + i + j] = CAST_OP(0xD1C8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1D0 + i + j] = CAST_OP(0xD1D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1D8 + i + j] = CAST_OP(0xD1D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1E0 + i + j] = CAST_OP(0xD1E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1E8 + i + j] = CAST_OP(0xD1E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xD1F0 + i + j] = CAST_OP(0xD1F0);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1F8 + i] = CAST_OP(0xD1F8);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1F9 + i] = CAST_OP(0xD1F9);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1FA + i] = CAST_OP(0xD1FA);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1FB + i] = CAST_OP(0xD1FB);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1FC + i] = CAST_OP(0xD1FC);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1DF + i] = CAST_OP(0xD1DF);\r
+ for(i = 0x0000; i <= 0x0E00; i += 0x0200)\r
+ JumpTable[0xD1E7 + i] = CAST_OP(0xD1E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE000 + i + j] = CAST_OP(0xE000);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE040 + i + j] = CAST_OP(0xE040);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE080 + i + j] = CAST_OP(0xE080);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE008 + i + j] = CAST_OP(0xE008);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE048 + i + j] = CAST_OP(0xE048);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE088 + i + j] = CAST_OP(0xE088);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE010 + i + j] = CAST_OP(0xE010);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE050 + i + j] = CAST_OP(0xE050);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE090 + i + j] = CAST_OP(0xE090);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE018 + i + j] = CAST_OP(0xE018);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE058 + i + j] = CAST_OP(0xE058);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE098 + i + j] = CAST_OP(0xE098);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE100 + i + j] = CAST_OP(0xE100);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE140 + i + j] = CAST_OP(0xE140);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE180 + i + j] = CAST_OP(0xE180);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE108 + i + j] = CAST_OP(0xE108);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE148 + i + j] = CAST_OP(0xE148);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE188 + i + j] = CAST_OP(0xE188);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE110 + i + j] = CAST_OP(0xE110);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE150 + i + j] = CAST_OP(0xE150);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE190 + i + j] = CAST_OP(0xE190);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE118 + i + j] = CAST_OP(0xE118);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE158 + i + j] = CAST_OP(0xE158);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE198 + i + j] = CAST_OP(0xE198);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE020 + i + j] = CAST_OP(0xE020);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE060 + i + j] = CAST_OP(0xE060);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE0A0 + i + j] = CAST_OP(0xE0A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE028 + i + j] = CAST_OP(0xE028);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE068 + i + j] = CAST_OP(0xE068);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE0A8 + i + j] = CAST_OP(0xE0A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE030 + i + j] = CAST_OP(0xE030);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE070 + i + j] = CAST_OP(0xE070);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE0B0 + i + j] = CAST_OP(0xE0B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE038 + i + j] = CAST_OP(0xE038);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE078 + i + j] = CAST_OP(0xE078);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE0B8 + i + j] = CAST_OP(0xE0B8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE120 + i + j] = CAST_OP(0xE120);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE160 + i + j] = CAST_OP(0xE160);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE1A0 + i + j] = CAST_OP(0xE1A0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE128 + i + j] = CAST_OP(0xE128);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE168 + i + j] = CAST_OP(0xE168);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE1A8 + i + j] = CAST_OP(0xE1A8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE130 + i + j] = CAST_OP(0xE130);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE170 + i + j] = CAST_OP(0xE170);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE1B0 + i + j] = CAST_OP(0xE1B0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE138 + i + j] = CAST_OP(0xE138);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE178 + i + j] = CAST_OP(0xE178);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ for(j = 0x0000; j <= 0x0E00; j += 0x0200)\r
+ JumpTable[0xE1B8 + i + j] = CAST_OP(0xE1B8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE0D0 + i] = CAST_OP(0xE0D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE0D8 + i] = CAST_OP(0xE0D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE0E0 + i] =CAST_OP(0xE0E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE0E8 + i] = CAST_OP(0xE0E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE0F0 + i] = CAST_OP(0xE0F0);\r
+ JumpTable[0xE0F8] = CAST_OP(0xE0F8);\r
+ JumpTable[0xE0F9] = CAST_OP(0xE0F9);\r
+ JumpTable[0xE0DF] = CAST_OP(0xE0DF);\r
+ JumpTable[0xE0E7] = CAST_OP(0xE0E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE2D0 + i] = CAST_OP(0xE2D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE2D8 + i] = CAST_OP(0xE2D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE2E0 + i] = CAST_OP(0xE2E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE2E8 + i] = CAST_OP(0xE2E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE2F0 + i] = CAST_OP(0xE2F0);\r
+ JumpTable[0xE2F8] = CAST_OP(0xE2F8);\r
+ JumpTable[0xE2F9] = CAST_OP(0xE2F9);\r
+ JumpTable[0xE2DF] = CAST_OP(0xE2DF);\r
+ JumpTable[0xE2E7] = CAST_OP(0xE2E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE4D0 + i] = CAST_OP(0xE4D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE4D8 + i] = CAST_OP(0xE4D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE4E0 + i] = CAST_OP(0xE4E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE4E8 + i] = CAST_OP(0xE4E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE4F0 + i] = CAST_OP(0xE4F0);\r
+ JumpTable[0xE4F8] = CAST_OP(0xE4F8);\r
+ JumpTable[0xE4F9] = CAST_OP(0xE4F9);\r
+ JumpTable[0xE4DF] = CAST_OP(0xE4DF);\r
+ JumpTable[0xE4E7] = CAST_OP(0xE4E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE6D0 + i] = CAST_OP(0xE6D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE6D8 + i] = CAST_OP(0xE6D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE6E0 + i] = CAST_OP(0xE6E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE6E8 + i] = CAST_OP(0xE6E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE6F0 + i] = CAST_OP(0xE6F0);\r
+ JumpTable[0xE6F8] = CAST_OP(0xE6F8);\r
+ JumpTable[0xE6F9] = CAST_OP(0xE6F9);\r
+ JumpTable[0xE6DF] = CAST_OP(0xE6DF);\r
+ JumpTable[0xE6E7] = CAST_OP(0xE6E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE1D0 + i] = CAST_OP(0xE1D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE1D8 + i] = CAST_OP(0xE1D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE1E0 + i] = CAST_OP(0xE1E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE1E8 + i] = CAST_OP(0xE1E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE1F0 + i] = CAST_OP(0xE1F0);\r
+ JumpTable[0xE1F8] = CAST_OP(0xE1F8);\r
+ JumpTable[0xE1F9] = CAST_OP(0xE1F9);\r
+ JumpTable[0xE1DF] = CAST_OP(0xE1DF);\r
+ JumpTable[0xE1E7] = CAST_OP(0xE1E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE3D0 + i] = CAST_OP(0xE3D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE3D8 + i] = CAST_OP(0xE3D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE3E0 + i] = CAST_OP(0xE3E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE3E8 + i] = CAST_OP(0xE3E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE3F0 + i] = CAST_OP(0xE3F0);\r
+ JumpTable[0xE3F8] = CAST_OP(0xE3F8);\r
+ JumpTable[0xE3F9] = CAST_OP(0xE3F9);\r
+ JumpTable[0xE3DF] = CAST_OP(0xE3DF);\r
+ JumpTable[0xE3E7] = CAST_OP(0xE3E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE5D0 + i] = CAST_OP(0xE5D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE5D8 + i] = CAST_OP(0xE5D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE5E0 + i] = CAST_OP(0xE5E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE5E8 + i] = CAST_OP(0xE5E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE5F0 + i] = CAST_OP(0xE5F0);\r
+ JumpTable[0xE5F8] = CAST_OP(0xE5F8);\r
+ JumpTable[0xE5F9] = CAST_OP(0xE5F9);\r
+ JumpTable[0xE5DF] = CAST_OP(0xE5DF);\r
+ JumpTable[0xE5E7] = CAST_OP(0xE5E7);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE7D0 + i] = CAST_OP(0xE7D0);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE7D8 + i] = CAST_OP(0xE7D8);\r
+ for(i = 0x0000; i <= 0x0006; i += 0x0001)\r
+ JumpTable[0xE7E0 + i] = CAST_OP(0xE7E0);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE7E8 + i] = CAST_OP(0xE7E8);\r
+ for(i = 0x0000; i <= 0x0007; i += 0x0001)\r
+ JumpTable[0xE7F0 + i] = CAST_OP(0xE7F0);\r
+ JumpTable[0xE7F8] = CAST_OP(0xE7F8);\r
+ JumpTable[0xE7F9] = CAST_OP(0xE7F9);\r
+ JumpTable[0xE7DF] = CAST_OP(0xE7DF);\r
+ JumpTable[0xE7E7] = CAST_OP(0xE7E7);\r
+ for(i = 0x0000; i <= 0x0FFF; i += 0x0001)\r
+ JumpTable[0xF000 + i] = CAST_OP(0xF000);\r
+\r
+ initialised = 1;\r
+}\r
+\r
+\r
--- /dev/null
+
+// ORI
+OPCODE(0x0000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ res = DREGu8((Opcode >> 0) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ORI
+OPCODE(0x0010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORI
+OPCODE(0x0018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORI
+OPCODE(0x0020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ORI
+OPCODE(0x0028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORI
+OPCODE(0x0030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ORI
+OPCODE(0x0038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORI
+OPCODE(0x0039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ORI
+OPCODE(0x001F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORI
+OPCODE(0x0027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ORI
+OPCODE(0x0040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 0) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ORI
+OPCODE(0x0050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORI
+OPCODE(0x0058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORI
+OPCODE(0x0060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ORI
+OPCODE(0x0068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORI
+OPCODE(0x0070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ORI
+OPCODE(0x0078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORI
+OPCODE(0x0079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ORI
+OPCODE(0x005F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORI
+OPCODE(0x0067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ORI
+OPCODE(0x0080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ res = DREGu32((Opcode >> 0) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(16)
+}
+
+// ORI
+OPCODE(0x0090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ORI
+OPCODE(0x0098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ORI
+OPCODE(0x00A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ORI
+OPCODE(0x00A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// ORI
+OPCODE(0x00B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// ORI
+OPCODE(0x00B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// ORI
+OPCODE(0x00B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(36)
+}
+
+// ORI
+OPCODE(0x009F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ORI
+OPCODE(0x00A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ORICCR
+OPCODE(0x003C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ res &= M68K_CCR_MASK;
+ res |= GET_CCR;
+ SET_CCR(res)
+RET(20)
+}
+
+// ORISR
+OPCODE(0x007C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ u32 res;
+ FETCH_WORD(res);
+ res &= M68K_SR_MASK;
+ res |= GET_SR;
+ SET_SR(res)
+ CHECK_INT_TO_JUMP(20)
+ }
+ else
+ {
+ u32 newPC = (u32)(PC) - BasePC;
+ SET_PC(newPC-2);
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+#ifdef USE_CYCLONE_TIMING
+ RET(0)
+#else
+ RET(4)
+#endif
+ }
+RET(20)
+}
+
+// ANDI
+OPCODE(0x0200)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ res = DREGu8((Opcode >> 0) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ANDI
+OPCODE(0x0210)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDI
+OPCODE(0x0218)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDI
+OPCODE(0x0220)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ANDI
+OPCODE(0x0228)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDI
+OPCODE(0x0230)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ANDI
+OPCODE(0x0238)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDI
+OPCODE(0x0239)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ANDI
+OPCODE(0x021F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDI
+OPCODE(0x0227)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ANDI
+OPCODE(0x0240)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 0) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ANDI
+OPCODE(0x0250)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDI
+OPCODE(0x0258)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDI
+OPCODE(0x0260)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ANDI
+OPCODE(0x0268)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDI
+OPCODE(0x0270)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ANDI
+OPCODE(0x0278)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDI
+OPCODE(0x0279)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ANDI
+OPCODE(0x025F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDI
+OPCODE(0x0267)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ANDI
+OPCODE(0x0280)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ res = DREGu32((Opcode >> 0) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(14)
+#else
+RET(16)
+#endif
+}
+
+// ANDI
+OPCODE(0x0290)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ANDI
+OPCODE(0x0298)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ANDI
+OPCODE(0x02A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ANDI
+OPCODE(0x02A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// ANDI
+OPCODE(0x02B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// ANDI
+OPCODE(0x02B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// ANDI
+OPCODE(0x02B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(36)
+}
+
+// ANDI
+OPCODE(0x029F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ANDI
+OPCODE(0x02A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ANDICCR
+OPCODE(0x023C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ res &= M68K_CCR_MASK;
+ res &= GET_CCR;
+ SET_CCR(res)
+RET(20)
+}
+
+// ANDISR
+OPCODE(0x027C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ FETCH_WORD(res);
+ res &= M68K_SR_MASK;
+ res &= GET_SR;
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ CHECK_INT_TO_JUMP(20)
+ }
+ else
+ {
+ u32 newPC = (u32)(PC) - BasePC;
+ SET_PC(newPC-2);
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(20)
+}
+
+// EORI
+OPCODE(0x0A00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ res = DREGu8((Opcode >> 0) & 7);
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// EORI
+OPCODE(0x0A10)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A18)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A20)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// EORI
+OPCODE(0x0A28)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORI
+OPCODE(0x0A30)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// EORI
+OPCODE(0x0A38)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORI
+OPCODE(0x0A39)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// EORI
+OPCODE(0x0A1F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A27)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// EORI
+OPCODE(0x0A40)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 0) & 7);
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// EORI
+OPCODE(0x0A50)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A58)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A60)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// EORI
+OPCODE(0x0A68)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORI
+OPCODE(0x0A70)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// EORI
+OPCODE(0x0A78)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORI
+OPCODE(0x0A79)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// EORI
+OPCODE(0x0A5F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A67)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// EORI
+OPCODE(0x0A80)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ res = DREGu32((Opcode >> 0) & 7);
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(16)
+}
+
+// EORI
+OPCODE(0x0A90)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// EORI
+OPCODE(0x0A98)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// EORI
+OPCODE(0x0AA0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// EORI
+OPCODE(0x0AA8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// EORI
+OPCODE(0x0AB0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// EORI
+OPCODE(0x0AB8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// EORI
+OPCODE(0x0AB9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(36)
+}
+
+// EORI
+OPCODE(0x0A9F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// EORI
+OPCODE(0x0AA7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// EORICCR
+OPCODE(0x0A3C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ res &= M68K_CCR_MASK;
+ res ^= GET_CCR;
+ SET_CCR(res)
+RET(20)
+}
+
+// EORISR
+OPCODE(0x0A7C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ FETCH_WORD(res);
+ res &= M68K_SR_MASK;
+ res ^= GET_SR;
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ CHECK_INT_TO_JUMP(20)
+ }
+ else
+ {
+ u32 newPC = (u32)(PC) - BasePC;
+ SET_PC(newPC-2);
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(20)
+}
+
+// SUBI
+OPCODE(0x0400)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ dst = DREGu8((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// SUBI
+OPCODE(0x0410)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0418)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0420)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBI
+OPCODE(0x0428)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBI
+OPCODE(0x0430)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SUBI
+OPCODE(0x0438)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBI
+OPCODE(0x0439)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// SUBI
+OPCODE(0x041F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0427)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBI
+OPCODE(0x0440)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ dst = DREGu16((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// SUBI
+OPCODE(0x0450)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0458)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0460)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBI
+OPCODE(0x0468)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBI
+OPCODE(0x0470)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SUBI
+OPCODE(0x0478)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBI
+OPCODE(0x0479)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// SUBI
+OPCODE(0x045F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0467)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBI
+OPCODE(0x0480)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = DREGu32((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(16)
+}
+
+// SUBI
+OPCODE(0x0490)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// SUBI
+OPCODE(0x0498)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// SUBI
+OPCODE(0x04A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// SUBI
+OPCODE(0x04A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// SUBI
+OPCODE(0x04B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// SUBI
+OPCODE(0x04B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// SUBI
+OPCODE(0x04B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(36)
+}
+
+// SUBI
+OPCODE(0x049F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// SUBI
+OPCODE(0x04A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ADDI
+OPCODE(0x0600)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ dst = DREGu8((Opcode >> 0) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ADDI
+OPCODE(0x0610)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0618)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0620)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDI
+OPCODE(0x0628)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDI
+OPCODE(0x0630)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ADDI
+OPCODE(0x0638)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDI
+OPCODE(0x0639)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ADDI
+OPCODE(0x061F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0627)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDI
+OPCODE(0x0640)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ dst = DREGu16((Opcode >> 0) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ADDI
+OPCODE(0x0650)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0658)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0660)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDI
+OPCODE(0x0668)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDI
+OPCODE(0x0670)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ADDI
+OPCODE(0x0678)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDI
+OPCODE(0x0679)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ADDI
+OPCODE(0x065F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0667)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDI
+OPCODE(0x0680)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = DREGu32((Opcode >> 0) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(16)
+}
+
+// ADDI
+OPCODE(0x0690)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ADDI
+OPCODE(0x0698)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ADDI
+OPCODE(0x06A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ADDI
+OPCODE(0x06A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// ADDI
+OPCODE(0x06B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// ADDI
+OPCODE(0x06B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// ADDI
+OPCODE(0x06B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(36)
+}
+
+// ADDI
+OPCODE(0x069F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ADDI
+OPCODE(0x06A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// CMPI
+OPCODE(0x0C00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ dst = DREGu8((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+RET(8)
+}
+
+// CMPI
+OPCODE(0x0C10)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMPI
+OPCODE(0x0C18)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMPI
+OPCODE(0x0C20)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(14)
+}
+
+// CMPI
+OPCODE(0x0C28)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(16)
+}
+
+// CMPI
+OPCODE(0x0C30)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(18)
+}
+
+// CMPI
+OPCODE(0x0C38)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(16)
+}
+
+// CMPI
+OPCODE(0x0C39)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(20)
+}
+
+// CMPI
+OPCODE(0x0C1F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMPI
+OPCODE(0x0C27)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(14)
+}
+
+// CMPI
+OPCODE(0x0C40)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ dst = DREGu16((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+RET(8)
+}
+
+// CMPI
+OPCODE(0x0C50)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMPI
+OPCODE(0x0C58)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMPI
+OPCODE(0x0C60)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(14)
+}
+
+// CMPI
+OPCODE(0x0C68)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(16)
+}
+
+// CMPI
+OPCODE(0x0C70)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(18)
+}
+
+// CMPI
+OPCODE(0x0C78)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(16)
+}
+
+// CMPI
+OPCODE(0x0C79)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(20)
+}
+
+// CMPI
+OPCODE(0x0C5F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMPI
+OPCODE(0x0C67)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(14)
+}
+
+// CMPI
+OPCODE(0x0C80)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = DREGu32((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(14)
+}
+
+// CMPI
+OPCODE(0x0C90)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMPI
+OPCODE(0x0C98)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMPI
+OPCODE(0x0CA0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(22)
+}
+
+// CMPI
+OPCODE(0x0CA8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(24)
+}
+
+// CMPI
+OPCODE(0x0CB0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(26)
+}
+
+// CMPI
+OPCODE(0x0CB8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(24)
+}
+
+// CMPI
+OPCODE(0x0CB9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(28)
+}
+
+// CMPI
+OPCODE(0x0C9F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMPI
+OPCODE(0x0CA7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(22)
+}
+
+// BTSTn
+OPCODE(0x0800)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+RET(10)
+}
+
+// BTSTn
+OPCODE(0x0810)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(12)
+}
+
+// BTSTn
+OPCODE(0x0818)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(12)
+}
+
+// BTSTn
+OPCODE(0x0820)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(14)
+}
+
+// BTSTn
+OPCODE(0x0828)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(16)
+}
+
+// BTSTn
+OPCODE(0x0830)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(18)
+}
+
+// BTSTn
+OPCODE(0x0838)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(16)
+}
+
+// BTSTn
+OPCODE(0x0839)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(20)
+}
+
+// BTSTn
+OPCODE(0x083A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(16)
+}
+
+// BTSTn
+OPCODE(0x083B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(18)
+}
+
+// BTSTn
+OPCODE(0x081F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(12)
+}
+
+// BTSTn
+OPCODE(0x0827)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(14)
+}
+
+// BCHGn
+OPCODE(0x0840)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+ res ^= src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(12)
+}
+
+// BCHGn
+OPCODE(0x0850)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCHGn
+OPCODE(0x0858)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCHGn
+OPCODE(0x0860)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BCHGn
+OPCODE(0x0868)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BCHGn
+OPCODE(0x0870)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// BCHGn
+OPCODE(0x0878)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BCHGn
+OPCODE(0x0879)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// BCHGn
+OPCODE(0x085F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCHGn
+OPCODE(0x0867)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BCLRn
+OPCODE(0x0880)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+ res &= ~src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(14)
+}
+
+// BCLRn
+OPCODE(0x0890)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCLRn
+OPCODE(0x0898)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCLRn
+OPCODE(0x08A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BCLRn
+OPCODE(0x08A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BCLRn
+OPCODE(0x08B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// BCLRn
+OPCODE(0x08B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BCLRn
+OPCODE(0x08B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// BCLRn
+OPCODE(0x089F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCLRn
+OPCODE(0x08A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BSETn
+OPCODE(0x08C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+ res |= src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(12)
+}
+
+// BSETn
+OPCODE(0x08D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BSETn
+OPCODE(0x08D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BSETn
+OPCODE(0x08E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BSETn
+OPCODE(0x08E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BSETn
+OPCODE(0x08F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// BSETn
+OPCODE(0x08F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BSETn
+OPCODE(0x08F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// BSETn
+OPCODE(0x08DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BSETn
+OPCODE(0x08E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BTST
+OPCODE(0x0100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+RET(6)
+}
+
+// BTST
+OPCODE(0x0110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(8)
+}
+
+// BTST
+OPCODE(0x0118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(8)
+}
+
+// BTST
+OPCODE(0x0120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(10)
+}
+
+// BTST
+OPCODE(0x0128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(12)
+}
+
+// BTST
+OPCODE(0x0130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(14)
+}
+
+// BTST
+OPCODE(0x0138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(12)
+}
+
+// BTST
+OPCODE(0x0139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(16)
+}
+
+// BTST
+OPCODE(0x013A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(12)
+}
+
+// BTST
+OPCODE(0x013B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(14)
+}
+
+// BTST
+OPCODE(0x013C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_BYTE(res);
+ flag_NotZ = res & src;
+RET(8)
+}
+
+// BTST
+OPCODE(0x011F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(8)
+}
+
+// BTST
+OPCODE(0x0127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ POST_IO
+RET(10)
+}
+
+// BCHG
+OPCODE(0x0140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+ res ^= src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// BCHG
+OPCODE(0x0150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BCHG
+OPCODE(0x0158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BCHG
+OPCODE(0x0160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// BCHG
+OPCODE(0x0168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCHG
+OPCODE(0x0170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BCHG
+OPCODE(0x0178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCHG
+OPCODE(0x0179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BCHG
+OPCODE(0x015F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BCHG
+OPCODE(0x0167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res ^= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// BCLR
+OPCODE(0x0180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+ res &= ~src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(10)
+}
+
+// BCLR
+OPCODE(0x0190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BCLR
+OPCODE(0x0198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BCLR
+OPCODE(0x01A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// BCLR
+OPCODE(0x01A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCLR
+OPCODE(0x01B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BCLR
+OPCODE(0x01B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BCLR
+OPCODE(0x01B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BCLR
+OPCODE(0x019F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BCLR
+OPCODE(0x01A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res &= ~src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// BSET
+OPCODE(0x01C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ src = 1 << (src & 31);
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_NotZ = res & src;
+ res |= src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// BSET
+OPCODE(0x01D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BSET
+OPCODE(0x01D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BSET
+OPCODE(0x01E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// BSET
+OPCODE(0x01E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BSET
+OPCODE(0x01F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// BSET
+OPCODE(0x01F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// BSET
+OPCODE(0x01F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// BSET
+OPCODE(0x01DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// BSET
+OPCODE(0x01E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ src = 1 << (src & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_NotZ = res & src;
+ res |= src;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEPWaD
+OPCODE(0x0108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr + 0, res)
+ READ_BYTE_F(adr + 2, src)
+ DREGu16((Opcode >> 9) & 7) = (res << 8) | src;
+ POST_IO
+RET(24)
+}
+
+// MOVEPLaD
+OPCODE(0x0148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res <<= 24;
+ adr += 2;
+ READ_BYTE_F(adr, src)
+ res |= src << 16;
+ adr += 2;
+ READ_BYTE_F(adr, src)
+ res |= src << 8;
+ adr += 2;
+ READ_BYTE_F(adr, src)
+ DREG((Opcode >> 9) & 7) = res | src;
+ POST_IO
+RET(32)
+}
+
+// MOVEPWDa
+OPCODE(0x0188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr + 0, res >> 8)
+ WRITE_BYTE_F(adr + 2, res >> 0)
+ POST_IO
+RET(24)
+}
+
+// MOVEPLDa
+OPCODE(0x01C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res >> 24)
+ adr += 2;
+ WRITE_BYTE_F(adr, res >> 16)
+ adr += 2;
+ WRITE_BYTE_F(adr, res >> 8)
+ adr += 2;
+ WRITE_BYTE_F(adr, res >> 0)
+ POST_IO
+RET(32)
+}
+
+// MOVEB
+OPCODE(0x1000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEB
+OPCODE(0x1080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x10C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x11C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x13C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1EC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1F00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+*/
+RET(4)
+}
+
+// MOVEB
+OPCODE(0x1088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x10C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x11C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x13C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1EC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1F08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+*/
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x11D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x13D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1ED0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1F10)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x1098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x11D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x13D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1ED8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1F18)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// MOVEB
+OPCODE(0x10A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x10E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x11A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x11E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x13E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x1EE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1F20)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x10E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x11A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x11E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x13E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x1EE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1F28)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x10B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x10F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x1130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x1170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x11B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x11F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x13F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEB
+OPCODE(0x1EF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x1F30)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x1038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x10F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x11B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x11F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x13F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x1EF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1F38)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x10B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x10F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x11B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEB
+OPCODE(0x11F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x13F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEB
+OPCODE(0x1EF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1F39)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x103A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x10FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x113A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x117A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x11BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x11FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x13FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x1EFA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x1F3A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x103B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x10BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x10FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x113B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x117B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x11BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEB
+OPCODE(0x11FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x13FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEB
+OPCODE(0x1EFB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x1F3B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x103C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x10BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x113C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x117C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x11BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x11FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x13FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1EFC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1F3C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x101F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEB
+OPCODE(0x109F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x10DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x111F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x115F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x119F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x11DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEB
+OPCODE(0x13DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x1EDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1F1F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEB
+OPCODE(0x1027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// MOVEB
+OPCODE(0x10A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x10E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x11A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEB
+OPCODE(0x11E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_SWORD(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEB
+OPCODE(0x13E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ FETCH_LONG(adr);
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEB
+OPCODE(0x1EE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEB
+OPCODE(0x1F27)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEL
+OPCODE(0x2000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEL
+OPCODE(0x2080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x20C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x2180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEL
+OPCODE(0x21C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x23C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2EC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2F00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEL
+OPCODE(0x2088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x20C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x2188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEL
+OPCODE(0x21C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x23C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2EC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2F08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x20D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x21D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x23D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2ED0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2F10)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x2098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x20D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x21D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x23D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2ED8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2F18)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEL
+OPCODE(0x20A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x20E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x21A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x21E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x23E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x2EE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2F20)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x20A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x20E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x21A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x21E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x23E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x2EE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2F28)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// MOVEL
+OPCODE(0x20B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x20F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x2130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x2170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x21B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x21F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x23F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// MOVEL
+OPCODE(0x2EF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x2F30)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x2038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x20B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x20F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x21B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x21F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x23F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x2EF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2F38)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x20B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x20F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x21B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// MOVEL
+OPCODE(0x21F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x23F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(36)
+}
+
+// MOVEL
+OPCODE(0x2EF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2F39)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x203A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEL
+OPCODE(0x20BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x20FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x213A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x217A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x21BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x21FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x23FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x2EFA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x2F3A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x203B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// MOVEL
+OPCODE(0x20BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x20FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x213B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x217B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x21BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(32)
+}
+
+// MOVEL
+OPCODE(0x21FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x23FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(34)
+}
+
+// MOVEL
+OPCODE(0x2EFB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x2F3B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x203C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x20BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x20FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x213C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x217C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x21BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x21FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x23FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2EFC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2F3C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x201F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEL
+OPCODE(0x209F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x20DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x211F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x215F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x219F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x21DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEL
+OPCODE(0x23DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x2EDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2F1F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEL
+OPCODE(0x2027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEL
+OPCODE(0x20A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x20E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x21A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEL
+OPCODE(0x21E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_SWORD(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEL
+OPCODE(0x23E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ FETCH_LONG(adr);
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// MOVEL
+OPCODE(0x2EE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7);
+ AREG(7) += 4;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEL
+OPCODE(0x2F27)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEAL
+OPCODE(0x2040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)DREGs32((Opcode >> 0) & 7);
+ AREG((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEAL
+OPCODE(0x2048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)AREGs32((Opcode >> 0) & 7);
+ AREG((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEAL
+OPCODE(0x2050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEAL
+OPCODE(0x2058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEAL
+OPCODE(0x2060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEAL
+OPCODE(0x2068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEAL
+OPCODE(0x2070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// MOVEAL
+OPCODE(0x2078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEAL
+OPCODE(0x2079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// MOVEAL
+OPCODE(0x207A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEAL
+OPCODE(0x207B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// MOVEAL
+OPCODE(0x207C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(res);
+ AREG((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// MOVEAL
+OPCODE(0x205F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEAL
+OPCODE(0x2067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEW
+OPCODE(0x3080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x30C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x31C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x33C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3EC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3F00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEW
+OPCODE(0x3088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x30C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x31C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x33C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3EC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3F08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x31D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x33D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3ED0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3F10)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x3098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x31D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x33D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3ED8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3F18)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// MOVEW
+OPCODE(0x30A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x30E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x31A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x31E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x33E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x3EE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3F20)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x30E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x31A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x31E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x33E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x3EE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3F28)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x30B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x30F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x3130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x3170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x31B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x31F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x33F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEW
+OPCODE(0x3EF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x3F30)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x3038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x30F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x31B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x31F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x33F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x3EF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3F38)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x30B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x30F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x31B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEW
+OPCODE(0x31F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x33F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// MOVEW
+OPCODE(0x3EF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3F39)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x303A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x30FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x313A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x317A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x31BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x31FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x33FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x3EFA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x3F3A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x303B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x30BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x30FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x313B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x317B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x31BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// MOVEW
+OPCODE(0x31FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x33FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// MOVEW
+OPCODE(0x3EFB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x3F3B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x303C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x30BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x313C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x317C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x31BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x31FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x33FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3EFC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3F3C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x301F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEW
+OPCODE(0x309F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x30DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x311F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x315F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x319F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x31DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVEW
+OPCODE(0x33DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x3EDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3F1F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVEW
+OPCODE(0x3027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// MOVEW
+OPCODE(0x30A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x30E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 9) & 7);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x31A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG((Opcode >> 9) & 7);
+ DECODE_EXT_WORD
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVEW
+OPCODE(0x31E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_SWORD(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVEW
+OPCODE(0x33E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ FETCH_LONG(adr);
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVEW
+OPCODE(0x3EE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7);
+ AREG(7) += 2;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEW
+OPCODE(0x3F27)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEAW
+OPCODE(0x3040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)DREGs16((Opcode >> 0) & 7);
+ AREG((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEAW
+OPCODE(0x3048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)AREGs16((Opcode >> 0) & 7);
+ AREG((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// MOVEAW
+OPCODE(0x3050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEAW
+OPCODE(0x3058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEAW
+OPCODE(0x3060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// MOVEAW
+OPCODE(0x3068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEAW
+OPCODE(0x3070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEAW
+OPCODE(0x3078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEAW
+OPCODE(0x3079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// MOVEAW
+OPCODE(0x307A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// MOVEAW
+OPCODE(0x307B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// MOVEAW
+OPCODE(0x307C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(res);
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// MOVEAW
+OPCODE(0x305F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// MOVEAW
+OPCODE(0x3067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, res)
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// NEGX
+OPCODE(0x4000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// NEGX
+OPCODE(0x4010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEGX
+OPCODE(0x4018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEGX
+OPCODE(0x4020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEGX
+OPCODE(0x4028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEGX
+OPCODE(0x4030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// NEGX
+OPCODE(0x4038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEGX
+OPCODE(0x4039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEGX
+OPCODE(0x401F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEGX
+OPCODE(0x4027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEGX
+OPCODE(0x4040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// NEGX
+OPCODE(0x4050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEGX
+OPCODE(0x4058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEGX
+OPCODE(0x4060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEGX
+OPCODE(0x4068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEGX
+OPCODE(0x4070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// NEGX
+OPCODE(0x4078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEGX
+OPCODE(0x4079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEGX
+OPCODE(0x405F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEGX
+OPCODE(0x4067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEGX
+OPCODE(0x4080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// NEGX
+OPCODE(0x4090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) | (src >> 1) | (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEGX
+OPCODE(0x4098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEGX
+OPCODE(0x40A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// NEGX
+OPCODE(0x40A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// NEGX
+OPCODE(0x40B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// NEGX
+OPCODE(0x40B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// NEGX
+OPCODE(0x40B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// NEGX
+OPCODE(0x409F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEGX
+OPCODE(0x40A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_V = (res & src) >> 24;
+flag_X = flag_C = (res?1:0)<<8;
+// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// CLR
+OPCODE(0x4200)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// CLR
+OPCODE(0x4210)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// CLR
+OPCODE(0x4218)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// CLR
+OPCODE(0x4220)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// CLR
+OPCODE(0x4228)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// CLR
+OPCODE(0x4230)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// CLR
+OPCODE(0x4238)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// CLR
+OPCODE(0x4239)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// CLR
+OPCODE(0x421F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// CLR
+OPCODE(0x4227)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// CLR
+OPCODE(0x4240)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// CLR
+OPCODE(0x4250)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// CLR
+OPCODE(0x4258)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// CLR
+OPCODE(0x4260)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// CLR
+OPCODE(0x4268)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// CLR
+OPCODE(0x4270)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// CLR
+OPCODE(0x4278)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// CLR
+OPCODE(0x4279)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// CLR
+OPCODE(0x425F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// CLR
+OPCODE(0x4267)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// CLR
+OPCODE(0x4280)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// CLR
+OPCODE(0x4290)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// CLR
+OPCODE(0x4298)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// CLR
+OPCODE(0x42A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// CLR
+OPCODE(0x42A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// CLR
+OPCODE(0x42B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// CLR
+OPCODE(0x42B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// CLR
+OPCODE(0x42B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// CLR
+OPCODE(0x429F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// CLR
+OPCODE(0x42A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ res = 0;
+ flag_N = flag_NotZ = flag_V = flag_C = 0;
+ PRE_IO
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// NEG
+OPCODE(0x4400)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// NEG
+OPCODE(0x4410)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEG
+OPCODE(0x4418)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEG
+OPCODE(0x4420)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEG
+OPCODE(0x4428)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEG
+OPCODE(0x4430)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// NEG
+OPCODE(0x4438)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEG
+OPCODE(0x4439)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEG
+OPCODE(0x441F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEG
+OPCODE(0x4427)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = -src;
+ flag_V = res & src;
+ flag_N = flag_X = flag_C = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEG
+OPCODE(0x4440)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// NEG
+OPCODE(0x4450)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEG
+OPCODE(0x4458)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEG
+OPCODE(0x4460)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEG
+OPCODE(0x4468)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEG
+OPCODE(0x4470)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// NEG
+OPCODE(0x4478)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NEG
+OPCODE(0x4479)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEG
+OPCODE(0x445F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NEG
+OPCODE(0x4467)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = -src;
+ flag_V = (res & src) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NEG
+OPCODE(0x4480)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// NEG
+OPCODE(0x4490)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEG
+OPCODE(0x4498)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEG
+OPCODE(0x44A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// NEG
+OPCODE(0x44A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// NEG
+OPCODE(0x44B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// NEG
+OPCODE(0x44B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// NEG
+OPCODE(0x44B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// NEG
+OPCODE(0x449F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NEG
+OPCODE(0x44A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = -src;
+ flag_NotZ = res;
+ flag_V = (res & src) >> 24;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// NOT
+OPCODE(0x4600)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// NOT
+OPCODE(0x4610)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NOT
+OPCODE(0x4618)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NOT
+OPCODE(0x4620)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NOT
+OPCODE(0x4628)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NOT
+OPCODE(0x4630)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// NOT
+OPCODE(0x4638)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NOT
+OPCODE(0x4639)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NOT
+OPCODE(0x461F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NOT
+OPCODE(0x4627)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_N = res;
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NOT
+OPCODE(0x4640)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// NOT
+OPCODE(0x4650)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NOT
+OPCODE(0x4658)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NOT
+OPCODE(0x4660)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NOT
+OPCODE(0x4668)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NOT
+OPCODE(0x4670)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// NOT
+OPCODE(0x4678)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// NOT
+OPCODE(0x4679)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NOT
+OPCODE(0x465F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// NOT
+OPCODE(0x4667)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res & 0xFFFF;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// NOT
+OPCODE(0x4680)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// NOT
+OPCODE(0x4690)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NOT
+OPCODE(0x4698)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NOT
+OPCODE(0x46A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// NOT
+OPCODE(0x46A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// NOT
+OPCODE(0x46B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// NOT
+OPCODE(0x46B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// NOT
+OPCODE(0x46B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// NOT
+OPCODE(0x469F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// NOT
+OPCODE(0x46A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = ~src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// MOVESRa
+OPCODE(0x40C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// MOVESRa
+OPCODE(0x40D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVESRa
+OPCODE(0x40D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVESRa
+OPCODE(0x40E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVESRa
+OPCODE(0x40E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVESRa
+OPCODE(0x40F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MOVESRa
+OPCODE(0x40F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ FETCH_SWORD(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// MOVESRa
+OPCODE(0x40F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ FETCH_LONG(adr);
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// MOVESRa
+OPCODE(0x40DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// MOVESRa
+OPCODE(0x40E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = GET_SR;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// MOVEaCCR
+OPCODE(0x44C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ SET_CCR(res)
+RET(12)
+}
+
+// MOVEaCCR
+OPCODE(0x44D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(16)
+}
+
+// MOVEaCCR
+OPCODE(0x44D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(16)
+}
+
+// MOVEaCCR
+OPCODE(0x44E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(18)
+}
+
+// MOVEaCCR
+OPCODE(0x44E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(20)
+}
+
+// MOVEaCCR
+OPCODE(0x44F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(22)
+}
+
+// MOVEaCCR
+OPCODE(0x44F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(20)
+}
+
+// MOVEaCCR
+OPCODE(0x44F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(24)
+}
+
+// MOVEaCCR
+OPCODE(0x44FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(20)
+}
+
+// MOVEaCCR
+OPCODE(0x44FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(22)
+}
+
+// MOVEaCCR
+OPCODE(0x44FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(res);
+ SET_CCR(res)
+RET(16)
+}
+
+// MOVEaCCR
+OPCODE(0x44DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(16)
+}
+
+// MOVEaCCR
+OPCODE(0x44E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_CCR(res)
+ POST_IO
+RET(18)
+}
+
+// MOVEaSR
+OPCODE(0x46C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ CHECK_INT_TO_JUMP(12)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(12)
+}
+
+// MOVEaSR
+OPCODE(0x46D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(16)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(16)
+}
+
+// MOVEaSR
+OPCODE(0x46D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(16)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(16)
+}
+
+// MOVEaSR
+OPCODE(0x46E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(18)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(18)
+}
+
+// MOVEaSR
+OPCODE(0x46E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(20)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(20)
+}
+
+// MOVEaSR
+OPCODE(0x46F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(22)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(22)
+}
+
+
+// MOVEaSR
+OPCODE(0x46F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(20)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(20)
+}
+
+// MOVEaSR
+OPCODE(0x46F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(24)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(24)
+}
+
+// MOVEaSR
+OPCODE(0x46FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(24)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(20)
+}
+
+// MOVEaSR
+OPCODE(0x46FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(22)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(22)
+}
+
+// MOVEaSR
+OPCODE(0x46FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ FETCH_WORD(res);
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ CHECK_INT_TO_JUMP(16)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(16)
+}
+
+// MOVEaSR
+OPCODE(0x46DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(16)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(16)
+}
+
+// MOVEaSR
+OPCODE(0x46E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_S)
+ {
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ CHECK_INT_TO_JUMP(18)
+ }
+ else
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+RET(18)
+}
+
+// NBCD
+OPCODE(0x4800)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+RET(6)
+}
+
+// NBCD
+OPCODE(0x4810)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// NBCD
+OPCODE(0x4818)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ 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);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// NBCD
+OPCODE(0x4820)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ 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);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(14)
+}
+
+// NBCD
+OPCODE(0x4828)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ 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);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(16)
+}
+
+// NBCD
+OPCODE(0x4830)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ 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);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(18)
+}
+
+// NBCD
+OPCODE(0x4838)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(16)
+}
+
+// NBCD
+OPCODE(0x4839)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(20)
+}
+
+// NBCD
+OPCODE(0x481F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// NBCD
+OPCODE(0x4827)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
+
+ if (res != 0x9a)
+ {
+ if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
+ res &= 0xFF;
+ WRITE_BYTE_F(adr, res)
+ flag_NotZ |= res;
+ flag_X = flag_C = M68K_SR_C;
+ }
+ else flag_X = flag_C = 0;
+ flag_N = res;
+ POST_IO
+RET(14)
+}
+
+// PEA
+OPCODE(0x4850)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(12)
+}
+
+// PEA
+OPCODE(0x4868)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(16)
+}
+
+// PEA
+OPCODE(0x4870)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(20)
+}
+
+// PEA
+OPCODE(0x4878)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(16)
+}
+
+// PEA
+OPCODE(0x4879)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(20)
+}
+
+// PEA
+OPCODE(0x487A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(16)
+}
+
+// PEA
+OPCODE(0x487B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ PUSH_32_F(adr)
+ POST_IO
+RET(20)
+}
+
+// SWAP
+OPCODE(0x4840)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ res = (res >> 16) | (res << 16);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// MOVEMRa
+OPCODE(0x4890)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(8)
+#else
+RET(12)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &AREGu32(7);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ adr -= 2;
+ WRITE_WORD_F(adr, *psrc)
+ }
+ psrc--;
+ } while (res >>= 1);
+ AREG((Opcode >> 0) & 7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+RET(8)
+}
+
+// MOVEMRa
+OPCODE(0x48A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(12)
+#else
+RET(20)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(14)
+#else
+RET(24)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(12)
+#else
+RET(20)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_LONG(adr);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG(7);
+ psrc = &AREGu32(7);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ adr -= 2;
+ WRITE_WORD_F(adr, *psrc)
+ }
+ psrc--;
+ } while (res >>= 1);
+ AREG(7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+RET(8)
+}
+
+// MOVEMRa
+OPCODE(0x48D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(8)
+#else
+RET(16)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &AREGu32(7);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ adr -= 4;
+ WRITE_LONG_DEC_F(adr, *psrc)
+ }
+ psrc--;
+ } while (res >>= 1);
+ AREG((Opcode >> 0) & 7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+RET(8)
+}
+
+// MOVEMRa
+OPCODE(0x48E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(12)
+#else
+RET(24)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(14)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(12)
+#else
+RET(24)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_LONG(adr);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ WRITE_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(32)
+#endif
+}
+
+// MOVEMRa
+OPCODE(0x48E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG(7);
+ psrc = &AREGu32(7);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ adr -= 4;
+ WRITE_LONG_DEC_F(adr, *psrc)
+ }
+ psrc--;
+ } while (res >>= 1);
+ AREG(7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+RET(8)
+}
+
+// EXT
+OPCODE(0x4880)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)DREGs8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// EXT
+OPCODE(0x48C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)DREGs16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// TST
+OPCODE(0x4A00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+RET(4)
+}
+
+// TST
+OPCODE(0x4A10)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(8)
+}
+
+// TST
+OPCODE(0x4A18)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(8)
+}
+
+// TST
+OPCODE(0x4A20)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(10)
+}
+
+// TST
+OPCODE(0x4A28)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4A30)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(14)
+}
+
+// TST
+OPCODE(0x4A38)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4A39)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(16)
+}
+
+// TST
+OPCODE(0x4A1F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(8)
+}
+
+// TST
+OPCODE(0x4A27)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(10)
+}
+
+// TST
+OPCODE(0x4A40)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+RET(4)
+}
+
+// TST
+OPCODE(0x4A50)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(8)
+}
+
+// TST
+OPCODE(0x4A58)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(8)
+}
+
+// TST
+OPCODE(0x4A60)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(10)
+}
+
+// TST
+OPCODE(0x4A68)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4A70)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(14)
+}
+
+// TST
+OPCODE(0x4A78)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4A79)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(16)
+}
+
+// TST
+OPCODE(0x4A5F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(8)
+}
+
+// TST
+OPCODE(0x4A67)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ POST_IO
+RET(10)
+}
+
+// TST
+OPCODE(0x4A80)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+RET(4)
+}
+
+// TST
+OPCODE(0x4A90)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4A98)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4AA0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// TST
+OPCODE(0x4AA8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// TST
+OPCODE(0x4AB0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// TST
+OPCODE(0x4AB8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// TST
+OPCODE(0x4AB9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// TST
+OPCODE(0x4A9F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(12)
+}
+
+// TST
+OPCODE(0x4AA7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// TAS
+OPCODE(0x4AC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu8((Opcode >> 0) & 7);
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ res |= 0x80;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// TAS
+OPCODE(0x4AD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(8)
+}
+
+// TAS
+OPCODE(0x4AD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(8)
+}
+
+// TAS
+OPCODE(0x4AE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(10)
+}
+
+// TAS
+OPCODE(0x4AE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// TAS
+OPCODE(0x4AF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(14)
+}
+
+// TAS
+OPCODE(0x4AF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(12)
+}
+
+// TAS
+OPCODE(0x4AF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(16)
+}
+
+// TAS
+OPCODE(0x4ADF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(8)
+}
+
+// TAS
+OPCODE(0x4AE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ POST_IO
+RET(10)
+}
+
+// ILLEGAL
+OPCODE(0x4AFC)
+{
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_ILLEGAL_INSTRUCTION_EX);
+RET(4)
+}
+
+// ILLEGAL A000-AFFF
+OPCODE(0xA000)
+{
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_1010_EX);
+RET(4)
+}
+
+// ILLEGAL F000-FFFF
+OPCODE(0xF000)
+{
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_1111_EX);
+RET(4)
+}
+
+// MOVEMaR
+OPCODE(0x4C90)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(12)
+#else
+RET(16)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4C98)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ AREG((Opcode >> 0) & 7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+RET(12)
+}
+
+// MOVEMaR
+OPCODE(0x4CA8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(24)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CB0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(18)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CB8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(24)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CB9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_LONG(adr);
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(20)
+#else
+RET(32)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CBA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(24)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CBB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(18)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4C9F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ s32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG(7);
+ psrc = &DREGs32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READSX_WORD_F(adr, *psrc)
+ adr += 2;
+ }
+ psrc++;
+ } while (res >>= 1);
+ AREG(7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+RET(12)
+}
+
+// MOVEMaR
+OPCODE(0x4CD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(12)
+#else
+RET(20)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ AREG((Opcode >> 0) & 7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+RET(12)
+}
+
+// MOVEMaR
+OPCODE(0x4CE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(18)
+#else
+RET(32)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_SWORD(adr);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ FETCH_LONG(adr);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(20)
+#else
+RET(36)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CFA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(28)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CFB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+#ifdef USE_CYCLONE_TIMING
+RET(18)
+#else
+RET(32)
+#endif
+}
+
+// MOVEMaR
+OPCODE(0x4CDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 *psrc;
+
+ FETCH_WORD(res);
+ adr = AREG(7);
+ psrc = &DREGu32(0);
+ dst = adr;
+ PRE_IO
+ do
+ {
+ if (res & 1)
+ {
+ READ_LONG_F(adr, *psrc)
+ adr += 4;
+ }
+ psrc++;
+ } while (res >>= 1);
+ AREG(7) = adr;
+ POST_IO
+ m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+RET(12)
+}
+
+// TRAP
+OPCODE(0x4E40)
+{
+ execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF));
+RET(4)
+}
+
+// LINK
+OPCODE(0x4E50)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ PRE_IO
+ PUSH_32_F(res)
+ res = AREG(7);
+ AREG((Opcode >> 0) & 7) = res;
+ FETCH_SWORD(res);
+ AREG(7) += res;
+ POST_IO
+RET(16)
+}
+
+// LINKA7
+OPCODE(0x4E57)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ AREG(7) -= 4;
+ PRE_IO
+ WRITE_LONG_DEC_F(AREG(7), AREG(7))
+ FETCH_SWORD(res);
+ AREG(7) += res;
+ POST_IO
+RET(16)
+}
+
+// ULNK
+OPCODE(0x4E58)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu32((Opcode >> 0) & 7);
+ AREG(7) = src + 4;
+ PRE_IO
+ READ_LONG_F(src, res)
+ AREG((Opcode >> 0) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ULNKA7
+OPCODE(0x4E5F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ PRE_IO
+ READ_LONG_F(AREG(7), AREG(7))
+ POST_IO
+RET(12)
+}
+
+// MOVEAUSP
+OPCODE(0x4E60)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_S)
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+ res = AREGu32((Opcode >> 0) & 7);
+ ASP = res;
+RET(4)
+}
+
+// MOVEUSPA
+OPCODE(0x4E68)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_S)
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+ res = ASP;
+ AREG((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// RESET
+OPCODE(0x4E70)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_S)
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+ PRE_IO
+ if (m68kcontext.reset_handler) m68kcontext.reset_handler();
+// CPU->Reset_CallBack();
+ POST_IO
+RET(132)
+}
+
+// NOP
+OPCODE(0x4E71)
+{
+RET(4)
+}
+
+// STOP
+OPCODE(0x4E72)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_S)
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+ FETCH_WORD(res);
+ res &= M68K_SR_MASK;
+ SET_SR(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ m68kcontext.execinfo |= M68K_HALTED;
+ m68kcontext.io_cycle_counter = 0;
+RET(4)
+}
+
+// RTE
+OPCODE(0x4E73)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_S)
+ {
+ u32 oldPC=GET_PC;
+ SET_PC(oldPC-2)
+ execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
+ RET(4)
+ }
+ PRE_IO
+ POP_16_F(res)
+ SET_SR(res)
+ POP_32_F(res)
+ SET_PC(res)
+ if (!flag_S)
+ {
+ res = AREG(7);
+ AREG(7) = ASP;
+ ASP = res;
+ }
+ POST_IO
+ m68kcontext.execinfo &= ~(M68K_EMULATE_GROUP_0|M68K_EMULATE_TRACE|M68K_DO_TRACE);
+ CHECK_INT_TO_JUMP(20)
+RET(20)
+}
+
+// RTS
+OPCODE(0x4E75)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ PRE_IO
+ POP_32_F(res)
+ SET_PC(res)
+ CHECK_BRANCH_EXCEPTION(res)
+ POST_IO
+RET(16)
+}
+
+// TRAPV
+OPCODE(0x4E76)
+{
+ if (flag_V & 0x80)
+ execute_exception(M68K_TRAPV_EX);
+RET(4)
+}
+
+// RTR
+OPCODE(0x4E77)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ PRE_IO
+ POP_16_F(res)
+ SET_CCR(res)
+ POP_32_F(res)
+ SET_PC(res)
+ CHECK_BRANCH_EXCEPTION(res)
+ POST_IO
+RET(20)
+}
+
+// JSR
+OPCODE(0x4E90)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(16)
+}
+
+// JSR
+OPCODE(0x4EA8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(18)
+}
+
+// JSR
+OPCODE(0x4EB0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(22)
+}
+
+// JSR
+OPCODE(0x4EB8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(18)
+}
+
+// JSR
+OPCODE(0x4EB9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(20)
+}
+
+// JSR
+OPCODE(0x4EBA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(18)
+}
+
+// JSR
+OPCODE(0x4EBB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ {
+ u32 oldPC;
+
+ oldPC = (u32)(PC) - BasePC;
+ PRE_IO
+ PUSH_32_F(oldPC)
+ }
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+ POST_IO
+RET(22)
+}
+
+// JMP
+OPCODE(0x4ED0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(8)
+}
+
+// JMP
+OPCODE(0x4EE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(10)
+}
+
+// JMP
+OPCODE(0x4EF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(14)
+}
+
+// JMP
+OPCODE(0x4EF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(10)
+}
+
+// JMP
+OPCODE(0x4EF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(12)
+}
+
+// JMP
+OPCODE(0x4EFA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(10)
+}
+
+// JMP
+OPCODE(0x4EFB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ SET_PC(adr)
+ CHECK_BRANCH_EXCEPTION(adr)
+RET(14)
+}
+
+// CHK
+OPCODE(0x4180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+RET(10)
+}
+
+// CHK
+OPCODE(0x4190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(14)
+}
+
+// CHK
+OPCODE(0x4198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(14)
+}
+
+// CHK
+OPCODE(0x41A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(16)
+}
+
+// CHK
+OPCODE(0x41A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(18)
+}
+
+// CHK
+OPCODE(0x41B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(20)
+}
+
+// CHK
+OPCODE(0x41B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(18)
+}
+
+// CHK
+OPCODE(0x41B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(22)
+}
+
+// CHK
+OPCODE(0x41BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(18)
+}
+
+// CHK
+OPCODE(0x41BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(20)
+}
+
+// CHK
+OPCODE(0x41BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(14)
+}
+
+// CHK
+OPCODE(0x419F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(14)
+}
+
+// CHK
+OPCODE(0x41A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ if (((s32)res < 0) || (res > src))
+ {
+ flag_N = res >> 8;
+ execute_exception(M68K_CHK_EX);
+ }
+ POST_IO
+RET(16)
+}
+
+// LEA
+OPCODE(0x41D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// LEA
+OPCODE(0x41E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// LEA
+OPCODE(0x41F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// LEA
+OPCODE(0x41F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// LEA
+OPCODE(0x41F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// LEA
+OPCODE(0x41FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// LEA
+OPCODE(0x41FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ res = adr;
+ AREG((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// STCC
+OPCODE(0x50C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+}
+
+// STCC
+OPCODE(0x51C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x52C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x53C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x54C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x55C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x56C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x57C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x58C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x59C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x5AC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x5BC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x5CC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x5DC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x5EC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x5FC0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(4)
+}
+
+// STCC
+OPCODE(0x50D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x51D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x52D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x53D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x54D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x55D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x56D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x57D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x58D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x59D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5AD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5BD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5CD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5DD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5ED0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5FD0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x50D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x51D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x52D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x53D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x54D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x55D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x56D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x57D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x58D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x59D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5AD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5BD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5CD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5DD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5ED8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5FD8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x50E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x51E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x52E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x53E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x54E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x55E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x56E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x57E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x58E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x59E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5AE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5BE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5CE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5DE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5EE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5FE0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x50E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x51E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x52E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x53E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x54E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x55E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x56E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x57E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x58E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x59E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5AE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5BE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5CE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5DE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5EE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5FE8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x50F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x51F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x52F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x53F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x54F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x55F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x56F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x57F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x58F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x59F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x5AF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x5BF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x5CF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x5DF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x5EF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x5FF0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(18)
+}
+
+// STCC
+OPCODE(0x50F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x51F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x52F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x53F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x54F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x55F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x56F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x57F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x58F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x59F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5AF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5BF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5CF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5DF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5EF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x5FF8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(16)
+}
+
+// STCC
+OPCODE(0x50F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x51F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x52F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x53F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x54F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x55F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x56F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x57F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x58F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x59F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x5AF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x5BF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x5CF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x5DF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x5EF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x5FF9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(20)
+}
+
+// STCC
+OPCODE(0x50DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x51DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x52DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x53DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x54DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x55DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x56DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x57DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x58DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x59DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5ADF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5BDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5CDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5DDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5EDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x5FDF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(12)
+}
+
+// STCC
+OPCODE(0x50E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x51E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x52E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x53E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x54E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (!(flag_C & 0x100))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x55E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (flag_C & 0x100)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x56E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x57E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (!flag_NotZ)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x58E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (!(flag_V & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x59E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (flag_V & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5AE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (!(flag_N & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5BE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (flag_N & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5CE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5DE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5EE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// STCC
+OPCODE(0x5FE7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = 0xFF;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+ }
+ res = 0;
+ PRE_IO
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+ RET(14)
+}
+
+// DBCC
+OPCODE(0x50C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ PC++;
+RET(12)
+}
+
+// DBCC
+OPCODE(0x51C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x52C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x53C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x54C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_C & 0x100)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x55C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_C & 0x100))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x56C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_NotZ)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x57C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x58C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_V & 0x80)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x59C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_V & 0x80))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x5AC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_N & 0x80)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x5BC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_N & 0x80))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x5CC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x5DC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x5EC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// DBCC
+OPCODE(0x5FC8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ res = DREGu16((Opcode >> 0) & 7);
+ res--;
+ DREGu16((Opcode >> 0) & 7) = res;
+ if ((s32)res != -1)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ }
+ else
+ {
+ PC++;
+ RET(12)
+ }
+ PC++;
+RET(14)
+}
+
+// ADDQ
+OPCODE(0x5000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = DREGu8((Opcode >> 0) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// ADDQ
+OPCODE(0x5010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDQ
+OPCODE(0x5018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDQ
+OPCODE(0x5020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDQ
+OPCODE(0x5028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDQ
+OPCODE(0x5030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDQ
+OPCODE(0x5038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDQ
+OPCODE(0x5039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDQ
+OPCODE(0x501F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDQ
+OPCODE(0x5027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDQ
+OPCODE(0x5040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = DREGu16((Opcode >> 0) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// ADDQ
+OPCODE(0x5048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = AREGu32((Opcode >> 0) & 7);
+ res = dst + src;
+ AREG((Opcode >> 0) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_ // breaks Project-X
+RET(4)
+#else
+RET(8)
+#endif
+}
+
+// ADDQ
+OPCODE(0x5050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDQ
+OPCODE(0x5058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDQ
+OPCODE(0x5060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDQ
+OPCODE(0x5068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDQ
+OPCODE(0x5070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDQ
+OPCODE(0x5078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDQ
+OPCODE(0x5079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDQ
+OPCODE(0x505F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDQ
+OPCODE(0x5067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDQ
+OPCODE(0x5080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = DREGu32((Opcode >> 0) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ADDQ
+OPCODE(0x5088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = AREGu32((Opcode >> 0) & 7);
+ res = dst + src;
+ AREG((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ADDQ
+OPCODE(0x5090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDQ
+OPCODE(0x5098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDQ
+OPCODE(0x50A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ADDQ
+OPCODE(0x50A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ADDQ
+OPCODE(0x50B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// ADDQ
+OPCODE(0x50B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ADDQ
+OPCODE(0x50B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ADDQ
+OPCODE(0x509F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDQ
+OPCODE(0x50A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SUBQ
+OPCODE(0x5100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = DREGu8((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// SUBQ
+OPCODE(0x5110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBQ
+OPCODE(0x5118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBQ
+OPCODE(0x5120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBQ
+OPCODE(0x5128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBQ
+OPCODE(0x5130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBQ
+OPCODE(0x5138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBQ
+OPCODE(0x5139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBQ
+OPCODE(0x511F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBQ
+OPCODE(0x5127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBQ
+OPCODE(0x5140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = DREGu16((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// SUBQ
+OPCODE(0x5148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = AREGu32((Opcode >> 0) & 7);
+ res = dst - src;
+ AREG((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// SUBQ
+OPCODE(0x5150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBQ
+OPCODE(0x5158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBQ
+OPCODE(0x5160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBQ
+OPCODE(0x5168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBQ
+OPCODE(0x5170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBQ
+OPCODE(0x5178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBQ
+OPCODE(0x5179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBQ
+OPCODE(0x515F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBQ
+OPCODE(0x5167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBQ
+OPCODE(0x5180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = DREGu32((Opcode >> 0) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// SUBQ
+OPCODE(0x5188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ dst = AREGu32((Opcode >> 0) & 7);
+ res = dst - src;
+ AREG((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// SUBQ
+OPCODE(0x5190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBQ
+OPCODE(0x5198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBQ
+OPCODE(0x51A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SUBQ
+OPCODE(0x51A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// SUBQ
+OPCODE(0x51B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// SUBQ
+OPCODE(0x51B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// SUBQ
+OPCODE(0x51B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// SUBQ
+OPCODE(0x519F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBQ
+OPCODE(0x51A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (((Opcode >> 9) - 1) & 7) + 1;
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// BCC
+OPCODE(0x6201)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6301)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6401)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_C & 0x100))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6501)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_C & 0x100)
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6601)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ)
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6701)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_NotZ)
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6801)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_V & 0x80))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6901)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_V & 0x80)
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6A01)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_N & 0x80))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6B01)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_N & 0x80)
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6C01)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6D01)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6E01)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC
+OPCODE(0x6F01)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+ m68kcontext.io_cycle_counter -= 2;
+ }
+RET(8)
+}
+
+// BCC16
+OPCODE(0x6200)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!(flag_C & 0x100)))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6300)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || (flag_C & 0x100))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6400)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_C & 0x100))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6500)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_C & 0x100)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6600)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6700)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!flag_NotZ)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6800)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_V & 0x80))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6900)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_V & 0x80)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6A00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!(flag_N & 0x80))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6B00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_N & 0x80)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6C00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (!((flag_N ^ flag_V) & 0x80))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6D00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((flag_N ^ flag_V) & 0x80)
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6E00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BCC16
+OPCODE(0x6F00)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ RET(10)
+ }
+ PC++;
+RET(12)
+}
+
+// BRA
+OPCODE(0x6001)
+{
+#ifdef FAMEC_CHECK_BRANCHES
+ u32 newPC = (u32)(PC) - BasePC;
+ s8 offs=Opcode;
+ newPC += offs;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(offs)
+#else
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+#endif
+RET(10)
+}
+
+// BRA16
+OPCODE(0x6000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ {
+ u32 newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ }
+RET(10)
+}
+
+// BSR
+OPCODE(0x6101)
+{
+ u32 adr, res;
+ u32 src, dst;
+ u32 oldPC;
+ s8 offs;
+
+ PRE_IO
+
+ oldPC = (u32)(PC) - BasePC;
+ PUSH_32_F(oldPC)
+#ifdef FAMEC_CHECK_BRANCHES
+ offs = Opcode;
+ oldPC += offs;
+ SET_PC(oldPC);
+ CHECK_BRANCH_EXCEPTION(offs)
+#else
+ PC += ((s8)(Opcode & 0xFE)) >> 1;
+#endif
+ POST_IO
+RET(18)
+}
+
+// BSR16
+OPCODE(0x6100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ PRE_IO
+ {
+ u32 oldPC, newPC;
+
+ newPC = (u32)(PC) - BasePC;
+ oldPC = newPC + 2;
+ PUSH_32_F(oldPC)
+ newPC += GET_SWORD;
+ SET_PC(newPC);
+ CHECK_BRANCH_EXCEPTION(newPC)
+ }
+ POST_IO
+RET(18)
+}
+
+// MOVEQ
+OPCODE(0x7000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = (s32)(s8)Opcode;
+ flag_C = flag_V = 0;
+ flag_N = flag_NotZ = res;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ORaD
+OPCODE(0x8000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ORaD
+OPCODE(0x8010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ORaD
+OPCODE(0x8028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ORaD
+OPCODE(0x8030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x8038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ORaD
+OPCODE(0x8039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ORaD
+OPCODE(0x803A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ORaD
+OPCODE(0x803B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x803C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ORaD
+OPCODE(0x801F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ORaD
+OPCODE(0x8040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ORaD
+OPCODE(0x8050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ORaD
+OPCODE(0x8068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ORaD
+OPCODE(0x8070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x8078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ORaD
+OPCODE(0x8079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ORaD
+OPCODE(0x807A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ORaD
+OPCODE(0x807B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x807C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ORaD
+OPCODE(0x805F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ORaD
+OPCODE(0x8080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ORaD
+OPCODE(0x8090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x8098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x80A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ORaD
+OPCODE(0x80A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ORaD
+OPCODE(0x80B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ORaD
+OPCODE(0x80B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ORaD
+OPCODE(0x80B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(22)
+}
+
+// ORaD
+OPCODE(0x80BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ORaD
+OPCODE(0x80BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ORaD
+OPCODE(0x80BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(16)
+}
+
+// ORaD
+OPCODE(0x809F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ORaD
+OPCODE(0x80A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ORDa
+OPCODE(0x8110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ORDa
+OPCODE(0x8118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ORDa
+OPCODE(0x8120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ORDa
+OPCODE(0x8128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORDa
+OPCODE(0x8130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ORDa
+OPCODE(0x8138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORDa
+OPCODE(0x8139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORDa
+OPCODE(0x811F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ORDa
+OPCODE(0x8127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ORDa
+OPCODE(0x8150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ORDa
+OPCODE(0x8158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ORDa
+OPCODE(0x8160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ORDa
+OPCODE(0x8168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORDa
+OPCODE(0x8170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ORDa
+OPCODE(0x8178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ORDa
+OPCODE(0x8179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORDa
+OPCODE(0x815F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ORDa
+OPCODE(0x8167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ORDa
+OPCODE(0x8190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORDa
+OPCODE(0x8198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORDa
+OPCODE(0x81A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ORDa
+OPCODE(0x81A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ORDa
+OPCODE(0x81B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// ORDa
+OPCODE(0x81B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ORDa
+OPCODE(0x81B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ORDa
+OPCODE(0x819F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ORDa
+OPCODE(0x81A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res |= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SBCD
+OPCODE(0x8100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ 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;
+ 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_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(6)
+}
+
+// SBCDM
+OPCODE(0x8108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SBCD7M
+OPCODE(0x810F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SBCDM7
+OPCODE(0x8F08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SBCD7M7
+OPCODE(0x8F0F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// DIVU
+OPCODE(0x80C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(140)
+#else
+RET(10)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(140)
+#else
+RET(70)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(140)
+#else
+RET(90)
+#endif
+}
+
+// DIVU
+OPCODE(0x80D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(14)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+ RET(74)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(94)
+#endif
+}
+
+// DIVU
+OPCODE(0x80D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(14)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+ RET(74)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(94)
+#endif
+}
+
+// DIVU
+OPCODE(0x80E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(146)
+#else
+RET(16)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(146)
+#else
+ RET(76)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(146)
+#else
+RET(96)
+#endif
+}
+
+// DIVU
+OPCODE(0x80E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+RET(18)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+ RET(78)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+RET(98)
+#endif
+}
+
+// DIVU
+OPCODE(0x80F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(150)
+#else
+RET(20)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(150)
+#else
+ RET(80)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(150)
+#else
+RET(100)
+#endif
+}
+
+// DIVU
+OPCODE(0x80F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+RET(18)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+ RET(78)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+RET(98)
+#endif
+}
+
+// DIVU
+OPCODE(0x80F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(162)
+#else
+RET(22)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(162)
+#else
+ RET(82)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(162)
+#else
+RET(102)
+#endif
+}
+
+// DIVU
+OPCODE(0x80FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+RET(18)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+ RET(78)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(148)
+#else
+RET(98)
+#endif
+}
+
+// DIVU
+OPCODE(0x80FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(160)
+#else
+RET(20)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(160)
+#else
+ RET(80)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(160)
+#else
+RET(100)
+#endif
+}
+
+// DIVU
+OPCODE(0x80FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(14)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+ RET(74)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(94)
+#endif
+}
+
+// DIVU
+OPCODE(0x80DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(14)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+ RET(74)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(144)
+#else
+RET(94)
+#endif
+}
+
+// DIVU
+OPCODE(0x80E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(146)
+#else
+RET(16)
+#endif
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ {
+ u32 q, r;
+
+ q = dst / src;
+ r = dst % src;
+
+ if (q & 0xFFFF0000)
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(146)
+#else
+ RET(76)
+#endif
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+RET(146)
+#else
+RET(96)
+#endif
+}
+
+// DIVS
+OPCODE(0x81C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs16((Opcode >> 0) & 7);
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(10)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(50)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(80)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(108)
+}
+
+// DIVS
+OPCODE(0x81D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(14)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(54)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(84)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(112)
+}
+
+// DIVS
+OPCODE(0x81D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(14)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(54)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(84)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(112)
+}
+
+// DIVS
+OPCODE(0x81E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(16)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(56)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(86)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(114)
+}
+
+// DIVS
+OPCODE(0x81E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(18)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(58)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(88)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(116)
+}
+
+// DIVS
+OPCODE(0x81F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(20)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(60)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(90)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(118)
+}
+
+// DIVS
+OPCODE(0x81F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(18)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(58)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(88)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(116)
+}
+
+// DIVS
+OPCODE(0x81F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(22)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(62)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(92)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(120)
+}
+
+// DIVS
+OPCODE(0x81FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(18)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(58)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(88)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(116)
+}
+
+// DIVS
+OPCODE(0x81FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(20)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(60)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(90)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(118)
+}
+
+// DIVS
+OPCODE(0x81FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(src);
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(14)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(54)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(84)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(112)
+}
+
+// DIVS
+OPCODE(0x81DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(14)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(54)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(84)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(112)
+}
+
+// DIVS
+OPCODE(0x81E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ if (src == 0)
+ {
+ execute_exception(M68K_ZERO_DIVIDE_EX);
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(16)
+ }
+ dst = DREGu32((Opcode >> 9) & 7);
+ if ((dst == 0x80000000) && (src == (u32)-1))
+ {
+ flag_NotZ = flag_N = 0;
+ flag_V = flag_C = 0;
+ res = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(56)
+ }
+ {
+ s32 q, r;
+
+ q = (s32)dst / (s32)src;
+ r = (s32)dst % (s32)src;
+
+ if ((q > 0x7FFF) || (q < -0x8000))
+ {
+ flag_V = M68K_SR_V;
+#ifdef USE_CYCLONE_TIMING_DIV
+goto end;
+#endif
+ RET(86)
+ }
+ q &= 0x0000FFFF;
+ flag_NotZ = q;
+ flag_N = q >> 8;
+ flag_V = flag_C = 0;
+ res = q | (r << 16);
+ DREGu32((Opcode >> 9) & 7) = res;
+ }
+#ifdef USE_CYCLONE_TIMING_DIV
+end: m68kcontext.io_cycle_counter -= 50;
+#endif
+RET(114)
+}
+
+// SUBaD
+OPCODE(0x9000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// SUBaD
+OPCODE(0x9008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+*/
+RET(4)
+}
+
+// SUBaD
+OPCODE(0x9010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBaD
+OPCODE(0x9028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBaD
+OPCODE(0x9030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x9038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBaD
+OPCODE(0x9039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBaD
+OPCODE(0x903A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBaD
+OPCODE(0x903B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x903C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x901F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBaD
+OPCODE(0x9040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// SUBaD
+OPCODE(0x9048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// SUBaD
+OPCODE(0x9050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBaD
+OPCODE(0x9068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBaD
+OPCODE(0x9070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x9078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBaD
+OPCODE(0x9079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBaD
+OPCODE(0x907A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBaD
+OPCODE(0x907B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x907C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x905F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBaD
+OPCODE(0x9080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBaD
+OPCODE(0x9090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x9098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x90A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBaD
+OPCODE(0x90A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBaD
+OPCODE(0x90B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// SUBaD
+OPCODE(0x90B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBaD
+OPCODE(0x90B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(22)
+}
+
+// SUBaD
+OPCODE(0x90BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBaD
+OPCODE(0x90BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// SUBaD
+OPCODE(0x90BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(16)
+}
+
+// SUBaD
+OPCODE(0x909F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBaD
+OPCODE(0x90A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBDa
+OPCODE(0x9110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBDa
+OPCODE(0x9118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBDa
+OPCODE(0x9120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBDa
+OPCODE(0x9128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBDa
+OPCODE(0x9130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBDa
+OPCODE(0x9138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBDa
+OPCODE(0x9139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBDa
+OPCODE(0x911F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBDa
+OPCODE(0x9127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBDa
+OPCODE(0x9150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBDa
+OPCODE(0x9158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBDa
+OPCODE(0x9160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBDa
+OPCODE(0x9168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBDa
+OPCODE(0x9170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBDa
+OPCODE(0x9178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// SUBDa
+OPCODE(0x9179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBDa
+OPCODE(0x915F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// SUBDa
+OPCODE(0x9167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// SUBDa
+OPCODE(0x9190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBDa
+OPCODE(0x9198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBDa
+OPCODE(0x91A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SUBDa
+OPCODE(0x91A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// SUBDa
+OPCODE(0x91B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// SUBDa
+OPCODE(0x91B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// SUBDa
+OPCODE(0x91B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// SUBDa
+OPCODE(0x919F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// SUBDa
+OPCODE(0x91A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// SUBX
+OPCODE(0x9100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ |= res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// SUBX
+OPCODE(0x9140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// SUBX
+OPCODE(0x9180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBXM
+OPCODE(0x9108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBXM
+OPCODE(0x9148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBXM
+OPCODE(0x9188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// SUBX7M
+OPCODE(0x910F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBX7M
+OPCODE(0x914F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBX7M
+OPCODE(0x918F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// SUBXM7
+OPCODE(0x9F08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBXM7
+OPCODE(0x9F48)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBXM7
+OPCODE(0x9F88)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// SUBX7M7
+OPCODE(0x9F0F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBX7M7
+OPCODE(0x9F4F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// SUBX7M7
+OPCODE(0x9F8F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst - src - ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// SUBA
+OPCODE(0x90C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs16((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBA
+OPCODE(0x90C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)AREGs16((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// SUBA
+OPCODE(0x90D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBA
+OPCODE(0x90D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBA
+OPCODE(0x90E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBA
+OPCODE(0x90E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBA
+OPCODE(0x90F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBA
+OPCODE(0x90F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBA
+OPCODE(0x90F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBA
+OPCODE(0x90FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBA
+OPCODE(0x90FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBA
+OPCODE(0x90FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(src);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// SUBA
+OPCODE(0x90DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// SUBA
+OPCODE(0x90E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// SUBA
+OPCODE(0x91C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs32((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(8)
+#else
+RET(6)
+#endif
+}
+
+// SUBA
+OPCODE(0x91C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)AREGs32((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(8)
+#else
+RET(6)
+#endif
+}
+
+// SUBA
+OPCODE(0x91D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBA
+OPCODE(0x91D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBA
+OPCODE(0x91E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// SUBA
+OPCODE(0x91E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBA
+OPCODE(0x91F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// SUBA
+OPCODE(0x91F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBA
+OPCODE(0x91F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(22)
+}
+
+// SUBA
+OPCODE(0x91FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// SUBA
+OPCODE(0x91FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// SUBA
+OPCODE(0x91FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(14)
+#endif
+}
+
+// SUBA
+OPCODE(0x91DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// SUBA
+OPCODE(0x91E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// CMP
+OPCODE(0xB000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+RET(4)
+}
+
+// CMP
+OPCODE(0xB008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+*/
+RET(4)
+}
+
+// CMP
+OPCODE(0xB010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(8)
+}
+
+// CMP
+OPCODE(0xB018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(8)
+}
+
+// CMP
+OPCODE(0xB020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(10)
+}
+
+// CMP
+OPCODE(0xB028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMP
+OPCODE(0xB030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMP
+OPCODE(0xB039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(16)
+}
+
+// CMP
+OPCODE(0xB03A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMP
+OPCODE(0xB03B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB03C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+RET(8)
+}
+
+// CMP
+OPCODE(0xB01F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(8)
+}
+
+// CMP
+OPCODE(0xB027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(10)
+}
+
+// CMP
+OPCODE(0xB040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+RET(4)
+}
+
+// CMP
+OPCODE(0xB048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+RET(4)
+}
+
+// CMP
+OPCODE(0xB050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(8)
+}
+
+// CMP
+OPCODE(0xB058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(8)
+}
+
+// CMP
+OPCODE(0xB060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(10)
+}
+
+// CMP
+OPCODE(0xB068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMP
+OPCODE(0xB070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMP
+OPCODE(0xB079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(16)
+}
+
+// CMP
+OPCODE(0xB07A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMP
+OPCODE(0xB07B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB07C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+RET(8)
+}
+
+// CMP
+OPCODE(0xB05F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(8)
+}
+
+// CMP
+OPCODE(0xB067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(10)
+}
+
+// CMP
+OPCODE(0xB080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(6)
+}
+
+// CMP
+OPCODE(0xB088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(6)
+}
+
+// CMP
+OPCODE(0xB090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB0A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// CMP
+OPCODE(0xB0A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMP
+OPCODE(0xB0B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMP
+OPCODE(0xB0B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMP
+OPCODE(0xB0B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(22)
+}
+
+// CMP
+OPCODE(0xB0BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMP
+OPCODE(0xB0BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMP
+OPCODE(0xB0BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(14)
+}
+
+// CMP
+OPCODE(0xB09F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMP
+OPCODE(0xB0A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// CMPM
+OPCODE(0xB108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMPM
+OPCODE(0xB148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMPM
+OPCODE(0xB188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMP7M
+OPCODE(0xB10F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 1;
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMP7M
+OPCODE(0xB14F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 2;
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMP7M
+OPCODE(0xB18F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) += 4;
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMPM7
+OPCODE(0xBF08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7);
+ AREG(7) += 2;
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMPM7
+OPCODE(0xBF48)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG(7);
+ AREG(7) += 2;
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMPM7
+OPCODE(0xBF88)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG(7);
+ AREG(7) += 4;
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMP7M7
+OPCODE(0xBF0F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7);
+ AREG(7) += 2;
+ READ_BYTE_F(adr, dst)
+ res = dst - src;
+ flag_N = flag_C = res;
+ flag_V = (src ^ dst) & (res ^ dst);
+ flag_NotZ = res & 0xFF;
+ POST_IO
+RET(12)
+}
+
+// CMP7M7
+OPCODE(0xBF4F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG(7);
+ AREG(7) += 2;
+ READ_WORD_F(adr, dst)
+ res = dst - src;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
+ flag_N = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ POST_IO
+RET(12)
+}
+
+// CMP7M7
+OPCODE(0xBF8F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG(7);
+ AREG(7) += 4;
+ READ_LONG_F(adr, dst)
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// EORDa
+OPCODE(0xB100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ res = DREGu8((Opcode >> 0) & 7);
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// EORDa
+OPCODE(0xB110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// EORDa
+OPCODE(0xB118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// EORDa
+OPCODE(0xB120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// EORDa
+OPCODE(0xB128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORDa
+OPCODE(0xB130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// EORDa
+OPCODE(0xB138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORDa
+OPCODE(0xB139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORDa
+OPCODE(0xB11F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// EORDa
+OPCODE(0xB127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// EORDa
+OPCODE(0xB140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ res = DREGu16((Opcode >> 0) & 7);
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(4)
+}
+
+// EORDa
+OPCODE(0xB150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// EORDa
+OPCODE(0xB158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// EORDa
+OPCODE(0xB160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// EORDa
+OPCODE(0xB168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORDa
+OPCODE(0xB170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// EORDa
+OPCODE(0xB178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// EORDa
+OPCODE(0xB179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORDa
+OPCODE(0xB15F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// EORDa
+OPCODE(0xB167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// EORDa
+OPCODE(0xB180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ res = DREGu32((Opcode >> 0) & 7);
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// EORDa
+OPCODE(0xB190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORDa
+OPCODE(0xB198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORDa
+OPCODE(0xB1A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// EORDa
+OPCODE(0xB1A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// EORDa
+OPCODE(0xB1B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// EORDa
+OPCODE(0xB1B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// EORDa
+OPCODE(0xB1B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// EORDa
+OPCODE(0xB19F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// EORDa
+OPCODE(0xB1A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res ^= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// CMPA
+OPCODE(0xB0C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs16((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(6)
+}
+
+// CMPA
+OPCODE(0xB0C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)AREGs16((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(6)
+}
+
+// CMPA
+OPCODE(0xB0D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(10)
+}
+
+// CMPA
+OPCODE(0xB0D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(10)
+}
+
+// CMPA
+OPCODE(0xB0E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(12)
+}
+
+// CMPA
+OPCODE(0xB0E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB0F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// CMPA
+OPCODE(0xB0F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB0F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMPA
+OPCODE(0xB0FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB0FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// CMPA
+OPCODE(0xB0FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(src);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(10)
+}
+
+// CMPA
+OPCODE(0xB0DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(10)
+}
+
+// CMPA
+OPCODE(0xB0E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(12)
+}
+
+// CMPA
+OPCODE(0xB1C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs32((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(6)
+}
+
+// CMPA
+OPCODE(0xB1C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)AREGs32((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(6)
+}
+
+// CMPA
+OPCODE(0xB1D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB1D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB1E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// CMPA
+OPCODE(0xB1E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMPA
+OPCODE(0xB1F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMPA
+OPCODE(0xB1F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMPA
+OPCODE(0xB1F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(22)
+}
+
+// CMPA
+OPCODE(0xB1FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(18)
+}
+
+// CMPA
+OPCODE(0xB1FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(20)
+}
+
+// CMPA
+OPCODE(0xB1FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB1DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(14)
+}
+
+// CMPA
+OPCODE(0xB1E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst - src;
+ flag_NotZ = res;
+ flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
+ flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
+ flag_N = res >> 24;
+ POST_IO
+RET(16)
+}
+
+// ANDaD
+OPCODE(0xC000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ANDaD
+OPCODE(0xC010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ANDaD
+OPCODE(0xC028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ANDaD
+OPCODE(0xC030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ANDaD
+OPCODE(0xC039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ANDaD
+OPCODE(0xC03A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ANDaD
+OPCODE(0xC03B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC03C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC01F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ res = DREGu8((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ANDaD
+OPCODE(0xC040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ANDaD
+OPCODE(0xC050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ANDaD
+OPCODE(0xC068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ANDaD
+OPCODE(0xC070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ANDaD
+OPCODE(0xC079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ANDaD
+OPCODE(0xC07A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ANDaD
+OPCODE(0xC07B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC07C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC05F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ANDaD
+OPCODE(0xC080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ANDaD
+OPCODE(0xC090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC0A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ANDaD
+OPCODE(0xC0A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ANDaD
+OPCODE(0xC0B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ANDaD
+OPCODE(0xC0B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ANDaD
+OPCODE(0xC0B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(22)
+}
+
+// ANDaD
+OPCODE(0xC0BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ANDaD
+OPCODE(0xC0BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ANDaD
+OPCODE(0xC0BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(16)
+}
+
+// ANDaD
+OPCODE(0xC09F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ANDaD
+OPCODE(0xC0A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ res = DREGu32((Opcode >> 9) & 7);
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ANDDa
+OPCODE(0xC110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ANDDa
+OPCODE(0xC118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ANDDa
+OPCODE(0xC120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ANDDa
+OPCODE(0xC128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDDa
+OPCODE(0xC130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ANDDa
+OPCODE(0xC138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDDa
+OPCODE(0xC139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDDa
+OPCODE(0xC11F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ANDDa
+OPCODE(0xC127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ANDDa
+OPCODE(0xC150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ANDDa
+OPCODE(0xC158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ANDDa
+OPCODE(0xC160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ANDDa
+OPCODE(0xC168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDDa
+OPCODE(0xC170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ANDDa
+OPCODE(0xC178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ANDDa
+OPCODE(0xC179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDDa
+OPCODE(0xC15F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ANDDa
+OPCODE(0xC167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 8;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ANDDa
+OPCODE(0xC190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDDa
+OPCODE(0xC198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDDa
+OPCODE(0xC1A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ANDDa
+OPCODE(0xC1A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ANDDa
+OPCODE(0xC1B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// ANDDa
+OPCODE(0xC1B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ANDDa
+OPCODE(0xC1B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ANDDa
+OPCODE(0xC19F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ANDDa
+OPCODE(0xC1A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, res)
+ res &= src;
+ flag_C = 0;
+ flag_V = 0;
+ flag_NotZ = res;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ABCD
+OPCODE(0xC100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ 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;
+ 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_N = res;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(6)
+}
+
+// ABCDM
+OPCODE(0xC108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ABCD7M
+OPCODE(0xC10F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ABCDM7
+OPCODE(0xCF08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ABCD7M7
+OPCODE(0xCF0F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ 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;
+ 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_N = res;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// MULU
+OPCODE(0xC0C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(54)
+#else
+RET(50)
+#endif
+}
+
+// MULU
+OPCODE(0xC0D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULU
+OPCODE(0xC0D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULU
+OPCODE(0xC0E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(60)
+#else
+RET(56)
+#endif
+}
+
+// MULU
+OPCODE(0xC0E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(62)
+#else
+RET(58)
+#endif
+}
+
+// MULU
+OPCODE(0xC0F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(64)
+#else
+RET(60)
+#endif
+}
+
+// MULU
+OPCODE(0xC0F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(62)
+#else
+RET(58)
+#endif
+}
+
+// MULU
+OPCODE(0xC0F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(66)
+#else
+RET(62)
+#endif
+}
+
+// MULU
+OPCODE(0xC0FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(62)
+#else
+RET(58)
+#endif
+}
+
+// MULU
+OPCODE(0xC0FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(64)
+#else
+RET(60)
+#endif
+}
+
+// MULU
+OPCODE(0xC0FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULU
+OPCODE(0xC0DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULU
+OPCODE(0xC0E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ res = DREGu16((Opcode >> 9) & 7);
+ res *= src;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(60)
+#else
+RET(56)
+#endif
+}
+
+// MULS
+OPCODE(0xC1C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs16((Opcode >> 0) & 7);
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(54)
+#else
+RET(50)
+#endif
+}
+
+// MULS
+OPCODE(0xC1D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULS
+OPCODE(0xC1D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULS
+OPCODE(0xC1E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(60)
+#else
+RET(56)
+#endif
+}
+
+// MULS
+OPCODE(0xC1E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(62)
+#else
+RET(58)
+#endif
+}
+
+// MULS
+OPCODE(0xC1F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(64)
+#else
+RET(60)
+#endif
+}
+
+// MULS
+OPCODE(0xC1F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(62)
+#else
+RET(58)
+#endif
+}
+
+// MULS
+OPCODE(0xC1F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(66)
+#else
+RET(62)
+#endif
+}
+
+// MULS
+OPCODE(0xC1FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(62)
+#else
+RET(58)
+#endif
+}
+
+// MULS
+OPCODE(0xC1FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(64)
+#else
+RET(60)
+#endif
+}
+
+// MULS
+OPCODE(0xC1FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(src);
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULS
+OPCODE(0xC1DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(58)
+#else
+RET(54)
+#endif
+}
+
+// MULS
+OPCODE(0xC1E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ res = (s32)DREGs16((Opcode >> 9) & 7);
+ res = ((s32)res) * ((s32)src);
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ flag_V = flag_C = 0;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+#ifdef USE_CYCLONE_TIMING
+RET(60)
+#else
+RET(56)
+#endif
+}
+
+// EXGDD
+OPCODE(0xC140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = DREGu32((Opcode >> 0) & 7);
+ src = DREGu32((Opcode >> 9) & 7);
+ DREGu32((Opcode >> 9) & 7) = res;
+ res = src;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// EXGAA
+OPCODE(0xC148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ src = AREGu32((Opcode >> 9) & 7);
+ AREG((Opcode >> 9) & 7) = res;
+ res = src;
+ AREG((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// EXGAD
+OPCODE(0xC188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ res = AREGu32((Opcode >> 0) & 7);
+ src = DREGu32((Opcode >> 9) & 7);
+ DREGu32((Opcode >> 9) & 7) = res;
+ res = src;
+ AREG((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ADDaD
+OPCODE(0xD000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ADDaD
+OPCODE(0xD008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ // can't read byte from Ax registers !
+ m68kcontext.execinfo |= M68K_FAULTED;
+ m68kcontext.io_cycle_counter = 0;
+/*
+ goto famec_Exec_End;
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+*/
+RET(4)
+}
+
+// ADDaD
+OPCODE(0xD010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDaD
+OPCODE(0xD028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDaD
+OPCODE(0xD030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDaD
+OPCODE(0xD039)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDaD
+OPCODE(0xD03A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDaD
+OPCODE(0xD03B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD03C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_BYTE(src);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD01F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD027)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDaD
+OPCODE(0xD040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ADDaD
+OPCODE(0xD048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ADDaD
+OPCODE(0xD050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDaD
+OPCODE(0xD068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDaD
+OPCODE(0xD070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDaD
+OPCODE(0xD079)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDaD
+OPCODE(0xD07A)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDaD
+OPCODE(0xD07B)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD07C)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_WORD(src);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD05F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD067)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDaD
+OPCODE(0xD080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = AREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDaD
+OPCODE(0xD090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD0A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDaD
+OPCODE(0xD0A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDaD
+OPCODE(0xD0B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ADDaD
+OPCODE(0xD0B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDaD
+OPCODE(0xD0B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(22)
+}
+
+// ADDaD
+OPCODE(0xD0BA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDaD
+OPCODE(0xD0BB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ADDaD
+OPCODE(0xD0BC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(16)
+}
+
+// ADDaD
+OPCODE(0xD09F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDaD
+OPCODE(0xD0A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDDa
+OPCODE(0xD110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDDa
+OPCODE(0xD118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 1;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDDa
+OPCODE(0xD120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDDa
+OPCODE(0xD128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDDa
+OPCODE(0xD130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDDa
+OPCODE(0xD138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDDa
+OPCODE(0xD139)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDDa
+OPCODE(0xD11F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDDa
+OPCODE(0xD127)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, dst)
+ res = dst + src;
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ = res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDDa
+OPCODE(0xD150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDDa
+OPCODE(0xD158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDDa
+OPCODE(0xD160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDDa
+OPCODE(0xD168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDDa
+OPCODE(0xD170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDDa
+OPCODE(0xD178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ADDDa
+OPCODE(0xD179)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDDa
+OPCODE(0xD15F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ADDDa
+OPCODE(0xD167)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 9) & 7);
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, dst)
+ res = dst + src;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ = res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ADDDa
+OPCODE(0xD190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDDa
+OPCODE(0xD198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDDa
+OPCODE(0xD1A0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ADDDa
+OPCODE(0xD1A8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ADDDa
+OPCODE(0xD1B0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(26)
+}
+
+// ADDDa
+OPCODE(0xD1B8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(24)
+}
+
+// ADDDa
+OPCODE(0xD1B9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(28)
+}
+
+// ADDDa
+OPCODE(0xD19F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ADDDa
+OPCODE(0xD1A7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 9) & 7);
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, dst)
+ res = dst + src;
+ flag_NotZ = res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(22)
+}
+
+// ADDX
+OPCODE(0xD100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu8((Opcode >> 0) & 7);
+ dst = DREGu8((Opcode >> 9) & 7);
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ |= res & 0xFF;
+ DREGu8((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ADDX
+OPCODE(0xD140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu16((Opcode >> 0) & 7);
+ dst = DREGu16((Opcode >> 9) & 7);
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ DREGu16((Opcode >> 9) & 7) = res;
+RET(4)
+}
+
+// ADDX
+OPCODE(0xD180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = DREGu32((Opcode >> 0) & 7);
+ dst = DREGu32((Opcode >> 9) & 7);
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ DREGu32((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDXM
+OPCODE(0xD108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDXM
+OPCODE(0xD148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDXM
+OPCODE(0xD188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ADDX7M
+OPCODE(0xD10F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 1;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDX7M
+OPCODE(0xD14F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 2;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDX7M
+OPCODE(0xD18F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG((Opcode >> 9) & 7) - 4;
+ AREG((Opcode >> 9) & 7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ADDXM7
+OPCODE(0xDF08)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 1;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDXM7
+OPCODE(0xDF48)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDXM7
+OPCODE(0xDF88)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ADDX7M7
+OPCODE(0xDF0F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_BYTE_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_BYTE_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_N = flag_X = flag_C = res;
+ flag_V = (src ^ res) & (dst ^ res);
+ flag_NotZ |= res & 0xFF;
+ WRITE_BYTE_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDX7M7
+OPCODE(0xDF4F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ READ_WORD_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_V = ((src ^ res) & (dst ^ res)) >> 8;
+ flag_N = flag_X = flag_C = res >> 8;
+ flag_NotZ |= res & 0xFFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ADDX7M7
+OPCODE(0xDF8F)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READ_LONG_F(adr, src)
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ READ_LONG_F(adr, dst)
+ res = dst + src + ((flag_X >> 8) & 1);
+ flag_NotZ |= res;
+ flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
+ flag_V = ((src ^ res) & (dst ^ res)) >> 24;
+ flag_N = res >> 24;
+ WRITE_LONG_F(adr, res)
+ POST_IO
+RET(30)
+}
+
+// ADDA
+OPCODE(0xD0C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs16((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDA
+OPCODE(0xD0C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)AREGs16((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+RET(8)
+}
+
+// ADDA
+OPCODE(0xD0D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDA
+OPCODE(0xD0D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDA
+OPCODE(0xD0E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDA
+OPCODE(0xD0E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDA
+OPCODE(0xD0F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDA
+OPCODE(0xD0F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDA
+OPCODE(0xD0F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDA
+OPCODE(0xD0FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDA
+OPCODE(0xD0FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDA
+OPCODE(0xD0FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(src);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+RET(12)
+}
+
+// ADDA
+OPCODE(0xD0DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(10)
+}
+
+// ADDA
+OPCODE(0xD0E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_WORD_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(12)
+}
+
+// ADDA
+OPCODE(0xD1C0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)DREGs32((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(8)
+#else
+RET(6)
+#endif
+}
+
+// ADDA
+OPCODE(0xD1C8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ src = (s32)AREGs32((Opcode >> 0) & 7);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(8)
+#else
+RET(6)
+#endif
+}
+
+// ADDA
+OPCODE(0xD1D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDA
+OPCODE(0xD1D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDA
+OPCODE(0xD1E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 4;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ADDA
+OPCODE(0xD1E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDA
+OPCODE(0xD1F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ADDA
+OPCODE(0xD1F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDA
+OPCODE(0xD1F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(22)
+}
+
+// ADDA
+OPCODE(0xD1FA)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = GET_SWORD + ((u32)(PC) - BasePC);
+ PC++;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(18)
+}
+
+// ADDA
+OPCODE(0xD1FB)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = (u32)(PC) - BasePC;
+ DECODE_EXT_WORD
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(20)
+}
+
+// ADDA
+OPCODE(0xD1FC)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(src);
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+#ifdef USE_CYCLONE_TIMING
+RET(16)
+#else
+RET(14)
+#endif
+}
+
+// ADDA
+OPCODE(0xD1DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 4;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(14)
+}
+
+// ADDA
+OPCODE(0xD1E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 4;
+ AREG(7) = adr;
+ PRE_IO
+ READSX_LONG_F(adr, src)
+ dst = AREGu32((Opcode >> 9) & 7);
+ res = dst + src;
+ AREG((Opcode >> 9) & 7) = res;
+ POST_IO
+RET(16)
+}
+
+// ASRk
+OPCODE(0xE000)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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);
+ res = ((s32)src) >> sft;
+ flag_N = res >> 0;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ASRk
+OPCODE(0xE040)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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);
+ res = ((s32)src) >> sft;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ASRk
+OPCODE(0xE080)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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);
+ res = ((s32)src) >> sft;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// LSRk
+OPCODE(0xE008)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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);
+ res = src >> sft;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// LSRk
+OPCODE(0xE048)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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);
+ res = src >> sft;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// LSRk
+OPCODE(0xE088)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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);
+ res = src >> sft;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ROXRk
+OPCODE(0xE010)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu8((Opcode >> 0) & 7);
+ src |= (flag_X & M68K_SR_X) << 0;
+ res = (src >> sft) | (src << (9 - sft));
+ flag_X = flag_C = res >> 0;
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ROXRk
+OPCODE(0xE050)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu16((Opcode >> 0) & 7);
+ src |= (flag_X & M68K_SR_X) << 8;
+ res = (src >> sft) | (src << (17 - sft));
+ flag_X = flag_C = res >> 8;
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ROXRk
+OPCODE(0xE090)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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)));
+ else res = (src >> sft) | (src << (33 - sft)) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + sft)));
+ flag_X = flag_C;
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// RORk
+OPCODE(0xE018)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu8((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
+ res = (src >> sft) | (src << (8 - sft));
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// RORk
+OPCODE(0xE058)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu16((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
+ res = (src >> sft) | (src << (16 - sft));
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// RORk
+OPCODE(0xE098)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu32((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
+ res = (src >> sft) | (src << (32 - sft));
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ASLk
+OPCODE(0xE100)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft < 8)
+ {
+ flag_X = flag_C = src << (0 + sft);
+ res = src << sft;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ flag_V = 0;
+ if ((sft > 7) && (src)) flag_V = M68K_SR_V;
+ else
+ {
+ u32 msk = (((s32)0x80000000) >> (sft + 24)) & 0x000000FF;
+ src &= msk;
+ if ((src) && (src != msk)) flag_V = M68K_SR_V;
+ }
+ RET(6)
+ }
+
+ if (src) flag_V = M68K_SR_V;
+ else flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ flag_N = 0;
+ flag_NotZ = 0;
+RET(6)
+}
+
+// ASLk
+OPCODE(0xE140)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu16((Opcode >> 0) & 7);
+ flag_X = flag_C = src >> (8 - sft);
+ res = src << sft;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+ flag_V = 0;
+ {
+ u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF;
+ src &= msk;
+ if ((src) && (src != msk)) flag_V = M68K_SR_V;
+ }
+RET(6)
+}
+
+// ASLk
+OPCODE(0xE180)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu32((Opcode >> 0) & 7);
+ flag_X = flag_C = src >> (24 - sft);
+ res = src << sft;
+ flag_N = res >> 24;
+ flag_NotZ = res & 0xFFFFFFFF;
+ DREGu32((Opcode >> 0) & 7) = res;
+ flag_V = 0;
+ {
+ u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF;
+ src &= msk;
+ if ((src) && (src != msk)) flag_V = M68K_SR_V;
+ }
+RET(8)
+}
+
+// LSLk
+OPCODE(0xE108)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu8((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_X = flag_C = src << (0 + sft);
+ res = src << sft;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// LSLk
+OPCODE(0xE148)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu16((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_X = flag_C = src >> (8 - sft);
+ res = src << sft;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// LSLk
+OPCODE(0xE188)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu32((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_X = flag_C = src >> (24 - sft);
+ res = src << sft;
+ flag_N = res >> 24;
+ flag_NotZ = res & 0xFFFFFFFF;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ROXLk
+OPCODE(0xE110)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu8((Opcode >> 0) & 7);
+ src |= (flag_X & M68K_SR_X) << 0;
+ res = (src << sft) | (src >> (9 - sft));
+ flag_X = flag_C = res >> 0;
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ROXLk
+OPCODE(0xE150)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu16((Opcode >> 0) & 7);
+ src |= (flag_X & M68K_SR_X) << 8;
+ res = (src << sft) | (src >> (17 - sft));
+ flag_X = flag_C = res >> 8;
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ROXLk
+OPCODE(0xE190)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.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));
+ else res = (src << sft) | (src >> (33 - sft)) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - sft));
+ flag_X = flag_C;
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ROLk
+OPCODE(0xE118)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu8((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_C = src << (0 + sft);
+ res = (src << sft) | (src >> (8 - sft));
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ROLk
+OPCODE(0xE158)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu16((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_C = src >> (8 - sft);
+ res = (src << sft) | (src >> (16 - sft));
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+RET(6)
+}
+
+// ROLk
+OPCODE(0xE198)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = (((Opcode >> 9) - 1) & 7) + 1;
+ m68kcontext.io_cycle_counter -= sft * 2;
+ src = DREGu32((Opcode >> 0) & 7);
+ flag_V = 0;
+ flag_C = src >> (24 - sft);
+ res = (src << sft) | (src >> (32 - sft));
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+RET(8)
+}
+
+// ASRD
+OPCODE(0xE020)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = (s32)DREGs8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 8)
+ {
+ flag_V = 0;
+ flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
+ res = ((s32)src) >> sft;
+ flag_N = res >> 0;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ if (src & (1 << 7))
+ {
+ flag_N = M68K_SR_N;
+ flag_NotZ = 1;
+ flag_V = 0;
+ flag_C = M68K_SR_C;
+ flag_X = M68K_SR_X;
+ res = 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ flag_C = 0;
+ flag_X = 0;
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ASRD
+OPCODE(0xE060)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = (s32)DREGs16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 16)
+ {
+ flag_V = 0;
+ flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
+ res = ((s32)src) >> sft;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ if (src & (1 << 15))
+ {
+ flag_N = M68K_SR_N;
+ flag_NotZ = 1;
+ flag_V = 0;
+ flag_C = M68K_SR_C;
+ flag_X = M68K_SR_X;
+ res = 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ flag_C = 0;
+ flag_X = 0;
+ res = 0;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ASRD
+OPCODE(0xE0A0)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = (s32)DREGs32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 32)
+ {
+ flag_V = 0;
+ flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
+ res = ((s32)src) >> sft;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ if (src & (1 << 31))
+ {
+ flag_N = M68K_SR_N;
+ flag_NotZ = 1;
+ flag_V = 0;
+ flag_C = M68K_SR_C;
+ flag_X = M68K_SR_X;
+ res = 0xFFFFFFFF;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ flag_C = 0;
+ flag_X = 0;
+ res = 0;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// LSRD
+OPCODE(0xE028)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft <= 8)
+ {
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
+ res = src >> sft;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_X = flag_C = 0;
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// LSRD
+OPCODE(0xE068)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft <= 16)
+ {
+ flag_N = flag_V = 0;
+ flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
+ res = src >> sft;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_X = flag_C = 0;
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ res = 0;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// LSRD
+OPCODE(0xE0A8)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 32)
+ {
+ flag_N = flag_V = 0;
+ flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
+ res = src >> sft;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ if (sft == 32) flag_C = src >> (31 - M68K_SR_C_SFT);
+ else flag_C = 0;
+ flag_X = flag_C;
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ res = 0;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// ROXRD
+OPCODE(0xE030)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft %= 9;
+
+ src |= (flag_X & M68K_SR_X) << 0;
+ res = (src >> sft) | (src << (9 - sft));
+ flag_X = flag_C = res >> 0;
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = flag_X;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ROXRD
+OPCODE(0xE070)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft %= 17;
+
+ src |= (flag_X & M68K_SR_X) << 8;
+ res = (src >> sft) | (src << (17 - sft));
+ flag_X = flag_C = res >> 8;
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = flag_X;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ROXRD
+OPCODE(0xE0B0)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.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));
+ flag_X = (src >> (32 - sft)) << M68K_SR_X_SFT;
+ }
+ else res = src;
+ flag_C = flag_X;
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = flag_X;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// RORD
+OPCODE(0xE038)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft &= 0x07;
+
+ flag_C = src << (M68K_SR_C_SFT - ((sft - 1) & 7));
+ res = (src >> sft) | (src << (8 - sft));
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// RORD
+OPCODE(0xE078)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft &= 0x0F;
+
+ flag_C = (src >> ((sft - 1) & 15)) << M68K_SR_C_SFT;
+ res = (src >> sft) | (src << (16 - sft));
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// RORD
+OPCODE(0xE0B8)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft &= 0x1F;
+
+ flag_C = (src >> ((sft - 1) & 31)) << M68K_SR_C_SFT;
+ res = (src >> sft) | (src << (32 - sft));
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// ASLD
+OPCODE(0xE120)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 8)
+ {
+ flag_X = flag_C = (src << sft) >> 0;
+ res = (src << sft) & 0x000000FF;
+ flag_N = res >> 0;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+ flag_V = 0;
+ {
+ u32 msk = (((s32)0x80000000) >> (sft + 24)) & 0x000000FF;
+ src &= msk;
+ if ((src) && (src != msk)) flag_V = M68K_SR_V;
+ }
+ RET(6)
+ }
+
+ if (sft == 256) flag_C = src << M68K_SR_C_SFT;
+ else flag_C = 0;
+ flag_X = flag_C;
+ if (src) flag_V = M68K_SR_V;
+ else flag_V = 0;
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ flag_N = 0;
+ flag_NotZ = 0;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ASLD
+OPCODE(0xE160)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 16)
+ {
+ flag_X = flag_C = (src << sft) >> 8;
+ res = (src << sft) & 0x0000FFFF;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+ flag_V = 0;
+ {
+ u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF;
+ src &= msk;
+ if ((src) && (src != msk)) flag_V = M68K_SR_V;
+ }
+ RET(6)
+ }
+
+ if (sft == 65536) flag_C = src << M68K_SR_C_SFT;
+ else flag_C = 0;
+ flag_X = flag_C;
+ if (src) flag_V = M68K_SR_V;
+ else flag_V = 0;
+ res = 0;
+ DREGu16((Opcode >> 0) & 7) = res;
+ flag_N = 0;
+ flag_NotZ = 0;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ASLD
+OPCODE(0xE1A0)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 32)
+ {
+ flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
+ res = src << sft;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ flag_V = 0;
+ {
+ u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF;
+ src &= msk;
+ if ((src) && (src != msk)) flag_V = M68K_SR_V;
+ }
+ RET(CYC)
+ }
+
+ if (sft == 0) flag_C = src << M68K_SR_C_SFT;
+ else flag_C = 0;
+ flag_X = flag_C;
+ if (src) flag_V = M68K_SR_V;
+ else flag_V = 0;
+ res = 0;
+ DREGu32((Opcode >> 0) & 7) = res;
+ flag_N = 0;
+ flag_NotZ = 0;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// LSLD
+OPCODE(0xE128)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft <= 8)
+ {
+ flag_X = flag_C = (src << sft) >> 0;
+ res = (src << sft) & 0x000000FF;
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_X = flag_C = 0;
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ res = 0;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// LSLD
+OPCODE(0xE168)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft <= 16)
+ {
+ flag_X = flag_C = (src << sft) >> 8;
+ res = (src << sft) & 0x0000FFFF;
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_X = flag_C = 0;
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ res = 0;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// LSLD
+OPCODE(0xE1A8)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft < 32)
+ {
+ flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
+ res = src << sft;
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ if (sft == 32) flag_C = src << M68K_SR_C_SFT;
+ else flag_C = 0;
+ flag_X = flag_C;
+ flag_N = 0;
+ flag_NotZ = 0;
+ flag_V = 0;
+ res = 0;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// ROXLD
+OPCODE(0xE130)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft %= 9;
+
+ src |= (flag_X & M68K_SR_X) << 0;
+ res = (src << sft) | (src >> (9 - sft));
+ flag_X = flag_C = res >> 0;
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res & 0x000000FF;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = flag_X;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ROXLD
+OPCODE(0xE170)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft %= 17;
+
+ src |= (flag_X & M68K_SR_X) << 8;
+ res = (src << sft) | (src >> (17 - sft));
+ flag_X = flag_C = res >> 8;
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = flag_X;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ROXLD
+OPCODE(0xE1B0)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ sft %= 33;
+
+ if (sft != 0)
+ {
+ if (sft == 1) res = (src << 1) | ((flag_X >> ((M68K_SR_X_SFT + 1) - 1)) & 1);
+ else res = (src << sft) | (src >> (33 - sft)) | (((flag_X >> ((M68K_SR_X_SFT + 1) - 1)) & 1) << (sft - 1));
+ flag_X = (src >> (32 - sft)) << M68K_SR_X_SFT;
+ }
+ else res = src;
+ flag_C = flag_X;
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = flag_X;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// ROLD
+OPCODE(0xE138)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu8((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft &= 0x07)
+ {
+ flag_C = (src << sft) >> 0;
+ res = ((src << sft) | (src >> (8 - sft))) & 0x000000FF;
+ flag_V = 0;
+ flag_N = res >> 0;
+ flag_NotZ = res;
+ DREGu8((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 0;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ROLD
+OPCODE(0xE178)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu16((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft &= 0x0F)
+ {
+ flag_C = (src << sft) >> 8;
+ res = ((src << sft) | (src >> (16 - sft))) & 0x0000FFFF;
+ flag_V = 0;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ DREGu16((Opcode >> 0) & 7) = res;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+ RET(6)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 8;
+ flag_NotZ = src;
+RET(6)
+}
+
+// ROLD
+OPCODE(0xE1B8)
+{
+#ifdef USE_CYCLONE_TIMING
+#define CYC 8
+#else
+#define CYC 6
+#endif
+ u32 adr, res;
+ u32 src, dst;
+
+ u32 sft;
+
+ sft = DREG((Opcode >> 9) & 7) & 0x3F;
+ src = DREGu32((Opcode >> 0) & 7);
+ if (sft)
+ {
+ m68kcontext.io_cycle_counter -= sft * 2;
+ if (sft &= 0x1F)
+ {
+ flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
+ res = (src << sft) | (src >> (32 - sft));
+ flag_V = 0;
+ flag_N = res >> 24;
+ flag_NotZ = res;
+ DREGu32((Opcode >> 0) & 7) = res;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+ RET(CYC)
+ }
+
+ flag_V = 0;
+ flag_C = 0;
+ flag_N = src >> 24;
+ flag_NotZ = src;
+RET(CYC)
+#undef CYC
+}
+
+// ASR
+OPCODE(0xE0D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ASR
+OPCODE(0xE0D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ASR
+OPCODE(0xE0E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ASR
+OPCODE(0xE0E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ASR
+OPCODE(0xE0F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ASR
+OPCODE(0xE0F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ASR
+OPCODE(0xE0F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ASR
+OPCODE(0xE0DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ASR
+OPCODE(0xE0E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src & (1 << 15));
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// LSR
+OPCODE(0xE2D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// LSR
+OPCODE(0xE2D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// LSR
+OPCODE(0xE2E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// LSR
+OPCODE(0xE2E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// LSR
+OPCODE(0xE2F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// LSR
+OPCODE(0xE2F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// LSR
+OPCODE(0xE2F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// LSR
+OPCODE(0xE2DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// LSR
+OPCODE(0xE2E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_N = flag_V = 0;
+ flag_X = flag_C = src << M68K_SR_C_SFT;
+ res = src >> 1;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROXR
+OPCODE(0xE4D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROXR
+OPCODE(0xE4D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROXR
+OPCODE(0xE4E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROXR
+OPCODE(0xE4E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROXR
+OPCODE(0xE4F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ROXR
+OPCODE(0xE4F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROXR
+OPCODE(0xE4F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ROXR
+OPCODE(0xE4DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROXR
+OPCODE(0xE4E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
+ flag_C = flag_X = src << M68K_SR_C_SFT;
+ flag_N = res >> 8;
+ flag_NotZ = res;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROR
+OPCODE(0xE6D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROR
+OPCODE(0xE6D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROR
+OPCODE(0xE6E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROR
+OPCODE(0xE6E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROR
+OPCODE(0xE6F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ROR
+OPCODE(0xE6F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROR
+OPCODE(0xE6F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ROR
+OPCODE(0xE6DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROR
+OPCODE(0xE6E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src << M68K_SR_C_SFT;
+ res = (src >> 1) | (src << 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ASL
+OPCODE(0xE1D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ASL
+OPCODE(0xE1D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ASL
+OPCODE(0xE1E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ASL
+OPCODE(0xE1E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ASL
+OPCODE(0xE1F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ASL
+OPCODE(0xE1F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ASL
+OPCODE(0xE1F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ASL
+OPCODE(0xE1DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ASL
+OPCODE(0xE1E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_V = (src ^ res) >> 8;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// LSL
+OPCODE(0xE3D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// LSL
+OPCODE(0xE3D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// LSL
+OPCODE(0xE3E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// LSL
+OPCODE(0xE3E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// LSL
+OPCODE(0xE3F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// LSL
+OPCODE(0xE3F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// LSL
+OPCODE(0xE3F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// LSL
+OPCODE(0xE3DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// LSL
+OPCODE(0xE3E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_X = flag_C = src >> 7;
+ res = src << 1;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROXL
+OPCODE(0xE5D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROXL
+OPCODE(0xE5D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROXL
+OPCODE(0xE5E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROXL
+OPCODE(0xE5E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROXL
+OPCODE(0xE5F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ROXL
+OPCODE(0xE5F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROXL
+OPCODE(0xE5F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ROXL
+OPCODE(0xE5DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROXL
+OPCODE(0xE5E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
+ flag_X = flag_C = src >> 7;
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROL
+OPCODE(0xE7D0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROL
+OPCODE(0xE7D8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ AREG((Opcode >> 0) & 7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROL
+OPCODE(0xE7E0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7) - 2;
+ AREG((Opcode >> 0) & 7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
+// ROL
+OPCODE(0xE7E8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ adr += AREG((Opcode >> 0) & 7);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROL
+OPCODE(0xE7F0)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG((Opcode >> 0) & 7);
+ DECODE_EXT_WORD
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(18)
+}
+
+// ROL
+OPCODE(0xE7F8)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_SWORD(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(16)
+}
+
+// ROL
+OPCODE(0xE7F9)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ FETCH_LONG(adr);
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(20)
+}
+
+// ROL
+OPCODE(0xE7DF)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7);
+ AREG(7) += 2;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(12)
+}
+
+// ROL
+OPCODE(0xE7E7)
+{
+ u32 adr, res;
+ u32 src, dst;
+
+ adr = AREG(7) - 2;
+ AREG(7) = adr;
+ PRE_IO
+ READ_WORD_F(adr, src)
+ flag_V = 0;
+ flag_C = src >> 7;
+ res = (src << 1) | (src >> 15);
+ flag_N = res >> 8;
+ flag_NotZ = res & 0x0000FFFF;
+ WRITE_WORD_F(adr, res)
+ POST_IO
+RET(14)
+}
+
#include <stdio.h>
#define lprintf printf
#elif defined(PSP)
- #if 0
+ #if 1
#include <stdio.h>
#define lprintf printf
#else
# settings
-dprint = 1
+use_fame = 1
+
# profile = 1
# unzip
OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
# CPU cores
+ifeq "$(use_fame)" "1"
+DEFINC += -DEMU_F68K
+OBJS += ../../cpu/fame/famec.o
+else
DEFINC += -DEMU_M68K
OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
+endif
# mz80
DEFINC += -D_USE_MZ80
OBJS += ../../cpu/mz80/mz80.o
@echo $@
@$(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@ # -mtune=arm940t -DEXTERNAL_YM2612
+../../cpu/fame/famec.o : ../../cpu/fame/famec.c
+ @echo $<
+ @$(GCC) $(COPT) $(DEFINC) -Wno-unused -c $< -o $@
+
PSPSDK = $(shell psp-config --pspsdk-path)\r
\r
# settings\r
-use_musashi = 1\r
+#use_musashi = 1\r
use_mz80 = 1\r
amalgamate = 0\r
#profile = 1\r
CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC # -DBENCHMARK\r
CFLAGS += -Wall -Winline\r
ifeq ($(DEBUG),)\r
-CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
+CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -ffast-math\r
else\r
CFLAGS += -ggdb\r
endif\r
else\r
OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r
- ../../Pico/Patch.o\r
+ ../../Pico/Patch.o ../../Pico/Draw_amips.o\r
# Pico - CD\r
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
ifeq "$(use_musashi)" "1"\r
CFLAGS += -DEMU_M68K\r
OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o\r
+else\r
+CFLAGS += -DEMU_F68K\r
+OBJS += ../../cpu/fame/famec.o\r
endif\r
# z80\r
ifeq "$(use_mz80)" "1"\r
endif\r
\r
\r
-LIBS += -lpng -lm -lpspgu # -lpspaudio -lpspgu -lpsppower -lpsphprm -lz -lm -lstdc++\r
+LIBS += -lpng -lm -lpspgu -lpsppower -Wl,-Map=PicoDrive.map # -lpspaudio -lpsphprm\r
\r
# target\r
TARGET = PicoDrive\r
\r
include $(PSPSDK)/lib/build.mak\r
\r
-\r
# some additional rules\r
.c.o:\r
@echo ">>>" $<\r
$(CC) $(CFLAGS) -c $< -o $@\r
\r
+AS := psp-as\r
+\r
+.s.o:\r
+ @echo ">>>" $<\r
+ $(AS) -march=allegrex -mtune=allegrex $< -o $@\r
+\r
../../cpu/musashi/m68kops.c :\r
make -C ../../cpu/musashi\r
\r
../../tools/textfilter: ../../tools/textfilter.c\r
make -C ../../tools/ textfilter\r
\r
+../../cpu/fame/famec.o : ../../cpu/fame/famec.c\r
+ @echo ">>>" $<\r
+ $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
\r
# ?\r
up: EBOOT.PBP\r
#include <sys/syslimits.h> // PATH_MAX
#include <pspthreadman.h>
+#include <pspdisplay.h>
#include "psp.h"
#include "menu.h"
currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP
currentConfig.Frameskip = -1; // auto
currentConfig.volume = 50;
+ currentConfig.CPUclock = 222;
currentConfig.KeyBinds[ 4] = 1<<0; // SACB RLDU
currentConfig.KeyBinds[ 6] = 1<<1;
currentConfig.KeyBinds[ 7] = 1<<2;
int i;
keys = psp_pad_read(0);
+ if (keys & PSP_CTRL_HOME)
+ sceDisplayWaitVblankStart();
+
if (keys & BTN_SELECT)
engineState = PGS_Menu;
fpsbuff[0] = 0;
+ if (currentConfig.CPUclock != psp_get_cpu_clock()) {
+ lprintf("setting cpu clock to %iMHz... ", currentConfig.CPUclock);
+ i = psp_set_cpu_clock(currentConfig.CPUclock);
+ lprintf(i ? "failed\n" : "done\n");
+ currentConfig.CPUclock = psp_get_cpu_clock();
+ }
+
// make sure we are in correct mode
vidResetMode();
Pico.m.dirtyPal = 1;
{ "Use SRAM/BRAM savestates", MB_ONOFF, MA_OPT_SRAM_STATES, ¤tConfig.EmuOpt, 0x0001, 0, 0, 1 },
{ NULL, MB_NONE, MA_OPT_CONFIRM_STATES,NULL, 0, 0, 0, 1 },
{ "Save slot", MB_RANGE, MA_OPT_SAVE_SLOT, &state_slot, 0, 0, 9, 1 },
+ { NULL, MB_NONE, MA_OPT_CPU_CLOCKS, NULL, 0, 0, 0, 1 },
{ "[Sega/Mega CD options]", MB_NONE, MA_OPT_SCD_OPTS, NULL, 0, 0, 0, 1 },
{ "[advanced options]", MB_NONE, MA_OPT_ADV_OPTS, NULL, 0, 0, 0, 1 },
{ NULL, MB_NONE, MA_OPT_SAVECFG, NULL, 0, 0, 0, 1 },
}
text_out16(x, y, "Confirm savestate %s", str);
break;
+ case MA_OPT_CPU_CLOCKS:
+ text_out16(x, y, "CPU/bus clock %3i/%3iMHz", currentConfig.CPUclock, currentConfig.CPUclock/2);
+ break;
case MA_OPT_SAVECFG:
str24[0] = 0;
if (config_slot != 0) sprintf(str24, " (profile: %i)", config_slot);
} else {state_slot--; if (state_slot < 0) state_slot = 9;
}
break;
+ case MA_OPT_CPU_CLOCKS:
+ while ((inp = psp_pad_read(0)) & (BTN_LEFT|BTN_RIGHT)) {
+ currentConfig.CPUclock += (inp & BTN_LEFT) ? -1 : 1;
+ if (currentConfig.CPUclock < 19) currentConfig.CPUclock = 19;
+ if (currentConfig.CPUclock > 333) currentConfig.CPUclock = 333;
+ draw_menu_options(menu_sel); // will wait vsync
+ }
+ break;
case MA_OPT_SAVECFG:
case MA_OPT_SAVECFG_GAME:
case MA_OPT_LOADCFG:
#define CPU_CALL\r
\r
// draw.c\r
+#define USE_BGR555 1\r
#define OVERRIDE_HIGHCOL 0\r
\r
// draw2.c\r
#include <pspkernel.h>
#include <pspiofilemgr.h>
#include <pspdisplay.h>
+#include <psppower.h>
#include <pspgu.h>
#include "psp.h"
void psp_video_flip(int wait_vsync)
{
if (wait_vsync) sceDisplayWaitVblankStart();
- sceDisplaySetFrameBuf(psp_screen, 512, PSP_DISPLAY_PIXEL_FORMAT_565, PSP_DISPLAY_SETBUF_NEXTFRAME);
+ sceDisplaySetFrameBuf(psp_screen, 512, PSP_DISPLAY_PIXEL_FORMAT_565,
+ wait_vsync ? PSP_DISPLAY_SETBUF_IMMEDIATE : PSP_DISPLAY_SETBUF_NEXTFRAME);
current_screen ^= 1;
psp_screen = current_screen ? PSP_VRAM_BASE0 : PSP_VRAM_BASE1;
}
return pad.Buttons;
}
+int psp_get_cpu_clock(void)
+{
+ return scePowerGetCpuClockFrequencyInt();
+}
+
+int psp_set_cpu_clock(int clock)
+{
+ int ret = scePowerSetClockFrequency(clock, clock, clock/2);
+ if (ret != 0) lprintf("failed to set clock: %i\n", ret);
+
+ return ret;
+}
+
/* alt logging */
#define LOG_FILE "log.log"
unsigned int psp_pad_read(int blocking);
+int psp_get_cpu_clock(void);
+int psp_set_cpu_clock(int clock);
/* shorter btn names */
#define BTN_UP PSP_CTRL_UP