Skip to content

Commit

Permalink
Update to the most recent fs-uae based on winuae 4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cahirwpz authored Nov 24, 2022
2 parents 74bb491 + 70e323a commit 2edac59
Show file tree
Hide file tree
Showing 16 changed files with 300 additions and 135 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ RUN apt-get -q update && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
automake bison ca-certificates flex git-core gettext gperf \
gcc g++ libc6-dev libglib2.0-dev libncurses-dev libpng-dev \
libsdl2-dev libopenal-dev libtool make patch pkg-config \
python3 libpython3-dev python3-setuptools quilt \
libsdl2-dev libsdl2-ttf-dev libopenal-dev libtool make patch \
pkg-config python3 libpython3-dev python3-setuptools quilt \
subversion texinfo zip
12 changes: 6 additions & 6 deletions patches/fs-uae/break-at-start.diff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Index: demoscene-toolchain/submodules/fs-uae/src/fs-uae/main.c
Index: demoscene-toolchain/submodules/fs-uae/src/fsuae/fsuae-main.c
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/fs-uae/main.c
+++ demoscene-toolchain/submodules/fs-uae/src/fs-uae/main.c
@@ -531,6 +531,10 @@ static void on_init(void)
--- demoscene-toolchain.orig/submodules/fs-uae/src/fsuae/fsuae-main.c
+++ demoscene-toolchain/submodules/fs-uae/src/fsuae/fsuae-main.c
@@ -803,6 +803,10 @@ static void on_init(void)
fs_uae_configure_input();
fs_uae_configure_directories();

Expand All @@ -12,12 +12,12 @@ Index: demoscene-toolchain/submodules/fs-uae/src/fs-uae/main.c
+
if (fs_config_get_int("save_state_compression") == 0) {
amiga_set_save_state_compression(0);
}
} else {
Index: demoscene-toolchain/submodules/fs-uae/src/od-fs/stubs.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/od-fs/stubs.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/od-fs/stubs.cpp
@@ -188,7 +188,7 @@ void target_fixup_options (struct uae_pr
@@ -179,7 +179,7 @@ void target_fixup_options(struct uae_pre
}

int debuggable (void) {
Expand Down
2 changes: 1 addition & 1 deletion patches/fs-uae/break-on-illegal.diff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Index: demoscene-toolchain/submodules/fs-uae/src/newcpu.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/newcpu.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/newcpu.cpp
@@ -3195,6 +3195,14 @@ uae_u32 REGPARAM2 op_illg (uae_u32 opcod
@@ -4139,6 +4139,14 @@ uae_u32 REGPARAM2 op_illg (uae_u32 opcod
}
}

Expand Down
14 changes: 7 additions & 7 deletions patches/fs-uae/break-on-sigint.diff
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ Index: demoscene-toolchain/submodules/fs-uae/src/od-fs/uaemisc.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/od-fs/uaemisc.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/od-fs/uaemisc.cpp
@@ -9,6 +9,7 @@
#include "uae.h"
@@ -10,6 +10,7 @@
#include "xwin.h"
#include "clipboard.h"
#include "uae/fs.h"
+#include "fs/conf.h"
#include "../od-win32/debug_win32.h"

#ifndef PICASSO96
@@ -229,7 +230,6 @@ TCHAR *target_expand_environment (const
return strdup(path);
#include <fs/emu/hacks.h>
@@ -203,7 +204,6 @@ TCHAR *target_expand_environment (const
}
}

-#if 0
#include <signal.h>
#include "debug.h"
#ifdef __cplusplus_disabled
@@ -246,11 +246,12 @@ static RETSIGTYPE sigbrkhandler (int foo
@@ -220,11 +220,12 @@ static RETSIGTYPE sigbrkhandler (int foo
signal (SIGINT, sigbrkhandler);
#endif
}
Expand All @@ -33,7 +33,7 @@ Index: demoscene-toolchain/submodules/fs-uae/src/od-fs/uaemisc.cpp
#if defined(__unix) && !defined(__NeXT__)
struct sigaction sa;
sa.sa_handler = sigbrkhandler;
@@ -263,7 +264,6 @@ void setup_brkhandler (void)
@@ -237,7 +238,6 @@ void setup_brkhandler (void)
#else
signal (SIGINT, sigbrkhandler);
#endif
Expand Down
13 changes: 13 additions & 0 deletions patches/fs-uae/data-path-macos.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: demoscene-toolchain/submodules/fs-uae/fsemu/src/fsemu-data.c
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/fsemu/src/fsemu-data.c
+++ demoscene-toolchain/submodules/fs-uae/fsemu/src/fsemu-data.c
@@ -284,7 +284,7 @@ char *fsemu_data_file_path(const char *r
return path;
}

-#ifdef FSEMU_OS_MACOS
+#ifdef FSEMU_OS_MACOS__DISABLE
char buffer[FSEMU_PATH_MAX];
fs_get_application_exe_dir(buffer, FSEMU_PATH_MAX);
path = g_build_filename(buffer, "..", "Resources", "Data", relative, NULL);
13 changes: 13 additions & 0 deletions patches/fs-uae/debug-msg-fix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: demoscene-toolchain/submodules/fs-uae/src/debug.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/debug.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/debug.cpp
@@ -6474,7 +6474,7 @@ void debug (void)
return;
}
if (bp > 0)
- console_out_f(_T("Breakpoint %d triggered.\n"), bp - 1);
+ console_out_f(_T("Breakpoint at %x\n"), pc);
debug_cycles();
}
} else {
46 changes: 23 additions & 23 deletions patches/fs-uae/debugger-on-stderr.diff
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
Index: demoscene-toolchain/submodules/fs-uae/src/od-fs/uaemisc.cpp
Index: demoscene-toolchain/submodules/fs-uae/src/od-fs/writelog_fs.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/od-fs/uaemisc.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/od-fs/uaemisc.cpp
@@ -85,7 +85,7 @@ void sleep_millis (int ms) {
void console_out_f(const TCHAR *fmt, ...) {
--- demoscene-toolchain.orig/submodules/fs-uae/src/od-fs/writelog_fs.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/od-fs/writelog_fs.cpp
@@ -479,7 +479,7 @@ void console_out_f (const TCHAR *format,
#else
va_list arg_ptr;
va_start(arg_ptr, fmt);
- vprintf(fmt, arg_ptr);
+ vfprintf(stderr, fmt, arg_ptr);
va_start(arg_ptr, format);
- vprintf(format, arg_ptr);
+ vfprintf(stderr, format, arg_ptr);
va_end(arg_ptr);
}

@@ -102,7 +102,7 @@ void f_out(void *f, const TCHAR *format,
}

void console_out (const TCHAR *msg) {
- printf("%s", msg);
+ fprintf(stderr, "%s", msg);
}

int console_get_gui (TCHAR *out, int maxlen) {
@@ -120,7 +120,7 @@ int console_get(TCHAR *in, int maxlen) {
#endif
@@ -490,7 +490,7 @@ void console_out (const TCHAR *txt)
#ifdef _WIN32
console_put (txt);
#else
- printf("%s", txt);
+ fprintf(stderr, "%s", txt);
#endif
}

void console_flush(void) {
- fflush(stdout);
+ fflush(stderr);
@@ -596,7 +596,7 @@ void console_flush (void)
#ifdef _WIN32
flushconsole ();
#else
- fflush(stdout);
+ fflush(stderr);
#endif
}

TCHAR console_getch (void) {
25 changes: 6 additions & 19 deletions patches/fs-uae/exceptions-on-stderr.diff
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
Index: demoscene-toolchain/submodules/fs-uae/src/debug.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/debug.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/debug.cpp
@@ -4836,7 +4836,7 @@ static bool debug_line (TCHAR *input)
debug_illegal_mask = debug_illegal ? 0 : -1;
debug_illegal_mask &= ~((uae_u64)255 << 24); // mask interrupts
}
- console_out_f (_T("Exception breakpoint mask: %0I64X\n"), debug_illegal_mask);
+ console_out_f (_T("Exception breakpoint mask: %016" PRIx64 "\n"), debug_illegal_mask);
debug_illegal = debug_illegal_mask ? 1 : 0;
} else {
addr = 0xffffffff;
Index: demoscene-toolchain/submodules/fs-uae/src/newcpu.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/newcpu.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/newcpu.cpp
@@ -2191,6 +2191,7 @@ static void exception_debug (int nr)
@@ -2911,6 +2911,7 @@ static void exception_debug (int nr)
return;
console_out_f (_T("Exception %d, PC=%08X\n"), nr, M68K_GETPC);
#endif
+ console_out_f (_T("Exception %d, PC=%08X\n"), nr, M68K_GETPC);
}

#ifdef CPUEMU_13
@@ -2993,7 +2994,7 @@ static void ExceptionX (int nr, uaecptr
@@ -3792,7 +3793,7 @@ static void ExceptionX (int nr, uaecptr

if (debug_illegal && !in_rom (M68K_GETPC)) {
if (debug_illegal && !in_rom(pc)) {
if (nr <= 63 && (debug_illegal_mask & ((uae_u64)1 << nr))) {
- write_log (_T("Exception %d breakpoint\n"), nr);
+ console_out_f (_T("Exception %d breakpoint\n"), nr);
activate_debugger ();
- write_log(_T("Exception %d breakpoint\n"), nr);
+ console_out_f(_T("Exception %d breakpoint\n"), nr);
activate_debugger();
}
}
12 changes: 6 additions & 6 deletions patches/fs-uae/fix-without-ppc.diff
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ Index: demoscene-toolchain/submodules/fs-uae/src/cpuboard.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/cpuboard.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/cpuboard.cpp
@@ -898,12 +898,16 @@ void cpuboard_rethink(void)
INTREQ_0(0x8000 | 0x0008);
@@ -1055,12 +1055,16 @@ void cpuboard_rethink(void)
safe_interrupt_set(IRQ_SOURCE_CPUBOARD, 0, false);
if (currprefs.cachesize)
uae_int_requested |= 0x010000;
atomic_or(&uae_int_requested, 0x010000);
+#ifdef WITH_PPC
uae_ppc_wakeup_main();
+#endif
} else if (!(io_reg[CSIII_REG_IRQ] & (P5_IRQ_PPC_1 | P5_IRQ_PPC_2))) {
INTREQ_0(0x8000 | 0x0008);
safe_interrupt_set(IRQ_SOURCE_CPUBOARD, 1, false);
if (currprefs.cachesize)
uae_int_requested |= 0x010000;
atomic_or(&uae_int_requested, 0x010000);
+#ifdef WITH_PPC
uae_ppc_wakeup_main();
+#endif
} else {
uae_int_requested &= ~0x010000;
atomic_and(&uae_int_requested, ~0x010000);
}
2 changes: 1 addition & 1 deletion patches/fs-uae/print-memwatch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Index: demoscene-toolchain/submodules/fs-uae/src/debug.cpp
===================================================================
--- demoscene-toolchain.orig/submodules/fs-uae/src/debug.cpp
+++ demoscene-toolchain/submodules/fs-uae/src/debug.cpp
@@ -3219,6 +3219,7 @@ static void memwatch (TCHAR **c)
@@ -3849,6 +3849,7 @@ static void memwatch (TCHAR **c)
mwn->access_mask = MW_MASK_CPU_D_R | MW_MASK_CPU_D_W | MW_MASK_CPU_I;
if (mwn->frozen && mwn->rwi == 0)
mwn->rwi = 3;
Expand Down
Loading

0 comments on commit 2edac59

Please sign in to comment.