Post subject: Linux/Windows fceu differences
Joined: 12/3/2005
Posts: 20
The linux version of fceu is not exactly the same as the windows version. I would like to keep a list of their differences in this thread, mostly so I can list fixes or workarounds for the linux version if they exist. Note that when I talk about the 'linux' version, I'm including BSDs, OSX, and any other unix variant that fceu can be compiled and run on. Unless otherwise noted, all references to fceu refer to version 0.98.28. Some links, for convenience: Remapping Controller Input To change controller key mappings, start fceu with the inputcfg option:
fceu -inputcfg gamepad1 somerom.nes
Because of how fceu parses the command line, you do have to include some text after any options; it doesn't necessarily have to be a rom filename. Configuring 'gamepad1' will set controls for the first controller. Other options are gamepad2, gamepad3, gamepad4, powerpad1, powerpad2. When starting fceu with inputcfg, you will be prompted to map each button up to four times, so you can enter multiple keys for each controller input. If you don't want to map multiple keys, just repeat a key and it will move on to the next input. Note that fceu does support auto-fire for the A and B buttons, despite what the Features wiki page suggests. You can not remap keys for emulator functions from the command line, only for controller input. Changing the keys for emulator functions has to be done in the source code. Input Display There is no way to toggle input display because no key is mapped to this function. This is easy to fix in the source code. Add this line to src/drivers/pc/input.c around line 196 and recompile.
if(keyonly(COMMA)) FCEUI_ToggleInputDisplay();
Now Comma will toggle input display. Frame Count Display Toggling frame count display is mapped to Backspace in linux, not Period as in windows. If you want to make linux fceu work like windows fceu, change line 198 in src/drivers/pc/input.c and recompile.
- if(keyonly(BACKSPACE)) FCEUI_MovieToggleFrameDisplay();
+ if(keyonly(PERIOD)) FCEUI_MovieToggleFrameDisplay();
Now Period will toggle Frame Count Display and Backspace will do nothing. Pause and Frame Advance Frame Advance is mapped to Right Control rather than Backslash. Instead, Pause is mapped to Backslash. If you want to bring linux fceu more in line with windows fceu, you can swap the keys for Pause and Frame Advance by changing lines 200 and 201 in src/drivers/pc/input.c as follows:
- if(keyonly(BACKSLASH)) FCEUI_ToggleEmulationPause();
- if(keyonly(RIGHTCONTROL)) FCEUI_FrameAdvance();
+ if(keyonly(RIGHTCONTROL)) FCEUI_ToggleEmulationPause();
+ if(keyonly(BACKSLASH)) FCEUI_FrameAdvance();
I think Pause may be a menu-only setting on default Windows fceu (this is based on source-exploring; I don't have a windows machine available to test this), so make your own choices about which key is the 'correct' key for pause. Fast Forward Fast Forward doesn't exist in the linux version. I don't see an easy/obvious way to fix this. Changing the speed with '-' and '+' works, but of course this is not exactly the same thing. Auto-hold The Features page on the wiki suggest that linux has partial auto-hold support. If this is the case, I don't know how to use it. Start Recording from Power-On By default, linux FCEU seems to be recording from an embedded "quicksave" snapshot. I don't know exactly what this means, but the important thing is that it is not recording from Power-On (one of the requirements of this site). To change FCEU to always start recording a movie from Power-On, change line 181 of src/drivers/pc/input.c as follows and recompile:
- FCEUI_SaveMovie(NULL,0,NULL); 
+ FCEUI_SaveMovie(NULL,MOVIE_FLAG_FROM_POWERON,NULL);
After making this change, emulation no longer pauses on the last frame of playback. I don't yet know why this happens, or how this behavior compares to that of windows fceu. Disabling Layers According to the Features page, fceu linux supports disabling layers, but fceu windows does not. I assume this refers to F4 (hide sprites) and shift+F4 (hide background data; i.e. everything that is not considered a sprite). I'm not sure why this wouldn't exist in the Windows version (and this implementation seems less than useful to me anyway), but I'm putting it on this list for completeness. Combos or Macros According to the Features page, Combos and Macros are available in Windows although they are not supported in fceu linux. Export to AVI The Features list indicates that this is built in to the Windows version and partially supported in linux. I really don't know the details. Memory Search I don't know how to do this, or if it's possible in linux fceu.
Joined: 7/2/2007
Posts: 3960
Pause and Frame Advance were mapped to '\' and right-control on my default compile on OSX.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 12/3/2005
Posts: 20
Derakon wrote:
Pause and Frame Advance were mapped to '\' and right-control on my default compile on OSX.
Oh, you're right. I'm not sure how I didn't see it in the source. I'll fix that on the list.
Joined: 7/2/2007
Posts: 3960
Apparently the Windows version of FCEU has options for recording movies from power-on vs. from a save-state. I can't figure out how to record a movie from power-on for my version, though; it seems like regardless of what I do it assumes a savestate. Here's how I'm starting the movie: * Start emulator * Pause emulation * Hard reset * Shift-1 (select movie slot one) * Shift-F5 (start recording movie) However, the result is still a save-state-anchored movie. I don't see any commandline arguments for movies and the only documentation I've found has little to say on the matter, too. Any ideas?
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Player (206)
Joined: 5/29/2004
Posts: 5712
I think if a hard reset is the first thing you do after you start recording a movie, then it might work.
put yourself in my rocketpack if that poochie is one outrageous dude
Joined: 7/2/2007
Posts: 3960
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 12/3/2005
Posts: 20
Derakon wrote:
Apparently the Windows version of FCEU has options for recording movies from power-on vs. from a save-state. I can't figure out how to record a movie from power-on for my version, though; it seems like regardless of what I do it assumes a savestate.
Yeah, this was kind of lame. I think I figured out how to get fceu to record from power-on (see the edited topic post), but now I have to figure out how to properly fix the wip I had already started.
Post subject: Re: Linux/Windows fceu differences
Former player
Joined: 12/5/2007
Posts: 716
How about fixing it this way: Record a few frames (10 should be enough, I guess) from record on just the way you did for your savestate run and look for these overlapping bytes to be the same in your savestate run. Then append all the frames you've had before and fix the run header according to this. ... Honestly? I have no clue what I'm talking about; just pointing out the way I'd try it.
jsor wrote:
After making this change, emulation no longer pauses on the last frame of playback. I don't yet know why this happens, or how this behavior compares to that of windows fceu.
Iirc the Windows version usually does not stop after the last recorded frame.
Joined: 7/2/2007
Posts: 3960
I managed to fix my WIP through hex-editing. * Pause * Start recording * Hard reset * Play as normal * Save, open in hex editor, change byte that says if video starts from save state to be "start from hard reset". The FCM format is discussed in detail here: http://tasvideos.org/FCM.html
Pyrel - an open-source rewrite of the Angband roguelike game in Python.