MSXcompiler

بواسطة bosh77 بتاريخ 24-02-2022, 21:09

This is the renewed version. The 1.0 version was called MSXbasictoz80. For Windows OS
I have added several instructions and many more code examples.
Write your code for MSX computer in BASIC and with "F5", the compilator will create a ".DSK" or ".ROM" file, to your choice, to try on emulator or real MSX!
First you need to set the emulator and its path!

المرفقالحجمالتنزيلاتآخر الملفات المحملة
MSXcompilerV2.zip‏248.34 ك.بايت207منذ أقل من يوم أقل من ساعة
MSXcompilerV3.zip‏284.96 ك.بايت114منذ أقل من يوم أقل من ساعة

التعليقات (12)

بواسطة bosh77

Resident (43)

صورة bosh77

24-02-2022, 21:26

Work on Windows

بواسطة ARTRAG

Enlighted (6914)

صورة ARTRAG

25-02-2022, 15:19

Going to try! Greetings ! Very interesting!

بواسطة Frederik Dumarey

Supporter (10)

صورة Frederik Dumarey

21-08-2022, 17:11

Going to try V3 in combination with the MSXVR Face
Thanks a lot bosh77 ! Great job!

بواسطة bosh77

Resident (43)

صورة bosh77

07-12-2022, 16:43

I just released version 4 with new features and new BASIC commands, available for Windows and MAC OS.
You can find and download the compiler on github.com at this link:

https://github.com/bosh77/MsxCompilerV4

بواسطة ARTRAG

Enlighted (6914)

صورة ARTRAG

17-12-2022, 10:01

I'm testing the version 4. The test project in attach makes the GUI under windows crash, without any message... Any suggestion?

100 ' Death Star by Electron Greg
110 ' Adapted by Tursilion - 256x192 version - optimized
120 Dim AL,V,A,S,C,Z,Z2,R,X,Y,N2,P,B,Q,O As Float
130 AL=2*4*Atn(1)/300
140 Screen 2:Color 7,1,1:Cls
150 Dim M,N,W As Int
160 ' draw globe
170 V=64:A=2*4*Atn(1)/360:S=Sin(A):C=Cos(A)
180 For N=120 To 195
190 Z=(1080+((Cos(AL*(219-N))*300)+40)*7)/5
200 Z2=Z/10
210 R=-(Cos(AL*N)*300+40)/2.5
220 X=R:Y=0:N2=N/2
230 For W=1 To 360
240 P=(Int(Rnd(1)*W))-N2
250 If P>99 Then Goto 320
260 B=X*C-Y*S:Y=X*S+Y*C:X=B
270 If W<180 Then Goto 320
280 Q=((V+X)*1.3)-(Z/10)+100:O=((Z+Y)/4!)*1.34+(X/3)
290 If N>148 And N<152 Then Pset (Q+12,192-O):Goto 320
300 LIM=(360-W)/30
310 For M=1 To LIM:Pset(Q+Int(Rnd(1)*8+1),191-O):Next
320 Next
330 Next
340 ' clear out dish area
350 '
360 ' Super fast filled circle (does require a single square root)
370 ' from <a href="https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles" title="https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles">https://stackoverflow.com/questions/1201200/fast-algorithm-f...</a>
380 RAD=40:RQ = RAD*RAD
390 For X=-RAD To RAD
400 HH=Sqr(RQ-X*X)
410 RX=100+X
420 PH=130+HH
430 Line (RX,HH+61)-(RX,191-PH),1
440 Next
450 '
460 ' draw the circles inside the dish
470 V=100:Z=130:A=2*4*Atn(1)/400:S=Sin(A):C=Cos(A)
480 For N=0 To 40 Step 4
490 X=N:Y=0
500 For W=1 To 400:B=X*C-Y*S:Y=X*S+Y*C:X=B
510 If N>32 And N<44 Then Goto 530
520 If Int((Rnd(1)*(44-N))/5)<>0 Then Goto 550
530 If W>0 And W<120+Int(Rnd(1)*30+1)  Then Pset (V+X,191-(Z+Y))
540 If W>310+Int(Rnd(1)*30+1)And W<400 Then Pset (V+X,191-(Z+Y))
550 Next
560 Next
570 ' spin forever
580 Goto 580

بواسطة bosh77

Resident (43)

صورة bosh77

17-12-2022, 21:57

Hi Artrag, I corrected a few lines and now it works but only in Screen 5 and not screen 2.
I will solve the bug, in the meantime try this should work.

