Support BANK() correctly when given WRAMX/SRAM/VRAM labels.

(Mostly) from Antonio Niño Díaz.
This commit is contained in:
Anthony J. Bentley
2015-02-22 03:33:18 -07:00
parent 9d0203a4ee
commit bc60b85785
3 changed files with 55 additions and 8 deletions

View File

@@ -1073,7 +1073,7 @@ section:
}
} else if ($4 == SECT_WRAMX) {
if ($8 >= 1 && $8 <= 7) {
out_NewAbsSection($2, $4, -1, $8);
out_NewAbsSection($2, $4, -1, $8 - 1);
} else {
yyerror("WRAMX bank value $%x out of range (1 to 7)", $8);
}
@@ -1110,7 +1110,7 @@ section:
} else if ($4 == SECT_WRAMX) {
if ($6 >= 0 && $6 < 0x10000) {
if ($11 >= 1 && $11 <= 7) {
out_NewAbsSection($2, $4, $6, $11);
out_NewAbsSection($2, $4, $6, $11 - 1);
} else {
yyerror("WRAMX bank value $%x out of range (1 to 7)", $11);
}