mirror of
https://github.com/elliotnunn/mac-rom.git
synced 2024-12-27 10:29:32 +00:00
basing classic on shaky master branch
This commit is contained in:
parent
6d103981d8
commit
8164d94cf8
Binary file not shown.
@ -204,8 +204,6 @@ Features = hasRISCV0ResMgrPatches
|
||||
hasCQD ¶
|
||||
hasDisplayMgr ¶
|
||||
hasDisplayMgrWindows ¶
|
||||
hasEDisk ¶
|
||||
hasEgret ¶
|
||||
hasExtendedCharacterSet ¶
|
||||
hasGDU ¶
|
||||
hasIdle ¶
|
||||
@ -219,7 +217,6 @@ Features = hasRISCV0ResMgrPatches
|
||||
hasVISA2 ¶
|
||||
hasWaimeaVIA2 ¶
|
||||
isUniversal ¶
|
||||
hasPwrControls ¶
|
||||
hasPwrMgrClock ¶
|
||||
hasSplineFonts ¶
|
||||
hasVIAClock ¶
|
||||
|
@ -135,9 +135,10 @@ DisassemblerFileName str16 'Disassembler'
|
||||
StartupScreenFileName str16 'StartUpScreen'
|
||||
HelloFileName str16 'Finder'
|
||||
ClipboardFileName str16 'Clipboard'
|
||||
ClassicFileName str16 'Classic'
|
||||
|
||||
NumFCBs dc.w 10 ; number of FCBs to allocate at boot
|
||||
NumEvents dc.w 20 ; number of event queue elements
|
||||
NumFCBs dc.w 40 ; number of FCBs to allocate at boot
|
||||
NumEvents dc.w 48 ; number of event queue elements
|
||||
|
||||
SystemHeapSize128K dc.l $4300 ; size of system heap for 128K system (never used)
|
||||
SystemHeapSize256K dc.l $8000 ; size of system heap for 256K system (never used)
|
||||
@ -147,99 +148,6 @@ SystemHeapSize dc.l $20000 ; size of system heap (used for pre-7.0)
|
||||
|
||||
Boot
|
||||
|
||||
; There are three things that can happen here.
|
||||
; 1) Successful boot; control passed to the code in the 'boot' (2) resource.
|
||||
; 2) Old system file; no 'boot' (2) resource; continue booting; get patches from System data fork
|
||||
; 3) Failed boot; call Reboot vector.
|
||||
;
|
||||
; The main boot code below will never return in case 1, but in case 2 or 3 it will return with
|
||||
; a result code in D0. The result code is noErr for an old system file (case 2 above), and some
|
||||
; other error otherwise (case 3 above).
|
||||
;
|
||||
; This section here is used on older ROMs that do not understand the result values. It has hardcoded
|
||||
; ROM offsets of where to continue booting for cases 2 and 3.
|
||||
|
||||
tst.w ROM85 ; check for very old ROMs
|
||||
bmi.s BadROM
|
||||
|
||||
move.l ROMBase,a0 ; get the ROM version number
|
||||
move.w 8(a0),d1
|
||||
moveq #-2,d6 ; start before the beginning of the table
|
||||
NextROM
|
||||
addq.w #2,d6 ; advance to the next entry in the table
|
||||
move.w ROMVersionTable(d6.w),d0 ; the end of the table?
|
||||
bz.s MainBootCode ; yes, this is a new ROM that directly calls MainBootCode
|
||||
cmp.w d0,d1 ; the right ROM?
|
||||
bne.s NextROM ; no, go on to the next one
|
||||
|
||||
; At this point, D6.W contains an offset into all of the ROM-specific tables.
|
||||
; Next, set the system heap size for pre-Mac II ROMs where it isnÕt growable.
|
||||
|
||||
cmp.b #$76,d1 ; is this an old ROM that we must help?
|
||||
bhi.s NoSysZoneResizeNeeded ; no, system heap is already growable
|
||||
|
||||
move.l SysZone,a0 ; the one true heap
|
||||
add.l SystemHeapSize,a0 ; proper size of the heap
|
||||
_SetAppBase
|
||||
move.l SysZone,TheZone ; set the zone to system heap
|
||||
NoSysZoneResizeNeeded
|
||||
|
||||
; Call the boot code, and handle errors that might occur.
|
||||
|
||||
addq #4,sp ; pop off the return address into the ROM
|
||||
move.l sp,d7 ; here is the place for PB calls to be used
|
||||
bsr.s MainBootCode ; do normal boot code
|
||||
|
||||
move.w AfterInitResourcesTable(d6.w),d1 ; get ROM offset for continuing 6.0-style boot
|
||||
tst.w d0 ; check and see if there was an error
|
||||
bz.s JoinROM ; no error, join the ROM to continue booting
|
||||
move.w RebootTable(d6.w),d1 ; get ROM offset for failing and rebooting
|
||||
|
||||
JoinROM
|
||||
move.l ROMBase,a0
|
||||
jmp 0(a0,d1.w) ; jump to the routine
|
||||
|
||||
BadROM
|
||||
moveq #dsNoPatch,d0 ; canÕt boot on this ROM
|
||||
_SysError
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
ROMVersionTable
|
||||
|
||||
; ROM version numbers of old ROMs that have old-fashioned boot code
|
||||
|
||||
dc.w $0075 ; Plus
|
||||
dc.w $0276 ; SE
|
||||
dc.w $0178 ; II
|
||||
dc.w $037A ; Portable
|
||||
dc.w $067C ; IIci
|
||||
dc.w 0 ; end of table
|
||||
|
||||
AfterInitResourcesTable
|
||||
|
||||
; ROM offsets for continuing booting after InitResources
|
||||
|
||||
dc.w $0A44 ; Plus
|
||||
dc.w $090E ; SE
|
||||
dc.w $0F1C ; II
|
||||
dc.w $30E6 ; Portable
|
||||
dc.w $1D96 ; IIci
|
||||
|
||||
RebootTable
|
||||
|
||||
; ROM offsets for Reboot routine
|
||||
|
||||
dc.w $0B82 ; Plus
|
||||
dc.w $0A52 ; SE
|
||||
dc.w $11AE ; II
|
||||
dc.w $336E ; Portable
|
||||
dc.w $203E ; IIci
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
MainBootCode
|
||||
|
||||
; This code will either boot the machine, and not return or return with an error in d0.
|
||||
; If the error returned is noErr (0), then it means that this is an old-style System file,
|
||||
; and the older ROM booting code should be used.
|
||||
@ -255,16 +163,16 @@ GetFileNames
|
||||
lea SystemFileName,a0
|
||||
lea SysResName,a1
|
||||
moveq #16,d0
|
||||
_BlockMove
|
||||
_BlockMoveData
|
||||
lea FinderFileName,a0
|
||||
lea FinderName,a1
|
||||
moveq #16,d0
|
||||
_BlockMove
|
||||
_BlockMoveData
|
||||
lea ClipboardFileName,a0
|
||||
LEA ScrapTag,A1
|
||||
MOVE.L A1,ScrapName ; point ScrapName to ScrapTag
|
||||
moveq #16,d0
|
||||
_BlockMove
|
||||
_BlockMoveData
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
@ -275,34 +183,53 @@ InitializeEventManager
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
InitializeFileSystem
|
||||
|
||||
move.w NumFCBs,d0
|
||||
_InitFS ; note to future generations: InitFS trashes A2!
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
MountStartupDisk
|
||||
|
||||
move.l d7,a0 ; point to parameter block
|
||||
move.w BootDrive,ioDrvNum(a0) ; set up drive number
|
||||
_MountVol ; mount startup disk
|
||||
bnz.s Return ; reboot if thereÕs an error
|
||||
bz @noErr ; reboot if thereÕs an error, with one exception:
|
||||
cmp.w #volOnLinErr,d0 ; "drive volume already on-line at MountVol"
|
||||
bne Return
|
||||
@noErr
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
FindBlessedFolder
|
||||
|
||||
moveq #0,d0
|
||||
move.w ioVRefNum(a0),d0
|
||||
|
||||
move.l d0,-(sp)
|
||||
clr.l -(sp)
|
||||
move.l #-1,-(sp)
|
||||
move.l #$0001011C,d0
|
||||
dc.w $FE22
|
||||
|
||||
cmp.w #-1,d0
|
||||
bne.s @refnumNotFirst
|
||||
move.l #$00000C04, d0
|
||||
dc.w $FE22
|
||||
addq #4,sp
|
||||
@refnumNotFirst
|
||||
|
||||
move.l d0,ioWDDirID(a0)
|
||||
clr.l ioFileName(a0) ; ? we donÕt want the diskÕs name
|
||||
clr.w ioVolIndex(a0) ; ? use the vRefNum left over from MountVol
|
||||
bra.s @straightToOpenWD
|
||||
|
||||
clr.l ioFileName(a0) ; we donÕt want the diskÕs name
|
||||
clr.w ioVolIndex(a0) ; use the vRefNum left over from MountVol
|
||||
_HGetVInfo ; see if there is a system folder
|
||||
bnz.s UnmountAndReturn ; if we fail, tell our caller
|
||||
bnz UnmountAndReturn ; if we fail, tell our caller
|
||||
move.l ioVFndrInfo+4(a0),a4 ; save dirID of startup app. in a4 for pre-7.0 systems
|
||||
move.l ioVFndrInfo(a0),ioWDDirID(a0) ; get the dirID of system folder
|
||||
bz.s @noFolder ; if it is 0, boot the root
|
||||
move.l #'ERIK',ioWDProcID(a0) ; magic incantation from hell
|
||||
|
||||
@straightToOpenWD
|
||||
_OpenWD ; use the vRefNum left over from MountVol
|
||||
bnz.s UnmountAndReturn ; canÕt open, tell our caller
|
||||
bnz UnmountAndReturn ; canÕt open, tell our caller
|
||||
_SetVol ; make blessed folder the default volume
|
||||
@noFolder
|
||||
|
||||
@ -313,7 +240,67 @@ InitializeResourceManager
|
||||
subq #2,sp ; make room for function result
|
||||
_InitResources ; open that system file
|
||||
tst.w (sp)+ ; did we get it?
|
||||
bmi.s InitResourcesFailed ; yes, weÕre OK
|
||||
bmi InitResourcesFailed ; yes, weÕre OK
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
subq #4,sp
|
||||
move.l #'vers',-(sp)
|
||||
move.w #1,-(sp)
|
||||
_GetResource
|
||||
move.l (sp)+,d5
|
||||
beq.s @noVersResource
|
||||
|
||||
move.l d5,a0
|
||||
move.l (a0),a0
|
||||
moveq #0,d5
|
||||
move.w (a0),d5
|
||||
|
||||
clr.l -(sp)
|
||||
move.l d5,-(sp)
|
||||
move.l #$00020C03,d0
|
||||
dc.w $FE22
|
||||
addq #8,sp
|
||||
@noVersResource
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
clr.b ResLoad
|
||||
subq #2,sp
|
||||
pea ClassicFileName
|
||||
_OpenResFile
|
||||
st ResLoad
|
||||
move.w (sp)+,d5
|
||||
bmi @noClassicFile
|
||||
|
||||
subq #4,sp
|
||||
move.l #'gvrs',-(sp) ; no docs on this resource
|
||||
move.w #1,-(sp)
|
||||
_Get1Resource
|
||||
move.l (sp)+,d6
|
||||
bz.s @noGvrsResource
|
||||
|
||||
move.l d6,a0
|
||||
move.l (a0),a0
|
||||
move.l (a0),(sp) ; really does not look right
|
||||
@noGvrsResource
|
||||
|
||||
move.w d5,-(sp)
|
||||
_CloseResFile
|
||||
@noClassicFile
|
||||
|
||||
move.l #$0002020A,d0 ; does the above set an argument for this?
|
||||
dc.w $FE22
|
||||
addq #8,sp
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
move.l d7,a0 ; get back our ParamBlock ptr
|
||||
move.w ioVRefNum(a0),-(sp) ; save ioVRefNum for _SetVol (not BootDrive!)
|
||||
move.w BootDrive,ioVRefNum(a0) ; call _MountVol on BootDrive
|
||||
_MountVol
|
||||
move.w (sp)+,ioVRefNum(a0) ; restore ioVRefNum for _SetVol
|
||||
_SetVol
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
@ -352,6 +339,7 @@ InitResourcesFailed
|
||||
|
||||
UnmountAndReturn
|
||||
|
||||
addq #8,sp ; oops! been leaking stack have we?
|
||||
move.w d0,-(sp) ; save the result code
|
||||
move.l d7,a0 ; point to parameter block
|
||||
_UnmountVol ; already set up (for HGetVInfo)
|
||||
@ -364,13 +352,13 @@ Return
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
bootBlocksSoFar: equ *-BootBlocks
|
||||
if bootBlocksSoFar > maxBootCodeSize then
|
||||
aerror &concat('boot blocks donÕt fit: ', \
|
||||
&i2s(bootBlocksSoFar),' bytes; ', \
|
||||
'maximum ',&i2s(maxBootCodeSize),' bytes')
|
||||
else
|
||||
dcb.b bootBlocksSize-bootBlocksSoFar,$DA
|
||||
endif
|
||||
; if bootBlocksSoFar > maxBootCodeSize then
|
||||
; aerror &concat('boot blocks donÕt fit: ', \
|
||||
; &i2s(bootBlocksSoFar),' bytes; ', \
|
||||
; 'maximum ',&i2s(maxBootCodeSize),' bytes')
|
||||
; else
|
||||
; dcb.b bootBlocksSize-bootBlocksSoFar,$DA
|
||||
; endif
|
||||
|
||||
; ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
|
||||
|
||||
|
@ -1387,7 +1387,6 @@ getHInfo move.l a6,-(sp) ; save regs <SM44>
|
||||
LEA SysCom,A0 ; A0 <- pointer to start of system globals
|
||||
@cont ; ENDIF
|
||||
LEA HeapStart,A1 ; A1 <- pointer to end of system globals.
|
||||
BSR FillWithOnes ; Fill system globals with ones.
|
||||
|
||||
BSR.L InitRomVectors ; initialize ROM vectorization
|
||||
|
||||
@ -1418,7 +1417,13 @@ getHInfo move.l a6,-(sp) ; save regs <SM44>
|
||||
|
||||
bsr SetupHWBases ; setup the hardware base address low mems
|
||||
|
||||
BSR InitSCC ; init the SCC
|
||||
JSR * ; init the SCC?
|
||||
movem.l D0-D7/A0-A5, -(sp)
|
||||
move.l #$1D4, -(sp)
|
||||
move.l #$00010800, d0
|
||||
dc.w $FE22
|
||||
addq.l #4, sp
|
||||
movem.l (sp)+, D0-D7/A0-A5
|
||||
|
||||
bsr.l InitMMUGlobals ; set up MMU globals
|
||||
|
||||
@ -1491,19 +1496,24 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
Move.l #emRecSize,(a0) ; size <SM40>
|
||||
ENDWITH ; <SM40>
|
||||
|
||||
IMPORT InterC_1cc0_MoveUnivInfoToSysHeap
|
||||
BSR.L InterC_1cc0_MoveUnivInfoToSysHeap
|
||||
; IMPORT InterC_1cc0_MoveUnivInfoToSysHeap
|
||||
; BSR.L InterC_1cc0_MoveUnivInfoToSysHeap
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
BSR.L initGestalt ; initialize Gestalt <SM39>
|
||||
BSR.L CreateAltiVecBufForEmulator
|
||||
BSR.L InitIntHandler ; initialize interrupt vectors and dispatch tables
|
||||
|
||||
BSR CheckForEgretOrCuda ; Do we have an Egret/Caboose/Cuda? <mc2>
|
||||
BNE.S @EInitDone ; -> Nope, don't be callin' shit
|
||||
BSR.L InitEgretOrCuda ; Initialize Egret or Cuda Manager
|
||||
nop
|
||||
nop
|
||||
; BSR CheckForEgretOrCuda ; Do we have an Egret/Caboose/Cuda? <mc2>
|
||||
; BNE.S @EInitDone ; -> Nope, don't be callin' shit
|
||||
; BSR.L InitEgretOrCuda ; Initialize Egret or Cuda Manager
|
||||
|
||||
IMPORT GestaltCudaFunc
|
||||
BSR.L GestaltCudaFunc
|
||||
@EInitDone
|
||||
; IMPORT GestaltCudaFunc
|
||||
; BSR.L GestaltCudaFunc
|
||||
;@EInitDone
|
||||
|
||||
|
||||
*************************************************************************************************
|
||||
@ -1555,10 +1565,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
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)
|
||||
@ -1568,15 +1574,11 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
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
|
||||
|
||||
BSR.L EnableOneSecInts ; allow the clock interrupts
|
||||
@ -1588,12 +1590,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
|
||||
MOVE #$2000,SR ; supervisor state, interrupts on
|
||||
|
||||
IMPORT RSETKMAP
|
||||
BSR.L RSETKMAP
|
||||
|
||||
IMPORT InterC_2bc0_DebugPrint
|
||||
BSR.L InterC_2bc0_DebugPrint
|
||||
|
||||
MOVEQ.L #10, D0
|
||||
_NewHandle ,Sys,Immed
|
||||
MOVE.L A0, D0
|
||||
@ -1626,15 +1622,8 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
IMPORT InitDeviceDispatch
|
||||
BSR.L InitDeviceDispatch
|
||||
|
||||
BTST.B #$6, ($2400)
|
||||
BNE.B @definitely
|
||||
BTst.B #$0, ($DD0)
|
||||
BEQ.B @dont
|
||||
@definitely
|
||||
|
||||
BSR SetScsiIdFromPram ; taken from SCSIMgrInit.a
|
||||
BSR.L InitSCSIMgr ; Init old and new SCSI Mgrs
|
||||
@dont
|
||||
|
||||
IMPORT InitExpansionMgr
|
||||
BSR.L InitExpansionMgr
|
||||
@ -1687,6 +1676,9 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
IF hasPwrControls THEN
|
||||
BSR.L PowerDownAll ; power down all peripheral subsystems
|
||||
ENDIF
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
BSR DrawBeepScreen ; Horst BeepmanhÕs patented gray screen
|
||||
|
||||
@ -1697,12 +1689,6 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
; place where StarTest can see it w/o an MMU
|
||||
|
||||
|
||||
|
||||
|
||||
import InterC_2780_FireWire
|
||||
bsr.l InterC_2780_FireWire
|
||||
|
||||
|
||||
;----------------------------------------------------------------
|
||||
; Initialize the File System.
|
||||
;----------------------------------------------------------------
|
||||
@ -1716,31 +1702,37 @@ BootRetry MOVE #$2700,SR ; disable interrupts
|
||||
;----------------------------------------------------------------
|
||||
; 3b6
|
||||
|
||||
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
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
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 <SM16>
|
||||
@nodiskmode
|
||||
|
||||
BSR.L INITSCSIBOOT ; allocate some memory for SCSI booting
|
||||
; and load third party SIMs (SCSI Interface
|
||||
; modules
|
||||
movem.l d0-d7/a0-a4, -(sp)
|
||||
clr.l -(sp)
|
||||
clr.l -(sp)
|
||||
move.l #$00020700, d0
|
||||
dc.w $FE22
|
||||
addq #8, sp
|
||||
movem.l (sp)+, d0-d7/a0-a4
|
||||
|
||||
IMPORT ATAMgr_5dae0
|
||||
BSR.L ATAMgr_5dae0
|
||||
IMPORT ATAMgr_5dde0
|
||||
BSR.L ATAMgr_5dde0
|
||||
|
||||
IMPORT InterC_2130_CardBus
|
||||
BSR InterC_2130_CardBus
|
||||
movem.l d0-d7/a0-a4, -(sp)
|
||||
jsr *
|
||||
movem.l (sp)+, d0-d7/a0-a4
|
||||
|
||||
movem.l d0-d7/a0-a4, -(sp)
|
||||
jsr *
|
||||
movem.l (sp)+, d0-d7/a0-a4
|
||||
|
||||
movem.l d0-d7/a0-a4, -(sp)
|
||||
jsr *
|
||||
movem.l (sp)+, d0-d7/a0-a4
|
||||
|
||||
bsr * + 1000
|
||||
|
||||
|
||||
|
||||
*************************************************************************************************
|
||||
@ -1877,225 +1869,11 @@ WhichBoard swap d7 ; get CPU type in hi word
|
||||
;________________________________________________________________________________________
|
||||
|
||||
SetUpTimeK
|
||||
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
|
||||
|
||||
MoveM.L D0-D2/A0, -(A7)
|
||||
MoveA.L ([$68FFEFD0.L],$18), A0
|
||||
|
||||
Tst.L A0
|
||||
BNE.B L10
|
||||
MoveA.L ([$68FFEFF0.L],$100), A0
|
||||
|
||||
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)
|
||||
|
||||
L13: MoveA.L ($1D4), A1
|
||||
BClr.B #$5, $1600(A1)
|
||||
Nop
|
||||
Move.B #$FF, $1200(A1)
|
||||
Nop
|
||||
Move.B #$A0, $1C00(A1)
|
||||
Nop
|
||||
|
||||
; Load timer with number of VIA ticks per millisecond - 3. There are 3 clocks of overhead
|
||||
; because it takes 1 clock for the timer to load, and 2 extra clocks because it has to count
|
||||
; through -1, instead of down to 0.
|
||||
|
||||
moveq.l #(NTicks-3)**$FF,d1 ; low byte of value to load into timer
|
||||
moveq.l #(NTicks-3)>>8,d2 ; high byte of value to load into timer
|
||||
|
||||
movea.l sp,a3 ; mark the stack
|
||||
lea TimerInt,a0 ; point to the interrupt handler
|
||||
move.l a0,AutoInt1 ; setup the interrupt handler
|
||||
lea TimingTable,a4 ; point to table of routines to time
|
||||
|
||||
@nextRoutine
|
||||
movea.l a4,a0 ; point to table entry
|
||||
adda.w (a4),a0 ; get routine address
|
||||
moveq.l #2,d0 ; make a quick run to get it into the cache
|
||||
lea @cacheLoaded,a2 ; setup return address
|
||||
jmp (a0) ; call the routine to time
|
||||
@cacheLoaded
|
||||
movea.l a4,a0 ; point to table entry
|
||||
adda.w (a4)+,a0 ; get routine address
|
||||
moveq.l #-1,d0 ; run until the timer interrupts
|
||||
lea @timedOut,a2 ; setup return address
|
||||
andi.w #$F8FF,sr ; enable interrupts
|
||||
jmp (a0) ; call the routine to time
|
||||
@timedOut not.w d0 ; convert to number of loop executions.
|
||||
|
||||
bne.s @skip_the_thing
|
||||
move.w #$ffff, d0
|
||||
@skip_the_thing
|
||||
|
||||
movea.w (a4)+,a0 ; get the address of the lowmem
|
||||
move.w d0,(a0) ; store the result
|
||||
|
||||
btst #6,$2400
|
||||
beq.b @dont
|
||||
MOVE.B ([$68FFEFD0],$0083),([$68FFEFD0],$008D) ; VIAIntBit+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<<ifIRQ)+(1<<ifT2),vIER(a1) ; Disable Timer 2 interrupts.
|
||||
NOP
|
||||
MOVE.L (A7)+,$0064
|
||||
MOVE (A7)+,SR
|
||||
MOVEM.L (A7)+,D1/D2/A1-A4
|
||||
move #$05C, TimeSCCDB
|
||||
move #$548, TimeSCSIDB
|
||||
move #$30E, TimeVIADB
|
||||
rts
|
||||
|
||||
TimerInt nop
|
||||
tst.b vT2C(a1) ; Reset the timer interrupt.
|
||||
nop
|
||||
movea.l a3,sp ; restore the stack pointer
|
||||
jmp (a2) ; just jump to the return address
|
||||
|
||||
TimingTable dc.w DbraTime-*,TimeDBRA ; simple DBRA loop timing
|
||||
dc.w SCCTime-*,TimeSCCDB ; SCC access timing
|
||||
dc.w SCSITime-*,TimeSCSIDB ; SCSI access timing
|
||||
dc.w VIATime-*,TimeVIADB ; VIA access timing
|
||||
dc.w 0 ; end of list
|
||||
|
||||
|
||||
DbraTime
|
||||
move.b d1,vT2C(A1) ; load low order byte
|
||||
move.b d2,vT2CH(A1) ; load high order byte & go.
|
||||
@loop
|
||||
dbra d0,@loop ; time an empty DBRA loop
|
||||
jmp (a2) ; return if loop expires
|
||||
|
||||
|
||||
SCCTime
|
||||
movea.l SCCRd,a0 ; point to SCC base read address
|
||||
move.b d1,vT2C(A1) ; load low order byte
|
||||
move.b d2,vT2CH(A1) ; load high order byte & go.
|
||||
@loop
|
||||
btst.b #3,$DD3
|
||||
bne.s @differentloop
|
||||
dbra d0,* ; time the SCC DBRA loop
|
||||
jmp (a2) ; return if loop expires
|
||||
@differentloop
|
||||
btst.b #0,(a0)
|
||||
dbra d0,@differentloop
|
||||
jmp (a2)
|
||||
|
||||
|
||||
SCSITime
|
||||
TestFor SCSI96_1Exists
|
||||
bne.s @normalTest
|
||||
|
||||
btst.b #6, $2400
|
||||
beq.s @normalTest
|
||||
|
||||
move.b d1, vT2C(a1) ; load low order byte
|
||||
move.b d2, vT2CH(a1) ; load high order byte & go.
|
||||
dbra d0, *
|
||||
jmp (a2)
|
||||
|
||||
@normalTest
|
||||
movea.l SCSIBase,a0 ; point to SCSI base address
|
||||
move.b d1, vT2C(a1) ; load low order byte
|
||||
eieioSTP
|
||||
move.b d2, vT2CH(a1) ; load high order byte & go.
|
||||
eieioSTP
|
||||
TestFor SCSI96_1Exists ; use macro to check if we have
|
||||
beq.s @loop80 ; SCSI96. Bra. if not
|
||||
@loop96
|
||||
btst.b #0, rSTA(a0) ; typical SCSIMgr96 loop
|
||||
dbra d0, @loop96 ; time the SCSI DBRA loop
|
||||
jmp (a2) ; return if loop expires
|
||||
|
||||
@loop80
|
||||
btst.b #0,sCSR(A0) ; typical SCSIMgr loop
|
||||
dbra d0,@loop80 ; time the SCSI DBRA loop
|
||||
jmp (a2) ; return if loop expires
|
||||
|
||||
|
||||
; ----------------------------------------------------------------------------------------------------- <H11>
|
||||
;
|
||||
; VIATime 5ca, in the IIci/IIfx/TERROR/HORROR ROMs, lives at 40x008BC. <H11>
|
||||
; --------
|
||||
; This means that the @loop btst.b #0,(A0) is at 40x008C8, and the dbra d0,@loop <H11>
|
||||
; is at 40x008CC. This code, "half cache-line aligned, when run on an 040 and above, will execute <H11>
|
||||
; in an on-chip cache SEPARATE FROM THE I-CACHE, called (appropriately), the DBRA-CACHE (not to be <H11>
|
||||
; confused with the Zebra-cache, or any other African equine). Why this is so important is that the <H11>
|
||||
; memory address the BTST.B is referencing is a VIA (not surprising, since this is a loop that <H11>
|
||||
; calculates Time-VIA-DB), and on 040s and above I/O space ($5xxxxxxx) is marked as non-cached and <H11>
|
||||
; serialized. At 20MHz and below, 040s will encounter a 'beat frequency' between the CPU and VIA <H11>
|
||||
; clocks, which will cause the CPU to miss both edges of the VIA clock on the first pass. This causes <H11>
|
||||
; the CPU to have to wait an extra VIA clock cycle (1.2µs * 2 = 2.4µs) to access the register on the <H11>
|
||||
; VIA about 21% of the time when running out of the DBRA CACHE. However, if the loop is unaligned and <H11>
|
||||
; does not run from the DBRA-cache and CPU = 040 @ ² 20MHz, it will synchronize with the VIA clock <H11>
|
||||
; on the first VIA clock cycle ZERO percent of the time. So, just to perform sadistic, saddalistic <H11>
|
||||
; necroequinia, ALL unaligned loop VIA accesses at 20MHz and below will take 2.4µs. This is important <H11>
|
||||
; (you knew I'd get to this part eventually, right?) when using TimeVIADB as an EXACT time instead of <H11>
|
||||
; a "minimum" type of timing constant. Poignant example - {Drivers}Sony:SonyMFM.a in mWrData uses <H11>
|
||||
; TimeVIADB to wait EXACTLY a certain amount of time (~ 235µs). However, the constant generated from <H11>
|
||||
; this loop when it is aligned is $2B0. But 1ms/$2B0 ~= 1.45µs, which indicates the bias of 79% of the <H11>
|
||||
; VIA accesses taking 1.2µs (1.2µs * (0.79 * $2B0) = 652µs) and 21% taking 2.4µs <H11>
|
||||
; (2.4µs * (0.21 * $2B0) = 346µs), giving (652+346 = 998µs. The loop in mWrData is unaligned so 100% <H11>
|
||||
; of the VIA accesses will take 2.4µs. So instead of the loop waiting 235µs (040 @ 20MHz = 162 times <H11>
|
||||
; thru the loop; 162 * 1.45 = ~235), it actually waits 162 * 2.4 = ~389 µs. This is bad since the <H11>
|
||||
; reason why this loop is waiting is for the floppy drive head to reach the correct place at the start <H11>
|
||||
; of a sector to begin writing and since that loop waits so long, sectors are written late and the <H11>
|
||||
; floppy is trashed. <H11>
|
||||
;
|
||||
; So by unaligning this loop it calculates a smaller number since each VIA access will then take 2.4µs <H11>
|
||||
; and mWrData will work correctly.
|
||||
;
|
||||
; In the case of 25MHz and above 040 processors, the rate that CPU and VIA clocks don't synchronize <H11>
|
||||
; drops to ~ 1% and above that the CPU clock rate is fast enough that it always guarantees that it <H11>
|
||||
; NEVER misses the first synchronization with the VIA clock. Unaligning the loop has no effect on <H11>
|
||||
; ³ 25MHz 040 processors. <H11>
|
||||
;
|
||||
; ----------------------------------------------------------------------------------------------------- <H11>
|
||||
|
||||
VIATime
|
||||
lea vIER(a1),a0 ; <40x008BC> point to a VIA register <H11>
|
||||
eieioSTP
|
||||
move.b d1,vT2C(A1) ; <40x008C0> load low order byte <H11>
|
||||
eieioSTP
|
||||
move.b d2,vT2CH(A1) ; <40x008C4> load high order byte & go. <H11>
|
||||
eieioSTP
|
||||
@loop
|
||||
btst.b #0,(A0) ; <40x008CA> typical VIA access loop <H11>
|
||||
dbra d0,@loop ; <40x008CE> time the VIA DBRA loop <H11>
|
||||
jmp (a2) ; <40x008D2> return if loop expires <H11>
|
||||
|
||||
|
||||
;________________________________________________________________________________________
|
||||
;
|
||||
@ -2598,6 +2376,19 @@ InitCrsrMgrMiddle
|
||||
MOVE.W D0,CrsrNew ; flag cursor as changed, turn on tracking
|
||||
MOVE.L D0,MouseMask ; No jerkiness with $FFFFFFFF mask
|
||||
|
||||
MOVEQ #14, D0 ; Install JCrsrTask to VBL, with a twist
|
||||
_NewPtrSysClear
|
||||
MOVE #1, 4(A0)
|
||||
MOVE #1, 10(A0)
|
||||
LEA TheCrsrVBLTask, A1
|
||||
move.l A1, 6(A0)
|
||||
_VInstall
|
||||
|
||||
RTS
|
||||
|
||||
TheCrsrVBLTask
|
||||
MOVE #1, 10(A0)
|
||||
MOVE.L JCrsrTask, -(SP)
|
||||
RTS
|
||||
|
||||
|
||||
@ -2655,8 +2446,6 @@ SetupHWBases
|
||||
|
||||
@BaseInitTable
|
||||
dc.w VIA1Exists,VIA ; init VIA1 base address
|
||||
dc.w SCCRdExists,SCCRd ; init SCC read base address
|
||||
dc.w SCCWrExists,SCCWr ; init SCC write base address
|
||||
IF hasIopScc THEN
|
||||
dc.w SCCIOPExists,SCCRd ; init SCC IOP read base address
|
||||
dc.w SCCIOPExists,SCCWr ; init SCC IOP write base address
|
||||
@ -2701,21 +2490,6 @@ SetupHWBases
|
||||
; d0 -> Addresses Map Flags, which system addresses are valid
|
||||
|
||||
SetupMiscSCSI
|
||||
IF hasSCSI96 THEN
|
||||
btst.l #SCSI96_1Exists, d0 ; see if we have 1st SCSI96
|
||||
beq.s @2ndSCSI96 ; bra. if not
|
||||
move.l SCSI96Addr1(a0), SCSIBase ; initialize the low mem <SM82>
|
||||
@2ndSCSI96
|
||||
btst.l #SCSI96_2Exists, d0 ; see if we have 2nd SCSI96
|
||||
beq.s @80based ;
|
||||
move.l SCSI96Addr2(a0), SCSI2Base ; initialize the low mem <SM82>
|
||||
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
|
||||
@ -2800,25 +2574,33 @@ LoadDrivers
|
||||
MOVE.L SP,A0
|
||||
CLR.B IOPermssn(A0) ; r/w permissions
|
||||
|
||||
;
|
||||
;ÑÑÑÑÑÑÑÑÑ RAM Disk Driver ÑÑÑÑÑÑÑÑÑ
|
||||
;
|
||||
; if we don't have an EDisk driver, this will not affect anything
|
||||
; to enable the EDisk, make sure that it is included in the rom resources
|
||||
|
||||
IF hasEDisk THEN
|
||||
LEA.L EDiskName,A1
|
||||
MOVEQ.L #$30,D2 ; and resource ID <SM84>
|
||||
BSR InstallDriver ; go install the driver <SM84>
|
||||
ENDIF
|
||||
;
|
||||
;ÑÑÑÑÑÑÑÑÑ Blue Box Driver ÑÑÑÑÑÑÑÑÑ
|
||||
;
|
||||
|
||||
lea BlueBoxSharedName, a1 ; Driver name
|
||||
move #-20423, d2 ; DRVR resource ID
|
||||
clr.l -(sp)
|
||||
bsr InstallDriver
|
||||
addq #4, sp
|
||||
|
||||
lea BlueBoxSharedName, a1
|
||||
bsr OpenDRVR
|
||||
|
||||
|
||||
;
|
||||
;ÑÑÑÑÑÑÑÑÑ LAN Disk Driver ÑÑÑÑÑÑÑÑÑ
|
||||
;ÑÑÑÑÑÑÑÑÑ AppleCD Driver ÑÑÑÑÑÑÑÑÑ
|
||||
;
|
||||
|
||||
IMPORT InterC_1890_InitLANDisk
|
||||
BSR InterC_1890_InitLANDisk
|
||||
lea AppleCDName, a1 ; Driver name
|
||||
move #-20424, d2 ; DRVR resource ID
|
||||
clr.l -(sp)
|
||||
bsr InstallDriver
|
||||
addq #4, sp
|
||||
|
||||
lea AppleCDName, a1
|
||||
bsr OpenDRVR
|
||||
|
||||
|
||||
;
|
||||
@ -2828,56 +2610,27 @@ LoadDrivers
|
||||
|
||||
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)
|
||||
btst #5, $240A
|
||||
beq @noBCScreen
|
||||
|
||||
IMPORT Interstix208c_1
|
||||
BSR.L Interstix208c_1
|
||||
|
||||
dc.w $defc, $001a
|
||||
;AddA #$1A, A7
|
||||
move.l #'only', -(sp)
|
||||
lea BCScreenName, a1
|
||||
move.w #-16515, d2
|
||||
bsr InstallDriver
|
||||
addq #4, sp
|
||||
@noBCScreen
|
||||
|
||||
ENDIF
|
||||
|
||||
|
||||
;
|
||||
;ÑÑÑÑÑÑÑÑÑ Backlight Driver ÑÑÑÑÑÑÑÑÑ
|
||||
;ÑÑÑÑÑÑÑÑÑ Sound Driver ÑÑÑÑÑÑÑÑÑ
|
||||
;
|
||||
|
||||
IF hasPwrControls THEN
|
||||
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 <SM84>
|
||||
MOVE.W #-16511,D2 ; and resource ID <SM84>
|
||||
BSR InstallDriver ; go install the driver <SM84>
|
||||
AddQ #$4, A7
|
||||
@noBacklight
|
||||
|
||||
MoveA.L A7, A0
|
||||
Clr.B $1B(A0)
|
||||
Bsr FROVideo
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
MOVE.L SP,A0 ; iopb on the stack <sm125>
|
||||
CLR.B IOPermssn(A0) ; r/w permissions <sm125>
|
||||
BSR FROVideo ; open the default video driver and setup video globals <SM19>
|
||||
LEA IOQElSize(SP),SP ; deallocate parameter block for device manager calls.
|
||||
|
||||
|
||||
;
|
||||
@ -2889,13 +2642,16 @@ LoadDrivers
|
||||
; whose entry point is an installation procedure. A 'SERD' installs itself into the unit
|
||||
; table, remaining closed and inactive until opened by a client.
|
||||
|
||||
btst #3, $DD3
|
||||
beq @noSerial
|
||||
|
||||
subq #4,sp ; allocate space for return value
|
||||
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
|
||||
beq.b @noSerial
|
||||
movea.l d0,a2
|
||||
movea.l (a2),a1
|
||||
SubQ #$4, A7
|
||||
@ -2915,29 +2671,16 @@ LoadDrivers
|
||||
_BlockMove
|
||||
jsr (a1) ; call the install code
|
||||
|
||||
@exitDrivers
|
||||
@noSerial
|
||||
rts
|
||||
|
||||
|
||||
STRING PASCAL
|
||||
|
||||
SndName DC.W '.Sound' ; <SM83>
|
||||
|
||||
IF hasEDisk THEN
|
||||
EDiskName DC.W '.EDisk' ; <SM83>
|
||||
ENDIF
|
||||
IF hasNewAge THEN
|
||||
NewAgeName DC.W '.NewAge' ; <SM16>
|
||||
ENDIF
|
||||
IF hasNetBoot THEN
|
||||
NetBootName DC.W '.netBOOT'
|
||||
ENDIF
|
||||
|
||||
IF hasPwrControls THEN
|
||||
BacklightName
|
||||
DC.W '.Backlight'
|
||||
ENDIF
|
||||
|
||||
BlueBoxSharedName
|
||||
DC.W '.BlueBoxShared'
|
||||
AppleCDName DC.W '.AppleCD'
|
||||
|
||||
IF hasBCScreen THEN
|
||||
BCScreenName
|
||||
@ -2970,6 +2713,7 @@ BCScreenName
|
||||
; app heap during system initialization time.
|
||||
;________________________________________________________________________________________
|
||||
|
||||
align 16
|
||||
DrawBeepScreen
|
||||
PEA -4(A5) ; set up QuickDraw global area
|
||||
_InitGraf
|
||||
@ -3107,6 +2851,16 @@ FROVideo MOVE.L A0,A1 ; save the param block pointer for _Open
|
||||
BNE.B @End
|
||||
|
||||
@TryDefault
|
||||
movem.l d0-d7/a0-a4, -(sp)
|
||||
subq #2, sp
|
||||
clr.l -(sp)
|
||||
move #$02EB, d0
|
||||
_DisplayDispatch
|
||||
move (sp)+, d0
|
||||
tst d0
|
||||
movem.l (sp)+, d0-d7/a0-a4
|
||||
bne.s @End
|
||||
|
||||
BSR OpnVidDeflt ; open the default video device, set video params
|
||||
BEQ @End ; -> got it
|
||||
|
||||
@ -4049,4 +3803,5 @@ OnePage equ $1000
|
||||
|
||||
|
||||
align 16
|
||||
dcb.b 64, 0
|
||||
end
|
@ -28,6 +28,7 @@
|
||||
StartMgrObjs = "{ObjDir}StartTop.a.o" ś
|
||||
"{ObjDir}StartInit.a.o" ś
|
||||
"{ObjDir}StartInterstix.c.o" ś
|
||||
"{ObjDir}Boot1.a.o" ś
|
||||
"{ObjDir}StartSearch.a.o" ś
|
||||
"{ObjDir}StartLibGlue.c.o" ś
|
||||
"{ObjDir}StartBoot.a.o" ś
|
||||
@ -239,6 +240,10 @@ Boot3Objects = "{ObjDir}Boot3.a.o"
|
||||
C {StdCOpts} -o "{Targ}" "{StartDir}UnivTestEnv:SONIC_Test.c" -i "{StartDir}UnivTestEnv:"
|
||||
|
||||
|
||||
"{ObjDir}Boot1.a.o" Ä "{StartDir}Boot1.a"
|
||||
Asm {StdAOpts} -o "{Targ}" "{StartDir}Boot1.a"
|
||||
|
||||
|
||||
"{ObjDir}Boot3.a.o" Ä "{IntAIncludes}LinkedPatchMacros.a" ś
|
||||
"{ObjDir}StandardEqu.d" ś
|
||||
"{AIncludes}Folders.a" ś
|
||||
|
@ -204,6 +204,8 @@ NoDefaultVal EQU $6666 ; the sign of the ... no default disk selected
|
||||
IMPORT ITTBOOT ; BootItt.c
|
||||
ENDIF
|
||||
|
||||
IMPORT BootBlocks
|
||||
|
||||
|
||||
|
||||
Locals RECORD {link},INCR
|
||||
@ -274,7 +276,19 @@ FindStartupDevice PROC EXPORT
|
||||
IMPORT GetDefaultStartup ; StartSearch.a
|
||||
|
||||
link A4, #frameSize
|
||||
|
||||
|
||||
|
||||
bsr SmallFunction2
|
||||
cmp.w #-1,d0
|
||||
bne.s @refnumNotFirst
|
||||
move.l #$00000C04,d0
|
||||
dc.w $FE22
|
||||
@refnumNotFirst
|
||||
|
||||
BSR SelectDevice
|
||||
|
||||
BRA @GotIt ; SKIP EVERYTHING
|
||||
|
||||
BSR EmbarkOnSearch ; Initialize our state.
|
||||
|
||||
BSR LoadSlotDrivers ; Default is a slot device, execute boot code
|
||||
@ -283,18 +297,12 @@ FindStartupDevice PROC EXPORT
|
||||
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
|
||||
|
||||
CLR.B -6(A4)
|
||||
|
||||
BSR LoadATADrivers
|
||||
|
||||
BSR OpenLANDiskDriver
|
||||
BSR SmallFunction1
|
||||
|
||||
BRA @FirstEntry ; First time through: keep original goal
|
||||
|
||||
@NextPass
|
||||
IF hasPwrControls THEN ; <SM7>
|
||||
WITH PmgrRec,pmCommandRec
|
||||
TestFor hwCbPwrMgr ; do we have Power Manager?
|
||||
beq.s @noSleep ; if not then skip time check
|
||||
@ -316,7 +324,6 @@ FindStartupDevice PROC EXPORT
|
||||
@waitsleep BEQ.S @waitsleep ; Wait for the drugs to take affect
|
||||
@nosleep
|
||||
ENDWITH
|
||||
ENDIF ; <SM7>
|
||||
|
||||
|
||||
Move.L D7, D7
|
||||
@ -340,28 +347,19 @@ FindStartupDevice PROC EXPORT
|
||||
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
|
||||
|
||||
MOVE.L #$00000C04,D0
|
||||
DC.W $FE22
|
||||
|
||||
@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.
|
||||
BEQ @NextPass ; Branch if we're at the end of the queue.
|
||||
|
||||
BSR SelectDevice ; Set up parameter block for this device.
|
||||
BSR CheckMouseEject ; Eject it if requested by mouse-down.
|
||||
@ -424,6 +422,13 @@ 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
|
||||
|
||||
MOVE.L A7,A0
|
||||
MOVE.L A0,-(SP)
|
||||
MOVE.L #$00010113,D0
|
||||
DC.W $FE22
|
||||
ADDQ #4,SP
|
||||
|
||||
CLR -4(A4)
|
||||
MOVE.L (SP), startPRAM(A4) ; store for later partition check
|
||||
MOVE.W (SP)+,D3 ; D3.L = <xx><xx><device-ID><partition>
|
||||
@ -621,95 +626,34 @@ LoadSCSIDrivers
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
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
|
||||
SmallFunction1
|
||||
pea lsdSRsrcID(a4)
|
||||
move.l #$00010112,d0
|
||||
dc.w $FE22
|
||||
addq #4,sp
|
||||
tst.w d0
|
||||
bz.s @dontUseD0
|
||||
move.w d0,d4
|
||||
@dontUseD0
|
||||
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
|
||||
SmallFunction2
|
||||
lea BootBlocks,a0 ; that's the ROM-based boot 1
|
||||
move.l a6,a1
|
||||
move.l #$400,d0
|
||||
_BlockMove
|
||||
cmp.w #'LK',(a6)
|
||||
bne.s @notBootBlocks ; should never happen because this is ROM
|
||||
|
||||
clr.l -(sp)
|
||||
move.l #$0001011C,d0
|
||||
dc.w $FE22
|
||||
addq #4,sp
|
||||
move.l d0,a2
|
||||
@notBootBlocks
|
||||
rts
|
||||
|
||||
|
||||
|
||||
@ -820,6 +764,23 @@ WaitForPollDrive
|
||||
;________________________________________________________________________________________
|
||||
|
||||
FindNextCandidate
|
||||
TST.L A2
|
||||
BNZ @doNotRestartSearch
|
||||
|
||||
CLR.L -(SP)
|
||||
MOVE.L #$0001011C,D0
|
||||
DC.W $FE22
|
||||
ADDQ #4,SP
|
||||
|
||||
MOVE.L D0,A2
|
||||
CMP.W #-1,D0
|
||||
BNE.S @DoneLooking
|
||||
|
||||
MOVE.L #$00000C04,D0
|
||||
DC.W $FE22
|
||||
RTS
|
||||
|
||||
@doNotRestartSearch
|
||||
BSR.S NextDQEntry ; Find the next drive queue entry.
|
||||
BNE.S @ckThisOut ; valid -> check out the drive
|
||||
; not: we've searched the whole queue.
|
||||
@ -950,12 +911,37 @@ DontEject RTS ; Return with status
|
||||
;________________________________________________________________________________________
|
||||
|
||||
GetStartupInfo
|
||||
MOVE.L A0,-(SP) ; save IOPB ptr for later
|
||||
|
||||
MOVEQ #0,D0
|
||||
MOVE.W ioPosOffset(A0),D0
|
||||
MOVE.L D0,-(SP)
|
||||
MOVE.L #$0001010F,D0
|
||||
DC.W $FE22
|
||||
ADDQ #4,SP
|
||||
|
||||
MOVE.L (SP)+,A0 ; restore that IOPB ptr to A0
|
||||
|
||||
TST.W D0 ; we asked Classic if we should use ROM blocks
|
||||
BZ @SearchDiskForBootBlocks
|
||||
|
||||
MOVEM.L A0/A1,-(SP)
|
||||
LEA BootBlocks,A0
|
||||
MOVE.L A6,A1
|
||||
MOVE.L #$400,D0
|
||||
_BlockMove
|
||||
MOVEM.L (SP)+,A0/A1
|
||||
BRA.S @TryTheseRomBootBlocks
|
||||
|
||||
@SearchDiskForBootBlocks
|
||||
MOVE.W #1,IOPosMode(A0) ; position relative to start
|
||||
CLR.L IOPosOffset(A0) ; start at byte position 0
|
||||
MOVE.L A6,IOBuffer(A0) ; load boot blocks at (A6)
|
||||
MOVE.L #$400,IOReqCount(A0) ; two 512-byte blocks
|
||||
_Read ; read the boot blocks
|
||||
BNE.S @Exit ; -> error, so exit
|
||||
|
||||
@TryTheseRomBootBlocks
|
||||
move.l a0,-(sp)
|
||||
BSR.L CacheFlush ; flush the caches
|
||||
move.l (sp)+,a0
|
||||
|
@ -1064,9 +1064,9 @@ POSTWRITE
|
||||
MOVE.L #$4000C,D0
|
||||
_WriteXPRam
|
||||
|
||||
IMPORT InterC_29c0_Wireless
|
||||
MACHINE MC68030
|
||||
BSR.L InterC_29c0_Wireless
|
||||
; IMPORT InterC_29c0_Wireless
|
||||
; MACHINE MC68030
|
||||
; BSR.L InterC_29c0_Wireless
|
||||
; MACHINE MC68000
|
||||
|
||||
ClkXit MOVE.W (SP)+,D0 ; pass back error code <30oct85> LAK
|
||||
|
Loading…
Reference in New Issue
Block a user