mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-07-01 19:10:15 -04:00
Use ld's fill command instead of doing it manually with mkrom
This commit is contained in:
@@ -636,6 +636,13 @@ SECTIONS
|
||||
_accessingpakSegmentRomEnd = 0;
|
||||
#endif
|
||||
|
||||
.fill : AT(__rompos)
|
||||
{
|
||||
FILL(0xff);
|
||||
. = 0x02000000 - __rompos - 1;
|
||||
BYTE(0xff);
|
||||
}
|
||||
|
||||
/DISCARD/ : {
|
||||
* (.MIPS.abiflags);
|
||||
* (.options);
|
||||
|
||||
@@ -63,7 +63,6 @@ int main(int argc, char **argv)
|
||||
pack_lib();
|
||||
pack_data();
|
||||
pack_game();
|
||||
pack_fill();
|
||||
|
||||
rom_update_crc();
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ bool map_get_segment_rompos(char *funcname, uint32_t *start, uint32_t *end);
|
||||
void pack_lib(void);
|
||||
void pack_data(void);
|
||||
void pack_game(void);
|
||||
void pack_fill(void);
|
||||
|
||||
void piracy_patch(void);
|
||||
|
||||
|
||||
@@ -134,24 +134,3 @@ void pack_lib(void)
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill from the end of the last segment to the end of the ROM with 0xff.
|
||||
*/
|
||||
void pack_fill(void)
|
||||
{
|
||||
uint32_t offset;
|
||||
|
||||
map_get_segment_rompos("accessingpak", NULL, &offset);
|
||||
|
||||
if (offset == 0) {
|
||||
// We're probably building ntsc-beta, which doesn't have the
|
||||
// accessingpak segment.
|
||||
map_get_segment_rompos("copyright", NULL, &offset);
|
||||
}
|
||||
|
||||
while (offset < 1024 * 1024 * 32) {
|
||||
state.rom[offset] = 0xff;
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user