forked from brendanalford/zx-diagnostics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.asm
205 lines (134 loc) · 2.92 KB
/
about.asm
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
;
; ZX Diagnostics - fixing ZX Spectrums in the 21st Century
; https://github.com/brendanalford/zx-diagnostics
;
; Original code by Dylan Smith
; Modifications and 128K support by Brendan Alford
;
; This code is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation;
; version 2.1 of the License.
;
; This code is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; about.asm
;
about
; Initialise stack and system variables
ld sp, sys_stack
call initialize
; White screen and border
ld a, BORDERWHT
out (0xfe), a
call cls
; Print top and bottom banners/footers
ld hl, str_creditsbanner
call print_header
call print_footer
; Print the diagnostic hardware type we're running
; on (if any)
ld hl, str_hardware
call print
ld a, (v_testhwtype)
cp 1
jr nz, .checkhw_1
ld hl, str_diagboard
jr print_hw
.checkhw_1
cp 2
jr nz, .checkhw_2
ld hl, str_smart
jr print_hw
.checkhw_2
cp 3
jr nz, .checkhw_3
ld hl, str_zxc
jr print_hw
.checkhw_3
cp 4
jr nz, .checkhw_4
ld hl, str_dand
jr print_hw
.checkhw_4
cp 5
jr nz, .checkhw_5
ld hl, str_css
jr print_hw
.checkhw_5
ld hl, str_no_hardware
print_hw
call print
; Print version and build information
ld hl, str_version
call print
ld hl, str_build
call print
call newline
ld hl, str_gitbranch
call print
call newline
ld hl, str_gitcommit
call print
call newline
ld hl, str_buildmachine
call print
; Output the amount of free space left in the ROM image
ld hl, str_free_sp
call print
ld hl, free_space_end - free_space
ld de, v_decstr
call Num2Dec
ld hl, v_decstr
call print
ld hl, str_free_sp_2
call print
ld a, (v_testhwtype)
cp 0
jr nz, wait_for_key
; No diagnostic hardware means no means of exit - just halt
di
halt
wait_for_key
; Prompt and wait for a key press
ld hl, str_anykey
call print
call get_key
; Passing 0x1234 to the pageout routine forces a jump to
; the system ROM when done
ld a, 2
ld bc, 0x1234
; We won't ever return from this call
call sys_rompaging
str_creditsbanner
defb TEXTBOLD, "About ZX Diagnostics", TEXTNORM, 0
str_hardware
defb AT, 2, 0, "Hardware: ", 0
str_diagboard
IFNDEF SLAMTEST
defb "Alioth Diagboard\n\n", 0
ENDIF
IFDEF SLAMTEST
defb "SLAM48/128 ULA Replacement\n\n", 0
ENDIF
str_smart
defb "Retroleum SMART Card\n\n", 0
str_zxc
defb "Paul Farrow ZXC3/ZXC4\n\n", 0
str_dand
defb "ZX Dandanator! Mini\n\n", 0
str_css
defb "CSS 128K ROM Board\n\n", 0
str_no_hardware
defb "None detected\n\n", 0
str_version
defb "Build/version information:\n\n", 0
str_free_sp
defb "\n\nFree ROM space: ", 0
str_anykey
defb "Press any key to exit.", 0
str_free_sp_2
defb " bytes \n\n", 0