mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
Two things, both about being able to check the emulator's work rather than
infer it.
Sound. The samples a payload pushes through the ADMAIF PIO port were being
discarded; now they are written to last_audio.wav and played on the host.
Each FIFO word is already a stereo frame, so the capture needs only a header.
The take is played after it is complete rather than streamed while it is
produced: the emulator generates samples in bursts and stalls entirely
between phrases while the payload talks to the codec over I2C, so a live
stream underruns wherever the producer falls behind the sound card, heard as
flicker. Queueing the finished buffer removes the producer from the timing
path. The rate comes from the I2S_TIMING the payload programmed, not a
nominal 48 kHz, or the melody replays at the wrong pitch.
Windows. Cross-compiled in a container, since neither dependency has a MinGW
package. Three things had to be fixed to get there, none of them findable
without actually trying it:
- mingw GCC 13 hits an internal compiler error on unicorn's
qemu/softmmu/memory.c at -O2, so unicorn is built at -O1.
- pread/pwrite are POSIX and absent on MinGW. The SD/eMMC image access now
has a seek-then-read shim, which is equivalent here because the emulated
storage is only touched from the CPU thread.
- SDL renames main on Windows, so SDL2main must be linked before SDL2 with
SDL_MAIN_HANDLED, and unicorn's threads need winpthread.
The .exe is static: one file, no DLLs beside it. Verified running natively -
it emulates a full hwtest sweep and plays the melody through WASAPI.
CI covers both platforms, and a third job runs the .exe on a Windows runner,
because a cross-build only proves it links. Builds on push and PR, not just
tags: the Windows build broke in three separate ways the first time it was
attempted, and a Linux-only workflow would have shown none of them.
31 lines
326 B
Plaintext
31 lines
326 B
Plaintext
# Build artifacts
|
|
rcm_emu
|
|
rcm_emu.exe
|
|
*.o
|
|
*.d
|
|
|
|
# Runtime captures
|
|
last_fb.rgba
|
|
last_fb.meta
|
|
last_fb*.png
|
|
out.log
|
|
out*.txt
|
|
emu_run*.log
|
|
emu_capture*.txt
|
|
win_run.log
|
|
last_audio*.wav
|
|
|
|
# User data — never commit dumps or keys
|
|
*.img
|
|
*.bin
|
|
|
|
# Editor / OS
|
|
.vscode/
|
|
.idea/
|
|
.DS_Store
|
|
__pycache__/
|
|
*.pyc
|
|
backup/
|
|
imgui.ini
|
|
rcm_emu.ini
|