diff options
| -rw-r--r-- | config/config.c | 11 | ||||
| -rw-r--r-- | doc/scrollback.txt | 6 | ||||
| -rw-r--r-- | src/irc.c | 9 | ||||
| -rw-r--r-- | src/screen.c | 19 | ||||
| -rw-r--r-- | src/screen.h | 1 |
5 files changed, 42 insertions, 4 deletions
diff --git a/config/config.c b/config/config.c index c8f1a48..bd9c1a6 100644 --- a/config/config.c +++ b/config/config.c @@ -45,6 +45,8 @@ char numbuf[4]; char server[101]; char port[6]; +unsigned int *bonus_addrs = 0xf0; + char lcgetc(void) { char c; @@ -183,7 +185,14 @@ void prompt_alert_type(void) { } void no_dos(void) { - print("No DOS booted\n"); + print("No DOS booted (using $0700 area for\nextra scrollback)\n"); + bonus_addrs[0] = 0x0700; + bonus_addrs[1] = 0x0ae8; + bonus_addrs[2] = 0x1000; /* start on a 4K boundary */ + bonus_addrs[3] = 0x13e8; + bonus_addrs[4] = 0x17d0; + bonus_addrs[5] = 0x1bb8; + bonus_addrs[6] = 0; /* screen #7 doesn't have this */ } char want_overwrite() { diff --git a/doc/scrollback.txt b/doc/scrollback.txt index 7aa2b54..93e1117 100644 --- a/doc/scrollback.txt +++ b/doc/scrollback.txt @@ -15,8 +15,10 @@ $0700 (MEMLO) to the start of the code ($2000). This would be enough for 6 of the screens to have another 25 lines (73 each). Of course the user would have no place to save his config file (can we use the FujiNet for that, without bloating up the code?)... also, the -load address could be bumped up to $2300 or so, which would give -us all 7 screens. +load address could be bumped up to $2400, which would give +us all 7 screens. **Partially implemented: screens 1-6 get an +extra (bonus) 25 lines of scrollback if DOS is not booted. Screen +7 is still 48 lines tall. 1.5. Same as 1, but we convert the binary to a boot disk, so we just load at $0700. Still can use the disk (image?) to write the config to @@ -812,10 +812,17 @@ void irc_register(void) { } static void scrollback() { + char c; scr_scrollback(); while(!keypress()) irc_read(); - kgetc(); + c = kgetc(); + if(c == '-') { + scr_scrollback_bonus(); + while(!keypress()) + irc_read(); + kgetc(); + } scr_end_scrollback(); } diff --git a/src/screen.c b/src/screen.c index 42a7e65..2d4436f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -8,6 +8,10 @@ #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 *)0xf0; + char scr_status[MAX_SCREENS]; /* the screen that's currently displaying */ @@ -26,12 +30,20 @@ void scr_waitvcount(u8 c) { } 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); @@ -115,6 +127,13 @@ void scr_display(char s) { scr_show_status(s); } +void scr_scrollback_bonus(void) { + if(bonus_addrs[scr_current]) { + scr_waitvcount(112); + *dlist_top_lms = (u16)bonus_addrs[scr_current]; + } +} + void scr_scrollback(void) { // OS.color2 = 0; scr_waitvcount(112); diff --git a/src/screen.h b/src/screen.h index 9acd720..0d3e268 100644 --- a/src/screen.h +++ b/src/screen.h @@ -57,6 +57,7 @@ void scr_display(char s); note that it's a bad idea to write to the screen while it's scrolled back! */ void scr_scrollback(void); +void scr_scrollback_bonus(void); /* end scrollback mode (display the bottom 23 lines + status) */ void scr_end_scrollback(void); |
