Skip to content

A PSF format bug #10

Description

@umjammer

as for DQ samples

some songs are silent.

opus5 said


A bug in aosdk that I faithfully reproduced. In psx_bios_hle, DeliverEvent (B0 0x07) leaves the function with a bare return when the target event isn't active:

if (Event[ev][spec].status != LE32(EvStACTIVE))
{
    printf("event not active\n");
    return;            /* skips the "PC = RA" every other path falls through to */
}

That leaves the pc sitting on the HLECALL instruction that got us there, so the next step runs the same call again — for ever. The sound driver never advances, no voice is ever keyed, and the output is silence.

The probe made it obvious. In a track that works, the CPU idles in the driver's main loop; in a silent one it never leaves the kernel vector:

916 (plays)   peak=9500   pc 800f01a4 ×1306   pc 800f01a8 ×461
917 (silent)  peak=0      pc 000000b0 ×1950   ← t1=0x07, a0=0xf0000009

PsxHw now breaks instead, falling through to PC = RA like every other call.


-                    return;
+                    // Nothing to deliver, but the call still has to return: aosdk leaves the
+                    // function here instead, which skips the "PC = RA" at the bottom and leaves
+                    // the pc on the HLECALL that got us here, so the next step runs the same
+                    // call again and the song spins at 0xb0 for ever. Fourteen of the forty six
+                    // tracks of Dragon Quest Monsters 1+2 are silent in aosdk for this reason.
+                    break;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions