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

Fix for some problems in overlay: black screen, video freezes, DAT files, ... #24

Merged
merged 2 commits into from
Feb 9, 2021

Conversation

lmerckx
Copy link

@lmerckx lmerckx commented May 9, 2018

Some games (cobra, roadblaster, astron, bega) don't work with last revision for two reasons:

  1. The CPU's MAX_CONTEXT_SIZE is too short and must be increased. Error returned by Hypseus.
  2. The default overlay transparent color is 0 (black) and Hypseus doesn't support other color requested by specific games

The corrections made in this branch seem to resolve these problems.

lmerckx added 2 commits May 9, 2018 21:20
- freezes in some games (astron, bega, ...) during some seconds + block when generating .DAT files
- lair2: video stucks after first frames
@lmerckx lmerckx changed the title Support other color than 0 for transparency + increase MAX_CONTEXT_SIZE Fix for some problems in overlay: back screen, video freezes, ... May 23, 2018
@lmerckx
Copy link
Author

lmerckx commented May 23, 2018

Two other problems encountered in some games:

  1. Some games (bega, astron, ...) freezes during some seconds and restart after a timeout message VLDP error! Timed out waiting for internal thread to accept command!:
    This problems seems due to the "lock" system between methods vid_blit and vid_update_yuv_overlay.
    Indeed, these methods use SDL_CondWait and SDL_CondSignal to avoid conflict when changing same texture.
    But for these games, vid_update_yuv_overlay is called twice (setting vid_update_yuv_overlay to true) without any call to vid_blit.
    It leads in a blocking call to vid_update_yuv_overlay, which also blocks the command handler; and avoid processing other command.
    Only the timeout, after about 7 seconds, unblocks the emulator.
    So, I replace SDL_CondWait by SDL_CondWaitTimeout (with a timeout of 100 ms) to solve the problem.

  2. Videos of Dragon's Lair 2 block after some frames:
    After some analysis, it seems that vid_blit is never called for this game during the video play !
    It seems due to this line of code:
    if (m_game_uses_video_overlay && m_video_overlay_needs_update) blit();
    where m_video_overlay_needs_update is never true.
    The correction was to set this flag to true when receiving an IRQ 0.

These modifications solve these problems but I'm not sure it was the best way to do it.
So, I'm opened to any other solutions !

By the way, the solution for 1 also solves the problem of generation of .DAT files.

@lmerckx
Copy link
Author

lmerckx commented May 23, 2018

This PR should be linked to issues:

And perhaps:
#13: debian 9 strech

@lmerckx lmerckx changed the title Fix for some problems in overlay: back screen, video freezes, ... Fix for some problems in overlay: black screen, video freezes, DAT files, ... May 23, 2018
@ghost
Copy link

ghost commented May 23, 2018

@lmerckx can you send a pull request to https://github.com/grant2258/hypseus I will test later on today when i get time if you like.

@lmerckx
Copy link
Author

lmerckx commented May 23, 2018

@grant2258 It seems you already merge changes. I see my commits in your history.
Still need to do it ?

@ghost
Copy link

ghost commented May 23, 2018

it sok i found them still not tested yet need to remember the command line to start the game has been a while :)

@ghost
Copy link

ghost commented May 23, 2018

still getting some video freeinzing no where as bad as it used to be though in dragons lair 2

@ghost
Copy link

ghost commented May 23, 2018

./daphne.bin lair2 vldp -framefile /home/pi/RetroPie/roms/daphne/lair.daphne/lair.txt -useoverlaysb 2

(am testing on retropie)

@lmerckx
Copy link
Author

lmerckx commented Nov 20, 2019

@grant2258 I don't know if it is linked to your problem but since GCC 7, I needed to remove the embedded version of libmpeg2 and use the standard one.
Performance are not impacted !

See my patch for Recalbox: https://gitlab.com/recalbox/recalbox/blob/master/package/hypseus/hypseus-005-stdmpeg2.patch

@vanfanel
Copy link
Contributor

vanfanel commented Feb 9, 2021

@lmerckx Do you know what happened to updated Hypseus code? This repository doesn't look like merging your fixes. I did the overlay stuff years ago and I would love having your changes incorporated to Hypseus... But the main repo looks SO abandoned.

@lmerckx
Copy link
Author

lmerckx commented Feb 9, 2021

@vanfanel Hello vanfanel.
I don't know why these changes are not merged. They work and they are used in Recalbox without problem for some years.
It seems that this project is not yet maintained anymore. It is sad because it was a very good idea and there is still work to do !

@h0tw1r3 h0tw1r3 merged commit 5775060 into btolab:master Feb 9, 2021
@lmerckx
Copy link
Author

lmerckx commented Feb 9, 2021

Just ignore my previous comment, so. :)
Thank you for the merge.

@h0tw1r3
Copy link
Contributor

h0tw1r3 commented Feb 9, 2021

Clearly I haven't had much time for my personal projects such as this one.
Appreciate the nudge.
I'm always hesitant to merge without testing the build myself. Going forward I'll merge things that make sense, or have a second comment "works for me".

@vanfanel
Copy link
Contributor

vanfanel commented Feb 9, 2021

@lmerckx
Are there any other Recalbox-exclusive patches not yet merged?

What OS are you using?
Have you tried -fullscreen? I am seeing some "stroboscopic effects" around the video if I do.

@h0tw1r3 Thanks for the merges! It's nice to see this move again!

@lmerckx
Copy link
Author

lmerckx commented Feb 9, 2021

@vanfanel All patches can be found here: https://gitlab.com/recalbox/recalbox/-/tree/master/package/hypseus
Most of them are specific to Recalbox.

Recalbox works on Buildroot (Linux distribution) for Raspberry PI, PC and Odroid.
It works fine on Raspberry but some people report me flashes on Odroid and sometimes PC (depending on the graphic card).
I haven't investigated yet.

@vanfanel
Copy link
Contributor

vanfanel commented Feb 9, 2021

@lmerckx I have just done a PR that fixes the flahsing, in #31

Please propagate this to RecalBox, etc if you are into them.

@lmerckx lmerckx deleted the transparent-overlay branch February 21, 2021 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants