Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:22 24 Nov 2024 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 1 of 5    
Author Message
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 04:50pm 15 Aug 2024
Copy link to clipboard 
Print this post

DEMO: PCB Router


DefineFont #9
08300C08
00000000 00000000 00000000 667E3C18 C3C3C3C3 183C7E66
18181818 18181818 18181818 00000000 00FFFF00 00000000
18181818 00E0F038 00000000 18181818 00070F1C 00000000
00000000 38F0E000 18181818 00000000 1C0F0700 18181818
End DefineFont
Dim upSet(7)=(&hCB,&hFD,&h36,&hC3,&hCB,&hCB,&h36,&h36)
Dim lfSet(7)=(&hA7,&hFD,&hA7,&h5A,&hA7,&h5A,&hA7,&h5A)
Dim upEstr(79)

Font 9: CLS
Do
 lfE=0
 For i=0 To 79
   upE=upEstr(i)
   xxSet=upSet(upE) And lfSet(lfE)
   Do
     tmp=Int(Rnd*8)
   Loop Until xxSet And (1<<tmp)
   lfE=tmp
   upEstr(i)=tmp
   Color RGB(Green)
   If tmp=1 Then Colour RGB(Yellow)
   Print Chr$(tmp+48);
   Pause 1
 Next
Loop
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4222
Posted: 06:01pm 15 Aug 2024
Copy link to clipboard 
Print this post

Nice! Will try when I get home...
PicomiteVGA PETSCII ROBOTS
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 10:26am 17 Aug 2024
Copy link to clipboard 
Print this post

Incredible Knot


Font 9
Do
 For n=1 To 1200
   Print Chr$(Rnd*7+32);
 Next
 Pause 2000
 Print @(0,0);
Loop

DefineFont #9
08201010
C003C003 C003C003 C003C003 DFFBDFFB DFFBDFFB C003C003 C003C003 C003C003
C003C003 0000E001 FC03F001 FFF0FFC7 E3FF0FFF 800FC03F 80070000 C003C003
C003C003 C003C003 0000C003 FFFFFFFF FFFFFFFF C0030000 C003C003 C003C003
C003C003 80078007 402F000F 77EF63EF F7C6F7EE F000F402 E001E001 C003C003
C003C003 8007C007 003F800F 1FFC07FE 7FE03FF8 F001FC00 E003E001 C003C003
C003C003 E003E003 FC01F001 7FF8FFE0 0FFE3FFC 800F003F C0078007 C003C003
C003C003 8007C007 003F800F 1FFC07FE 7FE03FF8 F001FC00 E003E001 C003C003
C003C003 E001E003 FC00F001 3FF87FE0 07FE1FFC 800F003F C0078007 C003C003
End DefineFont

Edited 2024-08-17 20:31 by javavi
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 04:43pm 19 Aug 2024
Copy link to clipboard 
Print this post

Random Color Checkboxes & Sound Tones


Do
 x=Int(Rnd*80)
 y=Int(Rnd*40)
 s=Int(Rnd*7)+128
 Colour Int(Rnd*&hFFFFFF)
 Print @(x*8,y*12) Chr$(s);
 Inc c
 If c>500 Then
   c=0
   Play tone Rnd*2000,Rnd*2000,200
 EndIf
Loop While Inkey$=""
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 11:51am 24 Aug 2024
Copy link to clipboard 
Print this post

Windows Serenity


