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 : PicoMite: FrameBufffers
Page 2 of 2 | |||||
Author | Message | ||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
A new thread ok, when I got code to show. Your idea is valid but not for beginners.. Hope you sort it and share. take care Tom, stan, usually off piste |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
Does CLS work on the framebuffer or always on the main display? Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9129 |
What happens to f in the loop and therefore why is n always blank? |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
Am I having a senior moment, I still don't see it: FRAMEBUFFER Create ' N is blank, F is blank FRAMEBUFFER Write F Text 50, 50, "Hello World" ' N is blank, F contains "Hello World" FRAMEBUFFER Copy F, N ' N and F contain "Hello World" ' i.e. "Hello World" appears on the display Pause 2000 Do ' N and F contain "Hello World", L does not exist FRAMEBUFFER Layer ' N and F contain "Hello World", L is blank FRAMEBUFFER Copy F, L ' N, F and L all contain "Hello World" CLS ' N and L contain "Hello World", F is blank FRAMEBUFFER Copy F, N ' N and F are blank, L contains "Hello World" ' i.e. "Hello World" disappears from the display Pause 2000 FRAMEBUFFER Copy L, F ' N is blank, F and L contain "Hello World" FRAMEBUFFER Copy F, N ' N, F and L all contain "Hello World" ' i.e. "Hello World" reappears on the display. Pause 2000 FRAMEBUFFER CLOSE L ' N and F contain "Hello World", L does not exist (same as first time through loop) Loop State is the same at the beginning and end of the loop, so "Hello World" should disappear and then reappear every time we go through the loop shouldn't it ? Note that as I understand it the difference between the behaviour of F and L never manifests because we never copy L to N. Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
I thought so too... ' Write Hello World to "F" and copy to the display N F L. 1 FRAMEBUFFER Write F _ _ x 2 Text 50, 50, "Hello World" _ HW x 3 FRAMEBUFFER Copy F, N HW HW x ' *** Display should now show "Hello World" 4 Pause 2000 HW HW x 5 Do ' Create "L" and copy "F" to "L" 6 FRAMEBUFFER Layer HW HW _ 7 FRAMEBUFFER Copy F, L HW HW HW ' Clear "F" and copy to the display. 8 CLS HW _ HW 9 FRAMEBUFFER Copy F, N _ _ HW ' *** Display should now be blank. 10 Pause 2000 _ _ HW ' Copy "L" to "F" and then "F" to display. 11 FRAMEBUFFER Copy L, F _ HW HW 12 FRAMEBUFFER Copy F, N HW HW HW ' *** Display should now show "Hello World" 13 Pause 2000 HW HW HW ' Close "L" 14 FRAMEBUFFER CLOSE L HW HW x 15 Loop Edited 2023-06-25 16:22 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9129 |
The second statement in the loop copies f to l. But from the second time round the loop f is blank because of the CLS |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
Except after the CLS, line 11, as per Mixtel90's numbering, copies L (Hello World) to F so it is not blank the second time around the loop . Best wishes, Tom Edited 2023-06-25 17:50 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
Hi Peter, I'm still hoping for an explanation I can understand . In the meantime is this supposed to work ? PicoMite MMBasic Version 5.07.07 Copyright 2011-2023 Geoff Graham Copyright 2016-2023 Peter Mather > option list PicoMite MMBasic Version 5.07.07 OPTION SYSTEM SPI GP6,GP3,GP4 OPTION CPUSPEED (KHz) 252000 OPTION LCDPANEL ILI9341, RLANDSCAPE,GP2,GP1,GP0 OPTION GUI CONTROLS 2 OPTION TOUCH GP5,GP7 GUI CALIBRATE 0, 4034, 2040, -2600000, -64285 <== Ignore, broken touch OPTION SDCARD GP22 OPTION AUDIO GP20,GP21, ON PWM CHANNEL 2 > FrameBuffer Create > FrameBuffer Copy N, F Error: Invalid address - resetting PicoMite MMBasic Version 5.07.07 Copyright 2011-2023 Geoff Graham Copyright 2016-2023 Peter Mather Best wishes, Tom Edited 2023-06-29 19:37 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
As I see, you try to copy from a non existend Buffer (N) There is no reserved screenmemory in a non VGA Picomite. just my 2 cents 'no comment |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
The FRAMEBUFFER commands work in 5.07.07 for both versions now (for LCD panels it's only SPI colour, I think). I really must print out a new manual. A lot has happened since 5.07.03... Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
Ah, perhaps that's it; in which case there should be a proper ERROR. However I thought Peter had indicated this was possible for a MISO enabled display where N would refer to the actual display and copying from it to the C or L framebuffers was supported ... though the colours would obviously be converted to 4-bit in the process, so not the fastest operation. Is this not the case ? Best wishes, Tom Edited 2023-06-29 21:48 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9129 |
It's a bug (typo). Will post a fix when I've finalised the changes in PIO DMA |
||||
ice2642 Regular Member Joined: 27/05/2023 Location: BrazilPosts: 82 |
I am using here PicoMite VGA, and the framebuffer is working well, but I do not know if it is possible to create more layers. [code] CLS FRAMEBUFFER create FRAMEBUFFER layer Dim float vertices(2,7)=(-1,1,-1, 1,1,-1, 1,-1,-1, -1,-1,-1, -1,1,1, 1,1,1, 1,-1,1, -1,-1,1) Dim integer facecount(5)=(4,4,4,4,4,4) Dim integer faces(23)=(0,1,2,3, 1,5,6,2, 0,4,5,1, 5,4,7,6, 2,6,7,3, 0,3,7,4) Dim integer colours(6)=(RGB(red),RGB(green),RGB(red), RGB(blue), RGB(red), RGB(yellow), RGB(cyan)) Dim integer edge(5)=(6,6,6,6,6,6) Dim integer fill(5)=(0,1,2,3,4,5) Dim n=1,nv=8,nf=6,camera=1 Dim zz =1, zy=1,zx=1 Math scale vertices(),100.0,vertices() Draw3D create n,nv,nf,camera,vertices(),facecount(),faces(),colours(),edge(),fill() Dim integer viewplane=400 Draw3D CAMERA n,viewplane Dim integer x=0,y=0,z=900 MODE 2,4 Font 3 FRAMEBUFFER write l Draw3D show n,x,y,z Dim float yaw=Rad(1),pitch=Rad(2),roll=Rad(0.5) Dim float q(4) Dim escala(5)=(132,148,165,175,198,247) Do FRAMEBUFFER copy l,n Math q_euler yaw,pitch,roll,q() Draw3D rotate q(),n Draw3D show n,x,y,z Inc yaw, Rad(1) Inc pich, Rad(2) Inc roll, Rad(0.5) Pause 1.3 x=x+zz y=y+zy z=z+zx nota=nota+1 If nota> 5 Then nota = 1 Play tone escala(nota),0,100 Print @(10,10) " Marcio Esper 2023" If x > 270 Then zz = -1 If x < -270 Then zz = 1 If y > 110 Then zy=-1 If y < -140 Then zy =1 If z >3290 Then zx =-2 If z < 600 Then zx =1 Loop [/code] Best regards, MMBasic 5.0707 on PicoMite VGA |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
As I understand it: On the PicoMiteVGA: Every framebuffer costs you 37.5K of RAM hence there only being at most 3: N (always exists and is what is actually displayed on the VGA screen, but doesn't come from variable memory), C and L. On the standard PicoMite: Also has up to 3 buffers, but N does not refer to a RAM framebuffer it refers to the buffer/memory of the display hardware itself, e.g. ILI9341. If the display hardware doesn't support MISO (i.e. you can't blit from it) then you can copy to N, but you can't copy from N - the "bug" is that copying from N isn't currently working in a case where it should be. Best wishes, Tom Edited 2023-06-29 23:05 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Page 2 of 2 |
Print this page |