mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Fix develop compilation error
This bug slipped by because my pre-commit hook for testing was broken...
This commit is contained in:
@@ -439,12 +439,12 @@ static void applyFilePatches(struct Section *section, struct Section *dataSectio
|
|||||||
/* Target is relative to the byte *after* the operand */
|
/* Target is relative to the byte *after* the operand */
|
||||||
uint16_t address = patch->pcSection->org
|
uint16_t address = patch->pcSection->org
|
||||||
+ patch->pcOffset + 1;
|
+ patch->pcOffset + 1;
|
||||||
int16_t offset = value - address;
|
int16_t jumpOffset = value - address;
|
||||||
|
|
||||||
if (offset < -128 || offset > 127)
|
if (jumpOffset < -128 || jumpOffset > 127)
|
||||||
error("%s: jr target out of reach (expected -129 < %" PRId16 " < 128)",
|
error("%s: jr target out of reach (expected -129 < %" PRId16 " < 128)",
|
||||||
patch->fileName, offset);
|
patch->fileName, jumpOffset);
|
||||||
dataSection->data[offset] = offset & 0xFF;
|
dataSection->data[offset] = jumpOffset & 0xFF;
|
||||||
} else {
|
} else {
|
||||||
/* Patch a certain number of bytes */
|
/* Patch a certain number of bytes */
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user