# Mednafen

# General Documentation

Last updated September 6, 2006
Valid as of Mednafen 0.6.5

Table of Contents:

Introduction
Core Features

- NES
  CPU
  PPU
  Palettes
  Sound
  Input
  Zapper
  File Formats/Expansion Hardware
  iNES Format
  UNIF
  Famicom Disk System
  Game Genie
  VS Unisystem

- Atari Lynx
- PC Engine/SuperGrafx
- Automatic IPS Patching

- Using Mednafen

- Key Assignments

- NES

VS Unisystem
Famicom Disk System
Barcode Readers
Game Pad
Power Pad
Family Keyboard
HyperShot Controller
Mahjong Controller
Quiz King Controller

- Atari Lynx
- GameBoy/GameBoy Color/GameBoy Advance
- Neo Geo Pocket/Neo Geo Pocket Color
- PC Engine(Turbo Grafx 16)/SuperGrafx

Command line

- Cheat Guide
- Debugger
- Game-specific Emulation Hacks
- Credits
- Legal Stuff

## Introduction

Mednafen is a multi-game-system emulator, for various platforms, including emulation of the following systems:

- Atari Lynx
- Famicom
- GameBoy (Color)
- GameBoy Advance
- Neo Geo Pocket (Color)
- NES, both NTSC and PAL
- PC Engine/TurboGrafx 16 (CD)

This document has been arranged to keep user interface details and emulation details as separate as possible, though this has not been accomplished entirely.

