Rewrite the decoder

A complete rewrite of decode.cpp and decode.h to make it easier to follow
and maintain. Rather than a set of "layers" descended from C++ classes, the
for-loop across the rows and columns explicitly lays out the order of
processing the Level 1 characters and attributes, the X/26 enhancements
that affect the page directly as well as those within each Invocation of an
Object, followed by selecting which Invoked Object to place in the character
cell or in the absence of an Object the underlying page fragment will be
placed in the cell.

The new decoder has the following improvements over the old...
- Local Enhancement Data has priority over Active Objects.
- Active Objects can set Full Screen and Full Row colours.
- Incremental/decremental flash phases are tracked correctly within Objects.
- X/26 characters overwriting the bottom half of Level 1 Double Height rows.
- Interaction between the underlying page and Objects where characters of
  different sizes overlap.
This commit is contained in:
G.K.MacGregor
2023-05-07 19:25:06 +01:00
parent 801efa570c
commit 021fbfa60f
3 changed files with 1010 additions and 991 deletions

View File

@@ -96,7 +96,10 @@ void TeletextWidget::subPageSelected()
void TeletextWidget::refreshRow(int rowChanged)
{
m_pageDecode.decodeRow(rowChanged);
Q_UNUSED(rowChanged);
// TODO trace signals where this is called so we can remove this
m_pageDecode.decodePage();
update();
}
@@ -181,8 +184,10 @@ void TeletextWidget::setShowControlCodes(bool showControlCodes)
void TeletextWidget::setControlBit(int bitNumber, bool active)
{
m_levelOnePage->setControlBit(bitNumber, active);
if (bitNumber == 1 || bitNumber == 2)
if (bitNumber == 1 || bitNumber == 2) {
m_pageDecode.decodePage();
m_pageRender.renderPage(true);
}
}
void TeletextWidget::setDefaultCharSet(int newDefaultCharSet)