summaryrefslogtreecommitdiffstats
path: root/screen_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen_buffer.c')
-rw-r--r--screen_buffer.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/screen_buffer.c b/screen_buffer.c
index d56ae88..44635a7 100644
--- a/screen_buffer.c
+++ b/screen_buffer.c
@@ -1,14 +1,14 @@
-/* --*- C -*--
- *
+/* --*- C -*--
+ *
* By Jani Averbach, Jaa@iki.fi, 2001
- *
+ *
* Released under version 2 of the Gnu Public License.
*
- * $Author: jaa $
- * $Revision: 1.10 $
- * $Date: 2001/03/29 09:00:30 $
+ * $Author: jaa $
+ * $Revision: 1.10 $
+ * $Date: 2001/03/29 09:00:30 $
* $Source: /home/raid/cvs/memtest86/screen_buffer.c,v $ (for CVS)
- *
+ *
*/
#include "test.h"
#include "screen_buffer.h"
@@ -18,7 +18,7 @@
#define SCREEN_Y 25
#define Y_SIZE SCREEN_Y
/*
- * X-size should by one of by screen size,
+ * X-size should by one of by screen size,
* so that there is room for ending '\0'
*/
#define X_SIZE SCREEN_X+1
@@ -41,8 +41,8 @@ char
get_scrn_buf(const int y,
const int x)
{
- CHECK_BOUNDS(y,x);
- return screen_buf[y][x];
+ CHECK_BOUNDS(y,x);
+ return screen_buf[y][x];
}
@@ -51,43 +51,43 @@ set_scrn_buf(const int y,
const int x,
const char val)
{
- CHECK_BOUNDS(y,x);
- screen_buf[y][x] = val;
+ CHECK_BOUNDS(y,x);
+ screen_buf[y][x] = val;
}
void clear_screen_buf()
{
- int y, x;
-
- for (y=0; y < SCREEN_Y; ++y){
- for (x=0; x < SCREEN_X; ++x){
- CHECK_BOUNDS(y,x);
- screen_buf[y][x] = ' ';
- }
- CHECK_BOUNDS(y,SCREEN_X);
- screen_buf[y][SCREEN_X] = '\0';
- }
+ int y, x;
+
+ for (y=0; y < SCREEN_Y; ++y){
+ for (x=0; x < SCREEN_X; ++x){
+ CHECK_BOUNDS(y,x);
+ screen_buf[y][x] = ' ';
+ }
+ CHECK_BOUNDS(y,SCREEN_X);
+ screen_buf[y][SCREEN_X] = '\0';
+ }
}
-void tty_print_region(const int pi_top,
+void tty_print_region(const int pi_top,
const int pi_left,
const int pi_bottom,
const int pi_right)
{
- int y;
- char tmp;
+ int y;
+ char tmp;
+
+ for (y=pi_top; y < pi_bottom; ++y){
+ CHECK_BOUNDS(y, pi_right);
- for (y=pi_top; y < pi_bottom; ++y){
- CHECK_BOUNDS(y, pi_right);
-
- tmp = screen_buf[y][pi_right];
- screen_buf[y][pi_right] = '\0';
+ tmp = screen_buf[y][pi_right];
+ screen_buf[y][pi_right] = '\0';
- CHECK_BOUNDS(y, pi_left);
- ttyprint(y, pi_left, &(screen_buf[y][pi_left]));
+ CHECK_BOUNDS(y, pi_left);
+ ttyprint(y, pi_left, &(screen_buf[y][pi_left]));
- screen_buf[y][pi_right] = tmp;
- }
+ screen_buf[y][pi_right] = tmp;
+ }
}
void tty_print_line(
@@ -112,23 +112,23 @@ void tty_print_line(
void tty_print_screen(void)
{
#ifdef SCRN_DEBUG
- int i;
+ int i;
- for (i=0; i < SCREEN_Y; ++i)
- ttyprint(i,0, padding);
+ for (i=0; i < SCREEN_Y; ++i)
+ ttyprint(i,0, padding);
#endif /* SCRN_DEBUG */
- tty_print_region(0, 0, SCREEN_Y, SCREEN_X);
+ tty_print_region(0, 0, SCREEN_Y, SCREEN_X);
}
void print_error(char *pstr)
{
#ifdef SCRN_DEBUG
- ttyprint(0,0, padding);
+ ttyprint(0,0, padding);
#endif /* SCRN_DEBUG */
- ttyprint(0,35, pstr);
-
- while(1);
+ ttyprint(0,35, pstr);
+
+ while(1);
}