
                         R o c k N E S
             NES emulator and NSF player for Windows
                     _____________________
                       1998-2012 Zepper
                       Version 5.074
                       April 5th 2012

  Freeware, for home use.
  Best viewed with Notepad.
  <<======================================================================>>
  - Website......: http://rocknes.net
  - Message board: http://rocknes.phpbbnow.com
  - Twitter......: http://twitter.com/rocknes
  - E-mail.......: fx3rnes [at] hotmail [dot] 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 the RockNES software along with infringing ROMs. 
   (D) It comes "as is", meaning no warranties. Use at your own risk! I'm not
 responsible for the misuse of this software.
   
   * If you disagree with these terms, DELETE THIS SOFTWARE NOW.
  <<======================================================================>>

 What's new for version 5.074 (04/05/2012)
 -----------------------------------------
 - Fixed broken MMC3 IRQs (mapper 4), my mistake.
 - Fixed a potential crash if the joystick is set, but disconnected.
 - Put back Sleep(0) for both double and triple buffering modes.

 [==========================================================================]
   Read "oldnews.txt" for the history of updates.
 [==========================================================================]

 -----------------------------
 1. Description
 -----------------------------
 2. Player controls
    Shortcuts
 -----------------------------
 3. Using the GUI
    NES memory overview
    Additional notes
    Sound output
    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

 - NSF files have the playback set at 60hz. Custom refresh rates are not supported.
 - A few NSFs don't return from the PLAY routine. They're not supported yet.
 - Famicom Disk System (FDS) support is partial.
 - The game Battletoads (mapper 7) freezes during stage 2.
 - Sound skipping due to the way Allegro handles it.

 * For homebrewing, please, if you're using less than 32k of PRG ROM, please, compile
 your file to be, at least, 32k in size; otherwise, RockNES may not work.

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

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

 > RockNES emulates the Nintendo Entertainment System videogame, also known
 as NES 8-bit. It's fully coded in C, using Allegro library for audio, video and
 input devices, plus the zLib library for compressed files, supporting ZIP and GZ.

   > Emulated hardware features:
   -----------------------------
   - 6502 CPU and APU emulation.
   - NTSC PPU emulation.
   - Joypads 1 and 2.
   - Konami VRC6 sound expansion (Akumajou Densetsu / Madara).
   - [Partial] VS Unisystem.
   - Backed battery, formally PRG-RAM.
   - [Partial] 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,86,88,90,91,92,93,
     94,97,99,101,110,113,117,118,119,151,160,180,184,187,189,211,225,226,227,228,229,
     230,231,232,233,234,235,240,243,246 and 255.

   > Other features available:
   ---------------------------
   - PPU color emphasis and monochrome mode.
   - Joypad data logging for game replays.
   - Save states.
   - GUI and config file.
   - ROM patching.
   - Sound recording in WAV format.
   - Built-in disassembler.
   - Pseudo stereo sound output.
   - Fami clone sound output style.
   - Various video blitters & stretched modes.
   - Triple buffering in full screen.
   - Ability of dumping almost any PPU/CPU memory.
   - Palette RAM viewer.

   > Unemulated hardware/features:
   -------------------------------
   - Unofficial CPU opcodes.
   - Famicom hardware specific (japanese NES), or european (PAL).
   - Input devices like Zapper, Power Pad and others.
   - Joypads 3 and 4.
   - VS Dualsystem.
   - Playchoice-10 upper monitor, requires z80 emulation.
   - Other sound expansions, like MMC5, VRCVII or Namco.

   > NOTES:
   --------
        1. ZIP files are supported. Any file, including savestates, can be ZIPped.
        2. There's an auto generated config file "rocknes.ini".
        3. Certain ascii characters, like accents, are NOT supported on filenames.
        4. The NSF player supports savestates.
        5. The Famicom Disk System emulation requires the BIOS file "disksys.rom".
 
 [==========================================================================]

 2. Player controls
    Hotkeys
 ------------------

 > Default controls:

    [player 1] - PC input device assigned is KEYBOARD.
    [player 2] - no PC input device assigned.

   [KEYBOARD]
    D-pad + = keyboard arrows.
    B       = Z key.
    A       = X key.
    SELECT  = Tab key.
    START   = Enter key.


   [JOYSTICK SETUP]
    D-pad + =  joystick D-pad.
    B       = button 2.
    A       = button 1.
    SELECT  = button 3.
    START   = button 4.

 > Hotkeys:

 <ESC> - Swap to GUI/gameplay.

 <F1>  - toggles FPS display (Frames Per Second).
 <F2>  - save state.
 <F3>  - slot select, limited to 15.
 <F4>  - load state.

 <F5>  - soft reset.
 shift+<F5>  - hard reset.
 <F6>  - FDS disk swap.
 <F7>  - FDS disk insert/eject.
 <F8>  - "insert coin" for VS unisystem.

 <F9>  - gameplay recording.
 <F10> - gameplay replay.
 <F11> - quit to OS (no confirmation message).
 <F12> - game screenshot.
 <shift+F12> - snapshot of the desktop.

 <1> - reset to default blitter (256x240).
 <2> - switch between doubled (512x384) and stretched (640x480) modes.
 <3> - cycle between normal, scanlined and pixelated modes.
 NOTE: these hotkeys can be disabled. Go to [Options]->Other options.

 - Hold <Atl> and press <ENTER> to switch between windowed and fullscreen modes.

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

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

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

       [ ! File  CPU  Misc  Options  ? ]

 [File]
  - Load...............: File selector, displays NES, NSF, FDS and ZIP files.
  - Header info........: iNES, FDS or NSF header information viewer.
  - Take snapshot......: Screenshot [what's being rendered].
  - Sound recorder.....: Record WAV files.
  - Quit...............: Close the emulator.

 [CPU]
  - Reset..............: Software reset.
  - Hard reset.........: Hardware reset (much like a power off, then on).
  - Save state.........: Save your progress.
  - Load state.........: Load your previous save.
  - View ASM source....: PRG ROM disassembler.
  - Custom.............: Custom disassembler.
  - Dump...............: Select NES memory data to save.

 [Misc]
  - Screen resolution..: Change the video resolution.
  - Movies.............: Record/play your gameplay.
  - Palette............: Changes the current NES palette.
  - ROM patch..........: Patch PRG ROM data.
  - ROM corruptor......: Fill up a ROM area with a chosen byte.

 [Options]
  - Input setup........: Select the input device, like keyboard or joystick.
  - Sound options......: Enable/disable sound output and choose stereo/mono, famiclone.
  - Directories........: Paths to load movies, savestates and more.
  - Blitter............: Stretched and scanlined video (PPU output).
  - Video buffering....: Select double or triple buffering.

 [?] HELP MENU
  - System info........: Displays video, audio, mouse and joystick drivers.
  - About..............: Emulator version and copyright info.

 [!] QUICK MENU
  - Play another game...........: Access the file selector, like "Load".
  - Restart the game............: Soft reset.
  - Save my gameplay............: Save your progress.
  - Continue my saved gameplay..: Load your saved progress.
  - View the game information...: Like "Header info".
  - The screen..................: Quick emulator window setup.
  - I want to close this program: Close the emulator.


        <<--------------------------------------------------------->>
          NES memory quick overview

          [CPU] 
          $0000-$07FF: RAM.
          $0800-$1FFF: RAM mirrors.
          $2000-$2007: PPU registers.
          $2008-$3FFF: PPU mirrors.
          $4000-$4017: APU registers, except $4014 (OAM DMA).
          $4018-$5FFF: unused, assigned by mapper hardware.
          $6000-$7FFF: PRG RAM or backed battery.
          $8000-$FFFF: PRG ROM banks.

          [PPU]
          $0000-$1FFF: CHR RAM.
          $2000-$2FFF: Nametable data.
          $3000-$3E1F: Nametable mirrors.
          $3F00-$3F1F: palette RAM.
          $3F20-$3FFF: palette RAM mirrors.
        <<--------------------------------------------------------->>

 # menubar [ CPU ] Dump... ->  " RAM            "  -> CPU $0000-$07FF.
                               " PRG RAM        "  -> CPU $6000-$7FFF.
                               " $8000-$FFFF    "  -> PRG-ROM data, if assigned.
                               ------------------ 
                               " PRG ROM        "  -> Program ROM data.
                               " CHR ROM        "  -> Character ROM data, if available.
                               ------------------ 
                               " palette RAM    "  -> Color indexes at $3F00-$3F1F.
                               " CHR RAM        "  -> Pattern table data.
                               " nametables     "  -> Tile maps and attribute colors.
                               " primary OAM    "  -> Sprite RAM ($2004/$4014).
                               " secondary OAM  "  -> Last PPU sprite evaluation.
                               ------------------ 
                               " CPU registers  "  -> Saves a text file within relevant CPU info.

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

 - Most of the GUI settings are saved as "rocknes.ini" config file.
 - Game screen modes:

   - normal mode, at 256x240 pixels;
   - double mode, at 512x480 pixels;
   - double mode with scanlines (bright 50% reduced);
   - double mode pixelated (bright 75% reduced);
   - stretched mode, at 640x480 pixels;
   - stretched mode with scanlines (bright 50% reduced).

        <<--------------------------------------------------------->>
          Sound output

 - RockNES uses a PC sample rate of 44100 hertz. There are 3 configs:

 [x] Sound output...........: enables sound output.
 [ ] Use stereo mode........: enables a pseudo-stereo mode.
 [ ] Enable famiclone style.: swap square wave duty cycles to sound like Famicom clones.
 [x] Enable $4011 register..: ability to disable $4011 raw sound rendering.

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

 - NSF is a music file format. It's the sound code extracted from games. In order
 to get it working, RockNES emulates it as mapper 256.
 - NSFs are supported now, including a nice visualizer on playback. While a NSF is 
 playing, you can identify a sound channel by its 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

 - Controls are pretty easy. Use the keyboard arrows left/right to change tracks,
 hit ENTER to play the current track. Info is displayed in the program bar title.
 Notice that some NSFs use a non-standard setup, like not playing at 60hz. Such files
 are not supported though. Savestates are supported! :)

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

 - It eliminates the screen tearing effect, making your gameplay smoother.
 It works in full screen mode only.
 - To enable it, select [Options] -> Video buffering. Restart the emulator.
 - Instead, you can edit "rocknes.ini" and set the flag -triple_buffer to 1.

 * There's an option to use the desktop resolution on triple buffering mode.
 Look at [Options]->Other options. 

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

 - The default palette is a replica from the PSX game Rockman Complete Works,
 but some "holes" were filled up using another palette provided by Chris Covell.
 - There are 64 colors available. Color emphasis is supported, making a total of
 256 possible colors.

     " Load palette    " -> Select a palette file (.pal extension).
     " Restore default " -> Restore the default built-in palette.
     "_________________"             
     " VS palette      " -> Select a VS unisystem table.
     " Palette RAM     " -> View the palette RAM.

 - Palette files must be 192 bytes long. Three bytes compose a RGB value, 64 
 triplets building the palette. There are a couple of available custom palettes.
 The color emphasis table is build once the emulator is launched, so there's no
 need of storing such entries in a palette file.

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

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

 > Here's a quick iNES header description, created by Marat Fayzullin.

    +--------+------+------------------------------------------+
    | 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, should be zeroes.              |
    +--------+------+------------------------------------------+

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

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

 > From http://en.wikipedia.org/wiki/Nintendo_Vs._Series:
 
 "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".

 - Once you load a game, the palette will be probably wrong. Choose a new palette table
 at [Misc]->Palette->VS palette. Game titles are used for an easy reference.

 - Press <F8> to "insert coin". DIP Switches are not supported.


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

 - There's a built-in disassembler. You can see the ASM code for the current PRG-ROM
 bank accessed, or choose another bank to disassemble it. There are no debug options.
 However, a few tools are available, such as PRG-ROM patching and corruption,plus a
 memory dumper. It's possible to save the ASM code to a file.
 - All the CPU registers are displayed. There's a remote possibility of error or even
 a program crash in certain picky cases, but nothing to worry about. :)

 ##################################
 # [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]               |  -> PRG-ROM bank number and ROM offset.
 |+---------------------------------+| 
 ||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 (ASM 6502).
 ||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                ||
 |+---------------------------------+|
 |( )$4000( )$5000 ( )$6000 ( )$7000 |  -> CPU space.
 |(o)$8000( )$9000 ( )$A000 ( )$B000 |
 |( )$C000( )$D000 ( )$E000 ( )$F000 |
 +-----------------------------------+

 > If you select $8000, the entire PRG bank at $8000-$8FFF is disassembled.
 Click in the "Refresh" button to update the window & disassemble it again.
 > This feature is read-only, you cannot modify anything from here.

 *Note: if the cpu PC is at $4000-$4FFF, the disassemble still occurs. The
 $4000 label is disabled for now (you cannot select it).

 ##################################
 # [2] Custom disassembly         #
 ##################################

 +---------------------------------------------------+
 |+-------------------------------------------------+|
 || Disassembler                                 [X]||
 |+-------------------------------------------------+|
 |                                                   |
 |  Offset:                                          |
 |   8000___ [Refresh] [o]CPU  [ ]ROM     [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           | |            | |
 ||801D B0 0C    BCS $802B          | |            | |
 ||801F CA       DEX                | |            | |
 |+---------------------------------+ +------------+ |
 +---------------------------------------------------+

 > It's much like the previous one, with a different layout. The PRG banks
 are displayed for all paged banks, and $FF indicates open bus.
   * Switch to CPU to disassemble data from any CPU space.
   * Switch to PRG for file data offset MINUS 16.
    * Click [Save] to write the disassembled data to a text file.

 > NOTE: disassembled PRG ROM banks are always 4096 bytes long (0x1000).
 So, if you type an offset like 0x9120, the disassembler cannot cross the 
 page: the output will start at 0x9000 instead.


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

 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
 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

 quietust
 http://www.qmtpro.com/~nes/nintendulator/

 Marat Fayzullin
 http://fms.komkon.org

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