2010-12-28 01:53:15 +00:00
|
|
|
#include "base.hpp"
|
|
|
|
Application application;
|
|
|
|
|
|
|
|
#include "interface.cpp"
|
|
|
|
|
|
|
|
#include "general/main-window.cpp"
|
|
|
|
|
|
|
|
void Application::main(int argc, char **argv) {
|
|
|
|
quit = false;
|
|
|
|
|
|
|
|
mainWindow.create();
|
|
|
|
|
|
|
|
mainWindow.setVisible();
|
|
|
|
|
|
|
|
GameBoy::system.init(&interface);
|
|
|
|
|
2010-12-30 07:15:10 +00:00
|
|
|
unsigned frameCounter = 0;
|
|
|
|
time_t timeCounter = time(0);
|
|
|
|
|
2010-12-28 01:53:15 +00:00
|
|
|
while(quit == false) {
|
|
|
|
OS::run();
|
2010-12-28 06:03:02 +00:00
|
|
|
|
|
|
|
if(GameBoy::cartridge.loaded()) {
|
|
|
|
GameBoy::system.run();
|
2010-12-30 07:15:10 +00:00
|
|
|
|
|
|
|
frameCounter++;
|
|
|
|
time_t currentTime = time(0);
|
|
|
|
if(currentTime != timeCounter) {
|
|
|
|
timeCounter = currentTime;
|
|
|
|
mainWindow.setStatusText({ "FPS: ", frameCounter });
|
|
|
|
frameCounter = 0;
|
|
|
|
}
|
2010-12-28 06:03:02 +00:00
|
|
|
}
|
2010-12-28 01:53:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
application.main(argc, argv);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|