@nataliapc/mcp-openmsx 1.1.5 → 1.1.8

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 (48) hide show
  1. package/README.md +38 -0
  2. package/dist/server.js +110 -23
  3. package/dist/utils.js +17 -0
  4. package/package.json +4 -1
  5. package/resources/audio/toc.json +31 -0
  6. package/resources/bios/Calling_BIOS_from_MSX-DOS.md +75 -0
  7. package/resources/bios/MSX2_SUBROM_BIOS_calls.md +734 -0
  8. package/resources/bios/MSX_BIOS_calls.md +1046 -0
  9. package/resources/bios/toc.json +24 -0
  10. package/resources/book--msx2-technical-handbook/Appendix1__BIOS_Listing.md +1464 -0
  11. package/resources/book--msx2-technical-handbook/Appendix2__Math-Pack.md +427 -0
  12. package/resources/book--msx2-technical-handbook/Appendix3__Bit_Block_Transfer.md +182 -0
  13. package/resources/book--msx2-technical-handbook/Appendix4__Work_Area_Listing.md +1637 -0
  14. package/resources/book--msx2-technical-handbook/Appendix5__VRAM_Map.md +145 -0
  15. package/resources/book--msx2-technical-handbook/Appendix6__IO_Map.md +128 -0
  16. package/resources/book--msx2-technical-handbook/Appendix8_10__Control_Codes_and_Escape_Sequences.md +76 -0
  17. package/resources/book--msx2-technical-handbook/Chapter1__MSX_System_Overview.md +402 -0
  18. package/resources/book--msx2-technical-handbook/Chapter2__BASIC.md +2148 -0
  19. package/resources/book--msx2-technical-handbook/Chapter3__MSX-DOS.md +2577 -0
  20. package/resources/book--msx2-technical-handbook/Chapter4a__VDP_and_Display_Screen.md +2052 -0
  21. package/resources/book--msx2-technical-handbook/Chapter4b__VDP_and_Display_Screen.md +3311 -0
  22. package/resources/book--msx2-technical-handbook/Chapter5a__Access_to_Peripherals_through_BIOS.md +2714 -0
  23. package/resources/book--msx2-technical-handbook/Chapter5b__Access_to_Peripherals_through_BIOS.md +1263 -0
  24. package/resources/book--msx2-technical-handbook/MSX_Kun_BASIC_Compiler.md +220 -0
  25. package/resources/book--msx2-technical-handbook/toc.json +82 -0
  26. package/resources/book--the-msx-red-book/the_msx_red_book.md +10349 -0
  27. package/resources/book--the-msx-red-book/toc.json +12 -0
  28. package/resources/msx-dos/MSX-DOS_2_Function_Specifications.md +1366 -0
  29. package/resources/msx-dos/MSX-DOS_2_Program_Interface_Specification.md +963 -0
  30. package/resources/msx-dos/toc.json +18 -0
  31. package/resources/msx-unapi/Ethernet_UNAPI_specification_1.1.md +369 -0
  32. package/resources/msx-unapi/Introduction_to_MSX-UNAPI.md +132 -0
  33. package/resources/msx-unapi/MSX_UNAPI_specification_1.1.md +679 -0
  34. package/resources/msx-unapi/TCP-IP_UNAPI_specification.md +2361 -0
  35. package/resources/msx-unapi/toc.json +27 -0
  36. package/resources/others/toc.json +11 -0
  37. package/resources/processors/Z80_R800_instruction_set.md +482 -0
  38. package/resources/processors/toc.json +24 -0
  39. package/resources/processors/z80-undocumented.tex +5617 -0
  40. package/resources/processors/z80_detailed_instruction_set.md +2025 -0
  41. package/resources/programming/toc.json +121 -0
  42. package/resources/system/MSX_IO_ports_overview.md +554 -0
  43. package/resources/system/toc.json +18 -0
  44. package/resources/video/V9938_Technical_Data_Book.md +3623 -0
  45. package/resources/video/V9958_Technical_Data_Book.md +417 -0
  46. package/resources/video/V9990_Programmers_Manual_Banzai.html +1582 -0
  47. package/resources/video/VDP_TMS9918A.txt +709 -0
  48. package/resources/video/toc.json +28 -0
