diff --git a/BuildResults/RISC/Lib/ATAMgr.lib b/BuildResults/RISC/Lib/ATAMgr.lib new file mode 100644 index 0000000..3aa6bec Binary files /dev/null and b/BuildResults/RISC/Lib/ATAMgr.lib differ diff --git a/BuildResults/RISC/Lib/AliasMgr.lib b/BuildResults/RISC/Lib/AliasMgr.lib new file mode 100644 index 0000000..f52ac01 Binary files /dev/null and b/BuildResults/RISC/Lib/AliasMgr.lib differ diff --git a/BuildResults/RISC/Lib/CQD.lib b/BuildResults/RISC/Lib/CQD.lib new file mode 100644 index 0000000..b970d22 Binary files /dev/null and b/BuildResults/RISC/Lib/CQD.lib differ diff --git a/BuildResults/RISC/Lib/ComponentMgr.lib b/BuildResults/RISC/Lib/ComponentMgr.lib new file mode 100644 index 0000000..b688be5 Binary files /dev/null and b/BuildResults/RISC/Lib/ComponentMgr.lib differ diff --git a/BuildResults/RISC/Lib/DataAccessMgr.lib b/BuildResults/RISC/Lib/DataAccessMgr.lib new file mode 100644 index 0000000..c5e4630 Binary files /dev/null and b/BuildResults/RISC/Lib/DataAccessMgr.lib differ diff --git a/BuildResults/RISC/Lib/DialogMgr.lib b/BuildResults/RISC/Lib/DialogMgr.lib new file mode 100644 index 0000000..69809a1 Binary files /dev/null and b/BuildResults/RISC/Lib/DialogMgr.lib differ diff --git a/BuildResults/RISC/Lib/DisplayMgr.lib b/BuildResults/RISC/Lib/DisplayMgr.lib new file mode 100644 index 0000000..d0dee87 Binary files /dev/null and b/BuildResults/RISC/Lib/DisplayMgr.lib differ diff --git a/BuildResults/RISC/Lib/ExpansionBusMgr.lib b/BuildResults/RISC/Lib/ExpansionBusMgr.lib new file mode 100644 index 0000000..89c3254 Binary files /dev/null and b/BuildResults/RISC/Lib/ExpansionBusMgr.lib differ diff --git a/BuildResults/RISC/Lib/FontMgr.lib b/BuildResults/RISC/Lib/FontMgr.lib new file mode 100644 index 0000000..52bc0d9 Binary files /dev/null and b/BuildResults/RISC/Lib/FontMgr.lib differ diff --git a/BuildResults/RISC/Lib/Gestalt.lib b/BuildResults/RISC/Lib/Gestalt.lib new file mode 100644 index 0000000..a69f74e Binary files /dev/null and b/BuildResults/RISC/Lib/Gestalt.lib differ diff --git a/BuildResults/RISC/Lib/HFS.lib b/BuildResults/RISC/Lib/HFS.lib new file mode 100644 index 0000000..86ab43f Binary files /dev/null and b/BuildResults/RISC/Lib/HFS.lib differ diff --git a/BuildResults/RISC/Lib/IoPrimitives.lib b/BuildResults/RISC/Lib/IoPrimitives.lib new file mode 100644 index 0000000..74405a1 Binary files /dev/null and b/BuildResults/RISC/Lib/IoPrimitives.lib differ diff --git a/BuildResults/RISC/Lib/Lastly.lib b/BuildResults/RISC/Lib/Lastly.lib new file mode 100644 index 0000000..4b29240 Binary files /dev/null and b/BuildResults/RISC/Lib/Lastly.lib differ diff --git a/BuildResults/RISC/Lib/MMU.lib b/BuildResults/RISC/Lib/MMU.lib new file mode 100644 index 0000000..926ed57 Binary files /dev/null and b/BuildResults/RISC/Lib/MMU.lib differ diff --git a/BuildResults/RISC/Lib/MemoryMgr.lib b/BuildResults/RISC/Lib/MemoryMgr.lib new file mode 100644 index 0000000..d61d2bb Binary files /dev/null and b/BuildResults/RISC/Lib/MemoryMgr.lib differ diff --git a/BuildResults/RISC/Lib/MenuMgr.lib b/BuildResults/RISC/Lib/MenuMgr.lib new file mode 100644 index 0000000..27eafae Binary files /dev/null and b/BuildResults/RISC/Lib/MenuMgr.lib differ diff --git a/BuildResults/RISC/Lib/NotificationMgr.lib b/BuildResults/RISC/Lib/NotificationMgr.lib new file mode 100644 index 0000000..1f03376 Binary files /dev/null and b/BuildResults/RISC/Lib/NotificationMgr.lib differ diff --git a/BuildResults/RISC/Lib/SCSI.lib b/BuildResults/RISC/Lib/SCSI.lib new file mode 100644 index 0000000..3f998de Binary files /dev/null and b/BuildResults/RISC/Lib/SCSI.lib differ diff --git a/BuildResults/RISC/Lib/ScriptMgr.lib b/BuildResults/RISC/Lib/ScriptMgr.lib new file mode 100644 index 0000000..99c5ef0 Binary files /dev/null and b/BuildResults/RISC/Lib/ScriptMgr.lib differ diff --git a/BuildResults/RISC/Lib/SlotMgr.lib b/BuildResults/RISC/Lib/SlotMgr.lib new file mode 100644 index 0000000..1d30b2b Binary files /dev/null and b/BuildResults/RISC/Lib/SlotMgr.lib differ diff --git a/BuildResults/RISC/Lib/WindowMgr.lib b/BuildResults/RISC/Lib/WindowMgr.lib new file mode 100644 index 0000000..8aec3fc Binary files /dev/null and b/BuildResults/RISC/Lib/WindowMgr.lib differ diff --git a/BuildResults/RISC/Obj/BCScreenRelated.o b/BuildResults/RISC/Obj/BCScreenRelated.o new file mode 100644 index 0000000..b00079f Binary files /dev/null and b/BuildResults/RISC/Obj/BCScreenRelated.o differ diff --git a/BuildResults/RISC/Obj/DeviceMgr.a.o b/BuildResults/RISC/Obj/DeviceMgr.a.o new file mode 100644 index 0000000..f23eacd Binary files /dev/null and b/BuildResults/RISC/Obj/DeviceMgr.a.o differ diff --git a/BuildResults/RISC/Obj/DeviceRelatedMgr.o b/BuildResults/RISC/Obj/DeviceRelatedMgr.o new file mode 100644 index 0000000..c39a913 Binary files /dev/null and b/BuildResults/RISC/Obj/DeviceRelatedMgr.o differ diff --git a/BuildResults/RISC/Obj/InterruptHandlers.a.o b/BuildResults/RISC/Obj/InterruptHandlers.a.o new file mode 100644 index 0000000..05dfb09 Binary files /dev/null and b/BuildResults/RISC/Obj/InterruptHandlers.a.o differ diff --git a/BuildResults/RISC/Obj/NKEventGroupRelated.a.o b/BuildResults/RISC/Obj/NKEventGroupRelated.a.o new file mode 100644 index 0000000..36f5431 Binary files /dev/null and b/BuildResults/RISC/Obj/NKEventGroupRelated.a.o differ diff --git a/BuildResults/RISC/Obj/PowerMgr.o b/BuildResults/RISC/Obj/PowerMgr.o new file mode 100644 index 0000000..556d2b6 Binary files /dev/null and b/BuildResults/RISC/Obj/PowerMgr.o differ diff --git a/BuildResults/RISC/Obj/Printing.a.o b/BuildResults/RISC/Obj/Printing.a.o new file mode 100644 index 0000000..e40b3dd Binary files /dev/null and b/BuildResults/RISC/Obj/Printing.a.o differ diff --git a/BuildResults/RISC/Obj/ScrapMgr.a.o b/BuildResults/RISC/Obj/ScrapMgr.a.o new file mode 100644 index 0000000..12dd548 Binary files /dev/null and b/BuildResults/RISC/Obj/ScrapMgr.a.o differ diff --git a/BuildResults/RISC/Obj/ShutDownMgr.c.o b/BuildResults/RISC/Obj/ShutDownMgr.c.o new file mode 100644 index 0000000..52f425c Binary files /dev/null and b/BuildResults/RISC/Obj/ShutDownMgr.c.o differ diff --git a/BuildResults/RISC/Obj/StartInterstix.c.o b/BuildResults/RISC/Obj/StartInterstix.c.o new file mode 100644 index 0000000..9c62624 Binary files /dev/null and b/BuildResults/RISC/Obj/StartInterstix.c.o differ diff --git a/BuildResults/RISC/Obj/StartLibGlue.c.o b/BuildResults/RISC/Obj/StartLibGlue.c.o new file mode 100644 index 0000000..9a9c862 Binary files /dev/null and b/BuildResults/RISC/Obj/StartLibGlue.c.o differ diff --git a/BuildResults/RISC/Obj/TextEdit.lib b/BuildResults/RISC/Obj/TextEdit.lib new file mode 100644 index 0000000..ca9db82 Binary files /dev/null and b/BuildResults/RISC/Obj/TextEdit.lib differ diff --git a/BuildResults/RISC/Obj/UniversalTables.a.o b/BuildResults/RISC/Obj/UniversalTables.a.o new file mode 100644 index 0000000..72c9dd3 Binary files /dev/null and b/BuildResults/RISC/Obj/UniversalTables.a.o differ diff --git a/Drivers/Drivers.make b/Drivers/Drivers.make index 85152e1..3e56fe0 100644 --- a/Drivers/Drivers.make +++ b/Drivers/Drivers.make @@ -22,8 +22,8 @@ BackLightDir = {DriverDir}BackLight: #include {SonyDir}Sony.make -#include {SerialDir}Serial.make -#include {SerialDMADir}SerialDMA.make +##include {SerialDir}Serial.make +##include {SerialDMADir}SerialDMA.make #include {NewAgeDir}NewAge.make diff --git a/Interfaces/AIncludes/SysEqu.a b/Interfaces/AIncludes/SysEqu.a index 1458352..79f1d4e 100644 --- a/Interfaces/AIncludes/SysEqu.a +++ b/Interfaces/AIncludes/SysEqu.a @@ -674,7 +674,7 @@ btQType EQU 21 ; B*Tree Manager ; Device Control Entry Definition ;dCtlEntrySize used to be only 40 bytes! -dCtlEntrySize EQU $34 ; length of a DCE [52 bytes] +dCtlEntrySize EQU $38 ; length of a DCE [52 bytes] dCtlDriver EQU 0 ; driver [handle] dCtlFlags EQU 4 ; flags [word] dCtlQueue EQU 6 ; queue header diff --git a/Internal/Asm/AppleDeskBusPriv.a b/Internal/Asm/AppleDeskBusPriv.a index 4851418..9104a6b 100644 --- a/Internal/Asm/AppleDeskBusPriv.a +++ b/Internal/Asm/AppleDeskBusPriv.a @@ -53,7 +53,7 @@ resetCmd EQU $00 ; Command for Bus Reset kbdAddr EQU $02 ; keyboard type device mouseAddr EQU $03 ; mouse type device numFDBAdr EQU 16 ; number of avaiblae FDB address -moveTime EQU 50 ; number of times to move device +moveTime EQU 10 ; number of times to move device IF IopADB THEN diff --git a/Internal/Asm/CrsrDevEqu.a b/Internal/Asm/CrsrDevEqu.a index c436e17..bb58f84 100644 --- a/Internal/Asm/CrsrDevEqu.a +++ b/Internal/Asm/CrsrDevEqu.a @@ -90,6 +90,8 @@ denom ds.w 1 ; Private: fraction of the errors to use next time spread ds.w 1 ; Private: Number of samples to spread errors over newData ds.b 1 ; Private: set when deltas are new ds.b 1 ; align + + ds.b 4 ; new CrsrDevSize EQU * ENDR diff --git a/Internal/Asm/InternalOnlyEqu.a b/Internal/Asm/InternalOnlyEqu.a index d60daa7..28f4d60 100644 --- a/Internal/Asm/InternalOnlyEqu.a +++ b/Internal/Asm/InternalOnlyEqu.a @@ -231,41 +231,110 @@ DockingGlobals EQU $1FF8 ; pointer to docking globals ;_______________________________________________________________________ -; Processor Info Record -; -; Used to pass Processor information from the NanoKernel to user mode -; software. +; Configuration Info Record +; Used to pass Configuration information from the Boot Program to the +; NanoKernel for data structure and address mapping initialization. ;_______________________________________________________________________ -ProcessorInfoPtr equ $5FFFEFD8 ; logical address of ProcessorInfo record -ProcessorInfoVer equ $5FFFEFDC ; version number of ProcessorInfo record -ProcessorInfoLen equ $5FFFEFDE ; length of ProcessorInfo record +NKConfigurationInfo record 0,increment +ROMByteCheckSums ds.l 8 ; 000 ; ROM Checksums - one word for each of 8 byte lanes +ROMCheckSum64 ds.l 2 ; 020 ; ROM Checksum - 64 bit sum of doublewords -ProcessorInfo record 0,increment -ProcessorVersionReg ds.l 1 ; contents of the PVR special purpose register -CpuClockRateHz ds.l 1 ; CPU Clock frequency -BusClockRateHz ds.l 1 ; Bus Clock frequency -DecClockRateHz ds.l 1 ; Decrementer Clock frequency -PageSize ds.l 1 ; number of bytes in a memory page -DataCacheTotalSize ds.l 1 ; number of bytes in the Data Cache -InstCacheTotalSize ds.l 1 ; number of bytes in the Instruction Cache -CoherencyBlockSize ds.w 1 ; number of bytes in a Coherency Block -ReservationGranuleSize ds.w 1 ; number of bytes in a Reservation Granule -CombinedCaches ds.w 1 ; 1 <- combined or no cache, 0 <- split cache -InstCacheLineSize ds.w 1 ; number of bytes in a Line of the Instruction Cache -DataCacheLineSize ds.w 1 ; number of bytes in a Line of the Data Cache -DataCacheBlockSizeTouch ds.w 1 ; number of bytes in a Block for DCBT DCBTST -InstCacheBlockSize ds.w 1 ; number of bytes in a Block of the Instruction Cache -DataCacheBlockSize ds.w 1 ; number of bytes in a Block of the Data Cache -InstCacheAssociativity ds.w 1 ; Associativity of the Instruction Cache -DataCacheAssociativity ds.w 1 ; Associativity of the Data Cache +ROMImageBaseOffset ds.l 1 ; 028 ; Offset of Base of total ROM image +ROMImageSize ds.l 1 ; 02c ; Number of bytes in ROM image +ROMImageVersion ds.l 1 ; 030 ; ROM Version number for entire ROM -TransCacheTotalSize ds.w 1 ; number of entries in the Translation Cache -TransCacheAssociativity ds.w 1 ; Associativity of the Translation Cache - align 32 ; pad to nice cache block alignment -Size equ *-ProcessorInfo +Mac68KROMOffset ds.l 1 ; 034 ; Offset of base of Macintosh 68K ROM +Mac68KROMSize ds.l 1 ; 038 ; Number of bytes in Macintosh 68K ROM + +ExceptionTableOffset ds.l 1 ; 03c ; Offset of base of PowerPC Exception Table Code +ExceptionTableSize ds.l 1 ; 040 ; Number of bytes in PowerPC Exception Table Code + +HWInitCodeOffset ds.l 1 ; 044 ; Offset of base of Hardware Init Code (field moved!) +HWInitCodeSize ds.l 1 ; 048 ; Number of bytes in Hardware Init Code + +KernelCodeOffset ds.l 1 ; 04c ; Offset of base of NanoKernel Code +KernelCodeSize ds.l 1 ; 050 ; Number of bytes in NanoKernel Code + +EmulatorCodeOffset ds.l 1 ; 054 ; Offset of base of Emulator Code +EmulatorCodeSize ds.l 1 ; 058 ; Number of bytes in Emulator Code + +OpcodeTableOffset ds.l 1 ; 05c ; Offset of base of Opcode Table +OpcodeTableSize ds.l 1 ; 060 ; Number of bytes in Opcode Table + +BootstrapVersion ds.b 16 ; 064 ; Bootstrap loader version info +BootVersionOffset ds.l 1 ; 074 ; offset within EmulatorData of BootstrapVersion +ECBOffset ds.l 1 ; 078 ; offset within EmulatorData of ECB +IplValueOffset ds.l 1 ; 07c ; offset within EmulatorData of IplValue + +EmulatorEntryOffset ds.l 1 ; 080 ; offset within Emulator Code of entry point +KernelTrapTableOffset ds.l 1 ; 084 ; offset within Emulator Code of KernelTrapTable + +TestIntMaskInit ds.l 1 ; 088 ; initial value for test interrupt mask +ClearIntMaskInit ds.l 1 ; 08c ; initial value for clear interrupt mask +PostIntMaskInit ds.l 1 ; 090 ; initial value for post interrupt mask +LA_InterruptCtl ds.l 1 ; 094 ; logical address of Interrupt Control I/O page +InterruptHandlerKind ds.b 1 ; 098 ; kind of handler to use + ds.b 3 ; 099 ; filler + +LA_InfoRecord ds.l 1 ; 09c ; logical address of InfoRecord page +LA_KernelData ds.l 1 ; 0a0 ; logical address of KernelData page +LA_EmulatorData ds.l 1 ; 0a4 ; logical address of EmulatorData page +LA_DispatchTable ds.l 1 ; 0a8 ; logical address of Dispatch Table +LA_EmulatorCode ds.l 1 ; 0ac ; logical address of Emulator Code + +MacLowMemInitOffset ds.l 1 ; 0b0 ; offset to list of LowMem addr/data values + +PageAttributeInit ds.l 1 ; 0b4 ; default WIMG/PP settings for PTE creation +PageMapInitSize ds.l 1 ; 0b8 ; size of page mapping info +PageMapInitOffset ds.l 1 ; 0bc ; offset to page mapping info (from base of ConfigInfo) +PageMapIRPOffset ds.l 1 ; 0c0 ; offset of InfoRecord map info (from base of PageMap) +PageMapKDPOffset ds.l 1 ; 0c4 ; offset of KernelData map info (from base of PageMap) +PageMapEDPOffset ds.l 1 ; 0c8 ; offset of EmulatorData map info (from base of PageMap) + +SegMaps +SegMap32SupInit ds.l 32 ; 0cc ; 32 bit mode Segment Map Supervisor space +SegMap32UsrInit ds.l 32 ; 14c ; 32 bit mode Segment Map User space +SegMap32CPUInit ds.l 32 ; 1cc ; 32 bit mode Segment Map CPU space +SegMap32OvlInit ds.l 32 ; 24c ; 32 bit mode Segment Map Overlay mode + +BATRangeInit ds.l 32 ; 2cc ; BAT mapping ranges + +BatMap32SupInit ds.l 1 ; 34c ; 32 bit mode BAT Map Supervisor space +BatMap32UsrInit ds.l 1 ; 350 ; 32 bit mode BAT Map User space +BatMap32CPUInit ds.l 1 ; 354 ; 32 bit mode BAT Map CPU space +BatMap32OvlInit ds.l 1 ; 358 ; 32 bit mode BAT Map Overlay mode + +SharedMemoryAddr ds.l 1 ; 35c ; physical address of Mac/Smurf shared message mem + +PA_RelocatedLowMemInit ds.l 1 ; 360 ; physical address of RelocatedLowMem + +OpenFWBundleOffset ds.l 1 ; 364 ; Offset of base of OpenFirmware PEF Bundle +OpenFWBundleSize ds.l 1 ; 368 ; Number of bytes in OpenFirmware PEF Bundle + +LA_OpenFirmware ds.l 1 ; 36c ; logical address of Open Firmware +PA_OpenFirmware ds.l 1 ; 370 ; physical address of Open Firmware +LA_HardwarePriv ds.l 1 ; 374 ; logical address of HardwarePriv callback + +; Used to stop here, plus 8 bytes for cache block alignment (0x380 bytes). +; Now there be more! + +Debug ds.w 1 ; 378 ; > 256 required for screen log +DebugThreshold equ 257 + + org $388 +DebugFlags ds.l 1 ; 388 ; bit 1<< 1 required for screen log +NanodbgrFlagShift equ 0 +NanodbgrFlagBit equ 31 - NanodbgrFlagShift +LogFlagShift equ 1 +LogFlagBit equ 31 - LogFlagShift + + org $100 +Size equ * endr + + ;_______________________________________________________________________ ; System Info Record ; @@ -273,70 +342,112 @@ Size equ *-ProcessorInfo ; software. ;_______________________________________________________________________ -NKSystemInfoPtr equ $5FFFEFF0 ; logical address of NKSystemInfo record -NKSystemInfoVer equ $5FFFEFF4 ; version number of NKSystemInfo record -NKSystemInfoLen equ $5FFFEFF6 ; length of NKSystemInfo record +NKSystemInfoPtr equ $68FFEFF0 ; logical address of NKSystemInfo record +NKSystemInfoVer equ $68FFEFF4 ; version number of NKSystemInfo record +NKSystemInfoLen equ $68FFEFF6 ; length of NKSystemInfo record NKSystemInfo record 0,increment -PhysicalMemorySize ds.l 1 ; Number of bytes in Physical RAM -UsableMemorySize ds.l 1 ; Number of bytes in Usable RAM -LogicalMemorySize ds.l 1 ; Number of bytes in Logical RAM -HashTableSize ds.l 1 ; Number of bytes in Memory Hash Table +PhysicalMemorySize ds.l 1 ; 000, irp+dc0 ; Number of bytes in Physical RAM +UsableMemorySize ds.l 1 ; 004, irp+dc4 ; Number of bytes in Usable RAM +LogicalMemorySize ds.l 1 ; 008, irp+dc8 ; Number of bytes in Logical RAM +HashTableSize ds.l 1 ; 00c, irp+dcc ; Number of bytes in Memory Hash Table -L2DataCacheTotalSize ds.l 1 ; number of bytes in the L2 Data Cache -L2InstCacheTotalSize ds.l 1 ; number of bytes in the L2 Instruction Cache -L2CombinedCaches ds.w 1 ; 1 <- combined or no cache, 0 <- split cache -L2InstCacheBlockSize ds.w 1 ; number of bytes in a Block of the L2 Instruction Cache -L2DataCacheBlockSize ds.w 1 ; number of bytes in a Block of the L2 Data Cache -L2InstCacheAssociativity ds.w 1 ; Associativity of the L2 Instruction Cache -L2DataCacheAssociativity ds.w 1 ; Associativity of the L2 Data Cache - ds.b 2 ; unused +L2DataCacheTotalSize ds.l 1 ; 010, irp+dd0 ; number of bytes in the L2 Data Cache +L2InstCacheTotalSize ds.l 1 ; 014, irp+dd4 ; number of bytes in the L2 Instruction Cache +L2CombinedCaches ds.w 1 ; 018, irp+dd8 ; 1 <- combined or no cache, 0 <- split cache +L2InstCacheBlockSize ds.w 1 ; 01a, irp+dda ; number of bytes in a Block of the L2 Instruction Cache +L2DataCacheBlockSize ds.w 1 ; 01c, irp+ddc ; number of bytes in a Block of the L2 Data Cache +L2InstCacheAssociativity ds.w 1 ; 01e, irp+dde ; Associativity of the L2 Instruction Cache +L2DataCacheAssociativity ds.w 1 ; 020, irp+de0 ; Associativity of the L2 Data Cache + ds.b 2 ; 022, irp+de2 ; unused - ds.b 2 ; unused -FlashManufacturerCode ds.b 1 ; Flash ROM Manufacturer code -FlashDeviceCode ds.b 1 ; Flash ROM Device code -FlashStart ds.l 1 ; Starting address of Flash ROM -FlashSize ds.l 1 ; Number of bytes in Flash ROM + ds.b 2 ; 024, irp+de4 ; unused +FlashManufacturerCode ds.b 1 ; 026, irp+de6 ; Flash ROM Manufacturer code +FlashDeviceCode ds.b 1 ; 027, irp+de7 ; Flash ROM Device code +FlashStart ds.l 1 ; 028, irp+de8 ; Starting address of Flash ROM +FlashSize ds.l 1 ; 02c, irp+dec ; Number of bytes in Flash ROM - align 16 -Bank0Start ds.l 1 ; Starting address of RAM bank 0 -Bank0Size ds.l 1 ; Number of bytes in RAM bank 0 -Bank1Start ds.l 1 ; Starting address of RAM bank 1 -Bank1Size ds.l 1 ; Number of bytes in RAM bank 1 -Bank2Start ds.l 1 ; Starting address of RAM bank 2 -Bank2Size ds.l 1 ; Number of bytes in RAM bank 2 -Bank3Start ds.l 1 ; Starting address of RAM bank 3 -Bank3Size ds.l 1 ; Number of bytes in RAM bank 3 -Bank4Start ds.l 1 ; Starting address of RAM bank 4 -Bank4Size ds.l 1 ; Number of bytes in RAM bank 4 -Bank5Start ds.l 1 ; Starting address of RAM bank 5 -Bank5Size ds.l 1 ; Number of bytes in RAM bank 5 -Bank6Start ds.l 1 ; Starting address of RAM bank 6 -Bank6Size ds.l 1 ; Number of bytes in RAM bank 6 -Bank7Start ds.l 1 ; Starting address of RAM bank 7 -Bank7Size ds.l 1 ; Number of bytes in RAM bank 7 -Bank8Start ds.l 1 ; Starting address of RAM bank 8 -Bank8Size ds.l 1 ; Number of bytes in RAM bank 8 -Bank9Start ds.l 1 ; Starting address of RAM bank 9 -Bank9Size ds.l 1 ; Number of bytes in RAM bank 9 -Bank10Start ds.l 1 ; Starting address of RAM bank 10 -Bank10Size ds.l 1 ; Number of bytes in RAM bank 10 -Bank11Start ds.l 1 ; Starting address of RAM bank 11 -Bank11Size ds.l 1 ; Number of bytes in RAM bank 11 -Bank12Start ds.l 1 ; Starting address of RAM bank 12 -Bank12Size ds.l 1 ; Number of bytes in RAM bank 12 -Bank13Start ds.l 1 ; Starting address of RAM bank 13 -Bank13Size ds.l 1 ; Number of bytes in RAM bank 13 -Bank14Start ds.l 1 ; Starting address of RAM bank 14 -Bank14Size ds.l 1 ; Number of bytes in RAM bank 14 -Bank15Start ds.l 1 ; Starting address of RAM bank 15 -Bank15Size ds.l 1 ; Number of bytes in RAM bank 15 - align 32 ; pad to nice cache block alignment -MaxBanks equ 16 ; 16 banks, 0É15 -Size equ *-SystemInfo +Bank0Start ds.l 1 ; 030, irp+df0 ; Starting address of RAM bank 0 +Bank0Size ds.l 1 ; 034, irp+df4 ; Number of bytes in RAM bank 0 +Bank1Start ds.l 1 ; 038, irp+df8 ; Starting address of RAM bank 1 +Bank1Size ds.l 1 ; 03c, irp+dfc ; Number of bytes in RAM bank 1 +Bank2Start ds.l 1 ; 040, irp+e00 ; Starting address of RAM bank 2 +Bank2Size ds.l 1 ; 044, irp+e04 ; Number of bytes in RAM bank 2 +Bank3Start ds.l 1 ; 048, irp+e08 ; Starting address of RAM bank 3 +Bank3Size ds.l 1 ; 04c, irp+e0c ; Number of bytes in RAM bank 3 +Bank4Start ds.l 1 ; 050, irp+e10 ; Starting address of RAM bank 4 +Bank4Size ds.l 1 ; 054, irp+e14 ; Number of bytes in RAM bank 4 +Bank5Start ds.l 1 ; 058, irp+e18 ; Starting address of RAM bank 5 +Bank5Size ds.l 1 ; 05c, irp+e1c ; Number of bytes in RAM bank 5 +Bank6Start ds.l 1 ; 060, irp+e20 ; Starting address of RAM bank 6 +Bank6Size ds.l 1 ; 064, irp+e24 ; Number of bytes in RAM bank 6 +Bank7Start ds.l 1 ; 068, irp+e28 ; Starting address of RAM bank 7 +Bank7Size ds.l 1 ; 06c, irp+e2c ; Number of bytes in RAM bank 7 +Bank8Start ds.l 1 ; 070, irp+e30 ; Starting address of RAM bank 8 +Bank8Size ds.l 1 ; 074, irp+e34 ; Number of bytes in RAM bank 8 +Bank9Start ds.l 1 ; 078, irp+e38 ; Starting address of RAM bank 9 +Bank9Size ds.l 1 ; 07c, irp+e3c ; Number of bytes in RAM bank 9 +Bank10Start ds.l 1 ; 080, irp+e40 ; Starting address of RAM bank 10 +Bank10Size ds.l 1 ; 084, irp+e44 ; Number of bytes in RAM bank 10 +Bank11Start ds.l 1 ; 088, irp+e48 ; Starting address of RAM bank 11 +Bank11Size ds.l 1 ; 08c, irp+e4c ; Number of bytes in RAM bank 11 +Bank12Start ds.l 1 ; 090, irp+e50 ; Starting address of RAM bank 12 +Bank12Size ds.l 1 ; 094, irp+e54 ; Number of bytes in RAM bank 12 +Bank13Start ds.l 1 ; 098, irp+e58 ; Starting address of RAM bank 13 +Bank13Size ds.l 1 ; 09c, irp+e5c ; Number of bytes in RAM bank 13 +Bank14Start ds.l 1 ; 0a0, irp+e60 ; Starting address of RAM bank 14 +Bank14Size ds.l 1 ; 0a4, irp+e64 ; Number of bytes in RAM bank 14 +Bank15Start ds.l 1 ; 0a8, irp+e68 ; Starting address of RAM bank 15 +Bank15Size ds.l 1 ; 0ac, irp+e6c ; Number of bytes in RAM bank 15 +Bank16Start ds.l 1 ; 0b0, irp+e70 ; Starting address of RAM bank 16 +Bank16Size ds.l 1 ; 0b4, irp+e74 ; Number of bytes in RAM bank 16 +Bank17Start ds.l 1 ; 0b8, irp+e78 ; Starting address of RAM bank 17 +Bank17Size ds.l 1 ; 0bc, irp+e7c ; Number of bytes in RAM bank 17 +Bank18Start ds.l 1 ; 0c0, irp+e80 ; Starting address of RAM bank 18 +Bank18Size ds.l 1 ; 0c4, irp+e84 ; Number of bytes in RAM bank 18 +Bank19Start ds.l 1 ; 0c8, irp+e88 ; Starting address of RAM bank 19 +Bank19Size ds.l 1 ; 0cc, irp+e8c ; Number of bytes in RAM bank 19 +Bank20Start ds.l 1 ; 0d0, irp+e90 ; Starting address of RAM bank 20 +Bank20Size ds.l 1 ; 0d4, irp+e94 ; Number of bytes in RAM bank 20 +Bank21Start ds.l 1 ; 0d8, irp+e98 ; Starting address of RAM bank 21 +Bank21Size ds.l 1 ; 0dc, irp+e9c ; Number of bytes in RAM bank 21 +Bank22Start ds.l 1 ; 0e0, irp+ea0 ; Starting address of RAM bank 22 +Bank22Size ds.l 1 ; 0e4, irp+ea4 ; Number of bytes in RAM bank 22 +Bank23Start ds.l 1 ; 0e8, irp+ea8 ; Starting address of RAM bank 23 +Bank23Size ds.l 1 ; 0ec, irp+eac ; Number of bytes in RAM bank 23 +Bank24Start ds.l 1 ; 0f0, irp+eb0 ; Starting address of RAM bank 24 +Bank24Size ds.l 1 ; 0f4, irp+eb4 ; Number of bytes in RAM bank 24 +Bank25Start ds.l 1 ; 0f8, irp+eb8 ; Starting address of RAM bank 25 +Bank25Size ds.l 1 ; 0fc, irp+ebc ; Number of bytes in RAM bank 25 +EndOfBanks +MaxBanks equ 26 ; Pads out to old struct len (cache block), more to come... + + ; Interrupt Support Data +IntCntrBaseAddr ds.l 1 ; 100, irp+ec0 ; Interrupt Controller Base Address (variable is used since this is a PCI Dev and address is relocatable) +IntPendingReg ds.l 2 ; 104, irp+ec4 ; Data of current interrupts pending register + + ; These fields were added to report information about tightly-coupled L2 caches. + ; The inline L2 information should be used in situations where there is a CPU + ; card L2 cache that can coexist with a motherboard L2. + +InlineL2DSize ds.l 1 ; 10c, irp+ecc ; Size of in-line L2 Dcache +InlineL2ISize ds.l 1 ; 110, irp+ed0 ; Size of in-line L2 Icache +InlineL2Combined ds.w 1 ; 114, irp+ed4 ; 1 <- combined or no cache, 0 <- split cache +InlineL2IBlockSize ds.w 1 ; 116, irp+ed6 ; Block size of in-line I L2 cache +InlineL2DBlockSize ds.w 1 ; 118, irp+ed8 ; Block size of in-line D L2 cache +InlineL2IAssoc ds.w 1 ; 11a, irp+eda ; Associativity of L2 I +InlineL2DAssoc ds.w 1 ; 11c, irp+edc ; Associativity of L2 D + ds.w 1 ; 11e, irp+ede ; pad + + ; More Interrupt Support Data +IntsCompleted ds.l 2 ; 120, irp+ee0 ; completed interrupts + + ds.b $18 +Size equ * endr + ;_______________________________________________________________________ ; Diagnostic Info Record ; @@ -344,19 +455,52 @@ Size equ *-SystemInfo ; the NanoKernel, and from the NanoKernel to user mode software. ;_______________________________________________________________________ -nkDiagInfoPtr equ $5FFFEFE8 ; logical address of DiagnosticInfo record -nkDiagInfoVer equ $5FFFEFEC ; version number of DiagnosticInfo record -nkDiagInfoLen equ $5FFFEFEE ; length of DiagnosticInfo record +NKDiagInfoPtr equ $68FFEFE8 ; logical address of DiagnosticInfo record +NKDiagInfoVer equ $68FFEFEC ; version number of DiagnosticInfo record +NKDiagInfoLen equ $68FFEFEE ; length of DiagnosticInfo record -nkDiagInfo record 0,increment - ds.b 236 ; it WILL all fit in 256 bytes -DiagPOSTResult2 ds.l 1 ; POST results -DiagPOSTResult1 ds.l 1 ; POST results -DiagEmoRestart ds.l 1 ; Burn in restart flag -DiagWarmStartHigh ds.l 1 ; First long of native warm start (WLSC) -DiagWarmStartLow ds.l 1 ; Second long of native warm start (SamB) - align 32 ; pad to nice cache block alignment -Size equ *-nkDiagInfo +NKDiagInfo record 0,increment +BankMBFailOffset ds.l 1 ; 000 ; Mother Board RAM failure code +BankAFailOffset ds.l 1 ; 004 ; Bank A RAM failure code +BankBFailOffset ds.l 1 ; 008 ; Bank B RAM failure code +BankCFailOffset ds.l 1 ; 00c ; Bank C RAM failure code + +BankDFailOffset ds.l 1 ; 010 ; Bank D RAM failure code +BankEFailOffset ds.l 1 ; 014 ; Bank E RAM failure code +BankFFailOffset ds.l 1 ; 018 ; Bank F RAM failure code +BankGFailOffset ds.l 1 ; 01c ; Bank G RAM failure code + +BankHFailOffset ds.l 1 ; 020 ; Bank H RAM failure code +CacheFailOffset ds.l 1 ; 024 ; cache failure code +LongBootParamOffset ds.l 1 ; 028 ; on longBoot this is where the params will be +POSTTraceOffset ds.l 1 ; 02c ; this tells us what route the POST took + +POSTOldWarmOffset ds.l 1 ; 030 ; logged address of old warmstart flag +POSTOldLongOffset ds.l 1 ; 034 ; logged address of old long boot flag +POSTOldGlobbOffset ds.l 1 ; 038 ; logged address of old Diagnostic Info Record +POSTOldParamOffset ds.l 1 ; 03c ; the params from the old diag globb + +POSTStartRTCUOffset ds.l 1 ; 040 ; PPC Real Time Clock Upper at start of POST +POSTStartRTCLOffset ds.l 1 ; 044 ; PPC Real Time Clock Lower at start of POST +POSTEndRTCUOffset ds.l 1 ; 048 ; PPC Real Time Clock Upper at end of POST +POSTEndRTCLOffset ds.l 1 ; 04c ; PPC Real Time Clock Lower at end of POST + +POSTTestTypeOffset ds.l 1 ; 050 ; when long RAM tests fail test type which failed is put here +POSTError2Offset ds.l 1 ; 054 ; result codes from tests +POSTError3Offset ds.l 1 ; 058 ; result codes from tests +POSTError4Offset ds.l 1 ; 05c ; result codes from tests + +RegistersStore ds.b 140 ; 060 ; store all 60x registers here, still fit into 256 bytes size. + +; Everything BEFORE here is new (hence the funny-sized register store) + +DiagPOSTResult2 ds.l 1 ; 0ec ; POST results +DiagPOSTResult1 ds.l 1 ; 0f0 ; POST results +DiagLongBootSig ds.l 1 ; 0f4 ; Burn in restart flag +DiagWarmStartHigh ds.l 1 ; 0f8 ; First long of native warm start (WLSC) +DiagWarmStartLow ds.l 1 ; 0fc ; Second long of native warm start (SamB) + +Size equ * endr @@ -368,30 +512,278 @@ Size equ *-nkDiagInfo ; software. ;_______________________________________________________________________ -nkNanoKernelInfoPtr equ $5FFFEFE0 ; logical address of NanoKernelInfo record -nkNanoKernelInfoVer equ $5FFFEFE4 ; version number of NanoKernelInfo record -nkNanoKernelInfoLen equ $5FFFEFE6 ; length of NanoKernelInfo record +NKNanoKernelInfoPtr equ $68FFEFE0 ; logical address of NanoKernelInfo record +NKNanoKernelInfoVer equ $68FFEFE4 ; version number of NanoKernelInfo record +NKNanoKernelInfoLen equ $68FFEFE6 ; length of NanoKernelInfo record -nkNanoKernelInfo record 0,increment -ExceptionCauseCounts ds.l 32 ; counters per exception cause -NanoKernelCallCounts ds.l 16 ; counters per NanoKernel call -ExternalIntCount ds.l 1 ; count of External Interrupts -MisalignmentCount ds.l 1 ; count of Misalignment Interrupts -FPUReloadCount ds.l 1 ; count of FPU reloads on demand -DecrementerIntCount ds.l 1 ; count of Decrementer Interrupts -QuietWriteCount ds.l 1 ; count of Writes to Quiet Read-Only memory -HashTableCreateCount ds.l 1 ; count of Hash Table Entry creations -HashTableDeleteCount ds.l 1 ; count of Hash Table Entry deletions -HashTableOverflowCount ds.l 1 ; count of Hash Table Entry overflows -EmulatedUnimpInstCount ds.l 1 ; count of Emulated unimplemented instructions -NCBPtrCacheMissCount ds.l 1 ; count of NCB Pointer cache misses -ExceptionPropagateCount ds.l 1 ; count of Exceptions propagated to system -ExceptionForcedCount ds.l 1 ; count of Exceptions forced to system - align 8 ; align for 64 bit time base counters -SysContextCpuTime ds.l 2 ; CPU Time used by System Context -AltContextCpuTime ds.l 2 ; CPU Time used by Alternate Context - align 32 ; pad to nice cache block alignment -Size equ *-nkNanoKernelInfo +NKNanoKernelInfo record 0,increment +ExceptionCauseCounts ds.l 32 ; 000, kdp+dc0 ; counters per exception cause +NanoKernelCallCounts ds.l 16 ; 080, kdp+e40 ; counters per NanoKernel call +ExternalIntCount ds.l 1 ; 0c0, kdp+e80 ; count of External Interrupts +MisalignmentCount ds.l 1 ; 0c4, kdp+e84 ; count of Misalignment Interrupts +FPUReloadCount ds.l 1 ; 0c8, kdp+e88 ; count of FPU reloads on demand +DecrementerIntCount ds.l 1 ; 0cc, kdp+e8c ; count of Decrementer Interrupts +QuietWriteCount ds.l 1 ; 0d0, kdp+e90 ; count of Writes to Quiet Read-Only memory +HashTableCreateCount ds.l 1 ; 0d4, kdp+e94 ; count of Hash Table Entry creations +HashTableDeleteCount ds.l 1 ; 0d8, kdp+e98 ; count of Hash Table Entry deletions +HashTableOverflowCount ds.l 1 ; 0dc, kdp+e9c ; count of Hash Table Entry overflows +EmulatedUnimpInstCount ds.l 1 ; 0e0, kdp+ea0 ; count of Emulated unimplemented instructions +NCBPtrCacheMissCount ds.l 1 ; 0e4, kdp+ea4 ; count of NCB Pointer cache misses +ExceptionPropagateCount ds.l 1 ; 0e8, kdp+ea8 ; count of Exceptions propagated to system +ExceptionForcedCount ds.l 1 ; 0ec, kdp+eac ; count of Exceptions forced to system +SysContextCpuTime ds.l 2 ; 0f0, kdp+eb0 ; CPU Time used by System Context +AltContextCpuTime ds.l 2 ; 0f8, kdp+eb4 ; CPU Time used by Alternate Context + +; This stuff is new (starts at 0x100) + +blueProcessID ds.l 1 ; 100, kdp+ec0 ; ID of the blue process. +blueTaskID ds.l 1 ; 104, kdp+ec4 ; ID of the blue task. +pageQueueID ds.l 1 ; 108, kdp+ec8 ; ID of the page fault queue. +TaskCount ds.l 1 ; 10c, kdp+ecc ; Number of tasks. +FreePoolExtendCount ds.l 1 ; 110, kdp+ed0 ; Number of pages given to the nanokernel. + +;rsrv1 ds.l 3 ; 114, kdp+ed4 ; reserved??? + +; My additions + + org $11c +ConfigFlags ds.l 1 ; 11c, kdp+edc ; includes ScreenConsole ... TODO put flag equs here +NanodbgrFlagShift equ 1 +NanodbgrFlagBit equ 31 - NanodbgrFlagShift +LogFlagShift equ 3 +LogFlagBit equ 31 - LogFlagShift +; bit 31 always set on replacement, bit 27 set on replacement with ROM 2.7f3 or later + + org $128 +VMDispatchCountTblPtr ds.l 1 ; 128, kdp+ee8 + ds.l 1 + ds.l 1 +MPDispatchCountTblPtr ds.l 1 ; 134, kdp+ef4 ; ??????? +AddrSpcSetCtr ds.l 1 ; 138, kdp+ef8 ; incremented by SetAddrSpcRegisters +IDCtr ds.l 1 ; 13c, kdp+efc + + ds.b $20 +Size equ * + endr + + + +;_______________________________________________________________________ +; Processor Info Record +; +; Used to pass Processor information from the NanoKernel to user mode +; software. +;_______________________________________________________________________ + +ProcessorInfoPtr equ $68FFEFD8 ; logical address of ProcessorInfo record +ProcessorInfoVer equ $68FFEFDC ; version number of ProcessorInfo record +ProcessorInfoLen equ $68FFEFDE ; length of ProcessorInfo record + +ProcessorInfo record 0,increment +ProcessorVersionReg ds.l 1 ; 000, kdp+f20 ; contents of the PVR special purpose register +CpuClockRateHz ds.l 1 ; 004, kdp+f24 ; CPU Clock frequency +BusClockRateHz ds.l 1 ; 008, kdp+f28 ; Bus Clock frequency +DecClockRateHz ds.l 1 ; 00c, kdp+f2c ; Decrementer Clock frequency + +Ovr +PageSize ds.l 1 ; 010, kdp+f30 ; number of bytes in a memory page +DataCacheTotalSize ds.l 1 ; 014, kdp+f34 ; number of bytes in the Data Cache +InstCacheTotalSize ds.l 1 ; 018, kdp+f38 ; number of bytes in the Instruction Cache +CoherencyBlockSize ds.w 1 ; 01c, kdp+f3c ; number of bytes in a Coherency Block +ReservationGranuleSize ds.w 1 ; 01e, kdp+f3e ; number of bytes in a Reservation Granule +CombinedCaches ds.w 1 ; 020, kdp+f40 ; 1 <- combined or no cache, 0 <- split cache +InstCacheLineSize ds.w 1 ; 022, kdp+f42 ; number of bytes in a Line of the Instruction Cache +DataCacheLineSize ds.w 1 ; 024, kdp+f44 ; number of bytes in a Line of the Data Cache +DataCacheBlockSizeTouch ds.w 1 ; 026, kdp+f46 ; number of bytes in a Block for DCBT DCBTST +InstCacheBlockSize ds.w 1 ; 028, kdp+f48 ; number of bytes in a Block of the Instruction Cache +DataCacheBlockSize ds.w 1 ; 02a, kdp+f4a ; number of bytes in a Block of the Data Cache +InstCacheAssociativity ds.w 1 ; 02c, kdp+f4c ; Associativity of the Instruction Cache +DataCacheAssociativity ds.w 1 ; 02e, kdp+f4e ; Associativity of the Data Cache + +TransCacheTotalSize ds.w 1 ; 030, kdp+f50 ; number of entries in the Translation Cache +TransCacheAssociativity ds.w 1 ; 032, kdp+f52 ; Associativity of the Translation Cache +OvrEnd + +; These fields were added to report information about back-side L2 caches + +ProcessorL2DSize ds.l 1 ; 034, kdp+f54 ; Size of back-side L2 Dcache +ProcessorL2ISize ds.l 1 ; 038, kdp+f58 ; Size of back-side L2 Icache +ProcessorL2Combined ds.w 1 ; 03c, kdp+f5c ; 1 <- combined or no cache, 0 <- split cache +ProcessorL2IBlockSize ds.w 1 ; 03e, kdp+f5e ; Block size of back-side I L2 cache +ProcessorL2DBlockSize ds.w 1 ; 040, kdp+f60 ; Block size of back-side D L2 cache +ProcessorL2IAssoc ds.w 1 ; 042, kdp+f62 ; Associativity of L2 I +ProcessorL2DAssoc ds.w 1 ; 044, kdp+f64 ; Associativity of L2 D + +filler1 ds.w 1 ; 046, kdp+f66 ; align to long + +; ProcessorFlags - Definitions for the processor flags field. These are bit positions, +; as in 1 << hasVMX, and not masks. +hasL2CR equ 0 +hasPLRUL1 equ 1 +hasTAU equ 2 +hasVMX equ 3 +unknownFlag equ 4 +hasExtraBATs equ 5 +ProcessorFlags ds.l 1 ; 048, kdp+f68 ; flags to specify processor features + + align 5 ; pad to nice cache block alignment + + org $05e +SetToZero ds.w 1 ; 05e, kdp+f7e ; by same code that sets below +CpuClockRateHzCopy ds.l 1 ; 060, kdp+f80 ; copies by Init.s +BusClockRateHzCopy ds.l 1 ; 064, kdp+f84 ; copies by Init.s +DecClockRateHzCopy ds.l 1 ; 068, kdp+f88 ; copies by Init.s + + ds.b $34 +Size equ * + endr + + + +;_______________________________________________________________________ +; Hardware Info Record +; +; Used to pass hardware information from the NanoKernel to user mode +; software. +;_______________________________________________________________________ + +NKHWInfoPtr equ $68FFEFD0 ; logical address of HWInfo record +NKHWInfoVer equ $68FFEFD4 ; version number of HWInfo record +NKHWInfoLen equ $68FFEFD6 ; length of HWInfo record + +NKHWInfo record 0,increment +MacROM_Base ds.l 1 ; 000, irp+f00 ; base address (physical) of Mac ROM +DeviceTreeBase ds.l 1 ; 004, irp+f04 ; base address of the copied device tree properties +UniversalInfoTableBase ds.l 1 ; 008, irp+f08 ; base address of the Universal Info Table +ConfigInfoTableBase ds.l 1 ; 00c, irp+f0c ; base address of the Config Info Table +VectorLookupTable ds.l 1 ; 010, irp+f10 ; base address of the interrupt vector lookup table (short *) +VectorMaskTable ds.l 1 ; 014, irp+f14 ; base address of the interrupt vector mask table (long *) + +OpenPICBaseAddr ds.l 1 ; 018, irp+f18 ; OpenPIC base address + +ISAMaster8259 ds.l 1 ; 01c, irp+f1c ; ISA Master 8259 ports (char *) +ISASlave8259 ds.l 1 ; 020, irp+f20 ; ISA Slave 8259 ports (char *) +InterruptAck8259 ds.l 1 ; 024, irp+f24 ; address to read to ack 8259 interrupt (long *) + + ; interrupt pending bits (actively changing) + +PendingInts ds.l 2 ; 028, irp+f28 ; 64 bits of pending interrupts + + ; some Mac I/O device base addresses + +ADB_Base ds.l 1 ; 030, irp+f30 ; base address of ADB +SCSI_DMA_Base ds.l 1 ; 034, irp+f34 ; base address of SCSI DMA registers + + ; RTAS related stuff + +RTAS_PrivDataArea ds.l 1 ; 038, irp+f38 ; RTAS private data area +MacOS_NVRAM_Offset ds.l 1 ; 03c, irp+f3c ; offset into nvram to MacOS data + +RTAS_NVRAM_Fetch ds.l 1 ; 040, irp+f40 ; token for RTAS NVRAM fetch +RTAS_NVRAM_Store ds.l 1 ; 044, irp+f44 ; token for RTAS NVRAM store +RTAS_Get_Clock ds.l 1 ; 048, irp+f48 ; token for RTAS clock get +RTAS_Set_Clock ds.l 1 ; 04c, irp+f4c ; token for RTAS clock set +RTAS_Restart ds.l 1 ; 050, irp+f50 ; token for RTAS Restart +RTAS_Shutdown ds.l 1 ; 054, irp+f54 ; token for RTAS Shutdown +RTAS_Restart_At ds.l 1 ; 058, irp+f58 ; token for RTAS system startup at specified time +RTAS_EventScan ds.l 1 ; 05c, irp+f5c ; token for RTAS event scan +RTAS_Check_Exception ds.l 1 ; 060, irp+f60 ; token for RTAS check exception +RTAS_Read_PCI_Config ds.l 1 ; 064, irp+f64 ; token for RTAS read PCI config +RTAS_Write_PCI_Config ds.l 1 ; 068, irp+f68 ; token for RTAS write PCI config + + ; SIO interrupt source numbers for the MPIC + +SIOIntVect ds.w 1 ; 06c, irp+f6c ; SIO (8259 cascade vector) vector number +SIOIntBit ds.w 1 ; 06e, irp+f6e ; SIO (8259 cascade vector) bit number + +Signature ds.l 1 ; 070, irp+f70 ; signature for this record ('Hnfo') + + ; more interrupt source numbers + +SpuriousIntVect ds.w 1 ; 074, irp+f74 ; spurious vector number + +CPU_ID ds.w 1 ; 076, irp+f76 ; the ID of this CPU (universal-tables-related) + +SCCAIntVect ds.w 1 ; 078, irp+f78 ; SCC A (non-DMA) vector number +SCCBIntVect ds.w 1 ; 07a, irp+f7a ; SCC B (non-DMA) vector number +SCSIIntVect ds.w 1 ; 07c, irp+f7c ; SCSI vector number +SCSIDMAIntVect ds.w 1 ; 07e, irp+f7e ; SCSI DMA vector number +VIAIntVect ds.w 1 ; 080, irp+f80 ; VIA vector number +VIAIntBit ds.w 1 ; 082, irp+f82 ; VIA bit number +ADBIntVect ds.w 1 ; 084, irp+f84 ; vector number +NMIIntVect ds.w 1 ; 086, irp+f86 ; NMI vector number +NMIIntBit ds.w 1 ; 088, irp+f88 ; NMI bit number + + ; current (actively changing) interrupt handling variables + +ISAPendingInt ds.w 1 ; 08a, irp+f8a ; currently pending ISA/8259 interrupt +CompletedInts ds.b 8 ; 08c, irp+f8c ; completed interrupts + +nkHWInfoFlagSlowMESH equ 1 ; set if fast MESH doesn't work on this box +nkHWInfoFlagAsynchMESH equ 2 ; set if Synchronous MESH doesn't work on this box +nkHWInfoFlagNoCopySWTLB equ 4 ; set if the software TLB walk code for 603 should NOT be copied +HardwareInfoFlags ds.l 1 ; 094, irp+f94 ; 32 bits of flags (see enum above) + +RTAS_Get_PowerOn_Time ds.l 1 ; 098, irp+f98 ; token for RTAS getting time for system startup + + ds.b $24 +Size equ * + endr + + + +;_______________________________________________________________________ +; Processor State Record +; +; Used to save the state of the processor across sleep. +;_______________________________________________________________________ + +NKProcessorStatePtr equ $68FFEFC8 ; logical address of ProcessorState record +NKProcessorStateVer equ $68FFEFCC ; version number of ProcessorState record +NKProcessorStateLen equ $68FFEFCE ; length of ProcessorState record + +NKProcessorState record 0,increment +saveDBAT0u ds.l 1 ; 000 ; place to store DBAT0U +saveDBAT0l ds.l 1 ; 004 ; place to store DBAT0L +saveDBAT1u ds.l 1 ; 008 ; place to store DBAT1U +saveDBAT1l ds.l 1 ; 00c ; place to store DBAT1L +saveDBAT2u ds.l 1 ; 010 ; place to store DBAT2U +saveDBAT2l ds.l 1 ; 014 ; place to store DBAT2L +saveDBAT3u ds.l 1 ; 018 ; place to store DBAT3U +saveDBAT3l ds.l 1 ; 01c ; place to store DBAT3L + +saveIBAT0u ds.l 1 ; 020 ; place to store IBAT0U +saveIBAT0l ds.l 1 ; 024 ; place to store IBAT0L +saveIBAT1u ds.l 1 ; 028 ; place to store IBAT1U +saveIBAT1l ds.l 1 ; 02c ; place to store IBAT1L +saveIBAT2u ds.l 1 ; 030 ; place to store IBAT2U +saveIBAT2l ds.l 1 ; 034 ; place to store IBAT2L +saveIBAT3u ds.l 1 ; 038 ; place to store IBAT3U +saveIBAT3l ds.l 1 ; 03c ; place to store IBAT3L + +saveSPRG0 ds.l 1 ; 040 ; place to store SPRG0 +saveSPRG1 ds.l 1 ; 044 ; place to store SPRG1 +saveSPRG2 ds.l 1 ; 048 ; place to store SPRG2 +saveSPRG3 ds.l 1 ; 04c ; place to store SPRG3 + +saveL2CR ds.l 1 ; 050 ; place to store Arthur's L2CR + +saveSRR0 ds.l 1 ; 054 ; place to store SRR0 +saveSRR1 ds.l 1 ; 058 ; place to store SRR1 +saveTBU ds.l 1 ; 05c ; place to store TBU +saveTBL ds.l 1 ; 060 ; place to store TBL +saveHID0 ds.l 1 ; 064 ; place to store HID0 +saveDEC ds.l 1 ; 068 ; place to store DEC +saveMSR ds.l 1 ; 06c ; place to store MSR +saveSDR1 ds.l 1 ; 070 ; place to store SDR1 + + ; saveKernelDataPtr needs to always be right after saveReturnAddr + ; because of how the code works. DO NOT CHANGE THIS ORDERING! + +saveReturnAddr ds.l 1 ; 074 ; place to store the addr to jump to. +saveKernelDataPtr ds.l 1 ; 078 ; place to store the KernelDataPtr +saveContextPtr ds.l 1 ; 07c ; place to store the ContextPtr +Size equ * endr diff --git a/Internal/Asm/ResourceMgrPriv.a b/Internal/Asm/ResourceMgrPriv.a index 90da301..1f555e7 100644 --- a/Internal/Asm/ResourceMgrPriv.a +++ b/Internal/Asm/ResourceMgrPriv.a @@ -104,7 +104,7 @@ kPreventFileFromBeingClosedMask equ 16 kAllOverrideAttributesMask equ kOverrideNextMapMask + \ kDontCountOrIndexDuplicatesMask + \ kTwoDeepMask + \ - kPreventFileFromBeingClosedMask + kPreventFileFromBeingClosedMask + 32 + 64 + 128 kAllButOverrideAttributesMask equ 255 - kAllOverrideAttributesMask selectMakeOverrideMap equ 4 diff --git a/Internal/Asm/SysPrivateEqu.a b/Internal/Asm/SysPrivateEqu.a index 301cf1b..cc6234b 100644 --- a/Internal/Asm/SysPrivateEqu.a +++ b/Internal/Asm/SysPrivateEqu.a @@ -436,11 +436,13 @@ emExpansionBusGlobals ds.l 1 ; Pointer to Expansion Bus Manager Globals jSWModemSoundVector ds.l 1 ; Vector to control routine for software modem sound + ds.b 270 + ; NOTE: When adding new fields here, be sure to update the high-level language header files as well ; (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 +emCurVersion EQU $016b ; version emRecSize equ * ; size for this version size equ * diff --git a/Internal/Asm/VectorTableInit.a b/Internal/Asm/VectorTableInit.a index d240bad..06afd27 100644 --- a/Internal/Asm/VectorTableInit.a +++ b/Internal/Asm/VectorTableInit.a @@ -118,13 +118,13 @@ InitVec&TVec proc export ; initialize the vector table vector Endif - ; fill in the unused "holes" with the address of UNIMPLEMENTED + ; fill in the unused "holes" with the address of BADTRAP If (&thisCVect - &lastCVect) > 4 Then - import UNIMPLEMENTED + import BADTRAP - dcb.l (&thisCVect - &lastCVect - 4)/4 ,UNIMPLEMENTED-BASEOFROM+ROMBASE + dcb.l (&thisCVect - &lastCVect - 4)/4 ,BADTRAP-BASEOFROM+ROMBASE Endif diff --git a/Internal/Asm/egretequ.a b/Internal/Asm/egretequ.a index 7d8629e..be7745e 100644 --- a/Internal/Asm/egretequ.a +++ b/Internal/Asm/egretequ.a @@ -109,6 +109,7 @@ ContinueComp ds.l 1 ; vector to power message continue procedure deferredPDM ds.l 1 ; pointer to PDM deferred task to post alert prevPollStack ds.l 1 ; keep address of any other poll stack SpareComp3 ds.l 1 ; spare vector #3 + ds.b $178-$64 ; new EgretGlobSize EQU * ENDR @@ -273,7 +274,8 @@ 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 +; more commands apparently added +MaxPseudoCmd equ $2A ; largest possible pseudo command number ; ;__________________________________________________________________________________________________ diff --git a/Make/Build b/Make/Build index 6016ea5..b797f01 100644 --- a/Make/Build +++ b/Make/Build @@ -285,7 +285,7 @@ Exit 1 End - "{Sources}Tools:Make" -w {MOpts} {Targets} -f "{MakeFile}" > "{MakeOut}" || Exit + Make -w {MOpts} {Targets} -f "{MakeFile}" > "{MakeOut}" || Exit If {EchoCmds} Set Echo 1 diff --git a/Make/FeatureList b/Make/FeatureList index c6913ef..42e3e74 100644 --- a/Make/FeatureList +++ b/Make/FeatureList @@ -13,6 +13,12 @@ # # Change History (most recent first): # +# 1/29/17 HQX Add conditionals for "Custer" (Mirrored Drive Door G4 ROM v10.2.1) +# resources, change TNTPlus to hasPCI. +# 1/9/17 HQX Add Classic flag +# 12/28/16 HQX Finally realise how this works. Patch to emulate the missing +# "ParseFeatures" command. Added NewWorld and TNTPlus flags. +# # 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ # machines # 11/10/93 fau Update from SuperMunggio . @@ -64,7 +70,28 @@ # # -Set AvailableFeatures "hasROMGibbly ¶ +Set cdg5Features "¶ + Vanilla ¶ + LatestHack ¶ + hasPCI ¶ + BlueBox ¶ + NewWorld ¶ + CusterBacklightParcel ¶ + CusterUSBShimKeyboard ¶ + cdg5HappyMac ¶ + NKDebugShim ¶ + NKShowLog ¶ + ExtraNKLogging ¶ + DebugAlways ¶ + SkipTbxiValidation ¶ + TbxiPatchG4Version ¶ + TbxiDisableAppleKiwi ¶ + Wedge ¶ +" + +Set AvailableFeatures "{cdg5Features} ¶ + hasBCScreen ¶ + hasROMGibbly ¶ hasManEject ¶ hasCacheTypeCPU ¶ forPDMProto ¶ @@ -197,12 +224,25 @@ Set AvailableFeatures "hasROMGibbly useROMFonts " - If "` ParseFeatures -a "{AvailableFeatures}" -f ": ROM {1}" `" =~ /': ROM '(Å)¨1/ - Set Defines "{¨1}" - Else - Exit 1 - End + +# # ParseFeatures is lost to the ages... +# If "` ParseFeatures -a "{AvailableFeatures}" -f ": ROM {1}" `" =~ /': ROM '(Å)¨1/ +# Set Defines "{¨1}" +# Else +# Exit 1 +# End + +# Set Defines "-d " + + # This block of code replaces it... + For Feature in {AvailableFeatures} + Set Defines "{Defines} -d {Feature}=`Evaluate " {1} " =~ /Å {Feature} Å/`" + End + + # Ugh! + Set Defines "`Echo {Defines} | StreamEdit -e '¥,° Replace /=1/ "=TRUE" -c °' -e '¥,° Replace /=0/ "=FALSE" -c °'`" + For Override in {2} If "{Override}" =~ /(Å)¨1=(Å)¨2/ @@ -214,9 +254,9 @@ Set AvailableFeatures "hasROMGibbly End If {Value} =~ /true/ - Set Value TRUE + Set Value 1 #TRUE # to allow overrides to work right! Else If {Value} =~ /false/ - Set Value FALSE + Set Value 0 #FALSE End If "{Defines}" =~ /(Å)¨3{Name}=[Â ¶t]+(Å)¨4/ diff --git a/Make/MainCode.Make b/Make/MainCode.Make index a7fc664..c69bca3 100644 --- a/Make/MainCode.Make +++ b/Make/MainCode.Make @@ -54,30 +54,23 @@ MainCodeLibs = "{MiscDir}GoNativeROMLib.o" ¶ "{LibDir}SlotMgr.lib" ¶ "{LibDir}SCSI.lib" ¶ - "{LibDir}SCSI4pt3.lib" ¶ "{LibDir}HFS.lib" ¶ - "{LibDir}PPC.lib" ¶ "{LibDir}ADBMgr.lib" ¶ - "{LibDir}TimeMgr.lib" ¶ "{LibDir}Toolbox.lib" ¶ - "{LibDir}CommToolboxPatch.Lib" ¶ "{LibDir}MemoryMgr.lib" ¶ "{LibDir}AliasMgr.lib" ¶ "{LibDir}ComponentMgr.lib" ¶ "{LibDir}DataAccessMgr.lib" ¶ - "{LibDir}EditionMgr.lib" ¶ "{LibDir}ExpansionBusMgr.lib" ¶ - "{LibDir}HelpMgr.lib" ¶ - "{LibDir}SoundMgr.lib" ¶ "{LibDir}Gestalt.lib" ¶ - "{LibDir}IconUtils.lib" ¶ "{LibDir}NotificationMgr.lib" ¶ - "{LibDir}PictUtilities.lib" ¶ "{LibDir}ToolboxEventMgr.lib" ¶ "{LibDir}ControlMgr.lib" ¶ "{LibDir}DisplayMgr.lib" ¶ "{LibDir}WindowMgr.lib" ¶ "{LibDir}MenuMgr.lib" ¶ + "{LibDir}ATAMgr.lib" ¶ + "{ObjDir}DeviceMgr.a.o" ¶ # ¶ # DispatchHelper and DialogMgr.lib need to be colocated ¶ # ¶ @@ -89,15 +82,8 @@ MainCodeLibs = "{LibDir}ResourceMgr.lib" ¶ "{LibDir}ScriptMgr.lib" ¶ "{LibDir}CQD.lib" ¶ - "{LibDir}TextServicesMgr.lib" ¶ "{LibDir}FontMgr.lib" ¶ - "{LibDir}RomInterface.Lib" ¶ - "{LibDir}RomStandardLib.lib" ¶ - "{LibDir}StartTest.lib" ¶ - "{LibDir}VideoDriver.lib" ¶ - "{ObjDir}WallyWorld.a.o" ¶ - "{ObjDir}FPEmulation.a.o" ¶ - "{LibDir}Beep.lib" ¶ + "{LibDir}Lastly.lib" ¶ # ¶ # Keep DispTable at end ¶ # ¶ @@ -118,7 +104,7 @@ MainCodeLibs = # # Vectorization # -"{LibDir}MainCode.Lib" Ä {MainCodeLibs} "{ObjDir}VectorTablePatch.a.o" +"{LibDir}MainCode.Lib" Ä {MainCodeLibs} "{ObjDir}VectorTablePatch.a.o" "{ToolDir}Vectorize" "{ToolDir}Vectorize" -w -v "{ObjDir}VectorTablePatch.a.o" -log "{TextDir}MainCode.Sym" {StdVOpts} -o "{Targ}" {MainCodeLibs} "{ObjDir}VectorTablePatch.a.o" Ä "{Sources}Make:VectorTable.a" "{IntAIncludes}VectorTablePatch.a" diff --git a/Make/RISC.make b/Make/RISC.make index 31b0c0f..d71d569 100644 --- a/Make/RISC.make +++ b/Make/RISC.make @@ -162,26 +162,21 @@ 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: -MAOpts = -d TRUE=1 -d FALSE=0 -d Alignment=8 -d CPU=20 -d ROMRelease=$D4C1 -wb -d SubRelease=3 -blksize 62 -MCOpts = -d TRUE=1 -d FALSE=0 -d Alignment=8 -d CPU=20 -d ROMRelease=$D4C1 -b3 -mbg full -mc68020 -blksize 62 -opt full +MAOpts = -d TRUE=1 -d FALSE=0 -d Alignment=8 -d CPU=20 -d ROMRelease=$45F6 -wb -d SubRelease=1 -blksize 62 +MCOpts = -d TRUE=1 -d FALSE=0 -d Alignment=8 -d CPU=20 -d ROMRelease=$45F6 -b3 -mbg full -mc68020 -blksize 62 -opt full MPOpts = -mbg full -mc68020 -RomBase = $40800000 +RomBase = $FFC00000 Features = hasRISCV0ResMgrPatches ¶ hasDoubleByte ¶ - hasAMIC ¶ SupportNativeComponents ¶ Script_Char_Extra ¶ hasPenFraction ¶ hasFullKerning ¶ hasGlyphState ¶ - hasNewHeapMgr ¶ hasPDMMaceEnet ¶ hasAppleTalkInROM ¶ hasMixedMode ¶ @@ -189,9 +184,7 @@ Features = hasRISCV0ResMgrPatches hasSCSIDiskModeFeature ¶ hasSysSevenResources ¶ hasDataAccessPACK ¶ - hasYMCA ¶ hasCPUIDRegister ¶ - hasHMC ¶ has2MegROMOrMore ¶ hasVideoIn ¶ hasAsyncSCSI ¶ @@ -208,7 +201,6 @@ Features = hasRISCV0ResMgrPatches forLocalizability ¶ has040MMU ¶ hasADBKeyLayouts ¶ - hasASC ¶ hasAliasMgr ¶ hasApple2Fonts ¶ hasAppleEventMgr ¶ @@ -216,49 +208,25 @@ Features = hasRISCV0ResMgrPatches hasBattery ¶ hasCommToolbox ¶ hasCQD ¶ - hasDAFB ¶ - hasDJMEMC ¶ - hasDataAccessMgr ¶ hasDisplayMgr ¶ hasDisplayMgrWindows ¶ hasEDisk ¶ - hasEclipseVIA2 ¶ - hasEditionMgr ¶ hasEgret ¶ hasExtendedCharacterSet ¶ - hasFMC ¶ hasGDU ¶ - hasGlue ¶ - hasGrandCentral ¶ hasIdle ¶ - hasIopScc ¶ - hasIopSwim ¶ - hasJaws ¶ - hasMDU ¶ - hasMMU ¶ - hasMSC ¶ - hasMac2VIA2 ¶ - hasNetBoot ¶ - hasNiagra ¶ - hasOrwell ¶ - hasOss ¶ - hasPratt ¶ hasProtectedPRAM ¶ hasSCSI96 ¶ hasSWIM2 ¶ - hasSwim3 ¶ hasSlotMgr ¶ - hasSonora ¶ hasSplineFonts ¶ hasVDAC ¶ hasVIAClock ¶ hasVISA2 ¶ - hasVISADecoder ¶ hasWaimeaVIA2 ¶ isUniversal ¶ hasPwrControls ¶ hasPwrMgrClock ¶ - hasRBV ¶ hasSplineFonts ¶ hasVIAClock ¶ hasWaimeaVIA2 ¶ @@ -267,6 +235,8 @@ Features = hasRISCV0ResMgrPatches onHafMac ¶ onMac32 ¶ onNuMac ¶ + hasBCScreen ¶ + hasMMU ¶ ForROM @@ -340,9 +310,6 @@ FeatureSet Set CIncludes "{CIncludes}" Set PInterfaces "{PInterfaces}" Set RIncludes "{RIncludes}" - Set Libraries "{Libraries}" - Set CLibraries "{CLibraries}" - Set PLibraries "{PLibraries}" Set StdAOpts "{MAOpts} {FeatureSet} -i {IntAIncludes} {AOpts} -i {ObjDir}" Set StdCOpts "{MCOpts} {FeatureSet} -i {IntCIncludes} {COpts}" Set StdCPOpts "{MCPOpts} {FeatureSet} -i {IntCIncludes} {COpts}" @@ -381,10 +348,10 @@ Clean #include {ToolSrcDir}Tools.make -#include {MakeDir}MainCode.make - -#include {DeclDir}DeclData.make - #include {DriverDir}Drivers.make -#include {ResourceDir}Resources.make +#include {MakeDir}MainCode.make + +##include {DeclDir}DeclData.make + +##include {ResourceDir}Resources.make diff --git a/Make/VectorTable.a b/Make/VectorTable.a index 4b260a1..541ffe8 100644 --- a/Make/VectorTable.a +++ b/Make/VectorTable.a @@ -221,6 +221,7 @@ ; $2080 - Time Manager ; $2084 - Window Mananger ; $2088 - Figment Memory Manager +; $208c - Expansion Bus Manager ;Global Vector Table Code Dispatch Source ;Identifier Macro Vector Vector Register File @@ -330,21 +331,21 @@ SETRESPONSEPARAMS vIndirect $2010, $0040, A7 ; {sources}OS:EgretMgr.a TICKHANDLER vIndirect $2010, $0044, A7 ; {sources}OS:EgretMgr.a PSEUDOCNTTABLE vDataTable ; {sources}OS:EgretMgr.a ADBCNTTABLE vDataTable ; {sources}OS:EgretMgr.a -EGRETINIT vIndirect $2010, $0048, A7 ; {sources}OS:EgretMgr.a +;EGRETINIT vIndirect $2010, $0048, A7 ; {sources}OS:EgretMgr.a SENDEGRETCMD vNoVector ; {sources}OS:EgretMgr.a -ECLIPSEPDMPATCH vIndirect $2010, $004c, A7 ; {sources}OS:EgretMgr.a -KEYSWITCHHANDLER vIndirect $2010, $0050, A7 ; {sources}OS:EgretMgr.a -ECLIPSEDFACPATCH vIndirect $2010, $0054, A7 ; {sources}OS:EgretMgr.a -DEBUGUTILRUNKBDPATCH vIndirect $2010, $0058, A7 ; {sources}OS:EgretMgr.a +;ECLIPSEPDMPATCH vIndirect $2010, $004c, A7 ; {sources}OS:EgretMgr.a +;KEYSWITCHHANDLER vIndirect $2010, $0050, A7 ; {sources}OS:EgretMgr.a +;ECLIPSEDFACPATCH vIndirect $2010, $0054, A7 ; {sources}OS:EgretMgr.a +;DEBUGUTILRUNKBDPATCH vIndirect $2010, $0058, A7 ; {sources}OS:EgretMgr.a CUDAEGRETCODE vDataTable ; {sources}OS:EgretMgr.a -EGRETDFACANDPDM vIndirect $2010, $005c, A7 ; {sources}OS:EgretMgr.a -CACHEINSTALL vIndirect $2010, $0060, A7 ; {sources}OS:HFS:Cache:DiskCache.a +;EGRETDFACANDPDM vIndirect $2010, $005c, A7 ; {sources}OS:EgretMgr.a +;CACHEINSTALL vIndirect $2010, $0060, A7 ; {sources}OS:HFS:Cache:DiskCache.a CHKFIRMWARE vIndirect $2010, $0064, A7 ; {sources}OS:EgretMgr.a -INSTALLFPSP vIndirect $2010, $0068, A7, has040MMU ; {sources}OS:FPUEmulation:FPEmulation.a -NEWGESTALTSELECTORS vIndirect $2010, $006c, A7 ; {sources}OS:Gestalt:GestaltExtensions.a +;INSTALLFPSP vIndirect $2010, $0068, A7, has040MMU ; {sources}OS:FPUEmulation:FPEmulation.a +;NEWGESTALTSELECTORS vIndirect $2010, $006c, A7 ; {sources}OS:Gestalt:GestaltExtensions.a GESTALTTRAP vATrap A??? ; {sources}OS:Gestalt:GestaltFunction.a -newGestalt vIndirect $2010, $0070, A7 ; {sources}OS:Gestalt:GestaltLookup.c -findLong vIndirect $2010, $0074, A7 ; {sources}OS:Gestalt:GestaltLookup.c +;newGestalt vIndirect $2010, $0070, A7 ; {sources}OS:Gestalt:GestaltLookup.c +;findLong vIndirect $2010, $0074, A7 ; {sources}OS:Gestalt:GestaltLookup.c HWPRIV vATrap A??? ; {sources}OS:HwPriv.a SWAPICACHE vIndirect $2010, $0078, A7 ; {sources}OS:HwPriv.a FLUSHICACHE vIndirect $2010, $007c, A7 ; {sources}OS:HwPriv.a @@ -355,7 +356,7 @@ FLUSHEXTCACHE vIndirect $2010, $008c, A7 ; {sources}OS:HwPriv.a SWAPSERIALCLOCK vIndirect $2010, $0090, A7 ; {sources}OS:HwPriv.a FLUSHCRANGEFORBM vNoVector ; {sources}OS:HwPriv.a FLUSHCRANGE vIndirect $2010, $0094, A7 ; {sources}OS:HwPriv.a -WAITFORSCSIDEVS vIndirect $2010, $0098, A7 ; {sources}OS:HwPriv.a +;WAITFORSCSIDEVS vIndirect $2010, $0098, A7 ; {sources}OS:HwPriv.a MEMORYDISPATCH vNoVector ; {sources}OS:HwPriv.a HOLDMEMORYPROC vNoVector ; {sources}OS:HwPriv.a UNHOLDMEMORYPROC vNoVector ; {sources}OS:HwPriv.a @@ -372,13 +373,13 @@ MMUSETWRITEPROTECT vNoVector ; {sources}OS:HwPriv.a MMUSETCACHEINHIBIT vNoVector ; {sources}OS:HwPriv.a MMUSETCACHEMODE vNoVector ; {sources}OS:HwPriv.a MMUFLUSHATC vNoVector ; {sources}OS:HwPriv.a -; UNUSED vIndirect $2010, $009C ; +MAKESOMETHINGWRITETHROUGH vIndirect $2010, $009C, A7 ; {sources}OS:HwPriv.a IOPMGR vNoVector ; {sources}OS:IOPMgr.a -IOPINFOACCESS vIndirect $2010, $00a0, A7 ; {sources}OS:IOPMgr.a -IOPMSGREQUEST vIndirect $2010, $00a4, A7 ; {sources}OS:IOPMgr.a -IOPMOVEDATA vIndirect $2010, $00a8, A7 ; {sources}OS:IOPMgr.a +;IOPINFOACCESS vIndirect $2010, $00a0, A7 ; {sources}OS:IOPMgr.a +;IOPMSGREQUEST vIndirect $2010, $00a4, A7 ; {sources}OS:IOPMgr.a +;IOPMOVEDATA vIndirect $2010, $00a8, A7 ; {sources}OS:IOPMgr.a IOPINTERRUPT vDirect ???? ; {sources}OS:IOPMgr.a -MOVEREQHANDLER vIndirect $2010, $00ac, A7 ; {sources}OS:IOPMgr.a +;MOVEREQHANDLER vIndirect $2010, $00ac, A7 ; {sources}OS:IOPMgr.a INITIOPMGR vNoVector ; {sources}OS:IOPMgr.a SCCIOPBYPASS vNoVector ; {sources}OS:IOPMgr.a SCCIOPHWINIT vNoVector ; {sources}OS:IOPMgr.a @@ -422,7 +423,7 @@ PMGROP vATrap A??? ; {sources}OS:PowerMgr:PowerMgr.a IDLEMIND vNoVector ; {sources}OS:PowerMgr:PowerMgr.a GOTOSLEEP vATrap A??? ; {sources}OS:PowerMgr:PowerMgr.a WAKEUP vNoVector ; {sources}OS:PowerMgr:PowerMgr.a -SETSUPERVISORMODE vIndirect $2010, $00b8, A7, hasPwrControls ; {sources}OS:PowerMgr:PowerMgr.a +;SETSUPERVISORMODE vIndirect $2010, $00b8, A7, hasPwrControls ; {sources}OS:PowerMgr:PowerMgr.a DISPATCHER vNoVector ; {sources}OS:TrapDispatcher:Dispatch.a GETTRAPADDRESSTRAP vATrap A??? ; {sources}OS:TrapDispatcher:Dispatch.a SETTRAPADDRESSTRAP vATrap A??? ; {sources}OS:TrapDispatcher:Dispatch.a @@ -430,7 +431,7 @@ CACHEFLUSH vDirect ???? ; {sources}OS:TrapDispatcher:Dispatch.a VCACHEFLUSH vDirect ???? ; {sources}OS:TrapDispatcher:Dispatch.a INITDISPATCHER vNoVector ; {sources}OS:TrapDispatcher:Dispatch.a BADTRAP vIndirect $2010, $00bc, A7 ; {sources}OS:TrapDispatcher:Dispatch.a -TRAPADDRESSBITS vIndirect $2010, $00c0, A7 ; {sources}OS:TrapDispatcher:Dispatch.a +;TRAPADDRESSBITS vIndirect $2010, $00c0, A7 ; {sources}OS:TrapDispatcher:Dispatch.a UNIVERSAL vNoVector ; {sources}OS:Universal.a JUMPINTOROM vNoVector ; {sources}OS:Universal.a INITVIAS vNoVector ; {sources}OS:Universal.a @@ -483,7 +484,7 @@ RELTIMETASK vNoVector ; {sources}OS:sysUtil.a ; UNUSED vATrap A??? ; {sources}Patches:MiscPatches.a INITAPP vIndirect $2010, $00c8, A7 ; {sources}Patches:MiscPatches.a CLEANUPAPP vATrap A??? ; {sources}Patches:MiscPatches.a -MISCPATCHESINSTALL vIndirect $2010, $00cc, A7 ; {sources}Patches:MiscPatches.a +;MISCPATCHESINSTALL vIndirect $2010, $00cc, A7 ; {sources}Patches:MiscPatches.a PACK8 vATrap A??? ; {sources}Toolbox:AppleEventMgr:AEPackEntry.a @@ -509,9 +510,9 @@ GETNEWCONTROL vATrap A??? ; {sources}Toolbox:GetMgr:GetMgr.a GETMENU vATrap A??? ; {sources}Toolbox:GetMgr:GetMgr.a GETNEWMBAR vATrap A??? ; {sources}Toolbox:GetMgr:GetMgr.a GETMGREND vNoVector ; {sources}Toolbox:GetMgr:GetMgr.a -INSTALLPRIVTRAP vIndirect $2010, $00d8, A7, has040MMU ; {sources}Toolbox:InSANE:FPPrivTrap.a -PRIVTRAP881 vIndirect $2010, $00dc, A7, has040MMU ; {sources}Toolbox:InSANE:FPPrivTrap.a -PRIVTRAP040 vIndirect $2010, $00e0, A7, has040MMU ; {sources}Toolbox:InSANE:FPPrivTrap.a +;INSTALLPRIVTRAP vIndirect $2010, $00d8, A7, has040MMU ; {sources}Toolbox:InSANE:FPPrivTrap.a +;PRIVTRAP881 vIndirect $2010, $00dc, A7, has040MMU ; {sources}Toolbox:InSANE:FPPrivTrap.a +;PRIVTRAP040 vIndirect $2010, $00e0, A7, has040MMU ; {sources}Toolbox:InSANE:FPPrivTrap.a PACKDISPATCHER vIndirect $2010, $00e4, A7 ; {sources}Toolbox:PackageMgr.a INITPACK vATrap A??? ; {sources}Toolbox:PackageMgr.a INITALLPACKS vATrap A??? ; {sources}Toolbox:PackageMgr.a @@ -540,6 +541,19 @@ EMT1010 vDirect ???? ; {sources}Objects:ROM:Dispatch.a.o BASEOFROM vDataTable ; {sources}Objects:ROM:StartTop.a.o ; UNUSED vIndirect $2010, $00ec, A7 ; {sources} +MISCELLANEOUS_VEC00F0 vIndirect $2010, $00f0, A7 +MISCELLANEOUS_VEC00F4 vIndirect $2010, $00f4, A7 +MISCELLANEOUS_VEC00F8 vIndirect $2010, $00f8, A7 +MISCELLANEOUS_VEC00FC vIndirect $2010, $00fc, A7 +MISCELLANEOUS_VEC0100 vIndirect $2010, $0100, A7 +MISCELLANEOUS_VEC0104 vIndirect $2010, $0104, A7 +MISCELLANEOUS_VEC0108 vIndirect $2010, $0108, A7 +MISCELLANEOUS_VEC010C vIndirect $2010, $010c, A7 +MISCELLANEOUS_VEC0110 vIndirect $2010, $0110, A7 +MISCELLANEOUS_VEC0114 vIndirect $2010, $0114, A7 +MISCELLANEOUS_VEC0118 vIndirect $2010, $0118, A7 +MISCELLANEOUS_VEC011C vIndirect $2010, $011c, A7 + ;============================== End Misc. Vectors ;============================== Public Vectors @@ -552,13 +566,13 @@ PICKWDCB vIndirect $2014, $002C, A7 ; {sources}OS:HFS:TFSVol.a ### PC Exch ALIASMGRINSTALL vIndirect $2018, $0004, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a ALIAS vATrap A??? ; {sources}Toolbox:AliasMgr:AliasMgr.a -gestaltAliasMgr vIndirect $2018, $0008, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a +;gestaltAliasMgr vIndirect $2018, $0008, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a GETEXPORTEDFOLDERINFO vIndirect $2018, $000c, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a -GETVOLMOUNTINFOSIZE vIndirect $2018, $0010, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a -GETVOLMOUNTINFO vIndirect $2018, $0014, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a -VOLUMEMOUNT vIndirect $2018, $0018, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a +;GETVOLMOUNTINFOSIZE vIndirect $2018, $0010, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a +;GETVOLMOUNTINFO vIndirect $2018, $0014, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a +;VOLUMEMOUNT vIndirect $2018, $0018, A7 ; {sources}Toolbox:AliasMgr:AliasMgr.a InitFolderManager vIndirect $2018, $001c, A7 ; {sources}Toolbox:AliasMgr:FolderMgr.a -gestaltFolderMgr vIndirect $2018, $0020, A7 ; {sources}Toolbox:AliasMgr:FolderMgr.a +;gestaltFolderMgr vIndirect $2018, $0020, A7 ; {sources}Toolbox:AliasMgr:FolderMgr.a FindFolder vIndirect $2018, $0024, A7 ; {sources}Toolbox:AliasMgr:FolderMgr.a GetFolderName vIndirect $2018, $0028, A7 ; {sources}Toolbox:AliasMgr:FolderMgr.a FindFolderInternal vIndirect $2018, $002c, A7 ; {sources}Toolbox:AliasMgr:FolderMgr.a @@ -631,29 +645,6 @@ AL_mountVolume vIndirect $2018, $0134, A1 ; {sources}Toolbox:AliasMgr:alUti ;============================== End Alias Manager Vectors -;============================== Commtoolbox Vectors - -MyGetString vIndirect $201C, $0004, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CRMBuiltInSerial.c -REGISTERBUILTINPORTS vIndirect $201C, $0008, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CRMBuiltInSerial.c -COMMTOOLBOXDISPATCHER vATrap A??? ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxDispatcher.a -SETUPGLOBALS vIndirect $201C, $000c, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -SETUPGESTALT vIndirect $201C, $0010, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETCTBVERSION vIndirect $201C, $0014, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETCMATTR vIndirect $201C, $0018, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETFTATTR vIndirect $201C, $001c, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETTMATTR vIndirect $201C, $0020, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETCRMATTR vIndirect $201C, $0024, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETDITLATTR vIndirect $201C, $0028, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETPOPUPATTR vIndirect $201C, $002c, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -GETSTDNBPATTR vIndirect $201C, $0030, A7 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.a -CLEANUPCOMMTOOLBOX vIndirect $201C, $0034, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.c -TRACKMANAGERS vIndirect $201C, $0038, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.c -FindApp vIndirect $201C, $003c, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.c -AddApp vIndirect $201C, $0040, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.c -RemoveApp vIndirect $201C, $0044, A1 ; {sources}Toolbox:CommToolbox:CommToolboxStartup:CommToolboxPatches.c - -;============================== End Commtoolbox Vectors - ;============================== Component Manager Vectors ;COMPONENTMGRINSTALL vIndirect $2020, $0004, A7 ; {sources}Toolbox:ComponentMgr:ComponentExtensions.a @@ -712,7 +703,7 @@ __OPENCOMPONENT vIndirect $2020, $00d4, A1 ; {sources}Toolbox:ComponentMgr: __CLOSECOMPONENT vIndirect $2020, $00d8, A1 ; {sources}Toolbox:ComponentMgr:ThingManager.c __OPENDEFAULTCOMPONENT vIndirect $2020, $00dc, A1 ; {sources}Toolbox:ComponentMgr:ThingManager.c __CALLCOMPONENT vIndirect $2020, $00e0, A1 ; {sources}Toolbox:ComponentMgr:ThingManager.c -REGISTERCOMPONENTROMRESOURCE vIndirect $2020, $00e4, A1 ; {sources}Toolbox:ComponentMgr:ThingManager.c +;REGISTERCOMPONENTROMRESOURCE vIndirect $2020, $00e4, A1 ; {sources}Toolbox:ComponentMgr:ThingManager.c __REGISTERROMCOMPONENTS vIndirect $2020, $00e8, A1 ; {sources}Toolbox:ComponentMgr:ThingManager.c __MAINCOMPONENT vATrap A??? ; {sources}Toolbox:ComponentMgr:ThingManagerDisp.a COMPONENTBUMMER vIndirect $2020, $00ec, A7 ; {sources}Toolbox:ComponentMgr:ThingManagerDisp.a @@ -1432,233 +1423,11 @@ BLKCHK vIndirect $2030, $0370, A7 ; {sources}OS:HFS:vsm.a UPDATEFREE vIndirect $2030, $0374, A7 ; {sources}OS:HFS:vsm.a VREADBM vDirect ???? ; {sources}OS:HFS:vsm.a +HFS_VEC0378 vIndirect $2030, $0378, A7 +HFS_VEC037C vIndirect $2030, $037c, A7 + ;============================== End HFS Vectors -;============================== Help Manager Vectors - -HELPMGRINSTALL vIndirect $2034, $0004, A7 ; {sources}Toolbox:HelpMgr:BalloonExtensions.a -PACK14ENTRY vATrap A??? ; {sources}Toolbox:HelpMgr:BalloonExtensions.a -PTCHHMUPDATEHELPMENU vIndirect $2034, $0008, A7 ; {sources}Toolbox:HelpMgr:BalloonExtensions.a -PTCHHMGETHELPGLOBAL vIndirect $2034, $000c, A7 ; {sources}Toolbox:HelpMgr:BalloonExtensions.a -PTCHHMGETBALLOONS vIndirect $2034, $0010, A7 ; {sources}Toolbox:HelpMgr:BalloonExtensions.a -PTCHHMSETHELPGLOBAL vIndirect $2034, $0014, A7 ; {sources}Toolbox:HelpMgr:BalloonExtensions.a -PTCHHMPASCALGETBALLOONS vIndirect $2034, $0018, A1 ; {sources}Toolbox:HelpMgr:Balloonptch28.p -PTCHHMGESTALTISTHEREHELP vIndirect $2034, $001c, A1 ; {sources}Toolbox:HelpMgr:Balloonptch28.p -PTCHHMBOOTINITHELPMANAGER vIndirect $2034, $0020, A1 ; {sources}Toolbox:HelpMgr:Balloonptch28.p -PTCHHMTOGGLEWHATIS vIndirect $2034, $0024, A1 ; {sources}Toolbox:HelpMgr:Balloonptch28.p -PTCHHMCALLTRACKERINCONTEXT vIndirect $2034, $0028, A1 ; {sources}Toolbox:HelpMgr:Balloonptch28.p -PTCHHMSHOWHELPABOUTDIALOG vIndirect $2034, $002c, A1 ; {sources}Toolbox:HelpMgr:Balloonptch28.p - -;============================== End Help Manager Vectors - -;============================== Icon Utils Vectors - -ICONDISPATCH vATrap A??? ; {sources}Toolbox:IconUtils:IconUtils.a -typeTable vDataTable ; {sources}Toolbox:IconUtils:IconUtils.a -GetGlobalPtr vIndirect $2038, $0004, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -GetGlobalHandle vIndirect $2038, $0008, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -FromResource vIndirect $2038, $000c, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__PLOTICONID vIndirect $2038, $0010, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__LOADICONCACHE vIndirect $2038, $0014, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__PLOTICONSUITE vIndirect $2038, $0018, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__ICONIDTORGN vIndirect $2038, $001c, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__ICONSUITETORGN vIndirect $2038, $0020, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__RECTINICONID vIndirect $2038, $0024, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__PTINICONID vIndirect $2038, $0028, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__RECTINICONSUITE vIndirect $2038, $002c, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__PTINICONSUITE vIndirect $2038, $0030, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -FromMethod vIndirect $2038, $0034, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__PLOTICONMETHOD vIndirect $2038, $0038, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__ICONMETHODTORGN vIndirect $2038, $003c, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__RECTINICONMETHOD vIndirect $2038, $0040, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__PTINICONMETHOD vIndirect $2038, $0044, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__ADDICONTOSUITE vIndirect $2038, $0048, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__GETICONFROMSUITE vIndirect $2038, $004c, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -ADJUSTRGN vIndirect $2038, $0050, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__GETICONCACHEDATA vIndirect $2038, $0054, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__SETICONCACHEDATA vIndirect $2038, $0058, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__GETICONCACHEPROC vIndirect $2038, $005c, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__SETICONCACHEPROC vIndirect $2038, $0060, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__GETICONDEVICE vIndirect $2038, $0064, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -__SETICONDEVICE vIndirect $2038, $0068, A7 ; {sources}Toolbox:IconUtils:IconUtils.a -PERFORMALIGNMENT vIndirect $2038, $006c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -ADDBUFFERTORGN vIndirect $2038, $0070, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -MASKRGN vIndirect $2038, $0074, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -GETBESTDATA vIndirect $2038, $0078, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -ChooseBestSize vIndirect $2038, $007c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -SETUPPIXMAP vIndirect $2038, $0080, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__NEWICONSUITE vIndirect $2038, $0084, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__MAKEICONCACHE vIndirect $2038, $0088, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -EDITICONSUITE vIndirect $2038, $008c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__FOREACHICONDO vIndirect $2038, $0090, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -GETICONFROMRESOURCE vIndirect $2038, $0094, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__GETICONSUITE vIndirect $2038, $0098, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__SETSUITELABEL vIndirect $2038, $009c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__GETSUITELABEL vIndirect $2038, $00a0, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -DISPOSER vIndirect $2038, $00a4, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__DISPOSEICONSUITE vIndirect $2038, $00a8, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -FromSuite vIndirect $2038, $00ac, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -DOREGIONTRANSFORM vIndirect $2038, $00b0, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -DoOutline vIndirect $2038, $00b4, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -APPLYPATTERN vIndirect $2038, $00b8, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -DOBITMAPTRANSFORM vIndirect $2038, $00bc, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -RENDER vIndirect $2038, $00c0, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTDEEP vIndirect $2038, $00c4, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTSHALLOWBLACKANDWHITE vIndirect $2038, $00c8, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTSHALLOWCOLOR vIndirect $2038, $00cc, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTSHALLOW vIndirect $2038, $00d0, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTTHEICON vIndirect $2038, $00d4, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -MakeBoundary vIndirect $2038, $00d8, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -CreateMask vIndirect $2038, $00dc, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -SetupParamBlock vIndirect $2038, $00e0, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PRESCALEMASK vIndirect $2038, $00e4, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTICONGENERIC vIndirect $2038, $00e8, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -ICONTORGNGENERIC vIndirect $2038, $00ec, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -HITTESTICONMASKGENERIC vIndirect $2038, $00f0, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -HITTESTICONGENERIC vIndirect $2038, $00f4, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -MAKEICONDATA vIndirect $2038, $00f8, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -CompareComponent vIndirect $2038, $00fc, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -Darken vIndirect $2038, $0100, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -Luminance vIndirect $2038, $0104, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -Brighten vIndirect $2038, $0108, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -FindBlack vIndirect $2038, $010c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -MakeClut vIndirect $2038, $0110, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -GetDeviceCheck vIndirect $2038, $0114, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -CheckClut vIndirect $2038, $0118, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -IconGetClut vIndirect $2038, $011c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__GETLABEL vIndirect $2038, $0120, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -INVALLABELCLUTS vIndirect $2038, $0124, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__SETLABEL vIndirect $2038, $0128, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -FromICON vIndirect $2038, $012c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -FromSICN vIndirect $2038, $0130, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__PLOTICONHANDLE vIndirect $2038, $0134, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__PLOTSICNHANDLE vIndirect $2038, $0138, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -SetupParamBlockForCIcon vIndirect $2038, $013c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -CopyClut vIndirect $2038, $0140, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -GETCICONCLUT vIndirect $2038, $0144, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -PLOTTHECICON vIndirect $2038, $0148, A1 ; {sources}Toolbox:IconUtils:IconUtils.c -__PLOTCICONHANDLE vIndirect $2038, $014c, A1 ; {sources}Toolbox:IconUtils:IconUtils.c - -;============================== End Icon Utils Vectors - -;============================== MMU Vectors - -GETREALPROC vNoVector ; {sources}OS:MMU:GetReal.a -GETPAGEDESCPROC vNoVector ; {sources}OS:MMU:GetReal.a -GETMMUINFO vNoVector ; {sources}OS:MMU:GetReal.a -CHECKTTREGS vNoVector ; {sources}OS:MMU:GetReal.a -EDISKPROTECT vNoVector ; {sources}OS:MMU:GetReal.a -INITMMUTRAP vNoVector ; {sources}OS:MMU:MMU.a -INITMMUGLOBALS vNoVector ; {sources}OS:MMU:MMU.a -MMUCLEANUPFOR8MB vNoVector ; {sources}OS:MMU:MMU.a -INITMMU vNoVector ; {sources}OS:MMU:MMUTables.a -TRANS vNoVector ; {sources}OS:MMU:MMUTables.a - -;============================== End MMU Vectors - -;============================== Memory Manager Vectors - -__BLOCKMOVE vATrap A??? ; {sources}OS:MemoryMgr:BlockMove.a -BLOCKMOVE68020 vNoVector ; {sources}OS:MemoryMgr:BlockMove.a -BLOCKMOVE68040 vNoVector ; {sources}OS:MemoryMgr:BlockMove.a -HEAP vNoVector ; {sources}OS:MemoryMgr:MemoryMgr.a -INITMEMVECT vNoVector ; {sources}OS:MemoryMgr:MemoryMgr.a -SETAPPLBASE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -INITAPPLZONE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -VIAZINIT vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -VIAZPOSTINIT vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -INITZONETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -GETZONE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -SETZONE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -MAXBLOCKTRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -COMPACTMEMTRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -PURGEMEM vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -PURGESPACETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -FREEMEM vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -RESRVMEM vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -MAXMEMTRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -SETGROWZONE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -SETAPPLLIMIT vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -STACKSPACETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -MAXAPPLZONE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -NEWPTRTRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -DISPOSEPTR vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -GETPTRSIZETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -SETPTRSIZETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -PTRZONETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -NEWEMPTYHANDLETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -NWHANDLE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -DSPOSEHANDLE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -__GETHANDLESIZE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -SETHANDLESIZETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HANDLEZONETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -RECOVERHANDLETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -EMPTYHANDLE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -REALLOCHANDLETRAP vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HLOCK vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HUNLOCK vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HPURGE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HNOPURGE vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HRSRC vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HNORSRC vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HGETFLAGS vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -HSETFLAGS vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -MOREMASTERS vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -__STRIPADDRESS vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -MOVEHHI vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgr.a -MOVEHLOW vATrap A??? ; {sources}OS:MemoryMgr:MemoryMgrExtensions.a -HEAPGUTS vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMPPROLOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMHPROLOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMNOPROLOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMMMPROLOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMPROLOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMRHPROLOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMEPILOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MMNOERREPILOGUE vDirect ???? ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24MAKEBKF vIndirect $2040, $0004, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32MAKEBKF vIndirect $2040, $0008, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24EH vIndirect $2040, $000c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32EH vIndirect $2040, $0010, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24PURGEHEAP vIndirect $2040, $0014, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32PURGEHEAP vIndirect $2040, $0018, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24TOTEPURGEABLES vIndirect $2040, $001c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32TOTEPURGEABLES vIndirect $2040, $0020, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24BKCOMPACTS vIndirect $2040, $0024, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32BKCOMPACTS vIndirect $2040, $0028, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24ALLOCBK vIndirect $2040, $002c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32ALLOCBK vIndirect $2040, $0030, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24COMPACTHP vIndirect $2040, $0034, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32COMPACTHP vIndirect $2040, $0038, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -TOMAXLIMIT vIndirect $2040, $003c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24MAXLIMIT vIndirect $2040, $0040, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32MAXLIMIT vIndirect $2040, $0044, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24ZONEADJUSTEND vIndirect $2040, $0048, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32ZONEADJUSTEND vIndirect $2040, $004c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24ACTUALS vIndirect $2040, $0050, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32ACTUALS vIndirect $2040, $0054, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24GETSIZE vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32GETSIZE vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -CLEARGZSTUFF vIndirect $2040, $0058, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24SETSIZE vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32SETSIZE vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -ADJUSTFREE vIndirect $2040, $005c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24NEXTMASTER vIndirect $2040, $0060, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32NEXTMASTER vIndirect $2040, $0064, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24HMAKEMOREMASTERS vIndirect $2040, $0068, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32HMAKEMOREMASTERS vIndirect $2040, $006c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -RELEASEMP vIndirect $2040, $0070, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24MAKEPTRSPC vIndirect $2040, $0074, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32MAKEPTRSPC vIndirect $2040, $0078, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A24FREEBK vIndirect $2040, $007c, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -A32FREEBK vIndirect $2040, $0080, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -STDGZ vIndirect $2040, $0084, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -MEMMGREND vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -INITMEMMGR vNoVector ; {sources}OS:MemoryMgr:MemoryMgrInternal.a -IAZ vIndirect $2040, $0088, A7 ; {sources}OS:MemoryMgr:MemoryMgrInternal.a - -;============================== End Memory Manager Vectors - ;============================== Menu Manager Vectors MENUMGRDISPATCH vATrap A??? ; {sources}Toolbox:MenuMgr:MenuDispatch.a @@ -1744,41 +1513,6 @@ FIND6BOFROMID vIndirect $2044, $007c, A7 ; {sources}Toolbox:MenuMgr:SystemM ;============================== End Menu Manager Vectors -;============================== Munger Vectors - -BYTES vIndirect $2048, $0004, A7 ; {sources}Toolbox:Munger:Munger.a -MUNGER vATrap A??? ; {sources}Toolbox:Munger:Munger.a -XMUNGER vATrap A??? ; {sources}Toolbox:Munger:Munger.a -HANDTOHANDTRAP vATrap A??? ; {sources}Toolbox:Munger:Munger.a -PTRTOXHANDTRAP vATrap A??? ; {sources}Toolbox:Munger:Munger.a -PTRTOHANDTRAP vATrap A??? ; {sources}Toolbox:Munger:Munger.a -HANDANDHANDTRAP vATrap A??? ; {sources}Toolbox:Munger:Munger.a -PTRANDHANDTRAP vATrap A??? ; {sources}Toolbox:Munger:Munger.a -METHODDISPATCH vATrap A??? ; {sources}Toolbox:Munger:Munger.a -LONGMUL vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRACMUL vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIXMUL vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRACDIV vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIXDIV vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRACSQRT vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIXRATIO vATrap A??? ; {sources}Toolbox:Munger:Munger.a -LOWORD vATrap A??? ; {sources}Toolbox:Munger:Munger.a -HIWORD vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIXROUND vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRACCOS vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRACSIN vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIXATAN2 vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIX2X vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRAC2X vATrap A??? ; {sources}Toolbox:Munger:Munger.a -X2FIX vATrap A??? ; {sources}Toolbox:Munger:Munger.a -X2FRAC vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIX2LONG vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FRAC2FIX vATrap A??? ; {sources}Toolbox:Munger:Munger.a -LONG2FIX vATrap A??? ; {sources}Toolbox:Munger:Munger.a -FIX2FRAC vATrap A??? ; {sources}Toolbox:Munger:Munger.a - -;============================== End Munger Vectors - ;============================== Notification Manager Vectors __NMINSTALL vATrap A??? ; {sources}Toolbox:NotificationMgr:NotificationMgr.a @@ -1799,10 +1533,10 @@ ValidIconRec vIndirect $204C, $0034, A1 ; {sources}Toolbox:NotificationMgr: NMINIT vIndirect $204C, $0038, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c _NMInstall vIndirect $204C, $003c, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c _NMRemove vIndirect $204C, $0040, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c -COPYSTRING vIndirect $204C, $0044, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c +;COPYSTRING vIndirect $204C, $0044, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c FLUSHAPPLNM vIndirect $204C, $0048, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c NMFILTER vIndirect $204C, $004c, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c -DEFBUTPROC vIndirect $204C, $0050, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c +;DEFBUTPROC vIndirect $204C, $0050, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c NMCallMBarProc vIndirect $204C, $0054, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c SWAPITEMMARKS vIndirect $204C, $0058, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c ClearMarks vIndirect $204C, $005c, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c @@ -1812,223 +1546,13 @@ RotateIcon vIndirect $204C, $0068, A1 ; {sources}Toolbox:NotificationMgr:N DoSound vIndirect $204C, $006c, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c DoDialog vIndirect $204C, $0070, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c DoRespProc vIndirect $204C, $0074, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c -NMGNEFILTER vIndirect $204C, $0078, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c +;NMGNEFILTER vIndirect $204C, $0078, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c NMTASK vIndirect $204C, $007c, A1 ; {sources}Toolbox:NotificationMgr:NotificationMgr.c disable vIndirect $204C, $0080, A7 ; {sources}Toolbox:NotificationMgr:SetProcessorLevel.a spl vIndirect $204C, $0084, A7 ; {sources}Toolbox:NotificationMgr:SetProcessorLevel.a ;============================== End Notification Manager Vectors -;============================== PPC Vectors - -OPENUGBT vIndirect $2050, $0004, A7 ; {sources}OS:PPC:BTIntf.a -BLDFSKEY vIndirect $2050, $0008, A7 ; {sources}OS:PPC:BTIntf.a -BTINIT vIndirect $2050, $000c, A7 ; {sources}OS:PPC:BTreeCGlue.a -MYBTOPEN vIndirect $2050, $0010, A7 ; {sources}OS:PPC:BTreeCGlue.a -MYBTCLOSE vIndirect $2050, $0014, A7 ; {sources}OS:PPC:BTreeCGlue.a -BTINSREC vIndirect $2050, $0018, A7 ; {sources}OS:PPC:BTreeCGlue.a -BTSETREC vIndirect $2050, $001c, A7 ; {sources}OS:PPC:BTreeCGlue.a -BTREPLREC vIndirect $2050, $0020, A7 ; {sources}OS:PPC:BTreeCGlue.a -MYBTSEARCH vIndirect $2050, $0024, A7 ; {sources}OS:PPC:BTreeCGlue.a -BTSEARCHPPC vIndirect $2050, $0028, A7 ; {sources}OS:PPC:BTreeCGlue.a -BTGETREC vIndirect $2050, $002c, A7 ; {sources}OS:PPC:BTreeCGlue.a -MYBTDELETE vIndirect $2050, $0030, A7 ; {sources}OS:PPC:BTreeCGlue.a -BTGETINFO vIndirect $2050, $0034, A7 ; {sources}OS:PPC:BTreeCGlue.a -MYBTFLUSH vIndirect $2050, $0038, A7 ; {sources}OS:PPC:BTreeCGlue.a -mixupPswd vIndirect $2050, $003c, A1 ; {sources}OS:PPC:PPCAuth.c -getUserRec vIndirect $2050, $0040, A1 ; {sources}OS:PPC:PPCAuth.c -GetUserCompletion vIndirect $2050, $0044, A1 ; {sources}OS:PPC:PPCAuth.c -GetAuthInfo vIndirect $2050, $0048, A1 ; {sources}OS:PPC:PPCAuth.c -random vATrap A??? ; {sources}OS:PPC:PPCAuth.c -checkInit vIndirect $2050, $004c, A1 ; {sources}OS:PPC:PPCAuth.c -ppcStartSecure vIndirect $2050, $0050, A1 ; {sources}OS:PPC:PPCAuth.c -promptCallBack vIndirect $2050, $0054, A1 ; {sources}OS:PPC:PPCAuth.c -UserRefNumCompare vIndirect $2050, $0058, A1 ; {sources}OS:PPC:PPCAuth.c -ppcDeleteUser vIndirect $2050, $005c, A1 ; {sources}OS:PPC:PPCAuth.c -ppcGetDefaultUser vIndirect $2050, $0060, A1 ; {sources}OS:PPC:PPCAuth.c -FindUserByNameAndPassword vIndirect $2050, $0064, A1 ; {sources}OS:PPC:PPCAuth.c -findUserByRef vIndirect $2050, $0068, A1 ; {sources}OS:PPC:PPCAuth.c -GetFreeEntry vIndirect $2050, $006c, A1 ; {sources}OS:PPC:PPCAuth.c -scramble vIndirect $2050, $0070, A1 ; {sources}OS:PPC:PPCAuth.c -PACK9 vATrap A??? ; {sources}OS:PPC:PPCBrowserPackEntry.a -ppcDispatcher vIndirect $2050, $0074, A7 ; {sources}OS:PPC:PPCDispatcher.a -VPPCDISPATCHER vATrap A??? ; {sources}OS:PPC:PPCDispatcher.a -ppcBadSelector vIndirect $2050, $0078, A7 ; {sources}OS:PPC:PPCDispatcher.a -OpenADSPDriver vIndirect $2050, $007c, A1 ; {sources}OS:PPC:PPCDsp.c -CreateConnectionListener vIndirect $2050, $0080, A1 ; {sources}OS:PPC:PPCDsp.c -ListenConnectionRequest vIndirect $2050, $0084, A1 ; {sources}OS:PPC:PPCDsp.c -RejectConnectionRequest vIndirect $2050, $0088, A1 ; {sources}OS:PPC:PPCDsp.c -RemoveConnectionListener vIndirect $2050, $008c, A1 ; {sources}OS:PPC:PPCDsp.c -CreateConnectionEnd vIndirect $2050, $0090, A1 ; {sources}OS:PPC:PPCDsp.c -OpenConnectionEnd vIndirect $2050, $0094, A1 ; {sources}OS:PPC:PPCDsp.c -RemoveConnectionEnd vIndirect $2050, $0098, A1 ; {sources}OS:PPC:PPCDsp.c -WriteToConnection vIndirect $2050, $009c, A1 ; {sources}OS:PPC:PPCDsp.c -ReadFromConnection vIndirect $2050, $00a0, A1 ; {sources}OS:PPC:PPCDsp.c -ppcOpen vIndirect $2050, $00a4, A1 ; {sources}OS:PPC:PPCEntry.c -ppcStart vIndirect $2050, $00a8, A1 ; {sources}OS:PPC:PPCEntry.c -ppcInform vIndirect $2050, $00ac, A1 ; {sources}OS:PPC:PPCEntry.c -ppcAccept vIndirect $2050, $00b0, A1 ; {sources}OS:PPC:PPCEntry.c -ppcReject vIndirect $2050, $00b4, A1 ; {sources}OS:PPC:PPCEntry.c -ppcWrite vIndirect $2050, $00b8, A1 ; {sources}OS:PPC:PPCEntry.c -ppcRead vIndirect $2050, $00bc, A1 ; {sources}OS:PPC:PPCEntry.c -ppcEnd vIndirect $2050, $00c0, A1 ; {sources}OS:PPC:PPCEntry.c -ppcClose vIndirect $2050, $00c4, A1 ; {sources}OS:PPC:PPCEntry.c -ipcListPorts vIndirect $2050, $00c8, A1 ; {sources}OS:PPC:PPCEntry.c -PPCCommonPBEntry vIndirect $2050, $00cc, A1 ; {sources}OS:PPC:PPCEntry.c -PPCCommonPBExit vIndirect $2050, $00d0, A1 ; {sources}OS:PPC:PPCEntry.c -NetOpenCompletion vIndirect $2050, $00d4, A1 ; {sources}OS:PPC:PPCEntry.c -CallCompletionRoutine vIndirect $2050, $00d8, A1 ; {sources}OS:PPC:PPCEntry.c -CompleteWithResult vIndirect $2050, $00dc, A1 ; {sources}OS:PPC:PPCEntry.c -VerifyLocNameFormat vIndirect $2050, $00e0, A1 ; {sources}OS:PPC:PPCEntry.c -LocationNameLocal vIndirect $2050, $00e4, A1 ; {sources}OS:PPC:PPCEntry.c -LocNameTaken vIndirect $2050, $00e8, A1 ; {sources}OS:PPC:PPCEntry.c -BeginLocalOrRemote vIndirect $2050, $00ec, A1 ; {sources}OS:PPC:PPCEntry.c -LocalOrNot vIndirect $2050, $00f0, A1 ; {sources}OS:PPC:PPCEntry.c -DoGetMyZone vIndirect $2050, $00f4, A1 ; {sources}OS:PPC:PPCEntry.c -DMFix vIndirect $2050, $00f8, A1 ; {sources}OS:PPC:PPCEntry.c -PPCSetUp vIndirect $2050, $00fc, A1 ; {sources}OS:PPC:PPCInit.c -AtalkEvent vIndirect $2050, $0100, A1 ; {sources}OS:PPC:PPCInit.c -EnableIncoming vIndirect $2050, $0104, A1 ; {sources}OS:PPC:PPCInit.c -DisableIncoming vIndirect $2050, $0108, A1 ; {sources}OS:PPC:PPCInit.c -initUserGroupFile vIndirect $2050, $010c, A1 ; {sources}OS:PPC:PPCInit.c -RemoveConnectionListeners vIndirect $2050, $0110, A1 ; {sources}OS:PPC:PPCInit.c -SetUpToolBoxName vIndirect $2050, $0114, A1 ; {sources}OS:PPC:PPCInit.c -RemoveToolBoxName vIndirect $2050, $0118, A1 ; {sources}OS:PPC:PPCInit.c -SetUpConnectionListeners vIndirect $2050, $011c, A1 ; {sources}OS:PPC:PPCInit.c -PPCSleepEvent vIndirect $2050, $0120, A1 ; {sources}OS:PPC:PPCInit.c -EndAllNetworkSessions vIndirect $2050, $0124, A1 ; {sources}OS:PPC:PPCInit.c -KillUserSession vIndirect $2050, $0128, A1 ; {sources}OS:PPC:PPCInit.c -PPCCloseUserSessions vIndirect $2050, $012c, A1 ; {sources}OS:PPC:PPCInit.c -PPCCountAcceptedNetworkSessions vIndirect $2050, $0130, A1 ; {sources}OS:PPC:PPCInit.c -PPCCheckDupNBPName vIndirect $2050, $0134, A1 ; {sources}OS:PPC:PPCInit.c -PPCGESTALTFUNCTION vIndirect $2050, $0138, A1 ; {sources}OS:PPC:PPCInit.c -GetPPCGlobalFlag vIndirect $2050, $013c, A1 ; {sources}OS:PPC:PPCInit.c -PPCSHUTDOWN vIndirect $2050, $0140, A1 ; {sources}OS:PPC:PPCInit.c -PPCSystemTask vNoVector ; {sources}OS:PPC:PPCInit.c -UnRegisterAllNBPNames vIndirect $2050, $0144, A1 ; {sources}OS:PPC:PPCInit.c -ReRegisterAllNBPNames vIndirect $2050, $0148, A1 ; {sources}OS:PPC:PPCInit.c -PPCDEADGESTAULT vIndirect $2050, $014c, A1 ; {sources}OS:PPC:PPCInit.c -KillPPC vIndirect $2050, $0150, A1 ; {sources}OS:PPC:PPCInit.c -PPCINSTALL vIndirect $2050, $0154, A1 ; {sources}OS:PPC:PPCInstall.a -setupGlobal vIndirect $2050, $0158, A1 ; {sources}OS:PPC:PPCInstall.a -ppcLoader vIndirect $2050, $015c, A1 ; {sources}OS:PPC:PPCLoader.c -initAuth vIndirect $2050, $0160, A1 ; {sources}OS:PPC:PPCLoader.c -GetLocSess vIndirect $2050, $0164, A1 ; {sources}OS:PPC:PPCLocal.c -FreeLocSess vIndirect $2050, $0168, A1 ; {sources}OS:PPC:PPCLocal.c -StartLocalSession vIndirect $2050, $016c, A1 ; {sources}OS:PPC:PPCLocal.c -AcceptLocalSession vIndirect $2050, $0170, A1 ; {sources}OS:PPC:PPCLocal.c -RejectLocalSession vIndirect $2050, $0174, A1 ; {sources}OS:PPC:PPCLocal.c -WriteLocalData vIndirect $2050, $0178, A1 ; {sources}OS:PPC:PPCLocal.c -ReadLocalData vIndirect $2050, $017c, A1 ; {sources}OS:PPC:PPCLocal.c -EndLocalSession vIndirect $2050, $0180, A1 ; {sources}OS:PPC:PPCLocal.c -ListLocalPorts vIndirect $2050, $0184, A1 ; {sources}OS:PPC:PPCLocal.c -LocalTransfer vIndirect $2050, $0188, A1 ; {sources}OS:PPC:PPCLocal.c -RegisterName vIndirect $2050, $018c, A1 ; {sources}OS:PPC:PPCNbp.c -LookupName vIndirect $2050, $0190, A1 ; {sources}OS:PPC:PPCNbp.c -RemoveName vIndirect $2050, $0194, A1 ; {sources}OS:PPC:PPCNbp.c -GetRemSess vIndirect $2050, $0198, A1 ; {sources}OS:PPC:PPCNetwork.c -FreeRemSess vIndirect $2050, $019c, A1 ; {sources}OS:PPC:PPCNetwork.c -RemoveNetworkConnection vIndirect $2050, $01a0, A1 ; {sources}OS:PPC:PPCNetwork.c -RemoveCompletion vIndirect $2050, $01a4, A1 ; {sources}OS:PPC:PPCNetwork.c -StartNetworkSession vIndirect $2050, $01a8, A1 ; {sources}OS:PPC:PPCNetwork.c -AcceptNetworkSession vIndirect $2050, $01ac, A1 ; {sources}OS:PPC:PPCNetwork.c -RejectNetworkSession vIndirect $2050, $01b0, A1 ; {sources}OS:PPC:PPCNetwork.c -WriteNetworkData vIndirect $2050, $01b4, A1 ; {sources}OS:PPC:PPCNetwork.c -ReadNetworkData vIndirect $2050, $01b8, A1 ; {sources}OS:PPC:PPCNetwork.c -EndNetworkSession vIndirect $2050, $01bc, A1 ; {sources}OS:PPC:PPCNetwork.c -ListNetworkPorts vIndirect $2050, $01c0, A1 ; {sources}OS:PPC:PPCNetwork.c -BeginNetworkConnection vIndirect $2050, $01c4, A1 ; {sources}OS:PPC:PPCNetwork.c -AcceptNetworkConnection vIndirect $2050, $01c8, A1 ; {sources}OS:PPC:PPCNetwork.c -NetLookUpCompletion vIndirect $2050, $01cc, A1 ; {sources}OS:PPC:PPCNetwork.c -ConnectionEndCompletion vIndirect $2050, $01d0, A1 ; {sources}OS:PPC:PPCNetwork.c -OpenCompletion vIndirect $2050, $01d4, A1 ; {sources}OS:PPC:PPCNetwork.c -StartSendCompletion vIndirect $2050, $01d8, A1 ; {sources}OS:PPC:PPCNetwork.c -StartCommandCompletion vIndirect $2050, $01dc, A1 ; {sources}OS:PPC:PPCNetwork.c -ListSendCompletion vIndirect $2050, $01e0, A1 ; {sources}OS:PPC:PPCNetwork.c -ListReadCompletion vIndirect $2050, $01e4, A1 ; {sources}OS:PPC:PPCNetwork.c -ListCommandCompletion vIndirect $2050, $01e8, A1 ; {sources}OS:PPC:PPCNetwork.c -ConnectionRequestCompletion vIndirect $2050, $01ec, A1 ; {sources}OS:PPC:PPCNetwork.c -RespConnectionEndCompletion vIndirect $2050, $01f0, A1 ; {sources}OS:PPC:PPCNetwork.c -RespOpenCompletion vIndirect $2050, $01f4, A1 ; {sources}OS:PPC:PPCNetwork.c -RecvSessReqCompletion vIndirect $2050, $01f8, A1 ; {sources}OS:PPC:PPCNetwork.c -GuestRecCompletion vIndirect $2050, $01fc, A1 ; {sources}OS:PPC:PPCNetwork.c -UserRecCompletion vIndirect $2050, $0200, A1 ; {sources}OS:PPC:PPCNetwork.c -AuthSendCompletion vIndirect $2050, $0204, A1 ; {sources}OS:PPC:PPCNetwork.c -AuthRespCompletion vIndirect $2050, $0208, A1 ; {sources}OS:PPC:PPCNetwork.c -ProcessInform vIndirect $2050, $020c, A1 ; {sources}OS:PPC:PPCNetwork.c -RespSendCompletion vIndirect $2050, $0210, A1 ; {sources}OS:PPC:PPCNetwork.c -ARepostConnectionListener vIndirect $2050, $0214, A1 ; {sources}OS:PPC:PPCNetwork.c -RepostConnectionListener vIndirect $2050, $0218, A1 ; {sources}OS:PPC:PPCNetwork.c -ListWrite vIndirect $2050, $021c, A1 ; {sources}OS:PPC:PPCNetwork.c -ListWriteCompletion vIndirect $2050, $0220, A1 ; {sources}OS:PPC:PPCNetwork.c -ListRespCompletion vIndirect $2050, $0224, A1 ; {sources}OS:PPC:PPCNetwork.c -BeginWriteBlock vIndirect $2050, $0228, A1 ; {sources}OS:PPC:PPCNetwork.c -WriteHdrCompletion vIndirect $2050, $022c, A1 ; {sources}OS:PPC:PPCNetwork.c -WriteBlockData vIndirect $2050, $0230, A1 ; {sources}OS:PPC:PPCNetwork.c -WriteBlockDataCompletion vIndirect $2050, $0234, A1 ; {sources}OS:PPC:PPCNetwork.c -CompleteWriteRequest vIndirect $2050, $0238, A1 ; {sources}OS:PPC:PPCNetwork.c -BeginReadBlock vIndirect $2050, $023c, A1 ; {sources}OS:PPC:PPCNetwork.c -ReadHdrCompletion vIndirect $2050, $0240, A1 ; {sources}OS:PPC:PPCNetwork.c -ReadBlockData vIndirect $2050, $0244, A1 ; {sources}OS:PPC:PPCNetwork.c -ReadDataCompletion vIndirect $2050, $0248, A1 ; {sources}OS:PPC:PPCNetwork.c -CompleteReadRequest vIndirect $2050, $024c, A1 ; {sources}OS:PPC:PPCNetwork.c -CopyReadBlk vIndirect $2050, $0250, A1 ; {sources}OS:PPC:PPCNetwork.c -ClosePortTable vIndirect $2050, $0254, A1 ; {sources}OS:PPC:PPCPort.c -NBPRemoveCompletion vIndirect $2050, $0258, A1 ; {sources}OS:PPC:PPCPort.c -CompleteClosePort vIndirect $2050, $025c, A1 ; {sources}OS:PPC:PPCPort.c -CheckPortName vIndirect $2050, $0260, A1 ; {sources}OS:PPC:PPCPort.c -ValidPortName vIndirect $2050, $0264, A1 ; {sources}OS:PPC:PPCPort.c -ComparePortName vIndirect $2050, $0268, A1 ; {sources}OS:PPC:PPCPort.c -GetLocationName vIndirect $2050, $026c, A1 ; {sources}OS:PPC:PPCPort.c -PortRefNumCompare vIndirect $2050, $0270, A1 ; {sources}OS:PPC:PPCPort.c -DeletePortByRefNum vIndirect $2050, $0274, A1 ; {sources}OS:PPC:PPCPort.c -PortRefNumtoPtr vIndirect $2050, $0278, A1 ; {sources}OS:PPC:PPCPort.c -GetUniquePortRefNum vIndirect $2050, $027c, A1 ; {sources}OS:PPC:PPCPort.c -GetPortTable vIndirect $2050, $0280, A1 ; {sources}OS:PPC:PPCPort.c -FreePortTable vIndirect $2050, $0284, A1 ; {sources}OS:PPC:PPCPort.c -SetPortInformQue vIndirect $2050, $0288, A1 ; {sources}OS:PPC:PPCPort.c -GetPortNames vIndirect $2050, $028c, A1 ; {sources}OS:PPC:PPCPort.c -WildPortMatch vIndirect $2050, $0290, A1 ; {sources}OS:PPC:PPCPort.c -QueueFromSessRefNum vIndirect $2050, $0294, A1 ; {sources}OS:PPC:PPCSession.c -SessRefNumCompare vIndirect $2050, $0298, A1 ; {sources}OS:PPC:PPCSession.c -SessRefNumtoPtr vIndirect $2050, $029c, A1 ; {sources}OS:PPC:PPCSession.c -DeleteSessByRefNum vIndirect $2050, $02a0, A1 ; {sources}OS:PPC:PPCSession.c -GetSessionRefNum vIndirect $2050, $02a4, A1 ; {sources}OS:PPC:PPCSession.c -SetSessionTable vIndirect $2050, $02a8, A1 ; {sources}OS:PPC:PPCSession.c -PortSessCompare vIndirect $2050, $02ac, A1 ; {sources}OS:PPC:PPCSession.c -CleanSessions vIndirect $2050, $02b0, A1 ; {sources}OS:PPC:PPCSession.c -KillReadAndWrite vIndirect $2050, $02b4, A1 ; {sources}OS:PPC:PPCSession.c -getGlobal vNoVector ; {sources}OS:PPC:PPCUtil.a -callCompletion vIndirect $2050, $02b8, A1 ; {sources}OS:PPC:PPCUtil.a -AddtoAtalkQ vIndirect $2050, $02bc, A1 ; {sources}OS:PPC:PPCUtil.a -RmvfromAtalkQ vIndirect $2050, $02c0, A1 ; {sources}OS:PPC:PPCUtil.a -FakeCompletion vIndirect $2050, $02c4, A1 ; {sources}OS:PPC:PPCUtil.a -PointerCompare vIndirect $2050, $02c8, A1 ; {sources}OS:PPC:PPCUtilities.c -EnQueue vIndirect $2050, $02cc, A1 ; {sources}OS:PPC:PPCUtilities.c -ServeQueue vIndirect $2050, $02d0, A1 ; {sources}OS:PPC:PPCUtilities.c -SearchQueue vIndirect $2050, $02d4, A1 ; {sources}OS:PPC:PPCUtilities.c -DeleteFromQueue vIndirect $2050, $02d8, A1 ; {sources}OS:PPC:PPCUtilities.c -DeleteMultiple vIndirect $2050, $02dc, A1 ; {sources}OS:PPC:PPCUtilities.c -NewMem vIndirect $2050, $02e0, A1 ; {sources}OS:PPC:PPCUtilities.c -DisposeMem vIndirect $2050, $02e4, A1 ; {sources}OS:PPC:PPCUtilities.c -AddNew vIndirect $2050, $02e8, A1 ; {sources}OS:PPC:PPCUtilities.c -RemOld vIndirect $2050, $02ec, A1 ; {sources}OS:PPC:PPCUtilities.c -Replenish vNoVector ; {sources}OS:PPC:PPCUtilities.c -Excess vNoVector ; {sources}OS:PPC:PPCUtilities.c -PRMTFUSER vIndirect $2050, $02f0, A7 ; {sources}OS:PPC:PromptForUser.a -PROMPTFORUSER vIndirect $2050, $02f4, A7 ; {sources}OS:PPC:PromptForUser.a -GETPASSWORDBULLET vIndirect $2050, $02f8, A1 ; {sources}OS:PPC:PromptForUser.c -GetIntlTokenChar vIndirect $2050, $02fc, A1 ; {sources}OS:PPC:PromptForUser.c -FRK vDataTable ; {sources}Objects:ROM:PPC.lib -PERMUTE vDataTable ; {sources}Objects:ROM:PPC.lib -PTBL vDataTable ; {sources}Objects:ROM:PPC.lib -IPINVTBL vDataTable ; {sources}Objects:ROM:PPC.lib -IP vDataTable ; {sources}Objects:ROM:PPC.lib -KEYSCHED vIndirect $2050, $0300, A1 ; {sources}Objects:ROM:PPC.lib -ENCODE vIndirect $2050, $0304, A1 ; {sources}Objects:ROM:PPC.lib - -;============================== End PPC Vectors - ;============================== Quickdraw Vectors ANGLEFROMSLOPE vATrap A??? ; {sources}QuickDraw:ANGLES.a @@ -2699,8 +2223,8 @@ INITCRTABLE vDataTable ; {sources}QuickDraw:cCrsrCore.a CRSRVBLTASK vIndirect $2054, $0390, A7 ; {sources}QuickDraw:cCrsrCore.a PINRECT vATrap A??? ; {sources}QuickDraw:cCrsrCore.a CURSORSECT vIndirect $2054, $0394, A7 ; {sources}QuickDraw:cCrsrCore.a -ERASECURSOR vIndirect $2054, $0398, A7 ; {sources}QuickDraw:cCrsrCore.a -DRAWCURSOR vIndirect $2054, $039c, A7 ; {sources}QuickDraw:cCrsrCore.a +;ERASECURSOR vIndirect $2054, $0398, A7 ; {sources}QuickDraw:cCrsrCore.a +;DRAWCURSOR vIndirect $2054, $039c, A7 ; {sources}QuickDraw:cCrsrCore.a GETMAINCRSR vIndirect $2054, $03a0, A7 ; {sources}QuickDraw:cCrsrCore.a SETCRSRDATA vIndirect $2054, $03a4, A7 ; {sources}QuickDraw:cCrsrCore.a ALLOCCRSR vATrap A??? ; {sources}QuickDraw:cCrsrCore.a @@ -2842,513 +2366,6 @@ GETNEXTFOND vIndirect $2058, $0090, A7 ; {sources}Toolbox:ResourceMgr:Reso ;============================== End Resource Manager Vectors -;============================== SCSI Manager Vectors - -;ÑÑÑÑÑ Old SCSI Manager -SCSIDISPATCHCOMMON vATrap A??? ; {sources}OS:SCSIMgr:SCSILinkPatch.a -SCSIBUSYPLUS vIndirect $205C, $0004, A7 ; {sources}OS:SCSIMgr:SCSILinkPatch.a -SCSIBUSYOTHERS vIndirect $205C, $0008, A7 ; {sources}OS:SCSIMgr:SCSILinkPatch.a -SCSIBOOTS vIndirect $205C, $000c, A7 ; {sources}OS:SCSIMgr:scsiboot.a -SCSILOAD vIndirect $205C, $0010, A7 ; {sources}OS:SCSIMgr:scsiboot.a -SCSI96 vNoVector ; {sources}OS:SCSIMgr:scsimgr96.a -SCSIMGR_96 vIndirect $205C, $0014, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -UNIMPLEMENTED_96 vIndirect $205C, $0018, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSISTAT_96 vIndirect $205C, $001c, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSIRESET_96 vIndirect $205C, $0020, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSIGET_96 vIndirect $205C, $0024, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSISELECT_D96 vIndirect $205C, $0028, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSISELATN_D96 vIndirect $205C, $002c, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSISELECT_S96 vIndirect $205C, $0030, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSISELATN_S96 vIndirect $205C, $0034, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSICMD_96 vIndirect $205C, $0038, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -NEWSCSIWBLIND_96 vIndirect $205C, $003c, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -NEWSCSIWRITE_96 vIndirect $205C, $0040, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -NEWSCSIRBLIND_96 vIndirect $205C, $0044, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -NEWSCSIREAD_96 vIndirect $205C, $0048, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSICOMPLETE_96 vIndirect $205C, $004c, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSIMSGIN_96 vIndirect $205C, $0050, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -DOSCSIMSGOUT_96 vIndirect $205C, $0054, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -CYCLEPHASE_96 vIndirect $205C, $0058, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -SCSIPCTO32BIT vIndirect $205C, $005c, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -ERROR vIndirect $205C, $0060, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -SCSIERR_96 vIndirect $205C, $0064, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -SWAPMMU vIndirect $205C, $0068, A7 ; {sources}OS:SCSIMgr:scsimgr96.a -SCSIHW vNoVector ; {sources}OS:SCSIMgr:scsimgrhw.a -DOSPINDOWN vNoVector ; {sources}OS:SCSIMgr:scsimgrhw.a -SLEEPTASK vNoVector ; {sources}OS:SCSIMgr:scsimgrhw.a -CLEARIRQ vIndirect $205C, $006c, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -DISENABLE vIndirect $205C, $0070, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -BUSERRHANDLER vIndirect $205C, $0074, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -ARB vIndirect $205C, $0078, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -SEL vIndirect $205C, $007c, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -DELAY22 vIndirect $205C, $0080, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -SCSIINTHND vIndirect $205C, $0084, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -TRANSFER vIndirect $205C, $0088, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -SLOWREAD vIndirect $205C, $008c, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -SLOWWRITE vIndirect $205C, $0090, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -VFASTWRITEOSS vIndirect $205C, $0094, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -PFASTWRITEOSS vIndirect $205C, $0098, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -PFASTWRITE vIndirect $205C, $009c, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -VFASTWRITE vIndirect $205C, $00a0, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -FASTWRITE vIndirect $205C, $00a4, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -FASTWRITEOSS vIndirect $205C, $00a8, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -VFASTREADOSS vIndirect $205C, $00ac, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -PFASTREADOSS vIndirect $205C, $00b0, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -PFASTREAD vIndirect $205C, $00b4, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -VFASTREAD vIndirect $205C, $00b8, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -FASTREAD vIndirect $205C, $00bc, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -FASTREADOSS vIndirect $205C, $00c0, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -SLOWCOMP vIndirect $205C, $00c4, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -FASTCOMP vIndirect $205C, $00c8, A7 ; {sources}OS:SCSIMgr:scsimgrhw.a -SCSIHW96 vNoVector ; {sources}OS:SCSIMgr:scsimgrhw96.a -INITHW_SCSI96 vNoVector ; {sources}OS:SCSIMgr:scsimgrhw96.a -INTHND_SCSI96 vIndirect $205C, $00cc, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -TRANSFER_96 vIndirect $205C, $00d0, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -XFER1BYTE vIndirect $205C, $00d4, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -SLOWREAD_96 vIndirect $205C, $00d8, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -SLOWWRITE_96 vIndirect $205C, $00dc, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -FASTWRITE_96 vIndirect $205C, $00e0, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -FASTREAD_96 vIndirect $205C, $00e4, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -RESETBUS_96 vIndirect $205C, $00e8, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -WAITFORINTNOTIME vIndirect $205C, $00ec, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -HANDLESELINPROG vIndirect $205C, $00f0, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -WT4DREQORINT vIndirect $205C, $00f4, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -WAITFORSCSIINTRP vIndirect $205C, $00f8, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -FASTCOMP_96 vIndirect $205C, $00fc, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -SLOWCOMP_96 vIndirect $205C, $0100, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -BUSERRHANDLER_96 vIndirect $205C, $0104, A7 ; {sources}OS:SCSIMgr:scsimgrhw96.a -SCSIINIT vNoVector ; {sources}OS:SCSIMgr:scsimgrinit.a -INITSCSIMGR vNoVector ; {sources}OS:SCSIMgr:scsimgrinit.a -INITSCSIHW vNoVector ; {sources}OS:SCSIMgr:scsimgrinit.a -SCSIINIT96 vNoVector ; {sources}OS:SCSIMgr:scsimgrinit96.a -INITMGR_SCSI96 vNoVector ; {sources}OS:SCSIMgr:scsimgrinit96.a -SCSISETFLAGS vIndirect $205C, $0108, A7 ; {sources}OS:SCSIMgr:scsimgrinitflags.a -SCSINEW vNoVector ; {sources}OS:SCSIMgr:scsimgrnew.a -NEWSCSITRAP vATrap A??? ; {sources}OS:SCSIMgr:scsimgrnew.a -ALTBUSCALL vIndirect $205C, $010c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -DOREQUESTIO vIndirect $205C, $0110, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -DOKILLIO vIndirect $205C, $0114, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -DOBUSINFO vIndirect $205C, $0118, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -RESETBUS vIndirect $205C, $011c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -ENDEQUEUE vIndirect $205C, $0120, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -LOGERROR vIndirect $205C, $0124, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -CLEARSTATE vIndirect $205C, $0128, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -CLEARBUS vIndirect $205C, $012c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MESSAGE vIndirect $205C, $0130, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -PREFLIGHT vIndirect $205C, $0134, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -SETUP vIndirect $205C, $0138, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -FIND vIndirect $205C, $013c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -SETTIMER vIndirect $205C, $0140, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -TIMETASK vIndirect $205C, $0144, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -SCSIDT vIndirect $205C, $0148, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -COMMAND vIndirect $205C, $014c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -STATUSPHASE vIndirect $205C, $0150, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGIN vIndirect $205C, $0154, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGINVALIDIN vIndirect $205C, $0158, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGIDENTIFYIN vIndirect $205C, $015c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGCMDCOMPLETE vIndirect $205C, $0160, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGSAVEDATAPTR vIndirect $205C, $0164, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGRESTOREPTRS vIndirect $205C, $0168, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGDISCONNECT vIndirect $205C, $016c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGMSGREJIN vIndirect $205C, $0170, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGLCCF vIndirect $205C, $0174, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGOUT vIndirect $205C, $0178, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGIDENTIFYOUT vIndirect $205C, $017c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGBUSDEVRST vIndirect $205C, $0180, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGMSGREJOUT vIndirect $205C, $0184, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGINVALIDOUT vIndirect $205C, $0188, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGKILLIO vIndirect $205C, $018c, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -MSGNOOP vIndirect $205C, $0190, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -DATAIO vIndirect $205C, $0194, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -DATADMA vIndirect $205C, $0198, A7 ; {sources}OS:SCSIMgr:scsimgrnew.a -SCSIOLD vNoVector ; {sources}OS:SCSIMgr:scsimgrold.a -SCSIMGR vATrap A??? ; {sources}OS:SCSIMgr:scsimgrold.a -UNIMPLEMENTED vIndirect $205C, $019c, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSISTAT vIndirect $205C, $01a0, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSIRESET vIndirect $205C, $01a4, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSIGET vIndirect $205C, $01a8, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSISELECT vIndirect $205C, $01ac, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSISELATN vIndirect $205C, $01b0, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSICMD vIndirect $205C, $01b4, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -NEWSCSIWBLIND vIndirect $205C, $01b8, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -NEWSCSIWRITE vIndirect $205C, $01bc, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -NEWSCSIRBLIND vIndirect $205C, $01c0, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -NEWSCSIREAD vIndirect $205C, $01c4, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSICOMPLETE vIndirect $205C, $01c8, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSIMSGIN vIndirect $205C, $01cc, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -DOSCSIMSGOUT vIndirect $205C, $01d0, A7 ; {sources}OS:SCSIMgr:scsimgrold.a -LATELOAD vIndirect $205C, $01d4, A7 ; {sources}OS:SCSIMgr:scsiLateLoad.a - -SCSIDISKMODE vNoVector -SCSIDISKWAKEALERT vNoVector -TESTFORDISKMODE vNoVector -SCSICYC96 vNoVector -SCSIERR_PSC vNoVector -NEWSCSIRBLIND_PSC vNoVector -NEWSCSIWBLIND_PSC vNoVector -NEWSCSIWRITE_PSC vNoVector -NEWSCSIREAD_PSC vNoVector -DOSCSIMSGIN_PSC vNoVector -DOSCSIGET_PSC vNoVector -DOSCSIRESET_PSC vNoVector -UNIMPLEMENTED_PSC vNoVector -ERROR_PSC vNoVector -SCSIPCTO32BIT_PSC vNoVector -DOSCSIMSGOUT_PSC vNoVector -DOSCSISTAT_PSC vNoVector -CYCLEPHASE_PSC vNoVector -DOSCSISELATN_DPSC vNoVector -DOSCSISELATN_SPSC vNoVector -DOSCSISELECT_DPSC vNoVector -DOSCSISELECT_SPSC vNoVector -DOSCSICOMPLETE_PSC vNoVector -DOSCSICMD_PSC vNoVector -SCSIMGR_PSC vNoVector -SCSICYCHW96 vNoVector -WAITFORINTNOTIME_PSC vNoVector -FASTCOMP_PSC vNoVector -FASTWRITE_PSC vNoVector -FASTREAD_PSC vNoVector -SLOWCOMP_PSC vNoVector -SLOWWRITE_PSC vNoVector -INTHND_SCSI_PSC vNoVector -INITHW_SCSI_PSC vNoVector -BUSERRHANDLER_PSC vNoVector -WAITFORSCSIINTRP_PSC vNoVector -RESETBUS_PSC vNoVector -HANDLESELINPROGPSC vNoVector -WT4DREQORINTPSC vNoVector -XFER1BYTE_PSC vNoVector -TRANSFER_PSC vNoVector -SLOWREAD_PSC vNoVector -SCSIMGRINITPSC vNoVector -INITMGR_SCSI_PSC vNoVector -SCSIC96INSTALL vNoVector -PATCHSCSIDRIVERS vNoVector -SCSIPATCHTOBLOCKIOINDRIVER vNoVector - -;ÑÑÑÑÑ SCSI Manager 4.3 ; {sources}OS:SCSIMgr4pt3:Å -SCSIAtomic vATrap A??? - -JmpToDrvr vIndirect $205C, $01d8, A7, hasAsyncSCSI ; BootItt.a -CheckSumDrvr vIndirect $205C, $01dc, A7, hasAsyncSCSI ; BootItt.a -; UNUSED vIndirect $205C, $01e0, A1, hasAsyncSCSI ; BootItt.c -; UNUSED vIndirect $205C, $01e4, A1, hasAsyncSCSI ; BootItt.c -; UNUSED vIndirect $205C, $01e8, A1, hasAsyncSCSI ; BootItt.c -ScanDrive vIndirect $205C, $01ec, A1, hasAsyncSCSI ; BootItt.c -LoadDriver vIndirect $205C, $01f0, A1, hasAsyncSCSI ; BootItt.c -ScRead vIndirect $205C, $01f4, A1, hasAsyncSCSI ; BootItt.c -; UNUSED vIndirect $205C, $01f8, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $01fc, Ax, hasAsyncSCSI ; HALc96.a -RecordEvent vIndirect $205C, $0200, A7, hasAsyncSCSI ; Recorder.a -; UNUSED vIndirect $205C, $0204, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0208, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $020c, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0210, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0214, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0218, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $021c, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0220, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0224, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0228, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $022c, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0230, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0234, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $0238, Ax, hasAsyncSCSI ; HALc96.a -; UNUSED vIndirect $205C, $023c, Ax, hasAsyncSCSI ; HALc96.a -SIMRegisterHAL vIndirect $205C, $0240, A1, hasAsyncSCSI ; HALc96Data.a -SIMReregisterHAL vIndirect $205C, $0244, A1, hasAsyncSCSI ; HALc96Data.a -SIMRegisterCommon vIndirect $205C, $0248, A1, hasAsyncSCSI ; HALc96Data.a -EarlySwitchPhase vIndirect $205C, $024c, A1, hasAsyncSCSI ; HALc96Data.a -WastePhase vIndirect $205C, $0250, A1, hasAsyncSCSI ; HALc96Data.a -HandleInitWErr vIndirect $205C, $0254, A1, hasAsyncSCSI ; HALc96Data.a -HandleRejectedIdentify vIndirect $205C, $0258, A1, hasAsyncSCSI ; HALc96Data.a -HandleEarlyMsgIn vIndirect $205C, $025c, A1, hasAsyncSCSI ; SIMmachine.c -HandleNoIdentifyMsg vIndirect $205C, $0260, A1, hasAsyncSCSI ; HALc96Data.a -CallMachine vIndirect $205C, $0264, A1, hasAsyncSCSI ; HALc96Data.a -GetVirtualIDInfo vIndirect $205C, $0268, A1, hasAsyncSCSI ; HALc96Data.a -CheckInterrupts vIndirect $205C, $026c, A1, hasAsyncSCSI ; HALc96Data.a -XPTCallCompRoutine vIndirect $205C, $0270, A1, hasAsyncSCSI ; HALc96Data.a -SIMIntPoll vIndirect $205C, $0274, A1, hasAsyncSCSI ; HALc96Data.a -SetupResetPB vIndirect $205C, $0278, A1, hasAsyncSCSI ; HALc96Data.a -ValidateDeviceIdent vIndirect $205C, $027c, A1, hasAsyncSCSI ; HALc96HWInit.a -TryToRecover vIndirect $205C, $0280, A1, hasAsyncSCSI ; HALc96Init.a -XPTRegisterCommon vIndirect $205C, $0284, A1, hasAsyncSCSI ; HALc96HWInit.a -NewXPTioPB vIndirect $205C, $0288, A1, hasAsyncSCSI ; HALc96PSC.a -; UNUSED vIndirect $205C, $028c, Ax, hasAsyncSCSI ; HALc96DMA.a -; UNUSED vIndirect $205C, $0290, Ax, hasAsyncSCSI ; HALc96DMA.a -; UNUSED vIndirect $205C, $0294, Ax, hasAsyncSCSI ; HALc96DMA.a -COMPRESETDEVICE vIndirect $205C, $0298, A7, hasAsyncSCSI ; HALc96DMA.a -Disconnected vIndirect $205C, $029c, A1, hasAsyncSCSI ; HALc96Routines.a -ciDebuggerPatch vIndirect $205C, $02a0, A7, hasAsyncSCSI ; XPT.a -ReRegisterAllSIMs vIndirect $205C, $02a4, A1, hasAsyncSCSI ; XPT.c -; UNUSED vIndirect $205C, $02a8, Ax, hasAsyncSCSI ; HALc96Routines.a -; UNUSED vIndirect $205C, $02ac, Ax, hasAsyncSCSI ; HALc96Routines.a -; UNUSED vIndirect $205C, $02b0, Ax, hasAsyncSCSI ; HALc96Routines.a -; UNUSED vIndirect $205C, $02b4, Ax, hasAsyncSCSI ; HALc96Routines.a -Ck4SCSIInt vIndirect $205C, $02b8, A7, hasAsyncSCSI ; HALc96Routines.a -Wt4SCSIInt vIndirect $205C, $02bc, A7, hasAsyncSCSI ; InitItt.c -Ck4DREQ vIndirect $205C, $02c8, A7, hasAsyncSCSI ; HALc96Routines.a -; UNUSED vIndirect $205C, $02c0, Ax, hasAsyncSCSI ; HALc96Routines.a -; UNUSED vIndirect $205C, $02c4, Ax, hasAsyncSCSI ; HALc96Routines.a - -; UNUSED vIndirect $205C, $02cc, Ax, hasAsyncSCSI ; -; UNUSED vIndirect $205C, $02d0, Ax, hasAsyncSCSI ; -; UNUSED vIndirect $205C, $02d4, Ax, hasAsyncSCSI ; -; UNUSED vIndirect $205C, $02d8, Ax, hasAsyncSCSI ; -; UNUSED vIndirect $205C, $02dc, Ax, hasAsyncSCSI ; -; UNUSED vIndirect $205C, $02e0, Ax, hasAsyncSCSI ; Recorder.a -CallOldXPT vIndirect $205C, $02e4, A7, hasAsyncSCSI ; SCSIGlue.a -; UNUSED vIndirect $205C, $02e8, Ax, hasAsyncSCSI ; SCSIGlue.a -; UNUSED vIndirect $205C, $02ec, Ax, hasAsyncSCSI ; SCSIGlue.a -; UNUSED vIndirect $205C, $02f0, Ax, hasAsyncSCSI ; SCSIGlue.a -SIMaction vIndirect $205C, $02f4, A1, hasAsyncSCSI ; SIMCore.c -NewOldCall vIndirect $205C, $02f8, A1, hasAsyncSCSI ; SIMCore.c -SIMinit vIndirect $205C, $02fc, A1, hasAsyncSCSI ; SIMCore.c -SIM_ISR vIndirect $205C, $0300, A1, hasAsyncSCSI ; SIMCore.c -ResetSIM vIndirect $205C, $0304, A1, hasAsyncSCSI ; SIMCore.c -ResetDevice vIndirect $205C, $0308, A1, hasAsyncSCSI ; SIMCore.c -TerminateIO vIndirect $205C, $030c, A1, hasAsyncSCSI ; SIMCore.c -AbortCommand vIndirect $205C, $0310, A1, hasAsyncSCSI ; SIMCore.c -SetTempXPTg vIndirect $205C, $0314, A1, hasAsyncSCSI ; XPT.c -EnQIO vIndirect $205C, $0318, A1, hasAsyncSCSI ; SIMQ.c -DeQIO vIndirect $205C, $031c, A1, hasAsyncSCSI ; SIMQ.c -GetNextReadyIO vIndirect $205C, $0320, A1, hasAsyncSCSI ; SIMQ.c -ResetQueues vIndirect $205C, $0324, A1, hasAsyncSCSI ; SIMQ.c -GetNextAutoSense vIndirect $205C, $0328, A1, hasAsyncSCSI ; SIMQ.c -FindIO vIndirect $205C, $032c, A1, hasAsyncSCSI ; SIMQ.c -SwitchQ vIndirect $205C, $0330, A1, hasAsyncSCSI ; SIMQ.c -; UNUSED vIndirect $205C, $0334, Ax, hasAsyncSCSI ; SIMmachine.a -; UNUSED vIndirect $205C, $0338, Ax, hasAsyncSCSI ; SIMmachine.a -VMEnableUserCode vIndirect $205C, $033c, A7, hasAsyncSCSI ; SIMmachine.a -VMDisableUserCode vIndirect $205C, $0340, A7, hasAsyncSCSI ; SIMmachine.a -TheMachine vIndirect $205C, $0344, A1, hasAsyncSCSI ; SIMmachine.c -Reconnect vIndirect $205C, $0348, A1, hasAsyncSCSI ; SIMmachine.c -SwitchPhase vIndirect $205C, $034c, A1, hasAsyncSCSI ; SIMmachine.c -FreeMachine vIndirect $205C, $0350, A1, hasAsyncSCSI ; SIMmachine.c -StartMachine vIndirect $205C, $0354, A1, hasAsyncSCSI ; SIMmachine.c -NewIOStartMachine vIndirect $205C, $0358, A1, hasAsyncSCSI ; SIMmachine.c -; UNUSED vIndirect $205C, $035c, Ax, hasAsyncSCSI ; SIMmachine.c -CompleteIO vIndirect $205C, $0360, A1, hasAsyncSCSI ; SIMmachine.c -; UNUSED vIndirect $205C, $0364, Ax, hasAsyncSCSI ; SIMmachine.c -CheckErrors vIndirect $205C, $0368, A1, hasAsyncSCSI ; SIMmachine.c -SetupSensePB vIndirect $205C, $036c, A1, hasAsyncSCSI ; SIMmachine.c -COMPAUTOSENSE vIndirect $205C, $0370, A1, hasAsyncSCSI ; SIMmachine.c -ValidatePB vIndirect $205C, $0374, A1, hasAsyncSCSI ; SIMmachine.c -StartTimer vIndirect $205C, $0378, A1, hasAsyncSCSI ; Timeout.c -SIMTimerProc vIndirect $205C, $037c, A7, hasAsyncSCSI ; Timeout.c -; UNUSED vIndirect $205C, $0380, Ax, hasAsyncSCSI ; XPT.a -; UNUSED vIndirect $205C, $0384, Ax, hasAsyncSCSI ; XPT.a -; UNUSED vIndirect $205C, $0388, Ax, hasAsyncSCSI ; XPT.a -; UNUSED vIndirect $205C, $038c, Ax, hasAsyncSCSI ; XPT.a -; UNUSED vIndirect $205C, $0390, Ax, hasAsyncSCSI ; XPT.a -; UNUSED vIndirect $205C, $0394, Ax, hasAsyncSCSI ; XPT.c -; UNUSED vIndirect $205C, $0398, Ax, hasAsyncSCSI ; XPT.c -; UNUSED vIndirect $205C, $039c, Ax, hasAsyncSCSI ; XPT.c -XPTRegisterBus vIndirect $205C, $03a0, A1, hasAsyncSCSI ; XPT.c -XPTDeregisterBus vIndirect $205C, $03a4, A1, hasAsyncSCSI ; XPT.c -XPTAction vIndirect $205C, $03a8, A1, hasAsyncSCSI ; XPT.c -CallSIMaction vIndirect $205C, $03ac, A1, hasAsyncSCSI ; XPT.c -SyncWait vIndirect $205C, $03b0, A1, hasAsyncSCSI ; XPT.c -XPTKillXPT vIndirect $205C, $03b4, A1, hasAsyncSCSI ; XPT.c -DispatchISR vIndirect $205C, $03b8, A1, hasAsyncSCSI ; XPT.c -SetRefNum vIndirect $205C, $03bc, A1, hasAsyncSCSI ; XPT.c -GetRefNum vIndirect $205C, $03c0, A1, hasAsyncSCSI ; XPT.c -RemoveRefNum vIndirect $205C, $03c4, A1, hasAsyncSCSI ; XPT.c -CallCompRoutine vIndirect $205C, $03c8, A1, hasAsyncSCSI ; XPT.c -XPTReregisterBus vIndirect $205C, $03cc, A1, hasAsyncSCSI ; XPT.c -SCSIXLATE vIndirect $205C, $03d0, A7, hasAsyncSCSI ; XPTSCSIXlate.a -; UNUSED vIndirect $205C, $03d4, Ax, hasAsyncSCSI ; -Clear vIndirect $205C, $03d8, A1, hasAsyncSCSI ; XPTfunctions.c -; UNUSED vIndirect $205C, $03dc, Ax, hasAsyncSCSI ; -OldSCSICall vIndirect $205C, $03e0, A1, hasAsyncSCSI ; XPToldCall.c -EnumPhaseToSCSIStat vIndirect $205C, $03e4, A1, hasAsyncSCSI ; XPToldCall.c -CallSIMNewOldCall vIndirect $205C, $03e8, A1, hasAsyncSCSI ; XPToldCall.c -OldCallWait vIndirect $205C, $03ec, A1, hasAsyncSCSI ; XPToldCall.c -getTimerPB vIndirect $205C, $03f0, A7, hasAsyncSCSI ; timeout.a - - -SIMCoreRegisterHAL vNoVector -FindIOFromID vNoVector - -AttemptDriverLoad vNoVector - -InitXPT vNoVector -SetXPTg vNoVector -XlateOldSCSIGlobals vNoVector -Init_SCSIXlate vNoVector -InitRecorder vNoVector -InitItt vNoVector -TestFor_SCSI96_1Exists vNoVector -TestFor_SCSI96_2Exists vNoVector -TestFor_PSCExists vNoVector -WtForFIFOData vNoVector -Init53c9xSW vNoVector -OldSCSIExists vNoVector -SCSITrap vNoVector -getCurrentA5 vNoVector -restoreCurrentA5 vNoVector -InitSyncWait vNoVector -RemoveSyncWait vNoVector -ReconnectISR vNoVector -BlockInterrupts vNoVector -UnblockInterrupts vNoVector -Install_ISR vNoVector -OneByteRead vNoVector -OneByteWrite vNoVector -Xfer1Byte96 vNoVector -SlowRead96 vNoVector -FastRead96 vNoVector -SlowWrite96 vNoVector -FastWrite96 vNoVector -Init53c9xHW vNoVector -Initc96Asm vNoVector -AsmInit53c9xHW vNoVector -HALinit vNoVector -GetHalInfo vNoVector -HALSyncConfig vNoVector -HALTeardownIO vNoVector -HALAssertATN vNoVector -HALResetBus vNoVector -HALIntPoll vNoVector -CallBusInquiry vNoVector -HALaction vNoVector -CallCompRoutineGlue vNoVector -Ck4IgnoreCmdShOptDel vNoVector -Ck4OnlyLoadFromDefault vNoVector -AutoMsgIn vNoVector -HandleBusInt vNoVector -InitHW_SCSI96_BIOS vNoVector -DoWeHaveFastSCSI vNoVector -DataIn_DMA1x1 vNoVector -DataOut_DMA1x1 vNoVector -InitAMIC vNoVector -HALc96DataBIOS vNoVector -OneByteWrite_BIOS vNoVector -OneByteRead_BIOS vNoVector -FastWrite_96_BIOS vNoVector -FastRead_96_BIOS vNoVector -DeferAndWait vNoVector -DataDTask vNoVector -RemoveBEH96 vNoVector -InstallBEH96 vNoVector -CEnqueueHead vNoVector -TestFor_OrwellExists vNoVector -TestFor_djMEMCExists vNoVector -IllegalInstr vNoVector -UnimplementedATrap vNoVector -VMRunning vNoVector -InitXPTAsm vNoVector -Ck4EjectableVolume vNoVector -DummyOldCallRead vNoVector -ReInitHAL vNoVector -HALInitCommon vNoVector -InitHW_AMIC vNoVector -InitSW_AMIC vNoVector -SetupIOAMIC vNoVector -TeardownIOAMIC vNoVector -InitHW_PSC vNoVector -InitSW_PSC vNoVector -SetupIOPSC vNoVector -TeardownIOPSC vNoVector - -HALc96 vDataTable ; HALc96.a -HALc96Data vDataTable ; HALc96Data.a -HALc96Init vDataTable ; HALc96Init.a - -;ÑÑÑ Internally Dispatched Entry points -DoInitiate vNoVector -DoBitBucket vNoVector -DoDataIn vNoVector -DoDataOut vNoVector -DoAcceptMsg vNoVector -DoMsgIn vNoVector -DoMsgOut vNoVector -DoStatus vNoVector -DoComplete vNoVector -DoSaveDataPointer vNoVector -DoModifyDataPointer vNoVector -DoRestorePointers vNoVector -GetReconnectInfo vNoVector -GetSelectInfo vNoVector -DoSelect vNoVector -DoSelectWAtn vNoVector -DoCommand vNoVector -SetParity vNoVector -SetupIONoDMA vNoVector -DoReset vNoVector -DoAssertATN vNoVector -TeardownIONoDMA vNoVector -HandleSelected vNoVector - -;ÑÑÑ Internally Dispatched (Non-entry points) -InitDataBuffer vNoVector -InitDataTIB vNoVector -InitDataSG vNoVector -DoDataBuffer vNoVector -DoDataTIB vNoVector -DoDataSG vNoVector -DataIn_DMA vNoVector -DataOut_DMA vNoVector -CyclePhase vNoVector -BusErrHandler96 vNoVector - -;ÑÑÑ Internally Vectored (Non-entry points) -Wt4SelectComplete vNoVector -StartPSC vNoVector ; HALc96PSC.a -PausePSC vNoVector ; HALc96PSC.a -Wt4PSCComplete vNoVector ; HALc96PSC.a -StopPSCRead vNoVector ; HALc96PSC.a -StopPSCWrite vNoVector ; HALc96PSC.a -StartAMIC vNoVector ; HALc96AMIC.a -Wt4AMICComplete vNoVector ; HALc96AMIC.a -StopAMICRead vNoVector ; HALc96AMIC.a -StopAMICWrite vNoVector ; HALc96AMIC.a -DMAInitSW vNoVector ; HALc96PSC.c -HALc96Routines vNoVector ; HALc96Routines.a -SizeOfGlobals vNoVector ; HALc96Routines.a -HAL_SingleISR vNoVector ; HALc96Routines.a -InterruptLevel vNoVector ; XPT.a -DEFERREDCALL vNoVector ; XPT.a -InitDataStuff vNoVector -TeardownIO vNoVector -Init53x9xRegs vNoVector -HAL_DualISR vNoVector -TestFor_HMCDecoder vNoVector -SetLoadFlag vNoVector -SOpenDriver vNoVector -HAL_NoISR vNoVector -DMAInitHW vNoVector -SetupIOPB vNoVector -TeardownIOPB vNoVector -ITTGESTALT vNoVector -XPT_ISR0 vNoVector -XPT_ISR1 vNoVector -XPT_ISR2 vNoVector -XPT_ISR3 vNoVector -XPT_ISR4 vNoVector -XPT_ISR5 vNoVector -XPT_ISR6 vNoVector -XPT_ISR7 vNoVector -XPT_ISR8 vNoVector -XPT_ISR9 vNoVector -XPT_ISRa vNoVector -XPT_ISRb vNoVector -XPT_ISRc vNoVector -XPT_ISRd vNoVector -XPT_ISRe vNoVector -XPT_ISRf vNoVector -ReadInitiatorID vNoVector -GetInitiatorID vNoVector - -;ÑÑÑ Non-vectored but we don't want them vectored (debugging or init things) -ISITT vNoVector -INITSCSIBOOT vNoVector -ITTBOOT vNoVector -RecordError vNoVector - -;============================== End SCSI Manager Vectors - ;============================== Script Manager Vectors GETIDENTRY vIndirect $2060, $0004, A7 ; {sources}Toolbox:ScriptMgr:DblByteCompat.a @@ -3485,6 +2502,9 @@ INTLTOKENIZE vIndirect $2060, $01dc, A7 ; {sources}Toolbox:ScriptMgr:Script MAXOLDDATE vDataTable ; {sources}Objects:ROM:ScriptMgr.lib SECSINDAYX vDataTable ; {sources}Objects:ROM:ScriptMgr.lib +SCRIPTMGR_VEC01E0 vIndirect $2060, $01e0, A7 +SCRIPTMGR_VEC01E4 vIndirect $2060, $01e4, A7 + ;============================== End Script Manager Vectors ;============================== Segment Loader Vectors @@ -3525,8 +2545,8 @@ UPDATEEMUWARMSTART vIndirect $2068, $002C, A7 ; {sources}Toolbox:ShutDownMgr ;============================== Original SuperMario Team Names -MAGICNAME vIndirect $206C, $0004, A7 ; Ricardo's attempt to hide the name strings -MAGIC vIndirect $206C, $0008, A7 ; can be found in {Sources}OS:MagicData.a +;MAGICNAME vIndirect $206C, $0004, A7 ; Ricardo's attempt to hide the name strings +;MAGIC vIndirect $206C, $0008, A7 ; can be found in {Sources}OS:MagicData.a ;============================== Original SuperMario Team Names @@ -3563,8 +2583,8 @@ CARDCHANGED vIndirect $206C, $003c, A7 ; {sources}OS:SlotMgr:SlotMgr.a SLOTEXEC vIndirect $206C, $0040, A7 ; {sources}OS:SlotMgr:SlotMgr.a CALCSPOINTER vIndirect $206C, $0044, A7 ; {sources}OS:SlotMgr:SlotMgr.a GETSLOTDRVR vIndirect $206C, $0048, A7 ; {sources}OS:SlotMgr:SlotMgr.a -GETDRIVERPATCH vIndirect $206C, $004c, A7, has2MegROMOrMore ; {sources}OS:SlotMgr:SlotMgr.a -GETDEVINDEX vIndirect $206C, $0050, A7, has2MegROMOrMore ; {sources}OS:SlotMgr:SlotMgr.a +;GETDRIVERPATCH vIndirect $206C, $004c, A7, has2MegROMOrMore ; {sources}OS:SlotMgr:SlotMgr.a +;GETDEVINDEX vIndirect $206C, $0050, A7, has2MegROMOrMore ; {sources}OS:SlotMgr:SlotMgr.a JSRTBL vDataTable ; {sources}OS:SlotMgr:SlotMgr.a READSLOTPRAM vIndirect $206C, $0054, A7 ; {sources}OS:SlotMgr:SlotMgr.a PUTSLOTPRAM vIndirect $206C, $0058, A7 ; {sources}OS:SlotMgr:SlotMgr.a @@ -3623,124 +2643,6 @@ SECONDARYEND vNoVector ; {sources}OS:SlotMgr:SlotMgrInit.a ;============================== End Slot Manager Vectors -;============================== Sound Manager Vectors - -AcceptInitOptions vIndirect $2070, $0004, A7 ; {sources}Toolbox:SoundMgr: -AddToHead vIndirect $2070, $0008, A7 ; {sources}Toolbox:SoundMgr: -CancelWaitCallback vIndirect $2070, $000c, A7 ; {sources}Toolbox:SoundMgr: -ClearASCInt vIndirect $2070, $0010, A7 ; {sources}Toolbox:SoundMgr: -ClearStandardASCInterrupt vNoVector -CloseOutputDevice vIndirect $2070, $0018, A7 ; {sources}Toolbox:SoundMgr: -__Comp3to1 vIndirect $2070, $001c, A7 ; {sources}Toolbox:SoundMgr: -__Comp6to1 vIndirect $2070, $0020, A7 ; {sources}Toolbox:SoundMgr: -CountMatchingBits vIndirect $2070, $0024, A7 ; {sources}Toolbox:SoundMgr: -DisableASCInts vIndirect $2070, $0028, A7 ; {sources}Toolbox:SoundMgr: -DisableStandardASCInterrupt vNoVector -DispAddTool vIndirect $2070, $0030, A7 ; {sources}Toolbox:SoundMgr: -DispFuncDisp vIndirect $2070, $0034, A7 ; {sources}Toolbox:SoundMgr: -DispRemTool vNoVector -DispToolAddr vNoVector -DispVersion vNoVector -DoNothing vNoVector -DOUBLEBUFFERCOMPLETE vIndirect $2070, $0048, A7 ; {sources}Toolbox:SoundMgr: -EnableASCInts vIndirect $2070, $004c, A7 ; {sources}Toolbox:SoundMgr: -EnableStandardASCInterrupt vNoVector -__Exp1to3 vIndirect $2070, $0054, A7 ; {sources}Toolbox:SoundMgr: -__Exp1to6 vIndirect $2070, $0058, A7 ; {sources}Toolbox:SoundMgr: -GetBuiltInDevice vIndirect $2070, $005c, A7 ; {sources}Toolbox:SoundMgr: -GetHardwareVolume vIndirect $2070, $0060, A7 ; {sources}Toolbox:SoundMgr: -GetSoundAttributes vIndirect $2070, $0064, A7 ; {sources}Toolbox:SoundMgr: -GetThisComponent vIndirect $2070, $0068, A7 ; {sources}Toolbox:SoundMgr: -HGetFCBInfo vIndirect $2070, $006c, A7 ; {sources}Toolbox:SoundMgr: -InitSoundMgr vNoVector ; {sources}Toolbox:SoundMgr: -InitSndDispatch vIndirect $2070, $0074, A7 ; {sources}Toolbox:SoundMgr: -InitWaveBuffer vIndirect $2070, $0078, A7 ; {sources}Toolbox:SoundMgr: -InsertInQueue vIndirect $2070, $007c, A7 ; {sources}Toolbox:SoundMgr: -InstallNewGlobals vIndirect $2070, $0080, A7 ; {sources}Toolbox:SoundMgr: -InstallSoundIntHandler vIndirect $2070, $0084, A7 ; {sources}Toolbox:SoundMgr: -IsDeadProcess vIndirect $2070, $0088, A7 ; {sources}Toolbox:SoundMgr: -IsUnknownChannel vIndirect $2070, $008c, A7 ; {sources}Toolbox:SoundMgr: -LoadSoundInputDriver vIndirect $2070, $0090, A7 ; {sources}Toolbox:SoundMgr: -MACEDispatch vIndirect $2070, $0094, A7 ; {sources}Toolbox:SoundMgr: -MakeFlags vIndirect $2070, $0098, A7 ; {sources}Toolbox:SoundMgr: -NEXTDOUBLEBUFFER vIndirect $2070, $009c, A7 ; {sources}Toolbox:SoundMgr: -NextFromQueue vIndirect $2070, $00a0, A7 ; {sources}Toolbox:SoundMgr: -NEXTNOTEBUFFER vIndirect $2070, $00a4, A7 ; {sources}Toolbox:SoundMgr: -NEXTWAVEBUFFER vIndirect $2070, $00a8, A7 ; {sources}Toolbox:SoundMgr: -OpenOutputDevice vIndirect $2070, $00ac, A7 ; {sources}Toolbox:SoundMgr: -OpenPreferenceFile vIndirect $2070, $00b0, A7 ; {sources}Toolbox:SoundMgr: -PowerTable vDataTable ; {sources}Toolbox:SoundMgr: -PrepChannel vIndirect $2070, $00b8, A7 ; {sources}Toolbox:SoundMgr: -PrepDoubleBuffer vIndirect $2070, $00bc, A7 ; {sources}Toolbox:SoundMgr: -PrepNoteBuffer vIndirect $2070, $00c0, A7 ; {sources}Toolbox:SoundMgr: -PrepSoundParamBlock vIndirect $2070, $00c4, A7 ; {sources}Toolbox:SoundMgr: -PrepWaveBuffer vIndirect $2070, $00c8, A7 ; {sources}Toolbox:SoundMgr: -ProcessCmd vIndirect $2070, $00cc, A7 ; {sources}Toolbox:SoundMgr: -ProcessNextCmd vIndirect $2070, $00d0, A7 ; {sources}Toolbox:SoundMgr: -PumpSndResource vIndirect $2070, $00d4, A7 ; {sources}Toolbox:SoundMgr: -QuantizeSample vNoVector -SadismDispatch vIndirect $2070, $00dc, A7 ; {sources}Toolbox:SoundMgr: -SadismJmpTable vNoVector -SamplesToBytes vNoVector -ScheduleWaitCallback vIndirect $2070, $00e8, A7 ; {sources}Toolbox:SoundMgr: -SetChannelType vIndirect $2070, $00ec, A7 ; {sources}Toolbox:SoundMgr: -SetSoundHeader vIndirect $2070, $00f0, A7 ; {sources}Toolbox:SoundMgr: -SetTimbre vIndirect $2070, $00f4, A7 ; {sources}Toolbox:SoundMgr: -SetUpSifter vIndirect $2070, $00f8, A7 ; {sources}Toolbox:SoundMgr: -SetupSoundInterruptVectors vIndirect $2070, $00fc, A7 ; {sources}Toolbox:SoundMgr: -SetWaveTable vIndirect $2070, $0100, A7 ; {sources}Toolbox:SoundMgr: -SineTable vDataTable ; {sources}Toolbox:SoundMgr: -SndManagerDispatch vIndirect $2070, $0108, A7 ; {sources}Toolbox:SoundMgr: -SndManagerJmpTable vNoVector ; {sources}Toolbox:SoundMgr: -SOUNDCOMPLETE vIndirect $2070, $0110, A7 ; {sources}Toolbox:SoundMgr: -SoundDispatcher vIndirect $2070, $0114, A7 ; {sources}Toolbox:SoundMgr: -SoundInDispatch vIndirect $2070, $0118, A7 ; {sources}Toolbox:SoundMgr: -SoundIntHandler vIndirect $2070, $011c, A7 ; {sources}Toolbox:SoundMgr: -StartSyncedSounds vIndirect $2070, $0120, A7 ; {sources}Toolbox:SoundMgr: -TryRomBeep vIndirect $2070, $0124, A7 ; {sources}Toolbox:SoundMgr: -TwelthPower vIndirect $2070, $0128, A7 ; {sources}Toolbox:SoundMgr: -UnimplFunction vIndirect $2070, $012c, A7 ; {sources}Toolbox:SoundMgr: -WAITCOMPLETION vIndirect $2070, $0130, A7 ; {sources}Toolbox:SoundMgr: -__CLOSEMIXERCOMPONENT vIndirect $2070, $0134, A7 ; {sources}Toolbox:SoundMgr: -__DISPOSESOUNDGLOBALS vIndirect $2070, $0138, A7 ; {sources}Toolbox:SoundMgr: -__GETCOMPRESSIONINFO vIndirect $2070, $013c, A7 ; {sources}Toolbox:SoundMgr: -__GETDEFAULTOUTPUTVOLUME vIndirect $2070, $0140, A7 ; {sources}Toolbox:SoundMgr: -__GETDEFAULTSOUNDOUTPUT vIndirect $2070, $0144, A7 ; {sources}Toolbox:SoundMgr: -__GETSOUNDHEADEROFFSET vIndirect $2070, $0148, A7 ; {sources}Toolbox:SoundMgr: -__GETSOUNDPREFERENCE vIndirect $2070, $014c, A7 ; {sources}Toolbox:SoundMgr: -__GETSYSBEEPVOLUME vIndirect $2070, $0150, A7 ; {sources}Toolbox:SoundMgr: -__MAKESIFTERCHAIN vIndirect $2070, $0154, A7 ; {sources}Toolbox:SoundMgr: -__MulDivU vIndirect $2070, $0158, A7 ; {sources}Toolbox:SoundMgr: -__OPENMIXERCOMPONENT vIndirect $2070, $015c, A7 ; {sources}Toolbox:SoundMgr: -__SETDEFAULTOUTPUTVOLUME vIndirect $2070, $0160, A7 ; {sources}Toolbox:SoundMgr: -__SETDEFAULTSOUNDOUTPUT vIndirect $2070, $0164, A7 ; {sources}Toolbox:SoundMgr: -__SETSOUNDPREFERENCE vIndirect $2070, $0168, A7 ; {sources}Toolbox:SoundMgr: -__SETSOUNDVOL vNoVector -__SETSYSBEEPVOLUME vIndirect $2070, $0170, A7 ; {sources}Toolbox:SoundMgr: -__SNDADDMODIFIER vIndirect $2070, $0174, A7 ; {sources}Toolbox:SoundMgr: -__SNDAPPDEAD vIndirect $2070, $0178, A7 ; {sources}Toolbox:SoundMgr: -__SNDCHANNELSTATUS vIndirect $2070, $017c, A7 ; {sources}Toolbox:SoundMgr: -__SNDCONTROL vIndirect $2070, $0180, A7 ; {sources}Toolbox:SoundMgr: -__SNDDISPOSECHANNEL vIndirect $2070, $0184, A7 ; {sources}Toolbox:SoundMgr: -__SNDDOCOMMAND vIndirect $2070, $0188, A7 ; {sources}Toolbox:SoundMgr: -__SNDDOIMMEDIATE vIndirect $2070, $018c, A7 ; {sources}Toolbox:SoundMgr: -__SNDGETSYSBEEPSTATE vIndirect $2070, $0190, A7 ; {sources}Toolbox:SoundMgr: -__SNDMANAGERSTATUS vIndirect $2070, $0194, A7 ; {sources}Toolbox:SoundMgr: -__SNDNEWCHANNEL vIndirect $2070, $0198, A7 ; {sources}Toolbox:SoundMgr: -__SNDPLAY vIndirect $2070, $019c, A7 ; {sources}Toolbox:SoundMgr: -__SNDPLAYDOUBLEBUFFER vIndirect $2070, $01a0, A7 ; {sources}Toolbox:SoundMgr: -__SNDSETSYSBEEPSTATE vIndirect $2070, $01a4, A7 ; {sources}Toolbox:SoundMgr: -__SNDSOUNDMANAGERVERSION vIndirect $2070, $01a8, A7 ; {sources}Toolbox:SoundMgr: -__SYSBEEP vIndirect $2070, $01ac, A7 ; {sources}Toolbox:SoundMgr: - -DELTA_TABLE vDataTable ; {sources}Toolbox:SoundMgr:Tables.3.a -MIN2_TABLE vDataTable ; {sources}Toolbox:SoundMgr:Tables.3.a -MIN3_TABLE vDataTable ; {sources}Toolbox:SoundMgr:Tables.3.a -IQUADEL2_TABLE vDataTable ; {sources}Toolbox:SoundMgr:Tables.3.a -IQUADEL3_TABLE vDataTable ; {sources}Toolbox:SoundMgr:Tables.3.a - -;============================== End Sound Manager Vectors - ;============================== Start Manager Vectors SIZEMEMORY vNoVector ; {sources}OS:StartMgr:SizeMem.a ALLOCFAKERGNS vNoVector ; {sources}OS:StartMgr:StartAlert.a @@ -3904,101 +2806,6 @@ SONIC_Test vNoVector ; {sources}OS:StartMgr:UnivTestEnv:SONIC_Test.c ;============================== End Start Manager Vectors -;============================== Text Services Manager Vectors - -TSMDISPATCH vATrap A??? ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -XINITTSMAWAREAPPLICATION vIndirect $2078, $0004, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -xInitTSMAwareDriver vIndirect $2078, $0008, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utaRecordDocumentID vIndirect $2078, $000c, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utaRemoveDocumentID vIndirect $2078, $0010, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utaUpdateAppFlagInPSNTable vIndirect $2078, $0014, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utaUpdateDocFlagInPSNTable vIndirect $2078, $0018, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utaTSMAwareApplicationP vIndirect $2078, $001c, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -XCLOSETSMAWAREAPPLICATION vIndirect $2078, $0020, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utCloseAppCommon vIndirect $2078, $0024, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -UTAGETTSMAWAREDOCTABLE vIndirect $2078, $0028, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -UTAGETTSMAPPRECORDPTR vIndirect $2078, $002c, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -UTAGETAPPSUSEINPUTWINDOWFLAG vIndirect $2078, $0030, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -UTAISAPPTSMAWAREANDNOTUSINGIW vIndirect $2078, $0034, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -XINFORMTSM vIndirect $2078, $0038, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -TSMGestalt vIndirect $2078, $003c, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -TSMGRINSTALL vIndirect $2078, $0040, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -OLDJAPANESEINPUTMETHODEXISTS vIndirect $2078, $0044, A7 ; {sources}Toolbox:TextServicesMgr:TSMExtension.a -utNewTSMDocument vIndirect $2078, $0048, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XNEWTSMDOCUMENT4SWM vIndirect $2078, $004c, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XNEWTSMDOCUMENT vIndirect $2078, $0050, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XDELETETSMDOCUMENT vIndirect $2078, $0054, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XDEACTIVATETSMDOCUMENT vIndirect $2078, $0058, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XACTIVATETSMDOCUMENT vIndirect $2078, $005c, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -utTSMEvent2InputMethod vIndirect $2078, $0060, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XTSMEVENTFROMSWM vIndirect $2078, $0064, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XTSMEVENT vIndirect $2078, $0068, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XTSMMENUSELECT vIndirect $2078, $006c, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XFIXTSMDOCUMENT vIndirect $2078, $0070, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XSETTSMCURSOR vIndirect $2078, $0074, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XGETSERVICELIST vIndirect $2078, $0078, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XOPENTEXTSERVICE vIndirect $2078, $007c, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XCLOSETEXTSERVICE vIndirect $2078, $0080, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -utMapInstance2Refcon vIndirect $2078, $0084, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -XSENDAETOCLIENT vIndirect $2078, $0088, A1 ; {sources}Toolbox:TextServicesMgr:TSMFunctions.c -utJustDeactivateIM4Document vIndirect $2078, $008c, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utBadSandL vIndirect $2078, $0090, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utVerifyTSMDocID vIndirect $2078, $0094, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utAppendTS2Document vIndirect $2078, $0098, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utMakeRoom4SInfoHandle vIndirect $2078, $009c, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utHidePaletteAndMenu vIndirect $2078, $00a0, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utCleanUpPreviousDoc vIndirect $2078, $00a4, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utCreateSystemVersionOfMenu vIndirect $2078, $00a8, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utActivateIM4Document vIndirect $2078, $00ac, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utDeactivateIMforDocument vIndirect $2078, $00b0, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utDeleteCleanUpTSMDocument vIndirect $2078, $00b4, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utCloseIM4Document vIndirect $2078, $00b8, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utDeleteInputMethodsPreviousMenu vIndirect $2078, $00bc, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utCheckSysHeapSlop vIndirect $2078, $00c0, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utOpenIM4Document vIndirect $2078, $00c4, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utOpenActivateDefaultIM vIndirect $2078, $00c8, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utActivateThisDocsInputMethod vIndirect $2078, $00cc, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utSupportedSL vIndirect $2078, $00d0, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utScriptIsNotCCJK vIndirect $2078, $00d4, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utScriptIsCCJKAndNeedsIM vIndirect $2078, $00d8, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utInformPMgr vIndirect $2078, $00dc, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utDocNeedsInputMethod vIndirect $2078, $00e0, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utGetScriptIndex vIndirect $2078, $00e4, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utGetTSMDefaultInputMethod vIndirect $2078, $00e8, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utSLRec2CompFlag vIndirect $2078, $00ec, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utChangeToOldJIM vIndirect $2078, $00f0, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utSuspendResumeApp vIndirect $2078, $00f4, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utAddTSMResource vIndirect $2078, $00f8, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utUpdateDefaultInputMethodResource vIndirect $2078, $00fc, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utFixDocumentAndCloseSWMWindow vIndirect $2078, $0100, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utCloseSWMWindow vIndirect $2078, $0104, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utDeleteMenu vIndirect $2078, $0108, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utDeleteSysMenu vIndirect $2078, $010c, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -utSwapZone vIndirect $2078, $0110, A1 ; {sources}Toolbox:TextServicesMgr:TSMInternalUtils.c -XSETDEFAULTINPUTMETHOD vIndirect $2078, $0114, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XGETDEFAULTINPUTMETHOD vIndirect $2078, $0118, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XSETTEXTSERVICELANGUAGE vIndirect $2078, $011c, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XGETTEXTSERVICELANGUAGE vIndirect $2078, $0120, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XUSEINPUTWINDOW vIndirect $2078, $0124, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XNEWSERVICEWINDOW vIndirect $2078, $0128, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XCLOSESERVICEWINDOW vIndirect $2078, $012c, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XGETFRONTSERVICEWINDOW vIndirect $2078, $0130, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -XFINDSERVICEWINDOW vIndirect $2078, $0134, A1 ; {sources}Toolbox:TextServicesMgr:TSMUtility.c -MISCMGR vNoVector ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -GETKEYS vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -BUTTON vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -TICKCOUNT vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -GETMOUSE vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -STILLDOWN vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -WAITMOUSEUP vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -EVENTAVAIL vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -GETNEXTEVENT vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -WAITNEXTEVENT vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgr.a -DOSYSERRORUPDATES vATrap A??? ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgrPatches.a -CLEARSYSERRORUPDATERECT vIndirect $2078, $0138, A7 ; {sources}Toolbox:ToolboxEventMgr:ToolboxEventMgrPatches.a - -;============================== End Text Services Manager Vectors - ;============================== TextEdit Vectors TEXTEDIT vNoVector ; {sources}Toolbox:TextEdit:TextEdit.a @@ -4082,17 +2889,17 @@ TEGETOFFSET vATrap A??? ; {sources}Toolbox:TextEdit:TextEdit.a ;============================== Time Manager Vectors -TIMEMGR vNoVector ; {sources}OS:TimeMgr:TimeMgr.a -__RMVTIME vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a -AFTERFREEZETIMEINRMVTIME vIndirect $2080, $0004, A7 ; {sources}OS:TimeMgr:TimeMgr.a -__INSTIME vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a -MULTANDMERGE vIndirect $2080, $0008, A7 ; {sources}OS:TimeMgr:TimeMgr.a -__PRIMETIME vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a -AFTERFREEZETIMEINPRIMETIME vIndirect $2080, $000c, A7 ; {sources}OS:TimeMgr:TimeMgr.a -AFTERFREEZETIMEINTIMER2INT vIndirect $2080, $0010, A7 ; {sources}OS:TimeMgr:TimeMgr.a -__MICROSECONDS vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a -FREEZETIME vIndirect $2080, $0014, A7 ; {sources}OS:TimeMgr:TimeMgr.a -INITTIMEMGR vNoVector ; {sources}OS:TimeMgr:TimeMgr.a +;TIMEMGR vNoVector ; {sources}OS:TimeMgr:TimeMgr.a +;__RMVTIME vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a +;AFTERFREEZETIMEINRMVTIME vIndirect $2080, $0004, A7 ; {sources}OS:TimeMgr:TimeMgr.a +;__INSTIME vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a +;MULTANDMERGE vIndirect $2080, $0008, A7 ; {sources}OS:TimeMgr:TimeMgr.a +;__PRIMETIME vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a +;AFTERFREEZETIMEINPRIMETIME vIndirect $2080, $000c, A7 ; {sources}OS:TimeMgr:TimeMgr.a +;AFTERFREEZETIMEINTIMER2INT vIndirect $2080, $0010, A7 ; {sources}OS:TimeMgr:TimeMgr.a +;__MICROSECONDS vATrap A??? ; {sources}OS:TimeMgr:TimeMgr.a +;FREEZETIME vIndirect $2080, $0014, A7 ; {sources}OS:TimeMgr:TimeMgr.a +;INITTIMEMGR vNoVector ; {sources}OS:TimeMgr:TimeMgr.a ;============================== End Time Manager Vectors @@ -4286,165 +3093,94 @@ FASTERINVALRECT vATrap A??? ; {sources}Toolbox:WindowMgr:WindowMgrExte ACTIVATEPALETTELAYERBRACKET vATrap A??? ; {sources}Toolbox:WindowMgr:WindowMgrExtensions.a GETREARWINDOW vIndirect $2084, $01d0, A7 ; {sources}Toolbox:WindowMgr:WindowMgrExtensions.a +WINDOWMGR_VEC01D4 vIndirect $2084, $01d4, A1 + ;============================== End Window Manager Vectors -;============================== Figment Memory Manager Vectors +;============================== Expansion Bus Manager Vectors +EXPANSIONBUSMGR_VEC0004 vIndirect $208c, $0004, A7 +EXPANSIONBUSMGR_VEC0008 vIndirect $208c, $0008, A7 +EXPANSIONBUSMGR_VEC000C vIndirect $208c, $000c, A7 +EXPANSIONBUSMGR_VEC0010 vIndirect $208c, $0010, A7 +EXPANSIONBUSMGR_VEC0014 vIndirect $208c, $0014, A7 +EXPANSIONBUSMGR_VEC0018 vIndirect $208c, $0018, A7 +EXPANSIONBUSMGR_VEC001C vIndirect $208c, $001c, A7 +EXPANSIONBUSMGR_VEC0020 vIndirect $208c, $0020, A7 +EXPANSIONBUSMGR_VEC0024 vIndirect $208c, $0024, A7 +EXPANSIONBUSMGR_VEC0028 vIndirect $208c, $0028, A7 +EXPANSIONBUSMGR_VEC002C vIndirect $208c, $002c, A7 +EXPANSIONBUSMGR_VEC0030 vIndirect $208c, $0030, A7 +EXPANSIONBUSMGR_VEC0034 vIndirect $208c, $0034, A7 +EXPANSIONBUSMGR_VEC0038 vIndirect $208c, $0038, A7 +EXPANSIONBUSMGR_VEC003C vIndirect $208c, $003c, A7 +EXPANSIONBUSMGR_VEC0040 vIndirect $208c, $0040, A7 +EXPANSIONBUSMGR_VEC0044 vIndirect $208c, $0044, A7 +EXPANSIONBUSMGR_VEC0048 vIndirect $208c, $0048, A7 +EXPANSIONBUSMGR_VEC004C vIndirect $208c, $004c, A7 +EXPANSIONBUSMGR_VEC0050 vIndirect $208c, $0050, A7 +EXPANSIONBUSMGR_VEC0054 vIndirect $208c, $0054, A7 +EXPANSIONBUSMGR_VEC0058 vIndirect $208c, $0058, A7 +EXPANSIONBUSMGR_VEC005C vIndirect $208c, $005c, A7 +EXPANSIONBUSMGR_VEC0060 vIndirect $208c, $0060, A7 +EXPANSIONBUSMGR_VEC0064 vIndirect $208c, $0064, A7 +EXPANSIONBUSMGR_VEC0068 vIndirect $208c, $0068, A7 +EXPANSIONBUSMGR_VEC006C vIndirect $208c, $006c, A7 +EXPANSIONBUSMGR_VEC0070 vIndirect $208c, $0070, A7 +EXPANSIONBUSMGR_VEC0074 vIndirect $208c, $0074, A7 +EXPANSIONBUSMGR_VEC0078 vIndirect $208c, $0078, A7 +EXPANSIONBUSMGR_VEC007C vIndirect $208c, $007c, A7 +EXPANSIONBUSMGR_VEC0080 vIndirect $208c, $0080, A7 +EXPANSIONBUSMGR_VEC0084 vIndirect $208c, $0084, A7 +EXPANSIONBUSMGR_VEC0088 vIndirect $208c, $0088, A7 +EXPANSIONBUSMGR_VEC008C vIndirect $208c, $008c, A7 +EXPANSIONBUSMGR_VEC0090 vIndirect $208c, $0090, A7 +EXPANSIONBUSMGR_VEC0094 vIndirect $208c, $0094, A7 +EXPANSIONBUSMGR_VEC0098 vIndirect $208c, $0098, A7 +EXPANSIONBUSMGR_VEC0100 vIndirect $208c, $0100, A7 +EXPANSIONBUSMGR_VEC0104 vIndirect $208c, $0104, A7 +EXPANSIONBUSMGR_VEC0108 vIndirect $208c, $0108, A7 +EXPANSIONBUSMGR_VEC010C vIndirect $208c, $010c, A7 +EXPANSIONBUSMGR_VEC0110 vIndirect $208c, $0110, A7 +EXPANSIONBUSMGR_VEC0114 vIndirect $208c, $0114, A7 +EXPANSIONBUSMGR_VEC0118 vIndirect $208c, $0118, A7 +EXPANSIONBUSMGR_VEC011C vIndirect $208c, $011c, A7 +EXPANSIONBUSMGR_VEC0120 vIndirect $208c, $0120, A7 +EXPANSIONBUSMGR_VEC0124 vIndirect $208c, $0124, A7 +EXPANSIONBUSMGR_VEC012C vIndirect $208c, $012c, A7 +EXPANSIONBUSMGR_VEC0130 vIndirect $208c, $0130, A7 +EXPANSIONBUSMGR_VEC0134 vIndirect $208c, $0134, A7 +EXPANSIONBUSMGR_VEC0138 vIndirect $208c, $0138, A7 +EXPANSIONBUSMGR_VEC014C vIndirect $208c, $014c, A7 +EXPANSIONBUSMGR_VEC0150 vIndirect $208c, $0150, A7 +EXPANSIONBUSMGR_VEC0154 vIndirect $208c, $0154, A7 +EXPANSIONBUSMGR_VEC0158 vIndirect $208c, $0158, A7 +EXPANSIONBUSMGR_VEC015C vIndirect $208c, $015c, A7 +EXPANSIONBUSMGR_VEC0160 vIndirect $208c, $0160, A7 +EXPANSIONBUSMGR_VEC0164 vIndirect $208c, $0164, A7 +EXPANSIONBUSMGR_VEC0168 vIndirect $208c, $0168, A7 +EXPANSIONBUSMGR_VEC016C vIndirect $208c, $016c, A7 +EXPANSIONBUSMGR_VEC0170 vIndirect $208c, $0170, A7 +EXPANSIONBUSMGR_VEC0174 vIndirect $208c, $0174, A7 +EXPANSIONBUSMGR_VEC0178 vIndirect $208c, $0178, A7 +EXPANSIONBUSMGR_VEC017C vIndirect $208c, $017c, A7 +EXPANSIONBUSMGR_VEC0180 vIndirect $208c, $0180, A7 +EXPANSIONBUSMGR_VEC0184 vIndirect $208c, $0184, A7 +EXPANSIONBUSMGR_VEC0188 vIndirect $208c, $0188, A7 +EXPANSIONBUSMGR_VEC018C vIndirect $208c, $018c, A7 +EXPANSIONBUSMGR_VEC0190 vIndirect $208c, $0190, A7 +EXPANSIONBUSMGR_VEC0194 vIndirect $208c, $0194, A7 +EXPANSIONBUSMGR_VEC0198 vIndirect $208c, $0198, A7 +EXPANSIONBUSMGR_VEC019C vIndirect $208c, $019c, A7 +EXPANSIONBUSMGR_VEC01A0 vIndirect $208c, $01a0, A7 +EXPANSIONBUSMGR_VEC01A4 vIndirect $208c, $01a4, A7 +EXPANSIONBUSMGR_VEC01A8 vIndirect $208c, $01a8, A7 +EXPANSIONBUSMGR_VEC01AC vIndirect $208c, $01ac, A7 +EXPANSIONBUSMGR_VEC01B0 vIndirect $208c, $01b0, A7 +EXPANSIONBUSMGR_VEC01B4 vIndirect $208c, $01b4, A7 -HEAPDISPATCH vIndirect $2088, $0004, A7 ; Figment -FIG_HSETFLAGS vIndirect $2088, $0008, A7 ; Figment -FIG_HGETFLAGS vIndirect $2088, $000c, A7 ; Figment -FIG_HNORSRC vIndirect $2088, $0010, A7 ; Figment -FIG_HRSRC vIndirect $2088, $0014, A7 ; Figment -FIG_STACKSPACETRAP vIndirect $2088, $0018, A7 ; Figment -FIG_PURGESPACETRAP vIndirect $2088, $001c, A7 ; Figment -FIG_MAXBLOCKTRAP vIndirect $2088, $0020, A7 ; Figment -FIG_MOVEHLOW vIndirect $2088, $0024, A7 ; Figment -FIG_MOVEHHI vIndirect $2088, $0028, A7 ; Figment -FIG_SETGROWZONE vIndirect $2088, $002c, A7 ; Figment -FIG_HNOPURGE vIndirect $2088, $0030, A7 ; Figment -FIG_HPURGE vIndirect $2088, $0034, A7 ; Figment -FIG_HUNLOCK vIndirect $2088, $0038, A7 ; Figment -FIG_HLOCK vIndirect $2088, $003c, A7 ; Figment -FIG_EMPTYHANDLE vIndirect $2088, $0040, A7 ; Figment -FIG_PURGEMEM vIndirect $2088, $0044, A7 ; Figment -FIG_RESRVMEM vIndirect $2088, $0048, A7 ; Figment -FIG_COMPACTMEMTRAP vIndirect $2088, $004c, A7 ; Figment -FIG_MAXMEMTRAP vIndirect $2088, $0050, A7 ; Figment -FIG_FREEMEM vIndirect $2088, $0054, A7 ; Figment -FIG_PTRZONETRAP vIndirect $2088, $0058, A7 ; Figment -FIG_SETPTRSIZETRAP vIndirect $2088, $005c, A7 ; Figment -FIG_GETPTRSIZETRAP vIndirect $2088, $0060, A7 ; Figment -FIG_DISPOSEPTR vIndirect $2088, $0064, A7 ; Figment -FIG_NEWPTRTRAP vIndirect $2088, $0068, A7 ; Figment -FIG_REALLOCHANDLETRAP vIndirect $2088, $006c, A7 ; Figment -FIG_RECOVERHANDLETRAP vIndirect $2088, $0070, A7 ; Figment -FIG_HANDLEZONETRAP vIndirect $2088, $0074, A7 ; Figment -FIG_SETHANDLESIZETRAP vIndirect $2088, $0078, A7 ; Figment -FIG___GETHANDLESIZE vIndirect $2088, $007c, A7 ; Figment -FIG_DSPOSEHANDLE vIndirect $2088, $0080, A7 ; Figment -FIG_NEWEMPTYHANDLETRAP vIndirect $2088, $0084, A7 ; Figment -FIG_NWHANDLE vIndirect $2088, $0088, A7 ; Figment -FIG_SETZONE vIndirect $2088, $008c, A7 ; Figment -FIG_GETZONE vIndirect $2088, $0090, A7 ; Figment -FIG_MOREMASTERS vIndirect $2088, $0094, A7 ; Figment -FIG_MAXAPPLZONE vIndirect $2088, $0098, A7 ; Figment -FIG_SETAPPLLIMIT vIndirect $2088, $009c, A7 ; Figment -FIG_INITZONETRAP vIndirect $2088, $00a0, A7 ; Figment -c_InitZone vIndirect $2088, $00a4, A7 ; Figment -c_SetApplLimit vIndirect $2088, $00a8, A7 ; Figment -c_MaxApplZone vIndirect $2088, $00ac, A7 ; Figment -c_MoreMasters vIndirect $2088, $00b0, A7 ; Figment -c_GetZone vIndirect $2088, $00b4, A7 ; Figment -c_SetZone vIndirect $2088, $00b8, A7 ; Figment -c_NewHandle vIndirect $2088, $00bc, A7 ; Figment -c_NewEmptyHandle vIndirect $2088, $00c0, A7 ; Figment -c_NewHandleHi vIndirect $2088, $00c4, A7 ; Figment -c_DisposeHandle vIndirect $2088, $00c8, A7 ; Figment -c_GetHandleSize vIndirect $2088, $00cc, A7 ; Figment -c_SetHandleSize vIndirect $2088, $00d0, A7 ; Figment -c_HandleZone vIndirect $2088, $00d4, A7 ; Figment -c_RecoverHandle vIndirect $2088, $00d8, A7 ; Figment -c_ReallocHandle vIndirect $2088, $00dc, A7 ; Figment -c_NewPtr vIndirect $2088, $00e0, A7 ; Figment -c_DisposePtr vIndirect $2088, $00e4, A7 ; Figment -c_GetPtrSize vIndirect $2088, $00e8, A7 ; Figment -c_SetPtrSize vIndirect $2088, $00ec, A7 ; Figment -c_PtrZone vIndirect $2088, $00f0, A7 ; Figment -c_FreeMem vIndirect $2088, $00f4, A7 ; Figment -c_MaxMem vIndirect $2088, $00f8, A7 ; Figment -c_CompactMem vIndirect $2088, $00fc, A7 ; Figment -c_ReserveMem vIndirect $2088, $0100, A7 ; Figment -c_PurgeMem vIndirect $2088, $0104, A7 ; Figment -c_EmptyHandle vIndirect $2088, $0108, A7 ; Figment -c_HLock vIndirect $2088, $010c, A7 ; Figment -c_HUnlock vIndirect $2088, $0110, A7 ; Figment -c_HPurge vIndirect $2088, $0114, A7 ; Figment -c_HNoPurge vIndirect $2088, $0118, A7 ; Figment -c_SetGrowZone vIndirect $2088, $011c, A7 ; Figment -c_MoveHHi vIndirect $2088, $0120, A7 ; Figment -c_MoveHLow vIndirect $2088, $0124, A7 ; Figment -c_MaxBlock vIndirect $2088, $0128, A7 ; Figment -c_PurgeSpace vIndirect $2088, $012c, A7 ; Figment -c_StackSpace vIndirect $2088, $00130, A7 ; Figment -c_HSetRBit vIndirect $2088, $0134, A7 ; Figment -c_HClrRBit vIndirect $2088, $0138, A7 ; Figment -c_HGetState vIndirect $2088, $013c, A7 ; Figment -c_HSetState vIndirect $2088, $0140, A7 ; Figment -c_GetNextBlockInHeap vIndirect $2088, $0144, A7 ; Figment -c_DisposeZone vIndirect $2088, $0148, A7 ; Figment -c_SetZoneCompatibilityFlags vIndirect $2088, $014c, A7 ; Figment -c_GetZoneCompatibilityFlags vIndirect $2088, $0150, A7 ; Figment -c_RegisterDisposeProc vIndirect $2088, $0154, A7 ; Figment -GetZoneFromNilMP vIndirect $2088, $0158, A7 ; Figment -WalkUpFindNewLowRemoveable vIndirect $2088, $015c, A7 ; Figment -FixedBlockInRange vIndirect $2088, $0160, A7 ; Figment -CompactHeap vIndirect $2088, $0164, A7 ; Figment -CalcMaxBlockSize vIndirect $2088, $0168, A7 ; Figment -ExtendHeapLimit vIndirect $2088, $016c, A7 ; Figment -ExtendApplLimit vIndirect $2088, $0170, A7 ; Figment -MakeSpaceLow vIndirect $2088, $0174, A7 ; Figment -MakeSpaceHigh vIndirect $2088, $0178, A7 ; Figment -ShrinkHeapLimit vIndirect $2088, $017c, A7 ; Figment -NewBlock vIndirect $2088, $0180, A7 ; Figment -NewBlockFast vIndirect $2088, $0184, A7 ; Figment -MarkBlockAsPrivate vIndirect $2088, $0188, A7 ; Figment -AllocateMoreMasters vIndirect $2088, $018c, A7 ; Figment -KillBlock vIndirect $2088, $0190, A7 ; Figment -SetBlockSize vIndirect $2088, $0194, A7 ; Figment -CalcFreeSpaceAndFindRegionTop vIndirect $2088, $0198, A7 ; Figment -MoveBlockHigh vIndirect $2088, $019c, A7 ; Figment -MoveBlockLow vIndirect $2088, $01a0, A7 ; Figment -CalcLargestPurgeRegion vIndirect $2088, $01a4, A7 ; Figment -PurgeBlock vIndirect $2088, $01a8, A7 ; Figment -DoEmpty vIndirect $2088, $01ac, A7 ; Figment -LocatePurgePtr vIndirect $2088, $01b0, A7 ; Figment -PurgeAndMakeSpace vIndirect $2088, $01b4, A7 ; Figment -PurgeAndCompactHeap vIndirect $2088, $01b8, A7 ; Figment -FindHeap vIndirect $2088, $01bc, A7 ; Figment -FindBlockInHeap vIndirect $2088, $01c0, A7 ; Figment -IsValidBlockInHeap vIndirect $2088, $01c4, A7 ; Figment -CreateNewHeap vIndirect $2088, $01c8, A7 ; Figment -MoveHeapHeaderHigh vIndirect $2088, $01cc, A7 ; Figment -RemoveHeap vIndirect $2088, $01d0, A7 ; Figment -GrowHeap vIndirect $2088, $01d4, A7 ; Figment -ShrinkHeap vIndirect $2088, $01d8, A7 ; Figment -CLEARBYTES vIndirect $2088, $01dc, A7 ; Figment -FillBytes vIndirect $2088, $01e0, A7 ; Figment -c_InitProcessMgrHeap vIndirect $2088, $01e4, A7 ; Figment -c_ShrinkSysHeap vIndirect $2088, $01e8, A7 ; Figment -c_LowerProcessMgrZoneBottom vIndirect $2088, $01ec, A7 ; Figment -c_ShrinkProcessMgrZone vIndirect $2088, $01f0, A7 ; Figment -c_ExtendSystemZone vIndirect $2088, $01f4, A7 ; Figment -c_ReclaimSpaceIfSysHeapLow vIndirect $2088, $01f8, A7 ; Figment -c_StraddleBlockSize vIndirect $2088, $01fc, A7 ; Figment -c_ProcessMgrMaxBlock vIndirect $2088, $0200, A7 ; Figment -c_GetProcessMgrLoFreeBytes vIndirect $2088, $0204, A7 ; Figment -c_GetSystemHiFreeBytes vIndirect $2088, $0208, A7 ; Figment -GetSystemHiPurgeBytes vIndirect $2088, $020c, A7 ; Figment -FIG_VIAZPOSTINIT vIndirect $2088, $0210, A7 ; Figment -FIG_VIAZINIT vIndirect $2088, $0214, A7 ; Figment -FIG_INITAPPLZONE vIndirect $2088, $0218, A7 ; Figment -FIG_SETAPPLBASE vIndirect $2088, $021c, A7 ; Figment -FIG___STRIPADDRESS vIndirect $2088, $0220, A7 ; Figment -MOVEBYTES020 vIndirect $2088, $0224, A7 ; Figment -MOVEBYTES040 vIndirect $2088, $0228, A7 ; Figment -INITQTMEMORY vIndirect $2088, $022c, A7 ; Figment -addTrashMemoryProc vIndirect $2088, $0230, A7 ; Figment -removeTrashMemoryProc vIndirect $2088, $0234, A7 ; Figment -c_RegisterHandleTrashNotification vIndirect $2088, $0238, A7 ; Figment -c_UnregisterHandleTrashNotification vIndirect $2088, $023c, A7 ; Figment -c_TrashZone vIndirect $2088, $0240, A7 ; Figment -c_TrashProcess vIndirect $2088, $0244, A7 ; Figment -c_TrashMemoryArea vIndirect $2088, $0248, A7 ; Figment -c_NewHandleSystemSafe vIndirect $2088, $024c, A7 ; Figment -c_NewPtrSystemSafe vIndirect $2088, $0250, A7 ; Figment -c_EnoughSystemHeapSlop vIndirect $2088, $0254, A7 ; Figment -OLD_INITMEMMGR vIndirect $2088, $0258, A7 ; Figment -OLD_INITMEMVECT vIndirect $2088, $025c, A7 ; Figment -OLD_AFTERBOOTSETAPPLBASE vIndirect $2088, $0260, A7 ; Figment +;============================== End Expansion Bus Manager Vectors -;============================== End Figment Memory Manager Vectors ; ; The following list of entrypoints are not currently vectorized. @@ -6092,8 +4828,8 @@ PC1TBL vNoVector ADBPROC vNoVector INITADB vNoVector GETRIDOFPOWERMGRINFREEZETIME vNoVector -INSTALLTIMEMGRPLUSSEII vNoVector -INSTALLTIMEMGRPORTABLEIICI vNoVector +;INSTALLTIMEMGRPLUSSEII vNoVector +;INSTALLTIMEMGRPORTABLEIICI vNoVector RMVTIMENEWFREEZETIME vNoVector PRIMETIMENEWFREEZETIME vNoVector TIMER2INTNEWFREEZETIME vNoVector @@ -6179,75 +4915,3 @@ PARTIALFONTZONEGROWZONEPROCEDURE vNoVector INITIALIZEPARTIALFONTS vNoVector SetCurrentFragment vNoVector Assert vNoVector -AssertCharacter vNoVector -AssertInteger vNoVector -AssertUnsignedInteger vNoVector -AssertPointer vNoVector -NewZonePtr vNoVector -GetZoneHandleSize vNoVector -ResizeZoneHandle vNoVector -MoveZoneHandleHigh vNoVector -INITIALIZEDISKCACHE vNoVector -DISKCACHERESOURCEMANAGERPURGEPROCEDURE vNoVector -DISKCACHESHUTDOWNPROCEDURE vNoVector -GetFontCacheFileSize vNoVector -SetFontCacheFileSize vNoVector -GetFontCacheFileStatus vNoVector -SetFontCacheFileStatus vNoVector -FontCacheFileExists vNoVector -LoadDiskCacheMap vNoVector -NEWGESTALT vNoVector -PPCOPEN vNoVector -PPCINFORM vNoVector -PPCACCEPT vNoVector -PPCREJECT vNoVector -PPCWRITE vNoVector -PPCREAD vNoVector -PPCEND vNoVector -PPCCLOSE vNoVector -IPCLISTPORTS vNoVector -NAN vNoVector -TESTHALT vNoVector -GETPRECISION vNoVector -SETPRECISION vNoVector -GETROUND vNoVector -SETROUND vNoVector -SETHALT vNoVector -SETEXCEPTION vNoVector -TESTEXCEPTION vNoVector -COMPOUND vNoVector -ANNUITY vNoVector -REMAINDER vNoVector -COPYSIGN vNoVector -LOGB vNoVector -RINT vNoVector -NEXTEXTENDED vNoVector -SCALB vNoVector -SETENVIRONMENT vNoVector -GETENVIRONMENT vNoVector -PROCEXIT vNoVector -PROCENTRY vNoVector -NUM2DEC vNoVector -DEC2NUM vNoVector -RELATION vNoVector -RANDOMX vNoVector -NEXTDOUBLE vNoVector -CLASSEXTENDED vNoVector -CLASSCOMP vNoVector -CLASSDOUBLE vNoVector -LOG2 vNoVector -TAN vNoVector -EXP1 vNoVector -EXP2 vNoVector -LN1 vNoVector -SIGNNUM vNoVector -GETHALTVECTOR vNoVector -SETHALTVECTOR vNoVector -X96TOX80 vNoVector -X80TOX96 vNoVector -TJUMP vNoVector -GetCTEGlobals vNoVector -SIZESOUNDBUFFER vNoVector -HMCMERGE vNoVector -HHEADMERGE vNoVector -DICTIONARYDISPATCH vNoVector diff --git a/Misc/GoNativeROMLib.o b/Misc/GoNativeROMLib.o index a32c1b6..47d96f4 100644 Binary files a/Misc/GoNativeROMLib.o and b/Misc/GoNativeROMLib.o differ diff --git a/OS/ADBMgr/ADBMgr.a b/OS/ADBMgr/ADBMgr.a index fd45e71..a4b109c 100644 --- a/OS/ADBMgr/ADBMgr.a +++ b/OS/ADBMgr/ADBMgr.a @@ -182,7 +182,7 @@ Debugging equ 0 ; disable debugging checks ;______________________________________________________________________ ; -; Routine: CountADBs +; Routine: CountADBs 2b380 ; Arguments: None ; Output: D0.W Number of ADB entries ; Function: This routine counts the number of entries in the ADB @@ -210,7 +210,7 @@ FirstCount ;______________________________________________________________________ ; -; Routine: GetIndADB +; Routine: GetIndADB 2b39a ; Arguments: DO.W Index from 1 to the value returned by CountADBs ; A0 Pointer to buffer in which DeviceType, OrigAddr, ; ServiceAddr, DataAddr are returned (10 bytes) @@ -245,7 +245,7 @@ LoadBuf MOVE.B FDBDevTy(A1), (A0)+ ; Return DeviceType Title 'KbdADB - ADB Manager - GetADBInfo / SetADBInfo / FindFDBInfo' ;______________________________________________________________________ ; -; Routine: GetADBInfo +; Routine: GetADBInfo 2b3c6 ; Arguments: DO.B ADBAddr ; A0 Pointer to buffer in which DeviceType, OrigAddr, ; ServiceAddr, DataAddr are returned (10 bytes) @@ -261,7 +261,7 @@ GetADBInfoTrap ;______________________________________________________________________ ; -; Routine: SetADBInfo +; Routine: SetADBInfo 2b3cc ; Arguments: DO.B ADBAddr ; A0 Pointer to buffer containing ServiceAddr and ; DataAddr (8 bytes) @@ -282,7 +282,7 @@ DoneSet RTS ;______________________________________________________________________ ; -; Routine: FindFDBInfo +; Routine: FindFDBInfo 2b3da ; Arguments: DO.B FDBAddr ; Output: D0.L 0 if found, -1 if not ; A1 Real address of FDB record if found. @@ -317,7 +317,7 @@ DoneFind Title 'KbdADB - ADB Manager - ADBOp' ;_______________________________________________________________________ ; -; Routine: ADBOp +; Routine: ADBOp 2b3fc ; Inputs: A0.L - pointer to ADBOpBlock paramater block ; D0.B - ADB command/address byte to send ; @@ -379,7 +379,7 @@ ADBOpTrap ; a0-a1/d1-d2 saved by OsTrap dispatch Title 'KbdADB - ADB Manager - RunADBRequest' ;_______________________________________________________________________ ; -; Routine: RunADBRequest +; Routine: RunADBRequest 2b44c ; Inputs: A3 - pointer to ADBBase ; ; Outputs: D2 - length of transmit buffer data @@ -424,7 +424,7 @@ RunADBRequest Title 'KbdADB - ADB Manager - ExplicitRequestDone' ;_______________________________________________________________________ ; -; Routine: ExplicitRequestDone +; Routine: ExplicitRequestDone 2b47e ; Inputs: D2 - length of receive buffer data ; D3 - command byte / SRQ flag (bit 31) ; A2 - pointer to buffer containing receive data @@ -482,7 +482,7 @@ ExplicitRequestDone Title 'KbdADB - ADB Manager - ImplicitRequestDone' ;_______________________________________________________________________ ; -; Routine: ImplicitRequestDone +; Routine: ImplicitRequestDone 2b4b4 ; Inputs: D2 - length of receive buffer data ; D3 - command byte / SRQ flag (bit 31) ; A2 - pointer to buffer containing receive data @@ -524,7 +524,7 @@ ImplicitRequestDone Title 'KbdADB - ADB Manager - RequestDone' ;_______________________________________________________________________ ; -; Routine: RequestDone +; Routine: RequestDone 2b4d4 ; Inputs: D2 - length of receive buffer data ; D3 - command byte / SRQ flag (bit 31) ; A0 - pointer to buffer to pass to completion routine @@ -559,37 +559,74 @@ RequestDone move.l a0,-(sp) ; copy buffer address to A0 save area on stack TestFor SupportsIdle BEQ.S @notsupported - _IdleUpdate ; this is activity, stay at full speed + + MoveA.L (PmgrBase), A1 + CmpI.L #sleepConst, PmgrRec.SleepSaveFlag(A1) + BEQ.B @definitelyNot + BTst.B #$2, $129(A1) + BEQ.B @nearEnd +@definitelyNot + + Move.L (A7), D3 + Move.B D3, D0 + LsR.B #$4, D0 + Bsr FindFDBInfo + Move.B $1(A1), D0 + MoveA.L $4(A7), A1 + Move.L (A1), D3 + CmpI.B #$2, D0 + BNE.B @noTesting + BTst.L #$17, D3 + BNE.B @idleDone + Bra.B @nearEnd +@noTesting + MoveA.L (PmgrBase), A1 + CmpI.L #sleepConst, PmgrRec.SleepSaveFlag(A1) + BEQ.B @idleDone + CmpI.B #$3, D0 + BNE.B @idleDone +@nearEnd + Move.L D0, -(A7) + Move.L #$10001, D0 + _PowerDispatch + Move.L (A7)+, D0 +@idleDone @notsupported movem.l (sp)+,d0/a0/a1/a2 ; setup cmd, buffer, handler, data - ; (13).start - TestFor SupportsIdle - beq.s @continue - move.l d0,-(sp) ; save d0 temporarily on the stack ag - move.l #((UsrActivity<<16)|\ ; set for user activity - (IdleUpdateDisp<<0)),d0 ; idle update selector - _PowerDispatch ; call power manager - move.l (sp)+,d0 ; restore d0 ag -@continue move.l a1,d1 ; test to see if handler address is valid beq.s @noHandler ; if not, don't call it BTST #fDBInit,FDBFlag(A3) ; is ADB initialization in progress? BNE.S @JustDoIt ; -> yes, calling the handler now is allowed + MOVE.L D0,D2 + AND #$F,D2 + CMP.B #$C,D2 + BNE @justDoIt + ; jump thru the ProductInfo table to check if a keyswitch is in the secure position

MOVEA.L UnivInfoPtr,A1 ; point to the ProductInfo table

ADDA.L ProductInfo.ADBDebugUtilPtr(A1),A1 ; and get the address of its ADB table

MOVE.L 4*adbKeySwSecure(A1),D2 ; get the offset to the keyswitch code

- BEQ.S @JustDoIt ; -> no keyswitch check, so just call the handler

+ BEQ.S @MaybeDoIt ; -> no keyswitch check, so just call the handler

MOVEM.L D0/D1/A0/A2,-(SP) ;

ADDA.L D2,A1 ; calculate the routine's address

JSR (A1) ; and call it

MOVEM.L (SP)+,D0/D1/A0/A2 ;

BEQ.S @noHandler ; -> the keyswitch is secure, so don't call the handler +@MaybeDoIt BTST.B #3,$240A + BEQ.S @JustDoIt + + MOVE.L PmgrBase,A1 + CMP.L #sleepConst,PmgrRec.SleepSaveFlag(A1) + BEQ.S @noHandler + + BTST.B #2,PmgrRec.PmgrFlags2(A1) + BNE.B @noHandler + @JustDoIt MOVEA.L D1,A1 ; get the handler's address

jsr (a1) ; call the handler @@ -602,7 +639,7 @@ RequestDone move.l a0,-(sp) ; copy buffer address to A0 save area on stack Title 'KbdADB - ADB Manager - Initialization' ;______________________________________________________________________ ; -; ADBReInit - ReInitialize the Front Desk Bus +; ADBReInit 2b5aa - ReInitialize the Front Desk Bus ; ;______________________________________________________________________ @@ -638,7 +675,7 @@ iLocalData EQU iDeviceTy ;______________________________________________________________________ ; -; ADBProc - this routine lives in the JADBProc vector and is called +; ADBProc 2b5d0 - this routine lives in the JADBProc vector and is called ; by ADBReInit before and after initialization ; ;______________________________________________________________________ @@ -695,6 +732,7 @@ ADBProc ;______________________________________________________________________ PostInit ; rb +; 2b610 WITH ExpandMemRec,KybdDriverData ; rb _CountADBs ; Get the number of ADB devices @@ -728,14 +766,14 @@ PostInit ; rb ENDWITH ; rb ;______________________________________________________________________ ; -; InitADBDrvr - this routine bring in all appropriate 'ADBS' resources and +; InitADBDrvr 2b64c - this routine bring in all appropriate 'ADBS' resources and ; execute the initialization routines. ; ;______________________________________________________________________ InitADBDrvr _CountADBs ; get the number of valid ADB entries Move D0,D3 ; save it in D3 - BEQ.S DoneSrv ; If none, nothing to do + BEQ DoneSrv ; If none, nothing to do MoveQ #1,D4 ; start at first entry Link A6,#iLocalData ; reserve stack frame FSrvLoop @@ -759,9 +797,7 @@ FSrvLoop _DetachResource ; detach it Move.L D1,A0 ; put handle in A0 - Move.L (A0),D0 ; dereference handle - _StripAddress ; make it a 24-bit address - Move.L D0,A0 ; put it in A0 + Move.L (A0),A0 ; dereference handle Move.B iADBAddr(A6),D0 ; put ADB Address in D0 Move.B iDeviceTy(A6),D1 ; put device type in D1 JSR (A0) ; execute the service routine @@ -777,7 +813,7 @@ DoneSrv ;_______________________________________________________________________ ; -; InitADB - Initialize state variables +; InitADB 2b69c - Initialize state variables ; ;_______________________________________________________________________ @@ -796,6 +832,50 @@ InitADB MOVE.L #FDBDSize,D0 ; get local data area length LEA FDBTask,A0 ; setup the FDB VBL task MOVE.L A0,JKybdTask ; lomem vector + BTst.B #$2, ($2408) + BEQ.B @dontHitExpandMem + import IOPR_ADB + Lea.L IOPR_ADB, A0 + Move.L A0, ([ExpandMem],$294) +@dontHitExpandMem + + Move.L UnivROMFlags, D0 + + AndI.L #$E, D0 + BEQ.B @escape + + CmpI.L #$A, D0 + BEQ.B @escape + + CmpI.L #$C, D0 + BEQ.B @second + + CmpI.L #$8, D0 + BEQ.B @fourth + + CmpI.L #$2, D0 + BNE.B @third + +@first Lea.L ($FFFDB592).L, A0 + Lea.L @first(A0.L), A0 + Bra.B @done + +@second Lea.L ($FFFDB5A2).L, A0 + Lea.L @second(A0.L), A0 + Bra.B @done + +@third Lea.L ($FFFDB5CE).L, A0 + Lea.L @third(A0.L), A0 + Bra.B @done + +@fourth Lea.L ($FFFDB5DE).L, A0 + Lea.L @fourth(A0.L), A0 + +@done MoveA.L (UnivInfoPtr), A1 + SubA.L A1, A0 + Move.L A0, $48(A1) +@escape + ; jump thru the ProductInfo table to call the hardware-dependent initialization code MOVEA.L UnivInfoPtr,A0 ; point to the ProductInfo table

@@ -838,7 +918,7 @@ ReInit ori.w #HiIntMask,sr ; mask out interrupts ;_______________________________________________________________________ ; -; InitDevT - Initialize the Device Table +; InitDevT 2b7a0 - Initialize the Device Table ; ; NOTE: everything after BusReset below is part of an ADB completion ; routine, and thus is run at interrupt level 1. No calls @@ -853,17 +933,19 @@ InitDevT bsr BusReset ; reset all devices on the bus @PollNext move.b d0,InitAddr(a3) ; save device address bsr TalkR3 ; issue a Talk R3 command (asynchronously) move.b InitAddr(a3),d0 ; restore poll address - tst.b (a0)+ ; test reply length, see if device returned data + tst.b (a0) ; test reply length, see if device returned data beq.s @NoDevice ; no, nothing to install ; there is a response from the device in the address, so update the ; device table according to the device +@whoaGoBack moveq.l #0,d1 ; zero extend for indexing move.b DevTOffset(a3),d1 ; get offset to devicetable - move.b 1(a0),FDBDevTy(a3,d1.w) ; copy device handler ID into table + move.b 2(a0),FDBDevTy(a3,d1.w) ; copy device handler ID into table move.b d0,FDBOAddr(a3,d1.w); save device address move.b d0,FDBAddr(a3,d1.w) ; save device address + move.b d0,FDBOAddr(a3,d1.w); save device address cmpi.b #KbdAddr,d0 ; is it a keyboard type device? bne.s @notKbd ; no, branch @@ -878,10 +960,29 @@ InitDevT bsr BusReset ; reset all devices on the bus move.w HasDev(a3),d2 ; get value in HasDev bset.l d0,d2 ; remember which address has device move.w d2,HasDev(A3) ; save it + Bra @skipNewNoDeviceCode @NoDevice + + BTst.B #$2, ($2408) + BEQ.B @skipNewNoDeviceCode + + Tst.L ([$2B6],$29C) + BEQ.B @skipNewNoDeviceCode + + MoveM.L D0/A0-A3, -(A7) + MoveA.L ([$2B6],$29C), A1 + MoveA.L A0, A2 + AndI #$FF, D0 + OrI #$200, D0 + Jsr (A1) + MoveM.L (A7)+, D0/A0-A3 + Tst.B (A0) + BNE.B @whoaGoBack +@skipNewNoDeviceCode + addq.b #1,d0 ; advance device address cmpi.b #NumFDBAdr,d0 ; has it polled all addresses yet? - bne.s @PollNext ; no, go to poll next device + bne @PollNext ; no, go to poll next device ; ChgAddr - check the device address to identify multiple devices on ; the same address @@ -922,7 +1023,7 @@ ChgNext ; to the old address by issuing a Listen R3. Move.B InitAddr(A3),D0 ; get address - BSR.s TalkR3 ; issue a Talk R3 command <1.6> + BSR TalkR3 ; issue a Talk R3 command <1.6> ; MovBack - A Talk R3 has just been issued, a timeout in S1 indicates no ; more device in original address, we want to move the device back to @@ -931,21 +1032,40 @@ ChgNext tst.b (a0) ; did the device return data beq.S @1 ; no, branch ; no timeout indication, - BSR.S CopyEntry ; copy entry into device table +@whoaGoBack + BSR CopyEntry ; copy entry into device table Move.B FDBByte1(A3),FDBDevTy(A3,D1.W) ; get new handle ID into table BRA.S ChgNext ; go to change next device ; there is timeout indication @1 + BTst.B #$2, ($2408) + BEQ.B @skipNewTimeoutCode + + Move.B $16F(A3), D0 + Tst.L ([$2B6],$29C) + BEQ.B @skipNewTimeoutCode + + MoveM.L D0/A1-A2, -(A7) + MoveA.L ([$2B6],$29C), A1 + MoveA.L A0, A2 + AndI #$FF, D0 + OrI #$300, D0 + Jsr (A1) + MoveM.L (A7)+, D0/A1-A2 + Tst.B (A0) + BNE.B @whoaGoBack +@skipNewTimeoutCode + Move.B InitAddr(A3),D1 ; get address to change back to Move.B NewAddr(A3),D0 ; get address to talk to - bsr.s ListenR3 ; send a listen R3 command <1.6> + bsr ListenR3 ; send a listen R3 command <1.6> ; CKNewAdr - check the new address by issuing a Talk R3, to see if ; there is still any device left. If yes, add entry into device ; table, but if not, just go to change next device address Move.B NewAddr(A3),D0 ; get address - BSR.S TalkR3 ; issue a talk R3 <1.6> + BSR TalkR3 ; issue a talk R3 <1.6> ; AddEntry - a Talk R3 command has just been issed to the new address, ; if there is no timeout in S1, one or more device is still in that @@ -964,7 +1084,7 @@ ExitEntry ;_______________________________________________________________________ ; -; CopyEntry - copy the device entry from the original address to the +; CopyEntry 2b8ea - copy the device entry from the original address to the ; new address, a Talk R3 had just been issued ; ; Called by: MoveBack and AddEntry @@ -1003,7 +1123,7 @@ CopyEntry ;_______________________________________________________________________ ; -; BusReset - issue a Reset command +; BusReset 2b930 - issue a Reset command ; ; On entry, (SP) has completion routine address <1.6> ; @@ -1017,7 +1137,7 @@ BusReset moveq.l #0,d0 ; address zero ;_______________________________________________________________________ ; -; Talk R3 - issue a Talk R3 command +; Talk R3 2b938 - issue a Talk R3 command ; ; On entry, D0 has device address ; (SP) has completion routine address <1.6> @@ -1031,7 +1151,7 @@ TalkR3 moveq.l #talkCmd+3,d1 ; talk command, register 3 ;_______________________________________________________________________ ; -; ListenR3 - issue a listen R3 command +; ListenR3 2b93e - issue a listen R3 command ; ; On entry, D0 has device address to send the command ; D1 has new device address to change to @@ -1058,7 +1178,7 @@ MakeAsyncRequest ;_______________________________________________________________________ ; -; GNextAddr - get next address to change +; GNextAddr 2b964 - get next address to change ; ;_______________________________________________________________________ @@ -1081,7 +1201,7 @@ GNextAddr MoveQ #0,D0 ;_______________________________________________________________________ ; -; GEmptyAddr - get empty address space +; GEmptyAddr 2b986 - get empty address space ; ; on return: ; D0 = empty address or @@ -1100,7 +1220,7 @@ GEmptyAddr MoveQ #0,D1 ;_______________________________________________________________________ ; -; FDBTask - FDB VBL Task +; FDBTask 2b998 - FDB VBL Task ; ;_______________________________________________________________________ @@ -1119,7 +1239,7 @@ KbdDRTS RTS ;______________________________________________________________________ ; -; DefaultDev - check mouse and keyboard in the device table, if they +; DefaultDev 2b9ac - check mouse and keyboard in the device table, if they ; are not there, set them up as default device anyway. ; ;______________________________________________________________________ @@ -1143,7 +1263,7 @@ ChkMouse moveq #1,d0 ; post processing

;______________________________________________________________________ ; -; Routine: flushkbds +; Routine: flushkbds 2b9de ; Arguments: none ; Output: none ; Function: this routine finds all kbd devices, and sends a flush command to them @@ -1167,6 +1287,7 @@ waitForKeys equ (4+4) ; add 100% margin @type cmp.b #kbdAddr,origADBAddr(a0); is this a keyboard bne.s @next ; not a keyboard, next device bsr.s sendFlush ; send a flush command to kbd + bsr.s newAdbFunc bra.s @next ; next device @done movea.l #waitForKeys,a0 ; wait for keys @@ -1176,9 +1297,34 @@ waitForKeys equ (4+4) ; add 100% margin movem.l (sp)+,@saved ; restore registers rts + ;______________________________________________________________________ ; -; Routine: sendFlush +; Routine: newAdbFunc 2ba12 +; Arguments: a0 +; Output: none +; Function: +; Note: +;______________________________________________________________________ + +newAdbFunc +@saved reg d0/d1/a0 + + movem.l @saved,-(sp) + + move.l 6(a0),a0 + addq.l #4,a0 + clr.l (a0)+ + clr.l (a0) + bsr RSetKmap + + movem.l (sp)+,@saved ; restore registers + rts + + +;______________________________________________________________________ +; +; Routine: sendFlush 2ba2a ; Arguments: d0.b adb id ; Output: none ; Function: this routine sends a "flush" command to the adb device at d0.b @@ -1225,7 +1371,7 @@ CompleteFlush Title 'KbdADB - ADB KeyBoard Driver' ;______________________________________________________________________ ; -; Routine: KbdDrvr +; Routine: KbdDrvr 2ba72 ; Arguments: D0.B ADB Command ; A0 ADB Buffer address ; A1 ADB Completion Routine Address (= KbdServ) @@ -1288,7 +1434,7 @@ KbdDrvr ;______________________________________________________________________ ; -; Routine: KeyIn +; Routine: KeyIn 2ba9e ; Arguments: D0.B Raw Keycode ; D3.L Device Type, Orig Addr, ADB Addr, Unused ; A2 Private data area @@ -1373,7 +1519,7 @@ NextWord ;______________________________________________________________________ ; -; Routine: PostIt +; Routine: PostIt 2bb2c ; Arguments: D0.W ASCII Code ; D3.W ADB Address in high byte and raw keycode in low byte ; Output: None @@ -1415,7 +1561,7 @@ PostKeyUp ;______________________________________________________________________ ; -; FoundEx +; FoundEx 2bb64 ; An exception exists for this particular keystroke. Process it appropriately. ;______________________________________________________________________ FoundEx @@ -1491,7 +1637,7 @@ FoundEx ;______________________________________________________________________ ; -; Routine: KbdListen +; Routine: KbdListen 2bbee ; Arguments: D0.B ADB Command ; D1.L DeviceType, OrigAddr, ADBAddr, Unused (byte order) ; A0 ADB Buffer Address @@ -1553,7 +1699,7 @@ KbdListen ;______________________________________________________________________ ; -; Routine: KbdBufFree +; Routine: KbdBufFree 2bc36 ; Arguments: D0.B ADB Command ; D1.L DeviceType, OrigAddr, ADBAddr, Unused (byte order) ; A0 ADB Buffer Address @@ -1573,7 +1719,7 @@ KbdBufFree ;______________________________________________________________________ ; -; KbdInstall - allocate memory for keyboard information and put in ADB record, +; KbdInstall 2bc3c - allocate memory for keyboard information and put in ADB record, ; loading resources as necessary. ; ;______________________________________________________________________ @@ -1606,6 +1752,13 @@ FirstInstall MOVE.L D0, A0 MOVE.L (A0), KCHRPtr(A2) ; Dereference and put away + MOVE.L A1, -(SP) + MOVE.L ExpandMem, A1 + TST.L ExpandMemRec.emKeyCache(A1) + BNE.S @no + MOVE.L (A0), ExpandMemRec.emKeyCache(A1) +@no MOVE.L (SP)+, A1 + SUBQ.L #4, SP ; Make room for result MOVE.L #'KMAP', -(SP) ; ResType = KCHR CLR.W -(SP) ; theID = 0 @@ -1718,6 +1871,7 @@ kchrTableNoLink equ kchrTable-return ; kchrTable offset before link r endr KeyTrans +; 2bcb8 ;------------------------------------------------------------------------------ with ktFrame,SMgrRecord ; if SMgr not initialized or no itlk, skip @@ -1909,7 +2063,7 @@ KeyTrans ; Macintosh keyboard mapping hook, which relies on the new KeyTrans trap. ; ----------------------------------------------------------------------------- -KeyHook PROC +KeyHook PROC EXPORT with ExpandMemRec bra.s SkipHeader ; skip the header. diff --git a/OS/Beep/Beep.make b/OS/Beep/Beep.make new file mode 100644 index 0000000..e69de29 diff --git a/OS/Clock.a b/OS/Clock.a index 17b208f..0f5d2ba 100644 --- a/OS/Clock.a +++ b/OS/Clock.a @@ -129,7 +129,7 @@ Clock PROC EXPORT IF NOT BlackBirdDebug THEN ;_______________________________________________________________________ <1.3> ; -; Routine: OneSecInt +; Routine: OneSecInt 8180 ; ; Arguments: A1 (input) -- Address of VIA1 ; @@ -151,7 +151,7 @@ Clock PROC EXPORT ;_______________________________________________________________________ OneSecInt MOVE.B #1< - ADDQ.L #1,Time ; count the second + NOP BCLR #5,AlarmState ; flag GNEFilter to flash if enabled TST.B SPVolCtl ; bit 7 is alarm enable @@ -210,7 +210,7 @@ OneSecInt MOVEA.l A1, A0 ; ;________________________________________________________________________________________ ; -; Routine: PramIO +; Routine: PramIO 81a8 ; ; Inputs: A0 - pointer to table of base addresses ; A1 - pointer to ProductInfo record for this machine @@ -239,7 +239,7 @@ PramIO MOVEM.L D0-D2/A0-A2,-(SP) ;

;________________________________________________________________________________________ ; -; Routine: ReadXPRAM, WriteXPRAM +; Routine: ReadXPRAM 81c2, WriteXPRAM 81cc ; ; Inputs: A0 - pointer to caller's buffer ; D0 - [number of bytes to transfer][starting PRAM address] @@ -277,7 +277,7 @@ rwXCommon BTST.B #hwCbClock-8,HWCfgFlags ; do we have a new clock chip (256 PRAM ;________________________________________________________________________________________

; -; Routine: ValidatePRAM +; Routine: ValidatePRAM 81f8 ; ; Inputs: A6 - return address ; A0 - pointer to table of base addresses @@ -322,14 +322,16 @@ ValidatePRAM (8<<0),D3 ; starting at PRAM address 8

BSR PramIO ; write out the last 4 bytes of original PRAM

+ LEA @other,A3 + MOVE.L #(1<<31)|\ ; write + (1<<16)|\ ; 1 byte + (16<<0),D3 ; starting at PRAM address 16 + BSR PramIO + @CheckXPRAM LEA @XPRAMSig,A3 ;

MOVE.L 12(SP),D3 ; are the extended PRAM signature bytes valid?

CMP.L (A3),D3 ;

BEQ.S @Done ; -> yes, we're done

- MOVE.L #(1<<31)|\ ; write

- (4<<16)|\ ; 4 bytes

- (12<<0),D3 ; starting at PRAM address 12

- BSR PramIO ; write out the correct extended PRAM signature bytes

MOVEA.L SP,A3 ; point to our stack buffer

MOVEQ #(256-32)/4-1,D3 ; and zero each byte

@@ -337,8 +339,11 @@ ValidatePRAM DBRA D3,@ClearBuf ;

BIGLEA PRAMInitTbl,A2 ; point to the table of default extended PRAM values

+ BIGLEA *+$373c,A3 + SUB.L A2,A3 + MOVE.L A3,D3 + SUB.L #1,D3 LEA $76-32(SP),A3 ; and where they'll go in the buffer

- MOVEQ #$89-$76,D3 ; copy them into the buffer

@CopyXDefs MOVE.B (A2)+,(A3)+ ;

DBRA D3,@CopyXDefs ;

@@ -348,11 +353,19 @@ ValidatePRAM (32<<0),D3 ; starting at PRAM address 32

BSR PramIO ;

+ LEA @XPRAMSig,A3 + MOVE.L #(1<<31)|\ ; write + (4<<16)|\ ; 4 bytes + (12<<0),D3 ; starting at PRAM address 12 + BSR PramIO + @Done LEA 256(SP),SP ; clean up the stack

MOVEM.L (SP)+,D0-D3/A0-A3 ; restore regs from StartINIT <8.6> RTS ;

+@other DC.W $A800 + @XPRAMSig DC.L 'NuMc' ; extended PRAM validity bytes (slot-based machines)

diff --git a/OS/CrsrDev.a b/OS/CrsrDev.a index db769c9..e390b54 100644 --- a/OS/CrsrDev.a +++ b/OS/CrsrDev.a @@ -100,7 +100,7 @@ _FixDiv OPWORD $A84D CrsrDev PROC EXPORT InitCrsrDev,CrsrDevDispatch - IMPORT CrsrVBLTask + IMPORT CrsrVBLTask,vDrawCursor,vEraseCursor WITH CrsrDevGlobals, CrsrDevRec, CrsrDevSegment, CrsrDataRec WITH ADBDeviceEntry, ADBVars, ExpandMemRec @@ -108,7 +108,7 @@ CrsrDev PROC _______________________________________________________________________ ; -; Routine: CrsrDevDispatch (trap # $AADB) +; Routine: CrsrDevDispatch 82b0 (trap # $AADB) ; ; Inputs: d0.w - selector ; 4(sp) - last parameter @@ -177,7 +177,7 @@ paramBase equ * ; ptr to base of parameters ;==================================================================== ; -; Routine: CrsrDevMoveTrap +; Routine: CrsrDevMoveTrap 82ec ; ; Inputs: 8(a6).l - delta Y ; 12(a6).l - delta X @@ -207,7 +207,7 @@ CrsrDevMoveTrap ;==================================================================== ; -; Routine: CrsrDevMoveToTrap +; Routine: CrsrDevMoveToTrap 8306 ; ; Inputs: 8(a6).l - V ; 12(a6).l - H @@ -248,7 +248,7 @@ CrsrDevMoveToTrap ;==================================================================== ; -; Routine: CrsrDevFlushTrap +; Routine: CrsrDevFlushTrap 8334 ; ; Inputs: 8(a6).l - pointer to CrsrDevRec for this device ; @@ -282,7 +282,7 @@ CrsrDevFlushTrap ;==================================================================== ; -; Routine: CrsrDevButtonsTrap +; Routine: CrsrDevButtonsTrap 8360 ; ; Inputs: 8(a6).w - new button states (1 = down, 0 = up) ; 10(a6).l - pointer to CrsrDevRec for this device @@ -312,7 +312,7 @@ CrsrDevButtonsTrap ;==================================================================== ; -; Routine: CrsrDevButtonDownTrap +; Routine: CrsrDevButtonDownTrap 8376 ; ; Inputs: 8(a6).l - pointer to CrsrDevRec for this device ; @@ -335,7 +335,7 @@ CrsrDevButtonDownTrap ;==================================================================== ; -; Routine: CrsrDevButtonUpTrap +; Routine: CrsrDevButtonUpTrap 8388 ; ; Inputs: 8(a6).l - pointer to CrsrDevRec for this device ; @@ -358,7 +358,7 @@ CrsrDevButtonUpTrap ;==================================================================== ; -; Routine: CrsrDevButtonOpTrap +; Routine: CrsrDevButtonOpTrap 839a ; ; Inputs: 8(a6).l - Operation specific data ; 12(a6).w - Operation code @@ -388,7 +388,7 @@ CrsrDevButtonOpTrap ;==================================================================== ; -; Routine: CrsrDevSetButtonsTrap +; Routine: CrsrDevSetButtonsTrap 83ba ; ; Inputs: 8(a6).w - # buttons for this device ; 10(a6).l - pointer to CrsrDevRec for this device @@ -413,7 +413,7 @@ CrsrDevSetButtonsTrap ;==================================================================== ; -; Routine: CrsrDevSetAccelTrap +; Routine: CrsrDevSetAccelTrap 83ce ; ; Inputs: 8(a6).l - acceleration (Fixed) ; 12(a6).l - pointer to CrsrDevRec for this device @@ -440,7 +440,7 @@ CrsrDevSetAccelTrap ;==================================================================== ; -; Routine: CrsrDevDoubleTimeTrap +; Routine: CrsrDevDoubleTimeTrap 83e4 ; ; Inputs: 8(a6).l - duration (ticks) ; 12(a6).l - pointer to CrsrDevRec for this device @@ -468,7 +468,7 @@ CrsrDevDoubleTimeTrap ;==================================================================== ; -; Routine: CrsrDevSetUnitsPerInchTrap +; Routine: CrsrDevSetUnitsPerInchTrap 83f8 ; ; Inputs: 8(a6).l - resolution (fixed) ; 12(a6).l - pointer to CrsrDevRec for this device @@ -500,7 +500,7 @@ CrsrDevSetUnitsPerInchTrap ;==================================================================== ; -; Routine: CrsrDevNextDeviceTrap +; Routine: CrsrDevNextDeviceTrap 8414 ; ; Inputs: 8(a6).l - VAR ptr to CrsrDevRec ; @@ -539,7 +539,7 @@ CrsrDevNextDeviceTrap ;==================================================================== ; -; Routine: CrsrDevNewDeviceTrap +; Routine: CrsrDevNewDeviceTrap 843c ; ; Inputs: 8(a6).l - VAR pointer to CrsrDevRec ; @@ -566,7 +566,7 @@ CrsrDevNewDeviceTrap ;==================================================================== ; -; Routine: CrsrDevDisposeDevTrap +; Routine: CrsrDevDisposeDevTrap 8450 ; ; Inputs: 8(a6).l - pointer to CrsrDevRec for this device ; @@ -594,7 +594,7 @@ CrsrDevDisposeDevTrap ;_______________________________________________________________________ ; -; Routine: CrsrDevHandleADB +; Routine: CrsrDevHandleADB 8462 ; ; Inputs: a0 - pointer to mouse data ; a2 - pointer to CrsrDevRec for this device @@ -741,7 +741,7 @@ CrsrDevHandleADB ;_______________________________________________________________________ ; -; Routine: CrsrDevMove +; Routine: CrsrDevMove 854e ; ; Inputs: d0.l - delta X ; d1.l - delta Y @@ -843,7 +843,7 @@ CrsrDevMove ;_______________________________________________________________________ ; -; Routine: CrsrDevButtons +; Routine: CrsrDevButtons 85ee ; ; Inputs: d0.b - new button states (1 = down, 0 = up) ; a2 - pointer to CrsrDevRec for this device @@ -934,20 +934,20 @@ doDouble ;--------------------------------------------------------- doClickLock - tst.b buttonData(a2,d3.w) ; is this the 1st time? + tst.b buttonData(a2,d2.w) ; is this the 1st time? bne.s @secondHit ; no, skip btst.b d3,buttons(a2) ; are we down? beq.s @firstUp ; no, skip bsr.s CrsrDevButtonDown ; yes, generate button down event bra.s @done -@firstUp st.b buttonData(a2,d3.w) ; first up, mark it +@firstUp st.b buttonData(a2,d2.w) ; first up, mark it bra.s @done @secondHit btst.b d3,buttons(a2) ; are we up (2nd time)? bne.s @done ; no, do nothing... bsr.s CrsrDevButtonUp ; yes, post up event - clr.b buttonData(a2,d3.w) ; mark that we're really up + clr.b buttonData(a2,d2.w) ; mark that we're really up @done rts @@ -963,13 +963,13 @@ doAppleScript ;--------------------------------------------------------- doCustom - pea buttonData(a2) ; push our custom routine address + move.l buttonData(a2,d2.w),-(sp) ; push our custom routine address rts ; and call it. ;_______________________________________________________________________ ; -; Routine: CrsrDevButtonDown +; Routine: CrsrDevButtonDown 86a4 ; ; Inputs: a2 - pointer to CrsrDevRec for this device ; @@ -1009,7 +1009,7 @@ CrsrDevButtonDown ;_______________________________________________________________________ ; -; Routine: CrsrDevButtonUp +; Routine: CrsrDevButtonUp 86e4 ; ; Inputs: a2 - pointer to CrsrDevRec for this device ; @@ -1051,7 +1051,7 @@ CrsrDevButtonUp ;_______________________________________________________________________ ; -; Routine: CrsrDevSetAccel +; Routine: CrsrDevSetAccel 8720 ; ; Inputs: a2 - pointer to CrsrDevRec for device we want to set ; d0 - acceleration to set (0-1, fixed point) @@ -1102,7 +1102,21 @@ CrsrDevSetAccel ; first find the two tables which enclose the desired acceleration ;---------------------------------------------- -@foundIt move.l acceleration(a2),d3 ; get new acceleration in d3 +@foundIt Move.B $85(A2), D3 + BEQ.B @endofthing + Clr -(SP) + Move.L #'accl', -(A7) + Move #$FFFF, (ROMMapInsert) + _CountResources + Move (SP)+, D3 + Move.L #'USB*', D4 + Bsr FindResource + BEQ.B @endofthing + MoveQ.L #$0, D4 + Bsr FindResource +@endofthing + + move.l acceleration(a2),d3 ; get new acceleration in d3 move.w (a0)+,d2 ; get # of acceleration tables in resource move.l a0,a1 ; keep ptr to 'low' accel table in a1 @@ -1316,7 +1330,7 @@ CrsrDevSetAccel ;------------------------------------------------ ; -; Routine: FindResource +; Routine: FindResource 8906 ; ; Inputs: d3 - # of 'accl' resources to search ; d4 - 'accl' resource tag we're looking for @@ -1353,7 +1367,7 @@ FindResource ;------------------------------------------------ ; -; Routine: Interpolate +; Routine: Interpolate 892e ; ; Inputs: 18(sp) - x1 ; 14(sp) - y1 @@ -1437,7 +1451,7 @@ Interpolate ;_______________________________________________________________________ ; -; Routine: CrsrDevHandleVBL +; Routine: CrsrDevHandleVBL 8992 ; ; Inputs: - ; @@ -1456,6 +1470,9 @@ CrsrDevHandleVBL movea.l ExpandMem,a3 ; get ptr to expandmem rec movea.l emCursorGlobals(a3),a3 ; get cursory global ptr + tst.l a3 + beq @exit + move.l firstCrsrDev(a3),d0 ; get ptr to 1st CrsrDevRec beq @exit ; if not even 1 device, just exit move.l d0,a2 ; ptr in a2 @@ -1664,7 +1681,7 @@ CrsrDevHandleVBL ;_______________________________________________________________________ ; -; Routine: DrawCursor +; Routine: DrawCursor 8b38 ; ; Inputs: a3 - ptr to CrsrDevGlobals ; @@ -1691,6 +1708,7 @@ DrawCursor movea.l firstCrsrData(a3),a4 ; get ptr to main CrsrDataRec bne.s @exit ; yesÉ exit lea CrsrPin,a0 ; it's ok to update cursor, get bounding rect + move.l d0,-(sp) BSR.L CrsrVBLTask ; pin and draw the cursor move.l Mouse,d0 ; has cursor been pinned? @@ -1730,7 +1748,7 @@ DrawCursor movea.l firstCrsrData(a3),a4 ; get ptr to main CrsrDataRec ;_______________________________________________________________________ ; -; Routine: CrsrDevNewDevice +; Routine: CrsrDevNewDevice 8bb8 ; ; Inputs: ... ; @@ -1827,7 +1845,7 @@ CrsrDevNewDevice ;_______________________________________________________________________ ; -; Routine: CrsrDevDisposeDev +; Routine: CrsrDevDisposeDev 8c6e ; ; Inputs: a2 - pointer to CrsrDevRec for device we want to remove ; @@ -1850,6 +1868,7 @@ CrsrDevDisposeDev @loop cmpa.l a1,a2 ; is this the linked list element we want? beq.s @gotIt ; yes, handle it move.l a1,d1 ; no, prev := next + beq.s @exit move.l nextCrsrDev(a1),d0 ; get next->nextCrsrDev beq.s @exit ; exit if NIL (we never found it) move.l d0,a1 ; next := next->nextCrsrDev @@ -1859,8 +1878,10 @@ CrsrDevDisposeDev tst.l d1 ; was it the first one? beq.s @firstOne ; yes, handle special case + move.l a2,d0 move.l d1,a2 move.l a1,nextCrsrDev(a2) ; else, delete our element from middle of list + move.l d0,a2 bra.s @dispose @firstOne move.l a1,firstCrsrDev(a0) @@ -1879,7 +1900,7 @@ CrsrDevDisposeDev ;_______________________________________________________________________ ; -; Routine: CrsrDevReInit +; Routine: CrsrDevReInit 8cae ; ; Inputs: d0 - 0 = pre-init, 1=post-init ; @@ -1912,6 +1933,7 @@ CrsrDevReInit ; movem.l d0-d3/a0-a3,-(sp) link a6,#adbPBSize ; Make a stack frame for our param block + tst d0 bne.s @PostInit ; Skip if post-processing ;--------------------- @@ -2106,7 +2128,7 @@ CrsrDevReInit ; ;_______________________________________________________________________ ; -; Routine: syncADBTalk +; Routine: syncADBTalk 8e7c ; ; Inputs: d0 - address/command byte ; a0 - ptr to receive buffer @@ -2120,7 +2142,9 @@ CrsrDevReInit ; ;_______________________________________________________________________ syncADBTalk +@restart move.l a0,-(sp) ; save ptr to our buffer + move.l d0,-(sp) clr.w -(sp) ; our 'sync' flag move.l sp,a1 ; keep pointer to globals for later @@ -2129,18 +2153,23 @@ syncADBTalk move.l a0,-(sp) ; push pointer to our reply buffer move.l sp,a0 _ADBOp + bmi.s @weird @spin tst.b (a1) ; have we completed? beq.s @spin ; no, keep waiting - lea 14(sp),sp ; dump locals + lea 18(sp),sp ; dump locals move.l (sp)+,a0 ; restore a0 rts +@weird lea.l $e(sp),sp + move.l (sp)+,d0 + move.l (sp)+,a0 + bra.s @restart ;_______________________________________________________________________ ; -; Routine: syncADBListen +; Routine: syncADBListen 8ea8 ; ; Inputs: d0 - address/command byte ; a0 - ptr to transmit buffer @@ -2154,6 +2183,8 @@ syncADBTalk ;_______________________________________________________________________ syncADBListen +@restart + movem.l d0/a0,-(sp) clr.w -(sp) ; our 'sync' flag move.l sp,a1 ; keep pointer to data area for later move.l sp,-(sp) ; push pointer to data area @@ -2161,17 +2192,21 @@ syncADBListen move.l a0,-(sp) ; push ptr to data to send move.l sp,a0 _ADBOp + bmi.s @weird @spin tst.b (a1) ; have we completed? beq.s @spin ; no, keep waiting - lea 14(sp),sp ; dump locals + lea 22(sp),sp ; dump locals rts - + +@weird lea.l $e(sp),sp + movem.l (sp)+,d0/a0 + bra.s @restart ;_______________________________________________________________________ ; -; Routine: syncComp +; Routine: syncComp 8ed2 ; ; Inputs: d0 - ADB command byte ; a0 - ptr to data (pascal string) @@ -2192,7 +2227,7 @@ syncComp st.b (a2) ; set our complete flag ;_______________________________________________________________________ ; -; Routine: InitCrsrDev +; Routine: InitCrsrDev 8ed6 ; ; Inputs: - ; @@ -2246,7 +2281,7 @@ InitCrsrDev ;______________________________________________________________________________ ; -; Routine: SetCrsrDelay +; Routine: SetCrsrDelay 8f22 ; ; Inputs: a1 contains the ptr to the cursor gDevice being setup ; @@ -2278,7 +2313,7 @@ SetCrsrDelay ;______________________________________________________________________________ ; -; Routine: SetCrsrDelCore +; Routine: SetCrsrDelCore 8f3c ; ; Inputs: a1 contains the ptr to the cursor gDevice being setup ; @@ -2296,6 +2331,22 @@ SetCrsrDelCore rts ; just a hook for now +NewCrsrFunction +; 8f3e + Move.L (DeviceList), D0 +@loop BEQ.B @done + MoveA.L D0, A0 + CmpA.L D1, A0 + BNE.B @moredone + MoveA.L (A0), A0 + Move.L $1E(A0), D0 + Bra.B @loop +@done SubA.L A0, A0 +@moredone Move.L A0, D1 + Rts + + + ;_____________________________________________________________________________________________ ; VDrawCursor - default DrawCursor routine ; @@ -2304,23 +2355,10 @@ SetCrsrDelCore ; the routine InitCrsrVects. ; - EXPORT VDrawCursor - IMPORT BLITCURSOR ;from ccrsrcore.a -VDrawCursor - MOVE.B #1,CRSRBUSY ;MARK CHANGE IN PROGRESS - - TST CRSRSTATE - BMI.S DoneSho ;QUIT IF STILL HIDDEN - CLR CRSRSTATE ;DON'T LET CRSRSTATE GET > 0 - TST.B CRSRVIS ;IS CURSOR ALREADY VISIBLE? - BNE.S DoneSho ;YES, DON'T TRY TO REDRAW - TST.B CrsrObscure ;Skip if obscured - BNE.S DoneSho +VDrawCursor PROC EXPORT - BSR.L BLITCURSOR ;Do the real work: put pixels up - -DoneSho CLR.B CRSRBUSY ;CHANGE COMPLETE - RTS + IMPORT QD_DRAWCURSOR + BRA.L QD_DRAWCURSOR ;______________________________________________________________________________________________ @@ -2331,16 +2369,9 @@ DoneSho CLR.B CRSRBUSY ;CHANGE COMPLETE ; the routine InitCrsrVects. ; - EXPORT VEraseCursor - IMPORT UNBLITCURSOR ;from ccrsrcore.a -VEraseCursor - MOVE.B #1,CRSRBUSY ;MARK CHANGE IN PROGRESS - TST.B CRSRVIS ;IS CURSOR VISIBLE? - BEQ.S DoneHid ;NO, DON'T TRY TO REMOVE IT - - BSR.L UNBLITCURSOR ;Zap Pixels +VEraseCursor PROC EXPORT -DoneHid CLR.B CRSRBUSY ;CHANGE COMPLETE - RTS + IMPORT QD_ERASECURSOR + BRA.L QD_ERASECURSOR END \ No newline at end of file diff --git a/OS/CudaMgr.a b/OS/CudaMgr.a index cc82f94..b8b51ab 100644 --- a/OS/CudaMgr.a +++ b/OS/CudaMgr.a @@ -208,7 +208,7 @@ ErrCudaInit equ $0030 ; TEMPORARY definition of error equate defined in STEQ WITH EgretGlobals,EgretPB,RespHeader eject ; { With ;________________________________________________________________________________________________ -; Routine: CudaDispatch +; Routine: CudaDispatch 8f90 ; ; Function: This is the Cuda manager trap routine. It waits for Cuda to be idle, sends ; the first byte of the command packet. If Cuda didn't abort, then it sets up @@ -271,6 +271,48 @@ CudaDispatch bra @done @CudaRestart + CmpI #$10C, (A0) + BEQ.B @L4 + CmpI #$107, (A0) + BNE.B @endChicanery + Tst.B $64(A2) + BEQ @endChicanery + +@L4 CmpI #$100, $2(A0) + BLT.B @L5 + Move #$FFCE, $E(A0) + Bra @done + +@L5 Lea.L $66(A2), A2 + Move $6(A0), D1 + BEQ @L9 + SubQ #$1, D1 + MoveQ.L #$0, D2 + Move $2(A0), D2 + MoveA.L $8(A0), A1 + +@L6 CmpI.B #$7, $1(A0) + BEQ.B @L7 + Move.B (A1)+, $0(A2,D2.W) + Bra.B @L8 + +@L7 Move.B $0(A2,D2.W), (A1)+ + +@L8 AddQ #$1, D2 + AndI #$FF, D2 + DBF D1, @L6 + +@L9 MoveA.L ($DE0), A2 + MoveA.L ($1D4), A1 + CmpI.B #$C, $1(A0) + BEQ.B @endChicanery + Tst.L $10(A0) + BEQ @done + MoveA.L $10(A0), A1 + Jsr (A1) + Bra @done + +@endChicanery move.w sr,-(sp) ; save SR ori.w #hiIntMask,sr ; mask interrupts @@ -285,17 +327,21 @@ CudaDispatch @abort move.w (sp)+,sr ; we were busy, enable interrupts jsr pollByte ; poll shift reg, calling handler if interrupts masked - bra.s @CudaRestart ; and keep waiting for busy to go away... + bra.s @endChicanery ; and keep waiting for busy to go away... @sendPackType ; interrupts masked here eieioSTP bset.b #SRdir,vACR(a1) ; switch to output, Define direction FROM System + nop eieioSTP move.b pbCmdType(a0),vSR(a1) ; send command packet to shift reg + nop eieioSTP bset.b #vByteAck,vBufB(a1) ; make sure state is idle before transaction + nop eieioSTP bclr.b #TIP,vBufB(a1) ; assert TIP (we're starting command packet) + nop eieioSTP ; @@ -303,7 +349,7 @@ CudaDispatch ; When the shift register irq comes in call the PollProc ; then process the shift register irq data ; - movem.l d0/d1/a0-a4/a6,-(sp) ; save some registers + movem.l d0-d3/a0-a4/a6,-(sp) ; save some registers move.l PollStack,-(sp) ; save previous poll stack lea @zero, a3 move.l sp,PollStack ; Pointer to buffer for polled bytes @@ -323,6 +369,7 @@ CudaDispatch beq.s @2 move.b (a6),-(sp) ; Push the data on the stack @2 + bsr.l otherDelay eieioSTP btst.b #vShift,vIFR(a1) ; now wait for shift reg IRQ eieioSTP @@ -341,7 +388,7 @@ CudaDispatch @NoSCCData move.l (sp)+,PollStack ; restore previous poll stack - movem.l (sp)+,d0/d1/a0-a4/a6 ; restore work registers + movem.l (sp)+,d0-d3/a0-a4/a6 ; restore work registers eieioSTP btst.b #TReq,vBufB(a1) ; did CUDA abort? eieioSTP @@ -353,22 +400,24 @@ CudaDispatch ; of CB1. Delay long enough for the edge to occur before acknowledging the shift ; register interrupt. (R. Montagne 1/11/93) ;________________________________________________________________________________________________ - moveq #10,d0 ; delay for 10µS min. + move $d00,d0 + divu #$50,d0 @mode7delay - eieioSTP - tst.b vBufB(a1) ; 1.2µS per access - eieioSTP dbra d0,@mode7delay eieioSTP bclr.b #SRdir,vACR(a1) ; yes, switch back to input + nop eieioSTP tst.b vSR(a1) ; clear pending shift register interrupt + nop eieioSTP ori.b #((1< - movea.l EgretBase,a2 ; get ptr to globals <13> - bset.b #busy,flags(a2) ; make sure we're marked as busy - - eieioSTP - btst.b #SRdir,vACR(a1) ; see if VIA direction is output - eieioSTP - beq.s @input ; no, then we're receiving.. + + btst.b #vShift,vIFR(a1) + bne.s @output + + move.w d3,sr ; restore interrupts + rts + ;________________________________________________________________________________________________ ; When outputing from the VIA to Cuda, the interrupt will occur prior to the rising edge ; of CB1. Delay long enough for the edge to occur before acknowledging the shift ; register interrupt. (R. Montagne 1/11/93) ;________________________________________________________________________________________________ - moveq #10,d0 ; delay for 10µS min. + +@output + movea.l EgretBase,a2 ; get ptr to globals <13> + bset.b #busy,flags(a2) ; make sure we're marked as busy + + btst.b #$4, $1600(A1) + beq.s * + $60 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + move $d00,d0 + divu #$50,d0 @mode7delay - eieioSTP - tst.b vBufB(a1) ; 1.2µS per access - eieioSTP dbra d0,@mode7delay ; eieioSTP tst.b vSR(a1) ; clear the shift reg interrupt + nop eieioSTP tst.w sendHdrCnt(a2) ; any bytes left in header? ble.s @ckSendData ; no, see if any send bytes left... @@ -535,6 +594,7 @@ CudaShiftRegIRQ @CmdFinished eieioSTP bclr.b #SRdir,vACR(a1) ; now switch to input + nop eieioSTP ;________________________________________________________________________________________________ ; When changing VIA direction, a clock can be generated to the VIA bit counter. An @@ -548,12 +608,14 @@ CudaShiftRegIRQ eieioSTP ori.b #((1< (rbm) @waitIdleAck ; (rbm) eieioSTP + bsr.l otherDelay btst.b #ifSR,vIFR(a1) ; wait for idle state acknowledgement (rbm) eieioSTP beq.s @waitIdleAck ; (rbm) eieioSTP tst.b vSR(a1) ; clear the shift reg interrupt (rbm) + nop eieioSTP ;--------------------------------------------------------------------------- @@ -806,7 +873,7 @@ CudaShiftRegIRQ Eject ;________________________________________________________________________________________________ -; Routine: SetTransferParams +; Routine: SetTransferParams 93e0 ; ; Function: This routine sets up transmit/receive ptrs (globals) for the packet pointed to by A0, ; for use by the Shift Reg interrupt handler. @@ -850,7 +917,9 @@ SetTransferParams clr.l sendDataPtr(a2) ; no extended data ptr <12> bra @rcvParams -@notDFAC cmp.b #RdWrIIC,pbCmd(a0) ; check for IIC transaction +@notDFAC cmp.b #$25,pbCmd(a0) + beq @dontjump + cmp.b #RdWrIIC,pbCmd(a0) ; check for IIC transaction bne.s @notRdWrIIC ; use the table if not RdWrIIC * * Here is how the transfer globals are set up for IIC transactionsÉ @@ -885,21 +954,30 @@ SetTransferParams * RespData ¥ RespData ¥ * curPB CudaPB curPB CudaPB * +@dontjump move.w pbByteCnt(a0),d1 ; RdWrIIC uses byte count for send portion addq.w #1,d1 ; include the packet byte already sent move.w d1,sendHdrCnt(a2) ; set up header byte count move.w #4,rcvHdrCnt(a2) ; 4 byte header default clr.w rcvHdrIndex(a2) ; reset index into header buffer move.l pbBufPtr(a0),a1 ; get address of data buffer - btst.b #0,pbParam(a0) ; is this a read or write IIC operation? - bne.s @doIICread ; + + cmp.b #RdWrIIC,pbCmd(a0) + beq.s @doIICwrite + + btst.b #0,4(a0) + bne.s @doIICread @doIICwrite ; + btst.b #0,pbParam(a0) + bne.s @doIICread + moveq #0,d1 ; data phase count must be 1 to 256 move.b (a1),d1 ; bne.s @wrCntOK ; move.w #$0100,d1 ; @wrCntOK ; move.w d1,sendDataCnt(a2) ; number of extended data bytes to send +@newlbl adda.l #1,a1 ; move.l a1,sendDataPtr(a2) ; extended data ptr clr.w rcvDataCnt(a2) ; no data to receive on IIC write @@ -1001,7 +1079,7 @@ CheckCudaPacket ;________________________________________________________________________________________________ -; Routine: CudaTickHandler +; Routine: CudaTickHandler 9566 ; ; Function: This is the completion routine for tick response packets. ; @@ -1063,7 +1141,7 @@ CudaTickHandler ENDWITH ; } ;========================================================================= -; Routine: CudaInit +; Routine: CudaInit 9584 ; ; This routine sends a NOP/WarmStart command to Cuda. This routine is ; called early during rom Startup to stop autopoll and 1 sec irq. Also, @@ -1118,6 +1196,7 @@ CudaInit eieioSTP ori.b #((1< (1< + nop eieioSTP move.l #hw4msDelay,d4 ; we want to delay 4 millisecs for ADB reset to complete @killtime @@ -1139,10 +1218,12 @@ CudaInit @noX eieioSTP tst.b vSR(a2) ; clear the pending interrupt + nop eieioSTP move.l #hw10msDelay,d4 ; Timeout values must exceed duration of maximum ADB auto poll. <7> eieioSTP bclr.b #vByteAck,vBufB(a2) ; issue a sync state (TIP = negated, ByteAck = asserted) + nop eieioSTP @waitSync eieioSTP @@ -1161,6 +1242,7 @@ CudaInit @haveSync move.l #hw10msDelay,d4 ; number of retries before giving up with Cuda eieioSTP bset.b #vByteAck,vBufB(a2) ; terminate the sync cycle + nop eieioSTP @syncTerm eieioSTP @@ -1172,6 +1254,7 @@ CudaInit @haveTerm eieioSTP tst.b vSR(a2) ; clear the pending interrupt + nop eieioSTP move.l #hw10msDelay,d4 ; number of retries before giving up with Cuda @waitIdle2 @@ -1185,15 +1268,17 @@ CudaInit eieioSTP ori.b #((1< + nop eieioSTP tst.b vSR(a2) ; clear the pending interrupt + nop eieioSTP @exit rts6 ; setup the return to caller of CudaInit eject ************************************************************************************************************ -* SendCudaCmd: This register based routine will send up to four bytes of data to +* SendCudaCmd 9630: This register based routine will send up to four bytes of data to * Cuda. The packet type, command, byte count and data are passed in * registers. The routine will return with d0.w = $0000 if it sent the * command successfully. A value of $FFFF signifies that the command did @@ -1236,14 +1321,17 @@ SendCudaCmd eieioSTP ori.b #((1< move.l #0001,d6 ; d6.l must be nonzero - bigjmp Error1Handler,a3 ; Play death chimes + bra.s * VsrIrq - move.b #10,d4 ; mode 7 interrupt occurs at falling edge CB1 -@m7dly ; use d4 since retry count not required anymore - eieioSTP - tst.b vBufB(a1) ; hardware access is 1.2µS - eieioSTP - sub.b #1,d4 ; can only trash low byte - bne.s @m7dly ; wait long enough for CB1 to rise (10µS delay) - + move.l d4,-(sp) + move $d00,d4 + divu #10,d4 + dbra.w d4,* + move.l (sp)+,d4 + eieioSTP tst.b vSR(a1) ; clear the interrupt + nop eieioSTP btst.b #TReq,vBufB(a1) ; exit with abort status + nop eieioSTP AbortReq rts5 ;-------------------------------------------------------------------------- -; DumpAbort This routine will read all the data for an abort transaction and +; DumpAbort 9774 This routine will read all the data for an abort transaction and ; discard it. When done it will jump back to SendNopCmd entry point ; to retry our command. This command will eventually complete... @@ -1383,14 +1483,18 @@ AbortReq rts5 RealAbort eieioSTP bclr.b #SRdir,vACR(a1) ; shift in + nop eieioSTP ori.b #((1< -@m7dly - eieioSTP - tst.b vBufB(a1) ; hardware access is 1.2µS - eieioSTP - sub.b #1,d0 ; can only trash low byte - bne.s @m7dly ; wait long enough for CB1 to rise (10µS delay) - + move.l d0,-(sp) + move $d00,d0 + divu #10,d0 + dbra.w d0,* + move.l (sp)+,d0 eieioSTP tst.b vSR(a1) ; clear the interrupt + nop eieioSTP rts5 ;-------------------------------------------------------------------------- ; Export readByte readByte + bsr.l otherDelay eieioSTP btst.b #ifSR,vIFR(a1) ; wait for shift to complete eieioSTP beq.s readByte eieioSTP move.b vSR(a1),d0 ; read the byte + nop eieioSTP eori.b #1< BT: Second OS table macro for Figment. This is temporary -; until figment is fully approved. -;------------------------------------------------------------------------------ - macro - OS2 &num,&name,&cond - if (*-SecondOS)/4 <> &Eval(&num) then - aerror 'Trap Number out of sequence' - endif - if &name = '' then - dc.l 0 ; unused - elseif &cond = '' then - import &name - dc.l &name-BaseOfRom - elseif &Eval(&cond) then - import &name - dc.l &name-BaseOfRom - else - dc.l 0 ; not used in this configuration - endif - endm -;------------------------------------------------------------------------------ -; BT: End second OS table macro -;------------------------------------------------------------------------------ - endif - EXPORT DispTable IMPORT BaseofRom @@ -353,13 +326,13 @@ DispTable FirstTool ToolBox $000 ; toolbox trap $000 (ALWAYS LEAVE AS ZERO) rb - ToolBox $001,__SNDDISPOSECHANNEL ; toolbox trap $001 - ToolBox $002,__SNDADDMODIFIER ; toolbox trap $002 - ToolBox $003,__SNDDOCOMMAND ; toolbox trap $003 - ToolBox $004,__SNDDOIMMEDIATE ; toolbox trap $004 - ToolBox $005,__SNDPLAY ; toolbox trap $005 - ToolBox $006,__SNDCONTROL ; toolbox trap $006 - ToolBox $007,__SNDNEWCHANNEL ; toolbox trap $007 + ToolBox $001 ;,__SNDDISPOSECHANNEL ; toolbox trap $001 + ToolBox $002 ;,__SNDADDMODIFIER ; toolbox trap $002 + ToolBox $003 ;,__SNDDOCOMMAND ; toolbox trap $003 + ToolBox $004 ;,__SNDDOIMMEDIATE ; toolbox trap $004 + ToolBox $005 ;,__SNDPLAY ; toolbox trap $005 + ToolBox $006 ;,__SNDCONTROL ; toolbox trap $006 + ToolBox $007 ;,__SNDNEWCHANNEL ; toolbox trap $007 ToolBox $008,InitProcMenu ; toolbox trap $008 (new menu mgr) ToolBox $009,GetCVariant ; toolbox trap $009 ToolBox $00A,GetWVariant ; toolbox trap $00A @@ -374,8 +347,8 @@ FirstTool ToolBox $013,TEAutoView ; toolbox trap $013 ToolBox $014,SetFractEnable ; toolbox trap $014 (font mgr) ; ToolBox $015,SCSIMgr ; toolbox trap $015 - ToolBox $015,SCSIDispatchCommon ; toolbox trap $015 - ToolBox $016,Pack8 ; toolbox trap $016 + ToolBox $015, ;SCSIDispatchCommon ; toolbox trap $015 + ToolBox $016, ;Pack8 ; toolbox trap $016 ToolBox $017,CopyMask ; toolbox trap $017 ToolBox $018,FixAtan2 ; toolbox trap $018 ToolBox $019,XMunger ; toolbox trap $019 @@ -396,13 +369,13 @@ FirstTool ToolBox $028,ShowDItem ; toolbox trap $028 ToolBox $029,LayerDispatch ; toolbox trap $029 (LayerDispatch) (v1.1) ToolBox $02A,MainComponent ; toolbox trap $02A (ComponentDispatch) (v1.1) - ToolBox $02B,Pack9 ; toolbox trap $02B + ToolBox $02B ;,Pack9 ; toolbox trap $02B ToolBox $02C,Pack10 ; toolbox trap $02C - ToolBox $02D,Pack11 ; toolbox trap $02D + ToolBox $02D ;,Pack11 ; toolbox trap $02D ToolBox $02E,Pack12 ; toolbox trap $02E ToolBox $02F,Pack13 ; toolbox trap $02F - ToolBox $030,Pack14Entry ; toolbox trap $030 - ToolBox $031,Pack15 ; toolbox trap $031 + ToolBox $030 ;,Pack14Entry ; toolbox trap $030 + ToolBox $031 ;,Pack15 ; toolbox trap $031 ToolBox $032 ; toolbox trap $032 (unimplemented) (v1.1) ToolBox $033,ScrnBitMap ; toolbox trap $033 ToolBox $034,SetFScaleDisable ; toolbox trap $034 @@ -819,7 +792,7 @@ FirstTool ToolBox $1C5,RsrcMapEntry ; toolbox trap $1C5 ToolBox $1C6,Secs2Date ; toolbox trap $1C6 ToolBox $1C7,Date2Secs ; toolbox trap $1C7 - ToolBox $1C8,__SYSBEEP ; toolbox trap $1C8 + ToolBox $1C8 ;,__SYSBEEP ; toolbox trap $1C8 ToolBox $1C9,SystemError ; toolbox trap $1C9 ToolBox $1CA,PutIcon ; toolbox trap $1CA ToolBox $1CB,TEGetText ; toolbox trap $1CB @@ -958,11 +931,11 @@ FirstTool ToolBox $250,SeedCFill ; toolbox trap $250 <31Jan89 BAL> ToolBox $251,KopyMask ; toolbox trap $251 ToolBox $252,HighLevelFSDispatch ; toolbox trap $252 (unknown) - ToolBox $253,DictionaryDispatch ; toolbox trap $253 (DictionaryDispatch) CSS - ToolBox $254,TSMDispatch ; toolbox trap $254 (TMSDispatch) + ToolBox $253 ;,DictionaryDispatch ; toolbox trap $253 (DictionaryDispatch) CSS + ToolBox $254 ;,TSMDispatch ; toolbox trap $254 (TMSDispatch) ToolBox $255 ; toolbox trap $255 (unknown) ToolBox $256 ; toolbox trap $256 (unknown) - ToolBox $257,DockingDispatch ; toolbox trap $257 (unknown) + ToolBox $257 ;,DockingDispatch ; toolbox trap $257 (unknown) ToolBox $258 ; toolbox trap $258 (unknown) ToolBox $259 ; toolbox trap $259 (unknown) ToolBox $25A ; toolbox trap $25A (unknown) @@ -983,13 +956,14 @@ FirstTool ToolBox $268,DialogMgrDispatch ; toolbox trap $268 ToolBox $269 ; toolbox trap $269 (unknown) - ToolBox $26A ; toolbox trap $26A (unknown) + ToolBox $26A,__AA6A ToolBox $26B ; toolbox trap $26B (unknown) ToolBox $26C ; toolbox trap $26C (unknown) ToolBox $26D ; toolbox trap $26D (unknown) ToolBox $26E ; toolbox trap $26E (unknown) ToolBox $26F ; toolbox trap $26F (unknown) - DCB.L 16,0 ; toolbox trap $270-$27F (unknown) + DCB.L 15,0 ; toolbox trap $270-$27E (unknown) + ToolBox $27F,NKLog DCB.L 16,0 ; toolbox trap $280-$28F (unknown) ToolBox $290,InitPalettes ; toolbox trap $290 <02Jun87 DAF> ToolBox $291,NewPalette ; toolbox trap $291 <02Jun87 DAF> @@ -1045,7 +1019,7 @@ FirstTool DCB.L 16,0 ; toolbox trap $2E0-$2EF (unknown) ToolBox $2F0 ; toolbox trap $2AF (unknown) - ToolBox $2F1 ; toolbox trap $2AF (unknown) + ToolBox $2F1,ATAManager ToolBox $2F2 ; toolbox trap $2AF (unknown) ToolBox $2F3,ExpansionBusDispatch ; toolbox trap $2F3 (Expansion Bus Mgr) ToolBox $2F4 ; toolbox trap $2AF (unknown) @@ -1262,7 +1236,7 @@ FirstTool ToolBox $3C6 ; quickdraw hook $3C6 ToolBox $3C7 ; quickdraw hook $3C7 ToolBox $3C8 ; quickdraw2 hook $3C8 - ToolBox $3C9,IconDispatch ; quickdraw _IconDispatch $3C9 + ToolBox $3C9 ;,IconDispatch ; quickdraw _IconDispatch $3C9 ToolBox $3CA,DeviceLoop ; quickdraw _DeviceLoop <20> PN ToolBox $3CB ; quickdraw hook $3CB ToolBox $3CC ; quickdraw hook $3CC @@ -1270,7 +1244,8 @@ FirstTool ToolBox $3CE ; quickdraw hook $3CE ToolBox $3CF ; quickdraw hook $3CF DCB.L 16,0 ; toolbox trap $3D0-$3DF (unknown) - DCB.L 11,0 ; toolbox trap $3E0-$3EA (unknown) + ToolBox $3E0,QDExtensions2 + DCB.L 10,0 ; toolbox trap $3E1-$3EA (unknown) IF hasDisplayMgr THEN ; Only install if we have we are flagged ToolBox $3EB,DisplayDispatch ; toolbox trap $3EB (DisplayManager) (IH) ELSE @@ -1278,7 +1253,7 @@ FirstTool ENDIF DCB.L 4,0 ; toolbox trap $3EC-$3EF (unknown) ToolBox $3F0 ; toolbox trap $3F0 (unknown) - ToolBox $3F1 ; toolbox trap $3F1 (unknown) + ToolBox $3F1,GestaltValueDispatch ToolBox $3F2 ; toolbox trap $3F2 (unknown) ToolBox $3F3 ; toolbox trap $3F3 (unknown) ToolBox $3F4 ; toolbox trap $3F4 (unknown) @@ -1384,14 +1359,14 @@ FirstOS OS $50,RelStringTrap ; OS trap $50 OS $51,ReadXPRam ; OS trap $51 OS $52,WriteXPRam ; OS trap $52 - OS $53,ClkNoMem ; OS trap $53 + OS $53 ;,ClkNoMem ; OS trap $53 OS $54,UprStringTrap ; OS trap $54 OS $55,__StripAddress ; OS trap $55 (new memory mgr) OS $56,NewLwrString ; OS trap $56 ;in-ROM script manager OS $57,SetApplBase ; OS trap $57 - OS $58,__InsTime ; OS trap $58 - OS $59,__RmvTime ; OS trap $59 - OS $5A,__PrimeTime ; OS trap $5A + OS $58 ;,__InsTime ; OS trap $58 + OS $59 ;,__RmvTime ; OS trap $59 + OS $5A ;,__PrimeTime ; OS trap $5A OS $5B,PowerOff ; OS trap $5B (poweroff trap) <11apr86>/ OS $5C,MemoryDispatch,hasMMU ; OS trap $5C (MemoryDispatch trap) OS $5D ; OS trap $5D (MMU trap, set up later) <2.7> @@ -1408,7 +1383,7 @@ FirstOS OS $68,HNoRSRC ; OS trap $68 OS $69,HGetFlags ; OS trap $69 OS $6A,HSetFlags ; OS trap $6A - OS $6B,TestManager ; OS trap $6B (test trap) + OS $6B ;,TestManager ; OS trap $6B (test trap) OS $6C,InitFS ; OS trap $6C OS $6D,InitEvents ; OS trap $6D OS $6E,SlotManager,hasSlotMgr ; OS trap $6E @@ -1434,13 +1409,13 @@ FirstOS OS $82,DTInstallTrap ; OS trap $82 (deferred task) OS $83,SetOSDefault,hasSlotMgr ; OS trap $83 (which os to use) OS $84,GetOSDefault,hasSlotMgr ; OS trap $84 (which os to use) - OS $85,PmgrOp,hasPwrControls|PwrMgrADB|hasPwrMgrClock ; OS trap $85 + OS $85 ;,PmgrOp,hasPwrControls|PwrMgrADB|hasPwrMgrClock ; OS trap $85 OS $86,IOPInfoAccess,hasIopScc|hasIopSwim ; OS trap $086 <1.3> OS $87,IOPMsgRequest,hasIopScc|hasIopSwim ; OS trap $087 <1.3> OS $88,IOPMoveData,hasIopScc|hasIopSwim ; OS trap $088 <1.3> OS $89,NewSCSITrap,0 ; os trap $89 (async SCSI Mgr) <3.0> OS $8A,GoToSleep,hasPwrControls|PwrMgrADB|hasPwrMgrClock ; OS trap $8A - OS $8B,COMMTOOLBOXDISPATCHER ; os trap $8B (CommToolBoxTrap) + OS $8B ;,COMMTOOLBOXDISPATCHER ; os trap $8B (CommToolBoxTrap) OS $8C ; os trap $8C (unknown) <1.5> OS $8D,DebugUtil ; os trap $8D <1.5> OS $8E,ExtBTreeDispatch ; os trap $8E (BTreeDispatch) <2.0> @@ -1448,7 +1423,7 @@ FirstOS OS $90,SysEnvironsTrap ; OS trap $90 OS $91,Translate24To32 ; os trap $91 (unknown) <2.9> BAL OS $92,EgretDispatch,hasEgret ; os trap $92 <4> - OS $93,__Microseconds ; os trap $93 <9> + OS $93 ;,__Microseconds ; os trap $93 <9> OS $94 ; os trap $94 (unknown) OS $95 ; os trap $95 (unknown) OS $96 ; os trap $96 (unknown) @@ -1459,8 +1434,8 @@ FirstOS OS $9B ; os trap $9B (unknown) OS $9C ; os trap $9C (unknown) OS $9D,MoveHLow ; os trap $9D MoveHLow tcn - OS $9E,PowerMgrDispatch,hasPwrControls ; os trap $9E (PowerMgrDispatch Trap) - OS $9F,PowerDispatch,hasPwrControls ; os trap $9F (PwrControls Traps) <17> rb + OS $9E ;,PowerMgrDispatch,hasPwrControls ; os trap $9E (PowerMgrDispatch Trap) + OS $9F ;,PowerDispatch,hasPwrControls ; os trap $9F (PwrControls Traps) <17> rb OS $A0 ; os trap $A0 (unknown) OS $A1 ; os trap $A1 (unknown) OS $A2 ; os trap $A2 (unknown) @@ -1493,7 +1468,7 @@ FirstOS OS $B6,vWaitUntil ; vector $B6 (iocore) OS $B7,vSyncWait ; vector $B7 (iocore) - OS $B8,__SNDAPPDEAD ; vector $B8 + OS $B8 ;,__SNDAPPDEAD ; vector $B8 OS $B9,vDisPtch ; vector $B9 (deferred task) <2.2> OS $BA,vIAZInit ; vector $BA <16jun87 CSL> OS $BB,vIAZPostInit ; vector $BB <16jun87 CSL> @@ -1530,7 +1505,7 @@ FirstOS OS $DA,vExtendFile ; vector $DA OS $DB,vTruncateFile ; vector $DB OS $DC,vCMSetUp ; vector $DC - OS $DD,vppcDispatcher ; vector $DD (PPCDispatcher) + OS $DD ;,vppcDispatcher ; vector $DD (PPCDispatcher) OS $DE,vDtrmV1 ; vector $DE OS $DF,vBlkAlloc ; vector $DF OS $E0,vBlkDeAlloc ; vector $E0 @@ -1570,285 +1545,5 @@ FirstOS ; end of vectors ;------------------------------------------------------------------------------ - - if hasNewHeapMgr Then -;------------------------------------------------------------------------------ -; BT: Second OS table for Figment. This is temporary -; until figment is fully approved. -;------------------------------------------------------------------------------ -; WARNING -- DO NOT CHANGE THIS TABLE UNLESS YOU CHANGE THE CORRESPONDING OS TABLE! (ABOVE) -;------------------------------------------------------------------------------ - -SecondOS - OS2 $00,Open ; OS trap $00 - OS2 $01,Close ; OS trap $01 - OS2 $02,Read ; OS trap $02 - OS2 $03,Write ; OS trap $03 - OS2 $04,ControlTrap ; OS trap $04 - OS2 $05,StatusTrap ; OS trap $05 - OS2 $06,KillIOTrap ; OS trap $06 - OS2 $07,GetVolInfo ; OS trap $07 - OS2 $08,FileCreate ; OS trap $08 - OS2 $09,FileDelete ; OS trap $09 - OS2 $0A,OpenRFTrap ; OS trap $0A - OS2 $0B,RenameTrap ; OS trap $0B - OS2 $0C,GetFileInfo ; OS trap $0C - OS2 $0D,SetFileInfo ; OS trap $0D - OS2 $0E,UnmountVolTrap ; OS trap $0E - OS2 $0F,MountVol ; OS trap $0F - OS2 $10,FileAlloc ; OS trap $10 - OS2 $11,GetEOFTrap ; OS trap $11 - OS2 $12,SetEOFTrap ; OS trap $12 - OS2 $13,FlushVolTrap ; OS trap $13 - OS2 $14,GetVolTrap ; OS trap $14 - OS2 $15,SetVolTrap ; OS trap $15 - OS2 $16,FInitQueue ; OS trap $16 - OS2 $17,EjectTrap ; OS trap $17 - OS2 $18,GetFPosTrap ; OS trap $18 - OS2 $19,Fig_InitZoneTrap ; OS trap $19 - OS2 $1A,Fig_GetZone ; OS trap $1A - OS2 $1B,Fig_SetZone ; OS trap $1B - OS2 $1C,Fig_FreeMem ; OS trap $1C - OS2 $1D,Fig_MaxMemTrap ; OS trap $1D - OS2 $1E,Fig_NewPtrTrap ; OS trap $1E - OS2 $1F,Fig_DisposePtr ; OS trap $1F - OS2 $20,Fig_SetPtrSizeTrap ; OS trap $20 - OS2 $21,Fig_GetPtrSizeTrap ; OS trap $21 - OS2 $22,Fig_NwHandle ; OS trap $22 - OS2 $23,Fig_DsposeHandle ; OS trap $23 - OS2 $24,Fig_SetHandleSizeTrap ; OS trap $24 - OS2 $25,Fig___GetHandleSize ; OS trap $25 - OS2 $26,Fig_HandleZoneTrap ; OS trap $26 - OS2 $27,Fig_ReallocHandleTrap ; OS trap $27 - OS2 $28,Fig_RecoverHandleTrap ; OS trap $28 - OS2 $29,Fig_HLock ; OS trap $29 - OS2 $2A,Fig_HUnlock ; OS trap $2A - OS2 $2B,Fig_EmptyHandle ; OS trap $2B - OS2 $2C,Fig_InitApplZone ; OS trap $2C - OS2 $2D,Fig_SetApplLimit ; OS trap $2D - OS2 $2E,__BlockMove ; OS trap $2E - OS2 $2F,PostEventTrap ; OS trap $2F - OS2 $30,OSEventAvailTrap ; OS trap $30 rb - OS2 $31,GetOSEventTrap ; OS trap $31 - OS2 $32,FlushEvents ; OS trap $32 - OS2 $33,VInstall ; OS trap $33 - OS2 $34,VRemove ; OS trap $34 - OS2 $35,OffLine ; OS trap $35 - OS2 $36,Fig_MoreMasters ; OS trap $36 - OS2 $37,ReadParam ; OS trap $37 - OS2 $38,WriteParamTrap ; OS trap $38 - OS2 $39,ReadDateTimeTrap ; OS trap $39 - OS2 $3A,SetDateTimeTrap ; OS trap $3A - OS2 $3B,DelayTrap ; OS trap $3B - OS2 $3C,CmpString ; OS trap $3C - OS2 $3D,DrvrInstall ; OS trap $3D - OS2 $3E,DrvrRemove ; OS trap $3E - OS2 $3F,InitUtil ; OS trap $3F - OS2 $40,Fig_ResrvMem ; OS trap $40 - OS2 $41,SetFilLock ; OS trap $41 new from extensionHFS - OS2 $42,RstFilLock ; OS trap $42 new from extensionHFS - OS2 $43,SetFilType ; OS trap $43 - OS2 $44,SetFPosTrap ; OS trap $44 - OS2 $45,FlushFile ; OS trap $45 - OS2 $46,GetTrapAddressTrap ; OS trap $46 - OS2 $47,SetTrapAddressTrap ; OS trap $47 - OS2 $48,Fig_PtrZoneTrap ; OS trap $48 - OS2 $49,Fig_HPurge ; OS trap $49 - OS2 $4A,Fig_HNoPurge ; OS trap $4A - OS2 $4B,Fig_SetGrowZone ; OS trap $4B - OS2 $4C,Fig_CompactMemTrap ; OS trap $4C - OS2 $4D,Fig_PurgeMem ; OS trap $4D - OS2 $4E,AddDriveTrap ; OS trap $4E - OS2 $4F,InstallRDrivers ; OS trap $4F - OS2 $50,RelStringTrap ; OS trap $50 - OS2 $51,ReadXPRam ; OS trap $51 - OS2 $52,WriteXPRam ; OS trap $52 - OS2 $53,ClkNoMem ; OS trap $53 - OS2 $54,UprStringTrap ; OS trap $54 - OS2 $55,__StripAddress ; OS trap $55 (new memory mgr) - OS2 $56,NewLwrString ; OS trap $56 ;in-ROM script manager - OS2 $57,Fig_SetApplBase ; OS trap $57 - OS2 $58,__InsTime ; OS trap $58 - OS2 $59,__RmvTime ; OS trap $59 - OS2 $5A,__PrimeTime ; OS trap $5A - OS2 $5B,PowerOff ; OS trap $5B (poweroff trap) <11apr86>/ - OS2 $5C,MemoryDispatch,hasMMU ; OS trap $5C (MemoryDispatch trap) - OS2 $5D ; OS trap $5D (MMU trap, set up later) <2.7> - OS2 $5E,__NMINSTALL ; OS trap $5E (v1.1) tcn - OS2 $5F,__NMREMOVE ; OS trap $5F (v1.1) tcn - OS2 $60,TFSDispatch ; OS trap $60 - OS2 $61,Fig_MaxBlockTrap ; OS trap $61 - OS2 $62,Fig_PurgeSpaceTrap ; OS trap $62 - OS2 $63,Fig_MaxApplZone ; OS trap $63 - OS2 $64,Fig_MoveHHi ; OS trap $64 - OS2 $65,Fig_StackSpaceTrap ; OS trap $65 - OS2 $66,Fig_NewEmptyHandleTrap ; OS trap $66 - OS2 $67,Fig_HRSRC ; OS trap $67 - OS2 $68,Fig_HNoRSRC ; OS trap $68 - OS2 $69,Fig_HGetFlags ; OS trap $69 - OS2 $6A,Fig_HSetFlags ; OS trap $6A - OS2 $6B,TestManager ; OS trap $6B (test trap) - OS2 $6C,InitFS ; OS trap $6C - OS2 $6D,InitEvents ; OS trap $6D - OS2 $6E,SlotManager,hasSlotMgr ; OS trap $6E - OS2 $6F,SlotVInstall,hasSlotMgr ; os trap $6F (Slot Manager) - OS2 $70,SlotVRemove,hasSlotMgr ; os trap $70 (Slot Manager) - OS2 $71,AttachVBL,hasSlotMgr ; os trap $71 (VBL Manager) - OS2 $72,DoVBLTask,hasSlotMgr ; os trap $72 (VBL Manager) - OS2 $73 ; OS trap $73 (reserved for twitcher??) - OS2 $74,CacheTrap ; os trap $74 - OS2 $75,SIntInstall,hasSlotMgr ; OS trap $75 - OS2 $76,SIntRemove,hasSlotMgr ; OS trap $76 - OS2 $77,CountADBs ; OS trap $77 (fdb manager) - OS2 $78,GetIndADBTrap ; OS trap $78 (fdb manager) - OS2 $79,GetADBInfoTrap ; OS trap $79 (fdb manager) - OS2 $7A,SetADBInfoTrap ; OS trap $7A (fdb manager) - OS2 $7B,ADBReinit ; OS trap $7B (fdb manager) - OS2 $7C,ADBOpTrap ; OS trap $7C (fdb manager) - OS2 $7D,GetDefaultStartup ; OS trap $7D (start manager) - OS2 $7E,SetDefaultStartup ; OS trap $7E (start manager) - OS2 $7F,InternalWait ; os trap $7F (start manager) - OS2 $80,GetVideoDefault,hasSlotMgr ; OS trap $80 (start manager) - OS2 $81,SetVideoDefault,hasSlotMgr ; OS trap $81 (start manager) - OS2 $82,DTInstallTrap ; OS trap $82 (deferred task) - OS2 $83,SetOSDefault,hasSlotMgr ; OS trap $83 (which os to use) - OS2 $84,GetOSDefault,hasSlotMgr ; OS trap $84 (which os to use) - OS2 $85,PmgrOp,hasPwrControls|PwrMgrADB|hasPwrMgrClock ; OS trap $85 - OS2 $86,IOPInfoAccess,hasIopScc|hasIopSwim ; OS trap $086 <1.3> - OS2 $87,IOPMsgRequest,hasIopScc|hasIopSwim ; OS trap $087 <1.3> - OS2 $88,IOPMoveData,hasIopScc|hasIopSwim ; OS trap $088 <1.3> - OS2 $89,NewSCSITrap,0 ; os trap $89 (async SCSI Mgr) <3.0> - OS2 $8A,GoToSleep,hasPwrControls|PwrMgrADB|hasPwrMgrClock ; OS trap $8A - OS2 $8B,COMMTOOLBOXDISPATCHER ; os trap $8B (CommToolBoxTrap) - OS2 $8C ; os trap $8C (unknown) <1.5> - OS2 $8D,DebugUtil ; os trap $8D <1.5> - OS2 $8E,ExtBTreeDispatch ; os trap $8E (BTreeDispatch) <2.0> - OS2 $8F,NonVMDeferUserFn ; os trap $8F (DeferUserFn) PN - OS2 $90,SysEnvironsTrap ; OS trap $90 - OS2 $91,Translate24To32 ; os trap $91 (unknown) <2.9> BAL - OS2 $92,EgretDispatch,hasEgret ; os trap $92 <4> - OS2 $93,__Microseconds ; os trap $93 <9> - OS2 $94 ; os trap $94 (unknown) - OS2 $95 ; os trap $95 (unknown) - OS2 $96 ; os trap $96 (unknown) - OS2 $97 ; os trap $97 (unknown) - OS2 $98,HwPriv,Cpu³020 ; OS trap $98 <1.6> - OS2 $99 ; os trap $99 (unknown) - OS2 $9A,ProcHelper ; os trap $9A ProcHelper <19> rb - OS2 $9B ; os trap $9B (unknown) - OS2 $9C ; os trap $9C (unknown) - OS2 $9D,Fig_MoveHLow ; os trap $9D MoveHLow tcn - OS2 $9E,PowerMgrDispatch,hasPwrControls ; os trap $9E (PowerMgrDispatch Trap) - OS2 $9F,PowerDispatch,hasPwrControls ; os trap $9F (PwrControls Traps) <17> rb - OS2 $A0 ; os trap $A0 (unknown) - OS2 $A1 ; os trap $A1 (unknown) - OS2 $A2 ; os trap $A2 (unknown) - OS2 $A3 ; os trap $A3 (unknown) - OS2 $A4,HeapDispatch ; os trap $A4 (unknown) - OS2 $A5,VisRgnChanged ; os trap $A5 <26MAR90 KON> - OS2 $A6,vRMgrStdEntry ; vector $A6 (StdEntry in rmgr)<3.2> - OS2 $A7,vRMgrStdExit ; vector $A7 (StdExit in rmgr) <3.2> - OS2 $A8 ; os trap $A8 (unknown) - OS2 $A9 ; os trap $A9 (unknown) - OS2 $AA ; os trap $AA (unknown) - OS2 $AB ; os trap $AB (unknown) - OS2 $AC ; os trap $AC (unknown) - OS2 $AD,GestaltTrap ; os trap $AD (Gestalt) <1.9> - OS2 $AE ; os trap $AE (unknown) - -;------------------------------------------------------------------------------ -; end of OS traps, start of vectors -;------------------------------------------------------------------------------ -; WARNING -- DO NOT CHANGE THIS TABLE UNLESS YOU CHANGE THE CORRESPONDING OS TABLE! (ABOVE) -;------------------------------------------------------------------------------ - - OS2 $AF,vMtCheck ; vector $AF (HFS) - OS2 $B0,vCheckReMount ; vector $B0 (HFS) - OS2 $B1,vDtrmV2 ; vector $B1 (HFS) - OS2 $B2,vFindDrive ; vector $B2 (HFS) - OS2 $B3,vFClose ; vector $B3 (HFS) - OS2 $B4,vFlushMDB ; vector $B4 (HFS) - OS2 $B5,vGoDriver ; vector $B5 (iocore) - OS2 $B6,vWaitUntil ; vector $B6 (iocore) - OS2 $B7,vSyncWait ; vector $B7 (iocore) - - OS2 $B8,__SNDAPPDEAD ; vector $B8 - OS2 $B9,vDisPtch ; vector $B9 (deferred task) <2.2> - OS2 $BA,vIAZInit ; vector $BA <16jun87 CSL> - OS2 $BB,vIAZPostInit ; vector $BB <16jun87 CSL> - OS2 $BC,vLaunchInit ; vector $BC <16jun87 CSL> - OS2 $BD,vCacheFlush ; vector $BD <1.2> - OS2 $BE,AsyncPatch ; vector $BE - OS2 $BF,vLg2Phys ; vector $BF - OS2 $C0,vFLushCache ; vector $C0 - OS2 $C1,vGetBlock ; vector $C1 - OS2 $C2,vMarkBlock ; vector $C2 - OS2 $C3,vRelBlock ; vector $C3 - OS2 $C4,vTrashBlocks ; vector $C4 - OS2 $C5,vTrashVBlks ; vector $C5 - OS2 $C6,vCacheWrIP ; vector $C6 - OS2 $C7,vCacheRdIP ; vector $C7 - OS2 $C8,vBasicIO ; vector $C8 - OS2 $C9,vRdBlocks ; vector $C9 - OS2 $CA,vWrBlocks ; vector $CA - OS2 $CB,vSetUpTags ; vector $CB - OS2 $CC,vBTClose ; vector $CC - OS2 $CD,vBTDelete ; vector $CD - OS2 $CE,vBTFlush ; vector $CE - OS2 $CF,vBTGetRecord ; vector $CF - OS2 $D0,VBTINSERT ; vector $D0 - OS2 $D1,vBTOpen ; vector $D1 - OS2 $D2,vBTSEARCH ; vector $D2 - OS2 $D3,vBTUpdate ; vector $D3 - OS2 $D4,vGetNode ; vector $D4 - OS2 $D5,vRelNode ; vector $D5 - OS2 $D6,vAllocNode ; vector $D6 - OS2 $D7,vFreeNode ; vector $D7 - OS2 $D8,vExtBTFile ; vector $D8 - OS2 $D9,vDeallocFile ; vector $D9 - OS2 $DA,vExtendFile ; vector $DA - OS2 $DB,vTruncateFile ; vector $DB - OS2 $DC,vCMSetUp ; vector $DC - OS2 $DD,vppcDispatcher ; vector $DD (PPCDispatcher) - OS2 $DE,vDtrmV1 ; vector $DE - OS2 $DF,vBlkAlloc ; vector $DF - OS2 $E0,vBlkDeAlloc ; vector $E0 - OS2 $E1,vFileOpen ; vector $E1 - OS2 $E2,vPermssnChk ; vector $E2 - OS2 $E3,vFndFilName ; vector $E3 - OS2 $E4,vRfNCall ; vector $E4 - OS2 $E5,vAdjEOF ; vector $E5 - OS2 $E6,vPixel2Char ; vector $E6 - OS2 $E7,vChar2Pixel ; vector $E7 - OS2 $E8 ; vector $E8 (unknown) - OS2 $E9,vFileClose ; vector $E9 (dnf v2.6) - OS2 $EA,vFileRead ; vector $EA (dnf v2.6) - OS2 $EB,vFileWrite ; vector $EB (dnf v2.6) - OS2 $EC,DispatchHelper ; OS Trap $EC DispatchHelper <19> rb - OS2 $ED,VUPDALTMDB ; vector $ED <3.1> - OS2 $EE,vCkExtFS ; vector $EE - OS2 $EF,vDTrmV3 ; vector $EF - OS2 $F0,vBMChk ; vector $F0 - OS2 $F1,vTstMod ; vector $F1 - OS2 $F2,vLocCRec ; vector $F2 - OS2 $F3,vTreeSearch ; vector $F3 - OS2 $F4,vMapFBlock ; vector $F4 - OS2 $F5,vXFSearch ; vector $F5 - OS2 $F6,vReadBM ; vector $F6 - OS2 $F7,vDoEject ; vector $F7 - OS2 $F8,vSegStack ; vector $F8 - OS2 $F9,vSuperLoad ; vector $F9 - OS2 $FA,vCmpFrm ; vector $FA - OS2 $FB,vNewMap ; vector $FB - OS2 $FC,vCheckLoad ; vector $FC - OS2 $FD,XTrimMeasure ; vector $FD - OS2 $FE,XFindWord ; vector $FE - OS2 $FF,XFindLine ; vector $FF - -;------------------------------------------------------------------------------ -; BT: End second OS table macro -;------------------------------------------------------------------------------ - endif - END diff --git a/OS/EgretMgr.a b/OS/EgretMgr.a index 9d457f5..fbfdd62 100644 --- a/OS/EgretMgr.a +++ b/OS/EgretMgr.a @@ -231,7 +231,7 @@ ErrEgretInit equ $0030 ; TEMPORARY definition of error equate defined in STEQ WITH EgretGlobals,EgretPB,RespHeader ; <60> rb ;=============================================================================================== -; Routine: InitEgret +; Routine: InitEgret 9bb0 ; ; Function: Allocates globals, sets vACR to shift in mode, sets up globals for an auto-response ; packet (ADB/Ticks). @@ -243,7 +243,7 @@ ErrEgretInit equ $0030 ; TEMPORARY definition of error equate defined in STEQ ; Destroys: a0-a2, d0-d2 ;________________________________________________________________________________________________ InitEgretOrCuda - moveq.l #EgretGlobSize,D0 ; get size of globals + move.l #EgretGlobSize,D0 ; get size of globals _NewPtr ,SYS,CLEAR ; allocate space on heap and clear move.l a0,EgretBase ; save ptr to it @@ -264,16 +264,19 @@ InitEgretOrCuda movea.l VIA,a1 ; point to the VIA eieioSTP bclr.b #SRdir,vACR(a1) ; shift reg direction = input + nop eieioSTP move.b #(1< Rolled in from PatchIIciROM.a @@ -356,7 +363,7 @@ EgretDispatch ; When the shift register irq comes in call the PollProc ; then process the shift register irq data ; - movem.l d0/d1/a0-a4/a6,-(sp) ; save some registers + movem.l d0-d3/a0-a4/a6,-(sp) ; save some registers move.l sp,PollStack ; Pointer to buffer for polled bytes @@ -403,7 +410,7 @@ EgretDispatch beq.s @NoPollWait -@NoSCCData movem.l (sp)+,d0/d1/a0-a4/a6 ; restore work registers +@NoSCCData movem.l (sp)+,d0-d3/a0-a4/a6 ; restore work registers @VsrIrq eieioSTP @@ -411,8 +418,10 @@ EgretDispatch eieioSTP bne.s @accepted ; no, then it will accept our packet bclr.b #SRdir,vACR(a1) ; yes, switch back to input + nop eieioSTP bclr.b #sysSes,vBufB(a1) ; ack the abort + nop eieioSTP bsr CallShiftRegIRQ ; handle it eieioSTP @@ -460,6 +469,7 @@ EgretDispatch _________________________________________________________________________________________________ CheckPacket +; 9ce2 cmp.b #SpecialPkt,pbCmdType(a0) ; could be an ADB initialization packet beq.s @OkExit @@ -503,7 +513,7 @@ CheckPacket ; Destroys: d0,d1 ;________________________________________________________________________________________________ PollByte - +; 9d26 move.w sr,d0 ; get 68xxx interrupt mask andi.w #hiIntMask,d0 ; are we at interrupt level? beq.s @exit ; no, just exit @@ -529,19 +539,24 @@ PollByte ; Destroys: d1 ;________________________________________________________________________________________________ SendByte +; 9d3a eieioSTP bclr.b #viaFull,vBufB(a1) ; negate via full + nop eieioSTP bsr.s Delay100 ; give Egret time to see it eieioSTP move.b d0,vSR(a1) ; send the byte to the shift reg + nop eieioSTP bset.b #viaFull,vBufB(a1) ; let Egret know it's there + nop eieioSTP rts ;________________________________________________________________________________________________ CallShiftRegIRQ +; 9d50 movem.l a0-a3/d0-d3,-(sp) ; save regs like interrupt handler does movea.l Lvl1DT+8,a0 ; get the shift reg IRQ handler jsr (a0) ; call it @@ -550,15 +565,43 @@ CallShiftRegIRQ ;________________________________________________________________________________________________ viaFullAck +; 9d60 eieioSTP bset.b #viaFull,vBufB(a1) ; acknowlege the byte + nop eieioSTP bsr.s Delay100 ; give Egret time to see it eieioSTP rts ; gets cleared on exit from IRQ handler ;________________________________________________________________________________________________ +NewDelay100 +; 9d6a + tst.l $13e + beq.s Delay100 + + btst.b #0, $bfe + beq.s Delay100 + + MoveM.L D0-D3/A0-A4/A6, -(SP) + Move.L SP, (PollStack) + MoveA.L (SCCRd), A3 + Move (TimeSCCDB), D1 + LsR #$3, D1 + BTst.B #$0, $2(A3) + BEQ.B (* + $6) + Move.B $6(A3), -(SP) + DBF D1, (* + -$C) + Nop + CmpA.L (PollStack), SP + BEQ.B (* + $C) + Lea.L $6(A3), A6 + Jsr ([$13E]) + MoveM.L (SP)+, D0-D3/A0-A4/A6 + Rts + Delay100 +; 9db2 move.l d1,-(sp) ; save d1 move.w timeViaDB,d1 ; 1 ms loop count lsr.w #3,d1 ; / 8 = 125 us @@ -575,7 +618,7 @@ Delay100 rts ;________________________________________________________________________________________________ -; Routine: ShiftRegIRQ +; Routine: ShiftRegIRQ 9dc8 ; ; Function: This routine is called in response to a VIA shift reg interrupt. It will transfer ; the next byte in the current packet. When the packet is complete, the globals are @@ -598,10 +641,12 @@ ShiftRegIRQ eieioSTP btst.b #SRdir,vACR(a1) ; see if VIA direction is output + nop eieioSTP beq.s @input ; no, then we're receiving.. tst.b vSR(a1) ; clear the shift reg interrupt + nop eieioSTP tst.w sendHdrCnt(a2) ; any bytes left in header? ble.s @ckSendData ; no, see if any send bytes left... @@ -627,10 +672,12 @@ ShiftRegIRQ eieioSTP bclr.b #SRdir,vACR(a1) ; now switch to input + nop @sendCmd eieioSTP andi.b #~((1< @@ -639,6 +686,7 @@ ShiftRegIRQ @input ;----------------------------------------------------------------------------- eieioSTP move.b vSR(a1),d0 ; read the byte from shift reg into D0 + nop eieioSTP tst.w rcvHdrCnt(a2) ; any bytes left in response packet header? ble.s @ckRcvData ; if not then must be data byte @@ -663,6 +711,7 @@ ShiftRegIRQ eieioSTP bne.s @done ; yes, we're through... bset.b #sysSes,vBufB(a1) ; make sure System Session is asserted <5> + nop eieioSTP bra @exitRd ; not done with header yet... exit @@ -679,6 +728,7 @@ ShiftRegIRQ bsr.s viaFullAck ; acknowlege the byte using via full <8> eieioSTP bclr.b #sysSes,vBufB(a1) ; yes, let Egret know we don't want more <8> + nop @wait eieioSTP btst.b #xcvrSes,vBufB(a1) ; wait for egret to acknowledge termination <8> @@ -717,10 +767,12 @@ ShiftRegIRQ @done eieioSTP bclr.b #viaFull,vBufB(a1) ; make sure via full is low + nop eieioSTP bclr.b #sysSes,vBufB(a1) ; let Egret know we're done + nop eieioSTP - bsr delay100 ; Give Egret time to see transitions & Poll SCC <13> + bsr newdelay100 ; Give Egret time to see transitions & Poll SCC <13> movea.l curPb(a2),a0 ; a0 points to current param block lea rcvHeader(a2),a1 ; a1 points to header buffer <11> @@ -864,6 +916,7 @@ ShiftRegIRQ @exitRd eieioSTP bclr.b #viaFull,vBufB(a1) ; make sure via full is low + nop eieioSTP move.w d3,sr ; restore interrupts @exit rts @@ -872,7 +925,7 @@ ShiftRegIRQ ;________________________________________________________________________________________________ -; Routine: SetTransferParams +; Routine: SetTransferParams 9fee ; ; Function: This routine sets up transmit/receive ptrs (globals) for the packet pointed to by A0, ; for use by the Shift Reg interrupt handler. @@ -984,7 +1037,7 @@ SetTransferParams rts ;________________________________________________________________________________________________ -; Routine: SetResponseParams +; Routine: SetResponseParams a0ac ; ; Function: This routine sets up transmit/receive ptrs (globals) for an auto response packet ; (e.g. ticks, ADB autopoll data), for use by the Shift Reg interrupt handler. @@ -1015,7 +1068,7 @@ SetResponseParams ; put back function banner ;________________________________________________________________________________________________ -; Routine: tickHandler +; Routine: tickHandler a0da ; ; Function: This is the completion routine for tick response packets. ; @@ -1093,6 +1146,7 @@ TickHandler ;________________________________________________________________________________________________ PseudoCntTable +; a0f8 dc.b $00, $00 ; 00 NoOperation send 0 bytes, receive 0 data bytes dc.b $01, $00 ; 01 StartStopAutopoll send 1 byte, receive 0 data bytes dc.b $02, $FF ; 02 Read6805 send 2 bytes, receive n data bytes @@ -1132,9 +1186,12 @@ PseudoCntTable dc.b $00, $00 ; 22 RdWrIIC send n bytes, receive n data bytes [rbm] dc.b $01, $00 ; 23 Set WakeUpMode send 1 bytes, receive 0 data bytes rb dc.b $01, $00 ; 24 Tickle PDM Timer send 1 bytes, receive 0 data bytes rb + dc.b $00, $00 + dc.b $01, $00 ADBCntTable +; a142 dc.b $00, $00 ; 0000 SendReset send 0 bytes, receive 0 data bytes dc.b $00, $00 ; 0001 Flush send 0 bytes, receive 0 data bytes dc.b $00, $00 ; 0010 send 0 bytes, receive 0 data bytes @@ -1158,669 +1215,8 @@ ADBCntTable Eject -;========================================================================= -; Routines: EgretInit -; -; This routine sends a NOP/WarmStart command to Egret. This routine is -; called early during rom Startup to stop autopoll and 1 sec irq. Also, -; the routine will issue a Send DFAC command to Egret to initialize the -; the DFAC hardware to a known state. The routine does not use ANY -; memory it is register driven only. -; -; NOTE: This routine actually sends a STOP AUTO POLL, SET ONE SECOND -; INTERRUPT MODE 0 call and a SEND DFAC command to Egret. -; The Stop Autopoll and set one second interrupt modes calls will -; be changed to a single NOP/WarmStart when Egret 3 becomes -; available (S/B 4/6/90). -; -; Inputs: NONE -; -; Outputs: NONE -; -; Destroys: D0, D1, D2, D3, A1, A5, A6, A4 (Egret 2 implementation) -; Destroys: D0, D3, A1, A5, A6 (Egret 3 implementation) -; -; NOTE: This routine is called via a BSR6 and returns via a RTS6 -;------------------------------------------------------------------------- - EXPORT EgretInit - -EgretInit movea.l DecoderInfo.VIA1Addr(a0),a1 ; get VIA 1 base address - eieioSTP - bclr.b #vSyssesbit,vBufB(a1) ; kill any pending transactions <8> <13> - eieioSTP - bclr.b #vViafullbit,vBufB(a1) ; <8> <13> - eieioSTP - moveq #$28,d0 ; we want to delay 4 millisecs -@killtime bsr5 delay100us ; in 100 usec increments - dbra d0,@killtime - move.l a6,a4 ; save the return address - - if rayFix then -; -; Send the Stop autopoll pseudo command -; - move.l #(APoll << 16) + PseudoPkt,d0 ; first command to send is Stop Auto Poll - moveq #0,d1 ; sending one byte of data $00 = stop autopoll - moveq #1,d2 - bsr6 SendEgretCmd ; send the command to Egret - tst.w d0 ; check for an error - bne.s @exit ; failed to send the command (hang timeout expired) -; -; Send the mode 0 1 second interrupt pseudo command -; - move.l #(Wr1SecMode << 16) + PseudoPkt,d0 ; mode 0 1 sec interrupts (stop 1 second irq) - moveq #0,d1 ; sending one byte of data - moveq #1,d2 - bsr6 SendEgretCmd ; send the command to Egret - tst.w d0 ; negative if error - bne.s @exit ; failed to send the command (hang timeout expired) - - else -; -; Send the NOP/WarmStart command -; - move.w #NopCmd,d0 ; Nop/WarmStart stops autopoll and 1 sec irq - swap d0 ; packet type Pseudo - move.w #pseudopkt,d0 - moveq #0,d2 ; no data to send - bsr6 SendEgretCmd ; send the command to Egret - tst.w d0 ; nonzero if error - bne.s @exit ; failed to send the command (hang timeout expired) - - endif - -; -; Send Elsie/Erickson initial DFAC setting -; - with ProductInfo - - moveq #0,d2 ; force full scan of hardware features <10> - bsr6 GetHardwareInfo ; get the ProductInfo Record <9> - btst.b #v8chipbit,ExtValid+3(a1) ; See if system has a VISA chip (bit7)<9><10> - beq.s @Erickson ; 0 = No Visa (Erickson) 1 = Visa (Elsie) <9> - - move.l #ElsieDFAC,d1 ; Assume running on Erickson (Not Elsie) <9> - bra.s @sendit - -@Erickson move.l #EricksonDFAC,d1 ; Erickson DFAC setting <9> -@sendit move.l #(WrDFAC << 16) + PseudoPkt,d0 ; Send DFAC command - moveq #1,d2 ; One byte to send - bsr6 SendEgretCmd ; send the command to Egret - tst.w d0 ; negative if error -@exit move.l a4,a6 ; restore return address - rts6 ; return to the caller - - endwith - - eject -************************************************************************************************************ -* SendEgretCmd: This register based routine will send up to four bytes of data to Egret. The -* packet type, command, byte count and data are passed in registers. The routine -* will return with d0.w = $0000 if it sent the command successfully. A value of -* $FFFF signifies that the command did not get through. The system and Egret hung -* and the system aborted the transaction. -* -* WARNING: This routine will not error check the transaction requested. It is the responsibility of -* WARNING: the caller to make sure that the packet type, command, data and data byte count are valid -* WARNING: for the transaction requested. Failure to follow the rules will make this routine fail and -* WARNING: CRASH the system. -* -* Input: -* a0.l Pointer to Base address table -* -* d0.l = High word PACKET Command -* Low word PACKET Type -* -* d1.l = Up to four bytes of data to send -* Long word data byte assigment = byte 4, byte 3, byte 2, byte 1 -* Byte 1 sent out first -* -* d2.l = Byte count to send. (0-4 bytes) -* Byte count > 4 will send four bytes only -* -* Output: d0.w $0000 if call succeeded, Nonzero if failed -* -* d1.l high word = flags, low word packet type returned by Egret -* -* Destroys: D2.l, D3.l, D4.l, A5.l, A4.l, A1.l -* -************************************************************************************************************ - - Export SendEgretCmd -SendEgretCmd - movea.l DecoderInfo.VIA1Addr(a0),a1 ; get VIA 1 base address rb, start - move.l #((MaxTout<<16) OR MaxRetries),d4 ; number of retries before giving up with Egret <13> - bsr5 Delay100us - eieioSTP - btst.b #vsysSesBit,vBufB(a1) ; check for a transaction in progress - eieioSTP - beq.s @AllOK - -@Timeout - eieioSTP - bclr.b #vsysSesBit,vBufB(a1) ; kill the rest of the transaction <8> - eieioSTP - bclr.b #vViaFullBit,vBufB(a1) ; <8> - eieioSTP - bsr5 Delay100us ; in progretss <8> - bsr5 Delay100us ; <8> - -@AllOK swap.w d4 ; timeout in low word of d4 Retry count in high word <13> - eieioSTP - btst.b #vxcvrSesBit,vBufB(a1) ; check for abort pending - eieioSTP - beq IrqMissed ; MIssed Vsr Irq because of INITVIAS - bset #vsysSesBit,vBufB(a1) ; assert sysSesBit - eieioSTP - bsr5 @SendPtype ; send the packet type - beq RealAbort ; Discard Aborting transaction rb, end -; -; If not abort transaction in progress then send the command byte -; - swap d0 - bsr5 sendByte1 ; send the command byte - bsr5 delay100us ; give Egret time to see viaEmpty -; -; Now send number of bytes contained in d1 based on -; byte count contained in d2.w -; - move.l d1,d0 ; get the data to send - subq #1,d2 ; adjust for DBRA - cmp.w #3,d2 ; if count out of range quit - bhi.s @EndCmd ; if count valid then adjust for dbra -@sendloop bsr5 sendByte1 - bsr5 delay100us - lsr.l #8,d0 ; move data byte to low byte of register -@loopEntry dbra d2,@sendloop ; decrement byte count -; -; Wait for the response packet header -; -@EndCmd - eieioSTP - bclr.b #SRdir,vACR(a1) ; shift in - eieioSTP - bclr.b #vSyssesbit,vBufB(a1) ; negate vSyssesbit - eieioSTP - bsr5 Delay100us -; -; Now receive the Standard Response packet Header -; - bsr5 readAttn ; get the Attention byte - eieioSTP - bsr5 Delay100us - eieioSTP - bset.b #vSyssesbit,vBufB(a1) ; assert vSyssesbit - eieioSTP - bsr5 readByte ; get the packet type - and #$00FF,d0 ; keep low byte only - swap d0 ; save the packet type - bsr5 readByte ; get the flags byte - and.w #$00FF,d0 ; keep low byte only - swap d0 ; keep the flags byte as an error code - exg d0,d1 ; save the packet type and flags returned - bsr5 readByte ; get the command - eieioSTP - bclr.b #vSyssesbit,vBufB(a1) ; negate vSyssesbit - eieioSTP - bsr5 Delay100us -; -; Check for an error packet returned by Egret -; - move.l d1,d0 ; save the packet type and flags - cmp.b #errorpkt,d0 ; check for error packet - beq.s @Exit ; error pkt then just exit - sub.w d0,d0 ; zero for success -@exit rts6 - ;-------------------------------------------------------------------------- -@SendPtype ; <2> - eieioSTP - bset.b #SRdir,vACR(a1) ; shift out - eieioSTP - btst.b #vXcvrsesbit,vbufB(a1) ; check for abort - eieioSTP - beq.s @AbortReq ; go away if abort requested - move.b d0,vSR(a1) ; load byte into shift reg - eieioSTP - bset.b #vViafullbit,vBufB(a1) ; indicate shift reg is full - eieioSTP -; -; Check Vsr Irq until timeout. If timeout then check the retry count -; and Call Death Chimes if Retry count exausted. -; -@PollDelay - eieioSTP - btst.b #ifSR,vIFR(a1) ; wait for shift to complete - eieioSTP - bne.s @VsrIrq ; Go service Shift register Irq <13> - dbra.w d4,@PollDelay ; try again if timed out <13> rb - move.w #MaxTout,d4 ; Reset the Timeout <13> rb - swap.w d4 ; get the Retry count <13> rb - subq.w #1,d4 ; Try again if Retry count not Exausted <13> rb - beq.s @Timeout ; <13> - -@DeadEgret move.w #ErrEgretInit,d7 ; Egret failed <13> - move.l #0001,d6 ; d6.l must be nonzero <13> - bigjmp Error1Handler,a3 ; Play death chimes <13> - -@VsrIrq - eieioSTP - tst.b vSR(a1) ; clear the interrupt - eieioSTP - bclr.b #vViafullbit,vBufB(a1) ; now indicate shift reg empty - eieioSTP -; -; Delay 100 usec -; - move.w #DelayCnt,d3 -@wait20 - eieioSTP - tst.b (a1) ; sync to VIA clock - eieioSTP - dbra d3,@wait20 ; delay at least 100 us (very rough) - eieioSTP - btst.b #vXcvrsesbit,vbufB(a1) ; check for abort - eieioSTP -@AbortReq rts5 - -;-------------------------------------------------------------------------- -; DumpAbort This routine will read all the data for an abort transaction and -; discard it. When done it will jump back to SendNopCmd entry point -; to retry our command. This command will eventually complete... - -RealAbort - eieioSTP - bclr.b #vSyssesbit,vBufB(a1) ; deassert system session - eieioSTP -IrqMissed bsr5 Delay100us ; Let Egret see SysSes. ³ 125µsec - eieioSTP - bclr.b #SRdir,vACR(a1) ; shift in - eieioSTP - tst.b vSR(a1) ; discard the byte - eieioSTP - bset #vSyssesbit,vBufB(a1) ; assert vSyssesbit - eieioSTP - -DumpAbort - - eieioSTP - bclr #vViafullbit,vBufB(a1) ; then negate VIA full bit - eieioSTP - -@loop - eieioSTP - btst.b #ifSR,vIFR(a1) ; wait for shift to complete - eieioSTP - beq.s @loop - bset.b #vViafullbit,vBufB(a1) ; acknowlege byte - eieioSTP - tst.b vSR(a1) ; discard the byte - eieioSTP -; -; Delay 100 usec -; - move.w #DelayCnt,d3 -@wait - eieioSTP - tst.b (a1) ; sync to VIA clock - dbra d3,@wait ; delay at least 100 us (very rough) - eieioSTP - btst.b #vXcvrsesbit,vBufB(a1) ; check for last byte - eieioSTP - beq.s DumpAbort ; Clock Tick Packets only 2 bytes -; -; Last byte was read -; - bclr #vViafullbit,vBufB(a1) ; then negate VIA full bit - eieioSTP - bclr.b #vSyssesbit,vBufB(a1) ; negate vSyssesbit - eieioSTP - bsr5 Delay100us ; delay 200 usec - bra.s SendEgretCmd ; go try sending our command again - -;-------------------------------------------------------------------------- -sendByte1 ; <2> - eieioSTP - bset.b #SRdir,vACR(a1) ; shift out - eieioSTP - move.b d0,vSR(a1) ; load byte into shift reg - eieioSTP - bset.b #vViafullbit,vBufB(a1) ; indicate shift reg is full - eieioSTP -@poll - eieioSTP - btst.b #ifSR,vIFR(a1) ; wait for shift to complete - eieioSTP - beq.s @poll - tst.b vSR(a1) ; clear the interrupt - eieioSTP - bclr.b #vViafullbit,vBufB(a1) ; now indicate shift reg empty - eieioSTP - rts5 - -;-------------------------------------------------------------------------- -readByte - eieioSTP - btst.b #ifSR,vIFR(a1) ; wait for shift to complete - eieioSTP - beq.s readByte - bset.b #vViafullbit,vBufB(a1) ; Tell Egret we saw the byte - eieioSTP - move.b vSR(a1),d0 ; read the byte -; -; Delay 100 usec -; - eieioSTP - move.w #DelayCnt,d3 -@wait - eieioSTP - tst.b (a1) ; sync to VIA clock - eieioSTP - dbra d3,@wait ; delay at least 100 us (very rough) - eieioSTP - bclr #vViafullbit,vBufB(a1) ; then negate VIA full bit - eieioSTP - rts5 - -;-------------------------------------------------------------------------- -readAttn - eieioSTP - - btst.b #ifSR,vIFR(a1) ; wait for shift to complete - eieioSTP - beq.s readAttn - eieioSTP - tst.b vSR(a1) ; clear the interrupt - eieioSTP - rts5 - -;-------------------------------------------------------------------------- -delay100us - move.w #DelayCnt,d3 -; add.w d3,d3 ; let's make it even rougher -@wait - eieioSTP - tst.b (a1) ; sync to VIA clock - eieioSTP - dbra d3,@wait ; delay at least 100 us (very rough) - eieioSTP - rts5 - -;_______________________________________________________________________ -; -; Routine: EclipsePDMPatch -; -; Desc: Patch for ECLIPSE PowerDown Messsage Handler Install -; and PowerDown Message Enable -;_______________________________________________________________________ - - EXPORT EclipsePDMPatch -EclipsePDMPatch - WITH EgretPB -; -; Initialize the Eclipse PowerDown Message handler. -; - movem.l a0-a1,-(sp) ; work registers - suba.l #EgretPbSize,sp ; make room for PB - move.l sp,a0 ; point a0 to pbBuffer - move.w #(PDMVectPkt << 8),pbCmdType(a0); InitPDM Vector Packet (Cmd ignored) - clr.l pbCompletion(a0) ; No Completion - lea KeySwitchHandler,a1 ; address of keyswitch sense handling - move.l a1,PbParam(a0) - _EgretDispatch - -; ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ -; We don't want to enable messages where we set up the Power Down Message Handler. This is because -; up until the time a system is located to boot from, when the user turns the keyswitch OFF, there -; are no files to flush, no volumes to unmount and Caboose can safely turn the machine off with us -; getting in the way. Once we get a system loaded, we'll enable Power Down Messages with the other -; routine, EclipsePDEPatch() (see below). -; ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ - -; We need to allocate a TimeMgr TMTask record that we can use once we enable power down messages so -; we can power the machine down even if UnMounts fail or hang. ExpandMemRec has JUST been initialized -; when this patch gets called, so this is safe to do. - - WITH ExpandMemRec - - movea.l expandMem,a1 ; get base of ExpandMemRec - moveq.l #(tmQSize+dtQElSize),d0 ; request a TimeMgr TMTask+Deferred Task-sized record in SysHeap - _NewPtr ,SYS,CLEAR ; - move.l a0,emKeyTMTaskPtr(a1) ; save pointer to TMTask record in ExpandMemRec - ENDWITH - adda.l #EgretPbSize,sp ; discard the parameter block - movem.l (sp)+,a0-a1 ; restore registers -@EgretDone - - rts ; Return to Caller - -;_______________________________________________________________________ -; -; Eclipse Keyswitch Handler -; ------------------------- -; -; This routines either -; (1) turns off Eclipse, or -; (2) catches and ignores keyswitch changes interrupts -; from Caboose, since we look directly at the keyswitch -; position values on VIA2[PB][v2Keyswitch] or [v2PowerOff]. -; -; As of DVT hardware, the values of these keyswitch positions -; should be available on VIA2 and no longer need to be maintained -; in SW. -;_______________________________________________________________________ -; -; PowerDown Message Handler -; - export KeySwitchHandler ; - import EgretPowerOff ; from EgretPatches.a - -KeySwitchHandler ; Handler of Power Down / Keyswitch Sense messages - -; Caboose sends a message whenever the keyswitch sense changes. thru next -; -; Input: D0.B Keyswitch position -; -; 0 OFF -; 1 Secure -; 2 Insecure or ON ("normal") -; - - tst.b d0 ; check for PowerOff message - bne.s @rts ; IF Message == PowerDOWN THEN - - movem.l a0-a1,-(sp) ; save A0, A1 thru next - -; First, install a time manager task that will forcefull shut us down in 5 seconds. That way, -; in case something goes wrong with the deferred task, we will shut off anyway. - - WITH ExpandMemRec - - movea.l expandMem,a1 ; get base address of ExpandMemRec - movea.l emKeyTMTaskPtr(a1),a0 ; retrieve "final" Time Mgr queue element - movea.l a0,a1 ; use A1 to clear the record - moveq.l #((tmQSize+dtQElSize)/2)-1,d0 ; clear the TimeMgr+DeferredTask queue elements -@clrRec clr.w (a1)+ ; just in case someone has crapped them up - dbra d0,@clrRec - lea PullThePlug,a1 ; get address of where to go when timer expires - move.l a1,tmAddr(a0) ; tell the TimeMgr about it - _InsTime ; go install the Turn Off The Power Time Mgr task - move.l #(5*1000),d0 ; set timeout to be 5 SECONDS - _PrimeTime ; activate the task - -; Now install the Deferred Task that will attempt to unmount all mounted volumes. -; -; The ExpandMemRec Ptr points at an area that is tmQSize+dtQSize bytes big. -; -; Initialize the Deferred Task queue element to point at our Unmount Volumes Deferred Task. - - adda.w #tmQSize,a0 ; move A0 to point at the Deferred Task Queue Element - move.w #dtQType,dtType(a0) ; and initialize the record - lea EclipseAdios,a1 - move.l a1,dtAddr(a0) - jsr ([jDTInstall]) ; go install our Unmount and Shutdown deferred task - movem.l (sp)+,a0-a1 ; restore A0, A1 - tst.w d0 ; see whether or not deferred task install was done - bne.s PullThePlug ; if it failed, shut down RIGHT NOW -@rts rts ; if it was successful, return to the int. handler - - ENDWITH - -;_______________________________________________________________________ -; -; Routine: EclipseAdios -; -; Desc: Deferred Task installed when the keyswitch is turned -; to the OFF position. This attempts to Unmount all -; volumes. Once that attempt has been made, the system -; is powered down. -; -; Inputs: None. -; Returns: None. -; Trashes: The System. Power to Eclipse is turned off. G'night. -; -;_______________________________________________________________________ - -EclipseAdios - -; Try and unmount any mounted volumes before we power down. - - move.l VCBQHdr+qHead,a1 ; Start at the head of the VCBQ - bra.s @checkVCB ; Check if valid -@UMloop - tst.w vcbFSID(a1) ; Make sure itÕs FSID = 0 - bne.s @nextQEntry ; ... i.e. not a server - -; Try to unmount the volume. - - sub.w #ioQElSize,a7 ; get an I/O param block - movea.l a7,a0 - - move.w vcbVRefNum(a1),ioVRefNum(a0) ; stuff VCB VRefNum into PB - move.l #0,ioFileName(a0) - move.l #0,ioCompletion(a0) ; no completion routine - move.l a1,-(sp) ; save A1 (queue link ptr) - _HUnmountVol ; attempt to forcefully unmount volume - movea.l (sp)+,a1 ; restore A1 - adda.w #ioQElSize,a7 ; get rid of PB. we'll reallocate the PB if needed - -@nextQEntry movea.l qLink(a1),a1 ; get next queue entry -@checkVCB move.l a1,d0 ; at EOQ yet? - bne.s @UMloop ; nope, try this one - -PullThePlug ; ENDIF - bsr.l EgretPowerOff ; power junkies go into sudden withdrawl - bra.s PullThePlug ; with no hope of recovery - -;_______________________________________________________________________ -; -; Routine: EclipseDFACPatch -; -; Desc: Patch for ECLIPSE send default DFAC Messsage -;_______________________________________________________________________ - EXPORT EclipseDFACPatch - -EclipseDFACPatch -; -; Build a Parameter block for the default DFAC message -; - movem.l a0-a1,-(sp) ; work register - suba.l #EgretPbSize,sp ; make room for PB - move.l sp,a0 ; point a0 to pbBuffer - move.w #(pseudoPkt << 8) \ - + SetDefDFAC,pbCmdType(a0) ; InitPDM Vector Packet (Cmd ignored) - clr.l pbCompletion(a0) ; No Completion -; -; Build the DFAC message issue the call and clean up -; - move.w #$0100,-(sp) ; byte count and one DFAC byte in buffer - move.l sp,pbBufPtr(a0) ; Buffer pointer - move.w #$0002,pbByteCnt(a0) ; byte count includes the byte count byte in the buffer - _EgretDispatch - adda.l #EgretPbSize+2,sp ; discard the parameter block and data buffer - movem.l (sp)+,a0-a1 -@EgretDone - rts ; Return to Caller - -;_______________________________________________________________________ thru next -; -; Routine: DebugUtilRunKbdPatch -; -; Desc: Checks to see if the machine we're running on has a -; keyswitch, and if so, if it's in the OFF position. -; If so, then we probably don't have any choice as to -; whether volumes can be flushed and unmounted, so we -; go directly to the PowerOff routine. Do not pass Go, -; do not collect $200. (is that 200 hex dollars?) -; -; NOTE: This handles both the DebugEnter _and_ DebugPoll cases. -;_______________________________________________________________________ - - EXPORT DebugUtilRunKbdPatch ; provide address to InterruptHandlers.and anyone else -DebugUtilRunKbdPatch - - TestFor KeyswCabooseBit ; do we have a caboose? <21> - beq.s @justDoIt ; nope <21> - -; If you made it here, you're a Caboose-flavor keyswitch. -; -; VIA2 has v2PowerOff and v2Keyswitch (SECURE mode) wired, with 0=TRUE. - - move.l a1,-(sp) ; save A1 temporarily - movea.l VIA2RBV,a1 ; retrieve address of VIA2 - eieioSTP - btst.b #v2PowerOff,VBufB(a1) ; is the keyswitch OFF? - eieioSTP - move.l (sp)+,a1 ; restore A1 - beq.s @powerOff ; IF Keyswitch != OFF THEN -@justDoIt - bra DebugPwrMgrADBPatch2 ; check for PowerMgr stuff -@powerOff ; ELSE - bra.s PullThePlug ; administer the death blow - -DebugPwrMgrADBPatch2 - TestFor hwCbPwrMgr ; see if we have a power manager - beq.s @noPmgrADB ; if not, skip it - - movea.l VIA,a1 ; point to the VIA - movea.l Lvl1DT+(ifCB1*4),a0 ; get the handler address - jsr (a0) ; call the interrupt handler - addq.l #4,SP ; clean up stack from bsr - movem.l (sp)+,d3/a3 ; restore registers - rts -@noPmgrADB - rts - -;_______________________________________________________________________ -; -; Routine: EgretDFACandPDM formerly: EclipseEgretPatches -; -; Desc: Calls egret patches for Eclipse with Caboose, keyswitch -; Calls Egret patches for Anyone with Cuda, SoftPower Off -;_______________________________________________________________________ - - EXPORT EgretDFACandPDM - IMPORT CudaPDMPatch - -EgretDFACandPDM - - move.l #EgretFWMask, d0 ; get productInfo record mask for Egret FW - and.l UnivRomFlags,d0 ; isolate the field - sub.l #Caboose,d0 ; Do we have an Egret/Caboose? - bne.s @Done ; -> Nope. Don't do nothing! - - ; Instead of calling EclipseDFACPatch, this should more generally initialize DFAC - ; for all machines that care about it (or even if we don't but it needs it anyway). - ; -- bg/djw, 12/6/90 - -@EgretCaboose - bsr EclipseDFACPatch ; call the Eclipse DFAC control patch - bsr EclipsePDMPatch ; call the Eclipse keyswitch/PowerDown Msgs patch -@Done rts ; Return to Caller - - -;-------------------------------------------------------------------------- -;ChkFirmware +;ChkFirmware a166 ; ; This routine will determine if the Egret Chip is using Egret 8 or Caboose ; firmware or the new Cuda firmware. Based on this result, the IRQ handler, @@ -1837,16 +1233,6 @@ EgretDFACandPDM ChkFirmware ; movem.l a2/d0-d2, -(sp) ; preserve used regs - move.l #EgretFWMask,d0 ; mask for EgretFW - and.l UnivRomFlags,d0 ; isolate the field - sub.l #Egret8,d0 ; see if we have EgretFW - beq.s @haveEgret ; set Zero flag, exit - - ; If we dont have Egret FW, we still might have an Caboose FW - - sub.l #Egret8,d0 ; see if we have CabooseFW - beq.s @haveCaboose ; if we do, chk for Cuda - @haveCuda ; biglea CudaDispatch, a0 ; Cuda FW dispatcher move.l #$92,d0 ; set $92 trap @@ -1854,210 +1240,80 @@ ChkFirmware ; biglea CudaShiftRegIRQ,a0 ; stuff Cuda IRQ handler in biglea CudaTickHandler,a1 ; stuff Cuda tick handler in - bra.s @chkDone ; -@haveEgret -@haveCaboose - lea EgretDispatch, a0 ; Egret FW dispatcher - move.l #$92,d0 ; set $92 trap - _SetTrapAddress ,NEWOS ; - ; - lea ShiftRegIRQ,a0 ; stuff Egret IRQ handler in - lea tickHandler,a1 ; stuff Egret tick handler in @chkDone movem.l (sp)+, a2/d0-d2 ; restore used regs rts - -;-------------------------------------------------------------------------- -;SendEgretCmdPatch -; -; This routine will determine if the Egret Chip is using Egret 8 or Caboose -; firmware or the new Cuda firmware. From the firmware type, determine what -; routine to use, SendEgretCmd for Egret or Caboose, and SendCudaCmd for Cuda -; -; NOTE: This routine is REGISTER based, there isn't a stack -; SendEgretCmd is called via BSR6, so must Preserve A6, as the return address -; SendEgretCmdPatch is called via a BSR5 return is in A5 -; Input: -; a0.l Pointer to Base address table -; -; d0.l = High word PACKET Command -; Low word PACKET Type -; -; d1.l = Up to four bytes of data to send -; Long word data byte assigment = byte 4, byte 3, byte 2, byte 1 -; Byte 1 sent out first -; -; d2.l = Byte count to send. (0-4 bytes) -; Byte count > 4 will send four bytes only -; -;-------------------------------------------------------------------------- - -SendEgretCmdPatch - move.l a5, a3 ; preserve patch return addr - move.l a6, a4 ; preserve EgretInit rtn addr - bigbsr6 GetHardwareInfo,a1 ; - move.l a4, a6 ; restore EgretInitrtn addr - move.l a3, a5 ; restore patch rtn addr - moveq.l #ProductInfo.ADBMask,d0 ;mask for ADB kind <23> - and.l d1,d0 ;isolate the field <23> - subq.l #ProductInfo.ADBEgret,d0 ;see if we have Egret ADB <23> - - and.l #EgretFWMask,d4 ; isolate the field - sub.l #Egret8,d4 ; see if we have Egret8 FW - beq.s @patchdone ; if we do, zero flag set -; -; If we dont have Egret FW, we still might have an Caboose -; - sub.l #Egret8,d1 ; see if we have Caboose FW -@haveEgret ; if we do, zero flag set - beq.s @patchdone ; its Egret or Caboose, just exit... -@haveCuda ; - bigjmp SendCudaCmd,a3 ; jump to Cuda Send routine -@patchdone ; - movea.l DecoderInfo.VIA1Addr(a0),a1 ; get VIA 1 base address - move.l #((MaxTout<<16) OR MaxRetries),d4 ; number of retries before giving up with Egret <13> - rts5 - -;-------------------------------------------------------------------------- -;EgretInitPatch -; -; This routine will determine if the Egret Chip is using Egret 8 or Caboose -; firmware or the new Cuda firmware. From the firmware type, determine what -; routine to use, EgretInit for Egret or Caboose, and CudaInit for Cuda -; -; NOTE: This routine is REGISTER based, there isn't a stack -; EgretInit is called via BSR6, so must Preserve A6, as the return address -; EgretInitPatch is called via a BSR5 return is in A5 -; -EgretInitPatch ; - move.l a5, a3 ; preserve patch return addr - move.l a6, a4 ; preserve EgretInit rtn addr - bigbsr6 GetHardwareInfo,a1 ; - move.l a4, a6 ; restore EgretInitrtn addr - move.l a3, a5 ; restore patch rtn addr - - and.l #EgretFWMask,d1 ; isolate the field - sub.l #Egret8,d1 ; see if we have Egret8 FW - beq.s @patchdone ; if we do, zero flag set -; -; If we dont have Egret FW, we still might have an Caboose -; - sub.l #Egret8,d1 ; see if we have Caboose FW -@haveEgret ; if we do, zero flag set - beq.s @patchdone ; its Egret or Caboose, just exit... -@haveCuda ; - bigjmp CudaInit,a3 ; jump to CudaInit routine in CudaMgr.a -@patchdone ; - movea.l DecoderInfo.VIA1Addr(a0),a1 ; get VIA 1 base address - eieioSTP - bclr.b #vsysSesBit,vBufB(a1) ; kill any pending transactions <8> <13> - eieioSTP - bclr.b #vViaFullBit,vBufB(a1) ; <8> <13> - eieioSTP - rts5 - -TerrorEgret - - IMPORT ExplicitRequestDone, ImplicitRequestDone -;_______________________________________________________________________ -; -; Routine: StartReqEgret -; Inputs: D2 - length of transmit buffer data -; D3 - command byte / implicit flag (bit 31) -; A2 - pointer to buffer containing transmit data -; A3 - pointer to ADBBase -; -; Outputs: A3 - pointer to ADBBase -; -; Destroys: A0-A2/D0-D2 -; Calls: exits through _EgretDispatch -; -; Function: Sends an ADB request to the Egret, and asynchronously waits for a reply. -; -;_______________________________________________________________________ - - with ADBVars,EgretPB - - -jEgretDispatch equ OSTable+($92*4) ; OS trap table entry for _EgretDispatch - -StartReqEgret - tst.l d3 ; see if explicit/implicit - bmi.s @implicit ; if implicit, we generally don't need to do anything - -;_______________________________________________________________________ -; Process Explicit Requests - -@explicit bset.b #fDBExpRunning,fDBAuFlag(a3); explicit command starting, exclude new ones - bne.s @ignoreExplicit ; if already in progress, don't run it twice - move.b d3,ExplicitEPB.pbCmd(a3) ; setup the ADB command - move.w d2,ExplicitEPB.pbByteCnt(a3); setup byte count - move.l a2,ExplicitEPB.pbBufPtr(a3) ; setup buffer pointer - - bset.b #fDBExpInited,fDBAuFlag(a3) ; see if explicit command initialization has occured - bne.s @expInited ; if already inited, no need to change anything - - lea @ExplicitCompleted,a0 ; explicit request completion routine address - move.l a0,ExplicitEPB.pbCompletion(a3) ; setup buffer pointer - - lea ImplicitEPB(a3),a0 ; point to the param block used to wait for autopoll data - clr.l pbCompletion(a0) ; remove the handler - bsr.s @SendToEgret ; remove the auto poll handler - - move.l #(pseudoPkt<<24)\ ; pcCmdType := pseudoPkt - +(aPoll<<16)\ ; pbCmd := aPoll - +($00<<8),d0 ; pbParam := $00 (only high byte is used) - bsr.s @syncReq ; send command to stop auto polling -@expInited - - lea ExplicitEPB(a3),a0 ; point to the param block -@SendToEgret - moveq.l #0,d1 ; zero the trapword flag bits (in case they ever get used) - movea.l jEgretDispatch,a2 ; get the OSTrap table entry - jmp (a2) ; _EgretDispatch, issue the request (asynchronously), return - - -;_______________________________________________________________________ -; Process Implicit Requests - -@implicit btst.b #fDBInit,fDBFlag(a3); see if initialization is happening - bne.s @impDone ; if so, implicit commands are ignored - bset.b #fDBImpInited,fDBAuFlag(a3) ; see if implicit command initialization has occured - beq.s @InitImplicit ; if not inited, do initialization to allow autopolling -@ignoreExplicit -@impDone rts ; auto-polling/srq data will arrive unsolicited from now on - -@InitImplicit - lea ImplicitEPB(a3),a0 ; point to the param block used to wait for autopoll data - lea @ImplicitCompleted,a1 ; handler address - move.l a1,pbCompletion(a0) ; install the handler - bsr.s @SendToEgret ; install the auto poll handler - - move.l #(pseudoPkt<<24)\ ; pcCmdType := pseudoPkt - +(wrDevList<<16),d0 ; pbCmd := wrDevList - move.w DevMap(a3),d0 ; pbParam := DevMap (in first 2 bytes) - bsr.s @syncReq ; send command to specify auto polling addresses - - move.l #(pseudoPkt<<24)\ ; pcCmdType := pseudoPkt - +(aPoll<<16)\ ; pbCmd := aPoll - +($FF<<8),d0 ; pbParam := $FF (only high byte is used) - ; send command to start auto polling - -@syncReq suba.w #EgretPBSize,sp ; allocate a param block on the stack for a sync call - movea.l sp,a0 ; point to the param block - move.l d0,pbCmdType(a0) ; init pcCmdType, pbCmd, and high word of pbParam - clr.l pbCompletion(a0) ; no completion routine, sync call - bsr.s @SendToEgret ; call send the request off to the ADB micro - adda.w #EgretPBSize,sp ; deallocate the param block - rts ; auto-polling/srq data will arrive unsolicited from now on - Title 'KbdADB - ADB Manager - ExplicitCompleted' +NewEgretFunc +; a196 + Link A6, #-$14 + Move.L #$7000000, D0 + And.L (UnivROMFlags), D0 + CmpI.L #$3000000, D0 + BNE.B (* + $42) + MoveA.L A7, A0 + Move.B #$1, (A0) + Move.B #$2, $1(A0) + Clr.L $2(A0) + Move #$A1, $2(A0) + Move #$1, $6(A0) + Lea.L $4(A0), A1 + Move.L A1, $8(A0) + Clr $C(A0) + Clr $E(A0) + Clr.L $10(A0) + _EgretDispatch + Move.B #$8, $1(A0) + BClr.B #$5, $4(A0) + _EgretDispatch + Unlk A6 + Rts + Tst.L D3 + BMI.B (* + $44) + BSet.B #$2, $15E(A3) + BNE.B (* + $4C) + Move.B D3, $171(A3) + Move D2, $176(A3) + Move.L A2, $178(A3) + BSet.B #$0, $15E(A3) + BNE.B (* + $1C) + Lea.L @ExplicitCompleted, A0 + Move.L A0, $180(A3) + Lea.L $184(A3), A0 + Clr.L $10(A0) + Bsr.B (* + $E) + Move.L #$1010000, D0 + Bsr.B (* + $40) + Lea.L $170(A3), A0 + MoveQ.L #$0, D1 + MoveA.L ($648), A2 + Jmp (A2) + BTst.B #$5, $15D(A3) + BNE.B (* + $A) + BSet.B #$1, $15E(A3) + BEQ.B (* + $4) + Rts + Lea.L $184(A3), A0 + Lea.L (* + $9A), A1 + Move.L A1, $10(A0) + Bsr.B (* + -$26) + Move.L #$1190000, D0 + Move $14E(A3), D0 + Bsr.B (* + $8) + Move.L #$101FF00, D0 + SubA #$14, A7 + MoveA.L A7, A0 + Move.L D0, (A0) + Clr.L $10(A0) + Bsr.B (* + -$46) + Lea.L $14(A7), A7 + Rts ;_______________________________________________________________________ ; -; Routine: @ExplicitCompleted +; Routine: @ExplicitCompleted a27c ; Inputs: A0 - Pointer to the EgretPB of the Explicit Request ; ; Outputs: D2 - length of receive buffer data @@ -2072,6 +1328,10 @@ StartReqEgret ; ;_______________________________________________________________________ + with ADBVars,EgretPB + + import ExplicitRequestDone, ImplicitRequestDone + @ExplicitCompleted ; A0 := pointer to EgretPB if EgretDebug then btst.b #EgAutoPoll,pbFlags(a0) ; see if this was from auto poll @@ -2145,7 +1405,7 @@ StartReqEgret ;_______________________________________________________________________ ; -; Routine: @ImplicitCompleted +; Routine: @ImplicitCompleted a2ec ; Inputs: A0 - Pointer to the EgretPB of the Implicit Request ; D0 - Number of data bytes returned (word, 0..8) ; A1 - Pointer to Flags, Command, Data Buffer @@ -2185,6 +1445,7 @@ StartReqEgret Export DebugEnterCont DebugEnterCont +a2fc with ProductInfo move.l UnivRomFlags,d0 ; get the Universal system flags @@ -2233,6 +1494,7 @@ DebugEnterCont Export DebugExitCont DebugExitCont +; a346 with ProductInfo move.l UnivRomFlags,d0 ; get the Universal system flags diff --git a/OS/Gestalt/Gestalt.make b/OS/Gestalt/Gestalt.make index 7dabc79..8472e6d 100644 --- a/OS/Gestalt/Gestalt.make +++ b/OS/Gestalt/Gestalt.make @@ -18,8 +18,8 @@ GestaltObjs = "{ObjDir}GestaltFunction.a.o" "{ObjDir}GestaltLookup.c.o" ¶ "{ObjDir}GestaltExtensions.a.o" -"{LibDir}Gestalt.lib" Ä {GestaltObjs} - Lib {StdLibOpts} -o "{Targ}" {GestaltObjs} +# "{LibDir}Gestalt.lib" Ä {GestaltObjs} +# Lib {StdLibOpts} -o "{Targ}" {GestaltObjs} "{ObjDir}GestaltFunction.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/OS/HFS/HFS.make b/OS/HFS/HFS.make index b9c1939..e2f6042 100644 --- a/OS/HFS/HFS.make +++ b/OS/HFS/HFS.make @@ -45,8 +45,8 @@ HFSObjs = "{LibDir}BTreeMgr.lib" "{ObjDir}DiskCache.a.o" -"{LibDir}HFS.lib" Ä {HFSObjs} - Lib {StdLibOpts} -o "{Targ}" {HFSObjs} +# "{LibDir}HFS.lib" Ä {HFSObjs} +# Lib {StdLibOpts} -o "{Targ}" {HFSObjs} "{ObjDir}BTAlloc.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/OS/HwPriv.a b/OS/HwPriv.a index 46389ba..40d63da 100644 --- a/OS/HwPriv.a +++ b/OS/HwPriv.a @@ -329,18 +329,22 @@ Vects ;table of offsets to selector routines HwPrivSelector DisableExtCache ; 5 DisableExtCache HwPrivSelector FlushExtCache ; 6 FlushExtCache HwPrivSelector SwapSerialClock ; 7 SwapSerialClock - HwPrivSelector ProtectEDisk ; 8 Protect/Unprotect EDisk +; HwPrivSelector ProtectEDisk ; 8 Protect/Unprotect EDisk + dc.w $d8b8 ; HARDCODED due to unhappy linker, must remove HwPrivSelector FlushCRange ; 9 FlushCRange - HwPrivSelector WaitForSCSIDevs ; 10 WaitForSCSIDevs + HwPrivSelector ReturnErr ; 10 WaitForSCSIDevs HwPrivSelector ReturnErr ; 11 Unused HwPrivSelector SlotBlockXferCtl ; 12 - enable block xfers to a slot - HwPrivSelector GetENetID ; 13 - Get Ethernet ID from serial ROM + HwPrivSelector ReturnErr ; 13 - Get Ethernet ID from serial ROM + HwPrivSelector ReturnErr ; 14 + HwPrivSelector ReturnErr ; 15 + HwPrivSelector MakeSomethingWriteThrough ; 16 LastVec ALIGN 8 HWPrivSwitch cmpi.w #(LastVec-Vects)/HwVecSize,d0 ; check if selector in range - bhs ReturnErr ; abort if itÕs not a valid selector + bcc.s ReturnErr ; abort if itÕs not a valid selector move.w Vects(d0*HwVecSize),d0 ; get offset to selectorÕs routine jmp Vects(d0) ; go to the routine @@ -354,7 +358,6 @@ ReturnErr PROC ENTRY ENDPROC - ;---------- ; ; SwapICache (_HWPriv Selector 0) @@ -376,37 +379,6 @@ ReturnErr PROC ENTRY SwapICache PROC EXPORT - TestFor has68kEmulator ; are we on a PPC-based machine? - bnz.b @EmuFake - - cmp.b #cpu68040,CpuFlag ; are we on an 040-based machine? - bhs.s @handle040 - -@handle030 - movec CACR,d0 ; get current cache state - bfextu d0{31:1},d1 ; get cache enable bit into LSbit of d1 - bclr #CACR_EI_020_030,d0 ; assume we're disabling (clear enable flag) - move.l a0,d2 ; see what we want to do - beq.s @SetCACR ; if we want to turn it on - ori.b #((1< nope, just blow it all off - subq #4,sp ; make room for result - move.l #dockCacheControl,-(sp) ; cache control selector - move.l #dockCacheOn,-(sp) ; indicate the cache should be turned on - _DockingDispatch - addq #4,sp ; remove the result (assume success) - - IF hasMDU THEN - bra.s @extCacheDone -@noDockMgr - - movea.l UnivInfoPtr,a0 ; point to the product info - cmpi.b #DecoderKinds.MDUDecoder,\ - ProductInfo.DecoderKind(a0) ; see if we have an MDU - bne.s @noMDU ; if not, nothing to enable - -; enable the external MDU cache as follows: -; Toggle the RvCFlush bit 1 - 0 - 1, to flush the cache -; set the RvCDis bit to 0, to enable the cache (special restriction, can't access cacheable -; memory for some amount of time after enableing the cache. By executing this code in -; a loop, it will be executing out of the instruction cache, and not accessing memory) - - movea.l VIA2RBV,a0 ; get the VIA2 or RBV base address - lea vBufB|RvDataB(a0),a0 ; point to the cache register - - move.w sr,-(sp) ; save int mask - ori.w #HiIntMask,sr ; disable all interrupts - - moveq.l #~(1< nope, just blow it all off - subq #4, sp ; make room for result - move.l #dockCacheControl, -(sp) ; cache control selector - move.l #dockCacheOff, -(sp) ; indicate the cache should be turned on - _DockingDispatch - addq #4,sp ; remove the result (assume success) - - IF hasMDU THEN - bra.s @extCacheDone -@noDockMgr - - movea.l UnivInfoPtr,a0 ; point to the product info - cmpi.b #DecoderKinds.MDUDecoder,\ - ProductInfo.DecoderKind(a0) ; see if we have an MDU - bne.s @noMDU ; if not, nothing to enable - - movea.l VIA2RBV,a0 ; get the VIA2 or RBV base address - lea vBufB|RvDataB(a0),a0 ; point to the cache register - ori.b #(1< A0[7-0] = bit map of SCSI IDs to wait for -; -> A0[23-16] = bit map of SCSI IDs to search for -; -; On Exit: -; <- A0 = result (0=found wait_for drives, -1=didn't find them) -; -; Register Usage: -; D0 = temp -; D1 = bitmap of devices to wait for -; D2 = bitmap of devices to search for -; D3 = OS Type (for SCSILoad) -; D4 = Ticks at timeout -; -;---------- - -WaitForSCSIDevs PROC EXPORT - - IMPORT SCSILoad - -trashedRegs REG D2-D4/D6 - -DefaultTimeOut EQU 20 ; Number of seconds timeout if PRAM is pristine -PollDelay EQU 15 ; Delay (in ticks) between SCSILoads - - movem.l trashedRegs, -(sp) ; save registers that we're going to trash - -; Get bitmap parameters into D1 and D2 - move.l A0, D1 ; D1 = bitmap of devices to wait for - move.l D1, D2 ; - swap D2 ; D2 = bitmap of devices to search for - or.b D1, D2 ; make sure that we search for the drive(s) - ; that we are waiting for - -; SCSILoad expects OS type in high word of D3 - subq.w #2, sp ; Make room for parameters. - move.l sp, A0 ; Point to the parameter block. - _GetOSDefault ; Get info about the default device. - ; leave OS results on stack for a second - -; Get PRAM time out value and convert it to ticks and keep in D4 - _GetTimeOut ; Get the timeout parameter. - bne.s @UseGivenTime ; Branch if not using default. - moveq.l #DefaultTimeOut, D0 ; Use default timeout. -@UseGivenTime - mulu #60, D0 ; Convert timeout to ticks. - move.l D0, D4 ; Save timeout in our final reg. - - move.w (sp)+, D3 ; Get OS type off of stack - swap D3 ; put in high word (where SCSILoad expects it) - - moveq.l #0, D6 - bset #31, D6 ; tell drivers not to munge the blasted heap - -; SCSILoad polling loop ------- - -@TopO_TheLoop - move.l D2, D0 ; Try to load drivers for the "search" disks - bsr.l SCSILoad - - move.b SCSIDrvrs, D0 - and.b D1, D0 ; look only at bits we are waiting for - cmp.b D1, D0 ; if all are 1 then - beq.s @goodexit ; we got what we were waiting for - exit - -; Check for timeout, wait for PollDelay more ticks, check timeout again, then do the SCSILoad again - move.l Ticks, D0 - cmp.l D4, D0 ; is current ticks higher than our time_out ticks? - bhi @fldexit ; yes - timed out, exit - - add.l #PollDelay, D0 ; wait till Ticks+PollDelay before polling -@1 cmp.l Ticks, D0 ; if polldelay timeout is higher than current ticks, - bhi @1 ; then loop - - cmp.l D4, D0 ; is current ticks higher than our time_out ticks? - blo @TopO_TheLoop ; no - repeat SCSILoad - ; yes - timed out, exit -@fldexit - move.w #-1, A0 - bra.s @exit - -@goodexit - move.w #0, A0 -@exit - movem.l (sp)+, trashedRegs ; restore registers that we trashed - rts - - ENDPROC - - ;---------- ; ; SlotBlockXferCtl (_HWPriv Selector 12) @@ -1051,117 +637,38 @@ PollDelay EQU 15 ; Delay (in ticks) between SCSILoads SlotBlockXferCtl PROC EXPORT - MoveQ.l #paramErr, D0 ; assume don't have MUNI or bad slot value passed - Testfor BARTExists ; are we on a ColdFusion or PDM - bne.s @bart - TestFor MUNIExists ; Do we have the MUNI Nubus controller - Beq.s @exit ; No, we're done. - - MoveA.l UnivInfoPtr, A1 ; point to the product info - Add.l ProductInfo.DecoderInfoPtr(A1), A1 ; get decoder info ptr - MoveA.l DecoderInfo.MUNIAddr(A1), A1 ; get MUNI base address - - Move.l A0, D1 ; get user parm - MoveQ #0, D2 - Move.l MUNI_BlkAttmpt(A1), D2 ; get previous state of slots 1-14 - Lsl.w #1, D2 ; make bit x match slot x, bit 1 = slot 1 - MoveA.l D2, A0 ; return previous state bit mask in A0 - - MoveQ #0, D2 - Move.b D1, D2 ; Get slot # - SubQ.b #1, D2 ; adjust slot # for bit offset - Bmi.s @exit ; bad slot value, < 1 - Cmp.b #14, D2 - Bhs.s @exit ; bad slot value, > 14 - Move.l MUNI_BlkAttmpt(A1), D0 ; get current state of slots 1-14 - BTst #8, D1 ; Turn blk xfer on or off? - Bne.s @on - BClr D2, D0 ; turn if off - Bra.s @doit -@on BSet D2, D0 ; turn if on -@doit Move.l D0, MUNI_BlkAttmpt(A1) ; setup block xfers for slot # in D2 - bra.s @done - -@bart - MoveA.l UnivInfoPtr, A1 ; point to the product info - Add.l ProductInfo.DecoderInfoPtr(A1),A1 ; get decoder info ptr - MoveA.l DecoderInfo.BARTAddr(A1),A1 ; get Bart base address - - Move.l A0, D1 ; get user parm - MoveQ #0, D2 - Move.b D1, D2 ; Get slot # - SubQ.b #1, D2 ; adjust slot # for bit offset - Bmi.s @exit ; bad slot value, < 1 - Cmp.b #14, D2 - Bhs.s @exit ; bad slot value, > 14 - BTst #8, D1 ; Turn blk xfer on or off? - Bne.s @Bon - - moveq #BARTBurstRegOff, d0 - mulu.l d2, d0 - adda.l #BARTBurstReg,a1 - suba.l d0, a1 - bclr.b #BARTBurstBit, (A1) ; turn off block xfers for slot # in D2 - Bra.s @done - -@Bon moveq #BARTBurstRegOff, d0 - mulu.l d2, d0 - adda.l #BARTBurstReg,a1 - suba.l d0, a1 - bset.b #BARTBurstBit, (A1) ; turn on block xfers for slot # in D2 - -@done MoveQ #noErr,D0 ; signal all's well - -@exit Rts + moveq #paramErr,D0 + rts ENDPROC ;---------- ; -; GetENetID (_HWPriv Selector 13) -; -; This routine gets the EtherNet ID from a serial-interface EtherNet ID ROM. -; On all machines except Blackbird (so far), the Ethernet ID is in a memory-mapped -; parallel ROM. When this routine runs on those machines, a0 should already -; contain a valid address at which to read the ethernet ID, so this routine -; will just exit for those machines. If there is no address in a0, we double check -; here to make sure we are on a Blackbird (by checking for Pratt), and then -; go ahead and try to get the Ethernet ID from the serial ROM. -; -; Entry: -; -; A0.l - ENetPROM field of the EtherNet Driver (address of ID ROM, or -; zero for an ID ROM that is not memory-mapped). -; -; Exit: -; -; A0.l - non-zero pointer to EtherNet ID -; - ID = 0 if we can't get address from ID ROM -; -; Destroys: D1, D2, A1 +; MakeSomethingWriteThrough ; ;---------- -GetENetID PROC EXPORT +MakeSomethingWriteThrough PROC EXPORT - IMPORT X24c01aGetID + Move.L ([$1FF4],$8), D2 + Move.L A0, D0 + LsR.L D2, D0 + MoveA.L D0, A0 + Move.L A1, D0 + SubQ.L #$1, D0 + LsR.L D2, D0 + Move.L D0, D2 +@loop + _nkMakePageWriteThrough + Tst.L D0 + BMI.B @exit + AddQ #$1, A0 + DBF D2, @loop + MoveQ.L #$0, D0 +@exit + Rts - WITH PMgrRec, PmgrPrimitivesRec - - IF hasPratt THEN - TestFor PrattExists ; do we have a Pratt? - beq.s @exit ; no, so exit - - move.l a4, -(sp) ; save our macro register - bigjsr X24c01aGetID,a4 ; get the ID from the serial ROM - move.l (sp)+, a4 ; restore our macro register - ENDIF - -@exit moveq #noErr,d0 ; everything always fine - rts - - ENDWITH ENDPROC @@ -1210,7 +717,7 @@ MdVecSize EQU 4 ;--------------- ; -; MemoryDispatch +; MemoryDispatch a590 ; ; Provides services for Virtual Memory access to the hardware ; @@ -1228,24 +735,28 @@ Vects ;table of offset to selector routines MemDispSelector LockMemoryContiguousProc ; 4 MemDispSelector GetPhysicalProc ; 5 MemDispSelector WriteProtectProc ; 6 -LastVec MemDispSelector UnWriteProtectProc ; 7 + MemDispSelector UnWriteProtectProc ; 7 + dc.w badSelect-Vects ; 8 + dc.w badSelect-Vects ; 9 +LastVec MemDispSelector LockMemoryProc ; 10 MemoryDispatchCode cmp.w #(LastVec-Vects)/MdVecSize,d0 ; check if selector in range - bhi.s @badSelect ; abort if its not a valid selector + bhi.s badSelect ; abort if its not a valid selector move.w Vects(d0.w*MdVecSize),d0 ; get offset to selector's routine jmp Vects(d0) ; go to the routine -@badSelect move.l #hwParamErr,d0 ; abort: return error code +badSelect2 +badSelect3 +badSelect move.l #hwParamErr,d0 ; abort: return error code rts EndProc - ;----- ; -; HoldMemoryProc (_MemoryDispatch Selector 0) +; HoldMemoryProc a5c0 (_MemoryDispatch Selector 0) ; ; This routine makes the address space resident in real memory and ineligible for paging. ; @@ -1260,7 +771,7 @@ HoldMemoryProc PROC Export EndProc ;----- ; -; UnHoldMemoryProc (_MemoryDispatch Selector 1) +; UnHoldMemoryProc a5d0 (_MemoryDispatch Selector 1) ; ; This routine makes the address space eligible for paging. ; @@ -1276,7 +787,7 @@ UnHoldMemoryProc PROC Export ;----- ; -; LockMemoryProc (_MemoryDispatch Selector 2) +; LockMemoryProc a5e0 (_MemoryDispatch Selector 2) ; ; This routine makes the address space immovable in real memory and ineligible for paging. ; It also marks the corresponding page frames as non-cacheable, and increments the @@ -1301,7 +812,7 @@ LockMemoryProc PROC Export movea.l LockMemCt,a2 ; point to MemoryDispatch globals bsr GetPageRange ; check input arguments bne.s @error ; get out - lea.l mdLockTable(a2,d1*2),a1 ; point to lock counter for first page + lea.l mdLockTable(a2,d1.l*2),a1 ; point to lock counter for first page moveq.l #1,d0 ; flag to MMUSetCacheInhibit to inhibit caching @loop addq.w #1,(a1)+ ; bump the lock count @@ -1310,10 +821,6 @@ LockMemoryProc PROC Export subq.l #1,d2 ; one less page to go bhi.s @loop ; keep looping - cmpi.b #EMMU1,MMUType ; is this an Emulated MMU? - beq.s @done ; -> Yes, no need to flush anything - bsr MMUFlushATC ; flush ATC's - _FlushDataCache ; flush data cache @done moveq.l #noErr,d0 ; no error @error movem.l (sp)+,@saveRegs ; restore registers @@ -1323,7 +830,7 @@ LockMemoryProc PROC Export ;----- ; -; UnLockMemoryProc (_MemoryDispatch Selector 3) +; UnLockMemoryProc a610 (_MemoryDispatch Selector 3) ; ; This routine makes the address space movable in real memory and eligible for paging again. ; It also decrements the lock count for the corresponding page frames, and if the @@ -1342,7 +849,7 @@ UnLockMemoryProc PROC Export movea.l LockMemCt,a2 ; point to MemoryDispatch globals bsr GetPageRange ; check input arguments bne.s @error ; get out - lea.l mdLockTable(a2,d1*2),a1 ; point to lock counter for first page + lea.l mdLockTable(a2,d1.l*2),a1 ; point to lock counter for first page move.l d2,d3 ; copy of the count move.w #notLockedErr,d0 ; assume a nonlocked page @lockCheckLoop @@ -1351,7 +858,7 @@ UnLockMemoryProc PROC Export subq.l #1,d3 ; one less page to go bhi.s @lockCheckLoop ; keep looping - lea.l mdLockTable(a2,d1*2),a1 ; point to lock counter for first page + lea.l mdLockTable(a2,d1.l*2),a1 ; point to lock counter for first page move.l d2,d3 ; copy of the count moveq.l #0,d0 ; flag to MMUSetCacheInhibit to enable caching moveq.l #0,d4 ; assume ATC will not need to be cleared @@ -1380,7 +887,7 @@ UnLockMemoryProc PROC Export ;------------------------------------------------------------------- ; -; LockMemoryContiguousProc (_MemoryDispatch Selector 4) +; LockMemoryContiguousProc a660 (_MemoryDispatch Selector 4) ; ; This routine provides the service of making a virtual address range contiguous in ; physical address space. @@ -1423,7 +930,7 @@ LockMemoryContiguousProc PROC Export cmpa.l a1,a0 ; compare the results bne.s @notContigError ; range crosses a non-contiguous bank boundary - lea.l mdLockTable(a2,d1*2),a1 ; point to lock counter for first page + lea.l mdLockTable(a2,d1.l*2),a1 ; point to lock counter for first page moveq.l #1,d0 ; flag to MMUSetCacheInhibit to inhibit caching @loop addq.w #1,(a1)+ ; bump the lock count @@ -1432,10 +939,6 @@ LockMemoryContiguousProc PROC Export subq.l #1,d2 ; one less page to go bhi.s @loop ; keep looping - cmpi.b #EMMU1,MMUType ; is this an Emulated MMU? - beq.s @done ; -> Yes, no ATC or Data cache to flush - bsr MMUFlushATC ; flush ATC's - _FlushDataCache ; flush data cache @done moveq.l #noErr,d0 ; no error @error movem.l (sp)+,@saveRegs ; restore registers @@ -1449,7 +952,7 @@ LockMemoryContiguousProc PROC Export ;------------------------------------------------------------------- ; -; GetPhysicalProc (_MemoryDispatch Selector 5) +; GetPhysicalProc a6c0 (_MemoryDispatch Selector 5) ; ; This routine translates virtual addressess to corresponding physical addresses. ; @@ -1678,7 +1181,7 @@ ChkContig PROC Export ;----- ; -; WriteProtectProc (_MemoryDispatch Selector 6) +; WriteProtectProc a850 (_MemoryDispatch Selector 6) ; ; This routine protects the address space from write accesses. ; It also sets the high bit in the lock counter for each page in the range. @@ -1722,12 +1225,7 @@ WriteProtectProc Proc Export bsr GetPageRange ; check input arguments bne.s @error ; get out - cmpi.b #EMMU1,MMUType ; do we have an EMMU? - beq.s @NoFlush ; -> Yes, no need for this crap - _FlushDataCache ; flush data cache (flush data before write protecting) - _FlushInstructionCache ; flush instruction cache (just for grins) - bsr MMUFlushATC ; flush ATC's -@NoFlush lea.l mdLockTable(a2,d1*2),a1 ; point to lock counter for first page +@NoFlush lea.l mdLockTable(a2,d1.l*2),a1 ; point to lock counter for first page moveq.l #@setW,d0 ; flag to MMUSetWriteProtect to write-protect @loop ori.w #@setWMask,(a1)+ ; set the write-protect flag @@ -1745,7 +1243,7 @@ WriteProtectProc Proc Export ;----- ; -; UnWriteProtectProc (_MemoryDispatch Selector 7) +; UnWriteProtectProc a88c (_MemoryDispatch Selector 7) ; ; This routine allows write accesses to the address space. ; It also clears the high bit in the lock counter for each page in the range. @@ -1789,7 +1287,7 @@ UnWriteProtectProc Proc Export bsr GetPageRange ; check input arguments bne.s @error ; get out - lea.l mdLockTable(a2,d1*2),a1 ; point to lock counter for first page + lea.l mdLockTable(a2,d1.l*2),a1 ; point to lock counter for first page moveq.l #@clearW,d0 ; flag to MMUSetWriteProtect to clear write-protect @loop andi.w #@clearWMask,(a1)+ ; clear the write-protect flag @@ -1809,7 +1307,7 @@ UnWriteProtectProc Proc Export ;------------------------------------------------------------------- ; -; InitMemoryDispatch +; InitMemoryDispatch a8e0 ; ; This routine allocates and initializes the MemoryDispatch globals. ; @@ -1827,15 +1325,6 @@ InitMemoryDispatch Proc Export clr.l LockMemCt ; clear ptr to globals (assume failure) - cmpi.b #HMMU,MMUType ; Do we have an MMU? - bhi.s @hasMMU ; -> Yes, do the init! - - MOVE.W #@UnimplementedTrap,d0 ; _Unimplemented - _GetTrapAddress ,newTool ; Get its address - MOVE.W #@MemoryDispatchTrap,d0 ; Select MemoryDispatch trap - _SetTrapAddress ,newOS ; Set it to point to Unimplemented - bra @NoPages ; -> All done - @hasMMU move.b CPUFlag,d1 ; get the CPU type moveq.l #0,d2 ; assume no page size move.l PhysMemTop,d3 ; get actual amount of physical RAM @@ -1856,8 +1345,6 @@ InitMemoryDispatch Proc Export blo.w @noPages ; bail without allocating globals ??? (Use old code ?) cmpi.b #PMMU851,MMUType ; do we have a real MMU ? blo.w @noPages ; bail without allocating globals ??? (Use old code ?) - cmpi.b #EMMU1,MMUType ; do we have an emulated MMU? - bne.s @mustbe030 ; -> No, must be an 030 moveq #0,D1 ; clear D1 move.l ([ProcessorInfoPtr],ProcessorInfo.PageSize),D0 ; Get the Page size from the nano-k @@ -1867,8 +1354,6 @@ InitMemoryDispatch Proc Export addq #1,d1 bra.s @countBits ; Keep shifting till we find one -@mustbe030 pmove.l TC,-4(a6) ; get the '030 TC register contents - bfextu -4(a6){8,4},d1 ; get log2 of page size @gotPageSize bset.l d1,d2 ; get the page size lsr.l d1,d3 ; get number of page frames @@ -1901,7 +1386,7 @@ InitMemoryDispatch Proc Export ;------------------------------------------------------------------- -; GetPageRange - Sanity check on the logical address and count +; GetPageRange a980 - Sanity check on the logical address and count ; ; Destroys: a0/d1/d2 ; @@ -1959,7 +1444,7 @@ GetPageRange Proc Export EndProc ;------------------------------------------------------------------- -; MMUSetWriteProtect - Set W (Write Protect) bit for a page +; MMUSetWriteProtect a9c0 - Set W (Write Protect) bit for a page ; ; Destroys: none. ; @@ -1978,15 +1463,9 @@ MMUSetWriteProtect Proc Export @moreRegs REG d1/a1/a2 @wBit EQU 2 ; write protect bit in all page descriptors - cmp.b #PMMU851,MMUType ; do we have at least a 68851 PMMU ? - blo.w @noPages ; if not, no pages to write protect (020 or less) -@hasPages movem.l @saveRegs,-(sp) ; save registers move.l d0,d4 ; remember write-protect mask - CMPI.B #EMMU1,MMUType ; Do we have an EMMU? - BNE.S @RealMMU ; -> Nope, sorry - MOVE.L D1,A0 ; Put the page number in A0 _nkGetPTEntryGivenPage ; Get the 030+ PTE from the nk @@ -1997,47 +1476,6 @@ MMUSetWriteProtect Proc Export MOVE.L D1,A1 ; Put the page number in A1 _nkSetPTEntryGivenPage ; Set the 030+ PTE - BRA.S @RegDone ; -> Exit - -@RealMMU move.l mdLog2PageSize(a2),d0 ; get the log2 of the page size - asl.l d0,d1 ; turn logical page number into a logical address - - IF Supports24Bit THEN ; - cmp.l mdPages24(a2),d1 ; check if page is in the 24-bit address space - slo d3 ; if it is, be sure to whack the 24-bit table - - moveq.l #false32b,d0 ; first go to 24-bit mode - _SwapMMUMode ; go to 24-bit mode - move.l d0,d2 ; remember the caller's MMU mode - - movea.l d1,a0 ; set up logical address to get page descriptor - movem.l @moreRegs,-(sp) ; save registers that GetPageDesc destroys - bsr GetPageDescProc ; ptr to page descriptor given logical address - movem.l (sp)+,@moreRegs ; restore registers that GetPageDesc destroys - movea.l a0,a1 ; save ptr to 24-bit page descriptor - - moveq.l #true32b,d0 ; go to 32-bit mode - _SwapMMUMode ; go to 32-bit, return caller's MMU mode - ENDIF - - movea.l d1,a0 ; set up logical address to get page descriptor - movem.l @moreRegs,-(sp) ; save registers that GetPageDesc destroys - bsr GetPageDescProc ; ptr to page descriptor given logical address - movem.l (sp)+,@moreRegs ; restore registers that GetPageDesc destroys - - bclr.b #@wBit,3(a0) ; clear the W bit - or.l d4,(a0) ; clear/set the write-protect flag - - IF Supports24Bit THEN ; - tst.b d3 ; should we whack the 24-bit table ? - beq.s @exit ; if not, we're done - - bclr.b #@wBit,3(a1) ; clear the W bit - or.l d4,(a1) ; clear/set the write-protect flag -@exit - move.l d2,d0 ; caller's MMU mode - _SwapMMUMode ; restore the MMU mode - ENDIF @regDone movem.l (sp)+,@saveRegs ; restore registers @noPages rts @@ -2045,7 +1483,7 @@ MMUSetWriteProtect Proc Export EndProc ;------------------------------------------------------------------- -; MMUSetCacheInhibit - Set CI (Cache Inhibit) bit for a page +; MMUSetCacheInhibit a9e0 - Set CI (Cache Inhibit) bit for a page ; ; NOTE: On the 040, it is assumed that bit 5 of the page descriptor (CM[0]) is ; meaningful, since it is used to select write-through/copyback when @@ -2072,57 +1510,15 @@ MMUSetCacheInhibit Proc Export @saveRegs REG d0-d4/a0/a1 @moreRegs REG d1/a1/a2 - cmp.b #PMMU851,MMUType ; do we have at least a 68851 PMMU ? - blo.w @noPages ; if not, we can't control data caching (020 or less) -@hasPages movem.l @saveRegs,-(sp) ; save registers - cmpi.b #EMMU1,MMUType ; Do we have an EMMU? - bne.s @RealMMU ; -> Nope, sorry + btst.b #7,$240A + bne.s @RegDone MOVE.L D1,A0 ; Put the page number in A0 ADDI.W #mmuMakePageCacheable,D0 ; Turn the cache mode flag into a nKernel selector _KernelVMDispatch ; Set the cache status & flush the ATC - BRA.S @RegDone ; -> Exit -@RealMMU move.l d0,d4 ; remember inhibit flag - - move.l mdLog2PageSize(a2),d0 ; get the log2 of the page size - asl.l d0,d1 ; turn logical page number into a logical address - - IF Supports24Bit THEN ; - cmp.l mdPages24(a2),d1 ; check if page is in the 24-bit address space - slo d3 ; if it is, be sure to whack the 24-bit table - - moveq.l #false32b,d0 ; first go to 24-bit mode - _SwapMMUMode ; go to 24-bit mode - move.l d0,d2 ; remember the caller's MMU mode - - movea.l d1,a0 ; set up logical address to get page descriptor - movem.l @moreRegs,-(sp) ; save registers that GetPageDesc destroys - bsr GetPageDescProc ; ptr to page descriptor given logical address - movem.l (sp)+,@moreRegs ; restore registers that GetPageDesc destroys - movea.l a0,a1 ; save ptr to 24-bit page descriptor - - moveq.l #true32b,d0 ; go to 32-bit mode - _SwapMMUMode - ENDIF - movea.l d1,a0 ; set up logical address to get page descriptor - movem.l @moreRegs,-(sp) ; save registers that GetPageDesc destroys - bsr GetPageDescProc ; ptr to page descriptor given logical address - movem.l (sp)+,@moreRegs ; restore registers that GetPageDesc destroys - bsr.s MMUSetCacheMode ; go whack the page descriptor - - IF Supports24Bit THEN ; - tst.b d3 ; should we whack the 24-bit table ? - beq.s @exit ; if not, we're done - - movea.l a1,a0 ; point to the 24-bit page descriptor - bsr.s MMUSetCacheMode ; go whack the page descriptor -@exit - move.l d2,d0 ; caller's MMU mode - _SwapMMUMode ; restore the MMU mode - ENDIF @RegDone movem.l (sp)+,@saveRegs ; restore registers @noPages rts @@ -2130,60 +1526,11 @@ MMUSetCacheInhibit Proc Export EndProc ;------------------------------------------------------------------- -; MMUSetCacheMode - code to actually whack the page table entry (Called in 32-bit mode) -; -; Destroys: None. ; -; On entry: d4.l = cache inhibit flag: 0=clear cache inhibit bit(s) -; 1=set cache inhibit bit(s) -; a0.l = logical address of page descriptor -; a2.l = ptr to MemoryDispatch globals -;------------------------------------------------------------------- -MMUSetCacheMode Proc Export -@saveRegs REG d0/d1 -@cacheBit EQU 6 ; C bit for 851/030, CM[1] for 040 (CM[0] untouched) -@cm0bit EQU 5 ; CM[0] bit in 040 page descriptor - - movem.l @saveRegs,-(sp) ; save registers - tst.b d4 ; check the cache inhibit flag - beq.s @enableCaching ; if clear, enable caching for the page - move.l (a0),d1 ; get page desc (forces serialization on 040) - bset.l #@cacheBit,d1 ; inhibit caching - bclr.l #@cm0bit,d1 ; make it non-serialized - move.l d1,(a0) ; update page descriptor - bra.s @exit -@enableCaching - clr.l d1 ; clear 68040 mask - bfextu CacheFlags{31-bCopybackMode:1},d1 ; get current cache mode - lsl.l #@cm0bit,d1 ; make a mask for a 68040 page descriptor - or.l (a0),d1 ; get page descriptor (forces copyback on 040) - bclr.l #@cacheBit,d1 ; enable caching - move.l d1,(a0) ; update page descriptor -@exit - movem.l (sp)+,@saveRegs ; restore registers - rts - EndProc - - -;------------------------------------------------------------------- -; -; MMUFlushATC - Flush all entries in the MMU's Address Translation Cache +; MMUFlushATC aa00 - Flush all entries in the MMU's Address Translation Cache ; ;------------------------------------------------------------------- MMUFlushATC Proc Export - cmpi.b #EMMU1,MMUType ; do we have an Emulated MMU? - beq.s @exit ; -> Yes, do nothing - cmp.b #PMMU851,MMUType ; do we have at least a 68851 PMMU ? - blo.s @exit ; if not, we're done - cmp.b #PMMU040,MMUType ; do we have an 040 PMMU? - beq.s @handle040 ; if so, use 040 PFLUSHA - pflusha ; use 851 & 030 PFLUSHA -@exit - rts ; done -@handle040 - MACHINE MC68040 - pflusha ; flush the ATC - MACHINE MC68030 rts EndProc diff --git a/OS/IoPrimitives/IOPrimitives.make b/OS/IoPrimitives/IOPrimitives.make index 4ce64c1..d8583c8 100644 --- a/OS/IoPrimitives/IOPrimitives.make +++ b/OS/IoPrimitives/IOPrimitives.make @@ -27,8 +27,8 @@ IOPrimitivesObjs = "{ObjDir}PowerMgrPrimitives.a.o" "{ObjDir}PWM.c.o" ¶ "{ObjDir}SndPrimitives.a.o" -"{LibDir}IOPrimitives.lib" Ä {IOPrimitivesObjs} - Lib {StdLibOpts} {IOPrimitivesObjs} -o "{Targ}" +# "{LibDir}IOPrimitives.lib" Ä {IOPrimitivesObjs} +# Lib {StdLibOpts} {IOPrimitivesObjs} -o "{Targ}" "{ObjDir}ADBPrimitives.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/OS/MMU/GetReal.a b/OS/MMU/GetReal.a index 3d60783..465c13b 100644 --- a/OS/MMU/GetReal.a +++ b/OS/MMU/GetReal.a @@ -82,7 +82,7 @@ VMGlobals EQU $0B78 ; VM globals ptr VMInstalled equ $0101 ; VMInstalled offset inside VM's globals ;---------------------------------------------------------------------------------- -; GetReal - Translates a logical address into a physical address. The address +; GetReal 7c50 - Translates a logical address into a physical address. The address ; translation is performed in the MMU mode at the time of the call. ; ; input: a0.l = logical address to be translated @@ -111,14 +111,8 @@ GetRealSize equ * GetRealProc PROC EXPORT WITH GetRealVars,MemDispGlobals - EXPORT GetPageDescProc EXPORT GetMMUInfo - EXPORT checkTTRegs - ; Note: We dont support "GetPageDesc Address" - cmpi.b #EMMU1,MMUType ; Do we have an Emulated MMU? - bne.s GetRealAddr ; -> No, OSW (old slow way). - ; Do Logical to Physical Translation for machines with EMMUs. SAM MOVEM.L A2/D1/D2,-(SP) ; Save some regs @@ -147,72 +141,9 @@ GetRealProc PROC EXPORT * BRA.S @Done ; -> Exit RTS -GetRealAddr - move.w #getReal,-(sp) ; indicate we want physical address in a0 - bra.s walkTable ; go walk table - -GetPageDescProc - move.w #getpageDesc,-(sp) ; indicate we want page descriptor ptr in a0 - -walkTable movem.l GetRealRegs,-(sp) ; save working registers - link a6,#GetRealSize ; allocate some room for our locals - cmpi.b #PMMU851,MMUType ; check to see if we have an MMU - bhs.s @haveAnMMU ; IF we do not have an MMU THEN - move.w #noMMUErr,d0 ; return an error - bra.s @exitGetReal ; >>EXIT routine -@haveAnMMU ; ENDIF - move.l a0,d2 ; get logical address into d2 - jsr GetMMUInfo ; fill our globals with MMU info - IF Supports24Bit THEN - move.b MMU32Bit,-(sp) ; save current MMU mode - bne.s @in32BitMode ; IF we're in 24-bit mode THEN - moveq #true32b,d0 ; we want to go to 32 bit addressing - _SwapMMUMode ; switch the MMU mode - and.l Lo3Bytes,d2 ; clean up the 24-bit address - bra.s @doTranslation ; go do the translation - ENDIF -@in32BitMode ; ELSE - jsr checkTTRegs ; check transparent translation regs - bne.s @doTranslation ; IF we matched a TT register THEN - move.l d2,a0 ; put the original address into a0 - move.l #0,a2 ; return null for page descriptor address - moveq #noErr,d3 ; return good status - bra.s @cleanupGetReal ; >>EXIT with easy translation - ; ENDIF -@doTranslation ; ENDIF - cmp.b #PMMU040,MMUType ; check MMU type - beq.s @trans68040 ; IF we're on a 68030 THEN - jsr translate030 ; do the translation for an 851/030 - bra.s @cleanupGetReal ; ELSE -@trans68040 jsr translate040 ; do the translation for a 68040 - ; ENDIF - -;------------ -; a2.w = address of page descriptor, if any -; d3.w = result code -; a0.l = physical address if successful -;------------ -@cleanupGetReal - IF Supports24Bit THEN ; SM is always in 32 bit mode - move.b (sp)+,d0 ; get original MMU mode - bne.s @returnResult ; IF we were originally in 24-bit mode THEN - _SwapMMUMode ; swap back to it - ENDIF -@returnResult ; ENDIF - move.w d3,d0 ; return result in d0 -@exitGetReal - unlk a6 ; restore registers - movem.l (sp)+,GetRealRegs ; save working registers - cmp.w #getpageDesc,(sp)+ ; check for page getPageDesc call - bne.s @getRealDone ; IF this is the getPageDesc call THEN - move.l a2,a0 ; return page descriptor pointer -@getRealDone ; ENDIF - tst.w d3 -@done rts - ;---------------------------------------------------------------------------------- -; GetMMUInfo - Fills the global area with MMU-specific table information. +; GetMMUInfo 7c7e - Fills the global area with MMU-specific table information. ; ; input: a6.l = pointer to global area ; @@ -224,364 +155,15 @@ ISOffset equ 12 ; bit offset into 851/030 TC of IS field pageSizeBit equ 14 ; bit number of page size bit in 68040 TC GetMMUInfo - cmpi.b #EMMU1,MMUType ; Do we have an Emulated MMU - beq @VMisOn ; -> Yes, just clear the Log2Phys field & Exit - cmp.b #PMMU040,MMUType ; check MMU type - beq.s @get040Info ; IF the MMU is an 851/030 THEN - pmove crp,theCRP(a6) ; get the 64-bit CRP value - pmove tc,theTc(a6) ; get TC value - move.l theTc(a6),d4 ; put TC into d4 - move.l #ISOffset,d3 ; get offset into TC of IS field - bfextu d4{d3:4},d0 ; get IS value - move.b d0,initShift(a6) ; save IS value in globals - add.l #4,d3 ; get offset into TC of TIA field - bfextu d4{d3:4},d0 ; get TIA value - move.b d0,levelOne(a6) ; save level one index width in globals - add.l #4,d3 ; get offset into TC of TIB field - bfextu d4{d3:4},d0 ; get TIB value - move.b d0,levelTwo(a6) ; save level one index width in globals - add.l #4,d3 ; get offset into TC of TIC field - bfextu d4{d3:4},d0 ; get TIC value - move.b d0,levelThree(a6) ; save level one index width in globals - add.l #4,d3 ; get offset into TC of TID field - bfextu d4{d3:4},d0 ; get TID value - move.b d0,levelFour(a6) ; save level one index width in globals - bra.s @gotInfo ; go check for log2Phys offset -@get040Info ; ELSE - MACHINE MC68040 ; use 68040 instructions - movec srp,d0 ; get 68040 srp - move.l d0,theSRP(a6) ; save the root ptr - move.l #0,theCRP(a6) ; 68040 only has a 32-bit root pointer - move.b #7,levelOne(a6) ; 68040 always uses 7 bits for first level - move.b #7,levelTwo(a6) ; 68040 always uses 7 bits for second level - move.b #5,levelThree(a6) ; assume 5 bits for 8k pages in third level - movec tc,d0 ; get 68040 tc - move.w d0,theTC(a6) ; store it in globals - btst #pageSizeBit,d0 ; check which page size we're using - bne.s @not4kPages ; IF we're using 4k pages - move.b #6,levelThree(a6) ; use 6 bits for 4k pages in third level -@not4kPages ; ENDIF - move.b #0,levelFour(a6) ; 68040 never has a fourth level - move.b #0,initShift(a6) ; 68040 never has an initial shift - MACHINE MC68030 ; switch back to 68030 instructions -@gotInfo ; ENDIF - move.l phys2log,myPhys2Log(a6) ; get our phys2log translation offset (Assume no vm) - - IF not forROM THEN ; Supermario is always 32bit capable - cmp.l #-1,ExpandMem ; is gestalt unimplemented? - beq.s @done ; IF gestalt is implemented THEN - move.l #gestaltAddressingModeAttr,d0 ; we need to find out 32-bit cleanliness - _Gestalt ; call Gestalt - tst.w d0 ; check for errors - bne.s @VMisOn ; >>EXIT on error - move.l a0,d0 ; get response in d0 - btst #gestalt32BitCapable,d0 ; check if phys2Log globals exists - beq.s @VMisOn ; >>EXIT on error - ENDIF - - ; Some history: Since GetMMUInfo cannot be making lengthy Gestalt calls to determine if VM is on - ; we would (previously) test the lomem where VM puts its globals to see it it had been initialized. - ; A problem arises when VM has saved its globals ptr in VMGlobals but has not yet whacked the MMU - ; tables and someone (VM) calls GetPhysical. An additional flag inside the VMGlobals has been added - ; that is set at the very end of VMs initalization. We now check it to determine if the MMU world - ; has been changed on us. SAM - ; - - ; Determine if VM is installed an running - - move.l VMGlobals,d0 ; Has VM installed its globals ptr (is it installed?) - ble.s @done ; -> No. Leave with Phys2Log offset set. - - move.l d0,a0 ; Globals in. Is VM actually running yet? - tst.b VMInstalled(a0) ; VM's Gestalt inited? - beq.s @done ; -> Nope, leave the offset alone - @VMisOn clr.l myPhys2log(a6) ; VM is on. No phys2log translation @done rts ; return - -;---------------------------------------------------------------------------------- -; checkTTRegs - Checks a logical address against the MMU's transparent -; translation registers. This routine assumes that the -; instruction and data TT registers contain identical information -; on the 68040. -; -; input: d2.l = logical address to check -; -; output: ccr.z is set if the address would be transparently translated -; -; destroys: d0-d1/d3-d4 -;---------------------------------------------------------------------------------- -checkTTRegs - cmp.b #PMMU040,MMUType ; check MMU type - beq.s @get040Regs ; IF the MMU is an 851/030 THEN - subq #4,sp ; create room on stack for tt values - pmove tt0,(sp) ; get tt0 value - move.l (sp),d0 ; store in d0 - pmove tt1,(sp) ; get tt1 value - move.l (sp),d1 ; store in d1 - addq #4,sp ; restore stack - bra.s @checkTTs ; continue with check -@get040Regs ; ELSE - MACHINE MC68040 ; use 68040 instructions - movec dtt0,d0 ; store tt0 in d0 - movec dtt1,d1 ; store tt1 in d1 - MACHINE MC68030 ; switch back to 68030 -@checkTTs ; ENDIF - btst #TTEnable,d0 ; see if tt0 is on - beq.s @checkTT1 ; IF tt0 is enabled THEN - move.l d2,d3 ; make a copy of the logical address - eor.l d0,d3 ; exclusive OR to leave ones in different bits - rol.l #8,d3 ; move upper 8-bits into low byte - swap d0 ; put logical address mask in low byte - not.b d0 ; invert logical address mask - and.b d0,d3 ; isolate bits we care about - beq.s @checkDone ; >>EXIT if we found a match -@checkTT1 ; ENDIF - btst #TTEnable,d1 ; see if tt1 is on - beq.s @notEnabled ; IF tt1 is enabled THEN - move.l d2,d3 ; make a copy of the logical address - eor.l d1,d3 ; exclusive OR to leave ones in different bits - rol.l #8,d3 ; move upper 8-bits into low byte - swap d1 ; put logical address mask in low byte - not.b d1 ; invert logical address mask - and.b d1,d3 ; isolate bits we care about - bra.s @checkDone ; go exit - ; ELSE -@notEnabled andi #$fffb,sr ; clear zero bit -@checkDone ; ENDIF - rts - - -;---------------------------------------------------------------------------------- -; translate030 - Translates a logical address to its corresponding physical -; address on a 68030. -; -; input: a6.l = pointer to globals -; d2.l = logical address to translate -; -; output: a0.l = physical address -; a2.l = ptr to page descriptor for translated address -; d3.w = result code -; -; destroys: d0-d1 -;---------------------------------------------------------------------------------- -tcSRE EQU 25 ; SRP Enable in TC for 851/030 -tcFCL EQU 24 ; Function code Lookup in TC for 851/030 -tcEnable030 EQU 31 ; MMU enable bit in TC on 851/030 -pageDesc EQU 1 ; page descriptor -valid4 EQU 2 ; valid 4 byte -valid8 EQU 3 ; valid 8 byte - -transRegs REG d4-d7 - -translate030 - movem.l transRegs,-(sp) ; save working registers - move.l theSRP(a6),d1 ; get root ptr - move.l theCRP(a6),d7 ; get limit in d7 - move.b d7,d3 ; get descriptor type in d3 - and.b #3,d3 ; isolate it - move.l theTC(a6),d0 ; get a copy of the TC in d0 - btst #tcSRE,d0 ; check for SRP mode - bne @paramErr ; >>EXIT if on - btst #tcFCL,d0 ; check for FCL mode - bne @paramErr ; >>EXIT if on - btst #tcEnable030,d0 ; check if MMU is on - bne.s @startTranslate ; IF MMU is off THEN - move.l d2,a1 ; return logical address unchanged - clr.l d1 ; return null for page descriptor addr - moveq #noErr,d3 ; return good status - bra.s @xlatDone ; >>EXIT with physical address -@startTranslate ; ENDIF - clr.l d4 ; clear offset into logical address - move.b initShift(a6),d4 ; add in initial shift - lea levelOne(a6),a1 ; point a1 at width of first field - clr.l d5 ; get a clear longword - move.b (a1)+,d5 ; get width of next field - -;----------------- -; a1.l = pointer to width of next field -; d1.l = current descriptor entry -; d2.l = logical address to translate -; d3.b = descriptor type of current descriptor -; d4.l = offset into logical address of index field -; d5.l = width of index field -; d7.l = limit of current descriptor -;----------------- -@xlatLoop ; LOOP (to walk an MMU table) - cmp.b #pageDesc,d3 ; is this a page descriptor? - beq.s @getPage ; >>BREAK on page descriptor - bfextu d2{d4:d5},d6 ; get index into next table - tst.l d7 ; is there a limit for this table? - beq.s @noLimit ; IF there is a limit THEN - jsr checkLimit ; check the index against the limit - bcs.s @paramErr ; >>EXIT on a limit overflow -@noLimit ; ENDIF - and.l #$fffffff0,d1 ; remove unused bottom byte - cmp.b #valid4,d3 ; check for 4-byte descriptor - bne.s @not4byte ; IF this is a four byte descriptor THEN - add.l myPhys2Log(a6),d1 ; convert current descriptor to logical addr - move.l d1,a2 ; get pointer to next table - lsl.w #2,d6 ; multiple index by four - add.l d6,a2 ; get address of next descriptor - move.l (a2),d1 ; get next descriptor - clr.l d7 ; no limit on this descriptor - move.b d1,d3 ; get a copy of descriptor - bra.s @doNext ; look at next descriptor -@not4byte ; ELSE - cmp.b #valid8,d3 ; check for 8-byte descriptor - bne.s @paramErr ; >>EXITLOOP on invalid descriptors - add.l myPhys2Log(a6),d1 ; convert current descriptor to logical addr - move.l d1,a2 ; get pointer to next table - lsl.w #3,d6 ; multiple index by eight - add.l d6,a2 ; get address of next descriptor - move.l 4(a2),d1 ; get lower word of next descriptor - move.l 0(a2),d7 ; get upper word of next descriptor - move.b d7,d3 ; get a copy of descriptor - -@doNext ; ENDIF - add.l d5,d4 ; update d4 to contain number of bytes decoded - move.b (a1)+,d5 ; get width of next field - and.b #3,d3 ; isolate descriptor type - bra.s @xlatLoop ; ENDLOOP -@getPage - move.l #32,d5 ; total number of bits in address - sub.l d4,d5 ; get number of bits not yet decoded - bfextu d1{0:d4},d0 ; get top bits of address of physical page - bfextu d2{d4:d5},d6 ; get offset into physical page - lsl.l d5,d0 ; make a base address out of it - add.l d6,d0 ; get physical address - move.l d0,a0 ; put address into a1 - moveq #noErr,d3 ; return no error -@xlatDone - movem.l (sp)+,transRegs ; restore registers - rts - -@paramErr - move.w #paramErr,d3 - bra.s @xlatDone - - -;---------------------------------------------------------------------------------- -; translate040 - Translates a logical address to its corresponding physical -; address on a 68040. -; -; input: a6.l = pointer to globals -; d2.l = logical address to translate -; -; output: a0.l = physical address -; a2.l = ptr to page descriptor for translated address -; d3.w = result code -; -; destroys: d0-d1 -;---------------------------------------------------------------------------------- -tcEnable040 EQU 15 ; MMU enable bit in TC on 68040 -UDTResident EQU 1 ; UDT resident bit in table descriptor -PDTResident EQU 1 ; PDT field value for a resident page -PDTIndirect EQU 2 ; PDT field value for an indirect page desc - -translate040 - movem.l transRegs,-(sp) ; save working registers - move.l theSRP(a6),d1 ; get root ptr in a2 - move.w theTC(a6),d0 ; get a copy of the TC in d0 - btst #tcEnable040,d0 ; check if MMU is on - bne.s @startTranslate ; IF MMU is off THEN - move.l d2,a0 ; return logical address unchanged - clr.l d1 ; return null for page descriptor addr - moveq #noErr,d3 ; return good status - bra.s @xlatDone ; >>EXIT with physical address - ; ENDIF -@startTranslate - clr.l d4 ; clear offset into logical address - clr.w d3 ; clear level counter - clr.l d5 ; get a clear longword - lea levelOne(a6),a1 ; init pointer to field widths -;----------------- -; a1.l = pointer to field width info -; d1.l = current descriptor entry -; d2.l = logical address to translate -; d3.w = level counter -; d4.l = offset into logical address of index field -;----------------- -@walkLoop ; LOOP (to walk 68040 table) - move.b (a1)+,d5 ; get width of first index field - move.l #(32-2),d0 ; get total bits in descriptor (table pointer/4) - sub.l d5,d0 ; get number of significant bits in table ptr - bfextu d1{0:d0},d1 ; get pointer to next table - lsl.l d5,d1 ; almost make a base address out of it - lsl.l #2,d1 ; make a base address out of it - bfextu d2{d4:d5},d6 ; get index into next table - lsl.w #2,d6 ; multiple index by four - add.l d6,d1 ; get address of next descriptor - add.l myPhys2Log(a6),d1 ; convert pointer to logical addr - move.l d1,a2 ; put into an address register - move.l (a2),d1 ; get next descriptor - cmp.w #2,d3 ; is this the third level - beq.s @getPage ; >>EXITLOOP if so - btst #UDTResident,d1 ; is it resident? - beq.s @paramErr ; >>EXIT if not - add.l d5,d4 ; update d4 to contain number of bytes decoded - add.w #1,d3 ; bump level count - bra.s @walkLoop ; ENDLOOP -@getPage - move.b d1,d0 ; get a copy of the page descriptor - and.b #3,d0 ; isolate PDT field - cmp.b #PDTResident,d0 ; is this page resident? - beq.s @residentPage ; IF it is not resident THEN - cmp.b #PDTIndirect,d0 ; check for indirect pointer - bne.s @paramErr ; >>EXIT if invalid - and.l #$fffffffc,d1 ; clear PDT field from indirect descriptor - add.l myPhys2Log(a6),d1 ; convert pointer to logical addr - move.l d1,a2 ; get address of page descriptor - move.l (a2),d1 ; get page descriptor -@residentPage ; ENDIF - add.l d5,d4 ; update d4 to contain number of bytes decoded cch - move.l #32,d5 ; total number of bits in address - sub.l d4,d5 ; get number of bits not yet decoded - bfextu d1{0:d4},d0 ; get address of physical page - bfextu d2{d4:d5},d6 ; get offset into physical page - lsl.l d5,d0 ; make a base address out of it - add.l d6,d0 ; get physical address - move.l d0,a0 ; put address into a0 - moveq #noErr,d3 ; return no error -@xlatDone - movem.l (sp)+,transRegs ; restore registers - rts - -@paramErr - move.w #paramErr,d3 - bra.s @xlatDone - - -;---------------------------------------------------------------------------------- -; checkLimit - Checks an index against a limit for an 8-byte descriptor. -; -; input: d6.l = index to be checked -; d7.l = upper word of descriptor -; -; output: ccr.c set on invalid index -; ccr.c clear on valid index -; -; destroys: d7 -;---------------------------------------------------------------------------------- - -checkLimit swap d7 ; get limit into low word - btst #15,d7 ; check type of limit - bne.s @lower ; IF it is an upper limit THEN - cmp.w d6,d7 ; compare upper limit - bra.s @limitExit ; ELSE -@lower and.w #$7fff,d7 ; remove l/u bit - cmp.w d7,d6 ; compare lower limit -@limitExit ; ENDIF - rts - - ENDWITH ENDP ;---------------------------------------------------------------------------------- -; EDiskProtectPPC - Protects or unprotects the EDisk as specified for PowerPC. +; EDiskProtectPPC 7c90 - Protects or unprotects the EDisk as specified for PowerPC. ; ; input: d0[15:0] = HwPriv selector #8 ; d0[16] = set to protect specified area, clear to unprotect it @@ -602,9 +184,6 @@ ProtectRegsPPC REG d2-d4 EDiskProtectPPC PROC EXPORT WITH GetRealVars - cmp.b #EMMU1,MMUType ; check to see if we have a PowerPC MMU - bne @paramErr ; >>EXIT if not - movem.l ProtectRegsPPC,-(sp) ; save working registers ;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ @@ -641,124 +220,6 @@ EDiskProtectPPC PROC EXPORT movem.l (sp)+,ProtectRegsPPC ; restore working registers @return rts -@paramErr move.w #paramErr,d0 ; return paramErr - bra.s @return - - ENDWITH - - ENDP - - - -;---------------------------------------------------------------------------------- -; EDiskProtect - Protects or unprotects the EDisk as specified. -; -; NOTE: This algorithm assumes that the Edisk space is the only space -; mapped by it's 1st level descriptor. -; -; input: d0.w = HwPriv selector #8 -; a0.l = 32-bit base address of EDisk -; a1.w = flag to protect or unprotect Edisk (1=protect) -; -; output: a0.l = pointer to the 1st-level table descriptor for the eDisk -; d0.w = result code -; -; destroys: d1/a1 -;---------------------------------------------------------------------------------- -ProtectRegs REG d2-d4/a2 - -EDiskProtect PROC EXPORT - IMPORT GetMMUInfo - IMPORT checkTTRegs - WITH GetRealVars - - cmp.b #PMMU851,MMUType ; check to see if we have an MMU - blo @bailNoMMU ; >>EXIT if not - - movem.l ProtectRegs,-(sp) ; save working registers - link a6,#GetRealSize ; allocate some room for our locals - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; 68K EDisk Write Protect Code -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -@noEMMU move.l a0,d2 ; get base address of Edisk - move.w a1,a2 ; save protect flag in a2 - - Move SR,D0 ; Get and save the SR. - Btst #13,D0 ; Are we in Supervisor mode? - Bne.s @noVM ; Yes? Then don't call _EnterSupervisorMode. - _EnterSupervisorMode ; Must be in supervisor mode (SR returned in D0). -@noVM - move.w d0,-(sp) ; save status register value - IF Supports24Bit THEN - move.b MMU32Bit,-(sp) ; save current MMU mode - bne.s @in32BitMode ; IF we're in 24-bit mode THEN - moveq #true32b,d0 ; we want to go to 32 bit addressing - _SwapMMUMode ; switch the MMU mode - bra.s @doTranslation ; go do the translation -@in32BitMode ; ELSE - ENDIF - jsr checkTTRegs ; check transparent translation regs - bne.s @doTranslation ; IF we matched a TT register THEN - move.l d2,a0 ; put the original address into a0 - moveq #paramErr,d3 ; return bad status - bra.s @cleanup ; >>EXIT with easy translation - ; ENDIF -@doTranslation ; ENDIF - jsr GetMMUInfo ; set up globals - clr.l d0 ; clear starting bit value - clr.l d1 ; clear bit field length - move.b initShift(a6),d0 ; get bit to start at, with initial shift, if any - move.b levelOne(a6),d1 ; get bit field length - bfextu d2{d0:d1},d0 ; get index into 1st-level table - lsl.l #2,d0 ; convert to a 4-byte entry pointer index - btst.b #0,theCRP+3(a6) ; is this an 8-byte table? - beq.s @is4Byte ; IF this is a 8-byte entry table THEN - lsl.l #1,d0 ; convert to an 8-byte entry pointer index -@is4Byte ; ENDIF - add.l theSRP(a6),d0 ; get the physical address of the 1st-level entry - add.l myPhys2Log(a6),d0 ; convert to a logical address - move.l d0,a0 ; save in a0 - -;------------ -; Change RAM disk protection -;------------ - - move.w #noErr,d3 ; return good result if we get here.

- bset #writeProtectBit,3(a0) ; set the write-protect bit - tst.w a2 ; check if protect flag is set - bne.s @protect ; IF we want to unprotect THEN - bclr #writeProtectBit,3(a0) ; clear the write-protect bit -@protect ; ENDIF - cmp.b #cpu68040,CPUFlag ; check for processor type - bne.s @not040 ; IF on a 68040 THEN - MACHINE MC68040 ; - pflusha ; flush the ATC regs - bra.s @cleanup ; ELSE - MACHINE MC68030 ; -@not040 jsr ([jCacheFlush]) ; flush caches since they're logical

- pflusha ; flush the ATC regs - ; ENDIF - -;------------ -; d3.w = result code -; a0.l = physical address if successful -;------------ -@cleanup - IF Supports24Bit THEN - move.b (sp)+,d0 ; get original MMU mode - bne.s @skipMMUSwap ; IF we were originally in 24-bit mode THEN - _SwapMMUMode ; swap back to it -@skipMMUSwap ; ENDIF - ENDIF - move.w (sp)+,d0 ; get status register value - move d0,sr ; restore status register - move.w d3,d0 ; return result in d0 -@return unlk a6 - movem.l (sp)+,ProtectRegs ; restore working registers -@bailNoMMU - rts - ENDWITH ;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ; That's all folks. diff --git a/OS/MMU/MMU.a b/OS/MMU/MMU.a index 8ef38b4..9d6dd41 100644 --- a/OS/MMU/MMU.a +++ b/OS/MMU/MMU.a @@ -129,7 +129,7 @@ MACHINE MC68030 MMUStuff PROC - EXPORT InitMMUGlobals, InitMMUTrap, MMUCleanupFor8Mb, SwitchMMU + EXPORT InitMMUGlobals, InitMMUTrap, SwitchMMU IMPORT BaseOfROM, Critical, PramIO, RamTest IMPORT RomLoc @@ -138,7 +138,7 @@ MMUStuff PROC ;----- -; InitMMUTrap - set up trap addres for SwapMMUMode +; InitMMUTrap 7930 - set up trap addres for SwapMMUMode ; ; Entry ; jSwapMMU points to correct SwapMMUMode routine @@ -155,7 +155,7 @@ InitMMUTrap ;----- -; InitMMUGlobals - set up vectors & lowmem for SwapMMUMode +; InitMMUGlobals 793c - set up vectors & lowmem for SwapMMUMode ; ; Entry ; BootGlobPtr points to BootGlobs @@ -195,53 +195,16 @@ InitMMUGlobals @NoSwap rts @swaps dc.w @NoSwap-@swaps ; No MMU: no swap routine! - dc.w SwapHMMU-@swaps ; offset to HMMU swap routine + dc.w @NoSwap-@swaps ; offset to HMMU swap routine dc.w @NoSwap-@swaps ; MMB not supported: no swap routine! - dc.w Swap851-@swaps ; offset to 68851 PMMU swap routine + dc.w @NoSwap-@swaps ; offset to 68851 PMMU swap routine dc.w Swap030-@swaps ; offset to 030 PMMU swap routine - dc.w Swap040-@swaps ; offset to 040 PMMU swap routine + dc.w @NoSwap-@swaps ; offset to 040 PMMU swap routine dc.w @NoSwap-@swaps ; future expansion dc.w @NoSwap-@swaps ; future expansion -;----- <3.1> -; MMUCleanupFor8Mb - copies MMU info (tc, crp, tt0, tt1) to below BufPtr. -; -; This is called on systems supporting 24 bit mode that have more than 8mb of RAM -; installed. The MMU info must be at a place that can be accessed in 24 bit mode, -; since the Swap MMU code must access it! -; -; Entry -; System is in 32 bit mode -; MMU24Info (long) points to 24 bit mode MMU configuration info in BootGlobs -; MMU32Info (long) points to 32 bit mode MMU configuration info in BootGlobs -; Exit -; MMU24Info (long) points to 24 bit mode MMU configuration info below BufPtr -; MMU32Info (long) points to 32 bit mode MMU configuration info below BufPtr -; -; Trashes -; d0/a0-a2 -;--- - - WITH MMUConfigInfo - -MMUCleanupFor8Mb - move.l BufPtr,a0 ; get top useable memory - suba.w #2*MMUInfoSize,a0 ; allocate space for config info - move.l a0,BufPtr ; update top useable memory - lea MMU32Info,a1 ; point at ptr to 32 bit mode info - bsr.s @doCopy ; copy it down - lea MMU24Info,a1 ; point at ptr to 32 bit mode info -@doCopy move.l (a1),a2 ; get ptr to info in BootGlobs - move.l a0,(a1) ; update ptr w/new stuff below BufPtr - moveq #MMUInfoSize-1,d0 ; loop counter -@copy move.b (a2)+,(a0)+ ; copy next byte - dbra d0,@copy ; repeat for all bytes - rts - - ENDWITH ; {MMUConfigInfo} - ;----- -; Swap32Only - null MMU swap, used when system has 32 bit addressing only +; Swap32Only 7990 - null MMU swap, used when system has 32 bit addressing only ; ; Entry: ; d0.b 0 to set 24-bit mode, non-zero to set 32-bit mode. @@ -256,84 +219,6 @@ Swap32Only rts -;----- -; Swap851 - switches 68851 PMMU between 24 & 32 bit modes. -; -; Entry -; d0.b 0 to set 24-bit mode, non-zero to set 32-bit mode. -; -; Exit -; MMU32Bit updated with passed value of d0 -; d0.l has previous value of MMU32Bit -; MMU is switched into the desired mode -; -; Trashes: -; d1/a0/a1 -;--- - -Swap851 move.b d0,d1 ; check what mode we are going to, set up d1 - bne.s @to32 ; IF we want 24 bit mode - moveq #0,d0 ; clear return register - move.b MMU32bit,d0 ; see what mode we're in now - beq.s @endif ; IF in 32 bit mode now - move sr,-(sp) ; save current interrupt status - ori #HiIntMask,sr ; disable interrupts during switch - move.l MMU24Info,a0 ; get ptr to 24 bit mode info - bra.s @swap ; go to common swap code - ; ENDIF -@to32 ; ELSE (we want 32 bit mode) - moveq #0,d0 ; clear return register - move.b MMU32bit,d0 ; see what mode we're in now - bne.s @endif ; IF in 24 bit mode - move sr,-(sp) ; save current interrupt status - ori #HiIntMask,sr ; disable interrupts during switch - move.l MMU32Info,a0 ; get ptr to 32 bit mode info - - IF forRomulator THEN ; Assume logical PC <> physical PC <3.7> - -@swap moveq.l #1,d0 ; unset zero flag <3.7> - bra.s @doSwap ; go put PMOVE to TC into i-cache <3.7> -@inCache moveq.l #0,d0 ; set zero flag <3.7> - pmove theCRP(a0),CRP ; set the root pointer <3.7> - lea theTC(a0),a1 ; get address of TC <3.7> - bra.s @doSwap ; go swap modes from i-cache <3.7> - - ; NOTE: the following instructions are put <3.7> - ; . in the i-cache, thus the 4 byte instructions<3.7> - ; . to be executed must start on odd word <3.7> - ; . boundaries so that they are put in on the <3.7> - ALIGN 4 ; . first pass through <3.7> -@doSwap bne.s @step ; (2 bytes) if zero flag not set, skip pmove <3.7> - pmove theCRP(a0),TC ; (4 bytes) disable the 851 <3.7> - ; NOTE: the 851 must be disabled before <3.7> - ; . the TC can be changed. The CRP always <3.7> - ; . has the high bit off, and can be used to <3.7> - ; . disable MMU. Also note that "theCRP" is <3.7> - ; . zero, causing this instruction to be 4 bytes<3.7> -@step nop ; (2 bytes) force next inst to start on odd word<3.7> - bne.s @chk ; (2 bytes) if zero flag not set, skip pmove <3.7> - pmove (a1),TC ; (4 bytes) fire up new TC, flush ATC <3.7> -@chk beq.s @swapped ; (2 bytes) if zero flag set, we're done <3.7> - bra.s @inCache -@swapped ; <3.7> - - ELSE ; <3.7> - -@swap pmove theCRP(a0),tc ; disable the MMU so we can load a new TC value <3.8> - pmove theCRP(a0),crp ; set crp -@thePmove pmove theTC(a0),tc ; fire up the TC - - ENDIF - pflusha ; clean out dirty ATC entries - move.b d1,MMU32Bit ; update global w/new mode flag - movec cacr,d1 ; get cache control register - ori.w #$0008,d1 ; set i-cache 'flush' bit - movec d1,cacr ; flush instruction caches - move (sp)+,sr ; restore interrupt mask - ; ENDIF -@endif ; ENDIF - rts - ;----- ; Swap030 - switches 030 PMMU between 24 & 32 bit modes. ; @@ -383,124 +268,8 @@ Swap030 move.b d0,d1 ; check what mode we are going to, set up d1 rts -;----- -; Swap040 - switches 040 PMMU between 24 & 32 bit modes. <7> -; -; Entry -; d0.b 0 to set 24-bit mode, non-zero to set 32-bit mode. -; -; Exit -; MMU32Bit updated with passed value of d0 -; d0.l has previous value of MMU32Bit -; MMU is switched into the desired mode -; -; Trashes: -; d1/a0 -;--- - - machine mc68040 - -Swap040 move.b d0,d1 ; check what mode we are going to, set up d1 - bne.s @to32 ; IF we want 24 bit mode - moveq #0,d0 ; clear return register - move.b MMU32bit,d0 ; see what mode we're in now - beq.s @endif ; IF in 32 bit mode now - move.l MMU24Info,a0 ; get ptr to 24 bit mode info - bra.s @swap ; go to common swap code - ; ENDIF -@to32 ; ELSE (we want 32 bit mode) - moveq #0,d0 ; clear return register - move.b MMU32bit,d0 ; see what mode we're in now - bne.s @endif ; IF in 24 bit mode - move.l MMU32Info,a0 ; get ptr to 32 bit mode info -@swap move sr,-(sp) ; save current interrupt status - ori #HiIntMask,sr ; disable interrupts during switch - move.b d1,MMU32Bit ; update global w/new mode flag - move.l theTT0(a0),d1 ; get transparent translation reg 0 value - movec d1,itt0 ; load the instruction TT0 reg - movec d1,dtt0 ; load the data TT0 reg with the same value - move.l theTT1(a0),d1 ; get transparent translation reg 1 value - movec d1,itt1 ; load the instruction TT0 reg - movec d1,dtt1 ; load the data TT0 reg with the same value - move.l theTC(a0),d1 ; get the TC value in d1 - move.l theSRP(a0),a0 ; get the SRP value in a0 - movec a0,SRP ; set the SRP with new pointer - movec d1,TC ; set the TC with the new value - pflusha ; flush the ATC entries - move (sp)+,sr ; restore interrupt mask - ; ENDIF -@endif ; ENDIF - rts - - machine mc68030 ; - -;----- -; SwapHMMU - switches HMMU between 24 & 32 bit modes. -; -; This routine has a fix for the problem of losing sound interrupts when switching -; MMU modes. On HMMU Mac II's, a bit on Via2 portB switches the MMU mode. -; Unfortunately, hitting this bit clears the CB1 interrupt flag, which is -; the ASC interrupt. -; -; Since the interrupt handlers all call SwapMMUMode to switch into 24 bit mode -; before processing interrutps, an ASC interrupt that occurs after the -; original interrupt could be lost. -; -; This routine reduces the window for losing ASC interrupts to the minimum -; possible, which is half an instruction. After switching MMU modes, -; it checks the ASC's interrupt register, and if any interrupts are present -; (but lost because the CB1 flag was cleared), it OR's the interrupt register back -; to itself. The ASC then generates a new interrupt. -; -; Entry -; d0.b 0 to set 24-bit mode, non-zero to set 32-bit mode. -; -; Exit -; MMU32Bit updated with passed value of d0 -; d0.l has previous value of MMU32Bit -; MMU is switched into the desired mode -; -; Trashes: -; d1/a0 -;--- - -SwapHMMU - move.b d0,d1 ; check what mode desired, save it - bne.s @1 ; IF we want 24 bit mode - moveq #0,d0 ; clear return register - move.b MMU32bit,d0 ; see what mode we're in now - beq.s @3 ; IF in 32 bit mode now - move sr,-(sp) ; save current interrupt status - ori #HiIntMask,sr ; disable interrupts during switch - move.l VIA2RBV,a0 ; get ptr to 2nd Via - bclr #vFC3,vBufB(a0) ; throw us into 24 bit mode - bra.s @common ; (re-use common code) -@1 ; ELSE (we want 32 bit mode) - moveq #0,d0 ; clear return register - move.b MMU32bit,d0 ; see (and return) what mode we're in now - bne.s @3 ; IF in 24 bit mode now - move sr,-(sp) ; save current interrupt status - ori #HiIntMask,sr ; disable interrupts during switch - move.l VIA2RBV,a0 ; get ptr to 2nd Via - bset #vFC3,vBufB(a0) ; throw us into 32 bit mode -@common move.b d1,MMU32Bit ; update global w/new mode flag - movec cacr,d1 ; get cache control register - bset #3,d1 ; set icache flush bit - movec d1,cacr ; flush da cache, Guido - move.l ASCBase,a0 ; point to ASC - adda.w #ascFifoInt,a0 ; point to ASC interrupt register - move.b (a0),d1 ; get ASC interrupt register - beq.s @2 ; IF ASC thinks interrupt is pending - or.b d1,(a0) ; re-generate interrupt to VIA's CB1 -@2 ; ENDIF - move (sp)+,sr ; restore interrupt mask - ; ENDIF -@3 ; ENDIF - rts - - ;--------------------------------------------------- -; MMU switch code, for Unix & Pink. +; MMU switch code, for Unix & Pink. 79ec ; ; Turns off the MMU, flushes ATC, then re-enables the MMU with passed info. ; @@ -525,33 +294,6 @@ SwapHMMU SwitchMMU -@TestCPU sub.l d0,d0 ; D0 = 0 - bset #CACR_DE_040,d0 ; set Data Cache Enable bit on 040s - movec d0,CACR ; attempt to enable data cache (temporarily) - movec CACR,d0 ; check and see if it's still there - btst #CACR_DE_040,d0 ; see if the bit exists in CACR - beq.s @isNot040 - - - MACHINE MC68040 ; IF we're on a 68040 THEN - -@is040 movec CACR,d0 ; retrieve cache control register - move.l d0,d1 ; save a copy for later restoration - sub.l d0,d0 ; clear D0 to disable caches (see diagram above) - movec d0,CACR ; disable both caches - movec d0,TC ; disable the ATC - pflusha ; flush ATC - movea.l theCRP(a0),a2 ; retrieve the new CRP (= URP on the 040) into D0 - move.l theTC(a0),d0 ; retrieve the new TC into D0 - movec a2,URP ; set up the URP - movec d0,TC ; ... and the TC - cpusha bc ; flush both caches (dirty data only pushed out of - ; the data cache. inst. cache CPUSH = CINV) - movec d1,cacr ; re-enable caches - bra.s @allDone - - MACHINE MC68030 ; ELSE we're on a 68030/68020 - @isNot040 movec cacr,d0 ; get 020/030 cache control reg move.w d0,d1 ; save it andi #$FEFE,d0 ; clear cache enable bits diff --git a/OS/MMU/MMU.make b/OS/MMU/MMU.make index 02a0ac1..2310492 100644 --- a/OS/MMU/MMU.make +++ b/OS/MMU/MMU.make @@ -15,8 +15,8 @@ MMUObjs = "{ObjDir}MMU.a.o" "{ObjDir}MMUTables.a.o" ¶ "{ObjDir}GetReal.a.o" -"{LibDir}MMU.lib" Ä {MMUObjs} - Lib {StdLibOpts} {MMUObjs} -o "{Targ}" +# "{LibDir}MMU.lib" Ä {MMUObjs} +# Lib {StdLibOpts} {MMUObjs} -o "{Targ}" diff --git a/OS/MMU/MMUTables.a b/OS/MMU/MMUTables.a index f02a4c7..154c2f4 100644 --- a/OS/MMU/MMUTables.a +++ b/OS/MMU/MMUTables.a @@ -238,7 +238,6 @@ MACHINE MC68030 MMUStuff PROC EXPORT InitMMU - EXPORT Trans IMPORT BaseOfROM, Critical, PramIO, RamTest IMPORT RomLoc IMPORT SizeSoundBuffer @@ -267,16 +266,6 @@ MMUStuff PROC ; is set. ;--- - MACRO -&label Setup &tc,&tt0,&tt1,&template,&special,&physical -&label dc.l &tc - dc.l &tt0 - dc.l &tt1 - dc.w &template-&label - dc.w &special-&label - dc.w &physical-&label - ENDM - MMUSetupInfo RECORD 0,INCR newtc ds.l 1 ; translation control register newtt0 ds.l 1 ; transparent translation reg 0 @@ -289,44 +278,6 @@ size equ * ; size of each table entry WITH MMUSetupInfo -; transp. transp offset to offset to offset to -; TC xlat 0 xlat 1 template special template physical template -; -------- --------- --------- ----------- ---------------- ---------------- -contig24 Setup $80F84500, 0, 0, template24, 0, physNormal -contig32 Setup $80F05750, 0, 0, template32, void32, physNormal -split24 Setup $80F84500, 0, 0, template24, 0, physNormal -split1mb32 Setup $80F05750, 0, 0, template32, void32, physNormal -split2mb32 Setup $80F05660, 0, 0, template32, void32, physNormal -split4mb32 Setup $80F05570, 0, 0, template32, void32, physNormal -split8mb32 Setup $80F05480, 0, 0, template32, void32, physNormal -split16mb32 Setup $80F08900, 0, 0, template32, void32, physNormal -split32mb32 Setup $80F07A00, 0, 0, template32, void32, physNormal -split64mb32 Setup $80F06B00, 0, 0, template32, void32, physNormal -Rbv24b Setup $80F84500, 0, 0, template24RBVb, 0, physRBVb ; <11> -Rbv32b Setup $80F05750, 0, 0, Template32RBVb, void32RBVb, physRBVb ; <11> -Rbv24e Setup $80F84500, 0, 0, template24RBVe, 0, physRBVe ; <11> -Rbv32e Setup $80F05750, 0, 0, Template32RBVe, void32RBVe, physRBVe ; <11> -orwell24 Setup $C000, 0, 0, template24Orwell, 0, physOrwell ; -orwell32 Setup $C000, $F900C060, $807FC040, Template32Orwell, void32Orwell, physOrwell ; -Jaws24 Setup $80F84500, 0, 0, template24Jaws, 0, physLCD ; <9> -Jaws32 Setup $80F05750, 0, 0, template32Jaws, void32Jaws, physLCD ; <9> -MSC24 Setup $80D86500, 0, 0, template24MSC, 0, physMSC ; -MSC32 Setup $80D07750, $600F8507, $807F8507, template32MSC, void32MSC, physMSC ; -MSC24040 Setup $C000, 0, 0, template24MSC040, 0, physMSC ; -MSC32040 Setup $C000, $600FC060, $807FC060, template32MSC040, void32MSC, physMSC ; -Niagra24 Setup $80D86500, 0, 0, template24Niagra, 0, physNiagra ; -Niagra32 Setup $80D07750, $600F8507, 0, template32Niagra, void32Niagra, physNiagra ; -Sonora24 Setup $80D86500, 0, 0, template24Sonora, 0, physSonora ; -Sonora32 Setup $80D07750, $600F8507, $807F8507, template32Sonora, void32Sonora, physSonora ; -FstrFrms24 Setup $80F84500, 0, 0, templateFF24, 0, physFF ; CSS -FstrFrms32 Setup $80F05750, 0, 0, templateFF32, 0, physFF ; CSS -YMCA24 Setup $C000, 0, 0, template24YMCA, 0, physYMCA ; CSS -YMCA32 Setup $C000, $F900C060, $807FC040, Template32YMCA, void32YMCA, physYMCA ; CSS -SnraForty24 Setup $C000, 0, 0, template24SnraFrty, 0, physSonora ; -SnraForty32 Setup $C000, $600FC060, $807FC040, template32SnraFrty, void32Sonora, physSonora ; -Pratt24 Setup $C000, 0, 0, template24Pratt, 0, physPratt ; -Pratt32 Setup $C000, $A01FC040, $600FC060, template32Pratt, void32Pratt, physPratt ; - ;----- ; The template tables describe the logical to physical address mapping. ; @@ -540,417 +491,6 @@ physNflag ds.l 1 ; suggested physical address, & flags <7> tEntrySize equ * ; size of a template entry ENDR - MACRO -&label tp &span,&physNflag -&label dc.l &span - dc.l &physNflag ; <7> - ENDM - -Template32 - tp bRom32-bRam, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o and/or video - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isThru+cInhibit ; slots - -Template32RBVb ; RBV in Slot B - tp bRom32-bRam, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp RBVWrap32b-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots - tp RBVBase32b-RBVWrap32b, isVidWrap ; wrap area <11> - tp RBVEnd32b-RBVBase32b, isVideo ; frame buffer area <11> - tp (bTop32Less1-RBVEnd32b)+1, isThru+cInhibit ; rest of slots <11> - -Template32RBVe ; RBV in Slot E <11> - tp bRom32-bRam, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp RBVWrap32e-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots - tp RBVBase32e-RBVWrap32e, isVidWrap ; wrap area - tp RBVEnd32e-RBVBase32e, isVideo ; frame buffer area - tp (bTop32Less1-RBVEnd32e)+1, isThru+cInhibit ; rest of slots - -Template32Orwell ; <7> - tp bRealRom32-bRam, isRAM+c040CopyBack ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+c040CopyBack; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp bNonSerEyeOh-bRealEyeOh32, isThru+c040InhibitSer ; ser i/o - tp (bNonSerEyeOh+IOMaxSize)-bNonSerEyeOh, isThru+c040InhibitNonSer ; non-ser i/o - tp bRamDisk-(bNonSerEyeOh+IOMaxSize), isVoid ; Invalid - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp (bTop32Less1-(bRamDisk+EDskMaxSize))+1, isVoid ; slots (uses TTx regs) - -Template32Jaws - tp bRom32-bRam, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp LCDWrap32-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots - tp LCDBase32-LCDWrap32, isVidWrap ; wrap area - tp LCDEnd32-LCDBase32, isVideoRAM ; frame buffer area - tp (bTop32Less1-LCDEnd32)+1, isThru+cInhibit ; rest of slots - -Template32MSC ; - tp bRealRom32-bRam, isRAM+FullTbl ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+FullTbl ; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp b32VidBase-bRealEyeOh32, isThru+cInhibit ; i/o - tp bRamDisk-b32VidBase, isVoid ; video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isVoid ; slots (uses TT1) - -Template32MSC040 - tp bRealRom32-bRam, isRAM+c040CopyBack ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+c040CopyBack ; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp b32VidBase-bRealEyeOh32, isThru+c040InhibitSer ; i/o - tp bRamDisk-b32VidBase, isVoid ; video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isVoid ; slots (uses TT1) - -Template32SnraFrty ; - tp bRealRom32-bRam, isRAM+c040CopyBack ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+c040CopyBack ; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp bNonSerEyeOh-bRealEyeOh32, isThru+c040InhibitSer ; ser i/o - tp (bNonSerEyeOh+IOMaxSize)-bNonSerEyeOh, isThru+c040InhibitNonSer; non-ser i/o - tp (b32VidBase-$2000)-(bNonSerEyeOh+IOMaxSize), isVoid ; Invalid - tp b32VidBase-(b32VidBase-$2000), isThru+c040InhibitSer ; CPU ID Register - tp bRamDisk-b32VidBase, isVoid ; Video (uses TTx regs) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp (bTop32Less1-(bRamDisk+EDskMaxSize))+1, isVoid ; slots (uses TTx regs) - -Template32Sonora ; - tp bRealRom32-bRam, isRAM+FullTbl ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+FullTbl ; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp b32VidBase-bRealEyeOh32, isThru+cInhibit ; I/O - tp bRamDisk-b32VidBase, isThru+cInhibit ; Video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isVoid ; slots (uses TT1) - -Template32Niagra ; - tp bRealRom32-bRam, isRAM+FullTbl ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+FullTbl ; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp b32VidBase-bRealEyeOh32, isThru+cInhibit ; i/o - tp bRamDisk-b32VidBase, isVoid ; video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp b32SlotE-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots thru E - tp (b32SlotF-DeclRomSize)-b32SlotE, isThru+cInhibit ; slot E up to config ROM - tp b32SlotF-(b32SlotF-DeclRomSize), bRealRom32+isMap+cInhibit ; slot E Config ROM - tp bTop32Less1-b32SlotF+1, isThru+cInhibit ; slots - -Template32YMCA ; CSS - tp bRealRom32-bRam, isRAM+c040CopyBack ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+c040CopyBack; ROM - tp bVideo32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp bVRAM32 -bVideo32, isThru+c040InhibitNonSer ; non-ser video I/O. - tp (bVRAM32+VRAMMaxSize)-bVRAM32, isThru+c040InhibitNonSer ; non-ser VRAM. - tp bRealEyeOh32 -(bVRAM32+VRAMMaxSize), isVoid ; Invalid - tp bNonSerEyeOh-bRealEyeOh32, isThru+c040InhibitSer ; ser i/o - tp (bNonSerEyeOh+IOMaxSize)-bNonSerEyeOh, isThru+c040InhibitNonSer ; non-ser i/o - tp bRamDisk-(bNonSerEyeOh+IOMaxSize), isVoid ; Invalid - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp (bTop32Less1-(bRamDisk+EDskMaxSize))+1, isVoid ; slots (uses TTx regs) - -Template32Pratt - tp bRom32-bRam, isRAM+c040CopyBack ; RAM - -; IMPORTANT! The following two lines contain the expression 2*ROMMaxSize so that we can overlay -; the emulation monitor for the HP 040 emulator into a valid address range. For the final product, -; we don't need the factor of 2 (i.e. just use ROMMaxSize instead). - tp (bRom32+2*ROMMaxSize)-bRom32, isROM32+c040CopyBack ; ROM - tp bEyeOh32-(bRom32+2*ROMMaxSize), isVoid ; Invalid - - tp bNonSerIO-bEyeOh32, isThru+c040InhibitSer ; ser i/o - tp b32VidBase-bNonSerIO, isThru+c040InhibitNonSer ; non-ser i/o - tp bRamDisk-b32VidBase, isVoid ; Invalid - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp b32SlotA-(bRamDisk+EDskMaxSize), isVoid ; Invalid - tp b32SlotC-b32SlotA, isThru+c040InhibitSer ; Minor slot spaces A and B - tp b32SlotE-b32SlotC, isVoid ; Invalid - tp (b32SlotF-DeclRomSz)-b32SlotE, isThru+c040InhibitSer ; map beginning of slot E thru - tp b32SlotF-(b32SlotF-DeclRomSz), ($402e0000-DeclRomSz)+isMap+c040InhibitSer; slot E Config ROM - tp bTop32Less1-b32SlotF+1, isVoid ; slot f not used - -Template24 - tp bRom24-bRam, isRAM ; RAM - tp b24Slot9-bRom24, isROM24 ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+cInhibit ; minor slot 9 <7> - tp b24SlotB-b24SlotA, b32SlotA+isMap+cInhibit ; minor slot A <7> - tp b24SlotC-b24SlotB, b32SlotB+isMap+cInhibit ; minor slot B <7> - tp b24SlotD-b24SlotC, b32SlotC+isMap+cInhibit ; minor slot C <7> - tp b24SlotE-b24SlotD, b32SlotD+isMap+cInhibit ; minor slot D <7> - tp bEyeOh24-b24SlotE, b32SlotE+isMap+cInhibit ; minor slot E <7> - tp (bTop24Less1-bEyeOh24)+1, bEyeOh32+isMap+cInhibit ; i/o <7> - -Template24RBVb ; RBV in Slot B <11> - tp bRom24-bRam, isRAM ; RAM - tp b24Slot9-bRom24, isROM24 ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+cInhibit ; minor slot 9 <7> - tp RBVWrap24b-b24SlotA, b32SlotA+isMap+cInhibit ; minor slot A <7><11> - tp RBVBase24b-RBVWrap24b, isVidWrap ; wrap area <11> - tp RBVEnd24b-RBVBase24b, isVideo ; frame buffer area <11> - tp b24SlotD-RBVEnd24b, b32SlotC+isMap+cInhibit ; minor slot C <7><11> - tp b24SlotE-b24SlotD, b32SlotD+isMap+cInhibit ; minor slot D <7> - tp bEyeOh24-b24SlotE, b32SlotE+isMap+cInhibit ; minor slot E <7> - tp bTop24Less1-bEyeOh24+1, bEyeOh32+isMap+cInhibit ; i/o <7> - -Template24RBVe ; <11> - tp bRom24-bRam, isRAM ; RAM - tp b24Slot9-bRom24, isROM24 ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+cInhibit ; minor slot 9 - tp b24SlotB-b24SlotA, b32SlotA+isMap+cInhibit ; minor slot A - tp b24SlotC-b24SlotB, b32SlotB+isMap+cInhibit ; minor slot B - tp b24SlotD-b24SlotC, b32SlotC+isMap+cInhibit ; minor slot C - tp RBVWrap24e-b24SlotD, b32SlotD+isMap+cInhibit ; minor slot D - tp RBVBase24e-RBVWrap24e, isVidWrap ; wrap area - tp RBVEnd24e-RBVBase24e, isVideo ; frame buffer area - tp bEyeOh24-RBVEnd24e, isVoid ; invalid - tp bTop24Less1-bEyeOh24+1, bEyeOh32+isMap+cInhibit ; i/o - -Template24Orwell ; <7> - tp bRom24-bRam, isRAM+c040CopyBack ; RAM <16> - tp b24Slot9-bRom24, isROM24+c040CopyBack ; ROM <16> - tp b24SlotA-b24Slot9, b32Slot9+isMap+c040InhibitNonSer ; minor slot 9 <16> - tp b24SlotB-b24SlotA, b32SlotA+isMap+c040InhibitSer ; minor slot A <16> - tp b24SlotC-b24SlotB, b32SlotB+isMap+c040InhibitSer ; minor slot B <16> - tp b24SlotD-b24SlotC, b32SlotC+isMap+c040InhibitSer ; minor slot C <16> - tp b24SlotE-b24SlotD, b32SlotD+isMap+c040InhibitSer ; minor slot D <16> - tp bEyeOh24-b24SlotE, b32SlotE+isMap+c040InhibitSer ; minor slot E <16> - tp IOMaxSize,bRealEyeOh32+isMap+c040InhibitSer ; serialized i/o - tp IOMaxSize,bNonSerEyeOh+isMap+c040InhibitNonSer ; nonserialized i/o - tp bTop24Less1-(bEyeOh24+(2*IOMaxSize))+1, isVoid ; void - tp bTop32Less1-bTop24Less1+1, isWrap24 ; 24-bit wrap area - -Template24Jaws ; <9> - tp bRom24-bRam, isRAM ; RAM - tp b24Slot9-bRom24, isROM24 ; ROM <13> - tp LCDWrap24-b24Slot9, isVoid ; invalid <13> - tp LCDBase24-LCDWrap24, isVidWrap ; wrap area - tp LCDEnd24-LCDBase24, isVideoRAM ; frame buffer area - tp bEyeOh24-LCDEnd24, isVoid ; invalid - tp bTop24Less1-bEyeOh24+1, bEyeOh32+isMap+cInhibit ; i/o - -Template24MSC ; - tp bRom24-bRam, isRAM+FullTbl ; RAM - tp b24Slot9-bRom24, isROM24+FullTbl ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+cInhibit ; minor slot 9 - tp b24SlotB-b24SlotA, b32SlotA+isMap+cInhibit ; minor slot A - tp b24SlotC-b24SlotB, b32SlotB+isMap+cInhibit ; minor slot B - tp b24SlotD-b24SlotC, b32SlotC+isMap+cInhibit ; minor slot C - tp b24SlotE-b24SlotD, b32SlotD+isMap+cInhibit ; minor slot D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+cInhibit ; minor slot E - tp bTop24Less1-bEyeOh24+1, bRealEyeOh32+isMap+cInhibit ; i/o - -Template24MSC040 ; - tp bRom24-bRam, isRAM+c040CopyBack ; RAM - tp b24Slot9-bRom24, isROM24+c040CopyBack ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+c040InhibitSer ; minor slot 9 - tp b24SlotB-b24SlotA, b32SlotA+isMap+c040InhibitSer ; minor slot A - tp b24SlotC-b24SlotB, b32SlotB+isMap+c040InhibitSer ; minor slot B - tp b24SlotD-b24SlotC, b32SlotC+isMap+c040InhibitSer ; minor slot C - tp b24SlotE-b24SlotD, b32SlotD+isMap+c040InhibitSer ; minor slot D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+c040InhibitSer ; minor slot E - tp bTop24Less1-bEyeOh24+1, bRealEyeOh32+isMap+c040InhibitSer ; i/o - tp bTop32Less1-bTop24Less1+1, isWrap24 ; 24-bit wrap area - -Template24Niagra ; - tp bRom24-bRam, isRAM+FullTbl ; RAM - tp b24Slot9-bRom24, isROM24+FullTbl ; ROM - tp b24SlotC-b24Slot9, isVoid ; invalid - tp b24SlotD-b24SlotC, b32SlotC+isMap+cInhibit ; minor slot C - tp b24SlotE-b24SlotD, b32SlotD+isMap+cInhibit ; minor slot D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+cInhibit ; minor slot E - tp bTop24Less1-bEyeOh24+1, bRealEyeOh32+isMap+cInhibit ; i/o - -Template24SnraFrty ; - tp bRom24-bRam, isRAM+c040CopyBack ; RAM - tp b24Slot9-bRom24, isROM24+c040CopyBack ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+c040InhibitSer ; minor slot 9 - tp b24SlotB-b24SlotA, b32SlotA+isMap+c040InhibitSer ; minor slot A - tp b24SlotC-b24SlotB, $60B00000+isMap+c040InhibitNonSer ; Video RAM - tp b24SlotD-b24SlotC, b32SlotC+isMap+c040InhibitSer ; minor slot C - tp b24SlotE-b24SlotD, b32SlotD+isMap+c040InhibitSer ; minor slot D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+c040InhibitSer ; minor slot E - tp b24DblX-bEyeOh24, bRealEyeOh32+isMap+c040InhibitSer ; i/o - tp (bTop24Less1-b24DblX)+1, $FEE00000+isMap+c040InhibitSer ; Double X slot space - tp bTop32Less1-bTop24Less1+1, isWrap24 ; 24-bit wrap area - -Template24Sonora - tp bRom24-bRam, isRAM+FullTbl ; RAM - tp b24Slot9-bRom24, isROM24+FullTbl ; ROM - tp b24SlotA-b24Slot9, b32Slot9+isMap+cInhibit ; minor slot 9 - tp b24SlotB-b24SlotA, b32SlotA+isMap+cInhibit ; minor slot A - tp b24SlotC-b24SlotB, $60B00000+isMap+cInhibit ; Video RAM - tp b24SlotD-b24SlotC, b32SlotC+isMap+cInhibit ; minor slot C - tp b24SlotE-b24SlotD, b32SlotD+isMap+cInhibit ; minor slot D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+cInhibit ; minor slot E - tp b24DblX-bEyeOh24, bRealEyeOh32+isMap+cInhibit ; i/o - tp (bTop24Less1-b24DblX)+1, b24SlotE+isMap+cInhibit ; Double X slot space - -Template24YMCA ; - tp bRom24-bRam, isRAM+c040CopyBack ; RAM - tp b24Slot9-bRom24, isROM24+c040CopyBack ; ROM - tp b24SlotA-b24Slot9, $40900000 + isMap ; Slot 9 is 2nd meg of ROM. - tp b24SlotB-b24SlotA, b32SlotA+isMap+c040InhibitSer ; minor slot A - tp b24SlotC-b24SlotB, b32SlotB+isMap+c040InhibitSer ; minor slot B - tp b24SlotD-b24SlotC, b32SlotC+isMap+c040InhibitSer ; minor slot C - tp b24SlotE-b24SlotD, b32SlotD+isMap+c040InhibitSer ; minor slot D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+c040InhibitSer ; minor slot E - tp IOMaxSize,bRealEyeOh32+isMap+c040InhibitSer ; serialized i/o - tp IOMaxSize,bNonSerEyeOh+isMap+c040InhibitNonSer ; nonserialized i/o - tp bTop24Less1-(bEyeOh24+(2*IOMaxSize))+1, isVoid ; void - tp bTop32Less1-bTop24Less1+1, isWrap24 ; 24-bit wrap area - -Template24Pratt ; - tp bRom24-bRam, isRAM+c040CopyBack ; RAM - tp b24Slot9-bRom24, isROM24+c040CopyBack ; ROM - tp b24SlotA-b24Slot9, isVoid ; invalid - tp b24SlotC-b24SlotA, b32SlotC+isMap+c040InhibitSer ; minor slots A-B - tp b24SlotE-b24SlotC, isVoid ; minor slots C-D - tp bEyeOh24-b24SlotE, b32SlotE+isMap+c040InhibitSer ; minor slot E - tp bTop24Less1-bEyeOh24+1, bRealEyeOh32+isMap+c040InhibitSer ; i/o - -Void32 - tp HoleLowMem-bRam, isRAM ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRom32 - HoleSysHeap, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isThru+cInhibit ; slots - -Void32RBVb - tp HoleLowMem-bRam, isRAM ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRom32 - HoleSysHeap, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp RBVWrap32b-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots - tp RBVBase32b-RBVWrap32b, isVidWrap ; wrap area - tp RBVEnd32b-RBVBase32b, isVideo ; frame buffer area - tp (bTop32Less1-RBVEnd32b)+1, isThru+cInhibit ; rest of slots - -Void32RBVe - tp HoleLowMem-bRam, isRAM ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRom32 - HoleSysHeap, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp RBVWrap32e-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots - tp RBVBase32e-RBVWrap32e, isVidWrap ; wrap area - tp RBVEnd32e-RBVBase32e, isVideo ; frame buffer area - tp bTop32Less1-RBVEnd32e+1, isThru+cInhibit ; rest of slots - -Void32Orwell ; - tp HoleLowMem-bRam, isRAM+c040CopyBack ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRealRom32-HoleSysHeap, isRAM+c040CopyBack ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+c040CopyBack; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp bNonSerEyeOh-bRealEyeOh32, isThru+c040InhibitSer ; ser i/o - tp (bNonSerEyeOh+IOMaxSize)-bNonSerEyeOh, isThru+c040InhibitNonSer ; non-ser i/o - tp bRamDisk-(bNonSerEyeOh+IOMaxSize), isVoid ; Invalid - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp (bTop32Less1-(bRamDisk+EDskMaxSize))+1, isVoid ; slots (uses TTx regs) - -Void32Jaws ; <9> - tp HoleLowMem-bRam, isRAM ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRom32 - HoleSysHeap, isRAM ; RAM - tp bEyeOh32-bRom32, isROM32 ; ROM - tp bRamDisk-bEyeOh32, isThru+cInhibit ; i/o - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp LCDWrap32-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots - tp LCDBase32-LCDWrap32, isVidWrap ; wrap area - tp LCDEnd32-LCDBase32, isVideo ; frame buffer area - tp bTop32Less1-LCDEnd32+1, isThru+cInhibit ; rest of slots - -Void32MSC ; - tp HoleLowMem-bRam, isRAM+FullTbl ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRealRom32 - HoleSysHeap, isRAM+FullTbl ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32 ; ROM - tp b32VidBase-(bRealRom32+ROMMaxSize), isThru+cInhibit ; i/o - tp bRamDisk-b32VidBase, isVoid ; video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isVoid ; slots (uses TT1) - -Void32Sonora ; - tp HoleLowMem-bRam, isRAM+FullTbl ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRealRom32-HoleSysHeap, isRAM+FullTbl ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32 ; ROM - tp b32VidBase-(bRealRom32+ROMMaxSize), isThru+cInhibit ; I/O - tp bRamDisk-b32VidBase, isVoid ; Video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp (bTop32Less1-(bRamDisk+EDskMaxSize))+1, isVoid ; slots (uses TTx regs) - -Void32Niagra ; - tp HoleLowMem-bRam, isRAM+FullTbl ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRealRom32 - HoleSysHeap, isRAM+FullTbl ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32 ; ROM - tp b32VidBase-(bRealRom32+ROMMaxSize), isThru+cInhibit ; i/o - tp bRamDisk-b32VidBase, isVoid ; video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk ; Ram Disk - tp b32SlotE-(bRamDisk+EDskMaxSize), isThru+cInhibit ; slots thru E - tp (b32SlotF-DeclRomSize)-b32SlotE, isThru+cInhibit ; slot E up to config ROM - tp b32SlotF-(b32SlotF-DeclRomSize), bRealRom32+isMap+cInhibit; slot E Config ROM - tp bTop32Less1-b32SlotF+1, isThru+cInhibit ; slots - -TemplateFF24 ; CSS - tp FFbShadow-bRam, isRAM ; RAM - tp FFtRom24-FFbShadow, isThru ; ROM - tp t24SlotE-FFtRom24, b32SlotE+isMap+cInhibit ; Slot E - tp FFtEyeOh24-t24SlotE, isThru+cInhibit ; I/O space - tp FFtDblxSlot24-FFtEyeOh24, b24SlotE+isMap+cInhibit ; Slot E (64k), for DblX - tp bTop24Less1-FFtDblxSlot24+1, isThru+cInhibit ; rest of I/O space - -TemplateFF32 - tp FFbShadow-bRam, isRAM ; RAM - tp FFtShadow-FFbShadow, isThru ; Shadowed area - tp FFbRom32-FFtShadow, isRAM ; RAM - tp FFtRom32-FFbRom32, FFbRom24+isMap ; ROM - tp FFbEyeOh32-FFtRom32, isVoid ; unmapped space - tp FFtEyeOh32-FFbEyeOh32, bEyeOh24+isMap+cInhibit ; I/O space - tp FFtDblXSlot32-FFtEyeOh32, b24SlotE+isMap+cInhibit ; Slot E (64k), for DblX - tp bRAMDisk-FFtDblXSlot32, isThru+cInhibit ; bank switch reg in here - tp bRamDisk+EDskMaxSize-bRamDisk, isEdisk ; Ram Disk - tp bTop32Less1-(bRamDisk+EDskMaxSize)+1, isThru+cInhibit ; Rest of slot space - -Void32YMCA ; CSS - tp HoleLowMem-bRam, isRAM+c040CopyBack ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRealRom32-HoleSysHeap, isRAM+c040CopyBack ; RAM - tp (bRealRom32+ROMMaxSize)-bRealRom32, isROM32+c040CopyBack; ROM - tp bRealEyeOh32-(bRealRom32+ROMMaxSize), isVoid ; Invalid - tp bNonSerEyeOh-bRealEyeOh32, isThru+c040InhibitSer ; ser i/o - tp (bNonSerEyeOh+IOMaxSize)-bNonSerEyeOh, isThru+c040InhibitNonSer ; non-ser i/o - tp bRamDisk-(bNonSerEyeOh+IOMaxSize), isVoid ; Invalid - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp (bTop32Less1-(bRamDisk+EDskMaxSize))+1, isVoid ; slots (uses TTx regs) - -Void32Pratt ; - tp HoleLowMem-bRam, isRAM+c040CopyBack ; low memory: RAM - tp HoleSysHeap - HoleLowMem, isVoid ; black hole - tp bRom32 - HoleSysHeap, isRAM+c040CopyBack ; RAM - tp (bRom32+ROMMaxSize)-bRom32, isROM32 ; ROM - tp b32VidBase-(bRom32+ROMMaxSize), isThru+c040InhibitSer ; i/o - tp bRamDisk-b32VidBase, isVoid ; video (uses TT0) - tp (bRamDisk+EDskMaxSize)-bRamDisk, isEdisk+c040CopyBack ; Ram Disk - tp b32SlotE-(bRamDisk+EDskMaxSize), isThru+c040InhibitSer ; slots thru E - tp (b32SlotF-DeclRomSize)-b32SlotE, isThru+c040InhibitSer ; slot E up to config ROM - tp b32SlotF-(b32SlotF-DeclRomSize), bRom32+c040InhibitSer ; slot E Config ROM - tp bTop32Less1-b32SlotF+1, isThru+c040InhibitSer ; slots - ;----- ; The physical template tables describe the significant sections of the pysical address space. ; These templates are used ONLY to generate the 'physical table', which is passed to VM and @@ -1018,752 +558,8 @@ firstEntry DS.B PhysicalSpaceBlock ; first in variable-sized table ENDIF -physNormal dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40000000, $10000000 - dc.l $40000000, $10000000 - dc.l $00800000, $00100000 ; - - dc.w kUsageIO, notCacheable - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l $00F00000, $00100000 - - dc.w kUsageMajorSlot, notCacheable - dc.l $60000000, $10000000 - dc.l $60000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $90000000, $10000000 - dc.l $90000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $B0000000, $10000000 - dc.l $B0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable - dc.l $F9000000, $01000000 - dc.l $F9000000, $01000000 - dc.l $00900000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FB000000, $01000000 - dc.l $FB000000, $01000000 - dc.l $00B00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageEndTable - -;--- -; Max size of buffer for physical table = size of above fized stuff, plus entries for -; max # of RAM chunks, plus video and video wrapping space, plus bootglobals space <3.2> -; plus a few more just to be safe. <3.2> -;--- - -physBufSize equ *-physNormal + (sgMaxChunks+6) * PhysicalSpaceBlock.size ; CSS ;<3.2> - - -;--- -; Physical table for RBV in Slot B <9> -;--- - -physRBVb dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40000000, $10000000 - dc.l $40000000, $10000000 - dc.l $00800000, $00100000 - - dc.w kUsageIO, notCacheable - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l $00F00000, $00100000 - - dc.w kUsageMajorSlot, notCacheable - dc.l $90000000, $10000000 - dc.l $90000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable - dc.l $F9000000, $01000000 - dc.l $F9000000, $01000000 - dc.l $00900000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageEndTable - - -;--- -; Physical table for RBV in Slot E <11> -;--- - -physRBVe dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40000000, $10000000 - dc.l $40000000, $10000000 - dc.l $00800000, $00100000 - - dc.w kUsageIO, notCacheable - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l $00F00000, $00100000 - - dc.w kUsageMajorSlot, notCacheable - dc.l $90000000, $10000000 - dc.l $90000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $B0000000, $10000000 - dc.l $B0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable - dc.l $F9000000, $01000000 - dc.l $F9000000, $01000000 - dc.l $00900000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FB000000, $01000000 - dc.l $FB000000, $01000000 - dc.l $00B00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageEndTable - -;--- -; Physical table for 68030 LCD portables <9> <17> HJR -;--- - -physLCD dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40000000, $10000000 - dc.l $40000000, $10000000 - dc.l $00800000, $00100000 - - dc.w kUsageIO, notCacheable - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l $00F00000, $00100000 - - dc.w kUsageEndTable - -;--- -; Physical table for MSC-based portables -;--- - -physMSC dc.w kUsageRAM, cacheable ; RAM - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable ; ROM - dc.l $40800000, ROMMaxSize - dc.l $40800000, ROMMaxSize - dc.l $00800000, ROMMaxSize - - dc.w kUsageIO, notCacheable ; I/O - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l $00F00000, $00100000 - - dc.w kUsageOnboardVideo, notCacheable ; LCD video - dc.l $60000000, $10000000 - dc.l $60000000, $10000000 - dc.l $00000000, $00000000 - - dc.w kUsageMajorSlot, notCacheable ; slot 9 - dc.l $90000000, $10000000 - dc.l $90000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable ; slot A - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable ; slot B - dc.l $B0000000, $10000000 - dc.l $B0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable ; slot C in docking station - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable ; slot D in docking station - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable ; slot E (PDS docking connector) - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable ; slot 9 - dc.l $F9000000, $01000000 - dc.l $F9000000, $01000000 - dc.l $00900000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot A - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot B - dc.l $FB000000, $01000000 - dc.l $FB000000, $01000000 - dc.l $00B00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot C in docking station - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot D in docking station - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot E (PDS docking connector) - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageEndTable - -;--- -; Physical table for Niagra LCD portables -;--- - -physNiagra dc.w kUsageRAM, cacheable ; - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable ; ROM - dc.l $40800000, ROMMaxSize - dc.l $40800000, ROMMaxSize - dc.l $00800000, ROMMaxSize - - dc.w kUsageIO, notCacheable ; I/O - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l $00F00000, $00100000 - - dc.w kUsageOnboardVideo, notCacheable ; LCD video - dc.l $60000000, $10000000 - dc.l $60000000, $10000000 - dc.l $00000000, $00000000 - - dc.w kUsageMinorSlot, notCacheable ; slot C - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot D - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot E up to declaration ROM - dc.l $FE000000, $01000000-DeclRomSize - dc.l $FE000000, $01000000-DeclRomSize - dc.l $00E00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable ; slot E declaration ROM (VSCDeclData) - dc.l $40800000, DeclRomSize - dc.l $FF000000-DeclRomSize, DeclRomSize - dc.l $00000000, $00000000 - - dc.w kUsageEndTable - -;--- -; Physical table for Orwell Based machines -;--- - -physOrwell dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40800000, ROMMaxSize - dc.l $40800000, ROMMaxSize - dc.l $00800000, ROMMaxSize - - dc.w kUsageIO, notCacheable - dc.l $50F00000, IOMaxSize - dc.l $50F00000, IOMaxSize - dc.l $00F00000, IOMaxSize - - dc.w kUsageIO, notCacheable ; ¥¥temp¥¥ - dc.l $50F40000, IOMaxSize ; should be nonserialized - dc.l $50F40000, IOMaxSize - dc.l $00F40000, IOMaxSize - - dc.w kUsageMajorSlot, notCacheable - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $B0000000, $10000000 - dc.l $B0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageOnboardVideo, notCacheable - dc.l $F9000000, $01000000 - dc.l $F9000000, $01000000 - dc.l $00900000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FB000000, $01000000 - dc.l $FB000000, $01000000 - dc.l $00B00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageEndTable - -physSonora dc.w kUsageRAM, cacheable ; Special Cased for Double X Slot E - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40800000, ROMMaxSize - dc.l $40800000, ROMMaxSize - dc.l $00800000, ROMMaxSize - -; dc.w kUsageROM, cacheable ; ROM -; dc.l $40000000, $10000000 -; dc.l $40000000, $10000000 -; dc.l $00800000, $00100000 - - dc.w kUsageIO, notCacheable ; - dc.l $50000000, $10000000 ; Don't map all of I/O Space - dc.l $50000000, $00FC0000 ; because of Double Exposure Card - dc.l $00F00000, $000C0000 - - dc.w kUsageOnboardVideo, notCacheable ; Video Space - dc.l $60000000, $01000000 ; - dc.l $60000000, $01000000 ; - dc.l $00B00000, $00100000 - - dc.w kUsageMajorSlot, notCacheable - dc.l $90000000, $10000000 - dc.l $90000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $B0000000, $10000000 - dc.l $B0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable - dc.l $F9000000, $01000000 - dc.l $F9000000, $01000000 - dc.l $00900000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageOther, notCacheable ; Double X accesses slot E - dc.l $FEE00000, $40000 ; with addresses in the range - dc.l $50FC0000, $40000 ; $50FC0000-$50100000 - dc.l $00FC0000, $40000 ; - - dc.w kUsageEndTable - -;¥¥¥ Begin CSS Cyclone Roll-in. -;----- -; Physical table for Foster Farms -;--- - -physFF dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $00A00000, $00100000 - dc.l $40A00000, $00100000 - dc.l $00A00000, $00100000 - - dc.w kUsageROM, cacheable - dc.l $00B00000, $00100000 - dc.l $40B00000, $00100000 - dc.l $00B00000, $00100000 - - dc.w kUsageROM, cacheable ; define 2 Mb addtional ROM - dc.l $00C00000, $00100000 ; - dc.l $40C00000, $00100000 ; - dc.l $00C00000, $00100000 ; - - dc.w kUsageROM, cacheable ; - dc.l $00D00000, $00100000 ; - dc.l $40D00000, $00100000 ; - dc.l $00D00000, $00100000 ; - - dc.w kUsageIO, notCacheable - dc.l $00F00000, FFIOMax - dc.l $50F00000, FFIOMax - dc.l $00F00000, FFIOMax - - dc.w kUsageMajorSlot, notCacheable - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageOther, notCacheable ; Double X accesses slot E - dc.l $00E00000, DblXSlotMax ; with addresses in the range - dc.l $50FC0000, DblXSlotMax ; $50FC0000-$50CFFFFF - dc.l $00FC0000, DblXSlotMax ; - - dc.w kUsageEndTable ; - -;--- -; Physical table for YMCA Based machines -;--- - -physYMCA dc.w kUsageRAM, cacheable - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable - dc.l $40800000, ROMMaxSize - dc.l $40800000, ROMMaxSize - dc.l $00800000, ROMMaxSize - - dc.w kUsageOnboardVideo, notCacheable - dc.l $50100000, VRAMMaxSize - dc.l $50100000, VRAMMaxSize - dc.l 0, 0 - - dc.w kUsageIO, notCacheable - dc.l $50036000, $00002000 - dc.l $50036000, $00002000 - dc.l 0, 0 - - dc.w kUsageIO, notCacheable - dc.l $50F00000, IOMaxSize - dc.l $50F00000, IOMaxSize - dc.l $00F00000, IOMaxSize - - dc.w kUsageMajorSlot, notCacheable - dc.l $A0000000, $10000000 - dc.l $A0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $B0000000, $10000000 - dc.l $B0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $C0000000, $10000000 - dc.l $C0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $D0000000, $10000000 - dc.l $D0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMajorSlot, notCacheable - dc.l $E0000000, $10000000 - dc.l $E0000000, $10000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FA000000, $01000000 - dc.l $FA000000, $01000000 - dc.l $00A00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FB000000, $01000000 - dc.l $FB000000, $01000000 - dc.l $00B00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FC000000, $01000000 - dc.l $FC000000, $01000000 - dc.l $00C00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FD000000, $01000000 - dc.l $FD000000, $01000000 - dc.l $00D00000, $00100000 - - dc.w kUsageMinorSlot, notCacheable - dc.l $FE000000, $01000000 - dc.l $FE000000, $01000000 - dc.l $00E00000, $00100000 - - dc.w kUsageEndTable - -;¥¥¥ End CSS Cyclone roll-in - -;--- -; Physical table for Pratt LCD portables -;--- - -physPratt dc.w kUsageRAM, cacheable ; - dc.l 0, 0 - dc.l 0, 0 - dc.l 0, 0 - - dc.w kUsageROM, cacheable ; ROM - dc.l $40000000, ROMMaxSize - dc.l $40000000, ROMMaxSize - dc.l 0,0 - - dc.w kUsageIO, notCacheable ; I/O - dc.l $50000000, $10000000 - dc.l $50000000, $10000000 - dc.l 0,0 - - dc.w kUsageOnboardVideo, notCacheable ; LCD video - dc.l $60000000, $10000000 - dc.l $60000000, $10000000 - dc.l 0,0 - - dc.w kUsageMajorSlot, notCacheable ; PDS, major slots A-B - dc.l $A0000000, $20000000 - dc.l $A0000000, $20000000 - dc.l 0, 0 - - dc.w kUsageMinorSlot, notCacheable ; PDS, minor slots A-B - dc.l $FA000000, $02000000 - dc.l $FA000000, $02000000 - dc.l 0,0 - - dc.w kUsageMinorSlot, notCacheable ; slot E up to declaration ROM - dc.l $FE000000, $01000000-DeclRomSz - dc.l $FE000000, $01000000-DeclRomSz - dc.l 0,0 - - dc.w kUsageMinorSlot, notCacheable ; slot E up to declaration ROM - dc.l $402e0000-DeclRomSz, DeclRomSz - dc.l $FF000000-DeclRomSz, DeclRomSz - dc.l 0,0 - - dc.w kUsageEndTable - ;----- -; MMUError - unrecoverable error discovered while setting up MMU. -;--- -MMUError move.w #102,d6 ; minor error code = MMU setup error <3.2> - move.l #$0F,d7 ; major error code = NuMac error <3.2> - bigjmp Critical,a0 ; ugly tone, service call needed... - - -;----- -; InitMMU - sets up the MMU depending on what memory controller we are running and +; InitMMU 7a20 - sets up the MMU depending on what memory controller we are running and ; what chunks of RAM were found by StartTest. ; ; Entry @@ -1847,11 +643,6 @@ InitMMU link a5,#InitSize ; set up stack frame bsr SetupGlobals ; set up stack frame, boot globals bsr FindInfo ; get ptr to MMU setup info ; returns a0 = 32 bit info ptr, a1 = 24 bit ptr - cmpi.b #EMMU1,sgTypeMMU(A6) ; Do we have an Emulated MMU? (ie don't make tables) - beq.s @NoTables ; -> Yes, bail out now! - cmp.b #HMMU,sgTypeMMU(a6) ; CSS check type of MMU - bne.s @isPmmu ; IF HMMU -@noTables movem.l SaveURegs(a5),UnivRegs ; restore universal registers IF forRomulator THEN ; TestInRAM A2 ; check if running ROM image in RAM | @@ -1864,179 +655,9 @@ InitMMU link a5,#InitSize ; set up stack frame move.l a6,a4 ; return ptr to BootGlobs unlk a5 ; remove stack frame rts ; EXITROUTINE -@isPmmu ; ENDIF - move.l a1,a4 ; save ptr to 24 bit mode MMU setup info - move.l a0,a2 ; save ptr to 32 bit mode MMU setup info - bsr MakePhysicalTable ; create physical space table (for VM et. al.) - move.l a2,a0 ; recall ptr to 32 bit mode info - bsr MakeTable ; make 32 bit translation table - lea sg32Info(a6),a1 ; point at 32 bit mode info in BootGlobs CSS - bsr SaveMMUInfo ; move 32 bit info to BootGlobs CSS - btst #MMStartMode,sgMMFlags(a6);check if we're booting 32 bit only CSS - bne.s @modesOK ; IF not booting 32 only - move.l a4,a0 ; recall addr 24 bit mode MMU setup Info - move.l a4,a2 ; recall addr 24 bit mode MMU setup Info - bsr MakeTable ; make a translation table -@modesOK ; ENDIF - lea sg24Info(a6),a1 ; point at 24 bit mode info in BootGlobs CSS - bsr SaveMMUInfo ; move 24 (or 32) bit info to BootGlobs -@done ; ENDIF - - bsr CleanupGlobals ; tidy up, leaving registers as follows: - ; a2 - InitMMU's logical return address - ; a3 - points to tc in MMUConfigInfo - ; a4 - logical ptr to BootGlobs - ; d3 - ROM physical-2-logical conversion constant - ; sp - midway thru useable logical RAM - ; d0-d2/d7/a0-a1 restored (DON'T TOUCH!) ;----- -; The following code actually enables the MMU. Since enabling the MMU may change the -; address of the code that actually does it (if it is running in RAM under Romulatorª), -; we take precautions to ensure that both the 'pmove tc' and the 'jmp to the new logical -; address' are both in the 020/030 instruction cache. We can then jump to our new -; logical pc without fetching anything from the old pc, which is invalid once the pmove -; is executed. The same principle applies to the 040 'MOVEC URP', 'MOVEC TC' code. <2> -; -; We preload the instruction cache by executing the code snippet twice, passing in the Z -; condition code flag to determine whether to run the pmove or not. Since the pmove is -; 4 bytes, if we ensure that it is on a non-longword boundary, it will always be prefetched -; and cached by the 020 on the first pass thru the code. -; -; It is important the the transparent translation registers be set up before the MMU <7> -; is enabled, since we get the values for the TT regs using a3, which may become <7> -; invalid once the MMU is enabled. This will also work with Romulatorª, since <7> -; we are already executing out of phyiscal space, which will not be affected by <7> -; transparent translation. <7> -; -; This routine assumes that the MMU is NOT enabled when called on a system with a <3.8> -; 68851 PMMU. <3.8> -;--- - -VTEntries equ 64 ; entries in exception vector table CSS - - IF forRomulator THEN ; <3.8> - biglea baseOfRom,a5 ; get physical base of ROM <3.8> - move.l a5,d6 ; save it to adjust pointers later <3.8> - ENDIF ; <3.8> - - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 <2><3> - beq.s @enable040MMU ; YES ... go enable 040 MMU <2> - - pflusha ; flush address translation cache <16> -;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ CSS -; For LC since all addresses are mapped straight thru, (i.e. no address translation takes place) -; 00AxXXXX is a valid address in 32 or 24 bit modes but on Foster Farms trying to access the ROM -; at 00AxXXXX will generate a bus error in 32 bit mode once the MMU is turned on. Therefore we -; must adjust all ptrs that have already been set up to pt at 40AxXXXX. Note: this address is -; also valid in 24 bit mode since the upper 8 bits of the address are ignored in this mode. -; Remember, D3 contains the ROM physical-2-logical conversion constant. -;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ - add.l d3,a0 ; adjust ptr to base addrs - add.l d3,a1 ; adjust ptr to productInfo rec - - movec vbr,a5 ; get address of vectors - move.w #VTEntries-1,d5 ; get number of entries to adjust -@adj add.l d3,(a5)+ ; convert a vector - dbra d5,@adj ; do all of them - -;¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ CSS - movec cacr,d5 ; NO ... get cache control reg - ori.w #$0808,d5 ; set flush bits (also set ccr.z = 0, for no pmove) - movec d5,cacr ; flush instruction, data caches - pmove theTT0-theTC(a3),tt0 ; load the transparent translation regs <7> - pmove theTT1-theTC(a3),tt1 ; BEFORE we fire up the MMU <7> - lea theCRP-theTC(a3),a6 ; get address of CRP <3.8> - lea @return1,a5 ; get 1st return addr - bra.s @inIcache ; load tc enable code into i-cache <3.8> -@return1 lea @mmuEnabled,a5 ; get 2nd return addr <3.8> - add.l d3,a5 ; add in phys-to-log conversion constant <3.8> - moveq #0,d5 ; set ccr.z = 1, so pmove gets executed - IF NOT forRomulator THEN ; Do not set the VBR to 0 if this is a ReAnimator build - movec d5,vbr ; restore vector base reg <3.8> - ENDIF ; - bra.s @inIcache ; go enable the mmu, return from InitMMU <3.8> - nop ; appease the assembler gods - ALIGN 4 ; <3.8> -@inIcache bne.s @step ; (2 bytes) IF second time thru - pmove (a6),crp ; (4 bytes) set up 32 bit mode crp <3.8> -@step nop ; (2 bytes) aligns next pmove to odd-word <3.8> - bne.s @goBack ; (2 bytes) IF second time thru <3.8> - pmove (a3),tc ; (4 bytes) enable the MMU -@goBack jmp (a5) ; (2 bytes) ENDIF - return - -@mmuEnabled - - IF 0 THEN - IF forRomulator THEN ; <3.8> - TestInRam a5 ; running in RAM? <3.8> - beq.s @noAdj ; if not, don't adjust pointers <3.8> - move.l ROMBase,d5 ; get correct base of ROM <3.8> - sub.l d6,d5 ; make d5 a phys-to-log offset <3.8> - add.l d5,a0 ; adjust ptr to base addrs <3.8> - add.l d5,a1 ; adjust ptr to productInfo rec <3.8> -@noAdj ; <3.8> - ENDIF ; <3.8> - ENDIF - jmp (a2) ; get InitMMU return addr <3.8> - - -;----- -; Enable the MMU on a 68040. -; -; Flush both caches. Use a CPUSHA instead of a CINVA, since CINVA does not flush <2> -; dirty entries to memory. N.B. - the CPUSHA IC generated by the operand does <2> -; NOT flush out the inst. cache, but instead performs the same action as a CINVA IC. <2> -; This is because in the 040, there won't BE any "dirty" entries in the inst. cache. <2> -; -; Since the Mac OS does not distinguish between instruction and data space, we must <7> -; duplicate the values placed in the instruction and data transparent translation <7> -; registers. <7> -;----- - MACHINE MC68040 ; The use of 040 instructions requires this <2> - -@enable040MMU ; <2> - - IF forRomulator THEN ; - biglea baseOfRom,a5 ; get physical base of ROM - MACHINE MC68040 ; corrects for ASM bug w/040 directive - move.l a5,d6 ; save it to adjust pointers later - ENDIF ; - - pflusha ; flush address translation cache <16> - move.l theTT0-theTC(a3),d5 ; get transparent translation reg 0 value <7> - movec d5,itt0 ; load the instruction TT0 reg <7> - movec d5,dtt0 ; load the data TT0 reg with the same value <7> - move.l theTT1-theTC(a3),d5 ; get transparent translation reg 1 value <7> - movec d5,itt1 ; load the instruction TT0 reg <7> - movec d5,dtt1 ; load the data TT0 reg with the same value <7> - moveq #0,d5 ; set ccr.z=1, to put enable code in cache <7> - lea @return0,a5 ; get 1st return addr <2> - bra.s @cachedEnableCode ; load TC enable code into i-cache <2> -@return0 lea @mmuEnabled,a5 ; get 2nd return addr <2> - add.l d3,a5 ; add in phys-to-log conversion constant <2> - if NOT forRomulator THEN ; <16> - movec d5,vbr ; restore vector base reg to zero <16> - endif ; <16> - move.l theSRP-theTC(a3),a6 ; retrieve 040 SRP value <7> - move.l (a3),d5 ; retrieve 040 TC value in lsw (ccr.z=0) <2> - bra.s @cachedEnableCode ; go enable the MMU, return from InitMMU <2> - - ALIGN 16 ; force onto Cache Line boundary <2> -@cachedEnableCode - beq.s @aJMP ; (2 bytes) IF second time thru, fall thru <2> - movec a6,SRP ; (2 bytes) set up 32 bit mode SRP <7> - movec d5,TC ; (2 bytes) enable the MMU <2> -@aJMP jmp (a5) ; (2 bytes) ENDIF - return <2> - -; ----------------------------------------------------------------------------------- <2> - - MACHINE MC68030 ; return to prior MACHINE directive <2> - -; ----------------------------------------------------------------------------------- <2> - -;----- -; SetupGlobals - sets up the InitMMU stack frame and the BootGlobals record that is passed +; SetupGlobals 7a38 - sets up the InitMMU stack frame and the BootGlobals record that is passed ; back to StartInit. ; ; Entry: @@ -2069,7 +690,7 @@ SetupGlobals move.l ROMPhysAddr(a0),d0 ; use it instead of computed value @SavePhys move.l d0,physRomBase(a5) ; save it in our globals - bsr GetMMUType ; figure out what kind of MMU we have + moveq.l #6,d0 ; figure out what kind of MMU we have move.b d0,sgTypeMMU(a6) ; save MMU type in BootGlobs CSS clr.l VRAMSize(a5) ; assume no onboard video <9> clr.l VRAMrealSize(a5) ; assume no onboard video <9> @@ -2086,42 +707,15 @@ SetupGlobals clr.b sgEDiskStealFlag(a6) ; assume no chunks to steal move.l #-1,eDiskChunks(a5) ; make eDisk chunk table empty too - lea sgBottom,a0 ; assume we'll start allocating below BootGlobs CSS + lea $FFFFFFA4,a0 move.l a0,sgAllocOff(a6) ; save allocation offset CSS - move.b #ramDiskPramAddr,d0 ; get PRAM address of memory manager flags - bsr ReadPRAMByte ; read it and weep... - andi.l #$ff,d0 ; clear upper bytes of pram byte - beq.s @noEdisk ; IF we want an Edisk THEN clr.l d3 ; clear counter - cmpi.b #EMMU1,sgTypeMMU(A6) ; DO we have an EMMU? (have we already stolen RAM for the EDisk?) - bne.s @countRAM ; -> Nope, parse the tables - move.l sgTestSpace+24(a6),d1 ; Get the amount of bytes allocated by SizeMem for the EDisk - bra.s @saveSize ; join the rest of the code (if D1=0 then no EDisk) - -@countRAM lea sgRamTable+4(a6),a0 ; get pointer to size of the first chunk | CSS -@countLoop ; LOOP (to count RAM chunk sizes) v - add.l (a0)+,d3 ; bump RAM counter - tst.l (a0)+ ; is this the last chunk? - bpl.s @countLoop ; UNTIL (we reach the last chunk) -@gotSize lsr.l #8,d3 ; get chunk size - mulu.l d3,d0 ; calc size of edisk - add.l #$7fff,d0 ; bump edisk past next 32k boundary - and.w #$8000,d0 ; round down to the boundary ^ - cmp.l #MinRamDiskSize,d0 ; check ram disk size | - blo.s @noEdisk ; >>EXIT if edisk is too small - cmp.l #MaxRamDiskSize,d0 ; check upper size limit - bhi.s @noEdisk ; >>EXIT is edisk to too big - move.l d0,d1 ; copy the size into D1 - move.b #1,sgEDiskStealFlag(a6) ; signal that we want to steal chunks from RAM - lea sgRamTable(a6),a0 ; source = chunk table in BootGlobs CSS - lea eDiskChunks(a5),a1 ; destination = edisk chunk table - bsr stealChunks ; try to steal some ram from main memory -@saveSize ; + ; move.l d1,sgRamDiskSize(a6) ; save size of eDisk in boot globals CSS @noEdisk ; ENDIF - + lea sgRamTable(a6),a0 ; source = chunk table in BootGlobs CSS lea globChunks(a5),a1 ; destination = our globals bsr CopyChunks ; copy RAM chunks to our globals @@ -2130,27 +724,18 @@ SetupGlobals ; a0 = top highest bank, d1 = total RAM sub.l a0,d1 ; normal phys-to-log offset = total - top - move.b #MMPRAMloc**$FF,d0 ; get PRAM address of memory manager flags - bsr ReadPRAMByte ; read it and weep... <5> + moveq.l #0,d0 - IF NOT Supports24Bit THEN ; rb rb +; IF NOT Supports24Bit THEN ; rb rb + bset #mmFigEnable,d0 ; Force 32-bit mode until we make room for a 2 meg rom kc ¥¥¥¥ bset #MMStartMode,d0 ; Force 32-bit mode until we make room for a 2 meg rom kc ¥¥¥¥ bset #MMMixed,d0 ; Force 32-bit mode until we make room for a 2 meg rom kc ¥¥¥¥ bset #MMSysheap,d0 ; Force 32-bit mode until we make room for a 2 meg rom kc ¥¥¥¥ bset #MMROZheap,d0 ; Force 32-bit mode until we make room for a 2 meg rom kc ¥¥¥¥ - bclr #mmHighSysHeap,d0 ; Force 32-bit mode until we make room for a 2 meg rom kc ¥¥¥¥ - ENDIF ; rb + +; ENDIF ; rb - btst #MMStartMode,d0 ; check for 32 bit only - bne.s @not24 ; IF not 32 bit only - bclr #mmHighSysHeap,d0 ; weird system heap is a bad idea - bra.s @modeOk ; ... -@not24 btst #mmHighSysHeap,d0 ; ELSEIF 'black hole' before system heap - beq.s @modeOk ; . - add.l #HoleSysHeap-HoleLowMem,d1 ; phys-to-log offset = (total-top) + - ; .(new base system heap - ram for lowmem) -@modeOk ; ENDIF move.b d0,sgMMFlags(a6) ; save memory mgr flags in BootGlobs CSS move.l d1,sgPhys2Log(a6) ; save physical-to-logical offset CSS rts @@ -2158,7 +743,7 @@ SetupGlobals ENDWITH ; {DecoderInfo} ;_____________________________________________________________________________________________ -; Routine ReadPRAMByte +; Routine ReadPRAMByte 7ada ; ; Inputs: D0 - byte # to read from PRAM ; A5 - local frame pointer for InitMMU @@ -2184,7 +769,7 @@ ReadPRAMByte rts ;_____________________________________________________________________________________________ -; CleanupGlobals +; CleanupGlobals 7b04 ; ; Fixes up the RAM entries in the physical space table to account for total space ; occupied by boot globals and mmu tables. Restores the 'universal' registers that were @@ -2239,14 +824,6 @@ CleanupGlobals ENDIF ; add.l sgAllocOff(a6),d0 ; get logical address top useable memory CSS - btst.b #mmHighSysHeap,sgMMFlags(a6); check if 'black hole' before system heap CSS - beq.s @noHole ; IF 'black hole' - move.l d0,sp ; temporarily set new logical stack ptr there - sub.l #HoleSysHeap-HoleLowMem,d0 ; adjust amount of useable logical memory - lsr.l #1,d0 ; divide amt useable logical memory by 2 - suba.l d0,sp ; stack = middle of useable logical memory - bra.s @donestak ; . -@noHole ; ELSE cmp.l #$200000,d0 ; do we have at least two meg of RAM? <5> bge.s @plentyORam ; IF we have less than two meg THEN <5> lsr.l #2,d0 ; divide amt useable logical memory by 4 <5> @@ -2256,7 +833,6 @@ CleanupGlobals move.l #defStackAddr,d0 ; use default stack size <5> @stakOk ; ENDIF move.l d0,sp ; set new stack -@doneStak ; ENDIF biglea BaseOfROM,a1 ; get physical base address of ROM move.l logRomBase(a5),d3 ; get future logical base addr ROM @@ -2270,7 +846,7 @@ CleanupGlobals jmp (a5) ; return to caller ;----- -; SaveMMUInfo - save tc, tt0, tt1, create and save crp +; SaveMMUInfo 7b86 - save tc, tt0, tt1, create and save crp ; ; Entry: d0 has 1st longword of crp ; a0 points to translation table @@ -2291,40 +867,15 @@ SaveMMUInfo move.l newtc(a2),theTC(a1) ; move tc ;----- -; GetMMUType - figure out what kind of MMU we have -; -; Entry -; a5 - points to InitMMU globals -; d7 - bits 31-16: logic board type -; d7 - bits 15-0: cpu type (0 = 68000, 1 = 68010, 2 = 68020, 3 = 68030, 4 = 68040, etc.) <2> -; -; Exit -; d0.b - type of MMU -; -; Destroys d1-d2/a0-a1 +; MMUError 7bac - unrecoverable error discovered while setting up MMU. ;--- - -MMUTypes ; CPU type -> MMU type mapping - dc.b NoMMU ; 68000 - no MMU - dc.b NoMMU ; 68010 - no MMU - dc.b HMMU ; 68020 - HMMU or 68851 - dc.b PMMU030 ; 68030 - '030 MMU - dc.b PMMU040 ; 68040 - '040 MMU <2> -MaxCPU equ *-MMUTypes-1 ; highest CPU flag supported - -GetMMUType cmp.w #MaxCPU,d7 ; check if CPU type is in range - bhi MMUError ; if outta range, we're hosed - moveq #0,d0 ; clear a reg - move.b MMUTypes(d7),d0 ; get MMU type, based on CPU type - - move.l prodInfoPtr(A5),A0 ; Get ptr to productInfo table - btst #ProductInfo.has68kEmulator//8,ProductInfo.ExtValid1+3(A0) - beq.s @done ; -> No emu. MMU type is correct. - moveq #EMMU1,D0 ; Set the MMU type to EmuMMU cause we're emulation an 020. -@done rts +MMUError move.w #102,d6 ; minor error code = MMU setup error <3.2> + move.l #$0F,d7 ; major error code = NuMac error <3.2> + bra.l Critical + ;----- -; CopyChunks - copies a RAM chunk table, skipping zero sized chunks, remembering +; CopyChunks 7bb8 - copies a RAM chunk table, skipping zero sized chunks, remembering ; the smallest one, and accumulating the total size of all the chunks. ; ; Entry @@ -2365,91 +916,6 @@ CopyChunks movem.l CopyRegs,-(sp) ; save work regs rts -;----- -; StealChunks - Steals chunks from the end of a chunk table and moves them to -; another table. Also copies the original Boot Globs from the end -; of the original last chunk to the "new" last chunk of main memory. -; -; Entry -; a0 - points to source table of chunks -; a1 - points to destination table of chunks -; d0 - amount of RAM to steal -; -; Exit -; d1.l - total size of memory stolen, else zero upon failure -; a6.l - new boot globs pointer if RAM was stolen -; -; Destroys -; a1-a3 -;----- -MinBootGlobs equ $00080000 ; 512k: boot globs min size - -StealRegs REG d2-d5/a4 - -StealChunks - movem.l StealRegs,-(sp) ; save work regs - move.l a0,a2 ; get addr of source chunks - move.l a1,a3 ; get addr of dest chunks - move.l d0,d2 ; get number of bytes to steal - clr.l d3 ; clear RAM size count -@findEndLoop ; LOOP (to find end of source chunks) - cmp.l #-1,(a2)+ ; did we reach the end? - beq.s @foundEnd ; >>EXIT when we get there - add.l (a2)+,d3 ; add size of this chunk into total - bra.s @findEndLoop ; END -@foundEnd ; - sub.l #MinHeapSize,d3 ; subtract minimum amount of RAM for System - ble @notEnufRAM ; >>EXIT if not enuf RAM - cmp.l d3,d2 ; check against requested amount - bhi @notEnufRAM ; >>EXIT if not enuf RAM - - add.l #MinBootGlobs,d2 ; so we eat past boot globs - suba.l #4,a2 ; point just past last chunk entry - cmp.l #MinBootGlobs,-4(a2); is this a boot globs chunk? - beq.s @getChunksLoop ; IF boot globs chunk is not already seperate THEN - move.l -4(a2),d4 ; get size of previous last chunk - sub.l #MinBootGlobs,d4 ; calc new size of previous last chunk - move.l d4,-4(a2) ; save new size in previous last chunk - add.l -8(a2),d4 ; calc new end of previous last chunk - move.l d4,(a2) ; save start of boot globs chunk in new entry - move.l #MinBootGlobs,4(a2) ; save size of new chunk in a new entry at end - move.l #-1,8(a2) ; put end of chunk marker after boot globs chunk - adda.l #8,a2 ; point past new boot globs chunk - ; ENDIF - - move.l a2,a4 ; save ptr to end of boot globs chunk in src table -@getChunksLoop ; LOOP (to get start of Edisk chunks) - sub.l -(a2),d2 ; subtract this chunk from request - suba.l #4,a2 ; point to beginning of this chunk - bgt.s @getChunksLoop ; END - move.l a2,a0 ; make a copy of source table address - bsr copyChunks ; copy the chunk table starting with the chunk in a0 - add.l d2,d1 ; calc amount of memory stolen - neg.l d2 ; get number of bytes in last main RAM chunk we don't need - move.l d2,4(a2) ; save new size of last chunk of main RAM in src table - sub.l d2,4(a3) ; save size of first chunk of edisk in dest table - add.l d2,(a3) ; adjust start of first chunk of edisk in dest table - -; fix up boot globs chunks - move.l -8(a4),8(a2) ; copy start of boot globs chunk down in src table - move.l -4(a4),12(a2) ; copy size of boot globs chunk down in src table - move.l #-1,16(a2) ; put an end marker in src table after last chunk -@findEndLoop1 ; LOOP (to find end of dest chunks) - cmp.l #-1,(a3)+ ; did we reach the end? - beq.s @foundEnd1 ; >>EXIT when we get there - add.l #4,a3 ; bump up ptr to next addr - bra.s @findEndLoop1 ; END -@foundEnd1 move.l #-1,-12(a3) ; kill off extra boot globs chunk - sub.l #MinBootGlobs,d1 ; adjust amount of memory stolen - -@exit movem.l (sp)+,StealRegs ; restore regs - rts - -@notEnufRAM - clr.l d1 ; clear total size to indicate failure - bra.s @exit - - ;----- ; FindInfo - massage RAM chunks based on what type of hardware we are on, and return ; pointers to the layout tables to use in setting up the MMU. @@ -2486,1899 +952,39 @@ FindInfo movem.l FindRegs,-(sp) ; save work registers dc.w @bad-@casetbl ; .(Mac Pal) dc.w @bad-@casetbl ; .(BBU) dc.w @bad-@casetbl ; .(Normandy) - dc.w @Glu-@casetbl ; .(Mac2Glue) - dc.w @MDU-@casetbl ; .(MDU) - dc.w @FMC-@casetbl ; .(OSS FMC) - dc.w @VISA-@casetbl ; .(VISA has MMU similar to HMMU) <12> - dc.w @Orwell-@casetbl ; .(Orwell) <7> - dc.w @Jaws-@casetbl ; .(Jaws) <9> - dc.w @MSC-@casetbl ; .(MSC) - dc.w @Sonora-@casetbl ; .(Sonora)

- dc.w @Niagra-@casetbl ; .(Niagra) - dc.w @YMCA-@casetbl ; .(YMCA) fau - dc.w @djMEMC-@casetbl ; .(djMEMC) - dc.w @Emulated-@casetbl ; .(HMC) - dc.w @Pratt-@casetbl ; .(Pratt) - dc.w @Emulated-@casetbl ; .(HHead) + dc.w @bad-@casetbl ; .(Mac2Glue) + dc.w @bad-@casetbl ; .(MDU) + dc.w @bad-@casetbl ; .(OSS FMC) + dc.w @bad-@casetbl ; .(VISA has MMU similar to HMMU) <12> + dc.w @bad-@casetbl ; .(Orwell) <7> + dc.w @bad-@casetbl ; .(Jaws) <9> + dc.w @bad-@casetbl ; .(MSC) + dc.w @bad-@casetbl ; .(Sonora)

+ dc.w @bad-@casetbl ; .(Niagra) + dc.w @bad-@casetbl ; .(YMCA) fau + dc.w @bad-@casetbl ; .(djMEMC) + dc.w @exp-@casetbl ; .(HMC) + dc.w @bad-@casetbl ; .(Pratt) + dc.w @exp-@casetbl ; .(HHead) + dc.w @exp-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @bad-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @exp-@casetbl ; + dc.w @bad-@casetbl ; Align 4 @bad ; CASE non-MMU based controller: bra MMUError ; we're hosed... @exp ; CASE some new controller: - moveq #2,d0 ; filler for a future overpatch - moveq #2,d0 ; filler for a future overpatch - bra @endSwitch - -;--- -; Mac II glue chip: check for weird cases, normally return pointer to Contiguous setup. -; Normal case is no bank B here, since we merged it with bank A -; and set the size bits. If we still have bank B, either there -; was no bank A, or Bank B is bigger than bank A. Either can be -; handled if a 68851 is present by using the Split setup. -;--- - - - -@Glu ; CASE Mac 2 glue chip: - lea Contig32,a0 ; assume contig 32 bit mode layout info - lea Contig24,a1 ; assume contig 24 bit mode layout info - tst.l d2 ; check if first chunk start w/Bank A <3.5> - bne.s @tryPMMU ; if not, its a weird case (has to be bank B) <3.5> - addq.l #1,d4 ; check if second chunk (bank B) exists <3.5> - beq @endSwitch ; if only one chunk of RAM, we're all set <3.5> -@tryPMMU cmp.b #HMMU,sgTypeMMU(a6) ; see if we have an MMU up to the task <3.5> CSS - bne @split ; if its a PMMU, we can live with split memory <3.5> - bra MMUError ; otherwise we're hosed (no mem at addr zero!) - -;--- -; Emulated: RISC Macs have MMU functionality, but don't need to be setup here. cch -;--- - -@Emulated ; CASE RISC Mac: - bra @endSwitch ; that's all folks - - -;--- -; Sonora: Weird Case necessary to be able to handle Vail and Double Exposure. -;--- - -@Sonora ; CASE Sonora chip:

- - move.l d0,a0 ; save d0 - movec cacr,d0 ; - move.l d0,a1 ; save cacr - sub.l d0,d0 ; D0 = 0 - bset #CACR_DE_040,d0 ; set Data Cache Enable bit on 040s - movec d0,CACR ; attempt to enable data cache (temporarily) - movec CACR,d0 ; check and see if it's still there - btst #CACR_DE_040,d0 ; see if the bit exists in CACR - beq.s @Sonora030 ; IF we're on a 68040 THEN - - MACHINE MC68040 ; need this for the MOVEC D0,TC below - - cinva bc ; make sure caches are invalidated - - MACHINE MC68030 ; return to prior MACHINE directive <2> - - move.l a1,d0 ; restore cacr - movec d0,cacr ; - move.l a0,d0 ; restore d0 - lea SnraForty32,a0 ; use Sonora's 040 32 bit mode layout info - lea SnraForty24,a1 ; use Sonora's 040 24 bit mode layout info - bra @endSwitch ; that's all folks - -@Sonora030 move.l a1,d0 ; restore cacr - movec d0,cacr ; - move.l a0,d0 ; restore d0 - - lea Sonora32,a0 ; use Sonora's 32 bit mode layout info - lea Sonora24,a1 ; use Sonora's 24 bit mode layout info - bra @endSwitch ; that's all folks - -;--- -; Orwell: no weird cases. This wonderful decoder has already been set up to merge <7> -; RAM to be contiguous. -;--- - -@djMEMC ; CASE djMEMC chip: -@Orwell ; CASE Orwell chip: <7> - lea Orwell32,a0 ; use Orwell's 32 bit mode layout info - lea Orwell24,a1 ; use Orwell's 24 bit mode layout info - bra @endSwitch ; that's all folks - -;--- -; Jaws: Memory is always contiguous on Jaws, and onboard video will always be on. -;--- - -@Jaws ; CASE Jaws chip: <9> - movea.l prodInfoPtr(a5),a0 ; get productInfo record in a0 - move.l a0,a1 ; get a copy in a1 - adda.l ProductInfo.VideoInfoPtr(a0),a1 ; point to the VideoInfo record - move.l VideoInfo.VRAMPhysAddr(a1),VRAMPhysBase(a5) ; initialize base of video RAM - move.l VideoInfo.VRAMLogAddr32(a1),logVRAMBase32(a5) ; 24-bit logical VRAM addr - move.l VideoInfo.VRAMLogAddr24(a1),logVRAMBase24(a5) ; 32-bit logical VRAM addr - move.l #LCDMaxSize,VRAMrealSize(a5) ; set the size of video for phys space tbl <17> HJR - lea Jaws32,a0 ; use Jaws' 32 bit mode layout info - lea Jaws24,a1 ; use Jaws' 24 bit mode layout info - - bra @endSwitch ; that's all folks - -;--- -; MSC: Memory is always contiguous on MSC, and onboard video will always be on. -;--- - -@MSC ; CASE MSC chip: - - movea.l prodInfoPtr(a5),a0 ; get productInfo record in a0 - move.l a0,a1 ; get a copy in a1 - adda.l ProductInfo.VideoInfoPtr(a0),a1 ; point to the VideoInfo record - move.l VideoInfo.VRAMPhysAddr(a1),VRAMPhysBase(a5) ; initialize base of video RAM - move.l VideoInfo.VRAMLogAddr32(a1),logVRAMBase32(a5) ; 24-bit logical VRAM addr - move.l VideoInfo.VRAMLogAddr24(a1),logVRAMBase24(a5) ; 32-bit logical VRAM addr - lea MSC32,a0 ; use MSC's 32 bit mode layout info - lea MSC24,a1 ; use MSC's 24 bit mode layout info - - bra @endSwitch ; that's all folks - -;--- -; Niagra: Memory is always contiguous on Niagra, and onboard video will always be on. -; through next -;--- - -@Niagra ; - - movea.l prodInfoPtr(a5),a0 ; get productInfo record in a0 - move.l a0,a1 ; get a copy in a1 - adda.l ProductInfo.VideoInfoPtr(a0),a1 ; point to the VideoInfo record - move.l VideoInfo.VRAMPhysAddr(a1),VRAMPhysBase(a5) ; initialize base of video RAM - move.l VideoInfo.VRAMLogAddr32(a1),logVRAMBase32(a5) ; 24-bit logical VRAM addr - move.l VideoInfo.VRAMLogAddr24(a1),logVRAMBase24(a5) ; 32-bit logical VRAM addr - lea Niagra32,a0 ; use Niagra' 32 bit mode layout info - lea Niagra24,a1 ; use Niagra' 24 bit mode layout info - - bra @endSwitch ; that's all folks - -;--- -; Pratt: Memory is always contiguous on Pratt, and onboard video will always be on. -; -;--- - -@Pratt ; - - movea.l prodInfoPtr(a5),a0 ; get productInfo record in a0 - move.l a0,a1 ; get a copy in a1 - adda.l ProductInfo.VideoInfoPtr(a0),a1 ; point to the VideoInfo record - move.l VideoInfo.VRAMPhysAddr(a1),VRAMPhysBase(a5) ; initialize base of video RAM - move.l VideoInfo.VRAMLogAddr32(a1),logVRAMBase32(a5) ; 24-bit logical VRAM addr - move.l VideoInfo.VRAMLogAddr24(a1),logVRAMBase24(a5) ; 32-bit logical VRAM addr - lea Pratt32,a0 ; use Niagra' 32 bit mode layout info - lea Pratt24,a1 ; use Niagra' 24 bit mode layout info - - bra @endSwitch ; that's all folks - -;--- -; FMC - only weird case is bank B only. For other cases, we previously merged -; everything into one bank starting at physical zero. We can survive bank B -; only with the split model. -;--- - -@FMC ; CASE FMC chip: <3.6> - lea Contig32,a0 ; assume contig 32 bit mode layout info - lea Contig24,a1 ; assume contig 24 bit mode layout info - tst.l d2 ; check if RAM starts at physical zero - bne @split ; if not, we can live with split memory mode <3.8> - bra @endSwitch ; ... - - -;¥¥¥ Begin fau -;--- -; YMCA: no weird cases. -;--- - -@YMCA ; CASE YMCA chip: - lea YMCA32,a0 ; use YMCA's 32 bit mode layout info - lea YMCA24,a1 ; use YMCA's 24 bit mode layout info - bra @endSwitch ; that's all folks -;¥¥¥ End fau end - -;--- -; MDU - if RBV present w/monitor attached, deallocate video buffer from useable RAM -; and make Bank B, if present, be low memory. -;--- - -@MDU ; CASE MDU chip: - - btst #RBVExists,d6 ; check if RBV exists - beq @split ; IF RBV exists <3.8> - movea.l prodInfoPtr(a5),a0 ; get productInfo record in a0 <9> - move.l a0,a1 ; get a copy in a1 <9> - adda.l ProductInfo.VideoInfoPtr(a0),a1 ; point to the VideoInfo record <9> - move.l VideoInfo.VRAMPhysAddr(a1),VRAMPhysBase(a5) ; initialize base of video RAM <9> - move.l VideoInfo.VRAMLogAddr32(a1),logVRAMBase32(a5) ; 24-bit log. VRAM addr <9> - move.l VideoInfo.VRAMLogAddr24(a1),logVRAMBase24(a5) ; 32-bit log. VRAM addr <9> - cmpi.l #RBVBase32b,logVRAMBase32(a5) ; check which slot video is in <11> - adda.l ProductInfo.DecoderInfoPtr(a0),a0 ; point a0 to decoder info <11> - bne.s @slotE ; IF RBV is in Slot B THEN <11> - lea RBV32b,a3 ; point to RBV Slot B table <11> - bra.s @gotSlot ; ELSE <11> -@slotE lea RBV32e,a3 ; point to RBV Slot E table <11> -@gotSlot ; ENDIF <11> - bfextu newtc(a3){8,4},d0 ; get # addr bits for pageSize <11> - moveq #0,d6 ; clear a reg - bset d0,d6 ; get our pagesize - move.l sgTotalRAM(a6),d0 ; get total amt memory (for GetRBVSize) CSS - moveq #0,d1 ; signal no rounding, we want the REAL size - move.l RBVAddr(a0),a0 ; get addr of RBV hardware <11> - movea.l prodInfoPtr(a5),a2 ; pass addr of productInfo record in a2 <3.0> - bsr GetRBVSize ; get actual video buffer size - move.l d0,VRAMrealSize(a5) ; save it for later <9> - move.l sgTotalRAM(a6),d0 ; get total amt memory (for GetRBVSize) CSS - move.l d6,d1 ; rounding factor = MMU page size - bigjsr GetRBVSize,a4 ; get monitor size, rounded up to pagesize - move.l d0,VRAMSize(a5) ; save it for later <9> - beq @split ; if no monitor, its easy! - tst.l d2 ; check if any memory in Bank A - bne @split ; if no Bank A, its easy! - sub.l d0,d3 ; subtract monitor size from bank A - move.l d3,globChunks+4(a5) ; update RAM chunk table - add.l d0,d2 ; add monitor size to bank A start addr - move.l d2,globChunks(a5) ; update RAM chunk table - sub.l d0,sgPhys2Log(a6) ; adjust physical-to-logical conversion offset CSS - move.l a3,a0 ; point to RBV table <11> - - lea globChunks+8(a5),a1 ; get pointer to second chunk - tst.l sgEDiskStealFlag(a6); check for ram disk CSS | - beq.s @noRamDisk ; IF there is a ram disk THEN v - add.l #8,a1 ; point at third chunk -@noRamDisk ; ENDIF - tst.l (a1) ; check for bank B ^ - bmi.s @noBankB ; IF Bank B exists | - IF forRomulator THEN ; ¥¥¥Note: Romulator won't work with an Edisk - TestInRam A2 ; are we running in ram? <3.8> - beq.s @inROM ; if not, skip this <3.8> - BigLea BaseOfRom,a2 ; get current base of ROM <3.8> - lsl.l #1,d1 ; add an extra page to bootglobs <3.8> - add.l ROMHeader.RomSize(a2),d1 ; increase size of bootglobs by ROM size <3.8> -@inROM ; - ENDIF ; <3.8> - tst.l sgEDiskStealFlag(a6); check for ram disk CSS - bne.s @ramDiskExists ; IF there is no ram disk THEN - sub.l d1,d5 ; decrement Bank B size by pagesize -@ramDiskExists ; ENDIF - lea globChunks(a5),a1 ; point at beginning of chunk table - move.l d4,(a1)+ ; put Bank B (addr) first in Ram chunk table - move.l d5,(a1)+ ; put Bank B (size) first in Ram chunk table - move.l d2,(a1)+ ; put Bank A (addr) second in Ram chunk table - move.l d3,(a1)+ ; put Bank A (size) second in Ram chunk table - tst.l sgEDiskStealFlag(a6); check for ram disk CSS - bne.s @noBankB ; IF there is no ram disk THEN - add.l d5,d4 ; get addr of last chunk - move.l d4,(a1)+ ; put addr last little chunk in table - move.l d1,(a1)+ ; put size last little chunk in table - moveq #-1,d4 ; get end of table marker - move.l d4,(a1)+ ; put end marker in table - move.l d4,(a1)+ ; put end marker in table - ; ENDIF -@noBankB ; ENDIF - move.l #RBVBase24b,d2 ; get the 24-bit video base address <14> - move.l logVRAMBase24(a5),d3 ; get the 24-bit video base addr for this machine <14> - andi.l #$ffffff,d2 ; ensure these are 24-bit addrs... <14> - andi.l #$ffffff,d3 ; same here <14> - cmp.l d3,d2 ; check which slot video is in <14> - bne.s @inSlotE ; IF RBV is in Slot B THEN <11> - lea RBV24b,a1 ; point to RBV Slot B table <11> - bra.s @done ; ELSE <11> -@inSlotE lea RBV24e,a1 ; point to RBV Slot E table <11> -@done ; ENDIF <11> - bra.s @endSwitch ; ... - - -;--- <12> -; VISA chip: Generally, the VISA code is similar to the HMMU (that is, there isn't any -; hardware, and it doesn't do anything). This code also whacks the ChunkTable -; to adjust for usage of RAM by the video system. There's no possibility of -; the split RAM case (big block in bank B), since there's no PMMU at all. -; -; For Slice there is no on-board video so no need to allocate a video buffer. -; All we need to do is allocate a 4k sound buffer. -;--- - -@VISA ; CASE VISA chip: - sub.l #$00001000,sgAllocOff(A6) ; allocate 4k sound buffer - lea FstrFrms24,a1 ; point to 24 bit MMU info table - lea FstrFrms32,a0 ; point to 32 bit MMU info table - bra @endSwitch ; - -@split ; ELSE (no RBV, just split memory) - move.l smallest(a5),d0 ; get size smallest chunk - bfffo d0{0,0},d0 ; get 32-log2(size) - subq.w #5,d0 ; normalize to 64 meg - muls.w #-MMUSetupInfo.Size,d0; compute offset from 64 meg entry - lea (split64mb32,d0.w),a0; return addr 32 bit mode layout - lea Split24,a1 ; return split 24 bit mode layout info -;fallThru bra.s @endSwitch ; ... - -@endSwitch ; ENDSWITCH movem.l (sp)+,FindRegs ; restore work registers rts -;----- -; MakePhysicalTable -; -; Create the 'physical table' describing the significant portions of the physical -; address space. Use the physical template to create the table. -; -; The table is actually created into a buffer on the stack, then copied to space -; allocated below BootGlobals. -; -; Entry -; a0 - points to 32 bit mode layout info -; a5 - points to InitMMU stack frame -; a6 - points to BootGlobs -; -; Exit -; physical table created (in BootGlobs) -;--- -MakPhysRegs REG a1-a2 - -MakePhysicalTable - - movem.l MakPhysRegs,-(sp) ; save work registers - suba.w #physBufSize,sp ; allocate buffer on stack - move.l sp,a2 ; save ptr to buffer start - move.l a2,a1 ; init buffer fill ptr - add.w physicalOff(a0),a0 ; scan ptr = addr physical template -@loop ; LOOP for each entry - move.w PhysicalSpaceBlock.usage(a0),d0;get template entry type - cmp.w #kUsageEndTable,d0 ; check it - beq.s @exitLoop ; >>EXITLOOP if end-of-table - cmp.w #kUsageRAM,d0 ; check it again - bne.s @notRam ; IF its a RAM entry - bsr doPhysRam ; generate RAM entries - adda.w #PhysicalSpaceBlock.size,a0 ; point at next template entry - bra.s @loop ; . -@notRam cmp.w #kUsageROM,d0 ; ELSEIF its a ROM entry - bne.s @notRom ; . - bsr doPhysRom ; generate ROM entry - adda.w #PhysicalSpaceBlock.size,a0 ; point at next template entry - bra.s @loop ; . -@notRom ; ELSE - moveq #PhysicalSpaceBlock.size-1,d0; prepare to copy entry to buffer -@copy move.b (a0)+,(a1)+ ; LOOP - copy next byte - dbra d0,@copy ; REPEAT - ; ENDIF - bra.s @loop ; REPEAT -@exitLoop - suba.l a2,a1 ; size = end - start - move.l a1,d1 ; save size of entries - addq.l #PhysicalSpace.firstEntry-PhysicalSpace,a1 ; add in extra fields - move.l a6,a0 ; get ptr to BootGlobs - move.l sgAllocOff(a6),d0 ; get current allocation offset CSS - sub.l a1,d0 ; allocate space for physical table - move.l d0,sgPhysicalTableOff(a6) ; save offset to physical table CSS - move.l d0,sgAllocOff(a6) ; update allocation offset CSS - add.l d0,a0 ; get ptr to allocated table - - move.l d1,d0 ; get total size of entries - divu #PhysicalSpaceBlock.size,d0 ; # entries = (total size)/(entry size) - move.w d0,(a0)+ ; write # entries - move.w #PhysicalSpaceBlock.size,(a0)+ ; write entry size - bra.s @endCopy ; adjust for dbra -@copyLoop move.b (a2)+,(a0)+ ; LOOP - copy byte from buffer to final table -@endCopy dbra d1,@copyLoop ; REPEAT for all bytes of entries in buffer - adda.w #physBufSize,sp ; de-allocate buffer from stack - movem.l (sp)+,MakPhysRegs ; restore registers - rts - -;----- -; doPhysRam - local subroutine of MakePhysicalTable to generate RAM entries in the -; physical table. -; -; First, if onboard video uses some RAM, entries are generated for both the video -; and the wrap of the logical space before and afet the video buffer (to accomodate <3.2> -; the Quickdraw bug of accessing a few bytes before and after the video buffer). <3.2> -; -; Then, a RAM entry is generated for each RAM chunk from our 'massaged' RAM chunk -; table. The first RAM entry is marked as low memory, so VM knows where low -; memory really is. We also duplicate the last entry, because we need to -; divide the last chunk into useable Ram and boot globals space. Later we will -; go back and adjust the addesses and sizes to reflect the actual size of the -; boot globals/mmu tables area. -; -; Entry -; a0 - points to physical template entry -; a1 - buffer fill ptr where physical table is being generated -; a2 - points to start of buffer -; a5 - points to InitMMU stack frame -; a6 - points to boot globs -; -; Exit -; a1 - updated buffer fill ptr (after RAM entries are added) -; a0-a2 preserved -;--- - -doPhysRegs REG d2-d4/a3-a4 - -doPhysRam movem.l doPhysRegs,-(sp) ; save registers - move.l VRAMrealSize(a5),d0 ; get exact onboard video size <9> - beq.s @doneVideo ; IF any onboard video - - move.l VRAMPhysBase(a5),d4 ; get physical base - - moveq #kUsageOnboardVideo,d1 ; entry type = onboard video <3.2, to end 3.2> - move.l logVRAMBase32(a5),d2 ; logical 32 addr <9> - move.l logVRAMBase24(a5),d3 ; logical 24 addr - bsr @writeOne ; create entry for real video buffer - - add.l d0,d2 ; log 32 addr = end of video buffer - add.l d0,d3 ; log 24 addr = end of video buffer - move.l #VidWrapSize,d0 ; size = size of wrap area <9> - moveq #kUsageOnboardVideoWrap,d1 ; entry type = onboard video WRAP - bsr.w @writeOne ; create entry for wrap area after video buffer - - move.l logVRAMBase32(a5),d2 ; wrap area before video buffer <9> - sub.l d0,d2 ; calculate start of wrap area <9> - move.l logVRAMBase24(a5),d3 ; logical 24 addr - sub.l d0,d3 ; calculate start of wrap area - bsr.w @writeOne ; for wrap area before video buffer - -@doneVideo ; ENDIF - - tst.l sgEDiskStealFlag(a6) ; check for ram disk CSS - beq.s @doneEDisk ; IF any ram disk THEN | - move.l #kUsageEDisk,d1 ; entry type = ram disk v - move.l sgRamDiskBase(a6),d2 ; logical 32 base = from globals CSS - clr.l d3 ; no access in 24-bit mode - lea eDiskChunks(a5),a3 ; point at ram disk chunk table -@eDiskLoop ; LOOP (to write entries for eDisk chunks) - move.l (a3)+,d4 ; get chunk addr - move.l (a3)+,d0 ; get chunk size - cmp.l #-1,d4 ; check for end of chunks - beq.s @doneEDisk ; >>EXITIF done all ram disk chunks - bsr @writeOne ; write a physical table entry - add.l d0,d2 ; bump up logical pointer ^ - bra.s @eDiskLoop ; REPEAT | -@doneEDisk ; ENDIF - - moveq #kUsageLowMemory,d0 ; start w/type = low memory - lea globChunks(a5),a3 ; point at massaged RAM chunk table -@ramLoop ; LOOP through RAM chunk table - movem.l (a3)+,d1-d2 ; get chunk addr/size - cmp.l #-1,d1 ; check for end of chunks - beq.s @doneRam ; >>EXITIF done all RAM chunks - move.l a1,a4 ; remember pointer to last RAM entry - move.w d0,(a1)+ ; type = current type - move.w #cacheable,(a1)+ ; attributes = cacheable - move.l d1,(a1)+ ; physical addr = RAM chunk addr - move.l d2,(a1)+ ; physical size = RAM chunk size - clr.l (a1)+ ; logical 32 addr = (don't care) - clr.l (a1)+ ; logical 32 size = (don't care) - clr.l (a1)+ ; logical 24 addr = (don't care) - clr.l (a1)+ ; logical 24 size = (don't care) - moveq #kUsageRam,d0 ; next type = normal RAM - bra.s @ramLoop ; REPEAT -@doneRam - move.l a4,d0 ; get ptr to last RAM chunk entry - sub.l a2,d0 ; buffer offset = ptr - start of buffer - addq.l #PhysicalSpace.firstEntry-PhysicalSpace,d0 ; account for extra fields - move.l d0,lastPhysRam(a5) ; save offset to last RAM chunk entry - moveq #PhysicalSpaceBlock.size-1,d0;prepare to copy last RAM chunk entry -@copy move.b (a4)+,(a1)+ ; LOOP - copy next byte - dbra d0,@copy ; REPEAT - - move.l soundBufferSize(a5),d0 ; is there a sound buffer on this machine? - beq.s @NoSoundBuffer ; -> nope, all done - clr.w (a1)+ ; entry type = other - move.w #notCacheable,(a1)+ ; attributes = notCacheable - move.l soundBufferBase(a5),(a1)+ ; physical addr = base of sound buffer - move.l d0,(a1)+ ; physical size = size of sound buffer - clr.l (a1)+ ; logical 32 addr = (don't care) - move.l d0,(a1)+ ; logical 32 size = size of sound buffer - clr.l (a1)+ ; logical 24 addr = (don't care) - move.l d0,(a1)+ ; logical 24 size = size of sound buffer -@NoSoundBuffer ; - movem.l (sp)+,doPhysRegs ; restore regs - rts - -;------ -; mini-routine to write a non-cached physical space entry -; d0 - size -; d1 - entry type -; d2 - logical 32 addr -; d3 - logical 24 addr -; d4 - physical addr -; a1 - pointer to next free entry -;------ -@writeOne move.w d1,(a1)+ ; write out entry type - move.w #notCacheable,(a1)+ ; attributes = notCacheable - move.l d4,(a1)+ ; physical addr = video base addr - move.l d0,(a1)+ ; physical size - move.l d2,(a1)+ ; logical 32 addr - move.l d0,(a1)+ ; logical 32 size - move.l d3,(a1) ; logical 24 addr - andi.l #$00FFFFFF,(a1)+ ; strip high byte of 24 bit addr - move.l d0,(a1)+ ; logical 24 size - rts - - -;----- -; doPhysRom - local subroutine of MakePhysicalTable to generate the Rom entry in the -; physical table. -; -; The physical address in the entry is the physical address of the ROM image, which might -; be in RAM if we are using Romulatorª. The size is obtained from the Rom header. -; -; Entry -; a0 - points to physical template entry -; a1 - buffer fill ptr where physical table is being generated -; a2 - points to start of buffer -; a5 - points to InitMMU stack frame -; -; Exit -; a1 - updated buffer fill ptr (after RAM entries are added) -; a0-a2 preserved -;--- - -doPhysRom exg a3,d1 ; save register - move.w PhysicalSpaceBlock.usage(a0),(a1)+ ; CSS get usage type - move.w PhysicalSpaceBlock.attributes(a0),(a1)+ ; CSS get the attributes - move.l PhysicalSpaceBlock.physical.rangeSize(a0),d0 ; CSS - cmpi.l #$10000000,d0 ; CSS is the size 256MB ? - - bne.s @doNew ; CSS if 256MB then generate ROM entry the old way otherwise get -; ; CSS actual values from the physical space template - biglea BaseOfRom,a3 ; get physical addr Rom image - move.l a3,(a1)+ ; physical addr = image addr - move.l RomHeader.RomSize(a3),d0 ; get Rom image size from header - move.l d0,(a1)+ ; physical size = image size - exg a3,d1 ; restore reg - move.l logRomBase(a5),d1 ; get logical addr ROM - move.l d1,(a1)+ ; logical 32 addr - move.l d0,(a1)+ ; logical 32 size... - and.l #$FFFFFF,d1 ; get 24 bit mode address of ROM - move.l d1,(a1)+ ; logical 24 addr... - move.l d0,(a1)+ ; logical 24 size... - - bra.s @done ; CSS - -@doNew move.l PhysicalSpaceBlock.physical.address(a0),(a1)+ ; CSS get the physical address of the rom bank - move.l d0,(a1)+ ; CSS physical size of rom image from template - move.l PhysicalSpaceBlock.logical.address(a0),(a1)+ ; CSS get the logical 32 bit Rom bank address - move.l PhysicalSpaceBlock.logical.rangesize(a0),(a1)+ ; CSS get the logical 32 bit Rom bank size - move.l PhysicalSpaceBlock.logical24.address(a0),(a1)+ ; CSS get the logical 24 bit Rom bank address - move.l PhysicalSpaceBlock.logical24.rangesize(a0),(a1)+ ; CSS get the logical 32 bit Rom bank size - -@done exg a3,d1 ; CSS restore reg - rts - -;----- -; -; MakeTable - creates an MMU table. -; -; First an intermediate table is generated, given the installed RAM and the desired -; logical map. Then the final MMU table entries are generated from the intermediate table. -; -; The intermediate table entries are formatted as follows: -; -; 31 8 7 6 5 43 2 10 -; +--------------------------------+-+-+-+--+-+--+ -; | page address or table limit |0|c|0|xx|0|yy| -; +--------------------------------+-+-+-+--+-+--+ -; c - cache inhibit bit (one if cache should be inhibited, zero if not) -; xx - level in table. Level one corresponds to TIA, four to TID -; yy - descriptor type -; -; Each intermediate entry corresponds to some piece of the logical address space. For -; instance, if the tc specifies 16 TIA entries, there would be 16 level 1 entries. -; -; The intermediate entry is generated to allow easy creation of the final MMU table. -; Entries for the same level are laid out consecutively until it is determined that -; a deeper level is needed, or until the entire address space for that level has been -; covered. -; -; If a deeper level is needed, entries are laid out for that deeper level, followed -; by an entry for the parent level with a descriptor type of 'table'. The sequence -; of levels for a tc w/16 TIA entries, xx TIB entries, yy TIC entries might look like: -; -; 1111223333...322..2111111111111 -; | | - level 1 'table' entry, possible w/limit for the preceeding run -; | of level 2's -; | -; | - level 2 'table' entry, possibly w/limit -; -; In the above example, the level 2's even had a nested level 3 table! -; -; Entry: a0 points to table layout info -; a5 points to InitMMU stack frame -; -; Exit: a0 points to created table -; d0 has 1st longword of CRP -;----- - -tableSize EQU $30000 ; get 192k of space for intermediate table <7> - -MakeFrame RECORD {prevLink},DECR -Return ds.l 1 ; return addr -prevLink ds.l 1 ; previous value of link register -mmuSetupPtr ds.l 1 ; ptr to mmu setup information -templatePtr ds.l 1 ; pointer to template -logicalAddr ds.l 1 ; current logical address -genPtr ds.l 1 ; ptr into "intermediate form" table -ramChunks ds.l sgMaxChunks*2 ; space for copy of RAM chunks (addr/size) (last addr -1) CSS -eDskChunks ds.l sgMaxChunks*2 ; space for copy of edisk chunks (addr/size) (last addr -1) CSS -vidAddr ds.l 1 ; video chunk addr (get bumped up as allocated) -vidSize ds.l 1 ; video chunk size (gets bumped down as allocated) -doWrap24 ds.w 1 ; true if we need to wrap tables for 24-bit mode <7> -intermedTbl ds.l 1 ; start of intermediate table <7> -makeLocSize equ * ; size of locals - ENDR - -NoLimit equ $7FFF0000 ; what to stuff in limit field when there is no limit - - WITH MakeFrame - -MakeTable -MakeRegs REG d2/a1 - link a4,#makeLocSize-tableSize ; set up stack frame <7> - movem.l MakeRegs,-(sp) ; save registers - - move.l a0,mmuSetupPtr(a4) ; save ptr to MMU setup info - move.w templOff(a0),d0 ; get offset to normal template - btst.b #mmHighSysHeap,sgMMFlags(a6) ; check if creating map w/huge void CSS - beq.s @haveTempl ; IF we are - move.w specialOff(a0),d0 ; get offset to special template -@haveTempl add.w d0,a0 ; ENDIF - add in template offset - move.l a0,templatePtr(a4) ; save ptr to template - - lea globChunks(a5),a0 ; source = ram chunk table from InitMMU globals - lea ramChunks(a4),a1 ; destination = our local copy - bsr.s CopyChunks ; get a local copy of chunk table - - lea eDiskChunks(a5),a0 ; source = ram disk chunk table from globals - lea eDskChunks(a4),a1 ; destination = our local copy - bsr.s CopyChunks ; get a local copy of chunk table - move.l VRAMPhysBase(a5),vidAddr(a4) ; get local copy of base of video RAM <9> - move.l VRAMSize(a5),vidSize(a4) ; get local copy of size of video buffer <9> - - bsr.s IntermediateTable ; make the intermediate table - bsr FinalTable ; make the final MMU tables - - movem.l (sp)+,MakeRegs ; restore registers - unlk a4 ; deallocate stack frame - rts - -;----- -; IntermediateTable - wrapper routine for creating the intermediate form table. -; -; The table is created using two mutually recursive routines, DoLevel and DoNode. -; DoLevel is responsible for creating all nodes at a given level. It calls DoNode -; to create each node. -; -; DoNode attempts to create a node at the current level. If it determines that a node -; can be created at the current level (a contiguous physical space is possible for the -; current logical address mapping and the span of the current level), it quickly does so -; and returns. Otherwise, a lower level table is neccessary, and it calls DoLevel to -; create the lower level entries in the intermediate table. -; -; This routine simply sets up for generating nodes at the top level, and calls DoLevel. -; Before returning, it appends a dummy level zero node to the end of the intermediate -; table, to make generating the final MMU tables easier. -; -; Entry: -; a4 - points to MakeTable stack frame -; -;--- - -IntermediateTable - move.l d2,-(sp) ; save work reg - lea intermedTbl(a4),a0 ; get ptr to where intermediate table will go - move.l a0,genPtr(a4) ; save ptr to intermediate table - clr.l logicalAddr(a4) ; start at logical address zero - clr.w doWrap24(a4) ; assume generating for 32-bit mode <7> - moveq #1,d0 ; start at level one - bsr.s DoLevel ; create level 1 (and higher!) intermediate table - moveq #0,d2 ; signal writing table node for level zero - bsr WriteTableNode ; write the final table node - move.l (sp)+,d2 ; restore work reg - rts - -;----- -; DoLevel - create intermediate table entries for a given level of the MMU tree. -; -; Entry: -; d0.w - the level -;--- - -DoLevelRegs REG d2-d4 -DoLevel movem.l DoLevelRegs,-(sp) ; save regs - move.w d0,d2 ; save level of interest - bsr SpanAndCount ; d0 = span, d1 = count of entries at this level - move.l d0,d3 ; save span - move.l d1,d4 ; save count - bra.s @endLoop ; adjust loop count for dbra -@loop ; LOOP count times - bsr.s DoNode ; create next node -@endLoop dbra d4,@loop ; REPEAT - movem.l (sp)+,DoLevelRegs ; restore regs - rts - -;----- -; DoNode - create a node in the intermediate table, given the current table level and -; logical address. -; -; Entry: -; d2.w - level -; d3 - span of this level (passed in for convenience, could be recomputed here) -; a4 - points to MakeTable stack frame -;--- - -DoNode bsr.s PageAddr ; a0 = page address, d0 = type, d1 = cache inhibit flag - move.b @casetbl(d0),d0 ; get offset to routine to handle type - jmp @casetbl(d0.w) ; SWITCH(type) -@casetbl dc.b @valid-@casetbl ; . - dc.b @invalid-@casetbl ; . - dc.b @noFit-@casetbl ; . - dc.b @endCase-@casetbl ; . - ALIGN 2 ; . -@valid ; CASE(type = valid) - bsr WritePageNode ; write page node(level, page addr, cache flag) - bra.s @endCase ; ... -@invalid ; CASE(type = invalid) - bsr WriteInvalidNode ; write invalid node(level) - bra.s @endCase ; ... -@noFit ; CASE(type = didn't fit) - bsr CanGoDeeper ; see if we can go to next level - beq.s @noDeeper ; IF we can - move.w d2,d0 ; recall level - addq.w #1,d0 ; bump to next level - bsr.s DoLevel ; make entries at next level - bsr WriteTableNode ; write a table node (level) - bra.s @endCase ; ... -@noDeeper ; ELSE - bsr WriteInvalidNode ; write invalid node (level) - ; ENDIF -;fallthru bra.s @endCase ; ... -@endCase ; ENDSWITCH - rts - -;----- -; PageAddr - given logical address and level span, return information about the physical -; page where it will map to -; -; Entry: -; a4 - points to MakeTable stack frame -; a5 - points to InitMMU stack frame <3.2> -; d2.w - level -; d3 - span of this level (passed in for convenience, could be recomputed here) -; -; Exit -; d0.w - type (0 = valid page, 1 = invalid page, 2 = didn't fit) -; d1.w - cache inhibit flag in bit 6 -; a0 - page address -;--- - - WITH Template -PageRegs REG d3-d5 -PageAddr movem.l PageRegs,-(sp) ; save regs - move.l templatePtr(a4),a0 ; get ptr to template table - moveq #0,d5 ; template logical address = zero - move.l logicalAddr(a4),d0 ; get our current logical addr -@loop ; LOOP - move.l span(a0),d1 ; get chunk size - move.l d0,d4 ; recall our current logical address - sub.l d5,d4 ; get offset from start of template chunk - cmp.l d4,d1 ; check if we're in this chunk's range - bhi.s @exitLoop ; >>EXITLOOP if logical addr falls in this chunk - add.l d1,d5 ; bump template chunk address by size this chunk - addq.l #tEntrySize,a0 ; point at next template entry - bra.s @loop ; REPEAT -@exitLoop ; at this point: a0 -> template entry, - ; d1 = template chunk size, d2 -> bottom of chunk, - ; d3 = level span, d4 = our offset from bottom of chunk - move.l d3,d0 ; save level span - add.l d4,d3 ; get offset + span - cmp.l d3,d1 ; check against size of chunk - bhs.s @fits ; IF logical span doesn't fit in template chunk - moveq #2,d0 ; returned type = "doesn't fit" - bra @done ; EXITROUTINE -@fits ; ENDIF - move.l physNflag(a0),d3 ; get phys addr/flags word <7> - move.l d3,d5 ; copy for getting type bits <7> - and.l #typeMask,d5 ; mask all except type bits <7> - move.b @casetbl(d5),d5 ; get offset to routine to handle type - jmp @casetbl(d5.w) ; SWITCH(type) -@casetbl dc.b @thru-@casetbl ; . - dc.b @ram-@casetbl ; . - dc.b @rom32-@casetbl ; . - dc.b @rom24-@casetbl ; . - dc.b @vidWrap-@casetbl ; . - dc.b @video-@casetbl ; . - dc.b @mapped-@casetbl ; . - dc.b @Void-@casetbl ; . - dc.b @wrap24-@casetbl ; . <7> - dc.b @vram-@casetbl ; . <9> - dc.b @eDisk-@casetbl ; . - - ALIGN 2 ; . -@thru ; CASE(pass thru) - move.l logicalAddr(a4),a0 ; page address = current logical address - bra.s @valid ; returned type = "valid page" -@ram ; CASE(ram) - bsr.w GrabRam ; allocate from RAM chunks, return type, page addr - bra.s @endSwitch ; ... -@wrap24 ; CASE(24-bit wrap area) <7> - move.w #1,doWrap24(a4) ; fall through, and mark "invalid" <7> -@Void ; CASE(void in the middle of RAM) - moveq #1,d0 ; mark page as "invalid" - bra.s @endSwitch ; ... -@rom32 ; CASE(rom, 32 bit mode) - move.l physRomBase(a5),d0 ; assume running in ROM (use real h/w address) - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 - beq.s @nomask ; IF NOT on a 68040 THEN - btst.l #FullTblBit,d3 ; Check if we want full MMU tables for this block - bne.s @nomask ; IF Full Tables NOT wanted then - and.l #$ff000000,d0 ; mask to just use high byte of phys addr -@nomask move.l d0,a0 ; ENDIF - bra.s @romCommon ; (continue w/common code) - -@rom24 ; CASE(rom, 24 bit mode) - move.l physRomBase(a5),a0 ; assume running in ROM (use phys addr) - -@romCommon - IF forRomulator THEN ; <3.7> - biglea BaseOfROM,a0 ; point to start of ROM image in RAM - ENDIF ; <3.7> -@gotROM ; ENDIF - add.l d4,a0 ; returned page addr = start of ROM + offset from - ; .start of template chunk - bra.s @valid ; returned type = "valid page" -@vidWrap ; CASE(wrap to start of video) - move.l VRAMPhysBase(a5),a0 ; get physical base of video buffer <9> - bra.s @valid ; ... -@video ; CASE(video) - bsr GrabVideo ; allocate from vRAM chunks, return type, page addr - bra.s @endSwitch ; ... -@vram ; CASE(vram) <9> - move.l VRAMPhysBase(a5),a0 ; get physical base of video RAM <9> -; adda.l d4,a0 ; returned page addr = start + offset - bra.s @valid ; ... <9> -@eDisk ; CASE(ram disk) - bsr GrabEdisk ; allocate from eDisk chunks, return type, page addr - bra.s @endSwitch ; ... -@mapped ; CASE(mapped) - move.l d3,d0 ; get phys addr/flags word - and.l #physMask,d0 ; mask all except suggested physical addr <7> - move.l d0,a0 ; returned page addr = suggested phys addr <7> - add.l d4,a0 ; .plus offset from start of template chunk -@valid moveq #0,d0 ; returned type = "valid page" -;fallThru bra.s @endSwitch ; ... - -@endSwitch ; ENDSWITCH - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 <7> - beq.s @on040 ; IF NOT on a 68040 THEN <7> - btst.l #FullTblBit,d3 ; Check if we want full MMU tables for this block - beq.s @term ; IF Full Tables wanted then - and.l #cBitMask,d3 ; get cache inhibit bit - bra.s @fullTables ; check table level - ; ELSE -@term and.l #cBitMask,d3 ; get cache inhibit bit <7> - bra.s @setCache ; ELSE <7> -@on040 and.l #c040ModeMask,d3 ; get cache mode bits <7> - -@fullTables bsr.w CanGoDeeper ; check if we are at the lowest Level <7> - beq.s @setCache ; >>EXITROUTINE if NOT on lowest level <7> - cmp.w #0,d0 ; check if we would have returned valid <7> - bne.s @setCache ; >>EXITROUTINE if NOT returning valid <7> - moveq #2,d0 ; can't have a page descriptor yet, return "doesn't fit" <7> -@setCache ; ENDIF <7> - lsl.l #6-cBitNum,d3 ; move it into position <7> - move.w d3,d1 ; return it - -@done movem.l (sp)+,PageRegs ; restore regs - rts - - ENDWITH ; {Template} - - -;----- -; GrabRAM - allocate some space from the chunks of RAM. -; -; The procedure scans the chunks, looking for one that has a non-zero size. -; It then determines whether the allocation amount fits in that chunk. No attempt -; is made to look at other chunks (if it doesn't fit in the first non-zero sized one) -; in order to preserve the ordering present in the chunk table. -; -; Entry: -; a4 - ptr to MakeTable stack frame -; d0 - amount to allocate -; d2.w - level -; d3 - phys addr/flags -; -; Exit: -; a0 - ptr to the RAM chunk -; d0 - type, as follows: -; zero: valid (allocation was successful) -; one: invalid (no RAM available) -; two: didn't fit (requested size didn't fit in first available chunk) -; -; if successful, RAM chunk's size reduced by allocation amount. -; -; Trashes -; d1 -;--- - -GrabRAM lea ramChunks(a4),a0 ; point at table of RAM chunks - move.l d0,d1 ; save allocation amt - moveq #1,d0 ; assume returning "invalid" (no RAM available) -@loop cmp.l #-1,(a0)+ ; LOOP while more chunks - beq.s @done ; >>EXITROUTINE if no more chunks - tst.l (a0)+ ; check size of chunk - beq.s @loop ; REPEAT while nothing in this chunk - moveq #2,d0 ; assume returning "didn't fit" - cmp.l -4(a0),d1 ; check size versus desired size - bhi.s @done ; IF chunk is big enough - - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 - beq.s @fulltbl ; IF on a 68040 THEN - - btst.l #FullTblBit,d3 ; Check if we want full MMU tables for this block - beq.s @term ; IF Full Tables wanted then - -@fulltbl bsr.w CanGoDeeper ; check if on lowest level <7> - bne.s @valid ; >>EXITROUTINE if we're not on lowest level <7> - ; ENDIF <7> -@term move.l -8(a0),d0 ; page addr = start addr chunk - add.l d1,-8(a0) ; increment start addr by allocation amt - sub.l d1,-4(a0) ; decrement chunk size by allocation amt - move.l d0,a0 ; return page addr -@valid moveq #0,d0 ; returned type = "valid" -@done ; ENDIF - rts - - -;----- -; GrabVideo - allocate some space from the RAM allocated to video -; -; Entry: -; a4 - ptr to MakeTable stack frame -; a5 - points to InitMMU stack frame <3.2> -; d0 - amount to allocate -; d2.w - level -; d3 - phys addr/flags -; -; Exit: -; If requested size didn't fit in video RAM chunk -; d0 - two (didn't fit) -; a0 - undefined -; If all video RAM already allocated -; d0 - zero (valid page) -; a0 - base of video RAM (makes end of buffer wrap to start) <3.2> -; If requested size successfully allocated from video RAM chunk -; d0 - zero (valid page) -; a0 - allocated RAM chunk addr -; video RAM chunk's size reduced by allocation amount. -; -; Trashes -; d1 -;--- - -GrabVideo move.l d0,d1 ; save allocation amt - move.l VRAMPhysBase(a5),a0 ; assume no vRAM left, wrap to physical buffer base <9> - tst.l vidSize(a4) ; check remaining video RAM - beq.s @valid ; EXITROUTINE w/valid if none left <3.2> - moveq #2,d0 ; assume returning "didn't fit" (not enuf video RAM left) - cmp.l vidSize(a4),d1 ; check if there is enough - bhi.s @done ; EXITROUTINE if not enough left - - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 - beq.s @fulltbl ; IF on a 68040 THEN - - btst.l #FullTblBit,d3 ; Check if we want full MMU tables for this block - beq.s @term ; IF Full Tables wanted then - -@fulltbl bsr.s CanGoDeeper ; check if we'er on the lowest level <7> - bne.s @valid ; >>EXITROUTINE if we're not on lowest level <7> - ; ENDIF <7> -@term move.l vidAddr(a4),a0 ; return ptr to video RAM chunk - add.l d1,vidAddr(a4) ; bump video addr by allocation amt - sub.l d1,vidSize(a4) ; decrease remaining size by allocation amt -@valid moveq #0,d0 ; return "valid" <3.2> -@done rts - - -;----- -; GrabEdisk - allocate some space from the RAM allocated to the RAM disk -; -; The procedure scans the chunks, looking for one that has a non-zero size. -; It then determines whether the allocation amount fits in that chunk. No attempt -; is made to look at other chunks (if it doesn't fit in the first non-zero sized one) -; in order to preserve the ordering present in the chunk table. -; -; Entry: -; a4 - ptr to MakeTable stack frame -; d0 - amount to allocate -; d2.w - level -; d3 - phys addr/flags -; -; Exit: -; a0 - ptr to the RAM disk chunk -; d0 - type, as follows: -; zero: valid (allocation was successful) -; one: invalid (no RAM available) -; two: didn't fit (requested size didn't fit in first available chunk) -; -; if successful, RAM disk chunk size reduced by allocation amount. -; -; Trashes -; d1 -;--- -GrabEdisk - lea eDskChunks(a4),a0 ; point at table of eDisk chunks - move.l d0,d1 ; save allocation amt - moveq #1,d0 ; assume returning "invalid" (no RAM available) -@loop cmp.l #-1,(a0)+ ; LOOP while more chunks - beq.s @done ; >>EXITROUTINE if no more chunks - tst.l (a0)+ ; check size of chunk - beq.s @loop ; REPEAT while nothing in this chunk - moveq #2,d0 ; assume returning "didn't fit" - cmp.l -4(a0),d1 ; check size versus desired size - bhi.s @done ; IF chunk is big enough - - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 - beq.s @fulltbl ; IF on a 68040 THEN - - btst.l #FullTblBit,d3 ; Check if we want full MMU tables for this block - beq.s @term ; IF Full Tables wanted then - -@fulltbl bsr.s CanGoDeeper ; check if we'er on the lowest level <7> - bne.s @valid ; >>EXITROUTINE if we're not on lowest level <7> - ; ENDIF <7> -@term move.l -8(a0),d0 ; page addr = start addr chunk - add.l d1,-8(a0) ; increment start addr by allocation amt - sub.l d1,-4(a0) ; decrement chunk size by allocation amt - move.l d0,a0 ; return page addr -@valid moveq #0,d0 ; returned type = "valid" -@done ; ENDIF - rts - - -;----- -; CanGoDeeper - check if we can generate tables at at next level -; -; Entry: -; d2.w - current level -; a4 - points to MakeTable stack frame -; -; Exit -; Z flag - ne if we can, eq if we can't -; -; Trashes -; none -;--- - -DeeperRegs REG d0/a0 ; - -CanGoDeeper - movem.l DeeperRegs,-(sp) ;save working registers - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 <7> - bne.s @not040 ; IF on a 68040 THEN <7> - - cmp.w #3,d2 ; third level is the deepest we can go <7> - bra.s @done ; ELSE <7> -@not040 cmp.w #4,d2 ; fourth level is the deepest we can go <7> -@1 beq.s @done ; >>EXITROUTINE w/failure if at deepest level <7> - clr.l d0 ; so not to mess up bfextu down below <7> - move.w d2,d0 ; get level - addq.w #1,d0 ; get next level - lsl.w #2,d0 ; multiply by four (= TIx field size) - add.w #12,d0 ; get offset to TIx field - move.l mmuSetupPtr(a4),a0 ; get ptr to MMU setup info - bfextu newtc(a0){d0,4},d0 ; get TIx field for next level (eq if no TIx bits) -@done ; ENDIF <7> - movem.l (sp)+,DeeperRegs ; restore regs - rts - - -;----- -; WritePageNode - write a page node to the intermediate table. -; -; Entry: -; d1.w - cache inhibit flag -; d2.w - current level -; d3.l - logical address span of the node -; a0 - page address -; a4 - points to MakeTable stack frame -; -; Trashes: -; d0/a0 -;--- - -WritePageNode - moveq #0,d0 ; clear a reg - move.w d2,d0 ; get the level - lsl.w #3,d0 ; shift level into place - or.w d1,d0 ; factor in the cache inhibit flag - add.l a0,d0 ; lay in the page address - addq.w #descrPage,d0 ; set type = 'page' -AdvAndWrite add.l d3,logicalAddr(a4) ; logical address += span of this entry -WriteNode move.l genPtr(a4),a0 ; get ptr to next intermediate table entry - move.l d0,-(a0) ; put entry into intermediate table <7> - move.l a0,genPtr(a4) ; save ptr to next entry - rts - - -;----- -; WriteInvalidNode - write an invalid page node to the intermediate table. -; -; Entry: -; d2.w - current level -; d3.l - logical address span of the node -; a4 - points to MakeTable stack frame -; -; Trashes: -; d0/a0 -;--- - -WriteInvalidNode - moveq #0,d0 ; clear a reg - move.w d2,d0 ; get the level - lsl.w #3,d0 ; shift level into place - ; NOTE: invalid type = 0, so its already there - bra.s AdvAndWrite ; advance logical address, write node to - ; .intermediate table & EXIT - - -;----- -; WriteTableNode - write a table node to the intermediate table. -; -; Entry: -; d2.w - level -; a4 - points to MakeTable stack frame -; -; Trashes: -; d0/a0 -;--- - -WriteTableNode - cmp.w #cpu68040,d7 ; Check whether or not we're on an 040 <7> - bne.s @not040 ; IF on a 68040 THEN <7> - - movea.l #NoLimit,a0 ; we don't have limit fields <7> - bra.s @1 ; ELSE <7> -@not040 bsr.s Limit ; get limit field - ; ENDIF <7> -@1 moveq #0,d0 ; clear a reg - move.w d2,d0 ; get the level - lsl.w #3,d0 ; shift level into place - tst.w a0 ; check if low word of a0 is nonzero - bne.s @doWrite ; IF it is clear THEN - addq.w #descrTbl4,d0 ; set type to '4 byte table descriptor' - add.l a0,d0 ; factor in the limit field - or.w #LongStat,d0 ; put in rest of status field -@doWrite bra.s WriteNode ; write node to intermediate table & EXIT - ; ENDIF - -;----- -; Limit - given current level, looks backwards in intermediate table to see if -; a limit can be used on the next deeper level. -; -; If limit is possible, entries are shifted in the table to get rid of any entries -; made obsolete by the limit. -; -; Entry: -; d2.w - current level -; a4 - points to MakeTable stack frame -; -; Exit: -; a0 - limit field -;--- - -Limit move.l d3,-(sp) ; save work reg - bsr.s CountLeading ; get # leading invalid entries at next level - move.w d0,d3 ; save it - bsr.s CountTrailing ; get # trailing invalid entries at next level - move.w d0,d1 ; save it - or.w d3,d0 ; check for both zero - bne.s @yesLimit ; IF no leading OR trailing invalids - movea.l #NoLimit,a0 ; no limit! - bra.s @haveLimit ; . -@yesLimit cmp.w d1,d3 ; ELSEIF more trailing than leading - bhi.s @doLeading ; . - move.w d1,d0 ; recall # trailing invalids - bsr.s HandleTrailing ; handle upper limit case - bra.s @haveLimit ; . -@doLeading ; ELSE - move.w d3,d0 ; recall # leading invalids - bsr.s HandleLeading ; handle lower limit case -@haveLimit ; ENDIF - move.l (sp)+,d3 ; restore work reg - rts - -;----- -; CountLeading - count the number of leading invalid entries for the next lower level. -; -; Entry: -; d2.w - current level -; a4 - points to MakeTable stack frame -; -; Exit: -; d0.w - # leading invalid entries -;--- - -CountLeading - moveq #0,d0 ; deal w/leading invalid entries later... - rts - -;----- -; HandleLeading - purge the leading invalid entries at the next level from -; the intermediate table, and return an appropriate limit field. -; -; Entry: -; d0.w - # leading invalids -; d2.w - current level -; a4 - points to MakeTable stack frame -; -; Exit: -; a0 - limit field -;--- - -HandleLeading - move.l #NoLimit,a0 ; deal w/leading invalid entries later... - rts - -;----- -; CountTrailing - count the number of trailing invalid entries for the next lower level. -; -; Entry: -; d2.w - current level -; a4 - points to MakeTable stack frame -; -; Exit: -; d0.w - # trailing invalid entries -;--- - -CountTrailing - moveq #0,d0 ; # trailing invalids = 0 - move.l genPtr(a4),a0 ; get ptr to next intermediate table entry -@loop ; LOOP backwards thru intermediate table - move.l (a0)+,d1 ; get entry <7> - bfextu d1{30,2},d1 ; get descriptor type - bne.s @exitLoop ; >>EXITLOOP if not invalid - addq.w #1,d0 ; bump # trailing invalids - cmpa.l intermedTbl(a4),a0 ; check if we're at start of table - bne.s @loop ; REPEAT till start of table -@exitLoop rts - - -;----- -; HandleTrailing - purge the trailing invalid entries at the next level from -; the intermediate table, and return an appropriate limit field. -; Entry: -; d0.w - # trailing invalids -; d2.w - current level -; a4 - points to MakeTable stack frame -; -; Exit: -; a0 - limit field -;--- - -HandleTrailing - move.l d2,-(sp) ; save work reg - exg d2,d0 ; get current level, save # trailers - addq.w #1,d0 ; look at level we're getting limit for - bsr.s SpanAndCount ; get max # entries for that level - cmp.w d2,d1 ; check max entries against trailing invalids - blt.s @invalidLevel ; IF less invalids than max entries THEN | - sub.w d2,d1 ; limit = max # - # trailing v - subq.w #1,d1 ; limits are zero-based! - swap d1 ; get limit field in hi word - clr.w d1 ; zap low word - move.l d1,a0 ; return it - moveq #0,d0 ; clear a reg - move.w d2,d0 ; get # trailing invalids - bra.s @bumpPtr ; go bump intermediate table ptr -@invalidLevel ; ELSE - move.l d1,d0 ; use max number of entries - move.l #1,a0 ; return a bad limit -@bumpPtr ; ENDIF - lsl.l #2,d0 ; get size of their intermediate table entries - add.l d0,genPtr(a4) ; purge entries from intermediate table <7> - move.l (sp)+,d2 ; restore reg - rts - - -;----- -; SpanAndCount - get the address span of a given table level, and # entries at that level -; -; Entry -; d0.w - level -; a4 - ptr to MakeTable stack frame -; -; Exit -; d0.l - address span -; d1.w - count -;--- - -SpanAndCount -SpanRegs REG d2-d3 - movem.l SpanRegs,-(sp) ; save regs - move.l mmuSetupPtr(a4),a0 ; get ptr to MMU setup info - cmp.w #cpu68040,d7 ; check if we are an 040 <7> - bne.s @not040 ; IF on a 68040 THEN <7> - - clr.l d2 ; clear reg for span bits <7> - clr.l d3 ; clear reg for entry bits <7> - subq.w #1,d0 ; convert level into table index <7> - move.b (TIX040,d0.w*2),d2 ; get # of bits in this level's span <7> - move.b (TIX040+1,d0.w*2),d3; get # of bits in entry count for this level <7> - move.l #14,d0 ; bit # in TC to test for page size on 68040 <7> - btst d0,newtc(a0) ; check what size pages we're using <7> - beq.s @8kPages ; IF we're using 4k pages <7> - subq #1,d2 ; span goes down by half <7> - addq #1,d3 ; and number of entries doubles <7> -@8kPages ; ENDIF <7> - bra.s @done ; ELSE <7> -@not040 moveq #32,d2 ; start w/all address bits - bfextu newtc(a0){12,4},d1 ; get # initial shift bits - sub.l d1,d2 ; reduce total bits by initial shift - moveq #16,d1 ; get bit offset to 1st TIx field - subq.w #1,d0 ; adjust level for dbra -@loopTIx ; LOOP - bfextu newtc(a0){d1,4},d3 ; get # bits this level - sub.l d3,d2 ; reduce total by # bits this level - addq.w #4,d1 ; bump offset to next TIx field - dbra d0,@loopTIx ; REPEAT for all levels - ; ENDIF <7> -@done moveq #0,d0 ; clear return reg - bset d2,d0 ; set address span for this level - moveq #0,d1 ; clear return reg - bset d3,d1 ; set # entries this level - movem.l (sp)+,SpanRegs ; restore regs - rts - -TIX040 ; 68040 built-in table index field sizes (8k pages) <7> -LevelOne dc.b 25,7 ; 32M span, 128 entries <7> -LevelTwo dc.b 18,7 ; 256k span, 128 entries <7> -LevelThree dc.b 13,5 ; 8k span, 32 entries <7> - -;----- -; FinalTable - generate the final MMU table from the intermediate table -; -; Entry: -; a4 - point to MakeTable stack frame -; intermediate table has been created -; -; Exit -; a0 - points to newly created MMU table -; d0 - has 1st word of crp (limit, descriptor type) -;--- - -FinalTable lea intermedTbl(a4),a0 ; get ptr to intermediate table - move.l a0,genPtr(a4) ; initialize scanning ptr - moveq #1,d0 ; start generating at level 1 - bsr.s Generate ; generate the table - tst.w doWrap24(a4) ; wrap the tables for 24-bit mode? <7> - beq.s @noWrap ; IF we need to wrap tables THEN <7> - bsr Wrap24BitTable ; wrap tables for 24-bit mode <7> -@noWrap ; ENDIF <7> - move.l ([genPtr,a4],-4),d1 ; get next intermediate table entry <7> - add.w d0,d1 ; make type '8 byte' if sub-table is 8 byte - and.w #descrTypeMask,d1 ; crp doesn't have extra status field bits - cmp.b #PMMU851,sgTypeMMU(a6) ; check MMU type CSS - bne.s @done ; IF we are on a 68851 - bset #9,d1 ; set 'shared global' bit -@done ; ENDIF - move.l d1,d0 ; return crp - rts - -;----- -; Generate - given a level, generate a (sub) table for that level -; -; Entry -; d0.w - level -; -; Exit -; d0.w - size (0 = short, 1 = long) of entries at this level -; a0 - ptr to generated table -;--- - -GenRegs REG d2-d4/a1-a2 -Generate movem.l GenRegs,-(sp) ; save work regs - move.l d0,d4 ; save level - bsr.s CountAndSize ; get #, size table entries needed - move.w d0,d3 ; save count - move.w d1,d2 ; save size - bsr.s AllocTbl ; allocate space for the (sub) table - move.l a0,a1 ; set up fill ptr for table - move.l a0,a2 ; remember table address - bra.s @repeat ; adjust for dbra -@loop ; LOOP - move.l ([genPtr,a4],-4),d0 ; get next intermediate table entry <7> - bfextu d0{27,2},d1 ; get level of this entry - cmp.w d1,d4 ; check against level we're generating for - bhs.s @notTbl ; IF entry's level deeper than ours - move.w d4,d0 ; recall level we are working on - addq.w #1,d0 ; bump to deeper level - bsr.s Generate ; generate sub-table at next deeper level - bsr MakeTableEntry ; make a 4/8 byte table descriptor at fill ptr <16> - bra.s @next ; ... -@notTbl bne.s @weird ; ELSEIF entry's level = ours - bsr MakePageEntry ; make a 4/8 byte page/invalid entry at fill ptr -;fallThru bra.s @next ; ... -@next ; ENDIF -@repeat dbra d3,@loop ; REPEAT for all entries at this level - move.l a2,a0 ; return ptr to generated table - move.w d2,d0 ; return size of entries in generated table - movem.l (sp)+,GenRegs ; restore work regs - rts - -@weird ; entry's level less deep than ours - SHOULD NEVER HAPPEN! - dc.w $A9FF ; trap to debugger, call Sculley - - -;----- -; CountAndSize - return number and size of entries for subtree at given level -; -; Number of entries is obtained by scanning forward in the intermediate table, -; counting entries at this level until a higher (lower in number) level entry -; is found. Size is assumed 4 byte, but is 8 byte if any of the intermediate -; table entries encountered at this level are 8 byte. -; -; Entry -; d0 - level -; a4 points to MakeTable stack frame -; -; Exit -; d0.w - number of entries -; d1.w - zero if 4 byte descriptors, one if eight byte descriptors -;--- - -CountRegs REG d2-d4 -CountAndSize - movem.l CountRegs,-(sp) ; save work registers - move.w d0,d2 ; save level of interest - move.l genPtr(a4),a0 ; get ptr to itermediate table entry - moveq #0,d1 ; assume 4 byte descriptors - moveq #0,d0 ; count = zero -@loop ; LOOP - move.l -(a0),d3 ; get next intermediate table entry <7> - bfextu d3{27,2},d4 ; get level of this entry - cmp.w d4,d2 ; compare level to ours - bhi.s @done ; >>EXITIF level less deep than ours - bne.s @loop ; COUNTINUELOOP if not same level as ours - addq.w #1,d0 ; bump count - bfextu d3{30,2},d4 ; get type from entry - cmp.w #descrTbl4,d4 ; check it - bne.s @loop ; CONTINUELOOP if type ­ "4 byte table" - swap d3 ; get limit field - cmp.w #NoLimit>>16,d3 ; check the limit - beq.s @loop ; CONTINUELOOP if no limit - moveq #1,d1 ; signal we'll need 8 byte descriptors - bra.s @loop ; REPEAT -@done movem.l (sp)+,CountRegs ; restore work regs - rts - - -;----- -; AllocTbl - allocate quadlong aligned space for MMU table from BootGlobs -; -; Entry -; d0.w - # entries in table -; d1.w - size of entries (0 = short, 1 = long) -; d4.w - level -; a6 - points to BootGlobs -; -; Exit -; a0 - ptr to allocated space -; -;----- - -AllocTbl and.l #$FFFF,d0 ; clear hi word of # entries - addq.w #2,d1 ; convert size into scale factor - ext.l d1 ; clear hi word of size - lsl.l d1,d0 ; table size = scaled # entries - move.l a6,d1 ; get ptr to BootGlobs - add.l sgAllocOff(a6),d1 ; calculate current allocation ptr CSS - sub.l d0,d1 ; allocate our table - cmpi.w #cpu68040,d7 ; check the type of processor <16> - bne.s @notAn040 ; IF on a 68040 THEN <16> - lea AlignmentMasks,a0 ; get address of table alignment masks <16> - and.w (a0,d4.w*2),d1 ; align the table <16> - bra.s @aligned ; ELSE <16> -@notAn040 and.b #$F0,d1 ; ensure quad-long alignment for 020/030's <16> -@aligned ; ENDIF <16> - move.l d1,a0 ; return ptr to allocated space - sub.l a6,d1 ; figure out new allocation offset - move.l d1,sgAllocOff(a6) ; update allocation offset CSS - rts - -; Masks for aligning 68040 tables on the correct boundaries <16> -AlignmentMasks -Level0 dc.w 0 -Level1 dc.w $fe00 ; align to 512 bytes (SRP ptr) -Level2 dc.w $fe00 ; align to 512 bytes (ptrs IN 1st level) -Level3 dc.w $ff00 ; align to 256 bytes (ptrs IN 2nd level) - -;----- -; MakeTableEntry - make a 4 or eight byte table descriptor at passed fill ptr -; -; Entry -; d0 - size (0 = short, 1 = long) of entries in sub-table -; d2 - size (0 = short, 1 = long) of table descriptor to be made -; a0 - ptr to sub-table -; a1 - fill ptr -; a4 - points to MakeTable stack frame (genPtr points to next intermediate entry) -; -; Exit -; a1 - fillptr updated to next place to put a descriptor -; genPtr(a4) - points to next intermediate table entry -;--- - -MakeTableEntry - subq.l #4,genPtr(a4) ; bump scan ptr <7> - move.l ([genPtr,a4]),d1 ; get next intermediate table entry <7> - add.w d0,d1 ; make type '8 byte' if sub-table is 8 byte - bfextu d1{30,2},d0 ; get descriptor type - tst.w d2 ; check descriptor size - bne.s @eightByte ; IF its a 4 byte descriptor - add.l a0,d0 ; merge sub-table address w/type - bset #3,d0 ; set used bit, so processor won't have to - move.l d0,(a1)+ ; lay down descriptor, update fill ptr - bra.s @done ; ... -@eightByte ; ELSE (its an eight byte descriptor) - bfclr d1{24,6} ; clear rest of status field - bset #3,d1 ; set used bit, so processor won't have to - move.l d1,(a1)+ ; lay down limit & status, update fill ptr - move.l a0,(a1)+ ; lay down table address, update fill ptr -@done ; ENDIF - rts - - -;----- -; MakePageEntry - make a (4 or eight byte) page or table descriptor at passed fill ptr -; -; Entry -; d2 - size (0 = short, 1 = long) of descriptor to be made -; a1 - fill ptr -; a4 - points to MakeTable stack frame (genPtr points to next intermediate entry) -; -; Exit -; a1 - fillptr updated to next place to put a descriptor -; genPtr(a4) - points to next intermediate table entry -;--- - -MakePageEntry - subq.l #4,genPtr(a4) ; bump scan ptr <7> - move.l ([genPtr,a4]),d0 ; get next intermediate table entry <7> - bfextu d0{25,7},d1 ; get descriptor type, cache inhibit bit - and.w #$FF00,d0 ; clear out all except page address - bfset d1{27,2} ; set modified, used bits so processor won't have to - tst.w d2 ; check descriptor size - bne.s @eightByte ; IF its a 4 byte descriptor - add.l d0,d1 ; merge page address w/status field - move.l d1,(a1)+ ; lay down descriptor, update fill ptr - bra.s @done ; ... -@eightByte ; ELSE (its an eight byte descriptor) - bfset d1{1,21} ; set limit to $7FFF, set up high bits of status - move.l d1,(a1)+ ; lay down limit & status, update fill ptr - move.l d0,(a1)+ ; lay down page address, update fill ptr -@done ; ENDIF - rts - - ENDWITH ; {MakeFrame} - ENDWITH ; {InitFrame} - ENDWITH ; {MMUSetupInfo} - -;----- -; Wrap24BitTable - Wrap the entries in the first and second level tables. This causes <7> -; the first byte in an address to be essentially ignored in 24-bit mode. -; Note: This routine assumes 4-byte descriptors. -; -; Entry -; a0 - points to newly created MMU table -; a4 - point to MakeTable stack frame -; -; Exit -; a0 - ptr to generated table -;--- - -WrapRegs REG d2/a1-a2 -Wrap24BitTable - movem.l WrapRegs,-(sp) ; save work registers - move.l a0,a2 ; save ptr to mmu table - move.w #2,d0 ; for level two, - bsr.s SpanAndCount ; find entrys' address span and count - mulu.l d1,d0 ; calc span of entire 2nd-level table - move.l #24,d2 ; bits in 16 meg chunk - lsr.l d2,d0 ; calc how many 16 meg chunks in level - and.l #$ffff,d1 ; clear high word of count - divu.w d0,d1 ; calc # of entries to duplicate - move.l (a2),d2 ; get table descriptor for first 2nd-level table - andi.l #$fffffff0,d2 ; get rid of attribute bits - move.l d2,a1 ; get it in an address register - subq.l #2,d0 ; (# of copies to make)-1 - movea.l a1,a0 ; get copy of pointer to table - lsl.l #2,d1 ; convert # of entries to bytes -@chunkLoop - adda.l d1,a0 ; point to copy destination - clr.l d2 ; clear counter -@copyLoop - move.l (a1,d2),(a0,d2) ; copy an entry - addq.l #4,d2 ; point to next entry - cmp.l d2,d1 ; done? - bne.s @copyLoop ; nope, keep looping - dbra d0,@chunkLoop ; do next chunk, if any - - moveq.l #1,d0 ; for level one -- - bsr.s SpanAndCount ; get address span and entry count - movea.l a2,a1 ; get a copy of the mmu table pointer - adda.l #4,a1 ; bump to point at second entry in table - subq.w #2,d1 ; (# of entries to copy) - 1 -@wrapLoop - move.l (a2),(a1)+ ; copy an entry - dbra d1,@wrapLoop ; loop through first level table - movea.l a2,a0 ; restore a0 - - movem.l (sp)+,WrapRegs ; restore work regs - rts ; - -;_____________________________________________________________________________________________ -; GetRBVSize - return size of RBV video buffer, optionally rounded up. -; -; Entry -; d0.l - total memory available -; d1.l - MMU page size to round buffer size up to. Zero if no rounding. -; a0 - RBV base address -; a2 - ProductInfo record ptr (for finding slot zero PRAM alias addr) <8.1> -; -; Exit -; d0 - the size -; -; all registers except parameters are preserved -;_____________________________________________________________________________________________ - - -GetRBVSize - - IF hasRBV THEN - bra.s DoRBVSize ; branch around tables, assembler barfs on fwd refs - -Trans ; Translations from monitor ID bits - dc.w 0 ; 000 = reserved (no monitor) - dc.w P15Table-Trans ; x01 = 15" portrait - dc.w IIGSTable-Trans ; 010 = IIgs - dc.w 0 ; 011 = reserved (no monitor) - dc.w 0 ; 100 = reserved (no monitor) - dc.w P15Table-Trans ; x01 = 15" portrait - dc.w MacIITable-Trans ; 110 = Mac 2 - dc.w 0 ; 111 = no monitor - -; these sizes are ordered to match the option bit ordering in DeclDataRBV.a - -SETable DC.L $0002AC00 ; SE (9" monitor), 8 bits/pixel, 171 Kbyte buffer <8.9> - DC.L $00005580 ; SE (9" monitor, 342x512), 1 bit/pixel, 21.375 Kbyte buffer <8.9> - DC.L $00015600 ; SE (9" monitor), 4 bits/pixel, 85.5 Kbyte buffer <8.9> - DC.L $0000A600 ; SE (9" monitor), 2 bits/pixel, 42.75 Kbyte buffer <8.9> - -IIGSTable DC.L $00030000 ; IIGS (12" monitor,384x512), 8 bits/pixel, 192 Kbyte buffer <8.9> - DC.L $00006000 ; IIGS (12" monitor,384x512), 1 bit/pixel, 24 Kbyte buffer <8.9> - DC.L $00018000 ; IIGS (12" monitor,384x512), 4 bits/pixel, 96 Kbyte buffer <8.9> - DC.L $0000C000 ; IIGS (12" monitor,384x512), 2 bits/pixel, 48 Kbyte buffer <8.9> - -MacIITable DC.L $0004B000 ; Mac II (12" monitor,640x480), 8 bits/pixel, 300 Kbyte buffer - DC.L $00009600 ; Mac II (12" monitor,640x480), 1 bit/pixel, 37.5 Kbyte buffer - DC.L $00025800 ; Mac II (12" monitor,640x480), 4 bits/pixel, 150 Kbyte buffer - DC.L $00012C00 ; Mac II (12" monitor,640x480), 2 bits/pixel, 75 Kbyte buffer - -P15Table - DC.L $00043F80 ; Portrait (15" monitor,640x870), 4 bits/pixel, 272 Kbyte buffer - DC.L $00010FE0 ; Portrait (15" monitor,640x870), 1 bit/pixel, 68 Kbyte buffer - DC.L $00021FC0 ; Portrait (15" monitor,640x870), 2 bits/pixel, 136 Kbyte buffer - - -GetRBVRegs REG d1-d4/a0 - -DoRBVSize movem.l GetRBVRegs,-(sp) ; save regs - - move.l d1,-(SP) ; save the rounding factor - - moveq #(1< - adda.l ProductInfo.VideoInfoPtr(a2),a0 ; point to the VideoInfo record <8.1> - moveq.l #0,d2 ; <8.1> - move.b VideoInfo.SlotPramAddr(a0),d2 ; set d2 = pram addr for slot zero <8.1> - - move.w d2,d0 ; <8.1> - addq.w #4,d0 ; get the last configuration flags from slot 0 pRAM <8.1> - - bsr ReadPRAMByte ; read it and weep... <5> - - eor.b d3,d0 ; exclusive or to see if anything changed - - btst #3,d0 ; did the RAM size change? - bne.s @configChanged ; if set, then it did - -;+++ btst #4,d0 ; did the CPU speed change? -;+++ bne.s @configChanged ; if set, then the configuration changed - -; test if the monitor type has changed - - move.w d2,d0 ; d2 = addr of slot zero pram <8.1> - addq.w #3,d0 ; get the last video sRsrc spID from pRAM <8.1> - bsr ReadPRAMByte ; read this pRAM - bclr #7,d0 ; mask off the spID hi bit - move.w d0,d3 ; remember this value in d3 - and.l #7,D0 ; lo-3 bits = monitor ID - - moveq #0,d1 ; clear this register out as a long in case there's no monitor - move.w (Trans,d4*2),d1 ; 0 = none, 1-4 = SE, IIGS, MacII, P15 - beq.s @gotSize ; if no monitor, then don't allocate any memory for video - - cmp.b d0,d4 ; is the monitor the same? - beq.s @noChange ; yup, so the saved slot pRAM value is OK - -@configChanged ; if we got here, then the CPU configuration has changed - ; PRESERVE D1 ACROSS THIS SECTION! - btst #3,d3 ; was the 1MB bit turned on? - beq.s @10 ; if not, then skip - bclr #4,d3 ; if 1MB, then ignore CPU speed -@10 - or.b d4,d3 ; OR the monitor ID in d4 with the config data in d3 to get - ; sRsrc id (with hi-bit off) - -; when 1MB/25MHz machines default to 1,2,4 instead of 1,2,4,8, then and extra test will be needed hee - -; -; at this point, we have the valid video sRsrc spID (sans bit 7) in d3. We use this value to look -; up the buffer size in the Trans table declared above -; - -@noChange - lea Trans,a0 ; point to table - moveq #0,d1 ; clear, in case there's no monitor <6.4> - move.w (Trans,d4*2),d1 ; 0 = none, 1-4 = SE, IIGS, MacII, P15 <6.4> - beq.s @gotSize ; if no monitor, then no memory for video <6.4> - adda.l d1,a0 ; offset to monitor's table <6.4> - lsr #3,d3 ; get the option bits at the bottom of d3 - move.l (a0,d3*4),d1 ; get the frame buffer size in d1 - - move.l (SP),d0 ; get the rounding factor in d0 - beq.s @gotSize ; IF rounding needed - move.l d1,d2 ; save our size - tdivu.l d0,d3:d2 ; get remainder of size/round factor - tst.l d3 ; check remainder - beq.s @gotSize ; IF any remainder - sub.l d3,d0 ; get round factor - remainder - add.l d0,d1 ; add to size to get next higher - ; ENDIF - ; ENDIF -@gotSize ; ENDIF - move.l d1,d0 ; return size - move.l (SP)+,d1 ; restore d1 - movem.l (sp)+,GetRBVRegs ; restore regs - ELSE - moveq #0,d0 ; no RBV, no size - ENDIF - - - RTS - - -;_____________________________________________________________________________________________ -; -; GetVISASize - calculate size of VISA video buffer -; -; This routine finds the amount of RAM occupied by the video frame buffer to be used by the -; VISA decoder, and adjusts the chunk table sizes accordingly. This code is similar to -; that in the Universal primaryInit (in RBVPrimaryInit.a). It needs to verify the -; connected display, and do some pRAM stuff to make this calculation work correctly. -; -; Preserves all registers -; -; Inputs : A2 = pointer to productInfo record -; A3 = VISA base address -; A6 = pointer to RAM chunk table -; -; Outputs : none -; -;_____________________________________________________________________________________________ - - WITH StartGlobals - -GetVISASize - -; I'm a bad dog to include these equates here, but they live in different files in Reality/split sources and -; the Reality version can't be included. - -sRsrc_VidElsA2Em EQU $A8 ; special Apple II emulation mode (1,4) -sRsrc_VidElsGSa EQU $A2 ; Rubik (1,4) - - - MOVEM.L A0/A2/A3/D0/D2/D4,-(SP) - - MOVE.B VsMonP(A3),D4 ; get the current monitor information - LSR.B #3,D4 ; shift the monitor ID into the low bits - AND.B #7,D4 ; clear out other bits - CMP.B #7,D4 ; if sense lines read 111 then no connect - BEQ.S @Done ; no changes needed if no connect - - CMP.B #2,D4 ; if =2, then Rubik display - BNE.S @isJersey ; if =6, then Jersey display - LEA RubikTbl,A1 ; point to the Rubik memory table - BRA.S @GetPRAM ; -@isJersey LEA JerseyTbl,A1 ; point to the Jersey memory table - -@GetPRAM - ADD.L ProductInfo.VideoInfoPtr(A2),A2 ; point to the VideoInfo record - MOVEQ #0,D2 ; clear out this register - MOVE.B VideoInfo.SlotPramAddr(A2),D2 ; get the start of pRAM for built-in video - ADDQ #4,D2 ; point to the config byte (see PrimaryInit) - - MOVE.W D2,D0 ; copy it to this register - BSR ReadPRAMByte ; get the config byte from pRAM in D0, the RAM-less way - - CMP.B D4,D0 ; was it the same configuration? - BNE.S @ReConfig ; no, so recalculate the default - -; the display configuration is the same, so use the spID in slot pRAM byte 3 to determine allocation - - MOVE.W D2,D0 ; point to pRAM byte again, clearing bits 8-15 of D0 - SUBQ #1,D0 ; point to byte 3 - BSR ReadPRAMByte ; get the config byte from pRAM in D0, the RAM-less way - - CMP.W #sRsrc_VidElsA2Em,D0 ; is it the Apple II emulation mode? - BNE.S @0 ; if not, continue - - MOVE.B #sRsrc_VidElsGSa,D0 ; memory allocation for the Apple II mode is same as Rubik (1,4) -@0 - LSR.B #3,D0 ; shift lo to make index - AND.B #3,D0 ; just the low two bits - BRA.S @GetSize ; - -; the display configuration is different, so determine the new default - -@ReConfig - MOVEQ #0,D0 ; zero index register - CMP.B #2,D4 ; if =2, then Rubik display, so default is RAM sensitive - BNE.S @GetSize ; if Jersey, then no RAM size variant - CMP.L #$100000,sgTotalRAM(A6) ; is there more than a megabyte of RAM? CSS - BGT.S @GetSize ; if so, then select variant 0 - ADDQ #1,D0 ; select variant 1 for Elsie with 1MB on Rubik - -@GetSize - MOVE.L (A1,D0.W*4),D0 ; get size for this config. A1=Monitor table, D0=index in tbl - -; adjust the sgAllocOff field down by the frame buffer size - - MOVE.L sgTotalRAM(A6),D2 ; get total ram CSS - SUB.L D0,D2 ; subtract frame buffer size to get base of frame buffer - SUB.L A6,D2 ; make frame buffer base relative to pointer to boot globals - MOVE.L D2,sgAllocOff(A6) ; CSS - -@Done - MOVEM.L (SP)+,A0/A2/A3/D0/D2/D4 ; restore work registers - RTS - -RubikTbl DC.L $0001B400,$00007000,$0003B400,$00027000 ; sizes for Rubik (1,4),(1),(1,4,2Pg),(1,2Pg) -JerseyTbl DC.L $0000B000,$00000000,$0002B000 ; sizes for Jersey (1), , (1,2Pg) <12> - - ENDWITH ; {MMUConfigInfo} ENDWITH ; {BootGlobs} diff --git a/OS/MemoryMgr/MemoryMgr.make b/OS/MemoryMgr/MemoryMgr.make index 1701bbd..86058fb 100644 --- a/OS/MemoryMgr/MemoryMgr.make +++ b/OS/MemoryMgr/MemoryMgr.make @@ -17,21 +17,20 @@ FigmentDir = {MemoryMgrDir}FigmentSources: -#include {FigmentDir}Figment.Make - - MemoryMgrObjs = "{ObjDir}MemoryMgr.a.o" ¶ "{ObjDir}MemoryMgrExtensions.a.o" ¶ "{ObjDir}MemoryMgrInternal.a.o" ¶ "{ObjDir}BlockMove.a.o" -"{LibDir}MemoryMgr.lib" Ä "{LibDir}Figment.lib" {MemoryMgrObjs} - If "{FeatureSet}" =~ /Å'hasNewHeapMgr=True'Å/ - Lib {StdLibOpts} -o "{Targ}" "{LibDir}Figment.lib" {MemoryMgrObjs} - Else - Lib {StdLibOpts} -o "{Targ}" {MemoryMgrObjs} - End +#include {FigmentDir}Figment.Make + +# "{LibDir}MemoryMgr.lib" Ä "{LibDir}Figment.lib" {MemoryMgrObjs} +# If "{FeatureSet}" =~ /Å'hasNewHeapMgr=True'Å/ +# Lib {StdLibOpts} -o "{Targ}" "{LibDir}Figment.lib" {MemoryMgrObjs} +# Else +# Lib {StdLibOpts} -o "{Targ}" {MemoryMgrObjs} +# End "{ObjDir}BlockMove.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/OS/NKEventGroupWrapper.a b/OS/NKEventGroupWrapper.a new file mode 100644 index 0000000..8114f69 --- /dev/null +++ b/OS/NKEventGroupWrapper.a @@ -0,0 +1,55 @@ +; Straightforward 68k wrappers for three NanoKernel MPCalls related to EventGroups + +MPCall49 PROC EXPORT ; create an EventGroup (will be for blue), return its ID + + Link A6, #$0 + MoveQ.L #49, D0 + dc.w $fe1f + Move.L D0, $C(A6) + Move.L $8(A6), D0 + BEQ.B (* + $6) + MoveA.L D0, A1 + Move.L A0, (A1) + Unlk A6 + MoveA.L (SP)+, A0 + AddQ #$4, SP + Jmp (A0) + + + +MPCall54 PROC EXPORT + + Link A6, #$0 + MoveA.L $C(A6), A0 + Move.L $8(A6), D1 + MoveQ.L #54, D0 + dc.w $fe1f + Move.L D0, $10(A6) + Unlk A6 + MoveA.L (SP)+, A0 + AddQ.L #$8, SP + Jmp (A0) + + + +MPCall52 PROC EXPORT + + Link A6, #$0 + MoveA.L $8(A6), A1 + MoveA.L $10(A6), A0 + MoveQ.L #52, D0 + dc.w $fe1f + Move.L D0, $14(A6) + Move.L $C(A6), D0 + BEQ.B (* + $6) + MoveA.L D0, A1 + Move.L A0, (A1) + Unlk A6 + MoveA.L (SP)+, A0 + DC.W $defc, $000c +; AddA.W #$C, SP + Jmp (A0) + + + + END \ No newline at end of file diff --git a/OS/NKLogShim.a b/OS/NKLogShim.a new file mode 100644 index 0000000..2397394 --- /dev/null +++ b/OS/NKLogShim.a @@ -0,0 +1,68 @@ +; To print a C string: +; PEA @cstring +; MOVE $-3, -(SP) +; DC.W $AA7F + +; To print a hex string: +; MOVE.L #value, -(SP) +; MOVE #2, -(SP) ; 1: byte, 2: word, else: long +; MOVE $-2, -(SP) +; DC.W $AA7F + + +NKLog PROC EXPORT + CmpI #-3, $4(SP) + BEQ.S NKxprintf + + CmpI #-2, $4(SP) ; + BEQ.S NKPrintHex + + Pea.L @errStr ; ERROR + Clr -(SP) + Bsr NKxprintf + + MoveQ.L #$0, D0 + Move $4(SP), D0 + Move.L D0, -(SP) + Move.L #$2, -(SP) + Clr -(SP) + Bsr NKPrintHex + Rts + + string Pascal +@errStr dc.b 'Unknown MPDispatch selector: ', 0, 0 + + +NKxprintf + + MoveA.L $6(SP), A0 + +@loop Move.B (A0)+, D0 ; iterate over string to get it in physical RAM? + BNE.S @loop + + MoveA.L $6(SP), A0 + + MoveQ.L #96, D0 ; call NKXprintf + dc.w $fe1f + + MoveA.L (SP)+, A0 ; return + AddQ.L #$6, SP + Jmp (A0) + + +NKPrintHex + + MoveA.L $A(SP), A0 ; r3 arg (value to print) + Move.L $6(SP), D1 ; r4 arg (1: byte, 2: 2byte, else: 4byte) + + MoveQ.L #97, D0 ; call NKPrintHex + dc.w $fe1f + + MoveA.L (SP)+, A0 ; return + dc.w $defc, $000A +; AddA.W #$A, SP + Jmp (A0) + + + + END diff --git a/OS/OS.make b/OS/OS.make index 567c4d6..80426c1 100644 --- a/OS/OS.make +++ b/OS/OS.make @@ -77,29 +77,28 @@ RealTimeDir = {OSDir}RealTime: #include {RealTimeDir}RealTime.make -OSObjs = "{ObjDir}clock.a.o" ¶ +OSObjs = "{ObjDir}BCScreenRelated.o" ¶ + "{ObjDir}clock.a.o" ¶ "{ObjDir}CrsrDev.a.o" ¶ "{ObjDir}CudaMgr.a.o" ¶ "{ObjDir}DeferredTaskMgr.a.o" ¶ - "{ObjDir}DeviceMgr.a.o" ¶ - "{ObjDir}DockingMgr.a.o" ¶ + "{ObjDir}DeviceRelatedMgr.o" ¶ "{ObjDir}EgretMgr.a.o" ¶ "{ObjDir}HwPriv.a.o" ¶ - "{ObjDir}I2C.a.o" ¶ "{ObjDir}Universal.a.o" ¶ - "{ObjDir}InterruptHandlers.a.o" ¶ - "{ObjDir}IOPMgr.a.o" ¶ "{ObjDir}OSEventMgr.a.o" ¶ "{ObjDir}queue.a.o" ¶ "{ObjDir}sysUtil.a.o" ¶ "{ObjDir}VerticalRetraceMgr.a.o" ¶ "{ObjDir}MiscPatches.a.o" ¶ - "{ObjDir}MagicData.a.o" ¶ "{ObjDir}PowerMgr.o" ¶ - "{ObjDir}PwrControlsPatches.o" ¶ "{ObjDir}VMPatches.a.o" ¶ + "{ObjDir}NKLogShim.a.o" ¶ "{ObjDir}Dispatch.a.o" ¶ - "{ObjDir}UniversalTables.a.o" + "{ObjDir}UniversalTables.a.o" ¶ + "{ObjDir}NKEventGroupRelated.a.o" ¶ + "{ObjDir}InterruptHandlers.a.o" ¶ + "{ObjDir}NKEventGroupWrapper.a.o" "{LibDir}OS.lib" Ä {OSObjs} @@ -133,14 +132,14 @@ OSObjs = "{ObjDir}clock.a.o" Asm {StdAOpts} -o "{Targ}" "{OSDir}DeferredTaskMgr.a" -"{ObjDir}DeviceMgr.a.o" Ä "{OSDir}DeviceMgr.a" ¶ - "{ObjDir}StandardEqu.d" ¶ - "{AIncludes}HardwareEqu.a" ¶ - "{IntAIncludes}UniversalEqu.a" ¶ - "{AIncludes}ROMEqu.a" ¶ - "{AIncludes}Slots.a" ¶ - "{AIncludes}FSEqu.a" - Asm {StdAOpts} -o "{Targ}" "{OSDir}DeviceMgr.a" +# "{ObjDir}DeviceMgr.a.o" Ä "{OSDir}DeviceMgr.a" ¶ +# "{ObjDir}StandardEqu.d" ¶ +# "{AIncludes}HardwareEqu.a" ¶ +# "{IntAIncludes}UniversalEqu.a" ¶ +# "{AIncludes}ROMEqu.a" ¶ +# "{AIncludes}Slots.a" ¶ +# "{AIncludes}FSEqu.a" +# Asm {StdAOpts} -o "{Targ}" "{OSDir}DeviceMgr.a" "{ObjDir}DispatchHelper.a.o" Ä "{ObjDir}StandardEqu.d" ¶ @@ -191,19 +190,19 @@ OSObjs = "{ObjDir}clock.a.o" "{IntAIncludes}i2cEqu.a" Asm {StdAOpts} -o "{Targ}" "{I2CDir}I2C.a" -"{ObjDir}InterruptHandlers.a.o" Ä "{ObjDir}StandardEqu.d" ¶ - "{IntAIncludes}HardwarePrivateEqu.a" ¶ - "{IntAIncludes}SysPrivateEqu.a" ¶ - "{IntAIncludes}UniversalEqu.a" ¶ - "{IntAIncludes}IOPrimitiveEqu.a" ¶ - "{AIncludes}Shutdown.a" ¶ - "{IntAIncludes}PowerPrivEqu.a" ¶ - "{IntAIncludes}EgretEqu.a" ¶ - "{IntAIncludes}PSCEqu.a" ¶ - "{IntAIncludes}AMICEqu.a" ¶ - "{IntAIncludes}GrandCentralPriv.a" ¶ - "{OSDir}InterruptHandlers.a" - Asm {StdAOpts} -o "{Targ}" "{OSDir}InterruptHandlers.a" +# "{ObjDir}InterruptHandlers.a.o" Ä "{ObjDir}StandardEqu.d" ¶ +# "{IntAIncludes}HardwarePrivateEqu.a" ¶ +# "{IntAIncludes}SysPrivateEqu.a" ¶ +# "{IntAIncludes}UniversalEqu.a" ¶ +# "{IntAIncludes}IOPrimitiveEqu.a" ¶ +# "{AIncludes}Shutdown.a" ¶ +# "{IntAIncludes}PowerPrivEqu.a" ¶ +# "{IntAIncludes}EgretEqu.a" ¶ +# "{IntAIncludes}PSCEqu.a" ¶ +# "{IntAIncludes}AMICEqu.a" ¶ +# "{IntAIncludes}GrandCentralPriv.a" ¶ +# "{OSDir}InterruptHandlers.a" +# Asm {StdAOpts} -o "{Targ}" "{OSDir}InterruptHandlers.a" "{ObjDir}IOPMgr.a.o" Ä "{ObjDir}StandardEqu.d" ¶ @@ -255,14 +254,14 @@ OSObjs = "{ObjDir}clock.a.o" Asm {StdAOpts} -o "{Targ}" "{OSDir}Universal.a" -i "{OSDir}StartMgr" -"{ObjDir}UniversalTables.a.o" Ä "{ObjDir}StandardEqu.d" ¶ - "{IntAIncludes}HardwarePrivateEqu.a" ¶ - "{IntAIncludes}UniversalEqu.a" ¶ - "{AIncludes}Slots.a" ¶ - "{IntAincludes}DepVideoEqu.a" ¶ - "{AIncludes}ROMEqu.a" ¶ - "{OSDir}UniversalTables.a" - Asm {StdAOpts} -o "{Targ}" "{OSDir}UniversalTables.a" -i "{OSDir}IoPrimitives:" +# "{ObjDir}UniversalTables.a.o" Ä "{ObjDir}StandardEqu.d" ¶ +# "{IntAIncludes}HardwarePrivateEqu.a" ¶ +# "{IntAIncludes}UniversalEqu.a" ¶ +# "{AIncludes}Slots.a" ¶ +# "{IntAincludes}DepVideoEqu.a" ¶ +# "{AIncludes}ROMEqu.a" ¶ +# "{OSDir}UniversalTables.a" +# Asm {StdAOpts} -o "{Targ}" "{OSDir}UniversalTables.a" -i "{OSDir}IoPrimitives:" "{ObjDir}VerticalRetraceMgr.a.o" Ä "{ObjDir}StandardEqu.d" ¶ @@ -282,3 +281,11 @@ OSObjs = "{ObjDir}clock.a.o" "{ObjDir}VMPatches.a.o" Ä "{OSDir}VMPatches.a" Asm {StdAOpts} -o "{Targ}" "{OSDir}VMPatches.a" + + +"{ObjDir}NKLogShim.a.o" Ä "{OSDir}NKLogShim.a" + Asm {StdAOpts} -o "{Targ}" "{OSDir}NKLogShim.a" + + +"{ObjDir}NKEventGroupWrapper.a.o" Ä "{OSDir}NKEventGroupWrapper.a" + Asm {StdAOpts} -o "{Targ}" "{OSDir}NKEventGroupWrapper.a" diff --git a/OS/OSEventMgr.a b/OS/OSEventMgr.a index 72dfb69..64aafd4 100644 --- a/OS/OSEventMgr.a +++ b/OS/OSEventMgr.a @@ -129,10 +129,11 @@ INCLUDE 'Balloons.a' ; INCLUDE 'BalloonsPriv.a' ; INCLUDE 'PowerPrivEqu.a' ; + INCLUDE 'Processes.a' Events PROC EXPORT - EXPORT InitEvents,PostEventTrap,GetOSEventTrap,OSEventAvailTrap,FlushEvents + EXPORT InitEvents,PostEventTrap,GetOSEventTrap,OSEventAvailTrap,FlushEvents,NewEMFunction IMPORT EnqueueTrap,DequeueTrap,SMgrPostMunging @@ -143,7 +144,7 @@ EvtOffset EQU 6 ; event record offset from start of ;_______________________________________________________________________ ; -; Routine: InitEvents +; Routine: InitEvents afe0 ; ; Arguments: D0 (input) -- number of elements in the event queue ; D0 (output) -- result code @@ -184,7 +185,7 @@ InitEvents move.w EventQueue,d2 ; check the first word of the EventQ ;_______________________________________________________________________ ; -; Routine: PostEvent +; Routine: PostEvent b010 ; ; Arguments: A0 (input) -- event number (16-bit) ; D0 (input) -- event message (32-bit) @@ -304,7 +305,7 @@ FillRecord MOVE.L Ticks,EvtTicks(A0) ; fill in the current time ;_______________________________________________________________________ ; -; Routine: OSEventavail +; Routine: OSEventavail b09c ; ; Arguments: A0 (input) -- pointer to user event record (32-bit) ; D0 (input) -- set of events desired (event mask) @@ -330,8 +331,9 @@ FillRecord MOVE.L Ticks,EvtTicks(A0) ; fill in the current time ;_______________________________________________________________________ OSEventAvailTrap - IMPORT ptchHMGetBalloons ; rb, start - IMPORT ptchHMCallTrackerInContext + ANDI.L #$FFFF,D0 + +OSEventAvailSkippingAndi with PowerDispRec MOVEM.L A0-A1/D0-D2,-(SP) ; we need to save these regs @@ -348,7 +350,40 @@ OSEventAvailTrap BNE.S @DoNothing ; do nothing on the reentrant case ST hmgOSEventReentrantCount(A0) ; say that we're busy - JSR ptchHMCallTrackerInContext + +; from BalloonExtensions.a: ptchHMCallTrackerInContext + + SUBQ #$8, SP + SUBQ #$2, SP + PEA.L $2(SP) + + MOVEQ.L #-$1, D0 ; like _GetFrontProcess but not quite + MOVE.L D0, -(SP) + MOVE #$39, -(SP) + _OSDispatch + + TST (SP)+ + BNE.B @wasError + SUBQ #$2, SP + + PEA.L $2(SP) + _WakeUpProcess + + TST (SP)+ + BNE.B @wasError + + SUBQ #$2, SP + MOVE #$FC, D0 ; from Balloonptch28.p: HMBalloonBulk + _Pack14 + + TST (SP)+ +@wasError AddQ #$8, SP + + ; from BalloonExtensions.a: ptchHMGetHelpGlobal + MOVE.L ExpandMem,A0 ; point to the expand mem ptr + MOVE.L ExpandMemRec.emHelpGlobals(A0),A0 ; return the global ptr on the stack + + CLR hmgOSEventReentrantCount(A0) @DoNothing MOVEM.L (SP)+,A0-A1/D0-D2 ; restore 'em, rb, end @@ -389,9 +424,12 @@ TstAutoEvent AND.W SysEvtMask,D0 ; figure in system mask for pseudo-evts MOVE.L Ticks,D1 ; check first threshold MOVE.L D1,D2 SUB.L KeyTime,D1 + CMPI.L #$8000,D1 + BGE @skip CMP KeyThresh,D1 BLT.S NoEventAvail ; br if not time yet +@skip SUB.L KeyRepTime,D2 ; check second threshold CMP KeyRepThresh,D2 BLT.S NoEventAvail ; br if not time yet @@ -439,7 +477,7 @@ NoEventAvail BSR.S FillRecord ; fill in record for null events ;_______________________________________________________________________ ; -; Routine: GetOSEvent +; Routine: GetOSEvent b1aa ; ; Arguments: A0 (input) -- pointer to user event buffer (32-bit) ; D0 (input) -- type of event desired (event mask) @@ -458,7 +496,10 @@ NoEventAvail BSR.S FillRecord ; fill in record for null events ; Other: uses D0,D1,D2,A0,A1 ;_______________________________________________________________________ -GetOSEventTrap BSR.S OldOSEventAvail ; first find the event +GetOSEventTrap ANDI.L #$FFFF,D0 + +GetOSEventSkippingAndi + BSR.S OldOSEventAvail ; first find the event BNE.S @EventDone ; don't dequeue null or update events MOVE.L A0,-(SP) ; save user's event record ptr @@ -487,7 +528,7 @@ DeleteEvt JSR DequeueTrap ; dequeue it (D0 destroyed) ;_______________________________________________________________________ ; -; Routine: FlushEvents +; Routine: FlushEvents b1ea ; ; Arguments: D0 (input) -- low word: events to remove (event mask) ; high word: events on which to stop (event mask) @@ -548,33 +589,38 @@ FlushStop MOVEM.L (SP)+,D3-D4 ; restore regs MOVE.W (SP)+, SR ; on as our result RTS - END - - - - - - - - - - - - - - - - - - - - - - - - - - - + +NewEMFunction +; b232 + MoveA.L (A7)+, A1 + CmpI #$1, D0 + BEQ.B L13 + CmpI #$2, D0 + BEQ.B L14 + CmpI #$3, D0 + BEQ.B L15 + MoveQ.L #$C, D0 + DC.W $A9C9 +L13 Move.L (A7)+, D0 + MoveA (A7)+, A0 + Move.L A1, -(A7) + Bsr GetFreeOne + Bra.B L16 +L14 MoveA.L (A7)+, A0 + Move.L (A7)+, D0 + Move.L A1, -(A7) + Bsr OSEventAvailSkippingAndi + Not.L D0 + AndI.L #$101, D0 + Bra.B L16 +L15 MoveA.L (A7)+, A0 + Move.L (A7)+, D0 + Move.L A1, -(A7) + Bsr GetOSEventSkippingAndi + Not.L D0 + AndI.L #$101, D0 +L16 Move.L D0, $4(A7) + Rts + END diff --git a/OS/PowerMgr/PowerMgr.a b/OS/PowerMgr/PowerMgr.a index 31d267e..911de97 100644 --- a/OS/PowerMgr/PowerMgr.a +++ b/OS/PowerMgr/PowerMgr.a @@ -615,7 +615,7 @@ PowerMngr PROC EXPORT ;________________________________________________________________________________________ ; -; Routine: InitPMgrVars +; Routine: InitPMgrVars c3c0 ; ; Inputs: none ; @@ -982,7 +982,7 @@ InitPmgrGlobals ;________________________________________________________________________________________ ; -; Routine: InitPMgrOp +; Routine: InitPMgrOp c446 ; ; Inputs: A3 -- pointer to Power Manager's variables ; @@ -1004,7 +1004,7 @@ InitPMgrOp LEA cmdCounts,A0 ; save pointers to the PMgrOp send/receive count ;________________________________________________________________________________________ ; -; Routine: SetupPMgrOpInterface +; Routine: SetupPMgrOpInterface c45e ; ; Inputs: none ; @@ -1046,7 +1046,7 @@ SetupPMgrOpInterface ;________________________________________________________________________________________ ; -; Routine: DoPmgrCommands +; Routine: DoPmgrCommands c49c ; ; Inputs: A3 -- Pointer to PmgrVars ; @@ -1109,7 +1109,7 @@ DoPmgrCommands ;________________________________________________________________________________________ ; -; Routine: DoDynamicSpeedChange +; Routine: DoDynamicSpeedChange c540 ; ; Inputs: A3 -- Pointer to PmgrVars ; @@ -1233,7 +1233,7 @@ GetPmgrPRAM ;________________________________________________________________________________________ -; Routine: InstallVBLs +; Routine: InstallVBLs c6de ; ; Inputs: A3 -- Pointer to PmgrVars ; @@ -1401,7 +1401,7 @@ BatWatch ;________________________________________________________________________________________ ; -; Routine: RemoveMsg +; Routine: RemoveMsg c780 ; ; Inputs: A2 - pointer to Power Manager's variables ; @@ -1464,7 +1464,7 @@ InstallMsg ;________________________________________________________________________________________ ; -; Routine: PMGRInt +; Routine: PMGRInt c79e ; ; Inputs: A1 - pointer to VIA1 base ; @@ -2249,7 +2249,7 @@ SetHDState ;________________________________________________________________________________________ ; | -; Routine: PmgrOp v +; Routine: PmgrOp ceb2 v ; ; Inputs: D1 - trap word ; @@ -2291,7 +2291,7 @@ PmgrOp ;________________________________________________________________________________________ ; -; Routine: PmgrTrap +; Routine: PmgrTrap cef6 ; ; Inputs: A0 -- pointer to Power Manager parameter block ; [word] command/reply @@ -2569,7 +2569,7 @@ pmgrPollRegs REG D3/D4/D5/D6/A0/A1/A2/A4 ;________________________________________________________________________________________ ; -; Routine: Wait4AckLo +; Routine: Wait4AckLo d09e ; ; Inputs: D2 -- timeout count ; A1 -- pointer to VIA1 base @@ -2599,7 +2599,7 @@ Wait4AckLo MOVEA.L (SP)+,A4 ; save the return address ;________________________________________________________________________________________ ; -; Routine: Wait4AckHi +; Routine: Wait4AckHi d0b8 ; ; Inputs: D2 -- timeout count ; A1 -- pointer to VIA1 base @@ -2629,7 +2629,7 @@ Wait4AckHi MOVEA.L (SP)+,A4 ; save the return address ;________________________________________________________________________________________ ; -; Routine: ReceiveByte +; Routine: ReceiveByte d0d2 ; ; Inputs: D6 -- interface type ; 0=parallel @@ -2704,7 +2704,7 @@ SendRcvDone BSET #PMreq,(A2) ; be sure /req is not asserted ;________________________________________________________________________________________ ; -; Routine: SendByte +; Routine: SendByte d136 ; ; Inputs: D1 -- byte to send ; D2 -- timeout count @@ -2769,7 +2769,7 @@ DisableBuf BRA.S @Buf2Input ; [0] parallel interface ;________________________________________________________________________________________ ; -; Routine: UnloadPollstack +; Routine: UnloadPollstack d180 ; ; Inputs: D7 -- pointer to top of poll stack ; A1 -- pointer to VIA1 base @@ -3378,7 +3378,7 @@ replyCounts DC.B 0 ; [$00] - ;________________________________________________________________________________________ ; -; _CommsPower - Communications' port power control +; _CommsPower - Communications' port power control d3a8 ; _SerialPower ($A685) - Serial port power control ; ; Enter with: D0 = bit pattern @@ -3493,7 +3493,7 @@ SerialPower ;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ djw -; Modem Sound Interrupt Handlers +; Modem Sound Interrupt Handlers d3f4 ; ; Modem sound on Tim is implemented through DFAC's aux channel. The modem demands ; and releases the sound path through the MODEM_SND_ENABLE signal (on VIA1 CB2). The @@ -3524,7 +3524,7 @@ ModemSndOnInt rts ;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; Modem Sound Interrupt Handlers | +; Modem Sound Interrupt Handlers d464 | ; V ; Modem sound on Tim is implemented through DFAC's aux channel. The modem demands ; and releases the sound path through the MODEM_SND_ENABLE signal (on VIA1 CB2). The @@ -3555,7 +3555,7 @@ ModemSndOffInt ;________________________________________________________________________________________ ; -; IdleState ($A485) - Increments/decrements the idle enable flag count and returns +; IdleState d4d2 ($A485) - Increments/decrements the idle enable flag count and returns ; the current speed. ; ; Enter with: D0 < 0, read speed @@ -4350,7 +4350,7 @@ SlpQRemove CMP.W #slpQType,SleepqType(A0) ;________________________________________________________________________________________ ; -; Routine: ResetPMGRInts +; Routine: ResetPMGRInts c752 ; ; Inputs: A1 - VIA1 base address ; @@ -4456,7 +4456,7 @@ SetSupervisorMode JMP (A1) ; Get out of here ;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; Routine: PMGRsend/recv +; Routine: PMGRsend/recv d504/d506 ; ; Inputs: A0 - data buffer ; D0 - command diff --git a/OS/PowerMgr/PowerMgr.make b/OS/PowerMgr/PowerMgr.make index 4383e53..e12a1eb 100644 --- a/OS/PowerMgr/PowerMgr.make +++ b/OS/PowerMgr/PowerMgr.make @@ -14,22 +14,22 @@ # -"{ObjDir}PowerMgr.o" Ä "{ObjDir}StandardEqu.d" ¶ - "{IntAIncludes}HardwarePrivateEqu.a" ¶ - "{IntAIncludes}UniversalEqu.a" ¶ - "{IntAIncludes}PowerPrivEqu.a" ¶ - "{AIncludes}AppleTalk.a" ¶ - "{AIncludes}Notification.a" ¶ - "{IntAIncludes}IopEqu.a" ¶ - "{IntAIncludes}EgretEqu.a" ¶ - "{IntAIncludes}AppleDeskBusPriv.a" ¶ - "{IntAIncludes}MMUEqu.a" ¶ - "{IntAIncludes}IOPrimitiveEqu.a" ¶ - "{AIncludes}LAPEqu.a" ¶ - "{IntAIncludes}DockingEqu.a" ¶ - "{AIncludes}Slots.a" ¶ - "{PowerMgrDir}PowerMgr.a" - Asm {StdAOpts} -o "{Targ}" "{PowerMgrDir}PowerMgr.a" +# "{ObjDir}PowerMgr.o" Ä "{ObjDir}StandardEqu.d" ¶ +# "{IntAIncludes}HardwarePrivateEqu.a" ¶ +# "{IntAIncludes}UniversalEqu.a" ¶ +# "{IntAIncludes}PowerPrivEqu.a" ¶ +# "{AIncludes}AppleTalk.a" ¶ +# "{AIncludes}Notification.a" ¶ +# "{IntAIncludes}IopEqu.a" ¶ +# "{IntAIncludes}EgretEqu.a" ¶ +# "{IntAIncludes}AppleDeskBusPriv.a" ¶ +# "{IntAIncludes}MMUEqu.a" ¶ +# "{IntAIncludes}IOPrimitiveEqu.a" ¶ +# "{AIncludes}LAPEqu.a" ¶ +# "{IntAIncludes}DockingEqu.a" ¶ +# "{AIncludes}Slots.a" ¶ +# "{PowerMgrDir}PowerMgr.a" +# Asm {StdAOpts} -o "{Targ}" "{PowerMgrDir}PowerMgr.a" "{ObjDir}PwrControlsPatches.o" Ä "{ObjDir}StandardEqu.d" ¶ "{IntAIncludes}HardwarePrivateEqu.a" ¶ diff --git a/OS/Queue.a b/OS/Queue.a index 91dbf92..45b33c6 100644 --- a/OS/Queue.a +++ b/OS/Queue.a @@ -87,49 +87,6 @@ ENQDONE SUBQ #2,A1 ;restore A1 ENDP -;----------------------------------------------------------------------- -; EnqueueHead -- add a queue element to the head of a queue. -;----------------------------------------------------------------------- -; -; Entry: -; A0 - points to the queue element -; A1 - points to the queue header -; All registers are preserved; there are no error conditions. -; -; The element is inserted at the beginning of the list. -; -;----------------------------------------------------------------------- -; -ENQUEUEHEAD PROC EXPORT - - MOVE SR, -(SP) ;preserve status - ADDQ #2, A1 ;point to qHead - ORI #$0700, SR ;disable interrupts for exclusion - - TST.L (A1)+ ;anything in the queue? (qHead) - BNE.S @doQinsert ;if so, skip ahead -; -; the queue is empty so make the head and tail point to the new element -; - MOVE.L A0, (A1) ;qTail - MOVE.L A0, -(A1) ;qHead - CLR.L qLink(A0) ;clear the link of the element - BRA.S @enQdone -; -; insert the element at the head of the list -; -@doQinsert MOVE.L A2, -(SP) ;preserve A2 - MOVE.L -(A1), A2 ;get ptr to old qHead - MOVE.L A2, qLink(A0) ;update new link to old head - MOVE.L A0, (A1) ;update qHead - MOVE.L (SP)+, A2 ;restore A2 -; -@enQdone SUBQ #2, A1 ;restore A1 - MOVE (SP)+, SR ;restore status and go home - RTS - - ENDP - ; ;----------------------------------------------------------------------- ; diff --git a/OS/RealTime/RealTime.make b/OS/RealTime/RealTime.make new file mode 100644 index 0000000..e69de29 diff --git a/OS/SCSIMgr/SCSIMgr.make b/OS/SCSIMgr/SCSIMgr.make index 589d04c..6077460 100644 --- a/OS/SCSIMgr/SCSIMgr.make +++ b/OS/SCSIMgr/SCSIMgr.make @@ -38,8 +38,8 @@ SCSIObjects = "{ObjDir}scsiboot.a.o" "{ObjDir}SCSIMgrInitDB.a.o" ¶ "{ObjDir}SCSIMgrDB.a.o" ¶ -"{LibDir}SCSI.lib" Ä {SCSIObjects} - Lib {StdLibOpts} -o "{Targ}" {SCSIObjects} +# "{LibDir}SCSI.lib" Ä {SCSIObjects} +# Lib {StdLibOpts} -o "{Targ}" {SCSIObjects} "{ObjDir}SCSIBoot.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/OS/SlotMgr/SlotMgr.make b/OS/SlotMgr/SlotMgr.make index fbb4032..b68a544 100644 --- a/OS/SlotMgr/SlotMgr.make +++ b/OS/SlotMgr/SlotMgr.make @@ -16,8 +16,8 @@ SlotMgrObjs = "{ObjDir}SlotInterrupts.a.o" "{ObjDir}SlotMgrInit.a.o" ¶ "{ObjDir}SlotMgr.a.o" -"{LibDir}SlotMgr.lib" Ä {SlotMgrObjs} - Lib {StdLibOpts} -o "{Targ}" {SlotMgrObjs} +# "{LibDir}SlotMgr.lib" Ä {SlotMgrObjs} +# Lib {StdLibOpts} -o "{Targ}" {SlotMgrObjs} diff --git a/OS/StartMgr/StartAlert.a b/OS/StartMgr/StartAlert.a index a48ba85..a2e6085 100644 --- a/OS/StartMgr/StartAlert.a +++ b/OS/StartMgr/StartAlert.a @@ -113,7 +113,7 @@ ; --------------------------------------------------------------------------- -; Routine AllocFakeRgns +; Routine AllocFakeRgns 4a50 ; Arguments ; Function Sets up a dummy vis and clip region for the system alert port ; --------------------------------------------------------------------------- @@ -142,7 +142,7 @@ FakeRgn DC.W 10 ;--------------------------------------------------------------------------- -; ClipBox sets the clipRegion (stored in GetParam) to the DS Alert rect. +; ClipBox 4a80 sets the clipRegion (stored in GetParam) to the DS Alert rect. ; Trashes A0 and A1. ;--------------------------------------------------------------------------- @@ -160,7 +160,7 @@ ClipBox LEA DSAlertRect+8,A0 ; point to our rect <16-Oct-85><1.3> ;--------------------------------------------------------------------------- -; Routine DSErrorHandler +; Routine DSErrorHandler 4a9e ; Arguments DSErrCode (input) System error value ; Function Creates temporary QD world on stack & uses the current Deep shit ; alert table (DSAT) to decide what to draw/do based on the system @@ -319,7 +319,7 @@ RTS2SysErr BSR OpenClip ; set clip back to full size ;--------------------------------------------------------------------------- -; FindObject takes the logical alert ID in D0 and scans through the +; FindObject 4b88 takes the logical alert ID in D0 and scans through the ; association until it finds an entry with the matching ID. It returns ; a pointer to the object body in A0, which is NIL if it couldn't ; find anything. The z-Flag will be set if we couldn't find it. @@ -344,7 +344,7 @@ FindObject MOVE.L D7,A0 ;point to DS data structure ;--------------------------------------------------------------------------- -; DrawText draws the deep shit text structure as specified by the ID in D0 +; DrawText 4ba4 draws the deep shit text structure as specified by the ID in D0 ;--------------------------------------------------------------------------- DrawText MOVE.W (A3)+,D0 ;get the text ID @@ -387,7 +387,7 @@ DrawText MOVE.W (A3)+,D0 ;get the text ID ;--------------------------------------------------------------------------- -; DrawBox draws a dialog-box-like-box or a deepshit-like-box +; DrawBox 4bdc draws a dialog-box-like-box or a deepshit-like-box ;--------------------------------------------------------------------------- DrawBox MOVE.L DSDrawProc,D0 ; is a custom dialog draw procedure specified? @@ -396,12 +396,29 @@ DrawBox MOVE.L DSDrawProc,D0 ; is a custom dialog draw procedure specified? BSET #7,DSDrawProc ; make it a one-shot RTS ; go to it -@StdProc LEA DSAlertRect,A0 ; pt A0 at rect +@StdProc MOVE D6,D0 + BSR.S FindObject + BEQ.S @old + + CMPI #12,-2(A0) + BLT.S @old + MOVE 10(A0),D0 + BSR.S FindObject + BEQ.S @old + + MOVE.L (A0)+,DSAlertRect + MOVE.L (A0),DSAlertRect+4 + PEA.L DSAlertRect + BSR NewAlertFunc + ADDQ #4,SP + +@old LEA DSAlertRect,A0 ; pt A0 at rect TST.B (A0) ; is this a system alert? (vs system error?) BPL.S DrawSysAlert ; yes, draw normal, do _MovePortTo ; we know it's a system error, so go stuff the rect w/what we need +; 4c1c DrawSysErr MOVEM.L A1/D1,-(SP) ; save registers. @@ -439,6 +456,7 @@ DrawSysErr MOVEM.L (SP)+,A1/D1 ; restore registers. RTS ; and return +; 4c6a DrawSysAlert BSR.S DrawBox2 ; draw it MOVE.L DSAlertRect,-(SP) ; push TL of rect @@ -447,6 +465,7 @@ DrawSysAlert ; use rect at (A0) +; 4c74 DrawBox2 MOVE.L A0, -(SP) ; rect for EraseRect MOVE.L A0, -(SP) ; rect for FrameRect MOVE.L A0, -(SP) ; rect for InsetRect @@ -465,6 +484,56 @@ DrawBox2 MOVE.L A0, -(SP) ; rect for EraseRect NoButtons RTS + + +NewAlertFunc + Link A6, #-$8 + MoveM.L A1-A3, -(A7) + MoveA.L $8(A6), A3 + Lea.L -$8(A6), A2 + MoveA.L (A5), A0 + Lea.L -$74(A0), A0 + Move.L (A0)+, (A2) + Move.L (A0), $4(A2) + SubQ #$2, A7 + Move (MBarHeight), (A7) + Move (A7)+, D0 + Add D0, (A2) + Move.L A3, -(A7) + Move $6(A2), D0 + Add $2(A2), D0 + AsR #$1, D0 + Move D0, -(A7) + Move $6(A3), D0 + Add $2(A3), D0 + AsR #$1, D0 + Sub D0, (A7) + Move (A2), D0 + Add $4(A2), D0 + AsR #$1, D0 + Move D0, -(A7) + Move (A3), D0 + Add $4(A3), D0 + AsR #$1, D0 + Sub D0, (A7) + _OffsetRect + Move (A3), D0 + Sub (A2), D0 + Ext.L D0 + Neg.L D0 + DivS #$3, D0 + Move.L A3, -(A7) + Clr -(A7) + Move D0, -(A7) + _OffsetRect + MoveM.L (A7)+, A1-A3 + Unlk A6 + Rts + + + + + ;--------------------------------------------------------------------------- ; DoButtons draws some buttons as specified by the buttonList data structure ; defined by the ID in D0, and then hit-tests the mouse position against @@ -683,6 +752,7 @@ CmdLoop MOVE.L SP,A0 ; Point to event record on stack _OffsetRect ; offset it BSR MBDoErase ; erase it + MOVE.B #$20,(A6) MOVE.W D3,-(SP) ; char width NEG.W (SP) ; negative movement CLR.W -(SP) ; delta V = 0 @@ -791,7 +861,7 @@ DMCmd MOVE.L #$007001B0,-(SP) ; push BR RTS ; and return Print6Hx SWAP D0 - BSR.S Print2Hx + BSR.S Print4Hx SWAP D0 Print4Hx MOVE.W D0,-(SP) diff --git a/OS/StartMgr/StartBoot.a b/OS/StartMgr/StartBoot.a index d3fa305..09fae57 100644 --- a/OS/StartMgr/StartBoot.a +++ b/OS/StartMgr/StartBoot.a @@ -294,10 +294,6 @@ BootMe PROC EXPORT EXPORT InitSys7Toolbox EXPORT OpenSlots - - BSR CheckForROMDisk ; Check if we would like to boot a ROM disk - TST.W D0 ; Did we find a bootable ROM disk? - BEQ.S @foundBootDisk ; If so then we've got startup device, now call BBs BSR FindStartupDevice ; Find the startup device & load boot blocks. ; (see StartSearch.a) @@ -350,7 +346,8 @@ MyExecMask EQU BBNewMask+BBExecMask CMP.B #MyExecMask,D1 ; Are these new executable boot blocks? BNE.S @NoExec ; If not, don't execute them -@ExecBB LEA MyIOPBA6(A6),A0 ; point to parameter block +@ExecBB BSR MessWithZones + LEA MyIOPBA6(A6),A0 ; point to parameter block MOVE.L A0,D7 ; set it where Boot blocks want it JSR BBEntry(A6) ; Execute the boot blocks @NoExec @@ -372,17 +369,13 @@ ReBoot move.w BootDrive,D3 ; Get current boot drive number MOVE.W #EjectCode,CSCode(A0) MOVE.W D3,IODrvNum(A0) ; d3 = BootDrive, must be a drive# here! _Control ; eject the bad diskette - BNE.S @DisableNextTime ; If not ejectable, don't try again move.b (sp)+,d0 ; restore DiskInPlace byte + tst -$3f0(a6) + bne.b @DisableNextTime cmpi.b #8,d0 ; were we ejectable? bge @DisableNextTime ; no, don't boot from this drive again -; ((( -------------------- Systems with HD20 -------------------- - CMP.W #$FFFE,BtDskRfN ; HD20's can pretend they're ejectable - BNE.S @1 ; Branch if it's not an HD20 -; ))) -------------------- Systems with HD20 -------------------- - @DisableNextTime MOVE.W BootMask,D0 BCLR D3,D0 @@ -400,6 +393,41 @@ ReBoot move.w BootDrive,D3 ; Get current boot drive number + + + +MessWithZones + MoveM.L D0/A0-A1, -(A7) + Move.L (ApplZone), D0 + Cmp.L (SysZone), D0 + BEQ.B (* + $4) + _InitApplZone + MoveA.L (SysZone), A0 + AddA.L #$A00000, A0 + MoveA.L A7, A1 + SubA.L (DefltStack), A1 + SubA.L #$40000, A1 + SubA.L #$64000, A1 + CmpA.L A0, A1 + BHI.B (* + $4) + MoveA.L A1, A0 + _SetApplBase + MoveA.L (SysZone), A0 + Move.L A0, (ApplZone) + Move.L A0, (TheZone) + Move.L (A0), (HeapEnd) + MoveA.L A7, A0 + SubA.L (DefltStack), A0 + SubA.L #$40000, A0 + _SetApplLimit + MoveM.L (A7)+, D0/A0-A1 + Rts + + + + + + ;________________________________________________________________________________________________ IF 0 THEN ; IMPORT IRQException ; @@ -508,239 +536,6 @@ getDiskInPlace ; find the drive queue element @done rts -;________________________________________________________________________________________________ -; CheckForROMDisk -; -; The following code supports the "Ginty" ROM disk architecture (System Disk in ROM). -; The idea is to pass control to the ROM disk so it can decide whether or not -; to boot from the ROM disk. If there is no ROM disk present or this particular machine -; does not support it then we continue as usual in the boot process. -; -; Input: nothing -; Output: D0.W = non-zero if no ROM disk was found or if one was it was non-bootable -; D0.W = zero means we found a bootable ROM disk. The code in the ROM disk -; already called FinderStartupDevice. -;________________________________________________________________________________________________ - -CheckForROMDisk - move.l UnivROMFlags,d0 ; get external features flag - btst.l #ProductInfo.SupportsROMDisk,d0 ; see if machine supports ROM disks? - beq.s @noROMDisk ; if not then just continue as usual - - bsr.s FindROMDisk ; check if we have a ROM disk - beq.s @foundROMDisk - - move.l UnivROMFlags,D0 ; get external feature flags - btst.l #ProductInfo.V8ChipBit,D0 ; are we on a VISA decoder machine? - beq.s @NoROMDisk ; if not then we're done -; -; ---- At this pt we need to check ROM space one more time but with the C/D slot bit XOR'ed in the ---- -; ---- Miscellaneous Setup Register ($50F26009), we need to do this because we cannot tell if we ---- -; ---- have a PDS/PCMCIA flash card installed or a ROM exp. SIMM. With this bit cleared no DSACK ---- -; ---- is generated by the ASIC and with it set DSACK is generated by the PDS card attached. ---- - - move.l #$50F26009,A0 ; Miscellaneous Setup Register in VIA2 space - bfchg (A0){4:1} ; complement the C/D bit field in setup register - bsr.s FindROMDisk ; check for bootable ROM disk - beq.s @foundROMDisk ; - - move.l #$50F26009,A0 ; Miscellaneous Setup Register in VIA2 space - bfchg (A0){4:1} ; set field back to original setting - bra.s @NoROMDisk ; -; -; At this point, A0 points to the beginning of the header for the RomDisk driver. -; (A0 gets set in routine FindROMDisk) -; -@foundROMDisk - with GintyHeader - - move.l HdrBootCode(A0),D0 ; get the offset to search routine - beq.s @NoROMDisk ; it's zero, so no search routine - adda.l HdrBootCode(A0),A0 ; point to search routine - jsr (A0) ; call the ROM Disk search/open routine - tst.w D0 ; see if it found the boot blocks - beq.s @FoundDevice ; ready to boot (A6 points to boot blocks) - -; ------------ If we get here, we didn't find a ROMDisk ------------ -; -@noROMDisk st d0 ; set d0 to TRUE to indicate no ROM disk -@FoundDevice - rts - - -;------------------------------------------------------------------------------------------------ -; Search through ROM looking for the special ROM disk header info. -; If found, check for boot blocks. Adapted from code in EDiskDrvr.a. -; -; Returns EQ if we found a ROM disk with boot blocks, NE if not. -; If ROM disk found then A0 contains a ptr to the ROM Disk header. -; -; Destroys D0,A0 - -FindROMDisk - movem.l d1/a2-a4,-(sp) ; save registers - - movea.l RomBase,a2 ; start searching at the base of ROM - move.l a2,d1 - addi.l #ROMSize,d1 ; end of ROM space to search -@RomDiskLoop - move.w sr,-(sp) ; save old interrupt mask - ori.w #HiIntMask,sr ; disable interrupts (stealing BusErrVct) - move.l BusErrVct,-(sp) ; save old bus error vector - lea @NotFound,a0 ; new handler address - move.l a0,BusErrVct ; setup bus error handler - movea.l sp,a4 ; mark the stack - - lea HeaderTemplate,a3 ; point to expected values - lea HdrBlockSize(a2),a0 ; point to header data - moveq.l #(HdrDeviceSize-HdrBlockSize)/4-1,d0 ; loop counter -@SigCmpLoop - cmpm.l (a0)+,(a3)+ ; compare the values - dbne d0,@SigCmpLoop ; compare the blocks -@NotFound - movea.l a4,sp ; pop stack in case of bus error - move.l (sp)+,BusErrVct ; restore bus error vector - move.w (sp)+,sr ; restore interrupt mask - addq.w #1,d0 ; see if we had a match - bne.s @NextBlock ; no, check next block - move.l a2,a0 ; save our position in ROM - moveq #0,d0 ; set cc to EQ - bra.s @Done ; return EQ -@NextBlock - adda.l #RomDiskAlign,a2 ; point to next block to check - move.l d1,a0 - cmpa.l a0,a2 ; see if end reached - blo.s @RomDiskLoop ; search the entire space - moveq #1,d0 ; set cc to NE -@Done - movem.l (sp)+,d1/a2-a4 ; restore registers - rts - - endwith ; GintyHeader - - - string asis ; no length on strings - align 2 -HeaderTemplate - dc.w 512 ; signature block size - dc.w 1 ; version number 1 - dc.b 'Ginty ' ; 12 byte signature - dc.b 'HYGWGA' ; (brought to you by et. al) - - -;______________________________________________________________________________________ -; All the 7.0 managers are installed here, the Gibbly calls us via a ROM vector at -; the start or the ROM. -; -; Sure would have been nice if each of these generic routines were commented when -; they were added.... (Sigh) Rewrote most of this code today . -; -;______________________________________________________________________________________ - -InitSys7Toolbox - _InitAllPacks ; Make sure the Packs are available at this time - - BSR.L NewGestaltSelectors ; - - ; Don't call ShutInit here since it blows away existing shutdown tasks - - BSR.L ALIASMGRINSTALL - - BSR.L SetupGlobals ; Comm Toolbox - BSR.L SetupGestalt ; - - BSR.L InitDialogMgrGlobals - BSR.L InitScrollSpeedGlobals ; scrollbar scrolling speed - BSR.L ExtBTreeInstall - BSR.L PPCINSTALL - BSR.L NMINIT - BSR.L InitValidateMenuBarSemaphore - BSR.L InitSystemMenuList - BSR.L MiscPatchesInstall - CLR.L -(SP) ; unused parameter for system builds - BSR.L __InitComponentManager - BSR.L ClearSysErrorUpdateRect ; ToolboxEventMgrPatches - BSR.L TSMgrInstall - BSR.L HelpMgrInstall - BSR.L ADDFONTSTOCHAIN ; FontFolder - - ; ADBSecondaryInitialization ; SAM (from here down...) - - BSR.L InitADBDrvr ; Another reinit - - - ; Display Manager - - IF hasDisplayMgr THEN ; <52> - SUBQ #2,A7 - _DMInstallDisplayManager ; Display Manager - ADDQ #2,A7 - ENDIF ; <52> - - ; SlotMgrSecondaryInitializationIIci - - 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 - BSR OpenSlots ; Open all slot drivers... - - ; ColorQDSecondaryInitialization - - 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 ; me too... - - ; SetUpIconCluts - - PEA ([ExpandMem],ExpandMemRec.emIconCluts) - JSR MakeIconData - - ; FontMgrSecondaryInitialization - - _InitFonts ; Reinit the font manager (in case a new one's just been loaded) - - ; File System Cache - - BSR AdjustBarrier ; Get the limit to bufPtr in A2 - BTST #extensionsEnabledBit,ExtensionsEnabledByte ; Have extensions been disabled? - BNE.S @normal ; -> No. Use the default limit - - MOVE.L BufPtr,d2 ; Extensions disabled. Limit the cache to 64k - SUB.L #$10000,d2 ; give the cache 64K - BRA.S @continue ; -> Join the common code - -@normal MOVE.L BootGlobals.bufPtrLimit(a5),d2 ; Get the current limit - ADD.L #elbowRoomCacheCantHave,d2 ; Reserve 32k or so to assure we can boot -@continue BSR.L CacheInstall ; Install the disk cache - ; - ; - BSR.L LateLoad ; Wait for SCSI devices present last time (that may not be ready yet) - ; Load their drivers if they come up to speed. - - ; VM Final Initialization - - ; 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. - - TST.L VMGlobals ; Has VM installed itself? - BMI.S @noVM ; -> No. No Memory Dispatch - -@hasVM MOVEQ #-1,D0 ; Finish VM initialization selector - _MemoryDispatch ; Call VM. - BRA.S @Done ; ->> Jump to end - -@noVM LEA AfterBootSetApplBase,A0 ; Patch _SetAppBase to call _InitZone before and after - MOVE.W #$A057,D0 ; it calls the real SetAppBase. Do this only if VM is - _SetTrapAddress ,NewOS ; not installed, or you'll look like a Cyclone. - -@Done RTS ; Return to boot3 (or Gibbly) - ; SAM (End of today's mods) -; ¥¥ End of InitSys7Toolbox ¥¥ -;______________________________________________________________________________________ - ;-------------------------------------------------------------------- ; Open all slot drivers which request to be opened at Start time. ; Destroys no registers. @@ -867,30 +662,20 @@ OpenBDrvrs MOVE.B spSlot(A0),-(SP) ;Save slot RTS -AdjustBarrier ; <38> -; Adjust BootGlobals.bufPtrLimit(a5) to have: -; MAX( sysHeap.bkLim + minProcessMgrSpace, static limits (i.e. boot globals & vm limits) ) +;______________________________________________________________________________________ +; All the 7.0 managers are installed here, the Gibbly calls us via a ROM vector at +; the start or the ROM. +; +; Sure would have been nice if each of these generic routines were commented when +; they were added.... (Sigh) Rewrote most of this code today . +; +;______________________________________________________________________________________ -; Trashes: a0/d0 +InitSys7Toolbox - move.l SysZone,a0 - move.l a0,d0 ; copy baseAddr of SysZone - move.l bkLim(a0),a0 - add.l #initialSysHeapSize,d0 - cmp.l d0,a0 ; if heap is small because weÕre on a small RAM machine - bhs.s @enoughReservedForSysHeap ; pretend heap is at initialSysHeapSize because it will - ; be that big soon anyway. - move.l d0,a0 ; Set to be the minimum weÕd ever consider. -@enoughReservedForSysHeap - add.l #minProcessMgrSpace,a0 ; where the process mgr heap would end if we - ; created it right now - cmp.l BootGlobals.bufPtrLimit(a5),a0 ; processMgrHeap.bkLim > current barrier? - bls.s @dont ; if not, donÕt adjust + RTS - move.l a0,BootGlobals.bufPtrLimit(a5) ; set new barrier -@dont - rts ENDP @@ -907,7 +692,7 @@ AdjustBarrier ; <38> ;------------------------------------------------------------------------------------------ CheckPassword PROC EXPORT - + MyStack RECORD 0,DECREMENT DialogRect DS.W 4 ItemRect DS.W 4 diff --git a/OS/StartMgr/StartErr.a b/OS/StartMgr/StartErr.a index 6b2588c..eb172e1 100644 --- a/OS/StartMgr/StartErr.a +++ b/OS/StartMgr/StartErr.a @@ -235,57 +235,6 @@ SysErrInit PROC EXPORT ; ENDP ; -;---------------------------------------------------------------------- -; Routine Debugger (Arg1, Arg2...ArgN, ParamSize, CmdWord) -; Arguments Highly variable -; Function Dispatch debugger call to current installed debugger, -; else ignore. (_Debugger trap) -;---------------------------------------------------------------------- - -Debugger PROC EXPORT ; - EXPORT DebugProlog ; - - MOVEM.L A0-A7/D0-D7,SEVars ; save all regs - - BSET #7,MacJmpFlag ; in the debugger - - LINK A6,#0 ; no locals - LEA 8(A6),A0 ; pt A0 at args - MOVE.W (A0)+,D0 ; get command word - MOVE.W (A0)+,SECmdSize ; stash size of param list - BSR.S DebugProlog ; set up call for debuggers, set CC=existence - BLE.S DebugErr ; V true, so either Z or (NOT N) means no inited debugger - -; Now we know there's a debugger, so call it. -; A0 = ptr to last command parameter, A1 = ptr to debugger entry pt. - - BSET #15,D0 ; set high bit of word to flag trap call - JSR (A1) ; call debugger!!!! - -DebugAdios UNLK A6 ; restore A6 - MOVEM.L SEVars,A0-A7/D0-D7 ; restore all regs - MOVE.L (SP)+,A0 ; get return address - ADD.W SECmdSize,SP ; pop params - ADDQ.L #4,SP ; pop command word & size word - BCLR #7,MacJmpFlag ; out of the debugger - JMP (A0) ; and return - - -DebugErr MOVEQ #SENoDB,D0 ; return "no debugger" error - BRA.S DebugAdios - -; Utility for setting CC's for existance of debugger, pointing A1 to debugger code entry. -; Must preserve D0. - -DebugProlog - MOVE.L MacJmp,A1 ; get ptr in A1 - MOVE.B MacJmpFlag,D3 ; get flags - ADD.B D3,D3 ; init flag now high bit, set CC's - RTS ; and return - - ENDP ; - - ;---------------------------------------------------------------------- ; Routine ToDeepShit ; Arguments (SP) (input) Return address to exception receiver @@ -320,23 +269,15 @@ ToDeepShit PROC EXPORT ; ; Now clear stack of exception info, saving SR and PC unless re-entered. A special case <13Jul85> ; is class 0 exception on the 68000, which has 4 words of info on top of the usual SR/PC. <13Jul85> - TST.B CPUFlag ; 0-000, 1-010, 2-020, etc. <13Jul85> - BNE.S @1 ; <13Jul85> - - CMPI.W #2,D0 ; 1 or 2 means nasty bus error frame <13Jul85> - BGT.S @1 ; <13Jul85> - MOVE.L (SP)+,SE000BE ; save fcn code, access address, and instruction word <04Nov85> JTC - MOVE.L (SP)+,SE000BE+4 ; ...the other 4 bytes of the eight <04Nov85> JTC -@1 - TST.B MacJmpFlag ; minus means we're re-entering <13Jul85> - BMI.S @3 ; <13Jul85> + TST.B $BFF + BMI.S @3 MOVE (SP)+,SESR ; SR on top for all CPUs <13Jul85> MOVE.L (SP)+,SEPC ; next is the saved PC <13Jul85> - BRA.S SysErr2 ; bypass nonsaving pop <13Jul85><1.4> + BRA SysErr2 ; bypass nonsaving pop <13Jul85><1.4> @3 ADDQ.W #6,SP ; kill SR and PC <13Jul85><1.4> - BRA.S SysErr2 + BRA SysErr2 NOP ; appease the assembler gods <12> kc ENDP ; @@ -396,8 +337,6 @@ SystemError PROC EXPORT ; SysErr1 MOVE.W SR,SESR ; save SR <13Jul85> MOVE.L (SP)+,SEPC ; clean PC for fall-through to SysErr2 <13Jul85> - TST.B CPUFlag ; zero for 68000 <02Nov85> JTC - BEQ.S SysErr2 ; no need for dummy frame on old cpu <02Nov85> JTC CLR.W -(SP) ; <02Nov85> JTC ; entry point for standard system exceptions (address error, etc) @@ -407,71 +346,9 @@ SysErr2 BMI.S @0 ; yes, skip reg saving MOVE.L SP,SEA7 ; save true PC @0 ; deleted obsolete stack-cleansing instructions <13Jul85> - BSET #7,MacJmpFlag ; prevent re-entrancy, vote Republican + BSET.B #7,MacJmpFlag ; prevent re-entrancy, vote Republican - cmpi.w #13,d0 ; was it an NMI? <1.5> - bne.w @continue ; no, proceed <1.5> - TestFor RBVExists ; <1.5> - beq.s @noRBV ; <1.5> - - btst.b #ProductInfo.PGCInstalled,UnivRomFlags+3 ; see if we have a PGC chip <9><4>
- beq.s @continue ; no, handle normal NMI-- there is no parity <4> - - move.l VIA,A0 ; get VIA1 base <1.5> - eieioSTP - btst #vPGCEnb,VBufB(a0) ; is parity enabled? <1.5> - eieioSTP - bne.s @continue ; no, proceed <1.5> - eieioSTP - bclr #vPGCErr,vDirB(a0) ; make parity error bit an input <1.5> - eieioSTP - move.b VBufB(a0),d1 ; read parity error flag <2.1> - eieioSTP - bset #vPGCErr,vDirB(a0) ; back to an output <1.5> - eieioSTP - btst #vPGCErr,d1 ; was NMI caused by parity error? <1.5> - bne.s @continue ; no, restore ddr and proceed <1.5> - eieioSTP - bset #vPGCEnb,VBufB(a0) ; yes, disable parity (so we won't get int again<1.5> - eieioSTP - bra.s @parityErr ; and blast the warm start flag -@noRBV - - WITH DecoderInfo - TestFor RPUExists ; do we have RPU parity? - beq.s @continue ; no, skip... - - movea.l OSS,a0 ; get OSS address - eieioSTP - move.w OSSIntStat(a0),d1 - eieioSTP - btst #OSSIntRPU,d1 ; did the RPU cause the interrupt? - beq.s @continue ; no, handle normal NMI - eieioSTP - clr.b OSSMskRPU(a0) ; disable RPU parity interrupts <2> - eieioSTP - movea.l UnivInfoPtr,a0 - adda.l ProductInfo.DecoderInfoPtr(a0),a0 - movea.l RPUAddr(a0),a0 ; get RPU base - st.b rpuReset(a0) ; reset serial ptr - move.l (a0),d1 - bset.l #16,d1 ; clear the parity error - move.l d1,(a0) -@parityErr - IF Supports24Bit THEN ; - moveq #true32B,d0 ; 32 bit mode to look at BootGlobs <1.9> - _SwapMMUMode ; switch to 32 bit mode <1.9> - move.l BootGlobPtr,a1 ; get ptr to boot globals (near top of RAM) <1.6><1.8> - clr.l StartGlobals.sgWarmStart(a1) ; CSS clear boot-globs warm start flag - _SwapMMUMode ; switch back to previous mode (in d0) <1.9> - ELSE - move.l BootGlobPtr,a1 ; get ptr to boot globals (near top of RAM) <1.6><1.8> - clr.l StartGlobals.sgWarmStart(a1) ; CSS clear boot-globs warm start flag - ENDIF - clr.l WarmStart ; clear low memory global warm start flag <1.6> - moveq #dsParityErr,d0 ; yes, set parity error code <1.5><1.7> -@continue ; <1.5> cmpi.w #dsNoPatch,d0 ; is this Error can't find patch ? rb beq.s @PreCubeE ; change the error message then rb cmpi.w #dsBadPatch,d0 ; is this a can't load patch message ? rb @@ -482,10 +359,10 @@ SysErr2 MOVE.W D0,DSErrCode ; Save the possibly modified ErrCode -; now we've set up all regs, etc. Time to decide whether to call the debuggers -; or just call the Deepshit code + MOVE.L MacJmp,A1 + MOVE.B MacJmpFlag,D3 + ADD.B D3,D3 - BSR DebugProlog ; any debuggers? BPL.S Call2DS ; yes, but not initialized (init bit not set) BNE.S CallDB ; yes, initialized, call 'em diff --git a/OS/StartMgr/StartFail.a b/OS/StartMgr/StartFail.a index b6ece62..b224d92 100644 --- a/OS/StartMgr/StartFail.a +++ b/OS/StartMgr/StartFail.a @@ -287,23 +287,12 @@ CritErr MOVEM.L A0-A7/D0-D7,SERegs ; save all regs for debug <26Aug85> LSR.L #2,D3 ; Compute number of longs on screen. - if hasMMU then ; <1.7> - MOVEQ #true32b,D0 ; set 32-bit addressing mode - _SwapMMUMode ; - MOVE.B D0,-(SP) ; save the previous mode - endif ; <1.7> - MOVEQ #-1,D0 ; This should be black. @FillLoop MOVE.L D0,(A2)+ ; Fill a long. SUBQ.L #1,D3 ; Countdown. BHI.S @FillLoop ; Loop until done. - if hasMMU then ; <1.7> - MOVE.B (SP)+,D0 ; get the previous addressing mode back - _SwapMMUMode ; flip back to previous addressing mode - endif ; <1.7> - ; Okay, here are the values we still consider important at this point: ; ; A3 = pointer to the center of the screen. @@ -343,7 +332,7 @@ CritErr MOVEM.L A0-A7/D0-D7,SERegs ; save all regs for debug <26Aug85> BSR6 DeadMac ; plot the dead Mac icon -SkipDisplay BigJmp TMRestart,a0 ; go to Test Manager entry point <1.4><2.0><2.1> +SkipDisplay BRA.S * TinyTable DC.W $0000,$FFFF,$FFFF,$FFFF ; whiteColor DC.W $0000,$0000,$0000,$0000 ; black @@ -370,13 +359,6 @@ TinyTable DC.W $0000,$FFFF,$FFFF,$FFFF ; whiteColor ;----------------------------------------------------------------------------- FailData - if hasMMU then ; <1.7> - MOVEQ #true32b,D1 ; put in D1 for a second - EXG D1,D0 ; get true32b in D0, save D0 in D1 - _SwapMMUMode ; switch to 32-bit addressing - MOVE.B D0,-(SP) ; save the previous addressing mode - EXG D1,D0 ; get D0 back in D0 - endif ; <1.7> FailLoop ROL.L #4,D0 ; get nibble in low order @@ -409,11 +391,6 @@ chLoop MOVE.B (A1),D5 ; get the next byte DBRA D4,FailLoop ; loop until all characters are drawn - if hasMMU then ; <1.7> - MOVE.B (SP)+,D0 ; get the old addressing mode back - _SwapMMUMode ; restore the addressing mode - endif ; <1.7> - JMP (A6) ; return to caller ;---------------------------------------------------------------------------- @@ -458,12 +435,6 @@ DeadMac LEA SadMacIcon,A0 ;point to the "Sad Mac" icon <1.3> MOVE.L IconTLAddr,A2 ; figure out where the topLeft corner is <1.3> - if hasMMU then ; <1.7> - MOVEQ #true32b,D0 ; flip to 32-bit mode - _SwapMMUMode ; switch to 32-bit addressing - MOVE.B D0,-(SP) ; save the previous mode - endif ; <1.7> - MOVEQ #6,D1 ; move the icon down 6 lines <1.9> MULU D2,D1 ; <1.9> ADDA.L D1,A2 ; <1.3><1.9> @@ -476,10 +447,6 @@ DeadMac ADDA.W D2,A2 ; move down to the next screen line <1.3><1.9> DBRA D1,@BlastIcon ; keep looping until all 32 lines are copied<1.3><1.9> - if hasMMU then ; <1.7> - MOVE.B (SP)+,D0 ; switch back to previous addressing mode - _SwapMMUMode ; flip back - endif ; <1.7> RTS6 ; return to caller <1.3> diff --git a/OS/StartMgr/StartInit.a b/OS/StartMgr/StartInit.a index 5d09482..f26ef8e 100644 --- a/OS/StartMgr/StartInit.a +++ b/OS/StartMgr/StartInit.a @@ -1145,15 +1145,15 @@ MyROM MAIN Export EXPORT InitDefGamma EXPORT InitSCC EXPORT OpensDrvr - EXPORT PMSPSwOS +; EXPORT PMSPSwOS EXPORT RomLoc EXPORT StartBoot EXPORT StartInit1 - EXPORT WDCBSwOS +; EXPORT WDCBSwOS EXPORT TCOff EXPORT SetUpTimeK ; - EXPORT DynamicBoxFlag +; EXPORT DynamicBoxFlag ************************************************************************************************* * * @@ -1216,63 +1216,23 @@ GOOFYDoEject BRA.L DoEject ; branch island to eject code + STRING AsIs + DC.L 'Copyright (c) 1983-2002 Apple Computer, Inc. All Rights Reserved.' + ************************************************************************************************* * * * R E S E T / R E B O O T E N T R Y P O I N T * * * ************************************************************************************************* +; b4 -TCOff dc.l 0 ; for turning off MMU below +TCOff dc.w 0 ; for turning off MMU below Start StartBoot MOVE #$2700,SR ; Disable processor interrupts. - IF NOT ROMinRAM THEN ; - sub.l d0,d0 ; D0 = 0 - bset #CACR_DE_040,d0 ; set Data Cache Enable bit on 040s - movec d0,CACR ; attempt to enable data cache (temporarily) - movec CACR,d0 ; check and see if it's still there - btst #CACR_DE_040,d0 ; see if the bit exists in CACR - beq.s @not040 ; IF we're on a 68040 THEN - - MACHINE MC68040 ; need this for the MOVEC D0,TC below - - cinva bc ; make sure caches are invalidated - sub.l d0,d0 ; clear d0 - movec d0,CACR ; disable both instruction and data caches - movec d0,TC ; make sure that the MMU is disabled - move.l #nuBusTTxlat,D0 ; get value to translate upper nuBus space - movec d0,DTT0 ; use serialized writes on this space - move.l #ioNuBusTTxlat,D0 ; get value to translate i/o and nuBus space - movec d0,DTT1 ; use serialized writes on this space - bra.s @not030 ; step around the rest of the 020/030 cache/tc stuff - - MACHINE MC68030 ; set it back to what works for 020/030 -@not040 ; ELSE - move.l #(1< ; <60>, check what WakeUp does, does it return here again after changing clock ? @@ -1284,13 +1244,20 @@ StartBoot MOVE #$2700,SR ; Disable processor interrupts. * H A R D W A R E I N I T I A L I Z A T I O N * * * ************************************************************************************************* - +; bc + BSR6 JumpIntoROM ; init the hardware - - IF hasPwrControls THEN ; If we're on a portable, - BigBSR6 PortableCheck ; check to see if we are coming out of sleep - ENDIF - BRA.L StartTest1 ; run new universal diagnostics + + + + move #$2600, sp + moveq #0, d7 + moveq #0, d6 + move #$11, d7 + + import LASTLY_A8FE0 + BSR6 LASTLY_A8FE0 + move.l (sp),a6 StartInit1 ; Jumped to from StartTest1. ;----- @@ -1323,6 +1290,7 @@ StartInit1 ; Jumped to from StartTest1. ; ; On 68000 machines, exception vectors set up by the diagnostics are in RAM at address zero. ;----- +; de WITH StartGlobals @@ -1348,6 +1316,7 @@ getHInfo move.l a6,-(sp) ; save regs ; d2 - Bits 15..8, BoxFlag info (possibly unknown) ; d2 - Bits 7..0, Address Decoder Kind (zero if unknown) ;----- +; 108 BSR6 InitVIAs,a2 ; initialize the VIAs and RBV @@ -1358,22 +1327,18 @@ getHInfo move.l a6,-(sp) ; save regs ;---------------------------------------------------------------- ; Get logical: set up RAM, address translation tables ;---------------------------------------------------------------- +; 11a bsr ConfigureRam ; set up RAM, move sp to middle of 1st bank ;---------------------------------------------------------------- ; D7 <- CPU type in low word, logic board type in hi word ;---------------------------------------------------------------- +; 11e BSR WhichCPU ; get CPU type in low word of d7 bsr WhichBoard ; get logic board type in hi word of d7 - btst.l #hwCbMMU+16,d2 ; HwCfgFlags in high word of d2 - bne.s @hasMMU ; yes, InitMMU - ; no, InitNonMMU - bsr InitNonMMU ; init a4,a5,a6 for non MMU based machines - bra.s @done - -@hasMMU bsr.l InitMMU ; generate MMU tables, enable MMU + bsr.l InitMMU ; generate MMU tables, enable MMU ; returns a4 -> BootGlobs move.l sgTotalRAM(a4),a6 ; get top of memory @@ -1403,6 +1368,7 @@ getHInfo move.l a6,-(sp) ; save regs ; sp - in the middle of the useable logical space ; ;----- +; 136 MOVEM.L sgScratch(A4),D3-D6 ; get the extended Universal info ENDWITH ; {StartGlobals} @@ -1421,7 +1387,7 @@ getHInfo move.l a6,-(sp) ; save regs LEA HeapStart,A1 ; A1 <- pointer to end of system globals. BSR FillWithOnes ; Fill system globals with ones. - BSR InitRomVectors ; initialize ROM vectorization + BSR.L InitRomVectors ; initialize ROM vectorization MOVEM.L (SP)+,D0-D6/A0-A1 ; restore Universal info @@ -1439,8 +1405,6 @@ getHInfo move.l a6,-(sp) ; save regs MOVE.B D7,CpuFlag ; save type of CPU we have swap d7 ; - - bsr DynamicBoxFlag ; Calculate the Boxflag based on Family type and CPU speed @StoreBox move.b d7,BoxFlag ; ... and save it in lomem @@ -1448,149 +1412,17 @@ getHInfo move.l a6,-(sp) ; save regs MOVE.L A5,BufPtr ; save the top of useable memory MOVE.L A6,MemTop ; and the top of available memory - ; Here, we check to see if a special bit is set on PRAM, which tells us rb, start - ; that the user want's his ROM to run from RAM for a slightly faster machine. - ; We copy the ROM image into RAM and then re-initialize vectorization with the new RAM/ROM. - - IMPORT PramIO - - MOVEM.L D0-D6/A0-A4,-(SP) ; save Universal info - CLR.W -(SP) ; make buffer space in stack for PRAM data - MOVE.L SP,A3 ; set buffer pointer - MOVE.L #(0<<31)|\ ; read PRAM command - (1<<16)|\ ; 1 byte please - (11<<0),D3 ; from address X - BSR.L PramIO ; read PRAM - MOVE.W (SP)+,D0 ; get the byte read from PRAM - ANDI.W #$0100,D0 ; let's see if bit 1 was set in our byte - BEQ.W NoROMinRAM ; if bit is clear, don't use RAM for the ROM - - LEA BaseOfRom,A0 ; set source address - MOVE.L A0,ROMBase ; save in ROMBase since it's not setup yet - MOVE.L $40(A0),D3 ; get the ROM size in D3 - SUBA.L D3,A5 ; Subtract the ROM size from BufPtr - MOVE.L A5,D0 ; let's make sure A5 is aligned - ANDI.L #$0000000F,D0 ; mask up to 15 bytes of mis-alignement - SUBA.L D0,A5 ; and adjust A5 for 16 byte alignment - MOVE.L A5,BufPtr ; and set the new BufPtr - MOVE.L A5,A1 ; set Destination address - - MOVE.L D3,D0 ; set count - MOVEQ.L #16,D2 ; set copy amount per loop (16 for non 040) - CMPI.B #cpu68040,CPUFlag ; are we in an 040 ? - BNE.S @CopyLongs ; if not, then copy longs only - MOVEQ.L #32,D2 ; set copy amount per loop - BRA.S @Copy16 ; do the copy thing, based on BlockMove040 - NOP ; no warnings please - - ALIGN 16 ; align with a cache line - MACHINE MC68040 ; for move 16 -@Copy16 - MOVE16 (A0)+,(A1)+ ; copy 16 bytes - SUB.L D2,D0 ; decrement our count by 32 bytes - MOVE16 (A0)+,(A1)+ ; copy another 16... - BHI.S @Copy16 ; and keep copying until we have 2 Meg - -@JumpIntoRAM - LEA InRAM,A0 ; get our address in RAM (almost) - MOVE.L ROMBase,D5 ; save old ROMBase in D5 rb - SUBA.L ROMBase,A0 ; get rid of the ROM offset - MOVE.L BufPtr,A5 ; get BufPtr (ROMBase soon) in a5 - MOVE.L A5,ROMBase ; set the new ROM base - ADDA.L A0,A5 ; add offset to InRAM routine - JMP (A5) ; and go there ! - NOP ; fill me in - -@CopyLongs - MOVE.L (A0)+,(A1)+ ; copy 4 bytes - MOVE.L (A0)+,(A1)+ ; copy 8 bytes - MOVE.L (A0)+,(A1)+ ; copy 12 bytes - MOVE.L (A0)+,(A1)+ ; copy 16 bytes - SUB.L D2,D0 ; decrement our count by 16 bytes - BHI.S @CopyLongs ; and copy more if nessesary - BRA.S @JumpIntoRAM ; now jump into RAM - NOP ; just for the fun of it. - - ALIGN 16 - -InRAM - BSR InitROMVectors ; re - initialize vectorization with new ROM addr - ; Now that the ROM vectors have been re-initialized from RAM, the actual table entries still rb, start - ; point to ROM since these were created at compile time. So now we need to adjust every entry - ; in the RAM copy of the tables so that it points to its RAM equivalent. From then on - ; InitROMVectors can be called and the RAM table entries will be used, as expected. - - MOVE.L #$2010,D0 ; get start address for ROM vector adjustments - SUB.L ROMBase,D5 ; adjust our saved ROMBase, D5 is now the difference -@WalkList - MOVE.L D0,A0 ; get vector address in a0 - MOVE.L (A0),D1 ; get the table address - CMPI.L #-1,D1 ; is it an empty table ? - BEQ.S @NextTable ; if so, try the next table - - MOVE.L D1,A1 ; get the table address in a1 - MOVE.L (A1),A2 ; get decription table in a2 - MOVE.L 8(A2),D3 ; get vector count for this table in D3 - -@AdjustEntry - SUB.L D5,(A1)+ ; adjust this entry so it points in the RAM copy of ROM - DBRA D3,@AdjustEntry ; fix all entries in this table - -@NextTable - ADDI.L #4,D0 ; add offset to next vector address - CMPI.L #$2104,D0 ; have we reached the current limit ? - BNE.S @WalkList ; if not the limit, keep looking - - SUB.L D5,UnivInfoPtr ; adjust the info record so int handlers are in RAM rb - -NoROMinRAM ; rb, end - MOVEM.L (SP)+,D0-D6/A0-A4 ; restore Universal info - ; DONE, WE ARE RUNNING FROM A RAM COPY OF ROM rb, end move.l UnivInfoPtr,a1 ; reload a1 in case the info record was adjusted in RAM rb bsr SetupHWBases ; setup the hardware base address low mems BSR InitSCC ; init the SCC - move.w d2,-(sp) ; save D2 around this call - BSR InitIWM - move.w (sp)+,d2 ; restore D2 - - IF NOT hasAsyncSCSI THEN ; we do HW init later with new SCSI Manager - bsr.l InitSCSIHw ; - ENDIF - - BSR.L InitSndHW ; go initialize the sound hardware - bsr.l InitMMUGlobals ; set up MMU globals BSR6 SysErrInit ; Init exception vectors. clr.l DockingGlobals ; flag for EnableExtCache to know traps don't exist - IF has040MMU THEN ; rb - cmpi.b #cpu68040,CPUFlag ; check if we're running on an 040/050 - bne.s @notAn040 ; IF we are running on an 040/050 THEN - BSR.L InstallFPSP ; Initialize 040/050 FP emulation package -@notAn040 ; ENDIF - ENDIF ; rb - - -;---------------------------------------------------------------- -; Enable Caches, if any. -;---------------------------------------------------------------- - -; turn on Bursting for Instruction and Data cache before TimeDBRA and TimeSCCDB - - IF forRomulator THEN - Moveq.l #$0,D0 ; Set up to disable the caches if weÕre debugging. - ELSE - cmp.b #cpu68040,CpuFlag ; check if we're on an 040 - bne.s @not040 ; NO ... enable 020/030 cache(s) - - move.l #(1< rb, end 1< rb, end * all Universal variables (i.e., UnivInfoPtr, UnivROMFlags, AddrMapFlags, etc) * * * ************************************************************************************************* +; 1ce BootRetry MOVE #$2700,SR ; disable interrupts @@ -1643,7 +1475,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts MOVE.L A0,SP ; Set the stack pointer there SUBA.W #BootStackSize,A0 ; Give ourselves some stack space - BSET.B #MMStartMode,MMFlags ; set for 32 bit system heap _SetApplLimit ; Don't let the System Heap crash our stack BSR.L InitMemoryDispatch ; go set up the MemoryDispatch globals @@ -1658,15 +1489,18 @@ BootRetry MOVE #$2700,SR ; disable interrupts Move.l #emRecSize,(a0) ; size ENDWITH ; + IMPORT InterC_1cc0_MoveUnivInfoToSysHeap + BSR.L InterC_1cc0_MoveUnivInfoToSysHeap + BSR.L initGestalt ; initialize Gestalt + BSR.L FiddleWithEmulator BSR.L InitIntHandler ; initialize interrupt vectors and dispatch tables - BSR.L InstallPrivTrap ; setup FPPriv if there's an FPU - - BSR.L InitPmgrVars ; initialize Power Manager variables if on a portable - ; (otherwise disable all of its traps) BSR CheckForEgretOrCuda ; Do we have an Egret/Caboose/Cuda? BNE.S @EInitDone ; -> Nope, don't be callin' shit BSR.L InitEgretOrCuda ; Initialize Egret or Cuda Manager + + IMPORT GestaltCudaFunc + BSR.L GestaltCudaFunc @EInitDone @@ -1678,19 +1512,67 @@ BootRetry MOVE #$2700,SR ; disable interrupts * able to take off as if we were a generic Macintosh. * * * ************************************************************************************************* +; 244 - - BSR InitSwitcherTable ; initialize Switcher's table (do we still need this?) - - BSR GetPRAM ; get 20 bytes PRAM, and TIME - BSR SetPRAM32 ; Always set PRAM to 32bit BSR.L InitRSRCMgr ; initialize the Resource Manager BSR.L NMInit ; Initialize the Notification Manager - BSR.L InitTimeMgr ; Initialize the Time Manager CLR.W -(SP) ; pass the INIT message to ShutDown _ShutDown ; to initialize the queue + IMPORT EXPANSIONBUSMGR_452D0 + BSR.L EXPANSIONBUSMGR_452D0 + +;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ SAM +; Install Code Fragment Mangaer (GoNative) +;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ +; 25a + + CASE ON + IMPORT GoNative + BSR.L GoNative ; Load all those NCODs! + CASE OFF + BPL.S @noPower ; -> No errors. Keep booting SAM + + MOVE.W #dsGNLoadFail,D0 ; Fatal GoNative load error. + _SysError ; Put up a dialog and die. +@noPower + +; 268 + IMPORT InterC_1690_CodeRegister + BSR.L InterC_1690_CodeRegister + + IMPORT InterC_15c0_CodePrepare2 + BSR.L InterC_15c0_CodePrepare2 + + IMPORT EXPANSIONBUSMGRFIRSTFUNC + BSR.L EXPANSIONBUSMGRFIRSTFUNC + + BSR.L CompBootStackOld ; lifted from SetUpSysAppZone + MOVE.L A0,SP + SUBA.W #BootStackSize,A0 + _SetApplLimit + + IMPORT InterC_2560 + BSR InterC_2560 + + + CLR.L -(SP) ; who wrote this? + MOVE.L (SP)+, ($D18) + MOVE.L ToolScratch, -(SP) + LEA.L SetUpTimeK, A0 + MOVE.L A0, ToolScratch + + IMPORT InterC_2090_PowerMgr + BSR InterC_2090_PowerMgr + + IMPORT InterC_2a80_EtherPrintfLib + BSR.L InterC_2a80_EtherPrintfLib + MOVE.L (SP)+, ToolScratch + + + BSR GetPRAM ; get 20 bytes PRAM, and TIME + BSR InitSlots ; inits slot cards, grays the screen(s) BSR.L InitDTQueue ; initialize the Deferred Task Manager Queue @@ -1704,79 +1586,71 @@ BootRetry MOVE #$2700,SR ; disable interrupts MOVE #$2000,SR ; supervisor state, interrupts on -;------------------------------------------------------------------------ -; Gestalt must now be initialized before IO drivers RLM -;------------------------------------------------------------------------ + IMPORT RSETKMAP + BSR.L RSETKMAP - BSR.L initGestalt ; initialize Gestalt + IMPORT InterC_2bc0_DebugPrint + BSR.L InterC_2bc0_DebugPrint - moveq #10,D0 - _NewHandle ,Sys,Clear ; Get space for a Heap utilities list - move.l A0,D0 ; Did we get it? - beq.s @noHU ; -> Nope - move.l D0,$1E0C ; Stuff it in the magic location -@noHU - - Cmpi.b #cpu68040,CPUFlag ; Are we less than an 040? - Blo.s @no040BM ; Yes? Then use original BlockMove. - Move.w #$A02E,D0 ; BlockMove trap. - BigLea BlockMove68040,A0 ; New routine. - _SetTrapAddress ; Set new routine. -@no040BM - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ SAM -; Install Code Fragment Mangaer (GoNative) -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ - - MOVE.L #gestaltSysArchitecture,d0 ; Are we running on a PowerPC machine? SAM - _Gestalt - BNE.S @NoPower ; Error, assume 68k - CMP.W #gestaltPowerPC,A0 ; PowerPC? - BNE.S @NoPower ; -> Nope, assume 68k - - CASE ON - IMPORT GoNative - BSR.L GoNative ; Load all those NCODs! - CASE OFF - BPL.S @noPower ; -> No errors. Keep booting SAM - - MOVE.W #dsGNLoadFail,D0 ; Fatal GoNative load error. - _SysError ; Put up a dialog and die. -@noPower - -;---------------------------------------------------------------- -; Install Drivers (Disk, Sound, Video). -;---------------------------------------------------------------- - - LEA DrvQHdr, A1 ; Initialize the drive queue. - BSR.L InitQueue - - BSR InitIOPStuff ; - BSR InitDeviceMgr ; Init unit I/O table and install the drivers. - BSR LoadDrivers ; load the standard drivers - - BSR.L InitSCSIMgr ; Init old and new SCSI Mgrs + MOVEQ.L #10, D0 + _NewHandle ,Sys,Immed + MOVE.L A0, D0 + BEQ.B @fail + MOVE.L D0, $1E0C +@fail BSR.L INSTALLBASSCOMMON ; Init Bass before anyone calls _InitFonts (like _InitGraf) BSR.L FORCEINITFONTSCALL ; More Bass init stuff + BSR InitCrsrMgrMiddle BSR.L InitCrsrDev ; initialize Cursor globals ; (InitCrsrDev must preceed InitADB) + + SUBQ #2, SP + MOVEQ.L #-1, D0 + _DisplayDispatch + ADDQ #2, SP + +;---------------------------------------------------------------- +; Install Drivers (Disk, Sound, Video). +;---------------------------------------------------------------- +; 300 + + LEA DrvQHdr, A1 ; Initialize the drive queue. + BSR.L InitQueue + + BSR InitDeviceMgr ; Init unit I/O table and install the drivers. + + IMPORT InitDeviceDispatch + BSR.L InitDeviceDispatch + + BTST.B #$6, ($2400) + BNE.B @definitely + BTst.B #$0, ($DD0) + BEQ.B @dont +@definitely + + BSR NewStartInitFunc + BSR.L InitSCSIMgr ; Init old and new SCSI Mgrs +@dont + + IMPORT InitExpansionMgr + BSR.L InitExpansionMgr + + IMPORT InterC_1980_Drivers + BSR.L InterC_1980_Drivers + + BSR LoadDrivers ; load the standard drivers + BSR.L InitADB ; initialize ADB interface + import InterC_1910_USBFamilyExpertLib + bsr.l InterC_1910_USBFamilyExpertLib + BSR InitCrsrMgr ; Initialize cursor variables -;---------------------------------------------------------------- -; Initialize Reliability Manager -;---------------------------------------------------------------- - - BSR.L InitReliability ; initialize the Reliability Manager - - BSR CheckForEgretOrCuda ; call check routine - BNE.S @NoEgret ; Egret not installed - BSR.L EgretDFACandPDM ; install additional Egret features -@NoEgret - BSR CheckForResetPRAM ; see if PRAM needs to be nuked + IMPORT InitBCScreen + BSR.L InitBCScreen BSR.L TEGlobalInit ; initialize TextEdit vectors @@ -1791,6 +1665,7 @@ BootRetry MOVE #$2700,SR ; disable interrupts ; for the sake of its internal side-effects. After the call, ApplZone, HeapEnd, and HiHeapMark ; must be reset. ApplLimit is set to BufPtr-DefltStack, which is fine for boot time. ;---------------------------------------------------------------- +; 35a MOVE.L SysZone,A0 ; Point to System Heap MOVE.L bkLim(A0),A0 ; Point to end of System Heap @@ -1813,36 +1688,23 @@ BootRetry MOVE #$2700,SR ; disable interrupts BSR DrawBeepScreen ; Horst BeepmanhÕs patented gray screen -; On machines with Civic, check to see if we want to boot off the composite out - - TestFor CivicExists - Beq.s @NoCivic ; don't do it for Non-Civic Based cpu's - bsr CheckForTV ; see if we need to set the "Drive CompOut Flag" -@NoCivic - MOVE.L #WmStConst,WarmStart ; write warm start constant to indicate warm start MOVEA.L BootGlobPtr,A0 ; point to bootGlobals move.l #WmStConst,StartGlobals.sgWarmStart(A0) ; flag warm start in a ; place where StarTest can see it w/o an MMU -;---------------------------------------------------------------- -; Initialize the Sound Manager -;---------------------------------------------------------------- - MOVEM.L A0-A2/A6/D0-D2,-(SP) ; save our important Address - case obj - import InitSoundMgr - bsr.l InitSoundMgr - case off - MOVEM.L (SP)+,A0-A2/A6/D0-D2 ; restore our important Address + import InterC_2780_FireWire + bsr.l InterC_2780_FireWire ;---------------------------------------------------------------- ; Initialize the File System. ;---------------------------------------------------------------- +; 3b0 MOVE #40,D0 ; Inital number of file control blocks _InitFS @@ -1850,20 +1712,33 @@ BootRetry MOVE #$2700,SR ; disable interrupts ;---------------------------------------------------------------- ; <65>, Other Terror changes... ;---------------------------------------------------------------- +; 3b6 - BSR.L SetupDockBases ; initialize docking bar base addresses

-* BSR.L SCSIDiskMode ; check if we should be in SCSI Disk Mode + BTST #$1, $2409 + BEQ.B @dont_do_mysterious_thing + IMPORT LoadPCCardLib + BSR.L LoadPCCardLib +@dont_do_mysterious_thing + + IMPORT InterC_2a20_SCSITargetMode + BSR.L InterC_2a20_SCSITargetMode + + BTst.B #5, $2408 + BEQ.B @nodiskmode + BSR.L SCSIDiskMode ; check if we should be in SCSI Disk Mode +@nodiskmode - IF hasAsyncSCSI THEN ; \/ - BSR.L ISITT ; check if we're running SCSI 4.3 - TST.B D0 ; are we? - BEQ.S @noAsyncSCSI ; -> no, don't don't initialize for new - ; style boot. BSR.L INITSCSIBOOT ; allocate some memory for SCSI booting ; and load third party SIMs (SCSI Interface ; modules -@noAsyncSCSI - ENDIF ; /\ + + IMPORT ATAMgr_5dae0 + BSR.L ATAMgr_5dae0 + IMPORT ATAMgr_5dde0 + BSR.L ATAMgr_5dde0 + + IMPORT InterC_2130_CardBus + BSR InterC_2130_CardBus ************************************************************************************************* @@ -1885,7 +1760,7 @@ BootRetry MOVE #$2700,SR ; disable interrupts ;________________________________________________________________________________________ ; -; Routine: WhichCPU +; Routine: WhichCPU 3f2 ; ; Inputs: none ; @@ -1956,60 +1831,12 @@ WhichCPU MACHINE MC68020 moveq.l #2,d7 ; setup index to see if index scaling works - jmp @CheckIndexScale-2(d7.w*2) ; decide if scaling works - -@CheckIndexScale - bra.s @NoIndexScale ; 68000/68010 don't have index scaling - -@HasIndexScale ; 68020/68030/68040 do have index scaling - sub.l d7,d7 ; D7 = 0 (testing for 040) - - bset #CACR_DE_040,d7 ; set DE (data cache enable) in CACR - movec d7,CACR ; enable data cache - movec CACR,d7 ; IF CACR != 0 THEN we're on an 040 - bclr #CACR_DE_040,d7 ; see if the bit exists in CACR - movec d7,CACR ; put it back in cache reg - beq.s @notAn040 ; NO ... check for 020/030 - - MACHINE MC68040 ; YES ... needed to execute a 040 CINVA inst. - - cinva bc ; invalidate both caches, dont push data from d-cache - ; NOTE - I-cache is still enabled here - moveq #cpu68040,d7 ; return that we're running on an 040 - rts - - MACHINE MC68020 -@notAn040 - move.w #(1<>1,d7 ; setup to shift in ccr.x - addx.l d7,d7 ; d7 := 2 if 68020, d7 := 3 if 68030 rts ; all done -@NoIndexScale ; 68000/68010 don't have index scaling - move.l sp,d7 ; mark the stack - clr.w -(sp) ; fake a 68010 exception format word - bsr.s @doRTE ; push a return address, sr, and RTE back - exg.l d7,sp ; restore the stack - sub.l sp,d7 ; d7 := -2 if 68000, d7 := 0 if 68010 - addq.l #2,d7 ; d7 := 0 if 68000, d7 := 2 if 68010 - lsr.l #1,d7 ; d7 := 0 if 68000, d7 := 1 if 68010 - rts ; all done - -@doRTE move.w sr,-(sp) ; push the SR to complete exception frame - rte ; pop the exception frame and return - - SETMACHINE - ;________________________________________________________________________________________ ; -; Routine: WhichBoard +; Routine: WhichBoard 3f6 ; ; Inputs: D7.B- CPU type ; @@ -2029,7 +1856,7 @@ WhichBoard swap d7 ; get CPU type in hi word ;________________________________________________________________________________________ ; -; Routine: SetUpTimeK +; Routine: SetUpTimeK 402 ; ; Inputs: D7.B- CPU type ; @@ -2048,62 +1875,57 @@ WhichBoard swap d7 ; get CPU type in hi word ;________________________________________________________________________________________ SetUpTimeK - cmpi.b #cpu68040,CPUFlag ; check if running on one of those nasty 040s - blt.s @doIt + MoveM.L D1-D2/A1-A4, -(A7) + Move SR, -(A7) + OrI #$700, SR + Move.L ($64), -(A7) + BTst.B #$6, ($2400) + BNE.B L8 + BTst.B #$1, ($2400) + BNE L12 + Bra L13 +L8: MoveQ.L #$0, D0 + Move ([$68FFEFD0.L],$80), D0 -; If we are 040'ish, check if the Cache Switch has requested to disable processor -; caches. The Cache Switch CDEV sets PRAM location $8A bit 7 if caches will be -; disabled. We are taking the initiative here and THIS is the place we will turn -; OFF caches for the duration. We want to make sure that we do this BEFORE we -; calculate the timing values, as they will change depending on whether caches are -; on or off. + MoveM.L D0-D2/A0, -(A7) + MoveA.L ([$68FFEFD0.L],$18), A0 - movem.l d0-d3/a0-a3,-(sp) ; save registers before mucking around - move.l UnivInfoPtr,a1 ; retrieve ProductInfo record pointer - move.l a1,a2 ; leave A1 alone - call the routine with A2 - move.l a1,a0 ; leave A1 alone - get pointer in A0 for call - adda.l ProductInfo.ClockPRAMPtr(a2),a2; get pointer to primitives table - move.l 4*cpXPRAMIO(a2),d0 ; get the offset to the routine - beq.s @restore ; if no trap-less routine, then run with caches ON - add.l ProductInfo.DecoderInfoPtr(a1),a0; required for the PramIO call - adda.l d0,a2 ; form trapless _ReadXPram subroutine address - clr.w -(sp) ; make room on the stack - movea.l sp,a3 ; set up for call to _ReadXPRam - move.l UnivROMFlags,d1 ; D1, A0, A1, A3 need to set for StandardXPramIO - move.l #$0001008A,d3 ; 1 byte at $8A - jsr (a2) ; dont have traps yet. go there directly - move.w (sp)+,d0 ; get the byte - tst.w d0 ; check if top bit is set - bpl.s @restore ; top bit not set - run with caches on + Tst.L A0 + BNE.B L10 + MoveA.L ([$68FFEFF0.L],$100), A0 - MACHINE MC68040 - CPUSHA BC ; make sure return addresses make it to memory - MACHINE MC68020 + Move.L #$80000000, D1 + CmpI.L #$1F, D0 + BGT.B L9 + ROR.L D0, D1 + Or.L D1, $14(A0) + Nop + Bra L11 +L9: SubI.L #$20, D0 + ROR.L D0, D1 + Or.L D1, $4(A0) + Nop + Bra L11 +L10: AddA.L #$10000, A0 + LsL.L #$5, D0 + Move.L $0(A0,D0.W), D1 + BClr.L #$7, D1 + Move.L D1, $0(A0,D0.W) + Nop +L11: MoveM.L (A7)+, D0-D2/A0 + Bra.B L13 +L12: MoveA.L ($DD8), A0 + AddA.L (A0), A0 + MoveA.L $E4(A0), A0 + OrI.L #$400, $24(A0) - moveq.l #0,d0 - movec d0,CACR ; turn OFF all caches -@restore - movem.l (sp)+,d0-d3/a0-a3 ; restore registers after mucking around -@doit - move.l AutoInt1,-(sp) ; Save current auto interrupt vector. - move.w sr,-(sp) ; Save current interrupt level. - ori.w #HiIntMask,sr ; disable interrupts - - TestFor GrandCentralExists ; Do we have a Grand Central - beq.b @viaIntsEnabled ; Nope, so carry on - movea.l UnivInfoPtr,a0 ; Get the GC base address from - adda.l ProductInfo.DecoderInfoPtr(a0),a0 ; the universal info - movea.l DecoderInfo.GrandCentralAddr(a0),a0 ; and then - ori.l #1< CompletedInts+1 +@dont + tst.w (a4) ; see if any more routines to time bne.s @nextRoutine ; time all routines in the table eieioSTP move.b #(0< ; -; VIATime, in the IIci/IIfx/TERROR/HORROR ROMs, lives at 40x008BC. +; VIATime 5ca, in the IIci/IIfx/TERROR/HORROR ROMs, lives at 40x008BC. ; -------- ; This means that the @loop btst.b #0,(A0) is at 40x008C8, and the dbra d0,@loop ; is at 40x008CC. This code, "half cache-line aligned, when run on an 040 and above, will execute @@ -2252,7 +2097,7 @@ VIATime ;________________________________________________________________________________________ ; -; Routine: JmpTblInit, JmpTbl2 +; Routine: JmpTblInit 5e0, JmpTbl2 5e2 ; ; Inputs: A0 - pointer to table of routine word offsets (A0-relative) ; A1 - pointer to destination jump table in RAM @@ -2277,7 +2122,7 @@ JmpTbl2 MOVEQ #0,D2 ; clear high part for arithmetic ;________________________________________________________________________________________ ; -; Routine: FillWithOnes +; Routine: FillWithOnes 5f0 ; ; Inputs: A0 - pointer to starting RAM location (must be longword aligned) ; A1 - pointer to ending RAM location (must be longword aligned) @@ -2300,7 +2145,7 @@ FillWithOnes ;________________________________________________________________________________________ ; -; Routine: CompBootStack +; Routine: CompBootStack 5fa ; ; Inputs: none ; @@ -2312,19 +2157,26 @@ FillWithOnes ;________________________________________________________________________________________ CompBootStack + btst #$06,$240B + beq.s CompBootStackOld + move.l #$007EFFE0,A0 ; 8 M - 64 K - 32 b + rts + +CompBootStackOld move.l BufPtr,d0 ; get top useable memory move.l sysZone,a0 ; get start system heap sub.l a0,d0 ; get (top useable - sys heap start) lsr.l #1,d0 ; divide by two - andi.w #$FFFE,d0 ; force it to be even - add.l d0,a0 ; get sys heap + (top - sysHeap)/2 - suba.w #BootGlobalsSize,a0 ; leave room for QuickDraw stuff. + add.l a0,d0 ; get sys heap + (top - sysHeap)/2 + sub.w #BootGlobalsSize,d0 ; leave room for QuickDraw stuff. + andi.w #$FFF0,d0 ; force it to be even + move.l d0,a0 rts ;________________________________________________________________________________________ ; -; Routine: ConfigureRAM +; Routine: ConfigureRAM 624 ; ; Inputs: D2.B- address decoder kind (from Universal) ; A0 - pointer to machine's DecoderInfo table (from Universal) @@ -2391,7 +2243,7 @@ ConfigureRAM ;________________________________________________________________________________________ ; -; Routine: SetUpSysAppZone +; Routine: SetUpSysAppZone 674 ; ; Inputs: none ; Outputs: none @@ -2406,17 +2258,6 @@ ConfigureRAM SetUpSysAppZone lea SysHeap,a0 ; point at normal system heap template - move.b MMFlags,-(sp) ; save the memory Manager flag - btst.b #MMSysHeap,MMFlags ; check type of System Heap - beq.s @do24 ; IF we want a 32 bit heap - bset.b #MMStartMode,MMFlags ; set for 32 bit system heap - btst.b #mmHighSysHeap,MMFlags ; check for the 'black hole' - beq.s @knowHeap ; IF we have 'black hole' between lowmem & sysHeap - lea SysHoleHeap,a0 ; get addr 'black hole' zone template - bra.s @knowHeap ; ENDIF -@do24 bclr.b #MMStartMode,MMFlags ; set for 24 bit system heap -@knowHeap ; ENDIF - _InitZone ; set up initial system heap Move.L theZone,SysZone ; save pointer to the new zone Move.L SysZone,RamBase ; setup RamBase to system heap @@ -2435,193 +2276,40 @@ SetUpSysAppZone MOVE.L SP,A0 ; Use the current sp when itÕs lower @3 SUBA.W #BootStackSize,A0 ; Give ourselves some stack space _SetApplLimit ; Don't let the System Heap crash our stack - MOVE.B (SP)+,MMFlags ; restore memory manager flag - - _MoreMasters ; Create 768 master pointers at the bottom of SAM - _MoreMasters ; the heap. This is approximately the number of - _MoreMasters ; relocatable objects in the system heap for - _MoreMasters ; System 7.1 and a set of standard inits. - _MoreMasters ; (We need 6 calls to MoreMasters to get 768 of them. - ; _InitZone will create one block of "4*dfltMasters" - RTS ; MPs for us.) + + +; _MoreMasters ; Create 768 master pointers at the bottom of SAM +; _MoreMasters ; the heap. This is approximately the number of +; _MoreMasters ; relocatable objects in the system heap for +; _MoreMasters ; System 7.1 and a set of standard inits. +; _MoreMasters ; (We need 6 calls to MoreMasters to get 768 of them. +; ; _InitZone will create one block of "4*dfltMasters" +; RTS ; MPs for us.) + + move.l d3,-(sp) + moveq.l #2,d3 +@trap_blk + _MoreMasters + _MoreMasters + _MoreMasters + _MoreMasters + _MoreMasters + _MoreMasters + _MoreMasters + _MoreMasters + dbf d3,@trap_blk + move.l (sp)+,d3 + rts SysHeap DC.L HeapStart DC.L HeapStart+SysZoneSize DC.W 4*dfltMasters ; Master Pointer allocation size = 128 (MPs) DC.L 0 -SysHoleHeap dc.l HoleSysHeap ; start address - dc.l HoleSysHeap+SysZoneSize ; size - dc.w 2*dfltMasters ; # master ptrs - dc.l 0 ; no growzone proc - ;________________________________________________________________________________________ ; -; Routine: CheckForResetPRAM -; -; Inputs: none -; Outputs: none -; Trashes: D0, A0, A1 -; -; Function: if the cmd-option-R-P keys are down, it resets PRAM and then reboots the machine -; -; If the byte 76 contains a value of 2 in it then some of the PRAM information will be saved. -; If the value is any other value (0,1,3) then the value will be set to zero. -; The information which is saved is: -; all PassWord information (address/size) -; 04/04 PSWD -; 0E/02 pswd checksum and flags -; AB/03 PSWD -; All AUX information 40/06 A/UX -; Sensitive Boot Parms 76/01 Reserved for StartMgr -; Default OS Type 77/01 Default OS -; Default Boot Device 78/04 Default Boot Device -;________________________________________________________________________________________ - -CheckForResetPRAM - -ck4rpRegs REG D1-D2 - -; hi-byte == size, lo-byte == address -PSWDPRAM equ $00040004 ; 4 bytes at password location $04 -PSWDChkFlg equ $0002000E ; 2 bytes at password location $0E ($0E = Checksum, $0F = Flags) -AUXPRAM equ $00060040 ; 6 bytes at A/UX location $40 -OSTypePRAM equ $00020076 ; 2 bytes at Default OS $76 ($76 = reserved/save PRAM or not, $77 = Default OS) -ClearPRAM equ $00010076 ; 1 byte at reserved byte (used if value is 1 or 3) -DefBoot equ $00040078 ; 4 bytes at Default Boot Device $78 -PSWDspace equ $000400AB ; 4 bytes at password location $AB (only use 3, but I alocate 4 on the stack) -PSWDmore equ $000300AB ; the actual 3 bytes which I use at location $AB - - movem.l ck4rpRegs, -(sp) ; \/ \/ \/ - - bsr Ck4LimitPRAMClear ; supposed to allow bypassing security with reset? - sne D2 ; D2=true if limit clear - ; /\ /\ /\ - lea @Keys,a1 ; keys to check for - lea KeyMap,a0 ; compare to the Key Down Map - moveq.l #4-1,d0 ; compare loop count -@loop cmpm.l (a0)+,(a1)+ ; check for exactly this combo - dbne d0,@loop ; examine the entire key map - bne.s @noMatch ; if not equal, don't reset PRAM - - tst.b D2 - beq.s @normNuke - bra.s @savesome -@noMatch - movem.l (sp)+, ck4rpRegs - rts ; otherwise, just return - - -; \/ \/ \/ \/ Save security-related items (mainly for AIX) thru next - -@savesome - subq.w #PSWDPRAM>>16,sp ; allocate buffer on stack - movea.l sp,a0 ; get buffer ptr - move.l #PSWDPRAM,d0 ; get #, addr PRAM bytes - _ReadXPram ; read the PSWD info - - subq.w #PSWDChkFlg>>16,sp ; - movea.l sp,a0 ; - move.l #PSWDChkFlg,d0 ; - _ReadXPram ; read the PSWD checksum & Flags - - subq.w #PSWDspace>>16,sp ; - movea.l sp,a0 ; - move.l #PSWDmore,d0 ; - _ReadXPram ; read the PSWD info - - subq.w #AUXPRAM>>16,sp ; - movea.l sp,a0 ; - move.l #AUXPRAM,d0 ; - _ReadXPram ; read the AUX info - - subq.w #OSTypePRAM>>16,sp ; - movea.l sp,a0 ; - move.l #OSTypePRAM,d0 ; - _ReadXPram ; read the Default OS - - subq.w #DefBoot>>16,sp ; - movea.l sp,a0 ; - move.l #DefBoot,d0 ; - _ReadXPram ; read the Default Boot Device - -; /\ /\ /\ /\ from prev - -@normNuke subq.w #RelPram>>16,sp ; - movea.l sp,a0 ; - move.l #RelPram,d0 ; - _ReadXPram ; read the reliability MGR info - - ; kill signatures in extended and old PRAM so that InitUtil writes default values out - - movea.l a1,a0 ; point to table data - move.l (a0)+,d0 ; get PRAM len/addr, point to data - _WriteXPRam ; kill the extended PRAM signature - lea SysParam,a0 ; standard PRAM buffer address - moveq.l #-1,d0 ; mask/data to write - move.b d0,(a0) ; kill the signature in the buffer - _WriteParam ; write the buffer to PRAM - - _InitUtil ; Init PRAM - - movea.l sp,a0 ; - move.l #RelPram,d0 ; - _WriteXPram ; restore the reliability MGR info - adda.w #RelPram>>16,sp ; clean up the stack - - tst.b D2 ; flag set telling us not to clear everything? - beq.s @normNuke3 ; no-> don't restore them (we didn't save them earlier) - -; \/ \/ \/ \/ Restore security-related items thru next - - movea.l sp,a0 ; get buffer ptr - move.l #DefBoot,d0 ; get #, addr PRAM bytes - _WriteXPram ; restore the Default Boot Device - adda.w #DefBoot>>16,sp ; clean up the stack - - movea.l sp,a0 ; - move.l #OSTypePRAM,d0 ; - _WriteXPram ; restore the Default clean of OS - adda.w #OSTypePRAM>>16,sp ; - - movea.l sp,a0 ; - move.l #AUXPRAM,d0 ; - _WriteXPram ; restore the AUX info - adda.w #AUXPRAM>>16,sp ; - - movea.l sp,a0 ; - move.l #PSWDmore,d0 ; - _WriteXPram ; restore the PSWD info - adda.w #PSWDspace>>16,sp ; - - movea.l sp,a0 ; - move.l #PSWDChkFlg,d0 ; - _WriteXPram ; restore the PSWD Checksum & Flags - adda.w #PSWDChkFlg>>16,sp ; - - movea.l sp,a0 ; - move.l #PSWDPRAM,d0 ; - _WriteXPram ; restore the PSWD info - adda.w #PSWDPRAM>>16,sp ; - -; /\ /\ /\ /\ from prev - -@normNuke3 bra Start ; re-boot the machine - - -@Keys dc.l $00800000 ; R - dc.l $08008004 ; P, Cmd, Opt - dc.l $00000000 - dc.l $00000000 - - dc.l $0004000C ; XPRAM signature len/addr - dc.l 'Gone' ; invalidate XPRam signature with this - - -;________________________________________________________________________________________ -; -; Routine: GetPRAM +; Routine: GetPRAM 6ce ; ; Inputs: none ; Outputs: none @@ -2665,54 +2353,6 @@ GetPRAM _InitUtil ; seed low memory PRAM buffer RTS -;________________________________________________________________________________________ -; -; Routine: SetPRAM32 -; -; Inputs: none -; Outputs: none -; Trashes: none -; -; Function: force Memory Manager start mode to 32-bit mode -;________________________________________________________________________________________ - -SetPRAM32 movem.l a0/d0,-(sp) ; save a0 and d0 - subq.l #4,sp ; create space on stack - move.l sp,a0 ; get pointer to useful buffer - - MOVE.L #$1008a,d0 ; Command to read 1 byte at addr 8a - _ReadXPRam ; - - move.l sp,a0 ; get pointer to useful buffer - ori.b #5,(a0) ; set PRAM to 32 bit mode - MOVE.L #$1008a,d0 ; Command to write 4 bytes at addr 8a - _WriteXPRam ; - addq.l #4,sp ; dispose space on stack - movem.l (sp)+,a0/d0 ; restore a0/d0 - rts - -;________________________________________________________________________________________ -; -; Routine: InitNonMMU -; -; Inputs: A6 - pointer to memory table in high memory -; -; Outputs: A4 - points to memory table -; A5 - points to top of useable RAM -; A6 - points to top of total RAM -; -; Trashes: none -; -; Function: sets up A4, A5, A6 for non-MMU based machines and points jSwapMMU to an RTS. -;________________________________________________________________________________________ - -InitNonMMU move.l a6,a4 ; get ptr to memory table - move.l (a4),a6 - add.l 4(a4),a6 ; calculate top of all memory - move.l a6,a5 ; top useable memory = top all memory - rts - - ************************************************************************************************* * * @@ -2723,7 +2363,7 @@ InitNonMMU move.l a6,a4 ; get ptr to memory table ;________________________________________________________________________________________ ; -; Routine: InitHiMemGlobals +; Routine: InitHiMemGlobals 70c ; ; Inputs: none ; Outputs: none @@ -2753,7 +2393,7 @@ InitHiMemGlobals ;________________________________________________________________________________________ ; -; Routine: InitGlobalVars +; Routine: InitGlobalVars 73c ; ; Inputs: none ; Outputs: none @@ -2804,18 +2444,7 @@ InitGlobalVars ; jump table. ; Move.l ROMBase,A0 ; Get ROMBase - TestFor ASCExists ; Do we really have an ASC? - Beq.s @noASC ; -> No. Set SoundBase = ROMBase - Move.l ASCBase, A0 ; We do have an ASC. Get its base from universal -@noASC Move.l A0,SoundBase ; Set up SoundBase - - IF ROMinRAM THEN - CMPI.L #$40800000,SoundBase ; if running from RAM, Set sound base to ROM rb - BHI.S @BaseOK ; if SoundBase points to higher than 40800000 rb - MOVE.L #$40800000,SoundBase ; is ok, otherwise point to real ROM rb -@BaseOK ; rb - ENDIF ;-------------------------------------- LEA VBLQueue,A1 @@ -2870,7 +2499,7 @@ InitGlobalVars ;________________________________________________________________________________________ ; -; Routine: InitCrsrVars +; Routine: InitCrsrVars 81e ; ; Inputs: none ; Outputs: none @@ -2890,7 +2519,7 @@ InitCrsrVars ;________________________________________________________________________________________ ; -; Routine: InitCrsrMgr +; Routine: InitCrsrMgr 82e ; ; Inputs: none ; Outputs: none @@ -2938,6 +2567,11 @@ InitCrsrMgr MOVE.L #$000F000F,D0 move.l (a1)+,(a0)+ ; move the bytes in move.l (a1),(a0) + RTS + +MouseBytes dc.b 4,10,15,255,255,83,77,72 + +InitCrsrMgrMiddle LEA GrafEnd,A1 ; end of cursor globals BigLea CrsrDevHandleVBL,A0 ; install cursor VBL task MOVE.L A0,-(A1) ; JCrsrTask @@ -2962,119 +2596,12 @@ InitCrsrMgr MOVE.L #$000F000F,D0 MOVE.W D0,CrsrNew ; flag cursor as changed, turn on tracking MOVE.L D0,MouseMask ; No jerkiness with $FFFFFFFF mask - IF forTNTDebug THEN -; set up a Time Manager task to call jVBLTask - -initDummyVBL - moveq.l #tmXQSize, d0 ; allocate a block in the system heap - _NewPtr ,SYS,CLEAR ; to hold the Time Manager task structure - lea dummyVBL, a1 - move.l a1, tmAddr(a0) - move.l #'eada', (a0) ; identify queue type to VM - _InsXTime - move.l #-16626, d0 - move.l jPrimeTime, a1 - jmp (a1) - - RTS - -dummyVBL - movea.l a1, a0 - move.l #-16626,d0 ; 60.15 Hz - movea.l jPrimeTime, a1 - move.l jCrsrTask,-(sp) ; return address from PrimeTime to CrsrTask - jmp (a1) ; restart time manager task - ENDIF - - RTS - -MouseBytes dc.b 4,10,15,255,255,83,77,72 - - -;________________________________________________________________________________________ -; -; Routine: InitSwitcherTable -; -; Inputs: none -; Outputs: none -; Trashes: A0,A1 -; -; Function: Installs a table telling Switcher what low memory locations to save/restore -; between applications in addition to the Switcher's own table (but always -; including the dispatch table). The Switcher's table: -; -; $100: $02 bytes (monkey lives) -; $108: $14 bytes (MemTop, BufPtr, StkLowPt, HeapEnd, TheZone) -; $130: $04 bytes (ApplLimit) -; $15C: $04 bytes (SEvtEnb, DSWndUpdate, FontFlag, IntFlag) -; $2AA: $04 bytes (ApplZone) -; $31E: $22 bytes (MinStack, DefltStack, mmDefFlags, GZRootHnd, GZRootPtr, -; GZMoveHnd, DSDrawProc, EjectNotify, IAZNotify). -; $800: $2FC bytes (ToolBox globals) -; -; Table defining our additional switchables -; -; Format is: -; address (word), byte count (word) ; save bytecount bytes at address -; . -; . -; 0 (longword) ; terminates list -;________________________________________________________________________________________ - -OurSwitch DC.W OSTable, 4*numOStrap ; OS dispatch table - DC.W ToolTable, 4*numTBtrap ; Toolbox dispatch table - DC.W $0B80, $26 ; new switchables - DC.W $0BAE, $52 ; new switchables - DC.W HFSFlags, 2 ; TFS flags (PMSP status) & Cache flags - DC.W DefVRefNum, 2 ; Default VRefNum/WDRefNum - DC.W DefVCBPtr, 4 - DC.W ScrDmpEnb, 2 - DC.W CurDirStore,4 - DC.W MBProcHndl, 4 - - DC.W $0100, $0002 ; SysCom//MonkeyLives - DC.W $0108, $0014 ; memtop,bufptr,stklowpt,etc. - DC.W $015C, $0004 ; SEvtEnb,DSWndUpdate,FontFlag,IntFlag - DC.W $031E, $0022 ; MinStack,DefltSTack,mmDefFlags,etc. - DC.W $0800, $02FC ; toolbox globals,etc. - DC.W ApplLimit, $0004 - DC.W ApplZone, $0004 - DC.W AuxWinHead, $0004 - DC.W AuxCtlHead, $0004 - DC.W BNMQHd, $0004 - DC.W MenuCInfo, $0004 - DC.W MenuDisable,$0008 - DC.W theGDevice, $0004 - -WDCBSwitch DC.W 0,0,0 ; WDCB table -PMSPSwitch DC.W 0,0,SPHdrSize-2 ; PMSP hook - DC.W 0,0 ; terminate with a long of zeroes -SwitchLen EQU *-OurSwitch - -;---------------------------------------------------------------- -; These constant values are stored in ROM rather than defined as EQUs for -; use at compile time simply because we have a brain-damaged (c.f. Jobs on HP) -; development system. -;---------------------------------------------------------------- -WDCBSwOS DC.W WDCBSwitch-OurSwitch -PMSPSwOS DC.W PMSPSwitch-OurSwitch - - -InitSwitcherTable - MOVEQ #SwitchLen,D0 ; allocate a switcher table in - _NewPtr ,SYS,CLEAR ; the system heap - MOVE.L A0,A1 ; make it the destination - LEA OurSwitch,A0 ; template table - MOVEQ #SwitchLen,D0 ; copy it - needs to be updated with - _BlockMove ; WDCBSwitch, PMSPSwitch later - - MOVE.L A1,SwitcherTPtr ; Set the pointer up for Switcher RTS ;________________________________________________________________________________________ ; -; Routine: SetupHWBases +; Routine: SetupHWBases 8be ; ; Inputs: none ; Outputs: none @@ -3121,7 +2648,9 @@ SetupHWBases lsl.w #2,d3 ; setup index into bases table move.l (4*64,a0,d3.w),(a3) ; initialize the low mem bra.s @loop ; go on to next low mem - + + + @BaseInitTable dc.w VIA1Exists,VIA ; init VIA1 base address dc.w SCCRdExists,SCCRd ; init SCC read base address @@ -3181,6 +2710,11 @@ SetupMiscSCSI bra.s @SCSIHskDone @80based ENDIF + + + btst.b #6, ($2400) + bne.b @SCSIHskDone + btst.l #SCSIDackExists,d0 ; see if we have SCSI Dack bne.s @SCSIDackDone ; if we do, it's setup ok move.l SCSIHsk,SCSIDMA ; if not, use hsk instead @@ -3200,7 +2734,7 @@ SetupMiscSCSI ;________________________________________________________________________________________ ; -; Routine: InitSlots +; Routine: InitSlots 992 ; ; Inputs: none ; Outputs: none @@ -3224,38 +2758,7 @@ InitSlots BSR.L InitSDTbl ; init slot int dispatch table ;________________________________________________________________________________________ ; -; Routine: InitIOPStuff -; -; Inputs: none -; Outputs: none -; Trashes: ??? -; -; Function: initializes the I/O system by building the Unit Table and issuing initialization -; calls to all the component drivers. -;________________________________________________________________________________________ - -InitIOPStuff - IF IopADB | hasIopScc | hasIopSwim THEN - BSR.L InitIOPMgr ; fire up the IOP manager - IF hasIopSWIM THEN - TestFor SWIMIOPExists ; see if we have a SWIM IOP - beq.s @noSwimIOP ; if not, skip it - BSR.L EnableSwimIOPInts ; Enable SWIM IOP interrupts -@noSwimIOP - ENDIF - IF hasIopScc THEN - TestFor SCCIOPExists ; see if we have a SCC IOP - beq.s @noSCCIOP ; if not, skip it - BSR.L SCCIOPBypass -@noSCCIOP - ENDIF - ENDIF - rts - - -;________________________________________________________________________________________ -; -; Routine: InitDeviceMgr +; Routine: InitDeviceMgr 9b0 ; ; Inputs: none ; Outputs: none @@ -3269,7 +2772,7 @@ InitDeviceMgr ; Compute the size of the unit table and allocate it. MOVEQ #UnitEntries,D0 ; get number of entries in unit table MOVE.W D0,UnitNtryCnt ; save for IOCore checking - MOVE.L #MaxUTEntries*4,D0 ; reserve more memory so table can grow + MOVE.L #MaxUTEntries*2,D0 ; reserve more memory so table can grow _NewPtr ,SYS,CLEAR ; allocate it and zero out the memory MOVE.L A0,UTableBase ; and save its address @@ -3278,7 +2781,7 @@ InitDeviceMgr ; Compute the size of the unit table and allocate it. ;________________________________________________________________________________________ ; -; Routine: LoadDrivers +; Routine: LoadDrivers 9c4 ; ; Inputs: none ; Outputs: none @@ -3295,55 +2798,6 @@ LoadDrivers MOVE.L SP,A0 CLR.B IOPermssn(A0) ; r/w permissions - IF hasNewAge THEN - TestFor NewAgeExists ; do we have a NewAge? - Beq.S @NoNewAge ; no ? then try old floppy - - move.l SP,A0 ; iopb on stack - clr.b IOPermssn(A0) ; clear r/w permissions - lea NewAgeName,a1 ; get new age driver name - move.l a1,IOFileName(a0) ; set it up - _Open ; and open the driver -@NoNewAge - ENDIF - - TestFor IWMExists ; do we have an IWM or SWIM? - IF hasIopSwim THEN - BNE.S @OpenSony ; -> yes, open the driver - TestFor SWIMIOPExists ; how about an IOP-based version? - ENDIF - - IF hasSwim3 THEN - BNE.S @OpenSony ; -> yes, open the driver - TestFor SWIM3Exists ; how about a SWIM3 based version? - ENDIF - BEQ.S @NoFloppy ; -> nope, no floppy controller - -@OpenSony - MOVE.L SP,A0 ; iopb on the stack - CLR.B IOPermssn(A0) ; r/w permissions - LEA DiskName,A1 - MOVE.L A1,IOFileName(A0) - _Open ;OPEN Floppy disk driver - -; -;ÑÑÑÑÑÑÑÑÑ NetBoot Driver ÑÑÑÑÑÑÑÑÑ -; -@NoFloppy - IF hasNetBoot THEN - SUBQ.W #4,SP - MOVE.L #'DRVR',-(SP) ; resource type - PEA NetBootName ; resource name - _GetNamedResource ; try to get the handle to the .netBoot driver - TST.L (SP)+ ; does the driver exist? - BEQ.S @NoNetBoot ; -> no, try don't open it - - LEA NetBootName, A1 - MOVE.W #49,D2 ; and resource ID - BSR InstallDriver ; go install the driver -@NoNetBoot - ENDIF - ; ;ÑÑÑÑÑÑÑÑÑ RAM Disk Driver ÑÑÑÑÑÑÑÑÑ ; @@ -3351,42 +2805,78 @@ LoadDrivers ; to enable the EDisk, make sure that it is included in the rom resources IF hasEDisk THEN - LEA EDiskName,A1 - MOVE.W #48,D2 ; and resource ID + LEA.L EDiskName,A1 + MOVEQ.L #$30,D2 ; and resource ID BSR InstallDriver ; go install the driver ENDIF - IF NOT forTNTDebug THEN -; -;ÑÑÑÑÑÑÑÑÑ Sound Driver ÑÑÑÑÑÑÑÑÑ -; - IF hasDSP THEN - TestFor DSPExists ; If we have a DSP, we assume we're doing sound through it. - BNE.s @DoneSoundDriver ; if we have a Cyclone/DSP then don't load sound driver - ENDIF - MOVE.L SP,A0 ; iopb on the stack - CLR.B IOPermssn(A0) ; r/w permissions - LEA SndName,A1 - MOVE.L A1,IOFileName(A0) - _Open ; OPEN sound driver -@DoneSoundDriver - ENDIF +; +;ÑÑÑÑÑÑÑÑÑ LAN Disk Driver ÑÑÑÑÑÑÑÑÑ +; - MOVE.L SP,A0 ; iopb on the stack - CLR.B IOPermssn(A0) ; r/w permissions - BSR FROVideo ; open the default video driver and setup video globals - LEA IOQElSize(SP),SP ; deallocate parameter block for device manager calls. + IMPORT InterC_1890_InitLANDisk + BSR InterC_1890_InitLANDisk + + +; +;ÑÑÑÑÑÑÑÑÑ BCScreen Driver ÑÑÑÑÑÑÑÑÑ +; + + + IF hasBCScreen THEN + + SubQ.L #$2, sp + Move.L sp, -(sp) + Move.L #$3FF, -(sp) + Move.L #$36, -(sp) + Clr.L -(sp) + Pea.L BCScreenName + Move.L #$FFFFBF7D, -(sp) + + IMPORT Interstix208c_1 + BSR.L Interstix208c_1 + + dc.w $defc, $001a + ;AddA #$1A, A7 + + ENDIF + + +; +;ÑÑÑÑÑÑÑÑÑ Backlight Driver ÑÑÑÑÑÑÑÑÑ +; IF hasPwrControls THEN - TestFor hwCbPwrMgr ; <61>, is this a Power Mgr mac ? - beq.s @noBacklight ; <61>, if not, skip - LEA BacklightName,A1 ; get the backlight driver's name + BTst.B #$0, (HWCfgFlags) + BEQ.B @noBacklight + BTst.B #$6, ($2409) + BNE.B @noBacklight + Move.L #'only', -(A7) + LEA.L BacklightName,A1 ; get the backlight driver's name MOVE.W #-16511,D2 ; and resource ID BSR InstallDriver ; go install the driver + AddQ #$4, A7 @noBacklight - ENDIF + MoveA.L A7, A0 + Clr.B $1B(A0) + Bsr (* + $128) + Lea.L $32(A7), A7 + BTst.B #$6, ($2409) + BEQ.B @skipALine + import InterC_1f40_Backlight + Bsr.L InterC_1f40_Backlight +@skipALine + + BTst.B #$3, ($DD3) + BEQ @exitDrivers + ENDIF + + + + + ; ;ÑÑÑÑÑÑÑÑÑ Serial Drivers ÑÑÑÑÑÑÑÑÑ @@ -3398,21 +2888,30 @@ LoadDrivers ; table, remaining closed and inactive until opened by a client. subq #4,sp ; allocate space for return value - move.l #'SERD',-(sp) ; push serial driver resource type - - TestFor SerialDMA - bne.b @SerialDMA - clr.w -(sp) ; classic serial driver is 'SERD' (0) - bra.b @CallSERD -@SerialDMA move.w #1,-(sp) ; SerialDMA driver is 'SERD' (1) - -@CallSERD move.w #mapTrue,ROMMapInsert ; get resource from ROM + move.l #'nsrd',-(sp) ; push serial driver resource type + move.w #1,-(sp) ; SerialDMA driver is 'SERD' (1) + move.w #mapTrue,ROMMapInsert ; get resource from ROM _GetResource move.l (sp)+,d0 ; did it get the handle? beq.b @exitDrivers - movea.l d0,a0 - movea.l (a0),a0 - jsr (a0) ; call the install code + movea.l d0,a2 + movea.l (a2),a1 + SubQ #$4, A7 + Move.L A2, -(A7) + dc.w $a9a5 ; _SizeResource + Move.L (A7)+, D1 + Move.L D1, D0 + dc.w $A440 ; _ResrvMemSys + Move.L D1, D0 + _NewHandle ,Sys + Move.L A0, D0 + BEQ.B (* + $E) + _HLock + Move.L D1, D0 + MoveA.L (A0), A1 + MoveA.L (A2), A0 + _BlockMove + jsr (a1) ; call the install code @exitDrivers rts @@ -3420,8 +2919,6 @@ LoadDrivers STRING PASCAL -DiskName DC.W '.Sony' - SndName DC.W '.Sound' ; IF hasEDisk THEN @@ -3439,6 +2936,13 @@ BacklightName DC.W '.Backlight' ENDIF + + IF hasBCScreen THEN +BCScreenName + DC.W '.BCScreen' + ENDIF + + STRING ASIS @@ -3451,7 +2955,7 @@ BacklightName ;________________________________________________________________________________________ ; -; Routine: DrawBeepScreen +; Routine: DrawBeepScreen ab0 ; ; Inputs: A5 - pointer to QuickDraw globals in boot globals space ; @@ -3480,11 +2984,24 @@ DrawBeepScreen ; of the menu bar (because the screen background is white on LCD screens vs black on CRTs) BSR.L LCDScreenChk ; is this an LCD screen ? - BEQ.S @DoNormalBeepScreen ; -> no, do the normal stuff + BEQ.B @DoNormalBeepScreen ; -> no, do the normal stuff - PEA ScreenBits+bounds(A2) ; screen rectangle - PEA gray(A2) ; fill pattern - _FillRect ; fill the screen with 50% gray + Clr.B ($B3E) + Pea.L -$74(A2) + Clr.B -(A7) + Jsr (* + $204A) + Tst.B (A7)+ + BNE.B (* + $8) + Pea.L -$18(A2) + Bra.B (* + $14) + MoveA.L ($2b6), A0 + ST.B $341(A0) + Pea.L (* + $62) + _RGBForeColor + Pea.L -$10(A2) + _FillRect + MoveQ.L #$5, D0 + DC.W $ABE0 RTS @DoNormalBeepScreen ENDIF ; @@ -3510,15 +3027,23 @@ DrawBeepScreen _PenNormal ; restore the pen - MOVE.L #$00100010, -(SP) ; rounding factor - PEA gray(A2) ; fill pattern - _FillRoundRect ; fill the screen with 50% gray + Pea.L (* + $24) + _RGBForeColor + Move.L #$100010, -(A7) + Pea.L -$10(A2) + Bra.B (* + $C) + DC.L $2F3C0010 ; '/< ' + DC.L $0010486A ; ' Hj' + DC.W $FFE8 ; ' ' + _FillRoundRect + MoveQ.L #$5, D0 + DC.W $ABE0 RTS ;________________________________________________________________________________________ ; -; Routine: FROVideo +; Routine: FROVideo b54 ; ; Inputs: A0 - pointer to ioParamBlock ; @@ -3529,6 +3054,8 @@ DrawBeepScreen ; Function: finds, reads parameters for, and opens the driver for a video sRsrc ;________________________________________________________________________________________ + DC.W $8888, $8888, $8888 + WITH spBlock,seBlock,vpBlock FROVideo MOVE.L A0,A1 ; save the param block pointer for _Open @@ -3536,8 +3063,33 @@ FROVideo MOVE.L A0,A1 ; save the param block pointer for _Open LINK A6,#-spBlockSize ; allocate space for a slot parameter block MOVE.L SP,A0 ; and point to it - BSR.S OpnVidDeflt ; open the default video device, set video params - BEQ.S @End ; -> got it + BTST.B #6, ($240B) + BEQ.B @TryDefault + + MoveM.L D0-D7/A0-A4, -(A7) + Move.L ($1FB8), -(A7) + MoveA.L ($2b6), A3 + MoveA.L $1E0(A3), A3 + Move.L $C(A3), -(A7) + Lea.L (* + $28A), A2 + Move.L A2, ($1FB8) + Move.L A2, $C(A3) + SubQ #$2, A7 + Clr.L -(A7) + Move #$2EB, D0 + _DisplayDispatch + Move (A7)+, D0 + MoveA.L ($2b6), A3 + MoveA.L $1E0(A3), A3 + Move.L (A7)+, $C(A3) + Move.L (A7)+, ($1FB8) + Tst D0 + MoveM.L (A7)+, D0-D7/A0-A4 + BNE.B @End + +@TryDefault + BSR OpnVidDeflt ; open the default video device, set video params + BEQ @End ; -> got it ; the default video device is bad, so go search for a video sRsrc... @@ -3553,27 +3105,30 @@ FROVideo MOVE.L A0,A1 ; save the param block pointer for _Open @NextVidsRsrc _sNextTypesRsrc ; search for a video sRsrc - BNE.S @FakeIt ; -> couldn't find one, so allocate a dummy screen - - BSR RdVidParam ; read the video parameters - BNE.S @NextVidsRsrc ; -> error, so go search some more + BNE @End ; -> couldn't find one, so allocate a dummy screen BSR OpensDrvr ; open the video driver BNE.S @NextVidsRsrc ; -> couldn't do it, so go look some more + MOVE $18(A1), -(SP) + BSR RdVidParam ; read the video parameters + TST D0 + BNE.S @NextVidsRsrc ; -> error, so go search some more + BSR InitVidDeflt ; initialize the default video device BNE.S @NextVidsRsrc ; -> error during initialization, so go looking + BRA.S @End + + BSR InitDummyScreenWrapper + @End UNLK A6 ; get rid of the slot parameter block RTS -@FakeIt BSR InitDummyScreen ; allocate a dummy screen, GDevice - BRA.S @End ; and return - ;________________________________________________________________________________________ ; -; Routine: OpnVidDeflt +; Routine: OpnVidDeflt bfa ; ; Inputs: A0 - pointer to Slot Manager parameter block ; A1 - pointer to ioParamBlock @@ -3604,19 +3159,21 @@ OpnVidDeflt MOVE.L A0,A2 ; save A0 CMP.W #DrSwApple,spDrvrSW(A0) ; does it have an Apple driver interface (software only)? BNE.S @Error ; -> no, keep on searching - BSR.S RdVidParam ; a video sRsrc was found, so read the video parameters - BNE.S @Error ; -> error during the read - BSR OpensDrvr ; open the video driver BNE.S @Error ; -> couldn't do it + MOVE $18(A1), -(SP) + BSR RdVidParam ; a video sRsrc was found, so read the video parameters + TST D0 + BNE.S @Error ; -> error during the read + BSR InitVidDeflt ; initialize the default video device @Error RTS ;________________________________________________________________________________________ ; -; Routine: RdVidParam +; Routine: RdVidParam c42 ; ; Inputs: A0 - pointer to Slot Manager parameter block ; A1 - pointer to ioParamBlock @@ -3629,7 +3186,8 @@ OpnVidDeflt MOVE.L A0,A2 ; save A0 ; then saved in low memory as needed. ;________________________________________________________________________________________ -RdVidParam MOVEM.L A1-A2/D3,-(SP) +RdVidParam LINK A6, #-$94 + MOVEM.L A0-A2/D3,-(SP) MOVE.B spId(A0),D3 ; save the ID CLR.B spExtDev(A0) ; no external devices @@ -3651,6 +3209,7 @@ RdVidParam MOVEM.L A1-A2/D3,-(SP) @gotBase MOVE.L spResult(A0),ScreenBytes ; save it MOVE.B D3,spId(A0) ; restore the sRsrc ID + MOVE $18(A1), -(SP) BSR GetDefVidMode ; get the default video mode MOVE.B D0,spId(A0) ; and save it @@ -3686,9 +3245,9 @@ RdVidParam MOVEM.L A1-A2/D3,-(SP) MOVEQ #0,D0 ; no errors @End MOVE.B D3,spId(A0) ; restore ID for caller - MOVEM.L (SP)+,A1-A2/D3 - TST.W D0 - RTS + MOVEM.L (SP)+,A0-A2/D3 + UNLK A6 + RTD #2 @Error MOVEQ #1,D0 ; bad video card (woof) BRA.S @End @@ -3696,7 +3255,7 @@ RdVidParam MOVEM.L A1-A2/D3,-(SP) ;________________________________________________________________________________________ ; -; Routine: OpensDrvr +; Routine: OpensDrvr d0a ; ; Inputs: A0 - pointer to Slot Manager parameter block ; A1 - pointer to ioParamBlock @@ -3755,34 +3314,76 @@ OpensDrvr MOVE.L A2,-(SP) ;________________________________________________________________________________________ InitVidDeflt - MOVEM.L D1-D2/A0-A1,-(SP) ; save all registers - CLR.L -(SP) ; make room for GDevice handle - MOVE ioRefNum(A1),-(SP) ; push the device's refNum - - BSR.S GetDefVidMode ; get the default video mode - MOVE.L D0,-(SP) ; and push it - - _NewGDevice ; allocate a new GDevice (in the system heap) - ;strips refNum and video mode - MOVE.L (SP)+,A0 ;save current device in A0 - -; install default video card as primary display device - - MOVE.L A0,TheGDevice ; make this the default destination - MOVE.L A0,DeviceList ; make this device head of list - MOVE.L A0,MainDevice ; make it the main device - MOVE.L A0,SrcDevice ; make it the default source for copyBits - MOVE.L A0,CrsrDevice ; make it the one owning the cursor - MOVE.L (A0),A1 ; point to this device - ORI.W #$B800,GDFlags(A1) ; set flags: ScrnActive,MainScrn,ScreenDevice,Allinit + MOVEM.L D1-D2/A0-A3,-(SP) ; save all registers + SubQ #$4, A7 + MoveA.L A7, A2 + Move $18(A1), -(A7) + Bsr GetDefVidMode + Move.L ($1FB8), -(A7) + MoveA.L ($2b6), A3 + MoveA.L $1E0(A3), A3 + Move.L $C(A3), -(A7) + Lea.L InitVidDeflt_RTS, A3 + Move.L A3, ($1FB8) + Move.L A3, (12) + SubQ #$4, A7 + MoveA.L A7, A3 + SubQ #$2, A7 + Move.L A3, -(A7) + Move $18(A1), -(A7) + Move.L D0, -(A7) + Clr.L -(A7) + Clr.L -(A7) + Clr.L -(A7) + Clr.L -(A7) + Move #$D23, D0 + _DisplayDispatch + Move (A7)+, D0 + MoveA.L (A7)+, A3 + Tst D0 + BNE.B @skip + SubQ #$2, A7 + Move.L A3, -(A7) + Move.L A2, -(A7) + Clr.B -(A7) + Move #$51F, D0 + _DisplayDispatch + Tst (A7)+ + BNE.B @skip + SubQ #$2, A7 + Move.L A3, -(A7) + Clr.L -(A7) + Move #$40B, D0 + _DisplayDispatch + Tst (A7)+ + BNE.B @skip + SubQ #$2, A7 + Move.L (A2), -(A7) + Move.L A2, -(A7) + Clr.B -(A7) + Move #$520, D0 + _DisplayDispatch + Tst (A7)+ + BNE.B @skip + MoveA.L (A2), A0 +@skip + MoveA.L ($2b6), A3 + MoveA.L $1E0(A3), A3 + Move.L (A7)+, $C(A3) + Move.L (A7)+, ($1FB8) + AddQ #$4, A7 BSR InitDefGamma ; initialize gamma correction for this device - MOVEM.L (SP)+,D1-D2/A0-A1 ;restore all registers + MOVEM.L (SP)+,D1-D2/A0-A3 ;restore all registers MOVEQ #0,D0 ;no error RTS +InitVidDeflt_RTS + RTS + + ;________________________________________________________________________________________ ; ; Routine: GetDefVidMode @@ -3797,14 +3398,15 @@ InitVidDeflt ;________________________________________________________________________________________ GetDefVidMode + LINK A6, #-$58 + MOVE.L spsPointer(A0),-(SP) ; save the sPointer, MOVE.B spId(A0),-(SP) ; the id, - MOVE.L A1,-(SP) ; and registers + MOVEM.L A1-A2,-(SP) ; and registers - LEA -SizesPRAMRec(SP),SP ; make room for parameter RAM info - MOVE.L SP,A1 ; and point to it + LEA -SizesPRAMRec*3(A6),A1 ; make room for parameter RAM info + MOVE.L A1,(A0) ; and point to it - MOVE.L A1,spResult(A0) ; pass the pointer to the buffer _SReadPRAMRec ; get parameter RAM record BNE.S @OneBit ; -> it's invalid, so default to one bit mode @@ -3819,11 +3421,11 @@ GetDefVidMode MOVEQ #0,D0 MOVE.B 2(A1),D0 ; get the default mode -@ValidMode LEA SizesPRAMRec(SP),SP ; clean up the stack - MOVE.L (SP)+,A1 ; restore registers, +@ValidMode MOVEM.L (SP)+,A1-A2 ; restore registers, MOVE.B (SP)+,spId(A0) ; the id, MOVE.L (SP)+,spsPointer(A0) ; and the sPointer - RTS + UNLK A6 + RTD #2 @OneBit MOVE.B #OneBitMode,2(A1) ; Set default to OneBitMode MOVE.L A1,spsPointer(A0) ; Pass pointer to buffer @@ -3834,7 +3436,7 @@ GetDefVidMode ;________________________________________________________________________________________ ; -; Routine: InitDefGamma +; Routine: InitDefGamma e64 ; ; Inputs: A0 - handle to GDevice ; @@ -3952,9 +3554,17 @@ InitDefGamma BRA.S @SetIt ; set it +InitDummyScreenWrapper ; f52 + MOVE.L (DeviceList), D0 + BEQ.B InitDummyScreen + CMPI.L #$FFFFFFFF, D0 + BEQ.B InitDummyScreen + RTS + + ;________________________________________________________________________________________ ; -; Routine: InitDummyScreen +; Routine: InitDummyScreen f62 ; ; Inputs: none ; Outputs: none @@ -4048,7 +3658,7 @@ InitDummyScreen ;________________________________________________________________________________________ ; -; Routine: AddVidDevice +; Routine: AddVidDevice 101c ; ; Inputs: A0 - pointer to Slot Manager parameter block ; A1 - pointer to ioParamBlock @@ -4081,6 +3691,7 @@ AddVidDevice MOVE ioRefNum(A1),-(SP) ; push the device's refNum BSR.S GetDefVidMode ; D0 <- the default video mode + MOVE $18(A1), -(SP) MOVE.L D0,-(SP) ; Push it _NewGDevice ; allocate a new GrafDevice (in system heap) @@ -4109,7 +3720,7 @@ AddVidDevice ;________________________________________________________________________________________ ; -; Routine: InitSCC +; Routine: InitSCC 1066 ; ; Inputs: none ; Outputs: none @@ -4130,6 +3741,10 @@ InitSCC bsr.l SCCIOPHwInit ; initialize the IOP hardware registers @NoIOP ; fall thru -- IOP boots in bypass mode ENDIF + + btst.b #3, ($DD3) + beq.b @dontInitSCC + movea.l SCCWr,a0 ; point to SCC base write address (chan B) movea.l SCCRd,a1 ; point to SCC base read address (chan B) tst.b (a1) ; synchronize SCC accesses @@ -4141,90 +3756,7 @@ InitSCC ;________________________________________________________________________________________ ; -; Routine: InitIWM -; -; Inputs: none -; Outputs: none -; Trashes: D0, D2, A0 -; -; Function: initializes the IWM/SWIM/SWIM2 floppy disk controller -;________________________________________________________________________________________ - -InitIWM TestFor IWMExists ; see if we really have an IWM - beq ExitInitIWM ; if not, nothing to init - - MOVEA.L IWM,A0 ; get floppy controller base address - -InitSWIM2 MOVE.L BusErrVct,-(SP) ; save the old bus error vector
- PEA @Resume ; and point it to ours
- MOVE.L (SP)+,BusErrVct ;
- MOVE.L SP,D2 ; save the stack pointer in case we bus error
- - MOVEQ #noDriveErr,D0 ; assume the chip isn't there
- TST.B q6L|rPhase(A0) ; access the chip (may bus error!)
- MOVEQ #noErr,D0 ; if we got here, the chip may be connected
- -@Resume MOVEA.L D2,SP ; trash the exception frame if we bus errored
- MOVE.L (SP)+,BusErrVct ; restore the previous bus error vector
- TST.W D0 ; set the CCR
- BNE ExitInitIWM ; -> IWM/SWIM/SWIM2 is not currently connected
- -; If we got here, at least we didn't bus error. That doesn't mean we really have -; a IWM/SWIM, though, so lets do some more checking... - - MOVE.B #$F8,wZeroes(A0) ; try to switch to the IWM register set - IF nonSerializedIO THEN ; - nop ; allow write to complete - ENDIF - MOVEQ #$F5-256,D2 ; - MOVE.B D2,wPhase(A0) ; write a value to the phase register - IF nonSerializedIO THEN ; - nop ; allow write to complete - ENDIF - MOVE.B D0,rPhase(A0) ; drive the bus in case the chip's not there - IF nonSerializedIO THEN ; - nop ; allow write to complete - ENDIF - CMP.B rPhase(A0),D2 ; did we get back what was originally written? - BEQ.S ExitInitIWM ; -> yes, we've got a SWIM2 - -; At this point, we know we don't have a SWIM2 connected. We either have an IWM/SWIM or no chip... - -@NotSWIM2 TST.B q7L(A0) ; select "Read Handshake" - TST.B q6L(A0) ; - MOVE.B D0,q7H(A0) ; - MOVEQ #%00111111,D2 ; mask to just the low 6 bits - AND.B q6L(A0),D2 ; and read the register - TST.B q7L(A0) ; back into a read mode - CMPI.B #%00111111,D2 ; did we get what we expected? - BNE.S ExitInitIWM ; -> no, it's isn't IWM or SWIM - - MOVEQ #IWMInitMode,D0 ; initial mode setting -@1 MOVE.B #$BE,wZeroes(A0) ; disable enabled if in ISM mode - MOVE.B #$F8,wZeroes(A0) ; switch SWIM to the IWM register set - TST.B Q7L(A0) ; and get out of write mode - TST.B MtrOff(A0) ; change the IWM mode now - TST.B Q6H(A0) ; set IWM to sense state - MOVE.B Q7L(A0),D2 ; sense the mode register - BTST #5,D2 ; no disks should be enabled - BNE.S @1 ; keep waiting - - AND.B D0,D2 ; see if low bits match mode we want - CMP.B D0,D2 - BEQ.S @2 ; if so, we are done - - MOVE.B D0,Q7H(A0) ; set to twiggy mode - TST.B Q7L(A0) ; set IWM back to sense state - BRA.S @1 ; loop back just to check - -@2 TST.B Q6L(A0) ; and back to read mode - -ExitInitIWM RTS - - -;________________________________________________________________________________________ -; -; Routine: InstallDriver +; Routine: InstallDriver 1082 ; ; Inputs: A1 - pointer to driver name string (pascal) ; D2 - driver's resource ID @@ -4250,7 +3782,7 @@ InstallDriver move.l UTableBase,a0 ; point to utable array move.l (a0,d1),a0 ; get handle to dce in a3 move.l (a0),a0 ; get pointer to dce - move.l a1,dCtlDriver(a0) ; load driver + move.l (a1),dCtlDriver(a0) ; load driver move.l (a1),a1 ; get pointer to driver move.w drvrFlags(a1),dCtlFlags(a0) ; copy data to dce @@ -4258,7 +3790,9 @@ InstallDriver move.w drvrEMask(a1),dCtlEMask(a0) move.w drvrMenu(a1),dCtlMenu(a0) - bset.b #dNeedLock,dCtlFlags+1(a0) ; set the handle bit + bclr.b #dNeedLock,dCtlFlags+1(a0) ; set the handle bit + cmpi.l #'only', $4(sp) + beq.b @exit @openDrvr move.l a2,a1 ; load pointer to driver name bra.s OpenDRVR ; open the driver (a1/) @@ -4271,7 +3805,7 @@ InstallDriver ;________________________________________________________________________________________ ; -; Routine: GetDetachDrvr, GetDetachRes +; Routine: GetDetachDrvr 10ce, GetDetachRes 10d4 ; ; Inputs: D1 - resource type (GetDetachRes) ; D2 - driver's resource ID @@ -4305,7 +3839,7 @@ GetDetachRes ;________________________________________________________________________________________ ; -; Routine: FirstEntryFree +; Routine: FirstEntryFree 10f2 ; ; Inputs: none ; @@ -4339,7 +3873,7 @@ FirstEntryFree ;________________________________________________________________________________________ ; -; Routine: OpenDRVR +; Routine: OpenDRVR 1112 ; ; Inputs: A1 - pointer to driver name string (pascal) ; @@ -4367,7 +3901,7 @@ OpenDRVR LEA -ioQElSize(SP),SP ; Allocate IO stack frame IF hasEgret THEN ;________________________________________________________________________________________ ; -; Routine: CheckForEgretOrCuda +; Routine: CheckForEgretOrCuda 1132 ; ; Inputs: none ; @@ -4391,126 +3925,66 @@ CheckForEgretOrCuda ; ENDIF -;___________________________________________________________________________ -; CheckForTV: Checks for the Cmd-Option-T-V keys down, and if so, set -; the PRAM bit that specifies we do that and Re-Boot -; -; Destroys A0-A1/D0/D1. -;___________________________________________________________________________ - WITH spBlock,SP_Params -CheckForTV - lea @TVKeys,a1 ; keys to check for - lea KeyMap,a0 ; compare to the Key Down Map - moveq.l #4-1,d0 ; compare loop count -@loop cmpm.l (a0)+,(a1)+ ; check for exactly this combo - dbne d0,@loop ; examine the entire key map - beq.s @tvmatch ; if equal, reset PRAM - rts ; otherwise, just return - -@tvmatch SUBA #spBlockSize,SP ; make an slot parameter block on stack - MOVE.L SP,A0 ; get pointer to parm block now - MOVE.B #0,spSlot(A0) ; put slot in pBlock - CLR.B spExtDev(A0) ; external device = 0 - -; Read the slot pRAM to determine what the currently saved mode is. -; The flag are in SP_FLAGS, which are in VendorUse5 byte. - - SUBA #SizesPRAMRec,SP ; allocate block for pRAM record - MOVE.L SP,spResult(A0) ; point to it - _sReadPRAMRec ; read it - Bne @ErrorReturn ; should not fail, but if so... - Move.b SP_Flags(SP),D0 ; Get the current flags - Bset #spCompOut,D0 ; Set it, which means to enable - Move.b D0,SP_Flags(SP) ; write out the sp_flags byte - MOVE.L SP,spsPointer(A0) ; set up parameter block - _sPutPRAMRec ; write the new record out - Bne @ErrorReturn ; any errors? - Adda #SizesPRAMRec+spBlockSize,SP; Deallocate buffer and - jmp Start -@ErrorReturn - Adda #SizesPRAMRec+spBlockSize,SP; Deallocate buffer and - rts - -@TVKeys dc.l $00020200 ; V, T - dc.l $00008004 ; Cmd, Opt - dc.l $00000000 - dc.l $00000000 - ENDWITH - -;________________________________________________________________________________________ -; -; Routine: DynamicBoxFlag -; -; Inputs: D7.w BoxFlag from the Universal tabke -; -; Outputs: D7.w Adjusted BoxFlag for this machine -; -; Trashes: D0-D1, A0-A1 -; -; Function: Calculates the boxflag based on box type and CPU clock rates. -; Look Ma! We have only one Universal table entry per family! -; -;________________________________________________________________________________________ - -DynamicBoxFlag - TestFor HMCDecoder ; do we have an HMC decoder? - beq.s @rts ; -> Nope, just use the boxflag from the uTables. - - MOVEM.L D0-D6/A0-A4/A6,-(SP) ; save Universal info -; CMPI.B #boxPDMEvt1,D7 ; Is this an Evt1? ; removing evt1 suprt -; BEQ.S @Done ; -> Yes, never muck with the boxflag ; - - BigBSR6 GetCPUIDReg ; Get the CPU id - BNE.S @Done ; -> Failed (can't happen) - - AND.W #%00000011,D0 ; Just look at bits 0 & 1 - - MOVE.L ([ProcessorInfoPtr],\ - ProcessorInfo.CPUClockRateHz),D1 ; Get the CPU clock rate - - MOVEQ #-1,D2 ; Clear the counter - LEA @SpeedTable,A0 ; Point to the list of clock rates -@Lupe CMP.L (A0)+,D1 ; Is the bus clock rate less than the entry? - BLS.S @GotIt ; -> Yes, go with the current delay factor - ADDQ #1,D2 - BRA.S @Lupe - -@GotIt LSL.W #2,D0 ; Mult the box bit by the size of the table - LEA (@BoxTable,D0),A0 - MOVE.B (A0,D2),D7 ; Get the boxflag - -@Done MOVEM.L (SP)+,D0-D6/A0-A4/A6 ; save Universal info -@rts RTS ; Return - -@SpeedTable ; PDM CPU clock rate mapping table - DC.L 10000000 ; 50.001 MHz - DC.L 60000000 ; 66.001 MHz - DC.L 73000000 ; 80.001 MHz - DC.L 100000000 ; 100.001 MHz - DC.L -1 ; end of table - -@BoxTable EQU * -@WLCDboxes DC.B boxPDM50WLCD ; QFC - DC.B boxPDM66WLCD - DC.B boxPDM80WLCD - DC.B boxPDM - -@notboxes DC.B boxPDM50WLCD ; QFC (wlcd post evt1) - DC.B boxPDM66WLCD - DC.B boxPDM80WLCD - DC.B boxPDM - -@shitboxes DC.B boxPDM50L ; Lego - DC.B boxPDM66L - DC.B boxPDM80L - DC.B boxPDM - -@FridgBoxes DC.B boxPDM ; Fridge - DC.B boxPDM66F - DC.B boxPDM80F - DC.B boxPDM100F - - ENDPROC ; {MyROM} - END +NewStartInitFunc +; 1148 + SubQ.L #$2, A7 + MoveA.L A7, A0 + Move.L #$20002, D0 + _ReadXPRam + Move (A7), D0 + AndI #$808, D0 + CmpI #$808, D0 + BEQ.B @skipwrite + Move #$4F48, (A7) + MoveA.L A7, A0 + Move.L #$20002, D0 + _WriteXPRam +@skipwrite + Move (A7)+, D0 + LsR #$8, D0 + AndI #$7, D0 + MoveQ.L #$1, D1 + LsL.B D0, D1 + Move.B D1, (SCSIDrvrs) + Rts + + + + +FiddleWithEmulator +; 1180 + Move.L #'ppcf', D0 + _Gestalt + BNE.B @done + Move.L A0, D0 + AndI.L #$10, D0 + BEQ.B @done + Move.L #$2000, D0 + _NewPtrSysClear + BNE.B @done + Lea.L ($68FFF000).L, A2 + Move.L A0, D0 + AddI.L #$FFF, D0 + AndI.L #$FFFFF000, D0 + Move.L D0, $E0(A2) + Move.L #$FE000000, $E8(A2) + Clr.L $EC(A2) + + MoveA.L D0, A0 + MoveA #$1000, A1 + MoveQ.L #$2, D0 + _MemoryDispatch + + import GETREALPROC + bsr.l GETREALPROC + BMI.B @done + Move.L A0, $E4(A2) +@done + Rts + + + + align 16 + end \ No newline at end of file diff --git a/OS/StartMgr/StartMgr.make b/OS/StartMgr/StartMgr.make index 2b8f9b3..767ffa7 100644 --- a/OS/StartMgr/StartMgr.make +++ b/OS/StartMgr/StartMgr.make @@ -27,7 +27,9 @@ StartMgrObjs = "{ObjDir}StartTop.a.o" ¶ "{ObjDir}StartInit.a.o" ¶ + "{ObjDir}StartInterstix.c.o" ¶ "{ObjDir}StartSearch.a.o" ¶ + "{ObjDir}StartLibGlue.c.o" ¶ "{ObjDir}StartBoot.a.o" ¶ "{ObjDir}StartFail.a.o" ¶ "{ObjDir}StartErr.a.o" ¶ diff --git a/OS/StartMgr/StartSearch.a b/OS/StartMgr/StartSearch.a index d912866..255d654 100644 --- a/OS/StartMgr/StartSearch.a +++ b/OS/StartMgr/StartSearch.a @@ -180,7 +180,7 @@ NumFlashX EQU 3 ; number of times to flash X before going FloppyRefNum EQU -5 ; floppy driver refnum IntHDRefNum EQU -33 ; refnum of driver for SCSI ID 0 -DefaultTimeOut EQU 20 ; number of seconds timeout if PRAM is pristine +DefaultTimeOut EQU 25 ; number of seconds timeout if PRAM is pristine MaxTimeOut EQU 31 ; maximum number of seconds allowed as timeout PollDelay EQU 15 ; delay (in ticks) between poll drive SCSILoads @@ -211,7 +211,7 @@ Locals RECORD {link},INCR frameSize equ * flashTime ds.l 1 ; time to flash icon -startTicks ds.l 1 ; Ticks when we first get into FindStartupDevice +startTicks ds.l 1 ; Ticks when we first get into FindStartupDevice ; 8 lower ckPartition ds.b 1 ; flag = we need to check to see if the partition #s match noDefaultDrive ds.b 1 ; flag = we have no default drive @@ -220,7 +220,7 @@ forcedBoot ds.b 1 ; flag = boot has been forced to a non-default device csPB ds CntrlParam ; pb for Control and Status -pmCommandPB ds pmCommandRec ; pb for sending SleepReq to power manager +pmCommandPB ds pmCommandRec ; pb for sending SleepReq to power manager ; 8 lower startPRAM ;(ds.l 1) lsdExtDevID ds.b 1 ; slot device ExtDevID (for SCSI target/lun) @@ -229,6 +229,8 @@ lsdRefNum ;(ds.w 1) ; SCSI device refnum lsdSlotNum ds.b 1 ; slot number lsdSRsrcID ds.b 1 ; sRsrc ID (for native SCSI, bus #; for plug-in, sRsrc ID) + ds.b 8 + link ds.l 1 ; old A4 = (A4) ENDR @@ -245,9 +247,10 @@ A4_locals EQU A4 A5_bootGlobs EQU A5 A6_bootBlocks EQU A6 + ;________________________________________________________________________________________ ; -; Routine: FindStartupDevice +; Routine: FindStartupDevice 3600 ; ; Inputs: none ; @@ -276,11 +279,19 @@ FindStartupDevice PROC EXPORT BSR LoadSlotDrivers ; Default is a slot device, execute boot code ; When booting a Mac OS, execution will continue here + MOVEQ.L #0, D7 MOVE.L Ticks, startTicks(A4) ; Init the time we got here in case we have PowerMgr BSR LoadSCSIDrivers ; Load all the drivers we can BSR WaitForPollDrive ; Wait until the boot drive has warmed up - BRA.S @FirstEntry ; First time through: keep original goal + + CLR.B -6(A4) + + BSR LoadATADrivers + + BSR OpenLANDiskDriver + + BRA @FirstEntry ; First time through: keep original goal @NextPass IF hasPwrControls THEN ; @@ -294,7 +305,7 @@ FindStartupDevice PROC EXPORT BLS.S @nosleep @sleepnow LEA pmCommandPB(A4), A0 ; A0 gets pointer to parameter block - MOVE.W #SleepReq, pmCommand(A0) ; PMGR command, Go to sleep + MOVE.W #PmgrPWRoff, pmCommand(A0) MOVE.W #4, pmLength(A0) ; Four bytes of data to send LEA pmData(A0), A1 MOVE.L A1, pmSBuffer(A0) ; pointer to send buffer @@ -307,16 +318,48 @@ FindStartupDevice PROC EXPORT ENDWITH ENDIF ; - CMPI.W #FloppyRefNum,D4 ; do we have floppy set as the default? - BEQ.S @NoChange ; -> yes, keep looking for floppies - LEA IsItAnything,A3 ; no, from now on, any device will do -@NoChange + + Move.L D7, D7 + BNE.B @twenty_six + SubA.L A0, A0 + _InternalWait + BNE.B @skip_blah + MoveQ.L #$19, D0 +@skip_blah + MulU #$3C, D0 + Add.L -$56(A4), D0 + Cmp.L (Ticks), D0 + BCS.B @twenty_six + MoveQ.L #$F, D0 + Add.L (Ticks), D0 +@before_cmp + Cmp.L (Ticks), D0 + BCC.B @before_cmp + Bra.B @after_less_stuff +@twenty_six + MoveQ.L #$1, D7 + Lea.L IsItAnything, A3 +@after_less_stuff + IMPORT ATAMgr_5d940 + Bsr.L ATAMgr_5d940 +@after_stuff + + BSR LoadSCSIDrivers ; load more drivers if we can + BSR OpenLANDiskDriver @TryAgain BSR VisualUpdate ; Update dynamic user feedback + IMPORT PMIDLERELATEDDRIVERCALL + BSR.L PMIDLERELATEDDRIVERCALL + IMPORT INTERC_2750 + BSR.L INTERC_2750 + + @FirstEntry + BSR DaFuq + BSR FindNextCandidate ; Find the next potential Startup Device. BEQ.S @NextPass ; Branch if we're at the end of the queue. @@ -351,7 +394,7 @@ FindStartupDevice PROC EXPORT ;________________________________________________________________________________________ ; -; Routine: EmbarkOnSearch +; Routine: EmbarkOnSearch 36f2 ; ; Inputs: none ; @@ -381,6 +424,7 @@ EmbarkOnSearch SUBQ.W #4,SP ; make room for parameters on the stack MOVE.L SP,A0 ; and point to them _GetDefaultStartup ; get info about the default device + CLR -4(A4) MOVE.L (SP), startPRAM(A4) ; store for later partition check MOVE.W (SP)+,D3 ; D3.L = MOVE.W (SP)+,D4 ; get the driver's refNum/ @@ -413,19 +457,8 @@ EmbarkOnSearch SUBA.L A2,A2 ; initialize the drive queue pointer - LEA IsItFloppyOrDefault,A3 ; ASSUME match default or floppy devices. + LEA IsItDefault,A3 - CASE OBJ - IMPORT Ck4OnlyLoadFromDefault ; :SCSIMgr4pt3:BootItt.a - BSR.L Ck4OnlyLoadFromDefault ; supposed to limit our search to default device? - CASE OFF - BEQ.S @ck4NoDefault - LEA IsItDefault, A3 ; match only default device -@ck4NoDefault - TST.B noDefaultDrive(A4) ; is there a default drive? - BEQ.S @HaveDefault ; -> yes - LEA IsItAnything,A3 ; no, match any device -@HaveDefault MOVE.L Ticks,flashTime(A4) ; let flash time expire immediately. CLR.W D6 ; clear visual state information. @@ -453,9 +486,8 @@ EmbarkOnSearch move.w D4, D1 ; get refNum (maybe) not.w D1 ; convert refNum to unit number sub.w #$20, D1 ; convert to SCSI ID - blt.s @exit ; out of range -> use previous value cmpi.w #$07, D1 - bgt.s @exit ; out of range -> use previous value + bhi.s @exit ; out of range -> use previous value move.b SCSIPoll, D0 and.b #$F8, D0 ; strip out old internal HD SCSI ID @@ -468,7 +500,7 @@ EmbarkOnSearch ;________________________________________________________________________________________ ; -; Routine: LoadSlotDrivers +; Routine: LoadSlotDrivers 377e ; ; Inputs: D3 - bits 31-24: -reserved- ; 23-16: default OS @@ -548,7 +580,7 @@ LoadSlotDrivers ;________________________________________________________________________________________ ; -; Routine: LoadSCSIDrivers +; Routine: LoadSCSIDrivers 37ee ; ; Inputs: D3 - bits 31-24: -reserved- ; 23-16: default OS @@ -569,9 +601,7 @@ LoadSlotDrivers LoadSCSIDrivers IF hasAsyncSCSI THEN - BSR.L ISITT ; check if we're running SCSI 4.3 - TST.B D0 ; are we? - BEQ.S @UseOldSCSI ; -> no, use the old code to load drivers + CLR.B forcedBoot(A4) PEA forcedBoot(A4) ; ptr to flag indicating a forcedBoot CLR.L -(SP) ; load all drivers @@ -589,31 +619,104 @@ LoadSCSIDrivers RTS @UseOldSCSI ENDIF - -; there is a new mechanism to disable loading of poll drive, so, check power -; user command, "command, shift, option and delete keys", if those keys are -; not down, go load the poll drive. -; Make sure that command, shift, option and delete keys are not down - MOVEQ #-1,D0 ; try to load all SCSI devices - CMPI.W #CmdShiftOptDel,KeyMap+6 ; are command, shift, option and delete keys down? - BNE.S @GoLoadD ; -> no, continue - MOVEQ #$07,D1 - AND.B SCSIPoll,D1 ; get the SCSI ID of the poll drive - BCLR D1,D0 ; and clear the bit in the available drive list -@GOLoadD move.l d6,-(sp) ; save d6 pdw - move.l a0,-(sp) ; save a0 - moveq.l #0, D6 ; allow drivers to munge heap pdw - BSR.L SCSILoad ; try to load driver(s) from disk - move.l (sp)+,a0 ; restore a0 - move.l (sp)+,d6 ; restore d6 pdw - RTS + + +LoadATADrivers + BTst.B #$7, ($B23) + BEQ @L3 + MoveM.L D1-D7/A0-A6, -(A7) + Move D4, -$8(A4) + Move.L -$C(A4), D5 + Move.L #$FF, D2 + Move.L D5, D1 + AndI #$F800, D1 + CmpI #$2000, D1 + BEQ.B @L0 + AndI.L #$FFFF00FF, D3 + CmpI #$FFCA, D5 + BEQ.B @L0 + Bra.B @L2 +@L0 _DisableDynWait + _GetTimeOut + BNE.B @L1 + MoveQ.L #$19, D0 +@L1 Move.L D0, -(A7) + MoveQ.L #$0, D0 + Move.B -$9(A4), D0 + LsL #$8, D0 + Move.B -$C(A4), D0 + Move.L D0, -(A7) + IMPORT ATAMgr_5d9b0 + BSR.L ATAMgr_5d9b0 + AddQ #$8, A7 + CmpI #$0, D0 + BEQ.B @L2 + Move D0, -$8(A4) + IMPORT ATAMgr_5d940 +@L2 BSR.L ATAMgr_5d940 + MoveM.L (A7)+, D1-D7/A0-A6 + Move -$8(A4), D4 +@L3 Rts + + + +PostATA + MoveM.L D0-D3/A0-A2, -(A7) + MoveA.L ([$2B6],$288), A2 + + Move.L A2, D0 + BEQ.B @return + Move $6(A2), D1 + MoveQ.L #$0, D2 + +@loop MoveA.L $14(A2,D2.L), A1 + Move.L A1, D0 + BEQ.B @return + Move $C8(A1), D0 + + Clr D3 + Cmp D3, D0 + BEQ.B @skip + MoveA.L $C4(A1), A0 + Move.L A0, D0 + BEQ.B @return + Jsr (A0) + Bra.B @return + +@skip AddQ #$4, D2 + SubQ #$1, D1 + BNE.B @loop + +@return MoveM.L (A7)+, D0-D3/A0-A2 + Rts + + + +OpenLANDiskDriver + Lea.L @DriverName, A1 + Lea.L -$32(A7), A7 + MoveA.L A7, A0 + Move.L A1, $12(A0) + DC.W $A000 + Tst D0 + BNE.B @L7 + Move $18(A0), D4 +@L7 Lea.L $32(A7), A7 + Rts + + STRING Pascal +@DriverName DC.B '.LANDisk' + ALIGN 2 + + + ;________________________________________________________________________________________ ; -; Routine: WaitForPollDrive +; Routine: WaitForPollDrive 38f0 ; ; Inputs: none ; @@ -655,9 +758,7 @@ WaitForPollDrive @WaitForIt IF hasAsyncSCSI THEN - BSR.L ISITT ; check if we're running SCSI 4.3 - TST.B D0 ; are we? - BEQ.S @UseOldSCSI ; -> no, use the old code to load drivers + CLR.B forcedBoot(A4) PEA forcedBoot(A4) ; ptr to flag indicating a forcedBoot PEA 1 ; only look for the startup device BSR.L ITTBOOT ; get the startup device's refnum in D0 @@ -676,47 +777,7 @@ WaitForPollDrive @UseOldSCSI ENDIF -; make sure that command, shift, option and delete keys are not down - - MOVE.W KeyMap+6,D0 ; get keys down - CMP.W #CmdShiftOptDel,D0 ; are command, shift, option and delete keys down? - BEQ.S @RawExit ; -> exit if so - - MOVEQ #$07,D1 - AND.B SCSIPoll,D1 ; Get SCSI ID of poll drive - MOVEQ #0,D0 ; Clear register - BSET D1,D0 ; Set the bit for the drive - -; Call SCSILoad with bit map in D0 and heap_munge_flag in D6 - - move.l d6,-(sp) ; save d6 pdw - move.l a0,-(sp) ; save a0 - moveq.l #0, D6 ; allow drivers to munge heap pdw - BSR.L SCSILoad ; Try to load driver for poll disk - move.l (sp)+,a0 ; restore a0 - move.l (sp)+,d6 ; restore d6 pdw - BEQ.S @MyExit ; Branch if warmed up, but driver is invalid - - MOVEQ #IntHDRefNum,D0 ; Refnum for ID 0 - SUB.W SCSIPoll,D0 ; Convert to refnum for poll drive - MOVE.W D0,D1 ; Put back in D1 for comparison - - -; Let's see if the poll hard disk is actually in the queue -@ExamDQ SUBA.L A2,A2 ; Start at beginning of drive queue -@FindIntHD - BSR NextDQEntry ; Get the next drive queue entry - BEQ.S @EndOfQueue ; Branch if we're out of queue entries - - CMP.W dqRefNum(A2),D1 ; Is it our trusty poll hard disk? - - BNE.S @FindIntHD ; Nope, see if the next one's it - -@Warm_n_Toasty ; We found the drive; it must have warmed up - BRA.S @MyExit ; That's all folks - @ckTimeout -@EndOfQueue CMP.L Ticks,D5 ; Should the poll HD be visible by now? BLO.S @NoDrivePresent ; Yes, so quit waiting for it MOVEQ.L #PollDelay,D0 ; Get number of ticks to wait before retrying @@ -739,7 +800,7 @@ WaitForPollDrive ;________________________________________________________________________________________ ; -; Routine: FindNextCandidate +; Routine: FindNextCandidate 3966 ; ; Inputs: A2 - Points to the drive queue entry which was tried last time; the search ; for an appropriate device will begin with the NEXT drive queue entry. @@ -786,7 +847,7 @@ FindNextCandidate ;________________________________________________________________________________________ ; -; Routine: NextDQEntry +; Routine: NextDQEntry 3996 ; ; Inputs: A2 - points to the drive queue entry which was tried last time (nil if ; at the end of the queue) @@ -810,7 +871,7 @@ NextDQEntry MOVE.L A2,D0 ; is the pointer NIL? ;________________________________________________________________________________________ ; -; Routine: SelectDevice +; Routine: SelectDevice 39a4 ; ; Inputs: A2 - points to the current drive queue entry ; @@ -839,7 +900,7 @@ SelectDevice ;________________________________________________________________________________________ ; -; Routine: CheckMouseEject +; Routine: CheckMouseEject 39c2 ; ; Inputs: A0 - pointer to A6-based I/O parameter block ; @@ -857,7 +918,7 @@ CheckMouseEject ;________________________________________________________________________________________ ; -; Routine: EjectMe +; Routine: EjectMe 39c8 ; ; Inputs: A0 - pointer to A6-based I/O parameter block ; @@ -876,7 +937,7 @@ DontEject RTS ; Return with status ;________________________________________________________________________________________ ; -; Routine: GetStartupInfo +; Routine: GetStartupInfo 39d6 ; ; Inputs: A0 - pointer to A6-based I/O parameter block ; A6 - pointer to buffer for holding the boot blocks @@ -904,7 +965,7 @@ GetStartupInfo ;________________________________________________________________________________________ ; -; Routine: ReactToFailure +; Routine: ReactToFailure 3a00 ; ; Inputs: D0 - error code indicating what went wrong ; D4 - default device's driver reference number @@ -941,7 +1002,7 @@ ReactToFailure ;________________________________________________________________________________________ ; -; Routine: Ck4SupportsPartition +; Routine: Ck4SupportsPartition 3a30 ; ; Inputs: A2 - pointer to the current drive queue entry (must not be nil!) ; D4 - default device's driver reference number @@ -969,6 +1030,7 @@ Ck4SupportsPartition ; now check this driver to see if it "follows new rules" and responds ; to driverGestalt status call ; + move.l (A0), A0 move.w dCtlFlags(A0), D0 ; does it Follow New Rules? btst #FollowsNewRules, D0 ; (word-relative bit #) beq.s @notSupported ; no -> skip driverGestalt call @@ -997,7 +1059,7 @@ Ck4SupportsPartition ;________________________________________________________________________________________ ; -; Routine: IsItDefault +; Routine: IsItDefault 3a8e ; ; Inputs: A2 - pointer to the current drive queue entry (must not be nil!) ; D4 - default device's driver reference number @@ -1010,9 +1072,29 @@ Ck4SupportsPartition ;________________________________________________________________________________________ IsItDefault + tst -4(A4) + bne.s @skipsomestuff + + pea.l -4(A4) + import StartLib_GetStartupDevice + jsr StartLib_GetStartupDevice + lea.l $4(SP), SP + tst D0 + bne.s @notTheDisk +@skipsomestuff + + move -4(A4), D0 + cmp 6(A2), D0 + beq.s @isTheDisk + bra.s @notTheDisk + cmp.w dqRefNum(A2), D4 ; is this driver for the default device? bne.s @notTheDisk ; no-> definitely no the disk then + import ZeroD0 + bsr ZeroD0 + bne.s @notTheDisk + move.b #1, foundDrvr(A4) ; so we know to clr ckPartition if end-of-Q tst.b ckPartition(A4) ; do we need to check the partition num? beq.s @isTheDisk ; no-> well then, it is the right disk @@ -1033,7 +1115,7 @@ IsItDefault ;________________________________________________________________________________________ ; -; Routine: IsItFloppyOrDefault +; Routine: IsItFloppyOrDefault 3adc ; ; Inputs: A2 - pointer to the current drive queue entry (must not be nil!) ; D4 - default device's driver reference number @@ -1054,7 +1136,7 @@ IsItFloppyOrDefault ;________________________________________________________________________________________ ; -; Routine: IsItFloppy +; Routine: IsItFloppy 3ae4 ; ; Inputs: A2 - pointer to the current drive queue entry (must not be nil!) ; D4 - default device's driver reference number @@ -1072,7 +1154,7 @@ ItsDefault RTS ; and return BEQ if so ;________________________________________________________________________________________ ; -; Routine: IsItAnything +; Routine: IsItAnything 3aec ; ; Inputs: A2 - pointer to the current drive queue entry (must not be nil!) ; D4 - default device's driver reference number @@ -1085,14 +1167,23 @@ ItsDefault RTS ; and return BEQ if so ;________________________________________________________________________________________ IsItAnything - CMP D0,D0 ; return BEQ + CMP 8(A2), D4 + BNE.S @beq + + BSR ZeroD0 + BNE.S @bne + +@beq MOVEQ.L #0, D0 + RTS + +@bne MOVEQ.L #1, D0 RTS ;________________________________________________________________________________________ ; -; Routine: VisualUpdate +; Routine: VisualUpdate 3b00 ; ; Inputs: flashTime(A4) - the absolute time of the next flash of the ? or X ; D6 - the current state of the icons on the screen @@ -1129,15 +1220,18 @@ VisualUpdate @NoSwitch BCHG #FlashParity,D6 ; Switch parity. BNE.S @XorQ ; Branch if we need X or ? showing. LEA DiskIcon,A0 ; plot the plain disk icon + MOVE #-20021,D0 BRA.S PlotMyIcon @XorQ TST.B D6 ; Are we showing an ? BEQ.S @ShowQ ; Branch if so. SUBQ.B #1,D6 ; Eventually, we go back to a ?. LEA XDiskIcon,A0 ; but for now, plot the disk icon with the X + MOVE #-20023,D0 BRA.S PlotMyIcon @ShowQ LEA QDiskIcon,A0 ; plot the disk icon with the question mark + MOVE #-20022,D0 BRA.S PlotMyIcon @DoneDisk RTS @@ -1145,7 +1239,7 @@ VisualUpdate ;________________________________________________________________________________________ ; -; Routine: HappyMac +; Routine: HappyMac 3b54 ; ; Inputs: none ; @@ -1158,39 +1252,15 @@ VisualUpdate HappyMac BSR.S EraseMyIcon ; erase what's on the screen where the icon goes LEA HappyIcon,A0 ; plot the happy mac icon - BSR.S PlotMyIcon - RTS + MOVE #-20020,D0 ;________________________________________________________________________________________ ; -; Routine: EraseMyIcon -; -; Inputs: none -; -; Outputs: none -; -; Trashes: none -; -; Function: erases the ICN# in the center of the main screen -;________________________________________________________________________________________ - -EraseMyIcon MOVEM.L D0-D2/A0-A1,-(SP) - BSR.S PushIconRect ; push the icon's rectangle onto the stack - MOVE.L SP,-(SP) ; and point to it - MOVE.L grafGlobals(A5),A0 ; point to the QuickDraw globals - PEA gray(A0) ; and use 50% gray as the background - _FillRect ; erase the rectangle with the desktop pattern - ADDQ.W #8,SP ; clean up the stack - MOVEM.L (SP)+,D0-D2/A0-A1 - RTS - - -;________________________________________________________________________________________ -; -; Routine: PlotMyIcon +; Routine: PlotMyIcon 3b5e ; ; Inputs: A0 - pointer to ICN# to plot +; D0 - ID of cicn to try first ; ; Outputs: none ; @@ -1199,7 +1269,27 @@ EraseMyIcon MOVEM.L D0-D2/A0-A1,-(SP) ; Function: plots an icon, centered on the main video device ;________________________________________________________________________________________ -PlotMyIcon MOVE.L A0,D2 ; save the pointer to the ICN# +PlotMyIcon + MOVE.L A0,-(SP) + MOVE #$FFFF,ROMMapInsert + SUBQ #4,SP + MOVE D0,-(SP) + _GetCIcon + MOVE.L (SP)+,D2 + MOVE.L (SP)+,A0 + + BEQ.S @useOld + + MOVE.L D2,-(SP) + BSR PushIconRect + MOVE.L SP,-(SP) + MOVE.L D2,-(A7) + _PlotCIcon + ADDQ #8,SP + _DisposeCIcon + RTS + +@useOld MOVE.L A0,D2 ; save the pointer to the ICN# ; put the source bitmap on the stack (icon's bit image) @@ -1232,6 +1322,46 @@ PlotMyIcon MOVE.L A0,D2 ; save the pointer to the ICN# RTS +;________________________________________________________________________________________ +; +; Routine: EraseMyIcon 3bbc +; +; Inputs: none +; +; Outputs: none +; +; Trashes: none +; +; Function: erases the ICN# in the center of the main screen +;________________________________________________________________________________________ + +EraseMyIcon MOVEM.L D0-D2/A0-A2,-(SP) + BSR.S PushIconRect ; push the icon's rectangle onto the stack + MOVE.L SP,-(SP) ; and point to it + + + + MOVE.L grafGlobals(A5),A2 ; point to the QuickDraw globals + TST.B ($B3E) + BNE.S @anyway + MOVE.L ExpandMem,A0 + TST.B $341(A0) + BEQ.B @otherthing +@anyway PEA.L @theColor + _RGBForeColor + PEA.L -16(A2) + BRA.S @ffs +@otherthing + PEA.L -24(A2) +@ffs + _FillRect ; erase the rectangle with the desktop pattern + ADDQ.W #8,SP ; clean up the stack + MOVEM.L (SP)+,D0-D2/A0-A2 + RTS + +@theColor DC.W $8888, $8888, $8888 + + ;________________________________________________________________________________________ ; ; Routine: PushIconRect @@ -1322,7 +1452,54 @@ XDiskIcon DC.L $7FFFFFF0,$81000108,$81007104,$81008902,$81008901,$81008901,$8100 DC.L $FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFF,$FFFFFFFE ENDWITH - ENDPROC +; ENDPROC + + + + + + + +DaFuq ; proc export ; but has no callers yet? +; IMPORT NextDQEntry +; IMPORT SelectDevice +; IMPORT GetStartupInfo + + + MOVEM.L D0-D2/A0-A2,-(SP) + SUB.L A2,A2 +@loop + MOVE #$A002,D0 + _GetOSTrapAddress + MOVE.L ROMBase,A1 + CMP.L A0,A1 + BCS.S @return + BSR NextDQEntry + BEQ.S @return + BSR SelectDevice + BSR GetStartupInfo + BRA.S @loop +@return + MOVEM.L (SP)+,D0-D2/A0-A2 + RTS + +; ALIGN 16 + + + + + + + +ZeroD0 PROC EXPORT + MOVEQ.L #0, D0 + RTS + +; ALIGN 16 + + + + @@ -1335,6 +1512,7 @@ XDiskIcon DC.L $7FFFFFF0,$81000108,$81007104,$81008902,$81008901,$81008901,$8100 ; ; Destroys D0-D2/A0-A1. ;---------------------------------------------------------------------- +; 4070 InternalWait PROC EXPORT @@ -1373,6 +1551,7 @@ MaxDispVal EQU 9 ; Entries 0-9 exist. ; ; Destroys D0/A0. ;---------------------------------------------------------------------- +; 4098 iGetTimeOut BSR.S GetRawTimeOut ; Get the current timeout parameter @@ -1387,6 +1566,7 @@ iGetTimeOut ; ; Destroys D0/A0. ;---------------------------------------------------------------------- +; 40a0 iGetWaitFlags BSR.S GetRawTimeOut ; Get the current timeout parameter @@ -1401,6 +1581,7 @@ iGetWaitFlags ; ; Destroys D0-D1/A0. ;---------------------------------------------------------------------- +; 40a8 iSetTimeOut MOVE.B D0,-(SP) ; Save timeout value @@ -1423,6 +1604,7 @@ iSetTimeOut ; ; Destroys D0-D1/A0. ;---------------------------------------------------------------------- +; 40bc iSetWaitFlags MOVE.B D0,-(SP) ; Save wait flags @@ -1479,6 +1661,7 @@ GetRawTimeOut ; ; Destroys D0/A0. ;---------------------------------------------------------------------- +; 40f0 iDisableDynWait _GetWaitFlags ; Get the current wait flags. @@ -1492,6 +1675,7 @@ iDisableDynWait ; ; Destroys D0/A0. ;---------------------------------------------------------------------- +; 4102 iEnableDynWait _GetWaitFlags ; Get the current wait flags. @@ -1505,6 +1689,7 @@ iEnableDynWait ; ; Destroys D0/A0. ;---------------------------------------------------------------------- +; 4114 iDisablePermWait _GetWaitFlags ; Get the current wait flags. @@ -1518,6 +1703,7 @@ iDisablePermWait ; ; Destroys D0/A0. ;---------------------------------------------------------------------- +; 4126 iEnablePermWait _GetWaitFlags ; Get the current wait flags. @@ -1545,6 +1731,7 @@ iEnablePermWait ; ; Destroys D0-D2/A0-A1. ;---------------------------------------------------------------------- +; 4140 GetDefaultStartup PROC EXPORT @@ -1575,6 +1762,7 @@ GetDefaultStartup PROC EXPORT ; ; Destroys D0-D2/A0-A1. ;---------------------------------------------------------------------- +; 4150 SetDefaultStartup PROC EXPORT @@ -1603,6 +1791,7 @@ SetDefaultStartup PROC EXPORT ; ; Destroys D0-D2/A0-A1. ;---------------------------------------------------------------------- +; 4160 GetOSDefault PROC EXPORT @@ -1642,6 +1831,7 @@ GetOSDefault PROC EXPORT ; creating Chaos. ; ;---------------------------------------------------------------------- +; 4170 SetOSDefault PROC EXPORT @@ -1665,104 +1855,6 @@ AppPhne EQU $09961010 ENDPROC -;________________________________________________________________________________________ -; -; Routine: Ck4LimitPRAMClear -; -; Inputs: none -; -; Outputs: Z: NE = only boot from Default device -; EQ = boot from Floppy or Default -; D0: NE = only boot from Default device -; EQ = boot from Floppy or Default -; -; Trashes: D0, A0 -; -;________________________________________________________________________________________ - -Ck4LimitPRAMClear PROC EXPORT - - IMPORT ValidatePRAM76 ; StartSearch.a - bsr ValidatePRAM76 - subq.w #2,sp ; allocate buffer on stack - movea.l sp, A0 ; get buffer ptr - MOVE.L #$00010076, D0 ; Read 1 bytes starting at loc $76 - _ReadXPRam - move.b (sp)+, D0 - and.b #1, D0 ; low bit - rts - - ENDPROC - - -;________________________________________________________________________________________ -; -; Routine: ValidatePRAM76 -; -; Inputs: none -; -; Outputs: none -; -; Trashes: none -; -; Function: Validates byte $76 of xpram: counts set bits in lower 6 and compares with -; upper two bits. If not equal, zeros out the byte. -; -; Note: Byte $76 (previously reserved but used by OSDefault stuff) is -; being defined as sensitive boot bits generally having to do with -; security issues driven by AIX but these functions can be used -; by other OSes as well. The upper two bits of byte $76 are a -; "checksum" of the other 6 bits (i.e. count of bits set). This -; is desired because of the danger if one of these bits is set -; accidentally by some bogus client. Failing this checksum will -; cause the byte to revert to 00 - a safe value. Currently defined -; bits are: -; 0: limit PRAM clear - don't clear PSWD, AUXPRAM, OSType, DefBoot -; 1: only load drivers from default device, don't boot from floppy -; 2: ignore CmdShiftOptDel -; -;________________________________________________________________________________________ -vp76trashedRegs REG D0-D2/A0 - -ValidatePRAM76 PROC EXPORT - - movem.l vp76trashedRegs, -(sp) - - subq.w #2, sp ; allocate buffer on stack - movea.l sp, A0 ; get buffer ptr - MOVE.L #$00010076, D0 ; Read 1 bytes starting at loc $76 - _ReadXPRam ; Get it from PRAM. - move.b (sp)+, D0 - - move.b #0, D2 ; zero reg for addx - moveq.l #0, D1 ; clear checksum - and.b #$3F, D0 ; get data bits (strip sum bits) -@bitloop - lsr.b #1, D0 ; get a bit - addx.b D2, D1 ; add that bit to checksum - tst.b D0 ; loop until no more bits - bne.s @bitloop - - and.b #3, D1 ; only 2 low bits are valid - - move.b (A0), D0 ; get byte 76 again - lsr.b #6, D0 ; get only checksum bits - - cmp.b D0, D1 ; valid signature? - beq @valid ; Yes, don't clear all - - move.b #00, -(sp) ; clean up bogus value - movea.l sp, A0 ; get buffer ptr - move.l #$00010076, D0 ; get #, addr PRAM bytes - _WriteXPram ; write out zeros to 76 - move.b (sp)+, D0 -@valid - movem.l (sp)+, vp76trashedRegs - rts - - ENDP - - ;---------------------------------------------------------------------- ; Get information about the current default video device. ; @@ -1779,6 +1871,7 @@ ValidatePRAM76 PROC EXPORT ; ; Destroys D0-D2/A0-A1. ;---------------------------------------------------------------------- +; 4190 GetVideoDefault PROC EXPORT @@ -1808,6 +1901,7 @@ GetVideoDefault PROC EXPORT ; ; Destroys D0-D2/A0-A1. ;---------------------------------------------------------------------- +; 41a0 SetVideoDefault PROC EXPORT diff --git a/OS/SysUtil.a b/OS/SysUtil.a index 5708b63..8a21319 100644 --- a/OS/SysUtil.a +++ b/OS/SysUtil.a @@ -219,7 +219,7 @@ ASyncPatch ; ;______________________________________________________________________ ; -; Routine: ReadParam +; Routine: ReadParam b332 ; A0 (input) -- pointer to buffer which returns parameters ; D0 (input) -- bits 0-19 indicate which of parameter bytes ; 0-19 to return in the buffer. bytes are @@ -246,7 +246,7 @@ XPLoop LSR.L #1,D0 ; read a byte for each one set ;______________________________________________________________________ ; -; Routine: WriteParam +; Routine: WriteParam b34c ; Input: A0 (input) -- pointer to PRAM buffer ; Arguments: D0 (output) -- result code ; Function: This routine writes the parameter ram copy in SysParam @@ -273,7 +273,7 @@ WriteParamTrap ;______________________________________________________________________ ; -; Routine: ReadDateTime +; Routine: ReadDateTime b374 ; A0 (input) -- pointer to buffer in which time is returned ; Arguments: D0 (output) -- result code ; Function: This routine updates Time in memory and then writes @@ -288,7 +288,7 @@ ReadDateTimeTrap ;______________________________________________________________________ ; -; Routine: SetDateTime +; Routine: SetDateTime b37e ; Arguments: D0 (input) -- 32-bit value to write to clock ; D0 (output) -- result code ; Function: This routine updates Time in memory and then writes @@ -302,7 +302,7 @@ SetDateTimeTrap ;______________________________________________________________________ ; -; Routine: Delay +; Routine: Delay b386 ; Arguments: A0 (input) -- number of tick counts to delay ; D0 (output) -- value of Ticks after delay ; interrupt level 0 is set @@ -311,19 +311,29 @@ SetDateTimeTrap ; ;______________________________________________________________________ -DelayTrap ANDI.W #$F8FF,SR ; have to let interrupts in rb - MOVE.L Ticks,D0 - ADD.L A0,D0 +DelayTrap MOVEM.L D1-D3/A0-A1,-(SP) + ANDI.W #$F8FF,SR ; have to let interrupts in rb + MOVE.L Ticks,D3 + ADD.L A0,D3 + BRA.S @enter -@1 CMP.L Ticks,D0 ; have enough ticks ticked? +@1 CLR.L -(SP) + MOVE.L #$10,-(SP) + MOVE #$FFCB,-(SP) + DC.W $AA7F ; InternalWait? + ADDQ.L #4,SP + +@enter CMP.L Ticks,D3 ; have enough ticks ticked? BHI.S @1 ; -> No. Keep waiting. (now use unsigned comparison) + MOVE.L D3,D0 + MOVEM.L (SP)+,D1-D3/A0-A1 RTS ;______________________________________________________________________ ; -; Routine: UprString +; Routine: UprString b3b4 ; Arguments: D0.W (input) -- string length ; A0.L (input) -- pointer to string to canonize ; Opcode bit 10 -- 0 - map to upper case; 1 - case sensitive @@ -363,7 +373,7 @@ USLoopEntry ;______________________________________________________________________ <27Feb85>... ; -; Routine: CmpString, RelString +; Routine: CmpString b3ca, RelString b3e0 ; Arguments: D0.L (input) -- high-order word = string 0 length ; low-order word = string 1 length ; A0.L (input) -- pointer to string 0 @@ -952,7 +962,7 @@ CmpTab ;_______________________________________________________________________ ; -; Routine: ReadPram +; Routine: ReadPram b856 ; ; Arguments: A1 (input) -- pointer to buffer where 20 bytes are placed ; all regs preserved @@ -983,7 +993,7 @@ ReadPram MOVE.L A0,-(SP) ;

;_______________________________________________________________________ ; -; Routine: InitUtil +; Routine: InitUtil b87c ; ; Arguments: D0 (output) -- result code (0 if clock was already initialized) ; @@ -1003,7 +1013,7 @@ InitUtil CLR.W -(SP) ; assume no reset of PRam values <30Oct85> LAK MOVEQ #0,D0 ; assume valid clock data CMP.B #$A8,(A1) ; is the clock data valid? - BEQ.S CkNewPram ; branch if so + BEQ.S POSTWRITE MOVE.W #PRInitErr,(SP) ; report non-zero result <30Oct85> LAK MOVEQ #4,D1 @@ -1013,8 +1023,11 @@ InitUtil CLR.W -(SP) ; assume no reset of PRam values <30Oct85> LAK BSR WritePram ; and put initial values into clk chip -CkNewPram BTST #6,HWCfgFlags ; new clock chip present? <30oct85> BBM - BEQ.S ClkXit ; exit if not <30oct85> BBM +CkNewPram LEA.L SysParam,A0 + MOVE.B #$A8,(A0) + MOVE.L #$10010,D0 + _WriteXPRam +POSTWRITE LEA GetParam,A0 ; get pointer to useful buffer <30oct85> BBM MOVE.L #$4000C,D0 ; Command to read 4 bytes at addr C <30oct85> BBM @@ -1026,10 +1039,6 @@ CkNewPram BTST #6,HWCfgFlags ; new clock chip present? <30oct85> BBM BEQ.S ClkXit ; exit if so <30oct85> BBM MOVE.W #PRInitErr,(SP) ; report non-zero result <30Oct85> LAK - MOVE.L D1,(A0) ; store out true validity bytes <30oct85> BBM - MOVE.L #$4000C,D0 ; Command to write 4 bytes at addr C <30oct85> BBM - _WriteXPRam ; <30oct85> BBM - MOVEQ #32,D1 ; starting address to clear out XPRam <30oct85> BBM @0 MOVEQ #4,D0 ; number of bytes to write SWAP D0 ; finish the command byte <30oct85> BBM @@ -1041,25 +1050,24 @@ CkNewPram BTST #6,HWCfgFlags ; new clock chip present? <30oct85> BBM CMP.B #8,D1 ; Check if we wrote the last address <30oct85> BBM BNE.S @0 ; if not loop back untill we are done <30oct85> BBM - MOVEM.L A1,-(SP) ;Save A1 LEA PRAMInitTbl,A0 ;Copy the data from the PRAMInit table. - LEA GetParam,A1 ; into the GetParam buffer. - MOVEQ #5-1,D0 ;Loop 5 times (20 bytes) -@10 MOVE.L (A0)+,(A1)+ ;Copy 4 bytes - DBRA D0,@10 ;Branch if not done. + LEA ReadTime,A1 - MOVE.L #$00140076,D0 ;Write 20 bytes beginning at PRAM address $76 - LEA GetParam,A0 ; from the buffer - _WriteXPRam ; into the PRAM. + SUB.L A0,A1 + MOVE.L A1,D0 + SWAP D0 + ORI #$76,D0 + _WriteXPRam - ; Write the default memory mgr flags to location $8A. Since this is the only xpram whose default - ; is non zero, we write it explicitly (as opposed to writing a default table full of zeros) + LEA.L GetParam,A0 + MOVE.L #'NuMc',(A0) + MOVE.L #$4000C,D0 + _WriteXPRam - LEA MMFlags,A0 ; Point A0 at the Memory Manager flags lomem - MOVE.B #MMFlagsDefault,(A0) ; Put the default MMFlags into MMFlags - MOVE.L #MMPRAMloc,D0 ; Write MMFlags to PRAM - _WriteXPRam ; Store it. - MOVEM.L (SP)+,A1 ;Restore A1 + IMPORT InterC_29c0_Wireless + MACHINE MC68030 + BSR.L InterC_29c0_Wireless +; MACHINE MC68000 ClkXit MOVE.W (SP)+,D0 ; pass back error code <30oct85> LAK BNE.S @1 ; br if we had to reset clock/pram <30oct85> LAK @@ -1070,7 +1078,7 @@ ClkXit MOVE.W (SP)+,D0 ; pass back error code <30oct85> LAK ; original 20-byte parameter RAM initialization values -PRAMInit DC.B $A8 ; old PRAM validity byte <2.7> +PRAMInit DC.B $77 ; old PRAM validity byte <2.7> DC.B 0 ; AppleTalk node ID hint for modem port <2.7> DC.B 0 ; AppleTalk node ID hint for printer port <2.7> DC.B (0<<4)+(0<<0) ; serial port usage = neither port in use <2.7> @@ -1107,7 +1115,7 @@ PRAMInit DC.B $A8 ; old PRAM validity byte <2.7> DC.B ((32/4)<<4)+ \ ; ¥ double-click time = 32 ticks <2.7> (32/4) ; ¥ caret-blink time = 32 ticks <2.7> - DC.B 3 ; ram cache size in 32K blocks (96k default) + DC.B 32 ; ram cache size in 32K blocks (96k default) DC.B (1<<7)+ \ ; ¥ color desk pattern = 1 (use if CQD around) <2.7>
(1<<6)+ \ ; ¥ mouse scaling = 1 (on) <2.7> @@ -1118,7 +1126,7 @@ PRAMInit DC.B $A8 ; old PRAM validity byte <2.7> ;Start Manager PRAMInitTbl DC.B 00 ; [$76] Reserved. DC.B 01 ; [$77] Default OS. - DC.W $FFFF,$FFDF ; [$78-$7B] Default boot. + DC.W $0000,$6666 ; [$78-$7B] Default boot. ;Sound Manager? DC.W 0 ; [$7C-$7D] Sound alert id @@ -1135,9 +1143,35 @@ PRAMInitTbl DC.B 00 ; [$76] Reserved. ;Reserved DC.B 0,0 ; [$88-$89] + +OtherDamnTable + DC.L $25000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000070 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000000 + DC.L $00000001 + DC.W $000A + ;________________________________________________________________________________________ ; -; Routine: ReadTime +; Routine: ReadTime b9a2 ; ; Inputs: none ; @@ -1166,7 +1200,7 @@ ReadTime MOVEM.L A0/A2-A3/D1-D2/D4-D5,-(SP) ;

;________________________________________________________________________________________ ; -; Routine: WriteTime +; Routine: WriteTime b9ca ; ; Inputs: "Time" contains the 32-bit time value to write to the clock ; @@ -1194,7 +1228,7 @@ WriteTime MOVEM.L A0/D1-D5,-(SP) ;

;________________________________________________________________________________________ ; -; Routine: InitCPHardware +; Routine: InitCPHardware b9e6 ; ; Inputs: none ; @@ -1220,7 +1254,7 @@ InitCPHardware ;

;_______________________________________________________________________ ; -; Routine: WritePram +; Routine: WritePram ba06 ; ; Arguments: SysParam contains the 20 bytes to write. ; all regs preserved @@ -1252,7 +1286,7 @@ WritePram MOVE.L A0,-(SP) ;

;----------------------------------------------------------------------------- -; SysEnvirons call. +; SysEnvirons call. ba30 ; ; Fix File Date Patch# Fix Routine(s) Routine(s) Fixed ;AppleSystemPatch PatchIIROM.a 28Mar87 #PABM150 (SysEnvirons) (SysEnvirons) @@ -1485,163 +1519,4 @@ Exit MOVE.W D2,D0 ; put error number in D0 RTS ; return to caller (Return address should be on stack) ENDPROC ; SysEnvirons - -;----- <2.4> -; -; The Reliability Manager -; -; This new "manager" is responsible for monitoring the operation of the machine -; and recording pertinent information in parameter RAM. -; -; Written by Bob Herold, May 24, 1989 -; -;----- - -;----- -; InitReliability - sets time of 1st power on, and initializes the Usage Statistics time -; manager task -; -; The time of 1st power on is kept as the number of 48 hour periods since Jan 1 1989. To -; calculate this, we first get the number of seconds since Jan 1 1989. On 020 and higher -; machines, we could divide by the number of seconds in 48 hours. To work on 68000 -; machines, we separate out factors of two to get the divisor into the 16 bit range: -; -; # 48 hrs since Jan 1 1989 = (# secs since Jan 1 1989) / (# secs in 48 hours) -; = (# secs) / (60 * 60 * 24 * 2) -; = (# secs) / (2*2*15) * (2*2*15) * (2*2*2*3) * 2 -; = (# secs) / (15 * 15 * 3) * 2^^8 -; = ((# secs) / 2^^8) / (15 * 15 * 3) -;--- - -InitReliability PROC EXPORT - IMPORT RelTimeTask, RelDeferredTimeTask - - IF hasPowerMgr THEN - rts - ELSE - -;--- -; Initialize the 'time of 1st power on' -;--- - - subq #RelPram>>16,sp ; allocate buffer on stack - move.l Time,d1 ; get current # secs - sub.l #Jan1st89,d1 ; get # secs since Jan 1 1989 - blo.s @doneStart ; if earlier, clock chip set wrong! - movea.l sp,a0 ; get buffer ptr - move.l #RelPram,d0 ; get #, addr PRAM bytes - _ReadXPram ; read 'em and weep - move.l (sp),d0 ; get 'da bytes - and.l #Rel1stMask,d0 ; mask all except 1st powered on time - bne.s @doneStart ; if already set, do nothing - lsr.l #8,d1 ; divide # secs by 2^^8 - divu.w #15*15*3,d1 ; get # 48 hour periods (see comment above) - moveq #Rel1stBit,d0 ; get shift count - lsl.l d0,d1 ; shift our value into position - and.l #Rel1stMask,d1 ; mask unneeded high bits - and.l #-1-Rel1stMask,(sp) ; zero our bits in result - or.l d1,(sp) ; overlay our value into result - move.l #RelPram,d0 ; get #, addr PRAM bytes - _WriteXPram ; write out 1st power on time -@doneStart addq #RelPram>>16,sp ; de-allocate buffer - -;--- -; Set up time manager task for power on time measurement -;--- - - WITH RelGlobals - - moveq #rlRecSize,d0 ; get size Reliability Mgr globals - move.b d0,d1 ; save for later - _NewPtr ,sys,clear ; allocate space for it - bne.s @done ; don't bother if no room - move.l ExpandMem,a1 ; get ptr to low memory expansion - move.l a0,ExpandMemRec.emReliability(a1) ; save ptr to Reliability globals there - move.b d1,rlGlobalsSize(a0) ; save size of globals - move.b #rlRecVers,rlGlobalsVers(a0); save version number of globals - bclr #usRelTaskRun,UnSwitchedFlags; signal we are timing - -; Initialize a deferred task queue element to schedule execution of the original Time Manager -; task, now called RelDeferredTimeTask. Pass a pointer to the Time Manager task in dtParm so -; that the original code still gets its expected parameter in A1. - - move.w #dtQType,rlDeferredTask.qType(a0) - lea RelDeferredTimeTask,a1 - move.l a1,rlDeferredTask.dtAddr(a0) - lea rlTimeBlock(a0),a1 - move.l a1,rlDeferredTask.dtParm(a0) - - lea rlTimeBlock(a0),a0 ; point to time manager task block - lea RelTimeTask,a1 ; point to our time task - move.l a1,tmAddr(a0) ; stuff it into task block - _InsXTime ; install our task - move.l #RelMsCount,d0 ; get # ms between calls - clr.l tmWakeUp(a0) ; signal its the first time - _PrimeTime ; fire up time mgr task -@done rts - - ENDWITH ; {RelGlobals} - - ENDIF - - ENDPROC ; {InitReliability} - - -;----- -; RelTimeTask - the time manager task for doing all this reliability stuff -; -; Called by the Time Manager -; -; Entry -; a0 - points to this routine (not too useful, huh?) -; a1 - points to task block (now there's something useful!) -; -; -; RelDeferredTimeTask - the deferred Time Manager task for doing all this reliability stuff -; -; Called by the Deferred Task Manager -; -; Entry -; A1 - dtParm points to the originating Time Manager task block -;--- - -RelTimeTask PROC EXPORT - -; If PRAM is in Egret/CUDA, _ReadXPram and _WriteXPram require interrupts enabled -; to execute efficiently. Therefore, the periodic Reliability task now uses the -; Deferred Task Manager to be more interrupt-friendly. - -; This helps MIDI SysEx dumps and other interrupt tasks run more punctually. - - lea tmXQSize(a1),a0 ; deferred task element follows TM task element - _DTInstall - rts - - - entry RelDeferredTimeTask - -RelDeferredTimeTask - - subq #RelPram>>16,sp ; allocate buffer on stack - movea.l sp,a0 ; get buffer ptr - move.l #RelPram,d0 ; get #, addr PRAM bytes - _ReadXPram ; read 'em and weep - move.l (sp),d0 ; get 'da bytes - move.l d0,d1 ; save a copy - and.l #RelPwrMask,d0 ; mask to get power on time - addq.l #1,d0 ; increment power on time - and.l #RelPwrMask,d0 ; mask again, in case of rollover - and.l #-1-RelPwrMask,d1 ; zero power on time bits - or.l d0,d1 ; replace the power on time bits - move.l d1,(a0) ; put new PRAM value in buffer - move.l #RelPram,d0 ; get #, addr PRAM bytes - _WriteXPRAM ; write 'em back - addq #RelPram>>16,sp ; deallocate buffer - move.l a1,a0 ; get ptr to task block - move.l #RelMsCount,d0 ; get # ms between calls - _PrimeTime ; re-fire up time mgr task - rts - - ENDPROC ; {RelTimeTask} - END diff --git a/OS/TrapDispatcher/Dispatch.a b/OS/TrapDispatcher/Dispatch.a index 8c78499..1010215 100644 --- a/OS/TrapDispatcher/Dispatch.a +++ b/OS/TrapDispatcher/Dispatch.a @@ -225,6 +225,7 @@ Dispatcher proc export export BadTrap import SysErr1 import BlockMove68020 + import FLUSHCRANGE If hasNewHeapMgr Then import PramIO ; endif @@ -233,7 +234,7 @@ Dispatcher proc export ;_______________________________________________________________________ ; -; Routine: ATrap68020 +; Routine: ATrap68020 dfa0 ; ; Function: Dispatch A-line emulator traps to Mac system. ; @@ -328,7 +329,7 @@ EMT1010 equ ATrap68020 ;_______________________________________________________________________ ; -; Routine: FindTableEntry +; Routine: FindTableEntry e01c ; ; Function: Return address of trap entry in the dispatch table. (flushes Inst cache on 020). ; @@ -342,13 +343,21 @@ EMT1010 equ ATrap68020 FindTableEntry _AssumeEq OldDisp,ToolDisp-1 ; OldDisp is next to, and lower than ToolDisp lsl.w #16-ToolDisp,d1 ; ccr.c <- ToolDisp, ccr.n <- OldDisp - bpl.s @oldTrap ; if OldDisp = 0, it's an old style trap + bpl.s @newOldTrap ; if OldDisp = 0, it's an old style trap bcc.s @osTrap ; if ToolDisp = 0, it's a new style OS trap ; otherwise, it's a new style ToolBox trap @toolTrap andi.w #numTrapMask,d0 ; clear all but trap bits lea (ToolTable,d0.w*4),a1 ; index into the Toolbox table - bra CacheFlush ; flush inst cache and return (destroys only reg D1) + rts + +@newOldTrap bcc.s @oldTrap + move.l d0,d1 + btst.l #11,d1 + bsr.s @toolTrapInstead + subi #$c000,d1 + cmpi #$1000,d1 + rts @oldTrap andi.w #$01FF,d0 ; clear irrelevant bits moveq.l #-$0057,d1 ; setup to check for ToolBox range @@ -358,17 +367,18 @@ FindTableEntry addq.w #$0057-$004F,d1 ; d1 := TrapNum - $004F ble.s @osTrap ; $0000 É $004F are OS traps subq.w #$0054-$004F,d1 ; d1 := TrapNum - $0054 +@toolTrapInstead bne.s @toolTrap ; $0054 is an OS trap, $50É$53,$55,$56 are tool box @osTrap andi.w #$00FF,d0 ; only 8 bits for OS trap numbers lea (OSTable,d0.w*4),a1 ; index into the OS table - bra.s CacheFlush ; flush inst cache and return (destroys only reg D1) + rts Title 'Dispatch - Get / Set Trap Address' IMPORT TrapAddressBits ; rb ;_______________________________________________________________________ ; -; Routine: GetTrapAddress +; Routine: GetTrapAddress e062 ; ; Function: Return trap address from dispatch table. ; @@ -383,10 +393,8 @@ kComeFromHeader equ (kBranchOverJMPLOpcode << 16) + kJMPLOpcode ; GetTrapAddressTrap ; rb - bsr TrapAddressBits ; makes sure trap word is correct begin - move ccr,-(sp) ; save condition register - bsr.s OldGetTrapAddress ; call the old GetTrapAddress - move (sp)+,ccr ; get condition codes back + bsr.s FindTableEntry + move.l (a1),a0 bcs.s @done ; come-from patches bypass our trickery @next cmp.l #kComeFromHeader,(a0) ; does this have the come-from header? @@ -397,17 +405,10 @@ GetTrapAddressTrap ; rb moveq #0,d0 ; must zero the result code again rts -OldGetTrapAddress ; ; end - - bsr.s FindTableEntry ; locate the dispatch table entry - movea.l (a1),a0 ; get the routine address from the table - moveq.l #noErr,d0 ; return with success - rts ; all done - ;_______________________________________________________________________ ; -; Routine: SetTrapAddress +; Routine: SetTrapAddress e07a ; ; Function: Load new trap vector into dispatch table. ; On 020 machines, flush the cache as well. @@ -423,29 +424,28 @@ SetTrapAddressTrap ; rb move.l (a0),d2 ; get header of trap, and check for bus errors <5>begin - bsr TrapAddressBits ; makes sure trap word is correct rb + bsr.s FindTableEntry ; locate the dispatch table entry + + exg.l d0,a0 bcs.s OldSetTrapAddress ; come-from patches bypass our trickery cmp.l #kComeFromHeader,d2 ; headers can only be used on come-from patches <5> beq.s @illegalHeader ; saw a header, so I must system error <5> - movem.l d0-d1/a0,-(sp) ; save trap address, number, and bits - bsr OldGetTrapAddress ; call the old GetTrapAddress - move.l #0,a1 ; no come-froms found yet -@next + movea.l (a1),a0 + cmp.l #kComeFromHeader,(a0)+ ; does this have the come-from header? - bne.s @done ; no we are done + bne.s OldSetTrapAddress +@next move.l a0,a1 ; remember this address move.l (a0),a0 ; go on to the next - bra.s @next -@done - movem.l (sp)+,d0-d1/a0 ; restore trap address, number, and bits + cmp.l #kComeFromHeader,(a0)+ ; does this have the come-from header? + beq.s @next + move.l d0,(a1) - cmp.l #0,a1 ; any come-froms found? - beq.s OldSetTrapAddress ; no, go do the real SetTrapAddress - move.l a0,(a1) ; set the trap address - move.l jCacheFlush,-(sp) ; get the cache flush vector <9> - rts ; call it, and then return to the trap dispatcher <9> + lea -2(a1),a0 + lea 6,a1 + bra.l FLUSHCRANGE @illegalHeader move.w #dsBadPatchHeader,d0 ; get error code <5> @@ -453,16 +453,13 @@ SetTrapAddressTrap ; rb OldSetTrapAddress - bsr.s FindTableEntry ; locate the dispatch table entry - move.l a0,(a1) ; install the new routine address into the table + move.l d0,(a1) ; install the new routine address into the table moveq.l #noErr,d0 ; return with success - - move.l jCacheFlush,-(sp) ; get the cache flush vector <9> - rts ; call it, and then return to the trap dispatcher <9>end + rts ;_______________________________________________________________________ ; -; Macros: CacheFlush, vCacheFlush +; Macros: CacheFlush e0c2, vCacheFlush e0c2, DummyCacheFlush e0c6 ; ; Function: Flush the 68020 Cache. For programs that do self modifying code, etc. ; @@ -481,13 +478,6 @@ CacheFlush rts ; jump through the vector vCacheFlush - move.l d1,-(SP) ; save this f*&%$ng register <5> - movec.l cacr,d1 ; get current cache state of 68020 - addq.w #1<<3,d1 ; flush the instruction cache <1.4> - movec.l d1,cacr ; write back to the control register - move.l (SP)+,d1 ; restore register <5> - rts ; all done - vCacheFlush68040 ; 68040 cache flushing for self-modifying programs <3> ; NOTE - since the 040 I-Cache never gets "dirty", it only needs to be invalidated. <3> @@ -502,6 +492,9 @@ vCacheFlush68040 ; 68040 cache flushing for self-modifying programs <3> rts ; return to caller - no registers destroyed <3> MACHINE MC68020 ; reset to previous MACHINE directive <3> + +DummyCacheFlush + rts Title 'Dispatch - InitDispatcher' ;_______________________________________________________________________ @@ -666,18 +659,14 @@ OSLoop move.l (a2)+,d1 ; get the next entry from the ROM dispatch table EndIf ; Not NewBuildSystem ; now install the trap dispatcher + btst.b #2,$240a + beq.s @noInstallFlusher + lea DummyCacheFlush,a0 + move.l a0,jCacheFlush +@noInstallFlusher + lea EMT1010,a0 ; point to the dispatcher - TestFor has68kEmulator ; Are we emulating a 68020? SAM - beq.s @noEmu ; -> Nope. - lea Rts020Disp,A1 ; Point A1 to an rts (hopefully near some cache resident code) - bra.s @StuffFlush ; -> Install it - -@noEmu cmpi.b #cpu68040,CpuFlag ; check if we need to install 040 Cache Flush routine <3> - bne.s @notAn040 ; NO ... perform 020/030 cache-flush <3> - lea vCacheFlush68040,a1 ; YES ... get addr. of 040 cache flush routine <3> -@StuffFlush move.l a1,jCacheFlush ; ... and install it <3> -@notAn040 ; <3> move.l a0,Line1010 ; install the Line-A exception handler IF forRomulator THEN ; register the Line-A handler with the nub @@ -711,60 +700,5 @@ BadTrap ; rb, start from PatchProtector.a -TrapAddressBits proc export - -; TrapAddressBits -; -; In: -; d0.w trap number -; d1.w [GS]etTrapAddress trap word -; -; Out: -; d1.w (modified) [GS]etTrapAddress trap word -; ccr CC if it is not a come-from, CS if it is a come-from - -; bits in trap numbers and Set/GetTrapAddress opcodes - -TrapNumber record 0 -toolboxBit equ 11 - endr - -TrapAddressOpcode record 0 -newBit equ 9 -toolboxBit equ 10 - endr - - btst #TrapAddressOpcode.newBit,d1 ; is this N[GS]etTrapAddress? - bnz.s @notFullWord ; yes, donÕt handle it - btst #TrapAddressOpcode.toolboxBit,d1 ; is this normal [GS]etTrapAddress? - bz.s @notFullWord ; yes, donÕt handle it - -@fullWord - ; adjust the trap bits - - bset #TrapAddressOpcode.newBit,d1 ; is this NGetTrapAddress? - btst #TrapNumber.toolboxBit,d0 ; is the trap a Toolbox trap? - bnz.s @toolbox ; yes, leave the bit set - bclr #TrapAddressOpcode.toolboxBit,d1 ; clear bit for OS -@toolbox - - cmp.w #$C000,d0 ; is this a come-from trap word? - blo.s @notComeFrom ; no, it is not - cmp.w #$D000,d0 ; is it a come-from trap word? - bhs.s @notComeFrom ; no, it is not -@comeFrom - ; oooh... carry is set for us, we can return - rts - -@notFullWord -@notComeFrom - and #$FE,ccr ; clear the carry bit - rts - - endproc - -; rb, end - - end diff --git a/OS/Universal.a b/OS/Universal.a index cf33da2..126ba67 100644 --- a/OS/Universal.a +++ b/OS/Universal.a @@ -427,7 +427,7 @@ JumpIntoROM @TryAgain moveq.l #0,d2 ; figure it out from scratch bsr6 GetHardwareInfo ; figure out what we are running on btst.l #ROMExists,d0 ; see if we have a ROM - beq.s @TryAgain ; if not, we're screwed, but try again anyway + beq.s norom ; if not, we're screwed ; Now figure out what the new base of ROM should be, @@ -453,6 +453,7 @@ intoROM ; now we are in ROM adda.l d3,sp ; relocate the stack to rom addresses +norom lea GotBusError,a0 ; get the handler address move.l a0,d0 ; value to search for @loop cmp.l -(a0),d0 ; check for a match @@ -478,8 +479,6 @@ intoROM ; now we are in ROM @TryAgain moveq.l #0,d2 ; figure it out from scratch bsr6 GetHardwareInfo ; figure out what we are running on - btst.l #ROMExists,d0 ; see if we have a ROM - beq.s @TryAgain ; if not, we're screwed, but try again anyway IF NOT ROMinRAM THEN ; rb bsr6 InitVIAs ; initialize the VIAs (turns off vOverlay) @@ -502,33 +501,14 @@ intoROM ; now we are in ROM move.l d0,d3 ; save a copy of d0 move.l #EgretFWMask,d0 ; mask for Egret Firmware {rbm}<2> and.l d1,d0 ; isolate the field {rbm}<2> - sub.l #Egret8,d0 ; see if we have Egret FW {rbm}<2> - beq.w @DoEgretInit ; do Egret 8 FW INIT, LC/si {rbm}<2> - sub.l #Egret8,d0 ; see if we have Caboose FW {rbm}<2> - beq.s @CudaDone ; just exit Quadra900 {rbm}<2> PN - sub.l #Egret8,d0 ; see if we have Cuda FW {rbm}<2> + beq.s @CudaDone + + cmpi.l #$3000000, D0 bne.s @CudaDone ; if not, just exit {rbm}<2> IF NOT ROMinRAM THEN ; rb BigBSR6 CudaInit ;Setup Cuda Sysnc Ack with System {rbm}<2> - bra.s @CudaDone ; ENDIF ; rb -@DoEgretInit ; - movea.l DecoderInfo.VIA1Addr(a0),a1 ; get VIA 1 base address - move.w #4000,d0 ; -@wait - eieioSTP - tst.b (a1) ; sync to hardware for 1.2µS per access - - dbra d0,@wait ; Egret must see idle before command, it's busy - ; doing ADB reset for 3mSec so delay in idle state - eieioSTP - move.l #(NopCmd<<16)|pseudoPkt,d0 ; - moveq #0,d2 ; no bytes to send - bsr6 SendEgretCmd ; send the command to disable async. messages - moveq.l #0,d2 ; figure it out from scratch - bsr6 GetHardwareInfo ; restore all the registers we trashed - move.l d0,d3 ; by calling SendEgretCmd @CudaDone move.l d3,d0 ; restore d0 @@ -922,11 +902,10 @@ intoROM ; now we are in ROM ALIGN 16 ; <60><62> rb, for the 040 emulator... dc.l 0,0,0,0 ; end of list - dc.l (GotBusError-BaseOfRom)+$40A00000 ; base of Elsie II ROM rb - dc.l (GotBusError-BaseOfRom)+$00A00000 ; base of Elsie ROM <51> dc.l (GotBusError-BaseOfRom)+$40000000 ; alternate base of normal ROM <58> rb dc.l (GotBusError-BaseOfRom)+$40800000 ; base of normal ROM dc.l (GotBusError-BaseOfRom)+$00000000 ; base of overlay ROM + dc.l (GotBusError-BaseOfRom)+$FFC00000 ; base of NewWorld ROM? GotBusError btst.l #beok,d7 ; indicate that bus error occured move.l a5,a7 ; restore stack @@ -935,7 +914,7 @@ GotBusError btst.l #beok,d7 ; indicate that bus error occured ;_______________________________________________________________________ ; -; Routine: InitVIAs +; Routine: InitVIAs aad8 ; Inputs: A0 - Pointer to table of base addresses ; A1 - Pointer to ProductInfo record for this machine ; D0 - Flags indicating which base addresses are valid @@ -962,9 +941,6 @@ InitVIAs movea.l VIA1Addr(a0),a2 ; get VIA base address rb movea.l a1,a3 ; get product info ptr rb adda.l VIA1InitPtr(a3),a3 ; point to the init info rb - - btst.l #PSCExists,d0 ; is this a Cyclone ? rb rb, start - beq.s @WombatVIAInit ; if not, check if we're a Wombat ; ; This change is valid only for the Cyclone VIA1 Info Table... ; The other machine tables will have to be updated to follow this initialization @@ -972,14 +948,16 @@ InitVIAs ; in a different order than in previous ROMS... THIS MUST BE UPDATED!!!! ; gjs ???? ; - eieioSTP - move.b (a3)+,vDirA(a2) ; init direction for port A gjs eieioSTP move.b (a3)+,vBufA(a2) ; init output port A gjs eieioSTP - move.b (a3)+,vDirB(a2) ; init direction for port B gjs + move.b (a3)+,vDirA(a2) ; init direction for port A gjs + nop eieioSTP move.b (a3)+,vBufB(a2) ; init output port B gjs + eieioSTP + move.b (a3)+,vDirB(a2) ; init direction for port B gjs + nop eieioSTP move.b (a3)+,vPCR(a2) ; init peripheral control reg rb eieioSTP @@ -987,53 +965,7 @@ InitVIAs eieioSTP move.b #$7F,vIER(a2) ; Disable all VIA interrupts. rb eieioSTP - bra.s @VIA1done ; cool, keep going rb -@WombatVIAInit ; - IF hasDJMEMC THEN ; rb - cmpi.b #djMEMCDecoder,d2 ; are we on a Wombat? - bne.s @doOldVIAInit ; if not, initialize VIAs the old way - eieioSTP - move.b (a3)+,vBufA(a2) ; init output port A - eieioSTP - move.b (a3)+,vDirA(a2) ; init direction for port A - eieioSTP - move.b #$1C,vACR(a2) ; enable shift-out on ACR - eieioSTP - move.b #0,vSR(a2) ; preset shift register with an ADB resetCmd - eieioSTP - move.b (a3)+,vBufB(a2) ; init output port B - eieioSTP - move.b (a3)+,vDirB(a2) ; init direction for port B - eieioSTP - move.b -2(a3),vBufB(a2) ; (re-)init output port B - eieioSTP - move.b (a3)+,vPCR(a2) ; init peripheral control reg - eieioSTP - move.b (a3)+,vACR(a2) ; init auxiliary control reg - eieioSTP - move.b #$7F,vIER(a2) ; Disable all VIA interrupts. - eieioSTP - bra.s @VIA1done ; cool, keep going - ENDIF ; rb - -@doOldVIAInit ; rb, start - eieioSTP - move.b (a3)+,vBufA(a2) ; init output port A - eieioSTP - move.b (a3)+,vDirA(a2) ; init direction for port A - eieioSTP - move.b (a3)+,vBufB(a2) ; init output port B - eieioSTP - move.b (a3)+,vDirB(a2) ; init direction for port B - eieioSTP - move.b (a3)+,vPCR(a2) ; init peripheral control reg - eieioSTP - move.b (a3)+,vACR(a2) ; init auxiliary control reg - eieioSTP - move.b #$7F,vIER(a2) ; Disable all VIA interrupts. - eieioSTP - @VIA1done btst.l #VIA2Exists,d0 ; see if we have VIA2 beq.s @VIA2done ; if not, skip it @@ -1071,10 +1003,12 @@ InitVIAs move.b d3,vBufA(a2) ; init output port A eieioSTP move.b (a3)+,vDirA(a2) ; init direction for port A + nop eieioSTP move.b (a3)+,vBufB(a2) ; init output port B eieioSTP move.b (a3)+,vDirB(a2) ; init direction for port B + nop eieioSTP move.b (a3)+,vPCR(a2) ; init peripheral control reg eieioSTP @@ -1102,70 +1036,12 @@ InitVIAs eieioSTP @VIA2done - btst.l #RBVExists,d0 ; see if we have an RBV - beq.s @RBVdone ; if not, skip it - - movea.l RBVAddr(a0),a2 ; get RBV base address - eieioSTP - move.b #$7F,RvIER(a2) ; disable all interrupts - eieioSTP - move.b #$8F,RvDataB(a2) ; initialize data reg. B <1.3> - eieioSTP - - BTST #MSCChipBit,D1 ; are we using an MSC variant? - BEQ.S @NoMSC ; -> no, continue on - -; This is the point where we check to see if an external FPU is attached to -; the system. In the case of Escher, the onboard FPU will power up disabled, -; but we want to enable it here if we don't detect anything else sitting on -; the coprocessor bus. -; -; The idea is to move VBR DOWN the difference between the F-Line and -; BusError, so that if you were to execute an F-Line instruction and -; couldn't handle it, you would end up fetching the address of the -; BusErrVector and going thru the BusErrVector. The BusErr handler -; expects A6 to contain the address of where it should return TO. - - movec VBR,d3 ; retrieve VBR - sub.l #Line1111-BusErrVct,d3 ; temporarily move VBR down - movec d3,VBR ; shuffle VBR for F-Line test - moveq #1,d3 ; non-zero value in D3 for later comparison - move.l a7,a5 ; sp to restore if you dont have an FPU - move.l a6,a3 ; save return address - bset #beok,d7 ; set bus error expected flag - lea @noFPU,a6 ; where to come back to if you dont have an FPU - - FNOP ; execute suspect command - clr.l d3 ; if you got here, you already have an FPU - -@noFPU tst.b d3 ; - beq.s @ignore ; already using an FPU so ignore internal - bclr #MSCEnableFPU,RvDataB(a2);enable onboard FPU -@ignore - movec VBR,d3 ; return VBR to it's old value - add.l #Line1111-BusErrVct,d3 - movec d3,VBR ; ... so everyone is happy - bclr #beok,d7 ; release bus error expected flag - move.l a3,a6 ; restore return address - - MOVE.B #$7F,RvSEnb(A2) ; disable all slot interrupts - eieioSTP - RTS6 ; -@NoMSC ; - - eieioSTP - move.b #1< - eieioSTP - move.b #$FF,RvSEnb(a2) ; set all slots to be interrupt enabled - eieioSTP -@RBVdone - rts6 ;_______________________________________________________________________ ; -; Routine: GetHardwareInfo +; Routine: GetHardwareInfo ab4e ; Inputs: D2 - Bits 15..8, BoxFlag info (only if decoder kind <> 0) ; D2 - Bits 7..0, Address Decoder Kind (zero if unknown) ; A6 - return address @@ -1205,6 +1081,13 @@ GetHardwareInfo bra HasNoCPUIDReg ; ->CONTINUE in GetHardwareInfo using old recognition method rb @foundCPUIDReg ; ENDIF + + cmpi.l #'Hnfo',([$68FFEFD0],$70) ; NKHWInfo.Signature, fix this later + bne.s @tryOldWay + import InfoNanoKernel + biglea InfoNanoKernel,a1 + bra Matched +@tryOldWay biglea CPUIDProductLookup-4,a2 ; get address of CPUID product lookup table @MatchLoop ; LOOP (through product info entries to match CPU ID) addq.w #4,a2 ; bump to next entry @@ -1217,10 +1100,6 @@ GetHardwareInfo btst #11,d0 ; is the complete CPU ID in the CPUID register? beq Matched ; -> yes, we've got it - cmpi.b #PrattDecoder,\ ; IF Decoder is a Pratt THEN - DecoderKind(a1) ; Found Match - beq Matched ; { For Now just handle one case } - movea.l DecoderInfoPtr(a1),a0 ; get the pointer to this machine's decoder table adda.l a1,a0 move.l DefaultBases(a0),d0 ; and get the default bases flags @@ -1271,7 +1150,7 @@ GetHardwareInfo movea.l a3,a2 ; restore our place in the table bra.s @MatchLoop ; go look for another candidate to check Matched ; END - bra.s FoundMatch ; yea!!! rb + bra.s FoundMatch ; yea!!! rb UnknownCPU bra.s UnknownCPU ; Ack! @@ -1280,19 +1159,137 @@ UnknownCPU bra.s UnknownCPU ; Ack! HasNoCPUIDReg ; fall through to @MatchLoop tst.b d2 ; check address decoder kind - beq.s FindDecoder ; if unknown decoder, search for it. + beq FindDecoder ; if unknown decoder, search for it. ; The ProductKind and DecoderKind are setup in D2, find the matching ProductInfo record. biglea ProductLookup-4,a0 ; point before the first product to check for @MatchLoop addq.w #4,a0 ; point to next product to check for move.l (a0),d0 ; see if end of list reached - beq.s FindDecoder ; if end, look start over, looking for decoder first + beq FindDecoder ; if end, look start over, looking for decoder first lea (a0,d0.l),a1 ; a1 := pointer to ProductInfo record cmp.w ProductKind(a1),d2 ; see if product and decoder match bne.s @MatchLoop ; if not, keep searching FoundMatch + Move.L BasesValid1(A1), D0 + BTst.L #$1E, D0 + BEQ @skipAllThis + MoveA.L ([$68FFEFD0],$8), A0 ; NKHWInfo.UniversalInfoTableBase + Move.B $12(A1), D0 + Move.B D0, $12(A0) + Move $14(A1), D0 + Move D0, $14(A0) + Move.B $16(A1), D0 + Move.B D0, $16(A0) + Move $10(A1), D0 + Or D0, $10(A0) + MoveA.L (A0), A2 + AddA.L A0, A2 + Move.L $24(A1), D0 + Or.L D0, $24(A0) + Or.L D0, -$1C(A2) + Move.L $28(A1), D0 + Or.L D0, $28(A0) + Or.L D0, -$18(A2) + Move.L $2C(A1), D0 + Or.L D0, $2C(A0) + Or.L D0, -$14(A2) + MoveA.L A1, A2 + SubA.L A0, A2 + Move.L A1, D0 + MoveA.L $8(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $8(A0) + MoveA.L D0, A1 + MoveA.L $4(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $4(A0) + MoveA.L D0, A1 + MoveA.L $C(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $C(A0) + MoveA.L D0, A1 + MoveA.L $38(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $38(A0) + MoveA.L D0, A1 + MoveA.L $3C(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $3C(A0) + MoveA.L D0, A1 + MoveA.L $40(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $40(A0) + MoveA.L D0, A1 + MoveA.L $44(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $44(A0) + MoveA.L D0, A1 + MoveA.L $48(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $48(A0) + MoveA.L D0, A1 + MoveA.L $4C(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $4C(A0) + MoveA.L D0, A1 + MoveA.L $50(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $50(A0) + MoveA.L D0, A1 + MoveA.L $64(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $64(A0) + MoveA.L D0, A1 + MoveA.L $5C(A1), A1 + Tst.L A1 + BEQ.B (* + $4) + AddA.L A2, A1 + Move.L A1, $5C(A0) + MoveA.L D0, A2 + MoveA.L A2, A1 + Move.B $68(A1), D0 + Move.L D0, $68(A0) + MoveQ.L #$0, D0 + Move ([$68FFEFD0],$76), D0 ; NKHWInfo.CPU_ID + Move D0, $58(A0) + biglea CPUIDProductLookup,a2 + Lea.L $8(A2), A2 + Tst.L (A2) + BEQ.B @is_single_entry_table + Cmp.L (A2), D0 + BNE.B (* + -$A) + Move.L $4(A2), D0 + Bra.B @common_path +@is_single_entry_table + Move.L $60(A1), D0 +@common_path + Move.L D0, $60(A0) + MoveA.L A0, A1 +@skipAllThis movea.l DecoderInfoPtr(a1),a0 ; get offset to DecoderInfo record adda.l a1,a0 ; make it absolute @@ -1331,39 +1328,16 @@ MapFound movea.l d0,a2 ; now save return address in A2 and.l VIAIdMask(a1),d0 ; mask them cmp.l VIAIdMatch(a1),d0 ; see if they match bne.s @MatchLoop ; if not, try the next product - bra.s FoundMatch ; if found, return the info + bra FoundMatch ; if found, return the info CheckBases move.l DefaultBases(a0),d0 ; get the default base flags movea.l a6,a0 ; save return address - btst.l #RBVExists,d0 ; see if RBV might be allowed - beq.s @RBVDone ; if not, don't test for one - movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l RBVAddr(a1,a2.l),a2 - lea RvIER(a2),a2 ; base address of RBV VIER register - bsr6 TestForRvIER ; see if RBV exists - beq.s @RBVDone ; if found, has RBV and VDAC - bclr.l #RBVExists,d0 ; no RBV, clear the bit - bclr.l #VDACExists,d0 ; if no RBV, then assume no VDAC either -@RBVDone - - bclr.l #VIA2Exists,d0 ; see if VIA2 might be allowed + bclr.l #VIA2Exists,d0 beq.s @VIA2Done ; if not, don't test for one movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l VIA2Addr(a1,a2.l),a2 ; get VIA2 base address - - IF hasPSC THEN ; rb - btst.l #PSCExists, D0 ; do we have PSC? rb, start - Beq.s @noPSC ; no, do horror style VIA2 init - - - lea PSCVIA2IER(a2),a2 ; base address of PSC VIA2 VIER register - Bra.s @gotVIA2 - -@noPSC ; - ENDIF ; rb - + movea.l VIA2Addr(a1,a2.l),a2 lea VIER(a2),a2 ; base address of VIA2 VIER register @gotVIA2 ; rb, end bsr6 TestForVIER ; see if VIA2 exists @@ -1371,31 +1345,6 @@ CheckBases bset.l #VIA2Exists,d0 ; has VIA2, set the bit @VIA2Done - IF hasIopSwim THEN ; rb - bclr.l #SWIMIOPExists,d0 ; see if SWIMIOP might be allowed - beq.s @SWIMIOPDone ; if not, don't test for one - movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l SWIMIOPAddr(a1,a2.l),a2 - bsr6 TestForIOP ; see if SWIM IOP exists - bne.s @SWIMIOPDone ; if not found, has regular IWM - bclr.l #IWMExists,d0 ; no regular IWM, clear the bit - bset.l #SWIMIOPExists,d0 ; has SWIMIOP, set the bit -@SWIMIOPDone - ENDIF ; rb - - IF hasIopScc THEN ; rb - bclr.l #SCCIOPExists,d0 ; see if SCCIOP might be allowed - beq.s @SCCIOPDone ; if not, don't test for one - movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l SCCIOPAddr(a1,a2.l),a2 - bsr6 TestForIOP ; see if SCC IOP exists - bne.s @SCCIOPDone ; if not found, has regular SCC - bset.l #SCCIOPExists,d0 ; has SCCIOP, set the bit - bclr.l #SCCrdExists,d0 ; no regular SCC, clear the bit - bclr.l #SCCwrExists,d0 ; no regular SCC, clear the bit -@SCCIOPDone - ENDIF ; rb - bclr.l #SCSIDMAExists,d0 ; see if SCSIDMA might be allowed beq.s @SCSIDMADone ; if not, don't test for one movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info @@ -1435,57 +1384,12 @@ CheckBases @SCSI96Done ENDIF ; rb - bclr.l #RPUExists,d0 ; see if RPU might be allowed - beq.s @RPUDone ; if not, don't test for one - movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l RPUAddr(a1,a2.l),a2 - bsr6 TestForRPU ; see if SCSI DMA exists - bne.s @RPUDone ; if not found, no parity chip - bset.l #RPUExists,d0 ; has SCSI DMA, set the bit -@RPUDone - movea.l a0,a6 ; restore return address movea.l a1,a0 ; get product info pointer adda.l DecoderInfoPtr(a0),a0 ; get decoder info pointer CheckOptionals move.l HwCfgWord(a1),d2 ; access hardware cfg flags <8> - btst.l #hwCbFPU+16,d2 ; should FPU be installed - beq.s FPUDone ; branch if it shouldn't be installed - movea.l a6,a2 ; save return address - bra TestForFPU ; see if FPU installed -FPUReturn movea.l a2,a6 ; restore return address - beq.s FPUDone ; branch if FPU found - bclr.l #hwCbFPU+16,d2 ; otherwise,clear FPU installed flag - -FPUDone - - bset.l #beok,d7 ; allow bus errors - movea.l a7,a5 ; mark the stack for bus error handler - - bclr.l #SonicExists,d0 ; see if Sonic might be allowed - beq.s @SonicDone ; if not, don't test for one - move.l a1,d1 ; save a1 - move.l SonicAddr(a0),a1 ; get Sonic Base Address - movea.l a6,a2 ; save return address - bsr6 TestForSonic ; see if Sonic exists - movea.l a2,a6 ; restore return address - move.l d1,a1 ; restore a1 - bne.s @SonicDone ; if not found, no Sonic chip - bset.l #SonicExists,d0 ; has Sonic, set the bit -@SonicDone - - bclr.l #PatchROMExists,d0 ; see if PatchRom might be allowed .start - beq.s @PatchROMDone ; if not, don't test for one - move.l a1,d1 ; save a1 - move.l PatchRomAddr(a0),a1 ; get PatchRom Base Address - movea.l a6,a2 ; save return address - bsr6 TestForPatchRom ; see if PatchRom exists - movea.l a2,a6 ; restore return address - move.l d1,a1 ; restore a1 - bne.s @PatchRomDone ; if not found, no PatchRom chip - bset.l #PatchRomExists,d0 ; has PatchRom, set the bit .end -@PatchROMDone ; External features checked after CheckOptionals so that d1 can be used as a scratch register CheckFeatures ; <11> @@ -1498,7 +1402,7 @@ CheckFeatures ; <11> ;_______________________________________________________________________ ; -; Routine: GetExtHardwareInfo +; Routine: GetExtHardwareInfo ab4e ; ; Inputs: A0 - Pointer to DecoderInfo record for this machine ; A1 - Pointer to ProductInfo record for this machine @@ -1538,32 +1442,6 @@ CheckExtBases1 move.l DefaultBases1(a0),d0 ; get the default base flags for #32-63 movea.l a6,a0 ; save return address -;--------------- -; Call "TestForÉ" routines here to verify devices for #32-63 -;--------------- -; begin fau -; See if we have a Muni - - btst.l #MuniExists-32,d0 ; see if MUNI might be allowed - beq.s @MuniDone ; if not, don't test for one - movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l (MUNIAddr,a1,a2.l),a2 ; get MUNI's base addresses - bsr6 TestForMUNI ; and go test for it - beq.s @MUNIDone ; if found, has MUNI - bclr.l #MUNIExists-32,d0 ; no MUNI, clear the bit -@MUNIDone - -; See if we have a BART - - btst.l #BartExists-32,d0 ; see if BART might be allowed - beq.s @BartDone ; if not, don't test for one - movea.l DecoderInfoPtr(a1),a2 ; get offset to decoder info - movea.l (BartAddr,a1,a2.l),a2 ; get BART's base addresses - bsr6 TestForBART ; and go test for it - beq.s @BartDone ; if found, has BART - bclr.l #BartExists-32,d0 ; no BART, clear the bit -@BartDone -; end fau movea.l a0,a6 ; restore return address movea.l a1,a0 ; get product info pointer adda.l DecoderInfoPtr(a0),a0 ; get decoder info pointer @@ -1929,7 +1807,7 @@ CheckForNiagra ;_______________________________________________________________________ ; -; Routine: CheckForUnknown +; Routine: CheckForUnknown aec6 ; Inputs: A0 - Pointer to DecoderInfo record for this decoder ; A1 - Pointer to next entry in DecoderLookup table ; A5, A7, D7, VBR - setup for bus error handler @@ -1952,7 +1830,7 @@ CheckForUnknown ;_______________________________________________________________________ ; -; Routine: TestForVIER, TestVIERWrap +; Routine: TestForVIER aeca, TestVIERWrap aecc ; Inputs: A2 - Address of the VIER register to test ; D2 - offset of alternate address to check for (wrap around) ; Used by TestVIERWrap, set to zero for TestForVIER. @@ -1986,10 +1864,12 @@ TestVIERWrap ; A2 := address of VIER register to test rol.w #8,d1 ; save it in the next byte st.b d1 ; test pattern := $FF move.b d1,(a2) ; set all bits of VIER + nop eieioSTP @loop neg.b d1 ; pattern of bit to clear eieioSTP move.b d1,(a2) ; clear the lowest order bit + nop add.b d1,d1 ; shift the test pattern beq.s @exit ; exit when all bits shifted out neg.b d1 ; convert to mask of bits that should be set @@ -2003,6 +1883,7 @@ TestVIERWrap ; A2 := address of VIER register to test @exit ror.w #8,d1 ; get saved VIER value eieioSTP move.b #$7F,(a2) ; prepare to restore (clear all bits) + nop eieioSTP move.b d1,(a2) ; restore original VIER value eieioSTP @@ -2011,196 +1892,7 @@ TestVIERWrap ; A2 := address of VIER register to test ;_______________________________________________________________________ ; -; Routine: TestForRvIER -; Inputs: A2 - Address of the RvIER register to test -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if not a valid RvIER register, or bus error. -; - 1 (beq) if valid RvIER register found. -; -; Destroys: D1, D2 -; Called by: BSR6 -; -; Function: Checks to see if the specified I/O register is a RBV IER -; (interrupt enable) register, by first setting all bits of -; the register, and then clearing each bit individually. -; There are some reserved bits in the RvIER register, which -; are ignored by this test. -; -;_______________________________________________________________________ - -TestForRvIER ; A2 := address of RvIER register to test - move.b (a2),d1 ; save old RvIER value - rol.w #8,d1 ; save it in the next byte - st.b d1 ; test pattern := $FF - eieioSTP - move.b d1,(a2) ; set all bits of RvIER -@loop - neg.b d1 ; pattern of bit to clear - eieioSTP - move.b d1,(a2) ; clear the lowest order bit - add.b d1,d1 ; shift the test pattern - beq.s @exit ; exit when all bits shifted out - neg.b d1 ; convert to mask of bits that should be set - eieioSTP - move.b (a2),d2 ; get the RvIER value - eor.b d1,d2 ; compare them - andi.b #$9F,d2 ; ignore the reserved bits - beq.s @loop ; if match found, keep testing -@exit ror.w #8,d1 ; get saved RvIER value - eieioSTP - move.b #$7F,(a2) ; prepare to restore (clear all bits) - eieioSTP - move.b d1,(a2) ; restore original RvIER value - eieioSTP - lsr.w #8,d1 ; 0 if RvIER found - rts6 - -;_______________________________________________________________________ -; -; Routine: TestForSCC -; Inputs: A2 - Base write address of the SCC to test for. -; D2 - offset to SCC read base address from write base -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if SCC not found, or bus error. -; - 1 (beq) if valid SCC found. -; -; Destroys: D1 -; Called by: BSR6 -; -; Function: Checks to see if the specified I/O registers point to an -; SCC. The read and write addresses may be specified separatly -; since some address decoders require this. An SCC is detected -; by writing a two byte signature to the time constant register -; and reading it back. The old value is saved and restored to -; make this test non-destructive. In order to meet SCC timing -; requirements on systems like the Mac Plus that do not provide -; a hardware holdoff, extra delays are introduced between SCC -; accesses. -; -;_______________________________________________________________________ - -TestForSCC ; A2 := address of SCCrd - ; D2 := offset of SCCwr-SCCrd - eieioSTP - tst.b bCtl(a2,d2.l) ; reset register pointer to reg 0 - ror.b #8,d1 ; kill some time, non-destructive - - eieioSTP - move.b #13,bCtl(a2) ; point to register 13, time const high - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b bCtl(a2,d2.l),d1 ; save old time const high byte - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b #12,bCtl(a2) ; point to register 12, time const low - lsl.l #8,d1 ; make room for low byte, kill time - eieioSTP - move.b bCtl(a2,d2.l),d1 ; save old time const low byte - ror.b #8,d1 ; kill some time, non-destructive - - eieioSTP - move.b #13,bCtl(a2) ; point to register 13, time const high - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b #'G',bCtl(a2) ; load in signature high byte - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b #12,bCtl(a2) ; point to register 12, time const low - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b #'D',bCtl(a2) ; load in signature low byte - ror.b #8,d1 ; kill some time, non-destructive - - eieioSTP - move.b #13,bCtl(a2) ; point to register 13, time const high - lsl.l #8,d1 ; make room for byte, kill time - eieioSTP - move.b bCtl(a2,d2.l),d1 ; read back signature high byte - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b #12,bCtl(a2) ; point to register 12, time const low - lsl.l #8,d1 ; make room for byte, kill time - eieioSTP - move.b bCtl(a2,d2.l),d1 ; read back signature low byte - subi.w #'GD',d1 ; see if signature matched - ror.l #8,d1 ; setup to restore, kill some time - - eieioSTP - move.b #12,bCtl(a2) ; point to register 12, time const low - ror.l #8,d1 ; position saved low byte of time const - eieioSTP - move.b d1,bCtl(a2) ; restore original time const low byte - ror.b #8,d1 ; kill some time, non-destructive - eieioSTP - move.b #13,bCtl(a2) ; point to register 13, time const high - lsr.l #8,d1 ; get the high byte - eieioSTP - move.b d1,bCtl(a2) ; restore original time const high byte - - lsr.l #8,d1 ; test signature for match - rts6 ; all done - -;_______________________________________________________________________ -; -; Routine: TestForIOP -; Inputs: A2 - Base address of IOP to test for. -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if IOP not found, or bus error. -; - 1 (beq) if valid IOP found. -; -; Destroys: D1, D2 -; Called by: BSR6 -; -; Function: Checks to see if the specified I/O registers point to an -; IOP. Since the IOP chip generates it's own DSACK, a Bus -; Error may occur if it doesn't exist, which would cause this -; routine to return through the bus error handler, indicating -; that an IOP doesn't exist. If no bus errors occur, we -; verify that a long word read from the IOPRamData register -; causes the IOPRamAddr register to incement by 4. All of the -; IOP registers used are saved and restored, making this test -; non-destructive. -; -;_______________________________________________________________________ - -TestForIOP ; A2 := Base address of IOP to test - eieioSTP - move.b iopStatCtl(a2),d1 ; save status/ctl register value - moveq.l #(1< - eieioSTP - move.b d2,iopStatCtl(a2) ; enable register pointer incrementing - eieioSTP - tst.l iopRamData(a2) ; read and ignore 4 bytes of Ram - eieioSTP - move.w iopRamAddr(a2),d2 ; save updated Ram Address register value - eieioSTP - move.w d1,iopRamAddr(a2) ; restore Ram Address register value - subq.w #4,d2 ; back off the 4 byte increment - sub.w d1,d2 ; check for increment - swap d1 ; get status ctl reg - andi.b #-1-(1< rb, from Terror... ;_______________________________________________________________________ thru matching ; -; Routine: TestForSCSI96 +; Routine: TestForSCSI96 af06 ; Inputs: A2 - Base address of SCSI Port to test. ; A6 - return address ; A5, A7, D7, VBR - setup for bus error handler @@ -2266,195 +1958,9 @@ TestForSCSI96 ; A2 = Base address of SCSI port to test - ;_______________________________________________________________________ ; -; Routine: TestForRPU -; Inputs: A2 - Base address of RPU to test for. -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if RPU not found, or bus error. -; - 1 (beq) if valid RPU found. -; -; Destroys: D1,D2 -; Called by: BSR6 -; -; Function: Checks to see if the RPU (Ram Parity Unit) is present by writing -; to the WWP bit of the chip (the only r/w bit) and reading back, -; making sure bus capacitance doesn't make it look valid. -; -;_______________________________________________________________________ -TestForRPU ; - eieioSTP - tst.b (a2) ; x First 4 reads are unique - eieioSTP - tst.b (a2) ; x - eieioSTP - tst.b (a2) ; PDCA Read out the parity daisy chain bits - eieioSTP - tst.b (a2) ; PDCB and toss them (no where to save them) - - eieioSTP - st.b rpuReset(a2) ;reset the RPU serial pointer - eieioSTP - move.b (a2),d2 ;save the WWP bit - - eieioSTP - st.b rpuReset(a2) ;reset the RPU serial pointer - eieioSTP - st.b (a2) ;set the WWP bit - eieioSTP - clr.b rpuReset(a2) ;force bus low, reset pointer - moveq #1,d1 ;check bit 0 - eieioSTP - and.b (a2),d1 ;read WWP bit - seq.b d1 ;d1=FF if WWP bit was 0 - beq.s @exit ;exit if WWP bit=0 - - eieioSTP - st.b rpuReset(a2) ;reset the RPU serial pointer - clr.b (a2) ;clear the WWP bit - eieioSTP - st.b rpuReset(a2) ;force bus high, reset pointer - moveq #1,d1 ;check bit 0 - eieioSTP - and.b (a2),d1 ;read WWP bit - -@exit - eieioSTP - st.b rpuReset(a2) ;reset pointer for exit - move.b d2,(a2) ;restore WWP bit - tst.b d1 ;test result - eieioSTP - rts6 - -;_______________________________________________________________________ -; -; Routine: TestForMUNI -; Inputs: A2 - Address of the MUNI Control register to test -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if not a valid MUNI Control register, or bus error. -; - 1 (beq) if valid MUNI Control register found. -; -; Destroys: D1, D2 -; Called by: BSR6 -; -; Function: Checks to see if the specified MUNI Control register -; exists by writing to it and seeing if we get a bus error. -; If we do, then we have no MUNI. -; Since the MUNI chip generates it's own -; DSACK, a Bus Error may occur if it doesn't exist, which would -; cause this routine to return through the bus error handler, -; indicating that it doesn't exist. For now we just simply test -; to see if we can read the control register without getting -; a bus error. If we are successful, we assume that the chip -; exists. This test may need to be improved in the future. -; -; -;_______________________________________________________________________ - -TestForMUNI ; A2 := address of MUNI register to test - eieioSTP - tst.l MUNI_Control(a2) ; try to read the control register - eieioSTP - cmp.b d1,d1 ; if no bus error, assume that it exists - rts6 - - - -;_______________________________________________________________________ -; -; Routine: TestForBart -; Inputs: A2 - Address of BART -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if no BART, or bus error. -; - 1 (beq) if BART found. -; -; Destroys: D1, D2 -; Called by: BSR6 -; -; Function: Checks to see if BART exists by accessing it and seeing if -; we get a bus error. If we do, then we don't have a BART. This -; test should be extended in the future to check the version register -; in BART. -; -; -;_______________________________________________________________________ - -TestForBart ; A2 := address of BART register to test - eieioSTP - tst.b (a2) ; try to read BART - cmp.b d1,d1 ; if no bus error, assume that it exists - eieioSTP - rts6 - - - -; fau start -;_______________________________________________________________________ -; -; Routine: TestForFPU -; Inputs: A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if FPU not found. -; - 1 (beq) if FPU available. -; -; Destroys: A6, D1, sfc -; Called by: BRA -; -; Function: Checks to see if an FPU is installed. -; -; NOTE: this routine is BRA'nched to, not BSR6'ed, so that A6 is -; available for trashing in this routine. -; -; NOTE2: this needed to be changed because with an 040LC you're -; no longer guaranteed to have an on-board FPU. -;_______________________________________________________________________ -TestForFPU - - IF ROMinRAM THEN ; rb - movec CACR,d1 ; MacsBug does not like the fpu rb - cmp.b d1,d1 ; code when booting from RAM rb - bra FPUReturn ; rb - ELSE ; rb - -; New, Improved method of on-the-fly checking for and FPU - - movec VBR,d1 ; retrieve VBR - -; The idea is to move VBR DOWN the difference between the F-Line and -; BusError, so that if you were to execute an F-Line instruction and -; couldn't handle it, you would end up fetching the address of the -; BusErrVector and going thru the BusErrVector. The BusErr handler -; expects A6 to contain the address of where it should return TO. - - sub.l #Line1111-BusErrVct,d1; temporarily move VBR down - movec d1,VBR ; shuffle VBR for F-Line test - moveq #1,d1 ; non-zero value in D1 for later comparison - lea @noFPU,a6 ; where to come back to if you dont have an FPU - eieioSTP - FNOP ; execute suspect command - eieioSTP - clr.l d1 ; if you got here, you have an FPU - -@noFPU move.l d1,a6 ; save D1 - movec VBR,d1 ; return VBR to it's old value - add.l #Line1111-BusErrVct,d1 - movec d1,VBR ; ... so everyone is happy - move.l a6,d1 ; restore D1 - tst.b d1 ; return CCR.Z to CheckOptionals -@exit bra FPUReturn ; and return to CheckOptionals fau end - - ENDIF ; rb - -;_______________________________________________________________________ -; -; Routine: GetVIAInputs +; Routine: GetVIAInputs af12 ; Inputs: A0 - Pointer to Decoder Info record for this decoder ; D0 - DefaultBases flags for this decoder ; A6 - return address @@ -2495,6 +2001,7 @@ GetVIAInputs and.b AvoidVIA1A(a0),d1 ; if we need to avoid any output, don't make them input eieioSTP move.b d1,vDirA(a1) ; change bits to inputs + nop eieioSTP move.b vBufA(a1),d1 ; get port A inputs eieioSTP @@ -2514,6 +2021,7 @@ GetVIAInputs and.b AvoidVIA1B(a0),d1 ; if we need to avoid any output, don't make them input eieioSTP move.b d1,vDirB(a1) ; change bits to inputs + nop eieioSTP move.b vBufB(a1),d1 ; get port B inputs eieioSTP @@ -2539,6 +2047,7 @@ GetVIAInputs and.b AvoidVIA2A(a0),d1 ; if we need to avoid any output, don't make them input eieioSTP move.b d1,vDirA(a1) ; change bits to inputs + nop eieioSTP move.b vBufA(a1),d1 ; get port A inputs eieioSTP @@ -2558,6 +2067,7 @@ GetVIAInputs and.b AvoidVIA2B(a0),d1 ; if we need to avoid any output, don't make them input eieioSTP move.b d1,vDirB(a1) ; change bits to inputs + nop eieioSTP move.b vBufB(a1),d1 ; get port B inputs eieioSTP @@ -2569,69 +2079,9 @@ GetVIAInputs @noVIA2 rts6 ; all done -;_______________________________________________________________________ -; -; Routine: TestForSonic -; Inputs: A1 - Base address of Sonic to test. -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if Sonic not found, or bus error. -; - 1 (beq) if Sonic found. -; -; Destroys: none -; Called by: BSR6 -; -; Function: Checks to see if we have a Sonic Ethernet chip. An access to a non-existent -; address MUST cause us to BusError. -; -;_______________________________________________________________________ - -TestForSonic ; A1 = Base address of Sonic Chip to test - eieioSTP - tst.b (a1) ; try to read the Command Register - eieioSTP - bset #7,(a1) ; send a SW Reset to Sonic - eieioSTP - - cmp d1,d1 ; set ccr.z because no bus error if we made it here - - rts6 ; return with flags set - - -;_______________________________________________________________________ -; -; Routine: TestForPatchROM -; Inputs: A1 - Base address of PatchROM to test. -; A6 - return address -; A5, A7, D7, VBR - setup for bus error handler -; -; Outputs: ccr.z - 0 (bne) if PatchROM not found, or bus error. -; - 1 (beq) if PatchROM found. -; -; Destroys: a1 -; Called by: BSR6 -; -; Function: Checks to see if we have a PatchROM. An access to a non-existent -; address MUST cause us to BusError. -; -;_______________________________________________________________________ - -TestForPatchROM ; A1 = Base address of PatchROM to test - eieioSTP - tst.b (a1) ; try to read the first byte - eieioSTP - movea.l $4(a1),a1 ; load signature into a1 - eieioSTP - exg a1,d1 ; because we have no free registers - cmpi.l #'romp',d1 ; set ccr.z if signtures match - exg a1,d1 ; because we have no free registers - rts6 ; return with flags set - - ;__________________________________________________________________________________________________ ; -; Routine: GetCPUIDReg +; Routine: GetCPUIDReg afb4 ; ; Inputs: A6 - return address ; A5, A7, D7, VBR - setup for bus error handler @@ -2662,198 +2112,17 @@ TestForPatchROM ; A1 = Base address of PatchROM to test IF hasCPUIDRegister THEN ; rb rb GetCPUIDReg - IF ROMinRAM THEN ; rb - move.l #$A55A2830,d0 ; ¥¥¥ HACK, force Cyclone, make your rb - cmp.w d0,d0 ; ModifyReadOnly hack here. Cyclone rb - jmp (a6) ; needs this because the MMU is rb - ENDIF ; hiding the CPUIDReg one we booted rb - - - - IF forSmurf THEN - - ; Read the CPUID bits from the via register. Orwells/djmemc both have - ; via addrs at $50F0000 (but for smurfs, use $50000000) - - - movea.l #$50000000,a2 ; get the VIA1 base address - - ;now get the cpuid bits from the via register - move.b vBufA(a2),d2 ; save port A - lsl.w #8,d2 ; make room for direction bits - move.b vDirA(a2),d2 ; save direction bits - move.b d2,d1 ; get prior direction bits - move.b #0,vDirA(a2) ; change bits to inputs - move.b vBufA(a2),d1 ; get port A inputs - move.b d2,vDirA(a2) ; restore direction bits - lsr.w #8,d2 ; get saved port A - move.b d2,vBufA(a2) ; restore port A - - ; d1.b now contains the cpuid bits. so use $56 to mask out leaving us with the - ; cpuid bits PA6, PA4, PA2, PA1 - - andi.b #$56,d1 ; d1.b now contains the cpu id bits from the via - - ; now find out if we are on a machine with a djmemc decoder or and orwell. - ; djmec have a 12 bit register, bits 11..9 contain the version number for the djmemc... - ; Game Plan: read from the 12 bit register. if bits 11..9 = 010 then djmec - - lea #MEMCAddr,a2 ; Orwell or djmec decoder addr. - - move.l MEMCIntleaveEnable(a2),d0 ; read the 12 bit register at the base of DJMEMC/Orwell - andi.w #$0E00,d0 ; mask out all bits except version bits at bit 11..9 - cmpi.w #$0200,d0 ; the version number for djmec is 010 for bits 11..9 - - beq.s @tryCentris610 ; if equal than on djmec machine..via id bits will match - ; those for wombat machines -@tryQ700 - cmpi.b #$40,d1 ; is it a quadra700 - bne.s @tryQ900 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1235,D0 ; return emulator CPU ID - BRA @success -@tryQ900 - cmpi.b #$50,d1 ; is it a quadra900 - bne.s @tryQ950 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1236,D0 ; return emulator CPU ID - BRA @success -@tryQ950 ; if here it must be Q950 - - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1237,D0 ; return emulator CPU ID - BRA @success - - -@tryCentris610 - cmpi.b #$40,d1 ; is it a Centris610? - bne.s @tryCentris650 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1204,D0 ; return emulator CPU ID - BRA @success - -@tryCentris650 - cmpi.b #$46,d1 ; is it a Centris650? - bne.s @tryQ800 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1200,D0 ; return emulator CPU ID - BRA @success -@tryQ800 - cmpi.b #$12,d1 ; is it a Quadra800? - bne.s @tryQ610 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1201,D0 ; return emulator CPU ID - BRA @success - -@tryQ610 - cmpi.b #$44,d1 ; is it a Quadra610? - bne.s @tryQ650 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1202,D0 ; return emulator CPU ID - BRA @success - -@tryQ650 ;if here assume Smurf card is in Q650 - MOVE.W #(cpuIDRISC)|\ ; CPU ID: RISC design center - $1203,D0 ; return emulator CPU ID - BRA @success - - - ENDIF ; forSmurf - - LEA CPUIDReg,A2 ; Get CPU ID reg address - - ; FIRST - try to read it as a LONG. , - MOVE.L (A2),D0 ; read the register (bus err if it doesn't exist) - MOVEQ #0,D1 ; clear pattern register -@FlipBits ; LOOP (to write different patterns in CPUID reg) - MOVE.L D1,(A2) ; write next pattern to CPUID register location - CMP.L (A2),D0 ; does it read back the same as the first time? - BNE.S @tryPDMIDReg ; -> no. try reading it the other way. - NOT.L D1 ; flip the bits in the write pattern - BNE.S @FlipBits ; -> try the next write pattern - SWAP D0 ; look at the signature - CMPI.W #cpuIDSig,D0 ; is it a valid signature? - BNE.S @tryPDMIDReg ; -> no. try reading it the other way. - SWAP D0 ; look at the decoder-specific stuff - bra @success ; yay, we're done. - -@tryPDMIDReg ; SECOND - see if it's a byte-wide only reg (like on PDM) - move.b (a2), d0 ; read high byte (bus err if it doesn't exist) - move.b #$6a, (a2) ; write/read to be sure it's really there - cmp.b (a2), d0 ; match previous read? - bne @noCPUIDReg ; no. must not really be the CPUID reg. - lsl.l #8, d0 ; shift high byte over - - move.b 1(a2), d0 ; read next byte - move.b #$6f, 1(a2) ; write/read to be sure it's really there - cmp.b 1(a2), d0 ; match previous read? - bne @noCPUIDReg ; no. must not really be the CPUID reg. - lsl.l #8, d0 ; shift next byte over - - move.b 2(a2), d0 ; read next byte - move.b #$65, 2(a2) ; write/read to be sure it's really there - cmp.b 2(a2), d0 ; match previous read? - bne @noCPUIDReg ; no. must not really be the CPUID reg. - lsl.l #8, d0 ; shift next byte over - - move.b 3(a2), d0 ; read last byte - move.b #$20, 3(a2) ; write/read to be sure it's really there - cmp.b 3(a2), d0 ; match previous read? - bne @noCPUIDReg ; no. must not really be the CPUID reg. - - swap d0 ; check the signature - cmpi.w #cpuIDSig, d0 ; is it valid? - bne @noCPUIDReg ; nope, exit with Z cleared. - swap d0 ; yay! we're probably a PDM! (how cool if we are.) - - cmpi.w #$3010, d0 ; could we be an EVT2 but don't know it? - bne @success ; nope - - move.b $50F32008, d1 ; read SCSI DMA ctl reg - movea.w d1, a2 ; remember the original setting - ori.b #$0C, d1 ; poke the extra bits - move.b d1, $50F32008 ; save the updated value - nop - move.b $50F32008, d1 ; read SCSI DMA ctl reg again - andi.b #$0C, d1 ; did they stick? - beq.s @success ; nope, don't dick with the CPUID - - move.w a2, d1 ; restore the original setting - move.b d1, $50F32008 - nop - -@ck4FastSCSI - move.b #$02, $50f11030 ; do cResetChip cmd - nop - move.b #$00, $50f11030 ; cNOP required after HW or SW reset - - move.b #$40, $50f110b0 ; turn on Features enable then, - move.b #$80, $50f11030 ; send a DMA NOP command then, - nop - cmp.b #$A2, $50f110e0 ; read the SCSI chip ID - an FC96? - beq.s @isFastSCSI ; yes -> we have Fast SCSI (i.e. we're on a Cold Fusion) - -@noFastSCSI - move.b #$02, $50f11030 ; cResetChip again - nop - move.b #$00, $50f11030 ; cNOP required after HW or SW reset - - move.b #$11, d0 ; we're an AMIC2 - change CPUID to $3011 - bra.s @success ; - -@isFastSCSI - move.b #$02, $50f11030 ; cResetChip again - nop - move.b #$00, $50f11030 ; cNOP required after HW or SW reset - - move.b #$13, d0 ; we're a Cold Fusion - change CPUID to $3013 - -@success - IF forSTP601 THEN - ori.w #(cpuIDRISC),d0 - ENDIF - CMP.W D0,D0 ; set ccr.z to indicate success -@noCPUIDReg JMP (A6) ; END + move.l ([$68FFEFD0],$70),d0 ; NKHWInfo.Signature + cmpi.l #'Hnfo',d0 + bne.s @noHnfo + move ([$68FFEFD0],$76),d0 ; NKHWInfo.CPU_ID + bra @eq +@noHnfo + bra.s @ne +@eq + cmp d0,d0 +@ne + rts6 ENDIF ; rb end diff --git a/OS/VerticalRetraceMgr.a b/OS/VerticalRetraceMgr.a index 25a2c1d..ea70f78 100644 --- a/OS/VerticalRetraceMgr.a +++ b/OS/VerticalRetraceMgr.a @@ -86,7 +86,7 @@ VBLCore proc export ;_______________________________________________________________________ ; -; Trap: _VINSTALL +; Trap: _VINSTALL bb40 ; ; Arguments: A0 (input) : address of vertical retrace control block ; D0 (output): error code - 0 no error @@ -115,7 +115,18 @@ VBLCore proc export ; Registers Used: D0,D1,D2,A0,A1 <30Apr85> ;_______________________________________________________________________ -VInstall lea VBLQueue,a1 ; get address of queue <1.4> +VInstall + + lea VBLQueue+2,a1 +@loop move.l (a1),d1 + beq.s @dontflunk + move.l d1,a1 + cmp.l a0,a1 + bne.s @loop + moveq.l #0,d0 + rts + +@dontflunk lea VBLQueue,a1 ; get address of queue <1.4> VInstallCommon ; common code shared with SlotVInstall cmpi.w #vType,VBLType(a0) ; is it the proper type? @@ -159,7 +170,7 @@ VTypeError moveq.l #VTypErr,d0 ; flag the error ;_______________________________________________________________________ ; -; The VREMOVE trap routine removes a vertical retrace control block from the +; The VREMOVE bba2 trap routine removes a vertical retrace control block from the ; VBL queue. On entry, A0 points to the control block. D0 returns the error ; code; all other registers are preserved. ; @@ -177,7 +188,7 @@ AnRTS rts ; return Dequeue error code ;_______________________________________________________________________ <1.3> ; -; we put the code for the VBL interrupt handler next +; we put the code for the VBL interrupt handler next bbb8 ; ; NOTE: This handler expects that the interrupt is still pending, and clears ; it by clearing the CA1 interrupt flag on VIA 1 (base address passed @@ -199,6 +210,7 @@ PseudoVBLInt VBLInt eieioSTP move.b #1< @@ -332,7 +367,7 @@ SlotVInstall ;_______________________________________________________________________ ; -; Trap: _SlotVRemove +; Trap: _SlotVRemove bc76 ; ; Arguments: A0 (input) : address of vertical retrace control block ; D0 (input) : video card slot ($0..$E possible) @@ -353,7 +388,7 @@ SlotVRemove bsr.s GetSlotVBLQHdr ; find the VBL Queue for the slot ;_______________________________________________________________________ ; -; Trap: _AttachVBL +; Trap: _AttachVBL bc86 ; ; Arguments: D0 (input) : new video card slot for system VBL ($0..$E possible) ; D0 (output): error code @@ -371,7 +406,7 @@ AttachVBL bsr.s GetSlotVBLQHdr ; find the VBL Queue for the slot ;_______________________________________________________________________ ; -; Trap: _DoVBLTask +; Trap: _DoVBLTask bc90 ; ; Arguments: D0 (input) : video card slot ($0..$E possible) ; D0 (output): error code @@ -406,7 +441,7 @@ DoVBLTask bsr.s GetSlotVBLQHdr ; find the VBL Queue for the slot ;_______________________________________________________________________ ; -; Routine: InitVBLQs +; Routine: InitVBLQs bcae ; ; Arguments: none ; @@ -415,7 +450,7 @@ DoVBLTask bsr.s GetSlotVBLQHdr ; find the VBL Queue for the slot ; Registers Used: A0 ;_______________________________________________________________________ -InitVBLQs LEA DoVBLTask,A0 ; and save hook to +InitVBLQs LEA.L DoVBLTask,A0 ; and save hook to MOVE.L A0,JVBLTask ; VBL task execute routine CLR.L ScrnVBLPtr ; init main screen ptr save global RTS ; exit to caller diff --git a/Patches/MiscPatches.a b/Patches/MiscPatches.a index 55e0901..c869fdc 100644 --- a/Patches/MiscPatches.a +++ b/Patches/MiscPatches.a @@ -155,6 +155,8 @@ include 'fontPrivate.a' ; include 'universalEqu.a' include 'PowerPrivEqu.a' + include 'Processes.a' + include 'TextServices.a' PwrCycCount EQU $AA ; <1> @@ -168,7 +170,7 @@ PwrCycCount EQU $AA ; <1> ;___________________________________________________________________________________ ; -; Routine: SynchIdleTime +; Routine: SynchIdleTime bcc0 ; ; Inputs: none ; @@ -243,25 +245,52 @@ SynchIdleTimeProc PatchProc _SynchIdleTime _PPC ; PPC trap WITH PMgrRec,PowerDispRec ; - BRA.S @Done ; branch always because we are SM ROM - Testfor hwCbPwrMgr ; do we have a power manager? + BTST.B #0,$DD5 BEQ.S @Done ; no power cycling - MOVE.L PMgrBase,A0 ; Get the Power Manager Globals - MOVE.W PwrCycSyncCount(A0),D0 ; Get the number of syncIdle before IdleMind - ADDI.W #1,PMgrScratch.SyncCounter(A0) ; Increment scratch counter - CMP.W PMgrScratch.SyncCounter(A0),D0 ; Have we done enough SyncIdles - BLT.S @Done - CLR.W PMgrScratch.SyncCounter(A0) ; reset counter MOVEQ #IdleMindDisp,D0 ; Set the selector to IdleMind _PowerDispatch @Done - rts + + BTst.B #$1, ($2409) + BEQ.B @skipDriverCall + IMPORT PMIdleRelatedDriverCall + MACHINE MC68030 + Bsr.L PMIdleRelatedDriverCall +@skipDriverCall + + MoveA.L ([$2B6],$288), A0 + Move.L A0, D0 + BEQ.B @return + MoveM.L D1-D3/A1-A2, -(A7) + Move $6(A0), D1 + MoveQ.L #$0, D2 + +@loop MoveA.L $14(A0,D2.L), A1 + Move.L A1, D0 + BEQ.B @continue + Move $C8(A1), D0 + Clr D3 + Cmp D3, D0 + BEQ.B @continue + MoveA.L $C4(A1), A2 + Move.L A2, D0 + BEQ.B @continue + Jsr (A2) + Bra.B @exit +@continue AddQ #$4, D2 + SubQ #$1, D1 + BNE.B @loop + +@exit MoveM.L (A7)+, D1-D3/A1-A2 + +@return Rts + ENDPROC ; SynchIdleTimeProc ;___________________________________________________________________________________ ; -; Routine: InitApplication <1.6> +; Routine: InitApplication bd40 <1.6> ; ; Inputs: none ; @@ -314,30 +343,48 @@ CleanupApp PatchProc _CleanupApplication MOVE.L applZone,A0 ; point to zone hdr MOVE.L A0,-(SP) ; push start ptr MOVE.L (A0),-(SP) ; push zone trailer - _sbKillSomeCaches + MOVE.W #sbKillSomeCaches,D0 + _SplineMgr ; like _sbKillSomeCaches but with non-quick move ADDQ #4,SP ; ignore result - IF hasCommToolbox THEN - ; - ; Clean up CommToolbox if necessary - ; - import CleanUpCommToolbox - JSR CleanupCommToolbox - ENDIF - IF hasEditionMgr THEN ; <36> - ; - ; Check if app was doing Edition Manager stuff that needs cleaning up - ; - MOVE.L ExpandMem, A0 ; get expanded memory area - MOVE.L ExpandMemRec.emDataPub(A0), D0 ; get dp globals - BEQ.S @noEditionMgr ; if not allocated, no need to do cleanup - SUBQ #2,SP ; place holder for result - _QuitEditionPack ; call pack11 clean up - TST.W (SP)+ ; ignore result -@noEditionMgr - ENDIF - + MoveA.L ExpandMem, A0 + MoveA.L $64(A0), A0 + + Tst.L $70(A0) + BEQ.B @skipAll + + SubQ #$8, SP + Clr -(SP) + Pea.L $2(SP) + + _GetCurrentProcess + + Tst (SP)+ + BNE.B @dont + + Clr -(SP) + Pea.L $2(SP) + Clr -(SP) + + _InlineAware + + Tst.B (SP)+ + BEQ.B @dont + + Clr -(SP) + Move #$2, -(SP) + Pea.L $4(SP) + + Move #$16, D0 + _TSMDispatch + AddQ #$2, SP +@dont + + AddQ #$8, SP +@skipAll + + ; ; Clean up Compoents and Component insetances belong to this app. ; @@ -346,10 +393,8 @@ CleanupApp PatchProc _CleanupApplication ; ; Clean up the Palette Manager if there is one. ; - CMP.W #$3FFF,ROM85 ; do we have color QD? - BHI.S @noPMgrExit - _PMgrExit -@noPmgrExit + MOVE.W #selectPMgrExit,D0 ; _PMgrExit + _PaletteDispatch ; ; Clean up Sound Manager @@ -409,107 +454,5 @@ CleanupApp PatchProc _CleanupApplication ENDPROC ; CleanupApp -;___________________________________________________________________________________ -; -; FUNCTION get70MgrAttr(selector : OSType; VAR response : LONGINT) : OSErr; -; -; Generic Gestalt function for testing for existence of System 7.0 -; features. Since this patch is for 7.0 only, it always returns 1 in the -; response. If your particular feature requires more bits set in the -; response, don't use this routine. Currently, this is the function -; for the gestaltDBAccessMgrAttr and gestaltEditionMgrAttr selectors. -; -; Registers A0 and A1 are destroyed. -; -;___________________________________________________________________________________ - -get70MgrAttr PROC - - MOVE.L (SP)+,A0 ; return address - MOVE.L (SP)+,A1 ; address of result - - MOVE.L #1,(A1) ; 7.0 features always under 7.0! - - ADDA.W #4,SP ; pop the selector type - MOVE.W #noErr,(SP) ; it always works - JMP (A0) - - ENDPROC ; get70MgrAttr - - - -;___________________________________________________________________________________ -; -; Additional patch code goes here -; -;___________________________________________________________________________________ - -;___________________________________________________________________________________ -; -; dimg entry - Dictionary Manager -; -;___________________________________________________________________________________ - -DictionaryDispatch PatchProc _DictionaryDispatch - -DictionaryHandle EQU ExpandMemRec.emDictionaryMgrPackHandle -DictionaryUseCount EQU ExpandMemRec.emDictionaryMgrUseCount - - MOVE.L ExpandMem,A1 ; get expand mem into A1 - MOVE.L DictionaryHandle(A1),A0 ; move the handle to the code into A0 - ADD.W #DictionaryUseCount,A1 ; A1 = pointer to use count - _ProcHelper ; let ProcHelper take over - - ENDPROC ; DictionaryDispatch - -;___________________________________________________________________________________ -; -; Install Gestalt functions for gestaltDBAccessMgrAttr, gestaltEditionMgr, -; gestaltStandardFileAttr, and gestaltAppleEventsAttr -; -; !!!! all just return 1 for system 7.0 !!!!! -; -;___________________________________________________________________________________ - -MiscPatchesInstall InstallProc - - IMPORT get70MgrAttr - - IF hasDataAccessMgr THEN ; <37> - MOVE.L #gestaltDBAccessMgrAttr, D0 ; Data Access Manager - lea get70MgrAttr, A0 - _NewGestalt - ENDIF - - - IF hasEditionMgr THEN ; <37> - MOVE.L #gestaltEditionMgrAttr, D0 ; Edition Manager - lea get70MgrAttr, A0 - _NewGestalt - ENDIF - - MOVE.L #gestaltStandardFileAttr, D0 ; Standard File - leaResident get70MgrAttr, A0 - _NewGestalt - - IF hasAppleEventMgr THEN ; <37> - MOVE.L #gestaltAppleEventsAttr, D0 ; AppleEvent Manager - lea get70MgrAttr, A0 - _NewGestalt - ENDIF - -;___________________________________________________________________________________ -; Gestalt function for the dictionary manager. -; just returns 1 for CubeE -;____________________________________________________________________________________ - MOVE.L #gestaltDictionaryMgrAttr, D0 ; Dictionary Manager - lea get70MgrAttr, A0 - _NewGestalt - - - RTS - - ENDPROC - END ; of file \ No newline at end of file diff --git a/QuickDraw/ColorQD.make b/QuickDraw/ColorQD.make index a2c059b..bca464a 100644 --- a/QuickDraw/ColorQD.make +++ b/QuickDraw/ColorQD.make @@ -28,8 +28,8 @@ CQDObjs = "{ObjDir}CheckDevicesINIT.a.o" Rez {StdROpts} -o "{Targ}" "{ColorQDDir}CQD.r" -i "{QDPatchesDir}" -"{LibDir}CQD.lib" Ä {CQDObjs} - Lib {StdLibOpts} -o "{Targ}" {CQDObjs} +# "{LibDir}CQD.lib" Ä {CQDObjs} +# Lib {StdLibOpts} -o "{Targ}" {CQDObjs} "{ObjDir}CheckDevicesINIT.a.o" Ä "{ColorQDDir}CheckDevicesINIT.a" diff --git a/Toolbox/AliasMgr/AliasMgr.make b/Toolbox/AliasMgr/AliasMgr.make index c79f535..3c71c83 100644 --- a/Toolbox/AliasMgr/AliasMgr.make +++ b/Toolbox/AliasMgr/AliasMgr.make @@ -20,8 +20,8 @@ AliasMgrObjects = "{ObjDir}alDlogUtil.a.o" "{ObjDir}FolderMgr.a.o" -"{LibDir}AliasMgr.lib" Ä {AliasMgrObjects} - Lib {StdLibOpts} -o "{Targ}" {AliasMgrObjects} +# "{LibDir}AliasMgr.lib" Ä {AliasMgrObjects} +# Lib {StdLibOpts} -o "{Targ}" {AliasMgrObjects} "{ObjDir}alDlogUtil.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/Toolbox/ComponentMgr/ComponentMgr.make b/Toolbox/ComponentMgr/ComponentMgr.make index 2b32c2f..32316ba 100644 --- a/Toolbox/ComponentMgr/ComponentMgr.make +++ b/Toolbox/ComponentMgr/ComponentMgr.make @@ -22,8 +22,8 @@ ComponentMgrObjects = "{ObjDir}ThingManagerDispatcher.a.o" "{ObjDir}ThingSearch.c.o" ¶ "{ObjDir}ThingFiles.c.o" ¶ -"{LibDir}ComponentMgr.lib" Ä {ComponentMgrObjects} - Lib {StdLibOpts} {ComponentMgrObjects} -o "{Targ}" +# "{LibDir}ComponentMgr.lib" Ä {ComponentMgrObjects} +# Lib {StdLibOpts} {ComponentMgrObjects} -o "{Targ}" "{ObjDir}ThingManagerDispatcher.a.o" Ä "{ComponentMgrDir}ThingManagerDispatcher.a" ¶ diff --git a/Toolbox/ControlMgr/ControlMgr.a b/Toolbox/ControlMgr/ControlMgr.a index 3bb9d69..d55a93d 100644 --- a/Toolbox/ControlMgr/ControlMgr.a +++ b/Toolbox/ControlMgr/ControlMgr.a @@ -255,6 +255,7 @@ CMGR PROC EXPORT ; External Routines used by Control Manager ; IMPORT GetNewRgn + IMPORT FlushCRange ; ; FUNCTION NewControl( window: windowPtr; @@ -302,8 +303,6 @@ NewControl MOVE.L A0,(A4) ;also, its the function result MOVE.L (A3),A2 ;handle -> pointer - TST.B MMU32Bit ; are we in 32-bit mode? DAF - BEQ.S @1 ; nope, so continue DAF SF.B contrlVis(A2) ; set this temporarily, so SetCtlColor won't try to draw DAF MOVE.L A3,-(SP) ; push controlHandle DAF MOVE.L #-1,-(SP) ; push -1 to make a new rec with default CTab DAF @@ -371,8 +370,6 @@ GetCDefProc MOVE.W (A4),D0 ;get resource ID AND #$000F,D0 ;use only low 4 bits - TST.B MMU32Bit ; is it in 32-bit mode? DAF - BEQ.S @1 ; nope, so hide in hi-byte DAF MOVE.L A0,-(SP) ; save A0 DAF MOVE.L D0,-(SP) ; save D0 too DAF SUBQ #6,SP ; get placeholder for auxCtlHndl, and boolean result DAF @@ -385,10 +382,7 @@ GetCDefProc MOVE.L (SP)+,D0 ; restore D0 (with variant) DAF MOVE.B D0,acReserved(A0) ; put variant in auxRec DAF<1.6> MOVE.L (SP)+,A0 ; restore A0 DAF - BRA.S @2 ; all done DAF -@1 - MOVE.B D0,(A0) ;keep in high byte of handle -@2 + ADDQ #4,A0 ;bump to next field CLR.L (A0)+ ;init dataHandle @@ -470,9 +464,7 @@ CallControl MOVE.W (SP)+,10(SP) ; move from top of stack to placeholder DAF MOVE.L (A3),A0 ;get pointer to control structure - MOVE.L ContrlDefHandle(A0),D0 ;get handle of controlProc DAF - _StripAddress ;clean variant code out of hi byte DAF - MOVE.L D0,A0 ;copy to an A-reg DAF + MOVE.L ContrlDefHandle(A0),A0 ;get handle of controlProc DAF TST.L (A0) ;needs reloading? BNE.S SkipCLoad ;if not,skip @@ -497,7 +489,12 @@ SkipCLoad _GetHandleSize ; How big is our CDEF Handle fau cmp.l #32,D0 ; Is it "small" chp bhi.s @RealCDEF ; no, don't flush the cache fau - jsr ([jCacheFlush]) ; else, flush the caches. fau + move.l A0,-(SP) + move.l (A0),A0 + move.l D0,A1 + bsr.l FlushCRange ; else, flush the caches. fau + move.l (SP)+,A0 + @RealCDEF ; fau _HLock ; lock it down MOVE.L (A0),A0 ;get cDefProc ptr @@ -527,8 +524,6 @@ NoDControl GetCVariant ; DAF MOVE.L 4(SP),A0 ; get ctl handle - TST.B MMU32Bit ; are we in 32-Bit mode? DAF - BEQ.S @1 ; no, so do it the old way DAF SUBQ #6,SP ; leave room for result and boolean DAF MOVE.L A0,-(SP) ; push the controlHandle DAF PEA 6(SP) ; point to result placeholder DAF @@ -538,12 +533,7 @@ GetCVariant ; DAF MOVE.L (A0),A0 ; get the auxRecPtr DAF CLR.W D0 ; clear top byte DAF MOVE.B acReserved(A0),D0 ; get variant code DAF<1.6> - BRA.S @2 ; DAF -@1 - MOVE.L (A0),A0 ; get ctl ptr - MOVE.B ContrlDefHandle(A0),D0 ; get selector parameter - AND.W #$000F,D0 ; lo nybble only -@2 + MOVE.W D0,8(SP) ; return result MOVE.L (SP)+,A0 ; get return addr ADDQ #4,SP ; flush parameters @@ -569,18 +559,10 @@ EraseControl _NewRgn ;allocate a new region MOVE.L (SP),A4 ;keep the region in A4, keep on stack - TST.B MMU32Bit ;are we in 32-bit mode? <1.3> - BEQ.S @24bit ;no, donÕt call new message <1.3> MOVEQ #CalcWholeCtlMsg,D0 ;message is calculate whole regions <1.2> MOVE.L A4,D1 ;the region is the parameter <1.2> - BSR.S CallControl ;send it the message <1.2> - BRA.S @doneCalc ; <1.2> -@24bit ; <1.3> - MOVEQ #CalcCtlMsg,D0 ;message is calculate regions - MOVE.L A4,D1 ;the region is the parameter - BCLR #31,D1 ;hi-bit clear means whole thing - BSR.S CallControl ;send it the message -@doneCalc + BSR CallControl ;send it the message <1.2> + ; ; paint white to erase control and add it to the windowÕs update region ; @@ -657,9 +639,6 @@ DontEraseControl ; <3> MOVE.L (A0),A0 ; get auxCtlRec ptr MOVE.L acCTable(A0),-(SP) ; push default colors hndl <1.6> - TST.B MMU32Bit ; are we in 32-bit mode? <1.4/DAF> - BEQ.S @CtlRec24 ; nope, so get rid of it the easy, old-fashioned way <1.4/DAF> - LEA AuxCtlHead,A1 ; get the head of the auxCtlList (offset is zero so this works!) @10 MOVE.L (A1),A2 ; get the handle to the auxCtlRec @@ -684,11 +663,6 @@ DontEraseControl ; <3> MOVE.L A2,A0 ; release the auxCtlRec _DisposHandle ; ADDQ #4,SP ; get rid of the extra window pointer pushed above - BRA.S @CtlRecDone ; - -@CtlRec24 - _SetCtlColor ; set this controlÕs colors to default (and delete) -@CtlRecDone ; ; delete it from the windowÕs controlList @@ -991,7 +965,7 @@ GetCTitle MOVEQ #0,D0 ;clear high part MOVE.B (A0),D0 ;get length of string ADDQ.L #1,D0 ;include the length byte, too - _BLOCKMOVE ;move it in place + _BLOCKMOVEDATA ;move it in place RTS ;all done! ; ; PROCEDURE SetCTitle(theControl: controlHandle; theTitle: Str255); @@ -1034,7 +1008,7 @@ CopyCTitle ; <3> MOVE.L (A3),A1 ;get control pointer LEA ContrlTitle(A1),A1 ;point to title string ADDQ #1,D0 ;dont forget the length byte - _BlockMove ;move it in + _BlockMoveData ;move it in ; ; make it visible if it used to be ; @@ -1221,8 +1195,6 @@ DragCon1 ; JSR GetNewRgn ;allocate a new region - TST.B MMU32Bit ;are we in 32-bit mode? <1.3> - BEQ.S @24bit ;no, donÕt call new message <1.3> MOVEQ #CalcWholeCtlMsg,D0 ;message is calculate whole regions <1.2> TST.W DragFlag ;if weÕre called as real MoveControl, <1.2> BEQ.S @0 ;then we picked the right message <1.2> @@ -1230,16 +1202,7 @@ DragCon1 @0 ; <1.2> MOVE.L (SP),D1 ;the region is the parameter <1.2> BSR.S CallControl ;send it the message <1.2> - BRA.S @doneCalc ; <1.2> -@24bit ; <1.3> - TST.W DragFlag ;if weÕre called as real MoveControl, - SNE (SP) ;high bit off means we want whole thing - MOVE.L (SP),D1 ;parameter goes in D1 - MOVEQ #CalcCtlMsg,D0 ;tell controlProc to calculate it regions - BSR CallControl ;tell the control about it -; - CLR.B (SP) ;clear high byte of region -@doneCalc + MOVE.L (SP)+,A4 ;keep it in A4 ; ; set up the parameters for dragging the region around (careful -- extra reg diff --git a/Toolbox/DataAccessMgr/DataAccessMgr.make b/Toolbox/DataAccessMgr/DataAccessMgr.make index dca8355..589e77b 100644 --- a/Toolbox/DataAccessMgr/DataAccessMgr.make +++ b/Toolbox/DataAccessMgr/DataAccessMgr.make @@ -25,8 +25,8 @@ DataAccessRTTObjs = "{ObjDir}DataAccessResultsHandlers.a.o" DataAccessCompObjs = "{ObjDir}DataAccessCompletion.a.o" -"{LibDir}DataAccessMgr.lib" Ä "{ObjDir}DataAccessPackEntry.a.o" - Lib {StdLibOpts} -o "{Targ}" "{ObjDir}DataAccessPackEntry.a.o" +# "{LibDir}DataAccessMgr.lib" Ä "{ObjDir}DataAccessPackEntry.a.o" +# Lib {StdLibOpts} -o "{Targ}" "{ObjDir}DataAccessPackEntry.a.o" "{RsrcDir}DataAccessMgr.rsrc" ÄÄ {DataAccessMgrPackObjs} diff --git a/Toolbox/DataAccessMgr/DataAccessPackEntry.a b/Toolbox/DataAccessMgr/DataAccessPackEntry.a index 93882cc..7e5fdf7 100644 --- a/Toolbox/DataAccessMgr/DataAccessPackEntry.a +++ b/Toolbox/DataAccessMgr/DataAccessPackEntry.a @@ -47,7 +47,8 @@ Pack13Globals EQU ExpandMemRec.emPack13Globals @globalsOK MOVE.L Pack13Handle,A0 ; A0 = handle to PACK MOVE.L ExpandMem, A1 ; A1 = expanded memory area ADD.W #Pack13Globals,A1 ; A1 = pointer to PACK use count - _ProcHelper ; let ProcHelper take over + MOVE.L $668, -(SP) + RTS ; ; Attempt to call Database Access Manager before InitDBPack diff --git a/Toolbox/DeskMgr/DeskMgr.a b/Toolbox/DeskMgr/DeskMgr.a index 89daad6..679f4d3 100644 --- a/Toolbox/DeskMgr/DeskMgr.a +++ b/Toolbox/DeskMgr/DeskMgr.a @@ -237,6 +237,8 @@ SearchWindow MOVE windowKind(A0),D0 ; get the unit number from window BPL.S noGoodSearch ; if not sys. kind, ignore it NOT D0 ; flip it (bitwise) + CMP UnitNtryCnt,D0 + BPL.S noGoodSearch ASL #2,D0 ; * 4 MOVE.L UTableBase,A0 ; point to the driver table MOVE.L 0(A0,D0),A0 ; get the handle @@ -255,12 +257,12 @@ SendDrvrMsg MOVEQ #64,D0 ;message 64 is "feedEvent" ; SendDCommon - LINK A6,#-32 ;get some space for the control p-block - LEA IORefNum-32(A6),A0 ;point A0 at the block + LINK A6,#-$32 ;get some space for the control p-block + LEA IORefNum-$32(A6),A0 ;point A0 at the block MOVE.W DCtlRefNum(A1),(A0)+ ;set up the refNum MOVE.W D0,(A0)+ ;set up the control "opCode" MOVE.L A3,(A0) ;set up event ptr as parameter - LEA -32(A6),A0 ;point to pBlock + LEA -$32(A6),A0 ;point to pBlock _Control ,IMMED ;make the control call ; UNLK A6 ;de-allocate parameter block @@ -304,11 +306,11 @@ DiskHandler tst.w EvtMessage(A3) ;if an Eject event, jsr (A0) ;eject the disk bra.s DoneSysEvt ;mark as taken, no error -@1 SUB.W #24,SP ;allocate 24 bytes on stack +@1 SUB.W #64,SP MOVE.L SP,A0 ;point to it MOVE.W EvtMessage+2(A3),IODrvNum(A0) ;get the "disk ID" parameter _MountVol ;tell OS to do its thing - ADD.W #24,SP ;deallocate space on stack + ADD.W #64,SP ;deallocate space on stack MOVE.W D0,EvtMessage(A3) ;return result to application BRA DoneSEvt ;always return "FALSE" @@ -652,10 +654,14 @@ SystemTask ; begin roll-in HMSystemTaskPatch patch <11> - IMPORT ptchHMGetBalloons ; <11> + MOVE.L ExpandMem,A0 + MOVE.L $78(A0),D0 + BEQ.S @BalloonsOff - JSR ptchHMGetBalloons ; what is the state of What Is? mode? <11> - BEQ.S @BalloonsOff ; no, let's not scan for a content window <11> + CLR -(SP) + _HMGetBalloons + TST.B (SP)+ + BEQ.S @BalloonsOff SUBQ #2,SP ; make room for a dummy OSErr <11> _HMBalloonBulk ; <11> @@ -668,7 +674,7 @@ SystemTask IMPORT NMTask ; JSR NMTask ;Give time to Notification Manager - MOVEM.L D3/A3,-(SP) ;save some work registers + MOVEM.L D2-D4/A3-A4,-(SP) ;save some work registers ; ; if this is a re-entrant call, just punt ; @@ -701,7 +707,9 @@ SystemTask NotSWindow MOVE.L UTableBase,A3 ;point to the driver table + MOVE.L A3,A4 MOVE.W UnitNtryCnt,D3 ;get number of entries + MOVE.L D3,D4 ; ; here is the main loop for SystemTask. For each driver that's installed, see if ; it needs time. If so, send it the RUN message. @@ -729,9 +737,10 @@ SysTLoop MOVEQ #0,D0 ;zero high part of D0 MOVE.W DCtlDelay(A1),D0 ;get delay tick count BEQ.S DoItNow ;if zero, always do it - ADD.L DCtlCurTicks(A1),D0 ;figure out next time to call it - CMP.L Ticks,D0 ;has that time passed yet? - BGT.S NextTSys ;if not, don't call it + MOVE.L Ticks,D2 + SUB.L DCtlCurTicks(A1),D2 + CMP.L D0,D2 + BCS.S NextTSys ; ; its time to give it a call ; @@ -741,12 +750,18 @@ DoItNow ; ; here is the bottom of the main loop. See if there are any more entries to process ; + CMP.L UTableBase,A4 + BNE.S NotSWindow + + CMP UnitNtryCnt,D4 + BNE.S NotSWindow + NextTSys SUBQ.W #1,D3 BGT.S SysTLoop ;loop if there's more to do _SetPort ;restore it CLR.B TaskLock ;flag that we're done -TaskDone MOVEM.L (SP)+,D3/A3 ;restore work registers +TaskDone MOVEM.L (SP)+,D2-D4/A3-A4 ;restore work registers RTS ;return to caller ; ; PROCEDURE SystemMenu(menuResult: LongInt); @@ -774,8 +789,8 @@ SystemMenu SWAP D1 ;put the high word back MOVE.L D1,-(SP) ;move it onto the stack PEA (SP) ;push the address - IMPORT CHANGEMENURESULTFORINPUTMETHOD - JSR CHANGEMENURESULTFORINPUTMETHOD ;and send it to the input method + MOVE #35,D0 + _TSMDispatch ;and send it to the input method ADDQ #4,SP ;get rid of space for menuresult MOVE.L (SP)+,(SP) ;strip parameter RTS ;return to caller @@ -893,8 +908,8 @@ DoneSEdit OpenDeskAcc CLR.W 8(SP) ;return 0 as the default - SUB #32,SP ;get 32 bytes for a parameter block - MOVE.L 36(SP),IOFileName(SP) ;set up name + SUB #$32,SP ;get 32 bytes for a parameter block + MOVE.L $36(SP),IOFileName(SP) ;set up name CLR.W IODrvNum(SP) ;use default volume MOVE.W #$0040, IOFileType(SP) ;clear type byte, special permissions to ID OpenDeskAcc CLR.L IOOwnBuf(SP) ;use system buffer @@ -904,7 +919,7 @@ OpenDeskAcc BNE.S DoneOpenDAcc ;if an error, don't return refNum MOVE.W IORefNum(SP),D0 ;get the refNum - MOVE D0,40(SP) ;return the refNum + MOVE D0,$3A(SP) ;return the refNum ; figure out the DCE ptr @@ -926,7 +941,7 @@ OpenDeskAcc _ShowWindow ;show it! DoneOpenDAcc - ADD.W #32,SP ;strip the pBlock + ADD.W #$32,SP ;strip the pBlock MOVE.L (SP)+,(SP) ;strip parameter RTS @@ -935,11 +950,11 @@ DoneOpenDAcc CloseDeskAcc MOVE.W 4(SP),D0 ;get the refNum - SUB #30,SP ;get space for param block + SUB #$32,SP ;get space for param block MOVE.W D0,IORefNum(SP) ;set up refNum MOVE.L SP,A0 _Close ;close it! - ADD #30,SP ;pop off param block + ADD #$32,SP ;pop off param block TwoByteExit MOVE.L (SP)+,A0 ADDQ #2,SP diff --git a/Toolbox/DialogMgr/DialogMgr.make b/Toolbox/DialogMgr/DialogMgr.make index 47356d9..cf754c2 100644 --- a/Toolbox/DialogMgr/DialogMgr.make +++ b/Toolbox/DialogMgr/DialogMgr.make @@ -19,8 +19,8 @@ DialogMgrObjects = "{ObjDir}DialogMgr.a.o" "{ObjDir}DialogDispatch.a.o" -"{LibDir}DialogMgr.lib" Ä {DialogMgrObjects} - Lib {StdLibOpts} -o "{Targ}" {DialogMgrObjects} +# "{LibDir}DialogMgr.lib" Ä {DialogMgrObjects} +# Lib {StdLibOpts} -o "{Targ}" {DialogMgrObjects} "{ObjDir}DialogMgr.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/Toolbox/DisplayMgr/DisplayMgr.make b/Toolbox/DisplayMgr/DisplayMgr.make index 1c78b94..f056098 100644 --- a/Toolbox/DisplayMgr/DisplayMgr.make +++ b/Toolbox/DisplayMgr/DisplayMgr.make @@ -52,8 +52,8 @@ DisplayMgrCOpts = -b2 {StdCOpts} -i {DisplayMgrDir} -i {ProcessMgrDir} DisplayMgrAOpts = {StdAOpts} -"{DispalyMgrLibDir}DisplayMgr.lib" Ä {DisplayObjs} - Lib {LibWarnings} -o {Targ} {DisplayObjs} +# "{DispalyMgrLibDir}DisplayMgr.lib" Ä {DisplayObjs} +# Lib {LibWarnings} -o {Targ} {DisplayObjs} "{DispalyMgrLibDir}DisplayMgrExtensionLib.o" Ä {DisplayExtensionObjs} diff --git a/Toolbox/ExpansionBusMgr/ExpansionBusMgr.Make b/Toolbox/ExpansionBusMgr/ExpansionBusMgr.Make index c45fd4a..3972c9e 100644 --- a/Toolbox/ExpansionBusMgr/ExpansionBusMgr.Make +++ b/Toolbox/ExpansionBusMgr/ExpansionBusMgr.Make @@ -24,8 +24,8 @@ ExpansionBusObjs = "{ObjDir}ExpansionBusMgr.a.o" ExpansionBusMgrCOpts = -b2 {StdCOpts} -i {ExpansionBusMgrDir} ExpansionBusMgrAOpts = {StdAOpts} -"{ExpansionBusMgrLibDir}ExpansionBusMgr.lib" Ä {ExpansionBusObjs} - Lib {LibWarnings} -o {Targ} {ExpansionBusObjs} +# "{ExpansionBusMgrLibDir}ExpansionBusMgr.lib" Ä {ExpansionBusObjs} +# Lib {LibWarnings} -o {Targ} {ExpansionBusObjs} "{ObjDir}ExpansionBusMgr.a.o" Ä "{ObjDir}StandardEqu.d" ¶ "{ExpansionBusMgrDir}ExpansionBusMgr.a" diff --git a/Toolbox/FontMgr/FontMgr.make b/Toolbox/FontMgr/FontMgr.make index 572f95f..ad1c8c4 100644 --- a/Toolbox/FontMgr/FontMgr.make +++ b/Toolbox/FontMgr/FontMgr.make @@ -61,8 +61,8 @@ FontMgrObjs = "{ObjDir}fnt.c.o" "{ObjDir}FontMgr.a.o" -"{LibDir}FontMgr.lib" Ä {FontMgrObjs} - Lib {StdLibOpts} {FontMgrObjs} -o "{Targ}" +# "{LibDir}FontMgr.lib" Ä {FontMgrObjs} +# Lib {StdLibOpts} {FontMgrObjs} -o "{Targ}" "{ObjDir}FontFolderExtension.a.o" Ä "{IntAIncludes}LinkedPatchMacros.a" ¶ diff --git a/Toolbox/GetMgr/GetMgr.a b/Toolbox/GetMgr/GetMgr.a index 31eda02..96ce8a9 100644 --- a/Toolbox/GetMgr/GetMgr.a +++ b/Toolbox/GetMgr/GetMgr.a @@ -181,13 +181,14 @@ VisState EQU -1 ; flag for resource's vis state DAF Align EQU -2 ; another byte to re-align stack frame DAF IsACPort EQU -4 ; flag for color port -GetNewCWindow LINK A6,#IsACPort ; build stack frame - MOVE #-1,IsACPort(A6) ; flag the color port +GetNewCWindow MOVEQ.L #-1,D0 ; color port BRA.S GNWShare ; =>dive into common code -GetNewWindow LINK A6,#IsACPort ; build stack frame - CLR IsACPort(A6) ; flag black and white port -GNWShare MOVE.L A3,-(SP) ; preserve a work register +GetNewWindow MOVEQ.L #0,D0 ; black and white port + +GNWShare LINK A6,#IsACPort ; build stack frame + MOVE D0,IsACPort(A6) ; flag port + MOVE.L A3,-(SP) ; preserve a work register CLR.L result(A6) ; set result to NIL SUBQ #4,SP ; make space for result @@ -496,18 +497,18 @@ LoadMDEF MOVE.W #MapTRUE,ROMMapInsert ; get the MDEF from the ROM map _GetResource ; get it! - MOVE.L (A3),A0 ; get pointer to menu - MOVE.L (SP)+,MenuDefHandle(A0) ; install the defProc handle (which may be NIL) - - MOVE.L A3,-(SP) ; push the menu handle - _CalcMenuSize ; calculate the size of the menu - ; ; Now try to load a menu color table with the same ID as the menu's ; move.b #1, -(sp) ; force Resource Load to true _SetResLoad + MOVE.L (A3),A0 ; get pointer to menu + MOVE.L (SP)+,MenuDefHandle(A0) ; install the defProc handle (which may be NIL) + + MOVE.L A3,-(SP) ; push the menu handle + _CalcMenuSize ; calculate the size of the menu + subq #4, sp ; make room for the result move.l #'mctb', -(sp) ; push resource type move.w 8(a6), -(sp) ; push menuID @@ -584,6 +585,7 @@ GetNewMBar ; loop, getting and inserting one menu at a time + BRA.S skipAllThis GetMBLoop SUBQ #4,SP ;make room for result MOVE.L (A3),A0 ;get pointer to mBarDef @@ -595,8 +597,9 @@ GetMBLoop CLR.W -(SP) ;insert at end of menuBar _InsertMenu - MOVE.L (A3),A0 ;get ptr to mBarDef ADDQ #1,D3 ;bump to next menu +skipAllThis + MOVE.L (A3),A0 ;get ptr to mBarDef CMP (A0),D3 ;done yet BLT.S GetMBLoop ;loop until done diff --git a/Toolbox/MenuMgr/MenuMgr.make b/Toolbox/MenuMgr/MenuMgr.make index ca51e1d..a86ae09 100644 --- a/Toolbox/MenuMgr/MenuMgr.make +++ b/Toolbox/MenuMgr/MenuMgr.make @@ -29,8 +29,8 @@ MenuMgrObjs = "{ObjDir}MenuMgr.a.o" Link {StdLOpts} {StdAlign} -rt MDEF=0 -o "{Targ}" "{ObjDir}StandardMDEF.a.o" || Exit 1 -"{LibDir}MenuMgr.lib" Ä {MenuMgrObjs} - Lib {StdLibOpts} -o "{Targ}" {MenuMgrObjs} +# "{LibDir}MenuMgr.lib" Ä {MenuMgrObjs} +# Lib {StdLibOpts} -o "{Targ}" {MenuMgrObjs} "{ObjDir}StandardMDEF.a.o" Ä "{ObjDir}StandardEqu.d" ¶ diff --git a/Toolbox/Munger/Munger.a b/Toolbox/Munger/Munger.a index 8d6c990..15c8b85 100644 --- a/Toolbox/Munger/Munger.a +++ b/Toolbox/Munger/Munger.a @@ -267,7 +267,7 @@ bm ; local, faster block move <4May85> SUBQ.L #1,D0 ; only move <=1 byte? <4May85> BLE.S @0 ; small move? <4May85> ADDQ.L #1,D0 ; fix up subtract above <4May85> - _BlockMove ; move 'em on out <4May85 + _BlockMoveData ; move 'em on out <4May85 RTS ; adios <4May85> @0 ; <4May85> BLT.S zeroErr ; nothing to move <4May85> @@ -324,7 +324,7 @@ doDelete ADD.L D3,A0 ; l1 BSR bm ; use our blockmove <4May85> -; _BlockMove ; <4May85> +; _BlockMoveData ; <4May85> MOVE.L A2,A0 ; reset size MOVE.L D5,D0 ; new size @@ -483,7 +483,7 @@ clone2Common ADD.L D2,A0 ; add in offset (=0 most times) EXG A0,A1 ; switch source/dest MOVE.L D1,D0 ; restore length - _BlockMove ; counts on D0 being returned 0 + _BlockMoveData ; counts on D0 being returned 0 MOVE.L (SP)+,A0 ; get handle for return noRoom diff --git a/Toolbox/NotificationMgr/NotificationMgr.make b/Toolbox/NotificationMgr/NotificationMgr.make index fdda2ac..65256eb 100644 --- a/Toolbox/NotificationMgr/NotificationMgr.make +++ b/Toolbox/NotificationMgr/NotificationMgr.make @@ -16,8 +16,8 @@ NotificationMgrObjs = "{ObjDir}NotificationMgr.c.o" "{ObjDir}SetProcessorLevel.a.o" -"{LibDir}NotificationMgr.lib" Ä {NotificationMgrObjs} - Lib {StdLibOpts} -o "{Targ}" {NotificationMgrObjs} +# "{LibDir}NotificationMgr.lib" Ä {NotificationMgrObjs} +# Lib {StdLibOpts} -o "{Targ}" {NotificationMgrObjs} diff --git a/Toolbox/ResourceMgr/ResourceMgr.a b/Toolbox/ResourceMgr/ResourceMgr.a index a47e154..44ed185 100644 --- a/Toolbox/ResourceMgr/ResourceMgr.a +++ b/Toolbox/ResourceMgr/ResourceMgr.a @@ -1011,9 +1011,6 @@ RMGRVersion DC.W 1 ; Resource Manager version number InitRSRCMgr ST SysMap ; flag that resources are not inited CLR.L TopMapHndl ; tell the res mgr that it's start time - Move.B MMFlags,-(SP) ; save the memory Manager flag - BSET.B #MMStartMode,MMFlags; set for 32 bit system heap - move.l ExpandMem,a0 ; init override flags kc clr.b ExpandMemRec.emScanOverrideMaps(a0) ; turn off ScanOverrideMaps kc clr.w ExpandMemRec.emLastMapOverridden(a0) ; flush override cache. kc @@ -1023,7 +1020,6 @@ InitRSRCMgr ST SysMap ; flag that resources are not inited _InitResources ; Init ROM resource file ADDQ #2, SP ; Assume success - MOVE.B (SP)+,MMFlags ; restore memory manager flag RTS @@ -1109,7 +1105,7 @@ InitResources ;_______________________________________________________________________________ ; -; Routine: RomOverRide (utility) +; Routine: RomOverRide 65446 (utility) ; ; Arguments: None ; @@ -1126,13 +1122,41 @@ ROVR EQU $524F7672 ; ROVR = 'ROvr' (type of override rsrc) RomOverRide ; new routine <27aug85> BBM SUBQ #4,SP ; Save room on stack for handle - MOVE.L #ROVR,-(SP) ; rsrc type for override + PEA ROVR ; rsrc type for override + MOVE.W #0,-(SP) ; rsrc ID of 0 + MOVE #-1,RomMapInsert + _GetResource ; get the override rsrc + SUBQ #4,SP ; Save room on stack for handle + PEA ROVR ; rsrc type for override MOVE.W #0,-(SP) ; rsrc ID of 0 _GetResource ; get the override rsrc + MOVEQ.L #0,D1 MOVE.L (SP)+,D0 ; Check to see if it exists - BEQ.S ROvrOut ; if handle is zero then just return + BEQ.S @Lx MOVE.L D0,A0 ; get ready to execute this resource MOVE.L (A0),A0 ; dereference handle + + Move $8(A0), D1 +@Lx MoveA.L (SP)+, A1 + Move.L A1, D2 + BEQ.S @L0 + MoveA.L (A1), A0 + Move $8(A0), D2 +@L0 Cmp D2, D1 + BHI.S @L2 + Tst.L D0 + BEQ.S @L1 + Cmp.L A1, D0 + BEQ.S @L1 + Move.L A1, -(SP) + Move.L D0, -(SP) + _ReleaseResource + MoveA.L (SP)+, A1 +@L1 Move.L A1, D0 + BEQ.S ROvrOut +@L2 MoveA.L D0, A0 + MoveA.L (A0), A0 + FPCallROvr ; FlashPort hint attachment point JSR (A0) ; and execute handle ROvrOut RTS ; and return @@ -1280,7 +1304,7 @@ ReDoMap ; new routine moveq #$20,d0 ; size of null map lea NullRF,a0 ; get null map from rom move.l (A4),A1 ; Dereference handle to destination - _BlockMove ; move map down + _BlockMoveData ; move map down move.w #1,MRefNum(a1) ; and stuff the rom map refnum (so getcurmap works) clr.w -(sp) ; get a buffer on the stack to read in index @@ -1783,7 +1807,7 @@ vNewMap ; Def to build dispatch entry <27oct85> BBM ADDA.L #HdrSize,A0 ; ... finish calc for source LEA HSCache,A1 ; Destination for blockmove MOVE.L #PreSize,D0 ; size for blockmove <11jul85> BBM - _BlockMove ; move the key data to the stack + _BlockMoveData ; move the key data to the stack MOVEA.L A0,A1 ; restore A1 SUBA.L #HdrSize,A1 ; ... finish restoring A1 BSR PreFormat ; check the preload format of this file CSS @@ -1824,7 +1848,7 @@ vNewMap ; Def to build dispatch entry <27oct85> BBM ; a new map is first created and only set after the appropriate Resource overrides ; calls have been made. - andi.b #kAllButOverrideAttributesMask,mInMemoryAttr(a1) + andi.b #kDecompressionPasswordMask,mInMemoryAttr(a1) ; Successful load. Return with D6=refnum of file and D0=1 for "newmap" flag @@ -4572,7 +4596,7 @@ vCheckLoad ; Def to build dispatch entry tst.b (sp)+ bne.s @system_rsrc ; if so, branch move.l (a4),a0 ; a0 <- ptr to map - btst.b #mapForceSysHeap,MAttr(a0) ; should all entries in map go in system heap? + btst.b #overrideNextMapBit,MAttr(a0) ; should all entries in map go in system heap? beq.s @GoOnCheckLoad ; if not, branch @system_rsrc bset #ResSysHeap,RAttr(a2) ; get into the system heap (and stay there!) @@ -5806,7 +5830,7 @@ LoadResource MOVE.L D0,A0 ; handle in A0 MOVE.L ROMBASE,A1 CMP.L (A0),A1 ; resource in ROM - BPL.S @2 ; Nope + BHI.S @2 ; Nope CLR.W ResErr ; since we found a ROM resource, and we assume it is ok. CSS BRA.S @9 ; yes, done @2 @@ -6324,7 +6348,7 @@ CopyStr MOVEQ #0, D0 ; Zero high order bits. MOVE.B (A0), D0 ; Get length of string ADDQ.W #1, D0 ; include length byte. <14jun85> BBM - _BlockMove ; Copy the string to A1 + _BlockMoveData ; Copy the string to A1 RTS ; and return. ;_______________________________________________________________________________ diff --git a/Toolbox/ResourceMgr/ResourceMgrExtensions.a b/Toolbox/ResourceMgr/ResourceMgrExtensions.a index c60128e..d0f574a 100644 --- a/Toolbox/ResourceMgr/ResourceMgrExtensions.a +++ b/Toolbox/ResourceMgr/ResourceMgrExtensions.a @@ -922,7 +922,7 @@ ValidateFontResourceIDs Proc Export 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. + bra @nextTableEntry ; If it is a sfnt or other, go on to the next one. @checkForFONTs subq #4,sp ; @@ -930,7 +930,7 @@ ValidateFontResourceIDs Proc Export 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 @nextTableEntry ; This number is fine bra.s @conflictOccured @checkForNFNTs @@ -939,7 +939,7 @@ ValidateFontResourceIDs Proc Export 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 @nextTableEntry ; This number is fine @conflictOccured move.l d0,a0 ; <46> @@ -965,6 +965,27 @@ ValidateFontResourceIDs Proc Export ; Make sure this ID is not used in the resource map. ; + cmpi.l #'FONT',D3 + beq.s @isFONT + cmpi.l #'NFNT',D3 + beq.s @isNFNT + bra.s @isNeither + +@isNFNT subq #4,SP + move.l #'FONT',-(SP) + move D2,-(SP) + _GetResource + move.l (SP)+,D0 + beq.s @isNeither + bra.s @getUniqueID +@isFONT subq #4,SP + move.l #'NFNT',-(SP) + move D2,-(SP) + _GetResource + move.l (SP)+,D0 + bne.s @getUniqueID +@isNeither + move.l mapToRenumber(a6),TopMapHndl ; <29> Make sure weÕre reading out of the right map move.w refNum(a6),CurMap subq #4,sp @@ -974,6 +995,28 @@ ValidateFontResourceIDs Proc Export move.l (sp)+,d0 ; Check it out bnz.s @getUniqueID ; Try again + cmpi.l #'FONT',D3 + beq.s @isFONT2 + cmpi.l #'NFNT',D3 + beq.s @isNFNT2 + bra.s @@isNeither + +@isNFNT2 subq #4,SP + move.l #'FONT',-(SP) + move D2,-(SP) + _GetResource + move.l (SP)+,D0 + beq.s @@isNeither + bra @getUniqueID +@isFONT2 subq #4,SP + move.l #'NFNT',-(SP) + move D2,-(SP) + _GetResource + move.l (SP)+,D0 + beq.s @@isNeither + bra @getUniqueID +@@isNeither + ; We have a unique ID. Put it and the original in the from-to list. move.w d2,-(sp) ; <57> Pass new ID @@ -1131,26 +1174,6 @@ ReleaseTheFont Proc Export jmp (a0) ; Return to the caller EndProc -;____________________________________________________________________________________________________ -; <53> SetDeanBitIfResourceWillBeLoaded -; -; This routine checks to see if the resource reference entry already contains a handle -; or not. If it does, DeanBit is cleared. If there is no handle (ie, the resource will -; be loaded this time) set DeanBit. This allows people to determine whether they loaded -; a resource, or if someone else did. -; - -SetDeanBitIfResourceWillBeLoaded PatchProc jCheckLoad - tst.l RHndl(a2) ; See if a master pointer has already been allocated - bz.s @setDeanBit - bclr #kDeanBit,kBrianBits ; A master pointer has already been allocated - bra.s @goLoadTheResource -@setDeanBit - bset #kDeanBit,kBrianBits ; WeÕll be loading the resource right now -@goLoadTheResource - jmpOld ; Load the resource - EndProc - ;____________________________________________________________________________________________________ ; <48> CloseResFileUnderSystemMap(refNum: Integer); ; @@ -1512,7 +1535,7 @@ IsThisASystemResourceMap Proc Export move.l d1,a0 move.l (a0),a0 move.w mRefNum(a0),d0 ; Get the file reference number of this map - bsr GetPSNFromParallelFCB ; <60> Get the parallel FCB info + bsr.l GetPSNFromParallelFCB ; <60> Get the parallel FCB info ; I really should use EqualProcess, but the Process Manager might not be around yetÉ @@ -1540,6 +1563,29 @@ IsThisASystemResourceMap Proc Export ; people are picky about how long they can play Tetris on the airplaneÉ GetPSNFromParallelFCB Proc Export + movea.l FSVarsPtr,A0 + btst.b #3,FSVars.fsFlags(A0) + beq.s @dontHitFS + + sub #$32,SP + movea.l SP,A0 + cmp #$3,D0 + bne.s @L0 + moveq.l #$2,D0 +@L0 move D0,$18(A0) + moveq.l #$50,D0 + _HFSDispatch + cmp #$0,D0 + bne.s @L1 + movea.l $1C(A0),A0 + bra.s @L2 +@L1 lea.l 0,A0 + +@L2 dc.w $defc, $0032 + ;add #$32,SP ; can't seem to make this look right! + rts + +@dontHitFS andi.l #$FFFF, d0 ; only the low word is passed. divu.w FSFCBLen,d0 ; convert refnum to an index movea.l FSVarsPtr,a0 ; get address of HFS variable area @@ -1566,7 +1612,7 @@ MarkFileAsOwnedByTheSystem Proc Export Import GetPSNFromParallelFCB move.l a0,-(sp) ; Preserve A0 - bsr GetPSNFromParallelFCB + bsr.l GetPSNFromParallelFCB clr.l (a0)+ ; Clear high word of PSN move.l #kSystemProcess,(a0) ; Set the low word move.l (sp)+,a0 ; Restore A0 @@ -1950,7 +1996,7 @@ MakeOverrideMap Proc Export exg a2,a1 ; Swap reference entry and 'rovm' pointer move.l #RESize,d0 - _BlockMove ; Copy reference data + _BlockMoveData ; Copy reference data clr.b RAttr(a0) ; clear the attributes for the resource (protected, etc.) ; diff --git a/Toolbox/ScrapMgr/ScrapMgr.a b/Toolbox/ScrapMgr/ScrapMgr.a index a7b6fc5..c8e29b9 100644 --- a/Toolbox/ScrapMgr/ScrapMgr.a +++ b/Toolbox/ScrapMgr/ScrapMgr.a @@ -383,6 +383,7 @@ ZeroScrap BSR StdEntry ; D0 set to 0 by above BNE err0Exit + MOVEQ.L #0,D0 MOVE.L D0,scrapInfo ; zero out info ADDQ #8,4(A4) ; increment validation word BPL.S @0 diff --git a/Toolbox/ScriptMgr/ScriptMgr.make b/Toolbox/ScriptMgr/ScriptMgr.make index 8369333..b90c06f 100644 --- a/Toolbox/ScriptMgr/ScriptMgr.make +++ b/Toolbox/ScriptMgr/ScriptMgr.make @@ -32,8 +32,8 @@ ScriptMgrObjects = "{ObjDir}ScriptMgrHeader.a.o" "{ObjDir}ScriptMgrDispatch.a.o" ¶ -"{LibDir}ScriptMgr.lib" Ä {ScriptMgrObjects} - Lib {StdLibOpts} -o "{Targ}" {ScriptMgrObjects} +# "{LibDir}ScriptMgr.lib" Ä {ScriptMgrObjects} +# Lib {StdLibOpts} -o "{Targ}" {ScriptMgrObjects} "{ObjDir}ScriptMgrDispatch.a.o" Ä "{IntAIncludes}ScriptPriv.a" ¶ diff --git a/Toolbox/SegmentLoader/SegmentLoader.a b/Toolbox/SegmentLoader/SegmentLoader.a index 8543797..48e0c7a 100644 --- a/Toolbox/SegmentLoader/SegmentLoader.a +++ b/Toolbox/SegmentLoader/SegmentLoader.a @@ -242,9 +242,7 @@ LoadSeg @37 ;Aren't we slick and tight? <02Nov85> JTC _HLock ; <23May85> NoMoveHHi - MOVE.L (A0),D0 ; handle -> dirty pointer - _StripAddress ; D0 <- clean ptr - MOVE.L D0,A0 ; + MOVE.L (A0),A0 ; handle -> dirty pointer MOVE.L A5,A1 ;copy world base address ADD.W CurJTOffset,A1 ;offset by the current offset @@ -448,7 +446,7 @@ fAVDone ; <27Mar85> ;------------------------------------------------------------------------------ ; -; PROCEDUREs Launch, Chain, ExitToShell: +; PROCEDUREs Launch, Chain, ExitToShell 2c22a: ; ; Here is the main part of the segment loader that actually launches ; an application. It opens the resource file specified by the input name, @@ -530,7 +528,7 @@ LaunchCom move.w (a3)+,CurPageOption ; <28Oct85> LEA CurApName,A1 ;get address to stuff the name MOVEQ #32,D0 ;move 32 bytes worth - _BlockMove ;move it in + _BlockMoveData ;move it in MOVEQ #0,D3 ; assume all flags are zero CMP.W #'LC',(A3)+ ; extension code around? @@ -570,7 +568,7 @@ SkipClose MOVE.L SP,A1 ;set up destination for move MOVE.L (A0),A0 ;set up source for move MOVE.L D0,-(SP) ;remember the size - _BlockMove ;move it! + _BlockMoveData ;move it! ; re-init the application heap zone, destroying the world... ; ...but just before, flush any vbl tasks executing out of that doomed land! <27Mar85> @@ -608,7 +606,7 @@ GoInitAZone MOVE.L D1,D0 ;get size for blockMove MOVE.L (A0),A1 ;get destination pointer MOVE.L SP,A0 ;get source pointer - _BlockMove ;move it in! + _BlockMoveData ;move it in! ADD.L D1,SP ;deallocate scrap save buffer @@ -728,7 +726,9 @@ ExitToShell ; <30Jan85> ; _CloseResFile ; CLR.W CurApRefNum - _PMgrExit ; Empty out the palette manager < 7Jul89> + MOVE #$C, D0 ; Empty out the palette manager < 7Jul89> + _PaletteDispatch + SUB.L A0,A0 ; clear out A0 <30Jan85> _SetGrowZone ; disable application's growZone handler <30Jan85> @@ -763,7 +763,7 @@ BadOpen ;------------------------------------------------------------------------------ -; PROCEDURE vLaunchInit; new +; PROCEDURE vLaunchInit 2c266; new ; ; Vectored utility to set up application world just before launching the app. ; Historically set $0 to be diag ROM rather than even more historical 'FOBJ' @@ -812,7 +812,7 @@ vLaunchInit ;------------------------------------------------------------------------------ ; -; PROCEDURE GetAppParms(VAR apName: Str255; +; PROCEDURE GetAppParms 2c298(VAR apName: Str255; ; VAR apRefNum: INTEGER; ; VAR apParam: Ptr) ; @@ -836,7 +836,7 @@ GetAppParms LEA CurApName,A0 ;point to name in low memory MOVEQ #32,D0 ;move 32 bytes - _BlockMove ;move it! + _BlockMoveData ;move it! RTS ;return to caller (params already stripped) diff --git a/Toolbox/ShutDownMgr/ShutDownMgr.a b/Toolbox/ShutDownMgr/ShutDownMgr.a index 07cb67e..6f658c1 100644 --- a/Toolbox/ShutDownMgr/ShutDownMgr.a +++ b/Toolbox/ShutDownMgr/ShutDownMgr.a @@ -333,6 +333,7 @@ sdBitPowerOff EQU 0 ; Call routine just before PowerOff. sdBitReStart EQU 1 ; Call routine just before a Reboot. sdBitUnMount EQU 2 ; Call routine before UnMounting Vols. sdBitDrivers EQU 3 ; before Driver Goodbye Kiss. +sdBitNew EQU 4 ; local equates @@ -343,7 +344,7 @@ SDHeader EQU $BBC ; low mem for ROM version ;_______________________________________________________________________ ; -; ShutDownINIT +; ShutDownINIT 2c330 ; Install default shutdown procedures in the shutdown queue. ; Will not stick around in System builds, but will be there for ROMs. ;_______________________________________________________________________ @@ -354,15 +355,27 @@ ShutInit PROC Export move.l A0,SDHeader pea DoDrivers ; the default routine to unload - move.w #SDOnUnMount,-(SP) ; all drivers with a goodbye + move.w #$8000|SDOnUnMount,-(SP) ; all drivers with a goodbye jsr ShutInstall ; install it in the queue pea DoUnmount ; the default routine to unmount volumes - move.w #sdRestartOrPower,-(SP) ; do before power-off or restart + move.w #$8000|$10,-(SP) ; do before power-off or restart + jsr ShutInstall + + pea DoSomethingAtRestartOrPower + move.w #$8000|sdRestartOrPower,-(SP) + jsr ShutInstall + + pea DoUnmountAtPowerDown + move.w #$8000|sdOnPowerOff,-(SP) + jsr ShutInstall + + pea DoUnmountAtRestart + move.w #$8000|sdOnRestart,-(SP) jsr ShutInstall pea ClearWarmStart - move.w #sdOnPowerOff,-(SP) ; only on 'shut down' <26> + move.w #$8000|sdOnPowerOff,-(SP) ; only on 'shut down' <26> jsr ShutInstall ; install it in the queue <26> Rts @@ -370,7 +383,7 @@ ShutInit PROC Export ;_______________________________________________________________________ ; -; Routine: ShutDown +; Routine: ShutDown 2c382 ; ; Arguments: A0 (input) : address of a ShutDown routine ; D0 (input) : command word (SDInit, SDPowerOff ...) @@ -392,23 +405,26 @@ ShutInit PROC Export ShutDown move.l (SP)+,D2 ; save return move.w (SP)+,D0 ; get opcode word move.l D2,-(SP) ; restore the return - subq #SDPowerOff,D0 - bcs.w ShutInit ; if d0=0, _SDInit a selector in ROM versions - beq ShutPower ; if d0=1, Shutdown - subq #SDInstall-SDPowerOff,D0 - bcs ShutRestart ; if d0=2, carry set, bra to restart - beq.s ShutInstall ; if d0=3, Install + cmp.w #5,D0 + bhi.s @unknownSelector + + move.w @tbl(d0*2),d0 + jmp @tbl(d0) + +@tbl dc.w ShutInit-@tbl ; 0 + dc.w ShutPower-@tbl ; 1 + dc.w ShutRestart-@tbl ; 2 + dc.w ShutInstall-@tbl ; 3 + dc.w ShutRemove-@tbl ; 4 + dc.w UserChoice-@tbl ; 5 - subq.w #sdUserChoice-sdInstall,d0 - bmi.s ShutRemove ;if d0=4, Remove - beq UserChoice ; if d0=5, User Choice @unknownSelector rts ; unknown selector (do nothing, assume no parameters) ;_______________________________________________________________________ ; -; ShutInstall - Installs a shutDown procedure in the SD Queue. +; ShutInstall 2c3a4 - Installs a shutDown procedure in the SD Queue. ; Entry On Stack: Long - Proc pointer, to install in Queue, call later. ; Word - Flags word, with low bits defining when to call proc. ; @@ -432,7 +448,7 @@ ShutInstall ;_______________________________________________________________________ ; -; ShutRemove - Removes a shutDown procedure in the SD Queue. +; ShutRemove 2c3c0 - Removes a shutDown procedure in the SD Queue. ; Entry: TOS - Proc pointer, to remove from the Queue. ; Exit: D0 - Error Code. ; @@ -476,7 +492,7 @@ ShutRemove ;_______________________________________________________________________ ; -; ShutRestart - do a shut-down and restart the system +; ShutRestart 2c3f6 - do a shut-down and restart the system ; ; Entry: no parameters ; Exit: never does. @@ -514,57 +530,118 @@ ShutRemove export ShutRestart + import SHUTDOWNMGRC_2CC90 ShutRestart with ROMHeader + bsr VersionCheckingFunc + beq.s @old + + bsr DoRAMDiskAlert + bne @return + + bsr FindEDisk + beq.s @old + + bsr KillEDisk + bra.s @old + +@return rts +@old + moveq #sdOnPowerOff,d5 ; Remove poweroff routines from the queue <13> bsr RemoveOtherRoutines moveq #SDBitRestart,D0 ; remember that we will reboot. + moveq #1,D1 bsr CallRoutines ; do the shutDown cleanup. - moveq #1,D5 ; Go ahead and hide cursor/close LCDs. - bsr BlankDesktop ; Go blank the desktop. - move.l ROMBase,A2 ; point to the ROM lea ROMHeader.Restart(A2),A2 ; point to the restart routine move.l #emuWarmStartConst,D0 ; Does the upper long match? move.l #WmStConst,D1 ; Does the upper long match? bsr UpdateEmuWarmstart ; Write the warmstart (We may have come from a shutdown...) - - tst.l VMGlobals ; Is VM running? - bmi.s @noVM ; -> No. Assume we're in Supervisor Mode - _EnterSupervisorMode ; Enter supervisor mode (donÕt worry about munging the stack...) -@noVM - bsr DockInitSCC ; reset the SCC (if we have Power controls) <3> - TestFor JawsExists ; are we running on a Tim machine with JAWS <5> HJR - beq.s @noJAWS ; -> No JAWS, jump to RESTART now. <43> - - with PmgrRec, pmCommandRec -@JawsRestartSeq ; -- Special Case for JAWS -- <5> HJR - move.l PMgrBase,a0 ; get pointer to the power manager globals - move.l HDVector(a0),a0 ; get pointer to hard disk power down - jsr (a0) ; kill the hard disk - lea -pmBlkSize(sp),sp ; Create stack frame - lea pmData(sp),a0 ; Get pointer to a xmit buffer - move.l a0,pmRBuffer(sp) ; Load pointer to receive buffer - move.l a0,pmSBuffer(sp) ; Load pointer to xmit buffer - clr.l (a0) ; No data - clr.w pmLength(sp) ; No data - move.w #$21,pmCommand(sp) ; ADB autopoll disable - move.l sp,a0 ; a0 get pointer to paramter block - _PmgrOp ; go kill the machine - clr.l pmData(a0) ; clear data - clr.w pmLength(a0) ; clear length - move.w #$d0,pmCommand(sp) ; reset CPU command - move.w Timedbra,d1 ; set-up our counter - lsl.w #2,d1 ; give ourselves 4 milliseconds - _PmgrOp ; go kill the machine - -@waitloop dbra d1,@waitloop ; stick around for 4 milliseconds - ; Fall into the JMP to Restart <43> +E_0 Bsr SHUTDOWNMGRC_2CC90 + MoveQ.L #$0, D0 + _DebugUtil + CmpI.L #$8, D0 + BLT.B @L0 + MoveQ.L #$8, D0 + _DebugUtil +@L0 Move.L #'pwrv', D0 + _Gestalt + BNE.B @L1 + Move.L A0, D0 + CmpI.L #$200, D0 + BLT.B @L1 + MoveQ.L #$20, D0 + _PowerDispatch +@L1 BTst.B #$0, (HWCfgFlags) + BEQ.B @L3 + BTst.B #$3, ($240A) + BNE.B @L3 + Clr.L -(A7) + Clr.L -(A7) + Move.L A7, -(A7) + Move.L (A7), -(A7) + Clr -(A7) + Move #$D0, -(A7) + MoveA.L A7, A0 + _PMgrOp + Lea.L $C(A7), A7 +@L2 Bra.B @L2 +@L3 BTst.B #$1, ($2400) + BNE.B @L4 + Bra.B @L6 +@L4 Move.L #$7000000, D0 + And.L (UnivROMFlags), D0 + SubI.L #$3000000, D0 + BNE.B @L6 + Lea.L -$14(A7), A7 + MoveA.L A7, A0 + Move.B #$1, (A0) + Move.B #$11, $1(A0) + Clr.L $10(A0) + _EgretDispatch + Lea.L $14(A7), A7 +@L5 Bra.B @L5 +@L6 BTst.B #$3, ($2409) + BEQ @L8 + Lea.L -$28(A7), A7 + Move.L A7, D0 + AddQ #$7, D0 + AndI.L #$FFFFFFF8, D0 + Move.L #$FFFFF000, D1 + Move.L D1, D2 + And.L D0, D2 + MoveA.L D0, A1 + Lea.L $F(A1), A1 + Move.L A1, D4 + And.L D4, D1 + Cmp.L D1, D2 + BEQ.B @L7 + Move.L D1, D0 +@L7 MoveA.L D0, A0 + Move.L ([$68FFEFD0.L],$50), (A0) ; NKHWInfo.RTAS_Restart + Clr.L $4(A0) + Move.L #$1, $8(A0) + MoveA.L A0, A1 + MoveQ.L #$10, D0 + DC.W $FE0C + MoveA.L A1, A0 + DC.W $FE20 + Lea.L $28(A7), A7 +@L8 MoveQ.L #$E, D0 + And.L (UnivROMFlags), D0 + CmpI.L #$8, D0 + BNE.B @noJAWS + MoveA.L ([$68FFEFD0.L],$30), A0 ; NKHWInfo.ADB_Base + BSet.B #$4, $A0(A0) + Nop + BSet.B #$4, $110(A0) + Nop ; Finally! Restart the machine by Jumping through the Restart vector in the ROM header @@ -576,7 +653,7 @@ ShutRestart ;_______________________________________________________________________ ; -; ShutPower - Do a shutDown and power off the system if possible. If itÕs +; ShutPower 2c546 - Do a shutDown and power off the system if possible. If itÕs ; and older system (no power off ability) then put up an ; alert that the system can go down now. ; @@ -598,15 +675,15 @@ ShutPower bsr.w RemoveOtherRoutines ; Go remove these procedures from the queue <13> moveq #SDBitPowerOff,D0 ; pass parameter: power off. + moveq #1,D1 bsr.w CallRoutines ; do cleanup and check if new mac. - moveq #1,D5 ; Go ahead and hide cursor/close LCDs. - bsr BlankDesktop ; Clear the whole desktop. - bsr FindEDisk ; Do we have an EDisk in the drive Q? beq.s @noEDisk ; -> Nope, continue w/power off bsr KillEDisk ; Clear the EDisk's checksum data (invalidate the disk) @noEDisk + IMPORT SHUTDOWNMGRC_2CC90 + BSR SHUTDOWNMGRC_2CC90 ; Send Sonic a soft reset <16> thru next <16> @@ -635,7 +712,7 @@ ShutPower ;_______________________________________________________________________ ; -; DoSysErrDialog +; DoSysErrDialog 2c594 ; ; Put up a dialog (done by the system error handler). ; The system error ID must be in D0. @@ -648,7 +725,7 @@ DoSysErrDialog ;_______________________________________________________________________ ; -; UserChoice +; UserChoice 2c59a ; ; Start off as a power-off. If the machine supports soft power-off, ; we give the user a choice between Restart and Shut Down (some of the @@ -660,17 +737,18 @@ DoSysErrDialog ;_______________________________________________________________________ UserChoice - moveq #0,D5 ; DonÕt hide cursor/close LCDs. - bsr BlankDesktop ; Clear the entire desktop for consistency. - bsr CheckForSoftPowerOff ; does this machine have software power-off? bz.s @noSoftPowerOff ; no! + moveq #0,D5 ; DonÕt hide cursor/close LCDs. + bsr BlankDesktop ; Clear the entire desktop for consistency. + move.w #dsShutDownOrRestart,d0 ; yes, let the user choose Shut Down or Restart bra.s DoSysErrDialog @noSoftPowerOff moveq #sdBitPowerOff,d0 ; notify just as we would for PowerOff + moveq #0,d1 bsr.s CallRoutines ; go do the notification move.w #dsSwitchOffOrRestart,d0 ; no, let the user switch off or Restart @@ -679,7 +757,7 @@ UserChoice ;_______________________________________________________________________ ; -; CallRoutines +; CallRoutines 2c5b8 ; Entry: D0 - Bit number to test (shutdown type). ; Exit: regs saved. ;_______________________________________________________________________ @@ -688,16 +766,27 @@ CallRoutines movem.l A1-A3/D0-D5,-(SP) move.w D0,D4 + swap D4 + move D1,D4 + ; Call Cleanup for Drivers, and Custom cleanup Procs. moveq #SDBitDrivers,D5 ; do Pre-Driver cleanUp bsr.s CallCleanUp + moveq #sdBitUnMount,D5 + bsr.s CallCleanUp + ; Call Cleanup to unmount volumes, and then custom PowerOff/Restart. - moveq #SDBitUnMount,D5 ; do Vol UnMounts + moveq #SDBitNew,D5 bsr.s CallCleanUp move.w D4,D5 ; do PowerOff or ReStart cleanup + + bsr BlankDesktop + swap D4 + move D4,D5 + bsr.s CallCleanUp ; set up the flags for the caller. @@ -707,7 +796,7 @@ CallRoutines ;_______________________________________________________________________ ; -; RemoveOtherRoutines - Remove all occurences of the passed in shutdown procedure type from the shutdown queue. <13> +; RemoveOtherRoutines 2c5e0 - Remove all occurences of the passed in shutdown procedure type from the shutdown queue. <13> ; This differentiates routines that wish to be executed before drivers on restart, but not at all on poweroff ; (as an example). Before, there was no differentiation between restart and poweroff for routines that were ; to run before drivers close, or before volumes are unmounted. There are cases when such differentiation @@ -753,7 +842,7 @@ RemoveOtherRoutines ;_______________________________________________________________________ ; -; CallCleanUp +; CallCleanUp 2c608 ; Entry: D5 - Bit number to test (shutdown type). ; Exit: ;_______________________________________________________________________ @@ -786,6 +875,9 @@ CallCleanUp clr.w QType(a2) ; QType holds the shutdown flags @DontCallUs + cmp #0,A3 + beq.s @NotFound + cmp.l A2,D3 ; at the end? move.l A3,A2 Bne.S @ScanLoop @@ -794,7 +886,7 @@ CallCleanUp ;_______________________________________________________________________ ; -; DoDrivers - The Default shutdown routine to kiss all of the drivers +; DoDrivers 2c63a - The Default shutdown routine to kiss all of the drivers ; goodbye. ; Entry: No paramters. ; @@ -816,54 +908,6 @@ DoDrivers MOVE.L D0,A0 ; get the DCE handle MOVE.L (A0),A0 ; get the DCE pointer -;------------------------------------------------------------------------ <4> jmp - - Btst #dRamBased,DCtlFlags+1(A0) ; If weÕve got a pointer, then just skip - Beq.s @skipVidChk ; this code (our drivers are RamBased). - - Move.l A0,D7 ; Save pointer to DCE. - Move.l A1,D6 ; Save UTable pointer. - - Move.l dCtlDriver(A0),A0 ; Get handle to driver. - Move.l (A0),A0 ; Get pointer to driver. - Lea drvrName(A0),A0 ; Point to driver name. - Move.l A0,D5 ; Save it for later. - - moveq #0,D0 ; Prepare D0. - Move.b (A0),D0 ; Get the length of the driver name. - Move.w D0,D4 ; Make a copy. - Addq #2,D4 ; Adjust offset to version field (len + 1) - Bclr #0,D4 ; Adjust offset for word alignment. - Move.w (A0,D4.w),D4 ; Get the version number. - Bne.s @endVidChk ; If non-zero, then just leave. - - Swap D0 ; Get 1st string length into hi-word. - Addq #1,A0 ; Point to text of driver name. - Lea TimVidTitle,A1 ; Point to TIM/TIM-LCÕs video driver name. - Move.b (A1)+,D0 ; Get 2nd string length into lo-word. - _CmpString ; Compare drvrName with TimVidTitle. - Tst.b D0 ; If this is the TIM/TIM-LC driver, - Beq.s @fixFlags ; then donÕt kiss it goodbye. - - Move.l D5,A0 ; Restore pointer to driver name. - moveq #0,D0 ; Re-prepare D0. - Move.b (A0)+,D0 ; Get length of 1st stringÉ - Swap D0 ; Éinto the hi-word. - Lea DAFBVidTitle,A1 ; Point to Spike/Eclipse video driver name. - Move.b (A1)+,D0 ; Get 2nd string length into lo-word. - _CmpString ; Compare drvrName with DAFVidTitle. - Tst.b D0 ; If this is the DAFB (Spike/Eclipse) driver, - Beq.s @fixFlags ; then donÕt kiss it goodbye. - Bra.s @endVidChk ; Otherise, just leave. - -@fixFlags Move.l D7,A0 ; Restore pointer to DCE. - Bclr #DNeedGoodbye,DCtlFlags(A0) ; Reset the good-bye kiss flag. - -@endVidChk Move.l D7,A0 ; Restore pointer to DCE. - Move.l D6,A1 ; Restore pointer to UTable. - -@skipVidChk - ;------------------------------------------------------------------------ <4> jmp BTST #DNeedGoodbye,DCtlFlags(A0) ; need a goodbye kiss? @@ -884,28 +928,43 @@ DoDrivers MOVEM.L (SP)+,D0-D1/D4-D7/A0-A1 ; restore registers <4> jmp RTS -;------------------------------------------------------------------------ <4> jmp - - String Pascal - -TIMVidTitle - DC.W '.Display_Video_Apple_TIM' ; Name of TIM/TIM-LC Video Driver. - -DAFBVidTitle - DC.W '.Display_Video_Apple_DAFB' ; Name of Spike/Eclipse Video Driver. - ;------------------------------------------------------------------------ <4> jmp ;_______________________________________________________________________ ; -; DoUnmount - Unmount all of the volumes on line, so the disks will be updated before our power off. +; DoUnmountCommon 2c69c - Unmount all of the volumes on line, so the disks will be updated before our power off. ; ; Entry: No parameters. ; ;_______________________________________________________________________ - export DoUnmount +DoUnmountAtPowerDown + MOVE.L D3,-(SP) + MOVE.L #$2,D3 + BSR DoUnmountCommon + MOVE.L (SP)+,D3 + RTS + + +DoUnmountAtRestart + MOVE.L D3,-(SP) + MOVE.L #$1,D3 + BSR DoUnmountCommon + MOVE.L (SP)+,D3 + RTS + + + EXPORT DoUnmount DoUnmount + MOVE.L D3,-(SP) + MOVE.L #$3,D3 + BSR DoUnmountCommon + MOVE.L (SP)+,D3 + RTS + + +DoUnmountCommon + move.l D5,-(SP) sub #IOQElSize,SP ; allocate pBlock ; Go through the VCB Queue to Flush and eject all volumes. @@ -916,6 +975,20 @@ DoUnmount move.l VCBQHdr+QHead,A1 ; get the queue header move.l VCBQHdr+QTail,D2 ; get the tail too beq.s @AllFlushed + + cmp.l D2,A1 + beq.s @AllFlushed + + move.l (A1),A1 + move.l #0,D5 + tst.l $B78 + bmi.s @alreadySetB78 + + move.l $B78,A0 + move.w $4E(A0),D5 + move.l SP,A0 +@alreadySetB78 + bsr ZapVCBQueue ; wipe out the whole queue @AllFlushed @@ -938,6 +1011,7 @@ taskActive equ 7 ; High bit of qType word is active flag. _PrimeTime ; Start the TMTask. move.l DrvQHdr+QHead,D0 ; Now, get a pointer to the first drvQElem. + beq.s @TimedOut @Repeat move.l D0,A1 ; Copy the drvQElem pointer into A1. cmpi.w #-5,dqRefNum(A1) ; If this isnÕt a floppy (.Sony) driver drive, bne.s @Until ; then just go on. @@ -954,11 +1028,52 @@ taskActive equ 7 ; High bit of qType word is active flag. @TimedOut _RmvTime ; Remove TMTask. adda.w #tmXQSize,Sp ; Reclaim the stack space. + move.l (SP)+,D5 rts + +;_______________________________________________________________________ +; +; DoSomethingAtRestartOrPower 2c71e +;_______________________________________________________________________ + +DoSomethingAtRestartOrPower + + movem.l D3/D5,-(SP) + + tst D4 + beq.s @cond1 + + moveq #1,D3 + bra.s @cond2 + +@cond1 moveq #2,D3 +@cond2 sub #IOQElSize,SP ; allocate pBlock + +; Go through the VCB Queue..? + + move.l SP,A0 ; point to the parameter block + clr.L ioVNPtr(A0) + clr.W ioRefNum(A0) + move.l VCBQHdr+QHead,A1 ; get the queue header + move.l VCBQHdr+QTail,D2 ; get the tail too + + beq @noZap + + move.l #0,D5 + bsr ZapVCBQueue +@noZap + + add.w #IOQElSize,SP + + movem.l (SP)+,D3/D5 + + rts + + ;_______________________________________________________________________ <5> ; -; ClearWarmStart - Shutdown task to clear warm start variable if user +; ClearWarmStart 2c756 - Shutdown task to clear warm start variable if user ; chooses 'Shut Down' from the Finder. ; ;_______________________________________________________________________ <5> @@ -980,7 +1095,7 @@ ClearWarmStart ;_______________________________________________________________________ SAM ; -; UpdateEmuWarmstart - +; UpdateEmuWarmstart 2c76e - ; ; The emulator warmstart flag lives in the writeprotected diagnostic info block in the Nanokernel's ; data page. We need to "map" the diag page to a normally mapped page of RAM, write the warmstart @@ -996,9 +1111,6 @@ ClearWarmStart UpdateEmuWarmstart With nkDiagInfo - testFor has68kEmulator ; Does this machine have a V0 style emulator? - beq @Done ; -> Nope, we're done. Exit. - move SR,-(SP) ; Save SR ori.w #hiIntMask,SR ; Disable interrupts movem.l D2-D7,-(SP) ; Save some D regs @@ -1023,6 +1135,7 @@ UpdateEmuWarmstart lea 1,A0 ; Get the buffer page number in A0 lea 1,A1 ; Say page is inited (#1) + move.l D1,A1 _nkMMUMarkBacking ; Mark this page as outta here lea 1,A0 ; Logical Page number of the buffer @@ -1039,6 +1152,7 @@ UpdateEmuWarmstart lea 1,A0 ; Get the lo Page number in A0 lea 1,A1 ; Say page is inited (#1) + move.l D1,A1 _nkMMUMarkBacking ; Mark this page as outta here lea 1,A0 ; Get the lo Page number in A0 @@ -1054,8 +1168,14 @@ UpdateEmuWarmstart EndWith + + + rts + + + ;_______________________________________________________________________ <5> -; ZapVCBQueue - This routine goes through the VCB Queue, and calls HUnmountVol for each entry. +; ZapVCBQueue 2c7f2 - This routine goes through the VCB Queue, and calls HUnmountVol for each entry. ; ; Entry: A0 - IOParam Block ; A1 - Pointer to current Entry @@ -1064,25 +1184,60 @@ UpdateEmuWarmstart ; D1 - Preserved. ;_______________________________________________________________________ <5> + import SHUTDOWNMGRC_2CB90 + ZapVCBQueue - move.w D1,-(SP) ; save for re-entrancy. + movem.l D1/D4-D6,-(SP) ; save for re-entrancy. + moveq #0,D4 move.w vcbVRefNum(A1),D1 ; get a VRefNum + move.w vcbDrvNum(A1),D6 + move.w vcbDRefNum(A1),D4 move.l QLink(A1),-(SP) ; go on to the next VCB cmp.l D2,A1 move.l (SP)+,A1 beq.s @FlushTime ; have we reached the end? bsr.s ZapVCBQueue ; not yet, save the VRefNum, call self. @FlushTime + + tst D5 + beq.s @defsDo + cmp D5,D6 + beq.s @return +@defsDo + move.w D1,ioVRefNum(A0) ; set up the refNum in the PBlock. - _Eject _HUnMountVol ; shut the volume down. - move.w (SP)+,D1 ; restore crucial VRefNum + + tst D6 + bgt.s @skipCheck + + tst D4 + bge.s @return + + neg D4 + move D4,D6 +@skipCheck + + move.l A0,-(SP) + move.l D4,-(SP) + move.l D3,-(SP) + bsr SHUTDOWNMGRC_2CB90 + addq.l #8,SP + move.l (SP)+,A0 + + tst D0 + bne.s @return + + move D6,ioVRefNum(A0) + _Eject + +@return movem.l (SP)+,D1/D4-D6 Rts ; for reentrancy. ;_______________________________________________________________________ ; -; BlankDesktop +; BlankDesktop 2c846 ; ; Blank the whole deskstop. This fills the entire desktop with black. ; It used to be the case that we wanted the screen to go white on @@ -1099,6 +1254,7 @@ ZapVCBQueue ;_______________________________________________________________________ IMPORT AllocFakeRgns ; + IMPORT SHUTDOWNMGRC_2D4F0, SHUTDOWNMGRC_2D330 BlankDesktop @@ -1138,6 +1294,14 @@ BlankDesktop TST.B D5 ; If weÕre not supposed to close LCDs, BEQ.S @SkipClose ; then just go on. + + CLR.B -(SP) + BSR SHUTDOWNMGRC_2D4F0 + + CLR.B -(SP) + BSR SHUTDOWNMGRC_2D330 + + BSR YetAnother BSR CloseLCDVideo ; Otherwise, close Õem. @SkipClose @@ -1147,7 +1311,7 @@ BlankDesktop ;_______________________________________________________________________ ; -; CheckForSoftPowerOff +; CheckForSoftPowerOff 2c89c ; ; Check to see if this machine has a working PowerOff trap. ; @@ -1182,51 +1346,57 @@ CheckForSoftPowerOff ; if the video is of type LCD. If so, then close the video driver. ;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -CloseLCDFrame RECORD 0, DECR -CloseLCDCntBlk DS.B IOVQElSize ; control call parm block -CloseLCDSpBlk DS.B spBlock.spBlockSize ; Slot Manager param block. -CloseLCDFrameSize EQU * ; size of frame - ENDR +CloseLCDVideo -CloseLCDVideo -CloseLCDVideoRegs REG D1/A0-A1 - WITH CloseLCDFrame,spBlock - LINK A6,#CloseLCDFrameSize ; allocate variable space - MOVEM.L CloseLCDVideoRegs,-(SP) ; Save them regs - LEA CloseLCDSpBlk(A6),A1 ; Get pointer to spBlock - MOVEA.L A1,A0 ; Set pointer to A0 - CLR.B spSlot(A0) ; Set slot number - MOVEQ #0,D1 ; set spId to 0 - CLR.B spExtDev(A0) ; No external devices - MOVE.W #CatDisplay,spCategory(A0) ; Look for this slot's card - MOVE.W #TypVideo,spCType(A0) ; Make sure it is video - MOVE.W #DrSwApple,spDrvrSW(A0) ; Make sure it is from Apple - MOVE.B #1,spTBMask(A0) ; mark spDrvrHw field as donÕt care -@sNextLoop - MOVEA.L A1,A0 ; Get pointer to spBlock - MOVE.B D1,spId(A0) ; Set spID - _sNextTypesRsrc ; get the spsPointer - BNE.S @Done + Move.L (DeviceList), D0 + BEQ.B @L5 + MoveM.L A0-A2, -(A7) + Link A6, #-$40 +@L1 MoveA.L D0, A2 + MoveA.L (A2), A2 + IMPORT PMGRCALLEDBYSHUTDOWNMGRDEC4 + Bsr.L PMGRCALLEDBYSHUTDOWNMGRDEC4 + BNE.B @L2 + IMPORT PMGRCALLEDBYSHUTDOWNMGRDEE4 + Bsr.L PMGRCALLEDBYSHUTDOWNMGRDEE4 + BEQ.B @L4 +@L2 Move (A2), D0 + MoveA.L (UTableBase), A1 + AddQ #$1, D0 + Neg D0 + AsL #$2, D0 + MoveA.L $0(A1,D0.W), A1 + MoveA.L (A1), A1 + BTst.B #$3, $5(A1) + BEQ.B @L3 + Move.L #$1, -(A7) + Move (A2), D0 + Ext.L D0 + Move.L D0, -(A7) + IMPORT EXPANSIONBUSMGR_VEC01A8 + Bsr.L EXPANSIONBUSMGR_VEC01A8 + AddQ #$8, A7 + Bra.B @L4 +@L3 Lea.L -$40(A6), A0 + Move (A2), $18(A0) + _Close +@L4 Move.L $1E(A2), D0 + BNE.B @L1 + Unlk A6 + MoveM.L (A7)+, A0-A2 +@L5 Rts - MOVE.B spId(A0),D1 ; Save spId for later use - MOVE.B #sVidAttributes,spId(A0) ; read flag field in sRsrc - _sReadWord ; ...pointed to by spsPointer - BNE.S @sNextLoop ; no flags - find next sRsrc - MOVEQ.L #1< HJR - ENDWITH + IMPORT SHUTDOWNMGRC_2CC30 + +YetAnother + MOVEM.L D0-D2/A0-A1,-(SP) + BTST.B #6,$2409 + BEQ.S @return + BSR.L SHUTDOWNMGRC_2CC30 +@return MOVEM.L (SP)+,D0-D2/A0-A1 + RTS @@ -1312,7 +1482,6 @@ KillEDisk BNE.S @noEMMU ; IF we have an EMMU THEN MOVE.L A2,A0 ; get ptr to start of data area MOVE.L #BytesToKill,A1 ; get number of bytes to erase - MOVE.L #(0<<16)|hwEDiskProt,D0 ; _HwPriv EDisk write protect selector and "unprotect" parm BRA.S @unProtect ; ELSE @noEMMU MOVE.L CheckSumPtr(A0),A0 ; Get Ptr to the start of the checksum area, if it exists TST.L A0 ; Check if RAM Disk is using checksums @@ -1320,8 +1489,8 @@ KillEDisk MOVE.L A2,A0 ; base address of RAM disk is same as DataStartPtr @cksumOn ; ENDIF SUB.L A1,A1 ; Protect flag. Zero = Unprotect - MOVEQ #hwEDiskProt,D0 ; _HwPriv EDisk write protect selector @unProtect ; ENDIF + MOVEQ #hwEDiskProt,D0 ; _HwPriv EDisk write protect selector _HwPriv ; Write Enable the EDisk RAM CMPI.W #paramErr,D0 ; Does not clear D0 on success, Check for failure BEQ.S @Done ; -> enable failed. Bail out now or Bus Error! @@ -1445,7 +1614,13 @@ ShutDownCancelButton EQU 2 ; dialog item of Cancel button _ParamText ; set dialog parameters subq #4,sp ; room for DialogPtr + bsr VersionCheckingFunc + beq.s @oldDLOG + move.w #-20601,-(sp) + bra.s @doIt +@oldDLOG move.w #ShutDownDLOGID,-(sp) ; resource ID +@doIt clr.l -(sp) ; use heap storage move.l #-1,-(sp) ; put it in front _GetNewDialog @@ -1488,82 +1663,30 @@ exitFalse move.w #false,d0 ; allow shutdown to continue justExit move.l (sp)+,a2 ; restore a2 rts -;________________________________ -; -; Docking Dispatch Trap -; -DockInitSCC MOVEM.L D0-D2/A0-A2,-(SP) ; <3> - MOVE.W #UnimplementedTrapNumber,D0 ; does the _DockingDispatch trap exist? - _GetTrapAddress ,NEWTOOL - MOVEA.L A0,A1 - MOVE.W #$AA57,D0 - _GetTrapAddress ,NEWTOOL - CMPA.L A0,A1 - BEQ.S @Done ; -> no, skip it - MOVEQ #sccOn-256,D0 ; turn SCC power on - BSR.S @SCCPower - BSR.S InitSCC ; reset the SCC so it doesn't cause us trouble - MOVEQ #sccOff,D0 ; turn SCC power off - BSR.S @SCCPower -@Done MOVEM.L (SP)+,D0-D2/A0-A2 - RTS -@SCCPower - TestFor hwCbPwrMgr ; does this machine have a Power Manager? - BEQ.S @NoPMGR ; -> nope, skip - MOVE.B D0,-(SP) - MOVE.L SP,-(SP) ; pmRBuffer - MOVE.L (SP),-(SP) ; pmSBuffer - MOVE.W #1,-(SP) ; pmLength = 1 byte to send - MOVE.W #powerCntl,-(SP) ; pmCommand = power control - MOVEA.L SP,A0 ; point to the parameter block - _PMgrOp ; turn SCC power on or off - LEA pmRBuffer+4+2(SP),SP ; toss the parameter block and buffer -@NoPMGR RTS -InitBData - DC.B 9,$C0 ; do a hard reset - DC.B 9,$40 ; reset the channel - DC.B 4,$4C ; set async mode (magic?) - DC.B 2,$00 ; zero interrupt vector for dispatcher - DC.B 3,$C0 ; DCD not an auto-enable - DC.B 15,$00 ; no interrupts - DC.B 0,$10 ; reset ext/sts interrupts twice - DC.B 0,$10 - DC.B 1,$00 ; no interrupts -InitBLth EQU *-InitBData - -InitAData DC.B 9,$80 ; reset the channel - DC.B 4,$4C ; set async mode (magic?) - DC.B 3,$C0 ; DCD not an auto-enable - DC.B 15,$00 ; no interrupts - DC.B 0,$10 ; reset ext/sts interrupts twice - DC.B 0,$10 - DC.B 1,$00 ; no interrupts -InitALth EQU *-InitAData - - -InitSCC - TestFor SCCIOPExists ; see if we have a SCC IOP - bne.s @hasIOP ; if so, don't try to initialize it - MOVEA.L SCCWr,A0 ; point to SCC base write address (chan B) - MOVEA.L SCCRd,A1 ; point to SCC base read address (chan B) - LEA InitBData,A2 ; point to channel B init data - MOVEQ #InitBLth,D1 ; and set up the length - BSR.S @WriteSCC ; then init channel B - - ADDQ.W #ACtl,A0 ; adjust SCC addresses for channel A - ADDQ.W #ACtl,A1 - ; A2 points to channel A's init data - MOVEQ #InitALth,D1 ; init data length -@WriteSCC MOVE.B (A1),D2 ; read to make sure SCC is sync'ed up - BRA.S @2 ; delay for timing, too -@1 MOVE.L (SP),(SP) ; delay long for reset - MOVE.L (SP),(SP) - MOVE.B (A2)+,(A0) -@2 DBRA D1,@1 - -@hasIOP RTS - + +VersionCheckingFunc + + move.l ROMBase, a0 + + cmp.w #$077D, ROMHeader.MachineNumber(a0) + bne.s @zero + + cmp.b #$40, ROMHeader.ROMRelease(a0) + beq.s @one + + cmp.b #$45, ROMHeader.ROMRelease(a0) + beq.s @one + + cmp.b #$44, ROMHeader.ROMRelease(a0) + bne.s @zero + +@one moveq.l #1, d0 + rts + +@zero moveq.l #0, d0 + rts + endwith ENDP END diff --git a/Toolbox/Toolbox.make b/Toolbox/Toolbox.make new file mode 100644 index 0000000..1bb23bc --- /dev/null +++ b/Toolbox/Toolbox.make @@ -0,0 +1,75 @@ +# This makefile was missing. Here is a rudimentary reconstruction. +# Some toolbox managers were "dumped" instead of backported, to save time. + +ToolboxObjs = "{ObjDir}PackageMgr.a.o" ¶ + "{ObjDir}SegmentLoader.a.o" ¶ + "{ObjDir}ShutDownMgr.a.o" ¶ + "{ObjDir}ShutDownMgr.c.o" ¶ + "{ObjDir}Munger.a.o" ¶ + "{ObjDir}DeskMgr.a.o" ¶ + "{ObjDir}GetMgr.a.o" ¶ + "{ObjDir}TextEdit.lib" ¶ + "{ObjDir}ScrapMgr.a.o" ¶ + "{ObjDir}Printing.a.o" ¶ + "{ObjDir}SexyDate.a.o" + + +# Just guessing what the binaries should be called: +# *.lib for multi-file managers, *.a.o for single-file managers + +"{LibDir}Toolbox.lib" Ä {ToolboxObjs} + Lib {StdLibOpts} {ToolboxObjs} -o "{Targ}" + +"{ObjDir}PackageMgr.a.o" Ä "{ToolboxDir}PackageMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}PackageMgr.a" + +"{ObjDir}SegmentLoader.a.o" Ä "{ToolboxDir}SegmentLoader:SegmentLoader.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}SegmentLoader:SegmentLoader.a" + +"{ObjDir}ShutDownMgr.a.o" Ä "{ToolboxDir}ShutDownMgr:ShutDownMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}ShutDownMgr:ShutDownMgr.a" + +"{ObjDir}Munger.a.o" Ä "{ToolboxDir}Munger:Munger.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}Munger:Munger.a" + +"{ObjDir}DeskMgr.a.o" Ä "{ToolboxDir}DeskMgr:DeskMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}DeskMgr:DeskMgr.a" + +"{ObjDir}GetMgr.a.o" Ä "{ToolboxDir}GetMgr:GetMgr.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}GetMgr:GetMgr.a" + +"{ObjDir}SexyDate.a.o" Ä "{ToolboxDir}SexyDate.a" + Asm {StdAOpts} -o "{Targ}" "{ToolboxDir}SexyDate.a" + + +# The following libs are *not* part of Toolbox.lib + +AliasMgrDir = "{ToolBoxDir}AliasMgr:" +ComponentMgrDir = "{ToolBoxDir}ComponentMgr:" +DataAccessDir = "{ToolBoxDir}DataAccessMgr:" +ExpansionBusMgrDir = "{ToolBoxDir}ExpansionBusMgr:" +NotificationDir = "{ToolBoxDir}NotificationMgr:" +ToolboxEventDir = "{ToolBoxDir}ToolboxEventMgr:" +ControlMgrDir = "{ToolBoxDir}ControlMgr:" +DisplayMgrDir = "{ToolBoxDir}DisplayMgr:" +WindowMgrDir = "{ToolBoxDir}WindowMgr:" +MenuMgrDir = "{ToolBoxDir}MenuMgr:" +DialogDir = "{ToolBoxDir}DialogMgr:" +ResourceMgrDir = "{ToolBoxDir}ResourceMgr:" +ScriptMgrDir = "{ToolBoxDir}ScriptMgr:" +FontMgrDir = "{ToolBoxDir}FontMgr:" + +#include "{AliasMgrDir}AliasMgr.make" +#include "{ComponentMgrDir}ComponentMgr.make" +#include "{DataAccessDir}DataAccessMgr.make" +#include "{ExpansionBusMgrDir}ExpansionBusMgr.make" +#include "{NotificationDir}NotificationMgr.make" +#include "{ToolboxEventDir}ToolboxEventMgr.make" +#include "{ControlMgrDir}ControlMgr.make" +#include "{DisplayMgrDir}DisplayMgr.make" +#include "{WindowMgrDir}WindowMgr.make" +#include "{MenuMgrDir}MenuMgr.make" +#include "{DialogDir}DialogMgr.make" +#include "{ResourceMgrDir}ResourceMgr.make" +#include "{ScriptMgrDir}ScriptMgr.make" +#include "{FontMgrDir}FontMgr.make" diff --git a/Toolbox/ToolboxEventMgr/ToolboxEventMgr.a b/Toolbox/ToolboxEventMgr/ToolboxEventMgr.a index eaecf4f..f616e68 100644 --- a/Toolbox/ToolboxEventMgr/ToolboxEventMgr.a +++ b/Toolbox/ToolboxEventMgr/ToolboxEventMgr.a @@ -503,20 +503,6 @@ HandBySys ; <09Apr85> DoneGNE -; The following is a one-time check to see if the internal drive (SCSI ID in low -; memory) is up to speed by now. If so, then clear high bit of PRAM startup -; device timeout value (PRAM address $01, byte length) to indicate that device -; 0 is there (and the startup code will wait for it at the next boot). - - BTST.B #7,SCSIPoll ; bit 7 is cleared by InitSCSIMgr - BNE.S @1 ; don't poll if we've already done it once - CMP.L #20*60,Ticks ; have we been running for 20 seconds? - BLO.S @1 ; no, too early yet - BSET.B #7,SCSIPoll ; set it so we don't do it again - BSR TryDevice ; see if that device is out there - -@1 - ; see if there was no event, if so do a get mouse to tickle tracking ; Historical note: by this time, an FKey is made to look like "no event", in which <13Jan86 JTC> ; case the mouse update is done... @@ -617,75 +603,6 @@ GotDActive CLR D2 ;flag the deactivate BRA.S GotActCommon ;go use common code -;-------------------------------------------------------------------------- -; -; TryDevice -- we do a one-time check of the SCSI ID for the internal hard -; disk some number of seconds after bootup. Since the internal disk is -; powered from the CPU's power supply, it is likely that the startup code -; will be ready to boot off a floppy before the disk has spun up to full -; speed. Unless we have some way to know if there is an internal drive, -; the start code won't know whether or not to wait for the device. This -; 'lightning bolt' happens once per bootup, setting a field in parameter -; RAM that the startup code looks at. If we find a SCSI device ready that -; corresponds to the internal disk SCSI ID stored in parameter RAM, then -; we set a field in parameter RAM so the startup code will wait for it -; at the next bootup. This introduces some hysteresis in the process if the -; user changes the ID of his internal drive, but it was deemed to be more -; preferable than the alternative of a Control Panel setting to enable and -; disable waiting for the internal hard disk. The default ID to check is -; 0, but can be changed in parameter RAM (which gets stored into the SCSIPoll -; variable by InitSCSIMgr). -; - -TryDevice ; This subroutine new - CLR.L -(SP) ; 6-byte Test Unit Ready command block - CLR.L -(SP) ; (6 zeroes) and 2-byte return value - _SCSIGet ; arbitrate for the SCSI bus - TST.W (SP) ; success? - BNE.S TryDevDone ; if arbitrate failed, don't change PRAM - MOVE.B SCSIPoll,D0 ; get SCSI ID of the int. drive - AND.B #$07,D0 ; mask off ID bits - MOVE.W D0,-(SP) ; push SCSI ID for the select - - _SCSISelect ; try to select (max. wait 250 ms.) - TST.W (SP) ; success? - BEQ.S SelectOK ; branch if select succeeded - - _DisableDynWait ; don't wait for that id on bootup - BRA.S TryDevDone ; exit - -SelectOK - PEA 2(SP) ; address of Test Unit Ready command - MOVE.W #6,-(SP) ; length of Test Unit Ready command - _SCSICmd ; do the command - ; - ; If something went wrong with the command, then we need to do - ; SCSIComplete anyway, so it isn't necessary to check the - ; return value. Since we don't need the space for the command - ; block any more, we just reuse it for the status and message - ; values (each a word) returned by SCSIComplete. Before pushing - ; anything else, these EA's are 2(sp) and 4(sp), so we PEA 2(sp) - ; for the first (which adds 4 bytes to the stack), and PEA 8(sp) - ; for the second [PEA 4+4(sp)]. - ; - PEA 2(SP) ; address for status value - PEA 8(SP) ; address for message value - MOVEQ.L #60,D0 ; maximum number of ticks to wait - MOVE.L D0,-(SP) ; push it - _SCSIComplete ; wrap things up, ignore return code - ; - ; If we got this far, then there is a device 0, so enable timeout - ; - _EnableDynWait ; startup code will wait for dev. 0 - -TryDevDone - ADDQ.L #8,sp ; clean up local variables - RTS - - - ENDPROC - - ;____________________________________________________________________________________ ; ; Proc WaitNextEvent diff --git a/Toolbox/ToolboxEventMgr/ToolboxEventMgrPatches.a b/Toolbox/ToolboxEventMgr/ToolboxEventMgrPatches.a index cdd1a44..cfb1262 100644 --- a/Toolbox/ToolboxEventMgr/ToolboxEventMgrPatches.a +++ b/Toolbox/ToolboxEventMgr/ToolboxEventMgrPatches.a @@ -143,191 +143,4 @@ ClearSysErrorUpdateRect installproc (Plus,SE,II,Portable,IIci) endproc - if not forROM then -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; GetNextEvent/EventAvail Ñ fix 32-bit activation bug - -; A bug occurs in the IIci ROM under 32-bit mode. The high bit of CurActivate and CurDeactivate -; are used as flags to indicate that the events have already been sent. (0 in either also means that -; the event was sent.) The problem is that the ROM code (written for 24-bit machines) refers to the -; windowKind field without stripping off this high bit. Under some circumstances, this would cause -; a bus error. Since the code that checks the window is only used to set the system/application bit -; in the modifiers of the activate/deactivate event, and that bit was never documented in a released -; version of Inside Mac. (and no one uses it), we can fix the bug by getting rid of the code that -; sets the system/application bit. This patch to CheckActivate eliminates the code to set the -; system/application bit. - -FixCheckActivate comefrompatchproc _OSEventAvail,AfterOSEventAvailInCheckActivate,(IIci,using32BitHeaps) - - lea ComeBackHere,a1 ; after doing the OSEventAvail, come back here - move.l a1,ReturnAddressDepth(sp) ; jam in that return address - jmpOld ; go do the OSEventAvail - -ComeBackHere - MOVE.W #activateEvt,(A0)+ ; flag it as (de)activate event - MOVE.L D1,(A0) ; the windowPtr is the message - - jmpROM AfterSystemUserWindowInCheckActivate - - endproc - endif -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; GetNextEvent - Make sure current port is valid before calling _GetMouse - -; This is mostly for the sake of the journalling driver. Before _GetNextEvent calls _GetMouse, check -; to see if the Window Manager exists by checking WWExist. (QDExist is also checked in the process, but -; thatÕs fine.) If the Window Manager exists, set the port to the Window Manager port before calling -; _GetMouse. If thereÕs no Window Manager, the call to _GetMouse is skipped. - -SetWindowMgrPort ComeFromPatchProc _GetMouse,AfterGetMouseInGetNextEvent,(Plus,SE,II,Portable,IIci) - - tst.w WWExist ; See if the Window Manager & QuickDraw exist - bne.s @backToGetNextEvent ; If WMgr isnÕt there, donÕt call _GetMouse - -; Window Mananger exists. Set the port to the Window ManagerÕs port before calling _GetMouse - - sub.w #4,sp - move.l sp,-(sp) - _GetPort ; Save the current port on the stack - - move.l WMgrPort,-(sp) - _SetPort ; Set the port to the Window ManagerÕs port - move.l 8(sp),-(sp) ; Copy the original _GetMouse parameter - jsrOld ; Call _GetMouse - - _SetPort ; Old port is already on the stack. - -@backToGetNextEvent - add.w #8,sp ; Remove return address and parameter from stack - jmpROM AfterGetMouseInGetNextEvent - ENDPROC - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; Come-from patch on _GetResource inside GetNextEvent to ignore FKEYs on the Mac Plus <9> - -; If called from GetNextEvent trying to load an FKEY, abort out so that the -; event record is passed to the application. FKEYs are handled by SystemEvent on the Plus. - -; Note that this FKEY patch is rarely invoked, and only in bizarre circumstances. -; Due to a bug in the Mac Plus ROM, a valid FKEY event always fails the range check (it -; compares ASCII 0 through 9 (i.e. $30 to $39) to decimal 0 through 9), and GetNextEvent -; never tries to invoke the FKEY. However, it may try to load an FKEY when an invalid key -; combination is held down. For example, shift-cmd-enter is really shift-cmd-$03, which because -; of the range checking problem causes FKEY 3 to be loaded. Someday we may want to reassess whether -; this patch is more trouble than it's worth. - -LoadFKEYInGetNextEvent ComeFromPatchProc _GetResource,AfterGetResourceInTryFKey,(Plus) - - LEA 14(SP), SP ; Clean off the stack - jmpROM DoneGNE ; Go where we are supposed to - - endproc - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; Come-from patch on _GetResource inside GetNextEvent to disable FKEYs from the keypad <9> - -; Note that even though this is a come-from on the same label as LoadFKEYInGetNextEvent on -; the Plus, it's doing different things. On the Plus, FKEY handling was moved into SystemEvent. -; On the SE and II, it was moved back out so that FKEY's are handled before calling SystemEvent. -; So, it's valid for GetNextEvent to get an FKEY on the SE and II where it wasn't valid on the -; Plus. - -KeypadFKEYInGetNextEvent ComeFromPatchProc _GetResource,AfterGetResourceInTryFKey,(SE,II) - - TST.B ScrDmpEnb ; Check the ScrDmpEnb flag <11> - BNE.S moreChecks ; if it is not false, do some more checks <11> - MOVE.L (SP)+, A0 ; otherwise, return NIL. <11> - ADDQ.L #6, SP ; <11> - CLR.L (SP) ; <11> - JMP (A0) ; <11> - -moreChecks ; <11> - MOVE.B evtMessage+2(A3), D0 ; Get the raw keycode - CMP.B #$3F, D0 ; Keyboard or Keypad? - blsOld ; Keyboard -- execute normally - - LEA 14(SP), SP ; Clean off the stack - jmpROM TrySysEvent ; Go where we are suppossed to - - endproc - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; Come-from patch on _GetResource inside GetNextEvent to honor ScrDmpEnb <11> - -; The portable and IIci ROMS are fixed to do most of what KeypadFKEYInGetNextEvent does. They only -; require a fix to honor the ScrDmpEnable BOOLEAN in low-memory. - -CheckInhibitFKEYInGetNextEvent ComeFromPatchProc _GetResource,AfterGetResourceInTryFKey,(Portable,IIci) - - TST.B ScrDmpEnb ; Check the ScrDmpEnb flag - bneOld ; if it is not false, try to get the FKEY - MOVE.L (SP)+, A0 ; otherwise, return NIL. - ADDQ.L #6, SP - CLR.L (SP) - JMP (A0) - - endproc - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ -; GetOSEvent/OSEventAvail -- change ROM GetNextEvent to look for high level (PPC) events. -; This code should be rolled inline into GetNextEvent. We use comefrom patches for -; convenience only. - -HLEAvail ComeFromPatchProc _OSEventAvail,AfterOSEventAvailInGetNextEvent,(Plus,SE,II,Portable,IIci) - import shareHLEPatch:CODE - -; must look for OS events before we waste any more time - jsrOld ; call through - jmp shareHLEPatch ; go share code - - EndProc ; HLEAvail - -GetNextHLE ComeFromPatchProc _GetOSEvent,AfterGetOSEventInGetNextEvent,(Plus,SE,II,Portable,IIci) - entry shareHLEPatch:CODE - -; must try to get OS events before we waste any more time - jsrOld ; call through - -shareHLEPatch - tst.w EvtNum(a3) ; find something? - bne.s Return ; if so, get out without further ado - -; no OS events. Should we look for high-level events? - move.w 12(a6),d0 ; get the caller's event mask - btst #highLevelEvtBit,d0 ; high-level events requested? - beq.s ReturnFalse ; if not, just go on - move.w WeKnowProcMgrExists,d0 ; do we know whether OSDispatch is OK? - bne.s CallGetHLEvent ; if so, go do it right now - -; We need to check for high level events. Determine whether Process Mgr is around yet. - move.l #gestaltOSAttr,d0 ; Gestalt implemented by Process Mgr - _Gestalt ; ask about Process Mgr - blt.s ReturnFalse ; exit now if we're still too early - lea WeKnowProcMgrExists,a0 ; get address of cheater flag - st (a0) ; remember not to check again - -; Ask the Process Mgr for a high level event. -CallGetHLEvent - clr.w -(sp) ; allocate result storage - move.w 12(a6),-(sp) ; pass event mask - move.l a3,-(sp) ; pass address of event record - tst.w d3 ; EventAvail or GetNextEvent? - seq -(sp) ; pass Boolean: GNE - true, EA - false - _GetNextHighLevelEvent ; call Processs Mgr - move.w (sp)+,d0 ; pop result -Return - rts - -; Exit where we have to restore d0 to say ÒfalseÓ -ReturnFalse - moveq #0,d0 ; say false - bra.s Return ; joint exit - -; Flag whether we know Process Mgr exists -WeKnowProcMgrExists dc.w 0 - - EndProc ; GetNextHLE - -;ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ - end diff --git a/Toolbox/WindowMgr/WindowMgr.make b/Toolbox/WindowMgr/WindowMgr.make index ae2e1cb..632a67b 100644 --- a/Toolbox/WindowMgr/WindowMgr.make +++ b/Toolbox/WindowMgr/WindowMgr.make @@ -32,8 +32,8 @@ WindowMgrObjs = "{ObjDir}WindowMgr.a.o" Link {StdLOpts} {StdAlign} -rt WDEF=1 -o "{Targ}" "{ObjDir}RoundedWDEF.a.o" || Exit 1 -"{LibDir}WindowMgr.lib" Ä {WindowMgrObjs} - Lib {StdLibOpts} -o "{Targ}" {WindowMgrObjs} +# "{LibDir}WindowMgr.lib" Ä {WindowMgrObjs} +# Lib {StdLibOpts} -o "{Targ}" {WindowMgrObjs} "{ObjDir}LayerMgr.c.o" Ä "{WindowMgrDir}LayerMgr.c"