Minor fixes (#805)

* Add missing Riff.h include and fix const correctness of arguments.
* Cosmetic improvements to Perf breakdown in LogPerfTimings().
* Logging - removed unnecessary cast.
This commit is contained in:
Andrea 2020-07-01 21:08:18 +01:00 committed by GitHub
parent 951f7f5258
commit 82c09abd54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 16 deletions

View File

@ -145,15 +145,15 @@ void LogPerfTimings(void)
UINT64 other = g_timeTotal - g_timeCpu - g_timeSpeaker - g_timeMB_NoTimer - g_timeVideoRefresh;
LogOutput("Perf breakdown:\n");
LogOutput(". CPU %% = %2f.2\n", (double)cpu / (double)g_timeTotal * 100.0);
LogOutput(". Video %% = %2f.2\n", (double)video / (double)g_timeTotal * 100.0);
LogOutput("... NTSC %% = %2f.2\n", (double)g_timeVideo / (double)g_timeTotal * 100.0);
LogOutput("... refresh %% = %2f.2\n", (double)g_timeVideoRefresh / (double)g_timeTotal * 100.0);
LogOutput(". Audio %% = %2f.2\n", (double)audio / (double)g_timeTotal * 100.0);
LogOutput("... Speaker %% = %2f.2\n", (double)spkr / (double)g_timeTotal * 100.0);
LogOutput("... MB %% = %2f.2\n", (double)mb / (double)g_timeTotal * 100.0);
LogOutput(". Other %% = %2f.2\n", (double)other / (double)g_timeTotal * 100.0);
LogOutput(". TOTAL %% = %2f.2\n", (double)(cpu+video+audio+other) / (double)g_timeTotal * 100.0);
LogOutput(". CPU %% = %6.2f\n", (double)cpu / (double)g_timeTotal * 100.0);
LogOutput(". Video %% = %6.2f\n", (double)video / (double)g_timeTotal * 100.0);
LogOutput("... NTSC %% = %6.2f\n", (double)g_timeVideo / (double)g_timeTotal * 100.0);
LogOutput("... refresh %% = %6.2f\n", (double)g_timeVideoRefresh / (double)g_timeTotal * 100.0);
LogOutput(". Audio %% = %6.2f\n", (double)audio / (double)g_timeTotal * 100.0);
LogOutput("... Speaker %% = %6.2f\n", (double)spkr / (double)g_timeTotal * 100.0);
LogOutput("... MB %% = %6.2f\n", (double)mb / (double)g_timeTotal * 100.0);
LogOutput(". Other %% = %6.2f\n", (double)other / (double)g_timeTotal * 100.0);
LogOutput(". TOTAL %% = %6.2f\n", (double)(cpu+video+audio+other) / (double)g_timeTotal * 100.0);
}
}
#endif

View File

@ -87,6 +87,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Mockingboard.h"
#include "SoundCore.h"
#include "YamlHelper.h"
#include "Riff.h"
#include "AY8910.h"
#include "SSI263Phonemes.h"
@ -1281,13 +1282,13 @@ static bool MB_DSInit()
FALSE, // bManualReset (FALSE = auto-reset)
FALSE, // bInitialState (FALSE = non-signaled)
NULL); // lpName
LogFileOutput("MB_DSInit: CreateEvent(), g_hSSI263Event[0]=0x%08X\n", (UINT32)g_hSSI263Event[0]);
LogFileOutput("MB_DSInit: CreateEvent(), g_hSSI263Event[0]=0x%08X\n", g_hSSI263Event[0]);
g_hSSI263Event[1] = CreateEvent(NULL, // lpEventAttributes
FALSE, // bManualReset (FALSE = auto-reset)
FALSE, // bInitialState (FALSE = non-signaled)
NULL); // lpName
LogFileOutput("MB_DSInit: CreateEvent(), g_hSSI263Event[1]=0x%08X\n", (UINT32)g_hSSI263Event[1]);
LogFileOutput("MB_DSInit: CreateEvent(), g_hSSI263Event[1]=0x%08X\n", g_hSSI263Event[1]);
if((g_hSSI263Event[0] == NULL) || (g_hSSI263Event[1] == NULL))
{
@ -1389,7 +1390,7 @@ static bool MB_DSInit()
NULL, // lpParameter
0, // dwCreationFlags : 0 = Run immediately
&dwThreadId); // lpThreadId
LogFileOutput("MB_DSInit: CreateThread(), g_hThread=0x%08X\n", (UINT32)g_hThread);
LogFileOutput("MB_DSInit: CreateThread(), g_hThread=0x%08X\n", g_hThread);
BOOL bRes2 = SetThreadPriority(g_hThread, THREAD_PRIORITY_TIME_CRITICAL);
LogFileOutput("MB_DSInit: SetThreadPriority(), bRes=%d\n", bRes2 ? 1 : 0);

View File

@ -35,7 +35,7 @@ static DWORD dwDataOffset;
static DWORD g_dwTotalNumberOfBytesWritten = 0;
static unsigned int g_NumChannels = 2;
int RiffInitWriteFile(char* pszFile, unsigned int sample_rate, unsigned int NumChannels)
int RiffInitWriteFile(const char* pszFile, unsigned int sample_rate, unsigned int NumChannels)
{
g_hRiffFile = CreateFile(pszFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
@ -117,7 +117,7 @@ int RiffFinishWriteFile()
return CloseHandle(g_hRiffFile);
}
int RiffPutSamples(short* buf, unsigned int uSamples)
int RiffPutSamples(const short* buf, unsigned int uSamples)
{
if(g_hRiffFile == INVALID_HANDLE_VALUE)
return 1;

View File

@ -1,5 +1,5 @@
#pragma once
int RiffInitWriteFile(char* pszFile, unsigned int sample_rate, unsigned int NumChannels);
int RiffInitWriteFile(const char* pszFile, unsigned int sample_rate, unsigned int NumChannels);
int RiffFinishWriteFile();
int RiffPutSamples(short* buf, unsigned int uSamples);
int RiffPutSamples(const short* buf, unsigned int uSamples);

View File

@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Speaker.h"
#include "Video.h" // VideoRedrawScreen()
#include "YamlHelper.h"
#include "Riff.h"
#include "Debugger/Debug.h" // For DWORD extbench