return (dmamask & dmacon) && (dmacon & 0x200);
}
+#define SPCFLAG_CPUINRESET 2
#define SPCFLAG_COPPER 4
#define SPCFLAG_INT 8
#define SPCFLAG_BRK 16
extern void exception2_write(uae_u32 opcode, uaecptr addr, int size, uae_u32 val, int fc);
extern void exception2_fetch_opcode(uae_u32 opcode, int offset, int pcoffset);
extern void exception2_fetch(uae_u32 opcode, int offset, int pcoffset);
-extern void m68k_reset (void);
-extern bool cpureset (void);
-extern void cpu_halt (int id);
+extern void m68k_reset(void);
+extern bool cpureset(void);
+extern void cpu_halt(int id);
+extern void cpu_inreset(void);
extern int cpu_sleep_millis(int ms);
extern void cpu_change(int newmodel);
extern void cpu_fallback(int mode);
-extern void fill_prefetch (void);
+extern void fill_prefetch(void);
extern void fill_prefetch_020_ntx(void);
extern void fill_prefetch_030_ntx(void);
extern void fill_prefetch_030_ntx_continue(void);
}
}
-void inputdevice_do_keyboard (int code, int state)
+void inputdevice_do_keyboard(int code, int state)
{
#ifdef CDTV
if (code >= 0x72 && code <= 0x77) { // CDTV keys
- if (cdtv_front_panel (-1)) {
+ if (cdtv_front_panel(-1)) {
// front panel active
if (!state)
return;
- cdtv_front_panel (code - 0x72);
+ cdtv_front_panel(code - 0x72);
return;
}
}
memset(keybuf, 0, sizeof(keybuf));
send_internalevent(INTERNALEVENT_KBRESET);
if (keyboard_reset_seq >= 5 * 50) {
+ custom_reset(true, true);
uae_reset(1, 1);
} else {
if (currprefs.cs_resetwarning && resetwarning_do(0))
return;
+ custom_reset(false, true);
uae_reset(0, 1);
}
keyboard_reset_seq = 0;
}
if (key == AK_RESETWARNING) {
- resetwarning_do (0);
+ resetwarning_do(0);
return;
} else if ((keybuf[AK_CTRL] || keybuf[AK_RCTRL]) && keybuf[AK_LAMI] && keybuf[AK_RAMI]) {
int r = keybuf[AK_LALT] | keybuf[AK_RALT];
keyboard_reset_seq = 1;
if (!currprefs.cs_resetwarning || !resetwarning_do(0)) {
custom_reset(false, true);
+ cpu_inreset();
}
}
}
- if (record_key ((uae_u8)((key << 1) | (key >> 7)))) {
+ if (record_key((uae_u8)((key << 1) | (key >> 7)))) {
if (inputdevice_logging & 1)
- write_log (_T("Amiga key %02X %d\n"), key & 0x7f, key >> 7);
+ write_log(_T("Amiga key %02X %d\n"), key & 0x7f, key >> 7);
}
return;
}
- inputdevice_add_inputcode (code, state, NULL);
+ inputdevice_add_inputcode(code, state, NULL);
}
// these need cpu trace data
}
#endif
+ while ((regs.spcflags & SPCFLAG_CPUINRESET)) {
+ x_do_cycles(4 * CYCLE_UNIT);
+ if (regs.spcflags & SPCFLAG_COPPER) {
+ do_copper();
+ }
+ if (!(regs.spcflags & SPCFLAG_CPUINRESET) || (regs.spcflags & SPCFLAG_BRK) || (regs.spcflags & SPCFLAG_MODE_CHANGE)) {
+ break;
+ }
+ }
+
while ((regs.spcflags & SPCFLAG_BLTNASTY) && dmaen (DMA_BLITTER) && cycles > 0 && ((currprefs.waiting_blits && currprefs.cpu_model >= 68020) || !currprefs.blitter_cycle_exact)) {
int c = blitnasty();
if (c < 0) {
do_specialties (0);
}
-void cpu_halt (int id)
+void cpu_inreset(void)
+{
+ set_special(SPCFLAG_CPUINRESET);
+ regs.s = 1;
+ regs.intmask = 7;
+ MakeSR();
+}
+
+void cpu_halt(int id)
{
// id < 0: m68k halted, PPC active.
// id > 0: emulation halted.
maybe_disable_fpu();
m68k_reset_delay = currprefs.reset_delay;
set_special(SPCFLAG_CHECK);
+ unset_special(SPCFLAG_CPUINRESET);
send_internalevent(INTERNALEVENT_CPURESET);
if (cpuboard_forced_hardreset()) {
custom_reset_cpu(false, false);