您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vice_ptr_to_int函数代码示例

51自学网 2021-06-03 09:39:34
  C++
这篇教程C++ vice_ptr_to_int函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vice_ptr_to_int函数的典型用法代码示例。如果您正苦于以下问题:C++ vice_ptr_to_int函数的具体用法?C++ vice_ptr_to_int怎么用?C++ vice_ptr_to_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vice_ptr_to_int函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UI_CALLBACK

static UI_CALLBACK(set_refresh_rate){    int current_refresh_rate;    resources_get_int("RefreshRate", &current_refresh_rate);    if (!CHECK_MENUS) {        if (current_refresh_rate != vice_ptr_to_int(UI_MENU_CB_PARAM)) {            resources_set_int("RefreshRate", vice_ptr_to_int(UI_MENU_CB_PARAM));            ui_update_menus();        }    } else {        if (vice_ptr_to_int(UI_MENU_CB_PARAM) == current_refresh_rate) {            ui_menu_set_tick(w, 1);        } else {            ui_menu_set_tick(w, 0);        }        if (UI_MENU_CB_PARAM == 0) {            int speed;            resources_get_int("Speed", &speed);            if (speed == 0) {                /* Cannot enable the `automatic' setting if a speed limit is                   not specified. */                ui_menu_set_sensitive(w, 0);            } else {                ui_menu_set_sensitive(w, 1);            }        }    }}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:31,


示例2: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(custom_memory_callback){    int blocks, value;    if (activated) {        blocks = vice_ptr_to_int(param);        resources_set_int("RAMBlock0", blocks & BLOCK_0 ? 1 : 0);        resources_set_int("RAMBlock1", blocks & BLOCK_1 ? 1 : 0);        resources_set_int("RAMBlock2", blocks & BLOCK_2 ? 1 : 0);        resources_set_int("RAMBlock3", blocks & BLOCK_3 ? 1 : 0);        resources_set_int("RAMBlock5", blocks & BLOCK_5 ? 1 : 0);    } else {        resources_get_int("RAMBlock0", &value);        blocks = value;        resources_get_int("RAMBlock1", &value);        blocks |= (value << 1);        resources_get_int("RAMBlock2", &value);        blocks |= (value << 2);        resources_get_int("RAMBlock3", &value);        blocks |= (value << 3);        resources_get_int("RAMBlock5", &value);        blocks |= (value << 5);        if (blocks == vice_ptr_to_int(param)) {            return sdl_menu_text_tick;        }    }    return NULL;}
开发者ID:r-type,项目名称:vice-libretro,代码行数:29,


示例3: set_fsdevice_hide_cbm_files

static int set_fsdevice_hide_cbm_files(int val, void *param){    if (val && !fsdevice_convert_p00_enabled[vice_ptr_to_int(param) - 8]) {        return -1;    }    fsdevice_hide_cbm_files_enabled[vice_ptr_to_int(param) - 8] = val;    return 0;}
开发者ID:AreaScout,项目名称:vice,代码行数:9,


示例4: UI_CALLBACK

static UI_CALLBACK(set_joystick_device_4){    int tmp;    if (!CHECK_MENUS) {        resources_set_int("JoyDevice4", vice_ptr_to_int(UI_MENU_CB_PARAM));        ui_update_menus();    } else {        resources_get_int("JoyDevice4", &tmp);        ui_menu_set_tick(w, tmp == vice_ptr_to_int(UI_MENU_CB_PARAM));    }}
开发者ID:AreaScout,项目名称:vice,代码行数:12,


示例5: UI_CALLBACK

/* unused ? */static UI_CALLBACK(set_joystick_device){    vsync_suspend_speed_eval();    if (!CHECK_MENUS) {        resources_set_int("JoyDevice1", vice_ptr_to_int(UI_MENU_CB_PARAM));        ui_update_menus();    } else {        int tmp;        resources_get_int("JoyDevice1", &tmp);        ui_menu_set_tick(w, tmp == vice_ptr_to_int(UI_MENU_CB_PARAM));    }}
开发者ID:AreaScout,项目名称:vice,代码行数:14,


示例6: _ui_menu_radio_helper

void _ui_menu_radio_helper(Widget w, ui_callback_data_t client_data, ui_callback_data_t call_data, const char *resource_name){    int current_value;    resources_get_int(resource_name, &current_value);    if (!call_data) {        if (current_value != vice_ptr_to_int(client_data)) {            resources_set_int(resource_name, vice_ptr_to_int(client_data));            ui_update_menus();        }    } else {        ui_menu_set_tick(w, current_value == vice_ptr_to_int(client_data));    }}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:15,


