Cmd line: support -fs-height=nnnn starting in Windowed mode. (#876)

This commit is contained in:
tomcw 2020-12-12 18:23:23 +00:00
parent 0ddb1917aa
commit 954d7c1731
3 changed files with 28 additions and 21 deletions

View File

@ -64,15 +64,18 @@
-load-state &lt;savestate&gt;<br>
Load a save-state file (and auto power-on the Apple II).<br>
NB. This takes precedent over the -d1, -d2, -s#d#, -h1, -h2, s0-7, -model and -r switches.<br><br>
-f<br>
Start in full-screen mode<br><br>
-f or -full-screen<br>
Start in full-screen mode.<br><br>
-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 mode.<br>
Use to select a better resolution for full-screen or Windowed 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><br>
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>
-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

@ -189,14 +189,18 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
lpNextArg = GetNextArg(lpNextArg);
g_cmdLine.szSnapshotName = lpCmdLine;
}
else if (strcmp(lpCmdLine, "-f") == 0)
else if (strcmp(lpCmdLine, "-f") == 0 || strcmp(lpCmdLine, "-full-screen") == 0)
{
g_cmdLine.bSetFullScreen = true;
}
else if (strcmp(lpCmdLine, "-no-full-screen") == 0)
{
g_cmdLine.bSetFullScreen = false;
}
#define CMD_FS_HEIGHT "-fs-height="
else if (strncmp(lpCmdLine, CMD_FS_HEIGHT, sizeof(CMD_FS_HEIGHT)-1) == 0)
{
g_cmdLine.bSetFullScreen = true; // Implied
g_cmdLine.bSetFullScreen = true; // Implied. Can be overridden by "-no-full-screen"
LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_HEIGHT)-1;
bool bRes = false;

View File

@ -989,23 +989,23 @@ 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.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;
}
PostMessage(g_hFrameWindow, WM_USER_FULLSCREEN, 0, 0);
g_cmdLine.bSetFullScreen = false;
}