@@ -591,25 +591,44 @@ static void update_input(void)
591591static void set_variabless (void )
592592{
593593 struct retro_variable vars[] = {
594- { " geargrafx_turbotap " , " TurboTap; Disabled|Enabled " },
594+ { " geargrafx_console_type " , " System (restart); Auto|PC Engine (JAP)|SuperGrafx (JAP)|TurboGrafx-16 (USA) " },
595595 { " geargrafx_aspect_ratio" , " Aspect Ratio; 1:1 PAR|4:3 DAR|6:5 DAR|16:9 DAR|16:10 DAR" },
596596 { " geargrafx_overscan" , " Overscan; Disabled|Enabled" },
597597 { " geargrafx_scanline_count" , " Scanline Count; 224p|240p|Manual" },
598598 { " geargrafx_scanline_start" , " Scanline Start (Manual); 3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|0|1|2" },
599599 { " geargrafx_scanline_end" , " Scanline End (Manual); 241|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240" },
600600 { " geargrafx_composite_colors" , " Composite Colors; Disabled|Enabled" },
601+ { " geargrafx_no_sprite_limit" , " No Sprite Limit; Disabled|Enabled" },
601602 { " geargrafx_backup_ram" , " Backup RAM (restart); Enabled|Disabled" },
602- { " geargrafx_console_type" , " System (restart); Auto|PC Engine (JAP)|SuperGrafx (JAP)|TurboGrafx-16 (USA)" },
603603 { " geargrafx_cdrom_type" , " CD-ROM (restart); Auto|Standard|Super CD-ROM|Arcade CD-ROM" },
604604 { " geargrafx_cdrom_bios" , " CD-ROM Bios; Auto|System Card 1|System Card 2|System Card 3|Game Express" },
605605 { " geargrafx_cdrom_preload" , " Preload CD-ROM (restart); Disabled|Enabled" },
606- { " geargrafx_no_sprite_limit" , " No Sprite Limit; Disabled|Enabled" },
607- { " geargrafx_avenue_pad_3_switch" , " Avenue Pad 3 Switch; Auto|SELECT|RUN" },
608- { " geargrafx_soft_reset" , " Soft Reset; Enabled|Disabled" },
609- { " geargrafx_up_down_allowed" , " Allow Up+Down / Left+Right; Disabled|Enabled" },
610606 { " geargrafx_psg_volume" , " PSG Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
611607 { " geargrafx_cdrom_volume" , " CD-ROM Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
612608 { " geargrafx_adpcm_volume" , " ADPCM Volume; 100|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170|180|190|200" },
609+ { " geargrafx_up_down_allowed" , " Allow Up+Down / Left+Right; Disabled|Enabled" },
610+ { " geargrafx_soft_reset" , " Allow Soft Reset; Enabled|Disabled" },
611+ { " geargrafx_turbotap" , " TurboTap; Disabled|Enabled" },
612+ { " geargrafx_avenue_pad_3_switch" , " Avenue Pad 3 Switch; Auto|SELECT|RUN" },
613+ { " geargrafx_turbo_p1_i" , " P1 Turbo I; Disabled|Enabled" },
614+ { " geargrafx_turbo_p2_i" , " P2 Turbo I; Disabled|Enabled" },
615+ { " geargrafx_turbo_p2_ii" , " P2 Turbo II; Disabled|Enabled" },
616+ { " geargrafx_turbo_p3_i" , " P3 Turbo I; Disabled|Enabled" },
617+ { " geargrafx_turbo_p3_ii" , " P3 Turbo II; Disabled|Enabled" },
618+ { " geargrafx_turbo_p4_i" , " P4 Turbo I; Disabled|Enabled" },
619+ { " geargrafx_turbo_p4_ii" , " P4 Turbo II; Disabled|Enabled" },
620+ { " geargrafx_turbo_p5_i" , " P5 Turbo I; Disabled|Enabled" },
621+ { " geargrafx_turbo_p5_ii" , " P5 Turbo II; Disabled|Enabled" },
622+ { " geargrafx_turbo_speed_p1_i" , " P1 Turbo I Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
623+ { " geargrafx_turbo_speed_p1_ii" , " P1 Turbo II Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
624+ { " geargrafx_turbo_speed_p2_i" , " P2 Turbo I Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
625+ { " geargrafx_turbo_speed_p2_ii" , " P2 Turbo II Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
626+ { " geargrafx_turbo_speed_p3_i" , " P3 Turbo I Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
627+ { " geargrafx_turbo_speed_p3_ii" , " P3 Turbo II Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
628+ { " geargrafx_turbo_speed_p4_i" , " P4 Turbo I Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
629+ { " geargrafx_turbo_speed_p4_ii" , " P4 Turbo II Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
630+ { " geargrafx_turbo_speed_p5_i" , " P5 Turbo I Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
631+ { " geargrafx_turbo_speed_p5_ii" , " P5 Turbo II Speed; 4|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" },
613632 { NULL }
614633 };
615634
@@ -862,4 +881,52 @@ static void check_variables(void)
862881 float volume_f = (float )volume / 100 .0f ;
863882 core->GetAudio ()->SetADPCMVolume (volume_f);
864883 }
884+
885+ for (int i = 0 ; i < 5 ; i++)
886+ {
887+ char key[64 ];
888+ snprintf (key, sizeof (key), " geargrafx_turbo_p%d_i" , i + 1 );
889+ var.key = key;
890+ var.value = NULL ;
891+
892+ if (environ_cb (RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value )
893+ {
894+ bool enabled = (strcmp (var.value , " Enabled" ) == 0 );
895+ core->GetInput ()->EnableTurbo ((GG_Controllers)i, GG_KEY_I, enabled);
896+ }
897+
898+ snprintf (key, sizeof (key), " geargrafx_turbo_p%d_ii" , i + 1 );
899+ var.key = key;
900+ var.value = NULL ;
901+
902+ if (environ_cb (RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value )
903+ {
904+ bool enabled = (strcmp (var.value , " Enabled" ) == 0 );
905+ core->GetInput ()->EnableTurbo ((GG_Controllers)i, GG_KEY_II, enabled);
906+ }
907+
908+ snprintf (key, sizeof (key), " geargrafx_turbo_speed_p%d_i" , i + 1 );
909+ var.key = key;
910+ var.value = NULL ;
911+
912+ if (environ_cb (RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value )
913+ {
914+ int speed = atoi (var.value );
915+ if (speed < 0 )
916+ speed = 1 ;
917+ core->GetInput ()->SetTurboSpeed ((GG_Controllers)i, GG_KEY_I, speed);
918+ }
919+
920+ snprintf (key, sizeof (key), " geargrafx_turbo_speed_p%d_ii" , i + 1 );
921+ var.key = key;
922+ var.value = NULL ;
923+
924+ if (environ_cb (RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value )
925+ {
926+ int speed = atoi (var.value );
927+ if (speed < 0 )
928+ speed = 1 ;
929+ core->GetInput ()->SetTurboSpeed ((GG_Controllers)i, GG_KEY_II, speed);
930+ }
931+ }
865932}
0 commit comments