100 ' Death Star by Electron Greg
110 ' Adapted by Tursilion - 256x192 version - optimized
120 Dim AL,V,A,S,C,Z,Z2,R,X,Y,N2,P,B,Q,O As Float
130 AL=2*4*Atn(1)/300
140 Screen 5:Color 7,1,1:Cls
150 Dim M,N,W,LIM,RQ,RAD,HH,RX,PH As Int
160 ' draw globe
170 V=64:A=2*4*Atn(1)/360:S=Sin(A):C=Cos(A)
180 For N=120 To 195
190 Z=(1080+((Cos(AL*(219-N))*300)+40)*7)/5
200 Z2=Z/10
210 R=-(Cos(AL*N)*300+40)/2.5
220 X=R:Y=0:N2=N/2
230 For W=1 To 360
240 P=(Int(Rnd(1)*W))-N2
250 If P>99 Then Goto 320
260 B=X*C-Y*S:Y=X*S+Y*C:X=B
270 If W<180 Then Goto 320
280 Q=((V+X)*1.3)-(Z/10)+100:O=((Z+Y)/4)*1.34+(X/3)
290 If N>148 And N<152 Then Pset (Q+12,192-O),7:Goto 320
300 LIM=(360-W)/30
310 For M=1 To LIM:Pset(Q+Int(Rnd(1)*8+1),191-O),7:Next
320 Next
330 Next
340 ' clear out dish area
350 '
360 ' Super fast filled circle (does require a single square root)
370 ' from <a href="https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles" title="https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles">https://stackoverflow.com/questions/1201200/fast-algorithm-f...</a>
380 RAD=40:RQ = RAD*RAD
390 For X=-RAD To RAD
400 HH=Sqr(RQ-X*X)
410 RX=100+X
420 PH=130+HH
430 Line (RX,HH+61)-(RX,191-PH),1
440 Next
450 '
460 ' draw the circles inside the dish
470 V=100:Z=130:A=2*4*Atn(1)/400:S=Sin(A):C=Cos(A)
480 For N=0 To 40 Step 4
490 X=N:Y=0
500 For W=1 To 400:B=X*C-Y*S:Y=X*S+Y*C:X=B
510 If N>32 And N<44 Then Goto 530
520 If Int((Rnd(1)*(44-N))/5)<>0 Then Goto 550
530 If W>0 And W<120+Int(Rnd(1)*30+1)  Then Pset (V+X,191-(Z+Y)),7
540 If W>310+Int(Rnd(1)*30+1)And W<400 Then Pset (V+X,191-(Z+Y)),7
550 Next
560 Next
570 ' spin forever
580 Goto 580

بواسطة ARTRAG

Enlighted (6914)

صورة ARTRAG

18-12-2022, 00:40

hi Bore77
Something is wrong in the circles in the inner dish area. The black shadow you see in the original is missing. Look at this in basic for comparison. Some IF THEN do not work

100 ' Death Star by Electron Greg
110 ' Adapted by Tursilion - 256x192 version - optimized
120 ' 
130 AL=2*4*ATN(1)/300
140 SCREEN 2:COLOR 7,1,1:CLS
150 DEFINT M,N,W,O
160 ' draw globe
170 V=64:A=2*4*ATN(1)/360:S=SIN(A):C=COS(A)
180 FOR N=120 TO 195
190 Z=(1080+((COS(AL*(219-N))*300)+40)*7)/5
200 Z2=Z/10
210 R=-(COS(AL*N)*300+40)/2.5
220 X=R:Y=0:N2=N/2
230 FOR W=1 TO 360:P=(INT(RND(1)*W))-N2:IF P>99 THEN 300
240 B=X*C-Y*S:Y=X*S+Y*C:X=B
250 IF W<180 THEN 300
260 Q=((V+X)*1.3)-(Z/10)+100:O=((Z+Y)/4!)*1.34+(X/3)
270 IF N>148 AND N<152 THEN PSET (Q+12,192-O):GOTO 300
280 LIM=(360-W)/30
290 FOR M=1 TO LIM:PSET(Q+INT(RND(1)*8+1),191-O):NEXT
300 NEXT
310 NEXT
320 ' clear out dish area
330 '
340 ' Super fast filled circle (does require a single square root)
350 ' from <a href="https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles" title="https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles">https://stackoverflow.com/questions/1201200/fast-algorithm-f...</a>
360 RAD=40:RQ = RAD*RAD
370 FOR X=-RAD TO RAD
380 HH=SQR(RQ-X*X)
390 RX=100+X
400 PH=130+HH
410 LINE (RX,HH+61)-(RX,191-PH),1
420 NEXT
430 '
440 ' draw the circles inside the dish
450 V=100:Z=130:A=2*4*ATN(1)/400:S=SIN(A):C=COS(A)
460 FOR N=0 TO 40 STEP 4
470 X=N:Y=0
480 FOR W=1 TO 400:B=X*C-Y*S:Y=X*S+Y*C:X=B
490 IF N>32 AND N<44 THEN 510
500 IF INT((RND(1)*(44-N))/5)<>0 THEN 530
510 IF W>0 AND W<120+INT(RND(1)*30+1)  THEN PSET (V+X,191-(Z+Y))
520 IF W>310+INT(RND(1)*30+1)AND W<400 THEN PSET (V+X,191-(Z+Y))
530 NEXT
540 NEXT
550 ' spin forever
560 GOTO 560

بواسطة ARTRAG

Enlighted (6914)

صورة ARTRAG

18-12-2022, 15:21

PS "Renum" in the gui starting by 100 does not work

بواسطة bosh77

Resident (43)

صورة bosh77

19-12-2022, 14:30

I corrected the bugs of the Windows version, now you can download it again from Github at the usual link and try again.
I tried RENUM and works.

بواسطة ARTRAG

Enlighted (6914)

صورة ARTRAG

19-12-2022, 15:29

Try renum with START LINE 100
It keeps using 10

بواسطة bosh77

Resident (43)

صورة bosh77

19-12-2022, 16:59

After typing 100 in the window press Enter otherwise the value is not updated

بواسطة ARTRAG

Enlighted (6914)

صورة ARTRAG

20-12-2022, 09:07

Pressing enter it works