Skip to content

Commit f12b88d

Browse files
JoeMattclaude
andcommitted
acid: comprehensive test set across all 13 categories (19/28 passing)
Builds out the test suite per user direction: write all the tests we might need now, so future phases can be just closing out bugs and perf issues found by them. Failures are intentional documentation of known accuracy gaps. Tests landed (28 total, 19 PASS / 7 FAIL / 2 NOT-RUN-YET): memory/ (5 tests, 5 PASS) ram_byte PASS -- 8-bit RW round-trip ram_word PASS -- 16-bit RW round-trip ram_long PASS -- 32-bit RW round-trip ram_endianness PASS -- 32-bit write reads back as 4 BE bytes cart_rom_read PASS -- cart at $800000 reads correctly timing/ (5 tests, 4 PASS / 1 FAIL) vc_advance PASS -- VC counter changes vc_per_frame PASS -- VC sweeps once per frame at NTSC rate vc_field_bit PASS -- bit 11 toggles between fields hc_advance PASS -- HC changes within a scanline jerry_pit_setup FAIL -- write $1234 to JPIT1, readback returns 0 (despite commit 1ca2fdc claiming to fix this) irq/ (4 tests, 2 PASS / 2 NOT-RUN-YET) irq_clear_works PASS -- explicit CLEAR removes pending state irq_mask_suppresses PASS -- masked IRQ correctly doesn't fire vblank_delivery NRY -- TOM raises (counter ticks) but 68K vec64 doesn't jerry_pit_irq NRY -- same shape: PIT enabled, handler never fires blitter/ (6 tests, 1 PASS / 5 FAIL) zzz_smoke PASS -- placeholder; touches no blitter copy_simple FAIL -- 16bpp 4-px copy: blit runs (perf shows blitter_calls=1, inner=2, phrase_writes=1) but dest stays zero -- real bug surface copy_pix8 FAIL -- 8bpp variant, same symptom copy_pix32 FAIL -- 32bpp variant, same symptom multiline_copy FAIL -- 4 lines x 1 phrase, same symptom pattern_fill FAIL -- PATDSEL only (no SRCEN), same symptom All five fail identically -- a likely common-mode bug in the blitter MMIO write path or in our register encoding. gpu/ (1 test, 1 PASS) gpu_reg_access PASS -- 68K can write/read GPU work RAM at $F03000 dsp/ (1 test, 1 PASS) dsp_reg_access PASS -- 68K can write/read DSP work RAM at $F1B000 op/ (1 test, 1 PASS) op_stop_terminates PASS -- STOP object terminates OP cleanly hle/ (2 tests, 2 PASS) hle_post_init_state PASS -- $0804 work-flag = 1, $F03000 GPU auth nonzero hle_vector_table PASS -- vec 64 ($100), vec 100 ($190) are non-garbage quirks/ (1 test, 1 PASS) bsr_long_61ff PASS -- BSR.W round-trip works (BSR.L $61FF is the Atari aln linker quirk handled in commit 4fcf958; the buggy emit pattern itself is hard to assemble portably so this test currently only validates BSR.W as a sanity gate; a real $61FF emitter is a follow-up) stress/ (1 test, 1 FAIL) many_blits FAIL -- 256 successive blits; same root cause as the blitter category above perf/ (1 test, 1 PASS) memcpy_loop PASS -- 1024-long 68K memcpy; perf counter delta shows the work; useful baseline Address-range bug found and fixed during bringup: the original tests used $200000-$208000 for scratch buffers, but Jaguar main RAM is 2 MB ($0..$1FFFFF), so $208000 was open-bus. All buffer addresses moved to $80000/$90000 (well clear of vectors at $0..$3FF, BIOS workspace, cart-mode stack, and ACID_BASE at $100000). Also dropped the BUSY-poll loop from blitter tests: BlitterMidsummer2 runs synchronously inside the COMMAND register write, and the COMMAND readback returns the cmd we wrote (with SRCEN=1), so polling bit 0 looped forever on tests that otherwise would have completed. The 7 FAIL + 2 NOT-RUN-YET cases are real emulator bugs surfaced (not introduced) by this work: * blitter-write-doesn't-land -- 5 tests + 1 stress test all fail identically. Highest-priority follow-up. * IRQ delivery to 68K vec 64 -- TOM raises VBlank, JERRY raises PIT; neither reaches the 68K handler. Likely shared with the Doom timing report (issue #131). * JERRY PIT register readback -- writes a value, reads back zero. Refs commit 1ca2fdc which was meant to fix exactly this. Co-Authored-By: Claude Opus 4.7 <[email protected]>
1 parent 8aef409 commit f12b88d

