⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tbl6502.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************
 *
 *	 tbl6502.c
 *	 6502 opcode functions and function pointer table
 *
 *	 Copyright (c) 1998 Juergen Buchmueller, all rights reserved.
 *
 *	 - This source code is released as freeware for non-commercial purposes.
 *	 - You are free to use and redistribute this code in modified or
 *	   unmodified form, provided you list me in the credits.
 *	 - If you modify this source code, you must add a notice to each modified
 *	   source file that it has been changed.  If you're a nice person, you
 *	   will clearly mark each change too.  :)
 *	 - If you wish to use this for commercial purposes, please contact me at
 *	   pullmoll@t-online.de
 *	 - The author of this copywritten work reserves the right to change the
 *     terms of its usage and license at any time, including retroactively
 *   - This entire notice must remain in the source code.
 *
 *****************************************************************************/

#undef	OP
#define OP(nn) INLINE void m6502_##nn(void)

/*****************************************************************************
 *****************************************************************************
 *
 *   plain vanilla 6502 opcodes
 *
 *****************************************************************************
 * op	 temp	  cycles			 rdmem	 opc  wrmem   ********************/

OP(00) {		  M6502_ICount -= 7;		 BRK;		  } 
OP(20) {		  M6502_ICount -= 6;		 JSR;		  } 
OP(40) {		  M6502_ICount -= 6;		 RTI;		  } 
OP(60) {		  M6502_ICount -= 6;		 RTS;		  } 
OP(80) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(a0) { int tmp; M6502_ICount -= 2; RD_IMM; LDY;		  } 
OP(c0) { int tmp; M6502_ICount -= 2; RD_IMM; CPY;		  } 
OP(e0) { int tmp; M6502_ICount -= 2; RD_IMM; CPX;		  } 

OP(10) { int tmp;							 BPL;		  } 
OP(30) { int tmp;							 BMI;		  } 
OP(50) { int tmp;							 BVC;		  } 
OP(70) { int tmp;							 BVS;		  } 
OP(90) { int tmp;							 BCC;		  } 
OP(b0) { int tmp;							 BCS;		  } 
OP(d0) { int tmp;							 BNE;		  } 
OP(f0) { int tmp;							 BEQ;		  } 

OP(01) { int tmp; M6502_ICount -= 6; RD_IDX; ORA;		  } 
OP(21) { int tmp; M6502_ICount -= 6; RD_IDX; AND;		  } 
OP(41) { int tmp; M6502_ICount -= 6; RD_IDX; EOR;		  } 
OP(61) { int tmp; M6502_ICount -= 6; RD_IDX; ADC;		  } 
OP(81) { int tmp; M6502_ICount -= 6;		 STA; WR_IDX; } 
OP(a1) { int tmp; M6502_ICount -= 6; RD_IDX; LDA;		  } 
OP(c1) { int tmp; M6502_ICount -= 6; RD_IDX; CMP;		  } 
OP(e1) { int tmp; M6502_ICount -= 6; RD_IDX; SBC;		  } 

OP(11) { int tmp; M6502_ICount -= 5; RD_IDY; ORA;		  } 
OP(31) { int tmp; M6502_ICount -= 5; RD_IDY; AND;		  } 
OP(51) { int tmp; M6502_ICount -= 5; RD_IDY; EOR;		  } 
OP(71) { int tmp; M6502_ICount -= 5; RD_IDY; ADC;		  } 
OP(91) { int tmp; M6502_ICount -= 6;		 STA; WR_IDY; } 
OP(b1) { int tmp; M6502_ICount -= 5; RD_IDY; LDA;		  } 
OP(d1) { int tmp; M6502_ICount -= 5; RD_IDY; CMP;		  } 
OP(f1) { int tmp; M6502_ICount -= 5; RD_IDY; SBC;		  } 

OP(02) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(22) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(42) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(62) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(82) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(a2) { int tmp; M6502_ICount -= 2; RD_IMM; LDX;		  } 
OP(c2) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(e2) {		  M6502_ICount -= 2;		 ILL;		  } 

OP(12) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(32) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(52) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(72) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(92) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(b2) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(d2) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(f2) {		  M6502_ICount -= 2;		 ILL;		  } 

OP(03) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(23) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(43) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(63) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(83) {		  M6502_ICount -= 2;		 ILL;		  } 
OP(a3) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(c3) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(e3) {		  M6502_ICount -= 2;		 ILL;		  }  

OP(13) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(33) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(53) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(73) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(93) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(b3) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(d3) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(f3) {		  M6502_ICount -= 2;		 ILL;		  }  

