@nataliapc/mcp-openmsx 1.1.5 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +41 -2
  2. package/dist/openmsx.js +9 -0
  3. package/dist/server.js +502 -327
  4. package/dist/utils.js +17 -0
  5. package/package.json +4 -1
  6. package/resources/audio/toc.json +31 -0
  7. package/resources/bios/Calling_BIOS_from_MSX-DOS.md +75 -0
  8. package/resources/bios/MSX2_SUBROM_BIOS_calls.md +734 -0
  9. package/resources/bios/MSX_BIOS_calls.md +1046 -0
  10. package/resources/bios/toc.json +24 -0
  11. package/resources/book--msx2-technical-handbook/Appendix1__BIOS_Listing.md +1464 -0
  12. package/resources/book--msx2-technical-handbook/Appendix2__Math-Pack.md +427 -0
  13. package/resources/book--msx2-technical-handbook/Appendix3__Bit_Block_Transfer.md +182 -0
  14. package/resources/book--msx2-technical-handbook/Appendix4__Work_Area_Listing.md +1637 -0
  15. package/resources/book--msx2-technical-handbook/Appendix5__VRAM_Map.md +145 -0
  16. package/resources/book--msx2-technical-handbook/Appendix6__IO_Map.md +128 -0
  17. package/resources/book--msx2-technical-handbook/Appendix8_10__Control_Codes_and_Escape_Sequences.md +76 -0
  18. package/resources/book--msx2-technical-handbook/Chapter1__MSX_System_Overview.md +402 -0
  19. package/resources/book--msx2-technical-handbook/Chapter2__BASIC.md +2148 -0
  20. package/resources/book--msx2-technical-handbook/Chapter3__MSX-DOS.md +2577 -0
  21. package/resources/book--msx2-technical-handbook/Chapter4a__VDP_and_Display_Screen.md +2052 -0
  22. package/resources/book--msx2-technical-handbook/Chapter4b__VDP_and_Display_Screen.md +3311 -0
  23. package/resources/book--msx2-technical-handbook/Chapter5a__Access_to_Peripherals_through_BIOS.md +2714 -0
  24. package/resources/book--msx2-technical-handbook/Chapter5b__Access_to_Peripherals_through_BIOS.md +1263 -0
  25. package/resources/book--msx2-technical-handbook/MSX_Kun_BASIC_Compiler.md +220 -0
  26. package/resources/book--msx2-technical-handbook/toc.json +82 -0
  27. package/resources/book--the-msx-red-book/the_msx_red_book.md +10349 -0
  28. package/resources/book--the-msx-red-book/toc.json +12 -0
  29. package/resources/msx-dos/MSX-DOS_2_Function_Specifications.md +1366 -0
  30. package/resources/msx-dos/MSX-DOS_2_Program_Interface_Specification.md +963 -0
  31. package/resources/msx-dos/toc.json +18 -0
  32. package/resources/msx-unapi/Ethernet_UNAPI_specification_1.1.md +369 -0
  33. package/resources/msx-unapi/Introduction_to_MSX-UNAPI.md +132 -0
  34. package/resources/msx-unapi/MSX_UNAPI_specification_1.1.md +679 -0
  35. package/resources/msx-unapi/TCP-IP_UNAPI_specification.md +2361 -0
  36. package/resources/msx-unapi/toc.json +27 -0
  37. package/resources/others/toc.json +11 -0
  38. package/resources/processors/Z80_R800_instruction_set.md +482 -0
  39. package/resources/processors/toc.json +24 -0
  40. package/resources/processors/z80-undocumented.tex +5617 -0
  41. package/resources/processors/z80_detailed_instruction_set.md +2025 -0
  42. package/resources/programming/toc.json +121 -0
  43. package/resources/system/MSX_IO_ports_overview.md +554 -0
  44. package/resources/system/toc.json +18 -0
  45. package/resources/video/V9938_Technical_Data_Book.md +3623 -0
  46. package/resources/video/V9958_Technical_Data_Book.md +417 -0
  47. package/resources/video/V9990_Programmers_Manual_Banzai.html +1582 -0
  48. package/resources/video/VDP_TMS9918A.txt +709 -0
  49. package/resources/video/toc.json +28 -0
