X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=emulator.c;h=8129e2944374364b57f55b742f085f4b42c62825;hb=75bbc70be87a8f63f02ce6a57f23f5fb1d9c5787;hp=1cf79f3f899b4283a5bdd5818ff091db173ff8fc;hpb=b2121be23f388a760c0ff1985b5aa904906a702c;p=pistorm diff --git a/emulator.c b/emulator.c index 1cf79f3..8129e29 100644 --- a/emulator.c +++ b/emulator.c @@ -109,6 +109,8 @@ char keyboard_file[256] = "/dev/input/event1"; uint64_t trig_irq = 0, serv_irq = 0; uint16_t irq_delay = 0; +unsigned int amiga_reset=0, amiga_reset_last=0; +unsigned int do_reset=0; void *ipl_task(void *args) { printf("IPL thread running\n"); @@ -139,6 +141,24 @@ void *ipl_task(void *args) { //usleep(0); } } + if(do_reset==0) + { + amiga_reset=(value & (1 << PIN_RESET)); + if(amiga_reset!=amiga_reset_last) + { + amiga_reset_last=amiga_reset; + if(amiga_reset==0) + { + printf("Amiga Reset is down...\n"); + do_reset=1; + M68K_END_TIMESLICE; + } + else + { + printf("Amiga Reset is up...\n"); + } + } + } /*if (gayle_ide_enabled) { if (((gayle_int & 0x80) || gayle_a4k_int) && (get_ide(0)->drive[0].intrq || get_ide(0)->drive[1].intrq)) { @@ -211,6 +231,15 @@ cpu_loop: last_irq = 0; } }*/ + if (do_reset) { + cpu_pulse_reset(); + m68k_pulse_reset(); + do_reset=0; + usleep(1000000); // 1sec +// while(amiga_reset==0); +// printf("CPU emulation reset.\n"); + } + if (mouse_hook_enabled && (mouse_extra != 0x00)) { // mouse wheel events have occurred; unlike l/m/r buttons, these are queued as keypresses, so add to end of buffer