minimum tasedit should be working now

This commit is contained in:
zeromus 2008-06-28 22:03:59 +00:00
parent d6d2cea7cd
commit 0b1030a820
12 changed files with 434 additions and 283 deletions

View File

@ -305,48 +305,58 @@ static uint8 suborkbkeys[0x60];
void KeyboardUpdateState(void); //mbg merge 7/17/06 yech had to add this
void HandleHotkeys()
{
FCEUI_HandleEmuCommands(FCEUD_TestCommandState);
}
void FCEUD_UpdateInput()
{
int x;
int t=0;
bool joy=false,mouse=false;
KeyboardUpdateState();
UpdateJoysticks();
//UpdatePhysicalInput();
//KeyboardCommands();
FCEUI_HandleEmuCommands(FCEUD_TestCommandState);
HandleHotkeys();
{
for(x=0;x<2;x++)
for(int x=0;x<2;x++)
switch(InputType[x])
{
case SI_GAMEPAD:t|=1;break;
case SI_ARKANOID:t|=2;break;
case SI_ZAPPER:t|=2;break;
case SI_GAMEPAD: joy=true; break;
case SI_ARKANOID: mouse=true; break;
case SI_ZAPPER: mouse=true; break;
case SI_POWERPADA:
case SI_POWERPADB:powerpadbuf[x]=UpdatePPadData(x);break;
case SI_POWERPADB:
powerpadbuf[x]=UpdatePPadData(x);
break;
}
switch(InputType[2])
{
case SIFC_ARKANOID:t|=2;break;
case SIFC_SHADOW:t|=2;break;
case SIFC_FKB:if(cidisabled) UpdateFKB();break;
case SIFC_SUBORKB:if(cidisabled) UpdateSuborKB();break;
case SIFC_ARKANOID: mouse=true; break;
case SIFC_SHADOW: mouse=true; break;
case SIFC_FKB:
if(cidisabled)
UpdateFKB();
break;
case SIFC_SUBORKB:
if(cidisabled)
UpdateSuborKB();
break;
case SIFC_HYPERSHOT: UpdateHyperShot();break;
case SIFC_MAHJONG: UpdateMahjong();break;
case SIFC_QUIZKING: UpdateQuizKing();break;
case SIFC_FTRAINERB:
case SIFC_FTRAINERA: UpdateFTrainer();break;
case SIFC_TOPRIDER: UpdateTopRider();break;
case SIFC_OEKAKIDS:t|=2;break;
case SIFC_OEKAKIDS: mouse=true; break;
}
if(t&1)
if(joy)
UpdateGamepad();
if(t&2)
if(mouse)
GetMouseData(MouseData);
}
}

View File

@ -414,8 +414,24 @@ int InitJoysticks(HWND hwnd)
void SetJoystickBackgroundAccess(int background)
{
int n;
for(n=0; n<numjoysticks; n++)
}
static int background = 0;
static bool curr = false;
static void UpdateBackgroundAccess(bool on)
{
if(curr == on) return;
curr = on;
for(int n=0; n<numjoysticks; n++)
{
IDirectInputDevice7_Unacquire(Joysticks[n]);
if(background)
@ -426,4 +442,21 @@ void SetJoystickBackgroundAccess(int background)
}
}
void JoystickSetBackgroundAccessBit(int bit)
{
background |= (1<<bit);
UpdateBackgroundAccess(background != 0);
}
void JoystickClearBackgroundAccessBit(int bit)
{
background &= ~(1<<bit);
UpdateBackgroundAccess(background != 0);
}
void JoystickSetBackgroundAccess(bool on)
{
if(on)
JoystickSetBackgroundAccessBit(JOYBACKACCESS_OLDSTYLE);
else
JoystickClearBackgroundAccessBit(JOYBACKACCESS_OLDSTYLE);
}

View File

@ -1,3 +1,11 @@
#ifndef _JOYSTICK_H_
#define _JOYSTICK_H_
#include "common.h"
#include "dinput.h"
#include "input.h"
#include "joystick.h"
int InitJoysticks(HWND wnd);
int KillJoysticks(void);
@ -9,3 +17,11 @@ void JoyClearBC(ButtConfig *bc);
void UpdateJoysticks(void);
int DTestButtonJoy(ButtConfig *bc);
#define JOYBACKACCESS_OLDSTYLE 1
#define JOYBACKACCESS_TASEDIT 2
void JoystickSetBackgroundAccessBit(int bit);
void JoystickClearBackgroundAccessBit(int bit);
void JoystickSetBackgroundAccess(bool on);
#endif

View File

@ -1,22 +1,22 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* 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
*/
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* 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
*/
#include "common.h"
#include "dinput.h"
@ -30,8 +30,8 @@ static LPDIRECTINPUTDEVICE7 lpdid=0;
void KeyboardClose(void)
{
if(lpdid) IDirectInputDevice7_Unacquire(lpdid);
lpdid=0;
if(lpdid) IDirectInputDevice7_Unacquire(lpdid);
lpdid=0;
}
static unsigned int keys[256] = {0,}; // with repeat
@ -42,120 +42,120 @@ int autoHoldKey = 0, autoHoldClearKey = 0;
int ctr=0;
void KeyboardUpdateState(void)
{
unsigned char tk[256];
unsigned char tk[256];
ddrval=IDirectInputDevice7_GetDeviceState(lpdid,256,tk);
ddrval=IDirectInputDevice7_GetDeviceState(lpdid,256,tk);
// HACK because DirectInput is totally wacky about recognizing the PAUSE/BREAK key
if(GetAsyncKeyState(VK_PAUSE)) // normally this should have & 0x8000, but apparently this key is too special for that to work
tk[0xC5] = 0x80;
// HACK because DirectInput is totally wacky about recognizing the PAUSE/BREAK key
if(GetAsyncKeyState(VK_PAUSE)) // normally this should have & 0x8000, but apparently this key is too special for that to work
tk[0xC5] = 0x80;
switch(ddrval)
{
case DI_OK: //memcpy(keys,tk,256);break;
switch(ddrval)
{
extern int soundoptions;
#define SO_OLDUP 32
case DI_OK: //memcpy(keys,tk,256);break;
{
extern int soundoptions;
#define SO_OLDUP 32
extern int soundo;
extern int32 fps_scale;
int notAlternateThrottle = !(soundoptions&SO_OLDUP) && soundo && ((NoWaiting&1)?(256*16):fps_scale) >= 64;
#define KEY_REPEAT_INITIAL_DELAY ((!notAlternateThrottle) ? (16) : (64)) // must be >= 0 and <= 255
#define KEY_REPEAT_REPEATING_DELAY (6) // must be >= 1 and <= 255
#define KEY_JUST_DOWN_DURATION (4) // must be >= 1 and <= 255
extern int soundo;
extern int32 fps_scale;
int notAlternateThrottle = !(soundoptions&SO_OLDUP) && soundo && ((NoWaiting&1)?(256*16):fps_scale) >= 64;
#define KEY_REPEAT_INITIAL_DELAY ((!notAlternateThrottle) ? (16) : (64)) // must be >= 0 and <= 255
#define KEY_REPEAT_REPEATING_DELAY (6) // must be >= 1 and <= 255
#define KEY_JUST_DOWN_DURATION (4) // must be >= 1 and <= 255
for(int i = 0 ; i < 256 ; i++)
if(tk[i])
if(keys_nr[i] < 255)
keys_nr[i]++; // activate key, and count up for repeat
for(int i = 0 ; i < 256 ; i++)
if(tk[i])
if(keys_nr[i] < 255)
keys_nr[i]++; // activate key, and count up for repeat
else
keys_nr[i] = 255 - KEY_REPEAT_REPEATING_DELAY; // oscillate for repeat
else
keys_nr[i] = 255 - KEY_REPEAT_REPEATING_DELAY; // oscillate for repeat
else
keys_nr[i] = 0; // deactivate key
keys_nr[i] = 0; // deactivate key
memcpy(keys,keys_nr,256);
memcpy(keys,keys_nr,256);
// key-down detection
for(int i = 0 ; i < 256 ; i++)
if(!keys_nr[i])
{
keys_jd[i] = 0;
keys_jd_lock[i] = 0;
}
else if(keys_jd_lock[i])
{}
else if(keys_jd[i]
/*&& (i != 0x2A && i != 0x36 && i != 0x1D && i != 0x38)*/)
{
if(++keys_jd[i] > KEY_JUST_DOWN_DURATION)
// key-down detection
for(int i = 0 ; i < 256 ; i++)
if(!keys_nr[i])
{
keys_jd[i] = 0;
keys_jd_lock[i] = 1;
keys_jd_lock[i] = 0;
}
}
else
keys_jd[i] = 1;
else if(keys_jd_lock[i])
{}
else if(keys_jd[i]
/*&& (i != 0x2A && i != 0x36 && i != 0x1D && i != 0x38)*/)
{
if(++keys_jd[i] > KEY_JUST_DOWN_DURATION)
{
keys_jd[i] = 0;
keys_jd_lock[i] = 1;
}
}
else
keys_jd[i] = 1;
// key repeat
for(int i = 0 ; i < 256 ; i++)
if((int)keys[i] >= KEY_REPEAT_INITIAL_DELAY && !(keys[i]%KEY_REPEAT_REPEATING_DELAY))
keys[i] = 0;
}
break;
// key repeat
for(int i = 0 ; i < 256 ; i++)
if((int)keys[i] >= KEY_REPEAT_INITIAL_DELAY && !(keys[i]%KEY_REPEAT_REPEATING_DELAY))
keys[i] = 0;
}
break;
case DIERR_INPUTLOST:
case DIERR_NOTACQUIRED:
memset(keys,0,256);
IDirectInputDevice7_Acquire(lpdid);
break;
}
case DIERR_INPUTLOST:
case DIERR_NOTACQUIRED:
memset(keys,0,256);
IDirectInputDevice7_Acquire(lpdid);
break;
}
extern uint8 autoHoldOn, autoHoldReset;
autoHoldOn = autoHoldKey && keys[autoHoldKey] != 0;
autoHoldReset = autoHoldClearKey && keys[autoHoldClearKey] != 0;
extern uint8 autoHoldOn, autoHoldReset;
autoHoldOn = autoHoldKey && keys[autoHoldKey] != 0;
autoHoldReset = autoHoldClearKey && keys[autoHoldClearKey] != 0;
}
unsigned int *GetKeyboard(void)
{
return(keys);
return(keys);
}
unsigned int *GetKeyboard_nr(void)
{
return(keys_nr);
return(keys_nr);
}
unsigned int *GetKeyboard_jd(void)
{
return(keys_jd);
return(keys_jd);
}
int KeyboardInitialize(void)
{
if(lpdid)
return(1);
if(lpdid)
return(1);
//mbg merge 7/17/06 changed:
ddrval=IDirectInput7_CreateDeviceEx(lpDI, GUID_SysKeyboard,IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
//ddrval=IDirectInput7_CreateDeviceEx(lpDI, &GUID_SysKeyboard,&IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error creating keyboard device.");
return 0;
}
//mbg merge 7/17/06 changed:
ddrval=IDirectInput7_CreateDeviceEx(lpDI, GUID_SysKeyboard,IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
//ddrval=IDirectInput7_CreateDeviceEx(lpDI, &GUID_SysKeyboard,&IID_IDirectInputDevice7, (LPVOID *)&lpdid,0);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error creating keyboard device.");
return 0;
}
ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level.");
return 0;
}
ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level.");
return 0;
}
ddrval=IDirectInputDevice7_SetDataFormat(lpdid,&c_dfDIKeyboard);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error setting keyboard data format.");
return 0;
}
ddrval=IDirectInputDevice7_SetDataFormat(lpdid,&c_dfDIKeyboard);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error setting keyboard data format.");
return 0;
}
////--set to buffered mode
//DIPROPDWORD dipdw;
@ -168,33 +168,59 @@ int KeyboardInitialize(void)
//ddrval = IDirectInputDevice7_SetProperty(lpdid,DIPROP_BUFFERSIZE, &dipdw.diph);
////--------
ddrval=IDirectInputDevice7_Acquire(lpdid);
/* Not really a fatal error. */
//if(ddrval != DI_OK)
//{
// FCEUD_PrintError("DirectInput: Error acquiring keyboard.");
// return 0;
//}
return 1;
ddrval=IDirectInputDevice7_Acquire(lpdid);
/* Not really a fatal error. */
//if(ddrval != DI_OK)
//{
// FCEUD_PrintError("DirectInput: Error acquiring keyboard.");
// return 0;
//}
return 1;
}
int KeyboardSetBackgroundAccess(int on)
static int background = 0;
static bool curr = false;
static void UpdateBackgroundAccess(bool on)
{
if(!lpdid)
return(0);
if(curr == on) return;
ddrval=IDirectInputDevice7_Unacquire(lpdid);
curr = on;
if(!lpdid)
return;
if(on)
ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_BACKGROUND|DISCL_NONEXCLUSIVE);
else
ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level.");
return 0;
}
ddrval=IDirectInputDevice7_Unacquire(lpdid);
ddrval=IDirectInputDevice7_Acquire(lpdid);
return 1;
if(on)
ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_BACKGROUND|DISCL_NONEXCLUSIVE);
else
ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE);
if(ddrval != DI_OK)
{
FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level.");
return;
}
ddrval=IDirectInputDevice7_Acquire(lpdid);
return;
}
void KeyboardSetBackgroundAccessBit(int bit)
{
background |= (1<<bit);
UpdateBackgroundAccess(background != 0);
}
void KeyboardClearBackgroundAccessBit(int bit)
{
background &= ~(1<<bit);
UpdateBackgroundAccess(background != 0);
}
void KeyboardSetBackgroundAccess(bool on)
{
if(on)
KeyboardSetBackgroundAccessBit(KEYBACKACCESS_OLDSTYLE);
else
KeyboardClearBackgroundAccessBit(KEYBACKACCESS_OLDSTYLE);
}

