1 #include <math.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 
6 #include "sapGlobals.h"
7 
8 void cpuInit( void )
9 {
10 	cpuReg_PC = 0xFFFF;
11 	cpuReg_S = 0xFF;
12 	cpuReg_A = 0x00;
13 	cpuReg_X = 0x00;
14 	cpuReg_Y = 0x00;
15 	cpuSetFlags( 0x20 );
16 }
17 
18 
19 void cpuSetFlags( BYTE flags )
20 {
21 	cpuFlag_N = flags;
22 	cpuFlag_V = (flags>>6)&1;
23 	cpuFlag_B = (flags>>4)&1;
24 	cpuFlag_D = (flags>>3)&1;
25 	cpuFlag_I = (flags>>2)&1;
26 	cpuFlag_Z = (flags&2)==0 ? 1:0;
27 	cpuFlag_C = flags&1;
28 }
29 
30 
31 BYTE cpuGetFlags( void )
32 {
33 BYTE flags;
34 
35 	flags = (cpuFlag_N&0x80) | ((cpuFlag_V&1)<<6) | 0x20 | ((cpuFlag_B&1)<<4) | ((cpuFlag_D&1)<<3) | ((cpuFlag_I&1)<<2) | (cpuFlag_Z==0 ? 2:0) | (cpuFlag_C&1);
36 	return flags;
37 }
38 
39 #define CPY		{\
40 					cB ^= 255;\
41 					int cpuIntValue2;\
42 					cpuIntValue2 = ((int)cpuReg_Y) + ((int)cB) + 1;\
43 					cpuFlag_N = cpuFlag_Z = (BYTE)cpuIntValue2; cpuFlag_C = (BYTE)(cpuIntValue2>>8);\
44 					cpuFlag_V = (( ((cpuReg_Y^cB)^0x80) & (cpuReg_Y^cpuIntValue2) & 0x80))&0x80 ? 1:0;\
runShellCommand(QString cmd)45 				}
46 #define CMP		{\
47 					cB ^= 255;\
48 					int cpuIntValue2;\
49 					cpuIntValue2 = ((int)cpuReg_A) + ((int)cB) + 1;\
50 					cpuFlag_N = cpuFlag_Z = (BYTE)cpuIntValue2; cpuFlag_C = (BYTE)(cpuIntValue2>>8);\
51 					cpuFlag_V = (( ((cpuReg_A^cB)^0x80) & (cpuReg_A^cpuIntValue2) & 0x80))&0x80 ? 1:0;\
52 				}
53 #define CPX		{\
54 					cB ^= 255;\
55 					int cpuIntValue2;\
56 					cpuIntValue2 = ((int)cpuReg_X) + ((int)cB) + 1;\
57 					cpuFlag_N = cpuFlag_Z = (BYTE)cpuIntValue2; cpuFlag_C = (BYTE)(cpuIntValue2>>8);\
58 					cpuFlag_V = (( ((cpuReg_X^cB)^0x80) & (cpuReg_X^cpuIntValue2) & 0x80))&0x80 ? 1:0;\
59 				}
60 
61 #define DECCMP	{\
62 					cB--;\
63 					int cpuIntValue2;\
64 					cpuIntValue2 = ((int)cpuReg_A) + ((int)cB^255) + 1;\
65 					cpuFlag_N = cpuFlag_Z = (BYTE)cpuIntValue2; cpuFlag_C = (BYTE)(cpuIntValue2>>8);\
trayActivated()66 					cpuFlag_V = (( ((cpuReg_A^cB^255)^0x80) & (cpuReg_A^cpuIntValue2) & 0x80))&0x80 ? 1:0;\
67 				}
68 #define DEC		{ cB--; cpuFlag_N = cpuFlag_Z = cB; }
69 #define INC		{ cB++; cpuFlag_N = cpuFlag_Z = cB; }
70 #define	AND		{ cpuReg_A &= cB; cpuFlag_N = cpuFlag_Z = cpuReg_A; }
openMixerGUI()71 #define	ASL		{ cpuFlag_C = cB>>7; cB<<=1; cpuFlag_N = cpuFlag_Z = cB; }
72 #define	EOR		{ cpuReg_A ^= cB; cpuFlag_N = cpuFlag_Z = cpuReg_A; }
73 #define	ORA		{ cpuReg_A |= cB; cpuFlag_N = cpuFlag_Z = cpuReg_A; }
74 #define ADC		{\
75 					if( cpuFlag_D&1 )\
76 					{\
closeTray()77 						BYTE al,ah;\
78 						al = (cpuReg_A & 0x0f) + (cB & 0x0f) + (cpuFlag_C&1);\
79 						if (al > 9) al += 6;\
80 						ah = ((cpuReg_A >> 4)&0x0F) + ((cB >> 4)&0x0F); if (al > 0x0f) ah++;\
hoverDisable(QAction * action)81 						cpuFlag_N = cpuFlag_Z =  cpuReg_A + cB + (cpuFlag_C&1);\
82 						cpuFlag_V = (((ah << 4) ^ cpuReg_A) & 0x80) && !((cpuReg_A ^ cB) & 0x80) ? 1:0;\
83 						if (ah > 9) ah += 6; cpuFlag_C = (ah > 0x0f) ? 1:0; cpuReg_A = (ah << 4) | (al & 0x0f);\
84 					}\
85 					else\
86 					{\
muteClicked()87 						WORD te;\
88 						te = cpuReg_A + cB + (cpuFlag_C&1);\
89 						cpuFlag_C = (BYTE)(te>>8);\
90 						cpuFlag_V = (( ((cpuReg_A^cB)^0x80) & (cpuReg_A^te) & 0x80)) ? 1:0;\
91 						cpuFlag_N = cpuFlag_Z = cpuReg_A = (BYTE)te;\
92 					}\
93 				}
94 #define SBC		{\
sliderChanged(int value)95 					if( cpuFlag_D&1 )\
96 					{\
97 						BYTE al,ah; unsigned int tmp; tmp = (DWORD)cpuReg_A - (DWORD)cB - (WORD)((cpuFlag_C&1)^1);\
98 						al = (cpuReg_A & 0x0f) - (cB & 0x0f) - ((cpuFlag_C&1)^1);\
99 						ah = ((cpuReg_A >> 4)&0x0F) - ((cB >> 4)&0x0F); if (al & 0x10) { al -= 6; ah--; } if (ah & 0x10) ah -= 6;\
100 						cpuFlag_C = (tmp < (unsigned int)0x100) ? 1:0; cpuFlag_N = cpuFlag_Z = (BYTE)tmp;\
101 						cpuFlag_V = (((cpuReg_A ^ tmp) & 0x80) && ((cpuReg_A ^ cB) & 0x80) ) ? 1:0;\
102 						cpuReg_A = (ah << 4) | (al & 0x0f);\
103 					}\
104 					else\
105 					{\
slotSingleInstance()106 						WORD te;\
107 						te = cpuReg_A + (cB^255) + (cpuFlag_C&1);\
108 						cpuFlag_C = (BYTE)(te>>8);\
109 						cpuFlag_V = (( ((cpuReg_A^cB^255)^0x80) & (cpuReg_A^te) & 0x80)) ? 1:0;\
110 						cpuFlag_N = cpuFlag_Z = cpuReg_A = (BYTE)te;\
111 					}\
112 				}
113 #define INCSBC	{\
114 					cB++;\
115 					if( cpuFlag_D&1 )\
116 					{\
event(QEvent * event)117 						BYTE al,ah; unsigned int tmp; tmp = (DWORD)cpuReg_A - (DWORD)cB - (WORD)((cpuFlag_C&1)^1);\
118 						al = (cpuReg_A & 0x0f) - (cB & 0x0f) - ((cpuFlag_C&1)^1);\
119 						ah = ((cpuReg_A >> 4)&0x0F) - ((cB >> 4)&0x0F); if (al & 0x10) { al -= 6; ah--; } if (ah & 0x10) ah -= 6;\
120 						cpuFlag_C = (tmp < (unsigned int)0x100) ? 1:0; cpuFlag_N = cpuFlag_Z = (BYTE)tmp;\
121 						cpuFlag_V = (((cpuReg_A ^ tmp) & 0x80) && ((cpuReg_A ^ cB) & 0x80) ) ? 1:0;\
122 						cpuReg_A = (ah << 4) | (al & 0x0f);\
123 					}\
124 					else\
125 					{\
126 						WORD te;\
127 						te = cpuReg_A + (cB^255) + (cpuFlag_C&1);\
128 						cpuFlag_C = (BYTE)(te>>8);\
129 						cpuFlag_V = (( ((cpuReg_A^cB^255)^0x80) & (cpuReg_A^te) & 0x80)) ? 1:0;\
130 						cpuFlag_N = cpuFlag_Z = cpuReg_A = (BYTE)te;\
131 					}\
132 				}
133 
134 #define ROL		{ BYTE cFlag; cFlag = cB>>7; cB = (cB<<1) + (cpuFlag_C&1); cpuFlag_C = cFlag; cpuFlag_N = cpuFlag_Z = cB; }
135 #define ROR		{ BYTE cFlag; cFlag = cB; cB = (cB>>1) + (cpuFlag_C<<7); cpuFlag_C = cFlag; cpuFlag_N = cpuFlag_Z = cB; }
136 #define LSR		{ cpuFlag_C = cB; cB>>=1; cpuFlag_N = cpuFlag_Z = cB; }
137 #define	ASLORA	{ cpuFlag_C = cB>>7; cB<<=1; cpuReg_A |= cB; cpuFlag_N = cpuFlag_Z = cpuReg_A; }
138 #define	ROLAND	{ BYTE cFlag; cFlag = cB>>7; cB = (cB<<1) + (cpuFlag_C&1); cpuFlag_C = cFlag; cpuReg_A &= cB; cpuFlag_N = cpuFlag_Z = cpuReg_A; }
139 #define LSREOR	{ cpuFlag_C = cB; cB>>=1; cpuReg_A ^= cB; cpuFlag_N = cpuFlag_Z = cpuReg_A; }
140 #define RORADC	{\
141 					BYTE cC = cB; cB = (cB>>1) + (cpuFlag_C<<7); cpuFlag_C = cC;\
142 					if( cpuFlag_D&1 )\
143 					{\
144 						BYTE al,ah;\
145 						al = (cpuReg_A & 0x0f) + (cB & 0x0f) + (cpuFlag_C&1);\
146 						if (al > 9) al += 6;\
147 						ah = ((cpuReg_A >> 4)&0x0F) + ((cB >> 4)&0x0F); if (al > 0x0f) ah++;\
148 						cpuFlag_N = cpuFlag_Z =  cpuReg_A + cB + (cpuFlag_C&1);\
149 						cpuFlag_V = (((ah << 4) ^ cpuReg_A) & 0x80) && !((cpuReg_A ^ cB) & 0x80) ? 1:0;\
150 						if (ah > 9) ah += 6; cpuFlag_C = (ah > 0x0f) ? 1:0; cpuReg_A = (ah << 4) | (al & 0x0f);\
151 					}\
152 					else\
153 					{\
154 						WORD te;\
155 						te = cpuReg_A + cB + (cpuFlag_C&1);\
156 						cpuFlag_C = (BYTE)(te>>8);\
157 						cpuFlag_V = (( ((cpuReg_A^cB)^0x80) & (cpuReg_A^te) & 0x80)) ? 1:0;\
158 						cpuFlag_N = cpuFlag_Z = cpuReg_A = (BYTE)te;\
159 					}\
160 				}
161 
162 #define CondJump( a ) cpuReg_PC += (a) ? (WORD)(signed short int)(signed char)atariMem[cpuReg_PC+1]+2:2;
163 
164 //-------
165 
166 #define FREDDIEWRITEBYTE(ad,val)\
167 	{\
168 		if( (ad&0xFF00)==0xD200 )\
169 		{\
170 			if( isStereo==false )\
171 				pokeyWriteByte0( ad, val );\
172 			else if( (ad&0x10)==0 )\
173 				pokeyWriteByte0( ad, val );\
174 			else\
175 				pokeyWriteByte1( ad, val );\
176 		}\
177 		else if( ad==0xD40A )\
178 			holded = true;\
179 		else atariMem[ad] = val;\
180 	}
181 
182 #define Load_IMD(a)		BYTE cB; {																							cB = atariMem[cpuReg_PC+1]; cpuReg_PC+=2; a; }
183 #define Load_ZP(a)		BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1];															cB = atariMem[cA];	cpuReg_PC+=2; a; }
184 #define Load_ZPX(a)		BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1]+cpuReg_X;													cB = atariMem[cA];	cpuReg_PC+=2; a; }
185 #define Load_ZPY(a)		BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1]+cpuReg_Y;													cB = atariMem[cA];	cpuReg_PC+=2; a; }
186 #define Load_ABS(a)		BYTE cB; { WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0];											cB = freddieReadByte(cWA); cpuReg_PC+=3; a; }
187 #define Load_ABSX(a)	BYTE cB; { WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_X;							cB = freddieReadByte(cWA); cpuReg_PC+=3; a; }
188 #define Load_ABSY(a)	BYTE cB; { WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_Y;							cB = freddieReadByte(cWA); cpuReg_PC+=3; a; }
189 #define Load_PreX(a)	BYTE cB; { BYTE cA=(atariMem[cpuReg_PC+1]+cpuReg_X)&255; WORD cWA = ((WORD*)&atariMem[cA])[0];		cB = freddieReadByte(cWA); cpuReg_PC+=2; a; }
190 #define Load_PostY(a)	BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1]; WORD cWA = ((WORD*)&atariMem[cA])[0] + (WORD)cpuReg_Y;	cB = freddieReadByte(cWA); cpuReg_PC+=2; a; }
191 
192 #define LoadReg_IMD(a)		{																							a = cpuFlag_N = cpuFlag_Z = atariMem[cpuReg_PC+1]; cpuReg_PC+=2; }
193 #define LoadReg_ZP(a)		{ BYTE cA=atariMem[cpuReg_PC+1];															a = cpuFlag_N = cpuFlag_Z = atariMem[cA];	cpuReg_PC+=2; }
194 #define LoadReg_ZPX(a)		{ BYTE cA=atariMem[cpuReg_PC+1]+cpuReg_X;													a = cpuFlag_N = cpuFlag_Z = atariMem[cA];	cpuReg_PC+=2; }
195 #define LoadReg_ZPY(a)		{ BYTE cA=atariMem[cpuReg_PC+1]+cpuReg_Y;													a = cpuFlag_N = cpuFlag_Z = atariMem[cA];	cpuReg_PC+=2; }
196 #define LoadReg_ABS(a)		{ WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0];											a = cpuFlag_N = cpuFlag_Z = freddieReadByte(cWA); cpuReg_PC+=3; }
197 #define LoadReg_ABSX(a)		{ WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_X;							a = cpuFlag_N = cpuFlag_Z = freddieReadByte(cWA); cpuReg_PC+=3; }
198 #define LoadReg_ABSY(a)		{ WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_Y;							a = cpuFlag_N = cpuFlag_Z = freddieReadByte(cWA); cpuReg_PC+=3; }
199 #define LoadReg_PreX(a)		{ BYTE cA=(atariMem[cpuReg_PC+1]+cpuReg_X)&255; WORD cWA = ((WORD*)&atariMem[cA])[0];		a = cpuFlag_N = cpuFlag_Z = freddieReadByte(cWA); cpuReg_PC+=2; }
200 #define LoadReg_PostY(a)	{ BYTE cA=atariMem[cpuReg_PC+1]; WORD cWA = ((WORD*)&atariMem[cA])[0] + (WORD)cpuReg_Y;		a = cpuFlag_N = cpuFlag_Z = freddieReadByte(cWA); cpuReg_PC+=2; }
201 
202 #define Modify_ZP(a)	BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1];															cB = atariMem[cA];	cpuReg_PC+=2; a; atariMem[cA] = cB; }
203 #define Modify_ZPX(a)	BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1]+cpuReg_X;													cB = atariMem[cA];	cpuReg_PC+=2; a; atariMem[cA] = cB; }
204 #define Modify_ABS(a)	BYTE cB; { WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0];											cB = freddieReadByte(cWA); cpuReg_PC+=3; a; FREDDIEWRITEBYTE(cWA,cB); }
205 #define Modify_ABSX(a)	BYTE cB; { WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_X;							cB = freddieReadByte(cWA); cpuReg_PC+=3; a; FREDDIEWRITEBYTE(cWA,cB); }
206 #define Modify_ABSY(a)	BYTE cB; { WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_Y;							cB = freddieReadByte(cWA); cpuReg_PC+=3; a; FREDDIEWRITEBYTE(cWA,cB); }
207 #define Modify_PreX(a)	BYTE cB; { BYTE cA=(atariMem[cpuReg_PC+1]+cpuReg_X)&255; WORD cWA = ((WORD*)&atariMem[cA])[0];		cB = freddieReadByte(cWA); cpuReg_PC+=2; a; FREDDIEWRITEBYTE(cWA,cB); }
208 #define Modify_PostY(a)	BYTE cB; { BYTE cA=atariMem[cpuReg_PC+1]; WORD cWA = ((WORD*)&atariMem[cA])[0] + (WORD)cpuReg_Y;	cB = freddieReadByte(cWA); cpuReg_PC+=2; a; FREDDIEWRITEBYTE(cWA,cB); }
209 
210 #define Store_ZP(a)		{ BYTE cA=atariMem[cpuReg_PC+1];															cpuReg_PC+=2;	atariMem[cA] = a; }
211 #define Store_ZPX(a)	{ BYTE cA=atariMem[cpuReg_PC+1]+cpuReg_X;													cpuReg_PC+=2;	atariMem[cA] = a; }
212 #define Store_ABS(a)	{ WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0];											cpuReg_PC+=3;	FREDDIEWRITEBYTE(cWA,a); }
213 #define Store_ABSX(a)	{ WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_X;							cpuReg_PC+=3;	FREDDIEWRITEBYTE(cWA,a); }
214 #define Store_ABSY(a)	{ WORD cWA = ((WORD*)&atariMem[cpuReg_PC+1])[0] + (WORD)cpuReg_Y;							cpuReg_PC+=3;	FREDDIEWRITEBYTE(cWA,a); }
215 #define Store_PreX(a)	{ BYTE cA=(atariMem[cpuReg_PC+1]+cpuReg_X)&255; WORD cWA = ((WORD*)&atariMem[cA])[0];		cpuReg_PC+=2;	FREDDIEWRITEBYTE(cWA,a); }
216 #define Store_PostY(a)	{ BYTE cA=atariMem[cpuReg_PC+1]; WORD cWA = ((WORD*)&atariMem[cA])[0] + (WORD)cpuReg_Y;		cpuReg_PC+=2;	FREDDIEWRITEBYTE(cWA,a); }
217 
218 int opcode_0x00(bool &holded)	/* 0x00 - BRK				7 cycles	*/
219 {
220 	cpuReg_PC++;
221 	return 20;
222 }
223 int opcode_0x01(bool &holded)	/* 0x01 - ORA (,X)			6 cycles	*/
224 {
225 	Load_PreX( ORA );
226 	return 6;
227 }
228 int opcode_0x02(bool &holded)	/* 0x02 - ...				hang		*/
229 {
230 	return 20;
231 }
232 int opcode_0x03(bool &holded)	/* 0x03 - ASL:ORA (,X)		8 cycles	*/
233 {
234 	Modify_PreX( ASLORA );
235 	return 8;
236 }
237 int opcode_0x04(bool &holded)	/* 0x04 - NOP2				3 cycles	*/
238 {
239 	cpuReg_PC+=2;
240 	return 3;
241 }
242 int opcode_0x05(bool &holded)	/* 0x05 - ORA ZP			3 cycles	*/
243 {
244 	Load_ZP( ORA );
245 	return 3;
246 }
247 int opcode_0x06(bool &holded)	/* 0x06 - ASL ZP			5 cycles	*/
248 {
249 	Modify_ZP( ASL )
250 	return 5;
251 }
252 int opcode_0x07(bool &holded)	/* 0x07 - ASL:ORA ZP		5 cycles	*/
253 {
254 	Modify_ZP( ASLORA )
255 	return 5;
256 }
257 int opcode_0x08(bool &holded)	/* 0x08 - PHP				3 cycles	*/
258 {
259 BYTE te;
260 	cpuReg_PC++;
261 	te = (cpuFlag_N&0x80) | ((cpuFlag_V&1)<<6) | 0x20 | ((cpuFlag_B&1)<<4) | ((cpuFlag_D&1)<<3) | ((cpuFlag_I&1)<<2) | (cpuFlag_Z==0 ? 2:0) | (cpuFlag_C&1);
262 	atariMem[0x100 + cpuReg_S] = te; cpuReg_S--;
263 	return 3;
264 }
265 int opcode_0x09(bool &holded)	/* 0x09 - ORA #				2 cycles	*/
266 {
267 	Load_IMD( ORA );
268 	return 2;
269 }
270 int opcode_0x0A(bool &holded)	/* 0x0A - ASL @				2 cycles	*/
271 {
272 	cpuReg_PC++;
273 	cpuFlag_C = cpuReg_A>>7; cpuReg_A<<=1; cpuFlag_N = cpuFlag_Z = cpuReg_A;
274 	return 2;
275 }
276 int opcode_0x0B(bool &holded)	/* 0x0B - ????							*/
277 {
278 	return 20;
279 }
280 int opcode_0x0C(bool &holded)	/* 0x0C - NOP3				4 cycles	*/
281 {
282 	cpuReg_PC+=3;
283 	return 4;
284 }
285 int opcode_0x0D(bool &holded)	/* 0x0D - ORA ABS			4 cycles	*/
286 {
287 	Load_ABS( ORA );
288 	return 4;
289 }
290 int opcode_0x0E(bool &holded)	/* 0x0E - ASL ABS			6 cycles	*/
291 {
292 	Modify_ABS( ASL );
293 	return 6;
294 }
295 int opcode_0x0F(bool &holded)	/* 0x0F - ASL:ORA ABS		6 cycles	*/
296 {
297 	Modify_ABS( ASLORA );
298 	return 6;
299 }
300 int opcode_0x10(bool &holded)	/* 0x10 - BPL				2-4 cycles	*/
301 {
302 	CondJump( (cpuFlag_N&0x80)==0 );
303 	return 3;
304 }
305 int opcode_0x11(bool &holded)	/* 0x11 - ORA (),Y			5,6 cycles	*/
306 {
307 	Load_PostY( ORA );
308 	return 5;
309 }
310 int opcode_0x12(bool &holded)	/* 0x12 - ...				hang		*/
311 {
312 	return 20;
313 }
314 int opcode_0x13(bool &holded)	/* 0x13 - ASL:ORA (),Y		8 cycles	*/
315 {
316 	Modify_PostY( ASLORA );
317 	return 8;
318 }
319 int opcode_0x14(bool &holded)	/* 0x14 - NOP2							*/
320 {
321 	cpuReg_PC+=2;
322 	return 3;
323 }
324 int opcode_0x15(bool &holded)	/* 0x15 - ORA ZP,X			4 cycles	*/
325 {
326 	Load_ZPX( ORA );
327 	return 4;
328 }
329 int opcode_0x16(bool &holded)	/* 0x16 - ASL ZP,X			6 cycles	*/
330 {
331 	Modify_ZPX( ASL );
332 	return 6;
333 }
334 int opcode_0x17(bool &holded)	/* 0x17 - ASL:ORA ZP,X		6 cycles	*/
335 {
336 	Modify_ZPX( ASLORA );
337 	return 6;
338 }
339 int opcode_0x18(bool &holded)	/* 0x18 - CLC				2 cycles	*/
340 {
341 	cpuReg_PC++;
342 	cpuFlag_C = 0;
343 	return 2;
344 }
345 int opcode_0x19(bool &holded)	/* 0x19 - ORA ABS,Y			4,5 cycles	*/
346 {
347 	Load_ABSY( ORA );
348 	return 4;
349 }
350 int opcode_0x1A(bool &holded)	/* 0x1A - NOP1				2 cycles	*/
351 {
352 	cpuReg_PC++;
353 	return 2;
354 }
355 int opcode_0x1B(bool &holded)	/* 0x1B - ASL:ORA ABS,Y		7 cycles	*/
356 {
357 	Modify_ABSY( ASLORA );
358 	return 7;
359 }
360 int opcode_0x1C(bool &holded)	/* 0x1C - NOP3				7 cycles	*/
361 {
362 	cpuReg_PC+=3;
363 	return 7;
364 }
365 int opcode_0x1D(bool &holded)	/* 0x1D - ORA ABS,X			4,5 cycles	*/
366 {
367 	Load_ABSX( ORA );
368 	return 4;
369 }
370 int opcode_0x1E(bool &holded)	/* 0x1E - ASL ABS,X			7 cycles	*/
371 {
372 	Modify_ABSX( ASL );
373 	return 7;
374 }
375 int opcode_0x1F(bool &holded)	/* 0x1F - ASL:ORA ABS,X		7 cycles	*/
376 {
377 	Modify_ABSX( ASLORA );
378 	return 7;
379 }
380 int opcode_0x20(bool &holded)	/* 0x20 - JSR ABS			6 cycles	*/
381 {
382 	cpuReg_PC+=2;
383 	atariMem[0x100 + cpuReg_S] = (cpuReg_PC>>8)&0xFF; cpuReg_S--;
384 	atariMem[0x100 + cpuReg_S] = cpuReg_PC&0xFF; cpuReg_S--;
385 	cpuReg_PC = ((WORD*)&atariMem[cpuReg_PC-1])[0];
386 	return 6;
387 }
388 int opcode_0x21(bool &holded)	/* 0x21 - AND (,X)			6 cycles	*/
389 {
390 	Load_PreX( AND );
391 	return 6;
392 }
393 int opcode_0x22(bool &holded)	/* 0x22 - ...				hang		*/
394 {
395 	return 20;
396 }
397 int opcode_0x23(bool &holded)	/* 0x23 - ROL:AND (,X)		8 cycles	*/
398 {
399 	Modify_PreX( ROLAND );
400 	return 8;
401 }
402 int opcode_0x24(bool &holded)	/* 0x24 - BIT ZP			3 cycles	*/
403 {
404 BYTE cb;
405 	cb = atariMem[cpuReg_PC+1];
406 	cpuFlag_Z = cb&cpuReg_A; cpuFlag_N = cb; cpuFlag_V = cb>>6;
407 	cpuReg_PC+=2;
408 	return 3;
409 }
410 int opcode_0x25(bool &holded)	/* 0x25 - AND ZP			3 cycles	*/
411 {
412 	Load_ZP( AND );
413 	return 3;
414 }
415 int opcode_0x26(bool &holded)	/* 0x26 - ROL ZP			5 cycles	*/
416 {
417 	Modify_ZP( ROL );
418 	return 5;
419 }
420 int opcode_0x27(bool &holded)	/* 0x27 - ROL:AND ZP		5 cycles	*/
421 {
422 	Modify_ZP( ROLAND );
423 	return 5;
424 }
425 int opcode_0x28(bool &holded)	/* 0x28 - PLP				4 cycles	*/
426 {
427 BYTE te;
428 	cpuReg_PC++; cpuReg_S++; te = atariMem[0x100 + cpuReg_S];
429 	cpuFlag_N = te; cpuFlag_V = (te>>6)&1; cpuFlag_B = (te>>4)&1; cpuFlag_D = (te>>3)&1; cpuFlag_I = (te>>2)&1; cpuFlag_Z = (te&2)^2; cpuFlag_C = te&1;
430 	pokeyGenerateCheckIRQline();
431 	return 4;
432 }
433 int opcode_0x29(bool &holded)	/* 0x29 - AND #				2 cycles	*/
434 {
435 	Load_IMD( AND );
436 	return 2;
437 }
438 int opcode_0x2A(bool &holded)	/* 0x2A - ROL @				2 cycles	*/
439 {
440 BYTE cC;
441 	cpuReg_PC++;
442 	cC = cpuReg_A>>7; cpuReg_A = (cpuReg_A<<1) + (cpuFlag_C&1); cpuFlag_C = cC; cpuFlag_N = cpuFlag_Z = cpuReg_A;
443 	return 2;
444 }
445 int opcode_0x2B(bool &holded)	/* 0x2B - ????							*/
446 {
447 	return 20;
448 }
449 int opcode_0x2C(bool &holded)	/* 0x2C - BIT ABS			4 cycles	*/
450 {
451 BYTE cb;
452 	cb = atariMem[((WORD*)&atariMem[cpuReg_PC+1])[0]];
453 	cpuFlag_Z = cb&cpuReg_A; cpuFlag_N = cb; cpuFlag_V = cb>>6;
454 	cpuReg_PC+=3;
455 	return 4;
456 }
457 int opcode_0x2D(bool &holded)	/* 0x2D - AND ABS			4 cycles	*/
458 {
459 	Load_ABS( AND );
460 	return 4;
461 }
462 int opcode_0x2E(bool &holded)	/* 0x2E - ROL ABS			6 cycles	*/
463 {
464 	Modify_ABS( ROL );
465 	return 6;
466 }
467 int opcode_0x2F(bool &holded)	/* 0x2F - ROL:AND ABS		6 cycles	*/
468 {
469 	Modify_ABS( ROLAND );
470 	return 6;
471 }
472 int opcode_0x30(bool &holded)	/* 0x30 - BMI				2-4 cycles	*/
473 {
474 	CondJump( (cpuFlag_N&0x80) );
475 	return 2;
476 }
477 int opcode_0x31(bool &holded)	/* 0x31 - AND (),Y			5,6 cycles	*/
478 {
479 	Load_PostY( AND );
480 	return 5;
481 }
482 int opcode_0x32(bool &holded)	/* 0x32 - ...				hang		*/
483 {
484 	return 20;
485 }
486 int opcode_0x33(bool &holded)	/* 0x33 - ROL:AND (),Y		8 cycles	*/
487 {
488 	Modify_PostY( ROLAND );
489 	return 8;
490 }
491 int opcode_0x34(bool &holded)	/* 0x34 - NOP2						*/
492 {
493 	cpuReg_PC+=2;
494 	return 8;
495 }
496 int opcode_0x35(bool &holded)	/* 0x35 - AND ZP,X			4 cycles	*/
497 {
498 	Load_ZPX( AND );
499 	return 4;
500 }
501 int opcode_0x36(bool &holded)	/* 0x36 - ROL ZP,X			6 cycles	*/
502 {
503 	Modify_ZPX( ROL );
504 	return 6;
505 }
506 int opcode_0x37(bool &holded)	/* 0x37 - ROL:AND ZP,X		6 cycles	*/
507 {
508 	Modify_ZPX( ROLAND );
509 	return 6;
510 }
511 int opcode_0x38(bool &holded)	/* 0x38 - SEC				2 cycles	*/
512 {
513 	cpuReg_PC++;
514 	cpuFlag_C = 1;
515 	return 2;
516 }
517 int opcode_0x39(bool &holded)	/* 0x39 - AND ABS,Y			4,5 cycles	*/
518 {
519 	Load_ABSY( AND );
520 	return 4;
521 }
522 int opcode_0x3A(bool &holded)	/* 0x3A - NOP1						*/
523 {
524 	cpuReg_PC++;
525 	return 2;
526 }
527 int opcode_0x3B(bool &holded)	/* 0x3B - ROL:AND ABS,Y		7 cycles	*/
528 {
529 	Modify_ABSY( ROLAND );
530 	return 7;
531 }
532 int opcode_0x3C(bool &holded)	/* 0x3C - NOP3						*/
533 {
534 	cpuReg_PC+=3;
535 	return 4;
536 }
537 int opcode_0x3D(bool &holded)	/* 0x3D - AND ABS,X			4,5 cycles	*/
538 {
539 	Load_ABSX( AND );
540 	return 4;
541 }
542 int opcode_0x3E(bool &holded)	/* 0x3E - ROL ABS,X			7 cycles	*/
543 {
544 	Modify_ABSX( ROL );
545 	return 7;
546 }
547 int opcode_0x3F(bool &holded)	/* 0x3F - ROL:AND ABS,X		7 cycles	*/
548 {
549 	Modify_ABSX( ROLAND );
550 	return 7;
551 }
552 int opcode_0x40(bool &holded)	/* 0x40 - RTI				6 cycles	*/
553 {
554 BYTE te;
555 	cpuReg_PC++;
556 	cpuReg_S++; te = atariMem[0x100 + cpuReg_S];
557 	cpuFlag_N = te; cpuFlag_V = (te>>6)&1; cpuFlag_B = (te>>4)&1; cpuFlag_D = (te>>3)&1; cpuFlag_I = (te>>2)&1; cpuFlag_Z = (te&2)^2; cpuFlag_C = te&1;
558 	cpuReg_S++; cpuReg_PC =  (WORD)atariMem[0x100 + cpuReg_S];
559 	cpuReg_S++; cpuReg_PC+= ((WORD)atariMem[0x100 + cpuReg_S])*256;
560 	return 6;
561 }
562 int opcode_0x41(bool &holded)	/* 0x41 - EOR (,X)			6 cycles	*/
563 {
564 	Load_PreX( EOR );
565 	return 6;
566 }
567 int opcode_0x42(bool &holded)	/* 0x42 - ...				hang		*/
568 {
569 	return 20;
570 }
571 int opcode_0x43(bool &holded)	/* 0x43 - LSR:EOR (,X)		8 cycles	*/
572 {
573 	Modify_PreX( LSREOR );
574 	return 8;
575 }
576 int opcode_0x44(bool &holded)	/* 0x44 - NOP2				3 cycles	*/
577 {
578 	cpuReg_PC+=2;
579 	return 3;
580 }
581 int opcode_0x45(bool &holded)	/* 0x45 - EOR ZP			3 cycles	*/
582 {
583 	Load_ZP( EOR );
584 	return 3;
585 }
586 int opcode_0x46(bool &holded)	/* 0x46 - LSR ZP			5 cycles	*/
587 {
588 	Modify_ZP( LSR );
589 	return 5;
590 }
591 int opcode_0x47(bool &holded)	/* 0x47 - LSR:EOR ZP		5 cycles	*/
592 {
593 	Modify_ZP( LSREOR );
594 	return 5;
595 }
596 int opcode_0x48(bool &holded)	/* 0x48 - PHA				3 cycles	*/
597 {
598 	cpuReg_PC++;
599 	atariMem[0x100 + cpuReg_S] = cpuReg_A; cpuReg_S--;
600 	return 3;
601 }
602 int opcode_0x49(bool &holded)	/* 0x49 - EOR #				2 cycles	*/
603 {
604 	Load_IMD( EOR );
605 	return 2;
606 }
607 int opcode_0x4A(bool &holded)	/* 0x4A - LSR @				2 cycles	*/
608 {
609 	cpuReg_PC++;
610 	cpuFlag_C = cpuReg_A; cpuReg_A>>=1; cpuFlag_N = cpuFlag_Z = cpuReg_A;
611 	return 2;
612 }
613 int opcode_0x4B(bool &holded)	/* 0x4B - ????							*/
614 {
615 	cpuReg_PC--;
616 	return 20;
617 }
618 int opcode_0x4C(bool &holded)	/* 0x4C - JMP				3 cycles	*/
619 {
620 	cpuReg_PC = ((WORD*)&atariMem[cpuReg_PC+1])[0];
621 	return 3;
622 }
623 int opcode_0x4D(bool &holded)	/* 0x4D - EOR ABS			4 cycles	*/
624 {
625 	Load_ABS( EOR );
626 	return 4;
627 }
628 int opcode_0x4E(bool &holded)	/* 0x4E - LSR ABS			6 cycles	*/
629 {
630 	Modify_ABS( LSR );
631 	return 6;
632 }
633 int opcode_0x4F(bool &holded)	/* 0x4F - LSR:EOR ABS		6 cycles	*/
634 {
635 	Modify_ABS( LSREOR );
636 	return 6;
637 }
638 
639 int opcode_0x50(bool &holded)	/* 0x50 - BVC				2-4 cycles	*/
640 {
641 	CondJump( (cpuFlag_V&1)==0 );
642 	return 2;
643 }
644 
645 int opcode_0x51(bool &holded)	/* 0x51 - EOR (),Y			5 cycles	*/
646 {
647 	Load_PostY( EOR );
648 	return 5;
649 }
650 int opcode_0x52(bool &holded)	/* 0x52 - ...				hang		*/
651 {
652 	return 20;
653 }
654 int opcode_0x53(bool &holded)	/* 0x53 - LSR:EOR (),Y		8 cycles	*/
655 {
656 	Modify_PostY( LSREOR );
657 	return 8;
658 }
659 int opcode_0x54(bool &holded)	/* 0x54 - NOP2							*/
660 {
661 	cpuReg_PC+=2;
662 	return 3;
663 }
664 int opcode_0x55(bool &holded)	/* 0x55 - EOR ZP,X			4 cycles	*/
665 {
666 	Load_ZPX( EOR );
667 	return 4;
668 }
669 int opcode_0x56(bool &holded)	/* 0x56 - LSR ZP,X			6 cycles	*/
670 {
671 	Modify_ZPX( LSR );
672 	return 6;
673 }
674 int opcode_0x57(bool &holded)	/* 0x57 - LSR:EOR ZP,X			6 cycles	*/
675 {
676 	Modify_ZPX( LSREOR );
677 	return 6;
678 }
679 int opcode_0x58(bool &holded)	/* 0x58 - CLI				2 cycles	*/
680 {
681 	cpuReg_PC++;
682 	cpuFlag_I = 0;
683 	pokeyGenerateCheckIRQline();
684 	return 2;
685 }
686 int opcode_0x59(bool &holded)	/* 0x59 - EOR ABS,Y			4,5 cycles	*/
687 {
688 	Load_ABSY( EOR );
689 	return 4;
690 }
691 int opcode_0x5A(bool &holded)	/* 0x5A - NOP1				2 cycles	*/
692 {
693 	cpuReg_PC++;
694 	return 2;
695 }
696 int opcode_0x5B(bool &holded)	/* 0x5B - LSR:EOR ABS,Y		7 cycles	*/
697 {
698 	Modify_ABSY( EOR );
699 	return 7;
700 }
701 int opcode_0x5C(bool &holded)	/* 0x5C - NOP3				7 cycles	*/
702 {
703 	cpuReg_PC+=3;
704 	return 7;
705 }
706 int opcode_0x5D(bool &holded)	/* 0x5D - EOR ABS,X			4,5 cycles	*/
707 {
708 	Load_ABSX( EOR );
709 	return 4;
710 }
711 int opcode_0x5E(bool &holded)	/* 0x5E - LSR ABS,X			7 cycles	*/
712 {
713 	Modify_ABSX( EOR );
714 	return 7;
715 }
716 int opcode_0x5F(bool &holded)	/* 0x5F - LSR:EOR ABS,X		7 cycles	*/
717 {
718 	Modify_ABSX( LSREOR );
719 	return 7;
720 }
721 
722 int opcode_0x60(bool &holded)	/* 0x60 - RTS				6 cycles	*/
723 {
724 	cpuReg_S++; cpuReg_PC =  (WORD)atariMem[0x100 + cpuReg_S];
725 	cpuReg_S++; cpuReg_PC+= ((WORD)atariMem[0x100 + cpuReg_S])*256 + 1;
726 	return 6;
727 }
728 int opcode_0x61(bool &holded)	/* 0x61 - ADC (,X)			6 cycles	*/
729 {
730 	Load_PreX( ADC );
731 	return 6;
732 }
733 int opcode_0x62(bool &holded)	/* 0x62 - ...				hang		*/
734 {
735 	return 20;
736 }
737 int opcode_0x63(bool &holded)	/* 0x63 - ROR:ADC (,X)		8 cycles	*/
738 {
739 	Modify_PreX( RORADC );
740 	return 8;
741 }
742 int opcode_0x64(bool &holded)	/* 0x64 - NOP2				3 cycles	*/
743 {
744 	cpuReg_PC+=2;
745 	return 3;
746 }
747 int opcode_0x65(bool &holded)	/* 0x65 - ADC ZP			3 cycles	*/
748 {
749 	Load_ZP( ADC );
750 	return 3;
751 }
752 int opcode_0x66(bool &holded)	/* 0x66 - ROR ZP			5 cycles	*/
753 {
754 	Modify_ZP( ROR );
755 	return 5;
756 }
757 int opcode_0x67(bool &holded)	/* 0x67 - ROR:ADC ZP		5 cycles	*/
758 {
759 	Modify_ZP( RORADC );
760 	return 5;
761 }
762 int opcode_0x68(bool &holded)	/* 0x68 - PLA				4 cycles	*/
763 {
764 	cpuReg_PC++;
765 	cpuReg_S++; cpuFlag_N = cpuFlag_Z = cpuReg_A = atariMem[0x100 + cpuReg_S];
766 	return 4;
767 }
768 int opcode_0x69(bool &holded)	/* 0x69 - ADC #				2 cycles	*/
769 {
770 	Load_IMD( ADC );
771 	return 2;
772 }
773 int opcode_0x6A(bool &holded)	/* 0x6A - ROR @				2 cycles	*/
774 {
775 BYTE cC;
776 	cpuReg_PC++;
777 	cC = cpuReg_A; cpuReg_A = (cpuReg_A>>1) + (cpuFlag_C<<7); cpuFlag_C = cC; cpuFlag_N = cpuFlag_Z = cpuReg_A;
778 	return 2;
779 }
780 int opcode_0x6B(bool &holded)	/* 0x6B - ????							*/
781 {
782 	return 20;
783 }
784 int opcode_0x6C(bool &holded)	/* 0x6C - JMP ( )			6 cycles	*/
785 {
786 	WORD wA = ((WORD*)&atariMem[cpuReg_PC+1])[0];
787 	wA = ((WORD*)&atariMem[wA])[0];
788 	cpuReg_PC = wA;
789 	return 6;
790 }
791 int opcode_0x6D(bool &holded)	/* 0x6D - ADC ABS			4 cycles	*/
792 {
793 	Load_ABS( ADC );
794 	return 4;
795 }
796 int opcode_0x6E(bool &holded)	/* 0x6E - ROR ABS			6 cycles	*/
797 {
798 	Modify_ABS( ROR );
799 	return 6;
800 }
801 int opcode_0x6F(bool &holded)	/* 0x6F - ROR:ADC ABS		6 cycles	*/
802 {
803 	Modify_ABS( RORADC );
804 	return 6;
805 }
806 int opcode_0x70(bool &holded)	/* 0x70 - BVS				2-4 cycles	*/
807 {
808 	CondJump( (cpuFlag_V&1) );
809 	return 2;
810 }
811 int opcode_0x71(bool &holded)	/* 0x71 - ADC ( ),Y			5,6 cycles	*/
812 {
813 	Load_PostY( ADC );
814 	return 5;
815 }
816 int opcode_0x72(bool &holded)	/* 0x72 - ...				hang		*/
817 {
818 	return 20;
819 }
820 int opcode_0x73(bool &holded)	/* 0x73 - ROR:ADC ( ),Y		8 cycles	*/
821 {
822 	Modify_PostY( RORADC );
823 	return 8;
824 }
825 int opcode_0x74(bool &holded)	/* 0x74 - NOP2				4 cycles	*/
826 {
827 	return 4;
828 }
829 int opcode_0x75(bool &holded)	/* 0x75 - ADC ZP,X			4 cycles	*/
830 {
831 	Load_ZPX( ADC );
832 	return 4;
833 }
834 int opcode_0x76(bool &holded)	/* 0x76 - ROR ZP,X			6 cycles	*/
835 {
836 	Modify_ZPX( ROR );
837 	return 6;
838 }
839 int opcode_0x77(bool &holded)	/* 0x77 - ROR:ADC ZP,X		6 cycles	*/
840 {
841 	Modify_ZPX( RORADC );
842 	return 6;
843 }
844 int opcode_0x78(bool &holded)	/* 0x78 - SEI				2 cycles	*/
845 {
846 	cpuReg_PC++;
847 	cpuFlag_I = 1;
848 	return 2;
849 }
850 int opcode_0x79(bool &holded)	/* 0x79 - ADC ABS,Y			4,5 cycles	*/
851 {
852 	Load_ABSY( ADC );
853 	return 4;
854 }
855 int opcode_0x7A(bool &holded)	/* 0x7A - NOP1				2 cycles	*/
856 {
857 	cpuReg_PC++;
858 	return 2;
859 }
860 int opcode_0x7B(bool &holded)	/* 0x7B - ROR:ADC ABS,Y		6 cycles	*/
861 {
862 	Modify_ABSY( RORADC );
863 	return 6;
864 }
865 int opcode_0x7C(bool &holded)	/* 0x7C - NOP3				7 cycles	*/
866 {
867 	cpuReg_PC+=3;
868 	return 7;
869 }
870 int opcode_0x7D(bool &holded)	/* 0x7D - ADC ABS,X			4,5 cycles	*/
871 {
872 	Load_ABSX( ADC );
873 	return 4;
874 }
875 int opcode_0x7E(bool &holded)	/* 0x7E - ROR ABS,X			7 cycles	*/
876 {
877 	Modify_ABSX( ROR );
878 	return 7;
879 }
880 int opcode_0x7F(bool &holded)	/* 0x7F - ROR:ADC ABS,X		7 cycles	*/
881 {
882 	Modify_ABSX( RORADC );
883 	return 7;
884 }
885 
886 int opcode_0x80(bool &holded)	/* 0x80 - NOP2				2 cycles	*/
887 {
888 	cpuReg_PC+=2;
889 	return 2;
890 }
891 int opcode_0x81(bool &holded)	/* 0x81 - STA ( ,X)			6 cycles	*/
892 {
893 	Store_PreX( cpuReg_A );
894 	return 6;
895 }
896 int opcode_0x82(bool &holded)	/* 0x82 - NOP2				2 cycles	*/
897 {
898 	cpuReg_PC+=2;
899 	return 2;
900 }
901 int opcode_0x83(bool &holded)	/* 0x83 - STORE(A&X)	(,X)	6 cycles	*/
902 {
903 	Store_PreX( (cpuReg_A&cpuReg_X) );
904 	return 6;
905 }
906 int opcode_0x84(bool &holded)	/* 0x84 - STY ZP				3 cycles	*/
907 {
908 	atariMem[atariMem[cpuReg_PC+1]] = cpuReg_Y;
909 	cpuReg_PC+=2;
910 	return 3;
911 }
912 int opcode_0x85(bool &holded)	/* 0x85 - STA ZP				3 cycles	*/
913 {
914 	atariMem[atariMem[cpuReg_PC+1]] = cpuReg_A;
915 	cpuReg_PC+=2;
916 	return 3;
917 }
918 int opcode_0x86(bool &holded)	/* 0x86 - STX ZP				3 cycles	*/
919 {
920 	atariMem[atariMem[cpuReg_PC+1]] = cpuReg_X;
921 	cpuReg_PC+=2;
922 	return 3;
923 }
924 int opcode_0x87(bool &holded)	/* 0x87 - STORE(A&X)	ZP		3 cycles	*/
925 {
926 	atariMem[atariMem[cpuReg_PC+1]] = cpuReg_A&cpuReg_X;
927 	cpuReg_PC+=2;
928 	return 3;
929 }
930 int opcode_0x88(bool &holded)	/* 0x88 - DEY				2 cycles	*/
931 {
932 	cpuReg_PC++;
933 	cpuReg_Y--;
934 	cpuFlag_N = cpuFlag_Z = cpuReg_Y;
935 	return 2;
936 }
937 int opcode_0x89(bool &holded)	/* 0x89 - NOP2				2 cycles	*/
938 {
939 	cpuReg_PC+=2;
940 	return 2;
941 }
942 int opcode_0x8A(bool &holded)	/* 0x8A - TXA				2 cycles	*/
943 {
944 	cpuReg_PC+=1;
945 	cpuFlag_N = cpuFlag_Z = cpuReg_A = cpuReg_X;
946 	return 2;
947 }
948 int opcode_0x8B(bool &holded)	/* 0x8B - TXA:AND #			2 cycles	*/
949 {
950 	cpuReg_A = cpuReg_X;
951 	cpuFlag_N = cpuFlag_Z = cpuReg_A = cpuReg_A & atariMem[cpuReg_PC+1];
952 	cpuReg_PC+=2;
953 	return 2;
954 }
955 int opcode_0x8C(bool &holded)	/* 0x8C - STY ABS			4 cycles	*/
956 {
957 	Store_ABS( cpuReg_Y );
958 	return 4;
959 }
960 int opcode_0x8D(bool &holded)	/* 0x8D - STA ABS			4 cycles	*/
961 {
962 	Store_ABS( cpuReg_A );
963 	return 4;
964 }
965 int opcode_0x8E(bool &holded)	/* 0x8E - STX ABS			4 cycles	*/
966 {
967 	Store_ABS( cpuReg_X );
968 	return 4;
969 }
970 int opcode_0x8F(bool &holded)	/* 0x8F - STORE(A&X)	ABS		4 cycles	*/
971 {
972 	Store_ABS( (cpuReg_A&cpuReg_X) );
973 	return 4;
974 }
975 int opcode_0x90(bool &holded)	/* 0x90 - BCC				2-4 cycles	*/
976 {
977 	CondJump( (cpuFlag_C&1)==0 );
978 	return 2;
979 }
980 int opcode_0x91(bool &holded)	/* 0x91 - STA ( ),Y			6 cycles	*/
981 {
982 	Store_PostY( cpuReg_A );
983 	return 6;
984 }
985 int opcode_0x92(bool &holded)	/* 0x92 - ...				hang		*/
986 {
987 	return 20;
988 }
989 int opcode_0x93(bool &holded)	/* 0x93 - STORE(A&X)	(),Y	4,5 cycles	*/
990 {
991 	Store_PostY( (cpuReg_A&cpuReg_X) );
992 	return 6;
993 }
994 int opcode_0x94(bool &holded)	/* 0x94 - STY ZP,X			4 cycles	*/
995 {
996 	atariMem[(atariMem[cpuReg_PC+1]+cpuReg_X)&0xFF] = cpuReg_Y;
997 	cpuReg_PC+=2;
998 	return 4;
999 }
1000 int opcode_0x95(bool &holded)	/* 0x95 - STA ZP,X			4 cycles	*/
1001 {
1002 	atariMem[(atariMem[cpuReg_PC+1]+cpuReg_X)&0xFF] = cpuReg_A;
1003 	cpuReg_PC+=2;
1004 	return 4;
1005 }
1006 int opcode_0x96(bool &holded)	/* 0x96 - STX ZP,Y			4 cycles	*/
1007 {
1008 	atariMem[(atariMem[cpuReg_PC+1]+cpuReg_Y)&0xFF] = cpuReg_X;
1009 	cpuReg_PC+=2;
1010 	return 4;
1011 }
1012 int opcode_0x97(bool &holded)	/* 0x97 - STORE(A&X)	ZP,Y	4 cycles	*/
1013 {
1014 	atariMem[(atariMem[cpuReg_PC+1]+cpuReg_Y)&0xFF] = cpuReg_X&cpuReg_A;
1015 	cpuReg_PC+=2;
1016 	return 4;
1017 }
1018 int opcode_0x98(bool &holded)	/* 0x98 - TYA				2 cycles	*/
1019 {
1020 	cpuReg_PC++;
1021 	cpuFlag_N = cpuFlag_Z = cpuReg_A = cpuReg_Y;
1022 	return 2;
1023 }
1024 int opcode_0x99(bool &holded)	/* 0x99 - STA ABS,Y			5 cycles	*/
1025 {
1026 	Store_ABSY( cpuReg_A );
1027 	return 5;
1028 }
1029 int opcode_0x9A(bool &holded)	/* 0x9A - TXS				2 cycles	*/
1030 {
1031 	cpuReg_PC++;
1032 	cpuReg_S = cpuReg_X;
1033 	return 2;
1034 }
1035 int opcode_0x9B(bool &holded)	/* 0x9B - ????							*/
1036 {
1037 	return 20;
1038 }
1039 int opcode_0x9C(bool &holded)	/* 0x9C - ????							*/
1040 {
1041 	return 20;
1042 }
1043 int opcode_0x9D(bool &holded)	/* 0x9D - STA ABS,X			5 cycles	*/
1044 {
1045 	Store_ABSX( cpuReg_A );
1046 	return 5;
1047 }
1048 int opcode_0x9E(bool &holded)	/* 0x9E - ????							*/
1049 {
1050 	return 20;
1051 }
1052 int opcode_0x9F(bool &holded)	/* 0x9F - ????							*/
1053 {
1054 	return 20;
1055 }
1056 int opcode_0xA0(bool &holded)	/* 0xA0 - LDY #				2 cycles	*/
1057 {
1058 	LoadReg_IMD( cpuReg_Y );
1059 	return 2;
1060 }
1061 int opcode_0xA1(bool &holded)	/* 0xA1 - LDA (,X)			6 cycles	*/
1062 {
1063 	LoadReg_PreX( cpuReg_A );
1064 	return 6;
1065 }
1066 int opcode_0xA2(bool &holded)	/* 0xA2 - LDX #				2 cycles	*/
1067 {
1068 	LoadReg_IMD( cpuReg_X );
1069 	return 2;
1070 }
1071 int opcode_0xA3(bool &holded)	/* 0xA3 - LDA:TAX (,X)		6 cycles	*/
1072 {
1073 	LoadReg_IMD( cpuReg_A );
1074 	cpuReg_X = cpuReg_A;
1075 	return 6;
1076 }
1077 int opcode_0xA4(bool &holded)	/* 0xA4 - LDY ZP				3 cycles	*/
1078 {
1079 	LoadReg_ZP( cpuReg_Y );
1080 	return 3;
1081 }
1082 int opcode_0xA5(bool &holded)	/* 0xA5 - LDA ZP				3 cycles	*/
1083 {
1084 	LoadReg_ZP( cpuReg_A );
1085 	return 3;
1086 }
1087 int opcode_0xA6(bool &holded)	/* 0xA6 - LDX ZP				3 cycles	*/
1088 {
1089 	LoadReg_ZP( cpuReg_X );
1090 	return 3;
1091 }
1092 int opcode_0xA7(bool &holded)	/* 0xA7 - LDA:TAX ZP			3 cycles	*/
1093 {
1094 	LoadReg_ZP( cpuReg_A );
1095 	cpuReg_X = cpuReg_A;
1096 	return 3;
1097 }
1098 int opcode_0xA8(bool &holded)	/* 0xA8 - TAY				2 cycles	*/
1099 {
1100 	cpuReg_PC++;
1101 	cpuFlag_N = cpuFlag_Z = cpuReg_Y = cpuReg_A;
1102 	return 2;
1103 }
1104 int opcode_0xA9(bool &holded)	/* 0xA9 - LDA #				2 cycles	*/
1105 {
1106 	LoadReg_IMD( cpuReg_A );
1107 	return 2;
1108 }
1109 int opcode_0xAA(bool &holded)	/* 0xAA - TAX				2 cycles	*/
1110 {
1111 	cpuReg_PC++;
1112 	cpuFlag_N = cpuFlag_Z = cpuReg_X = cpuReg_A;
1113 	return 2;
1114 }
1115 int opcode_0xAB(bool &holded)	/* 0xAB - AND #:TAX			2 cycles	*/
1116 {
1117 	cpuFlag_N = cpuFlag_Z = cpuReg_A = cpuReg_X = cpuReg_A & atariMem[cpuReg_PC+1];
1118 	cpuReg_PC+=2;
1119 	return 2;
1120 }
1121 int opcode_0xAC(bool &holded)	/* 0xAC - LDY ABS			4 cycles	*/
1122 {
1123 	LoadReg_ABS( cpuReg_Y );
1124 	return 4;
1125 }
1126 int opcode_0xAD(bool &holded)	/* 0xAD - LDA ABS			4 cycles	*/
1127 {
1128 	LoadReg_ABS( cpuReg_A );
1129 	return 4;
1130 }
1131 int opcode_0xAE(bool &holded)	/* 0xAE - LDX ABS			4 cycles	*/
1132 {
1133 	LoadReg_ABS( cpuReg_X );
1134 	return 4;
1135 }
1136 int opcode_0xAF(bool &holded)	/* 0xAF - LDA:TAX ABS		4 cycles	*/
1137 {
1138 	LoadReg_ABS( cpuReg_A );
1139 	cpuReg_X = cpuReg_A;
1140 	return 4;
1141 }
1142 int opcode_0xB0(bool &holded)	/* 0xB0 - BCS				2-4 cycles	*/
1143 {
1144 	CondJump( (cpuFlag_C&1) );
1145 	return 2;
1146 }
1147 int opcode_0xB1(bool &holded)	/* 0xB1 - LDA ( ),Y			5,6 cycles	*/
1148 {
1149 	LoadReg_PostY( cpuReg_A );
1150 	return 5;
1151 }
1152 int opcode_0xB2(bool &holded)	/* 0xB2 - ...				hang		*/
1153 {
1154 	return 20;
1155 }
1156 int opcode_0xB3(bool &holded)	/* 0xB3 - LDA:TAX ( ),Y		5,6 cycles	*/
1157 {
1158 	LoadReg_PostY( cpuReg_A );
1159 	cpuReg_X = cpuReg_A;
1160 	return 5;
1161 }
1162 int opcode_0xB4(bool &holded)	/* 0xB4 - LDY ZP,X			4 cycles	*/
1163 {
1164 	LoadReg_ZPX( cpuReg_Y );
1165 	return 4;
1166 }
1167 int opcode_0xB5(bool &holded)	/* 0xB5 - LDA ZP,X			4 cycles	*/
1168 {
1169 	LoadReg_ZPX( cpuReg_A );
1170 	return 4;
1171 }
1172 int opcode_0xB6(bool &holded)	/* 0xB6 - LDX ZP,Y			4 cycles	*/
1173 {
1174 	LoadReg_ZPY( cpuReg_X );
1175 	return 4;
1176 }
1177 int opcode_0xB7(bool &holded)	/* 0xB7 - LDA:TAX ZP,Y		4 cycles	*/
1178 {
1179 	LoadReg_ZPY( cpuReg_X );
1180 	cpuReg_A = cpuReg_X;
1181 	return 4;
1182 }
1183 int opcode_0xB8(bool &holded)	/* 0xB8 - CLV				2 cycles	*/
1184 {
1185 	cpuReg_PC++;
1186 	cpuFlag_V = 0;
1187 	return 2;
1188 }
1189 int opcode_0xB9(bool &holded)	/* 0xB9 - LDA ABS,Y			4,5 cycles	*/
1190 {
1191 	LoadReg_ABSY( cpuReg_A );
1192 	return 4;
1193 }
1194 int opcode_0xBA(bool &holded)	/* 0xBA - TSX				2 cycles	*/
1195 {
1196 	cpuReg_PC++;
1197 	cpuFlag_N = cpuFlag_Z = cpuReg_X = cpuReg_S;
1198 	return 2;
1199 }
1200 int opcode_0xBB(bool &holded)	/* 0xBB - ????							*/
1201 {
1202 	return 20;
1203 }
1204 int opcode_0xBC(bool &holded)	/* 0xBC - LDY ABS,X			4,5 cycles	*/
1205 {
1206 	LoadReg_ABSX( cpuReg_Y );
1207 	return 4;
1208 }
1209 int opcode_0xBD(bool &holded)	/* 0xBD - LDA ABS,X			4,5 cycles	*/
1210 {
1211 	LoadReg_ABSX( cpuReg_A );
1212 	return 4;
1213 }
1214 int opcode_0xBE(bool &holded)	/* 0xBE - LDX ABS,Y			4,5 cycles	*/
1215 {
1216 	LoadReg_ABSY( cpuReg_X );
1217 	return 4;
1218 }
1219 int opcode_0xBF(bool &holded)	/* 0xBF - LDA:TAX ABS,Y		4,5 cycles	*/
1220 {
1221 	LoadReg_ABSY( cpuReg_X );
1222 	cpuReg_A = cpuReg_X;
1223 	return 4;
1224 }
1225 int opcode_0xC0(bool &holded)	/* 0xC0 - CPY #				2 cycles	*/
1226 {
1227 	Load_IMD( CPY );
1228 	return 2;
1229 }
1230 int opcode_0xC1(bool &holded)	/* 0xC1 - CMP (,X)			6 cycles	*/
1231 {
1232 	Load_PreX( CMP );
1233 	return 6;
1234 }
1235 int opcode_0xC2(bool &holded)	/* 0xC2 - NOP2				2 cycles	*/
1236 {
1237 	cpuReg_PC+=2;
1238 	return 2;
1239 }
1240 int opcode_0xC3(bool &holded)	/* 0xC3 - DEC:CMP (,X)		8 cycles	*/
1241 {
1242 	Modify_PreX( DECCMP );
1243 	return 8;
1244 }
1245 int opcode_0xC4(bool &holded)	/* 0xC4 - CPY ZP				3 cycles	*/
1246 {
1247 	Load_ZP( CPY );
1248 	return 3;
1249 }
1250 int opcode_0xC5(bool &holded)	/* 0xC5 - CMP ZP				3 cycles	*/
1251 {
1252 	Load_ZP( CMP );
1253 	return 3;
1254 }
1255 int opcode_0xC6(bool &holded)	/* 0xC6 - DEC ZP				5 cycles	*/
1256 {
1257 	Modify_ZP( DEC );
1258 	return 5;
1259 }
1260 int opcode_0xC7(bool &holded)	/* 0xC7 - DEC:CMP ZP			5 cycles	*/
1261 {
1262 	Modify_ZP( DECCMP );
1263 	return 8;
1264 }
1265 int opcode_0xC8(bool &holded)	/* 0xC8 - INY				2 cycles	*/
1266 {
1267 	cpuReg_PC++;
1268 	cpuFlag_N = cpuFlag_Z = cpuReg_Y = cpuReg_Y+1;
1269 	return 2;
1270 }
1271 int opcode_0xC9(bool &holded)	/* 0xC9 - CMP #				2 cycles	*/
1272 {
1273 	Load_IMD( CMP );
1274 	return 2;
1275 }
1276 int opcode_0xCA(bool &holded)	/* 0xCA - DEX				2 cycles	*/
1277 {
1278 	cpuReg_PC++;
1279 	cpuFlag_N = cpuFlag_Z = cpuReg_X = cpuReg_X-1;
1280 	return 2;
1281 }
1282 int opcode_0xCB(bool &holded)	/* 0xCB - ????							*/
1283 {
1284 	return 20;
1285 }
1286 int opcode_0xCC(bool &holded)	/* 0xCC - CPY ABS			4 cycles	*/
1287 {
1288 	Load_ABS( CPY );
1289 	return 4;
1290 }
1291 int opcode_0xCD(bool &holded)	/* 0xCD - CMP ABS			4 cycles	*/
1292 {
1293 	Load_ABS( CMP );
1294 	return 4;
1295 }
1296 int opcode_0xCE(bool &holded)	/* 0xCE - DEC ABS			6 cycles	*/
1297 {
1298 	Modify_ABS( DEC );
1299 	return 6;
1300 }
1301 int opcode_0xCF(bool &holded)	/* 0xCF - DEC:CMP ABS		6 cycles	*/
1302 {
1303 	Modify_ABS( DECCMP );
1304 	return 6;
1305 }
1306 int opcode_0xD0(bool &holded)	/* 0xD0 - BNE				2-4 cycles	*/
1307 {
1308 	CondJump( cpuFlag_Z );
1309 	return 2;
1310 }
1311 int opcode_0xD1(bool &holded)	/* 0xD1 - CMP (),Y			5,6 cycles	*/
1312 {
1313 	Load_PostY( CMP );
1314 	return 5;
1315 }
1316 int opcode_0xD2(bool &holded)	/* 0xD2 - ...				hang		*/
1317 {
1318 	return 20;
1319 }
1320 int opcode_0xD3(bool &holded)	/* 0xD3 - DEC:CMP (),Y			8 cycles	*/
1321 {
1322 	Modify_PostY( DECCMP );
1323 	return 8;
1324 }
1325 int opcode_0xD4(bool &holded)	/* 0xD4 - NOP2				4 cycles	*/
1326 {
1327 	cpuReg_PC+=2;
1328 	return 4;
1329 }
1330 int opcode_0xD5(bool &holded)	/* 0xD5 - CMP ZP,X			4 cycles	*/
1331 {
1332 	Load_ZPX( CMP );
1333 	return 4;
1334 }
1335 int opcode_0xD6(bool &holded)	/* 0xD6 - DEC ZP,X			6 cycles	*/
1336 {
1337 	Modify_ZPX( DEC );
1338 	return 6;
1339 }
1340 int opcode_0xD7(bool &holded)	/* 0xD7 - DEC:CMP ZP,X		6 cycles	*/
1341 {
1342 	Modify_ZPX( DECCMP );
1343 	return 6;
1344 }
1345 int opcode_0xD8(bool &holded)	/* 0xD8 - CLD				2 cycles	*/
1346 {
1347 	cpuReg_PC++;
1348 	cpuFlag_D = 0;
1349 	return 2;
1350 }
1351 int opcode_0xD9(bool &holded)	/* 0xD9 - CMP ABS,Y			4,5 cycles	*/
1352 {
1353 	Load_ABSY( CMP );
1354 	return 4;
1355 }
1356 int opcode_0xDA(bool &holded)	/* 0xDA - NOP1				2 cycles	*/
1357 {
1358 	cpuReg_PC++;
1359 	return 2;
1360 }
1361 int opcode_0xDB(bool &holded)	/* 0xDB - DEC:CMP ABS,Y		7 cycles	*/
1362 {
1363 	Modify_ABSY( DECCMP );
1364 	return 7;
1365 }
1366 int opcode_0xDC(bool &holded)	/* 0xDC - NOP3				4 cycles	*/
1367 {
1368 	cpuReg_PC+=3;
1369 	return 4;
1370 }
1371 int opcode_0xDD(bool &holded)	/* 0xDD - CMP ABS,X			4,5 cycles	*/
1372 {
1373 	Load_ABSX( CMP );
1374 	return 4;
1375 }
1376 int opcode_0xDE(bool &holded)	/* 0xDE - DEC ABS,X			7 cycles	*/
1377 {
1378 	Modify_ABSX( DEC );
1379 	return 7;
1380 }
1381 int opcode_0xDF(bool &holded)	/* 0xDF - DEC:CMP ABS,X		7 cycles	*/
1382 {
1383 	Modify_ABSX( DECCMP );
1384 	return 7;
1385 }
1386 int opcode_0xE0(bool &holded)	/* 0xE0 - CPX #				2 cycles	*/
1387 {
1388 	Load_IMD( CPX );
1389 	return 2;
1390 }
1391 int opcode_0xE1(bool &holded)	/* 0xE1 - SBC (,X)			6 cycles	*/
1392 {
1393 	Load_PreX( SBC );
1394 	return 6;
1395 }
1396 int opcode_0xE2(bool &holded)	/* 0xE2 - NOP2				2 cycles	*/
1397 {
1398 	cpuReg_PC+=2;
1399 	return 2;
1400 }
1401 int opcode_0xE3(bool &holded)	/* 0xE3 - INC:SBC (,X)		8 cycles	*/
1402 {
1403 	Modify_PreX( INCSBC );
1404 	return 8;
1405 }
1406 int opcode_0xE4(bool &holded)	/* 0xE4 - CPX ZP				3 cycles	*/
1407 {
1408 	Load_ZP( CPX );
1409 	return 3;
1410 }
1411 int opcode_0xE5(bool &holded)	/* 0xE5 - SBC ZP				3 cycles	*/
1412 {
1413 	Load_ZP( SBC );
1414 	return 3;
1415 }
1416 int opcode_0xE6(bool &holded)	/* 0xE6 - INC ZP				5 cycles	*/
1417 {
1418 	Modify_ZP( INC );
1419 	return 5;
1420 }
1421 int opcode_0xE7(bool &holded)	/* 0xE7 - INC:SBC ZP			5 cycles	*/
1422 {
1423 	Modify_ZP( INCSBC );
1424 	return 5;
1425 }
1426 int opcode_0xE8(bool &holded)	/* 0xE8 - INX				2 cycles	*/
1427 {
1428 	cpuReg_PC++;
1429 	cpuFlag_N = cpuFlag_Z = cpuReg_X = cpuReg_X+1;
1430 	return 2;
1431 }
1432 int opcode_0xE9(bool &holded)	/* 0xE9 - SBC #				2 cycles	*/
1433 {
1434 	Load_IMD( SBC );
1435 	return 2;
1436 }
1437 int opcode_0xEA(bool &holded)	/* 0xEA - NOP				2 cycles	*/
1438 {
1439 	cpuReg_PC++;
1440 	return 2;
1441 }
1442 int opcode_0xEB(bool &holded)	/* 0xEB - ????							*/
1443 {
1444 	return 20;
1445 }
1446 int opcode_0xEC(bool &holded)	/* 0xEC - CPX ABS			4 cycles	*/
1447 {
1448 	Load_ABS( CPX );
1449 	return 4;
1450 }
1451 int opcode_0xED(bool &holded)	/* 0xED - SBC ABS			4 cycles	*/
1452 {
1453 	Load_ABS( SBC );
1454 	return 4;
1455 }
1456 int opcode_0xEE(bool &holded)	/* 0xEE - INC ABS			6 cycles	*/
1457 {
1458 	Modify_ABS( INC );
1459 	return 6;
1460 }
1461 int opcode_0xEF(bool &holded)	/* 0xEF - INC:SBC ABS		6 cycles	*/
1462 {
1463 	Modify_ABS( INCSBC );
1464 	return 6;
1465 }
1466 int opcode_0xF0(bool &holded)	/* 0xF0 - BEQ				2-4 cycles	*/
1467 {
1468 	CondJump( (cpuFlag_Z==0) );
1469 	return 2;
1470 }
1471 int opcode_0xF1(bool &holded)	/* 0xF1 - SBC (),Y			5,6 cycles	*/
1472 {
1473 	Load_PostY( SBC );
1474 	return 5;
1475 }
1476 int opcode_0xF2(bool &holded)	/* 0xF2 - ...				hang		*/
1477 {
1478 	return 20;
1479 }
1480 int opcode_0xF3(bool &holded)	/* 0xF3 - INC:SBC (),Y			8 cycles	*/
1481 {
1482 	Modify_PostY( INCSBC );
1483 	return 8;
1484 }
1485 int opcode_0xF4(bool &holded)	/* 0xF4 - NOP2				4 cycles	*/
1486 {
1487 	cpuReg_PC+=2;
1488 	return 4;
1489 }
1490 int opcode_0xF5(bool &holded)	/* 0xF5 - SBC ZP,X			4 cycles	*/
1491 {
1492 	Load_ZPX( SBC );
1493 	return 4;
1494 }
1495 int opcode_0xF6(bool &holded)	/* 0xF6 - INC ZP,X			6 cycles	*/
1496 {
1497 	Modify_ZPX( INC );
1498 	return 6;
1499 }
1500 int opcode_0xF7(bool &holded)	/* 0xF7 - INC:SBC ZP,X		6 cycles	*/
1501 {
1502 	Modify_ZPX( INCSBC );
1503 	return 6;
1504 }
1505 int opcode_0xF8(bool &holded)	/* 0xF8 - SED				2 cycles	*/
1506 {
1507 	cpuReg_PC++;
1508 	cpuFlag_D = 1;
1509 	return 2;
1510 }
1511 int opcode_0xF9(bool &holded)	/* 0xF9 - SBC ABS,Y			4,5 cycles	*/
1512 {
1513 	Load_ABSY( SBC );
1514 	return 4;
1515 }
1516 int opcode_0xFA(bool &holded)	/* 0xFA - NOP1				2 cycles	*/
1517 {
1518 	cpuReg_PC++;
1519 	return 2;
1520 }
1521 int opcode_0xFB(bool &holded)	/* 0xFB - INC:SBC ABS,Y		7 cycles	*/
1522 {
1523 	Modify_ABSY( INCSBC );
1524 	return 7;
1525 }
1526 int opcode_0xFC(bool &holded)	/* 0xDC - NOP3				4 cycles	*/
1527 {
1528 	cpuReg_PC+=3;
1529 	return 4;
1530 }
1531 int opcode_0xFD(bool &holded)	/* 0xFD - SBC ABS,X			4,5 cycles	*/
1532 {
1533 	Load_ABSX( SBC );
1534 	return 4;
1535 }
1536 int opcode_0xFE(bool &holded)	/* 0xFE - INC ABS,X			7 cycles	*/
1537 {
1538 	Modify_ABSX( INC );
1539 	return 7;
1540 }
1541 int opcode_0xFF(bool &holded)	/* 0xDF - INC:SBC ABS,X		7 cycles	*/
1542 {
1543 	Modify_ABSX( INCSBC );
1544 	return 7;
1545 }
1546 
1547 opcodeFunc opcodes_0x00_0xFF[256]={
1548 	&opcode_0x00, &opcode_0x01, &opcode_0x02, &opcode_0x03, &opcode_0x04, &opcode_0x05, &opcode_0x06, &opcode_0x07,
1549 	&opcode_0x08, &opcode_0x09, &opcode_0x0A, &opcode_0x0B, &opcode_0x0C, &opcode_0x0D, &opcode_0x0E, &opcode_0x0F,
1550 	&opcode_0x10, &opcode_0x11, &opcode_0x12, &opcode_0x13, &opcode_0x14, &opcode_0x15, &opcode_0x16, &opcode_0x17,
1551 	&opcode_0x18, &opcode_0x19, &opcode_0x1A, &opcode_0x1B, &opcode_0x1C, &opcode_0x1D, &opcode_0x1E, &opcode_0x1F,
1552 	&opcode_0x20, &opcode_0x21, &opcode_0x22, &opcode_0x23, &opcode_0x24, &opcode_0x25, &opcode_0x26, &opcode_0x27,
1553 	&opcode_0x28, &opcode_0x29, &opcode_0x2A, &opcode_0x2B, &opcode_0x2C, &opcode_0x2D, &opcode_0x2E, &opcode_0x2F,
1554 	&opcode_0x30, &opcode_0x31, &opcode_0x32, &opcode_0x33, &opcode_0x34, &opcode_0x35, &opcode_0x36, &opcode_0x37,
1555 	&opcode_0x38, &opcode_0x39, &opcode_0x3A, &opcode_0x2B, &opcode_0x3C, &opcode_0x3D, &opcode_0x3E, &opcode_0x3F,
1556 	&opcode_0x40, &opcode_0x41, &opcode_0x42, &opcode_0x43, &opcode_0x44, &opcode_0x45, &opcode_0x46, &opcode_0x47,
1557 	&opcode_0x48, &opcode_0x49, &opcode_0x4A, &opcode_0x4B, &opcode_0x4C, &opcode_0x4D, &opcode_0x4E, &opcode_0x4F,
1558 	&opcode_0x50, &opcode_0x51, &opcode_0x52, &opcode_0x53, &opcode_0x54, &opcode_0x55, &opcode_0x56, &opcode_0x57,
1559 	&opcode_0x58, &opcode_0x59, &opcode_0x5A, &opcode_0x5B, &opcode_0x5C, &opcode_0x5D, &opcode_0x5E, &opcode_0x5F,
1560 	&opcode_0x60, &opcode_0x61, &opcode_0x62, &opcode_0x63, &opcode_0x64, &opcode_0x65, &opcode_0x66, &opcode_0x67,
1561 	&opcode_0x68, &opcode_0x69, &opcode_0x6A, &opcode_0x6B, &opcode_0x6C, &opcode_0x6D, &opcode_0x6E, &opcode_0x6F,
1562 	&opcode_0x70, &opcode_0x71, &opcode_0x72, &opcode_0x73, &opcode_0x74, &opcode_0x75, &opcode_0x76, &opcode_0x77,
1563 	&opcode_0x78, &opcode_0x79, &opcode_0x7A, &opcode_0x7B, &opcode_0x7C, &opcode_0x7D, &opcode_0x7E, &opcode_0x7F,
1564 	&opcode_0x80, &opcode_0x81, &opcode_0x82, &opcode_0x83, &opcode_0x84, &opcode_0x85, &opcode_0x86, &opcode_0x87,
1565 	&opcode_0x88, &opcode_0x89, &opcode_0x8A, &opcode_0x8B, &opcode_0x8C, &opcode_0x8D, &opcode_0x8E, &opcode_0x8F,
1566 	&opcode_0x90, &opcode_0x91, &opcode_0x92, &opcode_0x93, &opcode_0x94, &opcode_0x95, &opcode_0x96, &opcode_0x97,
1567 	&opcode_0x98, &opcode_0x99, &opcode_0x9A, &opcode_0x9B, &opcode_0x9C, &opcode_0x9D, &opcode_0x9E, &opcode_0x9F,
1568 	&opcode_0xA0, &opcode_0xA1, &opcode_0xA2, &opcode_0xA3, &opcode_0xA4, &opcode_0xA5, &opcode_0xA6, &opcode_0xA7,
1569 	&opcode_0xA8, &opcode_0xA9, &opcode_0xAA, &opcode_0xAB, &opcode_0xAC, &opcode_0xAD, &opcode_0xAE, &opcode_0xAF,
1570 	&opcode_0xB0, &opcode_0xB1, &opcode_0xB2, &opcode_0xB3, &opcode_0xB4, &opcode_0xB5, &opcode_0xB6, &opcode_0xB7,
1571 	&opcode_0xB8, &opcode_0xB9, &opcode_0xBA, &opcode_0xBB, &opcode_0xBC, &opcode_0xBD, &opcode_0xBE, &opcode_0xBF,
1572 	&opcode_0xC0, &opcode_0xC1, &opcode_0xC2, &opcode_0xC3, &opcode_0xC4, &opcode_0xC5, &opcode_0xC6, &opcode_0xC7,
1573 	&opcode_0xC8, &opcode_0xC9, &opcode_0xCA, &opcode_0xCB, &opcode_0xCC, &opcode_0xCD, &opcode_0xCE, &opcode_0xCF,
1574 	&opcode_0xD0, &opcode_0xD1, &opcode_0xD2, &opcode_0xD3, &opcode_0xD4, &opcode_0xD5, &opcode_0xD6, &opcode_0xD7,
1575 	&opcode_0xD8, &opcode_0xD9, &opcode_0xDA, &opcode_0xDB, &opcode_0xDC, &opcode_0xDD, &opcode_0xDE, &opcode_0xDF,
1576 	&opcode_0xE0, &opcode_0xE1, &opcode_0xE2, &opcode_0xE3, &opcode_0xE4, &opcode_0xE5, &opcode_0xE6, &opcode_0xE7,
1577 	&opcode_0xE8, &opcode_0xE9, &opcode_0xEA, &opcode_0xEB, &opcode_0xEC, &opcode_0xED, &opcode_0xEE, &opcode_0xEF,
1578 	&opcode_0xF0, &opcode_0xF1, &opcode_0xF2, &opcode_0xF3, &opcode_0xF4, &opcode_0xF5, &opcode_0xF6, &opcode_0xF7,
1579 	&opcode_0xF8, &opcode_0xF9, &opcode_0xFA, &opcode_0xFB, &opcode_0xFC, &opcode_0xFD, &opcode_0xFE, &opcode_0xFF,
1580 };
1581 
1582