@@ -0,0 +1,1464 @@
1
+ # APPENDIX 1 - BIOS LISTING
2
+
3
+ This chapter lists the 126 BIOS entries available to the user.
4
+
5
+
6
+ <p>&nbsp;</p>
7
+
8
+ ## Index
9
+
10
+ - [RSTs](#rsts)
11
+ - [I/O initialisation](#io-initialisation)
12
+ - [VDP access](#vdp-access)
13
+ - [PSG](#psg)
14
+ - [Keyboard, CRT, printer input-output](#keyboard-crt-printer-input-output)
15
+ - [Game I/O access](#game-io-access)
16
+ - [Cassette input-output routine](#cassette-input-output-routine)
17
+ - [Miscellaneous](#miscellaneous)
18
+ - [Entries appended for MSX2](#entries-appended-for-msx2)
19
+ - [SUB-ROM](#sub-rom)
20
+ - [Changes from the original](#changes-from-the-original)
21
+
22
+
23
+ <p>&nbsp;</p>
24
+
25
+ There are two kinds of BIOS routines, the ones in MAIN-ROM and the ones in SUB-ROM. They each have different calling sequences which will be described later. The following is the entry notation.
26
+
27
+
28
+ **Label name (address)** \*n*
29
+ * **Function**: descriptions and notes about the function
30
+ * **Input**: parameters used by call
31
+ * **Output**: parameters returned by call
32
+ * **Registers**: registers which will be used (original contentes are lost)
33
+
34
+
35
+ The value of **\*n** has the following meanings.
36
+
37
+ * **\*1**: same as MSX1
38
+ * **\*2**: call SUB-ROM internally in screen modes 5 to 8
39
+ * **\*3**: always call SUB-ROM
40
+ * **\*4**: do not call SUB-ROM while screen modes 4 to 8 are changed
41
+
42
+ Routines without **\*n** are appended for MSX2.
43
+
44
+
45
+ <p>&nbsp;</p>
46
+
47
+ ## MAIN-ROM
48
+
49
+ To call routines in MAIN-ROM, the CALL or RTS instruction is used as an ordinary subroutine call.
50
+
51
+
52
+ <p>&nbsp;</p>
53
+
54
+ ### RSTs
55
+
56
+ Among the following RSTs, RST 00H to RST 28H are used by the BASIC interpreter. RST 30H is used for inter-slot calls and RST 38H is used for hardware interrupts.
57
+
58
+
59
+ <p>&nbsp;</p>
60
+
61
+ #### CHKRAM (0000H) *1
62
+ * **Function**: tests RAM and sets RAM slot for the system
63
+ * **Input**: none
64
+ * **Output**: none
65
+ * **Registers**: all
66
+
67
+
68
+ <p>&nbsp;</p>
69
+
70
+ #### SYNCHR (0008H) *1
71
+ * **Function**: tests whether the character of [HL] is the specified character. If not, it generates SYNTAX ERROR, otherwise it goes to [CHRGTR](#chrgtr-0010h-1) (0010H).
72
+ * **Input**: set the character to be tested in [HL] and the character to be compared next to RST instruction which calls this routine (inline parameter).
73
+ ```
74
+ Example: LD HL,LETTER
75
+ RST 08H
76
+ DB "A"
77
+ .
78
+ .
79
+ .
80
+ LETTER: DB "B"
81
+ ```
82
+
83
+ * **Output**: HL is increased by one and A receives [HL]. When the tested character is numerical, the CY flag is set; the end of the statement (00H or 3AH) causes the Z flag to be set.
84
+ * **Registers**: AF, HL
85
+
86
+
87
+ <p>&nbsp;</p>
88
+
89
+ #### RDSLT (000CH) *1
90
+ * **Function**: selects the slot corresponding to the value of A and reads one byte from the memory of the slot. When this routine is called, the interrupt is inhibited and remains inhibited even after execution ends.
91
+ * **Input**: A for the slot number (see format below), HL for the address of memory to be read
92
+ ```
93
+ F000EEPP
94
+ - ----
95
+ | ||++-------------- Basic slot number (0 to 3)
96
+ | ++---------------- Expansion slot number (0 to 3)
97
+ +--------------------- "1" when using expansion slot
98
+ ```
99
+
100
+ * **Output**: the value of memory which has been read in A
101
+ * **Registers**: AF, BC, DE
102
+
103
+
104
+ <p>&nbsp;</p>
105
+
106
+ #### CHRGTR (0010H) *1
107
+ * **Function**: gets a character (or a token) from BASIC text
108
+ * **Input**: [HL] for the character to be read
109
+ * **Output**: HL is incremented by one and A receives [HL]. When the character is numerical, the CY flag is set; the end of the statement causes the Z flag to be set.
110
+ * **Registers**: AF, HL
111
+
112
+
113
+ <p>&nbsp;</p>
114
+
115
+ #### WRSLT (0014H) *1
116
+ * **Function**: selects the slot corresponding to the value of A and writes one byte to the memory of the slot. When this routine is called, interrupts are inhibited and remain so even after execution ends.
117
+ * **Input**: specifies a slot with A (same as [RDSLT](#rdslt-000ch-1))
118
+ * **Output**: none
119
+ * **Registers**: AF, BC, D
120
+
121
+
122
+ <p>&nbsp;</p>
123
+
124
+ #### OUTDO (0018H) *2
125
+ * **Function**: sends the value to current device
126
+ * **Input**: A for the value to be sent
127
+ * sends output to the printer when PTRFLG (F416H) is other than 0
128
+ * sends output to the file specified by PTRFIL (F864H) when PTRFIL is other than 0
129
+ * **Output**: none
130
+ * **Registers**: none
131
+
132
+
133
+ <p>&nbsp;</p>
134
+
135
+ #### CALSLT (001CH) *1
136
+ * **Function**: calls the routine in another slot (inter-slot call)
137
+ * **Input**: specify the slot in the 8 high order buts of the IY register (same as [RDSLT](#rdslt-000ch-1)). IX is for the address to be called.
138
+ * **Output**: depends on the calling routine
139
+ * **Registers**: depends on the calling routine
140
+
141
+
142
+ <p>&nbsp;</p>
143
+
144
+ #### DCOMPR (0020H) *1
145
+ * **Function**: compares the contents of HL and DE
146
+ * **Input**: HL, DE
147
+ * **Output**: sets the Z flag for HL = DE, CY flag for HL < DE
148
+ * **Registers**: AF
149
+
150
+
151
+ <p>&nbsp;</p>
152
+
153
+ #### ENASLT (0024H) *1
154
+ * **Function**: selects the slot corresponding to the value of A and enables the slot to be used. When this routine is called, interrupts are inhibited and remain so even after execution ends.
155
+ * **Input**:
156
+ * specify the slot by A (same as [RDSLT](#rdslt-000ch-1))
157
+ * specify the page to switch the slot by 2 high order bits of HL
158
+ * **Output**: none
159
+ * **Registers**: all
160
+
161
+
162
+ <p>&nbsp;</p>
163
+
164
+ #### GETYPR (0028H) *1
165
+ * **Function**: returns the type of DAC (decimal accumulator)
166
+ * **Input**: none
167
+ * **Output**: S, Z, P/V flags are changed depending on the type of DAC:
168
+
169
+ ```
170
+ integer type single precision real type
171
+ C = 1 C = 1
172
+ S = 1 * S = 0
173
+ Z = 0 Z = 0
174
+ P/V = 1 P/V = 0 *
175
+
176
+ string type double precision real type
177
+ C = 1 C = 0 *
178
+ S = 0 S = 0
179
+ Z = 1 * Z = 0
180
+ P/V = 1 P/V = 1
181
+
182
+ Types can be recognised by the flag marked by "*".
183
+ ```
184
+
185
+ * **Registers**: AF
186
+
187
+
188
+ <p>&nbsp;</p>
189
+
190
+ #### CALLF (0030H) *1
191
+ * **Function**: calls the routine in another slot. The following is the calling sequence:
192
+ ```
193
+ RST 30H
194
+ DB n ;n is the slot number (same as RDSLT)
195
+ DW nn ;nn is the called address
196
+ ```
197
+
198
+ * **Input**: In the method described above
199
+ * **Output**: depends on the calling routine
200
+ * **Registers**: AF, and other registers depending on the calling routine
201
+
202
+
203
+ <p>&nbsp;</p>
204
+
205
+ #### KEYINT (0038H) *1
206
+ * **Function**: executes the timer interrupt process routine
207
+ * **Input**: none
208
+ * **Output**: none
209
+ * **Registers**: none
210
+
211
+
212
+ <p>&nbsp;</p>
213
+
214
+ ### I/O initialisation
215
+
216
+
217
+ <p>&nbsp;</p>
218
+
219
+ #### INITIO (003BH) *1
220
+ * **Function**: initialises the device
221
+ * **Input**: none
222
+ * **Output**: none
223
+ * **Registers**: all
224
+
225
+
226
+ <p>&nbsp;</p>
227
+
228
+ #### INIFNK (003EH) *1
229
+ * **Function**: initialises the contents of function keys
230
+ * **Input**: none
231
+ * **Output**: none
232
+ * **Registers**: all
233
+
234
+
235
+
236
+ <p>&nbsp;</p>
237
+
238
+ ### VDP access
239
+
240
+
241
+ <p>&nbsp;</p>
242
+
243
+ #### DISSCR (0041H) *1
244
+ * **Function**: inhibits the screen display
245
+ * **Input**: none
246
+ * **Output**: none
247
+ * **Registers**: AF, BC
248
+
249
+
250
+ <p>&nbsp;</p>
251
+
252
+ #### ENASCR (0044H) *1
253
+ * **Function**: displays the screen
254
+ * **Input**: none
255
+ * **Output**: none
256
+ * **Registers**: all
257
+
258
+
259
+ <p>&nbsp;</p>
260
+
261
+ #### WRTVDP (0047H) *2
262
+ * **Function**: writes data in the VDP register
263
+ * **Input**: C for the register number, B for data; the register number is 0 to 23 and 32 to 46
264
+ * **Output**: none
265
+ * **Registers**: AF, BC
266
+
267
+
268
+ <p>&nbsp;</p>
269
+
270
+ #### RDVRM (004AH) *1
271
+ * **Function**: reads the contents of VRAM. This is for TMS9918, so only the 14 low order bits of the VRAM address are valid. To use all bits, call [NRDVRM](#nrdvrm-0174h).
272
+ * **Input**: HL for VRAM address to be read
273
+ * **Output**: A for the value which was read
274
+ * **Registers**: AF
275
+
276
+
277
+ <p>&nbsp;</p>
278
+
279
+ #### WRTVRM (004DH) *1
280
+ * **Function**: writes data in VRAM. This is for TMS9918, so only the 14 low order bits of the VRAM address are valid. To use all bits, call [NWRVRM](#nwrvrm-0177h).
281
+ * **Input**: HL for VRAM address, A for data
282
+ * **Output**: none
283
+ * **Registers**: AF
284
+
285
+
286
+ <p>&nbsp;</p>
287
+
288
+ #### SETRD (0050H) *1
289
+ * **Function**: sets VRAM address to VDP and enables it to be read. This is used to read data from the sequential VRAM area by using the address auto-increment function of VDP. This enables faster readout than using [RDVRM](#rdvrm-004ah-1) in a loop. This is for TMS9918, so only the 14 low order bits of VRAM address are valid. To use all bits, call [NSETRD](#nsetrd-016eh).
290
+ * **Input**: HL for VRAM address
291
+ * **Output**: none
292
+ * **Registers**: AF
293
+
294
+
295
+ <p>&nbsp;</p>
296
+
297
+ #### SETWRT (0053H) *1
298
+ * **Function**: sets VRAM address to VDP and enables it to be written. The purpose is the same as [SETRD](#setrd-0050h-1). This is for TMS9918, so only the 14 low order bits of VRAM address are valid. To use all bits, call [NSETRD](#nsetrd-016eh).
299
+ * **Input**: HL for VRAM address
300
+ * **Output**: none
301
+ * **Registers**: AF
302
+
303
+
304
+ <p>&nbsp;</p>
305
+
306
+ #### FILVRM (0056H) *4
307
+ * **Function**: fills the specified VRAM area with the same data. This is for TMS9918, so only the 14 low order bits of the VRAM address are valid. To use all bits, see [BIGFIL](#bigfil-016bh).
308
+ * **Input**: HL for VRAM address to begin writing, BC for the length of the area to be written, A for data.
309
+ * **Output**: none
310
+ * **Registers**: AF, BC
311
+
312
+
313
+ <p>&nbsp;</p>
314
+
315
+ #### LDIRMV (0059H) *4
316
+ * **Function**: block transfer from VRAM to memory
317
+ * **Input**: HL for source address (VRAM), DE for destination address (memory), BC for the length. All bits of the VRAM address are valid.
318
+ * **Output**: none
319
+ * **Registers**: all
320
+
321
+
322
+ <p>&nbsp;</p>
323
+
324
+ #### LDIRVM (005CH) *4
325
+ * **Function**: block transfer from memory to VRAM
326
+ * **Input**: HL for source address (memory), DE for destination address (VRAM), BC for the length. All bits of the VRAM address are valid.
327
+ * **Output**: none
328
+ * **Registers**: all
329
+
330
+
331
+ <p>&nbsp;</p>
332
+
333
+ #### CHGMOD (005FH) *3
334
+ * **Function**: changes the screen mode. The palette is not initialised. To initialise it, see [CHGMDP](#chgmdp-01b5h) in SUB-ROM.
335
+ * **Input**: A for the screen mode (0 to 8)
336
+ * **Output**: none
337
+ * **Registers**: all
338
+
339
+
340
+ <p>&nbsp;</p>
341
+
342
+ #### CHGCLR (0062H) *1
343
+ * **Function**: changes the screen colour
344
+ * **Input**:
345
+ * A for the mode
346
+ * FORCLR (F3E9H) for foreground color
347
+ * BAKCLR (F3EAH) for background color
348
+ * BDRCLR (F3EBH) for border colour
349
+ * **Output**: none
350
+ * **Registers**: all
351
+
352
+
353
+ <p>&nbsp;</p>
354
+
355
+ #### NMI (0066H) *1
356
+ * **Function**: executes NMI (Non-Maskable Interrupt) handling routine
357
+ * **Input**: none
358
+ * **Output**: none
359
+ * **Registers**: none
360
+
361
+
362
+ <p>&nbsp;</p>
363
+
364
+ #### CLRSPR (0069H) *3
365
+ * **Function**: initialises all sprites. The sprite pattern is cleared to null, the sprite number to the sprite plane number, the sprite colour to the foregtound colour. The vertical location of the sprite is set to 209 (mode 0 to 3) or 217 (mode 4 to 8).
366
+ * **Input**: SCRMOD (FCAFH) for the screen mode
367
+ * **Output**: none
368
+ * **Registers**: all
369
+
370
+
371
+ <p>&nbsp;</p>
372
+
373
+ #### INITXT (006CH) *3
374
+ * **Function**: initialises the screen to TEXT1 mode (40 x 24). In this routine, the palette is not initialised. To initialise the palette, call [INIPLT](#iniplt-0141h) in SUB-ROM after this call.
375
+ * **Input**:
376
+ * TXTNAM (F3B3H) for the pattern name table
377
+ * TXTCGP (F3B7H) for the pattern generator table
378
+ * LINL40 (F3AEH) for the length of one line
379
+ * **Output**: none
380
+ * **Registers**: all
381
+
382
+
383
+ <p>&nbsp;</p>
384
+
385
+ #### INIT32 (006FH) *3
386
+ * **Function**: initialises the screen to GRAPHIC1 mode (32x24). In this routine, the palette is not initialised.
387
+ * **Input**:
388
+ * T32NAM (F3BDH) for the pattern name table
389
+ * T32COL (F3BFH) for the colour table
390
+ * T32CGP (F3C1H) for the pattern generator table
391
+ * T32ATR (F3C3H) for the sprite attribute table
392
+ * T32PAT (F3C5H) for the sprite generator table
393
+ * **Output**: none
394
+ * **Registers**: all
395
+
396
+
397
+ <p>&nbsp;</p>
398
+
399
+ #### INIGRP (0072H) *3
400
+ * **Function**: initialises the screen to the high-resolution graphics mode. In this routine, the palette is not initialised.
401
+ * **Input**:
402
+ * GRPNAM (F3C7H) for the pattern name table
403
+ * GRPCOL (F3C9H) for the colour table
404
+ * GRPCGP (F3CBH) for the pattern generator table
405
+ * GRPATR (F3CDH) for the sprite attribute table
406
+ * GRPPAT (F3CFH) for the sprite generator table
407
+ * **Output**: none
408
+ * **Registers**: all
409
+
410
+
411
+ <p>&nbsp;</p>
412
+
413
+ #### INIMLT (0075H) *3
414
+ * **Function**: initialises the screen to MULTI colour mode. In this routine, the palette is not initialised.
415
+ * **Input**:
416
+ * MLTNAM (F3D1H) for the pattern name table
417
+ * MLTCOL (F3D3H) for the colour table
418
+ * MLTCGP (F3D5H) for the pattern generator table
419
+ * MLTATR (F3D7H) for the sprite attribute table
420
+ * MLTPAT (F3D9H) for the sprite generator table
421
+ * **Output**: none
422
+ * **Registers**: all
423
+
424
+
425
+ <p>&nbsp;</p>
426
+
427
+ #### SETTXT (0078H) *3
428
+ * **Function**: set only VDP in TEXT1 mode (40x24)
429
+ * **Input**: same as [INITXT](#initxt-006ch-3)
430
+ * **Output**: none
431
+ * **Registers**: all
432
+
433
+
434
+ <p>&nbsp;</p>
435
+
436
+ #### SETT32 (007BH) *3
437
+ * **Function**: set only VDP in GRAPHIC1 mode (32x24)
438
+ * **Input**: same as [INIT32](#init32-006fh-3)
439
+ * **Output**: none
440
+ * **Registers**: all
441
+
442
+
443
+ <p>&nbsp;</p>
444
+
445
+ #### SETGRP (007EH) *3
446
+ * **Function**: set only VDP in GRAPHIC2 mode
447
+ * **Input**: same as [INIGRP](#inigrp-0072h-3)
448
+ * **Output**: none
449
+ * **Registers**: all
450
+
451
+
452
+ <p>&nbsp;</p>
453
+
454
+ #### SETMLT (0081H) *3
455
+ * **Function**: set only VDP in MULTI colour mode
456
+ * **Input**: same as [INIMLT](#inimlt-0075h-3)
457
+ * **Output**: none
458
+ * **Registers**: all
459
+
460
+
461
+ #### CALPAT (0084H) *1
462
+ * **Function**: returns the address of the sprite generator table
463
+ * **Input**: A for the sprite number
464
+ * **Output**: HL for the address
465
+ * **Registers**: AF, DE, HL
466
+
467
+
468
+ <p>&nbsp;</p>
469
+
470
+ #### CALATR (0087H) *1
471
+ * **Function**: returns the address of the sprite attribute table
472
+ * **Input**: A for the sprite number
473
+ * **Output**: HL for the address
474
+ * **Registers**: AF, DE, HL
475
+
476
+
477
+ <p>&nbsp;</p>
478
+
479
+ #### GSPSIZ (008AH) *1
480
+ * **Function**: returns the current sprite size
481
+ * **Input**: none
482
+ * **Output**: A for the sprite size (in bytes). Only when the size is 16 x 16, the CY flag is set; otherwise the CY flag is reset.
483
+ * **Registers**: AF
484
+
485
+
486
+ <p>&nbsp;</p>
487
+
488
+ #### GRPPRT (008DH) *2
489
+ * **Function**: displays a character on the graphic screen
490
+ * **Input**: A for the character code. When the screen mode is 0 to 8, set the logical operation code in LOGOPR (FB02H).
491
+ * **Output**: none
492
+ * **Registers**: none
493
+
494
+
495
+ <p>&nbsp;</p>
496
+
497
+ ### PSG
498
+
499
+
500
+ <p>&nbsp;</p>
501
+
502
+ #### GICINI (0090H) *1
503
+ * **Function**: initialises PSG and sets the initial value for the PLAY statement
504
+ * **Input**: none
505
+ * **Output**: none
506
+ * **Registers**: all
507
+
508
+
509
+ <p>&nbsp;</p>
510
+
511
+ #### WRTPSG (0093H) *1
512
+ * **Function**: writes data in the PSG register
513
+ * **Input**: A for PSG register number, E for data
514
+ * **Output**: none
515
+ * **Registers**: none
516
+
517
+
518
+ <p>&nbsp;</p>
519
+
520
+ #### RDPSG (0096H) *1
521
+ * **Function**: reads the PSG register value
522
+ * **Input**: A for PSG register number
523
+ * **Output**: A for the value which was read
524
+ * **Registers**: none
525
+
526
+
527
+ <p>&nbsp;</p>
528
+
529
+ #### STRTMS (0099H) *1
530
+ * **Function**: tests whether the PLAY statement is being executed as a background task. If not, begins to execute the PLAY statement
531
+ * **Input**: none
532
+ * **Output**: none
533
+ * **Registers**: all
534
+
535
+
536
+ <p>&nbsp;</p>
537
+
538
+
539
+ ### Keyboard, CRT, printer input-output
540
+
541
+
542
+ <p>&nbsp;</p>
543
+
544
+ #### CHSNS (009CH) *1
545
+ * **Function**: tests the status of the keyboard buffer
546
+ * **Input**: none
547
+ * **Output**: the Z flag is set when the buffer is empty, otherwise the Z flag is reset
548
+ * **Registers**: AF
549
+
550
+
551
+ <p>&nbsp;</p>
552
+
553
+ #### CHGET (009FH) *1
554
+ * **Function**: one character input (waiting)
555
+ * **Input**: none
556
+ * **Output**: A for the code of the input character
557
+ * **Registers**: AF
558
+
559
+
560
+ <p>&nbsp;</p>
561
+
562
+ #### CHPUT (00A2H) *1
563
+ * **Function**: displays the character
564
+ * **Input**: A for the character code to be displayed
565
+ * **Output**: none
566
+ * **Registers**: none
567
+
568
+
569
+ <p>&nbsp;</p>
570
+
571
+ #### LPTOUT (00A5H) *1
572
+ * **Function**: sends one character to the printer
573
+ * **Input**: A for the character code to be sent
574
+ * **Output**: if failed, the CY flag is set
575
+ * **Registers**: F
576
+
577
+
578
+ <p>&nbsp;</p>
579
+
580
+ #### LPTSTT (00A8H) *1
581
+ * **Function**: tests the printer status
582
+ * **Input**: none
583
+ * **Output**:
584
+ * when A is 255 and the Z flag is reset, the printer is READY.
585
+ * when A is 0 and the Z flag is set, the printer is NOT READY.
586
+ * **Registers**: AF
587
+
588
+
589
+ <p>&nbsp;</p>
590
+
591
+ #### CNVCHR (00ABH) *1
592
+ * **Function**: test for the graphic header and transforms the code
593
+ * **Input**: A for the character code
594
+ * **Output**:
595
+ * the CY flag is reset to not the graphic header
596
+ * the CY flag and the Z flag are set to the transformed code is set in A
597
+ * the CY flag is set and the CY flag is reset to the untransformed code is set in A
598
+ * **Registers**: AF
599
+
600
+
601
+ <p>&nbsp;</p>
602
+
603
+ #### PINLIN (00AEH) *1
604
+ * **Function**: stores in the specified buffer the character codes input until the return key or STOP key is pressed.
605
+ * **Input**: none
606
+ * **Output**: HL for the starting address of the buffer minus 1, the CY flag is set only when it ends with the STOP key.
607
+ * **Registers**: all
608
+
609
+
610
+ <p>&nbsp;</p>
611
+
612
+ #### INLIN (00B1H) *1
613
+ * **Function**: same as [PINLIN](#pinlin-00aeh-1) except that AUTFLG (F6AAH) is set
614
+ * **Input**: none
615
+ * **Output**: HL for the starting address of the buffer minus 1, the CY flag is set only when it ends with the STOP key.
616
+ * **Registers**: all
617
+
618
+
619
+ <p>&nbsp;</p>
620
+
621
+ #### QINLIN (00B4H) *1
622
+ * **Function**: executes [INLIN](#inlin-00b1h-1) with displaying "?" and one space
623
+ * **Input**: none
624
+ * **Output**: HL for the starting address of the buffer minus 1, the CY flag is set only when it ends with the STOP key.
625
+ * **Registers**: all
626
+
627
+
628
+ <p>&nbsp;</p>
629
+
630
+ #### BREAKX (00B7H) *1
631
+ * **Function**: tests Ctrl-STOP key. In this routine, interrupts are inhibited.
632
+ * **Input**: none
633
+ * **Output**: the CY flag is set when pressed
634
+ * **Registers**: AF
635
+
636
+
637
+ <p>&nbsp;</p>
638
+
639
+ #### BEEP (00C0H) *3
640
+ * **Function**: generates BEEP
641
+ * **Input**: none
642
+ * **Output**: none
643
+ * **Registers**: all
644
+
645
+
646
+ <p>&nbsp;</p>
647
+
648
+ #### CLS (00C3H) *3
649
+ * **Function**: clears the screen
650
+ * **Input**: set zero flag
651
+ * **Output**: none
652
+ * **Registers**: AF, BC, DE
653
+
654
+
655
+ <p>&nbsp;</p>
656
+
657
+ #### POSIT (00C6H) *1
658
+ * **Function**: moves the cursor
659
+ * **Input**: H for the X-coordinate of the cursor, L for the Y-coordinate
660
+ * **Output**: none
661
+ * **Registers**: AF
662
+
663
+
664
+ <p>&nbsp;</p>
665
+
666
+ #### FNKSB (00C9H) *1
667
+ * **Function**: tests whether the function key display is active (FNKFLG). If so, displays them, otherwise erases them.
668
+ * **Input**: FNKFLG (FBCEH)
669
+ * **Output**: none
670
+ * **Registers**: all
671
+
672
+
673
+ <p>&nbsp;</p>
674
+
675
+ #### ERAFNK (00CCH) *1
676
+ * **Function**: erases the function key display
677
+ * **Input**: none
678
+ * **Output**: none
679
+ * **Registers**: all
680
+
681
+
682
+ <p>&nbsp;</p>
683
+
684
+ #### DSPFNK (00CFH) *2
685
+ * **Function**: displays the function keys
686
+ * **Input**: none
687
+ * **Output**: none
688
+ * **Registers**: all
689
+
690
+
691
+ <p>&nbsp;</p>
692
+
693
+ #### TOTEXT (00D2H) *1
694
+ * **Function**: forces the screen to be in the text mode
695
+ * **Input**: none
696
+ * **Output**: none
697
+ * **Registers**: all
698
+
699
+
700
+ <p>&nbsp;</p>
701
+
702
+ ### Game I/O access
703
+
704
+
705
+ <p>&nbsp;</p>
706
+
707
+ #### GTSTCK (00D5H) *1
708
+ * **Function**: returns the joystick status
709
+ * **Input**: A for the joystick number to be tested
710
+ * **Output**: A for the joystick direction
711
+ * **Registers**: all
712
+
713
+
714
+ <p>&nbsp;</p>
715
+
716
+ #### GTTRIG (00D8H) *1
717
+ * **Function**: returns the trigger button status
718
+ * **Input**: A for the trigger button number to be tested
719
+ * **Output**:
720
+ * When A is 0, the trigger button is not being pressed.
721
+ * When A is FFH, the trigger button is being pressed.
722
+ * **Registers**: AF
723
+
724
+
725
+ <p>&nbsp;</p>
726
+
727
+ #### GTPAD (00DBH) *1
728
+ * **Function**: returns the touch pad status
729
+ * **Input**: A for the touch pad number to be tested
730
+ * **Output**: A for the value
731
+ * **Registers**: all
732
+
733
+
734
+ <p>&nbsp;</p>
735
+
736
+ #### GTPDL (00DEH) *2
737
+ * **Function**: returns the paddle value
738
+ * **Input**: A for the paddle number
739
+ * **Output**: A for the value
740
+ * **Registers**: all
741
+
742
+
743
+ <p>&nbsp;</p>
744
+
745
+
746
+ ### Cassette input-output routine
747
+
748
+
749
+ <p>&nbsp;</p>
750
+
751
+ #### TAPION (00E1H) *1
752
+ * **Function**: reads the header block after turning the cassette motor ON.
753
+ * **Input**: none
754
+ * **Output**: if failed, the CY flag is set
755
+ * **Registers**: all
756
+
757
+
758
+ <p>&nbsp;</p>
759
+
760
+ #### TAPIN (00E4H) *1
761
+ * **Function**: reads data from the tape
762
+ * **Input**: none
763
+ * **Output**: A for data. If failed, the CY flag is set.
764
+ * **Registers**: all
765
+
766
+
767
+ <p>&nbsp;</p>
768
+
769
+ #### TAPIOF (00E7H) *1
770
+ * **Function**: stops reading the tape
771
+ * **Input**: none
772
+ * **Output**: none
773
+ * **Registers**: none
774
+
775
+
776
+ <p>&nbsp;</p>
777
+
778
+ #### TAPOON (00EAH) *1
779
+ * **Function**: writes the header block after turning the cassette motor ON
780
+ * **Input**: A = 0, short header; A <> 0, long header
781
+ * **Output**: if failed, the CY flag is set
782
+ * **Registers**: all
783
+
784
+
785
+ <p>&nbsp;</p>
786
+
787
+ #### TAPOUT (00EDH) *1
788
+ * **Function**: writes data on the tape
789
+ * **Input**: A for data
790
+ * **Output**: if failed, the CY flag is set
791
+ * **Registers**: all
792
+
793
+
794
+ <p>&nbsp;</p>
795
+
796
+ #### TAPOOF (00F0H) *1
797
+ * **Function**: stops writing to the tape
798
+ * **Input**: A for data
799
+ * **Output**: if failed, the CY flag is set
800
+ * **Registers**: all
801
+
802
+
803
+ <p>&nbsp;</p>
804
+
805
+ #### STMOTR (00F3H) *1
806
+ * **Function**: sets the cassette motor action
807
+ * **Input**:
808
+ * A = 0 ⟶ stop
809
+ * A = 1 ⟶ start
810
+ * A = 0FFH ⟶ reverse the current action
811
+ * **Output**: none
812
+ * **Registers**: AF
813
+
814
+
815
+ <p>&nbsp;</p>
816
+
817
+ ### Miscellaneous
818
+
819
+
820
+ <p>&nbsp;</p>
821
+
822
+ #### CHGCAP (0132H) *1
823
+ * **Function**: alternates the CAP lamp status
824
+ * **Input**:
825
+ * A = 0 ⟶ lamp off
826
+ * A <>0 ⟶ lamp on
827
+ * **Output**: none
828
+ * **Registers**: AF
829
+
830
+
831
+ <p>&nbsp;</p>
832
+
833
+ #### CHGSND (0135H) *1
834
+ * **Function**: alternates the 1-bit sound port status
835
+ * **Input**:
836
+ * A = 0 ⟶ OFF
837
+ * A <>0 ⟶ ON
838
+ * **Output**: none
839
+ * **Registers**: AF
840
+
841
+
842
+ <p>&nbsp;</p>
843
+
844
+ #### RSLREG (0138H) *1
845
+ * **Function**: reads the contents of current output to the basic slot register
846
+ * **Input**: none
847
+ * **Output**: A for the value which was read
848
+ * **Registers**: A
849
+
850
+
851
+ <p>&nbsp;</p>
852
+
853
+ #### WSLREG (013BH) *1
854
+ * **Function**: writes to the primary slot register
855
+ * **Input**: A for the value to be written
856
+ * **Output**: none
857
+ * **Registers**: none
858
+
859
+
860
+ <p>&nbsp;</p>
861
+
862
+ #### RDVDP (013EH) *1
863
+ * **Function**: reads VDP status register
864
+ * **Input**: none
865
+ * **Output**: A for the value which was read
866
+ * **Registers**: A
867
+
868
+
869
+ <p>&nbsp;</p>
870
+
871
+ #### SNSMAT (0141H) *1
872
+ * **Function**: reads the value of the specified line from the keyboard matrix
873
+ * **Input**: A for the specified line
874
+ * **Output**: A for data (the bit corresponding to the pressed key will be 0)
875
+ * **Registers**: AF, C
876
+
877
+
878
+ <p>&nbsp;</p>
879
+
880
+ #### PHYDIO (0144H)
881
+ * **Function**: Physical input/output for disk devices
882
+ * **Input**:
883
+ * A for the drive number (0 = A:, 1 = B:,...)
884
+ * B for the number of sector to be read from or written to
885
+ * C for the media ID DE for the first sector number to be read rom or written to
886
+ * HL for the startinga address of the RAM buffer to be read from or written to specified sectors
887
+ * CY set for sector writing; reset for sector reading
888
+ * **Output**:
889
+ * CY set if failed
890
+ * B for the number of sectors actually read or written
891
+ * A for the error code (only if CY set):
892
+ * 0 = Write protected
893
+ * 2 = Not ready
894
+ * 4 = Data error
895
+ * 6 = Seek error
896
+ * 8 = Record not found
897
+ * 10 = Write error
898
+ * 12 = Bad parameter
899
+ * 14 = Out of memory
900
+ * 16 = Other error
901
+ * **Registers**: all
902
+
903
+
904
+ <p>&nbsp;</p>
905
+
906
+ #### ISFLIO (014AH) *1
907
+ * **Function**: tests whether the device is active
908
+ * **Input**: none
909
+ * **Output**:
910
+ * A = 0 ⟶ active
911
+ * A <>0 ⟶ inactive
912
+ * **Registers**: AF
913
+
914
+
915
+ <p>&nbsp;</p>
916
+
917
+ #### OUTDLP (014DH) *1
918
+ * **Function**: printer output. Different from [LPTOUT](#lptout-00a5h-1) in the following points:
919
+ 1. TAB is expanded to spaces
920
+ 2. For non-MSX printers, hiragana is transformed to katakana and graphic characters are transformed to 1-byte characters.
921
+ 3. If failed, device I/O error occurs.
922
+ * **Input**: A for data
923
+ * **Output**: none
924
+ * **Registers**: F
925
+
926
+
927
+ <p>&nbsp;</p>
928
+
929
+ #### KILBUF (0156H) *1
930
+ * **Function**: clears the keyboard buffer
931
+ * **Input**: none
932
+ * **Output**: none
933
+ * **Registers**: HL
934
+
935
+
936
+ <p>&nbsp;</p>
937
+
938
+ #### CALBAS (0159H) *1
939
+ * **Function**: executes inter-slot call to the routine in BASIC interpreter
940
+ * **Input**: IX for the calling address
941
+ * **Output**: depends on the called routine
942
+ * **Registers**: depends on the called routine
943
+
944
+
945
+ <p>&nbsp;</p>
946
+
947
+ ### Entries appended for MSX2
948
+
949
+
950
+ <p>&nbsp;</p>
951
+
952
+ #### SUBROM (015CH)
953
+ * **Function**: executes inter-slot call to SUB-ROM
954
+ * **Input**: IX for the calling address and, at the same time, pushes IX on the stack
955
+ * **Output**: depends on the called routine
956
+ * **Registers**: background registers and IY are reserved
957
+
958
+
959
+ <p>&nbsp;</p>
960
+
961
+ #### EXTROM (015FH)
962
+ * **Function**: executes inter-slot call to SUB-ROM
963
+ * **Input**: IX for the calling address
964
+ * **Output**: depends on the called routine
965
+ * **Registers**: background registers and IY are reserved
966
+
967
+
968
+ <p>&nbsp;</p>
969
+
970
+ #### EOL (0168H)
971
+ * **Function**: deletes to the end of the line
972
+ * **Input**: H for X-coordinate of the cursor, L for Y-coordinate
973
+ * **Output**: none
974
+ * **Registers**: all
975
+
976
+
977
+ <p>&nbsp;</p>
978
+
979
+ #### BIGFIL (016BH)
980
+ * **Function**: same function as [FILVRM](#filvrm-0056h-4). Differences are as follows:
981
+ * In [FILVRM](#filvrm-0056h-4), it is tested whether the screen mode is 0 to 3. If so, it treats VDP as the one which has only 16K bytes VRAM (for the compatibility with MSX1).
982
+ * In [BIGFIL](#bigfil-016bh), the mode is not tested and actions are carried out by the given parameters.
983
+ * **Input**: same as [FILVRM](#filvrm-0056h-4)
984
+ * **Output**: same as [FILVRM](#filvrm-0056h-4)
985
+ * **Registers**: same as [FILVRM](#filvrm-0056h-4)
986
+
987
+
988
+ <p>&nbsp;</p>
989
+
990
+ #### NSETRD (016EH)
991
+ * **Function**: enables VRAM to be read by setting the address
992
+ * **Input**: HL for VRAM address
993
+ * **Output**: none
994
+ * **Registers**: AF
995
+
996
+
997
+ <p>&nbsp;</p>
998
+
999
+ #### NSTWRT (0171H)
1000
+ * **Function**: enables VRAM to be written by setting the address
1001
+ * **Input**: HL for VRAM address
1002
+ * **Output**: none
1003
+ * **Registers**: AF
1004
+
1005
+
1006
+ <p>&nbsp;</p>
1007
+
1008
+ #### NRDVRM (0174H)
1009
+ * **Function**: reads the contents of VRAM
1010
+ * **Input**: HL for VRAM address to be read
1011
+ * **Output**: A for the value which was read
1012
+ * **Registers**: F
1013
+
1014
+
1015
+ <p>&nbsp;</p>
1016
+
1017
+ #### NWRVRM (0177H)
1018
+ * **Function**: writes data in VRAM
1019
+ * **Input**: HL for VRAM address, A for data
1020
+ * **Output**: none
1021
+ * **Registers**: AF
1022
+
1023
+
1024
+ <p>&nbsp;</p>
1025
+
1026
+ ## SUB-ROM
1027
+
1028
+ The calling sequence of SUB-ROM is as follows:
1029
+
1030
+ ```
1031
+ .
1032
+ .
1033
+ .
1034
+ LD IX, INIPLT
1035
+ ; Set BIOS entry address
1036
+ CALL EXTROM
1037
+ ; Returns here
1038
+ .
1039
+ .
1040
+ .
1041
+ ```
1042
+
1043
+ When the contents of IX should not be destroyed, use the call as shown below.
1044
+
1045
+ ```
1046
+ .
1047
+ .
1048
+ .
1049
+ INIPAL: PUSH IX
1050
+ ; Save IX
1051
+ LD IX, INIPLT
1052
+ ; Set BIOS entry address
1053
+ JP SUBROM
1054
+ ;Returns caller of INIPAL
1055
+ .
1056
+ .
1057
+ .
1058
+ ```
1059
+
1060
+ <p>&nbsp;</p>
1061
+
1062
+ #### GRPRT (0089H)
1063
+ * **Function**: one character output to the graphic screen (active only in screen modes 5 to 8)
1064
+ * **Input**: A for the character code
1065
+ * **Output**: none
1066
+ * **Registers**: none
1067
+
1068
+
1069
+ <p>&nbsp;</p>
1070
+
1071
+ #### NVBXLN (00C9H)
1072
+ * **Function**: draws a box
1073
+ * **Input**:
1074
+ * start point: BC for X-coordinate, DE for Y-coordinate
1075
+ * end point:
1076
+ * GXPOS (FCB3H) for X-coordinate
1077
+ * GYPOS (FCB5H) for Y-coordinate
1078
+ * colour: ATRBYT (F3F3H) for the attribute
1079
+ * logical operation code: LOGOPR (FB02H)
1080
+ * **Output**: none
1081
+ * **Registers**: all
1082
+
1083
+
1084
+ <p>&nbsp;</p>
1085
+
1086
+ #### NVBXFL (00CDH)
1087
+ * **Function**: draws a painted box
1088
+ * **Input**:
1089
+ * start point: BC for X-coordinate, DE for Y-coordinate
1090
+ * end point:
1091
+ * GXPOS (FCB3H) for X-coordinate
1092
+ * GYPOS (FCB5H) for Y-coordinate
1093
+ * colour: ATRBYT (F3F3H) for the attribute
1094
+ * logical operation code: LOGOPR (FB02H)
1095
+ * **Output**: none
1096
+ * **Registers**: all
1097
+
1098
+
1099
+ <p>&nbsp;</p>
1100
+
1101
+ #### CHGMOD (00D1H)
1102
+ * **Function**: changes the screen mode
1103
+ * **Input**: A for the screen mode (0 to 8)
1104
+ * **Output**: none
1105
+ * **Registers**: all
1106
+
1107
+
1108
+ <p>&nbsp;</p>
1109
+
1110
+ #### INITXT (00D5H)
1111
+ * **Function**: initialises the screen to TEXT1 mode (40 x 24)
1112
+ * **Input**:
1113
+ * TXTNAM (F3B3H) for the pattern name table
1114
+ * TXTCGP (F3B7H) for the pattern generator table
1115
+ * LINL40 (F3AEH) for the length of one line
1116
+ * **Output**: none
1117
+ * **Registers**: all
1118
+
1119
+
1120
+ <p>&nbsp;</p>
1121
+
1122
+ #### INIT32 (00D9H)
1123
+ * **Function**: initialises the screen to GRAPHIC1 mode (32x24)
1124
+ * **Input**:
1125
+ * T32NAM (F3BDH) for the pattern name table
1126
+ * T32COL (F3BFH) for the colour table
1127
+ * T32CGP (F3C1H) for the pattern generator table
1128
+ * T32ATR (F3C3H) for the sprite attribute table
1129
+ * T32PAT (F3C5H) for the sprite generator table
1130
+ * **Output**: none
1131
+ * **Registers**: all
1132
+
1133
+
1134
+ <p>&nbsp;</p>
1135
+
1136
+ #### INIGRP (00DDH)
1137
+ * **Function**: initialises the screen to the high-resolution graphics mode
1138
+ * **Input**:
1139
+ * GRPNAM (F3C7H) for the pattern name table
1140
+ * GRPCOL (F3C9H) for the colour table
1141
+ * GRPCGP (F3CBH) for the pattern generator table
1142
+ * GRPATR (F3CDH) for the sprite attribute table
1143
+ * GRPPAT (F3CFH) for the sprite generator table
1144
+ * **Output**: none
1145
+ * **Registers**: all
1146
+
1147
+
1148
+ <p>&nbsp;</p>
1149
+
1150
+ #### INIMLT (00E1H)
1151
+ * **Function**: initialises the screen to MULTI colour mode
1152
+ * **Input**:
1153
+ * MLTNAM (F3D1H) for the pattern name table
1154
+ * MLTCOL (F3D3H) for the colour table
1155
+ * MLTCGP (F3D5H) for the pattern generator table
1156
+ * MLTATR (F3D7H) for the sprite attribute table
1157
+ * MLTPAT (F3D9H) for the sprite generator table
1158
+ * **Output**: none
1159
+ * **Registers**: all
1160
+
1161
+
1162
+ <p>&nbsp;</p>
1163
+
1164
+ #### SETTXT (00E5H)
1165
+ * **Function**: sets VDP in the text mode (40x24)
1166
+ * **Input**: same as [INITXT](#initxt-00d5h)
1167
+ * **Output**: none
1168
+ * **Registers**: all
1169
+
1170
+
1171
+ <p>&nbsp;</p>
1172
+
1173
+ #### SETT32 (00E9H)
1174
+ * **Function**: ses VDP in the text mode (32x24)
1175
+ * **Input**: same as [INIT32](#init32-00d9h)
1176
+ * **Output**: none
1177
+ * **Registers**: all
1178
+
1179
+
1180
+ <p>&nbsp;</p>
1181
+
1182
+ #### SETGRP (00EDH)
1183
+ * **Function**: sets VDP in the high-resolution mode
1184
+ * **Input**: same as [INIGRP](#inigrp-00ddh)
1185
+ * **Output**: none
1186
+ * **Registers**: all
1187
+
1188
+
1189
+ <p>&nbsp;</p>
1190
+
1191
+ #### SETMLT (00F1H)
1192
+ * **Function**: sets VDP in MULTI COLOUR mode
1193
+ * **Input**: same as [INIMLT](#inimlt-00e1h)
1194
+ * **Output**: none
1195
+ * **Registers**: all
1196
+
1197
+
1198
+ <p>&nbsp;</p>
1199
+
1200
+ #### CLRSPR (00F5H)
1201
+ * **Function**: initialises all sprites. The sprite pattern is set to null, sprite number to sprite plane number, and sprite colour to the foreground colour. The vertical location of the sprite is set to 217.
1202
+ * **Input**: SCRMOD (FCAFH) for the screen mode
1203
+ * **Output**: none
1204
+ * **Registers**: all
1205
+
1206
+
1207
+ <p>&nbsp;</p>
1208
+
1209
+ #### CALPAT (00F9H)
1210
+ * **Function**: returns the address of the sprite generator table (this routine is the same as [CALPAT](#calpat-0084h-1) in MAIN-ROM)
1211
+ * **Input**: A for the sprite number
1212
+ * **Output**: HL for the address
1213
+ * **Registers**: AF, DE, HL
1214
+
1215
+
1216
+ <p>&nbsp;</p>
1217
+
1218
+ #### CALATR (00FDH)
1219
+ * **Function**: returns the address of the sprite attribute table (this routine is the same as [CALATR](#calatr-0087h-1) in MAIN-ROM)
1220
+ * **Input**: A for the sprite number
1221
+ * **Output**: HL for the address
1222
+ * **Registers**: AF, DE, HL
1223
+
1224
+
1225
+ <p>&nbsp;</p>
1226
+
1227
+ #### GSPSIZ (0101H)
1228
+ * **Function**: returns the current sprite size (this routine is the same as [GSPSIZ](#gspsiz-008ah-1) in MAIN-ROM)
1229
+ * **Input**: none
1230
+ * **Output**: A for the sprite size. The CY flag is set only for the size 16 x 16.
1231
+ * **Registers**: AF
1232
+
1233
+
1234
+ <p>&nbsp;</p>
1235
+
1236
+ #### GETPAT (0105H)
1237
+ * **Function**: returns the character pattern
1238
+ * **Input**: A for the character code
1239
+ * **Output**: PATWRK (FC40H) for the character pattern
1240
+ * **Registers**: all
1241
+
1242
+
1243
+ <p>&nbsp;</p>
1244
+
1245
+ #### WRTVRM (0109H)
1246
+ * **Function**: writes data in VRAM
1247
+ * **Input**: HL for VRAM address (0 TO FFFFH), A for data
1248
+ * **Output**: none
1249
+ * **Registers**: AF
1250
+
1251
+
1252
+ <p>&nbsp;</p>
1253
+
1254
+ #### RDVRM (010DH)
1255
+ * **Function**: reads the contents of VRAM
1256
+ * **Input**: HL for VRAM address (0 TO FFFFH) to be read
1257
+ * **Output**: A for the value which was read
1258
+ * **Registers**: AF
1259
+
1260
+
1261
+ <p>&nbsp;</p>
1262
+
1263
+ #### CHGCLR (0111H)
1264
+ * **Function**: changes the screen colour
1265
+ * **Input**:
1266
+ * A for the mode
1267
+ * FORCLR (F3E9H) for the foreground color
1268
+ * BAKCLR (F3EAH) for the background color
1269
+ * BDRCLR (F3EBH) for the border colour
1270
+ * **Output**: none
1271
+ * **Registers**: all
1272
+
1273
+
1274
+ <p>&nbsp;</p>
1275
+
1276
+ #### CLSSUB (0115H)
1277
+ * **Function**: clears the screen
1278
+ * **Input**: none
1279
+ * **Output**: none
1280
+ * **Registers**: all
1281
+
1282
+
1283
+ <p>&nbsp;</p>
1284
+
1285
+ #### DSPFNK (011DH)
1286
+ * **Function**: displays the function keys
1287
+ * **Input**: none
1288
+ * **Output**: none
1289
+ * **Registers**: all
1290
+
1291
+
1292
+ <p>&nbsp;</p>
1293
+
1294
+ #### WRTVDP (012DH)
1295
+ * **Function**: writes data in the VDP register
1296
+ * **Input**: C for the register number, B for data
1297
+ * **Output**: none
1298
+ * **Registers**: AF, BC
1299
+
1300
+
1301
+ <p>&nbsp;</p>
1302
+
1303
+ #### VDPSTA (0131H)
1304
+ * **Function**: reads the VDP register
1305
+ * **Input**: A for the register number (0 to 9)
1306
+ * **Output**: A for data
1307
+ * **Registers**: F
1308
+
1309
+
1310
+ <p>&nbsp;</p>
1311
+
1312
+ #### SETPAG (013DH)
1313
+ * **Function**: switches the page
1314
+ * **Input**:
1315
+ * DPPAGE (FAF5H) for the display page number
1316
+ * ACPAGE (FAF6H) for the active page number
1317
+ * **Output**: none
1318
+ * **Registers**: AF
1319
+
1320
+
1321
+ <p>&nbsp;</p>
1322
+
1323
+ #### INIPLT (0141H)
1324
+ * **Function**: initialises the palette (the current palette is saved in VRAM)
1325
+ * **Input**: none
1326
+ * **Output**: none
1327
+ * **Registers**: AF, BC, DE
1328
+
1329
+
1330
+ <p>&nbsp;</p>
1331
+
1332
+ #### RSTPLT (0145H)
1333
+ * **Function**: restores the palette from VRAM
1334
+ * **Input**: none
1335
+ * **Output**: none
1336
+ * **Registers**: AF, BC, DE
1337
+
1338
+
1339
+ <p>&nbsp;</p>
1340
+
1341
+ #### GETPLT (0149H)
1342
+ * **Function**: obtains the colour code from the palette
1343
+ * **Input**: A for the palette number (0 to 15)
1344
+ * **Output**:
1345
+ * 4 high order bits of B for red code
1346
+ * 4 low order bits of B for blue code
1347
+ * 4 low order bits of C for green code
1348
+ * **Registers**: AF, DE
1349
+
1350
+
1351
+ <p>&nbsp;</p>
1352
+
1353
+ #### SETPLT (014DH)
1354
+ * **Function**: sets the colour code to the palette
1355
+ * **Input**:
1356
+ * D for the palette number (0 to 15)
1357
+ * 4 high order bits of A for red code
1358
+ * 4 low order bits of A for blue code
1359
+ * 4 low order bits of E for green code
1360
+ * **Output**: none
1361
+ * **Registers**: AF
1362
+
1363
+
1364
+ <p>&nbsp;</p>
1365
+
1366
+ #### BEEP (017DH)
1367
+ * **Function**: generates BEEP
1368
+ * **Input**: none
1369
+ * **Output**: none
1370
+ * **Registers**: all
1371
+
1372
+
1373
+ <p>&nbsp;</p>
1374
+
1375
+ #### PROMPT (0181H)
1376
+ * **Function**: displays the prompt
1377
+ * **Input**: none
1378
+ * **Output**: none
1379
+ * **Registers**: all
1380
+
1381
+
1382
+ <p>&nbsp;</p>
1383
+
1384
+ #### NEWPAD (01ADH)
1385
+ * **Function**: reads the status of mouse or light pen
1386
+ * **Input**: call with setting the following data in A; descriptions in parenthesis are return values.
1387
+ * 8: light pen check (valid at 0FFH)
1388
+ * 9: returns X-coordinate
1389
+ * 10: returns Y-coordinate
1390
+ * 11: returns the light pen switch status (0FFH, when pressed)
1391
+ * 12: whether the mouse is connected to the port 1 (valid at 0FFH)
1392
+ * 13: returns the offset in X direction
1393
+ * 14: returns the offset in Y direction
1394
+ * 15: (always 0)
1395
+ * 16: whether the mouse is connected to the port 2 (valid at 0FFH)
1396
+ * 17: returns the offset in X direction
1397
+ * 18: returns the offset in Y direction
1398
+ * 19: (always 0)
1399
+ * **Output**: A
1400
+ * **Registers**: all
1401
+
1402
+
1403
+ <p>&nbsp;</p>
1404
+
1405
+ #### CHGMDP (01B5H)
1406
+ * **Function**: changes VDP mode. The palette is initialised.
1407
+ * **Input**: A for the screen mode (0 to 8)
1408
+ * **Output**: none
1409
+ * **Registers**: all
1410
+
1411
+
1412
+ <p>&nbsp;</p>
1413
+
1414
+ #### KNJPRT (01BDH)
1415
+ * **Function**: sends a kanki to the graphic screen (modes 5 to 8)
1416
+ * **Input**: BC for JIS kanji code, A for the display mode. The display mode has the following meaning, similar to the PUT KANJI command of BASIC.
1417
+ * 0: display in 16 x 16 dot
1418
+ * 1: display even dots
1419
+ * 2: display odd dots
1420
+
1421
+
1422
+ <p>&nbsp;</p>
1423
+
1424
+ #### REDCLK (01F5H)
1425
+ * **Function**: reads the clock data
1426
+ * **Input**: C for RAM address of the clock
1427
+
1428
+ ```
1429
+ 00MMAAAA
1430
+ ------
1431
+ ||++++--- Address (0 to 15)
1432
+ ++------- Mode (0 to 3)
1433
+ ```
1434
+
1435
+ * **Output**: A for the data which were read (only 4 low order bits are valid)
1436
+ * **Registers**: F
1437
+
1438
+
1439
+ <p>&nbsp;</p>
1440
+
1441
+ #### WRTCLK (01F9H)
1442
+ * **Function**: writes the clock data
1443
+ * **Input**: A for the data to be written, C for RAM address of the clock
1444
+ * **Output**: none
1445
+ * **Registers**: F
1446
+
1447
+
1448
+ <p>&nbsp;</p>
1449
+
1450
+ ## Changes from the original
1451
+
1452
+ - In description of [ENASLT](#enaslt-0024h-1), the needed input in HL has been added.
1453
+
1454
+ - In description of [GETYPR](#getypr-0028h-1), the Input field has been added.
1455
+
1456
+ - In description of [INITXT](#initxt-006ch-3) (MAIN), the reference to "INIPLOT" has been corrected to "[INIPLT](#iniplt-0141h)".
1457
+
1458
+ - In description of [SUBROM](#subrom-015ch) routine, the mark "*1" has been erased.
1459
+
1460
+ - In description of [INITXT](#initxt-006ch-3) (SUB), the needed input in LINL40 has been added.
1461
+
1462
+ - Description of [PHYDIO](#phydio-0144h) routine has been added.
1463
+
1464
+