aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-15 16:08:25 -0700
committerChristian Cunningham <cc@localhost>2022-03-15 16:08:25 -0700
commit3ddd2534e3c09979135f42abd06d2b27ed3c5d16 (patch)
tree0b2ba1378103b2032fdd4a43d23c2088c73af10a /src
parent60cd2c9cf98171a0ddd49cabc13c2d7febbf2eba (diff)
Verbose Testing
Diffstat (limited to 'src')
-rw-r--r--src/graphics/lfb.c12
-rw-r--r--src/tests/test.c18
2 files changed, 22 insertions, 8 deletions
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);
}