@@ -66,6 +66,49 @@ Tests libretro SRAM interface for save game handling.
6666./test/sram_test.sh ./virtualjaguar_libretro.dylib
6767```
6868
69+ ## Unit Test Suites (make test)
70+
71+ Six test suites run via ` make test ` , covering CPU emulation, interrupt handling,
72+ HLE BIOS, and blitter SIMD correctness.
73+
74+ ### test_gpu_instructions.c — GPU RISC ISA (51 tests)
75+ Arithmetic, logic, shift/rotate, compare, move/MOVEI, STORE/LOAD, saturation,
76+ register bank switching. Tests run GPU programs in GPU RAM via dlsym.
77+
78+ ### test_dsp_instructions.c — DSP RISC ISA (28 tests)
79+ Same ISA as GPU with DSP-specific differences: signed saturation (sat16s/sat32s
80+ instead of SAT8/SAT16), 8KB RAM at $F1B000.
81+
82+ ### test_m68k_instructions.c — Motorola 68000 (39 tests)
83+ MOVEQ, ADD/SUB/NEG/CLR, MULU/MULS/DIVU, SWAP, EXT, AND/OR/EOR/NOT,
84+ LSL/LSR/ASR/ROL/ROR, CMP/TST, memory addressing modes (direct, pre-dec,
85+ post-inc), LEA, ADDA/SUBA, BTST/BSET/BCLR.
86+
87+ ### test_irq.c — Interrupt Handling (18 tests)
88+ TOM IRQ enable/disable/latch/pending, JERRY IRQ enable, GPU IRQ assert/clear/IMASK,
89+ TOM video mode register, JERRY timer prescaler, BUTCH interrupt control.
90+
91+ ### test_hle_bios.c — HLE CD BIOS (14 tests)
92+ Jump table, CD_poll A1=0 convention, CD_wait_response, ISR setup handlers,
93+ TOC format, no-op entry safety, GPU auth magic, RAM byte order.
94+
95+ ### test_blitter_simd.c — Blitter SIMD (40,067 tests)
96+ Exhaustive bit-exact comparison of LFU, DCOMP, ZCOMP, byte_merge against
97+ reference implementations.
98+
99+ ### Build & Run
100+ ``` bash
101+ make -j4 DEBUG=1 # Build core
102+ make test # Build & run all test suites
103+ make test-build # Build tests only
104+ make clean-test # Remove test binaries
105+ ```
106+
107+ ### Framework (test_framework.h)
108+ Minimal single-header test framework with dlsym-based core loading.
109+ Provides GPU/DSP instruction encoding helpers, assert macros, and
110+ function pointers to all hardware subsystem functions.
111+
69112## CI Integration
70113
71114GitHub Actions workflow (` .github/workflows/regression-test.yml ` ) runs
@@ -80,9 +123,14 @@ test/
80123 regression_test.sh # Screenshot regression suite
81124 sram_test.sh # SRAM interface test
82125 test_cd_boot.c # CD boot diagnostics (C)
83- test_blitter_simd.c # SIMD blitter test (C)
126+ test_framework.h # Unit test framework header
127+ test_gpu_instructions.c # GPU RISC ISA tests (51)
128+ test_dsp_instructions.c # DSP RISC ISA tests (28)
129+ test_m68k_instructions.c # 68K CPU tests (39)
130+ test_irq.c # Interrupt handling tests (18)
131+ test_hle_bios.c # HLE CD BIOS tests (14)
132+ test_blitter_simd.c # SIMD blitter tests (40067)
84133 baselines/ # Reference PNG screenshots
85134 roms/ # Test ROMs (private/ is git-ignored)
86135 tools/ # Test ROM generators, SRAM test harness
87- cd_trace_*.log # Debug logs from CD boot tests
88136```
0 commit comments