2024-03-24 02:01:28 -06:00
|
|
|
#include <libultraship.h>
|
|
|
|
|
|
|
|
#include <Fast3D/gfx_pc.h>
|
|
|
|
#include "Engine.h"
|
|
|
|
|
2024-04-01 23:13:52 -06:00
|
|
|
extern "C" {
|
2024-04-06 04:25:11 -06:00
|
|
|
#include <sf64mesg.h>
|
2024-04-01 23:13:52 -06:00
|
|
|
void Main_SetVIMode(void);
|
|
|
|
void Main_Initialize(void);
|
|
|
|
void Main_ThreadEntry(void* arg);
|
|
|
|
void Lib_FillScreen(u8 setFill);
|
|
|
|
void Graphics_ThreadUpdate();
|
|
|
|
}
|
|
|
|
|
2024-03-24 02:01:28 -06:00
|
|
|
extern "C"
|
2024-04-01 23:13:52 -06:00
|
|
|
void Graphics_PushFrame(Gfx* data) {
|
|
|
|
GameEngine::ProcessGfxCommands(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void Timer_Update();
|
2024-03-24 02:01:28 -06:00
|
|
|
|
|
|
|
void push_frame() {
|
|
|
|
// GameEngine::StartAudioFrame();
|
|
|
|
GameEngine::Instance->StartFrame();
|
2024-04-01 23:13:52 -06:00
|
|
|
Graphics_ThreadUpdate();
|
|
|
|
Timer_Update();
|
2024-03-24 02:01:28 -06:00
|
|
|
// thread5_iteration();
|
|
|
|
// GameEngine::EndAudioFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
int SDL_main(int argc, char **argv) {
|
|
|
|
#else
|
2024-04-19 03:21:56 -06:00
|
|
|
#if defined(__cplusplus) && defined(PLATFORM_IOS)
|
|
|
|
extern "C"
|
|
|
|
#endif
|
|
|
|
int main(int argc, char *argv[]) {
|
2024-03-24 02:01:28 -06:00
|
|
|
#endif
|
|
|
|
GameEngine::Create();
|
2024-04-01 23:13:52 -06:00
|
|
|
Main_SetVIMode();
|
|
|
|
Lib_FillScreen(1);
|
|
|
|
Main_Initialize();
|
|
|
|
Main_ThreadEntry(NULL);
|
2024-03-24 02:01:28 -06:00
|
|
|
GameEngine::Instance->ProcessFrame(push_frame);
|
|
|
|
GameEngine::Instance->Destroy();
|
|
|
|
return 0;
|
|
|
|
}
|