Williams Emulation Test Suite - old source
This is the older source for the Williams Emulation Test suite. See herefor the latest.
Eventually I will use automated external timing for accuracy, and I will average many passes on the 3 boardsets that I have. I'd also like to see how much temperature affects timing. For now, I timed the tests manually; the variation from test to test is under 1/2%, so that's good enough for initial observations. My current code makes 6 passes of 65,535 loops:
Test 1 from 0xF000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x02 74s
Test 2 from 0x0000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x06 141s
Test 3 from 0x0000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x07 141s
Test 4 from 0xd000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x02 74s
Test 5 from 0xd000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x03 74s
Test 6 from 0xF000 to 0x3c99, w/h 0x2424, mask 0x11, mode 0x02 74s
MAME 0145 (64-bit) timed out at 74s for all 6 tests, so it does not take into account mode bit 2, but it is otherwise quite good.
Version 0.1 6809 test suite, 6 blitter timing tests.
Version 0.2 Added 5 more blitter timing tests. I got the width, height, mask and mode bytes from a MAME log playing Robotron, so they should be representative of typical blits. I timed all tests on 2 different actual boardsets, and the longer blits were all within 0.4% of each other.
Test 7 from 0xF000 to 0x3c99, w/h 0x0702, mask 0x99, mode 0x1a 8s
Test 8 from 0xF000 to 0x3c99, w/h 0x0109, mask 0x00, mode 0x0a 11s
Test 9 from 0xF000 to 0x3c99, w/h 0x0c0b, mask 0x00, mode 0x2a 15s
Test 10 from 0x0000 to 0x3c99, w/h 0x0509, mask 0x00, mode 0x56 8s
Test 11 from 0x0000 to 0x3c99, w/h 0x0508, mask 0x46, mode 0x46 8s
MAME timed out at 8s, 11s, 15s, 7s and 8s. I need to increase the maximum number of blits from 0xFFFF since the smaller blits complete so quickly. The comparisons aren't as good since my reaction time is a larger percent of the shorter blit time, and the setup for each blit is a larger percent of the total time.
Version 0.3 Normalized # of blitter loops to make each pass last about a minute. Moved variables in memory.
Test 1 from 0xF000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x02 60.0s actual, 60.0s in MAME
Test 2 from 0x0000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x06 60.0s actual, 33.1s in MAME
Test 3 from 0x0000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x07 60.0s actual, 39.3s in MAME
Test 4 from 0xd000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x02 60.0s actual, 60.0s in MAME
Test 5 from 0xd000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x03 60.0s actual, 59.9s in MAME
Test 6 from 0xF000 to 0x3c99, w/h 0x2424, mask 0x11, mode 0x02 60.0s actual, 60.0s in MAME
Test 7 from 0xF000 to 0x3c99, w/h 0x0702, mask 0x99, mode 0x1a 52.3s actual, 52.7s in MAME
Test 8 from 0xF000 to 0x3c99, w/h 0x0109, mask 0x00, mode 0x0a 57.6s actual, 58.0s in MAME
Test 9 from 0xF000 to 0x3c99, w/h 0x0c0b, mask 0x00, mode 0x2a 56.9s actual, 59.1s in MAME
Test 10 from 0x0000 to 0x3c99, w/h 0x0509, mask 0x00, mode 0x56 54.7s actual, 48.9s in MAME
Test 11 from 0x0000 to 0x3c99, w/h 0x0508, mask 0x46, mode 0x46 53.1s actual, 48.7s in MAME
Version 0.4 Changed a few blitter loops, added instruction timing, added blit validation;
does various blits, CRCs RAM to validate. Expanded to 12K: 0xD000-0xFFFF.
Blit 1 from 0xF000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x02 60.2s actual, 60.2s in MAME
Blit 2 from 0x0000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x06 60.4s actual, 32.0s in MAME
Blit 3 from 0x0000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x07 60.4s actual, 32.0s in MAME
Blit 4 from 0xd000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x02 60.2s actual, 60.2s in MAME
Blit 5 from 0xd000 to 0x3c99, w/h 0x2424, mask 0xff, mode 0x03 60.2s actual, 59.2s in MAME
Blit 6 from 0xF000 to 0x3c99, w/h 0x2424, mask 0x11, mode 0x02 60.2s actual, 60.2s in MAME
Blit 7 from 0xF000 to 0x3c99, w/h 0x0702, mask 0x99, mode 0x1a 60.2s actual, 60.2s in MAME
Blit 8 from 0xF000 to 0x3c99, w/h 0x0109, mask 0x00, mode 0x0a 60.2s actual, 60.2s in MAME
Blit 9 from 0xF000 to 0x3c99, w/h 0x0c0b, mask 0x00, mode 0x2a 60.2s actual, 60.2s in MAME
Blit 10 from 0x0000 to 0x3c99, w/h 0x0509, mask 0x00, mode 0x56 60.2s actual, 54.5s in MAME
Blit 11 from 0x0000 to 0x3c99, w/h 0x0508, mask 0x46, mode 0x46 60.2s actual, 54.5s in MAME
Inst 1 NOP 59.8s actual, 59.9s in MAME
Inst 2 CLRA 59.8s actual, 59.9s in MAME
Inst 3 COMA 59.8s actual, 59.9s in MAME
Inst 4 DAA 59.8s actual, 59.9s in MAME
Inst 5 STA 59.8s actual, 59.9s in MAME
Version 0.5 A little cleanup.
Here are dumps of RAM (0000-BFF7) from an actual boardset after each blit validation pass. Note that the CRCs in the program are bit inverted and byte reversed as compared to CRC-32.
blit validation pass 1
blit validation pass 2
blit validation pass 3
Update- Aaron Giles added a small patch to MAME0145u2 that doubles the timing correction when mode bit 2 is set. With this change, the timing just about perfectly matches my real machine. There still appears to be some timing issue that needs to be found and corrected to make game play more comparable to a real game, though.
Update 2- I wrote a small program to read the 6-bit vertical position register repeatedly and store the results in memory. I compared what I got on my actual boardset to what MAME produced, and noticed a difference. It turns out that MAME specifies 260 scan lines for the Williams games, but the read handler for the vertical position register is only 8 bits. So when the count gets to 256, the register returns 0x00. On my actual game, the register returns 0xFC for lines 256-259, before rolling over to 0x00. This difference would cause any code that waits for the top of the screen to return early.
back to Williams Info page
back to Arcade Game Info page
back to Home page