From bba14cfff6dd7038bec53448e0a84d4b93b166bb Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 25 Jan 2025 00:46:26 +0100 Subject: amiga/amigaaga.cpp: implement BRDRBLNK, extend DDF stop for hires fmode 3 to +16 --- hash/amiga_cd.xml | 3 ++- src/mame/amiga/amigaaga.cpp | 42 +++++++++++++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/hash/amiga_cd.xml b/hash/amiga_cd.xml index eec29826b11..22af6c7aa58 100644 --- a/hash/amiga_cd.xml +++ b/hash/amiga_cd.xml @@ -102,7 +102,8 @@ cd32: unsupported [Akiko] close tray after CD32 BIOS plays back music, will othe - Pinball Brain Damage + + Pinball Brain Damage (Europe) 1997 APC & TCP diff --git a/src/mame/amiga/amigaaga.cpp b/src/mame/amiga/amigaaga.cpp index 82ce6696f08..020f0b65d8a 100644 --- a/src/mame/amiga/amigaaga.cpp +++ b/src/mame/amiga/amigaaga.cpp @@ -529,9 +529,13 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) /* loop over the line */ // TODO: copper runs on odd timeslots next_copper_x = m_copper->restore_offset(); + + const bool ecsena = !!BIT(CUSTOM_REG(REG_BPLCON0), 0); + // BRDRBLNK, 17bitlv6:3871 C42 Demo enables this + const rgb_t border_color = ecsena && BIT(CUSTOM_REG(REG_BPLCON3), 5) ? rgb_t(0, 0, 0) : aga_palette[0]; + // TODO: verify where we're missing pixels here for the GFX pitch bitplane corruptions // - wbenc30 scrolling in lores mode (fmode=3, expects a +58!, verify ddfstrt / delays) - // - roadkill title (fmode=3, max +14), gameplay uses fmode=1 // - sockid_a, alfred gameplay (fmode=1) // - virocp_a (fmode=1, +26) // - ssf2t (fmode=3, wants >+100, scrolling is very offset) @@ -546,16 +550,34 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) const int default_bit_offset[] = { 15, 31, 31, 63 }; const int ddf_start_offset_lores[] = { 17, 17, 17, 17 }; - const int ddf_stop_offset_lores[] = { 17 + 15, 17 + 31, 17 + 31, 17 + 63 }; - - // TODO: verify fmode 1/2 stops - // - (fmode 3) wbenc30/kangfu/pbillusn (F10 key)/cd32 (CD splash loading) all expects a +8 offset - const int ddf_start_offset_hires[] = { 9, 9, 9, 9 + 8 }; - const int ddf_stop_offset_hires[] = { 9 + 15, 9 + 15, 9 + 15, 9 + 8 }; + const int ddf_stop_offset_lores[] = { + 17 + 15, + // fmode 1: + // TODO: roadkill gameplay expects an extra +15 somewhere for scrolling to work to the right + // that breaks pbillusn main menu + 17 + 31, + 17 + 31, + 17 + 63 + }; + + const int ddf_start_offset_hires[] = { + 9, + 9, + 9, + // fmode 3: wbenc30/kangfu/pbillusn (F10 key)/cd32 (CD splash loading) all expects a +8 offset + 9 + 8 + }; + const int ddf_stop_offset_hires[] = { + 9 + 15, + 9 + 15, + 9 + 15, + // fmode 3: kangfu/pballdmg wants an extra +16 + 9 + 8 + 16 + }; // TODO: move this to inner block as const // atm the assignment is here just for the hack to work // Alice seems to expect to change it in mid-scanline for bitplane pointers to work - // - amiga_cd:bigred would otherwise offset the intro + // - amiga_cd:bigred would otherwise offset the intro u8 bitplane_fmode = CUSTOM_REG(REG_FMODE) & 0x3; for (int x = 0; x < (amiga_state::SCREEN_WIDTH / 2) + offset_hack[bitplane_fmode]; x++) @@ -647,7 +669,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) /* clear the target pixels to the background color as a starting point */ if (dst != nullptr && !out_of_beam) dst[x*2+0] = - dst[x*2+1] = aga_palette[0]; + dst[x*2+1] = border_color; /* if we hit the first fetch pixel, reset the counters and latch the delays */ if (x == ddf_start_pixel) @@ -664,6 +686,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) case 2: odelay += (CUSTOM_REG(REG_BPLCON1) & 0x0400) >> 6; edelay += (CUSTOM_REG(REG_BPLCON1) & 0x4000) >> 10; + // NOTE: breaks exile_a gameplay with this enabled //odelay ^= 0x10; //edelay ^= 0x10; @@ -677,6 +700,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) odelay ^= 0x20; if (CUSTOM_REG(REG_BPLCON1) & 0x8000) edelay ^= 0x20; + break; } -- cgit v1.2.3