* deleted "Lag Counter Reset" hotkey, as it was obsolete since FCEUX 2.0.2; added "Open TAS Edit" hotkey

* Tasedit: auto clear "Disable speed throttling" and "Run in background", auto set "Set high-priority thread" when entering TASEdit; FCEUX runs in bg when TASEdit has focus
* Tasedit: Config->"Mute Turbo" check (same as in Config->Sound)
* fixed long "savestate" messages containing path
This commit is contained in:
ansstuff 2011-09-22 16:02:09 +00:00
parent d2a886ebb1
commit 72e04788fe
8 changed files with 86 additions and 47 deletions

View File

@ -250,6 +250,7 @@ BEGIN
POPUP "Config"
BEGIN
MENUITEM "Set greenzone capacity", ID_CONFIG_SETGREENZONECAPACITY
MENUITEM "Mute Turbo", ID_CONFIG_MUTETURBO
END
POPUP "&Help"
BEGIN
@ -1988,14 +1989,15 @@ END
IDR_ACCELERATOR1 ACCELERATORS
BEGIN
VK_DELETE, ACCEL_CTRL_DELETE, VIRTKEY, CONTROL, NOINVERT
"S", ACCEL_CTRL_S, VIRTKEY, CONTROL, NOINVERT
"T", ACCEL_CTRL_T, VIRTKEY, CONTROL, NOINVERT
"C", ACCEL_CTRL_C, VIRTKEY, CONTROL, NOINVERT
"V", ACCEL_CTRL_V, VIRTKEY, CONTROL, NOINVERT
"X", ACCEL_CTRL_X, VIRTKEY, CONTROL, NOINVERT
VK_DELETE, ACCEL_CTRL_DELETE, VIRTKEY, CONTROL, NOINVERT
"F", ACCEL_CTRL_F, VIRTKEY, CONTROL, NOINVERT
"P", ACCEL_CTRL_P, VIRTKEY, CONTROL, NOINVERT
"S", ACCEL_CTRL_S, VIRTKEY, CONTROL, NOINVERT
"T", ACCEL_CTRL_T, VIRTKEY, CONTROL, NOINVERT
"V", ACCEL_CTRL_V, VIRTKEY, CONTROL, NOINVERT
"X", ACCEL_CTRL_X, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, ACCEL_CTRL_INSERT, VIRTKEY, CONTROL, NOINVERT
END
IDR_RWACCELERATOR ACCELERATORS

View File

