Skip to content

Native IRX host: vblank waits 4 and 6, data guesses left out of discovery, stuck task named - #101

Open
boubou666 wants to merge 12 commits into
masterfrom
jc2/native-irx-host
Open

boubou666 wants to merge 12 commits into
masterfrom
jc2/native-irx-host

Conversation

@boubou666

Copy link
Copy Markdown
Contributor

Jade Cocoon 2's i-mode and sound drivers on the compiled-library host (Genki's M2IMODE and M2SOUND over Sony's IMODEMAN, LIBSD, MODMIDI and MODHSYN):

  • vblank 4 and 6: WaitVblankStart (4) and WaitVblank (6) now wait for the next native frame tick, as WaitVblankEnd (5) already did. There is no display, so the start and the end of a vblank are the same tick. IMODEMAN polls on 4.
  • recompile.py: a pointer_seeds guess that cannot be recompiled, and that no recompiled function calls, is data rather than a function. It is now left out instead of failing the whole module.
    • Case: IMODEMAN.IRX, 0x84c10 at base 0x6a100, a data word that holds the address after a JR $ra.
    • The entry, the exports and --entry addresses are never dropped.
  • Stuck-task error: "native library tasks made no blocking progress" now names each task still running, with its pc and ra.
  • Trace: BOZO_NATIVE_IRX_TRACE also logs sifcmd 15 (an IOP bind of an EE service).

Checks:

  • DC's LIBSD, SDRDRV, MODMIDI, MODHSYN and EZMIDI discover the same functions as before.
  • JC2 runs 600 frames headless with all eight of its modules compiled.
  • The engine's test suite was not run.

🤖 Generated with Claude Code

boubou666 and others added 11 commits November 19, 2026 07:52
The back buffer's pixels are undefined where the window isn't visible (GL
pixel ownership), so captures of a covered or minimised window came out
black. The window now presents into its own framebuffer, blits it to the
screen, and captures read from that framebuffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A game may load a module into another's span (JC2: a battle effect at
0x96B000 over the tail of the Arena's lesson script at 0x96A800). Both
headers then match and moduleAt threw "ambiguous native module identity",
ending the run. Where two resident modules cover an address, the one
starting higher wins; each module keeps the lowest other start inside its
span as the limit of the last-module fast path. Same-start ambiguity still
throws. Runtime test added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en captures)

Master's ead0535 already captures from an offscreen picture and opens hidden
windows (WindowOptions::hidden / captureScene, PS2X_CAPTURE_SCENE=1): the
branch's own 250ff32 duplicated it, so the four files it touched take
master's version. The branch now differs from master only by the
overlapping-module fix (3a1b81e).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re their newer fields

States saved before these sections grew fail to load ("section pad ends before its fields"; then mpeg, sif) and the
game starts from the boot. JC2's states from before 2026-11-24 hit all four:
- pad: libpad2's sockets (pad2Sockets, pad2Next) came after multitapAttached; an older section ends there, and no
  socket is open.
- mpeg: inputEnded (MpegOptions::sdkNodata) came before the sound; an older section has exactly the sound left, and
  the input goes on.
- sif: the IOP side's software registers came before the heap; the older layout is tried first and kept only when it
  reads the section exactly (Archive::end checks it), with the registers cleared; otherwise the reader rewinds.
- snd: a state from before the 989SND driver was saved has "timers" next; the driver stays as it is.

Archive::sectionLeft(): the bytes the open section has left when reading. What is written does not change.

bozo-state-tests (sectionLeft) passes, with the whole engine suite on jc2/native-irx-host (symbol_maps aside: the
build's temp directory has "game" in its path). JC2: s24300_arena.state, saved on the engine before these fields,
loads again and the run goes on in the scene it was saved in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ipu parser and decoder)

For a game that drives the IPU itself to play Sony's ".ipu" files (header "ipum", size, width, height, frame count,
then intra-only IPU frames) as animated textures: no IPU, no DMA. open() copies the file and splits its frames with
FFmpeg's "ipu" parser; decodeMacroblocks(index, out) gives a frame as the IPU's colour conversion (CSC, RGB32) writes
it, 16 x 16 macroblocks in raster order (BT.601 video range), and decodeRaster the picture's rows. Built with
BOZO_HAVE_FFMPEG like libmpeg's decoder; without FFmpeg open() fails and the port keeps its own path.

JC2 answers its IPU player with it (scene D001's water: 64 x 64, 298 frames decoded into the game's ring).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hannel

The I/O library completes a channel the game starts (CHCR with STR) at once: no DMA, no VIF, no GIF. A port that
needs to know what the game sent can now read the transfer there: dmaStarted(channel, its registers) is called as
the channel starts, before the library completes it; unset, nothing changes. JC2 uses it to follow the GS image
transfers in its VIF1 and GIF chains (which RAM went to which texture page), for the effects whose texture records
are their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A state restored the cards' contents but not their host folder, so a game's saves after
--load-state stayed in memory and were lost. Cards kept in a folder are now taken back from
the folder when a state loads (a console's memory card is not part of a save state); cards in
memory stay the state's.

Archive::end closed a section before checking its size: a reader trying an older layout (the
libraries' sif section) that failed there rewound into a nameless section and the load failed
further on. The check now comes first. Tests for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant