aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/graphics/lfb.h14
-rw-r--r--src/graphics/lfb.c12
-rw-r--r--src/tests/test.c18
3 files changed, 29 insertions, 15 deletions
diff --git a/include/graphics/lfb.h b/include/graphics/lfb.h
index e8a7766..2034c75 100644
--- a/include/graphics/lfb.h
+++ b/include/graphics/lfb.h
@@ -2,7 +2,7 @@
#define GRAPHICS_LFB_H
#define GG_MAX_X 128
-#define GG_MAX_Y 46
+#define GG_MAX_Y 100
#define DRAW64(x,y,v) draw_hex32(x,y,v>>32);draw_hex32(x+8,y,v);
@@ -11,14 +11,14 @@ void lfb_showpicture(void);
void clear_screen(void);
-void draw_cpixel(unsigned long lx, unsigned long ly, unsigned int c);
-void draw_cbox(unsigned long lx, unsigned long ly, unsigned int dx, unsigned int dy, unsigned int c);
+void draw_cpixel(unsigned int lx, unsigned int ly, unsigned int c);
+void draw_cbox(unsigned int lx, unsigned int ly, unsigned int dx, unsigned int dy, unsigned int c);
-void draw_cbyte(unsigned char lx, unsigned char ly, unsigned char letter, unsigned int c);
-void draw_byte(unsigned char lx, unsigned char ly, unsigned char letter);
+void draw_cbyte(unsigned int lx, unsigned int ly, unsigned char letter, unsigned int c);
+void draw_byte(unsigned int lx, unsigned int ly, unsigned char letter);
-void draw_cletter(unsigned char lx, unsigned char ly, unsigned char letter, unsigned int c);
-void draw_letter(unsigned char lx, unsigned char ly, unsigned char letter);
+void draw_cletter(unsigned int lx, unsigned int ly, unsigned char letter, unsigned int c);
+void draw_letter(unsigned int lx, unsigned int ly, unsigned char letter);
void draw_cstring(unsigned int lx, unsigned int ly, char* s, unsigned int c);
void draw_string(unsigned int lx, unsigned int ly, char* s);
diff --git a/src/graphics/lfb.c b/src/graphics/lfb.c
index 7158afa..a01c344 100644
--- a/src/graphics/lfb.c
+++ b/src/graphics/lfb.c
@@ -96,14 +96,14 @@ void lfb_showpicture(void)
draw_cbox(SCR_WIDTH-FWIDTH, SCR_HEIGHT-FHEIGHT, FWIDTH, FHEIGHT, 0xffd700);
}
-void draw_cpixel(unsigned long lx, unsigned long ly, unsigned int c)
+void draw_cpixel(unsigned int lx, unsigned int ly, unsigned int c)
{
unsigned char* ptr = lfb;
ptr += (gpitch*ly+lx*4);
*((unsigned int*)ptr) = gisrgb ? (unsigned int)((c&0xFF)<<16 | (c&0xFF00) | (c&0xFF0000)>>16) : c;
}
-void draw_cbox(unsigned long lx, unsigned long ly, unsigned int dx, unsigned int dy, unsigned int c)
+void draw_cbox(unsigned int lx, unsigned int ly, unsigned int dx, unsigned int dy, unsigned int c)
{
unsigned char* ptr = lfb;
ptr += (gpitch*ly+lx*4);
@@ -116,7 +116,7 @@ void draw_cbox(unsigned long lx, unsigned long ly, unsigned int dx, unsigned int
}
}
-void draw_cbyte(unsigned char lx, unsigned char ly, unsigned char letter, unsigned int c)
+void draw_cbyte(unsigned int lx, unsigned int ly, unsigned char letter, unsigned int c)
{
unsigned int x, y;
unsigned char* ptr = lfb;
@@ -138,12 +138,12 @@ void draw_cbyte(unsigned char lx, unsigned char ly, unsigned char letter, unsign
}
}
-void draw_byte(unsigned char lx, unsigned char ly, unsigned char letter)
+void draw_byte(unsigned int lx, unsigned int ly, unsigned char letter)
{
draw_cbyte(lx, ly, letter, 0xFFFFFF);
}
-void draw_cletter(unsigned char lx, unsigned char ly, unsigned char letter, unsigned int c)
+void draw_cletter(unsigned int lx, unsigned int ly, unsigned char letter, unsigned int c)
{
unsigned int x, y;
unsigned char* ptr = lfb;
@@ -162,7 +162,7 @@ void draw_cletter(unsigned char lx, unsigned char ly, unsigned char letter, unsi
}
}
-void draw_letter(unsigned char lx, unsigned char ly, unsigned char letter)
+void draw_letter(unsigned int lx, unsigned int ly, unsigned char letter)
{
draw_cletter(lx, ly, letter, 0xFFFFFF);
}
diff --git a/src/tests/test.c b/src/tests/test.c
index 503e689..4402ed3 100644
--- a/src/tests/test.c
+++ b/src/tests/test.c
@@ -15,15 +15,23 @@ static int y = 13;
void test_entry(void)
{
x = 0;
+ unsigned int z = 1;
draw_string(0, y+4, "Starting tests");
unsigned long long ti, tf, dt=0;
for(int i = 0; i < 64; i++) {
sys0_64(SYS_TIME, &ti);
sys0_64(SYS_TIME, &tf);
dt += tf - ti;
+ if (z % 2) {
+ DRAW64(0+17, y+((z+1)/2)+5, (tf-ti));
+ } else {
+ DRAW64(0, y+(z/2)+5, (tf-ti));
+ }
+ z++;
}
DRAW64(0, y+5, dt/64);
DRAW64(17, y+5, dt%64);
+ z = 1;
// atest
//add_thread(atest, 0, 0);
@@ -32,9 +40,15 @@ void test_entry(void)
sys0(SYS_YIELD);
sys0_64(SYS_TIME, &tf);
dt += tf - ti;
+ if (z % 2) {
+ DRAW64(35+17, y+((z+1)/2)+5, (tf-ti));
+ } else {
+ DRAW64(35, y+(z/2)+5, (tf-ti));
+ }
+ z++;
}
- DRAW64(34, y+5, dt/64);
- DRAW64(34+17, y+5, dt%64);
+ DRAW64(35, y+5, dt/64);
+ DRAW64(35+17, y+5, dt%64);
add_thread(btest, 0, 4);
}