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

Query: Kang Fu not working correctly with model=CD32? #1600

Open
giantclambake opened this issue Jan 18, 2025 · 21 comments
Open

Query: Kang Fu not working correctly with model=CD32? #1600

giantclambake opened this issue Jan 18, 2025 · 21 comments
Assignees

Comments

@giantclambake
Copy link

I'd actually stumbled across some oddity wrt CD32 emulation before ...see #1377 ... at the time, I thought it to be an isolated example, caused by the fact the intro anim was very different from the layout of the title itself (game assets), so I just left 'sleeping dogs lay' as the expression goes --- now I just found this example, and it very much looks like a bug...

To recreate:

Download & unpack this CD32 title -> http://ftp2.grandis.nu/turran/FTP/TOSEC-ISO/CD32/Commodore%20Amiga%20CD32%20-%20Games%20-%20%5bISO%5d/Kang%20Fu%20(1996)(ALTER%20interservice%20-%20Greed)%5b!%5d%5bAmiga-CD32%5d.zip

NOTE: This title ran very poorly with the base CD32/2mb+8mb '020 machine type -- the 2 beginning splash screens were 'shimmering' like these were being displayed in a hires interlaced mode, and once the game menu screen appears, music is totally broken and graphics very bad, with these images appearing much smaller than the emulation window itself...(odd). I figured the best idea, was to first see if I could tweak amiberry settings, to get this title running 'properly' --- this is the resultant config.uae file I used, that addresses all these problems...

Kang Fu (1996)(ALTER interservice - Greed)[!]CD32.uae.gz

With the above configurata done (and Kang.Fu.1996.ALTER.interservice.-.Greed.CD32.uae is in conf/ ), I start the emulation by double-clicking on the Kang Fu (1996)(ALTER interservice - Greed)[!]CD32.cue file icon --> this works as expected, with amiberry direct loading the .cue file, loading in the associated config.uae file, and starting the emulation immediately....

  • CD32 bootscreen comes and goes...
  • the Greed splashscreen is displayed...
  • the Kang Fu splashscreen is displayed...
  • the intro screen and music starts... //lasts for a minute or so...
  • intro screen & music dismissed, replaced with water-color image //load screen...
  • water-color image is replaced, with scrolly Hi Score overlay, but the image is smaller and shifted, and graphics/music stutters badly...

ex

  • hit F12 key, pops GUI --> hit F12 key again to dismiss GUI and resume emulation
  • water-color image, with scrolly Hi Score overlay is now correct size, and graphics/music working correctly

Expected: Hitting the F12 key twice should not be required to correct the graphics anomaly (which shouldn't happen in the first place ofc ;)

Indeed, I can't even imagine how the F12 key/GUI are participle here, but, there it is =)

Any ideas?...obscure bug of some kind?

TIA

@midwan midwan self-assigned this Jan 21, 2025
@midwan
Copy link
Collaborator

midwan commented Jan 22, 2025

The two screens shown on startup are indeed Hi-Res Interlace, so if your line mode is set to Single, they will appear as flickering.
Looking into that, it appears that the default setting in amiberry.conf was indeed to have line mode as single, which was useful when running on slower platforms, but no longer an issue after the split.

I've changed that to be Double, to avoid the interlace artifacts - but of course, it won't overwrite the setting you may already have now, so you can change that manually if you want.

The other issues I could see here, are related to the audio playback from the (virtual) CD. I think the CDDA support needs some improvements, but it's going to take a bit of work to get done.

@giantclambake
Copy link
Author

Thanks... with default_line_mode=1 that does indeed fix display of the first 2 screens.... that's a win...

...but again, this title runs horribly on the CD32 2+8/020 machine emulation. I think I need to stop right there, and query why this is so...ie; typically speaking, CD32 emulation is better than this OOTB... retest...

  • double-click on the Kang Fu (1996)(ALTER interservice - Greed)[!]CD32.cue file icon... //Note: no associated config.uae
  • CD32 bootscreen comes and goes...
  • the Greed splashscreen is displayed...
  • the Kang Fu splashscreen is displayed...
  • the intro screen and music starts...horribly, with music playback and graphics overlay stuttering badly
  • hit F12 key, pops GUI --> hit F12 key again to dismiss GUI and resume emulation
  • NOW graphics and music working as expected

This also happens when it gets to the highscore scrolly/music ...ie; the image display is now correct, but you still have to hit F12 twice to fix the music/graphics stuttering.

..so.. one bug down, and one yet to be squashed here I guess ;)

@midwan
Copy link
Collaborator

midwan commented Jan 24, 2025

I haven't found a proper solution yet, but I noticed that if disable the Cycle Exact (Full) option in the Chipset panel, the audio does seem to behave better in the intro sequence.

There are still some corrupt graphics flashing on the screen in the same sequence, instead of the normal rotating logo that should be there. But that happens on WinUAE as well, so I think it's a different kind of issue. I managed to get it to show once during my tests, while opening the GUI, fiddling with settings then going back, but never again - so I'm not sure what did it.

@midwan
Copy link
Collaborator

midwan commented Jan 24, 2025

Reported to WinUAE regarding the graphics corruption: tonioni/WinUAE#331

@giantclambake
Copy link
Author

Thanks ~ interesting, your description of the issues differs slightly by the sounds of it, but no problem, that's what YT is for ;)

https://www.youtube.com/watch?v=Y-qYqgAdEh4

It's difficult to pin down, because the mere act of opening/closing the GUI effectively corrects the situation ~ ergo, you're left with setting an emulation option before you start the title, so hitting the F12 isn't part of the test...

This is what I found -- starting from the GUI with expanded (2+8) CD32 preset, changing one of the following options avoids the issues with this title...

  • GUI -> CPU and FPU panel --> set 68020 CPU Speed to 'Fastest possible' ....or.....
  • GUI -> CPU and FPU panel --> set CPU type to 68030 ....OR.....
  • GUI -> Chipset panel --> disable Cycle Exact (Full)

Somehow this reminds me of a title I was testing a number of months ago (I forget the title name now), wherein Toni had intimated this was something odd in the chipset code, which has many little hacks in it, which is why he was rewriting the chipset code....and that he likely wouldn't look at issues like this again, until the chipset code rewrite was done. Perhaps this issue is also related here? Sitting on hands....

@midwan
Copy link
Collaborator

midwan commented Jan 27, 2025

Toni replied, the gfx glitches are most likely due to 68020 timing issues, so they won't get fixed anytime soon.

There's still the issue that only happens in Amiberry, regarding the sound problem depending on the CPU/Chipset setting, which does not happen on WinUAE. I haven't figured out why that is, yet.

In any case, this is not a generic case about CD32 emulation I think, more about this specific title that behaves erratically.

@giantclambake
Copy link
Author

Yeah, saw Toni's comment ~ you're right, if it doesn't happen in WinUAE then it shouldn't happen in amiberry either ... ideally speaking ....

As to whether of not this is a CD32 emulation issue, or title specific, I'll just have to keep testing CD32 titles to divine ;)

@giantclambake
Copy link
Author

giantclambake commented Feb 8, 2025

KangFu is no longer booting at all wrt v7.0.3 (master) ~ it gets through the 2 splashscreens as before, but the main menu/music never appear....it just sits at a blackscreen..???

Logfile attached ... some recent change possibly did this... d56897a ??... I can check if you want...(maybe the logfile will be a pointer)...

TIA

amiberry.log.gz

@midwan
Copy link
Collaborator

midwan commented Feb 8, 2025

Please check after the latest updates today - there was a bug with the ROM refresh, which I fixed.

@giantclambake
Copy link
Author

Still not booting, still see the same error in logfile ~ title does not start.

amiberry.log.gz

@giantclambake
Copy link
Author

Git agrees with my surmise...

