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

General fixes and definitions for GO Advance clones #455

Merged
merged 4 commits into from Sep 5, 2021

Conversation

JohnnyonFlame
Copy link
Contributor

@JohnnyonFlame JohnnyonFlame commented Sep 5, 2021

In this PR are contained a number of changes:

  • GOA_CLONE flag for GO Advance clones, such as the RG351p/v, Gameforce Chi, RGB10 and other such devices.
  • Wrapper for SDL2's SDL_DYNAPI_entry
  • A new runtime environment variable BOX86_FORCE_ES that forces a specific OpenGL ES context version, allowing for the user to specify, e.g. BOX86_FORCE_ES=31 or BOX86_FORCE_ES=2 for GLES 3.1 or GLES 2.0 respectively.
  • A number of general fixes and workarounds A workaround to ensure no silent getpwuid failure causing crashes.

Sets compilation definitions for GO Advance clones, such as the RG351p/v, Gameforce Chi, RGB10 and other such devices.
@@ -19,6 +20,8 @@
#include "myalign.h"
#include "threads.h"

#include "wrappedsdl2defs.h"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it

#include "generated/wrappedsdl2defs.h

instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got auto-completed by the IDE, assumed that was correct since it worked.

#define GOS(sym, _w) GOM(sym, _w)

#define DATA
if(0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use of this if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of a change that got lost during debugging, it was supposed to allow the GO macros to be else if rather than a chain of endless if

}

// Cut down and adapted from SDL_video.c
EXPORT int my2_SDL_GL_ExtensionSupported(x86emu_t* emu, char *name)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this one should be inside an #ifdef GOA_CLONE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely makes more sense to check for gl4es than GOA_CLONE imho, since that's the reason for this functionality.

symbol = my->SDL_GL_GetProcAddress(name);
} else {
char buf[200] = {};
symbol = my_glXGetProcAddress(emu, name);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of this? both function will do the same mapping, and the libGL is supposed to be the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, this workaround was a tiny bit too jerry rigged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct way would've been having used SDL_VIDEO_GL_DRIVER to point towards the shim on egl-based backends, I was using SDL_OPENGL_LIBRARY instead and thus got the weird behavior. I'll be reverting these.

Fixes Chowdren games dereferencing an offset of a NULL pointer on 351ELEC when getpwuid fails and Chowdren fails to gracefully recover.
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.

None yet

2 participants