示例7: UI_CALLBACK

static UI_CALLBACK(select_user_keymap){    char *filename;    const char *resname;    ui_button_t button;    int kindex;    static char *last_dir;    uilib_file_filter_enum_t filter[] = { UILIB_FILTER_KEYMAP, UILIB_FILTER_ALL };    resources_get_int("KeymapIndex", &kindex);    kindex = (kindex & ~1) + vice_ptr_to_int(UI_MENU_CB_PARAM);    resname = machine_keymap_res_name_list[kindex];    vsync_suspend_speed_eval();    filename = ui_select_file(_("Read Keymap File"), NULL, 0, last_dir, filter, sizeof(filter) / sizeof(*filter), &button, 0, NULL, UI_FC_LOAD);    switch (button) {        case UI_BUTTON_OK:            resources_set_string(resname, filename);            lib_free(last_dir);            util_fname_split(filename, &last_dir, NULL);            break;        default:            /* Do nothing special.  */            break;    }    lib_free(filename);}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:28,


示例8: set_joy

static int set_joy(int v, void *param){    const int i = vice_ptr_to_int(param);    joy[i >> 5].direction[i & 0xf] = (int)v;    return 0;}
开发者ID:r-type,项目名称:vice-libretro,代码行数:7,


示例9: set_joystick_fire

static int set_joystick_fire(int value, void *param){    ULONG portstate;    int port_idx = vice_ptr_to_int(param);    int joy_dev = joystick_port_map[port_idx];    joy_arch_init();    if (joy_dev != JOYDEV_NONE) {        if (joy_dev >= JOYDEV_JOY0 && joy_dev <= JOYDEV_JOY3) {            portstate = ReadJoyPort(joy_dev - JOYDEV_JOY0);            if ((portstate & JP_TYPE_MASK) != JP_TYPE_GAMECTLR) {                if (value != JPF_BUTTON_RED) {                    ui_error(translate_text(IDMES_DEVICE_NOT_GAMEPAD));                    value = JPF_BUTTON_RED;                }            }        } else {            ui_error(translate_text(IDMES_NOT_MAPPED_TO_AMIGA_PORT));            return -1;        }    } else {        if (value != JPF_BUTTON_RED) {            ui_error(translate_text(IDMES_NOT_MAPPED_TO_AMIGA_PORT));            return -1;        }    }    joystick_fire[port_idx] = value;    return 0;}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:31,


示例10: set_keyset

static int set_keyset(int v, void *param){    const int i = vice_ptr_to_int(param);    keyset[i >> 5][i & 0xf] = (int)v;    return 0;}
开发者ID:r-type,项目名称:vice-libretro,代码行数:7,


示例11: set_video_standard

static int set_video_standard(const char *param, void *extra_param){    int value = vice_ptr_to_int(extra_param);    int vicii_model;    switch (machine_class) {        case VICE_MACHINE_C64SC:            resources_get_int("VICIIModel", &vicii_model);            switch (value) {                case MACHINE_SYNC_PAL:                default:                    if (vicii_model == VICII_MODEL_8562 || vicii_model == VICII_MODEL_8565) {                        return resources_set_int("VICIIModel", VICII_MODEL_8565);                    } else if (vicii_model == VICII_MODEL_6567R56A) {                        return resources_set_int("VICIIModel", VICII_MODEL_6569R1);                    } else {                        return resources_set_int("VICIIModel", VICII_MODEL_6569);                    }                    break;                case MACHINE_SYNC_NTSC:                    if (vicii_model == VICII_MODEL_8562 || vicii_model == VICII_MODEL_8565) {                        return resources_set_int("VICIIModel", VICII_MODEL_8562);                    } else {                        return resources_set_int("VICIIModel", VICII_MODEL_6567);                    }                    break;                case MACHINE_SYNC_NTSCOLD:                        return resources_set_int("VICIIModel", VICII_MODEL_6567R56A);                case MACHINE_SYNC_PALN:                        return resources_set_int("VICIIModel", VICII_MODEL_6572);            }        default:            return resources_set_int("MachineVideoStandard", value);    }}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:35,


示例12: UI_CALLBACK

