Reinstate support for old AppleWin 1.25 "Color (Standard)" video mode (#357) (PR #614)

Renamed this video mode to: "Color (RGB Monitor)"
Also renamed "Color (Monitor)" to "Color (NTSC Monitor)".

As for the colours: I've changed them from the original 1.25 colours. Instead I runtime-generate the colours from the NTSC code. See NTSC.cpp's GenerateBaseColors(). This shifts the same 4-bit pattern in, combining with NTSC color phase, until the colour stabilises. Then I average the next 4 RGB values to get the final colour. The reason for this is that we now have consistent colours between NTSC and this simplified rendering mode.

NB. The 2 greys (in GR,DGR,DHGR) are now the same RGB value.
This commit is contained in:
TomCh
2019-01-09 21:29:36 +00:00
committed by GitHub
parent d16416fd75
commit 25c7c41b07
8 changed files with 966 additions and 40 deletions
+37 -10
View File
@@ -83,14 +83,11 @@ static LPBITMAPINFO g_pFramebufferinfo = NULL;
HBITMAP g_hLogoBitmap;
const int MAX_SOURCE_Y = 512;
static LPBYTE g_aSourceStartofLine[ MAX_SOURCE_Y ];
COLORREF g_nMonochromeRGB = RGB(0xC0,0xC0,0xC0);
uint32_t g_uVideoMode = VF_TEXT; // Current Video Mode (this is the last set one as it may change mid-scan line!)
DWORD g_eVideoType = VT_COLOR_TV;
DWORD g_eVideoType = VT_DEFAULT;
DWORD g_uHalfScanLines = 1; // drop 50% scan lines for a more authentic look
static const bool g_bVideoScannerNTSC = true; // NTSC video scanning (or PAL)
@@ -100,9 +97,10 @@ static const bool g_bVideoScannerNTSC = true; // NTSC video scanning (or PAL)
// NOTE: KEEP IN SYNC: VideoType_e g_aVideoChoices g_apVideoModeDesc
TCHAR g_aVideoChoices[] =
TEXT("Monochrome (Custom)\0")
TEXT("Color Monitor\0")
TEXT("B&W TV\0")
TEXT("Color (RGB Monitor)\0")
TEXT("Color (NTSC Monitor)\0")
TEXT("Color TV\0")
TEXT("B&W TV\0")
TEXT("Monochrome (Amber)\0")
TEXT("Monochrome (Green)\0")
TEXT("Monochrome (White)\0")
@@ -113,9 +111,10 @@ static const bool g_bVideoScannerNTSC = true; // NTSC video scanning (or PAL)
char *g_apVideoModeDesc[ NUM_VIDEO_MODES ] =
{
"Monochrome Monitor (Custom)"
, "Color Monitor"
, "B&W TV"
, "Color (RGB Monitor)"
, "Color (NTSC Monitor)"
, "Color TV"
, "B&W TV"
, "Amber Monitor"
, "Green Monitor"
, "White Monitor"
@@ -1193,14 +1192,42 @@ bool IsVideoRom4K(void)
//===========================================================================
enum VideoType127_e
{
VT127_MONO_CUSTOM
, VT127_COLOR_MONITOR_NTSC
, VT127_MONO_TV
, VT127_COLOR_TV
, VT127_MONO_AMBER
, VT127_MONO_GREEN
, VT127_MONO_WHITE
, VT127_NUM_VIDEO_MODES
};
void Config_Load_Video()
{
REGLOAD(TEXT(REGVALUE_VIDEO_MODE ),&g_eVideoType);
REGLOAD(TEXT(REGVALUE_VIDEO_HALF_SCAN_LINES),&g_uHalfScanLines);
REGLOAD(TEXT(REGVALUE_VIDEO_MONO_COLOR ),&g_nMonochromeRGB);
const UINT16* pOldVersion = GetOldAppleWinVersion();
if (pOldVersion[0] == 1 && pOldVersion[1] <= 27 && pOldVersion[2] <= 13)
{
switch (g_eVideoType)
{
case VT127_MONO_CUSTOM: g_eVideoType = VT_MONO_CUSTOM; break;
case VT127_COLOR_MONITOR_NTSC: g_eVideoType = VT_COLOR_MONITOR_NTSC; break;
case VT127_MONO_TV: g_eVideoType = VT_MONO_TV; break;
case VT127_COLOR_TV: g_eVideoType = VT_COLOR_TV; break;
case VT127_MONO_AMBER: g_eVideoType = VT_MONO_AMBER; break;
case VT127_MONO_GREEN: g_eVideoType = VT_MONO_GREEN; break;
case VT127_MONO_WHITE: g_eVideoType = VT_MONO_WHITE; break;
default: g_eVideoType = VT_DEFAULT; break;
}
}
if (g_eVideoType >= NUM_VIDEO_MODES)
g_eVideoType = VT_COLOR_MONITOR;
g_eVideoType = VT_DEFAULT;
}
void Config_Save_Video()
@@ -1233,9 +1260,9 @@ static void videoCreateDIBSection()
);
SelectObject(g_hDeviceDC,g_hDeviceBitmap);
// CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE FRAME BUFFER
// DRAW THE SOURCE IMAGE INTO THE SOURCE BIT BUFFER
ZeroMemory( g_pFramebufferbits, GetFrameBufferWidth()*GetFrameBufferHeight()*sizeof(bgra_t) );
// CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE FRAME BUFFER
NTSC_VideoInit( g_pFramebufferbits );
}