-----------------------------------------------------------------------------
                                 RockNES 0.981
           A Nintendo Entertainment System 8-bit emulator for MS-DOS
              Copyright (c)1998/99 -= Fx3 =- October, 30th 1999
                    
 Copyright (c)1997/98 Nicolas Hamel and others (xNes) - original source code    
                      Nintendo is trademark of Nintendo
-----------------------------------------------------------------------------

* INDEX *

   I. Disclaimer
  II. Intro
 III. What's new for this version
  IV. Features 
   V. ZIP index
  VI. Hardware required
 VII. Using RockNES:
    - Sintax and help;
    - Configuration file;
    - Emulation keys;
    - NES Movies;
    - Game Genie;
    - VS Unisystem arcades;
    - PlayChoice-10 arcades.

VIII. File formats supported .AND. iNES Format (.NES) description;
  IX. Credits;
   X. http.

*---------------------------------------------------------------------------*
I. Disclaimer

       RockNES is NOT affiliated with Nintendo or any other company,
NOR ADVOCATES THE PIRACY OF NINTENDO GAMES.
       RockNES is FREEWARE. You can to distribute it freely, as long as it is
non-modified. Commercial games *cannot* be packaged with this emu.
       When you use this software you do so at your own risk. The author isn't
responsable for any loss or damage resulting from the use or misuse of this
software.
       If you don't agree with these terms, DELETE THIS SOFTWARE NOW.

-Many games don't work correctly (or at all).
-Don't e-mail me case your favorite game doesn't work. There are *tons* of
bad dumps, mostly with corrupt/incorrect headers...
-Don't e-mail me asking how to use rocknes (be sure you read this doc).
-Don't ask me for commercial games.
-Don't send any files without ask first.

*---------------------------------------------------------------------------*
II. Intro

-> xNes was a Nintendo Entertainment System 8-bit emulator (NES) written
by Nicolas Hamel, David Michel and others, firstly for DOS, ported later
to Linux and MacOS. Six months after the lastest public release (v0.45),
I decided to resume the DOS port, renamed later to RockNES, which is being
currently supported.
                     
-> It's in advanced stages, with support for sound, Game Genie codes,
VS Unisystem and Playchoice-10 arcades, NES movies, a lot of mappers...

-> The compatibility of RockNES grows version after version. The goal of
RockNES is to be a great emu: fast, compatible and FREE.

-> It's being coded fully in C and compiled with DJGPP. EAGLE is in assembly
and compiled with NASM. RockNES uses Allegro 3.9.25 (WIP) - 19990802.

-> Versions >0.5x are compiled with pgcc (gcc for Pentium).

-> Any help is *always* welcome! E-mail me.

*---------------------------------------------------------------------------*
III. What's new for this version

Version 0.981

- Fixed a sprite priority problem (Punch-Out!! is ok again);
- Fixed some mirroring problems due the new code;
- Fixed palette RAM mirroring;
- Fixed `-cps' option (cycles per scanline), working again;
- Pattern blitter rewritten;
- Default cycles per scanline changed to 113;
- Joystick calibration disabled.

Please, check `oldnews.txt' for history of past updates.

*---------------------------------------------------------------------------*
IV. Features 

 The following are implemented:
- 6502 CPU emulation by Marat Fayzullin <fms@cs.umd.edu>, slightly changed;
- *Scanline gfx engine (line-by-line);
- *Sprites 8x8, 8x16 (flipping & mirroring);
- Trainer;
- I/O ports;
- Fake color palette (not from a real NES);
- Backed battery;
- PPU emulation;
- Partial NES sound emulation (squares, triangle and noise).
- Mappers 0-4, 7-11, 13, 15-19, 21-26, 32-34, 64-66, 68, 69, 70, 71, 78,
79, 90, 91, 114, 151, 225, 227, 228, 231, 232;

* Currently, background/sprites render (except blitters) and sound core are
from DarcNES with the author's permission. The rest was written from scratch
by myself. Remember that Nyef already joined RockNES *before* public DarcNES
releases, and he built stuff.

 The following extra features are implemented:
- VS Unisystem arcades emulation;
- Playchoice-10 arcades support;
- Game Genie codes;
- Real time save/load state (now, 10 slots);
- Snapshots;
- NES movies (10 slots).

 In the future:
- ???

 KNOW PROBLEMS:
-> The new blitter will be fast *only* if a VESA mode is selected. It will be
*very very slow* using a non-VESA mode. If you noticed problems, use the old
blitter...:P. Don't forget that with the new blitter, the screen can't be
centered for a while, and the top&bottom 8 scanlines are not visible;

