diff --git a/ChangeLog b/ChangeLog index 27c7281c6..df956d4c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,8 @@ Changelog: - Rewritten mappers : All. - Rewritten WRAM, VRAM, PRGROM, CHROM and Nametebles management. - Rewritten FDS support. - Furthermore, an option has been added to select the mode for write operations. Until now, all writes were stored on an external file (to preserve the integrity of the disk image), now it's possible to choose to write them directly to the FDS/QD file (making it portable to other emulators as well). + * Furthermore, an option has been added to select the mode for write operations. Until now, all writes were stored on an external file (diff file) to preserve the integrity of the disk image, now it's possible to choose to write them directly to the FDS/QD file (making it portable to other emulators as well). + * Changed the format of the diff file, now I use the IPS format (which can always be applied to the original image). - Rewritten the format and management of save states. WARNING save states of version 0.110 or earlier are no longer compatible. - Added support to Quick Disk format. @@ -11,7 +12,9 @@ Changelog: It's possible to choose between three values: * 0x00 * 0xFF (default) - * Randomize. + * Randomize +- Added a screen icon that shows when fast forward is active. +- Added the possibility to set default values for PPU overclocking to be applied for all roms in addition to the per-game ones already used. - Added Arabic translation (thx to Chipsum). - Added Polish translation (thx to elektronicznypank). - Added full support for the NES 2.0 header format. diff --git a/src/core/common.h b/src/core/common.h index 537cef931..650d53a8b 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -54,6 +54,7 @@ enum exit_type { EXIT_OK, EXIT_ERROR }; enum lower_value { LOWER, UPPER }; enum machine_mode { AUTO, NTSC, PAL, DENDY, DEFAULT = 255 }; enum initial_ram_value_type { IRV_0X00, IRV_0XFF, IRV_RANDOM }; +enum overcan_type { PERGAME_OFF, PERGAME_ON, PERGAME_DEFAULT }; enum console_type { REGULAR_NES, VS_SYSTEM, diff --git a/src/core/conf.h b/src/core/conf.h index 49ebd02d1..47d0521bf 100644 --- a/src/core/conf.h +++ b/src/core/conf.h @@ -22,6 +22,14 @@ #include "apu.h" #include "input.h" +typedef struct _config_overclock { + BYTE enabled; + BYTE dmc_control_disabled; + struct config_overclock_extra_slines { + WORD vblank; + WORD postrender; + } extra_slines; +} _config_overclock; typedef struct _last_geometry { int x, y; int w, h; @@ -85,11 +93,7 @@ typedef struct _config { BYTE bck_pause; WORD language; int dipswitch; - BYTE ppu_overclock; - BYTE ppu_overclock_dmc_control_disabled; BYTE ppu_alignment; - WORD extra_vb_scanlines; - WORD extra_pr_scanlines; BYTE save_battery_ram_file; BYTE multiple_instances; BYTE nsf_player_effect; @@ -104,6 +108,12 @@ typedef struct _config { _config_input input; _config_apu apu; + _config_overclock *oclock; + + struct _config_overclock_all { + _config_overclock def; + _config_overclock pergame; + } oclock_all; #if defined (WITH_FFMPEG) struct _config_recording { BYTE last_type; diff --git a/src/core/cpu_inline.h b/src/core/cpu_inline.h index 684a3c47f..9642e3e71 100644 --- a/src/core/cpu_inline.h +++ b/src/core/cpu_inline.h @@ -1518,7 +1518,7 @@ INLINE static void apu_wr_reg(BYTE nidx, WORD address, BYTE value) { r4011.cycles = r4011.frames = 0; r4011.value = value; - if (!nsf.enabled && cfg->ppu_overclock && !cfg->ppu_overclock_dmc_control_disabled && value) { + if (!nsf.enabled && (cfg->oclock->enabled == PERGAME_ON) && !cfg->oclock->dmc_control_disabled && value) { nes[nidx].p.overclock.DMC_in_use = TRUE; nes[nidx].p.ppu_sclines.total = machine.total_lines; nes[nidx].p.ppu_sclines.vint = machine.vint_lines; @@ -1529,7 +1529,7 @@ INLINE static void apu_wr_reg(BYTE nidx, WORD address, BYTE value) { if (address == 0x4012) { DMC.address_start = (value << 6) | 0xC000; - if (!nsf.enabled && cfg->ppu_overclock && !cfg->ppu_overclock_dmc_control_disabled && value) { + if (!nsf.enabled && (cfg->oclock->enabled == PERGAME_ON) && !cfg->oclock->dmc_control_disabled && value) { nes[nidx].p.overclock.DMC_in_use = FALSE; ppu_overclock_update() ppu_overclock_control() @@ -1540,7 +1540,7 @@ INLINE static void apu_wr_reg(BYTE nidx, WORD address, BYTE value) { /* sample length */ DMC.length = (value << 4) | 0x01; - if (!nsf.enabled && cfg->ppu_overclock && !cfg->ppu_overclock_dmc_control_disabled && value) { + if (!nsf.enabled && (cfg->oclock->enabled == PERGAME_ON) && !cfg->oclock->dmc_control_disabled && value) { nes[nidx].p.overclock.DMC_in_use = FALSE; ppu_overclock_update() ppu_overclock_control() diff --git a/src/core/emu.c b/src/core/emu.c index 6900face0..6f48744d1 100644 --- a/src/core/emu.c +++ b/src/core/emu.c @@ -530,8 +530,6 @@ BYTE emu_turn_on(void) { info.lag_frame.totals = 0; info.lag_frame.consecutive = 0; - cfg->extra_vb_scanlines = cfg->extra_pr_scanlines = 0; - vs_system.watchdog.next = vs_system_wd_next() info.r2002_jump_first_vblank = FALSE; diff --git a/src/core/fps.c b/src/core/fps.c index afae85091..3f0fea0c2 100644 --- a/src/core/fps.c +++ b/src/core/fps.c @@ -21,6 +21,7 @@ #include "clock.h" #include "conf.h" #include "nes.h" +#include "gui.h" #include "video/gfx_thread.h" #define ff_estimated_ms()\ @@ -67,6 +68,7 @@ void fps_fast_forward_start(void) { ppu_draw_screen_pause(); fps.fast_forward = TRUE; fps_fast_forward_estimated_ms(); + gui_update(); } void fps_fast_forward_stop(void) { if (!fps.fast_forward) { @@ -75,6 +77,7 @@ void fps_fast_forward_stop(void) { fps.fast_forward = FALSE; fps_fast_forward_estimated_ms(); ppu_draw_screen_continue(); + gui_update(); } void fps_max_speed_estimated_ms(void) { @@ -93,6 +96,7 @@ void fps_max_speed_start(void) { ppu_draw_screen_pause(); fps.max_speed = TRUE; fps_max_speed_estimated_ms(); + gui_update(); } void fps_max_speed_stop(void) { if (!fps.max_speed) { @@ -100,6 +104,7 @@ void fps_max_speed_stop(void) { } fps.max_speed = FALSE; fps_max_speed_estimated_ms(); + gui_update(); ppu_draw_screen_continue(); } diff --git a/src/core/mappers/MMC1.c b/src/core/mappers/MMC1.c index c179a02cd..47468b47f 100644 --- a/src/core/mappers/MMC1.c +++ b/src/core/mappers/MMC1.c @@ -142,8 +142,8 @@ void wram_swap_MMC1_base(WORD address, WORD value) { // older boards with older MMC1's, while the R bit was only introduced later. But because the E bit wasn't // confirmed by the homebrew community until October 2010[4], emulators tend not to implement it. // -// !!!! : Se Lascio questo controllo attivo "Witch n' Wiz (World) (Digital Release) (Aftermarket) (Unl).nes" ha le -// schermate sporche dopo la selezione dello slot di salvataggio +// !!!! : Se Lascio questo controllo attivo "Witch n' Wiz (World) (Digital Release) (Aftermarket) (Unl).nes" ha le +// schermate sporche dopo la selezione dello slot di salvataggio // const BYTE wram_enabled = mmc1tmp.type == MMC1B // ? (info.mapper.submapper == 0 // ? (mmc1.reg[3] | (mmc1.reg[1] | mmc1.reg[2])) & 0x10 ? FALSE : TRUE diff --git a/src/core/mappers/mapper_547.c b/src/core/mappers/mapper_547.c index a540d1a92..6c3f864c0 100644 --- a/src/core/mappers/mapper_547.c +++ b/src/core/mappers/mapper_547.c @@ -230,7 +230,7 @@ INLINE static void wram_fix_547(void) { wram_swap_547(0x7000, m547.reg[1]); } INLINE static void wram_swap_547(WORD address, WORD value) { - memmap_auto_4k(0, MMCPU(address), (value & 0x01) | ((value & 0x80) >> 2)); + memmap_auto_4k(0, MMCPU(address), ((value & 0x08) >> 2) | (value & 0x01)); } INLINE static void mirroring_fix_547(void) { if (m547.reg[10] & 0x02) { diff --git a/src/core/ppu.c b/src/core/ppu.c index d97b5c4ef..8159283f3 100644 --- a/src/core/ppu.c +++ b/src/core/ppu.c @@ -1086,9 +1086,9 @@ void ppu_overclock(BYTE nidx, BYTE reset_dmc_in_use) { nes[nidx].p.overclock.sclines.vb = 0; nes[nidx].p.overclock.sclines.pr = 0; - if (cfg->ppu_overclock) { - nes[nidx].p.overclock.sclines.vb = cfg->extra_vb_scanlines; - nes[nidx].p.overclock.sclines.pr = cfg->extra_pr_scanlines; + if (cfg->oclock && (cfg->oclock->enabled == PERGAME_ON)) { + nes[nidx].p.overclock.sclines.vb = cfg->oclock->extra_slines.vblank; + nes[nidx].p.overclock.sclines.pr = cfg->oclock->extra_slines.postrender; } nes[nidx].p.overclock.sclines.total = nes[nidx].p.overclock.sclines.vb + nes[nidx].p.overclock.sclines.pr; diff --git a/src/gui/designer/pics/overlay_fastforward_gray.png b/src/gui/designer/pics/overlay_fastforward_gray.png new file mode 100644 index 000000000..ba80bee9a Binary files /dev/null and b/src/gui/designer/pics/overlay_fastforward_gray.png differ diff --git a/src/gui/designer/resources.qrc b/src/gui/designer/resources.qrc index 1e7675cf2..434dc7257 100644 --- a/src/gui/designer/resources.qrc +++ b/src/gui/designer/resources.qrc @@ -225,6 +225,7 @@ pics/overlay_controller.png pics/overlay_family_basic_keyboard.png pics/overlay_controller_left.png + pics/overlay_fastforward_gray.png pics/overlay_subor_keyboard_sb97.png pics/hostkey.png pics/hostkey_captured.png diff --git a/src/gui/designer/wdgOverlayUi.ui b/src/gui/designer/wdgOverlayUi.ui index 5d8e9f18d..0cc432b38 100644 --- a/src/gui/designer/wdgOverlayUi.ui +++ b/src/gui/designer/wdgOverlayUi.ui @@ -199,6 +199,16 @@ + + + + + 16 + 16 + + + + @@ -272,6 +282,12 @@
wdgOverlayUi.hpp
1 + + overlayWidgetFastForward + QWidget +
wdgOverlayUi.hpp
+ 1 +
diff --git a/src/gui/designer/wdgSettingsPPU.ui b/src/gui/designer/wdgSettingsPPU.ui index a264e2b04..17ed1ad2a 100644 --- a/src/gui/designer/wdgSettingsPPU.ui +++ b/src/gui/designer/wdgSettingsPPU.ui @@ -6,8 +6,8 @@ 0 0 - 559 - 355 + 555 + 449
@@ -31,63 +31,215 @@ - - + + Qt::LeftToRight - Unlimited Sprites + Hide Sprites - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - - Sprites and background icon - - - - - - - - 75 - true - - - - Sprites and background - - - + + - - - - 0 - 0 - - - - Qt::Horizontal - - + + + + + Per-Game + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Postrender Lines + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + VBlank Lines + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + :/icon/icons/trash.svgz:/icon/icons/trash.svgz + + + + + + + + + + + :/icon/icons/trash.svgz:/icon/icons/trash.svgz + + + + + + + + + Qt::LeftToRight + + + Disable 7bit Sample Control + + + + + + + + + + Default + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Postrender Lines + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + VBlank Lines + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + :/icon/icons/trash.svgz:/icon/icons/trash.svgz + + + + + + + + + + + :/icon/icons/trash.svgz:/icon/icons/trash.svgz + + + + + + + + + Qt::LeftToRight + + + Disable 7bit Sample Control + + + + + + + @@ -101,37 +253,17 @@ - - - - Qt::LeftToRight - - - Enable Extra Scanlines - - - - - - - Qt::LeftToRight - - - Hide Sprites - - - - - + + - + - Overclock icon + Sprites and background icon - + 75 @@ -139,12 +271,12 @@ - Overclock + Sprites and background - + 0 @@ -158,76 +290,16 @@ - - - - Qt::LeftToRight - - - Disable 7bit Sample Control - - - - + - - - Reset Lag Counter - - - - - - - - 145 - 0 - - - - VBlank Lines - - - - - - - - 0 - 0 - - - - - - - - Qt::NoFocus - - - true - - - - - - - - 0 - 0 - - - - - - + - Postrender Lines + Power up/reset CPU/PPU Alignment - + @@ -264,7 +336,7 @@ - + @@ -289,10 +361,57 @@
- - + + + + Qt::NoFocus + + + true + + + + + - Power up/reset CPU/PPU Alignment + Reset Lag Counter + + + + + + + + + + + Overclock icon + + + + + + + + 75 + true + + + + Overclock + + + + + + + + 0 + 0 + + + + Qt::Horizontal @@ -328,6 +447,135 @@ + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + Qt::LeftToRight + + + Unlimited Sprites + + + + + + + + + Per-Game Overclock Setting + + + + 0 + + + + + + 0 + 0 + + + + On + + + true + + + + + + + + 0 + 0 + + + + Off + + + true + + + + + + + + 0 + 0 + + + + + true + + + + Default Value + + + true + + + + + + + + + + Default Value + + + + 0 + + + + + On + + + true + + + + + + + + true + + + + Off + + + true + + + + + + + + @@ -337,13 +585,26 @@ checkBox_Hide_Background checkBox_Unlimited_Sprites checkBox_Unlimited_Sprites_Auto - checkBox_PPU_Overclock - checkBox_Disable_DMC_Control - spinBox_VB_Slines - spinBox_Postrender_Slines + pushButton_Overclock_Pergame_setting_on + pushButton_Overclock_Pergame_setting_off + pushButton_Overclock_Pergame_setting_use_def + pushButton_Overclock_Def_value_on + pushButton_Overclock_Def_value_off + spinBox_Pergame_VB_Slines + pushButton_Pergame_VB_Slines + spinBox_Pergame_Postrender_Slines + pushButton_Pergame_Postrender_Slines + checkBox_Pergame_Disable_DMC_Control + spinBox_Def_VB_Slines + pushButton_Def_VB_Slines + spinBox_Def_Postrender_Slines + pushButton_Def_Postrender_Slines + checkBox_Def_Disable_DMC_Control pushButton_Reset_Lag_Counter comboBox_CPUPPU_Alignment - + + + diff --git a/src/gui/objSettings.cpp b/src/gui/objSettings.cpp index d9820e103..bfdd83b40 100644 --- a/src/gui/objSettings.cpp +++ b/src/gui/objSettings.cpp @@ -956,6 +956,10 @@ void objSet::to_cfg(const QString &group) { int_to_val(SET_HIDE_BACKGROUND, cfg_from_file.hide_background); int_to_val(SET_UNLIMITED_SPRITES, cfg_from_file.unlimited_sprites); int_to_val(SET_UNLIMITED_SPRITES_AUTO, cfg_from_file.unlimited_sprites_auto); + int_to_val(SET_PPU_OVERCLOCK, cfg_from_file.oclock_all.def.enabled); + int_to_val(SET_PPU_OVERCLOCK_7BIT, cfg_from_file.oclock_all.def.dmc_control_disabled); + int_to_val(SET_PPU_OVERCLOCK_VB_SCLINE, cfg_from_file.oclock_all.def.extra_slines.vblank); + int_to_val(SET_PPU_OVERCLOCK_PR_SCLINE, cfg_from_file.oclock_all.def.extra_slines.postrender); int_to_val(SET_PPU_ALIGNMENT, cfg_from_file.ppu_alignment); } @@ -1094,6 +1098,10 @@ void objSet::fr_cfg(const QString &group) { cfg_from_file.hide_background = val_to_int(SET_HIDE_BACKGROUND); cfg_from_file.unlimited_sprites = val_to_int(SET_UNLIMITED_SPRITES); cfg_from_file.unlimited_sprites_auto = val_to_int(SET_UNLIMITED_SPRITES_AUTO); + cfg_from_file.oclock_all.def.enabled = val_to_int(SET_PPU_OVERCLOCK); + cfg_from_file.oclock_all.def.dmc_control_disabled = val_to_int(SET_PPU_OVERCLOCK_7BIT); + cfg_from_file.oclock_all.def.extra_slines.vblank = val_to_int(SET_PPU_OVERCLOCK_VB_SCLINE); + cfg_from_file.oclock_all.def.extra_slines.postrender = val_to_int(SET_PPU_OVERCLOCK_PR_SCLINE); cfg_from_file.ppu_alignment = val_to_int(SET_PPU_ALIGNMENT); } @@ -1128,7 +1136,7 @@ void objSet::after_the_defaults() { gfx.scale_before_fscreen = cfg_from_file.scale; save_slot.slot_in_use = 0; - cfg_from_file.oscan = OSCAN_DEFAULT; + cfg_from_file.oscan = PERGAME_DEFAULT; if (cfg_from_file.cheat_mode == GAMEGENIE_MODE) { gamegenie_check_rom_present(TRUE); @@ -1651,20 +1659,20 @@ void objPgs::to_cfg(UNUSED(const QString &group)) { cpy_utchar_to_val(SET_PGS_FILE_SAVE, cfg_from_file.save_file); int_to_val(SET_PGS_OVERSCAN, cfg_from_file.oscan); int_to_val(SET_PGS_DIPSWITCH, cfg_from_file.dipswitch); - int_to_val(SET_PGS_PPU_OVERCLOCK, cfg_from_file.ppu_overclock); - int_to_val(SET_PGS_PPU_OVERCLOCK_7BIT, cfg_from_file.ppu_overclock_dmc_control_disabled); - int_to_val(SET_PGS_PPU_OVERCLOCK_VB_SCLINE, cfg_from_file.extra_vb_scanlines); - int_to_val(SET_PGS_PPU_OVERCLOCK_PR_SCLINE, cfg_from_file.extra_pr_scanlines); + int_to_val(SET_PGS_PPU_OVERCLOCK, cfg_from_file.oclock_all.pergame.enabled); + int_to_val(SET_PGS_PPU_OVERCLOCK_7BIT, cfg_from_file.oclock_all.pergame.dmc_control_disabled); + int_to_val(SET_PGS_PPU_OVERCLOCK_VB_SCLINE, cfg_from_file.oclock_all.pergame.extra_slines.vblank); + int_to_val(SET_PGS_PPU_OVERCLOCK_PR_SCLINE, cfg_from_file.oclock_all.pergame.extra_slines.postrender); } void objPgs::fr_cfg(UNUSED(const QString &group)) { save_slot.slot_in_use = val_to_int(SET_PGS_SLOT); cpy_val_to_utchar(SET_PGS_FILE_SAVE, cfg_from_file.save_file, usizeof(cfg_from_file.save_file)); cfg_from_file.oscan = val_to_int(SET_PGS_OVERSCAN); cfg_from_file.dipswitch = val_to_int(SET_PGS_DIPSWITCH); - cfg_from_file.ppu_overclock = val_to_int(SET_PGS_PPU_OVERCLOCK); - cfg_from_file.ppu_overclock_dmc_control_disabled = val_to_int(SET_PGS_PPU_OVERCLOCK_7BIT); - cfg_from_file.extra_vb_scanlines = val_to_int(SET_PGS_PPU_OVERCLOCK_VB_SCLINE); - cfg_from_file.extra_pr_scanlines = val_to_int(SET_PGS_PPU_OVERCLOCK_PR_SCLINE); + cfg_from_file.oclock_all.pergame.enabled = val_to_int(SET_PGS_PPU_OVERCLOCK); + cfg_from_file.oclock_all.pergame.dmc_control_disabled = val_to_int(SET_PGS_PPU_OVERCLOCK_7BIT); + cfg_from_file.oclock_all.pergame.extra_slines.vblank = val_to_int(SET_PGS_PPU_OVERCLOCK_VB_SCLINE); + cfg_from_file.oclock_all.pergame.extra_slines.postrender = val_to_int(SET_PGS_PPU_OVERCLOCK_PR_SCLINE); } // ----------------------------------------- Input --------------------------------------- diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 5fbebefef..74274498b 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -142,7 +142,9 @@ void settings_pgs_parse(void) { s.pgs = new objPgs(s.cfg, PGSFILENAME, LSET_PGS); s.pgs->setup(); - if (cfg->ppu_overclock) { + cfg->oclock = cfg->oclock_all.pergame.enabled == PERGAME_DEFAULT ? &cfg->oclock_all.def : &cfg->oclock_all.pergame; + + if (cfg->oclock->enabled == PERGAME_ON) { gui_overlay_info_append_msg_precompiled(19, nullptr); } } diff --git a/src/gui/settings.h b/src/gui/settings.h index 7a88dd6db..d280b99f2 100644 --- a/src/gui/settings.h +++ b/src/gui/settings.h @@ -136,6 +136,10 @@ enum set_element { SET_HIDE_BACKGROUND, SET_UNLIMITED_SPRITES, SET_UNLIMITED_SPRITES_AUTO, + SET_PPU_OVERCLOCK, + SET_PPU_OVERCLOCK_7BIT, + SET_PPU_OVERCLOCK_VB_SCLINE, + SET_PPU_OVERCLOCK_PR_SCLINE, SET_PPU_ALIGNMENT, SET_NSF_PLAYER_EFFECT, SET_NSF_PLAYER_NSFE_PLAYLIST, @@ -561,10 +565,10 @@ static const _opt opt_par[] = { {NULL, uL("8:7") , PAR87}, {NULL, uL("11:8"), PAR118} }; -static const _opt opt_oscan[] = { - {NULL, uL("off") , OSCAN_OFF}, - {NULL, uL("on") , OSCAN_ON}, - {NULL, uL("default"), OSCAN_DEFAULT} +static const _opt opt_pergame[] = { + {NULL, uL("off") , PERGAME_OFF}, + {NULL, uL("on") , PERGAME_ON}, + {NULL, uL("default"), PERGAME_DEFAULT} }; static const _opt opt_filter[] = { {uL("no filter") , uL("none") , NO_FILTER}, @@ -910,7 +914,7 @@ static const _settings main_cfg[] = { uL("video"), uL("overscan default"), uL("off"), uL("# possible values: on, off"), uL("-o, --overscan default overscan : on, off"), - {LENGTH(opt_oscan), opt_oscan} + {LENGTH(opt_pergame), opt_pergame} }, { uL("video"), uL("overscan bordes NTSC"), uL("8,8,8,9"), @@ -1393,6 +1397,30 @@ static const _settings main_cfg[] = { NULL, {LENGTH(opt_no_yes), opt_no_yes} }, + { + uL("ppu"), uL("ppu overclock default"), uL("off"), + uL("# possible values: on, off"), + NULL, + {LENGTH(opt_pergame), opt_pergame} + }, + { + uL("ppu"), uL("disable 7bit sample control"), uL("no"), + uL("# possible values: yes, no"), + NULL, + {LENGTH(opt_no_yes), opt_no_yes} + }, + { + uL("ppu"), uL("extra vblank scanlines"), uL("0"), + uL("# possible values: [0 - 1000]"), + NULL, + {0, NULL} + }, + { + uL("ppu"), uL("extra postrender scanlines"), uL("0"), + uL("# possible values: [0 - 1000]"), + NULL, + {0, NULL} + }, { uL("ppu"), uL("cpu ppu alignment"), uL("default"), uL("# possible values: default, randomize, increment at reset"), @@ -1519,7 +1547,7 @@ static const _settings pgs_cfg[] = { uL("video"), uL("overscan"), uL("default"), uL("# possible values: on, off, default"), NULL, - {LENGTH(opt_oscan), opt_oscan} + {LENGTH(opt_pergame), opt_pergame} }, { uL("system"), uL("dipswitch"), uL("-1"), @@ -1528,25 +1556,25 @@ static const _settings pgs_cfg[] = { {0, NULL} }, { - uL("system"), uL("ppu overclock"), uL("no"), - uL("# possible values: yes, no"), + uL("ppu"), uL("ppu overclock"), uL("default"), + uL("# possible values: on, off, default"), NULL, - {LENGTH(opt_no_yes), opt_no_yes} + {LENGTH(opt_pergame), opt_pergame} }, { - uL("system"), uL("disable 7bit sample control"), uL("no"), + uL("ppu"), uL("disable 7bit sample control"), uL("no"), uL("# possible values: yes, no"), NULL, {LENGTH(opt_no_yes), opt_no_yes} }, { - uL("system"), uL("extra vblank scanlines"), uL("0"), + uL("ppu"), uL("extra vblank scanlines"), uL("0"), uL("# possible values: [0 - 1000]"), NULL, {0, NULL} }, { - uL("system"), uL("extra postrender scanlines"), uL("0"), + uL("ppu"), uL("extra postrender scanlines"), uL("0"), uL("# possible values: [0 - 1000]"), NULL, {0, NULL} diff --git a/src/gui/wdgOverlayUi.cpp b/src/gui/wdgOverlayUi.cpp index b7c363480..259ace272 100644 --- a/src/gui/wdgOverlayUi.cpp +++ b/src/gui/wdgOverlayUi.cpp @@ -235,8 +235,8 @@ void gui_overlay_info_append_msg_precompiled_with_alignment(BYTE alignment, int msg = msg.arg(a1); break; case 19: - a1 = QString("%1").arg(cfg->extra_vb_scanlines); - a2 = QString("%1").arg(cfg->extra_pr_scanlines); + a1 = QString("%1").arg(cfg->oclock->extra_slines.vblank); + a2 = QString("%1").arg(cfg->oclock->extra_slines.postrender); msg = msg.arg(a1, a2); break; case 22: @@ -328,6 +328,7 @@ wdgOverlayUi::wdgOverlayUi(QWidget *parent) : QWidget(parent) { overlayInfo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); overlayFPS->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + overlayFastForward->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); overlayFloppy->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); overlayFrame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); overlayRewind->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); @@ -416,6 +417,7 @@ void wdgOverlayUi::update_widget(void) { overlayInfo->update_widget(); overlayFPS->update_widget(); overlayFrame->update_widget(); + overlayFastForward->update_widget(); overlayFloppy->update_widget(); overlayRewind->update_widget(); overlayTAS->update_widget(); @@ -841,6 +843,39 @@ void overlayWidgetFrame::update_info(void) { td.setHtml(txt); } +// overlayWidgetFastForward--------------------------------------------------------------------------------------------- + +overlayWidgetFastForward::overlayWidgetFastForward(QWidget *parent) : overlayWidget(parent) {} +overlayWidgetFastForward::~overlayWidgetFastForward() = default; + +QSize overlayWidgetFastForward::sizeHint(void) const { + return (QSize(icon.size().width() + hpadtot(), minimum_eight())); +} +void overlayWidgetFastForward::paintEvent(QPaintEvent *event) { + const QPointF coords = QPointF(((qreal)rect().width() - (qreal)(icon.size().width())) / 2.0, + ((qreal)rect().height() - (qreal)icon.size().height()) / 2.0); + + overlayWidget::paintEvent(event); + + painter.begin(this); + painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); + if (fps.max_speed | fps.fast_forward) { + painter.drawImage(coords, icon); + } + painter.end(); +} + +void overlayWidgetFastForward::update_dpr(void) { + icon = dpr_image(":/pics/pics/overlay_fastforward_gray.png"); +} +void overlayWidgetFastForward::update_widget(void) { + if (cfg->txt_on_screen & (fps.max_speed | fps.fast_forward) & !info.turn_off) { + show_widget(); + } else { + hide(); + } +} + // overlayWidgetFloppy ------------------------------------------------------------------------------------------------- overlayWidgetFloppy::overlayWidgetFloppy(QWidget *parent) : overlayWidget(parent) {} diff --git a/src/gui/wdgOverlayUi.hpp b/src/gui/wdgOverlayUi.hpp index d7f85a32e..93eec35aa 100644 --- a/src/gui/wdgOverlayUi.hpp +++ b/src/gui/wdgOverlayUi.hpp @@ -172,6 +172,25 @@ class overlayWidgetFrame : public overlayWidget { void update_info(void); }; +// overlayWidgetFastForward -------------------------------------------------------------------------------------------- + +class overlayWidgetFastForward : public overlayWidget { + private: + QImage icon; + + public: + explicit overlayWidgetFastForward(QWidget *parent = nullptr); + ~overlayWidgetFastForward() override; + + protected: + QSize sizeHint(void) const override; + void paintEvent(QPaintEvent *event) override; + + public: + void update_dpr(void) override; + void update_widget(void) override; +}; + // overlayWidgetFloppy ------------------------------------------------------------------------------------------------- class overlayWidgetFloppy : public overlayWidget { diff --git a/src/gui/wdgSettingsPPU.cpp b/src/gui/wdgSettingsPPU.cpp index 02cb1778a..1dc57c39b 100644 --- a/src/gui/wdgSettingsPPU.cpp +++ b/src/gui/wdgSettingsPPU.cpp @@ -28,19 +28,59 @@ wdgSettingsPPU::wdgSettingsPPU(QWidget *parent) : QWidget(parent) { setFocusProxy(checkBox_Hide_Sprites); - spinBox_VB_Slines->setRange(0, 1000); - spinBox_Postrender_Slines->setRange(0, 1000); + groupBox_Overclock_Pergame_setting->setStyleSheet(group_title_and_button_stylesheet()); + groupBox_Overclock_Def_value->setStyleSheet(group_title_and_button_stylesheet()); + groupBox_Pergame_Slines->setStyleSheet(group_title_bold_stylesheet()); + groupBox_Def_Slines->setStyleSheet(group_title_bold_stylesheet()); connect(checkBox_Hide_Sprites, SIGNAL(clicked(bool)), this, SLOT(s_hide_sprites(bool))); connect(checkBox_Hide_Background, SIGNAL(clicked(bool)), this, SLOT(s_hide_background(bool))); connect(checkBox_Unlimited_Sprites, SIGNAL(clicked(bool)), this, SLOT(s_unlimited_sprites(bool))); connect(checkBox_Unlimited_Sprites_Auto, SIGNAL(clicked(bool)), this, SLOT(s_unlimited_sprites_auto(bool))); - connect(checkBox_PPU_Overclock, SIGNAL(clicked(bool)), this, SLOT(s_ppu_overclock(bool))); - connect(checkBox_Disable_DMC_Control, SIGNAL(clicked(bool)), this, SLOT(s_disable_dmc_control(bool))); + pushButton_Overclock_Pergame_setting_on->setProperty("mtype", QVariant(PERGAME_ON)); + pushButton_Overclock_Pergame_setting_off->setProperty("mtype", QVariant(PERGAME_OFF)); + pushButton_Overclock_Pergame_setting_use_def->setProperty("mtype", QVariant(PERGAME_DEFAULT)); - connect(spinBox_VB_Slines, SIGNAL(valueChanged(int)), this, SLOT(s_overclock_vb_slines(int))); - connect(spinBox_Postrender_Slines, SIGNAL(valueChanged(int)), this, SLOT(s_overclock_pr_slines(int))); + connect(pushButton_Overclock_Pergame_setting_on, SIGNAL(toggled(bool)), this, SLOT(s_overclock(bool))); + connect(pushButton_Overclock_Pergame_setting_off, SIGNAL(toggled(bool)), this, SLOT(s_overclock(bool))); + connect(pushButton_Overclock_Pergame_setting_use_def, SIGNAL(toggled(bool)), this, SLOT(s_overclock(bool))); + + pushButton_Overclock_Def_value_on->setProperty("mtype", QVariant(PERGAME_ON)); + pushButton_Overclock_Def_value_off->setProperty("mtype", QVariant(PERGAME_OFF)); + + connect(pushButton_Overclock_Def_value_on, SIGNAL(toggled(bool)), this, SLOT(s_overclock_def_value(bool))); + connect(pushButton_Overclock_Def_value_off, SIGNAL(toggled(bool)), this, SLOT(s_overclock_def_value(bool))); + + spinBox_Pergame_VB_Slines->setRange(0, 1000); + spinBox_Pergame_Postrender_Slines->setRange(0, 1000); + + spinBox_Pergame_VB_Slines->setProperty("mtype", QVariant(0)); + pushButton_Pergame_VB_Slines->setProperty("mtype", QVariant(0)); + spinBox_Pergame_Postrender_Slines->setProperty("mtype", QVariant(0)); + pushButton_Pergame_Postrender_Slines->setProperty("mtype", QVariant(0)); + checkBox_Pergame_Disable_DMC_Control->setProperty("mtype", QVariant(0)); + + connect(spinBox_Pergame_VB_Slines, SIGNAL(valueChanged(int)), this, SLOT(s_overclock_vb_slines(int))); + connect(pushButton_Pergame_VB_Slines, SIGNAL(clicked(bool)), this, SLOT(s_overclock_vb_slines_reset(bool))); + connect(spinBox_Pergame_Postrender_Slines, SIGNAL(valueChanged(int)), this, SLOT(s_overclock_pr_slines(int))); + connect(pushButton_Pergame_Postrender_Slines, SIGNAL(clicked(bool)), this, SLOT(s_overclock_pr_slines_reset(bool))); + connect(checkBox_Pergame_Disable_DMC_Control, SIGNAL(clicked(bool)), this, SLOT(s_overclock_disable_dmc_control(bool))); + + spinBox_Def_VB_Slines->setRange(0, 1000); + spinBox_Def_Postrender_Slines->setRange(0, 1000); + + spinBox_Def_VB_Slines->setProperty("mtype", QVariant(1)); + pushButton_Def_VB_Slines->setProperty("mtype", QVariant(1)); + spinBox_Def_Postrender_Slines->setProperty("mtype", QVariant(1)); + pushButton_Def_Postrender_Slines->setProperty("mtype", QVariant(1)); + checkBox_Def_Disable_DMC_Control->setProperty("mtype", QVariant(1)); + + connect(spinBox_Def_VB_Slines, SIGNAL(valueChanged(int)), this, SLOT(s_overclock_vb_slines(int))); + connect(pushButton_Def_VB_Slines, SIGNAL(clicked(bool)), this, SLOT(s_overclock_vb_slines_reset(bool))); + connect(spinBox_Def_Postrender_Slines, SIGNAL(valueChanged(int)), this, SLOT(s_overclock_pr_slines(int))); + connect(pushButton_Def_Postrender_Slines, SIGNAL(clicked(bool)), this, SLOT(s_overclock_pr_slines_reset(bool))); + connect(checkBox_Def_Disable_DMC_Control, SIGNAL(clicked(bool)), this, SLOT(s_overclock_disable_dmc_control(bool))); connect(pushButton_Reset_Lag_Counter, SIGNAL(clicked(bool)), this, SLOT(s_lag_counter_reset(bool))); @@ -74,20 +114,8 @@ void wdgSettingsPPU::update_widget(void) { checkBox_Unlimited_Sprites_Auto->setEnabled(cfg->unlimited_sprites); checkBox_Unlimited_Sprites_Auto->setChecked(cfg->unlimited_sprites_auto); - checkBox_PPU_Overclock->setChecked(cfg->ppu_overclock); - - checkBox_Disable_DMC_Control->setChecked(cfg->ppu_overclock_dmc_control_disabled); - checkBox_Disable_DMC_Control->setEnabled(cfg->ppu_overclock); - - label_VB_Slines->setEnabled(cfg->ppu_overclock); - - spinBox_VB_Slines->setEnabled(cfg->ppu_overclock); - qtHelper::spinbox_set_value(spinBox_VB_Slines, cfg->extra_vb_scanlines); - - label_Postrender_Slines->setEnabled(cfg->ppu_overclock); - - spinBox_Postrender_Slines->setEnabled(cfg->ppu_overclock); - qtHelper::spinbox_set_value(spinBox_Postrender_Slines, cfg->extra_pr_scanlines); + overclock_set(); + overclock_slines_set(); comboBox_CPUPPU_Alignment->setCurrentIndex(cfg->ppu_alignment); @@ -97,6 +125,47 @@ void wdgSettingsPPU::lag_counter_update(void) { lineEdit_Lag_Counter->setText(QString("%1").arg(info.lag_frame.totals)); } +void wdgSettingsPPU::overclock_set(void) { + // per-game + groupBox_Pergame_Slines->setEnabled(cfg->oclock_all.pergame.enabled == PERGAME_ON); + + qtHelper::pushbutton_set_checked(pushButton_Overclock_Pergame_setting_on, false); + qtHelper::pushbutton_set_checked(pushButton_Overclock_Pergame_setting_off, false); + qtHelper::pushbutton_set_checked(pushButton_Overclock_Pergame_setting_use_def, false); + switch (cfg->oclock_all.pergame.enabled) { + case PERGAME_ON: + qtHelper::pushbutton_set_checked(pushButton_Overclock_Pergame_setting_on, true); + break; + default: + case PERGAME_OFF: + qtHelper::pushbutton_set_checked(pushButton_Overclock_Pergame_setting_off, true); + break; + case PERGAME_DEFAULT: + qtHelper::pushbutton_set_checked(pushButton_Overclock_Pergame_setting_use_def, true); + break; + } + // default + groupBox_Def_Slines->setEnabled((cfg->oclock_all.pergame.enabled == PERGAME_DEFAULT) && + (cfg->oclock_all.def.enabled == PERGAME_ON)); + + qtHelper::pushbutton_set_checked(pushButton_Overclock_Def_value_on, false); + qtHelper::pushbutton_set_checked(pushButton_Overclock_Def_value_off, false); + if (cfg->oclock_all.def.enabled == PERGAME_ON) { + qtHelper::pushbutton_set_checked(pushButton_Overclock_Def_value_on, true); + } else { + qtHelper::pushbutton_set_checked(pushButton_Overclock_Def_value_off, true); + } +} +void wdgSettingsPPU::overclock_slines_set(void) { + qtHelper::spinbox_set_value(spinBox_Pergame_VB_Slines, cfg->oclock_all.pergame.extra_slines.vblank); + qtHelper::spinbox_set_value(spinBox_Pergame_Postrender_Slines, cfg->oclock_all.pergame.extra_slines.postrender); + qtHelper::checkbox_set_checked(checkBox_Pergame_Disable_DMC_Control, cfg->oclock_all.pergame.dmc_control_disabled); + + qtHelper::spinbox_set_value(spinBox_Def_VB_Slines, cfg->oclock_all.def.extra_slines.vblank); + qtHelper::spinbox_set_value(spinBox_Def_Postrender_Slines, cfg->oclock_all.def.extra_slines.postrender); + qtHelper::checkbox_set_checked(checkBox_Def_Disable_DMC_Control, cfg->oclock_all.def.dmc_control_disabled); +} + void wdgSettingsPPU::s_hide_sprites(UNUSED(bool checked)) { emu_thread_pause(); cfg->hide_sprites = !cfg->hide_sprites; @@ -118,36 +187,75 @@ void wdgSettingsPPU::s_unlimited_sprites_auto(UNUSED(bool checked)) { cfg->unlimited_sprites_auto = !cfg->unlimited_sprites_auto; emu_thread_continue(); } -void wdgSettingsPPU::s_ppu_overclock(UNUSED(bool checked)) { - emu_thread_pause(); - cfg->ppu_overclock = !cfg->ppu_overclock; - ppu_overclock(0, TRUE); - ppu_overclock(1, TRUE); - emu_thread_continue(); - settings_pgs_save(); - update_widget(); +void wdgSettingsPPU::s_overclock(bool checked) { + if (checked) { + emu_thread_pause(); + cfg->oclock_all.pergame.enabled = QVariant(((QPushButton *)sender())->property("mtype")).toInt(); + cfg->oclock = cfg->oclock_all.pergame.enabled == PERGAME_DEFAULT + ? &cfg->oclock_all.def + : &cfg->oclock_all.pergame; + ppu_overclock(0, TRUE); + ppu_overclock(1, TRUE); + settings_pgs_save(); + emu_thread_continue(); + } + overclock_set(); } -void wdgSettingsPPU::s_disable_dmc_control(UNUSED(bool checked)) { - emu_thread_pause(); - cfg->ppu_overclock_dmc_control_disabled = !cfg->ppu_overclock_dmc_control_disabled; - emu_thread_continue(); - settings_pgs_save(); +void wdgSettingsPPU::s_overclock_def_value(bool checked) { + if (checked) { + emu_thread_pause(); + cfg->oclock_all.def.enabled = QVariant(((QPushButton *)sender())->property("mtype")).toInt(); + cfg->oclock = cfg->oclock_all.pergame.enabled == PERGAME_DEFAULT + ? &cfg->oclock_all.def + : &cfg->oclock_all.pergame; + ppu_overclock(0, TRUE); + ppu_overclock(1, TRUE); + settings_pgs_save(); + emu_thread_continue(); + } + overclock_set(); } void wdgSettingsPPU::s_overclock_vb_slines(int i) { + _config_overclock *oclock = QVariant(((QPushButton *)sender())->property("mtype")).toInt() == 0 + ? &cfg->oclock_all.pergame + : &cfg->oclock_all.def; + emu_thread_pause(); - cfg->extra_vb_scanlines = i; + oclock->extra_slines.vblank = i; ppu_overclock(0, FALSE); ppu_overclock(1, FALSE); - emu_thread_continue(); settings_pgs_save(); + emu_thread_continue(); +} +void wdgSettingsPPU::s_overclock_vb_slines_reset(UNUSED(bool checked)) { + s_overclock_vb_slines(0); + overclock_slines_set(); } void wdgSettingsPPU::s_overclock_pr_slines(int i) { + _config_overclock *oclock = QVariant(((QPushButton *)sender())->property("mtype")).toInt() == 0 + ? &cfg->oclock_all.pergame + : &cfg->oclock_all.def; + emu_thread_pause(); - cfg->extra_pr_scanlines = i; + oclock->extra_slines.postrender = i; ppu_overclock(0, FALSE); ppu_overclock(1, FALSE); + settings_pgs_save(); emu_thread_continue(); +} +void wdgSettingsPPU::s_overclock_pr_slines_reset(UNUSED(bool checked)) { + s_overclock_pr_slines(0); + overclock_slines_set(); +} +void wdgSettingsPPU::s_overclock_disable_dmc_control(UNUSED(bool checked)) { + _config_overclock *oclock = QVariant(((QPushButton *)sender())->property("mtype")).toInt() == 0 + ? &cfg->oclock_all.pergame + : &cfg->oclock_all.def; + + emu_thread_pause(); + oclock->dmc_control_disabled = !oclock->dmc_control_disabled; settings_pgs_save(); + emu_thread_continue(); } void wdgSettingsPPU::s_lag_counter_reset(UNUSED(bool checked)) { emu_thread_pause(); diff --git a/src/gui/wdgSettingsPPU.hpp b/src/gui/wdgSettingsPPU.hpp index 40dce67c0..18d50e722 100644 --- a/src/gui/wdgSettingsPPU.hpp +++ b/src/gui/wdgSettingsPPU.hpp @@ -37,15 +37,22 @@ class wdgSettingsPPU : public QWidget, public Ui::wdgSettingsPPU { void update_widget(void); void lag_counter_update(void); + private: + void overclock_set(void); + void overclock_slines_set(void); + private slots: void s_hide_sprites(bool checked); void s_hide_background(bool checked); void s_unlimited_sprites(bool checked); void s_unlimited_sprites_auto(bool checked); - void s_ppu_overclock(bool checked); - void s_disable_dmc_control(bool checked); + void s_overclock(bool checked); + void s_overclock_def_value(bool checked); void s_overclock_vb_slines(int i); + void s_overclock_vb_slines_reset(bool checked); void s_overclock_pr_slines(int i); + void s_overclock_pr_slines_reset(bool checked); + void s_overclock_disable_dmc_control(bool checked); void s_lag_counter_reset(bool checked); void s_cpuppu_aligment(int index); }; diff --git a/src/gui/wdgSettingsVideo.cpp b/src/gui/wdgSettingsVideo.cpp index 87b76e155..a60ac47be 100644 --- a/src/gui/wdgSettingsVideo.cpp +++ b/src/gui/wdgSettingsVideo.cpp @@ -66,16 +66,16 @@ wdgSettingsVideo::wdgSettingsVideo(QWidget *parent) : QWidget(parent) { connect(pushButton_Scale_5x, SIGNAL(toggled(bool)), this, SLOT(s_scale(bool))); connect(pushButton_Scale_6x, SIGNAL(toggled(bool)), this, SLOT(s_scale(bool))); - pushButton_Oscan_pergame_setting_on->setProperty("mtype", QVariant(OSCAN_ON)); - pushButton_Oscan_pergame_setting_off->setProperty("mtype", QVariant(OSCAN_OFF)); - pushButton_Oscan_pergame_setting_use_def->setProperty("mtype", QVariant(OSCAN_DEFAULT)); + pushButton_Oscan_pergame_setting_on->setProperty("mtype", QVariant(PERGAME_ON)); + pushButton_Oscan_pergame_setting_off->setProperty("mtype", QVariant(PERGAME_OFF)); + pushButton_Oscan_pergame_setting_use_def->setProperty("mtype", QVariant(PERGAME_DEFAULT)); connect(pushButton_Oscan_pergame_setting_on, SIGNAL(toggled(bool)), this, SLOT(s_oscan(bool))); connect(pushButton_Oscan_pergame_setting_off, SIGNAL(toggled(bool)), this, SLOT(s_oscan(bool))); connect(pushButton_Oscan_pergame_setting_use_def, SIGNAL(toggled(bool)), this, SLOT(s_oscan(bool))); - pushButton_Oscan_def_value_on->setProperty("mtype", QVariant(OSCAN_ON)); - pushButton_Oscan_def_value_off->setProperty("mtype", QVariant(OSCAN_OFF)); + pushButton_Oscan_def_value_on->setProperty("mtype", QVariant(PERGAME_ON)); + pushButton_Oscan_def_value_off->setProperty("mtype", QVariant(PERGAME_OFF)); connect(pushButton_Oscan_def_value_on, SIGNAL(toggled(bool)), this, SLOT(s_oscan_def_value(bool))); connect(pushButton_Oscan_def_value_off, SIGNAL(toggled(bool)), this, SLOT(s_oscan_def_value(bool))); @@ -411,14 +411,14 @@ void wdgSettingsVideo::oscan_set(void) { qtHelper::pushbutton_set_checked(pushButton_Oscan_pergame_setting_off, false); qtHelper::pushbutton_set_checked(pushButton_Oscan_pergame_setting_use_def, false); switch (cfg->oscan) { - case OSCAN_ON: + case PERGAME_ON: qtHelper::pushbutton_set_checked(pushButton_Oscan_pergame_setting_on, true); break; default: - case OSCAN_OFF: + case PERGAME_OFF: qtHelper::pushbutton_set_checked(pushButton_Oscan_pergame_setting_off, true); break; - case OSCAN_DEFAULT: + case PERGAME_DEFAULT: qtHelper::pushbutton_set_checked(pushButton_Oscan_pergame_setting_use_def, true); break; } @@ -426,7 +426,7 @@ void wdgSettingsVideo::oscan_set(void) { void wdgSettingsVideo::oscan_def_value_set(void) { qtHelper::pushbutton_set_checked(pushButton_Oscan_def_value_on, false); qtHelper::pushbutton_set_checked(pushButton_Oscan_def_value_off, false); - if (cfg->oscan_default == OSCAN_ON) { + if (cfg->oscan_default == PERGAME_ON) { qtHelper::pushbutton_set_checked(pushButton_Oscan_def_value_on, true); } else { qtHelper::pushbutton_set_checked(pushButton_Oscan_def_value_off, true); @@ -894,7 +894,7 @@ void wdgSettingsVideo::s_oscan_def_value(bool checked) { if (checked) { emu_thread_pause(); cfg->oscan_default = QVariant(((QPushButton *)sender())->property("mtype")).toInt(); - if (cfg->oscan == OSCAN_DEFAULT) { + if (cfg->oscan == PERGAME_DEFAULT) { gfx_set_screen(NO_CHANGE, NO_CHANGE, NO_CHANGE, NO_CHANGE, NO_CHANGE, TRUE, FALSE); } emu_thread_continue(); diff --git a/src/video/gfx.c b/src/video/gfx.c index 615a21392..2e82cc5a4 100644 --- a/src/video/gfx.c +++ b/src/video/gfx.c @@ -105,7 +105,7 @@ void gfx_set_screen(BYTE scale, DBWORD filter, DBWORD shader, BYTE fullscreen, B gfx.rows = SCR_COLUMNS; gfx.lines = SCR_ROWS; - if (overscan.enabled == OSCAN_DEFAULT) { + if (overscan.enabled == PERGAME_DEFAULT) { overscan.enabled = cfg->oscan_default; } if (overscan.enabled) { diff --git a/src/video/gfx.h b/src/video/gfx.h index b195bcec6..b5858d2f1 100644 --- a/src/video/gfx.h +++ b/src/video/gfx.h @@ -93,7 +93,6 @@ enum shader_type { SHADER_FILE, SHADER_LAST = SHADER_FILE, }; -enum overcan_type { OSCAN_OFF, OSCAN_ON, OSCAN_DEFAULT }; enum gfx_info_type { CURRENT, NO_OVERSCAN, MONITOR, VIDEO_MODE, PASS0, FSCR_RESIZE, TOT_GFX_INFO_TYPE }; enum no_change { NO_CHANGE = 255 }; enum gfx_rotate_type { ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270, ROTATE_MAX };