Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/wpc/dedmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ static void dmd32_vblank(int which) {
assert((base & 0x00FF) == 0x0000); // As the mapping of lowest 8 bits is not implemented (would need complex data copy and does not seem to be used by any game)
assert(crtc6845_rasterized_height_r(0) == 64); // As the implementation requires this to be always true
unsigned int src = /*((base >> 3) & 0x000F) | ((base << 1) & 0x0100) |*/ ((base << 2) & 0x7C00);
core_dmd_submit_frame(core_gameData->lcdLayout, dmdlocals.RAMbankPtr + src, 2); // First frame has been displayed 2/3 of the time (500kHz row clock)
core_dmd_submit_frame(core_gameData->lcdLayout, dmdlocals.RAMbankPtr + (src | 0x0200), 1); // Second frame has been displayed 1/3 of the time (1MHz row clock)
const core_tLCDLayout* layout = core_gameData->lcdLayout->lptr ? core_gameData->lcdLayout->lptr : core_gameData->lcdLayout;
core_dmd_submit_frame(layout, dmdlocals.RAMbankPtr + src, 2); // First frame has been displayed 2/3 of the time (500kHz row clock)
core_dmd_submit_frame(layout, dmdlocals.RAMbankPtr + (src | 0x0200), 1); // Second frame has been displayed 1/3 of the time (1MHz row clock)
if (crtc6845_cursor_address_r(0)) // Guessing that the CURSOR signal is used to generate FIRQ
cpu_set_irq_line(dmdlocals.brdData.cpuNo, M6809_FIRQ_LINE, PULSE_LINE);
}
Expand Down Expand Up @@ -194,7 +195,8 @@ static void dmd32_init(struct sndbrdData *brdData) {
assert(0); // Unsupported board revision

// Init PWM shading
core_dmd_pwm_init(core_gameData->lcdLayout, CORE_DMD_PWM_FILTER_DE_128x32, CORE_DMD_PWM_COMBINER_SUM_2_1, 0);
const core_tLCDLayout* layout = core_gameData->lcdLayout->lptr ? core_gameData->lcdLayout->lptr : core_gameData->lcdLayout;
core_dmd_pwm_init(layout, CORE_DMD_PWM_FILTER_DE_128x32, CORE_DMD_PWM_COMBINER_SUM_2_1, 0);
}

static void dmd32_exit(int boardNo) {
Expand Down Expand Up @@ -227,8 +229,7 @@ PINMAME_VIDEO_UPDATE(dedmd32_update) {
will update after the next DMD event. */
}
#endif
core_dmd_video_update(bitmap, cliprect, layout);
return 0;
return core_dmd_video_update(bitmap, cliprect, layout);
}

/*-----------------------------
Expand Down
40 changes: 19 additions & 21 deletions src/wpc/sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,12 +994,12 @@ static WRITE32_HANDLER(sambank_w)
int bits = 0;
for (int y = 0; y < 7; y++)
bits = (bits << 1) | ((samlocals.wptLEDs[i][y] >> (3 + x)) & 0x01);
coreGlobals.drawSeg[35 * dmd_y + 5 * dmd_x + x] = bits;
coreGlobals.drawSeg[35 * dmd_y + 5 * dmd_x + 4 - x] = bits;
}
}
}
samlocals.prevCol = samlocals.col;
}
samlocals.prevCol = samlocals.col;
}
// Previous implementation using PWM physic outputs (somewhat overkill for LED matrix, but works)
/*for (int row = 0; row < 10; row++) { // 2 rows of 7 LED matrix, each matrix being 7 cols x 5 rows (so 10 rows, 49 cols)
Expand Down Expand Up @@ -1094,28 +1094,26 @@ static WRITE32_HANDLER(sambank_w)
case 0x0010: row = 4; break;
default: assert(FALSE); break;
}
if (row >= 0)
{
samlocals.wofLEDs[row][0] = (samlocals.dmdLatch[4] << 1) | ((samlocals.dmdLatch[3] >> 6) & 0x01);
samlocals.wofLEDs[row][1] = (samlocals.dmdLatch[3] << 2) | ((samlocals.dmdLatch[2] >> 5) & 0x03);
samlocals.wofLEDs[row][2] = (samlocals.dmdLatch[2] << 3) | ((samlocals.dmdLatch[1] >> 4) & 0x07);
samlocals.wofLEDs[row][3] = (samlocals.dmdLatch[1] << 4) | ((samlocals.dmdLatch[0] >> 3) & 0x0F);
samlocals.wofLEDs[row][4] = (samlocals.dmdLatch[0] << 5);
if (samlocals.col == 0x010) { // Last row, submit frame
const core_tLCDLayout* layout = &core_gameData->lcdLayout[1];
// Submit to core DMD handler
core_dmd_submit_frame(layout, &samlocals.wofLEDs[0][0], 1);
// Output mini DMD as LED segments (backward compatibility)
for (int ii = 0; ii < 35; ii++) {
UINT16 bits = 0;
for (int kk = 0; kk < 5; kk++)
bits = (bits << 1) | ((samlocals.wofLEDs[kk][ii / 8] >> (ii & 7)) & 0x01);
coreGlobals.drawSeg[ii] = bits;
}
samlocals.wofLEDs[row][0] = (samlocals.dmdLatch[4] << 1) | ((samlocals.dmdLatch[3] >> 6) & 0x01);
samlocals.wofLEDs[row][1] = (samlocals.dmdLatch[3] << 2) | ((samlocals.dmdLatch[2] >> 5) & 0x03);
samlocals.wofLEDs[row][2] = (samlocals.dmdLatch[2] << 3) | ((samlocals.dmdLatch[1] >> 4) & 0x07);
samlocals.wofLEDs[row][3] = (samlocals.dmdLatch[1] << 4) | ((samlocals.dmdLatch[0] >> 3) & 0x0F);
samlocals.wofLEDs[row][4] = (samlocals.dmdLatch[0] << 5);
if (samlocals.col == 0x010) { // Last row, submit frame
const core_tLCDLayout* layout = &core_gameData->lcdLayout[1];
// Submit to core DMD handler
core_dmd_submit_frame(layout, &samlocals.wofLEDs[0][0], 1);
// Output mini DMD as LED segments (backward compatibility)
for (int ii = 0; ii < 35; ii++) {
UINT16 bits = 0;
const int c = ii / 8, shift = 7 - (ii & 7);
for (int kk = 0; kk < 5; kk++)
bits = (bits << 1) | ((samlocals.wofLEDs[kk][c] >> shift) & 0x01);
coreGlobals.drawSeg[ii] = bits;
}
}
samlocals.prevCol = samlocals.col;
}
samlocals.prevCol = samlocals.col;
}
// Previous implementation using PWM physic outputs (somewhat overkill for LED matrix, but works)
/*int col = blank ? 0 : samlocals.dmdLatch[5];
Expand Down
Loading
Loading