From 6dbd59cfc6038acf8cbae22e8c80f0cf878cf2ee Mon Sep 17 00:00:00 2001 From: Asnivor Date: Fri, 15 Nov 2024 17:08:41 +0000 Subject: [PATCH] Try a new CPU. No idea what i'm doing :/ --- ExternalProjects/ziplantil_w65c02s.h/cpp.hint | 5 + .../ziplantil_w65c02s.h/ziplantil_w65c02s.c | 152 ++++++++++++++++++ .../ziplantil_w65c02s.h.sln | 31 ++++ .../ziplantil_w65c02s.h.vcxproj | 146 +++++++++++++++++ 4 files changed, 334 insertions(+) create mode 100644 ExternalProjects/ziplantil_w65c02s.h/cpp.hint create mode 100644 ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.c create mode 100644 ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.sln create mode 100644 ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.vcxproj diff --git a/ExternalProjects/ziplantil_w65c02s.h/cpp.hint b/ExternalProjects/ziplantil_w65c02s.h/cpp.hint new file mode 100644 index 0000000000..48a3ac2e3f --- /dev/null +++ b/ExternalProjects/ziplantil_w65c02s.h/cpp.hint @@ -0,0 +1,5 @@ +// Hint files help the Visual Studio IDE interpret Visual C++ identifiers +// such as names of functions and macros. +// For more information see https://go.microsoft.com/fwlink/?linkid=865984 +#define W_EXPORT __declspec(dllexport) +#define W_EXPORT __attribute__((visibility("default"))) diff --git a/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.c b/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.c new file mode 100644 index 0000000000..b897acfde9 --- /dev/null +++ b/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.c @@ -0,0 +1,152 @@ + + +#ifdef _WIN32 +#define W_EXPORT __declspec(dllexport) +#else +#define W_EXPORT __attribute__((visibility("default"))) +#endif // _WIN32 + +#include "w65c02s.h/include/w65c02s.h" + +W_EXPORT void exp_w65c02s_init(struct w65c02s_cpu* cpu, + uint8_t(*mem_read)(struct w65c02s_cpu*, uint16_t), + void (*mem_write)(struct w65c02s_cpu*, uint16_t, uint8_t), + void* cpu_data) { + w65c02s_init(cpu, mem_read, mem_write, cpu_data); +} + +W_EXPORT size_t exp_w65c02s_cpu_size(void) { + return w65c02s_cpu_size(); +} + +W_EXPORT unsigned long exp_w65c02s_run_cycles(struct w65c02s_cpu* cpu, unsigned long cycles) { + return w65c02s_run_cycles(cpu, cycles); +} + +W_EXPORT unsigned long exp_w65c02s_step_instruction(struct w65c02s_cpu* cpu) { + return w65c02s_step_instruction(cpu); +} + +W_EXPORT unsigned long exp_w65c02s_run_instructions(struct w65c02s_cpu* cpu, + unsigned long instructions, + bool finish_existing) { + return w65c02s_run_instructions(cpu, instructions, finish_existing); +} + +W_EXPORT unsigned long exp_w65c02s_get_cycle_count(const struct w65c02s_cpu* cpu) { + return w65c02s_get_cycle_count(cpu); +} + +W_EXPORT unsigned long exp_w65c02s_get_instruction_count(const struct w65c02s_cpu* cpu) { + return w65c02s_get_instruction_count(cpu); +} + +W_EXPORT void* exp_w65c02s_get_cpu_data(const struct w65c02s_cpu* cpu) { + return w65c02s_get_cpu_data(cpu); +} + +W_EXPORT void exp_w65c02s_reset_cycle_count(struct w65c02s_cpu* cpu) { + w65c02s_reset_cycle_count(cpu); +} + +W_EXPORT void exp_w65c02s_reset_instruction_count(struct w65c02s_cpu* cpu) { + w65c02s_reset_instruction_count(cpu); +} + +W_EXPORT bool exp_w65c02s_is_cpu_waiting(const struct w65c02s_cpu* cpu) { + return w65c02s_is_cpu_waiting(cpu); +} + +W_EXPORT bool exp_w65c02s_is_cpu_stopped(const struct w65c02s_cpu* cpu) { + return w65c02s_is_cpu_stopped(cpu); +} + +W_EXPORT void exp_w65c02s_break(struct w65c02s_cpu* cpu) { + w65c02s_break(cpu); +} + +W_EXPORT void exp_w65c02s_stall(struct w65c02s_cpu* cpu, unsigned long cycles) { + w65c02s_stall(cpu, cycles); +} + +W_EXPORT void exp_w65c02s_nmi(struct w65c02s_cpu* cpu) { + w65c02s_nmi(cpu); +} + +W_EXPORT void exp_w65c02s_reset(struct w65c02s_cpu* cpu) { + w65c02s_reset(cpu); +} + +W_EXPORT void exp_w65c02s_irq(struct w65c02s_cpu* cpu) { + w65c02s_irq(cpu); +} + +W_EXPORT void exp_w65c02s_irq_cancel(struct w65c02s_cpu* cpu) { + w65c02s_irq_cancel(cpu); +} + +W_EXPORT void exp_w65c02s_set_overflow(struct w65c02s_cpu* cpu) { + w65c02s_set_overflow(cpu); +} + +W_EXPORT bool exp_w65c02s_hook_brk(struct w65c02s_cpu* cpu, bool (*brk_hook)(uint8_t)) { + return w65c02s_hook_brk(cpu, brk_hook); +} + +W_EXPORT bool exp_w65c02s_hook_stp(struct w65c02s_cpu* cpu, bool (*stp_hook)(void)) { + return w65c02s_hook_stp(cpu, stp_hook); +} + +W_EXPORT bool exp_w65c02s_hook_end_of_instruction(struct w65c02s_cpu* cpu, + void (*instruction_hook)(void)) { + return w65c02s_hook_end_of_instruction(cpu, instruction_hook); +} + +W_EXPORT uint8_t exp_w65c02s_reg_get_a(const struct w65c02s_cpu* cpu) { + return w65c02s_reg_get_a(cpu); +} + +W_EXPORT uint8_t exp_w65c02s_reg_get_x(const struct w65c02s_cpu* cpu) { + return w65c02s_reg_get_x(cpu); +} + +W_EXPORT uint8_t exp_w65c02s_reg_get_y(const struct w65c02s_cpu* cpu) { + return w65c02s_reg_get_y(cpu); +} + +W_EXPORT uint8_t exp_w65c02s_reg_get_p(const struct w65c02s_cpu* cpu) { + return w65c02s_reg_get_p(cpu); +} + +W_EXPORT uint8_t exp_w65c02s_reg_get_s(const struct w65c02s_cpu* cpu) { + return w65c02s_reg_get_s(cpu); +} + +W_EXPORT uint16_t exp_w65c02s_reg_get_pc(const struct w65c02s_cpu* cpu) { + return w65c02s_reg_get_pc(cpu); +} + +W_EXPORT void exp_w65c02s_reg_set_a(struct w65c02s_cpu* cpu, uint8_t value) { + w65c02s_reg_set_a(cpu, value); +} + +W_EXPORT void exp_w65c02s_reg_set_x(struct w65c02s_cpu* cpu, uint8_t value) { + w65c02s_reg_set_x(cpu, value); +} + +W_EXPORT void exp_w65c02s_reg_set_y(struct w65c02s_cpu* cpu, uint8_t value) { + w65c02s_reg_set_y(cpu, value); +} + +W_EXPORT void exp_w65c02s_reg_set_p(struct w65c02s_cpu* cpu, uint8_t value) { + w65c02s_reg_set_p(cpu, value); +} + +W_EXPORT void exp_w65c02s_reg_set_s(struct w65c02s_cpu* cpu, uint8_t value) { + w65c02s_reg_set_s(cpu, value); +} + +W_EXPORT void exp_w65c02s_reg_set_pc(struct w65c02s_cpu* cpu, uint16_t value) { + w65c02s_reg_set_pc(cpu, value); +} + diff --git a/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.sln b/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.sln new file mode 100644 index 0000000000..73607f893f --- /dev/null +++ b/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35327.3 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ziplantil_w65c02s.h", "ziplantil_w65c02s.h.vcxproj", "{A99553CF-EDF3-49D7-B7C9-684957EFFC80}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Debug|x64.ActiveCfg = Debug|x64 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Debug|x64.Build.0 = Debug|x64 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Debug|x86.ActiveCfg = Debug|Win32 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Debug|x86.Build.0 = Debug|Win32 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Release|x64.ActiveCfg = Release|x64 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Release|x64.Build.0 = Release|x64 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Release|x86.ActiveCfg = Release|Win32 + {A99553CF-EDF3-49D7-B7C9-684957EFFC80}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {90297FEA-61EA-4995-ACCE-21481D9898C4} + EndGlobalSection +EndGlobal diff --git a/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.vcxproj b/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.vcxproj new file mode 100644 index 0000000000..7a3e58937e --- /dev/null +++ b/ExternalProjects/ziplantil_w65c02s.h/ziplantil_w65c02s.h.vcxproj @@ -0,0 +1,146 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {a99553cf-edf3-49d7-b7c9-684957effc80} + ziplantilw65c02sh + 10.0 + ziplantil_w65c02s + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + x64 + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + CompileAsC + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + CompileAsC + stdc17 + + + Console + true + true + true + + + + + + + + + + + + + + + \ No newline at end of file