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

River Raid and Frostbite have 'jumps' in objects #18

Closed sa666666 closed 7 years ago

sa666666 commented 7 years ago

I'm grouping these both together, since they both seem to be the same issue (and if I had to guess, related to player1).

In River Raid, after you play through to the first bridge and pass to the second screen, occasionally the 'house' on the left of the screen will jump horizontally.

In Frostbite, occasionally the ice-pans will jump in a similar fashion. When using debug colours, it is P1 in both cases.

Note that these also occur in 6502.ts.

DirtyHairy commented 7 years ago

I think that this is the same issue as #2 and maybe even #1. In a nutshell, the emulation of res[pmb] is not correct on a 'microscopic' level. The net effect on the counters is OK, but the emulation of the clocking delays seems to be incorrect, and this shows in edge cases where the positioning registers are strobed during hblank and hmove (this is why the effects are only visible when objects are close to the left edge of the screen).

I have tried to nail the problem, and driving the delays with different clocks (color clock vs. movement clock, etc.) fixes some of the issues, but I have yet to find and understand the magic forumula that fixes everything and doesn't introduce any new issues. In particular, I still have problems interpreting Andrew Towers' notes on this, and what they describe doesn't seem to match how things are done in either the new or the old core.

This will have to wait until I have access to real hardware, an improved 6502.ts debugger (conditional breakpoints and machine events) and the time to dig in sufficiently deep --- I guess I am talking about new year holidays :smirk:.

This is also connected to #6 and #16 .

sa666666 commented 7 years ago

Would the debugger in Stella be useful (it has conditional breakpoints, etc)?

Also, do we still go ahead with the test releases now, or wait until after you've had time to research this further? If you want to do the test releases now, just create a tag as you've mentioned in a previous email, and I'll be ready to create builds for it.

DirtyHairy commented 7 years ago

If we get the debugger in Stella going, that'd definitely help, too. However, I find the Chrome devtools easier than gdb to work with when debugging the emulator, so I will try to get the 6502.ts debugger sufficiently powerful.

From my end, I don't see any issues with starting test releases now. We need to get this (and other things) fixed before switching to the new core by default, but I think the glitch is very minor, and I would very much like to find other, more straightforward to fix issues like #17 In addition, someone of the TIA experts on Atariage might be able to provide a clue during testing :smirk: I'll create tag and release draft later today.

I didn't want my comment above to sound too desparate, the issue is definitely fixable, but it needs time and systematic research, and the side effects of an improper fix are likely to be worse than the glitch itself :smirk:

DirtyHairy commented 7 years ago

Closed for now by 839ba71 . It seems that positioning is yet of by during another clock if it happens during an extended hblank. It would be highly desirable to understand better what's happening here, though.