mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 03:02:06 +00:00
Add ds cnt, byte syntax
As suggested by https://github.com/rednex/rgbds/issues/350#issuecomment-498030458 The order `count` then `byte` was decided after some discussion: - First argument consistent with single-arg syntax - Intuitive at least to some people other than myself - Consistent with other assemblers, at least ca65
This commit is contained in:
@@ -295,11 +295,7 @@ void out_String(char const *s)
|
||||
absByteBypassCheck(*s++);
|
||||
}
|
||||
|
||||
/*
|
||||
* Output a relocatable byte. Checking will be done to see if it
|
||||
* is an absolute value in disguise.
|
||||
*/
|
||||
void out_RelByte(struct Expression *expr)
|
||||
static void outputExpression(struct Expression const *expr)
|
||||
{
|
||||
if (!rpn_isKnown(expr)) {
|
||||
out_CreatePatch(PATCHTYPE_BYTE, expr);
|
||||
@@ -307,6 +303,26 @@ void out_RelByte(struct Expression *expr)
|
||||
} else {
|
||||
out_AbsByte(expr->nVal);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Output a relocatable byte. Checking will be done to see if it
|
||||
* is an absolute value in disguise.
|
||||
*/
|
||||
void out_RelByte(struct Expression *expr)
|
||||
{
|
||||
outputExpression(expr);
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Output several copies of a relocatable byte. Checking will be done to see if
|
||||
* it is an absolute value in disguise.
|
||||
*/
|
||||
void out_RelBytes(struct Expression *expr, int32_t n)
|
||||
{
|
||||
while (n--)
|
||||
outputExpression(expr);
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user