nesemu/main.c

59 lines
1.1 KiB
C

/*
* =====================================================================================
*
* Filename: main.c
*
* Description: Emulator main loop
*
* Version: 1.0
* Created: 2023-09-21 09:50:34 PM
* Revision: none
* Compiler: gcc
*
* Author: William Nolin,
* Organization:
*
* =====================================================================================
*/
#include <stdlib.h>
#include "log.h"
#include "debugger/debugger.h"
#include "include/rom.h"
#include "include/system.h"
#include "gui.h"
int main() {
log_set_level(LOG_INFO);
system_init();
char *rom_path = "../test_roms/dk_jp.nes";
if (!rom_load(rom_path)) {
system_uninit();
return EXIT_FAILURE;
}
gui_init();
system_start();
bool stop = false;
while (!stop) {
if (gui_input() < 0) {
stop = true;
}
system_next_frame();
gui_render();
gui_present();
SDL_Delay(16);
}
system_uninit();
gui_uninit();
//// start_debugger();
return EXIT_SUCCESS;
}