Pick up upstream newlib commit 588c19ecdbcca1e70030688c1b08c342ada01b84 ("Fix memcpy alignment problems for m68k architecture", Yuichi Nakamura), which the bundled newlib 4.6.0 predates.
Under MISALIGNED_OK=0 (68000) an unaligned copy longer than 64 KiB was truncated, because the residue loop used "dbra d1" over the whole length. Also fixes 68020 misaligned access, word-aligned 68000 access, and the signed loop comparison that broke copies >2 GiB.
Fixes#315
DoDriverIO's types, and NumVersion is a plain integer there. Recognize when
the Universal Interfaces are present by the UNIVERSAL_INTERFACES_VERSION rather than by
the header's presence, and with Multiversal declare only what it lacks.
Builds an 'ndrv' the Driver Loader loads from the Extensions folder:
links with ndrv.lds and an export list, runs MakePEF, and Rezzes the PEF
with RetroPPCndrv.r into <name>.bin and <name>.dsk.
KIND GENERIC, AIM or SIM writes the export list for a Device Manager
driver (DoDriverIO), an ATA Interface Module (ThePluginDispatchTable) or a
SCSI Interface Module (LoadSIM), each with TheDriverDescription. EXPORTS
takes a list file instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One member, kDropInAdditionCFrag, no 'SIZE'. Mac OS skips a driver file
without a 'cfrg' in its resource fork.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lays out GCC's XCOFF sections the way MakePEF expects for an 'ndrv':
read-only data goes in .data, since a driver is never memory-mapped, and
.data starts with a pad word against a ROM DisposePtr bug. From
elliotnunn/classicvirtio, MIT-licensed. Installed with the .cmake files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Mini vMac launcher builds its boot disk from scratch and copies only
the System file, the debugger and a fixed handful of extensions from the
configured system image. Anything else a program under test needs is
absent -- notably the 'AppleTalk' file, which carries the .XPP and .DSP
drivers on System 6/7, so OpenDriver(".DSP") returns fnfErr on every
LaunchAPPL boot even though the system image has it.
Add a repeatable --system-extra-file NAME option (config-file key
system-extra-file). Each named file is copied by name from the system
disk's blessed folder when present, right after the debugger file, using
the existing CopySystemFile path; a name missing from the system disk is
skipped, so one config can serve images that differ. Documented in
LaunchAPPL.cfg.example with the AppleTalk file as the example.
Verified on macOS with a System 6.0.8 image: an app that opens .DSP
fails without the option and succeeds with `--system-extra-file
AppleTalk`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KKngnYbKgJyQ78EqPQZAGL
The previous `_realloc_r` implementation would leak the original memory block (`ptr`) when the in-place `SetPtrSize` call failed and a new block had to be allocated.
This change also adds correct handling for `realloc(ptr, 0)`, which should free the block and return `NULL`.