                 =====================================
                    Nofrendo version 0.54 beta-ish
                   (c) 1998 dripware - matthew conte
                 -------------------------------------
                      itsbroke@classicgaming.com
                   http://classicgaming.com/nofrendo/
                 =====================================

Listen Up
=========
Here's the deal.  I write the emulator, you find the ROMs.  Simple.
Stop bothering me, I've got real problems to deal with.

Michael Montague, where are you?

News
====
v0.54  - Nofrendo.ini configuration file.  Read it, live it, love it.
       - Automatic frameskipping; "-frameskip AUTO" or use the .ini.
         (courtesy I.A.)
       - ROM / save directories configurable in the .ini.  This is for
         all you with CD-ROMs.
       - FPS display, enable it with the spacebar.
       - Bug in 6502 core fixed - Dragon Warrior 2, Milon's Secret
         Castle, Karate Kid, etc. all work now.  Sadly, DW1 doesn't.
       - Mapper 19 (Splatterhouse) really works this time.
       - Mike Tyson's Punch-Out looks much better thanks to Jim Geffre.
       - NES timing is now very near perfect.  Galaxian, Castlevania,
         Kung Fu, Ice Hockey, etc. all run correctly now.
       - Speed gain due to complete code overhaul and much caffeine.
       - Made a spectacular simplification in the graphics code.  This
         doesn't do much for you, but it makes me feel like a genius.
       - Sprite routines sped up.
       - Graphics glitch fixed - now Wizards and Warriors/ Battletoads
         graphics display correctly (not the split screen, though).
       - Got rid of useless 640x480 mode.  F6 now sets 320x240 ModeX.
       - Sound code revamped.  Sound works in Galaxian, Bubble Bobble.
       - Volume decay added to sound code (coin sounds in SMB).
       - Square wave fixed (Zelda, etc.), courtesy of me.
       - Soundcard can now be specified on the command-line (see .ini).
       - Fixed a big bug in the volume control (i.e. it didn't work).
       - New "perfect" palette.  If you don't like it, you're wrong.
       - Command-line option parsing bug fixed.
       - "verbose" command-line option removed, as it was dumb.
       - Exit fade out removed.  Cool the first time, not the 8074th.

v0.52a - Save/load state filename bug fixed
       - Bogus .SAV file was being written to emulator directory
       - ROM loading code improved
       - Mapper 9 mirroring bug fixed <jgeffre@nd.edu>
       - Defaults to 256x240 for compatibility <XDarkLichX@aol.com>
       - Reversed my stance on big white mints <XDarkLichX@aol.com>
       - Corrected mapper 9 code, which made it look worse.  =(

v0.52  - Initial Release

Sick
====
Here's what's currently ailing Nofrendo:
 - Bankswitching.  I was under the impression that carts that bank-
   switch (i.e. the ones that use memory mappers) only switched banks
   between levels, or at long intervals like that.  Nope, a lot of
   games switch many times per second.  That's why games like Wizards
   and Warriors are so slow.  There's no way around this (yet) due 
   to some limitations of the 6502 core.  This will be addressed in
   the near future.
 - Mappers.  Mapper support is hairy.  0-15 are implemented pretty
   well, the rest I just stuck in there for giggles.  Save/Load state
   won't work right for these, most likely.  I'll get around to fixing
   all this eventually (pure laziness).

What?
=====
This is Nofrendo, a Nintendo Entertainment System (NES) emulator for 
MS-DOS/Windows based PC's.  It uses ROMs in the iNES format.
You'll need a computer, some memory, probably a monitor.  Sound cards
are always nice, too.

Take a look under the hood:
---------------------------
 o NES registers/PPU/battery-backed RAM; all the standard crap
 o 100% ASM 6502 core, courtesy Neil Bradley
 o Digital Sound support
 o Support for mappers 0,1,2,3,4,7,9,11,15,19,21,22,23,34
   (more exotic mappers only partially)
 o Line based graphics engine- supports raster/split screen effects
 o 100% correct sprite priorities
 o Loads / saves NESticle-compatible .STA state files
 o Gamepad support
 o Normal / NESticle palettes selectable
 o 5 different video modes, including a VESA mode (faster)
 o Long filename support (under Win95)
 o Volume control
 o Picture Perfect Palette (Perhaps)
 o Automatic Frameskipping

Why?
====
Okay, so there's like 5 billion other NES emulators.  So why another 
one?  Why the fuck not?  All you need to know is that I wanted to 
write my own emulator as a challenge to see if I could do it.  It 
wasn't even supposed to be released to the public, but my friends 
liked it so much that I thought that other people might like it, too.

Also, making my utility cajoNES, and working with the famicom .FAM 
format for so long, I wanted to see if I could make that emulator 
obsolete, as I'd rather poke myself with sharp pointy sticks than have 
to deal with that shitty format any longer.

Nofrendo is and _always_ will be free.  I will never charge a cent for 
it.  I will give you the source code.  I will implement your requested 
features.  I will let you pinch my routines.  I will help you with 
your own emulator.  I will drink your beer.

I will NOT give you ROMs.  I will NOT deal with flames.  I will NOT be 
providing round-the-clock assistance for this program- remember what I 
said about not charging for it?  Please respect the fact that this is 
a spare-time project, primarily done for my own enjoyment.  It works 
for me and I like it- if you like it that's great, if not, I don't 
really care that much, as they are plenty of other emulators out there 
for you.  If you can't find ROMs and you're on my site, you're dumb.

How?
====
Should be pretty self-explanatory.  Run it with no arguments to see a 
list of command-line switches.  I'd suggest you get yourself a front-
end until I hack up a GUI, so you don't have to be a command-line 
droid every time you want to run a game with your own options.  

Alternatively, you can use the nifty new configuration file,
Nofrendo.ini.  This file is created the first time you run Nofrendo,
in the same directory in which the executable lives.  I encourage you
to read through the options in the .ini file, chances are they will be
updated more frequently than this text.

Settings will *not* currently be saved to the .ini file (I had to
leave at least some degree of laziness in the whole production).
Which means you need to edit it by hand if you want Nofrendo to use
your settings by default.  Not too tough- I'm pretty sure you can
find yourself a copy of NOTEPAD.EXE or EDIT.COM somewhere...

Options passed on the command line will override what's in the .ini.

Please be aware that even though Nofrendo supports long filenames,
most DOS-based front ends will pass the shortened (i.e. SUPERM~1.NES)
versions to the emulator.  In this case, your battery-backed RAM
(.SAV) and state (.STA) filenames will have those funny tildes in
them, and they won't be all that long, either.

Current options:
 -frameskip <frames>      - you should know what this is by now
                            pass "AUTO" for auto-frameskip
 -video <mode>            - changes graphics modes
 -vsync                   - synchronize screen update to vertical
                            retrace (eliminates 'shearing')
 -palette <number>        - normal or NESticle palette
 -sound <number>          - set sound on/off/autodetect
 -volume <number>         - select volume level 1-16
 -joy <type>              - select none/2-button/4-button gamepad

Keyboard bindings (during emulation):
-------------------------------------
 F1  - 256x224 ModeX
 F2  - 256x240 ModeX
 F3  - 256x256 ModeX
 F4  - 320x240 VESA2 Linear
 F6  - 320x240 ModeX
 F5  - save NESticle-compatible .STA file
 F7  - load NESticle-compatible .STA file
 F8  - toggle VSYNC
 F11 - toggle palettes
 F12 - reset NES hardware
 `~' - toggle player 1 between gamepad/keyboard
 -/+ - frameskip -/+
 [/] - volume -/+
 7/8 - vblank lines -/+
 9/0 - hblank -/+
 SPACEBAR - show/hide FPS display
 
Messing with vblank or hblank can fix some games that rely on
extra-super-precise timing.

Player 1 controls:                       Player 2 controls:
------------------                       ------------------
 SELECT - Tab                             SELECT - Q
 START  - Enter                           START  - W
 B      - Ctrl                            B      - A
 A      - Alt                             A      - S
 UP     - Up Arrow                        UP     - I
 DOWN   - Down Arrow                      DOWN   - K
 LEFT   - Left Arrow                      LEFT   - J
 RIGHT  - Right Arrow                     RIGHT  - L

Player controls are not redefinable (I'm lazy).
Player 2 controls are useless unless Player 1 is using a gamepad, I 
guess.

More?
=====
Here's what's planned for the future, no particular order of urgency:

 o Fully implement sound (frequency sweeps, DMC channel)
 o Fully implement non-fully-implemented mappers (the higher ones)
 o GG codes (I've never used these myself...)
 o Fix CPU bug that's preventing Dragon Warrior from running
 o Get Super Mario Brothers 3 to work, dammit
 o Fix save/load state anomalies
 o Rewrite background drawing code - it sucks; slow n' buggy
 o Line-based sprite engine (will fix Duck Tales, etc.)
 o Figure out how vertical scrolling works in Zelda
 o GUI (hopefully)
 o Screen shots (this is trivial, but as I said before, I'm lazy)
 o Source code will be released - DON'T BUG ME!
 o Anything else that's requested

Ugh!
====
Problems:  Read this, it'll probably help.

SOUND - as of version 0.54, sound detection is handled differently.
See the .ini file for options.  Basically, "-sound 0" shuts sound off, 
"-sound 8" autodetects, and 1-7 are specific sound cards.  Setting the
.ini to your card rather than autodetect might reduce startup time
slightly.  GUS/AWE32 support is currently broken.  Anyone know where
Carlos Hasan is these days?  Output is loud - I like it that way.

GRAPHICS - modes 1-3 and 6 should work on any VGA card.  F4 needs VESA
1.  Get SDD 6.0 from www.scitechsoft.com if you don't already have it.

JOYSTICK - only digital joystick support is supported right now (i.e. 
Gravis GamePad), 2-button and 4-button.  Why?  Because that's what I 
have, and that's what I can test out.

ROMS - Nofrendo will assume that any ROMs whose mappers come out to be 
>34 have "dirty" headers, and will try to guess the correct mapper.  
If a game that you know runs on NESticle or iNES refuses to run on 
Nofrendo (and its mapper is supported by Nofrendo), check the header.

SPEED - It's kind of slow, due to the line-based graphics engine.  
Doing graphics like NESticle would speed things up, but I'm not going 
to, as this would make split-screening a friggin' nightmare, and would 
cause games like Bayou Billy, Fantasy Zone, and Kid Kool to not have 
those extra-neat raster effects. 

Huh?
====
Okay, so you've made it this far.  Chances are you might want to know 
about this project.  It was started November 27, 1997, and at that 
point, only included a pretty flimsy CPU debugger compiled under TC++ 
3.0.  It was pretty terrible for a while.

Software   Function          Cost
=================================
djgpp    - Compiler         $0.00
allegro  - Graphics library  0.00
SEAL     - Audio library     0.00
NASM     - Assembler         0.00
m6502    - 6502 CPU          0.00
---------------------------------
TOTAL                       $0.00  <- free.


As Nofrendo itself is free, everything I've used to make it is free as 
well.  I'm broke, and can't afford a real optimizing compiler, so 
djgpp will have to do.  Performance could be better, but I'm using 
PGCC and it works fine for me on my p133 with a frameskip of 1.  This 
will improve in the future.

This is my first real program.  This is the first program I've written 
that uses the VGA.  This is the first program I've written that has 
sound.  This is the first program I've written thas has multiple 
source files.  Give me a break if you're going to complain- I'm just 
learning the basics of programming here.

Who?
====
PROTONS: people who helped drag my sorry ass through 0's and 1's
--------
+ Jeremy Levenson - for the name, the beer, and being a tough Indian
+ Neil Bradley - for the ASM whiplash
+ Sardu - for teaching me how to tie my shoes
+ Marat Fayzullin - for the bathroom reading
+ Jeremy Chadwick - for the 'elite' bathroom reading
+ All the cute snuggly Care-Bears at Bloodlust Software
+ Kevin Horton - for taking apart every electronic thing in sight
+ Matthew Richey - for saving me from having to read the MMC1 patents
+ Ian - for general support and being a GUS freak
+ Trixter / Hornet - for the constant right nasty oldskool bitchin'
+ John Dullea - for the best damn 2600 emu this side of Pakistan
+ Paul Robson - 'cos 'es British, an' he ain't no git
+ Jim Pragit of EmuNews - http://members.aol.com/emunews- 'nuff said
+ Chris Pile - for speedily throttling speed throttling code my way
+ Roberto Rosario - for the original inspiration (er, code)
+ Brunswick Beverage, Troy NY - for inspiration (er, beer)
+ Eric Cartman - for demanding Cheesy Poofs, when no one else would

ELECTRONS: people who didn't
----------
- Nintendo of America - who still continue to exploit people and crush
  emulation projects
- Marat Fayzullin - after all I did to help support you, you wouldn't
  give me the time of day
- Julianne "Girl" McAlpine - thanks for making my life hell once again
- emerald.  you've moved up to the negatives.  whatever.
- Shareware emulator authors - blecch!  you make me sick...

If you like this program, please let me know.  If you don't, don't.

late/matt.
8 February 1998.

Boring
======
. Nofrendo Copyright 1998 matthew conte / dripware software.
. Multi-6502 CPU emulator by Neil Bradley (neil@synthcom.com)
. Allegro library by Shawn Hargreaves
. SEAL audio library by Carlos Hasan
. Nintendo Entertainment System (NES) is a registered trademark of
  Nintendo of America.
. MS-DOS/Windows are registered trademarks of the Microsoft Corp.
. NESticle / iNES / famicom copyright their respective authors.
. Gravis GamePad is a registered trademark of Gravis.
. SDD is copyright SciTech Software.
. The author is not affiliated with Nintendo nor does he advocate the
  piracy of NES games (even if he thinks NOA sucks donkey dick).
. Nofrendo is freeware and can be distributed freely as long as it is
  not modified and ROMs are not packaged with the program.
. When you use this software you do so at your own risk. The author is
  not responsible for any loss or damage resulting from the use or
  misuse of this software.
. Please, eat the big white mints at your leisure.