![]() |
Colors only shown... sometimes? - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: Colors only shown... sometimes? (/showthread.php?tid=2595) |
Colors only shown... sometimes? - baltasarq - 01-07-2025 Hi, I'm using print64.bas, and the code I'm using to show a command menu is as follows: Code: const COLOR_BLACK as ubyte = 0 Well, the code should be straightforward. I also know it should work because I ported it from C, the same source code I used wtith z88dk. Unfortunately, it does not work, or it does not always work... (check the image). What could be wrong? -- Baltasar RE: Colors only shown... sometimes? - boriel - 01-11-2025 The thing here is that you're using print64, which "simulates" 64 columns, but this is not real. The ZX Spectrum hardware still uses 32 columns (for attributes). So if you change an ATTR color on an even column (0, 2, 4...) and print something, and change again the color for an odd column, the attr will be overwritten every time by the odd column. RE: Colors only shown... sometimes? - baltasarq - 01-11-2025 Yep, I figured that myself creating a program that writes using print64() with many colors. I've changed my strategy since then (I'm going to use icons). The strange thing is that this program is a port of a program compiled with z88dk using a similar library, in which attributes were not a problem. Now that I know the limitations of print64(), I wonder how do they do it. RE: Colors only shown... sometimes? - boriel - 01-14-2025 This is not a limitation of print64, but of the ZX Spectrum hardware. What computer were you using?? If it was a REAL (not emulated) ZX Spectrum then the library must be doing something like nirvana engine (sincronizing with the vertical CRT sync to mimic 2 attributes per cell). |