Skip to content

Commit

Permalink
DMD: really fix Capcom
Browse files Browse the repository at this point in the history
  • Loading branch information
vbousquet committed Sep 18, 2024
1 parent a24d9dc commit fdf5784
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
41 changes: 16 additions & 25 deletions src/wpc/capcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,23 +946,18 @@ MACHINE_DRIVER_END
/*** 128 X 32 NORMAL SIZE DMD ***/
/********************************/
PINMAME_VIDEO_UPDATE(cc_dmd128x32) {
int ii, jj, kk;
UINT16 *RAM;

UINT32 offset = locals.visible_page ? 0x800 * locals.visible_page : 0;
RAM = ramptr+offset;
for (ii = 0; ii < 32; ii++) {
UINT8 *line = &coreGlobals.dmdDotRaw[ii*layout->length];
for (kk = 0; kk < 16; kk++) {
UINT16* RAM = ramptr + 0x800 * locals.visible_page + 0x10;
UINT8* line = &coreGlobals.dmdDotRaw[0];
for (int ii = 0; ii < 32; ii++) {
for (int kk = 0; kk < 16; kk++) {
UINT16 intens1 = RAM[0];
for(jj=0;jj<8;jj++) {
*line++ = (intens1&0xc000)>>14;
for(int jj = 0; jj < 8; jj++) {
*line++ = (intens1 >> 14) & 0x0003;
intens1 <<= 2;
}
RAM+=1;
RAM += 1;
}
*line++ = 0;
RAM+=16;
RAM += 16;
}
core_dmd_video_update(bitmap, cliprect, layout, NULL);
return 0;
Expand All @@ -972,26 +967,22 @@ PINMAME_VIDEO_UPDATE(cc_dmd128x32) {
/*** 256 X 64 SUPER HUGE DMD ***/
/*******************************/
PINMAME_VIDEO_UPDATE(cc_dmd256x64) {
int ii, jj, kk;
UINT16 *RAM;

UINT32 offset = locals.visible_page ? 0x800 * locals.visible_page : 0;
RAM = ramptr+offset;
for (ii = 0; ii < 64; ii++) {
UINT16 *RAM = ramptr + 0x800 * locals.visible_page;
for (int ii = 0; ii < 64; ii++) {
UINT8 *linel = &coreGlobals.dmdDotRaw[ii * layout->length];
UINT8 *liner = &coreGlobals.dmdDotRaw[ii * layout->length + 128];
for (kk = 0; kk < 16; kk++) {
for (int kk = 0; kk < 16; kk++) {
UINT16 intensl = RAM[0];
UINT16 intensr = RAM[0x10];
for(jj=0;jj<8;jj++) {
*linel++ = (intensl&0xc000)>>14;
for(int jj=0;jj<8;jj++) {
*linel++ = (intensl >> 14) & 0x0003;
intensl <<= 2;
*liner++ = (intensr&0xc000)>>14;
*liner++ = (intensr >> 14) & 0x0003;
intensr <<= 2;
}
RAM+=1;
RAM += 1;
}
RAM+=16;
RAM += 16;
}
core_dmd_video_update(bitmap, cliprect, layout, NULL);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/wpc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,7 @@ void core_dmd_video_update(struct mame_bitmap *bitmap, const struct rectangle *c
dmdDotLum = &coreGlobals.dmdDotLum[0];
if ((core_gameData->gen & GEN_SAM) == 0) {
const int shift = (core_gameData->gen & GEN_SPA) != 0 ? 4 : 6;
for (int ii = 0; ii < layout->length; ii++)
for (int ii = 0; ii < layout->length * layout->start; ii++)
dmdDotLum[ii] = dmdDotRaw[ii] << shift;
}
}
Expand Down

0 comments on commit fdf5784

Please sign in to comment.