}
break;
case STATE_SEQUENCE:
- cl450_frame_pixbytes = currprefs.color_mode != 5 ? 2 : 4;
+ cl450_frame_pixbytes = 4;
mpeg2_convert(mpeg_decoder, cl450_frame_pixbytes == 2 ? mpeg2convert_rgb16 : mpeg2convert_rgb32, NULL);
cl450_set_status(CL_INT_SEQ_V);
cl450_frame_rate = mpeg_info->sequence->frame_period ? 27000000 / mpeg_info->sequence->frame_period : 0;
{_T("gfx_center_horizontal"), _T("Center display horizontally?") },
{_T("gfx_center_vertical"), _T("Center display vertically?") },
{_T("gfx_colour_mode"), _T("") },
- {_T("32bit_blits"), _T("Enable 32 bit blitter emulation") },
{_T("immediate_blits"), _T("Perform blits immediately") },
{_T("show_leds"), _T("LED display") },
{_T("keyboard_leds"), _T("Keyboard LEDs") },
_T("double3"), _T("scanlines3"), _T("scanlines3p2"), _T("scanlines3p3"),
0 };
static const TCHAR *speedmode[] = { _T("max"), _T("real"), 0 };
-static const TCHAR *colormode1[] = { _T("8bit"), _T("15bit"), _T("16bit"), _T("8bit_dither"), _T("4bit_dither"), _T("32bit"), 0 };
-static const TCHAR *colormode2[] = { _T("8"), _T("15"), _T("16"), _T("8d"), _T("4d"), _T("32"), 0 };
static const TCHAR *soundmode1[] = { _T("none"), _T("interrupts"), _T("normal"), _T("exact"), 0 };
static const TCHAR *soundmode2[] = { _T("none"), _T("interrupts"), _T("good"), _T("best"), 0 };
static const TCHAR *centermode1[] = { _T("none"), _T("simple"), _T("smart"), 0 };
cfgfile_write_strarr(f, _T("gfx_fullscreen_picasso"), fullmodes, p->gfx_apmode[1].gfx_fullscreen);
cfgfile_write_strarr(f, _T("gfx_center_horizontal"), centermode1, p->gfx_xcenter);
cfgfile_write_strarr(f, _T("gfx_center_vertical"), centermode1, p->gfx_ycenter);
- cfgfile_write_strarr(f, _T("gfx_colour_mode"), colormode1, p->color_mode);
+ cfgfile_write_str(f, _T("gfx_colour_mode"), _T("32bit"));
cfgfile_write_bool(f, _T("gfx_blacker_than_black"), p->gfx_blackerthanblack);
cfgfile_dwrite_bool(f, _T("gfx_monochrome"), p->gfx_grayscale);
cfgfile_dwrite_strarr(f, _T("gfx_atari_palette_fix"), threebitcolors, p->gfx_threebitcolors);
|| cfgfile_strval (option, value, _T("gfx_center_vertical"), &p->gfx_ycenter, centermode1, 1)
|| cfgfile_strval (option, value, _T("gfx_center_horizontal"), &p->gfx_xcenter, centermode2, 0)
|| cfgfile_strval (option, value, _T("gfx_center_vertical"), &p->gfx_ycenter, centermode2, 0)
- || cfgfile_strval (option, value, _T("gfx_colour_mode"), &p->color_mode, colormode1, 1)
- || cfgfile_strval (option, value, _T("gfx_colour_mode"), &p->color_mode, colormode2, 0)
- || cfgfile_strval (option, value, _T("gfx_color_mode"), &p->color_mode, colormode1, 1)
- || cfgfile_strval (option, value, _T("gfx_color_mode"), &p->color_mode, colormode2, 0)
|| cfgfile_strval (option, value, _T("gfx_max_horizontal"), &p->gfx_max_horizontal, maxhoriz, 0)
|| cfgfile_strval (option, value, _T("gfx_max_vertical"), &p->gfx_max_vertical, maxvert, 0)
|| cfgfile_strval(option, value, _T("gfx_api"), &p->gfx_api, filterapi, 0)
|| cfgfile_strval (option, value, _T("absolute_mouse"), &p->input_tablet, abspointers, 0))
return 1;
+ if (cfgfile_string(option, value, _T("gfx_colour_mode"), tmpbuf, sizeof tmpbuf / sizeof(TCHAR))) {
+ return 1;
+ }
+
if (cfgfile_intval(option, value, _T("gfx_rotation"), &p->gfx_rotation, 1)) {
p->gf[GF_NORMAL].gfx_filter_rotation = p->gfx_rotation;
p->gf[GF_INTERLACE].gfx_filter_rotation = p->gfx_rotation;
break;
- case 'H':
- p->color_mode = _tstoi (arg);
- if (p->color_mode < 0) {
- write_log (_T("Bad color mode selected. Using default.\n"));
- p->color_mode = 0;
- }
- break;
default:
write_log (_T("Unknown option `-%c'!\n"), c);
break;
p->gfx_max_vertical = VRES_DOUBLE;
p->gfx_autoresolution_minv = 0;
p->gfx_autoresolution_minh = 0;
- p->color_mode = 2;
p->gfx_blackerthanblack = 0;
p->gfx_autoresolution_vga = true;
p->gfx_apmode[0].gfx_backbuffers = 2;
int gfx_threebitcolors;
int gfx_api;
int gfx_api_options;
- int color_mode;
int gfx_extrawidth;
int gfx_extraheight;
bool lightboost_strobo;
bool win32_iconified_nosound;
int win32_iconified_input;
- bool win32_rtgmatchdepth;
bool win32_rtgallowscaling;
int win32_rtgscaleaspectratio;
int win32_rtgvblankrate;
if (vidinfo->host_mode != vidinfo->ohost_mode || state->RGBFormat != vidinfo->orgbformat) {
write_log (_T("RTG conversion: Depth=%d HostRGBF=%d P96RGBF=%d Mode=%d/%d\n"),
picasso_vidinfo[monid].pixbytes, vidinfo->host_mode, state->RGBFormat, vidinfo->picasso_convert[0], vidinfo->picasso_convert[1]);
- if (vidinfo->host_mode != vidinfo->ohost_mode && isfullscreen() > 0 && currprefs.win32_rtgmatchdepth) {
- state->ModeChanged = true;
- }
vidinfo->ohost_mode = vidinfo->host_mode;
vidinfo->orgbformat = state->RGBFormat;
}
return -1;
if (ma->res.height > mb->res.height)
return 1;
- return ma->depth - mb->depth;
+ return 0;
}
static int missmodes[] = { 320, 200, 320, 240, 320, 256, 640, 400, 640, 480, 640, 512, 800, 600, 1024, 768, 1280, 1024, -1 };
for (int mon = 0; Displays[mon].monitorname; mon++) {
struct PicassoResolution *DisplayModes = Displays[mon].DisplayModes;
i = 0;
- while (DisplayModes[i].depth >= 0) {
+ while (DisplayModes[i].inuse) {
for (j = 0; missmodes[j * 2] >= 0; j++) {
if (DisplayModes[i].res.width == missmodes[j * 2 + 0] && DisplayModes[i].res.height == missmodes[j * 2 + 1]) {
missmodes[j * 2 + 0] = 0;
for (int mon = 0; Displays[mon].monitorname; mon++) {
struct PicassoResolution *DisplayModes = Displays[mon].DisplayModes;
i = 0;
- while (DisplayModes[i].depth >= 0) {
+ while (DisplayModes[i].inuse) {
if (DisplayModes[i].rawmode) {
i++;
continue;
int k;
for (k = 0; k < cnt; k++) {
if (newmodes[k].res.width == DisplayModes[i].res.width &&
- newmodes[k].res.height == DisplayModes[i].res.height &&
- newmodes[k].depth == DisplayModes[i].depth)
+ newmodes[k].res.height == DisplayModes[i].res.height)
break;
}
if (k >= cnt) {
size += PSSO_ModeInfo_sizeof * depths;
}
#endif
- newmodes[cnt].depth = -1;
+ newmodes[cnt].inuse = false;
for (i = 0; i < cnt; i++) {
int depth;
i = 0;
unkcnt = cnt = 0;
- while (newmodes[i].depth >= 0) {
+ while (newmodes[i].inuse) {
struct LibResolution res = { 0 };
int j = i;
if (addmode(ctx, AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, 0, &unkcnt)) {
s = au (res.Name);
write_log (_T("%2d: %08X %4dx%4d %s\n"), ++cnt, res.DisplayID, res.Width, res.Height, s);
xfree (s);
- while (newmodes[i].depth >= 0
+ while (newmodes[i].inuse
&& newmodes[i].res.width == newmodes[j].res.width
&& newmodes[i].res.height == newmodes[j].res.height)
i++;
state->VirtualHeight = state->Height; /* in case SetPanning doesn't get called */
uae_u8 d = trap_get_byte(ctx, modeinfo + PSSO_ModeInfo_Depth);
- if (d != state->GC_Depth && isfullscreen() > 0 && currprefs.win32_rtgmatchdepth) {
- state->ModeChanged = true;
- }
state->GC_Depth = d;
state->GC_Flags = trap_get_byte(ctx, modeinfo + PSSO_ModeInfo_Flags);
struct PicassoResolution
{
+ bool inuse;
struct ScreenResolution res;
- int depth; /* depth in bytes-per-pixel */
int residx;
int refresh[MAX_REFRESH_RATES]; /* refresh-rates in Hz */
int refreshtype[MAX_REFRESH_RATES]; /* 0=normal,1=raw,2=lace */
TCHAR name[25];
- /* Bit mask of RGBFF_xxx values. */
- uae_u32 colormodes;
int rawmode;
bool lace; // all modes lace
};
#define IDC_DISPLAYSELECT 1024
#define IDC_AUTOCONFIG 1025
#define IDC_PRINTERLIST 1025
-#define IDC_RESOLUTIONDEPTH 1025
#define IDC_CHIPMEM 1026
#define IDC_CREATELOGFILE 1026
#define IDC_PORT0_JOYS 1026
#define IDC_HDFINFO3 1783
#define IDC_DBG_ADDRINPUTTXT 1784
#define IDC_RTG_SCALE 1785
-#define IDC_RTG_MATCH_DEPTH 1786
#define IDC_RTG_8BIT 1787
#define IDC_RTG_16BIT 1788
#define IDC_PATHS_CONFIGCACHE 1788
GROUPBOX "Screen",IDC_SCREENRESTEXT,1,4,393,81,BS_LEFT
COMBOBOX IDC_DISPLAYSELECT,10,17,375,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
RTEXT "Fullscreen:",IDC_STATIC,3,35,51,15,SS_CENTERIMAGE
- COMBOBOX IDC_RESOLUTION,59,35,76,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_RESOLUTIONDEPTH,144,35,62,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_RESOLUTION,59,35,93,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
RTEXT "Windowed:",IDC_STATIC,2,52,51,15,SS_CENTERIMAGE
EDITTEXT IDC_XSIZE,59,54,43,12,ES_NUMBER
EDITTEXT IDC_YSIZE,110,54,43,12,ES_NUMBER
RTEXT "VRAM size: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,2,98,76,10,SS_NOTIFY | SS_CENTERIMAGE
CONTROL "",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,94,103,20
EDITTEXT IDC_P96RAM,201,97,40,12,ES_CENTER | ES_READONLY
- CONTROL "Match host and RTG color depth if possible",IDC_RTG_MATCH_DEPTH,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,117,177,10
CONTROL "Scale if smaller than display size setting",IDC_RTG_SCALE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,130,175,10
CONTROL "Always scale in windowed mode",IDC_RTG_SCALE_ALLOW,
if (p->rtgboards[0].rtgmem_type >= GFXBOARD_HARDWARE) {
p->rtg_hardwareinterrupt = false;
p->rtg_hardwaresprite = false;
- p->win32_rtgmatchdepth = false;
- p->color_mode = 5;
}
struct MultiDisplay *md = getdisplay(p, 0);
for (int j = 0; j < MAX_AMIGADISPLAYS; j++) {
if (p->gfx_monitor[j].gfx_size_fs.special == WH_NATIVE) {
int i;
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ for (i = 0; md->DisplayModes[i].inuse; i++) {
if (md->DisplayModes[i].res.width == md->rect.right - md->rect.left &&
md->DisplayModes[i].res.height == md->rect.bottom - md->rect.top) {
p->gfx_monitor[j].gfx_size_fs.width = md->DisplayModes[i].res.width;
break;
}
}
- if (md->DisplayModes[i].depth < 0) {
+ if (!md->DisplayModes[i].inuse) {
p->gfx_monitor[j].gfx_size_fs.special = 0;
write_log(_T("Native resolution not found.\n"));
}
}
}
- /* switch from 32 to 16 or vice versa if mode does not exist */
- if (1 || isfullscreen() > 0) {
- int depth = p->color_mode == 5 ? 4 : 2;
- for (int i = 0; md->DisplayModes[i].depth >= 0; i++) {
- if (md->DisplayModes[i].depth == depth) {
- depth = 0;
- break;
- }
- }
- if (depth) {
- p->color_mode = p->color_mode == 5 ? 2 : 5;
- }
- }
-
if ((p->gfx_apmode[0].gfx_vsyncmode || p->gfx_apmode[1].gfx_vsyncmode) ) {
if (p->produce_sound && sound_devices[p->win32_soundcard]->type == SOUND_DEVICE_DS) {
p->win32_soundcard = 0;
p->win32_powersavedisabled = true;
p->win32_gui_control = false;
p->sana2 = 0;
- p->win32_rtgmatchdepth = 1;
p->gf[GF_RTG].gfx_filter_autoscale = RTG_MODE_SCALE;
p->win32_rtgallowscaling = 0;
p->win32_rtgscaleaspectratio = -1;
p->win32_commandpathend[0] = 0;
p->win32_statusbar = 1;
p->gfx_api = 2;
- if (p->gfx_api > 1)
- 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)
cfgfile_target_dwrite_str_escape(f, _T("midiin_device_name"), midp->name);
cfgfile_target_dwrite_bool (f, _T("midirouter"), p->win32_midirouter);
- cfgfile_target_dwrite_bool (f, _T("rtg_match_depth"), p->win32_rtgmatchdepth);
cfgfile_target_dwrite_bool(f, _T("rtg_scale_small"), p->gf[GF_RTG].gfx_filter_autoscale == 1);
cfgfile_target_dwrite_bool(f, _T("rtg_scale_center"), p->gf[GF_RTG].gfx_filter_autoscale == 2);
cfgfile_target_dwrite_bool (f, _T("rtg_scale_allow"), p->win32_rtgallowscaling);
return 1;
}
- if (cfgfile_yesno(option, value, _T("rtg_match_depth"), &p->win32_rtgmatchdepth))
+ if (cfgfile_yesno(option, value, _T("rtg_match_depth"), &tbool))
return 1;
if (cfgfile_yesno(option, value, _T("rtg_scale_small"), &tbool)) {
p->gf[GF_RTG].gfx_filter_autoscale = tbool ? RTG_MODE_SCALE : 0;
return 0;
struct MultiDisplay *md = getdisplay(&currprefs, monid);
- for (int i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ for (int i = 0; md->DisplayModes[i].inuse; i++) {
struct PicassoResolution *pr = &md->DisplayModes[i];
if (pr->res.width == width && pr->res.height == height) {
for (int j = 0; pr->refresh[j] > 0; j++) {
static void addmode (struct MultiDisplay *md, DEVMODE *dm, int rawmode)
{
- int ct;
int i, j;
int w = dm->dmPelsWidth;
int h = dm->dmPelsHeight;
write_log (_T("Ignored mode %d*%d\n"), w, h);
return;
}
+ if (d != 32) {
+ return;
+ }
if (dm->dmFields & DM_DISPLAYFREQUENCY) {
freq = dm->dmDisplayFrequency;
lace = (dm->dmDisplayFlags & DM_INTERLACED) != 0;
}
- ct = 0;
- if (d == 8)
- ct = RGBMASK_8BIT;
- if (d == 15)
- ct = RGBMASK_15BIT;
- if (d == 16)
- ct = RGBMASK_16BIT;
- if (d == 24)
- ct = RGBMASK_24BIT;
- if (d == 32)
- ct = RGBMASK_32BIT;
- if (ct == 0)
- return;
- d /= 8;
i = 0;
- while (md->DisplayModes[i].depth >= 0) {
- if (md->DisplayModes[i].depth == d && md->DisplayModes[i].res.width == w && md->DisplayModes[i].res.height == h) {
+ while (md->DisplayModes[i].inuse) {
+ if (md->DisplayModes[i].res.width == w && md->DisplayModes[i].res.height == h) {
for (j = 0; j < MAX_REFRESH_RATES; j++) {
if (md->DisplayModes[i].refresh[j] == 0 || md->DisplayModes[i].refresh[j] == freq)
break;
i++;
}
i = 0;
- while (md->DisplayModes[i].depth >= 0)
+ while (md->DisplayModes[i].inuse) {
i++;
- if (i >= MAX_PICASSO_MODES - 1)
+ }
+ if (i >= MAX_PICASSO_MODES - 1) {
return;
+ }
+ md->DisplayModes[i].inuse = true;
md->DisplayModes[i].rawmode = rawmode;
md->DisplayModes[i].lace = lace;
md->DisplayModes[i].res.width = w;
md->DisplayModes[i].res.height = h;
- md->DisplayModes[i].depth = d;
md->DisplayModes[i].refresh[0] = freq;
md->DisplayModes[i].refreshtype[0] = (lace ? REFRESH_RATE_LACE : 0) | (rawmode ? REFRESH_RATE_RAW : 0);
md->DisplayModes[i].refresh[1] = 0;
- md->DisplayModes[i].colormodes = ct;
- md->DisplayModes[i + 1].depth = -1;
- _stprintf (md->DisplayModes[i].name, _T("%dx%d%s, %d-bit"),
+ _stprintf (md->DisplayModes[i].name, _T("%dx%d%s"),
md->DisplayModes[i].res.width, md->DisplayModes[i].res.height,
- lace ? _T("i") : _T(""),
- md->DisplayModes[i].depth * 8);
+ lace ? _T("i") : _T(""));
}
static int _cdecl resolution_compare (const void *a, const void *b)
return -1;
if (ma->res.height > mb->res.height)
return 1;
- return ma->depth - mb->depth;
+ return 0;
}
static void sortmodes (struct MultiDisplay *md)
int pw = -1, ph = -1;
i = 0;
- while (md->DisplayModes[i].depth >= 0)
+ while (md->DisplayModes[i].inuse) {
i++;
+ }
qsort (md->DisplayModes, i, sizeof (struct PicassoResolution), resolution_compare);
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ for (i = 0; md->DisplayModes[i].inuse; i++) {
int j, k;
for (j = 0; md->DisplayModes[i].refresh[j]; j++) {
for (k = j + 1; md->DisplayModes[i].refresh[k]; k++) {
int i, j;
i = 0;
- while (md->DisplayModes[i].depth >= 0) {
+ while (md->DisplayModes[i].inuse) {
write_log (_T("%d: %s%s ("), i, md->DisplayModes[i].rawmode ? _T("!") : _T(""), md->DisplayModes[i].name);
j = 0;
while (md->DisplayModes[i].refresh[j] > 0) {
}
md = Displays;
while (md->monitorname) {
- md->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
- md->DisplayModes[0].depth = -1;
+ md->DisplayModes = xcalloc(struct PicassoResolution, MAX_PICASSO_MODES);
write_log (_T("%s '%s' [%s]\n"), md->adaptername, md->adapterid, md->adapterkey);
write_log (_T("-: %s [%s]\n"), md->fullname, md->monitorid);
while (EnumDisplaySettingsEx (md->adapterid, idx, &dm, mode ? EDS_RAWMODE : 0)) {
int found = 0;
int idx2 = 0;
- while (md->DisplayModes[idx2].depth >= 0 && !found) {
+ while (md->DisplayModes[idx2].inuse && !found) {
struct PicassoResolution *pr = &md->DisplayModes[idx2];
if (dm.dmPelsWidth == w && dm.dmPelsHeight == h && dm.dmBitsPerPel == b) {
if (dm.dmDisplayFrequency > deskhz)
deskhz = dm.dmDisplayFrequency;
}
- if (pr->res.width == dm.dmPelsWidth && pr->res.height == dm.dmPelsHeight && pr->depth == dm.dmBitsPerPel / 8) {
+ if (pr->res.width == dm.dmPelsWidth && pr->res.height == dm.dmPelsHeight) {
for (i = 0; pr->refresh[i]; i++) {
if (pr->refresh[i] == dm.dmDisplayFrequency) {
found = 1;
sortmodes (md);
modesList (md);
i = 0;
- while (md->DisplayModes[i].depth > 0)
+ while (md->DisplayModes[i].inuse) {
i++;
+ }
write_log (_T("%d display modes.\n"), i);
md++;
}
/* DirectX will fail with "Mode not supported" if we try to switch to a full
* screen mode that doesn't match one of the dimensions we got during enumeration.
* So try to find a best match for the given resolution in our list. */
-int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, int *pwidth, int *pheight, int *ppixbits)
+int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, int *pwidth, int *pheight)
{
struct PicassoResolution *best;
- uae_u32 selected_mask = (*ppixbits == 8 ? RGBMASK_8BIT
- : *ppixbits == 15 ? RGBMASK_15BIT
- : *ppixbits == 16 ? RGBMASK_16BIT
- : *ppixbits == 24 ? RGBMASK_24BIT
- : RGBMASK_32BIT);
int pass, i = 0, index = 0;
for (pass = 0; pass < 2; pass++) {
struct PicassoResolution *dm;
- uae_u32 mask = (pass == 0
- ? selected_mask
- : RGBMASK_8BIT | RGBMASK_15BIT | RGBMASK_16BIT | RGBMASK_24BIT | RGBMASK_32BIT); /* %%% - BERND, were you missing 15-bit here??? */
i = 0;
index = 0;
best = &md->DisplayModes[0];
dm = &md->DisplayModes[1];
- while (dm->depth >= 0) {
+ while (dm->inuse) {
/* do we already have supported resolution? */
- if (dm->res.width == *pwidth && dm->res.height == *pheight && dm->depth == (*ppixbits / 8))
+ if (dm->res.width == *pwidth && dm->res.height == *pheight)
return i;
- if ((dm->colormodes & mask) != 0) {
- if (dm->res.width <= best->res.width && dm->res.height <= best->res.height
- && dm->res.width >= *pwidth && dm->res.height >= *pheight)
- {
- best = dm;
- index = i;
- }
- if (dm->res.width >= best->res.width && dm->res.height >= best->res.height
- && dm->res.width <= *pwidth && dm->res.height <= *pheight)
- {
- best = dm;
- index = i;
- }
+ if (dm->res.width <= best->res.width && dm->res.height <= best->res.height
+ && dm->res.width >= *pwidth && dm->res.height >= *pheight)
+ {
+ best = dm;
+ index = i;
+ }
+ if (dm->res.width >= best->res.width && dm->res.height >= best->res.height
+ && dm->res.width <= *pwidth && dm->res.height <= *pheight)
+ {
+ best = dm;
+ index = i;
}
dm++;
i++;
}
if (best->res.width == *pwidth && best->res.height == *pheight) {
- selected_mask = mask; /* %%% - BERND, I added this - does it make sense? Otherwise, I'd specify a 16-bit display-mode for my
- Workbench (using -H 2, but SHOULD have been -H 1), and end up with an 8-bit mode instead*/
break;
}
}
*pwidth = best->res.width;
*pheight = best->res.height;
- if (best->colormodes & selected_mask)
- return index;
-
- /* Ordering here is done such that 16-bit is preferred, followed by 15-bit, 8-bit, 32-bit and 24-bit */
- if (best->colormodes & RGBMASK_16BIT)
- *ppixbits = 16;
- else if (best->colormodes & RGBMASK_15BIT) /* %%% - BERND, this possibility was missing? */
- *ppixbits = 15;
- else if (best->colormodes & RGBMASK_8BIT)
- *ppixbits = 8;
- else if (best->colormodes & RGBMASK_32BIT)
- *ppixbits = 32;
- else if (best->colormodes & RGBMASK_24BIT)
- *ppixbits = 24;
- else
- index = -1;
return index;
}
gfx_hdr = false;
}
-static bool canmatchdepth(void)
-{
- if (!currprefs.win32_rtgmatchdepth)
- return false;
- if (currprefs.gfx_api >= 2)
- return false;
- return true;
-}
-
static void updatemodes(struct AmigaMonitor *mon)
{
DWORD flags = 0;
#if FORCE16BIT
mon->currentmode.current_depth = 16;
#else
- mon->currentmode.current_depth = currprefs.color_mode < 5 && currprefs.gfx_api == 1 ? 16 : 32;
+ mon->currentmode.current_depth = 32;
#endif
- if (mon->screen_is_picasso && canmatchdepth() && isfullscreen () > 0) {
- int pbits = state->BytesPerPixel * 8;
- if (pbits <= 8) {
- if (mon->currentmode.current_depth == 32)
- pbits = 32;
- else
- pbits = 16;
- }
- if (pbits == 24)
- pbits = 32;
- mon->currentmode.current_depth = pbits;
- }
mon->currentmode.amiga_width = mon->currentmode.current_width;
mon->currentmode.amiga_height = mon->currentmode.current_height;
mon->scalepicasso = -1;
}
} else if (isfullscreen () > 0) {
- if (!canmatchdepth()) { // can't scale to different color depth
- if (mon->currentmode.native_width > state->Width && mon->currentmode.native_height > state->Height) {
- if (currprefs.gf[GF_RTG].gfx_filter_autoscale)
- mon->scalepicasso = RTG_MODE_SCALE;
- if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
- mon->scalepicasso = RTG_MODE_INTEGER_SCALE;
- }
+ if (mon->currentmode.native_width > state->Width && mon->currentmode.native_height > state->Height) {
+ if (currprefs.gf[GF_RTG].gfx_filter_autoscale)
+ mon->scalepicasso = RTG_MODE_SCALE;
+ if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
+ mon->scalepicasso = RTG_MODE_INTEGER_SCALE;
}
- if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER)
- mon->scalepicasso = currprefs.gf[GF_RTG].gfx_filter_autoscale;
- if (!mon->scalepicasso && currprefs.win32_rtgscaleaspectratio)
- mon->scalepicasso = -1;
}
+ if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER)
+ mon->scalepicasso = currprefs.gf[GF_RTG].gfx_filter_autoscale;
+ if (!mon->scalepicasso && currprefs.win32_rtgscaleaspectratio)
+ mon->scalepicasso = -1;
} else if (isfullscreen () == 0) {
if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) {
mon->scalepicasso = RTG_MODE_INTEGER_SCALE;
c |= currprefs.gfx_size_win.x != changed_prefs.gfx_size_win.x ? 16 : 0;
c |= currprefs.gfx_size_win.y != changed_prefs.gfx_size_win.y ? 16 : 0;
#endif
- c |= currprefs.color_mode != changed_prefs.color_mode ? 2 | 16 : 0;
c |= currprefs.gfx_apmode[0].gfx_fullscreen != changed_prefs.gfx_apmode[0].gfx_fullscreen ? 16 : 0;
c |= currprefs.gfx_apmode[1].gfx_fullscreen != changed_prefs.gfx_apmode[1].gfx_fullscreen ? 16 : 0;
c |= currprefs.gfx_apmode[0].gfx_vsync != changed_prefs.gfx_apmode[0].gfx_vsync ? 2 | 16 : 0;
c |= currprefs.win32_nonotificationicon != changed_prefs.win32_nonotificationicon ? 32 : 0;
c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 32 : 0;
c |= currprefs.win32_blankmonitors != changed_prefs.win32_blankmonitors ? 32 : 0;
- c |= currprefs.win32_rtgmatchdepth != changed_prefs.win32_rtgmatchdepth ? 2 : 0;
-// c |= currprefs.win32_rtgscalemode != changed_prefs.win32_rtgscalemode ? (2 | 8 | 64) : 0;
c |= currprefs.win32_rtgallowscaling != changed_prefs.win32_rtgallowscaling ? (2 | 8 | 64) : 0;
c |= currprefs.win32_rtgscaleaspectratio != changed_prefs.win32_rtgscaleaspectratio ? (8 | 64) : 0;
c |= currprefs.win32_rtgvblankrate != changed_prefs.win32_rtgvblankrate ? 8 : 0;
currprefs.gfx_autoresolution = changed_prefs.gfx_autoresolution;
currprefs.gfx_autoresolution_vga = changed_prefs.gfx_autoresolution_vga;
- currprefs.color_mode = changed_prefs.color_mode;
currprefs.lightboost_strobo = changed_prefs.lightboost_strobo;
if (currprefs.gfx_api != changed_prefs.gfx_api) {
currprefs.win32_borderless = changed_prefs.win32_borderless;
currprefs.win32_blankmonitors = changed_prefs.win32_blankmonitors;
currprefs.win32_statusbar = changed_prefs.win32_statusbar;
- currprefs.win32_rtgmatchdepth = changed_prefs.win32_rtgmatchdepth;
-// currprefs.win32_rtgscalemode = changed_prefs.win32_rtgscalemode;
currprefs.win32_rtgallowscaling = changed_prefs.win32_rtgallowscaling;
currprefs.win32_rtgscaleaspectratio = changed_prefs.win32_rtgscaleaspectratio;
currprefs.win32_rtgvblankrate = changed_prefs.win32_rtgvblankrate;
lacecheck = true;
for (int extra = 1; extra >= -1 && !found; extra--) {
- for (i = 0; md->DisplayModes[i].depth >= 0 && !found; i++) {
+ for (i = 0; md->DisplayModes[i].inuse && !found; i++) {
struct PicassoResolution *r = &md->DisplayModes[i];
- if (r->res.width == w && (r->res.height == newh + cnt || r->res.height == newh - cnt) && r->depth == d) {
+ if (r->res.width == w && (r->res.height == newh + cnt || r->res.height == newh - cnt)) {
int j;
for (j = 0; r->refresh[j] > 0; j++) {
if (doublecheck) {
if (isfullscreen () > 0) {
/* fullscreen to fullscreen */
if (mon->screen_is_picasso) {
- if (state->BytesPerPixel > 1 && state->BytesPerPixel * 8 != wc->current_depth && canmatchdepth())
- return -1;
if (state->Width < wc->current_width && state->Height < wc->current_height) {
- if ((currprefs.gf[GF_RTG].gfx_filter_autoscale == 1 || (currprefs.gf[GF_RTG].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling)) && !canmatchdepth())
+ if (currprefs.gf[GF_RTG].gfx_filter_autoscale == 1 || (currprefs.gf[GF_RTG].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling))
return 0;
}
if (state->Width != wc->current_width ||
state->Height == wc->current_height) {
if (state->BytesPerPixel * 8 == wc->current_depth || state->BytesPerPixel == 1)
return 0;
- if (!canmatchdepth())
- return 0;
+ return 0;
}
return 1;
} else {
if (!md)
return 0;
ratio = mon->currentmode.native_width > mon->currentmode.native_height ? 1 : 0;
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ for (i = 0; md->DisplayModes[i].inuse; i++) {
struct PicassoResolution *pr = &md->DisplayModes[i];
if (pr->res.width == mon->currentmode.native_width && pr->res.height == mon->currentmode.native_height)
break;
}
- if (md->DisplayModes[i].depth >= 0) {
+ if (md->DisplayModes[i].inuse) {
if (!nextbest)
break;
while (md->DisplayModes[i].res.width == mon->currentmode.native_width && md->DisplayModes[i].res.height == mon->currentmode.native_height)
}
// first iterate only modes that have similar aspect ratio
startidx = i;
- for (; md->DisplayModes[i].depth >= 0; i++) {
+ for (; md->DisplayModes[i].inuse; i++) {
struct PicassoResolution *pr = &md->DisplayModes[i];
int r = pr->res.width > pr->res.height ? 1 : 0;
if (pr->res.width >= mon->currentmode.native_width && pr->res.height >= mon->currentmode.native_height && r == ratio) {
}
// still not match? check all modes
i = startidx;
- for (; md->DisplayModes[i].depth >= 0; i++) {
+ for (; md->DisplayModes[i].inuse; i++) {
struct PicassoResolution *pr = &md->DisplayModes[i];
int r = pr->res.width > pr->res.height ? 1 : 0;
if (pr->res.width >= mon->currentmode.native_width && pr->res.height >= mon->currentmode.native_height) {
if (errv == 2 && currprefs.gfx_api == 0) {
write_log("Retrying D3D %s\n", err);
changed_prefs.gfx_api = currprefs.gfx_api = 2;
- changed_prefs.color_mode = currprefs.color_mode = 5;
update_gfxparams(mon);
goto retry;
}
gfx_hdr = false;
if (currprefs.gfx_api >= 2) {
D3D_free(0, true);
- if (err[0] == 0 && currprefs.color_mode != 5) {
- changed_prefs.color_mode = currprefs.color_mode = 5;
- update_gfxparams(mon);
- goto retry;
- }
changed_prefs.gfx_api = currprefs.gfx_api = 1;
d3d_select(&currprefs);
error_log(_T("Direct3D11 failed to initialize ('%s'), falling back to Direct3D9."), err);
goto retry;
} else if (currprefs.gfx_api > 0) {
changed_prefs.gfx_api = currprefs.gfx_api = 0;
- changed_prefs.color_mode = currprefs.color_mode = 5;
changed_prefs.gf[ad->gf_index].gfx_filter = currprefs.gf[ad->gf_index].gfx_filter = 1;
update_gfxparams(mon);
d3d_select(&currprefs);
struct MultiDisplay *md = getdisplay(&workprefs, 0);
j = 0;
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ for (i = 0; md->DisplayModes[i].inuse; i++) {
if (md->DisplayModes[i].res.width == x &&
- md->DisplayModes[i].res.height == y &&
- md->DisplayModes[i].depth == d)
+ md->DisplayModes[i].res.height == y)
break;
j++;
}
if (x == 0 && y == 0) {
j = 0;
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ for (i = 0; md->DisplayModes[i].inuse; i++) {
if (md->DisplayModes[i].res.width == md->rect.right - md->rect.left &&
- md->DisplayModes[i].res.height == md->rect.bottom - md->rect.top &&
- md->DisplayModes[i].depth == d)
+ md->DisplayModes[i].res.height == md->rect.bottom - md->rect.top)
break;
j++;
}
}
- if(md->DisplayModes[i].depth < 0)
+ if(!md->DisplayModes[i].inuse)
j = -1;
return j;
}
static int gui_display_depths[3];
static void init_display_mode (HWND hDlg)
{
- int d, d2, index;
- int i, cnt;
+ int index;
struct MultiDisplay *md = getdisplay(&workprefs, 0);
struct monconfig *gm = &workprefs.gfx_monitor[0];
- switch (workprefs.color_mode)
- {
- case 2:
- d = 16;
- break;
- case 5:
- default:
- d = 32;
- break;
- }
-
- if (workprefs.gfx_apmode[0].gfx_fullscreen) {
- d2 = d;
- if ((index = WIN32GFX_AdjustScreenmode (md, &gm->gfx_size_fs.width, &gm->gfx_size_fs.height, &d2)) >= 0) {
- switch (d2)
- {
- case 15:
- case 16:
- workprefs.color_mode = 2;
- d = 2;
- break;
- case 32:
- default:
- workprefs.color_mode = 5;
- d = 4;
- break;
- }
- }
- } else {
- d = d / 8;
- }
-
if (gm->gfx_size_fs.special == WH_NATIVE) {
int cnt = (int)xSendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_GETCOUNT, 0, 0);
xSendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_SETCURSEL, cnt - 1, 0);
- index = display_mode_index (gm->gfx_size_fs.width, gm->gfx_size_fs.height, d);
+ index = display_mode_index (gm->gfx_size_fs.width, gm->gfx_size_fs.height, 4);
} else {
- index = display_mode_index (gm->gfx_size_fs.width, gm->gfx_size_fs.height, d);
+ index = display_mode_index (gm->gfx_size_fs.width, gm->gfx_size_fs.height, 4);
if (index >= 0)
xSendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_SETCURSEL, md->DisplayModes[index].residx, 0);
gm->gfx_size_fs.special = 0;
}
- xSendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_RESETCONTENT, 0, 0);
- cnt = 0;
- gui_display_depths[0] = gui_display_depths[1] = gui_display_depths[2] = -1;
- if (index >= 0) {
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
- if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx == md->DisplayModes[index].residx) {
- TCHAR tmp[64];
- _stprintf (tmp, _T("%d"), md->DisplayModes[i].depth * 8);
- xSendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp);
- if (md->DisplayModes[i].depth == d)
- xSendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0);
- gui_display_depths[cnt] = md->DisplayModes[i].depth;
- cnt++;
- }
- }
- }
init_frequency_combo (hDlg, index);
}
idx = -1;
xSendDlgItemMessage(hDlg, IDC_RESOLUTION, CB_RESETCONTENT, 0, 0);
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
- if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx != idx) {
+ for (i = 0; md->DisplayModes[i].inuse; i++) {
+ if (md->DisplayModes[i].residx != idx) {
_stprintf (tmp, _T("%dx%d%s"), md->DisplayModes[i].res.width, md->DisplayModes[i].res.height, md->DisplayModes[i].lace ? _T("i") : _T(""));
if (md->DisplayModes[i].rawmode)
_tcscat (tmp, _T(" (*)"));
bool native = false;
struct MultiDisplay *md = getdisplay(&workprefs, 0);
posn1 = xSendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_GETCURSEL, 0, 0);
- int posn2 = xSendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_GETCURSEL, 0, 0);
if (posn1 != CB_ERR) {
- if (posn2 == CB_ERR)
- posn2 = 0;
workprefs.gfx_monitor[0].gfx_size_fs.special = 0;
- for (dmode = 0; md->DisplayModes[dmode].depth >= 0; dmode++) {
+ for (dmode = 0; md->DisplayModes[dmode].inuse; dmode++) {
if (md->DisplayModes[dmode].residx == posn1)
break;
}
- if (md->DisplayModes[dmode].depth <= 0) {
- for (dmode = 0; md->DisplayModes[dmode].depth >= 0; dmode++) {
+ if (!md->DisplayModes[dmode].inuse) {
+ for (dmode = 0; md->DisplayModes[dmode].inuse; dmode++) {
if (md->DisplayModes[dmode].res.width == md->rect.right - md->rect.left &&
- md->DisplayModes[dmode].res.height == md->rect.bottom - md->rect.top &&
- md->DisplayModes[dmode].depth == gui_display_depths[posn2])
+ md->DisplayModes[dmode].res.height == md->rect.bottom - md->rect.top)
{
workprefs.gfx_monitor[0].gfx_size_fs.special = WH_NATIVE;
break;
}
}
- if (md->DisplayModes[dmode].depth <= 0)
+ if (!md->DisplayModes[dmode].inuse) {
dmode = -1;
- } else {
- i = dmode;
- while (md->DisplayModes[dmode].residx == posn1) {
- if (md->DisplayModes[dmode].depth == gui_display_depths[posn2])
- break;
- dmode++;
}
- if (md->DisplayModes[dmode].residx != posn1)
- dmode = i;
}
}
posn = xSendDlgItemMessage(hDlg, IDC_OVERSCANMODE, CB_GETCURSEL, 0, 0);
if (posn != CB_ERR)
workprefs.gfx_overscanmode = posn;
- } else if ((LOWORD (wParam) == IDC_RESOLUTION || LOWORD(wParam) == IDC_RESOLUTIONDEPTH) && dmode >= 0) {
+ } else if (LOWORD (wParam) == IDC_RESOLUTION && dmode >= 0) {
workprefs.gfx_monitor[0].gfx_size_fs.width = md->DisplayModes[dmode].res.width;
workprefs.gfx_monitor[0].gfx_size_fs.height = md->DisplayModes[dmode].res.height;
- switch(md->DisplayModes[dmode].depth)
- {
- case 2:
- workprefs.color_mode = 2;
- break;
- case 3:
- case 4:
- workprefs.color_mode = 5;
- break;
- default:
- workprefs.color_mode = 0;
- break;
- }
/* Set the Int boxes */
SetDlgItemInt (hDlg, IDC_XSIZE, workprefs.gfx_monitor[0].gfx_size_win.width, FALSE);
SetDlgItemInt (hDlg, IDC_YSIZE, workprefs.gfx_monitor[0].gfx_size_win.height, FALSE);
ew(hDlg, IDC_RTG_16BIT, rtg);
ew(hDlg, IDC_RTG_24BIT, rtg);
ew(hDlg, IDC_RTG_32BIT, rtg);
- ew(hDlg, IDC_RTG_MATCH_DEPTH, rtg3);
ew(hDlg, IDC_RTG_SCALE, rtg2);
ew(hDlg, IDC_RTG_CENTER, rtg2);
ew(hDlg, IDC_RTG_INTEGERSCALE, rtg2);
CheckDlgButton(hDlg, IDC_RTG_CENTER, workprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER);
CheckDlgButton(hDlg, IDC_RTG_INTEGERSCALE, workprefs.gf[1].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE);
CheckDlgButton(hDlg, IDC_RTG_SCALE_ALLOW, workprefs.win32_rtgallowscaling);
- CheckDlgButton(hDlg, IDC_RTG_MATCH_DEPTH, workprefs.win32_rtgmatchdepth);
CheckDlgButton(hDlg, IDC_RTG_VBINTERRUPT, workprefs.rtg_hardwareinterrupt);
CheckDlgButton(hDlg, IDC_RTG_HWSPRITE, workprefs.rtg_hardwaresprite);
CheckDlgButton(hDlg, IDC_RTG_THREAD, workprefs.rtg_multithread);
recursive++;
switch (LOWORD (wParam))
{
- case IDC_RTG_MATCH_DEPTH:
- workprefs.win32_rtgmatchdepth = ischecked(hDlg, IDC_RTG_MATCH_DEPTH);
- break;
case IDC_RTG_SCALE:
workprefs.gf[1].gfx_filter_autoscale = ischecked(hDlg, IDC_RTG_SCALE) ? RTG_MODE_SCALE : 0;
setchecked(hDlg, IDC_RTG_CENTER, false);