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); }
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; }
WORD RefreshWatchpoints(WORD maxLines, BOOL fullRefresh) { WORD count = 0; WORD i, undef; ULONG val; BOOL flag = FALSE; for (i=0; i<MAXWP && maxLines > 0; i++) { switch (wpTable[i].type) { case WP_UNSET: break; case WP_BYTES: val = ParseExp(wpTable[i].expression, &undef, strlen(wpTable[i].expression)); if (undef) ScrPrintf("%-24.24s *UNDEFINED*", wpTable[i].expression); else { WORD j = (CurDisplay->ds_ScrCols-35)/3; UBYTE *ps = (UBYTE *)val; if (!flag) { flag = ShowWatchTitle(fullRefresh,&count,&maxLines); } ScrPrintf("%-24.24s %08X ", wpTable[i].expression, val); while (j > 0) { ScrPrintf("%02X ", *ps++); --j; } } count++; Newline(); maxLines--; break; case WP_WORDS: val = ParseExp(wpTable[i].expression, &undef, strlen(wpTable[i].expression)); if (undef) ScrPrintf("%-24.24s *UNDEFINED*", wpTable[i].expression); else { WORD j = (CurDisplay->ds_ScrCols-35)/5; UWORD *ps = (UWORD *)val; if (!flag) { flag = ShowWatchTitle(fullRefresh,&count,&maxLines); } ScrPrintf("%-24.24s %08X ", wpTable[i].expression, val); while (j > 0) { ScrPrintf("%04X ", *ps++); --j; } } count++; Newline(); maxLines--; break; case WP_LONGS: val = ParseExp(wpTable[i].expression, &undef, strlen(wpTable[i].expression)); if (undef) ScrPrintf("%-24.24s *UNDEFINED*", wpTable[i].expression); else { WORD j = (CurDisplay->ds_ScrCols-35)/9; ULONG *ps = (ULONG *)val; if (!flag) { flag = ShowWatchTitle(fullRefresh,&count,&maxLines); } ScrPrintf("%-24.24s %08X ", wpTable[i].expression, val); while (j > 0) { ScrPrintf("%08X ", *ps++); --j; } } count++; Newline(); maxLines--; break; } } // add a newline to end if at top of screen if(flag && !CurDisplay->ds_RegFlag) { Newline(); count++; maxLines++; } return count; }
Local BOOL RefreshRegister(char *regName, ULONG current, ULONG last) { ScrPlain(); ScrPrintf("%s: ", regName); if (current != last)ScrHighlight(); ScrPrintf("$%08X ", current); }