# SNEmul configuration file
# Please read README before

# ROM Directory
ROMPath = /roms/snes

# SPC Directory
SPCPath = /spc

[Global]
# Those settings are default and overriden by games' settings

# Scaling modes:
# 0 : not scaled, the graphics are displayed without change, but the DS screen
# is too small to display all SNES screen. So a part of the screen is lost (see
# BG3SQuis and YScroll for workarounds).
#
# 2 : full-screen scaled, the SNES screen is displayed entirely onto the DS screen.
# The backgrounds uses a pseudo bi-linear filtering to squish the graphics. 
# Sprites are squished without filtering. Some pixels are lot.
#
# 1 : half scaled mode doesn't scale as much as full-screen does, so the top and bottom
# ranges of the screen are not displayed and sprites are not squished.
Scaled = 0

# BG3Squish and YScroll are only available for not scaled mode :

# BG3Squish : Squish the layer 3 
# 0 -> normal
# 1 -> squish (reduce 16 pixels)
# 2 -> squish more (reduce 32 pixels)
BG3Squish = 0

# YScroll : Vertical Scroll (pixels) of layer 1 and 2 
# 16 -> normal
# 32 -> bottom
# 0 -> top
# 24 -> medium botton (a good choice for many games)
YScroll = 16


# Sound emulation
# 0 -> off (and use SPC700 skipper)
# 1 -> on
Sound = 1

# BGLayer 
# Five digits number: s4321
# "1 2 3 4 s"  mean "BG1 BG2 BG3 BG4 sprite" respectively
# For each digit :
# 1 = enable, 0 = disable 
 
BGLayers = 10111

# BG Priorities selection
# 0 -> automatic
# 1 -> 1, 2, 0, 3
# 2 -> 3, 3, 2, 3
# 3 -> 3, 3, 3, 3
# 4 -> 2, 2, 2, 2 
# 5 -> 1, 1, 1, 1 
# 6 -> 0, 0, 0, 0
# 7 -> 2, 3, 0, 1
# 8 -> 2, 0, 3, 1
# 9 -> 2, 1, 0, 3 
# 10 -> manual (see below)
BGPriorities = 0

# BG Manual Prioritites
# abcd : priority for BG1 BG2 BG3 BG4
# 0 - 3 : the higher the value is, the lower the priority is
# if BG1 and BG2 have the same priority value, BG1 is in front of BG2
BGManualPriority = 1123

# Sprite Priorities
# abcd : priority for the 4 SNES priorities
# 0 - 3 : the higher the value is, the lower the priority is
# The most used values are 1123 or 1223
BGManualPriority = 1123

# BG3 Tile priority line detection
# if set to one, the emulator detects whether the current line has
# more low or high priority tiles, and change the priority of the 
# layer for this line (this only work for BG3 currently)
# This doesn't work for 16 pixels tiles and 64x64 layers
BG3TilePriority = 0

# Double a layer to emulate priority per tile for this layer
# When set to 0 or 1, one of the layer is doubled to the DS's fourth layer
# The high priority tiles are put on the main layer, the low priority tile
# on the back layer. Each layer is not entirely filled. The empty areas are
# filled with the tile BlankTilenumber (see below)
# This doesn't work for 16 pixels tiles and 64x64 layers 
TilePriorityBG = -1

# Number of a blank tile which will be used to fill the empty areas of the
# doubled layer
# 0 is a good value for most games, but some games may need another value, and
# this value may need to change for different parts of the game
# 666 seems ok for Secret Of Mana
BlankTileNumber = 0

# Transparency effects 
# 0 -> Disabled
# 1 -> Enabled
Transparency = 1

# HDMA
# 1 -> enable
# 0 -> disable
HDMA = 1

# Wait for V blank
Vblank = 1

# Fast DMA: Faster implementation of DMA, but maybe buggy
# 0 -> Regular DMA
# 1 -> Faster DMA 
FastDMA = 1

# Sound Port Synchronization hacks
# APU and CPU use 4 ports for exchanging data. Sometimes, games get
# desinchronzied because CPU write too fast or too slow. 
#
# abcdefgh where a,b,c,d,e,f,g,h is 0(off) or 1(on)
#
# abcd control the optional temporizing time before writing to a APU
# port. Of course this slowdown the game emulation.
#
# efgh control a little emulation hack that prevent the main CPU from writing 
# to an APU port until the previous data has been read by the sound CPU
#
# a/e : APU Port 0, b/f : APU Port 1 ... 
#
# Chrono Trigger is better with b=1
# Square games like SOM and FF6(FF3) sound  much better with g=1 and h=1
# Enix games like Illusion of gaia and Terranigma sound better with e=f=g=h=1 

SoundPortSync = 00000000

# External memory pak configuration:
# You can use external memory pack (like Opera RAM, Slot 2 card reader...) to
# increase memory available for emulator.
# There are two modes available for external memory:
#
# MapExtMem = 0 => Use external memory like a disk with paging enabled.
# In this mode, the emulator copy part of the ROM into the DS RAM as the
# the game needs it. It is the fastest method in most games.
#
# MapExtMem = 1 -> Map external memory directly, doesn't use memory paging.
# In this mode, the emulator doesn't copy the ROM into the DS RAM, it uses it
# directly from the external memory. As external memory is much slower than
# DS RAM, it is most of the time the slower method, but if a game uses a large
# range of memory (like graphic intensive game like Mortal Kombat), it can
# be faster than the other method. Some games can crash or refuse to launch,
# because the ROM cannot be locked read-only.
MapExtMem = 1

[KEYS]
# SNES -> NDS Mappable keys :
#
# To remap keys copy the original value in target field, then restore overwritten field's value into source field
SNES_BUTTON_A = 00000080
SNES_BUTTON_B = 00008000
SNES_BUTTON_X = 00000040
SNES_BUTTON_Y = 00004000
SNES_BUTTON_L = 00000020
SNES_BUTTON_R = 00000010
SNES_BUTTON_SELECT = 00002000
SNES_BUTTON_START = 00001000
SNES_BUTTON_UP = 00000800
SNES_BUTTON_DOWN = 00000400
SNES_BUTTON_LEFT = 00000200
SNES_BUTTON_RIGHT = 00000100


[GUI]
# Order for file chooser dialogs :
# 0 -> no order
# 1 -> alphabetical order
FileChooserOrder = 1

# Language of GUI
# -1 -> Use firmware settings (Japanese / English / French / German / Italian / Spanish)
# 0 -> Japanese (Katakana only)
# 1 -> English
# 2 -> French
# 3 -> German
# 4 -> Italian
# 5 -> Spanish 
# 106 -> Portuguese
# 107 -> Catalan
# 108 -> Polish
# 109 -> Dutch
# 110 -> Danish
# 111 -> Swedish (not available yet)
# 112 -> Korean (not available yet)
# 113 -> Simplified Chinese (not available yet)
# 114 -> Russian (not available yet)
# 115 -> Greek (not available yet)
Language = -1

# Screen Emulator Render
# TopScreen == 0: emulator renders at Bottom Screen
# TopScreen == 1: emulator renders at Top Screen (default)
TopScreen = 1

# --------------------------------------
# GUI layout
# --------------------------------------

DataPath = /

Palette = palette.dat

# Types :
# 0 -> Static (str)
# 1 -> Image static (file)
# 2 -> String button (str1, str2)
# 3 -> Image button (file1, file2)

LoadROM.type = 3
LoadROM.file1 = loadrom.raw
LoadROM.file2 = loadrom_a.raw
LoadROM.x = 4
LoadROM.y = 16
LoadROM.sx = 76
LoadROM.sy = 76

LoadState.type = 3
LoadState.file1 = loadstate.raw
LoadState.file2 = loadstate_a.raw
LoadState.x = 88
LoadState.y = 16
LoadState.sx = 76
LoadState.sy = 76

SaveState.type = 3
SaveState.file1 = savestate.raw
SaveState.file2 = savestate_a.raw
SaveState.x = 172
SaveState.y = 16
SaveState.sx = 76
SaveState.sy = 76

Options.type = 3
Options.file1 = options.raw
Options.file2 = options_a.raw
Options.x = 4
Options.y = 94
Options.sx = 76
Options.sy = 76

Jukebox.type = 3
Jukebox.file1 = jukebox.raw
Jukebox.file2 = jukebox_a.raw
Jukebox.x = 88
Jukebox.y = 94
Jukebox.sx = 76
Jukebox.sy = 76

Advanced.type = 3
Advanced.file1 = advanced.raw
Advanced.file2 = advanced_a.raw
Advanced.x = 172
Advanced.y = 94
Advanced.sx = 76
Advanced.sy = 76

StatusBar.type = 1
StatusBar.file1 = statusbar.raw
StatusBar.x = 0
StatusBar.y = 172
StatusBar.sx = 256
StatusBar.sy = 20

HideGUI.type = 3
HideGUI.file1 = hidegui.raw
HideGUI.file2 = hidegui_a.raw
HideGUI.x = 236
HideGUI.y = 0
HideGUI.sx = 14
HideGUI.sy = 14

Title.type = 0
Title.x = 0
Title.y = 0
Title.sx = 256
Title.sy = 14


# GAMES list:

# WARNING: AS of 0.5 alpha, crc is computed on first 1Mb for large ROMS(>3Mb)

# When loading a game, SNEmul will search in configuration in order : 
# - Title of the game
# - CRC
# - Filename
# - Alternat. CRC #2
# - Alternat. Title  #2
# - Alternat. CRC #3
# - Alternat. Title #3
# - Alternat. CRC #4
# - Alternat. Title #4
# - Alternat. CRC #5
# - Alternat. Title #5
# So you can associate up to 11 ROM dumps to the same entry 

[TITLE_OF_GAME_OR_FILENAME]
crc = 1020304
crc2 = deadbeef
crc3 = abbababa
crc4 = abcdef01
crc5 = 12345678
title2 = My Name Here (J)
title3 = My Name Here (US)
title4 = My Game
title5 = Hello World

[Secret of MANA]
SoundPortSync = 00000011
TilePriorityBG = 1
BG3TilePriority = 0
BlankTileNumber = 666
SpritePriority = 1223

[FINAL FANTASY 3]
SoundPortSync = 00000011
#TilePriorityBG = 1

[SUPER CASTLEVANIA 4]
BG3TilePriority = 1

[VAMPIRES KISS]
SoundPortSync = 00000011

[DONKEY KONG COUNTRY]
BGPriorities = 3
Transparency = 0
Vblank = 1

[CHRONO TRIGGER]
SoundPortSync = 01000000

[SUPER MARIOWORLD]
#BGPriorities = 1
# Mario is transparent in level selection 
Transparency = 0
BG3Squish = 1
YScroll = 24
Vblank = 1
Sound = 1
Scaled = 0
BGLayers = 10111
BGPriorities = 0
EnableSRAM = 0

[SUPER MARIO ALL_STARS]
YScroll = 24
BG3Squish = 0
Sound = 1
BGLayers = 10111
BGPriorities = 0
Vblank = 0

[SUPER BOMBERMAN]

[STREETFIGHTER2]
crc = A45CADD6
BG3TilePriority = 1

[POPULOUS II]
MouseXAddr = 7A
MouseYAddr = 7C
MouseMode = 2

[MARIOPAINT]
MouseXAddr = 4DC
MouseYAddr = 4DE
MouseMode = 1

[Lemmings 2,The Tribes]
MouseXAddr = C34
MouseYAddr = C35
MouseMode = 1
MouseXOffset = -8
MouseYOffset = -8

[CIVILIZATION]
MouseXAddr = 9D
MouseYAddr = 9F
MouseMode = 1

[Eye of the Beholder]
MouseXAddr = 87
MouseYAddr = 88
MouseMode = 1

[TERRANIGMA P]
TilePriorityBG = -1
BG3TilePriority = 0
BlankTileNumber = 0

[Street Fighter2 Turbo]
TilePriorityBG = -1
BlankTileNumber = 0
BG3TilePriority = 1

[Ogre Battle USA]
BG3Squish = 0
YScroll = 16
Sound = 1
GFXEngine = 0
HDMA = 1
BGLayers = 10111
BGPriorities = 0
Vblank = 0
TilePriorityBG = -1
BG3TilePriority = 1
BlankTileNumber = 0
SpritePriority = 1123
BGManualPriority = 0123

[Street Fighter 2]
TilePriorityBG = -1
BG3TilePriority = 1
BlankTileNumber = 0

[MORTAL KOMBAT 3]
BG3Squish = 0
YScroll = 16
Sound = 0
BGLayers = 10111
BGPriorities = 0
Vblank = 0
