Skip to content

Commit

Permalink
Add active m64 to the titlebar, adjust error message and fix Clear bu…
Browse files Browse the repository at this point in the history
…tton in tasinput
  • Loading branch information
Madghostek committed Aug 9, 2020
1 parent 655fd87 commit 501ea92
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
31 changes: 27 additions & 4 deletions main/vcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ long lastSound = 0;
volatile BOOL captureFrameValid = FALSE;
static int AVIBreakMovie = 0;

int titleLength;

static void printWarning (char* str)
{
Expand Down Expand Up @@ -905,10 +906,15 @@ VCR_getKeys( int Control, BUTTONS *Keys )
extern BOOL savestates_job_success;
if(!savestates_job_success)
{
char str [2048];
sprintf(str, "Couldn't find or load this movie's snapshot,\n\"%s\".\nMake sure that file is where Mupen64 can find it.", savestates_get_selected_filename());
printError(str);
//char str [2048];
//sprintf(str, "Couldn't find or load this movie's snapshot,\n\"%s\".\nMake sure that file is where Mupen64 can find it.", savestates_get_selected_filename());
//printError(str);
m_task = Idle;
extern HWND mainHWND;
char title[MAX_PATH];
GetWindowText(mainHWND, title, MAX_PATH);
title[titleLength] = '\0'; //remove movie being played part
SetWindowText(mainHWND, title);
getKeys( Control, Keys );
return;
}
Expand Down Expand Up @@ -1182,7 +1188,9 @@ VCR_startPlayback( const char *filename, const char *authorUTF8, const char *des
VCR_coreStopped();
// m_intro = TRUE;

extern HWND mainHWND;
char buf[PATH_MAX];
char title[MAX_PATH];
/*
if (m_task != Idle)
{
Expand All @@ -1209,6 +1217,16 @@ VCR_startPlayback( const char *filename, const char *authorUTF8, const char *des
fprintf( stderr, "[VCR]: Cannot start playback, could not open .m64 file '%s': %s\n", filename, strerror( errno ) );
return -1;
}
titleLength = GetWindowText(mainHWND, title, MAX_PATH);
_splitpath(buf, 0, 0, buf, 0);
//trim trailing spaces because it looks weird
while (title[--titleLength] == ' ');
title[++titleLength] = '\0';

strcat(title, " | ");
strcat(title, buf);
strcat(title, ".m64");
SetWindowText(mainHWND, title);
}

{
Expand Down Expand Up @@ -1459,9 +1477,14 @@ VCR_stopPlayback()
extern void EnableEmulationMenuItems(BOOL flag);
EnableEmulationMenuItems(TRUE);

extern HWND hStatus;
extern HWND hStatus,mainHWND;
SendMessage(hStatus, SB_SETTEXT, 1, (LPARAM)"");
SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"Stopped playback.");

char title[MAX_PATH];
GetWindowText(mainHWND, title, MAX_PATH);
title[titleLength] = '\0'; //remove movie being played part
SetWindowText(mainHWND, title);
#else
// FIXME: how to update enable/disable state of StopPlayback and StopRecord with gtk GUI?
#endif
Expand Down
1 change: 1 addition & 0 deletions main/win/guifuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void warn_savestate_from_another_rom()
if (!Config.savesERRORS) return;
TranslateDefault("Savestates Wrong Region","This savestate is from another ROM or version",TempMessage);
SendMessage( hStatus, SB_SETTEXT, 0, (LPARAM)TempMessage );
MessageBox(mainHWND, TempMessage, "Error", MB_ICONERROR);

}

Expand Down
4 changes: 2 additions & 2 deletions tasinput_plugin/src/DefDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void Status::GetKeys(BUTTONS * Keys)
int M1Speed = 0, M2Speed = 0;
bool analogKey = false;

if (Keys == NULL) { gettingKeys = false; return; }
if (Keys == NULL) { gettingKeys = false; SetKeys(ControllerInput); return; }

for(BYTE devicecount=0; devicecount<Controller[Control].NDevices; devicecount++)
{
Expand Down Expand Up @@ -2274,7 +2274,7 @@ LRESULT Status::StatusDlgMethod (UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_CHECK_DUP: DISP_UPDATE(U_DPAD);
case IDC_CHECK_DRIGHT: DISP_UPDATE(R_DPAD);
case IDC_CHECK_DDOWN: DISP_UPDATE(D_DPAD);
case IDC_CLEARBUTTONS: buttonOverride.Value = 0; buttonAutofire.Value = 0; buttonAutofire2.Value = 0; ActivateEmulatorWindow(); break;
case IDC_CLEARBUTTONS: buttonOverride.Value = buttonAutofire.Value = buttonAutofire2.Value = 0; GetKeys(0); ActivateEmulatorWindow(); break;

case IDC_MOREBUTTON0:
case IDC_MOREBUTTON1:
Expand Down

0 comments on commit 501ea92

Please sign in to comment.