1 /*** m6809: Portable 6809 emulator ******************************************/
2 
3 #ifndef _M6809_H
4 #define _M6809_H
5 
6 #include "memory.h"
7 #include "osd_cpu.h"
8 
9 enum {
10 	M6809_PC=1, M6809_S, M6809_CC ,M6809_A, M6809_B, M6809_U, M6809_X, M6809_Y,
11 	M6809_DP, M6809_NMI_STATE, M6809_IRQ_STATE, M6809_FIRQ_STATE };
12 
13 #define M6809_IRQ_LINE	0	/* IRQ line number */
14 #define M6809_FIRQ_LINE 1   /* FIRQ line number */
15 
16 /* PUBLIC GLOBALS */
17 extern int  m6809_ICount;
18 
19 
20 /* PUBLIC FUNCTIONS */
21 extern void m6809_init(void);
22 extern void m6809_reset(void *param);
23 extern void m6809_exit(void);
24 extern int m6809_execute(int cycles);  /* NS 970908 */
25 extern unsigned m6809_get_context(void *dst);
26 extern void m6809_set_context(void *src);
27 extern unsigned m6809_get_reg(int regnum);
28 extern void m6809_set_reg(int regnum, unsigned val);
29 extern void m6809_set_irq_line(int irqline, int state);
30 extern void m6809_set_irq_callback(int (*callback)(int irqline));
31 extern const char *m6809_info(void *context,int regnum);
32 extern unsigned m6809_dasm(char *buffer, unsigned pc);
33 
34 /****************************************************************************/
35 /* Read a byte from given memory location                                   */
36 /****************************************************************************/
37 /* ASG 971005 -- changed to cpu_readmem16/cpu_writemem16 */
38 #define M6809_RDMEM(Addr) ((unsigned)cpu_readmem16(Addr))
39 
40 /****************************************************************************/
41 /* Write a byte to given memory location                                    */
42 /****************************************************************************/
43 #define M6809_WRMEM(Addr,Value) (cpu_writemem16(Addr,Value))
44 
45 /****************************************************************************/
46 /* Z80_RDOP() is identical to Z80_RDMEM() except it is used for reading     */
47 /* opcodes. In case of system with memory mapped I/O, this function can be  */
48 /* used to greatly speed up emulation                                       */
49 /****************************************************************************/
50 #define M6809_RDOP(Addr) ((unsigned)cpu_readop(Addr))
51 
52 /****************************************************************************/
53 /* Z80_RDOP_ARG() is identical to Z80_RDOP() except it is used for reading  */
54 /* opcode arguments. This difference can be used to support systems that    */
55 /* use different encoding mechanisms for opcodes and opcode arguments       */
56 /****************************************************************************/
57 #define M6809_RDOP_ARG(Addr) ((unsigned)cpu_readop_arg(Addr))
58 
59 #ifndef FALSE
60 #    define FALSE 0
61 #endif
62 #ifndef TRUE
63 #    define TRUE (!FALSE)
64 #endif
65 
66 #ifdef MAME_DEBUG
67 extern unsigned Dasm6809 (char *buffer, unsigned pc);
68 #endif
69 
70 #endif /* _M6809_H */
71