From 894c20ec66b0934e9c20a7555e6c60c91f66305c Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 30 May 2026 19:58:07 -0700 Subject: [PATCH] dsp3210: fix portable host declarations Declare the onboard ROM as external from the emulation file and use the common byte-swap helpers in the host glue. This avoids Windows-only byteswap names in shared code. --- dsp3210/DSP3210_emulation.cpp | 2 +- dsp3210/dsp_glue.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dsp3210/DSP3210_emulation.cpp b/dsp3210/DSP3210_emulation.cpp index 30cb478e..a70bfb49 100644 --- a/dsp3210/DSP3210_emulation.cpp +++ b/dsp3210/DSP3210_emulation.cpp @@ -37,7 +37,7 @@ float DSP_history_a[5][5]; uint16_t DSP_history_CC[5]; int32_t DSP_history_mem[5][5]; uint8_t *DSP_onboard_RAM; -uint8_t DSP_onboard_ROM[]; +extern uint8_t DSP_onboard_ROM[]; uint8_t *DSP_MMIO; /* Defines */ diff --git a/dsp3210/dsp_glue.cpp b/dsp3210/dsp_glue.cpp index 5d9e48c5..d5f43249 100644 --- a/dsp3210/dsp_glue.cpp +++ b/dsp3210/dsp_glue.cpp @@ -15,6 +15,7 @@ #include "debug.h" #include "newcpu.h" #include "threaddep/thread.h" +#include "machdep/maccess.h" #include "dsp_glue.h" #define DSP_INST_COUNT_WAIT 1000 @@ -56,7 +57,7 @@ uint32_t DSP_get_long_ext(uint32_t addr) } else { v = safe_memory_read(addr, 4); } - v = _byteswap_ulong(v); + v = do_byteswap_32(v); if (log_dsp) { write_log("DSP LGET %08x = %08x\n", addr, v); } @@ -71,7 +72,7 @@ uint16_t DSP_get_short_ext(uint32_t addr) } else { v = safe_memory_read(addr, 2); } - v = _byteswap_ushort(v); + v = do_byteswap_16(v); if (log_dsp) { write_log("DSP WGET %08x = %04x\n", addr, v & 0xffff); } @@ -94,7 +95,7 @@ unsigned char DSP_get_char_ext(uint32_t addr) void DSP_set_long_ext(uint32_t addr, uint32_t v) { - v = _byteswap_ulong(v); + v = do_byteswap_32(v); if (log_dsp) { write_log("DSP LPUT %08x = %08x\n", addr, v); } @@ -107,7 +108,7 @@ void DSP_set_long_ext(uint32_t addr, uint32_t v) void DSP_set_short_ext(uint32_t addr, uint16_t v) { - v = _byteswap_ushort(v); + v = do_byteswap_16(v); if (log_dsp) { write_log("DSP WPUT %08x = %04x\n", addr, v & 0xffff); } -- 2.47.3