1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-02-22 05:09:36 +01:00

jbhook: Finalise half-baked "rotate window" hooks

This commit is contained in:
Will Toohey 2022-01-03 14:41:50 +10:00
parent 8de259c639
commit b42c9aa93b
6 changed files with 27 additions and 8 deletions

View File

@ -1,6 +1,9 @@
# Run the game windowed # Run the game windowed
gfx.windowed=false gfx.windowed=false
# rotate the normally-horizontal game window to be vertical
gfx.vertical=false
# URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80. # URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80.
eamuse.server=localhost:80 eamuse.server=localhost:80

View File

@ -1,6 +1,9 @@
# Run the game windowed # Run the game windowed
gfx.windowed=false gfx.windowed=false
# rotate the normally-horizontal game window to be vertical
gfx.vertical=false
# URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80. # URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80.
eamuse.server=localhost:80 eamuse.server=localhost:80

View File

@ -146,8 +146,10 @@ static void fb_init(void) {
static void __stdcall hook_glFlush(void) { static void __stdcall hook_glFlush(void) {
// 3 bytes per RGB pixel // 3 bytes per RGB pixel
uint8_t pixels_raw[W*H*3]; // these could really be stack variables but they are too big for gcc's
uint8_t pixels_rot[W*H*3]; // default stack size, and it's no problem for 6MiB of data to hang around
static uint8_t pixels_raw[W*H*3];
static uint8_t pixels_rot[W*H*3];
glReadPixels(0, 0, H, W, GL_RGB, GL_UNSIGNED_BYTE, pixels_raw); glReadPixels(0, 0, H, W, GL_RGB, GL_UNSIGNED_BYTE, pixels_raw);
@ -185,7 +187,7 @@ static void __stdcall hook_glFlush(void) {
// insufficiently generic compared to something in opengl32.dll, but the render // insufficiently generic compared to something in opengl32.dll, but the render
// loop of the game makes it very difficult to "catch" the rendering at the // loop of the game makes it very difficult to "catch" the rendering at the
// right place otherwise. This works with all horizontal jubeats, and they // right place otherwise. This works with all horizontal jubeats, and they
// stopped needing rotation past copious. // stopped needing rotation fixes starting with saucer.
static void hook_glBindFramebufferEXT(GLenum target, GLuint framebuffer) { static void hook_glBindFramebufferEXT(GLenum target, GLuint framebuffer) {
fb_init(); fb_init();

View File

@ -42,8 +42,6 @@ static struct options options;
static bool my_dll_entry_init(char *sidcode, struct property_node *param) static bool my_dll_entry_init(char *sidcode, struct property_node *param)
{ {
jbhook_util_gfx_install_vertical_hooks();
bool eam_io_ok; bool eam_io_ok;
bool jb_io_ok; bool jb_io_ok;
@ -52,6 +50,10 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
log_info("--- Begin jbhook dll_entry_init ---"); log_info("--- Begin jbhook dll_entry_init ---");
if(options.vertical) {
jbhook_util_gfx_install_vertical_hooks();
}
if (!options.disable_p3ioemu) { if (!options.disable_p3ioemu) {
log_assert(sidcode != NULL); log_assert(sidcode != NULL);
// pcbid and eamid are only used here for sec check, the ones used for // pcbid and eamid are only used here for sec check, the ones used for
@ -157,9 +159,11 @@ static HWND CDECL my_mwindow_create(
log_info("---------------- Begin jbhook mwindow_create ----------------"); log_info("---------------- Begin jbhook mwindow_create ----------------");
log_info("-------------------------------------------------------------"); log_info("-------------------------------------------------------------");
DWORD tmp = window_width; if(options.vertical) {
window_width = window_height; DWORD tmp = window_width;
window_height = tmp; window_width = window_height;
window_height = tmp;
}
return real_mwindow_create( return real_mwindow_create(
hinstance, hinstance,

View File

@ -65,6 +65,11 @@ bool options_read_cmdline(struct options *options, int argc, const char **argv)
break; break;
} }
case 'v': {
options->vertical = true;
break;
}
case 'a': { case 'a': {
options->disable_adapteremu = true; options->disable_adapteremu = true;
break; break;
@ -96,6 +101,7 @@ void options_print_usage(void)
" -h Print this usage message\n" " -h Print this usage message\n"
" -w Run the game windowed\n" " -w Run the game windowed\n"
" -f Run the game in a framed window (needs -w option)\n" " -f Run the game in a framed window (needs -w option)\n"
" -v Rotate the normally-horizontal game window to be vertical\n"
" -a Disable adapter hook\n" " -a Disable adapter hook\n"
" -c Disable card emulation (e.g. when running on a " " -c Disable card emulation (e.g. when running on a "
"real cab)\n" "real cab)\n"

View File

@ -7,6 +7,7 @@
struct options { struct options {
bool windowed; bool windowed;
bool window_framed; bool window_framed;
bool vertical;
bool disable_p3ioemu; bool disable_p3ioemu;
bool disable_cardemu; bool disable_cardemu;
bool disable_adapteremu; bool disable_adapteremu;