In several places references are made to the "base directory". If you are running a port on a UN*X-like system(Linux/*BSD/Mac OSX/SunOS/etc.), the base directory is "~/.mednafen", or in other words, "your home directory plus .mednafen". For all other ports(including DOS and MS Windows), the base directory is the directory that the executable is in.

Mednafen includes parts of or links with the following software packages and programs, so give the developers lots of thanks sometime(NOTE they do not provide user support for Mednafen, so don't ask them questions about Mednafen)!

- Blip_Buffer - Used in Atari Lynx, GB/GBC/GBA, and PC Engine sound emulation code.
- FCE Ultra - NES/Famicom emulation.
- Fuse - Z80 emulation code.
- Handy - Atari Lynx emulation.
- hq2x/hq3x/hq4x - Pretty real-time(kind of ;)) image magnification filter.
- libcdio - CD access routines used in PCE CD emulation.
- libsndfile - Used for WAVE file playback with PCE CD emulation and WAVE file recording.
- miniLZO - Real-time (de)compression of save-states used in game rewinding.
- nes_ntsc - NES NTSC effects/artifacts blitter.
- NeoPop - Neo Geo Pocket emulation code.
- Scale2x - Pretty non-blurring real-time image magnification filter.
- SDL - System interfaces for video blitting, sound output, input, etc.
- SDL_net - Used in network play code.
- Tremor Used for Ogg Vorbis playback with PCE CD emulation.
- Trio - *printf replacement functions for portability.
- VisualBoy Advance - GameBoy, GameBoy Color, and GameBoy Advance emulation.
- zlib - General (de)compressor used with network play and PNG snapshot saving.

## Core Features

- Double-buffered video, enabled by default.
- Multi-threaded video blitting, allowing for a kind of software triple-buffering, and improving performance on SMP systems.
- Joystick support.
- Extremely versatile input configuration system; assign multiple physical buttons to a virtual button or action.
- Full-screen modes.
- Save states.
- Real-time game rewinding, up to 10 seconds.
- Screen snapshots, saved in PNG format.
- Loading games from gzip and (pk)zip compressed archives.

- ### NES

  - ### CPU

    - All 256, official and unofficial, 2A03 opcodes emulated.

  - ### PPU

    - 8x8 and 8x16 sprites.
    - Sprite hit emulation(including checking the bg color).
    - 8 sprite limit(and flag emulation).
    - Screen/Sprite disabling, with correct color replacement.
    - Color deemphasis(probably not 100% correct, more research is needed).
    - Strip colorburst bit emulated.
    - CPU-instruction granularity for special mid-scanline effects(mostly CHR switching, such as used in "Pirates!", "Marble Madness", and "Mother").

    - #### Palettes

      Mednafen has many palette features, including loading a custom palette to replace the default NES palette. The palette from an NTSC NES can also be generated on-the-fly.

      First, a note on on the format of external palettes; Palette files are expected to contain 64 8-bit RGB triplets(each in that order; red comes first in the triplet in the file, then green, then blue). Each 8-bit value represents brightness for that particular color. 0 is minimum, 255 is maximum.

      Palettes can be set on a per-game basis. To do this, put a palette file in the "gameinfo" directory with the same base filename as the game you wish to associate with and add the extension "pal". Examples:

                          File name:              Palette file name:
                           BigBad.nes              BigBad.pal
                           BigBad.zip              BigBad.pal
                           BigBad.Better.nes       BigBad.Better.pal

      With so many ways to choose a palette, figuring out which one will be active may be difficult. Here's a list of what palettes will be used, in order from highest priority to least priority(if a condition doesn't exist for a higher priority palette, the emulator will continue down its list of palettes).

      NSF Palette(for NSFs only)
      Palette loaded from the "gameinfo" directory.
      NTSC Color Emulation(only for NTSC NES games).
      VS Unisystem palette(if the game is a VS Unisystem game and a palette is available).
      Custom global palette.
      Default NES palette.

  - ### Sound

    All 5 internal sound channels are supported(2x rectangle, triangle, noise, and DMC/PCM). Sound channels are emulated with CPU instruction granularity.

    Sound data is generated at the NES' CPU clock rate(about 1.8MHz for the NTSC NES), and then resampled to the output sample rate.

    Besides the 5 internal NES sound channels, Mednafen emulates the extra sound capabilities of the Konami VRCVI, Konami VRCVII, Namco 106, Nintendo MMC5, and the Sunsoft FME-07 chips. The extra sound channel in the Famicom Disk System is also emulated, but the support for its FM capabilities is limited.

  - ### Input

    Mednafen emulates the standard NES gamepad, the Four-Score multiplayer adapter, the Zapper, the Power Pad, and the Arkanoid controller. The Famicom version of the Arkanoid controller, the "Space Shadow" gun, the Famicom 4-player adapter, the Family Keyboard, the HyperShot controller, the Mahjong controller, the Oeka Kids tablet, the Quiz King buzzers, the Family Trainer, and the Barcode World barcode reader are also emulated.

    #### Zapper

    Most Zapper NES games expect the Zapper to be plugged into port 2. and most VS Unisystem games expect the Zapper to be plugged into port 1.

    The left mouse button is the emulated trigger button for the Zapper. The right mouse button is also emulated as the trigger, but as long as you have the right mouse button held down, no color detection will take place, which is effectively like pulling the trigger while the Zapper is pointed away from the television screen. Note that you must hold the right button down for a short time to have the desired effect.

  - ### File Formats/Expansion Hardware

    Mednafen supports the iNES, FDS(raw and with a header), UNIF, and NSF file formats. FDS ROM images in the iNES format are not supported; it would be silly to do so and storing them in that format is nonsensical.

    Mednafen supports loading ROM/disk images from some types of compressed files. Mednafen can load data from both PKZIP-format files and gzip-format files. Only the "deflate" algorithm is supported, but this is the most widely used algorithm for these formats.

    All files in a PKZIP format archive will be scanned for the followings extensions: .nes, .fds, .nsf, .unf, .nez, .unif The first archived file to have one of these extensions will be loaded. If no archived file has one of these extensions, the first archived file will be loaded.

    #### iNES Format

    The battery-backed RAM, vertical/horizontal mirroring, four-screen name table layout, and 8-bit mapper number capabilities of the iNES format are supported. The 512-byte trainer capability is also supported, but it is deprecated. Common header corruption conditions are cleaned(let's go on a DiskDude hunt), though not all conditions can be automatically detected and fixed. In addition, a few common header inaccuracies for games are also corrected(detected by CRC32 value). Note that these fixes are not written back to the storage medium.

    Support for the recent VS System bit and "number of 8kB RAM banks" is not implemented. Too many iNES headers are corrupt where this new data is stored, causing problems for those games.

    The following table lists iNES-format "mappers" supported well in Mednafen.

    Number: | Description: | Game Examples:
    --- | --- | ---
    0 | No bankswitching | Donkey Kong, Mario Bros
    1 | Nintendo MMC1 | MegaMan 2, Final Fantasy
    2 | UNROM | MegaMan, Archon, 1944
    3 | CNROM | Spy Hunter, Gradius
    4 | Nintendo MMC3 | Super Mario Bros. 3, Recca, Final Fantasy 3
    5 | Nintendo MMC5 | Castlevania 3, Just Breed, Bandit Kings of Ancient China
    6 | FFE F4 Series(hacked, bootleg) |
    7 | AOROM | Battle Toads, Time Lord
    8 | FFE F3 Series(hacked, bootleg) |
    9 | Nintendo MMC2 | Punchout!
    10 | Nintendo MMC4 | Fire Emblem, Fire Emblem Gaiden
    11 | Color Dreams | Crystal Mines, Bible Adventures
    12 | ?? | Dragon Ball Z 5 ("bootleg" original)
    13 | CPROM | Videomation
    15 | Multi-cart(bootleg) | 100-in-1: Contra Function 16
    16 | Bandai ?? | Dragon Ball Z, SD Gundam Gaiden **EEPROM is not emulated
    17 | FFE F8 Series(hacked, bootleg) |
    18 | Jaleco SS806 | Pizza Pop, Plasma Ball
    19 | Namco 106 | Splatter House, Mappy Kids
    21 | Konami VRC4 2A | WaiWai World 2, Ganbare Goemon Gaiden 2
    22 | Konami VRC4 1B | Twinbee 3
    23 | Konami VRC2B | WaiWai World, Crisis Force
    24 | Konami VRC6 | Akumajou Densetsu
    25 | Konami VRC4 | Gradius 2, Bio Miracle:Boku tte Upa
    26 | Konami VRC6 A0-A1 Swap | Esper Dream 2, Madara
    32 | IREM G-101 | Image Fight 2, Perman
    33 | Taito TC0190/TC0350 | Don Doko Don
    34 | NINA-001 and BNROM | Impossible Mission 2, Deadly Towers, Bug Honey
    41 | Caltron 6-in-1 | Caltron 6-in-1
    42 | (bootleg) | Mario Baby
    44 | Multi-cart(bootleg) | Super HiK 7 in 1
    45 | Multi-cart(bootleg) | Super 1000000 in 1
    46 | Game Station | Rumble Station
    47 | NES-QJ | Nintendo World Cup/Super Spike V-Ball
    48 | Taito TC190V | Flintstones
    49 | Multi-cart(bootleg) | Super HiK 4 in 1
    51 | Multi-cart(bootleg) | 11 in 1 Ball Games
    52 | Multi-cart(bootleg) | Mario Party 7 in 1
    64 | Tengen RAMBO 1 | Klax, Rolling Thunder, Skull and Crossbones
    65 | IREM H-3001 | Daiku no Gensan 2
    66 | GNROM | SMB/Duck Hunt
    67 | Sunsoft ?? | Fantasy Zone 2
    68 | Sunsoft ?? | After Burner 2, Nantetta Baseball
    69 | Sunsoft FME-7 | Batman: Return of the Joker, Hebereke
    70 | ?? | Kamen Rider Club
    71 | Camerica | Fire Hawk, Linus Spacehead
    72 | Jaleco ?? | Pinball Quest
    73 | Konami VRC3 | Salamander
    74 | Taiwanese MMC3 CHR ROM w/ VRAM | Super Robot Wars 2
    75 | Jaleco SS8805/Konami VRC1 | Tetsuwan Atom, King Kong 2
    76 | Namco 109 | Megami Tensei
    77 | IREM ?? | Napoleon Senki
    78 | Irem 74HC161/32 | Holy Diver
    79 | NINA-06/NINA-03 | F15 City War, Krazy Kreatures, Tiles of Fate
    80 | Taito X-005 | Minelvation Saga
    82 | Taito ?? | Kyuukyoku Harikiri Stadium - Heisei Gannen Ban
    85 | Konami VRC7 | Lagrange Point
    86 | Jaleco JF-13 | More Pro Baseball
    87 | ?? | Argus
    88 | Namco 118 | Dragon Spirit
    89 | Sunsoft ?? | Mito Koumon
    90 | ?? | Super Mario World, Mortal Kombat 3, Tekken 2
    92 | Jaleco ?? | MOERO Pro Soccer
    93 | ?? | Fantasy Zone
    94 | ?? | Senjou no Ookami
    95 | Namco 118 | Dragon Buster
    96 | Bandai ?? | Oeka Kids
    97 | ?? | Kaiketsu Yanchamaru
    99 | VS System 8KB VROM Switch | VS SMB, VS Excite Bike
    105 | NES-EVENT | Nintendo World Championships
    107 | ?? | Magic Dragon
    112 | Asder | Sango Fighter, Hwang Di
    113 | MB-91 | Deathbots
    114 | ?? | The Lion King
    115 | ?? | Yuu Yuu Hakusho Final, Thunderbolt 2, Shisen Mahjian 2
    117 | ?? | San Guo Zhi 4
    118 | MMC3-TLSROM/TKSROM Board | Ys 3, Goal! 2, NES Play Action Football
    119 | MMC3-TQROM Board | High Speed, Pin*Bot
    133 | Sachen SA72008 | Jovial Race
    134 | Sachen 74LS374N | Olympic IQ
    135 | Sachen 8259A | Super Pang
    140 | Jaleco ?? | Bio Senshi Dan
    144 | AGCI 50282 | Death Race
    150 | Camerica BF9097 | FireHawk
    151 | Konami VS System Expansion | VS The Goonies, VS Gradius
    152 | ?? | Arkanoid 2, Saint Seiya Ougon Densetsu
    153 | Bandai ?? | Famicom Jump 2
    154 | Namco ?? | Devil Man
    155 | MMC1 w/o normal WRAM disable | The Money Game, Tatakae!! Rahmen Man
    156 | ?? | Buzz and Waldog
    157 | Bandai Datach ?? | Datach DBZ, Datach SD Gundam Wars, **EEPROM is not emulated
    158 | RAMBO 1 Derivative | Alien Syndrome
    160 | (same as mapper 90) | (same as mapper 90)
    180 | ?? | Crazy Climber
    182 | ?? | Super Donkey Kong
    184 | ?? | Wing of Madoola, The
    185 | CNROM w/ CHR ROM unmapping | Banana, Mighty Bomb Jack, Spy vs Spy(Japanese)
    189 | ?? | Thunder Warrior, Street Fighter 2 (Yoko)
    193 | Mega Soft | Fighting Hero
    206 | DEIROM | Karnov
    207 | Taito ?? | Fudou Myouou Den
    208 | ?? | Street Fighter IV (by Gouder)
    209 | (mapper 90 w/ name-table control mode enabled) | Shin Samurai Spirits 2, Power Rangers III
    210 | Namco ?? | Famista '92, Famista '93, Wagyan Land 2
    215 | Bootleg multi-cart ?? | Super\ 308\ 3-in-1\
    217 | Bootleg multi-cart ?? | Golden Card 6-in-1
    222 | Bootleg ?? | Dragon Ninja
    228 | Action 52 | Action 52, Cheetahmen 2
    232 | BIC-48 | Quattro Arcade, Quattro Sports
    234 | Multi-cart ?? | Maxi-15
    240 | ?? | Gen Ke Le Zhuan, Shen Huo Le Zhuan
    242 | ?? | Wai Xing Zhan Shi
    244 | ?? | Decathalon
    246 | ?? | Fong Shen Ban
    248 | ?? | Bao Qing Tian
    249 | Waixing ?? | ??
    250 | ?? | Time Diver Avenger

    #### UNIF

    Mednafen supports the following UNIF boards. The prefixes HVC-, NES-, BTL-, and BMC- are omitted, since they are currently ignored in Mednafen's UNIF loader.

    Group:
    Name: | Game Examples:
    --- | ---
    Bootleg:
    BioMiracleA | Mario Baby
    MARIO1-MALEE2 | Super Mario Bros. Malee 2
    NovelDiamond9999999in1 | Novel Diamond 999999 in 1
    Super24in1SC03 | Super 24 in 1
    Supervision16in1 | Supervision 16-in-1
    Unlicensed:
    UNL-603-5052 | Contra Fighter
    NINA-06 | F-15 City War
    Sachen-8259A | Super Cartridge Version 1
    Sachen-8259B | Silver Eagle
    Sachen-74LS374N | Auto Upturn
    SA-016-1M | Master Chu and the Drunkard Hu
    SA-72007 | Sidewinder
    SA-72008 | Jovial Race
    SA-0036 | Mahjong 16
    SA-0037 | Mahjong Trap
    TC-U01-1.5M | Challenge of the Dragon
    8237 | Pocahontas Part 2
    MMC1:
    SAROM | Dragon Warrior
    SBROM | Dance Aerobics
    SCROM | Orb 3D
    SEROM | Boulderdash
    SGROM | Defender of the Crown
    SKROM | Dungeon Magic
    SLROM | Castlevania 2
    SL1ROM | Sky Shark
    SNROM | Shingen the Ruler
    SOROM | Nobunaga's Ambition
    MMC2:
    PEEOROM | Mike Tyson's Punch Out
    PNROM | Punch Out
    MMC3:
    TFROM | Legacy of the Wizard
    TGROM | Megaman 4
    TKROM | Kirby's Adventure
    TKSROM | Ys 3
    TLROM | Super Spike V'Ball
    TLSROM | Goal! 2
    TR1ROM | Gauntlet
    TQROM | Pinbot
    TSROM | Super Mario Bros. 3
    TVROM | Rad Racer 2
    MMC5:
    EKROM | Gemfire
    ELROM | Castlevania 3
    ETROM | Nobunaga's Ambition 2
    EWROM | Romance of the Three Kingdoms 2
    MMC6:
    HKROM | Star Tropics
    FME7:
    BTR | Batman: Return of the Joker
    Nintendo Discrete Logic:
    CNROM | Gotcha
    CPROM | Videomation
    GNROM | Super Mario Bros./Duck Hunt
    MHROM |
    NROM-128 | Mario Bros.
    NROM-256 | Super Mario Bros.
    RROM-128 |
    UNROM | Megaman

    #### Famicom Disk System

    You will need the FDS BIOS ROM image in the base Mednafen directory. It must be named "disksys.rom". Mednafen will not load FDS games without this file.

    Two types of FDS disk images are supported: disk images with the FWNES-style header, and disk images with no header. The number of sides on headerless disk images is calculated by the total file size, so don't put extraneous data at the end of the file.

    If a loaded disk image is written to during emulation, Mednafen will store the modified disk image in the save games directory, which is by default "sav" under the base directory.

    #### Game Genie

    The Game Genie ROM image is loaded from the path specified by the setting "nes.ggrom", or, if that string is not set, the file "gg.rom" in the base directory when Game Genie emulation is enabled.

    The ROM image may either be the 24592 byte iNES-format image, or the 4352 byte raw ROM image.

    #### VS Unisystem

    Mednafen currently only supports VS Unisystem ROM images in the iNES format. DIP switches and coin insertion are both emulated. The following games are supported, and have palettes provided(though not necessarily 100% accurate or complete):

    Battle City
    Castlevania
    Clu Clu Land
    Dr. Mario
    Duck Hunt
    Excitebike
    Excitebike (Japanese)
    Freedom Force
    Goonies, The
    Gradius
    Gumshoe
    Hogan's Alley
    Ice Climber
    Ladies Golf
    Mach Rider
    Mach Rider (Japanese)
    Mighty Bomb Jack (Japanese)
    Ninja Jajamaru Kun (Japanese)
    Pinball
    Pinball (Japanese)
    Platoon
    RBI Baseball
    Slalom
    Soccer
    Star Luster
    Stroke and Match Golf
    Stroke and Match Golf - Ladies
    Stroke and Match Golf (Japanese)
    Super Mario Bros.
    Super Sky Kid
    Super Xevious
    Tetris
    TKO Boxing
    Top Gun

- ### Atari Lynx

  Atari Lynx emulation requires the 512 Lynx boot ROM image, named as "lynxboot.img", and placed in the Mednafen base directory.

- ### PC Engine/SuperGrafx

  - All sprite sizes supported.
  - 16-sprites per line limit emulated.
  - Accurate HuC6280 flags emulation.
  - Dot-clock emulation for more accurate aspect ratios.
  - Very accurate and tonally-correct(thanks to Blip_Synth) PSG emulation.
  - Support for Street Fighter 2's HuCard hardware.
  - Support for Populous's backup RAM.

### Automatic IPS Patching

Place the IPS file in the same directory as the file to load, and name it filename.ips.

            Examples:       Boat.nes - Boat.nes.ips
                            Boat.zip - Boat.zip.ips
                            Boat.nes.gz - Boat.nes.gz.ips
                            Boat     - Boat.ips

Some operating systems and environments will hide file extensions. Keep this in mind if you are having trouble.

Patching is supported for all supported formats, but it will probably only be useful for fixed-position file formats.

## Using Mednafen

### Key Assignments

Key(s): | Action: | Configuration String:
--- | --- | ---
F5 | Save state. | save_state
F7 | Load state. | load_state
0-9 | Select save state slot. | "0" through "9"
- | Decrement selected save state slot. | state_slot_dec
= | Increment selected save state slot. | state_slot_inc
Shift + F5 | Record movie. | save_movie
Shift + F7 | Play movie. | load_movie
Shift + 0-9 | Select movie slot. | "m0" through "m9"
ALT + C | Toggle cheat console. | togglecheatview
ALT + T | Toggle cheats active. | togglecheatactive
ALT + N | Toggle network play console. | togglenetview
ALT + D | Toggle debugger. | toggle_debugger
ALT + A | Enter frame advance mode, if not already in it, and advance the frame. | advance_frame
ALT + R | Exit frame advance mode. | run_normal
SHIFT + F1 | Toggle frames-per-second display(from top to bottom, the display format is: virtual, rendered, blitted). | toggle_fps_view
F1 | Toggle 600-frame(~10 seconds on NES) save-state rewinding functionality, disabled by default. | state_rewind_toggle
Backspace | Rewind emulation, if save-state rewinding functionality is enabled, up to 600 frames. | state_rewind
F9 | Save screen snapshot. | take_snapshot
Alt + Enter | Toggle fullscreen mode. | toggle_fs
Ctrl + 1 through Ctrl + 9 | Toggle layer. | "tl1" through "tl9"
~ | Fast-forward. | fast_forward
F2 | Activate in-game input configuration process for a command key. | input_configc
F10 | Reset. | reset
F11 | Hard reset(toggle power switch). | power
F12 | Exit. | exit

#### NES

Key(s): | Action: | Configuration String:
--- | --- | ---
F3 | Activate in-game input configuration process for input port 1. | input_config1
Shift + F3 | Activate in-game input configuration process for input port 2. | input_config2
Alt + F3 | Activate in-game input configuration process for the Famicom expansion port. | input_configfc

#### VS Unisystem

Key: | Action: | Configuration String:
--- | --- | ---
F8 | Insert coin. | insert_coin
F6 | Show/Hide dip switches. | toggle_dipview
1-8 | Toggle dip switches(when dip switches are shown). | "1" through "8"

#### Famicom Disk System

Key: | Action: | Configuration String:
--- | --- | ---
F6 | Select disk and disk side. | select_disk
F8 | Eject or Insert disk. | insert_eject_disk

#### Barcode Readers

Key: | Action: | Configuration String:
--- | --- | ---
0-9 | Barcode digits(after activating barcode input). | "0" through "9"
F8 | Activate barcode input/scan barcode. | activate_barcode

#### Game Pad

Key: | Button on Emulated Gamepad:
--- | ---
Keypad 2 | B
Keypad 3 | A
Enter/Return | Start
Tab | Select
Z | Down
W | Up
A | Left
S | Right

#### Power Pad

Side B
O | P | [ | ]
K | L | ; | '
M | , | . | /

Side A
| P | [ |
K | L | ; | '
| , | . |

#### Family Keyboard

All emulated keys are mapped to the closest open key on the PC keyboard, with a few exceptions. The emulated "@" key is mapped to the "`"(grave) key, and the emulated "kana" key is mapped to the "Insert" key(in the 3x2 key block above the cursor keys).

To enable or disable Family Keyboard input, press the "Scroll Lock" key. When Family Keyboard input is enabled, Mednafen will also attempt to prevent any key presses from being passed to the GUI or system.

#### HyperShot Controller

| Run | Jump
Controller I | Q | W
Controller II | E | R

#### Mahjong Controller

Emulated Mahjong Controller: | A | B | C | D | E | F | G | H | I | J | K | L | M | N
PC Keyboard: | Q | W | E | R | T | A | S | D | F | G | H | J | K | L

Emulated Mahjong Controller: | SEL | ST | ? | ? | ? | ? | ?
PC Keyboard: | Z | X | C | V | B | N | M

#### Quiz King Controller

Emulated Buzzer: | 1 | 2 | 3 | 4 | 5 | 6
PC Keyboard: | Q | W | E | R | T | Y

#### Atari Lynx

Key(s): | Action: | Configuration String:
--- | --- | ---
F3 | Activate in-game input configuration process for Lynx pad. | input_config1
F8 | Rotate the screen | rotatescreen

Key: | Action/Button:
--- | ---
Keypad 2 | B
Keypad 3 | A
Keypad 4 & Enter/Return | Pause
Keypad 7 | Option 1
Keypad 1 | Option 2
W | Up
Z | Down
A | Left
S | Right

#### GameBoy/GameBoy Color/GameBoy Advance

Key(s): | Action: | Configuration String:
--- | --- | ---
F3 | Activate in-game input configuration process for GameBoy pad. | input_config1

Key: | Action/Button:
--- | ---
Keypad 2 | B
Keypad 3 | A
Enter/Return | Start
Tab | Select
Keypad 5 | Shoulder Left
Keypad 6 | Shoulder Right
W | Up
Z | Down
A | Left
S | Right

#### Neo Geo Pocket/Neo Geo Pocket Color

Key(s): | Action: | Configuration String:
--- | --- | ---
F3 | Activate in-game input configuration process for Neo Geo Pocket pad. | input_config1

Key: | Action/Button:
--- | ---
Keypad 2 | A
Keypad 3 | B
Enter/Return | Option
W | Up
Z | Down
A | Left
S | Right

#### PC Engine(TurboGrafx 16)/SuperGrafx

Key(s): | Action: | Configuration String:
--- | --- | ---
F3 | Activate in-game input configuration process for gamepad 1. | input_config1
Shift+F3 | Activate in-game input configuration process for gamepad 2. | input_config2
F4 | Activate in-game input configuration process for gamepad 3. | input_config3
Shift+F4 | Activate in-game input configuration process for gamepad 4. | input_config4
Ctrl+Shift+F4 | Activate in-game input configuration process for gamepad 5. | input_config5

Key: | Action/Button:
--- | ---
Keypad 2 | II
Keypad 3 | I
Enter/Return | Run
Tab | Select
W | Up
Z | Down
A | Left
S | Right

### Command-line

Mednafen supports arguments passed on the command line. Arguments are taken in the form of "-parameter value". Some arguments are valueless. Arguments that have both a parameter and a value will be saved in the configuration file.

Caution: Any arguments that change emulation behavior as seen from the emulated game are shown with bold text in the table. One should be conscious of these settings if one has changed them from the default values when using network play or movies, as they can cause desychronizations if not set the same among hosts(or between the recording emulator and the playing emulator).

Arguments listed in this table that contain <system> should have that string replaced with "nes", "pce", "gb", "gba", "lynx", or "ngp".
Example: <system>.xscale becomes nes.xscale.

Argument: | Value Type: | Default value: | Description:
--- | --- | --- | ---
-loadcd x | string | n/a | Load and boot a CD for system "x"(only "pce" is valid). This argument modifies the usage of the filename component of the command-line. For example, "mednafen -loadcd pce /somewhere/over/the/rainbow/game.cue" will load the CUE sheet as the emulated CDROM. "mednafen -loadcd pce" will load from the default physical CDROM device.
-nes.fnscan x | boolean | 1 | If value is true, scan the NES ROM image filename for (U), (J), and (E), and set the emulated video system(NTSC/PAL) accordingly, with NTSC preferred. Warning:This option may break NES network play when enabled IF the players are using ROM images with different filenames.
-autosave x | boolean | 0 | Automatically save the game state when a game is closed and reload the state when the game is loaded again.
-dfmd5 x | boolean | 1 | Include the MD5 hash of the loaded game in the filenames of the data file(save states, SRAM backups) Mednafen creates.
-snapname x | boolean | 0 | If value is true, use an alternate naming scheme(file base and numeric) for screen snapshots.
-sound x | boolean | 1 | If value is true, enable sound emulation and output.
-soundrate x | integer | 48000 | Specifies the sound playback rate, in frames per second("Hz").
-soundvol x | integer | 100 | Sound volume.
-soundbufsize x | integer | 32(52 for Win32) | Specifies the desired size of the sound buffer, in milliseconds.
-pce.adpcmlp x | boolean | 0 | When enabled, Mednafen will apply a lowpass filter to ADPCM sound output with a rolloff frequency dependent on the current ADPCM playback frequency. This makes ADPCM voices sound less "harsh", however, the downside is that it will cause many ADPCM sound effects to sound a bit muffled.</td</tr>
-<system(pce, gba, gb, ngp only)>.forcemono x | boolean | 0 | Force monophonic(instead of stereo) sound output.
-autofirefreq x | integer | 3 | Set auto fire frequency to ~60Hz / (x + 1). Replace "60" with "50" for PAL games. A value of "0" disables the configured autofire buttons.
-analogthreshold x | integer | 75 | Threshold for detecting a "button" press on analog axis, in percent.
-ckdelay x | integer | 0 | The length of time, in milliseconds, that a button/key corresponding to a "dangerous" command like power, reset, exit, load state, etc. must be pressed before the command is executed.

-ckconfig x

string(comma-delimited)

Configure mapping of physical buttons to commands. Values that are valid in the comma-delimited string include:

- save_state
- load_state
- save_movie
- load_movie
- "0" through "9"
- "m0" through "m9"
- "tl1" through "tl9"
- take_snapshot
- hide_sprites
- hide_bg
- toggle_fs
- fast_forward
- insert_coin
- toggle_dipview
- select_disk
- insert_eject_disk
- activate_barcode
- toggle_fkb
- input_config1
- input_config2
- input_config3
- input_config4
- input_configfc
- state_rewind_toggle
- state_rewind
- rotatescreen
- reset
- power
- exit

During configuration, pressing the same button twice in a row will cause configuration to move to the next command to configure. A maximum of 4 physical buttons may be assigned to one command.

-inputcfg x

string

Configure mapping of physical device inputs to a virtual device. Valid values(listed by system) are:

- NES
  - gamepad1
  - gamepad2
  - gamepad3
  - gamepad4
  - powerpad1
  - powerpad2
  - ftrainer
- PC Engine
  - pcegamepad1
  - pcegamepad2
  - pcegamepad3
  - pcegamepad4
  - pcegamepad5

During configuration, pressing the same button twice in a row will cause configuration to move to the next button on the virtual device. A maximum of 4 physical buttons may be assigned to one virtual button.

-nes.input1 x and -nes.input2 x | string | gamepad | Select input device for input port 1 or 2. Valid strings are "none", "gamepad", "zapper", "powerpada", and "powerpadb".
-nes.fcexp x | string | none | Select Famicom expansion port device. Valid strings are "none", "shadow", "arkanoid", "4player", and "fkb".
-nes.nofs x | boolean | 0 | If value is true, disable four-score emulation.
-nes.gg x | boolean | 0 | Enable NES Game Genie emulation.
-nes.ggrom x | string |  | Path to Game Genie ROM image.
-ffspeed x | integer | 2 | Specifies the speed multiplier to be used in fast-forward mode.
-fftoggle x | boolean | 0 | Treat the fast-forward button as a toggle.
-ffnosound | boolean | 0 | Silence sound output when fast-forwarding.
-nothrottle x | boolean | 0 | If value is true, disable the speed throttling that is used when sound emulation is disabled.
-nes.n106bs x | boolean | 0 | Enable less-accurate, but better sounding, Namco 106(mapper 19) sound emulation.
-nes.no8lim x | boolean | 0 | No 8-sprites-per-scanline limit option.
-nes.cpalette x | string | 0 | Load a custom global NES palette from file "x". To stop using a custom palette: mednafen -cpalette "" game.nes
-nes.ntscblitter x | boolean | 0 | Enable NTSC color generation and blitter(only used when NTSC games are played). NOTE:If your refresh rate isn't very close to 60.1Hz(+-0.1), you will need to set the nes.ntsc.mergefields setting to "1" to avoid excessive flickering.
-nes.ntsc.preset x | string | none | Select video quality/type preset. Valid strings are: none, composite, svideo, rgb, and monochrome.
-nes.ntsc.mergefields x | boolean | 0 | Merge fields to partially work around !=60.1Hz refresh rates.
-nes.ntsc.saturation x | real | 0 | NTSC composite blitter saturation, -1 <= x <= 1.
-nes.ntsc.hue x | real | 0 | NTSC composite blitter hue, -1 <= x <= 1.
-nes.ntsc.sharpness x | real | 0 | NTSC composite blitter sharpness, -1 <= x <= 1.
-nes.ntsc.brightness x | real | 0 | NTSC composite blitter brightness, -1 <= x <= 1.
-nes.ntsc.contrast x | real | 0 | NTSC composite blitter contrast, -1 <= x <= 1.
-nes.ntsc.matrix x | boolean | 0 | Enable NTSC custom decoder matrix.
-nes.ntsc.matrix.0 x | real | 1.539 | NTSC custom decoder matrix element 0(red, value * V).
-nes.ntsc.matrix.1 x | real | -0.622 | NTSC custom decoder matrix element 1(red, value * U).
-nes.ntsc.matrix.2 x | real | -0.571 | NTSC custom decoder matrix element 2(green, value * V).
-nes.ntsc.matrix.3 x | real | -0.185 | NTSC custom decoder matrix element 3(green, value * U).
-nes.ntsc.matrix.4 x | real | 0.000 | NTSC custom decoder matrix element 4(blue, value * V).
-nes.ntsc.matrix.5 x | real | 2.000 | NTSC custom decoder matrix element 5(blue, value * U.
-nes.pal x | boolean | 0 | If value is true, emulate a PAL NES. Otherwise emulate an NTSC NES.
-nes.clipsides x | boolean | 0 | If value is true, clip leftmost and rightmost 8 columns of pixels of the video output.
-nes.slstart x | integer | 8 | First scanline to be rendered in NTSC emulation mode(when PAL emulation is disabled).
-nes.slend x | integer | 231 | Last scanline to be rendered in NTSC emulation mode.
-nes.slstartp x | integer | 0 | First scanline to be rendered in PAL emulation mode.
-nes.slendp x | integer | 239 | Last scanline to be rendered in PAL emulation mode.
-pce.forcesgx x | boolean | 0 | Force SuperGrafx emulation.
-pce.ocmultiplier x | integer | 1 | CPU overclock multiplier. WARNING: This changes low-level emulation behavior in a way that is not possible on a real machine, so don't be surprised if a few games won't work or have glitches with a setting other than 1!
-pce.cdspeed x | integer | 1 | CD-ROM data transfer speed multiplier. WARNING: pce.ocmultiplier should be set to a value greater than or equal to pce.cdspeed, as the PCE's BIOS routines are not designed for higher transfer rates than in a real PC Engine. Also, don't expect games with HuVideo to work properly if you set this to a value other than 1!
-pce.nospritelimit x | boolean | 0 | No 16-sprites-per-scanline limit option. WARNING: This option may cause undesirable graphics glitching on some games(such as "Bloody Wolf").
-pce.cdbios x | string |  | Path to the CD BIOS
Argument: | Value Type: | Default value: | Description:
-connect |  |  | Trigger to connect to remote host after the game is loaded.
-nethost x | string |  | Set server's hostname to connect to during netplay.
-netport x | integer | 4046 | Set port number to connect to on remote host.
-netpassword x | string |  | The optional password used to connect to a netplay server.
-netlocalplayers x | integer | 1 | Set the number of local players on your system during netplay.
-netnick x | string |  | Set nickname used during chat when using netplay.

-vdriver x

integer

0

Select which video output "driver" to use.

- 0 = OpenGL + SDL
- 1 = SDL framebuffer

Bilinear interpolation and Lynx screen rotation are not available with the "SDL framebuffer" driver.

-<system>.videoip x | boolean | 0 PCE: 1 | Use bilinear interpolation.
-<system>.scanlines x | integer | 0 | If non-zero, enable scanlines; scanline_brightness = 100% - (100% / x)

-<system>.special x

string

none

Use a special video scaling filter applied before OpenGL rasterization. The destination rectangle is NOT altered by this setting, so if you have xscale and yscale set to "2", and try to use a 3x scaling filter like hq3x, the image is not going to look that great. The nearest-neighbor scalers are intended for use with bilinear interpolation enabled, at high resolutions(such as 1280x1024; nn2x(or nny2x) + bilinear interpolation + fullscreen stretching at this resolution looks quite nice).

none or 0 (disable special scaler)
hq2x
hq3x
hq4x
scale2x
scale3x
scale4x
nn2x (Nearest-neighbor 2x)
nn3x (Nearest-neighbor 3x)
nn4x (Nearest-neighbor 4x)
nny2x (Nearest-neighbor 2x, y axis only)
nny3x (Nearest-neighbor 3x, y axis only)
nny4x (Nearest-neighbor 4x, y axis only)

-<system>.pixshader x

string

none

Enable specified OpenGL pixel shader. Obviously, this will only work in OpenGL mode(-vdriver 0), and only on cards and OpenGL implementations that support pixel shaders, otherwise you will get a black screen, or Mednafen may display an error message when starting up. Bilinear interpolation is disabled with pixel shaders, and any interpolation, if present, will be noted in the description of each pixel shader.

none (disable pixel shader)
ipxnoty Linear interpolation on X axis only.
ipynotx Linear interpolation on Y axis only.
ipsharper Sharper bilinear interpolation.
ipxnotysharper Sharper version of "ipxnoty".
ipynotxsharper Sharper version of "ipynotx".
scale2x Scale2X effect. It can be used with the "scale2x", "scale3x", and "scale4x" special scalers, giving "scale4x", "scale6x", and "scale8x", respectively.

-<system>.stretch x | boolean | 0 | Stretch to fill screen when in fullscreen mode.
-doublebuf x | boolean | 1 | Request double buffering(note that double buffering or sync-to-vblank may already be forcibly enabled by your video drivers).
-<system>.xscale (-<system>.xscalefs) / -<system>.yscale (-<system>.yscalefs) | real | NES: 2(2)/2(2) GB: 4(4)/4(4) GBA: 3(3)/3(3) Lynx: 4(4)/4(4) NGP: 4(3)/4(3) PCE: 3(3)/3(3) | Specify the scaling factor for each axis.
-<system>.xres x / -<system>.yres y | integer | NES: 640/480 GB: 800/600 GBA: 800/600 Lynx: 800/600 NGP: 640/480 PCE: 1024/768 | Set the desired horizontal/vertical resolution when in fullscreen mode.
-fs | boolean | 0 | Full screen mode.

## Game-specific Emulation Hacks

Title: | Description: | Source code files affected:
--- | --- | ---
KickMaster | KickMaster relies on the low-level behavior of the MMC3(PPU A12 low->high transition) to work properly in certain parts. If an IRQ begins at the "normal" time on the last visible scanline(239), the game will crash after beating the second boss and retrieving the item. The hack is simple, to clock the IRQ counter twice on scanline 238. | src/nes/boards/mmc3.cpp
Shougi Meikan '92 Shougin Meikan '93 | The hack for these games is identical to the hack for KickMaster. | src/nes/boards/mmc3.cpp
Star Wars (PAL/European Version) | This game probably has the same(or similar) problem on Mednafen as KickMaster. The hack is to clock the IRQ counter twice on the "dummy" scanline(scanline before the first visible scanline). | src/nes/boards/mmc3.c

## Credits

Name: | Contribution(s):
--- | ---
\Firebug\ | High-level mapper information.
Andrea Mazzoleni | Scale2x/Scale3x scalers included in Mednafen.
Bero | Original FCE source code.
Brad Taylor | NES sound information.
Charles MacDonald | PC Engine technical information.
EFX | Testing.
Fredrik Olson | NES four-player adapter information.
Gilles Vollant | PKZIP file loading functions.
goroh | Various documents.
Info-ZIP | ZLIB
Jeremy Chadwick | General NES information.
kevtris | Low-level NES information and sound information.
Ki | Various technical information.
Mark Knibbs | Various NES information.
Marat Fayzullin | General NES information.
Matthew Conte | Sound information.
Maxim Stepin | hq2x and hq3x scalers included in Mednafen.
Mitsutaka | YM2413 emulator.
nori | FDS sound information.
Quietust | VRC7 sound translation code by The Quietust (quietust at ircN dort org).
rahga | Famicom four-player adapter information.
TheRedEye | ROM images, testing.
Xodnizel | FCE Ultra.
...and everyone whose name my mind has misplaced.

## Legal Stuff

libmpcdec:

>       Copyright (c) 2005, The Musepack Development Team
>       All rights reserved.

>       Redistribution and use in source and binary forms, with or without
>       modification, are permitted provided that the following conditions are
>       met:

>       * Redistributions of source code must retain the above copyright
>       notice, this list of conditions and the following disclaimer.

>       * Redistributions in binary form must reproduce the above
>       copyright notice, this list of conditions and the following
>       disclaimer in the documentation and/or other materials provided
>       with the distribution.

>       * Neither the name of the The Musepack Development Team nor the
>       names of its contributors may be used to endorse or promote
>       products derived from this software without specific prior
>       written permission.

>       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>       "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
>       A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
>       OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>       LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
>       DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
>       THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
>       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>       OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Tremor:

>     Copyright (c) 2002, Xiph.org Foundation

>     Redistribution and use in source and binary forms, with or without
>     modification, are permitted provided that the following conditions
>     are met:

>     - Redistributions of source code must retain the above copyright
>     notice, this list of conditions and the following disclaimer.

>     - Redistributions in binary form must reproduce the above copyright
>     notice, this list of conditions and the following disclaimer in the
>     documentation and/or other materials provided with the distribution.

>     - Neither the name of the Xiph.org Foundation nor the names of its
>     contributors may be used to endorse or promote products derived from
>     this software without specific prior written permission.

>     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>     ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
>     A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION
>     OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
>     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
>     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
>     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Gb_Snd_Emu:

>     /* Library Copyright (C) 2003-2004 Shay Green. Gb_Snd_Emu is free
>     software; you can redistribute it and/or modify it under the terms of the
>     GNU General Public License as published by the Free Software Foundation;
>     either version 2 of the License, or (at your option) any later version.
>     Gb_Snd_Emu is distributed in the hope that it will be useful, but WITHOUT
>     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>     FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
>     more details. You should have received a copy of the GNU General Public
>     License along with Gb_Snd_Emu; if not, write to the Free Software
>     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

Blip_Buffer:

>     Copyright (C) 2003-2006 Shay Green. This module is free software; you
>     can redistribute it and/or modify it under the terms of the GNU Lesser
>     General Public License as published by the Free Software Foundation; either
>     version 2.1 of the License, or (at your option) any later version. This
>     module is distributed in the hope that it will be useful, but WITHOUT ANY
>     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
>     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
>     more details. You should have received a copy of the GNU Lesser General
>     Public License along with this module; if not, write to the Free Software
>     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Sms_Snd_Emu(base for T6W28_Apu NGP code):

>     Copyright (C) 2003-2006 Shay Green. This module is free software; you
>     can redistribute it and/or modify it under the terms of the GNU Lesser
>     General Public License as published by the Free Software Foundation; either
>     version 2.1 of the License, or (at your option) any later version. This
>     module is distributed in the hope that it will be useful, but WITHOUT ANY
>     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
>     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
>     more details. You should have received a copy of the GNU Lesser General
>     Public License along with this module; if not, write to the Free Software
>     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Handy:

>     Copyright (c) 2004 K. Wilkins

>     This software is provided 'as-is', without any express or implied warranty.
>     In no event will the authors be held liable for any damages arising from
>     the use of this software.

>     Permission is granted to anyone to use this software for any purpose,
>     including commercial applications, and to alter it and redistribute it
>     freely, subject to the following restrictions:

>     1. The origin of this software must not be misrepresented; you must not
>        claim that you wrote the original software. If you use this software
>        in a product, an acknowledgment in the product documentation would be
>        appreciated but is not required.

>     2. Altered source versions must be plainly marked as such, and must not
>        be misrepresented as being the original software.

>     3. This notice may not be removed or altered from any source distribution.

Portions of PC Engine CD emulation:

>             Copyright (C) 2004 Ki

>         This program is free software; you can redistribute it and/or modify
>         it under the terms of the GNU General Public License as published by
>         the Free Software Foundation; either version 2 of the License, or
>         (at your option) any later version.

>         This program is distributed in the hope that it will be useful,
>         but WITHOUT ANY WARRANTY; without even the implied warranty of
>         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>         GNU General Public License for more details.

OKI MSM6258 ADPCM Decoder:

>     /*
>      * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
>      *
>      * Redistribution and use in source and binary forms, with or without
>      * modification, are permitted provided that the following conditions
>      * are met:
>      * 1. Redistributions of source code must retain the above copyright
>      *    notice, this list of conditions and the following disclaimer.
>      * 2. Redistributions in binary form must reproduce the above copyright
>      *    notice, this list of conditions and the following disclaimer in the
>      *    documentation and/or other materials provided with the distribution.
>      * 3. The name of the author may not be used to endorse or promote products
>      *    derived from this software without specific prior written permission
>      *
>      * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
>      * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>      * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
>      * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
>      * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
>      * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
>      * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
>      * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>      * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
>      * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>      * SUCH DAMAGE.
>      */

Scale2x:

>      * Copyright (C) 2001, 2002, 2003, 2004 Andrea Mazzoleni
>      *
>      * This program is free software; you can redistribute it and/or modify
>      * it under the terms of the GNU General Public License as published by
>      * the Free Software Foundation; either version 2 of the License, or
>      * (at your option) any later version.
>      *
>      * This program is distributed in the hope that it will be useful,
>      * but WITHOUT ANY WARRANTY; without even the implied warranty of
>      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>      * GNU General Public License for more details.
>      *
>      * You should have received a copy of the GNU General Public License
>      * along with this program; if not, write to the Free Software
>      * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

hq2x, hq3x, hq4x:

>     //Copyright (C) 2003 MaxSt ( maxst@hiend3d.com )

>     //This program is free software; you can redistribute it and/or
>     //modify it under the terms of the GNU Lesser General Public
>     //License as published by the Free Software Foundation; either
>     //version 2.1 of the License, or (at your option) any later version.
>     //
>     //This program is distributed in the hope that it will be useful,
>     //but WITHOUT ANY WARRANTY; without even the implied warranty of
>     //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>     //Lesser General Public License for more details.
>     //
>     //You should have received a copy of the GNU Lesser General Public
>     //License along with this program; if not, write to the Free Software
>     //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

nes_ntsc:

>     /* Copyright (C) 2006 Shay Green. This module is free software; you
>     can redistribute it and/or modify it under the terms of the GNU Lesser
>     General Public License as published by the Free Software Foundation; either
>     version 2.1 of the License, or (at your option) any later version. This
>     module is distributed in the hope that it will be useful, but WITHOUT ANY
>     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
>     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
>     more details. You should have received a copy of the GNU Lesser General
>     Public License along with this module; if not, write to the Free Software
>     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

VisualBoyAdvance GameBoy and GBA code:

>     // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
>     // Copyright (C) 1999-2003 Forgotten
>     // Copyright (C) 2004-2006 Forgotten and the VBA development team

>     // This program is free software; you can redistribute it and/or modify
>     // it under the terms of the GNU General Public License as published by
>     // the Free Software Foundation; either version 2, or(at your option)
>     // any later version.
>     //
>     // This program is distributed in the hope that it will be useful,
>     // but WITHOUT ANY WARRANTY; without even the implied warranty of
>     // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>     // GNU General Public License for more details.
>     //
>     // You should have received a copy of the GNU General Public License
>     // along with this program; if not, write to the Free Software Foundation,
>     // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

trio:

>      * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
>      * Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net>
>      * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg.
>      *
>      * Permission to use, copy, modify, and distribute this software for any
>      * purpose with or without fee is hereby granted, provided that the above
>      * copyright notice and this permission notice appear in all copies.
>      *
>      * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
>      * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
>      * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
>      * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.

ConvertUTF:

>      * Copyright 2001-2004 Unicode, Inc.
>      *
>      * Disclaimer
>      *
>      * This source code is provided as is by Unicode, Inc. No claims are
>      * made as to fitness for any particular purpose. No warranties of any
>      * kind are expressed or implied. The recipient agrees to determine
>      * applicability of information provided. If this file has been
>      * purchased on magnetic or optical media from Unicode, Inc., the
>      * sole remedy for any claim will be exchange of defective media
>      * within 90 days of receipt.
>      *
>      * Limitations on Rights to Redistribute This Code
>      *
>      * Unicode, Inc. hereby grants the right to freely use the information
>      * supplied in this file in the creation of products supporting the
>      * Unicode Standard, and to make copies of this file in any form
>      * for internal or external distribution as long as this notice
>      * remains attached.

MD5 Hashing:

>     /*
>      * RFC 1321 compliant MD5 implementation,
>      * by Christophe Devine <devine@cr0.net>;
>      * this program is licensed under the GPL.
>      */

V810 Emulator:

>      * Copyright (C) 2006 David Tucker
>      *
>      * This program is free software; you can redistribute it and/or modify
>      * it under the terms of the GNU General Public License as published by
>      * the Free Software Foundation; either version 2 of the License, or
>      * (at your option) any later version.
>      *
>      * This program is distributed in the hope that it will be useful,
>      * but WITHOUT ANY WARRANTY; without even the implied warranty of
>      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>      * GNU General Public License for more details.
>      *
>      * You should have received a copy of the GNU General Public License
>      * along with this program; if not, write to the Free Software
>      * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Unzipping Code:

>     /* unzip.c -- IO for uncompress .zip files using zlib
>        Version 1.01e, February 12th, 2005

>        Copyright (C) 1998-2005 Gilles Vollant

>        Read unzip.h for more info
>     */

>     /* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of
>     compatibility with older software. The following is from the original crypt.c. Code
>     woven in by Terry Thorsen 1/2003.
>     */
>     /*
>       Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.

>       See the accompanying file LICENSE, version 2000-Apr-09 or later
>       (the contents of which are also included in zip.h) for terms of use.
>       If, for some reason, all these files are missing, the Info-ZIP license
>       also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
>     */

MiniLZO:

>        Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
>        Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
>        All Rights Reserved.

>        The LZO library is free software; you can redistribute it and/or
>        modify it under the terms of the GNU General Public License as
>        published by the Free Software Foundation; either version 2 of
>        the License, or (at your option) any later version.

>        The LZO library is distributed in the hope that it will be useful,
>        but WITHOUT ANY WARRANTY; without even the implied warranty of
>        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>        GNU General Public License for more details.

>        You should have received a copy of the GNU General Public License
>        along with the LZO library; see the file COPYING.
>        If not, write to the Free Software Foundation, Inc.,
>        59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

>        Markus F.X.J. Oberhumer
>        <markus@oberhumer.com>
>        http://www.oberhumer.com/opensource/lzo/

Fuse Z80 emulation code:

>        Copyright (c) 1999-2004 Philip Kendall, Witold Filipczyk

>        $Id: z80_ops.c,v 1.56 2004/06/09 10:55:09 pak21 Exp $

>        This program is free software; you can redistribute it and/or modify
>        it under the terms of the GNU General Public License as published by
>        the Free Software Foundation; either version 2 of the License, or
>        (at your option) any later version.

>        This program is distributed in the hope that it will be useful,
>        but WITHOUT ANY WARRANTY; without even the implied warranty of
>        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>        GNU General Public License for more details.

>        You should have received a copy of the GNU General Public License
>        along with this program; if not, write to the Free Software
>        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

>        Author contact information:

>        E-mail: pak21-fuse@srcf.ucam.org
>        Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England

NeoPop Neo Geo Pocket (Color) Code:

>     //---------------------------------------------------------------------------
>     // NEOPOP : Emulator as in Dreamland
>     //
>     // Copyright (c) 2001-2002 by neopop_uk
>     //---------------------------------------------------------------------------
>     //      This program is free software; you can redistribute it and/or modify
>     //      it under the terms of the GNU General Public License as published by
>     //      the Free Software Foundation; either version 2 of the License, or
>     //      (at your option) any later version. See also the license.txt file for
>     //      additional informations.