From 2e2dcbd827f1b3107a6b8f6d643305e69a9a1a00 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sun, 22 Mar 2020 16:44:21 +0800 Subject: [PATCH] happy commit --- DeclData/DeclVideo/VideoDrivers.make | 11 + Drivers/Backlight/Backlight.make | 17 +- Drivers/Backlight/PWM.c | 280 +- Drivers/Backlight/Register.c | 131 +- Drivers/Backlight/backlight.a | 454 +- Drivers/Backlight/backlight.c | 142 +- Drivers/Backlight/backlight.h | 44 +- Drivers/Drivers.make | 10 +- Drivers/Sony/Sony.make | 12 + Drivers/Video/TFBDriver.a | 13 +- Interfaces/AIncludes/ATalkEqu.a | 5 + Interfaces/AIncludes/ATalkEqu.a.idump | 1 + Interfaces/AIncludes/AppleTalk.a | 9 +- Interfaces/AIncludes/FSPrivate.a | 11 +- Interfaces/AIncludes/GestaltEqu.a | 8 + Interfaces/AIncludes/PackMacs.a | 5 + Interfaces/AIncludes/PackMacs.a.idump | 1 + Interfaces/AIncludes/PaletteEqu.a | 5 + Interfaces/AIncludes/PaletteEqu.a.idump | 1 + Interfaces/AIncludes/PrEqu.a | 5 + Interfaces/AIncludes/PrEqu.a.idump | 1 + Interfaces/AIncludes/PrintCallsEqu.a | 5 + Interfaces/AIncludes/PrintCallsEqu.a.idump | 1 + Interfaces/AIncludes/QDOffscreenEqu.a | 5 + Interfaces/AIncludes/QDOffscreenEqu.a.idump | 1 + Interfaces/AIncludes/QuickEqu.a | 5 + Interfaces/AIncludes/QuickEqu.a.idump | 1 + Interfaces/AIncludes/SCSIEqu.a | 5 + Interfaces/AIncludes/SCSIEqu.a.idump | 1 + Interfaces/AIncludes/ScriptEqu.a | 5 + Interfaces/AIncludes/ScriptEqu.a.idump | 1 + Interfaces/AIncludes/ShutDownEqu.a | 5 + Interfaces/AIncludes/ShutDownEqu.a.idump | 1 + Interfaces/AIncludes/SlotEqu.a | 5 + Interfaces/AIncludes/SlotEqu.a.idump | 1 + Interfaces/AIncludes/SonyEqu.a | 14 +- Interfaces/AIncludes/ToolEqu.a | 5 + Interfaces/AIncludes/ToolEqu.a.idump | 1 + Interfaces/AIncludes/Traps.a | 22 +- Interfaces/AIncludes/VideoEqu.a | 5 + Interfaces/AIncludes/VideoEqu.a.idump | 1 + Interfaces/CIncludes/Desk.h | 8 + Interfaces/CIncludes/Devices.h | 9 + Interfaces/CIncludes/GestaltEqu.h | 21 +- Interfaces/CIncludes/Sound.h | 517 ++ Interfaces/CIncludes/Sound.h.idump | 1 + Interfaces/CIncludes/Sound.h.rdump | 176 + Interfaces/PInterfaces/Sound.p | 461 ++ Interfaces/PInterfaces/Sound.p.idump | 1 + Interfaces/RIncludes/Types.r | 24 +- Internal/Asm/AppleDeskBusPriv.a | 13 +- Internal/Asm/CommToolboxPriv.a | 11 +- Internal/Asm/Decompression.a | 10 + Internal/Asm/DecompressorPatchEqu.a | 5 + Internal/Asm/DecompressorPatchEqu.a.idump | 1 + Internal/Asm/HardwarePrivateEqu.a | 105 +- Internal/Asm/InternalOnlyEqu.a | 8 + Internal/Asm/ROMPrivateEqu.a | 5 + Internal/Asm/ROMPrivateEqu.a.idump | 1 + Internal/Asm/SysPrivateEqu.a | 22 +- Internal/Asm/egretequ.a | 10 +- Make/ForceRomBindOrder.a | 653 ++ Make/System.make | 551 ++ OS/Gestalt/GestaltLookup.c | 9 +- OS/HFS/Cache/DiskCache.a | 9 +- OS/HFS/Extensions/BTPScan.a | 13 +- OS/HFS/Extensions/BTreeMgr/BTreeFuncs.a | 19 +- OS/HFS/Extensions/BTreeMgr/BTreeMgr.make | 15 +- OS/HFS/Extensions/BTreeMgr/BTreeSvcs.a | 10 + OS/HFS/Extensions/CatSearch.a | 15 +- OS/HFS/Extensions/DTDBMgr.a | 284 +- OS/HFS/Extensions/ExternalMakeFSSpec.a | 16 +- OS/HFS/Extensions/FileIDs.a | 83 +- OS/HFS/Extensions/FileIDsSvcs.a | 89 +- OS/HFS/Extensions/MakeFSSpec.a | 31 +- OS/HFS/FileMgrPatches.a | 222 +- OS/HFS/HFS.make | 54 +- OS/MMU/MMU.make | 12 + OS/PPC/PPCDsp.c | 491 ++ OS/SCSIMgr/SCSILinkPatch.a | 9 + OS/SCSIMgr/SCSIMgr96.a | 93 +- OS/SCSIMgr/SCSIMgrHW96.a | 133 +- OS/SCSIMgr/SCSIMgrInit96.a | 15 +- Patches/BeforePatches.a | 8 + Patches/EDiskLocalNamePatch.a | 55 + Patches/EDiskLocalNamePatch.a.idump | 1 + Patches/FinalInitialization.a | 86 + Patches/FinalInitialization.a.idump | 1 + Patches/LoadPatches.a | 24 +- Patches/LowMemoryPrintingPatches.a | 483 ++ Patches/LowMemoryPrintingPatches.a.idump | 1 + Patches/MiscPatches.a | 104 +- Patches/PatchIIROM.a | 8 + Patches/PatchIIciROM.a | 141 +- Patches/ProcessManagerSegmentTweaks.a | 19 +- Patches/VideoPatch.a | 10 + ProcessMgr/DAHandler.a | 23 + ProcessMgr/DAHandler.c | 12 +- ProcessMgr/Eppc.c | 9 +- ProcessMgr/EppcPrivate.h | 12 + ProcessMgr/Glue.h | 12 + ProcessMgr/ProcessMgr.make | 257 + ProcessMgr/ProcessMgr.make.idump | 1 + ProcessMgr/ProcessMgrMisc.a | 22 + ProcessMgr/Processes.c | 10 + ProcessMgr/Startup.c | 21 +- ProcessMgr/Switch.a | 33 +- ProcessMgr/Switch.c | 11 +- ProcessMgr/WindowMgrPatches.c | 11 +- QuickDraw/Classic/Text.m.a | 4 + QuickDraw/Text.a | 22 + Toolbox/ComponentMgr/ThingManagerPatch.a | 38 + Toolbox/ControlMgr/ButtonCDEF.a | 9 +- Toolbox/ControlMgr/ControlMgr.make | 47 +- Toolbox/ControlMgr/ControlMgrExtensions.a | 36 +- Toolbox/ControlMgr/PopupCDEF.c | 14 +- Toolbox/ControlMgr/ScrollBarCDEF.a | 222 +- Toolbox/DataAccessMgr/DataAccessMgr.c | 28 +- Toolbox/DialogMgr/DialogDispatch.a | 32 +- Toolbox/DialogMgr/DialogMgr.make | 36 +- Toolbox/DialogMgr/DialogMgrPatches.a | 11 +- Toolbox/DialogMgr/ModalDialogMenuExtensions.a | 54 + Toolbox/DialogMgr/ModalDialogMenuPatches.a | 10 + Toolbox/DiskInit/DiskInit.make | 46 + Toolbox/DiskInit/DiskInitBadBlock.c | 17 +- Toolbox/FontMgr/BassExtensions.a | 391 +- Toolbox/FontMgr/Bass_Allocate.a | 11 +- Toolbox/FontMgr/FontFolderExtension.a | 54 +- Toolbox/FontMgr/FontMgr.a | 116 +- Toolbox/FontMgr/FontMgr.make | 51 +- Toolbox/FontMgr/OutlineMetrics.a | 9 +- .../Source/PartialFontExtensions.c | 17 +- Toolbox/HelpMgr/BalloonExtensions.a | 9 +- Toolbox/HelpMgr/BalloonPACK.a | 9 +- Toolbox/HelpMgr/BalloonPACK.p | 23 +- Toolbox/HelpMgr/HelpMgr.make | 24 +- Toolbox/IconUtils/IconUtils.a | 16 +- Toolbox/IconUtils/IconUtils.make | 19 +- Toolbox/ListMgr/TextLDEF.a | 9 +- Toolbox/MenuMgr/InvalMenuBarPatch.a | 61 + Toolbox/MenuMgr/StandardMBDF.a | 13 +- Toolbox/MenuMgr/StandardMDEF.a | 11 +- Toolbox/NotificationMgr/NotificationMgr.c | 38 +- Toolbox/NotificationMgr/NotificationMgr.make | 24 +- Toolbox/Printing/PrintGlue.a | 20 +- Toolbox/ResourceMgr/ResourceMgr.make | 29 +- Toolbox/ResourceMgr/ResourceMgrExtensions.a | 353 +- Toolbox/ResourceMgr/ResourceMgrPatches.a | 248 +- Toolbox/ResourceMgr/ResourceOverridePatches.a | 23 + Toolbox/ScriptMgr/International.r | 15 +- Toolbox/ScriptMgr/RomanNewJust.a | 9 +- Toolbox/ScriptMgr/ScriptMgr.make | 98 + Toolbox/ScriptMgr/ScriptMgrExtensions.a | 16 +- Toolbox/ScriptMgr/ScriptMgrInit.a | 198 +- Toolbox/ScriptMgr/ScriptMgrKbdMenu.a | 83 +- Toolbox/ScriptMgr/ScriptMgrMisc.a | 52 +- Toolbox/ScriptMgr/ScriptMgrUtilDate.a | 82 +- Toolbox/SoundMgr/SoundMgr.make | 25 + Toolbox/SoundMgr/SoundMgrPatch.a | 5598 +++++++++++++++++ Toolbox/SoundMgr/Tables.3.a | 308 + Toolbox/StandardFile/StandardFilePACK.a | 12 +- Toolbox/Toolbox.make | 150 + Toolbox/WindowMgr/LayerMgr.c | 63 +- Toolbox/WindowMgr/StandardWDEF.a | 22 +- Toolbox/WindowMgr/WindowList.a | 9 +- 165 files changed, 13455 insertions(+), 2355 deletions(-) create mode 100644 Interfaces/AIncludes/ATalkEqu.a create mode 100644 Interfaces/AIncludes/ATalkEqu.a.idump create mode 100644 Interfaces/AIncludes/PackMacs.a create mode 100644 Interfaces/AIncludes/PackMacs.a.idump create mode 100644 Interfaces/AIncludes/PaletteEqu.a create mode 100644 Interfaces/AIncludes/PaletteEqu.a.idump create mode 100644 Interfaces/AIncludes/PrEqu.a create mode 100644 Interfaces/AIncludes/PrEqu.a.idump create mode 100644 Interfaces/AIncludes/PrintCallsEqu.a create mode 100644 Interfaces/AIncludes/PrintCallsEqu.a.idump create mode 100644 Interfaces/AIncludes/QDOffscreenEqu.a create mode 100644 Interfaces/AIncludes/QDOffscreenEqu.a.idump create mode 100644 Interfaces/AIncludes/QuickEqu.a create mode 100644 Interfaces/AIncludes/QuickEqu.a.idump create mode 100644 Interfaces/AIncludes/SCSIEqu.a create mode 100644 Interfaces/AIncludes/SCSIEqu.a.idump create mode 100644 Interfaces/AIncludes/ScriptEqu.a create mode 100644 Interfaces/AIncludes/ScriptEqu.a.idump create mode 100644 Interfaces/AIncludes/ShutDownEqu.a create mode 100644 Interfaces/AIncludes/ShutDownEqu.a.idump create mode 100644 Interfaces/AIncludes/SlotEqu.a create mode 100644 Interfaces/AIncludes/SlotEqu.a.idump create mode 100644 Interfaces/AIncludes/ToolEqu.a create mode 100644 Interfaces/AIncludes/ToolEqu.a.idump create mode 100644 Interfaces/AIncludes/VideoEqu.a create mode 100644 Interfaces/AIncludes/VideoEqu.a.idump create mode 100644 Interfaces/CIncludes/Sound.h create mode 100644 Interfaces/CIncludes/Sound.h.idump create mode 100644 Interfaces/CIncludes/Sound.h.rdump create mode 100644 Interfaces/PInterfaces/Sound.p create mode 100644 Interfaces/PInterfaces/Sound.p.idump create mode 100644 Internal/Asm/DecompressorPatchEqu.a create mode 100644 Internal/Asm/DecompressorPatchEqu.a.idump create mode 100644 Internal/Asm/ROMPrivateEqu.a create mode 100644 Internal/Asm/ROMPrivateEqu.a.idump create mode 100644 Make/ForceRomBindOrder.a create mode 100644 Make/System.make create mode 100644 OS/PPC/PPCDsp.c create mode 100644 Patches/EDiskLocalNamePatch.a create mode 100644 Patches/EDiskLocalNamePatch.a.idump create mode 100644 Patches/FinalInitialization.a create mode 100644 Patches/FinalInitialization.a.idump create mode 100644 Patches/LowMemoryPrintingPatches.a create mode 100644 Patches/LowMemoryPrintingPatches.a.idump create mode 100644 ProcessMgr/ProcessMgr.make create mode 100644 ProcessMgr/ProcessMgr.make.idump create mode 100644 Toolbox/ComponentMgr/ThingManagerPatch.a create mode 100644 Toolbox/DiskInit/DiskInit.make create mode 100644 Toolbox/SoundMgr/SoundMgr.make create mode 100644 Toolbox/SoundMgr/SoundMgrPatch.a create mode 100644 Toolbox/SoundMgr/Tables.3.a create mode 100644 Toolbox/Toolbox.make diff --git a/DeclData/DeclVideo/VideoDrivers.make b/DeclData/DeclVideo/VideoDrivers.make index aa4acf7..4118890 100644 --- a/DeclData/DeclVideo/VideoDrivers.make +++ b/DeclData/DeclVideo/VideoDrivers.make @@ -1,3 +1,10 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added rule to build .Display_Video_Apple_TFB DRVR from TFBDriver.a +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: VideoDrivers.make # @@ -358,6 +365,10 @@ VideoDriverObjs = "{ObjDir}JMFBDriver.a.o" ∂ "{IntAIncludes}ComVideoEqu.a" Asm {StdAOpts} -o "{Targ}" "{VideoDriverDir}TFBDriver.a" +# +"{RsrcDir}TFBDriver.a.rsrc" ƒ "{ObjDir}TFBDriver.a.o" + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} "{ObjDir}TFBDriver.a.o" + "{ObjDir}TFBPrimaryInit.a.o" ƒ "{VideoDriverDir}TFBDepVideoEqu.a" ∂ "{VideoDriverDir}TFBPrimaryInit.a" ∂ diff --git a/Drivers/Backlight/Backlight.make b/Drivers/Backlight/Backlight.make index 7da76d5..01c0aa8 100644 --- a/Drivers/Backlight/Backlight.make +++ b/Drivers/Backlight/Backlight.make @@ -1,3 +1,11 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Restored missing source files to the Backlight DRVR build +# Made build rule for linked patch file backlightpatch.a +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: Backlight.make # @@ -20,13 +28,20 @@ # Backlight driver BL_DRVR_OBJ = "{ObjDir}backlight.c.o" ∂ - "{ObjDir}backlight.a.o" + "{ObjDir}backlight.a.o" ∂ + "{ObjDir}pwm.c.o" # ∂ + "{ObjDir}register.c.o" # ∂ + "{CLibraries}StdCLib.o" # "{ObjDir}backlight.a.o" ƒ "{AIncludes}SysEqu.a" ∂ "{AIncludes}SysErr.a" ∂ "{BackLightDir}backlight.a" Asm -o {Targ} "{BackLightDir}backlight.a" {StdAOpts} +# +"{ObjDir}backlightpatch.a.o" ƒ "{BackLightDir}backlightpatch.a" + Asm -o {Targ} "{BackLightDir}backlightpatch.a" {StdAOpts} + "{ObjDir}backlight.c.o" ƒ "{BackLightDir}backlight.h" ∂ "{BackLightDir}PowerMgr.h" ∂ "{CIncludes}SysEqu.h" ∂ diff --git a/Drivers/Backlight/PWM.c b/Drivers/Backlight/PWM.c index 56647eb..85efd6c 100644 --- a/Drivers/Backlight/PWM.c +++ b/Drivers/Backlight/PWM.c @@ -1,3 +1,13 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted Horror and SuperMario changes + Brought Get_AtoD/Get_PGEButton/GetPortableValues/PotControl back from backlightinput.c + Recreated PWMStatus (similar code to PWMControl) + Reduced the amount of indirection through global procedure pointers + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: PWM.c @@ -78,30 +88,86 @@ #include "PowerMgr.h" #include "backlight.h" +/* copied from backlightcpu.c */ +#define BACKLIGHT_POT_CHANNEL 0 +#define STATUS 0 +#define POWERBYTE 1 +#define TEMPBYTE 2 + +/* reclaimed from backlightinput.c */ +#define READ_ATOD_CHANNEL 0xD8 +#define READ_BUTTON_VALUE 0xD9 +extern short PotInputRangeShiftTblPWM[]; + +/* enable access to these assembly "procedures" (really tables) */ +extern unsigned char timTblLow[]; +extern unsigned char timTbl[]; +extern unsigned char asahiTbl[]; +extern short PWMMaxTbl[]; + /*page *************************************************************************************************** ** PWM software *********************************************************************************** *************************************************************************************************** */ -OSErr InitPWMControls(driverGlobalPtr globalPtr) +/* don't return OSErr */ +/* reverted to old-style tables despite */ +void InitPWMControls(driverGlobalPtr globalPtr) { unsigned int startvalue; + int boxFlag; + + /* setup default values */ + globalPtr->flyByWire = true; + globalPtr->freeflag = true; + globalPtr->dualTable = true; + globalPtr->userInputSampleRate = 10; + globalPtr->maximumTable = &PWMMaxTbl; + globalPtr->settingTableLow = &timTblLow; + globalPtr->settingTable = globalPtr->settingTableHigh = &timTbl; + + /* override for some specific machines */ + boxFlag = *(unsigned char *)0xCB3; + switch (boxFlag) + { + case 18: // PowerBook 100, Asahi + globalPtr->freeflag = false; + globalPtr->dualTable = false; + globalPtr->settingTable = &asahiTbl; + break; + case 15: // PowerBook 170, TIM + if (*JAWS_SPEED_FSTN_REG_PTR & JAWS_FSTN) + globalPtr->dualTable = false; + break; + } /* initialize dual table variables */ if (globalPtr->dualTable) { globalPtr->slewLimit = true; /* maximum change per/accrun */ - (*globalPtr->tableProc)(globalPtr); /* determine table based on current charger state */ + + /* determine table directly instead of using a tableProc */ + globalPtr->lowThreshold = 163; + globalPtr->hiThreshold = 173; + globalPtr->tableProc = ChargerAdjust; + globalPtr->lowTable = LowTable(globalPtr); + if (globalPtr->lowTable) + globalPtr->settingTable = globalPtr->settingTableLow; }; + /* not really sure why these procs weren't being set */ + globalPtr->setlevelproc = SetPWM; + globalPtr->userInputProc = PotControl; + globalPtr->closeProc = PWMCloseRoutine; + globalPtr->controlProc = PWMControl; + globalPtr->statusProc = PWMStatus; + /* initialize backlight hardware */ - startvalue = (*globalPtr->userInputProc)(globalPtr); /* */ + startvalue = PotControl(globalPtr); /* */ globalPtr->userBrightness = -1; - globalPtr->userBrightness = (*globalPtr->setlevelproc)(startvalue,globalPtr); /* */ - - return(noErr); + globalPtr->userBrightness = SetPWM(startvalue,globalPtr); /* */ }; /* @@ -113,10 +179,155 @@ OSErr InitPWMControls(driverGlobalPtr globalPtr) int PWMCloseRoutine (driverGlobalPtr globalPtr) { - (*globalPtr->setlevelproc)(globalPtr->settingTable->minimum,globalPtr); + SetPWM(0,globalPtr); /* no global setlevelproc */ return(0); }; +/* + *************************************************************************************************** + * + * + *************************************************************************************************** + */ + +/* moved from bottom of file and edited */ +/* reverted to old-style tables despite */ +int SetPWM(int new,driverGlobalPtr globalPtr) +{ + PMgrPBlock pb; /* power manager pb */ + unsigned char val; /* hardware value setting */ + + PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], 0); /* use new tables */ /* limit value to valid range */ + val = globalPtr->settingTable[new]; /* look up value from table */ + + if ((globalPtr->userBrightness >= 0) && (val == globalPtr->lastHWSetting)) return(new);/* nothing to do; 90/05/15 just turn on; 90/07/02 avoid touching */ + if (globalPtr->slewChange) + { + if (abs(globalPtr->lastHWSetting - val) > globalPtr->slewLimit) + val = globalPtr->lastHWSetting + ((globalPtr->lastHWSetting > val) ? -globalPtr->slewLimit : globalPtr->slewLimit); + else + globalPtr->slewChange = false; + }; + globalPtr->lastHWSetting = val; /* save the new hardware setting */ + + pb.pmgrCmd = ScreenSetCmd; /* don't do what they do */ /* everyone else uses "set brightness" */ + pb.pmgrCnt = 1; + pb.pmgrXPtr = &val; + pb.pmgrRPtr = nil; + PMgr(&pb); /* set the pwm */ + + return(new); /* return the current value */ +}; + +/*page + *************************************************************************************************** + * + * + *************************************************************************************************** + */ + +/* verbatim from backlightinput.c */ +unsigned char Get_AtoD(int channel) +{ + PMgrPBlock pb; /* power manager pb */ + char atodChannel; /* a to d channel to read [0-8] */ + unsigned char value; /* return value */ + OSErr error; /* pmgr error */ + + + atodChannel = channel; /* load channel value into buffer */ + + pb.pmgrCmd = READ_ATOD_CHANNEL; /* load read channel command */ + pb.pmgrCnt = 1; /* transmit buffer count is 1 byte */ + pb.pmgrXPtr = &atodChannel; /* pointer to transmit buffer */ + pb.pmgrRPtr = &value; /* pointer to receive buffer */ + + error = PMgr(&pb); + + return( (error) ? 0 : value); +}; + +/*page + *************************************************************************************************** + * + * + *************************************************************************************************** + */ + +/* verbatim from backlightinput.c */ +unsigned char Get_PGEButton(int channel) +{ + PMgrPBlock pb; /* power manager pb */ + char atodChannel; /* a to d channel to read [0-8] */ + unsigned char value; /* return value */ + OSErr error; /* pmgr error */ + + + atodChannel = channel; /* load channel value into buffer */ + + pb.pmgrCmd = READ_BUTTON_VALUE; /* load read channel command */ + pb.pmgrCnt = 1; /* transmit buffer count is 1 byte */ + pb.pmgrXPtr = &atodChannel; /* pointer to transmit buffer */ + pb.pmgrRPtr = &value; /* pointer to receive buffer */ + + error = PMgr(&pb); + + return( (error) ? 0 : value); +}; + +/*page + *************************************************************************************************** + * + * + *************************************************************************************************** + */ +/* verbatim from backlightinput.c */ +unsigned char GetPortableValues(int parameter) +{ + + PMgrPBlock pb; /* power manager pb */ + OSErr err; /* power manager error */ + unsigned char rbuf[3]; /* buffer for send command */ + + pb.pmgrCmd = BatteryStatusImmCmd; /* on old pmgr, read battery status (immediate not averaged) */ + pb.pmgrCnt = 0; + pb.pmgrXPtr = nil; + pb.pmgrRPtr = rbuf; + + err = PMgr(&pb); + return( (err) ? 0 : rbuf[parameter]); /* return 0 if error, else read value */ +} + +/*page + *************************************************************************************************** + * + * + *************************************************************************************************** + */ +/* modified from backlightinput.c */ +int PotControl (driverGlobalPtr globalPtr) + +{ +#pragma unused (globalPtr) + + unsigned int potvalue; + + /* no proc for this in driver globals */ + potvalue = globalPtr->freeflag ? Get_AtoD(BACKLIGHT_POT_CHANNEL) : GetPortableValues(TEMPBYTE); + + if (abs(globalPtr->lastatod - potvalue) <= 5) /* was the change less than 100mv */ + potvalue = globalPtr->lastatod; /* is less than, the use old value */ + + globalPtr->lastatod = potvalue; /* update last a to d value */ + potvalue >>= 3; /* scale to 0 to 31 */ + if (potvalue) /* if non-zero, check for subrange limiting */ + { + potvalue >>= PotInputRangeShiftTblPWM[globalPtr->powerRange]; /* rescale in low power levels */ + if (!potvalue) potvalue = 1; /* make sure we don't change the backlight state */ + }; + return(potvalue); +}; + /*page *************************************************************************************************** * @@ -144,7 +355,7 @@ OSErr PWMControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' entry p { case kSetScreenBrightness: /* set brightness level */ tempvalue = ctlPB->csParam[0]; - globalPtr->userBrightness = (*globalPtr->setlevelproc)(tempvalue,globalPtr); + globalPtr->userBrightness = SetPWM(tempvalue,globalPtr); /* no proc for this in driver globals */ break; default: @@ -154,37 +365,44 @@ OSErr PWMControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' entry p return(error); }; -/* +/*page *************************************************************************************************** * + * The status routine… + * + * return: + * noErr - task completed successfully + * statusErr - illegal status selector + * * *************************************************************************************************** */ -int SetPWM(int new,driverGlobalPtr globalPtr) +/* recreated from scratch */ +OSErr PWMStatus(CntrlParam *ctlPB,driverGlobalPtr globalPtr) { - PMgrPBlock pb; /* power manager pb */ - unsigned char val; /* hardware value setting */ - - PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], globalPtr->settingTable->minimum); /* use new tables */ /* limit value to valid range */ - val = globalPtr->settingTable->table[new]; /* look up value from table */ + OSErr error; - if ((globalPtr->userBrightness >= 0) && (val == globalPtr->lastHWSetting)) return(new);/* nothing to do; 90/05/15 just turn on; 90/07/02 avoid touching */ - if (globalPtr->slewChange) + error = noErr; + + switch(ctlPB->csCode) { - if (abs(globalPtr->lastHWSetting - val) > globalPtr->slewLimit) - val = globalPtr->lastHWSetting + ((globalPtr->lastHWSetting > val) ? -globalPtr->slewLimit : globalPtr->slewLimit); - else - globalPtr->slewChange = false; + case kGetScreenBrightness: /* get brightness level */ + ctlPB->csParam[0] = globalPtr->userBrightness; + break; + + case kGetBrightnessRange: + ctlPB->csParam[0] = 31; + ctlPB->csParam[1] = 0; + break; + + case kGetMaximum: + ctlPB->csParam[0] = globalPtr->maximumTable[globalPtr->powerRange]; + break; + + default: + error = statusErr; }; - globalPtr->lastHWSetting = val; /* save the new hardware setting */ - - pb.pmgrCmd = SetBrightnessCmd; /* everyone else uses "set brightness" */ - pb.pmgrCnt = 1; - pb.pmgrXPtr = &val; - pb.pmgrRPtr = nil; - PMgr(&pb); /* set the pwm */ - - return(new); /* return the current value */ -}; + return(error); +} diff --git a/Drivers/Backlight/Register.c b/Drivers/Backlight/Register.c index 4246197..6368430 100644 --- a/Drivers/Backlight/Register.c +++ b/Drivers/Backlight/Register.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted Horror and SuperMario changes + Brought ChargerAdjust/LowTable back from backlight.c + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: register.c @@ -117,7 +125,10 @@ typedef struct char keymodifiers; short unused; } posteventtype, *posteventtypeptr; -extern setTableType PortableTbl5V; +extern posteventtype postEventData; +extern unsigned char PortableTbl5V[]; +extern unsigned char PortableTable7V[]; +extern short PortableMaxTbl[]; int GetBacklightInfo(short mask, short shift); void SaveBacklightInfo(short new,short mask, short shift); @@ -125,23 +136,86 @@ void SaveBacklightInfo(short new,short mask, short shift); TurnOnOff(Boolean on); setNewKeys(int keycombo); +/*page + *************************************************************************************************** + * + * + *************************************************************************************************** + */ +/* verbatim from backlight.c */ +void ChargerAdjust (driverGlobalPtr globalPtr) +{ + unsigned int oldTable; + + oldTable = globalPtr->lowTable; /* save the current table being used */ + globalPtr->lowTable = LowTable(globalPtr); /* get the new table to use */ + if (globalPtr->lowTable == oldTable) return; /* are we changing tables ???, no exit */ + + globalPtr->slewChange = true; /* if change, set tmp slew on */ + globalPtr->settingTable = globalPtr->lowTable ? globalPtr->settingTableLow :globalPtr->settingTableHigh ; +}; + +/*page + *************************************************************************************************** + * + * + *************************************************************************************************** + */ +/* verbatim from backlight.c */ +unsigned int LowTable (driverGlobalPtr globalPtr) + +{ + PmgrGlobals **pmgrglobalhdl; /* handle to power manager globals */ + Boolean wasLowTable; /* current table being used */ + Boolean hiTable; /* use hi level table now */ + + pmgrglobalhdl = (PmgrGlobals **) 0x0D18; /* handle to power manager globals */ + + wasLowTable = globalPtr->lowTable; /* current table */ + hiTable = false; /* assume low table */ + if ((wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->hiThreshold)) || + (!wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->lowThreshold))) + { + hiTable = (*pmgrglobalhdl)->Charger & 0x01; /* qualify table with charger */ + }; + return(hiTable ? 0 : 1); /* return 1 if low table, 0 if high */ +}; + /*page *************************************************************************************************** ** Register control software ********************************************************************** *************************************************************************************************** */ -OSErr InitRegControls(driverGlobalPtr globalPtr) +/* don't return OSErr */ +/* reverted to old-style tables despite

*/ +void InitRegControls(driverGlobalPtr globalPtr) { int SetBrightness(); int KbdControl(); int RegisterClose(); - unsigned int pramBrightness; + OSErr RegisterStatus(CntrlParam *, driverGlobalPtr); + OSErr RegisterControl(CntrlParam *, driverGlobalPtr); + int pramBrightness; void ShutdownBacklight(); + posteventtypeptr postdataptr; - if (BACKLIGHTSIGREG & TABLE_5V) globalPtr->settingTable = &PortableTbl5V; + postdataptr = &postEventData; + postdataptr->keysActive = 0; + postdataptr->keymodifiers = 0; + + globalPtr->userInputSampleRate = 1; + + globalPtr->settingTable = (BACKLIGHTSIGREG & TABLE_5V) ? PortableTbl5V : PortableTable7V; + + globalPtr->maximumTable = &PortableMaxTbl; + globalPtr->setlevelproc = SetBrightness; + globalPtr->userInputProc = KbdControl; + globalPtr->closeProc = RegisterClose; + globalPtr->statusProc = RegisterStatus; + globalPtr->controlProc = RegisterControl; globalPtr->keycodes = GetPramKeyData(); pramBrightness = GetPramBrightness(); /* get pram setting */ @@ -149,13 +223,14 @@ OSErr InitRegControls(driverGlobalPtr globalPtr) setNewKeys(globalPtr->keycodes); if (pramBrightness < 0) /* check for valid brightness value */ { - pramBrightness = globalPtr->settingTable->minimum+1; /*

load default brightness */ - SaveBrightness(globalPtr->settingTable->minimum+1); /*

validate, as save new brightness */ + pramBrightness = 1; /*

load default brightness */ + SaveBrightness(1); /*

validate, as save new brightness */ }; - globalPtr->userBrightness = globalPtr->settingTable->maximum; /*

*/ - globalPtr->userBrightness = SetBrightness(globalPtr->settingTable->minimum,globalPtr); /*

initialize pot */ + globalPtr->userBrightness = 30; /*

*/ + globalPtr->lastHWSetting = globalPtr->settingTable[30]; + globalPtr->userBrightness = SetBrightness(0,globalPtr); /*

initialize pot */ globalPtr->userBrightness = SetBrightness(pramBrightness,globalPtr); /* set brightness level */ if (BACKLIGHTSIGREG == BACKLIGHTSIG_UPGRD) @@ -166,8 +241,6 @@ OSErr InitRegControls(driverGlobalPtr globalPtr) }; ShutDwnInstall( (ShutDwnProcPtr) ShutdownBacklight,sdRestartOrPower); /* install shutdown task */ - - return(noErr); }; /*page @@ -266,6 +339,7 @@ TurnOnOff(Boolean on) * *************************************************************************************************** */ +/* reverted to old-style tables despite

*/ int SetBrightness(int new, driverGlobalPtr globalPtr) { unsigned char regvalue; @@ -274,20 +348,16 @@ int SetBrightness(int new, driverGlobalPtr globalPtr) char signature; Boolean onBitHigh; Boolean countDownBit; - int current; unsigned char tablevalue; Boolean initialize; initialize = (globalPtr->userBrightness < 0); - PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], globalPtr->settingTable->minimum); /*

limit value to valid range */ - current = (initialize) - ? globalPtr->settingTable->minimum /*

*/ - : globalPtr->userBrightness; + PEG_TO_LIMITS(new, globalPtr->maximumTable[globalPtr->powerRange], 0); /*

limit value to valid range */ - tablevalue = globalPtr->settingTable->table[new]; /*

look up value from table */ - if (!initialize && (tablevalue == globalPtr->lastHWSetting) ) + tablevalue = globalPtr->settingTable[new]; /*

look up value from table */ + if (tablevalue == globalPtr->lastHWSetting) return(new); /* nothing to do; 90/05/15 just turn on; 90/07/02 avoid touching */ /* setup control bits */ @@ -297,13 +367,13 @@ int SetBrightness(int new, driverGlobalPtr globalPtr) backlightreg = (Ptr) PORTABLE_HW; regvalue = COUNT_BIT + L_CS_BIT; /* start with count and CS inactive */ - if ((onBitHigh && (new != globalPtr->settingTable->minimum)) || (!onBitHigh && (new == globalPtr->settingTable->minimum))) /*

*/ + if ((onBitHigh && new) || (!onBitHigh && !new)) /*

*/ regvalue |= ON_BIT; /* upgrade has opposite polarity */ - if ((countDownBit && (new <= current)) || (!countDownBit && (new >= current))) + if ((countDownBit && (new <= globalPtr->userBrightness)) || (!countDownBit && (new >= globalPtr->userBrightness))) regvalue |= COUNTDN_BIT; /* set the count down bit if new > current */ - strobes = (new == globalPtr->settingTable->minimum) /*

*/ + strobes = (new == 0) /*

*/ ? MAXSTROBECOUNT /* if minimum, bang against stops */ : abs(globalPtr->lastHWSetting - tablevalue); @@ -407,11 +477,12 @@ int KbdControl (driverGlobalPtr globalPtr) * *************************************************************************************************** */ +/* reverted to old-style tables despite

*/ int RegisterClose (driverGlobalPtr globalPtr) { - globalPtr->userBrightness = globalPtr->settingTable->maximum; /*

*/ - globalPtr->userBrightness = SetBrightness(globalPtr->settingTable->minimum,globalPtr); /*

initialize pot */ + globalPtr->userBrightness = 30; /*

*/ + globalPtr->userBrightness = SetBrightness(0,globalPtr); /*

initialize pot */ SleepQRemove(&globalPtr->sleepQelement); /* remove sleep task */ ShutDwnRemove( (ShutDwnProcPtr) ShutdownBacklight); /* remove shutdown task */ @@ -445,7 +516,7 @@ OSErr RegisterControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' en { case kSetScreenBrightness: /* set brightness level */ tempvalue = ctlPB->csParam[0]; - globalPtr->userBrightness = (*globalPtr->setlevelproc)(tempvalue,globalPtr); + globalPtr->userBrightness = SetBrightness(tempvalue,globalPtr); /* no proc for this in driver globals */ break; case kSaveScreenBrightness: /* save brightness level */ SaveBrightness(globalPtr->userBrightness); @@ -488,15 +559,25 @@ OSErr RegisterStatus(CntrlParam *ctlPB,driverGlobalPtr globalPtr) /* 'open' en error = noErr; switch(ctlPB->csCode) { + case kGetScreenBrightness: /* */ + ctlPB->csParam[0] = globalPtr->userBrightness; + break; case kGetBrightnessKeys: /* return current saved brightness */ ctlPB->csParam[0] = globalPtr->keycodes; break; + case kGetBrightnessRange: /* */ + ctlPB->csParam[0] = 30; + ctlPB->csParam[1] = 0; + break; case kGetPBacklight: ctlPB->csParam[0] = GetPramBrightness(); break; case kGetPKey: ctlPB->csParam[0] = GetPramKeyData(); break; + case kGetMaximum: /* */ + ctlPB->csParam[0] = globalPtr->maximumTable[globalPtr->powerRange]; + break; default: error = statusErr; @@ -508,11 +589,15 @@ setNewKeys(int keycombo) { char newKey; + posteventtypeptr postdataptr; newKey = 0; if (keycombo & 0x01) newKey |= 0x10; if (keycombo & 0x02) newKey |= 0x02; if (keycombo & 0x04) newKey |= 0x08; + /* would interact with (alas unused) MyPostEvent patch */ + postdataptr = &postEventData; + postdataptr->keymodifiers = newKey; }; diff --git a/Drivers/Backlight/backlight.a b/Drivers/Backlight/backlight.a index 04800dc..d77bd93 100644 --- a/Drivers/Backlight/backlight.a +++ b/Drivers/Backlight/backlight.a @@ -1,3 +1,14 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted Horror and SuperMario changes +; For some reason, <6> needed to be put back in +; Guessed the name of the unused _PostEvent patch +; Removed tables for DB and Dartanian +; Removed per-machine tables (in favour of C init code) +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: backlight.a ; @@ -92,6 +103,40 @@ VBLEntry PROC EXPORT rts +;---------------------------------------------------------------------------------- +; +MyPostEvent PROC EXPORT ; + movem.l d1/a1,-(sp) + lea postEventData,a1 + move.l a0,d1 + tst.b 5(a1) ; postEventData.keymodifiers + beq.s @noKey + cmp.w #3,d1 + beq.s @specialMode + tst.b 4(a1) ; postEventData.keysActive + beq.s @noKey + cmp.w #5,d1 + bne.s @noKey + bra.s @return +@specialMode move.w $17A,d1 + rol.w #1,d1 ; d1=1 if command key down + cmp.b 5(a1),d1 + bne.s @noKey + +@yesKey st 4(a1) ; postEventData.keysActive + bra.s @return + +@noKey sf 4(a1) ; postEventData.keysActive + move.l 0(a1),a1 + jsr (a1) + +@return movem.l (sp)+,d1/a1 + rts + + EXPORT postEventData +postEventData dcb.b 8,0 ; see struct in Register.c + + ;----------------------------------------------------------------------------------- ; ; @@ -105,28 +150,11 @@ SleepEntry PROC EXPORT move.l (sp)+,d0 clr.l d0 rts ; -;-------------------------------------------------------------------------------------------------------------- -; -GetBkltPrimInfo proc export - with PmgrRec,PmgrPrimitivesRec - - movea.l PmgrBase,a0 ; point to power manager globals - LoadTbl BklightTblPtr,a0,a0 ; get backlight table pointer in a0 - move.l a0,d0 ; move pointer to d0 for C return - rts - - - - - END ;----------------------------------------------------------------------------------- ; PortableTable7V PROC EXPORT - dc.w 0 ; minimum value - dc.w @end - @start ; - -@start dc.b 0 ; 0 + dc.b 0 ; 0 ; ex dc.b 1 ; 1 dc.b 2 ; 2 dc.b 3 ; 3 @@ -156,16 +184,14 @@ PortableTable7V PROC EXPORT dc.b 36 ; 27 dc.b 40 ; 28 dc.b 45 ; 29 -@end dc.b 50 ; 30 + dc.b 50 ; 30 + dc.b 0 ;-------------------------------------------------------------------------------------------------------------- ; PortableTbl5V PROC EXPORT - dc.w 0 ; minimum value - dc.w @end - @start ; -@start - dc.b 0 ; 0 + dc.b 0 ; 0 ; ex dc.b 2 ; 1 dc.b 5 ; 2 dc.b 7 ; 3 @@ -195,55 +221,62 @@ PortableTbl5V PROC EXPORT dc.b 66 ; 27 dc.b 70 ; 28 dc.b 75 ; 29 -@end dc.b 80 ; 30 + dc.b 80 ; 30 + dc.b 0 + + +;------------------------------------------------------------------------------------------------------------- +; +; moved from lower down in the file +PortableMaxTbl PROC EXPORT ; power range + dc.w 30 ; 0 + dc.w 15 ; 1 + dc.w 15 ; 2 + dc.w 7 ; 3 + dc.w 3 ; 4 ;-------------------------------------------------------------------------------------------------------------- ; asahiTbl PROC EXPORT - dc.w 0 ; minimum value - dc.w @end - @start ; - -@start dc.b 0 ; 0 - dc.b 1 ; 1 - dc.b 2 ; 2 - dc.b 3 ; 3 - dc.b 4 ; 4 - dc.b 5 ; 5 - dc.b 6 ; 6 - dc.b 7 ; 7 - dc.b 8 ; 8 - dc.b 9 ; 9 - dc.b 10 ; 10 - dc.b 11 ; 11 - dc.b 12 ; 12 - dc.b 13 ; 13 - dc.b 14 ; 14 - dc.b 15 ; 15 - dc.b 16 ; 16 - dc.b 17 ; 17 - dc.b 18 ; 18 - dc.b 19 ; 19 - dc.b 20 ; 20 - dc.b 21 ; 21 - dc.b 22 ; 22 - dc.b 23 ; 23 - dc.b 24 ; 24 + dc.b 0 ; 0 ; ex and redo <6> + dc.b 5 ; 1 + dc.b 6 ; 2 + dc.b 7 ; 3 + dc.b 8 ; 4 + dc.b 9 ; 5 + dc.b 10 ; 6 + dc.b 10 ; 7 + dc.b 11 ; 8 + dc.b 12 ; 9 + dc.b 13 ; 10 + dc.b 14 ; 11 + dc.b 15 ; 12 + dc.b 15 ; 13 + dc.b 16 ; 14 + dc.b 17 ; 15 + dc.b 18 ; 16 + dc.b 19 ; 17 + dc.b 20 ; 18 + dc.b 20 ; 19 + dc.b 21 ; 20 + dc.b 22 ; 21 + dc.b 23 ; 22 + dc.b 24 ; 23 + dc.b 25 ; 24 dc.b 25 ; 25 dc.b 26 ; 26 dc.b 27 ; 27 dc.b 28 ; 28 dc.b 29 ; 29 dc.b 30 ; 30 -@end dc.b 31 ; 31 + dc.b 31 ; 31 + ;-------------------------------------------------------------------------------------------------------------- ; -timTbl PROC EXPORT - dc.w 0 ; minimum value - dc.w @end - @start ; - -@start dc.b 31 ; 0 +timTbl PROC EXPORT ; ex + dc.b 31 ; 0 dc.b 30 ; 1 dc.b 29 ; 2 dc.b 28 ; 3 @@ -274,15 +307,13 @@ timTbl PROC EXPORT dc.b 3 ; 28 dc.b 2 ; 29 dc.b 1 ; 30 -@end dc.b 0 ; 31 + dc.b 0 ; 31 + ;-------------------------------------------------------------------------------------------------------------- ; -timTblLow PROC EXPORT - dc.w 0 ; minimum value - dc.w @end - @start ; - -@start dc.b 31 ; 0 +timTblLow PROC EXPORT ; ex + dc.b 31 ; 0 dc.b 30 ; 1 dc.b 30 ; 2 dc.b 29 ; 3 @@ -313,16 +344,8 @@ timTblLow PROC EXPORT dc.b 11 ; 28 dc.b 11 ; 29 dc.b 10 ; 30 -@end dc.b 10 ; 31 + dc.b 10 ; 31 -;-------------------------------------------------------------------------------------------------------------- -; -PortableMaxTbl PROC EXPORT ; power range - dc.w 30 ; 0 - dc.w 15 ; 1 - dc.w 15 ; 2 - dc.w 7 ; 3 - dc.w 3 ; 4 ;-------------------------------------------------------------------------------------------------------------- ; @@ -342,289 +365,4 @@ PotInputRangeShiftTblPWM PROC EXPORT dc.w 2 ; 3 dc.w 3 ; 4 -;-------------------------------------------------------------------------------------------------------------- -; -dbTbl PROC EXPORT ;

- dc.w 0 ; minimum value - dc.w @end - @start ; - -@start DC.B 127 ; 0 - DC.B 89 ; 1 - DC.B 87 ; 2 - DC.B 86 ; 3 - DC.B 84 ; 4 - DC.B 82 ; 5 - DC.B 81 ; 6 - DC.B 79 ; 7 - DC.B 77 ; 8 - DC.B 76 ; 9 - DC.B 74 ; 10 - DC.B 71 ; 11 - DC.B 69 ; 12 - DC.B 67 ; 13 - DC.B 66 ; 14 - DC.B 64 ; 15 - DC.B 62 ; 16 - DC.B 61 ; 17 - DC.B 59 ; 18 - DC.B 57 ; 19 - DC.B 56 ; 20 - DC.B 54 ; 21 - DC.B 52 ; 22 - DC.B 51 ; 23 - DC.B 49 ; 24 - DC.B 47 ; 25 - DC.B 46 ; 26 - DC.B 44 ; 27 - DC.B 42 ; 28 - DC.B 41 ; 29 - DC.B 39 ; 30 -@end DC.B 38 ; 31 - - -;-------------------------------------------------------------------------------------------------------------- -; -DartTable proc export - dc.w 0 ; minimum value - dc.w @end - @start - -@start dc.b 3 ; 0 - dc.b 2 ; 1 - dc.b 1 ; 2 -@end dc.b 0 ; 3 - -; -; -DartMaxTbl PROC EXPORT ; power range - dc.w 3 ; 0 - dc.w 2 ; 1 - dc.w 2 ; 2 - dc.w 1 ; 3 - dc.w 0 ; 4 - -;-------------------------------------------------------------------------------------------------------------- -; -; generic exit for non-supported functions -; -StandardExit PROC EXPORT - rts -;-------------------------------------------------------------------------------------------------------------- -; -; list to supported cpu's (boxflags) -; -cpuTable PROC EXPORT - - dc.w boxPortable - dc.l Portableinfo - cpuTable - - dc.w boxPowerBook100 - dc.l PowerBook100info - cpuTable - - dc.w boxPowerBookDuo250 ; - dc.l PowerBookDuoinfo - cpuTable - - dc.w boxDBLite20 - dc.l PowerBookDuoinfo - cpuTable - - dc.w boxPowerBookDuo210 - dc.l PowerBookDuoinfo - cpuTable - - dc.w boxPowerBookDuo230 - dc.l PowerBookDuoinfo - cpuTable - - dc.w boxPowerBook140 ; cpu id - dc.l PowerBook170info - cpuTable - - dc.w boxPowerBook170 ; cpu id - dc.l PowerBook170info - cpuTable - - dc.w boxPowerBook180 - dc.l PowerBook180info - cpuTable - - dc.w boxPowerBook160 - dc.l PowerBook180info - cpuTable - - dc.w boxYeagerFSTN ; - dc.l PowerBookDuoinfo - cpuTable - - dc.w boxPowerBookDuo270C ; - dc.l PowerBookDuoinfo - cpuTable - - - dc.w -1 - -;-------------------------------------------------------------------------------------------------------------- -; -; - import StandardExit - import SetBrightness,KbdControl,InitRegControls,RegisterClose,RegisterControl,RegisterStatus - import SetPWM,PotControl,InitPWMControls,PWMCloseRoutine,PWMControl,GenericStatus,PortableBacklightValue - import SetDart,GetDart,InitTimControls,InitDartControls,PowerMgrPot,ChargerAdjust - import PGE_button - - with backlightflags - -;-------------------------------------------------------------------------------------------------------------- -; -; -Portableinfo - dc.l (0 << disableHWinput)\ ; operating flag (stops user input) - +(0 << kbdactive)\ ; operating flag (kbd control inprogress) - +(1 << vbl_ok)\ ; operating flag (allow vbl operations) - +(0 << flyByWire)\ ; config flag (hardware input) - +(0 << freeflag)\ ; (n/a) unused flag - +(0 << dualTable)\ ; config flag (use multi tables) - +(0 << lowTable)\ ; operating flag (currently using low table) - +(0 << slewChange) ; operating flag (table transition inprogress) - dc.l SetBrightness - Portableinfo ; set routine - dc.l KbdControl - Portableinfo ; get user input routine - dc.l InitRegControls - Portableinfo ; initialization routine - dc.l RegisterClose - Portableinfo ; close routine - dc.l RegisterControl - Portableinfo ; control routine - dc.l RegisterStatus - Portableinfo ; status routine - dc.l StandardExit - Portableinfo ; (n/a) charger state change routine - dc.l PortableMaxTbl - Portableinfo ; table of maximum value for different power ranges - dc.l PortableTable7V - Portableinfo ; low range table - dc.l PortableTable7V - Portableinfo ; high range table - dc.l PowerMgrPot - Portableinfo ; hardware dependent var - dc.w 1 ; vbl count SampleRate - dc.w 0 ; (n/a) lowThreshold - dc.w 0 ; (n/a) hiThreshold - -;-------------------------------------------------------------------------------------------------------------- -; -; -PowerBook100info - dc.l (0 << disableHWinput)\ ; operating flag (stops user input) - +(0 << kbdactive)\ ; operating flag (kbd control inprogress) - +(1 << vbl_ok)\ ; operating flag (allow vbl operations) - +(1 << flyByWire)\ ; config flag (hardware input) - +(0 << freeflag)\ ; unused flag - +(0 << dualTable)\ ; config flag (use multi tables) - +(0 << lowTable)\ ; operating flag (currently using low table) - +(0 << slewChange) ; operating flag (table transition inprogress) - dc.l SetPWM - PowerBook100info ; set routine - dc.l PotControl - PowerBook100info ; get user input routine - dc.l InitPWMControls - PowerBook100info ; initialization routine - dc.l PWMCloseRoutine - PowerBook100info ; close routine - dc.l PWMControl - PowerBook100info ; control routine - dc.l GenericStatus - PowerBook100info ; status routine - dc.l StandardExit - PowerBook100info ; (n/a) charger state change routine - dc.l PWMMaxTbl - PowerBook100info ; table of maximum value for different power ranges - dc.l asahiTbl - PowerBook100info ; low range table - dc.l asahiTbl - PowerBook100info ; high range table - dc.l PortableBacklightValue- PowerBook100info; hardware dependent var - dc.w 10 ; vbl count SampleRate - dc.w 0 ; (n/a) lowThreshold - dc.w 0 ; (n/a) hiThreshold - -;-------------------------------------------------------------------------------------------------------------- -; -; -HITABLETHRESHOLD170 equ (685 - 512) -LOWTABLETHRESHOLD170 equ (675 - 512) - -PowerBook170info - dc.l (0 << disableHWinput)\ ; operating flag (stops user input) - +(0 << kbdactive)\ ; (n/a) operating flag (kbd control inprogress) - +(1 << vbl_ok)\ ; operating flag (allow vbl operations) - +(1 << flyByWire)\ ; config flag (hardware input) - +(1 << freeflag)\ ; (n/a) - +(0 << dualTable)\ ; config flag (use multi tables) - +(0 << lowTable)\ ; operating flag (currently using low table) - +(0 << slewChange) ; operating flag (table transition inprogress) - dc.l SetPWM - PowerBook170info ; set routine - dc.l PotControl - PowerBook170info ; get user input routine - dc.l InitTimControls - PowerBook170info ; initialization routine - dc.l PWMCloseRoutine - PowerBook170info ; close routine - dc.l PWMControl - PowerBook170info ; control routine - dc.l GenericStatus - PowerBook170info ; status routine - dc.l ChargerAdjust - PowerBook170info ; charger state change routine - dc.l PWMMaxTbl - PowerBook170info ; table of maximum value for different power ranges - dc.l timTblLow - PowerBook170info ; low range table - dc.l timTbl - PowerBook170info ; high range table - dc.l PowerMgrPot - PowerBook170info ; hardware dependent var - dc.w 10 ; vbl count SampleRate - dc.w LOWTABLETHRESHOLD170 ; voltage threshold before switching from high to low table - dc.w HITABLETHRESHOLD170 ; voltage threshold before switching from low to high table - - -;-------------------------------------------------------------------------------------------------------------- -; -; -PowerBook180info - dc.l (0 << disableHWinput)\ ; operating flag (stops user input) - +(0 << kbdactive)\ ; (n/a) operating flag (kbd control inprogress) - +(1 << vbl_ok)\ ; operating flag (allow vbl operations) - +(1 << flyByWire)\ ; config flag (hardware input) - +(1 << freeflag)\ ; (n/a) - +(1 << dualTable)\ ; config flag (use multi tables) - +(0 << lowTable)\ ; operating flag (currently using low table) - +(0 << slewChange) ; operating flag (table transition inprogress) - dc.l SetPWM - PowerBook180info ; set routine - dc.l PotControl - PowerBook180info ; get user input routine - dc.l InitPWMControls - PowerBook180info ; initialization routine - dc.l PWMCloseRoutine - PowerBook180info ; close routine - dc.l PWMControl - PowerBook180info ; control routine - dc.l GenericStatus - PowerBook180info ; status routine - dc.l ChargerAdjust - PowerBook180info ; charger state change routine - dc.l PWMMaxTbl - PowerBook180info ; table of maximum value for different power ranges - dc.l timTblLow - PowerBook180info ; low range table - dc.l timTbl - PowerBook180info ; high range table - dc.l PowerMgrPot - PowerBook180info ; hardware dependent var - dc.w 10 ; vbl count SampleRate - dc.w LOWTABLETHRESHOLD170 ; voltage threshold before switching from high to low table - dc.w HITABLETHRESHOLD170 ; voltage threshold before switching from low to high table - -PowerBook180infoHWControl - dc.l (0 << disableHWinput)\ ; operating flag (stops user input) - +(0 << kbdactive)\ ; operating flag (kbd control inprogress) - +(1 << vbl_ok)\ ; operating flag (allow vbl operations) - +(1 << flyByWire)\ ; config flag (hardware input) - +(1 << freeflag)\ - +(0 << dualTable)\ ; config flag (use multi tables) - +(0 << lowTable)\ ; operating flag (currently using low table) - +(0 << slewChange) ; operating flag (table transition inprogress) - dc.l SetPWM - PowerBook180info ; set routine - dc.l PotControl - PowerBook180info ; get user input routine - dc.l InitDartControls - PowerBook180info ; initialization routine - dc.l PWMCloseRoutine - PowerBook180info ; close routine - dc.l PWMControl - PowerBook180info ; control routine - dc.l GenericStatus - PowerBook180info ; status routine - dc.l 0 ; (n/a) charger state change routine - dc.l DartMaxTbl - PowerBook180info ; table of maximum value for different power ranges - dc.l DartTable - PowerBook180info ; low range table - dc.l DartTable - PowerBook180info ; high range table - dc.l PowerMgrPot - PowerBook180info ; hardware dependent var - dc.w 10 ; vbl count SampleRate - dc.w 0 ; (n/a) lowThreshold - dc.w 0 ; (n/a) hiThreshold - -;-------------------------------------------------------------------------------------------------------------- -; -; -PowerBookDuoinfo - dc.l (0 << disableHWinput)\ ; operating flag (stops user input) - +(0 << kbdactive)\ ; operating flag (kbd control inprogress) - +(1 << vbl_ok)\ ; operating flag (allow vbl operations) - +(1 << flyByWire)\ ; config flag (hardware input) - +(1 << freeflag)\ - +(0 << dualTable)\ ; config flag (use multi tables) - +(0 << lowTable)\ ; operating flag (currently using low table) - +(0 << slewChange) ; operating flag (table transition inprogress) - dc.l SetPWM - PowerBookDuoinfo ; set routine - dc.l PotControl - PowerBookDuoinfo ; get user input routine - dc.l InitPWMControls - PowerBookDuoinfo ; initialize routine - dc.l PWMCloseRoutine - PowerBookDuoinfo ; close routine - dc.l PWMControl - PowerBookDuoinfo ; control routine - dc.l GenericStatus - PowerBookDuoinfo ; status routine - dc.l StandardExit - PowerBookDuoinfo ; (n/a) charger state change routine - dc.l PWMMaxTbl - PowerBookDuoinfo ; table of maximum value for different power ranges - dc.l dbTbl - PowerBookDuoinfo ; low range table - dc.l dbTbl - PowerBookDuoinfo ; high range table - dc.l PGE_button - PowerBookDuoinfo ; hardware dependent var - dc.w 10 ; vbl count SampleRate - dc.w 0 ; (n/a) lowThreshold - dc.w 0 ; (n/a) hiThreshold - END diff --git a/Drivers/Backlight/backlight.c b/Drivers/Backlight/backlight.c index 11546ed..08c1078 100644 --- a/Drivers/Backlight/backlight.c +++ b/Drivers/Backlight/backlight.c @@ -1,3 +1,13 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted Horror (except

) and SuperMario changes + Constants used instead of boxFlag equates for clarity + GetBacklightInfo/SaveBacklightInfo recreated from disassembly + ChargerAdjust/LowTable put back into PWM.c + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: backlight.c @@ -166,19 +176,15 @@ cpuDependentInfoPtr GetBkltPrimInfo(); *************************************************************************************************** */ +/* many changes */ pascal OSErr DRVROpen(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point */ { #pragma unused (ctlPB) register driverGlobalPtr globalPtr; /* pointer to globals */ PmgrGlobals **pmgrglobalhdl; /* handle to power manager globals */ - OSErr error; - cpuDependentInfoType *cpuinfo; - OSErr (*openProc)(); + char boxFlag; - cpuinfo = GetBkltPrimInfo(); - if (!cpuinfo) return(openErr); - globalPtr = (driverGlobalPtr) NewPtrSysClear(sizeof(driverGlobaltypes)); if (!globalPtr) return(openErr); /* not enough memory, return error */ @@ -188,45 +194,25 @@ pascal OSErr DRVROpen(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point * /* setup variables */ globalPtr->version = DRIVERVERSION; /* driver version number, in globals for easy patching */ - *((unsigned int *)(((int)&(globalPtr->version)) + sizeof(globalPtr->version))) = cpuinfo->bkltinfo->flags; - globalPtr->lowThreshold = cpuinfo->bkltinfo->lowThreshold; /*low hysteresis threshold */ - globalPtr->hiThreshold = cpuinfo->bkltinfo->hiThreshold; /* high hysteresis threshold */ - globalPtr->userInputSampleRate = cpuinfo->bkltinfo->userInputSampleRate; /* sample every 160ms */ + globalPtr->vbl_ok = true; globalPtr->lastLevel = (*pmgrglobalhdl)->LastLevel; /* get current power level */ // globalPtr->userRange = 0; /* allow full power level */ globalPtr->powerRange = Larger(globalPtr->lastLevel,globalPtr->userRange); -/* initialize tables */ - globalPtr->maximumTable = (short *) (cpuinfo->bkltroutines->maxTable); - globalPtr->settingTableLow = (setTableType *) (cpuinfo->bkltroutines->lowTable); /* */ - globalPtr->settingTableHigh = (setTableType *) (cpuinfo->bkltroutines->hiTable); /* */ - globalPtr->settingTable = globalPtr->settingTableHigh; - -/* initialize vectors */ - globalPtr->setlevelproc = (intFunction) (cpuinfo->bkltroutines->setProc); /* proc to set level */ - globalPtr->userInputProc = (intFunction) (cpuinfo->bkltroutines->getProc); /* proc to read user input */ - openProc = (osFunction) (cpuinfo->bkltroutines->open); /* routine to close pwm hardware */ - globalPtr->closeProc = (intFunction) (cpuinfo->bkltroutines->close); /* routine to close pwm hardware */ - globalPtr->controlProc = (osFunction) (cpuinfo->bkltroutines->control); /* passed control routine */ - globalPtr->statusProc = (osFunction) (cpuinfo->bkltroutines->status); /* passed status routine */ - globalPtr->hardwareDependentPtr = (Ptr) (cpuinfo->bkltroutines->hwDependentVar); - globalPtr->tableProc = (voidFunction) (cpuinfo->bkltroutines->tableProc); - - -/* call custom initialization routine */ - if (openProc) + /* */ + boxFlag = *(char *)0xCB3; + switch (boxFlag) { - error = (*openProc)(globalPtr); - if (error) - { - DisposPtr((Ptr) globalPtr); /* release memory */ - dCtl->dCtlStorage = NULL; - return(error); /* clear out saved value for next open */ - }; - }; - - + case 4: // Portable + InitRegControls(globalPtr); + break; + case 15: // PowerBook 170, TIM + case 18: // PowerBook 100, Asahi + default: + InitPWMControls(globalPtr); + break; + } globalPtr->brightnessVbl.globals = (Ptr) globalPtr; globalPtr->brightnessVbl.vblpb.qType = vType; @@ -257,7 +243,6 @@ pascal OSErr DRVRClose(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point * globalPtr = (driverGlobalPtr) dCtl->dCtlStorage; /* set context to my global data area */ - globalPtr->slewChange = false; /* always turn off slew during close
*/ VRemove((QElemPtr) &globalPtr->brightnessVbl.vblpb); /* remove vbl task */ if (globalPtr->closeProc != NULL) /* if hw close proc … */ (*globalPtr->closeProc)(globalPtr); /* … call close proc */ @@ -375,6 +360,7 @@ OSErr GenericControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr) * *************************************************************************************************** */ +/* removed kGetUserInput/kGetScreenBrightness/kGetBrightnessRange/kGetMaximum */ pascal OSErr DRVRStatus(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point */ { @@ -390,27 +376,10 @@ pascal OSErr DRVRStatus(CntrlParam *ctlPB,DCtlPtr dCtl) /* 'open' entry point globalPtr->vbl_ok = false; /* disable vbl task */ switch(ctlPB->csCode) { - case kGetUserInput: - ctlPB->csParam[0] = globalPtr-> - userInputProc( globalPtr ); /* Get the button inputs */ - break; - case KGetVersion: ctlPB->csParam[0] = globalPtr->version; /* return current driver version */ break; - case kGetScreenBrightness: /*

return current saved brightness */ - ctlPB->csParam[0] = globalPtr->userBrightness; - break; - - case kGetBrightnessRange: /*

return range of brightness values */ - ctlPB->csParam[0] = globalPtr->settingTable->maximum;/*

using new tables, return max setting */ - ctlPB->csParam[1] = globalPtr->settingTable->minimum;/*

using new tables, return min setting */ - break; - case kGetMaximum: /*

*/ - ctlPB->csParam[0] = globalPtr->maximumTable[globalPtr->powerRange]; - break; - default: error = (*globalPtr->statusProc)(ctlPB,globalPtr); }; @@ -526,7 +495,7 @@ PowerChange (driverGlobalPtr globalPtr, int currentPowerLevel) { if (!globalPtr->flyByWire && userInput) /* if only software controls and backlight on */ { - userInput >>= 1; /* reduce power by 1/2 */ + userInput = globalPtr->userBrightness >> 1; /* reduce power by 1/2 */ if (!userInput) userInput = 1; /* insure at least on */ }; }; @@ -539,47 +508,22 @@ PowerChange (driverGlobalPtr globalPtr, int currentPowerLevel) * *************************************************************************************************** */ - -/*page - *************************************************************************************************** - * - * - *************************************************************************************************** - */ -unsigned int LowTable (driverGlobalPtr globalPtr) - +/* from scratch */ +int GetBacklightInfo(short mask, short shift) { - PmgrGlobals **pmgrglobalhdl; /* handle to power manager globals */ - Boolean wasLowTable; /* current table being used */ - Boolean hiTable; /* use hi level table now */ + unsigned char buf; + ReadXPram(0x74, sizeof(buf), &buf); + return (buf & mask) >> shift; +} - pmgrglobalhdl = (PmgrGlobals **) 0x0D18; /* handle to power manager globals */ - - wasLowTable = globalPtr->lowTable; /* current table */ - hiTable = false; /* assume low table */ - if ((wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->hiThreshold)) || - (!wasLowTable && ((*pmgrglobalhdl)->BatAvg >= globalPtr->lowThreshold))) - { - hiTable = (*pmgrglobalhdl)->Charger & 0x01; /* qualify table with charger */ - }; - return(hiTable ? 0 : 1); /* return 1 if low table, 0 if high */ -}; - -/*page - *************************************************************************************************** - * - * - *************************************************************************************************** - */ -void ChargerAdjust (driverGlobalPtr globalPtr) -{ - unsigned int oldTable; - - oldTable = globalPtr->lowTable; /* save the current table being used */ - globalPtr->lowTable = LowTable(globalPtr); /* get the new table to use */ - if (globalPtr->lowTable == oldTable) return; /* are we changing tables ???, no exit */ - - globalPtr->slewChange = true; /* if change, set tmp slew on */ - globalPtr->settingTable = globalPtr->lowTable ? globalPtr->settingTableLow :globalPtr->settingTableHigh ; -}; +/* from scratch */ +void SaveBacklightInfo(short new, short mask, short shift) +{ + int addr = 0x70; + unsigned char buf; + ReadXPram(addr + 4, sizeof(buf), &buf); + buf &= ~mask; + buf |= (new << shift) & mask; + WriteXPram(addr + 4, sizeof(buf), &buf); +} diff --git a/Drivers/Backlight/backlight.h b/Drivers/Backlight/backlight.h index 00bf48f..912f505 100644 --- a/Drivers/Backlight/backlight.h +++ b/Drivers/Backlight/backlight.h @@ -1,3 +1,12 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted Horror and SuperMario changes + Left out boxFlag definitions, because they use obscure codenames + Version somehow increased from 1.0.1 to 1.0.2 + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: backlight.h @@ -65,7 +74,7 @@ * */ #define DRIVERMAJORVERSION 0x0100 -#define DRIVERMINORVERSION 0x0001 +#define DRIVERMINORVERSION 0x0002 #define DRIVERVERSION (DRIVERMAJORVERSION + DRIVERMINORVERSION) /* Control Calls */ @@ -154,13 +163,6 @@ typedef struct VBLTask vblpb; } vblstruct; -typedef struct - { - short minimum; - short maximum; - unsigned char table[]; - } setTableType; /* new structure for tables */ - typedef struct { SleepQRec sleepQelement; /* sleep queue element, MUST stay on top */ @@ -187,9 +189,9 @@ typedef struct short slewLimit; unsigned short lowThreshold; unsigned short hiThreshold; - setTableType *settingTable; /* pointer to record now */ - setTableType *settingTableLow; /* pointer to record now */ - setTableType *settingTableHigh; /* pointer to record now */ + unsigned char *settingTable; + unsigned char *settingTableLow; + unsigned char *settingTableHigh; short *maximumTable; short lastLevel; /* last power level */ @@ -203,8 +205,6 @@ typedef struct short mousedownTicks; /* first notice of mouse down in tick count */ short keycodes; /* key combinations */ short lastatod; /* last raw a to d value */ - - Ptr hardwareDependentPtr; /* private storage for hardware dependent code */ } driverGlobaltypes, *driverGlobalPtr; typedef struct @@ -248,20 +248,20 @@ typedef struct #define SaveBrightness(new) SaveBacklightInfo(new+1,VALUE_MASK, 0) #define SaveKeyData(new) SaveBacklightInfo(new,KEY_MASK, 5) -/* new ponti defintions */ -#define PONTILMPCTLREG *((unsigned char *) 0x50f96C00) -#define PONTILMPON 0 -#define PONTILMPHWCTL 1 -#define PONTILMPMUX0 2 -#define PONTILMPMUX1 3 - typedef int (*intFunction)(); typedef OSErr (*osFunction)(); typedef void (*voidFunction)(); int abs(int); unsigned char GetPortableValues(int parameter); -OSErr InitPWMControls(driverGlobalPtr globalPtr); +void InitPWMControls(driverGlobalPtr globalPtr); unsigned char Get_AtoD(int channel); unsigned char Get_PGEButton(int channel); -int SetPWM(int new, driverGlobalPtr globalPtr); \ No newline at end of file +int SetPWM(int new, driverGlobalPtr globalPtr); +void InitRegControls(driverGlobalPtr globalPtr); +int PotControl (driverGlobalPtr globalPtr); +int PWMCloseRoutine (driverGlobalPtr globalPtr); +OSErr PWMControl(CntrlParam *ctlPB,driverGlobalPtr globalPtr); +OSErr PWMStatus(CntrlParam *ctlPB,driverGlobalPtr globalPtr); +unsigned int LowTable (driverGlobalPtr globalPtr); +void ChargerAdjust (driverGlobalPtr globalPtr); diff --git a/Drivers/Drivers.make b/Drivers/Drivers.make index 5188363..fdefb2d 100644 --- a/Drivers/Drivers.make +++ b/Drivers/Drivers.make @@ -1,3 +1,10 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Un-#included the missing files Serial.make and SerialDMA.make +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: Drivers.make # @@ -22,9 +29,6 @@ BackLightDir = {DriverDir}BackLight: #include {SonyDir}Sony.make -#include {SerialDir}Serial.make -#include {SerialDMADir}SerialDMA.make - #include {NewAgeDir}NewAge.make #include {IOPDir}IOP.make diff --git a/Drivers/Sony/Sony.make b/Drivers/Sony/Sony.make index 214aa28..6cdf8b9 100644 --- a/Drivers/Sony/Sony.make +++ b/Drivers/Sony/Sony.make @@ -1,3 +1,10 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Made build rule for linked patch file SonyPatches.a +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: Sony.make # @@ -41,3 +48,8 @@ "{RsrcDir}Sony.rsrc" ƒ "{ObjDir}SonyHdr.a.o" Link {StdLOpts} {StdAlign} -o "{Targ}" "{ObjDir}SonyHdr.a.o" -sn Main=".Sony" -rt DRVR=4 + +# +"{ObjDir}SonyPatches.a.o" ƒ "{SonyDir}SonyPatches.a" + Asm {StdAOpts} -o "{Targ}" -d SonyNonPortable=1 -d onMac32=1 "{SonyDir}SonyPatches.a" + diff --git a/Drivers/Video/TFBDriver.a b/Drivers/Video/TFBDriver.a index b620504..44669f0 100644 --- a/Drivers/Video/TFBDriver.a +++ b/Drivers/Video/TFBDriver.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: TFBDriver.a ; @@ -811,11 +818,11 @@ SetGamma ; DAF MOVE.L D0,A1 ; get pointer to new gamma table TST.L GVersion(A1) ; version, type = 0? - BNE BadCtl ; => no, return error CSS + BNE.S BadCtl ; => no, return error CSS CMP #8,GDataWidth(A1) ; is data width 8? - BNE BadCtl ; => no, return error CSS + BNE.S BadCtl ; => no, return error CSS CMP #256,GDataCnt(A1) ; 256 values per channel? - BNE BadCtl ; => no, return error CSS + BNE.S BadCtl ; => no, return error CSS ; if new table is different size, reallocate memory diff --git a/Interfaces/AIncludes/ATalkEqu.a b/Interfaces/AIncludes/ATalkEqu.a new file mode 100644 index 0000000..1caf251 --- /dev/null +++ b/Interfaces/AIncludes/ATalkEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'AppleTalk.a' diff --git a/Interfaces/AIncludes/ATalkEqu.a.idump b/Interfaces/AIncludes/ATalkEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/ATalkEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/AppleTalk.a b/Interfaces/AIncludes/AppleTalk.a index 4d576ed..a0ccc1d 100644 --- a/Interfaces/AIncludes/AppleTalk.a +++ b/Interfaces/AIncludes/AppleTalk.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: AppleTalk.a ; @@ -136,7 +143,7 @@ lengthErr EQU -4 ; ; SCC interrupt priority Should NEVER MOVE.W this value, just ORI.W rb ; -sccLockout EQU $600 ; This value works on both Mac and Lisa rb +sccLockout EQU $2600 ; This value works on both Mac and Lisa rb ; ; ;+ MPP (control calls to NBP, DDP and ABLAP) diff --git a/Interfaces/AIncludes/FSPrivate.a b/Interfaces/AIncludes/FSPrivate.a index 1782e65..5656fd0 100644 --- a/Interfaces/AIncludes/FSPrivate.a +++ b/Interfaces/AIncludes/FSPrivate.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; Version: 2.96 ; Created: Friday, October 20, 1989 at 9:18:00 PM ; @@ -122,7 +129,7 @@ maxHFSTrap EQU 17 ; Highest TFS trap dispatch index hfsVars EQU $36A ; Start of TFS variables in RAM version ; (previously RgSvArea) hfsTmpSize EQU 16 ; Additional temporary space for TFS -hfsStkLen EQU 1792 ; Allocate a decent-sized chunk of memory +hfsStkLen EQU 1280 ; Allocate a decent-sized chunk of memory HFSStkTop EQU $36A ; Temporary location of pointer to top of Stack HFSStkPtr EQU $36E ; Temporary location of TFS Stack pointer WDCBsPtr EQU $372 ; Working Directory queue header @@ -384,7 +391,7 @@ btcNodeSize EQU 42 ; BTree node size in bytes (word) btcKeyLen EQU 44 ; max key length (word) btcNNodes EQU 46 ; total number of nodes (long) btcFree EQU 50 ; number of free nodes (long) -LenBTCB EQU 74 ; length of a BTCB +LenBTCB EQU 54 ; length of a BTCB ; ; BTree Variables (btVars) layout diff --git a/Interfaces/AIncludes/GestaltEqu.a b/Interfaces/AIncludes/GestaltEqu.a index f00101e..a35e4a9 100644 --- a/Interfaces/AIncludes/GestaltEqu.a +++ b/Interfaces/AIncludes/GestaltEqu.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Recreated gestaltIconUtilities equate (no 'Attr') for compatibility +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ;__________________________________________________________________________________________________ ; ; File: GestaltEqu.a @@ -515,6 +522,7 @@ gestaltTranslationAttr EQU 'xlat' ; Translation manager attributes gestaltTranslationMgrExists EQU 0 ; TRUE if translation manager exists gestaltIconUtilitiesAttr EQU 'icon' ; Icon Utilities attributes +gestaltIconUtilities EQU 'icon' ; Recreated for old code gestaltIconUtilitiesPresent EQU 0 ; true if icon utilities are present gestaltCompressionMgr EQU 'icmp' ; returns version of the Image Compression Manager diff --git a/Interfaces/AIncludes/PackMacs.a b/Interfaces/AIncludes/PackMacs.a new file mode 100644 index 0000000..5f8fe4a --- /dev/null +++ b/Interfaces/AIncludes/PackMacs.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Packages.a' diff --git a/Interfaces/AIncludes/PackMacs.a.idump b/Interfaces/AIncludes/PackMacs.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/PackMacs.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/PaletteEqu.a b/Interfaces/AIncludes/PaletteEqu.a new file mode 100644 index 0000000..d1cf4a1 --- /dev/null +++ b/Interfaces/AIncludes/PaletteEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Palettes.a' diff --git a/Interfaces/AIncludes/PaletteEqu.a.idump b/Interfaces/AIncludes/PaletteEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/PaletteEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/PrEqu.a b/Interfaces/AIncludes/PrEqu.a new file mode 100644 index 0000000..4412b70 --- /dev/null +++ b/Interfaces/AIncludes/PrEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Printing.a' diff --git a/Interfaces/AIncludes/PrEqu.a.idump b/Interfaces/AIncludes/PrEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/PrEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/PrintCallsEqu.a b/Interfaces/AIncludes/PrintCallsEqu.a new file mode 100644 index 0000000..3b7bc11 --- /dev/null +++ b/Interfaces/AIncludes/PrintCallsEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'PrintTrapsEqu.a' diff --git a/Interfaces/AIncludes/PrintCallsEqu.a.idump b/Interfaces/AIncludes/PrintCallsEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/PrintCallsEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/QDOffscreenEqu.a b/Interfaces/AIncludes/QDOffscreenEqu.a new file mode 100644 index 0000000..63dabee --- /dev/null +++ b/Interfaces/AIncludes/QDOffscreenEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'QDOffscreen.a' diff --git a/Interfaces/AIncludes/QDOffscreenEqu.a.idump b/Interfaces/AIncludes/QDOffscreenEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/QDOffscreenEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/QuickEqu.a b/Interfaces/AIncludes/QuickEqu.a new file mode 100644 index 0000000..a37c8ae --- /dev/null +++ b/Interfaces/AIncludes/QuickEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'QuickDraw.a' diff --git a/Interfaces/AIncludes/QuickEqu.a.idump b/Interfaces/AIncludes/QuickEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/QuickEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/SCSIEqu.a b/Interfaces/AIncludes/SCSIEqu.a new file mode 100644 index 0000000..9564b2b --- /dev/null +++ b/Interfaces/AIncludes/SCSIEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'SCSI.a' diff --git a/Interfaces/AIncludes/SCSIEqu.a.idump b/Interfaces/AIncludes/SCSIEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/SCSIEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/ScriptEqu.a b/Interfaces/AIncludes/ScriptEqu.a new file mode 100644 index 0000000..f89c11f --- /dev/null +++ b/Interfaces/AIncludes/ScriptEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Script.a' diff --git a/Interfaces/AIncludes/ScriptEqu.a.idump b/Interfaces/AIncludes/ScriptEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/ScriptEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/ShutDownEqu.a b/Interfaces/AIncludes/ShutDownEqu.a new file mode 100644 index 0000000..30d5848 --- /dev/null +++ b/Interfaces/AIncludes/ShutDownEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'ShutDown.a' diff --git a/Interfaces/AIncludes/ShutDownEqu.a.idump b/Interfaces/AIncludes/ShutDownEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/ShutDownEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/SlotEqu.a b/Interfaces/AIncludes/SlotEqu.a new file mode 100644 index 0000000..aefcfae --- /dev/null +++ b/Interfaces/AIncludes/SlotEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Slots.a' diff --git a/Interfaces/AIncludes/SlotEqu.a.idump b/Interfaces/AIncludes/SlotEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/SlotEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/SonyEqu.a b/Interfaces/AIncludes/SonyEqu.a index 1e19d9c..c0f094a 100644 --- a/Interfaces/AIncludes/SonyEqu.a +++ b/Interfaces/AIncludes/SonyEqu.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Removed the struct elements inserted by

. Worked around +; hasPwrControls/hasPowerMgr being incorrectly set on Plus/Portable. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: SonyEqu.a ; @@ -362,7 +370,7 @@ chipState EQU sonyVarEnd ; Byte holds flag to indicate IWM on or off sonyVarEnd SET chipState+2 ; end of sony vars excluding DCD ENDIF - IF hasPwrControls | hasPowerMgr THEN ; <1.1> + IF (hasPwrControls | hasPowerMgr) and NOT onHcMac and NOT onMac THEN ; <1.1> chipState EQU sonyVarEnd ; Bit7 - saved VIA dir, 6..0 - pmgr enables <1.1> diskSleepQEL EQU chipState+2 ; sleep/wakeup queue element sonyVarEnd SET diskSleepQEL+SleepqRec.SleepqSize ; end of sony vars excluding DCD @@ -371,9 +379,7 @@ sonyVarEnd SET diskSleepQEL+SleepqRec.SleepqSize ; end of sony vars excluding IF forDiskDup THEN fmtParams EQU sonyVarEnd ;pointer to parameters for special format command gcrFmtByte EQU fmtParams+4 ; saved GCR format byte for duplicator -clock32Mhz EQU gcrFmtByte+2 ; ( 1) Clock speed: $FF=32Mhz, $00=16Mhz

-DisableRetries EQU clock32Mhz+1 ; ( 1) $FF=Don't perform retries, $00=normal

-sonyVarEnd SET DisableRetries+1 +sonyVarEnd SET gcrFmtByte+1 ; removed clock32Mhz

and DisableRetries

(1 byte each) ENDIF diff --git a/Interfaces/AIncludes/ToolEqu.a b/Interfaces/AIncludes/ToolEqu.a new file mode 100644 index 0000000..1bc171b --- /dev/null +++ b/Interfaces/AIncludes/ToolEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'ToolUtils.a' diff --git a/Interfaces/AIncludes/ToolEqu.a.idump b/Interfaces/AIncludes/ToolEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/ToolEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/AIncludes/Traps.a b/Interfaces/AIncludes/Traps.a index 31d9607..5022458 100644 --- a/Interfaces/AIncludes/Traps.a +++ b/Interfaces/AIncludes/Traps.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored SwapMMUMode/StripAddress/Translate24To32 to OPWORDs, as they +; were before . +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; Version: 3.29 ; Created: Friday, October 20, 1989 at 10:06:13 PM ; @@ -2110,17 +2118,9 @@ _HGetState OPWORD $A069 _HSetState OPWORD $A06A _InitFS OPWORD $A06C _InitEvents OPWORD $A06D - - Macro ; SuperMario is a 32-bit only ROM - _SwapMMUMode - EndM - Macro ; SuperMario is a 32-bit only ROM - _StripAddress - EndM - Macro ; SuperMario is a 32-bit only ROM - _Translate24To32 - EndM - +_SwapMMUMode OPWORD $A05D ; ex +_StripAddress OPWORD $A055 ; ex +_Translate24To32 OPWORD $A091 ; ex _SetAppBase OPWORD $A057 _SlotVInstall OPWORD $A06F _SlotVRemove OPWORD $A070 diff --git a/Interfaces/AIncludes/VideoEqu.a b/Interfaces/AIncludes/VideoEqu.a new file mode 100644 index 0000000..5e8acf7 --- /dev/null +++ b/Interfaces/AIncludes/VideoEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Video.a' diff --git a/Interfaces/AIncludes/VideoEqu.a.idump b/Interfaces/AIncludes/VideoEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/AIncludes/VideoEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/CIncludes/Desk.h b/Interfaces/CIncludes/Desk.h index d0a6bfd..b1685ba 100644 --- a/Interfaces/CIncludes/Desk.h +++ b/Interfaces/CIncludes/Desk.h @@ -1,3 +1,9 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Worked around accRun double define in Devices.h and Desk.h + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ /************************************************************ @@ -45,7 +51,9 @@ Created: Saturday, July 27, 1991 at 2:53 PM enum { accEvent = 64, +#ifndef __DEVICES__ // accRun = 65, +#endif accCursor = 66, accMenu = 67, accUndo = 68, diff --git a/Interfaces/CIncludes/Devices.h b/Interfaces/CIncludes/Devices.h index ab14dae..5928a23 100644 --- a/Interfaces/CIncludes/Devices.h +++ b/Interfaces/CIncludes/Devices.h @@ -1,3 +1,10 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Worked around accRun double define in Devices.h and Desk.h + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /************************************************************ Devices.h @@ -173,7 +180,9 @@ enum { /* special csCodes */ goodBye = -1, killCode = 1, +#ifndef __DESK__ // accRun = 65 +#endif }; diff --git a/Interfaces/CIncludes/GestaltEqu.h b/Interfaces/CIncludes/GestaltEqu.h index 37197e4..638c3b7 100644 --- a/Interfaces/CIncludes/GestaltEqu.h +++ b/Interfaces/CIncludes/GestaltEqu.h @@ -1,3 +1,10 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <60> by removing inline glue for NewGestalt and ReplaceGestalt + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /************************************************************ Created: Sunday, January 6, 1991 at 9:27 PM @@ -646,25 +653,19 @@ typedef pascal OSErr (*SelectorFunctionProcPtr)(OSType selector, long *response) #ifdef __cplusplus extern "C" { #endif + +pascal OSErr NewGestalt(OSType selector,SelectorFunctionProcPtr gestaltFunction); +pascal OSErr ReplaceGestalt(OSType selector,SelectorFunctionProcPtr gestaltFunction,SelectorFunctionProcPtr *oldGestaltFunction); + #if SystemSevenOrLater #pragma parameter __D0 Gestalt(__D0,__A1) pascal OSErr Gestalt(OSType selector,long *response) = {0xA1AD,0x2288}; -#pragma parameter __D0 NewGestalt(__D0,__A0) -pascal OSErr NewGestalt(OSType selector,SelectorFunctionProcPtr gestaltFunction) - = {0xA3AD}; - -#pragma parameter __D0 ReplaceGestalt(__D0,__A0,__A1) -pascal OSErr ReplaceGestalt(OSType selector,SelectorFunctionProcPtr gestaltFunction,SelectorFunctionProcPtr *oldGestaltFunction) - = {0x2F09, 0xA5AD, 0x225F, 0x2288}; - #else pascal OSErr Gestalt(OSType selector,long *response); -pascal OSErr NewGestalt(OSType selector,SelectorFunctionProcPtr gestaltFunction); -pascal OSErr ReplaceGestalt(OSType selector,SelectorFunctionProcPtr gestaltFunction,SelectorFunctionProcPtr *oldGestaltFunction); #endif diff --git a/Interfaces/CIncludes/Sound.h b/Interfaces/CIncludes/Sound.h new file mode 100644 index 0000000..c4b14cb --- /dev/null +++ b/Interfaces/CIncludes/Sound.h @@ -0,0 +1,517 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Copied from MPW Interfaces because SoundMgr and headers are missing from + SuperMario ROM source (header preserved below) +*/ + +/************************************************************ + +Created: Monday, January 28, 1991 at 6:54 PM + Sound.h + C Interface to the Macintosh Libraries + + + Copyright Apple Computer, Inc. 1986-1990 + All rights reserved + +************************************************************/ + + +#ifndef __SOUND__ +#define __SOUND__ + +#ifndef __TYPES__ +#include +#endif + +#ifndef __FILES__ +#include +#endif + + +enum { + + swMode = -1, /* Sound Driver modes */ + ftMode = 1, + ffMode = 0, + + +#define synthCodeRsrc 'snth' /* Resource types used by Sound Manager */ +#define soundListRsrc 'snd ' + +#define twelfthRootTwo 1.05946309434 + + rate22khz = 0x56EE8BA3, /* 22254.54545 in fixed-point */ + rate11khz = 0x2B7745D1, /* 11127.27273 in fixed-point */ + +/* synthesizer numbers for SndNewChannel */ + squareWaveSynth = 1, /*square wave synthesizer*/ + waveTableSynth = 3, /*wave table synthesizer*/ + sampledSynth = 5, /*sampled sound synthesizer*/ + +/* old Sound Manager MACE synthesizer numbers */ + MACE3snthID = 11, + MACE6snthID = 13, + +/* command numbers for SndDoCommand and SndDoImmediate */ + nullCmd = 0, + initCmd = 1, + freeCmd = 2, + quietCmd = 3, + flushCmd = 4, + reInitCmd = 5, + + waitCmd = 10, + pauseCmd = 11, + resumeCmd = 12, + callBackCmd = 13 +}; +enum { + syncCmd = 14, + emptyCmd = 15, + + tickleCmd = 20, + requestNextCmd = 21, + howOftenCmd = 22, + wakeUpCmd = 23, + availableCmd = 24, + versionCmd = 25, + totalLoadCmd = 26, + loadCmd = 27, + + scaleCmd = 30, + tempoCmd = 31, + + freqDurationCmd = 40, + restCmd = 41, + freqCmd = 42, + ampCmd = 43, + timbreCmd = 44, + getAmpCmd = 45, + + waveTableCmd = 60, + phaseCmd = 61 +}; +enum { + + soundCmd = 80, + bufferCmd = 81, + rateCmd = 82, + continueCmd = 83, + doubleBufferCmd = 84, + getRateCmd = 85, + + sizeCmd = 90, + convertCmd = 91, + + stdQLength = 128, + dataOffsetFlag = 0x8000, + + waveInitChannelMask = 0x07, + waveInitChannel0 = 0x04, + waveInitChannel1 = 0x05, + waveInitChannel2 = 0x06, + waveInitChannel3 = 0x07, + +/* channel initialization parameters */ + initPanMask = 0x0003, /* mask for right/left pan values */ + initSRateMask = 0x0030, /* mask for sample rate values */ + initStereoMask = 0x00C0, /* mask for mono/stereo values */ + initCompMask = 0xFF00, /* mask for compression IDs */ + + initChanLeft = 0x0002 /* left stereo channel */ +}; +enum { + initChanRight = 0x0003, /* right stereo channel */ + initNoInterp = 0x0004, /* no linear interpolation */ + initNoDrop = 0x0008, /* no drop-sample conversion */ + initMono = 0x0080, /* monophonic channel */ + initStereo = 0x00C0, /* stereo channel */ + initMACE3 = 0x0300, /* MACE 3:1 */ + initMACE6 = 0x0400, /* MACE 6:1 */ + + initChan0 = 0x0004, /* channel 0 - wave table only */ + initChan1 = 0x0005, /* channel 1 - wave table only */ + initChan2 = 0x0006, /* channel 2 - wave table only */ + initChan3 = 0x0007, /* channel 3 - wave table only */ + + stdSH = 0x00, /* Standard sound header encode value */ + extSH = 0xFF, /* Extended sound header encode value */ + cmpSH = 0xFE, /* Compressed sound header encode value */ + + notCompressed = 0, /* compression ID's */ + twoToOne = 1, + eightToThree = 2, + threeToOne = 3, + sixToOne = 4, + + outsideCmpSH = 0 /* MACE constants */ +}; +enum { + insideCmpSH = 1, + aceSuccess = 0, + aceMemFull = 1, + aceNilBlock = 2, + aceBadComp = 3, + aceBadEncode = 4, + aceBadDest = 5, + aceBadCmd = 6, + sixToOnePacketSize = 8, + threeToOnePacketSize = 16, + stateBlockSize = 64, + leftOverBlockSize = 32, + + firstSoundFormat = 0x0001, /* general sound format */ + secondSoundFormat = 0x0002, /* special sampled sound format (HyperCard) */ + + dbBufferReady = 0x00000001, /* double buffer is filled */ + dbLastBuffer = 0x00000004, /* last double buffer to play */ + + sysBeepDisable = 0x0000, /* SysBeep() enable flags */ + sysBeepEnable = 0x0001, + + unitTypeNoSelection = 0xFFFF, /* unitTypes for AudioSelection.unitType */ + unitTypeSeconds = 0x0000 +}; + + +/* Structures for Sound Driver */ + + +typedef unsigned char FreeWave[30001]; + +struct FFSynthRec { + short mode; + Fixed count; + FreeWave waveBytes; +}; + +typedef struct FFSynthRec FFSynthRec; +typedef FFSynthRec *FFSynthPtr; + +struct Tone { + short count; + short amplitude; + short duration; +}; + +typedef struct Tone Tone; + + +typedef Tone Tones[5001]; + +struct SWSynthRec { + short mode; + Tones triplets; +}; + +typedef struct SWSynthRec SWSynthRec; +typedef SWSynthRec *SWSynthPtr; + + +typedef unsigned char Wave[256]; +typedef Wave *WavePtr; + +struct FTSoundRec { + short duration; + Fixed sound1Rate; + long sound1Phase; + Fixed sound2Rate; + long sound2Phase; + Fixed sound3Rate; + long sound3Phase; + Fixed sound4Rate; + long sound4Phase; + WavePtr sound1Wave; + WavePtr sound2Wave; + WavePtr sound3Wave; + WavePtr sound4Wave; +}; + +typedef struct FTSoundRec FTSoundRec; +typedef FTSoundRec *FTSndRecPtr; + +struct FTSynthRec { + short mode; + FTSndRecPtr sndRec; +}; + +typedef struct FTSynthRec FTSynthRec; +typedef FTSynthRec *FTSynthPtr; + + +typedef pascal void (*SndCompletionProcPtr)(void); + +/* Structures for Sound Manager */ + +struct SndCommand { + unsigned short cmd; + short param1; + long param2; +}; + +typedef struct SndCommand SndCommand; + + +typedef long Time; /* in half milliseconds */ + + + +typedef struct SndChannel SndChannel; +typedef SndChannel *SndChannelPtr; + + +typedef pascal void (*SndCallBackProcPtr)(SndChannelPtr chan, SndCommand cmd); + +struct SndChannel { + struct SndChannel *nextChan; + Ptr firstMod; /* reserved for the Sound Manager */ + SndCallBackProcPtr callBack; + long userInfo; + Time wait; /* The following is for internal Sound Manager use only.*/ + SndCommand cmdInProgress; + short flags; + short qLength; + short qHead; /* next spot to read or -1 if empty */ + short qTail; /* next spot to write = qHead if full */ + SndCommand queue[stdQLength]; +}; + +/* MACE structures */ +struct StateBlock { + short stateVar[stateBlockSize]; +}; + +typedef struct StateBlock StateBlock; +typedef StateBlock *StateBlockPtr; + +struct LeftOverBlock { + unsigned long count; + char sampleArea[leftOverBlockSize]; +}; + +typedef struct LeftOverBlock LeftOverBlock; +typedef LeftOverBlock *LeftOverBlockPtr; + +struct ModRef { + unsigned short modNumber; + long modInit; +}; + +typedef struct ModRef ModRef; + +struct SndListResource { + short format; + short numModifiers; + ModRef modifierPart[1]; /*This is a variable length array*/ + short numCommands; + SndCommand commandPart[1]; /*This is a variable length array*/ + char dataPart[1]; /*This is a variable length array*/ +}; + +typedef struct SndListResource SndListResource; +typedef SndListResource *SndListPtr; + +struct SoundHeader { + Ptr samplePtr; /* if NIL then samples are in sampleArea */ + unsigned long length; /* length of sound in bytes */ + Fixed sampleRate; /* sample rate for this sound */ + unsigned long loopStart; /* start of looping portion */ + unsigned long loopEnd; /* end of looping portion */ + unsigned char encode; /* header encoding */ + unsigned char baseFrequency; /* baseFrequency value */ + char sampleArea[1]; +}; + +typedef struct SoundHeader SoundHeader; +typedef SoundHeader *SoundHeaderPtr; + + +struct CmpSoundHeader { + Ptr samplePtr; /* if nil then samples are in sample area */ + unsigned long numChannels; /* number of channels i.e. mono = 1 */ + Fixed sampleRate; /* sample rate in Apples Fixed point representation */ + unsigned long loopStart; /* loopStart of sound before compression */ + unsigned long loopEnd; /* loopEnd of sound before compression */ + unsigned char encode; /* data structure used , stdSH, extSH, or cmpSH */ + unsigned char baseFrequency; /* same meaning as regular SoundHeader */ + unsigned long numFrames; /* length in frames ( packetFrames or sampleFrames ) */ + extended AIFFSampleRate; /* IEEE sample rate */ + Ptr markerChunk; /* sync track */ + Ptr futureUse1; /* reserved by Apple */ + Ptr futureUse2; /* reserved by Apple */ + StateBlockPtr stateVars; /* pointer to State Block */ + LeftOverBlockPtr leftOverSamples; /* used to save truncated samples between compression calls */ + unsigned short compressionID; /* 0 means no compression, non zero means compressionID */ + unsigned short packetSize; /* number of bits in compressed sample packet */ + unsigned short snthID; /* resource ID of Sound Manager snth that contains NRT C/E */ + unsigned short sampleSize; /* number of bits in non-compressed sample */ + char sampleArea[1]; /* space for when samples follow directly */ +}; + +typedef struct CmpSoundHeader CmpSoundHeader; +typedef CmpSoundHeader *CmpSoundHeaderPtr; + +struct ExtSoundHeader { + Ptr samplePtr; /* if nil then samples are in sample area */ + unsigned long numChannels; /* number of channels, ie mono = 1 */ + Fixed sampleRate; /* sample rate in Apples Fixed point representation */ + unsigned long loopStart; /* same meaning as regular SoundHeader */ + unsigned long loopEnd; /* same meaning as regular SoundHeader */ + unsigned char encode; /* data structure used , stdSH, extSH, or cmpSH */ + unsigned char baseFrequency; /* same meaning as regular SoundHeader */ + unsigned long numFrames; /* length in total number of frames */ + extended AIFFSampleRate; /* IEEE sample rate */ + Ptr markerChunk; /* sync track */ + Ptr instrumentChunks; /* AIFF instrument chunks */ + Ptr AESRecording; + unsigned short sampleSize; /* number of bits in sample */ + unsigned short futureUse1; /* reserved by Apple */ + unsigned long futureUse2; /* reserved by Apple */ + unsigned long futureUse3; /* reserved by Apple */ + unsigned long futureUse4; /* reserved by Apple */ + char sampleArea[1]; /* space for when samples follow directly */ +}; + +typedef struct ExtSoundHeader ExtSoundHeader; +typedef ExtSoundHeader *ExtSoundHeaderPtr; + +struct ConversionBlock { + short destination; + short unused; + CmpSoundHeaderPtr inputPtr; + CmpSoundHeaderPtr outputPtr; +}; + +typedef struct ConversionBlock ConversionBlock; +typedef ConversionBlock *ConversionBlockPtr; + +struct SMStatus { + short smMaxCPULoad; + short smNumChannels; + short smCurCPULoad; +}; + +typedef struct SMStatus SMStatus; +typedef SMStatus *SMStatusPtr; + +struct SCStatus { + Fixed scStartTime; + Fixed scEndTime; + Fixed scCurrentTime; + Boolean scChannelBusy; + Boolean scChannelDisposed; + Boolean scChannelPaused; + Boolean scUnused; + unsigned long scChannelAttributes; + long scCPULoad; +}; + +typedef struct SCStatus SCStatus; +typedef SCStatus *SCStatusPtr; + +struct AudioSelection { + long unitType; + Fixed selStart; + Fixed selEnd; +}; + +typedef struct AudioSelection AudioSelection; +typedef AudioSelection *AudioSelectionPtr; + +struct SndDoubleBuffer { + long dbNumFrames; + long dbFlags; + long dbUserInfo[2]; + char dbSoundData[1]; +}; + +typedef struct SndDoubleBuffer SndDoubleBuffer; +typedef SndDoubleBuffer *SndDoubleBufferPtr; + + +typedef pascal void (*SndDoubleBackProcPtr) (SndChannelPtr channel, + SndDoubleBufferPtr doubleBufferPtr); + +struct SndDoubleBufferHeader { + short dbhNumChannels; + short dbhSampleSize; + short dbhCompressionID; + short dbhPacketSize; + Fixed dbhSampleRate; + SndDoubleBufferPtr dbhBufferPtr[2]; + SndDoubleBackProcPtr dbhDoubleBack; +}; + +typedef struct SndDoubleBufferHeader SndDoubleBufferHeader; +typedef SndDoubleBufferHeader *SndDoubleBufferHeaderPtr; + + +#ifdef __cplusplus +extern "C" { +#endif +pascal OSErr SndDoCommand(SndChannelPtr chan,const SndCommand *cmd,Boolean noWait) + = 0xA803; +pascal OSErr SndDoImmediate(SndChannelPtr chan,const SndCommand *cmd) + = 0xA804; +pascal OSErr SndNewChannel(SndChannelPtr *chan,short synth,long init,SndCallBackProcPtr userRoutine) + = 0xA807; +pascal OSErr SndDisposeChannel(SndChannelPtr chan,Boolean quietNow) + = 0xA801; +pascal OSErr SndPlay(SndChannelPtr chan,Handle sndHdl,Boolean async) + = 0xA805; +pascal OSErr SndAddModifier(SndChannelPtr chan,ProcPtr modifier,short id, + long init) + = 0xA802; +pascal OSErr SndControl(short id,SndCommand *cmd) + = 0xA806; + +pascal void SetSoundVol(short level); +#pragma parameter GetSoundVol(__A0) +pascal void GetSoundVol(short *level) + = {0x4218,0x10B8,0x0260}; +pascal void StartSound(const void *synthRec,long numBytes,SndCompletionProcPtr completionRtn); +pascal void StopSound(void); +pascal Boolean SoundDone(void); + +pascal NumVersion SndSoundManagerVersion(void) + = {0x203C,0x000C,0x0008,0xA800}; +pascal OSErr SndStartFilePlay(SndChannelPtr chan,short fRefNum,short resNum, + long bufferSize,void *theBuffer,AudioSelectionPtr theSelection,ProcPtr theCompletion, + Boolean async) + = {0x203C,0x0D00,0x0008,0xA800}; +pascal OSErr SndPauseFilePlay(SndChannelPtr chan) + = {0x203C,0x0204,0x0008,0xA800}; +pascal OSErr SndStopFilePlay(SndChannelPtr chan,Boolean async) + = {0x203C,0x0308,0x0008,0xA800}; +pascal OSErr SndChannelStatus(SndChannelPtr chan,short theLength,SCStatusPtr theStatus) + = {0x203C,0x0010,0x0008,0xA800}; +pascal OSErr SndManagerStatus(short theLength,SMStatusPtr theStatus) + = {0x203C,0x0014,0x0008,0xA800}; +pascal void SndGetSysBeepState(short *sysBeepState) + = {0x203C,0x0018,0x0008,0xA800}; +pascal OSErr SndSetSysBeepState(short sysBeepState) + = {0x203C,0x001C,0x0008,0xA800}; +pascal OSErr SndPlayDoubleBuffer(SndChannelPtr chan,SndDoubleBufferHeaderPtr theParams) + = {0x203C,0x0020,0x0008,0xA800}; + +pascal NumVersion MACEVersion(void) + = {0x203C,0x0000,0x0010,0xA800}; +pascal void Comp3to1(const void *inBuffer,void *outBuffer,unsigned long cnt, + const void *inState,void *outState,unsigned long numChannels,unsigned long whichChannel) + = {0x203C,0x0004,0x0010,0xA800}; +pascal void Exp1to3(const void *inBuffer,void *outBuffer,unsigned long cnt, + const void *inState,void *outState,unsigned long numChannels,unsigned long whichChannel) + = {0x203C,0x0008,0x0010,0xA800}; +pascal void Comp6to1(const void *inBuffer,void *outBuffer,unsigned long cnt, + const void *inState,void *outState,unsigned long numChannels,unsigned long whichChannel) + = {0x203C,0x000C,0x0010,0xA800}; +pascal void Exp1to6(const void *inBuffer,void *outBuffer,unsigned long cnt, + const void *inState,void *outState,unsigned long numChannels,unsigned long whichChannel) + = {0x203C,0x0010,0x0010,0xA800}; +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Interfaces/CIncludes/Sound.h.idump b/Interfaces/CIncludes/Sound.h.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/CIncludes/Sound.h.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/CIncludes/Sound.h.rdump b/Interfaces/CIncludes/Sound.h.rdump new file mode 100644 index 0000000..024dc74 --- /dev/null +++ b/Interfaces/CIncludes/Sound.h.rdump @@ -0,0 +1,176 @@ +data 'MPSR' (1005) { + $"0009 4D6F 6E61 636F 0042 01E3 01CF 026E" /* ..Monaco.B.....n */ + $"01CF 027E 0000 0000 0000 0000 8200 0014" /* ...~............ */ + $"0001 0006 0004 002A 0003 0142 01E3 002A" /* .......*...B...* */ + $"0003 0142 01E3 A42B A620 0000 0000 0000" /* ...B...+. ...... */ + $"0000 0000 0000 0100" /* ........ */ +}; + +data 'MPSR' (1007) { + $"0076 0000 01BE 0000 0202 0773 774D 6F64" /* .v.........swMod */ + $"6500 0000 0203 0000 0212 0766 744D 6F64" /* e..........ftMod */ + $"6500 0000 0213 0000 0222 0766 664D 6F64" /* e........".ffMod */ + $"6500 0000 0225 0000 027B 0D73 796E 7468" /* e....%...{.synth */ + $"436F 6465 5273 7263 0000 027C 0000 0298" /* CodeRsrc...|.... */ + $"0D73 6F75 6E64 4C69 7374 5273 7263 0000" /* .soundListRsrc.. */ + $"030D 0000 0359 0972 6174 6531 316B 687A" /* .....Y.rate11khz */ + $"0000 0387 0000 03CE 0F73 7175 6172 6557" /* .........squareW */ + $"6176 6553 796E 7468 0000 03CF 0000 0415" /* aveSynth........ */ + $"0F77 6176 6554 6162 6C65 5379 6E74 6800" /* .waveTableSynth. */ + $"0000 0416 0000 2BB9 0D73 616D 706C 6564" /* ......+..sampled */ + $"5379 6E74 6800 0000 0492 0000 2E8C 0B4D" /* Synth..........M */ + $"4143 4533 736E 7468 4944 0000 04A8 0000" /* ACE3snthID...... */ + $"04BD 0B4D 4143 4536 736E 7468 4944 0000" /* ...MACE6snthID.. */ + $"04F9 0000 0509 076E 756C 6C43 6D64 0000" /* .......nullCmd.. */ + $"050A 0000 051A 0769 6E69 7443 6D64 0000" /* .......initCmd.. */ + $"051B 0000 052B 0766 7265 6543 6D64 0000" /* .....+.freeCmd.. */ + $"052C 0000 053D 0971 7569 6574 436D 6400" /* .,...=.quietCmd. */ + $"0000 053E 0000 054F 0966 6C75 7368 436D" /* ...>...O.flushCm */ + $"6400 0000 0550 0000 0562 0972 6549 6E69" /* d....P...b.reIni */ + $"7443 6D64 0000 0564 0000 0575 0777 6169" /* tCmd...d...u.wai */ + $"7443 6D64 0000 0576 0000 0588 0970 6175" /* tCmd...v.....pau */ + $"7365 436D 6400 0000 0589 0000 059C 0972" /* seCmd..........r */ + $"6573 756D 6543 6D64 0000 059D 0000 05B1" /* esumeCmd........ */ + $"0B63 616C 6C42 6163 6B43 6D64 0000 05BC" /* .callBackCmd.... */ + $"0000 05CD 0773 796E 6343 6D64 0000 05CE" /* .....syncCmd.... */ + $"0000 05E0 0965 6D70 7479 436D 6400 0000" /* .....emptyCmd... */ + $"05E2 0000 05F5 0974 6963 6B6C 6543 6D64" /* .......tickleCmd */ + $"0000 05F6 0000 060E 0F72 6571 7565 7374" /* .........request */ + $"4E65 7874 436D 6400 0000 060F 0000 0624" /* NextCmd........$ */ + $"0B68 6F77 4F66 7465 6E43 6D64 0000 0625" /* .howOftenCmd...% */ + $"0000 0638 0977 616B 6555 7043 6D64 0000" /* ...8.wakeUpCmd.. */ + $"0639 0000 064F 0D61 7661 696C 6162 6C65" /* .9...O.available */ + $"436D 6400 0000 0650 0000 0664 0B76 6572" /* Cmd....P...d.ver */ + $"7369 6F6E 436D 6400 0000 0665 0000 067B" /* sionCmd....e...{ */ + $"0D74 6F74 616C 4C6F 6164 436D 6400 0000" /* .totalLoadCmd... */ + $"067C 0000 068D 076C 6F61 6443 6D64 0000" /* .|.....loadCmd.. */ + $"068F 0000 06A1 0973 6361 6C65 436D 6400" /* .......scaleCmd. */ + $"0000 06A2 0000 06B4 0974 656D 706F 436D" /* .........tempoCm */ + $"6400 0000 06B6 0000 06CF 0F66 7265 7144" /* d..........freqD */ + $"7572 6174 696F 6E43 6D64 0000 06D0 0000" /* urationCmd...... */ + $"06E1 0772 6573 7443 6D64 0000 06E2 0000" /* ...restCmd...... */ + $"06F3 0766 7265 7143 6D64 0000 06F4 0000" /* ...freqCmd...... */ + $"0704 0761 6D70 436D 6400 0000 0705 0000" /* ...ampCmd....... */ + $"0718 0974 696D 6272 6543 6D64 0000 0719" /* ...timbreCmd.... */ + $"0000 072C 0967 6574 416D 7043 6D64 0000" /* ...,.getAmpCmd.. */ + $"072E 0000 0744 0D77 6176 6554 6162 6C65" /* .....D.waveTable */ + $"436D 6400 0000 0745 0000 0756 0970 6861" /* Cmd....E...V.pha */ + $"7365 436D 6400 0000 0762 0000 0774 0973" /* seCmd....b...t.s */ + $"6F75 6E64 436D 6400 0000 0775 0000 0788" /* oundCmd....u.... */ + $"0962 7566 6665 7243 6D64 0000 0789 0000" /* .bufferCmd...... */ + $"079A 0772 6174 6543 6D64 0000 079B 0000" /* ...rateCmd...... */ + $"07B0 0B63 6F6E 7469 6E75 6543 6D64 0000" /* ...continueCmd.. */ + $"07B1 0000 07CA 0F64 6F75 626C 6542 7566" /* .......doubleBuf */ + $"6665 7243 6D64 0000 07CB 0000 07DF 0B67" /* ferCmd.........g */ + $"6574 5261 7465 436D 6400 0000 07E1 0000" /* etRateCmd....... */ + $"07F2 0773 697A 6543 6D64 0000 07F3 0000" /* ...sizeCmd...... */ + $"0807 0B63 6F6E 7665 7274 436D 6400 0000" /* ...convertCmd... */ + $"0809 0000 081E 0B73 7464 514C 656E 6774" /* .......stdQLengt */ + $"6800 0000 08B4 0000 08D0 1177 6176 6549" /* h..........waveI */ + $"6E69 7443 6861 6E6E 656C 3300 0000 08FA" /* nitChannel3..... */ + $"0000 094A 0B69 6E69 7450 616E 4D61 736B" /* ...J.initPanMask */ + $"0000 094B 0000 0998 0D69 6E69 7453 5261" /* ...K.....initSRa */ + $"7465 4D61 736B 0000 0999 0000 09E6 0F69" /* teMask.........i */ + $"6E69 7453 7465 7265 6F4D 6173 6B00 0000" /* nitStereoMask... */ + $"09E7 0000 0A31 0D69 6E69 7443 6F6D 704D" /* .....1.initCompM */ + $"6173 6B00 0000 0A33 0000 0A78 0D69 6E69" /* ask....3...x.ini */ + $"7443 6861 6E4C 6566 7400 0000 0A83 0000" /* tChanLeft....... */ + $"0AC9 0D69 6E69 7443 6861 6E52 6967 6874" /* ...initChanRight */ + $"0000 0ACA 0000 0B13 0D69 6E69 744E 6F49" /* .........initNoI */ + $"6E74 6572 7000 0000 0B14 0000 0B5F 0B69" /* nterp........_.i */ + $"6E69 744E 6F44 726F 7000 0000 0B60 0000" /* nitNoDrop....`.. */ + $"0BA4 0969 6E69 744D 6F6E 6F00 0000 0D47" /* ...initMono....G */ + $"0000 0D94 0969 6E69 7443 6861 6E33 0000" /* .....initChan3.. */ + $"0D96 0000 0DEA 0573 7464 5348 0000 0DEB" /* .......stdSH.... */ + $"0000 0E3F 0565 7874 5348 0000 0E40 0000" /* ...?.extSH...@.. */ + $"0E96 0563 6D70 5348 0000 0E98 0000 0EDA" /* ...cmpSH........ */ + $"0D6E 6F74 436F 6D70 7265 7373 6564 0000" /* .notCompressed.. */ + $"0EDB 0000 0EEC 0974 776F 546F 4F6E 6500" /* .......twoToOne. */ + $"0000 0EED 0000 0F02 0D65 6967 6874 546F" /* .........eightTo */ + $"5468 7265 6500 0000 0F03 0000 0F16 0B74" /* Three..........t */ + $"6872 6565 546F 4F6E 6500 0000 0F17 0000" /* hreeToOne....... */ + $"0F28 0973 6978 546F 4F6E 6500 0000 0F2A" /* .(.sixToOne....* */ + $"0000 0F6A 0D6F 7574 7369 6465 436D 7053" /* ...j.outsideCmpS */ + $"4800 0000 0F75 0000 0F89 0B69 6E73 6964" /* H....u.....insid */ + $"6543 6D70 5348 0000 0F8A 0000 0F9D 0B61" /* eCmpSH.........a */ + $"6365 5375 6363 6573 7300 0000 0F9E 0000" /* ceSuccess....... */ + $"0FB1 0B61 6365 4D65 6D46 756C 6C00 0000" /* ...aceMemFull... */ + $"0FB2 0000 0FC6 0B61 6365 4E69 6C42 6C6F" /* .......aceNilBlo */ + $"636B 0000 0FC7 0000 0FDA 0B61 6365 4261" /* ck.........aceBa */ + $"6443 6F6D 7000 0000 0FDB 0000 0FF0 0D61" /* dComp..........a */ + $"6365 4261 6445 6E63 6F64 6500 0000 0FF1" /* ceBadEncode..... */ + $"0000 1004 0B61 6365 4261 6444 6573 7400" /* .....aceBadDest. */ + $"0000 1034 0000 1052 1574 6872 6565 546F" /* ...4...R.threeTo */ + $"4F6E 6550 6163 6B65 7453 697A 6500 0000" /* OnePacketSize... */ + $"10D0 0000 112A 1173 6563 6F6E 6453 6F75" /* .....*.secondSou */ + $"6E64 466F 726D 6174 0000 112C 0000 1175" /* ndFormat...,...u */ + $"0D64 6242 7566 6665 7252 6561 6479 0000" /* .dbBufferReady.. */ + $"1176 0000 11C2 0D64 624C 6173 7442 7566" /* .v.....dbLastBuf */ + $"6665 7200 0000 11C4 0000 120C 0F73 7973" /* fer..........sys */ + $"4265 6570 4469 7361 626C 6500 0000 122A" /* BeepDisable....* */ + $"0000 1281 1375 6E69 7454 7970 654E 6F53" /* .....unitTypeNoS */ + $"656C 6563 7469 6F6E 0000 1282 0000 129E" /* election........ */ + $"0F75 6E69 7454 7970 6553 6563 6F6E 6473" /* .unitTypeSeconds */ + $"0000 12DE 0000 1305 0946 7265 6557 6176" /* .........FreeWav */ + $"6500 0000 1307 0000 139D 0B46 4653 796E" /* e..........FFSyn */ + $"7468 5265 6300 0000 139F 0000 1404 0554" /* thRec..........T */ + $"6F6E 6500 0000 1407 0000 1420 0554 6F6E" /* one........ .Ton */ + $"6573 0000 1422 0000 14A3 0B53 5753 796E" /* es...".....SWSyn */ + $"7468 5265 6300 0000 14A6 0000 14C7 0557" /* thRec..........W */ + $"6176 6500 0000 14C8 0000 14DE 0757 6176" /* ave..........Wav */ + $"6550 7472 0000 14E0 0000 1662 0B46 5453" /* ePtr.......b.FTS */ + $"6F75 6E64 5265 6300 0000 16EC 0000 171E" /* oundRec......... */ + $"1553 6E64 436F 6D70 6C65 7469 6F6E 5072" /* .SndCompletionPr */ + $"6F63 5074 7200 0000 175A 0000 17D2 0B53" /* ocPtr....Z.....S */ + $"6E64 436F 6D6D 616E 6400 0000 17D5 0000" /* ndCommand....... */ + $"181B 0554 696D 6500 0000 181F 0000 1AE9" /* ...Time......... */ + $"0B53 6E64 4368 616E 6E65 6C00 0000 1B01" /* .SndChannel..... */ + $"0000 1B85 0B53 7461 7465 426C 6F63 6B00" /* .....StateBlock. */ + $"0000 1B87 0000 1C37 0D4C 6566 744F 7665" /* .......7.LeftOve */ + $"7242 6C6F 636B 0000 1C39 0000 1C9A 074D" /* rBlock...9.....M */ + $"6F64 5265 6600 0000 1C9C 0000 1E3E 0F53" /* odRef........>.S */ + $"6E64 4C69 7374 5265 736F 7572 6365 0000" /* ndListResource.. */ + $"1E40 0000 20C9 0B53 6F75 6E64 4865 6164" /* .@.. ..SoundHead */ + $"6572 0000 20CC 0000 27B3 0F43 6D70 536F" /* er.. ...'..CmpSo */ + $"756E 6448 6561 6465 7200 0000 2D81 0000" /* undHeader...-... */ + $"2E64 0F43 6F6E 7665 7273 696F 6E42 6C6F" /* .d.ConversionBlo */ + $"636B 0000 2E66 0000 2F05 0953 4D53 7461" /* ck...f../..SMSta */ + $"7475 7300 0000 2F07 0000 304A 0953 4353" /* tus.../...0J.SCS */ + $"7461 7475 7300 0000 3266 0000 33CE 1553" /* tatus...2f..3..S */ + $"6E64 446F 7562 6C65 4275 6666 6572 4865" /* ndDoubleBufferHe */ + $"6164 6572 0000 33F8 0000 3459 0D53 6E64" /* ader..3...4Y.Snd */ + $"446F 436F 6D6D 616E 6400 0000 345A 0000" /* DoCommand...4Z.. */ + $"34AE 0F53 6E64 446F 496D 6D65 6469 6174" /* 4..SndDoImmediat */ + $"6500 0000 3523 0000 3575 1153 6E64 4469" /* e...5#..5u.SndDi */ + $"7370 6F73 6543 6861 6E6E 656C 0000 3576" /* sposeChannel..5v */ + $"0000 35C9 0753 6E64 506C 6179 0000 35CA" /* ..5..SndPlay..5. */ + $"0000 3631 0F53 6E64 4164 644D 6F64 6966" /* ..61.SndAddModif */ + $"6965 7200 0000 3632 0000 3672 0B53 6E64" /* ier...62..6r.Snd */ + $"436F 6E74 726F 6C00 0000 3674 0000 369A" /* Control...6t..6. */ + $"0B53 6574 536F 756E 6456 6F6C 0000 369B" /* .SetSoundVol..6. */ + $"0000 3703 0B47 6574 536F 756E 6456 6F6C" /* ..7..GetSoundVol */ + $"0000 3704 0000 3763 0B53 7461 7274 536F" /* ..7...7c.StartSo */ + $"756E 6400 0000 3764 0000 3781 0953 746F" /* und...7d..7..Sto */ + $"7053 6F75 6E64 0000 3B33 0000 3BB0 1353" /* pSound..;3..;..S */ + $"6E64 506C 6179 446F 7562 6C65 4275 6666" /* ndPlayDoubleBuff */ + $"6572 0000 3E6B 0000 3F39 0745 7870 3174" /* er..>k..?9.Exp1t */ + $"6F36" /* o6 */ +}; + +data 'MPSR' (1008) { + $"002A 0003 0142 01E3 002A 0003 0142 01E3" /* .*...B...*...B.. */ + $"0000 0000 0000 0000 0000 0000 0000" /* .............. */ +}; + +data 'vers' (1, purgeable) { + $"0320 8000 0000 0533 2E32 2E30 2433 2E32" /* . .....3.2.0$3.2 */ + $"2E30 20A9 2041 7070 6C65 2043 6F6D 7075" /* .0 . Apple Compu */ + $"7465 722C 2049 6E63 2E20 3139 3835 2D39" /* ter, Inc. 1985-9 */ + $"31" /* 1 */ +}; + +data 'vers' (2, purgeable) { + $"0320 8000 0000 0333 2E32 074D 5057 2033" /* . .....3.2.MPW 3 */ + $"2E32" /* .2 */ +}; + diff --git a/Interfaces/PInterfaces/Sound.p b/Interfaces/PInterfaces/Sound.p new file mode 100644 index 0000000..70221fb --- /dev/null +++ b/Interfaces/PInterfaces/Sound.p @@ -0,0 +1,461 @@ +{ + Hacks to match MacOS (most recent first): + + 8/3/92 Copied from MPW Interfaces because SoundMgr and headers are missing from + SuperMario ROM source (header preserved below) +} + +{ +Created: Monday, December 2, 1991 at 5:09 PM + Sound.p + Pascal Interface to the Macintosh Libraries + + Copyright Apple Computer, Inc. 1986-1991 + All rights reserved +} + + +{$IFC UNDEFINED UsingIncludes} +{$SETC UsingIncludes := 0} +{$ENDC} + +{$IFC NOT UsingIncludes} + UNIT Sound; + INTERFACE +{$ENDC} + +{$IFC UNDEFINED UsingSound} +{$SETC UsingSound := 1} + +{$I+} +{$SETC SoundIncludes := UsingIncludes} +{$SETC UsingIncludes := 1} +{$IFC UNDEFINED UsingTypes} +{$I $$Shell(PInterfaces)Types.p} +{$ENDC} +{$IFC UNDEFINED UsingFiles} +{$I $$Shell(PInterfaces)Files.p} +{$ENDC} +{$SETC UsingIncludes := SoundIncludes} + +CONST +swMode = -1; { Sound Driver modes } +ftMode = 1; +ffMode = 0; + +synthCodeRsrc = 'snth'; { Resource types used by Sound Manager } +soundListRsrc = 'snd '; + +twelfthRootTwo = 1.05946309434; +rate22khz = $56EE8BA3; { 22254.54545 in fixed-point } +rate11khz = $2B7745D1; { 11127.27273 in fixed-point } + +{ synthesizer numbers for SndNewChannel } +squareWaveSynth = 1; {square wave synthesizer} +waveTableSynth = 3; {wave table synthesizer} +sampledSynth = 5; {sampled sound synthesizer} + +{ old Sound Manager MACE synthesizer numbers } +MACE3snthID = 11; +MACE6snthID = 13; + +{ command numbers for SndDoCommand and SndDoImmediate } +nullCmd = 0; +initCmd = 1; +freeCmd = 2; +quietCmd = 3; +flushCmd = 4; +reInitCmd = 5; + +waitCmd = 10; +pauseCmd = 11; +resumeCmd = 12; +callBackCmd = 13; +syncCmd = 14; +emptyCmd = 15; + +tickleCmd = 20; +requestNextCmd = 21; +howOftenCmd = 22; +wakeUpCmd = 23; +availableCmd = 24; +versionCmd = 25; +totalLoadCmd = 26; +loadCmd = 27; + +scaleCmd = 30; +tempoCmd = 31; + +freqDurationCmd = 40; +restCmd = 41; +freqCmd = 42; +ampCmd = 43; +timbreCmd = 44; +getAmpCmd = 45; + +waveTableCmd = 60; +phaseCmd = 61; + +soundCmd = 80; +bufferCmd = 81; +rateCmd = 82; +continueCmd = 83; +doubleBufferCmd = 84; +getRateCmd = 85; + +sizeCmd = 90; +convertCmd = 91; + +stdQLength = 128; +dataOffsetFlag = $8000; + +waveInitChannelMask = $07; +waveInitChannel0 = $04; +waveInitChannel1 = $05; +waveInitChannel2 = $06; +waveInitChannel3 = $07; + +{ channel initialization parameters } +initPanMask = $0003; { mask for right/left pan values } +initSRateMask = $0030; { mask for sample rate values } +initStereoMask = $00C0; { mask for mono/stereo values } +initCompMask = $FF00; { mask for compression IDs } + +initChanLeft = $0002; { left stereo channel } +initChanRight = $0003; { right stereo channel } +initNoInterp = $0004; { no linear interpolation } +initNoDrop = $0008; { no drop-sample conversion } +initMono = $0080; { monophonic channel } +initStereo = $00C0; { stereo channel } +initMACE3 = $0300; { MACE 3:1 } +initMACE6 = $0400; { MACE 6:1 } + +initChan0 = $0004; { channel 0 - wave table only } +initChan1 = $0005; { channel 1 - wave table only } +initChan2 = $0006; { channel 2 - wave table only } +initChan3 = $0007; { channel 3 - wave table only } + +stdSH = $00; { Standard sound header encode value } +extSH = $FF; { Extended sound header encode value } +cmpSH = $FE; { Compressed sound header encode value } + +notCompressed = 0; { compression ID's } +twoToOne = 1; +eightToThree = 2; +threeToOne = 3; +sixToOne = 4; + +outsideCmpSH = 0; { MACE constants } +insideCmpSH = 1; +aceSuccess = 0; +aceMemFull = 1; +aceNilBlock = 2; +aceBadComp = 3; +aceBadEncode = 4; +aceBadDest = 5; +aceBadCmd = 6; +sixToOnePacketSize = 8; +threeToOnePacketSize = 16; +stateBlockSize = 64; +leftOverBlockSize = 32; + +firstSoundFormat = $0001; { general sound format } +secondSoundFormat = $0002; { special sampled sound format (HyperCard) } + +dbBufferReady = $00000001; { double buffer is filled } +dbLastBuffer = $00000004; { last double buffer to play } + +sysBeepDisable = $0000; { SysBeep() enable flags } +sysBeepEnable = $0001; + +unitTypeNoSelection = $FFFF; { unitTypes for AudioSelection.unitType } +unitTypeSeconds = $0000; + +TYPE +{ Structures for Sound Driver } + + +FreeWave = PACKED ARRAY [0..30000] OF Byte; + +FFSynthPtr = ^FFSynthRec; +FFSynthRec = RECORD + mode: INTEGER; + count: Fixed; + waveBytes: FreeWave; + END; + +Tone = RECORD + count: INTEGER; + amplitude: INTEGER; + duration: INTEGER; + END; + + +Tones = ARRAY [0..5000] OF Tone; + +SWSynthPtr = ^SWSynthRec; +SWSynthRec = RECORD + mode: INTEGER; + triplets: Tones; + END; + + +Wave = PACKED ARRAY [0..255] OF Byte; +WavePtr = ^Wave; + +FTSndRecPtr = ^FTSoundRec; +FTSoundRec = RECORD + duration: INTEGER; + sound1Rate: Fixed; + sound1Phase: LONGINT; + sound2Rate: Fixed; + sound2Phase: LONGINT; + sound3Rate: Fixed; + sound3Phase: LONGINT; + sound4Rate: Fixed; + sound4Phase: LONGINT; + sound1Wave: WavePtr; + sound2Wave: WavePtr; + sound3Wave: WavePtr; + sound4Wave: WavePtr; + END; + +FTSynthPtr = ^FTSynthRec; +FTSynthRec = RECORD + mode: INTEGER; + sndRec: FTSndRecPtr; + END; + +{ Structures for Sound Manager } + +SndCommand = PACKED RECORD + cmd: INTEGER; + param1: INTEGER; + param2: LONGINT; + END; + + +Time = LONGINT; { in half milliseconds } + + + +SndChannelPtr = ^SndChannel; +SndChannel = PACKED RECORD + nextChan: SndChannelPtr; + firstMod: Ptr; { reserved for the Sound Manager } + callBack: ProcPtr; + userInfo: LONGINT; + wait: Time; { The following is for internal Sound Manager use only.} + cmdInProgress: SndCommand; + flags: INTEGER; + qLength: INTEGER; + qHead: INTEGER; { next spot to read or -1 if empty } + qTail: INTEGER; { next spot to write = qHead if full } + queue: ARRAY [0..stdQLength - 1] OF SndCommand; + END; + +{ MACE structures } +StateBlockPtr = ^StateBlock; +StateBlock = RECORD + stateVar: ARRAY [0..stateBlockSize - 1] OF INTEGER; + END; + +LeftOverBlockPtr = ^LeftOverBlock; +LeftOverBlock = RECORD + count: LONGINT; + sampleArea: PACKED ARRAY [0..leftOverBlockSize - 1] OF Byte; + END; + +ModRef = RECORD + modNumber: INTEGER; + modInit: LONGINT; + END; + +SndListPtr = ^SndListResource; +SndListResource = RECORD + format: INTEGER; + numModifiers: INTEGER; + modifierPart: ARRAY [0..0] OF ModRef; {This is a variable length array} + numCommands: INTEGER; + commandPart: ARRAY [0..0] OF SndCommand; {This is a variable length array} + dataPart: PACKED ARRAY [0..0] OF Byte; {This is a variable length array} + END; + +SoundHeaderPtr = ^SoundHeader; +SoundHeader = PACKED RECORD + samplePtr: Ptr; { if NIL then samples are in sampleArea } + length: LONGINT; { length of sound in bytes } + sampleRate: Fixed; { sample rate for this sound } + loopStart: LONGINT; { start of looping portion } + loopEnd: LONGINT; { end of looping portion } + encode: Byte; { header encoding } + baseFrequency: Byte; { baseFrequency value } + sampleArea: PACKED ARRAY [0..0] OF Byte; + END; + +CmpSoundHeaderPtr = ^CmpSoundHeader; +CmpSoundHeader = PACKED RECORD + samplePtr: Ptr; { if nil then samples are in sample area } + numChannels: LONGINT; { number of channels i.e. mono = 1 } + sampleRate: Fixed; { sample rate in Apples Fixed point representation } + loopStart: LONGINT; { loopStart of sound before compression } + loopEnd: LONGINT; { loopEnd of sound before compression } + encode: Byte; { data structure used , stdSH, extSH, or cmpSH } + baseFrequency: Byte; { same meaning as regular SoundHeader } + numFrames: LONGINT; { length in frames ( packetFrames or sampleFrames ) } + AIFFSampleRate: Extended80; { IEEE sample rate } + markerChunk: Ptr; { sync track } + futureUse1: Ptr; { reserved by Apple } + futureUse2: Ptr; { reserved by Apple } + stateVars: StateBlockPtr; { pointer to State Block } + leftOverSamples: LeftOverBlockPtr; { used to save truncated samples between compression calls } + compressionID: INTEGER; { 0 means no compression, non zero means compressionID } + packetSize: INTEGER; { number of bits in compressed sample packet } + snthID: INTEGER; { resource ID of Sound Manager snth that contains NRT C/E } + sampleSize: INTEGER; { number of bits in non-compressed sample } + sampleArea: PACKED ARRAY [0..0] OF Byte; { space for when samples follow directly } + END; + +ExtSoundHeaderPtr = ^ExtSoundHeader; +ExtSoundHeader = PACKED RECORD + samplePtr: Ptr; { if nil then samples are in sample area } + numChannels: LONGINT; { number of channels, ie mono = 1 } + sampleRate: Fixed; { sample rate in Apples Fixed point representation } + loopStart: LONGINT; { same meaning as regular SoundHeader } + loopEnd: LONGINT; { same meaning as regular SoundHeader } + encode: Byte; { data structure used , stdSH, extSH, or cmpSH } + baseFrequency: Byte; { same meaning as regular SoundHeader } + numFrames: LONGINT; { length in total number of frames } + AIFFSampleRate: Extended80; { IEEE sample rate } + markerChunk: Ptr; { sync track } + instrumentChunks: Ptr; { AIFF instrument chunks } + AESRecording: Ptr; + sampleSize: INTEGER; { number of bits in sample } + futureUse1: INTEGER; { reserved by Apple } + futureUse2: LONGINT; { reserved by Apple } + futureUse3: LONGINT; { reserved by Apple } + futureUse4: LONGINT; { reserved by Apple } + sampleArea: PACKED ARRAY [0..0] OF Byte; { space for when samples follow directly } + END; + +ConversionBlockPtr = ^ConversionBlock; +ConversionBlock = RECORD + destination: INTEGER; + unused: INTEGER; + inputPtr: CmpSoundHeaderPtr; + outputPtr: CmpSoundHeaderPtr; + END; + +SMStatusPtr = ^SMStatus; +SMStatus = PACKED RECORD + smMaxCPULoad: INTEGER; + smNumChannels: INTEGER; + smCurCPULoad: INTEGER; + END; + +SCStatusPtr = ^SCStatus; +SCStatus = RECORD + scStartTime: Fixed; + scEndTime: Fixed; + scCurrentTime: Fixed; + scChannelBusy: BOOLEAN; + scChannelDisposed: BOOLEAN; + scChannelPaused: BOOLEAN; + scUnused: BOOLEAN; + scChannelAttributes: LONGINT; + scCPULoad: LONGINT; + END; + +AudioSelectionPtr = ^AudioSelection; +AudioSelection = PACKED RECORD + unitType: LONGINT; + selStart: Fixed; + selEnd: Fixed; + END; + +SndDoubleBufferPtr = ^SndDoubleBuffer; +SndDoubleBuffer = PACKED RECORD + dbNumFrames: LONGINT; + dbFlags: LONGINT; + dbUserInfo: ARRAY [0..1] OF LONGINT; + dbSoundData: PACKED ARRAY [0..0] OF Byte; + END; + +SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader; +SndDoubleBufferHeader = PACKED RECORD + dbhNumChannels: INTEGER; + dbhSampleSize: INTEGER; + dbhCompressionID: INTEGER; + dbhPacketSize: INTEGER; + dbhSampleRate: Fixed; + dbhBufferPtr: ARRAY [0..1] OF SndDoubleBufferPtr; + dbhDoubleBack: ProcPtr; + END; + + +FUNCTION SndDoCommand(chan: SndChannelPtr;cmd: SndCommand;noWait: BOOLEAN): OSErr; + INLINE $A803; +FUNCTION SndDoImmediate(chan: SndChannelPtr;cmd: SndCommand): OSErr; + INLINE $A804; +FUNCTION SndNewChannel(VAR chan: SndChannelPtr;synth: INTEGER;init: LONGINT; + userRoutine: ProcPtr): OSErr; + INLINE $A807; +FUNCTION SndDisposeChannel(chan: SndChannelPtr;quietNow: BOOLEAN): OSErr; + INLINE $A801; +FUNCTION SndPlay(chan: SndChannelPtr;sndHdl: Handle;async: BOOLEAN): OSErr; + INLINE $A805; +FUNCTION SndAddModifier(chan: SndChannelPtr;modifier: ProcPtr;id: INTEGER; + init: LONGINT): OSErr; + INLINE $A802; +FUNCTION SndControl(id: INTEGER;VAR cmd: SndCommand): OSErr; + INLINE $A806; + +PROCEDURE SetSoundVol(level: INTEGER); +PROCEDURE GetSoundVol(VAR level: INTEGER); +PROCEDURE StartSound(synthRec: Ptr;numBytes: LONGINT;completionRtn: ProcPtr); +PROCEDURE StopSound; +FUNCTION SoundDone: BOOLEAN; + +FUNCTION SndSoundManagerVersion: NumVersion; + INLINE $203C,$000C,$0008,$A800; +FUNCTION SndStartFilePlay(chan: SndChannelPtr;fRefNum: INTEGER;resNum: INTEGER; + bufferSize: LONGINT;theBuffer: Ptr;theSelection: AudioSelectionPtr;theCompletion: ProcPtr; + async: BOOLEAN): OSErr; + INLINE $203C,$0D00,$0008,$A800; +FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr; + INLINE $203C,$0204,$0008,$A800; +FUNCTION SndStopFilePlay(chan: SndChannelPtr;async: BOOLEAN): OSErr; + INLINE $203C,$0308,$0008,$A800; +FUNCTION SndChannelStatus(chan: SndChannelPtr;theLength: INTEGER;theStatus: SCStatusPtr): OSErr; + INLINE $203C,$0010,$0008,$A800; +FUNCTION SndManagerStatus(theLength: INTEGER;theStatus: SMStatusPtr): OSErr; + INLINE $203C,$0014,$0008,$A800; +PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER); + INLINE $203C,$0018,$0008,$A800; +FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr; + INLINE $203C,$001C,$0008,$A800; +FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr;theParams: SndDoubleBufferHeaderPtr): OSErr; + INLINE $203C,$0020,$0008,$A800; + +FUNCTION MACEVersion: NumVersion; + INLINE $203C,$0000,$0010,$A800; +PROCEDURE Comp3to1(inBuffer: Ptr;outBuffer: Ptr;cnt: LONGINT;inState: Ptr; + outState: Ptr;numChannels: LONGINT;whichChannel: LONGINT); + INLINE $203C,$0004,$0010,$A800; +PROCEDURE Exp1to3(inBuffer: Ptr;outBuffer: Ptr;cnt: LONGINT;inState: Ptr; + outState: Ptr;numChannels: LONGINT;whichChannel: LONGINT); + INLINE $203C,$0008,$0010,$A800; +PROCEDURE Comp6to1(inBuffer: Ptr;outBuffer: Ptr;cnt: LONGINT;inState: Ptr; + outState: Ptr;numChannels: LONGINT;whichChannel: LONGINT); + INLINE $203C,$000C,$0010,$A800; +PROCEDURE Exp1to6(inBuffer: Ptr;outBuffer: Ptr;cnt: LONGINT;inState: Ptr; + outState: Ptr;numChannels: LONGINT;whichChannel: LONGINT); + INLINE $203C,$0010,$0010,$A800; + + +{$ENDC} { UsingSound } + +{$IFC NOT UsingIncludes} + END. +{$ENDC} + diff --git a/Interfaces/PInterfaces/Sound.p.idump b/Interfaces/PInterfaces/Sound.p.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Interfaces/PInterfaces/Sound.p.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Interfaces/RIncludes/Types.r b/Interfaces/RIncludes/Types.r index 63cc128..804b744 100644 --- a/Interfaces/RIncludes/Types.r +++ b/Interfaces/RIncludes/Types.r @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted : replaced new 'actb' with old, and old with older + Referred to the MPW 3.2 version of this file (1990, E.T.O. #4) + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: Types.r @@ -148,23 +156,15 @@ type 'acur' { #ifdef oldTemp /*--------------------------actb • Alert Color old Lookup Table--------------------------*/ type 'actb' { - unsigned hex longint = 0; /* ctSeed */ - integer = 0; /* ctFlags */ + unsigned hex longint; /* ctSeed */ + integer; /* ctFlags */ integer = $$Countof(ColorSpec) - 1; /* ctSize */ wide array ColorSpec { integer wContentColor, /* value */ wFrameColor, wTextColor, wHiliteColor, - wTitleBarColor, - wHiliteLight, - wHiliteDark, - wTitleBarLight, - wTitleBarDark, - wDialogLight, - wDialogDark, - wTingeLight, - wTingeDark; + wTitleBarColor; unsigned integer; /* RGB: red */ unsigned integer; /* green */ unsigned integer; /* blue */ @@ -174,7 +174,7 @@ type 'acur' { /*----------------------------actb • Alert Color Lookup Table----------------------------*/ type 'actb' { unsigned hex longint = 0; /* ctSeed */ - integer = 1; /* ctFlags */ + integer = 0; /* ctFlags */ integer = $$Countof(ColorSpec) - 1; /* ctSize */ wide array ColorSpec { integer wContentColor, /* value */ diff --git a/Internal/Asm/AppleDeskBusPriv.a b/Internal/Asm/AppleDeskBusPriv.a index 716b0bd..eaaab4f 100644 --- a/Internal/Asm/AppleDeskBusPriv.a +++ b/Internal/Asm/AppleDeskBusPriv.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by uncommenting talkCmd and listenCmd +; 9/2/94 SuperMario ROM source dump (header preserved below) +; +; Clean diff against SuperMario +; + ; ; File: AppleDeskBusPriv.a ; @@ -48,8 +57,8 @@ __INCLUDINGAPPLEDESKBUSPRIV__ SET 1 maskADBCmd EQU $0C ; Mask for ADB command resetCmd EQU $00 ; Command for Bus Reset -; rb talkCmd EQU $0C ; Command for Talk R0 -; rb listenCmd EQU $08 ; Command for Listen R0 +talkCmd EQU $0C ; Command for Talk R0 ex +listenCmd EQU $08 ; Command for Listen R0 ex kbdAddr EQU $02 ; keyboard type device mouseAddr EQU $03 ; mouse type device numFDBAdr EQU 16 ; number of avaiblae FDB address diff --git a/Internal/Asm/CommToolboxPriv.a b/Internal/Asm/CommToolboxPriv.a index 673d9a2..5b5664a 100644 --- a/Internal/Asm/CommToolboxPriv.a +++ b/Internal/Asm/CommToolboxPriv.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted , slimming CTBBlock back down +; 9/2/94 SuperMario ROM source dump (header preserved below) +; +; Clean diff against SuperMario +; + ; ; File: CommToolboxPriv.a ; @@ -260,7 +269,7 @@ private DS.W 1 ; INTEGER; appList DS.L 1 ; CRMAppRecPtr; resFiles DS.L 1 ; ResFileRecHdl; toolResChain DS.L 1 ; ResourceMapHandle; -CommToolBoxTable DS.L 1 ; ptr to table + ; ex secret DS.L 16 ; LONGINT CTBBlockSize EQU * ENDR diff --git a/Internal/Asm/Decompression.a b/Internal/Asm/Decompression.a index b3185be..6d4a088 100644 --- a/Internal/Asm/Decompression.a +++ b/Internal/Asm/Decompression.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored the misspelt 'signiture' that was corrected by <19> +; 9/2/94 SuperMario ROM source dump (header preserved below) +; +; Clean diff against SuperMario +; + ; ; File: Decompression.a ; @@ -195,6 +204,7 @@ maxReplacement EQU 6 ;end of substitution list. ; ;--------------------------------------------------------------------------------- ExtendedResource Record 0 +signiture ; signature DS.L 1 ;used for robustness. Tells if data is compressed now. headerLength DS.W 1 ;length of this header in bytes. headerVersion DS.B 1 ;number of items in this header. ( must be < 128 ). diff --git a/Internal/Asm/DecompressorPatchEqu.a b/Internal/Asm/DecompressorPatchEqu.a new file mode 100644 index 0000000..8da21f2 --- /dev/null +++ b/Internal/Asm/DecompressorPatchEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'Decompression.a' diff --git a/Internal/Asm/DecompressorPatchEqu.a.idump b/Internal/Asm/DecompressorPatchEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Internal/Asm/DecompressorPatchEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Internal/Asm/HardwarePrivateEqu.a b/Internal/Asm/HardwarePrivateEqu.a index f5eed4a..db1d4d4 100644 --- a/Internal/Asm/HardwarePrivateEqu.a +++ b/Internal/Asm/HardwarePrivateEqu.a @@ -1,3 +1,16 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored the machine-specific equates for Plus/SE/Portable/"Universal +; 16-bit", which required some of the default equates to be +; conditionalised for onMac32 ("Universal 32-bit") to prevent double- +; defines. Restored vBufD equate for SE. Reconstructed some of the +; "private sound defines" that moved to the lost SoundPrivate.a. +; Commented out a small number of newer equates that conflict with other +; files. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ;__________________________________________________________________________________________________ ; ; File: HardwarePrivateEqu.a @@ -218,6 +231,25 @@ __INCLUDINGHARDWAREPRIVATEEQU__ SET 1 +; Assume onMac32 unless one of the old machines is defined + IF (&TYPE('onMac') = 'UNDEFINED') THEN + onMac: EQU 0 + ENDIF + IF (&TYPE('onMacPP') = 'UNDEFINED') THEN + onMacPP: EQU 0 + ENDIF + IF (&TYPE('onHcMac') = 'UNDEFINED') THEN + onHcMac: EQU 0 + ENDIF + IF (&TYPE('onMac16') = 'UNDEFINED') THEN + onMac16: EQU 0 + ENDIF + IF (&TYPE('onMac32') = 'UNDEFINED') THEN + onMac32: EQU NOT (onMac OR onMacPP OR onHcMac OR onMac16) + ENDIF + + + ;__________________________________________________________________________________________ ; ; Welcome to the New Hardware Equates File. By following some simple procedures this file @@ -432,6 +464,34 @@ sDTIME EQU $140 sTEST equ $180 +;--------------------------------------------------- +; Apple Sound Chip register offsets ex +;--------------------------------------------------- + +ascVersion EQU $800 ; [byte] +ascMode EQU $801 ; [byte] 2 means waveform +ascChipControl EQU $802 ; [byte] +ascFifoControl EQU $803 ; [byte] +ascFifoInt EQU $804 ; [byte] +ascWaveOneShot EQU $805 ; [byte] +ascVolControl EQU $806 ; [byte] +ascClockRate EQU $807 ; [byte] +ascPlayRecA EQU $80a ; [byte] +ascPlayRecB EQU $80b ; [byte] +ascTestReg EQU $80f ; [byte] + +bmSrcTimeIncrA EQU $f04 ; [byte] +bmSrcTimeIncrB EQU $f24 ; [byte] +bmLeftScaleA EQU $f06 ; [byte] +bmLeftScaleB EQU $f26 ; [byte] +bmRightScaleA EQU $f07 ; [byte] +bmRightScaleB EQU $f27 ; [byte] +bmFifoControlA EQU $f08 ; [byte] +bmFifoControlB EQU $f28 ; [byte] +bmIntControlA EQU $f09 ; [byte] +bmIntControlB EQU $f29 ; [byte] + + ;__________________________________________________________________________________________ ; ; @@ -651,7 +711,9 @@ vPCR EQU $1800 ; PERIPH. CONTROL REG. vIFR EQU $1A00 ; INT. FLAG REG. vIER EQU $1C00 ; INT. ENABLE REG. vBufA EQU $1E00 ; BUFFER A + IF onMac32 THEN ; Prevent double-define below vBufD EQU vBufA ; disk head select is buffer A <3.5> + ENDIF ; ;--------------------------------------------------- ; VIA IFR/IER bits @@ -673,7 +735,9 @@ ifIRQ EQU 7 ; any interrupt vSound EQU $7 ; sound volume bits (0..2) (output) + IF onMac32 THEN ; Prevent double-define below vTestJ EQU 0 ; Burn In Test jumper (input) + ENDIF ; vCpuId0 EQU 1 ; CPU Identification bit 0 (input) vCpuId1 EQU 2 ; CPU Identification bit 1 (input) @@ -2235,20 +2299,28 @@ MEMCRefresh EQU MEMCconfig+4 ; DRAM refresh rate register ; Interrupt Masks ;--------------------------------------------------- + IF onMac32 THEN ; Prevent double-define below hiIntMask EQU $0700 ; programmer switch only + ENDIF ; pwrOffEnbl EQU $2500 ; mask to allow poweroff interrupts + IF onMac32 THEN ; Prevent double-define below sccIntMask EQU $0400 ; SCC interrupt level sccEnblMask EQU $FBFF ; mask to enable SCC interrupts + ENDIF ; slotIntMask EQU $0200 ; slot's interrupt level <1.9> + IF onMac32 THEN ; Prevent double-define below viaIntMask EQU $0100 ; VIA1 interrupt level loIntMask EQU $0100 + ENDIF ; ;--------------------------------------------------- ; Hardware Base Addresses ;--------------------------------------------------- + IF onMac32 THEN ; Prevent double-define below WrOffs EQU 0 ; SCSI write addrs are same as read base + ENDIF ; MskIOP1 EQU 1 ; IOP 1 (SWIM) is level 1 interrupt MskVIA1 EQU 1 ; VIA 1 is level 1 MskADB EQU 1 ; ADB is level 1 @@ -2336,23 +2408,30 @@ CACR_WA_030 EQU 13 ; bit # of write allocate enable on 030s + IF onMac32 THEN ; Prevent double-define below Machine EQU 7 ; new Machine number for patches <18> + ENDIF ; ;--------------------------------------------------- ; System Software Information ;--------------------------------------------------- + IF onMac32 THEN ; Prevent double-define below numOsTrap EQU 256 ; number of os traps ToolTable EQU $0E00 ; start of toolbox trap table numTbTrap EQU 1024 ; number of toolbox traps numTrapMask EQU numTbTrap-1 ; mask for number of tb traps + ENDIF ; JMemMgr24 EQU $1E00 ; jump vector start for 24 bit Memory Manager JMemMgr32 EQU $1F00 ; jump vector start for 32 bit Memory Manager + IF onMac32 THEN ; Prevent double-define below HeapStart EQU $2800 ; Low mem is now 10k bytes defSysHeap EQU $18000 ; Default size of the system heap nDfltStackSize EQU $6000 ; Default stack size + ENDIF ; **** maybe not so temporary to allow things to build **** <3.5> + IF onMac32 THEN ; Prevent double-define below oneSecConst EQU 8 ; gets converted to $80000 for onesec constant<3.5> IF BlackBirdDebug THEN ROMStart EQU $40000000 ; ••PN BlackBirdstarting address of final ROM code <3.5> @@ -2362,13 +2441,15 @@ ROMStart EQU $40800000 ; starting address of final ROM code <3.5> snd2MemTop EQU $300 ; SoundLow to Memtop pwm2MemTop EQU $2FF ; PWMBuffer to MemTop bufWorldSize EQU 8192 ; total size of the BufPtr world + ENDIF ; ;--------------------------------------------------- rb, start ; Sound parameters +; Commented out because they conflict with TextEditPriv.a ;--------------------------------------------------- -sampleSize equ 4 ; number of bytes per sample -bufferSize equ 960 ; number of samples per buffer -sampleRate equ 24 * 1024 ; 24KHz sample rate +;sampleSize equ 4 ; number of bytes per sample +;bufferSize equ 960 ; number of samples per buffer +;sampleRate equ 24 * 1024 ; 24KHz sample rate ;--------------------------------------------------------------------- ; Whitney Sound Register Offsets (from ASC base in UniversalTables.a) @@ -2718,7 +2799,11 @@ pdspSet equ 7 ; "0" clears, "1" sets for any bit field [0:6] containing a ; ??? ;--------------------------------------------------- + IF onMac OR onMacPP THEN ; Work around this definition being moved up here +seRegs EQU $3FFC80 ; + ELSE ; seRegs EQU $0C30 ; offset to Sys Error Regs w/o Overlay + ENDIF ; ;--------------------------------------------------- ; Hardware configuration bits. @@ -2932,16 +3017,16 @@ PrattSysStatReg EQU $50080007 btst.b #PrattFlashLBit,PrattSysStatReg ; Is this a flash rom system ENDM -ForAmusementOnly equ 0 - If ForAmusementOnly then ;__________________________________________________________________________________________ ; ; ; Old 16 bit Equates for onMac, onMacPP, and onHcMac +; Removed forAmusementOnly conditional, and restored onMac etc ; ; ;__________________________________________________________________________________________ + IF onMac THEN ; ;=======================================; ; Macintosh Plus Hardware Information ; ;=======================================; @@ -3063,8 +3148,10 @@ halfSec EQU onesec/2 ; *** patch only *** stlDelay EQU $30 ; default bus settle delay *** patch only *** ROMDoEject EQU $40001E ; jump to DoEject utility *** patch only *** dACKRd EQU $200 ; offset of psuedo-DMA - READ *** patch only *** + ENDIF ; onMac + IF onMacPP THEN ; ;=======================================; ; Macintosh SE Hardware Information ; ;=======================================; @@ -3102,6 +3189,7 @@ vAInit EQU (1)|\ ; sound volume level initially 1 (1< restored ; === VIA1 BUFFER B === @@ -3182,8 +3270,10 @@ HeapStart EQU $1600 ; Aladdin starting point defSysHeap EQU $18000 ; Default size of the system heap nDfltStackSize EQU $2000 ; Default stack size + ENDIF ; onMacPP + IF onHcMac THEN ; ;===========================================; ; Macintosh Portable Hardware Information ; ;===========================================; @@ -3299,8 +3389,10 @@ numTrapMask EQU numTbTrap-1 ; mask for number of tb traps HeapStart EQU $1E00 ; Portable starting point <1.2> DefSysHeap EQU $18000 ; Default size of the system heap NDfltStackSize EQU $2000 ; Default stack size + ENDIF ; onHcMac + IF onMac16 THEN ; ;===================================================; ; Universal 16 bit Macintosh Hardware Information ; ;===================================================; @@ -3365,11 +3457,10 @@ numTrapMask EQU numTbTrap-1 ; mask for number of tb traps HeapStart EQU $1E00 ; Laguna starting point <1.2> DefSysHeap EQU $18000 ; Default size of the system heap NDfltStackSize EQU $2000 ; Default stack size + ENDIF ; onMac16 - ENDIF ; ForAmusementOnly - HardwarePrivate EQU 1 ENDIF ; __INCLUDINGHARDWAREPRIVATEEQU__ diff --git a/Internal/Asm/InternalOnlyEqu.a b/Internal/Asm/InternalOnlyEqu.a index 7fce49c..7dfa1ae 100644 --- a/Internal/Asm/InternalOnlyEqu.a +++ b/Internal/Asm/InternalOnlyEqu.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Added superseded boxFlag equates for code compatibility. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: InternalOnlyEqu.a ; @@ -645,6 +652,7 @@ boxQuadra700 EQU 16 ; Spike (25MHz 040) boxClassicII EQU 17 ; Apollo boxPowerBook100 EQU 18 ; Asahi (Its a Sony!) Portable <2> boxPowerBook140 EQU 19 ; TimLC 16 Mhz Tim; no FPU +boxZydeco EQU 20 ; code-compatibility equate boxQuadra950 EQU 20 ; a Mac Quadra 950 (33MHz 040, 5 slots+PDS, VIA1&2, Orwell MCA, 2 IOPs, SCSI 2*53c96) boxLCIII EQU 21 ; Vail (25 MHz, 030, optional FPU, 1 PDS, Sonora) boxSoftmacSUN EQU 22 ; Softmac on Sun, (recycled, was boxCarnation33) diff --git a/Internal/Asm/ROMPrivateEqu.a b/Internal/Asm/ROMPrivateEqu.a new file mode 100644 index 0000000..c7fd3ac --- /dev/null +++ b/Internal/Asm/ROMPrivateEqu.a @@ -0,0 +1,5 @@ +; +; Shim to point source to a compatible include file +; + + INCLUDE 'PowerPrivEqu.a' diff --git a/Internal/Asm/ROMPrivateEqu.a.idump b/Internal/Asm/ROMPrivateEqu.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Internal/Asm/ROMPrivateEqu.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Internal/Asm/SysPrivateEqu.a b/Internal/Asm/SysPrivateEqu.a index 0259fed..0a9d2e6 100644 --- a/Internal/Asm/SysPrivateEqu.a +++ b/Internal/Asm/SysPrivateEqu.a @@ -1,3 +1,14 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted ExpandMem to <66> (version $128, size $1F4) by moving the +; "size" equate. By leaving newer fields in the record after "size", we +; keep newer code building. Restored emNumer and emDenom as removed by +; <84>. Restored emFFSwapMMUMode, which was repurposed to +; emButtonIntGlobals by (and not used anywhere). +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: SysPrivateEqu.a ; @@ -336,7 +347,9 @@ emItlSysCachePtr ds.l 1 ; pointer to system itl cache <7><20> emScriptMapPtr ds.l 1 ; pointer to script mapping/sorting data <8> emLangMapPtr ds.l 1 ; pointer to language mapping/sorting data <8> +emNumer ; Resurrect the field below... ds.l 1 ; was emNumer (obsolete), now unused <11><84> +emDenom ; Resurrect the field below... ds.l 1 ; was emDenom (obsolete), now unused <11><84> emIconCluts ds.l 1 ; Ptr to global icon info <13> emScriptAppGlobals ds.l 1 ; Handle to application-specific script globals <16><20><21> @@ -388,6 +401,7 @@ emPrintingGlobals ds.l 1 ; Tsunami Printing Manager non-swapped printing gl emCursorGlobals ds.l 1 ; Ptr to CursorDev globals <46> +emFFSwapMMUMode ; Resurrect the field below... emButtonIntGlobals ds.l 1 ; Ptr to Button Interrupt globals. previously Ptr to "real" SwapMMUMode routine CSS emAppleTalkInactiveOnBoot ds.w 1 ; True if AppleTalk was inactive on boot <48> @@ -398,6 +412,9 @@ emLowMemoryPrintingGlobals ds.l 1 ; Handle to globals used by LowMemoryPrinti emNetBootGlobals ds.l 1 ; Handle to globals used by emNetBootGlobals for Network Booting and Appletalk stuff. <65> +emRecSize equ * ; size for this version +size equ * + emFndrDeskRgn ds.l 1 ; Handle to region maintained by Bungee Finder if fndrDeskRgnTracking is true <67> <69> emFndrDeskRgnTracking ds.w 1 ; If true, the Bungee Finder will keep an up-to-date region handle in fndrDeskRgn of the icons on the desktop <67> <69> @@ -440,10 +457,7 @@ jSWModemSoundVector ds.l 1 ; Vector to control routine for software modem s ; (currently {CInternal}ExpandMemPriv.h is the one) ; Be sure to update the Reality sources when you change this file (and the version number) -emCurVersion EQU $0133 ; version - -emRecSize equ * ; size for this version -size equ * +emCurVersion EQU $0128 ; version ENDR diff --git a/Internal/Asm/egretequ.a b/Internal/Asm/egretequ.a index e5ce0b6..044c20e 100644 --- a/Internal/Asm/egretequ.a +++ b/Internal/Asm/egretequ.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted MaxPseudoCmd to disregard the new Egret commands from and +; later. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + Eject ************************************************************************ ; EGRET Manager Equates @@ -273,7 +281,7 @@ EnDisPDM equ $21 ; Enable/Disable PowerDown Message RdWrIIC equ $22 ; Read or Write IIC (I sqared C) [rbm]<3> WakeUpMode equ $23 ; Enable/Disable WakeUpMode TimerTickle equ $24 ; ShutDown Timer Tickle -MaxPseudoCmd equ TimerTickle ; largest possible pseudo command number +MaxPseudoCmd equ EnDisPDM ; largest possible pseudo command number ; ;__________________________________________________________________________________________________ diff --git a/Make/ForceRomBindOrder.a b/Make/ForceRomBindOrder.a new file mode 100644 index 0000000..43eeb7a --- /dev/null +++ b/Make/ForceRomBindOrder.a @@ -0,0 +1,653 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Generated using information extracted from the System file +; + + INCLUDE 'LinkedPatchMacros.a' + +; This proc is included in the input of LinkPatch to force a known-good order on +; the RomBind table. This was needed to get round-tripping working, because +; LinkPatch orders this table as ROM$*$ strings appear in object file dictionary +; records. The proc itself is not included in the final binary. + +ForceRomBindOrder PROC ENTRY + CASE ON + + dcROM ROMVCBLOOP ; entry $000, lpch 1 (Plus) + dcROM AFTERGETBLOCKINGETBMBLK ; entry $001, lpch 1 (Plus) + dcROM AFTERGETBMBLKINREADBM ; entry $002, lpch 1 (Plus) + dcROM AFTERSECTRECTINCALLCONTROL ; entry $003, lpch 1 (Plus) + dcROM ROMNOTRGN ; entry $004, lpch 1 (Plus) + dcROM ROMNOTFR ; entry $005, lpch 1 (Plus) + dcROM PLUSSETHSIZE ; entry $006, lpch 1 (Plus) + dcROM PLUSPUTRGNDONE ; entry $007, lpch 1 (Plus) + dcROM PLUSNOTRECT ; entry $008, lpch 1 (Plus) + dcROM ROMFROMHBLOCK ; entry $009, lpch 1 (Plus) + dcROM ROMFROMRELOCREL ; entry $00a, lpch 1 (Plus) + dcROM ROMFROMCOMPACT ; entry $00b, lpch 1 (Plus) + dcROM ROMFROMPURGEHEAP ; entry $00c, lpch 1 (Plus) + dcROM ROMFROMMAKEPTR ; entry $00d, lpch 1 (Plus) + dcROM ROMBACKMPS ; entry $00e, lpch 1 (Plus) + dcROM ROMFROMCGZ ; entry $00f, lpch 1 (Plus) + dcROM ROMFROMBCS ; entry $010, lpch 1 (Plus) + dcROM GETMAXLOADAFTERPRELOCK ; entry $011, lpch 1 (Plus) + dcROM SIZEFITS ; entry $012, lpch 1 (Plus) + dcROM GETMAXLOAD@4 ; entry $013, lpch 1 (Plus) + dcROM AFTERMAXBLOCKINGETMAXLOAD ; entry $014, lpch 1 (Plus) + dcROM AFTERDISPOSEHANDLEINUPDATERESFILE ; entry $015, lpch 1 (Plus) + dcROM AFTERNEWHANDLEINUPDATERESFILE ; entry $016, lpch 1 (Plus) + dcROM AFTERBSRREADDATAINNEWMAP ; entry $017, lpch 1 (Plus) + dcROM AFTERREADINRDDATA ; entry $018, lpch 1 (Plus) + dcROM DONEGNE ; entry $019, lpch 1 (Plus) + dcROM AFTERBTOPENINACCESSBT ; entry $01a, lpch 3 (Plus,SE) + dcROM AFTER2NDACCESSBTINMOUNTVOL ; entry $01b, lpch 3 (Plus,SE) + dcROM MTCHECK ; entry $01c, lpch 3 (Plus,SE) + dcROM AFTERREADBMINUPDATEFREE ; entry $01d, lpch 3 (Plus,SE) + dcROM AFTERUPDATEFREEINMTCHECK ; entry $01e, lpch 3 (Plus,SE) + dcROM ROMCOLORMAP ; entry $01f, lpch 3 (Plus,SE) + dcROM ROMRSECT ; entry $020, lpch 3 (Plus,SE) + dcROM ROMTRIMRECT ; entry $021, lpch 3 (Plus,SE) + dcROM ROMSHIELDCURSOR ; entry $022, lpch 3 (Plus,SE) + dcROM ROMINITRGN ; entry $023, lpch 3 (Plus,SE) + dcROM ROMXORSLAB ; entry $024, lpch 3 (Plus,SE) + dcROM ROMFASTSLABMODE ; entry $025, lpch 3 (Plus,SE) + dcROM ROMSLABMODE ; entry $026, lpch 3 (Plus,SE) + dcROM ROMPATEXPAND ; entry $027, lpch 3 (Plus,SE) + dcROM ROMSEEKMASK ; entry $028, lpch 3 (Plus,SE) + dcROM ROMMASKTAB ; entry $029, lpch 3 (Plus,SE) + dcROM ROMDRAWSLAB ; entry $02a, lpch 3 (Plus,SE) + dcROM ROMDRAWRECT ; entry $02b, lpch 3 (Plus,SE) + dcROM ROMFRPOLY ; entry $02c, lpch 3 (Plus,SE) + dcROM ROMPUSHVERB ; entry $02d, lpch 3 (Plus,SE) + dcROM AFTERRELEASERESOURCEINGETNEWCONTROL ; entry $02e, lpch 3 (Plus,SE) + dcROM AFTERRELEASERESOURCEINGETNEWWINDOW ; entry $02f, lpch 3 (Plus,SE) + dcROM FLUSHAPPLVBLS ; entry $030, lpch 3 (Plus,SE) + dcROM ROMDONEINSERT ; entry $031, lpch 4 (II) + dcROM ROMCALLMBARPROC ; entry $032, lpch 4 (II) + dcROM ROMGETA1LIST ; entry $033, lpch 4 (II) + dcROM ROMIIGETHINDEX ; entry $034, lpch 4 (II) + dcROM ROMIIGETHA0LIST ; entry $035, lpch 4 (II) + dcROM ROMGETINDEX ; entry $036, lpch 4 (II) + dcROM ROMIIGETA0LIST ; entry $037, lpch 4 (II) + dcROM SETITEMPROPERTY ; entry $038, lpch 4 (II) + dcROM GETITEMPROPERTY ; entry $039, lpch 4 (II) + dcROM ROMFINDPARENTEND ; entry $03a, lpch 4 (II) + dcROM AFTERSYSERRINMENUKEY ; entry $03b, lpch 4 (II) + dcROM AFTERSYSERRININITMENUS ; entry $03c, lpch 4 (II) + dcROM MKEYDONE ; entry $03d, lpch 4 (II) + dcROM HMINMENUKEY ; entry $03e, lpch 4 (II) + dcROM ROMHLNONE ; entry $03f, lpch 4 (II) + dcROM TURNINDEXOFF ; entry $040, lpch 4 (II) + dcROM RESTOREALLBITS ; entry $041, lpch 4 (II) + dcROM FLASHFEEDBACK ; entry $042, lpch 4 (II) + dcROM GETITEMRECORD ; entry $043, lpch 4 (II) + dcROM GETMENUPTR ; entry $044, lpch 4 (II) + dcROM CHOOSEITEM ; entry $045, lpch 4 (II) + dcROM RESETRECTSCROLLDATA ; entry $046, lpch 4 (II) + dcROM MENUCHANGED ; entry $047, lpch 4 (II) + dcROM CALLMBARPROC ; entry $048, lpch 4 (II) + dcROM SETTICKCOUNTERS ; entry $049, lpch 4 (II) + dcROM DONECHECKDRAG ; entry $04a, lpch 4 (II) + dcROM RESTORESOMEBITS ; entry $04b, lpch 4 (II) + dcROM DRAWTHEMENU ; entry $04c, lpch 4 (II) + dcROM CALLDRAWMDEF ; entry $04d, lpch 4 (II) + dcROM ROMNULLMDEFPROC ; entry $04e, lpch 4 (II) + dcROM DIRTYMENUSIZE ; entry $04f, lpch 4 (II) + dcROM GETHA0LIST ; entry $050, lpch 4 (II) + dcROM GOTRMENU ; entry $051, lpch 4 (II) + dcROM TWOBYTEXIT ; entry $052, lpch 4 (II) + dcROM FOUNDRMENU ; entry $053, lpch 4 (II) + dcROM GETINDEX ; entry $054, lpch 4 (II) + dcROM FOUNDHMENU ; entry $055, lpch 4 (II) + dcROM GETHINDEX ; entry $056, lpch 4 (II) + dcROM AFTERSECTRECTINCALLDRAWMDEF ; entry $057, lpch 4 (II) + dcROM RTSINDRAWTHEMENU ; entry $058, lpch 4 (II) + dcROM ROMINSERTTHEITEM ; entry $059, lpch 4 (II) + dcROM ROMIIGETITEMRECORD ; entry $05a, lpch 4 (II) + dcROM ROMJUMPINTOINSERTTHEITEM ; entry $05b, lpch 4 (II) + dcROM ROMDODELENABLEBIT ; entry $05c, lpch 4 (II) + dcROM ROMSKIPDELENABLEBIT ; entry $05d, lpch 4 (II) + dcROM TENBYTEXIT ; entry $05e, lpch 4 (II) + dcROM CLOSEITEM ; entry $05f, lpch 4 (II) + dcROM SPECIALCHAR ; entry $060, lpch 4 (II) + dcROM ROMFINDCENTRY ; entry $061, lpch 4 (II) + dcROM ROMMENUCTBLSANITYCHK ; entry $062, lpch 4 (II) + dcROM AFTERLOADRESOURCEINGETTHEMPROC ; entry $063, lpch 4 (II) + dcROM AFTERRESTORESETPORTINDRAWITEM ; entry $064, lpch 4 (II) + dcROM AFTERGETAUXWININCLOSEDIALOG ; entry $065, lpch 4 (II) + dcROM ATNODITLINCLOSEDIALOG ; entry $066, lpch 4 (II) + dcROM AFTERDETACHRESOURCEINDOCOLOR ; entry $067, lpch 4 (II) + dcROM AFTERSETWINCOLORINGOTSTORAGE ; entry $068, lpch 4 (II) + dcROM AFTERFIXDIVINCHAREXTRA ; entry $069, lpch 4 (II) + dcROM AFTERSTACKSPACEINRGNOP ; entry $06a, lpch 4 (II) + dcROM AFTERBUFFERSIZECALCINRGNOP ; entry $06b, lpch 4 (II) + dcROM AFTERGETKEYSINGETPINMOUSE ; entry $06c, lpch 4 (II) + dcROM AFTERMOVEGWKEYMAPINGETPINMOUSE ; entry $06d, lpch 4 (II) + dcROM AFTERHILITEWINDOWINDOACTIVATE ; entry $06e, lpch 4 (II) + dcROM ROMINITADBDRVR ; entry $06f, lpch 6 (SE,II) + dcROM KBDDRVR ; entry $070, lpch 6 (SE,II) + dcROM FINDFDBINFO ; entry $071, lpch 6 (SE,II) + dcROM GEMPTYADDR ; entry $072, lpch 6 (SE,II) + dcROM TRYSYSEVENT ; entry $073, lpch 6 (SE,II) + dcROM FROMWAITFORDSK ; entry $074, lpch 7 (Plus,SE,II) + dcROM AFTERLOADRESOURCEINCALLCONTROL ; entry $075, lpch 7 (Plus,SE,II) + dcROM AFTERDISPOSEHANDLEINCLOSEDIALOG ; entry $076, lpch 7 (Plus,SE,II) + dcROM AFTERVALIDRECTINSETITEXT ; entry $077, lpch 7 (Plus,SE,II) + dcROM AFTERBSRDOCOMPACTINGOCONT ; entry $078, lpch 7 (Plus,SE,II) + dcROM COMPACTMEM ; entry $079, lpch 7 (Plus,SE,II) + dcROM MOVEREST ; entry $07a, lpch 7 (Plus,SE,II) + dcROM FILLSTKBUF ; entry $07b, lpch 7 (Plus,SE,II) + dcROM DOCOMPACT ; entry $07c, lpch 7 (Plus,SE,II) + dcROM FINDRGNTOP ; entry $07d, lpch 7 (Plus,SE,II) + dcROM MNSFINISH ; entry $07e, lpch 7 (Plus,SE,II) + dcROM CKDRVNUM ; entry $07f, lpch 7 (Plus,SE,II) + dcROM SEEK ; entry $080, lpch 7 (Plus,SE,II) + dcROM AFTERLOADRESOURCEINCALLWINDOW ; entry $081, lpch 7 (Plus,SE,II) + dcROM ROMSTDPOLYRTN ; entry $082, lpch 8 (Portable) + dcROM ROMSTDPOLYNOTPIC ; entry $083, lpch 8 (Portable) + dcROM SOMESLEEPPROC ; entry $084, lpch 8 (Portable) + dcROM ALLCLOSE ; entry $085, lpch 8 (Portable) + dcROM INITSCSI ; entry $086, lpch 8 (Portable) + dcROM KBDRESET ; entry $087, lpch 8 (Portable) + dcROM DOQUEUE ; entry $088, lpch 8 (Portable) + dcROM GETDRIVE ; entry $089, lpch 8 (Portable) + dcROM INVALTRKCACHE ; entry $08a, lpch 8 (Portable) + dcROM SETCHIPMODE ; entry $08b, lpch 8 (Portable) + dcROM ADRANDSTRB ; entry $08c, lpch 8 (Portable) + dcROM RECALSLOW ; entry $08d, lpch 8 (Portable) + dcROM ADRANDSENSE ; entry $08e, lpch 8 (Portable) + dcROM PULSE ; entry $08f, lpch 8 (Portable) + dcROM WAIT100 ; entry $090, lpch 8 (Portable) + dcROM ROMStdRgnRtn ; entry $091, lpch 10 (SE,Portable) + dcROM ROMStdRgnNotPic ; entry $092, lpch 10 (SE,Portable) + dcROM ROMTrimRect ; entry $093, lpch 11 (Plus,SE,Portable) + dcROM ROMRSect ; entry $094, lpch 11 (Plus,SE,Portable) + dcROM ROMDPUTPICBYTE ; entry $095, lpch 11 (Plus,SE,Portable) + dcROM ROMPUTPICRGN ; entry $096, lpch 11 (Plus,SE,Portable) + dcROM ROMXRGNBLT ; entry $097, lpch 11 (Plus,SE,Portable) + dcROM ROMSETUPSTRETCH ; entry $098, lpch 11 (Plus,SE,Portable) + dcROM ROMBACKTOROM ; entry $099, lpch 11 (Plus,SE,Portable) + dcROM ROMPUTPICDATA ; entry $09a, lpch 11 (Plus,SE,Portable) + dcROM ROMPUTPICWORD ; entry $09b, lpch 11 (Plus,SE,Portable) + dcROM ROMPUTPICLONG ; entry $09c, lpch 11 (Plus,SE,Portable) + dcROM ROMPUTPICBYTE ; entry $09d, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDBITSNOTPIC ; entry $09e, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDBITSOK ; entry $09f, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDBITSSTART2 ; entry $0a0, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDRECTRTN ; entry $0a1, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDRECTNOTPIC ; entry $0a2, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDLINERTN ; entry $0a3, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDLINENOTPIC ; entry $0a4, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDRRECTRTN ; entry $0a5, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDRRECTNOTPIC ; entry $0a6, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDOVALRTN ; entry $0a7, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDOVALNOTPIC ; entry $0a8, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDARCRTN ; entry $0a9, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDARCNOTPIC ; entry $0aa, lpch 11 (Plus,SE,Portable) + dcROM ROMSTDCOMMENT ; entry $0ab, lpch 11 (Plus,SE,Portable) + dcROM ROMEQUALRGN ; entry $0ac, lpch 11 (Plus,SE,Portable) + dcROM ROMCOPYRGN ; entry $0ad, lpch 11 (Plus,SE,Portable) + dcROM OPENPICTPTCHENTRY ; entry $0ae, lpch 11 (Plus,SE,Portable) + dcROM OPENPICTDONE ; entry $0af, lpch 11 (Plus,SE,Portable) + dcROM CLOSEPICTPTCHENTRYNEW ; entry $0b0, lpch 11 (Plus,SE,Portable) + dcROM CLOSEPICTGOHOME ; entry $0b1, lpch 11 (Plus,SE,Portable) + dcROM ROMSHOWCRSR ; entry $0b2, lpch 11 (Plus,SE,Portable) + dcROM ROMSEEDFILL ; entry $0b3, lpch 11 (Plus,SE,Portable) + dcROM ROMGOHOME ; entry $0b4, lpch 11 (Plus,SE,Portable) + dcROM ROMXCLIP ; entry $0b5, lpch 11 (Plus,SE,Portable) + dcROM ROMXCLIP2 ; entry $0b6, lpch 11 (Plus,SE,Portable) + dcROM ROMXPNSIZE ; entry $0b7, lpch 11 (Plus,SE,Portable) + dcROM OVALEND ; entry $0b8, lpch 11 (Plus,SE,Portable) + dcROM XORIGIN ; entry $0b9, lpch 11 (Plus,SE,Portable) + dcROM ROMLNOK ; entry $0ba, lpch 11 (Plus,SE,Portable) + dcROM ROMTEXTOP ; entry $0bb, lpch 11 (Plus,SE,Portable) + dcROM ROMRECTOP ; entry $0bc, lpch 11 (Plus,SE,Portable) + dcROM ROMRRECTOP ; entry $0bd, lpch 11 (Plus,SE,Portable) + dcROM ROMOVALOP ; entry $0be, lpch 11 (Plus,SE,Portable) + dcROM ROMARCOP ; entry $0bf, lpch 11 (Plus,SE,Portable) + dcROM ROMPOLYOP ; entry $0c0, lpch 11 (Plus,SE,Portable) + dcROM ROMRGNOP ; entry $0c1, lpch 11 (Plus,SE,Portable) + dcROM ROMBITS ; entry $0c2, lpch 11 (Plus,SE,Portable) + dcROM ROMCOMMENTOP ; entry $0c3, lpch 11 (Plus,SE,Portable) + dcROM ROMLONGCOM ; entry $0c4, lpch 11 (Plus,SE,Portable) + dcROM ROMGETRECT ; entry $0c5, lpch 11 (Plus,SE,Portable) + dcROM ROMKILL1 ; entry $0c6, lpch 11 (Plus,SE,Portable) + dcROM ROMABORT ; entry $0c7, lpch 11 (Plus,SE,Portable) + dcROM ROMDONE ; entry $0c8, lpch 11 (Plus,SE,Portable) + dcROM AFTERTEAUTOVIEWINSETNEWEDIT ; entry $0c9, lpch 11 (Plus,SE,Portable) + dcROM AFTERLOADRESOURCEINSYSTEMCLICK ; entry $0ca, lpch 15 (Plus,SE,II,Portable) + dcROM RWPOWERUP ; entry $0cb, lpch 15 (Plus,SE,II,Portable) + dcROM BACKTOGETCSTRING ; entry $0cc, lpch 16 (IIci) + dcROM THEDONELABEL ; entry $0cd, lpch 16 (IIci) + dcROM ROM@GETSELWRAP ; entry $0ce, lpch 16 (IIci) + dcROM ROM@FINDLINEFINIS ; entry $0cf, lpch 16 (IIci) + dcROM ROMINFINDLINE ; entry $0d0, lpch 16 (IIci) + dcROM ROM@SETUP ; entry $0d1, lpch 16 (IIci) + dcROM ROMGETCURSTYLE ; entry $0d2, lpch 16 (IIci) + dcROM ROMSETSTYLE ; entry $0d3, lpch 16 (IIci) + dcROM ROMTEHITTESTHOOK ; entry $0d4, lpch 16 (IIci) + dcROM ROMPIXEL2CHAR ; entry $0d5, lpch 16 (IIci) + dcROM ROMFINDWORD ; entry $0d6, lpch 16 (IIci) + dcROM ROMTEEOLHOOK ; entry $0d7, lpch 16 (IIci) + dcROM ROMANYNULLSTYLE ; entry $0d8, lpch 16 (IIci) + dcROM ROMGETSTYLE ; entry $0d9, lpch 16 (IIci) + dcROM ROMSETRSRVED ; entry $0da, lpch 16 (IIci) + dcROM ROM@DONEINKEYBD2FONT ; entry $0db, lpch 16 (IIci) + dcROM ROMGETDIRECTION ; entry $0dc, lpch 16 (IIci) + dcROM ROM@FIXSTACK ; entry $0dd, lpch 16 (IIci) + dcROM ROM@USEC2P ; entry $0de, lpch 16 (IIci) + dcROM ROMDOUBLEBYTE ; entry $0df, lpch 16 (IIci) + dcROM ROMDEFWORDBRK ; entry $0e0, lpch 16 (IIci) + dcROM ENDTEINIT ; entry $0e1, lpch 16 (IIci) + dcROM ROM@NOMORESTYLES ; entry $0e2, lpch 16 (IIci) + dcROM ROM@BAILTOLEFT ; entry $0e3, lpch 16 (IIci) + dcROM ROMAFTER@HITIT ; entry $0e4, lpch 16 (IIci) + dcROM ROMFINDDONE ; entry $0e5, lpch 16 (IIci) + dcROM ROMTEDRAWHOOK ; entry $0e6, lpch 16 (IIci) + dcROM ROMFREEFMTORDERARRAY ; entry $0e7, lpch 16 (IIci) + dcROM ROMINDOHILITE ; entry $0e8, lpch 16 (IIci) + dcROM ROMPREAMBLE ; entry $0e9, lpch 16 (IIci) + dcROM ROMPTRTOLINE ; entry $0ea, lpch 16 (IIci) + dcROM ROMNEXTLINERECT ; entry $0eb, lpch 16 (IIci) + dcROM ROMPREPLINE ; entry $0ec, lpch 16 (IIci) + dcROM ROMINVERTHOOK ; entry $0ed, lpch 16 (IIci) + dcROM ROMTESTLINEENDS ; entry $0ee, lpch 16 (IIci) + dcROM ROMSETRUN ; entry $0ef, lpch 16 (IIci) + dcROM ROMENDTEFMTORDER ; entry $0f0, lpch 16 (IIci) + dcROM ROMGETFORMATORDERING ; entry $0f1, lpch 16 (IIci) + dcROM ROMGETLRPOSITION ; entry $0f2, lpch 16 (IIci) + dcROM ROM@DONE ; entry $0f3, lpch 16 (IIci) + dcROM BACKTODOMEASURE ; entry $0f4, lpch 16 (IIci) + dcROM ROM@MEASUREDONE ; entry $0f5, lpch 16 (IIci) + dcROM ROMINMEASUREIT ; entry $0f6, lpch 16 (IIci) + dcROM ROM@PLAINMEASURE ; entry $0f7, lpch 16 (IIci) + dcROM ROMMEASUREWIDTH ; entry $0f8, lpch 16 (IIci) + dcROM ROMTEHILITETEXT ; entry $0f9, lpch 16 (IIci) + dcROM ROM@TESTENDS ; entry $0fa, lpch 16 (IIci) + dcROM BACKTOTESTRUNDIRECTION ; entry $0fb, lpch 16 (IIci) + dcROM ROMFINDLINEHITE ; entry $0fc, lpch 16 (IIci) + dcROM ROMSELVIEW ; entry $0fd, lpch 16 (IIci) + dcROM ROMDRAWCARET ; entry $0fe, lpch 16 (IIci) + dcROM ROMSTDEXIT ; entry $0ff, lpch 16 (IIci) + dcROM ROMALTSETRSRVED ; entry $100, lpch 16 (IIci) + dcROM ROMDELETESTYLE ; entry $101, lpch 16 (IIci) + dcROM ROMCONCATSTYLES ; entry $102, lpch 16 (IIci) + dcROM ENDDELGUTS ; entry $103, lpch 16 (IIci) + dcROM OldPBSoundClose ; entry $104, lpch 16 (IIci) + dcROM OldPBSoundStatus ; entry $105, lpch 16 (IIci) + dcROM ROMEPILOG4 ; entry $106, lpch 16 (IIci) + dcROM ROMSETSTYLSCRAP ; entry $107, lpch 16 (IIci) + dcROM ROMSTDEXIT2 ; entry $108, lpch 16 (IIci) + dcROM ROMTESTYLINSERT ; entry $109, lpch 16 (IIci) + dcROM OldPBSoundControl ; entry $10a, lpch 16 (IIci) + dcROM OldPBSoundPrime ; entry $10b, lpch 16 (IIci) + dcROM OldPBSoundOpen ; entry $10c, lpch 16 (IIci) + dcROM ROMPSTSTYLGUTS ; entry $10d, lpch 16 (IIci) + dcROM ROMCONCATRUNS ; entry $10e, lpch 16 (IIci) + dcROM ROMRECALDRAW ; entry $10f, lpch 16 (IIci) + dcROM ROMINTEDISPATCH ; entry $110, lpch 16 (IIci) + dcROM ROMINTEGETTEXT ; entry $111, lpch 16 (IIci) + dcROM ROMINTESETTEXT ; entry $112, lpch 16 (IIci) + dcROM ROMINTECALTEXT ; entry $113, lpch 16 (IIci) + dcROM ROMINTECOPY ; entry $114, lpch 16 (IIci) + dcROM ROMINTECUT ; entry $115, lpch 16 (IIci) + dcROM ROM@GOHOME ; entry $116, lpch 16 (IIci) + dcROM ROMINTEPASTE ; entry $117, lpch 16 (IIci) + dcROM ROMAFTERINSERT ; entry $118, lpch 16 (IIci) + dcROM ROMMUNGESETUP ; entry $119, lpch 16 (IIci) + dcROM ROMINSRSRVED ; entry $11a, lpch 16 (IIci) + dcROM ROMINTESETJUST ; entry $11b, lpch 16 (IIci) + dcROM ROMGETLINEHITES ; entry $11c, lpch 16 (IIci) + dcROM ROMINTESELVIEW ; entry $11d, lpch 16 (IIci) + dcROM ROMINTEAUTOVIEW ; entry $11e, lpch 16 (IIci) + dcROM ROM@KEYBDOK ; entry $11f, lpch 16 (IIci) + dcROM ROMEPILOG8 ; entry $120, lpch 16 (IIci) + dcROM ROMDRAWIT ; entry $121, lpch 16 (IIci) + dcROM ROMCLEANUPSEL ; entry $122, lpch 16 (IIci) + dcROM ROM@NOSYNCHINSETSELECT ; entry $123, lpch 16 (IIci) + dcROM ROMCLEARRSRVED ; entry $124, lpch 16 (IIci) + dcROM ROMHILITE ; entry $125, lpch 16 (IIci) + dcROM ROMHIDECARET ; entry $126, lpch 16 (IIci) + dcROM ROMCLICKEXPAND ; entry $127, lpch 16 (IIci) + dcROM ROMDOTEXT ; entry $128, lpch 16 (IIci) + dcROM ROMSHOWCARET ; entry $129, lpch 16 (IIci) + dcROM ROMADDRTABLE ; entry $12a, lpch 16 (IIci) + dcROM ROMSELSORT ; entry $12b, lpch 16 (IIci) + dcROM ROMTEFEATUREFLAG ; entry $12c, lpch 16 (IIci) + dcROM ROMTEGETPOINT ; entry $12d, lpch 16 (IIci) + dcROM ROMTESETSTYLE ; entry $12e, lpch 16 (IIci) + dcROM ROMGETHITE ; entry $12f, lpch 16 (IIci) + dcROM ROMGETLINE ; entry $130, lpch 16 (IIci) + dcROM ROMLINERECT ; entry $131, lpch 16 (IIci) + dcROM ROMINTEGETPOINT ; entry $132, lpch 16 (IIci) + dcROM ROM@DOENDOFLINE ; entry $133, lpch 16 (IIci) + dcROM ROM@DOTHEJUSTTHING ; entry $134, lpch 16 (IIci) + dcROM ROMPASTEGUTS ; entry $135, lpch 16 (IIci) + dcROM ROM@MOREROOM ; entry $136, lpch 16 (IIci) + dcROM ROMINGETHANDLE ; entry $137, lpch 16 (IIci) + dcROM ROMONECURSOR ; entry $138, lpch 16 (IIci) + dcROM ROM@LINEEND ; entry $139, lpch 16 (IIci) + dcROM ROM@INRLMIDDLE ; entry $13a, lpch 16 (IIci) + dcROM ROM@RLDONE ; entry $13b, lpch 16 (IIci) + dcROM ROMINSETUP2RECTANGLES ; entry $13c, lpch 16 (IIci) + dcROM ROMFIXFORMATEND ; entry $13d, lpch 16 (IIci) + dcROM ROMMEASUREIT ; entry $13e, lpch 16 (IIci) + dcROM ROM@ROMANTRIM ; entry $13f, lpch 16 (IIci) + dcROM ROMGETNUMSTYLES ; entry $140, lpch 16 (IIci) + dcROM ROM@ZEROWIDTH ; entry $141, lpch 16 (IIci) + dcROM ROM@GOERASE ; entry $142, lpch 16 (IIci) + dcROM ROM@JUSTMEASURE ; entry $143, lpch 16 (IIci) + dcROM ROM@HILITEOFFSETRUN ; entry $144, lpch 16 (IIci) + dcROM ROM@EXIT ; entry $145, lpch 16 (IIci) + dcROM ROM@HILITERUN ; entry $146, lpch 16 (IIci) + dcROM ROMHILITELINEENDS ; entry $147, lpch 16 (IIci) + dcROM ROMXEOLHOOK ; entry $148, lpch 16 (IIci) + dcROM ROMXDRAWHOOK ; entry $149, lpch 16 (IIci) + dcROM ROMGETSIZE ; entry $14a, lpch 16 (IIci) + dcROM ROMSETDIRECTION ; entry $14b, lpch 16 (IIci) + dcROM ROMINTENEW ; entry $14c, lpch 16 (IIci) + dcROM ROMMYNEWHANDLE ; entry $14d, lpch 16 (IIci) + dcROM ROMGETDEFSTYLE ; entry $14e, lpch 16 (IIci) + dcROM ROMINTESTYLNEW ; entry $14f, lpch 16 (IIci) + dcROM ROMFINDLINE ; entry $150, lpch 16 (IIci) + dcROM ROMSTAGE2Y ; entry $151, lpch 16 (IIci) + dcROM ROMSTAGE2A ; entry $152, lpch 16 (IIci) + dcROM ROMCLRLINESTS ; entry $153, lpch 16 (IIci) + dcROM ROMINPTTOLINE ; entry $154, lpch 16 (IIci) + dcROM ROMINDOFIND ; entry $155, lpch 16 (IIci) + dcROM ROMINPINDISPLAY ; entry $156, lpch 16 (IIci) + dcROM ROMINREFRESH ; entry $157, lpch 16 (IIci) + dcROM RONINTEXTBOX ; entry $158, lpch 16 (IIci) + dcROM ROMAFTERGETFINFOINTEXTBOX ; entry $159, lpch 16 (IIci) + dcROM AFTERMOVETOINTEXTBOX ; entry $15a, lpch 16 (IIci) + dcROM ROMGO14EXIT ; entry $15b, lpch 16 (IIci) + dcROM ROMAFTERGETFINFOINGETSIZE ; entry $15c, lpch 16 (IIci) + dcROM ROMINTEDISPOSE ; entry $15d, lpch 16 (IIci) + dcROM AFTERHILITETEXT ; entry $15e, lpch 16 (IIci) + dcROM CHECKDESKHOOK ; entry $15f, lpch 16 (IIci) + dcROM DONESCLICK ; entry $160, lpch 16 (IIci) + dcROM SYSTEMCLICKCONTINUE ; entry $161, lpch 16 (IIci) + dcROM AFTERSETRETRYFLAGINMMHPROLOGUE ; entry $162, lpch 16 (IIci) + dcROM ROMBACKTORESRVMEM24 ; entry $163, lpch 16 (IIci) + dcROM ROMBACKTONEWPTR24 ; entry $164, lpch 16 (IIci) + dcROM ROMBACKTOMOREMASTERS24 ; entry $165, lpch 16 (IIci) + dcROM ROMBACKTOA24HMAKEMOREMASTERS ; entry $166, lpch 16 (IIci) + dcROM ROMA24ACTUALS ; entry $167, lpch 16 (IIci) + dcROM ROMA24GROWZONE ; entry $168, lpch 16 (IIci) + dcROM ROMA24PURGEBLOCK ; entry $169, lpch 16 (IIci) + dcROM ROMSUBTRACTFREE ; entry $16a, lpch 16 (IIci) + dcROM ROMA24ALLOCBK ; entry $16b, lpch 16 (IIci) + dcROM ROMA24GETSIZE ; entry $16c, lpch 16 (IIci) + dcROM ROMHBLOCKMOVE ; entry $16d, lpch 16 (IIci) + dcROM ROMRELEASEMP ; entry $16e, lpch 16 (IIci) + dcROM ROMADJUSTFREE ; entry $16f, lpch 16 (IIci) + dcROM ROMBACKTORESRVMEM32 ; entry $170, lpch 16 (IIci) + dcROM ROMBACKTONEWPTR32 ; entry $171, lpch 16 (IIci) + dcROM ROMBACKTOMOREMASTERS32 ; entry $172, lpch 16 (IIci) + dcROM ROMBACKTOA32HMAKEMOREMASTERS ; entry $173, lpch 16 (IIci) + dcROM ROMA32ACTUALS ; entry $174, lpch 16 (IIci) + dcROM ROMA32GROWZONE ; entry $175, lpch 16 (IIci) + dcROM ROMA32PURGEBLOCK ; entry $176, lpch 16 (IIci) + dcROM ROMA32ALLOCBK ; entry $177, lpch 16 (IIci) + dcROM ROMA32GETSIZE ; entry $178, lpch 16 (IIci) + dcROM SLPQINSTALL ; entry $179, lpch 16 (IIci) + dcROM SLPQREMOVE ; entry $17a, lpch 16 (IIci) + dcROM ROMCHECKAPPLETALK ; entry $17b, lpch 16 (IIci) + dcROM CLOSEAPPLETALK ; entry $17c, lpch 16 (IIci) + dcROM DIDQUEUE ; entry $17d, lpch 16 (IIci) + dcROM SETSUPERVISORMODE ; entry $17e, lpch 16 (IIci) + dcROM BATINTCONT ; entry $17f, lpch 16 (IIci) + dcROM ROMPMGROP ; entry $180, lpch 16 (IIci) + dcROM AFTERFIRSTDISPOSED0 ; entry $181, lpch 16 (IIci) + dcROM AFTERSECONDDISPOSED0 ; entry $182, lpch 16 (IIci) + dcROM AFTEROPENCPORTINNEWGWORLD ; entry $183, lpch 16 (IIci) + dcROM FROMPUTPICPIXPAT ; entry $184, lpch 16 (IIci) + dcROM FROMPUTPMDATA ; entry $185, lpch 16 (IIci) + dcROM AFTERGETSCREENBASEINCOPYBITS ; entry $186, lpch 16 (IIci) + dcROM AFTERCOPYBITSCALLSITSELFTOFLATTEN ; entry $187, lpch 16 (IIci) + dcROM FROMNEWTEMPSCREENBUFFER ; entry $188, lpch 16 (IIci) + dcROM FROMNEWGWORLD ; entry $189, lpch 16 (IIci) + dcROM NEWTEMPSCREENBUFFERPARAMERROR ; entry $18a, lpch 16 (IIci) + dcROM NEWGWORLDPARAMERROR ; entry $18b, lpch 16 (IIci) + dcROM CICLOSEPORTENTRY ; entry $18c, lpch 16 (IIci) + dcROM CIOPENPIXMAP ; entry $18d, lpch 16 (IIci) + dcROM CIINITPIXMAP ; entry $18e, lpch 16 (IIci) + dcROM AFTEROSEVENTAVAILINCHECKACTIVATE ; entry $18f, lpch 16 (IIci) + dcROM AFTERSYSTEMUSERWINDOWINCHECKACTIVATE ; entry $190, lpch 16 (IIci) + dcROM ROMINTERNALRAMDISKSTRING ; entry $191, lpch 16 (IIci) + dcROM CheckPic ; entry $192, lpch 20 (II,IIci) + dcROM PutPicWord ; entry $193, lpch 20 (II,IIci) + dcROM PutPicLong ; entry $194, lpch 20 (II,IIci) + dcROM DPutPicOp ; entry $195, lpch 20 (II,IIci) + dcROM DPutPicByte ; entry $196, lpch 20 (II,IIci) + dcROM PutPicData ; entry $197, lpch 20 (II,IIci) + dcROM GETCVARIANTINCALLCONTROL ; entry $198, lpch 20 (II,IIci) + dcROM OWNERPORTINROM ; entry $199, lpch 20 (II,IIci) + dcROM AFTERDRAGTHERGNINDRAGCONTROL ; entry $19a, lpch 20 (II,IIci) + dcROM AFTERFRAMERECTINFASTPAINT ; entry $19b, lpch 20 (II,IIci) + dcROM AFTERSETCTLCOLORINNEWCONTROL ; entry $19c, lpch 20 (II,IIci) + dcROM AFTERPLOTCICONINDOALERT ; entry $19d, lpch 20 (II,IIci) + dcROM BEGININWIND ; entry $19e, lpch 20 (II,IIci) + dcROM SETUPTEXT ; entry $19f, lpch 20 (II,IIci) + dcROM RESTORETE ; entry $1a0, lpch 20 (II,IIci) + dcROM ENDINWIND ; entry $1a1, lpch 20 (II,IIci) + dcROM DIALOGSTDEXIT ; entry $1a2, lpch 20 (II,IIci) + dcROM AFTERGETRESOURCEINDOCOLOR ; entry $1a3, lpch 20 (II,IIci) + dcROM AFTERPAINTONEINSETWINCOLOR ; entry $1a4, lpch 20 (II,IIci) + dcROM SETGUTSINROM ; entry $1a5, lpch 20 (II,IIci) + dcROM SETCTLCOLORAFTERSETGUTS ; entry $1a6, lpch 20 (II,IIci) + dcROM SETENDINROM ; entry $1a7, lpch 20 (II,IIci) + dcROM AFTERUNIONRGNINSETWTITLE ; entry $1a8, lpch 20 (II,IIci) + dcROM AFTERPAINTONEINSETDESKCPAT ; entry $1a9, lpch 20 (II,IIci) + dcROM OPENSLOTS ; entry $1aa, lpch 20 (II,IIci) + dcROM SYNCCALLRTN2 ; entry $1ab, lpch 22 (SE,II,IIci) + dcROM FMTTRKRET2 ; entry $1ac, lpch 22 (SE,II,IIci) + dcROM EMPTYPD2 ; entry $1ad, lpch 22 (SE,II,IIci) + dcROM AFTERFREEZETIMEINRMVTIME ; entry $1ae, lpch 24 (Portable,IIci) + dcROM MULTANDMERGE ; entry $1af, lpch 24 (Portable,IIci) + dcROM AFTERFREEZETIMEINPRIMETIME ; entry $1b0, lpch 24 (Portable,IIci) + dcROM AFTERFREEZETIMEINTIMER2INT ; entry $1b1, lpch 24 (Portable,IIci) + dcROM AFTERNMTASKINSYSTEMTASK ; entry $1b2, lpch 24 (Portable,IIci) + dcROM AFTERLOADRESOURCEINCALLMDEFPROC ; entry $1b3, lpch 24 (Portable,IIci) + dcROM AFTERCALLTOMDEFINCALLMDEFPROC ; entry $1b4, lpch 24 (Portable,IIci) + dcROM PMGRRECV ; entry $1b5, lpch 24 (Portable,IIci) + dcROM PMGRSEND ; entry $1b6, lpch 24 (Portable,IIci) + dcROM GETLEVEL ; entry $1b7, lpch 24 (Portable,IIci) + dcROM REMOVEMSG ; entry $1b8, lpch 24 (Portable,IIci) + dcROM INSTALLMSG ; entry $1b9, lpch 24 (Portable,IIci) + dcROM FROMDRAWARC ; entry $1ba, lpch 27 (Plus,SE,Portable,IIci) + dcROM ROMGETA0LIST ; entry $1bb, lpch 28 (II,Portable,IIci) + dcROM ROMGETMENUPTR ; entry $1bc, lpch 28 (II,Portable,IIci) + dcROM ROMGETITEMRECORD ; entry $1bd, lpch 28 (II,Portable,IIci) + dcROM ROMUPCHAR ; entry $1be, lpch 28 (II,Portable,IIci) + dcROM ROMGOTMKEY ; entry $1bf, lpch 28 (II,Portable,IIci) + dcROM ROMKEYNOTFOUND ; entry $1c0, lpch 28 (II,Portable,IIci) + dcROM ROMGETHA0LIST ; entry $1c1, lpch 28 (II,Portable,IIci) + dcROM ROMGETHINDEX ; entry $1c2, lpch 28 (II,Portable,IIci) + dcROM AFTERUPRSTRINGINUPCHAR ; entry $1c3, lpch 28 (II,Portable,IIci) + dcROM ClearASCInt ; entry $1c4, lpch 28 (II,Portable,IIci) + dcROM DisableASCInts ; entry $1c5, lpch 28 (II,Portable,IIci) + dcROM EnableASCInts ; entry $1c6, lpch 28 (II,Portable,IIci) + dcROM SEEKCK ; entry $1c7, lpch 30 (SE,II,Portable,IIci) + dcROM INITADBDRVR ; entry $1c8, lpch 30 (SE,II,Portable,IIci) + dcROM ALLOCFAKERGNS ; entry $1c9, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SCSILOAD ; entry $1ca, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FLUSHVFILES ; entry $1cb, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCACHERDIP ; entry $1cc, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCHKNODE ; entry $1cd, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMLOCREC ; entry $1ce, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBUILDKEY ; entry $1cf, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMFSQUEUE ; entry $1d0, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMDTRMV3 ; entry $1d1, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMEXTOFFLINCK ; entry $1d2, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCMDDONE ; entry $1d3, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTDELETE ; entry $1d4, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMLOCCNODE ; entry $1d5, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTUPDATE ; entry $1d6, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMUPDVCNTS ; entry $1d7, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMMARKVCB ; entry $1d8, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCMFLUSH ; entry $1d9, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTINSERT ; entry $1da, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMLOCCREC ; entry $1db, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMUPDRTCNTS ; entry $1dc, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMUPDCNAME ; entry $1dd, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGT1STFCB ; entry $1de, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGTNXTFCB ; entry $1df, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMFSQUEUESYNC ; entry $1e0, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCKFILMOD ; entry $1e1, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMTFSVCBTST ; entry $1e2, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCHGMFLLOCK ; entry $1e3, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCMUPDATECN ; entry $1e4, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSYSERRORINDSHOOK ; entry $1e5, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DSEXIT ; entry $1e6, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DTRMV2 ; entry $1e7, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERVOLCHECKINRENAME ; entry $1e8, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM RNMVOL1 ; entry $1e9, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCVFLGS ; entry $1ea, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM RNMVOL@70 ; entry $1eb, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMDTRMV1 ; entry $1ec, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM CMRENAMECN ; entry $1ed, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMGETCNINRENAME ; entry $1ee, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMPOPCNAME ; entry $1ef, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMSETUPINCMCREATECN ; entry $1f0, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMSETUPINCMUPDATECN ; entry $1f1, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMSETUPINCMDELETECN ; entry $1f2, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMSETUPINCMMOVECN ; entry $1f3, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMSETUPINCMRENAMECN ; entry $1f4, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCMRENAMECNINRENAME ; entry $1f5, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FOPEN1 ; entry $1f6, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMFINDDRIVE ; entry $1f7, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM MARKVCBDIRTY ; entry $1f8, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FLUSHMDB ; entry $1f9, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM OLDMTVOLAFTERFSQUEUE ; entry $1fa, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCKEXTFS ; entry $1fb, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM EJECTIT ; entry $1fc, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM OFFLINEEJECTCALLSMFSFLUSH ; entry $1fd, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM OFFLINEEJECTCALLSFLUSHBUFFERS ; entry $1fe, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FLUNMNTAFTERMFSCHECK ; entry $1ff, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FLUNMNTCALLSFLUSHBUFFERS ; entry $200, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FCLOSE ; entry $201, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DSPOSVBLKS ; entry $202, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DSPOSVCB ; entry $203, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTGETRECORD ; entry $204, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTSEARCH ; entry $205, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMXFFLUSH ; entry $206, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGT1STWDCB ; entry $207, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMFNDFILNAME ; entry $208, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGTNXTWDCB ; entry $209, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMFILLWDCB ; entry $20a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMFLUSHCACHE ; entry $20b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGT1STMATCH ; entry $20c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGTNXTMATCH ; entry $20d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERTRUNCATEFILE ; entry $20e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMPUSHCNAME ; entry $20f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMLOCBTCB ; entry $210, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMROTATELT ; entry $211, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMSPLITLT ; entry $212, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMUPDDREC ; entry $213, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCMGETCN ; entry $214, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMINITNODE ; entry $215, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBUILDIREC ; entry $216, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGETMAXKEY ; entry $217, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMINSERTREC ; entry $218, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTSETUP ; entry $219, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMTREESEARCH ; entry $21a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMDELETEREC ; entry $21b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGETLTSIB ; entry $21c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGETRTSIB ; entry $21d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMLOCTPR ; entry $21e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGETRECA ; entry $21f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMUPDIKEY ; entry $220, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCMSETUP ; entry $221, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMCLRNODE ; entry $222, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMBTCLEANUP ; entry $223, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM MTVOLOK ; entry $224, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FIXPTSTDENTRY ; entry $225, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ATLABEL2INFIXATAN ; entry $226, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM GOTSTVISINSETCTITLE ; entry $227, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSETHANDLESIZEINSETCTITLE ; entry $228, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ERASECONTROLINDISPOSECONTROL ; entry $229, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERERASECONTROLINDISPOSECONTROL ; entry $22a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SYSEVTAFTERFRONTWINDOW ; entry $22b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SYSEVTDONESEVT ; entry $22c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SEARCHWINDOW ; entry $22d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERFRONTWINDOWINSYSTEMCLICK ; entry $22e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERTRACKGOAWAYINSYSTEMCLICK ; entry $22f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM CLAIMEVENT ; entry $230, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FRAMEOUT ; entry $231, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DIALOGSTDENTRY ; entry $232, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMINITDIALOGCONTINUE ; entry $233, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMISDIACLAIMEVENT ; entry $234, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ISDIAAFTERCLAIMEVENT ; entry $235, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ISDIANOTDLGEXIT ; entry $236, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DSAFTERCLAIMEVENT ; entry $237, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DSNOTMINEEXIT ; entry $238, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM TEKEYFROMEVENTAD ; entry $239, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERH2HINDOSTATIC ; entry $23a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMSKIPPARAM ; entry $23b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM STD1ENTRY ; entry $23c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM REFHANDLE ; entry $23d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM RRENTRY6 ; entry $23e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM RDDATA ; entry $23f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM RSTDEXIT ; entry $240, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM WRDATA ; entry $241, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SPACEAT ; entry $242, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SAVEREGS ; entry $243, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM CHECKGROWAT1 ; entry $244, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ADDNEWREFWITHOUTUPDATE ; entry $245, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ADDNAME ; entry $246, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM STDZENTRY ; entry $247, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSTDZENTRYINCREATERESFILE ; entry $248, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMOPENRFPERM ; entry $249, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCREATEINCREATERESFILE ; entry $24a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTEROPENRFINORFCOMMON ; entry $24b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSETEOFINCHECKGROW ; entry $24c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSETHANDLESIZEINRESIZEMAP ; entry $24d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERRESIZEMAPINRMVENAME ; entry $24e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM GETRSRCCNT ; entry $24f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AT9INRMVENAME ; entry $250, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DOPUTAPPENDMEM ; entry $251, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM PUTSCRAPEXIT ; entry $252, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM DOPUTAPPENDFILE ; entry $253, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SYNCCALLRTN ; entry $254, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FMTTRKRET ; entry $255, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM EMPTYPD ; entry $256, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERGETMOUSEINGETNEXTEVENT ; entry $257, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERGETRESOURCEINTRYFKEY ; entry $258, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTEROSEVENTAVAILINGETNEXTEVENT ; entry $259, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERGETOSEVENTINGETNEXTEVENT ; entry $25a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERKILLCONTROLSINCLOSEWINDOW ; entry $25b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSHOWHIDEINSHOWWINDOW ; entry $25c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FROMPAINTONE ; entry $25d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM TESTCLIP ; entry $25e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCLIPABOVE ; entry $25f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FROMDRAGWINDOW ; entry $260, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM CLIPGABOVE ; entry $261, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM NOBTF0 ; entry $262, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM STARTROMWMGR ; entry $263, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ENDROMWMGR ; entry $264, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FROMSELECTWINDOW ; entry $265, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM BTF1 ; entry $266, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM MAKEDEACTIVE ; entry $267, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM POSTDOACTIVATE ; entry $268, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM PRESKIPUNHILITE ; entry $269, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FROMBTF1 ; entry $26a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FROMGETNEWWIND ; entry $26b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM FROMGETADHNDL ; entry $26c, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM CALLWINDOW ; entry $26d, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM CALLWCALC ; entry $26e, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM INSERTWINDOW ; entry $26f, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM NODESKHOOK ; entry $270, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM IVALCOMMON ; entry $271, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERSECTRGNINGOPAINTONE ; entry $272, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SKIPERASEINROM ; entry $273, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ERASEINROM ; entry $274, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERPAINTBEHINDINDRAWNEW ; entry $275, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERPAINTBEHINDINSENDBEHIND ; entry $276, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERPAINTONEINMOVEWINDOW ; entry $277, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERPAINTONEINBRINGTOFRONT ; entry $278, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERPENMODEINDRAGTHERGN ; entry $279, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM AFTERCALCVBEHINDINSENDBEHIND ; entry $27a, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM ROMGETRSRCCNT ; entry $27b, lpch 31 (Plus,SE,II,Portable,IIci) + dcROM SWAPROMMAP ; entry $27c, lpch 31 (Plus,SE,II,Portable,IIci) diff --git a/Make/System.make b/Make/System.make new file mode 100644 index 0000000..80e9903 --- /dev/null +++ b/Make/System.make @@ -0,0 +1,551 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Written from scratch to replace missing makefile +# + +SysVersMajor = 7 # 0-99 +SysVersMinor = 1 # 0-9 +SysVersBugfix = 0 # 0-9 +SysVersStage = final # develop/alpha/beta/final=release (only first letter counted) +SysVersPre = 0 # 0-255 +LangInt = 0 # 0=US + +# Built-in Video Monitors (cdev) Extension for IIci and IIsi +VidExtVers = 1.0.1 + +# Directory variables for source code (trailing : essential) +BuildDir = {Sources}BuildResults:System: +ImageDir = {BuildDir}Image: +RsrcDir = {BuildDir}Rsrc: +LibDir = {BuildDir}Lib: +ObjDir = {BuildDir}Obj: +TextDir = {BuildDir}Text: +IfObjDir = {ObjDir}Interface: +MakeDir = {Sources}Make: +ResourceDir = {Sources}Resources: +DeclDir = {Sources}DeclData: +ToolDir = {Sources}Tools: +ToolSrcDir = {Sources}Tools:ToolSource: +MiscDir = {Sources}Misc: +TidbitsDir = {Sources}Tidbits: +DriverDir = {Sources}Drivers: +PatchDir = {Sources}Patches: +LinkPatchDir = {Sources}LinkedPatches: +ProcessMgrDir = {Sources}ProcessMgr: + +# Directory variables for Asm/C/Pascal/Rez headers +AIncludes = {Sources}Interfaces:AIncludes: +CIncludes = {Sources}Interfaces:CIncludes: +PInterfaces = {Sources}Interfaces:PInterfaces: +RIncludes = {Sources}Interfaces:RIncludes: +IntAIncludes = {Sources}Internal:Asm: +IntCIncludes = {Sources}Internal:C: +IntPInterfaces = {Sources}Internal:Pascal: +IntRIncludes = {Sources}Internal:Rez: +Libraries = {Sources}Libs:Libraries: +CLibraries = {Sources}Libs:CLibraries: +PLibraries = {Sources}Libs:PLibraries: + +# Resource and Rez files included by Sys.r into the System file +SystemResourceFiles = ∂ + {MiscDir}APTK57.rsrc ∂ + {MiscDir}SystemSounds.r ∂ + {MiscDir}VM.rsrc ∂ + {OSDir}Keyboard:Kbd.r ∂ + {RsrcDir}AliasMgr.rsrc ∂ + {RsrcDir}AppleEventMgr.rsrc ∂ + {RsrcDir}Backlight.rsrc ∂ + {RsrcDir}BalloonPack.a.rsrc ∂ + {RsrcDir}BeforePatches.a.rsrc ∂ + {RsrcDir}BootAlerts.a.rsrc ∂ + {RsrcDir}BootBlocks.a.rsrc ∂ + {RsrcDir}BootCode.a.rsrc ∂ + {RsrcDir}BuiltInVideoExtension.p.rsrc ∂ + {RsrcDir}ButtonCDEF.a.rsrc ∂ + {RsrcDir}Choose.p.rsrc ∂ + {RsrcDir}Choose.r.rsrc ∂ + {RsrcDir}ChooseHelp.r.rsrc ∂ + {RsrcDir}ColorPicker.p.rsrc ∂ + {RsrcDir}CommResourceMgr.c.rsrc ∂ + {RsrcDir}CommToolboxINIT.r.rsrc ∂ + {RsrcDir}CommToolboxLDEF.p.rsrc ∂ + {RsrcDir}CommToolboxUtilities.c.rsrc ∂ + {RsrcDir}ConnectionMgr.c.rsrc ∂ + {RsrcDir}DAHandler.rsrc ∂ + {RsrcDir}DeCompressDefProc.a.rsrc ∂ + {RsrcDir}DeCompressDefProc1.a.rsrc ∂ + {RsrcDir}DictionaryMgr.a.rsrc ∂ + {RsrcDir}DiskCache.a.rsrc ∂ + {RsrcDir}DiskInit.rsrc ∂ + {RsrcDir}DITL.p.rsrc ∂ + {RsrcDir}EditionMgr.rsrc ∂ + {RsrcDir}FileTransferMgr.c.rsrc ∂ + {RsrcDir}GenericIcons.rsrc ∂ + {RsrcDir}Gestalt.rsrc ∂ + {RsrcDir}GreggyBitsDefProc.a.rsrc ∂ + {RsrcDir}IconLDEF.a.rsrc ∂ + {RsrcDir}IconUtils.rsrc ∂ + {RsrcDir}International.rsrc ∂ + {RsrcDir}InternationalPACK.a.rsrc ∂ + {RsrcDir}itl4Roman.a.rsrc ∂ + {RsrcDir}KbdInstall.a.rsrc ∂ + {RsrcDir}LayerWDEF.c.rsrc ∂ + {RsrcDir}LinkedPatches.rsrc ∂ + {RsrcDir}LinkedPatchLoader.a.rsrc ∂ + {RsrcDir}ListMgrPACK.a.rsrc ∂ + {RsrcDir}MACE3.c.rsrc ∂ + {RsrcDir}MACE6.c.rsrc ∂ + {RsrcDir}Meter.c.rsrc ∂ + {RsrcDir}mNote.c.rsrc ∂ + {RsrcDir}mSamp.c.rsrc ∂ + {RsrcDir}mWave.c.rsrc ∂ + {RsrcDir}Note.c.rsrc ∂ + {RsrcDir}ParityINIT.a.rsrc ∂ + {RsrcDir}PartySamp.c.rsrc ∂ + {RsrcDir}PatchIIciROM.a.rsrc ∂ + {RsrcDir}PatchIIROM.a.rsrc ∂ + {RsrcDir}PatchPlusROM.a.rsrc ∂ + {RsrcDir}PatchPortableROM.a.rsrc ∂ + {RsrcDir}PatchSEROM.a.rsrc ∂ + {RsrcDir}PictButtonCDEF.a.rsrc ∂ + {RsrcDir}PictUtilities.rsrc ∂ + {RsrcDir}PictWhap.a.rsrc ∂ + {RsrcDir}PictWhapSound.rsrc ∂ + {RsrcDir}PopupCDEF.c.rsrc ∂ + {RsrcDir}PopupCDEFMDEF.a.rsrc ∂ + {RsrcDir}PopupTriangle.r.rsrc ∂ + {RsrcDir}PPCBrowser.a.rsrc ∂ + {RsrcDir}PreventSwitchLaunch.a.rsrc ∂ + {RsrcDir}PrintDriver.a.rsrc ∂ + {RsrcDir}QDciPatchROM.a.rsrc ∂ + {RsrcDir}QuickDrawPatchII.rsrc ∂ + {RsrcDir}RomanITL2.a.rsrc ∂ + {RsrcDir}RoundedWDEF.a.rsrc ∂ + {RsrcDir}ROvr.a.rsrc ∂ + {RsrcDir}Scheduler.rsrc ∂ + {RsrcDir}ScriptMgrExtensions.rsrc ∂ + {RsrcDir}ScriptMgrPatch.rsrc ∂ + {RsrcDir}ScriptMgrROMPatch.rsrc ∂ + {RsrcDir}ScrollBarCDEF.a.rsrc ∂ + {RsrcDir}SinDrvr.a.rsrc ∂ + {RsrcDir}SinHighLevel.rsrc ∂ + {RsrcDir}SnarfMan.a.rsrc ∂ + {RsrcDir}SnthLoading.rsrc ∂ + {RsrcDir}SoundInputProc.rsrc ∂ + {RsrcDir}SoundPFDProc.rsrc ∂ + {RsrcDir}StandardFile.rsrc ∂ + {RsrcDir}StandardMBDF.a.rsrc ∂ + {RsrcDir}StandardMDEF.a.rsrc ∂ + {RsrcDir}StandardNBP.p.rsrc ∂ + {RsrcDir}StandardNBP.r.rsrc ∂ + {RsrcDir}StandardNBPHelp.r.rsrc ∂ + {RsrcDir}StandardNBPLDEF.p.rsrc ∂ + {RsrcDir}StandardWDEF.a.rsrc ∂ + {RsrcDir}StartSystem.a.rsrc ∂ + {RsrcDir}SystemFonts.rsrc ∂ + {RsrcDir}TerminalClick.r.rsrc ∂ + {RsrcDir}TerminalMgr.c.rsrc ∂ + {RsrcDir}TextLDEF.a.rsrc ∂ + {RsrcDir}TFBDriver.a.rsrc ∂ + {RsrcDir}UserAlerts.a.rsrc ∂ + {RsrcDir}Wave.c.rsrc ∂ + {ToolBoxDir}ColorPicker:ColorPicker.r ∂ + {ToolBoxDir}ColorPicker:ColorPickerWedge.r ∂ + +# Object files that make up the (big) 'lpch' resources +LinkedPatchObjs = ∂ + {ObjDir}ForceRomBindOrder.a.o ∂ + {ObjDir}PatchProtector.a.o ∂ + {ObjDir}ProcessManagerSegmentTweaks.a.o ∂ + {ObjDir}PatchROMAlarmNotify.a.o ∂ + {ObjDir}GestaltExtensions.a.o ∂ + {ObjDir}ShutDownMgr.a.o ∂ + {ObjDir}HwPriv.a.o ∂ + {ObjDir}MMUPatches.a.o ∂ + {ObjDir}DispatchHelper.a.o ∂ + {ObjDir}VMPatches.a.o ∂ + {LibDir}TimeMgr.lib ∂ + {LibDir}AliasMgr.lib ∂ + {LibDir}SCSI.lib ∂ + {LibDir}HFS.lib ∂ + {LibDir}FontMgr.lib ∂ + {LibDir}BTreeMgr.lib ∂ + {LibDir}PPC.lib ∂ + {LibDir}NotificationMgr.lib ∂ + {LibDir}MenuMgr.lib ∂ + {ObjDir}MungerPatches.a.o ∂ + {LibDir}SlotMgr.lib ∂ + {ObjDir}TextEditPatch.a.o ∂ + {ObjDir}TextEditPatchIIciROM.a.o ∂ + {LibDir}SoundMgr.lib ∂ + {LibDir}IconUtils.lib ∂ + {ObjDir}ADBMgrPatch.a.o ∂ + {ObjDir}KbdPatches.a.o ∂ + {ObjDir}AllBWQDPatch.a.o ∂ + {ObjDir}CheckDevicesINIT.a.o ∂ + {LibDir}CommToolboxPatch.Lib ∂ + {LibDir}ControlMgr.lib ∂ + {ObjDir}DeskMgrPatches.a.o ∂ + {ObjDir}DeviceLoop.a.o ∂ + {LibDir}DialogMgr.lib ∂ + {ObjDir}GetMgrPatches.a.o ∂ + {ObjDir}LayerMgr.c.o ∂ + {ObjDir}MemoryMgrPatches.a.o ∂ + {ObjDir}MiscPatches.a.o ∂ + {LibDir}ModalDialogMenuPatches.lib ∂ + {ObjDir}Mouse.a.o ∂ + {ObjDir}OpenResFile.a.o ∂ + {ObjDir}PaletteMgrPatches.a.o ∂ + {ObjDir}PowerMgrPatches.a.o ∂ + {ObjDir}PrintGlue.a.o ∂ + {ObjDir}LowMemoryPrintingPatches.a.o ∂ + {ObjDir}QuickDrawPatches.a.o ∂ + {LibDir}ResourceMgr.lib ∂ + {ObjDir}SaveRestoreBits.a.o ∂ + {ObjDir}ScrapMgrPatches.a.o ∂ + {ObjDir}SegmentLoaderPatches.a.o ∂ + {ObjDir}SonyPatches.a.o ∂ + {LibDir}ComponentMgr.lib ∂ + {LibDir}ToolboxEventMgr.lib ∂ + {LibDir}WindowMgr.lib ∂ + {ObjDir}backlightpatch.a.o ∂ + {ObjDir}BrightnessPatches.a.o ∂ + {LibDir}HelpMgr.lib ∂ + {LibDir}TextServicesMgr.lib ∂ + {ObjDir}FontFolderExtension.a.o ∂ + {ObjDir}ResourceOverridePatches.a.o ∂ + {ObjDir}EDiskLocalNamePatch.a.o ∂ + {ObjDir}LateLoad.a.o ∂ + {CLibraries}StdCLib.o ∂ + {IfObjDir}interface.o ∂ + {Libraries}Runtime.o ∂ + {ObjDir}FinalInitialization.a.o ∂ + +# Conditional compilation booleans for Asm/C/Pascal/Rez +Conds = ∂ + BlackBirdDebug=FALSE ∂ + CubeE=TRUE ∂ + DBLite=FALSE ∂ + forADBKeyboards=TRUE ∂ + forPDMDebug=FALSE ∂ + forPDMProto=FALSE ∂ + forROM=FALSE ∂ + forRomulator=FALSE ∂ + forSmurf=FALSE ∂ + forSTPnop=FALSE ∂ + hasADBKeyLayouts=TRUE ∂ + hasAppleEventMgr=TRUE ∂ + hasAsyncSCSI=FALSE ∂ + hasBalloonHelp=TRUE ∂ + hasBitEdit=FALSE ∂ + hasCommToolbox=TRUE ∂ + hasDataAccessMgr=TRUE ∂ + hasDisplayMgrWindows=FALSE ∂ + hasEditionMgr=TRUE ∂ + hasEgret=FALSE ∂ + hasHMC=FALSE ∂ + hasJaws=FALSE ∂ + hasLayerlessApps=FALSE ∂ + hasManEject=FALSE ∂ + hasMMU=FALSE ∂ + hasMSC=FALSE ∂ + hasNiagra=FALSE ∂ + hasNonADBKeyLayouts=TRUE ∂ + hasPortableKeyLayouts=FALSE ∂ + hasPowerMgr=FALSE ∂ + hasPwrControls=TRUE ∂ + hasPwrMgrClock=TRUE ∂ + hasRISCV0ResMgrPatches=FALSE ∂ + hasSlotMgr=TRUE ∂ + hasSplineFonts=TRUE ∂ + IopADB=FALSE ∂ + NewBuildSystem=TRUE ∂ + nonSerializedIO=TRUE ∂ + padForOverPatch=FALSE ∂ + Pre70=FALSE ∂ + PwrMgrADB=TRUE ∂ + ROMFastTraps=FALSE ∂ + Supports24Bit=TRUE ∂ + SystemSevenOrLater=TRUE ∂ + SystemSixOrLater=TRUE ∂ + TheFuture=FALSE ∂ + ViaADB=TRUE ∂ + +# Stop newer MPW versions from using Symantec C +C = C + +# Housekeeping defs not to be overriden by the Build script +MAOpts = -d TRUE=1 -d FALSE=0 -d Alignment=4 -d CPU=20 -blksize 62 -w +MCOpts = -d TRUE=1 -d FALSE=0 -d Alignment=4 -d CPU=00 -b3 -mbg off +MPOpts = -mbg off -r -noload # -r suppresses bounds checks, -noload ignores dirty 'unit' resources + +# Build all targets if none is specified +All ƒ FeatureSet {BuildDir}System {BuildDir}ProcessMgrINIT + +# Shell vars and precompiled headers first (Build script will always specify FeatureSet) +FeatureSet ƒ RealFeatureSet {ObjDir}StandardEqu.d {ObjDir}ProcessMgrIncludes.D +RealFeatureSet ƒ + Set Exit 1 + Set StageChar `Echo {SysVersStage} | StreamEdit -d -e "/•r/ Pr 'f'; /•f/ Pr 'f'; /•b/ Pr 'b'; /•a/ Pr 'a'; /•d/ Pr 'd'"` + Set StageHex `Echo {SysVersStage} | StreamEdit -d -e "/•r/ Pr '0x80'; /•f/ Pr '0x80'; /•b/ Pr '0x60'; /•a/ Pr '0x40'; /•d/ Pr '0x20'"` + Set StageInt `Evaluate {StageHex}` + Set VersString `Echo {SysVersMajor}.{SysVersMinor}.{SysVersBugfix}{StageChar}{SysVersPre} | StreamEdit -e "/≈/ Rep /f0∞/ ''; Rep /(≈)®1.0/ ®1"` + Set VersInt `Evaluate 0x{SysVersMajor}{SysVersMinor}{SysVersBugfix}` + Set VersCommon "-d SysVers={VersInt} -d StageInt={StageInt} -d LangInt={LangInt}" + Set FeatureSet "`Echo {Conds} | StreamEdit -e "/≈/ Replace -c ∞ /([A-Za-z0-9]+=[A-Za-z0-9]+)®1/ '-d ' ®1"`" ; Export FeatureSet + Set Commands {ToolDir},{Commands} + Set ObjDir {ObjDir} ; Export ObjDir + Set RsrcDir {RsrcDir} ; Export RsrcDir + Set TextDir {TextDir} ; Export TextDir + Set MiscDir {MiscDir} ; Export MiscDir + Set TidbitsDir {TidbitsDir} ; Export TidbitsDir + Set AIncludes {AIncludes} + Set CIncludes {CIncludes} + Set PInterfaces {PInterfaces} + Set RIncludes {RIncludes} + Set Libraries {Libraries} + Set CLibraries {CLibraries} + Set PLibraries {PLibraries} + Set IntAIncludes {IntAIncludes} ; Export IntAIncludes + Set IntCIncludes {IntCIncludes} ; Export IntCIncludes + Set IntPInterfaces {IntPInterfaces} ; Export IntPInterfaces + Set IntRIncludes {IntRIncludes} ; Export IntRIncludes + Set StdAOpts "{MAOpts} {FeatureSet} -i {IntAIncludes} {AOpts} -i {ObjDir} {VersCommon} -d &SysVersion=∂∂'{VersString}∂∂'" + Set StdCOpts "{MCOpts} {FeatureSet} -i {IntCIncludes} {COpts} -n {VersCommon} -d SYS_VERSION=∂∂'{VersInt}∂∂'" + Set StdCPOpts "{MCPOpts} {FeatureSet} -i {IntCIncludes} {COpts} {VersCommon} -d SYS_VERSION=∂∂'{VersInt}∂∂'" + Set StdPOpts "{MPOpts} {FeatureSet} -i {IntPInterfaces} {POpts}" + Set StdROpts "{MROpts} {FeatureSet} -i {IntRIncludes} {ROpts} -i {RIncludes} {VersCommon} -d SysVersion=∂∂∂"{VersString}∂∂∂" -d LIntVers=0x{SysVersMajor},0x{SysVersMinor}{SysVersBugfix},{StageHex},`Evaluate -h {SysVersPre}`" + Set StdLOpts "-w {LOpts} -mf -t rsrc -c RSED -sg Main" + Set StdLibOpts "-w {LibOpts} -mf" + Set StdAlign "{Align}" + Set StdEquAOpts "-d StandardEquROMFastTraps=0 -d StandardEquSupports24Bit=1" # Compat with new conditionals in SuperMario headers + + +# For the Build script -- but easier just to trash BuildResults +Clean ƒ + Delete -i `Files -f -r -o -s {BuildDir}` ≥ Dev:Null + +# Make's default rules with XOpts replaced by StdXOpts (defined as a Shell variable above) +.a.o ƒ .a + {Asm} {StdAOpts} -o {Targ} {DepDir}{Default}.a + +.c.o ƒ .c + {C} {StdCOpts} -o {Targ} {DepDir}{Default}.c + +.p.o ƒ .p + {Pascal} {StdPOpts} -o {Targ} {DepDir}{Default}.p + +.cp.o ƒ .c + {CPlus} {StdCPOpts} -o {Targ} {DepDir}{Default}.cp + +# Bring in other variables and rules +# (MainCode.make is for ROM, but it brings in other stuff) +#include {DriverDir}Drivers.make +#include {MakeDir}MainCode.make +#include {DeclDir}DeclData.make +#include {ResourceDir}Resources.make +#include {ProcessMgrDir}ProcessMgr.make + + +######################################################################## +# Build tools +######################################################################## + +{RsrcDir}SysDF ƒ {ToolDir}SysDF.c {IfObjDir}Interface.o + C {COpts} -o {ObjDir}SysDF.c.o {ToolDir}SysDF.c + Link -o {Targ} -t 'MPST' -c 'MPS ' {ObjDir}SysDF.c.o {IfObjDir}Interface.o {CLibraries}StdCLib.o {Libraries}Runtime.o + + +######################################################################## +# The System file +######################################################################## + +# Hacks adapt Sys.r to the changed build system +{BuildDir}System ƒ {ResourceDir}Sys.r {SystemResourceFiles} {PatchDir}LoadPatches.a {RsrcDir}SysDF + Set Misc {MiscDir}; Export Misc + Set ColorPicker {ColorPickerDir}; Export ColorPicker + Set DataAccessMgr {DataAccessDir}; Export DataAccessMgr + Set Keyboard {OSDir}Keyboard:; Export Keyboard + Set RealObjDir {ObjDir}; Set ObjDir {RsrcDir} + Rez {StdROpts} -t zsys -c MACS -d VidExtVers=∂"{VidExtVers}∂" {ResourceDir}Sys.r -o {Targ} + Set ObjDir {RealObjDir} + # Get rid of all the "Main" segment names + #DeRez {Targ} ∂ + # | StreamEdit -d -e '/•data ([¬ ]+)®1 ∂(([¬,]+)®2,≈∂"Main∂"/ Print "Change "®1" ("®2") to $$Type ($$Id, $$Attributes);"' ∂ + # | Rez -a -o {Targ} + # Compatibility code (and credits) in the data fork + Asm {StdAOpts} -o {ObjDir}LoadPatches.a.o {PatchDir}LoadPatches.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {RsrcDir}LoadPatches.a.rsrc {ObjDir}LoadPatches.a.o + {RsrcDir}SysDF {Targ} {RsrcDir}LoadPatches.a.rsrc + + +######################################################################## +# Classical PTCH resources +######################################################################## + +# Patches and patch installation code for all ROMs (PTCH 0) +{RsrcDir}BeforePatches.a.rsrc ƒ {PatchDir}BeforePatches.a + Asm {StdAOpts} -o {ObjDir}BeforePatches.a.o {PatchDir}BeforePatches.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}BeforePatches.a.o + +PatchOpts = -d SonyNonPortable -i {PatchDir} -i {GestaltDir} -i {QDPatchesDir} -i {Sources}QuickDraw: -i {DriverDir}Video: + +# PTCH $75 (117) for Plus +{ObjDir}PatchPlusROM.a.o ƒ {PatchDir}PatchPlusROM.a + Asm {StdAOpts} {PatchOpts} -o {Targ} {PatchDir}PatchPlusROM.a +{RsrcDir}PatchPlusROM.a.rsrc ƒ {ObjDir}PatchPlusROM.a.o + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PatchPlusROM.a.o + +# PTCH $178 (376) for II +{ObjDir}PatchIIROM.a.o ƒ {PatchDir}PatchIIROM.a + Asm {StdAOpts} {PatchOpts} -o {Targ} {PatchDir}PatchIIROM.a +{RsrcDir}PatchIIROM.a.rsrc ƒ {ObjDir}PatchIIROM.a.o + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PatchIIROM.a.o + +# PTCH $276 (630) for SE +{ObjDir}PatchSEROM.a.o ƒ {PatchDir}PatchSEROM.a + Asm {StdAOpts} {PatchOpts} -o {Targ} {PatchDir}PatchSEROM.a +{RsrcDir}PatchSEROM.a.rsrc ƒ {ObjDir}PatchSEROM.a.o + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PatchSEROM.a.o + +# PTCH $37a (890) for Portable +{ObjDir}PatchPortableROM.a.o ƒ {PatchDir}PatchPortableROM.a + Asm {StdAOpts} {PatchOpts} -o {Targ} {PatchDir}PatchPortableROM.a +{RsrcDir}PatchPortableROM.a.rsrc ƒ {ObjDir}PatchPortableROM.a.o + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PatchPortableROM.a.o + +# PTCH $676 (1660) for IIci +{ObjDir}PatchIIciROM.a.o ƒ {PatchDir}PatchIIciROM.a + Asm {StdAOpts} {PatchOpts} -o {Targ} {PatchDir}PatchIIciROM.a +{RsrcDir}PatchIIciROM.a.rsrc ƒ {ObjDir}PatchIIciROM.a.o + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PatchIIciROM.a.o + + +######################################################################## +# The LinkedPatch mechanism +######################################################################## + +# Link LinkPatch, the LinkedPatch linker (object only, no source code!) +{RsrcDir}LinkPatch ƒ {LinkPatchDir}LinkPatchLib.o {ObjDir}LinkPatch.a.o + Link -t MPST -c 'MPS ' -o {Targ} {LinkPatchDir}LinkPatchLib.o {ObjDir}LinkPatch.a.o + +# LinkPatch needs to know some constants in LinkedPatchMacros.a +{ObjDir}LinkPatch.a.o ƒ {LinkPatchDir}LinkPatch.a + Asm {StdAOpts} -o {Targ} {LinkPatchDir}LinkPatch.a + +# Combine the linked patch objects into one lib... +{LibDir}LinkedPatches.lib ƒ {LinkedPatchObjs} + Lib {StdLibOpts} -o {Targ} {LinkedPatchObjs} + +# ...and link them into several 'lpch' resource +{RsrcDir}LinkedPatches.rsrc ƒ {RsrcDir}LinkPatch {LibDir}LinkedPatches.lib + # -l for some table, -v for counts, -p for patches, -w for ?warnings-off + {RsrcDir}LinkPatch -l -w -o {Targ} {LibDir}LinkedPatches.lib > {TextDir}LinkPatchJumpTbl + +# Assemble the runtime linked patch loader... +{ObjDir}LinkedPatchLoader.a.o ƒ {LinkPatchDir}LinkedPatchLoader.a + Asm {StdAOpts} -o {Targ} {LinkPatchDir}LinkedPatchLoader.a + +# ...and link it into a 'lodr' resource +{RsrcDir}LinkedPatchLoader.a.rsrc ƒ {ObjDir}LinkedPatchLoader.a.o + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}LinkedPatchLoader.a.o + + +######################################################################## +# LinkedPatch objects not built by another makefile +######################################################################## + +# My hack to ensure byte-perfect lpch builds +{ObjDir}ForceRomBindOrder.a.o ƒ {Sources}Make:ForceRomBindOrder.a + Asm {StdAOpts} -o {Targ} {Sources}Make:ForceRomBindOrder.a + +# A patch to SetTrapAddress and GetTrapAddress that “protects” come-from patches +{ObjDir}PatchProtector.a.o ƒ {LinkPatchDir}PatchProtector.a + Asm {StdAOpts} -o {Targ} {LinkPatchDir}PatchProtector.a + +# Do smarter loading of Process Manager segments to reduce system heap fragmentation +{ObjDir}ProcessManagerSegmentTweaks.a.o ƒ {PatchDir}ProcessManagerSegmentTweaks.a + Asm {StdAOpts} -o {Targ} {PatchDir}ProcessManagerSegmentTweaks.a + +# Patches to backgroung printing when memory is low +{ObjDir}LowMemoryPrintingPatches.a.o ƒ {PatchDir}LowMemoryPrintingPatches.a + Asm {StdAOpts} -o {Targ} {PatchDir}LowMemoryPrintingPatches.a + +# Patch Classic .Screen drvr to error on "GetScreenState" status call +{ObjDir}BrightnessPatches.a.o ƒ {PatchDir}BrightnessPatches.a + Asm {StdAOpts} -o {Targ} {PatchDir}BrightnessPatches.a + +# RamDisk internal name localizer +{ObjDir}EDiskLocalNamePatch.a.o ƒ {PatchDir}EDiskLocalNamePatch.a + Asm {StdAOpts} -o {Targ} {PatchDir}EDiskLocalNamePatch.a + +# Responsible for mounting slow SCSI drives on TERROR machines +{ObjDir}LateLoad.a.o ƒ {TidbitsDir}LateLoad.a + Asm {StdAOpts} -o {Targ} {TidbitsDir}LateLoad.a + +# "Secondary initialization" patches +{ObjDir}FinalInitialization.a.o ƒ {PatchDir}FinalInitialization.a + Asm {StdAOpts} -o {Targ} {PatchDir}FinalInitialization.a + + +######################################################################## +# Misc System file resources +######################################################################## + +# Deep shit alerts for booting +{RsrcDir}BootAlerts.a.rsrc ƒ {TidbitsDir}BootAlerts.a + Asm {StdAOpts} -o {ObjDir}BootAlerts.a.o {TidbitsDir}BootAlerts.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}BootAlerts.a.o + +# Deep shit alerts (for after booting) +{RsrcDir}UserAlerts.a.rsrc ƒ {TidbitsDir}UserAlerts.a + Asm {StdAOpts} -o {ObjDir}UserAlerts.a.o {TidbitsDir}UserAlerts.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}UserAlerts.a.o + +# Built-in Video Monitors (cdev) Extension for IIci and IIsi +{RsrcDir}BuiltInVideoExtension.p.rsrc ƒ {TidbitsDir}BuiltInVideoExtension.p + Pascal {StdPOpts} -o {ObjDir}BuiltInVideoExtension.p.o {TidbitsDir}BuiltInVideoExtension.p + Link {StdLOpts} {StdAlign} -m ENTRY -rt RSRC=0 -o {Targ} {ObjDir}BuiltInVideoExtension.p.o {LibraryDir}StandardLib.o {IfObjDir}interface.o + +# The standard decompression DefProc +{RsrcDir}DeCompressDefProc.a.rsrc ƒ {PatchDir}DeCompressDefProc.a + Asm {StdAOpts} -o {ObjDir}DeCompressDefProc.a.o {PatchDir}DeCompressDefProc.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}DeCompressDefProc.a.o + +# The standard decompression defproc for byte sized data +{RsrcDir}DeCompressDefProc1.a.rsrc ƒ {PatchDir}DeCompressDefProc1.a + Asm {StdAOpts} -o {ObjDir}DeCompressDefProc1.a.o {PatchDir}DeCompressDefProc1.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}DeCompressDefProc1.a.o + +# Decompress defProc for GreggyBits decompression +{RsrcDir}GreggyBitsDefProc.a.rsrc ƒ {PatchDir}GreggyBitsDefProc.a + Asm {StdAOpts} -o {ObjDir}GreggyBitsDefProc.a.o {PatchDir}GreggyBitsDefProc.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}GreggyBitsDefProc.a.o + +# Code to put up a dialog if we have a parity troubles +{RsrcDir}ParityINIT.a.rsrc ƒ {TidbitsDir}ParityINIT.a + Asm {StdAOpts} -o {ObjDir}ParityINIT.a.o {TidbitsDir}ParityINIT.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}ParityINIT.a.o + +# FKEY that will save the screen as a PICT file +{RsrcDir}PictWhap.a.rsrc ƒ {TidbitsDir}PictWhap.a + Asm {StdAOpts} -o {ObjDir}PictWhap.a.o {TidbitsDir}PictWhap.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PictWhap.a.o + +# Sound resource which is played when FKEY 3 is executed +{RsrcDir}PictWhapSound.rsrc ƒ {TidbitsDir}PictWhapSound.r + Rez {StdROpts} -o {Targ} {TidbitsDir}PictWhapSound.r + +# Prevents switch launching from System 6 to System 7 +{RsrcDir}PreventSwitchLaunch.a.rsrc ƒ {TidbitsDir}PreventSwitchLaunch.a + Asm {StdAOpts} -o {ObjDir}PreventSwitchLaunch.a.o {TidbitsDir}PreventSwitchLaunch.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}PreventSwitchLaunch.a.o + +# ROM resource override code +{RsrcDir}ROvr.a.rsrc ƒ {TidbitsDir}ROvr.a + Asm {StdAOpts} -o {ObjDir}ROvr.a.o {TidbitsDir}ROvr.a + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {ObjDir}ROvr.a.o + +{RsrcDir}SystemFonts.rsrc ƒ {MiscDir}SystemFonts.r + Rez {StdROpts} -o {Targ} {MiscDir}SystemFonts.r diff --git a/OS/Gestalt/GestaltLookup.c b/OS/Gestalt/GestaltLookup.c index 0bee687..1354881 100644 --- a/OS/Gestalt/GestaltLookup.c +++ b/OS/Gestalt/GestaltLookup.c @@ -1,3 +1,10 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted the fix. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: GestaltLookup.c @@ -247,7 +254,7 @@ findLong(ulong selector, int* index) min = 0; max = GestaltPtr->slotsUsed-1; do { - i = min + ((max - min) >> 1); /* get middle of range */ + i = min + ((max - min) > 1); /* get middle of range ex */ if (tablePtr[i][0] > selector) /* are we too high? (is that possible?) */ max = i; else if (tablePtr[i][0] < selector) /* are we too low? */ diff --git a/OS/HFS/Cache/DiskCache.a b/OS/HFS/Cache/DiskCache.a index c6f52e9..c7c0cc8 100644 --- a/OS/HFS/Cache/DiskCache.a +++ b/OS/HFS/Cache/DiskCache.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Conditionalized the 'bra fcExit' from as forROM (all other SM changes are forROM) +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: DiskCache.a ; @@ -453,7 +460,6 @@ fcFile MOVEA.L FCBSPtr,A1 ; A1 = FCB ptr BNE.S @1 ; br if so (go flush) BTST #noFlushBit,FHFlags(A4) ; avoid intermediate flushes? <08Dec85> BEQ.S @1 ; br if not (go flush) <08Dec85> - bra.s fcExit ; exit if so (skip flush) IF NOT forROM THEN ; We don't need MacPlus ROM check rb MOVE.L ROMBase,A3 ;<11Dec86> make sure we have the correct ROM @@ -463,6 +469,7 @@ fcFile MOVEA.L FCBSPtr,A1 ; A1 = FCB ptr BNE.S fcExit ; exit if not (skip flush) <08Dec85> ELSE ; rb ; if FlushFlag is 0, then if this file is control file skip flushing + bra.s fcExit ; exit if so (skip flush) ENDIF ; rb @1 BSR FlushFCache ; flush the A4 cache diff --git a/OS/HFS/Extensions/BTPScan.a b/OS/HFS/Extensions/BTPScan.a index ecf466a..d952809 100644 --- a/OS/HFS/Extensions/BTPScan.a +++ b/OS/HFS/Extensions/BTPScan.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: BTPScan.a ; @@ -215,7 +222,7 @@ GetMultNodes: proc MOVE.L D2, fcbCrPs(A3) ; put our current pos back into fcb @RdTop: - jsrRom CACHERDIP ; go do the read + jsrRom ROMCACHERDIP ; go do the read ex Put back "ROM" @1: BNE.S @Exit ADD.L D6, D5 ; advance current file position ADD.L D6, ioActCount(A0) ; and tally up bytes read @@ -348,7 +355,7 @@ ValidateNode: proc MOVE.L A4, D2 ; save PSR around ChkNode MOVEA.L PSR.btcbPtr(A4), A4 ; A4 = ptr(BTCB) - jsrRom CHKNODE ; is this node valid? + jsrRom ROMCHKNODE ; is this node valid? ex Put back "ROM" MOVEA.L D2, A4 ; restore PSR BNE.S @more ; not valid, get another node @@ -447,7 +454,7 @@ BTGetPhys: proc MOVE.W PSR.curRec(A4), D1 ; D1 = record we want ADDQ.W #1, PSR.curRec(A4) ; advance to next record for next time <8> MOVEA.L PSR.btcbPtr(A4), A4 ; A4 = ptr(BTCB) - jsrRom LOCREC + jsrRom ROMLOCREC ; ex Put back "ROM" @1: MOVEA.L (A6)+, A4 ; restore PSR ptr @Exit: MOVE.L (A6)+, -(A7) ; restore return address diff --git a/OS/HFS/Extensions/BTreeMgr/BTreeFuncs.a b/OS/HFS/Extensions/BTreeMgr/BTreeFuncs.a index 4f3fbb0..22c6c68 100644 --- a/OS/HFS/Extensions/BTreeMgr/BTreeFuncs.a +++ b/OS/HFS/Extensions/BTreeMgr/BTreeFuncs.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes, and de-inlining +; romGtNxt/1stFCB. Reverted word branches. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: BTreeFuncs.a ; @@ -521,8 +529,7 @@ GNMLoop CMP.W D1,D3 ; same FCB? MOVE.L FCBBTCBptr(A1,D1),D0; D0 = ptr(BTCB)? <12Jan92 #39> BNE.S BOpened ; found it <12Jan92 #39> -GtNxtMatch ADD.W FSFCBLen,D1 ; go to next FCB <03Feb87> - CMP.W (A1),D1 ; reached the end yet? +GtNxtMatch jsrROM ROMGTNXTFCB ; go to next FCB <03Feb87> De-inlined and put back "ROM" BCS.S GNMLoop ; loop thru them all ;; This is the first time open @@ -619,8 +626,7 @@ xBTClose BCLR #btAsyncBit,D1 ; sync only BNE.S @NxtMatch ; <28Mar90> CMP.L FCBVPtr(A1,D1),A3 ; on the same volume? <28Mar90> BEQ.S @BCOpened ; found it <28Mar90> -@NxtMatch ADD.W FSFCBLen,D1 ; go to next FCB - CMP.W (A1),D1 ; reached the end yet? +@NxtMatch jsrROM ROMGTNXTFCB ; go to next FCB De-inlined and put back "ROM" BCS.S @BCLoop ; loop thru them all <28Mar90> IF btDebug THEN ; no match ??!! <28Mar90> @@ -871,7 +877,7 @@ xBTGetRec BSR ExtBTQueue CMP.L BTCWcount(A4),D1 ; validate it BEQ.S @GetRec2 ; OK MOVE.L BTCWcount(A4),ioBTHint1(A3) ; return current Wcount - BRA GetExit ; invalid marker CSS + BRA.S GetExit ; invalid marker CSS @2 MOVE.L btcFNode(A4),D2 ; user wants to read the 1st record @GetRec2 MOVE.L D2,btcNodeM(A4) ; get record in this node, (change the node marker) @@ -1077,8 +1083,7 @@ xBTCleanUp MOVE cbPBufULen(A2),D4 ; D4=ext. FCB unit size LEA fcbPBufData(A2),A2 ; A2=ext. fcb array MOVE FSFCBLen,D5 ; D5=FCB len - MOVE.L FCBSPtr,A1 ; A1=FCB ptr - MOVEQ #2,D1 ; D1=FCB index + jsrROM ROMGT1STFCB ; A1=FCB ptrm, D1=FCB index De-inlined and put back "ROM" ; First close all the open files belong to this process: ; A1=FCBptr, A2=Ext. FCBptr, D1.W=RefNum, D2=id2, D3.W=loop index, D4.W=ext FCBlen, diff --git a/OS/HFS/Extensions/BTreeMgr/BTreeMgr.make b/OS/HFS/Extensions/BTreeMgr/BTreeMgr.make index b8e8bc3..dd604ed 100644 --- a/OS/HFS/Extensions/BTreeMgr/BTreeMgr.make +++ b/OS/HFS/Extensions/BTreeMgr/BTreeMgr.make @@ -1,3 +1,10 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Gently reordered BTreeMgrObjects. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: BTreeMgr.make # @@ -12,12 +19,12 @@ # 12/14/92 CSS Checkout to add BTreeGlue.a build which is required by DictionaryMgr.rsrc. -BTreeMgrObjects = "{ObjDir}BTreeAlloc.a.o" ∂ - "{ObjDir}BTreeFuncs.a.o" ∂ +BTreeMgrObjects = "{ObjDir}BTreeFuncs.a.o" ∂ + "{ObjDir}BTreeAlloc.a.o" ∂ "{ObjDir}BTreeMaint1.a.o" ∂ "{ObjDir}BTreeMaint2.a.o" ∂ - "{ObjDir}BTreeQueue.a.o" ∂ - "{ObjDir}BTreeSvcs.a.o" + "{ObjDir}BTreeSvcs.a.o" ∂ + "{ObjDir}BTreeQueue.a.o" "{LibDir}BTreeMgr.lib" ƒ {BTreeMgrObjects} diff --git a/OS/HFS/Extensions/BTreeMgr/BTreeSvcs.a b/OS/HFS/Extensions/BTreeMgr/BTreeSvcs.a index 2948c36..af320cf 100644 --- a/OS/HFS/Extensions/BTreeMgr/BTreeSvcs.a +++ b/OS/HFS/Extensions/BTreeMgr/BTreeSvcs.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Re-routed the unused function ExtBTUpdate through the trap table. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: BTreeSvcs.a ; @@ -1234,6 +1241,9 @@ BSExit1 ;__________________________________________________________________________________ ExtBTUpdate + MOVE.L jBTUpdate,-(SP) ; jumptable entry for vBTUpdate <25Oct85> + RTS ; go there <25Oct85> +vExtBTUpdate ; MOVE.L (SP)+,-(A6) ; save return address on A6 stack MOVEM.L D1/A0-A1/A4,-(A6) ; save regs diff --git a/OS/HFS/Extensions/CatSearch.a b/OS/HFS/Extensions/CatSearch.a index 0f1186d..91ac878 100644 --- a/OS/HFS/Extensions/CatSearch.a +++ b/OS/HFS/Extensions/CatSearch.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: CatSearch.a ; @@ -872,7 +879,7 @@ CheckCSPB proc export ;__________________________________________________________________________________ CMCatSearch: proc export - jsrRom FSQUEUE ; queue up the request + jsrRom ROMFSQUEUE ; queue up the request ex Put back "ROM" SUBA.W #CSSR.size, A6 ; allocate a CSSR on A6 moved here <1.3> CLR.B CSSR.flags(A6) ; clear the flags moved here <1.3> MOVEA.L A6, A3 ; move CSSR ptr to a safe register <12> @@ -881,7 +888,7 @@ CMCatSearch: proc export move.l ioSearchTime(a5), d0 ; get max search time (time mgr count) <12> bsr StartTimer ; start a timer, if needed, right away <12> - jsrRom DTRMV3 ; find vol using ioNamePtr & ioVRefNum (D023/A234 trashed) + jsrRom ROMDTRMV3 ; find vol using ioNamePtr & ioVRefNum (D023/A234 trashed) ex Put back "ROM" MOVEA.L A6, A3 ; reload pointer to CSSR (doesn’t hurt CCs) <12> BNE @Exit ; (DtrmV3 puts VCBPtr in A2) MOVE.W vcbSigWord(A2), D0 ; Check out the volume signature @@ -891,7 +898,7 @@ CMCatSearch: proc export BRA @Exit ; and cruise @ItsHFS: - jsrRom EXTOFFLINCK ; Is this volume on-line and one of ours? <1.2> + jsrRom ROMEXTOFFLINCK ; Is this volume on-line and one of ours? <1.2> ex Put back "ROM" BEQ.S @VolumeIsCool ; Keep going if so <1.2> BRA @Exit ; Go home if not (with extFSErr or volOffLinErr in D0) <1.2> @@ -1007,7 +1014,7 @@ CMCatSearch: proc export @notBufferOnStack: ADDA.W #CSSR.size, A6 ; deallocate CSSR suba.l a3, a3 ; clear WDCB pointer for external file systems <17> - jmpRom CMDDONE + jmpRom ROMCMDDONE ; ex Put back "ROM" _CSDebugRts 'CMCatSearch', 0 endproc diff --git a/OS/HFS/Extensions/DTDBMgr.a b/OS/HFS/Extensions/DTDBMgr.a index 91e8683..883d373 100644 --- a/OS/HFS/Extensions/DTDBMgr.a +++ b/OS/HFS/Extensions/DTDBMgr.a @@ -1,3 +1,13 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes and removing the +; copied-in routines. Reverted the branch changes in and . +; Reverted by changing pascalRegs back to interruptRegs (i.e. not +; saving a2/a3/d3). +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: DTDBMgr.a ; @@ -258,213 +268,7 @@ DTKeyDescriptor: proc proc _DTDebugRts 'DTDBQueueManager', 0 endproc -;________________________________________________________________________________ -; <36> -; Routine: DesktopCloseDownProc -; -; Inputs param block to _Unmount -; -; Outputs: (none) -; -; Function: Close the desktop database on _Unmount calls -; -;________________________________________________________________________________ -; Rolled into TFS.a for SuperMario FM -; Called by UnMountVol in TFSVol.a - -DesktopCloseDownProc Proc Export - import FindDTVol -@regs reg a0/a1/a3/d0/d1 ; <43> - - movem.l @regs, -(sp) - - movea.l a0,a3 ; save the user's pb <42> - -; d0 - pascal length byte of string <43> -; d1 - size of string allocated on stack <43> - - moveq.l #0,d1 ; assume no string on stack <43> - move.l ioNamePtr(a3),d0 ; d0 = caller’s name ptr <43> - beq.s @noName ; bail on nil <43> - movea.l d0,a0 ; get ready to copy <43> - moveq.l #0,d0 ; clear high bytes <43> - move.b (a0),d0 ; d0 = string length <43> - beq.s @noName ; bail on zero length (d0.l has nil) <43> - - move.b d0,d1 ; d1 = copy of string length byte <43> - addq.b #2,d1 ; add length byte and rounding fodder <43> - bclr.l #0,d1 ; make it even <43> - suba.w d1,sp ; allocate a string of the right length <43> - movea.l sp,a1 ; point to it <43> - -@1: move.b (a0)+,(a1)+ ; <43> - dbra d0,@1 ; copy string length+1 bytes <43> - - move.l sp,d0 ; point to it again <43> - -@noName: - suba.w #ioHVQElSize,sp ; get a pb <42> - movea.l sp,a0 ; point to it <42> - move.w ioVRefNum(a3),ioVRefNum(a0) ; copy caller's vRefNum <42> - move.l d0,ioNamePtr(a0) ; our version of the caller's name <42> - move.w #-1,ioVolIndex(a0) ; by name&vRef, please <42> - _GetVolInfo ; <42> - bne.s @done ; <42> - - move.w ioVRefNum(a0), d0 ; grab the volume that's going away - bsr FindDTVol ; try to find a DTDBQElt for this volume - bne.s @done ; no work to do if the DTDB is closed - sub.w #ioDTQElSize, sp ; allocate a DT param block - movea.l sp, a0 - move.w DTDBQElt.DTRefNum(a3), ioRefNum(a0) ; stash the DTRefNum for this volume - _DTCloseDown - add.w #ioDTQElSize, sp ; deallocate the param block - -@done: - adda.w #ioHVQElSize,sp ; deallocate the pb <42> - adda.w d1,sp ; deallocate the string <43> - movem.l (sp)+, @regs - rts - endproc -;__________________________________________________________________________________ -; -; Allocate the DTDBMgr's globals block -; -; FSVars has been allocated by btree patches. -;__________________________________________________________________________________ -DTDBMgrInit proc export - export QMInit - - move.l #DTGlobals.size, d0 ; we need this much space for DT manager - _NewPtr sys, clear - bne @fail ; no? Run away. - move.l FSVarsPtr, a1 ; a1 = ptr(FSVars block) - move.l a0, FSVars.DTDBMgr(a1) ; stuff ourselves into our slot in FSVars - rts - -@fail - moveq.l #dsMemFullErr, d0 ; sys heap is full, so punt - _SysError - -; Allocate the Queue Manager's globals block -QMInit - -; Allocate a block big enough of all of the Queue Manager's needs: -; Queue manager globals -; Desktop manager QMRec -; Compatibility layer QMRec -; Desktop manager stack -; Compatibility layer stack - - move.l #QMGlobals.size+QMRec.size*2+DTStackSize+clStackSize, d0 - _NewPtr sys, clear - bne.s @fail ; fail if we can't get memory - - move.l FSVarsPtr, a1 ; a1 = ptr(FSVars block) - move.l a0, FSVars.QMgr(a1) ; leave a pointer to globals in FSVars - move.l a0, a1 ; a1 = ptr(FSVars.QMgr) - adda.l #QMGlobals.size, a0 ; skip over globals - move.l a0, QMGlobals.DTQueuePtr(a1); stuff pointer to DTMgr's QMRec - adda.l #QMRec.size, a0 ; skip over DTMgr's QMRec - move.l a0, QMGlobals.CLQueuePtr(a1); stuff pointer to Comp Layer's QMRec - - adda.l #QMRec.size+DTStackSize, a0 ; skip over QMRec and Stack - move.l QMGlobals.DTQueuePtr(a1), a1 ; a1 = ptr(DTMgr's QMRec) - move.l a0, QMRec.stackBase(a1) ; store stack address (stack grows down) - move.w #desktopQType, QMRec.qType(a1) ; set queue type/refnum - - adda.l #CLStackSize, a0 ; skip to end of CLStack - move.l FSVarsPtr, a1 ; a1 = ptr(FSVars) - move.l FSVars.QMgr(a1), a1 ; a1 = ptr(QM globals) - move.l QMGlobals.CLQueuePtr(a1), a1 ; a1 = ptr(Comp Layer's QMRec) - move.l a0, QMRec.stackBase(a1) ; store stack address (stack grows down) - move.w #fsCompatQType, QMRec.qType(a1) ; set queue type/refnum - - rts - -@fail: - moveq.l #dsMemFullErr, d0 ; sys heap is full, so punt - _SysError - endproc - -; FM needed for GetVolParms -;________________________________________________________________________________ -; -; Routine: CheckDesktopSupport -; -; Input: a2 - pointer to local volume's vcb -; Output: zero flag clear if we support the desktop on this volume -; zero flag set if we don't -; -; Function: Indicate whether a volume can support the desktop manager calls -; -; Only call this on local hfs volumes -; -; The rule: A local volume gets desktop support if it is either -; 1) non-ejectable -; 2) ejectable but bigger than DTMinVolSize -; -; AlkBlkSiz is stored as a long and used as a word throughout HFS -;________________________________________________________________________________ -CDSRegs reg d0/d1/a1 -CheckDesktopSupport proc export - - movem.l CDSRegs, -(sp) - -; -; Is this an MFS volume? -; - cmp.w #SigWord,vcbSigWord(a2) ; is this an MFS volume? - beq.s @NoSupport ; yes, so use the exciting resource file technique -; -; Is this volume bigger than DTMinVolSize? -; - move.w vcbNmBlks(a2), d0 ; d0 = # of allocation blocks on this volume - move.w vcbAlBlkSiz+2(a2), d1 ; d1 = allocation block size - ; AlkBlkSiz is used as a word throughout HFS - mulu.w d1, d0 ; d0 = # bytes on this volume - cmp.l #DTMinVolSize, d0 ; is this a big volume? - bhs.s @SupportsDT ; then we always support the DTDB -; -; It's not a big volume, but check and see if the volume is ejectable -; - move.l DrvQHdr+qHead, a1 ; a1 = ptr (1st drive in Drive Queue) - - move.w vcbDrvNum(a2), d0 ; d0 = drive number for this volume (if online) - bne.s @SearchDrvQ ; if it's online, we can go straight to the search - - move.w vcbDRefNum(a2), d1 ; d1 = + or - DrvNum (since we know we're not online) - cmp.w d0, d1 ; = means volume is ejected - beq.s @NoSupport ; which means it gets no DT support - move.w d1, d0 ; d0 now = -DrvNum (since we know it's offline) - neg.w d0 ; d0 now = DrvNum, so we can search the drive Q -; -; We now have the drive number in d0, and we know that the drive is not big enough to -; automatically get DT support. We need to see if it is ejectable, and if it is a small -; non-ejectable volume (say, a ramdisk) we support it. -; -@SearchDrvQ: - cmp.w dQDrive(a1), d0 ; is this the dQ entry we want? - beq.s @GotDQ - move.l qLink(a1), d1 ; get the next dQ entry (test for zero) - movea.l d1, a1 ; move to an A reg where we can use it - bne.s @SearchDrvQ ; and keep going if there is one - move.w #nsvErr, d0 ; if we have a real vcb, we should find a dQ entry - bra.s @NoSupport ; but if we ever don't, let's return 'no support' - -@GotDQ: - cmp.b #8, -3(a1) ; drive queue entry flag bytes => 8 (signed) are non-ejectable <19><51> - blt.s @NoSupport ; we don't support DT on small ejectable volumes - -@SupportsDT: - moveq.l #1, d0 ; clear the zero flag - bra.s @CDSExit - -@NoSupport: - moveq.l #0, d0 ; set the zero flag -@CDSExit: movem.l (sp)+, CDSRegs - rts - endproc +; ex Removed DesktopCloseDownProc, DTDBMgrInit and CheckDesktopSupport ;________________________________________________________________________________ ; ; Routine: BottleNeckIO @@ -499,9 +303,7 @@ BottleNeckIO proc export move.l a0, FSVars.dtOwnCall(a1); leave a bread crumb for FileShare <17> moveq.l #desktopQType, d2 ; our queue type/refnum - move.l a4,-(sp) ; save a4 CSS - bigjsr GetQMRecPtr,a4 ; a1 = ptr(QMRec) CSS - move.l (sp)+,a4 ; recover a4 CSS + bsr GetQMRecPtr ; ex move.l a6, QMRec.curStack(a1) ; save current alt stack pointer ; •• do high water mark checking here @@ -530,25 +332,19 @@ BottleNeckIO proc export completionRoutine: moveq.l #desktopQType, d2 ; our queue type/refnum - MACHINE mc68020 - move.l a4,-(sp) ; save a4 CSS - bigjsr GetQMRecPtr,a4 ; a1 = ptr(QMRec) CSS - move.l (sp)+,a4 ; recover a4 CSS + bsr GetQMRecPtr ; ex move.l a6, -(sp) ; save a6 for a sec movea.l QMRec.curStack(a1), a6 ; get our a6 back bset.b #0, hasContinued(a6) ; mark that we've been back movea.l (sp)+, a6 ; restore a6 beq.s anRTSInstruction ; if we haven't returned from the trap, rts to driver - movem.l pascalRegs, -(sp) ; save all regs that pascal callers need saved pdw - pea restorePascalRegs ; and get in the chain to restore them later pdw + movem.l interruptRegs, -(sp) ; save all regs that pascal callers need saved pdw + pea restoreInterruptRegs ; and get in the chain to restore them later contDeskThread: moveq.l #desktopQType, d2 ; our queue type/refnum - MACHINE mc68020 - move.l a4,-(sp) ; save a4 CSS - bigjsr GetQMRecPtr,a4 ; a1 = ptr(QMRec) CSS - move.l (sp)+,a4 ; recover a4 CSS + bsr GetQMRecPtr ; ex movea.l QMRec.curStack(a1), a6 ; restore alt stack pointer adda.w #Lsize, a6 ; clear off the locals movem.l (a6)+, BottleNeckRegs ; restore desktop thread registers @@ -563,8 +359,8 @@ contAppThread: ; continue without saving registers rts ; return async time to application -restorePascalRegs: ; pdw - movem.l (sp)+, pascalRegs ; restore the regs that we saved last time through +restoreInterruptRegs: ; pdw + movem.l (sp)+, interruptRegs ; restore the regs that we saved last time through rts ; back to the app thread _DTDebugTail 'Completion',0 @@ -760,7 +556,7 @@ DTDone: proc ; ;________________________________________________________________________________ DTVolExtFSCheck: proc - jsrROM DTRMV3 ; Excuse me, Mr. FS, please find us a volume + jsrROM ROMDTRMV3 ; Excuse me, Mr. FS, please find us a volume ex Put back "ROM" bne.s @LocalErr ; early trouble is a sign to leave tst.w vcbFSID(a2) ; is this a local volume? @@ -775,10 +571,10 @@ DTVolExtFSCheck: proc bne.s @ExternalExit ; if not, just let'em have the call @GrabAnFCB: - jsrROM GT1STFCB ; get (A1,D1) pointing to first FCB + jsrROM ROMGT1STFCB ; get (A1,D1) pointing to first FCB ex Put back "ROM" @1 tst.l FCBFlNm(a1,d1) ; FCB unused? beq.s @GotFCB ; br if so - jsrROM GTNXTFCB ; get next one until we run out + jsrROM ROMGTNXTFCB ; get next one until we run out ex Put back "ROM" bcs.s @1 moveq.l #TMFOErr,d0 ; too many files open @@ -793,7 +589,7 @@ DTVolExtFSCheck: proc @LocalErr: tst.l (sp)+ ; discard the return address to DTMgr caller - jmpROM CMDDONE ; leave through the file system + jmpROM ROMCMDDONE ; leave through the file system ex Put back "ROM" @LocalVolume: move.l FSVarsPtr, a3 ; a3 = ptr(file system global area) @@ -840,7 +636,7 @@ DTRfnExtFSCheck: proc @LocalErr: tst.l (sp)+ ; discard the return address to DTMgr caller - jmpROM CMDDONE ; leave through the file system + jmpROM ROMCMDDONE ; leave through the file system ex Put back "ROM" @LocalVolume: rts ; this call is for us @@ -1313,7 +1109,7 @@ FindDTRegs reg d4/a0/a2/a3 move.w d3,ioVRefNum(a0) ; vRef of volume to look at clr.w ioVolIndex(a0) ; no indexing; use VRef only go_HGetVInfo - bne Error ; punt on errors CSS + bne.s Error ; punt on errors CSS move.w bigPB+ioVAtrb(a6), d0 ; get the volume attributes btst.l #15, d0 ; software locked? @@ -1800,7 +1596,7 @@ SetFileAttribs: proc ; False = were just created ;________________________________________________________________________________ DTOpenInform: proc export - jsrROM FSQUEUESYNC ; just to check for external file systems + jsrROM ROMFSQUEUESYNC ; just to check for external file systems ex Put back "ROM" bsr DTVolExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue bsr RealOpenDT ; d1 true/false for dtExisted @@ -1823,7 +1619,7 @@ DTOpenInform: proc export ; open for the specified volume, return its refNum. ;________________________________________________________________________________ DTGetPath: proc export - jsrROM FSQUEUESYNC ; just to check for external file systems + jsrROM ROMFSQUEUESYNC ; just to check for external file systems ex Put back "ROM" bsr DTVolExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue bsr RealOpenDT @@ -1878,7 +1674,7 @@ LSize equ *-bigPB endr @DTCloseDownRegs reg a0-a4/d1-d2 - jsrROM FSQUEUESYNC ; just to check for external file systems + jsrROM ROMFSQUEUESYNC ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue @@ -1924,7 +1720,7 @@ DTAddIcon: proc export StandardLocals AddIconLocals, IconDRec ; normal locals w/icon sized data rec @AddIconRegs reg a0-a4/d1-d2 ; set of regs to save around AddIcon - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn. @@ -2051,7 +1847,7 @@ DTGetIcon: proc export StandardLocals GetIconLocals, IconDRec @GetIconRegs reg a0-a4/d1-d2 ; set of regs to save around AddIcon - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn. @@ -2122,7 +1918,7 @@ DTGetIconInfo: proc export StandardLocals GetIconInfoLocals, IconDRec @GetIconInfoRegs reg a0-a4/d1-d2 ; set of regs to save around this call - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn @@ -2472,7 +2268,7 @@ AddAPPLCallback: proc DTAddAPPL: proc export @AddAPPLRegs reg a0-a4/d1-d2 ; set of regs to save around this call - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn @@ -2696,7 +2492,7 @@ RemoveAPPLCallback: proc DTRemoveAPPL: proc export @RemoveAPPLRegs reg a0-a4/d1-d2 - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; wait our turn @@ -2792,7 +2588,7 @@ DTGetAPPL: proc export StandardLocals GetAPPLLocals, APPLRec @GetAPPLRegs reg a0-a4/d1-d2 ; set of regs to save around GetAPPL - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn @@ -2881,7 +2677,7 @@ DTSetComment: proc export StandardLocals SetCommentLocals, CommentRec @SetCommentRegs reg a0-a4/d1-d2 ; set of regs to save around SetComment - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn @@ -2945,7 +2741,7 @@ DTGetComment: proc export StandardLocals GetCommentLocals, CommentRec @GetCommentRegs reg a0-a4/d1-d2 ; set of regs to save around GetComment - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn @@ -3008,7 +2804,7 @@ DTRemoveComment: proc export StandardLocals RemoveCommentLocals, 0 ; we only need a pb and a key here. Zero Data @RemoveCommentRegs reg a0-a4/d1-d2 ; set of regs to save around RmvCmt - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; Wait our turn @@ -3056,7 +2852,7 @@ LSize equ *-bigPB endr @DTFlushRegs reg a0/a3-a4 - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; wait our turn @@ -3108,7 +2904,7 @@ LSize equ *-bigPB endr @DTResetRegs reg a0-a4/d1-d2 - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; wait our turn @@ -3224,7 +3020,7 @@ LSize equ *-bigPB @DTDeleteRegs reg a0-a4/d1-d2 - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTVolExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; wait our turn @@ -3299,7 +3095,7 @@ LSize equ *-bigPB endr @DTGetInfoRegs reg a0-a4/d1-d2 - jsrROM FSQUEUE ; just to check for external file systems + jsrROM ROMFSQUEUE ; just to check for external file systems ex Put back "ROM" bsr DTRfnExtFSCheck ; find the right volume and hope it's ours bsr DeskMgrQueue ; wait our turn diff --git a/OS/HFS/Extensions/ExternalMakeFSSpec.a b/OS/HFS/Extensions/ExternalMakeFSSpec.a index 535619a..8f97c25 100644 --- a/OS/HFS/Extensions/ExternalMakeFSSpec.a +++ b/OS/HFS/Extensions/ExternalMakeFSSpec.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by changing pascalRegs back to interruptRegs (i.e. not +; saving a2/a3/d3). +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ExternalMakeFSSpec.a ; @@ -115,8 +123,8 @@ myCompletionRoutine: movea.l (sp)+, a6 ; restore a6 beq.s anRTSInstruction ; if we haven't returned from the trap, rts to driver - movem.l pascalRegs, -(sp) ; save all regs that pascal callers need saved pdw - pea restorePascalRegs ; and get in the chain to restore them later pdw + movem.l interruptRegs, -(sp) ; save all regs that pascal callers need saved pdw + pea restoreInterruptRegs ; and get in the chain to restore them later pdw myContCompatThread: move.w #fsCompatQType, d2 ; our queue type/refnum @@ -136,8 +144,8 @@ myContAppThread: ; continue without saving registers rts ; return async time to application -restorePascalRegs: ; pdw - movem.l (sp)+, pascalRegs ; restore the regs that we saved last time through +restoreInterruptRegs: ; pdw + movem.l (sp)+, interruptRegs ; restore the regs that we saved last time through rts ; back to the app thread endproc diff --git a/OS/HFS/Extensions/FileIDs.a b/OS/HFS/Extensions/FileIDs.a index 304adaa..e8a742d 100644 --- a/OS/HFS/Extensions/FileIDs.a +++ b/OS/HFS/Extensions/FileIDs.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: FileIDs.a ; @@ -115,30 +122,30 @@ FileIDs PROC EXPORT ;_______________________________________________________________________ CreateFileIDRef: - jsrROM FSQUEUE ; first wait our turn + jsrROM ROMFSQUEUE ; first wait our turn ex Put back "ROM" - jsrROM FNDFILNAME ; parse pathname(IN: A0=prmblk OUT: D0=err D2.L=namLen D6=dirID + jsrROM ROMFNDFILNAME ; parse pathname(IN: A0=prmblk OUT: D0=err D2.L=namLen D6=dirID ex Put back "ROM" ; D7=cathint A1=volBuffer A2=vcb A3=WDCB A4=cname A5=fileDirEntry) BNE.S @Exit - jsrROM EXTOFFLINCK ; is the volume online and used by us (not ExtFS)? (IN: A2=vcb OUT: D0=err) + jsrROM ROMEXTOFFLINCK ; is the volume online and used by us (not ExtFS)? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BNE.S @Exit - jsrROM TFSVCBTST ; it better be an HFS volume (IN: A2=vcb) + jsrROM ROMTFSVCBTST ; it better be an HFS volume (IN: A2=vcb) ex Put back "ROM" BNE.S @NotHFSErr MOVEA.L A0, A3 ; sure paramblock ptr for later - jsrROM PUSHCNAME ; Put name on A6 stack (IN: A4=name D2.W=len OUT: A0=name D2=len) + jsrROM ROMPUSHCNAME ; Put name on A6 stack (IN: A4=name D2.W=len OUT: A0=name D2=len) ex Put back "ROM" MOVE.W D2,-(A6) ; Save rounded source name length - jsrROM CVFLGS ; is the volume writable? (IN: A2=vcb OUT: D0=err) + jsrROM ROMCVFLGS ; is the volume writable? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BEQ.S @DoCreate MOVE.W D0, D7 ; save the error MOVE.L D6, D0 ; dirID or parent dirID JSR FIDGetID ; get the ID (IN: A0=cname D0=dirID A2=vcb OUT: D0=err D1=fthd) MOVE.W (A6)+,D2 ; Recover rounded source length - jsrROM POPCNAME ; Remove dest. name string (IN: A6=string D2=rndLen OUT: D2=len) + jsrROM ROMPOPCNAME ; Remove dest. name string (IN: A6=string D2=rndLen OUT: D2=len) ex Put back "ROM" MOVE.L D1, ioFileID(A3) ; set the fileID back in the paramblock ptr TST.W D0 BEQ.S @existsErr ; the fileID exists on the locked volume @@ -150,7 +157,7 @@ CreateFileIDRef: @DoCreate MOVE.L D6, D0 ; dirID or parent dirID JSR FIDCreateID ; and do it (IN: A0=cname D0=dirID A2=vcb OUT: D0=err D1=fthd) MOVE.W (A6)+,D2 ; Recover rounded source length - jsrROM POPCNAME ; Remove dest. name string (IN: A6=string D2=rndLen OUT: D2=len) + jsrROM ROMPOPCNAME ; Remove dest. name string (IN: A6=string D2=rndLen OUT: D2=len) ex Put back "ROM" MOVE.L D1, ioFileID(A3) ; set the fileID back in the paramblock ptr TST.W D0 BEQ.S @Exit ; no errors, get out @@ -169,7 +176,7 @@ CreateFileIDRef: BRA.S @Exit @NotHFSErr MOVEQ #wrgVolTypErr, D0 -@Exit jmpROM CMDDONE ; will also put the D0 result in ioResult(A0) +@Exit jmpROM ROMCMDDONE ; will also put the D0 result in ioResult(A0) ex Put back "ROM" ;_______________________________________________________________________ @@ -188,17 +195,17 @@ CreateFileIDRef: DeleteFileIDRef: - jsrROM FSQUEUE ; first wait our turn + jsrROM ROMFSQUEUE ; first wait our turn ex Put back "ROM" - jsrROM DTRMV3 ; get the vcb by vrefnum or name(IN: A0=prmblk OUT:A2=vcb D0=err) + jsrROM ROMDTRMV3 ; get the vcb by vrefnum or name(IN: A0=prmblk OUT:A2=vcb D0=err) ex Put back "ROM" BNE.S @Exit ; D2=nameLen? D3=volName? A3=WDCB A4=pathName) - jsrROM CVFLGS ; is the volume writable? (IN: A2=vcb OUT: D0=err) + jsrROM ROMCVFLGS ; is the volume writable? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BNE.S @Exit - jsrROM EXTOFFLINCK ; is the volume online and used by us (notExtFS)? (IN: A2=vcb OUT: D0=err) + jsrROM ROMEXTOFFLINCK ; is the volume online and used by us (notExtFS)? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BNE.S @Exit - jsrROM TFSVCBTST ; it better be an HFS volume (IN: A2=vcb) + jsrROM ROMTFSVCBTST ; it better be an HFS volume (IN: A2=vcb) ex Put back "ROM" BNE.S @NotHFSErr MOVE.L ioFileID(A0), D0 ; file id @@ -219,7 +226,7 @@ DeleteFileIDRef: BRA.S @Exit @NotHFSErr MOVEQ #wrgVolTypErr, D0 -@Exit jmpROM CMDDONE ; will also put the D0 result in ioResult(A0) +@Exit jmpROM ROMCMDDONE ; will also put the D0 result in ioResult(A0) ex Put back "ROM" ;_______________________________________________________________________ ; @@ -237,14 +244,14 @@ DeleteFileIDRef: ResolveFileIDRef: - jsrROM FSQUEUE ; first wait our turn + jsrROM ROMFSQUEUE ; first wait our turn ex Put back "ROM" - jsrROM DTRMV3 ; get the vcb by vrefnum or name (IN: A0=prmblk OUT:A2=vcb D0=err) + jsrROM ROMDTRMV3 ; get the vcb by vrefnum or name (IN: A0=prmblk OUT:A2=vcb D0=err) ex Put back "ROM" BNE.S @Exit1 ; CSS D2=nameLen? D3=volName? A3=WDCB A4=pathName?) - jsrROM EXTOFFLINCK ; is the volume online and used by us (notExtFS)? (IN: A2=vcb OUT: D0=err) + jsrROM ROMEXTOFFLINCK ; is the volume online and used by us (notExtFS)? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BNE.S @Exit1 ; CSS - jsrROM TFSVCBTST ; it better be an HFS volume (IN: A2=vcb) + jsrROM ROMTFSVCBTST ; it better be an HFS volume (IN: A2=vcb) ex Put back "ROM" BNE.S @NotHFSErr MOVEA.L A0, A3 ; save paramblock ptr for later @@ -265,7 +272,7 @@ ResolveFileIDRef: BRA @Exit1 @Exit MOVE.L D1, ioSrcDirID(A3) ; put it back in paramblock -@Exit1 jmpROM CMDDONE ; will also put the D0 result in ioResult(A0) +@Exit1 jmpROM ROMCMDDONE ; will also put the D0 result in ioResult(A0) ex Put back "ROM" ;_______________________________________________________________________ ; @@ -289,9 +296,9 @@ PBHExchangeFiles: ; A2 = vcb, A3 = destName, A4 = cmvars/scratch, A5 = srcName ; D2 = srcCatHint, D3 = destCatHint, D4 = destFileNum, D5 = srcFileNum, D6 = destDirID, D7 = srcDirID - jsrROM FSQUEUE ; first wait our turn + jsrROM ROMFSQUEUE ; first wait our turn ex Put back "ROM" - jsrROM FNDFILNAME ; parse pathname(IN: A0=prmblk OUT: D0=err D2.L=namLen D6=dirID + jsrROM ROMFNDFILNAME ; parse pathname(IN: A0=prmblk OUT: D0=err D2.L=namLen D6=dirID ex Put back "ROM" BNE @Exit ; D7=cathint A1=volBuffer A2=vcb A3=WDCB A4=cname A5=fileDirEntry) MOVE.L D6, D1 ; save src dirID for later MOVE.L D2, D5 ; save the rounded source name length for later @@ -302,7 +309,7 @@ PBHExchangeFiles: move.l ioSrcDirID(a0), -(a6) ; save caller's ioSrcDirID value MOVE.L ioDestNamePtr(A0), ioFileName(A0) MOVE.L ioDestDirID(A0), ioSrcDirID(A0) - jsrROM FNDFILNAME ; parse pathname(IN: A0=prmblk OUT: D0=err D2.L=namLen D6=dirID + jsrROM ROMFNDFILNAME ; parse pathname(IN: A0=prmblk OUT: D0=err D2.L=namLen D6=dirID ex Put back "ROM" ; D7=cathint A1=volBuffer A2=vcb A3=WDCB A4=cname A5=fileDirEntry) move.l (a6)+, ioSrcDirID(a0) ; restore caller's ioSrcDirID value move.l (a6)+, ioFileName(a0) ; restore caller's ioFileName value
@@ -314,22 +321,22 @@ PBHExchangeFiles: CMP.L A2, A3 ; better be the same volumes if specified by pathnames BNE @difVolErr - jsrROM CVFLGS ; is the volume writable? (IN: A2=vcb OUT: D0=err) + jsrROM ROMCVFLGS ; is the volume writable? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BNE @PopAndErr ; no -> - jsrROM EXTOFFLINCK ; is the volume online and used by us (notExtFS)? (IN: A2=vcb OUT: D0=err) + jsrROM ROMEXTOFFLINCK ; is the volume online and used by us (notExtFS)? (IN: A2=vcb OUT: D0=err) ex Put back "ROM" BNE @PopAndErr - jsrROM TFSVCBTST ; and it better be an HFS volume (IN: A2=vcb) + jsrROM ROMTFSVCBTST ; and it better be an HFS volume (IN: A2=vcb) ex Put back "ROM" BNE @NotHFSErr ; set up the names properly MOVE.L (A6)+, A5 ; get the src name off the A6 stack before it changes - jsrROM PUSHCNAME ; Put dest name on A6 stack (IN: A4=name D2.W=len OUT: A0=name D2=len) + jsrROM ROMPUSHCNAME ; Put dest name on A6 stack (IN: A4=name D2.W=len OUT: A0=name D2=len) ex Put back "ROM" MOVE.L A0, A3 ; save the dest name MOVE.L A5, A4 ; get the src name MOVE.L D2,-(A6) ; Save dest rounded name length MOVE.L D5, D2 ; get the src name length - jsrROM PUSHCNAME ; Put src name on A6 stack (IN: A4=name D2.W=len OUT: A0=name D2=len) + jsrROM ROMPUSHCNAME ; Put src name on A6 stack (IN: A4=name D2.W=len OUT: A0=name D2=len) ex Put back "ROM" MOVE.L D2,-(A6) ; Save rounded name length ; grab the File ID numbers to use later for fcb searching on open files @@ -340,7 +347,7 @@ PBHExchangeFiles: MOVEA.L A0, A5 ; keep the src name MOVE.L D7, D0 ; set the src dir ID MOVEQ #0, D2 ; no cat hint - jsrROM LOCCREC ; search the catalog (IN: A2=vcb A4=cmvars A0=name D0=dirID D2=catHInt + jsrROM ROMLOCCREC ; search the catalog (IN: A2=vcb A4=cmvars A0=name D0=dirID D2=catHInt ex Put back "ROM" BNE @ExchErr ; OUT: D0=err D1=size D2=catHint A0=ckr A1=cdr) MOVE.L D2, D4 ; save the src cat hint MOVE.L filFlNum(A1), D5 ; save src file ID @@ -348,7 +355,7 @@ PBHExchangeFiles: MOVEA.L A3, A0 ; set the dest name MOVE.L D6, D0 ; set the dest dir ID MOVEQ #0, D2 ; no cat hint - jsrROM LOCCREC ; search the catalog (IN: A2=vcb A4=cmvars A0=name D0=dirID D2=catHInt + jsrROM ROMLOCCREC ; search the catalog (IN: A2=vcb A4=cmvars A0=name D0=dirID D2=catHInt ex Put back "ROM" BNE @ExchErr ; OUT: D0=err D1=size D2=catHint A0=ckr A1=cdr) MOVE.L D2, D3 ; save the dest cat hint @@ -370,7 +377,7 @@ PBHExchangeFiles: ; FINE TUNING: Flag if either file is open. THEN after FidExchangeFiles, if none, skip fcb walking. - jsrROM GT1STFCB ; get the first fcb (uses A1, D1) + jsrROM ROMGT1STFCB ; get the first fcb (uses A1, D1) ex Put back "ROM" @loop CMP.L fcbVPtr(A1, D1), A2 ; better be correct volume BNE.S @nxtFCB CMP.L fcbFlNm(A1, D1), D5 @@ -390,10 +397,10 @@ PBHExchangeFiles: ; update the file number in the buffer header after the exchange MOVE.L VCBBufAdr(A2), A1 ST CacheFlag ; really flush - jsrROM FLUSHCACHE ; release the buffers to free buffer pool + jsrROM ROMFLUSHCACHE ; release the buffers to free buffer pool ex Put back "ROM" movem.L (a6)+, a1/d1 ; restore refnum and FCBSPtr after flush -@nxtFCB jsrROM GTNXTFCB +@nxtFCB jsrROM ROMGTNXTFCB ; ex Put back "ROM" BCS.S @loop ; loop thru them all ; we are almost ready to roll...FINALLY!... @@ -419,7 +426,7 @@ PBHExchangeFiles: ; exchange fcb info (file number, file name, and file parID only!) - jsrROM GT1STFCB ; get the first fcb (uses A1, D1) + jsrROM ROMGT1STFCB ; get the first fcb (uses A1, D1) ex Put back "ROM" @loop1 CMP.L fcbVPtr(A1, D1), A2 ; better be correct volume BNE.S @nxtFCB1 CMP.L fcbFlNm(A1, D1), D5 @@ -455,7 +462,7 @@ PBHExchangeFiles: MOVEA.L A4, A1 ; Restore A1 -@nxtFCB1 jsrROM GTNXTFCB +@nxtFCB1 jsrROM ROMGTNXTFCB ; ex Put back "ROM" BCS.S @loop1 ; loop thru them all BRA.S @PopAndExit @@ -480,11 +487,11 @@ PBHExchangeFiles: @PopAndExit ADD #lenCMVars, A6 ; get the temp storage back needed by LocCRec MOVE.L (A6)+,D2 ; Recover rounded length - jsrROM POPCNAME ; Remove src name string (IN: A6=string D2=rndLen OUT: D2=len) + jsrROM ROMPOPCNAME ; Remove src name string (IN: A6=string D2=rndLen OUT: D2=len) ex Put back "ROM" MOVE.L (A6)+,D2 ; Recover rounded length - jsrROM POPCNAME ; Remove dest name string (IN: A6=string D2=rndLen OUT: D2=len) + jsrROM ROMPOPCNAME ; Remove dest name string (IN: A6=string D2=rndLen OUT: D2=len) ex Put back "ROM" -@Exit jmpROM CMDDONE ; will also put the D0 result in ioResult(A0) +@Exit jmpROM ROMCMDDONE ; will also put the D0 result in ioResult(A0) ex Put back "ROM" diff --git a/OS/HFS/Extensions/FileIDsSvcs.a b/OS/HFS/Extensions/FileIDsSvcs.a index 5704aab..bae8bcc 100644 --- a/OS/HFS/Extensions/FileIDsSvcs.a +++ b/OS/HFS/Extensions/FileIDsSvcs.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: FileIDsSvcs.a ; @@ -141,14 +148,14 @@ FIDCreateID: MOVEM.L FIDCrRegs, -(A6) ; save registers MOVE.L D0,D6 ; save the par ID MOVEA.L A0,A3 ; save the cname ptr - jsrROM CMSETUP ; set up key storage pointed to by A4 + jsrROM ROMCMSETUP ; set up key storage pointed to by A4 ex Put back "ROM" MOVEQ #0,D5 ; clear fileID, in case we return early due to errors CLR.L VCBDirIDM(A2) ; invalidate current DirID marker ; ; locate the file record ; MOVEQ #0,D2 ; no catalog hint - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" BNE @CrExit ; it's not there, just exit with what's in D0 CMPI.B #cdrFilRec, cdrType(A1); better be a file (type=2) BNE.S @CrNotAFileErr @@ -161,7 +168,7 @@ FIDCreateID: MOVE.L D0,D5 ; keep fileID for later SUBA.L A0,A0 ; use NULL for fthread key name LEA ckrOff(A4), A1 ; use this storage for the fthread key - jsrROM BUILDKEY ; fill in the key + jsrROM ROMBUILDKEY ; fill in the key ex Put back "ROM" ; ; and do the data of the file thread ; @@ -176,7 +183,7 @@ FIDCreateID: MOVEA.L A3, A0 ; the cname ptr LEA thdCName(A1), A1 - jsrROM UPDCNAME + jsrROM ROMUPDCNAME ; ex Put back "ROM" ; ; Insert the file thread in the catalog btree ; @@ -184,7 +191,7 @@ FIDCreateID: MOVE.W #lenthd, D1 LEA cdrOff(A4), A1 LEA ckrOff(A4), A0 - jsrROM BTINSERT + jsrROM ROMBTINSERT ; ex Put back "ROM" BNE.S @CrBTErr ; could be disk full, so stop ; ; finally, turn on thread flag in file CNode. Too bad, gotta find it again @@ -192,16 +199,16 @@ FIDCreateID: MOVE.L D4, D2 ; use saved cat hint MOVE.L D6, D0 ; dirID or parent dirID MOVEA.L A3, A0 ; CName pointer - jsrROM LOCCREC ; we know it's there + jsrROM ROMLOCCREC ; we know it's there ex Put back "ROM" BSET #fThreadFlag,FilFlags(A1); set the flag MOVE.W VCBCtRef(A2),D0 ; refnum of catalog file - jsrROM BTUPDATE + jsrROM ROMBTUPDATE ; ex Put back "ROM" BNE.S @CRExit ; if there was an error, catalog could be shot! ; ; get it out to disk ; - jsrROm CMFLUSH ; flush the catalog + jsrROm ROMCMFLUSH ; flush the catalog ex Put back "ROM" BRA.S @CrExit ; ; handle errors @@ -217,7 +224,7 @@ FIDCreateID: MOVE.L D5,D0 ; file number <11Jan91 #10> SUBA.L A0,A0 ; no Cname <11Jan91 #10> MOVEQ #0,D2 ; no hint <11Jan91 #10> - jsrROM LOCCREC ; locate thread record <11Jan91 #10> + jsrROM ROMLOCCREC ; locate thread record <11Jan91 #10> ex Put back "ROM" BNE.S @7 ; bad time for error <11Jan91 #10> CMP.B #cdrfThdRec,cdrType(A1) ; file thread type? <11Jan91 #10> @@ -247,9 +254,9 @@ FIDCreateID: @5 TST.W D3 ; have we changed the file? <11Jan91 #10> BNE.S @7 ; no <11Jan91 #10> @6 MOVE.W VCBCtRef(A2),D0 ; refnum of catalog file (input = D0/D2) <11Jan91 #10> - jsrROM BTUPDATE ; mark the node (D2) dirty <11Jan91 #10> + jsrROM ROMBTUPDATE ; mark the node (D2) dirty <11Jan91 #10> ex Put back "ROM" BNE.S @CrExit ; bad time for error <11Jan91 #10> - jsrROm CMFLUSH ; flush the catalog (input = A2) <11Jan91 #10> + jsrROm ROMCMFLUSH ; flush the catalog (input = A2) <11Jan91 #10> ex Put back "ROM" BNE.S @CrExit ; bad time for error <11Jan91 #10> @7 MOVE.W #CMExists,D0 ; Translate error "CMExists = cnode already there" @@ -270,7 +277,7 @@ FIDCreateID: ; A3 = user's file name ; Output: BEQ if 2 names are the same LEA thdCName(A1), A1 - jsrROM UPDCNAME + jsrROM ROMUPDCNAME ; ex Put back "ROM" ;_________________________________________________________________________________ @@ -299,7 +306,7 @@ FIDDeleteID: ; MOVE.L (SP)+,-(A6) ; save return address on A6 stack MOVEM.L FIDDelRegs,-(A6) ; save registers - jsrROM CMSETUP ; set up key storage pointed to by A4 + jsrROM ROMCMSETUP ; set up key storage pointed to by A4 ex Put back "ROM" MOVE.L D0, D5 ; save fileID MOVEQ #0, D7 ; save error in here, if CNode for file is missing CLR.L VCBDirIDM(A2) ; invalidate current DirID marker @@ -308,7 +315,7 @@ FIDDeleteID: ; MOVEQ #0, D2 ; no catalog hint SUBA.L A0, A0 ; use NULL for fthread key. - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" BNE.S @DlNoThdErr ; it's not there CMPI.B #cdrFThdRec, cdrType(A1); better be a file BNE.S @DlNotAFileErr @@ -318,7 +325,7 @@ FIDDeleteID: MOVEQ #0, D2 ; no catalog hint MOVE.L thdParID(A1), D0 ; get file's dir id from fthread data LEA thdCName(A1), A0 ; and it's name - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" BEQ.S @DlUnsetFlg MOVE.W D0, D7 ; need to return the error later BNE.S @DlDelThd ; whoops, it's not there...well, delete the thread @@ -329,7 +336,7 @@ FIDDeleteID: ; @DlUnsetFlg BCLR #fThreadFlag,FilFlags(A1) MOVE.W VCBCtRef(A2), D0 ; refnum of catalog file - jsrROM BTUPDATE ; tell the btree + jsrROM ROMBTUPDATE ; tell the btree ex Put back "ROM" BNE.S @DlExit ; if there's an error, the catalog could be shot! ; ; Delete the file thread in the catalog btree @@ -337,17 +344,17 @@ FIDDeleteID: @DlDelThd MOVE.L D5, D0 ; file id SUBA.L A0,A0 ; use NULL for fthread key LEA ckrOff(A4), A1 ; use this storage for fthread key - jsrROM BUILDKEY ; fill in the key + jsrROM ROMBUILDKEY ; fill in the key ex Put back "ROM" LEA ckrOff(A4), A0 ; get the storage again MOVE.W VCBCtRef(A2), D0 ; refnum of catalog file - jsrROM BTDELETE ; delete file thread + jsrROM ROMBTDELETE ; delete file thread ex Put back "ROM" BNE.S @DlExit ; we know it exists, so must be IOError... ; ...Oh well, leave the cnode's fthread flag off. ; ; get it out to disk. ; - jsrROM CMFLUSH ; flush the catalog + jsrROM ROMCMFLUSH ; flush the catalog ex Put back "ROM" MOVE.W D7, D0 ; should be clear, unless file CNode was missing BRA.S @DlExit ; @@ -397,14 +404,14 @@ FIDGetID: ; MOVE.L (SP)+,-(A6) ; save return address on A6 stack MOVEM.L FIDGtRegs, -(A6) ; save registers - jsrROM CMSETUP ; set up key storage pointed to by A4 + jsrROM ROMCMSETUP ; set up key storage pointed to by A4 ex Put back "ROM" MOVEQ #0, D5 ; clear fileID, in case we return early due to errors CLR.L VCBDirIDM(A2) ; invalidate current DirID marker ; ; locate the file record ; MOVEQ #0, D2 ; no catalog hint - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" BNE @GtExit ; it's not there, just exit with what's in D0 CMPI.B #cdrFilRec, cdrType(A1); better be a file BNE.S @GtNotAFileErr @@ -462,7 +469,7 @@ FIDResolveID: MOVE.L (SP)+,-(A6) ; save return address on A6 stack MOVEM.L FIDResRegs,-(A6) ; save registers MOVE.L D0,D3 ; save fileID - jsrROM CMSETUP ; set up key record and data storage + jsrROM ROMCMSETUP ; set up key record and data storage ex Put back "ROM" MOVEA.L A0, A3 ; save cName ptr CLR.L VCBDirIDM(A2) ; invalidate current DirID marker ; @@ -470,7 +477,7 @@ FIDResolveID: ; ;; MOVEQ #0, D2 ; no catalog hint <23Aug90> SUBA.L A0, A0 ; use NULL for file name. - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" BNE.S @RsExit ; it's not there, pass error on up CMPI.B #cdrFThdRec, cdrType(A1); better be a file BNE.S @RsNotAFileErr @@ -480,7 +487,7 @@ FIDResolveID: LEA thdCName(A1), A0 ; and it's name MOVEM.L D0/D2/A0,-(A6) ; save dirID/hint/name <23Aug90> MOVEQ #0, D2 ; no catalog hint <23Aug90> - jsrROM LOCCREC ; does the file exist? <23Aug90> + jsrROM ROMLOCCREC ; does the file exist? <23Aug90> ex Put back "ROM" MOVEM.L (A6)+,D1/D2/A0 ; restore dirID/hint/name <23Aug90> BNE.S @dangling ; it's not there <23Aug90> @@ -489,7 +496,7 @@ FIDResolveID: BNE.S @dangling ; it's not <21Sep90> MOVEA.L A3, A1 ; the cname ptr - jsrROM UPDCNAME + jsrROM ROMUPDCNAME ; ex Put back "ROM" MOVEQ #0, D0 ; to be safe ; ; cleanup and exit @@ -577,7 +584,7 @@ FIDExchangeFiles: ; locate the source file, test for extents in extent file, and copy the cat record for later ; CLR.W extFlgsOff(A4) ; assume no extents in extents file - jsrROM LOCCREC ; A0, D0, D2 already set up from input + jsrROM ROMLOCCREC ; A0, D0, D2 already set up from input ex Put back "ROM" BNE @ExExit ; either CNode not there or io error CMPI.B #cdrFilRec, cdrType(A1); better be a file BNE @ExNotAFileErr @@ -608,7 +615,7 @@ FIDExchangeFiles: MOVE.L D7, D2 ; catalog hint MOVE.L destDIDOff(A4), D0 ; it's dir id MOVEA.L A3, A0 ; it's name - jsrROM LOCCREC ; keep the cat hint in D2 for the BTUpdate later + jsrROM ROMLOCCREC ; keep the cat hint in D2 for the BTUpdate later ex Put back "ROM" BNE @ExExit ; either CNode not there or io error (callee knows it's there!) CMPI.B #cdrFilRec, cdrType(A1); better be a file BNE @ExNotAFileErr @@ -689,14 +696,14 @@ FIDExchangeFiles: @ExGetOut MOVE.L D6, D2 ; catalog hint MOVEA.L A5,A0 ; it's name MOVE.L srcDIDOff(A4), D0 ; it's dir id - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" BNE @ExBusted LEA destCNode(A4), A0 ; from saved dest (A0) to memory src (A1) BSR CopyCNodeInfo MOVE.W VCBCtRef(A2), D0 - jsrROM BTUPDATE ; tell the btree + jsrROM ROMBTUPDATE ; tell the btree ex Put back "ROM" BNE @ExExit ; if there's an error, the catalog could be shot! ; @@ -705,14 +712,14 @@ FIDExchangeFiles: MOVE.L D7, D2 ; catalog hint MOVEA.L A3, A0 ; it's name MOVE.L destDIDOff(A4), D0 ; it's dir id - jsrROM LOCCREC ; keep cat hint in D2 for the BTUpdate later + jsrROM ROMLOCCREC ; keep cat hint in D2 for the BTUpdate later ex Put back "ROM" BNE @ExBusted LEA srcCNode(A4), A0 ; from saved src (A0) to memory dest (A1) BSR CopyCNodeInfo MOVE.W VCBCtRef(A2), D0 - jsrROM BTUPDATE ; tell the btree + jsrROM ROMBTUPDATE ; tell the btree ex Put back "ROM" BNE @ExExit ; if there's an error, the catalog could be shot! BRA.S @ExFinishUp @@ -757,8 +764,8 @@ FIDExchangeFiles: ; STEP 5: ALL DONE....ALMOST... ; @ExFinishErr - jsrROM CMFLUSH ; flush the catalog - jsrROM XFFLUSH ; flush the extent file (unneeded for common case, but it's cheap) + jsrROM ROMCMFLUSH ; flush the catalog ex Put back "ROM" + jsrROM ROMXFFLUSH ; flush the extent file (unneeded for common case, but it's cheap) MOVE.W #dskFulErr, D0 ; well, report the original error even if the flushes croaked. BRA.S @ExExit @ExNotAFileErr @@ -771,8 +778,8 @@ FIDExchangeFiles: ; @ExFinishUp MOVEQ #0, D0 ; no errors....yet... - jsrROM CMFLUSH ; flush the catalog - jsrROM XFFLUSH ; flush the extent file (unneeded for common case, but it's cheap) + jsrROM ROMCMFLUSH ; flush the catalog ex Put back "ROM" + jsrROM ROMXFFLUSH ; flush the extent file (unneeded for common case, but it's cheap) @ExExit ADD #lenFIDSwapVars,A6 ; de-allocate memory for CM vars MOVEM.L (A6)+, FIDExchRegs ; restore regs @@ -932,18 +939,18 @@ DeleteExts: @DXNxtDelete MOVEQ #0, D2 ; no hint (after BTDelete) <09Aug90> MOVE.W VCBXTRef(A2), D0 ; extents file refnum - jsrROM BTSEARCH ; search BTree for extent record + jsrROM ROMBTSEARCH ; search BTree for extent record ex Put back "ROM" CMP.W #BTNotFound, D0 BNE.S @DXExit ; has to be an ioerror! MOVEQ #0, D1 ; get what it's pointing at MOVE.W VCBXTRef(A2), D0 ; extents file refnum - jsrROM BTGETRECORD ; this is the first record we want for this file + jsrROM ROMBTGETRECORD ; this is the first record we want for this file ex Put back "ROM" BNE.S @DXBtErr CMP.L xkrFNum(A0), D6 BNE.S @DXExit ; Yippie!!! We're done! MOVE.W VCBXTRef(A2), D0 ; extent file's refnum - jsrROM BTDELETE ; and delete from btree (AO has key) + jsrROM ROMBTDELETE ; and delete from btree (AO has key) ex Put back "ROM" BNE.S @DXExit LEA tempKeyOff(A4), A0 ; look again @@ -1010,7 +1017,7 @@ extSize EQU lenxkr+lenxdr @MvNextBatch MOVE.W VCBXTRef(A2), D0 ; extents file refnum MOVEQ #0, D2 ; no hint - jsrROM BTSEARCH ; search BTree for extent record. + jsrROM ROMBTSEARCH ; search BTree for extent record. ex Put back "ROM" CMP.W #BtNotFound, D0 ; it won't exist the first time thru the loop BEQ.S @MvGoOn TST.W D0 @@ -1022,7 +1029,7 @@ extSize EQU lenxkr+lenxdr LEA extOff(A4), A3 ; extent ptr @MvNextRec MOVE.W VCBXTRef(A2), D0 ; extents file refnum - jsrROM BTGETRECORD ; this is the first record we want for this file + jsrROM ROMBTGETRECORD ; this is the first record we want for this file ex Put back "ROM" CMP.W #BtNotFound, D0 ; if xkrFNum(A0) is cleared on this error, then this test is bogus! BEQ.S @MvNoMoreExts TST.W D0 @@ -1050,7 +1057,7 @@ extSize EQU lenxkr+lenxdr MOVEQ #lenxdr, D1 ; data length @2 MOVE.L D7, xkrFNum(A0) ; change only the id in the key to dest ID MOVE.W VCBXTRef(A2), D0 ; extent file's refnum - jsrROM BTINSERT ; insert in btree + jsrROM ROMBTINSERT ; insert in btree ex Put back "ROM" BNE.S @MvBTInsertErr ADDA.W #extSize, A0 ADDA.W #extSize, A1 diff --git a/OS/HFS/Extensions/MakeFSSpec.a b/OS/HFS/Extensions/MakeFSSpec.a index b431382..77f271d 100644 --- a/OS/HFS/Extensions/MakeFSSpec.a +++ b/OS/HFS/Extensions/MakeFSSpec.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes. Reverted by +; saving ConsultCatalog registers on the normal stack. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: MakeFSSpec.a ; @@ -9,11 +17,6 @@ ; ; Change History (most recent first): ; -; 11/7/93 pdw ConsultCatalog was assuming totally synchronous behavior (i.e. -; it was using the A7 stack instead of A6). Changed register -; saving and return address handling to use HFS stack. -; 4/15/92 kc Removed the "ROM" prefix from the RomBind routines. -; • Pre-SuperMario comments follow • ; <12> 1/6/91 dnf (fjs) Add code to check for terminating ::'s on pathname ; parsing. ; <11> 9/22/90 dnf Add ExtOffLinCheck @@ -106,8 +109,7 @@ CopyCName: proc ConsultCatalog: proc ConsultCatalogRegs reg d2/a0/a1/a4 - move.l (SP)+,-(A6) ; save return address on A6 stack pdw - movem.l ConsultCatalogRegs,-(A6) ; pdw + movem.l ConsultCatalogRegs,-(sp) ; ex pdw lea.l FSSpec.name(a3), a0 ; a0 = ptr(CName) tst.b (a0) ; zero length name? bne.s @NotZeroLength @@ -116,7 +118,7 @@ ConsultCatalogRegs reg d2/a0/a1/a4 @NotZeroLength: move.l FSSpec.parID(a3), d0 ; move parID to input reg for GetCN move.l d7, d2 ; move catalog hint to input reg for CMGetCN - jsrROM CMGETCN ; go consult with the expert + jsrROM ROMCMGETCN ; go consult with the expert ex Put back "ROM" bne.s @Exit ; errors are good cause to leave move.l ckrParID(a0), FSSpec.parID(a3) ; set parID for directory name case @@ -128,9 +130,8 @@ ConsultCatalogRegs reg d2/a0/a1/a4 @Exit: move.l d2, d7 ; restore catalog hint - movem.l (A6)+, ConsultCatalogRegs ; pdw - move.l (A6)+,-(SP) ; Restore the return address pdw tst.w d0 ; set condition codes + movem.l (sp)+, ConsultCatalogRegs ; ex pdw rts endproc @@ -193,20 +194,20 @@ ConsultCatalogRegs reg d2/a0/a1/a4 ;_______________________________________________________________________ MakeFSSpec: proc export - jsrROM FSQUEUE + jsrROM ROMFSQUEUE ; ex Put back "ROM" - jsrROM DTRMV3 ; get at least the volume + jsrROM ROMDTRMV3 ; get at least the volume ex Put back "ROM" bne @Exit moveq.l #wrgVolTypErr, d0 ; assume the worst - jsrROM TFSVCBTST ; split HFS/MFS volumes + jsrROM ROMTFSVCBTST ; split HFS/MFS volumes ex Put back "ROM" bne @Exit ; go handle MFS in the compatibility layer moveq.l #0, d6 ; no input dirID move.l d6, d7 ; no catalog hint bset.b #SkipPMSP,HFSFlags ; Don't bother with PMSP for this operation - jsrROM FNDFILNAME ; parse things up + jsrROM ROMFNDFILNAME ; parse things up ex Put back "ROM" ; After FndFilName, registers are: ; a2 - vcb ptr @@ -322,7 +323,7 @@ MakeFSSpec: proc export clr.l (a1)+ ; clear the volume & high word of directory clr.l (a1)+ ; clear the directory & length byte of string @1: - jmpROM CMDDONE + jmpROM ROMCMDDONE ; ex Put back "ROM" endproc end diff --git a/OS/HFS/FileMgrPatches.a b/OS/HFS/FileMgrPatches.a index 031a236..ac51a42 100644 --- a/OS/HFS/FileMgrPatches.a +++ b/OS/HFS/FileMgrPatches.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted by putting back the "ROM" prefixes. Rolled in the 6/22/92 +; change that was made to the TFSRFN2.a version of ClosePatch: +; namely, disabled the patch with a short branch. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: FileMgrPatches.a ; @@ -274,48 +283,48 @@ BuildHFS70Init default 0 romAfterExtFSHook ROMBind (Plus,$029f2), (SE,$04434), (II,$07edc), (IIci,$0f0e0), (Portable, $096e0) romBTFlush ROMBind (Plus,$068c2), (SE,$08398), (II,$0be5c), (IIci,$13242), (Portable, $0d802) -BUILDKEY ROMBind (Plus,$065d8), (SE,$080a0), (II,$0BB64), (IIci,$12f40), (Portable, $0d50a) -BTDELETE ROMBind (Plus,$0671c), (SE,$081e6), (II,$0bcaa), (IIci,$13090), (Portable, $0d650) -BTGETRECORD ROMBind (Plus,$06928), (SE,$083fc), (II,$0bec0), (IIci,$132A6), (Portable, $0d866) -BTINSERT ROMBind (Plus,$069ea), (SE,$084b4), (II,$0bf78), (IIci,$1335E), (Portable, $0d91e) -BTSEARCH ROMBind (Plus,$06d4a), (SE,$0880c), (II,$0c2d0), (IIci,$136B6), (Portable, $0dc76) -BTUPDATE ROMBind (Plus,$06dd6), (SE,$08896), (II,$0c35a), (IIci,$13740), (Portable, $0dd00) -CACHERDIP ROMBind (Plus,$07b2a), (SE,$0967e), (II,$0d13e), (IIci,$1459C), (Portable, $0eb44) +ROMBUILDKEY ROMBind (Plus,$065d8), (SE,$080a0), (II,$0BB64), (IIci,$12f40), (Portable, $0d50a) ;ex Put back "ROM" +ROMBTDELETE ROMBind (Plus,$0671c), (SE,$081e6), (II,$0bcaa), (IIci,$13090), (Portable, $0d650) ;ex Put back "ROM" +ROMBTGETRECORD ROMBind (Plus,$06928), (SE,$083fc), (II,$0bec0), (IIci,$132A6), (Portable, $0d866) ;ex Put back "ROM" +ROMBTINSERT ROMBind (Plus,$069ea), (SE,$084b4), (II,$0bf78), (IIci,$1335E), (Portable, $0d91e) ;ex Put back "ROM" +ROMBTSEARCH ROMBind (Plus,$06d4a), (SE,$0880c), (II,$0c2d0), (IIci,$136B6), (Portable, $0dc76) ;ex Put back "ROM" +ROMBTUPDATE ROMBind (Plus,$06dd6), (SE,$08896), (II,$0c35a), (IIci,$13740), (Portable, $0dd00) ;ex Put back "ROM" +ROMCACHERDIP ROMBind (Plus,$07b2a), (SE,$0967e), (II,$0d13e), (IIci,$1459C), (Portable, $0eb44) ;ex Put back "ROM" romChgMFlLock ROMBind (Plus,$046de), (SE,$06812), (II,$0a2e8), (IIci,$11694), (Portable, $0bc7c) -CHKNODE ROMBind (Plus,$072c2), (SE,$08e22), (II,$0c8e6), (IIci,$13D42), (Portable, $0e2ec) +ROMCHKNODE ROMBind (Plus,$072c2), (SE,$08e22), (II,$0c8e6), (IIci,$13D42), (Portable, $0e2ec) ;ex Put back "ROM" romCkExtFS ROMBind (Plus,$03638), (SE,$050be), (II,$08b80), (IIci,$0fefa), (Portable, $0a4e2) romCkFilMod ROMBind (Plus,$0497a), (SE,$06420), (II,$09eec), (IIci,$11298), (Portable, $0b880) -CMDDONE ROMBind (Plus,$0295e), (SE,$043a0), (II,$07e48), (IIci,$0f04c), (Portable, $0964c) -CMFLUSH ROMBind (Plus,$06606), (SE,$080ce), (II,$0BB92), (IIci,$12f6e), (Portable, $0d538) -CMGETCN ROMBind (Plus,$06238), (SE,$07d04), (II,$0b7c8), (IIci,$12ba2), (Portable, $0d16e) -CMSETUP ROMBind (Plus,$065a0), (SE,$08068), (II,$0bb2c), (IIci,$12f06), (Portable, $0d4d2) +ROMCMDDONE ROMBind (Plus,$0295e), (SE,$043a0), (II,$07e48), (IIci,$0f04c), (Portable, $0964c) ;ex Put back "ROM" +ROMCMFLUSH ROMBind (Plus,$06606), (SE,$080ce), (II,$0BB92), (IIci,$12f6e), (Portable, $0d538) ;ex Put back "ROM" +ROMCMGETCN ROMBind (Plus,$06238), (SE,$07d04), (II,$0b7c8), (IIci,$12ba2), (Portable, $0d16e) ;ex Put back "ROM" +ROMCMSETUP ROMBind (Plus,$065a0), (SE,$08068), (II,$0bb2c), (IIci,$12f06), (Portable, $0d4d2) ;ex Put back "ROM" romCMUpdateCN ROMBind (Plus,$0656c), (SE,$08036), (II,$0bafa), (IIci,$12ed4), (Portable, $0d4a0) -CVFLGS ROMBind (Plus,$03a76), (SE,$05502), (II,$08FCA), (IIci,$10344), (Portable, $0a92c) +ROMCVFLGS ROMBind (Plus,$03a76), (SE,$05502), (II,$08FCA), (IIci,$10344), (Portable, $0a92c) ;ex Put back "ROM" romDtrmV1 ROMBind (Plus,$03650), (SE,$050e2), (II,$08ba4), (IIci,$0ff1e), (Portable, $0a50c) -DTRMV3 ROMBind (Plus,$03642), (SE,$050ce), (II,$08b90), (IIci,$0ff0a), (Portable, $0a4f8) -EXTOFFLINCK ROMBind (Plus,$04aba), (SE,$06560), (II,$0A02C), (IIci,$113d8), (Portable, $0b9c0) +ROMDTRMV3 ROMBind (Plus,$03642), (SE,$050ce), (II,$08b90), (IIci,$0ff0a), (Portable, $0a4f8) ;ex Put back "ROM" +ROMEXTOFFLINCK ROMBind (Plus,$04aba), (SE,$06560), (II,$0A02C), (IIci,$113d8), (Portable, $0b9c0) ;ex Put back "ROM" romFindDrive ROMBind (Plus,$03414), (SE,$04e9A), (II,$08956), (IIci,$0FC6C), (Portable, $0A258) -FNDFILNAME ROMBind (Plus,$04990), (SE,$06436), (II,$09f02), (IIci,$112ae), (Portable, $0b896) +ROMFNDFILNAME ROMBind (Plus,$04990), (SE,$06436), (II,$09f02), (IIci,$112ae), (Portable, $0b896) ;ex Put back "ROM" romFSAsync ROMBind (Plus,$02912), (SE,$04354), (II,$07dfc), (IIci,$0f000), (Portable, $09600) -FSQUEUESYNC ROMBind (Plus,$028a6), (SE,$042e8), (II,$07d90), (IIci,$0ef94), (Portable, $09594) -FSQUEUE ROMBind (Plus,$028aa), (SE,$042ec), (II,$07d94), (IIci,$0ef98), (Portable, $09598) +ROMFSQUEUESYNC ROMBind (Plus,$028a6), (SE,$042e8), (II,$07d90), (IIci,$0ef94), (Portable, $09594) ;ex Put back "ROM" +ROMFSQUEUE ROMBind (Plus,$028aa), (SE,$042ec), (II,$07d94), (IIci,$0ef98), (Portable, $09598) ;ex Put back "ROM" romGt1stMatch ROMBind (Plus,$04002), (SE,$05a9c), (II,$0955c), (IIci,$108d6), (Portable, $0aebe) romLocCNode ROMBind (Plus,$06678), (SE,$0813e), (II,$0BC02), (IIci,$12FDE), (Portable, $0d5a8) -LOCCREC ROMBind (Plus,$06698), (SE,$0815e), (II,$0bc22), (IIci,$12FFE), (Portable, $0d5c8) -LOCREC ROMBind (Plus,$07538), (SE,$0908c), (II,$0cb50), (IIci,$13FAC), (Portable, $0e556) +ROMLOCCREC ROMBind (Plus,$06698), (SE,$0815e), (II,$0bc22), (IIci,$12FFE), (Portable, $0d5c8) ;ex Put back "ROM" +ROMLOCREC ROMBind (Plus,$07538), (SE,$0908c), (II,$0cb50), (IIci,$13FAC), (Portable, $0e556) ;ex Put back "ROM" romMarkVCB ROMBind (Plus,$02d1e), (SE,$04766), (II,$0820e), (IIci,$0F524), (Portable, $09b10) romMarkVCBTime ROMBind (Plus,$02d20), (SE,$04768), (II,$08210), (IIci,$0F526), (Portable, $09b12) -POPCNAME ROMBind (Plus,$04288), (SE,$05d28), (II,$097EA), (IIci,$10b96), (Portable, $0b17e) -PUSHCNAME ROMBind (Plus,$04258), (SE,$05cf8), (II,$097BA), (IIci,$10b66), (Portable, $0b14e) +ROMPOPCNAME ROMBind (Plus,$04288), (SE,$05d28), (II,$097EA), (IIci,$10b96), (Portable, $0b17e) ;ex Put back "ROM" +ROMPUSHCNAME ROMBind (Plus,$04258), (SE,$05cf8), (II,$097BA), (IIci,$10b66), (Portable, $0b14e) ;ex Put back "ROM" romRfnCall ROMBind (Plus,$05352), (SE,$06e04), (II,$0a8c8), (IIci,$11C86), (Portable, $0c26e) -TFSVCBTST ROMBind (Plus,$04ec6), (SE,$06968), (II,$0a43e), (IIci,$117ea), (Portable, $0bdd2) -UPDCNAME ROMBind (Plus,$066c2), (SE,$0818c), (II,$0BC50), (IIci,$1302C), (Portable, $0d5f6) +ROMTFSVCBTST ROMBind (Plus,$04ec6), (SE,$06968), (II,$0a43e), (IIci,$117ea), (Portable, $0bdd2) ;ex Put back "ROM" +ROMUPDCNAME ROMBind (Plus,$066c2), (SE,$0818c), (II,$0BC50), (IIci,$1302C), (Portable, $0d5f6) ;ex Put back "ROM" romUpdRtCnts ROMBind (Plus,$065be), (SE,$08086), (II,$0BB4A), (IIci,$12f24), (Portable, $0d4f0) romUpdVCnts ROMBind (Plus,$065ae), (SE,$08076), (II,$0BB3A), (IIci,$12f14), (Portable, $0d4e0) -XFFLUSH ROMBind (Plus,$05ed0), (SE,$0799a), (II,$0B45E), (IIci,$1282a), (Portable, $0ce04) -GT1STFCB ROMBind (Plus,$03ff2), (SE,$05a8c), (II,$0954c), (IIci,$108c6), (Portable, $0aeae) -GTNXTFCB ROMBind (Plus,$03ffa), (SE,$05a94), (II,$09554), (IIci,$108ce), (Portable, $0aeb6) -FLUSHCACHE ROMBind (Plus,$076c6), (SE,$0921a), (II,$0ccdc), (IIci,$1413a), (Portable, $0e6e2) +ROMXFFLUSH ROMBind (Plus,$05ed0), (SE,$0799a), (II,$0B45E), (IIci,$1282a), (Portable, $0ce04) ;ex Put back "ROM" +ROMGT1STFCB ROMBind (Plus,$03ff2), (SE,$05a8c), (II,$0954c), (IIci,$108c6), (Portable, $0aeae) ;ex Put back "ROM" +ROMGTNXTFCB ROMBind (Plus,$03ffa), (SE,$05a94), (II,$09554), (IIci,$108ce), (Portable, $0aeb6) ;ex Put back "ROM" +ROMFLUSHCACHE ROMBind (Plus,$076c6), (SE,$0921a), (II,$0ccdc), (IIci,$1413a), (Portable, $0e6e2) ;ex Put back "ROM" ; The following addresses are needed for ROM B*Tree writecount patch: <2.3 kst> romBuildIRec ROMBind (Plus,$072a0), (SE,$08E00), (II,$0C8C4), (IIci,$13D20), (Portable,$0E2CA) @@ -581,8 +590,8 @@ A60DispTbl: proc ;________________________________________________________________________________ ; This routine was rolled into into the file TFS.a. VolumeCall: proc - jsrROM FSQUEUE ; Patiently wait our turn - jsrROM DTRMV3 ; Determine the volume being referred to + jsrROM ROMFSQUEUE ; Patiently wait our turn ex Put back "ROM" + jsrROM ROMDTRMV3 ; Determine the volume being referred to ex Put back "ROM" bne ToCmdDone ; Punt at the slightest hint of trouble move.l a2,ReqstVol ; Point to the volume being referred to @@ -602,7 +611,7 @@ VolumeCall: proc entry RefNumCall RefNumCall: import RefNumCheck - jsrROM FSQUEUE ; chill in line + jsrROM ROMFSQUEUE ; chill in line ex Put back "ROM" move.w ioRefNum(a0),d0 ; Pick up the refNum jsr RefNumCheck ; Check the refNum supplied bne ToCmdDone ; Punt at first hint of trouble @@ -629,7 +638,7 @@ RefNumCall: ; This routine was rolled into into the file TFS.a. entry UnknownCall UnknownCall: - jsrROM FSQUEUE ; Wait our turn + jsrROM ROMFSQUEUE ; Wait our turn ex Put back "ROM" ; movea.l VCBQHdr+qHead, a2 ; Pick up pointer to first VCB move.l a2, ReqstVol ; Point someplace semi-innocuous @@ -649,8 +658,8 @@ UnknownCall: entry OpenCall OpenCall: import OpenAttemptHook - jsrROM FSQUEUE ; Wait our turn - jsrROM DTRMV3 ; Determine the volume being referred to + jsrROM ROMFSQUEUE ; Wait our turn ex Put back "ROM" + jsrROM ROMDTRMV3 ; Determine the volume being referred to ex Put back "ROM" bne.s ToCmdDone ; Punt at the slightest hint of trouble move.l a2,ReqstVol ; Point to the volume being referred to @@ -658,10 +667,10 @@ OpenCall: beq.s ParamErrExit ; It's an unknown trap for a local volume bsr OpenAttemptHook ; let ourselves know we're trying <38> - jsrROM GT1STFCB ; get (A1,D1) pointing to first FCB + jsrROM ROMGT1STFCB ; get (A1,D1) pointing to first FCB ex Put back "ROM" @1 tst.l FCBFlNm(a1,d1) ; FCB unused beq.s @90 ; br if so - jsrROM GTNXTFCB ; get next one until we run out + jsrROM ROMGTNXTFCB ; get next one until we run out ex Put back "ROM" bcs.s @1 moveq.l #TMFOErr,d0 ; too many files open @@ -678,7 +687,7 @@ ParamErrExit: moveq.l #paramErr, d0 ; It's an unknown trap for a local volume ToCmdDone: - jmpROM CMDDONE ; And call it a day. + jmpROM ROMCMDDONE ; And call it a day. ex Put back "ROM" endproc @@ -771,17 +780,17 @@ OpenDF: proc SetFilLock: proc export export RstFilLock - JSRRom FSQUEUE ; wait our turn + JSRRom ROMFSQUEUE ; wait our turn ex Put back "ROM" ST FLckUnlck ; want to lock it BRA.S SRFLck RstFilLock: - jsrROM FSQUEUE + jsrROM ROMFSQUEUE ; ex Put back "ROM" CLR.B FLckUnlck SRFLck jsrROM romCkFilMod ; look for file and see if we can mod it ; (doesn't return on errors) - JSRROM TFSVCBTST ; Are we dealing with a TFS volume? <01Oct85> + JSRROM ROMTFSVCBTST ; Are we dealing with a TFS volume? <01Oct85> ex Put back "ROM" BNEROM romChgMFlLock ; Nope - do it the old fashioned way MOVEQ #FNFErr,D0 ; Expect the worst CMP.B #cdrFilRec,cdrType(A5) ; Is this a file entry? @@ -804,7 +813,7 @@ SRFLXit1 MOVE.L D7,D2 ; Get a hold of the catalog hint BRA.S SRFLXit3 ; If EQ, we're all set. SRFLXit2 MOVEQ #0,D0 -SRFLXit3 jmpROM CMDDONE +SRFLXit3 jmpROM ROMCMDDONE ; ex Put back "ROM" endproc @@ -823,7 +832,7 @@ GetParallelFCBFromRefnum proc export import ParallelFCBFromRefnum import RefNumCheck - jsrROM FSQUEUE ; wait our turn + jsrROM ROMFSQUEUE ; wait our turn ex Put back "ROM" move.w ioRefNum(a0),d0 ; Get the file reference number move.w d0,d1 ; Keep a copy in another register @@ -835,7 +844,7 @@ GetParallelFCBFromRefnum proc export move.l a1,ioFDirIndex(a0) ; Return the pointer in ioMisc moveq #noErr,d0 ; No error @exitGetParallelFCB - jmpROM CMDDONE ; outa here + jmpROM ROMCMDDONE ; outa here ex Put back "ROM" endproc ;________________________________________________________________________________ @@ -907,6 +916,15 @@ ClosePatch PatchProc _Close movem.l @ClosePatchRegs,-(sp) ; save regs we use movea.l sp,a2 ; for safe, quick stack pointer restore + ; : + ; *** NOTE: THIS PATCH IS DISABLED *** ; + ; This patch was broken in System 7, and fixed with change <53>. The fix ; + ; causes some third-party applications (QuicKeys, Retrospect Remote) to stop ; + ; working because they are unable to close files. For Cube-E, we’ll re-break this ; + ; patch and revisit the entire issue later. ; + ; + bra.s @DoClosePop ; <58> Disable this patch ; + ; check the refnum for validity. and locate the parallel FCB array element move.w ioRefNum(a0),d0 ; get refnum being closed bsr RefNumCheck ; is it legit? @@ -1063,7 +1081,7 @@ AccumulateDiskSwitchRectIntoUpdateRect comefrompatchproc _SetPort, DSExit ; Here we fix case 1 - rename of a volume. Fixed at the head of Rename: ; This patch was rolled into TFSDIR2.a FixVolumeRenames PatchProc _Rename - jsrROM FSQUEUE ; what a queue command! + jsrROM ROMFSQUEUE ; what a queue command! ex Put back "ROM" move.l ioNewName(a0),d2 ; check out the new name jsrROM DtrmV2 ; find what volume the new name is on @@ -1079,7 +1097,7 @@ FixVolumeRenames PatchProc _Rename RNmVol: cmp.w #nsvErr,d0 ; make sure it's no-such-vol error - bneROM CMDDONE + bneROM ROMCMDDONE ; ex Put back "ROM" tst.w d2 ; name length should be zero bne.s BadNewNam RNmVol1: @@ -1088,25 +1106,25 @@ RNmVol1: jmpROM RNmVol1 ; go let'em do it like they used to tst.w d3 ; Volume name must have been specified - beqROM CMDDONE - jsrROM DTRMV3 ; Check source volume - bneROM CMDDONE ; Punt if no such thing - jsrROM CVFLGS ; Can it be modified? - bneROM CMDDONE ; Nope - punt now. - jsrROM TFSVCBTST ; Is it a TFS volume? + beqROM ROMCMDDONE ; ex Put back "ROM" + jsrROM ROMDTRMV3 ; Check source volume ex Put back "ROM" + bneROM ROMCMDDONE ; Punt if no such thing ex Put back "ROM" + jsrROM ROMCVFLGS ; Can it be modified? ex Put back "ROM" + bneROM ROMCMDDONE ; Nope - punt now. ex Put back "ROM" + jsrROM ROMTFSVCBTST ; Is it a TFS volume? ex Put back "ROM" beq.s @checkExtFS ; Yes - make sure it's not ext. FS tst.w vcbDrvNum(a2) ; Volume on-line? - beqROM CMDDONE ; No - just forget it + beqROM ROMCMDDONE ; No - just forget it ex Put back "ROM" jmpROM RNMVol@70 ; Yes - go and rename it @checkExtFS: - jsrROM EXTOFFLINCK ; Our file system, on-line volume? - bneROM CMDDONE ; If not, get out now + jsrROM ROMEXTOFFLINCK ; Our file system, on-line volume? ex Put back "ROM" + bneROM ROMCMDDONE ; If not, get out now ex Put back "ROM" jmpROM RNMVol@70 ; Otherwise, same as ever BadNewNam: moveq.l #bdNamErr,d0 ; get the error code - jmpROM CMDDONE ; outa here + jmpROM ROMCMDDONE ; outa here ex Put back "ROM" endproc @@ -1115,12 +1133,12 @@ BadNewNam: ; bugs where we formerly didn’t rename the root directory and allowed a '' name. SetVolInfoPatch proc - jsrROM FSQUEUE ; Wait our turn + jsrROM ROMFSQUEUE ; Wait our turn ex Put back "ROM" jsrROM romDtrmV1 ; Determine volume by drvnum/refnum bne SVIDone ; Punt on errors - jsrROM CVFLGS ; Check if volume can be modified + jsrROM ROMCVFLGS ; Check if volume can be modified ex Put back "ROM" bne SVIDone ; Give up easily - jsrROM EXTOFFLINCK ; Check if volume is on-line, non ext. FS + jsrROM ROMEXTOFFLINCK ; Check if volume is on-line, non ext. FS ex Put back "ROM" bne SVIDone ; Be a wimp - give up now. move.l ioVNPtr(a0),d2 ; New name specified? @@ -1166,7 +1184,7 @@ SetUserFields: move.l ioVNPtr(a0), d1 ; grab ptr to caller's name - jsrROM TFSVCBTST ; Is it a TFS volume? + jsrROM ROMTFSVCBTST ; Is it a TFS volume? ex Put back "ROM" bne.s @skipHFS ; br if not - MFS VCBs don't have this info move.l ioVClpSiz(a0),vcbClpSiz(a2) ; Volume clump size move.l ioVBkup(a0),vcbVolBkup(a2) ; Last backup date @@ -1187,7 +1205,7 @@ SetUserFields: move.b d0, (a1)+ ; jam our length byte _BlockMove ; change the name - jsrROM TFSVCBTST ; Are we dealing with an MFS volume? + jsrROM ROMTFSVCBTST ; Are we dealing with an MFS volume? ex Put back "ROM" bne.s @skipRootRename ; if so, no root to rename ; rename the root @@ -1204,7 +1222,7 @@ SetUserFields: moveq.l #noErr,d0 ; All went well... SVIDone: - jmpROM CMDDONE + jmpROM ROMCMDDONE ; ex Put back "ROM" endproc ;__________________________________________________________________________________ @@ -1301,12 +1319,12 @@ myCMSetUp PatchProc jCMSetup,(Plus,SE,II,IIci,Portable) @BugOut ; clean up A6 & A7 stacks and jump back to rom addq.w #4,A7 ; remove return addr to Rename move.l (A6)+,D2 ; recover rounded string length - jsrRom POPCNAME ; remove name from A6 stack + jsrRom ROMPOPCNAME ; remove name from A6 stack ex Put back "ROM" @RNmExit cmp.w #BTExists,D0 ; B*-Tree error? bne.s @FinalExit moveq #dupFNErr,D0 ; If entry exists, give better error code -@FinalExit jmpRom CMDDONE ; and now back to our regularly scheduled broadcast... +@FinalExit jmpRom ROMCMDDONE ; and now back to our regularly scheduled broadcast... ex Put back "ROM" ; CMSvcs calls "MarkVCBTime", which only set the mod time but doesn't mark VCB dirty. @@ -1521,7 +1539,7 @@ dirCreateTrapWord equ selectDirCreate suba.l a0, a0 ; go after the parent move.l (a6)+,d0 ; retrieve target parent directory - jsrROM LOCCREC + jsrROM ROMLOCCREC ; ex Put back "ROM" bne.s @dirNotFound cmpi.b #cdrThdRec,cdrType(a1) ; is it a directory thread? beq.s @fileNotFound ; yes, so it was just the leaf that was missing @@ -1664,7 +1682,7 @@ OpenAttemptHook: proc ; This patch was rolled into TFSDIR1.a PreflightFileOpen proc - jsrROM FSQUEUE ; serialize things + jsrROM ROMFSQUEUE ; serialize things ex Put back "ROM" bsr OpenAttemptHook ; tell'em we're trying ST RegRsrc ; open regular part of file <39> jmpROM FOpen1 @@ -1685,7 +1703,7 @@ PreflightFileOpen proc ; This patch was rolled into TFSDIR1.a PreflightOpenRF PatchProc _OpenRF - jsrROM FSQUEUE ; serialize things + jsrROM ROMFSQUEUE ; serialize things ex Put back "ROM" bsr OpenAttemptHook ; tell'em we're trying clr.b RegRsrc ; open resource part of file <39> jmpROM FOpen1 @@ -1733,7 +1751,7 @@ PreflightOpenRF PatchProc _OpenRF AllocateFCBs proc import MoreFCBs - jsrROM FSQUEUE ; wait our turn + jsrROM ROMFSQUEUE ; wait our turn ex Put back "ROM" moveq.l #-1,d0 ; more FCBs than we'll ever have bsr CountFCBs ; count all of them @@ -1757,7 +1775,7 @@ AllocateFCBs proc move.w d3,d2 ; otherwise, just grow as much as we can @grow: - bsr MoreFCBs ; try to get the FCBs + jsr MoreFCBs ; try to get the FCBs ex Put back "ROM" beq.s @gotSome ; leave with a smile asr.w #1,d2 ; try to get half that many @@ -1778,7 +1796,7 @@ AllocateFCBs proc beq.s @noFCBsAvailable ; if none are left, report the problem moveq.l #noErr,d0 ; if some are left, we're happy -@exit: jmpROM CMDDONE +@exit: jmpROM ROMCMDDONE ; ex Put back "ROM" @noFCBsAvailable: moveq.l #tmfoErr,d0 @@ -1945,7 +1963,7 @@ FixDtrmV3: PatchProc jDtrmV3,(II,IIci,Portable) ; This patch was rolled into TFSVOL.a MountVolFor1991 PatchProc _MountVol - jsrROM FSQUEUESYNC + jsrROM ROMFSQUEUESYNC ; ex Put back "ROM" movea.l a0, a5 ; save caller's pb move.w ioDrvNum(a5), d2 ; where FindDrive likes it @@ -2030,7 +2048,7 @@ Remount: move.w d2,vcbDrvNum(a2) ; drive number move.w d1,vcbDRefNum(a2) ; driver RefNum - jsrROM TFSVCBTST ; remounted a TFS volume? <32> + jsrROM ROMTFSVCBTST ; remounted a TFS volume? <32> ex Put back "ROM" bne.s NoErrExit ; Nope - don't mess with the MDB <33> btst.b #vcbWrProt,vcbAtrb+1(a2); Is volume write protected? <32> bne.s NoErrExit ; If so, don't try to flush the MDB <33> @@ -2053,7 +2071,7 @@ EarlyExit: btst.b #fsNoAllocate, FSVars.fsFlags(a1) beqROM OldMtVolAfterFSQueue ; join the ROM (BTW, skipping the _Offline heroics) @1: - jmpROM CMDDONE + jmpROM ROMCMDDONE ; ex Put back "ROM" endproc ;_______________________________________________________________________ @@ -2076,18 +2094,18 @@ EarlyExit: ; These patches were rolled into TFSVOL.a NoCloseOnOffline PatchProc _Offline import OfflineEjectCommon - jsrROM FSQUEUESYNC ; wait until all current calls are done + jsrROM ROMFSQUEUESYNC ; wait until all current calls are done ex Put back "ROM" st NoEject ; -1 = send offline but don't eject jmp OfflineEjectCommon ; share code with Eject endproc NoCloseOnEject PatchProc _Eject export OfflineEjectCommon - jsrROM FSQUEUESYNC ; wait until all current calls are done + jsrROM ROMFSQUEUESYNC ; wait until all current calls are done ex Put back "ROM" clr.b NoEject ; 0 = offline + eject OfflineEjectCommon - jsrROM DTRMV3 ; check name, drive number, etc. + jsrROM ROMDTRMV3 ; check name, drive number, etc. ex Put back "ROM" bne.s ejectNotMounted ; br if drive not mounted (why flush?) jsrROM romCkExtFS ; see if it's for an external fs bne.s EjectDone ; exit if so @@ -2103,7 +2121,7 @@ ejectDrvNum: beqROM EjectIt ; OK, OK; it's going already... ejectDone: - jmpROM CMDDONE ; we're done . . . + jmpROM ROMCMDDONE ; we're done . . . ex Put back "ROM" ejectMounted: lea.l vcbDrvNum(a2),a1 ; point into VCB at drive number @@ -2138,13 +2156,13 @@ ejectOnLine: @5: st FlushOnly ; only flushing (don't close . . .) jsrROM FlushVFiles ; flush all files on this volume - jsrROM TFSVCBTST ; Are we dealing with a TFS volume? + jsrROM ROMTFSVCBTST ; Are we dealing with a TFS volume? ex Put back "ROM" bneROM OfflineEjectCallsMFSFlush ; Nope, so join ROM to do MFS right ; note that the following line is the opposite of the ROM code. We only want to flush ; these files, since _Unmount will close them later. However, we do want to mark the ; vcb consistent as it goes offline. - jsrROM CVFLGS ; Is volume write protected? <31> + jsrROM ROMCVFLGS ; Is volume write protected? <31> ex Put back "ROM" bne.s @1 ; If so, don't try to mark it dirty <31> bset.b #vcbAtVOK,vcbAtrb(a2) ; Indicate vol was unmounted ok <31> jsrROM MarkVCBDirty ; mark VCB dirty so it will be written <31> @@ -2240,15 +2258,15 @@ DesktopCloseDownProc: proc ;_______________________________________________________________________ UnmountForTheNineties: PatchProc _UnMountVol - bsr DesktopCloseDownProc ; go take care of the desktop database <36> + jsr DesktopCloseDownProc ; go take care of the desktop database <36> ex ; The desktop file hack should no longer be necessary for the 7.0 version of the AppleShare client. IncludeAppleShareDesktopHack equ 0 - jsrROM FSQUEUESYNC ; Get in sync... + jsrROM ROMFSQUEUESYNC ; Get in sync... ex Put back "ROM" clr.b FlushOnly ; Setup same as UnmountVol - jsrROM DTRMV3 ; Call DtrmV3 to do setup stuff - bneROM CMDDONE ; and split on errors + jsrROM ROMDTRMV3 ; Call DtrmV3 to do setup stuff ex Put back "ROM" + bneROM ROMCMDDONE ; and split on errors ex Put back "ROM" moveq #0,d0 ; Initialize result code btst #HFSBit,ioTrap(a0) ; Unconditional unmount? @@ -2292,19 +2310,19 @@ IncludeAppleShareDesktopHack equ 0 @5 movem.l (sp)+,a1/d1/d2 ; Restore regs tst.w d0 ; Were files open? - bneROM CMDDONE ; and quit on errors + bneROM ROMCMDDONE ; and quit on errors ex Put back "ROM" FlUnMnt: jsrROM romCkExtFS ; see if it's for an external fs - bneROM CMDDONE ; and split on errors + bneROM ROMCMDDONE ; and split on errors ex Put back "ROM" jsrROM FlushVFiles ; flush all files on this volume - bneROM CMDDONE ; and split on errors + bneROM ROMCMDDONE ; and split on errors ex Put back "ROM" ; All files on this volume are flushed now. Update the volume information as ; appropriate, depending on the file structure: - jsrROM TFSVCBTST ; is this a TFS volume? + jsrROM ROMTFSVCBTST ; is this a TFS volume? ex Put back "ROM" beq.s @1 ; br if so jmpROM FlUnMntAfterMFSCheck ; the ROM has is right for MFS volumes @@ -2342,7 +2360,7 @@ BackInFlUnMnt: moveq.l #noErr,d0 ; no error FlVolExit - jmpROM CMDDONE + jmpROM ROMCMDDONE ; ex Put back "ROM" endproc @@ -3029,7 +3047,7 @@ ProcessMgrExists proc export TagFileWithPSN ; Open traps can be (and are!) called before Process Mgr is init'd - bsr ProcessMgrExists ; is Process Mgr ready? + jsr ProcessMgrExists ; is Process Mgr ready? ex Put back "ROM" bne.s @CantRecord ; Process Mgr is not ready yet ; find the current PSN @@ -3089,7 +3107,7 @@ FSCleanupRegs REG A2-A3/D2-D6 MOVE cbPBufULen(A2),D4 ; D4=ext. FCB unit size LEA fcbPBufData(A2),A2 ; A2=ext. fcb array MOVE FSFCBLen,D5 ; D5=FCB len - jsrROM GT1STFCB ; A1=FCB, D1=1st RefNum + jsrROM ROMGT1STFCB ; A1=FCB, D1=1st RefNum ex Put back "ROM" ; First close all the open files belong to this process: ; A1=FCBptr, A2=Ext. FCBptr, D1.W=RefNum, D2=id2, D3.W=loop index, @@ -3187,8 +3205,8 @@ clearPB MOVEA.L A0,A3 ; A3=A0=iopb ;_______________________________________________________________________________________ ; This patch was rolled into TFSVOL.a OpenWDPatch Proc export - jsrROM FSQUEUE ; Wait for our turn to come - jsrROM FNDFILNAME ; Look for the indicated directory + jsrROM ROMFSQUEUE ; Wait for our turn to come ex Put back "ROM" + jsrROM ROMFNDFILNAME ; Look for the indicated directory ex Put back "ROM" BEQ.S @1 ; Br if found CMP.W #BdNamErr,D0 ; Was it a bad filename? <21Sep85> BNE.S opnWDExit ; If not, there's no more hope <21Sep85> @@ -3211,7 +3229,7 @@ OpenWDPatch Proc export @2 MOVE.W VCBVRefNum(A2),ioVRefNum(A0) ; Return the VRefNum as WDRfn <21Sep85> opnWDOK MOVEQ #0,D0 ; Call it a success <21Sep85> -opnWDExit jmpROM CMDDONE ; we're finished . . . +opnWDExit jmpROM ROMCMDDONE ; we're finished . . . ex Put back "ROM" ; Look for a matching working directory, starting with the third (the first two are ; reserved to hold the system-wide volume and directory defaults). @@ -4018,7 +4036,7 @@ DontTruncateMultiForks ComeFromPatchProc $A0DB,,(Plus,SE,II,Portable,IIci) ; <11 MOVE.L FCBFlNm(A1,D3.W),D2 ; D2.L = our file number <11Dec90 #17> move.b fcbMdRByt(a1,d3.w),d4 ; d4.b = our fork's misc info <44> - jsrROM GT1STFCB ; get (A1,D1) pointing to first FCB <11Dec90 #17> + jsrROM ROMGT1STFCB ; get (A1,D1) pointing to first FCB <11Dec90 #17> ex Put back "ROM" @1 CMP.W D1,D3 ; same FCB? <11Dec90 #17> BEQ.S @3 ; skip ourself if it is <11Dec90 #17> CMP.L FCBFlNm(A1,D1),D2 ; file numbers match? <11Dec90 #17> @@ -4029,7 +4047,7 @@ DontTruncateMultiForks ComeFromPatchProc $A0DB,,(Plus,SE,II,Portable,IIci) ; <11 eor.b d4,d0 ; see how it compares against ours <44> btst.l #fcbRscBit,d0 ; are we the same? <44> beq.s @7 ; if so, then there's another open path <44> -@3 jsrROM GTNXTFCB ; get next one until we run out <11Dec90 #17> +@3 jsrROM ROMGTNXTFCB ; get next one until we run out <11Dec90 #17> ex Put back "ROM" BCS.S @1 ; continue if more <11Dec90 #17> ; No second open path found, so do the truncate @@ -4741,7 +4759,7 @@ BDUpdDepth MOVEQ #0,D1 ; locate key and data for 1st record <10Oct85> MOVEA.L A3,A1 ; - jsrRom LOCREC ; ... in node <10Oct85> + jsrRom ROMLOCREC ; ... in node <10Oct85> ex Put back "ROM" MOVE.L (A1),BTCRoot(A4) ; new root = child node <10Oct85> ; ; release the previous root node @@ -4905,13 +4923,13 @@ GetVolParms: proc export @GetVolRegs reg d2/d3/a1-a4 bclr #asyncTrpBit, ioTrap(a0) ; force synchronous (wrong. See note, above) - jsrRom FSQUEUE ; Patiently wait our turn in line + jsrRom ROMFSQUEUE ; Patiently wait our turn in line ex Put back "ROM" movem.l @GetVolRegs, -(a6) ; save regs on FS stack suba.w @VolParmsBufferSize, a6 ; allocate a GetVolParms buffer on the stack ; ; Find the VCB in question: ; - jsrRom DTRMV3 ; find vol using ioNamePtr & ioVRefNum (D023/A234 trashed) + jsrRom ROMDTRMV3 ; find vol using ioNamePtr & ioVRefNum (D023/A234 trashed) ex Put back "ROM" bne.s @GetVolParmsExit ; (DtrmV3 puts VCBPtr in A2) tst.w vcbFSID(a2) ; Check: external file system? (•• TFSVCBTst?) @@ -4961,7 +4979,7 @@ GetVolParms: proc export @GetVolParmsExit: movem.l (a6)+, @GetVolRegs ; restore regs - jmpROM CMDDONE ; Go home + jmpROM ROMCMDDONE ; Go home ex Put back "ROM" ; This buffer contains the appropriate values for local HFS volumes. @HFSVolParmsBuffer: @@ -5057,7 +5075,7 @@ WriteCountInit MOVE.L VCBQHdr+QHead,D0 ; search the VCB queue BEQ.S wcEndq ; br if end of queue reached CkVol: MOVE.L D0,A2 ; next VCB pointer - jsrRom TFSVCBTST ; is this a HFS volume? + jsrRom ROMTFSVCBTST ; is this a HFS volume? ex Put back "ROM" BNE.S @6 ; No, don't bother TST vcbFSID(A2) ; internal HFS? (do we need to test this?) BNE.S @6 ; No, don't bother @@ -5121,7 +5139,7 @@ GrowFileSystemStack: moveq.l #0,d0 ; use selector 0 move.w #$a060,d1 ; and pretend we're trap _HFSDispatch - jsrROM FSQUEUE ; and sync up with the file system + jsrROM ROMFSQUEUE ; and sync up with the file system ex Put back "ROM" ; first we use the old equate to get the pointer block's base address move.l HFSStkTop,a0 ; current stack top @@ -5136,7 +5154,7 @@ GrowFileSystemStack: move.l a0,HFSStkTop ; Store pointer in lo-mem moveq.l #noErr,d0 ; success! - jmpROM CMDDONE + jmpROM ROMCMDDONE ; ex Put back "ROM" @bail: moveq.l #dsMemFullErr, d0 ; sys heap is full, so punt @@ -5237,7 +5255,7 @@ InstallVectors PROC export leaResident vAfterFSQHook, a0 ; get addr just past call to fsQueueHook (in fsQueueHook patch) move.l a0, ExpandMemRec.jAfterFSQHook(a1) - leaROM CMDDONE , a0 ; get addr of CmdDone (still in ROM) + leaROM ROMCMDDONE, a0 ; get addr of CmdDone (still in ROM) ex Put back "ROM" move.l a0, ExpandMemRec.jCmdDone(a1) leaResident fsGeneralWakeUp, a0 ; get addr of general purpose File System kickstart move.l a0, ExpandMemRec.jDispatchNext(a1) diff --git a/OS/HFS/HFS.make b/OS/HFS/HFS.make index 9e8c424..7eb9c2d 100644 --- a/OS/HFS/HFS.make +++ b/OS/HFS/HFS.make @@ -1,3 +1,14 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Removed TFS.a (i.e. HFS) from the lpch build altogether -- all the +# supported ROMs have it. Moved DiskCache.a back from the lpch to ptch 41. +# Removed BTreeMgr.lib from here, to be included in the lpch build +# elsewhere. Added (Later)FileMgrPatches.a and CMSvcsExtras.a back to the +# lpch build. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: HFS.make # @@ -19,36 +30,42 @@ HFSBTreeDir = {HFSExtensionsDir}BTreeMgr: #include {HFSBTreeDir}BTreeMgr.Make -HFSObjs = "{LibDir}BTreeMgr.lib" ∂ +HFSObjs = ∂ "{ObjDir}BTAlloc.a.o" ∂ "{ObjDir}BTMaint1.a.o" ∂ "{ObjDir}BTMaint2.a.o" ∂ - "{ObjDir}BTSVCS.a.o" ∂ - "{ObjDir}QMgr.a.o" ∂ - "{ObjDir}cache.a.o" ∂ - "{ObjDir}TFS.a.o" ∂ - "{ObjDir}cacheio.a.o" ∂ - "{ObjDir}cmmaint.a.o" ∂ - "{ObjDir}cmsvcs.a.o" ∂ - "{ObjDir}FXM.a.o" ∂ - "{ObjDir}ExternalMakeFSSpec.a.o" ∂ "{ObjDir}BTPScan.a.o" ∂ + "{ObjDir}BTSVCS.a.o" ∂ + "{ObjDir}cache.a.o" ∂ + "{ObjDir}cacheio.a.o" ∂ "{ObjDir}CacheControl.a.o" ∂ "{ObjDir}CatSearch.a.o" ∂ + "{ObjDir}cmmaint.a.o" ∂ + "{ObjDir}cmsvcs.a.o" ∂ + "{ObjDir}CMSvcsExtras.a.o" # ∂ + "{ObjDir}DTDBMgr.a.o" ∂ + "{ObjDir}ExternalMakeFSSpec.a.o" ∂ + "{ObjDir}FileMgrPatches.a.o" # ∂ + "{ObjDir}LaterFileMgrPatches.a.o" # ∂ "{ObjDir}FileIDs.a.o" ∂ "{ObjDir}FileIDsSvcs.a.o" ∂ "{ObjDir}FSpDispatch.a.o" ∂ "{ObjDir}FSSpecCalls.c.o" ∂ + "{ObjDir}FXM.a.o" ∂ "{ObjDir}MakeFSSpec.a.o" ∂ + "{ObjDir}QMgr.a.o" ∂ "{ObjDir}vsm.a.o" ∂ - "{ObjDir}DTDBMgr.a.o" ∂ - "{ObjDir}DiskCache.a.o" "{LibDir}HFS.lib" ƒ {HFSObjs} Lib {StdLibOpts} -o "{Targ}" {HFSObjs} +# +"{RsrcDir}DiskCache.a.rsrc" ƒ "{ObjDir}DiskCache.a.o" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{ObjDir}DiskCache.a.o" + + "{ObjDir}BTAlloc.a.o" ƒ "{ObjDir}StandardEqu.d" ∂ "{AIncludes}SonyEqu.a" ∂ "{HFSDir}BTAlloc.a" @@ -212,3 +229,16 @@ HFSObjs = "{LibDir}BTreeMgr.lib" ∂ "{IntAIncludes}DiskCachePriv.a" ∂ "{IntAIncludes}FileMgrPrivate.a" Asm {StdAOpts} -o "{Targ}" "{HFSCacheDir}DiskCache.a" + + +# +"{ObjDir}CMSvcsExtras.a.o" ƒ "{HFSExtensionsDir}CMSvcsExtras.a" + Asm {StdAOpts} -o "{Targ}" "{HFSExtensionsDir}CMSvcsExtras.a" + +# +"{ObjDir}FileMgrPatches.a.o" ƒ "{HFSDir}FileMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" -d SonyNonPortable -i "{HFSDir}Extensions:" "{HFSDir}FileMgrPatches.a" + +# +"{ObjDir}LaterFileMgrPatches.a.o" ƒ "{HFSDir}LaterFileMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{HFSDir}LaterFileMgrPatches.a" diff --git a/OS/MMU/MMU.make b/OS/MMU/MMU.make index 93d3d2c..10a5690 100644 --- a/OS/MMU/MMU.make +++ b/OS/MMU/MMU.make @@ -1,3 +1,10 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added rule for MMUPatches.a, which is separately linked into the lpch. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: MMU.Make # @@ -49,3 +56,8 @@ MMUObjs = "{ObjDir}MMU.a.o" ∂ Asm {StdAOpts} -o "{Targ}" "{MMUDir}GetReal.a" +# +"{ObjDir}MMUPatches.a.o" ƒ "{MMUDir}MMUPatches.a" + Asm {StdAOpts} -o "{Targ}" "{MMUDir}MMUPatches.a" + + diff --git a/OS/PPC/PPCDsp.c b/OS/PPC/PPCDsp.c new file mode 100644 index 0000000..d6cf86d --- /dev/null +++ b/OS/PPC/PPCDsp.c @@ -0,0 +1,491 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Decompiled from scratch +*/ + +#ifndef __TYPES__ +#include +#endif + +#ifndef __FILES__ +#include +#endif + +#ifndef __MEMORY__ +#include +#endif + +#ifndef __ERRORS__ +#include +#endif + +#ifndef __RESOURCES__ +#include +#endif + +#ifndef __TOOLUTILS__ +#include +#endif + +#ifndef __OSUTILS__ +#include +#endif + +#ifndef __DEVICES__ +#include +#endif + +#ifndef __POWER__ +#include +#endif + +#include +#include "UserGroup.h" + +#ifndef __APPLETALK__ +#include +#endif + +#ifndef __ADSP__ +#include "ADSP.h" +#endif + +#ifndef __PPCTOOLBOX__ +#include +#endif + +#ifndef __STDDEF__ +#include +#endif + +#include "PPCCommon.h" + + +OSErr OpenADSPDriver(short *refNum) //26cc4 +{ +// ROM:00126CC4 link a6,#0 +// ROM:00126CC8 subq.l #2,sp +// ROM:00126CCA pea unk_126CDC +// ROM:00126CCE move.l 8(a6),-(sp) +// ROM:00126CD2 ori.b #$D7,d0 +// ROM:00126CD6 move.w (sp)+,d0 +// ROM:00126CD8 unlk a6 +// ROM:00126CDA rts + return OpenDriver("\p.DSP", refNum); +} + +OSErr CreateConnectionListener(Ptr ccbPtr, //8 + DSPParamBlock *dsp, //c + unsigned short dspDrvrRef, //10 + unsigned char socket, //12 + Boolean async, //14 + ProcPtr compRoutine) //16 //26ce2 +{ +// ROM:00126CE2 +// ROM:00126CE2 link a6,#0 +// ROM:00126CE6 movem.l a3-a4,-(sp) +// ROM:00126CEA movea.l $C(a6),a3 +// ROM:00126CEE lea $22(a3),a4 +// ROM:00126CF2 move.w $12(a6),$18(a3) +// ROM:00126CF8 move.w #$FB,$1A(a3) +// ROM:00126CFE move.l $1C(a6),$C(a3) +// ROM:00126D04 move.l 8(a6),(a4) +// ROM:00126D08 moveq #0,d0 +// ROM:00126D0A move.l d0,4(a4) +// ROM:00126D0E clr.w 8(a4) +// ROM:00126D12 clr.w $E(a4) +// ROM:00126D16 move.l d0,$A(a4) +// ROM:00126D1A move.l d0,$10(a4) +// ROM:00126D1E move.l d0,$14(a4) +// ROM:00126D22 move.b $17(a6),$18(a4) +// ROM:00126D28 move.l a3,-(sp) +// ROM:00126D2A subq.l #2,sp +// ROM:00126D2C move.l a3,-(sp) +// ROM:00126D2E move.b $1B(a6),-(sp) +// ROM:00126D32 ori.b #$DF,d5 +// ROM:00126D36 move.w (sp)+,d0 +// ROM:00126D38 ext.l d0 +// ROM:00126D3A move.l d0,-(sp) +// ROM:00126D3C ori.b #$20,d0 ; jsr DMFix +// ROM:00126D40 movem.l -8(a6),a3-a4 +// ROM:00126D46 unlk a6 +// ROM:00126D48 rts + struct TRinitParams *params = &(dsp->u.initParams); + + dsp->ioCRefNum = dspDrvrRef; + dsp->csCode = dspCLInit; + dsp->ioCompletion = compRoutine; + + params->ccbPtr = ccbPtr; + params->userRoutine = NULL; + params->sendQSize = 0; + params->recvQSize = 0; + params->sendQueue = NULL; + params->recvQueue = NULL; + params->attnPtr = NULL; + params->localSocket = socket; + + return DMFix(PBControl(dsp, async), dsp); +} + +OSErr ListenConnectionRequest(DSPParamBlock *dsp, + Boolean async, + ProcPtr compRoutine) //26d4a +{ +// ROM:00126D4A link a6,#0 +// ROM:00126D4E movem.l a3-a4,-(sp) +// ROM:00126D52 movea.l 8(a6),a4 +// ROM:00126D56 lea $22(a4),a3 +// ROM:00126D5A move.w #$F9,$1A(a4) +// ROM:00126D60 move.l $10(a6),$C(a4) +// ROM:00126D66 clr.b $A(a3) +// ROM:00126D6A clr.w 8(a3) +// ROM:00126D6E clr.b $B(a3) +// ROM:00126D72 move.l a4,-(sp) +// ROM:00126D74 subq.l #2,sp +// ROM:00126D76 move.l a4,-(sp) +// ROM:00126D78 move.b $F(a6),-(sp) +// ROM:00126D7C ori.b #$DF,d5 +// ROM:00126D80 move.w (sp)+,d0 +// ROM:00126D82 ext.l d0 +// ROM:00126D84 move.l d0,-(sp) +// ROM:00126D86 ori.b #$20,d0 +// ROM:00126D8A movem.l -8(a6),a3-a4 +// ROM:00126D90 unlk a6 +// ROM:00126D92 rts + struct TRopenParams *params = &(dsp->u.openParams); + + dsp->csCode = dspCLListen; + dsp->ioCompletion = compRoutine; + + params->filterAddress.aNode = 0; + params->filterAddress.aNet = 0; + params->filterAddress.aSocket = 0; + + return DMFix(PBControl(dsp, async), dsp); +} + + +void RejectConnectionRequest(DSPParamBlock *dsp, Boolean async, ProcPtr compRoutine) //26d94 +{ +// ROM:00126D94 link a6,#0 +// ROM:00126D98 move.l a4,-(sp) +// ROM:00126D9A movea.l 8(a6),a4 +// ROM:00126D9E move.l $10(a6),$C(a4) +// ROM:00126DA4 move.w #$F8,$1A(a4) +// ROM:00126DAA move.l a4,-(sp) +// ROM:00126DAC subq.l #2,sp +// ROM:00126DAE move.l a4,-(sp) +// ROM:00126DB0 move.b $F(a6),-(sp) +// ROM:00126DB4 ori.b #$DF,d5 +// ROM:00126DB8 move.w (sp)+,d0 +// ROM:00126DBA ext.l d0 +// ROM:00126DBC move.l d0,-(sp) +// ROM:00126DBE ori.b #$20,d0 +// ROM:00126DC2 movea.l -4(a6),a4 +// ROM:00126DC6 unlk a6 +// ROM:00126DC8 rts + dsp->ioCompletion = compRoutine; + dsp->csCode = dspCLDeny; + + DMFix(PBControl(dsp, async), dsp); +} + +OSErr RemoveConnectionListener(unsigned char abortFlag, + Boolean async, + ProcPtr compRoutine, + DSPParamBlock *dsp) //26dca +{ +// ROM:00126DCA link a6,#0 +// ROM:00126DCE movem.l a3-a4,-(sp) +// ROM:00126DD2 movea.l $14(a6),a4 +// ROM:00126DD6 lea $22(a4),a3 +// ROM:00126DDA move.w #$FA,$1A(a4) +// ROM:00126DE0 move.l $10(a6),$C(a4) +// ROM:00126DE6 move.b $B(a6),(a3) +// ROM:00126DEA move.l a4,-(sp) +// ROM:00126DEC subq.l #2,sp +// ROM:00126DEE move.l a4,-(sp) +// ROM:00126DF0 move.b $F(a6),-(sp) +// ROM:00126DF4 ori.b #$DF,d5 +// ROM:00126DF8 move.w (sp)+,d0 +// ROM:00126DFA ext.l d0 +// ROM:00126DFC move.l d0,-(sp) +// ROM:00126DFE ori.b #$20,d0 +// ROM:00126E02 movem.l -8(a6),a3-a4 +// ROM:00126E08 unlk a6 +// ROM:00126E0A rts + struct TRcloseParams *params = &(dsp->u.closeParams); + + dsp->csCode = dspCLRemove; + dsp->ioCompletion = compRoutine; + + params->abort = abortFlag; + + return DMFix(PBControl(dsp, async), dsp); +} + +OSErr CreateConnectionEnd(TRCCB *ccbPtr, + ProcPtr userRoutine, + unsigned short sendQSize, + unsigned char *sendQ, + unsigned short recvQSize, + unsigned char *recvQ, + unsigned char *attnPtr, + unsigned char socket, + short drvrRef, + Boolean async, + ProcPtr compRoutine, + DSPParamBlock *dsp) //26e0c +{ +// ROM:00126E0C link a6,#0 +// ROM:00126E10 movem.l a3-a4,-(sp) +// ROM:00126E14 movea.l $34(a6),a3 +// ROM:00126E18 lea $22(a3),a4 +// ROM:00126E1C move.w $2A(a6),$18(a3) +// ROM:00126E22 move.w #$FF,$1A(a3) +// ROM:00126E28 move.l $30(a6),$C(a3) +// ROM:00126E2E move.l 8(a6),(a4) +// ROM:00126E32 move.l $C(a6),4(a4) +// ROM:00126E38 move.w $12(a6),8(a4) +// ROM:00126E3E move.w $1A(a6),$E(a4) +// ROM:00126E44 move.l $14(a6),$A(a4) +// ROM:00126E4A move.l $1C(a6),$10(a4) +// ROM:00126E50 move.l $20(a6),$14(a4) +// ROM:00126E56 move.b $27(a6),$18(a4) +// ROM:00126E5C move.l a3,-(sp) +// ROM:00126E5E subq.l #2,sp +// ROM:00126E60 move.l a3,-(sp) +// ROM:00126E62 move.b $2F(a6),-(sp) +// ROM:00126E66 ori.b #$DF,d5 +// ROM:00126E6A move.w (sp)+,d0 +// ROM:00126E6C ext.l d0 +// ROM:00126E6E move.l d0,-(sp) +// ROM:00126E70 ori.b #$20,d0 +// ROM:00126E74 movem.l -8(a6),a3-a4 +// ROM:00126E7A unlk a6 +// ROM:00126E7C rts + struct TRinitParams *params = &(dsp->u.initParams); + + dsp->ioCRefNum = drvrRef; + dsp->csCode = dspInit; + dsp->ioCompletion = compRoutine; + + params->ccbPtr = ccbPtr; + params->userRoutine = userRoutine; + params->sendQSize = sendQSize; + params->recvQSize = recvQSize; + params->sendQueue = sendQ; + params->recvQueue = recvQ; + params->attnPtr = attnPtr; + params->localSocket = socket; + + return DMFix(PBControl(dsp, async), dsp); +} + +OSErr OpenConnectionEnd(unsigned short remoteCid, + AddrBlock *remoteAddr, + AddrBlock *filterAddr, + unsigned long sendSeq, + unsigned short sendWindow, + unsigned long attnSendSeq, + unsigned char ocMode, + Boolean async, + ProcPtr compRoutine, + DSPParamBlock *dsp) //26e7e +{ + PPCGlobalParamsPtr ppcglobPtr = getGlobal(); + struct PPCConfigInfo *myptr = &(ppcglobPtr->configData); + + struct TRopenParams *params = &(dsp->u.openParams); + + dsp->csCode = dspOpen; + dsp->ioCompletion = compRoutine; + + params->remoteAddress.aNet = remoteAddr->aNet; + params->remoteAddress.aNode = remoteAddr->aNode; + params->remoteAddress.aSocket = remoteAddr->aSocket; + params->filterAddress.aNet = filterAddr->aNet; + params->filterAddress.aNode = filterAddr->aNode; + params->filterAddress.aSocket = filterAddr->aSocket; + params->ocMode = ocMode; + params->sendSeq = sendSeq; + params->sendWindow = sendWindow; + params->attnSendSeq = attnSendSeq; + params->remoteCID = remoteCid; + params->ocInterval = myptr->adspTimeout; + params->ocMaximum = myptr->adspRetries; + + return DMFix(PBControl(dsp, async), dsp); + +// ROM:00126E7E link a6,#-4 +// ROM:00126E82 movem.l a3-a4,-(sp) +// ROM:00126E86 movea.l $2C(a6),a3 +// ROM:00126E8A ori.w #$9406,a1 // getGlobal +// ROM:00126E8E movea.l d0,a4 +// ROM:00126E90 lea $CC(a4),a0 +// ROM:00126E94 move.l a0,-4(a6) +// ROM:00126E98 lea $22(a3),a4 + +// ROM:00126E9C move.w #$FD,$1A(a3) +// ROM:00126EA2 move.l $28(a6),$C(a3) + +// ROM:00126EA8 movea.l $C(a6),a0 +// ROM:00126EAC move.w (a0),4(a4) +// ROM:00126EB0 movea.l $C(a6),a0 +// ROM:00126EB4 move.b 2(a0),6(a4) +// ROM:00126EBA movea.l $C(a6),a0 +// ROM:00126EBE move.b 3(a0),7(a4) + +// ROM:00126EC4 movea.l $10(a6),a0 +// ROM:00126EC8 move.w (a0),8(a4) +// ROM:00126ECC movea.l $10(a6),a0 +// ROM:00126ED0 move.b 2(a0),$A(a4) +// ROM:00126ED6 movea.l $10(a6),a0 +// ROM:00126EDA move.b 3(a0),$B(a4) + +// ROM:00126EE0 move.b $23(a6),$1E(a4) +// ROM:00126EE6 move.l $14(a6),$C(a4) +// ROM:00126EEC move.w $1A(a6),$10(a4) +// ROM:00126EF2 move.l $1C(a6),$16(a4) +// ROM:00126EF8 move.w $A(a6),2(a4) + +// ROM:00126EFE movea.l -4(a6),a0 +// ROM:00126F02 move.b 8(a0),$1F(a4) adspTimeout +// ROM:00126F08 movea.l -4(a6),a0 +// ROM:00126F0C move.b 9(a0),$20(a4) adspRetries + +// ROM:00126F12 move.l a3,-(sp) +// ROM:00126F14 subq.l #2,sp +// ROM:00126F16 move.l a3,-(sp) +// ROM:00126F18 move.b $27(a6),-(sp) +// ROM:00126F1C ori.b #$DF,d5 +// ROM:00126F20 move.w (sp)+,d0 +// ROM:00126F22 ext.l d0 +// ROM:00126F24 move.l d0,-(sp) +// ROM:00126F26 ori.b #$20,d0 +// ROM:00126F2A movem.l -$C(a6),a3-a4 +// ROM:00126F30 unlk a6 +// ROM:00126F32 rts +} + +OSErr RemoveConnectionEnd(unsigned char abortFlag, + Boolean async, + ProcPtr compRoutine, + DSPParamBlock *dsp) //26f34 +{ + struct TRcloseParams *params = &(dsp->u.closeParams); + + dsp->csCode = dspRemove; + dsp->ioCompletion = compRoutine; + + params->abort = abortFlag; + + return DMFix(PBControl(dsp, async), dsp); +// ROM:00126F34 link a6,#0 +// ROM:00126F38 movem.l a3-a4,-(sp) +// ROM:00126F3C movea.l $14(a6),a4 +// ROM:00126F40 lea $22(a4),a3 +// ROM:00126F44 move.w #$FE,$1A(a4) dspRemove +// ROM:00126F4A move.l $10(a6),$C(a4) +// ROM:00126F50 move.b $B(a6),(a3) +// ROM:00126F54 move.l a4,-(sp) +// ROM:00126F56 subq.l #2,sp +// ROM:00126F58 move.l a4,-(sp) +// ROM:00126F5A move.b $F(a6),-(sp) +// ROM:00126F5E ori.b #$DF,d5 +// ROM:00126F62 move.w (sp)+,d0 +// ROM:00126F64 ext.l d0 +// ROM:00126F66 move.l d0,-(sp) +// ROM:00126F68 ori.b #$20,d0 +// ROM:00126F6C movem.l -8(a6),a3-a4 +// ROM:00126F72 unlk a6 +// ROM:00126F74 rts +} + + +OSErr WriteToConnection(unsigned short reqCount, + unsigned char *dataPtr, + unsigned char eom, + unsigned char flush, + Boolean async, + ProcPtr compRoutine, + DSPParamBlock *dsp) //26f76 +{ + struct TRioParams *params = &(dsp->u.ioParams); + + dsp->csCode = dspWrite; + dsp->ioCompletion = compRoutine; + + params->reqCount = reqCount; + params->dataPtr = dataPtr; + params->eom = eom; + params->flush = flush; + + return DMFix(PBControl(dsp, async), dsp); +// ROM:00126F76 link a6,#0 +// ROM:00126F7A movem.l a3-a4,-(sp) +// ROM:00126F7E movea.l $20(a6),a4 +// ROM:00126F82 lea $22(a4),a3 +// ROM:00126F86 move.w #$F5,$1A(a4) +// ROM:00126F8C move.l $1C(a6),$C(a4) + +// ROM:00126F92 move.w $A(a6),(a3) +// ROM:00126F96 move.l $C(a6),4(a3) +// ROM:00126F9C move.b $13(a6),8(a3) +// ROM:00126FA2 move.b $17(a6),9(a3) + +// ROM:00126FA8 move.l a4,-(sp) +// ROM:00126FAA subq.l #2,sp +// ROM:00126FAC move.l a4,-(sp) +// ROM:00126FAE move.b $1B(a6),-(sp) +// ROM:00126FB2 ori.b #$DF,d5 +// ROM:00126FB6 move.w (sp)+,d0 +// ROM:00126FB8 ext.l d0 +// ROM:00126FBA move.l d0,-(sp) +// ROM:00126FBC ori.b #$20,d0 +// ROM:00126FC0 movem.l -8(a6),a3-a4 +// ROM:00126FC6 unlk a6 +// ROM:00126FC8 rts +} + +OSErr ReadFromConnection(unsigned short reqCount, + unsigned char *dataPtr, + Boolean async, + ProcPtr compRoutine, + DSPParamBlock *dsp) //26fca +{ + struct TRioParams *params = &(dsp->u.ioParams); + + dsp->csCode = dspRead; + dsp->ioCompletion = compRoutine; + + params->reqCount = reqCount; + params->dataPtr = dataPtr; + + return DMFix(PBControl(dsp, async), dsp); +// ROM:00126FCA link a6,#0 +// ROM:00126FCE movem.l a3-a4,-(sp) +// ROM:00126FD2 movea.l $18(a6),a4 +// ROM:00126FD6 lea $22(a4),a3 + +// ROM:00126FDA move.w #$F6,$1A(a4) +// ROM:00126FE0 move.l $14(a6),$C(a4) + +// ROM:00126FE6 move.w $A(a6),(a3) +// ROM:00126FEA move.l $C(a6),4(a3) + +// ROM:00126FF0 move.l a4,-(sp) +// ROM:00126FF2 subq.l #2,sp +// ROM:00126FF4 move.l a4,-(sp) +// ROM:00126FF6 move.b $13(a6),-(sp) +// ROM:00126FFA ori.b #$DF,d5 +// ROM:00126FFE move.w (sp)+,d0 +// ROM:00127000 ext.l d0 +// ROM:00127002 move.l d0,-(sp) +// ROM:00127004 ori.b #$20,d0 +// ROM:00127008 movem.l -8(a6),a3-a4 +// ROM:0012700E unlk a6 +// ROM:00127010 rts +} diff --git a/OS/SCSIMgr/SCSILinkPatch.a b/OS/SCSIMgr/SCSILinkPatch.a index de8d7f3..9ebb0e0 100644 --- a/OS/SCSIMgr/SCSILinkPatch.a +++ b/OS/SCSIMgr/SCSILinkPatch.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 EXPORT the resident SCSIBusyVector so that install code can set it. +; This was broken before, but by which change? +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ;_______________________________________________________________________________________ ; ; File: SCSILinkPatch.a @@ -493,6 +501,7 @@ SCSIBusyCommon ; ; In SuperMario, this is part of SCSIGlobals. + EXPORT SCSIBusyVector ; FreeHookPending dc.l 0 ; location of pending free-hook flag SCSIBusyVector dc.l 0 diff --git a/OS/SCSIMgr/SCSIMgr96.a b/OS/SCSIMgr/SCSIMgr96.a index 07ef55c..546dd5a 100644 --- a/OS/SCSIMgr/SCSIMgr96.a +++ b/OS/SCSIMgr/SCSIMgr96.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Partly reverted , removing check for 040+VM from MOVE16 workaround +; Ripped out the (conditional) nops from +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: SCSIMgr96.a ; @@ -622,12 +630,7 @@ dataCommon_96 @data_end - cmpi.b #cpu68040,CPUFlag ; Do we have an 040? - bne.s @TheRealExit ; -> No. No MOVE16. No Problem. - cmpi.l #-1,VMGlobals ; VM running? - beq.s @TheRealExit ; -> No, no VM, no problem - - +; ex Don't restrict this workaround to 040s running VM ;--- Flush the cache line that contains location 8 (because of MOVE16 bug) <3> thru next <3> movem.l D0-D2, -(sp) @@ -673,9 +676,6 @@ DoSCSIComplete_96 bne.w @phaseErr ; @inPhase ; we should be in status phase. move.b #cCmdComp, rCMD(a3) ; load cmd complete code - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr WaitForSCSIIntrp ; Wait for intrp w/ timeout ; on exit d5 = rF0S|rINT|0|rSTA beq.w @noStatus ; Branch if timedout @@ -695,9 +695,6 @@ DoSCSIComplete_96 ; ;bne.s @cmdErr from last move.b #cMsgAcep, rCMD(a3) ; load msg accepted code which de-asserts *ACK - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr WaitForSCSIIntrp ; Wait for intrp w/ timeout ; on exit d5 = rFOS|rINT|0|rSTA beq.w @badAcpt ; Branch if timedout @@ -835,9 +832,6 @@ Select_96 ; Set up chip for select process (flush FIFO, init dest ID) move.b d0, rDID(a3) ; load select bus ID w/ target ID move.b #cFlshFFO, rCMD(a3) ; Flush FIFO, make sure it's empty - if nonSerializedIO Then - nop ; Force write to complete. - endif btst.l #16, d0 ; is this a Sel w/Atn? bne.s @withAtn @@ -847,9 +841,6 @@ Select_96 move.b zeroReg, rXCM(a3) ; tell chip that we will be sending 1 move.b #1, rXCL(a3) ; DMA byte (in command phase) move.b #cDMASelWOAtn, rCMD(a3) ; issue Select w/o Atn cmd - if nonSerializedIO Then - nop ; Force write to complete. - endif bset.b #NeedCmdSent, G_State96(a4) ; flag=expect to see a COMMAND phase next bra.s @2 @@ -858,9 +849,6 @@ Select_96 move.b zeroReg, rXCM(a3) ; tell chip that we will be sending 2 move.b #1, rXCL(a3) ; DMA bytes (1 in msg_out, 1 in command) move.b #cDMASelWAtn, rCMD(a3) ; issue Select w/ Atn cmd - if nonSerializedIO Then - nop ; Force write to complete. - endif bset.b #NeedMsgOut, G_State96(a4) ; flag=expect to see a MESSAGE_OUT phase next @2 bset.b #SelInProg, G_State96(a4) ; set flag->select is in prog, expect intrpt @@ -899,11 +887,7 @@ Select_96 ;——————————————————— @waitLoop ; Check for a REQ from the target (within valid phase) - IF forPDMDebug THEN ; - move.b (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ELSE move.l (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ENDIF move.b G_bitDREQ(a4),d0 ; load DREQ bit position <4> jab btst.l d0, d5 ; DREQ ? <4> jab bne.s @gotDREQ ; yes: then we have a REQ for Msg_Out or Cmd byte @@ -1016,9 +1000,6 @@ SendCMD_96 @btmLoadFIFO ; dbra d2, @loadFIFO ; last byte in order to satisfy the c96's DMA ; circuitry & get us that intrp. - if nonSerializedIO Then - nop ; Force write to complete. - endif btst.b #NeedCmdSent, G_State96(a4) ; were we expecting a command phase here? <2> thru next <2> beq.s @skipDMA @@ -1039,9 +1020,6 @@ SendCMD_96 and.b rSTA(a3), d1 ; get phase bits before sending last byte <2> from prev <2> move.b (a2)+, rDMA(a3) ; Use psuedo DMA to load last byte - if nonSerializedIO Then - nop ; Force write to complete. - endif bclr.b #NeedCmdSent,G_State96(a4) ; no longer need command sent and, bset.b #FCIntPend,G_State96(a4) ; now we can expect a FunctionCmplt interrupt @@ -1059,9 +1037,6 @@ SendCMD_96 moveq.l #noErr, d0 ; no error @cmdExit ; At this point, we're out of cmd phase and.b #$FF-SlowCableMode,rCF1(a3) ; turn-off Slow cable mode - if nonSerializedIO Then - nop ; Force write to complete. - endif tst.w d0 ; rts @@ -1095,9 +1070,6 @@ SendCMD_96 bclr.b #NeedMsgOut, G_State96(a4) ; and Message_Out bclr.b #NeedCmdSent, G_State96(a4) ; and Command expected flags move.b #cFlshFFO, rCMD(a3) ; flush the FIFO of unused Command bytes - if nonSerializedIO Then - nop ; Force write to complete. - endif @phaseErr moveq.l #scPhaseErr, d0 ; phase error move.l #scsiCmd, d6 ; load proc ID @@ -1132,9 +1104,6 @@ GetMsg_96 bne.s @phaseErr ; move.b #cIOXfer, rCMD(a3) ; load Transfer cmd byte in CMD regr - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr WaitForSCSIIntrp ; Wait for intrp w/ timeout ; on exit d5 = xxxx|rSQS|rSTA|rINT beq.s @timedOut ; Branch if timedout @@ -1142,9 +1111,6 @@ GetMsg_96 move.b rFFO(a3), d2 ; xfer fifo msg byte into d2 w/ *ACK still asserted ; now, unconditionally accept the message byte move.b #cMsgAcep, rCMD(a3) ; load msg accepted code which de-asserts *ACK - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr WaitForSCSIIntrp ; Wait for intrp w/ timeout ; on exit d5 = rFOS|rINT|0|rSTA beq.s @timedOut ; Branch if timedout @@ -1204,9 +1170,6 @@ SendMsg_96 @inPhase ; We probably got here from Select w/ATN which means ; ATN is deasserted prior to transfer of msg byte move.b d2, rFFO(a3) ; xfer msg byte - if nonSerializedIO Then - nop ; Force write to complete. - endif bclr.b #NeedMsgOut,G_State96(a4) ; did we send a Select w/ATN? beq.s @needXfer ; no - just split bset.b #NeedCmdSent,G_State96(a4) ; yes - we took care of MsgOut, now we need to send command @@ -1303,14 +1266,14 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) moveq.l #iPhaseMsk, d0 ; load mask bits for phase value and.b rSTA(a3), d0 ; get phase bits - ; cmp #iDataOut, d0 ; - beq.s @inDataPhase ; - cmp #iDataIn, d0 ; beq.s @inDataPhase ; + cmp #iDataOut, d0 ; + beq.s @inDataPhase ; + cmp #iCommand, d0 ; - beq @shoveCommand ; + beq.s @shoveCommand ; cmp #iMsgOut, d0 ; beq.w @shoveMsgOut ; @@ -1360,9 +1323,6 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) ; Dump out data_out bytes until we've gone into another phase @shoveDataOut move.b #$EE, rFFO(a3) ; load filler byte into FIFO - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr Xfer1Byte ; xfer 1 byte and wait for intrp w/o timeout ; on exit d5 = rFOS|rINT|0|rSTA bne.s @xferErr ; bra. on xfer error @@ -1374,9 +1334,6 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) bclr.b #NeedCmdSent, G_State96(a4) ; did we expect this? beq.s @nonDMA ; no - bra, do xfer using FIFO move.b #$EE, rDMA(a3) ; yes - use DMA (since chip is waiting for it) - if nonSerializedIO Then - nop ; Force write to complete. - endif bset.b #FCIntPend,G_State96(a4) ; we took care of cmd, now expect FC interrupt jsr WaitForSCSIIntrp beq.s @timedOut ; bra if timedout @@ -1386,9 +1343,6 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) bra.s @2 ; trying again is as good as anything else @nonDMA move.b #$EE, rFFO(a3) ; load filler byte into FIFO - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr Xfer1Byte ; xfer 1 byte and wait for intrp w/o timeout bne.s @xferErr ; bra. on xfer error @2 @@ -1398,9 +1352,6 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) ; Dump out message_out bytes until we've gone into another phase @shoveMsgOut move.b #$08, rFFO(a3) ; load filler byte into FIFO (NOP message) - if nonSerializedIO Then - nop ; Force write to complete. - endif bclr.b #NeedMsgOut, G_State96(a4) ; did we expect this? beq.s @needXferCmd ; no - branch bset.b #NeedCmdSent,G_State96(a4) ; yes - taking care of MsgOut, now we need cmd @@ -1418,9 +1369,6 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) bne.s @xferErr ; bra. on xfer error move.b rFFO(a3), d0 ; just empty the FIFO move.b #cMsgAcep, rCMD(a3) ; load msg accepted code which de-asserts ACK - if nonSerializedIO Then - nop ; Force write to complete. - endif jsr WaitForSCSIIntrp ; Wait for intrp w/ timeout ; on exit d5 = rFOS|rINT|0|rSTA bra.s @checkNextPhase @@ -1449,11 +1397,7 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) @pDMAread btst.b #bINT, rSTA(a3) ; poll for intrp hopefully from TC zero bne.s @readAll ; bra. if we got one - IF forPDMDebug THEN ; - move.b (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ELSE move.l (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ENDIF move.b G_bitDREQ(a4),d0 ; load DREQ bit position <4> jab btst.l d0, d5 ; DREQ ? <4> jab beq.s @pDMAread ; bra. if inactive @@ -1470,18 +1414,11 @@ CyclePhase_96 ; (accessed thru jvCyclePhase) @pDMAwrite btst.b #bINT, rSTA(a3) ; poll for intrp hopefully from TC zero bne.s @writeAll ; bra. if we filled all data - IF forPDMDebug THEN ; - move.b (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ELSE move.l (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ENDIF move.b G_bitDREQ(a4),d0 ; load DREQ bit position <4> jab btst.l d0, d5 ; DREQ ? <4> jab beq.s @pDMAwrite ; bra. if inactive move.w #$EEEE, rDMA(a3) ; load filler data into FIFO - if nonSerializedIO Then - nop ; Force write to complete. - endif bra.s @pDMAwrite @writeAll ; Intrp will occur when REQ is asserted for the next phase jsr WaitForIntNoTime ; Expecting an intrp, clear it when occurs @@ -1534,11 +1471,7 @@ TestForDREQ jsr SwapMMU ; (sets up d0 with previous mode) move.l G_SCSIDREQ(a4), a0 ; G_SCSIDREQ contains DREQ regr address - IF forPDMDebug THEN ; - move.b (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ELSE move.l (a0), d5 ; read DAFB regr (a0=DAFB register addr) - ENDIF jsr SwapMMU ; return to previous mode (in d0) diff --git a/OS/SCSIMgr/SCSIMgrHW96.a b/OS/SCSIMgr/SCSIMgrHW96.a index e8b7437..2cb25e0 100644 --- a/OS/SCSIMgr/SCSIMgrHW96.a +++ b/OS/SCSIMgr/SCSIMgrHW96.a @@ -1,3 +1,13 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted boxFlag checks and tacked-on flags from / +; Commented out the nonSerializedIO nops from and , and +; restored a short branch that the nops blew out +; Restored useless MaxBusErr code to Transfer_96 (from SCSIMgrHW96BIOS.a) +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: SCSIMgrHW96.a ; @@ -166,13 +176,13 @@ InitHW_SCSI96 move.b #cRstSChp, rCMD(a3) ; Reset the Chip (not the bus) if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.b #cNOP, rCMD(a3) ; C96 NOP required after HW or SW reset move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.b #initCF1, rCF1(a3) ; load init config. value which affects: ; busID, SCSI reset reporting & parity checking @@ -181,47 +191,20 @@ InitHW_SCSI96 move.b #initCF3, rCF3(a3) ; load init config. value if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif ; Check whether or not we're 25 or 33MHz and set SCSI bus speed values appropriately thru next TestFor VIA2Exists ; see if we should check 25/33MHz VIA2 bit - beq @dontChk ; if there's not a VIA2, don't do it. + beq.s @dontChk ; if there's not a VIA2, don't do it. ex + TestFor DAFBExists ; vs BoxFlags for Spike/Eclipse/Zydeco ex + beq.s @dontChk ; if there's not a DAFB ex -; Change to check for BoxFlags for Spike/Eclipse/Zydeco, instead of DAFBExists, since this -; special stuff only applies to those 3 machines. - - move.l UnivInfoPtr,A0 ; get pointer to universal table - cmp.b #BoxQuadra700,ProductInfo.ProductKind(A0) ; check for a Spike - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #BoxQuadra900,ProductInfo.ProductKind(A0) ; check for a Eclipse - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #BoxQuadra950,ProductInfo.ProductKind(A0) ; check for a Zydeco - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - IF forSmurf THEN - cmp.b #boxRiscQuadra700,ProductInfo.ProductKind(A0) ; check for a RISC Spike - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscQuadra900,ProductInfo.ProductKind(A0) ; check for a RISC Quadra900 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscQuadra950,ProductInfo.ProductKind(A0) ; check for a RISC Quadra950 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscCentris610,ProductInfo.ProductKind(A0) ; check for a RISC Centris610 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscCentris650,ProductInfo.ProductKind(A0) ; check for a RISC Centris650 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscQuadra800,ProductInfo.ProductKind(A0) ; check for a RISC Quadra800 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscQuadra610,ProductInfo.ProductKind(A0) ; check for a RISC Quadra610 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - cmp.b #boxRiscQuadra650,ProductInfo.ProductKind(A0) ; check for a RISC Quadra650 - beq.s @DoSpikeEclipseZydeco ; Special setup for Spike/Eclipse/Zydeco - ENDIF ; for Smurf - bra.s @dontChk ; only Spike/Eclipse have a VIA2 and DAFB - -@DoSpikeEclipseZydeco ; + move.l a0,-(sp) ; needlessly save a0... ex move.l VIA2,a0 ; and get VIA2 so that we can check the speed bit move.b vBufB(a0),d0 ; read PBx values for 25/33MHz checks + move.l (sp)+,a0 ; ...and restore a0 ex btst #v2Speed,d0 ; are we 25 MHz or 33 Mhz? beq.s @25MHz ; IF Speed == 33MHz THEN move.l #tsc_cf_stg_33,(a4) ; setup DAFB SCSI config register. @@ -245,20 +228,6 @@ InitHW_SCSI96 move.l UnivInfoPtr,A0 ; get pointer to universal table cmp.b #boxQuadra700,ProductInfo.ProductKind(A0) ; check for a Spike <2> beq.s @ForSpike ; (note - BoxFlag is not defined yet!) - IF forSmurf THEN - cmp.b #boxRiscQuadra700,ProductInfo.ProductKind(A0) ; check for a RISC Quadra700 - beq.s @ForSpike ; (note - BoxFlag is not defined yet!) - cmp.b #boxRiscCentris610,ProductInfo.ProductKind(A0) ; check for a RISC Centris610 - beq.s @ForSpike ; (note - BoxFlag is not defined yet!) - cmp.b #boxRiscCentris650,ProductInfo.ProductKind(A0) ; check for a RISC Centris650 - beq.s @ForSpike ; (note - BoxFlag is not defined yet!) - cmp.b #boxRiscQuadra800,ProductInfo.ProductKind(A0) ; check for a RISC Quadra800 - beq.s @ForSpike ; (note - BoxFlag is not defined yet!) - cmp.b #boxRiscQuadra610,ProductInfo.ProductKind(A0) ; check for a RISC Quadra610 - beq.s @ForSpike ; - cmp.b #boxRiscQuadra650,ProductInfo.ProductKind(A0) ; check for a RISC Quadra650 - beq.s @ForSpike ; - ENDIF ; for Smurf ; Check for difference between 25 and 33MHz Eclipse machines: @@ -301,7 +270,7 @@ InitHW_SCSI96 ; synch data xfer @4 if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.b rINT(a3), d0 ; read & clear rFOS, rSTA & rINT into throwaway rts @@ -400,6 +369,12 @@ linkSize EQU * Transfer_96: link a6, #linkSize ; allocate local storage + + moveq #Max020030BusErrs,d0 ; upper limit for 020s and 030s + cmp.b #cpu68040,CpuFlag ; check if we're on an 040 + bne.s @storeValue ; NO ... leave BusErrCount alone + moveq #Max040BusErrs,d0 ; YES ... use 040 MaxBusErr value +@storeValue ; move.l #0, BusErrAddr(a6) ; init so first bus err is seen as a new one moveq.l #noErr, d0 ; assume no error @@ -418,7 +393,7 @@ Transfer_96: move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif ; move.l BusErrVct, D0 ; compare old vector (at 8) <2> <3>removed @@ -478,7 +453,7 @@ Transfer_96: OneByteRead ; thru next move.b #cIOXfer, rCMD(a3) ; load IO transfer cmd & begin xfers if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif jsr.w WaitForIntNoTime ; Wait for intrp w/o timeout ; on exit d5 = rFOS|rINT|0|rSTA @@ -494,11 +469,11 @@ OneByteRead ; thru next OneByteWrite move.b (a2)+, rFFO(a3) ; preload the FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.b #cIOXfer, rCMD(a3) ; load IO transfer cmd & begin xfers if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif jsr.w WaitForIntNoTime ; Wait for intrp w/o timeout ; on exit d5 = rFOS|rINT|0|rSTA @@ -522,7 +497,7 @@ errExit clr.l d1 ; no bytes transferred move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; @@ -553,7 +528,7 @@ errExit Xfer1Byte move.b #cIOXfer, rCMD(a3) ; load IO transfer cmd & begin xfers if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif jsr.w WaitForIntNoTime ; Wait for intrp w/o timeout ; on exit d5 = rFOS|rINT|0|rSTA @@ -630,7 +605,7 @@ SlowRead_96 move.b #0, rXCM(a3) ; rXCM = 0, clear most-sig. byte count move.b #$10, rXCL(a3) ; rXCL = 16 bytes, least-sig. byte value if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif and.l #$F, d2 ; d2 = remainder word count after 16-byte moves @read16 @@ -709,7 +684,7 @@ SlowRead_96 bne.s @phaseErr ; bra. on phase err move.b #cIOXfer, rCMD(a3) ; load IO transfer cmd & begin xfers if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif @3 btst.b #bINT, rSTA(a3) ; check for c96 INTRP @@ -780,7 +755,7 @@ SlowRead_96 jsr Error ; call Error proc - for debug move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; @@ -834,7 +809,7 @@ SlowWrite_96 move.l d2, d6 ; d6 = number 64KB block to perform swap d6 ; upper word of d6 = lower word of d2 andi.l #$0000FFFF, d2 ; mask out upper word - beq @2 ; if 0 then we have $10000 (64K) bytes to xfer + beq.s @2 ; if 0 then we have $10000 (64K) bytes to xfer ex ex @next64KB moveq.l #iPhaseMsk, d3 ; load mask bits for phase value and.b rSTA(a3), d3 ; are we still in data-out phase? @@ -847,7 +822,7 @@ SlowWrite_96 lsr.l #8, d4 ; get upper byte of low word move.b d4, rXCM(a3) ; TC regr (most-sig. byte) <- d4.b if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.b #cDMAXfer, rCMD(a3) ; load DMA transfer cmd & begin xfers nop ; squoosh pipeline @@ -891,7 +866,7 @@ SlowWrite_96 @residual move.b (a2)+, rDMA(a3) ; xfer residual byte if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif @noResidual bsr.w WaitForIntNoTime ; Wait for intrp w/o timeout @@ -938,7 +913,7 @@ SlowWrite_96 jsr Error ; call Error proc - for debug move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; @@ -991,7 +966,7 @@ FastWrite_96 @doWrite move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif moveq.l #iPhaseMsk, d0 ; and.b rSTA(a3), d0 ; are we in data-out phase? @@ -1014,12 +989,12 @@ FastWrite_96 lsr.l #8, d4 ; get upper byte of low word move.b d4, rXCM(a3) ; TC regr (most-sig. byte) <- d4.b if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.b #cDMAXfer, rCMD(a3) ; load DMA transfer cmd & begin xfers ; DREQ* should be active at this time if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif move.w d2, d4 ; d4 = copy of transfer count lsr.w #5, d4 ; divide xfer count by 32 @@ -1057,7 +1032,7 @@ FastWrite_96 @residual move.b (a2)+, rDMA(a3) ; xfer residual byte if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif @noResidual bsr.w WaitForIntNoTime ; Wait for intrp w/o timeout @@ -1075,7 +1050,7 @@ FastWrite_96 subq.l #1, d2 ; adjust for transfer count calc move.b (a2)+, rFFO(a3) ; ...preload fifo with odd byte thru next if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif bra.w @next64KB ; now we're word aligned @phaseErr @@ -1101,7 +1076,7 @@ FastWrite_96 jsr Error ; call Error proc - for debug move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; @@ -1153,7 +1128,7 @@ FastRead_96 @doRead move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif moveq.l #iPhaseMsk, d0 ; load mask for phase bits thru next and.b rSTA(a3), d0 ; are we in data-in phase? @@ -1175,7 +1150,7 @@ FastRead_96 move.b #cDMAXfer, rCMD(a3) ; load DMA transfer cmd & begin xfers ; DREQ* should be active at this time if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif ; move.l a2, d5 ; ; btst.l #0, d5 ; check if input buffer is on word boundary @@ -1258,7 +1233,7 @@ FastRead_96 jsr Error ; call Error proc - for debug move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; @@ -1304,7 +1279,7 @@ ResetBus_96 move.b #cRstSBus, rCMD(a3) ; load reset scsi bus cmd ; re-enable all intrps if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts @@ -1379,7 +1354,7 @@ HandleSelInProg bsr.w WaitForIntNoTime move.b #cFlshFFO, rCMD(a3) ; Flush FIFO <3> if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif moveq.l #0, d0 bra.s @gotInt @@ -1565,7 +1540,7 @@ FastComp_96 move.b #cDMAXfer, rCMD(a3) ; load DMA transfer cmd & begin xfers ; DREQ* should be active at this time if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif ror.l #1, d2 ; xfer byte count to word & remember odd byte @@ -1615,7 +1590,7 @@ FastComp_96 jsr Error ; call Error proc - for debug move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; @@ -1691,7 +1666,7 @@ SlowComp_96 @read16 move.b #cDMAXfer, rCMD(a3) ; load DMA transfer cmd & start loading FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif @1 ; currently loaded transfer count is used/reused btst.b #bINT, rSTA(a3) ; poll for unexpected intrp while waiting @@ -1741,7 +1716,7 @@ SlowComp_96 bne.s @phaseErr ; bra. on phase err move.b #cIOXfer, rCMD(a3) ; load IO transfer cmd & begin xfers if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif @3 btst.b #bINT, rSTA(a3) ; check for c96 INTRP @@ -1789,7 +1764,7 @@ SlowComp_96 jsr Error ; call Error proc - for debug move.b #cFlshFFO, rCMD(a3) ; Flush FIFO if nonSerializedIO Then - nop ; Force write to complete. +; nop ; Force write to complete. endif rts ; diff --git a/OS/SCSIMgr/SCSIMgrInit96.a b/OS/SCSIMgr/SCSIMgrInit96.a index 35006db..feec430 100644 --- a/OS/SCSIMgr/SCSIMgrInit96.a +++ b/OS/SCSIMgr/SCSIMgrInit96.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted PDM-specific +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: SCSIMgrInit96.a ; @@ -57,7 +64,7 @@ ; don't print includes LOAD 'StandardEqu.d' ; from StandardEqu.a and for building ROMs - INCLUDE 'HardwareEqu.a' ; + INCLUDE 'HardwarePrivateEqu.a' ; INCLUDE 'SCSI.a' INCLUDE 'SCSIPriv.a' INCLUDE 'UniversalEqu.a' ; for TestFor @@ -193,11 +200,7 @@ InitMgr_SCSI96 clr.b G_bitDREQ(a4) ; initialize bit position of DREQ regr

thru to next

jab - TestFor HMCDecoder ; are we PDM ? - beq.s @notPDM - move.b #bDREQ_PDM,G_bitDREQ(a4) ; setup bit location of DREQ check - move.l #SCSI0_DREQ_PDM,pdma5380(a4) ; setup DREQ location - bra.s @chk2Bus ; + ; Removed code to set DREQ register location (G_bitDREQ, pdma5380) on PDM ex @notPDM cmpi.b #boxQuadra700,BoxFlag ; are we a Quadra 700? beq.s @wereQuadra ; yes ... set our DREQ location diff --git a/Patches/BeforePatches.a b/Patches/BeforePatches.a index 64757e0..e9b0ba5 100644 --- a/Patches/BeforePatches.a +++ b/Patches/BeforePatches.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Changed <26> to treat "useFree" the same as "useATalk". +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: BeforePatches.a (formerly RomAllFix.a) ; @@ -585,6 +592,7 @@ RAMSysInit PROC EXPORT move.b SPConfig,d0 ; <26> Get serial port configuration and.b #$0f,d0 ; <26> Mask off Port B bits + beq.s @appleTalkIsActive ; Treat "useFree" as AppleTalk=active. cmp.b #useATalk,d0 ; <26> Configured for AppleTalk? beq.s @appleTalkIsActive ; <26> Yes. Don’t set emAppleTalkInactiveOnBoot diff --git a/Patches/EDiskLocalNamePatch.a b/Patches/EDiskLocalNamePatch.a new file mode 100644 index 0000000..39ca445 --- /dev/null +++ b/Patches/EDiskLocalNamePatch.a @@ -0,0 +1,55 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Disassembled from scratch +; + + LOAD 'StandardEqu.d' + INCLUDE 'SysEqu.a' + INCLUDE 'EDiskEqu.a' + INCLUDE 'LinkedPatchMacros.a' + + +ROMInternalRAMDiskString RomBind (IIci,$E7DAA) + + +EDiskShutdownPtch InstallProc (IIci,hasTERROR) + lea DrvQHdr+QHead-QLink,a2 +@dqloop move.l (a2),d0 + beq.s @return + move.l d0,a2 ; follow link + move.w dQRefNum(a2),d0 ; calculate unit table offset from refNum + add.w #1,d0 + neg.w d0 + asl.w #2,d0 + move.l UTableBase,a1 + move.l (a1,d0),a1 + move.l (a1),a1 + btst #dRAMBased,DCtlFlags+1(a1) + bz.s @romBased + move.l (a1),a1 ; ptr to rom or handle to ram +@romBased move.l (a1),a1 + lea drvrName(a1),a1 + lea #'.EDisk',a0 ; searching for the EDisk drvr + clr.l d0 + move.b (a0),d0 +@cmploop cmp.b (a0)+,(a1)+ + bne.s @dqloop ; not the EDisk + dbra d0,@cmploop + + move.l EDiskDriveInfo.WhereStringPtr(a2),a1 + cmpRom ROMInternalRAMDiskString,a1 + beq.s @isEphemeral + cmp.l #$408E7DA0,a1 ; nearby location? + bne.s @return +@isEphemeral + + subq #4,sp + move.w #-16535,-(sp) ; 'Internal RAM Disk' + _GetString + move.l (sp)+,d0 + beq.s @return + move.l d0,a1 + move.l (a1),EDiskDriveInfo.WhereStringPtr(a2) + +@return rts diff --git a/Patches/EDiskLocalNamePatch.a.idump b/Patches/EDiskLocalNamePatch.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Patches/EDiskLocalNamePatch.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Patches/FinalInitialization.a b/Patches/FinalInitialization.a new file mode 100644 index 0000000..fd8f489 --- /dev/null +++ b/Patches/FinalInitialization.a @@ -0,0 +1,86 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Disassembled from scratch +; + + LOAD 'StandardEqu.d' + INCLUDE 'SysPrivateEqu.a' + INCLUDE 'Slots.a' + INCLUDE 'LinkedPatchMacros.a' + + +InitADBDrvr ROMBind (SE,$03C9E),(II,$07724),(Portable,$05BEE),(IIci,$0A7B0) +OpenSlots ROMBind (II,$01370),(IIci,$02240) + + +; Pieced together from StartBoot.a:InitSys7Toolbox + + + MakeInstall AddFontsToChain,(Plus,SE,II,Portable,IIci) + + +VMFinalInitialization InstallProc (Plus,SE,II,Portable,IIci,notAUX) + ; If VM loaded, we need to call MemoryDispatch with selector (-1) so VM can hold the system heap, + ; unhold the boot stack, patch the cursor task, and enable user mode. + + MOVE.L #$5C,D0 ; _MemoryDispatch + _GetOSTrapAddress + MOVE.L A0,D1 + MOVE #$9F,D0 ; _Unimplemented + _GetToolTrapAddress + CMP.L A0,D1 ; Has VM installed itself? + BEQ.S @noVM ; -> No. No Memory Dispatch + +@hasVM MOVEQ #-1,D0 ; Finish VM initialization selector + _MemoryDispatch ; Call VM. + +@noVM RTS ; Return to boot3 (or Gibbly) + + +ADBSecondaryInitialization InstallProc (SE,II,Portable,IIci,notAUX) + JMPROM InitADBDrvr ; Another reinit + + +SlotMgrSecondaryInitializationII InstallProc (II,notAUX) + IMPORT Secondary_Init + + SUB.W #spBlock.spBlockSize,SP ; Make room for a slot parameter block on the stack + MOVEA.L SP,A0 ; Point A0 to the record + BSET #fWarmStart,spBlock.spFlags(A0) ; Set warm start flag + JSR Secondary_Init ; Wake everybody up again + ADD.W #spBlock.spBlockSize,SP ; Remove the param block from the stack + JMPROM OpenSlots ; Open all slot drivers... + + +SlotMgrSecondaryInitializationIIci InstallProc (IIci,notAUX) + SUB.W #spBlock.spBlockSize,SP ; Make room for a slot parameter block on the stack + MOVEA.L SP,A0 ; Point A0 to the record + BSET #fWarmStart,spBlock.spFlags(A0) ; Set warm start flag + _SecondaryInit ; Wake everybody up again + ADD.W #spBlock.spBlockSize,SP ; Remove the param block from the stack + JMPROM OpenSlots ; Open all slot drivers... + + +ColorQDSecondaryInitialization InstallProc (II,IIci) + IMPORT DavesRandomVideoStuff + + JSR DavesRandomVideoStuff ; re-do CheckDevices and video driver patching. + MOVE.L (a5),-(sp) ; point to the same globals we are using now + _InitGraf ; catch all the new devices + _InitPalettes ,autoPop ; me too... + + +SetUpIconCluts InstallProc (Plus,SE,II,Portable,IIci) + IMPORT MakeIconData + + MOVE.L ExpandMem,a0 + PEA ExpandMemRec.emIconCluts(a0) + JSR MakeIconData + RTS + + +FontMgrSecondaryInitialization InstallProc (Plus,SE,II,Portable,IIci) + _InitFonts ,autoPop ; Reinit the font manager (in case a new one's just been loaded) + + END diff --git a/Patches/FinalInitialization.a.idump b/Patches/FinalInitialization.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Patches/FinalInitialization.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Patches/LoadPatches.a b/Patches/LoadPatches.a index 5e99ecc..4430333 100644 --- a/Patches/LoadPatches.a +++ b/Patches/LoadPatches.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted the credits. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: LoadPatches.a ; @@ -130,20 +137,25 @@ Failed Copyright string asis - dc.b '© 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991 Apple Computer Inc.',13 + dc.b '© 1983-1992 Apple Computer Inc.',13 dc.b 'All Rights Reserved.',13 dc.b 13 - dc.b 'Help! Help! We’re being held prisoner in a system software factory!',13 + dc.b 'Help! Help! We’re still being held prisoner in a system software factory!',13 dc.b 13 dc.b 'The Blue Meanies',13 dc.b 13 - dc.b 'Darin Adler',13 - dc.b 'Scott Boyd',13 + dc.b 'Lew Cirne',13 + dc.b 'David Collins',13 + dc.b 'Wayne Correia',13 dc.b 'Chris Derossi',13 - dc.b 'Cynthia Jasper',13 + dc.b 'Pete Helme',13 + dc.b 'Fred Huxham',13 + dc.b 'Don Louv',13 + dc.b 'Kevin MacDonell',13 dc.b 'Brian McGhie',13 dc.b 'Greg Marriott',13 - dc.b 'Beatrice Sochor',13 + dc.b 'Jeff Miller',13 + dc.b 'Fred Monroe',13 dc.b 'Dean Yu',13 align diff --git a/Patches/LowMemoryPrintingPatches.a b/Patches/LowMemoryPrintingPatches.a new file mode 100644 index 0000000..ec1de5b --- /dev/null +++ b/Patches/LowMemoryPrintingPatches.a @@ -0,0 +1,483 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Disassembled from scratch +; + + LOAD 'StandardEqu.d' + INCLUDE 'LinkedPatchMacros.a' + INCLUDE 'PrintTrapsEqu.a' + INCLUDE 'Folders.a' + INCLUDE 'FSEqu.a' + INCLUDE 'LayerEqu.a' + INCLUDE 'Processes.a' + + +Globals RECORD 0,INCREMENT +gPrmnModDate DS.L 1 +gPrmnPrefMem DS.L 1 +gPrmnVolRefNum DS.W 1 +gPrmnDirID DS.L 1 +gPrmnNameHand DS.L 1 +gDialogHit DS.W 1 +gFlag DS.W 1 +GlobalSize EQU * + ENDR + + +kCancel EQU 1 +kPrintLater EQU 2 +kPrintNow EQU 3 + + + +InstallLowMemoryPrinting InstallProc (Plus,SE,II,Portable,IIci) + WITH Globals + + MOVEQ #22,D0 ; create printing global handle + _NewHandle ,sys,clear + MOVE.L ExpandMem,A1 + MOVE.L A0,ExpandMemRec.emLowMemoryPrintingGlobals(A1) + MOVE.L A0,A2 ; save printing globals + + SUBQ #4,SP + MOVE.L #'STR ',-(SP) + MOVE.W #-16601,-(SP) ; "PrintMonitor" + _GetResource ; get it in the system heap + MOVE.L (A2),A0 + MOVE.L (SP)+,gPrmnNameHand(A0) + RTS + + +LowMemoryPrintingDialogPatch PatchProc _GetResource,(Plus,SE,II,Portable,IIci) + IMPORT lowMemPrintDialog + WITH Globals + + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + MOVE.L (A0),A0 + TST.B gFlag(A0) + BNE.S @keepTesting +@jmpOld jmpOld +@keepTesting CMP.L #'PREC',6(SP) + BNE.S @jmpOld + CMP.W #127,4(SP) + BNE.S @jmpOld + +; PREC 127, call original routine... + LEA 10(SP),A0 + SUBQ #4,SP + MOVE.L -(A0),-(SP) + MOVE.W -(A0),-(SP) + BSR.S @jmpOld + MOVE.L (SP)+,D0 + MOVE.L D0,10(SP) + BEQ.S @tailReturn ; pass through nil + +; and tail patch it... + MOVE.L D0,A0 + MOVE.L (A0),A0 + BTST #7,(A0) + BNE.S @tailReturn ; skip if first bit is set? + + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + _HLock + MOVE.L (A0),A0 + LEA gDialogHit(A0),A0 + TST.W (A0) + BNE.S @nodo + MOVE.W ResErr,-(SP) + MOVE.W MemErr,-(SP) + MOVEM.L D1/D2/A0/A1,-(SP) + MOVE.L A0,-(SP) + JSR lowMemPrintDialog + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + _HUnlock + MOVEM.L (SP)+,D1/D2/A0/A1 + MOVE.W (SP)+,MemErr + MOVE.W (SP)+,ResErr +@nodo + CMP.W #3,(A0) + BNE.S @tailReturn + MOVE.L 10(SP),A0 + MOVE.L (A0),A0 + BSET #7,(A0) + +@tailReturn MOVE.L (SP)+,A0 + ADDQ #6,SP + JMP (A0) + + +NastierPatch PatchProc $A8FD,(Plus,SE,II,Portable,IIci) + IMPORT prmtRunning,prmtPrefMem + WITH Globals + + MOVE.L 4(SP),D0 + CMP.L #$04000C00,D0 + BEQ.S @PrOpenDoc + CMP.L #$08000484,D0 + BEQ.S @PrClosDoc + +@jmpOld jmpOld + +@PrClosDoc LEA 12(SP),A0 + MOVE.L -(A0),-(SP) + MOVE.L -(A0),-(SP) + BSR.S @jmpOld + + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + MOVE.L (A0),A0 + CLR.B gFlag(A0) + + MOVE.L (SP)+,A0 + ADDQ #8,SP + JMP (A0) + +@PrOpenDoc MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + MOVE.L (A0),A0 + CLR.W gDialogHit(A0) + + SUBQ #2,SP + JSR prmtRunning + TST.B (SP)+ + BNE.S @jmpOld + + MOVE.L D3,-(SP) + SUBQ #4,SP + JSR prmtPrefMem + MOVE.L (SP)+,D3 + BEQ.S @cannotBackground + BMI.S @cleanupgo + + SUBQ #4,SP + _TempFreeMem + MOVE.L (SP)+,D1 + SUB.L #20*1024,D1 + CMP.L D3,D1 + BGE.S @cleanupgo + +@cannotBackground + MOVE.L (SP)+,D3 + + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + MOVE.L (A0),A0 + MOVE.B #1,gFlag(A0) + + LEA 20(SP),A0 + SUBQ #4,SP + MOVE.L -(A0),-(SP) + MOVE.L -(A0),-(SP) + MOVE.L -(A0),-(SP) + MOVE.L -(A0),-(SP) + BSR.S @jmpOld + MOVE.L (SP)+,20(SP) + + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + MOVE.L (A0),A0 + CMP.W #kCancel,gDialogHit(A0) + BNE.S @noErr + MOVE.W #128,-(SP) + _PrSetError +@noErr + MOVE.L (SP)+,A0 + LEA 16(SP),SP + JMP (A0) + +@cleanupgo MOVE.L (SP)+,D3 + BRA.W @jmpOld + + + +; Return a long, equal to the PrintMonitor's preferred memory partition +; Error if negative +prmtPrefMem PROC EXPORT + WITH Globals,HParamBlockRec,HFileParam + +prmtPrefMemFrm RECORD {A6Link},DECREMENT +result DS.L 1 +return DS.L 1 +A6Link DS.L 1 +HFQEl DS.B ioHFQElSiz +prmonRefNum DS.W 1 +LocalSize EQU * + ENDR + WITH prmtPrefMemFrm + + LINK A6,#LocalSize + MOVE.L A2,-(SP) + CLR.L result(A6) + + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + _HLock + MOVE.L (A0),A2 + TST.L gPrmnDirID(A2) + BNE.S @gotExtn + + SUB.L #2,SP + MOVE.W #kOnSystemDisk,-(SP) + MOVE.L #kExtensionFolderType,-(SP) + CLR.W -(SP) ; do not create + PEA gPrmnVolRefNum(A2) + PEA gPrmnDirID(A2) + MOVEQ #0,D0 + _AliasDispatch ; FindFolder + MOVE.W (SP)+,D0 + BNE @return +@gotExtn + + LEA HFQEl(A6),A0 + MOVEQ #ioHFQElSiz/2-1,D0 +@clearLoop CLR.W (A0)+ + DBRA D0,@clearLoop + + LEA HFQEl(A6),A0 + MOVE.L gPrmnNameHand(A2),A1 + MOVE.L (A1),ioNamePtr(A0) + MOVE.W gPrmnVolRefNum(A2),ioVRefNum(A0) + CLR.W ioFDirIndex(A0) + MOVE.L gPrmnDirID(A2),ioDirID(A0) + _GetCatInfo + BEQ.S @gotPrintMon + MOVE.L D0,result(A6) + BRA.S @return +@gotPrintMon + + TST.L gPrmnModDate(A2) + BEQ.S @globWasZero + MOVE.L gPrmnModDate(A2),D0 + CMP.L ioFlMdDat(A0),D0 + BNE.S @globWasZero + MOVE.L gPrmnPrefMem(A2),result(A6) + BRA.S @return +@globWasZero + MOVE.L ioFlMdDat(A0),gPrmnModDate(A2) + + SUB.L #2,SP + MOVE.W gPrmnVolRefNum(A2),-(SP) + MOVE.L gPrmnDirID(A2),-(SP) + MOVE.L gPrmnNameHand(A2),A1 + MOVE.L (A1),-(SP) + MOVE.B #1,-(SP) + _HOpenResFile + MOVE.W (SP)+,prmonRefNum(A6) + BMI.S @return + + SUB.L #4,SP + MOVE.L #'SIZE',-(SP) + MOVE.W #0,-(SP) + _Get1Resource + MOVE.L (SP)+,D0 + BNE.S @gotSizeRes + SUB.L #4,SP + MOVE.L #'SIZE',-(SP) + MOVE.W #-1,-(SP) + _Get1Resource + MOVE.L (SP)+,D0 + BEQ.S @closeAndReturn +@gotSizeRes + + MOVE.L D0,A0 + MOVE.L (A0),A0 + MOVE.L 2(A0),D0 + MOVE.L D0,result(A6) + MOVE.L D0,gPrmnPrefMem(A2) + +@closeAndReturn + MOVE.W prmonRefNum(A6),-(SP) + _CloseResFile +@return + MOVE.L ExpandMem,A0 + MOVE.L ExpandMemRec.emLowMemoryPrintingGlobals(A0),A0 + _HUnlock + MOVE.L (SP)+,A2 + UNLK A6 + RTS + + +; Return a bool, true if the PrintMonitor is running +prmtRunning PROC EXPORT + WITH Globals + +prmtRunningFrm RECORD {A6Link},DECREMENT +result DS.W 1 +return DS.L 1 +A6Link DS.L 1 +psn DS ProcessSerialNumber +procInfo DS ProcessInfoRec +LocalSize EQU * + ENDR + WITH prmtRunningFrm + + LINK A6,#LocalSize + + MOVEQ #0,D0 + MOVE.L D0,psn.highLongOfPSN(A6) + MOVE.L D0,psn.lowLongOfPSN(A6) + MOVEQ #ProcessInfoRec.size,D1 + MOVE.L D1,procInfo.processInfoLength(A6) + MOVE.L D0,procInfo.processName(A6) + MOVE.L D0,procInfo.processAppSpec(A6) + BRA.S @nextProcess + +@getProcessInfo SUB.L #2,SP + PEA psn(A6) + PEA procInfo(A6) + _GetProcessInformation + TST.W (SP)+ + BNE.S @nextProcess + CMP.L #'prmt',procInfo.processSignature(A6) + BNE.S @nextProcess + MOVE.B #1,result(A6) + BRA.S @return ; Print Monitor 'prmt' running + +@nextProcess SUB.L #2,SP + PEA psn(A6) + _GetNextProcess + TST.W (SP)+ + BEQ.S @getProcessInfo + + CLR.B result(A6) ; not running +@return UNLK A6 + RTS + + +; Dialog: "Your document will be printed in the background when more memory is available" +; Takes one argument: a pointer to a word +; The pointed-to word is set to the hit item: 1 = Cancel, 2 = Print Later, 3 = Print Now +lowMemPrintDialog PROC EXPORT + IMPORT HandToHand + WITH Globals + +lowMemPrintDialogFrm RECORD {A6Link},DECREMENT +result DS.L 1 +return DS.L 1 +A6Link DS.L 1 +oldZone DS.L 1 +newDitlHand DS.L 1 +itemHit DS.W 1 +LocalSize EQU * +savedRegs DS.L 3 + ENDR + WITH lowMemPrintDialogFrm + +@regs REG D7/A3/A4 + + LINK A6,#LocalSize + MOVEM.L @regs,-(SP) + + _GetZone + MOVE.L A0,oldZone(A6) + MOVE.L SysZone,A0 + _SetZone + + SUB.L #4,SP + MOVE.L #'DITL',-(SP) + MOVE.W #-16601,-(SP) + _GetResource + MOVE.L (SP)+,A4 + + SUB.L #2,SP + _ResError + TST.W (SP)+ + BNE @return + + SUB.L #4,SP + MOVE.L #'RECT',-(SP) + MOVE.W #-16601,-(SP) + _GetResource + MOVE.L (SP)+,A3 + + SUB.L #2,SP + _ResError + TST.W (SP)+ + BNE @return + + MOVE.L A4,newDitlHand(A6) + + SUB.L #2,SP + PEA newDitlHand(A6) + JSR HandToHand + TST.W (SP)+ + BEQ.S @ditlCopied + MOVE.L oldZone(A6),A0 + _SetZone + BRA @return +@ditlCopied + + MOVE.L A3,A0 ; the dialog rect + _HLock + + SUB.L #4,SP + MOVEQ #0,D0 + MOVE.L D0,-(SP) ; wStorage = nil + MOVE.L (A3),-(SP) ; boundsRect + MOVE.L D0,-(SP) ; title = nil + MOVEQ #0,D1 + MOVE.B D1,-(SP) ; visible = false + MOVEQ #1,D0 + MOVE.W D0,-(SP) ; procID = 1 + MOVEQ #-1,D0 + MOVE.L D0,-(SP) ; behind = -1 + MOVE.B D1,-(SP) ; goAwayFlag = false + MOVEQ #0,D0 + MOVE.L D0,-(SP) ; refCon = 0 + MOVE.L newDitlHand(A6),-(SP) ; itmLstHndl = newDitlHand + _NewDialog + MOVE.L (SP)+,A4 + + SUB.L #2,SP + MOVE.L A4,-(SP) + MOVEQ #3,D0 + MOVE.W D0,-(SP) + _SetDialogDefaultItem + MOVE.W (SP)+,D7 + + SUB.L #2,SP + MOVE.L A4,-(SP) + MOVEQ #1,D0 + MOVE.W D0,-(SP) + _SetDialogCancelItem + MOVE.W (SP)+,D7 + + MOVE.L A4,-(SP) ; whichWindow = our dialog + MOVEQ #lcMainScreen,D0 + MOVE.B D0,-(SP) ; where = lcMainScreen + MOVEQ #hcCenter,D1 + MOVE.B D1,-(SP) ; horizontalControl = hcCenter + MOVEQ #vcAlertCenter,D0 + MOVE.B D0,-(SP) ; verticalControl = vcAlertCenter + _AutoPositionWindow + + _InitCursor + + MOVE.L A4,-(SP) + _ShowWindow + + MOVEQ #0,D0 + MOVE.L D0,-(SP) ; filterProc = nil + PEA itemHit(A6) + _ModalDialog + + MOVE.L A4,-(SP) + _DisposeDialog + + MOVE.L A3,A0 ; the dialog rect + _HUnlock + + MOVE.L oldZone(A6),A0 + _SetZone + + MOVE.L result(A6),A0 + MOVE.W itemHit(A6),(A0) + +@return MOVEM.L savedRegs(A6),@regs + UNLK A6 + MOVE.L (SP)+,(SP) + RTS diff --git a/Patches/LowMemoryPrintingPatches.a.idump b/Patches/LowMemoryPrintingPatches.a.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/Patches/LowMemoryPrintingPatches.a.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/Patches/MiscPatches.a b/Patches/MiscPatches.a index f34f86d..7380043 100644 --- a/Patches/MiscPatches.a +++ b/Patches/MiscPatches.a @@ -1,3 +1,14 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored the IIci check that removed around Power Manager code. +; Added TSM clean-up code to CleanupApp. Added ExpandMem-based dispatchers +; for several Packs. Added includes to support this new code, plus +; HardwarePrivateEqu.a to support UniversalEqu.a (odd that this was +; missing). +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: MiscPatches.a ; @@ -135,6 +146,12 @@ PRINT PUSH,OFF LOAD 'StandardEqu.d' + include 'Dictionary.a' ; + include 'HardwarePrivateEqu.a' ; + include 'Processes.a' ; + include 'SysEqu.a' ; + include 'SysPrivateEqu.a' ; + include 'TSMPrivate.a' ; INCLUDE 'LinkedPatchMacros.a' INCLUDE 'BTreeEqu.a' include 'MMUEqu.a' @@ -243,7 +260,9 @@ SynchIdleTimeProc PatchProc _SynchIdleTime _PPC ; PPC trap WITH PMgrRec,PowerDispRec ; - BRA.S @Done ; branch always because we are SM ROM + MOVE.L ROMBase,A0 ; ex check for IIci + CMP.W #$67C,8(A0) + BNE.S @Done Testfor hwCbPwrMgr ; do we have a power manager? BEQ.S @Done ; no power cycling MOVE.L PMgrBase,A0 ; Get the Power Manager Globals @@ -338,6 +357,31 @@ CleanupApp PatchProc _CleanupApplication @noEditionMgr ENDIF + ; + ; Clean up Text Services Manager + ; + SUBQ #8,SP ; make space for PSN + CLR.W -(SP) ; clear space to return OSErr + PEA 2(SP) ; push PSN buf ptr + _GetCurrentProcess + TST.W (SP)+ + BNE.S @noKillTSM + + CLR.W -(SP) ; room for result + PEA 2(SP) ; PSN + MOVE.W #0,-(SP) ; flag = false + _InlineAware + TST.B (SP)+ + BEQ.S @noKillTSM + + CLR.W -(SP) + MOVE.W #kMsgKillTSMApp,-(SP) + PEA 4(SP) + _InformTSM + TST.W (SP)+ +@noKillTSM + ADDQ #8,SP ; clean up PSN on stack + ; ; Clean up Compoents and Component insetances belong to this app. ; @@ -444,6 +488,64 @@ get70MgrAttr PROC ; ;___________________________________________________________________________________ +; Dispatch Apple Event Manager through ExpandMem. +Pack8Patch PatchProc _Pack8 + + MOVE.L App2Packs,A0 + MOVE.L ExpandMem,A1 + LEA ExpandMemRec.emPack8Globals(A1),A1 + _ProcHelper + + +; Dispatch PPC Manager through ExpandMem. +Pack9Patch PatchProc _Pack9 + + MOVE.L App2Packs+4,A0 + MOVE.L ExpandMem,A1 + LEA ExpandMemRec.emPack9Globals(A1),A1 + _ProcHelper + + +; Dispatch Edition Manager through ExpandMem. +Pack11Patch PatchProc _Pack11 + + MOVE.L App2Packs+12,A0 + MOVE.L ExpandMem,A1 + LEA ExpandMemRec.emPack11Globals(A1),A1 + _ProcHelper + + +; Dispatch Data Access Manager through ExpandMem. +Pack13Patch PatchProc _Pack13 + + TST.B D0 + BEQ.S @initialize + ; If not initializing right now, check that SnarfMan is initialized. + MOVE.L ExpandMem,A0 + TST.L ExpandMemRec.emSnarfGlobals(A0) + BEQ.S @uninitialized +@initialize MOVE.L App2Packs+20,A0 + MOVE.L ExpandMem,A1 + LEA ExpandMemRec.emPack13Globals(A1),A1 + _ProcHelper + ; And if not already initialized, then fail. +@uninitialized MOVE.L (SP)+,A0 + LSR.W #8,D0 + LSL.W #1,D0 + ADD.W D0,SP + MOVE.W #rcDBPackNotInited,(SP) + JMP (A0) + + +; Dispatch Picture Utilities through ExpandMem. +Pack15Patch PatchProc _Pack15 + + MOVE.L App2Packs+28,A0 + MOVE.L ExpandMem,A1 + LEA ExpandMemRec.emPack15Globals(A1),A1 + _ProcHelper + + ;___________________________________________________________________________________ ; ; dimg entry - Dictionary Manager diff --git a/Patches/PatchIIROM.a b/Patches/PatchIIROM.a index 78869be..96d797e 100644 --- a/Patches/PatchIIROM.a +++ b/Patches/PatchIIROM.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Clobbered SlotVBLQ after disposing the block to prevent use-after-free. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: PatchIIROM.a ; @@ -6978,6 +6985,7 @@ InitSlotStuff ;and dispose the old vbl queue header ptr structure movea.l SlotVBLQ,a0 ; release storage for old SlotVBLQ _DisposPtr + move.l #-1,SlotVBLQ ; prevent use-after-free diff --git a/Patches/PatchIIciROM.a b/Patches/PatchIIciROM.a index dc89a58..c9558f2 100644 --- a/Patches/PatchIIciROM.a +++ b/Patches/PatchIIciROM.a @@ -1,3 +1,14 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Added boxFlag setting code for LCII and PB145. Added code to treat LCII +; like LC (GPI pin not connected). Brought the "new and improved bus error +; handler" back from SCSIMgrHW.a. Removed the "FixBackSANE" patch, which +; overrode the entirety of SANE in non-TERROR ROMs (fixing an unknown +; bug). Protected some Egret- only patch code with checks for a Cuda. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: PatchIIciROM.a ; @@ -1492,6 +1503,8 @@ gestaltSerial PROC EXPORT moveq.l #0,d0 ; assume no GPI connections cmpi.w #gestaltMacLC,machType(a0) ; <107> use real machine name now... beq.s @noGPI + cmpi.w #gestaltMacLCII,machType(a0) ; Like LC, LCII has no GPI pin connected + beq.s @noGPI ; ; IIci and IIsi have GPI connected moveq.l #(1< cmp.l SCSIHsk,d0 ; was it a SCSI chip access ? beq.s @start ; if so, start processing the bus error + movem.l d1/a4,-(sp) ; save what we will trash + move.l SCSIGlobals,a4 ; load our globals reference + move.l SCSI2Base,d1 ; is the external SCSI chip base address valid? + beq.s @NoSCSIBus2 ; -> no, cleanup and bail + + cmp.l scsiGlobalRecord.hhsk5380_2(a4),d0 ; was it an external SCSI chip access ? + beq.s @Is2ndSCSI ; if so, start processing the bus error + +@NoSCSIBus2 ; + movem.l (sp)+,d1/a4 ; restore d1/a4 + + move.l (sp)+,d0 ; restore d0 move.l OldBusErrVct(a6),-(sp) ; put old bus error handler addr on stack rts ; jump to old handler, assuming it'll RTE <29> +@Is2ndSCSI ; + movem.l (sp)+,d1/a4 ; restore d1/a4 + @start subq.w #1,BusErrCount(a6) ; retry until we get tired @@ -8047,6 +8075,18 @@ FixUpLooP move.l (A0)+, D1 ;========================================================================================= +;———————————————————————————————————————————————————————————————————————————— +; Distinguish LCII from the LC using ROM version +; + cmp.b #boxMacLC,BoxFlag + bne.s @notLCII + move.l RomBase,a0 + cmp.b #$19,ROMHeader.ROMRelease(a0) + bne.s @notLCII + move.b #boxMacLCII,BoxFlag +@notLCII + + ;———————————————————————————————————————————————————————————————————————————— GGD <8.4> ; Fix _StripAddress to not check the MMStartMode bit of MMFlags at runtime, ; because the memory manager changes that bit when accessing ROM resources, @@ -8090,7 +8130,11 @@ FixStripAddress BTST.L #hwCbPwrMgr,D0 ; Do we have a PowerMgr? BEQ.S @DoneTimLC ; -> No. This is not a Portable of any kind ; We're on a TERROR $67C ROM with a PwrMgr and no FPU. + BTST.B #0,$50FB4000 ; Interrogate the JAWS "25MHz" flag. + BNE.S @jaws25 ; -> Set. We're on a "25 MHz PowerBook 140"... MOVE.B #boxPowerBook140,boxFlag ; We're on a Tim LC. Stuff the right boxFlag <146> + BRA.S @DoneTimLC ; -> Unset. +@jaws25 MOVE.B #boxPowerBook145,boxFlag ; ...Which is a PowerBook 145! Stuff the boxFlag. @DoneTimLC ;———————————————————————————————————————————————————————————————————————————— <130><131><8><9> @@ -8148,98 +8192,7 @@ FixStripAddress @FixPMLoopEnd MOVE.L D2,(A0)+ ; stash correct address, bump A0 DBRA D0,@FixPMLoop ; and count down, including zero. dvb <8.3> end -;__________________________________________________________________________ -;__________________________________________________________________________ - -FixBackSANE MOVE.L #'fpu ',D0 ; Gestalt FPU selector - _Gestalt ; Do it - MOVE.L A0,D0 ; Do we have an FPU? - BEQ @ReallyDone ; -> No, do nothing - - MOVE.L ROMBase,A0 ; Get ROM base - CMPI.B #TERRORminorVers,18(A0) ; Is this TERROR 067C ROM? - BEQ @ReallyDone ; -> Yes, leave the ROM SANE enabled! - CMPI.B #ZYDECOminorVers,18(A0) ; Is this Zydeco 067C ROM? - BEQ @ReallyDone ; -> Yes, leave the ROM SANE enabled! - -@DisableSANEinROM - MOVE.B ResLoad,-(SP) ; Save current resLoad state - MOVE.W CurMap,-(SP) ; Save Current Rsrc Map refNum - CLR.W CurMap ; Make the System the current Map (CurMap = 0) - - SF ResLoad ; Don't actually read the rsrc - CLR.L -(SP) ; Result - MOVE.L #'PACK',-(SP) ; Type - MOVE.W #4,-(SP) ; Id 4 - _Get1Resource - MOVE.L (SP)+,D0 ; Did we get it? - BEQ @Done ; -> No, PACK 4 is not on the disk. Exit Now! (Use the ROM SANE) - MOVE.L D0,-(SP) - _ReleaseResource ; Make the System SANE handle go away. (or we'll get it at the _RmveRsrc) - - SF ResLoad ; Don't actually read the rsrc - CLR.L -(SP) ; Result - MOVE.L #'PACK',-(SP) ; Type - MOVE.W #5,-(SP) ; Id 5 - _Get1Resource - MOVE.L (SP)+,D0 ; Did we get it? - BEQ @Done ; -> No, PACK 5 is not on the disk. Exit Now! (Use the ROM SANE) - MOVE.L D0,-(SP) - _ReleaseResource ; Make the System SANE handle go away. (or we'll get it at the _RmveRsrc) - - ST RomMapInsert ; Put the ROM map in first - MOVE.W #1,CurMap ; Make the ROM map current - - CLR.L -(SP) ; Result - MOVE.L #'PACK',-(SP) ; Type - MOVE.W #4,-(SP) ; Id 4 - _Get1Resource - MOVE.L (SP)+,D0 ; Did we get it? - BEQ.S @Try45 ; -> No, try 4 five. - - MOVE.L D0,-(SP) ; The Handle (save a copy of it) - MOVE.L ROMMapHndl,-(SP) ; Save this - MOVE.L #-1,ROMMapHndl ; To fool SetResAttr into letting use change ROM rsrc attrs - - MOVE.L D0,-(SP) ; The Handle (push it. Push it good) - MOVE.W #$50,-(SP) ; A good value (Unprotected) - _SetResAttrs - MOVE.L (SP)+,ROMMapHndl - - MOVE.W #1,CurMap ; Set CurMap to the ROM rsrc map - ST RomMapInsert ; Dont load the rsrc into memory - _RmveResource - -@Try45 ST RomMapInsert ; Put the ROM map in first - - CLR.L -(SP) ; Result - MOVE.L #'PACK',-(SP) ; Type - MOVE.W #5,-(SP) ; Id 5 - _Get1Resource - MOVE.L (SP)+,D0 ; Did we get it? - BEQ.S @Done ; -> No, exit - - MOVE.L D0,-(SP) ; The Handle (save a copy of it) - MOVE.L ROMMapHndl,-(SP) ; Save this - MOVE.L #-1,ROMMapHndl ; To fool SetResAttr into letting use change ROM rsrc attrs - - MOVE.L D0,-(SP) ; The Handle (push it. Push it good) - MOVE.W #$50,-(SP) ; A good value (Unprotected) - _SetResAttrs - MOVE.L (SP)+,ROMMapHndl - - MOVE.W #1,CurMap ; Set CurMap to the ROM rsrc map - ST RomMapInsert ; Dont load the rsrc into memory - _RmveResource - -@Done MOVE.W (SP)+,CurMap ; Restore the current res map - MOVE.B (SP)+,resLoad ; Restore ResLoad -@ReallyDone -;__________________________________________________________________________ -;__________________________________________________________________________ - - - +; Removed "FixBackSANE" patch to override the SANE in non-TERROR ROMs. ;____________________________________________________________________________ <2> RMP ; This patch is used to fix a problem in the MPW Shell on Eclipse. See above. @@ -8693,6 +8646,10 @@ FixQDColors ; <4.7> AND.B #ClockMask,D0 ; (bits 4-6) <107> SAM (Use ClockMask!) CMP.B #ClockEgret,D0 ; Is bit 5 on? BNE.S @EndOfEgretOnly ; -> Nope, skip this install code + AND.L #EgretFWMask,D0 ; Get Egret "version". + BEQ.S @EndOfEgretOnly ; No Egret -> Skip patch. + CMP.L #Cuda,D0 ; Cuda? + BGE.S @EndOfEgretOnly ; -> Skip patch. ;---------------------------------------------------------------------------------------------------- ; This patch bypasses the physical read of egret when reading the time. The time is automatically diff --git a/Patches/ProcessManagerSegmentTweaks.a b/Patches/ProcessManagerSegmentTweaks.a index d5ea537..5289f03 100644 --- a/Patches/ProcessManagerSegmentTweaks.a +++ b/Patches/ProcessManagerSegmentTweaks.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Removed code to preflight the system heap with ResrvMem +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ProcessManagerSegmentTweaks.a ; @@ -34,21 +41,12 @@ LoadProcessManagerSegmentsLowerInSysHeap InstallProc (Plus,SE,II,IIci,Portable) _CurResFile ; Remember the current resource file clr.w -(sp) _UseResFile ; Work on the System file - move.b ResLoad,-(sp) ; Save current resource load state lea ProcessManagerSegmentTable,a4 ; Table of Process Manager segments to load low @loadLoop move.w (a4)+,d7 ; Get the segment number bz.s @doneWithSegments ; Did ’em all - sf ResLoad ; Don’t load in resources - subq #8,sp ; Space for _SizeResource result too - move.l #kProcessManagerSegmentType,-(sp) - move.w d7,-(sp) - _Get1Resource - _SizeRsrc ; Find out how big it is - move.l (sp)+,d0 ; Get the size - _ResrvMem ,Sys ; Make some space low in the heap - st ResLoad ; Load it in for real now +; Don't preflight with Get1Resource/SizeRsrc/ResrvMem subq #4,sp move.l #kProcessManagerSegmentType,-(sp) move.w d7,-(sp) @@ -57,7 +55,6 @@ LoadProcessManagerSegmentsLowerInSysHeap InstallProc (Plus,SE,II,IIci,Portable) bra.s @loadLoop @doneWithSegments - move.b (sp)+,ResLoad ; Restore resource load state _UseResFile ; The current resource file is on the stack rts diff --git a/Patches/VideoPatch.a b/Patches/VideoPatch.a index b2c9b1d..96c8502 100644 --- a/Patches/VideoPatch.a +++ b/Patches/VideoPatch.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Added extra CLRs to ensure spId/spTBMask is initialized for the SlotMgr. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: VideoPatch.a ; @@ -481,7 +488,9 @@ ROMMinVer Equ $12 ; Offset from ROMBase to RAM Major version word. StartDAFB Move.l A3,A0 ; Get spBlock ptr into A0. Clr.b spSlot(A0) ; We only care about Slot $0. + Clr.b spId(A0) ; Clr.b spExtDev(A0) ; (No external device.) + Clr.b spTBMask(A0) ; Move.w #catDisplay,spCategory(A0) ; Look for: Display, Move.w #typVideo,spCType(A0) ; Video, Move.w #drSwApple,spDrvrSW(A0) ; Apple, @@ -970,6 +979,7 @@ StartJMFB Move.b D3,spSlot(A0) ; Set the slot number to search in. Clr.b spId(A0) ; Begin at id 0. Clr.b spExtDev(A0) ; No external device. + Clr.b spTBMask(A0) ; Move.w #catDisplay,spCategory(A0) ; Look for: Display, Move.w #typVideo,spCType(A0) ; Video, Move.w #drSwApple,spDrvrSW(A0) ; Apple, diff --git a/ProcessMgr/DAHandler.a b/ProcessMgr/DAHandler.a index 3e7b61b..d13df5c 100644 --- a/ProcessMgr/DAHandler.a +++ b/ProcessMgr/DAHandler.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted <4> by recreating the non-standard "MyGestalt" glue asm. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: DAHandler.a ; @@ -172,4 +179,20 @@ GSHSDone ENDPROC +;--------------------------------------------------------------------------------------- +; Non-standard glue, only used at DAHandler init ex<4> +; (Marks the Init segment for UnloadSeg calls) + + SEG 'Init' +MYGESTALT PROC EXPORT + + MOVE.L 8(SP),D0 + _Gestalt + MOVE.L 4(SP),A1 + MOVE.L A0,(A1) + MOVE.L (SP)+,A0 + LEA.L 8(SP),SP + MOVE.W D0,(SP) + JMP (A0) + END diff --git a/ProcessMgr/DAHandler.c b/ProcessMgr/DAHandler.c index 28fac01..01a6c01 100644 --- a/ProcessMgr/DAHandler.c +++ b/ProcessMgr/DAHandler.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <16> by using the non-standard "MyGestalt" glue for an init- + time Gestalt call, and for freeing the Init code segment. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: DAHandler.c @@ -392,7 +400,7 @@ main(void) // <12> Now that DAHandler is up and running, it’s Init and %A5Init segments can be // unloaded. - UnloadSeg((Ptr) StartupCode); // <12> Unload Init + UnloadSeg((Ptr) MyGestalt); // <12> ex<16> Unload Init UnloadSeg((Ptr) _DataInit); // <12> Unload %A5Init /* The event loop */ @@ -509,7 +517,7 @@ InitConfig(void) Colorized = false; Has32BitQD = false; - if (Gestalt(gestaltQuickdrawVersion,&qdInfo) == noErr) + if (MyGestalt(gestaltQuickdrawVersion,&qdInfo) == noErr) // ex<16> { qdInfo &= 0xFFFF; Colorized = (qdInfo >= gestalt8BitQD); diff --git a/ProcessMgr/Eppc.c b/ProcessMgr/Eppc.c index b271fae..753f12b 100644 --- a/ProcessMgr/Eppc.c +++ b/ProcessMgr/Eppc.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted the MemoryMgrPriv.h include from <25>, as incompatible with + Zone.h, instead getting MoveHLow from EppcPrivate.h. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: Eppc.c @@ -206,7 +214,6 @@ #include #include #include -#include #include #include #include diff --git a/ProcessMgr/EppcPrivate.h b/ProcessMgr/EppcPrivate.h index f678fa6..df51dbf 100644 --- a/ProcessMgr/EppcPrivate.h +++ b/ProcessMgr/EppcPrivate.h @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <8> by bringing MoveHLow back from MemoryMgrPriv.h (to be + included indirectly by Eppc.c). + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: EppcPrivate.h @@ -107,4 +115,8 @@ void postReturnReceipt(const MFmsgBlkPtr mfMsgBlk, signed short rtnModifiers); void postTranslationResult(MFmsgBlkPtr, OSErr); void flushMsg(MFmsgBlkPtr aMsg, unsigned short rtnModifiers); +#pragma parameter MoveHLow(__A0) // ex<8> +pascal void MoveHLow(Handle h) // ex<8> + = 0xA09D; // ex<8> + #endif __EPPCPRIVATE__ diff --git a/ProcessMgr/Glue.h b/ProcessMgr/Glue.h index b52121b..21be578 100644 --- a/ProcessMgr/Glue.h +++ b/ProcessMgr/Glue.h @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Added MyGestalt prototype here (original location uncertain) for + Startup.c and DAHandler.c. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: Glue.h @@ -150,4 +158,8 @@ debugger(StringPtr message) /* _Debugger */ +/* Assembly-language glue */ +pascal OSErr +MyGestalt(OSType selector,long *response); + #endif __GLUE__ diff --git a/ProcessMgr/ProcessMgr.make b/ProcessMgr/ProcessMgr.make new file mode 100644 index 0000000..4816b17 --- /dev/null +++ b/ProcessMgr/ProcessMgr.make @@ -0,0 +1,257 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Written from scratch to replace missing makefile +# + +ProcessMgrDefs = ∂ + -d WRITENOW_FIX=1 ∂ + -d MSWORKS_FIX=1 ∂ + -d PsychicTV=0 ∂ + +ProcessMgrDefsC = ∂ + -d SYS_SEGMENT_TYPE=∂'scod∂' ∂ + -d NULLPROC_SIGNATURE=∂'TWIT∂' ∂ + -d SYS_PUPPET_STRING_RSRC_TYPE=∂'TWIT∂' ∂ + -d SYS_PUPPET_STRING_RSRC_ID=-16458 ∂ + -d DAH_SEGMENT_ZERO=-16479 ∂ + -d DAH_SIZE_RESOURCE_ID=-16471 ∂ + -d LOMEM_TAB_TYPE=∂'lmem∂' ∂ + -d COLOR_LOMEMTAB_ID=-16458 ∂ + -d BW_LOMEMTAB_ID=-16459 ∂ + +SchedulerObjs = ∂ + {ObjDir}Error.a.o ∂ + {ObjDir}OSDispatch.a.o ∂ + {ObjDir}ProcessMgrMisc.a.o ∂ + {ObjDir}Switch.a.o ∂ + {ObjDir}ZoomRect.a.o ∂ + {ObjDir}Startup.c.o ∂ + {ObjDir}AppleEventExtensions.c.o ∂ + {ObjDir}Data.c.o ∂ + {ObjDir}Debugger.c.o ∂ + {ObjDir}DeskMgrPatches.c.o ∂ + {ObjDir}Eppc.c.o ∂ + {ObjDir}Error.c.o ∂ + {ObjDir}EventMgrPatches.c.o ∂ + {ObjDir}FileSystem.c.o ∂ + {ObjDir}HList.c.o ∂ + {ObjDir}LayerMgrPatches.c.o ∂ + {ObjDir}Memory.c.o ∂ + {ObjDir}MemoryMgrPatches.c.o ∂ + {ObjDir}MemoryMgr24Patches.c.o ∂ + {ObjDir}MemoryMgr32Patches.c.o ∂ + {ObjDir}MenuMgrPatches.c.o ∂ + {ObjDir}OSDispatch.c.o ∂ + {ObjDir}PackageMgrPatches.c.o ∂ + {ObjDir}Patches.c.o ∂ + {ObjDir}Processes.c.o ∂ + {ObjDir}Puppet.c.o ∂ + {ObjDir}Queue.c.o ∂ + {ObjDir}ResourceMgrPatches.c.o ∂ + {ObjDir}Schedule.c.o ∂ + {ObjDir}ScrapCoercion.c.o ∂ + {ObjDir}SegmentLoaderPatches.c.o ∂ + {ObjDir}Sleep.c.o ∂ + {ObjDir}Switch.c.o ∂ + {ObjDir}Utilities.c.o ∂ + {ObjDir}WindowMgrPatches.c.o ∂ + {IfObjDir}interface.o ∂ + {Libraries}Runtime.o ∂ + +DAHandlerObjs = ∂ + {ObjDir}DAHandler.a.o ∂ + {ObjDir}DAHandler.c.o ∂ + {IfObjDir}interface.o ∂ + {Libraries}Runtime.o ∂ + +ProcessMgrINITObjs = ∂ + {ObjDir}ProcessMgrINIT.c.o ∂ + {IfObjDir}interface.o ∂ + + +{ObjDir}ProcessMgrIncludes.D ƒ {ProcessMgrDir}MakePMIncludes.a + Asm {StdEquAOpts} -o Dev:Null -d &DumpFile="'{ObjDir}ProcessMgrIncludes.D'" -i {IntAIncludes} {ProcessMgrDir}MakePMIncludes.a + +{RsrcDir}Scheduler.rsrc ƒƒ {SchedulerObjs} + # Omitting Link's -map arg yields a subtly different binary + Link {SchedulerObjs} ∂ + -m main -map -o {Targ} ∂ + -ra INIT=sysheap,purgeable,locked,preload # scod -16469/$BFAB ∂ + -ra Main=sysheap,locked # scod -16468/$BFAC ∂ + -ra zone_tools=sysheap,locked,preload # scod -16467/$BFAD ∂ + -ra zone32_tools=sysheap,locked,preload # scod -16466/$BFAE ∂ + -ra zone24_tools=sysheap,locked,preload # scod -16465/$BFAF ∂ + -ra kernel_segment=sysheap,locked # scod -16464/$BFB0 ∂ + -ra %A5Init=sysheap,purgeable,locked # scod -16463/$BFB1 ∂ + -ra eppc_segment=sysheap,locked # scod -16462/$BFB2 ∂ + -ra Debugger=sysheap # scod -16461/$BFB3 ∂ + > {TextDir}Scheduler.map + {ToolDir}CODE2scod {Targ} -16470 # scod -16470/$BFAA (jt) + +{RsrcDir}DAHandlerCode.rsrc ƒ {DAHandlerObjs} + Link {DAHandlerObjs} ∂ + -map -o {Targ} ∂ + -ra Main=sysheap,purgeable,locked # scod -16478/$BFA2 ∂ + -ra Init=sysheap,purgeable,locked # scod -16477/$BFA3 ∂ + -ra %A5Init=sysheap,purgeable,locked # scod -16476/$BFA4 ∂ + > {TextDir}DAHandler.map + {ToolDir}CODE2scod {Targ} -16479 # scod -16479/$BFA1 (jt) + +{BuildDir}ProcessMgrINIT ƒ {ProcessMgrDir}ProcessMgrINIT.r {ProcessMgrINITObjs} {RsrcDir}Scheduler.rsrc + Set RealObjDir {ObjDir}; Set ObjDir {RsrcDir} # Hack to adapt to old build system + Rez {StdROpts} {ProcessMgrDir}ProcessMgrINIT.r -o {Targ} # Includes the scods from Scheduler.rsrc + Set ObjDir {RealObjDir} + Link {ProcessMgrINITObjs} -rt INIT=128 -t INIT -m main -o {Targ} + + +{ObjDir}Error.a.o ƒ {ProcessMgrDir}Error.a + Asm {ProcessMgrDefs} {StdAOpts} -o {Targ} {ProcessMgrDir}Error.a + +{ObjDir}OSDispatch.a.o ƒ {ProcessMgrDir}OSDispatch.a + Asm {ProcessMgrDefs} {StdAOpts} -o {Targ} {ProcessMgrDir}OSDispatch.a + +{ObjDir}ProcessMgrMisc.a.o ƒ {ProcessMgrDir}ProcessMgrMisc.a + Asm {ProcessMgrDefs} {StdAOpts} -o {Targ} {ProcessMgrDir}ProcessMgrMisc.a + +{ObjDir}Switch.a.o ƒ {ProcessMgrDir}Switch.a + Asm {ProcessMgrDefs} {StdAOpts} -o {Targ} {ProcessMgrDir}Switch.a + +{ObjDir}ZoomRect.a.o ƒ {ProcessMgrDir}ZoomRect.a + Asm {ProcessMgrDefs} {StdAOpts} -o {Targ} {ProcessMgrDir}ZoomRect.a + +{ObjDir}AppleEventExtensions.c.o ƒ {ProcessMgrDir}AppleEventExtensions.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}AppleEventExtensions.c + +{ObjDir}Data.c.o ƒ {ProcessMgrDir}Data.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Data.c + +{ObjDir}Debugger.c.o ƒ {ProcessMgrDir}Debugger.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Debugger.c + +{ObjDir}DeskMgrPatches.c.o ƒ {ProcessMgrDir}DeskMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}DeskMgrPatches.c + +{ObjDir}Eppc.c.o ƒ {ProcessMgrDir}Eppc.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Eppc.c + +{ObjDir}Error.c.o ƒ {ProcessMgrDir}Error.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Error.c + +{ObjDir}EventMgrPatches.c.o ƒ {ProcessMgrDir}EventMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}EventMgrPatches.c + +{ObjDir}FileSystem.c.o ƒ {ProcessMgrDir}FileSystem.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}FileSystem.c + +{ObjDir}HList.c.o ƒ {ProcessMgrDir}HList.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}HList.c + +{ObjDir}LayerMgrPatches.c.o ƒ {ProcessMgrDir}LayerMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}LayerMgrPatches.c + +{ObjDir}Memory.c.o ƒ {ProcessMgrDir}Memory.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Memory.c + +{ObjDir}MemoryMgr24Patches.c.o ƒ {ProcessMgrDir}MemoryMgr24Patches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}MemoryMgr24Patches.c + +{ObjDir}MemoryMgr32Patches.c.o ƒ {ProcessMgrDir}MemoryMgr32Patches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}MemoryMgr32Patches.c + +{ObjDir}MemoryMgrPatches.c.o ƒ {ProcessMgrDir}MemoryMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}MemoryMgrPatches.c + +{ObjDir}MenuMgrPatches.c.o ƒ {ProcessMgrDir}MenuMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}MenuMgrPatches.c + +{ObjDir}OSDispatch.c.o ƒ {ProcessMgrDir}OSDispatch.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}OSDispatch.c + +{ObjDir}PackageMgrPatches.c.o ƒ {ProcessMgrDir}PackageMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}PackageMgrPatches.c + +{ObjDir}Patches.c.o ƒ {ProcessMgrDir}Patches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Patches.c + +{ObjDir}Processes.c.o ƒ {ProcessMgrDir}Processes.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Processes.c + +{ObjDir}Puppet.c.o ƒ {ProcessMgrDir}Puppet.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Puppet.c + +{ObjDir}Queue.c.o ƒ {ProcessMgrDir}Queue.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Queue.c + +{ObjDir}ResourceMgrPatches.c.o ƒ {ProcessMgrDir}ResourceMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}ResourceMgrPatches.c + +{ObjDir}Schedule.c.o ƒ {ProcessMgrDir}Schedule.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Schedule.c + +{ObjDir}ScrapCoercion.c.o ƒ {ProcessMgrDir}ScrapCoercion.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}ScrapCoercion.c + +{ObjDir}SegmentLoaderPatches.c.o ƒ {ProcessMgrDir}SegmentLoaderPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}SegmentLoaderPatches.c + +{ObjDir}Sleep.c.o ƒ {ProcessMgrDir}Sleep.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Sleep.c + +{ObjDir}Startup.c.o ƒ {ProcessMgrDir}Startup.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Startup.c + +{ObjDir}Switch.c.o ƒ {ProcessMgrDir}Switch.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Switch.c + +{ObjDir}Utilities.c.o ƒ {ProcessMgrDir}Utilities.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}Utilities.c + +{ObjDir}WindowMgrPatches.c.o ƒ {ProcessMgrDir}WindowMgrPatches.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}WindowMgrPatches.c + +{ObjDir}ProcessMgrINIT.c.o ƒ {ProcessMgrDir}ProcessMgrINIT.c + C {ProcessMgrDefs} {ProcessMgrDefsC} {StdCOpts} -o {Targ} {ProcessMgrDir}ProcessMgrINIT.c + +{RsrcDir}Scheduler.rsrc ƒƒ {ProcessMgrDir}ProcessMgr.r + Rez -a {StdROpts} -o {Targ} {ProcessMgrDir}ProcessMgr.r + +{ObjDir}PuppetString.Default.a.o ƒ {ProcessMgrDir}PuppetString.Default.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}PuppetString.Default.a +{RsrcDir}Scheduler.rsrc ƒƒ {ObjDir}PuppetString.Default.a.o + Link {ObjDir}PuppetString.Default.a.o -rt TWIT=-16458 -ra Main=sysheap,locked -o {Targ} + +{ObjDir}PuppetString.MacDraw.a.o ƒ {ProcessMgrDir}PuppetString.MacDraw.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}PuppetString.MacDraw.a +{RsrcDir}Scheduler.rsrc ƒƒ {ObjDir}PuppetString.MacDraw.a.o + Link {ObjDir}PuppetString.MacDraw.a.o -rt MDRW=-16458 -ra Main=sysheap,locked -o {Targ} + +{ObjDir}PuppetString.MacPaint.a.o ƒ {ProcessMgrDir}PuppetString.MacPaint.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}PuppetString.MacPaint.a +{RsrcDir}Scheduler.rsrc ƒƒ {ObjDir}PuppetString.MacPaint.a.o + Link {ObjDir}PuppetString.MacPaint.a.o -rt MPNT=-16458 -ra Main=sysheap,locked -o {Targ} + +{ObjDir}PuppetString.MacWrite.a.o ƒ {ProcessMgrDir}PuppetString.MacWrite.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}PuppetString.MacWrite.a +{RsrcDir}Scheduler.rsrc ƒƒ {ObjDir}PuppetString.MacWrite.a.o + Link {ObjDir}PuppetString.MacWrite.a.o -rt MACA=-16458 -ra Main=sysheap,locked -o {Targ} + +{ObjDir}LomemTab.BlackWhite.a.o ƒ {ProcessMgrDir}LomemTab.BlackWhite.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}LomemTab.BlackWhite.a +{RsrcDir}Scheduler.rsrc ƒƒ {ObjDir}LomemTab.BlackWhite.a.o + Link {ObjDir}LomemTab.BlackWhite.a.o -rt lmem=-16459 -ra Main=sysheap,locked -o {Targ} + +{ObjDir}LomemTab.Color.a.o ƒ {ProcessMgrDir}LomemTab.Color.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}LomemTab.Color.a +{RsrcDir}Scheduler.rsrc ƒƒ {ObjDir}LomemTab.Color.a.o + Link {ObjDir}LomemTab.Color.a.o -rt lmem=-16458 -ra Main=sysheap,locked -o {Targ} + +{ObjDir}DAHandler.a.o ƒ {ProcessMgrDir}DAHandler.a + Asm {StdAOpts} -o {Targ} {ProcessMgrDir}DAHandler.a + +{ObjDir}DAHandler.c.o ƒ {ProcessMgrDir}DAHandler.c + C {StdCOpts} -o {Targ} {ProcessMgrDir}DAHandler.c + +{RsrcDir}DAHandler.rsrc ƒ {ProcessMgrDir}DAHandler.r {RsrcDir}DAHandlerCode.rsrc + Set CodeResFile {RsrcDir}DAHandlerCode.rsrc; Export CodeResFile + Rez {StdROpts} -o {Targ} {ProcessMgrDir}DAHandler.r diff --git a/ProcessMgr/ProcessMgr.make.idump b/ProcessMgr/ProcessMgr.make.idump new file mode 100644 index 0000000..124c75a --- /dev/null +++ b/ProcessMgr/ProcessMgr.make.idump @@ -0,0 +1 @@ +TEXTMPS \ No newline at end of file diff --git a/ProcessMgr/ProcessMgrMisc.a b/ProcessMgr/ProcessMgrMisc.a index ca173ca..108c6df 100644 --- a/ProcessMgr/ProcessMgrMisc.a +++ b/ProcessMgr/ProcessMgrMisc.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted <18> by recreating the non-standard "MyGestalt" glue asm. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ProcessMgrMisc.a ; @@ -1759,4 +1766,19 @@ MNGSaveRegs REG d0-d1/a0-a2 ; working registers ENDPROC +;--------------------------------------------------------------------------------------- +; Non-standard glue, only used at ProcessMgr init ex<18> + + SEG 'INIT' +MYGESTALT PROC EXPORT + + MOVE.L 8(SP),D0 + _Gestalt + MOVE.L 4(SP),A1 + MOVE.L A0,(A1) + MOVE.L (SP)+,A0 + LEA.L 8(SP),SP + MOVE.W D0,(SP) + JMP (A0) + END diff --git a/ProcessMgr/Processes.c b/ProcessMgr/Processes.c index a555eb3..4a081fd 100644 --- a/ProcessMgr/Processes.c +++ b/ProcessMgr/Processes.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Conditionalized a check for a nil CODE 0 handle (a PowerPC-only case) + under "PsychicTV". + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: Processes.c @@ -742,7 +750,9 @@ CreateProcess(InternalLaunchPBPtr pParams, PEntryPtr pNewProc, PEntryPtr pLaunch BlockMove(pCode0->jt, (Ptr)currenta5 + pCode0->jtoffset, pCode0->jtsize); /* Now that things are set up, we can release segment 0 */ +#if PsychicTV // if (SAVESEGHANDLE != nil) +#endif // ReleaseResource(SAVESEGHANDLE); /* Try to set APPLLIMIT to ssize below current stack. We get an error if this diff --git a/ProcessMgr/Startup.c b/ProcessMgr/Startup.c index 233c563..ea28831 100644 --- a/ProcessMgr/Startup.c +++ b/ProcessMgr/Startup.c @@ -1,3 +1,10 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <26> by using the non-standard "MyGestalt" glue. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: Startup.c @@ -511,35 +518,35 @@ InitConfig(void) #endif HAS_AUX_PROCESSMGR /* Check processor addressing mode */ - if (Gestalt(gestaltAddressingModeAttr,&gestaltResult) == noErr) + if (MyGestalt(gestaltAddressingModeAttr,&gestaltResult) == noErr) // ex<26> In32BitMode = ((gestaltResult & (1 << gestalt32BitAddressing)) != 0); /* Check QuickDraw version */ - if (Gestalt(gestaltQuickdrawVersion,&gestaltResult) == noErr) + if (MyGestalt(gestaltQuickdrawVersion,&gestaltResult) == noErr) // ex<26> Colorized = ((gestaltResult & 0xFFFF) >= gestalt8BitQD); /* Does this machine have an FPU? */ - if (Gestalt(gestaltFPUType,&gestaltResult) == noErr) + if (MyGestalt(gestaltFPUType,&gestaltResult) == noErr) // ex<26> MachineHasFPU = (gestaltResult != gestaltNoFPU); /* Does this machine have an older style keyboard (without an escape key)? */ - if (Gestalt(gestaltKeyboardType,&gestaltResult) == noErr) + if (MyGestalt(gestaltKeyboardType,&gestaltResult) == noErr) // ex<26> MachineHasMacPlusKbd = (gestaltResult <= gestaltMacPlusKbd); - if (Gestalt(gestaltGraphicsVersion,&gestaltResult) == noErr) + if (MyGestalt(gestaltGraphicsVersion,&gestaltResult) == noErr) // ex<26> skiaExists = true; else skiaExists = false; #ifdef MODSQUAD /* Check whether drag manager is installed. */ - if (Gestalt(gestaltDragMgrVersion, &gestaltResult) == noErr) + if (MyGestalt(gestaltDragMgrVersion, &gestaltResult) == noErr) // ex<26> gDragMgrIsAvailable = true; #endif #ifdef HAS_AUX_PROCESSMGR /* Check whether we're running under AUX. */ - if (Gestalt(gestaltAUXVersion, &gestaltResult) == noErr && AUX_EnableCoffLaunch()) + if (MyGestalt(gestaltAUXVersion, &gestaltResult) == noErr && AUX_EnableCoffLaunch()) // ex<26> AUXIsPresent = true; #endif HAS_AUX_PROCESSMGR } diff --git a/ProcessMgr/Switch.a b/ProcessMgr/Switch.a index b56d520..45cbc85 100644 --- a/ProcessMgr/Switch.a +++ b/ProcessMgr/Switch.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted <7> and <8> by restoring the simple jsr (a3) call to plain +; BlockMove, without needing to save/set/restore d1 to hold the +; BlockMoveData trap word. Also reverted the one BlockMoveData trap. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: Switch.a ; @@ -264,7 +273,7 @@ saveInfo movea.l saveArea(a1),a1 ; get the handle movea.l (a1),a1 ; (destination) get pointer heap block movea.l sp,a0 ; (source) get pointer to stacked info - _BlockMoveData ; copy the data + _BlockMove ; copy the data ; cleanup up and leave leaveNow @@ -287,8 +296,8 @@ dummyvbl PROC EXPORT ; save_lmemtab. Copy the switchable lomem into a safe area. save_lmemtab PROC EXPORT IMPORT (switchTabPtr, blockTrapAddr):DATA -SaveRegs REG a2-a4/d1-d2 -SaveRegSize EQU 5*4 +SaveRegs REG a2-a4/d2 ; ex<8> No need to save D1 +SaveRegSize EQU 4*4 ; ex<8> movem.l SaveRegs,-(sp) ; save work registers move.l SaveRegSize+4(sp),a4 ; get pointer to PCB storage @@ -348,12 +357,7 @@ SaveOneLoop UseBlockMove move.l a4,a1 ; a1 = destination add.l d0,a4 ; update our storage address - if not(PsychicTV) then - move.w #$A22E,d1 ; <8> - jsr (a3) - else - _BlockMove ; <8> - endif + jsr (a3) ; ex<7> ex<8> unadorned BlockMove bra.s SaveAllLoop ; now get next entry @@ -368,8 +372,8 @@ AllSaved ; restore_lmemtab. Copy the saved switchable lomem back into lomem. restore_lmemtab PROC EXPORT IMPORT (switchTabPtr, blockTrapAddr):DATA -SaveRegs REG a2-a4/d1-d2 -SaveRegSize EQU 5*4 +SaveRegs REG a2-a4/d2 ; ex<8> No need to save D1 +SaveRegSize EQU 4*4 ; ex<8> movem.l SaveRegs,-(sp) ; save work registers move.l SaveRegSize+4(sp),a4 ; get pointer to PCB storage @@ -429,12 +433,7 @@ RestoreOneLoop UseBlockMove move.l a4,a0 ; setup source pointer for blockmove add d0,a4 ; and increment pointer by count - if not(PsychicTV) then - move.w #$A22E,d1 ; <8> - jsr (a3) - else - _BlockMove ; <8> - endif + jsr (a3) ; ex<7> ex<8> unadorned BlockMove bra.s RestoreAllLoop ; now get next entry diff --git a/ProcessMgr/Switch.c b/ProcessMgr/Switch.c index b6b7a17..256ce6b 100644 --- a/ProcessMgr/Switch.c +++ b/ProcessMgr/Switch.c @@ -1,3 +1,10 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <21> by restoring plain BlockMoves. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: Switch.c @@ -374,7 +381,7 @@ save_lomem(PEntryPtr pp) pc->appllimit = APPLLIMIT; pc->applzone = APPLZONE; pc->currenta5 = (unsigned long)CURRENTA5; - BlockMoveData(CURAPNAME, &pc->curapname, *((unsigned char *)CURAPNAME) + 1); + BlockMove(CURAPNAME, &pc->curapname, *((unsigned char *)CURAPNAME) + 1); // ex<21> pc->curlayer = GetCurLayer(); pc->topmaphandle = TOPMAPHANDLE; pc->curmap = CURMAP; @@ -439,7 +446,7 @@ restore_lomem(PEntryPtr pp, Boolean shouldRestoreVolatile) */ APPLLIMIT = pc->appllimit; CURRENTA5 = pc->currenta5; - BlockMoveData(&pc->curapname, CURAPNAME, Length(&(pc->curapname)) + 1); + BlockMove(&pc->curapname, CURAPNAME, Length(&(pc->curapname)) + 1); // ex<21> SetCurLayer(pc->curlayer); TOPMAPHANDLE = pc->topmaphandle; CURMAP = pc->curmap; diff --git a/ProcessMgr/WindowMgrPatches.c b/ProcessMgr/WindowMgrPatches.c index e91f673..ec76bb4 100644 --- a/ProcessMgr/WindowMgrPatches.c +++ b/ProcessMgr/WindowMgrPatches.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Partly reverted <7> by moving back to the array definition of Pattern, + requiring a BlockMove instead of a simple assignment to copy. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: WindowMgrPatches.c @@ -26,6 +34,7 @@ */ +#define dangerousPattern // ex<7> #include #include #include @@ -71,7 +80,7 @@ c_initwindows(void) DSWNDUPDATE |= ((char)0x80); SetPort(WMGRPORT); - DESKPATTERN = **GetPattern(deskPatID); + BlockMove(*GetPattern(deskPatID), &DESKPATTERN, sizeof(Pattern)); // ex<7> ShowCursor(); olda5 = ProcessMgrA5SimpleSetup(); diff --git a/QuickDraw/Classic/Text.m.a b/QuickDraw/Classic/Text.m.a index 3560873..ab5d418 100644 --- a/QuickDraw/Classic/Text.m.a +++ b/QuickDraw/Classic/Text.m.a @@ -179,6 +179,7 @@ XOFFSET EQU 22 ;WORD RASTER EQU 24 ;WORD + MakePatch BWStdText,_StdText,(Plus,SE,Portable) ; BWStdText PROC EXPORT IMPORT BWDrText @@ -744,6 +745,7 @@ NOTPIC MOVE D6,-(SP) ;PUSH COUNT GOHOME MOVEM.L (SP)+,D5-D7/A3-A4 ;RESTORE REGS UNLINK PARAMSIZE,'STDTEXT ' + MakePatch BWStdTxMeas,_StdTxMeas,(Plus,SE,Portable) ; BWStdTxMeas FUNC EXPORT IF SCRIPT_CHAR_EXTRA THEN @@ -959,6 +961,8 @@ noOverFlow ; <24-CEL/RWB> IF (SCRIPT_CHAR_EXTRA OR hasDoubleByte) THEN ;<1.4-4april89-CEL> <6> CEL + MakePatch BWMeasureText,_MeasureText,(Plus,SE,Portable) ; + PROC EXPORT BWMeasureText diff --git a/QuickDraw/Text.a b/QuickDraw/Text.a index c8183af..52d670c 100644 --- a/QuickDraw/Text.a +++ b/QuickDraw/Text.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Made all patch routines self-installing with MakePatch macros on color +; machines. Restored some RomBinds that were probably deleted from +; SuperMario, although possibly not from this file. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: Text.a ; @@ -181,6 +190,13 @@ hasGlyphState EQU 1 EndIf INCLUDE 'SysPrivateEqu.a' INCLUDE 'LinkedPatchMacros.a' + +CheckPic RomBind (II,$20ef2),(IIci,$33780) ; +DPutPicByte RomBind (II,$20806),(IIci,$32bf0) ; +DPutPicOp RomBind (II,$20884),(IIci,$32c90) ; +PutPicData RomBind (II,$207f0),(IIci,$32bd0) ; +PutPicLong RomBind (II,$20830),(IIci,$32c30) ; +PutPicWord RomBind (II,$2081e),(IIci,$32c10) ; ;—————————————————————————————————————————————————————————————————————————————— MACHINE MC68020 @@ -218,6 +234,8 @@ RASTER EQU 24 ;WORD ; Note that this is a fairly inelegant head patch to the ; real StdText, hereafter referred to as "ReglarStdText" + MakePatch StdText,_StdText,(II,IIci) ; + StdText PROC EXPORT IMPORT ReglarStdText @@ -1134,6 +1152,8 @@ GOHOME UNLINK PARAMSIZE,'TEXTWIDT' ENDIF ; NOT hasSplineFonts <1.6-4april89-CEL> + MakePatch StdTxMeas,_StdTxMeas,(II,IIci) ; + StdTxMeas FUNC EXPORT IMPORT CalcCharExtra @@ -1353,6 +1373,8 @@ noOverFlow ; <30-CEL/RWB> IF (forROM OR SCRIPT_CHAR_EXTRA OR hasDoubleByte) THEN ;<1.6-4april89-CEL> <8> CEL + MakePatch MeasureText,_MeasureText,(II,IIci) ; + PROC EXPORT MeasureText IMPORT CalcCharExtra diff --git a/Toolbox/ComponentMgr/ThingManagerPatch.a b/Toolbox/ComponentMgr/ThingManagerPatch.a new file mode 100644 index 0000000..dc21279 --- /dev/null +++ b/Toolbox/ComponentMgr/ThingManagerPatch.a @@ -0,0 +1,38 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Disassembled from scratch +; + + LOAD 'StandardEqu.d' + INCLUDE 'GestaltEqu.a' + INCLUDE 'LinkedPatchMacros.a' + + +InstallThingManager InstallProc (Plus,SE,II,Portable,IIci) + import __InitComponentManager + + move.w #$A82A,d0 + leaResident MainComponent,a0 + _SetTrapWordAddress + + jsr __InitComponentManager + + move.l #gestaltComponentMgr,d0 + leaResident GestaltComponentMgrVersion,a0 + _NewGestalt + + rts + + +GestaltComponentMgrVersion Proc Export + import __ComponentManagerVersion + + clr.l -(sp) + jsr __ComponentManagerVersion + move.l 8(sp),a0 + move.l (sp)+,(a0) + move.l (sp)+,a0 + addq #8,sp + clr.w (sp) + jmp (a0) diff --git a/Toolbox/ControlMgr/ButtonCDEF.a b/Toolbox/ControlMgr/ButtonCDEF.a index 31a3008..4172ad1 100644 --- a/Toolbox/ControlMgr/ButtonCDEF.a +++ b/Toolbox/ControlMgr/ButtonCDEF.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted word branch. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ButtonCDEF.a ; @@ -159,7 +166,7 @@ FrameSize EQU -58 CMP.W #$3FFF,ROM85 ; do we have color QD? SLS IsColor(A6) ; set boolean depending on color or B&W system - BHI @BWSys ; no, this system has B&W QD CSS + BHI.S @BWSys ; no, this system has B&W QD CSS ; save the current port’s colors and textMode DAF diff --git a/Toolbox/ControlMgr/ControlMgr.make b/Toolbox/ControlMgr/ControlMgr.make index bf53b5c..b995a14 100644 --- a/Toolbox/ControlMgr/ControlMgr.make +++ b/Toolbox/ControlMgr/ControlMgr.make @@ -1,3 +1,11 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added ControlMgrPatches.a and removed ControlMgr.a from the lpch build. +# Added several other new rules for System file defprocs. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: ControlMgr.make # @@ -12,7 +20,7 @@ # 12/2/92 kc Added " || Exit 1" to commands with a double dependency. -ControlMgrObjs = "{ObjDir}ControlMgr.a.o" ∂ +ControlMgrObjs = "{ObjDir}ControlMgrPatches.a.o" # ∂ "{ObjDir}ControlMgrExtensions.a.o" @@ -52,3 +60,40 @@ ControlMgrObjs = "{ObjDir}ControlMgr.a.o" ∂ "{IntAIncludes}ColorEqu.a" ∂ "{ControlMgrDir}ButtonCDEF.a" Asm {StdAOpts} -o "{Targ}" "{ControlMgrDir}ButtonCDEF.a" + +# from here onwards... +"{ObjDir}ControlMgrPatches.a.o" ƒ "{ControlMgrDir}ControlMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{ControlMgrDir}ControlMgrPatches.a" + +"{ObjDir}PopupCDEFMDEF.a.o" ƒ "{ControlMgrDir}PopupCDEFMDEF.a" + Asm {StdAOpts} -o "{Targ}" "{ControlMgrDir}PopupCDEFMDEF.a" + +"{RsrcDir}PopupCDEFMDEF.a.rsrc" ƒ "{ObjDir}PopupCDEFMDEF.a.o" + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o "{Targ}" "{ObjDir}PopupCDEFMDEF.a.o" + +"{RsrcDir}ButtonCDEF.a.rsrc" ƒ "{ObjDir}ButtonCDEF.a.o" + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o "{Targ}" "{ObjDir}ButtonCDEF.a.o" + +"{RsrcDir}ScrollBarCDEF.a.rsrc" ƒ "{ObjDir}ScrollBarCDEF.a.o" + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o "{Targ}" "{ObjDir}ScrollBarCDEF.a.o" + +"{ObjDir}PictButtonCDEF.a.o" ƒ "{ControlMgrDir}PictButtonCDEF.a" + Asm {StdAOpts} -o "{Targ}" "{ControlMgrDir}PictButtonCDEF.a" +"{RsrcDir}PictButtonCDEF.a.rsrc"ƒ "{ObjDir}PictButtonCDEF.a.o" + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o "{Targ}" "{ObjDir}PictButtonCDEF.a.o" + +"{RsrcDir}PopupTriangle.r.rsrc" ƒ "{ControlMgrDir}PopupTriangle.r" + Rez {StdROpts} -i {IntCIncludes} -o "{Targ}" "{ControlMgrDir}PopupTriangle.r" + +PopupCDEFObjs = "{ObjDir}PopupCDEF.a.o" ∂ + "{ObjDir}PopupCDEF.c.o" ∂ + "{IfObjDir}Interface.o" + +"{ObjDir}PopupCDEF.a.o" ƒ "{ControlMgrDir}PopupCDEF.a" + Asm {StdAOpts} -o "{Targ}" "{ControlMgrDir}PopupCDEF.a" + +"{ObjDir}PopupCDEF.c.o" ƒ "{ControlMgrDir}PopupCDEF.c" + C {StdCOpts} -o "{Targ}" "{ControlMgrDir}PopupCDEF.c" + +"{RsrcDir}PopupCDEF.c.rsrc" ƒ {PopupCDEFObjs} + Link {StdLOpts} {StdAlign} -m POPUP -rt RSRC=0 -o "{Targ}" {PopupCDEFObjs} diff --git a/Toolbox/ControlMgr/ControlMgrExtensions.a b/Toolbox/ControlMgr/ControlMgrExtensions.a index 9e72e7d..af6b5c4 100644 --- a/Toolbox/ControlMgr/ControlMgrExtensions.a +++ b/Toolbox/ControlMgr/ControlMgrExtensions.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted the speedup in . The mouse-down and tick-count check loop +; was de-reversed -- this might have been the bugfix component of , +; but it is not clear how. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ControlMgrExtensions.a ; @@ -83,7 +92,7 @@ result DS.W 1 FirstValue EQU 12 ; Number of ticks to begin with. KnownEndValue EQU 3 ; Number of ticks to end with, when the list size is known. UnknownEndValue EQU 0 ; Number of ticks to end with, when the list size is unknown. -DecayValue EQU 48 ; Time to decay from StartValue to EndValue. +DecayValue EQU 108 ; Time to decay from StartValue to EndValue. ex KnownConst EQU DecayValue / (FirstValue - KnownEndValue) UnknownConst EQU DecayValue / (FirstValue - UnknownEndValue) @@ -99,13 +108,14 @@ UnknownConst EQU DecayValue / (FirstValue - UnknownEndValue) CLR.W result(SP) ; No error. ; Commented out 5/18/93 RPC so that EndValue is always 0 for both ListMgr and non-ListMgr alike. -; TST.W itemsVisible(SP) ; Know the number of items visible? -; BEQ.S @unknown ; No, skip this part. -; MOVEQ.L #KnownEndValue, D0 ; EndValue = KnownEndValue -; MOVEQ.L #KnownConst, D1 ; For speed -; BRA.S @calcDelay +; ex Uncommented to revert that change + TST.W itemsVisible(SP) ; Know the number of items visible? + BEQ.S @unknown ; No, skip this part. + MOVEQ.L #KnownEndValue, D0 ; EndValue = KnownEndValue + MOVEQ.L #KnownConst, D1 ; For speed + BRA.S @calcDelay -;@unknown +@unknown MOVEQ.L #UnknownEndValue, D0 ; EndValue = UnknownEndValue MOVEQ.L #UnknownConst, D1 ; For speed @@ -122,17 +132,19 @@ UnknownConst EQU DecayValue / (FirstValue - UnknownEndValue) ; We need to loop until D0 <= TickCount() or the mouse button comes up. MOVE.L D0, -(SP) ; Save the time on the stack. +; ex The order of these two checks was reversed (unclear why) @loopDelay + SUBQ.L #2, SP + _StillDown ; Mouse still down? + TST.B (SP)+ + BEQ.S @endDelay ; ex Was BNE.S @loopDelay + SUBQ.L #4, SP _TickCount MOVE.L (SP)+, D0 CMP.L (SP), D0 ; Timed out? - BHS.S @endDelay ; Yes, Get Out. + BLO.S @loopDelay ; ex Was BHS.S @endDelay - SUBQ.L #2, SP - _StillDown ; Mouse still down? - TST.B (SP)+ - BNE.S @loopDelay ; Yes, Try Again. @endDelay diff --git a/Toolbox/ControlMgr/PopupCDEF.c b/Toolbox/ControlMgr/PopupCDEF.c index fdc54eb..ddda077 100644 --- a/Toolbox/ControlMgr/PopupCDEF.c +++ b/Toolbox/ControlMgr/PopupCDEF.c @@ -1,3 +1,13 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted expectation of finding the menu-widening "wrapper" MDEF + (really a proc resource) in ROM -- probably a bug, because the defproc + resource needs to be writeable. Reverted <43> to use the old array + definition of Pattern. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: PopupCDEF.c @@ -287,6 +297,7 @@ Make popup return different part codes */ +#define dangerousPattern // ex<43> #include #include #include @@ -860,8 +871,7 @@ long DoTrack(ControlHandle hControl, short theVar) useSpandex = (growWidth > 0); if (useSpandex) { // invoke spandex MDEF - *(short*) RomMapInsert = mapTrue; // rb - theHandle = (SpandexH) GetResource(SpandexResType, SpandexMDEF); // rb + theHandle = (SpandexH) GetResource(SpandexResType, SpandexMDEF); // rb if (theHandle != nil) { // load in spandex MDEF LoadResource( (Handle) theHandle ); // load in case of purged -- now unpurgeable so remove this HLock( (Handle) theHandle ); diff --git a/Toolbox/ControlMgr/ScrollBarCDEF.a b/Toolbox/ControlMgr/ScrollBarCDEF.a index 4205ffa..0fab151 100644 --- a/Toolbox/ControlMgr/ScrollBarCDEF.a +++ b/Toolbox/ControlMgr/ScrollBarCDEF.a @@ -1,3 +1,13 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted the refactoring in , as well as the short branches. +; Removed the expectation of finding associated resources in ROM +; (one of the changes is in code moved by ). Changed MOVE.L +; ProcResult to MOVE.B ProcResult+3. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ScrollBarCDEF.a ; @@ -309,8 +319,14 @@ hilite equ 50 ; test if the message is in range + cmp.w #6,message(A6) ; (0-6 good) + bls.s @MsgOK ; + cmp.w #10,message(A6) ; (10 good) + beq.s @MsgOK ; + cmp.w #11,message(A6) ; (11 good) + beq.s @MsgOK ; cmp.w #drawThumbOutlineMsg,message(A6) ; compare to highest value - bhi.s OORange ; We respond to 0-12 <1.2> + bne OORange ; We respond to 0-12, excluding 7-9 <1.2> @MsgOK ; save the penState and set it our way @@ -319,6 +335,63 @@ hilite equ 50 _GetPenState ; remember current penState _PenNormal ; set the pen the way we want it +; ex inlined from procedure "InitDrawingStuff" (for use of DrawSBar, DrawThumbOutline) +; sets up the drawing environment for calls that do drawing ex + +; Determine type of system. We need to know if we have color QuickDraw and a color ex +; window manager port. ex + + cmp.w #$3FFF,ROM85 ; do we have color QD? ex + SLS IsColor(A6) ; set boolean depending on color or B&W system ex + BHI.s @BWSys ; no, this system has B&W QD ex + +; save the current port's colors ex + + move.l GrafGlobals(A5),A0 ; get pointer to grafGlobals DAF ex + move.l thePort(A0),A0 ; get pointer to thePort DAF ex + + PEA SavFgCol(A6) ; save foreColor ex + _GetForeColor ; ex + PEA SavBkCol(A6) ; save backColor too ex + _GetBackColor ; ex + + +; get the CtlAuxRec for this guy and lock it's colortable ex + + CLR.l -(SP) ; return the handle here ex + CLR.b -(SP) ; space for boolean func return ex + move.l CtlHndl(A6),-(SP) ; push the control handle ex + PEA 6(SP) ; push a pointer to placeholder ex + _GetAuxCtl ; get its auxRec ex + addQ #2,SP ; don't need boolean result ex + move.l (SP)+,A0 ; get auxCtl handle ex + move.l (A0),A0 ; a pointer to the auxCtlRec ex + move.l acCTable(A0),A0 ; get colortable's handle <1.3> ex + move.l A0,AuxCtlHndl(A6) ; save the handle ex + _HLock ; lock the handle ex + move.l (A0),AuxCtlPtr(A6) ; save a pointer ex + +; ------------- get a pixmap for drawing the gadgets ------------ ex + + subq.l #4, SP ; room for a PixMapHandle ex + move.l #'pmap', -(SP) ; the Pixmap resource type ex + move.w #kPixmapID, -(SP) ; ID of working pixmap ex + _GetResource ; (don't) look in ROM first ex ex + move.l (SP), workPixmap(A6) ; save it for later ex + + + move.w #kClutID,-(sp) ; ID of clut for pixmap ex + _GetCTable ; ex + move.l (sp)+,workCLUT(a6) ; ex + + move.l workPixmap(a6),a0 ; ex + move.l (a0),a0 ; ex + move.l workCLUT(a6),pmTable(a0) ; Stash colour table into pmap handle ex + +@BWSys ; ex + clr.l tempPixels(A6) ; init this to NIL ex + + ; fetch the parameters into registers lea 8(A6),A0 ; get ptr to first parameter @@ -331,6 +404,11 @@ hilite equ 50 ; case out on the message number + cmp.w #6,d0 ; account for the table lacking selectors 7-9, + bls @LowSelector ; by adjusting the index into the table + subq #3,d0 ; +@LowSelector ; + add D0,D0 ; double for word index lea GoScrollBar,A1 ; get table address add 0(A1,D0),A1 ; compute dispatch address @@ -341,6 +419,24 @@ hilite equ 50 PEA SavePen(A6) ; push savePenState _SetPenState ; restore original pen state +; ex inlined from procedure "RestoreDrawingStuff" (for use of DrawSBar, DrawThumbOutline) +; clean up color stuff ex + + tst.b IsColor(A6) ; ex + beq.s @NoColor1 ; if on B&W, then skip ex + + move.l AuxCtlHndl(A6),A0 ; unlock the CDEF ex + _HUnlock ; ex + PEA SavFgCol(A6) ; ex + _RGBForeColor ; ex + PEA SavBkCol(A6) ; ex + _RGBBackColor ; ex + + move.l workCLUT(a6),-(sp) ; ex + _DisposCTable ; ex + +@NoColor1 ; ex + ; we're done -- restore registers and return to caller @@ -351,8 +447,9 @@ TenBytExit move.l (SP)+,A0 ; get return address add #12,SP ; strip parameters JMP (A0) ; return to caller -JustRTS clr.l ProcResult(a6) ; indicate we didn't handle this message - rts +; don't need this, there are no "unhandled message" entries in the table +; JustRTS clr.l ProcResult(a6) ; indicate we didn't handle this message +; rts GoScrollBar DC.w DrawSBar-GoScrollBar ; draw is message 0 @@ -362,91 +459,13 @@ GoScrollBar DC.w DispSBar-GoScrollBar ; de-allocate indicator region (4) DC.w MoveSBar-GoScrollBar ; move indicator call (5) DC.w ThumbSBar-GoScrollBar ; message 6 is thumb dragging - DC.w JustRTS-GoScrollBar ; message 7 is thumb dragging custom message - DC.w JustRTS-GoScrollBar ; message 8 is not supported - DC.w JustRTS-GoScrollBar ; message 9 is not supported + ; messages 7-9 not included in the table DC.w CalcWholeSBar-GoScrollBar; calc whole regions is message 10 <1.2> DC.w CalcThumbSBar-GoScrollBar; calc thumb regions is message 11 <1.2> DC.w DrawThumbOutline-GoScrollBar; <26> -; sets up the drawing environment for calls that do drawing - -InitDrawingStuff ; - -; Determine type of system. We need to know if we have color QuickDraw and a color -; window manager port. - - cmp.w #$3FFF,ROM85 ; do we have color QD? - SLS IsColor(A6) ; set boolean depending on color or B&W system - BHI.s @BWSys ; no, this system has B&W QD - -; save the current port's colors - - move.l GrafGlobals(A5),A0 ; get pointer to grafGlobals DAF - move.l thePort(A0),A0 ; get pointer to thePort DAF - - PEA SavFgCol(A6) ; save foreColor - _GetForeColor ; - PEA SavBkCol(A6) ; save backColor too - _GetBackColor ; - - -; get the CtlAuxRec for this guy and lock it's colortable - - CLR.l -(SP) ; return the handle here - CLR.b -(SP) ; space for boolean func return - move.l CtlHndl(A6),-(SP) ; push the control handle - PEA 6(SP) ; push a pointer to placeholder - _GetAuxCtl ; get its auxRec - addQ #2,SP ; don't need boolean result - move.l (SP)+,A0 ; get auxCtl handle - move.l (A0),A0 ; a pointer to the auxCtlRec - move.l acCTable(A0),A0 ; get colortable's handle <1.3> - move.l A0,AuxCtlHndl(A6) ; save the handle - _HLock ; lock the handle - move.l (A0),AuxCtlPtr(A6) ; save a pointer - -; ------------- get a pixmap for drawing the gadgets ------------ - - subq.l #4, SP ; room for a PixMapHandle - move.l #'pmap', -(SP) ; the Pixmap resource type - move.w #kPixmapID, -(SP) ; ID of working pixmap - move.w #MapTrue,RomMapInsert ; rb - _GetResource ; look in ROM first rb - move.l (SP), workPixmap(A6) ; save it for later - - - move.w #kClutID,-(sp) ; ID of clut for pixmap - _GetCTable - move.l (sp)+,workCLUT(a6) - - move.l workPixmap(a6),a0 - move.l (a0),a0 - move.l workCLUT(a6),pmTable(a0) ; Stash colour table into pmap handle - -@BWSys - clr.l tempPixels(A6) ; init this to NIL - rts - - -; clean up color stuff - -RestoreDrawingStuff ; - tst.b IsColor(A6) ; - beq.s @NoColor1 ; if on B&W, then skip - - move.l AuxCtlHndl(A6),A0 ; unlock the CDEF - _HUnlock - PEA SavFgCol(A6) ; - _RGBForeColor ; - PEA SavBkCol(A6) ; - _RGBBackColor ; - - move.l workCLUT(a6),-(sp) - _DisposCTable - -@NoColor1 rts +; ex InitDrawingStuff and RestoreDrawingStuff taken from here @@ -466,7 +485,7 @@ ParamSize EQU *-StartParams ; desired "hilite" area code. DrawSBar - bsr InitDrawingStuff ; initialize the drawing environment + ; (no need to) initialize the drawing environment ; if we are drawing to the screen, use _DeviceLoop to handle the case of ; multiple monitors. If we are not drawing to the screen, then _DeviceLoop @@ -498,7 +517,7 @@ DrawSBar move.w #fakeDeviceFlags, -(SP) ; assume non-CQD case clr.l -(SP) ; NIL gDeviceHandle for non-CQD machines btst #6, ROM85 ; Color QuickDraw available? - bnz.s @deviceAndFlagsOk ; of not, fake versions on stack are correct + bnz @deviceAndFlagsOk ; of not, fake versions on stack are correct move.l theGDevice, A1 ; current device GDHandle move.l A1, (SP) ; fix gdHandle on stack move.l (A1), A1 ; point to the device @@ -506,8 +525,8 @@ DrawSBar @deviceAndFlagsOk clr.l -(SP) ; flag clear (not drawing to screen) - bsr.s CDefDrawControl ; draw the control - bra.s RestoreDrawingStuff ; cleanup after doing drawing + bsr CDefDrawControl ; draw the control + rts ; (don't) cleanup after doing drawing @drawToScreen subq #4, SP ; room for RgnHandle @@ -529,7 +548,7 @@ DrawSBar move.l controlRgn(A6), -(SP) _DisposRgn - bra RestoreDrawingStuff ; cleanup after doing drawing + rts ; (don't) cleanup after doing drawing CDefDrawControl @@ -669,7 +688,7 @@ SkipDown bsr SetupColors ; PEA TempRect ; push the rectangle _EraseRect ; paint the shade on the scroll bar - bra.s DoIndicator ; done drawing background of scroll bar + bra DoIndicator ; done drawing background of scroll bar ex @whiteOutScrollBar PEA TempRect ; push the rectangle move.l (A5),A0 ; get grafGlobals @@ -697,12 +716,12 @@ SkipDown DoIndicator bsr IsDisabled ; is it disabled - bz.s FrameCtl ; yes => go frame the control + bz FrameCtl ; yes => go frame the control move.l IndicatorRect(A6),TempRect move.l IndicatorRect+4(A6),TempRect+4 tst.b shaded(a6) ; is it shaded - bnz.s @drawShadedThumb ; yes => handle shaded thumb + bnz @drawShadedThumb ; yes => handle shaded thumb move.l #$FFFF0000,d0 ; Inset height tst.w isHoriz(a6) ; Horizontal thumb? @@ -797,7 +816,7 @@ DrawArrowBox tst.b shaded(a6) ; If we’re drawing in black and white, then bz.s @bwScrollBar ; it doesn’t matter if we’re disabled or not. - bsr.s IsDisabled ; If disabled & drawing in colour, + bsr IsDisabled ; If disabled & drawing in colour, bnz.s @notDisabled ; use black and white arrows to draw. ; Set up colours to match faint gray used in body of scroll bar @@ -847,7 +866,7 @@ IsDisabled move.l (A3),A0 ; get sBar pointer move.w ContrlMin(A0),D0 ; get the min cmp.w ContrlMax(A0),D0 ; same as the max? - beq.s doneChecking ; + beq doneChecking ; move.b ContrlHilite(A0),D0 ; get the hilite parameter addQ.b #1,D0 ; was it 255? doneChecking @@ -1093,7 +1112,7 @@ GetIndRgn ; the whole region was requested CalcWholeSBar - move.l #1, ProcResult(A6) ; return 1 to show that we respond + move.b #1, ProcResult+3(A6); return 1 to show that we respond GetWholeRgn move.l D3,-(SP) ; push the region handle PEA ContrlRect(A0) ; push rectangle pointer @@ -1101,7 +1120,7 @@ GetWholeRgn rts ; all done! CalcThumbSBar - move.l #1, ProcResult(A6) ; return 1 to show that we respond + move.b #1, ProcResult+3(A6); return 1 to show that we respond BRA.s GetIndRgn ; PlotLtGray @@ -1112,13 +1131,13 @@ PlotLtGray beq.s @useOldStyle ; no => fill using black on white move.w #wHiliteShade8,D0 ; use a dark gray for dots in pattern move.w #cArrowShade2,D1 ; use a light gray for the background - bra.s @plotPAT ; + bra @plotPAT ; @useOldStyle move.w #cFrameColor,D0 ; black foreground move.w #cBodyColor,D1 ; white background @plotPAT bsr SetupColors ; set up the foreground and background colors - bsr.s GetOldStyleLtGray ; use common routine to get the PAT + bsr GetOldStyleLtGray ; use common routine to get the PAT move.l (A0),-(SP) ; dereference to get PatPtr _FillRect ; fill the rect @doneGetLtGray @@ -1645,8 +1664,7 @@ SetupColorPict subq.l #4, SP ; room for the PicHandle move.l #'pixs', -(SP) move.w d0, -(SP) ; push the resource ID - move.w #MapTrue,RomMapInsert ; rb - _GetResource ; look in ROM first rb + _GetResource ; (don't) look in ROM first rb move.l (SP)+, A0 ; pixels handle _HLock ; don’t want it to move move.l A0, tempPixels(A6) ; save for dispose @@ -1726,7 +1744,7 @@ AdjustRect ; <26> The following routine is used to draw the outline of the thumb during dragging. DrawThumbOutline - bsr InitDrawingStuff ; initialize the drawing environment + ; (no need to) initialize the drawing environment IF NOT forROM THEN subq.l #4,sp ; get a new rgn @@ -1747,7 +1765,7 @@ DrawThumbOutline _DisposRgn ENDIF ST ProcResult(a6) - bra RestoreDrawingStuff ; cleanup after doing drawing + rts ; (don't) cleanup after doing drawing ; <26> The following routine is for drawing of the outline of a dragged thumb. @@ -1791,7 +1809,7 @@ ThumbDrawRoutine _FrameRect ENDIF - bra.s @doneDrawThumb ; + bra @doneDrawThumb ; @colorWindow ; yes => use the HiliteMode bsr SetupWMgrCPort move.w #hilite,-(sp) ; set HiliteMode diff --git a/Toolbox/DataAccessMgr/DataAccessMgr.c b/Toolbox/DataAccessMgr/DataAccessMgr.c index c2e1e2a..8ef7e8e 100644 --- a/Toolbox/DataAccessMgr/DataAccessMgr.c +++ b/Toolbox/DataAccessMgr/DataAccessMgr.c @@ -1,3 +1,12 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted + 9/2/94 SuperMario ROM source dump (header preserved below) + + Clean diff against SuperMario +*/ + /* File: DataAccessMgr.c @@ -286,8 +295,7 @@ SMInitDBPack(short version) get unlocked and/or purged at the wrong time by PACKHelper. */ - *((short*) RomMapInsert) = mapTrue; - + /* ex GetResource not to use ROM map */ resH = GetResource(COMPCODERESTYPE, COMPCODERESID); if (resH != NULL) { @@ -384,8 +392,7 @@ InstallDefaultHandlers(snarfGlobPtr glob) if (rc == noErr) { /* get the 'rtt#' */ - *((short*) RomMapInsert) = mapTrue; - + /* ex GetResource not to use ROM map */ resH = GetResource(RTTLISTRESTYPE, RTTLISTID); if (resH != NULL) { @@ -406,9 +413,7 @@ InstallDefaultHandlers(snarfGlobPtr glob) resP += sizeof(short); /* load in 'proc' */ - - *((short*) RomMapInsert) = mapTrue; - + /* ex GetResource not to use ROM map */ handlerH = GetResource(RTTCODERESTYPE, handlerID); if (handlerH != NULL) { @@ -2184,8 +2189,7 @@ SMGetNewQuery(short queryID, QueryHandle *query) *query = NULL; /* get the 'qrsc' */ - *((short*) RomMapInsert) = mapTrue; - + /* ex GetResource not to use ROM map */ resH = (queryRes**)GetResource(QRSCRESTYPE, queryID); if (!resH) @@ -2251,8 +2255,7 @@ SMGetNewQuery(short queryID, QueryHandle *query) /* get qdef proc - id 0 means no qdef */ if (resP->qdefID != 0) { - *((short*) RomMapInsert) = mapTrue; - + /* ex GetResource not to use ROM map */ queryP->queryProc = GetResource(QDEFRESTYPE, resP->qdefID); if (!queryP->queryProc) { @@ -2278,8 +2281,7 @@ SMGetNewQuery(short queryID, QueryHandle *query) for (i = 0; i < resP->numQueries; i++) { - *((short*) RomMapInsert) = mapTrue; - + /* ex GetResource not to use ROM map */ *queries = GetResource(QUERYRESTYPE, *wstrID); if (*queries) { diff --git a/Toolbox/DialogMgr/DialogDispatch.a b/Toolbox/DialogMgr/DialogDispatch.a index 09cd85e..d8477f8 100644 --- a/Toolbox/DialogMgr/DialogDispatch.a +++ b/Toolbox/DialogMgr/DialogDispatch.a @@ -1,3 +1,12 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted SuperMario changes (including merged Reality changes) +; 9/2/94 SuperMario ROM source dump (header preserved below) +; +; Clean diff against SuperMario +; + ; ; File: DialogDispatch.a ; @@ -219,7 +228,6 @@ rName ds.b 256 ; resName move.l windowDef(a4),d0 ; Get the defproc handle _StripAddress ; Get rid of variant kept in hi byte (to be clean) - move.w #MapTrue,ROMMapInsert ; this WDEF could be in ROM ! rb move.l d0,-(sp) ; Push the handle pea id(a6) ; VAR id pea rType(a6) ; VAR type @@ -430,7 +438,7 @@ kBOCorner EQU 16 ; Radius for outline frame - linkSave A2-A4/D3-D7 ; link and save the registers to be used + linkSave A2-A4/D4-D7 ; link and save the registers to be used ex<18> move.l theEvent(a6),a2 move.l evtMessage(a2),d4 ; cache event.message @@ -553,17 +561,8 @@ kBOCorner EQU 16 ; Radius for outline frame ; if cursor is over a TE field, then turn cursor to an I-beam, else the arrow - ; Note: the current port may not be our dialog, we need to set it before <19> - ; calling GetMouse since it returns the mouse in local coordinates. <19> - - pea savedPort(a6) ; <19> - _GetPort ; <19> - push.l a4 ; switch current port to get right coordinates <19> - _SetPort ; <19> pea cursorLocation(a6) _GetMouse ; get currect mouse position in local coordinates - push.l savedPort(a6) ; <19> - _SetPort ; restore port <19> subq #2,sp push.l a4 ; this is assumed to be the front window, because of how ClaimEvent works push.l cursorLocation(a6) @@ -650,16 +649,7 @@ kBOCorner EQU 16 ; Radius for outline frame _SetPort @doneUpdate - ; If this is an update event for another window, it will never get cleared until the modal dialog <19> - ; is dismissed. So, we'll never see a null event, which means we need to track the cursor here as <19> - ; well as for null events. Also, A4 points to the window the update event is for, so we need to <19> - ; call FrontWindow to get the dialog we're really interested in. <19> - subq #4,sp ; room for frontmost window <19> - _FrontWindow ; <19> - pop.l a4 ; get frontmost window into a4 <19> - move.b dlgFlagsByte(a4),d6 ; and get the flags into d6 <19> - bra.s @checkCursor ; track cursor in case this update event is always <19> - ; pending and we never get a null event <19> + bra.s @done ; ex<19> diff --git a/Toolbox/DialogMgr/DialogMgr.make b/Toolbox/DialogMgr/DialogMgr.make index 3c71406..7040762 100644 --- a/Toolbox/DialogMgr/DialogMgr.make +++ b/Toolbox/DialogMgr/DialogMgr.make @@ -1,3 +1,13 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Split hypothetical library ModalDialogMenuPatches.lib off from +# a reordered DialogMgr.lib, and put DialogMgrPatches.a back in +# 9/2/94 SuperMario ROM source dump (header preserved below) +# +# Clean diff against SuperMario +# + # # File: DialogMgr.make # @@ -12,17 +22,27 @@ DialogMgrObjects = "{ObjDir}DialogMgr.a.o" ∂ + "{ObjDir}DialogDispatch.a.o" ∂ + "{ObjDir}DialogMgrPatches.a.o" # ∂ "{ObjDir}DialogMgrExtensions.a.o" ∂ "{ObjDir}DialogMgrExtensions.c.o" ∂ - "{ObjDir}ModalDialogMenuExtensions.a.o" ∂ - "{ObjDir}ModalDialogMenuExtensions.c.o" ∂ - "{ObjDir}DialogDispatch.a.o" "{LibDir}DialogMgr.lib" ƒ {DialogMgrObjects} Lib {StdLibOpts} -o "{Targ}" {DialogMgrObjects} +# +ModalDialogMenuPatchObjs = "{ObjDir}ModalDialogMenuPatches.a.o" ∂ + "{ObjDir}ModalDialogMenuExtensions.a.o" ∂ + "{ObjDir}ModalDialogMenuExtensions.c.o" + + +# +"{LibDir}ModalDialogMenuPatches.lib" ƒ {ModalDialogMenuPatchObjs} + Lib {StdLibOpts} -o "{Targ}" {ModalDialogMenuPatchObjs} + + "{ObjDir}DialogMgr.a.o" ƒ "{ObjDir}StandardEqu.d" ∂ "{IntAIncludes}ColorEqu.a" ∂ "{IntAIncludes}DialogsPriv.a" ∂ @@ -73,3 +93,13 @@ DialogMgrObjects = "{ObjDir}DialogMgr.a.o" ∂ "{IntAIncludes}DialogsPriv.a" ∂ "{DialogDir}DialogDispatch.a" Asm {StdAOpts} -o "{Targ}" "{DialogDir}DialogDispatch.a" + + +# +"{ObjDir}DialogMgrPatches.a.o" ƒ "{DialogDir}DialogMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{DialogDir}DialogMgrPatches.a" + + +# +"{ObjDir}ModalDialogMenuPatches.a.o" ƒ "{DialogDir}ModalDialogMenuPatches.a" + Asm {StdAOpts} -o "{Targ}" "{DialogDir}ModalDialogMenuPatches.a" diff --git a/Toolbox/DialogMgr/DialogMgrPatches.a b/Toolbox/DialogMgr/DialogMgrPatches.a index 5db41c3..de30eb9 100644 --- a/Toolbox/DialogMgr/DialogMgrPatches.a +++ b/Toolbox/DialogMgr/DialogMgrPatches.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Removed <29> fix to the DialogSelect patch. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: DialogMgrPatches.a ; @@ -300,8 +307,8 @@ DSResult EQU DSEvent+4 ; function result jmprom DSAfterClaimEvent ; rejoin the ROM @NotValid moveq #-1,d3 - move.l DSItemHit(a6), a0 ; get VAR address of user’s item <29> - move.w d3, (a0) ; Save item number hit <29> +; move.l DSItemHit(a6), a0 ; get VAR address of user’s item <29> Commented out +; move.w d3, (a0) ; Save item number hit <29> Commented out jmprom DSNotMineExit ; not a dialog event; exit through ROM EndProc diff --git a/Toolbox/DialogMgr/ModalDialogMenuExtensions.a b/Toolbox/DialogMgr/ModalDialogMenuExtensions.a index a42586b..734841d 100644 --- a/Toolbox/DialogMgr/ModalDialogMenuExtensions.a +++ b/Toolbox/DialogMgr/ModalDialogMenuExtensions.a @@ -1,3 +1,13 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored TheFuture conditionals that were added by <2> and removed by +; <6>, allowing a build without DialogMgrGlobals defined. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; +; Clean diff against SuperMario +; + ; ; File: ModalDialogMenuExtensions.a ; @@ -141,6 +151,7 @@ MDJGNEFilter Proc Export ; Called by StartBoot.a for the ROM, or by a MakeInstall macro in ModalDialogMenuPatches.a for the System. ; + IF forROM OR TheFuture THEN ; ex<6> InitDialogMgrGlobals Proc Export with DialogMgrGlobals @@ -167,6 +178,7 @@ InitDialogMgrGlobals Proc Export rts endproc + ENDIF ;forROM OR TheFuture ; ex<6> ;———————————————————————————————————————————————————————————————————————————————————————————————————— ; SetAnalyzedWindowState (GetAnalyzedWindowState) @@ -181,17 +193,31 @@ SetAnalyzedWindowState proc export export GetAnalyzedWindowState move.l (sp)+,a0 + IF forROM OR TheFuture THEN ; ex<6> move.l ExpandMem,a1 ; A1 -> Expanded Low Memory move.l ExpandMemRec.emDialogGlobals(a1),a1 ; A1-> ptr to globals move.w (sp)+,DialogMgrGlobals.AnalyzedWindowState(a1) ; set new value + ELSE ; ex<6> + lea AnalyzedWindowState,a1 ; ex<6> + move.w (sp)+,(a1) ; ex<6> + ENDIF ; ex<6> jmp (a0) GetAnalyzedWindowState + IF forROM OR TheFuture THEN ; ex<6> move.l ExpandMem,a1 ; A1 -> Expanded Low Memory move.l ExpandMemRec.emDialogGlobals(a1),a1 ; A1-> ptr to globals move.w DialogMgrGlobals.AnalyzedWindowState(a1),4(sp) ; get return value + ELSE ; ex<6> + move.w AnalyzedWindowState,4(sp) ; ex<6> + ENDIF ; ex<6> rts + IF NOT (forROM OR TheFuture) THEN +AnalyzedWindowState + dc.w 0 + ENDIF + endproc ;———————————————————————————————————————————————————————————————————————————————————————————————————— @@ -200,17 +226,31 @@ SetAnalyzedWindow proc export export GetAnalyzedWindow move.l (sp)+,a0 + IF forROM OR TheFuture THEN ; ex<6> move.l ExpandMem,a1 ; A1 -> Expanded Low Memory move.l ExpandMemRec.emDialogGlobals(a1),a1 ; A1-> ptr to globals move.l (sp)+,DialogMgrGlobals.AnalyzedWindow(a1) ; set new value + ELSE ; ex<6> + lea AnalyzedWindow,a1 ; ex<6> + move.l (sp)+,(a1) ; ex<6> + ENDIF ; ex<6> jmp (a0) GetAnalyzedWindow + IF forROM OR TheFuture THEN ; ex<6> move.l ExpandMem,a1 ; A1 -> Expanded Low Memory move.l ExpandMemRec.emDialogGlobals(a1),a1 ; A1-> ptr to globals move.l DialogMgrGlobals.AnalyzedWindow(a1),4(sp) ; get return value + ELSE ; ex<6> + move.l AnalyzedWindow,4(sp) ; ex<6> + ENDIF ; ex<6> rts + IF NOT (forROM OR TheFuture) THEN +AnalyzedWindow + dc.l 1 + ENDIF + endproc ;———————————————————————————————————————————————————————————————————————————————————————————————————— @@ -219,18 +259,32 @@ SetSavedMenuState proc export export GetSavedMenuState move.l (sp)+,a0 + IF forROM OR TheFuture THEN ; ex<6> move.l ExpandMem,a1 ; A1 -> Expanded Low Memory move.l ExpandMemRec.emDialogGlobals(a1),a1 ; A1-> ptr to globals move.l (sp)+,DialogMgrGlobals.SavedMenuState(a1) ; set new value + ELSE ; ex<6> + lea SavedMenuState,a1 ; ex<6> + move.l (sp)+,(a1) ; ex<6> + ENDIF ; ex<6> jmp (a0) GetSavedMenuState + IF forROM OR TheFuture THEN ; ex<6> move.l ExpandMem,a1 ; A1 -> Expanded Low Memory move.l ExpandMemRec.emDialogGlobals(a1),a1 ; A1-> ptr to globals move.l DialogMgrGlobals.SavedMenuState(a1),4(sp) ; get return value + ELSE ; ex<6> + move.l SavedMenuState,4(sp) ; ex<6> + ENDIF ; ex<6> rts + IF NOT (forROM OR TheFuture) THEN +SavedMenuState + dc.l 0 + ENDIF + endproc ;———————————————————————————————————————————————————————————————————————————————————————————————————— diff --git a/Toolbox/DialogMgr/ModalDialogMenuPatches.a b/Toolbox/DialogMgr/ModalDialogMenuPatches.a index 7c71f6b..0d72de7 100644 --- a/Toolbox/DialogMgr/ModalDialogMenuPatches.a +++ b/Toolbox/DialogMgr/ModalDialogMenuPatches.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored TheFuture conditional removed by <17> from around 'MakeInstall +; InitDialogMgrGlobals', matching ModalDialogMenuExtensions.a. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ModalDialogMenuPatches.a ; @@ -60,8 +68,10 @@ DEBUG default false ; Required for InternalMacros.a ; allocate and initialize globals stored in emDialogGlobals ; + IF TheFuture THEN ; ex<17> import InitDialogMgrGlobals MakeInstall InitDialogMgrGlobals,(Plus,SE,II,Portable,IIci) + ENDIF ; ex<17> ;———————————————————————————————————————————————————————————————————————————————————————————————————— ; ModalDialog — set up flags so we can recognize modal dialogs, and put in a new improved filter diff --git a/Toolbox/DiskInit/DiskInit.make b/Toolbox/DiskInit/DiskInit.make new file mode 100644 index 0000000..3894f78 --- /dev/null +++ b/Toolbox/DiskInit/DiskInit.make @@ -0,0 +1,46 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Written from scratch to replace missing makefile +# + +"{RsrcDir}DiskInit.rsrc" ƒ "{RIncludes}Types.r" ∂ + "{RIncludes}BalloonTypes.r" ∂ + "{ObjDir}DiskInit.a.rsrc" ∂ + "{ObjDir}DiskInitHFS.a.rsrc" ∂ + "{DiskInitDir}DiskInit.r" + Rez {StdROpts} -o {Targ} "{DiskInitDir}DiskInit.r" + +DiskInitObjs = "{ObjDir}DiskInit.a.o" ∂ + "{ObjDir}DiskInitBadBlock.c.o" ∂ + "{IfObjDir}Interface.o" ∂ + "{Libraries}Runtime.o" ∂ + +"{ObjDir}DiskInit.a.rsrc" ƒ {DiskInitObjs} + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} {DiskInitObjs} + +"{ObjDir}DiskInitHFS.a.rsrc" ƒ "{ObjDir}DiskInitHFS.a.o" + Link {StdLOpts} {StdAlign} -rt RSRC=0 -o {Targ} "{ObjDir}DiskInitHFS.a.o" + +"{ObjDir}DiskInit.a.o" ƒ "{ObjDir}StandardEqu.d" ∂ + "{IntAIncludes}HardwarePrivateEqu.a" ∂ + "{AIncludes}SonyEqu.a" ∂ + "{AIncludes}Packages.a" ∂ + "{AIncludes}Balloons.a" ∂ + "{DiskInitDir}DiskInit.a" + Asm {StdAOpts} -d SonyNonPortable=1 -d onMac=TRUE -o {Targ} "{DiskInitDir}DiskInit.a" + +"{ObjDir}DiskInitHFS.a.o" ƒ "{ObjDir}StandardEqu.d" ∂ + "{IntAIncludes}HardwarePrivateEqu.a" ∂ + "{AIncludes}SonyEqu.a" ∂ + "{DiskInitDir}DiskInitHFS.a" + Asm {StdAOpts} -o {Targ} "{DiskInitDir}DiskInitHFS.a" + +"{ObjDir}DiskInitBadBlock.c.o" ƒ "{CIncludes}Errors.h" ∂ + "{CIncludes}Files.h" ∂ + "{CIncludes}Devices.h" ∂ + "{CIncludes}Memory.h" ∂ + "{IntCIncludes}HFSDefs.h" ∂ + "{CIncludes}Disks.h" ∂ + "{DiskInitDir}DiskInitBadBlock.c" + C {StdCOpts} -o {Targ} "{DiskInitDir}DiskInitBadBlock.c" diff --git a/Toolbox/DiskInit/DiskInitBadBlock.c b/Toolbox/DiskInit/DiskInitBadBlock.c index 2be5e22..d14239c 100644 --- a/Toolbox/DiskInit/DiskInitBadBlock.c +++ b/Toolbox/DiskInit/DiskInitBadBlock.c @@ -1,3 +1,13 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Removed the common ulong/ushort/uchar typedefs from this file to work + around the ones added to Types.h 9/29/93 . This was the only + remaining incompatible file, so changing it was the simplest thing to + do. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: DiskInitBadBlock.c @@ -98,9 +108,10 @@ #include #include -typedef unsigned long ulong; /* idiosyncrasy of the author */ -typedef unsigned short ushort; -typedef unsigned char uchar; +// Commented out for compatibility with Types.h +// typedef unsigned long ulong; /* idiosyncrasy of the author */ +// typedef unsigned short ushort; +// typedef unsigned char uchar; #define BUFSIZE 18 /* test buffer size, in sectors (mb >=18) */ /* 18 is bad 'cause it's greater than a track (KSCT) */ diff --git a/Toolbox/FontMgr/BassExtensions.a b/Toolbox/FontMgr/BassExtensions.a index cfaf938..a57f9c2 100644 --- a/Toolbox/FontMgr/BassExtensions.a +++ b/Toolbox/FontMgr/BassExtensions.a @@ -1,3 +1,18 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Overall, changed this file back from 'BassExtensions' ROM routines to +; 'BassPatches' linked patches (but without actually renaming it). Changed +; several plain exported Procs back to self-executing Patch/InstallProcs. +; Reverted to use the nice dcImportResident-based dispatch table +; from <1>. Recovered PatchProcs from MemMgrBoot.a to flush the outline +; font cache when an app heap is clobbered (unclear when the code was +; deleted). Recreated the <5> patch that was removed some time before +; in 6/8/92, which rescues ATM's FMSwapFont and StdText patches from +; crashing when a spline font is loaded. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; File: BassExtensions.a ; ; Contains: This file was formerly part of the 'lpch' resource which loads the Spline @@ -191,9 +206,25 @@ JStdTxMeas PROC EXPORT ; application heap. ;—————————————————————————————————————————————————————————————————————————————————————————— -;SetAppBaseCacheCleaner PatchProc $A057,(Plus,SE,II,Portable,IIci) ;SetAppBase + MACRO ; start of code from MemMgrBoot.a + oneCopyOfPatchCode ; + MOVEM.L A0-A2/D0-D3,-(sp) ; save registers + CLR.L -(SP) ; room for result + MOVE.L applZone,A0 ; point to zone hdr + MOVE.L A0,-(SP) ; push start ptr + MOVE.L (A0),-(SP) ; push zone trailer + _sbKillSomeCaches ; + ADDQ #4,SP ; ignore result + MOVEM.L (sp)+,A0-A2/D0-D3 ; restore registers +@SkipIt + JMPOLD ; (changed from MemMgrBoot.a RTS) + ENDM ; ...end of code from MemMgrBoot.a -;InitApplZoneCacheCleaner PatchProc $A02C,(Plus,SE,II,Portable,IIci) ;InitApplZone +SetAppBaseCacheCleaner PatchProc $A057,(Plus,SE,II,Portable,IIci) ;SetAppBase Changed back from a plain PROC + oneCopyOfPatchCode ; + +InitApplZoneCacheCleaner PatchProc $A02C,(Plus,SE,II,Portable,IIci) ;InitApplZone Changed back from a plain PROC + oneCopyOfPatchCode ; @@ -201,13 +232,164 @@ JStdTxMeas PROC EXPORT ; ATM lovely hack remains with system files ;—————————————————————————————————————————————————————————————————————————————————————————— +ATMSwapFontWrapper PROC EXPORT ; reconstruction of <5> + CLR.L -(SP) ; First call the pre-ATM FMSwapFont to safely change the font. + MOVE.L 8(SP),-(SP) + MOVE.L ATMSwapFontWrapperCallees+4,A0 + JSR (A0) + MOVE.L (SP)+,A1 + + MOVE.L WidthTabHandle,A0 ; Test whether it set a spline font. + MOVE.L (A0),A0 + TST.B WidthIsSpline(A0) + BNE.S @unsafe + + MOVE.L ATMSwapFontWrapperCallees,A0 ; Non-spline font => safe to call ATM trap handler. + JMP (A0) ; (ATM will call FMSwapFont again, but no harm done.) + +@unsafe MOVE.L (SP)+,A0 ; Spline font => unsafe to call ATM trap handler. + ADDQ #4,SP + MOVE.L A1,(SP) ; We already called FMSwapFont above, so just return the saved result. + JMP (A0) + + EXPORT ATMSwapFontWrapperCallees ; These fields are initialized by ATMPatch: +ATMSwapFontWrapperCallees + DC.L 0 ; Address of ATM trap handler + DC.L 0 ; Address of Pre-ATM trap handler + + +ATMStdTextWrapper PROC EXPORT ; reconstruction of <5> + LINK A6,#0 ; Do the 'numer' and 'denom' scaling args imply a spline font? + CLR.W -(SP) + MOVE.L 12(A6),-(SP) + MOVE.L 8(A6),-(SP) + _IsOutline + TST.W (SP)+ + UNLK A6 + BNE.S @unsafe + + MOVE.L ATMStdTextWrapperCallees,A0 ; Non-spline font => safe to call ATM trap handler. + JMP (A0) + +@unsafe MOVE.L ATMStdTextWrapperCallees+4,A0 ; Spline font => unsafe to call ATM trap handler. + JMP (A0) + + EXPORT ATMStdTextWrapperCallees ; These fields are initialized by ATMPatch: +ATMStdTextWrapperCallees + DC.L 0 ; Address of ATM trap handler + DC.L 0 ; Address of Pre-ATM trap handler + + +; Compare the routine passed to SetToolTrapAddress against ATMPatch's checksum table +; +; Args: A0 = proposed new trap routine +; A1 = table of checksums from various ATM versions +; Returns: EQ if checksum matches + +ChecksumATMPatch PROC EXPORT ; reconstruction of <5> + + MOVEM.L D0/D1/A0,-(SP) ; Save registers. + + MOVE.W (A0)+,D0 ; Check for and follow the initial JMP $xxxxxxxx. + CMP.W #$4EF9,D0 + BNE.S @return ; (If no JMP, return NE.) + + MOVE.L (A0),A0 ; Checksum the target of the JMP. + MOVEQ #0,D0 + MOVE.W #50,D1 +@mksum ADD.L (A0)+,D0 + DBRA D1,@mksum + +@chksum MOVE.L (A1)+,D1 ; Return EQ if there is a match, NE if not. + BEQ.S @notfnd + CMP.L D1,D0 + BEQ.S @return + BRA.S @chksum +@notfnd MOVEQ #1,D0 + +@return MOVEM.L (SP)+,D0/D1/A0 ; Restore registers (except CCR) and return. + RTS + + +; Sniff ATM's non-Spline-savvy patches to FMSwapFont and StdText, and wrap +; them in our protective routines (above) to prevent a crash. + +ATMPatch PatchProc _SetTrapAddress, (Plus,SE,II,Portable,IIci) ; reconstruction of <5> + EXPORT ATMPatchReturn + IMPORT ATMSwapFontWrapper, ATMSwapFontWrapperCallees + IMPORT ATMStdTextWrapper, ATMStdTextWrapperCallees + +; ATMPatchReturn is exported so that ATMPatchDisable can disable this patch +; by copying our own 'JMPOLD' right here. + + CMP.W #$A647,D1 ; Patch SetToolTrapAddress only. + BNE.S ATMPatchReturn + + CMP.W #$A901,D0 ; SetToolTrapAddress(A0, FMSwapFont)? + BNE.S @NotThatTrap + LEARESIDENT ATMSwapFontWrapper,A2 + PEA ATMSwapFontWrapperCallees + LEA ATMSwapFontChecksums,A1 + + BRA.S @GotOurTrap +@NotThatTrap + + CMP.W #$A882,D0 ; SetToolTrapAddress(A0, StdText)? + BNE.S ATMPatchReturn + LEARESIDENT ATMStdTextWrapper,A2 + PEA ATMStdTextWrapperCallees + LEA ATMStdTextChecksums,A1 + +@GotOurTrap + JSR ChecksumATMPatch ; Compare the patch to our checksum list: is it from ATM? + MOVE.L (SP)+,A1 + BNE.S ATMPatchReturn ; Prepare our wrapper if so, otherwise proceed with SetToolTrapAddress. + + MOVE.L A0,(A1)+ ; Tell our wrapper about ATM's patch. + MOVEM.L D0,-(SP) + _GetToolTrapAddress + MOVEM.L (SP)+,D0 + MOVE.L A0,(A1) ; Tell our wrapper about the pre-ATM trap code. + MOVE.L A2,A0 ; Finally, SetToolTrapAddress with OUR WRAPPER. + +ATMPatchReturn + JMPOLD + +ATMSwapFontChecksums ; These checksums were derived from various ATM versions. + DC.L $417FFC36 + DC.L $2D71904E + DC.L $44EDD323 + DC.L $40CFFC7E + DC.L $2CC19096 + DC.L $4535D273 + DC.L 0 +ATMStdTextChecksums + DC.L $E339FCB4 + DC.L $86FDFDCE + DC.L $36B5833C + DC.L $E335FCB4 + DC.L $86F9FDCE + DC.L $36B1833C + DC.L 0 + + +; Disable the above ATMPatch when system startup is complete + +ATMPatchDisable PatchProc _Launch, (Plus,SE,II,Portable,IIci) ; reconstruction of <5> + IMPORT ATMPatch, ATMPatchReturn + + LEA ATMPatch,A1 ; A1 = destination of JMPOLD + MOVE.W #$4EF9,(A1)+ + LEA ATMPatchReturn,A2 ; A2 = source of JMPOLD + ADDQ #2,A2 + MOVE.L (A2),(A1) ; Slam it home + JMPOLD ;—————————————————————————————————————————————————————————————————————————————————————————— ; Bass Dispatcher ;—————————————————————————————————————————————————————————————————————————————————————————— -;SplineCall PatchProc $A854,(Plus,SE,II,Portable,IIci) -SPLINECALL Proc Export +SplineCall PatchProc $A854,(Plus,SE,II,Portable,IIci) ; Changed back from a plain PROC MOVE.L expandMem, A0 ; get low mem expand MOVE.L ExpandMemRec.emSplineKey(A0),D1 ; splineKey invalid? BEQ.S @bailOut ; yes -> bail out @@ -222,10 +404,11 @@ SPLINECALL Proc Export @fontCache MOVE.L (A1)+,D1 ; load vector table size. CMP.W D1,D0 ; valid selector? - BHS.S @bailOut ; no -> bail out. + BGE.S @bailOut ; no -> bail out. @loadVector - move.l (a1,d0*4),a1 ; Get address of routine - jmp (a1) ; Jump to routine + lsl.l #2,D0 ; ex Instead of d0*4 below... + move.l (a1,d0),a1 ; Get address of routine + jmp (a1) ; Jump to routine @bailOut SWAP D0 ; Get number of params @@ -324,40 +507,56 @@ vfs_GetBitMapData ds.l 1 ; selector 11 size equ * endr ; +FontCacheTable PROC EXPORT ; ex + dc.l (@end-*)/4 + CASE OFF + dcImportResident IsOutline + dcImportResident SetOutlinePreferred + dcImportResident SB_KillSomeCaches + dcImportResident sb_FillPrinterWidths + dcImportResident sb_RetrieveGlyph + dcImportResident sb_FillWidthTab + dcImportResident sb_SearchForCache + dcImportResident sb_PreflightFontMem + dcImportResident OutlineMetrics + dcImportResident GetOutlinePreferred + dcImportResident SetPreserveGlyph + dcImportResident GetPreserveGlyph + dcImportResident sb_FlushFonts + dcImportResident sb_SFNTMatchSize + dcImportResident fs_LowestPPEM + dcImportResident InitializePartialFonts + dcImportResident InitializeDiskCache + CASE OBJ +@end + +FontScalerTable PROC EXPORT ; ex + dc.l (@end-*)/4 + CASE OFF + dcImportResident fs_OpenFonts + dcImportResident fs_Initialize + dcImportResident fs_NewSfnt + dcImportResident fs_NewTransformation + dcImportResident fs_NewGlyph + dcImportResident fs_GetAdvanceWidth + dcImportResident fs_ContourGridFit + dcImportResident fs_ContourNoGridFit + dcImportResident fs_FindBitMapSize + dcImportResident fs_SizeOfOutlines + dcImportResident fs_SaveOutlines + dcImportResident fs_RestoreOutlines + dcImportResident fs_ContourScan + dcImportResident fs_CloseFonts + CASE OBJ +@end + ;—————————————————————————————————————————————————————————————————————————————————————————— ; Boot-time initialization code, if any, goes here. ;—————————————————————————————————————————————————————————————————————————————————————————— -;InstallBassCommon InstallProc (Plus,SE,II,Portable,IIci) -INSTALLBASSCOMMON Proc Export - -; Since the above-described dispatch tables are no longer initialized by the -; link patch mechanism and cannot be placed in ROM, all of the following -; entry points are imported and initialized into the tables by this routine. -; - case off - import IsOutline, SetOutlinePreferred, SB_KillSomeCaches - import sb_FillPrinterWidths, sb_RetrieveGlyph, sb_FillWidthTab - import sb_SearchForCache, sb_PreflightFontMem - import OutlineMetrics, GetOutlinePreferred - import SetPreserveGlyph, GetPreserveGlyph - import sb_FlushFonts, sb_SFNTMatchSize, fs_LowestPPEM - import InitializePartialFonts, InitializeDiskCache - - import fs_OpenFonts, fs_Initialize, fs_NewSfnt - import fs_NewTransformation, fs_NewGlyph - import fs_GetAdvanceWidth - import fs_ContourGridFit, fs_ContourNoGridFit - import fs_FindBitMapSize, fs_SizeOfOutlines - import fs_SaveOutlines, fs_RestoreOutlines - import fs_ContourScan, fs_CloseFonts - if TheFuture then - import fs_GetGlyphInfo, fs_GetGlyphData - import fs_GetBitMapInfo, fs_GetBitMapData - endif - case obj +InstallBassCommon InstallProc (Plus,SE,II,Portable,IIci) ; Changed back from a plain PROC ;—————————————————————————————————————————————————————————————————————————————————————————— ; Allocate splinekey memory… @@ -374,95 +573,12 @@ INSTALLBASSCOMMON Proc Export ;—————————————————————————————————————————————————————————————————————————————————————————— ; Fill out dispatch tables… ;—————————————————————————————————————————————————————————————————————————————————————————— - moveq #DispatchFontCache.size,d0 ; - _NewPtr ,sys,clear + leaResident FontCacheTable,A0 ; ex Instead of making a NewPtr MOVE.L A0, splineKeyRec.vFontCache(A2) ; Save dispatch table ptr (fontCache) - beq.b @endDFCInit - - moveq #(DispatchFontCache.size/4)-1,d0 ; number of vector entries in table - move.l d0,(a0)+ - lea IsOutline,a1 ; selector 0 - move.l a1,(a0)+ - lea SetOutlinePreferred,a1 ; selector 1 - move.l a1,(a0)+ - lea SB_KillSomeCaches,a1 ; selector 2 - move.l a1,(a0)+ - lea sb_FillPrinterWidths,a1 ; selector 3 - move.l a1,(a0)+ - lea sb_RetrieveGlyph,a1 ; selector 4 - move.l a1,(a0)+ - lea sb_FillWidthTab,a1 ; selector 5 - move.l a1,(a0)+ - lea sb_SearchForCache,a1 ; selector 6 - move.l a1,(a0)+ - lea sb_PreFlightFontMem,a1 ; selector 7 - move.l a1,(a0)+ - lea OutlineMetrics,a1 ; selector 8 - move.l a1,(a0)+ - lea GetOutlinePreferred,a1 ; selector 9 - move.l a1,(a0)+ - lea SetPreserveGlyph,a1 ; selector a - move.l a1,(a0)+ - lea GetPreserveGlyph,a1 ; selector b - move.l a1,(a0)+ - lea sb_FlushFonts,a1 ; selector c - move.l a1,(a0)+ - lea sb_SFNTMatchSize,a1 ; selector d - move.l a1,(a0)+ - lea fs_LowestPPEM,a1 ; selector e - move.l a1,(a0)+ - lea InitializePartialFonts,a1 ; selector f <14> - move.l a1,(a0)+ - lea InitializeDiskCache,a1 ; selector 10 <14> - move.l a1,(a0)+ -@endDFCInit - - moveq #DispatchFontScaler.size,d0 - _NewPtr ,sys,clear + ; ex ...No need to fill table + leaResident FontScalerTable,A0 ; ex Instead of making a NewPtr MOVE.L A0, splineKeyRec.vFontScaler(A2) ; Save dispatch table ptr (fontScaler) - beq.b @endDFSInit - - moveq #(DispatchFontScaler.size/4)-1,d0 ; number of vector entries in table - move.l d0,(a0)+ - lea fs_OpenFonts,a1 ; selector 0 - move.l a1,(a0)+ - lea fs_Initialize,a1 ; selector 1 - move.l a1,(a0)+ - lea fs_NewSfnt,a1 ; selector 2 - move.l a1,(a0)+ - lea fs_NewTransformation,a1 ; selector 3 - move.l a1,(a0)+ - lea fs_NewGlyph,a1 ; selector 4 - move.l a1,(a0)+ - lea fs_GetAdvanceWidth,a1 ; selector 5 - move.l a1,(a0)+ - lea fs_ContourGridFit,a1 ; selector 6 - move.l a1,(a0)+ - lea fs_ContourNoGridFit,a1 ; selector 7 - move.l a1,(a0)+ - lea fs_FindBitMapSize,a1 ; selector 8 - move.l a1,(a0)+ - lea fs_SizeOfOutlines,a1 ; selector 9 - move.l a1,(a0)+ - lea fs_SaveOutlines,a1 ; selector a - move.l a1,(a0)+ - lea fs_RestoreOutlines,a1 ; selector b - move.l a1,(a0)+ - lea fs_ContourScan,a1 ; selector c - move.l a1,(a0)+ - lea fs_CloseFonts,a1 ; selector d - move.l a1,(a0)+ - if TheFuture then - lea fs_GetGlyphInfo,a1 ; selector e - move.l a1,(a0)+ - lea fs_GetGlyphData,a1 ; selector f - move.l a1,(a0)+ - lea fs_GetBitMapInfo,a1 ; selector 10 - move.l a1,(a0)+ - lea fs_GetBitMapData,a1 ; selector 11 - move.l a1,(a0)+ - endif -@endDFSInit ; + ; ex ...No need to fill table ;—————————————————————————————————————————————————————————————————————————————————————————— ; Initialize the splinePreferred flag… @@ -501,21 +617,42 @@ INSTALLBASSCOMMON Proc Export ; Force _InitFonts to be called. ; Don’t include Mac Plus in ROM list, since FMExist doesn’t on the Plus. ;—————————————————————————————————————————————————————————————————————————————————————————— -;ForceInitFontsCall InstallProc (SE,II,Portable,IIci) -FORCEINITFONTSCALL Proc Export +ForceInitFontsCall InstallProc (SE,II,Portable,IIci) ; Changed back from a plain PROC ST FMExist rts ENDPROC +;—————————————————————————————————————————————————————————————————————————————————————————— +; Correct the proc that contains a pointer into the trap table. +;—————————————————————————————————————————————————————————————————————————————————————————— +PlusCorrectTxMeasVector InstallProc (Plus) ; Recreated + IMPORT JStdTxMeas + LEA JStdTxMeas,A0 + SUB.L #$200,(A0) ; Delta between ToolTable on Plus vs everywhere else + RTS + ENDPROC + + +;—————————————————————————————————————————————————————————————————————————————————————————— +; Init the outline font cache +;—————————————————————————————————————————————————————————————————————————————————————————— +InitPartialFonts InstallProc (Plus,SE,II,Portable,IIci) ; Recreated + SUBQ #2,SP + MOVE.L #10*1024,-(SP) ; Font cache size + _InitializePartialFonts + ADDQ #2,SP + RTS + ENDPROC + + ;—————————————————————————————————————————————————————————————————————————————————————————— ; Register our selector 'font' ;—————————————————————————————————————————————————————————————————————————————————————————— -;InstallFontGestalt InstallProc (Plus,SE,II,Portable,IIci) -INSTALLFONTGESTALT Proc Export +InstallFontGestalt InstallProc (Plus,SE,II,Portable,IIci) ; Changed back from a plain PROC IMPORT FontMgrGestalt MOVE.L #gestaltFontMgrAttr, D0 - LEA FontMgrGestalt, A0 + LEARESIDENT FontMgrGestalt, A0 ; _NewGestalt ; Install our function ; BEQ.S @noError ; error is in D0 ; DC.W $A9FF ; let me know if it failed diff --git a/Toolbox/FontMgr/Bass_Allocate.a b/Toolbox/FontMgr/Bass_Allocate.a index 09ecb00..269d171 100644 --- a/Toolbox/FontMgr/Bass_Allocate.a +++ b/Toolbox/FontMgr/Bass_Allocate.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Revert +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: Bass_Allocate.a ; @@ -244,9 +251,9 @@ DisposeTempBuffer PROC EXPORT ;<18Jun89> BAL ; ; CtempBufHand PROC EXPORT - EXPORT GETSTYLEBUFHAND + EXPORT GetStyleBufHand ; MOVE.L 4(SP), d0 ; Get size -GETSTYLEBUFHAND +GetStyleBufHand ; MOVE.L D0, D3 ; Save request in reg BSR FontNewTempHandle ; Try to get it from Multi Temp BNE.S @returnVal ; Worked so go home diff --git a/Toolbox/FontMgr/FontFolderExtension.a b/Toolbox/FontMgr/FontFolderExtension.a index 953351b..89445c4 100644 --- a/Toolbox/FontMgr/FontFolderExtension.a +++ b/Toolbox/FontMgr/FontFolderExtension.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted <13> maxFontFiles to 129. Added a separate check for 128 font +; files (and a user notification), rendering maxFontFiles irrelevant. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: FontFolderExtension.a ; @@ -50,8 +58,9 @@ include 'FileMgrPrivate.a' ; CSS include 'LinkedPatchMacros.a' ; CSS include 'ResourceMgrPriv.a' + include 'Notification.a' ; -maxFontFiles equ 128 ; Open a maximum of 128 files +maxFontFiles equ 129 ; Open a maximum of 129 files ex<13> isAlias equ 15 resolveSpecialFolderAliases equ 0 ; Bummers. Not allowed to resolve aliases yet. @@ -176,6 +185,32 @@ stackFrameSize equ * cmp.l d1,d0 ; Is it a font file? bne.s @fileTypeLoop ; Nope + cmp.w #128,d5 ; On the 129th file, put up a Notification. + blt.s @notTooMany ; + subq #4,sp ; + move.w #-16392,-(sp) ; "Some fonts may not be available for use." + _GetString ; + move.l (sp)+,a1 ; (Actually, they WILL not be available.) + + WITH NMRec ; + move.l #NMRecSize,d0 ; + _NewPtr ,sys,clear ; + move.w #nmType,qType(a0) ; + move.l #-1,nmSound(a0) ; + move.l a1,nmRefCon(a0) ; + move.l (a1),a1 ; + move.l a1,nmStr(a0) ; + leaResident TooManyResponder,a1 ; + move.l a1,nmResp(a0) ; + ENDWITH ; + + subq #2,sp ; + _NMInstall ; + addq #2,sp ; + + bra.s @expandFCBArray ; Stop opening files, preempting the check below. +@notTooMany ; + ; ; Add the file to the resource chain. ; @@ -233,5 +268,22 @@ fileTypeTable dc.b 'ffil', 'tfil', 'FFIL' dc.l 0 EndProc + + +TooManyResponder Proc Export ; Generic NotificationMgr responder routine + move.l (sp)+,d0 ; + move.l (sp)+,a0 ; + move.l d0,-(sp) ; + move.l NMRec.nmRefCon(a0),-(sp); + + subq #2,sp ; + _NMRemove ; + addq #2,sp ; + + _ReleaseResource ; + + rts ; + + EndProc ; End \ No newline at end of file diff --git a/Toolbox/FontMgr/FontMgr.a b/Toolbox/FontMgr/FontMgr.a index 30261d0..67ec441 100644 --- a/Toolbox/FontMgr/FontMgr.a +++ b/Toolbox/FontMgr/FontMgr.a @@ -1,3 +1,16 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted all three changes in <73> (<73>.1 etc). Reverted <71> fix to +; style search code. Reverted change that got ScrnBase directly +; from lowmem instead of QD globals. Commented out RomMapInserts +; for fctb/FOND/NFNT resources. Restored a missing HAS_COLOR conditional +; around 'color strike' caching code. Unlengthened one branch, likely from +; . Unshortened several branches. Made all patch routines self- +; installing with separate MakePatch macros on color and B&W machines. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ;————————————————————————————————————————————————————————————————————————————————————————————————————— ; ; File: FontMgr.a @@ -663,6 +676,7 @@ PrNonPortable EQU 1 ; Needed for patches INCLUDE 'ScriptEqu.a' ; <3.6> INCLUDE 'SysPrivateEqu.a' include 'Private.a' ; <19> + INCLUDE 'LinkedPatchMacros.a' ; ELSE LOAD 'StandardEqu.d' ; <1.4> INCLUDE 'ColorEqu.a' @@ -678,6 +692,14 @@ PrNonPortable EQU 1 ; Needed for patches ; with the rest of the world. IF forROM or HAS_COLOR THEN + MakePatch InitFonts,_InitFonts,(II,IIci) ; + MakePatch SetFontLock,_SetFontLock,(II,IIci) ; + MakePatch GetFontName,_GetFName,(II,IIci) ; + MakePatch GetFNum,_GetFNum,(II,IIci) ; + MakePatch FMSwapFont,_FMSwapFont,(II,IIci) ; + MakePatch RealFont,_RealFont,(II,IIci) ; + MakePatch FontMetrics,_FontMetrics,(II,IIci) ; + FontManager PROC EXPORT EXPORT InitFonts EXPORT SetFontLock @@ -696,6 +718,17 @@ FontManager PROC EXPORT EXPORT FMgrEnd EXPORT FPointOne ; (so that first reference will be seen.) ELSE + + MakePatch BWInitFonts,_InitFonts,(Plus,SE,Portable) ; + MakePatch BWFMSwapFont,_FMSwapFont,(Plus,SE,Portable) ; + MakePatch BWGetFontName,_GetFName,(Plus,SE,Portable) ; + MakePatch BWRealFont,_RealFont,(Plus,SE,Portable) ; + MakePatch BWGetFNum,_GetFNum,(Plus,SE,Portable) ; + MakePatch BWSetFontLock,_SetFontLock,(Plus,SE,Portable) ; + MakePatch BWSetFScaleDisable,_SetFScaleDisable,(Plus,SE,Portable) ; + MakePatch BWSetFractEnable,_SetFractEnable,(Plus,SE,Portable) ; + MakePatch BWFontMetrics,_FontMetrics,(Plus,SE,Portable) ; + BWFontManager PROC EXPORT EXPORT BWInitFonts EXPORT BWSetFontLock @@ -773,7 +806,7 @@ BWInitFonts BNE.S @doneAlloc ; Check for spline ready MOVE.L #WidTabSize,D0 ; size of table _NewHandle ,SYS ; new handle in sysHeap - BNE.S CantAllocMem ; if an error, skip + BNE CantAllocMem ; if an error, skip Unshortened branch MOVE.L A0,WidthTabHandle ; remember it @@ -798,6 +831,7 @@ BWInitFonts MOVE.L A0,JSwapFont ; ENDIF + IF HAS_COLOR THEN ; Restored conditional for 'color strike' code MOVEQ #SyntheticStrikeTable.synEntry,D0 ; size of 1 entry version MOVE.L SynListHandle,D1 ; already got it? BLE.S @createSynList ; if zero or -1, create one @@ -817,6 +851,7 @@ BWInitFonts TST.B fmExist BPL.S @skipRest CLR.B fmExist + ENDIF ; HAS_COLOR CLR.L FOutFontHandle ; may point to non-existent font, so clear CLR.L LastFOND BSR.S InValWidths ; invalidate all of the width tables. @@ -1192,9 +1227,9 @@ CheckPurged MOVE.L WidthTabHandle, A1 MOVE.L (A1), A1 ; Width table ptr TST.B WidthIsSpline(A1) ; Get flag stating if spline <14-jlf> - beq.s @DoNormalPurgeCheck ; do normal stuff if not a spline <14-jlf> + beq @DoNormalPurgeCheck ; do normal stuff if not a spline <14-jlf> Unshortened branch tst.b KeepSplineOnDisk(a1) ; should we do the load? <14-jlf> - bne.s @skipBuildTable ; no, skip it <14-jlf> + bne @skipBuildTable ; no, skip it <14-jlf> Unshortened branch move.w WidthStrikeID(a1),d0 ; setup sfnt resource id parameter <14-jlf> jsr LoadSplineFontResource ; load the spline font resource <14-jlf> bsr DerefWidthTab ; get the widthtablepointer in a0 <14-jlf> @@ -1202,7 +1237,7 @@ CheckPurged move.l d0,a0 ; move splineHandle <14-jlf> tst.l (a0) ; was the spline loaded? <14-jlf> seq KeepSplineOnDisk(a1) ; no, don't try to load it again. <14-jlf> - bra.s @skipBuildTable ; Do not build height table if spline <14-jlf> + bra @skipBuildTable ; Do not build height table if spline <14-jlf> Unshortened branch @DoNormalPurgeCheck MOVE.L A0,-(SP) ; push it @@ -1220,7 +1255,7 @@ CheckPurged FMSwapDone BSR DerefWidthTab ; get pointer to width table in A0 TST.B WidthIsSpline(A0) ; Test if spline - BEQ.S @skipSpline ; not a spline + BEQ @skipSpline ; not a spline Unshortened branch MOVEM.L A0-A1/D0-D2,-(SP) ; Save regs SUBQ #4,SP ; make room for result MOVE.L WidthTabHandle, -(SP) ; 1) Push the Width Table Handle onto the stack @@ -1652,7 +1687,7 @@ GotFontHandle MOVE.L WidthTabHandle, A1 MOVE.L (A1), A1 ; get Width Table pointer <14-jlf> TST.B WidthIsSpline(A1) ; is this a spline width table? <14-jlf> - beq.s @SkipSplineLoad ; no, do non-spline cases <14-jlf> + beq @SkipSplineLoad ; no, do non-spline cases <14-jlf> Unshortened branch tst.b KeepSplineOnDisk(a1) ; should we load the spline? <14-jlf> bne NoColors ; no, skip the load <14-jlf> move.w WidthStrikeID(a1),d0 ; setup sfnt resource id parameter <14-jlf> @@ -1739,7 +1774,7 @@ GetPixDepth ; This doesn't work so well because Cyclone changes ScrnBase on depth switch ; without updating the QuickDraw Globals. A "More Correct" fix would be to ; have the process manager update the QuickDraw Globals of all running processes. - MOVE.L ScrnBase,D0 ; get pointer to screen base address + MOVE.L screenBits(A1),D0 ; get pointer to screen base address Reverted the change described TST portBits+rowBytes(A0) ; IS SRC A PIXMAP? BPL.S @doBits ; =>NO, IT'S A BITMAP MOVE.L ([portBits+baseAddr,A0]),A0 ; GET POINTER TO PORT'S PIXMAP @@ -2054,7 +2089,7 @@ LookForColor SUBQ #4,SP ; make space for function result MOVE.L #'fctb',-(SP) ; pass resource type MOVE D0,-(SP) ; pass resource ID - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb +; MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb Don't! _GetResource ; only uses D0,A0 MOVE.L (SP)+,D5 ; if it fails, then no color table to pass to MakeScaleTbl @@ -2800,10 +2835,10 @@ AdjustSpace MOVE.L (A3)+,(A1)+ ; update numer, denom MOVE.L (A3),(A1) ; of the scale factors. TST.B WidthIsSpline(A0) ; Test if spline - BEQ.S @skipFill ; do not do spline things + BEQ @skipFill ; do not do spline things Unshortened branch CLR.B WidthUsedFam(A0) ; Splines never used FOND widths. tst.b KeepSplineOnDisk(a0) ; should we load the spline? <14-jlf> - bne.s @fontOkay ; no, skip the load. <14-jlf> + bne @fontOkay ; no, skip the load. <14-jlf> Unshortened branch move.w WidthStrikeID(a0),d0 ; push the sfnt resource id <14-jlf> jsr LoadSplineFontResource ; load the spline resource <14-jlf> bsr DerefWidthTab ; get widthpointer in a0 <14-jlf> @@ -3223,14 +3258,7 @@ checkNeighborhood ; common entry point for system family as well. tryNeighborhoodBase CMP #$4000,D3 BLO.S @mustBeRoman -;; AND #$FE00,D3 ; base is neighborhood & ~512 - - subq #6,SP ; <73> 2 for Font2RealScript, 4 for GetScript - move.w D3,-(SP) ; <73> push current font id - _Font2RealScript ; <73> convert it to script code - move.w #smScriptSysFond,-(SP) - _GetScript ; <73> get system font id for the script - move.l (SP)+,D3 ; <73> try the script system font + AND #$FE00,D3 ; base is neighborhood & ~512 ex<73>.3 Just mask to Chicago vs calling ScriptMgr. RTS @mustBeRoman @@ -3348,10 +3376,10 @@ LoadSplineFontResource move.l (sp)+,d0 ; <15> Set the condition code properly @foundSpline move.l d0,resourceHandle(a6) ; pop the spline handle - beq.s @Exit ; bail if it was nil + beq @Exit ; bail if it was nil Unshortened branch move.l d0,a0 ; grab the resource handle tst.l (a0) ; is the handle already loaded into memory? - bne.s @Exit ; yes, return immediately + bne @Exit ; yes, return immediately Unshortened branch ; at this point the empty resource handle is: ; @@ -3365,11 +3393,11 @@ LoadSplineFontResource _SizeRsrc ; get the size of the resource move.l (sp)+,d0 ; pop the resource size cmp.l #128*1024,d0 ; is the spline size greater than 128k? - bgt.s @LoadEmptySplineIntoSystemHeap ; yes, load an empty spline into the system heap + bgt @LoadEmptySplineIntoSystemHeap ; yes, load an empty spline into the system heap Unshortened branch move.l resourceHandle(a6),-(sp) ; push empty resource handle _LoadResource ; load the resource into memory - bra.s @Exit ; return + bra @Exit ; return Unshortened branch ; The spline font is bigger than 128K, so don’t load it into memory, but create an empty ; handle for it in it’s resource reference entry. We can probably get rid of the call to @@ -3468,7 +3496,7 @@ LoadNoROM SUBQ #4,SP ; <14-jlf> MOVE.L #'NFNT',-(SP) ; push NFNT MOVE.W D0,-(SP) - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb +; MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb Don't! _GetResource MOVE.L (SP)+,D0 ; got it? bz.s fontOnlyLoad ; if not, look for FONT @@ -3477,7 +3505,7 @@ LoadNoROM MOVE #$8000,widthNFNT(A0) ; remember that we found a NFNT MOVE (SP)+,widthStrikeID(A0) TST.L D0 ; clear z flag ; <3.1-16May89-CEL> - BRA.S weGotIt ; return z clear, handle in D0. + BRA weGotIt ; return z clear, handle in D0. Unshortened branch ; we couldn't find the NFNT, so look for a FONT @@ -3603,7 +3631,7 @@ FindSize DBRA D1,@fSizeLoop ; check them all out @trySpline TST D0 ; check if Spline was found - BEQ @cantFind + BEQ.S @cantFind ; ex Unlengthened branch @gotSpline ; @@ -3631,10 +3659,7 @@ FindSize @CheckSplinePreferred movem.l (sp)+, a1/d0-d2 ; Restore it all - MOVE.L (A2),A0 ; <73> handle->pointer - LEA FontFamilyRecord.FONDAssoc(A0),A0 ; <73> bump past header - tst.w (A0) ; <73> only sfnt is installed? - beq.s @DoRomanLogic ; <73> then use it. + ; ex<73>.1 Don't use too-small sfnt even if desparate. btst.b #splinePreferred,HiliteMode ; bit flag set in HiliteMode? bne.s @DoRomanLogic ; yes, force spline @@ -3777,11 +3802,7 @@ GetFONDForSizeAndStyle bra.s @checkSplinePreferred ; Yes. See if it’s ok to return a TrueType font. @styledSplineEntry - cmp.w d2,d0 ; <71> See if style is exactly the same - bne.s @testForStyle ; <71> No. See if this candidate has the style we want - move.l a4,d4 ; <71> This 'FOND' has the style we want - bra.s @gotStyledSpline ; <71> -@testForStyle + ; ex<71> Don't search the 'FOND' further and.w d2,d0 ; See if this 'FOND' describes the desired style bnz.s @savePotentialStyleMatch ; It does indeed. Prepare to load it in. move.l d3,d0 ; <63> This 'FOND' doesn’t have the desired style. @@ -3881,13 +3902,7 @@ GetFONDForSizeAndStyle ; @CheckAlternates - btst #splinePreferred,HiliteMode ; <71> See if TrueType fonts are preferred - bz.s @useBitMapAlternates ; <71> No. Get a bitmapped font - tst.l d4 ; <71> See if we have styled spline candidate - bnz.s @tryForSpline ; <71> We do. Use it. - tst.l d7 ; <71> See if we have plain spline candidate - bnz.s @tryForSpline ; <71> We do. Use it. -@useBitMapAlternates + ; ex<71> Don't obey splinePreferred tst.l d6 ; See if plain variation was found bz.s @tryForStyledAlternate ; <67> If there is a plain, return it. move.l d6,a1 ; The plain variant was found @@ -3908,9 +3923,7 @@ GetFONDForSizeAndStyle bz.s @tryForPlainSpline ; A plain font was desired @tryForStyledSpline tst.l d4 ; See if a styled spline was picked up. - bz.s @tryForPlainSpline ; <71> It wasn’t. Try plain. - move.l d4,a1 ; <71> Use styled spline - bra.s @setupForLoad ; <71> + bnz.s @passBackStyledSpline ; ex<71> Un-inline @passBackStyledSpline on way to @setupForLoad @tryForPlainSpline tst.l d7 ; See if a plain TrueType font was picked up. bnz.s @passBackPlainSpline ; We’ve got a TrueType version. Go use it. @@ -4293,8 +4306,7 @@ FindClosest MOVEQ #0,D1 ; no font yet MOVE #$7FFF,D2 ; closest delta so far - tst.w (A0) ; <73> don’t take sfnt as the closest NFNT - beq.s NxtSizeLoop ; <73> assuming sfnt is the first entry + ; ex<73>.2 Let sfnt be misinterpreted as 0pt NFNT Scan4SizeLoop MOVE.W D5,D0 ; get one we want @@ -4719,7 +4731,7 @@ GetFOND SUBQ #4,SP MOVE.L #'FOND',-(SP) ; push type "FOND" MOVE.W D1,-(SP) ; push the ID - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb +; MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb Don't! _GetResource ; look for it MOVE.L (SP)+,D0 MOVE.L D0,A0 @@ -4957,13 +4969,13 @@ BWSetFontLock move.l FOutFontHandle,a0 ; get the current font handle <14-jlf> tst.l (a0) ; is it purged? <14-jlf> - bne.s @NoPurgeFont ; no, skip the resource load stuff <14-jlf> + bne @NoPurgeFont ; no, skip the resource load stuff <14-jlf> Unshortened branch move.l WidthTabHandle,a0 ; get current width table <14-jlf> move.l (a0),a0 ; get master pointer <14-jlf> tst.b WidthIsSpline(a0) ; is this a spline font? <14-jlf> - beq.s @DoNormalFontLock ; no, do normal stuff <14-jlf> + beq @DoNormalFontLock ; no, do normal stuff <14-jlf> Unshortened branch tst.b KeepSplineOnDisk(a0) ; should the spline be loaded into memory? <14-jlf> - bne.s @doneSFL ; no, bail out of routine <14-jlf> + bne @doneSFL ; no, bail out of routine <14-jlf> Unshortened branch move.w WidthStrikeID(a0),d0 ; setup sfnt resource id parameter <14-jlf> jsr LoadSplineFontResource ; call the load routine <14-jlf> bsr DerefWidthTab ; get widthPointer in a0 <14-jlf> @@ -4971,8 +4983,8 @@ BWSetFontLock tst.l (a0) ; was the spline loaded into memory? <14-jlf> exg d0,a0 ; swap the registers back <14-jlf> seq KeepSplineOnDisk(a0) ; don't try to load next time if not loaded <14-jlf> - beq.s @doneSFL ; skip the nopurge if it wasn't loaded <14-jlf> - bra.s @NoPurgeFont ; make it non-purgeable <14-jlf> + beq @doneSFL ; skip the nopurge if it wasn't loaded <14-jlf> Unshortened branch + bra @NoPurgeFont ; make it non-purgeable <14-jlf> Unshortened branch @DoNormalFontLock diff --git a/Toolbox/FontMgr/FontMgr.make b/Toolbox/FontMgr/FontMgr.make index 67b0c8f..3415da9 100644 --- a/Toolbox/FontMgr/FontMgr.make +++ b/Toolbox/FontMgr/FontMgr.make @@ -1,3 +1,15 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Patched the entire FontMgr and the 'standard' QD text routines via the +# lpch lib. (Color and B&W versions built separately from the same source +# and then linked together.) Added DiskCachePatches.a to the lpch lib (vs +# having it rolled into the SuperMario ROM Memory Manager). Removed +# FontFolderExtension.a from this lpch lib, to be linked in separately +# elsewhere. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: FontMgr.make # @@ -31,7 +43,10 @@ FntIncOpts = -i "{FontLibIfDir}" ∂ -FontMgrObjs = "{ObjDir}fnt.c.o" ∂ +FontMgrObjs = "{ObjDir}BWDrawText.a.o" # ∂ + "{ObjDir}BWText.a.o" # ∂ + "{ObjDir}BWFontMgr.a.o" # ∂ + "{ObjDir}fnt.c.o" ∂ "{ObjDir}FSglue.c.o" ∂ "{ObjDir}embeddedBitmap.c.o" ∂ "{ObjDir}OutlineMetrics.a.o" ∂ @@ -57,7 +72,9 @@ FontMgrObjs = "{ObjDir}fnt.c.o" ∂ "{ObjDir}DiskCacheExtensions.c.o" ∂ "{ObjDir}DiskCacheList.c.o" ∂ "{ObjDir}DiskCacheMap.c.o" ∂ - "{ObjDir}FontFolderExtension.a.o" ∂ + "{ObjDir}DiskCachePatches.a.o" # ∂ + "{ObjDir}DrawText.a.o" # ∂ + "{ObjDir}Text.a.o" # ∂ "{ObjDir}FontMgr.a.o" @@ -372,4 +389,34 @@ FontMgrObjs = "{ObjDir}fnt.c.o" ∂ C {StdCOpts} -o "{Targ}" {FntIncOpts} "{FontCachDir}Source:DiskCacheMap.c" -i "{FontMgrDir}" +# +"{ObjDir}DiskCachePatches.a.o" ƒ "{FontCachDir}Source:DiskCachePatches.a" + Asm {StdAOpts} -o "{Targ}" {FntIncOpts} "{FontCachDir}Source:DiskCachePatches.a" + + +# +"{ObjDir}BWFontMgr.a.o" ƒ "{FontMgrDir}FontMgrShell.a" "{FontMgrDir}FontMgr.a" + Asm {StdAOpts} -o "{Targ}" "{FontMgrDir}FontMgrShell.a" -i "{ColorQDDir}" -d NOT_68000=0 -d HAS_COLOR=0 -i "{FontMgrDir}" + + +# +"{ObjDir}DrawText.a.o" ƒ "{ColorQDDir}DrawTextShell.a" "{ColorQDDir}DrawText.a" + Asm {StdAOpts} -d hasCQD=1 -d NOT_68000=1 -d NEED_JSTDTXMEAS=TRUE -o {Targ} -i "{ColorQDDir}" -i "{FontMgrDir}" "{ColorQDDir}DrawTextShell.a" + + +# +"{ObjDir}BWDrawText.a.o" ƒ "{ColorQDDir}DrawTextShell.a" "{ColorQDDir}DrawText.a" + Asm {StdAOpts} -d hasCQD=0 -d NOT_68000=0 -d NEED_JSTDTXMEAS=FALSE -o {Targ} -i "{ColorQDDir}" -i "{FontMgrDir}" "{ColorQDDir}DrawTextShell.a" + + +# +"{ObjDir}Text.a.o" ƒ "{ColorQDDir}TextShell.a" "{ColorQDDir}Text.a" + Asm {StdAOpts} -d hasCQD=1 -d NOT_68000=1 -d NEED_JSTDTXMEAS=TRUE -o {Targ} -i "{ColorQDDir}" -i "{FontMgrDir}" "{ColorQDDir}TextShell.a" + + +# +"{ObjDir}BWText.a.o" ƒ "{ColorQDDir}Classic:Text.m.a" + Asm {StdAOpts} -o "{Targ}" -i "{FontMgrDir}" "{ColorQDDir}Classic:Text.m.a" + + diff --git a/Toolbox/FontMgr/OutlineMetrics.a b/Toolbox/FontMgr/OutlineMetrics.a index d90e1ed..2d0c37a 100644 --- a/Toolbox/FontMgr/OutlineMetrics.a +++ b/Toolbox/FontMgr/OutlineMetrics.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Added missing colon to equate (otherwise it wouldn't compile). +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: OutlineMetrics.a ; @@ -64,7 +71,7 @@ IF (&TYPE('hasDoubleByte') = 'UNDEFINED') THEN - hasDoubleByte EQU 1 + hasDoubleByte: EQU 1 ; ex ENDIF LOAD 'StandardEqu.d' diff --git a/Toolbox/FontMgr/PartialFont/Source/PartialFontExtensions.c b/Toolbox/FontMgr/PartialFont/Source/PartialFontExtensions.c index 0f2374b..ab0eecf 100644 --- a/Toolbox/FontMgr/PartialFont/Source/PartialFontExtensions.c +++ b/Toolbox/FontMgr/PartialFont/Source/PartialFontExtensions.c @@ -1,3 +1,12 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted hack that used some cut-and-paste INITZONEGLUE to work + around the whole ROM INITZONE routine being called. Kept all the + subsequent Reality changes that were rolled in to SuperMario. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: PartialFontExtensions.c @@ -83,8 +92,8 @@ #include "FontScaler.h" #include "Bass_Cache.h" -//••••• Temporary hack for INitZone -extern pascal void INITZONEGLUE (GrowZoneProcPtr pgrowZone,short cmoreMasters,void *limitPtr, +//••••• Temporary hack for INitZone ex Use the real InitZone glue, not 'InitZoneGlue' +extern pascal void INITZONE (GrowZoneProcPtr pgrowZone,short cmoreMasters,void *limitPtr, void *startPtr); /* -------------------------------------------------------------------------------------- @@ -352,8 +361,8 @@ pascal OSErr InitializePartialFonts( Size partialFontZoneSize ) error = NewZonePtr( &partialFontZone, partialFontZoneSize, SystemZone( ) ); if ( error == noErr ) { -//••••Temporary hack - INITZONEGLUE( (GrowZoneProcPtr) PartialFontZoneGrowZoneProcedure, partialFontZoneSize/kPartialFontBytesPerMasterPointer, partialFontZone + partialFontZoneSize, partialFontZone ); // +//••••Temporary hack ex Use the real InitZone glue, not 'InitZoneGlue' + INITZONE( (GrowZoneProcPtr) PartialFontZoneGrowZoneProcedure, partialFontZoneSize/kPartialFontBytesPerMasterPointer, partialFontZone + partialFontZoneSize, partialFontZone ); // if ( (error = MemError( )) == noErr ) { error = NewZoneHandle( (Handle*) &fragmentTableCache, (Size) sizeof( FragmentTableCacheStructure ), (THz) partialFontZone ); diff --git a/Toolbox/HelpMgr/BalloonExtensions.a b/Toolbox/HelpMgr/BalloonExtensions.a index af50abe..3072df0 100644 --- a/Toolbox/HelpMgr/BalloonExtensions.a +++ b/Toolbox/HelpMgr/BalloonExtensions.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted expectation of PACK 14 in ROM. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: BalloonExtensions.a ; @@ -145,7 +152,7 @@ BSaveReg REG A3/A4 subq #4,sp ; room for package move.l #'PACK',-(sp) ; we want the package resource move #14,-(sp) ; of ID = 14 - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb + ; ex no RomMapInsert _GetResource move.l (sp)+,d0 ; did we get it? beq.s done ; no, so exit w/o putting up icon diff --git a/Toolbox/HelpMgr/BalloonPACK.a b/Toolbox/HelpMgr/BalloonPACK.a index 61187d7..f884e9d 100644 --- a/Toolbox/HelpMgr/BalloonPACK.a +++ b/Toolbox/HelpMgr/BalloonPACK.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted with a simple code change. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ;__________________________________________________________________________________________________ ; File: BalloonPACK.a ; @@ -2789,7 +2796,7 @@ workString ds.w 128 ; space for a STR255 work area MOVE.L origString(A6),A2 ; A2-> string beginning (len byte) MOVEQ #0,D3 ; clear some hibits MOVE.B (A2),D3 ; get length - BEQ @ExitFCS ; exit if original string was zero CSS + BEQ.S @ExitFCS ; exit if original string was zero CSS MOVE.B #'^',D0 ; look for citation caret character LEA 1(A2),A1 ; A1 -> string data diff --git a/Toolbox/HelpMgr/BalloonPACK.p b/Toolbox/HelpMgr/BalloonPACK.p index 03c80d3..b844b2b 100644 --- a/Toolbox/HelpMgr/BalloonPACK.p +++ b/Toolbox/HelpMgr/BalloonPACK.p @@ -1,3 +1,10 @@ +{ + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted , preventing PICTs going into the system heap. + 9/2/94 SuperMario ROM source dump (header preserved below) +} + {__________________________________________________________________________________________________ File: BalloonPACK.p @@ -2185,7 +2192,6 @@ FUNCTION __HMCalculateBalloon( aHelpMsg: HMMessageRecord; tix : LongInt; sloppy : BOOLEAN; hasColorQD : BOOLEAN; - oldZone : THz; { } BEGIN __HMCalculateBalloon := hmBalloonAborted; { make default case aborted } @@ -2326,15 +2332,12 @@ FUNCTION __HMCalculateBalloon( aHelpMsg: HMMessageRecord; inPort := @picPort; end; - oldZone := GetZone; { get the current heap zone } { } - SetZone(SystemZone); { point at the system heap } { } - { } + { ex don't open pict in the system heap } + pic := OpenPicture(visibleRect); TEUpdate(visibleRect,aTE); ClosePicture; - SetZone(oldZone); { } - { } with aTE^^ do inPort := tPort; end; @@ -2343,15 +2346,11 @@ FUNCTION __HMCalculateBalloon( aHelpMsg: HMMessageRecord; otherwise if aTE<>NIL then begin - oldZone := GetZone; { get the current heap zone } { } - SetZone(SystemZone); { point at the system heap } { } - { } + { ex don't open pict in the system heap } + pic := OpenPicture(visibleRect); TEUpdate(visibleRect,aTE); ClosePicture; - { } - SetZone(oldZone); { } - { } end; end; diff --git a/Toolbox/HelpMgr/HelpMgr.make b/Toolbox/HelpMgr/HelpMgr.make index f91a092..f81c358 100644 --- a/Toolbox/HelpMgr/HelpMgr.make +++ b/Toolbox/HelpMgr/HelpMgr.make @@ -1,3 +1,12 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added Balloonptch28.a back to lpch lib. Linked PasLib into PACK 14 for +# arithmetic routines. Created an "adapter" rule to work with the old +# System Rez file. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: HelpMgr.make # @@ -17,6 +26,7 @@ BalloonPackObjs = "{ObjDir}BalloonPack.a.o" ∂ "{ObjDir}BalloonPack.p.o" ∂ + "{PLibraries}PasLib.o" # ∂ "{IfObjDir}interface.o" @@ -25,9 +35,11 @@ BalloonWDEFObjs = "{ObjDir}BalloonWDEF.a.o" ∂ +# Added back Balloonptch28.a "{LibDir}HelpMgr.lib" ƒ "{ObjDir}BalloonExtensions.a.o" ∂ + "{ObjDir}Balloonptch28.a.o" ∂ "{ObjDir}Balloonptch28.p.o" - Lib {StdLibOpts} -o "{Targ}" "{ObjDir}BalloonExtensions.a.o" "{ObjDir}Balloonptch28.p.o" + Lib {StdLibOpts} -o "{Targ}" "{ObjDir}BalloonExtensions.a.o" "{ObjDir}Balloonptch28.a.o" "{ObjDir}Balloonptch28.p.o" "{RsrcDir}HelpMgr.rsrc" ƒƒ {BalloonPackObjs} Link {StdLOpts} {StdAlign} -rt PACK=14 -o "{Targ}" {BalloonPackObjs} || Exit 1 @@ -43,6 +55,16 @@ BalloonWDEFObjs = "{ObjDir}BalloonWDEF.a.o" ∂ Rez {StdROpts} -a -o "{Targ}" "{HelpMgrDir}Balloon.r" || Exit 1 +# "Adapter" rule to make the diff cleaner +"{RsrcDir}BalloonPACK.a.rsrc" ƒ "{RsrcDir}HelpMgr.rsrc" + Duplicate -y "{RsrcDir}HelpMgr.rsrc" "{RsrcDir}BalloonPACK.a.rsrc" + + +# Added back to lpch lib +"{ObjDir}Balloonptch28.a.o" ƒ "{HelpMgrDir}Balloonptch28.a" + Asm {StdAOpts} -o "{targ}" "{HelpMgrDir}Balloonptch28.a" + + "{ObjDir}BalloonPACK.a.o" ƒ "{ObjDir}StandardEqu.d" ∂ "{IntAIncludes}MFPrivate.a" ∂ "{IntAIncludes}LayerEqu.a" ∂ diff --git a/Toolbox/IconUtils/IconUtils.a b/Toolbox/IconUtils/IconUtils.a index 588f5c4..f864958 100644 --- a/Toolbox/IconUtils/IconUtils.a +++ b/Toolbox/IconUtils/IconUtils.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted bugfix (marked as ''). Removed code to use icon +; resources in ROM. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: IconUtils.a ; @@ -159,7 +167,7 @@ FromResource PROC EXPORT LEA typeTable, A1 ; get the table of resTypes MOVE.L $00(A1,D0.W), -(SP) ; push the icon type MOVE.W D1, -(SP) ; push the icon id - MOVE.W #MAPTRUE,ROMMAPINSERT ; look in ROM first rb +; MOVE.W #MAPTRUE,ROMMAPINSERT ; look in ROM first rb _GetResource ; call GetResource MOVE.L (A7)+, D0 ; pop the handle into D0 for return RTS ; return @@ -531,7 +539,7 @@ GETCODE MOVEA.L THEDATA(SP), A1 ; get the address to return data in MOVE.L (A0), (A1) ; return the data EXITOK MOVEQ #noErr, D0 ; record no error. EXIT MOVEA.L (SP)+, A0 ; Pop return address into A0 - ADDQ.L #8, SP ; Point stack at return value + ADDQ.L #6, SP ; Point stack at return value MOVE.W D0, (SP) ; put return value on the stack JMP (A0) ; return @@ -693,7 +701,7 @@ FromResource PROC EXPORT LEA typeTable, A1 ; get the table of resTypes MOVE.L $00(A1,D0.W), -(SP) ; push the icon type MOVE.W D1, -(SP) ; push the icon id - MOVE.W #MAPTRUE,ROMMAPINSERT ; look in ROM first rb +; MOVE.W #MAPTRUE,ROMMAPINSERT ; look in ROM first rb _GetResource ; call GetResource MOVE.L (A7)+, D0 ; pop the handle into D0 for return RTS ; return @@ -1065,7 +1073,7 @@ GETCODE MOVEA.L THEDATA(SP), A1 ; get the address to return data in MOVE.L (A0), (A1) ; return the data EXITOK MOVEQ #noErr, D0 ; record no error. EXIT MOVEA.L (SP)+, A0 ; Pop return address into A0 - ADDQ.L #8, SP ; Point stack at return value + ADDQ.L #6, SP ; Point stack at return value MOVE.W D0, (SP) ; put return value on the stack JMP (A0) ; return diff --git a/Toolbox/IconUtils/IconUtils.make b/Toolbox/IconUtils/IconUtils.make index 4f30313..c7e64c4 100644 --- a/Toolbox/IconUtils/IconUtils.make +++ b/Toolbox/IconUtils/IconUtils.make @@ -1,3 +1,10 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added build rules for some System resources. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: IconUtils.make # @@ -24,4 +31,14 @@ IconUtilsObjs = "{ObjDir}IconUtils.a.o" ∂ "{ObjDir}IconUtils.c.o" ƒ "{IconUtilsDir}IconUtils.c" - C {StdCOpts} -o "{Targ}" "{IconUtilsDir}IconUtils.c" \ No newline at end of file + C {StdCOpts} -o "{Targ}" "{IconUtilsDir}IconUtils.c" + + +# System resources +"{RsrcDir}IconUtils.rsrc" ƒ "{IconUtilsDir}IconUtils.r" + Rez {StdROpts} -o "{Targ}" -i {IntCIncludes} "{IconUtilsDir}IconUtils.r" + + +# System resources +"{RsrcDir}GenericIcons.rsrc" ƒ "{IconUtilsDir}GenericIcons.r" + Rez {StdROpts} -o "{Targ}" "{IconUtilsDir}GenericIcons.r" diff --git a/Toolbox/ListMgr/TextLDEF.a b/Toolbox/ListMgr/TextLDEF.a index 3e8fcd0..58672e3 100644 --- a/Toolbox/ListMgr/TextLDEF.a +++ b/Toolbox/ListMgr/TextLDEF.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted : changed back to short branches +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: TextLDEF.a ; @@ -209,7 +216,7 @@ ListDraw MOVE.W D3,-(SP) ; length of text _TextWidth CMP.W (SP),D7 ; will string fit? <11> Leave width on stack - BGE @noTruncate ; yes, no need to truncate CSS + BGE.S @noTruncate ; yes, no need to truncate CSS addq #2,sp ; <11> Width isn’t needed til after truncation. Lose it. diff --git a/Toolbox/MenuMgr/InvalMenuBarPatch.a b/Toolbox/MenuMgr/InvalMenuBarPatch.a index 5c4acf4..ad5ca3a 100644 --- a/Toolbox/MenuMgr/InvalMenuBarPatch.a +++ b/Toolbox/MenuMgr/InvalMenuBarPatch.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Restored the routines that were split off in . +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: InvalMenuBarPatch.a ; @@ -38,6 +45,19 @@ include 'MenuMgrPriv.a' +; Restored verbatim from MenuMgrExtensions.a +;———————————————————————————————————————————————————————————————————————————————————————————————————— +; InvalMenuBar + +; Set the low memory bit + +InvalMenuBar PatchProc _InvalMenuBar,(Plus,SE,II,Portable,IIci) + + bset #MenuBarInvalidBit,MenuBarInvalidByte ; set the invalid bit + rts + + EndProc + ;———————————————————————————————————————————————————————————————————————————————————————————————————— ; DrawMenuBar clear MenuBarInvalidBit and MenuBarGlobalInvalidBit ; @@ -77,4 +97,45 @@ DrawMenuBarIfInvalidOnHiliteMenu PatchProc _HiliteMenu,(Plus,SE,II,Portable,IIci EndProc +; Restored verbatim from MenuMgrExtensions.a +;———————————————————————————————————————————————————————————————————————————————————————————————————— +; ValidateMenuBar is the routine that draws the menu bar only if necessary (local or global dirty bit set) +; +; Note that the Process Mgr will not let the _DrawMenuBar through if we’re not the frontmost process. +; +; For the local dirty bit, we don’t care, since we’ll get redrawn anyway when we come to the front. This +; means we can clear it here to eliminate multiple calls to _DrawMenuBar that won’t do anything. +; +; However, we want to only test (not clear) the global dirty bit here, which is set by DrawMBARString, since +; we want to make sure the menu bar gets redrawn eventually no matter which app is at the front. +; +; To avoid problems where apps patch any of DrawMenuBar, HiliteMenu, MenuSelect (i.e., the routines +; herein that utilize ValidateMenuBar) and recurse forever trying to validate the menu bar, we +; use a semaphore. (THINK Pascal 3.0 was our orignal culprit.) Note the InstallProc below to +; initialize the semaphore to zero (meaning we are not in ValidateMenuBar). + +InitValidateMenuBarSemaphore InstallProc (Plus,SE,II,Portable,IIci) ; <7> + + bclr #ValidateMenuBarSemaphoreBit,ValidateMenuBarSemaphoreByte ; clear semaphore at startup + rts + + EndProc + +ValidateMenuBar Proc EXPORT + + bset #ValidateMenuBarSemaphoreBit,ValidateMenuBarSemaphoreByte ; Check and set semaphore <7> + bnz.s @dontRecurse ; If set, then do nothing. <7> + bclr #MenuBarInvalidBit,MenuBarInvalidByte ; clear the local invalid bit + bnz.s @dirty ; draw menu bar if set <6> + btst #MenuBarGlobalInvalidBit,MenuBarGlobalInvalidByte ; check the global invalid bit <6> + bz.s @notDirty ; exit if not set <6> +@dirty + _DrawMenuBar +@notDirty + bclr #ValidateMenuBarSemaphoreBit,ValidateMenuBarSemaphoreByte ; Clear semaphore at exit <7> +@dontRecurse + rts + + EndProc + end diff --git a/Toolbox/MenuMgr/StandardMBDF.a b/Toolbox/MenuMgr/StandardMBDF.a index fcd6579..07332f6 100644 --- a/Toolbox/MenuMgr/StandardMBDF.a +++ b/Toolbox/MenuMgr/StandardMBDF.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted : changed back to short branches +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: StandardMBDF.a ; @@ -826,7 +833,7 @@ SkipSysLoop DONEDRAWMLOOP BSR ClipMBar ; Restore the clip to the whole menu bar <10> move saveD3(a6), d0 ; get savedID of hilited menu - beq DrawDone ; branch if none CSS + beq.s DrawDone ; branch if none ex CSS move d0,d3 ; and put it in d3 too bsr GetTitleRect ; get selected title's rect move.l menuOH(a3,d3),a0 ; get selected menuHandle @@ -1468,7 +1475,7 @@ CalcBar MOVE.L SystemMenuList, A0 ; Get system menulist MOVE.L (A0), A1 ; deref system menulist handle TST.W lastMenu(A1) ; Are there any system menus? - BEQ SystemMenusAreIN ; Well, there aren't any -- so they are all in! CSS + BEQ.S SystemMenusAreIN ; Well, there aren't any -- so they are all in! ex CSS BSR FindFirstSystemMenu6BO ; See if the system menus are in. BNE.S SystemMenusAreIN ; Yes, they are (D0 is offset to 1st one) @@ -1721,7 +1728,7 @@ HiliteBar BSR ClipMBar ; MOVE.W param2+2(A6),D0 ; get the hilite selector - BEQ FlipBar ; if index = 0 then flip bar <35> CSS + BEQ.S FlipBar ; if index = 0 then flip bar <35> ex CSS CMP.W #1,param2(a6) ; hi-word has hilite BGT.S DoneHilite ; if not in range we support then bye-bye diff --git a/Toolbox/MenuMgr/StandardMDEF.a b/Toolbox/MenuMgr/StandardMDEF.a index ee17e65..68d7680 100644 --- a/Toolbox/MenuMgr/StandardMDEF.a +++ b/Toolbox/MenuMgr/StandardMDEF.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted /<64>: removed check for NIL before DisposeHandle +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: StandardMDEF.a ; @@ -442,9 +449,7 @@ MDEFSaveReg REG D3-D7/A2-A4 move.l a3, a0 ; get menuHandle _HUnlock ; and unlock it before we leave - move.l arrowHandle(a6),d0 ; the arrow handle or NIL <48><64> - beq.s @skipDispose ; Don't bother if already NIL <64> - move.l d0,a0 ; Get ready for DisposeHandle <64> + move.l arrowHandle(a6),a0 ; the arrow handle or NIL <48> ex<64> _DisposeHandle ; DisposeHandle can deal with NIL <48> @skipDispose diff --git a/Toolbox/NotificationMgr/NotificationMgr.c b/Toolbox/NotificationMgr/NotificationMgr.c index 7ee2c8f..a4d1ecd 100644 --- a/Toolbox/NotificationMgr/NotificationMgr.c +++ b/Toolbox/NotificationMgr/NotificationMgr.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted /: restored the simple SndPlay to DoSound + Reverted : removed early-return speedup from NMTask + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: NotificationMgr.c @@ -658,13 +666,11 @@ RotateIcon(NMRecPtr theNMRec, int /*procLevel*/) } /* Play a sound */ +/* ex ex */ void DoSound(NMRecPtr theNMRec, int procLevel) { register Handle theSound = theNMRec->nmSound; - SndChannelPtr chan = nil; // - long sysBeepVolume = 0; - SndCommand cmd; theNMRec->nmFlags |= fSndPlayed; if (theSound) @@ -674,16 +680,7 @@ DoSound(NMRecPtr theNMRec, int procLevel) SysBeep(3); else { - if ( SndNewChannel(&chan, 0, 0, nil) == noErr ) - { - GetSysBeepVolume(&sysBeepVolume); - cmd.cmd = volumeCmd; - cmd.param2 = sysBeepVolume; - SndDoImmediate(chan, &cmd); - - SndPlay(chan, theSound, false); - SndDisposeChannel(chan, true); - } + SndPlay(NULL, theSound, false); } } } @@ -823,23 +820,20 @@ NMGNEFilter(void) } /* Called by SystemTask in the topmost layer */ +/* ex */ pascal void NMTask(void) { register int procLevel; short selector[4]; - /* NOTE: If this code seems buggy, take this 'if' statement and move it below after the call to AddIconRec() */ - if (NMQHdr->requests.qHead == nil) - return; - - selector[0] = MoveSICNToPM; - selector[1] = MoveICSToPM; - selector[2] = MoveSICNToAM; - selector[3] = MoveICSToAM; - procLevel = disable(); + selector[3] = MoveICSToAM; + selector[2] = MoveSICNToAM; + selector[1] = MoveICSToPM; + selector[0] = MoveSICNToPM; + { /* Find the first queue element that needs attention. * Note that the response proc is the last thing done. diff --git a/Toolbox/NotificationMgr/NotificationMgr.make b/Toolbox/NotificationMgr/NotificationMgr.make index 11a27f8..28e58ed 100644 --- a/Toolbox/NotificationMgr/NotificationMgr.make +++ b/Toolbox/NotificationMgr/NotificationMgr.make @@ -1,3 +1,12 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added NotificationMgrPatch.a to the lpch build lib. Recreated the build +# rule for PatchROMAlarmNotify.a, which also goes in the lpch build, but +# separately. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: NotificationMgr.make # @@ -11,7 +20,8 @@ # -NotificationMgrObjs = "{ObjDir}NotificationMgr.c.o" ∂ +NotificationMgrObjs = "{ObjDir}NotificationMgrPatch.a.o" # ∂ + "{ObjDir}NotificationMgr.c.o" ∂ "{ObjDir}NotificationMgr.a.o" ∂ "{ObjDir}SetProcessorLevel.a.o" @@ -48,3 +58,15 @@ NotificationMgrObjs = "{ObjDir}NotificationMgr.c.o" ∂ "{ObjDir}SetProcessorLevel.a.o" ƒ "{NotificationDir}SetProcessorLevel.a" Asm {StdAOpts} -o "{Targ}" "{NotificationDir}SetProcessorLevel.a" + +# +"{ObjDir}NotificationMgrPatch.a.o" ƒ "{ObjDir}StandardEqu.d" ∂ + "{IntAIncludes}LinkedPatchMacros.a" ∂ + "{NotificationDir}NotificationMgrPatch.a" + Asm {StdAOpts} -o {Targ} "{NotificationDir}NotificationMgrPatch.a" + + +# +"{ObjDir}PatchROMAlarmNotify.a.o" ƒ "{NotificationDir}PatchROMAlarmNotify.a" + Asm {StdAOpts} -o "{Targ}" "{NotificationDir}PatchROMAlarmNotify.a" + diff --git a/Toolbox/Printing/PrintGlue.a b/Toolbox/Printing/PrintGlue.a index c8ef41f..e45619d 100644 --- a/Toolbox/Printing/PrintGlue.a +++ b/Toolbox/Printing/PrintGlue.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted /: removed cache flush for short "stub" PDEFs +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: PrintGlue.a ; @@ -352,18 +359,7 @@ GotPDEF Move.l d0,a4 ; Transfer the handle to an a-reg Move.l a4,a0 ; Lock that baby down -; Some programmers are pretty slimy and load a PDEF that is empty. They then fau -; stuff some code into it. However, since HLOCK does not flush the cache anymore, fau -; the code that they stuff into it might not get written back to memory. To solve this, fau -; we check here whether the PDEF resource size is less than, say, 32 bytes. If so, we fau -; assume that they have already loaded the PDEF and modified it, so we flush the cache fau -; for them. fau - - _GetHandleSize ; How big is our PDEF Handle fau - cmp.l #32,D0 ; Is it "small" fau - bhi.s @RealPDEF ; no, don't flush the cache fau - jsr ([jCacheFlush]) ; else, flush the caches. fau -@RealPDEF ; fau +;ex _HLock ;<22Feb87> JNP Restore curMap before jumping into the print code. Move.w a3, -(sp) ; <22Feb87> JNP user's resfile refnum diff --git a/Toolbox/ResourceMgr/ResourceMgr.make b/Toolbox/ResourceMgr/ResourceMgr.make index c977988..20e93e6 100644 --- a/Toolbox/ResourceMgr/ResourceMgr.make +++ b/Toolbox/ResourceMgr/ResourceMgr.make @@ -1,3 +1,13 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Leave ResourceMgr.a out of linked patches -- it is not needed, and its +# SuperMario changes (an OPENRESFILE symbol) mess up the build. +# Include ResourceMgrPatches.a in the linked patches. +# Add some rules for the linked patches. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: ResourceMgr.make # @@ -13,8 +23,8 @@ # 4/8/93 fau Updated the dependencies for ResourceMgr.a. # -ResourceMgrObjs = "{ObjDir}ResourceMgr.a.o" ∂ - "{ObjDir}ResourceMgrExtensions.a.o" +ResourceMgrObjs = "{ObjDir}ResourceMgrExtensions.a.o" ∂ + "{ObjDir}ResourceMgrPatches.a.o" # "{LibDir}ResourceMgr.lib" ƒ {ResourceMgrObjs} @@ -44,3 +54,18 @@ ResourceMgrObjs = "{ObjDir}ResourceMgr.a.o" ∂ Asm {StdAOpts} -o "{Targ}" "{ResourceMgrDir}ResourceMgrExtensions.a" +# +"{ObjDir}ResourceMgrPatches.a.o" ƒ "{ResourceMgrDir}ResourceMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{ResourceMgrDir}ResourceMgrPatches.a" + + +# +"{ObjDir}ResourceOverridePatches.a.o" ƒ "{ResourceMgrDir}ResourceOverridePatches.a" + Asm {StdAOpts} -o "{Targ}" "{ResourceMgrDir}ResourceOverridePatches.a" + + +# +"{ObjDir}OpenResFile.a.o" ƒ "{ResourceMgrDir}OpenResFile.a" + Asm {StdAOpts} -o "{Targ}" "{ResourceMgrDir}OpenResFile.a" + + diff --git a/Toolbox/ResourceMgr/ResourceMgrExtensions.a b/Toolbox/ResourceMgr/ResourceMgrExtensions.a index 80e029e..0210544 100644 --- a/Toolbox/ResourceMgr/ResourceMgrExtensions.a +++ b/Toolbox/ResourceMgr/ResourceMgrExtensions.a @@ -1,3 +1,19 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted /: removed check for FONT<->NFNT conflicts, and +; changed some branches back to shorts +; Reverted -/: put Begin/EndSystemMode back in +; Reverted : IsThisASystemResource is true for 0 and kSystemProcess +; Reverted : changed size back to 30 from 32 +; Reverted : restored (apparently buggy) word test +; : Removed a line labelled that didn't match the log entry +; Reverted : Don't set TwoDeepBit bit in MakeOverrideMap +; Reverted : Move the EXG instruction back down +; Reverted : brought patches back from ResourceMgrPatches.a +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ResourceMgrExtensions.a ; @@ -901,8 +917,8 @@ ValidateFontResourceIDs Proc Export bsr FindIDInFromToList ; <57> Go find the ID move.w (sp)+,d2 ; <57> FindIDInFromList will return the ID to renumber to, or -1 if this ID wasn’t in the table cmpi.w #-1,d2 ; <57> Did we get back a -1? - bne @changeFATEntry ; <57> This font was already renumbered. Just change the font association table entry. - bra @nextTableEntry ; <57> A -1 means that this ID isn’t in our list, so this 'FOND' entry is probably bad. + bne.s @changeFATEntry ; <57> ex This font was already renumbered. Just change the font association table entry. + bra.s @nextTableEntry ; <57> ex A -1 means that this ID isn’t in our list, so this 'FOND' entry is probably bad. ; ; See if the ID conflicts with a font resource in the main chain. @@ -916,31 +932,7 @@ ValidateFontResourceIDs Proc Export move.w 4(a3),-(sp) ; Look for this ID. _GetResource ; Does it exist? move.l (sp)+,d0 - bne.s @conflictOccured ; This number is used - - cmpi.l #'FONT',d3 ; If it is a FONT, also check for NFNT conflicts - beq.s @checkForNFNTs ; - cmpi.l #'NFNT',d3 ; If it is a NFNT, also check for FONT conflicts - beq.s @checkForFONTs ; - bra.s @nextTableEntry ; If it is a sfnt or other, go on to the next one. - -@checkForFONTs - subq #4,sp ; - move.l #'FONT',-(sp) ; Look for FONT type in the main chain - move.w 4(a3),-(sp) ; Look for this ID. - _GetResource ; Does it exist? - move.l (sp)+,d0 ; - bz.s @nextTableEntry ; This number is fine - bra.s @conflictOccured - -@checkForNFNTs - subq #4,sp ; - move.l #'NFNT',-(sp) ; Look for NFNT type in the main chain - move.w 4(a3),-(sp) ; Look for this ID. - _GetResource ; Does it exist? - move.l (sp)+,d0 ; - bz.s @nextTableEntry ; This number is fine - + bz.s @nextTableEntry ; ex This number is fine @conflictOccured move.l d0,a0 ; <46> btst #kDeanBit,kBrianBits ; <53> See if we loaded the resource @@ -1116,7 +1108,7 @@ FontResourceTypes ReleaseTheFont Proc Export With ConflictStackFrame move.l (sp)+,d1 ; Save the return address - tst.b fontAlreadyLoaded(a6) ; <46> See if we loaded the font + tst.w fontAlreadyLoaded(a6) ; <46> See if we loaded the font ex bz.s @weLoadedTheFont ; <46> If we did, then unload it addq #4,sp ; <46> If it was already loaded when we got our hands on it, leave it alone. clr.w fontAlreadyLoaded(a6) ; <46> And clear this flag for the next time. @@ -1289,6 +1281,7 @@ retAddr ds.l 1 A6Link ds.l 1 catInfoRec ds.b ioHFQElSiz ; Parameter block for _GetCatInfo call currentZone ds.l 1 ; Current zone +systemMode ds.w 1 ; ex realCurMap ds.w 1 ; Current resource map openingFontFile ds.w 1 ; <34> Non zero if this file is a font file localSize equ * @@ -1301,6 +1294,7 @@ localSize equ * move.w #-1,fileRefNum(a6) ; Be pessimistic and assume we’ll fail clr.w openingFontFile(a6) ; <34> Assume it’s not a font file. + clr.w systemMode(a6) ; ex ; Get the file type and creator of this file. @@ -1339,6 +1333,16 @@ localSize equ * move.l TheZone,currentZone(a6) ; Save the current zone move.l SysZone,TheZone ; Make sure map is opened in the system heap +; ex Open the file in System Mode (if OSDispatch is available) + move.l ExpandMem,a0 + tst.w ExpandMemRec.emProcessMgrExists(a0) ; See if Process Manager is around so _BeginSystemMode exists + bz.s @noBeginSystemMode ; It’s not. Don’t call BeginSystemMode + st systemMode(a6) + subq #2,sp + _BeginSystemMode ; The file was opened in system mode, so it needs to be closed that way. + addq #2,sp +@noBeginSystemMode + move.l TopMapHndl,a3 ; Remember current top resource map subq #2,sp move.l fileSpec(a6),-(sp) ; Pass file descriptor @@ -1365,10 +1369,15 @@ localSize equ * move.l ExpandMem,a0 ; <34> This was a font file add.w #1,ExpandMemRec.emOpenFontFiles(a0) @markFileOwner - move.w fileRefNum(a6),d0 - bsr MarkFileAsOwnedByTheSystem ; <62> Do this instead of opening in system mode @restoreHeap +; ex End System Mode (if we entered it) + tst.b systemMode(a6) ; See if Process Manager is around so _BeginSystemMode exists + bz.s @noEndSystemMode ; It’s not. Don’t call EndSystemMode + subq #2,sp + _EndSystemMode + addq #2,sp +@noEndSystemMode move.l currentZone(a6),TheZone ; Restore the current heap @exit move.w realCurMap(a6),CurMap ; <19> Restore CurMap @@ -1518,7 +1527,12 @@ IsThisASystemResourceMap Proc Export move.l (a0)+,d0 ; Get high long of PSN bnz.s @exit ; If not zero, it can’t be kSystemProcess - cmpi.l #kSystemProcess,(a0) ; <62> Check low word of PSN. + +; ex ex ex ... + move.l (a0),d0 ; Treat kNoProcess (0) like kSystemProcess (1) + beq.s @isSystemResource + cmpi.l #kSystemProcess,d0 ; <62> Check low word of PSN. + bne.s @exit @isSystemResource move.w #-1,4(sp) ; This is a system resource map @@ -1550,28 +1564,7 @@ GetPSNFromParallelFCB Proc Export EndProc ; MarkFileAsOwnedByTheSystem -; -; If a file is considered to be a “system file” if the PSN of the process that opened -; the file is kSystemProcess. Under 7.1, we also considered files with a PSN of 0 -; to be a system file. This caused problems for extensions that opened files and -; wanted to load resources into their own heap instead of the system heap. In 7.2 -; and later, this is no longer the case, so we need to explicitly set the PSN in the -; parallel FCB array to kSystemProcess for font files and override maps. This is what -; this routine does. -; -; Input: D0 Reference number of file to mark -; - -MarkFileAsOwnedByTheSystem Proc Export - Import GetPSNFromParallelFCB - - move.l a0,-(sp) ; Preserve A0 - bsr GetPSNFromParallelFCB - clr.l (a0)+ ; Clear high word of PSN - move.l #kSystemProcess,(a0) ; Set the low word - move.l (sp)+,a0 ; Restore A0 - rts - EndProc +; ex deleted ;_______________________________________________________________________________ @@ -1892,7 +1885,7 @@ MakeOverrideMap Proc Export move.l d0,-(sp) ; save handle for ReleaseResource later - moveq #32,d0 ; Space for header, map info, and type count + moveq #30,d0 ; Space for header, map info, and type count ex _NewHandle ,Sys,Clear ; Create a new map move.l a0,a4 ; Keep handle to new map in A4 move.l (a0),a0 @@ -1909,9 +1902,8 @@ MakeOverrideMap Proc Export move.w #mNames+4,(a0)+ ; Point to after resource map for name list move.w #-1,(a0)+ ; Nothing in the resource map clr.w (a0) ; No names in the map - move.l (a4),a1 ; get map pointer in a1 rb - bset #twoDeepBit,mInMemoryAttr(a1) ; mark for extended search rb - bset #overrideNextMapBit,mInMemoryAttr(a1) ; mark as an override map rb +; ex Don't set the TwoDeepBit attribute +; ex Don't set the OverrideNextMapBit attribute move.l (sp),a1 ; get rovm resource handle move.l (a1),a1 ; get rovm resource pointer @@ -1957,12 +1949,12 @@ MakeOverrideMap Proc Export ; If this resource has a name, add the name to the override map ; - exg a1,a2 ; Get entry pointer back in A2 rb move.w rNameOff(a0),d0 ; Get offset to resource name bmi.s @noName ; If negative, this resource has no name move.l (a5),a0 ; Dereference ROM map handle add.w MNames(a0),a0 ; Get to resource name list add.l d0,a0 ; A0 now points to the name for this resource + exg a1,a2 ; Get entry pointer back in A2 ex rb jsrROM AddName ; Let the Resource Manager do the hard part ; @@ -2090,9 +2082,7 @@ InsertOverrideMap Proc Export clr.w ResErr ; No error if we got this far ; <62> Mark override map as being owned by the system - - move.w mRefNum(a1),d0 ; Get file reference number - bsr MarkFileAsOwnedByTheSystem +; ex Removed call to MarkFileAsOwnedByTheSystem ; Clear emLastMapOverridden to force a resynchronization of the override maps. @@ -2334,5 +2324,246 @@ localSize equ * rts ; Return EndProc +; brought patches back from ResourceMgrPatches.a (rest of file) ex + +;____________________________________________________________________________________________________ +; StdDirIDExit +; +; This is a way out of Resource Mgr patches that clears the dirID global. +; It does very little of what StdExit in the Resource Manager does: +; For example, it does not restore saved registers. + +StdDirIDExit PROC EXPORT + + move.l ExpandMem,a0 ; point to extended low-memory + clr.l ExpandMemRec.resourceMgrDirID(a0) ; get rid of special dirID (done in StdExit on newer ROMs) + + move.l (sp)+,a0 ; get return address in A0 + add.l d0,sp ; pop off parameters + jmp (a0) ; return + + endproc + + + + +;____________________________________________________________________________________________________ +; CreateResFile(fileName: Str255); + +CreateResFileDirIDExit PatchProc _CreateResFile,(Plus,SE,II,Portable,IIci) + import StdDirIDExit + + move.l 4(sp),-(sp) ; pass file name + If forRom Then ; <2> kc.start + Import CreateResFile + jsr CreateResFile + Else + jsrOld ; create resource file + Endif ; <2> kc.end + + moveq #4,d0 ; get size of parameters + jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) + + endproc + +;____________________________________________________________________________________________________ +; HCreateResFile(vRefNum: INTEGER; dirID: LONGINT; fileName: Str255); +; This procedure needs to be named differently to get linked into LinkedPatches.rsrc by LinkPatch. + +CreateDirIDResFile PatchProc _HCreateResFile,(Plus,SE,II,Portable,IIci) + import StdDirIDExit + + move.l ExpandMem,a0 ; point to extended low-memory + move.l 4+4(sp),ExpandMemRec.resourceMgrDirID(a0) ; jam in the dirID + + move.w 4+4+4(sp),d0 ; get the vRefNum + + move.l 4(sp),-(sp) ; pass file name + pea ReturnHere ; start doing a CreateResFile + jsrROM StdZEntry ; save registers, etc. (D0 is saved across this call) + move.w d0,ioStkFrame+ioVRefNum(a6) ; stuff vRefNum into parameter block + jmpROM AfterStdZEntryInCreateResFile ; join CreateResFile +ReturnHere + + moveq #4+4+2,d0 ; get size of parameters + jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) + + endproc + +;____________________________________________________________________________________________________ +; OpenResFile(fileName: Str255): INTEGER; + +OpenResFileDirIDExit PatchProc _OpenResFile,(Plus,SE,II,Portable,IIci) + import StdDirIDExit + + subq #2,sp ; make room for result + move.l 2+4(sp),-(sp) ; pass file name + If forRom Then ; <2> kc.start + Import OpenResFile + jsr OpenResFile + Else + jsrOld ; open resource file + Endif ; <2> kc.end + move.w (sp)+,4+4(sp) ; propagate result out + + moveq #4,d0 ; get size of parameters + jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) + + endproc + +;____________________________________________________________________________________________________ +; OpenRFPerm(fileName: Str255; vRefNum: INTEGER; permission: SignedByte): INTEGER; + +OpenRFPermDirIDExit PatchProc _OpenRFPerm,(Plus,SE,II,Portable,IIci) + import StdDirIDExit + + subq #2,sp ; make room for result + move.l 2+4+2+2(sp),-(sp) ; pass file name + move.w 4+2+4+2(sp),-(sp) ; pass vRefNum + move.b 2+4+2+4(sp),-(sp) ; pass permission + + jsrOld ; open resource file + + move.w (sp)+,4+2+2+4(sp) ; propagate result out + + moveq #2+2+4,d0 ; get size of parameters + jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) + + endproc + +;____________________________________________________________________________________________________ +; HOpenResFile(vRefNum: INTEGER; dirID: LONGINT; fileName: Str255; permission: SignedByte): INTEGER; +; This procedure needs to be named differently to get linked into LinkedPatches.rsrc by LinkPatch. + +OpenDirIDResFile PatchProc _HOpenResFile,(Plus,SE,II,Portable,IIci) + import StdDirIDExit + + move.l ExpandMem,a0 ; point to extended low-memory + move.l 4+2+4(sp),ExpandMemRec.resourceMgrDirID(a0) ; jam in the dirID + + subq #2,sp ; make room for result + move.l 2+4+2(sp),-(sp) ; pass file name + move.w 4+2+4+2+4+4(sp),-(sp) ; pass vRefNum + move.b 2+4+2+4(sp),-(sp) ; pass permission + jsrROM ROMOpenRFPerm ; open resource file + move.w (sp)+,4+2+4+4+2(sp) ; propagate result out for HOpenResFile + + moveq #2+4+4+2,d0 ; get size of parameters + jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) + + endproc + +;____________________________________________________________________________________________________ +; patch to Create to use dirID +; +; This patch should only apply to the Create call in CreateResFile. +; Since come-from patches are a pain, instead we assume that the “resourceMgrDirID” +; global will be zero, except for some cases when Create is called from CreateResFile. +; +; Come-from patches are now cake with linked patches, so this routine has been changed into +; a proper come-from patch. <2> DTY 6/27/90 + + +NewCreate ComeFromPatchProc _Create,AfterCreateInCreateResFile,(Plus,SE,II,Portable,IIci) + move.l a0,-(sp) ; save pointer to the old parameter block + + sub #ioHQElSize,sp ; make room for new parameter block + + move.l ioFileName(a0),ioFileName(sp) ; use the same file name + move.w ioVRefNum(a0),ioVRefNum(sp) ; use the same vRefNum + move.b ioFileType(a0),ioFileType(sp) ; use the same “file type” + move.l ExpandMem,a1 ; point to extended low-memory + move.l ExpandMemRec.resourceMgrDirID(a1),d0 ; get the dirID + move.l d0,ioDirID(sp) ; put in the dirID + + move.l sp,a0 ; use the new parameter block + or.w #newHFS,d1 ; set the HFS bit in the trap word (passed by dispatcher) + jsrOld ; Call old _Create + + add #ioHQElSize,sp ; get rid of the parameter block + + move.l (sp)+,a0 ; get pointer to the old parameter block + move.w d0,ioResult(a0) ; put result in the old parameter block + + rts + + endproc + +;____________________________________________________________________________________________________ +; patch to OpenRF to use dirID +; +; This patch should only apply to the OpenRF call in ORFCommon. +; Since come-from patches are a pain, instead we assume that the “resourceMgrDirID” +; global will be zero, except for some cases when OpenRF is called from ORFCommon. +; +; Come-from patches are now cake with linked patches, so this routine has been changed into +; a proper come-from patch. <2> DTY 6/27/90 + +NewOpenRF ComeFromPatchProc _OpenRF,AfterOpenRFInORFCommon,(Plus,SE,II,Portable,IIci) + move.l a0,-(sp) ; save pointer to the old parameter block + + sub #ioHQElSize,sp ; make room for new parameter block + + move.l ExpandMem,a1 ; point to extended low-memory + move.l ExpandMemRec.resourceMgrDirID(a1),d0 ; get the dirID + move.l d0,ioDirID(sp) ; put in the dirID + + move.l ioFileName(a0),ioFileName(sp) ; use the same file name + move.w ioVRefNum(a0),ioVRefNum(sp) ; use the same vRefNum + move.b ioFileType(a0),ioFileType(sp) ; use the same “file type” + move.b ioPermssn(a0),ioPermssn(sp) ; use the same permissions + move.l ioOwnBuf(a0),ioOwnBuf(sp) ; and the same file buffer + + move.l sp,a0 ; use the new parameter block + or.w #newHFS,d1 ; set the HFS bit in the trap word (passed by dispatcher) + jsrOld ; Call old _OpenRF routine + + move.w ioRefNum(sp),d1 ; get the refNum result into a register + + add #ioHQElSize,sp ; get rid of the parameter block + + move.l (sp)+,a0 ; get pointer to the old parameter block + move.w d0,ioResult(a0) ; put result in the old parameter block + move.w d1,ioRefNum(a0) ; put refNum in the old parameter block + + rts + + endproc + +;____________________________________________________________________________________________________ +; Un-implement (de-announce) _AddReference and _RmveReference traps + +InstallResourceMgrExtensions InstallProc (Plus,SE,II,Portable,IIci) + + move.w #$9f,d0 + _GetTrapAddress newTool ; get the address of the Unimplemented trap + move.w #$1AC,d0 + _SetTrapAddress newTool ; nuke AddReference + move.w #$1AE,d0 + _SetTrapAddress newTool ; nuke RmveReference + + rts + + EndProc + +;____________________________________________________________________________________________________ +; patch to _SetEOF inside CheckGrow to check for resource file too large +; +; CheckGrow is called by AddResource, ChangedResource, SetResInfo, and (more or less) by +; SetResourceSize above. It calls _SetEOF to grow the file to accomodate these operations. +; Unfortunately, while the File Mgr supports files > 16 meg, the Resource Mgr does not. +; This patch checks if the size passed to _SetEOF is too big, and returns eofErr (for lack of +; a better error) in this case. + +ValidateFileSizeInCheckGrow ComeFromPatchProc _SetEOF,AfterSetEOFInCheckGrow,(Plus,SE,II,Portable,IIci) + + tst.b (a1) ; get new size of file set up by CheckGrow (a1 points to ioLEOF inside param block) + ; note: 16 meg = $01000000, so if any bits are set in first byte it’s >= 16 meg + beqOld ; no, grow the file as usual + move.w #eofErr,d0 ; yes, return an error (not really an eofErr, but it is the end of the resource fork) + rts + + endproc + End diff --git a/Toolbox/ResourceMgr/ResourceMgrPatches.a b/Toolbox/ResourceMgr/ResourceMgrPatches.a index 2a7cc56..1869437 100644 --- a/Toolbox/ResourceMgr/ResourceMgrPatches.a +++ b/Toolbox/ResourceMgr/ResourceMgrPatches.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted : moved patches back to ResourceMgrExtensions.a +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ResourceMgrPatches.a ; @@ -775,246 +782,7 @@ MyGetResource PatchProc _GetResource,(Plus,SE,II,Portable,IIci) EndProc endif -;____________________________________________________________________________________________________ -; StdDirIDExit -; -; This is a way out of Resource Mgr patches that clears the dirID global. -; It does very little of what StdExit in the Resource Manager does: -; For example, it does not restore saved registers. - -StdDirIDExit PROC EXPORT - - move.l ExpandMem,a0 ; point to extended low-memory - clr.l ExpandMemRec.resourceMgrDirID(a0) ; get rid of special dirID (done in StdExit on newer ROMs) - - move.l (sp)+,a0 ; get return address in A0 - add.l d0,sp ; pop off parameters - jmp (a0) ; return - - endproc - - - - -;____________________________________________________________________________________________________ -; CreateResFile(fileName: Str255); - -CreateResFileDirIDExit PatchProc _CreateResFile,(Plus,SE,II,Portable,IIci) - import StdDirIDExit - - move.l 4(sp),-(sp) ; pass file name - If forRom Then ; <2> kc.start - Import CreateResFile - jsr CreateResFile - Else - jsrOld ; create resource file - Endif ; <2> kc.end - - moveq #4,d0 ; get size of parameters - jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) - - endproc - -;____________________________________________________________________________________________________ -; HCreateResFile(vRefNum: INTEGER; dirID: LONGINT; fileName: Str255); -; This procedure needs to be named differently to get linked into LinkedPatches.rsrc by LinkPatch. - -CreateDirIDResFile PatchProc _HCreateResFile,(Plus,SE,II,Portable,IIci) - import StdDirIDExit - - move.l ExpandMem,a0 ; point to extended low-memory - move.l 4+4(sp),ExpandMemRec.resourceMgrDirID(a0) ; jam in the dirID - - move.w 4+4+4(sp),d0 ; get the vRefNum - - move.l 4(sp),-(sp) ; pass file name - pea ReturnHere ; start doing a CreateResFile - jsrROM StdZEntry ; save registers, etc. (D0 is saved across this call) - move.w d0,ioStkFrame+ioVRefNum(a6) ; stuff vRefNum into parameter block - jmpROM AfterStdZEntryInCreateResFile ; join CreateResFile -ReturnHere - - moveq #4+4+2,d0 ; get size of parameters - jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) - - endproc - -;____________________________________________________________________________________________________ -; OpenResFile(fileName: Str255): INTEGER; - -OpenResFileDirIDExit PatchProc _OpenResFile,(Plus,SE,II,Portable,IIci) - import StdDirIDExit - - subq #2,sp ; make room for result - move.l 2+4(sp),-(sp) ; pass file name - If forRom Then ; <2> kc.start - Import OpenResFile - jsr OpenResFile - Else - jsrOld ; open resource file - Endif ; <2> kc.end - move.w (sp)+,4+4(sp) ; propagate result out - - moveq #4,d0 ; get size of parameters - jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) - - endproc - -;____________________________________________________________________________________________________ -; OpenRFPerm(fileName: Str255; vRefNum: INTEGER; permission: SignedByte): INTEGER; - -OpenRFPermDirIDExit PatchProc _OpenRFPerm,(Plus,SE,II,Portable,IIci) - import StdDirIDExit - - subq #2,sp ; make room for result - move.l 2+4+2+2(sp),-(sp) ; pass file name - move.w 4+2+4+2(sp),-(sp) ; pass vRefNum - move.b 2+4+2+4(sp),-(sp) ; pass permission - - jsrOld ; open resource file - - move.w (sp)+,4+2+2+4(sp) ; propagate result out - - moveq #2+2+4,d0 ; get size of parameters - jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) - - endproc - -;____________________________________________________________________________________________________ -; HOpenResFile(vRefNum: INTEGER; dirID: LONGINT; fileName: Str255; permission: SignedByte): INTEGER; -; This procedure needs to be named differently to get linked into LinkedPatches.rsrc by LinkPatch. - -OpenDirIDResFile PatchProc _HOpenResFile,(Plus,SE,II,Portable,IIci) - import StdDirIDExit - - move.l ExpandMem,a0 ; point to extended low-memory - move.l 4+2+4(sp),ExpandMemRec.resourceMgrDirID(a0) ; jam in the dirID - - subq #2,sp ; make room for result - move.l 2+4+2(sp),-(sp) ; pass file name - move.w 4+2+4+2+4+4(sp),-(sp) ; pass vRefNum - move.b 2+4+2+4(sp),-(sp) ; pass permission - jsrROM ROMOpenRFPerm ; open resource file - move.w (sp)+,4+2+4+4+2(sp) ; propagate result out for HOpenResFile - - moveq #2+4+4+2,d0 ; get size of parameters - jmp StdDirIDExit ; clear the dirID and exit (done by StdExit on newer ROMs) - - endproc - -;____________________________________________________________________________________________________ -; patch to Create to use dirID -; -; This patch should only apply to the Create call in CreateResFile. -; Since come-from patches are a pain, instead we assume that the “resourceMgrDirID” -; global will be zero, except for some cases when Create is called from CreateResFile. -; -; Come-from patches are now cake with linked patches, so this routine has been changed into -; a proper come-from patch. <2> DTY 6/27/90 - - -NewCreate ComeFromPatchProc _Create,AfterCreateInCreateResFile,(Plus,SE,II,Portable,IIci) - move.l a0,-(sp) ; save pointer to the old parameter block - - sub #ioHQElSize,sp ; make room for new parameter block - - move.l ioFileName(a0),ioFileName(sp) ; use the same file name - move.w ioVRefNum(a0),ioVRefNum(sp) ; use the same vRefNum - move.b ioFileType(a0),ioFileType(sp) ; use the same “file type” - move.l ExpandMem,a1 ; point to extended low-memory - move.l ExpandMemRec.resourceMgrDirID(a1),d0 ; get the dirID - move.l d0,ioDirID(sp) ; put in the dirID - - move.l sp,a0 ; use the new parameter block - or.w #newHFS,d1 ; set the HFS bit in the trap word (passed by dispatcher) - jsrOld ; Call old _Create - - add #ioHQElSize,sp ; get rid of the parameter block - - move.l (sp)+,a0 ; get pointer to the old parameter block - move.w d0,ioResult(a0) ; put result in the old parameter block - - rts - - endproc - -;____________________________________________________________________________________________________ -; patch to OpenRF to use dirID -; -; This patch should only apply to the OpenRF call in ORFCommon. -; Since come-from patches are a pain, instead we assume that the “resourceMgrDirID” -; global will be zero, except for some cases when OpenRF is called from ORFCommon. -; -; Come-from patches are now cake with linked patches, so this routine has been changed into -; a proper come-from patch. <2> DTY 6/27/90 - -NewOpenRF ComeFromPatchProc _OpenRF,AfterOpenRFInORFCommon,(Plus,SE,II,Portable,IIci) - move.l a0,-(sp) ; save pointer to the old parameter block - - sub #ioHQElSize,sp ; make room for new parameter block - - move.l ExpandMem,a1 ; point to extended low-memory - move.l ExpandMemRec.resourceMgrDirID(a1),d0 ; get the dirID - move.l d0,ioDirID(sp) ; put in the dirID - - move.l ioFileName(a0),ioFileName(sp) ; use the same file name - move.w ioVRefNum(a0),ioVRefNum(sp) ; use the same vRefNum - move.b ioFileType(a0),ioFileType(sp) ; use the same “file type” - move.b ioPermssn(a0),ioPermssn(sp) ; use the same permissions - move.l ioOwnBuf(a0),ioOwnBuf(sp) ; and the same file buffer - - move.l sp,a0 ; use the new parameter block - or.w #newHFS,d1 ; set the HFS bit in the trap word (passed by dispatcher) - jsrOld ; Call old _OpenRF routine - - move.w ioRefNum(sp),d1 ; get the refNum result into a register - - add #ioHQElSize,sp ; get rid of the parameter block - - move.l (sp)+,a0 ; get pointer to the old parameter block - move.w d0,ioResult(a0) ; put result in the old parameter block - move.w d1,ioRefNum(a0) ; put refNum in the old parameter block - - rts - - endproc - -;____________________________________________________________________________________________________ -; Un-implement (de-announce) _AddReference and _RmveReference traps - -InstallResourceMgrExtensions InstallProc (Plus,SE,II,Portable,IIci) - - move.w #$9f,d0 - _GetTrapAddress newTool ; get the address of the Unimplemented trap - move.w #$1AC,d0 - _SetTrapAddress newTool ; nuke AddReference - move.w #$1AE,d0 - _SetTrapAddress newTool ; nuke RmveReference - - rts - - EndProc - -;____________________________________________________________________________________________________ -; patch to _SetEOF inside CheckGrow to check for resource file too large -; -; CheckGrow is called by AddResource, ChangedResource, SetResInfo, and (more or less) by -; SetResourceSize above. It calls _SetEOF to grow the file to accomodate these operations. -; Unfortunately, while the File Mgr supports files > 16 meg, the Resource Mgr does not. -; This patch checks if the size passed to _SetEOF is too big, and returns eofErr (for lack of -; a better error) in this case. - -ValidateFileSizeInCheckGrow ComeFromPatchProc _SetEOF,AfterSetEOFInCheckGrow,(Plus,SE,II,Portable,IIci) - - tst.b (a1) ; get new size of file set up by CheckGrow (a1 points to ioLEOF inside param block) - ; note: 16 meg = $01000000, so if any bits are set in first byte it’s >= 16 meg - beqOld ; no, grow the file as usual - move.w #eofErr,d0 ; yes, return an error (not really an eofErr, but it is the end of the resource fork) - rts - - endproc - -;____________________________________________________________________________________________________ +; moved patches back to ResourceMgrExtensions.a ex ;———————————————————————————————————————————————————————————————————————————————————————————————————— diff --git a/Toolbox/ResourceMgr/ResourceOverridePatches.a b/Toolbox/ResourceMgr/ResourceOverridePatches.a index 6c0e49f..3f4d8ff 100644 --- a/Toolbox/ResourceMgr/ResourceOverridePatches.a +++ b/Toolbox/ResourceMgr/ResourceOverridePatches.a @@ -1,3 +1,13 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Added a special case to the _CountTypes patch that I don't understand, +; possibly related to <42>. +; Save/restore ResOneDeep and ROMMapInsert around the jCheckLoad call. +; Added missing PrNonPortable equate for the good stuff in Private.a. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ResourceOverridePatches.a ; @@ -210,6 +220,7 @@ include 'ToolEqu.a' include 'fontPrivate.a' include 'LinkedPatchMacros.a' + PrNonPortable: equ 1 ; include 'Private.a' include 'ResourceMgrPriv.a' @@ -493,7 +504,14 @@ localSize equ * clr.w oneDeepCall(a6) ; <26> It’s not one deep after all bsr SyncTopOverrideMap ; Set up the override maps @isCount1Types ; <24> + tst.b ROMMapInsert ; Don't clear ResOneDeep if ROMMapInsert AND CurMap == SysMap + bz.s @normalCase ; + move.w CurMap,d0 ; + cmp.w SysMap,d0 ; + beq.s @specialCase ; +@normalCase ; clr.b ResOneDeep ; <27> Clear ResOneDeep so CountTypes will count all resources left in the chain. +@specialCase ; subq #2,sp ; Room for word result jsrOld ; Call through to the Resource Manager move.w (sp)+,numTypes(a6) ; Pass the result back to the caller @@ -1437,6 +1455,8 @@ localSize equ * move.l realNextMap(a1),mNext(a0) ; <11> Restore the chain below this map move.l realTopMap(a1),TopMapHndl ; <11> Restore the real top map @notOneDeep + move.b ResOneDeep,-(sp) ; + move.b ROMMapInsert,-(sp) ; link a6,#RMgrStack ; Create a stack frame for CheckLoad clr.w ioStkFrame+ioVRefNum(a6) ; so that it has a IOPB where it clr.w ioStkFrame+ioFileType(a6) ; expects it on the stack @@ -1444,6 +1464,8 @@ localSize equ * move.l jCheckLoad,a0 ; Handy dandy vector to see if a resource is loaded jsr (a0) ; Go load the resource if necessary unlk a6 ; Toss the parameter block + move.b (sp)+,ROMMapInsert ; + move.b (sp)+,ResOneDeep ; move.l a0,resHandle(a6) ; Return the handle move.l a0,HSCHandle ; <37> And save it in the cache @exitGetIndResourceOverride @@ -2059,6 +2081,7 @@ FlushFontsCallThroughCommon move.l (a1),a0 ; Nail the next one too _DisposeHandle clr.l (a1) + clr.l LastFOND bra.s Exit DontFlushFonts diff --git a/Toolbox/ScriptMgr/International.r b/Toolbox/ScriptMgr/International.r index 94632fd..294611f 100644 --- a/Toolbox/ScriptMgr/International.r +++ b/Toolbox/ScriptMgr/International.r @@ -1,3 +1,10 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <23>: restored '…' to About Keyboards strings. + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: International.r @@ -646,7 +653,7 @@ resource 'STR#' (kKeybdMenuItemsID, sysHeap, purgeable) { { // strings for menu items <25> "\0x00"; // marker for default keybd <2><9> - "About Keyboards"; // <2><23> + "About Keyboards…"; // <2> ex<23> // "Next Script"; // currently not used // "Next Keyboard in Script"; // currently not used } }; @@ -740,7 +747,7 @@ {14, 15, 46, 447}, StaticText { disabled, - "About Keyboards" // <23> + "About Keyboards…" // ex<23> } } }; @@ -763,7 +770,7 @@ {14, 17, 44, 422}, StaticText { disabled, - "About Keyboards" // <23> + "About Keyboards…" // ex<23> } } }; @@ -792,7 +799,7 @@ {14, 15, 46, 447}, StaticText { disabled, - "About Keyboards" + "About Keyboards…" // ex<23> } } }; diff --git a/Toolbox/ScriptMgr/RomanNewJust.a b/Toolbox/ScriptMgr/RomanNewJust.a index 08f112f..5088ec5 100644 --- a/Toolbox/ScriptMgr/RomanNewJust.a +++ b/Toolbox/ScriptMgr/RomanNewJust.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted : restored fallthrough bug in PortChExtra. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: RomanNewJust.a ; @@ -2682,7 +2689,7 @@ GetPortChExtra move.l (sp)+,d2 ; get real chExtra for our size @donePortChExtra ; - rts + ;rts ; ex endproc diff --git a/Toolbox/ScriptMgr/ScriptMgr.make b/Toolbox/ScriptMgr/ScriptMgr.make index 057d2d0..9e2396e 100644 --- a/Toolbox/ScriptMgr/ScriptMgr.make +++ b/Toolbox/ScriptMgr/ScriptMgr.make @@ -1,3 +1,11 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Added ScriptMgrPatch and ScriptMgrUtil to the lpch build. Recreated +# several missing build rules. +# 9/2/94 SuperMario ROM source dump (header preserved below) +# + # # File: ScriptMgr.make # @@ -17,6 +25,8 @@ ScriptMgrObjects = "{ObjDir}ScriptMgrHeader.a.o" ∂ "{ObjDir}RomanUtil.a.o" ∂ "{ObjDir}ScriptMgrMisc.a.o" ∂ + "{ObjDir}ScriptMgrPatch.a.o" # ∂ + "{ObjDir}ScriptMgrUtil.a.o" # ∂ "{ObjDir}ScriptMgrUtilDate.a.o" ∂ "{ObjDir}ScriptMgrUtilText.a.o" ∂ "{ObjDir}ScriptMgrUtilNum.a.o" ∂ @@ -161,3 +171,91 @@ ScriptMgrObjects = "{ObjDir}ScriptMgrHeader.a.o" ∂ +# +ScriptMgrExtObjects = "{ObjDir}ScriptMgrExtHead.a.o" ∂ + "{ObjDir}ScriptMgrFindWord.c.o" ∂ + "{ObjDir}ScriptMgrTruncRepl.a.o" ∂ + "{ObjDir}RomanNewJust.a.o" ∂ + "{ObjDir}ScriptMgrKbdMenu.a.o" ∂ + "{ObjDir}ScriptMgrSysMenuPatch.a.o" ∂ + "{ObjDir}DblByteCompat.a.o" ∂ + "{ObjDir}ScriptMgrDispatch.a.o" ∂ + "{ObjDir}ScriptMgrKeyGetSet.a.o" ∂ + "{ObjDir}ScriptMgrExtensions.a.o" ∂ + "{ObjDir}ScriptMgrInit.a.o" ∂ + "{ObjDir}ScriptMgrExtTail.a.o" ∂ + + +# +"{RsrcDir}International.rsrc" ƒ "{ScriptMgrDir}International.r" + Rez {StdROpts} -o "{Targ}" "{ScriptMgrDir}International.r" + + +# +"{RsrcDir}ScriptMgrPatch.rsrc" ƒ "{LibDir}ScriptMgr.lib" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{LibDir}ScriptMgr.lib" + + +# +"{RsrcDir}ScriptMgrExtensions.rsrc" ƒ {ScriptMgrExtObjects} + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 {ScriptMgrExtObjects} + + +# +"{RsrcDir}InternationalPACK.a.rsrc" ƒ "{ObjDir}InternationalPACK.a.o" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{ObjDir}InternationalPACK.a.o" + + +# +"{RsrcDir}ScriptMgrROMPatch.rsrc" ƒ "{ObjDir}ScriptMgrROMPatch.a.o" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{ObjDir}ScriptMgrROMPatch.a.o" + + +# +"{RsrcDir}RomanITL2.a.rsrc" ƒ "{ObjDir}RomanITL2.a.o" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{ObjDir}RomanITL2.a.o" + + +# +"{RsrcDir}itl4Roman.a.rsrc" ƒ "{ObjDir}itl4Roman.a.o" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{ObjDir}itl4Roman.a.o" + + +# +"{ObjDir}ScriptMgrPatch.a.o" ƒ "{ScriptMgrDir}ScriptMgrPatch.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}ScriptMgrPatch.a" + + +# +"{ObjDir}ScriptMgrUtil.a.o" ƒ "{ScriptMgrDir}ScriptMgrUtil.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}ScriptMgrUtil.a" + + +# +"{ObjDir}InternationalPACK.a.o" ƒ "{ScriptMgrDir}InternationalPACK.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}InternationalPACK.a" + + +# +"{ObjDir}ScriptMgrROMPatch.a.o" ƒ "{ScriptMgrDir}ScriptMgrROMPatch.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}ScriptMgrROMPatch.a" + + +# +"{ObjDir}RomanITL2.a.o" ƒ "{ScriptMgrDir}RomanITL2.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}RomanITL2.a" + + +# +"{ObjDir}itl4Roman.a.o" ƒ "{ScriptMgrDir}itl4Roman.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}itl4Roman.a" + + +# +"{ObjDir}ScriptMgrExtHead.a.o" ƒ "{ScriptMgrDir}ScriptMgrExtHead.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}ScriptMgrExtHead.a" + + +# +"{ObjDir}ScriptMgrExtTail.a.o" ƒ "{ScriptMgrDir}ScriptMgrExtTail.a" + Asm {StdAOpts} -o "{Targ}" "{ScriptMgrDir}ScriptMgrExtTail.a" diff --git a/Toolbox/ScriptMgr/ScriptMgrExtensions.a b/Toolbox/ScriptMgr/ScriptMgrExtensions.a index 8af603e..68b33cb 100644 --- a/Toolbox/ScriptMgr/ScriptMgrExtensions.a +++ b/Toolbox/ScriptMgr/ScriptMgrExtensions.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted word branch. Reverted code to search for Chicago in +; ROM. Reverted /<12> fix to gestaltScriptMgr return code. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ScriptMgrExtensions.a ; @@ -100,7 +108,7 @@ gestaltScriptMgr ; initialize loop, set up default return values move.l gestaltSelector(a6),d0 ; selector value - move.w #gestaltUndefSelectorErr,result(a6) ; assume unknown selector <12> + move.l #gestaltUndefSelectorErr,result(a6) ; assume unknown selector <12> Changed from move.l lea gestaltSMgrTable,a1 ; loop to find Gestalt selector in table @@ -599,7 +607,7 @@ MacPlusISOOptSp equ $1004 ; bits set for Opt & Space on Mac+ ISO <7> subq #4,sp ; space for return value move.l #'FOND',-(sp) ; push type move.w d4,-(sp) ; push next id in range - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb + ; ex Not in ROM _GetResource tst.l (sp)+ ; was it there? bne.s @popRetnAndSetSysFondId ; if yes, go reset @@ -1033,7 +1041,7 @@ FixFond subq #4,sp ; return room move.l #'FOND',-(sp) ; see if this FOND exists move.w (a2),-(sp) ; id, get the id from a2 pointer <47> - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb + ; ex Not in ROM _GetResource tst.l (sp)+ ; was it there? bne.s @fixFondDone ; yes, ok @@ -1689,7 +1697,7 @@ haveValidScript ; <38> move.l d0,sourceLen(a6) ; save length _PtrToHand ; make new handle containing copy of text move.w d0,errCode(a6) ; save err code - bne lwrTrUnlk ; if error in PtrToHand, quit CSS + bne.s lwrTrUnlk ; if error in PtrToHand, quit CSS move.l a0,sourceHndl(a6) ; save new source handle move.l sourceLen(a6),d0 ; get length again _NewHandle ; make new handle with random contents diff --git a/Toolbox/ScriptMgr/ScriptMgrInit.a b/Toolbox/ScriptMgr/ScriptMgrInit.a index 770cf90..6206580 100644 --- a/Toolbox/ScriptMgr/ScriptMgrInit.a +++ b/Toolbox/ScriptMgr/ScriptMgrInit.a @@ -1,3 +1,15 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Removed rollin that initialized ExpandMem fields. Removed +; /<33> code that allowed zero entries in a script system dispatch +; table. Reverted back to calling rGet/SetScript vs +; RomanGet/SetScript (both are nops). Removed rollin that installed +; non-Roman script systems. Removed rollin that installed the +; Dictionary Mgr. Reverted code that searched for Chicago in ROM. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ScriptMgrInit.a (formerly SMgrInit.a) ; @@ -13,28 +25,6 @@ ; ; Change History (most recent first): ; -; 5/27/93 CSS Don't initialize emNumer and emDenom because these are obsolete -; fields. -; 5/21/93 CSS Initialize some expandmem: emNumer, emDenom, emScriptAppGlobals -; from ScriptMgrExtTail.a. -; 5/21/93 CSS Rollin from Reality: -; <33> 5/19/93 PKE #1086200: Change roman dispatch table initialization to handle -; nil entries in romanDispTable by setting the corresponding -; dispatch table entry to be nil. Then make nil entries in -; romanDispTable for IsSpecialFont and RawPrinterValues for ROM -; builds. -; 1/27/93 CSS Rollin fix to auto-install scripts. This fix loads the itlb -; resource for each script an determines if the auto-install bit -; (for simple scripts) is set. If it is this patch installs the -; script. This fixes a bug Radar#1060646 "WorldScript I and/or -; Cyrillic does not work correctly." Wherein, the Cyrillic script -; was not installing. Also, fixed the vectors for getscript and -; setscript for roman scripts to call the new routines -; "RomanGetScript" and "RomanSetScript." This is per Radar bug -; #1025998. -; 12/15/92 CSS Look for dictionary manager in ROM. -; 11/19/92 RB When looking for the standard Chicago font, look in ROM first. -; 10/2/92 PN Add initDictionary to the initialization process ; <32> 6/17/92 HA #1029756,: Removing StyledlineBreak to ; ScriptMgrExtensions.a. ; <31> 6/12/92 FM More changes to bring the rom build up to date with system 7 @@ -654,11 +644,11 @@ BootConf move.w #(sisHighCall-smGetScript)/2,d0 ; number of entries - 1 move.l a2,-(sp) ; save a2 @romanTabLoop - movea.l #0,a2 ; assume 0 entry in dispatch table <33> +; movea.l #0,a2 ; assume 0 entry in dispatch table <33> move.w (a1)+,d1 ; get offset from romanDispTable - beq.s @gotAddress ; if 0, leave entry as 0 <33> +; beq.s @gotAddress ; if 0, leave entry as 0 <33> lea 0(a4,d1.w),a2 ; make it a real vector -@gotAddress ; <33> +;@gotAddress ; <33> move.l a2,(a0)+ ; stuff it in table dbra d0,@romanTabLoop ; if more, keep going move.l (sp)+,a2 ; restore a2 @@ -669,7 +659,7 @@ BootConf subq #4,sp ; return room move.l #'FOND',-(sp) ; see if we have real Chicago move.w d4,-(sp) ; id - MOVE.W #MapTrue,RomMapInsert ; look in ROM first rb + ; ex Not in ROM _GetResource tst.l (sp)+ ; was it there? bne.s @SkipResetFond ; yes, skip @@ -704,128 +694,8 @@ BadError ; <05/30/89 pke><9> RomanDone -; ----------------------------------------------------------------------------- -; Perform auto-initialization of script systems based on info in their itlb CSS - -; Skip if Opt-E or Shift - btst #0,KeyMap+7 ; shift key down? - bne DoneAutoInit ; if yes, skip script install - btst #2,KeyMap+7 ; option key down? - beq.s @noSkipInstall ; no, skip check. - subq #2,sp ; make room for Boolean result - move.w #'e',-(sp) ; push 'e' as the char to test for - - import iTestLetter ; - bsr iTestLetter ; returns TRUE if key with Roman 'e' being pressed - - tst.b (sp)+ ; what was the result? - bne DoneAutoInit ; if Opt-e, skip script install -@noSkipInstall ; - -; no Opt-E, go ahead - with scriptRecord,itlbRecord,ItlbExtRecord - GetSMgrCore a4 ; reset a4 to point to SMgrRecord - move.w #smgrCount-1,d3 ; for all entries. - -@SimpleLoopStart - move.w d3,d0 ; copy index. - lsl.w #2,d0 ; long word offset. - move.l smgrEntry(a4,d0.w),d0 ; script installed? - bne @NextSimple ; yes -> try next entry. - - subq.l #4,sp ; make room for handle. - move.l #'itlb',-(sp) ; push bundle type. - move.w d3,-(sp) ; push bundle number. - _GetResource ; load the resource. - move.l (sp)+,d0 ; handle = nil? - beq @NextSimple ; yes -> try next entry. - -; we have a prospective itlb, so check if the simple bit is on - move.l d0,a3 ; load bundle handle. - move.l (a3),a0 ; load bundle pointer. - btst.b #smsfAutoInit,itlbFlags+1(a0) ; auto-init it? (+1 for mem test) - beq @ReleaseSimple ; no, try next one - -; we have a simple script, so allocate the record, load the font numbers - - move.l itlbLocalSize(a0),d0 ; requested size for script locals - cmp.l #scriptSize,d0 ; must be ≥ ScriptRecord size - bcc.s @doneFixLocalRecordSize ; if it already is, skip fix - move.l #scriptSize,d0 ; if too small, fix it -@doneFixLocalRecordSize - _NewPtr sys,clear ; allocate script local data - bne BadError ; if error, bail - move.l a0,a2 ; save entry pointer. - move.w d3,d0 ; get script number - asl.w #2,d0 ; *4 for long array - move.l a2,smgrEntry(a4,d0.w) ; store in SMgr globals. - -; Use SimpleTable to initialize scriptVersion, scriptCreator, scriptFile instead -; of explicitly initializing them here. - -; Copy font information from itlb, and check it. -; For 7.0, this is moved to InitScripts. - -; copy relevant entries from Roman ScriptRecord to simple ScriptRecord -; a2=simple ScriptRecord - - move.l smgrEntry+(smRoman*4)(a4),a0 ; address of roman globals - lea SimpleTable,a1 ; load table pointer. -@SimpleEntryLoop - move.w (a1)+,d0 ; get offset (and trap code). - blt.s @ReleaseSimple ; last entry is -1. - move.w 0(a0,d0.w),0(a2,d0.w) ; copy Roman word to simple scriptRecord - bra.s @SimpleEntryLoop ; do the next routine. - -@ReleaseSimple -; Don't bother releasing anymore - -@NextSimple - subq #1,d3 ; don't do Roman - bgt.s @SimpleLoopStart ; keep going until 0 or less - bra DoneAutoInit ; clean exit - endWith ; - -; ----------------------------------------------------------------------------- -; Table of ScriptRecord fields to copy from Roman when auto-initializing -; a script. -; -; Moved initialization of scriptVersion, scriptCreator, scriptFile here instead -; of explicitly initializing them above. -; -; Changed terminator to be -1, cause one of the fields we want to initialize -; with this table has an offset of 0. -; ----------------------------------------------------------------------------- - -SimpleTable - with ScriptRecord - dc.w scriptVersion ; - dc.w scriptCreator ; - dc.w scriptCreator+2 ; (long) - dc.w scriptFile ; - dc.w scriptFile+2 ; (long) - dc.w scriptDispTable - dc.w scriptDispTable+2 ; (long) - dc.w scriptDispLow - dc.w scriptDispHigh - dc.w scriptPrint - dc.w scriptPrint+2 ; (long) - dc.w scriptTrap - dc.w scriptTrap+2 ; (long) - dc.w scriptName - dc.w scriptName+2 ; (long) - dc.w $ffff ; now -1 is terminato - endwith - -DoneAutoInit - -; ----------------------------------------------------------------------------- -; Update from ScriptMgrExtTail.a CSS -; -; Initialize emScriptAppGlobals field. -; - move.l ExpandMem,a0 - move.l #-1,ExpandMemRec.emScriptAppGlobals(a0) +; ex Removed ScriptMgrExtTail.a rollin that installed non-Roman script systems +; ex Removed ScriptMgrExtTail.a rollin that initialized ExpandMem fields SMgrInitDone ;Roll in from ScripMgrExtTail.a @@ -845,27 +715,7 @@ SmgrExit endWith -;======================================================================= -; -; InitDictionaryMgr -; Called to load the 'dimg' file which contains the -; Dictionary Manager code. We load the resources stick -; them into expand mem, and call it a day. -; JH, 10-9-91 -;======================================================================== - -InitDictionaryMgr - with ExpandMemRec - clr.l -(sp) ;room for our handle - move.l #'dimg',-(sp) ;looking for a 'dimg' resource - move.w #-16385,-(sp) ;with an id of -16385 - move.w #MapTrue,RomMapInsert ;check if resource is in ROM (it should be) CSS - _GetResource ;see if we can get it - move.l ExpandMem,a0 ;ptr to expandmem rec into a0 - move.l (sp)+,emDictionaryMgrPackHandle(a0) ;move the handle into our expandmem handle - ; move.w #0,emDictionaryMgrUseCount(a0) ;0 our count - rts - endwith ;ExpandMemRec +; ex Removed ScriptMgrExtTail.a rollin that installed the Dictionary Mgr ; ----------------------------------------------------------------------------- ; Utility routine to allocate and clear global space ; (was above BufPtr in old systems) <10/10/88ldc> @@ -1125,7 +975,7 @@ utilTable export romanDispTable import BitBucket, BitBucketReg - import RomanGetScript, RomanSetScript, CharByte ; CSS + import rGetScript, rSetScript, CharByte ; CSS import Translit, FindWord, HiliteText import VisibleLength IF forRom THEN ; <21> @@ -1150,8 +1000,8 @@ utilTable romanDispTable ; <04/26/89 pke> IF (NOT forRom) THEN ; <21> - dc.w RomanGetScript - romanDispTable ; GetScript (12) CSS - dc.w RomanSetScript - romanDispTable ; SetScript (14) CSS + dc.w rGetScript - romanDispTable ; GetScript (12) CSS + dc.w rSetScript - romanDispTable ; SetScript (14) CSS dc.w CharByte - romanDispTable ; CharByte (16) dc.w BitBucket - romanDispTable ; CharType (18) <26> dc.w BitBucket - romanDispTable ; Pixel2Char (20) @@ -1173,8 +1023,8 @@ romanDispTable ; <04/26/89 pke> dc.w BitBucket - romanDispTable ; NMeasureJust (52) dc.w BitBucket - romanDispTable ; NPortionText (54) ELSE - dc.w RomanGetScript - romanDispTable ; GetScript (12) CSS - dc.w RomanSetScript - romanDispTable ; SetScript (14) CSS + dc.w rGetScript - romanDispTable ; GetScript (12) CSS + dc.w rSetScript - romanDispTable ; SetScript (14) CSS dc.w CharByte - romanDispTable ; CharByte (16) dc.w CharType - romanDispTable ; CharType (18) <26> dc.w Pixel2Char - romanDispTable ; Pixel2Char (20) diff --git a/Toolbox/ScriptMgr/ScriptMgrKbdMenu.a b/Toolbox/ScriptMgr/ScriptMgrKbdMenu.a index 38d6dd1..d9ea983 100644 --- a/Toolbox/ScriptMgr/ScriptMgrKbdMenu.a +++ b/Toolbox/ScriptMgr/ScriptMgrKbdMenu.a @@ -1,3 +1,14 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Changed 'ST/SF ResLoad' to 'MOVE.B/CLR.B ResLoad' in several places +; (messier, and hits the condition registers). Reverted the <42> code +; forcing 'About Keyboards' menu item to be in the system font. Reverted +; the <43> fix in some string copying code, and reverted an associated +; optimization in that code and another place too. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ScriptMgrKbdMenu.a ; @@ -290,7 +301,7 @@ InitKeybdMenu _UseResFile ; <14> move.b ResLoad,-(sp) ; <14> - st ResLoad ; set to true <14> + move.b #$FF,ResLoad ; set to true <14> Changed from ST ; setup defaultMark for the menu move.w #KeybdDefaultMrk,defaultMark(a6) ; initialize to empty, 0x00 @@ -299,10 +310,10 @@ InitKeybdMenu move.w #DefMarkIndex,-(sp) ; string index <34> import localGetIndString ; <34> bsr localGetIndString ; making a pString (rather than a ptr to text) <34> - sf ResLoad ; reset to F <14> + clr.b ResLoad ; reset to F <14> Changed from SF tst.b NextItemString(a6) ; do we have a string? <34> - beq.s @useDefMarker ; if empty, use default marker <32> + beq @useDefMarker ; if empty, use default marker <32> Changed from short branch ; fetch the localized character move.b NextItemString+1(a6),defaultMark+1(a6) ; write out the default marker byte (skip length) <34> @useDefMarker @@ -341,9 +352,9 @@ InitKeybdMenu bsr BuildIMTable ; Init the ItemInstalledRec table for input methods <21> bsr BuildKCHRTable ; Init the ItemInstalledRec table for KCHRs <21> ;----------------------------------------------------------------------------------- - st ResLoad ; must be T for _IUTextOrderSys <14> + move.b #$FF,ResLoad ; must be T for _IUTextOrderSys <14> Changed from ST bsr SortItems ; sort the Items <10> - sf ResLoad ; reset to F <14> + clr.b ResLoad ; reset to F <14> Changed from SF ;------------------------------------------- ; Allocate AuxKeyboardMenuInfo record for IconSuite handles for MF and other info for SystemMenu patch @@ -375,7 +386,7 @@ InitKeybdMenu ; equivalent, cmd-opt-space bar (to switch between keybds. in a script) works. <15> move.w #1,menuItem(a6) ; initialize earlier for bra <15> tst.b smgrKbdMenuAvail(a1) ; do we want to display a menu? <15> - beq.s @BuildMenuRec ; <15> + beq @BuildMenuRec ; <15> Changed from short branch ; Do we already have a menu? (are we called from RebuildKeybdMenu?) tst.b rebuildFlag(a6) ; do we already have a menu? <21> bne.s @GotMenuH ; bra if so <21> @@ -389,29 +400,22 @@ InitKeybdMenu @GotMenuH ; Add the About Keyboards… menuitem followed by a disabled line <10> - st ResLoad ; set to true <35> <14> + move.b #$FF,ResLoad ; set to true <35> <14> Changed from ST pea NextItemString(a6) ; ptr to Str255 <34> move.w #kKeyboardMenuItemsID,-(sp) ; strListID <34><38> move.w #AboutKybdsIndex,-(sp) ; string index <34> import localGetIndString ; <34> bsr localGetIndString ; <34> - sf ResLoad ; reset to false <35> + clr.b ResLoad ; reset to false <35> Changed from SF tst.b NextItemString(a6) ; do we have the string <34> - beq.s @BuildMenuRec ; no, don't add AboutKeyboards… <34> + beq @BuildMenuRec ; no, don't add AboutKeyboards… <34> Changed from short branch ; name the menu item move.l menuH(a6),-(sp) pea NextItemString(a6) ; name of this KCHR: pString move.w menuItem(a6),-(sp) ; insert ‘after’ this menuItem _InsMenuItem - move.l menuH(a6),-(sp) - move.w #1,-(sp) ; the first item has a script code. <42> - move.w #$1C,-(sp) - _SetItemCmd - move.l menuH(a6),-(sp) - move.w #1,-(SP) - move.w #smSystemScript,-(sp) ; the script code is the sytem script <42> - _SetItmIcon +; ex<42> Don't force the system script font add.w #1,menuItem(a6) add.w #AuxMenuInfoSize,a2 ; point past 1st menuItem now bsr AddDisabledLine ; separate scripts by a disabled line <8> @@ -457,7 +461,7 @@ InitKeybdMenu @ScriptItemsLoop ; if script not enabled, loop for next input. (a0 set above) tst.b scriptEnabled(a0) ; script enabled? - beq.s @NextInput ; bra to fetch next input item if not a valid script + beq @NextInput ; bra to fetch next input item if not a valid script Changed from short branch ; find out the type of input to build the iconsuite move.b itemInpuType(a4), itemType(a2) ; type of input <25> @@ -496,7 +500,7 @@ InitKeybdMenu ; Get next input! sub.w #1,d4 ; are we out of inputs/menuItems to add? IF NOT DoCmdKeyEquivalents THEN ; bra if done <8> - beq.s @SetTitle ; <3>;temporary<6> + beq @SetTitle ; <3>;temporary<6> Changed from short branch ELSE beq @SetCmdKeyEquiv ; add Next Keyboard and Next Script <3>;temporary<6> ENDIF @@ -535,7 +539,7 @@ InitKeybdMenu @SetTitle GetSmgrCore a3 ; get script manager core. <15> tst.b smgrKbdMenuAvail(a3) ; do we want to display a menu? <15> - beq.s @Cleanup ; <15> + beq @Cleanup ; <15> Changed from short branch move.l menuH(a6),a0 move.l (a0),a0 ; deref ; stuff the length (5 bytes) and special byte into the name: 01 indicates a handle is following @@ -619,7 +623,7 @@ CountMenuContents bz.s @GetNewIMs ; No handle, so assume no old input method. Go find some new ones. <26> move.l d0,a0 ; <26> tst.b scriptEnabled(a0) ; script enabled? <25> - beq.s @GetNewIMs ; no Japanese script so get only new IMs now <25> + beq @GetNewIMs ; no Japanese script so get only new IMs now <25> Changed from short branch ; get handle to table of input methods move.l intfArray(a0),a0 ; load table handle <25> move.l (a0),a0 ; load table pointer <25> @@ -857,7 +861,7 @@ BuildIMTable move.l (sp), itemInfo(a4) ; component identifier: use as input on next call move.l (sp)+, compID(a6) ; need for next FindNextComponent call cmp.l #0, itemInfo(a4) ; 0 => no more matching components - beq.s @DoOldIMs ; <25> + beq @DoOldIMs ; <25> Changed from short branch @GetIMInfo ; must create a handle for the name @@ -883,9 +887,9 @@ BuildIMTable move.l itemHandle(a4),a0 ; double deref handle move.l (a0),a0 ; pointer to name lea itemName(a4),a1 ; ptr to name space on stack - moveq #0,D0 ; clear high bytes for BlockMove - move.b (a0)+,d0 ; get the length of this string + move.b (a0),d0 ; get the length of this string ex<43> Don't increment a0, DON'T CLEAR HI BYTES (BUG) move.b d0,(a1)+ ; store the length in the string (make a pString!) + add.w #1,a0 ; ex<43> Because we didn't already increment a0 move.w d0,d1 ; save the length _BlockMove ; copy it into theString clr.b 0(a1,d1) ; set terminator byte @@ -910,7 +914,7 @@ BuildIMTable @DoOldIMs ; now get old input methods btst.b #HaveOldJapanIMbit,CJKcount(a6) ; optimized: is there an old JIM <34> - beq.s @NoMoreIMs ; no, so done <32> + beq @NoMoreIMs ; no, so done <32> Changed from short branch GetSMgrCore a1 ; get Script Mgr core <25> move.l smgrEntry+(smJapanese*4)(a1),a1 ; get handle to the Japanese system globals <25> <26><34> @@ -927,7 +931,7 @@ BuildIMTable move.l (a2)+,a0 ; input method source ; check if this input method is "ready" before installing it <38> btst.b #intfFReady-8,intfFlags(a0) ; is the IM ready? <38> - bne.s @InstallIM ; yes, install it <38> + bne @InstallIM ; yes, install it <38> Changed from short branch add #1,d5 ; no, so be sure to decrement totals <38> bra.s @GetNextIM ; fetch the next one <38> @@ -938,8 +942,9 @@ BuildIMTable lea intfName(a0),a0 ; changed from intfFile to intfName <38> lea itemName(a4),a1 ; ptr to name space on stack clr.l d0 ; clear this space! <27> - move.b (a0)+,d0 ; get the length of this string + move.b (a0),d0 ; get the length of this string ex<43> Don't increment a0 move.b d0,(a1)+ ; store the length in the string (make a pString!) + add.w #1,a0 ; ex<43> Because we didn't already increment a0 move.w d0,d1 ; save the length _BlockMove ; copy it into theString clr.b 0(a1,d1) ; set terminator byte @@ -996,7 +1001,7 @@ iconSuiteRegs reg a0/a3/d6 _NewIconSuite move.w (sp)+,d0 move.w d0,result(a6) ; save (shouldn't affect CCs) - bne.s @Done ; error exit really <23> + bne @Done ; error exit really <23> Changed from short branch ; get a handle to each script’s small icon resource (‘kcs#’,‘kcs4’,‘kcs8’) and stuff in the icon suite lea kcsTable,a3 @@ -1124,7 +1129,7 @@ IMiconSuiteRegs reg d2-d6/a0 beq.s @noResource ; no ; if we are loading from component's resfile, better set resload to true ... - st ResLoad ; set to true + move.b #1,ResLoad ; set to true Changed from ST bra.s @doIt ; yes, use common code ; if we can't load the resource, then close the resfile and use the generic small @@ -1294,7 +1299,7 @@ AddMenuRegs reg d3/d4/a0/a2-a4 ; save a0, too <23> move.l #UsingOldStyleIM,-(sp) ; TRUE <34> _SetScript tst.w (sp)+ ; ignore OSErr <34> - bra.s @SaveItemNum ; and save the item num + bra @SaveItemNum ; and save the item num Changed from short branch ;------------------------------------------------------------------------------------------ @oldDefIM ; default is old-style IM @@ -1303,7 +1308,7 @@ AddMenuRegs reg d3/d4/a0/a2-a4 ; save a0, too <23> move.w compID+sidFEPID(a6),d0 ; saved in low word of long cmp.w itemRsrcID(a2),d0 ; is this item the default component for this script? - bne.s @done ; no + bne @done ; no Changed from short branch ; this is the default old-style IM so use it Import GetKanjiUserIDIntf ; call local version of UserIDIntf @@ -1313,7 +1318,7 @@ AddMenuRegs reg d3/d4/a0/a2-a4 ; save a0, too <23> move.l smgrEntry+(smJapanese*4)(a1),a1 ; load doubleTalkRecord for Japanese. ; if an error occured, didn't active old-style IM so don't make secret SetScript call. tst.w ScriptSystemGlobals.FISError(a1) ; bad index? - bne.s @done ; yes -> bail. + bne @done ; yes -> bail. Changed from short branch ; we have a problem here. If the old default IM is not in the system ...... ;; what to do if we failed ???? how could it get registered as the default if @@ -1330,17 +1335,17 @@ AddMenuRegs reg d3/d4/a0/a2-a4 ; save a0, too <23> move.l #UsingOldStyleIM,-(sp) ; TRUE _SetScript tst.w (sp)+ ; result OSErr - bne.s @done - bra.s @SaveItemNum ; + bne @done ; Changed from short branch + bra @SaveItemNum ; Changed from short branch ;------------------------------------------------------------------------------------------ @newDefIM ; default is TSM-style IM cmp.b #TSMIMitem, itemType(a2) ; is this new? - bne.s @done ; no, + bne @done ; no, Changed from short branch move.l auxItemInfo(a2),d0 ; compare to the default cmp.l compID(a6),d0 ; is this item the default component for this script? - bne.s @done ; no - bra.s @SaveItemNum ; + bne @done ; no Changed from short branch + bra @SaveItemNum ; Changed from short branch ; < End new #29 > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1351,7 +1356,7 @@ AddMenuRegs reg d3/d4/a0/a2-a4 ; save a0, too <23> @KCHRinput move.w itemRsrcID(a2),d1 ; get the first KCHR ID cmp.w scriptBundle.itlbKeys(a3),d1 - bne.s @done + bne @done ; Changed from short branch ;------------------------------------------------------------------------------------------ <21> @SaveItemNum @@ -1369,7 +1374,7 @@ AddMenuRegs reg d3/d4/a0/a2-a4 ; save a0, too <23> ; Add ‘√’mark to the system KCHR cmp.w itemScript(a4),d4 ; is this the system KCHR? - bne.s @done + bne @done ; Changed from short branch ; system KCHR gets ‘√’ mark and its icon gets put into menu name move.l menuH(a6),-(sp) move.w d3,-(sp) diff --git a/Toolbox/ScriptMgr/ScriptMgrMisc.a b/Toolbox/ScriptMgr/ScriptMgrMisc.a index 44aeaef..bbd7b6c 100644 --- a/Toolbox/ScriptMgr/ScriptMgrMisc.a +++ b/Toolbox/ScriptMgr/ScriptMgrMisc.a @@ -1,3 +1,11 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted : disassembled SMgrCalcRect. Reverted : changed back +; to short branches. +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ScriptMgrMisc.a (formerly SMgrMisc.a) ; @@ -205,7 +213,7 @@ xSwapKybd ; <06/30/89 pke> bne.s @loadItlk ; no - go load itlk. Otherwise… _UseResFile ; restore old resfile (refnum on stack) <5><6> - bra DoneKybd ; bail, keep old KCHR & itlk. CSS + bra.s DoneKybd ; bail, keep old KCHR & itlk. ex CSS @loadItlk ; if we already have an itlk, dispose of it <6> @@ -463,11 +471,51 @@ DoneEvent ; warning: This routine is a trap patch for InitMenus. ; This routine saves all registers. ; -; This routine is obsolete. +; This routine calculates the bounds of the menubar icon. ex ; ---------------------------------------------------------------------------- +mbarIconPix equ 16 + SMgrCalcRect Proc Export + with SMgrRecord + + movem.l a2,-(sp) + GetSMgrCore a2 + + move.w MBarHeight,d0 ; vertical placement + lsr.w #1,d0 + subq #mbarIconPix/2,d0 + move.w d0,smgrRect+top(a2) + add.w #mbarIconPix,d0 + move.w d0,smgrRect+bottom(a2) + + subq #4,sp + move.l sp,-(sp) + _GetWMgrPort + move.l (sp)+,a0 + + tst.b smgrIconSideFlag(a2) ; horizontal placement + bnz.s @iconLeft + +@iconRight ; ...on one side... + move.w portRect+right(a0),d0 + sub.w smgrIconOffset(a2),d0 + move.w d0,smgrRect+right(a2) + sub.w #mbarIconPix,d0 + move.w d0,smgrRect+left(a2) + bra.s @return +@iconLeft ; ...or the other. + move.w portRect+left(a0),d0 + add.w smgrIconOffset(a2),d0 + move.w d0,smgrRect+left(a2) + add.w #mbarIconPix,d0 + move.w d0,smgrRect+right(a2) + +@return + movem.l (sp)+,a2 rts + + endwith endproc ; ---------------------------------------------------------------------------- diff --git a/Toolbox/ScriptMgr/ScriptMgrUtilDate.a b/Toolbox/ScriptMgr/ScriptMgrUtilDate.a index 988c1f5..a0f98e2 100644 --- a/Toolbox/ScriptMgr/ScriptMgrUtilDate.a +++ b/Toolbox/ScriptMgr/ScriptMgrUtilDate.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted : "LongDivFunc" recreated for 68000s +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: ScriptMgrUtilDate.a (formerly SMgrUtilDate.a) ; @@ -237,8 +244,12 @@ genCdevRangeHi equ $DA319179 ; =3660681599, secs for 2019-Dec-31 23:59:59 macro LongDiv - machine mc68020 + IF &SETTING('MACHINE') = 'MC68000' THEN + bsr LongDivFunc + ELSE divs.l d2,d0:d1 ; do it + ENDIF + endm @@ -1213,6 +1224,74 @@ RD2SRegs reg a2/d3-d7 +;============================================================================ +; Arguments: d0:d1 = dividend (u64), d2 = divisor (u32) +; Returns: d0 = remainder (u32), d1 = quotient (u32) +;============================================================================ + +LongDivFunc proc export + + cmp.b #cpu68020, CPUFlag + blt.s @useSANE + +@useDIVS + machine MC68020 + divs.l d2,d0:d1 + rts + machine MC68000 + +@useSANE + +DivRec record {oldA6},decr +return ds.l 1 +oldA6 ds.l 1 +divisor ds.l 1 +dividend ds.d 1 +argBuffer +float80 ds.x 1 +remultiply ds.d 1 +quotient ds.l 1 +localFrame equ * + endr + + with DivRec + + link a6,#localFrame + + lea argBuffer(a6),a0 + move.l d0,(a0)+ ; save dividend + move.l d1,(a0)+ ; ... + move.l d2,(a0) ; and divisor + + pea dividend(a6) ; convert to 80-float + pea float80(a6) + FC2X + + pea divisor(a6) ; divide via SANE + pea float80(a6) + FDIVL + + pea float80(a6) ; quotient as long + pea quotient(a6) + FX2L + + move.l quotient(a6),-(sp) ; get quotient * divisor + move.l divisor(a6),-(sp) + pea remultiply(a6) + _LongMul + + move.l quotient(a6),d1 ; result: quotient + + move.l dividend+4(a6),d0 ; result: remainder + sub.l remultiply+4(a6),d0 + + unlk a6 + rts + + endWith + endProc + + ;============================================================================ ;pascal void LongSecs2Date (longSecs, longDate, selector) ; LongDate* longSecs; @@ -1253,6 +1332,7 @@ RS2DRegs reg a2/d3-d7 with LS2DRec,LongDateRec import MonthStarts,LeapStarts,secsInDayX + import LongDivFunc CheckSelector link a6,#localFrame diff --git a/Toolbox/SoundMgr/SoundMgr.make b/Toolbox/SoundMgr/SoundMgr.make new file mode 100644 index 0000000..4f38915 --- /dev/null +++ b/Toolbox/SoundMgr/SoundMgr.make @@ -0,0 +1,25 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Written from scratch +# + +SoundMgrObjs = "{ObjDir}SoundMgrPatch.a.o" ∂ + "{ObjDir}SysBeepPatch.a.o" ∂ + "{ObjDir}Tables.3.a.o" ∂ + + +"{LibDir}SoundMgr.lib" ƒ {SoundMgrObjs} + Lib {StdLibOpts} -o "{Targ}" {SoundMgrObjs} -rn _R258C_OTHERNAME=_R258C + + +"{ObjDir}SoundMgrPatch.a.o" ƒ "{SoundMgrDir}SoundMgrPatch.a" + Asm {StdAOpts} -o "{Targ}" "{SoundMgrDir}SoundMgrPatch.a" + + +"{ObjDir}SysBeepPatch.a.o" ƒ "{Sources}Patches:SysBeepPatch.a" + Asm {StdAOpts} -o "{Targ}" "{Sources}Patches:SysBeepPatch.a" + + +"{ObjDir}Tables.3.a.o" ƒ "{SoundMgrDir}Tables.3.a" + Asm {StdAOpts} -o "{Targ}" "{SoundMgrDir}Tables.3.a" diff --git a/Toolbox/SoundMgr/SoundMgrPatch.a b/Toolbox/SoundMgr/SoundMgrPatch.a new file mode 100644 index 0000000..d8a5bd8 --- /dev/null +++ b/Toolbox/SoundMgr/SoundMgrPatch.a @@ -0,0 +1,5598 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Disassembled from scratch +; + +; for linked patches + + CASE OBJ + + LOAD 'StandardEqu.d' + INCLUDE 'Devices.a' + INCLUDE 'EgretEqu.a' + INCLUDE 'GestaltEqu.a' + INCLUDE 'HardwarePrivateEqu.a' + INCLUDE 'InternalOnlyEqu.a' + INCLUDE 'IOPrimitiveEqu.a' + INCLUDE 'LinkedPatchMacros.a' + INCLUDE 'SysEqu.a' + INCLUDE 'SysPrivateEqu.a' + INCLUDE 'UniversalEqu.a' + INCLUDE 'TrapsPrivate.a' + + + MACHINE MC68030 + + + MakePatch SYSBEEP,_SysBeep,(Plus,SE,II,Portable,IIci,notAUX) + + +OldPBSoundOpen ROMBind (IIci,$E5A0A) +OldPBSoundPrime ROMBind (IIci,$E5A12) +OldPBSoundControl ROMBind (IIci,$E5A1C) +OldPBSoundStatus ROMBind (IIci,$E5B5A) +OldPBSoundClose ROMBind (IIci,$E5A26) + + +batmanSnd equ $b0 +elsieSound equ $e0 + + +;16:043fe +SetSosumi InstallProc (IIci) + cmp.b #boxMacIIsi,BoxFlag + bne.s @return + + subq #2,sp + move.l sp,a0 + move.l #$0002007C,d0 + _ReadXPram + tst.w (sp) + bne.s @cleanup + move.w #9,(sp) ; sosumi + move.l sp,a0 + move.l #$0002007C,d0 + _WriteXPram +@cleanup + addq #2,sp +@return + rts + + +;03:00f0e +InitSoundMgrA InstallProc (Plus,SE) + IMPORT Snd_Func1, InitSndDispatch, InitMACEDispatch, InitSoundMgrCommon + jsr Snd_Func1 + jsr InitSndDispatch + jsr InitMACEDispatch + jmp InitSoundMgrCommon + + +;28:000f2 +InitSoundMgrB InstallProc (II,Portable,IIci,notAUX,notEricksonSoundMgr) + IMPORT Snd_Func1, InitSndDispatch, InitMACEDispatch, InstallSoundIntHandler, InitSoundMgrCommon + jsr Snd_Func1 + jsr InitSndDispatch + jsr InitMACEDispatch + jsr InstallSoundIntHandler + jmp InitSoundMgrCommon + + +;16:04428 +InitSoundMgrC InstallProc (IIci,notAUX,hasEricksonSoundMgr) + IMPORT Snd_Func1, InstallSoundIntHandler, InitSoundMgrCommon + move.l SMGlobals,a1 + move.l 6(a1),a0 + _DisposeHandle + move.l 10(a1),a0 + _DisposePtr + move.l 26(a1),a0 + _RecoverHandle + _DisposeHandle + move.l 42(a1),a2 + move.l a1,a0 + _DisposePtr + + jsr Snd_Func1 + move.l SMGlobals,a1 + move.l a2,42(a1) + + jsr InstallSoundIntHandler + jmp InitSoundMgrCommon + + +;31:29048 +InitSoundMgrCommon Proc Export + IMPORT InstallNewGlobals, LoadSoundInputDriver + clr.w -(sp) + move.w #8,-(sp) + peaResident SndManagerDispatch + move.l #$00040000,d0 + _SoundDispatch + move.w (sp)+,d0 + + clr.w -(sp) + move.w #20,-(sp) + peaResident SoundInDispatch + move.l #$00040000,d0 + _SoundDispatch + move.w (sp)+,d0 + + move.l #32,d0 + _NewPtr ,sys,clear + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l a0,38(a1) + + leaResident soundAttrGestalt,a0 + move.l #gestaltSoundAttr,d0 + _NewGestalt + beq.s @noreplace + + leaResident soundAttrGestalt,a0 + move.l #gestaltSoundAttr,d0 + _ReplaceGestalt +@noreplace + + jsr InstallNewGlobals + jsr LoadSoundInputDriver + rts + + +;31:290a4 +LoadSoundInputDriver Proc Export +fBase equ -322 +fCntlBlock equ -322 +fSndBlock equ -270 +fRefNum equ -14 +fDriverHdl equ -12 +fUTblEntry equ -8 +fUTblEntry2 equ -4 + + link a6,#-322 + + move.l #gestaltSoundAttr,d0 + _Gestalt + move.l a0,d0 + btst #gestaltBuiltInSoundInput,d0 + beq @return + + subq #4,sp + move.l #'DRVR',-(sp) + pea @AppleSoundInput + _GetNamedResource + move.l (sp)+,d0 + beq @return + + move.l d0,fDriverHdl(a6) + move.l d0,-(sp) + _DetachResource + move.l fDriverHdl(a6),a0 + _HLock + + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l 38(a1),a1 + move.w #1,$1E(a1) + + cmp.b #boxQuadra900,BoxFlag + beq.s @q9x + cmp.b #boxQuadra950,BoxFlag + bne.s @notq9x +@q9x move.w #3,$1E(a1) +@notq9x + + move.l UTableBase,a0 + adda.l #48*4,a0 + move.l #~48,d0 + +@lup tst.l (a0)+ + dbeq d0,@lup + sub.l #4,a0 + move.l a0,fUTblEntry(a6) + move.w d0,fRefNum(a6) + + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l 38(a1),a1 + move.w d0,(a1) + move.l fUTblEntry(a6),fUTblEntry2(a6) + + move.l fDriverHdl(a6),a0 + move.l (a0),a0 + dc.w $A43D ; _DrvrInstall,LOCK - make a DCE + + move.l fUTblEntry(a6),a0 ; lock the DCE + move.l (a0),a0 + _HLock + + move.l fUTblEntry(a6),a1 ; a0=DRVR ptr, a1=DCE ptr + move.l (a1),a1 + move.l (a1),a1 + move.l -12(a6),a0 + move.l (a0),a0 + + move.l a0,dCtlDriver(a1) + move.w drvrFlags(a0),dCtlFlags(a1) + move.w drvrDelay(a0),dCtlDelay(a1) + move.w drvrEMask(a0),dCtlEMask(a1) + move.w drvrMenu(a0),dCtlMenu(a1) + bset #DOpened,dCtlFlags+1(a1) + + add drvrOpen(a0),a0 + jsr (a0) + + lea fCntlBlock(a6),a0 + move.w fRefNum(a6),CntrlParam.ioCRefNum(a0) + move.w #2,CntrlParam.csCode(a0) + move.l #'name',CntrlParam.csParam(a0) + lea fSndBlock(a6),a2 + move.l a2,CntrlParam.csParam+4(a0) + _Status ,immed + bne.s @return + + subq #2,sp + move.w fRefNum(a6),-(sp) + pea fSndBlock(a6) + _SPBSignInDevice + move.w (sp)+,d0 + +@return unlk a6 + rts + +@AppleSoundInput + string pascal + dc.b '.AppleSoundInput' + align 2 + +;16:0445c +_R2490 InstallProc (IIci,notAUX) + move.l #gestaltMachineType,d0 + _Gestalt + move.l a0,d2 + sub.b #gestaltMacIIci,d2 + and.w #$FF,d2 + + movea.l UnivInfoPtr,a1 ; a1 = ptr to productinfo record + move.l $30(a1),d0 ; get offset to sound vector tbl + beq.s @noRomTable + bsr copyPrimitiveTbl + bsr overridePrimitiveTbl + bra.s @tableDone + +@noRomTable + move.l #gestaltSoundAttr,d0 + _Gestalt + move.l a0,d0 + btst #gestaltBuiltInSoundInput,d0 + beq.s @partialTableDone + +; we have sound input hardware, meaning DFAC... so force insertion of crappy table + leaResident TableOfTables,a1 + add.l (a1,d2*4),a1 + moveq #0,d0 + bsr copyPrimitiveTbl + jsrTBL sndDFACInit + +@tableDone + moveq.l #1,d0 ; default all cpu's with AGC on + jsrTBL sndAGCcontrol + +@partialTableDone + bsr.s installVBL + bsr.s overrideSinDRVR + rts + + +installVBL + Import ReGenSoundInt + + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + cmp.b #$B0,46(a1) + bne.s @return + + TestFor VIA2Exists + beq.s @return + + TestFor JawsExists + bne.s @return + + move.l ROMBase,a0 + cmp.w #$67C,8(a0) + bne.s @return + cmp.w #$15F1,18(a0) + bne.s @return + + moveq #14,d0 + _NewPtr ,sys,clear + leaResident ReGenSoundInt,a1 + move.l a1,vblAddr(a0) + move.w #vType,vblType(a0) + move.w #30,vblCount(a0) + clr.w vblPhase(a0) + _VInstall + +@return rts + + +overrideSinDRVR + Import NewPBSoundDrvr + + move.l #gestaltMachineType,d0 + _Gestalt + move.l a0,d0 + cmp.b #gestaltPowerBook140,d0 + beq.s @pb14x + cmp.b #gestaltPowerBook145,d0 + bne.s @return +@pb14x + + leaResident NewPBSoundDrvr,a0 + move.l SoundDCE,a1 + move.l a0,dCtlDriver(a1) + +@return rts + + +; Convert ROM sound primitive offset table into a RAM pointer table. + +copyPrimitiveTbl + With SoundIOHeader + SndTblLength: equ -2 + + adda.l d0,a1 ; a1 = ptr to ROM tbl + moveq.l #0,d0 ; clear d0 + move.w SndTblLength(a1),d0 ; d0 = number of entries in table + asl.l #2,d0 ; convert long entries to byte count + addq.l #SoundIOHeaderSize,d0 ; size of global header records + _NewPtr ,sys,clear ; alloc storage + + adda.l #SoundIOHeaderSize,a0 ; inc past global header + move.l a0,([Expandmem],\ + ExpandMemRec.emSndPrimitives) ; set the expandmem pointer + + move.b #sndAGCOff,UserAGC(a0) ; init AGC off as default + +; Convert the offset values in the original table to long addresses in the RAM-based +; table. a0 = ptr to new RAM-based tbl, a1 = ptr to old ROM table + + move.w SndTblLength(a1),d0 ; get number of entries in table + subq.w #1,d0 ; adjust for dbra + move.l a1,d1 ; d1 = address of ROM/RAM table +@Loop + move.l (a1)+,(a0) ; get routine offset + add.l d1,(a0)+ ; add ROM/RAM table address to convert to 32 bit address + dbra d0,@Loop + + rts + + EndWith + + +overridePrimitiveTbl + leaResident TableOfTables,a1 ; a1 = ptr to table of tables + cmp.w -2(a1),d2 ; d2 = 'mach' minus 11 (IIci) + bhs.s @Return ; punt if no table for machine + move.l (a1,d2*4),d0 + beq.s @Return ; again, punt if no table + add.l d0,a1 ; a1 = ptr to this table + + move.l ([Expandmem],\ + ExpandMemRec.emSndPrimitives),a0 ; get the expandmem pointer + +; Convert the offset values in the original table to long addresses in the RAM-based +; table. a0 = ptr to new RAM-based tbl, a1 = ptr to old LINKED PATCH table + + move.w SndTblLength(a1),d0 ; get number of entries in table + subq.w #1,d0 ; adjust for dbra + move.l a1,d1 ; d1 = address of ROM/RAM table +@Loop + move.l (a1)+,d2 ; get routine offset + beq.s @0 ; do we offer one? + add.l d1,d2 ; add ROM/RAM table address to convert to 32 bit address + move.l d2,(a0) +@0 add.w #4,a0 ; postincrement (even if zero) + dbra d0,@Loop + +@Return + rts + + +;_________________________________________________________________________________________ +; Sound primitives vector table + + +;16:045ac + Proc + + Export TableOfTables + dc.w (TableOfTablesEnd-TableOfTables)/4 +TableOfTables + dc.l 0 ; 11 + dc.l 0 ; 12 + dc.l 0 ; 13 + dc.l 0 ; 14 + dc.l 0 ; 15 + dc.l 0 ; 16 + dc.l 0 ; 17 + dc.l SndCntlMacIIsi-TableOfTables ; 18 + dc.l SndCntlLC-TableOfTables ; 19 + dc.l SndCntlQuadra900-TableOfTables ; 20 + dc.l SndCntlPB170-TableOfTables ; 21 + dc.l SndCntlQuadra700-TableOfTables ; 22 + dc.l SndCntlClassicII-TableOfTables ; 23 + dc.l 0 ; 24 + dc.l SndCntlPB140-TableOfTables ; 25 + dc.l SndCntlQuadra950-TableOfTables ; 26 + dc.l SndCntlLCIII-TableOfTables ; 27 + dc.l SndCntlUnk28-TableOfTables ; 28 + dc.l 0 ; 29 + dc.l 0 ; 30 + dc.l 0 ; 31 + dc.l 0 ; 32 + dc.l 0 ; 33 + dc.l 0 ; 34 + dc.l 0 ; 35 + dc.l 0 ; 36 + dc.l SndCntlLCII-TableOfTables ; 37 + dc.l 0 ; 38 + dc.l 0 ; 39 + dc.l 0 ; 40 + dc.l 0 ; 41 + dc.l 0 ; 42 + dc.l 0 ; 43 + dc.l 0 ; 44 + dc.l 0 ; 45 + dc.l 0 ; 46 + dc.l 0 ; 47 + dc.l 0 ; 48 + dc.l 0 ; 49 + dc.l 0 ; 50 + dc.l 0 ; 51 + dc.l 0 ; 52 + dc.l 0 ; 53 + dc.l SndCntlPB145-TableOfTables ; 54 +TableOfTablesEnd + + + dc.w (SndCntlMacIIsiEnd-SndCntlMacIIsi)/4 +SndCntlMacIIsi + dc.l EricksonDFACInit-SndCntlMacIIsi + dc.l EgretDFACSend-SndCntlMacIIsi + dc.l ASCSetVol-SndCntlMacIIsi + dc.l EnableSoundInts-SndCntlMacIIsi + dc.l DisableSoundInts-SndCntlMacIIsi + dc.l ClearSoundInt-SndCntlMacIIsi + dc.l InputSelect-SndCntlMacIIsi + dc.l QueryInput-SndCntlMacIIsi + dc.l ByPassControl-SndCntlMacIIsi + dc.l PlayThruVol-SndCntlMacIIsi + dc.l AGCControl-SndCntlMacIIsi +SndCntlMacIIsiEnd + + + dc.w (SndCntlLCEnd-SndCntlLC)/4 +SndCntlLC +SndCntlLCII + dc.l ElsieDFACInit-SndCntlLC + dc.l EgretDFACSend-SndCntlLC + dc.l ASCSetVol-SndCntlLC + dc.l EnableSoundInts-SndCntlLC + dc.l DisableSoundInts-SndCntlLC + dc.l ClearSoundInt-SndCntlLC + dc.l ElsieInputSelect-SndCntlLC + dc.l QueryInput-SndCntlLC + dc.l ByPassControl-SndCntlLC + dc.l PlayThruVol-SndCntlLC + dc.l AGCControl-SndCntlLC +SndCntlLCEnd + + + dc.w (SndCntlClassicIIEnd-SndCntlClassicII)/4 +SndCntlClassicII + dc.l ElsieDFACInit-SndCntlClassicII + dc.l EgretDFACSend-SndCntlClassicII + dc.l ASCSetVol-SndCntlClassicII + dc.l EnableSoundInts-SndCntlClassicII + dc.l DisableSoundInts-SndCntlClassicII + dc.l ClearSoundInt-SndCntlClassicII + dc.l ElsieInputSelect-SndCntlClassicII + dc.l QueryInput-SndCntlClassicII + dc.l ByPassControl-SndCntlClassicII + dc.l PlayThruVol-SndCntlClassicII + dc.l AGCControl-SndCntlClassicII +SndCntlClassicIIEnd + + + dc.w (SndCntlQuadra700End-SndCntlQuadra700)/4 +SndCntlQuadra700 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l InputSelect-SndCntlQuadra700 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 +SndCntlQuadra700End + + + dc.w (SndCntlQuadra900End-SndCntlQuadra900)/4 +SndCntlQuadra900 +SndCntlQuadra950 + dc.l 0 + dc.l EgretDFACSend-SndCntlQuadra900 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l EclipseInputSelect-SndCntlQuadra900 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 +SndCntlQuadra900End + + + dc.w (SndCntlPB170End-SndCntlPB170)/4 +SndCntlPB170 +SndCntlPB140 +SndCntlPB145 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l TIMInputSelect-SndCntlPB170 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 +SndCntlPB170End + + + dc.w (SndCntlLCIIIEnd-SndCntlLCIII)/4 +SndCntlLCIII + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 +SndCntlLCIIIEnd + + + dc.w (SndCntlUnk28End-SndCntlUnk28)/4 +SndCntlUnk28 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 + dc.l 0 +SndCntlUnk28End + + +EricksonDFACInit + moveq #sndEricksonDFAC,d0 + bra.s EgretDFACInit +ElsieDFACInit + moveq #sndElsieDFAC-256,d0 +EgretDFACInit + jsrTBL sndDFACSend + rts + + +;—————————————————————————————————————————————————————————————————————————————— +; EgretDFACSend - send a byte to DFAC using Egret +; +; Use this routine during runtime after traps are enabled. +; +; Input: d0.b = byte to send DFAC (in DFAC order) +; Output: none +; + +EgretDFACSend +@saveregs reg d1-d3/a0-a1 + + WITH EgretPB, SoundIOHeader, ExpandMemRec + + movem.l @saveregs,-(sp) ; work register + +; Reverse the order of the bits because Egret shifts them out in reverse order +; to what DFAC is expecting MSB first. + + move.l d0,d3 ; save DFAC value in DFAC order + moveq #0,d1 ; destination + moveq #8-1,d2 ; loop count for 8 bits +@Loop + asr.b #1,d0 ; shift lsb into extend bit + roxl.b #1,d1 ; shift extend bit towards msb + dbra d2,@Loop + + move.w sr,-(sp) + ori.w #$700,sr + +; Build a Parameter block for the default DFAC message + + suba.w #EgretPbSize,sp ; make room for PB + movea.l sp,a0 ; point a0 to pbBuffer + move.b #pseudoPkt,pbCmdType(a0) + move.b #WrDFAC,pbCmd(a0) + move.w #1,pbByteCnt(a0) ; set byte count + clr.l pbBufPtr(a0) ; clear unused fields + clr.w pbFlags(a0) + clr.w pbResult(a0) + clr.l pbCompletion(a0) + move.b d1,pbParam(a0) ; set byte to send DFAC + + _EgretDispatch + adda.w #EgretPbSize,sp ; discard the parameter block and data buffer + bne.s @Done ; some error - do not update image of DFAC + +; Update the RAM image of the DFAC register + + movea.l ([Expandmem],emSndPrimitives),a0; a0 = ptr to vector table + move.b d3,DFAClast(a0) ; update DFAC register image + +@Done + move.w (sp)+,sr + movem.l (sp)+,@saveregs + rts ; Return to Caller + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— +; ElsieInputSelect - Select the sound input source on Elsie +; +; If we are turning off the source (equivalent to disabling recording), then +; re-establish the playback mode by selecting the Aux source with AGC on and +; playthrough volume set to the maximum. +; +; Input: do.b input selection +; 0 = none (off) +; 1 = microphone +; 2 = auxillary (modem sound on Tim, CD on Spike and Eclipse) +; Output: none +; + +ElsieInputSelect + + WITH ExpandMemRec, SoundIOHeader + + cmpi.b #sndMicrophone,d0 ; are we selecting the mike? + beq.s InputSelect ; yes - continue + +; In Elsie sound, the playthrough with the auxiliary source is how playback is +; done. If not selecting mike, then enable playback + +@saveregs reg d1/a0 + movem.l @saveregs,-(sp) + movea.l ([Expandmem],emSndPrimitives),a0; a0 = ptr to vector table + move.w sr,-(sp) + ori.w #$700,sr + moveq #(sndByPassMask\ ; + AND sndPlayThruMask\ + AND sndAGCMask),d1 ; mask off bypass, volume, and AGC bits + and.b DFAClast(a0),d1 ; get DFAC register image + moveq #sndElsieDFAC-256,d0 ; DFAC playback mode for Elsie sound + jsrTBL sndDFACSend ; call DFACSend routine thru expandmem + move.w (sp)+,sr + movem.l (sp)+,@saveregs + rts + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— +; InputSelect - Select the sound input source +; +; If we are selecting "none" for the input source, then turn off the volume +; and AGC to prevent any noise leakage. Save the old volume and restore it +; later when a new source is selected. +; +; AGCInputSelect +; On Tim and Spike, sound input does not work unless AGC is enabled. We +; kludge something to always set AGC. +; +; Input: do.b input selection +; 0 = none (off) +; 1 = microphone +; 2 = auxillary (modem sound on Tim, CD on Spike and Eclipse) +; Output: d0.b last source +; + +InputSelect +@saveregs reg d1-d2/a0-a1 ; added d2 to save registers + + WITH SoundIOHeader + + movem.l @saveregs,-(sp) + move.l ([Expandmem],\ + ExpandMemRec.emSndPrimitives),a0; a0 = ptr to vector table + move.w sr,-(sp) ; + ori.w #HiIntMask,sr ; disable ints + + moveq.l #3,d2 ; get selection bits to return + and.b DFAClast(a0),d2 ; save for return + + moveq #(sndSelectMask\ ; + AND sndPlayThruMask\ + AND sndAGCMask),d1 ; mask off selection, volume, and AGC bits + and.b DFAClast(a0),d1 ; in the DFAC register image + or.b d0,d1 ; and OR them into DFAC image + +; Check for volume and AGC to update in DFAC now that a sound source has been selected. +; If we are disabling input, then zero the volume and disable AGC to prevent noise +; leakage, otherwise set the currently selected volume and AGC levels. + + tst.b d0 ; are we turning off input? + beq.s @send ; yes - set no input and zero volume + or.b UserVolume(a0),d1 ; set volume level + cmpi.b #sndMicrophone,d0 ; are we selecting the mike input? + bne.s @send ; no - do not enable AGC + or.b UserAGC(a0),d1 ; set AGC level + +@send + move.b d1,d0 ; d0 = new DFAC value + jsrTBL sndDFACSend ; call DFACSend routine thru expandmem + + move.w (sp)+,sr ; enable ints + move.b d2,d0 ; return source bits we replaced + movem.l (sp)+,@saveregs + rts + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— + dc.b 0,1,2,0,0,0 + + +;—————————————————————————————————————————————————————————————————————————————— +; PlayThruVol - Set the playthrough volume +; +; If a sound source has not been selected, then save the volume in the globals +; to be updated to DFAC later when the source is selected. Also set playback +; volume for consistancy. +; +; Input: d0.b = volume level (0-7) +; Output: none +; + +PlayThruVol +@saveregs reg d1/a0 + + WITH SoundIOHeader + + movem.l @saveregs,-(sp) + movea.l ([Expandmem],\ + ExpandMemRec.emSndPrimitives),a0; a0 = ptr to vector table + move.w sr,-(sp) ; + ori.w #HiIntMask,sr ; disable ints + + asl.b #5,d0 ; shift volume into s5-s7 position + move.b d0,UserVolume(a0) ; save user set volume level + moveq #(sndSelectMask-256),d1 ; mask off selection bits + and.b DFAClast(a0),d1 ; in the DFAC register image + beq.s @Done ; no sound source - we are done + + moveq #sndPlayThruMask,d1 ; mask off volume bits + and.b DFAClast(a0),d1 ; in the DFAC register image + or.b d1,d0 ; or-in value to send DFAC to set volume + jsrTBL sndDFACSend ; call DFACSend routine thru expandmem +@Done + move.w (sp)+,sr ; enable ints + movem.l (sp)+,@saveregs + rts + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— +; AGCControl - enable or disable AGC +; +; Enable or disable AGC. If no sound source has been selected, then +; save the AGC value and set it whenever the sound source is selected. +; +; Input: d0.b = 0 is disable, nonzero is enable +; Output: none +; + +AGCControl +@saveregs reg d1/a0 + + WITH SoundIOHeader + + movem.l @saveregs,-(sp) + movea.l ([Expandmem],\ + ExpandMemRec.emSndPrimitives),a0; a0 = ptr to vector table + moveq.l #sndAGCOff,d1 ; assume AGC off (min gain) + tst.b d0 ; enable or disable AGC + beq.s @continue ; was disable AGC + moveq.l #sndAGCOn,d1 ; enable AGC +@continue + move.w sr,-(sp) ; + ori.w #HiIntMask,sr ; disable ints + move.b d1,UserAGC(a0) ; save value + + moveq #(sndSelectMask-256),d0 ; mask off selection bits + and.b DFAClast(a0),d0 ; in the DFAC register image + beq.s @Done ; no sound source - we are done + + moveq #sndAGCMask-256,d0 ; mask off the AGC control bits + and.b DFAClast(a0),d0 ; in the DFAC register image + or.b d1,d0 ; or-in AGC value to send to DFAC + jsrTBL sndDFACSend ; call DFACSend routine thru expandmem +@Done + move.w (sp)+,sr ; enable ints + movem.l (sp)+,@saveregs + rts + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— +; ASCSetVol - Set the playback volume on normal ASC/Batman hardware +; +; Set the playback volume using the volume control register on Batman. +; +; Input: d0.b = volume level (0-7) +; Output: none +; + +ASCSetVol move.l a0,-(sp) + movea.l ASCBase,a0 ; get base address of asc/batman + lsl.b #5,d0 ; shift volume up to pwm position + move.b d0,ascVolControl(a0) ; save it in ASC volume register + movea.l (sp)+,a0 + rts + + +;—————————————————————————————————————————————————————————————————————————————— +; ByPassControl - enable or disable aux bypass +; +; Input: d0.b = 0 is disable, nonzero is enable +; Output: none +; + +ByPassControl +@saveregs reg d1/a0 + + WITH SoundIOHeader, ExpandMemRec + + movem.l @saveregs,-(sp) + movea.l ([Expandmem],emSndPrimitives),a0; a0 = ptr to vector table + moveq.l #sndByPassOff,d1 ; assume bypass off + tst.b d0 ; enable or disable bypass + beq.s @continue ; was bypass off + moveq.l #sndByPassOn,d1 ; set bypass on +@continue move.w sr,-(sp) ; + ori.w #HiIntMask,sr ; disable ints + moveq #sndByPassMask-256,d0 ; mask off bypass control bit + and.b DFAClast(a0),d0 ; in the DFAC register image + or.b d1,d0 ; d0 = value to send DFAC + jsrTBL sndDFACSend ; call DFACSend routine thru expandmem + move.w (sp)+,sr ; enable ints + movem.l (sp)+,@saveregs + rts + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— +; QueryInput - return current input source selected +; +; Input: none +; Output: d0.b input source +; 0 = none (off) +; 1 = microphone +; 2 = auxillary (modem sound on Tim, CD on Spike and Eclipse) + + WITH SoundIOHeader, ExpandMemRec + +QueryInput move.l a0,-(sp) + movea.l ([Expandmem],emSndPrimitives),a0; a0 = ptr to vector table + moveq #~(sndSelectMask-256),d0 ; mask off selection bits + and.b DFAClast(a0),d0 ; in the DFAC register image + movea.l (sp)+,a0 + rts + + ENDWITH + + +;—————————————————————————————————————————————————————————————————————————————— + dc.b 0,1,2,0 + + +;—————————————————————————————————————————————————————————————————————————————— +EnableSoundInts + move.l a0,-(sp) + move.l VIA2,a0 + move.b #$90,$1C13(a0) + move.l (sp)+,a0 + rts + + +DisableSoundInts + move.l a0,-(sp) + move.l VIA2,a0 + move.b #$10,$1C13(a0) + move.l (sp)+,a0 + rts + + +ClearSoundInt + move.l a0,-(sp) + move.l VIA2,a0 + move.b #$90,$1A03(a0) + move.l (sp)+,a0 + rts + + +;—————————————————————————————————————————————————————————————————————————————— thru next djw +; TIMInputSelect - Select the sound input source on Tim +; +; On Tim, the input selection routine in ROM always turns AGC on. Patch +; it out to not force AGC on. +; +; Input: do.b input selection +; 0 = none (off) +; 1 = microphone +; 2 = auxillary (modem sound on Tim) +; Output: d0.b last source +; + + WITH SoundIOHeader, ExpandMemRec + +AutoSlpDisable equ $f8 ; Counting semaphor to disable sleep + +TIMInputSelect +@workingReg reg d2/a0-a1 + move.w sr,-(sp) ; save the old sr + movem.l @workingReg,-(sp) ; save working registers + + move.l PmgrBase,a1 ; point a1 to globals + movea.l ([Expandmem],emSndPrimitives),a0 ; a0 = ptr to vector table + ori.w #HiIntMask,sr ; disable ints + + moveq.l #3,d2 ; get selection bits + and.b DFAClast(a0),d2 ; + beq.s @currentlyOff ; is a source active ?? + +@currentlySelected ; sound source currently selected + tst.b d0 ; check new state, + bne.s @setsource ; if just new source, set the source + subq.b #1,AutoSlpDisable(a1) ; ... if turning off source, dec the nosleep semaphore + bra.s @setsource + +@currentlyOff ; sound source currently off + tst.b d0 ; check new state, + beq.s @setsource ; if new source still off, set the source + addq.b #1,AutoSlpDisable(a1) ; ... if turning on source, inc the nosleep semaphore +; bra.s @setsource + +@setsource + movem.l (sp)+,@workingReg ; restore working registers + bsr InputSelect ; change the source djw + move.w (sp)+,sr ; enable ints + rts + + ENDWITH + + +;_______________________________________________________________________ thru next thru next +; +; Routine: ReGenSoundIntVBL +; +; Desc: Since reading VIAx[vBufB] causes interrupts to cleared, +; this re-generates those sound interrupts. +; +; This routine stolen from +; +; {Regatta}Toolbox:SoundMgr:SoundMgrPatch.a +; +; ...Then brought back from SndPrimitives.a +; +;_______________________________________________________________________ + + Export ReGenSoundInt +ReGenSoundInt ; file=SoundMgrPatch.a (per SndPrimitives.a/Sony.a comment) + move.w #30,vblCount(a0) ; re-arm VBL task + + movea.l ASCBase,a1 ; point to Batman + + move.w sr,-(sp) ; preserve the status register + ori.w #$0700,sr ; mask interrupts + + tst.b bmIntControlA(a1) ; channel A interrupt enabled? + beq.s @do + tst.b bmIntControlB(a1) ; channel B interrupt enabled? + bne.s @dont + +@do move.b #1,bmIntControlA(a1) ; disable chnl A interrupts + move.b #1,bmIntControlB(a1) ; disable chnl B interrupts + clr.b bmIntControlA(a1) ; clear the interrupt mask to re-generate + clr.b bmIntControlB(a1) ; clear the interrupt mask to re-generate + + move.w #1,vblCount(a0) + +@dont move.w (sp)+,sr + rts + + +;_______________________________________________________________________ thru next thru next + + Export NewPBSoundDrvr +NewPBSoundDrvr + dc.b (1< +; EclipseInputSelect - Select the sound input source on Eclipse +; +; On Eclipse, the sound input source is selected by two bits on VIA2 port B +; register in addition to DFAC. There are four sound input sources on +; Eclipse: Microphone (or none?), RCA jacks, Microphone, and the CD (aux). +; These sources are selected through the VIA2 bits and routed through DFAC. +; +; If we are selecting "none" for the input source, then turn off the volume +; and AGC to prevent any noise leakage. Save the old volume and restore it +; later when a new source is selected. +; +; Input: do.b input selection +; 0 = none (off) +; 1 = microphone +; 2 = auxillary (modem sound on Tim, CD on Spike and Eclipse) +; 3 = RCA jacks +; Output: none +; + +EclipseInputSelect + + move.w sr,-(sp) ; djw + ori.w #HiIntMask,sr ; djw + movem.l d0-d1,-(sp) ; djw + move.b ([via2],vBufB),d1 ; read current via values djw + and.b #%10110111,d1 ; clear the previous value (bits pb6,pb3) djw + andi.w #$ff,d0 ; make a word index + or.b EclipseSelectTable(pc,d0.w),d1 ; set new input djw + move.b d1,([via2],vBufB) ; set via2 bits + movem.l (sp)+,d0-d1 ; djw + move.w (sp)+,sr ; djw + + tst.b d0 ; selecting no source? + beq InputSelect ; yes - ok to go setup DFAC djw + moveq.l #sndMicrophone,d0 ; all sound sources go through DFAC mike input + bra InputSelect ; djw + +EclipseSelectTable + dc.b %00000000 ; none (or microphone?) pb6=0, pb3=0 + dc.b %01000000 ; microphone pb6=1, pb3=0 + dc.b %01001000 ; auxilary (CD) pb6=1, pb3=1 + dc.b %00001000 ; RCA jacks pb6=0, pb3=1 + + +;—————————————————————————————————————————————————————————————————————————————— +;31:291c2 + +__Comp3to1 Proc Export + Import Table_1,Table_2,Table_3,Table_4,Table_5 + + link a6,#0 + movem.l d0-d7/a0-a5,-(sp) + cmpi.l #6,$18(a6) + blt.w loc_129428 + movea.l $14(a6),a0 + cmpa.w #0,a0 + bne.s loc_1291ea + clr.w d3 + move.w d3,d4 + move.w d3,d5 + move.w d3,d6 + bra.s loc_1291f8 +loc_1291ea + move.w (a0),d3 + move.w 2(a0),d4 + move.w 4(a0),d5 + move.w 6(a0),d6 +loc_1291f8 + movea.l $20(a6),a2 + movea.l $1c(a6),a3 + move.l 8(a6),d0 + subq.l #1,d0 + adda.l d0,a2 + movea.l $c(a6),a5 + subq.l #1,a5 +loc_12920e + move.b (a2)+,d0 + adda.l a5,a2 + addi.b #-$80,d0 + ext.w d0 + asl.w #8,d0 + addi.b #-$80,d0 + sub.w d4,d0 + bvc.s loc_12922e + bmi.s loc_12922a + move.w #$8001,d0 + bra.s loc_12922e +loc_12922a + move.w #$7fff,d0 +loc_12922e + move.w d3,d1 + asr.w #4,d1 + add.w d1,d1 + lea Table_1,a4 + adda.w d1,a4 + muls.w (a4),d0 + swap d0 + or.w d0,d0 + bmi.s loc_129264 + cmpi.w #$13,d0 + bgt.s loc_12924c + moveq #0,d2 + bra.s loc_129286 +loc_12924c + cmpi.w #$28,d0 + bgt.s loc_129256 + moveq #1,d2 + bra.s loc_129286 +loc_129256 + cmpi.w #$43,d0 + bgt.s loc_129260 + moveq #2,d2 + bra.s loc_129286 +loc_129260 + moveq #3,d2 + bra.s loc_129286 +loc_129264 + not.w d0 + cmpi.w #$13,d0 + bgt.s loc_129270 + moveq #7,d2 + bra.s loc_129286 +loc_129270 + cmpi.w #$28,d0 + bgt.s loc_12927a + moveq #6,d2 + bra.s loc_129286 +loc_12927a + cmpi.w #$43,d0 + bgt.s loc_129284 + moveq #5,d2 + bra.s loc_129286 +loc_129284 + moveq #4,d2 +loc_129286 + asl.w #3,d1 + lea Table_5,a4 + add.w d2,d1 + add.w d2,d1 + adda.w d1,a4 + move.w (a4),d6 + add.w d4,d6 + bvc.s loc_1292a4 + bmi.s loc_1292a0 + move.w #$8001,d6 + bra.s loc_1292a4 +loc_1292a0 + move.w #$7fff,d6 +loc_1292a4 + move.w d6,d0 + move.w d6,d4 + asr.w #3,d0 + sub.w d0,d4 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + lea Table_4,a4 + adda.w d2,a4 + adda.w d2,a4 + add.w (a4),d3 + bge.s loc_1292c0 + clr.w d3 +loc_1292c0 + move.b d2,d7 + move.b (a2)+,d0 + adda.l a5,a2 + addi.b #-$80,d0 + ext.w d0 + asl.w #8,d0 + addi.b #-$80,d0 + sub.w d4,d0 + bvc.s loc_1292e2 + bmi.s loc_1292de + move.w #$8001,d0 + bra.s loc_1292e2 +loc_1292de + move.w #$7fff,d0 +loc_1292e2 + move.w d3,d1 + asr.w #4,d1 + add.w d1,d1 + lea Table_1,a4 + adda.w d1,a4 + muls.w (a4),d0 + swap d0 + or.w d0,d0 + bmi.s loc_129304 + cmpi.w #$23,d0 + bgt.s loc_129300 + moveq #0,d2 + bra.s loc_129312 +loc_129300 + moveq #1,d2 + bra.s loc_129312 +loc_129304 + not.w d0 + cmpi.w #$23,d0 + bgt.s loc_129310 + moveq #3,d2 + bra.s loc_129312 +loc_129310 + moveq #2,d2 +loc_129312 + asl.w #3,d1 + lea Table_3,a4 + add.w d2,d1 + add.w d2,d1 + adda.w d1,a4 + move.w (a4),d6 + add.w d4,d6 + bvc.s loc_129330 + bmi.s loc_12932c + move.w #$8001,d6 + bra.s loc_129330 +loc_12932c + move.w #$7fff,d6 +loc_129330 + move.w d6,d0 + move.w d6,d4 + asr.w #3,d0 + sub.w d0,d4 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + lea Table_2,a4 + adda.w d2,a4 + adda.w d2,a4 + add.w (a4),d3 + bge.s loc_12934c + clr.w d3 +loc_12934c + asl.b #3,d2 + add.b d2,d7 + move.b (a2)+,d0 + adda.l a5,a2 + addi.b #-$80,d0 + ext.w d0 + asl.w #8,d0 + addi.b #-$80,d0 + sub.w d4,d0 + bvc.s loc_129370 + bmi.s loc_12936c + move.w #$8001,d0 + bra.s loc_129370 +loc_12936c + move.w #$7fff,d0 +loc_129370 + move.w d3,d1 + asr.w #4,d1 + add.w d1,d1 + lea Table_1,a4 + adda.w d1,a4 + muls.w (a4),d0 + swap d0 + or.w d0,d0 + bmi.s loc_1293a6 + cmpi.w #$13,d0 + bgt.s loc_12938e + moveq #0,d2 + bra.s loc_1293c8 +loc_12938e + cmpi.w #$28,d0 + bgt.s loc_129398 + moveq #1,d2 + bra.s loc_1293c8 +loc_129398 + cmpi.w #$43,d0 + bgt.s loc_1293a2 + moveq #2,d2 + bra.s loc_1293c8 +loc_1293a2 + moveq #3,d2 + bra.s loc_1293c8 +loc_1293a6 + not.w d0 + cmpi.w #$13,d0 + bgt.s loc_1293b2 + moveq #7,d2 + bra.s loc_1293c8 +loc_1293b2 + cmpi.w #$28,d0 + bgt.s loc_1293bc + moveq #6,d2 + bra.s loc_1293c8 +loc_1293bc + cmpi.w #$43,d0 + bgt.s loc_1293c6 + moveq #5,d2 + bra.s loc_1293c8 +loc_1293c6 + moveq #4,d2 +loc_1293c8 + asl.w #3,d1 + lea Table_5,a4 + add.w d2,d1 + add.w d2,d1 + adda.w d1,a4 + move.w (a4),d6 + add.w d4,d6 + bvc.s loc_1293e6 + bmi.s loc_1293e2 + move.w #$8001,d6 + bra.s loc_1293e6 +loc_1293e2 + move.w #$7fff,d6 +loc_1293e6 + move.w d6,d0 + move.w d6,d4 + asr.w #3,d0 + sub.w d0,d4 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + lea Table_4,a4 + adda.w d2,a4 + adda.w d2,a4 + add.w (a4),d3 + bge.s loc_129402 + clr.w d3 +loc_129402 + asl.b #5,d2 + add.b d2,d7 + move.b d7,(a3)+ + subq.l #3,$18(a6) + bgt.w loc_12920e + movea.l $10(a6),a0 + cmpa.w #0,a0 + beq.s loc_129428 + move.w d3,(a0) + move.w d4,2(a0) + move.w d5,4(a0) + move.w d6,6(a0) +loc_129428 + movem.l (sp)+,d0-d7/a0-a5 + movea.l 4(a6),a0 + unlk a6 + adda.l #$20,sp + jmp (a0) + + +__Exp1to3 Proc Export + Import Table_2,Table_4 + + link a6,#0 + movem.l d0-d7/a0-a5,-(sp) + cmpi.l #1,$18(a6) + blt.w loc_129620 + movea.l $14(a6),a0 + cmpa.w #0,a0 + bne.s loc_12945c + clr.w d2 + clr.w d3 + bra.s loc_129462 +loc_12945c + move.w (a0),d2 + move.w 2(a0),d3 +loc_129462 + movea.l $20(a6),a2 + movea.l $1c(a6),a3 + move.w #$7f0,d6 + movea.w #$10,a5 + move.w #$8080,d7 + move.l 8(a6),d0 + subq.l #1,d0 + lsl.l #1,d0 + adda.l d0,a2 + movea.l $c(a6),a1 + subq.l #1,a1 + adda.l a1,a1 +loc_129488 + move.b (a2)+,d4 + moveq #7,d1 + and.b d4,d1 + add.w d1,d1 + lea Table_4,a4 + adda.w d1,a4 + move.w d2,d1 + move.w d2,d0 + asr.w #5,d0 + sub.w d0,d2 + add.w (a4),d2 + bge.s loc_1294a4 + moveq #0,d2 +loc_1294a4 + and.w d6,d1 + add.w a5,d1 + adda.w d1,a4 + add.w (a4),d3 + bvc.s loc_1294ba + bmi.s loc_1294b6 + move.w #$8001,d3 + bra.s loc_1294ba +loc_1294b6 + move.w #$7fff,d3 +loc_1294ba + move.w d3,d0 + move.w d0,d5 + andi.w #$ff00,d5 + asr.w #3,d0 + sub.w d0,d3 + lsr.w #2,d4 + moveq #6,d1 + and.b d4,d1 + lea Table_2,a4 + adda.w d1,a4 + move.w d2,d1 + move.w d2,d0 + asr.w #5,d0 + sub.w d0,d2 + add.w (a4),d2 + bge.s loc_1294e0 + moveq #0,d2 +loc_1294e0 + and.w d6,d1 + add.w a5,d1 + adda.w d1,a4 + add.w (a4),d3 + bvc.s loc_1294f6 + bmi.s loc_1294f2 + move.w #$8001,d3 + bra.s loc_1294f6 +loc_1294f2 + move.w #$7fff,d3 +loc_1294f6 + move.w d3,d0 + asr.w #3,d0 + sub.w d0,d3 + lsr.w #5,d0 + andi.w #$ff,d0 + or.w d0,d5 + eor.w d7,d5 + move.w d5,(a3)+ + lsr.w #2,d4 + moveq #$e,d1 + and.b d4,d1 + lea Table_4,a4 + adda.w d1,a4 + move.w d2,d1 + move.w d2,d0 + asr.w #5,d0 + sub.w d0,d2 + add.w (a4),d2 + bge.s loc_129522 + moveq #0,d2 +loc_129522 + and.w d6,d1 + add.w a5,d1 + adda.w d1,a4 + add.w (a4),d3 + bvc.s loc_129538 + bmi.s loc_129534 + move.w #$8001,d3 + bra.s loc_129538 +loc_129534 + move.w #$7fff,d3 +loc_129538 + move.w d3,d0 + move.w d0,d5 + andi.w #$ff00,d5 + asr.w #3,d0 + sub.w d0,d3 + move.b (a2)+,d4 + moveq #7,d1 + and.b d4,d1 + add.w d1,d1 + lea Table_4,a4 + adda.w d1,a4 + move.w d2,d1 + move.w d2,d0 + asr.w #5,d0 + sub.w d0,d2 + add.w (a4),d2 + bge.s loc_129560 + moveq #0,d2 +loc_129560 + and.w d6,d1 + add.w a5,d1 + adda.w d1,a4 + add.w (a4),d3 + bvc.s loc_129576 + bmi.s loc_129572 + move.w #$8001,d3 + bra.s loc_129576 +loc_129572 + move.w #$7fff,d3 +loc_129576 + move.w d3,d0 + asr.w #3,d0 + sub.w d0,d3 + lsr.w #5,d0 + andi.w #$ff,d0 + or.w d0,d5 + eor.w d7,d5 + move.w d5,(a3)+ + lsr.w #2,d4 + moveq #6,d1 + and.b d4,d1 + lea Table_2,a4 + adda.w d1,a4 + move.w d2,d1 + move.w d2,d0 + asr.w #5,d0 + sub.w d0,d2 + add.w (a4),d2 + bge.s loc_1295a2 + moveq #0,d2 +loc_1295a2 + and.w d6,d1 + add.w a5,d1 + adda.w d1,a4 + add.w (a4),d3 + bvc.s loc_1295b8 + bmi.s loc_1295b4 + move.w #$8001,d3 + bra.s loc_1295b8 +loc_1295b4 + move.w #$7fff,d3 +loc_1295b8 + move.w d3,d0 + move.w d0,d5 + andi.w #$ff00,d5 + asr.w #3,d0 + sub.w d0,d3 + lsr.w #2,d4 + moveq #$e,d1 + and.b d4,d1 + lea Table_4,a4 + adda.w d1,a4 + move.w d2,d1 + move.w d2,d0 + asr.w #5,d0 + sub.w d0,d2 + add.w (a4),d2 + bge.s loc_1295de + moveq #0,d2 +loc_1295de + and.w d6,d1 + add.w a5,d1 + adda.w d1,a4 + add.w (a4),d3 + bvc.s loc_1295f4 + bmi.s loc_1295f0 + move.w #$8001,d3 + bra.s loc_1295f4 +loc_1295f0 + move.w #$7fff,d3 +loc_1295f4 + move.w d3,d0 + asr.w #3,d0 + sub.w d0,d3 + lsr.w #5,d0 + andi.w #$ff,d0 + or.w d0,d5 + eor.w d7,d5 + move.w d5,(a3)+ + adda.l a1,a2 + subq.l #1,$18(a6) + bne.w loc_129488 + movea.l $10(a6),a0 + cmpa.w #0,a0 + beq.s loc_129620 + move.w d2,(a0) + move.w d3,2(a0) +loc_129620 + movem.l (sp)+,d0-d7/a0-a5 + movea.l 4(a6),a0 + unlk a6 + adda.l #$20,sp + jmp (a0) + + +__Exp1to6 Proc Export + Import Table_2,Table_4 + + link a6,#-4 + movem.l d0-d7/a0-a5,-(sp) + cmpi.l #1,$18(a6) + blt.w loc_129870 + movea.l $14(a6),a0 + cmpa.w #0,a0 + bne.s loc_12965c + suba.l a4,a4 + move.w a4,d5 + move.w a4,d3 + movea.w a4,a5 + move.w a4,d4 + move.w a4,d2 + bra.s loc_129672 +loc_12965c + movea.w (a0),a4 + move.w 2(a0),d5 + move.w 4(a0),d3 + movea.w 6(a0),a5 + move.w 8(a0),d4 + move.w $a(a0),d2 +loc_129672 + movea.l $20(a6),a0 + movea.l $1c(a6),a2 + move.w #$7f0,d6 + move.w #$10,d7 + move.l 8(a6),d0 + subq.l #1,d0 + adda.l d0,a0 + movea.l $c(a6),a3 + subq.l #1,a3 +loc_129690 + move.b (a0)+,d1 + moveq #7,d0 + and.w d1,d0 + add.w d0,d0 + move.w d0,-2(a6) + lsr.w #2,d1 + moveq #6,d0 + and.w d1,d0 + move.w d0,-4(a6) + lsr.w #2,d1 + andi.w #$e,d1 + lea Table_4,a1 + adda.w d1,a1 + move.w d3,d1 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + add.w (a1),d3 + bge.s loc_1296c0 + clr.w d3 +loc_1296c0 + and.w d6,d1 + add.w d7,d1 + adda.w d1,a1 + move.w (a1),d0 + eor.w d0,d2 + bmi.s loc_1296ea + add.w a5,d0 + bvc.s loc_1296dc + bmi.s loc_1296d8 + move.w #$8001,d0 + bra.s loc_1296dc +loc_1296d8 + move.w #$7fff,d0 +loc_1296dc + move.w d0,d2 + addi.w #$1fa,d4 + bvc.s loc_1296e8 + move.w #$7fff,d4 +loc_1296e8 + bra.s loc_129706 +loc_1296ea + add.w a5,d0 + bvc.s loc_1296fa + bmi.s loc_1296f6 + move.w #$8001,d0 + bra.s loc_1296fa +loc_1296f6 + move.w #$7fff,d0 +loc_1296fa + move.w d0,d2 + subi.w #$13a,d4 + bvc.s loc_129706 + move.w #$8001,d4 +loc_129706 + muls.w d4,d0 + add.l d0,d0 + swap d0 + movea.w d0,a5 + asr.w #1,d2 + move.w d5,d1 + sub.w d2,d1 + asr.w #2,d1 + move.w d5,d0 + add.w a4,d0 + sub.w d1,d0 + move.w a4,d5 + movea.w d2,a4 + add.w a4,d1 + add.w d5,d1 + andi.w #$ff00,d0 + lsr.w #8,d1 + or.w d0,d1 + eori.w #$8080,d1 + move.w d1,(a2)+ + move.w -4(a6),d1 + lea Table_2,a1 + adda.w d1,a1 + move.w d3,d1 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + add.w (a1),d3 + bge.s loc_12974a + clr.w d3 +loc_12974a + and.w d6,d1 + add.w d7,d1 + adda.w d1,a1 + move.w (a1),d0 + eor.w d0,d2 + bmi.s loc_129774 + add.w a5,d0 + bvc.s loc_129766 + bmi.s loc_129762 + move.w #$8001,d0 + bra.s loc_129766 +loc_129762 + move.w #$7fff,d0 +loc_129766 + move.w d0,d2 + addi.w #$1fa,d4 + bvc.s loc_129772 + move.w #$7fff,d4 +loc_129772 + bra.s loc_129790 +loc_129774 + add.w a5,d0 + bvc.s loc_129784 + bmi.s loc_129780 + move.w #$8001,d0 + bra.s loc_129784 +loc_129780 + move.w #$7fff,d0 +loc_129784 + move.w d0,d2 + subi.w #$13a,d4 + bvc.s loc_129790 + move.w #$8001,d4 +loc_129790 + muls.w d4,d0 + add.l d0,d0 + swap d0 + movea.w d0,a5 + asr.w #1,d2 + move.w d5,d1 + sub.w d2,d1 + asr.w #2,d1 + move.w d5,d0 + add.w a4,d0 + sub.w d1,d0 + move.w a4,d5 + movea.w d2,a4 + add.w a4,d1 + add.w d5,d1 + andi.w #$ff00,d0 + lsr.w #8,d1 + or.w d0,d1 + eori.w #$8080,d1 + move.w d1,(a2)+ + move.w -2(a6),d1 + lea Table_4,a1 + adda.w d1,a1 + move.w d3,d1 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + add.w (a1),d3 + bge.s loc_1297d4 + clr.w d3 +loc_1297d4 + and.w d6,d1 + add.w d7,d1 + adda.w d1,a1 + move.w (a1),d0 + eor.w d0,d2 + bmi.s loc_1297fe + add.w a5,d0 + bvc.s loc_1297f0 + bmi.s loc_1297ec + move.w #$8001,d0 + bra.s loc_1297f0 +loc_1297ec + move.w #$7fff,d0 +loc_1297f0 + move.w d0,d2 + addi.w #$1fa,d4 + bvc.s loc_1297fc + move.w #$7fff,d4 +loc_1297fc + bra.s loc_12981a +loc_1297fe + add.w a5,d0 + bvc.s loc_12980e + bmi.s loc_12980a + move.w #$8001,d0 + bra.s loc_12980e +loc_12980a + move.w #$7fff,d0 +loc_12980e + move.w d0,d2 + subi.w #$13a,d4 + bvc.s loc_12981a + move.w #$8001,d4 +loc_12981a + muls.w d4,d0 + add.l d0,d0 + swap d0 + movea.w d0,a5 + asr.w #1,d2 + move.w d5,d1 + sub.w d2,d1 + asr.w #2,d1 + move.w d5,d0 + add.w a4,d0 + sub.w d1,d0 + move.w a4,d5 + movea.w d2,a4 + add.w a4,d1 + add.w d5,d1 + andi.w #$ff00,d0 + lsr.w #8,d1 + or.w d0,d1 + eori.w #$8080,d1 + move.w d1,(a2)+ + adda.l a3,a0 + subq.l #1,$18(a6) + bne.w loc_129690 + movea.l $10(a6),a0 + cmpa.w #0,a0 + beq.s loc_129870 + move.w a4,(a0) + move.w d5,2(a0) + move.w d3,4(a0) + move.w a5,6(a0) + move.w d4,8(a0) + move.w d2,$a(a0) +loc_129870 + movem.l (sp)+,d0-d7/a0-a5 + movea.l 4(a6),a0 + unlk a6 + adda.l #$20,sp + jmp (a0) + + +__Comp6to1 Proc Export + Import Table_1,Table_2,Table_4 + + link a6,#-4 + movem.l d0-d7/a0-a5,-(sp) + cmpi.l #6,$18(a6) + blt.w loc_129c5c + movea.l $14(a6),a0 + cmpa.w #0,a0 + bne.s loc_1298b8 + move.w #$fc02,d6 + movea.w #$fc02,a5 + move.w #$e00f,d7 + movea.w #$e00f,a4 + clr.w d3 + clr.w d4 + clr.w d5 + suba.l a2,a2 + bra.s loc_1298d6 +loc_1298b8 + move.w (a0),d6 + movea.w 2(a0),a5 + move.w 4(a0),d7 + movea.w 6(a0),a4 + move.w 8(a0),d3 + move.w $a(a0),d4 + move.w $c(a0),d5 + movea.w $e(a0),a2 +loc_1298d6 + movea.l $20(a6),a0 + movea.l $1c(a6),a1 + move.l 8(a6),d0 + subq.l #1,d0 + adda.l d0,a0 + move.l $c(a6),-4(a6) + subq.l #1,-4(a6) +loc_1298f0 + moveq #$ffffff80,d1 + add.b (a0)+,d1 + adda.l -4(a6),a0 + ext.w d1 + asl.w #4,d1 + add.w d6,d1 + sub.w a5,d1 + asr.w #1,d1 + move.w a5,d0 + add.w d6,d0 + add.w d6,d0 + add.w d1,d0 + movea.w d6,a5 + move.w d1,d6 + movea.w d7,a4 + asr.w #1,d7 + add.w d0,d7 + moveq #$ffffff80,d0 + add.b (a0)+,d0 + adda.l -4(a6),a0 + ext.w d0 + asl.w #4,d0 + add.w d6,d0 + sub.w a5,d0 + asr.w #1,d0 + move.w a5,d1 + add.w d6,d1 + add.w d6,d1 + add.w d0,d1 + movea.w d6,a5 + move.w d0,d6 + move.w a4,d0 + add.w d7,d0 + add.w d7,d0 + movea.w d7,a4 + asr.w #1,d7 + add.w d1,d7 + add.w d7,d0 + sub.w d4,d0 + bvc.s loc_129950 + bmi.s loc_12994c + move.w #$8001,d0 + bra.s loc_129950 +loc_12994c + move.w #$7fff,d0 +loc_129950 + move.w d3,d1 + asr.w #4,d1 + add.w d1,d1 + lea Table_1,a3 + adda.w d1,a3 + muls.w (a3),d0 + swap d0 + or.w d0,d0 + bmi.s loc_129986 + cmpi.w #$15,d0 + bgt.s loc_12996e + moveq #0,d2 + bra.s loc_1299a8 +loc_12996e + cmpi.w #$2b,d0 + bgt.s loc_129978 + moveq #1,d2 + bra.s loc_1299a8 +loc_129978 + cmpi.w #$48,d0 + bgt.s loc_129982 + moveq #2,d2 + bra.s loc_1299a8 +loc_129982 + moveq #3,d2 + bra.s loc_1299a8 +loc_129986 + not.w d0 + cmpi.w #$15,d0 + bgt.s loc_129992 + moveq #7,d2 + bra.s loc_1299a8 +loc_129992 + cmpi.w #$2b,d0 + bgt.s loc_12999c + moveq #6,d2 + bra.s loc_1299a8 +loc_12999c + cmpi.w #$48,d0 + bgt.s loc_1299a6 + moveq #5,d2 + bra.s loc_1299a8 +loc_1299a6 + moveq #4,d2 +loc_1299a8 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + lea Table_4,a3 + adda.w d2,a3 + adda.w d2,a3 + add.w (a3),d3 + bge.s loc_1299bc + clr.w d3 +loc_1299bc + asl.w #3,d1 + lea $10(a3),a3 + adda.w d1,a3 + move.w (a3),d0 + move.w a2,d1 + eor.w d0,d1 + bmi.s loc_1299ea + add.w d4,d0 + bvc.s loc_1299dc + bmi.s loc_1299d8 + move.w #$8001,d0 + bra.s loc_1299dc +loc_1299d8 + move.w #$7fff,d0 +loc_1299dc + movea.w d0,a2 + addi.w #$1fa,d5 + bvc.s loc_1299e8 + move.w #$7fff,d5 +loc_1299e8 + bra.s loc_129a06 +loc_1299ea + add.w d4,d0 + bvc.s loc_1299fa + bmi.s loc_1299f6 + move.w #$8001,d0 + bra.s loc_1299fa +loc_1299f6 + move.w #$7fff,d0 +loc_1299fa + movea.w d0,a2 + subi.w #$13a,d5 + bvc.s loc_129a06 + move.w #$8001,d5 +loc_129a06 + muls.w d5,d0 + add.l d0,d0 + swap d0 + move.w d0,d4 + asl.b #5,d2 + move.b d2,(a1) + moveq #$ffffff80,d1 + add.b (a0)+,d1 + adda.l -4(a6),a0 + ext.w d1 + asl.w #4,d1 + add.w d6,d1 + sub.w a5,d1 + asr.w #1,d1 + move.w a5,d0 + add.w d6,d0 + add.w d6,d0 + add.w d1,d0 + movea.w d6,a5 + move.w d1,d6 + movea.w d7,a4 + asr.w #1,d7 + add.w d0,d7 + moveq #$ffffff80,d0 + add.b (a0)+,d0 + adda.l -4(a6),a0 + ext.w d0 + asl.w #4,d0 + add.w d6,d0 + sub.w a5,d0 + asr.w #1,d0 + move.w a5,d1 + add.w d6,d1 + add.w d6,d1 + add.w d0,d1 + movea.w d6,a5 + move.w d0,d6 + move.w a4,d0 + add.w d7,d0 + add.w d7,d0 + movea.w d7,a4 + asr.w #1,d7 + add.w d1,d7 + add.w d7,d0 + sub.w d4,d0 + bvc.s loc_129a72 + bmi.s loc_129a6e + move.w #$8001,d0 + bra.s loc_129a72 +loc_129a6e + move.w #$7fff,d0 +loc_129a72 + move.w d3,d1 + asr.w #4,d1 + add.w d1,d1 + lea Table_1,a3 + adda.w d1,a3 + muls.w (a3),d0 + swap d0 + or.w d0,d0 + bmi.s loc_129a94 + cmpi.w #$25,d0 + bgt.s loc_129a90 + moveq #0,d2 + bra.s loc_129aa2 +loc_129a90 + moveq #1,d2 + bra.s loc_129aa2 +loc_129a94 + not.w d0 + cmpi.w #$25,d0 + bgt.s loc_129aa0 + moveq #3,d2 + bra.s loc_129aa2 +loc_129aa0 + moveq #2,d2 +loc_129aa2 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + lea Table_2,a3 + adda.w d2,a3 + adda.w d2,a3 + add.w (a3),d3 + bge.s loc_129ab6 + clr.w d3 +loc_129ab6 + asl.w #3,d1 + lea $10(a3),a3 + adda.w d1,a3 + move.w (a3),d0 + move.w a2,d1 + eor.w d0,d1 + bmi.s loc_129ae4 + add.w d4,d0 + bvc.s loc_129ad6 + bmi.s loc_129ad2 + move.w #$8001,d0 + bra.s loc_129ad6 +loc_129ad2 + move.w #$7fff,d0 +loc_129ad6 + movea.w d0,a2 + addi.w #$1fa,d5 + bvc.s loc_129ae2 + move.w #$7fff,d5 +loc_129ae2 + bra.s loc_129b00 +loc_129ae4 + add.w d4,d0 + bvc.s loc_129af4 + bmi.s loc_129af0 + move.w #$8001,d0 + bra.s loc_129af4 +loc_129af0 + move.w #$7fff,d0 +loc_129af4 + movea.w d0,a2 + subi.w #$13a,d5 + bvc.s loc_129b00 + move.w #$8001,d5 +loc_129b00 + muls.w d5,d0 + add.l d0,d0 + swap d0 + move.w d0,d4 + asl.b #3,d2 + add.b d2,(a1) + moveq #$ffffff80,d1 + add.b (a0)+,d1 + adda.l -4(a6),a0 + ext.w d1 + asl.w #4,d1 + add.w d6,d1 + sub.w a5,d1 + asr.w #1,d1 + move.w a5,d0 + add.w d6,d0 + add.w d6,d0 + add.w d1,d0 + movea.w d6,a5 + move.w d1,d6 + movea.w d7,a4 + asr.w #1,d7 + add.w d0,d7 + moveq #$ffffff80,d0 + add.b (a0)+,d0 + adda.l -4(a6),a0 + ext.w d0 + asl.w #4,d0 + add.w d6,d0 + sub.w a5,d0 + asr.w #1,d0 + move.w a5,d1 + add.w d6,d1 + add.w d6,d1 + add.w d0,d1 + movea.w d6,a5 + move.w d0,d6 + move.w a4,d0 + add.w d7,d0 + add.w d7,d0 + movea.w d7,a4 + asr.w #1,d7 + add.w d1,d7 + add.w d7,d0 + sub.w d4,d0 + bvc.s loc_129b6c + bmi.s loc_129b68 + move.w #$8001,d0 + bra.s loc_129b6c +loc_129b68 + move.w #$7fff,d0 +loc_129b6c + move.w d3,d1 + asr.w #4,d1 + add.w d1,d1 + lea Table_1,a3 + adda.w d1,a3 + muls.w (a3),d0 + swap d0 + or.w d0,d0 + bmi.s loc_129ba2 + cmpi.w #$15,d0 + bgt.s loc_129b8a + moveq #0,d2 + bra.s loc_129bc4 +loc_129b8a + cmpi.w #$2b,d0 + bgt.s loc_129b94 + moveq #1,d2 + bra.s loc_129bc4 +loc_129b94 + cmpi.w #$48,d0 + bgt.s loc_129b9e + moveq #2,d2 + bra.s loc_129bc4 +loc_129b9e + moveq #3,d2 + bra.s loc_129bc4 +loc_129ba2 + not.w d0 + cmpi.w #$15,d0 + bgt.s loc_129bae + moveq #7,d2 + bra.s loc_129bc4 +loc_129bae + cmpi.w #$2b,d0 + bgt.s loc_129bb8 + moveq #6,d2 + bra.s loc_129bc4 +loc_129bb8 + cmpi.w #$48,d0 + bgt.s loc_129bc2 + moveq #5,d2 + bra.s loc_129bc4 +loc_129bc2 + moveq #4,d2 +loc_129bc4 + move.w d3,d0 + asr.w #5,d0 + sub.w d0,d3 + lea Table_4,a3 + adda.w d2,a3 + adda.w d2,a3 + add.w (a3),d3 + bge.s loc_129bd8 + clr.w d3 +loc_129bd8 + asl.w #3,d1 + lea $10(a3),a3 + adda.w d1,a3 + move.w (a3),d0 + move.w a2,d1 + eor.w d0,d1 + bmi.s loc_129c06 + add.w d4,d0 + bvc.s loc_129bf8 + bmi.s loc_129bf4 + move.w #$8001,d0 + bra.s loc_129bf8 +loc_129bf4 + move.w #$7fff,d0 +loc_129bf8 + movea.w d0,a2 + addi.w #$1fa,d5 + bvc.s loc_129c04 + move.w #$7fff,d5 +loc_129c04 + bra.s loc_129c22 +loc_129c06 + add.w d4,d0 + bvc.s loc_129c16 + bmi.s loc_129c12 + move.w #$8001,d0 + bra.s loc_129c16 +loc_129c12 + move.w #$7fff,d0 +loc_129c16 + movea.w d0,a2 + subi.w #$13a,d5 + bvc.s loc_129c22 + move.w #$8001,d5 +loc_129c22 + muls.w d5,d0 + add.l d0,d0 + swap d0 + move.w d0,d4 + add.b d2,(a1)+ + subq.l #6,$18(a6) + bgt.w loc_1298f0 + movea.l $10(a6),a0 + cmpa.w #0,a0 + beq.s loc_129c5c + move.w d6,(a0) + move.w a5,2(a0) + move.w d7,4(a0) + move.w a4,6(a0) + move.w d3,8(a0) + move.w d4,$a(a0) + move.w d5,$c(a0) + move.w a2,$e(a0) +loc_129c5c + movem.l (sp)+,d0-d7/a0-a5 + movea.l 4(a6),a0 + unlk a6 + adda.l #$20,sp + jmp (a0) + + +;—————————————————————————————————————————————————————————————————————————————— +;31:29c6c + +InitSndDispatch Proc Export + Import DispFuncDisp, UnimplFunction, _R24DE, DispAddTool, _R24EA, _R24F0, SoundDispatcher + move.l #52,d0 + _NewPtr ,sys + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l a0,42(a1) + + leaResident DispFuncDisp,a1 + move.l a1,(a0)+ + + move.l #7,d1 + leaResident UnimplFunction,a1 +@Loop8 move.l a1,(a0)+ + dbra d1,@Loop8 + + leaResident _R24DE,a1 + move.l a1,(a0)+ + leaResident DispAddTool,a1 + move.l a1,(a0)+ + leaResident _R24EA,a1 + move.l a1,(a0)+ + leaResident _R24F0,a1 + move.l a1,(a0)+ + + leaResident SoundDispatcher,a0 + move.l #$00,d0 ; SoundDispatch + _SetTrapAddress ,newTool + + rts + + +;31:29cb0 +SoundDispatcher Proc Export + move.l ExpandMem,a0 + move.l ExpandMemRec.soundMgrGlobals(a0),a0 + move.l 42(a0),a0 + move.l (a0,d0),a0 + swap d0 + jmp (a0) + + Export DispFuncDisp +DispFuncDisp + cmp.w #16,d0 + bhs.s UnimplFunction + move.l ExpandMem,a0 + move.l ExpandMemRec.soundMgrGlobals(a0),a0 + move.l 42(a0),a0 + move.l 36(a0,d0),a0 + jmp (a0) + + Export UnimplFunction +UnimplFunction + tst.w d0 + bne.s @return + clr.l 4(sp) +@return rts + + +_R24DE Proc Export + Import SoundDispatcher + + move.w 4(sp),d0 + beq.s @version + cmp.w #36,d0 + bhs.s @bad + + move.l (sp),a0 + add.l #6,sp + move.l a0,-(sp) + and.l #$FFFF,d0 + jmp SoundDispatcher + +@bad clr.l 6(sp) + bra.s @return + +@version move.l #$01002001,6(sp) ; 1.0d1 + +@return move.l (sp),a0 + OPT NONE + addq.l #6,sp + OPT ALL + jmp (a0) + rts + + +;31:29d18 +DispAddTool Proc Export + move.w 8(sp),d0 + cmp.w #36,d0 + bge.s @bad + + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l 42(a1),a1 + + move.l 4(sp),a0 + move.l a0,(a1,d0) + clr.w 10(sp) + bra.s @return + +@bad move.w #paramErr,10(sp) + +@return move.l (sp),a0 + adda.l #10,sp + jmp (a0) + + +;31:29d4a +_R24EA Proc Export + Import UnimplFunction + + move.w 4(sp),d0 + cmp.w #36,d0 + bhs.s @bad + + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l 42(a1),a1 + + leaResident UnimplFunction,a0 + move.l a0,(a1,d0) + clr.w 6(sp) + bra.s @return + +@bad move.w #paramErr,6(sp) + +@return move.l (sp),a0 + OPT NONE + addq.l #6,sp + OPT ALL + jmp (a0) + + +;31:29d7a +_R24F0 Proc Export + Import UnimplFunction + + move.w 4(sp),d0 + cmp.w #36,d0 + bhs.s @bad + + move.l ExpandMem,a1 + move.l ExpandMemRec.soundMgrGlobals(a1),a1 + move.l 42(a1),a1 + + move.l (a1,d0),d0 + lea UnimplFunction,a0 + cmp.l a0,d0 + bne.s @ne + +@bad moveq #0,d0 + +@ne move.l d0,6(sp) + move.l (sp),a0 + add.l #6,sp + jmp (a0) + + +;31:29da8 +InitMACEDispatch Proc Export + Import MACEDispatch + + clr.w -(sp) + move.w #16,-(sp) + peaResident MACEDispatch + move.l #$00040000,d0 + _SoundDispatch + move.w (sp)+,d0 + rts + + +;31:29dbe +MACEDispatch Proc Export + jmp @jumptable(d0) +@jumptable + Import Version + jmp Version + Import __Comp3to1 + jmp __Comp3to1 + Import __Exp1to3 + jmp __Exp1to3 + Import __Comp6to1 + jmp __Comp6to1 + Import __Exp1to6 + jmp __Exp1to6 + + +;28:00106 +InstallSoundIntHandler Proc Export + Import SoundIntHandler, SetupSoundInterruptVectors + + leaResident SoundIntHandler,a0 + move.l a0,$D80 + jsr SetupSoundInterruptVectors + + move.l a0,-(sp) + move.l ExpandMem,a0 + move.l ExpandMemRec.jSetupSoundInterrupt(a0),a0 + jsr (a0) + move.l (sp)+,a0 + rts + + +;28:00122 +SoundIntHandler Proc Export + move.l a0,-(sp) + move.l ExpandMem,a0 + move.l ExpandMemRec.jAcknowledgeSoundInterrupt(a0),a0 + jsr (a0) + move.l (sp)+,a0 + + move.l ExpandMem,a0 + move.l ExpandMemRec.soundMgrGlobals(a0),a0 + move.l ASCBase,a1 + + clr.l d0 ; we use the high bit as a flag + move.b ascFifoInt(a1),d0 + + move.l 30(a0),d1 + beq.s @doneChecking + +; try 0 + cmp.b #0,46(a0) + bne.s @not0 + btst #0,d0 + beq.s @doneChecking + bset #31,d0 + bra.s @defer + +@not0 ; try E0 + cmp.b #elsieSound,46(a0) + bne.s @notElsie + bset #0,d0 + beq.s @doneChecking + move.l a0,-(sp) + move.l ExpandMem,a0 + move.l ExpandMemRec.jSuspendSoundInterrupt(a0),a0 + jsr (a0) + move.l (sp)+,a0 + bra.s @defer + +@notElsie ; try B0 + cmp.b #batmanSnd,46(a0) + bne.s @notBatman + tst.b bmIntControlA(a1) + bne.s @doneChecking + tst.b 47(a0) + beq.s @otherpath + btst #0,d0 + beq.s @doneChecking + bra.s @common +@otherpath btst #0,d0 + bne.s @doneChecking +@common move.b #1,bmIntControlA(a1) + bset #31,d0 + bra.s @defer + +@notBatman + _Debugger + +@defer movem.l d0/a0/a1,-(sp) + move.l d1,a0 + _DeferUserFn + movem.l (sp)+,d0/a0/a1 +@doneChecking ; now do something similar for bmIntControlB... +laber_barrier + move.l 34(a0),d1 + beq.s @doneChecking + +; try 0 + cmp.b #0,46(a0) + bne.s @not0 + btst #2,d0 + beq.s @doneChecking + bset #31,d0 + bra.s @defer + +@not0 ; try E0 + cmp.b #elsieSound,46(a0) + bne.s @notElsie + btst #0,d0 + beq.s @doneChecking + move.l a0,-(sp) + move.l ExpandMem,a0 + move.l ExpandMemRec.jSuspendSoundInterrupt(a0),a0 + jsr (a0) + move.l (sp)+,a0 + bra.s @defer + +@notElsie ; try B0 + cmp.b #batmanSnd,46(a0) + bne.s @notBatman + tst.b bmIntControlB(a1) + bne.s @doneChecking + btst #2,d0 + beq.s @doneChecking + move.b #1,bmIntControlB(a1) + bset #31,d0 + bra.s @defer + +@notBatman + _Debugger + +@defer movem.l d0/a0/a1,-(sp) + move.l d1,a0 + _DeferUserFn + movem.l (sp)+,d0/a0/a1 + +@doneChecking +; defer myself + btst #31,d0 + beq.s @noInt + movem.l d0/a0/a1,-(sp) + lea SoundIntHandler,a0 + _DeferUserFn + movem.l (sp)+,d0/a0/a1 +@noInt rts + + +;28:00232 +EnableASCInts ROMBind (II,$1),(Portable,$232),(IIci,$a00e) +DisableASCInts ROMBind (II,$1),(Portable,$232),(IIci,$a02e) +ClearASCInt ROMBind (II,$1),(Portable,$232),(IIci,$a04c) + +SetupSoundInterruptVectors Proc Export + leaROM EnableASCInts,a1 + leaROM DisableASCInts,a2 + move.l a1,a3 + leaROM ClearASCInt,a4 + + Import ElsieEnableASCInts + move.l ASCBase,a0 ; nop out EnableASCInts on Elsie + move.b ascVersion(a0),d0 + and.b #$F0,d0 + cmp.b #elsieSound,d0 + bne.s @notElsie + leaResident ElsieEnableASCInts,a1 +@notElsie + + Import IIEnableASCInts, IIDisableASCInts, IIClearASCInt + move.l a1,d0 ; replace all on Mac II + btst #0,d0 + beq.s @probablyBad + leaResident IIEnableASCInts,a1 + leaResident IIDisableASCInts,a2 + move.l a1,a3 + leaResident IIClearASCInt,a4 +@probablyBad + + move.l ExpandMem,a0 + lea ExpandMemRec.jSetupSoundInterrupt(a0),a0 + move.l a1,(a0)+ ; jSetupSoundInterrupt + move.l a2,(a0)+ ; jSuspendSoundInterrupt + move.l a3,(a0)+ ; jResumeSoundInterrupt + move.l a4,(a0)+ ; jAcknowledgeSoundInterrupt + rts + + +;28:00284 +ElsieEnableASCInts Proc Export + rts + + +;28:00286 +IIEnableASCInts Proc Export + move.l VIA2,a0 + bclr #4,vPCR(a0) + move.b #(1<= 2, save original in d0 + move.w d0,d1 + and.w #$700,d1 + cmp.w #$200,d1 + bge.s @return + move.w d0,d1 + and.w #~$700,d1 + or.w #$200,d1 + move.w d1,sr +@return rts + + +soundAttrGestalt Proc Export ; file=SoundMgrLowLevel.a (GestaltFunction.a changelog) + link a6,#-$100 + move.l d3,-(sp) + move.l #'mach',d0 + _Gestalt + move.l a0,d0 + moveq #8,d3 + cmpi.w #$36,d0 + bne.s loc_129F62 + move.w #$19,d0 +loc_129F62 + cmp.w byte_12A000,d0 + bhi.s loc_129F74 + subq.w #1,d0 + lea unk_12A002,a0 + move.b (a0,d0.w),d3 + bra.s loc_129FB0 +loc_129F74 + move.l $DD4,d1 + move.l d1,d2 + andi.l #$700,d2 + beq.s loc_129F86 + bset #4,d3 +loc_129F86 + move.l d1,d2 + andi.l #$800,d2 + beq.s loc_129F94 + bset #0,d3 +loc_129F94 + move.l d1,d2 + andi.l #$1000,d2 + beq.s loc_129FA2 + bset #1,d3 +loc_129FA2 + move.l d1,d2 + andi.l #$2000,d2 + beq.s loc_129FB0 + bset #6,d3 +loc_129FB0 + move.l #$A89F,d0 + _GetToolTrapAddress + move.l a0,-(sp) + move.l #$A800,d0 + _GetToolTrapAddress + cmpa.l (sp)+,a0 + beq.s loc_129FEC + clr.l -(sp) + moveq #$14,d0 + _SoundDispatch + tst.l (sp)+ + beq.s loc_129FEC + clr.w -(sp) + move.w #1,-(sp) + pea -$100(a6) + clr.l -(sp) + move.l #$5140014,d0 + _SoundDispatch + tst.w (sp)+ + bne.s loc_129FEC + bset #5,d3 +loc_129FEC + movea.l 8(a6),a0 + move.l d3,(a0) + clr.w $10(a6) + move.l (sp)+,d3 + unlk a6 + movea.l (sp)+,a0 + addq.l #8,sp + jmp (a0) +byte_12A000 dc.b 0 + dc.b $1C +unk_12A002 dc.b 8 + dc.b 8 + dc.b 8 + dc.b 8 + dc.b 8 + dc.b 9 + dc.b 9 + dc.b 9 + dc.b $B + dc.b 9 + dc.b 9 + dc.b 0 + dc.b 9 + dc.b 0 + dc.b 0 + dc.b 0 + dc.b 8 + dc.b $5B + dc.b $18 + dc.b $5B + dc.b $5B + dc.b $5B + dc.b $18 + dc.b 8 + dc.b $5B + dc.b $5B + dc.b $18 + dc.b $5B + + +_R2568 Proc Export + link a6,#-4 + move.l d7,-(sp) + move.l #'hdwr',d0 + lea -4(a6),a0 + movea.l a0,a1 + _Gestalt + move.l a0,(a1) + move.w d0,d7 + moveq #8,d0 + and.l -4(a6),d0 + move.l -8(a6),d7 + unlk a6 + rts + + +Snd_Func1 Proc Export + Import _R254A + Import _R2550 + Import _R2568 + + link a6,#-4 + movem.l d3/d6-d7/a3-a4,-(sp) + moveq #$40,d0 + _NewPtrSysClear + movea.l a0,a3 + movea.l $2B6,a0 + move.l a3,$110(a0) + movea.l $2AE,a0 + tst.b 8(a0) + beq.s loc_12A068 + move.l a3,$CC4 +loc_12A068 + move.w #$64,$16(a3) + move.w #1,$18(a3) + jsr _R2568 + tst.w d0 + beq.w loc_12A14C + move.l #$400,d0 + _NewPtrSysClear + movea.l a0,a4 + move.l a4,$A(a3) + clr.w d7 + move.w #$400,d3 +loc_12A092 + dc.w $18fc,$ff80 ; move.b #$FF80,(a4)+ + move.w d7,d0 + addq.w #1,d7 + cmp.w d7,d3 + bgt.s loc_12A092 + move.l #'mach',d0 + lea -4(a6),a0 + movea.l a0,a1 + _Gestalt + move.l a0,(a1) + move.w d0,d6 + moveq #$28,d0 + _NewPtrSysClear + movea.l a0,a4 + clr.w d7 + move.l d7,d0 + add.w d0,d0 + lea _R254A,a0 + move.w (a0,d0.w),(a4) + moveq #1,d7 +loc_12A0C6 + move.l d7,d0 + add.w d0,d0 + lea _R254A,a0 + pea (a0,d0.w) + jsr _R2550 + ext.l d7 + move.l d7,d1 + add.l d1,d1 + add.l a4,d1 + movea.l d1,a0 + move.w d0,(a0) + addq.w #4,sp + move.w d7,d0 + addq.w #1,d7 + cmpi.w #$11,d7 + blt.s loc_12A0C6 + move.l a4,$1A(a3) + move.l #$100,d0 + _NewHandle ,sys,clear + move.l a0,6(a3) + movea.l $CC0,a0 + move.b $800(a0),d0 + ext.w d0 + move.w #$F0,d1 + and.b d0,d1 + move.b d1,$2E(a3) + movea.l $CC0,a0 + moveq #$F,d0 + and.b $800(a0),d0 + move.b d0,$2F(a3) + moveq #0,d0 + move.b $2E(a3),d0 + cmpi.w #$B0,d0 + bne.s loc_12A152 + movea.l $CC0,a0 + move.b #1,$F09(a0) + movea.l $CC0,a0 + move.b #1,$F29(a0) + movea.l $CC0,a0 + move.b #1,$801(a0) + bra.s loc_12A152 +loc_12A14C + move.b #$FF,$2E(a3) +loc_12A152 + moveq #0,d0 + movem.l -$18(a6),d3/d6-d7/a3-a4 + unlk a6 + rts + + +_R2574 Proc Export + link a6,#0 + movem.l d3/d5-d7/a3-a4,-(sp) + movea.l 8(a6),a3 + move.w $E(a6),d5 + cmpi.w #2,d5 + bge.s loc_12A178 + moveq #0,d0 + bra.s loc_12A1B6 +loc_12A178 + movea.l a3,a0 + _HUnlock + movea.l a3,a0 + move.w d5,d0 + ext.l d0 + asl.l #8,d0 + _SetHandleSize + move.w $220,d6 + movea.l a3,a0 + _HLock + tst.w d6 + beq.s loc_12A196 + move.w d6,d0 + bra.s loc_12A1B6 +loc_12A196 + movea.l (a3),a4 + clr.w d6 + move.w #$100,d3 +loc_12A19E + clr.w d7 + bra.s loc_12A1A8 +loc_12A1A2 + move.b d6,(a4)+ + move.w d7,d0 + addq.w #1,d7 +loc_12A1A8 + cmp.w d7,d5 + bgt.s loc_12A1A2 + move.w d6,d0 + addq.w #1,d6 + cmp.w d6,d3 + bgt.s loc_12A19E + moveq #0,d0 +loc_12A1B6 + movem.l -$18(a6),d3/d5-d7/a3-a4 + unlk a6 + rts + + +_R257A Proc Export + Import _R255C + + link a6,#0 + movem.l d7/a4,-(sp) + movea.l 8(a6),a4 + jsr _R255C + move.w d0,d7 + move.w $20(a4),d0 + cmp.w $22(a4),d0 + bne.s loc_12A1E6 + ext.l d7 + move.l d7,d0 + move d0,sr + moveq #1,d0 + bra.s loc_12A228 +loc_12A1E6 + moveq #$FFFFFFFF,d0 + cmp.w $20(a4),d0 + bne.s loc_12A1FA + move.w $22(a4),$20(a4) + andi.w #$FFEF,$1C(a4) +loc_12A1FA + movea.l $C(a6),a0 + move.w $22(a4),d0 + addq.w #1,$22(a4) + ext.l d0 + asl.l #3,d0 + lea $24(a4,d0.l),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + move.w $22(a4),d0 + cmp.w $1E(a4),d0 + bne.s loc_12A220 + clr.w $22(a4) +loc_12A220 + ext.l d7 + move.l d7,d0 + move d0,sr + moveq #0,d0 +loc_12A228 + movem.l -8(a6),d7/a4 + unlk a6 + rts + + +_R2580 Proc Export + link a6,#0 + move.l a4,-(sp) + movea.l 8(a6),a4 + moveq #$FFFFFFFF,d0 + cmp.w $20(a4),d0 + bne.s loc_12A248 + moveq #1,d0 + bra.s loc_12A286 +loc_12A248 + move.w $20(a4),d0 + addq.w #1,$20(a4) + ext.l d0 + asl.l #3,d0 + movea.l $C(a6),a0 + lea $24(a4,d0.l),a1 + move.l (a1)+,(a0)+ + move.l (a1)+,(a0)+ + move.w $20(a4),d0 + cmp.w $1E(a4),d0 + bne.s loc_12A26E + clr.w $20(a4) +loc_12A26E + move.w $20(a4),d0 + cmp.w $22(a4),d0 + bne.s loc_12A284 + move.w #$FFFF,$20(a4) + ori.w #$10,$1C(a4) +loc_12A284 + moveq #0,d0 +loc_12A286 + movea.l -4(a6),a4 + unlk a6 + rts + + +_R2586 Proc Export + Import _R2544 + + link a6,#0 + movem.l d3/a3-a4,-(sp) + movea.l 8(a6),a0 + movea.l 4(a0),a4 + move.l a4,d0 + beq.w def_12A2C6 + bra.s loc_12A2A8 +loc_12A2A6 + movea.l (a4),a4 +loc_12A2A8 + tst.l (a4) + bne.s loc_12A2A6 + movea.l $C(a6),a0 + move.w (a0),d0 + subq.w #3,d0 + bcs.w def_12A2C6 + cmpi.w #$1C,d0 + bhi.w def_12A2C6 + add.w d0,d0 + move.w jtbl(d0),d0 +jtblbase equ *+2 + jmp jtblbase(d0) +jtbl dc.w loc_12A304-jtblbase + dc.w loc_12A312-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w loc_12A332-jtblbase + dc.w loc_12A37A-jtblbase + dc.w loc_12A388-jtblbase + dc.w loc_12A3C6-jtblbase + dc.w loc_12A3E2-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w loc_12A466-jtblbase + dc.w loc_12A4A4-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase + dc.w def_12A2C6-jtblbase +loc_12A304 + movea.l 8(a6),a0 + ori.w #2,$1C(a0) + bra.w def_12A2C6 +loc_12A312 + movea.l 8(a6),a0 + move.w #$FFFF,$20(a0) + movea.l 8(a6),a0 + clr.w $22(a0) + movea.l 8(a6),a0 + ori.w #$10,$1C(a0) + bra.w def_12A2C6 +loc_12A332 + movea.l $C(a6),a0 + moveq #0,d0 + move.w 2(a0),d0 + tst.l d0 + movea.l 8(a6),a0 + move.l d0,$10(a0) + move.l $42(a4),-(sp) + movea.l 8(a6),a0 + move.l $10(a0),d1 + move.l d1,d0 + mulu.w #$1F4,d1 + swap d0 + mulu.w #$1F4,d0 + swap d0 + clr.w d0 + add.l d0,d1 + move.l d1,-(sp) + moveq #0,d0 + move.l d0,-(sp) + move.l 8(a6),-(sp) + jsr _R2544 + lea $10(sp),sp + bra.w def_12A2C6 +loc_12A37A + movea.l 8(a6),a0 + ori.w #4,$1C(a0) + bra.w def_12A2C6 +loc_12A388 + movea.l 8(a6),a0 + andi.w #$FFB3,$1C(a0) + moveq #0,d0 + move.l d0,$10(a4) + movea.l 8(a6),a0 + move.l d0,$10(a0) + movea.l 8(a6),a0 + moveq #$FFFFFFFF,d1 + cmp.w $20(a0),d1 + beq.w def_12A2C6 + move.l $42(a4),-(sp) + moveq #0,d0 + move.l d0,-(sp) + move.l d0,-(sp) + move.l a0,-(sp) + jsr _R2544 + lea $10(sp),sp + bra.w def_12A2C6 +loc_12A3C6 + movea.l 8(a6),a0 + tst.l 8(a0) + beq.w def_12A2C6 + move.l a0,-(sp) + move.l $C(a6),-(sp) + movea.l 8(a0),a1 + jsr (a1) + bra.w def_12A2C6 +loc_12A3E2 + movea.l $C(a6),a0 + movea.l 8(a6),a1 + lea $14(a1),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + movea.l 8(a6),a0 + ori.w #8,$1C(a0) + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l (a0),a3 + bra.s loc_12A460 +loc_12A408 + moveq #8,d0 + and.w $1C(a3),d0 + beq.s loc_12A45E + movea.l $C(a6),a0 + move.l $18(a3),d0 + cmp.l 4(a0),d0 + bne.s loc_12A45E + subq.w #1,$16(a3) + tst.w $16(a3) + bne.s loc_12A45E + andi.w #$FFF7,$1C(a3) + movea.l 4(a3),a4 + bra.s loc_12A436 +loc_12A434 + movea.l (a4),a4 +loc_12A436 + tst.l (a4) + bne.s loc_12A434 + movea.l 8(a6),a0 + moveq #$FFFFFFFF,d0 + cmp.w $20(a0),d0 + beq.s loc_12A45E + move.l a4,d0 + beq.s loc_12A45E + move.l $42(a4),-(sp) + moveq #0,d0 + move.l d0,-(sp) + move.l d0,-(sp) + move.l a0,-(sp) + jsr _R2544 + lea $10(sp),sp +loc_12A45E + movea.l (a3),a3 +loc_12A460 + move.l a3,d0 + bne.s loc_12A408 + bra.s def_12A2C6 +loc_12A466 + movea.l $C(a6),a0 + moveq #0,d0 + move.w 2(a0),d0 + move.l d0,$10(a4) + move.l d0,$C(a4) + move.l $3E(a4),-(sp) + move.l $C(a4),d1 + move.l d1,d0 + mulu.w #$1F4,d1 + swap d0 + mulu.w #$1F4,d0 + swap d0 + clr.w d0 + add.l d0,d1 + move.l d1,-(sp) + move.l a4,-(sp) + moveq #0,d0 + move.l d0,-(sp) + jsr _R2544 + lea $10(sp),sp + bra.s def_12A2C6 +loc_12A4A4 + movea.l $C(a6),a0 + moveq #0,d0 + move.w 2(a0),d0 + move.l d0,$C(a4) + move.l $3E(a4),-(sp) + move.l $C(a4),d1 + move.l d1,d0 + mulu.w #$1F4,d1 + swap d0 + mulu.w #$1F4,d0 + swap d0 + clr.w d0 + add.l d0,d1 + move.l d1,-(sp) + move.l a4,-(sp) + moveq #0,d0 + move.l d0,-(sp) + jsr _R2544 + lea $10(sp),sp +def_12A2C6 + movem.l -$C(a6),d3/a3-a4 + unlk a6 + rts + + +_R258C_OTHERNAME Proc Export + Import _R2586 + Import _R258C + + link a6,#0 + movem.l d6-d7/a3-a4,-(sp) + movea.l $10(a6),a3 + movea.l $C(a6),a4 + clr.w d6 +loc_12A4F8 + moveq #0,d0 + move.w (a4),d0 + tst.l d0 + beq.s loc_12A536 + move.l a3,d0 + beq.s loc_12A528 + subq.l #2,sp + move.l 8(a6),-(sp) + move.l a4,-(sp) + move.l a3,-(sp) + movea.l 4(a3),a0 + jsr (a0) + move.b (sp)+,d7 + move.l (a3),-(sp) + move.l a4,-(sp) + move.l 8(a6),-(sp) + jsr _R258C ; this is an internal call, we need the assembler not to optimise it + lea $C(sp),sp + bra.s loc_12A536 +loc_12A528 + clr.b d7 + move.l a4,-(sp) + move.l 8(a6),-(sp) + jsr _R2586 + addq.w #8,sp +loc_12A536 + move.w #$15,(a4) + addq.w #1,d6 + move.w d6,2(a4) + tst.b d7 + bne.s loc_12A4F8 + movem.l -$10(a6),d6-d7/a3-a4 + unlk a6 + rts + + +_R2592 Proc Export + Import _R2580 + Import _R258C_OTHERNAME + + link a6,#-8 + move.l a4,-(sp) + movea.l 8(a6),a4 + pea -8(a6) + move.l a4,-(sp) + jsr _R2580 + tst.b d0 + addq.w #8,sp + beq.s loc_12A56C + moveq #1,d0 + bra.s loc_12A580 +loc_12A56C + move.l 4(a4),-(sp) + pea -8(a6) + move.l a4,-(sp) + jsr _R258C_OTHERNAME + moveq #0,d0 + lea $C(sp),sp +loc_12A580 + movea.l -$C(a6),a4 + unlk a6 + rts + + +_R2598 Proc Export + Import _R253E + Import _R258C_OTHERNAME + + link a6,#-8 + movem.l a3-a4,-(sp) + movea.l 8(a6),a3 + moveq #$10,d0 + and.w $1C(a3),d0 + beq.s loc_12A5D0 + move.w #$F,-8(a6) + move.l 4(a3),-(sp) + pea -8(a6) + move.l a3,-(sp) + jsr _R258C_OTHERNAME + andi.w #$FFEF,$1C(a3) + movea.l 4(a3),a4 + lea $C(sp),sp + bra.s loc_12A5C2 +loc_12A5C0 + movea.l (a4),a4 +loc_12A5C2 + tst.l (a4) + bne.s loc_12A5C0 + move.l $42(a4),-(sp) + jsr _R253E + addq.w #4,sp +loc_12A5D0 + movem.l -$10(a6),a3-a4 + unlk a6 + rts + + +_R259E Proc Export + Import _R258C_OTHERNAME + + link a6,#-8 + move.w #$14,-8(a6) + move.l $C(a6),-(sp) + pea -8(a6) + move.l 8(a6),-(sp) + jsr _R258C_OTHERNAME + unlk a6 + rts + + +_R25A4 Proc Export + link a6,#-4 + movem.l d3/a3-a4,-(sp) + move.l 8(a6),d0 + _StripAddress + move.l d0,-4(a6) + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l (a0),a3 + bra.s loc_12A634 +loc_12A616 + movea.l 4(a3),a4 + bra.s loc_12A62E +loc_12A61C + move.l 4(a4),d0 + _StripAddress + cmp.l -4(a6),d0 + bne.s loc_12A62C + move.l a4,d0 + bra.s loc_12A63A +loc_12A62C + movea.l (a4),a4 +loc_12A62E + move.l a4,d0 + bne.s loc_12A61C + movea.l (a3),a3 +loc_12A634 + move.l a3,d0 + bne.s loc_12A616 + moveq #0,d0 +loc_12A63A + movem.l -$10(a6),d3/a3-a4 + unlk a6 + rts + + +_R25AA Proc Export + Import _R2568 + Import _R2574 + Import _R258C_OTHERNAME + Import _R25A4 + + link a6,#-8 + movem.l d3/a3-a4,-(sp) + move.l 8(a6),d0 + _StripAddress + movea.l d0,a4 + movea.l $2B6,a0 + movea.l $110(a0),a0 + lea (a0),a3 + bra.s loc_12A674 +loc_12A660 + move.l (a3),d0 + _StripAddress + cmpa.l d0,a4 + bne.s loc_12A670 + movea.l 8(a6),a0 + move.l (a0),(a3) + bra.s loc_12A678 +loc_12A670 + movea.l (a3),a0 + movea.l a0,a3 +loc_12A674 + tst.l (a3) + bne.s loc_12A660 +loc_12A678 + movea.l 8(a6),a0 + movea.l 4(a0),a4 + bra.s loc_12A6D2 +loc_12A682 + movea.l (a4),a3 + move.w #2,-8(a6) + move.l a4,-(sp) + pea -8(a6) + move.l 8(a6),-(sp) + jsr _R258C_OTHERNAME + move.l 4(a4),-(sp) + jsr _R25A4 + tst.l d0 + lea $10(sp),sp + bne.s loc_12A6B4 + tst.l $16(a4) + beq.s loc_12A6B4 + movea.l $16(a4),a0 + _HUnlock +loc_12A6B4 + movea.l $3E(a4),a0 + _RmvTime + movea.l $3E(a4),a0 + _DisposePtr + movea.l $42(a4),a0 + _RmvTime + movea.l $42(a4),a0 + _DisposePtr + movea.l a4,a0 + _DisposePtr + movea.l a3,a4 +loc_12A6D2 + move.l a4,d0 + bne.s loc_12A682 + movea.l 8(a6),a0 + move.w $1C(a0),d0 + btst #0,d0 + beq.s loc_12A6E6 + _DisposePtr +loc_12A6E6 + movea.l $2B6,a0 + movea.l $110(a0),a0 + tst.w 4(a0) + ble.s loc_12A72A + movea.l $2B6,a0 + movea.l $110(a0),a0 + subq.w #1,4(a0) + jsr _R2568 + tst.w d0 + beq.s loc_12A72A + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.w 4(a0),d0 + ext.l d0 + move.l d0,-(sp) + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l 6(a0),-(sp) + jsr _R2574 + addq.w #8,sp +loc_12A72A + movem.l -$14(a6),d3/a3-a4 + unlk a6 + rts + + +_R25B0 Proc Export + link a6,#-$C + movem.l d3/d6-d7/a3-a4,-(sp) + movea.l $C(a6),a0 + movea.l (a0),a3 + lea 4(a3),a4 + move.w 2(a3),d7 + bra.s loc_12A76A +loc_12A74C + subq.l #2,sp + move.l 8(a6),-(sp) + moveq #0,d0 + move.l d0,-(sp) + move.w (a4),-(sp) + move.l 2(a4),-(sp) + _SndAddModifier + move.w (sp)+,d6 + beq.s loc_12A766 + move.w d6,d0 + bra.s loc_12A7BE +loc_12A766 + subq.w #1,d7 + addq.w #6,a4 +loc_12A76A + tst.w d7 + bgt.s loc_12A74C + movea.l a4,a0 + move.w (a0)+,d7 + move.l a0,-$C(a6) + bra.s loc_12A7B8 +loc_12A778 + move.l -$C(a6),d0 + addq.l #8,-$C(a6) + movea.l d0,a0 + lea -8(a6),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + moveq #0,d0 + move.w -8(a6),d0 + move.w #$8000,d1 + and.w d0,d1 + beq.s loc_12A7A4 + move.l a3,d0 + add.l d0,-4(a6) + andi.w #$7FFF,-8(a6) +loc_12A7A4 + subq.l #2,sp + move.l 8(a6),-(sp) + pea -8(a6) + moveq #0,d0 + move.b d0,-(sp) + _SndDoCommand + addq.w #2,sp + subq.w #1,d7 +loc_12A7B8 + tst.w d7 + bgt.s loc_12A778 + moveq #0,d0 +loc_12A7BE + movem.l -$20(a6),d3/d6-d7/a3-a4 + unlk a6 + rts + + +_R25B6 Proc Export + Import _R2544 + Import _R259E + + link a6,#-4 + movem.l a3-a4,-(sp) + move.l a1,d0 + movea.l d0,a3 + move.l $16(a3),-4(a6) + movea.l $1A(a3),a4 + move.l a4,-(sp) + move.l -4(a6),-(sp) + jsr _R259E + tst.l $10(a4) + addq.w #8,sp + ble.s loc_12A81E + move.l $10(a4),$C(a4) + move.l a3,-(sp) + move.l $10(a4),d1 + move.l d1,d0 + mulu.w #$1F4,d1 + swap d0 + mulu.w #$1F4,d0 + swap d0 + clr.w d0 + add.l d0,d1 + move.l d1,-(sp) + move.l a4,-(sp) + moveq #0,d0 + move.l d0,-(sp) + jsr _R2544 + lea $10(sp),sp +loc_12A81E + movem.l -$C(a6),a3-a4 + unlk a6 + rts + + +_R25BC Proc Export + Import _R253E + Import _R2592 + Import _R2598 + Import NGETTRAPADDRESS + + link a6,#-4 + movem.l d7/a3-a4,-(sp) + move.l a1,d0 + move.l d0,-4(a6) + movea.l d0,a0 + movea.l $16(a0),a4 + movea.l -4(a6),a0 + movea.l $1A(a0),a3 + move.l $10(a4),d7 + moveq #0,d0 + move.l d0,$10(a4) + tst.l d7 + bne.s loc_12A884 + movea.l 4(a4),a3 + bra.s loc_12A85A +loc_12A858 + movea.l (a3),a3 +loc_12A85A + tst.l (a3) + bne.s loc_12A858 + move.l $42(a3),-(sp) + jsr _R253E + addq.w #4,sp + bra.s loc_12A884 +loc_12A86A + move.l a4,-(sp) + jsr _R2592 + tst.b d0 + addq.w #4,sp + beq.s loc_12A884 + tst.l d7 + beq.s loc_12A892 + move.l a4,-(sp) + jsr _R2598 + addq.w #4,sp + bra.s loc_12A892 +loc_12A884 + tst.l $10(a4) + bne.s loc_12A892 + moveq #$4C,d0 + and.w $1C(a4),d0 + beq.s loc_12A86A +loc_12A892 + movem.l -$10(a6),d7/a3-a4 + unlk a6 + rts + + +IsDeadProcess Proc Export + Import NGETTRAPADDRESS + + link a6,#-$A + clr.b -1(a6) + subq.l #4,sp + move.w #$A89F,-(sp) + moveq #1,d0 + move.b d0,-(sp) + jsr NGETTRAPADDRESS + subq.l #4,sp + move.w #$A88F,-(sp) + moveq #1,d0 + move.b d0,-(sp) + jsr NGETTRAPADDRESS + move.l (sp)+,d0 + cmp.l (sp)+,d0 + beq.s loc_12A8EC + subq.l #2,sp + pea -$A(a6) + move.w #$37,-(sp) + _OSDispatch + tst.w (sp)+ + bne.s loc_12A8EC + subq.l #2,sp + pea -$A(a6) + pea 8(a6) + pea -1(a6) + move.w #$3D,-(sp) + _OSDispatch + addq.w #2,sp +loc_12A8EC + move.b -1(a6),d0 + unlk a6 + rts + + +__SNDAPPDEAD PatchProc _SndAppDead,(Plus,SE,II,Portable,IIci,notAUX) + Import _R2556 + Import IsDeadProcess + + link a6,#-4 + movem.l d3/a3-a4,-(sp) + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l (a0),a3 + bra.s loc_12A93C +loc_12A908 + move.l (a3),-4(a6) + movea.l 4(a3),a4 + bra.s loc_12A934 +loc_12A912 + lea $84(a4),a0 + move.l -(a0),-(sp) + move.l -(a0),-(sp) + jsr IsDeadProcess + tst.b d0 + addq.w #8,sp + beq.s loc_12A932 + subq.l #2,sp + move.l a3,-(sp) + moveq #1,d0 + move.b d0,-(sp) + _SndDisposeChannel + addq.w #2,sp + bra.s loc_12A938 +loc_12A932 + movea.l (a4),a4 +loc_12A934 + move.l a4,d0 + bne.s loc_12A912 +loc_12A938 + movea.l -4(a6),a3 +loc_12A93C + move.l a3,d0 + bne.s loc_12A908 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l $26(a0),a0 + movea.l 2(a0),a3 + bra.s loc_12A976 +loc_12A952 + movea.l (a3),a4 + lea $5C(a3),a0 + move.l -(a0),-(sp) + move.l -(a0),-(sp) + jsr IsDeadProcess + tst.b d0 + addq.w #8,sp + beq.s loc_12A974 + subq.l #2,sp + move.l a3,-(sp) + move.l #$21C0014,d0 + _SoundDispatch + addq.w #2,sp +loc_12A974 + movea.l a4,a3 +loc_12A976 + move.l a3,d0 + bne.s loc_12A952 + movea.l $2B6,a0 + movea.l $110(a0),a0 + tst.w 4(a0) + bne.s loc_12A98C + jsr _R2556 +loc_12A98C + movem.l -$10(a6),d3/a3-a4 + unlk a6 + rts + + +__SNDDOCOMMAND PatchProc _SndDoCommand,(Plus,SE,II,Portable,IIci,notAUX) + Import _R2544 + Import _R255C + Import _R257A + Import _R261C + + link a6,#0 + movem.l d6-d7/a3-a4,-(sp) + move.b 8(a6),d6 + movea.l $E(a6),a3 + move.l a3,-(sp) + jsr _R261C + tst.b d0 + addq.w #4,sp + beq.s loc_12A9BA + move.w #$FF33,$12(a6) + bra.s loc_12AA2C +loc_12A9BA + movea.l 4(a3),a4 + move.l a4,d0 + bne.s loc_12A9CC + move.w #$FF33,$12(a6) + bra.s loc_12AA2C +loc_12A9CA + movea.l (a4),a4 +loc_12A9CC + tst.l (a4) + bne.s loc_12A9CA +loc_12A9D0 + move.l $A(a6),-(sp) + move.l a3,-(sp) + jsr _R257A + move.b d0,d7 + addq.w #8,sp + beq.s loc_12A9E4 + tst.b d6 + beq.s loc_12A9D0 +loc_12A9E4 + jsr _R255C + move.w d0,d6 + tst.l $10(a3) + bgt.s loc_12AA14 + moveq #$4C,d0 + and.w $1C(a3),d0 + bne.s loc_12AA14 + moveq #$FFFFFFFF,d0 + cmp.w $20(a3),d0 + beq.s loc_12AA14 + move.l $42(a4),-(sp) + moveq #0,d0 + move.l d0,-(sp) + move.l d0,-(sp) + move.l a3,-(sp) + jsr _R2544 + lea $10(sp),sp +loc_12AA14 + ext.l d6 + move.l d6,d0 + move d0,sr + tst.b d7 + beq.s loc_12AA26 + move.l #$FFFFFF35,d0 + bra.s loc_12AA28 +loc_12AA26 + moveq #0,d0 +loc_12AA28 + move.w d0,$12(a6) +loc_12AA2C + movem.l -$10(a6),d6-d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + lea $A(sp),sp + jmp (a0) + + +__SNDDOIMMEDIATE PatchProc _SndDoImmediate,(Plus,SE,II,Portable,IIci,notAUX) + Import _R253E + Import _R255C + Import _R258C_OTHERNAME + Import _R261C + + link a6,#-8 + movem.l d7/a3-a4,-(sp) + movea.l $C(a6),a3 + move.l a3,-(sp) + jsr _R261C + tst.b d0 + addq.w #4,sp + beq.s loc_12AA5C + move.w #$FF33,$10(a6) + bra.s loc_12AAB2 +loc_12AA5C + movea.l 8(a6),a0 + moveq #0,d0 + move.w (a0),d0 + moveq #$28,d1 + cmp.l d0,d1 + bne.s loc_12AA84 + movea.l 4(a3),a4 + bra.s loc_12AA72 +loc_12AA70 + movea.l (a4),a4 +loc_12AA72 + tst.l (a4) + bne.s loc_12AA70 + move.l a4,d0 + beq.s loc_12AA84 + move.l $42(a4),-(sp) + jsr _R253E + addq.w #4,sp +loc_12AA84 + movea.l 8(a6),a0 + lea -8(a6),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + jsr _R255C + move.w d0,d7 + move.l 4(a3),-(sp) + pea -8(a6) + move.l a3,-(sp) + jsr _R258C_OTHERNAME + ext.l d7 + move.l d7,d0 + move d0,sr + clr.w $10(a6) + lea $C(sp),sp +loc_12AAB2 + movem.l -$14(a6),d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #8,sp + jmp (a0) + + +__SNDNEWCHANNEL PatchProc _SndNewChannel,(Plus,SE,II,Portable,IIci,notAUX) +; Touched by AIncludes Release Notes, 5/27/92 10:41:35 PM + Import _R255C + Import _R2568 + Import _R2574 + Import _R25AA + + link a6,#-4 + movem.l d3/d5-d7/a3-a4,-(sp) + move.w $10(a6),d5 + tst.l $12(a6) + bne.s loc_12AADC + move.w #$FF33,$16(a6) + bra.w loc_12AC74 +loc_12AADC + movea.l $2B6,a0 + movea.l $110(a0),a0 + tst.l $1E(a0) + beq.s loc_12AB10 + move.l #'snd ',d0 + lea -4(a6),a0 + movea.l a0,a1 + _Gestalt + move.l a0,(a1) + tst.w d0 + bne.s loc_12AB10 + moveq #6,d0 + and.l -4(a6),d0 + bne.s loc_12AB10 + move.w #$FF37,$16(a6) + bra.w loc_12AC74 +loc_12AB10 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l (a0),a4 + bra.s loc_12AB42 +loc_12AB1C + movea.l (a4),a3 + movea.l $12(a6),a0 + cmpa.l (a0),a4 + bne.s loc_12AB30 + move.w #$FF2F,$16(a6) + bra.w loc_12AC74 +loc_12AB30 + moveq #$20,d0 + and.w $1C(a4),d0 + beq.s loc_12AB40 + move.l a4,-(sp) + jsr _R25AA + addq.w #4,sp +loc_12AB40 + movea.l a3,a4 +loc_12AB42 + move.l a4,d0 + bne.s loc_12AB1C + clr.b d7 + movea.l $12(a6),a0 + movea.l (a0),a4 + move.l a4,d0 + bne.s loc_12AB80 + move.l #$424,d0 + _NewPtrSysClear + movea.l $12(a6),a1 + move.l a0,(a1) + movea.l a0,a4 + move.l a4,d0 + bne.s loc_12AB70 + move.w $220,$16(a6) + bra.w loc_12AC74 +loc_12AB70 + moveq #1,d7 + move.w #1,$1C(a4) + move.w #$80,$1E(a4) + bra.s loc_12AB94 +loc_12AB80 + tst.w $1E(a4) + bne.s loc_12AB90 + move.w #$FF33,$16(a6) + bra.w loc_12AC74 +loc_12AB90 + clr.w $1C(a4) +loc_12AB94 + moveq #0,d0 + move.l d0,4(a4) + move.l 8(a6),8(a4) + move.l d0,$C(a4) + move.l d0,$10(a4) + move.w #$FFFF,$20(a4) + clr.w $22(a4) + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l (a0),(a4) + movea.l $2B6,a0 + movea.l $110(a0),a0 + addq.w #1,4(a0) + tst.w d5 + beq.s off_12ABFA + subq.l #2,sp + move.l a4,-(sp) + moveq #0,d0 + move.l d0,-(sp) + move.w d5,-(sp) + move.l $C(a6),-(sp) + _SndAddModifier + move.w (sp)+,d6 + beq.s off_12ABFA + tst.b d7 + beq.s loc_12ABEC + movea.l $12(a6),a0 + moveq #0,d0 + move.l d0,(a0) +loc_12ABEC + move.l a4,-(sp) + jsr _R25AA + move.w d6,$16(a6) + addq.w #4,sp + bra.s loc_12AC74 +off_12ABFA jsr _R255C + move.w d0,d5 + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l a4,(a0) + ext.l d5 + move.l d5,d0 + move d0,sr + movea.l $2B6,a0 + movea.l $110(a0),a0 + moveq #1,d0 + cmp.w 4(a0),d0 + bge.s loc_12AC70 + jsr _R2568 + tst.w d0 + beq.s loc_12AC70 + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.w 4(a0),d0 + ext.l d0 + move.l d0,-(sp) + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l 6(a0),-(sp) + jsr _R2574 + tst.w d0 + sne d0 + neg.b d0 + ext.w d0 + move.w d0,d6 + addq.w #8,sp + beq.s loc_12AC70 + tst.b d7 + beq.s loc_12AC62 + movea.l $12(a6),a0 + moveq #0,d0 + move.l d0,(a0) +loc_12AC62 + move.l a4,-(sp) + jsr _R25AA + move.w d6,$16(a6) + addq.w #4,sp + bra.s loc_12AC74 +loc_12AC70 + clr.w $16(a6) +loc_12AC74 + movem.l -$1C(a6),d3/d5-d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + lea $E(sp),sp + jmp (a0) + + +__SNDDISPOSECHANNEL PatchProc _SndDisposeChannel,(Plus,SE,II,Portable,IIci,notAUX) + Import _R25AA + Import _R261C + + link a6,#-$C + move.l a4,-(sp) + movea.l $A(a6),a4 + move.l a4,-(sp) + jsr _R261C + tst.b d0 + addq.w #4,sp + beq.s loc_12ACA2 + move.w #$FF33,$E(a6) + bra.s loc_12AD10 +loc_12ACA2 + tst.l 4(a4) + beq.s loc_12ACF8 + moveq #2,d0 + and.w $1C(a4),d0 + bne.s loc_12ACF8 + tst.b 8(a6) + beq.s loc_12ACDA + move.w #4,-$C(a6) + subq.l #2,sp + move.l a4,-(sp) + pea -$C(a6) + _SndDoImmediate + move.w #3,-$C(a6) + subq.l #2,sp + move.l a4,-(sp) + pea -$C(a6) + _SndDoImmediate + addq.w #4,sp + bra.s loc_12ACF0 +loc_12ACDA + move.w #3,-$C(a6) + subq.l #2,sp + move.l a4,-(sp) + pea -$C(a6) + moveq #0,d0 + move.b d0,-(sp) + _SndDoCommand + addq.w #2,sp +loc_12ACF0 + moveq #2,d0 + and.w $1C(a4),d0 + beq.s loc_12ACF0 +loc_12ACF8 + movea.w #3,a0 + lea -4(a6),a1 + _Delay + move.l d0,(a1) + move.l a4,-(sp) + jsr _R25AA + clr.w $E(a6) + addq.w #4,sp +loc_12AD10 + movea.l -$10(a6),a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #6,sp + jmp (a0) + + +__SNDPLAY PatchProc _SndPlay,(Plus,SE,II,Portable,IIci,notAUX) + Import _R2568 + Import _R2574 + Import _R25AA + Import _R25B0 + Import _R261C + + link a6,#-$C + movem.l d4-d7/a3-a4,-(sp) + move.b 8(a6),d4 + movea.l $E(a6),a3 + movea.l $A(a6),a4 + move.l a3,d0 + seq d0 + andi.w #1,d0 + ext.l d0 + move.b d0,d6 + beq.s loc_12AD40 + clr.b d4 +loc_12AD40 + move.l a4,d0 + beq.s loc_12AD48 + tst.l (a4) + bne.s loc_12AD52 +loc_12AD48 + move.w #$FF34,$12(a6) + bra.w loc_12AF1E +loc_12AD52 + movea.l (a4),a0 + moveq #1,d0 + cmp.w (a0),d0 + beq.s loc_12AD6A + moveq #2,d0 + cmp.w (a0),d0 + beq.s loc_12AD6A + move.w #$FF32,$12(a6) + bra.w loc_12AF1E +loc_12AD6A + movea.l a4,a0 + _HGetState + move.b d0,d5 + movea.l a4,a0 + _HLock + tst.b d6 + beq.s loc_12ADA2 + moveq #0,d0 + move.l d0,-$C(a6) + subq.l #2,sp + pea -$C(a6) + moveq #0,d0 + move.w d0,-(sp) + moveq #0,d1 + move.l d1,-(sp) + move.l d1,-(sp) + _SndNewChannel + move.w (sp)+,d7 + beq.s loc_12ADC2 + movea.l a4,a0 + move.b d5,d0 + _HSetState + move.w d7,$12(a6) + bra.w loc_12AF1E +loc_12ADA2 + move.l a3,-(sp) + jsr _R261C + tst.b d0 + addq.w #4,sp + beq.s loc_12ADBE + movea.l a4,a0 + move.b d5,d0 + _HSetState + move.w #$FF33,$12(a6) + bra.w loc_12AF1E +loc_12ADBE + move.l a3,-$C(a6) +loc_12ADC2 + movea.l (a4),a0 + moveq #1,d0 + cmp.w (a0),d0 + bne.w loc_12AE66 + tst.w 2(a0) + bne.s loc_12AE38 + movea.l -$C(a6),a0 + tst.l 4(a0) + bne.s loc_12AE38 + subq.l #2,sp + move.l -$C(a6),-(sp) + moveq #0,d0 + move.l d0,-(sp) + moveq #1,d1 + move.w d1,-(sp) + move.l d0,-(sp) + _SndAddModifier + move.w (sp)+,d7 + beq.s loc_12AE38 + tst.b d6 + beq.s loc_12AE00 + move.l -$C(a6),-(sp) + jsr _R25AA + addq.w #4,sp +loc_12AE00 + jsr _R2568 + tst.w d0 + beq.s loc_12AE2A + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.w 4(a0),d0 + ext.l d0 + move.l d0,-(sp) + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l 6(a0),-(sp) + jsr _R2574 + addq.w #8,sp +loc_12AE2A + movea.l a4,a0 + move.b d5,d0 + _HSetState + move.w d7,$12(a6) + bra.w loc_12AF1E +loc_12AE38 + move.l a4,-(sp) + move.l -$C(a6),-(sp) + jsr _R25B0 + move.w d0,d7 + addq.w #8,sp + beq.w loc_12AED8 + tst.b d6 + beq.s loc_12AE58 + move.l -$C(a6),-(sp) + jsr _R25AA + addq.w #4,sp +loc_12AE58 + movea.l a4,a0 + move.b d5,d0 + _HSetState + move.w d7,$12(a6) + bra.w loc_12AF1E +loc_12AE66 + subq.l #2,sp + move.l -$C(a6),-(sp) + moveq #0,d0 + move.l d0,-(sp) + moveq #5,d1 + move.w d1,-(sp) + move.l d0,-(sp) + _SndAddModifier + move.w (sp)+,d7 + beq.s loc_12AE98 + tst.b d6 + beq.s loc_12AE8A + move.l -$C(a6),-(sp) + jsr _R25AA + addq.w #4,sp +loc_12AE8A + movea.l a4,a0 + move.b d5,d0 + _HSetState + move.w d7,$12(a6) + bra.w loc_12AF1E +loc_12AE98 + move.w #$51,-8(a6) + clr.w -6(a6) + movea.l (a4),a3 + addq.w #4,a3 + move.l a3,d0 + addq.l #2,d0 + move.w (a3),d1 + ext.l d1 + asl.l #3,d1 + add.l d0,d1 + move.l d1,-4(a6) + subq.l #2,sp + move.l -$C(a6),-(sp) + pea -8(a6) + moveq #0,d0 + move.b d0,-(sp) + _SndDoCommand + move.w (sp)+,d7 + beq.s loc_12AED8 + tst.b d6 + beq.s loc_12AED8 + move.l -$C(a6),-(sp) + jsr _R25AA + addq.w #4,sp +loc_12AED8 + tst.b d4 + bne.s loc_12AF1A + tst.b d6 + beq.s loc_12AEF0 + subq.l #2,sp + move.l -$C(a6),-(sp) + moveq #0,d0 + move.b d0,-(sp) + _SndDisposeChannel + move.w (sp)+,d7 + bra.s loc_12AF14 +loc_12AEF0 + move.w #3,-8(a6) + subq.l #2,sp + move.l -$C(a6),-(sp) + pea -8(a6) + moveq #0,d0 + move.b d0,-(sp) + _SndDoCommand + addq.w #2,sp +loc_12AF08 + movea.l -$C(a6),a0 + moveq #2,d0 + and.w $1C(a0),d0 + beq.s loc_12AF08 +loc_12AF14 + movea.l a4,a0 + move.b d5,d0 + _HSetState +loc_12AF1A + move.w d7,$12(a6) +loc_12AF1E + movem.l -$24(a6),d4-d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + lea $A(sp),sp + jmp (a0) + + +__SNDCONTROL PatchProc _SndControl,(Plus,SE,II,Portable,IIci,notAUX) + Import _R2568 + Import _R2586 + + link a6,#-4 + movem.l d5-d7/a3-a4,-(sp) + movea.l 8(a6),a3 + move.w $C(a6),d7 + beq.w loc_12AFEC + move.w d7,d6 + cmpi.w #$800,d7 + bge.s loc_12AF74 + jsr _R2568 + tst.w d0 + beq.s loc_12AF70 + movea.l $2B6,a0 + movea.l $110(a0),a0 + moveq #0,d0 + move.b $2E(a0),d0 + tst.l d0 + beq.s loc_12AF6A + cmpi.w #5,d7 + bne.s loc_12AF70 +loc_12AF6A + addi.w #$800,d6 + bra.s loc_12AF74 +loc_12AF70 + addi.w #$1000,d6 +loc_12AF74 + moveq #0,d5 + move.b $A5E,d5 + moveq #1,d0 + move.b d0,-(sp) + _SetResLoad + subq.l #4,sp + move.l #'snth',-(sp) + move.w d6,-(sp) + _GetResource + movea.l (sp)+,a4 + move.l a4,d0 + bne.s loc_12AFC0 + subq.l #4,sp + move.l #'snth',-(sp) + move.w d7,-(sp) + _GetResource + movea.l (sp)+,a4 + move.l a4,d0 + bne.s loc_12AFC0 + subq.l #2,sp + _ResError + move.w (sp)+,d7 + beq.s loc_12AFB0 + move.w d7,d0 + bra.s loc_12AFB4 +loc_12AFB0 + move.w #$FF34,d0 +loc_12AFB4 + move.w d0,d7 + move.b d5,-(sp) + _SetResLoad + move.w d7,$E(a6) + bra.s loc_12AFFC +loc_12AFC0 + move.b d5,-(sp) + _SetResLoad + movea.l a4,a0 + _HGetState + move.b d0,d5 + movea.l a4,a0 + _HLock + move.l (a4),-4(a6) + subq.l #2,sp + moveq #0,d0 + move.l d0,-(sp) + move.l a3,-(sp) + move.l d0,-(sp) + movea.l -4(a6),a0 + jsr (a0) + movea.l a4,a0 + move.b d5,d0 + _HSetState + addq.w #2,sp + bra.s loc_12AFF8 +loc_12AFEC + move.l a3,-(sp) + moveq #0,d0 + move.l d0,-(sp) + jsr _R2586 + addq.w #8,sp +loc_12AFF8 + clr.w $E(a6) +loc_12AFFC + movem.l -$18(a6),d5-d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #6,sp + jmp (a0) + + +__SNDADDMODIFIER PatchProc _SndAddModifier,(Plus,SE,II,Portable,IIci,notAUX) + Import _R255C + Import _R2568 + Import _R258C_OTHERNAME + Import _R25A4 + Import _R25B6 + Import _R25BC + Import NGETTRAPADDRESS + + link a6,#-$C + movem.l d3-d7/a3-a4,-(sp) + move.l 8(a6),d5 + move.w $C(a6),d7 + tst.l $12(a6) + bne.s loc_12B02A + move.w #$FF33,$16(a6) + bra.w loc_12B3AE +loc_12B02A + tst.l $E(a6) + bne.w loc_12B146 + tst.w d7 + bne.s loc_12B03E + clr.w $16(a6) + bra.w loc_12B3AE +loc_12B03E + tst.b $27E + beq.s loc_12B0BC + tst.b $27E + bge.s loc_12B054 + move.w #$FF37,$16(a6) + bra.w loc_12B3AE +loc_12B054 + cmpi.w #1,d7 + bne.s loc_12B064 + move.w #$FF37,$16(a6) + bra.w loc_12B3AE +loc_12B064 + cmpi.w #5,d7 + bne.s loc_12B07C + jsr _R2568 + tst.w d0 + bne.s loc_12B07C + move.w #$FF37,$16(a6) + bra.w loc_12B3AE +loc_12B07C + cmpi.w #3,d7 + beq.s loc_12B088 + cmpi.w #5,d7 + bne.s loc_12B09C +loc_12B088 + move.b $27E,d0 + ext.w d0 + cmp.w d0,d7 + beq.s loc_12B09C + move.w #$FF37,$16(a6) + bra.w loc_12B3AE +loc_12B09C + cmpi.w #3,d7 + bne.s loc_12B0BC + movea.l $2B6,a0 + movea.l $110(a0),a0 + moveq #4,d0 + cmp.w 4(a0),d0 + bge.s loc_12B0BC + move.w #$FF37,$16(a6) + bra.w loc_12B3AE +loc_12B0BC + move.w d7,d6 + cmpi.w #$800,d7 + bge.s loc_12B0EE + jsr _R2568 + tst.w d0 + beq.s loc_12B0EA + movea.l $2B6,a0 + movea.l $110(a0),a0 + moveq #0,d0 + move.b $2E(a0),d0 + tst.l d0 + beq.s loc_12B0E4 + cmpi.w #5,d7 + bne.s loc_12B0EA +loc_12B0E4 + addi.w #$800,d6 + bra.s loc_12B0EE +loc_12B0EA + addi.w #$1000,d6 +loc_12B0EE + moveq #0,d4 + move.b $A5E,d4 + moveq #1,d0 + move.b d0,-(sp) + _SetResLoad + subq.l #4,sp + move.l #'snth',-(sp) + move.w d6,-(sp) + _GetResource + movea.l (sp)+,a3 + move.l a3,d0 + bne.s loc_12B142 + cmpi.w #$800,d7 + bge.s loc_12B120 + subq.l #4,sp + move.l #'snth',-(sp) + move.w d7,-(sp) + _GetResource + movea.l (sp)+,a3 +loc_12B120 + move.l a3,d0 + bne.s loc_12B142 + subq.l #2,sp + _ResError + move.w (sp)+,d6 + beq.s loc_12B130 + move.w d6,d0 + bra.s loc_12B134 +loc_12B130 + move.w #$FF34,d0 +loc_12B134 + move.w d0,d6 + move.b d4,-(sp) + _SetResLoad + move.w d6,$16(a6) + bra.w loc_12B3AE +loc_12B142 + move.b d4,-(sp) + _SetResLoad +loc_12B146 + movea.l $12(a6),a0 + movea.l 4(a0),a4 + bra.s loc_12B170 +loc_12B150 + move.l 4(a4),d0 + _StripAddress + move.l d0,-$C(a6) + move.l (a3),d0 + _StripAddress + move.l -$C(a6),d1 + cmp.l d1,d0 + bne.s loc_12B16E + clr.w $16(a6) + bra.w loc_12B3AE +loc_12B16E + movea.l (a4),a4 +loc_12B170 + move.l a4,d0 + bne.s loc_12B150 + tst.l $E(a6) + bne.s loc_12B17E + movea.l a3,a0 + _HLock +loc_12B17E + move.l #$84,d0 + _NewPtrSysClear + movea.l a0,a4 + move.l a4,d0 + bne.s loc_12B1AE + move.w $220,d6 + tst.l $E(a6) + bne.s loc_12B1A6 + move.l (a3),-(sp) + jsr _R25A4 + tst.l d0 + addq.w #4,sp + bne.s loc_12B1A6 + movea.l a3,a0 + _HUnlock +loc_12B1A6 + move.w d6,$16(a6) + bra.w loc_12B3AE +loc_12B1AE + moveq #$1E,d0 + _NewPtrSysClear + move.l a0,$3E(a4) + move.l a0,d0 + bne.s loc_12B1DC + move.w $220,d6 + tst.l $E(a6) + bne.s loc_12B1D4 + move.l (a3),-(sp) + jsr _R25A4 + tst.l d0 + addq.w #4,sp + bne.s loc_12B1D4 + movea.l a3,a0 + _HUnlock +loc_12B1D4 + move.w d6,$16(a6) + bra.w loc_12B3AE +loc_12B1DC + lea _R25B6,a0 + movea.l $3E(a4),a1 + move.l a0,6(a1) + movea.l $3E(a4),a0 + move.l $12(a6),$16(a0) + movea.l $3E(a4),a0 + move.l a4,$1A(a0) + moveq #$1E,d0 + _NewPtrSysClear + move.l a0,$42(a4) + move.l a0,d0 + bne.s loc_12B232 + move.w $220,d6 + tst.l $E(a6) + bne.s loc_12B220 + move.l (a3),-(sp) + jsr _R25A4 + tst.l d0 + addq.w #4,sp + bne.s loc_12B220 + movea.l a3,a0 + _HUnlock +loc_12B220 + movea.l $3E(a4),a0 + _DisposePtr + movea.l a4,a0 + _DisposePtr + move.w d6,$16(a6) + bra.w loc_12B3AE +loc_12B232 + lea _R25BC,a0 + movea.l $42(a4),a1 + move.l a0,6(a1) + movea.l $42(a4),a0 + move.l $12(a6),$16(a0) + tst.l $E(a6) + bne.s loc_12B258 + move.l (a3),4(a4) + move.l a3,$16(a4) + bra.s loc_12B25E +loc_12B258 + move.l $E(a6),4(a4) +loc_12B25E + cmpi.w #5,d7 + bne.w loc_12B300 + jsr _R2568 + tst.w d0 + beq.w loc_12B300 + move.w #$1A,-8(a6) + move.l d5,-4(a6) + subq.l #2,sp + moveq #5,d0 + move.w d0,-(sp) + pea -8(a6) + _SndControl + move.w (sp)+,d6 + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.w -6(a6),d0 + cmp.w $16(a0),d0 + ble.s loc_12B2DA + movea.l $2B6,a0 + movea.l $110(a0),a0 + moveq #1,d0 + cmp.w 4(a0),d0 + bge.s loc_12B2DA + tst.l $E(a6) + bne.s loc_12B2C0 + move.l (a3),-(sp) + jsr _R25A4 + tst.l d0 + addq.w #4,sp + bne.s loc_12B2C0 + movea.l a3,a0 + _HUnlock +loc_12B2C0 + movea.l $3E(a4),a0 + _DisposePtr + movea.l $42(a4),a0 + _DisposePtr + movea.l a4,a0 + _DisposePtr + move.w #$FF37,$16(a6) + bra.w loc_12B3AE +loc_12B2DA + move.w #$1B,-8(a6) + move.l d5,-4(a6) + subq.l #2,sp + moveq #5,d0 + move.w d0,-(sp) + pea -8(a6) + _SndControl + move.w (sp)+,d6 + move.w -6(a6),d0 + ext.l d0 + move.l d0,$68(a4) + move.l d5,$64(a4) +loc_12B300 + move.w #1,-8(a6) + move.l d5,-4(a6) + move.l a4,-(sp) + pea -8(a6) + move.l $12(a6),-(sp) + jsr _R258C_OTHERNAME + moveq #$FFFFFFFF,d0 + cmp.l -4(a6),d0 + lea $C(sp),sp + bne.s loc_12B352 + tst.l $E(a6) + bne.s loc_12B33A + move.l (a3),-(sp) + jsr _R25A4 + tst.l d0 + addq.w #4,sp + bne.s loc_12B33A + movea.l a3,a0 + _HUnlock +loc_12B33A + movea.l $3E(a4),a0 + _DisposePtr + movea.l $42(a4),a0 + _DisposePtr + movea.l a4,a0 + _DisposePtr + move.w #$FF94,$16(a6) + bra.s loc_12B3AE +loc_12B352 + movea.l $3E(a4),a0 + _InsXTime + movea.l $42(a4),a0 + _InsXTime + subq.l #4,sp + move.w #$A89F,-(sp) + moveq #1,d0 + move.b d0,-(sp) + jsr NGETTRAPADDRESS + subq.l #4,sp + move.w #$A88F,-(sp) + moveq #1,d0 + move.b d0,-(sp) + jsr NGETTRAPADDRESS + move.l (sp)+,d0 + cmp.l (sp)+,d0 + beq.s loc_12B38E + subq.l #2,sp + pea $7C(a4) + move.w #$37,-(sp) + _OSDispatch + addq.w #2,sp +loc_12B38E + jsr _R255C + move.w d0,d5 + movea.l $12(a6),a0 + move.l 4(a0),(a4) + movea.l $12(a6),a0 + move.l a4,4(a0) + ext.l d5 + move.l d5,d0 + move d0,sr + clr.w $16(a6) +loc_12B3AE + movem.l -$28(a6),d3-d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + lea $E(sp),sp + jmp (a0) + + +__SNDSOUNDMANAGERVERSION Proc Export + link a6,#0 + move.l #$2018000,8(a6) + unlk a6 + rts + + +Version Proc Export + link a6,#0 + move.l #$1018000,8(a6) + unlk a6 + rts + + +__SNDCHANNELSTATUS Proc Export + Import _R261C + Import _R2634 + Import _R263A + Import _UTOX + + link a6,#-$24 + movem.l a3-a4,-(sp) + movea.l 8(a6),a3 + moveq #$18,d0 + cmp.w $C(a6),d0 + beq.s loc_12B3FC + move.w #$FFCE,$12(a6) + bra.w loc_12B566 +loc_12B3FC + move.l $E(a6),-(sp) + jsr _R261C + tst.b d0 + addq.w #4,sp + beq.s loc_12B414 + move.w #$FF33,$12(a6) + bra.w loc_12B566 +loc_12B414 + move.l $E(a6),-$1A(a6) + bne.s loc_12B426 + move.w #$FF33,$12(a6) + bra.w loc_12B566 +loc_12B426 + movea.l -$1A(a6),a0 + movea.l 4(a0),a4 + move.l a4,d0 + bne.s loc_12B43E + move.w #$FF33,$12(a6) + bra.w loc_12B566 +loc_12B43C + movea.l (a4),a4 +loc_12B43E + tst.l (a4) + bne.s loc_12B43C + moveq #5,d0 + cmp.b $27E,d0 + beq.s loc_12B46C + move.l #$FF,d0 + and.l 8(a4),d0 + move.b d0,$C(a3) + clr.w $E(a3) + moveq #0,d0 + move.l d0,(a3) + move.l d0,4(a3) + move.l d0,8(a3) + bra.w loc_12B54A +loc_12B46C + move.l 8(a4),-8(a6) + beq.s loc_12B48C + movea.l -8(a6),a0 + move.w $11A(a0),d0 + ext.l d0 + move.l d0,-(sp) + jsr _R2634 + move.l d0,$10(a3) + addq.w #4,sp + bra.s loc_12B492 +loc_12B48C + move.l $64(a4),$10(a3) +loc_12B492 + movea.l -8(a6),a0 + move.l (a0),-4(a6) + move.l $68(a4),$14(a3) + move.l -$1A(a6),-(sp) + jsr _R263A + move.l d0,-$16(a6) + movea.l d0,a0 + tst.b (a0) + addq.w #4,sp + bne.s loc_12B4DA + movea.l -4(a6),a0 + tst.w $1E(a0) + sne d0 + andi.w #1,d0 + ext.l d0 + move.b d0,$C(a3) + clr.w $E(a3) + moveq #0,d0 + move.l d0,(a3) + move.l d0,4(a3) + move.l d0,8(a3) + bra.s loc_12B54A +loc_12B4DA + movea.l -$16(a6),a0 + movea.l 8(a0),a4 + movea.l -4(a6),a0 + tst.w $1E(a0) + sne d0 + andi.w #1,d0 + ext.l d0 + move.b d0,$C(a3) + movea.l -$16(a6),a0 + move.b 3(a0),$E(a3) + clr.b $F(a3) + move.l $5E(a4),(a3) + move.l $62(a4),4(a3) + pea -$24(a6) + move.l $72(a4),-(sp) + jsr _UTOX + pea $4C(a4) + pea -$24(a6) + move.w #6,-(sp) + _Pack4 + lea -$24(a6),a0 + lea -$12(a6),a1 + move.l (a0)+,(a1)+ + move.l (a0)+,(a1)+ + move.w (a0)+,(a1)+ + subq.l #4,sp + pea -$12(a6) + _X2Fix + move.l $62(a4),d0 + sub.l (sp)+,d0 + move.l d0,8(a3) + addq.w #8,sp +loc_12B54A + movea.l $E(a6),a0 + moveq #$20,d0 + and.w $1C(a0),d0 + beq.s loc_12B55E + move.b #1,$D(a3) + bra.s loc_12B562 +loc_12B55E + clr.b $D(a3) +loc_12B562 + clr.w $12(a6) +loc_12B566 + movem.l -$2C(a6),a3-a4 + unlk a6 + movea.l (sp)+,a0 + lea $A(sp),sp + jmp (a0) + + +__SNDMANAGERSTATUS Proc Export + link a6,#-4 + movem.l d3/d6-d7/a3-a4,-(sp) + moveq #6,d0 + cmp.w $C(a6),d0 + beq.s loc_12B590 + move.w #$FFCE,$E(a6) + bra.w loc_12B654 +loc_12B590 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l 8(a6),a1 + move.w 4(a0),2(a1) + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l 8(a6),a1 + move.w $16(a0),(a1) + movea.l 8(a6),a0 + clr.w 4(a0) + clr.w d6 + clr.w d7 + moveq #5,d0 + cmp.b $27E,d0 + bne.s loc_12B622 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l (a0),a3 + bra.s loc_12B604 +loc_12B5D2 + movea.l 4(a3),a4 + move.l a4,d0 + beq.s loc_12B602 + bra.s loc_12B5DE +loc_12B5DC + movea.l (a4),a4 +loc_12B5DE + tst.l (a4) + bne.s loc_12B5DC + move.l 8(a4),-4(a6) + beq.s loc_12B602 + subq.l #2,sp + movea.l -4(a6),a0 + move.w $11A(a0),-(sp) + move.l #$240008,d0 + _SoundDispatch + add.w (sp)+,d7 + move.w d6,d0 + addq.w #1,d6 +loc_12B602 + movea.l (a3),a3 +loc_12B604 + move.l a3,d0 + bne.s loc_12B5D2 + subq.l #2,sp + move.w d6,-(sp) + move.l #$280008,d0 + _SoundDispatch + move.w (sp)+,d0 + add.w d7,d0 + movea.l 8(a6),a0 + move.w d0,4(a0) + bra.s loc_12B650 +loc_12B622 + moveq #1,d0 + cmp.b $27E,d0 + bne.s loc_12B636 + movea.l 8(a6),a0 + move.w #$64,4(a0) + bra.s loc_12B650 +loc_12B636 + moveq #3,d0 + cmp.b $27E,d0 + bne.s loc_12B650 + movea.l 8(a6),a0 + moveq #$19,d0 + muls.w 2(a0),d0 + movea.l 8(a6),a0 + move.w d0,4(a0) +loc_12B650 + clr.w $E(a6) +loc_12B654 + movem.l -$18(a6),d3/d6-d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #6,sp + jmp (a0) + + +__SNDGETSYSBEEPSTATE Proc Export + link a6,#0 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l 8(a6),a1 + move.w $18(a0),(a1) + unlk a6 + move.l (sp)+,(sp) + rts + + +__SNDSETSYSBEEPSTATE Proc Export + link a6,#0 + move.l d7,-(sp) + move.w 8(a6),d7 + blt.s loc_12B68E + cmpi.w #1,d7 + ble.s loc_12B696 +loc_12B68E + move.w #$FFCE,$A(a6) + bra.s loc_12B6A6 +loc_12B696 + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.w d7,$18(a0) + clr.w $A(a6) +loc_12B6A6 + move.l -4(a6),d7 + unlk a6 + movea.l (sp)+,a0 + addq.w #2,sp + jmp (a0) + + +_R261C Proc Export + link a6,#0 + movem.l d3/a3-a4,-(sp) + movea.l 8(a6),a3 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l (a0),a4 + moveq #0,d3 + bra.s loc_12B6D6 +loc_12B6CC + cmpa.l a3,a4 + bne.s loc_12B6D4 + moveq #0,d0 + bra.s loc_12B6DC +loc_12B6D4 + movea.l (a4),a4 +loc_12B6D6 + cmp.l a4,d3 + bne.s loc_12B6CC + moveq #1,d0 +loc_12B6DC + movem.l -$C(a6),d3/a3-a4 + unlk a6 + rts + + +__SNDPLAYDOUBLEBUFFER Proc Export + Import _R261C + + link a6,#-8 + movem.l d7/a4,-(sp) + movea.l $C(a6),a4 + move.l a4,-(sp) + jsr _R261C + tst.b d0 + addq.w #4,sp + beq.s loc_12B706 + move.w #$FF33,$10(a6) + bra.s loc_12B72A +loc_12B706 + move.w #$54,-8(a6) + clr.w -6(a6) + move.l 8(a6),-4(a6) + subq.l #2,sp + move.l a4,-(sp) + pea -8(a6) + moveq #0,d0 + move.b d0,-(sp) + _SndDoCommand + move.w (sp)+,d7 + move.w d7,$10(a6) +loc_12B72A + movem.l -$10(a6),d7/a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #8,sp + jmp (a0) + + +__SND_NotSure Proc Export + Import _R2550 + + link a6,#0 + movem.l d7/a3-a4,-(sp) + move.w 8(a6),d7 + movea.l $2B6,a0 + movea.l $110(a0),a0 + tst.l $E(a0) + bne.s loc_12B794 + subq.l #4,sp + move.l #'bst#',-(sp) + moveq #1,d0 + move.w d0,-(sp) + _GetResource + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l (sp)+,$E(a0) + bne.s loc_12B778 + subq.l #2,sp + _ResError + move.w (sp)+,$A(a6) + bra.s loc_12B7F0 +loc_12B778 + movea.l $2B6,a0 + movea.l $110(a0),a0 + move.l $E(a0),-(sp) + _DetachResource + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l $E(a0),a0 + _HLock +loc_12B794 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l $E(a0),a3 + movea.l (a3),a4 + addq.w #2,a4 + bra.s loc_12B7E6 +loc_12B7A6 + cmp.w (a4),d7 + bne.s loc_12B7E2 + moveq #0,d0 + move.w $C(a4),d0 + moveq #$64,d1 + cmp.l d0,d1 + bne.s loc_12B7D2 + subq.l #2,sp + moveq #1,d0 + move.w d0,-(sp) + move.l #$280008,d0 + _SoundDispatch + move.w (sp)+,d0 + ext.l d0 + moveq #$64,d1 + sub.l d0,d1 + move.w d1,$A(a6) + bra.s loc_12B7F0 +loc_12B7D2 + pea $C(a4) + jsr _R2550 + move.w d0,$A(a6) + addq.w #4,sp + bra.s loc_12B7F0 +loc_12B7E2 + lea $14(a4),a4 +loc_12B7E6 + tst.l 2(a4) + bne.s loc_12B7A6 + clr.w $A(a6) +loc_12B7F0 + movem.l -$C(a6),d7/a3-a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #2,sp + jmp (a0) + + +__SND_NotSure2 Proc Export + link a6,#0 + movem.l d6-d7/a4,-(sp) + move.w 8(a6),d7 + movea.l $2B6,a0 + movea.l $110(a0),a0 + movea.l $1A(a0),a4 + move.l a4,d0 + beq.s loc_12B85C + tst.w d7 + beq.s loc_12B85C + move.w (a4),d6 + cmpi.w #5,d7 + bge.s loc_12B838 + ext.l d6 + ext.l d7 + move.l d6,d0 + add.l d7,d0 + add.l d0,d0 + move.w (a4,d0.l),$A(a6) + bra.s loc_12B860 +loc_12B838 + ext.l d6 + move.l d6,d0 + addq.l #5,d0 + add.l d0,d0 + move.w d7,d1 + muls.w (a4,d0.l),d1 + ext.l d6 + move.l d6,d0 + addq.l #6,d0 + add.l d0,d0 + move.w (a4,d0.l),d0 + ext.l d0 + add.l d1,d0 + move.w d0,$A(a6) + bra.s loc_12B860 +loc_12B85C + clr.w $A(a6) +loc_12B860 + movem.l -$C(a6),d6-d7/a4 + unlk a6 + movea.l (sp)+,a0 + addq.w #2,sp + jmp (a0) + + +_R2634 Proc Export + link a6,#0 + movem.l d6-d7,-(sp) + move.w $A(a6),d6 + moveq #3,d0 + and.w d6,d0 + add.w d0,d0 + move.w jtbl(d0),d0 +jtblbase equ *+2 + jmp jtblbase(d0) +jtbl dc.w loc_12B890-jtblbase + dc.w loc_12B898-jtblbase + dc.w loc_12B8A0-jtblbase + dc.w loc_12B8A8-jtblbase +loc_12B890 + move.l #$80,d7 + bra.s loc_12B8AE +loc_12B898 + move.l #$C0,d7 + bra.s loc_12B8AE +loc_12B8A0 + move.l #$82,d7 + bra.s loc_12B8AE +loc_12B8A8 + move.l #$83,d7 +loc_12B8AE + moveq #4,d0 + and.w d6,d0 + beq.s loc_12B8BA + ori.l #4,d7 +loc_12B8BA + moveq #8,d0 + and.w d6,d0 + beq.s loc_12B8C6 + ori.l #8,d7 +loc_12B8C6 + ext.l d6 + move.w #$FF00,d0 + and.w d6,d0 + moveq #0,d1 + move.w d0,d1 + or.l d1,d7 + move.l d7,d0 + movem.l -8(a6),d6-d7 + unlk a6 + rts + + +_R263A Proc Export + link a6,#0 + movem.l a3-a4,-(sp) + movea.l 8(a6),a0 + movea.l 4(a0),a4 + bra.s loc_12B8F4 +loc_12B8F2 + movea.l (a4),a4 +loc_12B8F4 + tst.l (a4) + bne.s loc_12B8F2 + lea $1A(a4),a3 + move.l a3,d0 + movem.l -8(a6),a3-a4 + unlk a6 + rts + + + END diff --git a/Toolbox/SoundMgr/Tables.3.a b/Toolbox/SoundMgr/Tables.3.a new file mode 100644 index 0000000..27e9ff8 --- /dev/null +++ b/Toolbox/SoundMgr/Tables.3.a @@ -0,0 +1,308 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Disassembled from scratch +; + + CASE OBJ + + +;31:2b9d0 +Table_1 Proc Export + dc.w $4000,$3D44,$3AA6,$3825,$35BF,$3373,$3140,$2F26 + dc.w $2D22,$2B34,$295C,$2797,$25E6,$2448,$22BB,$213F + dc.w $1FD4,$1E78,$1D2A,$1BEB,$1ABA,$1996,$187E,$1772 + dc.w $1672,$157C,$1491,$13B0,$12D9,$120B,$1145,$1089 + dc.w $0FD4,$0F27,$0E81,$0DE2,$0D4B,$0CB9,$0C2E,$0BA9 + dc.w $0B29,$0AAF,$0A3A,$09CB,$095F,$08F9,$0897,$0839 + dc.w $07DF,$0789,$0737,$06E8,$069C,$0654,$060F,$05CC + dc.w $058D,$0550,$0516,$04DF,$04A9,$0476,$0446,$0417 + dc.w $03EA,$03BF,$0396,$036F,$034A,$0326,$0303,$02E2 + dc.w $02C3,$02A5,$0288,$026C,$0252,$0238,$0220,$0209 + dc.w $01F2,$01DD,$01C9,$01B5,$01A3,$0191,$0180,$016F + dc.w $0160,$0151,$0142,$0134,$0127,$011B,$010F,$0103 + dc.w $00F8,$00ED,$00E3,$00DA,$00D0,$00C7,$00BF,$00B7 + dc.w $00AF,$00A7,$00A0,$009A,$0093,$008D,$0087,$0081 + dc.w $007B,$0076,$0071,$006C,$0068,$0063,$005F,$005B + dc.w $0057,$0053,$0050,$004C,$0049,$0046,$0043,$0040 + + +;31:2bad0 + Export Table_2 +Table_2 + dc.w $FFEE,$008C,$008C,$FFEE,$0000,$0000,$0000,$0000 + + +;31:2bae0 + Export Table_3 +Table_3 + dc.w $0040,$00D8,$FF27,$FFBF,$0000,$0000,$0000,$0000 + dc.w $0043,$00E2,$FF1D,$FFBC,$0000,$0000,$0000,$0000 + dc.w $0046,$00EC,$FF13,$FFB9,$0000,$0000,$0000,$0000 + dc.w $004A,$00F6,$FF09,$FFB5,$0000,$0000,$0000,$0000 + dc.w $004D,$0101,$FEFE,$FFB2,$0000,$0000,$0000,$0000 + dc.w $0050,$010C,$FEF3,$FFAF,$0000,$0000,$0000,$0000 + dc.w $0054,$0118,$FEE7,$FFAB,$0000,$0000,$0000,$0000 + dc.w $0058,$0126,$FED9,$FFA7,$0000,$0000,$0000,$0000 + dc.w $005C,$0133,$FECC,$FFA3,$0000,$0000,$0000,$0000 + dc.w $0060,$0141,$FEBE,$FF9F,$0000,$0000,$0000,$0000 + dc.w $0064,$014E,$FEB1,$FF9B,$0000,$0000,$0000,$0000 + dc.w $0068,$015E,$FEA1,$FF97,$0000,$0000,$0000,$0000 + dc.w $006D,$016D,$FE92,$FF92,$0000,$0000,$0000,$0000 + dc.w $0072,$017E,$FE81,$FF8D,$0000,$0000,$0000,$0000 + dc.w $0077,$018F,$FE70,$FF88,$0000,$0000,$0000,$0000 + dc.w $007C,$01A0,$FE5F,$FF83,$0000,$0000,$0000,$0000 + dc.w $0082,$01B2,$FE4D,$FF7D,$0000,$0000,$0000,$0000 + dc.w $0088,$01C6,$FE39,$FF77,$0000,$0000,$0000,$0000 + dc.w $008E,$01DB,$FE24,$FF71,$0000,$0000,$0000,$0000 + dc.w $0094,$01EF,$FE10,$FF6B,$0000,$0000,$0000,$0000 + dc.w $009B,$0207,$FDF8,$FF64,$0000,$0000,$0000,$0000 + dc.w $00A2,$021D,$FDE2,$FF5D,$0000,$0000,$0000,$0000 + dc.w $00A9,$0234,$FDCB,$FF56,$0000,$0000,$0000,$0000 + dc.w $00B0,$024E,$FDB1,$FF4F,$0000,$0000,$0000,$0000 + dc.w $00B9,$0269,$FD96,$FF46,$0000,$0000,$0000,$0000 + dc.w $00C1,$0284,$FD7B,$FF3E,$0000,$0000,$0000,$0000 + dc.w $00C9,$02A1,$FD5E,$FF36,$0000,$0000,$0000,$0000 + dc.w $00D2,$02BF,$FD40,$FF2D,$0000,$0000,$0000,$0000 + dc.w $00DC,$02DF,$FD20,$FF23,$0000,$0000,$0000,$0000 + dc.w $00E6,$02FF,$FD00,$FF19,$0000,$0000,$0000,$0000 + dc.w $00F0,$0321,$FCDE,$FF0F,$0000,$0000,$0000,$0000 + dc.w $00FB,$0346,$FCB9,$FF04,$0000,$0000,$0000,$0000 + dc.w $0106,$036C,$FC93,$FEF9,$0000,$0000,$0000,$0000 + dc.w $0112,$0392,$FC6D,$FEED,$0000,$0000,$0000,$0000 + dc.w $011E,$03BB,$FC44,$FEE1,$0000,$0000,$0000,$0000 + dc.w $012B,$03E5,$FC1A,$FED4,$0000,$0000,$0000,$0000 + dc.w $0138,$0411,$FBEE,$FEC7,$0000,$0000,$0000,$0000 + dc.w $0146,$0441,$FBBE,$FEB9,$0000,$0000,$0000,$0000 + dc.w $0155,$0472,$FB8D,$FEAA,$0000,$0000,$0000,$0000 + dc.w $0164,$04A4,$FB5B,$FE9B,$0000,$0000,$0000,$0000 + dc.w $0174,$04D9,$FB26,$FE8B,$0000,$0000,$0000,$0000 + dc.w $0184,$0511,$FAEE,$FE7B,$0000,$0000,$0000,$0000 + dc.w $0196,$054A,$FAB5,$FE69,$0000,$0000,$0000,$0000 + dc.w $01A8,$0587,$FA78,$FE57,$0000,$0000,$0000,$0000 + dc.w $01BB,$05C6,$FA39,$FE44,$0000,$0000,$0000,$0000 + dc.w $01CE,$0608,$F9F7,$FE31,$0000,$0000,$0000,$0000 + dc.w $01E3,$064D,$F9B2,$FE1C,$0000,$0000,$0000,$0000 + dc.w $01F9,$0694,$F96B,$FE06,$0000,$0000,$0000,$0000 + dc.w $020F,$06E0,$F91F,$FDF0,$0000,$0000,$0000,$0000 + dc.w $0227,$072E,$F8D1,$FDD8,$0000,$0000,$0000,$0000 + dc.w $0240,$0781,$F87E,$FDBF,$0000,$0000,$0000,$0000 + dc.w $0259,$07D7,$F828,$FDA6,$0000,$0000,$0000,$0000 + dc.w $0274,$0831,$F7CE,$FD8B,$0000,$0000,$0000,$0000 + dc.w $0290,$088E,$F771,$FD6F,$0000,$0000,$0000,$0000 + dc.w $02AE,$08F0,$F70F,$FD51,$0000,$0000,$0000,$0000 + dc.w $02CC,$0955,$F6AA,$FD33,$0000,$0000,$0000,$0000 + dc.w $02EC,$09C0,$F63F,$FD13,$0000,$0000,$0000,$0000 + dc.w $030D,$0A2F,$F5D0,$FCF2,$0000,$0000,$0000,$0000 + dc.w $0330,$0AA4,$F55B,$FCCF,$0000,$0000,$0000,$0000 + dc.w $0355,$0B1E,$F4E1,$FCAA,$0000,$0000,$0000,$0000 + dc.w $037B,$0B9D,$F462,$FC84,$0000,$0000,$0000,$0000 + dc.w $03A2,$0C20,$F3DF,$FC5D,$0000,$0000,$0000,$0000 + dc.w $03CC,$0CAB,$F354,$FC33,$0000,$0000,$0000,$0000 + dc.w $03F8,$0D3D,$F2C2,$FC07,$0000,$0000,$0000,$0000 + dc.w $0425,$0DD3,$F22C,$FBDA,$0000,$0000,$0000,$0000 + dc.w $0454,$0E72,$F18D,$FBAB,$0000,$0000,$0000,$0000 + dc.w $0486,$0F16,$F0E9,$FB79,$0000,$0000,$0000,$0000 + dc.w $04B9,$0FC3,$F03C,$FB46,$0000,$0000,$0000,$0000 + dc.w $04F0,$1078,$EF87,$FB0F,$0000,$0000,$0000,$0000 + dc.w $0528,$1133,$EECC,$FAD7,$0000,$0000,$0000,$0000 + dc.w $0563,$11F7,$EE08,$FA9C,$0000,$0000,$0000,$0000 + dc.w $05A1,$12C6,$ED39,$FA5E,$0000,$0000,$0000,$0000 + dc.w $05E1,$139B,$EC64,$FA1E,$0000,$0000,$0000,$0000 + dc.w $0624,$147C,$EB83,$F9DB,$0000,$0000,$0000,$0000 + dc.w $066A,$1565,$EA9A,$F995,$0000,$0000,$0000,$0000 + dc.w $06B3,$165A,$E9A5,$F94C,$0000,$0000,$0000,$0000 + dc.w $0700,$175A,$E8A5,$F8FF,$0000,$0000,$0000,$0000 + dc.w $0750,$1865,$E79A,$F8AF,$0000,$0000,$0000,$0000 + dc.w $07A3,$197A,$E685,$F85C,$0000,$0000,$0000,$0000 + dc.w $07FB,$1A9D,$E562,$F804,$0000,$0000,$0000,$0000 + dc.w $0856,$1BCE,$E431,$F7A9,$0000,$0000,$0000,$0000 + dc.w $08B5,$1D0C,$E2F3,$F74A,$0000,$0000,$0000,$0000 + dc.w $0919,$1E57,$E1A8,$F6E6,$0000,$0000,$0000,$0000 + dc.w $0980,$1FB2,$E04D,$F67F,$0000,$0000,$0000,$0000 + dc.w $09ED,$211D,$DEE2,$F612,$0000,$0000,$0000,$0000 + dc.w $0A5F,$2296,$DD69,$F5A0,$0000,$0000,$0000,$0000 + dc.w $0AD5,$2422,$DBDD,$F52A,$0000,$0000,$0000,$0000 + dc.w $0B51,$25BF,$DA40,$F4AE,$0000,$0000,$0000,$0000 + dc.w $0BD2,$276E,$D891,$F42D,$0000,$0000,$0000,$0000 + dc.w $0C5A,$2932,$D6CD,$F3A5,$0000,$0000,$0000,$0000 + dc.w $0CE7,$2B08,$D4F7,$F318,$0000,$0000,$0000,$0000 + dc.w $0D7A,$2CF4,$D30B,$F285,$0000,$0000,$0000,$0000 + dc.w $0E14,$2EF4,$D10B,$F1EB,$0000,$0000,$0000,$0000 + dc.w $0EB5,$310C,$CEF3,$F14A,$0000,$0000,$0000,$0000 + dc.w $0F5D,$333E,$CCC1,$F0A2,$0000,$0000,$0000,$0000 + dc.w $100C,$3587,$CA78,$EFF3,$0000,$0000,$0000,$0000 + dc.w $10C4,$37EB,$C814,$EF3B,$0000,$0000,$0000,$0000 + dc.w $1183,$3A69,$C596,$EE7C,$0000,$0000,$0000,$0000 + dc.w $124B,$3D05,$C2FA,$EDB4,$0000,$0000,$0000,$0000 + dc.w $131C,$3FBE,$C041,$ECE3,$0000,$0000,$0000,$0000 + dc.w $13F7,$4296,$BD69,$EC08,$0000,$0000,$0000,$0000 + dc.w $14DB,$458F,$BA70,$EB24,$0000,$0000,$0000,$0000 + dc.w $15C9,$48AA,$B755,$EA36,$0000,$0000,$0000,$0000 + dc.w $16C2,$4BE9,$B416,$E93D,$0000,$0000,$0000,$0000 + dc.w $17C6,$4F4C,$B0B3,$E839,$0000,$0000,$0000,$0000 + dc.w $18D6,$52D5,$AD2A,$E729,$0000,$0000,$0000,$0000 + dc.w $19F2,$5688,$A977,$E60D,$0000,$0000,$0000,$0000 + dc.w $1B1A,$5A65,$A59A,$E4E5,$0000,$0000,$0000,$0000 + dc.w $1C50,$5E6D,$A192,$E3AF,$0000,$0000,$0000,$0000 + dc.w $1D93,$62A4,$9D5B,$E26C,$0000,$0000,$0000,$0000 + dc.w $1EE5,$670C,$98F3,$E11A,$0000,$0000,$0000,$0000 + dc.w $2046,$6BA5,$945A,$DFB9,$0000,$0000,$0000,$0000 + dc.w $21B7,$7072,$8F8D,$DE48,$0000,$0000,$0000,$0000 + dc.w $2338,$7578,$8A87,$DCC7,$0000,$0000,$0000,$0000 + dc.w $24CB,$7AB5,$854A,$DB34,$0000,$0000,$0000,$0000 + dc.w $266F,$7FFF,$8000,$D990,$0000,$0000,$0000,$0000 + dc.w $2826,$7FFF,$8000,$D7D9,$0000,$0000,$0000,$0000 + dc.w $29F1,$7FFF,$8000,$D60E,$0000,$0000,$0000,$0000 + dc.w $2BD0,$7FFF,$8000,$D42F,$0000,$0000,$0000,$0000 + dc.w $2DC5,$7FFF,$8000,$D23A,$0000,$0000,$0000,$0000 + dc.w $2FD0,$7FFF,$8000,$D02F,$0000,$0000,$0000,$0000 + dc.w $31F2,$7FFF,$8000,$CE0D,$0000,$0000,$0000,$0000 + dc.w $342C,$7FFF,$8000,$CBD3,$0000,$0000,$0000,$0000 + dc.w $3681,$7FFF,$8000,$C97E,$0000,$0000,$0000,$0000 + dc.w $38F0,$7FFF,$8000,$C70F,$0000,$0000,$0000,$0000 + dc.w $3B7A,$7FFF,$8000,$C485,$0000,$0000,$0000,$0000 + dc.w $3E22,$7FFF,$8000,$C1DD,$0000,$0000,$0000,$0000 + dc.w $40E7,$7FFF,$8000,$BF18,$0000,$0000,$0000,$0000 + + +;31:2c2e0 + Export Table_4 +Table_4 + dc.w $FFF3,$0008,$004C,$00DE,$00DE,$004C,$0008,$FFF3 + + +;31:2c2f0 + Export Table_5 +Table_5 + dc.w $0025,$0074,$00CE,$014A,$FEB5,$FF31,$FF8B,$FFDA + dc.w $0027,$0079,$00D8,$015A,$FEA5,$FF27,$FF86,$FFD8 + dc.w $0029,$007F,$00E1,$0169,$FE96,$FF1E,$FF80,$FFD6 + dc.w $002A,$0084,$00EB,$0179,$FE86,$FF14,$FF7B,$FFD5 + dc.w $002C,$0089,$00F5,$0188,$FE77,$FF0A,$FF76,$FFD3 + dc.w $002E,$0090,$0100,$019A,$FE65,$FEFF,$FF6F,$FFD1 + dc.w $0030,$0096,$010B,$01AC,$FE53,$FEF4,$FF69,$FFCF + dc.w $0033,$009D,$0118,$01C1,$FE3E,$FEE7,$FF62,$FFCC + dc.w $0035,$00A5,$0125,$01D6,$FE29,$FEDA,$FF5A,$FFCA + dc.w $0037,$00AC,$0132,$01EA,$FE15,$FECD,$FF53,$FFC8 + dc.w $003A,$00B3,$013F,$01FF,$FE00,$FEC0,$FF4C,$FFC5 + dc.w $003C,$00BB,$014D,$0216,$FDE9,$FEB2,$FF44,$FFC3 + dc.w $003F,$00C3,$015C,$022D,$FDD2,$FEA3,$FF3C,$FFC0 + dc.w $0042,$00CD,$016C,$0247,$FDB8,$FE93,$FF32,$FFBD + dc.w $0045,$00D6,$017C,$0261,$FD9E,$FE83,$FF29,$FFBA + dc.w $0048,$00DF,$018C,$027B,$FD84,$FE73,$FF20,$FFB7 + dc.w $004B,$00E9,$019E,$0297,$FD68,$FE61,$FF16,$FFB4 + dc.w $004F,$00F4,$01B1,$02B6,$FD49,$FE4E,$FF0B,$FFB0 + dc.w $0052,$00FE,$01C5,$02D5,$FD2A,$FE3A,$FF01,$FFAD + dc.w $0056,$0109,$01D8,$02F4,$FD0B,$FE27,$FEF6,$FFA9 + dc.w $005A,$0116,$01EF,$0318,$FCE7,$FE10,$FEE9,$FFA5 + dc.w $005E,$0122,$0204,$033A,$FCC5,$FDFB,$FEDD,$FFA1 + dc.w $0062,$012F,$021A,$035E,$FCA1,$FDE5,$FED0,$FF9D + dc.w $0066,$013C,$0232,$0385,$FC7A,$FDCD,$FEC3,$FF99 + dc.w $006B,$014B,$024C,$03AE,$FC51,$FDB3,$FEB4,$FF94 + dc.w $0070,$0159,$0266,$03D7,$FC28,$FD99,$FEA6,$FF8F + dc.w $0075,$0169,$0281,$0403,$FBFC,$FD7E,$FE96,$FF8A + dc.w $007A,$0179,$029E,$0432,$FBCD,$FD61,$FE86,$FF85 + dc.w $007F,$018A,$02BD,$0463,$FB9C,$FD42,$FE75,$FF80 + dc.w $0085,$019B,$02DC,$0494,$FB6B,$FD23,$FE64,$FF7A + dc.w $008B,$01AE,$02FC,$04C8,$FB37,$FD03,$FE51,$FF74 + dc.w $0091,$01C1,$031F,$0500,$FAFF,$FCE0,$FE3E,$FF6E + dc.w $0098,$01D5,$0343,$0539,$FAC6,$FCBC,$FE2A,$FF67 + dc.w $009F,$01EA,$0368,$0575,$FA8A,$FC97,$FE15,$FF60 + dc.w $00A6,$0200,$038F,$05B3,$FA4C,$FC70,$FDFF,$FF59 + dc.w $00AD,$0217,$03B7,$05F3,$FA0C,$FC48,$FDE8,$FF52 + dc.w $00B5,$022E,$03E1,$0636,$F9C9,$FC1E,$FDD1,$FF4A + dc.w $00BD,$0248,$040E,$067F,$F980,$FBF1,$FDB7,$FF42 + dc.w $00C5,$0262,$043D,$06CA,$F935,$FBC2,$FD9D,$FF3A + dc.w $00CE,$027D,$046D,$0717,$F8E8,$FB92,$FD82,$FF31 + dc.w $00D7,$0299,$049F,$0767,$F898,$FB60,$FD66,$FF28 + dc.w $00E1,$02B7,$04D5,$07BC,$F843,$FB2A,$FD48,$FF1E + dc.w $00EB,$02D6,$050B,$0814,$F7EB,$FAF4,$FD29,$FF14 + dc.w $00F6,$02F7,$0545,$0871,$F78E,$FABA,$FD08,$FF09 + dc.w $0101,$0318,$0581,$08D1,$F72E,$FA7E,$FCE7,$FEFE + dc.w $010C,$033C,$05C0,$0935,$F6CA,$FA3F,$FCC3,$FEF3 + dc.w $0118,$0361,$0602,$099F,$F660,$F9FD,$FC9E,$FEE7 + dc.w $0125,$0387,$0646,$0A0C,$F5F3,$F9B9,$FC78,$FEDA + dc.w $0132,$03B0,$068E,$0A80,$F57F,$F971,$FC4F,$FECD + dc.w $013F,$03DA,$06D9,$0AF7,$F508,$F926,$FC25,$FEC0 + dc.w $014E,$0406,$0728,$0B75,$F48A,$F8D7,$FBF9,$FEB1 + dc.w $015D,$0434,$077A,$0BF9,$F406,$F885,$FBCB,$FEA2 + dc.w $016C,$0464,$07CF,$0C82,$F37D,$F830,$FB9B,$FE93 + dc.w $017C,$0496,$0828,$0D10,$F2EF,$F7D7,$FB69,$FE83 + dc.w $018E,$04CB,$0886,$0DA6,$F259,$F779,$FB34,$FE71 + dc.w $019F,$0501,$08E6,$0E41,$F1BE,$F719,$FAFE,$FE60 + dc.w $01B2,$053B,$094C,$0EE3,$F11C,$F6B3,$FAC4,$FE4D + dc.w $01C5,$0576,$09B6,$0F8E,$F071,$F649,$FA89,$FE3A + dc.w $01D9,$05B5,$0A26,$1040,$EFBF,$F5D9,$FA4A,$FE26 + dc.w $01EF,$05F6,$0A9A,$10FA,$EF05,$F565,$FA09,$FE10 + dc.w $0205,$063A,$0B13,$11BC,$EE43,$F4EC,$F9C5,$FDFA + dc.w $021C,$0681,$0B91,$1285,$ED7A,$F46E,$F97E,$FDE3 + dc.w $0234,$06CC,$0C15,$1359,$ECA6,$F3EA,$F933,$FDCB + dc.w $024D,$071A,$0CA0,$1437,$EBC8,$F35F,$F8E5,$FDB2 + dc.w $0267,$076A,$0D2F,$151D,$EAE2,$F2D0,$F895,$FD98 + dc.w $0283,$07C0,$0DC7,$160F,$E9F0,$F238,$F83F,$FD7C + dc.w $029F,$0818,$0E63,$170A,$E8F5,$F19C,$F7E7,$FD60 + dc.w $02BD,$0874,$0F08,$1811,$E7EE,$F0F7,$F78B,$FD42 + dc.w $02DD,$08D5,$0FB4,$1926,$E6D9,$F04B,$F72A,$FD22 + dc.w $02FE,$093A,$1067,$1A44,$E5BB,$EF98,$F6C5,$FD01 + dc.w $0320,$09A3,$1122,$1B70,$E48F,$EEDD,$F65C,$FCDF + dc.w $0344,$0A12,$11E7,$1CAB,$E354,$EE18,$F5ED,$FCBB + dc.w $0369,$0A84,$12B2,$1DF0,$E20F,$ED4D,$F57B,$FC96 + dc.w $0390,$0AFD,$1389,$1F48,$E0B7,$EC76,$F502,$FC6F + dc.w $03B8,$0B7A,$1467,$20AC,$DF53,$EB98,$F485,$FC47 + dc.w $03E3,$0BFE,$1551,$2223,$DDDC,$EAAE,$F401,$FC1C + dc.w $040F,$0C87,$1645,$23A9,$DC56,$E9BA,$F378,$FBF0 + dc.w $043E,$0D16,$1744,$2541,$DABE,$E8BB,$F2E9,$FBC1 + dc.w $046E,$0DAB,$184C,$26E8,$D917,$E7B3,$F254,$FB91 + dc.w $04A1,$0E47,$1961,$28A4,$D75B,$E69E,$F1B8,$FB5E + dc.w $04D6,$0EEA,$1A84,$2A75,$D58A,$E57B,$F115,$FB29 + dc.w $050D,$0F95,$1BB3,$2C5B,$D3A4,$E44C,$F06A,$FAF2 + dc.w $0547,$1046,$1CEF,$2E55,$D1AA,$E310,$EFB9,$FAB8 + dc.w $0583,$1100,$1E3A,$3066,$CF99,$E1C5,$EEFF,$FA7C + dc.w $05C2,$11C3,$1F94,$3292,$CD6D,$E06B,$EE3C,$FA3D + dc.w $0604,$128E,$20FC,$34D2,$CB2D,$DF03,$ED71,$F9FB + dc.w $0649,$1362,$2275,$372E,$C8D1,$DD8A,$EC9D,$F9B6 + dc.w $0690,$143F,$23FF,$39A4,$C65B,$DC00,$EBC0,$F96F + dc.w $06DC,$1527,$259A,$3C37,$C3C8,$DA65,$EAD8,$F923 + dc.w $072A,$1619,$2749,$3EE8,$C117,$D8B6,$E9E6,$F8D5 + dc.w $077C,$1715,$2909,$41B6,$BE49,$D6F6,$E8EA,$F883 + dc.w $07D1,$181D,$2ADF,$44A6,$BB59,$D520,$E7E2,$F82E + dc.w $082B,$1930,$2CC7,$47B4,$B84B,$D338,$E6CF,$F7D4 + dc.w $0888,$1A50,$2EC6,$4AE7,$B518,$D139,$E5AF,$F777 + dc.w $08EA,$1B7D,$30DE,$4E40,$B1BF,$CF21,$E482,$F715 + dc.w $094F,$1CB7,$330C,$51BE,$AE41,$CCF3,$E348,$F6B0 + dc.w $09BA,$1DFF,$3554,$5565,$AA9A,$CAAB,$E200,$F645 + dc.w $0A29,$1F55,$37B4,$5932,$A6CD,$C84B,$E0AA,$F5D6 + dc.w $0A9D,$20BC,$3A31,$5D2E,$A2D1,$C5CE,$DF43,$F562 + dc.w $0B16,$2231,$3CC9,$6156,$9EA9,$C336,$DDCE,$F4E9 + dc.w $0B95,$23B8,$3F80,$65AF,$9A50,$C07F,$DC47,$F46A + dc.w $0C19,$2551,$4256,$6A39,$95C6,$BDA9,$DAAE,$F3E6 + dc.w $0CA4,$26FB,$454C,$6EF7,$9108,$BAB3,$D904,$F35B + dc.w $0D34,$28B8,$4864,$73EB,$8C14,$B79B,$D747,$F2CB + dc.w $0DCB,$2A8A,$4B9F,$7918,$86E7,$B460,$D575,$F234 + dc.w $0E68,$2C6F,$4EFE,$7E7E,$8181,$B101,$D390,$F197 + dc.w $0F0D,$2E6B,$5285,$7FFF,$8000,$AD7A,$D194,$F0F2 + dc.w $0FB9,$307E,$5635,$7FFF,$8000,$A9CA,$CF81,$F046 + dc.w $106D,$32A7,$5A0D,$7FFF,$8000,$A5F2,$CD58,$EF92 + dc.w $1128,$34EA,$5E12,$7FFF,$8000,$A1ED,$CB15,$EED7 + dc.w $11ED,$3747,$6245,$7FFF,$8000,$9DBA,$C8B8,$EE12 + dc.w $12B9,$39BF,$66A8,$7FFF,$8000,$9957,$C640,$ED46 + dc.w $138F,$3C52,$6B3C,$7FFF,$8000,$94C3,$C3AD,$EC70 + dc.w $146F,$3F04,$7006,$7FFF,$8000,$8FF9,$C0FB,$EB90 + dc.w $1558,$41D3,$7505,$7FFF,$8000,$8AFA,$BE2C,$EAA7 + dc.w $164C,$44C3,$7A3E,$7FFF,$8000,$85C1,$BB3C,$E9B3 + dc.w $174B,$47D5,$7FB3,$7FFF,$8000,$804C,$B82A,$E8B4 + dc.w $1855,$4B0A,$7FFF,$7FFF,$8000,$8000,$B4F5,$E7AA + dc.w $196B,$4E63,$7FFF,$7FFF,$8000,$8000,$B19C,$E694 + dc.w $1A8D,$51E3,$7FFF,$7FFF,$8000,$8000,$AE1C,$E572 + dc.w $1BBD,$558B,$7FFF,$7FFF,$8000,$8000,$AA74,$E442 + dc.w $1CFA,$595C,$7FFF,$7FFF,$8000,$8000,$A6A3,$E305 + dc.w $1E45,$5D59,$7FFF,$7FFF,$8000,$8000,$A2A6,$E1BA + dc.w $1F9F,$6184,$7FFF,$7FFF,$8000,$8000,$9E7B,$E060 + dc.w $2108,$65DE,$7FFF,$7FFF,$8000,$8000,$9A21,$DEF7 + dc.w $2281,$6A6A,$7FFF,$7FFF,$8000,$8000,$9595,$DD7E + dc.w $240C,$6F29,$7FFF,$7FFF,$8000,$8000,$90D6,$DBF3 + dc.w $25A7,$741F,$7FFF,$7FFF,$8000,$8000,$8BE0,$DA58 + + + END diff --git a/Toolbox/StandardFile/StandardFilePACK.a b/Toolbox/StandardFile/StandardFilePACK.a index 9c66234..b436663 100644 --- a/Toolbox/StandardFile/StandardFilePACK.a +++ b/Toolbox/StandardFile/StandardFilePACK.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: StandardFilePACK.a ; @@ -4811,7 +4818,7 @@ CallActivate _TEDeactivate ; deactivate the TE ; mark the dialog as not having active TE field move.w #-1,editField(a3) - bra @checkFileList ; CSS + bra.s @checkFileList ; CSS @TEActivate ; switch to new item's text handle move.l teHandle(a3),a0 @@ -7873,8 +7880,7 @@ GetVolIcon move.l a0,-(sp) ; don't trash a0 move.w #floppyIconResource,d0 cmp.l #'Sony',(a0) ; .Sony means use floppy icon beq.s @done - cmp.l #'NewA',(a0) ; .NewAge means use floppy icon CSS - beq.s @done +; ex Don't treat 'NewA' same as 'Sony' move.w #genericFileServerIconResource,d0 cmp.l #'AFPT',(a0) ; .AFPTranslator means use fileserver icon beq.s @done diff --git a/Toolbox/Toolbox.make b/Toolbox/Toolbox.make new file mode 100644 index 0000000..dfc80c3 --- /dev/null +++ b/Toolbox/Toolbox.make @@ -0,0 +1,150 @@ +# +# Hacks to match MacOS (most recent first): +# +# 8/3/92 Written from scratch to replace missing makefile +# + +AliasMgrDir = "{ToolBoxDir}AliasMgr:" +AppleEventDir = "{ToolBoxDir}AppleEventMgr:" +ColorPickerDir = "{ToolBoxDir}ColorPicker:" +CommToolboxDir = "{ToolBoxDir}CommToolbox:" +ComponentMgrDir = "{ToolBoxDir}ComponentMgr:" +ControlMgrDir = "{ToolBoxDir}ControlMgr:" +DataAccessDir = "{ToolBoxDir}DataAccessMgr:" +DeskMgrDir = "{ToolBoxDir}DeskMgr:" +DialogDir = "{ToolBoxDir}DialogMgr:" +DictionaryMgrDir = "{ToolBoxDir}DictionaryMgr:" +DiskInitDir = "{ToolBoxDir}DiskInit:" +DisplayMgrDir = "{ToolBoxDir}DisplayMgr:" +EditionMgrDir = "{ToolBoxDir}DataPubsMgr:" +ExpansionBusMgrDir = "{ToolBoxDir}ExpansionBusMgr:" +FontMgrDir = "{ToolBoxDir}FontMgr:" +GetMgrDir = "{ToolBoxDir}GetMgr:" +HelpMgrDir = "{ToolBoxDir}HelpMgr:" +IconUtilsDir = "{ToolBoxDir}IconUtils:" +InSaneDir = "{ToolBoxDir}InSANE:" +ListMgrDir = "{ToolBoxDir}ListMgr:" +MenuMgrDir = "{ToolBoxDir}MenuMgr:" +MungerDir = "{ToolBoxDir}Munger:" +NotificationDir = "{ToolBoxDir}NotificationMgr:" +PrintingDir = "{ToolBoxDir}Printing:" +ResourceMgrDir = "{ToolBoxDir}ResourceMgr:" +SANEDir = "{ToolBoxDir}SANE:" +ScrapMgrDir = "{ToolBoxDir}ScrapMgr:" +ScriptMgrDir = "{ToolBoxDir}ScriptMgr:" +SegmentLoaderDir = "{ToolBoxDir}SegmentLoader:" +ShutDownMgrDir = "{ToolBoxDir}ShutDownMgr:" +SoundMgrDir = "{ToolBoxDir}SoundMgr:" +StandardFileDir = "{ToolBoxDir}StandardFile:" +TextEditDir = "{ToolBoxDir}TextEdit:" +TextServicesDir = "{ToolBoxDir}TextServicesMgr:" +ToolboxEventDir = "{ToolBoxDir}ToolboxEventMgr:" +WindowMgrDir = "{ToolBoxDir}WindowMgr:" + + + +#include "{AliasMgrDir}AliasMgr.make" +#include "{AppleEventDir}AppleEventMgr.make" +#include "{ColorPickerDir}ColorPicker.make" +#include "{CommToolboxDir}CommToolbox.make" +#include "{ComponentMgrDir}ComponentMgr.make" +#include "{ControlMgrDir}ControlMgr.make" +#include "{DataAccessDir}DataAccessMgr.make" +#include "{DialogDir}DialogMgr.make" +#include "{DictionaryMgrDir}DictionaryMgr.make" +#include "{DiskInitDir}DiskInit.make" +#include "{DisplayMgrDir}DisplayMgr.make" +#include "{EditionMgrDir}EditionMgr.make" +#include "{ExpansionBusMgrDir}ExpansionBusMgr.make" +#include "{FontMgrDir}FontMgr.make" +#include "{HelpMgrDir}HelpMgr.make" +#include "{IconUtilsDir}IconUtils.make" +#include "{InSaneDir}InSane.make" +#include "{ListMgrDir}ListMgr.make" +#include "{MenuMgrDir}MenuMgr.make" +#include "{NotificationDir}NotificationMgr.make" +#include "{ResourceMgrDir}ResourceMgr.make" +#include "{SANEDir}SANE.make" +#include "{ScriptMgrDir}ScriptMgr.make" +#include "{SoundMgrDir}SoundMgr.make" +#include "{StandardFileDir}StandardFile.make" +#include "{TextServicesDir}TextServicesMgr.make" +#include "{ToolboxEventDir}ToolboxEventMgr.make" +#include "{WindowMgrDir}WindowMgr.make" + + + +"{ObjDir}DeskMgr.a.o" ƒ "{DeskMgrDir}DeskMgr.a" + Asm {StdAOpts} -o "{Targ}" "{DeskMgrDir}DeskMgr.a" + +"{ObjDir}DeskMgrPatches.a.o" ƒ "{DeskMgrDir}DeskMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{DeskMgrDir}DeskMgrPatches.a" + + + +"{ObjDir}GetMgr.a.o" ƒ "{GetMgrDir}GetMgr.a" + Asm {StdAOpts} -o "{Targ}" "{GetMgrDir}GetMgr.a" + +"{ObjDir}GetMgrPatches.a.o" ƒ "{GetMgrDir}GetMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{GetMgrDir}GetMgrPatches.a" + + + +"{ObjDir}Munger.a.o" ƒ "{MungerDir}Munger.a" + Asm {StdAOpts} -o "{Targ}" "{MungerDir}Munger.a" + +"{ObjDir}MungerPatches.a.o" ƒ "{MungerDir}MungerPatches.a" + Asm {StdAOpts} -o "{Targ}" "{MungerDir}MungerPatches.a" + + + +"{ObjDir}PackageMgr.a.o" ƒ "{ToolboxDir}PackageMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}PackageMgr.a" + + + +"{ObjDir}PrintGlue.a.o" ƒ "{PrintingDir}PrintGlue.a" + Asm {StdAOpts} -o "{Targ}" "{PrintingDir}PrintGlue.a" + +"{ObjDir}PrintDriver.a.o" ƒ "{PrintingDir}PrintDriver.a" + Asm {StdAOpts} -o "{Targ}" "{PrintingDir}PrintDriver.a" + +"{RsrcDir}PrintDriver.a.rsrc" ƒ "{ObjDir}PrintDriver.a.o" + Link {StdLOpts} {StdAlign} -o "{Targ}" -rt RSRC=0 "{ObjDir}PrintDriver.a.o" + + + +"{ObjDir}ScrapMgr.a.o" ƒ "{ScrapMgrDir}ScrapMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ScrapMgrDir}ScrapMgr.a" + +"{ObjDir}ScrapMgrPatches.a.o" ƒ "{ScrapMgrDir}ScrapMgrPatches.a" + Asm {StdAOpts} -o "{Targ}" "{ScrapMgrDir}ScrapMgrPatches.a" + + + +"{ObjDir}SegmentLoader.a.o" ƒ "{SegmentLoaderDir}SegmentLoader.a" + Asm {StdAOpts} -o "{Targ}" "{SegmentLoaderDir}SegmentLoader.a" + +"{ObjDir}SegmentLoaderPatches.a.o" ƒ "{SegmentLoaderDir}SegmentLoaderPatches.a" + Asm {StdAOpts} -o "{Targ}" "{SegmentLoaderDir}SegmentLoaderPatches.a" + + + +"{ObjDir}SexyDate.a.o" ƒ "{ToolboxDir}SexyDate.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}SexyDate.a" + + + +"{ObjDir}ShutDownMgr.a.o" ƒ "{ShutDownMgrDir}ShutDownMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ShutDownMgrDir}ShutDownMgr.a" + + + +"{ObjDir}TextEdit.a.o" ƒ "{TextEditDir}TextEdit.a" "{TextEditDir}IncludeTextEdit.a" + Asm {StdAOpts} -o "{Targ}" "{TextEditDir}IncludeTextEdit.a" + +"{ObjDir}TextEditPatch.a.o" ƒ "{TextEditDir}TextEditPatch.a" + Asm {StdAOpts} -o "{Targ}" "{TextEditDir}TextEditPatch.a" + +"{ObjDir}TextEditPatchIIciROM.a.o" ƒ "{TextEditDir}TextEditPatchIIciROM.a" + Asm {StdAOpts} -o "{Targ}" "{TextEditDir}TextEditPatchIIciROM.a" diff --git a/Toolbox/WindowMgr/LayerMgr.c b/Toolbox/WindowMgr/LayerMgr.c index 7f84201..85d172f 100644 --- a/Toolbox/WindowMgr/LayerMgr.c +++ b/Toolbox/WindowMgr/LayerMgr.c @@ -1,3 +1,11 @@ +/* + Hacks to match MacOS (most recent first): + + 8/3/92 Reverted <74>: Go back to direct ExpandMem access + Reverted : XGlue to romX, XGuts to oldX etc + 9/2/94 SuperMario ROM source dump (header preserved below) +*/ + /* File: LayerMgr.c @@ -316,16 +324,17 @@ short ShortDiv(short, short) #define layerProc layerWDEF*16 #if !hasLayerlessAppsINIT -pascal void InitWindowsGuts(void); +pascal void oldInitWindows(void); #endif -pascal void ClipAboveGuts(WindowPeek); -pascal void PaintOneGuts(WindowPeek, RgnHandle); -pascal void CloseWindowGuts(WindowPtr); -pascal void InsertWindow(WindowPtr, WindowPtr); -pascal void MakeDeactiveGlue(WindowPtr); -pascal void CallWindowGlue(WindowPeek, short, long); -pascal void CallWindowDrawGlue(WindowPeek); -pascal void CallWindowCalcGlue(WindowPeek); +pascal void oldClipAbove(WindowPeek); +pascal void oldPaintOne(WindowPeek, RgnHandle); +pascal void oldCloseWindow(WindowPtr); +pascal void oldBeginUpdate(WindowPtr); +pascal void romInsertWindow(WindowPtr, WindowPtr); +pascal void romMakeDeactive(WindowPtr); +pascal void romCallWindow(WindowPeek, short, long); +pascal void romCallWindowDraw(WindowPeek); +pascal void romCallWindowCalc(WindowPeek); pascal void PaintDesk(void); pascal void ValidateMenuBar(void); @@ -473,7 +482,7 @@ void GetNewStructRect(Rect *newStruct, WindowPeek whichWindow, Rect *thePort) // call the WDEF with the wCalcRgns message in this new faked up state. - CallWindowCalcGlue(whichWindow); + romCallWindowCalc(whichWindow); /* */ // get the bounding box of the structure rgn. @@ -487,7 +496,7 @@ void GetNewStructRect(Rect *newStruct, WindowPeek whichWindow, Rect *thePort) SetPort(curPort); - CallWindowCalcGlue(whichWindow); + romCallWindowCalc(whichWindow); /* */ } #define staggerIncrement 20 @@ -1120,7 +1129,7 @@ NewWindowCommon(register Ptr wStorage, register const Rect *boundsRect, const St ((WindowPeek) wStorage)->nextWindow = WindowList; WindowList = ((WindowPeek) wStorage); } else - InsertWindow((WindowPtr) wStorage, behind); + romInsertWindow((WindowPtr) wStorage, behind); /* */ /* Get the WDEF. If the one we’re looking for doesn’t exist, get id = 0. */ { @@ -1188,7 +1197,7 @@ NewWindowCommon(register Ptr wStorage, register const Rect *boundsRect, const St WindowPtr newFront = ActiveWindow(); if (newFront != oldFront) { if (oldFront != nil) - MakeDeactiveGlue(oldFront); + romMakeDeactive(oldFront); /* */ if (newFront != nil) ((WindowPeek) newFront)->hilited = true; CurActivate = (WindowPeek) newFront; @@ -1220,7 +1229,7 @@ NewWindowCommon(register Ptr wStorage, register const Rect *boundsRect, const St ((WindowPeek) wStorage)->titleWidth = StringWidth(title); } - CallWindowGlue((WindowPeek) wStorage, wNew, 0); + romCallWindow((WindowPeek) wStorage, wNew, 0); /* */ if (autoPosition) { struct AutoWindowPosition *info = (struct AutoWindowPosition *) &(boundsRect->left); @@ -1245,7 +1254,7 @@ NewWindowCommon(register Ptr wStorage, register const Rect *boundsRect, const St * If it is a visible window, it can also affect the structure of the layers it is contained in * and needs to be drawn and obscure other windows. */ - CallWindowCalcGlue((WindowPeek) wStorage); + romCallWindowCalc((WindowPeek) wStorage); /* */ if (visible && !FastIsLayer(wStorage)) { ActivatePalette((WindowPtr) wStorage); PaintOne((WindowPeek) wStorage, ((WindowPeek) wStorage)->strucRgn); @@ -1520,7 +1529,7 @@ __InitLayers(void) #if hasLayerlessAppsINIT InitWindows(); #else - InitWindowsGuts(); + oldInitWindows(); /* */ #endif /* Create the two layers (one for system stuff). */ @@ -1572,7 +1581,7 @@ CalcAncestorRgns(WindowPtr window) { LayerPeek layer = __GetParent(window); while (layer != nil) { - CallWindowCalcGlue((WindowPeek) layer); + romCallWindowCalc((WindowPeek) layer); /* */ layer = layer->parent; } } @@ -1638,13 +1647,15 @@ __CheckUpdate(EventRecord *event) /* If window is a layer, BeginUpdate will correctly paint and calculate visRgns for its children. */ pascal void -BeginUpdateOfLayersChildren(WindowPtr window) +__BeginUpdate(WindowPtr window) /* */ { if (FastIsLayer(window)) { PaintOne((WindowPeek) window, ((WindowPeek) window)->updateRgn); /* Note that only the children of window really need CalcVis. */ CalcVis((WindowPeek) window); } + + oldBeginUpdate((WindowPeek) window); /* was not being treated as a wrapper */ } #if !hasLayerlessApps @@ -1668,7 +1679,7 @@ __ClipAbove(WindowPeek window) /* Call the old ClipAbove (set the current layer for it). */ __SetCurLayer(parent); - ClipAboveGuts(window); + oldClipAbove(window); /* */ /* Jump up a layer. */ window = (WindowPeek) parent; @@ -1757,7 +1768,7 @@ PaintAction(WindowPeek window, LayerPeek, PaintInfoPtr paintInfo) /* Call the old PaintOne for real windows only in normal loops and when a palette update * is necessary. */ - PaintOneGuts(window, paintInfo->clobberedRgn); + oldPaintOne(window, paintInfo->clobberedRgn); /* */ } return noErr; @@ -1770,11 +1781,11 @@ PaintAction(WindowPeek window, LayerPeek, PaintInfoPtr paintInfo) */ void CalcAncestorRgnsForPaintActions(WindowPtr window) { - ExpandMemRec *emRec = ExpandMem; - if (GetExpandMemAncestorRgnsCalced() == 0) + ExpandMemRec *emRec = GetExpandMem(); /* */ + if (emRec->emAncestorRgnsCalced == 0) /* */ CalcAncestorRgns(window); // calculate the regions if the one-shot is off else - SetExpandMemAncestorRgnsCalced(0); // reset the one-shot + emRec->emAncestorRgnsCalced = 0; // reset the one-shot /* */ } #endif @@ -2078,7 +2089,7 @@ __CloseWindow(WindowPtr window) } /* Call the old CloseWindow. */ - CloseWindowGuts(window); + oldCloseWindow(window); /* */ /* Restore the current layer. */ __SetCurLayer(saveLayer); @@ -2105,9 +2116,9 @@ ShowWindowAction(WindowPeek window, LayerPeek layer, PaintInfoPtr) if (!window->visible) return skipChildren; if (!FastIsLayer(window)) { - CallWindowCalcGlue(window); + romCallWindowCalc(window); /* */ if (window->nextWindow == nil) /* calculate parent only after the last child of a layer */ - CallWindowCalcGlue((WindowPeek) layer); + romCallWindowCalc((WindowPeek) layer); /* */ } return noErr; } diff --git a/Toolbox/WindowMgr/StandardWDEF.a b/Toolbox/WindowMgr/StandardWDEF.a index 423ccb5..75e73d0 100644 --- a/Toolbox/WindowMgr/StandardWDEF.a +++ b/Toolbox/WindowMgr/StandardWDEF.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted SuperMario changes +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: StandardWDEF.a ; @@ -446,7 +453,7 @@ IsNoZoom move.l WMgrPort,-(SP) ; B&W, set to window manager port _SetPort ; - bra @CommonSys ; done for the B&W environment CSS + bra.s @CommonSys ; done for the B&W environment CSS ; ------------- doin it with color ------------- ; when using the WMgrCPort, it is the defproc’s responsibility to reconcile @@ -538,8 +545,7 @@ IsNoZoom subq.l #4, SP ; room for a PixMapHandle move.l #'pmap', -(SP) ; the Pixmap resource type move.w #kPixmapID, -(SP) ; ID of working pixmap - move.w #MapTrue,RomMapInsert ; rb - _GetResource ; look in ROM first rb + _GetResource ; look in ROM first <22> rb move.l (SP)+, workPixmap(A6) ; save it for later move.l #16,D0 ; allocate a bogus ctab <21> _NewHandle ,SYS,CLEAR ; in sys heap with 0 entries <21> @@ -1663,11 +1669,8 @@ WDefDrawGIcon move.l portRect+botRight(windowReg),(rectReg) ; botRight=topLeft move.l (rectReg),botRight(rectReg) ; copy into botRight, too - add.w d4,left(rectReg) ; reintroduced from <34> - add.w d4,right(rectReg) ; - swap d4 ; - add.w d4,top(rectReg) ; - add.w d4,bottom(rectReg) ; + add.l d4,topLeft(a4) ; reintroduced from <34> + add.l d4,botRight(a4) sub.w #scrollBarSize-2,top(rectReg) ; remove scroll area sub.w #scrollBarSize-2,left(rectReg) @@ -2359,8 +2362,7 @@ SetupColorPict move.w (A2, D0.w), -(SP) ; push the resource ID cmpi.w #kHighlightPix,(sp) seq gadgetHighlight(a6) ; Set if we’re highlighting - move.w #MapTrue,RomMapInsert ; rb - _GetResource ; look in ROM first rb + _GetResource ; look in ROM first rb move.l (SP)+, A0 ; pixels handle _HLock ; don’t want it to move move.l A0, tempPixels(A6) ; save for dispose diff --git a/Toolbox/WindowMgr/WindowList.a b/Toolbox/WindowMgr/WindowList.a index 6055015..2010de0 100644 --- a/Toolbox/WindowMgr/WindowList.a +++ b/Toolbox/WindowMgr/WindowList.a @@ -1,3 +1,10 @@ +; +; Hacks to match MacOS (most recent first): +; +; 8/3/92 Reverted +; 9/2/94 SuperMario ROM source dump (header preserved below) +; + ; ; File: WindowList.a ; @@ -258,7 +265,7 @@ DoOld MOVE.L (SP)+, A1 wlBringToFront PatchProc _BringToFront MOVE.L 4(SP), -(SP) - CLR.W DragFlag + CLR.B DragFlag IMPORT BringToFrontGuts LEA BringToFrontGuts, A0 IMPORT TwoByFour