diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-11-21 21:08:43 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-11-21 21:08:43 +0100 |
commit | 052899e196c6a2660651b9896ceed3313e7d0bac (patch) | |
tree | 9deb31de468693326a2b426db76f0e99ffe0c9c2 /emu/emu.c | |
parent | 56ae2c7b25157e44c50ab982236fee8bbcca0463 (diff) | |
download | 6502-052899e196c6a2660651b9896ceed3313e7d0bac.tar.gz 6502-052899e196c6a2660651b9896ceed3313e7d0bac.tar.bz2 |
started a simple emulator
Diffstat (limited to 'emu/emu.c')
-rw-r--r-- | emu/emu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/emu/emu.c b/emu/emu.c new file mode 100644 index 0000000..fbd9bb7 --- /dev/null +++ b/emu/emu.c @@ -0,0 +1,21 @@ +#include "emul.h" +#include "6502.h" +#include "memory.h" + +#include <stdlib.h> + +int main( int argc, char *argv[] ) +{ + 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 ); + cpu_6502_run( &cpu ); + + exit( EXIT_SUCCESS ); +} |