Clean the demo app

This commit is contained in:
Romain Goyet
2015-09-02 19:00:24 +02:00
parent 65bfef0a96
commit ef1d927d14
2 changed files with 6 additions and 53 deletions

View File

@@ -12,8 +12,8 @@ static inline void set_color(KDColor * address, int8_t high_bit, int8_t low_bit,
assert(low_bit >= 0); // Interval starts too early
assert(low_bit < 8*sizeof(KDColor)); // Interval ends too late
KDColor mask = ((((KDColor)1<<(high_bit-low_bit+1))-1)<<low_bit);
assert(address >= KD_FRAMEBUFFER_ADDRESS);
assert(address < (KD_FRAMEBUFFER_ADDRESS+(KD_FRAMEBUFFER_WIDTH*KD_FRAMEBUFFER_HEIGHT*KD_BITS_PER_PIXEL)/8));
assert((void *)address >= KD_FRAMEBUFFER_ADDRESS);
assert((void *)address < (KD_FRAMEBUFFER_ADDRESS+(KD_FRAMEBUFFER_WIDTH*KD_FRAMEBUFFER_HEIGHT*KD_BITS_PER_PIXEL)/8));
*address = (*address & ~mask) | (value & mask);
}

View File

@@ -9,53 +9,12 @@ extern "C" {
void hello() {
/*char letter = 'Z';
while (1) {
letter = getc();
}
*/
KDFillRect((KDRect){
.x = 0,
.y = 0,
.width = 240,
.height = 320},
0x00);
/*
for (int i=0; i <255; i++) {
KDFillRect((KDRect){.x = (KDCoordinate)i, .y = (KDCoordinate)i, .width = 100, .height = 200}, i);
}
KDDrawString("Hello, world", (KDPoint){});
*/
/*
Number n1 = Number(123);
Number n2 = Number(45);
Fraction f = Fraction(&n1, &n2);
Number n3 = Number(3);
Power p = Power(&f, &n3);
p.recursiveLayout();
p.m_frame.origin = KDPOINT(0, 0);
p.recursiveDraw();
char * test = (char *)malloc(10);
char * bar = (char *)malloc(8);
free(bar);
free(test);
*/
/*
while (1) {
char character = getc();
KDDrawChar(character, (KDPoint){.x = 0, .y = 0});
}
*/
.width = 320,
.height = 240},
0x7F);
char input[255];
@@ -69,13 +28,7 @@ void hello() {
} else {
input[index++] = character;
input[index] = 0;
KDDrawString(input, (KDPoint){.x = 0, .y = 0});
KDDrawString(input, (KDPoint){.x = 40, .y = 40});
}
}
/*
char * input = "12/34/8787/29292929";
CreateFromString(input);
*/
}