From d25ed31d97d6c3c4f3675718b90343089cb3228e Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Wed, 24 Aug 2011 02:25:15 +0000 Subject: [PATCH] Hacked around the mask screen thing (any idea here is welcome) --- src/mame/drivers/taito_f3.c | 8 +++--- src/mame/video/taitojc.c | 56 ++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c index 30b655dab6d..a3cc14b03ba 100644 --- a/src/mame/drivers/taito_f3.c +++ b/src/mame/drivers/taito_f3.c @@ -28,10 +28,10 @@ Taito custom chips on motherboard: - TC0630 FDP - Playfield generator? (Nearest tile roms) - TC0640 FI0 - I/O & watchdog? - TC0650 FDA - Priority mixer? (Near paletteram & video output) - TC0660 FCM - Sprites? (Nearest sprite roms) + TC0630FDP - Playfield generator? (Nearest tile roms) + TC0640FIO - I/O & watchdog? + TC0650FDA - Priority mixer? (Near paletteram & video output) + TC0660FCM - Sprites? (Nearest sprite roms) ***************************************************************************/ diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c index 5a0c8952bf0..2e83c035e41 100644 --- a/src/mame/video/taitojc.c +++ b/src/mame/video/taitojc.c @@ -184,14 +184,21 @@ static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectan /* this bit seems to set up border at left/right of screen (reads at 0xffc00) */ if(mask_screen) { + if(address != 0xffc00) + { + popmessage("mask screen with %08x, contact MAMEdev",address); + return; + } + for (j=y1; j < y2; j++) { UINT16 *d = BITMAP_ADDR16(bitmap, j, 0); - //int index = (iy * (width / 8)) + ix; + + UINT8 pen = state->m_objlist[(address-0xff000)/4]; for (i=x1; i < x2; i++) { - d[i] = v[0]; + d[i] = pen; //index++; } @@ -210,14 +217,12 @@ static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectan { UINT8 pen = (v[BYTE4_XOR_BE(index)] & 0xf0) >> 4; if (pen != 0) - { d[i] = palette + pen; - } + pen = (v[BYTE4_XOR_BE(index)] & 0x0f); if (pen != 0) - { d[i+1] = palette + pen; - } + index++; } @@ -226,23 +231,25 @@ static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectan } else // 8bpp { - for (j=y1; j < y2; j++) { - UINT16 *d = BITMAP_ADDR16(bitmap, j, 0); - int index = (iy * width) + ix; - - for (i=x1; i < x2; i++) + for (j=y1; j < y2; j++) { - UINT8 pen = v[BYTE4_XOR_BE(index)]; - if (pen != 0) + UINT16 *d = BITMAP_ADDR16(bitmap, j, 0); + int index = (iy * width) + ix; + + for (i=x1; i < x2; i++) { - d[i] = palette + pen; + UINT8 pen = v[BYTE4_XOR_BE(index)]; + if (pen != 0) + { + d[i] = palette + pen; + } + + index++; } - index++; + iy++; } - - iy++; } } } @@ -291,18 +298,21 @@ static void draw_object_bank(running_machine &machine, bitmap_t *bitmap, const r { taitojc_state *state = machine.driver_data(); UINT16 start_offs; +// UINT8 double_xy; int i; start_offs = ((bank_type+1)*0x400)/4; +// double_xy = (state->m_objlist[(0xd1c+bank_type*0x10)/4] & 0x20000000) >> 29; + + /* probably a core bug in there (otherwise objects sticks on screen in Densya de Go) */ + if(bank_type == 1 && (!(state->m_objlist[0xfc4/4] & 0x2000))) + return; for (i=start_offs-2; i >= (start_offs-0x400/4); i-=2) { UINT32 w1 = state->m_objlist[i + 0]; UINT32 w2 = state->m_objlist[i + 1]; - //if(i < 6) // don't try to draw non-video stuff - // return; - if (((w2 & 0x200000) >> 21) == pri) { draw_object(machine, bitmap, cliprect, w1, w2, bank_type); @@ -338,12 +348,14 @@ SCREEN_UPDATE( taitojc ) //popmessage("%08x %08x %08x %08x",state->m_objlist[0xd20/4],state->m_objlist[0xd24/4],state->m_objlist[0xd28/4],state->m_objlist[0xd2c/4]); - draw_object_bank(screen->machine(), bitmap, cliprect, ((state->m_objlist[0xfc4/4] & 0x2000) >> 13), 0); + draw_object_bank(screen->machine(), bitmap, cliprect, 0, 0); + draw_object_bank(screen->machine(), bitmap, cliprect, 1, 0); draw_object_bank(screen->machine(), bitmap, cliprect, 2, 0); copybitmap_trans(bitmap, state->m_framebuffer, 0, 0, 0, 0, cliprect, 0); - draw_object_bank(screen->machine(), bitmap, cliprect, ((state->m_objlist[0xfc4/4] & 0x2000) >> 13), 1); + draw_object_bank(screen->machine(), bitmap, cliprect, 0, 1); + draw_object_bank(screen->machine(), bitmap, cliprect, 1, 1); draw_object_bank(screen->machine(), bitmap, cliprect, 2, 1); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0,0);