Restore READY layout and authentic cursor timing
This commit is contained in:
+7
-7
@@ -4,7 +4,7 @@
|
||||
|
||||
#define C64_BLUE lv_color_make(64, 49, 141)
|
||||
#define C64_LIGHT_BLUE lv_color_make(120, 105, 196)
|
||||
#define PIXEL_SCALE 13
|
||||
#define PIXEL_SCALE 6
|
||||
#define CELL_SIZE (8 * PIXEL_SCALE)
|
||||
|
||||
typedef struct {
|
||||
@@ -53,14 +53,14 @@ static void cursor_blink(void *object, int32_t visible) {
|
||||
}
|
||||
|
||||
void c64_ui_create(void) {
|
||||
static const char text[] = "READY";
|
||||
static const char text[] = "READY.";
|
||||
lv_obj_t *screen = lv_scr_act();
|
||||
lv_obj_set_style_bg_color(screen, C64_BLUE, LV_PART_MAIN);
|
||||
lv_obj_set_style_bg_opa(screen, LV_OPA_COVER, LV_PART_MAIN);
|
||||
lv_obj_clear_flag(screen, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
const lv_coord_t start_x = 8;
|
||||
const lv_coord_t text_y = 34;
|
||||
const lv_coord_t start_x = 48;
|
||||
const lv_coord_t text_y = 24;
|
||||
for (unsigned i = 0; i < sizeof(text) - 1; ++i) {
|
||||
draw_glyph(screen, text[i], start_x + (lv_coord_t)i * CELL_SIZE, text_y);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ void c64_ui_create(void) {
|
||||
lv_obj_t *cursor = lv_obj_create(screen);
|
||||
lv_obj_remove_style_all(cursor);
|
||||
lv_obj_set_size(cursor, CELL_SIZE, CELL_SIZE);
|
||||
lv_obj_set_pos(cursor, start_x + 5 * CELL_SIZE, text_y);
|
||||
lv_obj_set_pos(cursor, start_x, text_y + CELL_SIZE + 16);
|
||||
lv_obj_set_style_bg_color(cursor, C64_LIGHT_BLUE, LV_PART_MAIN);
|
||||
lv_obj_set_style_bg_opa(cursor, LV_OPA_COVER, LV_PART_MAIN);
|
||||
|
||||
@@ -76,8 +76,8 @@ void c64_ui_create(void) {
|
||||
lv_anim_init(&blink);
|
||||
lv_anim_set_var(&blink, cursor);
|
||||
lv_anim_set_values(&blink, 1, 0);
|
||||
lv_anim_set_time(&blink, 250);
|
||||
lv_anim_set_playback_time(&blink, 250);
|
||||
lv_anim_set_time(&blink, 333);
|
||||
lv_anim_set_playback_time(&blink, 333);
|
||||
lv_anim_set_repeat_count(&blink, LV_ANIM_REPEAT_INFINITE);
|
||||
lv_anim_set_exec_cb(&blink, cursor_blink);
|
||||
lv_anim_start(&blink);
|
||||
|
||||
Reference in New Issue
Block a user