MSX Compilator

Page 6/8
1 | 2 | 3 | 4 | 5 | | 7 | 8

Par ARTRAG

Enlighted (6933)

Portrait de ARTRAG

25-02-2022, 15:56

Probably generating the ASM file and having a separate compilation step could allow to integrate MDL in the tool chain

Par santiontanon

Paragon (1771)

Portrait de santiontanon

25-02-2022, 16:07

ah, indeed! That'd be even better Smile

Par bosh77

Resident (44)

Portrait de bosh77

25-02-2022, 16:34

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.

Par ARTRAG

Enlighted (6933)

Portrait de ARTRAG

25-02-2022, 16:43

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

Par bosh77

Resident (44)

Portrait de bosh77

25-02-2022, 18:24

Thank you very much ARTRAG!
Ok, I will create an instruction manual.

Par ARTRAG

Enlighted (6933)

Portrait de ARTRAG

25-02-2022, 22:05

Just for the newly introduced instructions should be sufficient for coders willing to start using the tool

Par ARTRAG

Enlighted (6933)

Portrait de ARTRAG

01-03-2022, 09:27

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?

Par ARTRAG

Enlighted (6933)

Portrait de ARTRAG

01-03-2022, 12:27

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

Par bosh77

Resident (44)

Portrait de bosh77

01-03-2022, 19:32

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

Par ARTRAG

Enlighted (6933)

Portrait de ARTRAG

02-03-2022, 07:23

Just tested and it works great
Thanks

Page 6/8
1 | 2 | 3 | 4 | 5 | | 7 | 8