-> Don't bug me about possible Allegro problems (sound,video,etc).

-> To get some games working (or looking better), you need to change the
number of scanlines per frame (option -spf, default 262). Good examples are
Battletoads&DoubleDragon (255 lines/frame) and Elite (302 lines/frame).

-> Problems with some VS games (probably bad dumps).
-> Partial NES sound emulation.
-> Loading games from a CD-ROM unit, RockNES won't be able to save anything.
-> Unsupported IRQs from mappers that uses 16-bit registers to suit.
-> No extra sound channels (like VRCVI) are emulated.

*---------------------------------------------------------------------------*
V. ZIP index

   These files are in the rnesxxx.zip packages:

oldnews.txt => History of past RockNES updates.
rocknes.faq => Frequently Asked Questions.
rocknes.txt => This file.
rocknes.exe => The emulator (executable).
CWSDPMI.EXE => DPMI server (DOS mode only).

*---------------------------------------------------------------------------*
VI. Hardware required

- A *fast* processor (P200 or higher). I use framerate=1 to get full speed
and fine sound output under a Pentium 166Mhz, 16Mb RAM. For EAGLE, you will
need a Pentium II or better for a decent frame rate;
- A newer DOS version (I don't know the minimum);
- A sound card for sound emulation (SoundBlaster recommended);
- VESA support (get Scitech Display Doctor at http://www.scitechsoft.com);
- 8 MB of video RAM memory. I didn't tried it on 4 mb so...

Recommended:
- AMD 266Mhz or better (for no frameskip), Pentium II or better for EAGLE;
- 16Mb of RAM;
- A Sound Blaster card (SB16 or compatible);
- A good video board.

   RockNES uses by default 320x240 GFX_AUTODETECT. For EAGLE, 640x480
GFX_AUTODETECT. You can try ModeX, VESA x.xx, VBE/AF etc.. The best settings
are VESA modes and VBE/AF, with 320x240. Allegro can autodetect everything
you have, like joysticks, sound and video.
   EAGLE *always* uses 640x480 GFX_AUTODETECT, so don't try to change :)
   The new blitter (enabled by default) hasn't the screen centered.

* The native NES resolution is 256x240.
* VESA/VBE modes seems faster than any other.

*---------------------------------------------------------------------------*
VII. Using RockNES

=============================================================================
*NOTE: People are asking HOW TO START A GAME. I don't know if it's a joke or
something... Here's how to play your game with rocknes:

1) Unzip rnesxxx.zip (xxx = version number, like 098 [rnes098.zip] to 0.98)
in a empty directory (like c:\rocknes);

2) Check if all files were unzipped (type DIR at command line). You must to
see `rocknes.exe' at least;

3) Place your game in the same directory (let's say, mario.nes);

4) Type: rocknes mario.nes, and hit ENTER.

Okay, this seems *very* basic, but I *HAD* to put this piece of `how to do'.
Remember that when you run rocknes by first time, a config file is created.
Edit this file (rocknes.cfg) with a good text editor, like edit.com or other.
Check more stuff below. That's all.
=============================================================================

    You can set some aspects of emulation by command line switches or using
the config (rocknes.cfg). When you run RockNES by first time, the config is
automatically generated, and default settings on. You can edit the file and
change its parameters. It's always loaded on startup.
    Old configs (versions < 0.94) are *not* compatible.

[USE RockNES AT YOUR OWN RISK !!]

Sintax:
rocknes <game> <options>. The options avaliable are:

        -f x     : Frame rate (default=0).
        -b x     : Force x as battery file.
        -pal x   : Palettes: 1-NESticle,2-loopy,3-CrashMan,4-DarcNES,5-iNes.
        -p1 x    : Force input 1 (NONE, KEYBOARD1-2, JOYSTICK1-2).
        -p2 x    : Force input 2 (NONE, KEYBOARD1-2, JOYSTICK1-2).
        -joy x   : Enable joystick (only if input1/input2 are JOYSTICK);
        -vc x    : Video card          (default=AUTODETECT).
        -vr x y  : Video resolution    (default=320x240). 
        -cps x   : Cycles per scanline (default=113).       
        -spf x   : Scanlines per frame (default=262, VBlank lines=(x-240)).       
        -rate x  : Sampling rate - 1:22050 , 2:44100 (default). 
        -gg x    : 6 or 8 letter of GameGenie code. 
        -nosound : Guess what...
        -eagle   : Enable EAGLE effects.
        -oldblit : Enable the old blitter (slow).
        -info    : Show NES game information.
        -vsgame  : Load <game> as an original VS Unisystem set.
         See ROCKNES.CFG for other configuration options.

*Notes: 1) EAGLE always uses 640x480 GFX_AUTODETECT.
        2) The battery file is always saved from ROM loading folder.
        3) Using the -b option, the battery file is saved in the current dir.
You must to include `.sav' extension (ex: game.sav).

-----------------
 The config file
-----------------

Video
-----
The option `-vc' allows you to switch graphics modes.
The card parameter x should be one of the values:

  0-GFX_AUTODETECT    - let Allegro pick an appropriate graphics driver
  1-GFX_VGA           - normal VGA (320x200, 320x100, 160x120, or 80x80)
  2-GFX_MODEX         - select a planar, tweaked VGA mode
  3-GFX_VESA1         - use the VESA 1.x driver
  4-GFX_VESA2B        - use the VBE 2.0 banked mode driver
  5-GFX_VESA2L        - use the VBE 2.0 linear framebuffer driver
  6-GFX_VESA3         - use the VBE 3.0 driver
  7-GFX_VBEAF         - use the VBEAF hardware accelerator API
  8-GFX_XTENDED       - use the unchained mode 640x400 driver

Use the `-vr' option at command line to select the resolution.
Be carefull: some values can crash.

Inputs:
-------

The default input1 (player 1) is KEYBOARD1.
The default input2 (player 2) is KEYBOARD2.
Options avaliable are:

KEYBOARD1 - keyboard setup 1.
KEYBOARD2 - keyboard setup 2 (not other keyboard).
JOYSTICK1 - joystick on player 1.
JOYSTICK2 - joystick on player 2.

You can't enable a joystick if input 1 or 2 is KEYBOARD1 or KEYBOARD2.

The option `-joy x' enables a joystick:

     driver                 x
-------------------------------
  JOY_TYPE_NONE             0   (default)
  JOY_TYPE_AUTODETECT       1   
  JOY_TYPE_STANDARD         2
  JOY_TYPE_2PADS            3
  JOY_TYPE_4BUTTON          4
  JOY_TYPE_6BUTTON          5
  JOY_TYPE_8BUTTON          6
  JOY_TYPE_SIDEWINDER       7
  JOY_TYPE_GAMEPAD_PRO      8
  JOY_TYPE_SNESPAD_LPT1     9
  JOY_TYPE_SNESPAD_LPT2    10
  JOY_TYPE_SNESPAD_LPT3    11
  JOY_TYPE_GRIP            12
  JOY_TYPE_GRIP4           13
-------------------------------

*NOTE: Do not bug me if any of listed drivers don't work to you.

Directories
-----------

In the config file, you can specify directories, including for VS Unisystem.
Use `NONE' to keep these fields cleaned.

Keys
----

These are the default settings
  +------------------------------+--------------------+
  |   Player 1 controls:         | Player 2 controls: |
  +------------------------------+--------------------+
  |   `up'     = arrow key UP    | `up'     = U       |
  |   `down'   = arrow key DOWN  | `down'   = J       |
  |   `left    = arrow key LEFT  | `left'   = H       |
  |   `right'  = arrow key RIGHT | `right'  = K       |
  |   `A'      = X               | `A'      = S       |
  |   `B'      = Z               | `B'      = A       |
  |   `SELECT' = Tab             | `SELECT' = Q       |
  |   `START'  = Enter           | `START'  = W       |
  +------------------------------+--------------------+

Emulator keys
-------------

<ESC> - POWER OFF            (quit to OS)

<F1>  - NES MOVIE STATUS     (recording/playing/stopped)
<F2>  - STATE SLOT SELECT    (0..9)
<F3>  - SAVE STATE           (to CartName.RNx, x is a slot)
<F4>  - RESTORE STATE      (from CartName.RNx, x is a slot)
<F5>  - SOFT RESET
<F9>  - NES MOVIE RECORD
<F10> - NES MOVIE PLAY
<F12> - Snapshot to CARTNxxx.PCX (xxx, limit=999)

`+'   - Increase frame rate (max=10);
`-'   - Decrease frame rate (min=0).
``'   - Insert coins (VS Unisystem only).
   
IMPORTANT: Old *.RNx files are *NOT* compatible with RockNES < 0.98;

-----------------------------------------
The ID header looks like:
-size: 7 bytes-
-string: ROCKNES-
-desc: magic word for saved states-

-size: 1 byte-
-desc: version number (currently, 0.98)-
-----------------------------------------
-size: +than 27000 bytes-
-desc: saved state data-
-----------------------------------------