static UI_CALLBACK(load_save_fliplist){    char *filename, *title;    int what = vice_ptr_to_int(UI_MENU_CB_PARAM);    ui_button_t button;    uilib_file_filter_enum_t filter[] = { UILIB_FILTER_FLIPLIST, UILIB_FILTER_ALL };    vsync_suspend_speed_eval();    title = util_concat(what ? _("Load ") : _("Save"), _("Flip list file"), NULL);    filename = ui_select_file(title, NULL, 0, load_save_fliplist_last_dir, filter, sizeof(filter) / sizeof(*filter), &button, 1, NULL, what ? UI_FC_LOAD : UI_FC_SAVE);    lib_free(title);    switch (button) {        case UI_BUTTON_OK:            if (what) {                if (fliplist_load_list(FLIPLIST_ALL_UNITS, filename, 0) == 0) {                    ui_message(_("Successfully read `%s'."), filename);                } else {                    ui_error(_("Error reading `%s'."), filename);                }            } else {                if (fliplist_save_list(FLIPLIST_ALL_UNITS, filename) == 0) {                    ui_message(_("Successfully wrote `%s'"), filename);                } else {                    ui_error(_("Error writing `%s'."), filename);                }            }            lib_free(load_save_fliplist_last_dir);            util_fname_split(filename, &load_save_fliplist_last_dir, NULL);            break;        default:            break;    }}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:33,


示例13: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(vsidui_tune_callback){    int command_or_tune = vice_ptr_to_int(param);    if (activated) {        int tune = sdl_vsid_current_tune;        if (command_or_tune == SDLUI_VSID_CMD_NEXT) {            ++tune;        } else if (command_or_tune == SDLUI_VSID_CMD_PREV) {            --tune;        } else {            tune = command_or_tune;        }        if ((tune < 1) || (tune > sdl_vsid_tunes)) {            return NULL;        }        if (tune != sdl_vsid_current_tune) {            sdl_vsid_current_tune = tune;            sdl_ui_menu_radio_helper(1, (ui_callback_data_t)int_to_void_ptr(tune), "PSIDTune");        }    } else {        if (command_or_tune == sdl_vsid_current_tune) {            return sdl_menu_text_tick;        } else if (command_or_tune > sdl_vsid_tunes && !(command_or_tune & SDLUI_VSID_CMD_MASK)) {            return "(N/A)";        }    }    return NULL;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:32,


示例14: UI_CALLBACK

static UI_CALLBACK(datasette_settings){    int what = vice_ptr_to_int(UI_MENU_CB_PARAM);    char *prompt, *title, *resource;    char buf[50];    ui_button_t button;    int current;    long res;    if (what) {        prompt = title = _("Datasette speed tuning");        resource = "DatasetteSpeedTuning";    } else {        prompt = title = _("Datasette zero gap delay");        resource = "DatasetteZeroGapDelay";    }    resources_get_int(resource, &current);    sprintf(buf, "%d", current);    button = ui_input_string(title, prompt, buf, 50);    switch (button) {        case UI_BUTTON_OK:            if (util_string_to_long(buf, NULL, 10, &res) != 0) {                ui_error(_("Invalid value: %s"), buf);                return;            }            resources_set_int(resource, (int)res);            break;        default:            break;    }}
开发者ID:AreaScout,项目名称:vice,代码行数:33,


示例15: set_printer_device

static int set_printer_device(int prn_dev, void *param){    if (prn_dev < 0 || prn_dev > 2) {        return -1;    }    printer_device[vice_ptr_to_int(param)] = (unsigned int)prn_dev;    return 0;}
开发者ID:Rakashazi,项目名称:emu-ex-plus-alpha,代码行数:9,


示例16: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(detach_cart_callback){    int m;    m = vice_ptr_to_int(param);    if (activated) {        cartridge_detach_image(m);    }    return NULL;}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:9,


示例17: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(attach_cart_callback){    char *title;    char *name = NULL;    if (activated) {        switch (vice_ptr_to_int(param)) {        case CARTRIDGE_VIC20_FP:            title = "Select " CARTRIDGE_VIC20_NAME_FP " image";            break;        case CARTRIDGE_VIC20_MEGACART:            title = "Select " CARTRIDGE_VIC20_NAME_MEGACART " image";            break;        case CARTRIDGE_VIC20_FINAL_EXPANSION:            title = "Select " CARTRIDGE_VIC20_NAME_FP " image";            break;        case CARTRIDGE_VIC20_DETECT:        case CARTRIDGE_VIC20_GENERIC:            title = "Select cartridge image";            break;        case CARTRIDGE_VIC20_16KB_2000:        case CARTRIDGE_VIC20_16KB_4000:        case CARTRIDGE_VIC20_16KB_6000:            title = "Select 4/8/16kB image";            break;        case CARTRIDGE_VIC20_8KB_A000:            title = "Select 4/8kB image";            break;        case CARTRIDGE_VIC20_4KB_B000:        default:            title = "Select 4kB image";            break;        }        name = sdl_ui_file_selection_dialog(title, FILEREQ_MODE_CHOOSE_FILE);        if (name != NULL) {            if (cartridge_attach_image(vice_ptr_to_int(param), name) < 0) {                ui_error("Cannot load cartridge image.");            }            lib_free(name);        }    }    return NULL;}
开发者ID:stuartcarnie,项目名称:vice-emu,代码行数:43,


示例18: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(select_cbm2_model_callback){    int model;    model = vice_ptr_to_int(param);    if (activated) {        cbm2model_set(model);    }    return NULL;}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:10,


示例19: set_joyB_autoCal

int set_joyB_autoCal(const char *value, void *extra_param){    joy[1].autocal = vice_ptr_to_int(extra_param);    if (joy[1].autocal) {        joy[1].start = TRUE;    }    return FALSE;}
开发者ID:r-type,项目名称:vice-libretro,代码行数:10,


示例20: UI_CALLBACK

static UI_CALLBACK(radio_SidModel){    int engine, model, selected;    selected = vice_ptr_to_int(UI_MENU_CB_PARAM);    if (!CHECK_MENUS) {        engine = selected >> 8;        model = selected & 0xff;        sid_set_engine_model(engine, model);        ui_update_menus();    } else {
开发者ID:AreaScout,项目名称:vice,代码行数:11,


示例21: cart_attach_cmdline

/* ---------------------------------------------------------------------*/int cart_attach_cmdline(const char *param, void *extra_param){    int type = vice_ptr_to_int(extra_param);    /* NULL param is used for +cart */    if (!param) {        cartridge_detach_image(-1);        return 0;    }    return cartridge_attach_image(type, param);}
开发者ID:kleopatra999,项目名称:VICE-2,代码行数:12,


示例22: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(c64_cart_flush_callback){    if (activated) {        int cartid = vice_ptr_to_int(param);        if (cartridge_flush_image(cartid) < 0) {            ui_error("Cannot save cartridge image.");        }    }    return NULL;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:11,


示例23: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(custom_SidModel_callback){    int engine, model, selected;    selected = vice_ptr_to_int(param);    if (activated) {        engine = selected >> 8;        model = selected & 0xff;        sid_set_engine_model(engine, model);    } else {
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:11,


示例24: joys_draw

static gboolean joys_draw(GtkWidget *w, GdkEvent *event, gpointer data){    int i;    int joystick_number = vice_ptr_to_int(data);    int num_app_shells = get_num_shells();    for (i = 0; i < num_app_shells; i++) {        joystick_status_widget *ds = &app_shells[i].joystick_status[joystick_number];        set_joy(ds->colors, i, joystick_number);    }    return 0;}
开发者ID:r-type,项目名称:vice-libretro,代码行数:12,


示例25: set_joystick_device

static int set_joystick_device(int val, void *param){    int port_idx = vice_ptr_to_int(param);    if (joy_arch_set_device(port_idx, val) < 0) {        return -1;    }    joystick_port_map[port_idx] = val;    return 0;}
开发者ID:markjreed,项目名称:vice-emu,代码行数:12,


示例26: set_printer_driver

static int set_printer_driver(const char *name, void *param){    driver_select_list_t *list;    list = driver_select_list;    if (list == NULL)        return -1;    do {        if (!strcmp(list->driver_select.drv_name, name)) {            util_string_set(&printer_driver[vice_ptr_to_int(param)], name);            memcpy(&driver_select[vice_ptr_to_int(param)], &(list->driver_select),                   sizeof(driver_select_t));            return 0;        }        list = list->next;    } while (list != NULL);    return -1;}
开发者ID:twinaphex,项目名称:vice-next,代码行数:21,


示例27: set_drive_extend_image_policy

static int set_drive_extend_image_policy(int val, void *param){    switch (val) {        case DRIVE_EXTEND_NEVER:        case DRIVE_EXTEND_ASK:        case DRIVE_EXTEND_ACCESS:            drive_context[vice_ptr_to_int(param)]->drive->extend_image_policy = val;            return 0;        default:            return -1;    }}
开发者ID:AreaScout,项目名称:vice,代码行数:12,



注:本文中的vice_ptr_to_int函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ video函数代码示例
C++ vibes_short_pulse函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。