@ -820,6 +820,8 @@
#define ACCEL_CTRL_F 40429
#define ACCEL_CTRL_P 40430
#define ID_CONFIG_SETGREENZONECAPACITY 40432
#define ACCEL_CTRL_INSERT 40433
#define ID_CONFIG_MUTETURBO 40435
#define IDC_DEBUGGER_ICONTRAY 55535
#define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426
@ -829,7 +831,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 160
#define _APS_NEXT_COMMAND_VALUE 40433
#define _APS_NEXT_COMMAND_VALUE 40436
#define _APS_NEXT_CONTROL_VALUE 1262
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -12,6 +12,7 @@
#include "movie.h"
#include "utils/xstring.h"
#include "Win32InputBox.h"
#include "window.h"
#include "keyboard.h"
#include "joystick.h"
#include "help.h"
@ -27,6 +28,8 @@ int lastCursor;
int old_pauseframe;
bool old_show_pauseframe;
bool show_pauseframe;
bool TASEdit_focus = false;
int saved_eoptions = 0;
// vars saved in cfg file
int TasEdit_wndx, TasEdit_wndy;
@ -35,12 +38,12 @@ bool TASEdit_show_lag_frames = true;
bool TASEdit_show_tweak_count = false;
bool TASEdit_restore_position = false;
int TASEdit_greenzone_capacity = GREENZONE_DEFAULT_CAPACITY;
extern bool muteTurbo;
string tasedithelp = "{16CDE0C4-02B0-4A60-A88D-076319909A4D}"; //Name of TASEdit Help page
char buttonNames[NUM_JOYPAD_BUTTONS][2] = {"A", "B", "S", "T", "U", "D", "L", "R"};
HWND hwndTasEdit = 0;
static HMENU hmenu, hrmenu;
static HWND hwndList, hwndHeader, hwndTweakCount;
static RECT rectTweakCount;
@ -398,6 +401,7 @@ void DoubleClick(LPNMITEMACTIVATE info)
{
JumpToFrame(index);
ClearSelection();
RedrawList();
}
else if(info->iSubItem >= COLUMN_JOYPAD1_A && info->iSubItem <= COLUMN_JOYPAD4_R)
{
@ -699,12 +703,6 @@ static bool Paste()
return result;
}
//removes the current selection (does not put in clipboard)
static void Delete()
{
DeleteFrames();
}
void AddMarker()
{
}
@ -847,15 +845,6 @@ bool CheckSaveChanges()
return true;
}
void KillTasEdit()
{
if (!CheckSaveChanges()) return;
DestroyWindow(hwndTasEdit);
hwndTasEdit = 0;
turbo = false;
ExitTasEdit();
}
//Creates a new TASEdit Project
static void NewProject()
{
@ -1150,9 +1139,15 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case WM_CLOSE:
case WM_QUIT:
KillTasEdit();
ExitTasEdit();
break;
case WM_ACTIVATEAPP:
if((BOOL)wParam)
TASEdit_focus = true;
else
TASEdit_focus = false;
return DefWindowProc(hwndDlg,uMsg,wParam,lParam);
case WM_COMMAND:
switch(LOWORD(wParam))
{
@ -1183,7 +1178,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
case ID_TASEDIT_FILE_CLOSE:
KillTasEdit();
ExitTasEdit();
break;
case ID_EDIT_SELECTALL:
@ -1207,7 +1202,8 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case ACCEL_CTRL_DELETE:
case ID_TASEDIT_DELETE:
Delete();
case ID_CONTEXT_SELECTED_DELETEFRAMES:
if (selectionFrames.size()) DeleteFrames();
break;
case ID_EDIT_ADDMARKER:
@ -1257,12 +1253,9 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
}
break;
case ACCEL_CTRL_INSERT:
case ID_CONTEXT_SELECTED_INSERTFRAMES:
InsertFrames();
break;
case ID_CONTEXT_SELECTED_DELETEFRAMES:
DeleteFrames();
if (selectionFrames.size()) InsertFrames();
break;
case TASEDIT_FOWARD:
@ -1325,6 +1318,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
CheckDlgButton(hwndTasEdit,CHECK_AUTORESTORE_PLAYBACK,TASEdit_restore_position?BST_CHECKED:BST_UNCHECKED);
break;
case ID_CONFIG_SETGREENZONECAPACITY:
{
//open input dialog
int new_capacity = TASEdit_greenzone_capacity;
if(CWin32InputBox::GetInteger("Greenzone capacity", "Keep savestates for how many frames?", new_capacity, hwndDlg) == IDOK)
@ -1341,11 +1335,17 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
} else TASEdit_greenzone_capacity = new_capacity;
}
break;
}
case ID_CONFIG_MUTETURBO:
muteTurbo ^= 1;
CheckMenuItem(hmenu, ID_CONFIG_MUTETURBO, muteTurbo?MF_CHECKED : MF_UNCHECKED);
break;
}
default:
break;
}
return FALSE;
}
@ -1393,8 +1393,20 @@ void EnterTasEdit()
if(!hwndTasEdit) hwndTasEdit = CreateDialog(fceu_hInstance,"TASEDIT",hAppWnd,WndprocTasEdit);
if(hwndTasEdit)
{
// save "eoptions"
saved_eoptions = eoptions;
// clear "Run in background"
eoptions &= ~EO_BGRUN;
// set "Background TASEdit input"
KeyboardSetBackgroundAccessBit(KEYBACKACCESS_TASEDIT);
JoystickSetBackgroundAccessBit(JOYBACKACCESS_TASEDIT);
// "Set high-priority thread"
eoptions |= EO_HIGHPRIO;
DoPriority();
// clear "Disable speed throttling"
eoptions &= ~EO_NOTHROTTLE;
UpdateCheckedMenuItems();
hmenu = GetMenu(hwndTasEdit);
hrmenu = LoadMenu(fceu_hInstance,"TASEDITCONTEXTMENUS");
// check option ticks
@ -1402,14 +1414,26 @@ void EnterTasEdit()
CheckMenuItem(hmenu, ID_VIEW_SHOW_LAG_FRAMES, TASEdit_show_lag_frames?MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hmenu, ID_VIEW_SHOW_TWEAK_COUNT, TASEdit_show_tweak_count?MF_CHECKED : MF_UNCHECKED);
CheckDlgButton(hwndTasEdit,CHECK_AUTORESTORE_PLAYBACK,TASEdit_restore_position?BST_CHECKED:BST_UNCHECKED);
CheckMenuItem(hmenu, ID_CONFIG_MUTETURBO, muteTurbo?MF_CHECKED : MF_UNCHECKED);
SetWindowPos(hwndTasEdit,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
}
}
void ExitTasEdit()
{
if (!CheckSaveChanges()) return;
DestroyWindow(hwndTasEdit);
hwndTasEdit = 0;
turbo = false;
pauseframe = -1;
TASEdit_focus = false;
// restore "eoptions"
eoptions = saved_eoptions;
DoPriority();
UpdateCheckedMenuItems();
// release memory
currMovieData.clearGreenzone();
movieMode = MOVIEMODE_INACTIVE;
FCEU_DispMessage("Tasedit disengaged",0);
currMovieData.clearGreenzone();
CreateCleanMovie();
}

