Closed ID453543435 closed 5 years ago
Try adding an empty while loop after the VDP_drawText call. You cannot return from the main function on the genesis.
int main()
{
VDP_drawText("Hello World!", 10, 13);
while(1) { }
return (0);
}
Did you carefully read this tutorial ? :p It's explained that you can't use that code directly on Sega Genesis and that you need to add the infinite loop:
This code is correct but not Genesis friendly : do you think we can return (and stop) a program ?
Video games repeatedly update the TV screen, and it's up to you to handle things before or while a refresh.
So a more Genny Hello World is more like this :
include
int main() { VDP_drawText("Hello Genny World!", 10, 13);
while(1)
{
//read input
//move sprite
//update score
//draw current screen (logo, start screen, settings, game, gameover, credits...)
}
return (0);
}
>
> This code is correct, even if return(0) will never be reached.
include
int main() { VDP_drawText("Hello World!", 10, 13); return (0); } gives error https://i.ibb.co/JxcCtS3/image.png
https://github.com/Stephane-D/SGDK/wiki/Tuto-Hello-World