
                               R o c k N E S
                       A NES 8-bit videogame emulator
  <<======================================================================>>
               (c)1998-2006 Fx3, version 5.00B1, March 13rd 2006
             LICENSE: Freeware, for absolutely non-commercial use
                     hotmail.com@fx3rnes (swap to fix)
  <<======================================================================>>

   LICENSE AGREEMENT:

   - This is FREE SOFTWARE meaning no commercial ways and NO WARRANTIES, so 
   use it at your own risk. You cannot include commercial ROM images in the 
   package. Please, don't bother me if you messed up the things.
   - My website is always at http://rocknes.kinox.org, and you can even use
   the forum to contact me.
   - If you disagree with these terms, DELETE THIS SOFTWARE NOW.

   HARDWARE REQUIREMENTS:

   - RockNES features cycle precision timing emulation.
   - There's no test for a minimal hardware to get RockNES running at 60FPS,
   but a +1Ghz CPU might do the task. Notice it's not target to run on older 
   machines - that's the price for its accuracy.
  --------------------------------------------------------------------------
    ----------------------------------------------------------------------  

 What's new for version 5.00 BETA 1 (03/13/2006)
 -----------------------------------------------
 - Major CPU core rebuilding, now using cycle precision timing.
 - Opcode 3Ch emulated (NOP6) for our playing needs.
 - Major APU timing, output and core fixes, much more accurate and clean.
 - Major PPU timing fix, pass OK through test ROMs;
 - Optional sound quirk emulation;
 - Sprites 0 and 1 behaviour fixed (Tatakai no Banka works).
 - Better 2004h sprite reading emulation (no flickering in Micro Machines).
 - Fixed screen rendering when disabled (Micro Machines).
 - Fixed DMC clocking, making FireHawk game to work properly.
 - Fixed VRC6 sound output, now using fully signed waves (much better).
 - Several fixes in order to improve emulation performance.
 - Disabled save or loading states during movie playback.
 - Disabled joypad keypresses like up+down or left+right (Zelda 2).
 - Fixed a bug reading the config file, no more blanks at end of strings.
 - Changed joypad buttons assignment in the config file, fixing stupid errors.
 - Fixed many GUI problems, including dumping and file saving.
 - New savestate block added: PTB0 (PPU timing block).
 - Fixed a bug in the savestate [MPR block], plus added an extra block for APU.
 - Updated RSx revision id, now only revision 2 are loadable/supported.
 - Illegal opcodes are simply skipped, instead of quitting to OS.
 - Added mouse gameplay support!
 - Added command line support.
 - Added 'stretched to 640x480 non-scanlined' blitter.
 - Added new 'Options' GUI item, so you can configure inputs, sound, blitter and directories!
 - Config file reworked, fixing a few minor bugs.
 - Frames per second (FPS) display added.
 - A couple of hidden annoyances has been fixed.
 - Mapper 4 (MMC3) disabled due to bad IRQ counter working (to be fixed).
 - Broken trainer support (to be fixed).
 - Other minor fixes and improvements that I don't remember...

 [==========================================================================]
   Notes: * Refers to oldnews.txt for full history of updates.
          * Please, report any problems in a descriptive way in the forums.
 [==========================================================================]

 1. Description
 2. Configurations and default controls
 3. Using the GUI + Game Genie.
 4. iNES file format description.
 5. VS Unisystem games.
 6. "What is a NES mapper?"

 [==========================================================================]

 1. Description
 --------------
 > This software emulates the Nintendo Entertainment System videogame, the NES.
 > RockNES is fully coded in C. It uses the great Allegro library.

 * Emulated hardware *

   - CPU 2A03 emulation (Motorola 6502 variant) using cycle precision;
   - PPU 2C02 emulation using a 'pixel-by-pixel' core;
   - Joypads 1 & 2;
   - pAPU sound channels: square waves, triangle, noise and DMC/RAW;
   - Konami VRC6 sound emulation used in Akumajou Densetsu and Madara games;
   - Partial Famicom DiskSystem and VS-Unisystem;
   - Backed battery;
   - Supported iNES mappers: 0,1,2,3,4,7,9,10,11,13,15,16,18,19,20,21,22,23,24,
   25,26,32,33,34,40,41,42,43,44,57,64,65,66,67,68,69,70,71,72,73,75,76,78,79,
   83,85,88,90,91,92,94,97,99,100,101,110,113,117,118,119,151,160,180,184,187,
   189,225,226,227,228,229,230,231,232,233,234,235,240,243,246 and 255.

 NOTES: 1. Famicom DiskSystem emulation (mapper #20) requires a BIOS file named
           disksys.rom placed in the same directory (not included, no requests). 
        2. RockNES uses a custom RGB palette taken from Rockman Complete Works
           (Playstation); a few colors are from Chris Covell's palette in order
           to fill up 'hard-to-get' RGB entries.
        3. I have no interest to emulate mapper #5 (MMC5, CastleVania 3).

   > Other features available:
   ---------------------------
    - PPU color emphasis and monochrome masking;
    - Accurate sprite #0 triggering and 8-sprites limitation;
    - Joypad data logging (replay);
    - Save states (emulation freezing);
    - NESticle savestates are supported (STA files);
    - GUI and config file;
    - Game Genie codes;
    - Exclusive Real-time ROM data patching;
    - Sound logging (WAVE file);
    - PRG ROM data disassembler;
    - Optional pseudo-stereo sound output (channel separation);
    - Video filters on 640x480 mode: Pixelated, Scanlines and Stretched.

 * Unemulated hardware (and not planned) *

 - Illegal opcodes;
 - European NES (PAL 50Hz) and Famicom devices like microphone;
 - Joypads #3 and #4;
 - PowerPad, Zapper and others (?) through expansion port 4017h;
 - VS-Dualsystem;
 - Playchoice-10 upper monitor (within game instructions, z80 emulation);
 - Other extra sound hardware like VRCV7, Famicom DiskSystem and others.

 > NOTES:
 ********
  - RockNES has ZIP support - you can load game, savestate and movie files.
  - You can record your gameplay. It's just a full log of the joypad states, so 
 your gameplay can be exactly reproduced, like a movie.
  - Game Genie codes are supported.
  - Realtime ROM data patching is supported.
  - NESticle saved states (STA files) are supported & loadable.
  - On first run, RockNES creates a config file named 'rocknes.ini'. There's a
 lot of options to be set. Edit it using any text editor, like Notepad.
  - NES memory dumping* is supported, as listed below:
 Legend: T = text file, B = binary file.

 # Menu -> CPU -> Dump... -> "RAM",
                             "Work-RAM"
                             "CPU $8000-$FFFF"
                             "CPU registers"
                             "PRG ROM data"
                             "CHR ROM data"
                             "Palette RAM"
                             "Pattern table"
                             "Nametables"
                             "Sprite RAM"

    +---------------------+------------------+---------------+------+
    | context             | CPU memory range | filename      | type |
    +---------------------+------------------+---------------+------+
    | System RAM          | 0000h-1FFFh      | nes_ram.bin   |  B   |
    | PRG ROM data        | built-in         | gamename.prg  |  B   |
    | PRG RAM data        | 8000h-FFFFh      | gamename.p8f  |  B   |
    | Work-RAM            | 6000h-7FFFh      | nes_wram.bin  |  B   |
    +---------------------+------------------+---------------+------+

    +---------------------+------------------+---------------+------+
    | context             | PPU memory range | filename      | type |
    +---------------------+------------------+---------------+------+
    | CHR RAM data *      | 0000h-1FFFh      | gamename.gfx  |  B   |
    | Nametables          | 2000h-3EFFh      | gamename.nam  |  B   |
    | Palette RAM         | 3F00h-3FFFh      | pal_ram.bin   |  B   |
    | Sprite RAM          | built-in         | sprites.ram   |  B   |
    | CHR ROM data        | built-in         | gamename.chr  |  B   |
    +---------------------+------------------+---------------+------+
    * As known as Pattern table.
 
 # Menu -> File -> Game Information
 # Menu -> CPU -> Dump... -> CPU registers
    +---------------------+------------------+---------------+------+
    | context             | Information      | filename      | type |
    +---------------------+------------------+---------------+------+
    | iNES header info    | 16 bytes header  | gamename.txt  |  T   |
    | CPU registers       | Actual CPU state | cpu6502.txt   |  T   |
    +---------------------+------------------+---------------+------+

 [==========================================================================]
 * KNOWN EMULATION ISSUES (version 5.00):

 - MMC2/MMC4 games are 1 tile glitched (usually) at right of the screen;
 - The PPU sprite #0 timing still fails with a few games/demos;
 - Mapper #90 Mortal Kombat Special uses a slightly different hardware, so
expect a few issues;
 - Some mappers might be still broken due to lack of proper testing;
 - Garbaged scanline(s) with games that require a perfect IRQ timing;
 - Battletoads might hang during stage 2 (Impact Crater). You could get that
megawarp at beginning, rushing to Turbo Tunnel... ^_^;;
 [==========================================================================]

 2. Configurations and default controls
 --------------------------------------

 > Default keys (by default) are:

    [player 1] - device is KEYBOARD
    UP, DOWN, LEFT, RIGHT  = keyboard arrows
    A      = 'X' key
    B      = 'Z' key
    SELECT = 'Tab' key
    START  = 'Enter' key

    [player 2] - no device assigned (KEYBOARD)
    UP     = 'U' key.
    DOWN   = 'J' key.
    LEFT   = 'H' key.
    RIGHT  = 'K' key.
    A      = 'S' key.
    B      = 'A' key.
    SELECT = 'Q' key.
    START  = 'W' key.

    > Joypads:

    UP,DOWN,LEFT,RIGHT = D-pad
    A      - button 1
    B      - button 2
    SELECT - button 3
    START  - button 4
    Quit Emulator - button 5
    Fast Forward  - button 6

 > Other keys:

 <ESC> - Swap to GUI/game and halt/continue the emulation

 <F2>  - save state from selected slot
 <F3>  - slot selector to save/load a state (0,1,2,3,4,5,6,7,8 or 9)
 <F4>  - load state from selected slot

 <F5>  - NES soft reset (RAMs are not cleaned)
 <F6>  - FDS disk side flip (A->B->C->D->A...)
 <F7>  - FDS disk insert/eject
 <F8>  - to insert coins (VS Unisystem)

 <F9>  - gameplay logging
 <F10> - gameplay player
 <F12> - screenshot [disabled on beta versions]

 <KEY_Q> - Quit to OS

 [==========================================================================]

 3. Using the GUI + Game Genie
 -----------------------------
  (notice that some of the items might be outdated,
   perhaps I'm too lazy for updating them, heh)

 [Main]
  - Load ROM...........: Lists files of extension .NES/.NEZ/.FDS/.BAK/.ZIP 
  - Game information...: Displays iNES header information + CRCs.
  - Screenshot.........: Takes a screenshot (BMP).
  - WAVE logging.......: Record WAV files.
  - Quit...............: Take a wild guess...

 [CPU]
  - Reset..............: Emulation reset.
  - Save state.........: To save your progress.
  - Load state.........: To load your progress.
  - Load NESticle state: Ability to load a NESticle progress.
  - Dump...............: NES memory dumping (lots of options).

 [Misc]
  - Video resolution...: You can change the video card/resolution.
  - Movies.............: Record, play, stop and status of a NES movie.
  - Palettes...........: Set the current palette (for VS Unisystem games).
  - ROM cheat..........: You can patch the loaded ROM data.
  - Game Genie.........: You can enter Game Genie codes (up to 10).
  - ROM Corruptor!.....: Corrupts a certain memory range.

 [Help]
  - System.............: Disabled.
  - About..............: Software revision ID.

        <<--------------------------------------------------------->>
                                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
// To test game genie 8 char code - SXEZSKOZ  Super Mario 3  Skywalker

 > To input a GameGenie code, go to Misc->Game Genie. A small window will
 appear requesting a code, disregarding case (SXEZSKOZ, SxEzSKoz or szezskoz
 are acceptable). Any invalid letter is ignored. Click OK to finish or CLEAR
 to delete all inserted codes.
 > No way to enable/disable a code during gameplay. For 6 chars codes only,
 you must reset the emulation to take effect.

 Note for advanced users:

 > A 6-char GG code will patch data at 8000h-FFFFh on reset only. If a game
 uses bankswitch, there are chances to get an useless code. The 8-char code
 has no problem - it keeps patching whatever appears there.

 [==========================================================================]

 4. iNES header format
 ---------------------

 > RockNES supports only .NES files within the iNES header created by Marat
 Fayzullin years ago. Here's the description:

    +--------+------+------------------------------------------+
    | Offset | Size | Content(s)                               |
    +--------+------+------------------------------------------+
    |   0    |  3   | 'NES'                                    |
    |   3    |  1   | 1Ah                                      |
    |   4    |  1   | 16K PRG-ROM page count (size=x*0x4000)   |
    |   5    |  1   | 8K CHR-ROM page count  (size=y*0x2000)   |
    |   6    |  1   | ROM Control Byte #1                      |
    |        |      |   %mmmmvTsM                              |
    |        |      |    |  ||||+- 0=Horizontal Mirroring      |
    |        |      |    |  ||||   1=Vertical Mirroring        |
    |        |      |    |  |||+-- 1=Backed battery            |
    |        |      |    |  ||+--- 1=Trainer data (512 bytes)  |
    |        |      |    |  |+---- 1=Four-screen mirroring     |
    |        |      |    +--+----- Mapper # (lower 4-bits)     |
    |   7    |  1   | ROM Control Byte #2                      |
    |        |      |   %MMMM00PU                              |
    |        |      |    |  |  |+- 1=VS Unisystem arcade       |
    |        |      |    |  |  +-- 1=Playchoice-10 arcade      |
    |        |      |    +--+----- Mapper # (upper 4-bits)     |
    |  8-15  |  8   | 00h                                      |
    +--------+------+------------------------------------------+

 Legends:
 ========
 a) PRG-ROM stands for PRoGram ROM, or actual 6502 CPU instructions.
 b) CHR-ROM stands for CHaRacter ROM, or the game graphics.

 Notes:
 ======
 1. Needless to say that ROM stands for Read-Only Memory. Understand that
 a RAM type allows writes too.

 2. Next data is PRG-ROM (in linear order) and then CHR-ROM if exists.
 A certain game can use VideoROM (paged gfx data) or VideoRAM at ppu
 I/O 0000h-1FFFh space.

 3. By default, if 4-screen mirroring flag is set, then it's *hardwired*
 and cannot be changed.

 NOTICE:
 =======
 > Dirty headers are still present around ROM images, causing bad header
 parsing, usually getting the mapper number as #66.
 > Mappers 0-255 are valid numbers. However, some pirated/unlicensed games
 can bring unusual mappers being assigned over #255 - low 4 bits of byte 7
 is used, sharing the byte for arcade hardware flags. RockNES has no support
 for these unusual mappers.
 > The header brings the game data size. If the real file size does not match
 the size specified in the header, the loading proccess is halted.

 [==========================================================================]

 5. VS Unisystem
 ---------------

 > VS Unisystem are Nintendo arcade machines with titles such as Pinball,
 Super Mario Bros. and others (insert coin$). The color signal is different,
 hence the NES palette won't fit, so you must select a new palette in the
 GUI for your specific game. RockNES uses the iNES format too.

 * DIP Switches are not supported.

 [==========================================================================]

   CREDITS (no special order)
   **************************

 * Special thanks to Shay Green for his test ROMs, or else RockNES wouldn't
