Removed the old EXTEND_14M_VIDEO_BY_1_PIXEL rejected solution for #555

This commit is contained in:
tomcw 2019-08-29 21:38:00 +01:00
parent 2cc0f91fbf
commit bae7208852
3 changed files with 1 additions and 165 deletions

View File

@ -200,7 +200,7 @@ void SetAltEnterToggleFullScreen(bool mode)
UINT GetFrameBufferBorderlessWidth(void)
{
static const UINT uFrameBufferBorderlessW = NTSC_GetFrameBufferBorderlessWidth(); // 560 = Double Hi-Res, +1 for GH#555
static const UINT uFrameBufferBorderlessW = 560; // 560 = Double Hi-Res
return uFrameBufferBorderlessW;
}

View File

@ -32,15 +32,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "NTSC_CharSet.h"
// GH#555: Extend the 14M video modes by 1 pixel
// . 14M (DHGR,DGR,80COL) are shifted right by 1 pixel, so zero out the left-most visible pixel.
// . 7M (all other modes) are not shift right by 1 pixel, so zero out the right-most visible pixel.
// NB. This 1 pixel shift is a workaround for the 14M video modes that actually start 7x 14M pixels to the left on *real h/w*.
// . 7x 14M pixels early + 1x 14M pixel shifted right = 2 complete color phase rotations.
// . ie. the 14M colors are correct, but being 1 pixel out is the closest we can get the 7M and 14M video modes to overlap.
// . The alternative is to render the 14M correctly 7 pixels early, but have 7-pixel borders left (for 7M modes) or right (for 14M modes).
#define EXTEND_14M_VIDEO_BY_1_PIXEL 0
#define NTSC_REMOVE_WHITE_RINGING 1 // 0 = theoritical dimmed white has chroma, 1 = pure white without chroma tinting
#define NTSC_REMOVE_BLACK_GHOSTING 1 // 1 = remove black smear/smudges carrying over
#define NTSC_REMOVE_GRAY_CHROMA 1 // 1 = remove all chroma in gray1 and gray2
@ -461,17 +452,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
static void updateScreenText40 ( long cycles6502 );
static void updateScreenText80 ( long cycles6502 );
//===========================================================================
// NB. This func only exists so that EXTEND_14M_VIDEO_BY_1_PIXEL only needs to exist in this cpp file!
UINT NTSC_GetFrameBufferBorderlessWidth(void)
{
#if !EXTEND_14M_VIDEO_BY_1_PIXEL
return 560; // 560 = Double Hi-Res
#else
return 561; // 560 = Double Hi-Res, +1 for GH#555
#endif
}
//===========================================================================
static void set_csbits()
{
@ -788,7 +768,6 @@ inline void updateVideoScannerHorzEOLSimple()
}
}
#if !EXTEND_14M_VIDEO_BY_1_PIXEL
// NOTE: This writes out-of-bounds for a 560x384 framebuffer
inline void updateVideoScannerHorzEOL()
{
@ -826,97 +805,6 @@ inline void updateVideoScannerHorzEOL()
}
}
}
#endif
//-------------------------------------
#if EXTEND_14M_VIDEO_BY_1_PIXEL
// NB. Only needed for video modes that are 14M and shift the color phase, ie:
// . updateScreenDoubleHires80(), updateScreenDoubleLores80(), updateScreenText80()
// NOTE: This writes out-of-bounds for a 560x384 framebuffer
inline void updateVideoScannerHorzEOL_14M()
{
if (VIDEO_SCANNER_MAX_HORZ == ++g_nVideoClockHorz)
{
if (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY)
{
if (!GetColorBurst())
{
// Only for: VF_TEXT && !VF_MIXED (ie. full 24-row TEXT40 or TEXT80)
g_pFuncUpdateBnWPixel(g_nLastColumnPixelNTSC); // 14M: Output a 561st dot
g_pFuncUpdateBnWPixel(0);
g_pFuncUpdateBnWPixel(0);
}
else
{
g_pFuncUpdateHuePixel(g_nLastColumnPixelNTSC); // 14M: Output a 561st dot
g_pFuncUpdateHuePixel(0);
g_pFuncUpdateHuePixel(0);
}
}
g_nVideoClockHorz = 0;
if (++g_nVideoClockVert == g_videoScannerMaxVert)
{
g_nVideoClockVert = 0;
updateFlashRate();
}
if (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY)
{
updateVideoScannerAddress();
}
}
}
//-----------------
// NOTE: This writes out-of-bounds for a 560x384 framebuffer
inline void updateVideoScannerHorzEOL()
{
if (VIDEO_SCANNER_MAX_HORZ == ++g_nVideoClockHorz)
{
if (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY)
{
if ( !GetColorBurst() || // Only for: VF_TEXT && !VF_MIXED (ie. full 24-row TEXT40 or TEXT80)
(g_eVideoType == VT_MONO_CUSTOM) || (g_eVideoType == VT_MONO_AMBER) || (g_eVideoType == VT_MONO_GREEN) || (g_eVideoType == VT_MONO_WHITE) )
{
g_pFuncUpdateBnWPixel(0);
g_pFuncUpdateBnWPixel(0);
// 7M: Stop outputting video after 560 dots
*(UINT32*)&g_pVideoAddress[0] = 0;
*(UINT32*)&g_pVideoAddress[g_kFrameBufferWidth] = 0;
}
else
{
g_pFuncUpdateHuePixel(g_nLastColumnPixelNTSC);
g_pFuncUpdateHuePixel(0);
// 7M: Stop outputting video after 560 dots
*(UINT32*)&g_pVideoAddress[0] = 0;
*(UINT32*)&g_pVideoAddress[g_kFrameBufferWidth] = 0;
}
}
g_nVideoClockHorz = 0;
if (++g_nVideoClockVert == g_videoScannerMaxVert)
{
g_nVideoClockVert = 0;
updateFlashRate();
}
if (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY)
{
updateVideoScannerAddress();
}
}
}
#endif
//===========================================================================
inline void updateVideoScannerAddress()
@ -1304,31 +1192,6 @@ static void updatePixelHueMonitorDoubleScanline (uint16_t compositeSignal)
updateColorPhase();
}
//===========================================================================
#if EXTEND_14M_VIDEO_BY_1_PIXEL
// NB. Only needed for video modes that are 14M and shift the color phase, ie:
// . updateScreenDoubleHires80(), updateScreenDoubleLores80(), updateScreenText80()
inline void zeroPixel0_14M(void) // GH#555
{
if (g_nVideoClockHorz == VIDEO_SCANNER_HORZ_START)
{
UINT32* p = ((UINT32*)g_pVideoAddress) - 14; // Point back to pixel-0
// NB. For VT_COLOR_MONITOR_NTSC, also check color-burst so that TEXT and MIXED(HGR+TEXT) render the TEXT at the same offset (GH#341)
if (g_eVideoType == VT_MONO_TV || g_eVideoType == VT_COLOR_TV || (g_eVideoType == VT_COLOR_MONITOR_NTSC && GetColorBurst()))
{
p[2] = 0;
p[g_kFrameBufferWidth+2] = 0; // Next line (there are 2 lines per Apple II scanline)
}
else
{
p[0] = 0;
p[g_kFrameBufferWidth+0] = 0; // Next line (there are 2 lines per Apple II scanline)
}
}
}
#endif
//===========================================================================
void updateScreenDoubleHires40 (long cycles6502) // wsUpdateVideoHires0
{
@ -1459,17 +1322,9 @@ void updateScreenDoubleHires80 (long cycles6502 ) // wsUpdateVideoDblHires
bits = (bits << 1) | g_nLastColumnPixelNTSC;
updatePixels( bits );
g_nLastColumnPixelNTSC = (bits >> 14) & 1;
#if EXTEND_14M_VIDEO_BY_1_PIXEL
zeroPixel0_14M();
#endif
}
}
#if EXTEND_14M_VIDEO_BY_1_PIXEL
updateVideoScannerHorzEOL_14M();
#else
updateVideoScannerHorzEOL();
#endif
}
}
@ -1571,18 +1426,9 @@ void updateScreenDoubleLores80 (long cycles6502) // wsUpdateVideoDblLores
uint16_t bits = (main << 7) | (aux & 0x7f);
updatePixels( bits );
g_nLastColumnPixelNTSC = (bits >> 14) & 1;
#if EXTEND_14M_VIDEO_BY_1_PIXEL
zeroPixel0_14M();
#endif
}
}
#if EXTEND_14M_VIDEO_BY_1_PIXEL
updateVideoScannerHorzEOL_14M();
#else
updateVideoScannerHorzEOL();
#endif
}
}
@ -1799,18 +1645,9 @@ void updateScreenText80 (long cycles6502)
bits = (bits << 1) | g_nLastColumnPixelNTSC; // GH#555: Align TEXT80 chars with DHGR
updatePixels( bits );
g_nLastColumnPixelNTSC = (bits >> 14) & 1;
#if EXTEND_14M_VIDEO_BY_1_PIXEL
zeroPixel0_14M();
#endif
}
}
#if EXTEND_14M_VIDEO_BY_1_PIXEL
updateVideoScannerHorzEOL_14M();
#else
updateVideoScannerHorzEOL();
#endif
}
}

View File

@ -16,7 +16,6 @@
extern void NTSC_VideoInitChroma();
extern void NTSC_VideoUpdateCycles( UINT cycles6502 );
extern void NTSC_VideoRedrawWholeScreen( void );
extern UINT NTSC_GetFrameBufferBorderlessWidth( void );
enum VideoRefreshRate_e;
void NTSC_SetRefreshRate(VideoRefreshRate_e rate);