Added new AS token code.

This commit is contained in:
Mark Long 2016-01-21 18:39:12 -06:00
parent 871acbded3
commit c25e8bfc8a
6 changed files with 236 additions and 78 deletions

View File

@ -18,13 +18,10 @@ void ApplesoftFile::setData(QByteArray data)
m_length = addlo + (addhi * 256);
m_data.remove(0,2);
parse();
// m_detokenized = detokenize();
}
void ApplesoftFile::parse(quint16 start_address)
{
// QList<ApplesoftLine> retval;
int idx = 0;
quint8 val = 0;
@ -83,9 +80,6 @@ QByteArray ApplesoftFile::extraData()
return m_data.mid(m_data_end);
}
void Retokenizer::retokenize(ApplesoftLine &line)
{
// QList <QByteArray> string_list;

View File

@ -18,7 +18,6 @@ public:
void setData(QByteArray data);
void setFilename(QString filename) { m_filename = filename; }
QByteArray extraData();
// QList<ApplesoftLine> detokenized() { return m_detokenized; }
QStringList extraDataHexValues();
QVector<ApplesoftLine> getLines() const { return m_lines; }

View File

@ -47,37 +47,37 @@ void ApplesoftToken::setTokenId(quint16 id)
setValue(id);
m_token_type = UNDEFINED_APPLESOFT_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::StringTokenVal) {
} else if (id == StringTokenVal) {
m_token_type = STRING_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::RemStringTokenVal) {
} else if (id == RemStringTokenVal) {
m_token_type = REM_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::DataStringTokenVal) {
} else if (id == DataStringTokenVal) {
m_token_type = DATASTRING_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::IntegerTokenVal) {
} else if (id == IntegerTokenVal) {
m_token_type = INTEGER_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::FloatTokenVal) {
} else if (id == FloatTokenVal) {
m_token_type = FLOAT_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::IntVarTokenVal) {
} else if (id == IntVarTokenVal) {
m_token_type = INT_VARIABLE_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::IntAryVarTokenVal) {
} else if (id == IntAryVarTokenVal) {
m_token_type = INT_ARY_VARIABLE_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::FloatVarTokenVal) {
} else if (id == FloatVarTokenVal) {
m_token_type = FLOAT_VARIABLE_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::FloatAryVarTokenVal) {
} else if (id == FloatAryVarTokenVal) {
m_token_type = FLOAT_ARY_VARIABLE_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::StringVarTokenVal) {
} else if (id == StringVarTokenVal) {
m_token_type = STRING_VARIABLE_TOKEN;
m_command_type = NONE;
} else if (id == ApplesoftToken::StringAryVarTokenVal) {
} else if (id == StringAryVarTokenVal) {
m_token_type = STRING_ARY_VARIABLE_TOKEN;
m_command_type = NONE;
}
@ -103,63 +103,141 @@ QString ApplesoftToken::getRawPrintableString()
void ApplesoftToken::initializeTokenTable()
{
m_tokens[0x80] = " END "; m_tokens[0x81] = " FOR "; m_tokens[0x82] = " NEXT ";
m_tokens[0x83] = " DATA "; m_tokens[0x84] = " INPUT "; m_tokens[0x85] = " DEL ";
m_tokens[0x86] = " DIM "; m_tokens[0x87] = " READ "; m_tokens[0x88] = " GR ";
m_tokens[0x89] = " TEXT "; m_tokens[0x8A] = " PR# "; m_tokens[0x8B] = " IN# ";
m_tokens[0x8C] = " CALL "; m_tokens[0x8D] = " PLOT "; m_tokens[0x8E] = " HLIN ";
m_tokens[0x8F] = " VLIN "; m_tokens[0x90] = " HGR2 "; m_tokens[0x91] = " HGR ";
m_tokens[0x92] = " HCOLOR= "; m_tokens[0x93] = " HPLOT "; m_tokens[0x94] = " DRAW ";
m_tokens[0x95] = " XDRAW "; m_tokens[0x96] = " HTAB "; m_tokens[0x97] = " HOME ";
m_tokens[0x98] = " ROT= "; m_tokens[0x99] = " SCALE= "; m_tokens[0x9A] = " SHLOAD ";
m_tokens[0x9B] = " TRACE "; m_tokens[0x9C] = " NOTRACE "; m_tokens[0x9D] = " NORMAL ";
m_tokens[0x9E] = " INVERSE "; m_tokens[0x9F] = " FLASH "; m_tokens[0xA0] = " COLOR= ";
m_tokens[0xA1] = " POP "; m_tokens[0xA2] = " VTAB "; m_tokens[0xA3] = " HIMEM: ";
m_tokens[0xA4] = " LOMEM: "; m_tokens[0xA5] = " ONERR "; m_tokens[0xA6] = " RESUME ";
m_tokens[0xA7] = " RECALL "; m_tokens[0xA8] = " STORE "; m_tokens[0xA9] = " SPEED= ";
m_tokens[0xAA] = " LET "; m_tokens[0xAB] = " GOTO "; m_tokens[0xAC] = " RUN ";
m_tokens[0xAD] = " IF "; m_tokens[0xAE] = " RESTORE "; m_tokens[0xAF] = " & ";
m_tokens[0xB0] = " GOSUB "; m_tokens[0xB1] = " RETURN "; m_tokens[0xB2] = " REM ";
m_tokens[0xB3] = " STOP "; m_tokens[0xB4] = " ON "; m_tokens[0xB5] = " WAIT ";
m_tokens[0xB6] = " LOAD "; m_tokens[0xB7] = " SAVE "; m_tokens[0xB8] = " DEF ";
m_tokens[0xB9] = " POKE "; m_tokens[0xBA] = " PRINT "; m_tokens[0xBB] = " CONT ";
m_tokens[0xBC] = " LIST "; m_tokens[0xBD] = " CLEAR "; m_tokens[0xBE] = " GET ";
m_tokens[0xBF] = " NEW "; m_tokens[0xC0] = " TAB("; m_tokens[0xC1] = " TO ";
m_tokens[0xC2] = " FN "; m_tokens[0xC3] = " SPC( "; m_tokens[0xC4] = " THEN ";
m_tokens[0xC5] = " AT "; m_tokens[0xC6] = " NOT "; m_tokens[0xC7] = " STEP ";
m_tokens[0xC8] = " + "; m_tokens[0xC9] = " - "; m_tokens[0xCA] = " * ";
m_tokens[0xCB] = " / "; m_tokens[0xCC] = " ^ "; m_tokens[0xCD] = " AND ";
m_tokens[0xCE] = " OR "; m_tokens[0xCF] = " > "; m_tokens[0xD0] = " = ";
m_tokens[0xD1] = " < "; m_tokens[0xD2] = " SGN"; m_tokens[0xD3] = " INT";
m_tokens[0xD4] = " ABS"; m_tokens[0xD5] = " USR"; m_tokens[0xD6] = " FRE";
m_tokens[0xD7] = " SCRN( "; m_tokens[0xD8] = " PDL"; m_tokens[0xD9] = " POS";
m_tokens[0xDA] = " SQR"; m_tokens[0xDB] = " RND"; m_tokens[0xDC] = " LOG";
m_tokens[0xDD] = " EXP"; m_tokens[0xDE] = " COS"; m_tokens[0xDF] = " SIN";
m_tokens[0xE0] = " TAN"; m_tokens[0xE1] = " ATN"; m_tokens[0xE2] = " PEEK";
m_tokens[0xE3] = " LEN"; m_tokens[0xE4] = " STR$"; m_tokens[0xE5] = " VAL";
m_tokens[0xE6] = " ASC"; m_tokens[0xE7] = " CHR$"; m_tokens[0xE8] = " LEFT$ ";
m_tokens[0xE9] = " RIGHT$ "; m_tokens[0xEA] = " MID$ ";
m_tokens[0xEB] = "{Token 0xEB} ";
m_tokens[0xEC] = "{Token 0xEC} ";
m_tokens[0xED] = "{Token 0xED} ";
m_tokens[0xEE] = "{Token 0xEE} ";
m_tokens[0xEF] = "{Token 0xEF} ";
m_tokens[0xF0] = "{Token 0xF0} ";
m_tokens[0xF1] = "{Token 0xF1} ";
m_tokens[0xF2] = "{Token 0xF2} ";
m_tokens[0xF3] = "{Token 0xF3} ";
m_tokens[0xF4] = "{Token 0xF4} ";
m_tokens[0xF5] = "{Token 0xF5} ";
m_tokens[0xF6] = "{Token 0xF6} ";
m_tokens[0xF7] = "{Token 0xF7} ";
m_tokens[0xF8] = "{Token 0xF8} ";
m_tokens[0xF9] = "{Token 0xF9} ";
m_tokens[0xFA] = "{Token 0xFA} ";
m_tokens[0xFB] = "{Token 0xFB} ";
m_tokens[0xFC] = "{Token 0xFC} ";
m_tokens[0xFD] = "{Token 0xFD} ";
m_tokens[0xFE] = "{num}";
m_tokens[0xFF] = "{string}";
m_tokens[ASEnd] = " END "; m_tokens[ASFor] = " FOR ";
m_tokens[ASNext] = " NEXT "; m_tokens[ASData] = " DATA ";
m_tokens[ASInput] = " INPUT "; m_tokens[ASDel] = " DEL ";
m_tokens[ASDim] = " DIM "; m_tokens[ASRead] = " READ ";
m_tokens[ASGr] = " GR "; m_tokens[ASText] = " TEXT ";
m_tokens[ASPr] = " PR# "; m_tokens[ASIn] = " IN# ";
m_tokens[ASCall] = " CALL "; m_tokens[ASPlot] = " PLOT ";
m_tokens[ASHlin] = " HLIN "; m_tokens[ASVlin] = " VLIN ";
m_tokens[ASHgr2] = " HGR2 "; m_tokens[ASHgr] = " HGR ";
m_tokens[ASHcolor] = " HCOLOR= "; m_tokens[ASHplot] = " HPLOT ";
m_tokens[ASDraw] = " DRAW "; m_tokens[ASXdraw] = " XDRAW ";
m_tokens[ASHtab] = " HTAB "; m_tokens[ASHome] = " HOME ";
m_tokens[ASRot] = " ROT= "; m_tokens[ASScale] = " SCALE= ";
m_tokens[ASShload] = " SHLOAD "; m_tokens[ASTrace] = " TRACE ";
m_tokens[ASNotrace] = " NOTRACE "; m_tokens[ASNormal] = " NORMAL ";
m_tokens[ASInverse] = " INVERSE "; m_tokens[ASFlash] = " FLASH ";
m_tokens[ASColor] = " COLOR= "; m_tokens[ASPop] = " POP ";
m_tokens[ASVtab] = " VTAB "; m_tokens[ASHimem] = " HIMEM: ";
m_tokens[ASLomem] = " LOMEM: "; m_tokens[ASOnerr] = " ONERR ";
m_tokens[ASResume] = " RESUME "; m_tokens[ASRecall] = " RECALL ";
m_tokens[ASStore] = " STORE "; m_tokens[ASSpeed] = " SPEED= ";
m_tokens[ASLet] = " LET "; m_tokens[ASGoto] = " GOTO ";
m_tokens[ASRun] = " RUN "; m_tokens[ASIf] = " IF ";
m_tokens[ASRestore] = " RESTORE "; m_tokens[ASAMP] = " & ";
m_tokens[ASGosub] = " GOSUB "; m_tokens[ASReturn] = " RETURN ";
m_tokens[ASRem] = " REM "; m_tokens[ASStop] = " STOP ";
m_tokens[ASOn] = " ON "; m_tokens[ASWait] = " WAIT ";
m_tokens[ASLoad] = " LOAD "; m_tokens[ASSave] = " SAVE ";
m_tokens[ASDef] = " DEF "; m_tokens[ASPoke] = " POKE ";
m_tokens[ASPrint] = " PRINT "; m_tokens[ASCont] = " CONT ";
m_tokens[ASList] = " LIST "; m_tokens[ASClear] = " CLEAR ";
m_tokens[ASGet] = " GET "; m_tokens[ASNew] = " NEW ";
m_tokens[ASTab] = " TAB("; m_tokens[ASTo] = " TO ";
m_tokens[ASFn] = " FN "; m_tokens[ASSpc] = " SPC( ";
m_tokens[ASThen] = " THEN "; m_tokens[ASAt] = " AT ";
m_tokens[ASNot] = " NOT "; m_tokens[ASStep] = " STEP ";
m_tokens[ASPLUS] = " + "; m_tokens[ASMINUS] = " - ";
m_tokens[ASASTERISK] = " * "; m_tokens[ASSLASH] = " / ";
m_tokens[ASCARET] = " ^ "; m_tokens[ASAnd] = " AND ";
m_tokens[ASOr] = " OR "; m_tokens[ASGREATER] = " > ";
m_tokens[ASEQUAL] = " = "; m_tokens[ASLESS] = " < ";
m_tokens[ASSgn] = " SGN"; m_tokens[ASInt] = " INT";
m_tokens[ASAbs] = " ABS"; m_tokens[ASUsr] = " USR";
m_tokens[ASFre] = " FRE"; m_tokens[ASScrn] = " SCRN( ";
m_tokens[ASPdl] = " PDL"; m_tokens[ASPos] = " POS";
m_tokens[ASSqr] = " SQR"; m_tokens[ASRnd] = " RND";
m_tokens[ASLog] = " LOG"; m_tokens[ASExp] = " EXP";
m_tokens[ASCos] = " COS"; m_tokens[ASSin] = " SIN";
m_tokens[ASTan] = " TAN"; m_tokens[ASAtn] = " ATN";
m_tokens[ASPeek] = " PEEK"; m_tokens[ASLen] = " LEN";
m_tokens[ASStr] = " STR$"; m_tokens[ASVal] = " VAL";
m_tokens[ASAsc] = " ASC"; m_tokens[ASChr] = " CHR$";
m_tokens[ASLeft] = " LEFT$ "; m_tokens[ASRight] = " RIGHT$ ";
m_tokens[ASMid] = " MID$ ";
m_tokens[AS_EB] = "{Token 0xEB} "; m_tokens[AS_EC] = "{Token 0xEC} ";
m_tokens[AS_ED] = "{Token 0xED} "; m_tokens[AS_EE] = "{Token 0xEE} ";
m_tokens[AS_EF] = "{Token 0xEF} "; m_tokens[AS_F0] = "{Token 0xF0} ";
m_tokens[AS_F1] = "{Token 0xF1} "; m_tokens[AS_F2] = "{Token 0xF2} ";
m_tokens[AS_F3] = "{Token 0xF3} "; m_tokens[AS_F4] = "{Token 0xF4} ";
m_tokens[AS_F5] = "{Token 0xF5} "; m_tokens[AS_F6] = "{Token 0xF6} ";
m_tokens[AS_F7] = "{Token 0xF7} "; m_tokens[AS_F8] = "{Token 0xF8} ";
m_tokens[AS_F9] = "{Token 0xF9} "; m_tokens[AS_FA] = "{Token 0xFA} ";
m_tokens[AS_FB] = "{Token 0xFB} "; m_tokens[AS_FC] = "{Token 0xFC} ";
m_tokens[AS_FD] = "{Token 0xFD} "; m_tokens[AS_FE] = "{Token 0xFE} ";
m_tokens[AS_FF] = "{Token 0xFF} ";
}
const quint16 ApplesoftToken::ASEnd = 0x80; const quint16 ApplesoftToken::ASFor = 0x81;
const quint16 ApplesoftToken::ASNext = 0x82; const quint16 ApplesoftToken::ASData = 0x83;
const quint16 ApplesoftToken::ASInput = 0x84; const quint16 ApplesoftToken::ASDel = 0x85;
const quint16 ApplesoftToken::ASDim = 0x86; const quint16 ApplesoftToken::ASRead = 0x87;
const quint16 ApplesoftToken::ASGr = 0x88; const quint16 ApplesoftToken::ASText = 0x89;
const quint16 ApplesoftToken::ASPr = 0x8A; const quint16 ApplesoftToken::ASIn = 0x8B;
const quint16 ApplesoftToken::ASCall = 0x8C; const quint16 ApplesoftToken::ASPlot = 0x8D;
const quint16 ApplesoftToken::ASHlin = 0x8E; const quint16 ApplesoftToken::ASVlin = 0x8F;
const quint16 ApplesoftToken::ASHgr2 = 0x90; const quint16 ApplesoftToken::ASHgr = 0x91;
const quint16 ApplesoftToken::ASHcolor = 0x92; const quint16 ApplesoftToken::ASHplot = 0x93;
const quint16 ApplesoftToken::ASDraw = 0x94; const quint16 ApplesoftToken::ASXdraw = 0x95;
const quint16 ApplesoftToken::ASHtab = 0x96; const quint16 ApplesoftToken::ASHome = 0x97;
const quint16 ApplesoftToken::ASRot = 0x98; const quint16 ApplesoftToken::ASScale = 0x99;
const quint16 ApplesoftToken::ASShload = 0x9A; const quint16 ApplesoftToken::ASTrace = 0x9B;
const quint16 ApplesoftToken::ASNotrace = 0x9C; const quint16 ApplesoftToken::ASNormal = 0x9D;
const quint16 ApplesoftToken::ASInverse = 0x9E; const quint16 ApplesoftToken::ASFlash = 0x9F;
const quint16 ApplesoftToken::ASColor = 0xA0; const quint16 ApplesoftToken::ASPop = 0xA1;
const quint16 ApplesoftToken::ASVtab = 0xA2; const quint16 ApplesoftToken::ASHimem = 0xA3;
const quint16 ApplesoftToken::ASLomem = 0xA4; const quint16 ApplesoftToken::ASOnerr = 0xA5;
const quint16 ApplesoftToken::ASResume = 0xA6; const quint16 ApplesoftToken::ASRecall = 0xA7;
const quint16 ApplesoftToken::ASStore = 0xA8; const quint16 ApplesoftToken::ASSpeed = 0xA9;
const quint16 ApplesoftToken::ASLet = 0xAA; const quint16 ApplesoftToken::ASGoto = 0xAB;
const quint16 ApplesoftToken::ASRun = 0xAC; const quint16 ApplesoftToken::ASIf = 0xAD;
const quint16 ApplesoftToken::ASRestore = 0xAE; const quint16 ApplesoftToken::ASAMP = 0xAF;
const quint16 ApplesoftToken::ASGosub = 0xB0; const quint16 ApplesoftToken::ASReturn = 0xB1;
const quint16 ApplesoftToken::ASRem = 0xB2; const quint16 ApplesoftToken::ASStop = 0xB3;
const quint16 ApplesoftToken::ASOn = 0xB4; const quint16 ApplesoftToken::ASWait = 0xB5;
const quint16 ApplesoftToken::ASLoad = 0xB6; const quint16 ApplesoftToken::ASSave = 0xB7;
const quint16 ApplesoftToken::ASDef = 0xB8; const quint16 ApplesoftToken::ASPoke = 0xB9;
const quint16 ApplesoftToken::ASPrint = 0xBA; const quint16 ApplesoftToken::ASCont = 0xBB;
const quint16 ApplesoftToken::ASList = 0xBC; const quint16 ApplesoftToken::ASClear = 0xBD;
const quint16 ApplesoftToken::ASGet = 0xBE; const quint16 ApplesoftToken::ASNew = 0xBF;
const quint16 ApplesoftToken::ASTab = 0xC0; const quint16 ApplesoftToken::ASTo = 0xC1;
const quint16 ApplesoftToken::ASFn = 0xC2; const quint16 ApplesoftToken::ASSpc = 0xC3;
const quint16 ApplesoftToken::ASThen = 0xC4; const quint16 ApplesoftToken::ASAt = 0xC5;
const quint16 ApplesoftToken::ASNot = 0xC6; const quint16 ApplesoftToken::ASStep = 0xC7;
const quint16 ApplesoftToken::ASPLUS = 0xC8; const quint16 ApplesoftToken::ASMINUS = 0xC9;
const quint16 ApplesoftToken::ASASTERISK = 0xCA; const quint16 ApplesoftToken::ASSLASH = 0xCB;
const quint16 ApplesoftToken::ASCARET = 0xCC; const quint16 ApplesoftToken::ASAnd = 0xCD;
const quint16 ApplesoftToken::ASOr = 0xCE; const quint16 ApplesoftToken::ASGREATER = 0xCF;
const quint16 ApplesoftToken::ASEQUAL = 0xD0; const quint16 ApplesoftToken::ASLESS = 0xD1;
const quint16 ApplesoftToken::ASSgn = 0xD2; const quint16 ApplesoftToken::ASInt = 0xD3;
const quint16 ApplesoftToken::ASAbs = 0xD4; const quint16 ApplesoftToken::ASUsr = 0xD5;
const quint16 ApplesoftToken::ASFre = 0xD6; const quint16 ApplesoftToken::ASScrn = 0xD7;
const quint16 ApplesoftToken::ASPdl = 0xD8; const quint16 ApplesoftToken::ASPos = 0xD9;
const quint16 ApplesoftToken::ASSqr = 0xDA; const quint16 ApplesoftToken::ASRnd = 0xDB;
const quint16 ApplesoftToken::ASLog = 0xDC; const quint16 ApplesoftToken::ASExp = 0xDD;
const quint16 ApplesoftToken::ASCos = 0xDE; const quint16 ApplesoftToken::ASSin = 0xDF;
const quint16 ApplesoftToken::ASTan = 0xE0; const quint16 ApplesoftToken::ASAtn = 0xE1;
const quint16 ApplesoftToken::ASPeek = 0xE2; const quint16 ApplesoftToken::ASLen = 0xE3;
const quint16 ApplesoftToken::ASStr = 0xE4; const quint16 ApplesoftToken::ASVal = 0xE5;
const quint16 ApplesoftToken::ASAsc = 0xE6; const quint16 ApplesoftToken::ASChr = 0xE7;
const quint16 ApplesoftToken::ASLeft = 0xE8; const quint16 ApplesoftToken::ASRight = 0xE9;
const quint16 ApplesoftToken::ASMid = 0xEA; const quint16 ApplesoftToken::AS_EB = 0xEB;
const quint16 ApplesoftToken::AS_EC = 0xEC; const quint16 ApplesoftToken::AS_ED = 0xED;
const quint16 ApplesoftToken::AS_EE = 0xEE; const quint16 ApplesoftToken::AS_EF = 0xEF;
const quint16 ApplesoftToken::AS_F0 = 0xF0; const quint16 ApplesoftToken::AS_F1 = 0xF1;
const quint16 ApplesoftToken::AS_F2 = 0xF2; const quint16 ApplesoftToken::AS_F3 = 0xF3;
const quint16 ApplesoftToken::AS_F4 = 0xF4; const quint16 ApplesoftToken::AS_F5 = 0xF5;
const quint16 ApplesoftToken::AS_F6 = 0xF6; const quint16 ApplesoftToken::AS_F7 = 0xF7;
const quint16 ApplesoftToken::AS_F8 = 0xF8; const quint16 ApplesoftToken::AS_F9 = 0xF9;
const quint16 ApplesoftToken::AS_FA = 0xFA; const quint16 ApplesoftToken::AS_FB = 0xFB;
const quint16 ApplesoftToken::AS_FC = 0xFC; const quint16 ApplesoftToken::AS_FD = 0xFD;
const quint16 ApplesoftToken::AS_FE = 0xFE; const quint16 ApplesoftToken::AS_FF = 0xFF;

