|
Forum Index : Microcontroller and PC projects : CMM2 graphics questions
| Author | Message | ||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
to LeoNicolas: thank you a lot for your thoughts. you wrote: "If you are not syncing your write operation to the screen buffer with the logic that is reading from the same buffer, your write operation can be blocked while trying to write to the same address the reading operation is accessing, leaving that address in memory with its old content, and creating the artifacts we saw in you app." -good idea perhaps geoffg or matherp or disco4now will read this to give a complete answer... soon i will use your 2-buffer concept... Edited 2026-05-22 05:52 by hhtg1968 |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4332 |
The write operation would not need to be blocked, it would be enough that the screen memory is being read at the same time you write to it. If the reading goes past where you have partly written then it gets what you have written but also the old data you have not yet replaced. It's a sort of race (hardware reading, your program writing). You can either use a framebuffer that isn't being displayed by the hardware, so your writes cannot be involved in a race, or GETSCANLINE to make sure you're not writing in the wrong place at the wrong time. John |
||||
| LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 582 |
John, your answer makes sense for the flickering problem. My answer was for the artifacts that are persistent in the screen. it's just a guess. I think the screen buffer is becoming dirty because the blocked write operations. Do you have any theories? |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4332 |
I think due to the race artefacts might be more common than flickering. Carefully avoiding the issue should fix both. John Edited 2026-05-22 17:14 by JohnS |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
Thanks to JohnS too. i will test it with "GETSCANLINE" too. i think I will have time at the beginning of june. @JohnS: do you have watched my movies at youtube? error movies Edited 2026-05-22 18:48 by hhtg1968 |
||||
| LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 582 |
John The changes I put in place solved the issue. The code is on a link in one of my previous responses |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4332 |
I don't youtube much, sorry. John |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
ok. i can upload such a video. colour maximite 2 drawing disc with errors.mp4.zip |
||||
| LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 582 |
hhtg1968 Can you post your source code here or share its github repo? I can take a look and fix the problem |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 204 |
yes of course i can put the code here. hp.bas.zip but that is the code you already have (i think so) but i will change it myself... (or myself too). and you can try it too if you have enough time. as i told, i will get my cmm2 back in june... the open question for me is how the artefacts exactly arise... (you and johnS helped a lot). my favorite is that writing in screen memory is blocked while it is read out for the display or something like that... Edited 2026-05-26 17:48 by hhtg1968 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |