---------------------------------------------------------------------------
                    GEM - Gameboy Emulator for MSX v0.8
                      (c) 2000-2003 by The New Image

                      Programmed by Patriek Lesparre   

                            http://gem.tni.nl/
                            e-mail: gem@tni.nl
---------------------------------------------------------------------------


About GEM
---------
GEM is a Gameboy emulator for MSX2/turboR running MSX-DOS2 written in 100%
assembly language. Although many games are playable now, keep in mind it's
still in beta stages.

Why did I write it, you ask? Because I wanted to prove an MSX is capable
of emulating a Gameboy at reasonable speed (which ofcourse is a subjective
term).


System configuration
--------------------
Minimum:
MSX2, 256kB RAM, MSX-DOS2
or
MSX turboR

GEM is optimized for R800, so running it on a MSX turboR gives the best
performance.

Free memory required:
160kB + ROM-size (absolute minimum, uses Interpreter mode only)
160kB + 2 * ROM-size + ... (Dynamic Recompiler mode)

The Dynamic Recompiler needs memory for its code-cache. The amount needed
differs per ROM. If memory runs out, the remainder of the ROM program will
be interpreted which has a negative effect on speed.

GEM doesn't do any mapper switching and works from the mapper DOS selected.


Usage
-----
Just type GEM [FILENAME.EXT], you can specify any directorypath with both
GEM and the ROM in question.


Controls
--------
Gameboy: MSX:
Joypad - Cursors
A      - Shift
B      - Ctrl
Start  - Return
Select - Select

ESC enters GEM's so-called configuration mode. This is indicated by the
CAPS LED which will light up.

Configuration mode controls are:
ESC  - Exits GEM
STOP - Exits configuration mode without changes
BS   - Backspace resets the emulated Gameboy
F5   - Toggles sound on/off (turning sound off should increase speed a bit)
0    - Display all frames
1    - Display 1/2 of all frames
2    - Display 1/3 of all frames
3    - Display 1/4 of all frames
4    - Display 1/5 of all frames
5    - Display 1/6 of all frames
6    - Display 1/7 of all frames
7    - Display 1/8 of all frames


History
-------
24 September 2003, v0.8

  Got a few new idea's in the process of porting GEM over to LPE-Z380.

  - Added a Gfx9000 background and sprite renderer! You have to use them 
    together and they provide a really nice speed up.
  - Removed some useless code from some video renderers.
  - Fixed display of bottom half of Y-flipped 8x16 sprites.
  - Sped up ADD SP,d opcode in interpreter and dynarec.
  - Improved dynarec core to optimize joypad reads.
  - Implemented throttling to prevent games from running too fast.
  - Implemented new frameskipping code, now non-powers of 2 are possible.
  - Sped up all opcodes in the interpreting CPU core a bit.

  - Now assembled with the latest tniASM. (http://tniasm.tni.nl/)
  - Removed 'Future' and 'Technical Stuff' chapters from the manual.
  - For what it's worth, the Dynamic Recompiler introduced in v0.7 is up to
    4 times faster, not 25-50% ^^;

1 June 2001, v0.7

  SURPRISE! I honestly didn't plan on developing this version anymore, but
  I got a sudden rush of inspiration. Be happy :)

  - Accurate CPU timing! The CPU cores now count cycles, not instructions.
    This means another speed-up (about 15%), because the default CPU/LCD
    Timing settings were previously set too high.
  - Proper memory handling. Adds error-messages and ROM-size checks, allows
    TSR's to remain loaded, no more crash on turboR on exit with some ROMs.
  - Added CPU Core setting in the configuration file.
  - Dynamic Recompiler!!! As far as I know, unique for an 8-bit computer.
    For most games this means a whopping 25% to 50% speed increase! ^_^
  - Accidentally left in some debug-code in v0.6, it was PUSHing and POPing
    all Z80 registers every drawn frame!
  - Manual update, some fixes/additions. Read it :)
  - Sped up PUSH AF opcode, making it dynarec compatible as well.
  - Rewrote ADD SP,d opcode for dynarec compatibility (remains same speed).
  - Fixed a bug where an instruction accessing an unmapped GB memory-
    region would not be executed at all.

v0.1 (12 March 2000) - v0.6 (26 March 2001)
  For info, read GEM.TXT of older versions.


Disclaimer
----------
- MSX is a trademark of MSX Association.
  All other trademarks are property of their respective owners.
- GEM is freeware and can be distributed freely as long as:
  * it is not modified
  * this file is included in the archive
  * ROMs are not packaged with it
  * it is not part of a commercial product
- Use it at your own risk. The author is not responsible for any loss or
  damage resulting from the use or misuse of this software.
