OK, this is the first pass at some love for the OSX port, which doesn't

get nearly enough attention.  This is about to change, since I'm moving
to using it full time at work (still Linux at home though!).

The 'Control' key modifier for OSX is now the actual Control key, just like
on every other platform (instead of Command).  The 'Alt' key modifier for
OSX is now the Command key (instead of Shift-Cmd).  Maybe in the past it
made sense for this, when keyboards weren't the same between platforms, but
that's no longer the case.  And since Stella requires at least OSX 10.4,
everyone using it from this point on probably has newer hardware.
Still TODO is consider a few special keys for OSX (minimize, hide, etc).

Updated documentation for new key combos, as well as the recent build
and debugger improvements.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1906 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2009-11-13 17:35:42 +00:00
parent 3501fdcc3b
commit d8bca7a519
4 changed files with 87 additions and 84 deletions

View File

@ -305,15 +305,16 @@
<p> <p>
<h2><b>Macintosh</b></h2> <h2><b>Macintosh</b></h2>
<p>The Mac version of Stella is designed to work on a Power Macintosh with <p>The Mac version of Stella is designed to work on an Apple Macintosh with
the following:</p> the following:</p>
<ul> <ul>
<li>Mac OSX 10.3 or Above</li> <li>Mac OSX 10.4 (Tiger) or above</li>
<li>500 MHz G4 PPC/Intel processor or above (Stella <b>may</b> work with a G3 <li>PPC G4 or Intel processor, 500MHz or above</li>
processor, but no hardware is available for testing)</li> <li>OpenGL capable video card; software rendering mode is still available,
<li>OpenGL capable video card. Software rendering mode is still available, but as of OSX 10.4 is substandard compared to OpenGL</li>
but as of OSX 10.4 is substandard compared to OpenGL.</li> <li>Xcode 3.2 is required to compile the Stella source code (SDL 1.2.14 also
<li>Xcode 3.0 is required to compile the Stella source code</li> required to compile the 64-bit version)</li>
<li>The 64-bit version requires at minimum Snow Leopard (10.6) and Intel CPU</li>
</ul> </ul>
<p> <p>
@ -334,10 +335,9 @@
<h2><b>Other</b></h2> <h2><b>Other</b></h2>
<p>Stella is extremely portable, and in its lifetime has been ported to almost every <p>Stella is extremely portable, and in its lifetime has been ported to almost every
platform where the SDL library exists. It is 32/64 bit clean in Linux/Unix and Windows platform where the SDL library exists. It is 32/64 bit clean in Linux/Unix, Mac OSX
(win32/x64), and is expected to be compatible with 64-bit OSX as well. The Stella and Windows. The Stella team is interested in hearing about any problems you may
team is interested in hearing about any problems you may encounter with diverse encounter with diverse operating systems and CPU types.</p>
operating systems and CPU types.</p>
<!-- ///////////////////////////////////////////////////////////////////////// --> <!-- ///////////////////////////////////////////////////////////////////////// -->
@ -417,7 +417,7 @@
<li><b>Binary DMG file</b> (StellaOSX<i>release</i>.dmg) <li><b>Binary DMG file</b> (StellaOSX<i>release</i>.dmg)
<ol> <ol>
<li>Mount the disk image, then copy the StellaOSX<i>release</i> folder to <li>Mount the disk image, then copy the StellaOSX<i>release</i> folder to
your hard drive.</li> your hard drive</li>
</ol> </ol>
</li> </li>
<li><b>Compressed tarball : building from source code</b> (stella-<i>release</i>-src.tar.gz) <li><b>Compressed tarball : building from source code</b> (stella-<i>release</i>-src.tar.gz)
@ -425,10 +425,18 @@
<li>Extract files from the distribution using an archiving program that supports <li>Extract files from the distribution using an archiving program that supports
gzipped tar files</li> gzipped tar files</li>
<li>Open the <b>stella-<i>release</i>/src/macosx/stella.xcodeproj</b> <li>Open the <b>stella-<i>release</i>/src/macosx/stella.xcodeproj</b>
file using Xcode 3.0</li> file using Xcode 3.2</li>
<li>Make sure you have the SDL framework installed where Xcode can find it</li> <li>Make sure you have the SDL framework installed where Xcode can find it</li>
<li>Build the 'Stella' project</li> <li>Build the 'Stella' project</li>
<li>Copy the <b>StellaOSX.app</b> package somewhere on your system</li> <li>For installation:
<ul>
<li>Run the script <b>Create_build.sh</b>, located in the src/macosx directory.
This will create a DMG file on your desktop.</li>
<b>OR</b>
<li>Copy the <b>StellaOSX.app</b> package somewhere on your system</li>
</ul>
<li>For compiling the Intel version only, open the <b>stella-<i>release</i>/src/macosx/stella_intel.xcodeproj</b> file instead, and continue from
step 2 above.</li>
</ol> </ol>
</li> </li>
</ul> </ul>
@ -750,6 +758,14 @@
<td>Enable/disable the PAL color-loss effect.</td> <td>Enable/disable the PAL color-loss effect.</td>
</tr> </tr>
<tr>
<td><pre>-framerate &lt;number&gt;</pre></td>
<td>Display the given number of frames per second. Normally, Stella
will determine framerate based on number of scanlines.
Setting this to 0 automatically enables auto-frame
calculation (ie, framerate based on scanlines).</td>
</tr>
<tr> <tr>
<td><pre>-timing &lt;sleep|busy&gt;</pre></td> <td><pre>-timing &lt;sleep|busy&gt;</pre></td>
<td>Determines type of wait to perform between processing frames. <td>Determines type of wait to perform between processing frames.
@ -761,11 +777,10 @@
</tr> </tr>
<tr> <tr>
<td><pre>-framerate &lt;number&gt;</pre></td> <td><pre>-uimessages &lt;1|0&gt;</pre></td>
<td>Display the given number of frames per second. Normally, Stella <td>Enable or disable display of message in the UI. Note that messages
will determine framerate based on number of scanlines. indicating serious errors override this setting, and are always
Setting this to 0 automatically enables auto-frame shown.</td>
calculation (ie, framerate based on scanlines).</td>
</tr> </tr>
<tr> <tr>
@ -1030,8 +1045,8 @@
</tr> </tr>
<tr> <tr>
<td><pre>-tiafloat &lt;1|0&gt;</pre></td> <td><pre>-tiadriven &lt;1|0&gt;</pre></td>
<td>Set unused TIA pins to be floating on a read/peek.</td> <td>Set unused TIA pins to be randomly driven high or low on a read/peek.</td>
</tr> </tr>
<tr> <tr>
@ -1411,7 +1426,7 @@
<tr> <tr>
<td>Pause/resume emulation</td> <td>Pause/resume emulation</td>
<td>Pause</td> <td>Pause</td>
<td>Pause</td> <td>&nbsp;</td>
</tr> </tr>
</table> </table>
@ -1824,139 +1839,139 @@
<tr> <tr>
<td>Set "Display.YStart" to next <i>larger</i> value</td> <td>Set "Display.YStart" to next <i>larger</i> value</td>
<td>Alt + PageUp</td> <td>Alt + PageUp</td>
<td>Shift-Cmd + PageUp</td> <td>Cmd + PageUp</td>
</tr> </tr>
<tr> <tr>
<td>Set "Display.YStart" to next <i>smaller</i> value</td> <td>Set "Display.YStart" to next <i>smaller</i> value</td>
<td>Alt + PageDown</td> <td>Alt + PageDown</td>
<td>Shift-Cmd + PageDown</td> <td>Cmd + PageDown</td>
</tr> </tr>
<tr> <tr>
<td>Set "Display.Height" to next <i>larger</i> value</td> <td>Set "Display.Height" to next <i>larger</i> value</td>
<td>Control + PageUp</td> <td>Control + PageUp</td>
<td>Cmd + PageUp</td> <td>Control + PageUp</td>
</tr> </tr>
<tr> <tr>
<td>Set "Display.Height" to next <i>smaller</i> value</td> <td>Set "Display.Height" to next <i>smaller</i> value</td>
<td>Control + PageDown</td> <td>Control + PageDown</td>
<td>Cmd + PageDown</td> <td>Control + PageDown</td>
</tr> </tr>
<tr> <tr>
<td>Toggle frame stats (scanline count/fps/bs type/etc)</td> <td>Toggle frame stats (scanline count/fps/bs type/etc)</td>
<td>Alt + l</td> <td>Alt + l</td>
<td>Shift-Cmd + l</td> <td>Cmd + l</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Player0 object</td> <td>Toggle TIA Player0 object</td>
<td>Alt + z</td> <td>Alt + z</td>
<td>Shift-Cmd + z</td> <td>Cmd + z</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Player1 object</td> <td>Toggle TIA Player1 object</td>
<td>Alt + x</td> <td>Alt + x</td>
<td>Shift-Cmd + x</td> <td>Cmd + x</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Missile0 object</td> <td>Toggle TIA Missile0 object</td>
<td>Alt + c</td> <td>Alt + c</td>
<td>Shift-Cmd + c</td> <td>Cmd + c</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Missile1 object</td> <td>Toggle TIA Missile1 object</td>
<td>Alt + v</td> <td>Alt + v</td>
<td>Shift-Cmd + v</td> <td>Cmd + v</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Ball object</td> <td>Toggle TIA Ball object</td>
<td>Alt + b</td> <td>Alt + b</td>
<td>Shift-Cmd + b</td> <td>Cmd + b</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Playfield object</td> <td>Toggle TIA Playfield object</td>
<td>Alt + n</td> <td>Alt + n</td>
<td>Shift-Cmd + n</td> <td>Cmd + n</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Player0 collisions</td> <td>Toggle TIA Player0 collisions</td>
<td>Shift-Alt + z</td> <td>Shift-Alt + z</td>
<td>TODO</td> <td>Shift-Cmd + z</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Player1 collisions</td> <td>Toggle TIA Player1 collisions</td>
<td>Shift-Alt + x</td> <td>Shift-Alt + x</td>
<td>TODO</td> <td>Shift-Cmd + x</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Missile0 collisions</td> <td>Toggle TIA Missile0 collisions</td>
<td>Shift-Alt + c</td> <td>Shift-Alt + c</td>
<td>TODO</td> <td>Shift-Cmd + c</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Missile1 collisions</td> <td>Toggle TIA Missile1 collisions</td>
<td>Shift-Alt + v</td> <td>Shift-Alt + v</td>
<td>TODO</td> <td>Shift-Cmd + v</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Ball collisions</td> <td>Toggle TIA Ball collisions</td>
<td>Shift-Alt + b</td> <td>Shift-Alt + b</td>
<td>TODO</td> <td>Shift-Cmd + b</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA Playfield collisions</td> <td>Toggle TIA Playfield collisions</td>
<td>Shift-Alt + n</td> <td>Shift-Alt + n</td>
<td>TODO</td> <td>Shift-Cmd + n</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA HMOVE blanks</td> <td>Toggle TIA HMOVE blanks</td>
<td>Alt + m</td> <td>Alt + m</td>
<td>Shift-Cmd + m</td> <td>Cmd + m</td>
</tr> </tr>
<tr> <tr>
<td>Toggle TIA 'Fixed Debug Colors' mode</td> <td>Toggle TIA 'Fixed Debug Colors' mode</td>
<td>Alt + Comma</td> <td>Alt + Comma</td>
<td>Shift-Cmd + Comma</td> <td>Cmd + Comma</td>
</tr> </tr>
<tr> <tr>
<td>Turn all TIA objects off</td> <td>Turn all TIA objects off</td>
<td>Alt + .</td> <td>Alt + .</td>
<td>Shift-Cmd + .</td> <td>Cmd + .</td>
</tr> </tr>
<tr> <tr>
<td>Turn all TIA objects on</td> <td>Turn all TIA objects on</td>
<td>Alt + /</td> <td>Alt + /</td>
<td>Shift-Cmd + /</td> <td>Cmd + /</td>
</tr> </tr>
<tr> <tr>
<td>Turn all TIA collisions off</td> <td>Turn all TIA collisions off</td>
<td>Shift-Alt + .</td> <td>Shift-Alt + .</td>
<td>TODO</td> <td>Shift-Cmd + .</td>
</tr> </tr>
<tr> <tr>
<td>Turn all TIA collisions on</td> <td>Turn all TIA collisions on</td>
<td>Shift-Alt + /</td> <td>Shift-Alt + /</td>
<td>TODO</td> <td>Shift-Cmd + /</td>
</tr> </tr>
</table> </table>
@ -1990,68 +2005,68 @@
<tr> <tr>
<td>Decrease volume (*)</td> <td>Decrease volume (*)</td>
<td>Alt + [</td> <td>Alt + [</td>
<td>Shift-Cmd + [</td> <td>Cmd + [</td>
</tr> </tr>
<tr> <tr>
<td>Increase volume (*)</td> <td>Increase volume (*)</td>
<td>Alt + ]</td> <td>Alt + ]</td>
<td>Shift-Cmd + ]</td> <td>Cmd + ]</td>
</tr> </tr>
<tr> <tr>
<td>Grab mouse (keep mouse in game window)</td> <td>Grab mouse (keep mouse in game window)</td>
<td>Control + g</td> <td>Control + g</td>
<td>Cmd + g</td> <td>Control + g</td>
</tr> </tr>
<tr> <tr>
<td>Toggle display palette (<i>NTSC/PAL/SECAM</i>)</td> <td>Toggle display palette (<i>NTSC/PAL/SECAM</i>)</td>
<td>Control + f</td> <td>Control + f</td>
<td>Cmd + f</td> <td>Control + f</td>
</tr> </tr>
<tr> <tr>
<td>Save current properties to a new properties file</td> <td>Save current properties to a new properties file</td>
<td>Control + s</td> <td>Control + s</td>
<td>Cmd + s</td> <td>Control + s</td>
</tr> </tr>
<tr> <tr>
<td>Set mouse to emulate paddle 0</td> <td>Set mouse to emulate paddle 0</td>
<td>Control + 0</td> <td>Control + 0</td>
<td>Cmd + 0</td> <td>Control + 0</td>
</tr> </tr>
<tr> <tr>
<td>Set mouse to emulate paddle 1</td> <td>Set mouse to emulate paddle 1</td>
<td>Control + 1</td> <td>Control + 1</td>
<td>Cmd + 1</td> <td>Control + 1</td>
</tr> </tr>
<tr> <tr>
<td>Set mouse to emulate paddle 2</td> <td>Set mouse to emulate paddle 2</td>
<td>Control + 2</td> <td>Control + 2</td>
<td>Cmd + 2</td> <td>Control + 2</td>
</tr> </tr>
<tr> <tr>
<td>Set mouse to emulate paddle 3</td> <td>Set mouse to emulate paddle 3</td>
<td>Control + 3</td> <td>Control + 3</td>
<td>Cmd + 3</td> <td>Control + 3</td>
</tr> </tr>
<tr> <tr>
<td>Reload current ROM (singlecart ROM, TIA mode)<br> <td>Reload current ROM (singlecart ROM, TIA mode)<br>
Load next game in ROM (multicart ROM, TIA mode)</td> Load next game in ROM (multicart ROM, TIA mode)</td>
<td>Control + r</td> <td>Control + r</td>
<td>Cmd + r</td> <td>Control + r</td>
</tr> </tr>
<tr> <tr>
<td>Reload ROM listing (ROM launcher mode)</td> <td>Reload ROM listing (ROM launcher mode)</td>
<td>Control + r</td> <td>Control + r</td>
<td>Cmd + r</td> <td>Control + r</td>
</tr> </tr>
<tr> <tr>
@ -2069,19 +2084,19 @@
<tr> <tr>
<td>Toggle 'phosphor' effect</td> <td>Toggle 'phosphor' effect</td>
<td>Alt + p</td> <td>Alt + p</td>
<td>Shift-Cmd + p</td> <td>Cmd + p</td>
</tr> </tr>
<tr> <tr>
<td>Toggle palette</td> <td>Toggle palette</td>
<td>Control + p</td> <td>Control + p</td>
<td>Cmd + p</td> <td>Control + p</td>
</tr> </tr>
<tr> <tr>
<td>Toggle PAL color-loss effect</td> <td>Toggle PAL color-loss effect</td>
<td>Control + l</td> <td>Control + l</td>
<td>Cmd + l</td> <td>Control + l</td>
</tr> </tr>
</table> </table>

