Adjusted the Config PropSheetPage to widen the Video Mode's combo box.

Renamed a few globals & made static.
Removed a few VS2008 'int to bool' perf warnings.
This commit is contained in:
tomcw 2020-09-28 20:25:23 +01:00
parent 08458a9d29
commit b5739b862a
2 changed files with 31 additions and 31 deletions

View File

@ -90,11 +90,11 @@ CAPTION "Configuration"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Model:",IDC_STATIC,5,7,40,8
COMBOBOX IDC_COMPUTER,45,5,90,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMPUTER,45,5,91,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Confirm reboot",IDC_CHECK_CONFIRM_REBOOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,8,62,10
GROUPBOX "Video",IDC_STATIC,5,22,200,56
LTEXT "Mo&de:",IDC_STATIC,12,33,33,8
COMBOBOX IDC_VIDEOTYPE,45,30,90,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_VIDEOTYPE,33,30,103,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Monochrome &Color...",IDC_MONOCOLOR,12,46,80,14
CONTROL "50% Scan lines",IDC_CHECK_HALF_SCAN_LINES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,33,62,10
CONTROL "Vertical blend",IDC_CHECK_VERTICAL_BLEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,48,62,10

View File

@ -667,10 +667,10 @@ void UpdateHiResRGBCell(int x, int y, uint16_t addr, bgra_t* pVideoAddress)
int color = 0;
DWORD dwordval_tmp = dwordval;
dwordval_tmp = dwordval_tmp >> 7;
bool offset = (byteval2 & 0x80);
bool offset = (byteval2 & 0x80) ? true : false;
for (int i = 0; i < 14; i++)
{
if (i == 7) offset = (byteval3 & 0x80);
if (i == 7) offset = (byteval3 & 0x80) ? true : false;
color = dwordval_tmp & 0x3;
// Two cases because AppleWin's palette is in a strange order
if (offset)
@ -739,8 +739,8 @@ void UpdateHiResRGBCell(int x, int y, uint16_t addr, bgra_t* pVideoAddress)
}
}
bool dhgr_lastcell_iscolor = true;
int dhgr_lastbit = 0;
static bool g_dhgrLastCellIsColor = true;
static int g_dhgrLastBit = 0;
void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, bool isMixMode, bool isBit7Inversed)
{
@ -815,31 +815,31 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo
*(pDst++) = colors[1];
dwordval >>= 7;
dhgr_lastcell_iscolor = true;
g_dhgrLastCellIsColor = true;
}
else
{
// BW
for (int i = 0; i < 7; i++)
{
dhgr_lastbit = dwordval & 1;
*(pDst++) = bw[dhgr_lastbit];
g_dhgrLastBit = dwordval & 1;
*(pDst++) = bw[g_dhgrLastBit];
dwordval >>= 1;
}
dhgr_lastcell_iscolor = false;
g_dhgrLastCellIsColor = false;
}
if ((byteval2 & 0x80) || !isMixMode)
{
// Remaining of color cell 1
if (dhgr_lastcell_iscolor)
if (g_dhgrLastCellIsColor)
{
*(pDst++) = colors[1];
}
else
{
// Repeat last BW bit once
*(pDst++) = bw[dhgr_lastbit];
*(pDst++) = bw[g_dhgrLastBit];
}
// Color cell 2
*(pDst++) = colors[2];
@ -849,17 +849,17 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo
// Color cell 3
*(pDst++) = colors[3];
*(pDst++) = colors[3];
dhgr_lastcell_iscolor = true;
g_dhgrLastCellIsColor = true;
}
else
{
for (int i = 0; i < 7; i++)
{
dhgr_lastbit = dwordval & 1;
*(pDst++) = bw[dhgr_lastbit];
g_dhgrLastBit = dwordval & 1;
*(pDst++) = bw[g_dhgrLastBit];
dwordval >>= 1;
}
dhgr_lastcell_iscolor = false;
g_dhgrLastCellIsColor = false;
}
}
else // Second cell
@ -869,7 +869,7 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo
if ((byteval3 & 0x80) || !isMixMode)
{
// Remaining of color cell 3
if (dhgr_lastcell_iscolor)
if (g_dhgrLastCellIsColor)
{
*(pDst++) = colors[3];
*(pDst++) = colors[3];
@ -877,8 +877,8 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo
else
{
// Repeat last BW bit twice
*(pDst++) = bw[dhgr_lastbit];
*(pDst++) = bw[dhgr_lastbit];
*(pDst++) = bw[g_dhgrLastBit];
*(pDst++) = bw[g_dhgrLastBit];
}
// Color cell 4
*(pDst++) = colors[4];
@ -889,23 +889,23 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo
*(pDst++) = colors[5];
dwordval >>= 7;
dhgr_lastcell_iscolor = true;
g_dhgrLastCellIsColor = true;
}
else
{
for (int i = 0; i < 7; i++)
{
dhgr_lastbit = dwordval & 1;
*(pDst++) = bw[dhgr_lastbit];
g_dhgrLastBit = dwordval & 1;
*(pDst++) = bw[g_dhgrLastBit];
dwordval >>= 1;
}
dhgr_lastcell_iscolor = false;
g_dhgrLastCellIsColor = false;
}
if ((byteval4 & 0x80) || !isMixMode)
{
// Remaining of color cell 5
if (dhgr_lastcell_iscolor)
if (g_dhgrLastCellIsColor)
{
*(pDst++) = colors[5];
*(pDst++) = colors[5];
@ -914,26 +914,26 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo
else
{
// Repeat last BW bit three times
*(pDst++) = bw[dhgr_lastbit];
*(pDst++) = bw[dhgr_lastbit];
*(pDst++) = bw[dhgr_lastbit];
*(pDst++) = bw[g_dhgrLastBit];
*(pDst++) = bw[g_dhgrLastBit];
*(pDst++) = bw[g_dhgrLastBit];
}
// Color cell 6
*(pDst++) = colors[6];
*(pDst++) = colors[6];
*(pDst++) = colors[6];
*(pDst++) = colors[6];
dhgr_lastcell_iscolor = true;
g_dhgrLastCellIsColor = true;
}
else
{
for (int i = 0; i < 7; i++)
{
dhgr_lastbit = dwordval & 1;
*(pDst++) = bw[dhgr_lastbit];
g_dhgrLastBit = dwordval & 1;
*(pDst++) = bw[g_dhgrLastBit];
dwordval >>= 1;
}
dhgr_lastcell_iscolor = false;
g_dhgrLastCellIsColor = false;
}
}