7 #include "Screen.hpp"
\r
8 #include "RegEdit.HPP"
\r
11 RegisterEditor::RegisterEditor(istream &ins)
\r
12 : RegisterTable(ins)
\r
14 prevSel = select = 0;
\r
17 void RegisterEditor::printCon(int r)
\r
19 // This gotoxy divides the registers into two columns.
\r
20 gotoxy(40*(r / editHeight) +1, r % editHeight +1);
\r
21 // Optionally print the left cursor.
\r
22 textattr(CURSOR_COLOR);
\r
23 cprintf(r==select ? "\20" : " ");
\r
24 // Then put out the meat.
\r
26 // And possibly the right cursor.
\r
27 textattr(CURSOR_COLOR);
\r
28 cprintf(r==select ? "\21" : " ");
\r
29 // This gotoxy just puts the hardware cursor where it won't distract you.
\r
30 gotoxy(40*(r / editHeight)+38, r % editHeight +1);
\r
33 void RegisterEditor::printAllCon()
\r
35 for (int r = 0; r < registers; r++)
\r
39 int RegisterEditor::updateSelect()
\r
42 select = registers - 1;
\r
44 if (select >= registers)
\r
46 if (prevSel != select)
\r
56 // RegisterEditor::showBitMask() updates the bit pattern display with
\r
57 // the value of selected register. This is TWEAK specific.
\r
59 void RegisterEditor::showBitMask()
\r
61 gotoxy(42,editHeight-4);
\r
62 textattr(BITHEADER_COLOR);
\r
63 cprintf("Bit mask: 7 6 5 4 3 2 1 0");
\r
64 gotoxy(51,editHeight-3);
\r
65 textattr(BITPATTERN_COLOR);
\r
66 unsigned char v = reg[select].getValue();
\r
67 for (int e=7; e>=0; e--)
\r
68 cprintf( v&(1<<e) ? " 1" : " 0");
\r