summaryrefslogtreecommitdiff
path: root/emu/emu.c
blob: 7d5c37c58e6bda2e7ce3de1c8504fdef02141fc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "emul.h"
#include "6502.h"
#include "memory.h"

#include <stdlib.h>

int main( int argc, char *argv[] )
{
	emul_t emul;
	cpu_6502_t cpu;
	memory_t memory;
		
	memory_init( &memory );
	memory_load( &memory, ROM_START, ROM_SIZE, "./rom.bin" );
	
	cpu_6502_init( &cpu, &memory );
	//cpu.debug = true;
	cpu_6502_reset( &cpu );
	
	emul_init( &emul, &cpu, &memory );
	emul.gui = true;	
	emul_start( &emul );
	
	emul_run( &emul );
	
	emul_free( &emul );
	exit( EXIT_SUCCESS );
}