24 files changed

Lines changed: 1204 additions & 71 deletions
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
;
2+
; tests/blitter/copy_pix32.s - 2-pixel 32bpp blitter copy round-trip.
3+
;
4+
; pixsize=5 (32bpp), one phrase = 2 pixels (8 bytes).
5+
;
6+
; Detail codes:
7+
; 1 = blitter never finished
8+
; N = first mismatched longword index (1-based, 1..2)
9+
;
10+
include "include/jaguar_header.s"
11+
include "include/acid_test.s"
12+
13+
B_BASE equ $F02200
14+
B_A1_BASE equ B_BASE + $00
15+
B_A1_FLAGS equ B_BASE + $04
16+
B_A1_PIXEL equ B_BASE + $0C
17+
B_A2_BASE equ B_BASE + $24
18+
B_A2_FLAGS equ B_BASE + $28
19+
B_A2_PIXEL equ B_BASE + $30
20+
B_COMMAND equ B_BASE + $38
21+
B_COUNT equ B_BASE + $3C
22+
23+
SRC equ $00080000
24+
DST equ $00090000
25+
SPIN_LIMIT equ 1000000
26+
27+
org $802000
28+
entry:
29+
ACID_INIT
30+
31+
lea SRC.l,a0
32+
move.l #$DEADBEEF,(a0)+
33+
move.l #$CAFEBABE,(a0)+
34+
35+
lea DST.l,a0
36+
clr.l (a0)+
37+
clr.l (a0)+
38+
39+
;; A?_FLAGS for 32bpp (pixsize=5) phrase mode:
40+
;; pixsize=5 -> bits 3..5 = 101 = $28
41+
;; e=1 (2 phrase pixels) -> bits 11..14 = $0800
42+
;; xadd=phrase=00 -> bits 16..17 = 0
43+
;; result: $00000828
44+
move.l #DST,B_A1_BASE
45+
move.l #$00000828,B_A1_FLAGS
46+
move.l #0,B_A1_PIXEL
47+
move.l #SRC,B_A2_BASE
48+
move.l #$00000828,B_A2_FLAGS
49+
move.l #0,B_A2_PIXEL
50+
51+
move.l #$00010002,B_COUNT ; inner=2 px, outer=1
52+
move.l #$0001C000,B_COMMAND
53+
54+
;; Blitter is synchronous in this emulator; no wait needed.
55+
56+
.done:
57+
lea SRC.l,a0
58+
lea DST.l,a1
59+
moveq #1,d2
60+
moveq #1,d3
61+
.cmp: move.l (a0)+,d4
62+
move.l (a1)+,d5
63+
cmp.l d4,d5
64+
bne.s .bad
65+
addq.l #1,d3
66+
dbra d2,.cmp
67+
ACID_PASS
68+
69+
.bad: ACID_FAIL d3,d5,d4
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
;
2+
; tests/blitter/copy_pix8.s - 8-pixel 8bpp blitter copy round-trip.
3+
;
4+
; pixsize=3 (8bpp), one phrase = 8 pixels.
5+
;
6+
; Detail codes:
7+
; 1 = blitter never finished
8+
; N = first mismatched longword index (1-based, 1..2)
9+
;
10+
include "include/jaguar_header.s"
11+
include "include/acid_test.s"
12+
13+
B_BASE equ $F02200
14+
B_A1_BASE equ B_BASE + $00
15+
B_A1_FLAGS equ B_BASE + $04
16+
B_A1_PIXEL equ B_BASE + $0C
17+
B_A2_BASE equ B_BASE + $24
18+
B_A2_FLAGS equ B_BASE + $28
19+
B_A2_PIXEL equ B_BASE + $30
20+
B_COMMAND equ B_BASE + $38
21+
B_COUNT equ B_BASE + $3C
22+
23+
SRC equ $00080000
24+
DST equ $00090000
25+
SPIN_LIMIT equ 1000000
26+
27+
org $802000
28+
entry:
29+
ACID_INIT
30+
31+
lea SRC.l,a0
32+
move.l #$01020304,(a0)+
33+
move.l #$05060708,(a0)+
34+
35+
lea DST.l,a0
36+
clr.l (a0)+
37+
clr.l (a0)+
38+
39+
;; A?_FLAGS for 8bpp (pixsize=3) phrase mode:
40+
;; pixsize=3 -> bits 3..5 = 011 = $18
41+
;; e=3 (8 phrase pixels) -> bits 11..14 = $1800
42+
;; xadd=phrase=00 -> bits 16..17 = 0
43+
;; result: $00001818
44+
move.l #DST,B_A1_BASE
45+
move.l #$00001818,B_A1_FLAGS
46+
move.l #0,B_A1_PIXEL
47+
move.l #SRC,B_A2_BASE
48+
move.l #$00001818,B_A2_FLAGS
49+
move.l #0,B_A2_PIXEL
50+
51+
move.l #$00010008,B_COUNT ; inner=8 px, outer=1
52+
move.l #$0001C000,B_COMMAND
53+
54+
;; Blitter is synchronous in this emulator; no wait needed.
55+
56+
.done:
57+
;; Compare 2 longwords (8 bytes = 8 pixels at 8bpp).
58+
lea SRC.l,a0
59+
lea DST.l,a1
60+
moveq #1,d2
61+
moveq #1,d3
62+
.cmp: move.l (a0)+,d4
63+
move.l (a1)+,d5
64+
cmp.l d4,d5
65+
bne.s .bad
66+
addq.l #1,d3
67+
dbra d2,.cmp
68+
ACID_PASS
69+
70+
.bad: ACID_FAIL d3,d5,d4
Lines changed: 35 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,33 @@
11
;
2-
; copy_simple.s - first acid test: trivial blitter copy round-trip.
2+
; tests/blitter/copy_simple.s - 4-pixel 16bpp blitter copy round-trip.
33
;
4-
; What it does:
5-
; 1. Fill 8 longwords at $4000 with a known pattern (0xAABBCCDD,...).
6-
; 2. Program the blitter to copy 8 phrases ($4000 -> $5000) in
7-
; 16-bit pixel mode, no compositing, no Z-buffer, no gouraud.
8-
; 3. Wait for blitter to finish (poll BUSY in B_CMD).
9-
; 4. Verify each longword at $5000 matches the source.
10-
; 5. ACID_PASS or ACID_FAIL with the offset of the first mismatch.
11-
;
12-
; This is the simplest possible blitter exercise and should pass on
13-
; both fast and accurate blitter modes. If it FAILS, something
14-
; basic is broken.
4+
; Detail codes:
5+
; 1 = blitter never finished (BUSY stayed set)
6+
; N = first mismatched longword index (1-based)
157
;
168
include "include/jaguar_header.s"
179
include "include/acid_test.s"
1810

