@nataliapc/mcp-openmsx 1.1.14 → 1.2.2

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 (196) hide show
  1. package/README.md +37 -12
  2. package/dist/server.js +198 -69
  3. package/dist/utils.js +54 -7
  4. package/dist/vectordb.js +60 -0
  5. package/package.json +10 -3
  6. package/resources/audio/MGSC111.txt +669 -0
  7. package/resources/audio/msx-midi.md +872 -0
  8. package/resources/audio/opl4tech.txt +688 -0
  9. package/resources/audio/psg_registers.md +281 -0
  10. package/resources/audio/sound_cartridge_scc.md +123 -0
  11. package/resources/audio/sound_cartridge_scci.md +250 -0
  12. package/resources/audio/toc.json +18 -7
  13. package/resources/book--msx2-technical-handbook/toc.json +1 -1
  14. package/resources/msx-unapi/toc.json +2 -2
  15. package/resources/processors/toc.json +4 -4
  16. package/resources/processors/z80_detailed_instruction_set.md +80 -68
  17. package/resources/programming/basic_wiki/ABS().md +36 -0
  18. package/resources/programming/basic_wiki/AND.md +71 -0
  19. package/resources/programming/basic_wiki/ASC().md +38 -0
  20. package/resources/programming/basic_wiki/ATN().md +36 -0
  21. package/resources/programming/basic_wiki/AUTO.md +39 -0
  22. package/resources/programming/basic_wiki/BASE().md +147 -0
  23. package/resources/programming/basic_wiki/BEEP.md +27 -0
  24. package/resources/programming/basic_wiki/BIN$().md +36 -0
  25. package/resources/programming/basic_wiki/BLOAD.md +63 -0
  26. package/resources/programming/basic_wiki/BSAVE.md +61 -0
  27. package/resources/programming/basic_wiki/CALL.md +391 -0
  28. package/resources/programming/basic_wiki/CALL_ADJUST.md +40 -0
  29. package/resources/programming/basic_wiki/CALL_IMPOSE.md +28 -0
  30. package/resources/programming/basic_wiki/CALL_OPTIONS.md +26 -0
  31. package/resources/programming/basic_wiki/CALL_PAUSE.md +119 -0
  32. package/resources/programming/basic_wiki/CALL_PCMPLAY.md +60 -0
  33. package/resources/programming/basic_wiki/CALL_PCMREC.md +70 -0
  34. package/resources/programming/basic_wiki/CDBL().md +36 -0
  35. package/resources/programming/basic_wiki/CHR$().md +51 -0
  36. package/resources/programming/basic_wiki/CINT().md +36 -0
  37. package/resources/programming/basic_wiki/CIRCLE.md +51 -0
  38. package/resources/programming/basic_wiki/CLEAR.md +39 -0
  39. package/resources/programming/basic_wiki/CLOAD.md +27 -0
  40. package/resources/programming/basic_wiki/CLOAD?.md +31 -0
  41. package/resources/programming/basic_wiki/CLOSE.md +44 -0
  42. package/resources/programming/basic_wiki/CLS.md +51 -0
  43. package/resources/programming/basic_wiki/COLOR.md +143 -0
  44. package/resources/programming/basic_wiki/COLOR=.md +93 -0
  45. package/resources/programming/basic_wiki/COLOR_SPRITE$().md +83 -0
  46. package/resources/programming/basic_wiki/COLOR_SPRITE().md +85 -0
  47. package/resources/programming/basic_wiki/CONT.md +23 -0
  48. package/resources/programming/basic_wiki/COPY.md +215 -0
  49. package/resources/programming/basic_wiki/COPY_SCREEN.md +61 -0
  50. package/resources/programming/basic_wiki/COS().md +37 -0
  51. package/resources/programming/basic_wiki/CSAVE.md +35 -0
  52. package/resources/programming/basic_wiki/CSNG().md +36 -0
  53. package/resources/programming/basic_wiki/CSRLIN.md +33 -0
  54. package/resources/programming/basic_wiki/DATA.md +47 -0
  55. package/resources/programming/basic_wiki/DEFDBL.md +40 -0
  56. package/resources/programming/basic_wiki/DEFINT.md +40 -0
  57. package/resources/programming/basic_wiki/DEFSNG.md +40 -0
  58. package/resources/programming/basic_wiki/DEFSTR.md +40 -0
  59. package/resources/programming/basic_wiki/DEF_FN.md +49 -0
  60. package/resources/programming/basic_wiki/DEF_USR.md +33 -0
  61. package/resources/programming/basic_wiki/DELETE.md +49 -0
  62. package/resources/programming/basic_wiki/DIM.md +59 -0
  63. package/resources/programming/basic_wiki/DRAW.md +77 -0
  64. package/resources/programming/basic_wiki/ELSE.md +45 -0
  65. package/resources/programming/basic_wiki/END.md +32 -0
  66. package/resources/programming/basic_wiki/EOF().md +36 -0
  67. package/resources/programming/basic_wiki/EQV.md +76 -0
  68. package/resources/programming/basic_wiki/ERASE.md +35 -0
  69. package/resources/programming/basic_wiki/ERL.md +34 -0
  70. package/resources/programming/basic_wiki/ERR.md +143 -0
  71. package/resources/programming/basic_wiki/ERROR.md +145 -0
  72. package/resources/programming/basic_wiki/EXP().md +38 -0
  73. package/resources/programming/basic_wiki/FIELD.md +48 -0
  74. package/resources/programming/basic_wiki/FIX().md +44 -0
  75. package/resources/programming/basic_wiki/FN.md +61 -0
  76. package/resources/programming/basic_wiki/FOR...NEXT.md +80 -0
  77. package/resources/programming/basic_wiki/FRE().md +66 -0
  78. package/resources/programming/basic_wiki/GET_DATE.md +60 -0
  79. package/resources/programming/basic_wiki/GET_TIME.md +34 -0
  80. package/resources/programming/basic_wiki/GOSUB.md +41 -0
  81. package/resources/programming/basic_wiki/GOTO.md +41 -0
  82. package/resources/programming/basic_wiki/HEX$().md +36 -0
  83. package/resources/programming/basic_wiki/IF...GOTO...ELSE.md +55 -0
  84. package/resources/programming/basic_wiki/IF...THEN...ELSE.md +50 -0
  85. package/resources/programming/basic_wiki/IMP.md +83 -0
  86. package/resources/programming/basic_wiki/INKEY$.md +65 -0
  87. package/resources/programming/basic_wiki/INP().md +33 -0
  88. package/resources/programming/basic_wiki/INPUT$().md +51 -0
  89. package/resources/programming/basic_wiki/INPUT.md +93 -0
  90. package/resources/programming/basic_wiki/INSTR().md +44 -0
  91. package/resources/programming/basic_wiki/INT().md +44 -0
  92. package/resources/programming/basic_wiki/INTERVAL.md +57 -0
  93. package/resources/programming/basic_wiki/KEY().md +51 -0
  94. package/resources/programming/basic_wiki/KEY.md +254 -0
  95. package/resources/programming/basic_wiki/LEFT$().md +39 -0
  96. package/resources/programming/basic_wiki/LEN().md +36 -0
  97. package/resources/programming/basic_wiki/LET.md +68 -0
  98. package/resources/programming/basic_wiki/LINE.md +74 -0
  99. package/resources/programming/basic_wiki/LINE_INPUT.md +79 -0
  100. package/resources/programming/basic_wiki/LIST.md +58 -0
  101. package/resources/programming/basic_wiki/LLIST.md +43 -0
  102. package/resources/programming/basic_wiki/LOAD.md +56 -0
  103. package/resources/programming/basic_wiki/LOCATE.md +67 -0
  104. package/resources/programming/basic_wiki/LOG().md +36 -0
  105. package/resources/programming/basic_wiki/LPOS().md +31 -0
  106. package/resources/programming/basic_wiki/LPRINT.md +46 -0
  107. package/resources/programming/basic_wiki/MAXFILES.md +39 -0
  108. package/resources/programming/basic_wiki/MERGE.md +54 -0
  109. package/resources/programming/basic_wiki/MID$().md +72 -0
  110. package/resources/programming/basic_wiki/MOD.md +39 -0
  111. package/resources/programming/basic_wiki/MOTOR.md +46 -0
  112. package/resources/programming/basic_wiki/NEW.md +27 -0
  113. package/resources/programming/basic_wiki/NOT.md +61 -0
  114. package/resources/programming/basic_wiki/OCT$().md +36 -0
  115. package/resources/programming/basic_wiki/ON...GOSUB.md +45 -0
  116. package/resources/programming/basic_wiki/ON...GOTO.md +42 -0
  117. package/resources/programming/basic_wiki/ON_ERROR_GOTO.md +61 -0
  118. package/resources/programming/basic_wiki/ON_INTERVAL_GOSUB.md +54 -0
  119. package/resources/programming/basic_wiki/ON_KEY_GOSUB.md +56 -0
  120. package/resources/programming/basic_wiki/ON_SPRITE_GOSUB.md +41 -0
  121. package/resources/programming/basic_wiki/ON_STOP_GOSUB.md +56 -0
  122. package/resources/programming/basic_wiki/ON_STRIG_GOSUB.md +70 -0
  123. package/resources/programming/basic_wiki/OPEN.md +103 -0
  124. package/resources/programming/basic_wiki/OR.md +75 -0
  125. package/resources/programming/basic_wiki/OUT.md +35 -0
  126. package/resources/programming/basic_wiki/PAD().md +110 -0
  127. package/resources/programming/basic_wiki/PAINT.md +66 -0
  128. package/resources/programming/basic_wiki/PDL().md +53 -0
  129. package/resources/programming/basic_wiki/PEEK().md +44 -0
  130. package/resources/programming/basic_wiki/PLAY().md +58 -0
  131. package/resources/programming/basic_wiki/PLAY.md +196 -0
  132. package/resources/programming/basic_wiki/POINT.md +52 -0
  133. package/resources/programming/basic_wiki/POKE.md +51 -0
  134. package/resources/programming/basic_wiki/POS().md +36 -0
  135. package/resources/programming/basic_wiki/PRESET.md +61 -0
  136. package/resources/programming/basic_wiki/PRINT.md +179 -0
  137. package/resources/programming/basic_wiki/PSET.md +82 -0
  138. package/resources/programming/basic_wiki/PUT_KANJI.md +93 -0
  139. package/resources/programming/basic_wiki/PUT_SPRITE.md +143 -0
  140. package/resources/programming/basic_wiki/READ.md +45 -0
  141. package/resources/programming/basic_wiki/REM.md +42 -0
  142. package/resources/programming/basic_wiki/RENUM.md +78 -0
  143. package/resources/programming/basic_wiki/RESTORE.md +52 -0
  144. package/resources/programming/basic_wiki/RESUME.md +45 -0
  145. package/resources/programming/basic_wiki/RETURN.md +47 -0
  146. package/resources/programming/basic_wiki/RIGHT$().md +39 -0
  147. package/resources/programming/basic_wiki/RND().md +51 -0
  148. package/resources/programming/basic_wiki/RUN.md +56 -0
  149. package/resources/programming/basic_wiki/SAVE.md +65 -0
  150. package/resources/programming/basic_wiki/SCREEN.md +164 -0
  151. package/resources/programming/basic_wiki/SET_ADJUST.md +66 -0
  152. package/resources/programming/basic_wiki/SET_BEEP.md +76 -0
  153. package/resources/programming/basic_wiki/SET_DATE.md +103 -0
  154. package/resources/programming/basic_wiki/SET_PAGE.md +52 -0
  155. package/resources/programming/basic_wiki/SET_PASSWORD.md +75 -0
  156. package/resources/programming/basic_wiki/SET_PROMPT.md +61 -0
  157. package/resources/programming/basic_wiki/SET_SCREEN.md +100 -0
  158. package/resources/programming/basic_wiki/SET_SCROLL.md +55 -0
  159. package/resources/programming/basic_wiki/SET_TIME.md +83 -0
  160. package/resources/programming/basic_wiki/SET_TITLE.md +87 -0
  161. package/resources/programming/basic_wiki/SET_VIDEO.md +49 -0
  162. package/resources/programming/basic_wiki/SGN().md +38 -0
  163. package/resources/programming/basic_wiki/SIN().md +36 -0
  164. package/resources/programming/basic_wiki/SOUND.md +188 -0
  165. package/resources/programming/basic_wiki/SPACE$().md +38 -0
  166. package/resources/programming/basic_wiki/SPC().md +34 -0
  167. package/resources/programming/basic_wiki/SPRITE$().md +50 -0
  168. package/resources/programming/basic_wiki/SPRITE.md +31 -0
  169. package/resources/programming/basic_wiki/SQR().md +32 -0
  170. package/resources/programming/basic_wiki/STICK().md +70 -0
  171. package/resources/programming/basic_wiki/STOP.md +70 -0
  172. package/resources/programming/basic_wiki/STR$().md +37 -0
  173. package/resources/programming/basic_wiki/STRIG().md +82 -0
  174. package/resources/programming/basic_wiki/STRING$().md +42 -0
  175. package/resources/programming/basic_wiki/SWAP.md +62 -0
  176. package/resources/programming/basic_wiki/TAB().md +38 -0
  177. package/resources/programming/basic_wiki/TAN().md +36 -0
  178. package/resources/programming/basic_wiki/TIME.md +59 -0
  179. package/resources/programming/basic_wiki/TROFF.md +21 -0
  180. package/resources/programming/basic_wiki/TRON.md +39 -0
  181. package/resources/programming/basic_wiki/USR().md +66 -0
  182. package/resources/programming/basic_wiki/VAL().md +36 -0
  183. package/resources/programming/basic_wiki/VARPTR().md +50 -0
  184. package/resources/programming/basic_wiki/VDP().md +103 -0
  185. package/resources/programming/basic_wiki/VPEEK().md +46 -0
  186. package/resources/programming/basic_wiki/VPOKE.md +48 -0
  187. package/resources/programming/basic_wiki/WAIT.md +38 -0
  188. package/resources/programming/basic_wiki/WIDTH.md +76 -0
  189. package/resources/programming/basic_wiki/XOR.md +72 -0
  190. package/resources/programming/basic_wiki/_toc.json +871 -0
  191. package/resources/sdcc/sdccman.lyx +81574 -0
  192. package/resources/sdcc/toc.json +77 -0
  193. package/vector-db/index.json +1 -0
  194. /package/resources/msx-unapi/{Ethernet_UNAPI_specification_1.1.md → Ethernet_UNAPI_specification_1_1.md} +0 -0
  195. /package/resources/msx-unapi/{MSX_UNAPI_specification_1.1.md → MSX_UNAPI_specification_1_1.md} +0 -0
  196. /package/resources/processors/{Z80_R800_instruction_set.md → z80_r800_instruction_set.md} +0 -0
