--------------------------------------------------------------------------
                                  Pac-X

            Copyright (C) 1999 by Mike Balfour.  All Rights Reserved.
--------------------------------------------------------------------------


------------------------------
Usage and Distribution License
------------------------------

Pac-X may be distributed in unmodified form to any medium.

Pac-X may not be sold by itself or as a part of a commercial package 
without the express written permission of Mike Balfour (mab22@po.cwru.edu).
This includes shareware.

Modified versions of Pac-X may not be publicly redistributed without 
author approval (mab22@po.cwru.edu). This includes distributing via a 
publicly accessible LAN. You may make your own source modifications and 
distribute Pac-X in source form, but if you make modifications to 
Pac-X then it should be noted in the top of the modified source file(s)
as a comment.

Mike Balfour will not be held responsible for any damage done by the use of
Pac-X. It is offered purely "as-is".

If you use portions of Pac-X in a freeware application, the following 
text must accompany the freeware application within the application itself 
or in the documentation:

"This application uses source code from Pac-X.
 Pac-X is copyright (c) 1999 by Mike Balfour (mab22@po.cwru.edu)."

All usage of the MZ80 CPU core is bound by the MZ80 license agreement.

Pac-X is a non-profit project.

-------------------------
Pac-X Contact information
-------------------------

Author      : Mike Balfour (mab22@po.cwru.edu)
Distribution: http://pacx.retrogames.com/index.html


----------
What's New
----------

Version 0.2:
 - moved to 16-bit color for 3D
 - added the very beginnings of 3D code, note the spinning logo :)
 - added more parameters to the INI file
Notes:
 - Sorry it took so long for a release, but there were a lot of unexpected
   issues that cropped up with the initial 3D support.  I learned the hard
   way that using 8-bit palettes with 3D will NOT use hardware acceleration,
   so I moved to 16-bit sooner than expected. :)  It also took a while to
   benchmark Retained Mode vs. Immediate Mode to decide which to use.  Not
   to mention the learning curve for doing *any* Direct3D at all. :(
 - Some people have tried modifying the included bitmap files with various
   degrees of success.  The biggest problem with the previous release was
   the limit on the number of colors that could be used.  Now that I have
   moved to 16-bit color, each bitmap is now allowed to use all 256 colors
   (since I still only support 8-bit bitmaps).
 - Those people should also notice that digits.bmp is no longer hard-coded
   to use white as transparent.  Check out the INI file.  But be careful,
   in converting colors from 8-bit palettes to 16-bit, you actually *lose*
   8 bits of color resolution.  So two colors that you *think* are different
   can map to the same one in the conversion. :(
Known bugs:  
 - radar erases the pac-man blip during the intermission
 - sound is of dubious quality

----------
What's Old
----------

Version 0.1:
First release.
Known bugs:  
 - radar erases the pac-man blip during the intermission
 - sound is of dubious quality
 - 3D doesn't work ;)
 - error messages aren't always readable

-------------------
Pac-X Documentation
-------------------

If you have ever played Pac-Man, Pac-X should be fairly intuitive to play.
Basically, you go around, eat dots, and avoid being eaten by ghosts.  Power
pellets provide a temporary boost allowing you to eat the ghosts.  Bonuses
appear from time to time; these can be eaten for extra points.

However, Pac-X is also a bit different from Pac-Man.  It can be quite a bit
more difficult surviving a level when you're playing from a first-person
perspective.  Ghosts can sneak up on you very easily, and you'd better 
remember where those uneaten dots are!

Fortunately, if you've learned the patterns for Pac-Man, they still work 
here, since Pac-X is merely an updated graphics engine that is being
driven by the original game engine, thanks to emulation.

Note:  Pac-X is an emulator; consequently, it will not function without
Pac-Man ROMs.  Do not run the Pac-X executable unless you own a Pac-Man
arcade board.  The ROMs can be transferred from your arcade board through
the use of an EPROM reader.  My Pac-Man board cost about $15, so I imagine
these are still pretty easy to find.  If you don't own one, please buy one.

Pac-X expects the ROMs to be uncompressed; ZIPPED ROMS WILL NOT WORK.

NOTE:  Pac-X requires Direct X 6.0 or later!!!



How to use Pac-X:

Keys
----
ESC			Exit
LEFT ARROW		Move Left
RIGHT ARROW		Move Right
UP ARROW		Move Up
DOWN ARROW		Move Down
'1'			Start a one-player game (no coins are needed)
'2'			Start a two-player game (no coins are needed)
'R'			Reset the emulation
'U'			Unthrottle (only while held down)


--------------
Pac-X INI file
--------------
Most of the settings in the pacx.ini file should be somewhat intuitive.
However, just in case they aren't, here's a description of the important
ones.  If you don't like the INI file, delete it.  Pac-X will run without
one.

[Main]
ROMSection - the section of the INI file to use for loading ROMs.  This is
just in case you have many different Pac-Man ROM sets that you want to try
using in Pac-X.  You can create sections for each one, and just change the
name in ROMSection.  The default is to use Pacman ROMs.

[Sound Information]
You can force sound to be disabled by setting Enable=false.  Given the
current state of the sound emulation, this might not be a bad idea. :)

[Background Information]
Right now, you're still forced to *have* a background, but you can change
the name of it.  Note that the default name has changed from "pacx.bmp"
to "backgrnd.bmp".

[Radar Information]
These values are used to describe placement and size of the radar.  Don't
try weird values, I'm not doing any bounds checking.  You can disable the
radar with Enable=false.

[Pac2D Information]
These values are used to describe placement and size of the 2D viewscreen.
Don't try weird values, I'm still not doing any bounds checking.  You can
disable the 2D viewport with Enable=false.  This will make the game VERY
hard to play, since there's no 3D support yet. :)

[Pac3D Information]
These values are used to describe placement and size of the 3D viewscreen.
Don't try weird values, I'm still not doing any bounds checking.  You can
disable the 3D viewport with Enable=false.

[Scoreboard Information]
You should have the general idea by now.  The digits picture must have
a color defined as transparent, and this should be specified in the form
0xRRGGBB where every 2 characters represents a hex value.  Note that you
can change the *size* of the numbers if you want, just make sure they're 
evenly spaced.  Everything else here is just coordinates for where to draw
different items.

[Pacman ROMs]
Each entry here is the name of a ROM.  Specify the full path and name of
each ROM, remember they CANNOT be zipped.


--------------------------------
Pac-X Frequently Asked Questions
--------------------------------

Q)  How can you have frequently asked questions on a first release?
A)  I'm planning for the future.

Q)  Why not be original and write it from a second-person perspective?
A)  Ummmm, shut up.

Q)  Speaking of being original, why not code your own game engine?
A)  Well, because the whole POINT of Pac-X is to showcase how emulation
    can be used to achieve many different ends.  Besides, a certain amount
    of the fun of Pac-X comes from allowing the patterns we've all
    memorized as kids to continue providing value.

Q)  Where can I find Pac-Man ROMs?
A)  On a Pac-Man arcade game board.  That's where I found mine.  Don't ask
    me to locate a game board for you, but you might be able to find one
    for sale at the rec.games.video.arcade.collector newsgroup.

Q)  I don't like your source code.  What can I do about it?
A)  Send me an e-mail!  I'm looking for comments and criticisms at the source
    code level, so please send them.  I reserve the right to ignore silly
    comments and criticisms.

Q)  I don't like the layout/graphics of Pac-X.  What can I do about it?
A)  Modify backgrnd.bmp, digits.bmp, and pacx.ini.  If you come up with 
    something that you think looks pretty cool, please zip them up and send 
    them my way.  If I get a few that I like, I might post an "alternate 
    looks" page.

Q)  Why are you using Direct X 6.x?
A)  After doing some speed benchmarking, I've realized that the only way I
    have a *chance* of reaching 60 fps on my poor system is to code in 
    Direct3D Immediate Mode (as opposed to Retained Mode).  Since Microsoft
    has been drastically changing the Immediate Mode interface, my life is
    made much easier by sticking with the latest DirectX.

--------------
Building Pac-X
--------------

Hopefully you won't find it very difficult to build Pac-X, but I'm
anticipating one or two problems, so I'll try to answer them here.

1)  Make sure you have the DirectX SDK installed.  Without it, you will
have a difficult time building the executable.

2)  I've only compiled this with MS Visual C++.  I don't know what happens
if you try to build it with other compilers.

3)  Make sure that the DirectX library and include directories appear
*before* any MS Visual C++ directories in Tools/Options/Directories.  The
newer Visual C++ installations include out-of-date versions of the DirectX
libraries and include files, so you need to be certain that you're linking
in exactly what you expect.

4)  Be certain to include "ddraw.lib", "dsound.lib", and "dxguid.lib" in
your project.  You'll get some link errors if you don't.

5)  Don't forget to include MZ80.obj as well.  I've included one, but if
you want to build your own you'll need nasmw (a GNU product).

Everything else should compile and build without any problems, I hope.


-------
Credits
-------

Pac-X is copyright (c) 1999 by Mike Balfour.  All rights reserved.

Multi-Z80 CPU emulator by Neil Bradley (neil@synthcom.com)
Distribution: ftp://ftp.synthcom.com/pub/emulators/cpu/makez80.zip (latest)

The Pac-Man ROMs I own are copyright (c) 1980 by Namco, Ltd.  Your
Pac-Man ROMs might have different copyright information.

---------------
Acknowledgments
---------------

Thanks to Neil Bradley for the usage of the MZ80 emulator.  Also, thanks
for criticizing my code and providing lots of helpful tips!

Thanks to Howie Cohen for testing and design input!

A special thanks to the MAME team, especially Nicola Salmoria.  Working 
with the MAME team is quite a bit of fun, and I have learned volumes 
about programming, game design, emulation, and project management from
them!

