Skip to content

Commit ebc1e76

Browse files
committed
test: add real-BIOS CD boot smoke harness (test_cd_bios_boot)
Mirrors test_cd_hle_boot but forces virtualjaguar_cd_boot_mode=bios so the real Atari Jaguar CD BIOS is loaded from VJ_TEST_CD_ROOT (default test/roms/private). Discovers all .cue/.iso under that root, runs each for VJ_TEST_CD_FRAMES (default 600 — enough to clear the BIOS animation window and watch each disc reach its game-code entry point). New make target: test-cd-bios-boot (parallel to test-cd-hle-boot, also intentionally excluded from 'make test''s strict pass/fail loop). Adds two diagnostic LOG lines around CDIntfOpenImage in retro_load_game so silent disc-open failures are visible in the test log instead of just retro_load_game failed. Current real-BIOS baseline (600 frames): - All 9 cue discs advance through CD-AUTH bypass into game code (vs all 9 stuck in BIOS animation at 300 frames) - 8/9 then PC-OOB into garbage (stack/streaming corruption); Primal Rage stalls in BIOS at \$003616 Made-with: Cursor
1 parent dabb293 commit ebc1e76

4 files changed

Lines changed: 440 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ test/*.dSYM/
2828
# test/roms/private/*
2929
!test/roms/private/.gitkeep
3030
!test/roms/private/README.md
31+
/test/test_cd_bios_boot
3132
/test/test_cd_hle_boot
3233
/test/test_dsp_instructions
3334
/test/test_gpu_instructions

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ clean:
625625
TEST_CC ?= $(CC)
626626
TEST_CFLAGS = -O0 -g -Wno-incompatible-pointer-types
627627
TEST_LDFLAGS = -ldl
628-
TEST_BINS = test/test_gpu_instructions test/test_dsp_instructions test/test_m68k_instructions test/test_irq test/test_hle_bios test/test_cd_hle_boot test/test_blitter_simd
628+
TEST_BINS = test/test_gpu_instructions test/test_dsp_instructions test/test_m68k_instructions test/test_irq test/test_hle_bios test/test_cd_hle_boot test/test_cd_bios_boot test/test_blitter_simd
629629

630630
test/test_gpu_instructions: test/test_gpu_instructions.c test/test_framework.h $(TARGET)
631631
$(TEST_CC) $(TEST_CFLAGS) -o $@ $< $(TEST_LDFLAGS)
@@ -645,6 +645,9 @@ test/test_hle_bios: test/test_hle_bios.c test/test_framework.h $(TARGET)
645645
test/test_cd_hle_boot: test/test_cd_hle_boot.c test/test_framework.h test/cd_assertions.h $(TARGET)
646646
$(TEST_CC) $(TEST_CFLAGS) -o $@ $< $(TEST_LDFLAGS)
647647

648+
test/test_cd_bios_boot: test/test_cd_bios_boot.c test/test_framework.h test/cd_assertions.h $(TARGET)
649+
$(TEST_CC) $(TEST_CFLAGS) -o $@ $< $(TEST_LDFLAGS)
650+
648651
test/test_blitter_simd: test/test_blitter_simd.c src/blitter_simd.h $(TARGET)
649652
$(TEST_CC) -O2 -o $@ test/test_blitter_simd.c src/blitter_simd_neon.c
650653

@@ -676,10 +679,21 @@ test-cd-hle-boot: test/test_cd_hle_boot
676679
echo ""; echo "(full log: test/cd_hle_boot_baseline.log; rc=$$rc)"; \
677680
exit 0
678681

682+
# Same shape as test-cd-hle-boot but exercises the real Atari Jaguar CD BIOS.
683+
# Requires the BIOS file to live under VJ_TEST_CD_ROOT (default test/roms/private).
684+
test-cd-bios-boot: test/test_cd_bios_boot
685+
@echo ""; echo "=== CD real-BIOS boot smoke (TDD baseline; not part of strict test) ==="
686+
@DYLD_LIBRARY_PATH=. LD_LIBRARY_PATH=. test/test_cd_bios_boot \
687+
> test/cd_bios_boot_baseline.log 2>&1; \
688+
rc=$$?; \
689+
grep -aE '\[(RUN|PASS|FAIL|CRASH|FOCUS-SKIP|SKIP|PC-)\]|Discovered|---' test/cd_bios_boot_baseline.log; \
690+
echo ""; echo "(full log: test/cd_bios_boot_baseline.log; rc=$$rc)"; \
691+
exit 0
692+
679693
clean-test:
680694
rm -f $(TEST_BINS) $(addsuffix .dSYM,$(TEST_BINS))
681695

682-
.PHONY: clean test test-build clean-test test-cd-hle-boot
696+
.PHONY: clean test test-build clean-test test-cd-hle-boot test-cd-bios-boot
683697
endif
684698

685699
print-%:

libretro.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,10 @@ bool retro_load_game(const struct retro_game_info *info)
11581158
* and haveCDGoodness is set correctly. */
11591159
if (jaguar_cd_mode)
11601160
{
1161+
LOG_INF("[CD] Opening disc image: %s\n", cd_image_path);
11611162
if (!CDIntfOpenImage(cd_image_path))
11621163
{
1164+
LOG_ERR("[CD] CDIntfOpenImage failed for: %s\n", cd_image_path);
11631165
if (videoBuffer)
11641166
{
11651167
free(videoBuffer);
@@ -1172,6 +1174,7 @@ bool retro_load_game(const struct retro_game_info *info)
11721174
}
11731175
return false;
11741176
}
1177+
LOG_INF("[CD] Disc image opened OK\n");
11751178
}
11761179

11771180
JaguarInit(); // set up hardware

0 commit comments

Comments
 (0)