summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-06 12:14:47 +0200
committerBad Diode <bd@badd10de.dev>2021-06-06 12:14:47 +0200
commit6f3f65fd5dc7b6bfa13fbdb841548aaaee90b228 (patch)
tree173fb3bbee853d6a18b4f9787ad606289cceb435
parent3a62d618693d34fc807824698e8a64ba9a8d804c (diff)
downloadgba-sequencer-6f3f65fd5dc7b6bfa13fbdb841548aaaee90b228.tar.gz
gba-sequencer-6f3f65fd5dc7b6bfa13fbdb841548aaaee90b228.zip
Add compiler option to disable boundchecks
-rw-r--r--src/renderer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/renderer.c b/src/renderer.c
index 773d50b..2cc5758 100644
--- a/src/renderer.c
+++ b/src/renderer.c
@@ -12,7 +12,7 @@
12// the remaining two available for other background layers. There are 14KB of 12// the remaining two available for other background layers. There are 14KB of
13// sprite memory available, since the backbuffer is located at the end of the 13// sprite memory available, since the backbuffer is located at the end of the
14// VRAM, but if more space is needed it can be moved to the end of the BG 14// VRAM, but if more space is needed it can be moved to the end of the BG
15// charblocks instead as described below. 15// charblocks instead.
16// 16//
17 17
18#include "renderer.h" 18#include "renderer.h"
@@ -21,8 +21,14 @@
21// Keep track of which tiles need to be copied to the frontbuffer. 21// Keep track of which tiles need to be copied to the frontbuffer.
22static u32 dirty_tiles[21] = {0}; 22static u32 dirty_tiles[21] = {0};
23 23
24// TODO: Allow disable bound checking at compile time. 24// Boundchecks can be disable at compile time but this will not always improve
25// the performance and can in fact make it worse. It is possible that this is
26// due to some aliasing optimiztions but not sure at this moment.
27#ifdef DISABLE_BOUNDCHECK_SCREEN
28#define BOUNDCHECK_SCREEN(X,Y)
29#else
25#define BOUNDCHECK_SCREEN(X,Y) if ((X) >= SCREEN_WIDTH || (Y) >= SCREEN_HEIGHT) return; 30#define BOUNDCHECK_SCREEN(X,Y) if ((X) >= SCREEN_WIDTH || (Y) >= SCREEN_HEIGHT) return;
31#endif
26 32
27IWRAM_CODE 33IWRAM_CODE
28void 34void