mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
added asserts to src/mame/machine/megavdp.c to indicate array out-of-bounds accesses (nw)
This commit is contained in:
parent
98bcb7c341
commit
7da9cc8ee8
@ -1066,7 +1066,7 @@ static const UINT8 vc_ntsc_224[] =
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,/**/0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
|
||||
0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
|
||||
0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
|
||||
};
|
||||
|
||||
static const UINT8 vc_ntsc_240[] =
|
||||
@ -1111,7 +1111,7 @@ static const UINT8 vc_pal_224[] =
|
||||
0x00, 0x01, 0x02,/**/0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
|
||||
0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,
|
||||
0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
|
||||
};
|
||||
|
||||
static const UINT8 vc_pal_240[] =
|
||||
@ -1135,7 +1135,7 @@ static const UINT8 vc_pal_240[] =
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,/**/0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
|
||||
0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,
|
||||
0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
|
||||
};
|
||||
|
||||
|
||||
@ -1196,9 +1196,15 @@ UINT16 sega_genesis_vdp_device::megadriv_read_hv_counters(running_machine &machi
|
||||
}
|
||||
|
||||
if (MEGADRIVE_REG01_240_LINE)
|
||||
{
|
||||
assert(vpos % megadrive_total_scanlines < (m_vdp_pal ? sizeof(vc_pal_240) : sizeof(vc_ntsc_240)));
|
||||
vpos = m_vdp_pal ? vc_pal_240[vpos % megadrive_total_scanlines] : vc_ntsc_240[vpos % megadrive_total_scanlines];
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(vpos % megadrive_total_scanlines < (m_vdp_pal ? sizeof(vc_pal_224) : sizeof(vc_ntsc_224)));
|
||||
vpos = m_vdp_pal ? vc_pal_224[vpos % megadrive_total_scanlines] : vc_ntsc_224[vpos % megadrive_total_scanlines];
|
||||
}
|
||||
|
||||
if (hpos>0xf7) hpos -=0x49;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user