venice1200 / MiSTer_tty2oled

👾 MiSTer Software Add-On showing Text or Pictures on a Display driven by an Arduino 👾
GNU General Public License v3.0
49 stars 10 forks source link

Need to clear certain areas, without clearing the entire screen #26

Closed Paradox closed 2 years ago

Paradox commented 2 years ago

I have been trying everything I can think of, and cannot figure out how to erase text, etc. in a certain area of the screen for purposes of redrawing just that area, as just sending new text doesn't completely overwrite the existing text, and, clearing the entire screen and rewriting everything causes blinking or flickering of the entire screen. it also might help if the "buffer" worked more like a real frame buffer, and running CMDCLS didn't also clear the buffer, but, that still wouldn't help in my case.

Paradox commented 2 years ago

I kind of figured this out by saving the previous text and flashing it with a color of 0 before printing the new text, but, it's working in one place, and, not another, it may be something I'm doing wrong, but, I'll continue to work on it, if there is no better answer.

venice1200 commented 2 years ago

Which tty2oled Firmware version are you using. Are you up-to-date? I am asking because of the different command modes.

V2: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command_v2 V1: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command

Command Mode V2 is for Greyscale, V1 is the older Mono-Color Version.

Paradox commented 2 years ago

I just looked again, and, it seems I typoed one of the vars... checking to see if it works, now, but, it would be nice to be able to do it, in a way that didn't flash the text.

Paradox commented 2 years ago

Which tty2oled Firmware version are you using. Are you up-to-date? I am asking because of the different command modes.

V2: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command_v2 V1: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command

Command Mode V2 is for Greyscale, V1 is the older Mono-Color Version.

As far as I know, V2 but, I fixed my typo, and, it works, but, of course, it blinks the text.

venice1200 commented 2 years ago

But you are on the right way overwriting the old text with an saved version. Thats what I do as well is such cases. But you can do this hidden (without screen refresh), if you are on the Greyscale Version, by adding 100 to the Font Number. See https://github.com/venice1200/MiSTer_tty2oled/wiki/Command_v2#command-cmdtxt In this case you see the result after the next update of the screen. Example: Clear with Screen Update: CMDCLS Write Text with Screen Update: CMDTXT,3,15,0,0,40,Test Hidden Overwrite without Screen Update: CMDTXT,103,0,0,0,40,Test Write new Text with Screen Update: CMDTXT,3,15,0,0,40,Toast There are some more Command with hidden functionalities.

The second way is to use a filled Rectangle. See: https://github.com/venice1200/MiSTer_tty2oled/wiki/Command_v2#command-cmdgeo But here you need to know more or less the correct area to fill.

Hope this helps.

Paradox commented 2 years ago

I got it to work without blinking. by writing both to the buffer and using CMDDUP

venice1200 commented 2 years ago

Depending on your needs you can write your text and directly overwrite it hidden. Means you don't need to save your previous text. But this doesn't work for all needs.

Do you publish your result/project?

Paradox commented 2 years ago

Depending on your needs you can write your text and directly overwrite it hidden. Means you don't need to save your previous text. But this doesn't work for all needs.

Do you publish your result/project?

I'm working on improving the TTY2OLED support (as well as many other parts of the script) for SAM. So, yes, it will be published, soon to a test branch, and, eventually to the main branch.

venice1200 commented 2 years ago

Cool! If you like to get directly in contact with me drop me an PM through the MiSTer FPGA Forum.

venice1200 commented 2 years ago

If you like to use other fonts double check this page: https://github.com/olikraus/u8g2/wiki/fntlistall

I think we can add a few more but not all are available for the used library.

I already added two new fonts to my testing FW. Commodore64 image and 8bitclassic image

The Commodore64 font is my new favorite.