mirror of
https://github.com/holub/mame
synced 2025-05-30 17:41:47 +03:00
added assert for usage of uninitialized stack memory in n64_rdp::SpanDraw1Cycle() (nw)
happens with e.g. n64 -cart vprowrs2 - it actually already goes out of bounds in poly_manager::render_triangle_custom() but since that code is generic it's hard to add an assert there / also added another FBSize check
This commit is contained in:
parent
5ad41fafe5
commit
46051f5655
@ -1983,6 +1983,9 @@ void n64_rdp::DrawTriangle(bool shade, bool texture, bool zbuffer, bool rect)
|
||||
int dzdx_dz = (dzdx >> 16) & 0xffff;
|
||||
|
||||
extent_t Spans[2048];
|
||||
#ifdef MAME_DEBUG
|
||||
memset(Spans, 0xcc, sizeof(Spans));
|
||||
#endif
|
||||
|
||||
SpanBase.m_span_drdy = drdy;
|
||||
SpanBase.m_span_dgdy = dgdy;
|
||||
|
@ -152,6 +152,11 @@ void n64_rdp::SpanDraw1Cycle(INT32 scanline, const extent_t &extent, const rdp_p
|
||||
|
||||
INT32 tile1 = tilenum;
|
||||
|
||||
#ifdef PTR64
|
||||
assert(extent.userdata != (const void *)0xcccccccccccccccc);
|
||||
#else
|
||||
assert(extent.userdata != (const void *)0xcccccccc);
|
||||
#endif
|
||||
rdp_span_aux *userdata = (rdp_span_aux*)extent.userdata;
|
||||
|
||||
INT32 m_clamp_s_diff[8];
|
||||
@ -325,6 +330,11 @@ void n64_rdp::SpanDraw2Cycle(INT32 scanline, const extent_t &extent, const rdp_p
|
||||
INT32 news = 0;
|
||||
INT32 newt = 0;
|
||||
|
||||
#ifdef PTR64
|
||||
assert(extent.userdata != (const void *)0xcccccccccccccccc);
|
||||
#else
|
||||
assert(extent.userdata != (const void *)0xcccccccc);
|
||||
#endif
|
||||
rdp_span_aux *userdata = (rdp_span_aux*)extent.userdata;
|
||||
|
||||
INT32 m_clamp_s_diff[8];
|
||||
@ -367,6 +377,9 @@ void n64_rdp::SpanDraw2Cycle(INT32 scanline, const extent_t &extent, const rdp_p
|
||||
dzinc = 0;
|
||||
}
|
||||
|
||||
if (object.MiscState.FBSize < 2 || object.MiscState.FBSize > 4)
|
||||
fatalerror("unsupported FBSize %d\n", object.MiscState.FBSize);
|
||||
|
||||
int blend_index = (object.OtherModes.alpha_cvg_select ? 2 : 0) | ((object.OtherModes.rgb_dither_sel < 3) ? 1 : 0);
|
||||
int read_index = ((object.MiscState.FBSize - 2) << 1) | object.OtherModes.image_read_en;
|
||||
int write_index = ((object.MiscState.FBSize - 2) << 3) | (object.OtherModes.cvg_dest << 1);
|
||||
|
Loading…
Reference in New Issue
Block a user