Locked



Post subject: FYI: My Patchset for snes9x/unix
Joined: 12/17/2004
Posts: 99
Location: Karlsruhe, Germany
Hi, just for your information: I was quite unsatisfied with the way snes9x does work under unix as I were missing: ShowCurrentFrame, FrameAdvance, skip certain Number of Frames, the possibility to make movies with a savestate included and a key shortcut to make a movie read-only to be able to watch (not edit) a scene more than once (Or like in a big video like super Metroid make some Mark Points ...). I added those and some more options: -dmi / -displaymovieinfo: Shows Movie: Current Frame / Max Frame, but at the position of the FPS counter (which is not as annoying as the normal "status" position) -dpr / -displaypressedkeys: Shows the current pressed keys. A cool way to learn how a "perfect" player is playing and to spot unneeded key presses ;-). Shift+4 = Make new movie with snapshot included Shift+5 = Display Movie Info Shift+6 = Display Pressed Keys Shift+7 or \ = Advance one frame (\ did not work in my tests though :/) Shift+8 = Change R/W status of Movie Shift+9 = Skip a certain number of Frames Display Pressed Keys and Display Movie Info could be easily added to the windows version though I understand that most of you will be quite satisfied with the '.' and status bar solution already implemented. So the only thing interesting for those using windows could be the "Display Pressed Keys" Code, which is rather trivial, but the idea was new ... Blip, Anyone: If you are interested in the Patch-Set get it from: http://studwww.ira.uka.de/~s_franz2/smv/fabian-snes9x.diff cu Fabian
Post subject: Re: FYI: My Patchset for snes9x/unix
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Fabianx wrote:
Shift+4 = Make new movie with snapshot included
Hehe, the same key I ended up with :P
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
Actually I made something similar... It has a lot of your changes as well.. heh... Changes: - Stream dumping (for making videos) - Key display dumping (like yours) and frame number to stdout - SHIFT+2 asks number of controllers and whether to use snapshot/reset - Bisqwit's fix for the snapshot movie limit - Better turbo function (with TAB) - Frame advance keys (backslash and [ and ] because my keyboard sucks) - A few new command-line options for movies Can't live without frame advance. :) About \ as frame advance... on my keyboard it sometimes won't work because different keyboards have different limits on what keys can be pressed at once. Might that be what's affecting you?
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
DeHackEd wrote:
- Better turbo function (with TAB)
What is this? In my version, turbo increases the frame skipping as long as the key is being held - except in the recording version, where it doesn't touch frameskip but eliminates all waits of any kind. As for frame advance, I too think it's highly necessary for snes9x. At Famtasia, I can live easily without it.
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
I randomly NOT display frames so as to decrease the CPU usage by the X server, and I re-enable XShm (your original snes9x patch turns it off) to speed things up as well. It does make a significant difference on my system.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
DeHackEd wrote:
I randomly NOT display frames so as to decrease the CPU usage by the X server, and I re-enable XShm (your original snes9x patch turns it off)
In your patch, there's no reason to disable XShm. I disabled it because I used an external recorder. External recorder can't track direct memory access - it had to force snes9x to call XPutImage. (Thanks for reminding though - now that my version has an internal recorder as well, I have to remember to remove the touching of XShm support.) Randomly skip frames? How is that better than a controlled frameskipping?
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
XShm is enabled in my patch. The random frame skipping is just to ensure the X server only has to render about half the frames it normally does so it, thus increasing how much CPU snes9x gets. Making it random was just a gimmick so that regularized patterns wouldn't look funny. I just wanted to speed up the turbo function.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I combined my patch, Dehacked's patch and FabianX's patch and updated the instructions at the ConvertingSMVToAVIInLinux page. The patch now has these features, when compared to the standard WIP-1.43 version: - display frame numbers (hotkey and commandline option) - toggle movie recording state - display pressed keys (hotkey and commandline option) - display movie info (commandline option) - skip number of frames - automatically start playing a movie (commandline option) - automatically quit emulator after given number frames (commandline option) - movie recording asks for number of players - movie recording asks whether reset / savestate is wanted - movie recording allows cancelling - video stream writing to a pipe (commandline option) - audio stream writing to a pipe (commandline option) - emulator no longer gets confused (speedwise) from pausing Also Dehacked's patch concerning joystick buttons was incorporated. The audio/video stream recording option allows for a shell command where the audio/video data will be piped to. The defaults are set as to write raw audio to s.log and ffv1-compressed lossless video to test0.avi - but it will not be done unless activated. The keys are configured as follows:
        // player 1: tr,tl, x,a
        Define(PLAYING_KEY, 0x00000010, XK_z, XK_w, XK_b);
        Define(PLAYING_KEY, 0x00000020, XK_a, XK_q, XK_v);
        Define(PLAYING_KEY, 0x00000040, XK_s, XK_e, XK_m);
        Define(PLAYING_KEY, 0x00000080, XK_d, XK_t, XK_period);
        // player 1: right,left,down,up
        Define(PLAYING_KEY, 0x00000100, XK_k, XK_Right);
        Define(PLAYING_KEY, 0x00000200, XK_h, XK_Left);
        Define(PLAYING_KEY, 0x00000400, XK_j, XK_n, XK_Down);
        Define(PLAYING_KEY, 0x00000800, XK_u, XK_Up);
        // player 1: start,select, y,b
        Define(PLAYING_KEY, 0x00001000, XK_Return);
        Define(PLAYING_KEY, 0x00002000, XK_space);
        Define(PLAYING_KEY, 0x00004000, XK_x, XK_r, XK_comma);
        Define(PLAYING_KEY, 0x00008000, XK_y, XK_c);
        // player 2: tr,tl, x,a
        Define(PLAYING_KEY, 0x00100000, XK_Delete);
        Define(PLAYING_KEY, 0x00200000, XK_Insert);
        Define(PLAYING_KEY, 0x00400000, XK_Home);  
        Define(PLAYING_KEY, 0x00800000, XK_Prior);
        // player 2: right,left,down,up
        Define(PLAYING_KEY, 0x01000000, XK_KP_4);
        Define(PLAYING_KEY, 0x02000000, XK_KP_6);
        Define(PLAYING_KEY, 0x04000000, XK_KP_2);
        Define(PLAYING_KEY, 0x08000000, XK_KP_8);
        // player 2: start,select,y,b
        Define(PLAYING_KEY, 0x10000000, XK_KP_Enter);
        Define(PLAYING_KEY, 0x20000000, XK_KP_Add);  
        Define(PLAYING_KEY, 0x40000000, XK_End);   
        Define(PLAYING_KEY, 0x80000000, XK_Next);
        // toggle sound channels
        // Careful: alt + f-keys might be bound to the window manager!
        Define(TOGGLE_SOUND, 0,         Alt(XK_F4), Ctrl(XK_F4));     
        Define(TOGGLE_SOUND, 1,         Alt(XK_F5), Ctrl(XK_F5));  
        Define(TOGGLE_SOUND, 2,         Alt(XK_F6), Ctrl(XK_F6));  
        Define(TOGGLE_SOUND, 3,         Alt(XK_F7), Ctrl(XK_F7));  
        Define(TOGGLE_SOUND, 4,         Alt(XK_F8), Ctrl(XK_F8));  
        Define(TOGGLE_SOUND, 5,         Alt(XK_F9), Ctrl(XK_F9));  
        Define(TOGGLE_SOUND, 6,         Alt(XK_F10), Ctrl(XK_F10));
        Define(TOGGLE_SOUND, 7,         Alt(XK_F11), Ctrl(XK_F11));
        // re-enable all sound channels
        Define(TOGGLE_SOUND, 8,         Alt(XK_F12), Ctrl(XK_F12));
        // numbered quicksaves
        Define(WRITE_SAVE_NUM, 0,       XK_F1);
        Define(WRITE_SAVE_NUM, 1,       XK_F2);
        Define(WRITE_SAVE_NUM, 2,       XK_F3);
        Define(WRITE_SAVE_NUM, 3,       XK_F4);
        Define(WRITE_SAVE_NUM, 4,       XK_F5);
        Define(WRITE_SAVE_NUM, 5,       XK_F6);
        Define(WRITE_SAVE_NUM, 6,       XK_F7);
        Define(WRITE_SAVE_NUM, 7,       XK_F8);
        Define(WRITE_SAVE_NUM, 8,       XK_F9);
        Define(WRITE_SAVE_NUM, 9,       XK_F10);
        Define(LOAD_SAVE_NUM, 0,       Shift(XK_F1));
        Define(LOAD_SAVE_NUM, 1,       Shift(XK_F2));
        Define(LOAD_SAVE_NUM, 2,       Shift(XK_F3));
        Define(LOAD_SAVE_NUM, 3,       Shift(XK_F4));
        Define(LOAD_SAVE_NUM, 4,       Shift(XK_F5));
        Define(LOAD_SAVE_NUM, 5,       Shift(XK_F6));
        Define(LOAD_SAVE_NUM, 6,       Shift(XK_F7));
        Define(LOAD_SAVE_NUM, 7,       Shift(XK_F8));
        Define(LOAD_SAVE_NUM, 8,       Shift(XK_F9));
        Define(LOAD_SAVE_NUM, 9,       Shift(XK_F10));
        // layer toggles
        Define(TOGGLE_LAYER,  0,       XK_1);
        Define(TOGGLE_LAYER,  1,       XK_2);
        Define(TOGGLE_LAYER,  2,       XK_3);
        Define(TOGGLE_LAYER,  3,       XK_4);
        // sprite layer toggle
        Define(TOGGLE_LAYER,  4,       XK_5);
        // named saves
        Define(LOAD_SAVE_ASK,  0,      Alt(XK_F2), Ctrl(XK_F2), XK_F11);
        Define(WRITE_SAVE_ASK, 0,      Alt(XK_F3), Ctrl(XK_F3), XK_F12);
        Define(WRITE_SPC_ASK, 0,       Alt(XK_F1), Ctrl(XK_F1));
        // timings
        Define(FRAMETIME_INC, 0,       Shift(XK_equal), Shift(XK_plus));
        Define(FRAMETIME_DEC, 0,       Shift(XK_minus));
        Define(FRAMESKIP_INC, 0,       XK_equal, XK_plus);
        Define(FRAMESKIP_DEC, 0,       XK_minus);
        // pause
        Define(PAUSE, 0,               XK_Pause, XK_Break, XK_Scroll_Lock);
        Define(FRAME_ADVANCE, 0,       XK_backslash, Shift(XK_7));
        // misc functions
        Define(DGA_FULLSCREEN, 0,      Alt(XK_Return));
        Define(SCREENSHOT, 0,          XK_Print);
        Define(SPC7110LOG, 0,          XK_Sys_Req);
        Define(TOGGLE_HDMA, 0,         XK_0);
        Define(TOGGLE_JOYSWAP, 0,      XK_6);
        Define(TOGGLE_GL_CUBE, 0,      Shift(XK_6));
        Define(TOGGLE_BG_HACK, 0,      XK_8);
        Define(TOGGLE_TRANSP, 0,       XK_9);
        Define(TOGGLE_CLIPWIN, 0,      XK_BackSpace);
        Define(TOGGLE_CONTROLLER, 0,   XK_7);
        Define(TOGGLE_INTERPSOUND, 0,  XK_bracketleft, Alt(XK_8));
        Define(TOGGLE_SYNCSOUND, 0,    XK_bracketright, Alt(XK_9));
        Define(TOGGLE_MODE7INTERP, 0,  Shift(XK_9));
        Define(TURBO_ENABLE, 0,        XK_Tab);
        Define(SUPERSCOPE_TURBO, 0,    XK_grave, XK_asciitilde, XK_numbersign);
        Define(SUPERSCOPE_PAUSE_ENABLE, 0, XK_slash);
        // escape from fullscreen, escape from emulator
        Define(EXIT, 0,                XK_Escape);
        // movie functions
        Define(WRITE_MOVIE_ASK, 0,     Shift(XK_1));
        Define(LOAD_MOVIE_ASK, 0,      Shift(XK_2));
        Define(STOP_MOVIE, 0,          Shift(XK_3));
        Define(MOVIE_DISPLAY_FRAMES, 0,Shift(XK_4));
        Define(MOVIE_REC_STATE, 0,     Shift(XK_5));
        Define(DISPLAY_PRESSED_KEYS, 0,Shift(XK_8));
        Define(SKIP_NUMOF_FRAMES, 0,   Shift(XK_0));
There is no manual configuration of keys except for editing the source code in this version.

Locked