Best demos

Page 10/12
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12

By tfh

Prophet (3317)

tfh's picture

11-12-2022, 22:48

erpirao wrote:

I was talking a bit with some of the Batman Group about porting pinball dreams to msx2, I even made them a small program in turbo basic with a scroll of one of the tables in sc8, but it seems that they were not convinced..

Well... They already have the ball routines in Z80. Maybe if they could supply this to some one as a starter...

By MaxMSX

Supporter (13)

MaxMSX's picture

11-12-2022, 23:01

Another nice pinball game to convert is this one. That's using the same video chip as the MSX-1. The full sources are also available.

By MaxMSX

Supporter (13)

MaxMSX's picture

12-12-2022, 21:31

And another demo example on TI-99/4A with TMS9918 VDP you can find here

By BadWolf359

Resident (33)

BadWolf359's picture

13-12-2022, 17:53

The CPU of the TI-99/4A might be a little more powerful than z80 (can't really tell. It is 16 bit though) but not a lot. Its VDP is the same as MSX1, so a lot here can be done on MSX1 or 2 too.

By Grauw

Ascended (10711)

Grauw's picture

13-12-2022, 17:58

As far as I heard, the memory architecture of the TI-99/4A is really inefficient (something about all memory access being indirect, like how you would access VRAM on MSX), so the CPU is not able to reach its potential and it comparatively slower than a Z80 on MSX.

By ARTRAG

Enlighted (6933)

ARTRAG's picture

13-12-2022, 21:09

From the TI99 world, ported to msxbasic

100 ' Death Star by Electron Greg
110 ' Adapted to TI99 by Tursilion - 256x192 version - unoptimized
120 ' Ported to msxbasic by Artrag
130 DIM AR(300)
140 DEF FNMYRD(X)=(INT(RND(1)*(X))+1)
150 ' prepare lookup table
160 V=640 : Z=522 : R=300 : PI = 4*ATN(1)
170 A=2*PI/R : S=SIN(A) : C=COS(A) : X=R : Y=0
180 FOR W=1 TO R
190 B=X*C-Y*S : Y=X*S+Y*C : X=B : AR(W)=600-(V+X)
200 NEXT W
210 '
220 SCREEN 2
230 COLOR 7,1,1:CLS
240 ' draw globe
250 FOR NN=115 TO 210 : ' latitude
260 IV=64:IZ = (1080-(AR(219-NN)*7))/5:IR = AR(NN)/2.5:IN = NN: GOSUB 380
270 NEXT NN
280 ' clear out dish area
290 IV=100:IZ=130:IR=40: GOSUB 660
300 ' draw dish
310 FOR NN=0 TO 44 STEP 4 
320 IV=100: IZ=130:IR=NN: GOSUB 530 
330 NEXT NN
340 ' spin forever
350 COLOR ,,15
360 GOTO 360
370 ' draw the moon itself
380 '
390 V=IV : Z=IZ : R=IR : N=IN
400 A=2*PI/360 : S=SIN(A) : C=COS(A) : X=R : Y=0
410 FOR W=1 TO 360 
420 P=FNMYRD(W)-(N/2)
430 IF P>100 THEN GOTO 500
440 B=X*C-Y*S : Y=X*S+Y*C : X=B : Q=((V+X)*1.3)-(Z/10)+100 : O=((Z+Y)/4!)*1.34+(X/3)
450 IF W<180 THEN GOTO 500
460 IF N>148 AND N<152 THEN PSET(Q+12,191-(O-1)): GOTO 500 : ' belt
470 FOR M=1 TO (360-W)/30
480 PSET(Q+FNMYRD(8),191-O) : ' density set by how many random pixels are plotted
490 NEXT M 
500 NEXT W
510 RETURN
520 ' draw the circles inside the dish
530 ' 
540 V=IV : Z=IZ : R=IR : N=IR
550 A=2*PI/400 : S=SIN(A) : C=COS(A) : X=R : Y=0
560 FOR W=1 TO 400 
570 B=X*C-Y*S : Y=X*S+Y*C : X=B
580 IF N>32 AND N<44 THEN GOTO 600
590 IF INT(FNMYRD((44-N))/5)<>1 THEN GOTO 620
600 IF W>0 AND W<120+FNMYRD(30)   THEN PSET(V+X,191-(Z+Y))
610 IF W>310+FNMYRD(30) AND W<400 THEN PSET(V+X,191-(Z+Y))
620 NEXT W
630 RETURN
640 ' wipe the dish section - use the optimized brute force grid search
650 '
660 ' Super fast filled circle (does require a single square root)
670 ' from https:://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles
680 RD=IR
690 FOR X=-RD TO RD
700 HH=SQR(RD*RD-X*X)
710 RX=IV+X
720 PH=IZ+HH
730 FOR Y=IZ-HH TO PH
740 PRESET(RX,191-Y)
750 NEXT Y
760 NEXT X
770 RETURN

By ARTRAG

Enlighted (6933)

ARTRAG's picture

13-12-2022, 23:16

Faster

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
370 FOR X=-RAD TO RAD
380 HH=SQR(RAD*RAD-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

By santiontanon

Paragon (1770)

santiontanon's picture

14-12-2022, 04:33

Nice! I just pasted it into MSX Pen and ran it at 10x speed to see it form haha, very cool. How long does it take to fully render at regular speed?

By ARTRAG

Enlighted (6933)

ARTRAG's picture

14-12-2022, 07:15

No idea, I've ran it on MsxTR with fast-forward in openmsx

By Manuel

Ascended (19308)

Manuel's picture

14-12-2022, 09:56

Original version runtime on turboR: about 18 minutes.
Optimized version: about 10 minutes.

Did you try with MSX Basic-kun? Smile

Page 10/12
3 | 4 | 5 | 6 | 7 | 8 | 9 | | 11 | 12