README
------
Pgb is a Nintendo Gameboy emulator written in Java.  It
currently supports the original Gameboy, the Gameboy Pocket,
the Super Gameboy and the Gameboy Color.

I chose to write it in Java because I I didn't know of any 
other similar emulators (although I've since found some) 
and because I think Java is a fun language to program in.  
Because it is written in Java, it will run on any machine 
with a Java VM installed.

Because it is written in a high-level language like Java
it may not run as fast as emulators written in a machine-
native language like C or C++.  Despite this, recent versions
of Pgb play acceptably on my Celeron 400 with little or no
frame skipping.

Since I have even more optimization to do and because 
computers are constantly getting faster, I think that the 
speed issue will resolve itself and that Java emulators
represent the future of emulation.  Emulators written in 
Java emulate other platforms in a platform-unspecific manner.


TO INSTALL
----------
Unzip the emulator and related files into the directory of
your choice.  If you have a previous version of this emulator
installed, delete it before installing the new version.


HOW TO USE
----------
Pgb should run under any Java Virtual Machine (VM).  The two 
I have tested it with are the Microsoft VM (under Windows)
and the Sun VM (under Windows and Linux.)  The Microsoft VM
is reccomended under Windows.  Under any other platform, the
Sun VM or any other compatible VM will work quite nicely.

In this current version, the keys used are the arrow keys
on the keyboard and "z", "x", "a" & "s" which correspond to 
the A, B, Select and Start buttons on the Gameboy.  You may
configure the keys in the options menu.

If the emulator is running too slow for your taste, you may
adjust the frame skipping in the Options menu.  You may also
turn on or off the "Auto Wait" feature in this menu.

If Pgb does not work and you are using the Microsoft Java VM,
please try the Sun VM.  If you are using any other Java VM, I
would like to hear how it goes.


USING THE SUN JAVA VM
----------------------
From the directory Pgb is installed in, use the command line:

	javaw -jar Pgb.jar

You may also be able to simply double-click the Pgb.jar file.
It is also possible to use "java -jar Pgb.jar" but that will 
result in occasional unfriendly debug information being printed
to the console.

The latest Sun VM is available at:

	http://java.sun.com/j2se/1.3/jre/


USING THE MICROSOFT JAVA VM
---------------------------
To start Pgb using the Microsoft VM, run the Windows excutable
"Pgb.exe".

The latest Microsoft VM is available at:

	http://www.microsoft.com/java/vm/dl_vm40.htm

The Microsoft VM uses DirectX for video output by default.  If
you are having trouble with it, try switching to another Video
Output device in the menu.


USING ANOTHER JAVA VM
---------------------
For any other Java VM, launch the Pgb.class file in the classes
directory.  Good Luck!


VERSION HISTORY
---------------
Version 0.8x (05-06-01?)
- Sprites are cached
- Support background priority in many GBC games
- Support for zipped roms
- Fiddled with interrupts, probably breaking things

Version 0.87  (01-23-01)
- Reworked LCD interrupt timing a little.
- Fixed the bug causing Microsoft VM to sometimes lock after
    loading a game.
- Separated video rendering and output.
- Added DirectDraw video output for the Microsoft VM.  Allows
    better screen resizing.
- Added direct color video output for all VMs.  Allows more
    than 56 colors on screen in some games and demos.
- Added mechanism to switch video output in the video menu.
- Less PC CPU time consumed when the GB CPU is halted.  Major
    speedups, depending on the game.
- Improved tile caching mechanism.  Speed improvement in some
    games.
- Added a better "Auto Wait" function, accessed in the menu.


Version 0.84
- fixed opbi & bgpi again <sigh>
- was allocating 16k work ram for GBC, changed to 32k
- fixed GBC DMA length
- fixed GBC DMA destination
- cached tiles are updated more accurately
- fixed a bug with the LCD interrupt (Pokemon Yellow, Gold,
    Silver, Crystal start up now)
- fixed bgpal, objpal in GBC mode (Pokemon Yellow, Gold,
    Silver have correct colors)
- system preference goes Gameboy Color->Super Gameboy->Gameboy
    Pocket
- fixed a GB window positioning bug (Pokemon & others)
- fixed a regiser overflow bug (Final Fantasy Legend)
- can now set CPU thread priority through the GUI
- fixed a bug with signed reads and bitwise operators (Dragon
    Warrior Monsters, Pokemon Red & Blue)
- added support for 256kb save RAM (Pokemon Crystal)
- fixed a bug with the LY=LYC interrupt
- added support for ATF mode color setting in many SGB games
- fixed a bug with multi-packet SGB commands
- support for loading a rom via the command line


Version 0.82
- changed behavior: Pgb no longer auto-pauses when window 
    is inactive
- rearranged menus a little
- GBC DMA transfers work more accurately
- LYC=LY cooincidence interrupt fixed
- changed how GBC speed is set so that bit 0 is cleared
- fixes to opbi & bgpi

Version 0.80
- fixed SGB h- & vflip (Dragon Warrior Monsters & others)
- fixed window scrolling bug (Pokemon & others)
- LCD was skipping OAM mode.  fixed. (improved compatibility)
- Gameboy Color support!
- battery save files go into directory specified in config file
- source released under the GPL

Version 0.78
- support for MBC3 internal clock (no commercial games that
	use it work yet though)
- works under MS Java VM -- but hangs sometimes
- configurable keys
- battery save files are saved
- DDA instruction more accurate (most timers, score counters 
	work better)
- fix when reading addresses beyond 0xFFFF - cycles to 
	beginning
- changed the default palette for mono gameboy games
- added tile caching for graphics -- fairly large speedup
- super gameboy colorization support
- super gameboy border support (slow)


Version 0.70 (first release)
- full, but still buggy processor support
- most hardware and registers supported
- battery save files are loaded but not saved
- no sound support


THE SOURCE
----------
Pgb's source code is under the GPL (see copyright.txt for
more information.)  If you want to help out, feel free to 
contact me as listed below.


CONTACT
-------
You may email me at bmazur@sev.org regarding bugs or
suggestions.  DO NOT ASK ME FOR  ROM FILES.  Please 
include "Pgb" in the subject of your email.  Technical 
advice from experienced Gameboy programmers is appreciated.


THE FUTURE
----------
- link cable & I/R support with netplay
- improve compatibility and speed
- sound support
- joystick support
- more...


DISCLAIMER
----------
This software (in its UNMODIFIED form, with all files included) 
may be distributed freely on webpages and similar.  No warranty is
provided or implied.

This project is in NO way affiliated with Sun Microsystems or 
Nintendo.  Gameboy, Gameboy Color and Pokmon are trademarks 
of Nintendo.



Copyright (c) 2000-2001 Ben Mazur.  All rights reserved.
