Fix a couple of issues with RGB modes.

This commit is contained in:
Andrea Odetti 2020-10-07 20:45:31 +01:00
parent 13edefa6e0
commit 039bfc04c3
3 changed files with 21 additions and 16 deletions

View file

@ -14,6 +14,7 @@
#include "DiskImageHelper.h"
#include "Memory.h"
#include "Applewin.h"
#include "RGBMonitor.h"
#include "linux/interface.h"
#include "linux/paddle.h"
@ -136,7 +137,7 @@ namespace
typedef bool (*VideoUpdateFuncPtr_t)(int, int, int, int, int);
bool Update40ColCell (int x, int y, int xpixel, int ypixel, int offset)
bool NUpdate40ColCell (int x, int y, int xpixel, int ypixel, int offset)
{
frame->init(24, 40);
asciiArt->init(1, 1);
@ -151,7 +152,7 @@ namespace
return true;
}
bool Update80ColCell (int x, int y, int xpixel, int ypixel, int offset)
bool NUpdate80ColCell (int x, int y, int xpixel, int ypixel, int offset)
{
frame->init(24, 80);
asciiArt->init(1, 2);
@ -170,7 +171,7 @@ namespace
return true;
}
bool UpdateLoResCell (int x, int y, int xpixel, int ypixel, int offset)
bool NUpdateLoResCell (int x, int y, int xpixel, int ypixel, int offset)
{
BYTE val = *(g_pTextBank0+offset);
@ -192,12 +193,12 @@ namespace
return true;
}
bool UpdateDLoResCell (int x, int y, int xpixel, int ypixel, int offset)
bool NUpdateDLoResCell (int x, int y, int xpixel, int ypixel, int offset)
{
return true;
}
bool UpdateHiResCell (int x, int y, int xpixel, int ypixel, int offset)
bool NUpdateHiResCell (int x, int y, int xpixel, int ypixel, int offset)
{
const BYTE * base = g_pHiresBank0 + offset;
@ -225,7 +226,7 @@ namespace
return true;
}
bool UpdateDHiResCell (int x, int y, int xpixel, int ypixel, int offset)
bool NUpdateDHiResCell (int x, int y, int xpixel, int ypixel, int offset)
{
return true;
}
@ -353,6 +354,7 @@ void FrameRefreshStatus(int x, bool)
void NVideoInitialize()
{
VideoInitialize();
VideoSwitchVideocardPalette(RGB_GetVideocard(), GetVideoType());
setlocale(LC_ALL, "");
initscr();
@ -398,15 +400,15 @@ void VideoRedrawScreen()
VideoUpdateFuncPtr_t update = SW_TEXT
? SW_80COL
? Update80ColCell
: Update40ColCell
? NUpdate80ColCell
: NUpdate40ColCell
: SW_HIRES
? (SW_DHIRES && SW_80COL)
? UpdateDHiResCell
: UpdateHiResCell
? NUpdateDHiResCell
: NUpdateHiResCell
: (SW_DHIRES && SW_80COL)
? UpdateDLoResCell
: UpdateLoResCell;
? NUpdateDLoResCell
: NUpdateLoResCell;
int y = 0;
int ypixel = 0;
@ -424,8 +426,8 @@ void VideoRedrawScreen()
}
if (SW_MIXED)
update = SW_80COL ? Update80ColCell
: Update40ColCell;
update = SW_80COL ? NUpdate80ColCell
: NUpdate40ColCell;
while (y < 24) {
int offset = ((y & 7) << 7) + ((y >> 3) * 40);

View file

@ -21,6 +21,7 @@
#include "SaveState.h"
#include "Speaker.h"
#include "Riff.h"
#include "RGBMonitor.h"
#include "linux/data.h"
#include "linux/benchmark.h"
@ -107,6 +108,7 @@ namespace
SpkrInitialize();
MemInitialize();
VideoInitialize();
VideoSwitchVideocardPalette(RGB_GetVideocard(), GetVideoType());
emulator->displayLogo();

View file

@ -89,9 +89,10 @@ static bool g_bVideoScannerNTSC = true; // NTSC video scanning (or PAL)
// The window title will be set to this.
const char *g_apVideoModeDesc[ NUM_VIDEO_MODES ] =
{
"Monochrome Monitor (Custom)"
"Monochrome Monitor (Custom)"
, "Color (Composite Idealized)"
, "Color (RGB Monitor)"
, "Color (NTSC Monitor)"
, "Color (Composite Monitor)"
, "Color TV"
, "B&W TV"
, "Amber Monitor"