Skip to content

Commit

Permalink
DMD: fix capture duplicates, add alphanum capture
Browse files Browse the repository at this point in the history
  • Loading branch information
vbousquet committed Oct 31, 2024
1 parent 572026f commit 2c91300
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
29 changes: 18 additions & 11 deletions src/wpc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ static PALETTE_INIT(core) {
/------------------------------------*/
#ifdef VPINMAME
# define inRect(r,l,t,w,h) FALSE
void core_dmd_capture_frame(const int width, const int height, const UINT8* const dmdDotRaw, const int rawFrameCount, const UINT8* const rawFrame);
#else /* VPINMAME */
INLINE int inRect(const struct rectangle *r, int left, int top, int width, int height) {
return (r->max_x >= left) && (r->max_y >= top) &&
Expand Down Expand Up @@ -1066,6 +1067,7 @@ static void updateDisplay(struct mame_bitmap *bitmap, const struct rectangle *cl
g_raw_dmdbuffer[i] = (UINT8)((int)AlphaNumericFrameBuffer[i] * 100 / 3);
if (memcmp(buffer1, g_raw_dmdbuffer, g_raw_dmdx * g_raw_dmdy) != 0) {
memcpy(buffer1, g_raw_dmdbuffer, g_raw_dmdx * g_raw_dmdy);
core_dmd_capture_frame(128, 32, AlphaNumericFrameBuffer, 0, NULL);
g_needs_DMD_update = 1;
}
#endif
Expand Down Expand Up @@ -3189,17 +3191,22 @@ void core_dmd_capture_frame(const int width, const int height, const UINT8* cons
}

// Bitplane frame combined from PWM pattern of raw frames
strcat_s(DumpFilename, MAX_PATH, ".txt");
f = fopen(DumpFilename, "a");
if (f) {
fprintf(f, "0x%08x\n", tick);
for (int jj = 0; jj < height; jj++) {
for (int ii = 0; ii < width; ii++)
fprintf(f, "%01x", dmdDotRaw[jj*width + ii]);
fprintf(f, "\n");
}
fprintf(f, "\n");
fclose(f);
static UINT8 lastCapture[DMD_MAXX * DMD_MAXY] = { 0 };
if (memcmp(lastCapture, dmdDotRaw, width * height) != 0)
{
memcpy(lastCapture, dmdDotRaw, width * height);
strcat_s(DumpFilename, MAX_PATH, ".txt");
f = fopen(DumpFilename, "a");
if (f) {
fprintf(f, "0x%08x\n", tick);
for (int jj = 0; jj < height; jj++) {
for (int ii = 0; ii < width; ii++)
fprintf(f, "%01x", dmdDotRaw[jj * width + ii]);
fprintf(f, "\n");
}
fprintf(f, "\n");
fclose(f);
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/wpc/dmddevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ layout_t layoutAlphanumericFrame(UINT64 gen, UINT16* seg_data, UINT16* seg_data_
case GEN_WPCALPHA_2:
case GEN_S11C:
case GEN_S11B2:
layout = __2x16Alpha;
if (strncasecmp(GameName, "rvrbt", 5) == 0)
if (strncasecmp(GameName, "rvrbt", 5) == 0) // Additional displays for Riverboat Gambler
layout = __1x16Alpha_1x16Num_1x7Num_1x4Num;
else if (strncasecmp(GameName, "polic", 5) == 0) // Police force has an additional display (jackpot)
layout = __1x7Num_1x16Alpha_1x16Num;
else
layout = __2x16Alpha;
break;
case GEN_S11:
layout = __6x4Num_4x1Num;
Expand Down

0 comments on commit 2c91300

Please sign in to comment.