PicoMiteVGA DEMO


Author Message
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 07:02am 06 Sep 2024      

3D Vortex

TILE HEIGHT 16
CLS
For Y=0 To 29:For X=0 To 79
If X+(Y<<1) And 2 Then BC=RGB(Myrtle) Else BC=0
TILE X,Y,RGB(CYAN),BC,1,1
Next :Next
For X=-25 To 24
For Y=-25 To 24
For U=0 To 1
For V=0 To 1
Q=PLOT(4+83*U,X+U,Y+V)
Next :Next
For U=0 To 2 Step .5
Q=PLOT(4+Sgn(U),X+(1 And U+.5),Y+(1 And U))
Next :Next :Next

Function PLOT(P,X,Y)
X0=320+7.5*X-6.5*Y
Y0=240+2*X+2.5*Y+29*Sin(A2(X,Y)*4+Sqr(X*X+Y*Y)/2)
If P=4 Then X1=X0:Y1=Y0
If P=5 Then Line X1,Y1,X0,Y0:X1=X0:Y1=Y0
X2=X0:Y2=Y0
PLOT=0
End Function

Function A2(X,Y)
If X=0 Then A2=1.57 Else A2=Atn(Y/X)
End Function

Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5976
Posted: 07:25am 06 Sep 2024      

Nice.... Ik knew the previous, but this one is new to me...

Volhout

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 08:09am 06 Sep 2024      

  Volhout said  Nice.... Ik knew the previous, but this one is new to me...

Thank you Volhout!
Yes, I am rewriting this from the demos for the BBC Micro to MMBASIC...
Only one of their interesting modes does not work yet, where they build a color static picture (16 colors), and then quickly switch the color output modes and get the effect of running fire for the drawn image.
Best regards, javavi.

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 09:08am 06 Sep 2024      

Bad Apple

CLS
R=0:DIR=1
Do
A%=Peek(CFUNADDR BadAple)
X=1:Y=1
For I=0 To 191
D%=Peek(BYTE A%+I)
If D% And 128 Then C=1 Else C=0
D%=D% And 127
Do
If C Then Circle X*8-4,Y*8+32,R,,,0,DIR
Inc X: If X>80 Then X=1: Inc Y
Inc D%,-1
Loop While D%>0
Next
Inc R,DIR
If R>6 Then DIR=-1
If R<0 Then DIR= 1
Pause 100
Loop

CSub BadAple
00000000
864C831C 84428603 83408903 853D8B03 903B8F01 8F3B8204 8D448E42 8F428F44
92428E43 9101823B 9102843B 8C038439 843A8201 823F8D02 83018902 8A458B40
84038B46 85028A3F 86018A3F 8D01833F 8D018240 92028240 94038239 89038336
85038101 8B048237 87078107 93048227 89088F02 A5038215 820A9308 9F09A603
C50BA901 890B8101 820BBB01 AD0B8603 AE0A8514 8F0A8216 88229B04 99048701
9806862D 900A862C 852F8101 82328A0F 86138201 81308101 82168202 824E8201
End CSub

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 08:33am 07 Sep 2024      

  matherp said  
  Quote  I prefer working with a high resolution VGA 640x480.

640x480 in colour on the RP2350

Just the day before yesterday Pico2 became available for order on Aliexpress, and I ordered one for myself, now all that's left is to wait and watch with envy how everything develops in this direction.
Maybe on the new Pico 2 it will be possible to make the height of TILES set to 8 lines for monochrome mode? I'm just used to working with such 8x8 graphics, like ZX-Spectrum...
For me, this activity is just a godsend, it distracts from the hardships of the real circumstances of my current life.
The new video modes and HDMI video output are also inspiring!
I wonder if it will be possible to make HDMI sound eventually?
In general, thank you very much for your work!
Edited 2024-09-07 18:37 by javavi

matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11604
Posted: 09:07am 07 Sep 2024      

  Quote  Maybe on the new Pico 2 it will be possible to make the height of TILES set to 8 lines for monochrome mode?


It already is

  Quote  I wonder if it will be possible to make HDMI sound eventually?


