
                         R o c k N E S
               NES emulator and NSF player for PC
                     _____________________
                       1998-2011 Zepper
                       Version 5.061
                       February 4th 2011

  Freeware, for home use.
  - 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 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.
  <<======================================================================>>

 What's new for version 5.061 (02/04/2011)
 -----------------------------------------
 - Fixed input devices configuration, joysticks should work ok.
 - Fixed a minor mouse flag glitch on drawing.
 - Added a popup warning when an unofficial opcode is trapped in full screen mode.
 - Joystick driver info is displayed in the "System info" option.
 - Other internal fixes and cosmetic changes.
 - Documentation updated.

 [==========================================================================]
   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 at 60hz only. No custom refresh rate, sorry.
 - 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 assigns more than one cartridge board type, hence IRQ "modes" currently
 known as A and B; only mode B is supported. If a game looks glitched or with 
 flickering, that's a possible reason.

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

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

 > RockNES emulates the Nintendo Entertainment System videogame, also known
 as NES. It's fully coded in C and uses Allegro library for audio, video and
 inputs, plus the zLib for compressed files.
 > RockNES requires Allegro 4.4 library to run. Download it separately (alleg44.dll).

   > Emulated hardware features:
   -----------------------------
   - [6502] CPU and APU emulation.
   - [NTSC] PPU, or Picture Processing Unit.
   - Joypads 1 and 2.
   - Japanese 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,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.
   - PRG-ROM patching.
   - Sound recording [WAV format].
   - Built-in disassembler.
   - Pseudo stereo sound output.
   - Famicom-clone sound style.
   - Various video blitters & stretched modes.
   - Triple buffering [full screen].
   - Ability of dumping to a file almost any PPU/CPU memory data.
   - Palette RAM viewer.

   > Unemulated hardware/features:
   -------------------------------
   - Unofficial CPU opcodes.
   - The Family Computer System (Famicom).
   - The european NES [PAL].
   - Other kind of inputs such as Zapper or Power Pad.
   - Joypads 3 and 4.
   - VS Dualsystem.
   - Playchoice-10 upper monitor [z80 emulation].
   - Other sound extra channels like MMC5.

   > NOTES:
   --------
        1. ZIP files are supported. Any file, including savestates, can be ZIPped.
        2. There's a config file named "rocknes.ini", auto generated.
        3. Certain ascii characters, like accents, are NOT supported.
        4. The NSF player supports savestates.
        5. The Famicom Disk System emulation requires the BIOS file disksys.rom,
 placed in the same folder with the emulator binary.
        6. An iNES mapper may represent more than one type of cartridge board.
 
 [==========================================================================]

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

 > Default controls:

    [player 1] - device is KEYBOARD setup 1.
    [player 2] - no device assigned by default.

   [KEYBOARD SETUP]
    UP,DOWN,LEFT,RIGHT = keyboard arrows.
    B      = Z key.
    A      = X key.
    SELECT = Tab key.
    START  = Enter key.


   [JOYSTICK SETUP]
    UP,DOWN,LEFT,RIGHT = D-pad.
    B      - button 2.
    A      - button 1.
    SELECT - button 3.
    START  - button 4.

 > Hotkeys:

 <ESC> - Swap to GUI.

 <F1>  - FPS display toggle [Frames-Per-Second].
 <F2>  - save state.
 <F3>  - slot select.
 <F4>  - load state.

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

 <F9>  - gameplay recording.
 <F10> - plays the recorded gameplay.
 <F11> - quit the emulation / back to OS.
 <F12> - snapshot of the NES game screen [what's being rendered].
 <shift+F12> - snapshot of the desktop.

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

 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 select, displays NES, NSF, FDS and ZIP files.
  - Header info........: iNES, FDS or NSF header information viewer.
  - Take screenshot....: Snapshot [what is being rendered].
  - 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.
  - View ASM source....: PRG disassembler.
  - Custom... .........: Customize disassembly.
  - Dump...............: You can dump almost any NES memory data.

 [Misc]
  - Screen resolution..: Change the video driver and resolution.
  - Movies.............: For game replays.
  - Palette............: Changes the current palette.
  - ROM patch..........: Ability to patch ROM data by the file offset.
  - ROM corruptor......: Fill up a ROM area with a chosen byte.

 [Options]
  - Input setup........: Select the input device, as keyboard or joypads.
  - Sound setup........: You can enable/disable sound output and choose stereo/mono.
  - Directories........: Paths for movies, savestates and more.
  - Blitter............: Stretched and scanlined output modes.
  - Video buffering....: Select between double or triple buffering.

 [?]
  - System info........: Video, audio, mouse and joystick drivers.
  - About..............: Emulator version and copyright info.

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

          [CPU] 
          $0000-$07FF: main RAM.
          $0800-$1FFF: mirrors of $0000-$07FF.
          $2000-$2007: PPU registers.
          $2008-$3FFF: mirrors of $2000-$2007.
          $4000-$4017: APU registers, except $4014 [OAM DMA].
          $4018-$5FFF: a few mappers read/write there.
          $6000-$7FFF: PRG-RAM (backed battery, trainer).
          $8000-$FFFF: PRG-ROM banks.

          [PPU]
          $0000-$1FFF: CHR-RAM, composed by two pattern tables.
          $2000-$2FFF: four nametables of 1k each.
          $3000-$3E1F: mirrors of $2000-$2FFF.
          $3F00-$3F1F: color RAM indexes.
          $3F20-$3FFF: mirrors of $3F00-$3F1F.
        <<--------------------------------------------------------->>

 # menubar [ CPU ] Dump... ->  " main RAM       "  -> RAM at CPU $0000-$07FF.
                               " PRG-RAM        "  -> Data at CPU $6000-$7FFF.
                               " $8000-$FFFF    "  -> PRG-ROM data, if assigned.
                               ------------------ 
                               " PRG-ROM        "  -> Program data.
                               " CHR-ROM        "  -> Character ROM data, if available.
                               ------------------ 
                               " color RAM      "  -> Color indexes at $3F00-$3F1F.
                               " CHR-RAM        "  -> Pattern table data.
                               " nametables     "  -> Tile maps and attribute colors.
                               " primary OAM    "  -> Formally sprite RAM.
                               " secondary OAM  "  -> PPU evaluated sprites.
                               ------------------ 
                               " CPU registers  "  -> Save a text file within relevant CPU info.

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

 - Do not use the mouse as controller for serious gameplay!
 - All the GUI settings are automatically saved to the rocknes.ini file on quit to OS.

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

 - The sound sample rate is always at 44100hz for now. In the GUI, select [Options]->Sound options
 to access three features:

 [x] Sound output.
 [ ] Use stereo mode.
 [ ] Enable famiclone style.

 - The first options says by itself: you can enable/disable sound output; though, the frame rate 
 will remain at 60hz. The second option does NES channels separation for each speaker.
 - The last one enables the sound output of a Famicom-clone console. It swaps the duty cycles 25 
 and 50%. Notice that this option is NOT saved into config file.
 - There's no need to restart the emulator anymore.

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

 - NSF files are now supported, including a nice visualizer on playback.
 Try out and send me some feedback!

 > While playing a NSF, the emulator draws colored circumferences. 
 You can identify a sound channel by color, as described below:

 * 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

 > NSF controls: keyboard arrows (left/right) changes the track, ENTER plays it.
 They cannot be reconfigured!
 # NOTE: the playback is always at 60hz. Custom rates are not supported.

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

 - By request, triple buffering is available now! It eliminates the screen
 tearing effect, making your gameplay smoother. It works only in full screen mode.
 - 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
 flag -triple_buffer to 1.

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

 - The emulator palette is a replica of Rockman Complete Works palette for PSX.
 The missing entries were filled up using a palette provided by Chris Covell.
 - There are 64 colors available. Color emphasis is supported, making a total of
 256 possible colors.

 - Select [Misc] -> Palette... for:

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

 - Palette files must be 192 bytes long. Three bytes compose a RGB value, 64 
 triplets to build 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 the entries into a palette file.
 - The palette RAM is the data at PPU $3F00-$3F1F. The values aren't RGB, but
 palette indexes.


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

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

 > Here's the format description of the iNES header, 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.              |
    +--------+------+------------------------------------------+

 #NOTE: there's an open discussion in the community about an iNES 2.0 header version.
 For a few reasons, I'm not adding it yet.

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

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

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

 - 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 quick reference.

 - Press <F8> to "insert coin". DIP Switches are not supported, among other settings.


 [==========================================================================]
 
 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 into 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 do page
 crossing. 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 - 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