View File

@ -21,6 +21,77 @@ public:
static const quint16 StringVarTokenVal = 0x109;
static const quint16 StringAryVarTokenVal = 0x10A;
static const quint16 ASEnd; static const quint16 ASFor;
static const quint16 ASNext; static const quint16 ASData;
static const quint16 ASInput; static const quint16 ASDel;
static const quint16 ASDim; static const quint16 ASRead;
static const quint16 ASGr; static const quint16 ASText;
static const quint16 ASPr; static const quint16 ASIn;
static const quint16 ASCall; static const quint16 ASPlot;
static const quint16 ASHlin; static const quint16 ASVlin;
static const quint16 ASHgr2; static const quint16 ASHgr;
static const quint16 ASHcolor; static const quint16 ASHplot;
static const quint16 ASDraw; static const quint16 ASXdraw;
static const quint16 ASHtab; static const quint16 ASHome;
static const quint16 ASRot; static const quint16 ASScale;
static const quint16 ASShload; static const quint16 ASTrace;
static const quint16 ASNotrace; static const quint16 ASNormal;
static const quint16 ASInverse; static const quint16 ASFlash;
static const quint16 ASColor; static const quint16 ASPop;
static const quint16 ASVtab; static const quint16 ASHimem;
static const quint16 ASLomem; static const quint16 ASOnerr;
static const quint16 ASResume; static const quint16 ASRecall;
static const quint16 ASStore; static const quint16 ASSpeed;
static const quint16 ASLet; static const quint16 ASGoto;
static const quint16 ASRun; static const quint16 ASIf;
static const quint16 ASRestore; static const quint16 ASAMP;
static const quint16 ASGosub; static const quint16 ASReturn;
static const quint16 ASRem; static const quint16 ASStop;
static const quint16 ASOn; static const quint16 ASWait;
static const quint16 ASLoad; static const quint16 ASSave;
static const quint16 ASDef; static const quint16 ASPoke;
static const quint16 ASPrint; static const quint16 ASCont;
static const quint16 ASList; static const quint16 ASClear;
static const quint16 ASGet; static const quint16 ASNew;
static const quint16 ASTab; static const quint16 ASTo;
static const quint16 ASFn; static const quint16 ASSpc;
static const quint16 ASThen; static const quint16 ASAt;
static const quint16 ASNot; static const quint16 ASStep;
static const quint16 ASPLUS; static const quint16 ASMINUS;
static const quint16 ASASTERISK; static const quint16 ASSLASH;
static const quint16 ASCARET; static const quint16 ASAnd;
static const quint16 ASOr; static const quint16 ASGREATER;
static const quint16 ASEQUAL; static const quint16 ASLESS;
static const quint16 ASSgn; static const quint16 ASInt;
static const quint16 ASAbs; static const quint16 ASUsr;
static const quint16 ASFre; static const quint16 ASScrn;
static const quint16 ASPdl; static const quint16 ASPos;
static const quint16 ASSqr; static const quint16 ASRnd;
static const quint16 ASLog; static const quint16 ASExp;
static const quint16 ASCos; static const quint16 ASSin;
static const quint16 ASTan; static const quint16 ASAtn;
static const quint16 ASPeek; static const quint16 ASLen;
static const quint16 ASStr; static const quint16 ASVal;
static const quint16 ASAsc; static const quint16 ASChr;
static const quint16 ASLeft; static const quint16 ASRight;
static const quint16 ASMid; static const quint16 AS_EB;
static const quint16 AS_EC; static const quint16 AS_ED;
static const quint16 AS_EE; static const quint16 AS_EF;
static const quint16 AS_F0; static const quint16 AS_F1;
static const quint16 AS_F2; static const quint16 AS_F3;
static const quint16 AS_F4; static const quint16 AS_F5;
static const quint16 AS_F6; static const quint16 AS_F7;
static const quint16 AS_F8; static const quint16 AS_F9;
static const quint16 AS_FA; static const quint16 AS_FB;
static const quint16 AS_FC; static const quint16 AS_FD;
static const quint16 AS_FE; static const quint16 AS_FF;
typedef enum {
UNKNOWN_TOKEN = 0x0,
@ -86,4 +157,5 @@ private:
};
#endif // APPLESOFTTOKEN_H

