Short:        NES emulator for accelerated Amigas
Author:       Afrotechmods and Claude (afro afrotechmods com)
Uploader:     afro afrotechmods com (Afrotechmods)
Type:         misc/emu
Version:      1.00
Requires:     68030 or better, 1 MB fast RAM, Kickstart 3.0, ECS or AGA
Architecture: m68k-amigaos >= 3.0.0

FAmiga 1.00 - a Nintendo Entertainment System emulator for the Amiga
====================================================================

FAmiga (Famicom + Amiga) is an emulator for NES and Famicom games. On a
68060 it offers a near-flawless emulation experience with most games running
at full speed and pixel-level accuracy. On a 68030 @ 50 MHz some games are
playable with frame skip, but slowdowns are very common. FAmiga is an
unfinished work in progress and still has not yet been tested with a 68040.
Please see the bottom of this file on how to submit bug reports.


Changes from 0.73 to 1.00
-------------------------

0.73 was FAmiga's first release on Aminet. What changed between 0.73 and
1.00:

- CD32 pads, in either port (the menu's Player 1 and Player 2 rows), with
  two ways of reading them, "CD32 pad" and "KTRL CD32+". Each of the pad's
  seven buttons can be set in FAmiga.config, and the help screen shows them
  as set.
- Reduced input lag: in many games a press now shows on the screen 1 frame
  later instead of 2 or more.
- 13 more cartridge boards, 74 in all.
- The 60 Hz picture is now 224 lines high (it was 218 before).
- Picture fixes, among them Super Mario Bros. 3's title screen and status
  bar, Burai Fighter, Days of Thunder's dashboard, the status bars of
  Mickey's Numberland and Letterland, Numberland's title screen, Kirby's
  Adventure's save-file menu, Bill Elliott's NASCAR Challenge's dashboard
  and road, and Goal! Two (E)'s status bar.
- Game fixes: Star Wars (E) plays past its intro; Break Time, Vegas Dream
  and Greg Norman's Golf Power (when the CPU takes an interrupt); Dusty
  Diamond's All-Star Softball and Hudson Hawk (sprites); Garou Densetsu 2;
  Hillsfar; Bases Loaded and Treasure Master; San Guo Zhi and Dragon Ball
  Z 4-in-1 (the MMC3 board's power-on state).
- 16 game files with wrong headers are recognised and run as they should,
  among them Alien Syndrome, Rad Racer 2, Wrecking Crew, Gyruss and Super
  Cars.
- The Shell stays quiet unless something goes wrong. New Shell words:
  FAmiga ? lists them, VERBOSE prints the full report, and JOYTEST tests
  the joystick ports and CD32 pads.

Requirements
------------

- A 68030, 68040 or 68060.
- At least 1 MB of fast RAM (2 MB for rewind).
- Kickstart 3.0 or newer.
- ECS or AGA chipset (ECS is untested on real hardware).
- An NTSC game is shown on a 60 Hz NTSC screen when the OS has one (on a PAL
  machine: the NTSC monitor in DEVS:Monitors); PAL games on PAL.
- Your own NES game files. No games come with FAmiga.

FAmiga has also been tested and works well on an A1200 with a PiStorm32-lite
(CM4) running Emu68.


FAmiga.config and FAmiga.log
----------------------------

The first time FAmiga starts, it creates two plain text files in its own
drawer, each with an icon that opens it in MultiView. (Save states and
battery saves are kept beside your games instead: save states in a "saves"
drawer, battery saves as name.sav.)

FAmiga.config holds your settings: frame skip, sound, sprites, player 2,
screen mode, the screen positions, the palette, which palettes P cycles
through, and the last drawer you loaded a game from. FAmiga saves it by
itself when you leave the menu or a game, or quit, and only when something
changed. You may edit it with any text editor: the choices for each setting
are listed above it, and a line FAmiga cannot read goes back to its default
(FAmiga.log says which). To skip a palette, change its line at the end from
"On" to "Off". To go back to all the defaults, delete the file; FAmiga makes
a new one. Settings given in a Shell count for that run only.

The menu has two choices for a CD32 pad in each port, "CD32 pad" and
"KTRL CD32+". If a held button flickers on a CD32 pad, try the other CD32
choice.

FAmiga.config also says what each button of a CD32 pad does, one line a
button ("P1 red = B"): P1 is the pad in port 2 (Player 1 = Port 2 CD32
pad), P2 the pad in port 1. The choices are Up, Down, Left, Right, A, B,
Select, Start, Menu, Rewind, Help and Nothing. The help screen shows the
buttons as you set them.

FAmiga.log records what happened: for each of the last five times FAmiga
started, the machine, the screen, a short speed test and the settings, then
one line for each game played (how long, how fast, how many pictures a
second were shown, how it ended), and the full detail of the last five
games. It is written when FAmiga starts, when a game starts and ends, and
when FAmiga quits, never while a game runs, so after a crash it ends with
"still playing". There is nothing to edit in it. If something goes wrong,
please send FAmiga.log with your report: it usually shows what happened.

If FAmiga cannot start at all, it leaves a file called badstartup.txt beside
itself, which says how far it got. Please send that file too.

Features
--------

- 74 cartridge boards (mappers), including MMC1, MMC3, MMC5, VRC2/4/6/7,
  Namco 163, Sunsoft FME-7, Bandai and many multicarts. An unknown board
  loads as the simplest one and the menu says so.
- Cartridge sound: VRC6, VRC7 (FM), MMC5 and Namco 163.
- NTSC and PAL games, each on its own screen (selectable in the menu).
- Four save-state slots and rewind (hold F5: up to 30 seconds back).
- Battery saves, written beside the game as name.sav.
- Joysticks, Sega Mega Drive / Genesis pads (two buttons), CD32 pads, the
  keyboard; a second player on port 1 or on the keyboard.
- 13 colour palettes (P in a game).
- Frame skip (automatic or fixed), a sprite limit of 8, 16, unlimited or
  adaptive.
- A help screen that is also a live pad tester.
- A ROM browser that starts in a "ROMs" or "Games" drawer beside FAmiga,
  or in the last drawer you used; the top level lists every volume.


Keys in a game
--------------

  Joystick, cursor keys, W A S D   the NES pad
  Shift                            B
  Alt                              A
  Return                           Start
  Space                            Select
  2 and 1                          player 2's Start and Select
  F1-F4                            save the state to slot 1-4 (in a
                                   "saves" drawer beside the game)
  F6-F9                            load slot 1-4
  F5                               hold to rewind
  F10                              back to the menu (Start game
                                   resumes gameplay)
  P                                next colour palette
  Help                             the help screen (the game pauses)
  Escape                           quit to Workbench

B and A are on Shift and Alt because an Amiga keyboard can lose a letter key
held together with the cursor keys; Shift and Alt are never lost.


Starting from a Shell
---------------------

From a Shell, give FAmiga a stack first, then start it with or without a
game. With a game, it starts the game at once; F10 still goes to the menu.
Put a path that holds spaces in double quotes:

  stack 32768
  FAmiga
  FAmiga "Work:NES/Super Mario Bros. 3 (U).nes"
  FAmiga ?

FAmiga ? lists these words in the Shell and quits. Any of them may follow,
in any order. They count for that run only: none of them is saved in
FAmiga.config.

  NOSOUND           sound off (the menu's Sound)
  SKIP=n            fixed frame skip, counted as the menu's Frame skip row:
                    1 = none, 2 = one skipped frame after each drawn one,
                    3 = two, 4 = three (without it, Auto)
  SPRITES=8|16|64|A sprites per line: 8, 16, unlimited (64) or adaptive
  PALSCREEN         the 50 Hz PAL screen
  NTSCSCREEN        the 60 Hz NTSC screen (the way back if a PAL choice
                    leaves your display dark)
  VSTART=n          the picture's first screen line (the menu's Screen
                    position: 8 to 38 on NTSC, 8 to 56 on PAL)
  LINES=n           the 60 Hz picture's height in lines, 160 to 240
                    (default 224; the picture stays centred)
  SYNC=16           the 60 Hz screen's vertical sync moved to the end of
                    the frame, for some flicker fixers (default SYNC=0,
                    the chipset's standard sync; some TVs read SYNC=16
                    as PAL)
  NOLIMIT           no speed limit: the game runs as fast as the
                    machine can
  FILTER            leave the Amiga's low-pass (LED) filter as it is
                    (FAmiga turns it off by default)
  COPDIRECT         FAmiga loads its display lists itself from the
                    start (try it if the screen stays black, e.g. with
                    a graphics card)
  RULER             line numbers down the screen, to see how much of
                    the picture your TV or monitor shows
  VERBOSE           FAmiga's whole report in the Shell: the machine, each
                    step of the start and each game's figures (without it
                    the Shell shows only what went wrong)

For testers (the Shell shows the result; send it with your report):

  JOYTEST           the joystick ports, ten times a second for 8 seconds:
                    the raw registers and the buttons of a CD32 pad in
                    either port, read both ways FAmiga knows, each with
                    the pad's own check ("pad" when the read is right;
                    hold one button at a time)


