X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fv6809.h;h=380318c243bce63d9363873a1221efc19592262c;hb=756fbabdd25117272164fd2d31810e6018a5990e;hp=f62d1cfcc5be2589dbcfddb406c9d56bd75c539f;hpb=27ad8041c00ff80e50ba0ad9022c3eaa7a05b8b0;p=thunder diff --git a/src/v6809.h b/src/v6809.h old mode 100755 new mode 100644 index f62d1cf..380318c --- a/src/v6809.h +++ b/src/v6809.h @@ -1,26 +1,26 @@ // // Virtual 6809 Header file // -// by James L. Hammons +// by James Hammons // -// (c) 1997, 2004 Underground Software +// (C) 1997, 2014 Underground Software // #ifndef __V6809_H__ #define __V6809_H__ -#include "types.h" +#include // Useful defines -#define FLAG_E 0x80 // Entire -#define FLAG_F 0x40 // Fast IRQ -#define FLAG_H 0x20 // Half carry -#define FLAG_I 0x10 // IRQ -#define FLAG_N 0x08 // Negative -#define FLAG_Z 0x04 // Zero -#define FLAG_V 0x02 // oVerflow -#define FLAG_C 0x01 // Carry +#define FLAG_E 0x80 // Entire +#define FLAG_F 0x40 // Fast IRQ +#define FLAG_H 0x20 // Half carry +#define FLAG_I 0x10 // IRQ +#define FLAG_N 0x08 // Negative +#define FLAG_Z 0x04 // Zero +#define FLAG_V 0x02 // oVerflow +#define FLAG_C 0x01 // Carry #define V6809_ASSERT_LINE_RESET 0x0001 // v6809 RESET line #define V6809_ASSERT_LINE_IRQ 0x0002 // v6809 IRQ line @@ -28,31 +28,36 @@ #define V6809_ASSERT_LINE_NMI 0x0008 // v6809 NMI line #define V6809_STATE_SYNC 0x0010 // v6809 SYNC line #define V6809_STATE_ILLEGAL_INST 0x0020 // Illegal instruction executed flag - //#define V6809_START_DEBUG_LOG EQU 0020h // Debug log go (temporary!) // Useful structs struct V6809REGS { - WORD pc; // 6809 PC register - WORD x; // 6809 X index register - WORD y; // 6809 Y index register - WORD s; // 6809 System stack pointer - WORD u; // 6809 User stack pointer - BYTE cc; // 6809 Condition Code register - BYTE a; // 6809 A register - BYTE b; // 6809 B register - BYTE dp; // 6809 Direct Page register - DWORD clock; // 6809 clock -//DWORD _reserved;// BYTE (* Fetch)(WORD&); // Address of BYTE fetch routine - BYTE (* RdMem)(WORD); // Address of BYTE read routine - void (* WrMem)(WORD, BYTE); // Address of BYTE write routine - DWORD cpuFlags; // v6809 IRQ/RESET flags + uint16_t pc; // 6809 PC register + uint16_t x; // 6809 X index register + uint16_t y; // 6809 Y index register + uint16_t s; // 6809 System stack pointer + uint16_t u; // 6809 User stack pointer + uint8_t cc; // 6809 Condition Code register + uint8_t a; // 6809 A register + uint8_t b; // 6809 B register + uint8_t dp; // 6809 Direct Page register +// uint32_t clock; // 6809 clock (@ 1 MHz, wraps at 71.5 minutes) + uint64_t clock; // 6809 clock (@ 1 MHz, wraps at 570842 years) + uint8_t (* RdMem)(uint16_t); // Address of uint8_t read routine + void (* WrMem)(uint16_t, uint8_t); // Address of uint8_t write routine + uint32_t cpuFlags; // v6809 IRQ/RESET flags + uint32_t clockOverrun; }; // Function prototypes -void Execute6809(V6809REGS *, DWORD); // Function to execute 6809 instructions +void Execute6809(V6809REGS *, uint32_t); // Function to execute 6809 instructions +uint64_t GetCurrentV6809Clock(void); // Get the clock of the currently executing CPU +uint16_t GetCurrentV6809PC(void); // Get the PC of the currently executing CPU +void SetLineOfCurrentV6809(uint32_t line); // Set a line of the currently executing CPU +void ClearLineOfCurrentV6809(uint32_t line); // Clear a line of the currently executing CPU #endif // __V6809_H__ +