Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Source/PC/Graphics_PC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,14 @@ bool cGraphics_PC::Sprite_OnScreen_Check() {
mFodder->mVideo_Draw_Columns -= ax;
ax >>= 1;
mFodder->mVideo_Draw_FrameDataPtr += ax;

// Ensure the destination X never remains negative after clipping.
// A remaining -1 here would underflow the destination pointer in Video_Draw_8.
if (mFodder->mVideo_Draw_PosX < 0)
{
++mFodder->mVideo_Draw_PosX;
--mFodder->mVideo_Draw_Columns;
}
}

ax = mFodder->mVideo_Draw_PosX + mFodder->mVideo_Draw_Columns;
Expand Down
Loading