Skip to content

Commit 1271317

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 4657455 commit 1271317

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
@@ -630,7 +630,7 @@ clean:
630630
TEST_CC ?= $(CC)
631631
TEST_CFLAGS = -O0 -g -Wno-incompatible-pointer-types
632632
TEST_LDFLAGS = -ldl
633-
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
633+
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
634634

635635
test/test_gpu_instructions: test/test_gpu_instructions.c test/test_framework.h $(TARGET)
636636
$(TEST_CC) $(TEST_CFLAGS) -o $@ $< $(TEST_LDFLAGS)
@@ -650,6 +650,9 @@ test/test_hle_bios: test/test_hle_bios.c test/test_framework.h $(TARGET)
650650
test/test_cd_hle_boot: test/test_cd_hle_boot.c test/test_framework.h test/cd_assertions.h $(TARGET)
651651
$(TEST_CC) $(TEST_CFLAGS) -o $@ $< $(TEST_LDFLAGS)
652652

653+
test/test_cd_bios_boot: test/test_cd_bios_boot.c test/test_framework.h test/cd_assertions.h $(TARGET)
654+
$(TEST_CC) $(TEST_CFLAGS) -o $@ $< $(TEST_LDFLAGS)
655+
653656
test/test_blitter_simd: test/test_blitter_simd.c src/blitter_simd.h $(TARGET)
654657
$(TEST_CC) -O2 -o $@ test/test_blitter_simd.c src/blitter_simd_neon.c
655658

@@ -681,10 +684,21 @@ test-cd-hle-boot: test/test_cd_hle_boot
681684
echo ""; echo "(full log: test/cd_hle_boot_baseline.log; rc=$$rc)"; \
682685
exit 0
683686

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

687-
.PHONY: clean test test-build clean-test test-cd-hle-boot
701+
.PHONY: clean test test-build clean-test test-cd-hle-boot test-cd-bios-boot
688702
endif
689703

690704
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)