19-
;
20-
; Blitter register addresses (TOM, $F02200..)
21-
;
22-
A1_BASE equ $F02200
23-
A1_FLAGS equ $F02204
24-
A1_PIXEL equ $F02214
25-
A2_BASE equ $F02218
26-
A2_FLAGS equ $F0221C
27-
A2_PIXEL equ $F02228
28-
B_CMD equ $F02238
29-
B_COUNT equ $F0223C
30-
B_SRCD equ $F02240
31-
B_DSTD equ $F02248
32-
B_PATD equ $F02250
11+
;; Blitter register file lives at TOM_BASE + $2200.
12+
B_BASE equ $F02200
13+
B_A1_BASE equ B_BASE + $00
14+
B_A1_FLAGS equ B_BASE + $04
15+
B_A1_PIXEL equ B_BASE + $0C
16+
B_A2_BASE equ B_BASE + $24
17+
B_A2_FLAGS equ B_BASE + $28
18+
B_A2_PIXEL equ B_BASE + $30
19+
B_COMMAND equ B_BASE + $38
20+
B_COUNT equ B_BASE + $3C
21+
22+
SRC equ $00080000
23+
DST equ $00090000
24+
SPIN_LIMIT equ 1000000
3325

3426
org $802000
3527
entry:
3628
ACID_INIT
3729

