Dump cartridge bank usage to map file

This commit is contained in:
drmortalwombat 2022-09-13 09:55:38 +02:00
parent 76f463daff
commit 38fab44cca
3 changed files with 46 additions and 1 deletions

View File

@ -77,6 +77,7 @@ Linker::Linker(Errors* errors)
for (int i = 0; i < 64; i++)
{
mCartridgeBankUsed[i] = 0;
mCartridgeBankSize[i] = 0;
memset(mCartridge[i], 0, 0x4000);
}
memset(mMemory, 0, 0x10000);
@ -450,6 +451,8 @@ void Linker::Link(void)
{
mCartridgeBankUsed[i] = true;
memcpy(mCartridge[i] + obj->mAddress - 0x8000, obj->mData, obj->mSize);
if (obj->mAddress - 0x8000 + obj->mSize > mCartridgeBankSize[i])
mCartridgeBankSize[i] = obj->mAddress - 0x8000 + obj->mSize;
}
}
}
@ -727,6 +730,9 @@ bool Linker::WriteCrtFile(const char* filename)
fwrite(&chipHeader, sizeof(chipHeader), 1, file);
fwrite(bootmem + 0x2000, 1, 0x2000, file);
mCartridgeBankUsed[0] = true;
mCartridgeBankSize[0] = usedlz + 0x200;
for (int i = 1; i < 64; i++)
{
if (mCartridgeBankUsed[i])
@ -789,6 +795,17 @@ bool Linker::WriteMapFile(const char* filename)
}
}
if (mCartridgeBankUsed[0])
{
fprintf(file, "\nbanks\n");
for (int i = 0; i < 64; i++)
{
if (mCartridgeBankUsed[i])
fprintf(file, "%02d : %04x\n", i, mCartridgeBankSize[i]);
}
}
fclose(file);
return true;

View File

@ -209,6 +209,8 @@ public:
bool mCartridgeBankUsed[64];
uint32 mCartridgeBankSize[64];
int mProgramStart, mProgramEnd;
void ReferenceObject(LinkerObject* obj);

View File

@ -136,6 +136,12 @@
}
"Entry"
{
"MsmKey" = "8:_222FC9C47F124FE08B8D66C56A07DD94"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_23211A34D7544532ABFD8D17B647717F"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@ -1401,6 +1407,26 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_222FC9C47F124FE08B8D66C56A07DD94"
{
"SourcePath" = "8:..\\samples\\hires\\fractaltree.c"
"TargetName" = "8:fractaltree.c"
"Tag" = "8:"
"Folder" = "8:_82FDD682B0334DE1B89A843D32862B85"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_23211A34D7544532ABFD8D17B647717F"
{
"SourcePath" = "8:..\\samples\\memmap\\easyflashlow.c"
@ -4258,7 +4284,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:oscar64"
"ProductCode" = "8:{0D544354-1294-469B-90E0-8BD57E9EF14C}"
"PackageCode" = "8:{410BE777-EF03-4DF6-8C60-4042D036C312}"
"PackageCode" = "8:{7D269177-BF36-45D8-9AB9-C11F92E45E2D}"
"UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"