Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevKit: SPRPTR16 not working correctly #311

Open
steph72 opened this issue Nov 29, 2020 · 5 comments
Open

DevKit: SPRPTR16 not working correctly #311

steph72 opened this issue Nov 29, 2020 · 5 comments
Labels
bug Confirmed bug. cleanup-fixed Issue Cleanup - possibly already fixed issue

Comments

@steph72
Copy link

steph72 commented Nov 29, 2020

In yaped32 (my 32 colour petscii editor) I use SPRPTR16 to put sprites in the $00fxxx memory range. This worked fine on my R2 prototype M65. When I got my DevKit I noticed that sprites are no longer displayed correctly.

I wrote a little test program (attached to this issue) to demonstrate the problem.

On the M65 prototype, the (correct) output looks like this:
P1190150

whereas on the DevKit, only one line of the sprite is displayed:
P1190149

Here is the BASIC 10 test program to reproduce the issue:
spritetest.zip

@gardners
Copy link
Contributor

There is indeed something weird going on here.
The first row of the sprites comes from $F000, as expected.
But the subsequent rows are coming from $C000.
So the fetch address is getting borked somewhere.

The issue is an in-progress fix for latching sprite data source area, like VIC-II does, or continuously monitoring the sprite pointer to allow different sprite data to be selected every row, like we previously implemented on the VIC-IV, but which is not actually correct.

To select the correct VIC-II behaviour, which also works around this bug: Clear bit 3 of $D07A.

But I still need to find out the root cause and fix it.

@gardners
Copy link
Contributor

Probably needs simulation and grinding through the VHDL log messages to see where the sprite fetches all happen from.

What we know is that at the start of the sprite, when sprite data offset = 0, that it is right. But then for subsequent rows, its like the sprite pointer has $0000 in it, instead of the correct value.

More investigation: For subsequent rows it has rubbish in there, because it seems that the sprite_data_addresses() array doesn't get updated sometimes for some reason.

As said, this all needs more debugging.

@steph72
Copy link
Author

steph72 commented Nov 30, 2020

I tried the workaround with clearing bit 3 in $d07a. The good news: Sprites are being displayed now; the bad news: The first line is corrupted. The strange thing is that the corruption changes with the position of the sprite... I've attached a little clip, maybe it helps you narrow down the overall problem...

https://streamable.com/5dtndy

(yaped32 has two cursors as sprites: one is the mouse pointer and the other is the current character position)

@gardners
Copy link
Contributor

I think I have found the cause of this problem now. Will hopefully synthesise a fix for it soon.

@lydon42 lydon42 added bug Confirmed bug. cleanup-fixed Issue Cleanup - possibly already fixed issue labels Jan 7, 2022
@lydon42
Copy link
Member

lydon42 commented Jan 7, 2022

Can't reproduce this on r3a board and pre release development / rom.

@steph72 could you please recheck and close this issue if it is resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug. cleanup-fixed Issue Cleanup - possibly already fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants