WORD RefreshRegisters(WORD maxLines, BOOL fullRefresh) { WORD count = 0; if(CurDisplay->ds_RegFlag) { RefreshRegister("D0", programD0, lastD0); RefreshRegister("D1", programD1, lastD1); RefreshRegister("D2", programD2, lastD2); RefreshRegister("D3", programD3, lastD3); count++; Newline(); maxLines--; if (!maxLines) return count; RefreshRegister("D4", programD4, lastD4); RefreshRegister("D5", programD5, lastD5); RefreshRegister("D6", programD6, lastD6); RefreshRegister("D7", programD7, lastD7); count++; Newline(); maxLines--; if (!maxLines) return count; RefreshRegister("A0", programA0, lastA0); RefreshRegister("A1", programA1, lastA1); RefreshRegister("A2", programA2, lastA2); RefreshRegister("A3", programA3, lastA3); count++; Newline(); maxLines--; if (!maxLines) return count; RefreshRegister("A4", programA4, lastA4); RefreshRegister("A5", programA5, lastA5); RefreshRegister("A6", programA6, lastA6); RefreshRegister("A7", programA7, lastA7); count++; Newline(); maxLines--; if (!maxLines) return count; RefreshRegister("PC", programPC, lastPC); ScrPlain(); ScrPrintf("SR: "); if (programSR != lastSR)ScrHighlight(); ScrPrintf("$%04X ", programSR); DisplayFlags(); ScrPlain(); ScrPrintf("STATE: "); if (programState != lastState) ScrHighlight(); ScrPrintf("%s", StateText(programState)); count++; Newline(); maxLines--; if (!maxLines) return count; } return count; }
Local void DisplayFlags(void) { ScrPlain(); // ScrPrintf("T=%c ", (programSR & 0x8000) ? '1' : '0'); // ScrPrintf("S=%c ", (programSR & 0x2000) ? '1' : '0'); ScrPrintf("X=%c ", (programSR & 0x0010) ? '1' : '0'); ScrPrintf("N=%c ", (programSR & 0x0008) ? '1' : '0'); ScrPrintf("Z=%c ", (programSR & 0x0004) ? '1' : '0'); ScrPrintf("V=%c ", (programSR & 0x0002) ? '1' : '0'); ScrPrintf("C=%c ", (programSR & 0x0001) ? '1' : '0'); // ScrPrintf("IM=%d ", (programSR>>8)&7); }
BOOL ShowWatchTitle(BOOL fullRefresh, WORD *count, WORD *maxLines) { if(fullRefresh != -1) { if(CurDisplay->ds_RegFlag) { Newline(); (*count)++; (*maxLines)++; } } ScrPlain(); ScrInverse(); ScrPuts("WATCHPOINT ADDRESS CONTENTS"); // xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xx Newline(); (*count)++; (*maxLines)++; return TRUE; }
Local BOOL RefreshRegister(char *regName, ULONG current, ULONG last) { ScrPlain(); ScrPrintf("%s: ", regName); if (current != last)ScrHighlight(); ScrPrintf("$%08X ", current); }