mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove RPN_RANGECHECK
Leftover code from ASMotor. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -32,8 +32,6 @@ enum {
|
|||||||
|
|
||||||
RPN_HRAM,
|
RPN_HRAM,
|
||||||
|
|
||||||
RPN_RANGECHECK,
|
|
||||||
|
|
||||||
RPN_CONST = 0x80,
|
RPN_CONST = 0x80,
|
||||||
RPN_SYM = 0x81
|
RPN_SYM = 0x81
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,9 +76,6 @@ void rpn_UNNOT(struct Expression * expr, struct Expression * src);
|
|||||||
UWORD rpn_PopByte(struct Expression * expr);
|
UWORD rpn_PopByte(struct Expression * expr);
|
||||||
void rpn_Bank(struct Expression * expr, char *tzSym);
|
void rpn_Bank(struct Expression * expr, char *tzSym);
|
||||||
void rpn_Reset(struct Expression * expr);
|
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);
|
void rpn_CheckHRAM(struct Expression * expr, struct Expression * src1);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ enum eRpnData {
|
|||||||
|
|
||||||
RPN_HRAM,
|
RPN_HRAM,
|
||||||
|
|
||||||
RPN_RANGECHECK,
|
|
||||||
|
|
||||||
RPN_CONST = 0x80,
|
RPN_CONST = 0x80,
|
||||||
RPN_SYM = 0x81
|
RPN_SYM = 0x81
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -128,28 +128,6 @@ rpn_Bank(struct Expression * expr, char *tzSym)
|
|||||||
yyerror("BANK argument must be a relocatable identifier");
|
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
|
void
|
||||||
rpn_CheckHRAM(struct Expression * expr, struct Expression * src)
|
rpn_CheckHRAM(struct Expression * expr, struct Expression * src)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -206,29 +206,6 @@ calcrpn(struct sPatch * pPatch)
|
|||||||
rpnpush(getsymbank(t));
|
rpnpush(getsymbank(t));
|
||||||
size -= 4;
|
size -= 4;
|
||||||
break;
|
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());
|
return (rpnpop());
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ function.
|
|||||||
A symbol ID follows.
|
A symbol ID follows.
|
||||||
.It Li $16 Ta Li HRAMCheck.
|
.It Li $16 Ta Li HRAMCheck.
|
||||||
Check if the value is in HRAM, AND it with 0xFF.
|
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
|
.It Li $80 Ta Ar LONG
|
||||||
integer follows.
|
integer follows.
|
||||||
.It Li $81 Ta Ar LONG
|
.It Li $81 Ta Ar LONG
|
||||||
|
|||||||
Reference in New Issue
Block a user