diff options
Diffstat (limited to 'src/screen.c')
| -rw-r--r-- | src/screen.c | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/src/screen.c b/src/screen.c index 350a60c..02cc45a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -5,9 +5,14 @@ #include "screen.h" #include "edbox.h" #include "indic8.h" +#include "streq.h" #define SDLST ((u16 *)0x0230) +/* if DOS isn't being used, the config will carve up the $0700-$1fff + area for extra scrollback. */ +unsigned int *bonus_addrs = (unsigned int *)0xd4; /* aka FR0 */ + char scr_status[MAX_SCREENS]; /* the screen that's currently displaying */ @@ -20,18 +25,26 @@ char scr_names[7][32]; static char xpos; -void scr_waitvcount(u8 c) { - while(ANTIC.vcount < c) +void scr_waitvcount_116(void) { + while(ANTIC.vcount < 116) /* NOP */; } static void scr_clear(char s) { + if(bonus_addrs[s]) { + memset(bonus_addrs[s], 0, 1000); + strcpy(bonus_addrs[s], "This is bonus scrollback!"); + } memset(screen_top_addrs[s], 0, 1000); memset(screen_bot_addrs[s], 0, 1000); memset(scr_names[s], 0, 32); } static void scr_scroll(char s) { + if(bonus_addrs[s]) { + memmove(bonus_addrs[s], bonus_addrs[s] + 40, 960); + memmove(bonus_addrs[s] + 960, screen_top_addrs[s], 40); + } memmove(screen_top_addrs[s], screen_top_addrs[s] + 40, 960); memmove(screen_top_addrs[s] + 960, screen_bot_addrs[s], 40); memmove(screen_bot_addrs[s], screen_bot_addrs[s] + 40, 920); @@ -43,9 +56,7 @@ void scr_init(void) { OS.sdmctl = 0; /* disappear the screen */ - ind_net_status = status_box + 40; - - scr_waitvcount(112); /* after the last GR.0 line */ + scr_waitvcount_116(); *SDLST = DLIST_BOT_ADDR; OS.chbas = FONT_ADDR_HI; @@ -111,22 +122,29 @@ void scr_display(char s) { scr_status[s] = SCR_INACTIVE; scr_current = s; - scr_waitvcount(112); + scr_waitvcount_116(); *dlist_bot_lms = (u16)screen_bot_addrs[s]; scr_show_status(s); } +void scr_scrollback_bonus(void) { + if(bonus_addrs[scr_current]) { + scr_waitvcount_116(); + *dlist_top_lms = (u16)bonus_addrs[scr_current]; + } +} + void scr_scrollback(void) { // OS.color2 = 0; - scr_waitvcount(112); + scr_waitvcount_116(); *dlist_top_lms = (u16)screen_top_addrs[scr_current]; *SDLST = (u16)dlist_top; } void scr_end_scrollback(void) { // OS.color2 = 192; - scr_waitvcount(112); + scr_waitvcount_116(); *SDLST = (u16)dlist_bot; } @@ -150,6 +168,9 @@ void scr_show_status(char s) { case SCR_ACTIVE: /* color1 */ sc |= 0x40; break; + case SCR_OTHER: /* color2 */ + sc |= 0x80; + break; case SCR_HILITE: /* color3 */ sc |= 0xc0; break; @@ -162,18 +183,12 @@ void scr_show_status(char s) { // *p++ = 0xbe; if(!edbox_visible) { - scr_waitvcount(112); + scr_waitvcount_116(); *dlist_status_lms = (u16)status_box; *dlist_last_line = 0x06; /* ANTIC GR.1 */ } } -void scr_hilite_active(void) { - if(scr_active == scr_current) return; - scr_status[scr_active] = SCR_HILITE; - scr_show_status(scr_current); -} - void scr_refresh(void) { scr_display(scr_current); } @@ -184,7 +199,7 @@ char scr_getbyname(const char *name) { if(!name) return 0; for(i = 2; i < MAX_SCREENS; i++) { - if(strcasecmp(name, scr_names[i]) == 0) + if(streq_i(name, scr_names[i])) return i; } @@ -286,10 +301,12 @@ void scr_print_priv(const char *text) { } void scr_activate(char s) { + /* if(s != scr_current) { if(scr_status[s] != SCR_HILITE) scr_status[s] = SCR_ACTIVE; scr_show_status(scr_current); } + */ scr_active = s; } |
