本文整理汇总了C++中snapshot_module_open函数的典型用法代码示例。如果您正苦于以下问题:C++ snapshot_module_open函数的具体用法?C++ snapshot_module_open怎么用?C++ snapshot_module_open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了snapshot_module_open函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paperclip64_read_snapshot
static int paperclip64_read_snapshot(struct snapshot_s *s, int port)
{
BYTE major_version, minor_version;
snapshot_module_t *m;
m = snapshot_module_open(s, snap_module_name, &major_version, &minor_version);
if (m == NULL) {
return -1;
}
/* Do not accept versions higher than current */
if (major_version > SNAP_MAJOR || minor_version > SNAP_MINOR) {
snapshot_set_error(SNAPSHOT_MODULE_HIGHER_VERSION);
goto fail;
}
if (0
|| SMR_DW_INT(m, &counter) < 0
|| SMR_B(m, &command) < 0
|| SMR_B_INT(m, &state) < 0) {
goto fail;
}
return snapshot_module_close(m);
fail:
snapshot_module_close(m);
return -1;
}
示例2: magicdesk_snapshot_read_module
int magicdesk_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_B(m, ®val) < 0)
|| (SMR_BA(m, roml_banks, 0x2000 * MAXBANKS) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
if (magicdesk_common_attach() == -1) {
return -1;
}
magicdesk_io1_store(0xde00, regval);
return 0;
}
示例3: sfx_soundsampler_snapshot_read_module
int sfx_soundsampler_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0 || (SMR_B(m, &sfx_soundsampler_sound_data) < 0)) {
snapshot_module_close(m);
return -1;
}
if (!sfx_soundsampler_sound_chip.chip_enabled) {
set_sfx_soundsampler_enabled(1, NULL);
}
sound_store(sfx_soundsampler_sound_chip_offset, sfx_soundsampler_sound_data, 0);
snapshot_module_close(m);
return 0;
}
示例4: se5_snapshot_read_module
int se5_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_BA(m, roml_banks, SE5_CART_SIZE) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
return se5_common_attach();
}
示例5: ds12c887rtc_snapshot_read_module
int ds12c887rtc_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
int temp_ds12c887rtc_address;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
/* FIXME: Implement the RTC snapshot part */
if (0
|| (SMR_DW_INT(m, &temp_ds12c887rtc_address) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
/* HACK set address to an invalid value, then use the function */
ds12c887rtc_base_address = -1;
set_ds12c887rtc_base(temp_ds12c887rtc_address, NULL);
return ds12c887rtc_enable();
}
示例6: dtlbasic_read_snapshot
static int dtlbasic_read_snapshot(struct snapshot_s *s)
{
BYTE major_version, minor_version;
snapshot_module_t *m;
/* enable device */
set_dtlbasic_dongle_enabled(1, NULL);
m = snapshot_module_open(s, snap_module_name, &major_version, &minor_version);
if (m == NULL) {
return -1;
}
/* Do not accept versions higher than current */
if (major_version > SNAP_MAJOR || minor_version > SNAP_MINOR) {
snapshot_set_error(SNAPSHOT_MODULE_HIGHER_VERSION);
goto fail;
}
if (0
|| SMR_DW_INT(m, &dtlbasic_counter) < 0
|| SMR_DW_INT(m, &write_status) < 0
|| SMR_DW_INT(m, &sense_status) < 0
|| SMR_DW_INT(m, &dtlbasic_state) < 0) {
goto fail;
}
return snapshot_module_close(m);
fail:
snapshot_module_close(m);
return -1;
}
示例7: userport_rtc_read_snapshot_module
static int userport_rtc_read_snapshot_module(snapshot_t *s)
{
BYTE major_version, minor_version;
snapshot_module_t *m;
/* enable device */
set_userport_rtc_enabled(1, NULL);
m = snapshot_module_open(s, snap_module_name, &major_version, &minor_version);
if (m == NULL) {
return -1;
}
/* Do not accept versions higher than current */
if (major_version > SNAP_MAJOR || minor_version > SNAP_MINOR) {
snapshot_set_error(SNAPSHOT_MODULE_HIGHER_VERSION);
goto fail;
}
if (SMR_B_INT(m, &read_line_active) < 0) {
goto fail;
}
snapshot_module_close(m);
return rtc58321a_read_snapshot(rtc58321a_context, s);
fail:
snapshot_module_close(m);
return -1;
}
示例8: freezemachine_snapshot_read_module
int freezemachine_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_B_INT(m, &rom_A14) < 0)
|| (SMR_B_INT(m, &roml_toggle) < 0)
|| (SMR_B_INT(m, &allow_toggle) < 0)
|| (SMR_BA(m, roml_banks, 0x4000) < 0)
|| (SMR_BA(m, romh_banks, 0x4000) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
return freezemachine_common_attach();
}
示例9: mmc_snapshot_read_module
int mmc_snapshot_read_module(snapshot_t *s)
{
return -1;
#if 0
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
return 0;
#endif
}
示例10: userport_digimax_read_snapshot_module
static int userport_digimax_read_snapshot_module(snapshot_t *s)
{
BYTE major_version, minor_version;
snapshot_module_t *m;
/* enable device */
set_digimax_enabled(1, NULL);
m = snapshot_module_open(s, snap_module_name, &major_version, &minor_version);
if (m == NULL) {
return -1;
}
/* Do not accept versions higher than current */
if (major_version > SNAP_MAJOR || minor_version > SNAP_MINOR) {
snapshot_set_error(SNAPSHOT_MODULE_HIGHER_VERSION);
goto fail;
}
if (0
|| (SMR_B(m, &userport_digimax_address) < 0)
|| (SMR_BA(m, digimax_sound_data, 4) < 0)
|| (SMR_B(m, &snd.voice0) < 0)
|| (SMR_B(m, &snd.voice1) < 0)
|| (SMR_B(m, &snd.voice2) < 0)
|| (SMR_B(m, &snd.voice3) < 0)) {
goto fail;
}
return snapshot_module_close(m);
fail:
snapshot_module_close(m);
return -1;
}
示例11: actionreplay2_snapshot_read_module
int actionreplay2_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_B_INT(m, &ar_enabled) < 0)
|| (SMR_DW_INT(m, &ar_cap_enable) < 0)
|| (SMR_DW_INT(m, &ar_cap_disable) < 0)
|| (SMR_BA(m, roml_banks, 0x4000) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
return actionreplay2_common_attach();
}
示例12: kcs_snapshot_read_module
int kcs_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_B_INT(m, &freeze_flag) < 0)
|| (SMR_B_INT(m, &config) < 0)
|| (SMR_BA(m, roml_banks, 0x2000) < 0)
|| (SMR_BA(m, romh_banks, 0x2000) < 0)
|| (SMR_BA(m, export_ram0, 0x2000) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
return kcs_common_attach();
}
示例13: dinamic_snapshot_read_module
int dinamic_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_B_INT(m, &currbank) < 0)
|| (SMR_BA(m, roml_banks, 0x2000 * 16) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
return dinamic_common_attach();
}
示例14: freezeframe_snapshot_read_module
int freezeframe_snapshot_read_module(snapshot_t *s)
{
BYTE vmajor, vminor;
snapshot_module_t *m;
m = snapshot_module_open(s, SNAP_MODULE_NAME, &vmajor, &vminor);
if (m == NULL) {
return -1;
}
if ((vmajor != CART_DUMP_VER_MAJOR) || (vminor != CART_DUMP_VER_MINOR)) {
snapshot_module_close(m);
return -1;
}
if (0
|| (SMR_BA(m, roml_banks, FREEZE_FRAME_CART_SIZE) < 0)) {
snapshot_module_close(m);
return -1;
}
snapshot_module_close(m);
memcpy(romh_banks, roml_banks, FREEZE_FRAME_CART_SIZE);
return freezeframe_common_attach();
}
示例15: mem_read_rom_snapshot_module
static int mem_read_rom_snapshot_module(snapshot_t *s)
{
BYTE major_version, minor_version;
snapshot_module_t *m;
int trapfl;
/* Main memory module. */
m = snapshot_module_open(s, snap_rom_module_name,
&major_version, &minor_version);
/* This module is optional. */
if (m == NULL)
return 0;
/* disable traps before loading the ROM */
resources_get_int("VirtualDevices", &trapfl);
resources_set_int("VirtualDevices", 0);
if (major_version > SNAP_ROM_MAJOR || minor_version > SNAP_ROM_MINOR) {
log_error(c128_snapshot_log,
"MEM: Snapshot module version (%d.%d) newer than %d.%d.",
major_version, minor_version,
SNAP_ROM_MAJOR, SNAP_ROM_MINOR);
goto fail;
}
if (0
|| SMR_BA(m, c128memrom_kernal_rom, C128_KERNAL_ROM_SIZE) < 0
|| SMR_BA(m, c128memrom_basic_rom, C128_BASIC_ROM_SIZE) < 0
|| SMR_BA(m, c128memrom_basic_rom + C128_BASIC_ROM_SIZE,
C128_EDITOR_ROM_SIZE) < 0
|| SMR_BA(m, mem_chargen_rom, C128_CHARGEN_ROM_SIZE) < 0)
goto fail;
log_warning(c128_snapshot_log,"Dumped Romset files and saved settings will " "represent\nthe state before loading the snapshot!");
memcpy(c128memrom_kernal_trap_rom, c128memrom_kernal_rom,
C128_KERNAL_ROM_SIZE);
c128rom_basic_checksum();
c128rom_kernal_checksum();
/* enable traps again when necessary */
resources_set_int("VirtualDevices", trapfl);
/* to get all the checkmarks right */
ui_update_menus();
return 0;
fail:
/* enable traps again when necessary */
resources_set_int("VirtualDevices", trapfl);
if (m != NULL)
snapshot_module_close(m);
return -1;
}