CPU Testing, Any Good Tips?

Discussion of programming and development for the original Game Boy and Game Boy Color.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Updated links (also updated earlier message):

cpu_instrs.zip
instr_timing.zip
mem_timing.zip

Thank koitsu for providing me reliable space here on parodius.
mudlord
Posts: 11
Joined: Sat Jun 12, 2010 8:05 pm
Contact:

Post by mudlord »

Brilliant!

Thanks for these!
beannaich
Posts: 207
Joined: Wed Mar 31, 2010 12:40 pm

Post by beannaich »

Again, sorry for the necro, but this board seems to be a graveyard.

During the instruction timing test, I receive an error:

"Failed #255"

I'd really appreciate some clarity on this error (The previous test passes 11/11 also)
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

Try looking through the source code for that test.
beannaich
Posts: 207
Joined: Wed Mar 31, 2010 12:40 pm

Post by beannaich »

MottZilla wrote:Try looking through the source code for that test.
Turned out the Timer sync wasn't working properly because I wasn't adding cycles for taken CALL, RET, and JR instructions. But now the test is saying that I'm using extremely large timing values (on the order of 255) instead of the expected times. So, as with all emu dev: fix one thing, break another.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

The problem with these tests is if certain things are wrong the test is unreliable anyway. It may be better to test with game software.
beannaich
Posts: 207
Joined: Wed Mar 31, 2010 12:40 pm

Post by beannaich »

It took some doing but I finally figured out the problem, I wasn't handling the cases where more cycles are added to my TIMA frequency timer than were being remove (262,144 hz frequency was doing this, and also happens to be the speed used by the tests). So it all boiled down to changing an if statement to a while statement.

:(
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

Did you figure out it was the timer by looking through the test's source? Just curious.
beannaich
Posts: 207
Joined: Wed Mar 31, 2010 12:40 pm

Post by beannaich »

I noticed that 262,144hz was pretty fast and checked my timers during runtime, and sure enough there were many unspent cycles.

The source was pretty hard to follow, but I'm not complaining, at least the tests exist :)
Post Reply