@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.
- package/README.md +37 -12
- package/dist/server.js +198 -69
- package/dist/utils.js +54 -7
- package/dist/vectordb.js +60 -0
- package/package.json +10 -3
- package/resources/audio/MGSC111.txt +669 -0
- package/resources/audio/msx-midi.md +872 -0
- package/resources/audio/opl4tech.txt +688 -0
- package/resources/audio/psg_registers.md +281 -0
- package/resources/audio/sound_cartridge_scc.md +123 -0
- package/resources/audio/sound_cartridge_scci.md +250 -0
- package/resources/audio/toc.json +18 -7
- package/resources/book--msx2-technical-handbook/toc.json +1 -1
- package/resources/msx-unapi/toc.json +2 -2
- package/resources/processors/toc.json +4 -4
- package/resources/processors/z80_detailed_instruction_set.md +80 -68
- package/resources/programming/basic_wiki/ABS().md +36 -0
- package/resources/programming/basic_wiki/AND.md +71 -0
- package/resources/programming/basic_wiki/ASC().md +38 -0
- package/resources/programming/basic_wiki/ATN().md +36 -0
- package/resources/programming/basic_wiki/AUTO.md +39 -0
- package/resources/programming/basic_wiki/BASE().md +147 -0
- package/resources/programming/basic_wiki/BEEP.md +27 -0
- package/resources/programming/basic_wiki/BIN$().md +36 -0
- package/resources/programming/basic_wiki/BLOAD.md +63 -0
- package/resources/programming/basic_wiki/BSAVE.md +61 -0
- package/resources/programming/basic_wiki/CALL.md +391 -0
- package/resources/programming/basic_wiki/CALL_ADJUST.md +40 -0
- package/resources/programming/basic_wiki/CALL_IMPOSE.md +28 -0
- package/resources/programming/basic_wiki/CALL_OPTIONS.md +26 -0
- package/resources/programming/basic_wiki/CALL_PAUSE.md +119 -0
- package/resources/programming/basic_wiki/CALL_PCMPLAY.md +60 -0
- package/resources/programming/basic_wiki/CALL_PCMREC.md +70 -0
- package/resources/programming/basic_wiki/CDBL().md +36 -0
- package/resources/programming/basic_wiki/CHR$().md +51 -0
- package/resources/programming/basic_wiki/CINT().md +36 -0
- package/resources/programming/basic_wiki/CIRCLE.md +51 -0
- package/resources/programming/basic_wiki/CLEAR.md +39 -0
- package/resources/programming/basic_wiki/CLOAD.md +27 -0
- package/resources/programming/basic_wiki/CLOAD?.md +31 -0
- package/resources/programming/basic_wiki/CLOSE.md +44 -0
- package/resources/programming/basic_wiki/CLS.md +51 -0
- package/resources/programming/basic_wiki/COLOR.md +143 -0
- package/resources/programming/basic_wiki/COLOR=.md +93 -0
- package/resources/programming/basic_wiki/COLOR_SPRITE$().md +83 -0
- package/resources/programming/basic_wiki/COLOR_SPRITE().md +85 -0
- package/resources/programming/basic_wiki/CONT.md +23 -0
- package/resources/programming/basic_wiki/COPY.md +215 -0
- package/resources/programming/basic_wiki/COPY_SCREEN.md +61 -0
- package/resources/programming/basic_wiki/COS().md +37 -0
- package/resources/programming/basic_wiki/CSAVE.md +35 -0
- package/resources/programming/basic_wiki/CSNG().md +36 -0
- package/resources/programming/basic_wiki/CSRLIN.md +33 -0
- package/resources/programming/basic_wiki/DATA.md +47 -0
- package/resources/programming/basic_wiki/DEFDBL.md +40 -0
- package/resources/programming/basic_wiki/DEFINT.md +40 -0
- package/resources/programming/basic_wiki/DEFSNG.md +40 -0
- package/resources/programming/basic_wiki/DEFSTR.md +40 -0
- package/resources/programming/basic_wiki/DEF_FN.md +49 -0
- package/resources/programming/basic_wiki/DEF_USR.md +33 -0
- package/resources/programming/basic_wiki/DELETE.md +49 -0
- package/resources/programming/basic_wiki/DIM.md +59 -0
- package/resources/programming/basic_wiki/DRAW.md +77 -0
- package/resources/programming/basic_wiki/ELSE.md +45 -0
- package/resources/programming/basic_wiki/END.md +32 -0
- package/resources/programming/basic_wiki/EOF().md +36 -0
- package/resources/programming/basic_wiki/EQV.md +76 -0
- package/resources/programming/basic_wiki/ERASE.md +35 -0
- package/resources/programming/basic_wiki/ERL.md +34 -0
- package/resources/programming/basic_wiki/ERR.md +143 -0
- package/resources/programming/basic_wiki/ERROR.md +145 -0
- package/resources/programming/basic_wiki/EXP().md +38 -0
- package/resources/programming/basic_wiki/FIELD.md +48 -0
- package/resources/programming/basic_wiki/FIX().md +44 -0
- package/resources/programming/basic_wiki/FN.md +61 -0
- package/resources/programming/basic_wiki/FOR...NEXT.md +80 -0
- package/resources/programming/basic_wiki/FRE().md +66 -0
- package/resources/programming/basic_wiki/GET_DATE.md +60 -0
- package/resources/programming/basic_wiki/GET_TIME.md +34 -0
- package/resources/programming/basic_wiki/GOSUB.md +41 -0
- package/resources/programming/basic_wiki/GOTO.md +41 -0
- package/resources/programming/basic_wiki/HEX$().md +36 -0
- package/resources/programming/basic_wiki/IF...GOTO...ELSE.md +55 -0
- package/resources/programming/basic_wiki/IF...THEN...ELSE.md +50 -0
- package/resources/programming/basic_wiki/IMP.md +83 -0
- package/resources/programming/basic_wiki/INKEY$.md +65 -0
- package/resources/programming/basic_wiki/INP().md +33 -0
- package/resources/programming/basic_wiki/INPUT$().md +51 -0
- package/resources/programming/basic_wiki/INPUT.md +93 -0
- package/resources/programming/basic_wiki/INSTR().md +44 -0
- package/resources/programming/basic_wiki/INT().md +44 -0
- package/resources/programming/basic_wiki/INTERVAL.md +57 -0
- package/resources/programming/basic_wiki/KEY().md +51 -0
- package/resources/programming/basic_wiki/KEY.md +254 -0
- package/resources/programming/basic_wiki/LEFT$().md +39 -0
- package/resources/programming/basic_wiki/LEN().md +36 -0
- package/resources/programming/basic_wiki/LET.md +68 -0
- package/resources/programming/basic_wiki/LINE.md +74 -0
- package/resources/programming/basic_wiki/LINE_INPUT.md +79 -0
- package/resources/programming/basic_wiki/LIST.md +58 -0
- package/resources/programming/basic_wiki/LLIST.md +43 -0
- package/resources/programming/basic_wiki/LOAD.md +56 -0
- package/resources/programming/basic_wiki/LOCATE.md +67 -0
- package/resources/programming/basic_wiki/LOG().md +36 -0
- package/resources/programming/basic_wiki/LPOS().md +31 -0
- package/resources/programming/basic_wiki/LPRINT.md +46 -0
- package/resources/programming/basic_wiki/MAXFILES.md +39 -0
- package/resources/programming/basic_wiki/MERGE.md +54 -0
- package/resources/programming/basic_wiki/MID$().md +72 -0
- package/resources/programming/basic_wiki/MOD.md +39 -0
- package/resources/programming/basic_wiki/MOTOR.md +46 -0
- package/resources/programming/basic_wiki/NEW.md +27 -0
- package/resources/programming/basic_wiki/NOT.md +61 -0
- package/resources/programming/basic_wiki/OCT$().md +36 -0
- package/resources/programming/basic_wiki/ON...GOSUB.md +45 -0
- package/resources/programming/basic_wiki/ON...GOTO.md +42 -0
- package/resources/programming/basic_wiki/ON_ERROR_GOTO.md +61 -0
- package/resources/programming/basic_wiki/ON_INTERVAL_GOSUB.md +54 -0
- package/resources/programming/basic_wiki/ON_KEY_GOSUB.md +56 -0
- package/resources/programming/basic_wiki/ON_SPRITE_GOSUB.md +41 -0
- package/resources/programming/basic_wiki/ON_STOP_GOSUB.md +56 -0
- package/resources/programming/basic_wiki/ON_STRIG_GOSUB.md +70 -0
- package/resources/programming/basic_wiki/OPEN.md +103 -0
- package/resources/programming/basic_wiki/OR.md +75 -0
- package/resources/programming/basic_wiki/OUT.md +35 -0
- package/resources/programming/basic_wiki/PAD().md +110 -0
- package/resources/programming/basic_wiki/PAINT.md +66 -0
- package/resources/programming/basic_wiki/PDL().md +53 -0
- package/resources/programming/basic_wiki/PEEK().md +44 -0
- package/resources/programming/basic_wiki/PLAY().md +58 -0
- package/resources/programming/basic_wiki/PLAY.md +196 -0
- package/resources/programming/basic_wiki/POINT.md +52 -0
- package/resources/programming/basic_wiki/POKE.md +51 -0
- package/resources/programming/basic_wiki/POS().md +36 -0
- package/resources/programming/basic_wiki/PRESET.md +61 -0
- package/resources/programming/basic_wiki/PRINT.md +179 -0
- package/resources/programming/basic_wiki/PSET.md +82 -0
- package/resources/programming/basic_wiki/PUT_KANJI.md +93 -0
- package/resources/programming/basic_wiki/PUT_SPRITE.md +143 -0
- package/resources/programming/basic_wiki/READ.md +45 -0
- package/resources/programming/basic_wiki/REM.md +42 -0
- package/resources/programming/basic_wiki/RENUM.md +78 -0
- package/resources/programming/basic_wiki/RESTORE.md +52 -0
- package/resources/programming/basic_wiki/RESUME.md +45 -0
- package/resources/programming/basic_wiki/RETURN.md +47 -0
- package/resources/programming/basic_wiki/RIGHT$().md +39 -0
- package/resources/programming/basic_wiki/RND().md +51 -0
- package/resources/programming/basic_wiki/RUN.md +56 -0
- package/resources/programming/basic_wiki/SAVE.md +65 -0
- package/resources/programming/basic_wiki/SCREEN.md +164 -0
- package/resources/programming/basic_wiki/SET_ADJUST.md +66 -0
- package/resources/programming/basic_wiki/SET_BEEP.md +76 -0
- package/resources/programming/basic_wiki/SET_DATE.md +103 -0
- package/resources/programming/basic_wiki/SET_PAGE.md +52 -0
- package/resources/programming/basic_wiki/SET_PASSWORD.md +75 -0
- package/resources/programming/basic_wiki/SET_PROMPT.md +61 -0
- package/resources/programming/basic_wiki/SET_SCREEN.md +100 -0
- package/resources/programming/basic_wiki/SET_SCROLL.md +55 -0
- package/resources/programming/basic_wiki/SET_TIME.md +83 -0
- package/resources/programming/basic_wiki/SET_TITLE.md +87 -0
- package/resources/programming/basic_wiki/SET_VIDEO.md +49 -0
- package/resources/programming/basic_wiki/SGN().md +38 -0
- package/resources/programming/basic_wiki/SIN().md +36 -0
- package/resources/programming/basic_wiki/SOUND.md +188 -0
- package/resources/programming/basic_wiki/SPACE$().md +38 -0
- package/resources/programming/basic_wiki/SPC().md +34 -0
- package/resources/programming/basic_wiki/SPRITE$().md +50 -0
- package/resources/programming/basic_wiki/SPRITE.md +31 -0
- package/resources/programming/basic_wiki/SQR().md +32 -0
- package/resources/programming/basic_wiki/STICK().md +70 -0
- package/resources/programming/basic_wiki/STOP.md +70 -0
- package/resources/programming/basic_wiki/STR$().md +37 -0
- package/resources/programming/basic_wiki/STRIG().md +82 -0
- package/resources/programming/basic_wiki/STRING$().md +42 -0
- package/resources/programming/basic_wiki/SWAP.md +62 -0
- package/resources/programming/basic_wiki/TAB().md +38 -0
- package/resources/programming/basic_wiki/TAN().md +36 -0
- package/resources/programming/basic_wiki/TIME.md +59 -0
- package/resources/programming/basic_wiki/TROFF.md +21 -0
- package/resources/programming/basic_wiki/TRON.md +39 -0
- package/resources/programming/basic_wiki/USR().md +66 -0
- package/resources/programming/basic_wiki/VAL().md +36 -0
- package/resources/programming/basic_wiki/VARPTR().md +50 -0
- package/resources/programming/basic_wiki/VDP().md +103 -0
- package/resources/programming/basic_wiki/VPEEK().md +46 -0
- package/resources/programming/basic_wiki/VPOKE.md +48 -0
- package/resources/programming/basic_wiki/WAIT.md +38 -0
- package/resources/programming/basic_wiki/WIDTH.md +76 -0
- package/resources/programming/basic_wiki/XOR.md +72 -0
- package/resources/programming/basic_wiki/_toc.json +871 -0
- package/resources/sdcc/sdccman.lyx +81574 -0
- package/resources/sdcc/toc.json +77 -0
- package/vector-db/index.json +1 -0
- /package/resources/msx-unapi/{Ethernet_UNAPI_specification_1.1.md → Ethernet_UNAPI_specification_1_1.md} +0 -0
- /package/resources/msx-unapi/{MSX_UNAPI_specification_1.1.md → MSX_UNAPI_specification_1_1.md} +0 -0
- /package/resources/processors/{Z80_R800_instruction_set.md → z80_r800_instruction_set.md} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# CALL PCMREC
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Records a PCM audio file by using the built-in microphone of the _MSX turbo R_ computers. It can be done to computer RAM, computer VRAM or an array.
|
|
6
|
+
|
|
7
|
+
If the computer mode is _Z80_ mode, the mode is automatically switched to the _R800_ mode before the execution, and after finishing the _Z80_ mode is restored.
|
|
8
|
+
|
|
9
|
+
If the _STOP_ key is pushed during the recording, the program execution is quit and returns to BASIC.
|
|
10
|
+
|
|
11
|
+
## Syntaxes
|
|
12
|
+
|
|
13
|
+
`CALL PCMREC(@<StartAddress>, <EndAddress>, <SamplingFrequency>,<TriggerLevel>,<CompressionSwitch>,S)`
|
|
14
|
+
|
|
15
|
+
The three last parameters are optional. Parameters can not end with a comma alone.
|
|
16
|
+
|
|
17
|
+
`CALL PCMREC(<Array>,<Length>,<SamplingFrequency>,<TriggerLevel>,<CompressionSwitch>])`
|
|
18
|
+
|
|
19
|
+
`<Length>` and the two last parameters are optional. Parameters can not end with a comma alone.
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
`<StartAddress>` and `<EndAddress>` are used to specify the area of the computer RAM (or VRAM). The `<start address>` needs always to be preceded by `@`.
|
|
24
|
+
|
|
25
|
+
`<SamplingFrequency>` is a number between 0 and 3 to choose one of the four available sampling frequencies:
|
|
26
|
+
```
|
|
27
|
+
0 = 15.75 KHz
|
|
28
|
+
1 = 7.875 KHz
|
|
29
|
+
2 = 5.25 KHz
|
|
30
|
+
3 = 3.9375 KHz
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you specify the sampling rate to 15.75 KHz under `Z80` mode or `R800` ROM mode, you get _"Illegal function call"_ error message.
|
|
34
|
+
|
|
35
|
+
`<TriggerLevel>` is a number between 0 and 127 to specify the required input level to start the recording. If this is omitted or is 0, the recording is started immediately.
|
|
36
|
+
|
|
37
|
+
`<CompressionSwitch>` allows to enable or disable the silent data compression: data format is absolutely binary and 1 to 255 is normal data. When two or more data near the 0 level (126 to 128) are consecutive, the data can be compressed by recording a 0 and count of the consecutive data.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
0 (default value) = no silent data compression
|
|
41
|
+
1 = silent data compression
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The parameter `S` is used to record to VRAM instead of RAM - This can be done in any screen mode but only the active pages are valid when the screen mode is higher than 4.
|
|
45
|
+
|
|
46
|
+
`<Array>` must be a numeric type variable array.
|
|
47
|
+
|
|
48
|
+
`<Length>` can generally be omitted. When specified, the recording to an array will be stopped when this length is reached.
|
|
49
|
+
|
|
50
|
+
_Note: To save the PCM audio file to disk, you need to use `BSAVE` when you have recorded it to computer RAM or VRAM, or COPY when you have recorded it to an array._
|
|
51
|
+
|
|
52
|
+
## Example
|
|
53
|
+
|
|
54
|
+
```basic
|
|
55
|
+
10 CLEAR 300,&HB000
|
|
56
|
+
20 CALL PCMREC(@&HB000,&HDFFF,1,32,1)
|
|
57
|
+
30 BSAVE"PCMTEST.BIN",&HB000,&HDFFF
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Related to
|
|
61
|
+
|
|
62
|
+
`BSAVE`, `CALL PCMPLAY`, `COPY`
|
|
63
|
+
|
|
64
|
+
## Compatibility
|
|
65
|
+
|
|
66
|
+
MSX-BASIC 4.0 or higher
|
|
67
|
+
|
|
68
|
+
## Source
|
|
69
|
+
|
|
70
|
+
Retrieved from "https://www.msx.org/wiki/CALL_PCMREC"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# CDBL()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Converts a integer or single precision value to a double precision value. Double precision numbers have an accuracy of 14 digits. This function exists for compatibility reasons only and has no practical benefits in MSX environment.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CDBL(<Value>)`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`<Value>` can be a value, a numeric variable or an mathematical expression.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```basic
|
|
18
|
+
10 PRINT "7 divided by 6 is ";CDBL(7/6)
|
|
19
|
+
20 PRINT "10 divided by 11 ";CDBL(10/11)
|
|
20
|
+
|
|
21
|
+
RUN
|
|
22
|
+
7 divided by 6 is 1.1666666666667
|
|
23
|
+
10 divided by 11 is .90909090909091
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Related to
|
|
27
|
+
|
|
28
|
+
`CINT`, `CSNG`
|
|
29
|
+
|
|
30
|
+
## Compatibility
|
|
31
|
+
|
|
32
|
+
MSX-BASIC 1.0 or higher
|
|
33
|
+
|
|
34
|
+
## Source
|
|
35
|
+
|
|
36
|
+
Retrieved from "https://www.msx.org/wiki/CDBL()"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# CHR$()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Converts a value to the corresponding MSX character.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CHR$(<CodeNumber>)`
|
|
10
|
+
|
|
11
|
+
_Notes:_
|
|
12
|
+
- Used in instruction `PRINT` you can display 32 extended graphic characters by adding `CHR$(1)` before the character with a code number between 64 and 95. (see example below for use and see this page for details of codes).
|
|
13
|
+
- It can be combined with `INKEY$` to detect if a specific key has been pressed; it's useful not only for the alphanumeric keys, but also the special keys.
|
|
14
|
+
|
|
15
|
+
## Parameter
|
|
16
|
+
|
|
17
|
+
`<CodeNumber>` is the code number of a character between 0 and 255. (See this page about codes description).
|
|
18
|
+
|
|
19
|
+
According the localisation of the used MSX computer or the used mode on Arabic machines, the results can vary.
|
|
20
|
+
|
|
21
|
+
_Note: In Kanji modes, this instruction is limited to the characters 33 to 128, 161 to 223, 253 and 254, and the character displayed for `CHR$(128)`, `CHR$(253)` and `CHR$(254)` is not correct in Kanji modes 0 and 2 (bug in Kanji BASIC?)_
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
```basic
|
|
26
|
+
10 PRINT "The character with ASCII code 67 is ";CHR$(67)
|
|
27
|
+
20 PRINT "I like ";CHR$(77);CHR$(83);CHR$(88)
|
|
28
|
+
|
|
29
|
+
RUN
|
|
30
|
+
The character with ASCII code 67 is B
|
|
31
|
+
I like MSX
|
|
32
|
+
```
|
|
33
|
+
```basic
|
|
34
|
+
5 'How to print an extended graphic character
|
|
35
|
+
10 PRINT CHR$(1);CHR$(65);
|
|
36
|
+
20 PRINT CHR$(1)+CHR$(66)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The printed character will be a smiling face on European machines and a kana on Japanese machines.
|
|
40
|
+
|
|
41
|
+
## Related to
|
|
42
|
+
|
|
43
|
+
`ASC()`, `INKEY$`, `PRINT`, `STRING$()`
|
|
44
|
+
|
|
45
|
+
## Compatibility
|
|
46
|
+
|
|
47
|
+
MSX-BASIC 1.0 or higher
|
|
48
|
+
|
|
49
|
+
## Source
|
|
50
|
+
|
|
51
|
+
Retrieved from "https://www.msx.org/wiki/CHR$()"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# CINT()
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Converts a value to an integer number by truncating the numbers after the decimal point.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CINT(<Value>)`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`<Value>` must be an expression, a numeric variable or a value between -32768 and 32767. Digits after the decimal point will be simply ignored.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```basic
|
|
18
|
+
10 PRINT "1.23 converted to integer is ";CINT(1.23)
|
|
19
|
+
20 PRINT "1.99 converted to integer is ";CINT(1.99)
|
|
20
|
+
|
|
21
|
+
RUN
|
|
22
|
+
1.23 converted to integer is 1
|
|
23
|
+
1.99 converted to integer is 1
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Related to
|
|
27
|
+
|
|
28
|
+
`CDBL`, `CSNG`, `FIX`, `INT`
|
|
29
|
+
|
|
30
|
+
## Compatibility
|
|
31
|
+
|
|
32
|
+
MSX-BASIC 1.0 or higher
|
|
33
|
+
|
|
34
|
+
## Source
|
|
35
|
+
|
|
36
|
+
Retrieved from "https://www.msx.org/wiki/CINT()"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# CIRCLE
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Draws a circle, arc or ellipse on a graphic screen (2 to 8, 10 to 12).
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CIRCLE STEP(<X>,<Y>),<Radius>,<Color>,<TracingStart>,<TracingEnd>,<Aspect>`
|
|
10
|
+
|
|
11
|
+
_Note: Do not put a comma if no parameters are behind._
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
`<X>` is coordinate X of the centre of the circle (0-255/511).
|
|
16
|
+
|
|
17
|
+
`<Y>` is coordinate Y of the centre of the circle (0-191/211).
|
|
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
|
+
`<Radius>` is the radius of the biggest main axis.
|
|
24
|
+
|
|
25
|
+
`<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, 12). If `<Color>` is not specified the current foreground color is used.
|
|
26
|
+
|
|
27
|
+
`<TracingStart>` and `<TracingEnd>` are used to draw a partial circle. These values must be between 0 and 2π. By default, the tracing starts at 0 (the point at the extreme left of the circle) and the tracing ends at 2π (by turning clockwise). Using negative value will cause line to be drawn from end of arch to midpoint.
|
|
28
|
+
|
|
29
|
+
`<Aspect>` is used to define the ratio between the horizontal and vertical radius. The results of "aspect ratio" will be different depending on your screens refresh frequency, 50 Hz (PAL) or 60 Hz (NTSC). This difference is generally not supported in the emulators.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```basic
|
|
34
|
+
10 SCREEN 2
|
|
35
|
+
20 CIRCLE (127,95),50,,,,1.4
|
|
36
|
+
30 GOTO 30
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
It will draw a circle on a 50 Hz computer and an ellipse on a 60 Hz computer.
|
|
40
|
+
|
|
41
|
+
## Related to
|
|
42
|
+
|
|
43
|
+
`CLS`, `COLOR`, `DRAW`, `LINE`, `PAINT`, `POINT`, `PRESET`, `PSET`, `SCREEN`
|
|
44
|
+
|
|
45
|
+
## Compatibility
|
|
46
|
+
|
|
47
|
+
MSX-BASIC 1.0 or higher
|
|
48
|
+
|
|
49
|
+
## Source
|
|
50
|
+
|
|
51
|
+
Retrieved from "https://www.msx.org/wiki/CIRCLE"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# CLEAR
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Clears the contents of all variables, including functions defined with `DEF FN`, and all dimensions of arrays, sets all numeric variables to zero, all strings to null, closes all open files, and frees up memory.
|
|
6
|
+
|
|
7
|
+
Optionally reserves a specified number of bytes for storing string variables in a program and/or defines the highest memory location that may be used by MSX-BASIC.
|
|
8
|
+
|
|
9
|
+
After execution, you can check the result of the first parameter with `PRINT FRE("")` and the new available free space memory for MSX-BASIC with `PRINT FRE(0)`.
|
|
10
|
+
|
|
11
|
+
## Syntax
|
|
12
|
+
|
|
13
|
+
`CLEAR <StringsArea>,<UpperAddress>`
|
|
14
|
+
|
|
15
|
+
_Note: Parameters can not end with a comma alone._
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
`<StringsArea>` is the amount of bytes to be reserved for storing string variables. (200 by default).
|
|
20
|
+
|
|
21
|
+
`<UpperAddress>` is the highest memory location that may be used by MSX-BASIC. This address can vary between 831Fh and F380h. It is stored into variable system `HIMEM` (FC4Ah).
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
`CLEAR 300, &HC000`
|
|
26
|
+
|
|
27
|
+
**PLEASE NOTE:** MSX1 has a bug that allows string space to be exceeded by a byte. This problem can be fixed by adding another `CLEAR` instruction without parameters after the actual `CLEAR` instruction.
|
|
28
|
+
|
|
29
|
+
## Related to
|
|
30
|
+
|
|
31
|
+
`DEF FN`, `DIM`, `END`, `ERASE`, `FN`, `FRE`, `MAXFILES`, `NEW`
|
|
32
|
+
|
|
33
|
+
## Compatibility
|
|
34
|
+
|
|
35
|
+
MSX-BASIC 1.0 or higher
|
|
36
|
+
|
|
37
|
+
## Source
|
|
38
|
+
|
|
39
|
+
Retrieved from "https://www.msx.org/wiki/CLEAR"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# CLOAD
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Loads a BASIC program from cassette if this program has been saved in tokenized mode with `CSAVE`.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CLOAD "<Filename>"`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`"<Filename>"` is the name of the BASIC program to be loaded. When not specified, `CLOAD` will load the first or next BASIC program in tokenized mode found on tape. `"<Filename>"` can be replaced by a alphanumeric variable containing the name.
|
|
14
|
+
|
|
15
|
+
The format of file name is case sensitive and limited to 6 characters without extension.
|
|
16
|
+
|
|
17
|
+
## Related to
|
|
18
|
+
|
|
19
|
+
`CLOAD?`, `CSAVE`, `LOAD`, `RUN`, `SAVE`
|
|
20
|
+
|
|
21
|
+
## Compatibility
|
|
22
|
+
|
|
23
|
+
MSX-BASIC versions before 4.0
|
|
24
|
+
|
|
25
|
+
## Source
|
|
26
|
+
|
|
27
|
+
Retrieved from "https://www.msx.org/wiki/CLOAD"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# CLOAD?
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Verifies whether or not a BASIC file has been successfully saved to cassette with `CSAVE` in tokenized format. This instruction compares the program in memory with the program on tape and searches for differences.
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CLOAD?["<Filename>"]`
|
|
10
|
+
|
|
11
|
+
## Parameter
|
|
12
|
+
|
|
13
|
+
`"<Filename>"` is the specific name of the BASIC program to be verified. When not specified, `CLOAD?` will verify the first or next BASIC program in tokenized mode found on tape.
|
|
14
|
+
|
|
15
|
+
The format of file name is case sensitive and limited to 6 characters without extension.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
`CLOAD?("test")`
|
|
20
|
+
|
|
21
|
+
## Related to
|
|
22
|
+
|
|
23
|
+
`CLOAD`, `CSAVE`
|
|
24
|
+
|
|
25
|
+
## Compatibility
|
|
26
|
+
|
|
27
|
+
MSX-BASIC versions before 4.0
|
|
28
|
+
|
|
29
|
+
## Source
|
|
30
|
+
|
|
31
|
+
Retrieved from "https://www.msx.org/wiki/CLOAD%3F"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# CLOSE
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Closes one or more opened files and frees corresponding I/O buffer(s).
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
`CLOSE #<Number1>,#<Number2>...`
|
|
10
|
+
|
|
11
|
+
_Note: Parameters can not end with a comma alone._
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
`#` is optional and can be omitted.
|
|
16
|
+
|
|
17
|
+
`<Number1>`, `<Number2>`... correspond to the numbers assigned to the files opened with the `OPEN` instruction.
|
|
18
|
+
|
|
19
|
+
Without using parameters, all opened files are closed.
|
|
20
|
+
|
|
21
|
+
If it concerns a file opened on a linked computer, the `EOF` character is sent.
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
```basic
|
|
26
|
+
10 MAXFILES=2
|
|
27
|
+
20 OPEN "CAS:DEMO" FOR INPUT AS #1
|
|
28
|
+
30 OPEN "LPT:" FOR OUTPUT AS #2
|
|
29
|
+
40 INPUT #1,A$
|
|
30
|
+
50 PRINT #2,A$
|
|
31
|
+
60 CLOSE #1,#2
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Related to
|
|
35
|
+
|
|
36
|
+
`CLEAR`, `END`, `EOF`, `MAXFILES`, `OPEN`
|
|
37
|
+
|
|
38
|
+
## Compatibility
|
|
39
|
+
|
|
40
|
+
MSX-BASIC 1.0 or higher
|
|
41
|
+
|
|
42
|
+
## Source
|
|
43
|
+
|
|
44
|
+
Retrieved from "https://www.msx.org/wiki/CLOSE"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# CLS
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Clears the screen in any 'standard' screen mode with the last background color specified and resets the cursor coordinates for text.
|
|
6
|
+
|
|
7
|
+
When used with _Delta BASIC_, it can also clear the content of a window.
|
|
8
|
+
|
|
9
|
+
_Notes:_
|
|
10
|
+
- In text mode, the text of function keys displayed by `KEY ON` stays on screen.
|
|
11
|
+
- The sprites stay on screen as is.
|
|
12
|
+
- To clear the screen in `KANJI` text modes, you need to use `CALL CLS`. This command can also be useful in `SCREEN 9` when the screen is not correctly cleared with `CLS`.
|
|
13
|
+
|
|
14
|
+
## Syntaxes
|
|
15
|
+
|
|
16
|
+
`CLS`
|
|
17
|
+
|
|
18
|
+
`CLS #<WindowNumber>` (only with _Delta BASIC_) - As alternative, you can also use `FILL#<WindowNumber>,32`
|
|
19
|
+
|
|
20
|
+
## Parameter (Delta BASIC)
|
|
21
|
+
|
|
22
|
+
`<WindowNumber>` is a number between 1 and 9. It must always be preceded by `#` and correspond to a window previously defined with the `WINDOW` instruction.
|
|
23
|
+
|
|
24
|
+
## Example (Delta BASIC)
|
|
25
|
+
|
|
26
|
+
```basic
|
|
27
|
+
10 SCREEN0:KEYOFF:WIDTH40
|
|
28
|
+
20 WINDOW#1,1,1,38,3
|
|
29
|
+
30 WBOX#1
|
|
30
|
+
40 FILL#1,78
|
|
31
|
+
50 FOR I=1 TO 100: NEXT I
|
|
32
|
+
60 CLS#1
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`CLS#1` can be replaced by `FILL#1,32`
|
|
36
|
+
|
|
37
|
+
## Related to
|
|
38
|
+
|
|
39
|
+
Standard instruction: `CALL CLS`, `COLOR`, `KEY`, `SCREEN`
|
|
40
|
+
|
|
41
|
+
Delta BASIC: `FILL`, `WINDOW`
|
|
42
|
+
|
|
43
|
+
## Compatibility
|
|
44
|
+
|
|
45
|
+
MSX-BASIC 1.0 or higher
|
|
46
|
+
|
|
47
|
+
Delta BASIC
|
|
48
|
+
|
|
49
|
+
## Source
|
|
50
|
+
|
|
51
|
+
Retrieved from "https://www.msx.org/wiki/CLS"
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# COLOR
|
|
2
|
+
|
|
3
|
+
# Effect
|
|
4
|
+
|
|
5
|
+
Changes the color(s) to be used for the foreground, background and border.
|
|
6
|
+
|
|
7
|
+
_Notes:_
|
|
8
|
+
- If you use `COLOR` after `SCREEN`, you need to use `CLS` after `COLOR` on a graphic screen to initialize it with the new colors.
|
|
9
|
+
- For screens 0 to 5, 7, 9 and 10, it's useful to use `COLOR` before switching to the desired screen with `SCREEN`.
|
|
10
|
+
- For the Kanji text modes, it's useful to use `COLOR` before switching to the desired screen with `CALL KANJI`.
|
|
11
|
+
- For screen 6, using of the border colors 16 to 31 is only possible after the `SCREEN 6` instruction.
|
|
12
|
+
- For screens 8, 11, and 12, `COLOR` must be used after `SCREEN` when you want to use colors higher than 15.
|
|
13
|
+
- When all parameters are omitted on MSX2 or higher, the effect will be the same as `COLOR=NEW`, except in Kanji text mode. The color palette will be initialized.
|
|
14
|
+
|
|
15
|
+
## Syntax
|
|
16
|
+
|
|
17
|
+
`COLOR <ForegroundColor>,<BackgroundColor>,<BorderColor>`
|
|
18
|
+
|
|
19
|
+
_Notes:_
|
|
20
|
+
- It's possible to 'skip' a color by using just a comma. Each parameter is optional except the last specified. Do not put a comma after this parameter.
|
|
21
|
+
- `COLOR` without any parameter on MSX1 results to _"Missing parameter"_ error. On MSX2 and up it has same functionality as `COLOR=NEW` (see `COLOR=`).
|
|
22
|
+
|
|
23
|
+
## Parameters
|
|
24
|
+
|
|
25
|
+
`<ForegroundColor>` is the color used for the text or the drawing in graphic modes. This parameter can be omitted on MSX1 only if another parameter is placed behind it.
|
|
26
|
+
|
|
27
|
+
`<BackgroundColor>` is the color used for the background. By default in text screen modes, background of all screen changes. In graphic modes, the parameter seems to have not effect but it will be taken in account when returning to another screen mode.
|
|
28
|
+
|
|
29
|
+
`<BorderColor>` is the color used for the borders (top, bottom, left, right) of the screen. There are no borders in screen 0, so if you use this parameter in screen 0, it seems to have not effect but il will be taken in account when going to another screen mode.
|
|
30
|
+
|
|
31
|
+
Remarks about using of `COLOR` when you are in a Kanji text mode:
|
|
32
|
+
- the text displayed before the execution of `COLOR` does not switch to the new color specified as `<ForegroundColor>`.
|
|
33
|
+
- the background color displayed before the execution of `COLOR` does not change when specifying a new `<BackgroundColor>`, only the background of the new texts are changed, but the new color is also applied to he border color and the keylist (check it by pressing SHIFT!). Besides, the cursor will be displayed in another color, different from the foreground color, and that will vary depending on the general background color.
|
|
34
|
+
- if you specify a new `<BorderColor>`, it seems to have not effect but the new color will be taken in account when returning to another screen mode.
|
|
35
|
+
- to change the general background color, you need to enter `COLOR ,<BackgroundColor>: CALL CLS`.
|
|
36
|
+
|
|
37
|
+
Value of each color can vary and depends from the mode set with `SCREEN` or `CALL KANJI`/`CALL ANK`.
|
|
38
|
+
|
|
39
|
+
|SCREEN|COLOR|
|
|
40
|
+
|---|---|
|
|
41
|
+
|0-5|0 - 15|
|
|
42
|
+
|6<sup>(*)</sup>|0 - 31|
|
|
43
|
+
|7|0 - 15|
|
|
44
|
+
|8|0 - 255|
|
|
45
|
+
|9-10|0 - 15|
|
|
46
|
+
|11-12|0 - 255|
|
|
47
|
+
|KANJI0-3|0 - 15|
|
|
48
|
+
|
|
49
|
+
<sup>(*)</sup> See below for the specific working of `COLOR` in this screen.
|
|
50
|
+
|
|
51
|
+
The palette of colors 0 to 15 can be altered with the `COLOR=` instruction in all screen modes except screens 8, 11, 12. To alter MSX color palette in `KANJI` text modes, you need to use `CALL PALETTE`.
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
```basic
|
|
56
|
+
COLOR 1, 13, 5
|
|
57
|
+
```
|
|
58
|
+
```basic
|
|
59
|
+
COLOR 10
|
|
60
|
+
```
|
|
61
|
+
```basic
|
|
62
|
+
COLOR ,,13
|
|
63
|
+
```
|
|
64
|
+
```basic
|
|
65
|
+
10 SCREEN 8: COLOR 100,150,200
|
|
66
|
+
20 GOTO 20
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Specific working of COLOR in SCREEN 6
|
|
70
|
+
|
|
71
|
+
`SCREEN 6` uses only 4 colors (0-3). The default MSX palette for these colors is used if other palette is not defined. (See `COLOR=` command).
|
|
72
|
+
|
|
73
|
+
In case color number 0-15 is used, only bits 0 and 1 of VDP Control Register 7 will have effect, what implies these correspondances:
|
|
74
|
+
- color 0 = color 4 = color 8 = color 12
|
|
75
|
+
- color 1 = color 5 = color 9 = color 13
|
|
76
|
+
- color 2 = color 6 = color 10 = color 14
|
|
77
|
+
- color 3 = color 7 = color 11 = color 15
|
|
78
|
+
|
|
79
|
+
Border color in `SCREEN 6` has colors defined for odd and even pixels independently. This color encoding method is generated in order to implement high resolution sprites. When using `COLOR` command in `SCREEN 6` BASIC expects that you want to define both colors at a same time and uses bits 0 and 1 for color number.
|
|
80
|
+
|
|
81
|
+
This can be prevented by setting bit 4 of VDP Control Register 7 to 1 (using color values 16-31). In this case bits 0 and 1 will set color for odd pixels and bits 2 and 3 will set color for even pixels. Note also that bit 4 status is not stored and when screen mode changes the border color is not converted, but native 4 bit border color representation is always used as is.
|
|
82
|
+
|
|
83
|
+
## Specific working of COLOR in SCREEN 8
|
|
84
|
+
|
|
85
|
+
The colors in SCREEN 8 are fixed in a binary format &B11111111 where:
|
|
86
|
+
- the highest three bits are for R (red)
|
|
87
|
+
- the next three bits are for G (green)
|
|
88
|
+
- the lowest two bits are for B (blue)
|
|
89
|
+
|
|
90
|
+
Use this formula for the color code in decimal format:
|
|
91
|
+
```
|
|
92
|
+
Color code = 32 x (Green intensity) + 4 x (Red intensity) + (Blue intensity)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
with :
|
|
96
|
+
- Green intensity: an integer from 0 to 7
|
|
97
|
+
- Red intensity: an integer from 0 to 7
|
|
98
|
+
- Blue intensity: an integer from 0 to 3
|
|
99
|
+
|
|
100
|
+
## Default values
|
|
101
|
+
|
|
102
|
+
### SCREEN 0 to 5 and 7
|
|
103
|
+
|
|
104
|
+
|Machines|Foreground|Background|Border|
|
|
105
|
+
|---|:-:|:-:|:-:|
|
|
106
|
+
|Arabic MSX1 <sup>(*)</sup> booting in Arabic mode|15 - white|4 - dark blue|7 - sky blue|
|
|
107
|
+
|Arabic MSX1/2 booting in European mode|15 - white|4 - dark blue|4 - dark blue|
|
|
108
|
+
|Arabic Sakhr MSX2|15 - white|4 - dark blue|4 - dark blue <sup>(**)</sup>|
|
|
109
|
+
|Brazilian Ciel MSX2+|15 - white|4 - dark blue|7 - sky blue|
|
|
110
|
+
|Brazilian Gradiente MSX|15 - white|1 - black|1 - black|
|
|
111
|
+
|Brazilian Sharp MSX|15 - white|4 - dark blue|4 - dark blue|
|
|
112
|
+
|Daewoo CPC-300/300E MSX2|15 - white|4 - dark blue|7 - sky blue|
|
|
113
|
+
|Daewoo CPC-400/400S MSX2|15 - white|4 - dark blue|4 - dark blue|
|
|
114
|
+
|European and Russian MSX/MSX2|15 - white|4 - dark blue|4 - dark blue|
|
|
115
|
+
|Frael Bruc MSX|1 - black|13 - magenta|13 - magenta|
|
|
116
|
+
|Japanese MSX/MSX2/MSX2+/MSXturboR|15 - white|4 - dark blue|7 - sky blue|
|
|
117
|
+
|Korean MSX computers and MSX2 consoles|15 - white|4 - dark blue|7 - sky blue|
|
|
118
|
+
|Korean MSX consoles|15 - white|1 - black|1 - black|
|
|
119
|
+
|
|
120
|
+
<sup>(*)</sup> also Bawareth Perfect MSX2.
|
|
121
|
+
<sup>(**)</sup> "forced" to 7 when using `CALL DCOLOR`.
|
|
122
|
+
|
|
123
|
+
### KANJI text modes
|
|
124
|
+
|
|
125
|
+
When using the command `CALL KANJI`, the foreground and background colors of previously used mode (especially `SCREEN 0`, `SCREEN 1` and `SCREEN 9`) are directly transferred to the KANJI text mode and the background color is also used for the border.
|
|
126
|
+
|
|
127
|
+
### How to change the default values
|
|
128
|
+
|
|
129
|
+
On MSX2 and higher machines, you can change these default values by using first `COLOR`, then `SET SCREEN` to save the new parameters in the Real Time Clock (RTC). It is not possible to change the default values for the Japanese KANJI text modes.
|
|
130
|
+
|
|
131
|
+
If you use `SET SCREEN` when you are on `SCREEN 9`, the computer will display the MSX-BASIC screen after booting in `SCREEN 9` instead of `SCREEN 0` or `1`; the parameters of the other screens, especially `SCREEN 0` and `SCREEN 1`, will also be modified.
|
|
132
|
+
|
|
133
|
+
## Related to
|
|
134
|
+
|
|
135
|
+
`CALL CLS`, `CALL DCOLOR`, `CALL KANJI`, `CALL PALETTE`, `CLS`, `COLOR=`, `SCREEN`, `SET SCREEN`
|
|
136
|
+
|
|
137
|
+
# Compatibility
|
|
138
|
+
|
|
139
|
+
MSX-BASIC 1.0 or higher
|
|
140
|
+
|
|
141
|
+
## Source
|
|
142
|
+
|
|
143
|
+
Retrieved from "https://www.msx.org/wiki/COLOR"
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# COLOR=
|
|
2
|
+
|
|
3
|
+
## Effect
|
|
4
|
+
|
|
5
|
+
Alters MSX color palette, loads default color palette or restores color palette from VRAM. It can be used in all screen modes, but has no visual effect in `SCREEN 8`.
|
|
6
|
+
|
|
7
|
+
_Remark: To alter MSX color palette in KANJI text modes, you need to use `CALL PALETTE`._
|
|
8
|
+
|
|
9
|
+
## Syntaxes
|
|
10
|
+
|
|
11
|
+
`COLOR = (<Color>,<RedLuminance>,<GreenLuminance>,<BlueLuminance>)`
|
|
12
|
+
`COLOR = NEW`
|
|
13
|
+
`COLOR = RESTORE`
|
|
14
|
+
|
|
15
|
+
_Note: No parameter can be omitted._
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
`<Color>` is a number between 0 and 15. It can be a numerical constant variable, an array variable or an expression.
|
|
20
|
+
|
|
21
|
+
_Note that color 0 is a transparent color, it means that border space is seen transparently - to handle it as a 'normal' color, you need to use `VDP(9)=VDP(9) OR &H20` (back to transparent feature with `VDP(9)=VDP(9) AND &HDF`)._
|
|
22
|
+
|
|
23
|
+
`<RedLuminance>`, `<GreenLuminance>` and `<BlueLuminance>` are numbers between 0 and 7.
|
|
24
|
+
|
|
25
|
+
`NEW` allows to load the default MSX color palette, as it was when you turn on the computer. It can be a good idea to place this statement at the beginning and the end of your program.
|
|
26
|
+
|
|
27
|
+
`RESTORE` allows to restore the color palette from VRAM, for example when it has been stored by a graphic program.
|
|
28
|
+
|
|
29
|
+
If you `BSAVE` with `,S` option, you can save the contents of VRAM to the disk along with color palette infos. If you `BLOAD` with `,S` option, you can load such palette data to VRAM, but there are not yet any changes to the actually displayed colors. If you execute `COLOR=RESTORE`, you can display the picture in the same colors at the time you saved with `BSAVE` `,S`.
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
```basic
|
|
34
|
+
COLOR=(7,4,3,5)
|
|
35
|
+
```
|
|
36
|
+
```basic
|
|
37
|
+
10 SCREEN 2
|
|
38
|
+
20 BLOAD "BOX",S
|
|
39
|
+
30 COLOR=RESTORE
|
|
40
|
+
40 GOTO 40
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Default palette
|
|
44
|
+
|
|
45
|
+
|Color|R|G|B|
|
|
46
|
+
|-----|:-:|:-:|:-:|
|
|
47
|
+
|0|0|0|0|
|
|
48
|
+
|1|0|0|0|
|
|
49
|
+
|2|1|6|1|
|
|
50
|
+
|3|3|7|3|
|
|
51
|
+
|4|1|1|7|
|
|
52
|
+
|5|2|3|7|
|
|
53
|
+
|6|5|1|1|
|
|
54
|
+
|7|2|6|7|
|
|
55
|
+
|8|7|1|1|
|
|
56
|
+
|9|7|3|3|
|
|
57
|
+
|10|6|6|1|
|
|
58
|
+
|11|6|6|4|
|
|
59
|
+
|12|1|4|1|
|
|
60
|
+
|13|6|2|5|
|
|
61
|
+
|14|5|5|5|
|
|
62
|
+
|15|7|7|7|
|
|
63
|
+
|
|
64
|
+
## Storage of palette in VRAM
|
|
65
|
+
|
|
66
|
+
MSX-BASIC stores/restores palette to/from VRAM, but the address is different for each screen mode. The palette is stored in VDP native format: `(R*16+B, G)`.
|
|
67
|
+
|
|
68
|
+
Here is list of addresses for each mode:
|
|
69
|
+
|
|
70
|
+
|SCREEN|Decimal|Hexadecimal|
|
|
71
|
+
|---|:-:|:-:|
|
|
72
|
+
|0, WIDTH 40|1024|0400|
|
|
73
|
+
|0, WIDTH 80|3840|0F00|
|
|
74
|
+
|1|8224|2020|
|
|
75
|
+
|2|7040|1B80|
|
|
76
|
+
|3|8224|2020|
|
|
77
|
+
|4|7808|1E80|
|
|
78
|
+
|5-6|30336|7680|
|
|
79
|
+
|7-8|64128|FA80|
|
|
80
|
+
|9|30336|7680|
|
|
81
|
+
|10-12|64128|FA80|
|
|
82
|
+
|
|
83
|
+
## Related to
|
|
84
|
+
|
|
85
|
+
`CALL PALETTE`, `COLOR`, `SCREEN`, `SET PAGE`, `WIDTH`
|
|
86
|
+
|
|
87
|
+
## Compatibility
|
|
88
|
+
|
|
89
|
+
MSX-BASIC 2.0 or higher
|
|
90
|
+
|
|
91
|
+
## Source
|
|
92
|
+
|
|
93
|
+
Retrieved from "https://www.msx.org/wiki/COLOR%3D"
|