first commit
This commit is contained in:
48
boot.s
Normal file
48
boot.s
Normal file
@@ -0,0 +1,48 @@
|
||||
; Simple working bootblock
|
||||
MACHINE 68000
|
||||
ORG 0
|
||||
|
||||
dc.b 'D','O','S',0 ; DOS magic
|
||||
dc.l 0 ; Checksum
|
||||
dc.l 880 ; Rootblock
|
||||
|
||||
; Boot code - a1=IORequest, a6=ExecBase
|
||||
boot_start:
|
||||
; Save IORequest pointer (PC-relative)
|
||||
lea SavedA1(pc),a0
|
||||
move.l a1,(a0)
|
||||
|
||||
; Load game from disk
|
||||
move.w #2,28(a1) ; CMD_READ
|
||||
move.l #$20000,40(a1) ; io_Data
|
||||
move.l #11776,36(a1) ; io_Length (Exact game size)
|
||||
move.l #1024,44(a1) ; io_Offset
|
||||
|
||||
jsr -456(a6) ; DoIO
|
||||
|
||||
; Check for Error
|
||||
tst.l d0
|
||||
bne.s .loadError
|
||||
|
||||
; Restore IORequest pointer
|
||||
lea SavedA1(pc),a0
|
||||
move.l (a0),a1
|
||||
|
||||
; Turn off motor
|
||||
move.w #9,28(a1) ; CMD_MOTOR
|
||||
move.l #0,36(a1)
|
||||
jsr -456(a6) ; DoIO
|
||||
|
||||
; Jump to game
|
||||
jmp $20000
|
||||
|
||||
.loadError:
|
||||
; Error: Magenta Screen Loop
|
||||
move.w #$F0F,$dff180
|
||||
bra.s .loadError
|
||||
|
||||
SavedA1:
|
||||
dc.l 0
|
||||
|
||||
; Pad to 1024 bytes
|
||||
dcb.b 1024-(*-0),0
|
||||
Reference in New Issue
Block a user