Skip to content

Haiku operating system support + simple CPU idling#41

Open
pulkomandy wants to merge 3 commits intoDIVGAMES:old_masterfrom
pulkomandy:haiku
Open

Haiku operating system support + simple CPU idling#41
pulkomandy wants to merge 3 commits intoDIVGAMES:old_masterfrom
pulkomandy:haiku

Conversation

@pulkomandy
Copy link

Hello!

I wanted to run DIV on Haiku for some time now. This merge request includes the few fixes needed as well as a patch to reduce CPU use. Let me know what you think of it.

Thanks for keeping DIV alive! I didn't get any publishable games out of it back in the 2000s, but I should certainly give it a try again!

- d_type in dirent does not exist, stat is needed to get the entry type
- libdl does not exist (included in libroot)
- functions _fseek and _ftell exist in Haiku libroot and conflict with div
The main loops are constantly running and using a lot of CPU for
nothing. This implements a simple idling algorithm:

- If there are no user inputs, and
- Nothing already asked to wait for retrace,

Then it should be okay to sleep for 10ms (not more, because DIV timers
are based on a 10ms system clock).

This may not be perfect: adding "something_happened = 1" in more places
may be needed. But at least DIV runs without my laptop fans spinning
like crazy now.
@pulkomandy pulkomandy changed the title Haiku Haiku operating system support + simple CPU idling Jan 26, 2025
- Fix crash if there are more than 32 video modes
- The sorting function didn't work right for me, rewrite it
- Remove memory allocation that's not really needed
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.

1 participant