Skip to content

Merge 1.7.0 from upstream#35

Closed
desertkun wants to merge 152 commits into
masterfrom
feature/merge-1.7.0
Closed

Merge 1.7.0 from upstream#35
desertkun wants to merge 152 commits into
masterfrom
feature/merge-1.7.0

Conversation

@desertkun
Copy link
Copy Markdown
Collaborator

In this change, recent work from upstream git://git.code.sf.net/p/fuse-emulator/fuse has been merged in.

@morozov please support testing thig change.

Along with the change, I plan to change the versioning scheme to <upstream version>-fusex-<fusex changes version>, currently 1.7.0-fusex-0.1

arki55 and others added 30 commits November 9, 2022 20:20
… output from configure script contains certain text.
build: Implemented full workflow for building Fuse APP on Linux.
- It reuses build_linux.yml workflow from fuse libspectrum repository.
- Split into 2 files : _build_linux_sub.yml  with logic and steps for building main Fuse APP - checkout, configure, make, make install, etc.  And build_linux with actually triggered workflow upon push and pull_request .
- First step is to build libspectrum with its reusable workflow. FOr that purpose repo needs to define variable LIBSPECTRUM_REPO - address of libspectrum repo in github.
- Libspectrum is built, all files zipped into artifact file, which is then loaded by build subprocess and its content installed (make install)
- Libspectrum is built once, then all the dependant various LInux based configurations are built.
- Each build variant provides its specific .configure params, what to verify in .configure output, etc.

Supporting configurations:
- Default built (no params for ./configure)
- NULL UI
- GTK 3 UI
- SDL 1 UI
- SDL 2 UI (only checks that it shows not supported yet)

Deprecated UIs (as per official site):
- GTK 2 UI
- Frame Buffer UI
- X UI
…kflows

https://sourceforge.net/p/arki55-fuse-mod/tickets/9/
feature: GitHub workflow build scripts for FUSE App -  for linux, WII, WIN32 and MacOS
Suppressing doubleclick message on title bar to not do window maximizing
(fixes bug #488).
Created separate menu for sound peripherals, moved 4 devices there.
Moved sound related peripherals' source files into standalone folder (like disk related stuff is in)

See more
https://sourceforge.net/u/arki55/tickets/4/
Multiple changes, fixes needed to make cross compiling for WII fork again:
- Make sure GEKKO constant is set from configure.
- Explicit defining of GEKKO constant removed from wiijoystick.c and wiimouse.c (as it is set from configure).
- Function clock_gettime (wii only) has changed its signature, needing 2 parameters now. I made a best guess here and chose CLOCK_REALTIME as the first parameter.
- In WII mode most of optional stuff is turned off. Sockets including. However some code was still requiring winsock2.h. Wrapped it into ifdef HAVE_SOCKETS.
- compat_dir variable does not need WII specific type override.
- Added missing key mappings based on build failure. Some keys cannot be mapped 1:1, so leaving them at the end. They will not be mapped.
- Removing compatibility file dir.c for WII, as it has now standard POSIX dir related functions.
- Updated github workflow file, fixed path to allow cross-compiling. Also added checks to make sure cross-compiling was active.
- Installing missing packages bison, flex

https://sourceforge.net/p/arki55-fuse-mod/tickets/11/
Modified GitHub build workflow files for Windows and so introduced configuration with SDL UI (widget) + SDL Sound
Small fixes within the sub workflow file.

https://sourceforge.net/p/arki55-fuse-mod/tickets/12/
- Remove AC_CHECK_INCLUDES_DEFAULT macro. Improves compatibility with
  older autoconf versions. AC_INCLUDES_DEFAULT are implicitly checked
  by LT_INIT and AC_CHECK_HEADERS macros.
- Remove unused AC_PROG_EGREP macro.
- ax_string_strcasecmp.m4 file updated from upstream.
- gtk-2.0.m4 file updated by autoupdate.
- sdl.m4 file updated from upstream.
The Freedesktop theme spec says that icons are first searched in
the current theme, then in its parents and finally in the default
"hicolor" theme.

"hicolor" is where Fuse installs its icons, however if generic-icon is
not specified in fuse.xml then it defaults to application-x-generic.

This means that if the current theme provides an icon named
application-x-generic it will be used instead of the ZX Spectrum one.

Fixes bug #494
as are also commonly used for non ZX Spectrum content
and is better to not associate as the preferred application.
(more from bug #494) (thanks, Berto).
SP0256 ROM initialisation moved to the uspeech.c and produces meaningful
error messages if something goes wrong.
- Memory read/write at 0x38 should page the ROM in/out
- ROM is mapped to the first 4 Kb only

Thanks to Tim Busse tests tape. Now Booty launches the hidden "diving" game.
fmeunier added 4 commits May 4, 2026 07:58
All download-artifact calls already use v8, but the four upload-artifact
calls in the libspectrum and Windows build sub-workflows were still on v7.
Align them to v8 so that upload and download versions are consistent.
Add 11 new unit tests to debugger_disassemble_unittest():

FD CB documented RES/SET on (IY+d):
- test25: FD CB 55 86 -> RES 0,(IY+55)
- test26: FD CB 55 C6 -> SET 0,(IY+55)

FD CB undocumented LD reg,RES/SET n,(IY+d):
- test27: FD CB 55 87 -> LD A,RES 0,(IY+55)
- test28: FD CB 55 CF -> LD A,SET 1,(IY+55)

Negative (IX-d)/(IY-d) offsets (offset byte >= 0x80):
- test29: DD CB FF 46 -> BIT 0,(IX-01)
- test30: FD CB FF 46 -> BIT 0,(IY-01)
- test31: DD 7E FF    -> LD A,(IX-01)

Relative jump instructions (DJNZ/JR):
- test32: 18 00 -> JR 4002  (zero forward offset)
- test33: 18 FE -> JR 4000  (backward -2 offset)
- test34: 10 FE -> DJNZ 4000 (backward -2 offset)
- test35: 20 04 -> JR NZ,4006 (conditional forward +4)
Add five unit tests:

- timex_flash_hires_skips_flashing: when hires=1, the function is a
  no-op regardless of flash bits in memory.

- timex_flash_b1_no_attrs_clean: when b1=1 and no flash bits are set in
  the alternate pixel area (0x2000-0x37ff), no maybe_dirty bits are set.

- timex_flash_b1_marks_dirty: when b1=1 and the flash bit is set at
  ALTDFILE_OFFSET (0x2000), display_dirty8() is called and
  display_maybe_dirty[0] bit 0 is set.

- timex_flash_altdfile_marks_dirty: when altdfile=1 and a flash attr is
  set at 0x3800 (second screen attr area, row 0 col 0), display_dirty64()
  marks all 8 corresponding pixel rows dirty.

- timex_flash_standard_delegates_to_sinclair: when scld=STANDARD, the
  function delegates to display_dirty_flashing_sinclair() and the result
  matches the existing sinclair flash tests.
@morozov
Copy link
Copy Markdown
Member

morozov commented May 5, 2026

A few thoughts on the merge itself before testing.

1. It doesn't look like a real merge

The first commit of the PR has a single parent, while a merge one would have two (the FuseX tip and the upstream fuse-1.7.0 tag). That would:

  1. Preserve both commit histories
  2. Establish a real merge base for all future syncs
  3. Allow to review the 3-way diff between the HEAD, upstream and base and see which changes come from where.

The way to do it:

git checkout -b merge/fuse-1.7.0 master
git fetch git://git.code.sf.net/p/fuse-emulator/fuse --tags
git merge fuse-1.7.0
# resolve conflicts, then:
git add .
git commit
# apply fixes and removal of irrelevant workflows on top

There are 4 conflicts with straightforward resolutions. I'd put the necessary minimum of additional changes into the merge commit itself — it would communicate the intent clearly: these changes don't come from upstream or from the fork's own history, but they are needed to make them work together.

2. Non-macOS code is selectively updated

The PR updates the build system (configure.ac, Makefile.am) to reflect upstream 1.7.0, but leaves the corresponding source trees at their pre-1.7.0 state — GTK, SDL, etc.

I think FuseX should either drop the unused code entirely or keep merging the patches from upstream. The latter is easier because once you merge them and don't touch this code, there will be no future Git conflicts by definition. If you delete them, there will be permanent conflicts (the upstream makes changes ↔ the fork has deleted these files).

3. Some upstream bug fixes were dropped

A handful of upstream 1.7.0 fixes touch code that is active in FuseX builds (e.g. networking, the debugger disassembler, display rendering). It would make sense to keep them at lets to have the right to carry the upstream vesion (1.7.0-fusex...).

Let me know if I should try merging myself.

fmeunier added 2 commits May 5, 2026 13:17
Add printf() diagnostics so that a failing CI run immediately shows:

  disassemble test: expected 'BIT 0,A', got 'BIT 0,B'
  disassemble test: 'LD (3456),BC': expected length 4, got 3
Add 20 new unit tests to debugger_disassemble_unittest() covering the
full range of ED-prefix (extended) instructions:

ED IN reg,(C) / OUT (C),reg:
- test36: ED 40 -> IN B,(C)
- test37: ED 70 -> IN F,(C)  (special-cased flag register form)
- test38: ED 41 -> OUT (C),B
- test39: ED 71 -> OUT (C),0  (special-cased zero form)

ED SBC HL,rr and ADC HL,rr:
- test40: ED 42 -> SBC HL,BC
- test41: ED 4A -> ADC HL,BC

ED LD (nn),rr and LD rr,(nn):
- test42: ED 43 56 34 -> LD (3456),BC
- test43: ED 4B 56 34 -> LD BC,(3456)

ED NEG / RETN / RETI:
- test44: ED 44 -> NEG
- test45: ED 45 -> RETN
- test46: ED 4D -> RETI

ED interrupt mode:
- test47: ED 46 -> IM 0
- test48: ED 56 -> IM 1
- test49: ED 5E -> IM 2

ED register-pair accumulator ops:
- test50: ED 47 -> LD I,A
- test51: ED 57 -> LD A,I

ED block instructions:
- test52: ED A0 -> LDI
- test53: ED B0 -> LDIR
- test54: ED A8 -> LDD
- test55: ED B8 -> LDDR
@desertkun
Copy link
Copy Markdown
Collaborator Author

Yeah, you're right my git client appears to messed up the merge process. Let me redo it.

@desertkun
Copy link
Copy Markdown
Collaborator Author

As per non-macos use, I am considering ditching fuse repository in this organization, renaming this repository into fusex, and trying to maintain it for both mac and windows.

@desertkun desertkun force-pushed the feature/merge-1.7.0 branch from 98b4beb to 39f1cc2 Compare May 5, 2026 20:02
@desertkun
Copy link
Copy Markdown
Collaborator Author

Okay I have restored merge history. Opted to resolve conflicts upstream way, and then just replaced the repo with local copy, making a commit that takes those changes back, most of which are about spectranet anyways.

Could you please elaborate on "Some upstream bug fixes were dropped", which ones?

@morozov
Copy link
Copy Markdown
Member

morozov commented May 6, 2026

Could you please elaborate on "Some upstream bug fixes were dropped", which ones?

One example: peripherals/nic/w5100_socket.c (upstream commit d936529).

Two lines are present in fuse-1.7.0 but were absent from the original version of this PR:

// in w5100_socket_process_accept():
socket->ir |= 1 << 0;  /* CON interrupt */

// in w5100_socket_process_read(), on EOF:
socket->ir |= 1 << 1;  /* DISCON interrupt */

Another example: debugger/disassemble.c — upstream 1.7.0 fixed the DDFD CB prefix disassembler for BIT/RES/SET instructions. At the time of review, these changes were not in the PR:

The PR had the old code at lines 608 and 619:

https://github.com/speccytools/fuse-for-macosx/blob/dadc1f7998de7a0bba9edcfec8ad132f0cdf6810/debugger/disassemble.c#L608

https://github.com/speccytools/fuse-for-macosx/blob/dadc1f7998de7a0bba9edcfec8ad132f0cdf6810/debugger/disassemble.c#L619

Upstream 1.7.0 has the corrected versions at the same lines:

https://github.com/speccytools/fuse-for-macosx/blob/d30cd156d1f220103f5ea1176523c497be2bea59/debugger/disassemble.c#L608

https://github.com/speccytools/fuse-for-macosx/blob/d30cd156d1f220103f5ea1176523c497be2bea59/debugger/disassemble.c#L619

[...] and then just replaced the repo with local copy

Doesn't this invalidate the merge? It retains the commit history but discards the change and introduces potential new conflicts (similar to deletion of unused code, if we revert upstream changes and they make new changes, we won't be able to accept them). I can review the post-merge commit in detail closer to the weekend.

@desertkun desertkun force-pushed the feature/merge-1.7.0 branch from 39f1cc2 to f639e87 Compare May 6, 2026 21:17
@desertkun
Copy link
Copy Markdown
Collaborator Author

image

I think I have nailed it this time.

I kept original (to the mac version) settings scheme

image

I am also considering to turn off spectranet by default, help me here. I want it turned on because I plan to expose users who never used Fuse before into the use case with spectranet, so I want them have to do less clicks. Produce separate builds?

@desertkun
Copy link
Copy Markdown
Collaborator Author

@morozov have you had the time to look into this latest change? Thanks.

@morozov
Copy link
Copy Markdown
Member

morozov commented May 10, 2026

Not yet, sorry. But I plan to in the next two days. So far, my immediate concern is the “Post-merge patches (conflict resolution)” commit (f639e87). I don't believe that there are +9,365/-2,164 lines of conflicts with the upstream. I want to perform this merge myself and see what's going on.

The other caveat that I didn't think of is that besides the main repo, we may need to merge the changes from the submodules — this is besides and before updating the pointers in the main repo.

@desertkun
Copy link
Copy Markdown
Collaborator Author

I already did update libspectrum library submodule. There it was straightforward.

Copy link
Copy Markdown
Member

@morozov morozov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked through this end-to-end on a reference branch (merge/fuse-1.7.0) that builds cleanly from a fresh clone. Three categories of issue, then the missing steps, then how we got there.

What's wrong

  1. Doesn't build from a clean clone. 'libspectrum_snap_uspeech_active' undeclared in 3rdparty/libspectrum/{z80,sna,szx,snapshot}.c. Upstream Fuse 07d6bba5 builds fine standalone against upstream libspectrum master, so the regression is purely in fork-side integration.
  2. Same merge antipattern as the prior attempts. For each conflicted file, the merge commit picked one parent verbatim and f639e87b patches the other side back in. Example: peripherals/spectranet.c is 1114→603→1137 lines across master → merge commit → f639e87b. Git can't relate the post-merge additions to either parent, so future upstream syncs will re-conflict on these files indefinitely.
  3. Subtle refcount bug in peripherals/nic/w5100.c (see inline).

Steps that are missing

This branch bumps 3rdparty/libspectrum to e4a2d6e1, but the bump in this fork is not a one-file operation. The following are also required for the build to work and aren't here:

  1. Regenerate fusepb/libspectrum.h against the bumped libspectrum's libspectrum.h.in + accessor txt files (via fusepb/generate.pl).
  2. Update fusepb/FuseX.xcodeproj:
    • Update the path of the five sound peripherals upstream moved into peripherals/sound/ (ay, covox, fuller, melodik, specdrum).
    • Add the two new sound peripherals upstream introduced (sp0256, uspeech).
    • Add dsnap.c, wav_macos.c, wav_internals.h (new libspectrum files used by upstream Fuse).
    • Add AudioToolbox.framework to the FuseX target (for the wav_macos backend; matches upstream macOS CI's --without-libaudiofile choice).
  3. Commit in 3rdparty/FuseImporter: regenerate its tracked libspectrum.h, wire dsnap.c + wav_macos.c into the Xcode project, add AudioToolbox.framework. Then bump the fusex submodule pointer to it. (Also: latent bug in its generate.pl — missing #define WIN32_DLL in the LIBSPECTRUM_DEFINE_TYPES handler — surfaces on regen and needs fixing.)
  4. Commit in 3rdparty/FuseGenerator: same as FuseImporter, but for both Quick Look targets (Preview and Thumbnail).
  5. Resolve the six text conflicts as 3-way merges in the merge commit itself, not as "take one side, patch other in follow-up". Conflicts: memory_pages.c, peripherals/spectranet.{c,h}, settings.dat, settings.pl, ui/sdl/sdlui.c.

The libspectrum bump itself cannot be a separate pre-merge commit because the new libspectrum isn't backward-compatible with the fork's pre-merge code (signature changes in libspectrum_creator_*, etc.) — it has to travel inside the merge commit alongside the changes that need its new APIs.

Proposed replacement

I'd like to propose merge/fuse-1.7.0 as the replacement for this PR so that you don't have to redo the same work. It's a single atomic merge commit on top of master with the steps above bundled in, and it builds cleanly from a fresh clone.

It depends on companion branches in the dependent submodule repos (regenerated libspectrum.h, Xcode wiring for new libspectrum source files + AudioToolbox.framework, the WIN32_DLL fix in FuseImporter's generate.pl):

Things on this branch that don't belong in the merge but are otherwise fine

A few of your changes here are deliberate fork-side decisions that just shouldn't ride inside the merge commit. Cleanest as separate commits on top of the merge:

  • Versioning scheme bump (fusepb/English.lproj/InfoPlist.strings: CFBundleShortVersionString from "1.7.1" to "1.7.0-fusex-0.1") — exactly the scheme you described in the PR description. Belongs to a separate commit after the merge, not here.
  • Removing GitHub Actions workflows (.github/workflows/*, 0f6feb66) — already its own commit here, but worth narrowing rather than blanket-removing. Dropping the Linux and Wii workflows makes sense, but the macOS and Windows ones build the platforms this fork does target. Unless they're utterly broken, removing them is counterproductive — those are exactly the pipelines that catch breakage like what we hit in this PR. Suggestion: keep build_macos*.yml, build_windows*.yml, build_libspectrum_macos_sub.yml, build_libspectrum_windows_sub.yml, windows_release.yml, test_release*.yml; drop the Linux/Wii ones.
  • Root settings-header.pl parser update for the 6-field format — forward-looking improvement (the macOS build uses fusepb/settings-header.pl, not the root one, so it doesn't affect macOS specifically) but a reasonable thing to land. Separate commit.

I haven't tested my branch thoroughly yet, so I may need to spend a couple more cycles. I also want to see if the GitHub Actions workflows are healthy or at least in a salvageable state.

Comment thread peripherals/nic/w5100.c
int i;
nic_w5100_t *self;

compat_socket_networking_init();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calls the unwrapped compat_socket_networking_init(), but the fork has a refcounted wrapper for it: utils_networking_init() in utils.c. Together with the utils_networking_init() call at line 148, the bookkeeping drifts at shutdown — the real init happens here outside the refcount, while w5100_start_io_thread increments the refcount per thread without a paired underlying init.

@desertkun
Copy link
Copy Markdown
Collaborator Author

Hmmm, your proposed branch/merge loses commit history from upstream. I would like to ideally preserve that. Maybe we're taking this too seriously.

Let me try make another attempt. With better conflict resolution. I'll take a look into submodules.

@morozov
Copy link
Copy Markdown
Member

morozov commented May 11, 2026

your proposed branch/merge loses commit history from upstream

No, it does not. morozov@a6988e4 has both parents.

Let me try make another attempt.

Why? I already did the merge.

@desertkun
Copy link
Copy Markdown
Collaborator Author

Can you open a new PR from your branch then?

morozov added a commit to morozov/fusex that referenced this pull request May 11, 2026
Atomic merge of upstream Fuse at 07d6bba (= fuse-1.7.0 + 70 commits) into the
FuseX fork as a single commit. Verified to build cleanly from a fresh checkout
via the BUILDING.md procedure. Tree contents = auto-merge result + conflict
resolutions + atomic-commit fix-ups for the merged tree to be a working state.

== Conflict resolutions (six text conflicts, resolved 3-way) ==

  memory_pages.c, peripherals/spectranet.{c,h}
    Both sides added independent paged-memory regions to the Spectranet
    handler -- fork added xfs and spectranext_config; upstream added
    flash_rom. All three preserved.

    spectranet.c additionally has a region inside `#ifdef BUILD_SPECTRANET`
    where upstream added stubs for spectranet_flash_rom_read /
    spectranet_flash_rom_write inside the `#else` branch (= when
    BUILD_SPECTRANET is OFF). Fork removed that entire `#else` stub branch
    in fork master, so upstream's stub additions are dead code in the fork's
    structure. Took HEAD's `spectranet_config_get_total_size` only;
    discarded upstream's stub additions to the removed branch.

  settings.dat
    start_scaler_mode: fork added an empty 'string-option processing
    function' column, upstream changed the default value from "normal"
    to "2x". Both kept (= "2x" with the empty extra column).

  settings.pl
    Fork removed the libxml2/ini config-file readers and the
    CONFIG_FILE_NAME defines (Cocoa builds use NSUserDefaults). Upstream
    added FALLBACK_CONFIG_FILE_NAME inside that same removed block --
    irrelevant in the fork's structure. Fork side kept.

  ui/sdl/sdlui.c
    Copyright year conflict only; took upstream's wider range (2000-2021).

== Atomic-commit fix-ups (changes the merge tree requires to be buildable) ==

Background: bumping `3rdparty/libspectrum` is not a backward-compatible
operation here -- new libspectrum (1) renames `libspectrum_creator_*`
signatures, (2) adds new symbols upstream Fuse 07d6bba uses
(`libspectrum_snap_uspeech_*`, `LIBSPECTRUM_ID_SNAPSHOT_DSNAP`), and (3)
splits wav.c into a frontend + backend pair (wav_audiofile.c or
wav_macos.c). A standalone bump commit on fork master therefore would not
build, so the bump must live inside this merge commit, paired with all
the changes the new libspectrum requires.

  3rdparty/libspectrum: 8ba1310 -> e4a2d6e1
    The speccytools/libspectrum master tip, itself a real 2-parent merge
    of fork-side and upstream-side libspectrum (audit recorded in
    specs/008-validate-pr35-fuse-1.7.0-merge.md).

  3rdparty/FuseGenerator and 3rdparty/FuseImporter: bumped to local branches
    Each subproject commits its own copy of `libspectrum.h` (an artifact
    of the fork's earlier choice to switch these from libspectrum-as-subtree
    to libspectrum-as-submodule without keeping the header auto-regenerated).
    The committed headers had to be regenerated against the bumped libspectrum,
    and each subproject also needed Xcode wiring for new libspectrum source
    files (dsnap.c, wav_macos.c) plus AudioToolbox.framework linkage for the
    wav backend. Each subproject's branch is `merge/fuse-1.7.0` (LOCAL --
    not pushed). See subproject commits for details. FuseImporter additionally
    has a fix to `generate.pl` (missing `#define WIN32_DLL`) latent until
    libspectrum.h.in started using LIBSPECTRUM_DEFINE_TYPES marker.

  fusepb/libspectrum.h
    Regenerated from the bumped 3rdparty/libspectrum/libspectrum.h.in via
    the Xcode build phase script. Adds the new symbols and updates
    libspectrum_creator_* signatures. Committed in-tree to keep the merge
    tree self-consistent.

  fusepb/FuseX.xcodeproj/project.pbxproj
    Three categories of changes:
    1. Sound peripherals upstream moved from peripherals/ into
       peripherals/sound/ (5 files: ay, covox, fuller, melodik, specdrum)
       get 'sound/' path prefixes.
    2. New sound peripherals upstream added (sp0256, uspeech): four file
       references and two build entries.
    3. New libspectrum source files (dsnap.c, wav_macos.c, wav_internals.h)
       referenced and compiled into FuseX, plus AudioToolbox.framework
       linkage for the wav_macos backend (matches upstream macOS CI's
       `--without-libaudiofile` choice).

== Build verification ==

Builds cleanly from a fresh checkout per BUILDING.md:
  git submodule foreach git reset --hard HEAD
  git submodule foreach git clean -fdx
  make clean && make clean-3rdparty
  make
  cd fusepb && make
  cd .. && make fusex XCODEBUILD_SIGN_ARGS='DEVELOPMENT_TEAM="" CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY="-"'
  # then the codesign sequence per BUILDING.md

Produces fusepb/build/Deployment/FuseX.app.

For comparison: fork master also builds; PR speccytools#35 (which omits the FuseGenerator/
FuseImporter and fusepb pbxproj/AudioToolbox fix-ups) does not build. Upstream
Fuse 07d6bba builds cleanly against upstream libspectrum master via its own
autotools build (verified separately).

== Plan and findings ==

specs/008-validate-pr35-fuse-1.7.0-merge.md   reference plan
scratch/PR-35-REVIEW.md                        full findings
morozov added a commit to morozov/fusex that referenced this pull request May 11, 2026
Atomic merge of upstream Fuse at 07d6bba (= fuse-1.7.0 + 70 commits) into the
FuseX fork as a single commit. Verified to build cleanly from a fresh checkout
via the BUILDING.md procedure. Tree contents = auto-merge result + conflict
resolutions + atomic-commit fix-ups for the merged tree to be a working state.

== Conflict resolutions (seven text conflicts, resolved 3-way) ==

  memory_pages.c, peripherals/spectranet.{c,h}
    Both sides added independent paged-memory regions to the Spectranet
    handler -- fork added xfs and spectranext_config; upstream added
    flash_rom. All three preserved.

    spectranet.c additionally has a region inside `#ifdef BUILD_SPECTRANET`
    where upstream added stubs for spectranet_flash_rom_read /
    spectranet_flash_rom_write inside the `#else` branch (= when
    BUILD_SPECTRANET is OFF). Fork removed that entire `#else` stub branch
    in fork master, so upstream's stub additions are dead code in the fork's
    structure. Took HEAD's `spectranet_config_get_total_size` only;
    discarded upstream's stub additions to the removed branch.

  peripherals/nic/w5100.c
    Fork added a `nic_w5100_t *self` parameter to nic_w5100_socket_add_to_sets
    and nic_w5100_socket_process_io call sites (with matching signature
    changes in w5100_socket.c and w5100_internals.h, which auto-merged), and
    swapped `compat_socket_networking_init()` for the refcounted
    `utils_networking_init()` wrapper in `nic_w5100_alloc`. Upstream
    independently extracted `w5100_start_io_thread`, switched to lazy thread
    start (nic_w5100_alloc no longer starts the io thread; nic_w5100_enable
    does), and made nic_w5100_free conditionally stop the thread only if
    started. Deltas are non-overlapping; took both verbatim.

  settings.dat
    start_scaler_mode: fork added an empty 'string-option processing
    function' column, upstream changed the default value from "normal"
    to "2x". Both kept (= "2x" with the empty extra column).

  settings.pl
    Fork removed the libxml2/ini config-file readers and the
    CONFIG_FILE_NAME defines (Cocoa builds use NSUserDefaults). Upstream
    added FALLBACK_CONFIG_FILE_NAME inside that same removed block --
    irrelevant in the fork's structure. Fork side kept.

  ui/sdl/sdlui.c
    Copyright year conflict only; took upstream's wider range (2000-2021).

== Atomic-commit fix-ups (changes the merge tree requires to be buildable) ==

Background: bumping `3rdparty/libspectrum` is not a backward-compatible
operation here -- new libspectrum (1) renames `libspectrum_creator_*`
signatures, (2) adds new symbols upstream Fuse 07d6bba uses
(`libspectrum_snap_uspeech_*`, `LIBSPECTRUM_ID_SNAPSHOT_DSNAP`), and (3)
splits wav.c into a frontend + backend pair (wav_audiofile.c or
wav_macos.c). A standalone bump commit on fork master therefore would not
build, so the bump must live inside this merge commit, paired with all
the changes the new libspectrum requires.

  3rdparty/libspectrum: 8ba1310 -> e4a2d6e1
    The speccytools/libspectrum master tip, itself a real 2-parent merge
    of fork-side and upstream-side libspectrum (audit recorded in
    specs/008-validate-pr35-fuse-1.7.0-merge.md).

  3rdparty/FuseGenerator and 3rdparty/FuseImporter: bumped to local branches
    Each subproject commits its own copy of `libspectrum.h` (an artifact
    of the fork's earlier choice to switch these from libspectrum-as-subtree
    to libspectrum-as-submodule without keeping the header auto-regenerated).
    The committed headers had to be regenerated against the bumped libspectrum,
    and each subproject also needed Xcode wiring for new libspectrum source
    files (dsnap.c, wav_macos.c) plus AudioToolbox.framework linkage for the
    wav backend. Each subproject's branch is `merge/fuse-1.7.0` (LOCAL --
    not pushed). See subproject commits for details. FuseImporter additionally
    has a fix to `generate.pl` (missing `#define WIN32_DLL`) latent until
    libspectrum.h.in started using LIBSPECTRUM_DEFINE_TYPES marker.

  fusepb/libspectrum.h
    Regenerated from the bumped 3rdparty/libspectrum/libspectrum.h.in via
    the Xcode build phase script. Adds the new symbols and updates
    libspectrum_creator_* signatures. Committed in-tree to keep the merge
    tree self-consistent.

  fusepb/FuseX.xcodeproj/project.pbxproj
    Three categories of changes:
    1. Sound peripherals upstream moved from peripherals/ into
       peripherals/sound/ (5 files: ay, covox, fuller, melodik, specdrum)
       get 'sound/' path prefixes.
    2. New sound peripherals upstream added (sp0256, uspeech): four file
       references and two build entries.
    3. New libspectrum source files (dsnap.c, wav_macos.c, wav_internals.h)
       referenced and compiled into FuseX, plus AudioToolbox.framework
       linkage for the wav_macos backend (matches upstream macOS CI's
       `--without-libaudiofile` choice).

== Build verification ==

Builds cleanly from a fresh checkout per BUILDING.md:
  git submodule foreach git reset --hard HEAD
  git submodule foreach git clean -fdx
  make clean && make clean-3rdparty
  make
  cd fusepb && make
  cd .. && make fusex XCODEBUILD_SIGN_ARGS='DEVELOPMENT_TEAM="" CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY="-"'
  # then the codesign sequence per BUILDING.md

Produces fusepb/build/Deployment/FuseX.app.

For comparison: fork master also builds; PR speccytools#35 (which omits the FuseGenerator/
FuseImporter and fusepb pbxproj/AudioToolbox fix-ups) does not build. Upstream
Fuse 07d6bba builds cleanly against upstream libspectrum master via its own
autotools build (verified separately).

== Plan and findings ==

specs/008-validate-pr35-fuse-1.7.0-merge.md   reference plan
scratch/PR-35-REVIEW.md                        full findings
morozov added a commit to morozov/fusex that referenced this pull request May 11, 2026
Atomic merge of upstream Fuse at 07d6bba (= fuse-1.7.0 + 70 commits) into the
FuseX fork as a single commit. Verified to build cleanly from a fresh checkout
via the BUILDING.md procedure. Tree contents = auto-merge result + conflict
resolutions + atomic-commit fix-ups for the merged tree to be a working state.

== Conflict resolutions (seven text conflicts, resolved 3-way) ==

  memory_pages.c, peripherals/spectranet.{c,h}
    Both sides added independent paged-memory regions to the Spectranet
    handler -- fork added xfs and spectranext_config; upstream added
    flash_rom. All three preserved.

    spectranet.c additionally has a region inside `#ifdef BUILD_SPECTRANET`
    where upstream added stubs for spectranet_flash_rom_read /
    spectranet_flash_rom_write inside the `#else` branch (= when
    BUILD_SPECTRANET is OFF). Fork removed that entire `#else` stub branch
    in fork master, so upstream's stub additions are dead code in the fork's
    structure. Took HEAD's `spectranet_config_get_total_size` only;
    discarded upstream's stub additions to the removed branch.

  peripherals/nic/w5100.c
    Fork added a `nic_w5100_t *self` parameter to nic_w5100_socket_add_to_sets
    and nic_w5100_socket_process_io call sites (with matching signature
    changes in w5100_socket.c and w5100_internals.h, which auto-merged), and
    swapped `compat_socket_networking_init()` for the refcounted
    `utils_networking_init()` wrapper in `nic_w5100_alloc`. Upstream
    independently extracted `w5100_start_io_thread`, switched to lazy thread
    start (nic_w5100_alloc no longer starts the io thread; nic_w5100_enable
    does), and made nic_w5100_free conditionally stop the thread only if
    started. Deltas are non-overlapping; took both verbatim.

  settings.dat
    start_scaler_mode: fork added an empty 'string-option processing
    function' column, upstream changed the default value from "normal"
    to "2x". Both kept (= "2x" with the empty extra column).

  settings.pl
    Fork removed the libxml2/ini config-file readers and the
    CONFIG_FILE_NAME defines (Cocoa builds use NSUserDefaults). Upstream
    added FALLBACK_CONFIG_FILE_NAME inside that same removed block --
    irrelevant in the fork's structure. Fork side kept.

  ui/sdl/sdlui.c
    Copyright year conflict only; took upstream's wider range (2000-2021).

== Atomic-commit fix-ups (changes the merge tree requires to be buildable) ==

Background: bumping `3rdparty/libspectrum` is not a backward-compatible
operation here -- new libspectrum (1) renames `libspectrum_creator_*`
signatures, (2) adds new symbols upstream Fuse 07d6bba uses
(`libspectrum_snap_uspeech_*`, `LIBSPECTRUM_ID_SNAPSHOT_DSNAP`), and (3)
splits wav.c into a frontend + backend pair (wav_audiofile.c or
wav_macos.c). A standalone bump commit on fork master therefore would not
build, so the bump must live inside this merge commit, paired with all
the changes the new libspectrum requires.

  3rdparty/libspectrum: 8ba1310 -> e4a2d6e1
    The speccytools/libspectrum master tip, itself a real 2-parent merge
    of fork-side and upstream-side libspectrum.

  3rdparty/FuseGenerator and 3rdparty/FuseImporter: bumped to local branches
    Each subproject commits its own copy of `libspectrum.h` (an artifact
    of the fork's earlier choice to switch these from libspectrum-as-subtree
    to libspectrum-as-submodule without keeping the header auto-regenerated).
    The committed headers had to be regenerated against the bumped libspectrum,
    and each subproject also needed Xcode wiring for new libspectrum source
    files (dsnap.c, wav_macos.c) plus AudioToolbox.framework linkage for the
    wav backend. Each subproject's branch is `merge/fuse-1.7.0` (LOCAL --
    not pushed). See subproject commits for details. FuseImporter additionally
    has a fix to `generate.pl` (missing `#define WIN32_DLL`) latent until
    libspectrum.h.in started using LIBSPECTRUM_DEFINE_TYPES marker.

  fusepb/libspectrum.h
    Regenerated from the bumped 3rdparty/libspectrum/libspectrum.h.in via
    the Xcode build phase script. Adds the new symbols and updates
    libspectrum_creator_* signatures. Committed in-tree to keep the merge
    tree self-consistent.

  fusepb/FuseX.xcodeproj/project.pbxproj
    Three categories of changes:
    1. Sound peripherals upstream moved from peripherals/ into
       peripherals/sound/ (5 files: ay, covox, fuller, melodik, specdrum)
       get 'sound/' path prefixes.
    2. New sound peripherals upstream added (sp0256, uspeech): four file
       references and two build entries.
    3. New libspectrum source files (dsnap.c, wav_macos.c, wav_internals.h)
       referenced and compiled into FuseX, plus AudioToolbox.framework
       linkage for the wav_macos backend (matches upstream macOS CI's
       `--without-libaudiofile` choice).

== Build verification ==

Builds cleanly from a fresh checkout per BUILDING.md:
  git submodule foreach git reset --hard HEAD
  git submodule foreach git clean -fdx
  make clean && make clean-3rdparty
  make
  cd fusepb && make
  cd .. && make fusex XCODEBUILD_SIGN_ARGS='DEVELOPMENT_TEAM="" CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY="-"'
  # then the codesign sequence per BUILDING.md

Produces fusepb/build/Deployment/FuseX.app.

For comparison: fork master also builds; PR speccytools#35 (which omits the FuseGenerator/
FuseImporter and fusepb pbxproj/AudioToolbox fix-ups) does not build. Upstream
Fuse 07d6bba builds cleanly against upstream libspectrum master via its own
autotools build (verified separately).
@desertkun
Copy link
Copy Markdown
Collaborator Author

Closed in favor of new PR

@desertkun desertkun closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.