reach its current state.
 * Thanks to Brad Taylor for his superb NES documents;
 * Thanks to _Bnu for his 6502.TXT (6502 Microprocessor) document;
 * NESdev (http://nesdev.parodius.com) and everyone over there!

 DJGPP package
 http://www.delorie.com/djgpp/

 Allegro's library by Shawn Hargreaves
 http://www.talula.demon.co.uk/allegro
 http://alleg.sourceforge.net

 Binary compressed using UPX
 The Ultimate Packer for eXecutables
 Copyright (c) 1996-2001 Markus Oberhumer & Laszlo Molnar
 http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
 http://upx.sourceforge.net

 Alastair Bridgewater - Darcnes
 http://www.dridus.com/~nyef/darcnes

 Parodius Networking & Kinox - website hosting
 http://www.parodius.com
 http://www.kinox.org

 Dirk Stevens - EAGLE core
 http://???

 Super2xSaI and SuperEagle cores
 Copyright (c) Derek Liauw Kie Fa, 1999
 Modifications for Allegro 3.9+ comptibility by Robert J Ohannessian.
 Original web site: http://members.xoom.com/derek_liauw/                              

 unzip -- IO for uncompress .zip files using zlib
 Version 1.00, September 10th, 2003
 Copyright (C) 1998-2003 Gilles Vollant

 Richard Bannister - MacOS port
 http://bannister.org/software/rocknes.htm

 Blargg's Home
 http://www.slack.net/~ant/

 * NES and Nintendo are trademarks of Nintendo CO.

 [=========================================================================]
 [=========================================================================]
//eof
