mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-05 11:29:41 +00:00
Add nice progess bar
This commit is contained in:
parent
975a5090e5
commit
2a8734aedc
@ -63,14 +63,10 @@ char* load_kernel(char* path, int bootstrap_size,
|
|||||||
stream_t *stream;
|
stream_t *stream;
|
||||||
int read;
|
int read;
|
||||||
int to_read;
|
int to_read;
|
||||||
emile_window_t win;
|
emile_window_t win = { 18, 10, 1, 60 };
|
||||||
emile_progressbar_t *pg;
|
emile_progressbar_t *pg;
|
||||||
|
|
||||||
win.c = 6;
|
console_set_cursor_position(win.l - 2, win.c + (win.w - strlen("Loading kernel")) / 2);
|
||||||
win.l = 15;
|
|
||||||
win.h = 1;
|
|
||||||
win.w = 68;
|
|
||||||
console_set_cursor_position(13, 36);
|
|
||||||
printf("Loading kernel");
|
printf("Loading kernel");
|
||||||
|
|
||||||
stream = stream_open(path);
|
stream = stream_open(path);
|
||||||
@ -169,8 +165,8 @@ char* load_kernel(char* path, int bootstrap_size,
|
|||||||
}
|
}
|
||||||
read += ret;
|
read += ret;
|
||||||
}
|
}
|
||||||
|
emile_progressbar_value(pg, to_read);
|
||||||
emile_progressbar_delete(pg);
|
emile_progressbar_delete(pg);
|
||||||
putchar('\n');
|
|
||||||
|
|
||||||
ret = stream_close(stream);
|
ret = stream_close(stream);
|
||||||
|
|
||||||
@ -183,7 +179,7 @@ char *load_ramdisk(char* path, unsigned long *ramdisk_size)
|
|||||||
char *ramdisk_start;
|
char *ramdisk_start;
|
||||||
struct stream_stat stat;
|
struct stream_stat stat;
|
||||||
int ret;
|
int ret;
|
||||||
emile_window_t win;
|
emile_window_t win = { 22, 10, 1, 60 };
|
||||||
emile_progressbar_t *pg;
|
emile_progressbar_t *pg;
|
||||||
|
|
||||||
stream = stream_open(path);
|
stream = stream_open(path);
|
||||||
@ -198,11 +194,7 @@ char *load_ramdisk(char* path, unsigned long *ramdisk_size)
|
|||||||
if (!check_full_in_bank((unsigned long)ramdisk_start, stat.st_size))
|
if (!check_full_in_bank((unsigned long)ramdisk_start, stat.st_size))
|
||||||
error("ramdisk between two banks, contact maintainer\n");
|
error("ramdisk between two banks, contact maintainer\n");
|
||||||
|
|
||||||
win.c = 6;
|
console_set_cursor_position(win.l - 2, win.c + (win.w - strlen("Loading RAMDISK")) / 2);
|
||||||
win.l = 19;
|
|
||||||
win.h = 1;
|
|
||||||
win.w = 68;
|
|
||||||
console_set_cursor_position(17,35);
|
|
||||||
printf("Loading RAMDISK");
|
printf("Loading RAMDISK");
|
||||||
|
|
||||||
pg = emile_progressbar_create(&win, stat.st_size);
|
pg = emile_progressbar_create(&win, stat.st_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user