Page 2 of 3
Posted: Mon Jan 19, 2009 1:21 pm
by Dwedit
On the tests, instructions E8 and F8 fail in both VBA and Goomba Color. What is the correct behavior for those instructions?
Edit: This indeed is for the GB-Z80, not the Z80.
Posted: Mon Jan 19, 2009 1:59 pm
by blargg
E8 is RET if parity is even, F8 is RET if minus flag is set. Perhaps they're not setting the parity and minus flags properly.
Mods: please split this non-GB-Z80 CPU discussion off.
Posted: Mon Jan 19, 2009 2:31 pm
by Dwedit
bumping thread due to an edited post
Posted: Mon Jan 19, 2009 4:02 pm
by blargg
Oh, GB-Z80. Those are:
E8 ADD SP,+$00
F8 LD HL,SP+$00
Both of these set carry and half-carry based on the low byte of SP added to the UNSIGNED immediate byte. The Negative and Zero flags are always cleared. They also calculate SP + SIGNED immediate byte and put the result into SP or HL, respectively.
Posted: Mon Jan 19, 2009 5:10 pm
by Dwedit
Thanks, fixed those instructions in Goomba Color.
Now I just get "Failed 06" in the 01.custom test program.
Posted: Mon Jan 19, 2009 7:23 pm
by blargg
Looking at source/01.custom.a, I see that is for DAA. So you haven't yet implemented the DAA flag handling I outlined earlier?
Posted: Tue Jan 20, 2009 12:14 am
by Dwedit
Fixed DAA, got everything working except for Timing, which would be because the TIMER isn't emulated correctly.
Posted: Tue Jan 20, 2009 2:32 am
by mic_
The weird thing is that now that I've fixed the instruction timings according to pandocs, test 2 (the timing test) never finishes. It even stops generating timer overflows after a while.
If I just change the timing of "ADD HL,rp" to something other than 8 cycles the test will finish (but it obviously fails all those instructions).
Posted: Tue Jan 20, 2009 3:33 am
by mic_
For whatever reason, I had set the length of "SBC (HL)" to 2 bytes, so everything went bananas after that.. Now all that's left are a few subtests of tests 6, 7, 8 and 10 (I think my H-flag calculation for SBC might be incorrect, which is causing a few of those errors).
Posted: Thu Feb 05, 2009 9:10 am
by blargg
I've made a number of improvements to the CPU tests:
cpu_instrs.zip
instr_timing.zip
mem_timing.zip
- Split instruction timing from CPU behavior tests
- cpu_instrs now tests all instructions except STOP
- instr_timing now tests all instructions except HALT and STOP
- Added new memory access timing tests that test which cycle reads and writes occur (except stack and PC accesses)
- Improved documentation and added summary of how each test works
- Included source has been tested to assemble on its own with wla
- All ROMs also print output to the game link port, and will work even with no LCD support (rather than hanging)
Please note that while I've tested the underying code on the DMG and CGB, I can't test the exact ROMs included since my devcart doesn't have rewritable ROM. Internally I still copy the test code to internal RAM at $D000 before running it there, as my devcart does, so there's very little difference. Even so, having someone test these with a flash cartridge would be appreciated.
Thanks for trying and giving feedback on previous versions of these!
EDIT: fixed ROM header checksums so they work on hardware, and moved to file host that's working.
Posted: Thu Feb 05, 2009 9:16 am
by mic_
Even so, having someone test these with a flash cartridge would be appreciated.
I might be able to do that next week sometime, unless someone else comes through.
Posted: Sat Feb 07, 2009 4:52 am
by mic_
Here are my results (from a CGB):
cpu_instrs: Doesn't run
instr_timing: passes
mem_timing: Doesn't run
By "Doesn't run" I mean that the GAME BOY logo is displayed and the beep is played, then nothing happens. It just continues to show the GAME BOY logo. Maybe something went wrong when I programmed my flash cart, I dunno..
Posted: Sat Feb 07, 2009 9:32 am
by blargg
Thanks for testing; I found the problem to be an incorrect checksum in the header. I re-uploaded the fixed files (to a new host).
Posted: Sat Feb 07, 2009 12:11 pm
by mic_
They now pass all tests.
Posted: Sat Jun 12, 2010 8:08 pm
by mudlord
Any chance of a mirror download to these test ROMs?
all the links seem broken.
Thanks.