Пример #1
0
int joy_arch_resources_init(void)
{
    if (joyport_get_port_name(JOYPORT_1)) {
        if (resources_register_int(joy1_resources_int) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_2)) {
        if (resources_register_int(joy2_resources_int) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_3)) {
        if (resources_register_int(joy3_resources_int) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_4)) {
        if (resources_register_int(joy4_resources_int) < 0) {
            return -1;
        }
    }

    return 0;
}
Пример #2
0
int joy_arch_cmdline_options_init(void)
{
    if (joyport_get_port_name(JOYPORT_1)) {
        if (cmdline_register_options(joydev1cmdline_options) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_2)) {
        if (cmdline_register_options(joydev2cmdline_options) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_3)) {
        if (cmdline_register_options(joydev3cmdline_options) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_4)) {
        if (cmdline_register_options(joydev4cmdline_options) < 0) {
            return -1;
        }
    }

    return 0;
}
Пример #3
0
void uijoyport_menu_create(int port1, int port2, int port3, int port4, int port5)
{
    int j = 0;

    joyport_menu[j].string = "Save BBRTC data when changed";
    joyport_menu[j].type = MENU_ENTRY_RESOURCE_TOGGLE;
    joyport_menu[j].callback = toggle_BBRTCSave_callback;
    joyport_menu[j].data = NULL;
    ++j;

    if (port1) {
        joyport_menu[j].string = joyport_get_port_name(JOYPORT_1);
        joyport_menu[j].type = MENU_ENTRY_DYNAMIC_SUBMENU;
        joyport_menu[j].callback = JoyPort1Device_dynmenu_callback;
        joyport_menu[j].data = (ui_callback_data_t)joyport1_dyn_menu;
        ++j;
    }

    if (port2) {
        joyport_menu[j].string = joyport_get_port_name(JOYPORT_2);
        joyport_menu[j].type = MENU_ENTRY_DYNAMIC_SUBMENU;
        joyport_menu[j].callback = JoyPort2Device_dynmenu_callback;
        joyport_menu[j].data = (ui_callback_data_t)joyport2_dyn_menu;
        ++j;
    }

    if (port3) {
        joyport_menu[j].string = joyport_get_port_name(JOYPORT_3);
        joyport_menu[j].type = MENU_ENTRY_DYNAMIC_SUBMENU;
        joyport_menu[j].callback = JoyPort3Device_dynmenu_callback;
        joyport_menu[j].data = (ui_callback_data_t)joyport3_dyn_menu;
        ++j;
    }

    if (port4) {
        joyport_menu[j].string = joyport_get_port_name(JOYPORT_4);
        joyport_menu[j].type = MENU_ENTRY_DYNAMIC_SUBMENU;
        joyport_menu[j].callback = JoyPort4Device_dynmenu_callback;
        joyport_menu[j].data = (ui_callback_data_t)joyport4_dyn_menu;
        ++j;
    }

    if (port5) {
        joyport_menu[j].string = joyport_get_port_name(JOYPORT_5);
        joyport_menu[j].type = MENU_ENTRY_DYNAMIC_SUBMENU;
        joyport_menu[j].callback = JoyPort5Device_dynmenu_callback;
        joyport_menu[j].data = (ui_callback_data_t)joyport5_dyn_menu;
        ++j;
    }
    joyport_menu[j].string = NULL;
    joyport_menu[j].type = MENU_ENTRY_TEXT;
    joyport_menu[j].callback = NULL;
    joyport_menu[j].data = NULL;
}
Пример #4
0
int joystick_resources_init(void)
{
    if (joystick_joyport_register() < 0) {
        return -1;
    }

#ifdef COMMON_JOYKEYS
    if (resources_register_int(joykeys_resources_int) < 0) {
        return -1;
    }
#endif

    if (resources_register_int(joyopposite_resources_int) < 0) {
        return -1;
    }

#ifdef JOYDEV_DEFAULT
    switch (machine_class) {
        case VICE_MACHINE_C64:
        case VICE_MACHINE_C64SC:
        case VICE_MACHINE_C128:
        case VICE_MACHINE_C64DTV:
        case VICE_MACHINE_SCPU64:
            joy2_resources_int[0].factory_value = JOYDEV_DEFAULT;
            break;
        case VICE_MACHINE_PLUS4:
        case VICE_MACHINE_VIC20:
        case VICE_MACHINE_CBM5x0:
            joy1_resources_int[0].factory_value = JOYDEV_DEFAULT;
            break;
        case VICE_MACHINE_PET:
        case VICE_MACHINE_CBM6x0:
            break;
    }
#endif

    if (joyport_get_port_name(JOYPORT_1)) {
        if (resources_register_int(joy1_resources_int) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_2)) {
        if (resources_register_int(joy2_resources_int) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_3)) {
        if (resources_register_int(joy3_resources_int) < 0) {
            return -1;
        }
    }
    if (joyport_get_port_name(JOYPORT_4)) {
        if (resources_register_int(joy4_resources_int) < 0) {
            return -1;
        }
    }

    if (joyport_get_port_name(JOYPORT_5)) {
        if (resources_register_int(joy5_resources_int) < 0) {
            return -1;
        }
    }

    return joy_arch_resources_init();
}