@@ -0,0 +1,61 @@
1
+ # PRESET
2
+
3
+ ## Effect
4
+
5
+ Puts a point of specified color on a graphic screen (2 to 8, 10 to 12). If not specified the current background color is chosen.
6
+
7
+ ## Syntax
8
+
9
+ `PRESET STEP(<X>,<Y>),<Color>,<Operator>`
10
+
11
+ _Note: Do not put a comma if no parameters are behind._
12
+
13
+ ## Parameters
14
+
15
+ `<X>` is coordinate X (0-255/511) of the point to put or remove on the screen.
16
+
17
+ `<Y>` is coordinate Y (0-191/211) of the point to put or remove on the screen.
18
+
19
+ Coordinates cannot be omitted.
20
+
21
+ If `STEP` is used before these coordinates, they are interpreted relative to the current cursor position. In this case the values can also be negative.
22
+
23
+ `<Color>` is the color to be used = 0 to 15 (screens 2 to 5, 7 and 10), 0 to 3 (screen 6), 0 to 255 (screens 8, 11, and 12). When this parameter is specified, `PRESET` works like PSET. If `<Color>` is not specified the current background color will be used instead the draw color for PSET, what implies that the point is not displayed or can even be removed.
24
+
25
+ `<Operator>` is the logical operation to be performed between the color of the old pixel and the new color. This parameter can be used only on screens 5 to 8 and 10 to 12, it requires a MSX2 or higher computer.
26
+
27
+ The available operators are `AND`, `OR`, `PRESET`, `PSET` (default), `TAND`, `TOR`, `TPRESET`, `TPSET`, `TXOR`, `XOR`. Specifying a logical operation preceded by "T" causes nothing to be done when specified color is transparent (color 0).
28
+
29
+ The effect of the operators is done on each corresponding bit as shown in the following table.
30
+
31
+ |Current bit|Copied color bit|AND|OR|PRESET|PSET|XOR|
32
+ |:-:|:-:|:-:|:-:|:-:|:-:|:-:|
33
+ |0|0|0|0|1|0|0|
34
+ |0|1|0|1|0|1|1|
35
+ |1|0|0|1|1|0|1|
36
+ |1|1|1|1|0|1|0|
37
+
38
+ ## Example
39
+
40
+ ```basic
41
+ 10 COLOR 15,1,4: SCREEN 2
42
+ 20 LINE (40,40)-(215,151),7,B
43
+ 30 FOR I=0 TO 100
44
+ 40 A=INT(RND(1)*173)+41
45
+ 50 B=INT(RND(1)*109)+41
46
+ 60 PRESET(A,B)
47
+ 80 NEXT I
48
+ 90 GOTO 90
49
+ ```
50
+
51
+ ## Related to
52
+
53
+ `CIRCLE`, `COLOR`, `DRAW`, `LINE`, `PAINT`, `POINT`, `PSET`, `SCREEN`
54
+
55
+ ## Compatibility
56
+
57
+ MSX-BASIC 1.0 or higher
58
+
59
+ ## Source
60
+
61
+ Retrieved from "https://www.msx.org/wiki/PRESET"
@@ -0,0 +1,179 @@
1
+ # PRINT
2
+
3
+ ## Effect
4
+
5
+ Displays and formats text and numbers on the screen or sends formatted data to different devices through file handling.
6
+
7
+ _Note: `PRINT` can be replaced by the `?` character. This will be expanded to `PRINT` when listing a MSX-BASIC program._
8
+
9
+ ## Syntax
10
+
11
+ `PRINT #<FileNumber>, USING <ItemFormat>; <Item>;<Item>...`
12
+
13
+ ## Parameters
14
+
15
+ `<Item>` can be a character string, an expression, a variable or a value to display or send. All four items types can be mixed freely.
16
+
17
+ Items must be separated by `;`. If the last item does not end to `;` then `CR`+`LF` combination is displayed or sent.
18
+
19
+ A comma can replace a `;` to separate the items. In case of `,` they are separated by tabulator instead of a space.
20
+
21
+ `<Item>` can be omitted to display or send an empty line.
22
+
23
+ `#<FileNumber>`, is optional. `<FileNumber>` is a number between 0 and 15 that points to opened file name. Please see `OPEN` instruction.
24
+
25
+ `USING <ItemFormat>;` is optional. `<ItemFormat>` is a string that defines how the next items to be displayed or sent must be formatted. When `USING` is used the type of following usable items depends on the specified format.
26
+
27
+ The format string can contain following definitions:
28
+
29
+ _**Editor's note: Following table and comments are inaccurate and need revisiting.**_
30
+
31
+ <table>
32
+ <tr><th>Format definition</th><th>Data type</th><th>Description</th></tr>
33
+ <tr><td>!</td><td>String</td><td>Prints only first character of current item. Example:
34
+
35
+ ```basic
36
+ PRINT USING "!";"United","Nations"
37
+ UN
38
+ ```
39
+ </td></tr>
40
+ <tr><td>\[n spaces]\</td><td>String</td><td>Prints n+2 characters. When the length of the data is less than n+2 characters, the rest is padded with spaces. Example:
41
+
42
+ ```basic
43
+ PRINT USING "\ \";"ABCDEF","GHI","JKLMN"
44
+ ABCDGHI JKLM
45
+ ```
46
+ </td></tr>
47
+ <tr><td>&</td><td>String</td><td>Displays the whole string. Example:
48
+
49
+ ```basic
50
+ A$="North";B$="South":PRINT USING "& Pole ";A$,B$
51
+ North Pole South Pole
52
+ ```
53
+ </td></tr>
54
+ <tr><td>#</td><td>Number</td><td><li>Reserves a space (up to 24) for number. Decimal point can be specified with the full stop ".". Example:
55
+
56
+ ```basic
57
+ PRINT USING "POINT:###.#";123.4
58
+ POINT:123.4
59
+ ```
60
+ <li>When the amount of digits is smaller than the amount of specified `#`, the number is displayed with equal amounts of margins at both sides and when the number of digits is larger, a `%` is output. Example:
61
+
62
+ ```basic
63
+ 10 PRINT USING "####";12
64
+ 20 PRINT USING "####";12345
65
+ RUN
66
+ 12
67
+ %12345
68
+ ```
69
+ <li>When the number of digits behind the decimal separator is smaller than the amount of the input, it is padded with a "0" and when it is larger, it is rounded to the nearest integer number. Example:
70
+
71
+ ```basic
72
+ 10 PRINT USING "##.##";25.3
73
+ 20 PRINT USING "##.##";25.345
74
+ RUN
75
+ 25.30
76
+ 25.35
77
+ ```
78
+ <li>When displaying numeric data, the "+" sign is ignored and the character is counted as a number. Example:
79
+
80
+ ```basic
81
+ 10 PRINT USING "###";+123
82
+ 20 PRINT USING "###";-123
83
+ RUN
84
+ 123
85
+ %-123
86
+ ```
87
+ </td></tr>
88
+ <tr><td>+</td><td>Number</td><td>Positive numbers will be output with "+"-sign and negative numbers with a "-"-sign. Either in front or behind the number. Example:
89
+
90
+ ```basic
91
+ 10 PRINT USING "+####";123,-123
92
+ 20 PRINT USING "####+";123,-123
93
+ RUN
94
+ +123 -123
95
+ 123+ 123-
96
+ ```
97
+ </td></tr>
98
+ <tr><td>-</td><td>Number</td><td>Can be used to mark "-" to end of number when the number is negative. Example:
99
+
100
+ ```basic
101
+ PRINT USING "###-";123,-123
102
+ RUN
103
+ 123 123-
104
+ ```
105
+ </td></tr>
106
+ <tr><td>**</td><td>Number</td><td>The space for numerical data will be filled with "*" characters. A single "*" represents a single digit. Example:
107
+
108
+ ```basic
109
+ 10 PRINT USING "**######";123
110
+ 20 PRINT USING "**######";-234
111
+ RUN
112
+ *****123
113
+ ****-234
114
+ ```
115
+ </td></tr>
116
+ <tr><td>££</td><td>Number</td><td>Displays "£" in front of number. One "£" layout symbol counts as digit. Example:
117
+
118
+ ```basic
119
+ 10 PRINT USING "££###";1234
120
+ 20 PRINT USING "+££###";-1234
121
+ RUN
122
+ £1234
123
+ -£1234
124
+ ```
125
+ </td></tr>
126
+ <tr><td>**£</td><td>Number</td><td>Displays "£" in front of number and fills up heading spaces with "*". Example:
127
+
128
+ ```basic
129
+ PRINT USING "**£###.##";12.34
130
+ ***£12.34
131
+ ```
132
+ </td></tr>
133
+ <tr><td>,</td><td>Number</td><td>Numbers will be printed in groups of 3 separated by "," if a comma is used somewhere before the decimal point. Example:
134
+
135
+ ```basic
136
+ PRINT USING "#,######.##";12345.67
137
+ 12,345.67
138
+ ```
139
+ </td></tr>
140
+ <tr><td>^^^^</td><td>Number</td><td>Displays the number in scientific format. The ^^^^ part represents the numbers of the exponent part. Example:
141
+
142
+ ```basic
143
+ PRINT USING "##.##^^^^";234.56
144
+ 2.35E+02
145
+ ```
146
+ </td></tr>
147
+ </table>
148
+
149
+ _Please note: Format string should be used with caution. Pound signs should be avoided since this causes compatibility problems. On some machines this is "$" depending on local currency. "&" has been replaced with "\" on european and Brazilian machines causing easily _"Type missmatch"_ error in localized machines. In Japanese machines "\" is printed as "¥"._
150
+
151
+ ## Examples
152
+
153
+ ```basic
154
+ 10 FM$="The print documentation on & & has ##.#% relative accuracy"
155
+ 20 PRINT USING FM$;"MRC",5
156
+  
157
+ RUN
158
+ The print documentation on MRC has 5.0% relative accuracy
159
+ Ok
160
+ ```
161
+
162
+ ```basic
163
+ PRINT USING "!!!";"Alpha";"Beta";"Charlie"
164
+ ABC
165
+ Ok
166
+ ```
167
+
168
+ ## Related to
169
+
170
+ `CSRLIN`, `LOCATE`, `LPRINT`, `MAXFILES`, `OPEN`, `POS()`, `SCREEN`, `SPC()`, `TAB()`
171
+ , `WIDTH`
172
+
173
+ ## Compatibility
174
+
175
+ MSX-BASIC 1.0 or higher
176
+
177
+ ## Source
178
+
179
+ Retrieved from "https://www.msx.org/wiki/PRINT"
@@ -0,0 +1,82 @@
1
+ # PSET
2
+
3
+ ## Effect
4
+
5
+ Puts a point of specified color on a graphic screen (2 to 8, 10 to 12). If not specified the current plot color is chosen.
6
+
7
+ ## Syntax
8
+
9
+ `PSET STEP(<X>,<Y>),<Color>,<Operator>`
10
+
11
+ _Note: Parameters can not end with a comma alone._
12
+
13
+ ## Parameters
14
+
15
+ `<Y>` is coordinate X (0-255/511) of the point to put on the screen.
16
+
17
+ `<Y>` is coordinate Y (0-191/211) of the point to put on the screen.
18
+
19
+ Coordinates cannot be omitted.
20
+
21
+ If `STEP` is used before these coordinates, they are interpreted relative to the current cursor position. In this case the values can also be negative.
22
+
23
+ `<Color>` is the color to be used = 0 to 15 (screens 2 to 5, 7 and 10), 0 to 3 (screen 6), 0 to 255 (screens 8, 11, and 12). If `<Color>` is not specified the current foreground color is used.
24
+
25
+ `<Operator>` is the logical operation to be performed between the color of the old pixel and the new color. This parameter can be used only on screens 5 to 8 and 10 to 12, it requires a MSX2 or higher computer.
26
+
27
+ The available operators are `AND`, `OR`, `PRESET`, `PSET` (default), `TAND`, `TOR`, `TPRESET`, `TPSET`, `TXOR`, `XOR`. Specifying a logical operation preceded by "T" causes nothing to be done when specified color is transparent (color 0).
28
+
29
+ The effect of the operators is done on each corresponding bit as shown in the following table.
30
+
31
+ |Current bit|Copied color bit|AND|OR|PRESET|PSET|XOR|
32
+ |:-:|:-:|:-:|:-:|:-:|:-:|:-:|
33
+ |0|0|0|0|1|0|0|
34
+ |0|1|0|1|0|1|1|
35
+ |1|0|0|1|1|0|1|
36
+ |1|1|1|1|0|1|0|
37
+
38
+ ## Examples
39
+
40
+ ```basic
41
+ 10 COLOR 15,1,4: SCREEN 2
42
+ 20 LINE (40,40)-(215,151),7,B
43
+ 30 FOR I=0 TO 100
44
+ 40 A=INT(RND(1)*173)+41
45
+ 50 B=INT(RND(1)*109)+41
46
+ 60 C=INT(RND(1)*14)+1
47
+ 70 PSET(A,B), C
48
+ 80 NEXT I
49
+ 90 GOTO 90
50
+ ```
51
+
52
+ ```basic
53
+ 10 SCREEN5: BC=12: C=0: OC=2: DIM C(10)
54
+ 20 COLOR OC,BC,6:CLS
55
+ 30 PSET(110,96),C,AND: PSET(114,96),C,TAND
56
+ 40 PSET(118,96),C,OR: PSET(122,96),C,TOR
57
+ 50 PSET(126,96),C,PRESET: PSET(130,96),C,TPRESET
58
+ 60 PSET(134,96),C,PSET: PSET(138,96),C,TPSET
59
+ 70 PSET(142,96),C,XOR: PSET(146,96),C,TXOR
60
+ 80 IF NOT STRIG(0) GOTO 80
61
+ 90 FOR I=1 TO 10: C(I)=POINT(106+(I*4),96): NEXT
62
+ 100 COLOR 15,4,7: SCREEN0
63
+ 110 PRINT RIGHT$("000"+BIN$(BC),4);" Old color =";BC
64
+ 120 PRINT RIGHT$("000"+BIN$(C),4);" Specified color =";C
65
+ 130 PRINT "===="
66
+ 140 FOR I=1 TO 10: READ A$
67
+ 150 PRINT RIGHT$("000"+BIN$(C(I)),4);" Plotted color is ";C(I);"with ";A$
68
+ 160 NEXT: END
69
+ 170 DATA "AND","TAND","OR","TOR","PRESET","TPRESET","PSET","TPSET","XOR","TXOR"
70
+ ```
71
+
72
+ ## Related to
73
+
74
+ `CIRCLE`, `COLOR`, `DRAW`, `LINE`, `PAINT`, `POINT`, `PRESET`, `SCREEN`
75
+
76
+ ## Compatibility
77
+
78
+ MSX-BASIC 1.0 or higher
79
+
80
+ ## Source
81
+
82
+ Retrieved from "https://www.msx.org/wiki/PSET"
@@ -0,0 +1,93 @@
1
+ # PUT KANJI
2
+
3
+ ## Effect
4
+
5
+ Displays kanji on graphic screen (only screen modes 5 to 8 and 10 to 12).
6
+
7
+ ## Syntax
8
+
9
+ `PUT KANJI STEP(<X>,<Y>),<JIScode>,<Color>,<Operator>,<Mode>`
10
+
11
+ ## Parameters
12
+
13
+ `<X>` is coordinate X of destination. (0-255/511).
14
+
15
+ `<Y>` is coordinate Y of destination. (0-211).
16
+
17
+ The coordinates (with the parentheses) can be omitted only if there are parameters behind.
18
+
19
+ If `STEP` is used before these coordinates, they are interpreted relative to the current cursor position. In this case the values can also be negative.
20
+
21
+ `<JIScode>` is the JIS code corresponding to a character from the Kanji-ROM. (&H2120~&H4F53 for Level 1, and &H5020~&H7424 for Level 2).
22
+
23
+ `<Color>` is the color code = 0 to 15 (screens 5, 7 and 10), 0 to 3 (screen 6), 0 to 255 (screens 8, 11 and 12).
24
+
25
+ `<Operator>` is the logical operation to be performed between the color of the old pixel and the new color.
26
+
27
+ The available operators are `AND`, `OR`, `PRESET`, `PSET` (default), `TAND`, `TOR`, `TPRESET`, `TPSET`, `TXOR`, `XOR`. Specifying a logical operation preceded by "T" causes nothing to be done when specified color is transparent (color 0).
28
+
29
+ The effect of the operators is done on each corresponding bit as shown in the following table.
30
+
31
+ |Current bit|Copied color bit|AND|OR|PRESET|PSET|XOR|
32
+ |:-:|:-:|:-:|:-:|:-:|:-:|:-:|
33
+ |0|0|0|0|1|0|0|
34
+ |0|1|0|1|0|1|1|
35
+ |1|0|0|1|1|0|1|
36
+ |1|1|1|1|0|1|0|
37
+
38
+ `<Mode>` is the character size. (0-2, 0 by default):
39
+ - 0 is 16x16 dot
40
+ - 1 is 16x8 dot (only odd lines are displayed)
41
+ - 2 is 16x8 dot (only even lines are displayed)
42
+
43
+ ## Examples
44
+
45
+ ```basic
46
+ 10 SCREEN5
47
+ 20 PUT KANJI (99,99),&H4267
48
+ 30 GOTO 30
49
+ ```
50
+ Result: Shows the JIS1 Kanji `大` at coordinate X=99, Y=99
51
+
52
+ ---
53
+ ```basic
54
+ 10 SCREEN5
55
+ 20 PUT KANJI (99,99),&H737E
56
+ 30 GOTO 30
57
+ ```
58
+ Result: Shows the JIS2 Kanji `龠` on those systems with JIS2 character sets, or nothing on those without.
59
+
60
+ ---
61
+ ```basic
62
+ 5 ' ### JIS Code Table by KdL (2017.08.18)
63
+ 10 COLOR 15,4,4: SCREEN 5: DEFINT A-Z
64
+ 15 JIS=&H2120: OPEN "GRP:" FOR OUTPUT AS #1
65
+ 20 W=16: N=N+1: PRESET(4,W+172)
66
+ 25 PRINT#1,"[ BASE ADR ";HEX$(JIS);"H ] [ PAGE ";
67
+ 30 PRINT#1,RIGHT$(CHR$(N\10+48)+CHR$(NMOD10+48),2);" ]"
68
+ 35 FOR Y=0 TO 5: FOR X=0 TO 15
69
+ 40 PUT KANJI(X*16,W+Y*16),JIS,15
70
+ 45 JIS=JIS+1: NEXT X: W=W+8: NEXT Y
71
+ 50 IF JIS=&H7480 THEN CLOSE #1: K$=INPUT$(1): END
72
+ 55 IF JIS=&H2780 THEN JIS=&H2F80: N=N+8
73
+ 60 JIS=JIS+&HA0: K$=INPUT$(1): CLS: GOTO 20
74
+ ```
75
+ Result: Shows the full JIS Code Table.
76
+
77
+ This [conversion table](http://www.asahi-net.or.jp/~ax2s-kmtn/ref/jisx0208.html) may help you to get the JIS code.
78
+
79
+ ## Links
80
+
81
+ [MSX-Kanji revealed](http://www.msxcomputermagazine.nl/mccw/91/KANJI-stuff/en.html) for an in-depth article on this topic.
82
+
83
+ ## Related to
84
+
85
+ `AND`, `CALL JIS`, `CALL SJIS`, `OR`, `XOR`
86
+
87
+ ## Compatibility
88
+
89
+ MSX-BASIC 2.0 or higher - Requires a computer with Kanji-ROM
90
+
91
+ ## Source
92
+
93
+ Retrieved from "https://www.msx.org/wiki/PUT_KANJI"
@@ -0,0 +1,143 @@
1
+ # PUT SPRITE
2
+
3
+ ## Effect
4
+
5
+ Displays a sprite.
6
+
7
+ Known bugs:
8
+ - The coordinate Y is shifted +1 relative to other graphical instructions.
9
+ - Using the `OR operator` no longer works correctly on sprites above 26.
10
+
11
+ ## Syntax
12
+
13
+ `PUT SPRITE <SpriteNumber>,STEP(<X>,<Y>),<Color>,<PatternNumber>`
14
+
15
+ _Note: Do not put a comma if no parameters are behind._
16
+
17
+ ## Parameters
18
+
19
+ `<SpriteNumber>` is a number between 0 and 31 that specifies the display priority number of sprite. When the number is bigger, the sprite is displayed under the others. 0 is the highest priority, 31 the lowest priority.
20
+
21
+ `<X>` is abscissa coordinate. The value is between -32 and 255. In screens 6 and 7 the sprites are displayed like if the resolution was 256x212.
22
+
23
+ `<Y>` is ordinate coordinate. The value is between -32 and 191 in screens 1 to 3, between -32 and 211 in screens 4 to 8 and 10 to 12.
24
+
25
+ The special coordinates 208 and 216 on respectively mode 1 (screens 1 to 3) and mode 2 (screens 4 to 8 and 10 to 12) disable all subsequent sprites on the SAT (Sprite Attribute Table). MSX-BASIC also has the special coordinates 209 and 217, meant to take a single sprite off the screen.
26
+
27
+ If `STEP` is specified before these coordinates, they are interpreted relative to the current cursor position. In this case the values can also be negative.
28
+
29
+ If `<X>` and `<Y>` are not specified the current coordinates remain unchanged. Note that the maximum of sprites on the same horizontal line is limited to 4 on screens 1 to 3, to 8 on screens 4 to 8 and 10 to 12.
30
+
31
+ `<Color>` is a number:
32
+ - between 0 and 15 in screen 1 to 3 (sprites type 1).
33
+ - between 0 and 127 in screens 4 to 8 and 10 to 12 (sprites type 2). It is the result of values 0 or 1 in the 8-bit VDP Sprite Color Register, used only for this type of sprites. As bit 4 is unused, some values between 16 and 127 are useless.
34
+
35
+ _Note: In screen 8, the colors for the sprites are different from the colors of other screen modes._
36
+
37
+ Table below is the detail for the color value format of sprites type 2:
38
+
39
+ |Bits|Effect|
40
+ |:-:|---|
41
+ |7|Remember to set this bit to 0 otherwise an error "Illegal function call" occurs.|
42
+ |6|1 to enable OR operation with bits pattern of linked sprites. The linked sprites are sprites displayed below with the bit 6 at 0. Four sprites can be linked.<br>Each bit at 1 in sprite patterns corresponds to the specified color of sprite. The `OR operation` is performed with the sprite colors on each bit superposed when displayed. The colors are taken into account for operation only when the bit is at 1. Thus the color of each pixel of the sprite at the top (with bit 6 to 1) will take the color resulting from each operation. (See `OR operation` for more info).|
43
+ |5|1 to ignore the sprite collision with another sprite. (`ON SPRITE GOSUB` will have no effect)|
44
+ |4|Unused.|
45
+ |3-0|Color is used for the sprite (0~15 in decimal). The used colors are different in screen 8.|
46
+
47
+ To get the decimal value, you can input one of the following instructions:
48
+
49
+ |Bit|Instruction|
50
+ |:-:|---|
51
+ |5 set|`PRINT C+&B0100000`|
52
+ |6 set|`PRINT C+&B1000000`|
53
+ |5 and 6 set|`PRINT C+&B1100000`|
54
+
55
+ `C` is the color number (0~15) that you want to use.
56
+
57
+ Here is the detail with the decimal values and the different effects:
58
+
59
+ |Color|Effects|
60
+ |:-:|---|
61
+ |0-15|The corresponding color is used for the sprite.|
62
+ |32-47|<li>The color corresponding to (number - 32) is used for the sprite.<br><li>Collision with another sprite is ignored (`ON SPRITE GOSUB` will have no effect).|
63
+ |64-79|<li>The color corresponding to (number - 64) is used for the sprite.<br><li>The logical `operator OR` is applied between colors of previous sprite pattern and new sprite pattern.|
64
+ |96-111|<li>The color corresponding to (number - 96) is used for the sprite.<br><li> Collision with another sprite is ignored (`ON SPRITE GOSUB` will have no effect).<br><li>The logical `operator OR` is applied between colors of previous sprite pattern and new sprite pattern.|
65
+
66
+ If `<Color>` is not set the last foreground color will be used. The default value is 15. However, in screens 4 to 8 and 10 to 12, the color(s) previously specified with `COLOR SPRITE()` or `COLOR SPRITE$()` will be used.
67
+
68
+ `<PatternNumber>` is the pattern number in the sprites table. This number is between 0 and 255 for a 8x8 sprite, between 0 and 63 for a 16x16 sprite.
69
+
70
+ If `<PatternNumber>` is not specified it is equal to `<SpriteNumber>`.
71
+
72
+ ## Examples
73
+
74
+ ```basic
75
+ 10 SCREEN5
76
+ 15 ON SPRITE GOSUB 80: SPRITE ON 'Enable colision for all sprites
77
+ 20 SPRITE$(0)=STRING$(8,255)
78
+ 30 PUTSPRITE 0,(50,50),10,0
79
+ 40 PUTSPRITE 1,(54,54),38,0 ' 38 is color 6 + &B0100000 to disable collision for sprite 1
80
+ 50 IF NOT STRIG(0) GOTO 50 'Press Space to enable OR operator
81
+ 60 COLOR SPRITE(1)=79 ' 79 is color 15 + &B1000000 to enable OR operation
82
+ 70 GOTO 70
83
+ 80 SCREEN 0: PRINT"Sprite collision OK": BEEP: END
84
+ ```
85
+
86
+ ```basic
87
+ 5 ' Program to show all colors in screen 8
88
+ 10 SCREEN 8,0:COLOR 255,0: CLS
89
+ 20 SPRITE$(0)=STRING$(8,CHR$(255)) ' Defines pattern
90
+ 30 FOR C=0 TO 15
91
+ 40 PUTSPRITE C,(16,C*8),C,0 ' The sprites at left
92
+ 50 NEXT:C=0
93
+ 60 FOR X=32 TO 152 STEP 8
94
+ 70 FOR Y=1 TO 128 STEP 8
95
+ 80 LINE(X,Y)-STEP(7,7),C,BF: C=C+1 ' The squares at right
96
+ 90 NEXT: NEXT
97
+ 100 IF NOT STRIG(0) GOTO100
98
+ ```
99
+
100
+ ```basic
101
+ 10 ' Program like the drawing toy Etch A Sketch
102
+ 20 COLOR 11,11,6: SCREEN 5,1
103
+ 30 FOR I=1 TO 8
104
+ 40 READ L: A$=A$+CHR$(L): READ L: B$=B$+CHR$(L)
105
+ 50 NEXT
106
+ 60 SPRITE$(0)=A$: SPRITE$(1)=B$
107
+ 70 COLOR SPRITE(0)=1 ' Black
108
+ 80 COLOR SPRITE(1)=78 ' 14 (Gray)+&B100000 for set bit 6
109
+ 90 PUTSPRITE 0,(X,Y): PUTSPRITE 1,STEP(0,0): PSET STEP(0,1)
110
+ 100 IF STRIG(0) THEN COLOR 1: VDP(1)=VDP(1) AND 254 ' Sprite size normal
111
+ 110 IF NOT PEEK(&HFBED) AND 32 THEN Y=Y+(Y>-1)
112
+ 120 IF NOT PEEK(&HFBED) AND 128 THEN X=X-(X<255)
113
+ 130 IF NOT PEEK(&HFBED) AND 64 THEN Y=Y-(Y<210)
114
+ 140 IF NOT PEEK(&HFBED) AND 16 THEN X=X+(X>0)
115
+ 150 IF NOT PEEK(&HFBED) AND 2 THEN CLS: COLOR 11: VDP(1)=VDP(1)OR 1 ' Sprite size doubled
116
+ 160 GOTO 90
117
+ 170 ' Sprite patterns
118
+ 180 DATA &B01111100,&B00000000 ' in decimal: 124,0
119
+ 190 DATA &B11111100,&B01111000 ' in decimal: 252,120
120
+ 200 DATA &B10111000,&B01110000 ' in decimal: 184,112
121
+ 210 DATA &B10011100,&B01111000 ' in decimal: 156,120
122
+ 220 DATA &B10101110,&B01011100 ' in decimal: 174,92
123
+ 230 DATA &B11010111,&B00001110 ' in decimal: 215,14
124
+ 240 DATA &B00001010,&B00000100 ' in decimal: 10,4
125
+ 250 DATA &B00000100,&B00000000 ' in decimal: 4,0
126
+ 260 ' Notes:
127
+ 270 ' Only two sprites are used to make three colors! (1 or 14 = 15)
128
+ 280 ' PEEK(&HFBED) is to read the keyboard matrix (See system variables)
129
+ 290 ' Press Space key to switch to tracing mode, and CLS key to erase the screen
130
+ 300 ' The sprites are badly displayed on some emulators
131
+ ```
132
+
133
+ ## Related to
134
+
135
+ `COLOR SPRITE()`, `COLOR SPRITE$()`, `ON SPRITE GOSUB`, `SPRITE`, `SPRITE$()`
136
+
137
+ ## Compatibility
138
+
139
+ MSX-BASIC 1.0 or higher
140
+
141
+ ## Source
142
+
143
+ Retrieved from "https://www.msx.org/wiki/PUT_SPRITE"
@@ -0,0 +1,45 @@
1
+ # READ
2
+
3
+ ## Effect
4
+
5
+ Returns next value(s) that has been stored in the program source by using `DATA` instructions.
6
+
7
+ ## Syntax
8
+
9
+ `READ <Variable>,<Variable>...`
10
+
11
+ _Note: Parameters can not end with a comma alone._
12
+
13
+ ## Parameter
14
+
15
+ `<Variable>` is a variable that matches with the datatype stored in `DATA` instruction.
16
+
17
+ After `READ` instruction is executed the data pointer will automatically move to next item. Data pointer can be moved manually by using `RESTORE` instruction.
18
+
19
+ ## Example
20
+
21
+ ```basic
22
+ 10 READ A$
23
+ 20 PRINT A$
24
+ 30 READ A,B
25
+ 40 PRINT A
26
+ 50 PRINT B
27
+ 60 DATA "TEST",10,20
28
+  
29
+ RUN
30
+ TEST
31
+ 10
32
+ 20
33
+ ```
34
+
35
+ ## Related to
36
+
37
+ `DATA`, `DIM`, `RESTORE`
38
+
39
+ ## Compatibility
40
+
41
+ MSX-BASIC 1.0 or higher
42
+
43
+ ## Source
44
+
45
+ Retrieved from "https://www.msx.org/wiki/READ"
@@ -0,0 +1,42 @@
1
+ # REM
2
+
3
+ ## Effect
4
+
5
+ Adds remarks to the source code. Everything after `REM` until end of line will be stored as text and will not affect the program execution.
6
+
7
+ _Notes:_
8
+ - There is also 1-letter short version of this instruction: `'`, but it takes more space in RAM (3 bytes) instead of `REM` (only one byte).
9
+ - `REM` can also be replaced by `ELSE` (in this case, the compressed BASIC instructions after `ELSE` will take less place in RAM than with `REM`).
10
+
11
+ ## Syntaxes
12
+
13
+ `REM <TextString>`
14
+
15
+ `' <TextString>`
16
+
17
+ ## Parameter
18
+
19
+ `<TextString>` can be any text. It is optional, so you can have lines with only `REM` or `'`, just to give more clarity to your program.
20
+
21
+ If short version is used ":" is generally not mandatory when used in same line with other instructions. However, you need to use it if you get an error message when executing your program (it can happen when your remark follows a `CALL` instruction).
22
+
23
+ Unlike with `?` and `PRINT` the short version is not expanded to long version when listing the MSX-BASIC program.
24
+
25
+ ## Example
26
+
27
+ ```basic
28
+ 10 CLS:REM I will store this program with NAME "EXAMPLE.BAS"
29
+ 20 PRINT "HELLO WORLD!" ' End of program.
30
+ ```
31
+
32
+ ## Related to
33
+
34
+ `ELSE`
35
+
36
+ ## Compatibility
37
+
38
+ MSX-BASIC 1.0 or higher
39
+
40
+ ## Source
41
+
42
+ Retrieved from "https://www.msx.org/wiki/REM"