MODE 2
Dim CM(15)=(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
Colour Map CM(),CM()
W=0:E=Sqr(3):F=Sqr(7):Dim S(180)

For I=0 To 180: S(I)=Sin(Rad(2*I)): Next

For X=0 To 320
 For Y=0 To 240
   K=32:G=0

   For H=1 To 2
     A=(X+180)/K: B=Y/K: C=Int(A): D=Int(B)
     G=G+(FNS(C,D)+FNS(C+1,D)+FNS(C,D+1)+FNS(C+1,D+1))
     K=K/2
   Next

   G=Int((G+W+X/320)/3)*15
   If G=0 Then
     G=7
     If (X+Y)/416>W Then G=1
   EndIf

   If Y<20*(S((X*.4+20)Mod 180)+3) Then
     G=6
     If S(((X+3*Y)/4+10)Mod 180)<W Then G=2
   EndIf

   Color CM(G)
   Pixel X,240-Y

   W=W+E-Int(W+E)
 Next
Next

Function FNS(U,V)
 Q=(U*E+V*F)-Int(U*E+V*F)
 T=1-(A-U)*(A-U)-(B-V)*(B-V)
 If T<=0 Then FNS=0 Else FNS=(3-2*T)*T*T*Q
End Function

 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4222
Posted: 01:21pm 24 Aug 2024
Copy link to clipboard 
Print this post

Dear Javavi,

I like your first demo a lot. Maybe because I am in electronics. The others where nice also, but this last one, that packs a picture, all to familiar to us, in a set of mathematical calculations tops them all.

I am always intrigued by what math can do. As such I am also impressed with AI, but that is different. This is simple math at the basis of graphics.

Thank you for creating/sharing

Volhout
PicomiteVGA PETSCII ROBOTS
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 05:41pm 24 Aug 2024
Copy link to clipboard 
Print this post

  Volhout said  
Thank you for creating/sharing

I confess! Of course, I didn't write these formulas myself, I just shamelessly copied them from the BBS micro demos on MMBASIC.
I'm just trying to encourage the community to write similar demos to promote PicoMite in the VGA version, and in the near future I hope for the HDMI version as well.
With respect, Javavi
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 06:45am 25 Aug 2024
Copy link to clipboard 
Print this post

Mysteries of Deep Space


Do
CLS
TILE 0,0,Rnd*&hF0F0F0,0,80,40
For G=-Rnd*42 To 400
 tt=Rnd*99:qq=Rnd*99
 vv=Rnd*480:uu=Rnd*640
 A=Rnd*3
 R=90/(1+Rnd*200)
 Q=1+3*(.5+Rnd/2)
 aa=1+3*Rnd^2:M=1
 If Rnd*9<4 Then Q=R:t=0:qq=0:A=0:M=Pi/3:aa=1
 C=(1+3*Rnd^2)*R*R
 For ii=0 To C
   S=-Log(Rnd):T=ii*M
   U=S*R*Sin(T):V=S*Q*Cos(T)
   T=S*A
   X=U*Cos(T)+V*Sin(T)
   Y=V*Cos(T)-U*Sin(T)
   D=(X*X+Y*Y)/(R*R+Q*Q)
   Z=99*((2.7^-D)+.1)
   Z=Z*(Rnd-.5)^3
   yy=Y*Cos(tt)+Z*Sin(tt)
   Z=Z*Cos(tt)-Y*Sin(tt)
   xx=uu+X*Cos(qq)+yy*Sin(qq)
   yy=vv-X*Sin(qq)+yy*Cos(qq)
   Pixel xx,yy
 Next
Next
Loop
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 02:33pm 25 Aug 2024
Copy link to clipboard 
Print this post

Beautiful. Amazing what 30 lines of code can do. Thanks for working these out, and hope more is to come.

To run with ILI9341 LCD, I commented out the TILEs line, changed the sizing to:

vv=Rnd*240:uu=Rnd*320

and added the color purple to the PIXEL command:

Pixel xx,yy,RGB(160, 32, 240)


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 10:50am 26 Aug 2024
Copy link to clipboard 
Print this post

  lizby said  Beautiful. Amazing what 30 lines of code can do. Thanks for working these out, and hope more is to come.
To run with ILI9341 LCD, I commented out the TILEs line, changed the sizing


On such screens, "The Mystery of Deep Space" can be viewed in color ;))

MODE 2
Do
CLS
For G=-Rnd*42 To 400
tt=Rnd*99:  qq=Rnd*99
uu=Rnd*320: vv=Rnd*240
A=Rnd*3
R=90/(1+Rnd*100)
Q=1+3*(.5+Rnd/2)
aa=1+3*Rnd^2: M=1
If Rnd*9<4 Then Q=R:T=0:qq=0:A=0:M=Pi/3:aa=1
C=(1+3*Rnd^2)*R*R
Color Rnd*&hFFFFFF
For i=0 To C
  S=-Log(Rnd):  T=i*M
  U=S*R*Sin(T): V=S*Q*Cos(T)
  T=S*A
  X=U*Cos(T)+V*Sin(T)
  Y=V*Cos(T)-U*Sin(T)
  D=(X*X+Y*Y)/(R*R+Q*Q)
  Z=99*((2.7^-D)+.1)
  Z=Z*(Rnd-.5)^3
  y0=Y*Cos(tt)+Z*Sin(tt)
  Z=Z*Cos(tt)-Y*Sin(tt)
  x0=uu+X*Cos(qq)+y0*Sin(qq)
  y0=vv-X*Sin(qq)+y0*Cos(qq)
  Pixel x0,y0
Next
Next
Loop
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 12:06pm 26 Aug 2024
Copy link to clipboard 
Print this post

Great--thanks.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Canada_Cold
Newbie

Joined: 11/01/2020
Location: Canada
Posts: 37
Posted: 11:46pm 26 Aug 2024
Copy link to clipboard 
Print this post

Hi javavi,

Those are very cool little programs.  I ran both on a Picomite with a 2.8" LCD. I think I'll put one together with the second PGM and keep it on my workbench.  

Lizby, thanks for the tip on how to modify the first one, that's a big help.

Thanks to both of you.
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 05:24pm 27 Aug 2024
Copy link to clipboard 
Print this post

Windows


MODE 2
FRAMEBUFFER CREATE
FRAMEBUFFER WRITE F
Dim COL(5)=(RGB(Black),RGB(Red),RGB(Green),RGB(Blue),RGB(Cyan),RGB(Yellow))