-> You're able to save 10 states per game loaded (.RNx);
-> The sound core controls the NES timing (60FPS as limit);
-> You should increase the frame rate until emulation reaches full speed;
-> Backed battery is automatically saved/loaded;
-> You can adjust the number of cycles_per_scanline/scanlines_per_frame to
force some games to work/look better.

*----------------------------------------------------------------------------*
                                 NES MOVIES

     Like NESticle, RockNES can record your gameplay. Enjoy your pretty game
and re-see your gameplay! You've 10 slots avaliable (the same index used for
save/load states, <F2> to pick one). Press <F9> to start/stop recording, and
<F10> to play. It's easy and very fun!
     The "movie" feature doesn't save rendered frames, but joypad data/states
(logging). In other words, the emulator can "repeat" your gameplay by reading
joypad data saved from exact state saved, when you begin a new movie. 

 Here some important info:
- Press <F1> to display NES movie status (recording, playing or stopped).
- The movie file has extension .rmX, where X is a slot (0-9).
- RockNES writes 60 bytes/frame. 
- The file isn't large... 1 second records 60 bytes; 1 minute = 3600 bytes;
1 hour = 216000 bytes; 2 hours = 432000 bytes... etc.
- For this feature, RockNES will save the current game state into the movie
file (at starting).
- If you press <ESC> key during a movie recording (playing), RockNES will
automatically shutdown the current movie to you...
- Pushing <F9> while playing (Movie RECORD command) will be ignored.
- Pushing <F10> while recording (Movie PLAY command) will be ignored.
- Pushing <F3> (save state), <F4> (load state) or <F5> (reset) while
recording/playing will be ignored.
- Hit <F9> to start recording, and <F9> again to stop.
- Hit <F10> to play a movie, and <F10> again to stop.
- After the movie play, you can continue playing the game.
- Joypads won't work while playing.
- Player 2 game IS NOT SAVED right now.
- You can't save or load game states, or do a RESET during record/play.

 No know problems.

*---------------------------------------------------------------------------*
                                  GAME GENIE

GameGenie codes can be either 6 or 8 digits and use the letters:
    A P Z L G I T Y   E O X U K S V N

// To test game genie 6 char code - SXIOPO    Super Mario 1  Unlimited lives
//                                  SXEZSKOZ  Super Mario 3  Skywalker

examples:

rocknes mario.nes -gg SXIOPO
rocknes smb3.nes -gg SXEZSKOZ

Notes:
* You needn't the Game Genie ROM image.
* I don't know if Game Genie codes work under FDS images.
* You can't add/remove Game Genie codes during the emulation.

Examples:

  rocknes megaman6.nes -gg LOOEKGPP -gg TOKENGLP -gg SXEEXTVG
  3 cheats will be enabled

*---------------------------------------------------------------------------*
                                 VS UNISYSTEM

   They are arcade machines with some NES games classics. Currently, 18 games
are supported (not fully), both .NES and original arcade sets.
   Other games should run, but with a wrong palette.
   To insert coins, press the key <`>, under <ESC>.    
   DIP-Switches are not supported.
   For arcade sets, you must to place each one in a specific directory.
Read more below.

*** Be sure you've good dumps. For iNes format, look if the header is ok.

These are some VS system games:

-vsgame      Title               Status

 pinball     PINBALL             -
 h-alley     HOGAN'S ALLEY       -
 baseball    BASEBALL            (Unsupported)
 -           SKY KID             (Unsupported)
 -           SUPER XEVIOUS       (Unsupported)
 gradius     GRADIUS             -
 platoon     PLATOON             -
                                 
 ladygolf    LADIES GOLF         -
 machridr    MACH RIDER          -
 golf        GOLF                -
 castle      CASTLEVANIA         -

 exite       EXCITEBIKE          -
 soccer      SOCCER              -
 goonies     GOONIES             -
 dr-mario    DR MARIO            -

 suprmrio    SUPER MARIO BROS.   -
 iceclimb    ICE CLIMBER         -
 rbi-bb      ATARI RBI BASEBALL  -

 -           TENNIS              (Unsupported)
 duckhunt    DUCK HUNT           (VS gun not supported yet)
 -           GUMSHOE             (Unsupported)

 top-gun     TOP GUN             -

You can specify a VS directory in the config file (unecessary if you're using
the iNes file format). Each game should be placed in a subdirectory.

*Examples*:                  X:\MYPC\GAMES\VS\CASTLE
                             X:\MYPC\GAMES\VS\EXITE 
                             X:\MYPC\GAMES\VS\ICECLIMB
                             X:\MYPC\GAMES\VS\SUPRMRIO
where X:\MYPC\GAMES\VS should be in the config file as "VS directory".

Example to run EXITEBIKE:

         rocknes exite -vsgame

                  or

         rocknes X:\MYPC\GAMES\VS\exite -vsgame

*---------------------------------------------------------------------------*
                                 PLAYCHOICE-10

   They're arcade machines too, with no coins. The original arcade had two
monitors: the game, and the instructions (how to play). This one is another
CPU (z80) which isn't emulated and not required to play games. :)
   You need the iNES file format.

*---------------------------------------------------------------------------*
VIII. File formats supported

- VS Unisystem arcade;
- iNES (.NES). 

NOTE: Some games can be found with the .NEZ extension.

  iNES Format (.NES)
  ------------------
    +--------+------+------------------------------------------+
    | Offset | Size | Content(s)                               |
    +--------+------+------------------------------------------+
    |   0    |  3   | 'NES'                                    |
    |   3    |  1   | $1A                                      |
    |   4    |  1   | 16K PRG-ROM page count                   |
    |   5    |  1   | 8K CHR-ROM page count                    |
    |   6    |  1   | ROM Control Byte #1                      |
    |        |      |   %####vTsM                              |
    |        |      |    |  ||||+- 0=Horizontal Mirroring      |
    |        |      |    |  ||||   1=Vertical Mirroring        |
    |        |      |    |  |||+-- 1=SRAM enabled              |
    |        |      |    |  ||+--- 1=512-byte trainer present  |
    |        |      |    |  |+---- 1=Four-screen VRAM layout   |
    |        |      |    |  |                                  |
    |        |      |    +--+----- Mapper # (lower 4-bits)     |
    |   7    |  1   | ROM Control Byte #2                      |
    |        |      |   %####00PU                              |
    |        |      |    |  |  |+- VS Unisystem arcade         |
    |        |      |    |  |  +-- Playchoice-10 arcade        |
    |        |      |    +--+----- Mapper # (upper 4-bits)     |
    |  8-15  |  8   | $00                                      |
    | 16-..  |      | Actual 16K PRG-ROM pages (in linear      |
    |  ...   |      | order). If a trainer exists, it precedes |
    |  ...   |      | the first PRG-ROM bank.                  |
    | ..-EOF |      | CHR-ROM pages (in ascending order).      |
    +--------+------+------------------------------------------+
*---------------------------------------------------------------------------*

IX. Credits & Thanks

- Nori (Famtasia emu), fammaster@mail.goo.ne.jp
  http://famtasia.csj.net (Japanese, webmaster hiro_a)
  http://www.tsukuba.venture-web.or.jp/~ppm/famicom/ (English, webmaster PPM)
  Thanks for Konami VRCxx IRQs information.

- Marat Fayzullin (6502 emulator [m6502.c] and his NES.htm document);

- All the person behind DJGPP
  http://www.delorie.com/djgpp/

- Allegro by Shawn Hargreaves:
  http://www.talula.demon.co.uk/allegro/

- Kritz (GameGenie support and general help);

- ReaperSMS (save/load states feature fix);

- Nyef (sound emulation core, gfx engine, PPU fixes and general help).
  DarcNES webpage at:
  http://www.netway.com/~nyef

- \FireBug\ (mappers.nfo document);

- Akilla (NES4PC):
  http://www.emuclassics.com/nes4pc

- loopy (loopyNES);

- Matt Conte (http://nofrendo.org);

- Zoop (optimizations for PRG switching and gfx blitter, some help and
webpage hosting under Emulation Camp):
  http://www.emucamp.com

- IRC BrasNET #gamerom 
  http://end.tsx.org
  http://kinox.org 

- Nicolas Hamel and David M. for the original source (xNes 0.45);

- Zeograd (Hu-Go!) for help with EAGLE:
  http://www.emuunlim.com/hugo

           Eagle - Enhanced Arcade Graphics Library for Emulators
                  Copyright (c) 1998 by Dirk Stevens
Visit the Eagle HomePage : http://www.geocities.com/SiliconValley/Haven/1555/

                  UPX - The Ultimate Packer for eXecutables
          Copyright (c) 1996-1999 Markus Oberhumer & Laszlo Molnar
                     http://cdata.tvnet.hu/~ml/upx.html
               http://wildsau.idv.uni-linz.ac.at/mfx/upx.html

*---------------------------------------------------------------------------*
 X. http  

 RockNES webpage
  http://www.emucamp.com/rocknes/
  fx3rnes@hotmail.com
*---------------------------------------------------------------------------*
eof
