shithub: rgbds

Download patch

ref: aa90a53f34042b9839c6480efc61314c8af03574
parent: 598c923506a25e8e3a737e1e6d588a7404d4d221
author: ISSOtm <[email protected]>
date: Sun Feb 9 10:40:10 EST 2020

Move 1-byte overflow check to `out_AbsByte`

This check is already performed in bulk by all functions calling it except
`out_AbsByte`, adding extra overhead to those.

--- a/src/asm/section.c
+++ b/src/asm/section.c
@@ -201,7 +201,6 @@
  */
 static void absByteBypassCheck(int32_t b)
 {
-	checksectionoverflow(1);
 	b &= 0xFF;
 	pCurrentSection->tData[nPC] = b;
 	pCurrentSection->nPC++;
@@ -214,6 +213,7 @@
 void out_AbsByte(int32_t b)
 {
 	checkcodesection();
+	checksectionoverflow(1);
 	absByteBypassCheck(b);
 }