Create include/ directory and move main.h structs there

This commit is contained in:
PikalaxALT
2020-04-20 20:57:00 -04:00
parent 7fd747b7df
commit 43eb982a80
13 changed files with 57 additions and 59 deletions

View File

@@ -8,4 +8,4 @@ enable_language(ASM)
file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "*.c")
add_executable(PokeDiamond ${SOURCES})
target_include_directories(PokeDiamond PRIVATE nitro)
target_include_directories(PokeDiamond PRIVATE include)

View File

@@ -79,7 +79,7 @@ OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te
CFLAGS = -O4,p -proc v5te -thumb -fp soft -lang c99 -Cpp_exceptions off -i nitro
CFLAGS = -O4,p -proc v5te -thumb -fp soft -lang c99 -Cpp_exceptions off -i include
LDFLAGS = -map -nodead -w off -proc v5te -interworking -map -symtab -m Entry
####################### Other Tools #########################

6
include/global.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef GUARD_GLOBAL_H
#define GUARD_GLOBAL_H
#include "nitro/nitro.h"
#endif //GUARD_GLOBAL_H

40
include/main.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef GUARD_MAIN_H
#define GUARD_MAIN_H
struct Unk2106FA0
{
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
s32 unk20;
};
struct Unk21C48B8
{
void (*unk0)(s32);
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
s32 unk20;
s32 unk24;
s32 unk28;
s32 unk2C;
s32 unk30;
s32 unk34;
s32 unk38;
u8 filler3C[0xC];
s32 unk48;
u8 filler4C[0x20];
s32 unk6C;
};
#endif //GUARD_MAIN_H

View File

@@ -6,8 +6,8 @@ extern "C" {
#endif
// Include all nitro files
#include "types.h"
#include "os.h"
#include "nitro/types.h"
#include "nitro/os.h"
#ifdef __cplusplus
};

View File

@@ -5,6 +5,6 @@
#ifndef POKEDIAMOND_OS_H
#define POKEDIAMOND_OS_H
#include "os_asm.h"
#include "nitro/os_asm.h"
#endif //POKEDIAMOND_OS_H

View File

@@ -5,7 +5,7 @@
#ifndef POKEDIAMOND_OS_ASM_H
#define POKEDIAMOND_OS_ASM_H
#include "types.h"
#include "nitro/types.h"
OSProcMode OS_GetProcMode();

View File

@@ -1,12 +1,5 @@
#include "nitro.h"
struct Unk2106FA0 {
u8 filler0[0x8];
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
};
#include "global.h"
#include "main.h"
extern struct Unk2106FA0 gBacklightTop;

View File

@@ -1,46 +1,5 @@
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
typedef signed char s8;
typedef signed short s16;
typedef signed long s32;
struct Unk2106FA0
{
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
s32 unk20;
};
struct Unk21C48B8
{
void (*unk0)(s32);
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
s32 unk20;
s32 unk24;
s32 unk28;
s32 unk2C;
s32 unk30;
s32 unk34;
s32 unk38;
u8 filler3C[0xC];
s32 unk48;
u8 filler4C[0x20];
s32 unk6C;
};
#include "global.h"
#include "main.h"
extern struct Unk2106FA0 gBacklightTop;
extern struct Unk2106FA0 gBacklightTop_2; // same as the first one, it's referenced twice in the constant pool...

View File

@@ -1,4 +1,4 @@
#include "nitro.h"
#include "global.h"
u16 gDigitTable[] = {
0xA2,