Commit Graph
594 Commits
Author SHA1 Message Date
Yaya48andClaude Opus 5.5 d486779f50 Starlet: re-sample the ARM IRQ and FIQ lines on interrupt register writes
The core's IRQ and FIQ lines were set from WiiIPC's flags and masks only at
the start of each scheduler slice (Starlet::RunSlice, StarletBootstrapProbe).
Acknowledging an interrupt (HW_ARMIRQFLAG, write one to clear) or masking it
(HW_ARMIRQMASK) left the line asserted until the next slice, so code that
acknowledged an interrupt and unmasked IRQ within the same slice took it
again with no cause pending. Hollywood's interrupt output is level-sensitive.

StarletMemory now re-samples the lines of the core attached with
AttachInterruptLines on every write to those two registers, on both its
wide and byte-assembled write paths; Starlet and StarletBootstrapProbe
attach theirs. Raising a cause still reaches the core at the next slice, as
before. ARMCore exposes IsIRQLineAsserted and IsFIQLineAsserted for the
unit test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 02:19:55 +02:00
Yaya48andClaude Opus 5.5 bef2c8cf02 StarletBootstrapProbe: print the SBR1 ring with --sbr1-record
The probe printed the ring's length only. StarOS's EXP-003 images put
lines in the ring that REV_TRACE has no room for (the MEM2 monitor, the
measurements), so under Dolphin nothing showed them. After the record's
summary, --sbr1-record now prints the ring's text between "SBR1 RING
BEGIN" and "SBR1 RING END" on stderr, as StarOS's Broadway loader prints
it over the Gecko on the console: at most the ring's 4032 bytes, a byte
outside printable ASCII and newline, and the backslash, written \xHH.

The formatting is in ProbeRing.h, tested by StarletProbeRingTest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 17:50:01 +02:00
Yaya48andClaude Opus 5.5 b457eb18c3 StarletBootstrapProbe: --cycles
The probe ran every image for a fixed 512 slices of 4096 ARM cycles
(2097152). StarOS's EXP-003 images hash MEM2 and time series of
operations, which need more (StarOS experiments/proposals/mmu-console.md,
P-7 and P-8). --cycles <n> sets the budget: a decimal number of cycles,
a whole number of slices, from one slice to 2^30, given once; anything
else is a usage error (exit 2), never rounded. Without it the probe runs
2097152 cycles, as before, and the timeout messages name the budget.

The parser is in ProbeBudget.h, tested by StarletProbeBudgetTest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 17:34:06 +02:00
Yaya48andClaude Opus 5.5 6ede30f99e StarletBootstrapProbe: wait for StarOS's whole panic path
--expect-panic passed as soon as __panic_state was nonzero at the end of
a 4096-cycle slice. StarOS's handler stores the guard first, then the
code, then publishes the SBR1 record, so the run could stop with the path
half done. The probe now keeps running until the path is finished and
still is two slices later, and fails if the run budget ends first:
- __panic_state 1 and __panic_code 1;
- with --sbr1-record: STARLET_STATE 5 (Panic), FATAL_REASON 0 and
  EXI_OWNER 1 (handed back to the PPC);
- with --sbr1-absent: every word of the record area still zero.
The failure names the first unmet condition. The check is
StarOSPanicCheck.h, pure, with the SBR1 constants moved there, and
StarletProbePanicCheckTest covers each condition; each of 7 mutants of
the check fails a test. Runs that do not expect a panic are unchanged.

With StarOS's panic test image (eb930ee), interpreter and JIT: the
scenarios pass, two slices later than before. Three images derived from
it pass the previous probe and now fail: EXI kept by the Starlet
(--sbr1-record), __panic_code never stored, the record written although
absent (--sbr1-absent). (StarOS MMU-001 review of F1.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 00:20:23 +02:00
Yaya48andClaude Opus 5.5 a62c65615a IOS LLE: StarOS's panic words must not alias
LoadBootstrapELF accepted __panic_state and __panic_code at the same
address, or as two words sharing bytes: the code's store would then also
set the guard, and nothing could tell the two apart. They must now be two
non-overlapping words of the data segment, like the other checks, before
any byte is written. BootstrapELFTest.PanicWordsMustNotAlias: the same
word and three partial overlaps, all inside the data segment, are
rejected; adjacent words are accepted. With the rule disabled, the test
fails. (StarOS MMU-001 review of F1.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 00:20:22 +02:00
Yaya48andClaude Opus 5.5 612cab7b30 StarletBootstrapProbe: report StarOS's panic words
StarOS's panic path (ADR-0014 R6) writes no trace line: it sets the guard
word __panic_state, stores __panic_code and halts. LoadBootstrapELF now
returns both symbols when an image has them (optional, but both or
neither, as words of the data segment), and the probe stops a run whose
guard is set: it prints the trace published so far and
"Starlet panic state <n> code <n>", and passes --expect-panic when the
state is 1. Images without these symbols (StarletOS) load and run as
before; a REV:PANIC trace line still satisfies --expect-panic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 21:21:58 +02:00
Yaya48andClaude Opus 5.5 9b493a1e16 IOS LLE: optional ARM926 MMU aborts and CP15 privilege (StarOS MMU-001 F1)
ARMCore::SetMMUFaultsEnabled(true) makes the Starlet core deliver the
faults of the ARM926EJ-S MMU instead of the identity fallback:
- translation (section 0x5, page 0x7), domain (0x9, 0xb) and permission
  (0xd, 0xf) faults from the descriptors, the DACR (no access and the
  reserved value fault; manager skips AP) and AP with the S and R bits;
  ARMv5 has no execute permission, so a fetch needs read permission;
- data aborts (vector 0x10, LR = instruction + 8 in both states) set the
  FSR and the FAR (the MVA); prefetch aborts (vector 0x0c, LR + 4) set the
  IFSR (c5 opcode2 1) and leave the FAR unchanged;
- alignment faults (0x1) when control bit A is set;
- base-restored data aborts: the first faulting access ends the
  instruction's bus traffic and its register results are undone; words
  stored before the fault stay written;
- LDRT/STRT/LDRBT/STRBT check User permissions in any mode;
- the TLB keeps each granule's domain and AP, never caches a faulting
  walk, and c8 single-entry operations drop only the page that maps the
  MVA, so an entry stays stale until the guest invalidates it;
- MRC/MCR to CP15 from User mode is an undefined instruction.

The JIT stays usable: with the option on, every block entry goes through
C++, which checks the fetch under the current mode and DACR, and only
instructions that touch neither memory, CP15, the PSRs nor the exception
model run natively; the rest use the interpreter.

Off by default. The IOS LLE path keeps its identity fallback, its
savestate format (the option and the IFSR are not serialized) and its
idle-loop fast-forwarding; the only change there is that the data
accessors read one abort flag that stays clear.

20 StarletARMCoreMMUFaults tests, each run in the interpreter and the
JIT; the existing Starlet tests pass unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 21:09:18 +02:00
Yaya48andClaude Opus 5.5 3d12571127 IOS LLE: execute ARMv5TE enhanced DSP instructions (StarletOS phase 11 I1)
SMLAxy, SMLAWy, SMULWy, SMLALxy, SMULxy, QADD, QSUB, QDADD and QDSUB were
decoded as compare data processing that writes no register; the ARM926EJ-S
implements them. The interpreter now executes them with the Q flag and the
JIT leaves them to it. Adds ARMv5TEEnhancedDSPInstructions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 22:16:53 +02:00
Yaya48 54f5a74bbf Track exact StarletOS bootstrap integration and checkpoint provenance
Recover 16 modified and 6 previously untracked integration files. All 22 source SHA-256s match the pre-publication StarletOS snapshot. Add handoff instructions, byte-preserving attributes and private backup exclusion. This commit publishes existing behavior; it does not claim a new full build or hardware qualification. The two preceding local commits and staged files were screened before publication.
2026-10-03 16:27:07 +02:00
Yaya48 c230971f07 IOS LLE: checkpoint NAND conformance and diagnostic tooling
Preserve formatted NAND boot and Wii Remote pairing, add DMA/SRAM conformance tests and a Wii comparison probe. Keep P1 profiling tools and native update A/B evidence; reject the unhelpful targeted SRAM shortcut.
2026-09-23 13:30:17 +02:00
Yaya48 b931671fde IOS: checkpoint native Wii Shop connectivity and Starlet optimizations
Add opt-in AX88772 Ethernet with libslirp NAT, pinned Windows runtime setup and USB/network regressions. Correct Hollywood DI/reset interrupt routing and physical SRAM DMA for AES, SHA, NAND, SDIO and OHCI. Keep aligned Thumb bus accesses inside native JIT blocks.

Validated: 164 targeted tests pass. User confirmed Wii Shop connection and channel-list navigation at 100% speed / 59.96 FPS on 2026-09-12. Downloads and general channel performance remain unvalidated; local firmware, keys and runtime data are excluded.
2026-09-12 11:08:25 +02:00
Yaya48 ebb753d09a IOS: checkpoint Starlet JIT, PPC cache and Wii timing fixes
Save the remaining ARM JIT and MMU/cache optimizations, accurate Starlet timer and Wiimote report cadence, opt-in PPC event tracing, and full texture hashing in the LLE launcher. Include regression coverage and exclude local profiling artifacts.

Validation: 127 targeted tests from 15 suites passed, with one disabled test. Includes the current user-tested source state following the persistent NAND milestone.
2026-09-08 11:45:51 +02:00
Yaya48 31760e8bce IOS: persist Starlet NAND writes across restarts
Keep the source dump immutable and replay checksummed copy-on-write transactions from the active user profile. Persist program, erase, pairing and restored snapshot writes. Preserve interrupted tails before recovery and reject corrupt journals or concurrent writers.

Validated in the current build with 127 targeted tests and a user-confirmed channel deletion surviving process exit and restart; 2944 saved NAND pages reloaded successfully.
2026-09-08 11:42:29 +02:00
Yaya48 1bd3fac1f1 IOS: optimize Starlet LLE and accurate CPU cache
Retain ARM926 FCSE translations, accelerate common Starlet JIT blocks and cache sparse Hollywood register reads. Inline the hot Broadway write-back cache path while preserving exact cache miss, locking and split-access behavior.
2026-08-30 02:35:19 +02:00
Yaya48 9389e38f75 IOS: add x64 Starlet JIT with guarded fastmem 2026-08-28 13:22:30 +02:00
Yaya48 b85667435c HW: stabilize original BootMii interaction 2026-08-25 23:26:29 +02:00
Yaya48 5387658e0c IOS: boot original BootMii through MINI 2026-08-25 19:46:28 +02:00
Yaya48 a77c156bc8 IOS: add Starlet LLE milestone through HBC
Boot original Wii firmware through boot0, boot1, boot2 and IOS on an emulated ARM Starlet. Model the required IPC, memory, SD, USB and Bluetooth hardware behavior, including IOS reload into IOS58, and add focused tests, launch utilities and architecture documentation.
2026-08-25 17:11:49 +02:00
JosJuice cd3ea81462 Merge pull request #14767 from JosJuice/state-nand-open-file
IOS/FS: Fix loading savestate when files are open
2026-08-08 13:02:54 +02:00
Joshua Vandaële 55c015e6ac AchievementApprovedHash: Automatically generate hash using CMake 2026-07-27 07:09:11 +02:00
JosJuice 8a90cbf638 IOS/FS: Fix loading savestate when files are open
We already had code to close open host files when reading or writing a
savestate, but due to d35fe1b we also need to close open guest files
when reading a savestate, otherwise DoStateRead fails to delete them.

I was considering an alternative solution where instead of copying and
clearing m_handles, we just set `handle.opened = false;` for each handle
before reading a savestate (but not before writing a savestate).
However, this wouldn't solve the problem of DoStateWriteOrMeasure's
calls to OpenFile failing due to all handles being open. I'm not aware
of any games that have that many handles open, though.
2026-07-26 11:01:01 +02:00
Joshua Vandaële f1a639b12b CWDemangler: Resolve missing-declarations warnings 2026-07-25 05:19:26 +02:00
Joshua Vandaële d2833fb788 Remove Visual Studio Projects and Solutions in favor of CMake 2026-07-24 03:45:13 +02:00
cristian64 0cab1731d6 Core: Adjust emulated memory size automatically.
Dolphin now uses the simulated memory size defined in `bi2.bin` to
adjust the memory size in the emulated console automatically.

If **Enable Emulated Memory Size Override** has been enabled by the
user, the fixed memory size specified for **MEM1** and **MEM2** are
still used as they were before.

Most retail games do not define the simulated memory size (Wii or
Triforce games), or define it to a value that matches the default 24 MiB
(GameCube games), so, in the general case, there is no behavior change.
One game that sets the simulated memory to a non-default value is the
debug build of _Mario Kart: Double Dash!!_, where the value is set to
48 MiB.

This enhancement is focused mainly to the modding community. Prior to
these changes, modded games with extended memory requirements would
fail to launch in Dolphin [with no indication of what the problem is] if
the user failed to set the emulated memory override to the correct
value. Now, modding tools can specify the simulated memory size in the
`bi2.bin` file to produce extended games that _just work_ in Dolphin,
without cumbersome instructions that can be overlooked by the user.
2026-07-11 23:02:54 +01:00
Amber Brault 3f5460a5ff Core: Implement automatic symbol demangling 2026-05-07 09:25:28 +02:00
JMC47 6409c5beb3 Merge pull request #13931 from SuperSamus/pikmin-squared-60fps
GameINI: Add 60 FPS code for Pikmin Squared
2026-04-27 13:09:00 -04:00
Jordan Woyak 5588fe0022 Merge pull request #14308 from jordan-woyak/character-encoding
StringUtil: Make UTF16ToUTF8 and UTF8ToUTF16 use custom encoding/decoding implementation.
2026-04-25 14:59:27 -05:00
Martino Fontana c96d1b7b4a GameINI: Add 60 FPS code for Pikmin Squared 2026-04-25 10:45:25 +02:00
Jordan Woyak ff57599e67 StringUtil: Make UTF16ToUTF8 and UTF8ToUTF16 use custom encoding/decoding implementation to eliminate usage of deprecated std::wstring_convert. 2026-04-18 13:06:17 -05:00
Martino Fontana 95dec13203 Improve usage of std::move and const references parameters
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`.

Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move.

Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
2026-04-17 12:39:46 +02:00
Jordan Woyak 33f62b0f9f Merge pull request #14500 from Sintendo/span2
Replace `const std::vector&` arguments with `std::span`
2026-04-11 14:55:41 -05:00
JosJuice 4f0219d08c PageTableHostMappingTest: Fix copypaste error in misaligned+hole test
Because of this mistake, HoleInMaskMisalignedPageTable was testing the
same thing as MisalignedPageTable, which wasn't the intent.
2026-04-04 22:56:00 +02:00
JosJuice 3fe5df474b PageTableHostMappingTest: Fix alignment for misaligned+hole test
Mistakenly, MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE was aligned and
MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE_ALIGNED was misaligned. It should
be the other way around.

These variables are unused due to a separate mistake which is corrected
in the next commit.
2026-04-04 22:55:23 +02:00
Sintendo f6a67aa6e7 Use more std::span arguments 2026-03-23 23:55:09 +01:00
Martino Fontana a108fb849f AchievementManager: APPROVED_LIST_HASH quality of life improvements
APPROVED_LIST_HASH is moved to a separate file, making tests compilation faster after changing it.
The error message prints the hash in a way that it can be directly copy-pasted (though it still needs clang-format).
2026-02-22 00:22:46 +01:00
Jordan Woyak cbd43914a5 Network: Improve IPv4PortRange::ToString to support CIDR notation and only last octet difference. 2026-02-15 23:13:18 -06:00
Jordan Woyak 5545798e00 Common/Network: Add structs: IPv4Port, IPv4PortRange and functions: IPAddressToString, ParseIPv4PortRange. 2026-02-15 20:14:15 -06:00
Jordan Woyak 97ad5ad1a1 StringUtil: Add SplitStringIntoArray function template. 2026-02-15 20:14:15 -06:00
JMC47 c4b913d9da Merge pull request #13768 from JosJuice/page-table-fastmem-2
Core: Create fastmem mappings for page address translation
2026-02-04 16:20:35 -05:00
JosJuice 35ce08fb88 UnitTests: Add PageTableHostMappingTest 2026-02-04 21:35:22 +01:00
Jordan Woyak dd2b94cd4a Merge pull request #13594 from jordan-woyak/state-cleanups
State: Simplify interthread communication and general cleanups.
2026-02-03 16:50:52 -06:00
Martino Fontana a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00
Jordan Woyak 1d9e475123 Common: Add TransferableSharedMutex class and unit tests. 2026-01-19 21:56:59 -06:00
JosJuice 75666604a2 Jit64: Add fres unit test 2026-01-18 11:21:35 +01:00
iwubcode 373e35ed5b Merge pull request #14267 from jordan-woyak/std-expected
Common: Replace Result with std::expected.
2026-01-17 22:33:15 -06:00
Jordan Woyak dffc7a650d Common: Replace Result with C++23's std::expected. 2026-01-17 16:58:45 -06:00
Sintendo 1e0473e44f Fix various typos and spelling mistakes 2026-01-17 20:11:38 +01:00
Joshua Vandaële deeb6f160c Disable PatchAllowlistTest if USE_RETRO_ACHIEVEMENTS is OFF
This fixes a build error when `-DENABLE_TESTS=ON` and `-DUSE_RETRO_ACHIEVEMENTS=OFF` are both set together, since AchievementManager is also behind an ifdef.
2025-11-27 01:26:51 +01:00
JosJuice b6e062f2e3 Merge pull request #13689 from JosJuice/lock-core-any-thread
Core: Let any thread call previously host-thread-only functions
2025-11-16 18:35:17 +01:00
JosJuice 068947e2b6 Core: Remove IsHostThread
The core no longer cares which thread is the host thread.

Cleaning up Android's HostThreadLock is left for another PR, in part
because the HostThreadLock in NativeConfig.cpp still serves a purpose,
and in part to make any issues easier to bisect.
2025-11-10 21:14:56 +01:00