diff options
Diffstat (limited to 'src/video/ncurses.c')
-rw-r--r-- | src/video/ncurses.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/video/ncurses.c b/src/video/ncurses.c index 3b22231..aafde9e 100644 --- a/src/video/ncurses.c +++ b/src/video/ncurses.c @@ -3,7 +3,6 @@ // Provides an in-terminal interface to the emulator. #include<ncurses.h> -#include"interface.h" #include"../apple.h" #include"../cpu/6502.h" @@ -18,37 +17,8 @@ int vPosition = 0; int vOffset = 0; -void PrintInfo() -{ - mvprintw(2, 43, " acc : %02x", acc); - mvprintw(3, 43, " X : %02x", X ); - mvprintw(4, 43, " Y : %02x", Y ); - mvprintw(5, 43, " PC : %04x", PC); - mvprintw(6, 43, " S : %02x", S ); - mvprintw(7, 43, "Flags : %c%c_%c%c%c%c%c", - GetFlag(flag_N) ? 'N':'.' , - GetFlag(flag_V) ? 'V':'.' , - GetFlag(flag_B) ? 'B':'.' , - GetFlag(flag_D) ? 'D':'.' , - GetFlag(flag_I) ? 'I':'.' , - GetFlag(flag_Z) ? 'Z':'.' , - GetFlag(flag_C) ? 'C':'.' - ); - mvprintw(2, 65, "Stack"); - int count = 3; - for (int i = 0x1ff; i > 0x1e8; i--) { - if (i == (0x1ff-S)) // Indicate the stack pointer! - attron(A_REVERSE); - mvprintw(count, 65, "%x : %x", i, GetMemory(i)); - attroff(A_REVERSE); - count++; - } - refresh(); -} - - -void DisplayInit() +void DisplayInit_Ncurses() { // ncurses initialization functions. initscr(); @@ -85,7 +55,7 @@ void DisplayInit() -void DisplayClose() +void DisplayClose_Ncurses() { free(VRAM); curs_set(1); @@ -94,7 +64,7 @@ void DisplayClose() -void DisplayInput(byte n) +void DisplayInput_Ncurses(byte n) { if (n == BS) { return; @@ -160,3 +130,33 @@ void DisplayInput(byte n) mvwaddch(AppleWindow, TermY, TermX, '@' | A_BLINK); wrefresh(AppleWindow); } + + + +void PrintInfo_Ncurses() +{ + mvprintw(2, 43, " acc : %02x", acc); + mvprintw(3, 43, " X : %02x", X ); + mvprintw(4, 43, " Y : %02x", Y ); + mvprintw(5, 43, " PC : %04x", PC); + mvprintw(6, 43, " S : %02x", S ); + mvprintw(7, 43, "Flags : %c%c_%c%c%c%c%c", + GetFlag(flag_N) ? 'N':'.' , + GetFlag(flag_V) ? 'V':'.' , + GetFlag(flag_B) ? 'B':'.' , + GetFlag(flag_D) ? 'D':'.' , + GetFlag(flag_I) ? 'I':'.' , + GetFlag(flag_Z) ? 'Z':'.' , + GetFlag(flag_C) ? 'C':'.' + ); + mvprintw(2, 65, "Stack"); + int count = 3; + for (int i = 0x1ff; i > 0x1e8; i--) { + if (i == (0x1ff-S)) // Indicate the stack pointer! + attron(A_REVERSE); + mvprintw(count, 65, "%x : %x", i, GetMemory(i)); + attroff(A_REVERSE); + count++; + } + refresh(); +} |