- [NEW] ui::placetext() i ui::placechar, pa ficar text en qualsevol pixel

- [NEW] [Z80Analize] backspace esborra tots els tags
- [NEW] [zx-128bankviewer] Es mostra quina pàgina de memòria està asignada a cada bank
- [FIX] [zx_128mem] es filtra el port al que escolta la memòria
- [NEW] [zx_screen] Es mostra en quina pantalla estem (normal o shadow)
- [FIX] [zx_screen] tots els tipos per al calcul de adreces passats a uint32_t
- [NEW] [zx_ula] afegides combinacions de cursors per a major comoditat
This commit is contained in:
2025-07-22 13:31:21 +02:00
parent 4b4e1df8f9
commit 3fd28136f6
8 changed files with 85 additions and 10 deletions

16
ui.cpp
View File

@@ -88,6 +88,22 @@ namespace ui
for (int i=0; i<strlen(text);++i) if (text[i]!=32) printchar(x+i, y, text[i]);
}
void placechar(int x, int y, char chr, uint8_t color)
{
if (color != 255) SDL_SetRenderDrawColor(ren, colors[color][0], colors[color][1], colors[color][2], 255);
if (chr==32) return;
if (chr<32 || chr>127) chr = '.';
SDL_Rect src {((chr-32)&0xf)*CHR_W, ((chr-32)>>4)*CHR_H, CHR_W, CHR_H};
SDL_Rect dst {x, y, CHR_W*2, CHR_H*2};
SDL_RenderCopy(ren, tex, &src, &dst);
}
void placetxt(int x, int y, const char *text, uint8_t color)
{
SDL_SetTextureColorMod(tex, colors[color][0], colors[color][1], colors[color][2]);
for (int i=0; i<strlen(text);++i) if (text[i]!=32) placechar(x+i*CHR_W*2, y, text[i]);
}
void setClicked(const bool value)
{
clicked = value;