Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Andrea Odetti 2021-06-01 16:35:36 +01:00
commit 629afb1055
9 changed files with 63 additions and 43 deletions

View file

@ -9,6 +9,16 @@ https://github.com/AppleWin/AppleWin/issues/new
Tom Charlesworth
1.30.2.0 - 31 May 2021
----------------------
. [Change #947] Uthernet: fix so that a h/w change doesn't require the app to be close & reopened. [audetto]
. [Change #876] Command line: change -fs-height so only applied during full-screen (Windows mode unaffected).
. [Bug #958] Debugger: Mockingboard speech interrupt not working in debugger 'gg' mode.
. [Bug #952] Fix Mockingboard SC-01 speech for Ape Escape.
. Fix Phasor regression (at 1.30.0.0) as it does support reading AY-3-8913 registers in Mockingboard mode & Phasor native mode (just not Echo+ mode).
. Debugger: when displaying 6522 registers, if T1 and/or T2 is active, then display in white.
1.30.1.0 - 3 May 2021
---------------------
. Improve Mockingboard's 6522 support for cycle-accurate reading of IFR at Timer1/2 underflow.
@ -31,7 +41,7 @@ Note: This version only works under Windows XP and later.
- A better alternative fix for WOZ images: 'Wasteland' and 'Legacy of the Ancients'.
- Fix for WOZ images: 'Gruds in Space' (bug #921) and 'Buzzard Bait' (bug #930).
. [Change #912] For 'Base 64A' add support for its F2 key via the Windows DEL key.
. [Change #876] Starting up windowed mode & fullscreen mode
. [Change #876] Starting up windowed mode & full-screen mode
- New command line switch -no-full-screen to start in windowed mode.
- Added command line switch -full-screen as an alias for -f.
. [Change #864] Anti-M 1.8 doesn't work

View file

@ -71,13 +71,13 @@
-no-full-screen<br>
Start in Windowed mode (default).<br><br>
-fs-height=&lt;best|nnnn&gt;<br>
Use to select a better resolution for full-screen or Windowed mode.<br>
Use to select a better resolution for full-screen mode.<br>
<ul>
<li>best: picks the highest resolution where the height is an integer multiple of (192*2)</li>
<li>nnnn: select a specific resolution with height=nnnn pixels</li>
</ul>
NB. This changes the display resolution (and restores on exit).<br>
NB. Specify -no-full-screen after this switch for Windowed mode. Without this it'll just default to full-screen.<br><br>
NB. Combine with <em>-no-full-screen</em> to start in Windowed mode. Without this it'll just default to full-screen.<br>
NB. When switching to Windowed mode the default desktop resolution will be restored, and when switching back to full-screen mode this better resolution will again be used.<br><br>
-rom &lt;file&gt;<br>
Use custom 12K ROM (at $D000) for Apple II machine, or 16K ROM (at $C000) for Apple //e machine.<br><br>
-f8rom &lt;file&gt;<br>

View file

@ -1,4 +1,4 @@
#define APPLEWIN_VERSION 1,30,1,0
#define APPLEWIN_VERSION 1,30,2,0
#define xstr(a) str(a)
#define str(a) #a

View file

@ -199,33 +199,35 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
}
else if (strcmp(lpCmdLine, "-f") == 0 || strcmp(lpCmdLine, "-full-screen") == 0)
{
g_cmdLine.bSetFullScreen = true;
g_cmdLine.setFullScreen = 1;
}
else if (strcmp(lpCmdLine, "-no-full-screen") == 0)
{
g_cmdLine.bSetFullScreen = false;
g_cmdLine.setFullScreen = 0;
}
#define CMD_FS_HEIGHT "-fs-height="
else if (strncmp(lpCmdLine, CMD_FS_HEIGHT, sizeof(CMD_FS_HEIGHT)-1) == 0)
{
g_cmdLine.bSetFullScreen = true; // Implied. Can be overridden by "-no-full-screen"
if (g_cmdLine.setFullScreen < 0) // Not yet been specified on cmd line?
g_cmdLine.setFullScreen = 1; // Implicity set full-screen. NB. Can be overridden by "-no-full-screen"
LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_HEIGHT)-1;
bool bRes = false;
UINT bestWidth=0, bestHeight=0;
if (strcmp(lpTmp, "best") == 0)
{
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(g_cmdLine.bestWidth, g_cmdLine.bestHeight);
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(bestWidth, bestHeight);
}
else
{
UINT userSpecifiedHeight = atoi(lpTmp);
if (userSpecifiedHeight)
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(g_cmdLine.bestWidth, g_cmdLine.bestHeight, userSpecifiedHeight);
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(bestWidth, bestHeight, userSpecifiedHeight);
else
LogFileOutput("Invalid cmd-line parameter for -fs-height=x switch\n");
}
if (bRes)
LogFileOutput("Best resolution for -fs-height=x switch: Width=%d, Height=%d\n", g_cmdLine.bestWidth, g_cmdLine.bestHeight);
LogFileOutput("Best resolution for -fs-height=x switch: Width=%d, Height=%d\n", bestWidth, bestHeight);
else
LogFileOutput("Failed to set parameter for -fs-height=x switch\n");
}

View file

@ -12,15 +12,12 @@ struct CmdLine
CmdLine()
{
bShutdown = false;
bSetFullScreen = false;
setFullScreen = -1;
bBoot = false;
bChangedDisplayResolution = false;
bSlot0LanguageCard = false;
bSlot7EmptyOnExit = false;
bSwapButtons0and1 = false;
bRemoveNoSlotClock = false;
bestWidth = 0;
bestHeight = 0;
szImageName_harddisk[HARDDISK_1] = NULL;
szImageName_harddisk[HARDDISK_2] = NULL;
szSnapshotName = NULL;
@ -49,17 +46,14 @@ struct CmdLine
}
bool bShutdown;
bool bSetFullScreen;
int setFullScreen; // tristate: -1 (no cmd line specified), 0="-no-full-screen", 1="-full-screen"
bool bBoot;
bool bChangedDisplayResolution;
bool bSlot0LanguageCard;
bool bSlotEmpty[NUM_SLOTS];
bool bSlot7EmptyOnExit;
bool bSwapButtons0and1;
bool bRemoveNoSlotClock;
SS_CARDTYPE slotInsert[NUM_SLOTS];
UINT bestWidth;
UINT bestHeight;
LPSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
bool driveConnected[NUM_SLOTS][NUM_DRIVES];
LPSTR szImageName_harddisk[NUM_HARDDISKS];

View file

@ -643,7 +643,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
if (g_bRestart)
{
g_cmdLine.bSetFullScreen = g_bRestartFullScreen;
g_cmdLine.setFullScreen = g_bRestartFullScreen ? 1 : 0;
g_bRestartFullScreen = false;
MB_Reset(true);
@ -981,25 +981,10 @@ static void RepeatInitialization(void)
}
else
{
if (g_cmdLine.bestWidth && g_cmdLine.bestHeight)
{
DEVMODE devMode;
memset(&devMode, 0, sizeof(devMode));
devMode.dmSize = sizeof(devMode);
devMode.dmPelsWidth = g_cmdLine.bestWidth;
devMode.dmPelsHeight = g_cmdLine.bestHeight;
devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
DWORD dwFlags = 0;
LONG res = ChangeDisplaySettings(&devMode, dwFlags);
if (res == 0)
g_cmdLine.bChangedDisplayResolution = true;
}
if (g_cmdLine.bSetFullScreen)
if (g_cmdLine.setFullScreen > 0)
{
PostMessage(GetFrame().g_hFrameWindow, WM_USER_FULLSCREEN, 0, 0);
g_cmdLine.bSetFullScreen = false;
g_cmdLine.setFullScreen = 0;
}
if (g_cmdLine.bBoot)
@ -1012,8 +997,7 @@ static void RepeatInitialization(void)
static void Shutdown(void)
{
if (g_cmdLine.bChangedDisplayResolution)
ChangeDisplaySettings(NULL, 0); // restore default
ChangeDisplaySettings(NULL, 0); // restore default resolution
// Release COM
SysClk_UninitTimer();

View file

@ -36,6 +36,8 @@ Win32Frame::Win32Frame()
g_win_fullscreen_scale = 1;
g_win_fullscreen_offsetx = 0;
g_win_fullscreen_offsety = 0;
m_bestWidthForFullScreen = 0;
m_bestHeightForFullScreen = 0;
btnfacebrush = (HBRUSH)0;
btnfacepen = (HPEN)0;

View file

@ -96,8 +96,8 @@ private:
bool ConfirmReboot(bool bFromButtonUI);
void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive);
void RelayEvent(UINT message, WPARAM wparam, LPARAM lparam);
void SetFullScreenMode();
void SetNormalMode();
void SetFullScreenMode(void);
void SetNormalMode(void);
void SetUsingCursor(BOOL bNewValue);
void SetupTooltipControls(void);
void FrameResizeWindow(int nNewScale);
@ -132,6 +132,8 @@ private:
FULLSCREEN_SCALE_TYPE g_win_fullscreen_scale;
int g_win_fullscreen_offsetx;
int g_win_fullscreen_offsety;
UINT m_bestWidthForFullScreen;
UINT m_bestHeightForFullScreen;
static const UINT MAX_DRAW_DEVICES = 10;
char* draw_devices[MAX_DRAW_DEVICES];

View file

@ -2107,7 +2107,7 @@ int Win32Frame::GetFullScreenOffsetY(void)
return g_win_fullscreen_offsety;
}
void Win32Frame::SetFullScreenMode ()
void Win32Frame::SetFullScreenMode(void)
{
#ifdef NO_DIRECT_X
@ -2115,6 +2115,21 @@ void Win32Frame::SetFullScreenMode ()
#else // NO_DIRECT_X
if (m_bestWidthForFullScreen && m_bestHeightForFullScreen)
{
DEVMODE devMode;
memset(&devMode, 0, sizeof(devMode));
devMode.dmSize = sizeof(devMode);
devMode.dmPelsWidth = m_bestWidthForFullScreen;
devMode.dmPelsHeight = m_bestHeightForFullScreen;
devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
DWORD dwFlags = 0;
LONG res = ChangeDisplaySettings(&devMode, dwFlags);
}
//
MONITORINFO monitor_info;
FULLSCREEN_SCALE_TYPE width, height, scalex, scaley;
int top, left;
@ -2158,8 +2173,10 @@ void Win32Frame::SetFullScreenMode ()
}
//===========================================================================
void Win32Frame::SetNormalMode ()
void Win32Frame::SetNormalMode(void)
{
ChangeDisplaySettings(NULL, 0); // restore default resolution
FullScreenRevealCursor(); // Do before clearing g_bIsFullScreen flag
buttonover = -1;
@ -2682,6 +2699,9 @@ void Win32Frame::FrameUpdateApple2Type(void)
bool Win32Frame::GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight /*= 0*/)
{
m_bestWidthForFullScreen = 0;
m_bestHeightForFullScreen = 0;
typedef std::vector< std::pair<UINT,UINT> > VEC_PAIR;
VEC_PAIR vecDisplayResolutions;
@ -2733,6 +2753,9 @@ bool Win32Frame::GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& be
bestWidth = width;
bestHeight = userSpecifiedHeight;
m_bestWidthForFullScreen = bestWidth;
m_bestHeightForFullScreen = bestHeight;
return true;
}
@ -2760,5 +2783,8 @@ bool Win32Frame::GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& be
bestWidth = tmpBestWidth;
bestHeight = tmpBestHeight;
m_bestWidthForFullScreen = bestWidth;
m_bestHeightForFullScreen = bestHeight;
return true;
}