From 6611c641465fa088d2752cda78ecf867b7e9aeb9 Mon Sep 17 00:00:00 2001 From: Andreas 'phix' Jonsson Date: Wed, 8 Nov 2023 15:25:33 +0100 Subject: [PATCH] Fixed turbo mode switch --- front/sdl/main.c | 8 +++++++- front/sdl/window.c | 2 ++ lib/vxt/ppi.c | 3 +-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/front/sdl/main.c b/front/sdl/main.c index be0f081f..757aff17 100644 --- a/front/sdl/main.c +++ b/front/sdl/main.c @@ -983,7 +983,13 @@ int main(int argc, char *argv[]) { break; case SDL_KEYUP: if (e.key.keysym.sym == SDLK_F11) { - if ((e.key.keysym.mod & KMOD_CTRL)) { + if (e.key.keysym.mod & KMOD_ALT) { + printf("Toggle turbo!\n"); + SYNC( + vxt_byte data = ppi_device->io.in(VXT_GET_DEVICE_PTR(ppi_device), 0x61); + ppi_device->io.out(VXT_GET_DEVICE_PTR(ppi_device), 0x61, data ^ 4); + ); + } else if (e.key.keysym.mod & KMOD_CTRL) { open_window(ctx, "Eject"); } else { if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) { diff --git a/front/sdl/window.c b/front/sdl/window.c index 5208c7ea..37b74c29 100644 --- a/front/sdl/window.c +++ b/front/sdl/window.c @@ -63,6 +63,7 @@ void help_window(mu_Context *ctx) { const char *text_l = "\n" + "\n" "\n" "\n" "\n" @@ -72,6 +73,7 @@ void help_window(mu_Context *ctx) { const char *text_r = "Toggle fullscreen\n" + "Toggle CPU turbo mode\n" "Eject floppy disk image\n" "Show this help screen\n" "Debug break, if GDB module is loaded\n" diff --git a/lib/vxt/ppi.c b/lib/vxt/ppi.c index 633d58b6..3d8e922c 100644 --- a/lib/vxt/ppi.c +++ b/lib/vxt/ppi.c @@ -44,7 +44,6 @@ struct ppi { vxt_byte xt_switches; vxt_byte command; - vxt_byte refresh_request; bool keyboard_enable; bool turbo_enabled; @@ -69,7 +68,7 @@ static vxt_byte in(struct ppi *c, vxt_word port) { return data; } case 0x61: - return (c->port_61 & 0xEF) | c->refresh_request; + return c->port_61; case 0x62: return (c->port_61 & 8) ? (c->xt_switches >> 4) : (c->xt_switches & 0xF); case 0x64: