mirror of
https://github.com/holub/mame
synced 2025-10-08 09:30:17 +03:00
seibucop.cpp: disable sprite DMA dest increment for SD Gundam if X positions are outside expected ranges, fix sprite clipping [Angelo Salese]
This commit is contained in:
parent
eaec3c0e87
commit
acbc95ebb5
@ -1275,15 +1275,17 @@ WRITE16_MEMBER( raiden2cop_device::cop_sprite_dma_src_lo_w)
|
|||||||
m_cop_sprite_dma_src = (m_cop_sprite_dma_src&0xffff0000)|(data&0xffff);
|
m_cop_sprite_dma_src = (m_cop_sprite_dma_src&0xffff0000)|(data&0xffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
// guess
|
|
||||||
WRITE16_MEMBER(raiden2cop_device::cop_sprite_dma_inc_w)
|
WRITE16_MEMBER(raiden2cop_device::cop_sprite_dma_inc_w)
|
||||||
{
|
{
|
||||||
if (data)
|
if (data)
|
||||||
printf("Warning: COP RAM 0x410 used with %04x\n", data);
|
printf("Warning: COP RAM 0x410 used with %04x\n", data);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* guess */
|
// Don't increment if the sprite DMA is out of bounds
|
||||||
cop_regs[4] += 8;
|
// (A3 doesn't get updated if it happens, cfr. code at $1e56)
|
||||||
|
// TODO: hardwired for SD Gundam, must be user controllable somehow.
|
||||||
|
if (m_sprite_dma_x_clip >= -160 && m_sprite_dma_x_clip < 320)
|
||||||
|
cop_regs[4] += 8;
|
||||||
m_cop_sprite_dma_src += 6;
|
m_cop_sprite_dma_src += 6;
|
||||||
|
|
||||||
m_cop_sprite_dma_size--;
|
m_cop_sprite_dma_size--;
|
||||||
|
@ -187,6 +187,7 @@ public:
|
|||||||
|
|
||||||
int m_cop_sprite_dma_abs_x,m_cop_sprite_dma_abs_y;
|
int m_cop_sprite_dma_abs_x,m_cop_sprite_dma_abs_y;
|
||||||
int m_sprite_dma_rel_x, m_sprite_dma_rel_y;
|
int m_sprite_dma_rel_x, m_sprite_dma_rel_y;
|
||||||
|
int m_sprite_dma_x_clip;
|
||||||
DECLARE_WRITE16_MEMBER(cop_sprite_dma_abs_y_w);
|
DECLARE_WRITE16_MEMBER(cop_sprite_dma_abs_y_w);
|
||||||
DECLARE_WRITE16_MEMBER(cop_sprite_dma_abs_x_w);
|
DECLARE_WRITE16_MEMBER(cop_sprite_dma_abs_x_w);
|
||||||
|
|
||||||
|
@ -582,7 +582,10 @@ void raiden2cop_device::LEGACY_execute_c480(int offset, uint16_t data)
|
|||||||
sprite_pri |= 0x8000;
|
sprite_pri |= 0x8000;
|
||||||
m_host_space->write_word(cop_regs[4] + offs + 2, sprite_pri);
|
m_host_space->write_word(cop_regs[4] + offs + 2, sprite_pri);
|
||||||
}
|
}
|
||||||
m_host_space->write_word(cop_regs[4] + offs + 4, sprite_x);
|
|
||||||
|
// save into internal clip register, cfr. increment DMA register $410
|
||||||
|
m_sprite_dma_x_clip = sprite_x;
|
||||||
|
m_host_space->write_word(cop_regs[4] + offs + 4, m_sprite_dma_x_clip);
|
||||||
m_host_space->write_word(cop_regs[4] + offs + 6, sprite_y);
|
m_host_space->write_word(cop_regs[4] + offs + 6, sprite_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user