From fdf5784e11473fc27570a372d24a694671f2b671 Mon Sep 17 00:00:00 2001 From: Vincent Bousquet Date: Wed, 18 Sep 2024 22:47:27 +0200 Subject: [PATCH] DMD: really fix Capcom --- src/wpc/capcom.c | 41 ++++++++++++++++------------------------- src/wpc/core.c | 2 +- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/wpc/capcom.c b/src/wpc/capcom.c index 99ee06812..768f9865f 100644 --- a/src/wpc/capcom.c +++ b/src/wpc/capcom.c @@ -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; @@ -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; diff --git a/src/wpc/core.c b/src/wpc/core.c index 771a90ae8..c13c7b97f 100644 --- a/src/wpc/core.c +++ b/src/wpc/core.c @@ -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; } }