mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
Make some tweaks and fixes for the build system for Ubuntu
This commit is contained in:
1 parent
442027050f
commit
1d1d50494e
6 files changed
+19
-13
No files matched your search
@@ -784,4 +784,4 @@ allclean:
|
|||||||
rm -rf build/*
|
rm -rf build/*
|
||||||
|
|
||||||
codeclean:
|
codeclean:
|
||||||
find $(B_DIR)/{game,inflate,lib} -name '*.o' -delete
|
find $(B_DIR)/game $(B_DIR)/inflate $(B_DIR)/lib -name '*.o' -delete
|
||||||
@@ -17,11 +17,13 @@ The ntsc-1.0 and ntsc-final versions are fully decompiled, but a small handful o
|
|||||||
For Arch Linux:
|
For Arch Linux:
|
||||||
|
|
||||||
* Install these packages: `binutils fakeroot gcc make python vim`
|
* Install these packages: `binutils fakeroot gcc make python vim`
|
||||||
* Install from AUR: `armips` and a mips binutils package of your choice (eg. `mips-elf-binutils`)
|
* Install from AUR: `armips`
|
||||||
|
* Install from AUR: a MIPS binutils package of your choice (eg. `mips-elf-binutils`)
|
||||||
|
* Install from AUR: a MIPS gcc package of your choice (eg. `mips-elf-gcc`)
|
||||||
|
|
||||||
For Debian and Ubuntu:
|
For Debian and Ubuntu:
|
||||||
|
|
||||||
* Install these packages: `binutils-mips-linux-gnu build-essential libc6-dev-i386 libcapstone3 libcapstone-dev make`
|
* Install these packages: `binutils-mips-linux-gnu build-essential gcc-mips-linux-gnu libc6-dev-i386 libcapstone-dev make`
|
||||||
* Compile and install `armips`
|
* Compile and install `armips`
|
||||||
|
|
||||||
## ROM Versions
|
## ROM Versions
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ C_FILES = $(wildcard *.c)
|
|||||||
gcc -O3 %< -o $@
|
gcc -O3 %< -o $@
|
||||||
|
|
||||||
mkrom: $(C_FILES)
|
mkrom: $(C_FILES)
|
||||||
gcc -O3 $(C_FILES) -o mkrom
|
gcc -Wno-unused-result -O3 $(C_FILES) -o mkrom
|
||||||
+2
-6
@@ -41,9 +41,7 @@ bool map_get_function_rompos(char *funcname, uint32_t *start, uint32_t *end)
|
|||||||
|
|
||||||
fseek(state.mapfd, 0, SEEK_SET);
|
fseek(state.mapfd, 0, SEEK_SET);
|
||||||
|
|
||||||
while (!feof(state.mapfd)) {
|
while (fgets(line, 1024, state.mapfd)) {
|
||||||
fgets(line, 1024, state.mapfd);
|
|
||||||
|
|
||||||
if (lookingforend) {
|
if (lookingforend) {
|
||||||
ptr = line;
|
ptr = line;
|
||||||
|
|
||||||
@@ -116,9 +114,7 @@ bool map_get_segment_rompos(char *segname, uint32_t *start, uint32_t *end)
|
|||||||
// Find lines like this:
|
// Find lines like this:
|
||||||
// " 0x0000000000001050 _libzipSegmentRomStart = __rompos"
|
// " 0x0000000000001050 _libzipSegmentRomStart = __rompos"
|
||||||
|
|
||||||
while (!feof(state.mapfd)) {
|
while (fgets(line, 1024, state.mapfd)) {
|
||||||
fgets(line, 1024, state.mapfd);
|
|
||||||
|
|
||||||
if (!found_start && strstr(line, startstring)) {
|
if (!found_start && strstr(line, startstring)) {
|
||||||
char *ptr = strstr(line, "0x");
|
char *ptr = strstr(line, "0x");
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
extern struct state state;
|
extern struct state state;
|
||||||
|
|
||||||
static void copy(char *segname, uint8_t *payload, size_t len, char *constname)
|
static void copy(char *segname, uint8_t *payload, uint32_t len, char *constname)
|
||||||
{
|
{
|
||||||
uint32_t start;
|
uint32_t start;
|
||||||
uint32_t end;
|
uint32_t end;
|
||||||
|
|||||||
+10
-2
@@ -42,7 +42,11 @@ static uint32_t calc_sum(char *sumfunc, Algo algo)
|
|||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
|
|
||||||
if (!map_get_function_rompos(sumfunc, &start, &end)) {
|
if (!map_get_function_rompos(sumfunc, &start, &end)) {
|
||||||
fprintf(stderr, "Unable to find function \"%s\" in map file\n", sumfunc);
|
fprintf(stderr, "Unable to find function \"%s\" in map file.\n", sumfunc);
|
||||||
|
fprintf(stderr, "If a piracy function has been renamed then you may need to rebuild mkrom:\n");
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
fprintf(stderr, " make -C tools/mkrom\n");
|
||||||
|
fprintf(stderr, "\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +103,11 @@ static void write_sum(char *patchfunc, uint32_t sum)
|
|||||||
uint32_t end;
|
uint32_t end;
|
||||||
|
|
||||||
if (!map_get_function_rompos(patchfunc, &start, &end)) {
|
if (!map_get_function_rompos(patchfunc, &start, &end)) {
|
||||||
fprintf(stderr, "Unable to find function \"%s\" in map file\n", patchfunc);
|
fprintf(stderr, "Unable to find function \"%s\" in map file.\n", patchfunc);
|
||||||
|
fprintf(stderr, "If a piracy function has been renamed then you may need to rebuild mkrom:\n");
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
fprintf(stderr, " make -C tools/mkrom\n");
|
||||||
|
fprintf(stderr, "\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user