|
Recently, I've had problems getting a c++ game to run on Saturn. It didn't enter main() or ss_main(), must have hanged up in some startup code linked in by the linker. Looking at yabause's CPU debugger and at my map file, I found out that it hangs in a function called __sccl, somehow related to vfprintf and __main().
So I put a dummy function void __main() {} in a seperate .c file, linked it to the other .c++ files and the game started up correctly . It won't work when you compile that dummy function as c++ file. Obviously, it hanged in __main(), but I can't say why.
On a different note, with COFF compiler the function __main() is the reason why malloc() and free() are linked to the binary, even if it's not used in the game at all. Defining a dummy function void __main() {} in a c file (not c++) helps here. This can be useful when you want to save some kBytes of binary size, or if you must be sure to not use malloc somewhere, because you use a different memory allocator. |