Known limits
------------

- FAmiga draws the picture a line at a time. A few games that change the
  picture in the middle of a line show small faults, and some games are
  known not to work yet.
- Loopz (U) stops at a black screen after the level select. The cause is
  known (FAmiga's frame is a whole number of CPU cycles; the game waits for
  a timing drift the real console has) and the fix is deliberately left out
  for now, because it would shift every game's timing for the sake of one.
- No disk-based Famicom games (FDS), no NSF music files, no Game Genie.
- The speed figures above were measured on real 68060 and 68030 machines;
  68040 machines have not been measured.


Testers - thank you
-------------------

DanyPPC tested on his A1200 with a Blizzard 1230 (68030 at 50 MHz). His
speed measurements calibrated the 68030 model that every speed change of
FAmiga has had to pass since, his reports put the NES buttons on Shift and
Alt and fixed the screen flipping between PAL and NTSC on his TV, and he
suggested many bugged games to fix. Early on, his reports of FAmiga starting
to a grey screen led to the fix in AfroNES 3.40, which changed how FAmiga
times its screen so that the picture shows on setups where it had stayed
grey. His tests with his KTRL CD32+ gamepad led to FAmiga's second way of
reading a CD32 pad. Thank you, DanyPPC.

kiwidea tested on his A1200 with a TF1260 (68060) on a TV. His report of the
picture's bottom cut off on the 60 Hz screen, with photos, led to the Screen
position setting that fixed it in 0.69, and his question led to the ROM
browser remembering its last drawer. He also tested the CD32 pad reader
with his Honey Bee CD32 pad. Thank you, kiwidea.

