![]() |
Forum Index : Microcontroller and PC projects : PicoMite VT100 Mandelbrot
Author | Message | ||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1234 |
To test,how the Pico performes, compare to the old 8 Bit Computers, I translated Matt Heffernans small Basic Program to mmbasic. This Version uses the Terminal (VT100) for Output a Mandelbrot. The X / y Resulution is set by DX and DY In this case it is set to 32x22 as this is the same Resolution used in the "8 Bit Battle". The Pico performs in Basic much faster than the 8 Bit fellows in Assembler. (even the Commander x16 or the Spectrum Next) 'mandelbrot ' 'inspired by Matt Heffernan s 8-BIT BATTLE 'https://www.youtube.com/watch?v=DC5wi6iv9io 'for PicoMite is a Raspberry Pi Pico running the free MMBasic interpreter. 'and Putty or other VT100 emulation '2022 by M. Herhaus ' 'clear screen, home and cursor off Print Chr$(27);"[2J";Chr$(27);"[H";Chr$(27);"[?25l";Chr$(27);"(0"; Time$="00" ' max x and max y DX=32:DY=22 For py=0 To DY-1 For px=0 To DX-1 xz=px*3.5/DX-2.5 yz=py*2/DY-1 x=0 y=0 For i=0 To 14 If x*x+y*y>4 Then Exit For xt = x*x - y*y + xz y= 2 * x * y + yz x=xt Next i Print Chr$(27);"[";Str$(py+1);"H";Chr$(27);"[";Str$(px+1);"G"; 'at py+1,px+1 If i<8Then Print Chr$(27);"[";Str$(39+i);"m "; Else Print Chr$(27);"[";Str$(32+i);"ma"; EndIf Next px Next py 'cursor on Print Chr$(27);"[40m";Chr$(27);"[?25h";Chr$(27);"(B":Print Time$ 'no comment |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5090 |
Hi Martin, Pico does it in roughly 3.8 seconds (at 126MHz) tried on the VGA version. using Putty through serial interface USB, the mandelbrot shows nicely. Although there are some "a" characters in some of the cells. Not sure if the VT100 supports 16 colors. There is one advise I can give you: Replace: Time$="00" and print Time$ with Timer=0 and print Timer. Time$ and Date$ is the system time from the RTC (Real time clock). and when you set it to 0 , you loose your time reference. Timer is an independent variable that shows the time in ms (mili seconds). It does not change the system time Time$. Edited 2022-06-06 22:23 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5090 |
The VGA version of the program running in mode 2 on a picomite 5.07.05b5 Mapping of the colors is different, but can be tuned. Takes 1.2 seconds at 126MHz. 'mandelbrot ' 'inspired by Matt Heffernan s 8-BIT BATTLE 'https://www.youtube.com/watch?v=DC5wi6iv9io 'for PicoMite is a Raspberry Pi Pico running the free MMBasic interpreter. '2022 by M. Herhaus '2022 adaptation for picomiteVGA by Volhout ' 'clear screen, home and cursor off MODE 2 CLS 'read colours Dim color(15) For i=0 To 15 Read color(i) Next i 'MANDELBROTH Timer =0 ' max x and max y DX=32:DY=22 For py=0 To DY-1 For px=0 To DX-1 xz=px*3.5/DX-2.5 yz=py*2/DY-1 x=0 y=0 For i=0 To 14 If x*x+y*y>4 Then Exit For xt = x*x - y*y + xz y= 2 * x * y + yz x=xt Next i Box px*10,py*10,10,10,1,0,color(i) Next px Next py Print @(10,230) "time = ";Timer; Do :Loop While Inkey$="" End 'indexing the colors Data RGB(white),RGB(yellow),RGB(lilac),RGB(brown),RGB(fuchsia),RGB(rust) Data RGB(magenta),RGB(red),RGB(cyan),RGB(green),RGB(cerulean),RGB(midgreen) Data RGB(cobalt),RGB(myrtle),RGB(blue),RGB(black) Edited 2022-06-06 22:57 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
For MMBASICW (3GHz) 18 ms Micha? |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
duplicate Edited 2022-06-06 23:07 by Michal |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
I have a feeling that that 3GHz computer didn't cost 3.60 UKP. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5090 |
Yip, But 17.8ms is quite fast. And early 2010 laptops are cheap, can run Ubuntu, and MMB4W runs nice under WINE. 17.8ms... Anyway... the pico is 32 bit.. so not an 8bit challenge... Edited 2022-06-06 23:24 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1234 |
Thank you for your Response .. the "a" is the "Checkerboard Character" on VT100, depending on the Charset the terminel uses, as VT100 has just 8 Colors,I put it in as the "light" version of the Colors ;-) Edited 2022-06-07 00:06 by Martin H. 'no comment |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
PicoMite with: 3.5inch Touch Display Module for Raspberry Pi Pico, 65K Colors, 480×320, SPI https://www.waveshare.com/pico-restouch-lcd-3.5.htm 1,3 sec Michal |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
That's not a bad price for that Pico PCB with 480x320 LCD & SD card. Are there I/Os left over to do I2C to a MCP23017 module? Or maybe the SPI version would work. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |