From c93f98ea6a48906b9ae115c0448f562348c112d7 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 1 Jan 2024 12:12:41 -0800 Subject: [PATCH] Fix for spurious RMB detection This fixes kavanoz' basement bug where a ReAmiga3000 would always end up in the A4091 boot menu while being run in the basement, but the same problem would not happen on the upper floor. --- bootmenu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootmenu.c b/bootmenu.c index 6b5846f..d27f5a7 100644 --- a/bootmenu.c +++ b/bootmenu.c @@ -809,13 +809,14 @@ void boot_menu(void) /* Open graphics.library for WaitTOF */ GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",0); + IntuitionBase = OpenLibrary("intuition.library", 0); /* * Configure Paula POTGO LX + LY pins (Port 0 Button 2 + 3) as * output high. Paula implements a pull-up on the pins in this * mode, which may be overdriven (low) by a mouse button press. */ - *(volatile UWORD *)REG_POTGO = 0x0f00; + *(volatile UWORD *)REG_POTGO = 0xff00; /* Wait for Paula to refresh GPIO state */ WaitTOF(); @@ -824,11 +825,11 @@ void boot_menu(void) /* Check right mouse button */ if (REG_POTGOR_DATLY & *(volatile UWORD *)REG_POTGOR) { printf("RMB mouse not pressed.\n"); + CloseLibrary((struct Library *)IntuitionBase); CloseLibrary((struct Library *)GfxBase); return; } - IntuitionBase = OpenLibrary("intuition.library", 0); // Hack!? InitResident(FindResident("gadtools.library"), 0); GadToolsBase = OpenLibrary("gadtools.library",36);