z00p tested on his A1200 with a PiStorm32-lite running Emu68. He also wrote
the CD32 pad reader FAmiga uses and tested it in FAmiga with his KTRL CD32
pad, and his public notes on writing emulators for the Amiga gave the ideas
behind the lower input lag. Thank you, z00p.


Credits
-------

FAmiga was made by Afrotechmods, who designed it, tested it on his own Amiga
throughout and directed the work, and Claude (Anthropic's AI assistant), who
wrote the code. The full credits - the sources, the borrowed tables and
their licences, and what each of us did - are in credits.htm, which any
Amiga web browser shows (IBrowse, AWeb, Voyager).

FAmiga was written from scratch. It is not a port, clone or disassembly of
any other emulator and contains no code from one, including the Amiga's own
NES emulators A/NES, A/NES PRO, AmiNES, CoolNESs and DarkNESs. Its emulation
was written from public documentation, mainly the NESdev wiki. Where that
documentation was unclear, the source code of the open-source FCEUX, Mesen
2 and BizHawk emulators was read to see how they handle a case (how some
cartridge boards work, when the CPU takes an interrupt, a few details of
the picture chip), and FAmiga's own code was written to behave the same
way. No code from any of them was copied. The VRC7 sound follows the
method of emu2413, a sound-chip emulator, and the CD32 pad reader is
z00p's, under the MIT licence (their notices are in credits.htm).

Nintendo, NES and Famicom are trademarks of Nintendo. FAmiga is not
affiliated with Nintendo or with any game's publisher.


Licence
-------

FAmiga is freeware. Copyright (c) 2026 Afrotechmods.

You may use FAmiga for free and copy it to anyone, as long as the archive is
passed on whole and unchanged, with this readme and credits.htm. You may not
sell it or charge for it, apart from the cost of the medium on a collection
such as the Aminet CDs. You may not change the program or pass on changed
copies.

FAmiga comes with no warranty of any kind. Use it at your own risk; the
authors are not liable for any damage or loss that comes from using it.

The notices of the three borrowed pieces of work (the VRC7 sound tables
from emu2413, MIT licence; the Game Boy Color colour mix from ares, ISC
licence; z00p's CD32 pad reader, MIT licence) are in credits.htm and form
part of this licence.


Contact
-------

Afrotechmods: afro afrotechmods com (the first space is the at sign, the
second a dot). Feedback and bug reports are welcome. But with every report,
please attach FAmiga.log (and badstartup.txt, if FAmiga could not start and
left one) and a photo of the problem.
