summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2020-04-12 17:26:03 -0400
committerProjectRevoTPP <projectrevotpp@hotmail.com>2020-04-12 17:26:03 -0400
commit09fa95f0e27e9a835f5535a776f6a22861c7c4a0 (patch)
treeb26cfd33de21f5b3cf8cc78f27bde7352e997495
parentf2052ca8ef06f858037d6657b377197dd8772f4c (diff)
arm9 segment work
-rw-r--r--asm/rom2.s2
-rw-r--r--asm/rom3.s5
-rw-r--r--asm/rom_header.s6
-rw-r--r--ld_script.txt11
-rw-r--r--main.c7
5 files changed, 25 insertions, 6 deletions
diff --git a/asm/rom2.s b/asm/rom2.s
index 81eaddea..03b89938 100644
--- a/asm/rom2.s
+++ b/asm/rom2.s
@@ -2,4 +2,4 @@
.section .text
-.incbin "baserom.nds", 0x4E0C, 0x3FFB1F4
+.incbin "baserom.nds", 0x4E0C, 0x106918
diff --git a/asm/rom3.s b/asm/rom3.s
new file mode 100644
index 00000000..ddb524ba
--- /dev/null
+++ b/asm/rom3.s
@@ -0,0 +1,5 @@
+/* rom3.s TODO: Disassemble */
+
+.section .text
+
+.incbin "baserom.nds", 0x10B724, 0x3EF48DC
diff --git a/asm/rom_header.s b/asm/rom_header.s
index a8583e2b..2dc62ad5 100644
--- a/asm/rom_header.s
+++ b/asm/rom_header.s
@@ -29,13 +29,13 @@ RomVersion:
.space 1
ARM9ROMOffset:
-.word _rom_codeSegmentRomStart
+.word _arm9SegmentRomStart
ARM9EntryAddress:
.word Entry
ARM9RAMAddress:
-.word _rom_codeSegmentStart
+.word _arm9SegmentStart
ARM9CodeSize:
-.word 0x00107724
+.word _arm9SegmentSize
ARM7ROMOffset:
.word 0x0030D000
ARM7EntryAddress:
diff --git a/ld_script.txt b/ld_script.txt
index ec6e4c0c..4a5c4e3a 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -8,6 +8,7 @@
#define END_SEG(name) \
_##name##SegmentEnd = ADDR(.name) + SIZEOF(.name); \
_##name##SegmentRomEnd = __romPos + SIZEOF(.name); \
+ _##name##SegmentSize = SIZEOF(.name); \
__romPos += SIZEOF(.name);
SECTIONS {
@@ -20,7 +21,7 @@ SECTIONS {
__romPos += 0x3E00;
- BEGIN_SEG(rom_code, 0x2000000)
+ BEGIN_SEG(arm9, 0x2000000)
{
build/asm/secure.o(.text);
build/asm/main.o(.text);
@@ -28,5 +29,11 @@ SECTIONS {
build/src/sub_02000DF4.o(.text);
build/asm/rom2.o(.text);
}
- END_SEG(rom_code)
+ END_SEG(arm9)
+
+ BEGIN_SEG(rom3, 0x2000000 + SIZEOF(arm9))
+ {
+ build/asm/rom3.o(.text);
+ }
+ END_SEG(rom3)
}
diff --git a/main.c b/main.c
new file mode 100644
index 00000000..17e69b3d
--- /dev/null
+++ b/main.c
@@ -0,0 +1,7 @@
+// Just includes for now so CLion sees the files
+#include "structs/structs.h"
+#include "nitro/nitro.h"
+
+void main() {
+ int x = NULL;
+}