mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Parse bank capacities
This commit is contained in:
@@ -161,7 +161,7 @@ Implies
|
|||||||
Set a maximum number of tiles that can be placed in each VRAM bank.
|
Set a maximum number of tiles that can be placed in each VRAM bank.
|
||||||
.Ar nb_tiles
|
.Ar nb_tiles
|
||||||
should be one or two numbers between 0 and 256, separated by a comma; if the latter is omitted, it defaults to 0.
|
should be one or two numbers between 0 and 256, separated by a comma; if the latter is omitted, it defaults to 0.
|
||||||
Setting either number to 0 prevents any tiles froom being output in that bank.
|
Setting either number to 0 prevents any tiles from being output in that bank.
|
||||||
.Pp
|
.Pp
|
||||||
If more tiles are generated than can fit in the two banks combined,
|
If more tiles are generated than can fit in the two banks combined,
|
||||||
.Nm
|
.Nm
|
||||||
|
|||||||
@@ -307,7 +307,30 @@ int main(int argc, char *argv[]) {
|
|||||||
options.allowDedup = true;
|
options.allowDedup = true;
|
||||||
break;
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
options.maxNbTiles = {0, 0}; // TODO
|
options.maxNbTiles[0] = parseNumber(arg, "Number of tiles in bank 0", 256);
|
||||||
|
if (options.maxNbTiles[0] > 256) {
|
||||||
|
error("Bank 0 cannot contain more than 256 tiles");
|
||||||
|
}
|
||||||
|
if (*arg == '\0') {
|
||||||
|
options.maxNbTiles[1] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
skipWhitespace(arg);
|
||||||
|
if (*arg != ',') {
|
||||||
|
error("Bank capacity must be one or two comma-separated numbers, not \"%s\"",
|
||||||
|
musl_optarg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
skipWhitespace(arg);
|
||||||
|
options.maxNbTiles[1] = parseNumber(arg, "Number of tiles in bank 1", 256);
|
||||||
|
if (options.maxNbTiles[1] > 256) {
|
||||||
|
error("Bank 1 cannot contain more than 256 tiles");
|
||||||
|
}
|
||||||
|
if (*arg != '\0') {
|
||||||
|
error("Bank capacity must be one or two comma-separated numbers, not \"%s\"",
|
||||||
|
musl_optarg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
options.nbPalettes = 0; // TODO
|
options.nbPalettes = 0; // TODO
|
||||||
|
|||||||
Reference in New Issue
Block a user