On this page I'll help you to program.
Some pokes e peeks interesting:
POKE &HF346,1 - Call system available.
POKE &HF247,n - Change master drive (A,B,C,D,...).
POKE &HFF89,&HE1 - Command LIST shows syntax error.
POKE &HFF89,&HEE - Command LIST resets.
POKE &HFF89,&201 - Command LIST normalized.
POKE &HFBB1,1 - Desactivate CONTROL+STOP.
POKE &HFBB1,0 - Activate CONTROL+STOP.
POKE &HF2B1,n - Determina o número de linhas na tela.
POKE &HFCAB,1 - Hangs capital letter.
POKE &HFCAB,255 - Caps Lock normalized.
PEEK(&HFAFC) - Shows the memmory video size.
PEEK(&H2D) - Shows MSX version.
PEEK(&H347) - Shows how many drives are in use.
Using poke:
20 POKE &HF346,1
Using peek:
20 print peek(&hf346)
How to use colors on MSX 2:
As we see on hardware page, MSX 2 has screens with 16 colors and 512 combinations.
But, what the hell is this? Simply. We can put on screen 16 different colors at same
time, as on screen 2 and change each color by manipulating RGB table.
The command COLOR adjusts the tonality of the colors on screens 0, 1, 2, 3, 4, 5,
6 and 7. The COLOR structure is shown below:
COLOR=(color to change,red,green,blue)
COLOR=(COLOR,R,G,B), R,G,B => Ranges from 0 to 7. 0=Mín e 7=Máx.
Suppose we wish to change white color(15) to yellow. We know that yellow is red and
green combination. So:
10 COLOR=(15,7,7,0)
With this tool, we can make some effects like light and dark gradative:
10 FOR F=0 TO 7
20 COLOR=(15,F,F,F)
30 NEXT F
Screen 8 is destined to show photos. It has 256 colors simultaneous, but any of them
can be manipulated by RBG.
To change screen 8 color:
10 screen 8
20 line(10,10)-(100,100),255
30 goto 30
The colors ranges from 0 to 255.
from screen 5 on, the screens don't blots anymore.
How to scroll MSX 2+ screen:
Type:
SET SCROLL A,B,C,D
A - Horizontal moviment.
B - Vertical moviment.
C e D - Hides screens' corners. Values between 0 and 1.
Graphic text with no background:
Who is accustomed on screen 2 printing will notice that screen 5 on prints a word
with a background with the same color as border color. To use a invisible background
make this procedure:
COLOR ,,0. Then add the TPSET option to ignore the 0 color (transparent).
PRESET(x,y),0,tpset:?#1," ".
We can use TPSET to copy an image without the black border:
copy(x1,y1)-(x2,y2),1 to (xf,yf),0,tpset
MSX 2 brings us more than 1 video page to work:
Yes, we can change screen pages in basic. For what is this thing? As we know, loading pictures is
very slow for the drive but from memmory to video is much faster. So if we want to make some animation,
we can't show the pictures on main screen. We put them on a hidden screen and then we make the animation.
The page command is:
SET PAGE A,B
A - Page that is being used.
B - Visible page.
How to load MSX programs:
In basic:
1 - If it's .BAS, use: RUN"file.bas", where file is the name of the file to load.
2 - If it's .BIN, use: BLOAD"file.bin",r. The option r runs the program after load it.
3 - If the extension doesn't match these above:
Use Run. Else try bload. Else try DOS, like PC (MSX-DOS)
Emulators for MSX:
If you have sold your PC, don't worry!! You can emulate MSX on PC.
Go to funet.
I recommend FMSX-DOS version 1.6b and Ru-MSX. Pay attention to these programs ROMs need.
Download them from the same directory as you take the emulators.
Shortcuts to DOS 1:
Supose that mode 40 command was written:
A:>MODE 40
A:>
The last command is kept on memmory.
On new line, there are several shortcuts to make things easier.
1- Right arrow: Copies last command character by character.
Right arrow
A:>M
Right arrow
A:>MO
2- Select: Copies all characters up to specified caracter.
3- Down arrow: Copies all characters from previous line to next line.
Down arrow
A:>MODE 40
4- Delete: Erases a previous line's character to next line.
Delete
Down arrow (or right arrow)
A:>ODE 40
5- CLS(shift+home): Jumps up to specified character.
SHIFT+HOME
CHARACTER(EX:"D")
Down arrow (or right arrow)
A:>DE 40
6- ESC: Invalidates all alterations.
7- Left arrow or BS: Erases last digited character.
Down arrow
Left arrow
A:>MODE 4
8- INSERT: Inserts characters in the word.
Right arrow
Right arrow
INS
L
O
I
Down arrow
A:>MOLOIDE 40
9- HOME: New line.
Processes during command execution:
1- CTRL+N: Stop connecting with printer.
2- CTRL+C: Aborts current command.
3- CTRL+H: BS.
4- CTRL+J: Next line.
5- CTRL+P: Prints video data on printer.
6- CTRL+S: Pause (used on DIR, TYPE, etc).
Reading disk's sectors in BASIC:
It's possible to load all 1440 disk sectors on memmory, but once a time. Use
command:
10 PRINT DSKI$(num drive,num sector), where num drive = 0.
The memmo address is shown at addresses &HF351 e &HF352. In other words, these
two addresses contains the sector starting address in memmo.
After loading sector, we will check the starting address:
20 ? hex$(peek(&HF351))
30 ? hex$(peek(&HF352))
Suppose the hexadecimal value 96 for line 20 and EB for line 30.
But when we join the numbers, line 30 data comes first then line 20.
The right thing is EB96, that means (&HF352)(&HF351).
So, the starting address is &HEB96, with 512 bytes length.
Example on how showing sector 0 contents:
10 PRINT DSKI$(0,0)
20 AD$=hex$(peek(&HF352))+hex$(peek(&HF351))
30 AD=VAL("&H"+AD$)
40 FOR F=AD TO AD+511
50 PRINT HEX$(F);"-";HEX$(PEEK(F));"-";CHR$(PEEK(F))
60 NEXT F
It's possible to change current sector data:
POKE &H(address),data.
Save setor:
DSKO (numdrive,numsector).
Atenttion: Do not access the disk before saving the current sector
(if you intend to), because for each access, this memmory area is
cleared.
See some pascal on Back
/MARMSX/HELP