Do
 CLS RGB(Cyan)
 For R=0 To 6
   For C=0 To 12
     S=C*1.25+2.5: If C>6 Then S=16
     V=FNA(C+Q)
     X=80+C*12
     Y=40+R*(16+(C<7)*1)+V
     IC=(1+2*(R>3)+(C>9)*((R>3)+1))*(R Mod 3>0)*(C<6 Or C Mod 3>0)
     Clr=COL(IC)
     Z=S/2.5: If C>6 Then Z=V-FNA(C+Q+1)
     X0=X:Y0=Y
     X1=X+S*.8:Y1=Y-Z
     X2=X:Y2=Y+S
     X3=X+S*.8:Y3=Y+S-Z
     Triangle X0,Y0,X1,Y1,X2,Y2,Clr,Clr
     Triangle X1,Y1,X2,Y2,X3,Y3,Clr,Clr
   Next
 Next
 Text 160,200,"Windows 98","CM",5,1,0,RGB(Cyan)
 FRAMEBUFFER COPY F,N,B
 Pause 5
 Inc Q,0.5
Loop

Function FNA(A)
 FNA=Sin(A/2.23)*12
End Function
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 07:27pm 29 Aug 2024
Copy link to clipboard 
Print this post

Barnsley Fern


Do
 Select Case Rnd
   Case Is < .01
       nX = 0
       nY = .16 * Y
   Case .01 To .08
       nX = .2 * X - .26 * Y
       nY = .23 * X + .22 * Y + 1.6
   Case .08 To .15
       nX = -.15 * X + .28 * Y
       nY = .26 * X + .24 * Y + .44
   Case Else
       nX = .85 * X + .04 * Y
       nY = -.04 * X + .85 * Y + 1.6
 End Select

 X = nX
 Y = nY

 pX= 640 * (X + 3) / 6
 pY = 480 - 480 * ((Y + 2) / 14)
 Pixel pX, pY

Loop Until Inkey$ <> ""
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 01:42pm 31 Aug 2024
Copy link to clipboard 
Print this post

Fractal Star


Do
 CLS
 A=2*(.5-Rnd): B=2*(.5-Rnd)
 C=2*(.5-Rnd): D=2*(.5-Rnd)
 X=Rnd: Y=Rnd
Do
 SX=Pi*2*X: SY=Pi*2*Y
 SX4=Pi*4*X: SY4=Pi*4*Y
 X1=A*Sin(SX)+B*Sin(SX)*Cos(SY)+C*Sin(SX4)+D*Sin(Pi*6*X)*Cos(SY4)
 Y1=A*Sin(SY)+B*Sin(SY)*Cos(SX)+C*Sin(SY4)+D*Sin(Pi*6*Y)*Cos(SX4)
 NX=Int(100*X1+320): NY=Int(100*Y1+240)
 Pixel NX,NY
 X=X1: Y=Y1
Loop Until Inkey$<>""
Loop
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 02:47pm 01 Sep 2024
Copy link to clipboard 
Print this post

Fedora Hat


RX=MM.HRes: RY=MM.VRes
P=RX/2: Q=216
XP=P*0.9: XR=1.5*Pi
YP=90: YR=1: ZP=90
XF=XR/XP: YF=YP/YR: ZF=XR/XP

For ZI= -Q To Q-1
 If ZI<-ZP Or ZI>ZP Then Continue For
 ZT=ZI*XP/ZP: ZZ=ZI
 XL=Int(0.5+Sqr(XP*XP-ZT*ZT))

 For XI= -XL To XL
   XT=Sqr(XI*XI+ZT*ZT)*XF: XX=XI
   YY=(Sin(XT)+0.4*Sin(3*XT))*YF
   SubPlotXY
 Next XI
Next ZI

Sub SubPlotXY
 X1= XX+ZZ+P
 Y1= RY-(YY-ZZ+Q)
 Pixel X1,Y1
 If Y1=0 Then End Sub
 Line X1,Y1+1,X1,RY, 1,0
End Sub
 
Canada_Cold
Newbie

Joined: 11/01/2020
Location: Canada
Posts: 37
Posted: 07:28pm 03 Sep 2024
Copy link to clipboard 
Print this post

Hi javavi,

Those are very cool little programs.   Thanks for posting these.  I ran them on the small LCD, and they look great.   I was impressed, so I built a VGA adapter to work with my dev boards.

Don
 
Canada_Cold
Newbie

Joined: 11/01/2020
Location: Canada
Posts: 37
Posted: 07:28pm 03 Sep 2024
Copy link to clipboard 
Print this post

Hi javavi,

Those are very cool little programs.   Thanks for posting these.  I ran them on the small LCD, and they look great.   I was impressed, so I built a VGA adapter to work with my dev boards.

Don
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 206
Posted: 06:58am 06 Sep 2024
Copy link to clipboard 
Print this post

  Canada_Cold said  Hi javavi,
Those are very cool little programs.   Thanks for posting these.  I ran them on the small LCD, and they look great.   I was impressed, so I built a VGA adapter to work with my dev boards.
Don

Hi Canada_Cold,
Thank you for your feedback on my exercises with MMBasic.
Despite the mono mode, I prefer working with a high resolution VGA 640x480.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9105
Posted: 07:00am 06 Sep 2024
Copy link to clipboard 
Print this post

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


640x480 in colour on the RP2350
 
     Page 1 of 5    
Print this page
© JAQ Software 2024