@@ -0,0 +1,1046 @@
1
+ # MSX BIOS calls
2
+
3
+ This is an overview of all official MSX BIOS calls.
4
+
5
+ * [MSX 1 BIOS](#msx-1-bios-entries) (up to function call #159)
6
+ * [RST-and other routines](#rst-and-other-routines)
7
+ * [Initialization-routines](#initialization-routines)
8
+ * [VDP routines](#vdp-routines)
9
+ * [PSG routines](#psg-routines)
10
+ * [Console routines](#console-routines)
11
+ * [Controller routines](#controller-routines)
12
+ * [Tape device routines](#tape-device-routines)
13
+ * [Queue routines](#queue-routines)
14
+ * [Graphic routines](#graphic-routines)
15
+ * [Misc routines](#misc-routines)
16
+ * [MSX 2 BIOS](#msx-2-bios-entries) (up to function call #177)
17
+ * [MSX 2+ BIOS](#msx-2-bios-entries-1) (up to function call #17D)
18
+ * [MSX turbo R BIOS](#msx-turbo-r-bios-entries) (up to function call #189)
19
+
20
+ ## MSX 1 BIOS Entries
21
+
22
+ ### RST-and other routines
23
+
24
+ #### CHKRAM (also called STARTUP, RESET or BOOT)
25
+ ```
26
+ Address : #0000
27
+ Function : Tests RAM and sets RAM slot for the system
28
+ Registers: All
29
+ Remark : After this, a jump must be made to INIT, for further initialisation.
30
+ ```
31
+ #### SYNCHR
32
+ ```
33
+ Address : #0008
34
+ Function : Tests whether the character of (HL) is the specified character
35
+ if not, it generates SYNTAX ERROR, otherwise it goes to [CHRGTR](#CHRGTR) (#0010)
36
+ Input : Set the character to be tested in (HL) and the character to be
37
+ compared next to RST instruction which calls this routine (inline parameter)
38
+ Output : HL is increased by one and A receives (HL), When the tested character is
39
+ numerical, the carry flag is set the end of the statement (00h or 3Ah) causes
40
+ the zero flag to be set
41
+ Registers: AF, HL
42
+ ```
43
+ #### RDSLT
44
+ ```
45
+ Address : #000C
46
+ Function : Reads the value of an address in another slot
47
+ Input : A - ExxxSSPP Slot-ID
48
+ │ ││└┴─ Primary slot number (00-11)
49
+ │ └┴─── Secondary slot number (00-11)
50
+ └───────────── Expanded slot (0 = no, 1 = yes)
51
+ HL - Address to read
52
+ Output : A - Contains the value of the read address
53
+ Registers: AF, C, DE
54
+ Remark : This routine turns off the interupt, but won't turn it on again
55
+ ```
56
+ #### CHRGTR
57
+ ```
58
+ Address : #0010
59
+ Function : Gets the next character (or token) of the Basic text
60
+ Input : HL - Address last character
61
+ Output : HL - Points to the next character
62
+ A - Contains the character
63
+ Carry flag set if it's a number
64
+ Zero flag set if it's the end of the statement
65
+ Registers: AF, HL
66
+ ```
67
+ #### WRSLT
68
+ ```
69
+ Address : #0014
70
+ Function : Writes a value to an address in another slot.
71
+ Input : A - Slot ID, see [RDSLT](#RDSLT)
72
+ HL - Address
73
+ E - Value
74
+ Registers: AF, BC, D
75
+ Remark : See [RDSLT](#RDSLT)
76
+ ```
77
+ #### OUTDO
78
+ ```
79
+ Address : #0018
80
+ Function : Output to current output channel (printer, file, etc.)
81
+ Input : A - PRTFIL, PRTFLG
82
+ Remark : Used in basic, in ML it's pretty difficult
83
+ ```
84
+ #### CALSLT
85
+ ```
86
+ Address : #001C
87
+ Function : Executes inter-slot call.
88
+ Input : IY - High byte with slot ID, see [RDSLT](#RDSLT)
89
+ IX - The address that will be called
90
+ Remark : Variables can never be given in alternative registers or IX and IY
91
+ ```
92
+ #### DCOMPR
93
+ ```
94
+ Address : #0020
95
+ Function : Compares HL with DE
96
+ Input : HL, DE
97
+ Output : Zero flag set if HL and DE are equal. Carry flag set if HL is less than DE.
98
+ Registers: AF
99
+ ```
100
+ #### ENASLT
101
+ ```
102
+ Address : #0024
103
+ Function : Switches indicated slot at indicated page on perpetually
104
+ Input : A - Slot ID, see [RDSLT](#RDSLT)
105
+ H - Bit 6 and 7 must contain the page number (00-11)
106
+ ```
107
+ #### GETYPR
108
+ ```
109
+ Address : #0028
110
+ Function : Returns Type of DAC
111
+ Input : DAC
112
+ Output : S,Z,P/V, CY
113
+ Registers: AF
114
+ Remark : Not a very clear routine to me, please mail us if you know more about it.
115
+ ```
116
+ #### CALLF
117
+ ```
118
+ Address : #0030
119
+ Function : Executes an interslot call
120
+ Output : Depends on the calling routine
121
+ Registers: AF, and the other registers depending on the calling routine
122
+ Remark : The following is the calling sequence:
123
+ RST #30
124
+ DB destination slot ID, see [RDSLT](#RDSLT)
125
+ DW destination address
126
+ ```
127
+ #### KEYINT
128
+ ```
129
+ Address : #0038
130
+ Function : Executes the timer interrupt process routine
131
+ ```
132
+
133
+ ### Initialization-routines
134
+
135
+
136
+ #### INITIO
137
+ ```
138
+ Address : #003B
139
+ Function : Initialises the device
140
+ Registers: All
141
+ ```
142
+ #### INIFNK
143
+ ```
144
+ Address : #003E
145
+ Function : Initialises the contents of the function keys
146
+ Registers: All
147
+ ```
148
+
149
+ ### VDP routines
150
+
151
+ #### DISSCR
152
+ ```
153
+ Address : #0041
154
+ Function : Inhibits the screen display
155
+ Registers: AF, BC
156
+ ```
157
+ #### ENASCR
158
+ ```
159
+ Address : #0044
160
+ Function : Displays the screen
161
+ Registers: AF, BC
162
+ ```
163
+ #### WRTVDP
164
+ ```
165
+ Address : #0047
166
+ Function : Write data in the VDP-register
167
+ Input : B - Data to write
168
+ C - Number of the register
169
+ Registers: AF, BC
170
+ ```
171
+ #### RDVRM
172
+ ```
173
+ Address : #004A
174
+ Function : Reads the content of VRAM
175
+ Input : HL - Address read
176
+ Output : A - Value which was read
177
+ Registers: AF
178
+ ```
179
+ #### WRTVRM
180
+ ```
181
+ Address : #004D
182
+ Function : Writes data in VRAM
183
+ Input : HL - Address write
184
+ A - Value write
185
+ Registers: AF
186
+ ```
187
+ #### SETRD
188
+ ```
189
+ Address : #0050
190
+ Function : Enable VDP to read
191
+ Input : HL - For VRAM-address
192
+ Registers: AF
193
+ ```
194
+ #### SETWRT
195
+ ```
196
+ Address : #0053
197
+ Function : Enable VDP to write
198
+ Input : HL - Address
199
+ Registers: AF
200
+ ```
201
+ #### FILVRM
202
+ ```
203
+ Address : #0056
204
+ Function : Fill VRAM with value
205
+ Input : A - Data byte
206
+ BC - Length of the area to be written
207
+ HL - Start address
208
+ Registers: AF, BC
209
+ ```
210
+ #### LDIRMV
211
+ ```
212
+ Address : #0059
213
+ Function : Block transfer to memory from VRAM
214
+ Input : BC - Block length
215
+ DE - Start address of memory
216
+ HL - Start address of VRAM
217
+ Registers: All
218
+ ```
219
+ #### LDIRVM
220
+ ```
221
+ Address : #005C
222
+ Function : Block transfer to VRAM from memory
223
+ Input : BC - Block length
224
+ DE - Start address of VRAM
225
+ HL - Start address of memory
226
+ Registers: All
227
+ ```
228
+ #### CHGMOD
229
+ ```
230
+ Address : #005F
231
+ Function : Switches to given screen mode
232
+ Input : A - Screen mode
233
+ Registers: All
234
+ ```
235
+ #### CHGCLR
236
+ ```
237
+ Address : #0062
238
+ Function : Changes the screen colors
239
+ Input : Foreground color in FORCLR
240
+ Background color in BAKCLR
241
+ Border color in BDRCLR
242
+ Registers: All
243
+ ```
244
+ #### NMI
245
+ ```
246
+ Address : #0066
247
+ Function : Executes non-maskable interupt handling routine
248
+ ```
249
+ #### CLRSPR
250
+ ```
251
+ Address : #0069
252
+ Function : Initialises all sprites
253
+ Input : SCRMOD
254
+ Registers: Alles
255
+ ```
256
+ #### INITXT
257
+ ```
258
+ Address : #006C
259
+ Function : Switches to SCREEN 0 (text screen with 40×24 characters)
260
+ Input : TXTNAM, TXTCGP
261
+ Registers: All
262
+ ```
263
+ #### INIT32
264
+ ```
265
+ Address : #006F
266
+ Function : Switches to SCREEN 1 (text screen with 32×24 characters)
267
+ Input : T32NAM, T32CGP, T32COL, T32ATR, T32PAT
268
+ Registers: All
269
+ ```
270
+ #### INIGRP
271
+ ```
272
+ Address : #0072
273
+ Function : Switches to SCREEN 2 (high resolution screen with 256×192 pixels)
274
+ Input : GRPNAM, GRPCGP, GRPCOL, GRPATR, GRPPAT
275
+ Registers: All
276
+ ```
277
+ #### INIMLT
278
+ ```
279
+ Address : #0075
280
+ Function : Switches to SCREEN 3 (multi-color screen with 64×48 pixels)
281
+ Input : MLTNAM, MLTCGP, MLTCOL, MLTATR, MLTPAT
282
+ Registers: All
283
+ ```
284
+ #### SETTXT
285
+ ```
286
+ Address : #0078
287
+ Function : Switches VDP to SCREEN 0 mode
288
+ Input : See [INITXT](#INITXT)
289
+ Registers: All
290
+ ```
291
+ #### SETT32
292
+ ```
293
+ Address : #007B
294
+ Function : Switches VDP to SCREEN 1 mode
295
+ Input : See [INIT32](#INIT32)
296
+ Registers: All
297
+ ```
298
+ #### SETGRP
299
+ ```
300
+ Address : #007E
301
+ Function : Switches VDP to SCREEN 2 mode
302
+ Input : See [INIGRP](#INIGRP)
303
+ Registers: All
304
+ ```
305
+ #### SETMLT
306
+ ```
307
+ Address : #0081
308
+ Function : Switches VDP to SCREEN 3 mode
309
+ Input : See [INIMLT](#INIMLT)
310
+ Registers: All
311
+ ```
312
+ #### CALPAT
313
+ ```
314
+ Address : #0084
315
+ Function : Returns the address of the sprite pattern table
316
+ Input : A - Sprite ID
317
+ Output : HL - For the address
318
+ Registers: AF, DE, HL
319
+ ```
320
+ #### CALATR
321
+ ```
322
+ Address : #0087
323
+ Function : Returns the address of the sprite attribute table
324
+ Input : A - Sprite number
325
+ Output : HL - For the address
326
+ Registers: AF, DE, HL
327
+ ```
328
+ #### GSPSIZ
329
+ ```
330
+ Address : #008A
331
+ Function : Returns current sprite size
332
+ Output : A - Sprite size in bytes
333
+ Carry flag set when size is 16×16 sprites otherwise Carry flag is reset
334
+ Registers: AF
335
+ ```
336
+ #### GRPPRT
337
+ ```
338
+ Address : #008D
339
+ Function : Displays a character on the graphic screen
340
+ Input : A - ASCII value of the character to print
341
+ ```
342
+
343
+ ### PSG routines
344
+
345
+ #### GICINI
346
+ ```
347
+ Address : #0090
348
+ Function : Initialises PSG and sets initial value for the PLAY statement
349
+ Registers: All
350
+ ```
351
+ #### WRTPSG
352
+ ```
353
+ Address : #0093
354
+ Function : Writes data to PSG register
355
+ Input : A - PSG register number
356
+ E - Data write
357
+ ```
358
+ #### RDPSG
359
+ ```
360
+ Address : #0096
361
+ Function : Reads value from PSG register
362
+ Input : A - PSG register read
363
+ Output : A - Value read
364
+ ```
365
+ #### STRTMS
366
+ ```
367
+ Address : #0099
368
+ Function : Tests whether the PLAY statement is being executed as a background
369
+ task. If not, begins to execute the PLAY statement
370
+ Registers: All
371
+ ```
372
+
373
+ ### Console routines
374
+
375
+ #### CHSNS
376
+ ```
377
+ Address : #009C
378
+ Function : Tests the status of the keyboard buffer
379
+ Output : Zero flag set if buffer is empty, otherwise not set
380
+ Registers: AF
381
+ ```
382
+ #### CHGET
383
+ ```
384
+ Address : #009F
385
+ Function : One character input (waiting)
386
+ Output : A - ASCII code of the input character
387
+ Registers: AF
388
+ ```
389
+ #### CHPUT
390
+ ```
391
+ Address : #00A2
392
+ Function : Displays one character
393
+ Input : A - ASCII code of character to display
394
+ ```
395
+ #### LPTOUT
396
+ ```
397
+ Address : #00A5
398
+ Function : Sends one character to printer
399
+ Input : A - ASCII code of character to send
400
+ Output : Carry flag set if failed
401
+ Registers: F
402
+ ```
403
+ #### LPTSTT
404
+ ```
405
+ Address : #00A8
406
+ Function : Tests printer status
407
+ Output : A - #FF and zero flag reset if printer is ready
408
+ #00 and zero flag set if not ready
409
+ Registers: AF
410
+ ```
411
+ #### CNVCHR
412
+ ```
413
+ Address : #00AB
414
+ Function : Tests for the graphic header and transforms the code
415
+ Input : A - Character code
416
+ Output : The carry flag is reset to not the graphic reader
417
+ The carry flag and zero flag are set to the transformed code is set in A
418
+ The carry flag is set and zero flag is reset to the untransformed code is set in A
419
+ Registers: AF
420
+ ```
421
+ #### PINLIN
422
+ ```
423
+ Address : #00AE
424
+ Function : Stores in the specified buffer the character codes input until the return
425
+ key or STOP key is pressed
426
+ Output : HL - For the starting address of the buffer -1
427
+ Carry flag set when it ends with the STOP key
428
+ Registers: All
429
+ ```
430
+ #### INLIN
431
+ ```
432
+ Address : #00B1
433
+ Function : Same as [PINLIN](#PINLIN) except that AUGFLG (#F6AA) is set
434
+ Output : HL - For the starting address of the buffer -1
435
+ Carry flag set when it ends with the STOP key
436
+ Registers: All
437
+ ```
438
+ #### QINLIN
439
+ ```
440
+ Address : #00B4
441
+ Function : Prints a question mark and one space
442
+ Output : HL - For the starting address of the buffer -1
443
+ Carry flag set when it ends with the STOP key
444
+ Registers: All
445
+ ```
446
+ #### BREAKX
447
+ ```
448
+ Address : #00B7
449
+ Function : Tests status of CTRL-STOP
450
+ Output : Carry flag set when pressed
451
+ Registers: AF
452
+ Remark : In this routine, interrupts are inhibited
453
+ ```
454
+ #### ISCNTC
455
+ ```
456
+ Address : #00BA
457
+ Function : Tests status of SHIFT-STOP
458
+ ```
459
+ #### CKCNTC
460
+ ```
461
+ Address : #00BD
462
+ Function : Same as [ISCNTC](#ISCNTC). used in Basic
463
+ ```
464
+ #### BEEP
465
+ ```
466
+ Address : #00C0
467
+ Function : Generates beep
468
+ Registers: All
469
+ ```
470
+ #### CLS
471
+ ```
472
+ Address : #00C3
473
+ Function : Clears the screen
474
+ Registers: AF, BC, DE
475
+ Remark : Zero flag must be set to be able to run this routine
476
+ XOR A will do fine most of the time
477
+ ```
478
+ #### POSIT
479
+ ```
480
+ Address : #00C6
481
+ Function : Moves cursor to the specified position
482
+ Input : H - Y coordinate of cursor
483
+ L - X coordinate of cursor
484
+ Registers: AF
485
+ ```
486
+ #### FNKSB
487
+ ```
488
+ Address : #00C9
489
+ Function : Tests whether the function key display is active (FNKFLG)
490
+ If so, displays them, otherwise erase them
491
+ Input : FNKFLG (#FBCE)
492
+ Registers: All
493
+ ```
494
+ #### ERAFNK
495
+ ```
496
+ Address : #00CC
497
+ Function : Erase functionkey display
498
+ Registers: All
499
+ ```
500
+ #### DSPFNK
501
+ ```
502
+ Address : #00CF
503
+ Function : Displays the function keys
504
+ Registers: All
505
+ ```
506
+ #### TOTEXT
507
+ ```
508
+ Address : #00D2
509
+ Function : Forces the screen to be in the text mode
510
+ Registers: All
511
+ ```
512
+
513
+ ### Controller routines
514
+
515
+ #### GTSTCK
516
+ ```
517
+ Address : #00D5
518
+ Function : Returns the joystick status
519
+ Input : A - Joystick number to test (0 = cursors, 1 = port 1, 2 = port 2)
520
+ Output : A - Direction
521
+ Registers: All
522
+ ```
523
+ #### GTTRIG
524
+ ```
525
+ Address : #00D8
526
+ Function : Returns current trigger status
527
+ Input : A - Trigger button to test
528
+ 0 = space bar
529
+ 1 = port 1, button A
530
+ 2 = port 2, button A
531
+ 3 = port 1, button B
532
+ 4 = port 2, button B
533
+ Output : A - #00 trigger button not pressed
534
+ #FF trigger button pressed
535
+ Registers: AF
536
+ ```
537
+ #### GTPAD
538
+ ```
539
+ Address : #00DB
540
+ Function : Returns current touch pad status
541
+ Input : A - Function call number. Fetch device data first, then read.
542
+
543
+ [0] Fetch touch pad data from port 1 (#FF if available)
544
+ [1] Read X-position
545
+ [2] Read Y-position
546
+ [3] Read touchpad status from port 1 (#FF if pressed)
547
+
548
+ [4] Fetch touch pad data from port 2 (#FF if available)
549
+ [5] Read X-position
550
+ [6] Read Y-position
551
+ [7] Read touchpad status from port 2 (#FF if pressed)
552
+
553
+ Output : A - Value
554
+ Registers: All
555
+ Remark : On MSX2, function call numbers 8-23 are forwarded to
556
+ [NEWPAD](subrom.php#NEWPAD) in the SubROM.
557
+ ```
558
+ #### GTPDL
559
+ ```
560
+ Address : #00DE
561
+ Function : Returns current value of paddle
562
+ Input : A - Paddle number
563
+ Output : A - Value
564
+ Registers: All
565
+ ```
566
+
567
+ ### Tape device routines
568
+
569
+ #### TAPION
570
+ ```
571
+ Address : #00E1
572
+ Function : Reads the header block after turning the cassette motor on
573
+ Output : Carry flag set if failed
574
+ Registers: All
575
+ ```
576
+ #### TAPIN
577
+ ```
578
+ Address : #00E4
579
+ Function : Read data from the tape
580
+ Output : A - Read value
581
+ Carry flag set if failed
582
+ Registers: All
583
+ ```
584
+ #### TAPIOF
585
+ ```
586
+ Address : #00E7
587
+ Function : Stops reading from the tape
588
+ ```
589
+ #### TAPOON
590
+ ```
591
+ Address : #00EA
592
+ Function : Turns on the cassette motor and writes the header
593
+ Input : A - #00 short header
594
+ not #00 long header
595
+ Output : Carry flag set if failed
596
+ Registers: All
597
+ ```
598
+ #### TAPOUT
599
+ ```
600
+ Address : #00ED
601
+ Function : Writes data on the tape
602
+ Input : A - Data to write
603
+ Output : Carry flag set if failed
604
+ Registers: All
605
+ ```
606
+ #### TAPOOF
607
+ ```
608
+ Address : #00F0
609
+ Function : Stops writing on the tape
610
+ ```
611
+ #### STMOTR
612
+ ```
613
+ Address : #00F3
614
+ Function : Sets the cassette motor action
615
+ Input : A - #00 stop motor
616
+ #01 start motor
617
+ #FF reverse the current action
618
+ Registers: AF
619
+ ```
620
+
621
+ ### Queue routines
622
+
623
+ #### LFTQ
624
+ ```
625
+ Address : #00F6
626
+ Function : Gives number of bytes in queue
627
+ Output : A - Length of queue in bytes
628
+ Remark : Internal use
629
+ ```
630
+ #### PUTQ
631
+ ```
632
+ Address : #00F9
633
+ Function : Put byte in queue
634
+ Remark : Internal use
635
+ ```
636
+
637
+ ### Graphic routines
638
+
639
+ #### RIGHTC
640
+ ```
641
+ Address : #00FC
642
+ Function : Shifts screen pixel to the right
643
+ Registers: AF
644
+ ```
645
+ #### LEFTC
646
+ ```
647
+ Address : #00FF
648
+ Function : Shifts screen pixel to the left
649
+ Registers: AF
650
+ ```
651
+ #### UPC
652
+ ```
653
+ Address : #0102
654
+ Function : Shifts screen pixel up
655
+ Registers: AF
656
+ ```
657
+ #### TUPC
658
+ ```
659
+ Address : #0105
660
+ Function : Tests whether [UPC](#UPC) is possible, if possible, execute [UPC](#UPC)
661
+ Output : Carry flag set if operation would end outside the screen
662
+ Registers: AF
663
+ ```
664
+ #### DOWNC
665
+ ```
666
+ Address : #0108
667
+ Function : Shifts screen pixel down
668
+ Registers: AF
669
+ ```
670
+ #### TDOWNC
671
+ ```
672
+ Address : #010B
673
+ Function : Tests whether [DOWNC](#DOWNC) is possible, if possible, execute [DOWNC](#DOWNC)
674
+ Output : Carry flag set if operation would end outside the screen
675
+ Registers: AF
676
+ ```
677
+ #### SCALXY
678
+ ```
679
+ Address : #010E
680
+ Function : Scales X and Y coordinates
681
+ ```
682
+ #### MAPXY
683
+ ```
684
+ Address : #0111
685
+ Function : Places cursor at current cursor address
686
+ ```
687
+ #### FETCHC
688
+ ```
689
+ Address : #0114
690
+ Function : Gets current cursor addresses mask pattern
691
+ Output : HL - Cursor address
692
+ A - Mask pattern
693
+ ```
694
+ #### STOREC
695
+ ```
696
+ Address : #0117
697
+ Function : Record current cursor addresses mask pattern
698
+ Input : HL - Cursor address
699
+ A - Mask pattern
700
+ ```
701
+ #### SETATR
702
+ ```
703
+ Address : #011A
704
+ Function : Set attribute byte
705
+ ```
706
+ #### READC
707
+ ```
708
+ Address : #011D
709
+ Function : Reads attribute byte of current screen pixel
710
+ ```
711
+ #### SETC
712
+ ```
713
+ Address : #0120
714
+ Function : Returns current screen pixel of specified attribute byte
715
+ ```
716
+ #### NSETCX
717
+ ```
718
+ Address : #0123
719
+ Function : Set horizontal screen pixels
720
+ ```
721
+ #### GTASPC
722
+ ```
723
+ Address : #0126
724
+ Function : Gets screen relations
725
+ Output : DE, HL
726
+ Registers: DE, HL
727
+ ```
728
+ #### PNTINI
729
+ ```
730
+ Address : #0129
731
+ Function : Initalises the PAINT instruction
732
+ ```
733
+ #### SCANR
734
+ ```
735
+ Address : #012C
736
+ Function : Scans screen pixels to the right
737
+ ```
738
+ #### SCANL
739
+ ```
740
+ Address : #012F
741
+ Function : Scans screen pixels to the left
742
+ ```
743
+
744
+ ### Misc routines
745
+
746
+ #### CHGCAP
747
+ ```
748
+ Address : #0132
749
+ Function : Alternates the CAPS lamp status
750
+ Input : A - #00 is lamp on
751
+ not #00 is lamp off
752
+ Registers: AF
753
+ ```
754
+ #### CHGSND
755
+ ```
756
+ Address : #0135
757
+ Function : Alternates the 1-bit sound port status
758
+ Input : A - #00 to turn off
759
+ not #00 to turn on
760
+ Registers: AF
761
+ ```
762
+ #### RSLREG
763
+ ```
764
+ Address : #0138
765
+ Function : Reads the primary slot register
766
+ Output : A - For the value which was read
767
+ 33221100
768
+ ││││││└┴─ Page 0 (#0000-#3FFF)
769
+ ││││└┴─── Page 1 (#4000-#7FFF)
770
+ ││└┴───── Page 2 (#8000-#BFFF)
771
+ └┴─────── Page 3 (#C000-#FFFF)
772
+ Registers: A
773
+ ```
774
+ #### WSLREG
775
+ ```
776
+ Address : #013B
777
+ Function : Writes value to the primary slot register
778
+ Input : A - Value to write, see [RSLREG](#RSLREG)
779
+ ```
780
+ #### RDVDP
781
+ ```
782
+ Address : #013E
783
+ Function : Reads VDP status register
784
+ Output : A - Value which was read
785
+ Registers: A
786
+ ```
787
+ #### SNSMAT
788
+ ```
789
+ Address : #0141
790
+ Function : Returns the value of the specified line from the keyboard matrix
791
+ Input : A - For the specified line
792
+ Output : A - For data (the bit corresponding to the pressed key will be 0)
793
+ Registers: AF
794
+ ```
795
+ #### PHYDIO
796
+ ```
797
+ Address : #0144
798
+ Function : Executes I/O for mass-storage media like disks
799
+ Input : F - Set carry to write, reset carry to read
800
+ A - Drive number (0 = A:, 1 = B:, etc.)
801
+ B - Number of sectors
802
+ C - Media ID of the disk
803
+ DE - Begin sector
804
+ HL - Begin address in memory
805
+ Output : F - Carry set on error
806
+ A - Error code (only if carry set)
807
+ 0 = Write protected
808
+ 2 = Not ready
809
+ 4 = Data error
810
+ 6 = Seek error
811
+ 8 = Record not found
812
+ 10 = Write error
813
+ 12 = Bad parameter
814
+ 14 = Out of memory
815
+ 16 = Other error
816
+ B - Number of sectors actually written or read
817
+ Registers: All
818
+ Remark : Interrupts may be disabled afterwards. On some hard disk interfaces,
819
+ when bit 7 of register C is set, a 23-bit addressing scheme is used
820
+ and bits 0-6 of register C contain bits 23-16 of the sector number.
821
+ ```
822
+ #### FORMAT
823
+ ```
824
+ Address : #0147
825
+ Function : Initialises mass-storage media like formatting of disks
826
+ Registers: All
827
+ Remark : In minimum configuration only a HOOK is available
828
+ ```
829
+ #### ISFLIO
830
+ ```
831
+ Address : #014A
832
+ Function : Tests if I/O to device is taking place
833
+ Output : A - #00 if not taking place
834
+ not #00 if taking place
835
+ Registers: AF
836
+ ```
837
+ #### OUTDLP
838
+ ```
839
+ Address : #014D
840
+ Function : Printer output
841
+ Input : A - Code to print
842
+ Registers: F
843
+ Remark : Differences with [LPTOUT](#LPTOUT):
844
+ 1. TAB is expanded to spaces
845
+ 2. For non-MSX printers, Hiragana is transformed to katakana
846
+ and graphic characters are transformed to 1-byte characters
847
+ 3. If failed, device I/O error occurs
848
+ ```
849
+ #### GETVCP
850
+ ```
851
+ Address : #0150
852
+ Function : Returns pointer to play queue
853
+ Input : A - Channel number
854
+ Output : HL - Pointer
855
+ Registers: AF
856
+ Remark : Only used to play music in background
857
+ ```
858
+ #### GETVC2
859
+ ```
860
+ Address : #0153
861
+ Function : Returns pointer to variable in queue number VOICEN (byte at #FB38)
862
+ Input : L - Pointer in play buffer
863
+ Output : HL - Pointer
864
+ Registers: AF
865
+ ```
866
+ #### KILBUF
867
+ ```
868
+ Address : #0156
869
+ Function : Clear keyboard buffer
870
+ Registers: HL
871
+ ```
872
+ #### CALBAS
873
+ ```
874
+ Address : #0159
875
+ Function : Executes inter-slot call to the routine in BASIC interpreter
876
+ Input : IX - For the calling address
877
+ Output : Depends on the called routine
878
+ Registers: Depends on the called routine
879
+ ```
880
+
881
+ ## MSX 2 BIOS Entries
882
+
883
+ #### SUBROM
884
+ ```
885
+ Address : #015C
886
+ Function : Calls a routine in SUB-ROM
887
+ Input : IX - Address of routine in SUB-ROM
888
+ Output : Depends on the routine
889
+ Registers: Alternative registers, IY
890
+ Remark : Use of [EXTROM](#EXTROM) or [CALSLT](#CALSLT) is more convenient.
891
+ In IX an extra value to the routine can be given by first
892
+ pushing it to the stack.
893
+ ```
894
+ #### EXTROM
895
+ ```
896
+ Address : #015F
897
+ Function : Calls a routine in SUB-ROM. Most common way
898
+ Input : IX - Address of routine in SUB-ROM
899
+ Output : Depends on the routine
900
+ Registers: Alternative registers, IY
901
+ Remark : Use: LD IX,address
902
+ CALL EXTROM
903
+ ```
904
+ #### CHKSLZ
905
+ ```
906
+ Address : #0162
907
+ Function : Search slots for SUB-ROM
908
+ Registers: All
909
+ ```
910
+ #### CHKNEW
911
+ ```
912
+ Address : #0165
913
+ Function : Tests screen mode
914
+ Output : Carry flag set if screenmode = 5, 6, 7 or 8
915
+ Registers: AF
916
+ ```
917
+ #### EOL
918
+ ```
919
+ Address : #0168
920
+ Function : Deletes to the end of the line
921
+ Input : H - X coordinate of cursor
922
+ L - Y coordinate of cursor
923
+ Registers: All
924
+ ```
925
+ #### BIGFIL
926
+ ```
927
+ Address : #016B
928
+ Function : Same function as [FILVRM](#FILVRM) (with 16-bit VRAM-address).
929
+ Input : HL - Address
930
+ BC - Length
931
+ A - Data
932
+ Registers: AF,BC
933
+ ```
934
+ #### NSETRD
935
+ ```
936
+ Address : #016E
937
+ Function : Same function as [SETRD](#SETRD) (with 16-bit VRAM-address).
938
+ Input : HL - VRAM address
939
+ Registers: AF
940
+ ```
941
+ #### NSTWRT
942
+ ```
943
+ Address : #0171
944
+ Function : Same function as [SETWRT](#SETWRT) (with 16-bit VRAM-address).
945
+ Input : HL - VRAM address
946
+ Registers: AF
947
+ ```
948
+ #### NRDVRM
949
+ ```
950
+ Address : #0174
951
+ Function : Reads VRAM like in [RDVRM](#RDVRM) (with 16-bit VRAM-address).
952
+ Input : HL - VRAM address
953
+ Output : A - Read value
954
+ Registers: F
955
+ ```
956
+ #### NWRVRM
957
+ ```
958
+ Address : #0177
959
+ Function : Writes to VRAM like in [WRTVRM](#WRTVRM) (with 16-bit VRAM-address).
960
+ Input : HL - VRAM address
961
+ A - Value to write
962
+ Registers: AF
963
+ ```
964
+
965
+ ## MSX 2+ BIOS Entries
966
+
967
+ #### RDRES
968
+ ```
969
+ Address : #017A
970
+ Function : Read value of I/O port #F4
971
+ Input : None
972
+ Output : A = value read
973
+ Registers: AF
974
+ ```
975
+ #### WRRES
976
+ ```
977
+ Address : #017D
978
+ Function : Write value to I/O port #F4
979
+ Input : A = value to write
980
+ When bit 7 is reset it shows the MSX 2+ startup screen on boot,
981
+ and counts and initialises the RAM.
982
+ Output : None
983
+ Registers: None
984
+ ```
985
+
986
+ ## MSX turbo R BIOS Entries
987
+
988
+ #### CHGCPU
989
+ ```
990
+ Address : #0180
991
+ Function : Changes CPU mode
992
+ Input : A = LED 0 0 0 0 0 x x
993
+ │ 0 0 = Z80 (ROM) mode
994
+ │ 0 1 = R800 ROM mode
995
+ │ 1 0 = R800 DRAM mode
996
+ LED indicates whether the Turbo LED is switched with the CPU
997
+ Output : None
998
+ Registers: None
999
+ ```
1000
+ #### GETCPU
1001
+ ```
1002
+ Address : #0183
1003
+ Function : Returns current CPU mode
1004
+ Input : None
1005
+ Output : A = 0 0 0 0 0 0 x x
1006
+ 0 0 = Z80 (ROM) mode
1007
+ 0 1 = R800 ROM mode
1008
+ 1 0 = R800 DRAM mode
1009
+ Registers: AF
1010
+ ```
1011
+ #### PCMPLY
1012
+ ```
1013
+ Address : #0186
1014
+ Function : Plays specified memory area through the PCM chip
1015
+ Input : A = v 0 0 0 0 0 x x
1016
+ │ │ │
1017
+ │ └─┴── Quality parameter (Speed: 0 = Fast)
1018
+ └──────────────── VRAM usage flag
1019
+ HL= Start address in RAM or VRAM
1020
+ BC= Length of area to play
1021
+ D = Bit 0 = Bit 17 of area length when using VRAM
1022
+ E = Bit 0 = Bit 17 os start address when using VRAM
1023
+ Output : Carry flag set when aborted with CTRL-STOP
1024
+ Registers: All
1025
+ ```
1026
+ #### PCMREC
1027
+ ```
1028
+ Address : #0189
1029
+ Function : Records audio using the PCM chip into the specified memory area
1030
+ Input : A = v t t t t c x x
1031
+ │ │ │ │ │ │ │ │
1032
+ │ │ │ │ │ │ └─┴── Quality parameter (Speed: 0 = Fast)
1033
+ │ │ │ │ │ └────── Zero-data compression
1034
+ │ └─┴─┴─┴──────── Treshold
1035
+ └──────────────── VRAM usage flag
1036
+ HL= Start address in RAM or VRAM
1037
+ BC= Length of area to play
1038
+ D = Bit 0 = Bit 17 of area length when using VRAM
1039
+ E = Bit 0 = Bit 17 os start address when using VRAM
1040
+ Output : Carry flag set when aborted with CTRL-STOP
1041
+ Registers: All
1042
+ ```
1043
+
1044
+ ~BiFi
1045
+
1046
+ © 2025 MSX Assembly Page. MSX is a trademark of MSX Licensing Corporation.