Quote:
|
But about that V9948, is it possible to include that in the test ?
Or is it included ?
|
It is included...
Quote:
|
Could someone also explain to me line by line what this code example actually does and how it does it 
|
First we need to know, that MSX type is stored on memory location &H2D (45 as decimal number) This memory location has following meaning:
0=MSX1
1=MSX2
2=MSX2+
3=MSX tR
10 IF PEEK(&H2D)>0 then A=(VDP(-1)AND62)/2+1
Here we test that this is not MSX1. This is because MSX1 can not read VDP status register 1 (= negative VDP numbers in BASIC) This is because MSX1 VDP has only one status register (status register 0) and that can be read trough VDP(8) in BASIC.
If we have MSX2 or better, we read the status register to get VDP type. VDP types are:
0=V9938
1=V9948
2=V9958
This information is located in bit's 1-5. As we don't need bit 0, bit 6 and bit 7. We simply mask them away (&B00111110 = 62) Now the result is one bit left, so we move that one bit right by dividing the result by 2. Now we have the VDP type as defined earlyer. As the A variable is still 0 if this command is not executed, we add 1 to the result to give a range of numbers to 1-3 if the command is executed and 0 if it is not.
To make it a bit more clear, we could have written the line like this as well:
10 IF PEEK(45)>0 then A=(VDP(-1)AND &B00111110 )/2+1
20 FOR I=0 TO 3:READ B$(I),V$(I):NEXT I
Load MSX types (0-3) to B$ array and VDP types (0-3) to V$ array.
30 PRINTB$(PEEK(&H2D));" BIOS installed with ";V$(A);" VDP"
Display the information.
40 DATA MSX1,at least TMS9918/TMS9929,MSX2,V9938,MSX2+,V9948,MSX tR,V9958
The strings for B$ and V$ arrays separated with ","
More information can be found from comprehensive school math books, (MSX2) BASIC programming manuals and VDP data sheet's.
~NYYRIKKI