mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-25 20:42:07 +00:00
reran indent (whitespace changes)
Merging lai's source with this one is very irritating because they have different indentation styles. I couldn't find what profile vegard used for his version, so I used these flags (which should bring the source close to KNF): -bap -br -ce -ci4 -cli0 -d0 -di0 -i8 -ip -l79 -nbc -ncdb -ndj -ei -nfc1 -nlp -npcs -psl -sc -sob
This commit is contained in:
@@ -13,7 +13,8 @@ FILE *sf = NULL;
|
||||
SLONG currentbank = 0;
|
||||
SLONG sfbank;
|
||||
|
||||
void SetMapfileName(char *name)
|
||||
void
|
||||
SetMapfileName(char *name)
|
||||
{
|
||||
mf = fopen(name, "wt");
|
||||
|
||||
@@ -21,7 +22,8 @@ void SetMapfileName(char *name)
|
||||
fatalerror("Unable to open mapfile for writing");
|
||||
}
|
||||
|
||||
void SetSymfileName(char *name)
|
||||
void
|
||||
SetSymfileName(char *name)
|
||||
{
|
||||
sf = fopen(name, "wt");
|
||||
|
||||
@@ -31,7 +33,8 @@ void SetSymfileName(char *name)
|
||||
fprintf(sf, ";File generated by xLink v" LINK_VERSION "\n\n");
|
||||
}
|
||||
|
||||
void CloseMapfile(void)
|
||||
void
|
||||
CloseMapfile(void)
|
||||
{
|
||||
if (mf) {
|
||||
fclose(mf);
|
||||
@@ -43,7 +46,8 @@ void CloseMapfile(void)
|
||||
}
|
||||
}
|
||||
|
||||
void MapfileInitBank(SLONG bank)
|
||||
void
|
||||
MapfileInitBank(SLONG bank)
|
||||
{
|
||||
if (mf) {
|
||||
currentbank = bank;
|
||||
@@ -58,13 +62,13 @@ void MapfileInitBank(SLONG bank)
|
||||
else if (bank == BANK_VRAM)
|
||||
fprintf(mf, "VRAM:\n");
|
||||
}
|
||||
|
||||
if (sf) {
|
||||
sfbank = (bank >= 1 && bank <= 255) ? bank : 0;
|
||||
}
|
||||
}
|
||||
|
||||
void MapfileWriteSection(struct sSection *pSect)
|
||||
void
|
||||
MapfileWriteSection(struct sSection * pSect)
|
||||
{
|
||||
if (!mf && !sf)
|
||||
return;
|
||||
@@ -72,30 +76,30 @@ void MapfileWriteSection(struct sSection *pSect)
|
||||
SLONG i;
|
||||
|
||||
fprintf(mf, " SECTION: $%04lX-$%04lX ($%04lX bytes)\n",
|
||||
pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1,
|
||||
pSect->nByteSize);
|
||||
pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1,
|
||||
pSect->nByteSize);
|
||||
|
||||
for (i = 0; i < pSect->nNumberOfSymbols; i += 1) {
|
||||
struct sSymbol *pSym;
|
||||
pSym = pSect->tSymbols[i];
|
||||
if ((pSym->pSection == pSect)
|
||||
&& (pSym->Type != SYM_IMPORT)) {
|
||||
&& (pSym->Type != SYM_IMPORT)) {
|
||||
if (mf) {
|
||||
fprintf(mf, " $%04lX = %s\n",
|
||||
pSym->nOffset + pSect->nOrg,
|
||||
pSym->pzName);
|
||||
pSym->nOffset + pSect->nOrg,
|
||||
pSym->pzName);
|
||||
}
|
||||
if (sf) {
|
||||
fprintf(sf, "%02lX:%04lX %s\n", sfbank,
|
||||
pSym->nOffset + pSect->nOrg,
|
||||
pSym->pzName);
|
||||
pSym->nOffset + pSect->nOrg,
|
||||
pSym->pzName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MapfileCloseBank(SLONG slack)
|
||||
void
|
||||
MapfileCloseBank(SLONG slack)
|
||||
{
|
||||
if (!mf)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user