-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Majic 12 - Ray of hope 2 of hope glitches #799
Comments
Very cool. Thanks for reporting! I've set up a new test case exploiting the undocumented ECS feature (more precisely: the ECS Denise feature. The Agnus type doesn't matter, because Agnus only handles the vertical DIW). A500 (OCS Denise): A500+ (ECS Denise): The difference in both images results from this code fragment which will trigger the DIW stop logic on machines with a SuperDenise or Lisa chip:
|
Just did a little code review. Before this bug can be properly fixed, the following function needs to be made timing-sensitive (like void
Denise::setDIWHIGH(u16 value)
{
trace(DIW_DEBUG, "setDIWHIGH(%x)\n", value);
if (!isECS()) return;
// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
// -- -- H8 -- -- -- -- -- -- -- H8 -- -- -- -- --
// (stop) (strt)
diwhigh = value;
hstrt = LO_BYTE(diwstrt) | (GET_BIT(diwhigh, 5) ? 0x100 : 0x000);
hstop = LO_BYTE(diwstop) | (GET_BIT(diwhigh, 13) ? 0x100 : 0x000);
if (hstrt > 0x1C7) hstrt = INT16_MAX;
if (hstop > 0x1C7) hstop = INT16_MAX;
// Inform the debugger about the changed display window
debugger.updateDiwH(hstrt, hstop);
} TODO:
|
One issue of After fixing this, things got worse from the outside because the demos's splash screens are now gone. To get the DIW logic 100% correct, it should probably be handled event-driven (via the event scheduler). I need to consider whether it's worth doing, as it would slow down emulation a bit. |
Summing up:
|
Without knowing anything about what is going on in the demo (but knowing Amiga in general) my guess would be that it's a "stray" sprite showing up for whatever reason. |
Yes, indeed! After disabling sprite drawing with the following hack, it looks perfect. template <Resolution R> void
Denise::drawSprites()
{
// REMOVE ASAP
wasArmed = false; |
Cool. Thanks for confirming :) So it might be that the sprite DMA has been left on by accident then and when horizontal scrolling a screen on Amiga (at least on OCS) the last sprite (and half of the second last) can't be used because the extra DMA needing for the offscreen fetching. So it might be that sprite data that shows up for some reason. If that isn't the case it might be that the sprite that shows up ends up pointing on stale data somewhere and depending on how the memory is initialized it may end up showing some data or not showing it. |
More findings: Culprit is indeed sprite 7. With an additional trace statement in here... template <isize nr> void
Agnus::executeFirstSpriteCycle()
{
if (pos.v == sprVStop[nr]) {
sprDmaState[nr] = SPR_DMA_IDLE;
if (busOwner[pos.h] == BUS_NONE) {
// Read in the next control word (POS part)
if (sprdma()) {
auto value = doSpriteDmaRead<nr>();
trace(true, "executeFirstSpriteCycle %ld %u\n", nr, value);
agnus.pokeSPRxPOS<nr>(value);
denise.pokeSPRxPOS<nr>(value);
} else {
busOwner[pos.h] = BUS_BLOCKED;
}
} ... the following output is produced:
Bogus values are written into |
I can't remember what actually happens on the original hardware in this case. It might be that fetched bitplane graphics ends up as a sprite. |
You don't happen to have a Action replay for you Amiga? That way you could investigate the value of the data on the original hw. |
If DMA isn't enabled for sprite 7 then the pointer value won't increase. In WinUAE I can see SPR7PT stays $33004. |
Blocking sprite DMA slots w.r.t. BPRUN fixes the issue. Stray sprites are gone. |
Yeah, I'm not sure how the logic works, but yes Agnus blocks sprite fetches if bitplanes need them (or is supposed to). Apparently there's an OCS bug related to that though: "- sprite DMA vs bitplane DMA off-by-one fix. Second sprite control was stolen by bitplane DMA even if slot was free but next slot was used by bitplane. (ECS Agnus)" (example: https://eab.abime.net/showthread.php?t=75094) |
Pouet link, Direct download.
Noticed this one was mentioned in response to a recent update in the EAB Undocumented Amiga hardware stuff thread (see also following posts), and tested it in vAmigaWeb/net/own fork.
At least first interference part seems to glitch (black vertical blocks visible). Maybe more issues later on as well as I didn't do full comparison.
Config tested: OCS (not old)/KS 1.3/plain 68000/Mem: 512+512. No glitches in WinUAE 5.0.0 w/ most common A500 setup.
The text was updated successfully, but these errors were encountered: