Probably generating the ASM file and having a separate compilation step could allow to integrate MDL in the tool chain
ah, indeed! That'd be even better
Yes I will consider these compiler additions, thanks. About the command line is planned for the next version, and also a better IDE with color editor and more files editable at the same time.
Anyway your project is a sort of holy grail for all the kids coding in basic in the '80
Congratulation ! If you add a bit of documentation (for the extra commands) it would be perfect
Thank you very much ARTRAG!
Ok, I will create an instruction manual.
Just for the newly introduced instructions should be sufficient for coders willing to start using the tool
I was trying to compile some simple basic programs
This is one of them
https://github.com/robertocapuano/Doomfire10L/blob/main/doom...
It gives IndexOutOfRangeException at compile time... Any hint on what is going on?
I've rearranged the code to get more info on what the compiler does not like
10 screen 1,0,0:COLOR2,1,1 20 DEFINT A-Z 30 B=base(5):R=RND(-TIME):R=4: BB=B+23*32:CB=BASE(6) 40 FOR I=0 TO 4 50 READ R$ 60 VPOKE CB+8+I,VAL(R$) 70 NEXT I 80 FOR I=0 TO 32*24-1 90 VPOKE BB+31-I, 64 100 NEXT I 110 FOR I=0 TO 31 120 LL=R* (RND(1)* SIN(I/31 * 3.14)) 130 VPOKE BB+I,(8+LL)*8+LL 140 NEXT I 150 for J=0 TO 20 160 for I=0 to 31 170 A = BB-j*32+I 180 v = vpeek(a) and 7 190 d = RND(1)*3 200 AB = A - D + 1 - 32 210 vpoke AB, (8+V)*8+V 220 NEXT I,J 230 K$=INKEY$:K=(K$<>""): R=-K*(4-R) + (1+K)*R 240 goto 150 250 DATA &H11, &H88, &H99, &Hba, &H98, &H64, &H73, &H82, &H91, &H100
I get those errors:
START MSX COMPILER...
Syntax Error in 20
Syntax Error in 50
Syntax Error in 60
Syntax Error in 60
Syntax Error in 90
Syntax Error in 130
Syntax Error in 200
There are some changes to make:
- all variables must be declared with DIM
- there are no READ and DATA but 4 variants (READB, READI, READF, READS and DATAB, DATAI, DATAF, DATAS each for type of variable: byte, int, float and string)
- BASE and INKEY instructions are not supported, but I will add them
- the data in the DATAI statement must be written in decimal (also here I will add support for & H)
- the instructions must be written separately: PRINTI not works, but you must write PRINT I detached.
- the RESTORE statement must always be declared
try changing some variables to bytes and see if it's faster
now works
10 screen 1,0:COLOR 2,1,1 20 dim B as int 21 dim R,d as int 22 dim RS as int 23 dim I,J,v as int 24 dim A,AB,CB,BB,K,LL as int 25 dim rand as float 26 dim Key1 as byte 30 B=6144 31 rand=RND(-TIME):R=4: BB=B+23*32:CB=8192 35 restore 250 40 FOR I=0 TO 4 50 READI RS 60 VPOKE CB+8+I,RS 70 NEXT I 80 FOR I=0 TO 767 90 VPOKE BB+31-I,64 100 NEXT I 110 FOR I=0 TO 31 120 LL=R*(RND(1)*SIN(I/31*3.14)) 130 VPOKE BB+I,(8+LL)*8+LL 140 NEXT I 150 for J=0 TO 20 160 for I=0 to 31 170 A=BB-J*32+I 180 v=vpeek(A) & 7 190 d=RND(1)*3 200 AB=A-d+1-32 210 vpoke AB,(8+v)*8+v 220 NEXT I 221 next J 230 Key1=GetKey(KeySpace) 231 if Key1=0 then K=-1 else K=0 235 R=-K*(4-R)+(1+K)*R 240 goto 110 250 DATAI 17,136,153,186,152,100,115,130,145,256
Just tested and it works great
Thanks