This commit is contained in:
dinkc64 2019-07-16 00:33:27 -04:00
parent e2275f7c97
commit 6bd9caa4b4
2 changed files with 24 additions and 9 deletions

View File

@ -285,9 +285,9 @@ INT32 ReplayInput()
PrintInputs(); PrintInputs();
} }
#if 1 #if 0
if ( (GetCurrentFrame()-nStartFrame) == (nTotalFrames-1) ) { if ( (GetCurrentFrame()-nStartFrame) == (nTotalFrames-1) ) {
bRunPause = 1; // pause at the last recorded frame? *needs testing* bRunPause = 1; // pause at the last recorded frame? causes weird issues when pauses. investigate later.. -dink
} }
#endif #endif
@ -374,6 +374,8 @@ INT32 StartRecord()
fwrite(&nZero, 1, 4, fp); // undo count fwrite(&nZero, 1, 4, fp); // undo count
fwrite(&nMovieVersion, 1, 4, fp); // ThisMovieVersion fwrite(&nMovieVersion, 1, 4, fp); // ThisMovieVersion
memset(&MovieInfo, 0, sizeof(MovieInfo));
if (nMovieVersion >= 0x0401) { if (nMovieVersion >= 0x0401) {
bprintf(0, _T("nMovieVersion %X .. writing date stuff!\n"), nMovieVersion); bprintf(0, _T("nMovieVersion %X .. writing date stuff!\n"), nMovieVersion);
time_t nLocalTime = time(NULL); time_t nLocalTime = time(NULL);
@ -522,6 +524,8 @@ INT32 StartReplay(const TCHAR* szFileName) // const char* szFileName = NULL
nEndFrame += nStartFrame; nEndFrame += nStartFrame;
fread(&nReplayUndoCount, 1, 4, fp); fread(&nReplayUndoCount, 1, 4, fp);
fread(&nThisMovieVersion, 1, 4, fp); fread(&nThisMovieVersion, 1, 4, fp);
memset(&MovieInfo, 0, sizeof(MovieInfo));
if (nThisMovieVersion >= 0x0401) { if (nThisMovieVersion >= 0x0401) {
bprintf(0, _T("loading ext movie version!!\n")); bprintf(0, _T("loading ext movie version!!\n"));
fread(&MovieInfo, 1, sizeof(MovieInfo), fp); fread(&MovieInfo, 1, sizeof(MovieInfo), fp);
@ -701,6 +705,7 @@ void StopReplay()
} }
nReplayStatus = 0; nReplayStatus = 0;
nStartFrame = 0; nStartFrame = 0;
memset(&MovieInfo, 0, sizeof(MovieInfo));
CheckRedraw(); CheckRedraw();
MenuEnableItems(); MenuEnableItems();
} }
@ -980,6 +985,7 @@ void DisplayReplayProperties(HWND hDlg, bool bClear)
fread(&nThisMovieVersion, 1, 4, fd); fread(&nThisMovieVersion, 1, 4, fd);
memset(&MovieInfo, 0, sizeof(MovieInfo));
if (nThisMovieVersion >= 0x0401) { if (nThisMovieVersion >= 0x0401) {
fread(&MovieInfo, 1, sizeof(MovieInfo), fd); fread(&MovieInfo, 1, sizeof(MovieInfo), fd);
bprintf(0, _T("Movie Version %X\n"), nThisMovieVersion); bprintf(0, _T("Movie Version %X\n"), nThisMovieVersion);
@ -1039,7 +1045,7 @@ void DisplayReplayProperties(HWND hDlg, bool bClear)
char szLengthString[32]; char szLengthString[32];
char szUndoCountString[32]; char szUndoCountString[32];
char szRecordedFrom[32]; char szRecordedFrom[32];
char szRecordedTime[32]; char szRecordedTime[32] = { 0 };
sprintf(szFramesString, "%d", nFrames); sprintf(szFramesString, "%d", nFrames);
sprintf(szLengthString, "%02d:%02d:%02d", nHours, nMinutes % 60, nSeconds % 60); sprintf(szLengthString, "%02d:%02d:%02d", nHours, nMinutes % 60, nSeconds % 60);
@ -1050,7 +1056,9 @@ void DisplayReplayProperties(HWND hDlg, bool bClear)
else else
sprintf(szRecordedFrom, "%s", (bStartFromReset) ? "Power-On" : "Savestate"); sprintf(szRecordedFrom, "%s", (bStartFromReset) ? "Power-On" : "Savestate");
sprintf(szRecordedTime, "%02d/%02d/%04d @ %02d:%02d:%02d%s", MovieInfo.month+1, MovieInfo.day, 2000 + (MovieInfo.year%100), (MovieInfo.hour>12) ? MovieInfo.hour-12 : MovieInfo.hour, MovieInfo.minute, MovieInfo.second, (MovieInfo.hour>12) ? "pm" : "am"); if (nThisMovieVersion >= 0x0401) {
sprintf(szRecordedTime, "%02d/%02d/%04d @ %02d:%02d:%02d%s", MovieInfo.month+1, MovieInfo.day, 2000 + (MovieInfo.year%100), (MovieInfo.hour>12) ? MovieInfo.hour-12 : MovieInfo.hour, MovieInfo.minute, MovieInfo.second, (MovieInfo.hour>12) ? "pm" : "am");
}
SetDlgItemTextA(hDlg, IDC_LENGTH, szLengthString); SetDlgItemTextA(hDlg, IDC_LENGTH, szLengthString);
SetDlgItemTextA(hDlg, IDC_FRAMES, szFramesString); SetDlgItemTextA(hDlg, IDC_FRAMES, szFramesString);

View File

@ -222,9 +222,13 @@ static int RunGetNextSound(int bDraw)
return 0; return 0;
} }
int bBrokeOutOfFFWD = 0;
if (bAppDoFast) { // do more frames if (bAppDoFast) { // do more frames
for (int i = 0; i < nFastSpeed; i++) { for (int i = 0; i < nFastSpeed; i++) {
if (!bAppDoFast) break; // break out if no longer in ffwd if (!bAppDoFast) {
bBrokeOutOfFFWD = 1; // recording ended, etc.
break;
} // break out if no longer in ffwd
#ifdef INCLUDE_AVI_RECORDING #ifdef INCLUDE_AVI_RECORDING
if (nAviStatus) { if (nAviStatus) {
// Render frame with sound // Render frame with sound
@ -239,17 +243,20 @@ static int RunGetNextSound(int bDraw)
} }
} }
// Render frame with sound if (!bBrokeOutOfFFWD) {
pBurnSoundOut = nAudNextSound; // Render frame with sound
RunFrame(bDraw, 0); pBurnSoundOut = nAudNextSound;
RunFrame(bDraw, 0);
}
if (WaveLog != NULL && pBurnSoundOut != NULL) { // log to the file if (WaveLog != NULL && pBurnSoundOut != NULL) { // log to the file
fwrite(pBurnSoundOut, 1, nBurnSoundLen << 2, WaveLog); fwrite(pBurnSoundOut, 1, nBurnSoundLen << 2, WaveLog);
pBurnSoundOut = NULL; pBurnSoundOut = NULL;
} }
if (bAppDoStep) { if (bAppDoStep || (bBrokeOutOfFFWD && bRunPause)) {
memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer memset(nAudNextSound, 0, nAudSegLen << 2); // Write silence into the buffer
AudBlankSound();
} }
bAppDoStep = 0; // done one step bAppDoStep = 0; // done one step