aboutsummaryrefslogtreecommitdiff
path: root/patches/mame2000
diff options
context:
space:
mode:
authorneonloop2021-08-10 14:55:06 +0000
committerneonloop2021-08-10 14:55:06 +0000
commit20453016f9d38324961087b62f38145a455e409a (patch)
tree6b35161d0ebc567e18ce399960d0f3a848a7c46d /patches/mame2000
parentd9eea627fb916c099e908a9178acd5093e97bfef (diff)
downloadpicoarch-20453016f9d38324961087b62f38145a455e409a.tar.gz
picoarch-20453016f9d38324961087b62f38145a455e409a.tar.bz2
picoarch-20453016f9d38324961087b62f38145a455e409a.zip
Adds vertical mode to mame2000
Diffstat (limited to 'patches/mame2000')
-rw-r--r--patches/mame2000/1004-rotation.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/patches/mame2000/1004-rotation.patch b/patches/mame2000/1004-rotation.patch
new file mode 100644
index 0000000..f28b452
--- /dev/null
+++ b/patches/mame2000/1004-rotation.patch
@@ -0,0 +1,75 @@
+diff --git a/src/libretro/libretro.c b/src/libretro/libretro.c
+index aad93bc..2f37f52 100644
+--- a/src/libretro/libretro.c
++++ b/src/libretro/libretro.c
+@@ -68,6 +68,8 @@ int should_skip_frame = 0;
+ static int sample_rate = 32000;
+ static int stereo_enabled = true;
+
++static int rotate = false;
++
+ int game_index = -1;
+ unsigned short *gp2x_screen15;
+ int thread_done = 0;
+@@ -296,6 +298,19 @@ static void update_variables(bool first_run)
+ else
+ stereo_enabled = true;
+
++ var.value = NULL;
++ var.key = "mame2000-rotate";
++
++ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
++ {
++ if(strcmp(var.value, "enabled") == 0)
++ rotate = true;
++ else
++ rotate = false;
++ }
++ else
++ rotate = false;
++
+ /* Reinitialise frameskipping, if required */
+ if (!first_run &&
+ ((frameskip_type != prev_frameskip_type)))
+@@ -312,6 +327,7 @@ void retro_set_environment(retro_environment_t cb)
+ { "mame2000-show_gameinfo", "Show Game Info; disabled|enabled" },
+ { "mame2000-sample_rate", "Snd. Rate (Restart); 11025|22050|32000|44100" },
+ { "mame2000-stereo", "Stereo (Restart); disabled|enabled" },
++ { "mame2000-rotate", "Rotate (Restart); disabled|enabled" },
+ { NULL, NULL },
+ };
+ environ_cb = cb;
+@@ -378,10 +394,17 @@ static void update_input(void)
+
+ key[KEY_1 + i] |= JS(i, START);
+ key[KEY_5 + i] |= JS(i, SELECT);
+- joy_pressed[c++] = JS(i, LEFT);
+- joy_pressed[c++] = JS(i, RIGHT);
+- joy_pressed[c++] = JS(i, UP);
+- joy_pressed[c++] = JS(i, DOWN);
++ if (rotate_controls) {
++ joy_pressed[c++] = JS(i, UP);
++ joy_pressed[c++] = JS(i, DOWN);
++ joy_pressed[c++] = JS(i, RIGHT);
++ joy_pressed[c++] = JS(i, LEFT);
++ } else {
++ joy_pressed[c++] = JS(i, LEFT);
++ joy_pressed[c++] = JS(i, RIGHT);
++ joy_pressed[c++] = JS(i, UP);
++ joy_pressed[c++] = JS(i, DOWN);
++ }
+ joy_pressed[c++] = JS(i, B);
+ joy_pressed[c++] = JS(i, A);
+ joy_pressed[c++] = JS(i, Y);
+@@ -911,6 +934,11 @@ bool retro_load_game(const struct retro_game_info *info)
+ options.samplerate = sample_rate;
+ usestereo = stereo_enabled;
+
++ if (rotate) {
++ options.ror = 1;
++ rotate_controls = 1;
++ }
++
+ /* This is needed so emulated YM3526/YM3812 chips are used instead on physical ones. */
+ options.use_emulated_ym3812 = 1;
+