LINUXでSNESよ~ん
(更新2002/1/10)
snes9xをLinuxで遊ぶための設定 by blaze
質問はこちらまでblaze260@hotmail.com
(以下の設定は一般ユーザー向けになっていますが、できることならrootで作業してください。)
入手先
http://www.snes9x.com/からダウンロードして下さい。
私は s9x.linuxc6.139.i386.tar.gz を使いました。
インストール
インストールは簡単です。適当なディレクトリに展開して下さい。
$ tar xzvf s9x.linuxc6.139.i386.tar.gz
展開すると以下の実行可能ファイルが存在するはずです。
snes9x X Window System用 osnes9x X Window SystemでOpenGLを使う gsnes9x X Window SystemでVoodoo対応 ssnes9x SVGA用エミュ本体 s9xserver 通信対戦用サーバー(?) README.TXT
Xでしか遊ばないならsnes9xをパス(環境変数PATH)の通ったディレクトリにコピーして以下のコマンドを叩きます。
$ su (ようはrootでやれってこと)
# chown root snes9x
# chmod 4755 snes9x
# exit
これをやらないとゲームを起動したとき/dev/memに対するpermissionsエラーが発生します。(ゲームはできます。)
これは、フルスクリーンモードを可能にするためにsnes9xが直接ビデオチップセットのレジスタ値を変更し
ビデオメモリへの書き込みを行うためらしいです。
ついでに、サウンドの設定ができていない場合、『/dev/dsp
がありません』といったエラーが出ますが、ゲームはできます。
(もちろん音はなりませんけど。)
起動
では、いよいよゲームの起動です。
ROMは環境変数SNES96_ROM_DIRで指定したディレクトリ、またはsnes9xがあるディレクトリ配下の
./roms に置くとよいでしょう。
(私は./romsを作り、その上で環境変数SNES96_ROM_DIRに./romsへのパスを通すことをお勧めします。パス通さないとできませんでした。)
$ snes9x <パラメータ>
で起動します。パラメータは使用してるパソコンの環境で調整して下さい。(抜粋した一覧が下の方にあります)
起動の時にエラーがでて、その内容が、
error in loading shared libraries libXxf86vm.so.1 cannot open shared object file : No such file or directory
なら、次の方法で直るかも知れません。
まず、sudoを使えるようにします。/etc/sudoersに
自分のID ALL=(ALL) ALL
を追加します。そして、xshared-4.1.0-10.i386.rpm などの、libXxf86vm.so.1
を含んでいるパッケージをインストールし、
$ cd /usr/X11R6/lib/ $ sudo ld --whole-archive -shared -o libXxf86vm.so.1 libXxf86vm.a $ sudo ld --whole-archive -shared -o libXxf86dga.so.1 libXxf86dga.a $ sudo ldconfig
と打ち込みます。(権限が使える場合は、sudoの設定は飛ばして、そのまま上記のコマンドを打ち込んでください。)
これで起動できると思います。 $ snes9x <パラメータ>
################################
以下はおまけです。
################################
英文READMEの重要なところの抜粋
*ROMのタイプは、*.smc, *.sfc, *.fig or *.1, *.2, or sf32xxxa,sf32xxxb
でないと走らない。
(噂では*.zipもいけるらしい。)
*S-RAMセーブは、通常 $HOME/.snes96_snapshots に保存されるが、環境変数
SNES96_SNAPSHOT_DIR
で変えることができる。
*ZSNESのSRAMセーブファイルも読める。
*制御コマンドを訳してみました。稚拙な英語力しかありませんが、役に立ててください。
(もちろん、英語が読める方はREAMEの原文を読むことをお勧めします。間違いあると思うし)
Keyboard Controls
=================
ゲーム中
'Escape' やめる
'Pause' or 'Scroll Lock' 一時停止
Alt+'f' or PrtSc フルスクリーンの切替え
Joy-pad 1:
'up' or 'u' # ここは分かるね
'down', 'j' or 'n' #
'left' or 'h' #
'right' or 'k' #
'a', 'v' or 'q' L ボタン
'z', 'b' or 'w' R ボタン
's', 'm' or 'e' X ボタン
'x', ',' or 'r' Y ボタン
'd', '.' or 't' A ボタン
'c', or 'y' B ボタン
'return' Start ボタン
'space' Select ボタン
'tab' ターボモードボタン
'0' H-DMA emulation の切替え
'1' background 1 の切替え
'2' background 2 の切替え
'3' background 3 の切替え
'4' background 4 の切替え
'5' スプライトの切替え
'6' コントローラー1と2交換
'7' Rotate between Multi-player 5, mouse on port
1,(うまい表現がないのでこのまま)
mouse on port 2 and SuperScope emulation.
'8' Toggle background layer priorities for
backgrounds(ここも)
involved in sub-screen addition/subtraction.
'9' 16-bit screen mode のときは選ぶ。.
Shift+'9' SNES mode 7 bitフィルタリングの切替え
'Backspace' エミュのwindowsグラフィックの切替え.
'-' フレームスキップの速度低下
'+' フレームスキップの速度上昇
オートフレーム(?)
Shift+'-' フレームの表示時間の短縮.
Shift+'+' フレームの表示時間の延長
一つのフレームをエミュレイトする平均時間を変更できる。 オートフレームがうまく行かないときだけに設定しよう。 このコードはいくつかレンダリングし損なうかもしれない。 フレームは指示どうり動こうとするからだ。
Shift+'F1-F10' 簡易セーブ(F1-F10はスロット)
'F1-F10' 簡易ロード F1-F10までで選んだ場所からロードする。
Alt or Ctrl+'F1' 音楽抽出?データは.spc
という形になるらしい。
Alt/Ctrl+'F2' or 'F11' Load a game's saved position.
(機能がよく分からないので原文のまま)
Alt/Ctrl+'F3' or 'F12' Save a game's position. (同様)
Alt/Ctrl+'F4' -> 'F11' サウンドチャンネルの切替え.
Alt/Ctrl+'F12' 全てのサウンドチャンネルを反転する。
*以下はオプションなのですが、あまりにも多いので訳す気力が無くなっちゃいました。
ということで原文のままです。気が向いたらまた訳します。(英語のできる誰かさん、やってくれませんか?)
Lots of command line flags are available:
###########################
Graphics options:
- tr or transparency (default: off)
Enable transparency effects, also enables 16-bit screen mode selection. Transparency effects are automatically enabled if the depth of your X server is 15-bit or greater.
- 16 or -sixteen (default: off)
Enable 16-bit internal screen rendering, allows palette changes but no transparency effects.
- hires or -hi (default: lo-res.)
Enable support for SNES hi-res. and interlace modes. USE ONLY IF GAME REQUIRES IT (FEW DO) BECAUSE IT REALLY SLOWS DOWN THE EMULATOR.
- y or -interpolate (default: off)
Enables 'TV mode', hires support, 16-bit internal rendering and transparency effects. TV mode scales the SNES image by x2 by inserting an extra blended pixel between each SNES pixel and 80% brightness
'scan-lines'between each horizontal line. The result looks very nice but needs a fast machine. Use with the full-screen X mode and a 15 or 16 depth X server, or the SVGA port for fastest operation.
- y2 or -interpolate2
Enable Kreed's Super 2xSaI image processing mode.
- y3 or -interpolate3
Enable Kreed's Super Eagle image processing mode.
- y4 or -interpolate4
Enable Kreed's 2xSaI image processing mode.
- y5 or -interpolate5
Enable Kreed's software bi-linear filtering and image scaling mode.
- nms or -nomodeswitch (default: switch modes)
The Linux X Windows System port can change the screen resolution when switching to full-screen mode so the SNES display fills the whole screen. Specify this option to stop it if causes you problems.
- fullscreen or -fs
Start the emulator in full screen mode, rather than a window on the X11 port if supported by your X server, a suitable screen mode is defined in your XF86Config file and the snes9x binary has root permissions (see
above). - scale or -sc (default: off)
Stretch the SNES display to fit the whole of the computer display. Linux X Window System full-screen mode or SVGA port only. Use only if you have a very fast machine.
- displayframerate or -dfr
Display a frame rate counter superimposed over the bottom, left-hand
cornerof the SNES display. The value before the slash (/) indicates how many frames per second are being rendered compared to a real SNES, the value
ofwhich is displayed after the slash.
################################
Sound options:
- ns or -nosound
Disable sound CPU emulation and sound output, useful for the Starfox 2
betafloating around that has corrupt sound CPU code, causing the game to hang with sound emulation turned on. Disabling sound also speeds up emulation speed, at the expense of no music or sound effects during the game and reduced game compatibility.
- sk 0-3 or -soundskip 0-3 (default: 0)
ONLY USED IF SOUND IS DISABLED. The algorithm to use when trying to fool a ROM into thinking that the SPC700 sound CPU is there when actual
emulationof it is turned off (for speed reasons).
- stereo or -st (default: stereo)
Enable stereo sound output.
- mono (default: stereo)
Enable mono sound output. Slightly faster, but doesn't sound as nice.
- r 0-7 or -soundquality or -sq 0-7 (default: 4)
Sound playback rate/quality: 0 - disable sound, 1 - 8192, 2 - 11025, 3 - 16500, 4 - 22050
(default),5 - 29300, 6 - 36600, 7 - 44000.
- envx or -ex (default: off)
Enable volume envelope height reading by the sound CPU. Can cure sound repeat problems with some games (e.g. Mortal Kombat series), while
causingothers to lock if enabled (eg. Bomberman series). Use with -sy option
belowto fix the problems this option can otherwise create.
- ts or -threadsound
Starts to feed data to the sound card using a separate thread rather than using timers, signals and polling. Use to work around a bug in the beat
SoundBlaster Live Linux driver that keeps telling Snes9x that the sound card can accept more sound data, when it actually cannot and Snes9x slows down or locks up. A multi-CPU system could benifit from using this option - sound processing could take place on another CPU for speed.
- sy or -soundsync
Turns on sound-sync code where sound data is generated in sync with the emulation of the SNES sound CPU instructions. Slightly slower emulation
speedbut helps reduce note and sound effects timing problems and one or two games actually require this mode, notably Williams Arcade Classics. Also turns on interpolated sound and envelope height reading. Pressing the ']' key during gameplay toggles sound-sync only on and off. Not very effective/useless when thread sound is enabled due to mutex data locking timing problems.
- is or -interpolatedsound (default: off)
Turns on interpolated sound. Any samples played at a lower frequency than the current playback rate (-r option) have additional sample points computed and played where previously the same sample data was played repeatedly. Lower frequency sounds have improved bass and sound much less harsh - I suspect the real SNES does this. Pressing '[' during gameplay toggles the feature on and off.
- b size or -buffersize size or -bs size (default: auto-select)
Sound playback buffer size in bytes 128-4096.
- nosamplecaching or -nsc or -nc (default: on)
Disable decompressed sound sample caching. Decompressing samples takes
time,slowing down the emulator. Normally the decompressed samples are saved just in case they need to be played again, but the way samples are stored and played on the SNES, it can result in a click sound or distortion when caching samples with loops in them.
- alt or -altsampledecode (defalt: off)
Switch to using Anti Resonance's sample decoding method. Some games, notably Squaresoft RPG games, make use of a SNES hardare sample decoding
bug/feature to generate wind and swish-type sound effects; selecting this
optionenables code that tries to simulate the feature. The disadvantage is that it can decode some 'normal' samples incorrectly.
- noecho or -ne (default: on)
Turn off sound echo and FIR filter effects. Processing these effects can really slow down a non-MMX Pentium machine due to the number of
calculationsrequired to implement these features.
- ratio 1+ or -ra 1+ (default: 2) (OBSOLETE)
Ratio of 65c816 to SPC700 instructions. The value is no longer used because SPC700 cycle counting is now implemented giving much more
accuratetiming.
- nomastervolume or -nmv (default: on)
Disable emulation of the sound DSP master volume control. Some ROMs set the volume level very low requiring you to turn up the volume level of your speakers introducing more background noise. Use this option to always have the master volume set on full and to by-pass a bug which prevents the music and sound effects being heard on Turrican.
###############################
Cheat options:
- gg or -gamegenie
Supply a Game Genie code for the current ROM. Up to 10 codes can be in affect at once. Game Genie codes for many SNES games are available from:
http://vgstrategies.miningco.com/games/vgstrategies/library/ggn/bl_ggnsnes.htm
- ar or -actionreplay
Supply a Pro-Action Reply code for the current ROM. Up to 10 codes can be
inaffect at once. At the moment, codes which alter RAM do not work.
- gf or -goldfinger
Supply a Gold Finger code for the current ROM. Up to 10 codes can be
activeat once.
################################
Speed up/slow down options: (See "Speeding Up The Emulation")
- f or -frameskip (default:
auto-adjust)Set this value to deliberately fix the frame skip rate and disable auto- speed regulation. Use a larger value faster emulation but more jerky movement and a smaller value for smooth but slower screen updates. Use '+' and '-' keys to modify the value during a game. Ideal for some Super FX games that confuse the auto-adjust code or for games that deliberately flash the screen every alternate frame.
- frametime or -ft
(default: 16.6ms NTSC games and 20ms for PAL games) If auto-adjust frame skip option is in effect, then the emulator will try to maintain a constant game and music speed locked to this value by
skippingthe rendering of some frames or waiting until the required time is
reached.Increase the value to slow down games, decrease it to speed up games. During a game the value can be adjusted in millisecond steps by pressing Shift '-' or Shift '+'.
- h <0-200> or -cycles <0-200>(default: 100)
Percentage of CPU cycles to execute per scan line, decrease value to increase emulation frame rate. Most ROMs work with a value of 85 or
above. - j or -nojoy
Turn off joystick, SideWinder and GrIP detection (joystick polling on the PC slows the emulator down).
################################
ROM image format options:
- i or -interleaved (default: auto-detect)
Force interleaved ROM image format.
- i2 or -interleaved (default: can't be auto-detected)
Force alternate interleaved format (i.e. most Super FX games).
- hirom or -fh or -hr (default: auto-detect)
Force Hi-ROM memory map for ROMs where the Hi-ROM header test fails.
- lorom or -fl or -lr (default: auto-detect)
Force Lo-ROM memory map for ROMs where the Hi-ROM header test fails)
- header or -hd (default: auto-detect)
Force the detection of a ROM image header. Some ROM images have been hand-edited to remove unused space from the end of the file; if the resultant image size is not a multiple of 32k then Snes9x can't auto-detect the presence of a 512 byte ROM image header.
- noheader or -nhd (default: auto-detect)
Force Snes9x into thinking no ROM image header is present. See -header above.
- p or -pal (default: auto-detect)
Fool ROM into thinking this is a PAL SNES system and adjust frame time to 20ms (50 frames per second)
- n or -ntsc (default: auto-detect)
Fool ROM into thinking this is a NTSC SNES system and adjust frame time to 16.7ms (60 frames per second)
- l or -layering (default: off)
Swap background layer priorities from background involved in sub-screen addition/subtraction. Can improve some games play-ability - no need to constantly toggle background layers on and off to read text/see maps,
etc.Toggle feature on and off during game by pressing '8'. Not used if transparency effects are enabled.
- l or -loadsnapshot
Load snapshot file and restart game from saved position.
- nh or -nohdma (default: H-DMA enabled)
Turn off the H-DMA emulation. Pressing '0' during a game toggles H-DMA on and off.
- n or -nospeedhacks (default: speed hacks)
Turn off a couple of speed hacks. The hacks boost the speed of many ROMs but cause problems a few ROMs.
- nw or -nowindows (default: graphics windows emulated)
Disable graphics windows emulation. Use 'backspace' key during a game to toggle the emulation on and off.
################################
Joystick options:
- joymap[1|2|3|4] followed by 8 numbers
Specify the SNES joypad buttons to Linux joystick driver buttons mapping
foreach of the four supported joypads. Specify the Linux joystick button number for the corresponding SNES
buttonin the following order: A, B, X, Y, TL, TR, Start and Select The default map is: 1 0 4 3 6 7 8 9 which is suitable for Sidewinder gamepads.
- s or -swap
Swap emulated joy-pad 1 and 2 around, pressing '6' during a game does the same thing.
- j or -nojoy
Turn off joystick, SideWinder and GrIP detection (joystick polling on the PC slows the emulator down).
For example, to start a game called "mario", with sound, and transparency
effects, type:
snes9x -tr mario.smc