View File

@ -35,12 +35,19 @@ HiresViewWidget::HiresViewWidget(QWidget *parent) :
ntscAction->setChecked(true);
formatGroup->addAction(ntscAction);
perPixelColorAction= new QAction("Per Pixel Color Display",this);
perPixelColorAction->setCheckable(true);
perPixelColorAction->setChecked(false);
formatGroup->addAction(perPixelColorAction);
showScanLinesAction = new QAction("Show Scan Lines",this);
showScanLinesAction->setCheckable(true);
showScanLinesAction->setChecked(true);
connect(ntscAction, SIGNAL(toggled(bool)), this, SLOT(handleNtscAction(bool)));
connect(monochromeAction, SIGNAL(toggled(bool)), this, SLOT(handleMonochromeAction(bool)));
connect(perPixelColorAction, SIGNAL(toggled(bool)), this, SLOT(handlePerPixelColorAction(bool)));
connect(showScanLinesAction, SIGNAL(toggled(bool)), this, SLOT(handleShowScanLinesAction(bool)));
}
@ -59,6 +66,13 @@ void HiresViewWidget::handleMonochromeAction(bool toggled) {
}
}
void HiresViewWidget::handlePerPixelColorAction(bool toggled) {
if (toggled) {
m_viewMode = Color1;
update();
}
}
void HiresViewWidget::handleShowScanLinesAction(bool toggled) {
m_showScanLines = toggled;
update();
@ -376,7 +390,7 @@ QColor HiresViewWidget::getColorFromBits(QBitArray bits, quint8 phase)
void HiresViewWidget::drawNtscLine(QPainter &painter, int lineNum, QBitArray data) {
QVector<QColor> colors;
colors.resize(data.count()+4);
colors.resize(data.count()+3);
for (int idx = 0; idx < data.count(); idx++) {
QBitArray tmp(4);
@ -474,14 +488,13 @@ void HiresViewWidget::makeOffsetTable() {
}
outer += 0x0080;
}
}
void HiresViewWidget::contextMenuEvent(QContextMenuEvent *event) {
QMenu menu(this);
menu.addAction(monochromeAction);
menu.addAction(ntscAction);
menu.addAction(perPixelColorAction);
menu.addSeparator();
menu.addAction(showScanLinesAction);
menu.exec(event->globalPos());

View File

@ -56,6 +56,7 @@ public slots:
protected slots:
void handleNtscAction(bool toggled);
void handleMonochromeAction(bool toggled);
void handlePerPixelColorAction(bool toggled);
void handleShowScanLinesAction(bool toggled);
private:
QPixmap m_pixmap;
@ -76,6 +77,7 @@ private:
QAction *monochromeAction;
QAction *ntscAction;
QAction *perPixelColorAction;
QAction *showScanLinesAction;
QActionGroup *formatGroup;