diff options
author | Zsolt Vasvari <zsoltvas@mamedev.org> | 2008-01-21 08:58:19 +0000 |
---|---|---|
committer | Zsolt Vasvari <zsoltvas@mamedev.org> | 2008-01-21 08:58:19 +0000 |
commit | 892153bd09efc01520f8bfdef70af0063e551250 (patch) | |
tree | 9fab3df342e65db4084db615a23419b4353cff15 | |
parent | 45995624fff26ccd585188f925e4b523bb86af5b (diff) |
- Fixed saving callbacks across a reset
- Added 'pull' callback for the SID pin. This is needed by the Red Alert voice board
-rw-r--r-- | src/emu/cpu/i8085/i8085.c | 10 | ||||
-rw-r--r-- | src/emu/cpu/i8085/i8085.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c index bc205a3254b..a7d9e237cb5 100644 --- a/src/emu/cpu/i8085/i8085.c +++ b/src/emu/cpu/i8085/i8085.c @@ -144,6 +144,7 @@ typedef struct { INT8 irq_state[4]; int (*irq_callback)(int); void (*sod_callback)(int state); + int (*sid_callback)(void); } i8085_Regs; static int i8085_ICount = 0; @@ -313,6 +314,8 @@ INLINE void execute_one(int opcode) if( I.cputype ) { i8085_ICount -= 7; /* RIM */ I.AF.b.h = I.IM; + if (I.sid_callback) + I.AF.b.h = (I.AF.b.h & 0x7f) | ((*I.sid_callback)() ? 0x80 : 0); I.AF.b.h |= RIM_IEN; RIM_IEN = 0; //AT: read and clear IEN status latch } else { i8085_ICount -= 4; /* NOP undocumented */ @@ -1340,12 +1343,18 @@ static void i8085_init(int index, int clock, const void *config, int (*irqcallba static void i8085_reset(void) { int (*save_irqcallback)(int); + void (*save_sodcallback)(int); + int (*save_sidcallback)(void); int cputype_bak = I.cputype; init_tables(); save_irqcallback = I.irq_callback; + save_sodcallback = I.sod_callback; + save_sidcallback = I.sid_callback; memset(&I, 0, sizeof(i8085_Regs)); I.irq_callback = save_irqcallback; + I.sod_callback = save_sodcallback; + I.sid_callback = save_sidcallback; change_pc(I.PC.d); I.cputype = cputype_bak; @@ -1612,6 +1621,7 @@ static void i8085_set_info(UINT32 state, cpuinfo *info) /* --- the following bits of info are set as pointers to data or functions --- */ case CPUINFO_PTR_I8085_SOD_CALLBACK: I.sod_callback = (void (*)(int))info->f; break; + case CPUINFO_PTR_I8085_SID_CALLBACK: I.sid_callback = (int (*)(void))info->f; break; } } diff --git a/src/emu/cpu/i8085/i8085.h b/src/emu/cpu/i8085/i8085.h index f364218e32e..aa3497cc872 100644 --- a/src/emu/cpu/i8085/i8085.h +++ b/src/emu/cpu/i8085/i8085.h @@ -12,6 +12,7 @@ enum { enum { CPUINFO_PTR_I8085_SOD_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC, + CPUINFO_PTR_I8085_SID_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC + 1, CPUINFO_INT_I8085_SID = CPUINFO_INT_CPU_SPECIFIC }; |