Skip to content

Commit

Permalink
amiga/amigaaga.cpp: fix playfield-sprite collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosa committed Feb 3, 2025
1 parent c876114 commit e282e24
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/mame/amiga/amigaaga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline)
// - wbenc30 scrolling in lores mode (fmode=3, expects a +58!, verify ddfstrt / delays)
// - sockid_a, alfred gameplay (fmode=1)
// - ssf2t (fmode=3, wants >+100, scrolling is very offset)
// - turbojam gameplay
// (fmode=3, unaffected here, may be missing ddfstop bits given the screen masking)
// - watchtow gameplay (fmode=3, copper timings)
// - cd32 cdtv:insidino copyright screen (fmode=3)
// - cd32 cdtv:labytime intro/tutorial screens
Expand Down Expand Up @@ -670,7 +668,10 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline)
ddf_stop_pixel += hires ? ddf_stop_offset_hires[bitplane_fmode] : ddf_stop_offset_lores[bitplane_fmode];

// - https://github.com/dirkwhoffmann/vAmigaTS/blob/master/Agnus/DDF/DDF/ddf1/ddf1_A500_ECS.JPG
// - turbojam (gameplay, fmode 3) wants this, particularly when scrolling left (+15 isn't enough).
// - turbojam (gameplay) fmode 3 18 9a lores, particularly when scrolling left (+15 isn't enough).
// - aladdin 38 ca fmode 3 lores
// - amigames:burnout 34 b8 fmode 3 hires
// - fbglory (main menu) 28 a4 lores
if ( (CUSTOM_REG(REG_DDFSTRT) & 6) != (CUSTOM_REG(REG_DDFSTOP) & 6))
{
ddf_stop_pixel += defbitoffs;
Expand Down Expand Up @@ -855,20 +856,22 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline)
}

/* compute playfield/sprite collisions for first pixel */
// NOTE: need to << 2 to please the upgraded get_sprite_pixel bitmask
// - dxgalaga player sprite collisions
collide = pfpix0 ^ CUSTOM_REG(REG_CLXCON);
if ((collide & ocolmask) == 0)
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> 5) & 0x01e;
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> (5 + 2)) & 0x01e;
if ((collide & ecolmask) == 0)
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> 1) & 0x1e0;
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> (1 + 2)) & 0x1e0;
if ((collide & (ecolmask | ocolmask)) == 0)
CUSTOM_REG(REG_CLXDAT) |= 0x001;

/* compute playfield/sprite collisions for second pixel */
collide = pfpix1 ^ CUSTOM_REG(REG_CLXCON);
if ((collide & ocolmask) == 0)
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> 5) & 0x01e;
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> (5 + 2)) & 0x01e;
if ((collide & ecolmask) == 0)
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> 1) & 0x1e0;
CUSTOM_REG(REG_CLXDAT) |= (sprpix >> (1 + 2)) & 0x1e0;
if ((collide & (ecolmask | ocolmask)) == 0)
CUSTOM_REG(REG_CLXDAT) |= 0x001;
// TODO: CLXCON2
Expand Down

0 comments on commit e282e24

Please sign in to comment.