NES Emulation On N64 (Neon64) v1.2a
(c) 2001-2004 Halley's Comet Software (http://here.is/halleyscomet)
Developed from 7/4/02 to 6/1/04

1. Introduction

Neon64 is a Nintendo Entertainment System emulator for
the Nintendo 64 video game system. It has been written
by Halley's Comet Software without any development
kit (except for my own).
It can be run with either an N64 backup device or an
Interact GameShark Pro.

What is supported:
* 6502 CPU
* PPU (Picture Processing Unit)
* pAPU (pseudo Audio Processing Unit)
* Mappers 1,2,3,4,7,9,11,34~,66~,71~ (~ indicates incomplete support)
* Controllers 1 and 2 and Arkanoid paddle
* NTSC and PAL video mode (in emulated NES)
* SRAM/WRAM data saving with three slots in one N64 controller pack
* Screenshots (with a v64jr and PC)

Known Bugs:
* Occasionally Neon64 freezes upon starting a game.
* Changes that take place in the middle of a scanline are not
  handled properly/at all. This causes minor graphics inaccuracies
  with Punch Out, SMB3, Marble Madness and a number of others. In no
  situation that I know of does this render a game unplayable.
* Aladdin crashes, and probably some others I can't recall.
* Monster in my Pocket crashes if you watch the intro, just skip it by
  pressing Start to play the game, which works.
* Frame skipping isn't perfect, it keeps games up to speed but a
  significant jumpiness is visible when scrolling quickly (SMB,Stars)
* Some minor graphics issues in Battletoads (and BT Double Dragon)
* A major graphics issue in Qix, half the playfield is wrong.
* Big Foot has the wrong pattern tables after the second race.

----

2. What's in this archive

readme.txt: this doc
neon64hist.txt: the version history
neon64bu.rom: The main version of Neon64, for use with backup unit and
              the emulation standard method of sending a ROM (offset
              0x200000). It is not byteswapped, but it is properly
              CRCd and extended to about 1 MB (minimum size for accurate
              CRC).
neon64gs.bin: The USA Super Mario 64 + Gameshark version.
neon64ge.bin: The Europe Super Mario 64 + Gameshark version.
torom\: A directory containing utilities for converting NES ROMs to
              N64 ROMs.
torom\neon64cd.rom: An unextended version of Neon64, NES ROMs can be
              directly appended to it.
torom\chksum64.exe: Andreas Sterbenz's checksumming program
torom\extend.exe: Extends a ROM to about 1 MB
torom\makerom.bat: Makes an N64 ROM from an NES ROM
torom\makeall.bat: Make all NES ROMs in the current directory into N64
              ROMs.

----

3. Using Neon64

3a. Loading Neon64 and an NES ROM

Note: Neon64 cannot run compressed NES ROMs (ending with .ZIP, .RAR,
      etc.) or ROMs in the UNIF format (.UNF, etc.)

* With any backup device that has a PC connection
Send neon64bu.rom as you would any N64 ROM, then send the NES ROM to
offset 0x200000.

* With a Dr. V64jr
Use "elim neon64bu.rom -e mario.nes" to send Neon64 to the v64jr,
assuming Neon64 and the NES ROM are both in the same directory as
elim (and that the NES ROM is called "mario.nes"). If you can't run
elim follow the instructions for "any backup device".

* With a Dr. V64 or Z64
You should be able to put NES roms on a CD or ZIP disk and then
rename neon64bu.rom to nes.emu. I have not personally tested this,
though. If the .nes ROMs do not work try the CD64 option.

* With a CD64
Put the NES ROMs you want to use in the torom directory, then run
makeall.bat. Put all the .ROM files that are created onto a CD (ZIP
disk, hard drive, whatever) and it should work! The downside is that
each ROM is about 1 MB. It is normal for makeall.bat to say "File not found"
several times while it is running.

* With a Gameshark
First, you will need the following supplies:

