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:
1588
decode.cpp
1588
decode.cpp
File diff suppressed because it is too large
Load Diff
376
decode.h
376
decode.h
@@ -20,239 +20,49 @@
|
|||||||
#ifndef DECODE_H
|
#ifndef DECODE_H
|
||||||
#define DECODE_H
|
#define DECODE_H
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QMultiMap>
|
#include <QMultiMap>
|
||||||
#include <QPair>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "levelonepage.h"
|
#include "levelonepage.h"
|
||||||
|
|
||||||
struct textCharacter {
|
|
||||||
unsigned char code=0x20;
|
|
||||||
int set=0;
|
|
||||||
int diacritical=0;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline bool operator!=(const textCharacter &lhs, const textCharacter &rhs)
|
|
||||||
{
|
|
||||||
return lhs.code != rhs.code ||
|
|
||||||
lhs.set != rhs.set ||
|
|
||||||
lhs.diacritical != rhs.diacritical;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct displayAttributes {
|
|
||||||
bool doubleHeight=false;
|
|
||||||
bool doubleWidth=false;
|
|
||||||
bool boxingWindow=false;
|
|
||||||
bool conceal=false;
|
|
||||||
bool invert=false;
|
|
||||||
bool underlineSeparated=false;
|
|
||||||
bool forceContiguous=false;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline bool operator!=(const displayAttributes &lhs, const displayAttributes &rhs)
|
|
||||||
{
|
|
||||||
return lhs.doubleHeight != rhs.doubleHeight ||
|
|
||||||
lhs.doubleWidth != rhs.doubleWidth ||
|
|
||||||
lhs.boxingWindow != rhs.boxingWindow ||
|
|
||||||
lhs.conceal != rhs.conceal ||
|
|
||||||
lhs.invert != rhs.invert ||
|
|
||||||
lhs.underlineSeparated != rhs.underlineSeparated ||
|
|
||||||
lhs.forceContiguous != rhs.forceContiguous;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct textAttributes {
|
|
||||||
int foreColour=0x07;
|
|
||||||
int backColour=0x00;
|
|
||||||
struct flashFunctions {
|
|
||||||
int mode=0;
|
|
||||||
int ratePhase=0;
|
|
||||||
int phaseNumber=0;
|
|
||||||
} flash;
|
|
||||||
displayAttributes display;
|
|
||||||
/* font style */
|
|
||||||
};
|
|
||||||
|
|
||||||
inline bool operator!=(const textAttributes &lhs, const textAttributes &rhs)
|
|
||||||
{
|
|
||||||
return lhs.foreColour != rhs.foreColour ||
|
|
||||||
lhs.backColour != rhs.backColour ||
|
|
||||||
lhs.flash.mode != rhs.flash.mode ||
|
|
||||||
lhs.flash.ratePhase != rhs.flash.ratePhase ||
|
|
||||||
lhs.flash.phaseNumber != rhs.flash.phaseNumber ||
|
|
||||||
lhs.display != rhs.display;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct textCell {
|
|
||||||
textCharacter character;
|
|
||||||
textAttributes attribute;
|
|
||||||
bool bottomHalf=false;
|
|
||||||
bool rightHalf=false;
|
|
||||||
bool level1Mosaic=false;
|
|
||||||
int level1CharSet=0;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline bool operator!=(const textCell &lhs, const textCell &rhs)
|
|
||||||
{
|
|
||||||
return lhs.character != rhs.character ||
|
|
||||||
lhs.attribute != rhs.attribute ||
|
|
||||||
lhs.bottomHalf != rhs.bottomHalf ||
|
|
||||||
lhs.rightHalf != rhs.rightHalf ||
|
|
||||||
lhs.level1Mosaic != rhs.level1Mosaic ||
|
|
||||||
lhs.level1CharSet != rhs.level1CharSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct applyAttributes {
|
|
||||||
bool applyForeColour=false;
|
|
||||||
bool applyBackColour=false;
|
|
||||||
bool applyFlash=false;
|
|
||||||
bool applyDisplayAttributes=false;
|
|
||||||
bool applyTextSizeOnly=false;
|
|
||||||
bool applyBoxingOnly=false;
|
|
||||||
bool applyConcealOnly=false;
|
|
||||||
bool applyContiguousOnly=false;
|
|
||||||
bool copyAboveAttributes=false;
|
|
||||||
textAttributes attribute;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ActivePosition
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ActivePosition();
|
|
||||||
int row() const { return (m_row == -1) ? 0 : m_row; }
|
|
||||||
int column() const { return (m_column == -1) ? 0 : m_column; }
|
|
||||||
bool isDeployed() const { return m_row != -1; }
|
|
||||||
bool setRow(int);
|
|
||||||
bool setColumn(int);
|
|
||||||
// bool setRowAndColumn(int, int);
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_row, m_column;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class TextLayer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// TextLayer(TeletextPage* thePage) : currentPage(thePage) { };
|
|
||||||
virtual ~TextLayer() = default;
|
|
||||||
void setTeletextPage(LevelOnePage *);
|
|
||||||
virtual textCharacter character(int, int) =0;
|
|
||||||
virtual void attributes(int, int, applyAttributes *) =0;
|
|
||||||
virtual int fullScreenColour() const =0;
|
|
||||||
virtual int fullRowColour(int) const =0;
|
|
||||||
virtual bool fullRowDownwards(int) const =0;
|
|
||||||
virtual int objectType() const =0;
|
|
||||||
virtual int originR() const { return 0; };
|
|
||||||
virtual int originC() const { return 0; };
|
|
||||||
void setFullScreenColour(int);
|
|
||||||
void setFullRowColour(int, int, bool);
|
|
||||||
|
|
||||||
// Key QPair is row and column, value QPair is triplet mode and data
|
|
||||||
QMultiMap<QPair<int, int>, QPair<int, int>> enhanceMap;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
LevelOnePage* m_levelOnePage;
|
|
||||||
int m_layerFullScreenColour=-1;
|
|
||||||
int m_layerFullRowColour[25];
|
|
||||||
bool m_layerFullRowDownwards[25];
|
|
||||||
applyAttributes m_applyAttributes;
|
|
||||||
};
|
|
||||||
|
|
||||||
class EnhanceLayer: public TextLayer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
EnhanceLayer();
|
|
||||||
textCharacter character(int, int);
|
|
||||||
void attributes(int, int, applyAttributes *);
|
|
||||||
int fullScreenColour() const { return m_layerFullScreenColour; };
|
|
||||||
int fullRowColour(int r) const { return m_layerFullRowColour[r]; };
|
|
||||||
bool fullRowDownwards(int r) const { return m_layerFullRowDownwards[r]; };
|
|
||||||
int objectType() const { return m_objectType; };
|
|
||||||
int originR() const { return m_originR; };
|
|
||||||
int originC() const { return m_originC; };
|
|
||||||
void setObjectType(int);
|
|
||||||
void setOrigin(int, int);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int m_objectType=0;
|
|
||||||
int m_originR=0;
|
|
||||||
int m_originC=0;
|
|
||||||
int m_rowCached=-1;
|
|
||||||
int m_rightMostColumn[25];
|
|
||||||
};
|
|
||||||
|
|
||||||
class Level1Layer: public TextLayer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum RowHeight { Normal=-1, TopHalf, BottomHalf };
|
|
||||||
|
|
||||||
// Level1Layer(TeletextPage *thePage) : TextLayer(thePage) { };
|
|
||||||
Level1Layer();
|
|
||||||
textCharacter character(int, int);
|
|
||||||
void attributes(int, int, applyAttributes *);
|
|
||||||
int fullScreenColour() const { return -1; };
|
|
||||||
int fullRowColour(int) const { return -1; };
|
|
||||||
bool fullRowDownwards(int) const { return false; };
|
|
||||||
int objectType() const { return 0; }
|
|
||||||
RowHeight rowHeight(int r) const { return m_rowHeight[r]; };
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateRowCache(int);
|
|
||||||
|
|
||||||
struct level1CacheAttributes {
|
|
||||||
int foreColour=0x07;
|
|
||||||
int backColour=0x00;
|
|
||||||
unsigned char sizeCode=0x0c;
|
|
||||||
bool mosaics=false;
|
|
||||||
bool separated=false;
|
|
||||||
bool held=false;
|
|
||||||
bool escSwitch=false;
|
|
||||||
unsigned char holdChar=0x20;
|
|
||||||
bool holdSeparated=false;
|
|
||||||
};
|
|
||||||
level1CacheAttributes m_attributeCache[40];
|
|
||||||
int m_rowCached=-1;
|
|
||||||
bool m_rowHasDoubleHeightAttr[25];
|
|
||||||
RowHeight m_rowHeight[25];
|
|
||||||
};
|
|
||||||
|
|
||||||
class TeletextPageDecode : public QObject
|
class TeletextPageDecode : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum CharacterFragment { NormalSize, DoubleHeightTopHalf, DoubleHeightBottomHalf, DoubleWidthLeftHalf, DoubleWidthRightHalf, DoubleSizeTopLeftQuarter, DoubleSizeTopRightQuarter, DoubleSizeBottomLeftQuarter, DoubleSizeBottomRightQuarter };
|
enum CharacterFragment { NormalSize, DoubleHeightTopHalf, DoubleHeightBottomHalf, DoubleWidthLeftHalf, DoubleWidthRightHalf, DoubleSizeTopLeftQuarter, DoubleSizeTopRightQuarter, DoubleSizeBottomLeftQuarter, DoubleSizeBottomRightQuarter };
|
||||||
|
enum RowHeight { NormalHeight, TopHalf, BottomHalf };
|
||||||
|
|
||||||
TeletextPageDecode();
|
TeletextPageDecode();
|
||||||
~TeletextPageDecode();
|
~TeletextPageDecode();
|
||||||
bool refresh(int r, int c) const { return m_refresh[r][c]; }
|
bool refresh(int r, int c) const { return m_refresh[r][c]; }
|
||||||
void setRefresh(int, int, bool);
|
void setRefresh(int, int, bool);
|
||||||
void decodePage();
|
void decodePage();
|
||||||
void decodeRow(int r);
|
|
||||||
LevelOnePage *teletextPage() const { return m_levelOnePage; };
|
LevelOnePage *teletextPage() const { return m_levelOnePage; };
|
||||||
void setTeletextPage(LevelOnePage *);
|
void setTeletextPage(LevelOnePage *);
|
||||||
void updateSidePanels();
|
void updateSidePanels();
|
||||||
void buildEnhanceMap(TextLayer *, int=0);
|
|
||||||
|
|
||||||
unsigned char cellCharacterCode(int r, int c) { return cellAtCharacterOrigin(r, c).character.code; };
|
unsigned char cellCharacterCode(int r, int c) const { return m_cell[r][c].character.code; };
|
||||||
int cellCharacterSet(int r, int c) { return cellAtCharacterOrigin(r, c).character.set; };
|
int cellCharacterSet(int r, int c) const { return m_cell[r][c].character.set; };
|
||||||
int cellCharacterDiacritical(int r, int c) { return cellAtCharacterOrigin(r, c).character.diacritical; };
|
int cellCharacterDiacritical(int r, int c) const { return m_cell[r][c].character.diacritical; };
|
||||||
int cellForegroundCLUT(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.foreColour; };
|
int cellForegroundCLUT(int r, int c) const { return m_cell[r][c].attribute.foregroundCLUT; };
|
||||||
int cellBackgroundCLUT(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.backColour; };
|
int cellBackgroundCLUT(int r, int c) const { return m_cell[r][c].attribute.backgroundCLUT; };
|
||||||
QColor cellForegroundQColor(int, int);
|
QColor cellForegroundQColor(int, int);
|
||||||
QColor cellBackgroundQColor(int, int);
|
QColor cellBackgroundQColor(int, int);
|
||||||
QColor cellFlashForegroundQColor(int, int);
|
QColor cellFlashForegroundQColor(int, int);
|
||||||
int cellFlashMode(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.flash.mode; };
|
int cellFlashMode(int r, int c) const { return m_cell[r][c].attribute.flash.mode; };
|
||||||
int cellFlashRatePhase(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.flash.ratePhase; };
|
int cellFlashRatePhase(int r, int c) const { return m_cell[r][c].attribute.flash.ratePhase; };
|
||||||
int cellFlash2HzPhaseNumber(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.flash.phaseNumber; };
|
int cellFlash2HzPhaseNumber(int r, int c) const { return m_cell[r][c].attribute.flash.phase2HzShown; };
|
||||||
CharacterFragment cellCharacterFragment(int, int) const;
|
CharacterFragment cellCharacterFragment(int r, int c) const { return m_cell[r][c].fragment; };
|
||||||
bool cellBoxed(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.display.boxingWindow; };
|
bool cellBoxed(int r, int c) const { return m_cell[r][c].attribute.display.boxingWindow; };
|
||||||
bool cellConceal(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.display.conceal; };
|
bool cellConceal(int r, int c) const { return m_cell[r][c].attribute.display.conceal; };
|
||||||
bool cellUnderlined(int r, int c) { return cellAtCharacterOrigin(r, c).attribute.display.underlineSeparated && cellAtCharacterOrigin(r, c).character.set < 24; };
|
bool cellUnderlined(int r, int c) const { return cellCharacterSet(r, c) < 24 ? m_cell[r][c].attribute.display.underlineSeparated : false; };
|
||||||
|
|
||||||
bool level1MosaicAttribute(int r, int c) const { return m_cell[r][c].level1Mosaic; };
|
bool level1MosaicAttribute(int r, int c) const { return m_cellLevel1Mosaic[r][c]; };
|
||||||
int level1CharSet(int r, int c) const { return m_cell[r][c].level1CharSet; };
|
int level1CharSet(int r, int c) const { return m_cellLevel1CharSet[r][c]; };
|
||||||
|
|
||||||
|
RowHeight rowHeight(int r) const { return m_rowHeight[r]; };
|
||||||
|
|
||||||
QColor fullScreenQColor() const { return m_finalFullScreenQColor; };
|
QColor fullScreenQColor() const { return m_finalFullScreenQColor; };
|
||||||
QColor fullRowQColor(int r) const { return m_fullRowQColor[r]; };
|
QColor fullRowQColor(int r) const { return m_fullRowQColor[r]; };
|
||||||
@@ -270,29 +80,94 @@ signals:
|
|||||||
protected:
|
protected:
|
||||||
inline void setFullScreenColour(int);
|
inline void setFullScreenColour(int);
|
||||||
inline void setFullRowColour(int, int);
|
inline void setFullRowColour(int, int);
|
||||||
textCell& cellAtCharacterOrigin(int, int);
|
|
||||||
|
|
||||||
int m_finalFullScreenColour, m_level;
|
int m_finalFullScreenColour, m_level;
|
||||||
QColor m_finalFullScreenQColor;
|
QColor m_finalFullScreenQColor;
|
||||||
int m_leftSidePanelColumns, m_rightSidePanelColumns;
|
int m_leftSidePanelColumns, m_rightSidePanelColumns;
|
||||||
Level1Layer m_level1Layer;
|
|
||||||
std::vector<TextLayer *> m_textLayer;
|
|
||||||
const int m_foregroundRemap[8] = { 0, 0, 0, 8, 8, 16, 16, 16 };
|
const int m_foregroundRemap[8] = { 0, 0, 0, 8, 8, 16, 16, 16 };
|
||||||
const int m_backgroundRemap[8] = { 0, 8, 16, 8, 16, 8, 16, 24 };
|
const int m_backgroundRemap[8] = { 0, 8, 16, 8, 16, 8, 16, 24 };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
class Invocation;
|
||||||
|
|
||||||
enum ColourPart { Foreground, Background, FlashForeground };
|
enum ColourPart { Foreground, Background, FlashForeground };
|
||||||
|
|
||||||
QColor cellQColor(int, int, ColourPart);
|
struct textCharacter {
|
||||||
|
unsigned char code=0x20;
|
||||||
|
int set=0;
|
||||||
|
int diacritical=0;
|
||||||
|
};
|
||||||
|
|
||||||
textCell m_cell[25][72];
|
friend inline bool operator!=(const textCharacter &lhs, const textCharacter &rhs)
|
||||||
bool m_refresh[25][72];
|
{
|
||||||
LevelOnePage* m_levelOnePage;
|
return lhs.code != rhs.code ||
|
||||||
int m_fullRowColour[25];
|
lhs.set != rhs.set ||
|
||||||
QColor m_fullRowQColor[25];
|
lhs.diacritical != rhs.diacritical;
|
||||||
};
|
}
|
||||||
|
|
||||||
static const QMap<int, int> g0CharacterMap {
|
struct flashFunctions {
|
||||||
|
int mode=0;
|
||||||
|
int ratePhase=0;
|
||||||
|
int phase2HzShown=0;
|
||||||
|
} flash;
|
||||||
|
|
||||||
|
struct displayAttributes {
|
||||||
|
bool doubleHeight=false;
|
||||||
|
bool doubleWidth=false;
|
||||||
|
bool boxingWindow=false;
|
||||||
|
bool conceal=false;
|
||||||
|
bool invert=false;
|
||||||
|
bool underlineSeparated=false;
|
||||||
|
};
|
||||||
|
|
||||||
|
friend inline bool operator!=(const displayAttributes &lhs, const displayAttributes &rhs)
|
||||||
|
{
|
||||||
|
return lhs.doubleHeight != rhs.doubleHeight ||
|
||||||
|
lhs.doubleWidth != rhs.doubleWidth ||
|
||||||
|
lhs.boxingWindow != rhs.boxingWindow ||
|
||||||
|
lhs.conceal != rhs.conceal ||
|
||||||
|
lhs.invert != rhs.invert ||
|
||||||
|
lhs.underlineSeparated != rhs.underlineSeparated;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct textAttributes {
|
||||||
|
int foregroundCLUT=7;
|
||||||
|
int backgroundCLUT=0;
|
||||||
|
flashFunctions flash;
|
||||||
|
displayAttributes display;
|
||||||
|
};
|
||||||
|
|
||||||
|
friend inline bool operator!=(const textAttributes &lhs, const textAttributes &rhs)
|
||||||
|
{
|
||||||
|
return lhs.foregroundCLUT != rhs.foregroundCLUT ||
|
||||||
|
lhs.backgroundCLUT != rhs.backgroundCLUT ||
|
||||||
|
lhs.flash.mode != rhs.flash.mode ||
|
||||||
|
lhs.flash.ratePhase != rhs.flash.ratePhase ||
|
||||||
|
lhs.flash.phase2HzShown != rhs.flash.phase2HzShown ||
|
||||||
|
lhs.display != rhs.display;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct textCell {
|
||||||
|
textCharacter character;
|
||||||
|
textAttributes attribute;
|
||||||
|
CharacterFragment fragment=NormalSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
friend inline bool operator!=(const textCell &lhs, const textCell &rhs)
|
||||||
|
{
|
||||||
|
return lhs.character != rhs.character ||
|
||||||
|
lhs.attribute != rhs.attribute ||
|
||||||
|
lhs.fragment != rhs.fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct textPainter {
|
||||||
|
textAttributes attribute;
|
||||||
|
textCell result;
|
||||||
|
textCell rightHalfCell;
|
||||||
|
textCell bottomHalfCell[72];
|
||||||
|
};
|
||||||
|
|
||||||
|
const QMap<int, int> m_g0CharacterMap {
|
||||||
{ 0x00, 12 }, { 0x01, 15 }, { 0x02, 22 }, { 0x03, 16 }, { 0x04, 14 }, { 0x05, 19 }, { 0x06, 11 },
|
{ 0x00, 12 }, { 0x01, 15 }, { 0x02, 22 }, { 0x03, 16 }, { 0x04, 14 }, { 0x05, 19 }, { 0x06, 11 },
|
||||||
{ 0x08, 18 }, { 0x09, 15 }, { 0x0a, 22 }, { 0x0b, 16 }, { 0x0c, 14 }, { 0x0e, 11 },
|
{ 0x08, 18 }, { 0x09, 15 }, { 0x0a, 22 }, { 0x0b, 16 }, { 0x0c, 14 }, { 0x0e, 11 },
|
||||||
{ 0x10, 12 }, { 0x11, 15 }, { 0x12, 22 }, { 0x13, 16 }, { 0x14, 14 }, { 0x15, 19 }, { 0x16, 23 },
|
{ 0x10, 12 }, { 0x11, 15 }, { 0x12, 22 }, { 0x13, 16 }, { 0x14, 14 }, { 0x15, 19 }, { 0x16, 23 },
|
||||||
@@ -301,6 +176,69 @@ static const QMap<int, int> g0CharacterMap {
|
|||||||
{ 0x36, 23 }, { 0x37, 4 },
|
{ 0x36, 23 }, { 0x37, 4 },
|
||||||
{ 0x40, 12 }, { 0x44, 14 }, { 0x47, 5 },
|
{ 0x40, 12 }, { 0x44, 14 }, { 0x47, 5 },
|
||||||
{ 0x55, 6 }, { 0x57, 5 }
|
{ 0x55, 6 }, { 0x57, 5 }
|
||||||
|
};
|
||||||
|
|
||||||
|
class Invocation
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Invocation();
|
||||||
|
|
||||||
|
X26TripletList *tripletList() const { return m_tripletList; };
|
||||||
|
void setTripletList(X26TripletList *);
|
||||||
|
int startTripletNumber() const { return m_startTripletNumber; };
|
||||||
|
void setStartTripletNumber(int);
|
||||||
|
int endTripletNumber() const { return m_endTripletNumber; };
|
||||||
|
void setEndTripletNumber(int);
|
||||||
|
int originRow() const { return m_originRow; };
|
||||||
|
int originColumn() const { return m_originColumn; };
|
||||||
|
void setOrigin(int, int);
|
||||||
|
void buildMap(int);
|
||||||
|
|
||||||
|
QList<QPair<int, int>> charPositions() const { return m_characterMap.uniqueKeys(); };
|
||||||
|
QList<QPair<int, int>> attrPositions() const { return m_attributeMap.uniqueKeys(); };
|
||||||
|
QList<X26Triplet> charactersMappedAt(int r, int c) const { return m_characterMap.values(qMakePair(r, c)); };
|
||||||
|
QList<X26Triplet> attributesMappedAt(int r, int c) const { return m_attributeMap.values(qMakePair(r, c)); };
|
||||||
|
int rightMostColumn(int r) const { return m_rightMostColumn.value(r, -1); };
|
||||||
|
int fullScreenColour() const { return m_fullScreenCLUT; };
|
||||||
|
QList<X26Triplet> fullRowColoursMappedAt(int r) const { return m_fullRowCLUTMap.values(r); };
|
||||||
|
|
||||||
|
private:
|
||||||
|
X26TripletList *m_tripletList;
|
||||||
|
int m_startTripletNumber, m_endTripletNumber;
|
||||||
|
int m_originRow, m_originColumn;
|
||||||
|
// QPair is row and column
|
||||||
|
QMultiMap<QPair<int, int>, X26Triplet> m_characterMap;
|
||||||
|
QMultiMap<QPair<int, int>, X26Triplet> m_attributeMap;
|
||||||
|
QMap<int, int> m_rightMostColumn;
|
||||||
|
int m_fullScreenCLUT;
|
||||||
|
QMultiMap<int, X26Triplet> m_fullRowCLUTMap;
|
||||||
|
};
|
||||||
|
|
||||||
|
static int s_instances;
|
||||||
|
static textPainter s_blankPainter;
|
||||||
|
|
||||||
|
void decodeRow(int r);
|
||||||
|
QColor cellQColor(int, int, ColourPart);
|
||||||
|
textCell& cellAtCharacterOrigin(int, int);
|
||||||
|
void buildInvocationList(Invocation &, int);
|
||||||
|
textCharacter characterFromTriplets(const QList<X26Triplet>, int);
|
||||||
|
inline void rotateFlashMovement(flashFunctions &);
|
||||||
|
|
||||||
|
bool m_refresh[25][72];
|
||||||
|
textCell m_cell[25][72];
|
||||||
|
bool m_cellLevel1Mosaic[25][40];
|
||||||
|
int m_cellLevel1CharSet[25][40];
|
||||||
|
LevelOnePage* m_levelOnePage;
|
||||||
|
int m_fullRowColour[25];
|
||||||
|
QColor m_fullRowQColor[25];
|
||||||
|
QList<Invocation> m_invocations[3];
|
||||||
|
Invocation m_localEnhancements;
|
||||||
|
textPainter m_level1ActivePainter;
|
||||||
|
QList<textPainter> m_adapPassPainter[2];
|
||||||
|
int m_level1DefaultCharSet, m_level1SecondCharSet;
|
||||||
|
int m_x26DefaultG0CharSet, m_x26DefaultG2CharSet;
|
||||||
|
|
||||||
|
RowHeight m_rowHeight[25];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -96,7 +96,10 @@ void TeletextWidget::subPageSelected()
|
|||||||
|
|
||||||
void TeletextWidget::refreshRow(int rowChanged)
|
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();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,8 +184,10 @@ void TeletextWidget::setShowControlCodes(bool showControlCodes)
|
|||||||
void TeletextWidget::setControlBit(int bitNumber, bool active)
|
void TeletextWidget::setControlBit(int bitNumber, bool active)
|
||||||
{
|
{
|
||||||
m_levelOnePage->setControlBit(bitNumber, active);
|
m_levelOnePage->setControlBit(bitNumber, active);
|
||||||
if (bitNumber == 1 || bitNumber == 2)
|
if (bitNumber == 1 || bitNumber == 2) {
|
||||||
m_pageDecode.decodePage();
|
m_pageDecode.decodePage();
|
||||||
|
m_pageRender.renderPage(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TeletextWidget::setDefaultCharSet(int newDefaultCharSet)
|
void TeletextWidget::setDefaultCharSet(int newDefaultCharSet)
|
||||||
|
|||||||
Reference in New Issue
Block a user