View File

@ -330,10 +330,17 @@ void EventHandler::poll(uInt64 time)
// An attempt to speed up event processing // An attempt to speed up event processing
// All SDL-specific event actions are accessed by either // All SDL-specific event actions are accessed by either
// Control/Cmd or Alt/Shift-Cmd keys. So we quickly check for those. // Control or Alt/Cmd keys. So we quickly check for those.
if(kbdAlt(mod) && state) if(kbdAlt(mod) && state)
{ {
#ifdef MAC_OSX
// These keys work in all states // These keys work in all states
if(key == SDLK_q)
{
handleEvent(Event::Quit, 1);
}
else
#endif
if(key == SDLK_RETURN) if(key == SDLK_RETURN)
{ {
myOSystem->frameBuffer().toggleFullscreen(); myOSystem->frameBuffer().toggleFullscreen();
@ -343,7 +350,6 @@ void EventHandler::poll(uInt64 time)
{ {
switch(int(key)) switch(int(key))
{ {
#ifndef MAC_OSX
case SDLK_EQUALS: case SDLK_EQUALS:
myOSystem->frameBuffer().changeVidMode(+1); myOSystem->frameBuffer().changeVidMode(+1);
break; break;
@ -351,7 +357,7 @@ void EventHandler::poll(uInt64 time)
case SDLK_MINUS: case SDLK_MINUS:
myOSystem->frameBuffer().changeVidMode(-1); myOSystem->frameBuffer().changeVidMode(-1);
break; break;
#endif
case SDLK_LEFTBRACKET: case SDLK_LEFTBRACKET:
myOSystem->sound().adjustVolume(-1); myOSystem->sound().adjustVolume(-1);
break; break;
@ -490,26 +496,12 @@ void EventHandler::poll(uInt64 time)
myOSystem->frameBuffer().grabMouse(myGrabMouseFlag); myOSystem->frameBuffer().grabMouse(myGrabMouseFlag);
} }
} }
#ifdef MAC_OSX
else if(key == SDLK_RETURN)
{
myOSystem->frameBuffer().toggleFullscreen();
}
#endif
// These only work when in emulation mode // These only work when in emulation mode
else if(myState == S_EMULATE) else if(myState == S_EMULATE)
{ {
switch(int(key)) switch(int(key))
{ {
#ifdef MAC_OSX #ifdef MAC_OSX
case SDLK_EQUALS:
myOSystem->frameBuffer().changeVidMode(+1);
break;
case SDLK_MINUS:
myOSystem->frameBuffer().changeVidMode(-1);
break;
case SDLK_h: case SDLK_h:
case SDLK_m: case SDLK_m:
case SDLK_SLASH: case SDLK_SLASH:

View File

@ -189,17 +189,13 @@ class EventHandler
#ifndef MAC_OSX #ifndef MAC_OSX
return (mod & KMOD_ALT); return (mod & KMOD_ALT);
#else #else
return ((mod & KMOD_META) && (mod & KMOD_SHIFT)); return (mod & KMOD_META);
#endif #endif
} }
inline bool kbdControl(int mod) inline bool kbdControl(int mod)
{ {
#ifndef MAC_OSX
return (mod & KMOD_CTRL) > 0; return (mod & KMOD_CTRL) > 0;
#else
return ((mod & KMOD_META) && !(mod & KMOD_SHIFT));
#endif
} }
inline bool kbdShift(int mod) inline bool kbdShift(int mod)

View File

@ -1797,7 +1797,7 @@
2D91752209BA903B0026E9FF /* Development */ = { 2D91752209BA903B0026E9FF /* Development */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
., .,
"$(HOME)/Library/Frameworks", "$(HOME)/Library/Frameworks",
@ -1810,7 +1810,7 @@
2D91752309BA903B0026E9FF /* Deployment */ = { 2D91752309BA903B0026E9FF /* Deployment */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
., .,
"$(HOME)/Library/Frameworks", "$(HOME)/Library/Frameworks",
@ -1826,7 +1826,7 @@
2D91752409BA903B0026E9FF /* Default */ = { 2D91752409BA903B0026E9FF /* Default */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
MACOSX_DEPLOYMENT_TARGET = 10.4; MACOSX_DEPLOYMENT_TARGET = 10.4;
SDKROOT = macosx10.4; SDKROOT = macosx10.4;