N64
N64 expansion pack (GS Pro needs this though Neon64 doesn't)
Super Mario 64 USA or Europe version (may be able to use other
 games in the future, pester me if you need it)
Gameshark Pro for N64, with a parallel port on the back
Parallel port cable (straight-through, male to female)
GSCC 2002 (http://www.cmgsccc.com/dl/index.php?item=1)
A computer running a Windows operating system (XP not recommended)

A. Set Up Gameshark:
1. Connect the Gameshark to the Super Mario 64 cartridge, the N64, and
   the computer (via the cable).
2. Turn on N64.
2a. If Gameshark does not boot, remove all things connected to GS,
   reconnect, and try again. The GS can be very tempermental.
3. Select "Start Game"
4. Select "Code Generator Off", which will then change to "Code
   Generator On"
5. Select "Start game without codes"

B. Set up GSCC 2002 (only needs to be done once):
1. In the File menu, select Configuration.
2. In the System drop down box, select Nintendo 64.
3. Click the Auto Detect Settings box.
3a. If your Gameshark is not detected you did something wrong...
4. Click the Save button. Yes, you want to save settings.

C. Set up Super Mario 64:
1. Press start to get to the file select screen

D. Patch Neon64 into Super Mario 64 (USA version):
1. In the Ram Edit menu option, select Open Window.
1a. Occasionally this does not open the window properly, press
   Alt-Minus and then X to make the windows appear.
2. Click the Goto Address button (or press Alt-G) and enter the address
   0x80263844 (when you open GSCC 2002 in the future this location
   should be saved).
3. Click inside the edit window at the highlighted location.
3a. The values at this location should be: 85 CF 00 AE
   If you do not see these values you have a different version of Super
   Mario 64 than I do but it may still be possible to get it to work
   some day, contact me.
4. Enter 08 0C 00 00
5. Click the Upload File To Memory button (or press Alt-U)
6. Locate neon64gs.bin
7. In the Address To Upload To box, enter 0x80300000 (five zeroes at
   the end)
8. Send the file (click the Open button)
9. Select a game in Super Mario 64 (must be already started)
9a. The Neon64 title screen should appear.

D. Patch Neon64 into Super Mario 64 (Europe version):
1. In the Ram Edit menu option, select Open Window.
1a. Occasionally this does not open the window properly, press
   Alt-Minus and then X to make the windows appear.
2. Click the Goto Address button (or press Alt-G) and enter the address
   0x80259228 (when you open GSCC 2002 in the future this location
   should be saved).
3. Click inside the edit window at the highlighted location.
3a. The values at this location should be: 86 0A 00 AE
   If you do not see these values it may still be possible to get it to
   work some day, contact me.
4. Enter 08 0B 38 B0
5. Click the Upload File To Memory button (or press Alt-U)
6. Locate neon64ge.bin
7. In the Address To Upload To box, enter 0x802ce2c0
8. Send the file (click the Open button)
9. Select a game in Super Mario 64 (must be already started)
9a. The Neon64 title screen should appear.

D. Patch Neon64 into Super Mario 64 (Japan version)
0. If you need this let me know and I'll try to figure it out.

E. Send the NES ROM:
1. Click the Upload File To Memory button again (or press Alt-U)
2. Locate the NES ROM you want to run.
3. In the Address To Upload To box, enter 0x80300000 (five zeroes at
   the end) if it isn't already there
4. Send the file (click the Open button)
5. Press a button on the N64 controller.
6. Your game should begin running.

Once your game is running communication between the PC and the
Gameshark will be cut off, so you will be unable to load a new ROM.
To load a new ROM select the "load new ROM" option from the Neon64 menu,
the program will be returned to the title screen and communication will
be restored. You can then redo the "Send the NES ROM" steps to send a new
game.

3b. Controls

The controls on controller 1 and 2 have been mapped as follows:

+------------------------+
|NES      |N64           |
|---------|--------------|
| A       | A            |
| B       | B            |
|Start    |Start         |
|Select   | Z            |
|Direction|Analog stick  |
|         |or directional|
|         |pad           |
+------------------------+

I find that using the analog stick is best for isometric games such as
Battletoads or Deadly Towers, whereas the directional pad is better for
everything else, but that's just me.

3c. Menu

Neon64 has a menu which can be accessed by pressing the L and R buttons
on controller 1 at the same time. Choose an option with the directional
pad, select an option with the A button or leave the menu without
choosing by pressing L, R, or B.
The menu has the following options:

* Reset NES
Reloads the current game (or whatever game is in the backup device if
you have loaded a new one)

* Load new ROM
Returns to the title screen and waits for a new game to be loaded.
You must use this to load a new ROM in the Gameshark version, as it
reestablishes the PC<->GS connection. It is not necessary to use this
with the backup unit version, you can just send a new ROM at any time
and select Reset NES (or just hit the reset button).

* Save SRAM
If the current game has SRAM this will save it to one of three slots in
the controller pack. Follow the prompts to erase a previous save if
all three slots are already occupied. You can select a name for the save,
so that when you need to erase a save you know what each of them is.
Selecting this option is the only way to save your progress in a game.
Make sure that after you do whatever you need to save in the game
(sleep at an Inn in Final Fantasy, select Save at the continue screen
in Zelda, have your deeds recorded in the Imperial Scrolls of Honor in
Dragon Warrior, etc.) you select Save SRAM from the menu. If you don't
explicitly select "Save SRAM" your progress will be lost!
Neon64 is not compatible with the official Nintendo controller pack
access protocol, so when you format your controller pack for Neon64 it
will destroy any data from real N64 games that you might have.
Likewise, if you format your controller pack for an N64 game it will
erase any data for Neon64.
The controller pack should be in controller 1, and it should be
inserted before the N64 is turned on or it may not be detected.
When you start a game that has SRAM Neon64 will check the controller
pack for a save for that game, and if one is found it will be loaded.
Again, this controller pack must be in when the game starts.
Do not switch controller packs while Neon64 is running, as this may cause
data loss.

* PAL Mode On/Off
Selecting this option toggles the video mode of the emulated NES
between NTSC and PAL mode. This emulation is not perfect, all that it
changes is the length of the vertical retrace period and the dimensions
of the screen. It is enough for some European games like Elite and
Asterix to work correctly, but others may not.
This will not allow Neon64 to be used with a PAL-only TV. If you have such
a TV and could test a PAL version of Neon64 let me know.

* Take Screenshot
Copy the current frame to the cartridge where it can be read by the
Cap64 screen capture program (available, with source, at
http://here.is/halleyscomet).
I do not know what kind of effect this might have when used with any
system other than a v64jr. This should not be used at all with the
Gameshark version.

* Frame-by-frame On/Off
When you activate this option the menu will be activated once per
frame, allowing you to advance the game one frame at a time (tapping
B is a good way to do this). This is useful when trying to take a
screenshot of something that happens quickly.

* FPS On/Off
Enable or disable the display of the current emulation speed in Frames
Per Second. The displayed value is in hexadecimal. Note that enabling
this slows things down slightly.

* Arkanoid paddle On/Off
Enables emulation of the analog paddle controller for Arkanoid. This is
controlled by moving the analog stick on controller 1 left and right.
The Arkanoid paddle is assumed to be plugged into the NES's controller
port 2, and this works fine with the only game that uses it (Arkanoid).

* DMC On/Off
This option is included specifically for Final Fantasy 3, which uses
for a drum effect a very rapid change of value in the DMC channel. With
all of the NES's hardware sound filters this sounds reasonably good,
but Neon64 does not emulate this filtering, nor will it ever. As a
result, all throughout a battle in FF3 there is a popping sound which
becomes very annoying. Setting this option to Off (it is set to On by
default) disables the audio output of this channel, though the channel
still behaves normally from the emulated NES's point of view.
Come to think of it, Castlevania 2's DMC is pretty annoying, too.
Note: Some television sound systems do the filtering themselves, so
this isn't needed for them.

* Error trapping On/Off
Some games do things that Neon64 is unprepared to emulate, such as use
undocumented opcodes or accessing unknown parts of memory. It is
usually best to ignore these operations, because some games that use
them (Wizards & Warriors, Capcom OST) work fine if nothing is done.
When you set error trapping to "on", the game will stop running and
display debug information if it encounters an unknown opcode (or a
few other types of error). There is no way to exit this information
screen without resetting the N64. If you are not me you should leave
this off, so that even when a game crashes you will be able to access
the menu to reset it or load another ROM.

* Debug info
Displays some information about the emulation. Exit this screen by
pressing any button.

Note that options that you choose will remain set even when you reset
the NES or load a new ROM. Only resetting the N64 will reload the
default settings.

----

CONTACT:

If you have any questions or comments, or would like to see what else
Halley's Comet Software is up to, contact me or check out the web site!

WWW: http://here.is/halleyscomet or http://hcs.freeshell.org
EMAIL: halleyscometsoftware@hotmail.com
AIM: maskedtomato

THANKS:

Firstly, I thank God for all those of you who helped me
with this project, directly or through your work.

LaC, for an infinite supply of wisdom and documentation
Lemmy, for most of Nemu
Destop, for Heavy 64, through which I learned to use the RSP
Code Master, for making the GS version possible
SHIEK, for inspiring the GS version
CZN, for the various intros which taught me N64 programming
anarko, for N64OPS, for a long time my only source of info
Andreas Sterbenz, for CHKSUM64
Icarus, for a Propack unpacker for the R4000.
Bung, for low-cost development hardware
Gavin Hausermann, president of the HCS fan club!
Chris Covell, for interesting demos and documentation
Brad Taylor, for everything I know about NES sound
blargg, for insight into the linear counter
Jsr, for help with controller access
Marat Fayzullin, for a solid background in emulation
y0shi, for nestech
loopy!
Memblers, for NESDev and more
Xodnizel, for FCEU, whose source helped me fix a lot of bugs
Nintendo, Square, Capcom, etc., for the games that made this whole
project worthwhile!

et al!

Thanks to you, for keeping a little corner of the N64 scene alive!

Greets to my S&E and Humanities friends, and to Mike, Ross, and Chris.
Thanks to my family for their tolerance and support.

----

Neon64 was written entirely by themind (a.k.a. hcs) of Halley's
Comet Software in edit.com, assembled entirely by U64ASM (also
written by themind), built with DOS copy functions and Andreas
Sterbenz's CHKSUM64, and the GS version is compressed with with RNC
Propack.

The program is copyright 2001-2004 by Halley's Comet Software and is
licensed for unlimited distribution, so long as it retains all
copyright noticies, includes this readme, and is not used for
commercial gain (or loss, for that matter). If you think you can make
any money from it I want a cut :)

Please only distribute this archive in its complete form.

Source code is freely available, ask for it if I don't have it posted
publicly yet.

This program may cause your N64 to explode. Prolonged use may result in
severe mental trauma. Use at your own risk.
In all seriousness do not expect any game data on any hardware used in
conjunction with Neon64 to be undamaged.

Please do not distribute Neon64 with any NES ROMs, and do not
share the N64 ROMs made with makeall.bat
I have this terrible image of hundreds of GoodN64 entries...

All trademarks are property of their respective owners.

-EOF-