LX.NET, on Sat Nov 26, 2011 2:41 PM, said:
Thanks ThomH, this is really helpful. I will have a look at this particular bug mid December (bogged down with preparing for presentations before that time).
I guess I lied and took a short look the same evening.
ThomH, on Sun Nov 27, 2011 6:25 AM, said:
Further on this, the BLL bug that is nullified by the Lynx hardware bug that Handy doesn't reproduce is recorded on line 330 of BLL's fpolygon.inc:
.triimage dc.b 2,$11,0
Funny, I was debugging and tried the exact same thing. It did render the polygons correctly after that.
ThomH, on Sun Nov 27, 2011 6:25 AM, said:
That's unpacked data, so if the Lynx hardware were perfect it'd be two pixels and Handy renders it as such. On the real hardware it's only one pixel. Switching the $11 constant to $10 fixes that code in Handy.
I guess that, based on the description in the hardware guide that the problem is just the final bit, switching the $11 to $22 should produce double-width scan lines on both Handy and a real Lynx. I don't currently have any tools set up and things are a bit complicated because I'm about to emigrate but I do have one of Lynxman's flash carts, so if you're unable to test that and think it would be helpful then I can probably do that but not necessarily very soon.
I'm not sure what it is exactly. My guess is that if the last pixel ends exactly at the end of the last bit in the bit shifter, it will not output the bit. In my code I have patch this bug (or rather enabled this hardware bug) with this line:
[color=blue]if[/color] (register.BitsLeft == 0) [color=blue]yield[/color] [color=blue]break[/color];
As it turned out, the too-correct emulation was also causing the Joust lava bug. Pictures of the Wuerfel demo and the Joust screen with fixed code included in next post.
ThomH, on Sun Nov 27, 2011 6:25 AM, said:
I obviously don't know much the structure of your project but if there's any sort of global notion of time and you can do processing on each port read, couldn't you just check the time on read and see if it's been sufficiently much time that the result should be ready?
My general notion of time is (just like in Handy) the cycle count of the 65SC02 cpu. So, another way of implementing the non-instantaneous math behavior would be to set up some flag for the cycle count at the end of the math calculation and then flip the MathInProgress bit back off.
ThomH, on Sun Nov 27, 2011 6:25 AM, said:
Not offhand but I've surprised myself by being able to remember my diagnosis (which I highly recommend you treat critically by the way, memory being what it is) of the double-width scan line bug at least nine years after the fact so I'll have a poke around.
Keep them coming. Everything was perfectly true so far. Thanks again.
Next will be the fixing of the Handy source code, which might be at the initial time mentioned earlier. Shouldn't be too hard. After that, we will need to do some regression testing to find out whether the fix did not break things.