mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Contiguous WRAM
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
extern SLONG options;
|
||||
#define OPT_SMALL 0x01
|
||||
#define OPT_SMART_C_LINK 0x02
|
||||
#define OPT_CONTWRAM 0x04
|
||||
|
||||
enum eRpnData {
|
||||
RPN_ADD = 0,
|
||||
|
||||
@@ -280,7 +280,11 @@ AssignSections(void)
|
||||
} else if (i == BANK_WRAM0) {
|
||||
/* WRAM */
|
||||
BankFree[i]->nOrg = 0xC000;
|
||||
BankFree[i]->nSize = 0x1000;
|
||||
if (options & OPT_CONTWRAM) {
|
||||
BankFree[i]->nSize = 0x2000;
|
||||
} else {
|
||||
BankFree[i]->nSize = 0x1000;
|
||||
}
|
||||
} else if (i >= BANK_SRAM && i < BANK_SRAM + BANK_COUNT_SRAM) {
|
||||
/* Swappable SRAM bank */
|
||||
BankFree[i]->nOrg = 0xA000;
|
||||
@@ -318,6 +322,10 @@ AssignSections(void)
|
||||
&& pSection->oAssigned == 0) {
|
||||
/* User wants to have a say... */
|
||||
|
||||
if (pSection->Type == SECT_WRAMX && options & OPT_CONTWRAM) {
|
||||
errx(1, "WRAMX not compatible with -w!");
|
||||
}
|
||||
|
||||
switch (pSection->Type) {
|
||||
case SECT_WRAM0:
|
||||
case SECT_HRAM:
|
||||
|
||||
@@ -35,7 +35,7 @@ static void
|
||||
usage(void)
|
||||
{
|
||||
printf(
|
||||
"usage: rgblink [-t] [-m mapfile] [-n symfile] [-o outfile] [-p pad_value]\n"
|
||||
"usage: rgblink [-tw] [-m mapfile] [-n symfile] [-o outfile] [-p pad_value]\n"
|
||||
" [-s symbol] file [...]\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ main(int argc, char *argv[])
|
||||
|
||||
progname = argv[0];
|
||||
|
||||
while ((ch = getopt(argc, argv, "m:n:o:p:s:t")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "m:n:o:p:s:t:w")) != -1) {
|
||||
switch (ch) {
|
||||
case 'm':
|
||||
SetMapfileName(optarg);
|
||||
@@ -84,6 +84,12 @@ main(int argc, char *argv[])
|
||||
case 't':
|
||||
options |= OPT_SMALL;
|
||||
break;
|
||||
case 'w':
|
||||
/* Set to set WRAM as a single continuous block as on DMG.
|
||||
All WRAM sections must be WRAM0 as bankable WRAM sections do
|
||||
not exist in this mode. A WRAMX section will raise an error. */
|
||||
options |= OPT_CONTWRAM;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
/* NOTREACHED */
|
||||
|
||||
Reference in New Issue
Block a user