shithub: rgbds

Download patch

ref: 729683fb1f960f06b402973fd5d68c978a4a11dc
parent: ed6e4c476955ff1687f43ee17e90f661f0add6e6
author: Antonio Niño Díaz <[email protected]>
date: Sun Apr 16 15:55:00 EDT 2017

Remove RPN_RANGECHECK

Leftover code from ASMotor.

Signed-off-by: Antonio Niño Díaz <[email protected]>

--- a/include/asm/mylink.h
+++ b/include/asm/mylink.h
@@ -32,8 +32,6 @@
 
 	RPN_HRAM,
 
-	RPN_RANGECHECK,
-
 	RPN_CONST = 0x80,
 	RPN_SYM = 0x81
 };
--- a/include/asm/rpn.h
+++ b/include/asm/rpn.h
@@ -76,9 +76,6 @@
 UWORD rpn_PopByte(struct Expression * expr);
 void rpn_Bank(struct Expression * expr, char *tzSym);
 void rpn_Reset(struct Expression * expr);
-int
-rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low,
-    SLONG high);
 void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1);
 
 #endif
--- a/include/link/mylink.h
+++ b/include/link/mylink.h
@@ -45,8 +45,6 @@
 
 	RPN_HRAM,
 
-	RPN_RANGECHECK,
-
 	RPN_CONST = 0x80,
 	RPN_SYM = 0x81
 };
--- a/src/asm/rpn.c
+++ b/src/asm/rpn.c
@@ -128,28 +128,6 @@
 		yyerror("BANK argument must be a relocatable identifier");
 }
 
-int
-rpn_RangeCheck(struct Expression * expr, struct Expression * src, SLONG low,
-    SLONG high)
-{
-	*expr = *src;
-
-	if (rpn_isReloc(src)) {
-		pushbyte(expr, RPN_RANGECHECK);
-		pushbyte(expr, low);
-		pushbyte(expr, low >> 8);
-		pushbyte(expr, low >> 16);
-		pushbyte(expr, low >> 24);
-		pushbyte(expr, high);
-		pushbyte(expr, high >> 8);
-		pushbyte(expr, high >> 16);
-		pushbyte(expr, high >> 24);
-		return (1);
-	} else {
-		return (expr->nVal >= low && expr->nVal <= high);
-	}
-}
-
 void
 rpn_CheckHRAM(struct Expression * expr, struct Expression * src)
 {
--- a/src/link/patch.c
+++ b/src/link/patch.c
@@ -206,29 +206,6 @@
 			rpnpush(getsymbank(t));
 			size -= 4;
 			break;
-		case RPN_RANGECHECK:
-			{
-				SLONG low, high;
-
-				low = (*rpn++);
-				low |= (*rpn++) << 8;
-				low |= (*rpn++) << 16;
-				low |= (*rpn++) << 24;
-				high = (*rpn++);
-				high |= (*rpn++) << 8;
-				high |= (*rpn++) << 16;
-				high |= (*rpn++) << 24;
-				t = rpnpop();
-				if (t < low || t > high) {
-					errx(1,
-					    "%s(%ld) : Value must be in the range [%ld;%ld]",
-					    pPatch->pzFilename,
-					    pPatch->nLineNo, low, high);
-				}
-				rpnpush(t);
-				size -= 8;
-				break;
-			}
 		}
 	}
 	return (rpnpop());
--- a/src/rgbds.rgbformat.5
+++ b/src/rgbds.rgbformat.5
@@ -171,8 +171,6 @@
 A symbol ID follows.
 .It Li $16 Ta Li HRAMCheck.
 Check if the value is in HRAM, AND it with 0xFF.
-.It Li $17 No Ta RangeCheck, LOW and HIGH signed LONGs follow.
-Check a value to see if it's within the range [LOW;HIGH].
 .It Li $80 Ta Ar LONG
 integer follows.
 .It Li $81 Ta Ar LONG