************************************************************************
* MASSAGE V0.9  - Sega Master System/Game Gear Emulator by James McKay *
************************************************************************

5/5/98
======

Registered Version - Do not Distribute
======================================

Contact Address
===============
Since my support of Massage has ended, here are some addresses to
check out.  Please check the web page first, to make sure you're not asking
an already answered question.

Support E-mail : peter.sharp9@virgin.net
Support site : http://www.enterspace.org/world/


New stuff (compared to V0.8)
============================
* INI file to set up options.

* Redefinable keys (in INI file).

* Slightly inaccurate lightgun support via the mouse.

* Now with SB (2.0+) support, allows the simulation of the YM2413 chip via
  Adlib and the TI76489 chip via the SB - at the same time.
  And it's good enough to play speech.

* Stereo via OPL3 (Adlib) or SB Pro (SB) but, due to lack of info about the
  SB mixer chip, the SB version will not play stereo on any card newer than
  an SB Pro.

* Option to turn off sprite collision to make Impossible Mission a bit more
  playable (but it still doesn't emulate very well).

* Option to switch off the border.

* Bugfix : Golvellius now works.

* Bugfix : Options via command line or INI file to slow down the access to
  the OPL3 chip to solve the problem that some soundcards were having.


Known Bugs
==========
Mouse pointer is terrible.
Sometimes Massage thinks that there is no mouse present when there is...
Problems with mixer chip causing lack of stereo in SB mode with most cards.


Massage runs under DOS, but can run under Windows '95 just fine.
A Pentium is recommended.  For the Sound Blaster version, a P133 is
recommended.

The author accepts no responsibility for any damage caused to anything by
this software - no software is bug free! Although it's never done my machine
any harm so far...

========
FIRSTLY:
========

Massage V0.9 comes in two varieties:

1.  Adlib version.  This is like the older version of Massage, and supports
Adlib and internal speaker sound.

2.  SB/Adlib version, this uses the SB to produce excellent quality PSG
sound, including speech.  The YM2413 chip is emulated via the Adlib.

The ZIP file will be called MAS09A.ZIP for the Adlib version, and
MAS09S.ZIP for the SAOM version.

The SB version requires a faster machine than the Adlib version, if your
machine isn't fast enough then the output will be fuzzy.  Also the SB
version cannot autodetect the machine speed, basically, if you try to set
the SB version to go at a speed which makes the sound fuzzy, then you are
asking it to go too fast.  Do not think that as a result of this,
your P266 MMX will run it ridiculously fast, this is not the case, and
generally, if you do have a faster machine then SB is the version for you.

Also note that even though low end 486s cannot use the SB version without
fuzzy sound, it is worth a go, just to hear the speech!

Instructions
============

Started 23/07/96.
Today is 05/01/98.

This program emulates a Sega Master System and a Sega Game Gear.
A Pentium is strongly recommended, but is barely playable on a 486 with some
severe frame skipping.

How to use:
===========
massage  -  Starts the emulator with the file select screen.

massage /?   -  A not very good help, some of the options listed don't work.

massage <filename.sms>
        or
massage <filename.gg>

Loads and runs the named cartridge, however the cartridge must be in a
specific format:

1.  It can either be raw, or have a 512 byte header.  I have tested both
    kinds and they work.
2.  It must have the suffix .sms for an SMS game, or a .gg suffix for a Game
    Gear game.

massage /delay <num>  -  A rather poor slowdown method, num can be 0-65535,
where 65535 is a ridiculously long delay and 0 is no delay, use this if it
is running too fast.  Use low numbers to start with.

massage /mono - This is a relic from another piece of software I wrote, but
it does have the advantage that it basically switches off the screen making
it a bit like V0.0a.  Allowing for speedy playing of the music.

massage /frame <num> - This sets the screen to update 1/num times, (where 0
is 256) this is highly recommended for speed trouble!  I use /frame 5 on a
486SX-25!  (Although it is nowhere near full speed, about 80%).
The emulator now tries to detect which screen update is most suitable for
you, and will assign a value between 1 and 5 to this when you switch on, or
swap between small and large GG screens.

massage /jap - This convinces some Master System games that they are running
on a Sega Mark 3 (or indeed a Japanese Master System) console, which means
some games use Japanese.  Also gets some Game Gear games to use Japanese as
well.  Pop Breaker will only work in Japanese mode.

massage /nojoy - Switches off the joystick if you have a nasty old analogue
wobbler that doesn't work properly.

massage /ggpad - Select Gravis Gamepad "swapped buttons" option.

massage /p2joy - Use Joystick as player 2 controls, allows people who only
have one joystick to use keys as P1, and joystick as P2.

massage /bswap - This switches button 1 and 2 on your PC joysticks.

massage /4bpad - Selects 'other' 4 button pad, in other words a 4 button pad 
that doesn't have the buttons in funny positions.

massage /li <num> - Chooses line interrupt method, <num>=0 to 2.  0 is the
new improved default method.  Method 1 allows playing of Altered Beast and
method 2 allows playing of ChessMaster and Sagaia.

massage /nofm - Used to /fm but now fm is by default!  This switches off the
fm chip, so that you can use the PSG in games which can use one or the other.

massage /approx - Selects colour approximation mode.  This is what all the
old versions of Massage (and sms) used, it can handle games that change
palette colours mid-screen, but is somewhat slower.  Game Gear games will
look worse.

massage /262 - Selects 262 line option, a trick which gives a bit more speed,
but some games don't like it.

massage /opl2 - If you only have an OPL2 chip.

massage /opl3s - Use slower access to the OPL3 chip.  Use if you have a fast
machine that doesn't play the Adlib stuff correctly.

massage /opl3vs - Use very slow access to the OPL3 chip (if above doesn't
work).

massage /hz - Choose the sample quality from 4000 to 44100.  Choosing a 
lower sample rate will mean lower quality, but faster emulation.

massage /sbclone - Use this option if the game crashes above 22050hz.

massage /lightgun - Use the mouse to simulate the lightgun.  Normal controls
will not work while this is on.

INI File:
=========
Use a text editor to examine MASSAGE.INI, most of the options are fairly
self-explanatory and have comments to help you.

DEFAULT KEYS:
=============
Escape - Reset
Space  - Pause on Master System, or Start on the Game Gear.

Player 1 Controls:
Cursor Keys - Up, down, left and right.
Alt - button 1.
Ctrl - button 2.

Player 2 Controls:
1 - Up.
Q - Down.
W - Left.
E - Right.
2 - button 1.
3 - button 2.

I know that this is not a very playable set of keys but a PC keyboard is not
particularly good for playing 2 player games anyway, since it usually will
not allow certain combinations of keys to be pressed at the same time.
The option is only really there for the benefit of joypads and joysticks
which operate through the keyboard port.

Menu controls:
==============
Up, down - Move pointer.
Left, Right - Change value by 1.
Page Up, Page Down - Change value by 10.  (Where applicable).
Enter, Return - Select option.
Escape - Leave menu.

F1     - Options.
=================
* Alter Screen Skip [1/(0-255)] - The number of times the screen is updated,
  1/1 is perfect screen update.  The higher the number the faster the
  emulation should be (0 means 256 so is the fastest).
* Alter Slow Down [0-65535] - The higher the number the slower it goes, should
  now be set automatically when you run emulator.  Not in SB version.
* GG Screen Size [Small] - Set this to Large for a bigger GG screen.
* Keep close to 100% [Yes] - Set this to NO, if you are fed up with the
  settings changing every time you change from small to big screen GG.
  Not in SB version.

F2     - Screen dump to PCX.
============================
Enter the filename you wish to save it as, and it will be saved.  If there
is already a file with that name then you will be asked if you want to
overwrite it or not.
If you want to (for example) save the same GG screen in big and small, then
access this from the F1 menu.  Note that it saves the full 320x200 leaving
the black borders in.  Note that it is possible that some critical settings
could have been changed from the moment the screen was displayed to the point
you pressed F2, meaning that the screen might not be correct.  This bug has
not been fixed yet.

F3     - Pro Action Replay codes.
=================================
This menu has 8 codes set at "0000-0000" with all switched off.  The real
PAR has only 4 slots, so remember this if you are making codes.
To enter a code press return when you have picked a slot (with up and down),
enter the code (you don't have to enter the minus sign in the code) and the
code will be switched on.  To switch a code on or off, move to that slot and
press left or right.  If you enter an invalid code, then the old code will
remain in place.  When you load a new cartridge all codes are cleared.
The PAR was more popular in the UK than it was in the US (in fact was it
released at all in the US?), probably because it could make it's own codes,
this one can't though so you will have to find codes in old magazines or 
maybe someone will set up a big text file on some web site?

F4     - Joystick options.
==========================
* 4 Button Pad [No,Gravis,Other] - Set to Gravis or Other, depending on the
  position of the buttons on your pad, if you want the full effect of your
  four button pad.
* SMS 2P 1 Joystick [No] - Set this to YES if you only have one joystick and
  want to play a two player SMS game, player 2 is controlled using PC
  joystick 1.
* Swap Buttons [No] - Set this to YES if you want button 1 and 2 to be
  swapped on your joystick.

F5     - Load new cart.
=======================
Select the file you want to load and press return.

F6     - Save snap file.
========================
Type the name that you want to call the saved file and press return.  If
there is already a file with that name then you will be asked if you want to
overwrite it or not.

F7     - Load snap file.
========================
Select the file you want to load and press return.  Make sure that you have
loaded the appropriate cartridge first!

F8     - Emulator options.
==========================
* Border [On] - Whether the border colour is emulated or not.
* Top Line [304] - Switchable between 255 and 304.
* Vblank [Optional] - Switchable between Always and optional.
* Screen Lines [311] - Switchable between 311 and 262, selecting 262 will give
  you a few more percentage points of speed, but some games don't like it.
* V0.7 Default - Sets the 3 above to "304","Optional","311".
* V0.6 Default - Sets the 3 above to "304","Always","311".
* V0.5 Default - Sets the 3 above to "255","Always","311".  The idea
  being that you should be able to play any game which worked on V0.5 or V0.6
  (in conjunction with line int method).
* Language [English] - Can be set to Japanese for some SMS/GG carts, only
  affects game when you load or reload it.
* Line Int Method [0-2] - The algorithm that determines when the line
  interrupts happen, use 1 for Altered Beast and 2 for Chessmaster & Sagaia.
* YM2413 FM [On] - Determines whether the FM chip is visible to the game,
  effective when you load or reload a game, although switches off the sound
  immediately.
* Colour Approx [Off] - When this is off, the screen updates a little quicker,
  and the Game Gear palette is correct, but games that swap palette colours
  midway through the screen will flicker nastily.  In that case set this to on,
  but note that it is going slower but the (Adlib) speed gauge won't show it, 
  to see the correct speed that it is going at, select this option from the
  commandline by doing /approx.
* Sprites Currently [Hit] - This is a cheap hack, set it to 'Miss' for
  Impossible Mission.
* Lightgun [Off] - When on the mouse controls a very simple pointer and the
  left mouse button is the fire button, note that normal controls don't work
  while this option is on.

F10    - Quit to DOS.
=====================
Press Y to quit or N to stay.  This may cause the SB version to lose sync,
if so then go into the F1 menu and put the speed up and then down again.

F11    - Sound options.
=======================
* Sound is [Adlib,PC Speaker or Off]  Note: Just [On,Off] for the SB version.
* Create LOG File - Don't touch!
* White Noise Is [On] - So you prefer no white noise instead of a feeble
  attempt?  Then switch this to Off (only affects Adlib PSG emulation).


DISCLAIMER
==========
Sega is a trademark of Sega.
Mark 3, Master System, Game Gear, Megadrive and Genesis are trademarks of
Sega.

Pro Action Replay is a trademark of Datel Electronics Ltd.

Emulator compiled in Watcom C 10.0a and Watcom ASM.

Thanks to TF and AB for info regarding line interrupts (not sure if I should
put your names here!) hopefully you have managed to get round your debugging
problems.

Thanks to MT for 'a lot of info', finally!

Thanks to tak for writing the Japanese guide to
registration.

Thanks to Hiromitsu Shioya for writing the Yamaha YM2413 sound code.

Thanks to Duncan for the web page, the searching and downloading of the roms,
and the programming of the registered users area.

Thanks to all those that registered.

This software is not an official product of Sega, and neither are the
cartridge copiers, although I have nothing to do with the cart copiers.

All games mentioned are trademarks of their own respective companies.

Distribution of 'backed up' cartridges is an illegal activity.
