From b4a1418d123b8ecd87d975fc4d50c431329f9d6e Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 11 May 2026 16:59:29 +0300 Subject: [PATCH] Portability updates --- akiko.cpp | 12 ++++++------ cfgfile.cpp | 4 +++- cia.cpp | 17 +++++++++++------ debug.cpp | 1 + disk.cpp | 2 ++ expansion.cpp | 2 ++ include/bsdsocket.h | 1 + include/custom.h | 1 + include/execio.h | 2 +- include/sysdeps.h | 2 +- include/xwin.h | 1 + logging.cpp | 4 ++++ zfile.cpp | 1 + 13 files changed, 35 insertions(+), 15 deletions(-) diff --git a/akiko.cpp b/akiko.cpp index 688aa185..d3dee245 100644 --- a/akiko.cpp +++ b/akiko.cpp @@ -506,10 +506,10 @@ static smp_comm_pipe requests; static volatile int akiko_thread_running; static uae_sem_t akiko_sem, sub_sem, cda_sem; -static void checkint (void) +static void akiko_checkint(void) { if (cdrom_intreq & cdrom_intena) { - irq (); + irq(); #if AKIKO_DEBUG_IRQ write_log(_T("CD32: Akiko INT %08x\n"), cdrom_intreq & cdrom_intena); #endif @@ -520,22 +520,22 @@ static void checkint (void) } } -static void set_status (uae_u32 status) +static void set_status(uae_u32 status) { #if AKIKO_DEBUG_IO if (log_cd32 > 1) { if (!(cdrom_intreq & status)) - write_log (_T("CD32: Akiko IRQ %08x | %08x = %08x\n"), status, cdrom_intreq, cdrom_intreq | status); + write_log(_T("CD32: Akiko IRQ %08x | %08x = %08x\n"), status, cdrom_intreq, cdrom_intreq | status); } #endif cdrom_intreq |= status; - checkint (); + akiko_checkint(); cdrom_led ^= LED_CD_ACTIVE2; } static void rethink_akiko(void) { - checkint (); + akiko_checkint(); } static void cdaudiostop_do (void) diff --git a/cfgfile.cpp b/cfgfile.cpp index d56a945f..4ff05717 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -935,10 +935,12 @@ static void cfgfile_write_str(struct zfile *f, const TCHAR *option, const TCHAR { cfg_dowrite(f, option, optionext, value, 0, 0, 0); } -static void cfgfile_write_str_escape(struct zfile *f, const TCHAR *option, const TCHAR *value) +#if 0 +void cfgfile_write_str_escape(struct zfile *f, const TCHAR *option, const TCHAR *value) { cfg_dowrite(f, option, value, 0, 0, 1); } +#endif void cfgfile_dwrite_str(struct zfile *f, const TCHAR *option, const TCHAR *value) { cfg_dowrite(f, option, value, 1, 0, 0); diff --git a/cia.cpp b/cia.cpp index 37f65213..251fa9d1 100644 --- a/cia.cpp +++ b/cia.cpp @@ -2132,6 +2132,7 @@ static void WriteCIAA(uae_u16 addr, uae_u8 val, uae_u32 *flags) #endif break; case 1: + { #if DONGLE_DEBUG > 0 if (notinrom ()) write_log(_T("BFE101 W %02X %s\n"), val, debuginfo(0)); @@ -2142,27 +2143,31 @@ static void WriteCIAA(uae_u16 addr, uae_u8 val, uae_u32 *flags) alg_parallel_port(c->drb, val); #endif #ifdef PARALLEL_PORT - if (isprinter()) { - if (isprinter() > 0) { + int printermode = isprinter(); + if (printermode) { + if (printermode > 0) { doprinter(val); cia_parallelack(); - } else if (isprinter() < 0) { + } else if (printermode) { parallel_direct_write_data(val, c->drb); cia_parallelack(); } } +#else + int printermode = 0; #endif #ifdef ARCADIA - if (!isprinter() && arcadia_bios) { + if (!printermode && arcadia_bios) { arcadia_parport(1, c->prb, c->drb); } #endif #ifdef PARALLEL_PORT - if (!isprinter() && parallel_port_scsi) { + if (!printermode && parallel_port_scsi) { parallel_port_scsi_write(0, c->prb, c->drb); } #endif - break; + } + break; case 2: #if DONGLE_DEBUG > 0 if (notinrom ()) diff --git a/debug.cpp b/debug.cpp index 1e6f78fc..c90eb466 100644 --- a/debug.cpp +++ b/debug.cpp @@ -16,6 +16,7 @@ #include "options.h" #include "uae.h" +#include "uae/io.h" #include "memory.h" #include "custom.h" #include "newcpu.h" diff --git a/disk.cpp b/disk.cpp index 8ed55557..583a1028 100644 --- a/disk.cpp +++ b/disk.cpp @@ -3371,6 +3371,7 @@ void disk_insert_force (int num, const TCHAR *name, bool forcedwriteprotect) static void floppybridge_getsetprofile(int i) { +#ifdef FLOPPYBRIDGE if (currprefs.floppyslots[i].dfxsubtype == 0 || currprefs.floppyslots[i].dfxsubtypeid[0] == 0) { int sub = currprefs.floppyslots[i].dfxsubtype; if (sub == 0) { @@ -3385,6 +3386,7 @@ static void floppybridge_getsetprofile(int i) _tcscpy(currprefs.floppyslots[i].dfxsubtypeid, changed_prefs.floppyslots[i].dfxsubtypeid); } } +#endif } static void DISK_check_change (void) diff --git a/expansion.cpp b/expansion.cpp index 7748ce8a..91ca594b 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -6332,6 +6332,7 @@ const struct expansionromtype expansionroms[] = { #endif /* Network */ +#ifdef A2065 { _T("a2065"), _T("A2065"), _T("Commodore"), NULL, a2065_init, NULL, NULL, ROMTYPE_A2065 | ROMTYPE_NOT, 0, 0, BOARD_AUTOCONFIG_Z2, true, @@ -6350,6 +6351,7 @@ const struct expansionromtype expansionroms[] = { false, 0, ethernet_settings, { 0xc1, 0xc9, 0x00, 0x00, 2167 >> 8, 2167 & 255, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, +#endif #ifdef WITH_QEMU_CPU { _T("ariadne2"), _T("Ariadne II"), _T("Village Tronic"), diff --git a/include/bsdsocket.h b/include/bsdsocket.h index 9b50c9bc..5fbe31d9 100644 --- a/include/bsdsocket.h +++ b/include/bsdsocket.h @@ -11,6 +11,7 @@ #define UAE_BSDSOCKET_H #include "uae/types.h" +#include "threaddep/thread.h" #define BSD_TRACING_ENABLED 0 diff --git a/include/custom.h b/include/custom.h index 888bf27c..9d028b9e 100644 --- a/include/custom.h +++ b/include/custom.h @@ -10,6 +10,7 @@ #define UAE_CUSTOM_H #include "uae/types.h" +#include "uae/time.h" #include "machdep/rpt.h" #define BEAMCON0_HARDDIS 0x4000 diff --git a/include/execio.h b/include/execio.h index 17887041..9afc4fe6 100644 --- a/include/execio.h +++ b/include/execio.h @@ -57,7 +57,7 @@ #define TAG_IGNORE 1 #define TAG_MORE 2 #define TAG_SKIP 3 -#define TAG_USER (1 << 31) +#define TAG_USER (1UL << 31) #define NSDEVTYPE_UNKNOWN 0 #define NSDEVTYPE_GAMEPORT 1 diff --git a/include/sysdeps.h b/include/sysdeps.h index 04c9de57..e7e49be1 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -40,7 +40,7 @@ using namespace std; #define UAE #endif -#if defined(_M_ARM64) || defined(_M_ARM64EC) +#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) #define CPU_arm 1 #define ARM_ASSEMBLY 1 #define CPU_64_BIT 1 diff --git a/include/xwin.h b/include/xwin.h index 2f06950c..885e0e26 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -10,6 +10,7 @@ #define UAE_XWIN_H #include "uae/types.h" +#include "uae/time.h" #include "machdep/rpt.h" typedef uae_u32 xcolnr; diff --git a/logging.cpp b/logging.cpp index 1018a973..ba9e5d65 100644 --- a/logging.cpp +++ b/logging.cpp @@ -1,3 +1,7 @@ + +#include "sysconfig.h" +#include "sysdeps.h" + #include "uae/log.h" #include #include diff --git a/zfile.cpp b/zfile.cpp index e559560e..3cd9b80b 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -13,6 +13,7 @@ #include "sysconfig.h" #include "sysdeps.h" +#include "uae.h" #include "options.h" #include "zfile.h" #include "disk.h" -- 2.47.3