From: notaz Date: Sun, 21 Oct 2007 10:20:56 +0000 (+0000) Subject: FAME + some random stuff added X-Git-Tag: v1.85~642 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70357ce52578dee0dd3b3663902cf872c3d34258;p=picodrive.git FAME + some random stuff added git-svn-id: file:///home/notaz/opt/svn/PicoDrive@276 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/Pico/Draw.c b/Pico/Draw.c index 20a18de1..1c562f6b 100644 --- a/Pico/Draw.c +++ b/Pico/Draw.c @@ -1186,35 +1186,49 @@ static void FinalizeLineRGB555(int sh) unsigned short *pal=HighPal; int len, i, t, dirtyPal = Pico.m.dirtyPal; - if(dirtyPal) { - unsigned short *ppal=Pico.cram; - for(i = 0x3f; i >= 0; i--) - pal[i] = (unsigned short) (((ppal[i]&0x00f)<<12)|((ppal[i]&0x0f0)<<3)|((ppal[i]&0xf00)>>7)); + if (dirtyPal) + { + unsigned int *spal=(void *)Pico.cram; + unsigned int *dpal=(void *)HighPal; + for (i = 0x3f/2; i >= 0; i--) +#ifdef USE_BGR555 + dpal[i] = ((spal[i]&0x000f000f)<< 1)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)<<4); +#else + dpal[i] = ((spal[i]&0x000f000f)<<12)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)>>7); +#endif Pico.m.dirtyPal = 0; } - if (Pico.video.reg[12]&1) { - len = 320; - } else { - if(!(PicoOpt&0x100)) pd+=32; - len = 256; - } - - if(sh) { - if(dirtyPal) { + if (sh) + { + if (dirtyPal) { // shadowed pixels - for(i = 0x3f; i >= 0; i--) + for (i = 0x3f; i >= 0; i--) pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x738e); // hilighted pixels - for(i = 0x3f; i >= 0; i--) { + for (i = 0x3f; i >= 0; i--) { t=pal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c; pal[0x80|i]=(unsigned short)t; } } } - for(i = 0; i < len; i++) + if (Pico.video.reg[12]&1) { + len = 320; + } else { + if (!(PicoOpt&0x100)) pd+=32; + len = 256; + } + +#ifndef PSP + for (i = 0; i < len; i++) pd[i] = pal[ps[i]]; +#else + { + extern void amips_clut(unsigned short *dst, unsigned char *src, unsigned short *pal, int count); + amips_clut(pd, ps, pal, len); + } +#endif } #endif diff --git a/Pico/Draw_.s b/Pico/Draw_.s deleted file mode 100644 index ccfdbe24..00000000 --- a/Pico/Draw_.s +++ /dev/null @@ -1,1423 +0,0 @@ -@ assembly "optimized" version of some funtions from draw.c -@ this is highly specialized, be careful if changing related C code! - -@ (c) Copyright 2006, notaz -@ All Rights Reserved - - -.extern Pico -.extern PicoOpt -.extern HighCol -.extern Scanline -.extern HighSprZ -.extern rendstatus -.extern DrawLineDest -.extern DrawStripVSRam -.extern DrawStripInterlace - - -@ helper -.macro TilePixel pat lsrr offs -.if !\lsrr - ands r4, \pat, r2 -.else - ands r4, \pat, r2, lsr #\lsrr -.endif - orrne r4, r3, r4 - strneb r4, [r1,#\offs] -.endm - -@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileNorm pat - TilePixel \pat, 12, 0 @ #0x0000f000 - TilePixel \pat, 8, 1 @ #0x00000f00 - TilePixel \pat, 4, 2 @ #0x000000f0 - TilePixel \pat, 0, 3 @ #0x0000000f - TilePixel \pat, 28, 4 @ #0xf0000000 - TilePixel \pat, 24, 5 @ #0x0f000000 - TilePixel \pat, 20, 6 @ #0x00f00000 - TilePixel \pat, 16, 7 @ #0x000f0000 -.endm - -@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileFlip pat - TilePixel \pat, 16, 0 @ #0x000f0000 - TilePixel \pat, 20, 1 @ #0x00f00000 - TilePixel \pat, 24, 2 @ #0x0f000000 - TilePixel \pat, 28, 3 @ #0xf0000000 - TilePixel \pat, 0, 4 @ #0x0000000f - TilePixel \pat, 4, 5 @ #0x000000f0 - TilePixel \pat, 8, 6 @ #0x00000f00 - TilePixel \pat, 12, 7 @ #0x0000f000 -.endm - -@ shadow/hilight mode - -@ this one is for hi priority layer -.macro TilePixelShHP pat lsrr offs - TilePixel \pat, \lsrr, \offs - ldreqb r4, [r1,#\offs] - tsteq r4, #0x80 - andeq r4, r4, #0x3f - streqb r4, [r1,#\offs] -.endm - -@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileNormShHP pat - TilePixelShHP \pat, 12, 0 @ #0x0000f000 - TilePixelShHP \pat, 8, 1 @ #0x00000f00 - TilePixelShHP \pat, 4, 2 @ #0x000000f0 - TilePixelShHP \pat, 0, 3 @ #0x0000000f - TilePixelShHP \pat, 28, 4 @ #0xf0000000 - TilePixelShHP \pat, 24, 5 @ #0x0f000000 - TilePixelShHP \pat, 20, 6 @ #0x00f00000 - TilePixelShHP \pat, 16, 7 @ #0x000f0000 -.endm - -@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileFlipShHP pat - TilePixelShHP \pat, 16, 0 @ #0x000f0000 - TilePixelShHP \pat, 20, 1 @ #0x00f00000 - TilePixelShHP \pat, 24, 2 @ #0x0f000000 - TilePixelShHP \pat, 28, 3 @ #0xf0000000 - TilePixelShHP \pat, 0, 4 @ #0x0000000f - TilePixelShHP \pat, 4, 5 @ #0x000000f0 - TilePixelShHP \pat, 8, 6 @ #0x00000f00 - TilePixelShHP \pat, 12, 7 @ #0x0000f000 -.endm - - -@ TileSingleSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx; r12: helper pattern 0xf -.macro TileSingleSh - tst r0, #1 @ not aligned? - mov r7, #0x00c000 - orr r7, r7, #0xc0 - ldrneb r4, [r1] - ldreqh r4, [r1] - orr r4, r4, r7 - strneb r4, [r1], #1 - streqh r4, [r1], #2 - ldrh r4, [r1] - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - orr r4, r4, r7 - strh r4, [r1], #2 - ldrneb r4, [r1] - orr r4, r4, r7 - strneb r4, [r1], #1 -.endm - -@ TileSingleHi (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf -.macro TileSingleHi - tst r1, #1 @ not aligned? - mov r7, #0x008000 - orr r7, r7, #0x80 - ldrneb r4, [r1] - ldreqh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strneb r4, [r1], #1 - streqh r4, [r1], #2 - ldrh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strh r4, [r1], #2 - ldrneb r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strneb r4, [r1], #1 -.endm - -.macro TileDoShGenPixel shift ofs -.if \shift - ands r4, r12, r2, lsr #\shift -.else - ands r4, r12, r2 -.endif - beq 3f - cmp r4, #0xe - beq 2f - bgt 1f - orr r4, r3, r4 - strb r4, [r1,#\ofs] - b 3f -1: - ldrb r4, [r1,#\ofs] - orr r4, r4, #0xc0 - strb r4, [r1,#\ofs] - b 3f -2: - ldrb r4, [r1,#\ofs] - bic r4, r4, #0xc0 - orr r4, r4, #0x80 - strb r4, [r1,#\ofs] -3: -.endm - -@ TileFlipSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf -.macro TileFlipSh - TileDoShGenPixel 16, 0 @ #0x000f0000 - TileDoShGenPixel 20, 1 @ #0x00f00000 - TileDoShGenPixel 24, 2 @ #0x0f000000 - TileDoShGenPixel 28, 3 @ #0xf0000000 - TileDoShGenPixel 0, 4 @ #0x0000000f - TileDoShGenPixel 4, 5 @ #0x000000f0 - TileDoShGenPixel 8, 6 @ #0x00000f00 - TileDoShGenPixel 12, 7 @ #0x0000f000 -.endm - -@ TileNormSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf -.macro TileNormSh - TileDoShGenPixel 12, 0 @ #0x0000f000 - TileDoShGenPixel 8, 1 @ #0x00000f00 - TileDoShGenPixel 4, 2 @ #0x000000f0 - TileDoShGenPixel 0, 3 @ #0x0000000f - TileDoShGenPixel 28, 4 @ #0xf0000000 - TileDoShGenPixel 24, 5 @ #0x0f000000 - TileDoShGenPixel 20, 6 @ #0x00f00000 - TileDoShGenPixel 16, 7 @ #0x000f0000 -.endm - - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -@ struct TileStrip -@ { -@ int nametab; // 0x00 -@ int line; // 0x04 -@ int hscroll; // 0x08 -@ int xmask; // 0x0C -@ int *hc; // 0x10 (pointer to cache buffer) -@ int cells; // 0x14 -@ }; - -@ int DrawLayer(int plane, int *hcache, int maxcells, int sh) - -.global DrawLayer @ int plane, int *hcache, int maxcells, int sh - -DrawLayer: - stmfd sp!, {r4-r11,lr} - - ldr r11, =(Pico+0x22228) @ Pico.video - - mov r6, r1 @ hcache - orr r9, r2, r3, lsl #31 @ r9=maxcells|(sh<<31) - - ldrb r7, [r11, #16] @ ??hh??ww - - mov r1, r7, lsl #4 - orr r1, r1, #0x00ff - - and r10, r7, #3 - cmp r10, #1 - biclt r1, r1, #0xfc00 - biceq r1, r1, #0xfe00 - bicgt r1, r1, #0xff00 @ r1=ymask=(height<<8)|0xff; ...; // Y Mask in pixels - - add r10, r10, #5 - cmp r10, #7 - subge r10, r10, #1 @ r10=shift[width] (5,6,6,7) - - @ calculate xmask: - mov r8, #1 - mov r5, r8, lsl r10 - sub r5, r5, #1 @ r5=xmask - - @ Find name table: - tst r0, r0 - ldreqb r12, [r11, #2] - moveq r12, r12, lsl #10 - ldrneb r12, [r11, #4] - movne r12, r12, lsl #13 - and r12, r12, #(7<<13) @ r12=(ts->nametab<<1) (halfword compliant) - - ldr r2, =Scanline - ldr r2, [r2] - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - - ldrh r8, [r11, #12] - mov r4, r8, lsr #8 @ pvid->reg[13] - mov r4, r4, lsl #10 @ htab=pvid->reg[13]<<9; (halfwords) - ldrb r7, [r11, #11] - tst r7, #2 - addne r4, r4, r2, lsl #2 @ htab+=Scanline<<1; // Offset by line - tst r7, #1 - biceq r4, r4, #0x1f @ htab&=~0xf; // Offset by tile - add r4, r4, r0, lsl #1 @ htab+=plane - bic r4, r4, #0x00ff0000 @ just in case - ldrh r3, [lr, r4] @ r3=hscroll - - tst r7, #4 - bne .DrawStrip_vsscroll - - @ Get vertical scroll value: - add r7, lr, #0x012000 - add r7, r7, #0x000180 @ r7=Pico.vsram (Pico+0x22180) - ldr r7, [r7] - - tst r8, #2 - tstne r8, #4 - bne .DrawStrip_interlace - - tst r0, r0 - movne r7, r7, lsr #16 - - @ Find the line in the name table - add r2, r2, r7 - and r2, r2, r1 - mov r4, r2, lsr #3 - add r10, r10, #1 @ shift[width]++ - add r12, r12, r4, lsl r10 @ nametab+=(ts.line>>3)<hscroll, r5=ts->xmask, r6=ts->hc, r9=ts->cells -@ mov r12,r1, lsl #1 @ r12=(ts->nametab<<1) (halfword compliant) - - and r10,r2, #7 - mov r10,r10, lsl #1 @ r10=ty=(ts->line&7)<<1; - orr r10,r10, r9, lsl #24 - - rsb r8, r3, #0 - mov r8, r8, lsr #3 @ r8=tilex=(-ts->hscroll)>>3 - - sub r1, r3, #1 - and r1, r1, #7 - add r7, r1, #1 @ r7=dx=((ts->hscroll-1)&7)+1 - - tst r9, #1<<31 - mov r3, #0 - orrne r10,r10, #1<<23 @ r10=(cells<<24|sh<<23|hi_not_empty<<22|ty) - movne r3, #0x40 @ default to shadowed pal on sh mode - - mvn r9, #0 @ r9=prevcode=-1 - - cmp r7, #8 - subeq r10,r10, #0x01000000 @ we will loop cells+1 times, so loop less when there is no scroll - - @ cache some stuff to avoid mem access - ldr r11,=HighCol - add r1, r11, r7 @ r1=pdest - mov r0, #0xf - b .dsloop_enter - - @ r4 & r7 are scratch in this loop -.dsloop: @ 40-41 times - add r1, r1, #8 -.dsloop_nor1: - subs r10,r10, #0x01000000 - add r8, r8, #1 - bmi .dsloop_exit - -.dsloop_enter: - and r7, r5, r8 - add r7, lr, r7, lsl #1 @ Pico.vram+((tilex&ts->xmask) as halfwords) - ldrh r7, [r7, r12] @ r7=code (int, but from unsigned, no sign extend) - - tst r7, #0x8000 - bne .DrawStrip_hiprio - - cmp r7, r9 - beq .DrawStrip_samecode @ we know stuff about this tile already - - mov r9, r7 @ remember code - - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 -@ bic r7, r10,#0xff000000 -@ add r2, r7, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty - add r2, r2, r10, lsl #17 - mov r2, r2, lsr #17 - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - - bic r7, r3, #0x3f - and r3, r9, #0x6000 - add r3, r7, r3, lsr #9 @ r3=pal=((code&0x6000)>>9); - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - -.DrawStrip_samecode: - tst r2, r2 - beq .dsloop @ tileline blank - - cmp r2, r2, ror #4 - beq .DrawStrip_SingleColor @ tileline singlecolor - - tst r9, #0x0800 - beq .DrawStrip_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern - TileFlip r0 - b .dsloop - -.DrawStrip_TileNorm: - TileNorm r0 - b .dsloop - -.DrawStrip_SingleColor: - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - tst r1, #1 @ not aligned? - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 @ have a remaining unaligned pixel? - b .dsloop_nor1 @ we incremeted r1 ourselves - -.DrawStrip_hiprio: - tst r10, #0x00c00000 - beq .DrawStrip_hiprio_maybempt - sub r0, r1, r11 - orr r7, r7, r0, lsl #16 - orr r7, r7, r10, lsl #25 @ (ty<<25) - tst r7, #0x1000 - eorne r7, r7, #7<<26 @ if(code&0x1000) cval^=7<<26; - str r7, [r6], #4 @ cache hi priority tile - mov r0, #0xf - b .dsloop - -.DrawStrip_hiprio_maybempt: - cmp r7, r9 - beq .dsloop @ must've been empty, otherwise we wouldn't get here - mov r9, r7 @ remember code - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 - add r2, r2, r10, lsl #17 - mov r2, r2, lsr #17 - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - tst r2, r2 - orrne r10, r10, #1<<22 - bne .DrawStrip_hiprio - b .dsloop - -.dsloop_exit: - mov r0, #0 - str r0, [r6] @ terminate the cache list - - ldmfd sp!, {r4-r11,lr} - bx lr - - -.DrawStrip_vsscroll: - @ shit, we have 2-cell column based vscroll - @ let the c code handle this (for now) - - @ int nametab; // 0x00 - @ int line; // 0x04 - @ int hscroll; // 0x08 - @ int xmask; // 0x0C - @ int *hc; // 0x10 (pointer to cache buffer) - @ int cells; // 0x14 - - sub sp, sp, #6*4 - orr r2, r1, r10, lsl #24 @ ts.line=ymask|(shift[width]<<24); // save some stuff instead of line - mov r1, r0 @ plane - mov r0, r12, lsr #1 @ halfwords - and r9, r9, #0xff - stmia sp, {r0,r2,r3,r5,r6,r9} - - mov r0, sp - bl DrawStripVSRam @ struct TileStrip *ts, int plane - - add sp, sp, #6*4 - ldmfd sp!, {r4-r11,lr} - bx lr - -@ interlace mode 2? Sonic 2? -.DrawStrip_interlace: - tst r0, r0 - moveq r7, r7, lsl #21 - movne r7, r7, lsl #5 - - @ Find the line in the name table - add r2, r7, r2, lsl #22 @ r2=(vscroll+(Scanline<<1))<<21 (11 bits); - orr r1, r1, #0x80000000 - and r2, r2, r1, ror #10 @ &((ymask<<1)|1)<<21; - mov r2, r2, lsr #21 - mov r4, r2, lsr #4 - mov r12, r12, lsr #1 @ halfwords - add r0, r12, r4, lsl r10 @ nametab+=(ts.line>>4)<>9); - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - -.dtfc_samecode: - tst r8, r8 - bne .dtfc_shadow - - tst r2, r2 - beq .dtfc_loop - - cmp r2, r2, ror #4 - beq .dtfc_SingleColor @ tileline singlecolor - - tst r5, #0x0800 - beq .dtfc_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlip r12 - b .dtfc_loop - -.dtfc_TileNorm: - TileNorm r12 - b .dtfc_loop - -.dtfc_SingleColor: - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - tst r1, #1 @ not aligned? - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 @ have a remaining unaligned pixel? - b .dtfc_loop - -.dtfc_shadow: - tst r2, r2 - beq .dtfc_shadow_blank - - cmp r2, r2, ror #4 - beq .dtfc_SingleColor @ tileline singlecolor - - tst r5, #0x0800 - beq .dtfc_TileNormShHP - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlipShHP r12 - b .dtfc_loop - -.dtfc_TileNormShHP: - TileNormShHP r12 - b .dtfc_loop - -.dtfc_shadow_blank: - ldrb r4, [r1] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1] - ldrb r4, [r1,#1] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#1] - ldrb r4, [r1,#2] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#2] - ldrb r4, [r1,#3] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#3] - ldrb r4, [r1,#4] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#4] - ldrb r4, [r1,#5] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#5] - ldrb r4, [r1,#6] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#6] - ldrb r4, [r1,#7] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#7] - b .dtfc_loop - -.pool - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -.global DrawSpritesFromCache @ int *hc, int sh - -DrawSpritesFromCache: - stmfd sp!, {r4-r11,lr} - - @ cache some stuff to avoid mem access - ldr r11,=HighCol - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - mov r6, r1, lsl #31 - orr r6, r6, #1<<30 - mov r12,#0xf - - mov r10, r0 - -.dsfc_loop: - ldr r9, [r10], #4 @ read code - tst r9, r9 - ldmeqfd sp!, {r4-r11,pc} - - mov r4, r9, lsl #28 - bic r6, r6, #7 - orr r6, r6, r4, lsr #30 - add r6, r6, #1 @ r6=s1cc???? ... ?????www (s=shadow/hilight, cc=pal, w=width) - - and r5, r9, #3 - add r5, r5, #1 @ r5=delta - tst r9, #0x10000 - rsbne r5, r5, #0 @ Flip X - mov r5, r5, lsl #4 - - mov r2, r9, lsr #17 - mov r8, r2, lsl #1 @ tile=((unsigned int)code>>17)<<1; - - and r3, r9, #0x30 @ r3=pal=(code&0x30); - - bic r6, r6, #3<<28 - orr r6, r6, r3, lsl #24 - - mov r0, r9, lsl #16 - mov r0, r0, asr #22 @ sx=(code<<16)>>22 - adds r0, r0, #0 @ set ZV - b .dsfc_inloop_enter - -@ scratch: r4, r7 -.dsfc_inloop: - sub r6, r6, #1 - tst r6, #7 - beq .dsfc_loop - adds r0, r0, #8 - add r8, r8, r5 - -.dsfc_inloop_enter: - ble .dsfc_inloop - cmp r0, #328 - bge .dsfc_loop - - mov r8, r8, lsl #17 - mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address - - ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+tile); // Get 8 pixels - tst r2, r2 - beq .dsfc_inloop - - add r1, r11, r0 @ r1=pdest - - cmp r12, r6, lsr #28 - beq .dsfc_shadow - - cmp r2, r2, ror #4 - beq .dsfc_SingleColor @ tileline singlecolor - - tst r9, #0x10000 - beq .dsfc_TileNorm - - @ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlip r12 - b .dsfc_inloop - -.dsfc_TileNorm: - TileNorm r12 - b .dsfc_inloop - -.dsfc_SingleColor: - tst r0, #1 @ not aligned? - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 - b .dsfc_inloop - -.dsfc_shadow: - cmp r2, r2, ror #4 - beq .dsfc_singlec_sh - - tst r9, #0x10000 - beq .dsfc_TileNorm_sh - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlipSh - b .dsfc_inloop - -.dsfc_TileNorm_sh: - TileNormSh - b .dsfc_inloop - -.dsfc_singlec_sh: - cmp r2, #0xe0000000 - bcc .dsfc_SingleColor @ normal singlecolor tileline (carry inverted in ARM) - tst r2, #0x10000000 - bne .dsfc_sh_sh - TileSingleHi - b .dsfc_inloop - -.dsfc_sh_sh: - TileSingleSh - b .dsfc_inloop - -.pool - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -@ + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size -@ + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -.global DrawSprite @ unsigned int *sprite, int **hc, int sh - -DrawSprite: - stmfd sp!, {r4-r9,r11,lr} - - ldr r3, [r0] @ sprite[0] - mov r6, r3, lsr #28 - sub r6, r6, #1 @ r6=width-1 (inc later) - mov r5, r3, lsr #24 - and r5, r5, #7 @ r5=height - - mov r4, r3, lsl #16 @ r4=sy<<16 (tmp) - - ldr r7, =Scanline - ldr r7, [r7] - sub r7, r7, r4, asr #16 @ r7=row=Scanline-sy - - tst r2, r2 - ldr r9, [r0, #4] - mov r2, r9, asr #16 @ r2=sx - bic r9, r9, #0xfe000000 - orrne r9, r9, #1<<31 @ r9=code|(sh<<31) - - tst r9, #0x1000 - movne r4, r5, lsl #3 - subne r4, r4, #1 - subne r7, r4, r7 @ if (code&0x1000) row=(height<<3)-1-row; // Flip Y - - mov r8, r9, lsl #21 - mov r8, r8, lsr #21 - add r8, r8, r7, lsr #3 @ tile+=row>>3; // Tile number increases going down - - tst r9, #0x0800 - mlane r8, r5, r6, r8 @ if (code&0x0800) { tile+=delta*(width-1); - rsbne r5, r5, #0 @ delta=-delta; } // r5=delta now - - mov r8, r8, lsl #4 - and r7, r7, #7 - add r8, r8, r7, lsl #1 @ tile+=(row&7)<<1; // Tile address - - tst r9, #0x8000 - bne .dspr_cache @ if(code&0x8000) // high priority - cache it - - @ cache some stuff to avoid mem access - ldr r11,=HighCol - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - mov r12,#0xf - - mov r5, r5, lsl #4 @ delta<<=4; // Delta of address - and r4, r9, #0x6000 - orr r9, r9, r4, lsl #16 - orr r9, r9, #0x10000000 @ r9=scc1 ???? ... (s=shadow/hilight, cc=pal) - - tst r9, #1<<31 - mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30); - orrne r3, r3, #0x40 @ shadow by default - - add r6, r6, #1 @ inc now - adds r0, r2, #0 @ mov sx to r0 and set ZV flags - b .dspr_loop_enter - -.dspr_loop: - subs r6, r6, #1 @ width-- - ldmeqfd sp!, {r4-r9,r11,pc}@ return - adds r0, r0, #8 @ sx+=8 - add r8, r8, r5 @ tile+=delta - -.dspr_loop_enter: - ble .dspr_loop @ sx <= 0 - cmp r0, #328 - ldmgefd sp!, {r4-r9,r11,pc}@ return - - mov r8, r8, lsl #17 - mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address - - ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - tst r2, r2 - beq .dspr_loop - - add r1, r11, r0 @ r1=pdest - - cmp r12, r9, lsr #28 - beq .dspr_shadow - - cmp r2, r2, ror #4 - beq .dspr_SingleColor @ tileline singlecolor - - tst r9, #0x0800 - beq .dspr_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlip r12 - b .dspr_loop - -@ scratch: r4, r7 -.dspr_TileNorm: - TileNorm r12 - b .dspr_loop - -.dspr_SingleColor: - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - tst r0, #1 @ not aligned? - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 - b .dspr_loop - -.dspr_shadow: - cmp r2, r2, ror #4 - beq .dspr_singlec_sh - - tst r9, #0x0800 - beq .dspr_TileNorm_sh - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlipSh - b .dspr_loop - -.dspr_TileNorm_sh: - TileNormSh - b .dspr_loop - -.dspr_singlec_sh: - cmp r2, #0xe0000000 - bcc .dspr_SingleColor @ normal tileline - tst r2, #0x10000000 - bne .dspr_sh_sh - TileSingleHi - b .dspr_loop - -.dspr_sh_sh: - TileSingleSh - b .dspr_loop - - -.dspr_cache: - @ *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf); - mov r4, r8, lsl #16 @ tile - tst r9, #0x0800 - orrne r4, r4, #0x10000 @ code&0x0800 - mov r2, r2, lsl #22 - orr r4, r4, r2, lsr #16 @ (sx<<6)&0x0000ffc0 - and r2, r9, #0x6000 - orr r4, r4, r2, lsr #9 @ (code>>9)&0x30 - mov r2, r3, lsl #12 - orr r4, r4, r2, lsr #28 @ (sprite[0]>>24)&0xf - - ldr r2, [r1] - str r4, [r2], #4 - str r2, [r1] - - ldmfd sp!, {r4-r9,r11,lr} - bx lr - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -.global DrawWindow @ int tstart, int tend, int prio, int sh // int *hcache - -DrawWindow: - stmfd sp!, {r4-r11,lr} - - ldr r11, =(Pico+0x22228) @ Pico.video - ldrb r12, [r11, #3] @ pvid->reg[3] - mov r12, r12, lsl #10 - - ldr r10, =Scanline - ldr r10, [r10] - mov r5, r10, lsr #3 - and r10, r10, #7 - mov r10, r10, lsl #1 @ r10=ty - - ldr r4, [r11, #12] - tst r4, #1 @ 40 cell mode? - andne r12, r12, #0xf000 @ 0x3c<<10 - andeq r12, r12, #0xf800 - addne r12, r12, r5, lsl #7 - addeq r12, r12, r5, lsl #6 @ nametab - add r12, r12, r0, lsl #2 @ +starttile - - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - - @ fetch the first code now - ldrh r7, [lr, r12] - - ldr r6, =rendstatus - ldrb r6, [r6] - ands r6, r6, #2 @ we care about bit 1 only - orr r6, r6, r2 - bne .dw_no_sameprio - - cmp r2, r7, lsr #15 - ldmnefd sp!, {r4-r11,pc} @ assume that whole window uses same priority - -.dw_no_sameprio: - orr r6, r6, r3, lsl #8 @ shadow mode - - sub r8, r1, r0 - mov r8, r8, lsl #1 @ cells - - mvn r9, #0 @ r9=prevcode=-1 - - @ cache some stuff to avoid mem access - ldr r11,=(HighCol+8) - add r1, r11, r0, lsl #4 @ r1=pdest - mov r0, #0xf - b .dwloop_enter - - @ r4,r5 & r7 are scratch in this loop -.dwloop: - add r1, r1, #8 -.dwloop_nor1: - subs r8, r8, #1 - add r12, r12, #2 @ halfwords - beq .dwloop_end @ done - - ldrh r7, [lr, r12] @ r7=code (int, but from unsigned, no sign extend) - - eor r5, r6, r7, lsr #15 - tst r5, #1 - orrne r6, r6, #2 @ wrong pri - bne .dwloop - - cmp r7, r9 - beq .dw_samecode @ we know stuff about this tile already - -.dwloop_enter: - mov r9, r7 @ remember code - - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 - add r2, r10, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - - and r3, r9, #0x6000 - mov r3, r3, lsr #9 @ r3=pal=((code&0x6000)>>9); - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - -.dw_samecode: - tst r6, #0x100 - bne .dw_shadow -.dw_shadow_done: - tst r2, r2 - beq .dwloop @ tileline blank - - cmp r2, r2, ror #4 - beq .dw_SingleColor @ tileline singlecolor - - tst r9, #0x0800 - beq .dw_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern - TileFlip r0 - b .dwloop - -.dw_TileNorm: - TileNorm r0 - b .dwloop - -.dw_SingleColor: - and r4, r0, r2 @ #0x0000000f - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - orr r4, r4, r4, lsl #16 - mov r5, r4 - stmia r1!, {r4,r5} - b .dwloop_nor1 @ we incremeted r1 ourselves - -.dw_shadow: - tst r6, #1 @ hi pri? - orreq r3, r3, #0x40 - beq .dw_shadow_done - ldr r4, [r1] - tst r4, #0x00000080 - biceq r4, r4, #0x000000c0 - tst r4, #0x00008000 - biceq r4, r4, #0x0000c000 - tst r4, #0x00800000 - biceq r4, r4, #0x00c00000 - tst r4, #0x80000000 - biceq r4, r4, #0xc0000000 - str r4, [r1] - ldr r4, [r1,#4] - tst r4, #0x00000080 - biceq r4, r4, #0x000000c0 - tst r4, #0x00008000 - biceq r4, r4, #0x0000c000 - tst r4, #0x00800000 - biceq r4, r4, #0x00c00000 - tst r4, #0x80000000 - biceq r4, r4, #0xc0000000 - str r4, [r1,#4] - b .dw_shadow_done - -.dwloop_end: - ldr r0, =rendstatus - ldr r1, [r0] - and r6, r6, #2 - orr r1, r1, r6 - str r1, [r0] - - ldmfd sp!, {r4-r11,r12} - bx r12 - - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -@ hilights 2 pixels in RGB444/BGR444 format -.macro TileDoShHi2Pixels444 reg - mov \reg, \reg, ror #12 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #24 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #12 -.endm - - -.global FinalizeLineBGR444 @ int sh - -FinalizeLineBGR444: - stmfd sp!, {r4-r6,lr} - mov r6, r0 - ldr r0, =DrawLineDest - ldr r0, [r0] - ldr lr, =(Pico+0x22228) @ Pico.video - sub r3, lr, #0x128 @ r3=Pico.cram - - ldrb r12, [lr, #12] - tst r12, #1 - movne r2, #320/4 @ len - moveq r2, #256/4 - addeq r0, r0, #32*2 - ldreq r4, =PicoOpt - ldreq r4, [r4] - tsteq r4, #0x100 - addeq r0, r0, #32*2 - - tst r6, r6 - beq .fl_noshBGR444 - - ldr r4, =HighPal - - ldrb r12, [lr, #-0x1a] @ 0x2220e ~ dirtyPal - tst r12, r12 - moveq r3, r4 - beq .fl_noshBGR444 - mov r12, #0 - strb r12, [lr, #-0x1a] - - mov lr, #0x40/8 - @ copy pal: -.fl_loopcpBGR444: - subs lr, lr, #1 - ldmia r3!, {r1,r5,r6,r12} - stmia r4!, {r1,r5,r6,r12} - bne .fl_loopcpBGR444 - - @ shadowed pixels: - mov r12, #0x0077 - orr r12,r12,#0x0700 - orr r12,r12,r12,lsl #16 - sub r3, r3, #0x40*2 - add r5, r4, #0x80*2 - mov lr, #0x40/4 -.fl_loopcpBGR444_sh: - subs lr, lr, #1 - ldmia r3!, {r1,r6} - and r1, r12, r1, lsr #1 - and r6, r12, r6, lsr #1 - stmia r4!, {r1,r6} - stmia r5!, {r1,r6} - bne .fl_loopcpBGR444_sh - - @ hilighted pixels: - sub r3, r3, #0x40*2 - mov lr, #0x40/2 -.fl_loopcpBGR444_hi: - ldr r1, [r3], #4 - TileDoShHi2Pixels444 r1 - str r1, [r4], #4 - subs lr, lr, #1 - bne .fl_loopcpBGR444_hi - - sub r3, r4, #0x40*3*2 - - -.fl_noshBGR444: - ldr r1, =(HighCol+8) - mov lr, #0xff - mov lr, lr, lsl #1 - -.fl_loopBGR444: - subs r2, r2, #1 - - ldr r12, [r1], #4 - - and r4, lr, r12, lsl #1 - ldrh r4, [r3, r4] - and r5, lr, r12, lsr #7 - ldrh r5, [r3, r5] - orr r4, r4, r5, lsl #16 - - and r5, lr, r12, lsr #15 - ldrh r5, [r3, r5] - and r6, lr, r12, lsr #23 - ldrh r6, [r3, r6] - orr r5, r5, r6, lsl #16 - - stmia r0!, {r4,r5} - bne .fl_loopBGR444 - - - ldmfd sp!, {r4-r6,lr} - bx lr - - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -@ hilights 2 pixels in RGB555/BGR555 format -.macro TileDoShHi2Pixels555 reg - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #26 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #26 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 -.endm - - -@ Convert 0000bbb0 ggg0rrr0 -@ to rrrrrggg gggbbbbb - -@ r2,r3,r9 - scratch, lr = 0x001c001c, r8 = 0x00030003 -.macro convRGB565 reg - and r2, lr, \reg,lsl #1 - and r9, r8, \reg,lsr #2 - orr r2, r2, r9 @ r2=red - and r3, lr, \reg,lsr #7 - and r9, r8, \reg,lsr #10 - orr r3, r3, r9 @ r3=blue - and \reg, \reg, lr, lsl #3 - orr \reg, \reg, \reg,lsl #3 @ green - orr \reg, \reg, r2, lsl #11 @ add red back - orr \reg, \reg, r3 @ add blue back -.endm - -vidConvCpyRGB565: @ void *to, void *from, int pixels - stmfd sp!, {r4-r9,lr} - - mov r12, r2, lsr #3 @ repeats - mov lr, #0x001c0000 - orr lr, lr, #0x01c @ lr == pattern 0x001c001c - mov r8, #0x00030000 - orr r8, r8, #0x003 @ lr == pattern 0x001c001c - -.loopRGB565: - subs r12, r12, #1 - - ldmia r1!, {r4-r7} - convRGB565 r4 - str r4, [r0], #4 - convRGB565 r5 - str r5, [r0], #4 - convRGB565 r6 - str r6, [r0], #4 - convRGB565 r7 - str r7, [r0], #4 - - bgt .loopRGB565 - - ldmfd sp!, {r4-r9,lr} - bx lr - - - -.global FinalizeLineRGB555 @ int sh - -FinalizeLineRGB555: - stmfd sp!, {r4-r8,lr} - ldr r5, =(Pico+0x22228) @ Pico.video - ldr r4, =HighPal - mov r6, r0 - - ldrb r7, [r5, #-0x1a] @ 0x2220e ~ dirtyPal - tst r7, r7 - beq .fl_noconvRGB555 - mov r1, #0 - strb r1, [r5, #-0x1a] - sub r1, r5, #0x128 @ r1=Pico.cram - mov r0, r4 - mov r2, #0x40 - bl vidConvCpyRGB565 - -.fl_noconvRGB555: - ldr r0, =DrawLineDest - ldr r0, [r0] - - ldrb r12, [r5, #12] - tst r12, #1 - movne r2, #320/8 @ len - moveq r2, #256/8 - ldreq r3, =PicoOpt - ldreq r3, [r3] - tsteq r3, #0x100 - addeq r0, r0, #32*2 - - mov r3, r4 - tst r6, r6 - beq .fl_noshRGB555 - tst r7, r7 - beq .fl_noshRGB555 - - @ shadowed pixels: - mov r12, #0x008e - orr r12,r12,#0x7300 - orr r12,r12,r12,lsl #16 - add r4, r3, #0x40*2 - add r5, r3, #0xc0*2 - mov lr, #0x40/4 -.fl_loopcpRGB555_sh: - subs lr, lr, #1 - ldmia r3!, {r1,r6} - and r1, r12, r1, lsr #1 - and r6, r12, r6, lsr #1 - stmia r4!, {r1,r6} - stmia r5!, {r1,r6} - bne .fl_loopcpRGB555_sh - - @ hilighted pixels: - sub r3, r3, #0x40*2 - mov lr, #0x40/2 -.fl_loopcpRGB555_hi: - ldr r1, [r3], #4 - TileDoShHi2Pixels555 r1 - str r1, [r4], #4 - subs lr, lr, #1 - bne .fl_loopcpRGB555_hi - - sub r3, r3, #0x40*2 - - -.fl_noshRGB555: - ldr r1, =(HighCol+8) - mov lr, #0xff - mov lr, lr, lsl #1 - -.fl_loopRGB555: - subs r2, r2, #1 - - ldr r12, [r1], #4 - ldr r7, [r1], #4 - - and r4, lr, r12, lsl #1 - ldrh r4, [r3, r4] - and r5, lr, r12, lsr #7 - ldrh r5, [r3, r5] - orr r4, r4, r5, lsl #16 - - and r5, lr, r12, lsr #15 - ldrh r5, [r3, r5] - and r6, lr, r12, lsr #23 - ldrh r6, [r3, r6] - orr r5, r5, r6, lsl #16 - - and r8, lr, r7, lsl #1 - ldrh r8, [r3, r8] - and r6, lr, r7, lsr #7 - ldrh r6, [r3, r6] - orr r8, r8, r6, lsl #16 - - and r12,lr, r7, lsr #15 - ldrh r12,[r3, r12] - and r6, lr, r7, lsr #23 - ldrh r6, [r3, r6] - orr r12,r12, r6, lsl #16 - - stmia r0!, {r4,r5,r8,r12} - bne .fl_loopRGB555 - - - ldmfd sp!, {r4-r8,lr} - bx lr - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -@ utility -.global blockcpy @ void *dst, void *src, size_t n - -blockcpy: - stmfd sp!, {r4,r5} - mov r2, r2, lsr #4 -blockcpy_loop: - subs r2, r2, #1 - ldmia r1!, {r3-r5,r12} - stmia r0!, {r3-r5,r12} - bne blockcpy_loop - ldmfd sp!, {r4,r5} - bx lr - - -.global blockcpy_or @ void *dst, void *src, size_t n, int pat - -blockcpy_or: - stmfd sp!, {r4-r6} - orr r3, r3, r3, lsl #8 - orr r3, r3, r3, lsl #16 - mov r2, r2, lsr #4 -blockcpy_loop_or: - subs r2, r2, #1 - ldmia r1!, {r4-r6,r12} - orr r4, r4, r3 - orr r5, r5, r3 - orr r6, r6, r3 - orr r12,r12,r3 - stmia r0!, {r4-r6,r12} - bne blockcpy_loop_or - ldmfd sp!, {r4-r6} - bx lr - diff --git a/Pico/Draw_amips.s b/Pico/Draw_amips.s new file mode 100644 index 00000000..859534f4 --- /dev/null +++ b/Pico/Draw_amips.s @@ -0,0 +1,42 @@ +# 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 + diff --git a/Pico/Draw_sh.c b/Pico/Draw_sh.c deleted file mode 100644 index 2f05a69a..00000000 --- a/Pico/Draw_sh.c +++ /dev/null @@ -1,1301 +0,0 @@ -// This is part of Pico Library - -// (c) Copyright 2004 Dave, All rights reserved. -// (c) Copyright 2006 notaz, All rights reserved. -// Free for non-commercial use. - -// For commercial use, separate licencing terms must be obtained. - - -#include "PicoInt.h" -#ifndef __GNUC__ -#pragma warning (disable:4706) // Disable assignment within conditional -#endif - -int (*PicoScan)(unsigned int num, void *data)=NULL; - -//unsigned short DefOutBuff[320*2]; -unsigned char HighCol[320*2]; -static int HighCacheA[41+1]; // caches for high layers -static int HighCacheB[41+1]; -static int HighCacheS[80+1]; // and sprites -static int HighPreSpr[80*2+1]; // slightly preprocessed sprites -char HighSprZ[320+8+8]; // Z-buffer for accurate sprites and shadow/hilight mode - // (if bit 7 == 0, sh caused by tile; if bit 6 == 0 pixel must be shadowed, else hilighted, if bit5 == 1) -// lsb->msb: moved sprites, all window tiles don't use same priority, accurate sprites (copied from PicoOpt), interlace -// dirty sprites, sonic mode, 16bit mode -int rendstatus=0x40; -void *DrawLineDest=HighCol; // pointer to dest buffer where to draw this line to -unsigned char *DrawLineInt=HighCol; // dest for internal code -int Scanline=0; // Scanline - -static int SpriteBlocks; -//unsigned short ppt[] = { 0x0f11, 0x0ff1, 0x01f1, 0x011f, 0x01ff, 0x0f1f, 0x0f0e, 0x0e7c }; - -struct TileStrip -{ - int nametab; // Position in VRAM of name table (for this tile line) - int line; // Line number in pixels 0x000-0x3ff within the virtual tilemap - int hscroll; // Horizontal scroll value in pixels for the line - int xmask; // X-Mask (0x1f - 0x7f) for horizontal wraparound in the tilemap - int *hc; // cache for high tile codes and their positions - int cells; // cells (tiles) to draw (32 col mode doesn't need to update whole 320) -}; - -// stuff available in asm: -#ifdef _ASM_DRAW_C -void DrawWindow(int tstart, int tend, int prio, int sh); -void BackFill(int reg7, int sh); -void DrawSprite(int *sprite, int **hc, int sh); -void DrawTilesFromCache(int *hc, int sh); -void DrawSpritesFromCache(int *hc, int sh); -void DrawLayer(int plane, int *hcache, int maxcells, int sh); -void FinalizeLineBGR444(int sh); -void FinalizeLineRGB555(int sh); -void blockcpy_or(void *dst, void *src, size_t n, int pat); -#else -// utility -void blockcpy_or(void *dst, void *src, size_t n, int pat) -{ - unsigned char *pd = dst, *ps = src; - for (; n; n--) - *pd++ = (unsigned char) (*ps++ | pat); -} -#endif - - -static int TileNorm(int sx,int addr,int pal) -{ - unsigned char *pd = DrawLineInt+sx; - unsigned int pack=0; unsigned int t=0; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - t=pack&0x0000f000; if (t) pd[0]=(unsigned char)(pal|(t>>12)); - t=pack&0x00000f00; if (t) pd[1]=(unsigned char)(pal|(t>> 8)); - t=pack&0x000000f0; if (t) pd[2]=(unsigned char)(pal|(t>> 4)); - t=pack&0x0000000f; if (t) pd[3]=(unsigned char)(pal|(t )); - t=pack&0xf0000000; if (t) pd[4]=(unsigned char)(pal|(t>>28)); - t=pack&0x0f000000; if (t) pd[5]=(unsigned char)(pal|(t>>24)); - t=pack&0x00f00000; if (t) pd[6]=(unsigned char)(pal|(t>>20)); - t=pack&0x000f0000; if (t) pd[7]=(unsigned char)(pal|(t>>16)); - return 0; - } - - return 1; // Tile blank -} - -static int TileFlip(int sx,int addr,int pal) -{ - unsigned char *pd = DrawLineInt+sx; - unsigned int pack=0; unsigned int t=0; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - t=pack&0x000f0000; if (t) pd[0]=(unsigned char)(pal|(t>>16)); - t=pack&0x00f00000; if (t) pd[1]=(unsigned char)(pal|(t>>20)); - t=pack&0x0f000000; if (t) pd[2]=(unsigned char)(pal|(t>>24)); - t=pack&0xf0000000; if (t) pd[3]=(unsigned char)(pal|(t>>28)); - t=pack&0x0000000f; if (t) pd[4]=(unsigned char)(pal|(t )); - t=pack&0x000000f0; if (t) pd[5]=(unsigned char)(pal|(t>> 4)); - t=pack&0x00000f00; if (t) pd[6]=(unsigned char)(pal|(t>> 8)); - t=pack&0x0000f000; if (t) pd[7]=(unsigned char)(pal|(t>>12)); - return 0; - } - return 1; // Tile blank -} - - -// tile renderers for hacky operator sprite support -#define sh_pix(x) \ - if(!t); \ - else if(t==0xe) pd[x]=(unsigned char)((pd[x]&0x3f)|0x80); /* hilight */ \ - else if(t==0xf) pd[x]=(unsigned char)((pd[x]&0x3f)|0xc0); /* shadow */ \ - else pd[x]=(unsigned char)(pal|t); - -#ifndef _ASM_DRAW_C -static int TileNormSH(int sx,int addr,int pal) -{ - unsigned int pack=0; unsigned int t=0; - unsigned char *pd = DrawLineInt+sx; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - t=(pack&0x0000f000)>>12; sh_pix(0); - t=(pack&0x00000f00)>> 8; sh_pix(1); - t=(pack&0x000000f0)>> 4; sh_pix(2); - t=(pack&0x0000000f) ; sh_pix(3); - t=(pack&0xf0000000)>>28; sh_pix(4); - t=(pack&0x0f000000)>>24; sh_pix(5); - t=(pack&0x00f00000)>>20; sh_pix(6); - t=(pack&0x000f0000)>>16; sh_pix(7); - return 0; - } - - return 1; // Tile blank -} - -static int TileFlipSH(int sx,int addr,int pal) -{ - unsigned int pack=0; unsigned int t=0; - unsigned char *pd = DrawLineInt+sx; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - t=(pack&0x000f0000)>>16; sh_pix(0); - t=(pack&0x00f00000)>>20; sh_pix(1); - t=(pack&0x0f000000)>>24; sh_pix(2); - t=(pack&0xf0000000)>>28; sh_pix(3); - t=(pack&0x0000000f) ; sh_pix(4); - t=(pack&0x000000f0)>> 4; sh_pix(5); - t=(pack&0x00000f00)>> 8; sh_pix(6); - t=(pack&0x0000f000)>>12; sh_pix(7); - return 0; - } - return 1; // Tile blank -} -#endif - -static int TileNormZ(int sx,int addr,int pal,int zval) -{ - unsigned int pack=0; unsigned int t=0; - unsigned char *pd = DrawLineInt+sx; - char *zb = HighSprZ+sx; - int collision = 0, zb_s; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - if(collision) Pico.video.status|=0x20; - return 0; - } - - return 1; // Tile blank -} - -static int TileFlipZ(int sx,int addr,int pal,int zval) -{ - unsigned int pack=0; unsigned int t=0; - unsigned char *pd = DrawLineInt+sx; - char *zb = HighSprZ+sx; - int collision = 0, zb_s; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - 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; } } - if(collision) Pico.video.status|=0x20; - return 0; - } - return 1; // Tile blank -} - - -#define sh_pixZ(x) \ - if(t) { \ - if(zb[x]) collision=1; \ - if(zval>zb[x]) { \ - if (t==0xe) { pd[x]=(unsigned char)((pd[x]&0x3f)|0x80); /* hilight */ } \ - else if(t==0xf) { pd[x]=(unsigned char)((pd[x]&0x3f)|0xc0); /* shadow */ } \ - else { zb[x]=(char)zval; pd[x]=(unsigned char)(pal|t); } \ - } \ - } - -static int TileNormZSH(int sx,int addr,int pal,int zval) -{ - unsigned int pack=0; unsigned int t=0; - unsigned char *pd = DrawLineInt+sx; - char *zb = HighSprZ+sx; - int collision = 0; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - t=(pack&0x0000f000)>>12; sh_pixZ(0); - t=(pack&0x00000f00)>> 8; sh_pixZ(1); - t=(pack&0x000000f0)>> 4; sh_pixZ(2); - t=(pack&0x0000000f) ; sh_pixZ(3); - t=(pack&0xf0000000)>>28; sh_pixZ(4); - t=(pack&0x0f000000)>>24; sh_pixZ(5); - t=(pack&0x00f00000)>>20; sh_pixZ(6); - t=(pack&0x000f0000)>>16; sh_pixZ(7); - if(collision) Pico.video.status|=0x20; - return 0; - } - - return 1; // Tile blank -} - -static int TileFlipZSH(int sx,int addr,int pal,int zval) -{ - unsigned int pack=0; unsigned int t=0; - unsigned char *pd = DrawLineInt+sx; - char *zb = HighSprZ+sx; - int collision = 0; - - pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - if (pack) - { - t=(pack&0x000f0000)>>16; sh_pixZ(0); - t=(pack&0x00f00000)>>20; sh_pixZ(1); - t=(pack&0x0f000000)>>24; sh_pixZ(2); - t=(pack&0xf0000000)>>28; sh_pixZ(3); - t=(pack&0x0000000f) ; sh_pixZ(4); - t=(pack&0x000000f0)>> 4; sh_pixZ(5); - t=(pack&0x00000f00)>> 8; sh_pixZ(6); - t=(pack&0x0000f000)>>12; sh_pixZ(7); - if(collision) Pico.video.status|=0x20; - return 0; - } - return 1; // Tile blank -} - -// -------------------------------------------- - -#ifndef _ASM_DRAW_C -static void DrawStrip(struct TileStrip *ts, int sh) -{ - int tilex=0,dx=0,ty=0,code=0,addr=0,cells; - int oldcode=-1,blank=-1; // The tile we know is blank - int pal=0; - - // Draw tiles across screen: - tilex=(-ts->hscroll)>>3; - ty=(ts->line&7)<<1; // Y-Offset into tile - dx=((ts->hscroll-1)&7)+1; - cells = ts->cells; - if(dx != 8) cells++; // have hscroll, need to draw 1 cell more - - for (; cells; dx+=8,tilex++,cells--) - { - int zero=0; - - code=Pico.vram[ts->nametab+(tilex&ts->xmask)]; - if (code==blank) continue; - if (code>>15) { // high priority tile - int cval = code | (dx<<16) | (ty<<25); - if(code&0x1000) cval^=7<<26; - *ts->hc++ = cval; // cache it - continue; - } - - if (code!=oldcode) { - oldcode = code; - // Get tile address/2: - addr=(code&0x7ff)<<4; - addr+=ty; - if (code&0x1000) addr^=0xe; // Y-flip - -// pal=Pico.cram+((code>>9)&0x30); - pal=((code>>9)&0x30)|(sh<<6); - } - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - *ts->hc = 0; -} -#endif - -// this is messy -#ifndef _ASM_DRAW_C -static -#endif -void DrawStripVSRam(struct TileStrip *ts, int plane) -{ - int tilex=0,dx=0,ty=0,code=0,addr=0,cell=0,nametabadd=0; - int oldcode=-1,blank=-1; // The tile we know is blank - int pal=0,scan=Scanline; - - // Draw tiles across screen: - tilex=(-ts->hscroll)>>3; - dx=((ts->hscroll-1)&7)+1; - if(dx != 8) { - int vscroll, line; - cell--; // have hscroll, start with negative cell - // also calculate intial VS stuff - vscroll=Pico.vsram[plane]; - - // Find the line in the name table - line=(vscroll+scan)&ts->line&0xffff; // ts->line is really ymask .. - nametabadd=(line>>3)<<(ts->line>>24); // .. and shift[width] - ty=(line&7)<<1; // Y-Offset into tile - } - - for (; cell < ts->cells; dx+=8,tilex++,cell++) - { - int zero=0; - - if((cell&1)==0) { - int line,vscroll; - vscroll=Pico.vsram[plane+(cell&~1)]; - - // Find the line in the name table - line=(vscroll+scan)&ts->line&0xffff; // ts->line is really ymask .. - nametabadd=(line>>3)<<(ts->line>>24); // .. and shift[width] - ty=(line&7)<<1; // Y-Offset into tile - } - - code=Pico.vram[ts->nametab+nametabadd+(tilex&ts->xmask)]; - if (code==blank) continue; - if (code>>15) { // high priority tile - int cval = code | (dx<<16) | (ty<<25); - if(code&0x1000) cval^=7<<26; - *ts->hc++ = cval; // cache it - continue; - } - - if (code!=oldcode) { - oldcode = code; - // Get tile address/2: - addr=(code&0x7ff)<<4; - if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip - -// pal=Pico.cram+((code>>9)&0x30); - pal=((code>>9)&0x30); - } - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - *ts->hc = 0; -} - -#ifndef _ASM_DRAW_C -static -#endif -void DrawStripInterlace(struct TileStrip *ts) -{ - int tilex=0,dx=0,ty=0,code=0,addr=0,cells; - int oldcode=-1,blank=-1; // The tile we know is blank - int pal=0; - - // Draw tiles across screen: - tilex=(-ts->hscroll)>>3; - ty=(ts->line&15)<<1; // Y-Offset into tile - dx=((ts->hscroll-1)&7)+1; - cells = ts->cells; - if(dx != 8) cells++; // have hscroll, need to draw 1 cell more - - for (; cells; dx+=8,tilex++,cells--) - { - int zero=0; - - code=Pico.vram[ts->nametab+(tilex&ts->xmask)]; - if (code==blank) continue; - if (code>>15) { // high priority tile - int cval = (code&0xfc00) | (dx<<16) | (ty<<25); - cval|=(code&0x3ff)<<1; - if(code&0x1000) cval^=0xf<<26; - *ts->hc++ = cval; // cache it - continue; - } - - if (code!=oldcode) { - oldcode = code; - // Get tile address/2: - addr=(code&0x7ff)<<5; - if (code&0x1000) addr+=30-ty; else addr+=ty; // Y-flip - -// pal=Pico.cram+((code>>9)&0x30); - pal=((code>>9)&0x30); - } - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - *ts->hc = 0; -} - -// -------------------------------------------- - -#ifndef _ASM_DRAW_C -static void DrawLayer(int plane, int *hcache, int maxcells, int sh) -{ - struct PicoVideo *pvid=&Pico.video; - const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid) - struct TileStrip ts; - int width, height, ymask; - int vscroll, htab; - - ts.hc=hcache; - ts.cells=maxcells; - - // Work out the TileStrip to draw - - // Work out the name table size: 32 64 or 128 tiles (0-3) - width=pvid->reg[16]; - height=(width>>4)&3; width&=3; - - ts.xmask=(1<1) ymask =0x0ff; - - // Find name table: - if (plane==0) ts.nametab=(pvid->reg[2]&0x38)<< 9; // A - else ts.nametab=(pvid->reg[4]&0x07)<<12; // B - - htab=pvid->reg[13]<<9; // Horizontal scroll table address - if ( pvid->reg[11]&2) htab+=Scanline<<1; // Offset by line - if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile - htab+=plane; // A or B - - // Get horizontal scroll value, will be masked later - ts.hscroll=Pico.vram[htab&0x7fff]; - - if((pvid->reg[12]&6) == 6) { - // interlace mode 2 - vscroll=Pico.vsram[plane]; // Get vertical scroll value - - // Find the line in the name table - ts.line=(vscroll+(Scanline<<1))&((ymask<<1)|1); - ts.nametab+=(ts.line>>4)<reg[11]&4) { - // shit, we have 2-cell column based vscroll - // luckily this doesn't happen too often - ts.line=ymask|(shift[width]<<24); // save some stuff instead of line - DrawStripVSRam(&ts, plane); - } else { - vscroll=Pico.vsram[plane]; // Get vertical scroll value - - // Find the line in the name table - ts.line=(vscroll+Scanline)&ymask; - ts.nametab+=(ts.line>>3)<reg[12]&1) - { - nametab=(pvid->reg[3]&0x3c)<<9; // 40-cell mode - nametab+=(Scanline>>3)<<6; - } - else - { - nametab=(pvid->reg[3]&0x3e)<<9; // 32-cell mode - nametab+=(Scanline>>3)<<5; - } - - tilex=tstart<<1; - tend<<=1; - - ty=(Scanline&7)<<1; // Y-Offset into tile - - if(!(rendstatus&2)) { - // check the first tile code - code=Pico.vram[nametab+tilex]; - // if the whole window uses same priority (what is often the case), we may be able to skip this field - if((code>>15) != prio) return; - } - - // Draw tiles across screen: - for (; tilex < tend; tilex++) - { - int addr=0,zero=0; - int pal; - - code=Pico.vram[nametab+tilex]; - if(code==blank) continue; - if((code>>15) != prio) { - rendstatus|=2; - continue; - } - - pal=((code>>9)&0x30); - - if(sh) { - int tmp, *zb = (int *)(DrawLineInt+8+(tilex<<3)); - if(prio) { - tmp = *zb; - if(!(tmp&0x00000080)) tmp&=~0x000000c0; if(!(tmp&0x00008000)) tmp&=~0x0000c000; - if(!(tmp&0x00800000)) tmp&=~0x00c00000; if(!(tmp&0x80000000)) tmp&=~0xc0000000; - *zb++=tmp; tmp = *zb; - if(!(tmp&0x00000080)) tmp&=~0x000000c0; if(!(tmp&0x00008000)) tmp&=~0x0000c000; - if(!(tmp&0x00800000)) tmp&=~0x00c00000; if(!(tmp&0x80000000)) tmp&=~0xc0000000; - *zb++=tmp; - } else { - pal |= 0x40; - } - } - - // Get tile address/2: - addr=(code&0x7ff)<<4; - if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip - - if (code&0x0800) zero=TileFlip(8+(tilex<<3),addr,pal); - else zero=TileNorm(8+(tilex<<3),addr,pal); - - if (zero) blank=code; // We know this tile is blank now - } - - // terminate the cache list - //*hcache = 0; -} - -// -------------------------------------------- - -static void DrawTilesFromCache(int *hc, int sh) -{ - int code, addr, zero, dx; - int pal; - short blank=-1; // The tile we know is blank - - // *ts->hc++ = code | (dx<<16) | (ty<<25); // cache it - - while((code=*hc++)) { - if(!sh && (short)code == blank) continue; - - // Get tile address/2: - addr=(code&0x7ff)<<4; - addr+=(unsigned int)code>>25; // y offset into tile - dx=(code>>16)&0x1ff; - if(sh) { - unsigned char *zb = DrawLineInt+dx; - if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++; - if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++; - if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++; - if(!(*zb&0x80)) *zb&=0x3f; zb++; if(!(*zb&0x80)) *zb&=0x3f; zb++; - } - - pal=((code>>9)&0x30); - - if (code&0x0800) zero=TileFlip(dx,addr,pal); - else zero=TileNorm(dx,addr,pal); - - if(zero) blank=(short)code; - } -} - -// -------------------------------------------- - -// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size -// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -static void DrawSprite(int *sprite, int **hc, int sh) -{ - int width=0,height=0; - int row=0,code=0; - int pal; - int tile=0,delta=0; - int sx, sy; - int (*fTileFunc)(int sx,int addr,int pal); - - // parse the sprite data - sy=sprite[0]; - code=sprite[1]; - sx=code>>16; // X - width=sy>>28; - height=(sy>>24)&7; // Width and height in tiles - sy=(sy<<16)>>16; // Y - - row=Scanline-sy; // Row of the sprite we are on - - if (code&0x1000) row=(height<<3)-1-row; // Flip Y - - tile=code&0x7ff; // Tile number - tile+=row>>3; // Tile number increases going down - delta=height; // Delta to increase tile by going right - if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X - - tile<<=4; tile+=(row&7)<<1; // Tile address - - if(code&0x8000) { // high priority - cache it - *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>16)&0xf); - } else { - delta<<=4; // Delta of address - pal=((code>>9)&0x30)|(sh<<6); - - if(sh && (code&0x6000) == 0x6000) { - if(code&0x0800) fTileFunc=TileFlipSH; - else fTileFunc=TileNormSH; - } else { - if(code&0x0800) fTileFunc=TileFlip; - else fTileFunc=TileNorm; - } - - for (; width; width--,sx+=8,tile+=delta) - { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - fTileFunc(sx,tile,pal); - } - } -} -#endif - - -// Index + 0 : hhhhvvvv s---hhvv yyyyyyyy yyyyyyyy // s: skip flag, h: horiz. size -// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -static void DrawSpriteZ(int pack, int pack2, int shpri, int sprio) -{ - int width=0,height=0; - int row=0; - int pal; - int tile=0,delta=0; - int sx, sy; - int (*fTileFunc)(int sx,int addr,int pal,int zval); - - // parse the sprite data - sx=pack2>>16; // X - sy=(pack <<16)>>16; // Y - width=pack>>28; - height=(pack>>24)&7; // Width and height in tiles - - row=Scanline-sy; // Row of the sprite we are on - - if (pack2&0x1000) row=(height<<3)-1-row; // Flip Y - - tile=pack2&0x7ff; // Tile number - tile+=row>>3; // Tile number increases going down - delta=height; // Delta to increase tile by going right - if (pack2&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X - - tile<<=4; tile+=(row&7)<<1; // Tile address - delta<<=4; // Delta of address - pal=((pack2>>9)&0x30); - if((shpri&1)&&!(shpri&2)) pal|=0x40; - - shpri&=1; - if((pack2&0x6000) != 0x6000) shpri = 0; - shpri |= (pack2&0x0800)>>10; - switch(shpri) { - default: - case 0: fTileFunc=TileNormZ; break; - case 1: fTileFunc=TileNormZSH; break; - case 2: fTileFunc=TileFlipZ; break; - case 3: fTileFunc=TileFlipZSH; break; - } - - for (; width; width--,sx+=8,tile+=delta) - { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - fTileFunc(sx,tile,pal,sprio); - } -} - -static void DrawSpriteInterlace(unsigned int *sprite) -{ - int width=0,height=0; - int row=0,code=0; - int pal; - int tile=0,delta=0; - int sx, sy; - - // parse the sprite data - sy=sprite[0]; - height=sy>>24; - sy=(sy&0x3ff)-0x100; // Y - width=(height>>2)&3; height&=3; - width++; height++; // Width and height in tiles - - row=(Scanline<<1)-sy; // Row of the sprite we are on - - code=sprite[1]; - sx=((code>>16)&0x1ff)-0x78; // X - - if (code&0x1000) row^=(16<>4; // Tile number increases going down - delta=height; // Delta to increase tile by going right - if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X - - tile<<=5; tile+=(row&15)<<1; // Tile address - - delta<<=5; // Delta of address - pal=((code>>9)&0x30); // Get palette pointer - - for (; width; width--,sx+=8,tile+=delta) - { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - if (code&0x0800) TileFlip(sx,tile,pal); - else TileNorm(sx,tile,pal); - } -} - - -static void DrawAllSpritesInterlace(int pri, int maxwidth) -{ - struct PicoVideo *pvid=&Pico.video; - int i,u,table,link=0,sline=Scanline<<1; - unsigned int *sprites[80]; // Sprite index - - table=pvid->reg[5]&0x7f; - if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode - table<<=8; // Get sprite table address/2 - - for (i=u=0; u < 80 && i < 21; u++) - { - unsigned int *sprite; - int code, sx, sy, height; - - sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite - - // get sprite info - code = sprite[0]; - sx = sprite[1]; - if(((sx>>15)&1) != pri) goto nextsprite; // wrong priority sprite - - // check if it is on this line - sy = (code&0x3ff)-0x100; - height = (((code>>24)&3)+1)<<4; - if(sline < sy || sline >= sy+height) goto nextsprite; // no - - // check if sprite is not hidden offscreen - sx = (sx>>16)&0x1ff; - sx -= 0x78; // Get X coordinate + 8 - if(sx <= -8*3 || sx >= maxwidth) goto nextsprite; - - // sprite is good, save it's pointer - sprites[i++]=sprite; - - nextsprite: - // Find next sprite - link=(code>>16)&0x7f; - if(!link) break; // End of sprites - } - - // Go through sprites backwards: - for (i-- ;i>=0; i--) - DrawSpriteInterlace(sprites[i]); -} - - -#ifndef _ASM_DRAW_C -static void DrawSpritesFromCache(int *hc, int sh) -{ - int code, tile, sx, delta, width; - int pal; - int (*fTileFunc)(int sx,int addr,int pal); - - // *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf); - - while((code=*hc++)) { - pal=(code&0x30); - delta=code&0xf; - width=delta>>2; delta&=3; - width++; delta++; // Width and height in tiles - if (code&0x10000) delta=-delta; // Flip X - delta<<=4; - tile=((unsigned int)code>>17)<<1; - sx=(code<<16)>>22; // sx can be negative (start offscreen), so sign extend - - if(sh && pal == 0x30) { // - if(code&0x10000) fTileFunc=TileFlipSH; - else fTileFunc=TileNormSH; - } else { - if(code&0x10000) fTileFunc=TileFlip; - else fTileFunc=TileNorm; - } - - for (; width; width--,sx+=8,tile+=delta) - { - if(sx<=0) continue; - if(sx>=328) break; // Offscreen - - tile&=0x7fff; // Clip tile address - fTileFunc(sx,tile,pal); - } - } -} -#endif - - -// Index + 0 : ----hhvv -lllllll -------y yyyyyyyy -// Index + 4 : -------x xxxxxxxx pccvhnnn nnnnnnnn -// v -// Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size -// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -static void PrepareSprites(int full) -{ - struct PicoVideo *pvid=&Pico.video; - int u=0,link=0,sblocks=0; - int table=0; - int *pd = HighPreSpr; - - table=pvid->reg[5]&0x7f; - if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode - table<<=8; // Get sprite table address/2 - - if (!full) - { - int pack; - // updates: tilecode, sx - for (u=0; u < 80 && (pack = *pd); u++, pd+=2) - { - unsigned int *sprite; - int code, code2, sx, sy, skip=0; - - sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite - - // parse sprite info - code = sprite[0]; - code2 = sprite[1]; - code2 &= ~0xfe000000; - code2 -= 0x00780000; // Get X coordinate + 8 in upper 16 bits - sx = code2>>16; - - if((sx <= 8-((pack>>28)<<3) && sx >= -0x76) || sx >= 328) skip=1<<23; - else if ((sy = (pack<<16)>>16) < 240 && sy > -32) { - int sbl = (2<<(pack>>28))-1; - sblocks |= sbl<<(sy>>3); - } - - *pd = (pack&~(1<<23))|skip; - *(pd+1) = code2; - - // Find next sprite - link=(code>>16)&0x7f; - if(!link) break; // End of sprites - } - SpriteBlocks |= sblocks; - } - else - { - for (; u < 80; u++) - { - unsigned int *sprite; - int code, code2, sx, sy, hv, height, width, skip=0, sx_min; - - sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite - - // parse sprite info - code = sprite[0]; - sy = (code&0x1ff)-0x80; - hv = (code>>24)&0xf; - height = (hv&3)+1; - - if(sy > 240 || sy + (height<<3) <= 0) skip|=1<<22; - - width = (hv>>2)+1; - code2 = sprite[1]; - sx = (code2>>16)&0x1ff; - sx -= 0x78; // Get X coordinate + 8 - sx_min = 8-(width<<3); - - if((sx <= sx_min && sx >= -0x76) || sx >= 328) skip|=1<<23; - else if (sx > sx_min && !skip) { - int sbl = (2<>3; - if(shi < 0) shi=0; // negative sy - sblocks |= sbl<>16)&0x7f; - if(!link) break; // End of sprites - } - SpriteBlocks = sblocks; - *pd = 0; // terminate - } -} - -static void DrawAllSprites(int *hcache, int maxwidth, int prio, int sh) -{ - int i,u,n; - int sx1seen=0; // sprite with x coord 1 or 0 seen - int ntiles = 0; // tile counter for sprite limit emulation - int *sprites[40]; // Sprites to draw in fast mode - int *ps, pack, rs = rendstatus, scan=Scanline; - - if(rs&8) { - DrawAllSpritesInterlace(prio, maxwidth); - return; - } - if(rs&0x11) { - //dprintf("PrepareSprites(%i) [%i]", (rs>>4)&1, scan); - PrepareSprites(rs&0x10); - rendstatus=rs&~0x11; - } - if (!(SpriteBlocks & (1<<(scan>>3)))) return; - - if(((rs&4)||sh)&&prio==0) - memset(HighSprZ, 0, 328); - if(!(rs&4)&&prio) { - if(hcache[0]) DrawSpritesFromCache(hcache, sh); - return; - } - - ps = HighPreSpr; - - // Index + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size - // Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - - for(i=u=n=0; (pack = *ps) && n < 20; ps+=2, u++) - { - int sx, sy, row, pack2; - - if(pack & 0x00400000) continue; - - // get sprite info - pack2 = *(ps+1); - sx = pack2>>16; - sy = (pack <<16)>>16; - row = scan-sy; - - //dprintf("x: %i y: %i %ix%i", sx, sy, (pack>>28)<<3, (pack>>21)&0x38); - - if(sx == -0x77) sx1seen|=1; // for masking mode 2 - - // check if it is on this line - if(row < 0 || row >= ((pack>>21)&0x38)) continue; // no - n++; // number of sprites on this line (both visible and hidden, max is 20) [broken] - - // sprite limit - ntiles += pack>>28; - if(ntiles > 40) break; - - if(pack & 0x00800000) continue; - - // masking sprite? - if(sx == -0x78) { - if(!(sx1seen&1) || sx1seen==3) { - break; // this sprite is not drawn and remaining sprites are masked - } - if((sx1seen>>8) == 0) sx1seen=(i+1)<<8; - continue; - } - else if(sx == -0x77) { - // masking mode2 (Outrun, Galaxy Force II, Shadow of the beast) - if(sx1seen>>8) { i=(sx1seen>>8)-1; break; } // seen both 0 and 1 - sx1seen |= 2; - continue; - } - - // accurate sprites - //dprintf("P:%i",((sx>>15)&1)); - if(rs&4) { - // might need to skip this sprite - if((pack2&0x8000) ^ (prio<<15)) continue; - DrawSpriteZ(pack,pack2,sh|(prio<<1),(char)(0x1f-n)); - continue; - } - - // sprite is good, save it's pointer - sprites[i++]=ps; - } - - // Go through sprites backwards: - if(!(rs&4)) { - for (i--; i>=0; i--) - DrawSprite(sprites[i],&hcache,sh); - - // terminate cache list - *hcache = 0; - } -} - - -// -------------------------------------------- - -#ifndef _ASM_DRAW_C -static void BackFill(int reg7, int sh) -{ - unsigned int back=0; - unsigned int *pd=NULL,*end=NULL; - - // Start with a blank scanline (background colour): - back=reg7&0x3f; - back|=sh<<6; - back|=back<<8; - back|=back<<16; - - pd= (unsigned int *)(DrawLineInt+8); - end=(unsigned int *)(DrawLineInt+8+320); - - do { pd[0]=pd[1]=pd[2]=pd[3]=back; pd+=4; } while (pd= 0; i--) - pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x0777); - // hilighted pixels - for(i = 0x3f; i >= 0; i--) { - t=pal[i]&0xeee;t+=0x444;if(t&0x10)t|=0xe;if(t&0x100)t|=0xe0;if(t&0x1000)t|=0xe00;t&=0xeee; - pal[0x80|i]=(unsigned short)t; - } - Pico.m.dirtyPal = 0; - } - } - - for(i = 0; i < len; i++) - pd[i] = pal[ps[i]]; -} - - -static void FinalizeLineRGB555(int sh) -{ - unsigned short *pd=DrawLineDest; - unsigned char *ps=DrawLineInt+8; - unsigned short *pal=HighPal; - int len, i, t, dirtyPal = Pico.m.dirtyPal; - - if(dirtyPal) { - unsigned short *ppal=Pico.cram; - for(i = 0x3f; i >= 0; i--) - pal[i] = (unsigned short) (((ppal[i]&0x00f)<<12)|((ppal[i]&0x0f0)<<3)|((ppal[i]&0xf00)>>7)); - Pico.m.dirtyPal = 0; - } - - if (Pico.video.reg[12]&1) { - len = 320; - } else { - if(!(PicoOpt&0x100)) pd+=32; - len = 256; - } - - if(sh) { - if(dirtyPal) { - // shadowed pixels - for(i = 0x3f; i >= 0; i--) - pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x738e); - // hilighted pixels - for(i = 0x3f; i >= 0; i--) { - t=pal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c; - pal[0x80|i]=(unsigned short)t; - } - } - } - - for(i = 0; i < len; i++) - pd[i] = pal[ps[i]]; -} -#endif - -static void FinalizeLine8bit(int sh) -{ - unsigned char *pd=DrawLineDest; - int len, rs = rendstatus; - static int dirty_count; - - if (!sh && Pico.m.dirtyPal && Scanline < 222) { - // a hack for mid-frame palette changes - if (!(rs & 0x20)) - dirty_count = 1; - else dirty_count++; - rs |= 0x20; - rendstatus = rs; - if (dirty_count == 3) { - blockcpy(HighPal, Pico.cram, 0x40*2); - } else if (dirty_count == 11) { - blockcpy(HighPal+0x40, Pico.cram, 0x40*2); - } - } - - if (Pico.video.reg[12]&1) { - len = 320; - } else { - if(!(PicoOpt&0x100)) pd+=32; - len = 256; - } - -/* test - if (!sh && rs & 0x20) { - if (dirty_count >= 11) { - blockcpy_or(pd, HighCol+8, len, 0x80); - } else { - blockcpy_or(pd, HighCol+8, len, 0x40); - } - } else { - blockcpy(pd, HighCol+8, len); - } -*/ -} - -void (*FinalizeLine)(int sh) = FinalizeLineBGR444; - -// -------------------------------------------- - -static int DrawDisplay(int sh) -{ - struct PicoVideo *pvid=&Pico.video; - int win=0,edge=0,hvwind=0; - int maxw, maxcells; - - if(pvid->reg[12]&1) { - maxw = 328; maxcells = 40; - } else { - maxw = 264; maxcells = 32; - } - - // Find out if the window is on this line: - win=pvid->reg[0x12]; - edge=(win&0x1f)<<3; - - if (win&0x80) { if (Scanline>=edge) hvwind=1; } - else { if (Scanline< edge) hvwind=1; } - - if(!hvwind) { // we might have a vertical window here - win=pvid->reg[0x11]; - edge=win&0x1f; - if(win&0x80) { - if(!edge) hvwind=1; - else if(edge < (maxcells>>1)) hvwind=2; - } else { - if(!edge); - else if(edge < (maxcells>>1)) hvwind=2; - else hvwind=1; - } - } - - DrawLayer(1, HighCacheB, maxcells, sh); - if(hvwind == 1) - DrawWindow(0, maxcells>>1, 0, sh); // HighCacheAW - else if(hvwind == 2) { - // ahh, we have vertical window - DrawLayer(0, HighCacheA, (win&0x80) ? edge<<1 : maxcells, sh); - DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh); // HighCacheW - } else - DrawLayer(0, HighCacheA, maxcells, sh); - DrawAllSprites(HighCacheS, maxw, 0, sh); - - if(HighCacheB[0]) DrawTilesFromCache(HighCacheB, sh); - if(hvwind == 1) - DrawWindow(0, maxcells>>1, 1, sh); - else if(hvwind == 2) { - if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh); - DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 1, sh); - } else - if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh); - DrawAllSprites(HighCacheS, maxw, 1, sh); - - return 0; -} - - -void PicoFrameStart() -{ - // prepare to do this frame - rendstatus &= 0x40; - rendstatus |= (PicoOpt&0x80)>>5; // accurate sprites - if(rendstatus) - Pico.video.status &= ~0x0020; - else Pico.video.status |= 0x0020; // sprite collision - if((Pico.video.reg[12]&6) == 6) rendstatus |= 8; // interlace mode - - PrepareSprites(1); -} - -static int Skip=0; - -int PicoLine(int scan) -{ - int sh; - if (Skip>0) { Skip--; return 0; } // Skip rendering lines - - if(!(rendstatus&0x40)) - DrawLineInt = DrawLineDest; - - Scanline=scan; - sh=(Pico.video.reg[0xC]&8)>>3; // shadow/hilight? - - // Draw screen: - BackFill(Pico.video.reg[7], sh); - if (Pico.video.reg[1]&0x40) - DrawDisplay(sh); - - FinalizeLine(sh); - //if (SpriteBlocks & (1<<(scan>>3))) for (sh=0; sh < 30; sh++) DrawLineDest[sh] = 0xf; - - Skip=PicoScan(Scanline,DrawLineDest); - - return 0; -} - - -void DrawSetColorFormat(int which) -{ - rendstatus |= 0x40; - DrawLineInt = HighCol; - - if (which == 2) { - rendstatus &= ~0x40; - FinalizeLine = FinalizeLine8bit; - } else if (which == 1) - FinalizeLine = FinalizeLineRGB555; - else - FinalizeLine = FinalizeLineBGR444; -} diff --git a/Pico/Draw_sh.s b/Pico/Draw_sh.s deleted file mode 100644 index 7811b849..00000000 --- a/Pico/Draw_sh.s +++ /dev/null @@ -1,1527 +0,0 @@ -@ assembly "optimized" version of some funtions from draw.c -@ this is highly specialized, be careful if changing related C code! - -@ (c) Copyright 2006, notaz -@ All Rights Reserved - - -.extern Pico -.extern PicoOpt -.extern HighCol -.extern Scanline -.extern HighSprZ -.extern rendstatus -.extern DrawLineInt -.extern DrawLineDest -.extern DrawStripVSRam -.extern DrawStripInterlace - - -@ helper -.macro TilePixel pat lsrr offs -.if !\lsrr - ands r4, \pat, r2 -.else - ands r4, \pat, r2, lsr #\lsrr -.endif - orrne r4, r3, r4 - strneb r4, [r1,#\offs] -.endm - -@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileNorm pat - TilePixel \pat, 12, 0 @ #0x0000f000 - TilePixel \pat, 8, 1 @ #0x00000f00 - TilePixel \pat, 4, 2 @ #0x000000f0 - TilePixel \pat, 0, 3 @ #0x0000000f - TilePixel \pat, 28, 4 @ #0xf0000000 - TilePixel \pat, 24, 5 @ #0x0f000000 - TilePixel \pat, 20, 6 @ #0x00f00000 - TilePixel \pat, 16, 7 @ #0x000f0000 -.endm - -@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileFlip pat - TilePixel \pat, 16, 0 @ #0x000f0000 - TilePixel \pat, 20, 1 @ #0x00f00000 - TilePixel \pat, 24, 2 @ #0x0f000000 - TilePixel \pat, 28, 3 @ #0xf0000000 - TilePixel \pat, 0, 4 @ #0x0000000f - TilePixel \pat, 4, 5 @ #0x000000f0 - TilePixel \pat, 8, 6 @ #0x00000f00 - TilePixel \pat, 12, 7 @ #0x0000f000 -.endm - -@ shadow/hilight mode - -@ this one is for hi priority layer -.macro TilePixelShHP pat lsrr offs - TilePixel \pat, \lsrr, \offs - ldreqb r4, [r1,#\offs] - tsteq r4, #0x80 - andeq r4, r4, #0x3f - streqb r4, [r1,#\offs] -.endm - -@ TileNorm (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileNormShHP pat - TilePixelShHP \pat, 12, 0 @ #0x0000f000 - TilePixelShHP \pat, 8, 1 @ #0x00000f00 - TilePixelShHP \pat, 4, 2 @ #0x000000f0 - TilePixelShHP \pat, 0, 3 @ #0x0000000f - TilePixelShHP \pat, 28, 4 @ #0xf0000000 - TilePixelShHP \pat, 24, 5 @ #0x0f000000 - TilePixelShHP \pat, 20, 6 @ #0x00f00000 - TilePixelShHP \pat, 16, 7 @ #0x000f0000 -.endm - -@ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf -.macro TileFlipShHP pat - TilePixelShHP \pat, 16, 0 @ #0x000f0000 - TilePixelShHP \pat, 20, 1 @ #0x00f00000 - TilePixelShHP \pat, 24, 2 @ #0x0f000000 - TilePixelShHP \pat, 28, 3 @ #0xf0000000 - TilePixelShHP \pat, 0, 4 @ #0x0000000f - TilePixelShHP \pat, 4, 5 @ #0x000000f0 - TilePixelShHP \pat, 8, 6 @ #0x00000f00 - TilePixelShHP \pat, 12, 7 @ #0x0000f000 -.endm - - -@ TileSingleSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx; r12: helper pattern 0xf -.macro TileSingleSh - tst r0, #1 @ not aligned? - mov r7, #0x00c000 - orr r7, r7, #0xc0 - ldrneb r4, [r1] - ldreqh r4, [r1] - orr r4, r4, r7 - strneb r4, [r1], #1 - streqh r4, [r1], #2 - ldrh r4, [r1] - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - orr r4, r4, r7 - strh r4, [r1], #2 - ldrneb r4, [r1] - orr r4, r4, r7 - strneb r4, [r1], #1 -.endm - -@ TileSingleHi (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf -.macro TileSingleHi - tst r1, #1 @ not aligned? - mov r7, #0x008000 - orr r7, r7, #0x80 - ldrneb r4, [r1] - ldreqh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strneb r4, [r1], #1 - streqh r4, [r1], #2 - ldrh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strh r4, [r1], #2 - ldrh r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strh r4, [r1], #2 - ldrneb r4, [r1] - bic r4, r4, r7, lsr #1 - orr r4, r4, r7 - strneb r4, [r1], #1 -.endm - -.macro TileDoShGenPixel shift ofs -.if \shift - ands r4, r12, r2, lsr #\shift -.else - ands r4, r12, r2 -.endif - beq 3f - cmp r4, #0xe - beq 2f - bgt 1f - orr r4, r3, r4 - strb r4, [r1,#\ofs] - b 3f -1: - ldrb r4, [r1,#\ofs] - orr r4, r4, #0xc0 - strb r4, [r1,#\ofs] - b 3f -2: - ldrb r4, [r1,#\ofs] - bic r4, r4, #0xc0 - orr r4, r4, #0x80 - strb r4, [r1,#\ofs] -3: -.endm - -@ TileFlipSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf -.macro TileFlipSh - TileDoShGenPixel 16, 0 @ #0x000f0000 - TileDoShGenPixel 20, 1 @ #0x00f00000 - TileDoShGenPixel 24, 2 @ #0x0f000000 - TileDoShGenPixel 28, 3 @ #0xf0000000 - TileDoShGenPixel 0, 4 @ #0x0000000f - TileDoShGenPixel 4, 5 @ #0x000000f0 - TileDoShGenPixel 8, 6 @ #0x00000f00 - TileDoShGenPixel 12, 7 @ #0x0000f000 -.endm - -@ TileNormSh (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=sx, r12: register with helper pattern 0xf -.macro TileNormSh - TileDoShGenPixel 12, 0 @ #0x0000f000 - TileDoShGenPixel 8, 1 @ #0x00000f00 - TileDoShGenPixel 4, 2 @ #0x000000f0 - TileDoShGenPixel 0, 3 @ #0x0000000f - TileDoShGenPixel 28, 4 @ #0xf0000000 - TileDoShGenPixel 24, 5 @ #0x0f000000 - TileDoShGenPixel 20, 6 @ #0x00f00000 - TileDoShGenPixel 16, 7 @ #0x000f0000 -.endm - - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -@ struct TileStrip -@ { -@ int nametab; // 0x00 -@ int line; // 0x04 -@ int hscroll; // 0x08 -@ int xmask; // 0x0C -@ int *hc; // 0x10 (pointer to cache buffer) -@ int cells; // 0x14 -@ }; - -@ int DrawLayer(int plane, int *hcache, int maxcells, int sh) - -.global DrawLayer @ int plane, int *hcache, int maxcells, int sh - -DrawLayer: - stmfd sp!, {r4-r11,lr} - - ldr r11, =(Pico+0x22228) @ Pico.video - - mov r6, r1 @ hcache - orr r9, r2, r3, lsl #31 @ r9=maxcells|(sh<<31) - - ldrb r7, [r11, #16] @ ??hh??ww - - mov r1, r7, lsl #4 - orr r1, r1, #0x00ff - - and r10, r7, #3 - cmp r10, #1 - biclt r1, r1, #0xfc00 - biceq r1, r1, #0xfe00 - bicgt r1, r1, #0xff00 @ r1=ymask=(height<<8)|0xff; ...; // Y Mask in pixels - - add r10, r10, #5 - cmp r10, #7 - subge r10, r10, #1 @ r10=shift[width] (5,6,6,7) - - @ calculate xmask: - mov r8, #1 - mov r5, r8, lsl r10 - sub r5, r5, #1 @ r5=xmask - - @ Find name table: - tst r0, r0 - ldreqb r12, [r11, #2] - moveq r12, r12, lsl #10 - ldrneb r12, [r11, #4] - movne r12, r12, lsl #13 - and r12, r12, #(7<<13) @ r12=(ts->nametab<<1) (halfword compliant) - - ldr r2, =Scanline - ldr r2, [r2] - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - - ldrh r8, [r11, #12] - mov r4, r8, lsr #8 @ pvid->reg[13] - mov r4, r4, lsl #10 @ htab=pvid->reg[13]<<9; (halfwords) - ldrb r7, [r11, #11] - tst r7, #2 - addne r4, r4, r2, lsl #2 @ htab+=Scanline<<1; // Offset by line - tst r7, #1 - biceq r4, r4, #0x1f @ htab&=~0xf; // Offset by tile - add r4, r4, r0, lsl #1 @ htab+=plane - bic r4, r4, #0x00ff0000 @ just in case - ldrh r3, [lr, r4] @ r3=hscroll - - tst r7, #4 - bne .DrawStrip_vsscroll - - @ Get vertical scroll value: - add r7, lr, #0x012000 - add r7, r7, #0x000180 @ r7=Pico.vsram (Pico+0x22180) - ldr r7, [r7] - - tst r8, #2 - tstne r8, #4 - bne .DrawStrip_interlace - - tst r0, r0 - movne r7, r7, lsr #16 - - @ Find the line in the name table - add r2, r2, r7 - and r2, r2, r1 - mov r4, r2, lsr #3 - add r10, r10, #1 @ shift[width]++ - add r12, r12, r4, lsl r10 @ nametab+=(ts.line>>3)<hscroll, r5=ts->xmask, r6=ts->hc, r9=ts->cells -@ mov r12,r1, lsl #1 @ r12=(ts->nametab<<1) (halfword compliant) - - and r10,r2, #7 - mov r10,r10, lsl #1 @ r10=ty=(ts->line&7)<<1; - orr r10,r10, r9, lsl #24 - - rsb r8, r3, #0 - mov r8, r8, lsr #3 @ r8=tilex=(-ts->hscroll)>>3 - - sub r1, r3, #1 - and r1, r1, #7 - add r4, r1, #1 @ r4=dx=((ts->hscroll-1)&7)+1 - - tst r9, #1<<31 - mov r3, #0 - orrne r10,r10, #1<<23 @ r10=(cells<<24|sh<<23|hi_not_empty<<22|ty) - movne r3, #0x40 @ default to shadowed pal on sh mode - - mvn r9, #0 @ r9=prevcode=-1 - - @ cache some stuff to avoid mem access -@ ldr r11,=HighCol - ldr r11,=DrawLineInt - ldr r11,[r11] - add r1, r11, r4 @ r1=pdest - mov r0, #0xf - - cmp r4, #8 - subeq r10,r10, #0x01000000 @ we will loop cells+1 times, so loop less when there is no scroll - beq .dsloop_enter - - @ do first iteration with clipping - and r7, r5, r8 - add r7, lr, r7, lsl #1 @ Pico.vram+((tilex&ts->xmask) as halfwords) - ldrh r7, [r7, r12] @ r7=code (int, but from unsigned, no sign extend) - - tst r7, #0x8000 - bne .DrawStrip_hiprio - - mov r9, r7 @ remember code - - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 - add r2, r2, r10, lsl #17 - mov r2, r2, lsr #17 - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - - bic r7, r3, #0x3f - and r3, r9, #0x6000 - add r3, r7, r3, lsr #9 @ r3=pal=((code&0x6000)>>9); - - tst r2, r2 - beq .dsloop @ tileline blank - - tst r9, #0x0800 - addne r4, r4, #8 - - ldr pc, [pc, r4, lsl #2] - nop - .word .ds_tn1_px1 @ should not happen - .word .ds_tn1_px1 - .word .ds_tn1_px2 - .word .ds_tn1_px3 - .word .ds_tn1_px4 - .word .ds_tn1_px5 - .word .ds_tn1_px6 - .word .ds_tn1_px7 - .word .dsloop @ should not happen - - .word .ds_tf1_px1 @ ... - .word .ds_tf1_px1 - .word .ds_tf1_px2 - .word .ds_tf1_px3 - .word .ds_tf1_px4 - .word .ds_tf1_px5 - .word .ds_tf1_px6 - .word .ds_tf1_px7 - .word .dsloop @ ... - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern -.ds_tn1_px1: - TilePixel r0, 8, 1 @ #0x00000f00 -.ds_tn1_px2: - TilePixel r0, 4, 2 @ #0x000000f0 -.ds_tn1_px3: - TilePixel r0, 0, 3 @ #0x0000000f -.ds_tn1_px4: - TilePixel r0, 28, 4 @ #0xf0000000 -.ds_tn1_px5: - TilePixel r0, 24, 5 @ #0x0f000000 -.ds_tn1_px6: - TilePixel r0, 20, 6 @ #0x00f00000 -.ds_tn1_px7: - TilePixel r0, 16, 7 @ #0x000f0000 - b .dsloop - -.ds_tf1_px1: - TilePixel r0, 20, 1 @ #0x00f00000 -.ds_tf1_px2: - TilePixel r0, 24, 2 @ #0x0f000000 -.ds_tf1_px3: - TilePixel r0, 28, 3 @ #0xf0000000 -.ds_tf1_px4: - TilePixel r0, 0, 4 @ #0x0000000f -.ds_tf1_px5: - TilePixel r0, 4, 5 @ #0x000000f0 -.ds_tf1_px6: - TilePixel r0, 8, 6 @ #0x00000f00 -.ds_tf1_px7: - TilePixel r0, 12, 7 @ #0x0000f000 - - - @ r4 & r7 are scratch in this loop -.dsloop: @ 40-41 times - add r1, r1, #8 -.dsloop_nor1: - subs r10,r10, #0x01000000 - add r8, r8, #1 - bmi .dsloop_exit - -.dsloop_enter: - and r7, r5, r8 - add r7, lr, r7, lsl #1 @ Pico.vram+((tilex&ts->xmask) as halfwords) - ldrh r7, [r7, r12] @ r7=code (int, but from unsigned, no sign extend) - - tst r7, #0x8000 - bne .DrawStrip_hiprio - - cmp r7, r9 - beq .DrawStrip_samecode @ we know stuff about this tile already - - mov r9, r7 @ remember code - - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 -@ bic r7, r10,#0xff000000 -@ add r2, r7, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty - add r2, r2, r10, lsl #17 - mov r2, r2, lsr #17 - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - - bic r7, r3, #0x3f - and r3, r9, #0x6000 - add r3, r7, r3, lsr #9 @ r3=pal=((code&0x6000)>>9); - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - -.DrawStrip_samecode: - tst r2, r2 - beq .dsloop @ tileline blank - - cmp r2, r2, ror #4 - beq .DrawStrip_SingleColor @ tileline singlecolor - - tst r9, #0x0800 - beq .DrawStrip_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern - TileFlip r0 - b .dsloop - -.DrawStrip_TileNorm: - TileNorm r0 - b .dsloop - -.DrawStrip_SingleColor: - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - tst r1, #1 @ not aligned? - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 @ have a remaining unaligned pixel? - b .dsloop_nor1 @ we incremeted r1 ourselves - -.DrawStrip_hiprio: - tst r10, #0x00c00000 - beq .DrawStrip_hiprio_maybempt - sub r0, r1, r11 - orr r7, r7, r0, lsl #16 - orr r7, r7, r10, lsl #25 @ (ty<<25) - tst r7, #0x1000 - eorne r7, r7, #7<<26 @ if(code&0x1000) cval^=7<<26; - str r7, [r6], #4 @ cache hi priority tile - mov r0, #0xf - b .dsloop - -.DrawStrip_hiprio_maybempt: - cmp r7, r9 - beq .dsloop @ must've been empty, otherwise we wouldn't get here - mov r9, r7 @ remember code - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 - add r2, r2, r10, lsl #17 - mov r2, r2, lsr #17 - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - tst r2, r2 - orrne r10, r10, #1<<22 - bne .DrawStrip_hiprio - b .dsloop - -.dsloop_exit: - mov r0, #0 - str r0, [r6] @ terminate the cache list - - ldmfd sp!, {r4-r11,lr} - bx lr - - -.DrawStrip_vsscroll: - @ shit, we have 2-cell column based vscroll - @ let the c code handle this (for now) - - @ int nametab; // 0x00 - @ int line; // 0x04 - @ int hscroll; // 0x08 - @ int xmask; // 0x0C - @ int *hc; // 0x10 (pointer to cache buffer) - @ int cells; // 0x14 - - sub sp, sp, #6*4 - orr r2, r1, r10, lsl #24 @ ts.line=ymask|(shift[width]<<24); // save some stuff instead of line - mov r1, r0 @ plane - mov r0, r12, lsr #1 @ halfwords - and r9, r9, #0xff - stmia sp, {r0,r2,r3,r5,r6,r9} - - mov r0, sp - bl DrawStripVSRam @ struct TileStrip *ts, int plane - - add sp, sp, #6*4 - ldmfd sp!, {r4-r11,lr} - bx lr - -@ interlace mode 2? Sonic 2? -.DrawStrip_interlace: - tst r0, r0 - moveq r7, r7, lsl #21 - movne r7, r7, lsl #5 - - @ Find the line in the name table - add r2, r7, r2, lsl #22 @ r2=(vscroll+(Scanline<<1))<<21 (11 bits); - orr r1, r1, #0x80000000 - and r2, r2, r1, ror #10 @ &((ymask<<1)|1)<<21; - mov r2, r2, lsr #21 - mov r4, r2, lsr #4 - mov r12, r12, lsr #1 @ halfwords - add r0, r12, r4, lsl r10 @ nametab+=(ts.line>>4)<>9); - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - -.dtfc_samecode: - tst r8, r8 - bne .dtfc_shadow - - tst r2, r2 - beq .dtfc_loop - - cmp r2, r2, ror #4 - beq .dtfc_SingleColor @ tileline singlecolor - - tst r5, #0x0800 - beq .dtfc_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlip r12 - b .dtfc_loop - -.dtfc_TileNorm: - TileNorm r12 - b .dtfc_loop - -.dtfc_SingleColor: - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - tst r1, #1 @ not aligned? - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 @ have a remaining unaligned pixel? - b .dtfc_loop - -.dtfc_shadow: - tst r2, r2 - beq .dtfc_shadow_blank - - cmp r2, r2, ror #4 - beq .dtfc_SingleColor @ tileline singlecolor - - tst r5, #0x0800 - beq .dtfc_TileNormShHP - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlipShHP r12 - b .dtfc_loop - -.dtfc_TileNormShHP: - TileNormShHP r12 - b .dtfc_loop - -.dtfc_shadow_blank: - ldrb r4, [r1] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1] - ldrb r4, [r1,#1] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#1] - ldrb r4, [r1,#2] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#2] - ldrb r4, [r1,#3] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#3] - ldrb r4, [r1,#4] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#4] - ldrb r4, [r1,#5] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#5] - ldrb r4, [r1,#6] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#6] - ldrb r4, [r1,#7] - tst r4, #0x80 - andeq r4, r4,#0x3f - streqb r4, [r1,#7] - b .dtfc_loop - -.pool - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -.global DrawSpritesFromCache @ int *hc, int sh - -DrawSpritesFromCache: - stmfd sp!, {r4-r11,lr} - - @ cache some stuff to avoid mem access -@ ldr r11,=HighCol - ldr r11,=DrawLineInt - ldr r11,[r11] - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - mov r6, r1, lsl #31 - orr r6, r6, #1<<30 - mov r12,#0xf - - mov r10, r0 - -.dsfc_loop: - ldr r9, [r10], #4 @ read code - tst r9, r9 - ldmeqfd sp!, {r4-r11,pc} - - mov r4, r9, lsl #28 - bic r6, r6, #7 - orr r6, r6, r4, lsr #30 - add r6, r6, #1 @ r6=s1cc???? ... ?????www (s=shadow/hilight, cc=pal, w=width) - - and r5, r9, #3 - add r5, r5, #1 @ r5=delta - tst r9, #0x10000 - rsbne r5, r5, #0 @ Flip X - mov r5, r5, lsl #4 - - mov r2, r9, lsr #17 - mov r8, r2, lsl #1 @ tile=((unsigned int)code>>17)<<1; - - and r3, r9, #0x30 @ r3=pal=(code&0x30); - - bic r6, r6, #3<<28 - orr r6, r6, r3, lsl #24 - - mov r0, r9, lsl #16 - mov r0, r0, asr #22 @ sx=(code<<16)>>22 - adds r0, r0, #0 @ set ZV - b .dsfc_inloop_enter - -@ scratch: r4, r7 -.dsfc_inloop: - sub r6, r6, #1 - tst r6, #7 - beq .dsfc_loop - adds r0, r0, #8 - add r8, r8, r5 - -.dsfc_inloop_enter: - ble .dsfc_inloop - cmp r0, #328 - bge .dsfc_loop - - mov r8, r8, lsl #17 - mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address - - ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+tile); // Get 8 pixels - tst r2, r2 - beq .dsfc_inloop - - add r1, r11, r0 @ r1=pdest - - cmp r12, r6, lsr #28 - beq .dsfc_shadow - - cmp r2, r2, ror #4 - beq .dsfc_SingleColor @ tileline singlecolor - - tst r9, #0x10000 - beq .dsfc_TileNorm - - @ TileFlip (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlip r12 - b .dsfc_inloop - -.dsfc_TileNorm: - TileNorm r12 - b .dsfc_inloop - -.dsfc_SingleColor: - tst r0, #1 @ not aligned? - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 - b .dsfc_inloop - -.dsfc_shadow: - cmp r2, r2, ror #4 - beq .dsfc_singlec_sh - - tst r9, #0x10000 - beq .dsfc_TileNorm_sh - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlipSh - b .dsfc_inloop - -.dsfc_TileNorm_sh: - TileNormSh - b .dsfc_inloop - -.dsfc_singlec_sh: - cmp r2, #0xe0000000 - bcc .dsfc_SingleColor @ normal singlecolor tileline (carry inverted in ARM) - tst r2, #0x10000000 - bne .dsfc_sh_sh - TileSingleHi - b .dsfc_inloop - -.dsfc_sh_sh: - TileSingleSh - b .dsfc_inloop - -.pool - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -@ + 0 : hhhhvvvv ab--hhvv yyyyyyyy yyyyyyyy // a: offscreen h, b: offs. v, h: horiz. size -@ + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8 - -.global DrawSprite @ unsigned int *sprite, int **hc, int sh - -DrawSprite: - stmfd sp!, {r4-r9,r11,lr} - - ldr r3, [r0] @ sprite[0] - mov r6, r3, lsr #28 - sub r6, r6, #1 @ r6=width-1 (inc later) - mov r5, r3, lsr #24 - and r5, r5, #7 @ r5=height - - mov r4, r3, lsl #16 @ r4=sy<<16 (tmp) - - ldr r7, =Scanline - ldr r7, [r7] - sub r7, r7, r4, asr #16 @ r7=row=Scanline-sy - - tst r2, r2 - ldr r9, [r0, #4] - mov r2, r9, asr #16 @ r2=sx - bic r9, r9, #0xfe000000 - orrne r9, r9, #1<<31 @ r9=code|(sh<<31) - - tst r9, #0x1000 - movne r4, r5, lsl #3 - subne r4, r4, #1 - subne r7, r4, r7 @ if (code&0x1000) row=(height<<3)-1-row; // Flip Y - - mov r8, r9, lsl #21 - mov r8, r8, lsr #21 - add r8, r8, r7, lsr #3 @ tile+=row>>3; // Tile number increases going down - - tst r9, #0x0800 - mlane r8, r5, r6, r8 @ if (code&0x0800) { tile+=delta*(width-1); - rsbne r5, r5, #0 @ delta=-delta; } // r5=delta now - - mov r8, r8, lsl #4 - and r7, r7, #7 - add r8, r8, r7, lsl #1 @ tile+=(row&7)<<1; // Tile address - - tst r9, #0x8000 - bne .dspr_cache @ if(code&0x8000) // high priority - cache it - - @ cache some stuff to avoid mem access -@ ldr r11,=HighCol - ldr r11,=DrawLineInt - ldr r11,[r11] - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - mov r12,#0xf - - mov r5, r5, lsl #4 @ delta<<=4; // Delta of address - and r4, r9, #0x6000 - orr r9, r9, r4, lsl #16 - orr r9, r9, #0x10000000 @ r9=scc1 ???? ... (s=shadow/hilight, cc=pal) - - tst r9, #1<<31 - mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30); - orrne r3, r3, #0x40 @ shadow by default - - add r6, r6, #1 @ inc now - adds r0, r2, #0 @ mov sx to r0 and set ZV flags - b .dspr_loop_enter - -.dspr_loop: - subs r6, r6, #1 @ width-- - ldmeqfd sp!, {r4-r9,r11,pc}@ return - adds r0, r0, #8 @ sx+=8 - add r8, r8, r5 @ tile+=delta - -.dspr_loop_enter: - ble .dspr_loop @ sx <= 0 - cmp r0, #328 - ldmgefd sp!, {r4-r9,r11,pc}@ return - - mov r8, r8, lsl #17 - mov r8, r8, lsr #17 @ tile&=0x7fff; // Clip tile address - - ldr r2, [lr, r8, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - tst r2, r2 - beq .dspr_loop - - add r1, r11, r0 @ r1=pdest - - cmp r12, r9, lsr #28 - beq .dspr_shadow - - cmp r2, r2, ror #4 - beq .dspr_SingleColor @ tileline singlecolor - - tst r9, #0x0800 - beq .dspr_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlip r12 - b .dspr_loop - -@ scratch: r4, r7 -.dspr_TileNorm: - TileNorm r12 - b .dspr_loop - -.dspr_SingleColor: - and r4, r2, #0xf - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - tst r0, #1 @ not aligned? - strneb r4, [r1], #1 - streqh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strh r4, [r1], #2 - strneb r4, [r1], #1 - b .dspr_loop - -.dspr_shadow: - cmp r2, r2, ror #4 - beq .dspr_singlec_sh - - tst r9, #0x0800 - beq .dspr_TileNorm_sh - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern - TileFlipSh - b .dspr_loop - -.dspr_TileNorm_sh: - TileNormSh - b .dspr_loop - -.dspr_singlec_sh: - cmp r2, #0xe0000000 - bcc .dspr_SingleColor @ normal tileline - tst r2, #0x10000000 - bne .dspr_sh_sh - TileSingleHi - b .dspr_loop - -.dspr_sh_sh: - TileSingleSh - b .dspr_loop - - -.dspr_cache: - @ *(*hc)++ = (tile<<16)|((code&0x0800)<<5)|((sx<<6)&0x0000ffc0)|((code>>9)&0x30)|((sprite[0]>>24)&0xf); - mov r4, r8, lsl #16 @ tile - tst r9, #0x0800 - orrne r4, r4, #0x10000 @ code&0x0800 - mov r2, r2, lsl #22 - orr r4, r4, r2, lsr #16 @ (sx<<6)&0x0000ffc0 - and r2, r9, #0x6000 - orr r4, r4, r2, lsr #9 @ (code>>9)&0x30 - mov r2, r3, lsl #12 - orr r4, r4, r2, lsr #28 @ (sprite[0]>>24)&0xf - - ldr r2, [r1] - str r4, [r2], #4 - str r2, [r1] - - ldmfd sp!, {r4-r9,r11,lr} - bx lr - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -.global DrawWindow @ int tstart, int tend, int prio, int sh // int *hcache - -DrawWindow: - stmfd sp!, {r4-r11,lr} - - ldr r11, =(Pico+0x22228) @ Pico.video - ldrb r12, [r11, #3] @ pvid->reg[3] - mov r12, r12, lsl #10 - - ldr r10, =Scanline - ldr r10, [r10] - mov r5, r10, lsr #3 - and r10, r10, #7 - mov r10, r10, lsl #1 @ r10=ty - - ldr r4, [r11, #12] - tst r4, #1 @ 40 cell mode? - andne r12, r12, #0xf000 @ 0x3c<<10 - andeq r12, r12, #0xf800 - addne r12, r12, r5, lsl #7 - addeq r12, r12, r5, lsl #6 @ nametab - add r12, r12, r0, lsl #2 @ +starttile - - ldr lr, =(Pico+0x10000) @ lr=Pico.vram - - @ fetch the first code now - ldrh r7, [lr, r12] - - ldr r6, =rendstatus - ldrb r6, [r6] - ands r6, r6, #2 @ we care about bit 1 only - orr r6, r6, r2 - bne .dw_no_sameprio - - cmp r2, r7, lsr #15 - ldmnefd sp!, {r4-r11,pc} @ assume that whole window uses same priority - -.dw_no_sameprio: - orr r6, r6, r3, lsl #8 @ shadow mode - - sub r8, r1, r0 - mov r8, r8, lsl #1 @ cells - - mvn r9, #0 @ r9=prevcode=-1 - - @ cache some stuff to avoid mem access -@ ldr r11,=(HighCol+8) - ldr r11,=DrawLineInt - ldr r11,[r11] - add r11,r11, #8 - add r1, r11, r0, lsl #4 @ r1=pdest - mov r0, #0xf - b .dwloop_enter - - @ r4,r5 & r7 are scratch in this loop -.dwloop: - add r1, r1, #8 -.dwloop_nor1: - subs r8, r8, #1 - add r12, r12, #2 @ halfwords - beq .dwloop_end @ done - - ldrh r7, [lr, r12] @ r7=code (int, but from unsigned, no sign extend) - - eor r5, r6, r7, lsr #15 - tst r5, #1 - orrne r6, r6, #2 @ wrong pri - bne .dwloop - - cmp r7, r9 - beq .dw_samecode @ we know stuff about this tile already - -.dwloop_enter: - mov r9, r7 @ remember code - - movs r2, r9, lsl #20 @ if (code&0x1000) - mov r2, r2, lsl #1 - add r2, r10, r2, lsr #17 @ r2=addr=(code&0x7ff)<<4; addr+=ty - eorcs r2, r2, #0x0e @ if (code&0x1000) addr^=0xe; - - and r3, r9, #0x6000 - mov r3, r3, lsr #9 @ r3=pal=((code&0x6000)>>9); - - ldr r2, [lr, r2, lsl #1] @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels - -.dw_samecode: - tst r6, #0x100 - bne .dw_shadow -.dw_shadow_done: - tst r2, r2 - beq .dwloop @ tileline blank - - cmp r2, r2, ror #4 - beq .dw_SingleColor @ tileline singlecolor - - tst r9, #0x0800 - beq .dw_TileNorm - - @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: helper pattern - TileFlip r0 - b .dwloop - -.dw_TileNorm: - TileNorm r0 - b .dwloop - -.dw_SingleColor: - and r4, r0, r2 @ #0x0000000f - orr r4, r3, r4 - orr r4, r4, r4, lsl #8 - orr r4, r4, r4, lsl #16 - mov r5, r4 - stmia r1!, {r4,r5} - b .dwloop_nor1 @ we incremeted r1 ourselves - -.dw_shadow: - tst r6, #1 @ hi pri? - orreq r3, r3, #0x40 - beq .dw_shadow_done - ldr r4, [r1] - tst r4, #0x00000080 - biceq r4, r4, #0x000000c0 - tst r4, #0x00008000 - biceq r4, r4, #0x0000c000 - tst r4, #0x00800000 - biceq r4, r4, #0x00c00000 - tst r4, #0x80000000 - biceq r4, r4, #0xc0000000 - str r4, [r1] - ldr r4, [r1,#4] - tst r4, #0x00000080 - biceq r4, r4, #0x000000c0 - tst r4, #0x00008000 - biceq r4, r4, #0x0000c000 - tst r4, #0x00800000 - biceq r4, r4, #0x00c00000 - tst r4, #0x80000000 - biceq r4, r4, #0xc0000000 - str r4, [r1,#4] - b .dw_shadow_done - -.dwloop_end: - ldr r0, =rendstatus - ldr r1, [r0] - and r6, r6, #2 - orr r1, r1, r6 - str r1, [r0] - - ldmfd sp!, {r4-r11,r12} - bx r12 - - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -@ hilights 2 pixels in RGB444/BGR444 format -.macro TileDoShHi2Pixels444 reg - mov \reg, \reg, ror #12 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #24 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #28 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #12 -.endm - - -.global FinalizeLineBGR444 @ int sh - -FinalizeLineBGR444: - stmfd sp!, {r4-r6,lr} - mov r6, r0 - ldr r0, =DrawLineDest - ldr r0, [r0] - ldr lr, =(Pico+0x22228) @ Pico.video - sub r3, lr, #0x128 @ r3=Pico.cram - - ldrb r12, [lr, #12] - tst r12, #1 - movne r2, #320/4 @ len - moveq r2, #256/4 - addeq r0, r0, #32*2 - ldreq r4, =PicoOpt - ldreq r4, [r4] - tsteq r4, #0x100 - addeq r0, r0, #32*2 - - tst r6, r6 - beq .fl_noshBGR444 - - ldr r4, =HighPal - - ldrb r12, [lr, #-0x1a] @ 0x2220e ~ dirtyPal - tst r12, r12 - moveq r3, r4 - beq .fl_noshBGR444 - mov r12, #0 - strb r12, [lr, #-0x1a] - - mov lr, #0x40/8 - @ copy pal: -.fl_loopcpBGR444: - subs lr, lr, #1 - ldmia r3!, {r1,r5,r6,r12} - stmia r4!, {r1,r5,r6,r12} - bne .fl_loopcpBGR444 - - @ shadowed pixels: - mov r12, #0x0077 - orr r12,r12,#0x0700 - orr r12,r12,r12,lsl #16 - sub r3, r3, #0x40*2 - add r5, r4, #0x80*2 - mov lr, #0x40/4 -.fl_loopcpBGR444_sh: - subs lr, lr, #1 - ldmia r3!, {r1,r6} - and r1, r12, r1, lsr #1 - and r6, r12, r6, lsr #1 - stmia r4!, {r1,r6} - stmia r5!, {r1,r6} - bne .fl_loopcpBGR444_sh - - @ hilighted pixels: - sub r3, r3, #0x40*2 - mov lr, #0x40/2 -.fl_loopcpBGR444_hi: - ldr r1, [r3], #4 - TileDoShHi2Pixels444 r1 - str r1, [r4], #4 - subs lr, lr, #1 - bne .fl_loopcpBGR444_hi - - sub r3, r4, #0x40*3*2 - - -.fl_noshBGR444: -@ ldr r1, =(HighCol+8) - ldr r1, =DrawLineInt - ldr r1, [r1] - add r1, r1, #8 - mov lr, #0xff - mov lr, lr, lsl #1 - -.fl_loopBGR444: - subs r2, r2, #1 - - ldr r12, [r1], #4 - - and r4, lr, r12, lsl #1 - ldrh r4, [r3, r4] - and r5, lr, r12, lsr #7 - ldrh r5, [r3, r5] - orr r4, r4, r5, lsl #16 - - and r5, lr, r12, lsr #15 - ldrh r5, [r3, r5] - and r6, lr, r12, lsr #23 - ldrh r6, [r3, r6] - orr r5, r5, r6, lsl #16 - - stmia r0!, {r4,r5} - bne .fl_loopBGR444 - - - ldmfd sp!, {r4-r6,lr} - bx lr - - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -@ hilights 2 pixels in RGB555/BGR555 format -.macro TileDoShHi2Pixels555 reg - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #26 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #26 - adds \reg, \reg, #0x40000000 - orrcs \reg, \reg, #0xf0000000 - mov \reg, \reg, ror #27 -.endm - - -@ Convert 0000bbb0 ggg0rrr0 -@ to rrrrrggg gggbbbbb - -@ r2,r3,r9 - scratch, lr = 0x001c001c, r8 = 0x00030003 -.macro convRGB565 reg - and r2, lr, \reg,lsl #1 - and r9, r8, \reg,lsr #2 - orr r2, r2, r9 @ r2=red - and r3, lr, \reg,lsr #7 - and r9, r8, \reg,lsr #10 - orr r3, r3, r9 @ r3=blue - and \reg, \reg, lr, lsl #3 - orr \reg, \reg, \reg,lsl #3 @ green - orr \reg, \reg, r2, lsl #11 @ add red back - orr \reg, \reg, r3 @ add blue back -.endm - -vidConvCpyRGB565: @ void *to, void *from, int pixels - stmfd sp!, {r4-r9,lr} - - mov r12, r2, lsr #3 @ repeats - mov lr, #0x001c0000 - orr lr, lr, #0x01c @ lr == pattern 0x001c001c - mov r8, #0x00030000 - orr r8, r8, #0x003 @ lr == pattern 0x001c001c - -.loopRGB565: - subs r12, r12, #1 - - ldmia r1!, {r4-r7} - convRGB565 r4 - str r4, [r0], #4 - convRGB565 r5 - str r5, [r0], #4 - convRGB565 r6 - str r6, [r0], #4 - convRGB565 r7 - str r7, [r0], #4 - - bgt .loopRGB565 - - ldmfd sp!, {r4-r9,lr} - bx lr - - - -.global FinalizeLineRGB555 @ int sh - -FinalizeLineRGB555: - stmfd sp!, {r4-r8,lr} - ldr r5, =(Pico+0x22228) @ Pico.video - ldr r4, =HighPal - mov r6, r0 - - ldrb r7, [r5, #-0x1a] @ 0x2220e ~ dirtyPal - tst r7, r7 - beq .fl_noconvRGB555 - mov r1, #0 - strb r1, [r5, #-0x1a] - sub r1, r5, #0x128 @ r1=Pico.cram - mov r0, r4 - mov r2, #0x40 - bl vidConvCpyRGB565 - -.fl_noconvRGB555: - ldr r0, =DrawLineDest - ldr r0, [r0] - - ldrb r12, [r5, #12] - tst r12, #1 - movne r2, #320/8 @ len - moveq r2, #256/8 - ldreq r3, =PicoOpt - ldreq r3, [r3] - tsteq r3, #0x100 - addeq r0, r0, #32*2 - - mov r3, r4 - tst r6, r6 - beq .fl_noshRGB555 - tst r7, r7 - beq .fl_noshRGB555 - - @ shadowed pixels: - mov r12, #0x008e - orr r12,r12,#0x7300 - orr r12,r12,r12,lsl #16 - add r4, r3, #0x40*2 - add r5, r3, #0xc0*2 - mov lr, #0x40/4 -.fl_loopcpRGB555_sh: - subs lr, lr, #1 - ldmia r3!, {r1,r6} - and r1, r12, r1, lsr #1 - and r6, r12, r6, lsr #1 - stmia r4!, {r1,r6} - stmia r5!, {r1,r6} - bne .fl_loopcpRGB555_sh - - @ hilighted pixels: - sub r3, r3, #0x40*2 - mov lr, #0x40/2 -.fl_loopcpRGB555_hi: - ldr r1, [r3], #4 - TileDoShHi2Pixels555 r1 - str r1, [r4], #4 - subs lr, lr, #1 - bne .fl_loopcpRGB555_hi - - sub r3, r3, #0x40*2 - - -.fl_noshRGB555: -@ ldr r1, =(HighCol+8) - ldr r1, =DrawLineInt - ldr r1, [r1] - add r1, r1, #8 - mov lr, #0xff - mov lr, lr, lsl #1 - -.fl_loopRGB555: - subs r2, r2, #1 - - ldr r12, [r1], #4 - ldr r7, [r1], #4 - - and r4, lr, r12, lsl #1 - ldrh r4, [r3, r4] - and r5, lr, r12, lsr #7 - ldrh r5, [r3, r5] - orr r4, r4, r5, lsl #16 - - and r5, lr, r12, lsr #15 - ldrh r5, [r3, r5] - and r6, lr, r12, lsr #23 - ldrh r6, [r3, r6] - orr r5, r5, r6, lsl #16 - - and r8, lr, r7, lsl #1 - ldrh r8, [r3, r8] - and r6, lr, r7, lsr #7 - ldrh r6, [r3, r6] - orr r8, r8, r6, lsl #16 - - and r12,lr, r7, lsr #15 - ldrh r12,[r3, r12] - and r6, lr, r7, lsr #23 - ldrh r6, [r3, r6] - orr r12,r12, r6, lsl #16 - - stmia r0!, {r4,r5,r8,r12} - bne .fl_loopRGB555 - - - ldmfd sp!, {r4-r8,lr} - bx lr - -@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -@ utility -.global blockcpy @ void *dst, void *src, size_t n - -blockcpy: - stmfd sp!, {r4,r5} - mov r2, r2, lsr #4 -blockcpy_loop: - subs r2, r2, #1 - ldmia r1!, {r3-r5,r12} - stmia r0!, {r3-r5,r12} - bne blockcpy_loop - ldmfd sp!, {r4,r5} - bx lr - - -.global blockcpy_or @ void *dst, void *src, size_t n, int pat - -blockcpy_or: - stmfd sp!, {r4-r6} - orr r3, r3, r3, lsl #8 - orr r3, r3, r3, lsl #16 - mov r2, r2, lsr #4 -blockcpy_loop_or: - subs r2, r2, #1 - ldmia r1!, {r4-r6,r12} - orr r4, r4, r3 - orr r5, r5, r3 - orr r6, r6, r3 - orr r12,r12,r3 - stmia r0!, {r4-r6,r12} - bne blockcpy_loop_or - ldmfd sp!, {r4-r6} - bx lr - diff --git a/Pico/Memory.c b/Pico/Memory.c index aa15bef3..b0aa7afa 100644 --- a/Pico/Memory.c +++ b/Pico/Memory.c @@ -45,7 +45,7 @@ void log_io(unsigned int addr, int bits, int rw); #define log_io(...) #endif -#if defined(EMU_C68K) || defined(EMU_A68K) +#if defined(EMU_C68K) static __inline int PicoMemBase(u32 pc) { int membase=0; @@ -69,10 +69,6 @@ static __inline int PicoMemBase(u32 pc) #endif -#ifdef EMU_A68K -extern u8 *OP_ROM=NULL,*OP_RAM=NULL; -#endif - static u32 CPU_CALL PicoCheckPc(u32 pc) { u32 ret=0; @@ -90,11 +86,6 @@ static u32 CPU_CALL PicoCheckPc(u32 pc) PicoCpu.membase-=pc&0xff000000; ret = PicoCpu.membase+pc; -#elif defined(EMU_A68K) - OP_ROM=(u8 *)PicoMemBase(pc); - - // don't bother calling us back unless it's outside the 64k segment - M68000_regs.AsmBank=(pc>>16); #endif return ret; } @@ -498,8 +489,8 @@ static void CPU_CALL PicoWrite32(u32 a,u32 d) // ----------------------------------------------------------------- PICO_INTERNAL void PicoMemSetup(void) { -#ifdef EMU_C68K // Setup memory callbacks: +#ifdef EMU_C68K PicoCpu.checkpc=PicoCheckPc; PicoCpu.fetch8 =PicoCpu.read8 =PicoRead8; PicoCpu.fetch16=PicoCpu.read16=PicoRead16; @@ -508,43 +499,16 @@ PICO_INTERNAL void PicoMemSetup(void) PicoCpu.write16=PicoWrite16; PicoCpu.write32=PicoWrite32; #endif +#ifdef EMU_F68K + PicoCpuM68k.read_byte =PicoRead8; + PicoCpuM68k.read_word =PicoRead16; + PicoCpuM68k.read_long =PicoRead32; + PicoCpuM68k.write_byte=PicoWrite8; + PicoCpuM68k.write_word=PicoWrite16; + PicoCpuM68k.write_long=PicoWrite32; +#endif } -#ifdef EMU_A68K -struct A68KInter -{ - u32 unknown; - u8 (__fastcall *Read8) (u32 a); - u16 (__fastcall *Read16)(u32 a); - u32 (__fastcall *Read32)(u32 a); - void (__fastcall *Write8) (u32 a,u8 d); - void (__fastcall *Write16) (u32 a,u16 d); - void (__fastcall *Write32) (u32 a,u32 d); - void (__fastcall *ChangePc)(u32 a); - u8 (__fastcall *PcRel8) (u32 a); - u16 (__fastcall *PcRel16)(u32 a); - u32 (__fastcall *PcRel32)(u32 a); - u16 (__fastcall *Dir16)(u32 a); - u32 (__fastcall *Dir32)(u32 a); -}; - -struct A68KInter a68k_memory_intf= -{ - 0, - PicoRead8, - PicoRead16, - PicoRead32, - PicoWrite8, - PicoWrite16, - PicoWrite32, - PicoCheckPc, - PicoRead8, - PicoRead16, - PicoRead32, - PicoRead16, // unused - PicoRead32, // unused -}; -#endif #ifdef EMU_M68K unsigned int m68k_read_pcrelative_CD8 (unsigned int a); diff --git a/Pico/Misc.c b/Pico/Misc.c index 38c381dd..a458f4de 100644 --- a/Pico/Misc.c +++ b/Pico/Misc.c @@ -316,8 +316,30 @@ PICO_INTERNAL void SRAMUpdPending(unsigned int a, unsigned int d) #ifndef _ASM_MISC_C +typedef struct +{ + int b0; + int b1; + int b2; + int b3; + int b4; + int b5; + int b6; + int b7; +} intblock; + PICO_INTERNAL_ASM void memcpy16(unsigned short *dest, unsigned short *src, int count) { + if (((int)dest & (int)src & 3) == 0) + { + if (count >= 32) { + memcpy32((int *)dest, (int *)src, count/2); + count&=1; + } else { + for (; count >= 2; count -= 2, dest+=2, src+=2) + *(int *)dest = *(int *)src; + } + } while (count--) *dest++ = *src++; } @@ -334,6 +356,12 @@ PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count) PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count) { + intblock *bd = (intblock *) dest, *bs = (intblock *) src; + + for (; count >= sizeof(*bd)/4; count -= sizeof(*bd)/4) + *bd++ = *bs++; + + dest = (int *)bd; src = (int *)bs; while (count--) *dest++ = *src++; } @@ -341,6 +369,10 @@ PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count) PICO_INTERNAL_ASM void memset32(int *dest, int c, int count) { + for (; count >= 8; count -= 8, dest += 8) + dest[0] = dest[1] = dest[2] = dest[3] = + dest[4] = dest[5] = dest[6] = dest[7] = c; + while (count--) *dest++ = c; } diff --git a/Pico/Pico.c b/Pico/Pico.c index 5f90db38..b9fbfe61 100644 --- a/Pico/Pico.c +++ b/Pico/Pico.c @@ -212,12 +212,10 @@ static __inline void SekRunM68k(int cyc) PicoCpu.cycles=cyc_do; CycloneRun(&PicoCpu); SekCycleCnt+=cyc_do-PicoCpu.cycles; -#elif defined(EMU_A68K) - m68k_ICount=cyc_do; - M68000_RUN(); - SekCycleCnt+=cyc_do-m68k_ICount; #elif defined(EMU_M68K) SekCycleCnt+=m68k_execute(cyc_do); +#elif defined(EMU_F68K) + SekCycleCnt+=m68k_emulate(cyc_do); #endif } @@ -232,12 +230,10 @@ static __inline void SekStep(void) PicoCpu.cycles=1; CycloneRun(&PicoCpu); SekCycleCnt+=1-PicoCpu.cycles; -#elif defined(EMU_A68K) - m68k_ICount=1; - M68000_RUN(); - SekCycleCnt+=1-m68k_ICount; #elif defined(EMU_M68K) SekCycleCnt+=m68k_execute(1); +#elif defined(EMU_F68K) + SekCycleCnt+=m68k_emulate(1); #endif SekCycleAim=realaim; } @@ -677,6 +673,8 @@ char *debugString(void) } #elif defined(EMU_M68K) sprintf(dstrp, "M68k: PC: %06x, cycles: %u, irql: %i\n", SekPc, SekCyclesDoneT(), PicoM68kCPU.int_level>>8); dstrp+=strlen(dstrp); +#elif defined(EMU_F68K) + sprintf(dstrp, "M68k: PC: %06x, cycles: %u, irql: %i\n", SekPc, SekCyclesDoneT(), PicoCpuM68k.interrupts[0]); dstrp+=strlen(dstrp); #endif sprintf(dstrp, "z80Run: %i, pal: %i, frame#: %i\n", Pico.m.z80Run, Pico.m.pal, Pico.m.frame_count); dstrp+=strlen(dstrp); z80_debug(dstrp); dstrp+=strlen(dstrp); diff --git a/Pico/PicoInt.h b/Pico/PicoInt.h index 1fd7422e..a6fceff1 100644 --- a/Pico/PicoInt.h +++ b/Pico/PicoInt.h @@ -24,7 +24,7 @@ #define PICO_INTERNAL_ASM #endif -// to select core, define EMU_C68K, EMU_M68K or EMU_A68K in your makefile or project +// to select core, define EMU_C68K, EMU_M68K or EMU_F68K in your makefile or project #ifdef __cplusplus extern "C" { @@ -50,24 +50,28 @@ extern struct Cyclone PicoCpu, PicoCpuS68k; #define SekSetStopS68k(x) { PicoCpuS68k.state_flags&=~1; if (x) { PicoCpuS68k.state_flags|=1; PicoCpuS68k.cycles=0; } } #endif -#ifdef EMU_A68K -void __cdecl M68000_RUN(); -// The format of the data in a68k.asm (at the _M68000_regs location) -struct A68KContext -{ - unsigned int d[8],a[8]; - unsigned int isp,srh,ccr,xc,pc,irq,sr; - int (*IrqCallback) (int nIrq); - unsigned int ppc; - void *pResetCallback; - unsigned int sfc,dfc,usp,vbr; - unsigned int AsmBank,CpuVersion; -}; -struct A68KContext M68000_regs; -extern int m68k_ICount; -#define SekCyclesLeft m68k_ICount -#define SekSetCyclesLeft(c) m68k_ICount=c -#define SekPc M68000_regs.pc +#ifdef EMU_F68K +#include "../cpu/fame/fame.h" +M68K_CONTEXT PicoCpuM68k, PicoCpuS68k; +#define SekCyclesLeftNoMCD PicoCpuM68k.io_cycle_counter +#define SekCyclesLeft \ + (((PicoMCD&1) && (PicoOpt & 0x2000)) ? (SekCycleAim-SekCycleCnt) : SekCyclesLeftNoMCD) +#define SekCyclesLeftS68k \ + ((PicoOpt & 0x2000) ? (SekCycleAimS68k-SekCycleCntS68k) : PicoCpuS68k.io_cycle_counter) +#define SekSetCyclesLeftNoMCD(c) PicoCpuM68k.io_cycle_counter=c +#define SekSetCyclesLeft(c) { \ + if ((PicoMCD&1) && (PicoOpt & 0x2000)) SekCycleCnt=SekCycleAim-(c); else SekSetCyclesLeftNoMCD(c); \ +} +#define SekPc m68k_get_pc(&PicoCpuM68k) +#define SekPcS68k m68k_get_pc(&PicoCpuS68k) +#define SekSetStop(x) { \ + PicoCpuM68k.execinfo &= ~M68K_HALTED; \ + if (x) { PicoCpuM68k.execinfo |= M68K_HALTED; PicoCpuM68k.io_cycle_counter = 0; } \ +} +#define SekSetStopS68k(x) { \ + PicoCpuS68k.execinfo &= ~M68K_HALTED; \ + if (x) { PicoCpuS68k.execinfo |= M68K_HALTED; PicoCpuS68k.io_cycle_counter = 0; } \ +} #endif #ifdef EMU_M68K @@ -137,10 +141,10 @@ extern int SekCycleAimS68k; #define SekEndRun(c) #endif -extern int PicoMCD; - // --------------------------------------------------------- +extern int PicoMCD; + // main oscillator clock which controls timing #define OSC_NTSC 53693100 // seems to be accurate, see scans from http://www.hot.ee/tmeeco/ diff --git a/Pico/Sek.c b/Pico/Sek.c index 1f2316ee..f3af5319 100644 --- a/Pico/Sek.c +++ b/Pico/Sek.c @@ -14,33 +14,23 @@ int SekCycleCnt=0; // cycles done in this frame int SekCycleAim=0; // cycle aim unsigned int SekCycleCntT=0; + +/* context */ +// Cyclone 68000 #ifdef EMU_C68K -// ---------------------- Cyclone 68000 ---------------------- struct Cyclone PicoCpu; #endif - +// MUSASHI 68000 #ifdef EMU_M68K -// ---------------------- MUSASHI 68000 ---------------------- -m68ki_cpu_core PicoM68kCPU; // MD's CPU +m68ki_cpu_core PicoM68kCPU; #endif - -#ifdef EMU_A68K -// ---------------------- A68K ---------------------- - -void __cdecl M68000_RESET(); -int m68k_ICount=0; -unsigned int mem_amask=0xffffff; // 24-bit bus -unsigned int mame_debug=0,cur_mrhard=0,m68k_illegal_opcode=0,illegal_op=0,illegal_pc=0,opcode_entry=0; // filler - -static int IrqCallback(int i) { i; return -1; } -static int DoReset() { return 0; } -static int (*ResetCallback)()=DoReset; - -#pragma warning (disable:4152) +// FAME 68000 +#ifdef EMU_F68K +M68K_CONTEXT PicoCpuM68k; #endif - +/* callbacks */ #ifdef EMU_C68K // interrupt acknowledgment static int SekIntAck(int level) @@ -75,7 +65,6 @@ static int SekUnrecognizedOpcode() have_illegal = 1; } #endif - //exit(1); return 0; } #endif @@ -97,6 +86,35 @@ static int SekTasCallback(void) #endif +#ifdef EMU_F68K +static void setup_fame_fetchmap(void) +{ + int i; + + // be default, point everything to fitst 64k of ROM + for (i = 0; i < M68K_FETCHBANK1; i++) + PicoCpuM68k.Fetch[i] = (unsigned int)Pico.rom - (i<<(24-FAMEC_FETCHBITS)); + // now real ROM + for (i = 0; i < M68K_FETCHBANK1 && (i<<(24-FAMEC_FETCHBITS)) < Pico.romsize; i++) + PicoCpuM68k.Fetch[i] = (unsigned int)Pico.rom; + elprintf(EL_ANOMALY, "ROM end @ #%i %06x", i, (i<<(24-FAMEC_FETCHBITS))); + // .. and RAM (TODO) + for (i = M68K_FETCHBANK1*14/16; i < M68K_FETCHBANK1; i++) + PicoCpuM68k.Fetch[i] = (unsigned int)Pico.ram - (i<<(24-FAMEC_FETCHBITS)); + + elprintf(EL_ANOMALY, "rom = %p, ram = %p", Pico.rom, Pico.ram); + for (i = 0; i < M68K_FETCHBANK1; i++) + elprintf(EL_ANOMALY, "Fetch[%i] = %p", i, PicoCpuM68k.Fetch[i]); +} + +void SekIntAckF68K(unsigned level) +{ + if (level == 4) { Pico.video.pending_ints = 0; elprintf(EL_INTS, "hack: @ %06x [%i]", SekPc, SekCycleCnt); } + else if(level == 6) { Pico.video.pending_ints &= ~0x20; elprintf(EL_INTS, "vack: @ %06x [%i]", SekPc, SekCycleCnt); } + PicoCpuM68k.interrupts[0] = 0; +} +#endif + PICO_INTERNAL int SekInit() { @@ -107,12 +125,6 @@ PICO_INTERNAL int SekInit() PicoCpu.ResetCallback=SekResetAck; PicoCpu.UnrecognizedCallback=SekUnrecognizedOpcode; #endif -#ifdef EMU_A68K - memset(&M68000_regs,0,sizeof(M68000_regs)); - M68000_regs.IrqCallback=IrqCallback; - M68000_regs.pResetCallback=ResetCallback; - M68000_RESET(); // Init cpu emulator -#endif #ifdef EMU_M68K { void *oldcontext = m68ki_cpu_p; @@ -125,10 +137,21 @@ PICO_INTERNAL int SekInit() m68k_set_context(oldcontext); } #endif +#ifdef EMU_F68K + { + void *oldcontext = g_m68kcontext; + g_m68kcontext = &PicoCpuM68k; + memset(&PicoCpuM68k, 0, sizeof(PicoCpuM68k)); + m68k_init(); + PicoCpuM68k.iack_handler = SekIntAckF68K; + g_m68kcontext = oldcontext; + } +#endif return 0; } + // Reset the 68000: PICO_INTERNAL int SekReset() { @@ -144,19 +167,21 @@ PICO_INTERNAL int SekReset() PicoCpu.membase=0; PicoCpu.pc=PicoCpu.checkpc(PicoCpu.read32(4)); // Program Counter #endif -#ifdef EMU_A68K - // Reset CPU: fetch SP and PC - M68000_regs.srh=0x27; // Supervisor mode - M68000_regs.a[7]=PicoRead32(0); - M68000_regs.pc =PicoRead32(4); - PicoInitPc(M68000_regs.pc); -#endif #ifdef EMU_M68K m68k_set_context(&PicoM68kCPU); // if we ever reset m68k, we always need it's context to be set m68ki_cpu.sp[0]=0; m68k_set_irq(0); m68k_pulse_reset(); #endif +#ifdef EMU_F68K + { + unsigned ret; + g_m68kcontext = &PicoCpuM68k; + setup_fame_fetchmap(); + ret = m68k_reset(); + /*if (ret)*/ elprintf(EL_ANOMALY, "m68k_reset returned %u", ret); + } +#endif return 0; } @@ -174,9 +199,6 @@ PICO_INTERNAL int SekInterrupt(int irq) #ifdef EMU_C68K PicoCpu.irq=irq; #endif -#ifdef EMU_A68K - M68000_regs.irq=irq; // raise irq (gets lowered after taken) -#endif #ifdef EMU_M68K { void *oldcontext = m68ki_cpu_p; @@ -185,23 +207,23 @@ PICO_INTERNAL int SekInterrupt(int irq) m68k_set_context(oldcontext); } #endif +#ifdef EMU_F68K + PicoCpuM68k.interrupts[0]=irq; +#endif + return 0; } -//int SekPc() { return PicoCpu.pc-PicoCpu.membase; } -//int SekPc() { return M68000_regs.pc; } -//int SekPc() { return m68k_get_reg(NULL, M68K_REG_PC); } - PICO_INTERNAL void SekState(unsigned char *data) { #ifdef EMU_C68K memcpy(data,PicoCpu.d,0x44); -#elif defined(EMU_A68K) - memcpy(data, M68000_regs.d, 0x40); - memcpy(data+0x40,&M68000_regs.pc,0x04); #elif defined(EMU_M68K) - memcpy(data, PicoM68kCPU.dar,0x40); - memcpy(data+0x40,&PicoM68kCPU.pc, 0x04); + memcpy(data, PicoM68kCPU.dar, 0x40); + *(int *)(data+0x40) = PicoM68kCPU.pc; +#elif defined(EMU_F68K) + memcpy(data, PicoCpuM68k.dreg, 0x40); + *(int *)(data+0x40) = PicoCpuM68k.pc; #endif } @@ -210,5 +232,8 @@ PICO_INTERNAL void SekSetRealTAS(int use_real) #ifdef EMU_C68K CycloneSetRealTAS(use_real); #endif +#ifdef EMU_F68K + // TODO +#endif } diff --git a/cpu/fame/fame.h b/cpu/fame/fame.h new file mode 100644 index 00000000..11955939 --- /dev/null +++ b/cpu/fame/fame.h @@ -0,0 +1,186 @@ +/*****************************************************************************/ +/* FAME Fast and Accurate Motorola 68000 Emulation Core */ +/* (c) 2005 Oscar Orallo Pelaez */ +/* Version: 1.24 */ +/* Date: 08-20-2005 */ +/* See FAME.HTML for documentation and license information */ +/*****************************************************************************/ + +#ifndef __FAME_H__ +#define __FAME_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// PicoDrive hacks +#define FAMEC_FETCHBITS 8 +#define M68K_FETCHBANK1 (1 << FAMEC_FETCHBITS) + +//#define M68K_RUNNING 0x01 +#define M68K_HALTED 0x80 +#define M68K_WAITING 0x04 +#define M68K_DISABLE 0x20 +#define M68K_FAULTED 0x40 +#define M68K_EMULATE_GROUP_0 0x02 +#define M68K_EMULATE_TRACE 0x08 +#define M68K_DO_TRACE 0x10 + + +/************************************/ +/* General library defines */ +/************************************/ + +#ifndef M68K_OK + #define M68K_OK 0 +#endif +#ifndef M68K_RUNNING + #define M68K_RUNNING 1 +#endif +#ifndef M68K_NO_SUP_ADDR_SPACE + #define M68K_NO_SUP_ADDR_SPACE 2 +#endif +#ifndef M68K_DOUBLE_BUS_FAULT + #define M68K_DOUBLE_BUS_FAULT -1 +#endif +#ifndef M68K_INV_REG + #define M68K_INV_REG -1 +#endif + +/* Hardware interrupt state */ + +#ifndef M68K_IRQ_LEVEL_ERROR + #define M68K_IRQ_LEVEL_ERROR -1 +#endif +#ifndef M68K_IRQ_INV_PARAMS + #define M68K_IRQ_INV_PARAMS -2 +#endif + +/* Defines to specify hardware interrupt type */ + +#ifndef M68K_AUTOVECTORED_IRQ + #define M68K_AUTOVECTORED_IRQ -1 +#endif +#ifndef M68K_SPURIOUS_IRQ + #define M68K_SPURIOUS_IRQ -2 +#endif + +#ifndef M68K_AUTO_LOWER_IRQ + #define M68K_AUTO_LOWER_IRQ 1 +#endif +#ifndef M68K_MANUAL_LOWER_IRQ + #define M68K_MANUAL_LOWER_IRQ 0 +#endif + +/* Defines to specify address space */ + +#ifndef M68K_SUP_ADDR_SPACE + #define M68K_SUP_ADDR_SPACE 0 +#endif +#ifndef M68K_USER_ADDR_SPACE + #define M68K_USER_ADDR_SPACE 2 +#endif +#ifndef M68K_PROG_ADDR_SPACE + #define M68K_PROG_ADDR_SPACE 0 +#endif +#ifndef M68K_DATA_ADDR_SPACE + #define M68K_DATA_ADDR_SPACE 1 +#endif + + +/*******************/ +/* Data definition */ +/*******************/ + +/* M68K registers */ +typedef enum { + M68K_REG_D0=0, + M68K_REG_D1, + M68K_REG_D2, + M68K_REG_D3, + M68K_REG_D4, + M68K_REG_D5, + M68K_REG_D6, + M68K_REG_D7, + M68K_REG_A0, + M68K_REG_A1, + M68K_REG_A2, + M68K_REG_A3, + M68K_REG_A4, + M68K_REG_A5, + M68K_REG_A6, + M68K_REG_A7, + M68K_REG_ASP, + M68K_REG_PC, + M68K_REG_SR +} m68k_register; + +typedef union +{ + unsigned char B; + signed char SB; + unsigned short W; + signed short SW; + unsigned int D; + signed int SD; +} famec_union32; + +/* The memory blocks must be in native (Motorola) format */ +struct M68K_PROGRAM { + unsigned low_addr; + unsigned high_addr; + unsigned offset; +}; + +/* The memory blocks must be in native (Motorola) format */ +struct M68K_DATA { + unsigned low_addr; + unsigned high_addr; + void *mem_handler; + void *data; +}; + +/* M68K CPU CONTEXT */ +typedef struct +{ + unsigned int (*read_byte )(unsigned int a); + unsigned int (*read_word )(unsigned int a); + unsigned int (*read_long )(unsigned int a); + void (*write_byte)(unsigned int a,unsigned char d); + void (*write_word)(unsigned int a,unsigned short d); + void (*write_long)(unsigned int a,unsigned int d); + void (*reset_handler)(void); + void (*iack_handler)(unsigned level); + famec_union32 dreg[8]; + famec_union32 areg[8]; + unsigned asp; + unsigned pc; + unsigned char interrupts[8]; + unsigned short sr; + unsigned short execinfo; + // PD extension + int io_cycle_counter; // cycles left + unsigned int Fetch[M68K_FETCHBANK1]; +} M68K_CONTEXT; + +extern M68K_CONTEXT *g_m68kcontext; + +/************************/ +/* Function definition */ +/************************/ + +/* General purpose functions */ +void m68k_init(void); +int m68k_reset(void); +int m68k_emulate(int n); + +unsigned m68k_get_pc(M68K_CONTEXT *context); +unsigned m68k_get_register(M68K_CONTEXT *context, m68k_register reg); +unsigned m68k_set_register(M68K_CONTEXT *context, m68k_register reg, unsigned value); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/cpu/fame/famec.c b/cpu/fame/famec.c new file mode 100644 index 00000000..609b76fe --- /dev/null +++ b/cpu/fame/famec.c @@ -0,0 +1,5095 @@ +/****************************************************************************/ +/* FAME (Fast and Accurate Motorola 68000 Emulation Library) */ +/* Emulador de 68000 en C */ +/* Autor: Oscar Orallo Pelaez */ +/* Fecha de comienzo: 03-10-2006 */ +/* Ultima actualizacion: 08-10-2006 */ +/* Based on the excellent FAMEC emulator by Stèphane Dallongueville */ +/****************************************************************************/ + +#include +#include +#include + +#include "fame.h" + + +// Options // +#define FAMEC_ROLL_INLINE +#define FAMEC_EMULATE_TRACE +#define FAMEC_IRQ_CYCLES +#define FAMEC_CHECK_BRANCHES +// #define FAMEC_USE_DATA_BANKS +// #define FAMEC_EXTRA_INLINE +// #define FAMEC_DEBUG +#define FAMEC_NO_GOTOS +#define FAMEC_ADR_BITS 24 +// #define FAMEC_FETCHBITS 8 +#define FAMEC_DATABITS 8 + +#define USE_CYCLONE_TIMING +#define USE_CYCLONE_TIMING_DIV +// Options // + + +#undef INLINE +#ifndef INLINE +#define INLINE __inline__ +#endif + +#ifndef FAMEC_EXTRA_INLINE +#define FAMEC_EXTRA_INLINE +#else +#define FAMEC_EXTRA_INLINE INLINE +#endif + +#ifdef u8 +#undef u8 +#endif + +#ifdef s8 +#undef s8 +#endif + +#ifdef u16 +#undef u16 +#endif + +#ifdef s16 +#undef s16 +#endif + +#ifdef u32 +#undef u32 +#endif + +#ifdef s32 +#undef s32 +#endif + +#define u8 unsigned char +#define s8 signed char +#define u16 unsigned short +#define s16 signed short +#define u32 unsigned int +#define s32 signed int + +/* +typedef unsigned char u8; +typedef signed char s8; +typedef unsigned short u16; +typedef signed short s16; +typedef unsigned int u32; +typedef signed int s32; +*/ + +#ifdef FAMEC_EMULATE_TRACE +static u32 flag_T; +#endif +static u32 flag_C; +static u32 flag_V; +static u32 flag_NotZ; +static u32 flag_N; +static u32 flag_X; // 16 bytes aligned +static u32 flag_S; +static u32 flag_I; + +#ifndef M68K_OK + #define M68K_OK 0 +#endif + +#ifndef M68K_RUNNING + #define M68K_RUNNING 1 +#endif + +#ifndef M68K_NO_SUP_ADDR_SPACE + #define M68K_NO_SUP_ADDR_SPACE 2 +#endif + +#ifndef M68K_INV_REG + #define M68K_INV_REG -1 +#endif + +/* Hardware interrupt state */ + +#ifndef M68K_IRQ_LEVEL_ERROR + #define M68K_IRQ_LEVEL_ERROR -1 +#endif + +#ifndef M68K_IRQ_INV_PARAMS + #define M68K_IRQ_INV_PARAMS -2 +#endif + +/* Defines to specify hardware interrupt type */ + +#ifndef M68K_AUTOVECTORED_IRQ + #define M68K_AUTOVECTORED_IRQ -1 +#endif + +#ifndef M68K_SPURIOUS_IRQ + #define M68K_SPURIOUS_IRQ -2 +#endif + +/* Defines to specify address space */ + +#ifndef M68K_SUP_ADDR_SPACE + #define M68K_SUP_ADDR_SPACE 0 +#endif + +#ifndef M68K_USER_ADDR_SPACE + #define M68K_USER_ADDR_SPACE 2 +#endif + +#ifndef M68K_PROG_ADDR_SPACE + #define M68K_PROG_ADDR_SPACE 0 +#endif + +#ifndef M68K_DATA_ADDR_SPACE + #define M68K_DATA_ADDR_SPACE 1 +#endif + + + +/******************************/ +/* 68K core types definitions */ +/******************************/ + +#if FAMEC_ADR_BITS < 32 +#define M68K_ADR_MASK ((1 << FAMEC_ADR_BITS)-1) +#else +#define M68K_ADR_MASK 0xFFFFFFFF +#endif +#define M68K_FETCHSFT (FAMEC_ADR_BITS - FAMEC_FETCHBITS) +#define M68K_FETCHBANK (1 << FAMEC_FETCHBITS) +#define M68K_FETCHMASK (M68K_FETCHBANK - 1) + +#define M68K_DATASFT (FAMEC_ADR_BITS - FAMEC_DATABITS) +#define M68K_DATABANK (1 << FAMEC_DATABITS) +#define M68K_DATAMASK (M68K_DATABANK - 1) + +#define M68K_SR_C_SFT 8 +#define M68K_SR_V_SFT 7 +#define M68K_SR_Z_SFT 0 +#define M68K_SR_N_SFT 7 +#define M68K_SR_X_SFT 8 + +#define M68K_SR_S_SFT 13 +#define M68K_SR_T_SFT 15 + +#define M68K_SR_C (1 << M68K_SR_C_SFT) +#define M68K_SR_V (1 << M68K_SR_V_SFT) +#define M68K_SR_Z 0 +#define M68K_SR_N (1 << M68K_SR_N_SFT) +#define M68K_SR_X (1 << M68K_SR_X_SFT) + +#define M68K_SR_S (1 << M68K_SR_S_SFT) +#define M68K_SR_T (1 << M68K_SR_T_SFT) + +#define M68K_CCR_MASK 0x1F + +#ifdef FAMEC_EMULATE_TRACE +#define M68K_SR_MASK (M68K_SR_T | M68K_SR_S | 0x0700 | M68K_CCR_MASK) +#else +#define M68K_SR_MASK (M68K_SR_S | 0x0700 | M68K_CCR_MASK) +#endif + +// exception defines taken from musashi core +#define M68K_RESET_EX 1 +#define M68K_BUS_ERROR_EX 2 +#define M68K_ADDRESS_ERROR_EX 3 +#define M68K_ILLEGAL_INSTRUCTION_EX 4 +#define M68K_ZERO_DIVIDE_EX 5 +#define M68K_CHK_EX 6 +#define M68K_TRAPV_EX 7 +#define M68K_PRIVILEGE_VIOLATION_EX 8 +#define M68K_TRACE_EX 9 +#define M68K_1010_EX 10 +#define M68K_1111_EX 11 +#define M68K_FORMAT_ERROR_EX 14 +#define M68K_UNINITIALIZED_INTERRUPT_EX 15 +#define M68K_SPURIOUS_INTERRUPT_EX 24 +#define M68K_INTERRUPT_AUTOVECTOR_EX 24 +#define M68K_TRAP_BASE_EX 32 + +#define M68K_INT_ACK_AUTOVECTOR -1 + + +// internals core macros +///////////////////////// + +#define DREG(X) (m68kcontext.dreg[(X)].D) +#define DREGu32(X) (m68kcontext.dreg[(X)].D) +#define DREGs32(X) (m68kcontext.dreg[(X)].SD) +#define DREGu16(X) (m68kcontext.dreg[(X)].W) +#define DREGs16(X) (m68kcontext.dreg[(X)].SW) +#define DREGu8(X) (m68kcontext.dreg[(X)].B) +#define DREGs8(X) (m68kcontext.dreg[(X)].SB) + +#define AREG(X) (m68kcontext.areg[(X)].D) +#define AREGu32(X) (m68kcontext.areg[(X)].D) +#define AREGs32(X) (m68kcontext.areg[(X)].SD) +#define AREGu16(X) (m68kcontext.areg[(X)].W) +#define AREGs16(X) (m68kcontext.areg[(X)].SW) + +#define ASP (m68kcontext.asp) + +#define LSL(A, C) ((A) << (C)) +#define LSR(A, C) ((A) >> (C)) + +#define LSR_32(A, C) ((C) < 32 ? (A) >> (C) : 0) +#define LSL_32(A, C) ((C) < 32 ? (A) << (C) : 0) + +#define ROL_8(A, C) (LSL(A, C) | LSR(A, 8-(C))) +#define ROL_9(A, C) (LSL(A, C) | LSR(A, 9-(C))) +#define ROL_16(A, C) (LSL(A, C) | LSR(A, 16-(C))) +#define ROL_17(A, C) (LSL(A, C) | LSR(A, 17-(C))) +#define ROL_32(A, C) (LSL_32(A, C) | LSR_32(A, 32-(C))) +#define ROL_33(A, C) (LSL_32(A, C) | LSR_32(A, 33-(C))) + +#define ROR_8(A, C) (LSR(A, C) | LSL(A, 8-(C))) +#define ROR_9(A, C) (LSR(A, C) | LSL(A, 9-(C))) +#define ROR_16(A, C) (LSR(A, C) | LSL(A, 16-(C))) +#define ROR_17(A, C) (LSR(A, C) | LSL(A, 17-(C))) +#define ROR_32(A, C) (LSR_32(A, C) | LSL_32(A, 32-(C))) +#define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C))) + +#ifndef FAMEC_NO_GOTOS +#define NEXT \ + FETCH_WORD(Opcode); \ + goto *JumpTable[Opcode]; + +#ifdef FAMEC_ROLL_INLINE +#define RET(A) \ + m68kcontext.io_cycle_counter -= (A); \ + if (m68kcontext.io_cycle_counter <= 0) goto famec_Exec_End; \ + NEXT +#else +#define RET(A) \ + m68kcontext.io_cycle_counter -= (A); \ + if (m68kcontext.io_cycle_counter <= 0) goto famec_Exec_End; \ + goto famec_Exec; +#endif + +#else + +#define NEXT \ + do{ \ + FETCH_WORD(Opcode); \ + JumpTable[Opcode](); \ + }while(m68kcontext.io_cycle_counter>0); + +#define RET(A) \ + m68kcontext.io_cycle_counter -= (A); \ + return; + +#endif + +#define M68K_PPL (m68kcontext.sr >> 8) & 7 + +#define GET_PC \ + (u32)PC - BasePC; + +#define SET_PC(A) \ + BasePC = g_m68kcontext->Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \ + /* BasePC -= (A) & 0xFF000000; */ \ + PC = (u16*)(((A) & M68K_ADR_MASK) + BasePC); + +#define SET_PC_BASE(P,B,A) \ + (B) = g_m68kcontext->Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \ + /* (B) -= (A) & 0xFF000000; */ \ + (P) = (u16*)(((A) & M68K_ADR_MASK) + (B)); + + +#define PRE_IO \ +// io_cycle_counter = CCnt; + +#define POST_IO \ +// CCnt = io_cycle_counter; + +#ifndef FAME_BIG_ENDIAN + + #define READ_BYTE_F(A, D) \ + D = m68kcontext.read_byte(A) & 0xFF; + + #define READ_WORD_F(A, D) \ + D = m68kcontext.read_word(A) & 0xFFFF; + + #define READ_LONG_F(A, D) \ + D = m68kcontext.read_word((A)) << 16; \ + D |= m68kcontext.read_word((A) + 2) & 0xFFFF; + + #define READSX_LONG_F(A, D) \ + D = m68kcontext.read_word((A)) << 16; \ + D |= m68kcontext.read_word((A) + 2) & 0xFFFF; + + #define WRITE_LONG_F(A, D) \ + m68kcontext.write_word((A), (D) >> 16); \ + m68kcontext.write_word((A) + 2, (D) & 0xFFFF); + + #define WRITE_LONG_DEC_F(A, D) \ + m68kcontext.write_word((A), (D) >> 16); \ + m68kcontext.write_word((A) + 2, (D) & 0xFFFF); + + #define FETCH_LONG(A) \ + (A) = PC[1] | (PC[0] << 16); \ + PC += 2; + + #define PUSH_32_F(D) \ + AREG(7) -= 4; \ + m68kcontext.write_word(AREG(7), (D) >> 16); \ + m68kcontext.write_word(AREG(7) + 2, (D) & 0xFFFF); + + #define POP_32_F(D) \ + D = m68kcontext.read_word(AREG(7)) << 16; \ + D |= m68kcontext.read_word(AREG(7) + 2) & 0xFFFF; \ + AREG(7) += 4; + + #define GET_SWORD \ + (s16)(*PC) + + #define FETCH_BYTE(A) \ + (A) = (*PC++) & 0xFF; + + #define FETCH_SBYTE(A) \ + (A) = (s8)((*PC++) & 0xFF); + + #define FETCH_WORD(A) \ + (A) = *PC++; + + #define FETCH_SWORD(A) \ + (A) = (s16)(*PC++); + + #define DECODE_EXT_WORD \ + { \ + u32 ext; \ + \ + ext = *PC++; \ + \ + adr += (s8)(ext); \ + if (ext & 0x0800) adr += DREGs32(ext >> 12); \ + else adr += DREGs16(ext >> 12); \ + } + +#else + + #define READ_BYTE_F(A, D) \ + D = m68kcontext.read_byte(A) & 0xFF; + + #define READ_WORD_F(A, D) \ + D = m68kcontext.read_word(A) & 0xFFFF; + + #define READ_LONG_F(A, D) \ + D = m68kcontext.read_long(A); + + #define READSX_LONG_F(A, D) \ + D = m68kcontext.read_long(A); + + #define WRITE_LONG_F(A, D) \ + m68kcontext.write_long(A, D); + + #define WRITE_LONG_DEC_F(A, D) \ + m68kcontext.write_word((A) + 2, (D) >> 16); \ + m68kcontext.write_word((A), (D) & 0xFFFF); + + #define FETCH_LONG(A) \ + (A) = PC[0] | (PC[1] << 16); \ + PC += 2; + + #define PUSH_32_F(D) \ + AREG(7) -= 4; \ + m68kcontext.write_long(AREG(7), D); + + #define POP_32_F(D) \ + D = m68kcontext.read_long(AREG(7)); \ + AREG(7) += 4; + + #define GET_SWORD \ + ((s16)(((*PC & 0xFF) << 8) | (*PC >> 8))) + + #define FETCH_BYTE(A) \ + (A) = (*PC++) >> 8; + + #define FETCH_SBYTE(A) \ + (A) = (s8)((*PC++) >> 8); + + #define FETCH_WORD(A) \ + (A) = ((*PC & 0xFF) << 8) | (*PC >> 8); \ + PC++; + + #define FETCH_SWORD(A) \ + (A) = (s16)(((*PC & 0xFF) << 8) | (*PC >> 8)); \ + PC++; + + #define DECODE_EXT_WORD \ + { \ + u32 ext; \ + \ + ext = *PC++; \ + \ + adr += (s8)(ext >> 8); \ + if (ext & 0x0008) adr += DREGs32((ext >> 4) & 0x000F); \ + else adr += DREGs16((ext >> 4) & 0x000F); \ + } + +#endif + +#define READSX_BYTE_F(A, D) \ + D = (s8)m68kcontext.read_byte(A); + +#define READSX_WORD_F(A, D) \ + D = (s16)m68kcontext.read_word(A); + + +#define WRITE_BYTE_F(A, D) \ + m68kcontext.write_byte(A, D); + +#define WRITE_WORD_F(A, D) \ + m68kcontext.write_word(A, D); + +#define PUSH_16_F(D) \ + m68kcontext.write_word(AREG(7) -= 2, D); \ + +#define POP_16_F(D) \ + D = (u16)m68kcontext.read_word(AREG(7)); \ + AREG(7) += 2; + +#define GET_CCR \ + (((flag_C >> (M68K_SR_C_SFT - 0)) & 1) | \ + ((flag_V >> (M68K_SR_V_SFT - 1)) & 2) | \ + (((!flag_NotZ) & 1) << 2) | \ + ((flag_N >> (M68K_SR_N_SFT - 3)) & 8) | \ + ((flag_X >> (M68K_SR_X_SFT - 4)) & 0x10)) + +#ifdef FAMEC_EMULATE_TRACE +#define GET_SR \ + ((flag_S << 0) | \ + (flag_I << 8) | \ + (flag_T ) | \ + GET_CCR) +#else +#define GET_SR \ + ((flag_S << 0) | \ + (flag_I << 8) | \ + GET_CCR) +#endif + +#define SET_CCR(A) \ + flag_C = (A) << (M68K_SR_C_SFT - 0); \ + flag_V = (A) << (M68K_SR_V_SFT - 1); \ + flag_NotZ = ~(A) & 4; \ + flag_N = (A) << (M68K_SR_N_SFT - 3); \ + flag_X = (A) << (M68K_SR_X_SFT - 4); + + +#ifdef FAMEC_EMULATE_TRACE +#define SET_SR(A) \ + SET_CCR(A) \ + flag_T = (A) & M68K_SR_T; \ + flag_S = (A) & M68K_SR_S; \ + flag_I = ((A) >> 8) & 7; +#else +#define SET_SR(A) \ + SET_CCR(A) \ + flag_S = (A) & M68K_SR_S; \ + flag_I = ((A) >> 8) & 7; +#endif + +#define CHECK_INT_TO_JUMP(CLK) \ + if (interrupt_chk__()) \ + { \ + cycles_needed=m68kcontext.io_cycle_counter-(CLK); \ + m68kcontext.io_cycle_counter= (CLK); \ + } + + +#ifdef FAMEC_CHECK_BRANCHES + +#ifdef FAMEC_NO_GOTOS +#define CHECK_BRANCH_EXCEPTION_GOTO_END m68kcontext.io_cycle_counter=0; return; +#else +#define CHECK_BRANCH_EXCEPTION_GOTO_END goto famec_Exec_End; +#endif + +#define CHECK_BRANCH_EXCEPTION(_PC_) \ + if ((_PC_)&1) \ + { \ + u32 pr_PC=GET_PC; \ + m68kcontext.execinfo |= M68K_EMULATE_GROUP_0; \ + execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \ + CHECK_BRANCH_EXCEPTION_GOTO_END \ + } +#else +#define CHECK_BRANCH_EXCEPTION(_PC_) +#endif + + +static void init_jump_table(void); + +/* Custom function handler */ +typedef void (*icust_handler_func)(u32 vector); + +// global variable +/////////////////// + +/* Current CPU context */ +M68K_CONTEXT *g_m68kcontext; +#define m68kcontext (*g_m68kcontext) + +/* static s32 io_cycle_counter; */ +static s32 cycles_needed=0; +static u16 *PC; +static u32 BasePC; +// static u32 Fetch[M68K_FETCHBANK]; + +/* Custom function handler */ +typedef void (*opcode_func)(void); + +static opcode_func JumpTable[0x10000]; + + +static u32 initialised = 0; + +// exception cycle table (taken from musashi core) +static const s32 exception_cycle_table[256] = +{ + 4, // 0: Reset - Initial Stack Pointer + 4, // 1: Reset - Initial Program Counter + 50, // 2: Bus Error + 50, // 3: Address Error + 34, // 4: Illegal Instruction + 38, // 5: Divide by Zero + 40, // 6: CHK + 34, // 7: TRAPV + 34, // 8: Privilege Violation + 34, // 9: Trace + 4, // 10: + 4, // 11: + 4, // 12: RESERVED + 4, // 13: Coprocessor Protocol Violation + 4, // 14: Format Error + 44, // 15: Uninitialized Interrupt + 4, // 16: RESERVED + 4, // 17: RESERVED + 4, // 18: RESERVED + 4, // 19: RESERVED + 4, // 20: RESERVED + 4, // 21: RESERVED + 4, // 22: RESERVED + 4, // 23: RESERVED + 44, // 24: Spurious Interrupt + 44, // 25: Level 1 Interrupt Autovector + 44, // 26: Level 2 Interrupt Autovector + 44, // 27: Level 3 Interrupt Autovector + 44, // 28: Level 4 Interrupt Autovector + 44, // 29: Level 5 Interrupt Autovector + 44, // 30: Level 6 Interrupt Autovector + 44, // 31: Level 7 Interrupt Autovector + 34, // 32: TRAP #0 + 34, // 33: TRAP #1 + 34, // 34: TRAP #2 + 34, // 35: TRAP #3 + 34, // 36: TRAP #4 + 34, // 37: TRAP #5 + 34, // 38: TRAP #6 + 34, // 39: TRAP #7 + 34, // 40: TRAP #8 + 34, // 41: TRAP #9 + 34, // 42: TRAP #10 + 34, // 43: TRAP #11 + 34, // 44: TRAP #12 + 34, // 45: TRAP #13 + 34, // 46: TRAP #14 + 34, // 47: TRAP #15 + 4, // 48: FP Branch or Set on Unknown Condition + 4, // 49: FP Inexact Result + 4, // 50: FP Divide by Zero + 4, // 51: FP Underflow + 4, // 52: FP Operand Error + 4, // 53: FP Overflow + 4, // 54: FP Signaling NAN + 4, // 55: FP Unimplemented Data Type + 4, // 56: MMU Configuration Error + 4, // 57: MMU Illegal Operation Error + 4, // 58: MMU Access Level Violation Error + 4, // 59: RESERVED + 4, // 60: RESERVED + 4, // 61: RESERVED + 4, // 62: RESERVED + 4, // 63: RESERVED + // 64-255: User Defined + 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, + 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, + 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, + 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, + 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, + 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 +}; + + +/********************/ +/* helper functions */ +/********************/ + + +#if 0 +static void famec_SetFetch(u32 low_adr, u32 high_adr, u32 fetch_adr) +{ + u32 i, j; + + i = (low_adr >> M68K_FETCHSFT) & M68K_FETCHMASK; + j = (high_adr >> M68K_FETCHSFT) & M68K_FETCHMASK; + + while (i <= j) + g_m68kcontext->Fetch[i++] = fetch_adr; +} + +static void famec_SetBanks(void) +{ + u32 i=0; + while(m68kcontext.fetch[i].low_addr != (u32)-1) + { + famec_SetFetch(m68kcontext.fetch[i].low_addr,m68kcontext.fetch[i].high_addr,m68kcontext.fetch[i].offset); + i++; + } +} +#endif + + +/***********************/ +/* core main functions */ +/***********************/ + +/***************************************************************************/ +/* m68k_init() */ +/* Debe ser llamado para inicializar la tabla de saltos de instruccion */ +/* No recibe parametros y no devuelve nada */ +/***************************************************************************/ +void m68k_init(void) +{ +#ifdef FAMEC_DEBUG + puts("Initializing FAME..."); +#endif + + if (!initialised) + m68k_emulate(0); + +#ifdef FAMEC_DEBUG + puts("FAME initialized."); +#endif +} + +/******************************************************************************/ +/* m68k_reset() */ +/* Parametros: Ninguno */ +/* Retorno: Exito de la operacion */ +/* M68K_OK (0): La funcion se ha ejecutado satisfactoriamente */ +/* M68K_RUNNING (1): No se puede resetear porque la CPU esta en ejecucion */ +/* M68K_NO_SUP_ADDR_SPACE (2): No se puede resetear porque no hay mapa */ +/* de memoria supervisor de extraccion de opcodes */ +/******************************************************************************/ +int m68k_reset(void) +{ + if (!initialised) + m68k_emulate(0); + + // Si la CPU esta en ejecucion, salir con M68K_RUNNING + if (m68kcontext.execinfo & M68K_RUNNING) + return M68K_RUNNING; + + // Resetear registros + memset(&m68kcontext.dreg[0], 0, 16*4); + + // Resetear interrupts, execinfo y ASP + m68kcontext.interrupts[0] = 0; + m68kcontext.execinfo = 0; + ASP = 0; + + // Fijar registro de estado + m68kcontext.sr = 0x2700; + + // Obtener puntero de pila inicial y PC + AREG(7) = m68kcontext.read_long(0); + m68kcontext.pc = m68kcontext.read_long(4); + +#ifdef FAMEC_DEBUG + puts("Reset 68k done!\n"); + printf("PC = 0x%08X\n",m68kcontext.pc); +#endif + + return M68K_OK; +} + + +/****************************************************************************/ +/* m68k_get_pc() */ +/* No recibe parametros */ +/* Retorna 68k PC */ +/****************************************************************************/ +u32 m68k_get_pc(M68K_CONTEXT *context) +{ + return (context->execinfo & M68K_RUNNING)?(u32)PC-BasePC:context->pc; +} + + +/***************************************************************************/ +/* m68k_get_register(register) */ +/* Parametro: Registro a obtener valor (indice) */ +/* Retorno: Valor del registro requerido */ +/* Observacion: En caso de que el indice no sea correcto */ +/* la funcion devolvera -1 */ +/***************************************************************************/ +u32 m68k_get_register(M68K_CONTEXT *context, m68k_register reg) +{ + M68K_CONTEXT *oldcontext = g_m68kcontext; + s32 ret; + + g_m68kcontext = context; + + switch (reg) + { + case M68K_REG_D0: + case M68K_REG_D1: + case M68K_REG_D2: + case M68K_REG_D3: + case M68K_REG_D4: + case M68K_REG_D5: + case M68K_REG_D6: + case M68K_REG_D7: + ret = DREG(reg - M68K_REG_D0); + break; + + case M68K_REG_A0: + case M68K_REG_A1: + case M68K_REG_A2: + case M68K_REG_A3: + case M68K_REG_A4: + case M68K_REG_A5: + case M68K_REG_A6: + case M68K_REG_A7: + ret = AREG(reg - M68K_REG_A0); + break; + + case M68K_REG_ASP: + ret = ASP; + break; + + case M68K_REG_PC: + ret = m68k_get_pc(context); + break; + + case M68K_REG_SR: + ret = m68kcontext.sr; + break; + + default: + ret = M68K_INV_REG; + break; + } + + g_m68kcontext = oldcontext; + return ret; +} + +/***********************************************************************/ +/* m68k_set_register(register,value) */ +/* Parametros: Registro (indice) y valor a asignar */ +/* Retorno: Exito de la operacion */ +/* 0 La operacion se ha realizado satisfactoriamente */ +/* 1 El indice del registro no es valido (fuera de limites) */ +/***********************************************************************/ +u32 m68k_set_register(M68K_CONTEXT *context, m68k_register reg, u32 value) +{ + M68K_CONTEXT *oldcontext = g_m68kcontext; + s32 ret = M68K_OK; + + g_m68kcontext = context; + + switch (reg) + { + case M68K_REG_D0: + case M68K_REG_D1: + case M68K_REG_D2: + case M68K_REG_D3: + case M68K_REG_D4: + case M68K_REG_D5: + case M68K_REG_D6: + case M68K_REG_D7: + DREG(reg - M68K_REG_D0) = value; + break; + + case M68K_REG_A0: + case M68K_REG_A1: + case M68K_REG_A2: + case M68K_REG_A3: + case M68K_REG_A4: + case M68K_REG_A5: + case M68K_REG_A6: + case M68K_REG_A7: + AREG(reg - M68K_REG_A0) = value; + break; + + case M68K_REG_ASP: + ASP = value; + break; + + case M68K_REG_PC: + if (m68kcontext.execinfo & M68K_RUNNING) + { + SET_PC(value & M68K_ADR_MASK); + } + else + { + m68kcontext.pc = value; + } + break; + + case M68K_REG_SR: + m68kcontext.sr = value & 0xFFFF; + break; + + default: + ret = M68K_INV_REG; + break; + } + + g_m68kcontext = oldcontext; + return ret; +} + + +////////////////////////// +// Chequea las interrupciones y las inicia +static FAMEC_EXTRA_INLINE s32 interrupt_chk__(void) +{ + if (m68kcontext.interrupts[0] > flag_I) + return m68kcontext.interrupts[0]; + + return 0; +} + + +static FAMEC_EXTRA_INLINE void execute_exception(s32 vect) +{ + extern u32 flag_S; +#ifndef FAMEC_IRQ_CYCLES + if ((vect<24)||(vect>31)) +#endif + m68kcontext.io_cycle_counter -= exception_cycle_table[vect]; + { + u32 newPC; + u32 oldPC; + u32 oldSR = GET_SR; + + PRE_IO + + READ_LONG_F(vect * 4, newPC) + + /* swap A7 and USP */ + if (!flag_S) + { + u32 tmpSP; + + tmpSP = ASP; + ASP = AREG(7); + AREG(7) = tmpSP; + } + + oldPC = (u32)(PC) - BasePC; + PUSH_32_F(oldPC) + PUSH_16_F(oldSR) + + /* adjust SR */ + flag_S = M68K_SR_S; + + newPC&=M68K_ADR_MASK; + + SET_PC(newPC) + + POST_IO + } +} + +static FAMEC_EXTRA_INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, s32 addr, u16 spec_info) +{ + execute_exception(vect); + //if (!(m68kcontext.icust_handler && m68kcontext.icust_handler[vect])) + { + PUSH_16_F(inst_reg); + PUSH_32_F(addr); + PUSH_16_F(spec_info); + } +} + + +static void setup_jumptable(void); +static u32 Opcode; + +#ifdef FAMEC_NO_GOTOS + +#define OPCODE(N_OP) static void OP_##N_OP(void) +#define CAST_OP(N_OP) (opcode_func)&OP_##N_OP +#include "famec_opcodes.h" +#endif + + +// main exec function +////////////////////// + +int m68k_emulate(s32 cycles) +{ + if (!initialised) + { + init_jump_table(); + return 0; + } + + /* Comprobar si la CPU esta detenida debido a un doble error de bus */ + if (m68kcontext.execinfo & M68K_FAULTED) return -1; + + if (m68kcontext.execinfo & M68K_HALTED) + { + if (interrupt_chk__() <= 0) + { + return cycles; + } + m68kcontext.execinfo &= ~M68K_HALTED; + } + +#ifdef FAMEC_DEBUG + printf("Ciclos a ejecutar: %d\n",cycles); +#endif + + /* Poner la CPU en estado de ejecucion */ + m68kcontext.execinfo |= M68K_RUNNING; + + // Cache SR + SET_SR(m68kcontext.sr) + + // Cache PPL + flag_I = M68K_PPL; + + // Fijar PC + SET_PC(m68kcontext.pc) + +#ifdef FAMEC_DEBUG + printf("PC: %p\n",PC); + printf("BasePC: 0x%08x\n",BasePC); +#endif + + /* guardar ciclos de ejecucion solicitados */ + m68kcontext.io_cycle_counter = cycles; + cycles_needed = 0; + +#ifdef FAMEC_EMULATE_TRACE + if (!(m68kcontext.execinfo & M68K_EMULATE_TRACE)) +#endif + { + s32 line=interrupt_chk__(); + if (line>0) + { + /* comprobar si hay rutina de acknowledge */ + if (m68kcontext.iack_handler != NULL) + m68kcontext.iack_handler(line); + else + m68kcontext.interrupts[0] = 0; + + execute_exception(line + 0x18); + flag_I = (u32)line; + } +#ifdef FAMEC_EMULATE_TRACE + else + if (flag_T) + { + m68kcontext.execinfo |= M68K_EMULATE_TRACE; + cycles_needed= m68kcontext.io_cycle_counter; + m68kcontext.io_cycle_counter=0; + } +#endif + } + + +#ifndef FAMEC_NO_GOTOS +famec_Exec: +#endif + +#ifdef FAMEC_DEBUG + printf("Antes de NEXT... PC = %p\n", PC); +#endif + + NEXT + +#ifndef FAMEC_NO_GOTOS + +#define OPCODE(N_OP) OP_##N_OP: +#define CAST_OP(N_OP) (opcode_func)&&OP_##N_OP +#include "famec_opcodes.h" + + famec_Exec_End: +#endif + +#ifdef FAMEC_EMULATE_TRACE + if (m68kcontext.execinfo & M68K_EMULATE_TRACE) + { + m68kcontext.io_cycle_counter= cycles_needed; + m68kcontext.execinfo &= ~M68K_EMULATE_TRACE; + m68kcontext.execinfo |= M68K_DO_TRACE; + execute_exception(M68K_TRACE_EX); + flag_T=0; + if (m68kcontext.io_cycle_counter > 0) + { + NEXT + } + } + else +#endif + if (cycles_needed>0) + { + s32 line=interrupt_chk__(); + m68kcontext.io_cycle_counter= cycles_needed; + if (line>0) + { + if (m68kcontext.iack_handler != NULL) + m68kcontext.iack_handler(line); + else + m68kcontext.interrupts[0] = 0; + + execute_exception(line + 0x18); + flag_I = (u32)line; + } +#ifdef FAMEC_EMULATE_TRACE + else if (!(flag_T)) +#endif + if (m68kcontext.io_cycle_counter > 0) + { + NEXT + } + } + + m68kcontext.sr = GET_SR; + m68kcontext.pc = GET_PC; + + m68kcontext.execinfo &= ~M68K_RUNNING; + +#ifdef FAMEC_DEBUG + printf("En really end...\n"); + printf("PC: %p\n",PC); + printf("BasePC: 0x%08x\n",BasePC); + printf("pc: 0x%08x\n",m68kcontext.pc); +#endif + + return cycles - m68kcontext.io_cycle_counter; +} + + + +static void init_jump_table(void) +{ + u32 i, j; + + for(i = 0x0000; i <= 0xFFFF; i += 0x0001) + JumpTable[0x0000 + i] = CAST_OP(0x4AFC); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0000 + i] = CAST_OP(0x0000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0010 + i] = CAST_OP(0x0010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0018 + i] = CAST_OP(0x0018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0020 + i] = CAST_OP(0x0020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0028 + i] = CAST_OP(0x0028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0030 + i] = CAST_OP(0x0030); + JumpTable[0x0038] = CAST_OP(0x0038); + JumpTable[0x0039] = CAST_OP(0x0039); + JumpTable[0x001F] = CAST_OP(0x001F); + JumpTable[0x0027] = CAST_OP(0x0027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0040 + i] = CAST_OP(0x0040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0050 + i] = CAST_OP(0x0050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0058 + i] = CAST_OP(0x0058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0060 + i] = CAST_OP(0x0060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0068 + i] = CAST_OP(0x0068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0070 + i] = CAST_OP(0x0070); + JumpTable[0x0078] = CAST_OP(0x0078); + JumpTable[0x0079] = CAST_OP(0x0079); + JumpTable[0x005F] = CAST_OP(0x005F); + JumpTable[0x0067] = CAST_OP(0x0067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0080 + i] = CAST_OP(0x0080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0090 + i] = CAST_OP(0x0090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0098 + i] = CAST_OP(0x0098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x00A0 + i] = CAST_OP(0x00A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00A8 + i] = CAST_OP(0x00A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00B0 + i] = CAST_OP(0x00B0); + JumpTable[0x00B8] = CAST_OP(0x00B8); + JumpTable[0x00B9] = CAST_OP(0x00B9); + JumpTable[0x009F] = CAST_OP(0x009F); + JumpTable[0x00A7] = CAST_OP(0x00A7); + JumpTable[0x003C] = CAST_OP(0x003C); + JumpTable[0x007C] = CAST_OP(0x007C); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0200 + i] = CAST_OP(0x0200); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0210 + i] = CAST_OP(0x0210); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0218 + i] = CAST_OP(0x0218); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0220 + i] = CAST_OP(0x0220); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0228 + i] = CAST_OP(0x0228); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0230 + i] = CAST_OP(0x0230); + JumpTable[0x0238] = CAST_OP(0x0238); + JumpTable[0x0239] = CAST_OP(0x0239); + JumpTable[0x021F] = CAST_OP(0x021F); + JumpTable[0x0227] = CAST_OP(0x0227); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0240 + i] = CAST_OP(0x0240); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0250 + i] = CAST_OP(0x0250); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0258 + i] = CAST_OP(0x0258); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0260 + i] = CAST_OP(0x0260); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0268 + i] = CAST_OP(0x0268); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0270 + i] = CAST_OP(0x0270); + JumpTable[0x0278] = CAST_OP(0x0278); + JumpTable[0x0279] = CAST_OP(0x0279); + JumpTable[0x025F] = CAST_OP(0x025F); + JumpTable[0x0267] = CAST_OP(0x0267); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0280 + i] = CAST_OP(0x0280); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0290 + i] = CAST_OP(0x0290); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0298 + i] = CAST_OP(0x0298); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x02A0 + i] = CAST_OP(0x02A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02A8 + i] = CAST_OP(0x02A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02B0 + i] = CAST_OP(0x02B0); + JumpTable[0x02B8] = CAST_OP(0x02B8); + JumpTable[0x02B9] = CAST_OP(0x02B9); + JumpTable[0x029F] = CAST_OP(0x029F); + JumpTable[0x02A7] = CAST_OP(0x02A7); + JumpTable[0x023C] = CAST_OP(0x023C); + JumpTable[0x027C] = CAST_OP(0x027C); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A00 + i] = CAST_OP(0x0A00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A10 + i] = CAST_OP(0x0A10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A18 + i] = CAST_OP(0x0A18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A20 + i] = CAST_OP(0x0A20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A28 + i] = CAST_OP(0x0A28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A30 + i] = CAST_OP(0x0A30); + JumpTable[0x0A38] = CAST_OP(0x0A38); + JumpTable[0x0A39] = CAST_OP(0x0A39); + JumpTable[0x0A1F] = CAST_OP(0x0A1F); + JumpTable[0x0A27] = CAST_OP(0x0A27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A40 + i] = CAST_OP(0x0A40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A50 + i] = CAST_OP(0x0A50); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A58 + i] = CAST_OP(0x0A58); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A60 + i] = CAST_OP(0x0A60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A68 + i] = CAST_OP(0x0A68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A70 + i] = CAST_OP(0x0A70); + JumpTable[0x0A78] = CAST_OP(0x0A78); + JumpTable[0x0A79] = CAST_OP(0x0A79); + JumpTable[0x0A5F] = CAST_OP(0x0A5F); + JumpTable[0x0A67] = CAST_OP(0x0A67); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A80 + i] = CAST_OP(0x0A80); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A90 + i] = CAST_OP(0x0A90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A98 + i] = CAST_OP(0x0A98); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0AA0 + i] = CAST_OP(0x0AA0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AA8 + i] = CAST_OP(0x0AA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AB0 + i] = CAST_OP(0x0AB0); + JumpTable[0x0AB8] = CAST_OP(0x0AB8); + JumpTable[0x0AB9] = CAST_OP(0x0AB9); + JumpTable[0x0A9F] = CAST_OP(0x0A9F); + JumpTable[0x0AA7] = CAST_OP(0x0AA7); + JumpTable[0x0A3C] = CAST_OP(0x0A3C); + JumpTable[0x0A7C] = CAST_OP(0x0A7C); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0400 + i] = CAST_OP(0x0400); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0410 + i] = CAST_OP(0x0410); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0418 + i] = CAST_OP(0x0418); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0420 + i] = CAST_OP(0x0420); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0428 + i] = CAST_OP(0x0428); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0430 + i] = CAST_OP(0x0430); + JumpTable[0x0438] = CAST_OP(0x0438); + JumpTable[0x0439] = CAST_OP(0x0439); + JumpTable[0x041F] = CAST_OP(0x041F); + JumpTable[0x0427] = CAST_OP(0x0427); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0440 + i] = CAST_OP(0x0440); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0450 + i] = CAST_OP(0x0450); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0458 + i] = CAST_OP(0x0458); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0460 + i] = CAST_OP(0x0460); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0468 + i] = CAST_OP(0x0468); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0470 + i] = CAST_OP(0x0470); + JumpTable[0x0478] = CAST_OP(0x0478); + JumpTable[0x0479] = CAST_OP(0x0479); + JumpTable[0x045F] = CAST_OP(0x045F); + JumpTable[0x0467] = CAST_OP(0x0467); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0480 + i] = CAST_OP(0x0480); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0490 + i] = CAST_OP(0x0490); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0498 + i] = CAST_OP(0x0498); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x04A0 + i] = CAST_OP(0x04A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04A8 + i] = CAST_OP(0x04A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04B0 + i] = CAST_OP(0x04B0); + JumpTable[0x04B8] = CAST_OP(0x04B8); + JumpTable[0x04B9] = CAST_OP(0x04B9); + JumpTable[0x049F] = CAST_OP(0x049F); + JumpTable[0x04A7] = CAST_OP(0x04A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0600 + i] = CAST_OP(0x0600); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0610 + i] = CAST_OP(0x0610); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0618 + i] = CAST_OP(0x0618); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0620 + i] = CAST_OP(0x0620); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0628 + i] = CAST_OP(0x0628); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0630 + i] = CAST_OP(0x0630); + JumpTable[0x0638] = CAST_OP(0x0638); + JumpTable[0x0639] = CAST_OP(0x0639); + JumpTable[0x061F] = CAST_OP(0x061F); + JumpTable[0x0627] = CAST_OP(0x0627); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0640 + i] = CAST_OP(0x0640); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0650 + i] = CAST_OP(0x0650); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0658 + i] = CAST_OP(0x0658); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0660 + i] = CAST_OP(0x0660); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0668 + i] = CAST_OP(0x0668); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0670 + i] = CAST_OP(0x0670); + JumpTable[0x0678] = CAST_OP(0x0678); + JumpTable[0x0679] = CAST_OP(0x0679); + JumpTable[0x065F] = CAST_OP(0x065F); + JumpTable[0x0667] = CAST_OP(0x0667); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0680 + i] = CAST_OP(0x0680); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0690 + i] = CAST_OP(0x0690); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0698 + i] = CAST_OP(0x0698); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x06A0 + i] = CAST_OP(0x06A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x06A8 + i] = CAST_OP(0x06A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x06B0 + i] = CAST_OP(0x06B0); + JumpTable[0x06B8] = CAST_OP(0x06B8); + JumpTable[0x06B9] = CAST_OP(0x06B9); + JumpTable[0x069F] = CAST_OP(0x069F); + JumpTable[0x06A7] = CAST_OP(0x06A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C00 + i] = CAST_OP(0x0C00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C10 + i] = CAST_OP(0x0C10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C18 + i] = CAST_OP(0x0C18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C20 + i] = CAST_OP(0x0C20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C28 + i] = CAST_OP(0x0C28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C30 + i] = CAST_OP(0x0C30); + JumpTable[0x0C38] = CAST_OP(0x0C38); + JumpTable[0x0C39] = CAST_OP(0x0C39); + JumpTable[0x0C1F] = CAST_OP(0x0C1F); + JumpTable[0x0C27] = CAST_OP(0x0C27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C40 + i] = CAST_OP(0x0C40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C50 + i] = CAST_OP(0x0C50); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C58 + i] = CAST_OP(0x0C58); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C60 + i] = CAST_OP(0x0C60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C68 + i] = CAST_OP(0x0C68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C70 + i] = CAST_OP(0x0C70); + JumpTable[0x0C78] = CAST_OP(0x0C78); + JumpTable[0x0C79] = CAST_OP(0x0C79); + JumpTable[0x0C5F] = CAST_OP(0x0C5F); + JumpTable[0x0C67] = CAST_OP(0x0C67); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C80 + i] = CAST_OP(0x0C80); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C90 + i] = CAST_OP(0x0C90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C98 + i] = CAST_OP(0x0C98); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0CA0 + i] = CAST_OP(0x0CA0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CA8 + i] = CAST_OP(0x0CA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CB0 + i] = CAST_OP(0x0CB0); + JumpTable[0x0CB8] = CAST_OP(0x0CB8); + JumpTable[0x0CB9] = CAST_OP(0x0CB9); + JumpTable[0x0C9F] = CAST_OP(0x0C9F); + JumpTable[0x0CA7] = CAST_OP(0x0CA7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0800 + i] = CAST_OP(0x0800); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0810 + i] = CAST_OP(0x0810); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0818 + i] = CAST_OP(0x0818); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0820 + i] = CAST_OP(0x0820); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0828 + i] = CAST_OP(0x0828); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0830 + i] = CAST_OP(0x0830); + JumpTable[0x0838] = CAST_OP(0x0838); + JumpTable[0x0839] = CAST_OP(0x0839); + JumpTable[0x083A] = CAST_OP(0x083A); + JumpTable[0x083B] = CAST_OP(0x083B); + JumpTable[0x081F] = CAST_OP(0x081F); + JumpTable[0x0827] = CAST_OP(0x0827); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0840 + i] = CAST_OP(0x0840); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0850 + i] = CAST_OP(0x0850); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0858 + i] = CAST_OP(0x0858); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0860 + i] = CAST_OP(0x0860); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0868 + i] = CAST_OP(0x0868); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0870 + i] = CAST_OP(0x0870); + JumpTable[0x0878] = CAST_OP(0x0878); + JumpTable[0x0879] = CAST_OP(0x0879); + JumpTable[0x085F] = CAST_OP(0x085F); + JumpTable[0x0867] = CAST_OP(0x0867); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0880 + i] = CAST_OP(0x0880); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0890 + i] = CAST_OP(0x0890); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0898 + i] = CAST_OP(0x0898); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x08A0 + i] = CAST_OP(0x08A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08A8 + i] = CAST_OP(0x08A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08B0 + i] = CAST_OP(0x08B0); + JumpTable[0x08B8] = CAST_OP(0x08B8); + JumpTable[0x08B9] = CAST_OP(0x08B9); + JumpTable[0x089F] = CAST_OP(0x089F); + JumpTable[0x08A7] = CAST_OP(0x08A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08C0 + i] = CAST_OP(0x08C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08D0 + i] = CAST_OP(0x08D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x08D8 + i] = CAST_OP(0x08D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x08E0 + i] = CAST_OP(0x08E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08E8 + i] = CAST_OP(0x08E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08F0 + i] = CAST_OP(0x08F0); + JumpTable[0x08F8] = CAST_OP(0x08F8); + JumpTable[0x08F9] = CAST_OP(0x08F9); + JumpTable[0x08DF] = CAST_OP(0x08DF); + JumpTable[0x08E7] = CAST_OP(0x08E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0100 + i + j] = CAST_OP(0x0100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0110 + i + j] = CAST_OP(0x0110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0118 + i + j] = CAST_OP(0x0118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0120 + i + j] = CAST_OP(0x0120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0128 + i + j] = CAST_OP(0x0128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0130 + i + j] = CAST_OP(0x0130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0138 + i] = CAST_OP(0x0138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0139 + i] = CAST_OP(0x0139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x013A + i] = CAST_OP(0x013A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x013B + i] = CAST_OP(0x013B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x013C + i] = CAST_OP(0x013C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x011F + i] = CAST_OP(0x011F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0127 + i] = CAST_OP(0x0127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0140 + i + j] = CAST_OP(0x0140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0150 + i + j] = CAST_OP(0x0150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0158 + i + j] = CAST_OP(0x0158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0160 + i + j] = CAST_OP(0x0160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0168 + i + j] = CAST_OP(0x0168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0170 + i + j] = CAST_OP(0x0170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0178 + i] = CAST_OP(0x0178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0179 + i] = CAST_OP(0x0179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x015F + i] = CAST_OP(0x015F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0167 + i] = CAST_OP(0x0167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0180 + i + j] = CAST_OP(0x0180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0190 + i + j] = CAST_OP(0x0190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0198 + i + j] = CAST_OP(0x0198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01A0 + i + j] = CAST_OP(0x01A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01A8 + i + j] = CAST_OP(0x01A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01B0 + i + j] = CAST_OP(0x01B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01B8 + i] = CAST_OP(0x01B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01B9 + i] = CAST_OP(0x01B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x019F + i] = CAST_OP(0x019F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01A7 + i] = CAST_OP(0x01A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01C0 + i + j] = CAST_OP(0x01C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01D0 + i + j] = CAST_OP(0x01D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01D8 + i + j] = CAST_OP(0x01D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01E0 + i + j] = CAST_OP(0x01E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01E8 + i + j] = CAST_OP(0x01E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01F0 + i + j] = CAST_OP(0x01F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01F8 + i] = CAST_OP(0x01F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01F9 + i] = CAST_OP(0x01F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01DF + i] = CAST_OP(0x01DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01E7 + i] = CAST_OP(0x01E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0108 + i + j] = CAST_OP(0x0108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0148 + i + j] = CAST_OP(0x0148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0188 + i + j] = CAST_OP(0x0188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01C8 + i + j] = CAST_OP(0x01C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1000 + i + j] = CAST_OP(0x1000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1080 + i + j] = CAST_OP(0x1080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10C0 + i + j] = CAST_OP(0x10C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1100 + i + j] = CAST_OP(0x1100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1140 + i + j] = CAST_OP(0x1140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1180 + i + j] = CAST_OP(0x1180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11C0 + i] = CAST_OP(0x11C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13C0 + i] = CAST_OP(0x13C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EC0 + i] = CAST_OP(0x1EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F00 + i] = CAST_OP(0x1F00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1008 + i + j] = CAST_OP(0x1008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1088 + i + j] = CAST_OP(0x1088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10C8 + i + j] = CAST_OP(0x10C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1108 + i + j] = CAST_OP(0x1108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1148 + i + j] = CAST_OP(0x1148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1188 + i + j] = CAST_OP(0x1188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11C8 + i] = CAST_OP(0x11C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13C8 + i] = CAST_OP(0x13C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EC8 + i] = CAST_OP(0x1EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F08 + i] = CAST_OP(0x1F08); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1010 + i + j] = CAST_OP(0x1010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1090 + i + j] = CAST_OP(0x1090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10D0 + i + j] = CAST_OP(0x10D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1110 + i + j] = CAST_OP(0x1110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1150 + i + j] = CAST_OP(0x1150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1190 + i + j] = CAST_OP(0x1190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11D0 + i] = CAST_OP(0x11D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13D0 + i] = CAST_OP(0x13D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1ED0 + i] = CAST_OP(0x1ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F10 + i] = CAST_OP(0x1F10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1018 + i + j] = CAST_OP(0x1018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1098 + i + j] = CAST_OP(0x1098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10D8 + i + j] = CAST_OP(0x10D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1118 + i + j] = CAST_OP(0x1118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1158 + i + j] = CAST_OP(0x1158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1198 + i + j] = CAST_OP(0x1198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x11D8 + i] = CAST_OP(0x11D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x13D8 + i] = CAST_OP(0x13D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1ED8 + i] = CAST_OP(0x1ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1F18 + i] = CAST_OP(0x1F18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1020 + i + j] = CAST_OP(0x1020); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x10A0 + i + j] = CAST_OP(0x10A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10E0 + i + j] = CAST_OP(0x10E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1120 + i + j] = CAST_OP(0x1120); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1160 + i + j] = CAST_OP(0x1160); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x11A0 + i + j] = CAST_OP(0x11A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x11E0 + i] = CAST_OP(0x11E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x13E0 + i] = CAST_OP(0x13E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1EE0 + i] = CAST_OP(0x1EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1F20 + i] = CAST_OP(0x1F20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1028 + i + j] = CAST_OP(0x1028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x10A8 + i + j] = CAST_OP(0x10A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10E8 + i + j] = CAST_OP(0x10E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1128 + i + j] = CAST_OP(0x1128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1168 + i + j] = CAST_OP(0x1168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x11A8 + i + j] = CAST_OP(0x11A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11E8 + i] = CAST_OP(0x11E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13E8 + i] = CAST_OP(0x13E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EE8 + i] = CAST_OP(0x1EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F28 + i] = CAST_OP(0x1F28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1030 + i + j] = CAST_OP(0x1030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x10B0 + i + j] = CAST_OP(0x10B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10F0 + i + j] = CAST_OP(0x10F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1130 + i + j] = CAST_OP(0x1130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1170 + i + j] = CAST_OP(0x1170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x11B0 + i + j] = CAST_OP(0x11B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11F0 + i] = CAST_OP(0x11F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13F0 + i] = CAST_OP(0x13F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EF0 + i] = CAST_OP(0x1EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F30 + i] = CAST_OP(0x1F30); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1038 + i] = CAST_OP(0x1038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10B8 + i] = CAST_OP(0x10B8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10F8 + i] = CAST_OP(0x10F8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x1138 + i] = CAST_OP(0x1138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1178 + i] = CAST_OP(0x1178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11B8 + i] = CAST_OP(0x11B8); + JumpTable[0x11F8] = CAST_OP(0x11F8); + JumpTable[0x13F8] = CAST_OP(0x13F8); + JumpTable[0x1EF8] = CAST_OP(0x1EF8); + JumpTable[0x1F38] = CAST_OP(0x1F38); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1039 + i] = CAST_OP(0x1039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10B9 + i] = CAST_OP(0x10B9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10F9 + i] = CAST_OP(0x10F9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x1139 + i] = CAST_OP(0x1139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1179 + i] = CAST_OP(0x1179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11B9 + i] = CAST_OP(0x11B9); + JumpTable[0x11F9] = CAST_OP(0x11F9); + JumpTable[0x13F9] = CAST_OP(0x13F9); + JumpTable[0x1EF9] = CAST_OP(0x1EF9); + JumpTable[0x1F39] = CAST_OP(0x1F39); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x103A + i] = CAST_OP(0x103A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10BA + i] = CAST_OP(0x10BA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10FA + i] = CAST_OP(0x10FA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x113A + i] = CAST_OP(0x113A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x117A + i] = CAST_OP(0x117A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11BA + i] = CAST_OP(0x11BA); + JumpTable[0x11FA] = CAST_OP(0x11FA); + JumpTable[0x13FA] = CAST_OP(0x13FA); + JumpTable[0x1EFA] = CAST_OP(0x1EFA); + JumpTable[0x1F3A] = CAST_OP(0x1F3A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x103B + i] = CAST_OP(0x103B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10BB + i] = CAST_OP(0x10BB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10FB + i] = CAST_OP(0x10FB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x113B + i] = CAST_OP(0x113B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x117B + i] = CAST_OP(0x117B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11BB + i] = CAST_OP(0x11BB); + JumpTable[0x11FB] = CAST_OP(0x11FB); + JumpTable[0x13FB] = CAST_OP(0x13FB); + JumpTable[0x1EFB] = CAST_OP(0x1EFB); + JumpTable[0x1F3B] = CAST_OP(0x1F3B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x103C + i] = CAST_OP(0x103C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10BC + i] = CAST_OP(0x10BC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10FC + i] = CAST_OP(0x10FC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x113C + i] = CAST_OP(0x113C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x117C + i] = CAST_OP(0x117C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11BC + i] = CAST_OP(0x11BC); + JumpTable[0x11FC] = CAST_OP(0x11FC); + JumpTable[0x13FC] = CAST_OP(0x13FC); + JumpTable[0x1EFC] = CAST_OP(0x1EFC); + JumpTable[0x1F3C] = CAST_OP(0x1F3C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x101F + i] = CAST_OP(0x101F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x109F + i] = CAST_OP(0x109F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10DF + i] = CAST_OP(0x10DF); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x111F + i] = CAST_OP(0x111F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x115F + i] = CAST_OP(0x115F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x119F + i] = CAST_OP(0x119F); + JumpTable[0x11DF] = CAST_OP(0x11DF); + JumpTable[0x13DF] = CAST_OP(0x13DF); + JumpTable[0x1EDF] = CAST_OP(0x1EDF); + JumpTable[0x1F1F] = CAST_OP(0x1F1F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1027 + i] = CAST_OP(0x1027); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10A7 + i] = CAST_OP(0x10A7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10E7 + i] = CAST_OP(0x10E7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x1127 + i] = CAST_OP(0x1127); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1167 + i] = CAST_OP(0x1167); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11A7 + i] = CAST_OP(0x11A7); + JumpTable[0x11E7] = CAST_OP(0x11E7); + JumpTable[0x13E7] = CAST_OP(0x13E7); + JumpTable[0x1EE7] = CAST_OP(0x1EE7); + JumpTable[0x1F27] = CAST_OP(0x1F27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2000 + i + j] = CAST_OP(0x2000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2080 + i + j] = CAST_OP(0x2080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20C0 + i + j] = CAST_OP(0x20C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2100 + i + j] = CAST_OP(0x2100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2140 + i + j] = CAST_OP(0x2140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2180 + i + j] = CAST_OP(0x2180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21C0 + i] = CAST_OP(0x21C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23C0 + i] = CAST_OP(0x23C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EC0 + i] = CAST_OP(0x2EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F00 + i] = CAST_OP(0x2F00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2008 + i + j] = CAST_OP(0x2008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2088 + i + j] = CAST_OP(0x2088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20C8 + i + j] = CAST_OP(0x20C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2108 + i + j] = CAST_OP(0x2108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2148 + i + j] = CAST_OP(0x2148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2188 + i + j] = CAST_OP(0x2188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21C8 + i] = CAST_OP(0x21C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23C8 + i] = CAST_OP(0x23C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EC8 + i] = CAST_OP(0x2EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F08 + i] = CAST_OP(0x2F08); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2010 + i + j] = CAST_OP(0x2010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2090 + i + j] = CAST_OP(0x2090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20D0 + i + j] = CAST_OP(0x20D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2110 + i + j] = CAST_OP(0x2110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2150 + i + j] = CAST_OP(0x2150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2190 + i + j] = CAST_OP(0x2190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21D0 + i] = CAST_OP(0x21D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23D0 + i] = CAST_OP(0x23D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2ED0 + i] = CAST_OP(0x2ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F10 + i] = CAST_OP(0x2F10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2018 + i + j] = CAST_OP(0x2018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2098 + i + j] = CAST_OP(0x2098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20D8 + i + j] = CAST_OP(0x20D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2118 + i + j] = CAST_OP(0x2118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2158 + i + j] = CAST_OP(0x2158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2198 + i + j] = CAST_OP(0x2198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x21D8 + i] = CAST_OP(0x21D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x23D8 + i] = CAST_OP(0x23D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2ED8 + i] = CAST_OP(0x2ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2F18 + i] = CAST_OP(0x2F18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2020 + i + j] = CAST_OP(0x2020); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x20A0 + i + j] = CAST_OP(0x20A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20E0 + i + j] = CAST_OP(0x20E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2120 + i + j] = CAST_OP(0x2120); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2160 + i + j] = CAST_OP(0x2160); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x21A0 + i + j] = CAST_OP(0x21A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x21E0 + i] = CAST_OP(0x21E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x23E0 + i] = CAST_OP(0x23E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2EE0 + i] = CAST_OP(0x2EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2F20 + i] = CAST_OP(0x2F20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2028 + i + j] = CAST_OP(0x2028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x20A8 + i + j] = CAST_OP(0x20A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20E8 + i + j] = CAST_OP(0x20E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2128 + i + j] = CAST_OP(0x2128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2168 + i + j] = CAST_OP(0x2168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x21A8 + i + j] = CAST_OP(0x21A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21E8 + i] = CAST_OP(0x21E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23E8 + i] = CAST_OP(0x23E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EE8 + i] = CAST_OP(0x2EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F28 + i] = CAST_OP(0x2F28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2030 + i + j] = CAST_OP(0x2030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x20B0 + i + j] = CAST_OP(0x20B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20F0 + i + j] = CAST_OP(0x20F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2130 + i + j] = CAST_OP(0x2130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2170 + i + j] = CAST_OP(0x2170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x21B0 + i + j] = CAST_OP(0x21B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21F0 + i] = CAST_OP(0x21F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23F0 + i] = CAST_OP(0x23F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EF0 + i] = CAST_OP(0x2EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F30 + i] = CAST_OP(0x2F30); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2038 + i] = CAST_OP(0x2038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20B8 + i] = CAST_OP(0x20B8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20F8 + i] = CAST_OP(0x20F8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x2138 + i] = CAST_OP(0x2138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2178 + i] = CAST_OP(0x2178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21B8 + i] = CAST_OP(0x21B8); + JumpTable[0x21F8] = CAST_OP(0x21F8); + JumpTable[0x23F8] = CAST_OP(0x23F8); + JumpTable[0x2EF8] = CAST_OP(0x2EF8); + JumpTable[0x2F38] = CAST_OP(0x2F38); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2039 + i] = CAST_OP(0x2039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20B9 + i] = CAST_OP(0x20B9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20F9 + i] = CAST_OP(0x20F9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x2139 + i] = CAST_OP(0x2139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2179 + i] = CAST_OP(0x2179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21B9 + i] = CAST_OP(0x21B9); + JumpTable[0x21F9] = CAST_OP(0x21F9); + JumpTable[0x23F9] = CAST_OP(0x23F9); + JumpTable[0x2EF9] = CAST_OP(0x2EF9); + JumpTable[0x2F39] = CAST_OP(0x2F39); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x203A + i] = CAST_OP(0x203A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20BA + i] = CAST_OP(0x20BA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20FA + i] = CAST_OP(0x20FA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x213A + i] = CAST_OP(0x213A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x217A + i] = CAST_OP(0x217A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21BA + i] = CAST_OP(0x21BA); + JumpTable[0x21FA] = CAST_OP(0x21FA); + JumpTable[0x23FA] = CAST_OP(0x23FA); + JumpTable[0x2EFA] = CAST_OP(0x2EFA); + JumpTable[0x2F3A] = CAST_OP(0x2F3A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x203B + i] = CAST_OP(0x203B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20BB + i] = CAST_OP(0x20BB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20FB + i] = CAST_OP(0x20FB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x213B + i] = CAST_OP(0x213B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x217B + i] = CAST_OP(0x217B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21BB + i] = CAST_OP(0x21BB); + JumpTable[0x21FB] = CAST_OP(0x21FB); + JumpTable[0x23FB] = CAST_OP(0x23FB); + JumpTable[0x2EFB] = CAST_OP(0x2EFB); + JumpTable[0x2F3B] = CAST_OP(0x2F3B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x203C + i] = CAST_OP(0x203C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20BC + i] = CAST_OP(0x20BC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20FC + i] = CAST_OP(0x20FC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x213C + i] = CAST_OP(0x213C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x217C + i] = CAST_OP(0x217C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21BC + i] = CAST_OP(0x21BC); + JumpTable[0x21FC] = CAST_OP(0x21FC); + JumpTable[0x23FC] = CAST_OP(0x23FC); + JumpTable[0x2EFC] = CAST_OP(0x2EFC); + JumpTable[0x2F3C] = CAST_OP(0x2F3C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x201F + i] = CAST_OP(0x201F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x209F + i] = CAST_OP(0x209F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20DF + i] = CAST_OP(0x20DF); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x211F + i] = CAST_OP(0x211F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x215F + i] = CAST_OP(0x215F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x219F + i] = CAST_OP(0x219F); + JumpTable[0x21DF] = CAST_OP(0x21DF); + JumpTable[0x23DF] = CAST_OP(0x23DF); + JumpTable[0x2EDF] = CAST_OP(0x2EDF); + JumpTable[0x2F1F] = CAST_OP(0x2F1F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2027 + i] = CAST_OP(0x2027); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20A7 + i] = CAST_OP(0x20A7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20E7 + i] = CAST_OP(0x20E7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x2127 + i] = CAST_OP(0x2127); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2167 + i] = CAST_OP(0x2167); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21A7 + i] = CAST_OP(0x21A7); + JumpTable[0x21E7] = CAST_OP(0x21E7); + JumpTable[0x23E7] = CAST_OP(0x23E7); + JumpTable[0x2EE7] = CAST_OP(0x2EE7); + JumpTable[0x2F27] = CAST_OP(0x2F27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3000 + i + j] = CAST_OP(0x3000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3080 + i + j] = CAST_OP(0x3080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30C0 + i + j] = CAST_OP(0x30C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3100 + i + j] = CAST_OP(0x3100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3140 + i + j] = CAST_OP(0x3140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3180 + i + j] = CAST_OP(0x3180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31C0 + i] = CAST_OP(0x31C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33C0 + i] = CAST_OP(0x33C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EC0 + i] = CAST_OP(0x3EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F00 + i] = CAST_OP(0x3F00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3008 + i + j] = CAST_OP(0x3008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3088 + i + j] = CAST_OP(0x3088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30C8 + i + j] = CAST_OP(0x30C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3108 + i + j] = CAST_OP(0x3108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3148 + i + j] = CAST_OP(0x3148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3188 + i + j] = CAST_OP(0x3188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31C8 + i] = CAST_OP(0x31C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33C8 + i] = CAST_OP(0x33C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EC8 + i] = CAST_OP(0x3EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F08 + i] = CAST_OP(0x3F08); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3010 + i + j] = CAST_OP(0x3010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3090 + i + j] = CAST_OP(0x3090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30D0 + i + j] = CAST_OP(0x30D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3110 + i + j] = CAST_OP(0x3110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3150 + i + j] = CAST_OP(0x3150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3190 + i + j] = CAST_OP(0x3190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31D0 + i] = CAST_OP(0x31D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33D0 + i] = CAST_OP(0x33D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3ED0 + i] = CAST_OP(0x3ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F10 + i] = CAST_OP(0x3F10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3018 + i + j] = CAST_OP(0x3018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3098 + i + j] = CAST_OP(0x3098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30D8 + i + j] = CAST_OP(0x30D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3118 + i + j] = CAST_OP(0x3118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3158 + i + j] = CAST_OP(0x3158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3198 + i + j] = CAST_OP(0x3198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x31D8 + i] = CAST_OP(0x31D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x33D8 + i] = CAST_OP(0x33D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3ED8 + i] = CAST_OP(0x3ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3F18 + i] = CAST_OP(0x3F18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3020 + i + j] = CAST_OP(0x3020); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x30A0 + i + j] = CAST_OP(0x30A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30E0 + i + j] = CAST_OP(0x30E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3120 + i + j] = CAST_OP(0x3120); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3160 + i + j] = CAST_OP(0x3160); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x31A0 + i + j] = CAST_OP(0x31A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x31E0 + i] = CAST_OP(0x31E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x33E0 + i] = CAST_OP(0x33E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3EE0 + i] = CAST_OP(0x3EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3F20 + i] = CAST_OP(0x3F20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3028 + i + j] = CAST_OP(0x3028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x30A8 + i + j] = CAST_OP(0x30A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30E8 + i + j] = CAST_OP(0x30E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3128 + i + j] = CAST_OP(0x3128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3168 + i + j] = CAST_OP(0x3168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x31A8 + i + j] = CAST_OP(0x31A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31E8 + i] = CAST_OP(0x31E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33E8 + i] = CAST_OP(0x33E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EE8 + i] = CAST_OP(0x3EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F28 + i] = CAST_OP(0x3F28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3030 + i + j] = CAST_OP(0x3030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x30B0 + i + j] = CAST_OP(0x30B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30F0 + i + j] = CAST_OP(0x30F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3130 + i + j] = CAST_OP(0x3130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3170 + i + j] = CAST_OP(0x3170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x31B0 + i + j] = CAST_OP(0x31B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31F0 + i] = CAST_OP(0x31F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33F0 + i] = CAST_OP(0x33F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EF0 + i] = CAST_OP(0x3EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F30 + i] = CAST_OP(0x3F30); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3038 + i] = CAST_OP(0x3038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30B8 + i] = CAST_OP(0x30B8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30F8 + i] = CAST_OP(0x30F8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x3138 + i] = CAST_OP(0x3138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3178 + i] = CAST_OP(0x3178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31B8 + i] = CAST_OP(0x31B8); + JumpTable[0x31F8] = CAST_OP(0x31F8); + JumpTable[0x33F8] = CAST_OP(0x33F8); + JumpTable[0x3EF8] = CAST_OP(0x3EF8); + JumpTable[0x3F38] = CAST_OP(0x3F38); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3039 + i] = CAST_OP(0x3039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30B9 + i] = CAST_OP(0x30B9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30F9 + i] = CAST_OP(0x30F9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x3139 + i] = CAST_OP(0x3139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3179 + i] = CAST_OP(0x3179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31B9 + i] = CAST_OP(0x31B9); + JumpTable[0x31F9] = CAST_OP(0x31F9); + JumpTable[0x33F9] = CAST_OP(0x33F9); + JumpTable[0x3EF9] = CAST_OP(0x3EF9); + JumpTable[0x3F39] = CAST_OP(0x3F39); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x303A + i] = CAST_OP(0x303A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30BA + i] = CAST_OP(0x30BA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30FA + i] = CAST_OP(0x30FA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x313A + i] = CAST_OP(0x313A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x317A + i] = CAST_OP(0x317A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31BA + i] = CAST_OP(0x31BA); + JumpTable[0x31FA] = CAST_OP(0x31FA); + JumpTable[0x33FA] = CAST_OP(0x33FA); + JumpTable[0x3EFA] = CAST_OP(0x3EFA); + JumpTable[0x3F3A] = CAST_OP(0x3F3A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x303B + i] = CAST_OP(0x303B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30BB + i] = CAST_OP(0x30BB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30FB + i] = CAST_OP(0x30FB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x313B + i] = CAST_OP(0x313B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x317B + i] = CAST_OP(0x317B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31BB + i] = CAST_OP(0x31BB); + JumpTable[0x31FB] = CAST_OP(0x31FB); + JumpTable[0x33FB] = CAST_OP(0x33FB); + JumpTable[0x3EFB] = CAST_OP(0x3EFB); + JumpTable[0x3F3B] = CAST_OP(0x3F3B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x303C + i] = CAST_OP(0x303C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30BC + i] = CAST_OP(0x30BC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30FC + i] = CAST_OP(0x30FC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x313C + i] = CAST_OP(0x313C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x317C + i] = CAST_OP(0x317C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31BC + i] = CAST_OP(0x31BC); + JumpTable[0x31FC] = CAST_OP(0x31FC); + JumpTable[0x33FC] = CAST_OP(0x33FC); + JumpTable[0x3EFC] = CAST_OP(0x3EFC); + JumpTable[0x3F3C] = CAST_OP(0x3F3C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x301F + i] = CAST_OP(0x301F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x309F + i] = CAST_OP(0x309F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30DF + i] = CAST_OP(0x30DF); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x311F + i] = CAST_OP(0x311F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x315F + i] = CAST_OP(0x315F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x319F + i] = CAST_OP(0x319F); + JumpTable[0x31DF] = CAST_OP(0x31DF); + JumpTable[0x33DF] = CAST_OP(0x33DF); + JumpTable[0x3EDF] = CAST_OP(0x3EDF); + JumpTable[0x3F1F] = CAST_OP(0x3F1F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3027 + i] = CAST_OP(0x3027); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30A7 + i] = CAST_OP(0x30A7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30E7 + i] = CAST_OP(0x30E7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x3127 + i] = CAST_OP(0x3127); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3167 + i] = CAST_OP(0x3167); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31A7 + i] = CAST_OP(0x31A7); + JumpTable[0x31E7] = CAST_OP(0x31E7); + JumpTable[0x33E7] = CAST_OP(0x33E7); + JumpTable[0x3EE7] = CAST_OP(0x3EE7); + JumpTable[0x3F27] = CAST_OP(0x3F27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2040 + i + j] = CAST_OP(0x2040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2048 + i + j] = CAST_OP(0x2048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2050 + i + j] = CAST_OP(0x2050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2058 + i + j] = CAST_OP(0x2058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2060 + i + j] = CAST_OP(0x2060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2068 + i + j] = CAST_OP(0x2068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2070 + i + j] = CAST_OP(0x2070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2078 + i] = CAST_OP(0x2078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2079 + i] = CAST_OP(0x2079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x207A + i] = CAST_OP(0x207A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x207B + i] = CAST_OP(0x207B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x207C + i] = CAST_OP(0x207C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x205F + i] = CAST_OP(0x205F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2067 + i] = CAST_OP(0x2067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3040 + i + j] = CAST_OP(0x3040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3048 + i + j] = CAST_OP(0x3048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3050 + i + j] = CAST_OP(0x3050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3058 + i + j] = CAST_OP(0x3058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3060 + i + j] = CAST_OP(0x3060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3068 + i + j] = CAST_OP(0x3068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3070 + i + j] = CAST_OP(0x3070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3078 + i] = CAST_OP(0x3078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3079 + i] = CAST_OP(0x3079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x307A + i] = CAST_OP(0x307A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x307B + i] = CAST_OP(0x307B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x307C + i] = CAST_OP(0x307C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x305F + i] = CAST_OP(0x305F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3067 + i] = CAST_OP(0x3067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4000 + i] = CAST_OP(0x4000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4010 + i] = CAST_OP(0x4010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4018 + i] = CAST_OP(0x4018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4020 + i] = CAST_OP(0x4020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4028 + i] = CAST_OP(0x4028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4030 + i] = CAST_OP(0x4030); + JumpTable[0x4038] = CAST_OP(0x4038); + JumpTable[0x4039] = CAST_OP(0x4039); + JumpTable[0x401F] = CAST_OP(0x401F); + JumpTable[0x4027] = CAST_OP(0x4027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4040 + i] = CAST_OP(0x4040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4050 + i] = CAST_OP(0x4050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4058 + i] = CAST_OP(0x4058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4060 + i] = CAST_OP(0x4060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4068 + i] = CAST_OP(0x4068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4070 + i] = CAST_OP(0x4070); + JumpTable[0x4078] = CAST_OP(0x4078); + JumpTable[0x4079] = CAST_OP(0x4079); + JumpTable[0x405F] = CAST_OP(0x405F); + JumpTable[0x4067] = CAST_OP(0x4067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4080 + i] = CAST_OP(0x4080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4090 + i] = CAST_OP(0x4090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4098 + i] = CAST_OP(0x4098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x40A0 + i] = CAST_OP(0x40A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40A8 + i] = CAST_OP(0x40A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40B0 + i] = CAST_OP(0x40B0); + JumpTable[0x40B8] = CAST_OP(0x40B8); + JumpTable[0x40B9] = CAST_OP(0x40B9); + JumpTable[0x409F] = CAST_OP(0x409F); + JumpTable[0x40A7] = CAST_OP(0x40A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4200 + i] = CAST_OP(0x4200); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4210 + i] = CAST_OP(0x4210); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4218 + i] = CAST_OP(0x4218); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4220 + i] = CAST_OP(0x4220); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4228 + i] = CAST_OP(0x4228); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4230 + i] = CAST_OP(0x4230); + JumpTable[0x4238] = CAST_OP(0x4238); + JumpTable[0x4239] = CAST_OP(0x4239); + JumpTable[0x421F] = CAST_OP(0x421F); + JumpTable[0x4227] = CAST_OP(0x4227); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4240 + i] = CAST_OP(0x4240); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4250 + i] = CAST_OP(0x4250); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4258 + i] = CAST_OP(0x4258); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4260 + i] = CAST_OP(0x4260); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4268 + i] = CAST_OP(0x4268); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4270 + i] = CAST_OP(0x4270); + JumpTable[0x4278] = CAST_OP(0x4278); + JumpTable[0x4279] = CAST_OP(0x4279); + JumpTable[0x425F] = CAST_OP(0x425F); + JumpTable[0x4267] = CAST_OP(0x4267); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4280 + i] = CAST_OP(0x4280); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4290 + i] = CAST_OP(0x4290); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4298 + i] = CAST_OP(0x4298); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x42A0 + i] = CAST_OP(0x42A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42A8 + i] = CAST_OP(0x42A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42B0 + i] = CAST_OP(0x42B0); + JumpTable[0x42B8] = CAST_OP(0x42B8); + JumpTable[0x42B9] = CAST_OP(0x42B9); + JumpTable[0x429F] = CAST_OP(0x429F); + JumpTable[0x42A7] = CAST_OP(0x42A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4400 + i] = CAST_OP(0x4400); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4410 + i] = CAST_OP(0x4410); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4418 + i] = CAST_OP(0x4418); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4420 + i] = CAST_OP(0x4420); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4428 + i] = CAST_OP(0x4428); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4430 + i] = CAST_OP(0x4430); + JumpTable[0x4438] = CAST_OP(0x4438); + JumpTable[0x4439] = CAST_OP(0x4439); + JumpTable[0x441F] = CAST_OP(0x441F); + JumpTable[0x4427] = CAST_OP(0x4427); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4440 + i] = CAST_OP(0x4440); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4450 + i] = CAST_OP(0x4450); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4458 + i] = CAST_OP(0x4458); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4460 + i] = CAST_OP(0x4460); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4468 + i] = CAST_OP(0x4468); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4470 + i] = CAST_OP(0x4470); + JumpTable[0x4478] = CAST_OP(0x4478); + JumpTable[0x4479] = CAST_OP(0x4479); + JumpTable[0x445F] = CAST_OP(0x445F); + JumpTable[0x4467] = CAST_OP(0x4467); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4480 + i] = CAST_OP(0x4480); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4490 + i] = CAST_OP(0x4490); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4498 + i] = CAST_OP(0x4498); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x44A0 + i] = CAST_OP(0x44A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44A8 + i] = CAST_OP(0x44A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44B0 + i] = CAST_OP(0x44B0); + JumpTable[0x44B8] = CAST_OP(0x44B8); + JumpTable[0x44B9] = CAST_OP(0x44B9); + JumpTable[0x449F] = CAST_OP(0x449F); + JumpTable[0x44A7] = CAST_OP(0x44A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4600 + i] = CAST_OP(0x4600); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4610 + i] = CAST_OP(0x4610); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4618 + i] = CAST_OP(0x4618); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4620 + i] = CAST_OP(0x4620); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4628 + i] = CAST_OP(0x4628); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4630 + i] = CAST_OP(0x4630); + JumpTable[0x4638] = CAST_OP(0x4638); + JumpTable[0x4639] = CAST_OP(0x4639); + JumpTable[0x461F] = CAST_OP(0x461F); + JumpTable[0x4627] = CAST_OP(0x4627); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4640 + i] = CAST_OP(0x4640); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4650 + i] = CAST_OP(0x4650); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4658 + i] = CAST_OP(0x4658); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4660 + i] = CAST_OP(0x4660); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4668 + i] = CAST_OP(0x4668); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4670 + i] = CAST_OP(0x4670); + JumpTable[0x4678] = CAST_OP(0x4678); + JumpTable[0x4679] = CAST_OP(0x4679); + JumpTable[0x465F] = CAST_OP(0x465F); + JumpTable[0x4667] = CAST_OP(0x4667); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4680 + i] = CAST_OP(0x4680); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4690 + i] = CAST_OP(0x4690); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4698 + i] = CAST_OP(0x4698); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x46A0 + i] = CAST_OP(0x46A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46A8 + i] = CAST_OP(0x46A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46B0 + i] = CAST_OP(0x46B0); + JumpTable[0x46B8] = CAST_OP(0x46B8); + JumpTable[0x46B9] = CAST_OP(0x46B9); + JumpTable[0x469F] = CAST_OP(0x469F); + JumpTable[0x46A7] = CAST_OP(0x46A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40C0 + i] = CAST_OP(0x40C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40D0 + i] = CAST_OP(0x40D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x40D8 + i] = CAST_OP(0x40D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x40E0 + i] = CAST_OP(0x40E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40E8 + i] = CAST_OP(0x40E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40F0 + i] = CAST_OP(0x40F0); + JumpTable[0x40F8] = CAST_OP(0x40F8); + JumpTable[0x40F9] = CAST_OP(0x40F9); + JumpTable[0x40DF] = CAST_OP(0x40DF); + JumpTable[0x40E7] = CAST_OP(0x40E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44C0 + i] = CAST_OP(0x44C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44D0 + i] = CAST_OP(0x44D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x44D8 + i] = CAST_OP(0x44D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x44E0 + i] = CAST_OP(0x44E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44E8 + i] = CAST_OP(0x44E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44F0 + i] = CAST_OP(0x44F0); + JumpTable[0x44F8] = CAST_OP(0x44F8); + JumpTable[0x44F9] = CAST_OP(0x44F9); + JumpTable[0x44FA] = CAST_OP(0x44FA); + JumpTable[0x44FB] = CAST_OP(0x44FB); + JumpTable[0x44FC] = CAST_OP(0x44FC); + JumpTable[0x44DF] = CAST_OP(0x44DF); + JumpTable[0x44E7] = CAST_OP(0x44E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46C0 + i] = CAST_OP(0x46C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46D0 + i] = CAST_OP(0x46D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x46D8 + i] = CAST_OP(0x46D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x46E0 + i] = CAST_OP(0x46E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46E8 + i] = CAST_OP(0x46E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46F0 + i] = CAST_OP(0x46F0); + JumpTable[0x46F8] = CAST_OP(0x46F8); + JumpTable[0x46F9] = CAST_OP(0x46F9); + JumpTable[0x46FA] = CAST_OP(0x46FA); + JumpTable[0x46FB] = CAST_OP(0x46FB); + JumpTable[0x46FC] = CAST_OP(0x46FC); + JumpTable[0x46DF] = CAST_OP(0x46DF); + JumpTable[0x46E7] = CAST_OP(0x46E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4800 + i] = CAST_OP(0x4800); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4810 + i] = CAST_OP(0x4810); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4818 + i] = CAST_OP(0x4818); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4820 + i] = CAST_OP(0x4820); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4828 + i] = CAST_OP(0x4828); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4830 + i] = CAST_OP(0x4830); + JumpTable[0x4838] = CAST_OP(0x4838); + JumpTable[0x4839] = CAST_OP(0x4839); + JumpTable[0x481F] = CAST_OP(0x481F); + JumpTable[0x4827] = CAST_OP(0x4827); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4850 + i] = CAST_OP(0x4850); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4868 + i] = CAST_OP(0x4868); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4870 + i] = CAST_OP(0x4870); + JumpTable[0x4878] = CAST_OP(0x4878); + JumpTable[0x4879] = CAST_OP(0x4879); + JumpTable[0x487A] = CAST_OP(0x487A); + JumpTable[0x487B] = CAST_OP(0x487B); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4840 + i] = CAST_OP(0x4840); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4890 + i] = CAST_OP(0x4890); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x48A0 + i] = CAST_OP(0x48A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48A8 + i] = CAST_OP(0x48A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48B0 + i] = CAST_OP(0x48B0); + JumpTable[0x48B8] = CAST_OP(0x48B8); + JumpTable[0x48B9] = CAST_OP(0x48B9); + JumpTable[0x48A7] = CAST_OP(0x48A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48D0 + i] = CAST_OP(0x48D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x48E0 + i] = CAST_OP(0x48E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48E8 + i] = CAST_OP(0x48E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48F0 + i] = CAST_OP(0x48F0); + JumpTable[0x48F8] = CAST_OP(0x48F8); + JumpTable[0x48F9] = CAST_OP(0x48F9); + JumpTable[0x48E7] = CAST_OP(0x48E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4880 + i] = CAST_OP(0x4880); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48C0 + i] = CAST_OP(0x48C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A00 + i] = CAST_OP(0x4A00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A10 + i] = CAST_OP(0x4A10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A18 + i] = CAST_OP(0x4A18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A20 + i] = CAST_OP(0x4A20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A28 + i] = CAST_OP(0x4A28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A30 + i] = CAST_OP(0x4A30); + JumpTable[0x4A38] = CAST_OP(0x4A38); + JumpTable[0x4A39] = CAST_OP(0x4A39); + JumpTable[0x4A1F] = CAST_OP(0x4A1F); + JumpTable[0x4A27] = CAST_OP(0x4A27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A40 + i] = CAST_OP(0x4A40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A50 + i] = CAST_OP(0x4A50); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A58 + i] = CAST_OP(0x4A58); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A60 + i] = CAST_OP(0x4A60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A68 + i] = CAST_OP(0x4A68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A70 + i] = CAST_OP(0x4A70); + JumpTable[0x4A78] = CAST_OP(0x4A78); + JumpTable[0x4A79] = CAST_OP(0x4A79); + JumpTable[0x4A5F] = CAST_OP(0x4A5F); + JumpTable[0x4A67] = CAST_OP(0x4A67); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A80 + i] = CAST_OP(0x4A80); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A90 + i] = CAST_OP(0x4A90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A98 + i] = CAST_OP(0x4A98); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4AA0 + i] = CAST_OP(0x4AA0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AA8 + i] = CAST_OP(0x4AA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AB0 + i] = CAST_OP(0x4AB0); + JumpTable[0x4AB8] = CAST_OP(0x4AB8); + JumpTable[0x4AB9] = CAST_OP(0x4AB9); + JumpTable[0x4A9F] = CAST_OP(0x4A9F); + JumpTable[0x4AA7] = CAST_OP(0x4AA7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AC0 + i] = CAST_OP(0x4AC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AD0 + i] = CAST_OP(0x4AD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4AD8 + i] = CAST_OP(0x4AD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4AE0 + i] = CAST_OP(0x4AE0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AE8 + i] = CAST_OP(0x4AE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AF0 + i] = CAST_OP(0x4AF0); + JumpTable[0x4AF8] = CAST_OP(0x4AF8); + JumpTable[0x4AF9] = CAST_OP(0x4AF9); + JumpTable[0x4ADF] = CAST_OP(0x4ADF); + JumpTable[0x4AE7] = CAST_OP(0x4AE7); + JumpTable[0x4AFC] = CAST_OP(0x4AFC); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C90 + i] = CAST_OP(0x4C90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4C98 + i] = CAST_OP(0x4C98); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CA8 + i] = CAST_OP(0x4CA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CB0 + i] = CAST_OP(0x4CB0); + JumpTable[0x4CB8] = CAST_OP(0x4CB8); + JumpTable[0x4CB9] = CAST_OP(0x4CB9); + JumpTable[0x4CBA] = CAST_OP(0x4CBA); + JumpTable[0x4CBB] = CAST_OP(0x4CBB); + JumpTable[0x4C9F] = CAST_OP(0x4C9F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CD0 + i] = CAST_OP(0x4CD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4CD8 + i] = CAST_OP(0x4CD8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CE8 + i] = CAST_OP(0x4CE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CF0 + i] = CAST_OP(0x4CF0); + JumpTable[0x4CF8] = CAST_OP(0x4CF8); + JumpTable[0x4CF9] = CAST_OP(0x4CF9); + JumpTable[0x4CFA] = CAST_OP(0x4CFA); + JumpTable[0x4CFB] = CAST_OP(0x4CFB); + JumpTable[0x4CDF] = CAST_OP(0x4CDF); + for(i = 0x0000; i <= 0x000F; i += 0x0001) + JumpTable[0x4E40 + i] = CAST_OP(0x4E40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E50 + i] = CAST_OP(0x4E50); + JumpTable[0x4E57] = CAST_OP(0x4E57); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E58 + i] = CAST_OP(0x4E58); + JumpTable[0x4E5F] = CAST_OP(0x4E5F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E60 + i] = CAST_OP(0x4E60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E68 + i] = CAST_OP(0x4E68); + JumpTable[0x4E70] = CAST_OP(0x4E70); + JumpTable[0x4E71] = CAST_OP(0x4E71); + JumpTable[0x4E72] = CAST_OP(0x4E72); + JumpTable[0x4E73] = CAST_OP(0x4E73); + JumpTable[0x4E75] = CAST_OP(0x4E75); + JumpTable[0x4E76] = CAST_OP(0x4E76); + JumpTable[0x4E77] = CAST_OP(0x4E77); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E90 + i] = CAST_OP(0x4E90); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EA8 + i] = CAST_OP(0x4EA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EB0 + i] = CAST_OP(0x4EB0); + JumpTable[0x4EB8] = CAST_OP(0x4EB8); + JumpTable[0x4EB9] = CAST_OP(0x4EB9); + JumpTable[0x4EBA] = CAST_OP(0x4EBA); + JumpTable[0x4EBB] = CAST_OP(0x4EBB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4ED0 + i] = CAST_OP(0x4ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EE8 + i] = CAST_OP(0x4EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EF0 + i] = CAST_OP(0x4EF0); + JumpTable[0x4EF8] = CAST_OP(0x4EF8); + JumpTable[0x4EF9] = CAST_OP(0x4EF9); + JumpTable[0x4EFA] = CAST_OP(0x4EFA); + JumpTable[0x4EFB] = CAST_OP(0x4EFB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4180 + i + j] = CAST_OP(0x4180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4190 + i + j] = CAST_OP(0x4190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4198 + i + j] = CAST_OP(0x4198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41A0 + i + j] = CAST_OP(0x41A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41A8 + i + j] = CAST_OP(0x41A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41B0 + i + j] = CAST_OP(0x41B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41B8 + i] = CAST_OP(0x41B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41B9 + i] = CAST_OP(0x41B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41BA + i] = CAST_OP(0x41BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41BB + i] = CAST_OP(0x41BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41BC + i] = CAST_OP(0x41BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x419F + i] = CAST_OP(0x419F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41A7 + i] = CAST_OP(0x41A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41D0 + i + j] = CAST_OP(0x41D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41E8 + i + j] = CAST_OP(0x41E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41F0 + i + j] = CAST_OP(0x41F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41F8 + i] = CAST_OP(0x41F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41F9 + i] = CAST_OP(0x41F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41FA + i] = CAST_OP(0x41FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41FB + i] = CAST_OP(0x41FB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50C0 + i] = CAST_OP(0x50C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51C0 + i] = CAST_OP(0x51C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52C0 + i] = CAST_OP(0x52C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53C0 + i] = CAST_OP(0x53C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54C0 + i] = CAST_OP(0x54C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55C0 + i] = CAST_OP(0x55C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56C0 + i] = CAST_OP(0x56C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57C0 + i] = CAST_OP(0x57C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58C0 + i] = CAST_OP(0x58C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59C0 + i] = CAST_OP(0x59C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AC0 + i] = CAST_OP(0x5AC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BC0 + i] = CAST_OP(0x5BC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CC0 + i] = CAST_OP(0x5CC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DC0 + i] = CAST_OP(0x5DC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EC0 + i] = CAST_OP(0x5EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FC0 + i] = CAST_OP(0x5FC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50D0 + i] = CAST_OP(0x50D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51D0 + i] = CAST_OP(0x51D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52D0 + i] = CAST_OP(0x52D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53D0 + i] = CAST_OP(0x53D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54D0 + i] = CAST_OP(0x54D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55D0 + i] = CAST_OP(0x55D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56D0 + i] = CAST_OP(0x56D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57D0 + i] = CAST_OP(0x57D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58D0 + i] = CAST_OP(0x58D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59D0 + i] = CAST_OP(0x59D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AD0 + i] = CAST_OP(0x5AD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BD0 + i] = CAST_OP(0x5BD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CD0 + i] = CAST_OP(0x5CD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DD0 + i] = CAST_OP(0x5DD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5ED0 + i] = CAST_OP(0x5ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FD0 + i] = CAST_OP(0x5FD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x50D8 + i] = CAST_OP(0x50D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x51D8 + i] = CAST_OP(0x51D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x52D8 + i] = CAST_OP(0x52D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x53D8 + i] = CAST_OP(0x53D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x54D8 + i] = CAST_OP(0x54D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x55D8 + i] = CAST_OP(0x55D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x56D8 + i] = CAST_OP(0x56D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x57D8 + i] = CAST_OP(0x57D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x58D8 + i] = CAST_OP(0x58D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x59D8 + i] = CAST_OP(0x59D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5AD8 + i] = CAST_OP(0x5AD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5BD8 + i] = CAST_OP(0x5BD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5CD8 + i] = CAST_OP(0x5CD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5DD8 + i] = CAST_OP(0x5DD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5ED8 + i] = CAST_OP(0x5ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5FD8 + i] = CAST_OP(0x5FD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x50E0 + i] = CAST_OP(0x50E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x51E0 + i] = CAST_OP(0x51E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x52E0 + i] = CAST_OP(0x52E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x53E0 + i] = CAST_OP(0x53E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x54E0 + i] = CAST_OP(0x54E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x55E0 + i] = CAST_OP(0x55E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x56E0 + i] = CAST_OP(0x56E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x57E0 + i] = CAST_OP(0x57E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x58E0 + i] = CAST_OP(0x58E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x59E0 + i] = CAST_OP(0x59E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5AE0 + i] = CAST_OP(0x5AE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5BE0 + i] = CAST_OP(0x5BE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5CE0 + i] = CAST_OP(0x5CE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5DE0 + i] = CAST_OP(0x5DE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5EE0 + i] = CAST_OP(0x5EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5FE0 + i] = CAST_OP(0x5FE0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50E8 + i] = CAST_OP(0x50E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51E8 + i] = CAST_OP(0x51E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52E8 + i] = CAST_OP(0x52E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53E8 + i] = CAST_OP(0x53E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54E8 + i] = CAST_OP(0x54E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55E8 + i] = CAST_OP(0x55E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56E8 + i] = CAST_OP(0x56E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57E8 + i] = CAST_OP(0x57E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58E8 + i] = CAST_OP(0x58E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59E8 + i] = CAST_OP(0x59E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AE8 + i] = CAST_OP(0x5AE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BE8 + i] = CAST_OP(0x5BE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CE8 + i] = CAST_OP(0x5CE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DE8 + i] = CAST_OP(0x5DE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EE8 + i] = CAST_OP(0x5EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FE8 + i] = CAST_OP(0x5FE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50F0 + i] = CAST_OP(0x50F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51F0 + i] = CAST_OP(0x51F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52F0 + i] = CAST_OP(0x52F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53F0 + i] = CAST_OP(0x53F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54F0 + i] = CAST_OP(0x54F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55F0 + i] = CAST_OP(0x55F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56F0 + i] = CAST_OP(0x56F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57F0 + i] = CAST_OP(0x57F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58F0 + i] = CAST_OP(0x58F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59F0 + i] = CAST_OP(0x59F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AF0 + i] = CAST_OP(0x5AF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BF0 + i] = CAST_OP(0x5BF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CF0 + i] = CAST_OP(0x5CF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DF0 + i] = CAST_OP(0x5DF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EF0 + i] = CAST_OP(0x5EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FF0 + i] = CAST_OP(0x5FF0); + JumpTable[0x50F8] = CAST_OP(0x50F8); + JumpTable[0x51F8] = CAST_OP(0x51F8); + JumpTable[0x52F8] = CAST_OP(0x52F8); + JumpTable[0x53F8] = CAST_OP(0x53F8); + JumpTable[0x54F8] = CAST_OP(0x54F8); + JumpTable[0x55F8] = CAST_OP(0x55F8); + JumpTable[0x56F8] = CAST_OP(0x56F8); + JumpTable[0x57F8] = CAST_OP(0x57F8); + JumpTable[0x58F8] = CAST_OP(0x58F8); + JumpTable[0x59F8] = CAST_OP(0x59F8); + JumpTable[0x5AF8] = CAST_OP(0x5AF8); + JumpTable[0x5BF8] = CAST_OP(0x5BF8); + JumpTable[0x5CF8] = CAST_OP(0x5CF8); + JumpTable[0x5DF8] = CAST_OP(0x5DF8); + JumpTable[0x5EF8] = CAST_OP(0x5EF8); + JumpTable[0x5FF8] = CAST_OP(0x5FF8); + JumpTable[0x50F9] = CAST_OP(0x50F9); + JumpTable[0x51F9] = CAST_OP(0x51F9); + JumpTable[0x52F9] = CAST_OP(0x52F9); + JumpTable[0x53F9] = CAST_OP(0x53F9); + JumpTable[0x54F9] = CAST_OP(0x54F9); + JumpTable[0x55F9] = CAST_OP(0x55F9); + JumpTable[0x56F9] = CAST_OP(0x56F9); + JumpTable[0x57F9] = CAST_OP(0x57F9); + JumpTable[0x58F9] = CAST_OP(0x58F9); + JumpTable[0x59F9] = CAST_OP(0x59F9); + JumpTable[0x5AF9] = CAST_OP(0x5AF9); + JumpTable[0x5BF9] = CAST_OP(0x5BF9); + JumpTable[0x5CF9] = CAST_OP(0x5CF9); + JumpTable[0x5DF9] = CAST_OP(0x5DF9); + JumpTable[0x5EF9] = CAST_OP(0x5EF9); + JumpTable[0x5FF9] = CAST_OP(0x5FF9); + JumpTable[0x50DF] = CAST_OP(0x50DF); + JumpTable[0x51DF] = CAST_OP(0x51DF); + JumpTable[0x52DF] = CAST_OP(0x52DF); + JumpTable[0x53DF] = CAST_OP(0x53DF); + JumpTable[0x54DF] = CAST_OP(0x54DF); + JumpTable[0x55DF] = CAST_OP(0x55DF); + JumpTable[0x56DF] = CAST_OP(0x56DF); + JumpTable[0x57DF] = CAST_OP(0x57DF); + JumpTable[0x58DF] = CAST_OP(0x58DF); + JumpTable[0x59DF] = CAST_OP(0x59DF); + JumpTable[0x5ADF] = CAST_OP(0x5ADF); + JumpTable[0x5BDF] = CAST_OP(0x5BDF); + JumpTable[0x5CDF] = CAST_OP(0x5CDF); + JumpTable[0x5DDF] = CAST_OP(0x5DDF); + JumpTable[0x5EDF] = CAST_OP(0x5EDF); + JumpTable[0x5FDF] = CAST_OP(0x5FDF); + JumpTable[0x50E7] = CAST_OP(0x50E7); + JumpTable[0x51E7] = CAST_OP(0x51E7); + JumpTable[0x52E7] = CAST_OP(0x52E7); + JumpTable[0x53E7] = CAST_OP(0x53E7); + JumpTable[0x54E7] = CAST_OP(0x54E7); + JumpTable[0x55E7] = CAST_OP(0x55E7); + JumpTable[0x56E7] = CAST_OP(0x56E7); + JumpTable[0x57E7] = CAST_OP(0x57E7); + JumpTable[0x58E7] = CAST_OP(0x58E7); + JumpTable[0x59E7] = CAST_OP(0x59E7); + JumpTable[0x5AE7] = CAST_OP(0x5AE7); + JumpTable[0x5BE7] = CAST_OP(0x5BE7); + JumpTable[0x5CE7] = CAST_OP(0x5CE7); + JumpTable[0x5DE7] = CAST_OP(0x5DE7); + JumpTable[0x5EE7] = CAST_OP(0x5EE7); + JumpTable[0x5FE7] = CAST_OP(0x5FE7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50C8 + i] = CAST_OP(0x50C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51C8 + i] = CAST_OP(0x51C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52C8 + i] = CAST_OP(0x52C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53C8 + i] = CAST_OP(0x53C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54C8 + i] = CAST_OP(0x54C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55C8 + i] = CAST_OP(0x55C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56C8 + i] = CAST_OP(0x56C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57C8 + i] = CAST_OP(0x57C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58C8 + i] = CAST_OP(0x58C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59C8 + i] = CAST_OP(0x59C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AC8 + i] = CAST_OP(0x5AC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BC8 + i] = CAST_OP(0x5BC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CC8 + i] = CAST_OP(0x5CC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DC8 + i] = CAST_OP(0x5DC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EC8 + i] = CAST_OP(0x5EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FC8 + i] = CAST_OP(0x5FC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5000 + i + j] = CAST_OP(0x5000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5010 + i + j] = CAST_OP(0x5010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5018 + i + j] = CAST_OP(0x5018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5020 + i + j] = CAST_OP(0x5020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5028 + i + j] = CAST_OP(0x5028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5030 + i + j] = CAST_OP(0x5030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5038 + i] = CAST_OP(0x5038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5039 + i] = CAST_OP(0x5039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x501F + i] = CAST_OP(0x501F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5027 + i] = CAST_OP(0x5027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5040 + i + j] = CAST_OP(0x5040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5048 + i + j] = CAST_OP(0x5048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5050 + i + j] = CAST_OP(0x5050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5058 + i + j] = CAST_OP(0x5058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5060 + i + j] = CAST_OP(0x5060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5068 + i + j] = CAST_OP(0x5068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5070 + i + j] = CAST_OP(0x5070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5078 + i] = CAST_OP(0x5078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5079 + i] = CAST_OP(0x5079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x505F + i] = CAST_OP(0x505F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5067 + i] = CAST_OP(0x5067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5080 + i + j] = CAST_OP(0x5080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5088 + i + j] = CAST_OP(0x5088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5090 + i + j] = CAST_OP(0x5090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5098 + i + j] = CAST_OP(0x5098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x50A0 + i + j] = CAST_OP(0x50A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x50A8 + i + j] = CAST_OP(0x50A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x50B0 + i + j] = CAST_OP(0x50B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x50B8 + i] = CAST_OP(0x50B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x50B9 + i] = CAST_OP(0x50B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x509F + i] = CAST_OP(0x509F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x50A7 + i] = CAST_OP(0x50A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5100 + i + j] = CAST_OP(0x5100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5110 + i + j] = CAST_OP(0x5110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5118 + i + j] = CAST_OP(0x5118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5120 + i + j] = CAST_OP(0x5120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5128 + i + j] = CAST_OP(0x5128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5130 + i + j] = CAST_OP(0x5130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5138 + i] = CAST_OP(0x5138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5139 + i] = CAST_OP(0x5139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x511F + i] = CAST_OP(0x511F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5127 + i] = CAST_OP(0x5127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5140 + i + j] = CAST_OP(0x5140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5148 + i + j] = CAST_OP(0x5148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5150 + i + j] = CAST_OP(0x5150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5158 + i + j] = CAST_OP(0x5158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5160 + i + j] = CAST_OP(0x5160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5168 + i + j] = CAST_OP(0x5168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5170 + i + j] = CAST_OP(0x5170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5178 + i] = CAST_OP(0x5178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5179 + i] = CAST_OP(0x5179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x515F + i] = CAST_OP(0x515F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5167 + i] = CAST_OP(0x5167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5180 + i + j] = CAST_OP(0x5180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5188 + i + j] = CAST_OP(0x5188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5190 + i + j] = CAST_OP(0x5190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5198 + i + j] = CAST_OP(0x5198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x51A0 + i + j] = CAST_OP(0x51A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x51A8 + i + j] = CAST_OP(0x51A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x51B0 + i + j] = CAST_OP(0x51B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x51B8 + i] = CAST_OP(0x51B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x51B9 + i] = CAST_OP(0x51B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x519F + i] = CAST_OP(0x519F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x51A7 + i] = CAST_OP(0x51A7); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6200 + i] = CAST_OP(0x6201); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6300 + i] = CAST_OP(0x6301); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6400 + i] = CAST_OP(0x6401); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6500 + i] = CAST_OP(0x6501); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6600 + i] = CAST_OP(0x6601); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6700 + i] = CAST_OP(0x6701); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6800 + i] = CAST_OP(0x6801); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6900 + i] = CAST_OP(0x6901); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6A00 + i] = CAST_OP(0x6A01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6B00 + i] = CAST_OP(0x6B01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6C00 + i] = CAST_OP(0x6C01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6D00 + i] = CAST_OP(0x6D01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6E00 + i] = CAST_OP(0x6E01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6F00 + i] = CAST_OP(0x6F01); + JumpTable[0x6200] = CAST_OP(0x6200); + JumpTable[0x6300] = CAST_OP(0x6300); + JumpTable[0x6400] = CAST_OP(0x6400); + JumpTable[0x6500] = CAST_OP(0x6500); + JumpTable[0x6600] = CAST_OP(0x6600); + JumpTable[0x6700] = CAST_OP(0x6700); + JumpTable[0x6800] = CAST_OP(0x6800); + JumpTable[0x6900] = CAST_OP(0x6900); + JumpTable[0x6A00] = CAST_OP(0x6A00); + JumpTable[0x6B00] = CAST_OP(0x6B00); + JumpTable[0x6C00] = CAST_OP(0x6C00); + JumpTable[0x6D00] = CAST_OP(0x6D00); + JumpTable[0x6E00] = CAST_OP(0x6E00); + JumpTable[0x6F00] = CAST_OP(0x6F00); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6000 + i] = CAST_OP(0x6001); + JumpTable[0x6000] = CAST_OP(0x6000); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6100 + i] = CAST_OP(0x6101); + JumpTable[0x6100] = CAST_OP(0x6100); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + for(j = 0x0000; j <= 0x00FF; j += 0x0001) + JumpTable[0x7000 + i + j] = CAST_OP(0x7000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8000 + i + j] = CAST_OP(0x8000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8010 + i + j] = CAST_OP(0x8010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8018 + i + j] = CAST_OP(0x8018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8020 + i + j] = CAST_OP(0x8020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8028 + i + j] = CAST_OP(0x8028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8030 + i + j] = CAST_OP(0x8030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8038 + i] = CAST_OP(0x8038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8039 + i] = CAST_OP(0x8039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x803A + i] = CAST_OP(0x803A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x803B + i] = CAST_OP(0x803B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x803C + i] = CAST_OP(0x803C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x801F + i] = CAST_OP(0x801F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8027 + i] = CAST_OP(0x8027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8040 + i + j] = CAST_OP(0x8040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8050 + i + j] = CAST_OP(0x8050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8058 + i + j] = CAST_OP(0x8058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8060 + i + j] = CAST_OP(0x8060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8068 + i + j] = CAST_OP(0x8068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8070 + i + j] = CAST_OP(0x8070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8078 + i] = CAST_OP(0x8078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8079 + i] = CAST_OP(0x8079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x807A + i] = CAST_OP(0x807A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x807B + i] = CAST_OP(0x807B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x807C + i] = CAST_OP(0x807C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x805F + i] = CAST_OP(0x805F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8067 + i] = CAST_OP(0x8067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8080 + i + j] = CAST_OP(0x8080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8090 + i + j] = CAST_OP(0x8090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8098 + i + j] = CAST_OP(0x8098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80A0 + i + j] = CAST_OP(0x80A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80A8 + i + j] = CAST_OP(0x80A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80B0 + i + j] = CAST_OP(0x80B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80B8 + i] = CAST_OP(0x80B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80B9 + i] = CAST_OP(0x80B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80BA + i] = CAST_OP(0x80BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80BB + i] = CAST_OP(0x80BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80BC + i] = CAST_OP(0x80BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x809F + i] = CAST_OP(0x809F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80A7 + i] = CAST_OP(0x80A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8110 + i + j] = CAST_OP(0x8110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8118 + i + j] = CAST_OP(0x8118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8120 + i + j] = CAST_OP(0x8120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8128 + i + j] = CAST_OP(0x8128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8130 + i + j] = CAST_OP(0x8130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8138 + i] = CAST_OP(0x8138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8139 + i] = CAST_OP(0x8139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x811F + i] = CAST_OP(0x811F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8127 + i] = CAST_OP(0x8127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8150 + i + j] = CAST_OP(0x8150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8158 + i + j] = CAST_OP(0x8158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8160 + i + j] = CAST_OP(0x8160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8168 + i + j] = CAST_OP(0x8168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8170 + i + j] = CAST_OP(0x8170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8178 + i] = CAST_OP(0x8178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8179 + i] = CAST_OP(0x8179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x815F + i] = CAST_OP(0x815F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8167 + i] = CAST_OP(0x8167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8190 + i + j] = CAST_OP(0x8190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8198 + i + j] = CAST_OP(0x8198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81A0 + i + j] = CAST_OP(0x81A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81A8 + i + j] = CAST_OP(0x81A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81B0 + i + j] = CAST_OP(0x81B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81B8 + i] = CAST_OP(0x81B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81B9 + i] = CAST_OP(0x81B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x819F + i] = CAST_OP(0x819F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81A7 + i] = CAST_OP(0x81A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8100 + i + j] = CAST_OP(0x8100); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x8108 + i + j] = CAST_OP(0x8108); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x810F + i] = CAST_OP(0x810F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x8F08 + i] = CAST_OP(0x8F08); + JumpTable[0x8F0F] = CAST_OP(0x8F0F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80C0 + i + j] = CAST_OP(0x80C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80D0 + i + j] = CAST_OP(0x80D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80D8 + i + j] = CAST_OP(0x80D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80E0 + i + j] = CAST_OP(0x80E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80E8 + i + j] = CAST_OP(0x80E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80F0 + i + j] = CAST_OP(0x80F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80F8 + i] = CAST_OP(0x80F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80F9 + i] = CAST_OP(0x80F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80FA + i] = CAST_OP(0x80FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80FB + i] = CAST_OP(0x80FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80FC + i] = CAST_OP(0x80FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80DF + i] = CAST_OP(0x80DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80E7 + i] = CAST_OP(0x80E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81C0 + i + j] = CAST_OP(0x81C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81D0 + i + j] = CAST_OP(0x81D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81D8 + i + j] = CAST_OP(0x81D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81E0 + i + j] = CAST_OP(0x81E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81E8 + i + j] = CAST_OP(0x81E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81F0 + i + j] = CAST_OP(0x81F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81F8 + i] = CAST_OP(0x81F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81F9 + i] = CAST_OP(0x81F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81FA + i] = CAST_OP(0x81FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81FB + i] = CAST_OP(0x81FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81FC + i] = CAST_OP(0x81FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81DF + i] = CAST_OP(0x81DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81E7 + i] = CAST_OP(0x81E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9000 + i + j] = CAST_OP(0x9000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9008 + i + j] = CAST_OP(0x9008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9010 + i + j] = CAST_OP(0x9010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9018 + i + j] = CAST_OP(0x9018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9020 + i + j] = CAST_OP(0x9020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9028 + i + j] = CAST_OP(0x9028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9030 + i + j] = CAST_OP(0x9030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9038 + i] = CAST_OP(0x9038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9039 + i] = CAST_OP(0x9039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x903A + i] = CAST_OP(0x903A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x903B + i] = CAST_OP(0x903B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x903C + i] = CAST_OP(0x903C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x901F + i] = CAST_OP(0x901F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9027 + i] = CAST_OP(0x9027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9040 + i + j] = CAST_OP(0x9040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9048 + i + j] = CAST_OP(0x9048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9050 + i + j] = CAST_OP(0x9050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9058 + i + j] = CAST_OP(0x9058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9060 + i + j] = CAST_OP(0x9060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9068 + i + j] = CAST_OP(0x9068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9070 + i + j] = CAST_OP(0x9070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9078 + i] = CAST_OP(0x9078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9079 + i] = CAST_OP(0x9079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x907A + i] = CAST_OP(0x907A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x907B + i] = CAST_OP(0x907B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x907C + i] = CAST_OP(0x907C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x905F + i] = CAST_OP(0x905F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9067 + i] = CAST_OP(0x9067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9080 + i + j] = CAST_OP(0x9080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9088 + i + j] = CAST_OP(0x9088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9090 + i + j] = CAST_OP(0x9090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9098 + i + j] = CAST_OP(0x9098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90A0 + i + j] = CAST_OP(0x90A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90A8 + i + j] = CAST_OP(0x90A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90B0 + i + j] = CAST_OP(0x90B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90B8 + i] = CAST_OP(0x90B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90B9 + i] = CAST_OP(0x90B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90BA + i] = CAST_OP(0x90BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90BB + i] = CAST_OP(0x90BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90BC + i] = CAST_OP(0x90BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x909F + i] = CAST_OP(0x909F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90A7 + i] = CAST_OP(0x90A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9110 + i + j] = CAST_OP(0x9110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9118 + i + j] = CAST_OP(0x9118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9120 + i + j] = CAST_OP(0x9120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9128 + i + j] = CAST_OP(0x9128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9130 + i + j] = CAST_OP(0x9130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9138 + i] = CAST_OP(0x9138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9139 + i] = CAST_OP(0x9139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x911F + i] = CAST_OP(0x911F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9127 + i] = CAST_OP(0x9127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9150 + i + j] = CAST_OP(0x9150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9158 + i + j] = CAST_OP(0x9158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9160 + i + j] = CAST_OP(0x9160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9168 + i + j] = CAST_OP(0x9168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9170 + i + j] = CAST_OP(0x9170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9178 + i] = CAST_OP(0x9178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9179 + i] = CAST_OP(0x9179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x915F + i] = CAST_OP(0x915F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9167 + i] = CAST_OP(0x9167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9190 + i + j] = CAST_OP(0x9190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9198 + i + j] = CAST_OP(0x9198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91A0 + i + j] = CAST_OP(0x91A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91A8 + i + j] = CAST_OP(0x91A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91B0 + i + j] = CAST_OP(0x91B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91B8 + i] = CAST_OP(0x91B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91B9 + i] = CAST_OP(0x91B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x919F + i] = CAST_OP(0x919F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91A7 + i] = CAST_OP(0x91A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9100 + i + j] = CAST_OP(0x9100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9140 + i + j] = CAST_OP(0x9140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9180 + i + j] = CAST_OP(0x9180); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x9108 + i + j] = CAST_OP(0x9108); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x9148 + i + j] = CAST_OP(0x9148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x9188 + i + j] = CAST_OP(0x9188); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x910F + i] = CAST_OP(0x910F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x914F + i] = CAST_OP(0x914F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x918F + i] = CAST_OP(0x918F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x9F08 + i] = CAST_OP(0x9F08); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x9F48 + i] = CAST_OP(0x9F48); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x9F88 + i] = CAST_OP(0x9F88); + JumpTable[0x9F0F] = CAST_OP(0x9F0F); + JumpTable[0x9F4F] = CAST_OP(0x9F4F); + JumpTable[0x9F8F] = CAST_OP(0x9F8F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90C0 + i + j] = CAST_OP(0x90C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90C8 + i + j] = CAST_OP(0x90C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90D0 + i + j] = CAST_OP(0x90D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90D8 + i + j] = CAST_OP(0x90D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90E0 + i + j] = CAST_OP(0x90E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90E8 + i + j] = CAST_OP(0x90E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90F0 + i + j] = CAST_OP(0x90F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90F8 + i] = CAST_OP(0x90F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90F9 + i] = CAST_OP(0x90F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90FA + i] = CAST_OP(0x90FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90FB + i] = CAST_OP(0x90FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90FC + i] = CAST_OP(0x90FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90DF + i] = CAST_OP(0x90DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90E7 + i] = CAST_OP(0x90E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91C0 + i + j] = CAST_OP(0x91C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91C8 + i + j] = CAST_OP(0x91C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91D0 + i + j] = CAST_OP(0x91D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91D8 + i + j] = CAST_OP(0x91D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91E0 + i + j] = CAST_OP(0x91E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91E8 + i + j] = CAST_OP(0x91E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91F0 + i + j] = CAST_OP(0x91F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91F8 + i] = CAST_OP(0x91F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91F9 + i] = CAST_OP(0x91F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91FA + i] = CAST_OP(0x91FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91FB + i] = CAST_OP(0x91FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91FC + i] = CAST_OP(0x91FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91DF + i] = CAST_OP(0x91DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91E7 + i] = CAST_OP(0x91E7); + for(i = 0x0000; i <= 0x0FFF; i += 0x0001) + JumpTable[0xA000 + i] = CAST_OP(0xA000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB000 + i + j] = CAST_OP(0xB000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB008 + i + j] = CAST_OP(0xB008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB010 + i + j] = CAST_OP(0xB010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB018 + i + j] = CAST_OP(0xB018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB020 + i + j] = CAST_OP(0xB020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB028 + i + j] = CAST_OP(0xB028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB030 + i + j] = CAST_OP(0xB030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB038 + i] = CAST_OP(0xB038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB039 + i] = CAST_OP(0xB039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB03A + i] = CAST_OP(0xB03A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB03B + i] = CAST_OP(0xB03B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB03C + i] = CAST_OP(0xB03C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB01F + i] = CAST_OP(0xB01F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB027 + i] = CAST_OP(0xB027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB040 + i + j] = CAST_OP(0xB040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB048 + i + j] = CAST_OP(0xB048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB050 + i + j] = CAST_OP(0xB050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB058 + i + j] = CAST_OP(0xB058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB060 + i + j] = CAST_OP(0xB060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB068 + i + j] = CAST_OP(0xB068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB070 + i + j] = CAST_OP(0xB070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB078 + i] = CAST_OP(0xB078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB079 + i] = CAST_OP(0xB079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB07A + i] = CAST_OP(0xB07A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB07B + i] = CAST_OP(0xB07B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB07C + i] = CAST_OP(0xB07C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB05F + i] = CAST_OP(0xB05F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB067 + i] = CAST_OP(0xB067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB080 + i + j] = CAST_OP(0xB080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB088 + i + j] = CAST_OP(0xB088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB090 + i + j] = CAST_OP(0xB090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB098 + i + j] = CAST_OP(0xB098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0A0 + i + j] = CAST_OP(0xB0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0A8 + i + j] = CAST_OP(0xB0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0B0 + i + j] = CAST_OP(0xB0B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0B8 + i] = CAST_OP(0xB0B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0B9 + i] = CAST_OP(0xB0B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0BA + i] = CAST_OP(0xB0BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0BB + i] = CAST_OP(0xB0BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0BC + i] = CAST_OP(0xB0BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB09F + i] = CAST_OP(0xB09F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0A7 + i] = CAST_OP(0xB0A7); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xB108 + i + j] = CAST_OP(0xB108); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xB148 + i + j] = CAST_OP(0xB148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xB188 + i + j] = CAST_OP(0xB188); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xB10F + i] = CAST_OP(0xB10F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xB14F + i] = CAST_OP(0xB14F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xB18F + i] = CAST_OP(0xB18F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xBF08 + i] = CAST_OP(0xBF08); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xBF48 + i] = CAST_OP(0xBF48); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xBF88 + i] = CAST_OP(0xBF88); + JumpTable[0xBF0F] = CAST_OP(0xBF0F); + JumpTable[0xBF4F] = CAST_OP(0xBF4F); + JumpTable[0xBF8F] = CAST_OP(0xBF8F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB100 + i + j] = CAST_OP(0xB100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB110 + i + j] = CAST_OP(0xB110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB118 + i + j] = CAST_OP(0xB118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB120 + i + j] = CAST_OP(0xB120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB128 + i + j] = CAST_OP(0xB128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB130 + i + j] = CAST_OP(0xB130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB138 + i] = CAST_OP(0xB138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB139 + i] = CAST_OP(0xB139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB11F + i] = CAST_OP(0xB11F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB127 + i] = CAST_OP(0xB127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB140 + i + j] = CAST_OP(0xB140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB150 + i + j] = CAST_OP(0xB150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB158 + i + j] = CAST_OP(0xB158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB160 + i + j] = CAST_OP(0xB160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB168 + i + j] = CAST_OP(0xB168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB170 + i + j] = CAST_OP(0xB170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB178 + i] = CAST_OP(0xB178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB179 + i] = CAST_OP(0xB179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB15F + i] = CAST_OP(0xB15F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB167 + i] = CAST_OP(0xB167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB180 + i + j] = CAST_OP(0xB180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB190 + i + j] = CAST_OP(0xB190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB198 + i + j] = CAST_OP(0xB198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1A0 + i + j] = CAST_OP(0xB1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1A8 + i + j] = CAST_OP(0xB1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1B0 + i + j] = CAST_OP(0xB1B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1B8 + i] = CAST_OP(0xB1B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1B9 + i] = CAST_OP(0xB1B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB19F + i] = CAST_OP(0xB19F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1A7 + i] = CAST_OP(0xB1A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0C0 + i + j] = CAST_OP(0xB0C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0C8 + i + j] = CAST_OP(0xB0C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0D0 + i + j] = CAST_OP(0xB0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0D8 + i + j] = CAST_OP(0xB0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0E0 + i + j] = CAST_OP(0xB0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0E8 + i + j] = CAST_OP(0xB0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0F0 + i + j] = CAST_OP(0xB0F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0F8 + i] = CAST_OP(0xB0F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0F9 + i] = CAST_OP(0xB0F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0FA + i] = CAST_OP(0xB0FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0FB + i] = CAST_OP(0xB0FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0FC + i] = CAST_OP(0xB0FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0DF + i] = CAST_OP(0xB0DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0E7 + i] = CAST_OP(0xB0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1C0 + i + j] = CAST_OP(0xB1C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1C8 + i + j] = CAST_OP(0xB1C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1D0 + i + j] = CAST_OP(0xB1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1D8 + i + j] = CAST_OP(0xB1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1E0 + i + j] = CAST_OP(0xB1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1E8 + i + j] = CAST_OP(0xB1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1F0 + i + j] = CAST_OP(0xB1F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1F8 + i] = CAST_OP(0xB1F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1F9 + i] = CAST_OP(0xB1F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1FA + i] = CAST_OP(0xB1FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1FB + i] = CAST_OP(0xB1FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1FC + i] = CAST_OP(0xB1FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1DF + i] = CAST_OP(0xB1DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1E7 + i] = CAST_OP(0xB1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC000 + i + j] = CAST_OP(0xC000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC010 + i + j] = CAST_OP(0xC010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC018 + i + j] = CAST_OP(0xC018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC020 + i + j] = CAST_OP(0xC020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC028 + i + j] = CAST_OP(0xC028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC030 + i + j] = CAST_OP(0xC030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC038 + i] = CAST_OP(0xC038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC039 + i] = CAST_OP(0xC039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC03A + i] = CAST_OP(0xC03A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC03B + i] = CAST_OP(0xC03B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC03C + i] = CAST_OP(0xC03C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC01F + i] = CAST_OP(0xC01F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC027 + i] = CAST_OP(0xC027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC040 + i + j] = CAST_OP(0xC040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC050 + i + j] = CAST_OP(0xC050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC058 + i + j] = CAST_OP(0xC058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC060 + i + j] = CAST_OP(0xC060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC068 + i + j] = CAST_OP(0xC068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC070 + i + j] = CAST_OP(0xC070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC078 + i] = CAST_OP(0xC078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC079 + i] = CAST_OP(0xC079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC07A + i] = CAST_OP(0xC07A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC07B + i] = CAST_OP(0xC07B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC07C + i] = CAST_OP(0xC07C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC05F + i] = CAST_OP(0xC05F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC067 + i] = CAST_OP(0xC067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC080 + i + j] = CAST_OP(0xC080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC090 + i + j] = CAST_OP(0xC090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC098 + i + j] = CAST_OP(0xC098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0A0 + i + j] = CAST_OP(0xC0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0A8 + i + j] = CAST_OP(0xC0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0B0 + i + j] = CAST_OP(0xC0B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0B8 + i] = CAST_OP(0xC0B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0B9 + i] = CAST_OP(0xC0B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0BA + i] = CAST_OP(0xC0BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0BB + i] = CAST_OP(0xC0BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0BC + i] = CAST_OP(0xC0BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC09F + i] = CAST_OP(0xC09F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0A7 + i] = CAST_OP(0xC0A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC110 + i + j] = CAST_OP(0xC110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC118 + i + j] = CAST_OP(0xC118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC120 + i + j] = CAST_OP(0xC120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC128 + i + j] = CAST_OP(0xC128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC130 + i + j] = CAST_OP(0xC130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC138 + i] = CAST_OP(0xC138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC139 + i] = CAST_OP(0xC139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC11F + i] = CAST_OP(0xC11F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC127 + i] = CAST_OP(0xC127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC150 + i + j] = CAST_OP(0xC150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC158 + i + j] = CAST_OP(0xC158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC160 + i + j] = CAST_OP(0xC160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC168 + i + j] = CAST_OP(0xC168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC170 + i + j] = CAST_OP(0xC170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC178 + i] = CAST_OP(0xC178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC179 + i] = CAST_OP(0xC179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC15F + i] = CAST_OP(0xC15F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC167 + i] = CAST_OP(0xC167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC190 + i + j] = CAST_OP(0xC190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC198 + i + j] = CAST_OP(0xC198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1A0 + i + j] = CAST_OP(0xC1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1A8 + i + j] = CAST_OP(0xC1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1B0 + i + j] = CAST_OP(0xC1B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1B8 + i] = CAST_OP(0xC1B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1B9 + i] = CAST_OP(0xC1B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC19F + i] = CAST_OP(0xC19F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1A7 + i] = CAST_OP(0xC1A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC100 + i + j] = CAST_OP(0xC100); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xC108 + i + j] = CAST_OP(0xC108); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xC10F + i] = CAST_OP(0xC10F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xCF08 + i] = CAST_OP(0xCF08); + JumpTable[0xCF0F] = CAST_OP(0xCF0F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0C0 + i + j] = CAST_OP(0xC0C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0D0 + i + j] = CAST_OP(0xC0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0D8 + i + j] = CAST_OP(0xC0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0E0 + i + j] = CAST_OP(0xC0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0E8 + i + j] = CAST_OP(0xC0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0F0 + i + j] = CAST_OP(0xC0F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0F8 + i] = CAST_OP(0xC0F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0F9 + i] = CAST_OP(0xC0F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0FA + i] = CAST_OP(0xC0FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0FB + i] = CAST_OP(0xC0FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0FC + i] = CAST_OP(0xC0FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0DF + i] = CAST_OP(0xC0DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0E7 + i] = CAST_OP(0xC0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1C0 + i + j] = CAST_OP(0xC1C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1D0 + i + j] = CAST_OP(0xC1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1D8 + i + j] = CAST_OP(0xC1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1E0 + i + j] = CAST_OP(0xC1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1E8 + i + j] = CAST_OP(0xC1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1F0 + i + j] = CAST_OP(0xC1F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1F8 + i] = CAST_OP(0xC1F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1F9 + i] = CAST_OP(0xC1F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1FA + i] = CAST_OP(0xC1FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1FB + i] = CAST_OP(0xC1FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1FC + i] = CAST_OP(0xC1FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1DF + i] = CAST_OP(0xC1DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1E7 + i] = CAST_OP(0xC1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC140 + i + j] = CAST_OP(0xC140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC148 + i + j] = CAST_OP(0xC148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC188 + i + j] = CAST_OP(0xC188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD000 + i + j] = CAST_OP(0xD000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD008 + i + j] = CAST_OP(0xD008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD010 + i + j] = CAST_OP(0xD010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD018 + i + j] = CAST_OP(0xD018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD020 + i + j] = CAST_OP(0xD020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD028 + i + j] = CAST_OP(0xD028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD030 + i + j] = CAST_OP(0xD030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD038 + i] = CAST_OP(0xD038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD039 + i] = CAST_OP(0xD039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD03A + i] = CAST_OP(0xD03A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD03B + i] = CAST_OP(0xD03B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD03C + i] = CAST_OP(0xD03C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD01F + i] = CAST_OP(0xD01F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD027 + i] = CAST_OP(0xD027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD040 + i + j] = CAST_OP(0xD040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD048 + i + j] = CAST_OP(0xD048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD050 + i + j] = CAST_OP(0xD050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD058 + i + j] = CAST_OP(0xD058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD060 + i + j] = CAST_OP(0xD060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD068 + i + j] = CAST_OP(0xD068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD070 + i + j] = CAST_OP(0xD070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD078 + i] = CAST_OP(0xD078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD079 + i] = CAST_OP(0xD079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD07A + i] = CAST_OP(0xD07A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD07B + i] = CAST_OP(0xD07B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD07C + i] = CAST_OP(0xD07C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD05F + i] = CAST_OP(0xD05F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD067 + i] = CAST_OP(0xD067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD080 + i + j] = CAST_OP(0xD080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD088 + i + j] = CAST_OP(0xD088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD090 + i + j] = CAST_OP(0xD090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD098 + i + j] = CAST_OP(0xD098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0A0 + i + j] = CAST_OP(0xD0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0A8 + i + j] = CAST_OP(0xD0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0B0 + i + j] = CAST_OP(0xD0B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0B8 + i] = CAST_OP(0xD0B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0B9 + i] = CAST_OP(0xD0B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0BA + i] = CAST_OP(0xD0BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0BB + i] = CAST_OP(0xD0BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0BC + i] = CAST_OP(0xD0BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD09F + i] = CAST_OP(0xD09F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0A7 + i] = CAST_OP(0xD0A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD110 + i + j] = CAST_OP(0xD110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD118 + i + j] = CAST_OP(0xD118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD120 + i + j] = CAST_OP(0xD120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD128 + i + j] = CAST_OP(0xD128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD130 + i + j] = CAST_OP(0xD130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD138 + i] = CAST_OP(0xD138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD139 + i] = CAST_OP(0xD139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD11F + i] = CAST_OP(0xD11F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD127 + i] = CAST_OP(0xD127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD150 + i + j] = CAST_OP(0xD150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD158 + i + j] = CAST_OP(0xD158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD160 + i + j] = CAST_OP(0xD160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD168 + i + j] = CAST_OP(0xD168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD170 + i + j] = CAST_OP(0xD170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD178 + i] = CAST_OP(0xD178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD179 + i] = CAST_OP(0xD179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD15F + i] = CAST_OP(0xD15F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD167 + i] = CAST_OP(0xD167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD190 + i + j] = CAST_OP(0xD190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD198 + i + j] = CAST_OP(0xD198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1A0 + i + j] = CAST_OP(0xD1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1A8 + i + j] = CAST_OP(0xD1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1B0 + i + j] = CAST_OP(0xD1B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1B8 + i] = CAST_OP(0xD1B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1B9 + i] = CAST_OP(0xD1B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD19F + i] = CAST_OP(0xD19F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1A7 + i] = CAST_OP(0xD1A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD100 + i + j] = CAST_OP(0xD100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD140 + i + j] = CAST_OP(0xD140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD180 + i + j] = CAST_OP(0xD180); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xD108 + i + j] = CAST_OP(0xD108); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xD148 + i + j] = CAST_OP(0xD148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xD188 + i + j] = CAST_OP(0xD188); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xD10F + i] = CAST_OP(0xD10F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xD14F + i] = CAST_OP(0xD14F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xD18F + i] = CAST_OP(0xD18F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xDF08 + i] = CAST_OP(0xDF08); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xDF48 + i] = CAST_OP(0xDF48); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xDF88 + i] = CAST_OP(0xDF88); + JumpTable[0xDF0F] = CAST_OP(0xDF0F); + JumpTable[0xDF4F] = CAST_OP(0xDF4F); + JumpTable[0xDF8F] = CAST_OP(0xDF8F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0C0 + i + j] = CAST_OP(0xD0C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0C8 + i + j] = CAST_OP(0xD0C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0D0 + i + j] = CAST_OP(0xD0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0D8 + i + j] = CAST_OP(0xD0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0E0 + i + j] = CAST_OP(0xD0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0E8 + i + j] = CAST_OP(0xD0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0F0 + i + j] = CAST_OP(0xD0F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0F8 + i] = CAST_OP(0xD0F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0F9 + i] = CAST_OP(0xD0F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0FA + i] = CAST_OP(0xD0FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0FB + i] = CAST_OP(0xD0FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0FC + i] = CAST_OP(0xD0FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0DF + i] = CAST_OP(0xD0DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0E7 + i] = CAST_OP(0xD0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1C0 + i + j] = CAST_OP(0xD1C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1C8 + i + j] = CAST_OP(0xD1C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1D0 + i + j] = CAST_OP(0xD1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1D8 + i + j] = CAST_OP(0xD1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1E0 + i + j] = CAST_OP(0xD1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1E8 + i + j] = CAST_OP(0xD1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1F0 + i + j] = CAST_OP(0xD1F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1F8 + i] = CAST_OP(0xD1F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1F9 + i] = CAST_OP(0xD1F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1FA + i] = CAST_OP(0xD1FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1FB + i] = CAST_OP(0xD1FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1FC + i] = CAST_OP(0xD1FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1DF + i] = CAST_OP(0xD1DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1E7 + i] = CAST_OP(0xD1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE000 + i + j] = CAST_OP(0xE000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE040 + i + j] = CAST_OP(0xE040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE080 + i + j] = CAST_OP(0xE080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE008 + i + j] = CAST_OP(0xE008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE048 + i + j] = CAST_OP(0xE048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE088 + i + j] = CAST_OP(0xE088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE010 + i + j] = CAST_OP(0xE010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE050 + i + j] = CAST_OP(0xE050); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE090 + i + j] = CAST_OP(0xE090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE018 + i + j] = CAST_OP(0xE018); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE058 + i + j] = CAST_OP(0xE058); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE098 + i + j] = CAST_OP(0xE098); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE100 + i + j] = CAST_OP(0xE100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE140 + i + j] = CAST_OP(0xE140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE180 + i + j] = CAST_OP(0xE180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE108 + i + j] = CAST_OP(0xE108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE148 + i + j] = CAST_OP(0xE148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE188 + i + j] = CAST_OP(0xE188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE110 + i + j] = CAST_OP(0xE110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE150 + i + j] = CAST_OP(0xE150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE190 + i + j] = CAST_OP(0xE190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE118 + i + j] = CAST_OP(0xE118); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE158 + i + j] = CAST_OP(0xE158); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE198 + i + j] = CAST_OP(0xE198); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE020 + i + j] = CAST_OP(0xE020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE060 + i + j] = CAST_OP(0xE060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0A0 + i + j] = CAST_OP(0xE0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE028 + i + j] = CAST_OP(0xE028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE068 + i + j] = CAST_OP(0xE068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0A8 + i + j] = CAST_OP(0xE0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE030 + i + j] = CAST_OP(0xE030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE070 + i + j] = CAST_OP(0xE070); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0B0 + i + j] = CAST_OP(0xE0B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE038 + i + j] = CAST_OP(0xE038); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE078 + i + j] = CAST_OP(0xE078); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0B8 + i + j] = CAST_OP(0xE0B8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE120 + i + j] = CAST_OP(0xE120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE160 + i + j] = CAST_OP(0xE160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1A0 + i + j] = CAST_OP(0xE1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE128 + i + j] = CAST_OP(0xE128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE168 + i + j] = CAST_OP(0xE168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1A8 + i + j] = CAST_OP(0xE1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE130 + i + j] = CAST_OP(0xE130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE170 + i + j] = CAST_OP(0xE170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1B0 + i + j] = CAST_OP(0xE1B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE138 + i + j] = CAST_OP(0xE138); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE178 + i + j] = CAST_OP(0xE178); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1B8 + i + j] = CAST_OP(0xE1B8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE0D0 + i] = CAST_OP(0xE0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE0D8 + i] = CAST_OP(0xE0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE0E0 + i] =CAST_OP(0xE0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE0E8 + i] = CAST_OP(0xE0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE0F0 + i] = CAST_OP(0xE0F0); + JumpTable[0xE0F8] = CAST_OP(0xE0F8); + JumpTable[0xE0F9] = CAST_OP(0xE0F9); + JumpTable[0xE0DF] = CAST_OP(0xE0DF); + JumpTable[0xE0E7] = CAST_OP(0xE0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE2D0 + i] = CAST_OP(0xE2D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE2D8 + i] = CAST_OP(0xE2D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE2E0 + i] = CAST_OP(0xE2E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE2E8 + i] = CAST_OP(0xE2E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE2F0 + i] = CAST_OP(0xE2F0); + JumpTable[0xE2F8] = CAST_OP(0xE2F8); + JumpTable[0xE2F9] = CAST_OP(0xE2F9); + JumpTable[0xE2DF] = CAST_OP(0xE2DF); + JumpTable[0xE2E7] = CAST_OP(0xE2E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE4D0 + i] = CAST_OP(0xE4D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE4D8 + i] = CAST_OP(0xE4D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE4E0 + i] = CAST_OP(0xE4E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE4E8 + i] = CAST_OP(0xE4E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE4F0 + i] = CAST_OP(0xE4F0); + JumpTable[0xE4F8] = CAST_OP(0xE4F8); + JumpTable[0xE4F9] = CAST_OP(0xE4F9); + JumpTable[0xE4DF] = CAST_OP(0xE4DF); + JumpTable[0xE4E7] = CAST_OP(0xE4E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE6D0 + i] = CAST_OP(0xE6D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE6D8 + i] = CAST_OP(0xE6D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE6E0 + i] = CAST_OP(0xE6E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE6E8 + i] = CAST_OP(0xE6E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE6F0 + i] = CAST_OP(0xE6F0); + JumpTable[0xE6F8] = CAST_OP(0xE6F8); + JumpTable[0xE6F9] = CAST_OP(0xE6F9); + JumpTable[0xE6DF] = CAST_OP(0xE6DF); + JumpTable[0xE6E7] = CAST_OP(0xE6E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE1D0 + i] = CAST_OP(0xE1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE1D8 + i] = CAST_OP(0xE1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE1E0 + i] = CAST_OP(0xE1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE1E8 + i] = CAST_OP(0xE1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE1F0 + i] = CAST_OP(0xE1F0); + JumpTable[0xE1F8] = CAST_OP(0xE1F8); + JumpTable[0xE1F9] = CAST_OP(0xE1F9); + JumpTable[0xE1DF] = CAST_OP(0xE1DF); + JumpTable[0xE1E7] = CAST_OP(0xE1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE3D0 + i] = CAST_OP(0xE3D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE3D8 + i] = CAST_OP(0xE3D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE3E0 + i] = CAST_OP(0xE3E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE3E8 + i] = CAST_OP(0xE3E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE3F0 + i] = CAST_OP(0xE3F0); + JumpTable[0xE3F8] = CAST_OP(0xE3F8); + JumpTable[0xE3F9] = CAST_OP(0xE3F9); + JumpTable[0xE3DF] = CAST_OP(0xE3DF); + JumpTable[0xE3E7] = CAST_OP(0xE3E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE5D0 + i] = CAST_OP(0xE5D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE5D8 + i] = CAST_OP(0xE5D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE5E0 + i] = CAST_OP(0xE5E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE5E8 + i] = CAST_OP(0xE5E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE5F0 + i] = CAST_OP(0xE5F0); + JumpTable[0xE5F8] = CAST_OP(0xE5F8); + JumpTable[0xE5F9] = CAST_OP(0xE5F9); + JumpTable[0xE5DF] = CAST_OP(0xE5DF); + JumpTable[0xE5E7] = CAST_OP(0xE5E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE7D0 + i] = CAST_OP(0xE7D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE7D8 + i] = CAST_OP(0xE7D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE7E0 + i] = CAST_OP(0xE7E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE7E8 + i] = CAST_OP(0xE7E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE7F0 + i] = CAST_OP(0xE7F0); + JumpTable[0xE7F8] = CAST_OP(0xE7F8); + JumpTable[0xE7F9] = CAST_OP(0xE7F9); + JumpTable[0xE7DF] = CAST_OP(0xE7DF); + JumpTable[0xE7E7] = CAST_OP(0xE7E7); + for(i = 0x0000; i <= 0x0FFF; i += 0x0001) + JumpTable[0xF000 + i] = CAST_OP(0xF000); + + initialised = 1; +} + + diff --git a/cpu/fame/famec_opcodes.h b/cpu/fame/famec_opcodes.h new file mode 100644 index 00000000..a9cc9917 --- /dev/null +++ b/cpu/fame/famec_opcodes.h @@ -0,0 +1,39792 @@ + +// 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) +} + diff --git a/platform/common/lprintf.h b/platform/common/lprintf.h index 1d743236..dc49c655 100644 --- a/platform/common/lprintf.h +++ b/platform/common/lprintf.h @@ -2,7 +2,7 @@ #include #define lprintf printf #elif defined(PSP) - #if 0 + #if 1 #include #define lprintf printf #else diff --git a/platform/linux/Makefile b/platform/linux/Makefile index e3aac31f..6aed56e1 100644 --- a/platform/linux/Makefile +++ b/platform/linux/Makefile @@ -1,6 +1,7 @@ # settings -dprint = 1 +use_fame = 1 + # profile = 1 @@ -46,8 +47,13 @@ OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/i # 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 @@ -95,3 +101,7 @@ PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a @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 $@ + diff --git a/platform/psp/Makefile b/platform/psp/Makefile index 769f3edb..7a0cadae 100644 --- a/platform/psp/Makefile +++ b/platform/psp/Makefile @@ -3,7 +3,7 @@ PSPSDK = $(shell psp-config --pspsdk-path) # settings -use_musashi = 1 +#use_musashi = 1 use_mz80 = 1 amalgamate = 0 #profile = 1 @@ -13,7 +13,7 @@ amalgamate = 0 CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC # -DBENCHMARK CFLAGS += -Wall -Winline ifeq ($(DEBUG),) -CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math +CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -ffast-math else CFLAGS += -ggdb endif @@ -37,7 +37,7 @@ OBJS += ../../PicoAll.o else OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \ ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \ - ../../Pico/Patch.o + ../../Pico/Patch.o ../../Pico/Draw_amips.o # Pico - CD OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \ ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \ @@ -59,6 +59,9 @@ OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o ifeq "$(use_musashi)" "1" CFLAGS += -DEMU_M68K OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o +else +CFLAGS += -DEMU_F68K +OBJS += ../../cpu/fame/famec.o endif # z80 ifeq "$(use_mz80)" "1" @@ -69,7 +72,7 @@ $(error nothing here!) endif -LIBS += -lpng -lm -lpspgu # -lpspaudio -lpspgu -lpsppower -lpsphprm -lz -lm -lstdc++ +LIBS += -lpng -lm -lpspgu -lpsppower -Wl,-Map=PicoDrive.map # -lpspaudio -lpsphprm # target TARGET = PicoDrive @@ -82,12 +85,17 @@ CUSTOM_CLEAN = myclean include $(PSPSDK)/lib/build.mak - # some additional rules .c.o: @echo ">>>" $< $(CC) $(CFLAGS) -c $< -o $@ +AS := psp-as + +.s.o: + @echo ">>>" $< + $(AS) -march=allegrex -mtune=allegrex $< -o $@ + ../../cpu/musashi/m68kops.c : make -C ../../cpu/musashi @@ -97,6 +105,9 @@ readme.txt: ../../tools/textfilter ../base_readme.txt ../../tools/textfilter: ../../tools/textfilter.c make -C ../../tools/ textfilter +../../cpu/fame/famec.o : ../../cpu/fame/famec.c + @echo ">>>" $< + $(CC) $(CFLAGS) -Wno-unused -c $< -o $@ # ? up: EBOOT.PBP diff --git a/platform/psp/emu.c b/platform/psp/emu.c index 338ffa44..6c1b0508 100644 --- a/platform/psp/emu.c +++ b/platform/psp/emu.c @@ -3,6 +3,7 @@ #include // PATH_MAX #include +#include #include "psp.h" #include "menu.h" @@ -121,6 +122,7 @@ void emu_setDefaultConfig(void) 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; @@ -386,6 +388,9 @@ static void updateKeys(void) int i; keys = psp_pad_read(0); + if (keys & PSP_CTRL_HOME) + sceDisplayWaitVblankStart(); + if (keys & BTN_SELECT) engineState = PGS_Menu; @@ -498,6 +503,13 @@ void emu_Loop(void) 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; diff --git a/platform/psp/menu.c b/platform/psp/menu.c index c878f405..b2b3fc5f 100644 --- a/platform/psp/menu.c +++ b/platform/psp/menu.c @@ -1032,6 +1032,7 @@ menu_entry opt_entries[] = { "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 }, @@ -1102,6 +1103,9 @@ static void menu_opt_cust_draw(const menu_entry *entry, int x, int y, void *para } 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); @@ -1250,6 +1254,14 @@ static int menu_loop_options(void) } 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: diff --git a/platform/psp/port_config.h b/platform/psp/port_config.h index dcd50326..fe561325 100644 --- a/platform/psp/port_config.h +++ b/platform/psp/port_config.h @@ -6,6 +6,7 @@ #define CPU_CALL // draw.c +#define USE_BGR555 1 #define OVERRIDE_HIGHCOL 0 // draw2.c diff --git a/platform/psp/psp.c b/platform/psp/psp.c index 48e5e63e..e740f215 100644 --- a/platform/psp/psp.c +++ b/platform/psp/psp.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "psp.h" @@ -76,7 +77,8 @@ void psp_finish(void) 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; } @@ -108,6 +110,19 @@ unsigned int psp_pad_read(int blocking) 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" diff --git a/platform/psp/psp.h b/platform/psp/psp.h index e6d04ff1..07d4093c 100644 --- a/platform/psp/psp.h +++ b/platform/psp/psp.h @@ -15,6 +15,8 @@ extern void *psp_screen; 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 diff --git a/platform/psp/skin/background.png b/platform/psp/skin/background.png index cb6a3779..735ab647 100644 Binary files a/platform/psp/skin/background.png and b/platform/psp/skin/background.png differ