本文整理汇总了C++中resources_set_int函数的典型用法代码示例。如果您正苦于以下问题:C++ resources_set_int函数的具体用法?C++ resources_set_int怎么用?C++ resources_set_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resources_set_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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, ¤t);
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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: expert_enable
int expert_enable(void)
{
DBG(("EXPERT: enable\n"));
if (resources_set_int("ExpertCartridgeEnabled", 1) < 0) {
return -1;
}
return 0;
}
示例9: soundmovie_start
int soundmovie_start(soundmovie_funcs_t *f)
{
funcs = f;
resources_set_string("SoundRecordDeviceName", "soundmovie");
resources_set_int("Sound", 1);
return 0;
}
示例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)]);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}