]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
dsp3210: fix portable host declarations
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Sun, 31 May 2026 02:58:07 +0000 (19:58 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Sun, 31 May 2026 06:56:48 +0000 (23:56 -0700)
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
dsp3210/dsp_glue.cpp

index 30cb478e6e8930fc7d15f7beb05489d25fe0cd19..a70bfb49dc70b357ff9ebfd01cc323b43feb1eae 100644 (file)
@@ -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 */
index 5d9e48c540d61a12623501f38ccd4fbbb0d8f59f..d5f43249cbf70c4c73ecd999e99c087e4d37c43c 100644 (file)
@@ -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);
        }