summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/mbbsd/screen.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/pttbbs/mbbsd/screen.c b/pttbbs/mbbsd/screen.c
index b03dd784..606ec5e2 100644
--- a/pttbbs/mbbsd/screen.c
+++ b/pttbbs/mbbsd/screen.c
@@ -18,6 +18,16 @@ static unsigned char _typeahead = 1;
#define MODIFIED (1) /* if line has been modifed, screen output */
#define STANDOUT (2) /* if this line has a standout region */
+inline
+screenline_t* GetLine(int i) {
+ return &big_picture[(i + roll) % scr_lns];
+}
+
+inline
+screenline_t* GetCurrentLine() {
+ return GetLine(cur_ln);
+}
+
void
change_scroll_range(int top, int bottom)
{
@@ -122,7 +132,7 @@ move_ansi(int y, int x)
if (y >= scr_lns || x < 1)
return;
- slp = &big_picture[y];
+ slp = GetLine(y);
if (slp->len < 1)
return;
@@ -156,7 +166,7 @@ getyx_ansi(int *py, int *px)
if (y >= scr_lns || x < 1)
return;
- slp = &big_picture[y];
+ slp = GetLine(y);
if (slp->len < 1)
return;
c = slp->data[x];
@@ -165,14 +175,6 @@ getyx_ansi(int *py, int *px)
slp->data[x] = c;
}
-static inline
-screenline_t* GetCurrentLine(){
- register int i = cur_ln + roll;
- if(i >= scr_lns)
- i %= scr_lns;
- return &big_picture[i];
-}
-
static void
rel_move(int was_col, int was_ln, int new_col, int new_ln)
{