void draw_score() { unsigned char right = 4; if (right_score >= 10) right += 4; if (right_score >= 100) right += 4; draw_byte(screen, 30, 0, left_score); draw_byte(screen, DISPLAY_WIDTH - 30 - right, 0, right_score); }
// Example main function and loop int main() { // Initialize the display with (pixel size, pixel padding) (pixel padding not // implemented yet) lcdsim_init(3, 0); // Ascii display example char *cp, test0[] = "Static test string", test1[] = "Another string"; cp = test0; ascii_gotoxy(0,0); while (*cp) ascii_write_char(*cp++); cp = test1; ascii_gotoxy(0,1); while (*cp) ascii_write_char(*cp++); int i = 0; while(1) { keyb(c); // Show pressed down key draw_byte((c[0]) ? 0xFF : 0, 63, 3); draw_byte((c[1]) ? 0xFF : 0, 63, 5); draw_byte((c[2]) ? 0xFF : 0, 58, 4); draw_byte((c[3]) ? 0xFF : 0, 68, 4); // Moving byte draw_byte(0, (i % 128), 7); draw_byte(0xFF, (++i % 128), 7); delay_milli(40); } return 0; }
INLINE void draw_byte_trans8(offs_t addr, UINT8 val, UINT8 mask, UINT8 latch) { if (val) draw_byte(addr, val, mask, latch); }