From b00a01b948a8a1d7d7128c40a313e62bf6b11993 Mon Sep 17 00:00:00 2001 From: Marcio T Date: Wed, 1 Dec 2021 12:23:36 -0700 Subject: [PATCH] Bug fixes. --- mac-cpp-source/Iomega Tester.rsrc.bin | Bin 3456 -> 3456 bytes mac-cpp-source/Iomega Tester.µ.bin | Bin 18432 -> 18432 bytes mac-cpp-source/tip/tip_aspi.cpp | 3 +- mac-cpp-source/tip/tip_main.cpp | 85 ++++++++++++++++++-------- 4 files changed, 63 insertions(+), 25 deletions(-) diff --git a/mac-cpp-source/Iomega Tester.rsrc.bin b/mac-cpp-source/Iomega Tester.rsrc.bin index d925f64b736d79119cecf4320728b22e93474c3e..8bf07a3ec933f86998abf9798a551dd640943630 100644 GIT binary patch delta 762 zcmah_J4nMo82;~)P#dZsS}Ihji-W~MOx1#lK~xk$A~vE9K89`;1$Ucvs*{$u3erWX z4iz076&xJWsSb4rWOnz_Mg1>H9~Q)K`JQ(_S`iwS&B0e;tzKIy}KH;dyQ?zVB?;Nf#zDo-Xd%fe5p(OqMcqV-SEi8&w6G&ufCJ z%E$#|#pca7g2|d- z`j7=TQ7%K1WyFUIrt1#F%3r>MXzbar>RDHD?zGR>@4(oB{XMoS_t%43ixC@C$83RH zJ>~W5irA8D?*8-aIqqHfYcxqR5RyYiv5`&F@g<3|X_gGe_QFIOHw?2RZ8K3Uu^gF^ zG-0y3j%wb_&JG_TLyJEqUIm`RiO@5>BCFIQGI!4!BGa3==bRUEqbGs1-tOD$=5iwm zNMQ+3M!g4V2%>)Fa>LX5sjrtuF`z&AIwL5epnZP>(5St)H9wB0=A2xRaZ`5nBbSTZ O>fY8U&&K*p>(~$3YiYay delta 759 zcmZpWZjhdkC~G>4fq@~{$dB zfIONas2Y%_`~UxMwqWjHss}plKOBJF3FiSBAOWKIP-WQEBa4C9Kmaq6fk7Kt0K$eV zKyV=%CMrtTgLR@y5Y2C3;0GD-0p14AO10n`ts!S;fcgIN#) z#>Yi7ILQC7{{w<{HTHj)|FH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`(9(MM6Jbyvy46~{5AJGMD`?rTIP1UDgSiu G4fY?m^Zt_n diff --git a/mac-cpp-source/tip/tip_aspi.cpp b/mac-cpp-source/tip/tip_aspi.cpp index 859634e..b0e5299 100644 --- a/mac-cpp-source/tip/tip_aspi.cpp +++ b/mac-cpp-source/tip/tip_aspi.cpp @@ -274,7 +274,8 @@ long EnumerateIomegaDevices(uint8_t *DrivesSkipped) { // On the Mac, we want to ignore drives that have media in them at // program entry, as this means the volume is mounted in Mac OS - const bool driveEmpty = GetCartridgeStatus(Device) == DISK_NOT_PRESENT; + JazDrive = isJaz; + const bool driveEmpty = (GetCartridgeStatus(Device) == DISK_NOT_PRESENT); if(driveEmpty) { DriveArray[DriveCount].flags = flags; DriveArray[DriveCount].scsi_id = Device; diff --git a/mac-cpp-source/tip/tip_main.cpp b/mac-cpp-source/tip/tip_main.cpp index 8376ebd..1b20221 100644 --- a/mac-cpp-source/tip/tip_main.cpp +++ b/mac-cpp-source/tip/tip_main.cpp @@ -5,9 +5,11 @@ #include #include +#include #include #include +#include "TrapAvail.h" #include "pstring.h" #include "LaunchLib.h" #include "mac_vol.h" @@ -34,7 +36,8 @@ void DisposeTipWindow(); void AddTipMenus(); void RunCommandLine(); void DoEvent(EventRecord &event, RgnHandle *cursorRgn); -void DoMenuEvent(EventRecord &event); +void DoMenuEventPostSIOUX(EventRecord &event); +bool DoMenuSelection(long choice); void DoUpdate(WindowPtr window); void DoMouseDown(EventRecord &event); void DoMouseMove(EventRecord &event, RgnHandle *cursorRegion); @@ -144,6 +147,13 @@ void NewTipWindow() { } void AddTipMenus() { + if(!TrapAvailable(0xAA66)) { + // If MenuChoice is available, we can let SIOUX handle the menus, + // otherwise we have to handle it ourselves + SIOUXSettings.setupmenus = FALSE; + } + + // Add our menu tipMenu = GetMenu(128); InsertMenu(tipMenu, 0); DrawMenuBar(); @@ -204,36 +214,54 @@ void DoEvent(EventRecord &event, RgnHandle *cursorRgn) { case osEvt: DoMouseMove(event, cursorRgn); break; } } else { // Trap unhandled SIOUX menu events - DoMenuEvent(event); + DoMenuEventPostSIOUX(event); } } -void DoMenuEvent(EventRecord &event) { - // SIOUX will handle the menu event, but we can check after the fact - // to see whether the user selected one of our menus +void DoMenuEventPostSIOUX(EventRecord &event) { + if(!SIOUXSettings.setupmenus) return; + + /* If MenuChoice is available, it is best to let SIOUX handle the menu + * event so Copy and Paste will work. We can check after the fact + * to see whether the user selected one of our menus using MenuChoice. + * However, if that trap is not available, we must handle the menu + * ourselves and certain menu items will not work + */ WindowPtr thisWindow; - if(event.what == mouseDown && FindWindow(event.where, &thisWindow) == inMenuBar) { - long int choice = MenuChoice(); - int menuId = HiWord(choice); - int itemId = LoWord(choice); - switch(menuId) { - case 32000: // Apple menu - SysBeep(10); - break; - case 32001: // File menu - if (itemId == 9) { - WndProc(WM_COMMAND, IDB_QUIT); - } - break; - case 32002: // Edit menu - case 128: // TIP menu - switch(itemId) { - case 1: HiliteMenu(0); RunCommandLine(); break; - } - } + if((event.what == mouseDown) && (FindWindow(event.where, &thisWindow) == inMenuBar)) { + DoMenuSelection(MenuChoice()); + } +} + +bool DoMenuSelection(long choice) { + bool handled = false; + int menuId = HiWord(choice); + int itemId = LoWord(choice); + //printf("Menu choice: %d, %d\n", menuId, itemId); + switch(menuId) { + case 32000: // Apple menu SysBeep(10); + break; + case 32001: // File menu + if (itemId == 9) { // Quit + WndProc(WM_COMMAND, IDB_QUIT); + handled = true; + } + break; + case 32002: // Edit menu + break; + case 128: // TIP menu + switch(itemId) { + case 1: // Run Command Line... + HiliteMenu(0); + RunCommandLine(); + handled = true; + break; + } + break; } HiliteMenu(0); + return handled; } void DoUpdate(WindowPtr window) { @@ -257,6 +285,7 @@ void DoUpdate(WindowPtr window) { DrawEdge(&(*richText)->frame, BDR_SUNKENOUTER, BF_RECT); ReleaseDC(hExplainWnd); + SetColor(BLACK_COLOR); UpdateControls(window, window->visRgn); EndUpdate(window); @@ -311,6 +340,14 @@ void DoMouseDown(EventRecord &event) { gDone = true; } break; + case inMenuBar: + if(!DoMenuSelection(MenuSelect(event.where))) { + SysBeep(10); + } + break; + case inDrag: + DragWindow(thisWindow, event.where, &(*GetGrayRgn())->rgnBBox); + break; } }