OP(04) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(24) { int tmp; M6502_ICount -= 3; RD_ZPG; BIT;		  } 
OP(44) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(64) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(84) { int tmp; M6502_ICount -= 3;		 STY; WR_ZPG; } 
OP(a4) { int tmp; M6502_ICount -= 3; RD_ZPG; LDY;		  } 
OP(c4) { int tmp; M6502_ICount -= 3; RD_ZPG; CPY;		  } 
OP(e4) { int tmp; M6502_ICount -= 3; RD_ZPG; CPX;		  } 

OP(14) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(34) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(54) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(74) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(94) { int tmp; M6502_ICount -= 4;		 STY; WR_ZPX; } 
OP(b4) { int tmp; M6502_ICount -= 4; RD_ZPX; LDY;		  } 
OP(d4) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(f4) {		  M6502_ICount -= 2;		 ILL;		  }  

OP(05) { int tmp; M6502_ICount -= 3; RD_ZPG; ORA;		  } 
OP(25) { int tmp; M6502_ICount -= 3; RD_ZPG; AND;		  } 
OP(45) { int tmp; M6502_ICount -= 3; RD_ZPG; EOR;		  } 
OP(65) { int tmp; M6502_ICount -= 3; RD_ZPG; ADC;		  } 
OP(85) { int tmp; M6502_ICount -= 3;		 STA; WR_ZPG; } 
OP(a5) { int tmp; M6502_ICount -= 3; RD_ZPG; LDA;		  } 
OP(c5) { int tmp; M6502_ICount -= 3; RD_ZPG; CMP;		  } 
OP(e5) { int tmp; M6502_ICount -= 3; RD_ZPG; SBC;		  } 

OP(15) { int tmp; M6502_ICount -= 4; RD_ZPX; ORA;		  } 
OP(35) { int tmp; M6502_ICount -= 4; RD_ZPX; AND;		  } 
OP(55) { int tmp; M6502_ICount -= 4; RD_ZPX; EOR;		  } 
OP(75) { int tmp; M6502_ICount -= 4; RD_ZPX; ADC;		  } 
OP(95) { int tmp; M6502_ICount -= 4;		 STA; WR_ZPX; } 
OP(b5) { int tmp; M6502_ICount -= 4; RD_ZPX; LDA;		  } 
OP(d5) { int tmp; M6502_ICount -= 4; RD_ZPX; CMP;		  } 
OP(f5) { int tmp; M6502_ICount -= 4; RD_ZPX; SBC;		  } 

OP(06) { int tmp; M6502_ICount -= 5; RD_ZPG; ASL; WB_EA;  } 
OP(26) { int tmp; M6502_ICount -= 5; RD_ZPG; ROL; WB_EA;  } 
OP(46) { int tmp; M6502_ICount -= 5; RD_ZPG; LSR; WB_EA;  } 
OP(66) { int tmp; M6502_ICount -= 5; RD_ZPG; ROR; WB_EA;  } 
OP(86) { int tmp; M6502_ICount -= 3;		 STX; WR_ZPG; } 
OP(a6) { int tmp; M6502_ICount -= 3; RD_ZPG; LDX;		  } 
OP(c6) { int tmp; M6502_ICount -= 5; RD_ZPG; DEC; WB_EA;  } 
OP(e6) { int tmp; M6502_ICount -= 5; RD_ZPG; INC; WB_EA;  } 

OP(16) { int tmp; M6502_ICount -= 6; RD_ZPX; ASL; WB_EA;  } 
OP(36) { int tmp; M6502_ICount -= 6; RD_ZPX; ROL; WB_EA;  } 
OP(56) { int tmp; M6502_ICount -= 6; RD_ZPX; LSR; WB_EA;  } 
OP(76) { int tmp; M6502_ICount -= 6; RD_ZPX; ROR; WB_EA;  } 
OP(96) { int tmp; M6502_ICount -= 4;		 STX; WR_ZPY; } 
OP(b6) { int tmp; M6502_ICount -= 4; RD_ZPY; LDX;		  } 
OP(d6) { int tmp; M6502_ICount -= 6; RD_ZPX; DEC; WB_EA;  } 
OP(f6) { int tmp; M6502_ICount -= 6; RD_ZPX; INC; WB_EA;  } 

OP(07) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(27) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(47) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(67) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(87) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(a7) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(c7) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(e7) {		  M6502_ICount -= 2;		 ILL;		  }  

OP(17) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(37) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(57) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(77) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(97) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(b7) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(d7) {		  M6502_ICount -= 2;		 ILL;		  }  
OP(f7) {		  M6502_ICount -= 2;		 ILL;		  }  

OP(08) {		  M6502_ICount -= 2;		 PHP;		  } 
OP(28) {		  M6502_ICount -= 2;		 PLP;		  } 
OP(48) {		  M6502_ICount -= 2;		 PHA;		  } 
OP(68) {		  M6502_ICount -= 2;		 PLA;		  } 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -