Ejemplo n.º 1
0
void fs_uae_configure_input()
{
    fs_uae_configure_mouse();
    fs_emu_log("configuring joystick ports:\n");
    amiga_set_option("joyport0", "none");
    amiga_set_option("joyport1", "none");

    fs_uae_configure_actions();

    //fs_emu_set_action_function(joystick_action);
    char *value;
    value = fs_config_get_string("joystick_port_0");
    if (value == NULL) {
        value = g_strdup("mouse");
    }
    configure_joystick_port(0, value, "joyport0", "joy0");
    g_free(value);

    value = fs_config_get_string("joystick_port_1");
    if (value == NULL) {
        value = g_strdup("auto");
    }
    configure_joystick_port(1, value, "joyport1", "joy1");
    g_free(value);

    value = fs_config_get_string("joystick_port_2");
    if (value == NULL) {
        value = g_strdup("nothing");
    }
    configure_joystick_port(2, value, "joyport2", "joy2");
    g_free(value);

    value = fs_config_get_string("joystick_port_3");
    if (value == NULL) {
        value = g_strdup("nothing");
    }
    configure_joystick_port(3, value, "joyport3", "joy3");
    g_free(value);

    value = fs_config_get_string("joystick_port_4");
    if (value == NULL) {
        value = g_strdup("nothing");
    }
    configure_joystick_port(4, value, "joyport4", "joy4");
    g_free(value);
}
Ejemplo n.º 2
0
void fs_uae_configure_input()
{
    fs_uae_configure_mouse();
    fs_emu_log("configuring joystick ports:\n");
    amiga_set_option("joyport0", "none");
    amiga_set_option("joyport1", "none");

    fs_uae_configure_actions();

    char *value;
    value = fs_config_get_string("joystick_port_1");
    if (!value) {
        value = g_strdup("auto");
    }
    configure_joystick_port(1, value, "joyport1", "joy1");
    g_free(value);
    value = fs_config_get_string("joystick_port_0");
    if (!value) {
        value = g_strdup("auto");
    }
    configure_joystick_port(0, value, "joyport0", "joy0");
    g_free(value);

    for (int i = 2; i < FS_UAE_NUM_INPUT_PORTS; i++) {
        gchar *key = g_strdup_printf("joystick_port_%d", i);
        value = fs_config_get_string(key);
        g_free(key);
        if (value == NULL) {
            value = g_strdup("nothing");
        }
        gchar *key2 = g_strdup_printf("joyport%d", i);
        gchar *key3 = g_strdup_printf("joy%d", i);
        configure_joystick_port(i, value, key2, key3);
        g_free(key3);
        g_free(key2);
        g_free(value);
    }
}