• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ resources_set_int函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: UI_MENU_CALLBACK

static UI_MENU_CALLBACK(custom_Speed_callback)
{
    static char buf[20];
    char *value = NULL;
    int previous, new_value;

    resources_get_int("Speed", &previous);

    if (activated) {
        sprintf(buf, "%i", previous);
        value = sdl_ui_text_input_dialog("Enter custom maximum speed", buf);
        if (value) {
            new_value = strtol(value, NULL, 0);
            if (new_value != previous) {
                resources_set_int("Speed", new_value);
            }
            lib_free(value);
        }
    } else {
        if (previous != 0 && previous != 10 && previous != 25 &&
            previous != 50 && previous != 100 && previous != 200) {
            sprintf(buf, "%i%%", previous);
            return buf;
        }
    }
    return NULL;
}
开发者ID:AreaScout,项目名称:vice,代码行数:27,代码来源:menu_speed.c


示例2: superpet_io_dialog_proc

static INT_PTR CALLBACK superpet_io_dialog_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
    int type;

    switch (msg) {
    case WM_NOTIFY:
        if (((NMHDR FAR *)lparam)->code == (UINT)PSN_APPLY) {
            resources_set_int("SuperPET", (IsDlgButtonChecked(hwnd, IDC_TOGGLE_PET_SUPER_IO_ENABLE) == BST_CHECKED ? 1 : 0));
            SetWindowLongPtr(hwnd, DWLP_MSGRESULT, FALSE);
            return TRUE;
        }
        return FALSE;
    case WM_INITDIALOG:
        init_superpet_io_dialog(hwnd);
        return TRUE;
    case WM_COMMAND:
        type = LOWORD(wparam);
        switch (type) {
        case IDC_TOGGLE_PET_SUPER_IO_ENABLE:
            break;
        }
        return TRUE;
    }
    return FALSE;
}
开发者ID:r-type,项目名称:vice-libretro,代码行数:25,代码来源:uipetset.c


示例3: 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,代码来源:uidatasette.c


示例4: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(set_joy_device_callback)
{
    int port = (int)param >> 8;
    char *resource;

    switch (port) {
        case 1:
        default:
            resource = "JoyDevice1";
            break;
        case 2:
            resource = "JoyDevice2";
            break;
        case 3:
            resource = "JoyDevice3";
            break;
        case 4:
            resource = "JoyDevice4";
            break;
    }

    if (been_activated) {
        resources_set_int(resource, ((int)param & 0xff));
        ui_update_menus();
    } else {
        int value;

        resources_get_int(resource, &value);
        if (value == ((int)param & 0xff)) {
            *become_default = 1;
        }
    }

    return NULL;
}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:35,代码来源:uijoystick.c


示例5: mem_read_rom_snapshot_module

static int mem_read_rom_snapshot_module(snapshot_t *p)
{
    BYTE vmajor, vminor;
    snapshot_module_t *m;
    BYTE config;
    int trapfl;

    m = snapshot_module_open(p, SNAP_ROM_MODULE_NAME, &vmajor, &vminor);
    if (m == NULL) {
        return 0;       /* optional */
    }

    if (vmajor != VIC20ROM_DUMP_VER_MAJOR) {
        snapshot_module_close(m);
        return -1;
    }

    /* disable traps before loading the ROM */
    resources_get_int("VirtualDevices", &trapfl);
    resources_set_int("VirtualDevices", 0);

    /* old cart system ROMs (ignored) */
    SMR_B(m, &config);

    /* read kernal */
    SMR_BA(m, vic20memrom_kernal_rom, 0x2000);
    /* read basic */
    SMR_BA(m, vic20memrom_basic_rom, 0x2000);

    SMR_BA(m, vic20memrom_chargen_rom, 0x1000);

    vic20rom_kernal_checksum();
    vic20rom_basic_checksum();

    log_warning(vic20_snapshot_log,
                "Dumped Romset files and saved settings will "
                "represent\nthe state before loading the snapshot!");

    /* enable traps again when necessary */
    resources_set_int("VirtualDevices", trapfl);

    snapshot_module_close(m);

    mem_initialize_memory();

    return 0;
}
开发者ID:EdCornejo,项目名称:emu-ex-plus-alpha,代码行数:47,代码来源:vic20memsnapshot.c


示例6: petmem_set_conf_info

int petmem_set_conf_info(petinfo_t *pi)
{
    resources_set_int("RamSize", pi->ramSize);
    resources_set_int("IOSize", pi->IOSize);
    resources_set_int("Crtc", pi->crtc);
    resources_set_int("VideoSize", pi->video);
    resources_set_int("Ram9", pi->ramsel9);
    resources_set_int("RamA", pi->ramselA);
    resources_set_int("EoiBlank", pi->eoiblank);
    resources_set_int("SuperPET", pi->superpet);
    resources_set_int("KeyboardType", pi->kbd_type);
    return 0;
}
开发者ID:EdCornejo,项目名称:emu-ex-plus-alpha,代码行数:13,代码来源:petmodel.c


示例7: expert_common_attach

static int expert_common_attach(void)
{
    DBG(("EXPERT: common attach\n"));
    if (resources_set_int("ExpertCartridgeEnabled", 1) < 0) {
        return -1;
    }
    if (expert_enabled) {
        /* Set default mode
        here we want to load a previously saved image. we use ON as
        default here.
        */
        resources_set_int("ExpertCartridgeMode", EXPERT_MODE_ON);
        DBG(("EXPERT: common attach ok\n"));
        return 0;
    }
    return -1;
}
开发者ID:SMTDDR,项目名称:droidsound,代码行数:17,代码来源:expert.c


示例8: expert_enable

int expert_enable(void)
{
    DBG(("EXPERT: enable\n"));
    if (resources_set_int("ExpertCartridgeEnabled", 1) < 0) {
        return -1;
    }
    return 0;
}
开发者ID:SMTDDR,项目名称:droidsound,代码行数:8,代码来源:expert.c


示例9: soundmovie_start

int soundmovie_start(soundmovie_funcs_t *f)
{
    funcs = f;

    resources_set_string("SoundRecordDeviceName", "soundmovie");
    resources_set_int("Sound", 1);
    return 0;
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:8,代码来源:soundmovie.c


示例10: end_ds12c887rtc_dialog

static void end_ds12c887rtc_dialog(HWND hwnd)
{
    int *ui_ds12c887rtc_base;

    if (machine_class == VICE_MACHINE_VIC20) {
        ui_ds12c887rtc_base = ui_vic20_ds12c887rtc_base;
    } else if (machine_class == VICE_MACHINE_C128) {
        ui_ds12c887rtc_base = ui_c128_ds12c887rtc_base;
    } else {
        ui_ds12c887rtc_base = ui_c64_ds12c887rtc_base;
    }

    resources_set_int("DS12C887RTC", (IsDlgButtonChecked(hwnd, IDC_DS12C887RTC_ENABLE) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("DS12C887RTCRunMode", (IsDlgButtonChecked(hwnd, IDC_DS12C887RTC_RUNMODE) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("DS12C887RTCSave", (IsDlgButtonChecked(hwnd, IDC_DS12C887RTC_SAVE) == BST_CHECKED ? 1 : 0 ));
    resources_set_int("DS12C887RTCbase", ui_ds12c887rtc_base[SendMessage(GetDlgItem(hwnd, IDC_DS12C887RTC_BASE), CB_GETCURSEL, 0, 0)]);
}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:17,代码来源:uids12c887rtc.c


示例11: memory_dialog_proc

static INT_PTR CALLBACK memory_dialog_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
    int type;

    switch (msg) {
        case WM_INITDIALOG:
            init_memory_dialog(hwnd);
            return TRUE;
        case WM_COMMAND:
            type = LOWORD(wparam);
            switch (type) {
                case IDC_SELECT_CBMII_MEM_128:
                    resources_set_int("RamSize", 128);
                    break;
                case IDC_SELECT_CBMII_MEM_256:
                    resources_set_int("RamSize", 256);
                    break;
                case IDC_SELECT_CBMII_MEM_512:
                    resources_set_int("RamSize", 512);
                    break;
                case IDC_SELECT_CBMII_MEM_1024:
                    resources_set_int("RamSize", 1024);
                    break;
                case IDC_TOGGLE_CBMII_RAM08:
                    resources_toggle("Ram08", NULL);
                    break;
                case IDC_TOGGLE_CBMII_RAM1:
                    resources_toggle("Ram1", NULL);
                    break;
                case IDC_TOGGLE_CBMII_RAM2:
                    resources_toggle("Ram2", NULL);
                    break;
                case IDC_TOGGLE_CBMII_RAM4:
                    resources_toggle("Ram4", NULL);
                    break;
                case IDC_TOGGLE_CBMII_RAM6:
                    resources_toggle("Ram6", NULL);
                    break;
                case IDC_TOGGLE_CBMII_RAMC:
                    resources_toggle("RamC", NULL);
                    break;
            }
            return TRUE;
    }
    return FALSE;
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:46,代码来源:uicbm2set.c


示例12: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(radio_renderfilter_callback)
{
    int i;
    int video_index;
    int render_index;
    int crtemu;
    int scale2x;

    i = (int)param;
    video_index = i >> 4;
    render_index = i & 0xf;

    if (been_activated) {
        switch (render_index) {
             default:
             case 0:
                 crtemu = 0;
                 scale2x = 0;
                 break;
             case 1:
                 crtemu = 1;
                 scale2x = 0;
                 break;
             case 2:
                 crtemu = 0;
                 scale2x = 1;
                 break;
        }
        resources_set_int("PALEmulation", crtemu);
        if (video_item[video_index].scale2x_res != NULL) {
            resources_set_int(video_item[video_index].scale2x_res, scale2x);
        }
        *become_default = 1;
    } else {
        resources_get_int("PALEmulation", &crtemu);
        if (video_item[video_index].scale2x_res != NULL) {
            resources_get_int(video_item[video_index].scale2x_res, &scale2x);
        } else {
            scale2x = 0;
        }
        if (render_index == (crtemu * 2) + scale2x) {
            *become_default = 1;
        }
    }
    return NULL;
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:46,代码来源:uivideo.c


示例13: 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;

    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);
    }
    return 0;
}
开发者ID:EdCornejo,项目名称:emu-ex-plus-alpha,代码行数:32,代码来源:scpu64-cmdline-options.c


示例14: dialog_proc

static INT_PTR CALLBACK dialog_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
    int type;

    switch (msg) {
        case WM_INITDIALOG:
            init_dialog(hwnd);
            return TRUE;
        case WM_COMMAND:
            type = LOWORD(wparam);
            switch (type) {
                case IDC_SELECT_CBMII_610:
                    cbm2_set_model("610", NULL);
                    break;
                case IDC_SELECT_CBMII_620:
                    cbm2_set_model("620", NULL);
                    break;
                case IDC_SELECT_CBMII_620P:
                    cbm2_set_model("620+", NULL);
                    break;
                case IDC_SELECT_CBMII_710:
                    cbm2_set_model("710", NULL);
                    break;
                case IDC_SELECT_CBMII_720:
                    cbm2_set_model("720", NULL);
                    break;
                case IDC_SELECT_CBMII_720P:
                    cbm2_set_model("720+", NULL);
                    break;

                case IDC_SELECT_CBMII_HW0:
                    resources_set_int("ModelLine", 0);
                    break;
                case IDC_SELECT_CBMII_HW1:
                    resources_set_int("ModelLine", 1);
                    break;
                case IDC_SELECT_CBMII_HW2:
                    resources_set_int("ModelLine", 2);
                    break;
            }
            return TRUE;
    }
    return FALSE;
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:44,代码来源:uicbm2set.c


示例15: dialog_new_pal_proc

static BOOL CALLBACK dialog_new_pal_proc(HWND hwnd, UINT msg,
                                       WPARAM wparam, LPARAM lparam)
{
    int type, ival;
    float tf;
    TCHAR s[100];
    extern int querynewpalette;

    switch (msg) {
      case WM_NOTIFY:
        if (((NMHDR FAR *)lparam)->code == PSN_APPLY) {
            GetDlgItemText(hwnd, IDC_VIDEO_NEW_PAL_TINT, s, 100);
            _stscanf(s, TEXT("%f"), &tf);
            ival = (int)(tf * 1000.0 + 0.5);
            resources_set_int("ColorTint", ival);
            GetDlgItemText(hwnd, IDC_VIDEO_NEW_PAL_PHASE, s, 100);
            _stscanf(s, TEXT("%f"), &tf);
            ival = (int)(tf * 1000.0 + 0.5);
            resources_set_int("PALOddLinePhase", ival);
            GetDlgItemText(hwnd, IDC_VIDEO_NEW_PAL_OFFSET, s, 100);
            _stscanf(s, TEXT("%f"), &tf);
            ival = (int)(tf * 1000.0 + 0.5);
            resources_set_int("PALOddLineOffset", ival);
            querynewpalette = 1;
            SetWindowLong(hwnd, DWL_MSGRESULT, FALSE);
            return TRUE;
        }
        return FALSE;
      case WM_INITDIALOG:
        init_new_pal_dialog(hwnd);
        return TRUE;
      case WM_COMMAND:
        type = LOWORD(wparam);
        switch (type) {
          case IDC_VIDEO_NEW_PAL_TINT:
          case IDC_VIDEO_NEW_PAL_PHASE:
          case IDC_VIDEO_NEW_PAL_OFFSET:
            break;
        }
        return TRUE;
    }
    return FALSE;
}
开发者ID:martinpiper,项目名称:VICE,代码行数:43,代码来源:uivideo.c


示例16: dialog_color_proc

static BOOL CALLBACK dialog_color_proc(HWND hwnd, UINT msg,
                                       WPARAM wparam, LPARAM lparam)
{
    int type, ival;
    float tf;
    TCHAR s[100];
    extern int querynewpalette;

    switch (msg) {
      case WM_NOTIFY:
        if (((NMHDR FAR *)lparam)->code == (UINT)PSN_APPLY) {
            GetDlgItemText(hwnd, IDC_VIDEO_COLORS_SAT, s, 100);
            _stscanf(s, TEXT("%f"), &tf);
            ival = (int)(tf * 1000.0 + 0.5);
            resources_set_int("ColorSaturation", ival);
            GetDlgItemText(hwnd, IDC_VIDEO_COLORS_CON, s, 100);
            _stscanf(s, TEXT("%f"), &tf);
            ival = (int)(tf * 1000.0 + 0.5);
            resources_set_int("ColorContrast", ival);
            GetDlgItemText(hwnd, IDC_VIDEO_COLORS_BRI, s, 100);
            _stscanf(s, TEXT("%f"), &tf);
            ival = (int)(tf * 1000.0 + 0.5);
            resources_set_int("ColorBrightness", ival);
            querynewpalette = 1;
            SetWindowLong(hwnd, DWL_MSGRESULT, FALSE);
            return TRUE;
        }
        return FALSE;
      case WM_INITDIALOG:
        init_color_dialog(hwnd);
        return TRUE;
      case WM_COMMAND:
        type = LOWORD(wparam);
        switch (type) {
          case IDC_VIDEO_COLORS_SAT:
          case IDC_VIDEO_COLORS_CON:
          case IDC_VIDEO_COLORS_BRI:
            break;
        }
        return TRUE;
    }
    return FALSE;
}
开发者ID:martinpiper,项目名称:VICE,代码行数:43,代码来源:uivideo.c


示例17: end_functionrom_dialog

static void end_functionrom_dialog(HWND hwnd)
{
    char name[MAX_PATH];
    TCHAR st_name[MAX_PATH];

    resources_set_int("InternalFunctionROM", (IsDlgButtonChecked(hwnd,
                      IDC_C128_FUNCTIONROM_INTERNAL) == BST_CHECKED ? 1 : 0 ));
    GetDlgItemText(hwnd, IDC_C128_FUNCTIONROM_INTERNAL_NAME,
                   st_name, MAX_PATH);
    system_wcstombs(name, st_name, MAX_PATH);
    resources_set_string("InternalFunctionName", name);

    resources_set_int("ExternalFunctionROM", (IsDlgButtonChecked(hwnd,
                        IDC_C128_FUNCTIONROM_EXTERNAL)
                        == BST_CHECKED ? 1 : 0 ));
    GetDlgItemText(hwnd, IDC_C128_FUNCTIONROM_EXTERNAL_NAME,
                   st_name, MAX_PATH);
    system_wcstombs(name, st_name, MAX_PATH);
    resources_set_string("ExternalFunctionName", name);
}
开发者ID:martinpiper,项目名称:VICE,代码行数:20,代码来源:uic128.c


示例18: end_magicvoice_dialog

static void end_magicvoice_dialog(HWND hwnd)
{
    TCHAR st[MAX_PATH];
    char s[MAX_PATH];

    resources_set_int("MagicVoiceCartridgeEnabled", (IsDlgButtonChecked(hwnd, IDC_MAGICVOICE_ENABLE) == BST_CHECKED ? 1 : 0 ));

    GetDlgItemText(hwnd, IDC_MAGICVOICE_FILE, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);
    resources_set_string("MagicVoiceImage", s);
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:11,代码来源:uimagicvoice.c


示例19: end_romset_dialog

static void end_romset_dialog(HWND hwnd)
{
    TCHAR st[MAX_PATH];
    char s[MAX_PATH];

    if (IsDlgButtonChecked(hwnd, IDC_ROMSET_SELECT_ARCHIVE) == BST_CHECKED) {
        resources_set_int("RomsetSourceFile", 0);
    }
    if (IsDlgButtonChecked(hwnd, IDC_ROMSET_SELECT_FILE) == BST_CHECKED) {
        resources_set_int("RomsetSourceFile", 1);
    }

    GetDlgItemText(hwnd, IDC_ROMSET_ARCHIVE_NAME, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);
    resources_set_string("RomsetArchiveName", s);

    GetDlgItemText(hwnd, IDC_ROMSET_FILE_NAME, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);
    resources_set_string("RomsetFileName", s);
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:20,代码来源:uirom.c


示例20: end_v364speech_dialog

static void end_v364speech_dialog(HWND hwnd)
{
    TCHAR st[MAX_PATH];
    char s[MAX_PATH];

    resources_set_int("SpeechEnabled", (IsDlgButtonChecked(hwnd, IDC_V364SPEECH_ENABLE) == BST_CHECKED ? 1 : 0 ));

    GetDlgItemText(hwnd, IDC_V364SPEECH_FILE, st, MAX_PATH);
    system_wcstombs(s, st, MAX_PATH);
    resources_set_string("SpeechImage", s);
}
开发者ID:AreaScout,项目名称:vice,代码行数:11,代码来源:uiv364speech.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ resources_set_string函数代码示例发布时间:2022-05-30
下一篇:
C++ resources_register_string函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap