summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 07:09:28 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 07:09:28 +1100
commit88e6422ec31938fbff7b4fb9c5ddf63fc9f14a09 (patch)
treead4838998c6a8990e0ce81d22fbf4d325229fc43 /src/video
parent8ec080d0cd9fd62c0de20780581a4750d078ea94 (diff)
small changes
Diffstat (limited to 'src/video')
-rw-r--r--src/video/ncurses.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/video/ncurses.c b/src/video/ncurses.c
index 0e261bb..a3ae8a4 100644
--- a/src/video/ncurses.c
+++ b/src/video/ncurses.c
@@ -20,20 +20,28 @@ byte UserInput()
int c = getch();
byte r;
- switch(c)
- {
+ if (c == 0x08) // If c is backspace
+ return 0xDF;
+
+ if (c < 0x20) {
+ if (c != 0x0D // CR
+ && c != 0x1B) // Exit
+ return -1;
+ }
+ //switch(c)
+ //{
// Convert special characters
- case KEY_F(1): //backspace
+ /*case KEY_F(1): //backspace
r = 0xDF;
break;
case KEY_F(2): //enter
r = 0x8D;
break;
- case KEY_F(3): //exit. TODO: Figure out if this is Esc or not.
+ case KEY_F(3): //exit, for escape. TODO: Figure out if this is Esc or not.
r = 0x9B;
- break;
+ break;*/
// Convert regular characters
- default:
+ /*default:
if (c < 0x20 || c >= 0x60)
return -1;
@@ -43,15 +51,9 @@ byte UserInput()
r = c;
break;
- }
-
- //SetMemory(KBD, r);
-
-
- //TerminalInput(r);
-
+ }*/
- return r;
+ return c;
}
@@ -59,11 +61,12 @@ byte UserInput()
void PrintInfo()
{
- mvprintw(2, 43, " acc : %x", acc);
- mvprintw(3, 43, " X : %x", X );
- mvprintw(4, 43, " Y : %x", Y );
- mvprintw(5, 43, " PC : %x", PC);
- mvprintw(6, 43, "Flags : %c%c_%c%c%c%c%c",
+ 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':'.' ,
@@ -74,7 +77,7 @@ void PrintInfo()
);
mvprintw(2, 65, "Stack");
int count = 3;
- for (int i = 0x1ff; i > 0x1cf; i--) {
+ 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));