View File

@ -3,7 +3,7 @@
#define FRAMES_TOO_FAR 60
#define NUM_JOYPADS 4
#define NUM_JOYPAD_BUTTONS 8
#define GREENZONE_DEFAULT_CAPACITY 50000
#define GREENZONE_DEFAULT_CAPACITY 100000
#define GREENZONE_MIN_CAPACITY 1
#define GREENZONE_MAX_CAPACITY 200000 // maybe even more
#define PAUSEFRAME_BLINKING_PERIOD 100

View File

@ -126,6 +126,7 @@ bool AVIdisableMovieMessages = false;
char *md5_asciistr(uint8 digest[16]);
static int winwidth, winheight;
static volatile int nofocus = 0;
extern bool TASEdit_focus;
static int tog = 0; //Toggle for Hide Menu
static bool loggingSound = false;
static LONG WindowXC=1<<30,WindowYC;
@ -2223,13 +2224,9 @@ adelikat: Outsourced this to a remappable hotkey
break;
case WM_ACTIVATEAPP:
if((BOOL)wParam)
{
nofocus=0;
}
nofocus = 0;
else
{
nofocus=1;
}
nofocus = 1;
goto proco;
case WM_ENTERMENULOOP:
UpdateCheckedMenuItems();
@ -2360,7 +2357,7 @@ void UpdateFCEUWindow(void)
if(!(eoptions & EO_BGRUN))
{
while(nofocus)
while(nofocus && !TASEdit_focus)
{
Sleep(75);

View File

@ -620,6 +620,7 @@ static void BackgroundDisplayToggle(void);
static void ObjectDisplayToggle(void);
static void LagCounterToggle(void);
static void ViewSlots(void);
static void LaunchTasEdit(void);
static void LaunchMemoryWatch(void);
static void LaunchCheats(void);
static void LaunchDebugger(void);
@ -743,7 +744,7 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
{ EMUCMD_MISC_DISPLAY_BG_TOGGLE, EMUCMDTYPE_MISC, BackgroundDisplayToggle, 0, 0, "Toggle Background Display", 0 },
{ EMUCMD_MISC_DISPLAY_OBJ_TOGGLE, EMUCMDTYPE_MISC, ObjectDisplayToggle, 0, 0, "Toggle Object Display", 0 },
{ EMUCMD_MISC_DISPLAY_LAGCOUNTER_TOGGLE,EMUCMDTYPE_MISC, LagCounterToggle, 0, 0, "Lag Counter Toggle", EMUCMDFLAG_TASEDIT },
{ EMUCMD_MISC_LAGCOUNTER_RESET, EMUCMDTYPE_MISC, LagCounterReset, 0, 0, "Lag Counter Reset", 0},
{ EMUCMD_MISC_OPENTASEDIT, EMUCMDTYPE_TOOL, LaunchTasEdit, 0, 0, "Open TAS Edit", 0},
{ EMUCMD_TOOL_OPENMEMORYWATCH, EMUCMDTYPE_TOOL, LaunchMemoryWatch,0, 0, "Open Memory Watch", EMUCMDFLAG_TASEDIT },
{ EMUCMD_TOOL_OPENCHEATS, EMUCMDTYPE_TOOL, LaunchCheats, 0, 0, "Open Cheats", 0},
{ EMUCMD_TOOL_OPENDEBUGGER, EMUCMDTYPE_TOOL, LaunchDebugger, 0, 0, "Open Debugger", 0},
@ -901,6 +902,14 @@ static void LagCounterToggle(void)
lagCounterDisplay ^= 1;
}
static void LaunchTasEdit(void)
{
#ifdef WIN32
extern void EnterTasEdit();
EnterTasEdit();
#endif
}
static void LaunchMemoryWatch(void)
{
#ifdef WIN32
@ -974,6 +983,7 @@ static void LaunchRamSearch(void)
#endif
}
static void RamSearchOpLT(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);

View File

@ -201,8 +201,8 @@ enum EMUCMD
EMUCMD_MISC_DISPLAY_OBJ_TOGGLE,
EMUCMD_MISC_DISPLAY_LAGCOUNTER_TOGGLE,
EMUCMD_MISC_LAGCOUNTER_RESET,
//Currently Windows only------
EMUCMD_MISC_OPENTASEDIT,
EMUCMD_TOOL_OPENMEMORYWATCH,
EMUCMD_TOOL_OPENCHEATS,
EMUCMD_TOOL_OPENDEBUGGER,

View File

@ -725,7 +725,8 @@ bool FCEUSS_Load(const char *fname)
if(st == NULL || (st->get_fp() == NULL))
{
FCEU_DispMessage("State %d load error. Filename: %s",0,CurrentState, fn);
FCEU_DispMessage("State %d load error.",0,CurrentState);
//FCEU_DispMessage("State %d load error. Filename: %s",0,CurrentState, fn);
SaveStateStatus[CurrentState]=0;
return false;
}
@ -739,11 +740,13 @@ bool FCEUSS_Load(const char *fname)
{
char szFilename[260]={0};
splitpath(fname, 0, 0, szFilename, 0);
FCEU_DispMessage("State %s loaded. Filename: %s",0,szFilename, fn);
FCEU_DispMessage("State %s loaded.",0,szFilename);
//FCEU_DispMessage("State %s loaded. Filename: %s",0,szFilename, fn);
}
else
{
FCEU_DispMessage("State %d loaded. Filename: %s",0,CurrentState, fn);
FCEU_DispMessage("State %d loaded.",0,CurrentState);
//FCEU_DispMessage("State %d loaded. Filename: %s",0,CurrentState, fn);
SaveStateStatus[CurrentState]=1;
}
delete st;
@ -786,7 +789,8 @@ bool FCEUSS_Load(const char *fname)
{
SaveStateStatus[CurrentState]=1;
}
FCEU_DispMessage("Error(s) reading state %d! Filename: %s",0,CurrentState, fn);
FCEU_DispMessage("Error(s) reading state %d!",0,CurrentState);
//FCEU_DispMessage("Error(s) reading state %d! Filename: %s",0,CurrentState, fn);
delete st;
return 0;
}