Jump to content
IGNORED

Testing the new Stella TIA core


stephena

Recommended Posts

OK, some of you may have noticed in the 'Stella 4.7.3 released' thread that a new TIA core is being developed for Stella, ported from the 6502ts project. I'm happy to say that this will soon be in a state ready for preliminary testing. I hope to have a some test builds ready on Monday or Tuesday, but I just wanted to let everyone interested know that it's coming. Throughout this thread, I will update what's been added to each build, and hopefully be able to incorporate/fix some of the issues that you will find. What we'll be looking for is a somewhat detailed report on the following:

  • regressions against the old Stella core (ie, something worked in Stella before, and is now broken in the new core)
  • regressions/deviations from real hardware (ie, something is broken in the new core, and didn't work in Stella either)
  • improvements in the new core (ie, something that was broken in Stella before, but is now working in the new core)

It's very important that we know the status in terms of one of the 3 items above, so we can narrow down how to fix a bug, and/or note where the new code actually works correctly.

 

 

EDIT:

 

The third test release is now available at https://github.com/DirtyHairy/stella/releases. Please read the issues and readme, and report bugs accordingly :)

  • Like 9
Link to comment
Share on other sites

I am looking forward to test feedback :) I am currently tracking all emulation glitches and missing features in the issue tracker of my fork on github (https://github.com/DirtyHairy/stella). You can check out the tracker to get an overview of what should be working and what is know to be broken, and you're welcome to open new issues for any glitches you find. It also would be helpful if you could crosscheck emulation issues against 6502.ts (https://6502ts.github.io/stellerator) in order to check whether the issue was introduced in the process of porting the core to Stella.

 

As for the current state of the implementation: the initial port of the 6502.ts core is complete, and we are now working on reenabling the remaining, Stella-specific features, including the debugger. This work is mostly done by Stephen; I will now start digging deeper into the remaining emulation issues and try to iron them out; first in 6502.ts and subsequently porting fixes to Stella.

  • Like 1
Link to comment
Share on other sites

Hi - great news about the TIA core upgrade ;-)

 

I hope it's ok to pre-emptively raise an issue here that I think I've at least tried to raise with the old core before....It's difficult to tell if it will be fixed by the new core as the roms I have to hand to demonstrate the issue have other problems in 6502.ts....It's an issue with RESMP0 (/RESMP1) it's been ages since I looked at it but I suspect it relates to the the interpretation of the following passage in the Stella Programmers Guide:

 

 

RESMP0 (RESMP1)
These addresses are used to reset the hoiz. location of a missile to the center of it’s
corresponding player. As long as this control bit is true (1) the missile will remain
locked to the center of it’s player and the missile graphics will be disabled.

 

I have a feeling that the issue is the TIA core in Stella interprets "center of it’s corresponding player" literally where it should probably be "4 pixels to the right of it's corresponding player", so that the location doesn't move for a double sized player etc... but it does in Stella - see http://atariage.com/forums/topic/223257-arkanoid-2600/page-3?do=findComment&comment=2985254for example binary.

Link to comment
Share on other sites

Hi eshu!

 

I just checked the rom you linked --- "other problems" is a nice description, that's the most psychedelic bug I've seen so far :) . It does work mostly fine on the new 6502.ts TIA core in stella, though, but the paddle is glitched, and it very much looks like what you describe. The current description in the new core is just that: the position is adjusted to the center of the player (I couldn't find any definitive reference, and I currently lack real hardware to compare to). Thanks for the pointer, I'll change that to match real hardware once I get the 2600 I ordered from ebay last week.

 

As a sidenote: do you have an idea what's going wrong in 6502.ts? It's not the TIA, so that leaves timers, CPU timing and bank switching. I'd definitely like to find out what causes the issue and fix it.

Edited by DirtyHairy
  • Like 1
Link to comment
Share on other sites

As a sidenote: do you have an idea what's going wrong in 6502.ts? It's not the TIA, so that leaves timers, CPU timing and bank switching. I'd definitely like to find out what causes the issue and fix it.

 

Hi DirtyHarry :)

 

My first guess would be timers - It's using TIM64T and INTIM to judge when to leave a kernel (as well as other stuff) that it looks like it's getting stuck in........I suspect the bug is made to look worse than it really is as things go a bit mad if it doesn't leave that kernel when it's meant to..........

 

Edit:

 

