diff --git a/cpu.c b/cpu.c new file mode 100644 index 0000000..80dd57d --- /dev/null +++ b/cpu.c @@ -0,0 +1,17 @@ +#include "state.h" +#include "cpu.h" + +void* unimplemented_instruction(State6502* state) { + printf("Error: unimplemented instruction\n"); + exit(1); +} + +int emulate_6502_op(State6502* state) { + byte* opcode = &state->memory[state->pc]; + switch (*opcode) { + //... + default:unimplemented_instruction(state); break; + } + state->pc += 1; + return 0; +} diff --git a/cpu.h b/cpu.h new file mode 100644 index 0000000..7bde448 --- /dev/null +++ b/cpu.h @@ -0,0 +1,5 @@ +#pragma once +#include "types.h" + +void* unimplemented_instruction(State6502* state); +int emulate_6502_op(State6502* state); diff --git a/emu6502.c b/emu6502.c new file mode 100644 index 0000000..b7d0d31 --- /dev/null +++ b/emu6502.c @@ -0,0 +1,13 @@ +// emu6502.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include +#include "state.h" +#include "cpu.h" + +int main() +{ + printf("Hello World!\n"); + State6502 state; + emulate_6502_op(&state); +} \ No newline at end of file diff --git a/emu6502.vcxproj b/emu6502.vcxproj new file mode 100644 index 0000000..181315e --- /dev/null +++ b/emu6502.vcxproj @@ -0,0 +1,165 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {DA763E7C-CD88-4DE0-824E-39C7290F69E3} + Win32Proj + emu6502 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + + + \ No newline at end of file