Skip to content

Commit

Permalink
Fixed turbo mode switch
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-jonsson committed Nov 8, 2023
1 parent b644a40 commit 6611c64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion front/sdl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions front/sdl/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void help_window(mu_Context *ctx) {

const char *text_l =
"<F11>\n"
"<Alt+F11>\n"
"<Ctrl+F11>\n"
"<F12>\n"
"<Alt+F12>\n"
Expand All @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions lib/vxt/ppi.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct ppi {
vxt_byte xt_switches;

vxt_byte command;
vxt_byte refresh_request;
bool keyboard_enable;
bool turbo_enabled;

Expand All @@ -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:
Expand Down

0 comments on commit 6611c64

Please sign in to comment.