diff options
Diffstat (limited to 'source/gfx.cpp')
-rw-r--r-- | source/gfx.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/gfx.cpp b/source/gfx.cpp index d2b8b6e..1b429c6 100644 --- a/source/gfx.cpp +++ b/source/gfx.cpp @@ -154,10 +154,12 @@ extern uint8 Mode7Depths [2]; if (IPPU.DoubleHeightPixels && ((PPU.BGMode != 5 && PPU.BGMode != 6) || !IPPU.Interlace)) \ for (uint32 y = GFX.StartY; y <= GFX.EndY; y++) \ { \ - memmove (SCREEN + (y * 2 + 1) * GFX.Pitch2, \ - SCREEN + y * 2 * GFX.Pitch2, \ - GFX.Pitch2); \ + /* memmove converted: Same malloc, non-overlapping addresses [Neb] */ \ + memcpy (SCREEN + (y * 2 + 1) * GFX.Pitch2, \ + SCREEN + y * 2 * GFX.Pitch2, \ + GFX.Pitch2); \ if(DO_DEPTH){ \ + /* memmove required: Same malloc, potentially overlapping addresses [Neb] */ \ memmove (DEPTH + (y * 2 + 1) * (GFX.PPLx2>>1), \ DEPTH + y * GFX.PPL, \ GFX.PPLx2>>1); \ @@ -1207,6 +1209,7 @@ static void DrawOBJS (bool8 OnMain = FALSE, uint8 D = 0) if(j<i && Windows[j].Pos==GFX.pCurrentClip->Left[clip][4]){ Windows[j].Value = TRUE; } else { + // memmove required: Overlapping addresses [Neb] if(j<i) memmove(&Windows[j+1], &Windows[j], sizeof(Windows[0])*(i-j)); Windows[j].Pos = GFX.pCurrentClip->Left[clip][4]; Windows[j].Value = TRUE; @@ -1214,6 +1217,7 @@ static void DrawOBJS (bool8 OnMain = FALSE, uint8 D = 0) } for(j=0; j<i && Windows[j].Pos<GFX.pCurrentClip->Right[clip][4]; j++); if(j>=i || Windows[j].Pos!=GFX.pCurrentClip->Right[clip][4]){ + // memmove required: Overlapping addresses [Neb] if(j<i) memmove(&Windows[j+1], &Windows[j], sizeof(Windows[0])*(i-j)); Windows[j].Pos = GFX.pCurrentClip->Right[clip][4]; Windows[j].Value = FALSE; @@ -3723,10 +3727,13 @@ void S9xUpdateScreen () // part way down the screen. Scale everything. for (register int32 y = (int32) GFX.StartY - 1; y >= 0; y--) { - memmove (GFX.Screen + y * 2 * GFX.Pitch2, + // memmove converted: Same malloc, different addresses, and identical addresses at line 0 [Neb] + // DS2 DMA notes: This code path is unused [Neb] + memcpy (GFX.Screen + y * 2 * GFX.Pitch2, GFX.Screen + y * GFX.Pitch2, GFX.Pitch2); - memmove (GFX.Screen + (y * 2 + 1) * GFX.Pitch2, + // memmove converted: Same malloc, different addresses [Neb] + memcpy (GFX.Screen + (y * 2 + 1) * GFX.Pitch2, GFX.Screen + y * GFX.Pitch2, GFX.Pitch2); } |