From 3d0d77d9e7d960389d4552867a4f657211bd8753 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Thu, 10 Apr 2025 21:01:22 -0700 Subject: [PATCH] move data to code_8002774 --- data/data.s | 19 ------------------- data/pksdir_5.s | 9 +++++++++ ld_script.txt | 2 ++ src/code_8002774.c | 14 +++++++++++++- 4 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 data/pksdir_5.s diff --git a/data/data.s b/data/data.s index 30c0fdce9..abae1473c 100644 --- a/data/data.s +++ b/data/data.s @@ -1005,22 +1005,3 @@ gUnknown_80B7DF8: @ ??? .string "pksdir0\0" .fill 28, 1, 0 - -@ code_8002774.s -.string "pksdir0\0" - .fill 8, 1, 0 - - .global gVectorDirections -gVectorDirections: @ R=080B7E3C | B=0208772C - .4byte 0, 1 @N - .4byte 1, 1 @NE - .4byte 1, 0 @E - .4byte 1, -1 @SE - .4byte 0, -1 @S - .4byte -1, -1 @SW - .4byte -1, 0 @W - .4byte -1, 1 @NW - -@ ??? -.string "pksdir0\0" - diff --git a/data/pksdir_5.s b/data/pksdir_5.s new file mode 100644 index 000000000..a3bfe01ae --- /dev/null +++ b/data/pksdir_5.s @@ -0,0 +1,9 @@ + .section .rodata + + .align 2, 0 + + +@ ??? +.string "pksdir0\0" + .align 2, 0 + diff --git a/ld_script.txt b/ld_script.txt index f8f2dd4a1..d4e849ecb 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -427,6 +427,8 @@ SECTIONS { { src/main_loops.o(.rodata); data/data.o(.rodata); + src/code_8002774.o(.rodata); + data/pksdir_5.o(.rodata); src/memory.o(.rodata); data/data1.o(.rodata); src/random.o(.rodata); diff --git a/src/code_8002774.c b/src/code_8002774.c index 6a47f936b..dbfe9f892 100644 --- a/src/code_8002774.c +++ b/src/code_8002774.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "code_8002774.h" #include "constants/direction.h" #include "structs/str_position.h" @@ -11,7 +12,18 @@ struct S u8 x0[UNK_STRUCT_ARR_COUNT]; }; -extern const PixelPos gVectorDirections[8]; +const u8 sUnknown_8002774[] = {0, 0, 0, 0, 0, 0, 0, 0}; + +const PixelPos gVectorDirections[NUM_DIRECTIONS] = { + {0, 1}, // N + {1, 1}, // NE + {1, 0}, // E + {1, -1}, // SE + {0, -1}, // S + {-1, -1}, // SW + {-1, 0}, // W + {-1, 1}, // NW +}; static s8 VecDirection4Radial(PixelPos *pixelPos);