1 /*** konami: Portable Konami cpu emulator ******************************************/ 2 3 #ifndef _KONAMI_H 4 #define _KONAMI_H 5 6 #include "memory.h" 7 #include "osd_cpu.h" 8 9 enum { 10 KONAMI_PC=1, KONAMI_S, KONAMI_CC ,KONAMI_A, KONAMI_B, KONAMI_U, KONAMI_X, KONAMI_Y, 11 KONAMI_DP, KONAMI_NMI_STATE, KONAMI_IRQ_STATE, KONAMI_FIRQ_STATE }; 12 13 #define KONAMI_IRQ_LINE 0 /* IRQ line number */ 14 #define KONAMI_FIRQ_LINE 1 /* FIRQ line number */ 15 16 /* PUBLIC GLOBALS */ 17 extern int konami_ICount; 18 extern void (*konami_cpu_setlines_callback)( int lines ); /* callback called when A16-A23 are set */ 19 20 /* PUBLIC FUNCTIONS */ 21 extern void konami_init(void); 22 extern void konami_reset(void *param); 23 extern void konami_exit(void); 24 extern int konami_execute(int cycles); /* NS 970908 */ 25 extern unsigned konami_get_context(void *dst); 26 extern void konami_set_context(void *src); 27 extern unsigned konami_get_reg(int regnum); 28 extern void konami_set_reg(int regnum, unsigned val); 29 extern void konami_set_irq_line(int irqline, int state); 30 extern void konami_set_irq_callback(int (*callback)(int irqline)); 31 extern const char *konami_info(void *context,int regnum); 32 extern unsigned konami_dasm(char *buffer, unsigned pc); 33 34 /****************************************************************************/ 35 /* Read a byte from given memory location */ 36 /****************************************************************************/ 37 #define KONAMI_RDMEM(Addr) ((unsigned)cpu_readmem16(Addr)) 38 39 /****************************************************************************/ 40 /* Write a byte to given memory location */ 41 /****************************************************************************/ 42 #define KONAMI_WRMEM(Addr,Value) (cpu_writemem16(Addr,Value)) 43 44 /****************************************************************************/ 45 /* Z80_RDOP() is identical to Z80_RDMEM() except it is used for reading */ 46 /* opcodes. In case of system with memory mapped I/O, this function can be */ 47 /* used to greatly speed up emulation */ 48 /****************************************************************************/ 49 #define KONAMI_RDOP(Addr) ((unsigned)cpu_readop(Addr)) 50 51 /****************************************************************************/ 52 /* Z80_RDOP_ARG() is identical to Z80_RDOP() except it is used for reading */ 53 /* opcode arguments. This difference can be used to support systems that */ 54 /* use different encoding mechanisms for opcodes and opcode arguments */ 55 /****************************************************************************/ 56 #define KONAMI_RDOP_ARG(Addr) ((unsigned)cpu_readop_arg(Addr)) 57 58 #ifndef FALSE 59 # define FALSE 0 60 #endif 61 #ifndef TRUE 62 # define TRUE (!FALSE) 63 #endif 64 65 #ifdef MAME_DEBUG 66 extern unsigned Dasmknmi (char *buffer, unsigned pc); 67 #endif 68 69 #endif /* _KONAMI_H */ 70