mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Fix unary NOT being broken
nVal wasn't being set, this made the operator a no-op on constant expressions
This commit is contained in:
@@ -65,7 +65,7 @@ void mergetwoexpressions(struct Expression *expr, const struct Expression *src1,
|
|||||||
/*
|
/*
|
||||||
* Add a byte to the RPN expression
|
* Add a byte to the RPN expression
|
||||||
*/
|
*/
|
||||||
void pushbyte(struct Expression *expr, int b)
|
void pushbyte(struct Expression *expr, uint8_t b)
|
||||||
{
|
{
|
||||||
if (expr->nRPNLength == expr->nRPNCapacity) {
|
if (expr->nRPNLength == expr->nRPNCapacity) {
|
||||||
if (expr->nRPNCapacity == 0)
|
if (expr->nRPNCapacity == 0)
|
||||||
@@ -82,7 +82,7 @@ void pushbyte(struct Expression *expr, int b)
|
|||||||
fatalerror("No memory for RPN expression");
|
fatalerror("No memory for RPN expression");
|
||||||
}
|
}
|
||||||
|
|
||||||
expr->tRPN[expr->nRPNLength++] = b & 0xFF;
|
expr->tRPN[expr->nRPNLength++] = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -225,6 +225,7 @@ void rpn_CheckHRAM(struct Expression *expr, const struct Expression *src)
|
|||||||
void rpn_LOGNOT(struct Expression *expr, const struct Expression *src)
|
void rpn_LOGNOT(struct Expression *expr, const struct Expression *src)
|
||||||
{
|
{
|
||||||
*expr = *src;
|
*expr = *src;
|
||||||
|
expr->nVal = !expr->nVal;
|
||||||
pushbyte(expr, RPN_LOGUNNOT);
|
pushbyte(expr, RPN_LOGUNNOT);
|
||||||
expr->nRPNPatchSize++;
|
expr->nRPNPatchSize++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user