home *** CD-ROM | disk | FTP | other *** search
- ******* InterNES *******
- The Portable NES/Famicom Emulator
- version 0.5 (09/09/1996)
- based on the original code by Alex Krasivsky
-
- by Marat Fayzullin
-
-
- email: fms@freeflight.com
- IRC: RST38h
- WWW: http://www.freeflight.com/fms/
-
-
-
-
- * DICLAIMERS *
-
- * Nintendo Entertainment System and Famicom are registered trademarks of
- Nintendo.
- * The author is in no way affiliated with Nintendo.
- * The author is in no way affiliated with any pirate group out there.
- * The author can not provide you with NES/Famicom games.
-
-
-
- * NEW IN THIS VERSION *
-
- * Finally: The infamous horizontal sync problem *fixed*. There is still
- a couple of games causing problems, but the percentage of them is
- very low.
- * Sound emulation is implemented. While not perfect, it is still better
- than silence.
- * Windows95 version has got sound and joystick support.
- * iNES now handles GZIPped and PKZIPped files automatically. Just GZIP a
- file, and give its name in the command line (don't forget -gg/-sms
- switch if file has no .GG/.SMS extension).
- * Fixed several bugs in 6502 emulation related to the incorrect return
- address being save/restored from stack during BRK and interrupts.
- * Fixed initalization of the 4kB-VROM mode in the bank switch #1.
- * Many other bugfixes, big and small.
-
-
-
- * INTRODUCTION *
-
- iNES is a portable emulator of the Nintendo Entertainment System (aka
- Famicom in Korea and Japan), written in C. The original code was written
- by Alex Krasivsky from Moscow. I added missing CPU commands, wrote screen
- drivers, and did some thorough hacking to make the emulator run about 85%
- of games. Given enough support, I hope to make it even more compatible
- with real NES in the future. You can always get the latest iNES binaries
- and support files from
-
- http://www.freeflight.com/fms/iNES/
-
- At this moment, iNES is able to run most (80-90%) of the NES carts. Just
- about everything is implemented and working: ROM, VROM, screen scrolling,
- sprites, palette, joysticks, several different bank switches (MMCs)
- allowing to run large (>32kB) games. There may still be some problems with
- horizontal screen split synchronization and sound, as it is not completely
- clear how they work. Among other things which are *not* implemented:
-
- * Horizontal screen split (too expensive to implement).
- * 5th sound channel (do not know how it works).
- * Several MMCs, including the one used in Castlevania3 (very complicated,
- probably contains some extensions to the video controller).
- * Lightgun (very difficult to emulate due to some limitations of iNES code).
-
- Because of its portability, iNES can be compiled on a wide variety of
- platforms: Unix, Amiga, Macintosh, MSDOS, Windows, etc. Nevertheless, due
- to the nasty experience dealing with pirate wannabes of the Net, I decided
- not to release the iNES source code, and not to develop freeware versions
- of iNES for MSDOS or Windows. The only freeware version is distributed in
- a binary form for various flavors of Unix. It is possible though that Alex
- Krasivsky will finally release his version of iNES-MSDOS, written in 80x86
- assembly language. It is a different program, although we are working very
- closely and sharing the data.
-
- The Macintosh version of iNES is also available. It is being developed
- by John Stiles, and it is also free.
-
- The Windows95 version of iNES is available from me, Marat Fayzullin, for
- $35US. This fee ensures that you will get free updates via email as long
- as iNES-Windows is being updated. For more information about it, take a
- look at
-
- http://www.freeflight.com/fms/iNES/iNESWindows.html
-
- I do not feel very good about maintaining a Windows version, as I do not
- enjoy programming under Windows, and the very first copy of iNES-Windows I
- sold was immediately pirated by hordes of teenage idiots worldwide. If you
- *do want* to see the Windows version being developed, please, register it
- by sending the registration fee to
-
- Marat Fayzullin
- 6304 Hampton Place
- Elkridge, MD 21227
- USA
-
- If you have any information on NES/Famicom, or the ROM-images which can
- be used for testing, and are willing to help, feel free to send mail to
- fms@freeflight.com. Any *intelligent* help is greatly appreciated :).
-
-
-
- * WHAT IS INCLUDED *
-
- Following files are included into the distribution:
-
- ines - iNES executable file (ines -help for options)
- neslist - A little program to list/check .NES images (beta)
- dasm - Little 6502 disassembler
- iNES.doc - This documentation
- NES.doc - Documentation on NES programming
- CART.NES - Sample cartridge which contains a testing program for NES
- CART.ASM - The source code of a testing program
- headers.tgz - Some .NES headers to be used for conversion from
- other formats to .NES
- headers.zip - Same as headers.tgz, but in ZIP format
-
-
-
- * BUTTONS *
-
- iNES is controlled by following buttons:
-
- [SPACE] - FIRE-A button (also: [LALT],A,S,D,F,G,H,J,K,L)
- [LCONTROL] - FIRE-B button (also: Z,X,C,V,B,N,M)
- [TAB] - SELECT button
- [ENTER] - START button
- [BACKSPC] - Toggle vertical/horizontal mirroring
- [ESC] - Quit emulation (also: [F12])
- [SHIFT] and [CAPSLOCK] switch between joypads
-
- When compiled with #define SOUND:
- [1]-[5] - Turn sound channels on/off
- [0] - Turn all sound on/off
- [-] - Decrease sound volume
- [+] - Increase sound volume
-
- When compiled with #define DEBUG:
- [F1] - Go into the built-in debugger
-
-
-
- * COMMAND LINE OPTIONS *
-
- iNES can be started with following options:
-
- -verbose <level> - Select debugging messages [5]
- 0 - Silent 1 - Startup messages
- 2 - Illegal writes 4 - Illegal CPU ops
- 8 - Bank switching
- -hperiod <period> - Number of CPU cycles per scanline [100]
- -uperiod <period> - Number of interrupts per screen update [2]
- -vperiod <period> - Number of CPU cycles per interrupt [26500]
- -help - Print this help page
- -autoa/-noautoa - Autofire/No autofire for button A [-noautoa]
- -autob/-noautob - Autofire/No autofire for button B [-noautob]
- -shm/-noshm - Use/don't use MIT SHM extensions for X [-shm]
- -saver/-nosaver - Save/don't save CPU when inactive [-saver]
- -palette <number> - Choose a color palette [0]
- 0 - Normal 1 - Bright
- -pal/-ntsc - Show 240 or 224 lines [-ntsc]
-
- When compiled with #define DEBUG:
- -trap <address> - Trap execution when PC reaches address [FFFFh]
-
-
-
- * CARTRIDGE FILE FORMAT *
-
- The iNES distribution includes a single cartridge image with a program
- allowing to test the emulator. There is also a source code of this program
- included. Following is the format of ROM-image files used by iNES (.NES
- extension):
-
- byte contents
- -------------------------------------------------------------------------
- 0-3 String "NES^Z"
- 4 Number of 16kB ROM banks
- 5 Number of 8kB VROM banks
- 6 bit 0 1 for vertical mirroring, 0 for horizontal mirroring
- bit 1 1 for battery-backed RAM at $6000-$7FFF
- bit 2 1 for a 512-byte trainer at $7000-$71FF
- bit 3 Reserved
- bit 4-7 Type of ROM bank selector
- 0 - None
- 1 - Megaman2,Bomberman2,Destiny,etc.
- 2 - Castlevania,LifeForce,etc.
- 3 - QBert,PipeDream,Cybernoid,etc.
- 4 - SilverSurfer,SuperContra (experimental)
- 8 - F3xxx carts off FFE CDROM (experimental)
- 15 - 100-in-1 cartridge (experimental)
- 7-15 Reserved
- 16-... ROM banks, in ascending order. If a trainer is present, its
- 512 bytes precede the ROM bank contents.
- ...-EOF VROM banks, in ascending order.
- -------------------------------------------------------------------------
-
- Note that this format will most likely expand in the next version of
- iNES, therefore do not take it for something permanent. The general
- structure will stay the same though.
-
-
-
- * NOTES *
-
- You can get information about NES programming from the NES.doc file
- included into iNES distribution. The fresh documentation is always
- available at the iNES distribution site. You can also get Pascal Felber's
- NES copier schematics from his site at
-
- http://lsesun13.epfl.ch/~felber/IO-56/
-
- The iNES distribution includes .NES file headers for some carts, which
- can be used to convert carts into .NES format. These headers are *not*
- guaranteed to work. If you have a cartridge ROM in CART.PRG file, and a
- cartridge VROM in CART.CHR file, the following has to be done to create
- the CART.NES file:
-
- in Unix: cat CART.HDR CART.PRG CART.CHR > CART.NES
- in MSDOS: copy/b CART.HDR+CART.PRG+CART.CHR CART.NES
-
- The Vertical/Horizontal Mirroring flag requires an additional
- explanation. In the real NES/Famicom cartridges, either A10 or A11 line of
- the address bus can be connected. Depending on it, video memory may either
- contain two screens at addresses $2000/$2400 mirrored at $2800/$2C00
- (Vertical Mirroring), or two screens at $2000/$2800 mirrored at
- $2400/$2C00 (Horizontal Mirroring). The games which only use one screen do
- not care about the mirroring. The games using two screens require an
- appropriate mirroring though. Be aware that many bank switches allow to
- switch mirroring from the program.
-
- The 512-byte trainer mentioned before is something implemented in the
- Front Far East copier for the NES. When this trainer is present (its code
- precedes the ROM contents in the .NES file), it is loaded into
- $7000-$71FF, and then control is passed to it, instead of the real
- cartridge code.
-
- The -hperiod controls how many CPU cycles it will take to refresh a
- single scanline of display (including HBlank). It currently defaults to
- 100. The -vperiod controls how many CPU cycles it takes to refresh the
- entire screen (including VBlank). It currently defaults to 26500, which
- gives us total of 265 scanlines (that is 224 or 240 real scanlines plus
- VBlank). The vperiod/hperiod value should never be less than 256 to give
- VBlank interrupt handlers enough CPU cycles.
-
-
- ---------------
- Marat Fayzullin
-