Edit: Sorry for derailing :S
Feel free to move this to another thread or anything.
death2all wrote:
Thats one thing I've always wondered how to do: how do you exactly calculate the timings/percentages etc? Care to share a bit of code with us? Loving it! Very well done
I wrote one a while ago which I have since lost. I'll go through how it worked.
There was a struct that looked a little like this:
Code:
struct splash {
const char* action;
init_function func;
};
then a function, int splash(struct splash* actions), which you would call something like this:
Code:
struct splash actions[] = {
{ "Load Global Descriptor Table", gdt_init },
{ "Load Interrupt Descriptor Table", idt_init },
{ "Enable Paging", paging_init },
{ NULL, NULL, }
};
splash(actions);
It would count the number of actions in the list, figure out the current percentage based on which item it was doing and how many actions were left, then it would draw a bar in roughly the middle of the screen, with the percentage drawn in the middle, and write the string "action" underneath the bar. I think I also had a "struct splash_screen" that described how to draw the splash screen itself but I don't remember.
I'm going to write this again, it was fun, but I never got to test it.