summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/constants/items.h2
-rw-r--r--include/constants/pokemon.h16
-rw-r--r--include/itemtool.h24
-rw-r--r--include/move_data.h33
-rw-r--r--include/msg_data.h20
-rw-r--r--include/nitro/OS_alarm_shared.h35
-rw-r--r--include/nitro/OS_mutex_shared.h26
-rw-r--r--include/nitro/OS_systemWork_shared.h66
-rw-r--r--include/nitro/OS_thread_shared.h12
-rw-r--r--include/nitro/OS_tick_shared.h24
-rw-r--r--include/nitro/consts_shared.h8
-rw-r--r--include/nitro/mmap_shared.h3
12 files changed, 260 insertions, 9 deletions
diff --git a/include/constants/items.h b/include/constants/items.h
index 433532a4..a7fcc32f 100644
--- a/include/constants/items.h
+++ b/include/constants/items.h
@@ -128,7 +128,9 @@
#define ITEM_AIR_MAIL 146
#define ITEM_MOSAIC_MAIL 147
#define ITEM_BRICK_MAIL 148
+
#define ITEM_CHERI_BERRY 149
+#define FIRST_BERRY_IDX ITEM_CHERI_BERRY
#define ITEM_CHESTO_BERRY 150
#define ITEM_PECHA_BERRY 151
#define ITEM_RAWST_BERRY 152
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index 5c8c32d4..1af59830 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -269,9 +269,15 @@
#define MON_DATA_SPECIES_NAME 178
#define MON_RATIO_MALE 0
+#define MON_RATIO_EIGHTH 31
+#define MON_RATIO_QUARTER 63
+#define MON_RATIO_HALF 127
+#define MON_RATIO_THREEQUARTER 191
#define MON_RATIO_FEMALE 254
#define MON_RATIO_UNKNOWN 255
+#define GENDER_RATIO(frac) ( (frac) <= 1 ? (u8)((frac) * 254.75) : 255 )
+
enum MonGender
{
MON_MALE = 0,
@@ -435,4 +441,14 @@ typedef enum EvoMethod
EVO_ROUTE217,
} EvoMethod;
+enum GrowthRate
+{
+ GROWTH_MEDIUM_FAST = 0,
+ GROWTH_ERRATIC,
+ GROWTH_FLUCTUATING,
+ GROWTH_MEDIUM_SLOW,
+ GROWTH_FAST,
+ GROWTH_SLOW,
+};
+
#endif //POKEDIAMOND_CONSTANTS_POKEMON_H
diff --git a/include/itemtool.h b/include/itemtool.h
new file mode 100644
index 00000000..525e68f9
--- /dev/null
+++ b/include/itemtool.h
@@ -0,0 +1,24 @@
+#ifndef POKEDIAMOND_ITEMTOOL_H
+#define POKEDIAMOND_ITEMTOOL_H
+
+#include "global.h"
+#include "constants/items.h"
+
+// Berries (nutdata)
+
+struct NutData
+{
+ u16 unk0;
+ u8 unk2;
+ u8 unk3;
+ u8 unk4;
+ u8 unk5;
+ u8 unk6;
+ u8 unk7;
+ u8 unk8;
+ u8 unk9;
+ u8 unkA;
+ u8 unkB;
+};
+
+#endif //POKEDIAMOND_ITEMTOOL_H
diff --git a/include/move_data.h b/include/move_data.h
index 5267bfb1..a970e1bf 100644
--- a/include/move_data.h
+++ b/include/move_data.h
@@ -3,24 +3,39 @@
struct WazaTbl
{
- u16 unk0;
+ u16 effect;
u8 unk2;
- u8 unk3;
- u8 unk4;
- u8 unk5;
+ u8 power;
+ u8 type;
+ u8 accuracy;
u8 pp;
- u8 unk7;
+ u8 effectChance;
u16 unk8;
- s8 unkA;
+ s8 priority;
u8 unkB;
u8 unkC;
- u8 unkD;
+ u8 contestType;
u8 padding[2];
};
+typedef enum MoveAttr {
+ MOVEATTR_EFFECT = 0,
+ MOVEATTR_UNK1,
+ MOVEATTR_POWER,
+ MOVEATTR_TYPE,
+ MOVEATTR_ACCURACY,
+ MOVEATTR_PP,
+ MOVEATTR_EFFECT_CHANCE,
+ MOVEATTR_UNK7,
+ MOVEATTR_PRIORTY,
+ MOVEATTR_UNK9,
+ MOVEATTR_UNK10,
+ MOVEATTR_CONTEST_TYPE,
+} MoveAttr;
+
void LoadAllWazaTbl(struct WazaTbl * dest);
u8 WazaGetMaxPp(u16 move, u8 ppUp);
-u32 GetWazaAttr(u16 move, u32 attr);
-u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, u32 attr);
+u32 GetWazaAttr(u16 move, MoveAttr attr);
+u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, MoveAttr attr);
#endif //POKEDIAMOND_MOVE_DATA_H
diff --git a/include/msg_data.h b/include/msg_data.h
new file mode 100644
index 00000000..debacc79
--- /dev/null
+++ b/include/msg_data.h
@@ -0,0 +1,20 @@
+#ifndef POKEDIAMOND_MSG_DATA_H
+#define POKEDIAMOND_MSG_DATA_H
+
+struct MsgData
+{
+ u16 unk0;
+ u16 unk2;
+ u16 unk4;
+ u16 unk6;
+ union {
+ u16 * raw;
+ NARC * narc;
+ } data;
+};
+
+struct MsgData * NewMsgDataFromNarc(u32 type, u32 narcId, u32 msgId, u32 heapno);
+u16 * FUN_0200A914(struct MsgData *, u32);
+void DestroyMsgData(struct MsgData *);
+
+#endif //POKEDIAMOND_MSG_DATA_H
diff --git a/include/nitro/OS_alarm_shared.h b/include/nitro/OS_alarm_shared.h
new file mode 100644
index 00000000..fe549351
--- /dev/null
+++ b/include/nitro/OS_alarm_shared.h
@@ -0,0 +1,35 @@
+/*
+ * NOTE:
+ * This file is shared between ARM9 and ARM7
+ * DO NOT PUT PROC SPECIFIC CODE IN HERE
+ * Thank You!
+ */
+
+/*
+ * DO NOT INCLUDE THIS FILE DIRECTLY
+ * Include OS_alarm.h from the specific proc's lib
+ */
+
+#ifndef POKEDIAMOND_OS_ALARM_SHARED_H
+#define POKEDIAMOND_OS_ALARM_SHARED_H
+
+#include "nitro/types.h"
+#include "nitro/OS_tick_shared.h"
+
+typedef void (*OSAlarmHandler) (void *);
+
+struct OSiAlarm
+{
+ OSAlarmHandler handler;
+ void *arg;
+
+ u32 tag;
+ OSTick fire;
+ OSAlarm *prev;
+ OSAlarm *next;
+
+ OSTick period;
+ OSTick start;
+};
+
+#endif //POKEDIAMOND_OS_ALARM_SHARED_H
diff --git a/include/nitro/OS_mutex_shared.h b/include/nitro/OS_mutex_shared.h
new file mode 100644
index 00000000..e3c93e47
--- /dev/null
+++ b/include/nitro/OS_mutex_shared.h
@@ -0,0 +1,26 @@
+/*
+ * NOTE:
+ * This file is shared between ARM9 and ARM7
+ * DO NOT PUT PROC SPECIFIC CODE IN HERE
+ * Thank You!
+ */
+
+/*
+ * DO NOT INCLUDE THIS FILE DIRECTLY
+ * Include OS_mutex.h from the specific proc's lib
+ */
+
+#ifndef POKEDIAMOND_OS_MUTEX_SHARED_H
+#define POKEDIAMOND_OS_MUTEX_SHARED_H
+
+#include "nitro/OS_thread_shared.h"
+#include "nitro/types.h"
+
+struct OSMutex {
+ OSThreadQueue queue;
+ OSThread *thread;
+ s32 count;
+ OSMutexLink link;
+};
+
+#endif //POKEDIAMOND_OS_MUTEX_SHARED_H
diff --git a/include/nitro/OS_systemWork_shared.h b/include/nitro/OS_systemWork_shared.h
new file mode 100644
index 00000000..54321015
--- /dev/null
+++ b/include/nitro/OS_systemWork_shared.h
@@ -0,0 +1,66 @@
+/*
+ * NOTE:
+ * This file is shared between ARM9 and ARM7
+ * DO NOT PUT PROC SPECIFIC CODE IN HERE
+ * Thank You!
+ */
+
+/*
+ * DO NOT INCLUDE THIS FILE DIRECTLY
+ * Include consts.h from the specific proc's lib
+ */
+
+#ifndef POKEDIAMOND_OS_SYSTEMWORK_SHARED_H
+#define POKEDIAMOND_OS_SYSTEMWORK_SHARED_H
+
+#include "nitro/types.h"
+#include "nitro/mmap_shared.h"
+#include "nitro/OS_thread_shared.h"
+#include "nitro/OS_spinLock_shared.h"
+
+typedef struct {
+ u8 bootCheckInfo[0x20]; // 000-01f: 32byte boot check info
+ u32 resetParameter; // 020-023: 4byte reset parameter
+ u8 padding5[0x8]; // 024-02c: (8byte)
+ u32 romBaseOffset; // 02c-02f: 4byte ROM offset of own program
+ u8 cartridgeModuleInfo[12]; // 030-03b: 12byte cartridge module info
+ u32 vblankCount; // 03c-03f: 4byte V-Blank Count
+ u8 wmBootBuf[0x40]; // 040-07f: 64byte WM multiboot buffer
+ u8 nvramUserInfo[0x100]; // 080-17f: 256bytes NVRAM user info
+ u8 isd_reserved1[0x20]; // 180-19f: 32bytes ISDebugger reserved
+ u8 arenaInfo[0x48]; // 1a0-1e7: 72byte Arena information
+ u8 real_time_clock[8]; // 1e8-1ef: 8bytes RTC
+ u32 dmaClearBuf[4]; // 1f0-1ff: 16bytes DMA clear information buffer (for ARM9-TEG)
+ u8 rom_header[0x160]; // 200-35f: 352bytes ROM registration area info storage buffer
+ u8 isd_reserved2[32]; // 360-37f: 32bytes ISDebugger reserved
+ u32 pxiSignalParam[2]; // 380-387: 8bytes Param for PXI Signal
+ u32 pxiHandleChecker[2]; // 388-38f: 8bytes Flag for PXI Command Handler Installed
+ u32 mic_last_address; // 390-393: 4bytes MIC latest sampling result storage address
+ u16 mic_sampling_data; // 394-395: 2bytes MIC sampling result
+ u16 wm_callback_control; // 396-397: 2bytes Parameter for WM callback synchronization
+ u16 wm_rssi_pool; // 398-399: 2bytes Random number source depends on WM received signal intensity
+ u8 padding3[2]; // 39a-39b: (2bytes)
+ u32 component_param; // 39c-39f: 4bytes Parameter for Component synchronization
+ OSThreadInfo *threadinfo_mainp; // 3a0-3a3: 4bytes Verify that the pointer to ARM9 thread information is initial value 0
+ OSThreadInfo *threadinfo_subp; // 3a4-3a7: 4bytes Verify that the pointer to ARM7 thread information is initial value 0
+ u16 button_XY; // 3a8-3a9: 2bytes XY button information storage location
+ u8 touch_panel[4]; // 3aa-3ad: 4bytes Touch Screen information storage location
+ u16 autoloadSync; // 3ae-3af: 2bytes autoload sync between processors
+ u32 lockIDFlag_mainp[2]; // 3b0-3b7: 8bytes lockID management flag (ARM9)
+ u32 lockIDFlag_subp[2]; // 3b8-3bf: 8bytes lockID management flag (ARM7)
+ struct OSLockWord lock_VRAM_C; // 3c0-3c7: 8bytes C - lock buffer
+ struct OSLockWord lock_VRAM_D; // 3c8-3cf: 8bytes VRAM-D - lock buffer
+ struct OSLockWord lock_WRAM_BLOCK0; // 3d0-3d7: 8bytes Block0 - lock buffer
+ struct OSLockWord lock_WRAM_BLOCK1; // 3d8-3df: 8bytes CPU internal work RAM - Block1 - lock buffer
+ struct OSLockWord lock_CARD; // 3e0-3e7: 8bytes Game Card - lock buffer
+ struct OSLockWord lock_CARTRIDGE; // 3e8-3ef: 8bytes DS Pak - lock buffer
+ struct OSLockWord lock_INIT; // 3f0-3f7: 8bytes Initialization lock buffer
+ u16 mmem_checker_mainp; // 3f8-3f9: 2bytes MainMomory Size Checker for Main processor
+ u16 mmem_checker_subp; // 3fa-3fb: 2bytes MainMomory Size Checker for Sub processor
+ u8 padding4[2]; // 3fc-3fd: (2bytes)
+ u16 command_area; // 3fe-3ff: 2bytes Command Area
+} OSSystemWork; //0x027FFC00
+
+#define OS_GetSystemWork() ((OSSystemWork *)HW_MAIN_MEM_SYSTEM)
+
+#endif //POKEDIAMOND_OS_SYSTEMWORK_SHARED_H
diff --git a/include/nitro/OS_thread_shared.h b/include/nitro/OS_thread_shared.h
index 28d8a503..a0cce54d 100644
--- a/include/nitro/OS_thread_shared.h
+++ b/include/nitro/OS_thread_shared.h
@@ -1,3 +1,15 @@
+/*
+ * NOTE:
+ * This file is shared between ARM9 and ARM7
+ * DO NOT PUT PROC SPECIFIC CODE IN HERE
+ * Thank You!
+ */
+
+/*
+ * DO NOT INCLUDE THIS FILE DIRECTLY
+ * Include OS_thread.h from the specific proc's lib
+ */
+
#ifndef POKEDIAMOND_OS_THREAD_SHARED_H
#define POKEDIAMOND_OS_THREAD_SHARED_H
diff --git a/include/nitro/OS_tick_shared.h b/include/nitro/OS_tick_shared.h
new file mode 100644
index 00000000..e6d6d3b3
--- /dev/null
+++ b/include/nitro/OS_tick_shared.h
@@ -0,0 +1,24 @@
+/*
+ * NOTE:
+ * This file is shared between ARM9 and ARM7
+ * DO NOT PUT PROC SPECIFIC CODE IN HERE
+ * Thank You!
+ */
+
+/*
+ * DO NOT INCLUDE THIS FILE DIRECTLY
+ * Include OS_tick.h from the specific proc's lib
+ */
+
+#ifndef POKEDIAMOND_OS_TICK_SHARED_H
+#define POKEDIAMOND_OS_TICK_SHARED_H
+
+#include "nitro/types.h"
+
+typedef u64 OSTick;
+
+#define OS_SYSTEM_CLOCK HW_SYSTEM_CLOCK
+
+#define OS_MilliSecondsToTicks(msec) ((OSTick)(((OS_SYSTEM_CLOCK/1000) * (u64)(msec)) / 64))
+
+#endif //POKEDIAMOND_OS_TICK_SHARED_H
diff --git a/include/nitro/consts_shared.h b/include/nitro/consts_shared.h
index b6342172..26cc2fca 100644
--- a/include/nitro/consts_shared.h
+++ b/include/nitro/consts_shared.h
@@ -30,6 +30,14 @@
#define OSi_InRange(targ, a, b) ((u32)(a) <= (u32)(targ) && (u32)(targ) < (u32)(b))
#define OSi_OFFSET(n, a) (((u32) (n)) & ((a) - 1))
+#define OS_THREAD_SPECIFIC_MAX 0x03
+
+#define OS_THREAD_LAUNCHER_PRIORITY 0x10
+#define OS_THREAD_PRIORITY_MIN 0x00
+#define OS_THREAD_PRIORITY_MAX 0x1F
+
+#define HW_SYSTEM_CLOCK 33514000
+
#define OSi_GetArenaInfo() (*(OSArenaInfo*)HW_ARENA_INFO_BUF)
#endif //POKEDIAMOND_CONSTS_SHARED_H
diff --git a/include/nitro/mmap_shared.h b/include/nitro/mmap_shared.h
index f7ba4fb4..60c0c1cb 100644
--- a/include/nitro/mmap_shared.h
+++ b/include/nitro/mmap_shared.h
@@ -18,6 +18,9 @@
#define HW_MAIN_MEM_MAIN_SIZE 0x003E0000
#define HW_MAIN_MEM_SHARED_SIZE 0x00001000
+#define HW_WRAM 0x037F8000
+
+#define HW_MAIN_MEM_SYSTEM (HW_MAIN_MEM + 0x007ffc00)
#define HW_WM_BOOT_BUF (HW_MAIN_MEM + 0x007ffc40)
#define HW_ARENA_INFO_BUF (HW_MAIN_MEM + 0x007ffda0)
#define HW_CTRDG_LOCK_BUF (HW_MAIN_MEM + 0x007fffe8)