summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 08:42:58 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 08:42:58 +1100
commitb1c9034b2f91ba8f12ae2308196f4de7fa7359bd (patch)
treeb19188003d546a3d9ea43b4c5525c6759de41aa0
parent9ecaf2877f93664497110edf256fbc7825cd30f9 (diff)
changed TerminalShiftRegister to VRAM
-rw-r--r--src/video/ncurses.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/video/ncurses.c b/src/video/ncurses.c
index 1fbc314..c7cf3fb 100644
--- a/src/video/ncurses.c
+++ b/src/video/ncurses.c
@@ -14,11 +14,11 @@ int TermY = 0;
WINDOW *AppleWindow;
-const byte* TerminalShiftRegister;
+const byte* VRAM;
-byte* TerminalShiftRegisterPosition;
+byte* VRAM_Position;
-int TerminalShiftRegisterOffset;
+int VRAM_Offset;
void PrintInfo()
@@ -81,9 +81,9 @@ void DisplayInit()
mvwaddch(AppleWindow, TermY, TermX, '@' | A_BLINK);
// Initialize the terminal shift register variables.
- TerminalShiftRegister = (byte*)malloc(960);
- TerminalShiftRegisterPosition = TerminalShiftRegister;
- TerminalShiftRegisterOffset = 0;
+ VRAM = (byte*)malloc(960);
+ VRAM_Position = VRAM;
+ VRAM_Offset = 0;
refresh();
}
@@ -92,7 +92,7 @@ void DisplayInit()
void DisplayClose()
{
- free(TerminalShiftRegister);
+ free(VRAM);
curs_set(1);
endwin();
}
@@ -112,10 +112,10 @@ void DisplayInput(byte n)
mvwaddch(AppleWindow, TermY, TermX, n);
// Add character to register
- *TerminalShiftRegisterPosition = n;
- TerminalShiftRegisterPosition++;
- if (TerminalShiftRegisterPosition >= (TerminalShiftRegister + 960))
- TerminalShiftRegisterPosition = TerminalShiftRegister;
+ *VRAM_Position = n;
+ VRAM_Position++;
+ if (VRAM_Position >= (VRAM + 960))
+ VRAM_Position = VRAM;
TermX++;
// If X is past width..
@@ -128,20 +128,20 @@ void DisplayInput(byte n)
// If Y is past height..
if (TermY >= 24) {
//.. discard the first line..
- TerminalShiftRegisterOffset += 40;
+ VRAM_Offset += 40;
//.. verify the register offset..
- if (TerminalShiftRegisterOffset >= 960)
- TerminalShiftRegisterOffset = TerminalShiftRegister;
+ if (VRAM_Offset >= 960)
+ VRAM_Offset = VRAM;
//.. and create an offset variable to cycle through memory with.
- byte *offset = TerminalShiftRegister + TerminalShiftRegisterOffset;
+ byte *offset = VRAM + VRAM_Offset;
// Then, for every cell of the screen, fill with the contents of the video memory.
for (int i = 0; i < 23; i++) {
for (int j = 0; j < 40; j++) {
- if (offset >= (TerminalShiftRegister + 960))
- offset -= TerminalShiftRegister;
+ if (offset >= (VRAM + 960))
+ offset -= VRAM;
mvwaddch(AppleWindow, i, j, *offset );
offset++;
}}