In case it helps - I think (and it's pretty much pure guesswork) that the problem is probably occuring at:

 

F10C: LDY INTIM

F10F: CPY ram_C0

F111: BEQ LF100

 

(all in Bank 0)

 

if INTIM is off, even by one, it will carry on this part of the kernel and bad things will happen.....

Edited by eshu
Link to comment
Share on other sites

As a sidenote: do you have an idea what's going wrong in 6502.ts? It's not the TIA, so that leaves timers, CPU timing and bank switching. I'd definitely like to find out what causes the issue and fix it.

 

I also suspect the timers. Stella has had quite a bit of work over the years wrt timer behaviour, and fixes to make it work like real hardware (moreso than any other 2600 emulator). There are many test ROMs floating around; I'll see if I can track some down.

Link to comment
Share on other sites

Not really sure if this should be in the 6502.ts thread or this one, but it's TIA stuff so I hope it's ok here....

 

I thought I'd try some of the 32 character routines on 6502.ts - these are the ones that expose the issue with extra copies when using multiple RESP0/RESP1 on stella - it looks like the TIA core in 6502.ts gets that bit right - but it seems slightly off with the first copy of P0 (which is actually the second copy to the TIA as the first isn't drawn) on one of the RESP hits. DirtyHarry - a bunch of relevant binaries and pictures of the behaviour on real hardware can be found starting here: http://atariage.com/forums/topic/180632-32-character-text-display/page-2?do=findComment&comment=2280849

Link to comment
Share on other sites

In case it helps - I think (and it's pretty much pure guesswork) that the problem is probably occuring at:

 

F10C: LDY INTIM

F10F: CPY ram_C0

F111: BEQ LF100

 

(all in Bank 0)

 

if INTIM is off, even by one, it will carry on this part of the kernel and bad things will happen.....

You're right. I just checked and compared to stella, and during each spin of the loop, the timer picks up a delta of 1. I still have to investigate what exactly goes wrong, but that's the issue :thumbsup:

 

I also suspect the timers. Stella has had quite a bit of work over the years wrt timer behaviour, and fixes to make it work like real hardware (moreso than any other 2600 emulator). There are many test ROMs floating around; I'll see if I can track some down.

Thanks alot, that'd be great.

Not really sure if this should be in the 6502.ts thread or this one, but it's TIA stuff so I hope it's ok here....

 

I thought I'd try some of the 32 character routines on 6502.ts - these are the ones that expose the issue with extra copies when using multiple RESP0/RESP1 on stella - it looks like the TIA core in 6502.ts gets that bit right - but it seems slightly off with the first copy of P0 (which is actually the second copy to the TIA as the first isn't drawn) on one of the RESP hits. DirtyHarry - a bunch of relevant binaries and pictures of the behaviour on real hardware can be found starting here: http://atariage.com/forums/topic/180632-32-character-text-display/page-2?do=findComment&comment=2280849

This thread is fine for me, thanks alot for reporting :P The reason for this is the glitching of the draw decode logic if repositioning happens while the decode is in progress --- this is mentioned in the "Re-triggering..." section of Andrew Towers' notes. Now that I have a testcase, I have done a first stab at implementing this corner case, and the 32 chars example looks fine to me now --- could you recheck?

 

However, I am pretty sure that I still haven't got it completely right ;) In particular:

  • The notes suggest that triggering at a specific clock may completely gobble the decode. Do you know which one? My last change just resets the decode logic.
  • Do you know whether the missiles behave similarly?
Edited by DirtyHairy
  • Like 1
Link to comment
Share on other sites

As to the timer issue, the attached ROM works correctly in the old core in Stella, as well as the 6502ts one. But when loaded in Stellerator, Donkey Kong is split in half and spread across the screen. I remember that exact issue in an older version of Stella, and improving the M6532 emulation is what fixed it. Now I don't remember the exact fix (I guess we could go through the svn commit logs), but at least it's somewhere to start.

 

dk_sprite_demo.bin

Link to comment
Share on other sites

Wow - quick work!

 

Yep - the 32 char demos etc.. all look right to me now :grin:

 

However, I am pretty sure that I still haven't got it completely right ;) In particular:

  • The notes suggest that triggering at a specific clock may completely gobble the decode. Do you know which one? My last change just resets the decode logic.
  • Do you know whether the missiles behave similarly?

 

 

I'm afraid I really don't know either of these - some of the more hardware oriented members might have a better idea from the schematics.....

Link to comment
Share on other sites

Hi Thomas!

 

Thanks for the testcase ;) As for Tominv5.bin: I am aware of the glitch, but this will have to wait until I have improved debugging in 6502.ts (I am currently lacking conditional breakpoints a way to break in machine events like register writes). As for Three.s: how exactly do the timer glitches manifest?

Link to comment
Share on other sites

Hi again :)

 

Ok - I think this one is a regression from the old core, but I've never run the binary on a real machine - someone might be able to now with a harmony encore? it's an EFSC rom, the menu pointer is made up of a missle, and is supposed to be two pixels wide, I think NUSIZ1 should get changed just in time.....on old Stella it shows up 2 pixels wide, but just 1 on the test release.

 

The relevant code is run out of zero page, it should be executed from about scanline 179

 

"scanline b1" in the Stella debugger will get you there, then it's the STX NUSIZ1 run from A6

 

 

 

 

 

long005.bin

Edited by eshu
Link to comment
Share on other sites

As for Three.s: how exactly do the timer glitches manifest?

If you run it in Stellarator start a new game. You can see extra pixel on empty spaces and dots, also some pixel are missing (e.g. the bottom of top dot on two dot tiles).

 

I am pretty sure this is coming from slightly wrong INTIM values, because that's used as kernel index.

 

Note: This only happens in Stellarator, but not in Stella using the new core.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

Hi eshu!

 

Hi again :)

 

Ok - I think this one is a regression from the old core, but I've never run the binary on a real machine - someone might be able to now with a harmony encore? it's an EFSC rom, the menu pointer is made up of a missle, and is supposed to be two pixels wide, I think NUSIZ1 should get changed just in time.....on old Stella it shows up 2 pixels wide, but just 1 on the test release.

 

The relevant code is run out of zero page, it should be executed from about scanline 179

 

"scanline b1" in the Stella debugger will get you there, then it's the STX NUSIZ1 run from A6

 

Thanks, I have created an issue on github. Coincidentially, my 2600 Jr. arrived yesterday, and my harmony encore should be arriving soon :P Also, that's a good upportunity to EF[sC] to 6502.ts. Are you perchance hitting NUSIZ just when the first pixel is being rendered?

Link to comment
Share on other sites

Hi Thomas!

 

If you run it in Stellarator start a new game. You can see extra pixel on empty spaces and dots, also some pixel are missing (e.g. the bottom of top dot on two dot tiles).

 

I am pretty sure this is coming from slightly wrong INTIM values, because that's used as kernel index.

 

Note: This only happens in Stellarator, but not in Stella using the new core.

 

Ah, now I see, thank you.

 

 

I have added a few issues to the issue tracker. I hope they make sense and are not redundant.

 

Thanks alot for reporting --- they do make sense indeed ;)

Edited by DirtyHairy
Link to comment
Share on other sites

I have a feeling that the issue is the TIA core in Stella interprets "center of it’s corresponding player" literally where it should probably be "4 pixels to the right of it's corresponding player", so that the location doesn't move for a double sized player etc... but it does in Stella - see http://atariage.com/forums/topic/223257-arkanoid-2600/page-3?do=findComment&comment=2985254for example binary.

 

I have adjusted RESMP for 16 and 32 pixel players. paranoid_0.01_real.bin now looks like the Stella version on the old core to me. What do you think? You can find a screenshot here https://github.com/DirtyHairy/stella/issues/23 (if you can build from source, then you can also check the real thing).

Edited by DirtyHairy
  • Like 1
Link to comment
Share on other sites

 

I have adjusted RESMP for 16 and 32 pixel players. paranoid_0.01_real.bin now looks like the Stella version on the old core to me. What do you think? You can find a screenshot here https://github.com/DirtyHairy/stella/issues/23 (if you can build from source, then you can also check the real thing).

 

Nice - the screenshot looks perfect - if I get some time and am feeling brave I might try to build from source :)

Link to comment
Share on other sites

Hi again icon_smile.gif

 

Ok - I think this one is a regression from the old core, but I've never run the binary on a real machine - someone might be able to now with a harmony encore? it's an EFSC rom, the menu pointer is made up of a missle, and is supposed to be two pixels wide, I think NUSIZ1 should get changed just in time.....on old Stella it shows up 2 pixels wide, but just 1 on the test release.

 

The relevant code is run out of zero page, it should be executed from about scanline 179

 

"scanline b1" in the Stella debugger will get you there, then it's the STX NUSIZ1 run from A6

Can you provide an example which runs on Harmony?
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...