Skip to content

Commit

Permalink
Fix for spurious RMB detection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
reinauer committed Jan 1, 2024
1 parent 3099615 commit c93f98e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bootmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit c93f98e

Please sign in to comment.