Not something I intend to look at. The second processor is running at pretty much full capacity processing things like layers and tiles

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 09:29am 07 Sep 2024      

Gravity Funnel (MODE 1)

TILE height 16:  CLS

For y=0 To 29 Step 1
 c=c Xor 1
 For x=0 To 79 Step 2
   c=c Xor 1
   If c Then
     TILE x,y,,RGB(myrtle),2,1
   Else
     TILE x,y,,RGB(black),2,1
   EndIf
 Next
Next

For X=-25 To 24
 For Y=-25 To 24
   For U=0 To 1
     For V=0 To 1
       Q=PLOT(0,X+U,Y+V)
     Next
   Next
   For U=0 To 2 Step .5
     Q=PLOT(1,X+(1 And U+.5),Y+(1 And U))
   Next
 Next
Next

Function PLOT(P,X,Y)
PX=320-5*X-8*Y
PY=200-3*X+2*Y-30*(-8/Sqr(1+(X^2+Y^2)/5))
If P Then Line SX,SY,PX,PY
SX=PX:SY=PY
PLOT=0
End Function

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 09:37am 07 Sep 2024      

Сolor palette PicoMiteVGA (VGA121) MODE 1: 640x480

TILE height 30
CLS
For y=0 To 479 Step 30
For x=0 To 639 Step 40
 Box x,y,40,30
 Triangle x+2,y+2,x+2,y+27,x+37,y+27,1,1
 Text x+5,y+16,Str$(yi),"LT",7,,0,1
 Text x+36,y+5,Str$(xi),"RT",7,,1,0
 Inc xi
 TILE x\8,y\30,NCOL(FC),NCOL(BC),5,1
 Inc BC
Next x
 Inc yi: xi=0
 Inc FC:BC=0
Next y
Do : Loop While Inkey$=""

Function NCOL(N)
NCOL=((N And 1)<<7)+((N And 6)<<13)+((N And 8)<<20)
End Function

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 04:44pm 12 Sep 2024      

Bubble Universe
Uses the new MAP command !
Video this DEMO on YouTube (not mine :)

MODE 2
CX=MM.HRes\2:CY=MM.VRes\2
SC=MM.VRes/4
r=(2*Pi)/25
x=0:v=0:t=0

FRAMEBUFFER LAYER
FRAMEBUFFER WRITE L
Do
 CLS
 col=1
 For i=50 To 80 Step 2
   For j=50 To 70 Step 1
     u=Sin(i+v)+Sin(r*i+x)
     v=Cos(i+v)+Cos(r*i+x)
     x=u+t
     Pixel CX+SC*u,CY+SC*v,Map(col)
   Next j
   Inc col: If col>15 Then col=1
 Next i
 Inc t,.025
 FRAMEBUFFER COPY L,N,B
Loop

Edited 2024-09-13 02:46 by javavi

Canada_Cold
Regular Member

Joined: 11/01/2020
Location: Canada
Posts: 57
Posted: 12:23am 13 Sep 2024      

Hi javavi,

I got my HDMI interface working today, (big thanks to all the posts re the 5V needed by my monitor).

Your PGM looks great on the 19" HDMI display.

Thanks for posting it.  

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 05:28pm 14 Sep 2024      

Optical Illusion

CLS
For y=1 To 480
For x=0 To 640
 Inc m
 If Not (x And 31) Then c=c Xor 1
 If m And 3 Then Pixel x,y,c Else Pixel x,y,c Xor 1
Next
 Inc m
 c=c Xor 1
 If Not (y And 31) Then c=c Xor 1
Next

For y=1 To 14
For x=1 To 19
 c=(x+y+(x>5)+(x>14)+(y>4)+(y>11)+1)Mod 2
 Line 32*x-8,32*y-2,32*x+8,32*y-2,4,c
 Line 32*x-2,32*y-8,32*x-2,32*y+8,4,c
Next
Next

al18
Senior Member

Joined: 06/07/2019
Location: United States
Posts: 245
Posted: 05:33pm 14 Sep 2024      

Bubble Universe looks great. Thanks for posting.

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 02:08pm 17 Sep 2024      

  al18 said  Bubble Universe looks great. Thanks for posting.

With Pico2 on RP2350 it works in color with 640x480 resolution on VGA!
MODE 3

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 04:56pm 17 Sep 2024      

Polygons.
MODE 2 vs MODE 3
RP2040 vs RP2350


MODE 3
CX=MM.HRes\2:CY=MM.VRes\2
Dim PX(6),PY(6)

R=128
D=2*R :S=R*Sqr(3)
K=512^2
For V=-20 To 20
 For H=-19 To 18
   CC=1+Abs(V*H/4)Mod 15
   I=0
   For L=-Pi To Pi Step Pi/3
     A=R+(1 And V)*R+H*D+Sin(L)*R
     B=V*S+Cos(L)*R
     C=K/(A*A+B*B)
     X=CX+B*C :Y=CY+A*C
     PX(I)=X:PY(I)=Y
     Inc I
   Next
   Line GRAPH PX(),PY(),Map(CC)
 Next
Next

lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3798
Posted: 04:57pm 17 Sep 2024      

Nice. Haven't seen that one before.

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 04:04pm 21 Sep 2024      

Iron Chain

  Quote  Option ANGLE DEGREES
R=100:p=28:G=R+p
For W=0 To 550 Step 93
 S=Sin(W+33)
 C=Cos(W+33)
 For X=0 To G: F=X: If F<R-p Then F=R-p
 For I=0 To 60: K=F+I*(G-F)/60
 Z=S*Sqr(p*p-(K-R)*(K-R))
 Y=C*Sqr(K*K-X*X)
 For M=-1 To 1 Step 2
 For N=-1 To 1 Step 2
 For O=-1 To 1 Step 2
 A=M*X+W*1.5: B=N*Y+O*Z+240
 J=(7*(A Mod 4)+5*(B Mod 4)) Mod 16
 If (N*Y*S/C-O*Z*C/S)+G >19*J Then Pixel A, B
Next :Next :Next :Next :Next :Next

Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5976
Posted: 08:07am 24 Sep 2024      

Hi Javavi,

I am surprized with all the beauties you come up with. I am keeping these.
Great....

Volhout

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 04:24pm 24 Sep 2024      

Colourful impassable labyrinth

MODE 1
CW=80:CH=40
SW=MM.HRes\CW
SH=MM.VRes\CH

CLS
Do
 XC=Cint(Rnd*CW):YC=Cint(Rnd*CH)
 X0=XC*SW:Y0=YC*SH
 TILE XC,YC,Rnd*&hFFFFFF,0
 C=Cint(Rnd):Line X0,Y0,X0+SW-1,Y0,,C
 C=Cint(Rnd):Line X0,Y0,X0,Y0+SH-1,,C
Loop While Inkey$=""

javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 565
Posted: 04:38pm 26 Sep 2024      

Alien from Space


R=2^14: U=0: A=150: B=260
Dim X(7), Y(7), K(7)
Y(1)=0:   X(1)=300:   K(1)=375^2
Y(2)=B:   X(2)=A:     K(2)=A^2
Y(3)=B:   X(3)=-A:    K(3)=A^2
Y(4)=0:   X(4)=-300:  K(4)=375^2
Y(5)=-B:  X(5)=-A:    K(5)=A^2
Y(6)=-B:  X(6)=A:     K(6)=A^2
Y(7)=0:   X(7)=0:     K(7)=925^2
MODE 1: CLS
CX=MM.HRes\2:CY=MM.VRes
Print "I'm not saying it was aliens..."
For N%=-R To R
X(0)=N%: Y(0)=N%
For L=1 To 7
Do :T=Fix(Rnd*7+1):Loop Until T<>U
U=T
A=X(0)-X(T)+.001
B=Y(0)-Y(T)
C=A*A+B*B
X(0)=X(T)+(K(T)*A)/C
Y(0)=Y(T)+(K(T)*B)/C
Pixel CX+X(0),CY-Y(0)
Pixel CX-X(0),CY-Y(0)
Next : Next

Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 411
Posted: 05:04pm 26 Sep 2024      

An other beautiful creation! I love your programs and pictures.
Pluto