aboutsummaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-02-18 13:26:59 -0500
committerB. Watson <urchlay@slackware.uk>2026-02-18 13:26:59 -0500
commite05376aefc6b342859e8cddf9eca647dc61c3336 (patch)
treee52de6d8717bf549aa4c91b44b4d2297711f821e /src/screen.c
parent48feffd829f30d393b39ae1cbdc7bf3eddca7652 (diff)
downloadfujinet-chat-e05376aefc6b342859e8cddf9eca647dc61c3336.tar.gz
More work...
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/screen.c b/src/screen.c
index 7f34331..3e3f5df 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -6,11 +6,14 @@
#define SDLST ((u16 *)0x0230)
-char scr_active[MAX_SCREENS];
+char scr_status[MAX_SCREENS];
/* the screen that's currently displaying */
char scr_current;
+/* the screen that's currently being written to */
+char scr_active;
+
static char scr_names[7][32];
static char scr_topics[7][40];
@@ -43,12 +46,12 @@ void scr_init(void) {
for(i = 0; i < MAX_SCREENS; i++) {
scr_clear(i);
- scr_active[i] = SCR_UNUSED;
+ scr_status[i] = SCR_UNUSED;
}
strcpy(scr_names[0], "[server]");
strcpy(scr_names[1], "[private]");
- scr_active[0] = scr_active[1] = SCR_INACTIVE;
+ scr_status[0] = scr_status[1] = SCR_INACTIVE;
OS.sdmctl = old_dma;
@@ -59,9 +62,9 @@ char scr_create(const char *name, char display) {
int i;
for(i = 0; i < MAX_SCREENS; i++) {
- if(scr_active[i] == SCR_UNUSED) {
+ if(scr_status[i] == SCR_UNUSED) {
strcpy(scr_names[i], name);
- scr_active[i] = SCR_INACTIVE;
+ scr_status[i] = SCR_INACTIVE;
scr_topics[i][0] = '\0';
if(display)
scr_display(i);
@@ -71,7 +74,7 @@ char scr_create(const char *name, char display) {
}
}
- // scr_print(SCR_CURR, "Can't create window (all in use)\n");
+ // scr_print_current("Can't create window (all in use)\n");
return 0xff;
}
@@ -80,7 +83,7 @@ void scr_destroy(char s) {
if(s < 2 || s >= MAX_SCREENS)
return;
- scr_active[s] = SCR_UNUSED;
+ scr_status[s] = SCR_UNUSED;
if(scr_current == s)
scr_display(0);
}
@@ -94,11 +97,11 @@ void scr_display(char s) {
return;
/* leave this out, for testing
- if(scr_active[s] == SCR_UNUSED)
+ if(scr_status[s] == SCR_UNUSED)
return;
*/
- scr_active[s] = SCR_INACTIVE;
+ scr_status[s] = SCR_INACTIVE;
scr_current = s;
scr_waitvcount(112);
@@ -118,7 +121,7 @@ void scr_show_status(char s) {
p = status_box + 33;
for(i = 0; i < MAX_SCREENS; i++) {
- switch(scr_active[i]) {
+ switch(scr_status[i]) {
case SCR_ACTIVE:
sc = 128 | ('1' + i); break;
case SCR_INACTIVE:
@@ -214,9 +217,18 @@ void scr_print(char s, const char *text) {
scr_activate(s);
}
+void scr_print_current(const char *text) {
+ scr_print(scr_current, text);
+}
+
+void scr_print_active(const char *text) {
+ scr_print(scr_active, text);
+}
+
void scr_activate(char s) {
if(s != scr_current) {
- scr_active[s] = SCR_ACTIVE;
+ scr_status[s] = SCR_ACTIVE;
scr_show_status(scr_current);
}
+ scr_active = s;
}