Skip to content

Commit cf8b2af

Browse files
committed
added gam on debugging
1 parent 3392caf commit cf8b2af

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/ppuc.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ void PINMAMECALLBACK OnDisplayUpdated(int index, void* p_displayData, PinmameDis
291291
// the type is PINMAME_DISPLAY_TYPE_DMD | PINMAME_DISPLAY_TYPE_DMDSEG.
292292
// For some games like WPT, there's a second display on the playfield of type
293293
// PINMAME_DISPLAY_TYPE_DMD | PINMAME_DISPLAY_TYPE_DMDNOAA | PINMAME_DISPLAY_TYPE_NODISP
294-
if ((p_displayLayout->type & PINMAME_DISPLAY_TYPE_DMD) == PINMAME_DISPLAY_TYPE_DMD && (p_displayLayout->type & PINMAME_DISPLAY_TYPE_NODISP) == 0)
294+
if ((p_displayLayout->type & PINMAME_DISPLAY_TYPE_DMD) == PINMAME_DISPLAY_TYPE_DMD &&
295+
(p_displayLayout->type & PINMAME_DISPLAY_TYPE_NODISP) == 0)
295296
{
296297
pDmd->UpdateData((uint8_t*)p_displayData, p_displayLayout->depth, p_displayLayout->width, p_displayLayout->height,
297298
255, 255, 255);
@@ -400,13 +401,24 @@ void PINMAMECALLBACK OnSolenoidUpdated(PinmameSolenoidState* p_solenoidState, co
400401
{
401402
if (p_solenoidState->state)
402403
{
404+
if (opt_debug || opt_debug_coils)
405+
{
406+
printf("Game started: solenoid=%d, state=%d\n", p_solenoidState->solNo, p_solenoidState->state);
407+
}
403408
SDL_RenderTexture(pTransliteRenderer, pTransliteTexture, nullptr, nullptr);
404409
SDL_RenderPresent(pTransliteRenderer);
405410
}
406-
else if (pTransliteAttractTexture)
411+
else
407412
{
408-
SDL_RenderTexture(pTransliteRenderer, pTransliteAttractTexture, nullptr, nullptr);
409-
SDL_RenderPresent(pTransliteRenderer);
413+
if (opt_debug || opt_debug_coils)
414+
{
415+
printf("Game stopped: solenoid=%d, state=%d\n", p_solenoidState->solNo, p_solenoidState->state);
416+
}
417+
if (pTransliteAttractTexture)
418+
{
419+
SDL_RenderTexture(pTransliteRenderer, pTransliteAttractTexture, nullptr, nullptr);
420+
SDL_RenderPresent(pTransliteRenderer);
421+
}
410422
}
411423
}
412424
}

0 commit comments

Comments
 (0)