]> Shamusworld >> Repos - apple2/blobdiff - src/v65c02.h
First stab at adding Mockingboard support.
[apple2] / src / v65c02.h
index 95c7885d7ca0c16cd599c8bb45da5a8d94a4b45d..52cb4e8694646d0eb0534fd24b16fd3c7ee5f5d1 100644 (file)
 
 // Useful defines
 
-#define FLAG_N         0x80                    // Negative
-#define FLAG_V         0x40                    // oVerflow
-#define FLAG_UNK       0x20                    // ??? (always set when read?)
-#define FLAG_B         0x10                    // Break
-#define FLAG_D         0x08                    // Decimal
-#define FLAG_I         0x04                    // Interrupt
-#define FLAG_Z         0x02                    // Zero
-#define FLAG_C         0x01                    // Carry
+#define FLAG_N         0x80            // Negative
+#define FLAG_V         0x40            // oVerflow
+#define FLAG_UNK       0x20            // ??? (always set when read?)
+#define FLAG_B         0x10            // Break
+#define FLAG_D         0x08            // Decimal
+#define FLAG_I         0x04            // Interrupt
+#define FLAG_Z         0x02            // Zero
+#define FLAG_C         0x01            // Carry
 
 #define V65C02_ASSERT_LINE_RESET       0x0001          // v65C02 RESET line
 #define V65C02_ASSERT_LINE_IRQ         0x0002          // v65C02 IRQ line
 
 struct V65C02REGS
 {
-       uint16_t pc;                                    // 65C02 PC register
-       uint8_t cc;                                             // 65C02 Condition Code register
-       uint8_t sp;                                             // 65C02 System stack pointer (bound to $01xx)
-       uint8_t a;                                              // 65C02 A register
-       uint8_t x;                                              // 65C02 X index register
-       uint8_t y;                                              // 65C02 Y register
-//     uint32_t clock;                                 // 65C02 clock (@ 1 MHz, wraps at 71.5 minutes)
-       uint64_t clock;                                 // 65C02 clock (@ 1 MHz, wraps at 570,842 years)
+       uint16_t pc;                            // 65C02 PC register
+       uint8_t cc;                                     // 65C02 Condition Code register
+       uint8_t sp;                                     // 65C02 System stack pointer (bound to $01xx)
+       uint8_t a;                                      // 65C02 A register
+       uint8_t x;                                      // 65C02 X index register
+       uint8_t y;                                      // 65C02 Y register
+       uint64_t clock;                         // 65C02 clock (@ 1 MHz, wraps at 570,842 years)
        uint8_t (* RdMem)(uint16_t);    // Address of BYTE read routine
        void (* WrMem)(uint16_t, uint8_t);      // Address of BYTE write routine
-       uint16_t cpuFlags;                              // v65C02 IRQ/RESET flags
-       uint64_t overflow;                              // # of cycles we went over last time through
+       void (* Timer)(uint16_t);       // Address of Timer routine
+       uint16_t cpuFlags;                      // v65C02 IRQ/RESET flags
+       uint64_t overflow;                      // # of cycles we went over last time through
 };
 
 // Global variables (exported)
@@ -53,5 +53,7 @@ extern bool dumpDis;
 
 void Execute65C02(V65C02REGS *, uint32_t);     // Function to execute 65C02 instructions
 uint64_t GetCurrentV65C02Clock(void);          // Get the clock of the currently executing CPU
+void AssertLine(uint16_t);             // Assert 65C02 line in current context
 
 #endif // __V65C02_H__
+