Skip to content

Commit d1a6efc

Browse files
committed
GUI: squashed a few new bugs
1 parent 66e110c commit d1a6efc

5 files changed

Lines changed: 81 additions & 83 deletions

File tree

src/osd/winui/hbmameui.rc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,15 @@ STYLE WS_CHILD | WS_CAPTION
570570
CAPTION "Audit"
571571
FONT 8, "Tahoma"
572572
BEGIN
573-
ICON IDI_PR_AUDIT,IDC_STATIC,20,10,20,20
574-
LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
575-
LTEXT "ROM check:",IDC_STATIC,10,40,50,8
576-
LTEXT "Checking...",IDC_PROP_ROMS,66,40,139,8
577-
LTEXT "Sample check:",IDC_STATIC,10,52,50,8
578-
LTEXT "Checking...",IDC_PROP_SAMPLES,66,52,139,8
579-
GROUPBOX "Details",IDC_STATIC,4,64,211,171
580-
EDITTEXT IDC_AUDIT_DETAILS_PROP0,10,74,199,155,ES_MULTILINE |ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL |NOT WS_TABSTOP
573+
LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
574+
LTEXT "ROM Check:",IDC_STATIC,10,40,50,8
575+
LTEXT "Checking...",IDC_PROP_ROMS,66,40,139,8
576+
LTEXT "Sample Check:",IDC_STATIC,10,52,50,8
577+
LTEXT "Checking...",IDC_PROP_SAMPLES,66,52,139,8
578+
GROUPBOX "ROM Details",IDC_STATIC,4,64,212,104
579+
EDITTEXT IDC_AUDIT_DETAILS_PROP0,10,74,200,88,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
580+
GROUPBOX "Sample Details",IDC_STATIC,4,172,212,104
581+
EDITTEXT IDC_AUDIT_DETAILS_PROP1,10,182,200,88,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
581582
END
582583

583584
IDD_PROP_DISPLAY DIALOGEX 0, 0, 220, 240

src/osd/winui/mui_audit.cpp

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ int MameUIVerifyRomSet(int game, bool choice)
186186
}
187187

188188
// Verifies the Sample set while calling SetSampleAuditResults
189-
int MameUIVerifySampleSet(int game, int box)
189+
int MameUIVerifySampleSet(int game)
190190
{
191191
driver_enumerator enumerator(MameUIGlobal(), driver_list::driver(game));
192192
enumerator.next();
@@ -206,15 +206,15 @@ int MameUIVerifySampleSet(int game, int box)
206206

207207
// output the summary of the audit
208208
if (!summary_string.empty())
209-
DetailsPrintf(box, "%s", summary_string.c_str());
209+
DetailsPrintf(1, "%s", summary_string.c_str());
210210

211211
SetSampleAuditResults(game, summary);
212212
return summary;
213213
}
214214

215215
static DWORD WINAPI AuditThreadProc(LPVOID hDlg)
216216
{
217-
char s[80] { };
217+
char s[80]{};
218218

219219
while (!bCancel)
220220
{
@@ -329,7 +329,7 @@ INT_PTR CALLBACK GameAuditDialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lPa
329329

330330
if (DriverUsesSamples(rom_index))
331331
{
332-
iStatus = MameUIVerifySampleSet(rom_index, 0);
332+
iStatus = MameUIVerifySampleSet(rom_index);
333333
lpStatus = StatusString(iStatus);
334334
}
335335
else
@@ -348,7 +348,7 @@ INT_PTR CALLBACK GameAuditDialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lPa
348348
static void ProcessNextRom()
349349
{
350350
int retval = 0;
351-
TCHAR buffer[20] { };
351+
TCHAR buffer[20]{};
352352

353353
retval = MameUIVerifyRomSet(rom_index, 1);
354354
switch (retval)
@@ -386,9 +386,9 @@ static void ProcessNextRom()
386386
static void ProcessNextSample()
387387
{
388388
int retval = 0;
389-
TCHAR buffer[20] { };
389+
TCHAR buffer[20]{};
390390

391-
retval = MameUIVerifySampleSet(sample_index, 1);
391+
retval = MameUIVerifySampleSet(sample_index);
392392

393393
switch (retval)
394394
{
@@ -429,33 +429,27 @@ static void ProcessNextSample()
429429

430430
static void CLIB_DECL DetailsPrintf(int box, const char *fmt, ...)
431431
{
432-
//RS 20030613 Different Ids for Property Page and Dialog
433-
// so see which one's currently instantiated
434-
HWND hEdit = 0;
435-
if (box == 0)
432+
// This does the audit boxes for all systems and for an individual game.
433+
// See if it's all systems
434+
HWND hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS);
435+
// if not open, try individual game
436+
if (!hEdit)
436437
{
437-
hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS);
438+
// if this system has separate boxes for samples, try that
439+
// otherwise all errors go into the roms box
440+
if (box)
441+
hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS_PROP1);
438442
if (!hEdit)
439443
hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS_PROP0);
440444
}
441-
else
442-
if (box == 1)
443-
{
444-
hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS);
445-
if (!hEdit)
446-
hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS_PROP1);
447-
}
448445

446+
// Still nothing? Most likely doing an F5 audit, which has no boxes.
449447
if (!hEdit)
450-
{
451-
// Auditing via F5 - no window to display the results
452-
//printf("audit detailsprintfsprintf() can't find any audit control\n");
453448
return;
454-
}
455449

456450
va_list marker;
457451
va_start(marker, fmt);
458-
char s[8000] { };
452+
char s[8000]{};
459453
vsnprintf(s, sizeof(s), fmt, marker);
460454
va_end(marker);
461455

src/osd/winui/mui_audit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void InitGameAudit(int gameIndex);
1111
INT_PTR CALLBACK GameAuditDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
1212

1313
int MameUIVerifyRomSet(int game, bool choice);
14-
int MameUIVerifySampleSet(int game, int);
14+
int MameUIVerifySampleSet(int game);
1515

1616
const char * GetAuditString(int audit_result);
1717
BOOL IsAuditResultKnown(int audit_result);

0 commit comments

Comments
 (0)