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

CallNow demo #64

Closed sa666666 closed 7 years ago

sa666666 commented 7 years ago

callnow.zip

In the old core, the image is stable. In the new core, Only the top 1/3 of the image is drawn, just when it gets to the first scanline of text. I suspect this is related to either 'short' frames or 'large' frames (see the old core code for info), and needs to be implemented in FrameManager. I cannot test in 6502.ts, since the cart type isn't supported yet.

DirtyHairy commented 7 years ago

That one is very interesting. What happens is that this starts writing 0x31 to VSYNC on each scanline right after it starts displaying text, and consequently, the frame is terminated too early. This should fail on real hardware, too --- and indeed, I get a rolling image on our LCD.

The interesting bit is the relevant assembly. This is the disassembly fro 6502.ts:

    $1FD8:   PLA
    $1FD9:   PHA

When this piece executes, we have S = 0xFF and memory at 0xFF is 0x31. So, what happens is that PLA reads A from 0x00 (!!) and ends up with 0x31 from the previous read to 0xFF. This is then written to 0x00, causing the effect I described above. As this is highly dependent on the behavior of the databus during PLA, the demo may actually work on less precise emulators. Actually, it works in 6502.ts (I have fixed sub-2k cartridges) because the details of PLA are flawed --- I have to fix the access patterns :smirk:

Did anyone ever see this working on real hardware on a CRT?

sa666666 commented 7 years ago

Confirmed, this doesn't work for me on real hardware either; the screen is constantly rolling. So I guess this one can be closed.

Note that it would be nice at some point to emulate the screen rolling somehow. This may happen when we get the 'jitter' effect working.

DirtyHairy commented 7 years ago

I have not yet looked into jitter, but the rolling should be straightforward to implement by adding scanline limits after which FrameManager will forcefully switch states.