mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-25 04:22:07 +00:00
Cleanup the RPN evaluator somewhat
Make the bool field an actual bool Rename `iReloc` to a more exact `isKnown` (as was already pointed out by some comments) Make the value of `BANK(symbol)` consistent when the argument is invalid
This commit is contained in:
@@ -766,7 +766,7 @@ void out_RelByte(struct Expression *expr)
|
||||
{
|
||||
checkcodesection();
|
||||
checksectionoverflow(1);
|
||||
if (rpn_isReloc(expr)) {
|
||||
if (!rpn_isKnown(expr)) {
|
||||
pCurrentSection->tData[nPC] = 0;
|
||||
createpatch(PATCHTYPE_BYTE, expr);
|
||||
pCurrentSection->nPC++;
|
||||
@@ -801,7 +801,7 @@ void out_RelWord(struct Expression *expr)
|
||||
{
|
||||
checkcodesection();
|
||||
checksectionoverflow(2);
|
||||
if (rpn_isReloc(expr)) {
|
||||
if (!rpn_isKnown(expr)) {
|
||||
pCurrentSection->tData[nPC] = 0;
|
||||
pCurrentSection->tData[nPC + 1] = 0;
|
||||
createpatch(PATCHTYPE_WORD, expr);
|
||||
@@ -838,7 +838,7 @@ void out_RelLong(struct Expression *expr)
|
||||
{
|
||||
checkcodesection();
|
||||
checksectionoverflow(4);
|
||||
if (rpn_isReloc(expr)) {
|
||||
if (!rpn_isKnown(expr)) {
|
||||
pCurrentSection->tData[nPC] = 0;
|
||||
pCurrentSection->tData[nPC + 1] = 0;
|
||||
pCurrentSection->tData[nPC + 2] = 0;
|
||||
|
||||
Reference in New Issue
Block a user