diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/items.h | 107 | ||||
-rw-r--r-- | include/constants/pokemon.h | 47 | ||||
-rw-r--r-- | include/itemtool.h | 33 | ||||
-rw-r--r-- | include/math_util.h | 34 | ||||
-rw-r--r-- | include/move_data.h | 33 | ||||
-rw-r--r-- | include/msgdata.h | 44 | ||||
-rw-r--r-- | include/nitro/OS_alarm_shared.h | 35 | ||||
-rw-r--r-- | include/nitro/OS_mutex_shared.h | 26 | ||||
-rw-r--r-- | include/nitro/OS_systemWork_shared.h | 66 | ||||
-rw-r--r-- | include/nitro/OS_thread_shared.h | 12 | ||||
-rw-r--r-- | include/nitro/OS_tick_shared.h | 24 | ||||
-rw-r--r-- | include/nitro/consts_shared.h | 8 | ||||
-rw-r--r-- | include/nitro/mmap_shared.h | 3 | ||||
-rw-r--r-- | include/pokemon.h | 31 | ||||
-rw-r--r-- | include/proto.h | 9 | ||||
-rw-r--r-- | include/string16.h | 5 | ||||
-rw-r--r-- | include/string_util.h | 4 | ||||
-rw-r--r-- | include/text.h | 2 | ||||
-rw-r--r-- | include/unk_0201B8B88.h | 9 |
19 files changed, 483 insertions, 49 deletions
diff --git a/include/constants/items.h b/include/constants/items.h index 98c3dd97..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 @@ -445,4 +447,109 @@ #define ITEM_STORAGE_KEY 463 #define ITEM_SECRETPOTION 464 +#define TM_FOCUS_PUNCH ITEM_TM01 +#define TM_DRAGON_CLAW ITEM_TM02 +#define TM_WATER_PULSE ITEM_TM03 +#define TM_CALM_MIND ITEM_TM04 +#define TM_ROAR ITEM_TM05 +#define TM_TOXIC ITEM_TM06 +#define TM_HAIL ITEM_TM07 +#define TM_BULK_UP ITEM_TM08 +#define TM_BULLET_SEED ITEM_TM09 +#define TM_HIDDEN_POWER ITEM_TM10 +#define TM_SUNNY_DAY ITEM_TM11 +#define TM_TAUNT ITEM_TM12 +#define TM_ICE_BEAM ITEM_TM13 +#define TM_BLIZZARD ITEM_TM14 +#define TM_HYPER_BEAM ITEM_TM15 +#define TM_LIGHT_SCREEN ITEM_TM16 +#define TM_PROTECT ITEM_TM17 +#define TM_RAIN_DANCE ITEM_TM18 +#define TM_GIGA_DRAIN ITEM_TM19 +#define TM_SAFEGUARD ITEM_TM20 +#define TM_FRUSTRATION ITEM_TM21 +#define TM_SOLARBEAM ITEM_TM22 +#define TM_IRON_TAIL ITEM_TM23 +#define TM_THUNDERBOLT ITEM_TM24 +#define TM_THUNDER ITEM_TM25 +#define TM_EARTHQUAKE ITEM_TM26 +#define TM_RETURN ITEM_TM27 +#define TM_DIG ITEM_TM28 +#define TM_PSYCHIC ITEM_TM29 +#define TM_SHADOW_BALL ITEM_TM30 +#define TM_BRICK_BREAK ITEM_TM31 +#define TM_DOUBLE_TEAM ITEM_TM32 +#define TM_REFLECT ITEM_TM33 +#define TM_SHOCK_WAVE ITEM_TM34 +#define TM_FLAMETHROWER ITEM_TM35 +#define TM_SLUDGE_BOMB ITEM_TM36 +#define TM_SANDSTORM ITEM_TM37 +#define TM_FIRE_BLAST ITEM_TM38 +#define TM_ROCK_TOMB ITEM_TM39 +#define TM_AERIAL_ACE ITEM_TM40 +#define TM_TORMENT ITEM_TM41 +#define TM_FACADE ITEM_TM42 +#define TM_SECRET_POWER ITEM_TM43 +#define TM_REST ITEM_TM44 +#define TM_ATTRACT ITEM_TM45 +#define TM_THIEF ITEM_TM46 +#define TM_STEEL_WING ITEM_TM47 +#define TM_SKILL_SWAP ITEM_TM48 +#define TM_SNATCH ITEM_TM49 +#define TM_OVERHEAT ITEM_TM50 +#define TM_ROOST ITEM_TM51 +#define TM_FOCUS_BLAST ITEM_TM52 +#define TM_ENERGY_BALL ITEM_TM53 +#define TM_FALSE_SWIPE ITEM_TM54 +#define TM_BRINE ITEM_TM55 +#define TM_FLING ITEM_TM56 +#define TM_CHARGE_BEAM ITEM_TM57 +#define TM_ENDURE ITEM_TM58 +#define TM_DRAGON_PULSE ITEM_TM59 +#define TM_DRAIN_PUNCH ITEM_TM60 +#define TM_WILL_O_WISP ITEM_TM61 +#define TM_SILVER_WIND ITEM_TM62 +#define TM_EMBARGO ITEM_TM63 +#define TM_EXPLOSION ITEM_TM64 +#define TM_SHADOW_CLAW ITEM_TM65 +#define TM_PAYBACK ITEM_TM66 +#define TM_RECYCLE ITEM_TM67 +#define TM_GIGA_IMPACT ITEM_TM68 +#define TM_ROCK_POLISH ITEM_TM69 +#define TM_FLASH ITEM_TM70 +#define TM_STONE_EDGE ITEM_TM71 +#define TM_AVALANCHE ITEM_TM72 +#define TM_THUNDER_WAVE ITEM_TM73 +#define TM_GYRO_BALL ITEM_TM74 +#define TM_SWORDS_DANCE ITEM_TM75 +#define TM_STEALTH_ROCK ITEM_TM76 +#define TM_PSYCH_UP ITEM_TM77 +#define TM_CAPTIVATE ITEM_TM78 +#define TM_DARK_PULSE ITEM_TM79 +#define TM_ROCK_SLIDE ITEM_TM80 +#define TM_X_SCISSOR ITEM_TM81 +#define TM_SLEEP_TALK ITEM_TM82 +#define TM_NATURAL_GIFT ITEM_TM83 +#define TM_POISON_JAB ITEM_TM84 +#define TM_DREAM_EATER ITEM_TM85 +#define TM_GRASS_KNOT ITEM_TM86 +#define TM_SWAGGER ITEM_TM87 +#define TM_PLUCK ITEM_TM88 +#define TM_U_TURN ITEM_TM89 +#define TM_SUBSTITUTE ITEM_TM90 +#define TM_FLASH_CANNON ITEM_TM91 +#define TM_TRICK_ROOM ITEM_TM92 +#define HM_CUT ITEM_HM01 +#define HM_FLY ITEM_HM02 +#define HM_SURF ITEM_HM03 +#define HM_STRENGTH ITEM_HM04 +#define HM_DEFOG ITEM_HM05 +#define HM_WHIRLPOOL ITEM_HM05 +#define HM_ROCK_SMASH ITEM_HM06 +#define HM_WATERFALL ITEM_HM07 +#define HM_ROCK_CLIMB ITEM_HM08 + +#define NUM_TMS 92 +#define NUM_HMS 8 + #endif //POKEDIAMOND_CONSTANTS_ITEMS_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 9accbad1..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, @@ -404,4 +410,45 @@ typedef enum { UNOWN_QUESTION_MARK = 27 } AlternateForms; +typedef enum EvoMethod +{ + EVO_NONE = 0, + EVO_FRIENDSHIP, + EVO_FRIENDSHIP_DAY, + EVO_FRIENDSHIP_NIGHT, + EVO_LEVEL, + EVO_TRADE, + EVO_TRADE_ITEM, + EVO_STONE, + EVO_LEVEL_ATK_GT_DEF, + EVO_LEVEL_ATK_EQ_DEF, + EVO_LEVEL_ATK_LT_DEF, + EVO_LEVEL_PID_LO, + EVO_LEVEL_PID_HI, + EVO_LEVEL_NINJASK, + EVO_LEVEL_SHEDINJA, + EVO_BEAUTY, + EVO_STONE_MALE, + EVO_STONE_FEMALE, + EVO_ITEM_DAY, + EVO_ITEM_NIGHT, + EVO_HAS_MOVE, + EVO_OTHER_PARTY_MON, + EVO_LEVEL_MALE, + EVO_LEVEL_FEMALE, + EVO_CORONET, + EVO_ETERNA, + 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..d8419c2b --- /dev/null +++ b/include/itemtool.h @@ -0,0 +1,33 @@ +#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; +}; + +NARC * OpenNutsDataNarc(u32 heap_id); +struct NutData * ReadNutDataFromNarc(NARC * narc, u32 berry_idx, u32 heap_id); +void CloseNutsDataNarc(NARC * narc); +struct NutData * LoadNutDataSingle(s32 berry_idx, u32 heap_id); +struct NutData * LoadNutDataSingleByItemId(s32 item_id, u32 heap_id); +u32 GetNutAttr(struct NutData * nut, u32 attr); +struct String * GetNutName(u32 berry_idx, u32 heap_id); +struct String * GetNutDesc(u32 berry_idx, u32 heap_id); + +#endif //POKEDIAMOND_ITEMTOOL_H diff --git a/include/math_util.h b/include/math_util.h index f7169956..f66f8a07 100644 --- a/include/math_util.h +++ b/include/math_util.h @@ -1,6 +1,38 @@ #ifndef POKEDIAMOND_MATH_UTIL_H #define POKEDIAMOND_MATH_UTIL_H +#include "fx.h" -u16 rand_LC(void); +/* + * Trigonometric functions + */ +s32 Sin(u16 degrees); +s32 Cos(u16 degrees); +s32 Sin_Wrap(u16 degrees); +s32 Cos_Wrap(u16 degrees); +u16 MathUtil_0201B9A0(u16 x); +s32 Sin32(s32 degrees); + +/* + * Random number generators + */ +u32 GetLCRNGSeed(); +void SetLCRNGSeed(u32 seed); +u16 LCRandom(void); + +u32 PRandom(u32 seed); + +void SetMTRNGSeed(u32 seed); +u32 MTRandom(void); + +/* + * Nitro FX specific functions + */ +void MTX22_2DAffine(struct Mtx22 * mtx, u16 radians, fx32 x, fx32 y, u8 type); + +/* + * Vector functions + */ +s32 CircularDistance(s32 x1, s32 y1, s32 x2, s32 y2); +s32 MathUtil_0201BC84(u16 arg0, s32 arg1); #endif //POKEDIAMOND_MATH_UTIL_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/msgdata.h b/include/msgdata.h new file mode 100644 index 00000000..fae8ca78 --- /dev/null +++ b/include/msgdata.h @@ -0,0 +1,44 @@ +#ifndef POKEDIAMOND_MSG_DATA_H +#define POKEDIAMOND_MSG_DATA_H + +#include "string16.h" + +struct MsgDataAlloc +{ + u32 offset; + u32 length; +}; + +struct MsgDataTable +{ + u16 count; + u16 key; + struct MsgDataAlloc alloc[1]; +}; + +struct MsgData +{ + u16 type; + u16 heap_id; + u16 narc_id; + u16 file_id; + union { + struct MsgDataTable * raw; + NARC * narc; + } data; +}; + +void ReadMsgData_NewNarc_ExistingString(NarcId narc_id, u32 group, u32 num, u32 heap_id, struct String * dest); +struct MsgData * NewMsgDataFromNarc(u32 type, NarcId narcId, s32 msgId, u32 heapno); +void DestroyMsgData(struct MsgData *); +struct String * ReadMsgData_NewNarc_NewString(NarcId narc_id, u32 group, u32 num, u32 heap_id); +void ReadMsgDataIntoString(struct MsgData * msgData, u32 msg_no, struct String * dest); +struct String * NewString_ReadMsgData(struct MsgData *, u32); +u16 MsgDataGetCount(struct MsgData * msgData); +void ReadMsgDataIntoU16Array(struct MsgData * msgData, u32 msg_no, u16 * dest); +void GetSpeciesNameIntoArray(u16 species, u32 heap_id, u16 * dest); +struct String * ReadMsgData_ExpandPlaceholders(u32 * a0, struct MsgData * msgData, u32 msgno, u32 heap_id); +struct String * GetMoveName(u32 move, u32 heapno); +struct String * GetSpeciesName(u16 species, u32 heap_id); + +#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) diff --git a/include/pokemon.h b/include/pokemon.h index 01a03763..2387ef78 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -46,37 +46,6 @@ struct BaseStats { /* 0x28 */ u32 unk28; }; -typedef enum EvoMethod -{ - EVO_NONE = 0, - EVO_FRIENDSHIP, - EVO_FRIENDSHIP_DAY, - EVO_FRIENDSHIP_NIGHT, - EVO_LEVEL, - EVO_TRADE, - EVO_TRADE_ITEM, - EVO_STONE, - EVO_LEVEL_ATK_GT_DEF, - EVO_LEVEL_ATK_EQ_DEF, - EVO_LEVEL_ATK_LT_DEF, - EVO_LEVEL_PID_LO, - EVO_LEVEL_PID_HI, - EVO_LEVEL_NINJASK, - EVO_LEVEL_SHEDINJA, - EVO_BEAUTY, - EVO_STONE_MALE, - EVO_STONE_FEMALE, - EVO_ITEM_DAY, - EVO_ITEM_NIGHT, - EVO_HAS_MOVE, - EVO_OTHER_PARTY_MON, - EVO_LEVEL_MALE, - EVO_LEVEL_FEMALE, - EVO_CORONET, - EVO_ETERNA, - EVO_ROUTE217, -} EvoMethod; - // Structs typedef struct { diff --git a/include/proto.h b/include/proto.h index 2e7d19b3..4a0012d3 100644 --- a/include/proto.h +++ b/include/proto.h @@ -4,12 +4,12 @@ // For homeless function declarations #include "pokemon.h" // for struct definitions +#include "string16.h" // for struct definitions -u16 * FUN_0200AA50(u16 species, u32 heap_id); -void FUN_02021A74(u16 * dest, u16 * src); -void FUN_02021A20(void * ptr); +void StringCopy(u16 * dest, struct String * src); +void String_dtor(void * ptr); void FUN_02021E28(u16 * dest, u16 * src); -void FUN_02021EF0(const u16 * src, u16 * dest, u32 count); +void FUN_02021EF0(const struct String * src, u16 * dest, u32 count); u32 FUN_0206E7B8(u16 item, u32 a1, u32 a2); int FUN_02014C3C(u8); void FUN_02014C54(int, int, struct UnkStruct_02069038 *, u8); @@ -20,5 +20,6 @@ void FUN_02005E90(int, int, int, int); void FUN_020056AC(int, int, int, int, int); void FUN_020808AC(struct BoxPokemon *, int, int, int, int); void * FUN_02022610(void *, int); +void StringExpandPlaceholders(u32 *, struct String *, struct String *); #endif //POKEDIAMOND_PROTO_H diff --git a/include/string16.h b/include/string16.h index 7092c641..91888a7b 100644 --- a/include/string16.h +++ b/include/string16.h @@ -10,8 +10,11 @@ struct String u16 data[1]; }; -struct String * FUN_020219F4(u32 count, u32 heap_id); +struct String * String_ctor(u32 count, u32 heap_id); int FUN_02021CE0(struct String *, struct String *); int FUN_0206AE00(int x); +void FUN_02021E8C(struct String *, u16 *, u32); // copy +void StringSetEmpty(struct String *); // set empty +struct String * StringDup(struct String *, u32 heap_id); #endif //POKEDIAMOND_STRING16_H diff --git a/include/string_util.h b/include/string_util.h index e9079229..52168ace 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -16,8 +16,8 @@ enum PrintingMode { PAD_ZEROES }; -void StringCopy(u16 *dest, const u16 *src); -u16 *StringCopyN(u16 *dest, const u16 *src, u32 num); +void CopyU16StringArray(u16 *dest, const u16 *src); +u16 *CopyU16StringArrayN(u16 *dest, const u16 *src, u32 num); u32 StringLength(const u16 *s); BOOL StringNotEqual(const u16 *s1, const u16 *s2); BOOL StringNotEqualN(const u16 *s1, const u16 *s2, u32 num); diff --git a/include/text.h b/include/text.h index cec36a30..8b7fe896 100644 --- a/include/text.h +++ b/include/text.h @@ -1,6 +1,6 @@ #ifndef POKEDIAMOND_TEXT_H #define POKEDIAMOND_TEXT_H -void GetSpeciesName(u16 species, u32 heap_id, u16 * dest); +void GetSpeciesNameIntoArray(u16 species, u32 heap_id, u16 * dest); #endif //POKEDIAMOND_TEXT_H diff --git a/include/unk_0201B8B88.h b/include/unk_0201B8B88.h new file mode 100644 index 00000000..95eab968 --- /dev/null +++ b/include/unk_0201B8B88.h @@ -0,0 +1,9 @@ +#ifndef POKEDIAMOND_UNK_0201B8B88_H +#define POKEDIAMOND_UNK_0201B8B88_H + +const u16 * FUN_0201B8B8(const u16 * r4); +u16 FUN_0201B8E0(const u16 * r4); +BOOL FUN_0201B8F8(const u16 * r4); +u16 FUN_0201B914(const u16 * r5, u32 r4); + +#endif //POKEDIAMOND_UNK_0201B8B88_H |