-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathboot.s
79 lines (69 loc) · 2.45 KB
/
boot.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
; Autostarting bootpart
include memory.s
include kernal.s
include ldepacksym.s
org $032a
dc.b $0b,$08 ;GETIN vector or BASIC next line address
dc.w AutoStart ;CLALL vector or BASIC line number
dc.b $9e,$32,$30,$36,$31 ;Sys instruction
dc.b $00,$00,$00
rorg $080d
BasicStart: lda #<(BootStart-AutoStart+BasicEnd-1)
sta BasicEnd+3
lda #>(BootStart-AutoStart+BasicEnd-1)
sta BasicEnd+4
BasicEnd:
rend
AutoStart: ldx #BootEnd-BootStart
CopyBoot: lda BootStart-1,x
dc.b $9d,$ff,$00 ;stx $00ff,x
dex
bne CopyBoot
jmp $0100
BootStart:
rorg $0100
ldy #$04
lda #$20
ClearScreen: sta $2000,x
inx
bne ClearScreen
inc ClearScreen+2
dey
bne ClearScreen
lda #$02
ldx #<loaderFileName
;ldy #>loaderFileName
iny
jsr SetNam
ldx $ba ;Use last used device
;ldy #$00 ;A is still $02 (file number)
dey
jsr SetLFS
jsr Open
ldx #$02 ;Open file $02 for input
jsr ChkIn
ldy #36
ShowMessage: lda #$0f
sta colors+12*40+1,y
lda message-1,y
and #$3f
sta $2000+12*40+1,y
dey
bne ShowMessage
sty $d020
sty $d021
lda #$84
sta $d018
LoadExomizer: jsr ChrIn ;Load Exomizer as unpacked data
sta exomizerCodeStart,y
iny
cpy #packedLoaderStart-exomizerCodeStart
bne LoadExomizer
lda #<loaderCodeStart
ldx #>loaderCodeStart
jsr LoadFile ;Load rest of loader code with Exomizer
jmp loaderCodeEnd ;Jump to InitLoader
loaderFileName: dc.b "00"
message: dc.b "HOLD SPACE/FIRE FOR SAFE MODE LOADER"
rend
BootEnd: