Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:47 09 Jan 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMiteVGA DEMO

     Page 10 of 10    
Author Message
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 525
Posted: 04:56pm 18 Oct 2025
Copy link to clipboard 
Print this post

Landscape

MODE 2
CLS Map(1)
r=Rad(35):m%=4
For y%=0 To MM.VRES
For x%=0 To MM.HRES
 h=0
 For i%=1 To 4
   x0=x%/i%:y0=y%/i%
   a=r*i%
   Co=Cos(a):Si=Sin(a)
   s=x0*Co-y0*Si
   t=x0*Si+y0*Co
   h=h+Sin(s/5)*4+Sin(t/7)*5
 Next
If h>-2 Then
 Color Map(4+Abs(h) Mod 7)
 Pixel x0*m%,y0*m%
EndIf
Next : Next
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 525
Posted: 07:11pm 31 Oct 2025
Copy link to clipboard 
Print this post

Plasma

MODE 2
Map Reset
Dim integer cm(15)=(0,15,7,1,0,0,0,0,0,0,0,0,0,0,0,0)
Colour Map cm(),cm()

r=Rad(35)
For Y0%=0 To MM.VRES
For X0%=0 To MM.HRES
 h=0
For i%=1 To 3
 x=(X0%-10)/i%:y=Y0%/i%:a=r*i%
 C0=Cos(a):S0=Sin(a)
 s=x*C0-y*S0:t=x*S0+y*C0
 h=h+Sin(s/5)*4+Sin(t/7)*5
Next
 Pixel X0%,Y0%,Map((h+24)Mod 16)
Next :Next

Do
 T=cm(0)
 For i%=0 To 14:cm(i%)=cm(i%+1):Next
 cm(15)=T
 For i%=0 To 15:Map(i%)=cm(i%):Next
 Map Set
 Pause 50
Loop
 
AlbertR
Regular Member

Joined: 29/05/2025
Location: Germany
Posts: 100
Posted: 03:37pm 01 Nov 2025
Copy link to clipboard 
Print this post

I love demos like this and can watch them over and over again. I think a plasma demo is a must, great work!

Albert
Edited 2025-11-02 01:38 by AlbertR
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2715
Posted: 05:45pm 01 Nov 2025
Copy link to clipboard 
Print this post

nice
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 407
Posted: 09:25pm 01 Nov 2025
Copy link to clipboard 
Print this post

Cannot resist to immediately run and enjoy these interesting artworks.
Pluto
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 525
Posted: 05:37pm 06 Nov 2025
Copy link to clipboard 
Print this post

Plasma Watch

MODE 2
Map Reset
Dim integer CM(15)=(0,15,7,3,1,0,0,0,0,0,0,0,0,0,0,0)
Colour Map CM(),CM()
FRAMEBUFFER LAYER
FRAMEBUFFER WRITE L
r=Rad(35)
For Y0%=0 To MM.VRES
For X0%=0 To MM.HRES
 h=0
For i%=1 To 3
 x=(X0%-10)/i%:y=Y0%/i%:a=r*i%
 C0=Cos(a):S0=Sin(a)
 s=x*C0-y*S0:t=x*S0+y*C0
 h=h+Sin(s/5)*4+Sin(t/7)*5
Next
 Pixel X0%,Y0%,Map((h+64)Mod 16)
Next :Next

FRAMEBUFFER WRITE N
XCntr%=MM.HRES\2:YCntr%=MM.VRES\2
XC%=XCntr%:YC%=YCntr%:CC%=1
XDir%=1:YDir%=1
Do
 TC%=CM(1)
 For i%=1 To 14:CM(i%)=CM(i%+1):Next
 CM(15)=TC%
 For i%=1 To 15:Map(i%)=CM(i%):Next
 Map Set
 Inc CC%,-1:If CC%=0 Then CC%=15
 CLS
 Text XC%,YC%,Time$,"CM",6,,Map(CC%)
 Inc XC%,XDir%:Inc YC%,YDir%
 If XC%>XCntr%+32 Then XDir%=-1
 If XC%<XCntr%-32 Then XDir%=1
 If YC%>YCntr%+95 Then YDir%=-1
 If YC%<YCntr%-95 Then YDir%=1
 Pause 50
Loop
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1716
Posted: 03:00pm 10 Dec 2025
Copy link to clipboard 
Print this post

I like this thread because I can sometimes look up how to use certain graphics commands here. Many thanks, Vadim, for your tireless work!

My StarFlight screensaver for HDMI (Pico2, Mode 1 & 3) is a small contribution. The code is optimized for low memory usage (~1200 Bytes):



'*** STARFLIGHT Screensaver - packed, HDMI ***
Option default integer
starflight()
End

Sub starflight
MODE 3:CLS
Static N=120,S(N),ZM=50,ZS=2,SW=MM.HRES,SH=MM.VRES,CX=SW/2,CY=SH/2
Static MSW=SW-MM.Info(fontwidth),Z1=ZM*.7,Z2=ZM/4
Local i,WX,WY,WZ,SX,SY,COL,CH$
For I=0 To N:WX=Rnd*SW-CX:WY=Rnd*SH-CY:WZ=Rnd*ZM+1
S(I)=PkStar(WX,WY,WZ):Next I

Do :For I=0 To N:UnPkStar(S(I),WX,WY,WZ,SX,SY)
Print @(SX,SY)" ";:Color RGB(CYAN):Print @(CX,CY)Chr$(142);:Inc WZ,-ZS
If WZ>0 Then
SX=WX*ZM/WZ+CX:SY=WY*ZM/WZ+CY
If SX>=0 And SX<MSW And SY>=0 And SY<SH Then
COL=RGB(WHITE)
Select Case WZ
Case >Z1:CH$=Chr$(250)
Case Z2 To Z1:CH$=Chr$(249)
Case Else :CH$=Chr$(142):COL=RGB(ORANGE)
End Select :Color COL:Print @(SX,SY)CH$;:S(I)=PkStar(WX,WY,WZ,SX,SY)
Else :S(I)=PkStar(WX,WY,WZ):End If
Else :WX=Rnd*SW-CX:WY=Rnd*SH-CY:S(I)=PkStar(WX,WY,ZM):End If
Next :Loop While Inkey$=""
End Sub

Function PkStar(WX,WY,WZ,SX,SY)
Static M=2^12-1
PkStar=(WX And M) Or ((WY And M)<<12) Or ((WZ And M)<<24) Or ((SX And M)<<36) Or ((SY And M)<<48)
End Function

Sub UnPkStar(PD,WX,WY,WZ,SX,SY)
Static SC=2^12,M=SC-1,SL=SC/2-1
WX=(PD And M):If WX>SL Then WX=WX-SC
WY=((PD>>12) And M):If WY>SL Then WY=WY-SC
WZ=((PD>>24) And M):SX=((PD>>36) And M):SY=((PD>>48) And M)
End Sub


N - Star Count Index Limit: Defines the total number of stars (here: 120 stars).
S() - Star Data Array: An array that stores the packed state data (coordinates, etc.) for each star. Replaces S(n,5).
ZM - Z-Maximum: Defines the maximum depth (Z) in 3D space (50 units).
ZS - Z-Speed: Defines the speed (1 unit per frame) at which the depth (WZ) of each star is reduced.
SW - Screen Width: Stores the horizontal resolution (MM.HRES) of the display.
SH - Screen Height: Stores the vertical resolution (MM.VRES) of the display.
CX - Center X: The X-coordinate of the screen center (SW/2), used as an offset for the projection.
CY - Center Y: The Y-coordinate of the screen center (SH/2), used as an offset for the projection.
MSH - Max Screen Height: Defines the maximum Y screen boundary for drawing (SH - 2 * FontHeight).
Z1 - Z-Level 1: Depth (ZM * 0.7), defines the first color/character change threshold (Farthest to Mid-range).
Z2 - Z-Level 2: Depth (ZM / 4), defines the second color/character change threshold (Mid-range to Closest).


Adapting it for Mode 2 and the terminal is possible by replacing the star-characters with characters using ASCII codes less than 128 (e.g. CH$=".","+","*"). Of course, it won't look as good then.

There are still 3 million miles to go home ...

Regards
Michael
causality ≠ correlation ≠ coincidence
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5599
Posted: 03:16pm 10 Dec 2025
Copy link to clipboard 
Print this post

I know it is 100* pollution here, but when I see stars, I have to run this one-liner game... yes it is a game, use left and right keys.

Picomite mode 1 (VGA or HDMI).

1 Print @(8*c,84)"V":Pause 99:b=Asc(Inkey$):c=c+(b=131)-(b=130):a%=80*Rnd():Print @(8*a%,468)"*":If Pixel(8*c+4,89)=0 Then 1


Volhout
PicomiteVGA PETSCII ROBOTS
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1716
Posted: 03:14pm 13 Dec 2025
Copy link to clipboard 
Print this post

This is the older, smaller version of the Starflight screensaver. I've added automatic screen mode adjustment. I regret that we don't have a way to directly query the screen mode (mm.info(Mode)).
This version omits packing the star arrays, but therefore can only handle fewer stars. It seems to work fine for up to 100 stars.

Update:
MODE 3
starflight
End

Sub starflight
CLS
Static M=50,ZM=80,ZS=2,SW=MM.HRES,SH=MM.VRES,CX=SW/2,CY=SH/2
Static MSW=SW-MM.Info(fontwidth)
Local S(M,5),i,ZV,XP,YP,SX,SY,COL,CS$(1)=(" ",Chr$(142)),CH$
For I=1 To M: S(I,1)=Rnd*SW-CX:S(I,2)=Rnd*SH-CY:S(I,3)=Rnd*ZM:S(I,4)=0:S(I,5)=0:
Next I
Do :For I=1 To M:Print @(S(I,4),S(I,5))" ";
Color RGB(CYAN):Print @(CX,CY)CS$(Rnd);
S(I,3)=S(I,3)-ZS:ZV=S(I,3)
If ZV>1 Then:XP=S(I,1)*ZM/ZV:YP=S(I,2)*ZM/ZV:SX=XP+CX:SY=YP+CY
If SX>=0 And SX<MSW And SY>=0 And SY<SH Then:COL=RGB(WHITE)
Select Case ZV
Case >ZM/2:CH$=Choice(SW>=640,Chr$(250),".")
Case ZM/4 To ZM/2:CH$=Choice(SW>=640,Chr$(249),Chr$(96))
Case Else :CH$=Choice(SW>=640,Chr$(142),"*"):COL=RGB(ORANGE)
End Select
Color COL:Print @(SX,SY)CH$;:S(I,4)=SX:S(I,5)=SY:Else
S(I,1)=Rnd*SW-CX:S(I,2)=Rnd*SH-CY:S(I,3)=Rnd*ZM
EndIf :Else : S(I,1)=Rnd*SW-CX:S(I,2)=Rnd*SH-CY:S(I,3)=Rnd*ZM:EndIf :Next
Loop While Inkey$=""
End Sub

| M | Maximum number of stars in the simulation. Set to 80.
| ZM | Maximum Z-depth for the stars. This defines the farthest point in the simulated 3D space. Set to 80.
| ZS | Z-step or speed increment per frame. This value is subtracted from a star's Z-coordinate to simulate forward movement.
| SW | Screen Width (Horizontal Resolution) retrieved from MM.HRES.
| SH | Screen Height (Vertical Resolution) retrieved from MM.VRES.
| CX | Center X-coordinate of the screen: SW / 2. Used as the screen's projection center.
| CY | Center Y-coordinate of the screen: SH / 2. Used as the screen's projection center.
| MSW | Maximum visible Screen Width for plotting characters: SW - MM.Info(fontwidth). Used to prevent plotting characters outside the screen boundary on the right side.
| CS$(1) | Character Set for the center of the screen. Contains a space character and a special character (Chr$(142)).
| S | Star Data Array. Dimensioned S(M, 5). Each row I represents a star, and the columns store its properties.

Enjoy!

Michael
Edited 2025-12-22 03:41 by twofingers
causality ≠ correlation ≠ coincidence
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 525
Posted: 08:14pm 27 Dec 2025
Copy link to clipboard 
Print this post

Fill Maze  

MODE 2
CLS
S=4
W=MM.HRES\S
H=MM.VRES\S

For Y=0 To H
For X=0 To W
 X0=X*S:Y0=Y*S
 If Rnd>.5 Then Line X0,Y0,X0+S,Y0
 If Rnd>.5 Then Line X0,Y0,X0,Y0+S
Next
Next

Do
X=Int(Rnd*W)*S+2
Y=Int(Rnd*H)*S+2
Fill X,Y,Map(Int(Rnd*15))
Fill X,Y,0
Loop
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1716
Posted: 11:10am 31 Dec 2025
Copy link to clipboard 
Print this post

Hi Vadim,
you always bring new, amazing code snippets. Thanks!

Slava Ukraini! And a swift, dignified, and reliable end to the war. Down with the "orcs" in your land, and everywhere in the world.
Kind regards
Michael
causality ≠ correlation ≠ coincidence
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 407
Posted: 12:10pm 31 Dec 2025
Copy link to clipboard 
Print this post

  Quote  Slava Ukraini! And a swift, dignified, and reliable end to the war. Down with the "orcs" in your land, and everywhere in the world.


Vadim,
Best wishes for 2026!

Fred/(Pluto)
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 1037
Posted: 04:11pm 31 Dec 2025
Copy link to clipboard 
Print this post

Vadim, thank you so much for all the great programs you've posted here in the forum! All the best for 2026!!!

Frank
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5599
Posted: 09:57am 01 Jan 2026
Copy link to clipboard 
Print this post

Hi Vadim,

Good to hear that you are still holding on. All the best wished for 2026, and may the war be over soon.

One VGA demo I think is missing in this (your) thread is the your impressive matrix screen saver. Here as a stand alone program.

'SCREEN SAVER - Matrix
Const FW=MM.Info(FONTWIDTH): FH=MM.Info(FONTHEIGHT)
Const CHR=MM.HRes\FW: CVR=MM.VRes\FH
dim matr(CHR),fade(CHR),clr,x
For x=1 To CHR:matr(x)=CVR*Rnd:fade(x)=&hF*Rnd:Next
Do
 For x=1 To CHR
   clr=&h1000*(fade(x)-&hF) And &hFF00
   Colour clr
   Print @(x*FW-FW,matr(x)*FH)Chr$(Rnd*223+32);
   If matr(x)>CVR  Then matr(x)=0 Else Inc matr(x)
   If fade(x)=&hF0 Then fade(x)=0 Else Inc fade(x)
 Next
 Pause 10
Loop While Inkey$=""







Volhout

P.S. the last maze demo is a most impressive demo of Pico's V6.01.00 capabilities in utmost simplicity. Very nice !!
Edited 2026-01-01 20:13 by Volhout
PicomiteVGA PETSCII ROBOTS
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 525
Posted: 10:00am 04 Jan 2026
Copy link to clipboard 
Print this post

Maze Game  

MODE 2
CLS :Font #8
S=8
W=MM.HRES\S: Xc=MM.HRES\2
H=MM.VRES\S: Yc=MM.VRES\2
COUNTER=0: SCORE=0
CONTROL=0: DIRECT=0: SHIFT=0
Timer =0
FRAMEBUFFER LAYER
FRAMEBUFFER WRITE L
Color Map(14)
Print @(Xc,Yc)"%";
FRAMEBUFFER WRITE N
Color Map(7),Map(0)
Print @(0,0);
For i=1 To W*H
 Print Chr$(32+Int(Rnd*4));
Next

Do
GameController
CheckMovement(CONTROL)
Moving(DIRECT)
If SHIFT>7 Then
 SHIFT=0
 Color Map(Int(Rnd*16))
 Print @(Int(Rnd*W)*S,Int(Rnd*H)*S,1);"$";
 Color Map(7)
 Print @(Int(Rnd*W)*S,Int(Rnd*H)*S,1);Chr$(Int(Rnd*4)+32);

 If Pixel(Xc+2,Yc+2) Then
  Inc SCORE
  Print @(Xc,Yc)" ";
  Play Tone 400+100*Int(Rnd*30),400,200

  'Text Xc,2,"GAME SCORE:"+Str$(SCORE),"C",1,,Map(8),Map(15)
 EndIf
EndIf
FRAMEBUFFER WRITE L
Text 4,4,"TIME:"+Time$,"L",1,,Map(2),Map(9)
Text 4,20,"GAME SCORE:"+Str$(SCORE),"L",1,,Map(8),Map(15)
FRAMEBUFFER WRITE N
Pause 10
Loop

Sub GameController
Select Case Asc(Inkey$)
 Case 0
  CONTROL=0
  Inc COUNTER: If COUNTER>500 Then CONTROL=Int(Rnd*6)
  Exit Sub
 Case 27
  End
 Case 13,32
  CONTROL=5
 Case 119,128
  CONTROL=1
 Case 100,131
  CONTROL=2
 Case 115,129
  CONTROL=3
 Case 97,130
  CONTROL=4
End Select
COUNTER=0
End Sub

Sub CheckMovement(CTRL)
If SHIFT Then Exit Sub
DIRECT=CTRL
Select Case CTRL
Case 0
 Exit Sub
Case 1
 If Pixel(Xc+4,Yc) Then DIRECT=0
Case 2
 If Pixel(Xc+8,Yc+4) Then DIRECT=0
Case 3
 If Pixel(Xc+4,Yc+8) Then DIRECT=0
Case 4
 If Pixel(Xc,Yc+4) Then DIRECT=0
Case 5
 Print @(Xc,Yc)" ";
End Select
Play Tone 500,500,10
End Sub

Sub Moving(D)
Select Case D
Case 0
 Exit Sub
Case 1
 Sprite scroll 0,-1
Case 2
 Sprite scroll -1,0
Case 3
 Sprite scroll 0,1
Case 4
 Sprite scroll 1,0
End Select
Inc SHIFT
End Sub

DefineFont #8
06200808
00000000 00000000 000000ff 00000000
80808080 80808080 808080ff 80808080
663c1800 00183c66 dbdb7e3c 3c66dbff
End DefineFont

Edited 2026-01-04 20:03 by javavi
 
     Page 10 of 10    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026