stella-emu / stella

A multi-platform Atari 2600 Emulator
https://stella-emu.github.io
GNU General Public License v2.0
618 stars 112 forks source link

Activision Ice Hockey - Occasional 'dots' #83

Closed thrust26 closed 7 years ago

thrust26 commented 7 years ago

Occasional 'dot' appears on the left side of screen when puck is in the upper half of the rink; appears on the right side of the screen when puck is in the lower half of the rink. Imitates movement of puck momentary then disappears. http://atariage.com/forums/topic/259633-testing-the-new-stella-tia-core/page-3#entry3675034

Happens in Stellerator too.

DirtyHairy commented 7 years ago

That could be fixed by increasing the ENAMx delay from 1 to 3. Which reminds me that I don't have anything apart from guesswork on how long this shoud be in the first place :smirk: I'll write a test to find out, then I can hopefully close this.

DirtyHairy commented 7 years ago

Too bad, the test confirms that the delay is 1. So, I have to continue looking. What I know is that the 'dot' is a copy of the missiles that constitute the bat handle, so its movement is actually mimicking the bat handle. This might be related to NUSIZ during / before / after draw. I'll revisit this issue after I am done with NUSIZ-during-draw.

For reference, a have attached my two testcases (one for RESMx, one for RESBL). The source can be found in the 6502.ts repo. What the test shows are Missile 0 / Ball (orange) overlayed over Missile 1 / Missile 0 (white). The first line shows the plain sprites for reference. On the next lines, ENAM0 / ENABL is triggered at the same cycle the sprites were originally positioned, while each lines moves the sprites one pixel to the left via HMOVE. The color switch toggles between ENAM0 / ENABL initially being on and off.

After the reference line, there are three lines before the effect of ENAM0 / ENABL becomes visible. As there is a four pixel delay between the position where RESMx / RESBL was strobed and the first pixel, this means that there is a one pixel delay between ENAx and its effect. The test is repeated for all four possible sprite widths.

The test images look like this in all emulators that I tested and on my PAL TV:

ENAM0 / ENABL initially off: enabl_delay

ENAM0 / ENABL initially on: enabl_delay_1

DirtyHairy commented 7 years ago

After reproducing this issue in two-player mode (much easier to debug, should've thought about that earlier :smile:), it turns out that this was caused by RESMPx: it seems that decodes of the missile draw counter are ineffective while RESMP is active.