
                         R o c k N E S
                      NES emulator for PC
                     _____________________
                       1998-2010 Zepper
                       Version 5.05
                       February 21st 2010

  Freeware, for home use.
  - Website......: http://rocknes.net
  - Message board: http://rocknes.phpbbnow.com
  - Micro blog...: http://twitter.com/rocknes
  - E-mail.......: fx3rnes@hotmail.com
  <<======================================================================>>

   LICENSE AGREEMENT [January 2010]:

   (A) RockNES is FREE software. It can be distributed freely, as long as 
 you do not change the original ZIP package.
   (B) Do not modify the original binary/executable.
   (C) Be aware that popular NES games are copyrighted with all rights reserved.
 In most cases, distributing ROM images of these games infringes copyright. 
 Do not distribute RockNES software along with infringing ROMs. 
   (D) It comes 'as is', meaning no warranties. Use it at your own risk! I'm not
 responsible for the misuse of this software.
   
   * If you disagree with these terms, DELETE THIS SOFTWARE NOW.
  <<======================================================================>>

   REQUIRED PC HARDWARE:
   - Modern PCs won't be a problem. ^_^;;
   - For older PCs, you'll need a 1GHz processor and a system within 128mb of RAM.
 Any video board with built-in 3D hardware improves the blitting/speed.
  --------------------------------------------------------------------------
    ----------------------------------------------------------------------  

 What's new for version 5.05 (02/21/2010)
 ----------------------------------------
 - Fixed bitmap clearing again, when switching blitters.
 - More optimizations and cosmetic changes.

 [==========================================================================]
   Read 'oldnews.txt' for a complete history of updates.
 [==========================================================================]

 1. Description
 --------------
 2. Player controls
    Shortcuts
 ------------------
 3. Using the GUI
    NES memory overview
    Additional notes
    NSF playback
    Triple buffering
    Palettes
 ----------------------
 4. iNES header format
 ---------------------
 5. VS Unisystem
 ---------------
 6. The PRG data disassembler
 ----------------------------
 7. CREDITS (no special order)
 -----------------------------

 [==========================================================================]
   KNOWN EMULATION PROBLEMS

 - Mappers 9 and 10 are glitched in the right side of the screen.
 - The game Battletoads (mapper 7) freezes during stage 2.
 - Sound skipping due to the way Allegro handles it.
 - The mapper 5, known as MMC5, is used by a couple of japanese strategy games.
 Currently, only 2 games work: CastleVania 3 and Laser Invasion (USA). Well,
 it's good enough for both, but tell me if you find something wrong. The setup
 is 64k of RAM for all games.
 - Mapper 4 has two IRQ "modes"; only mode B is supported. If a game looks
 glitched or with flickering, it's that. "Mode" means a different cartridge
 board and setup.

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

 1. Description
 --------------

 > RockNES emulates the Nintendo Entertainment System videogame, also known
 as NES 8-bit. It's fully coded in C and uses Allegro library for audio, video
 and inputs.

 * Emulated hardware features *

   - RP2AO3 chip, CPU and APU, based on the 6502 processor.
   - NTSC NES PPU, or Picture Processing Unit.
   - Controller ports 1 and 2.
   - Konami VRC6 sound, used in Akumajou Densetsu / Madara.
   - VS-Unisystem.
   - Backed battery.
   - Famicom Disk System as mapper 20.
   - Supported iNES mappers 0,1,2,3,4,5,7,9,10,11,13,15,16,18,19,20,21,22,23,24,25,
    26,32,33,34,40,41,42,43,44,46,48,57,58,64,65,66,67,68,69,70,71,72,73,75,76,78,
    79,83,85,88,90,91,92,94,97,99,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 Disk System emulation requires disksys.bin (BIOS).
        2. The default palette is a replica from Rockman Complete Works, for PSOne. 
 Missing entries were filled up using a palette provided by Chris Covell.
        3. My palette can be found in the wikipedia, even if NOT officially released.

   > Other features available:
   ---------------------------
    - PPU color emphasis and monochrome mode.
    - Joypad data logging, for replay purposes.
    - Save states.
    - Trainer.
    - GUI and config file.
    - PRG data patching.
    - Sound recording in WAV format.
    - PRG disassembler.
    - Pseudo stereo sound.
    - Various video blitters & stretched modes.
    - Triple buffering in full screen.

   > Unemulated hardware/features:
   -------------------------------
    - Unofficial CPU opcodes.
    - The Famicom Computer system and the european PAL NES.
    - Other inputs like Zapper or Power Pad.
    - Joypads 3 and 4.
    - VS-Dualsystem.
    - Playchoice-10 upper monitor, z80 emulation.
    - MMC5 sound support, among others.

 NOTES: 1. ZIP file is supported. Any file, including savestates, can be zipped.
        2. There's a config file named "rocknes.ini", auto generated.
        3. Certain characters, like accents, are NOT supported.
        4. NSF playback supports savestates.
 
 [==========================================================================]

 2. Player controls
    Shortcuts
 ------------------

 > Default controls:

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

    [player 2] - no device assigned. You may use KEYBOARD setup 2.
    UP     = U key.
    DOWN   = J key.
    LEFT   = H key.
    RIGHT  = K key.
    A      = S key.
    B      = A key.
    SELECT = Q key.
    START  = W key.

    > Joystick/gamepads:

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

    NOTE: if you change the input type, the current config will be lost.

 > Shortcuts:

 <ESC> - GUI access.

 <F1>  - Frames-Per-Second (FPS) display.
 <F2>  - save state.
 <F3>  - file slot select.
 <F4>  - load state.

 <F5>  - soft reset.
 <F6>  - FDS disk change.
 <F7>  - FDS disk insert/eject.
 <F8>  - "insert coin", for VS unisystem games.

 <F9>  - gameplay recording.
 <F10> - plays the recorded gameplay.
 <F11> - unused.
 <F12> - take screenshot.
 <Q>   - Close the emulator.

 - While in the GUI, ctrl+L access the load file dialog, ctrl+X closes the program.
 - Click in the X (right corner of the window) to close the program.

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

 3. Using the GUI
    NES memory overview
    Additional notes
    NSF playback
    Triple buffering
    Palettes
 -----------------------------

 > Here's a quick summary of the GUI.
 > This is the menubar:

       [ File  CPU  Misc  Options  Help ]

 [File]
  - Load...............: File select, displays NES, NSF, FDS and ZIP files.
  - Header info........: iNES or NSF header information viewer.
  - Take screenshot....: Game screenshot.
  - Sound recorder.....: Record WAV files.
  - Quit...............: Close the emulator.

 [CPU]
  - Reset..............: System reset.
  - Hard reset.........: System power off/on.
  - Save state.........: Save your progress anytime.
  - Load state.........: Load your previous save.
  - Dump...............: System memory dumping.
  - View ASM source....: PRG assembly code.
  - Manual disassembler: PRG assembly code.

 [Misc]
  - Video resolution...: You can change the video driver and the resolution.
  - Movies.............: Your gameplay can be reproduced later.
  - Palette............: Changes the current palette.
  - PRG patch..........: You can patch a certain address.
  - PRG corruptor......: Corrupts CPU memory data.

 [Options]
  - Input setup........: Select the input device, as keyboard or joypads.
  - Sound config.......: Changes the sound quality and stereo/mono modes.
  - Directories........: You can configure the paths for dumps and more.
  - Blitter............: Choose a blitter, it enhances your game image.
  - Video buffering....: Select between double or triple buffering.

 [Help]
  - System.............: Video, audio and mouse drivers.
  - About..............: Emulator version.

        <<--------------------------------------------------------->>
          NES memory overview
          - Some of these registers do not allow reads.
          - A few mappers use 4018-FFFF region as I/O registers.

          [CPU] 
          $0000-$07FF: system RAM
          $0800-$1FFF: mirrors of $0000-$07FF
          $2000-$2007: PPU registers
          $2008-$3FFF: mirrors of $2000-$2007
          $4000-$4017: APU registers.
          $4018-$5FFF: may be used by mappers
          $6000-$7FFF: usually PRG RAM or backed battery data
          $8000-$FFFF: PRG data banks, 8k

          [PPU]
          $0000-$1FFF: CHR RAM, 2 x 4k pattern tables
          $2000-$3EFF: nametable, 4 x 1k banks
          $3F00-$3F1F: palette index, known as color RAM
          $3F20-$3FFF: mirrors of $3F00-$3F1F
        <<--------------------------------------------------------->>

 # [menubar] CPU -> Dump... -> " system RAM     "
                               " PRG RAM        "  -> PRG RAM or backed battery
                               " $8000-$FFFF    "  -> PRG data
                               ------------------ 
                               " PRG data       "  -> ROM PRG data
                               " CHR data       "  -> ROM CHR data
                               ------------------ 
                               " Palette RAM    "  -> color indexes
                               " Pattern tables "  -> CHR RAM data
                               " Nametables     "  -> tile and tile attribute data
                               " Sprite RAM     "  -> OAM data
                               ------------------ 
                               " CPU registers  "  -> values

    # The CPU registers saved are:
      - Interrupt vectors (NMI/RESET/IRQ).
      - Registers A, X, Y, S, P.
      - Program counter (PC).
      - IRQ and NMI pending flags.
      - $6000-$7FFF state, as PRG, Work RAM or openbus.
      - $8000-$FFFF state, as PRG or open bus.

 > Most of dumped files use the game filename as base. The filename is displayed
 once written to the disk.

        <<--------------------------------------------------------->>
          Additional notes

 - The selectable inputs are: keyboard (setup 1 or 2), joystick or mouse.
 - The mouse support is very poor and must be used only as curiosity, so don't 
 expect superb gameplay.
 - All the changes are saved to rocknes.ini file when you close the emulator.
 - The NES movies do NOT represent a multimedia file, like an AVI, MPEG or other
 kind of video. What's called "movie" here is the ability to replay a game by
 reading all your keypresses saved during a gameplay. Files .rm0, .rm1, .rm2 ...
 are saved gameplays, known here as "NES movies".

        <<--------------------------------------------------------->>
          NSF music playback

 - NSF files are now supported! The driver includes a nice visualizer on playback.
 Why don't you try out and send me some feedback? ;)

 > It draws colored circumferences. You can identify the sound channels by color:

 * dark blue..: square wave #1
 * light blue.: square wave #2
 * red........: triangle wave
 * white......: noise
 * green......: DMC ($4011 raw unsupported)
 * dark pink..: VRC6 square #1
 * light pink.: VRC6 square #2
 * orange.....: VRC6 sawtooth

 > PAL files (50hz) are not supported, as the playback stays always at 60hz.

 > NSF controls: keyboard arrows (left/right) changes the track, ENTER plays it.
 They cannot be reconfigured!

        <<--------------------------------------------------------->>
          Triple buffering

 - By request, triple buffering is available now! It eliminates the screen
 tearing effect, making your gameplay smooth on scrolling.
 - Works only in full screen modes.
 - To enable it, select "Options" -> "Video buffering". Changes will take effect
 on next launch. An optional way is to edit the rocknes.ini file and set the
 switch -triple_buffering to 1.

        <<--------------------------------------------------------->>
          Palettes

 - From [Menubar] Misc -> Palette, you have the following submenu:

     " load .PAL file " -> You can load palette files (.pal)
     " reset default  " -> Restore the default built-in palette
     "________________"             
     " set VS palette " -> Select a VS unisystem color table

 - PAL files must be 192 bytes long. Three bytes (a triplet) compose a RGB value. 
 We take 64 triplets to build the palette. There are a couple of available custom
 NES palettes around.


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

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

 > RockNES supports .NES files within the iNES header, created by Marat Fayzullin.
 > Here's the format description actually supported:

    +--------+------+------------------------------------------+
    | Offset | Size | Content(s)                               |
    +--------+------+------------------------------------------+
    |   0    |  3   | NES                                      |
    +--------+------+------------------------------------------+
    |   3    |  1   | $1A                                      |
    +--------+------+------------------------------------------+
    |   4    |  1   | 16K PRG data banks                       |
    +--------+------+------------------------------------------+
    |   5    |  1   | 8K CHR data banks                        |
    +--------+------+------------------------------------------+
    |   6    |  1   | Control lower byte                       |
    |        |      |   %mmmmvTsM                              |
    |        |      |    |  ||||+- 0=Horizontal Mirroring      |
    |        |      |    |  ||||   1=Vertical Mirroring        |
    |        |      |    |  |||+-- 1=Backed battery            |
    |        |      |    |  ||+--- 1=Trainer data (512 bytes)  |
    |        |      |    |  |+---- 1=Four screen mirroring     |
    |        |      |    |  |   (overrides H/V mirroring flag) |
    |        |      |    +--+----- Low 4 bits of mapper number |
    +--------+------+------------------------------------------+
    |   7    |  1   | Control upper byte                       |
    |        |      |   %MMMM00PU                              |
    |        |      |    |  |  |+- 1=VS Unisystem arcade       |
    |        |      |    |  |  +-- 1=Playchoice-10 arcade      |
    |        |      |    +--+----- High 4 bits of mapper number|
    +--------+------+------------------------------------------+
    |  8-15  |  8   | Reserved, "must be" zeroes.              |
    +--------+------+------------------------------------------+

 > Mappers greater than 255 are not supported.
 > The file size must match the size specified in the header.

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

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

 - Once you load a game, the palette will be probably wrong. Choose a new set,
 Misc->Palette->set VS palette. Game titles are used as a quick reference.
 Try different settings for a better choice.
 - Use key F8 to "insert coin". DIP Switches are not supported.

 - Here's a bit of history:
 > The Nintendo VS Series was a series of arcade video games designed for two-player
 competitive play using the VS. UniSystem or VS. DualSystem, arcade system boards 
 based on the Nintendo Entertainment System. Many of these stand-up or sit-down arcade
 machines had two screens and controls joined at an angle.
 > These games were arcade ports of home video games for the Nintendo Entertainment 
 System, thus they could be sold cheaply to arcades in the late 1980s.

 Source: WikiPedia
  http://en.wikipedia.org/wiki/Nintendo_Vs._Series

 [==========================================================================]
 
 6. The PRG data disassembler
 ----------------------------

 - [CPU]-> View ASM source
           Manual disassembler

 [1] "View ASM source" - overview

 +-----------------------------------+
 |$8057 *A=90, X=05, Y=00, S=FF, P=A5|  -> CPU registers: PC,A,X,Y,S,P.
 |PRG bank 08 [$1C057]               | 
 |+---------------------------------+| 
 ||8000 78       SEI                || 
 ||8001 D8       CLD                ||
 ||8002 A9 10    LDA #$10           || 
 ||8004 8D 00 20 STA $2000          ||
 ||8007 A2 FF    LDX #$FF           ||
 ||8009 9A       TXS                ||
 ||800A AD 02 20 LDA $2002          ||  -> Disassembled code.
 ||800D 10 FB    BPL $800A          ||
 ||800F AD 02 20 LDA $2002          ||
 ||8012 10 FB    BPL $800F          ||
 ||8014 A0 FE    LDY #$FE           ||
 ||8016 A2 05    LDX #$05           ||
 ||8018 BD D7 07 LDA $07D7, X       ||
 ||801B C9 0A    CMP #$0A           ||
 ||801D B0 0C    BCS $802B          ||
 ||801F CA       DEX                ||
 |+---------------------------------+|
 |( )$5000( )$6000 ( )$7000          |  -> CPU address select.
 |(o)$8000( )$9000 ( )$A000 ( )$B000 |
 |( )$C000( )$D000 ( )$E000 ( )$F000 |
 +-----------------------------------+

 > If you select $8000, the entire PRG bank at $8000-$8FFF is disassembled.
 Click "REFRESH" to update the disassembled code!
 > It's read-only, you cannot modify anything.

 [2] "Manual disassembler" - overview example

 +---------------------------------------------------+
 | Manual disassembler                             X |
 | Please, input a proper address:                   |
 |                                                   |
 |  8000___ [Refresh] (o)CPU  ( )PRG    [Save]       |
 |                                                   |
 |+---------------------------------+ +------------+ |
 ||8000 78       SEI                | |PC=$8057    | |
 ||8001 D8       CLD                | |A=$90       | |
 ||8002 A9 10    LDA #$10           | |X=$05       | |
 ||8004 8D 00 20 STA $2000          | |Y=$00       | |
 ||8007 A2 FF    LDX #$FF           | |S=$FF       | |
 ||8009 9A       TXS                | |P=$A5       | |
 ||800A AD 02 20 LDA $2002          | |            | |
 ||800D 10 FB    BPL $800A          | |$6000 = $FF | |
 ||800F AD 02 20 LDA $2002          | |$8000 = $00 | |
 ||8012 10 FB    BPL $800F          | |$A000 = $01 | |
 ||8014 A0 FE    LDY #$FE           | |$C000 = $02 | |
 ||8016 A2 05    LDX #$05           | |$E000 = $03 | |
 ||8018 BD D7 07 LDA $07D7, X       | |            | |
 ||801B C9 0A    CMP #$0A           | |Notice:     | |
 ||801D B0 0C    BCS $802B          | |FF = Open   | |
 ||801F CA       DEX                | |or normal.  | |
 |+---------------------------------+ +------------+ |
 +---------------------------------------------------+

 > It's much like the previous one, with a different layout. The PRG banks
 are displayed for all "valid" pages, and FF indicates a possible open bus.
 > The CPU setting allows you to disassemble data from CPU space.
 > The PRG setting has direct ROM data access; use the file offset MINUS 16.
 > Click [SAVE] to write the disassembled data into a text file.


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

 7. CREDITS (no special order)
 -----------------------------

 NesDev community
 http://nesdev.parodius.com/bbs
 http://wiki.nesdev.com/w/index.php/Nesdev_Wiki

 The Dev-C++ resource site
 http://www.bloodshed.net/dev

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

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

 Parodius Networking - website hosting
 http://www.parodius.com

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

 blargg
 http://www.slack.net/~ant

 Marat Fayzullin
 http://fms.komkon.org

 [=========================================================================]
EOF
