Posté le 18/03/2022 23:21
Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 240 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements
Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd
Citer : Posté le 19/03/2022 01:05 | #
That shouldn't cause any flashing
Cls does not update the display, only the vram
and that code runs very fast on my calculator
You're not mixing up Cls with ClrText and Text with Locate are you?
ClrText and Locate are for Text Mode
Cls and Text are for Graphical Mode
Citer : Posté le 19/03/2022 09:00 | #
It absolutely does; everything in Casio BASIC is direct-mode, with an update at every command. You might remember it's one of its main flaws
Il n'y a pas de façon "simple" d'effacer une portion de l'écran. Le plus commun, en fait c'est d'écrire des espaces avec Text pour effacer des carrés de 3×5.
Ce que tu peux faire dans ton cas, c'est simplement :
Text Y,X, " "
Isz X
Isz Y
Text Y,X,"Texte"
Goto 1
Note que si tu te déplaçais uniquement en X tu pourrais écrire directement " Texte" (espace au début) ou "Texte " (espace à la fin) pour effacer ta trace.
Et sur une note tout à fait indépendante, je suggère d'utiliser des boucles For/While autant que possible, le Goto ça ne t'emmènera pas très loin en comparaison
Citer : Posté le 19/03/2022 09:02 | #
J'avais déjà testé ce matin, ça ne change rien pour l'affichage de "Texte", ça clignote toujours autant.
C'est surtout parce que le texte se déplace rapidement donc on le voit mal à cause de l'écran, je crois pas qu'on puisse y faire grand chose ^^'
Citer : Posté le 19/03/2022 09:05 | #
Ah ! J'avais pas pensé à ça. Oui si la boucle va tellement vite que le texte reste effacé plus longtemps qu'il ne reste affiché, ça ne risque pas d'aller. J'ai supposé qu'il faisait des trucs plus compliqués... :x
J'ai pas la calto pour tester là tout de suite mais si tu réarranges peut-être que ça va un poil mieux ?
Isz X
Isz Y
Text Y-1,X-1," "
Text Y,X,"Texte"
// Voire insérer un For ici
Goto 1
Mais effectivement je connais pas de solution sérieuse aux problèmes de timings qui apparaissent ensuite x)
Citer : Posté le 19/03/2022 11:59 | #
It absolutely does; everything in Casio BASIC is direct-mode, with an update at every command. You might remember it's one of its main flaws
Almost every display command updates the screen
two commands I know that don't follow this rule is cls and BG-Pict
and I don't think BG-Pict actually updates the vram
I think cls writes the background to vram, with BG-None (aka BG-Pict 0) being hardcoded to blank (or just a seperate clear vram function)
https://www.planet-casio.com/Fr/forums/topic15950-1-effacer-un-pixel-dessine-par-le-drawstat.html#170535
https://www.planet-casio.com/Fr/forums/topic15950-1-effacer-un-pixel-dessine-par-le-drawstat.html#170545
By 'flashing', do you mean ghosting?
where you are able to see the text multiple times because the display is slow?
or is the text moving too fast that it appears gray instead of black?
you can slow down the program with just a For 1->T To 50: Next loop
Citer : Posté le 19/03/2022 18:46 | #
By 'flashing', do you mean ghosting?
where you are able to see the text multiple times because the display is slow?
or is the text moving too fast that it appears gray instead of black?
you can slow down the program with just a For 1->T To 50: Next loop
I mean that the text is displayed but its removed right after, so it becomes gray, and it repeats itself. Can you explain me what you mean by "slow down the program" ?
Isz X
Isz Y
Text Y-1,X-1," "
Text Y,X,"Texte"
Goto 1
Alors, j'ai essayé, mais le problème persiste. Par contre, jme suis dis que ça serait mieux d'effacer le texte après l'avoir affiché. Donc plutôt quelque chose comme ça:
Isz X
Isz Y
Text Y,X,"Texte"
Text Y-1,X-1," "
Goto 1
Mais ça marche pas non plus ahah
Citer : Posté le 19/03/2022 21:49 | #
Sorry I had my calculator overclocked
I now see what you're concerned about
I unclocked it and noticed something very peculiar (was super painful to navigate)
display commands write the vram to screen once before their operation, then they do it again after their operation
So whats happening with you program is the cls command clears vram only, it does not copy the vram to the display
Then the Text copies vram to the display, writes the string "Texte" to the vram, then copies the vram to the display
This is whats causing the flickering
Copying from vram to screen is already very slow, and now I realise that basic does it twice per draw command!
and from what I can see, Text mode (Locate X, Y, "Texte"), does not have this issue
which would explain why its just that little bit faster
I also just noticed that F-Line updates the screen after every single pixel
so a line of 127 pixels would update the screen 128 times!! (maybe even 129 times)
Text does draw the entire text to vram first before updating the screen. so its only twice (that I can see)
Citer : Posté le 19/03/2022 21:54 | #
so a line of 127 pixels would update the screen 128 times!! (maybe even 129 times)
Are you sure about this one? I just compared rendering 63 lines of length 2 vs. 63 lines of length 127, and there is no appreciable difference in performance. Considering updating the display (1-2.5 ms) is much slower than drawing some pixels (couple of µs), I should have observed a 60x slowdown.
Citer : Posté le 20/03/2022 08:20 | #
Im not sure
maybe underclocking messes with too many things
Heres a small video showcasing it
Notice how the screen is cleared instantly
and also how both lines are drawn from two different sides
But the line takes quite some time to complete
maybe the screen refresh is done on an interrupt
and when I was navigating the menu's the whole screen almost gets drawn instantly (maybe a 100ms delay)
Lbl 0
Cls
F-Line 127, Y, 1, Y
Isz Y
F-Line 1, Y, 127, Y
Goto 0
Citer : Posté le 20/03/2022 08:49 | #
Sounds like an regular/interrupt-based refresh is possible. Clearly the lines are drawn from different sides at least. But this looks super-slow for a single line. How fast is the calculator/video here?
Citer : Posté le 20/03/2022 09:16 | #
The calculator has been underclocked to 0.23MHz from its normal 29.49MHz
The video is at normal speed 1x
Citer : Posté le 20/03/2022 09:47 | #
Ah, that's the problem. With a 100x slowdown, the transfer time to the VRAM, which is at least 1 ms, probably takes around 100 ms, during which the display refreshes at least 6 times. That doesn't explain why the lines appear in rendering order, but I'm pretty sure twisting the CPU speed/display speed factor this much is a general problem.