Skip to content

Commit

Permalink
refactor: label gfx_api -> sdl2
Browse files Browse the repository at this point in the history
Use SDL2 as our gfx_api value, instead of the WinUAE-derived "direct3d11"
  • Loading branch information
midwan committed Jan 12, 2025
1 parent 69c11f9 commit 79487a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/cfgfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static const TCHAR *epsonprinter[] = { _T("none"), _T("ascii"), _T("epson_matrix
static const TCHAR *aspects[] = { _T("none"), _T("vga"), _T("tv"), nullptr };
static const TCHAR *vsyncmodes[] = { _T("false"), _T("true"), _T("autoswitch"), nullptr };
static const TCHAR *vsyncmodes2[] = { _T("normal"), _T("busywait"), nullptr };
static const TCHAR *filterapi[] = { _T("directdraw"), _T("direct3d"), _T("direct3d11"), _T("direct3d11"), nullptr};
static const TCHAR *filterapi[] = { _T("directdraw"), _T("direct3d"), _T("direct3d11"), _T("direct3d11"), _T("sdl2"), nullptr};
static const TCHAR *filterapiopts[] = { _T("hardware"), _T("software"), nullptr };
static const TCHAR *overscanmodes[] = { _T("tv_narrow"), _T("tv_standard"), _T("tv_wide"), _T("overscan"), _T("broadcast"), _T("extreme"), _T("ultra"), _T("ultra_hv"), _T("ultra_csync"), nullptr};
static const TCHAR *dongles[] =
Expand Down
18 changes: 7 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Copyright 1995 Ed Hanway
* Copyright 1995, 1996, 1997 Bernd Schmidt
*/
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
Expand Down Expand Up @@ -213,8 +214,7 @@ void fixup_prefs_dimensions (struct uae_prefs *prefs)

for (int i = 0; i < 2; i++) {
struct apmode *ap = &prefs->gfx_apmode[i];
if (ap->gfx_backbuffers < 1)
ap->gfx_backbuffers = 1;
ap->gfx_backbuffers = std::max(ap->gfx_backbuffers, 1);
ap->gfx_vflip = 0;
ap->gfx_strobo = false;
if (ap->gfx_vsync) {
Expand Down Expand Up @@ -266,7 +266,7 @@ void fixup_cpu (struct uae_prefs *p)

if (p->cpu_model >= 68020 && p->cpuboard_type && p->address_space_24 && cpuboard_32bit(p)) {
error_log (_T("24-bit address space is not supported with selected accelerator board configuration."));
p->address_space_24 = 0;
p->address_space_24 = false;
}
if (p->cpu_model >= 68040 && p->address_space_24) {
error_log (_T("24-bit address space is not supported with 68040/060 configurations."));
Expand Down Expand Up @@ -313,8 +313,7 @@ void fixup_cpu (struct uae_prefs *p)
cpuboard_setboard(p, BOARD_BLIZZARD, BOARD_BLIZZARD_SUB_PPC);
}
}
if (p->cpuboardmem1.size < 8 * 1024 * 1024)
p->cpuboardmem1.size = 8 * 1024 * 1024;
p->cpuboardmem1.size = std::max<uae_u32>(p->cpuboardmem1.size, 8 * 1024 * 1024);
}
#endif

Expand Down Expand Up @@ -649,8 +648,7 @@ void fixup_prefs (struct uae_prefs *p, bool userconfig)
}
} else if (p->cs_compatible == 0) {
if (p->cs_ide == IDE_A4000) {
if (p->cs_fatgaryrev < 0)
p->cs_fatgaryrev = 0;
p->cs_fatgaryrev = std::max(p->cs_fatgaryrev, 0);
if (p->cs_ramseyrev < 0)
p->cs_ramseyrev = 0x0f;
}
Expand Down Expand Up @@ -721,8 +719,7 @@ void fixup_prefs (struct uae_prefs *p, bool userconfig)
}
}
#endif
if (p->gfx_framerate < 1)
p->gfx_framerate = 1;
p->gfx_framerate = std::max(p->gfx_framerate, 1);
if (p->gfx_display_sections < 1) {
p->gfx_display_sections = 1;
} else if (p->gfx_display_sections > 99) {
Expand All @@ -743,8 +740,7 @@ void fixup_prefs (struct uae_prefs *p, bool userconfig)
p->cs_ciaatod = p->ntscmode ? 2 : 1;

// PCem does not support max speed.
if (p->x86_speed_throttle < 0)
p->x86_speed_throttle = 0;
p->x86_speed_throttle = std::max<float>(p->x86_speed_throttle, 0);

built_in_chipset_prefs (p);
blkdev_fix_prefs (p);
Expand Down
5 changes: 2 additions & 3 deletions src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2254,9 +2254,8 @@ void target_default_options(uae_prefs* p, const int type)
//p->commandpathstart[0] = 0;
//p->commandpathend[0] = 0;
//p->statusbar = 1;
p->gfx_api = 2;
if (p->gfx_api > 1)
p->color_mode = 5;
p->gfx_api = 4;
p->color_mode = 5;
if (p->gf[GF_NORMAL].gfx_filter == 0)
p->gf[GF_NORMAL].gfx_filter = 1;
if (p->gf[GF_RTG].gfx_filter == 0)
Expand Down

0 comments on commit 79487a2

Please sign in to comment.