normalizing SDL BIOS behavior against Teensy

This commit is contained in:
Jorj Bauer 2020-12-28 16:44:43 -05:00
parent 84df756230
commit 736f325e7f
2 changed files with 7 additions and 6 deletions

View File

@ -126,12 +126,12 @@ void BIOS::DrawMenuBar()
for (int i=0; i<NUM_TITLES; i++) {
for (int x=0; x<titleWidths[i] + 2*XPADDING; x++) {
g_display->drawPixel(xpos+x, 0, 0xFFFF);
g_display->drawPixel(xpos+x, 16, 0xFFFF);
g_display->drawUIPixel(xpos+x, 0, 0xFFFF);
g_display->drawUIPixel(xpos+x, 16, 0xFFFF);
}
for (int y=0; y<=16; y++) {
g_display->drawPixel(xpos, y, 0xFFFF);
g_display->drawPixel(xpos + titleWidths[i] + 2*XPADDING, y, 0xFFFF);
g_display->drawUIPixel(xpos, y, 0xFFFF);
g_display->drawUIPixel(xpos + titleWidths[i] + 2*XPADDING, y, 0xFFFF);
}
xpos += XPADDING;

View File

@ -206,9 +206,9 @@ void SDLDisplay::drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c)
uint8_t ch = BiosFont[temp];
for (int8_t x_off = 0; x_off <= xsize; x_off++) {
if (ch & (1 << (7-x_off))) {
drawPixel(x + x_off, y + y_off, onPixel);
drawUIPixel(x + x_off, y + y_off, onPixel);
} else {
drawPixel(x + x_off, y + y_off, offPixel);
drawUIPixel(x + x_off, y + y_off, offPixel);
}
}
temp++;
@ -223,6 +223,7 @@ void SDLDisplay::drawString(uint8_t mode, uint16_t x, uint8_t y, const char *str
for (int8_t i=0; i<strlen(str); i++) {
drawCharacter(mode, x, y, str[i]);
x += xsize; // fixme: any inter-char spacing?
if (x >= 320) break; // FIXME constant - and pre-scaling, b/c that's in drawCharacter
}
}