"Demo Scene" programming

Page 3/3
1 | 2 |

By NYYRIKKI

Enlighted (5385)

NYYRIKKI's picture

09-01-2015, 00:45

Manuel wrote:

On a normal MSX2 about 4 hours, on a turboR about 45 minutes Tongue

Hint, hint... On MSX tR with DEFINT A-Z & X-BASIC about 17 seconds... and then there are things called tables, that are also nice thing to learn...

By NYYRIKKI

Enlighted (5385)

NYYRIKKI's picture

09-01-2015, 01:03

I feel so bad for CX5Mer, that I just needed to optimize a tiny little bit (sorry, Vampier) I still tried to keep it simple by using multiple tables instead of one general table... Functionality is still same.

10 DEFINT D-Z
20 DIM A(255),B(211),C(467)
30 SCREEN 5
40 SET PAGE 1,1
50 CLS 'Remove to keep the old picture in memory
60 FOR I=0TO255:A(I)=SIN(I/22)*8:NEXT I
70 FOR I=0TO211:B(I)=COS(I/20)*8:NEXT I
80 FOR I=0TO467:C(I)=SIN(I/19)*8:NEXT I
90 FOR Y=0 TO 211:FOR X=0 TO 255
100 PSET (X,Y),(A(X)+B(Y)+C(X+Y))AND15
110 NEXT X,Y
120 I=(I+1)AND15:COLOR=(I,0,0,0):COLOR=((I+1)AND15,7,7,7)
130 IF INKEY$="" THEN 120

By CX5Mer

Champion (322)

CX5Mer's picture

09-01-2015, 03:07

Thanks for your advice Grauw, but even though I made two BSAVEs, the saved screens seem to have been tiled AND partly corrupted!

NYYRIKKI, thanks for your revised program, which I'll try later.

I don't really care about this at the moment, because my USB floppy drive from eBay has now arrived! As you may have guessed, I've just spent a few hours downloading MSX software onto floppy disks using a PC, but so far I haven't managed to even read any of these files on my Philips VG8235 MSX2 computer! The floppy disks had all been used by me before, I reformatted them on MSX, then found the PC USB floppy drive can't read the MSX formatted disks and the MSX can't read the PC USB formatted floppy disks! More about this later in another topic.

By Meits

Scribe (5539)

Meits's picture

09-01-2015, 07:30

Only format the disks on your MSX... Hmm... Which reminds me, you have a 8235... Is your drive single sided? PCs can't format single sided...

By Grauw

Ascended (8456)

Grauw's picture

09-01-2015, 09:24

CX5Mer wrote:

Thanks for your advice Grauw, but even though I made two BSAVEs, the saved screens seem to have been tiled AND partly corrupted!

Of course it’s partly corrupted, the text and character pictures of the text mode overwrites the graphics mode’s data... As for why it’s tiled I don’t know, maybe Basic uses 14-bit logic when using BSAVE in screen 0, so that it wraps around halfway down the screen.

Quote:

I reformatted them on MSX, then found the PC USB floppy drive can't read the MSX formatted disks and the MSX can't read the PC USB formatted floppy disks! More about this later in another topic.

If they are HD disks, you did put a piece of non-transparent tape over the hole in the bottom right?

By Vampier

Prophet (2297)

Vampier's picture

10-01-2015, 04:12

Let's just allows KUN/X Basic Smile no need to wait 100 hours before it's done filling the screen!

10 DEFINT D-Z
20 DIM A(255),B(211),C(467)
30 SCREEN 5
40 SET PAGE 1,1
50 CLS 'Remove to keep the old picture in memory
60 FOR I=0TO255:A(I)=SIN(I/22)*8:NEXT I
70 FOR I=0TO211:B(I)=COS(I/20)*8:NEXT I
80 FOR I=0TO467:C(I)=SIN(I/19)*8:NEXT I
90 FOR Y=0 TO 211:FOR X=0 TO 255
100 PSET (X,Y),(A(X)+B(Y)+C(X+Y))AND15
110 NEXT X,Y
115 R=5:G=6:B=2
120 I=(I+1)AND15:COLOR=(I,RMOD8,GMOD8,BMOD8)
121 R=R+1/1
123 G=G+1/2
124 B=B+1/3
130 IF INKEY$="" THEN 120

I made a slight adjustment on the color cycling. It looks much cooler like this Tongue

By Vampier

Prophet (2297)

Vampier's picture

10-01-2015, 04:15

NYYRIKKI we can up the level bit by bit Smile it has to be fun for those who just are starting in basic. I learned most from the 'kort en krachtig' (short and powerful) stuff that was mentioned earlier.

I'm busy this weekend but I'll try to come up with something cool to show soon.

By Vampier

Prophet (2297)

Vampier's picture

10-01-2015, 04:19

Here are the Moire Patterns against with some feedback from Nyrikki

Draw 1/4th of a circle then complete the circle. Then make them move over each-other and see the effect.

It's not really Moire anymore since I used an XOR operation.

100 SCREEN 5:FORI=0TO3:SET PAGE I,I:CLS:NEXTI:SCREEN ,2
110 COLOR=(2,3,3,3):COLOR=(3,7,7,7):COLOR=(6,7,7,7)
111 SET PAGE 1,1
120 FOR X=0 TO 31 STEP 1
130 FOR Y=0 TO 31 STEP 1
140 PSET(X,Y),SQR(X^2+Y^2)AND3
150 NEXT Y,X
160 FOR X=0 TO 31:COPY(31-X,0)-(31-X,31)TO(X,80):NEXT
170 COPY(0,0)-(31,31) TO (32,80)
180 FOR Y=0 TO 31:COPY(0,80+Y)-(64,80+Y) TO (0,80-Y):NEXTY
190 A=3:B=2
191 FOR M=0 TO 512STEP+.1:SET PAGE B,A:CLS
200 COPY (0,47)-(64,111),1 TO (64,100),A
201 COPY (0,47)-(64,111),1 TO (64+SIN(M)*8,100+COS(M)*8),A,XOR
202 SWAPA,B:NEXT M
210 GOTO 210
Page 3/3
1 | 2 |