Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/emu/emuopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const options_entry emu_options::s_option_entries[] =
{ OPTION_JOYSTICK ";joy", "1", OPTION_BOOLEAN, "enable joystick input" },
{ OPTION_LIGHTGUN ";gun", "0", OPTION_BOOLEAN, "enable lightgun input" },
{ OPTION_MULTIKEYBOARD ";multikey", "0", OPTION_BOOLEAN, "enable separate input from each keyboard device (if present)" },
{ OPTION_MULTIMOUSE, "0", OPTION_BOOLEAN, "enable separate input from each mouse device (if present)" },
{ OPTION_MULTIMOUSE, "1", OPTION_BOOLEAN, "enable separate input from each mouse device (if present)" },
{ OPTION_STEADYKEY ";steady", "0", OPTION_BOOLEAN, "enable steadykey support" },
{ OPTION_UI_ACTIVE, "0", OPTION_BOOLEAN, "enable user interface on top of emulated keyboard (if present)" },
{ OPTION_OFFSCREEN_RELOAD ";reload", "0", OPTION_BOOLEAN, "convert lightgun button 2 into offscreen reload" },
Expand Down
16 changes: 10 additions & 6 deletions src/mame/drivers/mazerbla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,20 +1315,24 @@ static INPUT_PORTS_START( greatgun )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Fire")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Fire")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )


PORT_START("STICK0_X") /* Strobe 6: horizontal movement of gun */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(1)
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_MINMAX(0x00, 0xff) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(1)

PORT_START("STICK0_Y") /* Strobe 7: vertical movement of gun */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(1)
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_MINMAX(0x00, 0xff) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(1)

PORT_START("STICK1_X") /* Strobe 8: horizontal movement of gun */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(2)
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_MINMAX(0x00, 0xff) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(2)

PORT_START("STICK1_Y") /* Strobe 9: vertical movement of gun */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(2)
// for whatever reason this should be inverted?
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_MINMAX(0x00, 0xff) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_INVERT PORT_KEYDELTA(7) PORT_PLAYER(2)

PORT_START("UNUSED")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
Expand Down
15 changes: 9 additions & 6 deletions src/osd/retro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void retro_set_audio_sample(retro_audio_sample_t cb) { }

void retro_set_environment(retro_environment_t cb)
{
sprintf(option_mouse, "%s_%s", core, "mouse_enable");
sprintf(option_mouse, "%s_%s", core, "mouse_mode");
sprintf(option_cheats, "%s_%s", core, "cheats_enable");
sprintf(option_overclock, "%s_%s", core, "cpu_overclock");
sprintf(option_nag, "%s_%s",core,"hide_nagscreen");
Expand Down Expand Up @@ -162,7 +162,7 @@ void retro_set_environment(retro_environment_t cb)
{ option_write_config, "Write configuration; disabled|enabled" },
{ option_saves, "Save state naming; game|system" },
{ option_auto_save, "Auto save/load states; disabled|enabled" },
{ option_mouse, "Enable in-game mouse; disabled|enabled" },
{ option_mouse, "XY device (Restart); none|lightgun|mouse" },
{ option_throttle, "Enable throttle; disabled|enabled" },
{ option_cheats, "Enable cheats; disabled|enabled" },
{ option_overclock, "Main CPU Overclock; default|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|60|65|70|75|80|85|90|95|100|105|110|115|120|125|130|135|140|145|150" },
Expand Down Expand Up @@ -212,10 +212,12 @@ static void check_variables(void)

if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (!strcmp(var.value, "disabled"))
mouse_enable = false;
if (!strcmp(var.value, "enabled"))
mouse_enable = true;
if (!strcmp(var.value, "none"))
mouse_mode = 0;
if (!strcmp(var.value, "mouse"))
mouse_mode = 1;
if (!strcmp(var.value, "lightgun"))
mouse_mode = 2;
}

var.key = option_throttle;
Expand Down Expand Up @@ -578,6 +580,7 @@ void retro_run (void)
input_poll_cb();

process_mouse_state();
process_lightgun_state();
process_keyboard_state();
process_joypad_state();

Expand Down
11 changes: 8 additions & 3 deletions src/osd/retro/libretro_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern int retro_pause;

extern bool experimental_cmdline;
extern bool hide_gameinfo;
extern bool mouse_enable;
extern int mouse_mode;
extern bool cheats_enable;
extern bool alternate_renderer;
extern bool boot_to_osd_enable;
Expand All @@ -45,9 +45,12 @@ extern bool throttle_enable;
extern bool auto_save_enable;
extern bool game_specific_saves_enable;

extern int mouseLX;
extern int mouseLY;
extern int mouseLX[4];
extern int mouseLY[4];
extern int mouseBUT[4];
extern int lightgunLX[4];
extern int lightgunLY[4];
extern int lightgunBUT[4];

extern UINT16 retrokbd_state[RETROK_LAST];

Expand Down Expand Up @@ -82,6 +85,8 @@ void process_joypad_state(void);

void process_mouse_state(void);

void process_lightgun_state(void);

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
Loading