Skip to content
Snippets Groups Projects
Commit 7088a459 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Refine SAA5050 state based on Keyop's experiments

It seems there is a "hold mosaic" mode, but it doesn't completely
avoid look-behind when it's set.  The rules for what "clears" the
held mosaic when not in hold mosic mode are a bit murky... added
extra2.pst to test.
parent 744cf3ec
No related branches found
No related tags found
No related merge requests found
Pipeline #7986 passed
...@@ -410,10 +410,8 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch) ...@@ -410,10 +410,8 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch)
cterm->bg_color |= 0x01000000; cterm->bg_color |= 0x01000000;
break; break;
case 76: // Normal Height case 76: // Normal Height
if (cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) {
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD);
cterm->prestel_last_mosaic = 0; cterm->prestel_last_mosaic = 0;
}
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT);
cterm->bg_color &= ~0x01000000; cterm->bg_color &= ~0x01000000;
break; break;
...@@ -428,6 +426,8 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch) ...@@ -428,6 +426,8 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch)
* was originally, and if there's no held mosaic, this will * was originally, and if there's no held mosaic, this will
* just be a space. * just be a space.
*/ */
if (!(cterm->extattr & CTERM_EXTATTR_PRESTEL_HOLD))
cterm->prestel_last_mosaic = 0;
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_SEPARATED); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_SEPARATED);
cterm->bg_color &= ~0x20000000; cterm->bg_color &= ~0x20000000;
break; break;
...@@ -438,6 +438,8 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch) ...@@ -438,6 +438,8 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch)
* was originally, and if there's no held mosaic, this will * was originally, and if there's no held mosaic, this will
* just be a space. * just be a space.
*/ */
if (!(cterm->extattr & CTERM_EXTATTR_PRESTEL_HOLD))
cterm->prestel_last_mosaic = 0;
cterm->extattr |= CTERM_EXTATTR_PRESTEL_SEPARATED; cterm->extattr |= CTERM_EXTATTR_PRESTEL_SEPARATED;
cterm->bg_color |= 0x20000000; cterm->bg_color |= 0x20000000;
break; break;
...@@ -462,11 +464,12 @@ prestel_colour(struct cterminal *cterm, bool alpha, int colour) ...@@ -462,11 +464,12 @@ prestel_colour(struct cterminal *cterm, bool alpha, int colour)
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_CONCEAL); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_CONCEAL);
if (alpha) { if (alpha) {
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD | CTERM_EXTATTR_PRESTEL_MOSAIC); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD | CTERM_EXTATTR_PRESTEL_MOSAIC);
cterm->prestel_last_mosaic = 0;
} }
else { else {
cterm->extattr |= CTERM_EXTATTR_PRESTEL_MOSAIC; cterm->extattr |= CTERM_EXTATTR_PRESTEL_MOSAIC;
} }
if (!(cterm->extattr & CTERM_EXTATTR_PRESTEL_HOLD))
cterm->prestel_last_mosaic = 0;
} }
static void static void
...@@ -501,10 +504,8 @@ prestel_apply_ctrl_after(struct cterminal *cterm, uint8_t ch) ...@@ -501,10 +504,8 @@ prestel_apply_ctrl_after(struct cterminal *cterm, uint8_t ch)
cterm->bg_color |= 0x01000000; cterm->bg_color |= 0x01000000;
break; break;
case 77: // Double Height case 77: // Double Height
if ((cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) == 0) {
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD);
cterm->prestel_last_mosaic = 0; cterm->prestel_last_mosaic = 0;
}
cterm->extattr |= CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT; cterm->extattr |= CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT;
cterm->bg_color |= 0x01000000; cterm->bg_color |= 0x01000000;
break; break;
...@@ -530,6 +531,7 @@ prestel_apply_ctrl_after(struct cterminal *cterm, uint8_t ch) ...@@ -530,6 +531,7 @@ prestel_apply_ctrl_after(struct cterminal *cterm, uint8_t ch)
prestel_colour(cterm, false, WHITE); prestel_colour(cterm, false, WHITE);
break; break;
case 95: // Release Mosaics case 95: // Release Mosaics
cterm->prestel_last_mosaic = 0;
cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD); cterm->extattr &= ~(CTERM_EXTATTR_PRESTEL_HOLD);
break; break;
} }
...@@ -4711,8 +4713,6 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore ...@@ -4711,8 +4713,6 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore
|| (line[i].ch >= 96 && line[i].ch < 128))) { || (line[i].ch >= 96 && line[i].ch < 128))) {
// Alphanum but should be mosaic // Alphanum but should be mosaic
line[i].ch |= 0x80; line[i].ch |= 0x80;
if (line[i].ch == 0xff)
line[i].ch = 0xdf;
if (cterm->extattr & CTERM_EXTATTR_PRESTEL_SEPARATED) if (cterm->extattr & CTERM_EXTATTR_PRESTEL_SEPARATED)
line[i].bg |= 0x20000000; line[i].bg |= 0x20000000;
else else
...@@ -6033,8 +6033,6 @@ CIOLIBEXPORT size_t cterm_write(struct cterminal * cterm, const void *vbuf, int ...@@ -6033,8 +6033,6 @@ CIOLIBEXPORT size_t cterm_write(struct cterminal * cterm, const void *vbuf, int
if (cterm->extattr & CTERM_EXTATTR_PRESTEL_MOSAIC) { if (cterm->extattr & CTERM_EXTATTR_PRESTEL_MOSAIC) {
if ((buf[j] < 64 && buf[j] >= 32) || (buf[j] >= 96 && buf[j] < 128)) { if ((buf[j] < 64 && buf[j] >= 32) || (buf[j] >= 96 && buf[j] < 128)) {
ch[0] = buf[j] | 0x80; ch[0] = buf[j] | 0x80;
if (ch[0] == 0xff)
ch[0] = 0xdf;
} }
else else
ch[0] = buf[j]; ch[0] = buf[j];
......
...@@ -2,6 +2,7 @@ Version 1.5b ...@@ -2,6 +2,7 @@ Version 1.5b
------------ ------------
Fix Prestel regressions Fix Prestel regressions
Use the SAA5050 font for Prestel mode Use the SAA5050 font for Prestel mode
Prestel mode is 25 rows, not 24
Version 1.5a Version 1.5a
------------ ------------
......
src/syncterm/prestest/extra-revealed.png

20.7 KiB | W: | H:

src/syncterm/prestest/extra-revealed.png

50.4 KiB | W: | H:

src/syncterm/prestest/extra-revealed.png
src/syncterm/prestest/extra-revealed.png
src/syncterm/prestest/extra-revealed.png
src/syncterm/prestest/extra-revealed.png
  • 2-up
  • Swipe
  • Onion skin
src/syncterm/prestest/extra.png

20.7 KiB | W: | H:

src/syncterm/prestest/extra.png

50.4 KiB | W: | H:

src/syncterm/prestest/extra.png
src/syncterm/prestest/extra.png
src/syncterm/prestest/extra.png
src/syncterm/prestest/extra.png
  • 2-up
  • Swipe
  • Onion skin
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment