Remove redundant code relating to SetCharseType() and g_nCharsetType

This commit is contained in:
tomcw 2017-04-30 18:50:27 +01:00
parent d243425c20
commit 739afea01a
4 changed files with 11 additions and 50 deletions

View File

@ -492,25 +492,6 @@ static void LoadConfigOldJoystick(const UINT uJoyNum)
JoySetJoyType(uJoyNum, uNewJoyType);
}
//Sets the character set for the Apple model/clone
void SetCharsetType(void)
{
switch ( GetApple2Type() )
{
case A2TYPE_APPLE2: g_nCharsetType = 0; break;
case A2TYPE_APPLE2PLUS: g_nCharsetType = 0; break;
case A2TYPE_APPLE2E: g_nCharsetType = 0; break;
case A2TYPE_APPLE2EENHANCED:g_nCharsetType = 0; break;
case A2TYPE_TK30002E: g_nCharsetType = 0; break;
case A2TYPE_PRAVETS82: g_nCharsetType = 1; break;
case A2TYPE_PRAVETS8M: g_nCharsetType = 2; break; //This charset has a very small difference with the PRAVETS82 one, and probably has some misplaced characters.
case A2TYPE_PRAVETS8A: g_nCharsetType = 3; break;
default:
_ASSERT(0);
g_nCharsetType = 0;
}
}
//Reads configuration from the registry entries
void LoadConfiguration(void)
{
@ -542,7 +523,6 @@ void LoadConfiguration(void)
}
SetApple2Type(apple2Type);
SetCharsetType();
//

View File

@ -8,7 +8,6 @@ void LogFileTimeUntilFirstKeyRead(void);
void SetCurrentCLK6502();
bool SetCurrentImageDir(const char* pszImageDir);
void SetCharsetType(void);
extern const UINT16* GetAppleWinVersion(void);
extern char VERSIONSTRING[]; // Constructed in WinMain()

View File

@ -141,7 +141,6 @@ static HWND tooltipwindow = (HWND)0;
static BOOL g_bUsingCursor = 0; // 1=AppleWin is using (hiding) the mouse-cursor
static int viewportx = VIEWPORTX; // Default to Normal (non-FullScreen) mode
static int viewporty = VIEWPORTY; // Default to Normal (non-FullScreen) mode
int g_nCharsetType = 0;
// Direct Draw -- For Full Screen
LPDIRECTDRAW g_pDD = (LPDIRECTDRAW)0;
@ -1201,42 +1200,28 @@ LRESULT CALLBACK FrameWndProc (
DrawButton((HDC)0,buttondown);
}
else if (wparam == VK_F9)
{
//bool bCtrlDown = (GetKeyState(VK_CONTROL) < 0) ? true : false;
//bool bShiftDown = (GetKeyState(VK_SHIFT ) < 0) ? true : false;
{
// F9 Next Video Mode
// SHIFT+F9 Prev Video Mode
// CTRL+SHIFT+F9 Toggle 50% Scan Lines
// ALT+F9 Can't use Alt-F9 as Alt is Open-Apple = Joystick Button #1
// F9 Next Video Mode
// ^F9 Next Char Set
// #F9 Prev Video Mode
// ^#F9 Toggle 50% Scan Lines
// @F9 -Can't use Alt-F9 as Alt is Open-Apple = Joystick Button #1
if ( g_bCtrlKey && !g_bShiftKey ) //CTRL+F9
{
g_nCharsetType++; // Cycle through available charsets (Ctrl + F9)
if (g_nCharsetType >= 3)
{
g_nCharsetType = 0;
}
}
else // Cycle through available video modes
if ( g_bCtrlKey && g_bShiftKey ) // ALT+F9
{
g_uHalfScanLines = !g_uHalfScanLines;
}
else
if ( !g_bShiftKey ) // Drop Down Combo Box is in correct order
if ( !g_bCtrlKey && !g_bShiftKey ) // F9
{
g_eVideoType++;
if (g_eVideoType >= NUM_VIDEO_MODES)
g_eVideoType = 0;
}
else // Forwards
else if ( !g_bCtrlKey && g_bShiftKey ) // SHIFT+F9
{
if (g_eVideoType <= 0)
g_eVideoType = NUM_VIDEO_MODES;
g_eVideoType--;
}
else if ( g_bCtrlKey && g_bShiftKey ) // CTRL+SHIFT+F9
{
g_uHalfScanLines = !g_uHalfScanLines;
}
// TODO: Clean up code:FrameRefreshStatus(DRAW_TITLE) DrawStatusArea((HDC)0,DRAW_TITLE)
DrawStatusArea( (HDC)0, DRAW_TITLE );
@ -1260,7 +1245,6 @@ LRESULT CALLBACK FrameWndProc (
Config_Save_Video();
}
else if ((wparam == VK_F11) && (GetKeyState(VK_CONTROL) >= 0)) // Save state (F11)
{
SoundCore_SetFade(FADE_OUT);

View File

@ -210,7 +210,6 @@ static void Snapshot_LoadState_v1() // .aws v1.0.0.1, up to (and including) Appl
MemUpdatePaging(TRUE);
// NB. g_Apple2Type doesn't change for v1, but replicate this (like v2)
SetCharsetType();
VideoReinitialize(); // g_CharsetType changed
FrameUpdateApple2Type();
}
@ -339,7 +338,6 @@ static void ParseUnitApple2(YamlLoadHelper& yamlLoadHelper, UINT version)
MemLoadSnapshot(yamlLoadHelper);
// g_Apple2Type may've changed: so redraw frame (title, buttons, leds, etc)
SetCharsetType();
VideoReinitialize(); // g_CharsetType changed
FrameUpdateApple2Type();
}