2 // Virtual 65C02 Header file
\r
4 // by James L. Hammons
\r
5 // (c) 2005 Underground Software
\r
15 #define FLAG_N 0x80 // Negative
\r
16 #define FLAG_V 0x40 // oVerflow
\r
17 #define FLAG_UNK 0x20 // ??? (always set when read?)
\r
18 #define FLAG_B 0x10 // Break
\r
19 #define FLAG_D 0x08 // Decimal
\r
20 #define FLAG_I 0x04 // Interrupt
\r
21 #define FLAG_Z 0x02 // Zero
\r
22 #define FLAG_C 0x01 // Carry
\r
24 #define V65C02_ASSERT_LINE_RESET 0x0001 // v65C02 RESET line
\r
25 #define V65C02_ASSERT_LINE_IRQ 0x0002 // v65C02 IRQ line
\r
26 #define V65C02_ASSERT_LINE_NMI 0x0004 // v65C02 NMI line
\r
27 #define V65C02_STATE_ILLEGAL_INST 0x0008 // Illegal instruction executed flag
\r
28 //#define V65C02_START_DEBUG_LOG 0x0020 // Debug log go (temporary!)
\r
34 uint16 pc; // 65C02 PC register
\r
35 uint8 cc; // 65C02 Condition Code register
\r
36 uint8 sp; // 65C02 System stack pointer (bound to $01xx)
\r
37 uint8 a; // 65C02 A register
\r
38 uint8 x; // 65C02 X index register
\r
39 uint8 y; // 65C02 Y register
\r
40 uint32 clock; // 65C02 clock
\r
41 uint8 (* RdMem)(uint16); // Address of BYTE read routine
\r
42 void (* WrMem)(uint16, uint8); // Address of BYTE write routine
\r
43 uint16 cpuFlags; // v65C02 IRQ/RESET flags
\r
46 // Global variables (exported)
\r
48 extern bool dumpDis;
\r
50 // Function prototypes
\r
52 void Execute65C02(V65C02REGS *, uint32); // Function to execute 65C02 instructions
\r
53 uint32 GetCurrentV65C02Clock(void); // Get the clock of the currently executing CPU
\r
55 #endif // __V65C02_H__
\r