|
Forum Index : Microcontroller and PC projects : Simple
| Author | Message | ||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5540 |
Thanks Leo, That is a nice project, designing a pipelined 8 bit computer. The thing is 2.5 times faster than the X16 at half the clock frequency (4 vs 8MHz). Very interesting.. Volhout PicomiteVGA PETSCII ROBOTS |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
also crazy Edited 2025-12-05 20:11 by Martin H. 'no comment |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8374 |
Love it! But the flickering plays havoc with my epilepsy, I couldn't watch much of it :( Really cool and nerdy though. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| marcos_lm Newbie Joined: 13/11/2025 Location: SpainPosts: 9 |
Peter, that’s incredible — I never expected pure Basic to go that fast. I’ll definitely go through your changes when I get some quiet time, it’s really inspiring. I’d also like to add your optimized version to my repo later (with proper credit). Thanks a lot for taking my little demo this far! |
||||
| marcos_lm Newbie Joined: 13/11/2025 Location: SpainPosts: 9 |
Peter, just to add some info about the CSUB version. I’m quite new to compiling for ARM (this is literally my first time using GCC for Cortex cores), so I’m still learning the process. I’m building the CSUB with these flags: -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -O3 and using the simple linker script and armcfgen (everything in .text at 0x00000000, 64KB range). On my PicoMite HDMI/USB with RP2350 it works perfectly on the stable firmware 6.00.03. But with 6.01.00RC23 and RC24 the PicoMite resets as soon as the CSUB decoder runs, even though I’m using the exact same build. Maybe something changed internally in how CSUBs are loaded or called? I’m not sure if I should adjust my compile options or if it might be a regression in the RC builds. If it helps, I can test any small CSUB or try different GCC settings. Edited 2025-12-09 06:09 by marcos_lm |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2873 |
Few people use CSubs on the PicoMite for the reason you have found. Mostly they only work on the firmware version that they were compiled for. Constant firmware updates make frequent re-compiling necessary. Where they are most useful is in an embedded controller, as they usually don't need updating for the rest of their working life. . Edited 2025-12-09 07:25 by phil99 |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10715 |
Try changing the address in PicoCfunction.h to 0x10000234 Don't know why it has changed - compiler or linker or sdk change - who knows |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
This is a (3 Sec) brief feasibility test using Polygons in mmb 4 Windows. The data would then be stored in an external file. In addition, there is still much to optimize (counting duplicate frames, etc.). Poly.zip ![]() Edited 2025-12-09 19:38 by Martin H. 'no comment |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
Here we have the full La Linea 10 Video for the Pico, using Polygons. Need option resolution 640x480 378 MHz to stay in Sync with the Audio Have Fun Martin Edited 2025-12-11 21:38 by Martin H. 'no comment |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5540 |
Very nice !! At 252MHz it is nice in sync until the first explosion, after that video lags (and keeps lagging) at a constant 600ms. But very very nice Martin !! Volhout P.S. I am sure you tried this, to convert the audio file to FLAC. That shrinks the file, so less CPU time is needed to read from SD card. As for the video files, these are readable characters. But since your coordinates surpass 255, changing them to bytes would not help much. P.P.S. I just realized the polygons are the background, not the lines. Remarkable. Edited 2025-12-11 22:36 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
Volhout, the video should run at 25 FPS, i.e. 40 ms per frame. Even at 378 MHz, the “longest frame” takes 51 ms, but this is not noticeable and the video remains synchronized. The audio is 16 kHz 8-bit mono. No, I haven't tried flac yet, but it's a good idea. --- I first reduced the video to 320x240 using Handbrake and then exported it as individual frames using VirtualDub. For vectorization, I use the Douglas-Peucker algorithm and had gemini write a JScript for it, although I still had to modify the output file again with the hex editor, . render3.zip Because it still wrote the color value after each “-1” (end of page). In addition, he used the RGB value instead of the color value Col (8), so I had to swap that with search/replace.(The RGB values differ between MMB4Windows and Picomite.) Cheers Martin 'no comment |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5540 |
Martin, I was wondering, also because the thing is called "line", would it be more efficient to draw lines from an/multiple array(s). With the multitude of individual elements on screen, the number of polygons could also be huge. Volhout PicomiteVGA PETSCII ROBOTS |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
Volhout, When rendering to polygons for the first time, the output - file was 38MB in size. It worked under mmb4w, but absolutely not on the Pico. I had previously considered converting the individual images to SVG, but our polygons cannot handle Bézier curves. Of course, this can be done using software, but then it takes too long for real-time rendering. And manually reworking over 3886 individual images was just too much work for me. One could also try converting it using the RLE method from marcos_lm, but I was more concerned with the feasibility using polygons. cheers Martin 'no comment |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10715 |
Turtle graphics can handle bezier curves and has a fill capability and also the new FILL command can fill in any bounded area |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5540 |
Hi Martin, Slight change to your player. You create a framerate with variable PAUSE statements. But PAUSE cannot get negative, so if you exceed the 40ms in one frame, there is no recovering. This could be slightly better, it allows fast frames to be used for compensation of slow frames. Not perfect, but better on my 252MHz RP2040 VGA system. Play_HdL.zip Volhout Edited 2025-12-12 01:59 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
| marcos_lm Newbie Joined: 13/11/2025 Location: SpainPosts: 9 |
Martin, brilliant! Seeing this done with polygons on the Pico is super inspiring. Thanks for sharing! |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
Great, I'll give that a try. I noticed that you assigned a fixed value to the background color- I included the color coding in the “stream” because I wanted to leave open the option of changing the background color depending on the character's mood, similar to the original. I didn't use that in this demo, but the variable wait time is a good idea. 'no comment |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
Good Morning Volhout, i tested the your Play Version and the use of Flac. To me it looks fine @ 252000 on RP2350 To convert the Wav to Flac I used the cloudconvert Website which shrinks it down to 1572763 Bytes. Thanks for your support. Cheers Martin 'no comment |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5540 |
Hi Martin, Good to hear it plays fine at 252MHz. I removed the color association in an effort to speed things up, and since the demo video only showed white and myrtle, I hard-coed these. But it made no noticable difference in speed (there is only 2 array elements in each (huge)polygon..). Thanks for showing us(me) how to do this. Did you notice Peter's idea to look at turtle graphics ? Regards, Volhout PicomiteVGA PETSCII ROBOTS |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1331 |
I removed the DrawPolygon Sub and placed the Code direct in the Main Loop, that looks not so nice but might also save some ms. I have never worked with turtle graphics before. It also involved converting the individual images to SVG beforehand, which very often uses Bezier curves. To do this, you would either have to adapt the player to interpret SVG or write a converter. I tried something like an SVG- Interpreter two years ago, but failed because of the fill algorithm (the return buffer took up too much space). CLS :font 1 Now that we have turtle graphics and a fill command, we could of course start again here. Feel free to make suggestions and improvements. GBLX=1000:GBLY=1000 Xres=MM.HRes:Xstp=Xres/GBLX Yres=MM.VRes:Ystp=Yres/GBLY MP%=0 open "ctest.svg" for Input as #1 dim integer sc=1,x=0,y=0,XA=1,YA=1,XB1,XB2,YB1,YB2,fn dim p%(127,2) 'testcurve do line input #1,a$:a$=decomma$(a$) if MP% then draw_path (a$) end if if left$(a$,5)="<path" then MP%=1 loop until eof(#1) close #1 Sub draw_path(PTH$) Local last$="" Do cm$=left$(PTH$,1):pth$=lcut$(pth$,1) Select Case cm$ case "z" last$="" exit sub Case "M" last$="M" fn=Instr(pth$," "):XA=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(1,pth$," "):YA=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) Case "l" last$="l" fn=Instr(pth$," "):X=int(.5+val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):Y=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) Line XA*xstp,YA*ystp,(XA+x)*xstp,(YA+y)*ystp:XA=X:YA=Y Case "C" Last$="C" fn=Instr(pth$," "):tmp$=left$(pth$,fn) XB1=int(.5+Val(tmp$)):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):YB1=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):XB2=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):YB2=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):X=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):Y=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) beziercubic XA,YA,XB1,YB1,XB2,YB2,X,Y,40 XA=X:YA=Y Case Else Select Case last$ Case "l" fn=Instr(pth$," "):Y=Val(left$(pth$,fn)):pth$=lcut$(pth$,fn) Line XA*xstp,YA*ystp,(XA+x)*xstp,(YA+y)*ystp:XA=X:YA=Y Case "C1" fn=Instr(pth$," "):tmp$=left$(pth$,fn) XB1=int(.5+Val(tmp$)):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):YB1=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):XB2=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):YB2=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):X=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) fn=Instr(pth$," "):Y=int(.5+Val(left$(pth$,fn))):pth$=lcut$(pth$,fn) beziercubic XA,YA,XB1,YB1,XB2,YB2,X,Y,40 XA=X:YA=Y End Select End Select if pth$="" then line input #1,a$:pth$=decomma$(a$) if eof (#1) then exit do Loop End Sub ' function lcut$(in$,num%) if len(in$) <1 then lcut$="" else lcut$=right$(in$,len(in$)-num%) end function ' function decomma$(ein$) local fn=0 do fn=instr(ein$,",") if not fn then exit do mid$(ein$,fn,1)=" " loop decomma$=ein$ end function '--------------- 'Translation of the BBC Version 'https://rosettacode.org/wiki/Bitmap/B%C3%A9zier_curves/Cubic#BBC_BASIC Sub beziercubic(x1%,y1%,x2%,y2%,x3%,y3%,x4%,y4%,n%) Local i%,t,t1,a,b1,c,d For i%=0 To n% t=i%/n%:t1=1-t:a=t1^3:b=3*t*t1^2:c=3*t^2*t1:d=t^3 p%(i%,1)=INT(a*x1%+b*x2%+c*x3%+d*x4%+.5) p%(i%,2)=INT(a*y1%+b*y2%+c*y3%+d*y4%+.5) Next For i%=0 To n%-1 line p%(i%,1),p%(i%,2),p%(i%+1,1),p%(i%+1,2) Next End Sub 'Translation of the BBC Version 'https://rosettacode.org/wiki/Bitmap/B%C3%A9zier_curves/Quadratic#BBC_BASIC sub bezierquad(x1%,y1%,X2%,y2%,X3%,y3%,n%) Local i%, t, t1, a, b, c, p%(n%,2) For i%=0 To n% t=i%/n%:t1=1-t:a=t1^2:b=2*t*t1:c=t^2 p%(i%,1)= INT(a*x1%+b*X2%+c*X3%+.5) p%(i%,2)= INT(a*y1%+b*y2%+c*y3%+.5) Next For i%=0 To n%-1 line p%(i%,1),p%(i%,2),p%(i%+1,1),p%(i%+1,2) Next end sub But that's a whole other story and shouldn't go beyond the scope of this Post. Cheers Martin Edited 2025-12-12 18:16 by Martin H. 'no comment |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |