From c038109806f74b4171dde22e844771c6ee23e446 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 15 Dec 2020 23:42:20 -0600 Subject: [PATCH] [nostalgia/core/gba] Add sprite update buffer overflow assert --- src/nostalgia/core/gba/gfx.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index e3b7cd58..6bd60622 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -235,6 +235,7 @@ void hideSprite(Context*, unsigned idx) { } void setSprite(Context*, unsigned idx, unsigned x, unsigned y, unsigned tileIdx, unsigned spriteShape, unsigned spriteSize, unsigned flipX) { + oxAssert(g_spriteUpdates < config::GbaSpriteBufferLen, "Sprite update buffer overflow"); GbaSpriteAttrUpdate oa; oa.attr0 = static_cast(y & ox::onMask(7)) | (static_cast(1) << 10) // enable alpha