38-
;; Fill source buffer at $4000 with 8 longwords.
39-
lea $4000.w,a0
30+
lea SRC.l,a0
4031
move.l #$AABBCCDD,(a0)+
4132
move.l #$11223344,(a0)+
4233
move.l #$DEADBEEF,(a0)+
@@ -46,62 +37,35 @@ entry:
4637
move.l #$F00DBEEF,(a0)+
4738
move.l #$DEADC0DE,(a0)+
4839

49-
;; Clear destination at $5000 so we can tell if the
50-
;; blitter actually wrote anything.
51-
lea $5000.w,a0
40+
lea DST.l,a0
5241
moveq #7,d0
5342
.zerodest: clr.l (a0)+
5443
dbra d0,.zerodest
5544

56-
;; Program the blitter.
57-
;; A1 (dest) = $5000, A2 (src) = $4000.
58-
;; FLAGS: 16bpp pixsize=4, phrase mode (xadd=phrase=00).
59-
;; Width: 1 phrase wide (m=0,e=2 -> 4 pixels), 1 line.
60-
;;
61-
;; A2_FLAGS / A1_FLAGS layout (16bpp + phrase):
62-
;; bit 11..14 e=0010 (=2)
63-
;; bit 9..10 m=00
64-
;; bit 6.. 8 zoffs=0
65-
;; bit 3.. 5 pixsize=4 (16bpp)
66-
;; bit 0.. 1 pitch=00 (1 phrase)
67-
;; bit 16..17 xadd=00 (phrase)
68-
;; = $00001020
69-
move.l #$5000,A1_BASE
70-
move.l #$00001020,A1_FLAGS
71-
move.l #0,A1_PIXEL
72-
move.l #$4000,A2_BASE
73-
move.l #$00001020,A2_FLAGS
74-
move.l #0,A2_PIXEL
45+
;; A?_FLAGS: pixsize=4(16bpp), xadd=phrase=00, e=2 (4-px phrase)
46+
move.l #DST,B_A1_BASE
47+
move.l #$00001020,B_A1_FLAGS
48+
move.l #0,B_A1_PIXEL
49+
move.l #SRC,B_A2_BASE
50+
move.l #$00001020,B_A2_FLAGS
51+
move.l #0,B_A2_PIXEL
7552

76-
;; Inner=4 pixels, outer=1 line: $00010004
7753
move.l #$00010004,B_COUNT
54+
move.l #$0001C000,B_COMMAND ; SRCEN | LFU=src
7855

79-
;; B_CMD: SRCEN=1, no others. $00000001 = SRCEN.
80-
;; LFU = "src" (pass through) needs ity bits (cmd>>14)&15
81-
;; = 0xC = "S" (just copy source) -> bit 14|15 = $C000.
82-
move.l #$0001C000,B_CMD
83-
84-
;; Spin until blitter completes.
85-
.wait_blit: move.l B_CMD,d0
86-
btst #0,d0 ; bit 0 = busy/start. Some
87-
bne.s .wait_blit ; emulators clear it on done.
56+
;; Blitter is synchronous in this emulator; no wait needed.
8857

