3 ‐ Analyzing Hello World - AtariLynx/programming-tutorial GitHub Wiki
The main function
Every C program has a main entry point that gets executed when the program starts. The programs written using CC65 are no exception. The entry point is the main function and it usually takes no arguments and returns nothing.
void main(void) {
initialize();
while (1)
{
if (!tgi_busy())
{
show_screen();
}
};
}
There are three important things in this function:
- The initialize function that performs the necessary initialization.
- An infinite loop where we remain forever. This is the while loop.
- Logic inside the infinite loop for rendering the screen.