#
# SDLHAZEMD 0.12a - by Olivier Galibert and R. Belmont
#
# For Linux/Unix, Mac OS X (both PPC and Intel), and FreeBSD systems.
# Portable to anything remotely POSIX-y with SDL 1.2.11 available.
#

Changes from 0.10a
==================
1) Up to date with mainline 0.12a and SDLMAME 0.109, including all the 
   enhancements made to those items.  See hazemd.txt for details on the 
   mainline changes.
2) No longer attempts to exit to the debugger unless -debug is on.  This
   prevents being stuck in full-screen on Linux/Mac/BSD.


The rest of this document is the same as for SDLMAME and SDLMESS - if you've already compiled them, 
you already know what to do.

Recommended benchmark switches: -noartwork -nosound -video none -nothrottle -ftr 5000 -window
But feel free to customize.


Build instructions
==================

Linux: make sure you have SDL and it's development packages installed via apt-get, yum, emerge, or
whatever your distro of choice uses. On Fedora 4 or 5, 'yum install SDL SDL-devel' will get you going 
assuming you already have GCC. If you already can compile XMAME/XMESS with the SDL target 
you're good to go. Just edit the makefile, change the options as necessary, and type 'make'.

In most cases on Linux you'll want to comment out BUILD_EXPAT and BUILD_ZLIB since most systems have them 
already present and you'll save some time and memory using the system's version (plus if security problems 
arise your distro's normal update will protect SDLMAME without having to upgrade SDLMAME).

For native 64-bit x86-64, you should also uncomment "PTR64 = 1".

NOTE: you will now need OpenGL headers and libraries as well.  If you're running either ATI or NVIDIA's
binary-only drivers you've definitely got them.  Otherwise you may need to install the "MesaGL" and 
"MesaGL-devel" packages.  NOTE: if you do not have hardware accelerated OpenGL you should not try to enable
it, it'll just go horribly slow.

--

Mac OS X: you'll need Xcode 2.3 or later (a free download from developer.apple.com) and SDL 1.2.11. Get SDL 
from www.libsdl.org, click the "SDL 1.2" download link in the sidebar, then scroll down to "Mac OS X" under
"Runtime Libraries".  Download the "SDL-1.2.11.dmg" disk image and open it.  Click 'Macintosh HD' or whatever 
your Mac's hard disk is named in the left pane of a Finder window, then open the Library folder and drag the 
SDL.framework folder from the SDL disk image into the 'Frameworks' folder. 

Next unzip the SDLMAME source in your home directory and edit the makefile with your favorite editor 
(even good old emacs). Change the 'SUBARCH=linux' line to 'SUBARCH=macosx' (lowercase is important). 
If you have an Intel Mac, the other default settings should be fine for you.  If you have a PowerPC Mac,
put a # before "PM = 1" and remove the # mark before "G4 = 1" or "G5 = 1", depending on if your Mac is a G4
or G5.  You don't have to explicitly disable the X86 DRCs for a PPC build - the makefile does it for you
automatically.  Save the makefile and type 'make' from a command prompt to build.

NOTE: I'm told there were a lot of OpenGL fixes in the 10.4.7 update, so if you experience issues with
OpenGL mode make sure your OS X is up to date first, especially on Intel Macs.

--

Win32: First, download SDL 1.2.11.  Go to www.libsdl.org and click "SDL 1.2" under "Downloads".  Scroll 
down to "Development libraries" and open "SDL-devel-1.2.11-mingw32.tar.gz".  Assuming you have WinZip or
a compatible archiver installed it should open automatically.  Decompress it into C:\, where it will create
the "SDL-1.2.11" folder.  Open that folder.  Drag the "bin" and "lib" folders into your MinGW
installation (note: it must be a mame.net style install, raw MinGW will not work).  Finally, create a new
folder "SDL" inside "include" in your MinGW install (e.g. MinGW\include\SDL) and copy the contents of 
SDL-1.2.11\include into that folder.

Now, Edit makefile.w32 with e.g. "edit makefile.w32" or Notepad or whatever.  Change the CPU type to
whatever you need.  The other defaults should be fine for you.  Type 'mingw32-make -f makefile.w32' to 
build SDLMAME.  Unlike normal MAME, you'll need the SDL.dll from the SDL package in order to run it, so don't
try moving it to another machine without that file accompanying it.

NOTE: MinGW appears to already come with sufficient OpenGL headers and libraries to build.  If problems
occur, make sure your video card drivers are up to date.

--

Other: SDLMAME should work with very little effort on other SDL targets, especially Unix and Unix-like ones.
Start with the Linux target and modify as necessary.  For non-Intel systems, turn off the X86_*_DRCs.  For
big-endian systems, don't -DLSB_FIRST.  If you get SDLMAME running on other platforms, let us know.

-------------------------------------

Run-time options:

Most of these are the same as for the Win32 version of MAME and so familiarity with that program will
pay off here.  The video options behave somewhat differently, however, so they get special coverage.

Please see docs/windows.txt for the baseline windows options - just ignore the stuff about DirectX :-)
If you're not sure about what Windows options SDLMAME supports, run it with the -showusage switch.

-video: "soft" uses software rendering, which is slower but more compatible.  "opengl" uses OpenGL and your
 graphics accelerator to speed up many aspects of drawing MAME including compositing artwork, overlays, and
 bezels, as well as stretching the image to fit your screen.  "none" does no drawing and is intended for
 CPU benchmarking.

-window: Enable window mode rather than fullscreen.  Unlike previous SDLMAMEs, this is a fully-featured
 window mode where the window resizes as necessary to track what the game does.  And you can resize it
 yourself with your OS's standard window controls.

-maximize: Not currently hooked up properly, just leave it alone :)

-keepaspect / -ka: Forces the correct aspect ratio.  This means when you're resizing the window in windowed
 mode the actual game image will resize in discrete steps to maintain the proper shape of the game graphics.
 If you turn this off you can resize the window to anything you like and get funny squishing and stretching.
 The same applies for full-screen.

-numscreens: For future (SDL 1.3) use.  Keep set to "1" unless you like crashing.

-extra_layout / -layout: Specify a layout file to use instead of any built-in ones for this game.

-switchres: Affects full screen mode only.  Chooses if SDLMAME can try to change the screen resolution
 (color depth is normally left alone) when in full-screen mode.  If it's off, you always get your desktop
 resolution in full-screen mode (which can be useful for LCDs).

-fullstretch / -fs: Allows stretching in non-integer steps.  Video purists should stay far, far away from this
 option, while everyone else will be happy to know that it lets you fill the screen properly in full-screen 
 mode.

-screen0 / -screen: For future (SDL 1.3) use.  Keep on "auto" for now.

-aspect0 / -screen_aspect: Select the aspect ratio of your monitor, in colon form (e.g. "4:3" or "16:9").
 This affects full-screen mode only, so if you have a widescreen monitor you should set it's proper ratio here.
 Autodetect will only work if you use the monitor's native resolution, which can get extremely slow in 
 "soft" mode.  It's normally not a problem when using OpenGL.

-resolution0 / -resolution / -r: Select the resolution to use in full-screen mode.  "-switchres" must be
 enabled for this to work.

-view0 / -view: Select the named view to use.