View File

@ -4,4 +4,8 @@ void KeyboardUpdate(void);
unsigned int *GetKeyboard(void);
unsigned int *GetKeyboard_nr(void);
unsigned int *GetKeyboard_jd(void);
int KeyboardSetBackgroundAccess(int on);
#define KEYBACKACCESS_OLDSTYLE 1
#define KEYBACKACCESS_TASEDIT 2
void KeyboardSetBackgroundAccessBit(int bit);
void KeyboardClearBackgroundAccessBit(int bit);
void KeyboardSetBackgroundAccess(bool on);

View File

@ -316,9 +316,7 @@ char* GetKeyComboName(int c)
return text;
}
/**
* Callback function for the dialog where the user can change hotkeys.
**/
//Callback function for the dialog where the user can change hotkeys.
BOOL CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static HANDLE hThread = NULL;
@ -338,7 +336,7 @@ BOOL CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
key = 0;
memset(keyonce, 0, sizeof(keyonce));
KeyboardSetBackgroundAccess(1);
KeyboardSetBackgroundAccess(true);
SetFocus(GetDlgItem(hwndDlg, LBL_KEY_COMBO));
CenterWindowOnScreen(hwndDlg);
@ -388,7 +386,7 @@ BOOL CALLBACK ChangeInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
case WM_USER+1:
{
// Done with keyboard.
KeyboardSetBackgroundAccess(0);
KeyboardSetBackgroundAccess(false);
// Kill the thread.
SetEvent(threadargs.hThreadExit);

View File

@ -1266,7 +1266,8 @@ MENU TASEDITMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,7,273,296
PUSHBUTTON "Hacky truncate after current frame",IDC_HACKY1,313,31,124,38
PUSHBUTTON "Hacky truncate after current frame",IDC_HACKY1,312,7,124,38
LTEXT "I think this will prove useful enough for a hotkey at some point",IDC_STATIC,312,46,125,16
END
ASSEMBLER DIALOGEX 0, 0, 202, 135

View File

@ -9,7 +9,8 @@
#include "movie.h"
#include "utils/xstring.h"
#include "Win32InputBox.h"
#include "keyboard.h"
#include "joystick.h"
using namespace std;
@ -21,7 +22,7 @@ HWND hwndTasEdit = 0;
static HMENU hmenu, hrmenu;
static int lastCursor;
static HWND hwndList, hwndHeader;
static WNDPROC hwndHeader_oldWndproc;
static WNDPROC hwndHeader_oldWndproc, hwndList_oldWndProc;
typedef std::set<int> TSelectionFrames;
static TSelectionFrames selectionFrames;
@ -101,21 +102,31 @@ void UpdateTasEdit()
if(!hwndTasEdit) return;
//update the number of items
ListView_SetItemCountEx(hwndList,currMovieData.getNumRecords(),LVSICF_NOSCROLL | LVSICF_NOINVALIDATEALL);
int currLVItemCount = ListView_GetItemCount(hwndList);
if(currMovieData.getNumRecords() != currLVItemCount)
{
ListView_SetItemCountEx(hwndList,currMovieData.getNumRecords(),LVSICF_NOSCROLL | LVSICF_NOINVALIDATEALL);
}
//update the cursor
int newCursor = currFrameCounter;
if(newCursor != lastCursor)
{
//unselect all prior rows
TSelectionFrames oldSelected = selectionFrames;
for(TSelectionFrames::iterator it(oldSelected.begin()); it != oldSelected.end(); it++)
ListView_SetItemState(hwndList,*it,0, LVIS_FOCUSED|LVIS_SELECTED);
//scroll to the row
ListView_EnsureVisible(hwndList,newCursor,FALSE);
//select the row
ListView_SetItemState(hwndList,lastCursor,0, LVIS_FOCUSED|LVIS_SELECTED);
ListView_SetItemState(hwndList,newCursor,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
//update the old and new rows
ListView_Update(hwndList,lastCursor);
ListView_Update(hwndList,newCursor);
ListView_Update(hwndList,lastCursor);
for(TSelectionFrames::iterator it(oldSelected.begin()); it != oldSelected.end(); it++)
ListView_Update(hwndList,*it);
lastCursor = newCursor;
}
@ -310,6 +321,17 @@ static LRESULT APIENTRY HeaderWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lP
return CallWindowProc(hwndHeader_oldWndproc,hWnd,msg,wParam,lParam);
}
//The subclass wndproc for the listview
static LRESULT APIENTRY ListWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
case WM_CHAR:
return 0;
}
return CallWindowProc(hwndList_oldWndProc,hWnd,msg,wParam,lParam);
}
//All dialog initialization
static void InitDialog()
{
@ -322,6 +344,8 @@ static void InitDialog()
hwndHeader = ListView_GetHeader(hwndList);
hwndHeader_oldWndproc = (WNDPROC)SetWindowLong(hwndHeader,GWL_WNDPROC,(LONG)HeaderWndProc);
//subclass the whole listview, so we can block some keystrokes
hwndList_oldWndProc = (WNDPROC)SetWindowLong(hwndList,GWL_WNDPROC,(LONG)ListWndProc);
//setup all images for the listview
HIMAGELIST himglist = ImageList_Create(12,12,ILC_COLOR32 | ILC_MASK,1,1);
@ -502,6 +526,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case IDC_HACKY1:
//hacky1: delete all items after the current selection
currMovieData.records.resize(currFrameCounter+1);
InvalidateGreenZone(currFrameCounter);
UpdateTasEdit();
break;
@ -542,6 +567,8 @@ void DoTasEdit()
if(hwndTasEdit)
{
KeyboardSetBackgroundAccessBit(KEYBACKACCESS_TASEDIT);
JoystickSetBackgroundAccessBit(JOYBACKACCESS_TASEDIT);
FCEUMOV_EnterTasEdit();
SetWindowPos(hwndTasEdit,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
}

View File

@ -45,6 +45,8 @@
#include "throttle.h"
#include "monitor.h"
#include "tasedit.h"
#include "keyboard.h"
#include "joystick.h"
#include "oldmovie.h"
#include "movie.h"
#include "7zip.h"
@ -72,8 +74,6 @@ char *md5_asciistr(uint8 digest[16]);
void SetAutoFirePattern(int onframes, int offframes);
void SetAutoFireOffset(int offset);
int KeyboardSetBackgroundAccess(int on); //mbg merge 7/17/06 YECH had to add
void SetJoystickBackgroundAccess(int background); //mbg merge 7/17/06 YECH had to add
void ShowNetplayConsole(void); //mbg merge 7/17/06 YECH had to add
void DoPPUView();//mbg merge 7/19/06 yech had to add
@ -935,8 +935,8 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
if((eoptions & EO_BGRUN) == 0)
{
EnableBackgroundInput = 0;
KeyboardSetBackgroundAccess(EnableBackgroundInput);
SetJoystickBackgroundAccess(EnableBackgroundInput);
KeyboardSetBackgroundAccess(EnableBackgroundInput!=0);
JoystickSetBackgroundAccess(EnableBackgroundInput!=0);
}
UpdateCheckedMenuItems();
@ -947,8 +947,8 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
// TODO: Does this even work?
EnableBackgroundInput ^= 1;
eoptions |= EO_BGRUN * EnableBackgroundInput;
KeyboardSetBackgroundAccess(EnableBackgroundInput);
SetJoystickBackgroundAccess(EnableBackgroundInput);
KeyboardSetBackgroundAccess(EnableBackgroundInput!=0);
JoystickSetBackgroundAccess(EnableBackgroundInput!=0);
UpdateCheckedMenuItems();
break;

View File

@ -620,129 +620,129 @@ static void ViewSlots(void);
struct EMUCMDTABLE FCEUI_CommandTable[]=
{
{ EMUCMD_POWER, EMUCMDTYPE_MISC, FCEUI_PowerNES, 0, 0, "Power", },
{ EMUCMD_RESET, EMUCMDTYPE_MISC, FCEUI_ResetNES, 0, 0, "Reset", },
{ EMUCMD_PAUSE, EMUCMDTYPE_MISC, FCEUI_ToggleEmulationPause, 0, 0, "Pause", },
{ EMUCMD_FRAME_ADVANCE, EMUCMDTYPE_MISC, FCEUI_FrameAdvance, FCEUI_FrameAdvanceEnd, 0, "Frame Advance", },
{ EMUCMD_SCREENSHOT, EMUCMDTYPE_MISC, FCEUI_SaveSnapshot, 0, 0, "Screenshot", },
{ EMUCMD_HIDE_MENU_TOGGLE, EMUCMDTYPE_MISC, FCEUD_HideMenuToggle, 0, 0, "Hide Menu Toggle", },
{ EMUCMD_POWER, EMUCMDTYPE_MISC, FCEUI_PowerNES, 0, 0, "Power", 0 },
{ EMUCMD_RESET, EMUCMDTYPE_MISC, FCEUI_ResetNES, 0, 0, "Reset", 0 },
{ EMUCMD_PAUSE, EMUCMDTYPE_MISC, FCEUI_ToggleEmulationPause, 0, 0, "Pause", EMUCMDFLAG_TASEDIT },
{ EMUCMD_FRAME_ADVANCE, EMUCMDTYPE_MISC, FCEUI_FrameAdvance, FCEUI_FrameAdvanceEnd, 0, "Frame Advance", EMUCMDFLAG_TASEDIT },
{ EMUCMD_SCREENSHOT, EMUCMDTYPE_MISC, FCEUI_SaveSnapshot, 0, 0, "Screenshot", EMUCMDFLAG_TASEDIT },
{ EMUCMD_HIDE_MENU_TOGGLE, EMUCMDTYPE_MISC, FCEUD_HideMenuToggle, 0, 0, "Hide Menu Toggle", EMUCMDFLAG_TASEDIT },
{ EMUCMD_SPEED_SLOWEST, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Slowest Speed", },
{ EMUCMD_SPEED_SLOWER, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Speed Down", },
{ EMUCMD_SPEED_NORMAL, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Normal Speed", },
{ EMUCMD_SPEED_FASTER, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Speed Up", },
{ EMUCMD_SPEED_FASTEST, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Fastest Speed", },
{ EMUCMD_SPEED_TURBO, EMUCMDTYPE_SPEED, FCEUD_TurboOn, FCEUD_TurboOff, 0, "Turbo", },
{ EMUCMD_SPEED_TURBO_TOGGLE, EMUCMDTYPE_SPEED, FCEUD_TurboToggle, 0, 0, "Turbo Toggle", },
{ EMUCMD_SPEED_SLOWEST, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Slowest Speed", 0 },
{ EMUCMD_SPEED_SLOWER, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Speed Down", 0 },
{ EMUCMD_SPEED_NORMAL, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Normal Speed", 0 },
{ EMUCMD_SPEED_FASTER, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Speed Up", 0 },
{ EMUCMD_SPEED_FASTEST, EMUCMDTYPE_SPEED, CommandEmulationSpeed, 0, 0, "Fastest Speed", 0 },
{ EMUCMD_SPEED_TURBO, EMUCMDTYPE_SPEED, FCEUD_TurboOn, FCEUD_TurboOff, 0, "Turbo", 0 },
{ EMUCMD_SPEED_TURBO_TOGGLE, EMUCMDTYPE_SPEED, FCEUD_TurboToggle, 0, 0, "Turbo Toggle", 0 },
{ EMUCMD_SAVE_SLOT_0, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 0", },
{ EMUCMD_SAVE_SLOT_1, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 1", },
{ EMUCMD_SAVE_SLOT_2, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 2", },
{ EMUCMD_SAVE_SLOT_3, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 3", },
{ EMUCMD_SAVE_SLOT_4, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 4", },
{ EMUCMD_SAVE_SLOT_5, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 5", },
{ EMUCMD_SAVE_SLOT_6, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 6", },
{ EMUCMD_SAVE_SLOT_7, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 7", },
{ EMUCMD_SAVE_SLOT_8, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 8", },
{ EMUCMD_SAVE_SLOT_9, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 9", },
{ EMUCMD_SAVE_SLOT_NEXT, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Next Savestate Slot", },
{ EMUCMD_SAVE_SLOT_PREV, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Previous Savestate Slot", },
{ EMUCMD_SAVE_STATE, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State", },
{ EMUCMD_SAVE_STATE_AS, EMUCMDTYPE_STATE, FCEUD_SaveStateAs, 0, 0, "Save State As...", },
{ EMUCMD_SAVE_STATE_SLOT_0, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 0", },
{ EMUCMD_SAVE_STATE_SLOT_1, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 1", },
{ EMUCMD_SAVE_STATE_SLOT_2, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 2", },
{ EMUCMD_SAVE_STATE_SLOT_3, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 3", },
{ EMUCMD_SAVE_STATE_SLOT_4, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 4", },
{ EMUCMD_SAVE_STATE_SLOT_5, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 5", },
{ EMUCMD_SAVE_STATE_SLOT_6, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 6", },
{ EMUCMD_SAVE_STATE_SLOT_7, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 7", },
{ EMUCMD_SAVE_STATE_SLOT_8, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 8", },
{ EMUCMD_SAVE_STATE_SLOT_9, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 9", },
{ EMUCMD_LOAD_STATE, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State", },
{ EMUCMD_LOAD_STATE_FROM, EMUCMDTYPE_STATE, FCEUD_LoadStateFrom, 0, 0, "Load State From...", },
{ EMUCMD_LOAD_STATE_SLOT_0, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 0", },
{ EMUCMD_LOAD_STATE_SLOT_1, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 1", },
{ EMUCMD_LOAD_STATE_SLOT_2, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 2", },
{ EMUCMD_LOAD_STATE_SLOT_3, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 3", },
{ EMUCMD_LOAD_STATE_SLOT_4, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 4", },
{ EMUCMD_LOAD_STATE_SLOT_5, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 5", },
{ EMUCMD_LOAD_STATE_SLOT_6, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 6", },
{ EMUCMD_LOAD_STATE_SLOT_7, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 7", },
{ EMUCMD_LOAD_STATE_SLOT_8, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 8", },
{ EMUCMD_LOAD_STATE_SLOT_9, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 9", },
{ EMUCMD_SAVE_SLOT_0, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 0", 0 },
{ EMUCMD_SAVE_SLOT_1, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 1", 0 },
{ EMUCMD_SAVE_SLOT_2, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 2", 0 },
{ EMUCMD_SAVE_SLOT_3, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 3", 0 },
{ EMUCMD_SAVE_SLOT_4, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 4", 0 },
{ EMUCMD_SAVE_SLOT_5, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 5", 0 },
{ EMUCMD_SAVE_SLOT_6, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 6", 0 },
{ EMUCMD_SAVE_SLOT_7, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 7", 0 },
{ EMUCMD_SAVE_SLOT_8, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 8", 0 },
{ EMUCMD_SAVE_SLOT_9, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Savestate Slot 9", 0 },
{ EMUCMD_SAVE_SLOT_NEXT, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Next Savestate Slot", 0 },
{ EMUCMD_SAVE_SLOT_PREV, EMUCMDTYPE_STATE, CommandSelectSaveSlot, 0, 0, "Previous Savestate Slot", 0 },
{ EMUCMD_SAVE_STATE, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State", 0 },
{ EMUCMD_SAVE_STATE_AS, EMUCMDTYPE_STATE, FCEUD_SaveStateAs, 0, 0, "Save State As...", 0 },
{ EMUCMD_SAVE_STATE_SLOT_0, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 0", 0 },
{ EMUCMD_SAVE_STATE_SLOT_1, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 1", 0 },
{ EMUCMD_SAVE_STATE_SLOT_2, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 2", 0 },
{ EMUCMD_SAVE_STATE_SLOT_3, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 3", 0 },
{ EMUCMD_SAVE_STATE_SLOT_4, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 4", 0 },
{ EMUCMD_SAVE_STATE_SLOT_5, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 5", 0 },
{ EMUCMD_SAVE_STATE_SLOT_6, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 6", 0 },
{ EMUCMD_SAVE_STATE_SLOT_7, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 7", 0 },
{ EMUCMD_SAVE_STATE_SLOT_8, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 8", 0 },
{ EMUCMD_SAVE_STATE_SLOT_9, EMUCMDTYPE_STATE, CommandStateSave, 0, 0, "Save State to Slot 9", 0 },
{ EMUCMD_LOAD_STATE, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State", 0 },
{ EMUCMD_LOAD_STATE_FROM, EMUCMDTYPE_STATE, FCEUD_LoadStateFrom, 0, 0, "Load State From...", 0 },
{ EMUCMD_LOAD_STATE_SLOT_0, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 0", 0 },
{ EMUCMD_LOAD_STATE_SLOT_1, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 1", 0 },
{ EMUCMD_LOAD_STATE_SLOT_2, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 2", 0 },
{ EMUCMD_LOAD_STATE_SLOT_3, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 3", 0 },
{ EMUCMD_LOAD_STATE_SLOT_4, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 4", 0 },
{ EMUCMD_LOAD_STATE_SLOT_5, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 5", 0 },
{ EMUCMD_LOAD_STATE_SLOT_6, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 6", 0 },
{ EMUCMD_LOAD_STATE_SLOT_7, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 7", 0 },
{ EMUCMD_LOAD_STATE_SLOT_8, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 8", 0 },
{ EMUCMD_LOAD_STATE_SLOT_9, EMUCMDTYPE_STATE, CommandStateLoad, 0, 0, "Load State from Slot 9", 0 },
/* { EMUCMD_MOVIE_SLOT_0, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 0", },
{ EMUCMD_MOVIE_SLOT_1, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 1", },
{ EMUCMD_MOVIE_SLOT_2, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 2", },
{ EMUCMD_MOVIE_SLOT_3, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 3", },
{ EMUCMD_MOVIE_SLOT_4, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 4", },
{ EMUCMD_MOVIE_SLOT_5, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 5", },
{ EMUCMD_MOVIE_SLOT_6, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 6", },
{ EMUCMD_MOVIE_SLOT_7, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 7", },
{ EMUCMD_MOVIE_SLOT_8, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 8", },
{ EMUCMD_MOVIE_SLOT_9, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 9", },
{ EMUCMD_MOVIE_SLOT_NEXT, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Next Movie Slot", },
{ EMUCMD_MOVIE_SLOT_PREV, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Previous Movie Slot", },
{ EMUCMD_MOVIE_RECORD, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie", },*/
{ EMUCMD_MOVIE_RECORD_TO, EMUCMDTYPE_MOVIE, FCEUD_MovieRecordTo, 0, 0, "Record Movie To...", },
/* { EMUCMD_MOVIE_RECORD_SLOT_0, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 0", },
{ EMUCMD_MOVIE_RECORD_SLOT_1, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 1", },
{ EMUCMD_MOVIE_RECORD_SLOT_2, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 2", },
{ EMUCMD_MOVIE_RECORD_SLOT_3, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 3", },
{ EMUCMD_MOVIE_RECORD_SLOT_4, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 4", },
{ EMUCMD_MOVIE_RECORD_SLOT_5, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 5", },
{ EMUCMD_MOVIE_RECORD_SLOT_6, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 6", },
{ EMUCMD_MOVIE_RECORD_SLOT_7, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 7", },
{ EMUCMD_MOVIE_RECORD_SLOT_8, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 8", },
{ EMUCMD_MOVIE_RECORD_SLOT_9, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 9", },
/* { EMUCMD_MOVIE_SLOT_0, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 0", 0 },
{ EMUCMD_MOVIE_SLOT_1, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 1", 0 },
{ EMUCMD_MOVIE_SLOT_2, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 2", 0 },
{ EMUCMD_MOVIE_SLOT_3, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 3", 0 },
{ EMUCMD_MOVIE_SLOT_4, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 4", 0 },
{ EMUCMD_MOVIE_SLOT_5, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 5", 0 },
{ EMUCMD_MOVIE_SLOT_6, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 6", 0 },
{ EMUCMD_MOVIE_SLOT_7, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 7", 0 },
{ EMUCMD_MOVIE_SLOT_8, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 8", 0 },
{ EMUCMD_MOVIE_SLOT_9, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Movie Slot 9", 0 },
{ EMUCMD_MOVIE_SLOT_NEXT, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Next Movie Slot", 0 },
{ EMUCMD_MOVIE_SLOT_PREV, EMUCMDTYPE_MOVIE, CommandMovieSelectSlot, 0, 0, "Previous Movie Slot", 0 },
{ EMUCMD_MOVIE_RECORD, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie", 0 },*/
{ EMUCMD_MOVIE_RECORD_TO, EMUCMDTYPE_MOVIE, FCEUD_MovieRecordTo, 0, 0, "Record Movie To...",0 },
/* { EMUCMD_MOVIE_RECORD_SLOT_0, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 0", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_1, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 1",0 },
{ EMUCMD_MOVIE_RECORD_SLOT_2, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 2", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_3, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 3", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_4, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 4", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_5, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 5", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_6, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 6", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_7, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 7", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_8, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 8", 0 },
{ EMUCMD_MOVIE_RECORD_SLOT_9, EMUCMDTYPE_MOVIE, CommandMovieRecord, 0, 0, "Record Movie to Slot 9", 0 },
{ EMUCMD_MOVIE_REPLAY, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie", },*/
{ EMUCMD_MOVIE_REPLAY_FROM, EMUCMDTYPE_MOVIE, FCEUD_MovieReplayFrom, 0, 0, "Replay Movie From...", },
/* { EMUCMD_MOVIE_REPLAY_SLOT_0, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 0", },
{ EMUCMD_MOVIE_REPLAY_SLOT_1, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 1", },
{ EMUCMD_MOVIE_REPLAY_SLOT_2, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 2", },
{ EMUCMD_MOVIE_REPLAY_SLOT_3, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 3", },
{ EMUCMD_MOVIE_REPLAY_SLOT_4, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 4", },
{ EMUCMD_MOVIE_REPLAY_SLOT_5, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 5", },
{ EMUCMD_MOVIE_REPLAY_SLOT_6, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 6", },
{ EMUCMD_MOVIE_REPLAY_SLOT_7, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 7", },
{ EMUCMD_MOVIE_REPLAY_SLOT_8, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 8", },
{ EMUCMD_MOVIE_REPLAY_SLOT_9, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 9", },
/* { EMUCMD_MOVIE_REPLAY_SLOT_0, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 0", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_1, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 1", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_2, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 2", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_3, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 3", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_4, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 4", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_5, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 5", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_6, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 6", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_7, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 7", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_8, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 8", 0 },
{ EMUCMD_MOVIE_REPLAY_SLOT_9, EMUCMDTYPE_MOVIE, CommandMovieReplay, 0, 0, "Replay Movie from Slot 9", 0 },
*/
{ EMUCMD_MOVIE_PLAY_FROM_BEGINNING, EMUCMDTYPE_MOVIE, FCEUI_MoviePlayFromBeginning, 0, 0, "Play Movie From Beginning", },
{ EMUCMD_MOVIE_STOP, EMUCMDTYPE_MOVIE, FCEUI_StopMovie, 0, 0, "Stop Movie", },
{ EMUCMD_MOVIE_READONLY_TOGGLE, EMUCMDTYPE_MOVIE, FCEUI_MovieToggleReadOnly, 0, 0, "Toggle Read-Only", },
{ EMUCMD_MOVIE_FRAME_DISPLAY_TOGGLE, EMUCMDTYPE_MOVIE, FCEUI_MovieToggleFrameDisplay, 0, 0, "Movie Frame Display Toggle", },
{ EMUCMD_MOVIE_INPUT_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUI_ToggleInputDisplay, 0, 0, "Toggle Input Display", },
{ EMUCMD_MOVIE_ICON_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUD_ToggleStatusIcon, 0, 0, "Toggle Status Icon", },
{ EMUCMD_MOVIE_PLAY_FROM_BEGINNING, EMUCMDTYPE_MOVIE, FCEUI_MoviePlayFromBeginning, 0, 0, "Play Movie From Beginning", 0 },
{ EMUCMD_MOVIE_STOP, EMUCMDTYPE_MOVIE, FCEUI_StopMovie, 0, 0, "Stop Movie", 0 },
{ EMUCMD_MOVIE_READONLY_TOGGLE, EMUCMDTYPE_MOVIE, FCEUI_MovieToggleReadOnly, 0, 0, "Toggle Read-Only", EMUCMDFLAG_TASEDIT },
{ EMUCMD_MOVIE_FRAME_DISPLAY_TOGGLE, EMUCMDTYPE_MOVIE, FCEUI_MovieToggleFrameDisplay, 0, 0, "Movie Frame Display Toggle", 0 },
{ EMUCMD_MOVIE_INPUT_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUI_ToggleInputDisplay, 0, 0, "Toggle Input Display", 0 },
{ EMUCMD_MOVIE_ICON_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUD_ToggleStatusIcon, 0, 0, "Toggle Status Icon", 0 },
{ EMUCMD_SOUND_TOGGLE, EMUCMDTYPE_SOUND, FCEUD_SoundToggle, 0, 0, "Sound Mute Toggle", },
{ EMUCMD_SOUND_VOLUME_UP, EMUCMDTYPE_SOUND, CommandSoundAdjust, 0, 0, "Sound Volume Up", },
{ EMUCMD_SOUND_VOLUME_DOWN, EMUCMDTYPE_SOUND, CommandSoundAdjust, 0, 0, "Sound Volume Down", },
{ EMUCMD_SOUND_VOLUME_NORMAL, EMUCMDTYPE_SOUND, CommandSoundAdjust, 0, 0, "Sound Volume Normal", },
{ EMUCMD_SOUND_TOGGLE, EMUCMDTYPE_SOUND, FCEUD_SoundToggle, 0, 0, "Sound Mute Toggle", EMUCMDFLAG_TASEDIT },
{ EMUCMD_SOUND_VOLUME_UP, EMUCMDTYPE_SOUND, CommandSoundAdjust, 0, 0, "Sound Volume Up", EMUCMDFLAG_TASEDIT },
{ EMUCMD_SOUND_VOLUME_DOWN, EMUCMDTYPE_SOUND, CommandSoundAdjust, 0, 0, "Sound Volume Down", EMUCMDFLAG_TASEDIT },
{ EMUCMD_SOUND_VOLUME_NORMAL, EMUCMDTYPE_SOUND, CommandSoundAdjust, 0, 0, "Sound Volume Normal", EMUCMDFLAG_TASEDIT },
{ EMUCMD_AVI_RECORD_AS, EMUCMDTYPE_AVI, FCEUD_AviRecordTo, 0, 0, "Record AVI As...", },
{ EMUCMD_AVI_STOP, EMUCMDTYPE_AVI, FCEUD_AviStop, 0, 0, "Stop AVI", },
{ EMUCMD_AVI_RECORD_AS, EMUCMDTYPE_AVI, FCEUD_AviRecordTo, 0, 0, "Record AVI As...", 0 },
{ EMUCMD_AVI_STOP, EMUCMDTYPE_AVI, FCEUD_AviStop, 0, 0, "Stop AVI", 0 },
{ EMUCMD_FDS_EJECT_INSERT, EMUCMDTYPE_FDS, FCEUI_FDSInsert, 0, 0, "Eject or Insert FDS Disk", },
{ EMUCMD_FDS_SIDE_SELECT, EMUCMDTYPE_FDS, FCEUI_FDSSelect, 0, 0, "Switch FDS Disk Side", },
{ EMUCMD_FDS_EJECT_INSERT, EMUCMDTYPE_FDS, FCEUI_FDSInsert, 0, 0, "Eject or Insert FDS Disk", 0 },
{ EMUCMD_FDS_SIDE_SELECT, EMUCMDTYPE_FDS, FCEUI_FDSSelect, 0, 0, "Switch FDS Disk Side", 0 },
{ EMUCMD_VSUNI_COIN, EMUCMDTYPE_VSUNI, FCEUI_VSUniCoin, 0, 0, "Insert Coin", },
{ EMUCMD_VSUNI_TOGGLE_DIP_0, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 0", },
{ EMUCMD_VSUNI_TOGGLE_DIP_1, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 1", },
{ EMUCMD_VSUNI_TOGGLE_DIP_2, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 2", },
{ EMUCMD_VSUNI_TOGGLE_DIP_3, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 3", },
{ EMUCMD_VSUNI_TOGGLE_DIP_4, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 4", },
{ EMUCMD_VSUNI_TOGGLE_DIP_5, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 5", },
{ EMUCMD_VSUNI_TOGGLE_DIP_6, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 6", },
{ EMUCMD_VSUNI_TOGGLE_DIP_7, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 7", },
{ EMUCMD_VSUNI_TOGGLE_DIP_8, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 8", },
{ EMUCMD_VSUNI_TOGGLE_DIP_9, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 9", },
{ EMUCMD_MISC_AUTOSAVE, EMUCMDTYPE_MISC, FCEUI_Autosave, 0, 0, "Auto-save", },
{ EMUCMD_MISC_SHOWSTATES, EMUCMDTYPE_MISC, ViewSlots, 0,0, "View save slots", },
{ EMUCMD_MISC_USE_INPUT_PRESET_1, EMUCMDTYPE_MISC, CommandUsePreset, 0,0, "Use Input Preset 1", },
{ EMUCMD_MISC_USE_INPUT_PRESET_2, EMUCMDTYPE_MISC, CommandUsePreset, 0,0, "Use Input Preset 2", },
{ EMUCMD_MISC_USE_INPUT_PRESET_3, EMUCMDTYPE_MISC, CommandUsePreset, 0,0, "Use Input Preset 3", },
{ EMUCMD_VSUNI_COIN, EMUCMDTYPE_VSUNI, FCEUI_VSUniCoin, 0, 0, "Insert Coin", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_0, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 0", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_1, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 1", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_2, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 2", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_3, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 3", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_4, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 4", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_5, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 5", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_6, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 6", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_7, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 7", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_8, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 8", 0 },
{ EMUCMD_VSUNI_TOGGLE_DIP_9, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 9", 0 },
{ EMUCMD_MISC_AUTOSAVE, EMUCMDTYPE_MISC, FCEUI_Autosave, 0, 0, "Auto-save", 0 },
{ EMUCMD_MISC_SHOWSTATES, EMUCMDTYPE_MISC, ViewSlots, 0,0, "View save slots",0 },
{ EMUCMD_MISC_USE_INPUT_PRESET_1, EMUCMDTYPE_MISC, CommandUsePreset, 0,0, "Use Input Preset 1", 0 },
{ EMUCMD_MISC_USE_INPUT_PRESET_2, EMUCMDTYPE_MISC, CommandUsePreset, 0,0, "Use Input Preset 2", 0 },
{ EMUCMD_MISC_USE_INPUT_PRESET_3, EMUCMDTYPE_MISC, CommandUsePreset, 0,0, "Use Input Preset 3", 0 },
};
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
@ -751,14 +751,23 @@ static int execcmd;
void FCEUI_HandleEmuCommands(TestCommandState* testfn)
{
bool tasedit = FCEUMOV_Mode(MOVIEMODE_TASEDIT);
for(execcmd=0; execcmd<NUM_EMU_CMDS; ++execcmd)
{
int new_state = (*testfn)(execcmd);
int old_state = FCEUI_CommandTable[execcmd].state;
if (new_state == 1 && old_state == 0 && FCEUI_CommandTable[execcmd].fn_on)
(*(FCEUI_CommandTable[execcmd].fn_on))();
else if (new_state == 0 && old_state == 1 && FCEUI_CommandTable[execcmd].fn_off)
(*(FCEUI_CommandTable[execcmd].fn_off))();
//in tasedit, forbid commands without the tasedit flag
bool allow = true;
if(tasedit && !(FCEUI_CommandTable[execcmd].flags & EMUCMDFLAG_TASEDIT))
allow = false;
if(allow)
{
if (new_state == 1 && old_state == 0 && FCEUI_CommandTable[execcmd].fn_on)
(*(FCEUI_CommandTable[execcmd].fn_on))();
else if (new_state == 0 && old_state == 1 && FCEUI_CommandTable[execcmd].fn_off)
(*(FCEUI_CommandTable[execcmd].fn_off))();
}
FCEUI_CommandTable[execcmd].state = new_state;
}
}

View File

@ -248,6 +248,12 @@ extern const char* FCEUI_CommandTypeNames[];
typedef void EMUCMDFN(void);
enum EMUCMDFLAG
{
EMUCMDFLAG_NONE = 0,
EMUCMDFLAG_TASEDIT = 1,
};
struct EMUCMDTABLE
{
int cmd;
@ -256,6 +262,7 @@ struct EMUCMDTABLE
EMUCMDFN* fn_off;
int state;
char* name;
int flags; //EMUCMDFLAG
};
extern struct EMUCMDTABLE FCEUI_CommandTable[];

View File

@ -101,11 +101,13 @@ void MovieData::TryDumpIncremental()
//only log the savestate if we are appending to the green zone
if(currFrameCounter == currMovieData.greenZoneCount)
{
if(currFrameCounter < (int)currMovieData.records.size())
if(currFrameCounter == (int)currMovieData.records.size() || currMovieData.records.size()==0)
{
MovieData::dumpSavestateTo(&currMovieData.records[currFrameCounter].savestate,Z_DEFAULT_COMPRESSION);
currMovieData.greenZoneCount++;
currMovieData.insertEmpty(-1,1);
}
MovieData::dumpSavestateTo(&currMovieData.records[currFrameCounter].savestate,Z_DEFAULT_COMPRESSION);
currMovieData.greenZoneCount++;
}
}
}
@ -626,7 +628,6 @@ void FCEUMOV_EnterTasEdit()
currMovieData.palFlag = FCEUI_GetCurrentVidSystem(0,0)!=0;
currMovieData.romChecksum = GameInfo->MD5;
currMovieData.romFilename = FileBase;
currMovieData.insertEmpty(0,1);
//reset the rom
poweron(false);
@ -797,7 +798,26 @@ void FCEUMOV_AddInputState()
//(input recording is just like standard read+write movie recording with input taken from gamepad)
//otherwise, it will come from the tasedit data.
if(movieMode == MOVIEMODE_PLAY || movieMode == MOVIEMODE_TASEDIT)
if(movieMode == MOVIEMODE_TASEDIT)
{
MovieRecord* mr = &currMovieData.records[currFrameCounter];
if(movie_readonly)
{
//reset if necessary
if(mr->command_reset())
ResetNES();
joyports[0].load(mr);
joyports[1].load(mr);
}
else
{
joyports[0].log(mr);
joyports[1].log(mr);
mr->commands = 0;
}
}
else if(movieMode == MOVIEMODE_PLAY)
{
//stop when we run out of frames
if(currFrameCounter == currMovieData.records.size())