Thomas Jentzsch, on Thu Jun 2, 2011 7:41 AM, said:
maiki, on Thu Jun 2, 2011 3:55 AM, said:
So what's the difference between using Stella and Harmony cartridge? I thought one could rely on Stella when testing stuff for the Harmony...
Some registers and ZP RAM might be different.
Usually that doesn't make any difference, since each game is supposed to initialize all those areas, because they are undefined by definition at start up. However, often they turn out to have a certain value at startup (usually 0), so if a programmers forgets to initialize them correctly, the code still might work 99%.
But since Harmony changes these areas for its menu and loading screen, there is a good chance that the bug becomes obvious.
This is true, however, this is not the reason for CoM's bug. The bug in this case is because preproduction Harmony carts will always read a 1 for bit 3 on TIA read registers that don't drive this bit. For example, a read to CXP0FB will usually return $02 when no collision is detected, but relying on a value of $02 is not a good idea because some hardware will not work this way as only bits 6 and 7 are actually connected to the TIA, and bits 0-5 could really contain anything. Preproduction Harmony carts will instead return $0A.
It's a common issue that most developers run into (usually it happens when a programmer forgets the # on an immediate load.) A while back I discussed the issue with Stella developer Stephen Anthony, and he added a command-line switch to drive some of these bits (which should highlight these bugs.) From Stella docs:
-tiadriven <1|0>
Set unused TIA pins to be randomly driven high or low on a read/peek. If disabled, use the last databus value for those pins instead.
Edited by batari, Thu Jun 2, 2011 1:25 PM.