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

Teddybear's Revenge crashes when run from autoexec with specific vmem_delay and cycles values #3726

Open
3 tasks done
PoulpSquad opened this issue Jun 2, 2024 · 5 comments
Labels
bug Something isn't working demoscene Issues related to demoscene productions video Graphics and video related issues

Comments

@PoulpSquad
Copy link

PoulpSquad commented Jun 2, 2024

Are you using the latest Dosbox-Staging Version?

  • I have checked releases and am using the latest release.

Different version than latest?

No response

What Operating System are you using?

Windows 10

If Other OS, please describe

No response

Relevant hardware info

i7 7700K, 32GB RAM, GTX 1070

Have you checked that no other similar issue already exists?

  • I have searched and not found similar issues.

A clear and concise description of what the bug is.

As discussed in #3723, demo "Teddybear's Revenge" crashes Staging when run from [autoexec] with vmem_delay and a high cycles value.

As a reminder, I'll paste a sample of what weirddan455 found investigating the issue discovered by interloper98:

"As for the crash on start @interloper98 found... that's a hell of an edge case you found 😉 . It's only reproducible for me if I also add the demo to my [autoexec]. One of the first things the demo does is call INT10_VideoState_Save. You've set the real mode cycles so high and also added a vmem delay so it's doing this before VGA_SetupDrawing had a chance to run for the first time. Basically, the demo started running before the welcome screen could even be shown 😉"

Grabbing popcorn, this stuff is geeky as hell and I love it!

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Set vmem_delay to on or any value >0
  2. Set cycles= to a high enough value
  3. Run demo from [autoexec] section

Download URL of affected game or software

No response

Your configuration

[dosbox]
vmem_delay= >0 or on

[autoexec]
mount c f:\dosbox -t dir
c:
cd teddy
teddy.exe

Provide a Log

No response

Code of Conduct & Contributing Guidelines

  • Yes, I agree.
@PoulpSquad PoulpSquad added the bug Something isn't working label Jun 2, 2024
@PoulpSquad PoulpSquad changed the title Edge Case when Running "Teddybear's Revenge" from [autoexec] with vmem_delay= setting. Edge Case when Running "Teddybear's Revenge" from [autoexec] with vmem_delay= setting and high cycles= value. Jun 2, 2024
@PoulpSquad PoulpSquad changed the title Edge Case when Running "Teddybear's Revenge" from [autoexec] with vmem_delay= setting and high cycles= value. Edge Case when Running "Teddybear's Revenge" from [autoexec] with vmem_delay setting and high cycles value. Jun 2, 2024
@interloper98
Copy link
Collaborator

Grabbing popcorn, this stuff is geeky as hell and I love it!

You and me, too, @PoulpSquad. 🍿

Also - That's some detective work for that cursor issue, @weirddan455! 🥳

This project just keep getting better.

@weirddan455
Copy link
Collaborator

weirddan455 commented Jun 2, 2024

Repro steps are use this config exactly. Bug doesn't trigger is cycles are too low or vmem_delay isn't in a narrow range. Setting it to off doesn't trigger it and setting it 10000 also doesn't trigger it but 8000 seems to be a sweet spot that does. It also must be run from [autoexec].

[cpu]
cycles = 100000

[dosbox]
vmem_delay = 8000

[autoexec]
mount c /home/user/dosdrive
c:
cd teddy
teddy

The cause is probably this line that gets run multiple times in VGA_Init. Reducing the delay to 1ms seems to fix it but it might also introduce regressions somewhere. Setting it to 0ms prevents the DOSBox window from ever showing. Default delay with these specific settings causes VGA_SetupDrawing (the function that VGA_StartResize calls after the delay) to get run too late to where the demo is already trying to read VGA registers.

VGA_StartResize();

@johnnovak
Copy link
Member

So video init stuff... again... 🥶 😆

@johnnovak johnnovak added video Graphics and video related issues bug Something isn't working demoscene Issues related to demoscene productions and removed bug Something isn't working labels Jun 3, 2024
@johnnovak
Copy link
Member

@PoulpSquad Edited the ticket description to clarify the edge case is in fact an emulator hard crash.

@johnnovak johnnovak changed the title Edge Case when Running "Teddybear's Revenge" from [autoexec] with vmem_delay setting and high cycles value. Teddybear's Revenge crashes when run from autoexec with specific vmem_delay and cycles values Jun 3, 2024
@PoulpSquad
Copy link
Author

Thank you johnnovak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working demoscene Issues related to demoscene productions video Graphics and video related issues
Projects
None yet
Development

No branches or pull requests

4 participants