gcb@gallah:~/_build/amiberry$ git bisect bad
d56897a2e77e3d8fbdd9c20fb010211ed948a520 is the first bad commit
commit d56897a2e77e3d8fbdd9c20fb010211ed948a520 (HEAD)
Author: Dimitris Panokostas <[email protected]>
Date:   Thu Feb 6 22:46:59 2025 +0100

    enhancement: When caching next CD sectors, don't seek backwards and release semaphore during read.

 src/akiko.cpp | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

@midwan
Copy link
Collaborator

midwan commented Feb 9, 2025

@giantclambake
Same issue on the latest WinUAE 6 beta7, where this came from. I can see the two title screens, but black screen after that. Is that the same you're seeing?

If that's the case, I think this should be reported upstream to WinUAE (either on EAB or on Github).

@midwan
Copy link
Collaborator

midwan commented Feb 9, 2025

I've reported this to Toni in the EAB thread

@giantclambake
Copy link
Author

I can see the two title screens, but black screen after that. Is that the same you're seeing?

Yeah, that's what I'm seeing here ~ ftr I tried a number of other CD32 title that use .wav / .mp3 / .bin (wave files), and they all hit uae_start_thread "cdimage_cdda_play" function and play music as expected ~ this title never does, just endless streams of the line CD32: filling buffer sector=49-48, blocks=0 that never ends...

Thanks for reporting it ~ glass half full, maybe this problem is at the crux of why the menu/high-score screens are so messed up with this title? Time will tell ;)

@giantclambake
Copy link
Author

I rolled in this fix from Toni...

tonioni/WinUAE@c4edda3

It gets this title running again, however the problems with the menu screens remain....

@giantclambake
Copy link
Author

Now that the title is running again, I noticed something...

  • CD32 bootscreen comes and goes...
  • the Greed splashscreen is displayed...and dismissed, replaced by...
  • the Kang Fu splashscreen is displayed...

When the Kang Fu splashscreen is dismissed (nothing displayed) and you hit F12 to raise GUI, hit F12 again to dismiss GUI, when the main menu screen/animation is displayed, it does so correctly -- music and animation working as expected.

@giantclambake
Copy link
Author

@midwan ~ now this title runs again, and work-arounds exist to get around the menu slowdowns, this is now more a case of "amiberry should work the same as WinUAE does with this title"....sort of thing.....

...that said, and wrt the 3 work-arounds, it occurred to me this morning, that enabling JIT (after disabling 24bit addressing), would likely be a 'fix' here as well...and it is, however...

Question: When JIT is enabled. it appears that line mode reverts to Single ... is that expected behaviour? ( /me just being observant, I perhaps don't expect this -- if line mode is set to Double, should JIT countermand that?)

@midwan
Copy link
Collaborator

midwan commented Feb 26, 2025

No, line mode and JIT are not connected in any way

@giantclambake giantclambake changed the title Query: Is model=CD32 functioning correctly? Query: Kang Fu not working correctly with model=CD32? Feb 27, 2025
@giantclambake
Copy link
Author

// oops, apols, forgot to change ticket description last time... ;)

No, line mode and JIT are not connected in any way

Interesting ...that, in and of itself, is an anomaly here, as that's appears to be what happens with this title...

No JIT ....

ex

With JIT enabled (24bit addressing OFF, which by itself doesn't cause this)

ex1

....and it doesn't 'shimmer' ... but some interleaving is going on, most visible wrt text line... and to really throw a cat among the pigeons (although one can't be sure of of the image source), on HOL this title screen appears like this latter screen above, the bottom font/text string being the stand-out (ie; with line mode set to double and no JIT, are we over-performing?)...

HTH

@midwan
Copy link
Collaborator

midwan commented Feb 27, 2025

Changing the JIT setting, does not affect the Single/Double line mode - you should be able to verify this in the GUI settings.

@giantclambake
Copy link
Author

That's my point ~ it doesn't seem to affect/change the Single/Double line mode in the GUI, and yet as can be seen above, the splash screen image is displayed differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants