Skip to content

SWI 0x23 — SoundWhatever3 (MusicPlayerContinue / MPlayContinue)

  • Entry: 0x000014FC (THUMB; SWI table stores 0x000014FD)
  • Status: verified (hardware-checked 2026-07-08: cycle counts and return registers measured on real GBA; struct layouts remain from static analysis)

Summary

Behaviorally the sequencer MPlayContinue: resumes a player that was paused/stopped by MPlayStop, by clearing the stopped flag so its tracks are processed again.

Parameters

Reg In Meaning
r0 ptr MusicPlayerInfo (identity 0x68736d53 at +0x34)

Returns

No return value.

Clobbered registers

r1, r2.

Hardware audit (2026-07-08, canary r4–r12 + CPSR snapshot): caller-visible clobbers: r0 (player pointer) preserved, r1 = 0x68736D53, r2/r3 preserved. r2, r4–r12, r13, and CPSR (flags and mode) came back bit-identical on every tested path. r11/r12 are explained by the SWI dispatcher (it pushes {r11, r12, lr} — see 10_irq_boot_and_iwram.md) and CPSR by the SPSR restore on return; r2 and r4–r10 must be preserved or restored by the routine itself — where a static note above claims r2 is destroyed, the hardware disagrees at the caller level. Raw data: results/clobber_audit_pass2.csv.

Algorithm

  1. Verify MusicPlayerInfo identity (+0x34); no-op if not open. Bump it as a busy lock.
  2. Clear the "stopped" flag (bit 0) in the player flags word (+0x04) by masking it off (flags = flags & ~1, implemented as a left-then-right shift by 1).
  3. Restore the identity word and return.

Edge cases & known bugs

  • No-op if the MusicPlayerInfo is not a valid opened player.
  • Only clears the stop flag; if playback had reached the song end, continuing has no audible effect until restarted.

Cycle count

Hardware-measured net CPU cycles (worker-ROM harness, TM0/TM1 cascade at F/1, 13-cycle baseline subtracted; identical across 3 runs — see 02_hardware_verification_checklist.md § Measurement setup).

87 cycles.

Open questions (need hardware verification)

  • Whether other pause-related state (fade, track flags) is also affected.

GBATEK cross-reference

Identifies GBATEK's reserved SWI 0x23 as the sequencer MPlayContinue.