-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbank.inc
130 lines (123 loc) · 2.13 KB
/
bank.inc
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
B.MAIN equ 0
B.INIT equ 1
B.KERNEL equ 2
B.KANJI equ 3
ifdef BANK
;
public B.MAIN, B.INIT, B.KERNEL, B.KANJI
;
; This is the bank header for the banked version of MSX-DOS2 ROM,
; and must be always linked at 40FFh.
;
public BNK_ID, $LOCAL
BNK_ID:
defb BANK ;Bank number stored in ROM
;
if BANK ne B.MAIN
;
; Define DOSHEAD entry.
;
public GETSLOT
GETSLOT equ 402Dh ;GETSLOT routine referenced by _XFER
;
public CHGBNK
CHGBNK equ 7FD0h
;
; Generate inter-bank call anchors.
;
BPROC macro BNO,NAME
if BANK eq B.&BNO
jp NAME##
endif
endm
else
;
; Define inter-bank call entry points.
;
QQQQ defl $
;
BPROC macro BNO,NAME
ifnb <NAME>
public NAME
NAME equ QQQQ
endif
QQQQ defl QQQQ+3
endm
;
;
; Resolve message id external references
;
msg_num defl 0
;
msg macro name,text
msg_num defl msg_num+1
public __&name
__&name equ msg_num
endm
;
; ----------------------------------------
;
;msg NORAM, <Not enough memory>
msg TOOMD, <Driver table is corrupted, too many drives allocated>
msg NOEMP, <Driver table is corrupted, unexpected non-empty entry found>
msg BADDI, <Boot error: disk controller ID does not match size of drive table>
msg INITE, <Boot error, kernel initialization code failed>
msg BHIM, <Boot error, not enough memory for BASIC variables>
;
msg FMT1, <Drive name? (>
msg FMT2, <) >
msg STRIKE, <Strike a key when ready >
msg ABORT, <Aborted>
msg FORMAT, <Format complete>
;
msg PRM1, <Insert disk for drive >
msg PRM2, <:>
msg PRM3, <and strike a key when ready>
;
msg ASTS, <*** >
;
msg SYS_ER, <System error >
msg USR_ER, <User error >
;
endif
else
;
; Generate inter-bank call entries.
;
BPROC macro BNO,NAME
call CALL_&BNO
endm
endif
$LOCAL:
;
; Entries for DOSINIT and Message module.
;
INITVECT:
BPROC INIT, MAP_SCAN
BPROC INIT, DOSINIT
BPROC INIT, ROM_MSG
BPROC INIT, ERR_MSG
BPROC INIT, MAPBIO
;
; Entries for KERNEL code.
;
KERNELVECT:
;
;
;
;
;
ifndef BANK
CALL_INIT:
pop ix
push bc
ld bc,$LOCAL-INITVECT-3
ex af,af'
ld a,B.INIT
add ix,bc
pop bc
jp CALBNK##
;
endif
;
;