MiSTer-devel / Minimig-AGA_MiSTer

139 stars 54 forks source link

Score graphics corruption in Hybris #73

Open MilanPolle opened 4 years ago

MilanPolle commented 4 years ago

If you look at the image, you can see that the shadow behind the score is incorrect. It works correctly on WinUAE. https://imgur.com/bPQmPmE This was confirmed by another user at the MiSTer forum https://misterfpga.org/viewtopic.php?f=4&t=698

I found a clue to what is probably the cause of this in an interview with the developer: https://codetapper.com/amiga/interviews/martin-pedersen/

"The game makes heavy use of sprite tricks! (Disabling sprites in an emulator yields a very empty screen!) Can you recall any interesting stories about the development of the sprite routines?

The biggest effort on the sprites was the score sprites "on top of everything". The rest of the sprites are grouped in such a way that no problems occur in practice.

The score panel at the top of the screen uses a nice trick where sprites 0 and 1 have their sprite data set and are repositioned horizontally across the screen "racing the beam". Did you come up with that effect or had you seen it in another game?

Good description of what actually goes on technically :-)

This was Torben's idea and was not seen on the Amiga before. There was an immense amount of fiddling to make this fit. It is essentially timed down to the exact processor cycle ;-)"

So they are following the display update based on processor cycle timing, to change the sprites at the right time. Then I remembered reading somewhere that the CPU speed of the Minimig core for MiSTer is not exactly the same as on a real Amiga. I guess that could be what is causing this problem.

sorgelig commented 4 years ago

did you test in 68000 mode?

MilanPolle commented 4 years ago

Yes, forgot to mention the config was simulating an Amiga 500. Kick 1.3 from Amiga forever.

ransom1122 commented 4 years ago

So I take it no fix for this?

sorgelig commented 4 years ago

So I take it no fix for this?

everybody is waiting when you will fix it.

MilanPolle commented 4 years ago

I think I found another problem in the attract mode that might be related (enemy score list, bottom enemy (base) vertical position jittering). I'll have to double check to make sure.

rsn8887 commented 9 months ago

Robinson5 has been working on MIST/TC64 Minimig core and made some fixes there.

There's a Hybris scoreboard fix which might be interesting to help fix this problem on MiSTer as well, here https://github.com/retrofun/MinimigAGA-MiST-TC64/commit/7abd0e3fb8594ae2ae6e6b36a3ee32fca6b7ad61 and here: https://github.com/retrofun/MinimigAGA-MiST-TC64/commit/b0b8d98c3a59018ad008e6ee81f34198021ec4dd

It might also depend on other commits.

rsn8887 commented 9 months ago

I compiled my own test core with the changes from the above mentioned two commits from the MinimigAGA-MIST-TC64 staging branch by Robinson5, and it indeed fixes the corruption in Hybris on MiSTer core!

Before:

20240119_183032-screen

After:

20240119_182736-screen

Notice the "Score" letters on top left.

Test core: Minimig_test.rbf.zip

MilanPolle commented 9 months ago

That is great news! I will test it, I hope it fixes the jittering base unit in the score overview as well.

MilanPolle commented 9 months ago

I can confirm that the score shadow problem is fixed with this test version. That is a great improvement!

The base position jittering in the score overview is still there, so that is caused by a different timing inaccuracy of the implementation of the custom chips.

rsn8887 commented 6 months ago

Fixed with release 20240409

vanfanel commented 1 week ago

@rsn8887 It seems that part of the problem is still present: The base position jittering/stuttering in the score overview is still there, as @MilanPolle said.

Maybe Robinson5 doesn't know about it? Should we tell him? This is the last remaning OCS game bug I know about in the core... It's a pitty OCS implementation is still wrong, I would gladly pay so we all get proper OCS open implementation.

MilanPolle commented 1 week ago

@vanfanel this bug is indeed still there. But this ticket is also not closed yet.

vanfanel commented 1 week ago

I even have several Amiga 500 computers stored that I would gladly donate for reverse-engineering efforts. Also 1200.

rsn8887 commented 6 days ago

I tried the following other MinimigAGA-MIST-TC64 commits by robinsonb5, but none of them helped with the remaining juttering problem in the attract mode score display.

https://github.com/retrofun/MinimigAGA-MiST-TC64/commit/52cb034ad519ce92a96e26a428a30061d26abb80

https://github.com/retrofun/MinimigAGA-MiST-TC64/commit/fe2db716c1cf7cd7f5b5e7cddb5b7b1ffeec5766

https://github.com/retrofun/MinimigAGA-MiST-TC64/commit/ce28f7996651c9034baff3c9ddb711ecbad305b8

https://github.com/retrofun/MinimigAGA-MiST-TC64/commit/7b0f0cfebb8b22905b4d1d2fbdf9d19dce1659dc