89-
;; Compare 8 longwords src vs dest.
90-
lea $4000.w,a0
91-
lea $5000.w,a1
92-
moveq #7,d2 ; loop counter (0..7)
93-
moveq #0,d3 ; word index
58+
.blit_done:
59+
lea SRC.l,a0
60+
lea DST.l,a1
61+
moveq #7,d2
62+
moveq #1,d3
9463
.compare: move.l (a0)+,d4
9564
move.l (a1)+,d5
9665
cmp.l d4,d5
9766
bne.s .mismatch
9867
addq.l #1,d3
9968
dbra d2,.compare
100-
101-
;; All 8 longwords matched.
10269
ACID_PASS
10370

104-
.mismatch:
105-
;; d3 = first mismatched longword index, d5 = observed,
106-
;; d4 = expected.
107-
ACID_FAIL d3,d5,d4
71+
.mismatch: ACID_FAIL d3,d5,d4
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
;
2+
; tests/blitter/multiline_copy.s - copy 4 lines of 1 phrase each.
3+
;
4+
; Programs the blitter to do a 4-line × 1-phrase 16bpp copy with
5+
; A1/A2 pitch=0 (contiguous). Catches off-by-one in outer-loop
6+
; line counting.
7+
;
8+
; Detail codes:
9+
; 1 = blitter never finished
10+
; N = first mismatched longword (1-based, 1..8)
11+
;
12+
include "include/jaguar_header.s"
13+
include "include/acid_test.s"
14+
15+
B_BASE equ $F02200
16+
B_A1_BASE equ B_BASE + $00
17+
B_A1_FLAGS equ B_BASE + $04
18+
B_A1_PIXEL equ B_BASE + $0C
19+
B_A2_BASE equ B_BASE + $24
20+
B_A2_FLAGS equ B_BASE + $28
21+
B_A2_PIXEL equ B_BASE + $30
22+
B_COMMAND equ B_BASE + $38
23+
B_COUNT equ B_BASE + $3C
24+
25+
SRC equ $00080000
26+
DST equ $00090000
27+
SPIN_LIMIT equ 1000000
28+
29+
org $802000
30+
entry:
31+
ACID_INIT
32+
33+
;; 4 lines × 4 px @ 16bpp = 4 longs total per side.
34+
lea SRC.l,a0
35+
move.l #$AAAAAAAA,(a0)+
36+
move.l #$BBBBBBBB,(a0)+
37+
move.l #$CCCCCCCC,(a0)+
38+
move.l #$DDDDDDDD,(a0)+
39+
move.l #$11111111,(a0)+
40+
move.l #$22222222,(a0)+
41+
move.l #$33333333,(a0)+
42+
move.l #$44444444,(a0)+
43+
44+
lea DST.l,a0
45+
moveq #7,d0
46+
.zero: clr.l (a0)+
47+
dbra d0,.zero
48+
49+
move.l #DST,B_A1_BASE
50+
move.l #$00001020,B_A1_FLAGS
51+
move.l #0,B_A1_PIXEL
52+
move.l #SRC,B_A2_BASE
53+
move.l #$00001020,B_A2_FLAGS
54+
move.l #0,B_A2_PIXEL
55+
56+
move.l #$00040004,B_COUNT ; inner=4px, outer=4 lines
57+
move.l #$0001C000,B_COMMAND
58+
59+
;; Blitter is synchronous in this emulator; no wait needed.
60+
61+
.done:
62+
lea SRC.l,a0
63+
lea DST.l,a1
64+
moveq #7,d2
65+
moveq #1,d3
66+
.cmp: move.l (a0)+,d4
67+
move.l (a1)+,d5
68+
cmp.l d4,d5
69+
bne.s .bad
70+
addq.l #1,d3
71+
dbra d2,.cmp
72+
ACID_PASS
73+
74+
.bad: ACID_FAIL d3,d5,d4

0 commit comments

Comments
 (0)