
                               R o c k N E S
                       A NES 8-bit videogame emulator
  <<======================================================================>>
                (c)1998-2003 Fx3, version 3.10 - Dec 09th 2003
             LICENSE: Freeware, for absolutely non-commercial use
  <<======================================================================>>

   LICENSE AGREEMENT:

   - This is a free software, meaning no commercial ways. It has absolutely
   no warranties, so you use it at your own risk. Any ROM images can not be
   packaged or distributed with this software. I can not be responsible for
   your actions. However, feel free to distribute it in a computer magazine
   CD with misc softwares, by respecting the agreement lines you just read.
   - My website is always at http://rocknes.kinox.org, and you can even use
   the forums to contact me.
   - If you disagree, delete this software now.

  --------------------------------------------------------------------------
    ----------------------------------------------------------------------  

 What's new for version 3.10 (12/09/2003)
 ----------------------------------------
 - Fixed the unreported (!) broken pAPU stereo sound effect;
 - Fixed pAPU sound driver, correct reset and envelope/sweep emulation;
 - Fixed pAPU volume levels to something near enough;
 - Added pAPU volume decay for the mixed sample output;
 - The fast forward now silents the sound output;
 - Fixed FDS state loading, plus its IRQ disk timing (or almost);
 - Fixed PRG-ROM/WorkRAM data identification on bank 3 (savestates);
 - Changed nametable/color RAMs to be saved in a separated tagged block (NAM),
 hence older RSx states are no more compatible;
 - Fixed a bug in the disassembler (relative branch address);
 - In the disassembler window, the actual CPU bank was incorrectly set;
 - Added ability to disassemble CPU 5000h-7FFFh regions;
 - A couple of CPU fixes, such as IRQs, and a few opcodes now parsed as NOP;
 - PPU timing tweaked once again, and rendering slightly optimized;
 - Fixed two PPU rendering bugs (of max. fine x-scroll value and color ram);
 - NMI timing tweaked once again, might be imperfect though;
 - Changed sprite DMA transfer behaviour on 4014h writes;
 - Removed mappers 6, 8 and 17 support (hacked stuff, gone nowadays);
 - Improved VRCVI/MMC5/mapper91 IRQ timing;
 - Fixed frame-IRQ somewhat (sound in Dragon Quest games is okay again);
 - Fixed a bug saving files (filename related);
 - Fixed stretched blitter plot (`-blitter 4` option in the rocknes.INI file);
 - Removed that vsync option for a while;
 - Mouse pointer fixed to start at GUI bar, instead of screen centered;
 - Changed `ROM cheat` label to `ROM patch` for your best safeness;
 - Up to date unzip code/ZLIB library;
 - Added a few C tweaks to speed up the emulation a bit;
 - PPU frame rendering optimized;
 - Optimized filters Pixelated and EAGLE, hence a very nice speed up;
 - Usual minor fixes and cosmetic changes.

 [==========================================================================]
   Notes: * Feel free to edit 'oldnews.txt' for history of past 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 NES videogame, currently +-20 years old.
 > RockNES is fully coded in C. It uses an EAGLE filter in ASM x86, and the
 great Allegro library.

  NOTICE: RockNES *works* fine under WindowsXP, including full sound support
  (downloading VDMSound from http://ntvdm.cjb.net). Despite the DOS label!

 * What's emulated *

   - CPU 2A03 emulation (6502 variant);
   - PPU 2C02 using a line-based render (~113.667 cycles/scanline);
   - Full I/O, except the expansion port capabilities;
   - Full sound (5 channels: 2 pulses, triangle, noise and DMC);
   - Konami's VRCVI sound output;
   - PPU color emphasis and monochrome mode ($2001 reg);
   - Famicom DiskSystem and VS Unisystem devices (both partially);
   - Backed battery save/load;
   - Sprite #0 hits, supposely accurate;
   - Supported 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,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, most of them are complete.

 NOTE: for Famicom DiskSystem emulation (mapper #20), you need the BIOS file
 disksys.rom and rocknes.exe placed at same directory.

   > Other features available:
   ---------------------------
    - Ability to record your gameplay (*.RMx files, x=0..9);
    - Ability to save your progress (*.RSx files, x=0..9);
    - Support for loading NESticle saved states (*.STA, *.STx files);
    - GUI and config file (rocknes.ini);
    - Game Genie codes;
    - Real-time ROM data patching;
    - Sound logging (WAVE file);
    - PRG-ROM data disassembler;
    - Optional pseudo-stereo sound output (channel separation);
    - Video filters: EAGLE, Super2xSAI, SuperEagle, Pixelated (TV looking),
    Scanlines and stretched mode (all displayed on 640x480).

 * Unemulated hardware *

 - NES PAL (50Hz) and Famicom hardwares;
 - Pixel-based render for CPU/PPU (+accuracy);
 - Accurate `sprite limit` PPU flag;
 - Devices such as PowerPad and Zapper through the expansion port;
 - VS Dualsystem;
 - Playchoice-10 upper monitor (within game instructions, z80 emulation);
 - Famicom DiskSystem sound emulation.

 > NOTES:
 ********

 1. There's no test for a minimal hardware to get RockNES running, but a CPU
 +200Mhz might be enough for 60FPS.
 2. ROM images, saved states and movies can be ZIPped! Be sure to place only
 one file per ZIP archive.
 3. You can record your gameplay (as "movies"). It's just a full log of the
 joypads states, hence your gameplay can be exactly reproduced.
 4. Game Genie codes are supported.
 5. PRG-ROM data patching is supported. You can input an address and a value
 to get modified/analysed. No other emulator has this feature I believe.
 6. NESticle saved states might be partially supported.
 7. RockNES has a configuration file called ROCKNES.INI which's located at
 same directory. Use any text editor to setup a lot of things, like inputs,
 directories, sound, blitters and more.
 8. The fastest video mode I got is 640x480 VESA1, normal blitter.
 9. You can dump/log most of NES memory/context to a file. Using the GUI, the
 available options are:

    +------------------------------+
    | context ****** file saved as |
    +------------------------------+
    | RAM             system.ram   |
    | WRAM            nes_wram.bin |
    | CPU             nes6502.log  |
    | PRG ROM       * gamename.prg |
    | CHR ROM         gamename.chr |
    | COLORS RAM      palette.bin  |
    | PATTERN TABLE   gamename.gfx |
    | NAMETABLES      gamename.nam |
    | SPRITES RAM     sprites.ram  |
    +------------------------------+
    NOTICE: everything is saved on scanline 240 (end of screen drawing).

    * If you loaded `Blast-o-Matic Adventure.NES` game, so the file will be
    saved as `Blast-o-Matic Adventure.PRG` for example.

 [==========================================================================]
 * KNOWN ISSUES:

 - Triangle wave does not work with VS Excitebike (FDS game);
 - A sample rate up to 48MHz can output buggy sounds;
 - The PPU timing still fails with a few games/demos;
 - There's an unknown problem with 6-chars GameGenie codes;
 - Super2xSaI, SuperEagle and stretched blitters are *very* slow;
 - Mapper #90 Mortal Kombat Special uses a slightly different hardware, so
 it does not work well like the others games;
 - Some mappers *can* still be broken due to lack of proper testing;
 - Garbaged scanline(s) with games that require a perfect NES timing;
 - Partial FDS support, so a lot of games might not work (Metroid hangs);
 - Sound output quality is ~limited~ due to Allegro's audio stream context;
 - Allegro-DOS under WinXP can cause problems with some video modes *IF*
 you try to change the video mode by the GUI.
 [==========================================================================]

 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

 <F1>  - increase bright (hold Shift to decrease it)
 <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

 <TILDE> - Fast forward
 <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 to update them, heh)

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

 [CPU]
  - Reset..............: Emulation reset.
  - Hard reset.........: Emulation reset, RAM data is cleared.
  - 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.

 [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 (max=10).
  - ROM Corruptor!.....: Corrupts a certain memory area.

 [Help]
  - System.............: Current video/sound devices
  - 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 $8000-$FFFF 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. Here's a partial description:

    +--------+------+------------------------------------------+
    | Offset | Size | Content(s)                               |
    +--------+------+------------------------------------------+
    |   0    |  3   | 'NES'                                    |
    |   3    |  1   | $1A                                      |
    |   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   | $00                                      |
    +--------+------+------------------------------------------+

 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 $0000-$1FFF space.

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

 NOTICE:
 =======
 > Mappers 0-255 are valid numbers. However, some pirated ROMs can bring
 mappers greater than 255 - they use the low 4 bits of offset 7, which
 conflicts with the arcade hardware detection flags. RockNES does not support
 these ones.
 > 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 like 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)
   **************************

 - If this makes you happier than ever, I use GoldWave to analyse waveforms
 and to adjust the volume decay of sound channels, including their output.
 The CPU core was written by myself after reading a couple of docs that I
 could found, to get it working in a personal way, with no hacks or flooded
 with bullshit. No third part sources were used as reference... ok? ^_^;;

 - Now, the credits:

 * 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.h -- IO for uncompress .zip files using zlib
 Version 0.15 beta, Mar 19th, 1998,
 Copyright (C) 1998 Gilles Vollant

 Richard Bannister - MacOS port
 http://bannister.org

 * NES and Nintendo are trademarks of Nintendo CO.

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