mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-22 20:11:43 +00:00
updated the q3asm .map file output for simpler parsing
This commit is contained in:
parent
b5ee082797
commit
46115fe130
1 changed files with 5 additions and 8 deletions
|
@ -60,7 +60,7 @@ typedef enum {
|
||||||
DATASEG, // initialized 32 bit data, will be byte swapped
|
DATASEG, // initialized 32 bit data, will be byte swapped
|
||||||
LITSEG, // strings
|
LITSEG, // strings
|
||||||
BSSSEG, // 0 filled
|
BSSSEG, // 0 filled
|
||||||
JTRGSEG, // psuedo-segment that contains only jump table targets
|
JTRGSEG, // pseudo-segment that contains only jump table targets
|
||||||
NUM_SEGMENTS
|
NUM_SEGMENTS
|
||||||
} segmentName_t;
|
} segmentName_t;
|
||||||
|
|
||||||
|
@ -875,13 +875,10 @@ static void WriteMapFile()
|
||||||
|
|
||||||
FILE* f = SafeOpenWrite( imageName );
|
FILE* f = SafeOpenWrite( imageName );
|
||||||
for (int seg = CODESEG; seg <= BSSSEG; ++seg) {
|
for (int seg = CODESEG; seg <= BSSSEG; ++seg) {
|
||||||
fprintf( f, "%s:\n", segment[seg].name );
|
|
||||||
for (SymTable::const_iterator it = aSymGlobal.begin(); it != aSymGlobal.end(); ++it) {
|
for (SymTable::const_iterator it = aSymGlobal.begin(); it != aSymGlobal.end(); ++it) {
|
||||||
const symbol_t* s = (*it).second;
|
const symbol_t* s = (*it).second;
|
||||||
if ( &segment[seg] == s->segment ) {
|
if ( &segment[seg] == s->segment ) {
|
||||||
if ( s->value >= 0 ) { // ignore systraps
|
fprintf( f, "%d %8X %s\n", seg, s->value, (*it).first );
|
||||||
fprintf( f, "%8X %s\n", s->value, (*it).first );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -914,7 +911,7 @@ static void WriteVmFile()
|
||||||
// (I know this isn't strictly correct due to padding, but then platforms
|
// (I know this isn't strictly correct due to padding, but then platforms
|
||||||
// that pad wouldn't be able to write a correct header anyway).
|
// that pad wouldn't be able to write a correct header anyway).
|
||||||
// Note: if vmHeader_t changes, this needs to be adjusted too.
|
// Note: if vmHeader_t changes, this needs to be adjusted too.
|
||||||
int headerSize = sizeof( header ) - sizeof( header.jtrgLength );
|
const int headerSize = sizeof( header );
|
||||||
|
|
||||||
header.instructionCount = instructionCount;
|
header.instructionCount = instructionCount;
|
||||||
header.codeOffset = headerSize;
|
header.codeOffset = headerSize;
|
||||||
|
@ -923,7 +920,6 @@ static void WriteVmFile()
|
||||||
header.dataLength = segment[DATASEG].imageUsed;
|
header.dataLength = segment[DATASEG].imageUsed;
|
||||||
header.litLength = segment[LITSEG].imageUsed;
|
header.litLength = segment[LITSEG].imageUsed;
|
||||||
header.bssLength = segment[BSSSEG].imageUsed;
|
header.bssLength = segment[BSSSEG].imageUsed;
|
||||||
header.jtrgLength = segment[JTRGSEG].imageUsed;
|
|
||||||
|
|
||||||
report( "Writing to %s\n", imageName );
|
report( "Writing to %s\n", imageName );
|
||||||
|
|
||||||
|
@ -1038,6 +1034,7 @@ int main( int argc, char **argv )
|
||||||
"Assemble LCC bytecode assembly to Q3VM bytecode.\n\n"
|
"Assemble LCC bytecode assembly to Q3VM bytecode.\n\n"
|
||||||
"-o OUTPUT Write assembled output to file OUTPUT.qvm\n"
|
"-o OUTPUT Write assembled output to file OUTPUT.qvm\n"
|
||||||
"-f LISTFILE Read options and list of files to assemble from LISTFILE\n"
|
"-f LISTFILE Read options and list of files to assemble from LISTFILE\n"
|
||||||
|
"-m Write symbols to a .map file\n"
|
||||||
"-v Verbose compilation report\n"
|
"-v Verbose compilation report\n"
|
||||||
, argv[0] );
|
, argv[0] );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue