diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 378d2dd8..8fd941df 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -2,6 +2,7 @@ #define HEADERS_FUNCTIONS_ARM9_H_ #include "arm9/itcm.h" +#include "arm9/libs.h" void Svc_SoftReset(void); void Svc_WaitByLoop(void); @@ -1059,142 +1060,5 @@ void MainLoop(void); int DungeonSwapIdToIdx(enum dungeon_id dungeon_id); enum dungeon_id DungeonSwapIdxToId(int idx); enum dungeon_mode GetDungeonModeSpecial(enum dungeon_id dungeon_id); -int SoundUtilGetRandomNumber(void); -void* ReadWaviEntry(struct wavi_data* wavi_data, int entry_index); -int ResumeBgm(undefined4 param_1, undefined4 param_2, undefined4 param_3); -void* FindSmdlSongChunk(void* smdl_data, uint16_t value_to_search); -int FlushChannels(undefined* param_1, int param_2, int param_3); -void ParseDseEvent(undefined* audio_state, struct track_data* track_data); -void UpdateSequencerTracks(int param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4); -void UpdateChannels(void); -void SoundEnvelopeReset(struct sound_envelope* envelope); -void SoundEnvelopeParametersReset(struct sound_envelope_parameters* parameters); -void SoundEnvelopeParametersCheckValidity(struct sound_envelope_parameters* parameters); -void SoundEnvelopeSetParameters(struct sound_envelope* envelope, - struct sound_envelope_parameters* parameters); -void SoundEnvelopeSetSlide(struct sound_envelope* envelope, int target_volume, int msec_tab_index); -void UpdateTrackVolumeEnvelopes(struct sound_envelope* envelope); -void SoundEnvelopeRelease(struct sound_envelope* envelope); -void SoundEnvelopeStop(struct sound_envelope* envelope); -void SoundEnvelopeForceVolume(struct sound_envelope* envelope, int volume); -void SoundEnvelopeStop2(struct sound_envelope* envelope); -int8_t SoundEnvelopeTick(struct sound_envelope* envelope); -void SoundLfoBankReset(struct dse_lfo_bank* lfo_bank); -void SoundLfoBankSet(struct dse_lfo_bank* lfo_bank, struct dse_lfo_settings* lfo_settings, - int8_t const_envelope_level); -void SoundLfoBankSetConstEnvelopes(struct dse_lfo_bank* lfo_bank, int8_t level); -uint16_t SoundLfoBankTick(struct dse_lfo_bank* lfo_bank); -int SoundLfoWaveInvalidFunc(struct dse_lfo* lfo); -int SoundLfoWaveHalfSquareFunc(struct dse_lfo* lfo); -int SoundLfoWaveFullSquareFunc(struct dse_lfo* lfo); -int SoundLfoWaveHalfTriangleFunc(struct dse_lfo* lfo); -int SoundLfoWaveFullTriangleFunc(struct dse_lfo* lfo); -int SoundLfoWaveSawFunc(struct dse_lfo* lfo); -int SoundLfoWaveReverseSawFunc(struct dse_lfo* lfo); -int SoundLfoWaveHalfNoiseFunc(struct dse_lfo* lfo); -int SoundLfoWaveFullNoiseFunc(struct dse_lfo* lfo); -void EnableVramBanksInSetDontSave(struct vram_banks_set vram_banks); -void EnableVramBanksInSet(struct vram_banks_set* vram_banks); -void G3_LoadMtx43(struct matrix_4x3* matrix); -void G3_MultMtx43(struct matrix_4x3* matrix); -void GeomGxFifoSendMtx4x3(struct matrix_4x3* matrix, void* gxfifo); -int IncrementThreadCount(void); -void InsertThreadIntoList(struct thread* thread); -void StartThread(struct thread* thread, thread_entry_fn_t function, struct thread* param_3, - void* stack_area, int stack_size, int param_6); -void ThreadExit(void); -void SetThreadField0xB4(struct thread* thread, int value); -void InitThread(struct thread* thread, void* function, void* stack_area_minus_4); -uint16_t GetTimer0Control(void); -int ClearIrqFlag(void); -int EnableIrqFlag(void); -int SetIrqFlag(int new_value); -int EnableIrqFiqFlags(void); -int SetIrqFiqFlags(int new_value); -int GetIrqFlag(void); -int GetProcessorMode(void); -uint32_t CountLeadingZeros(uint32_t x); -void WaitForever2(void); -void WaitForInterrupt(void); -void ArrayFill16(uint16_t val, void* ptr, int len); -void ArrayCopy16(void* src, void* dest, int len); -void ArrayFill32(uint32_t val, void* ptr, int len); -void ArrayCopy32(void* src, void* dest, int len); -void ArrayFill32Fast(uint32_t val, void* ptr, int len); -void ArrayCopy32Fast(void* src, void* dest, int len); -void MemsetFast(void* ptr, char val, uint32_t len); -void MemcpyFast(void* src, void* dest, uint32_t n); -uint32_t AtomicExchange(uint32_t desired, void* ptr); -void FileInit(struct file_stream* file); -bool GetOverlayInfo(struct overlay_info_entry* overlay_info, undefined param_2, int overlay_id); -bool LoadOverlayInternal(struct overlay_info_entry* overlay_info); -void InitOverlay(struct overlay_info_entry* overlay_info); - -// If declaring these builtins causes issues, you can disable them -#ifndef PMDSKY_NO_BUILTIN -int abs(int x); -int mbtowc(wchar_t* pwc, const char* s, size_t n); -bool TryAssignByte(uint8_t* ptr, uint8_t val); -bool TryAssignByteWrapper(uint8_t* ptr, uint8_t val); -size_t wcstombs(char* dest, const wchar_t* src, size_t n); -void* memcpy(void* dest, const void* src, size_t n); -void* memmove(void* dest, const void* src, size_t n); -void* memset(void* s, int c, size_t n); -void* memchr(const void* s, int c, size_t n); -int memcmp(const void* s1, const void* s2, size_t n); -void memset_internal(void* s, int c, size_t n); -int __vsprintf_internal_slice(slice_append_fn_t append, struct slice* str, const char* format, - va_list ap); -bool TryAppendToSlice(struct slice* slice, const void* data, size_t data_len); -int __vsprintf_internal(char* str, size_t maxlen, const char* format, va_list ap); -int vsprintf(char* str, const char* format, va_list ap); -int snprintf(char* str, size_t n, const char* format, ...); -int sprintf(char* str, const char* format, ...); -size_t strlen(const char* s); -char* strcpy(char* dest, const char* src); -char* strncpy(char* dest, const char* src, size_t n); -char* strcat(char* dest, const char* src); -char* strncat(char* dest, const char* src, size_t n); -int strcmp(const char* s1, const char* s2); -int strncmp(const char* s1, const char* s2, size_t n); -char* strchr(const char* string, int c); -size_t strcspn(const char* string, const char* stopset); -char* strstr(const char* haystack, const char* needle); -size_t wcslen(const wchar_t* ws); -double _dadd(double a, double b); -float _d2f(double d); -unsigned long long _ll_ufrom_d(double d); -double _dflt(int i); -double _dfltu(uint32_t u); -double _dmul(double a, double b); -double _dsqrt(double x); -double _dsub(double a, double b); -float _fadd(float a, float b); -bool _dgeq(double a, double b); -bool _dleq(double a, double b); -bool _dls(double a, double b); -bool _deq(double a, double b); -bool _dneq(double a, double b); -bool _fls(float a, float b); -float _fdiv(float dividend, float divisor); -double _f2d(float f); -int _ffix(float f); -float _fflt(int i); -float _ffltu(uint32_t u); -float _fmul(float a, float b); -float sqrtf(float x); -float _fsub(float a, float b); -long long _ll_mod(long long dividend, long long divisor); -long long _ll_sdiv(long long dividend, long long divisor); -unsigned long long _ll_udiv(unsigned long long dividend, unsigned long long divisor); -unsigned long long _ull_mod(unsigned long long dividend, unsigned long long divisor); -long long _ll_mul(long long a, long long b); -unsigned long long _s32_div_f(int dividend, int divisor); -unsigned long long _u32_div_f(uint32_t dividend, uint32_t divisor); -unsigned long long _u32_div_not_0_f(uint32_t dividend, uint32_t divisor); -double _drdiv(double divisor, double dividend); -double _ddiv(double dividend, double divisor); -void _fp_init(void); -#endif // #ifndef PMDSKY_NO_BUILTIN #endif diff --git a/headers/functions/arm9/libs.h b/headers/functions/arm9/libs.h new file mode 100644 index 00000000..de4b0b73 --- /dev/null +++ b/headers/functions/arm9/libs.h @@ -0,0 +1,142 @@ +#ifndef HEADERS_FUNCTIONS_ARM9_LIBS_H_ +#define HEADERS_FUNCTIONS_ARM9_LIBS_H_ + +int SoundUtilGetRandomNumber(void); +void* ReadWaviEntry(struct wavi_data* wavi_data, int entry_index); +int ResumeBgm(undefined4 param_1, undefined4 param_2, undefined4 param_3); +void* FindSmdlSongChunk(void* smdl_data, uint16_t value_to_search); +int FlushChannels(undefined* param_1, int param_2, int param_3); +void ParseDseEvent(undefined* audio_state, struct track_data* track_data); +void UpdateSequencerTracks(int param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4); +void UpdateChannels(void); +void SoundEnvelopeReset(struct sound_envelope* envelope); +void SoundEnvelopeParametersReset(struct sound_envelope_parameters* parameters); +void SoundEnvelopeParametersCheckValidity(struct sound_envelope_parameters* parameters); +void SoundEnvelopeSetParameters(struct sound_envelope* envelope, + struct sound_envelope_parameters* parameters); +void SoundEnvelopeSetSlide(struct sound_envelope* envelope, int target_volume, int msec_tab_index); +void UpdateTrackVolumeEnvelopes(struct sound_envelope* envelope); +void SoundEnvelopeRelease(struct sound_envelope* envelope); +void SoundEnvelopeStop(struct sound_envelope* envelope); +void SoundEnvelopeForceVolume(struct sound_envelope* envelope, int volume); +void SoundEnvelopeStop2(struct sound_envelope* envelope); +int8_t SoundEnvelopeTick(struct sound_envelope* envelope); +void SoundLfoBankReset(struct dse_lfo_bank* lfo_bank); +void SoundLfoBankSet(struct dse_lfo_bank* lfo_bank, struct dse_lfo_settings* lfo_settings, + int8_t const_envelope_level); +void SoundLfoBankSetConstEnvelopes(struct dse_lfo_bank* lfo_bank, int8_t level); +uint16_t SoundLfoBankTick(struct dse_lfo_bank* lfo_bank); +int SoundLfoWaveInvalidFunc(struct dse_lfo* lfo); +int SoundLfoWaveHalfSquareFunc(struct dse_lfo* lfo); +int SoundLfoWaveFullSquareFunc(struct dse_lfo* lfo); +int SoundLfoWaveHalfTriangleFunc(struct dse_lfo* lfo); +int SoundLfoWaveFullTriangleFunc(struct dse_lfo* lfo); +int SoundLfoWaveSawFunc(struct dse_lfo* lfo); +int SoundLfoWaveReverseSawFunc(struct dse_lfo* lfo); +int SoundLfoWaveHalfNoiseFunc(struct dse_lfo* lfo); +int SoundLfoWaveFullNoiseFunc(struct dse_lfo* lfo); +void EnableVramBanksInSetDontSave(struct vram_banks_set vram_banks); +void EnableVramBanksInSet(struct vram_banks_set* vram_banks); +void G3_LoadMtx43(struct matrix_4x3* matrix); +void G3_MultMtx43(struct matrix_4x3* matrix); +void GeomGxFifoSendMtx4x3(struct matrix_4x3* matrix, void* gxfifo); +int IncrementThreadCount(void); +void InsertThreadIntoList(struct thread* thread); +void StartThread(struct thread* thread, thread_entry_fn_t function, struct thread* param_3, + void* stack_area, int stack_size, int param_6); +void ThreadExit(void); +void SetThreadField0xB4(struct thread* thread, int value); +void InitThread(struct thread* thread, void* function, void* stack_area_minus_4); +uint16_t GetTimer0Control(void); +int ClearIrqFlag(void); +int EnableIrqFlag(void); +int SetIrqFlag(int new_value); +int EnableIrqFiqFlags(void); +int SetIrqFiqFlags(int new_value); +int GetIrqFlag(void); +int GetProcessorMode(void); +uint32_t CountLeadingZeros(uint32_t x); +void WaitForever2(void); +void WaitForInterrupt(void); +void ArrayFill16(uint16_t val, void* ptr, int len); +void ArrayCopy16(void* src, void* dest, int len); +void ArrayFill32(uint32_t val, void* ptr, int len); +void ArrayCopy32(void* src, void* dest, int len); +void ArrayFill32Fast(uint32_t val, void* ptr, int len); +void ArrayCopy32Fast(void* src, void* dest, int len); +void MemsetFast(void* ptr, char val, uint32_t len); +void MemcpyFast(void* src, void* dest, uint32_t n); +uint32_t AtomicExchange(uint32_t desired, void* ptr); +void FileInit(struct file_stream* file); +bool GetOverlayInfo(struct overlay_info_entry* overlay_info, undefined param_2, int overlay_id); +bool LoadOverlayInternal(struct overlay_info_entry* overlay_info); +void InitOverlay(struct overlay_info_entry* overlay_info); + +// If declaring these builtins causes issues, you can disable them +#ifndef PMDSKY_NO_BUILTIN +int abs(int x); +int mbtowc(wchar_t* pwc, const char* s, size_t n); +bool TryAssignByte(uint8_t* ptr, uint8_t val); +bool TryAssignByteWrapper(uint8_t* ptr, uint8_t val); +size_t wcstombs(char* dest, const wchar_t* src, size_t n); +void* memcpy(void* dest, const void* src, size_t n); +void* memmove(void* dest, const void* src, size_t n); +void* memset(void* s, int c, size_t n); +void* memchr(const void* s, int c, size_t n); +int memcmp(const void* s1, const void* s2, size_t n); +void memset_internal(void* s, int c, size_t n); +int __vsprintf_internal_slice(slice_append_fn_t append, struct slice* str, const char* format, + va_list ap); +bool TryAppendToSlice(struct slice* slice, const void* data, size_t data_len); +int __vsprintf_internal(char* str, size_t maxlen, const char* format, va_list ap); +int vsprintf(char* str, const char* format, va_list ap); +int snprintf(char* str, size_t n, const char* format, ...); +int sprintf(char* str, const char* format, ...); +size_t strlen(const char* s); +char* strcpy(char* dest, const char* src); +char* strncpy(char* dest, const char* src, size_t n); +char* strcat(char* dest, const char* src); +char* strncat(char* dest, const char* src, size_t n); +int strcmp(const char* s1, const char* s2); +int strncmp(const char* s1, const char* s2, size_t n); +char* strchr(const char* string, int c); +size_t strcspn(const char* string, const char* stopset); +char* strstr(const char* haystack, const char* needle); +size_t wcslen(const wchar_t* ws); +double _dadd(double a, double b); +float _d2f(double d); +unsigned long long _ll_ufrom_d(double d); +double _dflt(int i); +double _dfltu(uint32_t u); +double _dmul(double a, double b); +double _dsqrt(double x); +double _dsub(double a, double b); +float _fadd(float a, float b); +bool _dgeq(double a, double b); +bool _dleq(double a, double b); +bool _dls(double a, double b); +bool _deq(double a, double b); +bool _dneq(double a, double b); +bool _fls(float a, float b); +float _fdiv(float dividend, float divisor); +double _f2d(float f); +int _ffix(float f); +float _fflt(int i); +float _ffltu(uint32_t u); +float _fmul(float a, float b); +float sqrtf(float x); +float _fsub(float a, float b); +long long _ll_mod(long long dividend, long long divisor); +long long _ll_sdiv(long long dividend, long long divisor); +unsigned long long _ll_udiv(unsigned long long dividend, unsigned long long divisor); +unsigned long long _ull_mod(unsigned long long dividend, unsigned long long divisor); +long long _ll_mul(long long a, long long b); +unsigned long long _s32_div_f(int dividend, int divisor); +unsigned long long _u32_div_f(uint32_t dividend, uint32_t divisor); +unsigned long long _u32_div_not_0_f(uint32_t dividend, uint32_t divisor); +double _drdiv(double divisor, double dividend); +double _ddiv(double dividend, double divisor); +void _fp_init(void); +#endif // #ifndef PMDSKY_NO_BUILTIN + +#endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5d8ac6dc..ca8400ae 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -23,11 +23,12 @@ arm9: description: |- The main ARM9 binary. - This is the main binary that gets loaded when the game is launched, and contains the core code that runs the game, low level facilities such as memory allocation, compression, other external dependencies (such as linked functions from libc and libgcc), and the functions and tables necessary to load overlays and dispatch execution to them. + This is the main binary that gets loaded when the game is launched, and contains the core code that runs the game, low level facilities such as memory allocation, compression, other external dependencies (such as linked libraries), and the functions and tables necessary to load overlays and dispatch execution to them. Speaking generally, this is the program run by the Nintendo DS's main ARM946E-S CPU, which handles all gameplay mechanisms and graphics rendering. subregions: - itcm.yml + - libs.yml functions: - name: Svc_SoftReset address: @@ -10101,1883 +10102,6 @@ arm9: r0: Dungeon ID return: Dungeon mode - - name: SoundUtilGetRandomNumber - address: - EU: 0x206CC8C - NA: 0x206C8F4 - description: "return: random number in the range [0, 32767]" - - name: ReadWaviEntry - address: - EU: 0x206D8F0 - NA: 0x206D558 - JP: 0x206D840 - description: |- - Reads an entry from the pointer table of a wavi container and returns a pointer to the data of said entry, which contains information about a particular sample. - - r0: Wavi data struct - r1: Entry index - retrun: Pointer to the entry's data - - name: ResumeBgm - address: - EU: 0x206DD54 - NA: 0x206D9BC - JP: 0x206DCA4 - description: |- - Uncertain. - - Note: unverified, ported from Irdkwia's notes - - name: FindSmdlSongChunk - address: - EU: 0x206E880 - NA: 0x206E4E8 - JP: 0x206E7D0 - description: |- - Finds the first song chunk within an SMDL file that has the specified value on its 0x10 field. - - See https://projectpokemon.org/home/docs/mystery-dungeon-nds/dse-smdl-format-r13/. - - r0: Pointer to the start of the SMDL file - r1: Value to search for - return: Pointer to the first chunk that has the specified value + 0x10, or null if no chunk was found. - - name: FlushChannels - address: - EU: 0x2070A0C - NA: 0x2070674 - JP: 0x207095C - description: "Note: unverified, ported from Irdkwia's notes" - - name: ParseDseEvent - address: - EU: 0x20715BC - NA: 0x2071224 - JP: 0x207150C - description: |- - Parses and executes a DSE event for the specified track, if necessary. - - The function checks the time left before the next event (track_data::event_delay), and parses it if said time is 0. - - See also https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/ - - r0: Pointer to some struct that seems to hold the state of the audio engine - r1: Pointer to track data - - name: UpdateSequencerTracks - address: - EU: 0x2071780 - NA: 0x20713E8 - JP: 0x20716D0 - description: "From https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/" - - name: UpdateChannels - address: - EU: 0x2074824 - NA: 0x207448C - JP: 0x2074774 - description: |- - From https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/ and Irdkwia's notes. - - No params. - - name: SoundEnvelopeReset - address: - EU: 0x2075008 - NA: 0x2074C70 - description: "r0: Sound envelope pointer" - - name: SoundEnvelopeParametersReset - address: - EU: 0x207501C - NA: 0x2074C84 - description: "r0: Sound envelope parameters pointer" - - name: SoundEnvelopeParametersCheckValidity - address: - EU: 0x2075038 - NA: 0x2074CA0 - description: "r0: Sound envelope parameters pointer" - - name: SoundEnvelopeSetParameters - address: - EU: 0x207508C - NA: 0x2074CF4 - description: |- - r0: Sound envelope pointer - r1: Sound envelope parameters pointer - - name: SoundEnvelopeSetSlide - address: - EU: 0x20750F0 - NA: 0x2074D58 - description: |- - r0: Sound envelope pointer - r1: Target volume - r2: Music duration lookup table index - - name: UpdateTrackVolumeEnvelopes - address: - EU: 0x20751A4 - NA: 0x2074E0C - JP: 0x20750F4 - description: |- - From https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/ - - r0: Sound envelope pointer - - name: SoundEnvelopeRelease - address: - EU: 0x2075270 - NA: 0x2074ED8 - description: "r0: Sound envelope pointer" - - name: SoundEnvelopeStop - address: - EU: 0x207529C - NA: 0x2074F04 - description: "r0: Sound envelope pointer" - - name: SoundEnvelopeForceVolume - address: - EU: 0x20752B4 - NA: 0x2074F1C - description: |- - r0: Sound envelope pointer - r1: Volume - - name: SoundEnvelopeStop2 - address: - EU: 0x20752D4 - NA: 0x2074F3C - description: "r0: Sound envelope pointer" - - name: SoundEnvelopeTick - address: - EU: 0x20752EC - NA: 0x2074F54 - description: |- - r0: Sound envelope pointer - return: Current volume - - name: SoundLfoBankReset - address: - EU: 0x2075434 - NA: 0x207509C - description: "r0: LFO bank pointer" - - name: SoundLfoBankSet - address: - EU: 0x207544C - NA: 0x20750B4 - description: |- - r0: LFO bank pointer - r1: LFO settings pointer - r2: Envelope level - - name: SoundLfoBankSetConstEnvelopes - address: - EU: 0x2075644 - NA: 0x20752AC - description: |- - r0: LFO bank pointer - r1: Level - - name: SoundLfoBankTick - address: - EU: 0x2075690 - NA: 0x20752F8 - description: |- - r0: LFO bank pointer - return: New voice update flags - - name: SoundLfoWaveInvalidFunc - address: - EU: 0x2075744 - NA: 0x20753AC - description: |- - r0: LFO pointer - return: 0 - - name: SoundLfoWaveHalfSquareFunc - address: - EU: 0x2075758 - NA: 0x20753C0 - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveFullSquareFunc - address: - EU: 0x2075794 - NA: 0x20753FC - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveHalfTriangleFunc - address: - EU: 0x20757DC - NA: 0x2075444 - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveFullTriangleFunc - address: - EU: 0x2075830 - NA: 0x2075498 - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveSawFunc - address: - EU: 0x2075894 - NA: 0x20754FC - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveReverseSawFunc - address: - EU: 0x20758D0 - NA: 0x2075538 - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveHalfNoiseFunc - address: - EU: 0x207590C - NA: 0x2075574 - description: |- - r0: LFO pointer - return: LFO current output - - name: SoundLfoWaveFullNoiseFunc - address: - EU: 0x2075950 - NA: 0x20755B8 - description: |- - r0: LFO pointer - return: LFO current output - - name: Crypto_RC4Init - address: - EU: 0x2075AB8 - NA: 0x2075720 - - name: Mtx_LookAt - address: - EU: 0x2075BC0 - NA: 0x2075828 - - name: Mtx_OrthoW - address: - EU: 0x2075CC8 - NA: 0x2075930 - - name: FX_Div - address: - EU: 0x2075ED0 - NA: 0x2075B38 - - name: FX_GetDivResultFx64c - address: - EU: 0x2075EE0 - NA: 0x2075B48 - - name: FX_GetDivResult - address: - EU: 0x2075F04 - NA: 0x2075B6C - - name: FX_InvAsync - address: - EU: 0x2075F3C - NA: 0x2075BA4 - - name: FX_DivAsync - address: - EU: 0x2075F6C - NA: 0x2075BD4 - - name: FX_DivS32 - address: - EU: 0x2075F94 - NA: 0x2075BFC - - name: FX_ModS32 - address: - EU: 0x2075FD0 - NA: 0x2075C38 - - name: Vec_DotProduct - address: - EU: 0x207600C - NA: 0x2075C74 - - name: Vec_CrossProduct - address: - EU: 0x2076048 - NA: 0x2075CB0 - - name: Vec_Normalize - address: - EU: 0x20760CC - NA: 0x2075D34 - - name: Vec_Distance - address: - EU: 0x20761E4 - NA: 0x2075E4C - - name: FX_Atan2Idx - address: - EU: 0x2076260 - NA: 0x2075EC8 - - name: GX_Init - address: - EU: 0x207640C - NA: 0x2076074 - - name: GX_HBlankIntr - address: - EU: 0x2076558 - NA: 0x20761C0 - - name: GX_VBlankIntr - address: - EU: 0x2076580 - NA: 0x20761E8 - - name: GX_DispOff - address: - EU: 0x20765B4 - NA: 0x207621C - - name: GX_DispOn - address: - EU: 0x20765F0 - NA: 0x2076258 - - name: GX_SetGraphicsMode - address: - EU: 0x2076638 - NA: 0x20762A0 - - name: Gxs_SetGraphicsMode - address: - EU: 0x20766A0 - NA: 0x2076308 - - name: GXx_SetMasterBrightness - address: - EU: 0x20766BC - NA: 0x2076324 - - name: GX_InitGxState - address: - EU: 0x20766E4 - NA: 0x207634C - - name: EnableVramBanksInSetDontSave - address: - EU: 0x2076744 - NA: 0x20763AC - JP: 0x2076694 - description: |- - Enable the VRAM bank marked in the input set, but don’t mark them as enabled in ENABLED_VRAM_BANKS - - r0: vram_banks_set - - name: GX_SetBankForBg - address: - EU: 0x20767FC - NA: 0x2076464 - - name: GX_SetBankForObj - address: - EU: 0x2076A8C - NA: 0x20766F4 - - name: GX_SetBankForBgExtPltt - address: - EU: 0x2076BDC - NA: 0x2076844 - - name: GX_SetBankForObjExtPltt - address: - EU: 0x2076CDC - NA: 0x2076944 - - name: GX_SetBankForTex - address: - EU: 0x2076D88 - NA: 0x20769F0 - - name: GX_SetBankForTexPltt - address: - EU: 0x2076F60 - NA: 0x2076BC8 - - name: GX_SetBankForClearImage - address: - EU: 0x2077048 - NA: 0x2076CB0 - - name: GX_SetBankForArm7 - address: - EU: 0x207717C - NA: 0x2076DE4 - - name: GX_SetBankForLcdc - address: - EU: 0x2077228 - NA: 0x2076E90 - - name: GX_SetBankForSubBg - address: - EU: 0x2077248 - NA: 0x2076EB0 - - name: GX_SetBankForSubObj - address: - EU: 0x20772F0 - NA: 0x2076F58 - - name: GX_SetBankForSubBgExtPltt - address: - EU: 0x2077360 - NA: 0x2076FC8 - - name: GX_SetBankForSubObjExtPltt - address: - EU: 0x20773E0 - NA: 0x2077048 - - name: EnableVramBanksInSet - address: - EU: 0x2077460 - NA: 0x20770C8 - JP: 0x20773B0 - description: |- - Enable the VRAM banks in the input set. Will reset the pointed set to 0, and update ENABLED_VRAM_BANKS - - r0: vram_banks_set * - - name: GX_ResetBankForBgExtPltt - address: - EU: 0x2077494 - NA: 0x20770FC - - name: GX_ResetBankForObjExtPltt - address: - EU: 0x20774B8 - NA: 0x2077120 - - name: GX_ResetBankForTex - address: - EU: 0x20774DC - NA: 0x2077144 - - name: GX_ResetBankForTexPltt - address: - EU: 0x20774F0 - NA: 0x2077158 - - name: GX_ResetBankForSubBgExtPltt - address: - EU: 0x2077504 - NA: 0x207716C - - name: GX_ResetBankForSubObjExtPltt - address: - EU: 0x207752C - NA: 0x2077194 - - name: DisableBankForX - address: - EU: 0x2077554 - NA: 0x20771BC - - name: GX_DisableBankForBg - address: - EU: 0x2077634 - NA: 0x207729C - - name: GX_DisableBankForObj - address: - EU: 0x2077648 - NA: 0x20772B0 - - name: GX_DisableBankForBgExtPltt - address: - EU: 0x207765C - NA: 0x20772C4 - - name: GX_DisableBankForObjExtPltt - address: - EU: 0x2077680 - NA: 0x20772E8 - - name: GX_DisableBankForTex - address: - EU: 0x20776A4 - NA: 0x207730C - - name: GX_DisableBankForTexPltt - address: - EU: 0x20776B8 - NA: 0x2077320 - - name: GX_DisableBankForClearImage - address: - EU: 0x20776CC - NA: 0x2077334 - - name: GX_DisableBankForArm7 - address: - EU: 0x20776E0 - NA: 0x2077348 - - name: GX_DisableBankForLcdc - address: - EU: 0x20776F4 - NA: 0x207735C - - name: GX_DisableBankForSubBg - address: - EU: 0x2077708 - NA: 0x2077370 - - name: GX_DisableBankForSubObj - address: - EU: 0x207771C - NA: 0x2077384 - - name: GX_DisableBankForSubBgExtPltt - address: - EU: 0x2077730 - NA: 0x2077398 - - name: GX_DisableBankForSubObjExtPltt - address: - EU: 0x2077758 - NA: 0x20773C0 - - name: G2_GetBG0ScrPtr - address: - EU: 0x2077780 - NA: 0x20773E8 - - name: G2S_GetBG0ScrPtr - address: - EU: 0x20777B4 - NA: 0x207741C - - name: G2_GetBG1ScrPtr - address: - EU: 0x20777D4 - NA: 0x207743C - - name: G2S_GetBG1ScrPtr - address: - EU: 0x2077808 - NA: 0x2077470 - - name: G2_GetBG2ScrPtr - address: - EU: 0x2077828 - NA: 0x2077490 - - name: G2_GetBG3ScrPtr - address: - EU: 0x20778AC - NA: 0x2077514 - - name: G2_GetBG0CharPtr - address: - EU: 0x2077930 - NA: 0x2077598 - - name: G2S_GetBG0CharPtr - address: - EU: 0x2077964 - NA: 0x20775CC - - name: G2_GetBG1CharPtr - address: - EU: 0x2077984 - NA: 0x20775EC - - name: G2S_GetBG1CharPtr - address: - EU: 0x20779B8 - NA: 0x2077620 - - name: G2_GetBG2CharPtr - address: - EU: 0x20779D8 - NA: 0x2077640 - - name: G2_GetBG3CharPtr - address: - EU: 0x2077A28 - NA: 0x2077690 - - name: G2x_SetBlendAlpha - address: - EU: 0x2077A80 - NA: 0x20776E8 - - name: G2x_SetBlendBrightness - address: - EU: 0x2077A9C - NA: 0x2077704 - - name: G2x_ChangeBlendBrightness - address: - EU: 0x2077AC4 - NA: 0x207772C - - name: G3_LoadMtx44 - address: - EU: 0x2077B08 - NA: 0x2077770 - - name: G3_LoadMtx43 - address: - EU: 0x2077B24 - NA: 0x207778C - JP: 0x2077A74 - description: |- - Send the MTX_LOAD_4x3 geometry engine command, through a GXFIFO command. See https://problemkaputt.de/gbatek.htm#ds3dgeometrycommands and https://problemkaputt.de/gbatek.htm#ds3dmatrixloadmultiply for more information. - - This pops the top of the current matrix stack (https://problemkaputt.de/gbatek.htm#ds3dmatrixstack) and sets it as the engine's "current" matrix. It's commonly preceded by a MTX_PUSH command to populate the matrix stack with a matrix. - - r0: matrix_4x3 pointer - - name: G3_MultMtx43 - address: - EU: 0x2077B40 - NA: 0x20777A8 - JP: 0x2077A90 - description: |- - Send the MTX_MULT_4x3 geometry engine command, through a GXFIFO command. See https://problemkaputt.de/gbatek.htm#ds3dgeometrycommands and https://problemkaputt.de/gbatek.htm#ds3dmatrixloadmultiply for more information. - - This pops the top of the current matrix stack (https://problemkaputt.de/gbatek.htm#ds3dmatrixstack) and left-multiplies the engine's "current" matrix by the new matrix. It's commonly preceded by a MTX_PUSH command to populate the matrix stack with a matrix. - - r0: matrix_4x3 pointer - - name: G3X_Init - address: - EU: 0x2077B5C - NA: 0x20777C4 - - name: G3X_Reset - address: - EU: 0x2077C68 - NA: 0x20778D0 - - name: G3X_ClearFifo - address: - EU: 0x2077CD4 - NA: 0x207793C - - name: G3X_InitMtxStack - address: - EU: 0x2077CFC - NA: 0x2077964 - - name: G3X_ResetMtxStack - address: - EU: 0x2077D94 - NA: 0x20779FC - - name: G3X_SetClearColor - address: - EU: 0x2077E24 - NA: 0x2077A8C - - name: G3X_InitTable - address: - EU: 0x2077E4C - NA: 0x2077AB4 - - name: G3X_GetMtxStackLevelPV - address: - EU: 0x2077EEC - NA: 0x2077B54 - - name: G3X_GetMtxStackLevelPJ - address: - EU: 0x2077F1C - NA: 0x2077B84 - - name: GXi_NopClearFifo128 - address: - EU: 0x2077F4C - NA: 0x2077BB4 - - name: G3i_OrthoW - address: - EU: 0x2077FE0 - NA: 0x2077C48 - - name: G3i_LookAt - address: - EU: 0x2078044 - NA: 0x2077CAC - - name: GX_LoadBgPltt - address: - EU: 0x2078090 - NA: 0x2077CF8 - - name: Gxs_LoadBgPltt - address: - EU: 0x20780E4 - NA: 0x2077D4C - - name: GX_LoadObjPltt - address: - EU: 0x207813C - NA: 0x2077DA4 - - name: Gxs_LoadObjPltt - address: - EU: 0x2078194 - NA: 0x2077DFC - - name: GX_LoadOam - address: - EU: 0x20781EC - NA: 0x2077E54 - - name: Gxs_LoadOam - address: - EU: 0x2078240 - NA: 0x2077EA8 - - name: GX_LoadObj - address: - EU: 0x2078298 - NA: 0x2077F00 - - name: Gxs_LoadObj - address: - EU: 0x20782F0 - NA: 0x2077F58 - - name: GX_LoadBg0Scr - address: - EU: 0x2078348 - NA: 0x2077FB0 - - name: GX_LoadBg1Scr - address: - EU: 0x20783A8 - NA: 0x2078010 - - name: Gxs_LoadBg1Scr - address: - EU: 0x2078408 - NA: 0x2078070 - - name: GX_LoadBg2Scr - address: - EU: 0x2078468 - NA: 0x20780D0 - - name: GX_LoadBg3Scr - address: - EU: 0x20784C8 - NA: 0x2078130 - - name: GX_LoadBg0Char - address: - EU: 0x2078528 - NA: 0x2078190 - - name: Gxs_LoadBg0Char - address: - EU: 0x2078588 - NA: 0x20781F0 - - name: GX_LoadBg1Char - address: - EU: 0x20785E8 - NA: 0x2078250 - - name: Gxs_LoadBg1Char - address: - EU: 0x2078648 - NA: 0x20782B0 - - name: GX_LoadBg2Char - address: - EU: 0x20786A8 - NA: 0x2078310 - - name: GX_LoadBg3Char - address: - EU: 0x2078708 - NA: 0x2078370 - - name: GX_BeginLoadBgExtPltt - address: - EU: 0x2078768 - NA: 0x20783D0 - - name: GX_EndLoadBgExtPltt - address: - EU: 0x2078808 - NA: 0x2078470 - - name: GX_BeginLoadObjExtPltt - address: - EU: 0x2078850 - NA: 0x20784B8 - - name: GX_EndLoadObjExtPltt - address: - EU: 0x2078898 - NA: 0x2078500 - - name: Gxs_BeginLoadBgExtPltt - address: - EU: 0x20788DC - NA: 0x2078544 - - name: Gxs_EndLoadBgExtPltt - address: - EU: 0x20788F4 - NA: 0x207855C - - name: Gxs_BeginLoadObjExtPltt - address: - EU: 0x2078934 - NA: 0x207859C - - name: Gxs_EndLoadObjExtPltt - address: - EU: 0x207894C - NA: 0x20785B4 - - name: GX_BeginLoadTex - address: - EU: 0x207898C - NA: 0x20785F4 - - name: GX_LoadTex - address: - EU: 0x20789E8 - NA: 0x2078650 - - name: GX_EndLoadTex - address: - EU: 0x2078B28 - NA: 0x2078790 - - name: GX_BeginLoadTexPltt - address: - EU: 0x2078B74 - NA: 0x20787DC - - name: GX_LoadTexPltt - address: - EU: 0x2078BA8 - NA: 0x2078810 - - name: GX_EndLoadTexPltt - address: - EU: 0x2078C14 - NA: 0x207887C - - name: GeomGxFifoSendMtx4x3 - address: - EU: 0x2078C58 - NA: 0x20788C0 - JP: 0x2078BA8 - description: |- - Send a 4x3 matrix argument for a GXFIFO geometry engine command. - - This function is used by GeomMtxLoad4x3 and GeomMtxMult4x3 to pass the matrix argument for a GXFIFO command after already having written the command code. See https://problemkaputt.de/gbatek.htm#ds3dgeometrycommands for more information. - - Note that the GXFIFO address is 0x4000400, but is (maybe) mirrored up to 0x400043F. This function is optimized to take advantage of this by writing 3 matrix entries at a time using ldmia and stmia instructions. - - r0: matrix_4x3 pointer - r1: GXFIFO pointer - - name: GX_SendFifo64B - address: - EU: 0x2078C7C - NA: 0x20788E4 - - name: OS_GetLockID - address: - EU: 0x20793C4 - NA: 0x207902C - - name: IncrementThreadCount - address: - EU: 0x20794E8 - NA: 0x2079150 - JP: 0x2079438 - description: |- - Increments thread_info::thread_count by 1 and returns the new value. - - return: New thread count - - name: InsertThreadIntoList - address: - EU: 0x2079630 - NA: 0x2079298 - JP: 0x2079580 - description: |- - Inserts a new thread into the linked thread list (see thread_info::thread_list_head). - - The thread is inserted in sorted order. - - r0: Thread to insert - - name: StartThread - address: - EU: 0x20798F8 - NA: 0x2079560 - JP: 0x2079848 - description: |- - Called to start a new thread. - - Initializes the specified thread struct and some values on its stack area. - - r0: Struct of the thread to init - r1: Pointer to the function to run on this thread - r2: Pointer to a thread struct. Sometimes equal to r0. Sometimes null. - r3: Pointer to the stack area for this thread. Not all the space is usable. See thread::usable_stack_pointer for more info. - stack[0]: Stack size - stack[1]: (?) Used to sort threads on a list - - name: ThreadExit - address: - EU: 0x20799F4 - NA: 0x207965C - JP: 0x2079944 - description: |- - Function called by threads on exit. - - Base functions that contain an infinite loop that is not supposed to return and that have their stacks in main RAM have this function as their return address. - - No params. - - name: SetThreadField0xB4 - address: - EU: 0x207A014 - NA: 0x2079C7C - JP: 0x2079F64 - description: |- - Sets the given thread's field_0xB4 to the specified value. - - r0: Thread - r1: Value to set - - name: InitThread - address: - EU: 0x207A01C - NA: 0x2079C84 - JP: 0x2079F6C - description: |- - Initializes some fields of the given thread struct. - - Most notably, thread::flags, thread::function_address_plus_4, thread::stack_pointer_minus_4 and thread::usable_stack_pointer. Also initializes a few more fields with a value of 0. - thread::flags is initialized to 0x1F, unless the address of the function is odd (???), in which case it's initialized to 0x3F. - - r0: Pointer to the thread to initialize - r1: Pointer to the function the thread will run - r2: Pointer to the start of the thread's stack area - 4 - - name: GetTimer0Control - address: - EU: 0x207B27C - NA: 0x207AEE4 - JP: 0x207B1CC - description: |- - Returns the value of the control register for hardware timer 0 - - return: Value of the control register - - name: ClearIrqFlag - address: - EU: 0x207BB68 - NA: 0x207B7D0 - JP: 0x207BAB8 - description: |- - Enables processor interrupts by clearing the i flag in the program status register (cpsr). - - return: Old value of cpsr & 0x80 (0x80 if interrupts were disabled, 0x0 if they were already enabled) - - name: EnableIrqFlag - address: - EU: 0x207BB7C - NA: 0x207B7E4 - JP: 0x207BACC - description: |- - Disables processor interrupts by setting the i flag in the program status register (cpsr). - - return: Old value of cpsr & 0x80 (0x80 if interrupts were already disabled, 0x0 if they were enabled) - - name: SetIrqFlag - address: - EU: 0x207BB90 - NA: 0x207B7F8 - JP: 0x207BAE0 - description: |- - Sets the value of the processor's interrupt flag according to the specified parameter. - - r0: Value to set the flag to (0x80 to set it, which disables interrupts; 0x0 to unset it, which enables interrupts) - return: Old value of cpsr & 0x80 (0x80 if interrupts were disabled, 0x0 if they were enabled) - - name: EnableIrqFiqFlags - address: - EU: 0x207BBA8 - NA: 0x207B810 - JP: 0x207BAF8 - description: |- - Disables processor all interrupts (both standard and fast) by setting the i and f flags in the program status register (cpsr). - - return: Old value of cpsr & 0xC0 (contains the previous values of the i and f flags) - - name: SetIrqFiqFlags - address: - EU: 0x207BBBC - NA: 0x207B824 - JP: 0x207BB0C - description: |- - Sets the value of the processor's interrupt flags (i and f) according to the specified parameter. - - r0: Value to set the flags to (0xC0 to set both flags, 0x80 to set the i flag and clear the f flag, 0x40 to set the f flag and clear the i flag and 0x0 to clear both flags) - return: Old value of cpsr & 0xC0 (contains the previous values of the i and f flags) - - name: GetIrqFlag - address: - EU: 0x207BBD4 - NA: 0x207B83C - JP: 0x207BB24 - description: |- - Gets the current value of the processor's interrupt request (i) flag - - return: cpsr & 0x80 (0x80 if interrupts are disabled, 0x0 if they are enabled) - - name: GetProcessorMode - address: - EU: 0x207BBE0 - NA: 0x207B848 - JP: 0x207BB30 - description: |- - Gets the processor's current operating mode. - - See https://problemkaputt.de/gbatek.htm#armcpuflagsconditionfieldcond - - return: cpsr & 0x1f (the cpsr mode bits M4-M0) - - name: CountLeadingZeros - address: - EU: 0x207BE24 - NA: 0x207BA8C - description: |- - Counts the number of leading zeros in a 32-bit integer. - - r0: x - return: clz(x) - - name: WaitForever2 - address: - EU: 0x207BFB8 - NA: 0x207BC20 - JP: 0x207BF08 - description: |- - Calls EnableIrqFlag and WaitForInterrupt in an infinite loop. - - This is called on fatal errors to hang the program indefinitely. - - No params. - - name: WaitForInterrupt - address: - EU: 0x207BFC8 - NA: 0x207BC30 - JP: 0x207BF18 - description: |- - Presumably blocks until the program receives an interrupt. - - This just calls (in Ghidra terminology) coproc_moveto_Wait_for_interrupt(0). See https://en.wikipedia.org/wiki/ARM_architecture_family#Coprocessors. - - No params. - - name: ArrayFill16 - address: - EU: 0x207C650 - NA: 0x207C2B8 - JP: 0x207C5A0 - description: |- - Fills an array of 16-bit values with a given value. - - r0: value - r1: ptr - r2: len (# bytes) - - name: ArrayCopy16 - address: - EU: 0x207C678 - NA: 0x207C2E0 - JP: 0x207C5C8 - description: |- - Copies an array of 16-bit values to another array of 16-bit values. - - This is essentially an alternate implementation of Memcpy16, but with a different parameter order. - - r0: src - r1: dest - r2: len (# bytes) - - name: ArrayFill32 - address: - EU: 0x207C6AC - NA: 0x207C314 - JP: 0x207C5FC - description: |- - Fills an array of 32-bit values with a given value. - - This is essentially an alternate implementation of Memset32, but with a different parameter order. - - r0: value - r1: ptr - r2: len (# bytes) - - name: ArrayCopy32 - address: - EU: 0x207C6C8 - NA: 0x207C330 - JP: 0x207C618 - description: |- - Copies an array of 32-bit values to another array of 32-bit values. - - This is essentially an alternate implementation of Memcpy32, but with a different parameter order. - - r0: src - r1: dest - r2: len (# bytes) - - name: ArrayFill32Fast - address: - EU: 0x207C6F0 - NA: 0x207C358 - JP: 0x207C640 - description: |- - Does the same thing as ArrayFill32, except the implementation uses an unrolled loop that sets 8 values per iteration, taking advantage of the stmia instruction. - - r0: value - r1: ptr - r2: len (# bytes) - - name: ArrayCopy32Fast - address: - EU: 0x207C74C - NA: 0x207C3B4 - JP: 0x207C69C - description: |- - Does the same thing as ArrayCopy32, except the implementation uses an unrolled loop that copies 8 values per iteration, taking advantage of the ldmia/stmia instructions. - - r0: src - r1: dest - r2: len (# bytes) - - name: MemsetFast - address: - EU: 0x207C7A4 - NA: 0x207C40C - JP: 0x207C6F4 - description: |- - A semi-optimized implementation of the memset(3) C library function. - - This function was probably manually implemented by the developers, or was included as part of a library other than libc (the Nitro SDK probably?). See memset for what's probably the real libc function. - - This function is optimized to set values in 4-byte chunks, properly dealing with pointer alignment. However, unlike the libc memset, there are no loop unrolling optimizations. - - r0: ptr - r1: value - r2: len (# bytes) - - name: MemcpyFast - address: - EU: 0x207C860 - NA: 0x207C4C8 - JP: 0x207C7B0 - description: |- - Copies bytes from one buffer to another, similar to memcpy(3). Note that the source/destination buffer parameters swapped relative to the standard memcpy. - - This function was probably manually implemented by the developers, or was included as part of a library other than libc (the Nitro SDK probably?). See memcpy for what's probably the real libc function. - - This function is optimized to copy values in 4-byte chunks, properly dealing with pointer alignment. - - r0: src - r1: dest - r2: n (# bytes) - - name: AtomicExchange - address: - EU: 0x207C9E0 - NA: 0x207C648 - JP: 0x207C930 - description: |- - Atomically replaces a pointer's pointee with a desired value, and returns the previous value. - - This function is just a single swp instruction. - - r0: desired value - r1: ptr - return: previous value - - name: FileInit - address: - EU: 0x207F77C - NA: 0x207F3E4 - JP: 0x207F6CC - description: |- - Initializes a file_stream structure for file I/O. - - This function must always be called before opening a file. - - r0: file_stream pointer - - name: GetOverlayInfo - address: - EU: 0x2080034 - NA: 0x207FC9C - JP: 0x207FF84 - description: |- - Returns the y9.bin entry for the specified overlay - - r0: [output] Overlay info struct - r1: ? - r2: Overlay ID - return: True if the entry could be loaded successfully? - - name: LoadOverlayInternal - address: - EU: 0x2080130 - NA: 0x207FD98 - JP: 0x2080080 - description: |- - Called by LoadOverlay to load an overlay into RAM given its info struct - - r0: Overlay info struct - Return: True if the overlay was loaded successfully? - - name: InitOverlay - address: - EU: 0x2080254 - NA: 0x207FEBC - JP: 0x20801A4 - description: |- - Performs overlay initialization right after loading an overlay with LoadOverlayInternal. - - This function is responsible for jumping to all the pointers located in the overlay's static init array, among other things. - - r0: Overlay info struct - - name: abs - address: - EU: 0x20868F4 - NA: 0x208655C - JP: 0x2086844 - description: |- - Takes the absolute value of an integer. - - r0: x - return: abs(x) - - name: mbtowc - address: - EU: 0x2087554 - NA: 0x20871BC - JP: 0x20874A4 - description: |- - The mbtowc(3) C library function. - - r0: pwc - r1: s - r2: n - return: number of consumed bytes, or -1 on failure - - name: TryAssignByte - address: - EU: 0x208758C - NA: 0x20871F4 - JP: 0x20874DC - description: |- - Assign a byte to the target of a pointer if the pointer is non-null. - - r0: pointer - r1: value - return: true on success, false on failure - - name: TryAssignByteWrapper - address: - EU: 0x20875A0 - NA: 0x2087208 - JP: 0x20874F0 - description: |- - Wrapper around TryAssignByte. - - Accesses the TryAssignByte function with a weird chain of pointer dereferences. - - r0: pointer - r1: value - return: true on success, false on failure - - name: wcstombs - address: - EU: 0x20875BC - NA: 0x2087224 - JP: 0x208750C - description: |- - The wcstombs(3) C library function. - - r0: dest - r1: src - r2: n - return: characters converted - - name: memcpy - address: - EU: 0x2087634 - NA: 0x208729C - JP: 0x2087584 - description: |- - The memcpy(3) C library function. - - r0: dest - r1: src - r2: n - return: dest - - name: memmove - address: - EU: 0x2087654 - NA: 0x20872BC - JP: 0x20875A4 - description: |- - The memmove(3) C library function. - - The implementation is nearly the same as memcpy, but it copies bytes from back to front if src < dst. - - r0: dest - r1: src - r2: n - return: dest - - name: memset - address: - EU: 0x20876A0 - NA: 0x2087308 - JP: 0x20875F0 - description: |- - The memset(3) C library function. - - This is just a wrapper around memset_internal that returns the pointer at the end. - - r0: s - r1: c (int, but must be a single-byte value) - r2: n - return: s - - name: memchr - address: - EU: 0x20876B4 - NA: 0x208731C - JP: 0x2087604 - description: |- - The memchr(3) C library function. - - r0: s - r1: c - r2: n - return: pointer to first occurrence of c in s, or a null pointer if no match - - name: memcmp - address: - EU: 0x20876E0 - NA: 0x2087348 - JP: 0x2087630 - description: |- - The memcmp(3) C library function. - - r0: s1 - r1: s2 - r2: n - return: comparison value - - name: memset_internal - address: - EU: 0x2087720 - NA: 0x2087388 - JP: 0x2087670 - description: |- - The actual memory-setting implementation for the memset(3) C library function. - - This function is optimized to set bytes in 4-byte chunks for n >= 32, correctly handling any unaligned bytes at the front/back. In this case, it also further optimizes by unrolling a for loop to set 8 4-byte values at once (effectively a 32-byte chunk). - - r0: s - r1: c (int, but must be a single-byte value) - r2: n - - name: __vsprintf_internal_slice - address: - EU: 0x208900C - NA: 0x2088C74 - JP: 0x2088F5C - description: |- - This is what implements the bulk of __vsprintf_internal. - - The __vsprintf_internal in the modern-day version of glibc relies on __vfprintf_internal; this function has a slightly different interface, but it serves a similar role. - - r0: function pointer to append to the string being built (__vsprintf_internal uses TryAppendToSlice) - r1: string buffer slice - r2: format - r3: ap - return: number of characters printed, excluding the null-terminator - - name: TryAppendToSlice - address: - EU: 0x2089830 - NA: 0x2089498 - JP: 0x2089780 - description: |- - Best-effort append the given data to a slice. If the slice's capacity is reached, any remaining data will be truncated. - - r0: slice pointer - r1: buffer of data to append - r2: number of bytes in the data buffer - return: true - - name: __vsprintf_internal - address: - EU: 0x2089874 - NA: 0x20894DC - JP: 0x20897C4 - description: |- - This is what implements vsprintf. It's akin to __vsprintf_internal in the modern-day version of glibc (in fact, it's probably an older version of this). - - r0: str - r1: maxlen (vsprintf passes UINT32_MAX for this) - r2: format - r3: ap - return: number of characters printed, excluding the null-terminator - - name: vsprintf - address: - EU: 0x20898DC - NA: 0x2089544 - JP: 0x208982C - description: |- - The vsprintf(3) C library function. - - r0: str - r1: format - r2: ap - return: number of characters printed, excluding the null-terminator - - name: snprintf - address: - EU: 0x20898F4 - NA: 0x208955C - JP: 0x2089844 - description: |- - The snprintf(3) C library function. - - This calls __vsprintf_internal directly, so it's presumably the real snprintf. - - r0: str - r1: n - r2: format - ...: variadic - return: number of characters printed, excluding the null-terminator - - name: sprintf - address: - EU: 0x208991C - NA: 0x2089584 - JP: 0x208986C - description: |- - The sprintf(3) C library function. - - This calls __vsprintf_internal directly, so it's presumably the real sprintf. - - r0: str - r1: format - ...: variadic - return: number of characters printed, excluding the null-terminator - - name: strlen - address: - EU: 0x2089A10 - NA: 0x2089678 - JP: 0x2089960 - description: |- - The strlen(3) C library function. - - r0: s - return: length of s - - name: strcpy - address: - EU: 0x2089A2C - NA: 0x2089694 - JP: 0x208997C - description: |- - The strcpy(3) C library function. - - This function is optimized to copy characters in aligned 4-byte chunks if possible, correctly handling any unaligned bytes at the front/back. - - r0: dest - r1: src - return: dest - - name: strncpy - address: - EU: 0x2089AF4 - NA: 0x208975C - JP: 0x2089A44 - description: |- - The strncpy(3) C library function. - - r0: dest - r1: src - r2: n - return: dest - - name: strcat - address: - EU: 0x2089B44 - NA: 0x20897AC - JP: 0x2089A94 - description: |- - The strcat(3) C library function. - - r0: dest - r1: src - return: dest - - name: strncat - address: - EU: 0x2089B74 - NA: 0x20897DC - JP: 0x2089AC4 - description: |- - The strncat(3) C library function. - - r0: dest - r1: src - r2: n - return: dest - - name: strcmp - address: - EU: 0x2089BC4 - NA: 0x208982C - JP: 0x2089B14 - description: |- - The strcmp(3) C library function. - - Similarly to strcpy, this function is optimized to compare characters in aligned 4-byte chunks if possible. - - r0: s1 - r1: s2 - return: comparison value - - name: strncmp - address: - EU: 0x2089CD8 - NA: 0x2089940 - JP: 0x2089C28 - description: |- - The strncmp(3) C library function. - - r0: s1 - r1: s2 - r2: n - return: comparison value - - name: strchr - address: - EU: 0x2089D0C - NA: 0x2089974 - JP: 0x2089C5C - description: |- - The strchr(3) C library function. - - r0: string - r1: c - return: pointer to the located byte c, or null pointer if no match - - name: strcspn - address: - EU: 0x2089D48 - NA: 0x20899B0 - JP: 0x2089C98 - description: |- - The strcspn(3) C library function. - - r0: string - r1: stopset - return: offset of the first character in string within stopset - - name: strstr - address: - EU: 0x2089E08 - NA: 0x2089A70 - JP: 0x2089D58 - description: |- - The strstr(3) C library function. - - r0: haystack - r1: needle - return: pointer into haystack where needle starts, or null pointer if no match - - name: wcslen - address: - EU: 0x208B780 - NA: 0x208B3E8 - JP: 0x208B6D0 - description: |- - The wcslen(3) C library function. - - r0: ws - return: length of ws - - name: _dadd - address: - EU: 0x208E260 - NA: 0x208DEC8 - description: |- - Implements the addition operator for IEEE 754 double-precision floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a + b - - name: _d2f - address: - EU: 0x208E578 - NA: 0x208E1E0 - description: |- - Implements the double to float cast operator for IEEE 754 floating-point numbers. - - r0: double (low bits) - r1: double (high bits) - return: (float)double - - name: _ll_ufrom_d - address: - EU: 0x208E67C - NA: 0x208E2E4 - description: |- - Implements the double to unsigned long long cast operation for IEEE 754 floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: double (low bits) - r1: double (high bits) - return: (unsigned long long)double - - name: _dflt - address: - EU: 0x208E708 - NA: 0x208E370 - description: |- - Implements the int to double cast operation for IEEE 754 floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: int - return: (double)int - - name: _dfltu - address: - EU: 0x208E748 - NA: 0x208E3B0 - description: |- - Implements the unsigned int to double cast operation for IEEE 754 floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: uint - return: (double)uint - - name: _dmul - address: - EU: 0x208E784 - NA: 0x208E3EC - description: |- - Implements the multiplication operator for IEEE 754 double-precision floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a * b - - name: _dsqrt - address: - EU: 0x208EAE8 - NA: 0x208E750 - description: |- - Analogous to the sqrt(3) C library function. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: x (low bits) - r1: x (high bits) - return: sqrt(x) - - name: _dsub - address: - EU: 0x208EC9C - NA: 0x208E904 - description: |- - Implements the subtraction operator for IEEE 754 double-precision floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a - b - - name: _fadd - address: - EU: 0x208F050 - NA: 0x208ECB8 - JP: 0x208EFA0 - description: |- - Implements the addition operator for IEEE 754 floating-point numbers. - - Analogous to __addsf3 in libgcc. - - r0: a - r1: b - return: a + b - - name: _dgeq - address: - EU: 0x208F274 - NA: 0x208EEDC - description: |- - Implements the >= operator for IEEE 754 double-precision floating-point numbers. - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a >= b - - name: _dleq - address: - EU: 0x208F30C - NA: 0x208EF74 - description: |- - Implements the <= operator for IEEE 754 double-precision floating-point numbers. - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a <= b - - name: _dls - address: - EU: 0x208F3B0 - NA: 0x208F018 - description: |- - Implements the < operator for IEEE 754 double-precision floating-point numbers. - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a < b - - name: _deq - address: - EU: 0x208F44C - NA: 0x208F0B4 - description: |- - Implements the == operator for IEEE 754 double-precision floating-point numbers. - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a == b - - name: _dneq - address: - EU: 0x208F4D8 - NA: 0x208F140 - description: |- - Implements the != operator for IEEE 754 double-precision floating-point numbers. - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a != b - - name: _fls - address: - EU: 0x208F564 - NA: 0x208F1CC - description: |- - Implements the < operator for IEEE 754 floating-point numbers. - - r0: a - r1: b - return: a < b - - name: _fdiv - address: - EU: 0x208F5CC - NA: 0x208F234 - JP: 0x208F51C - description: |- - Implements the division operator for IEEE 754 floating-point numbers. - - Analogous to __divsf3 in libgcc. - - r0: dividend - r1: divisor - return: dividend / divisor - - name: _f2d - address: - EU: 0x208F984 - NA: 0x208F5EC - JP: 0x208F8D4 - description: |- - Implements the float to double cast operation for IEEE 754 floating-point numbers. - - Analogous to __extendsfdf2 in libgcc. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: float - return: (double)float - - name: _ffix - address: - EU: 0x208FA08 - NA: 0x208F670 - JP: 0x208F958 - description: |- - Implements the float to int cast operation for IEEE 754 floating-point numbers. The output saturates if the input is out of the representable range for the int type. - - Analogous to __fixsfsi in libgcc. - - r0: float - return: (int)float - - name: _fflt - address: - EU: 0x208FA3C - NA: 0x208F6A4 - JP: 0x208F98C - description: |- - Implements the int to float cast operation for IEEE 754 floating-point numbers. - - Analogous to __floatsisf in libgcc. - - r0: int - return: (float)int - - name: _ffltu - address: - EU: 0x208FA84 - NA: 0x208F6EC - JP: 0x208F9D4 - description: |- - Implements the unsigned int to float cast operation for IEEE 754 floating-point numbers. - - Analogous to __floatunsisf in libgcc. - - r0: uint - return: (float)uint - - name: _fmul - address: - EU: 0x208FACC - NA: 0x208F734 - JP: 0x208FA1C - description: |- - Implements the multiplication operator for IEEE 754 floating-point numbers. - - Analogous to __mulsf3 in libgcc. - - r0: a - r1: b - return: a * b - - name: sqrtf - address: - EU: 0x208FCAC - NA: 0x208F914 - JP: 0x208FBFC - description: |- - The sqrtf(3) C library function. - - r0: x - return: sqrt(x) - - name: _fsub - address: - EU: 0x208FD9C - NA: 0x208FA04 - JP: 0x208FCEC - description: |- - Implements the subtraction operator for IEEE 754 floating-point numbers. - - Analogous to __subsf3 in libgcc. - - r0: a - r1: b - return: a - b - - name: _ll_mod - address: - EU: 0x2090014 - NA: 0x208FC7C - description: |- - Implements the modulus operator for signed long longs. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: dividend (low bits) - r1: dividend (high bits) - r2: divisor (low bits) - r3: divisor (high bits) - return: dividend % divisor - - name: _ll_sdiv - address: - EU: 0x2090024 - NA: 0x208FC8C - description: |- - Implements the division operator for signed long longs. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: dividend (low bits) - r1: dividend (high bits) - r2: divisor (low bits) - r3: divisor (high bits) - return: dividend / divisor - - name: _ll_udiv - address: - EU: 0x20901D4 - NA: 0x208FE3C - description: |- - Implements the division operator for unsigned long longs. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: dividend (low bits) - r1: dividend (high bits) - r2: divisor (low bits) - r3: divisor (high bits) - return: dividend / divisor - - name: _ull_mod - address: - EU: 0x20901E0 - NA: 0x208FE48 - description: |- - Implements the modulus operator for unsigned long longs. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: dividend (low bits) - r1: dividend (high bits) - r2: divisor (low bits) - r3: divisor (high bits) - return: dividend % divisor - - name: _ll_mul - address: - EU: 0x209021C - NA: 0x208FE84 - description: |- - Implements the multiplication operator for signed long longs. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: a (low bits) - r1: a (high bits) - r2: b (low bits) - r3: b (high bits) - return: a * b - - name: _s32_div_f - address: - EU: 0x209023C - NA: 0x208FEA4 - JP: 0x209018C - description: |- - Implements the division operator for signed ints. - - Analogous to __divsi3 in libgcc. - - The return value is a 64-bit integer, with the quotient (dividend / divisor) in the lower 32 bits and the remainder (dividend % divisor) in the upper 32 bits. In accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return), this means that the quotient is returned in r0 and the remainder is returned in r1. - - r0: dividend - r1: divisor - return: (quotient) | (remainder << 32) - - name: _u32_div_f - address: - EU: 0x2090448 - NA: 0x20900B0 - JP: 0x2090398 - description: |- - Implements the division operator for unsigned ints. - - Analogous to __udivsi3 in libgcc. - - The return value is a 64-bit integer, with the quotient (dividend / divisor) in the lower 32 bits and the remainder (dividend % divisor) in the upper 32 bits. In accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return), this means that the quotient is returned in r0 and the remainder is returned in r1. - Note: This function falls through to _u32_div_not_0_f. - - r0: dividend - r1: divisor - return: (quotient) | (remainder << 32) - - name: _u32_div_not_0_f - address: - EU: 0x2090450 - NA: 0x20900B8 - JP: 0x20903A0 - description: |- - Subsidiary function to _u32_div_f. Skips the initial check for divisor == 0. - - The return value is a 64-bit integer, with the quotient (dividend / divisor) in the lower 32 bits and the remainder (dividend % divisor) in the upper 32 bits. In accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return), this means that the quotient is returned in r0 and the remainder is returned in r1. - This function appears to only be called internally. - - r0: dividend - r1: divisor - return: (quotient) | (remainder << 32) - - name: _drdiv - address: - EU: 0x209062C - NA: 0x2090294 - description: |- - The same as _ddiv, but with the parameters reversed. - - This simply swaps the first and second parameters, then falls through to _ddiv. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: divisor (low bits) - r1: divisor (high bits) - r2: dividend (low bits) - r3: dividend (high bits) - return: dividend / divisor - - name: _ddiv - address: - EU: 0x2090644 - NA: 0x20902AC - description: |- - Implements the division operator for IEEE 754 double-precision floating-point numbers. - - The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). - - r0: dividend (low bits) - r1: dividend (high bits) - r2: divisor (low bits) - r3: divisor (high bits) - return: dividend / divisor - - name: _fp_init - address: - EU: 0x2090B88 - NA: 0x20907F0 - description: |- - Meant to do set up for floating point calculations? Does nothing. - - No params. data: - name: SECURE address: diff --git a/symbols/arm9/libs.yml b/symbols/arm9/libs.yml new file mode 100644 index 00000000..97a73649 --- /dev/null +++ b/symbols/arm9/libs.yml @@ -0,0 +1,1898 @@ +libs: + versions: + - EU + - NA + - JP + address: + EU: 0x206C470 + NA: 0x206C0D8 + JP: 0x206C3C0 + length: + EU: 0x247FC + NA: 0x247FC + JP: 0x247FC + description: |- + System libraries linked to the main ARM9 binary. + + This includes code from common NDS system libraries like the Nitro SDK (which contains NDS-specific functionality as well as utilities akin to libc and libgcc). + + Where the library region starts and ends is a guess, but there appear to be fairly sharp boundaries. The function directly before it calls functions at lower memory addresses outside of the region, while all functions in the region only call other functions within the region. The bytes after the region seem to be the start of a global data region, used by both the libraries and the rest of ARM9. + functions: + - name: SoundUtilGetRandomNumber + address: + EU: 0x206CC8C + NA: 0x206C8F4 + description: "return: random number in the range [0, 32767]" + - name: ReadWaviEntry + address: + EU: 0x206D8F0 + NA: 0x206D558 + JP: 0x206D840 + description: |- + Reads an entry from the pointer table of a wavi container and returns a pointer to the data of said entry, which contains information about a particular sample. + + r0: Wavi data struct + r1: Entry index + retrun: Pointer to the entry's data + - name: ResumeBgm + address: + EU: 0x206DD54 + NA: 0x206D9BC + JP: 0x206DCA4 + description: |- + Uncertain. + + Note: unverified, ported from Irdkwia's notes + - name: FindSmdlSongChunk + address: + EU: 0x206E880 + NA: 0x206E4E8 + JP: 0x206E7D0 + description: |- + Finds the first song chunk within an SMDL file that has the specified value on its 0x10 field. + + See https://projectpokemon.org/home/docs/mystery-dungeon-nds/dse-smdl-format-r13/. + + r0: Pointer to the start of the SMDL file + r1: Value to search for + return: Pointer to the first chunk that has the specified value + 0x10, or null if no chunk was found. + - name: FlushChannels + address: + EU: 0x2070A0C + NA: 0x2070674 + JP: 0x207095C + description: "Note: unverified, ported from Irdkwia's notes" + - name: ParseDseEvent + address: + EU: 0x20715BC + NA: 0x2071224 + JP: 0x207150C + description: |- + Parses and executes a DSE event for the specified track, if necessary. + + The function checks the time left before the next event (track_data::event_delay), and parses it if said time is 0. + + See also https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/ + + r0: Pointer to some struct that seems to hold the state of the audio engine + r1: Pointer to track data + - name: UpdateSequencerTracks + address: + EU: 0x2071780 + NA: 0x20713E8 + JP: 0x20716D0 + description: "From https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/" + - name: UpdateChannels + address: + EU: 0x2074824 + NA: 0x207448C + JP: 0x2074774 + description: |- + From https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/ and Irdkwia's notes. + + No params. + - name: SoundEnvelopeReset + address: + EU: 0x2075008 + NA: 0x2074C70 + description: "r0: Sound envelope pointer" + - name: SoundEnvelopeParametersReset + address: + EU: 0x207501C + NA: 0x2074C84 + description: "r0: Sound envelope parameters pointer" + - name: SoundEnvelopeParametersCheckValidity + address: + EU: 0x2075038 + NA: 0x2074CA0 + description: "r0: Sound envelope parameters pointer" + - name: SoundEnvelopeSetParameters + address: + EU: 0x207508C + NA: 0x2074CF4 + description: |- + r0: Sound envelope pointer + r1: Sound envelope parameters pointer + - name: SoundEnvelopeSetSlide + address: + EU: 0x20750F0 + NA: 0x2074D58 + description: |- + r0: Sound envelope pointer + r1: Target volume + r2: Music duration lookup table index + - name: UpdateTrackVolumeEnvelopes + address: + EU: 0x20751A4 + NA: 0x2074E0C + JP: 0x20750F4 + description: |- + From https://projectpokemon.org/docs/mystery-dungeon-nds/procyon-studios-digital-sound-elements-r12/ + + r0: Sound envelope pointer + - name: SoundEnvelopeRelease + address: + EU: 0x2075270 + NA: 0x2074ED8 + description: "r0: Sound envelope pointer" + - name: SoundEnvelopeStop + address: + EU: 0x207529C + NA: 0x2074F04 + description: "r0: Sound envelope pointer" + - name: SoundEnvelopeForceVolume + address: + EU: 0x20752B4 + NA: 0x2074F1C + description: |- + r0: Sound envelope pointer + r1: Volume + - name: SoundEnvelopeStop2 + address: + EU: 0x20752D4 + NA: 0x2074F3C + description: "r0: Sound envelope pointer" + - name: SoundEnvelopeTick + address: + EU: 0x20752EC + NA: 0x2074F54 + description: |- + r0: Sound envelope pointer + return: Current volume + - name: SoundLfoBankReset + address: + EU: 0x2075434 + NA: 0x207509C + description: "r0: LFO bank pointer" + - name: SoundLfoBankSet + address: + EU: 0x207544C + NA: 0x20750B4 + description: |- + r0: LFO bank pointer + r1: LFO settings pointer + r2: Envelope level + - name: SoundLfoBankSetConstEnvelopes + address: + EU: 0x2075644 + NA: 0x20752AC + description: |- + r0: LFO bank pointer + r1: Level + - name: SoundLfoBankTick + address: + EU: 0x2075690 + NA: 0x20752F8 + description: |- + r0: LFO bank pointer + return: New voice update flags + - name: SoundLfoWaveInvalidFunc + address: + EU: 0x2075744 + NA: 0x20753AC + description: |- + r0: LFO pointer + return: 0 + - name: SoundLfoWaveHalfSquareFunc + address: + EU: 0x2075758 + NA: 0x20753C0 + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveFullSquareFunc + address: + EU: 0x2075794 + NA: 0x20753FC + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveHalfTriangleFunc + address: + EU: 0x20757DC + NA: 0x2075444 + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveFullTriangleFunc + address: + EU: 0x2075830 + NA: 0x2075498 + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveSawFunc + address: + EU: 0x2075894 + NA: 0x20754FC + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveReverseSawFunc + address: + EU: 0x20758D0 + NA: 0x2075538 + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveHalfNoiseFunc + address: + EU: 0x207590C + NA: 0x2075574 + description: |- + r0: LFO pointer + return: LFO current output + - name: SoundLfoWaveFullNoiseFunc + address: + EU: 0x2075950 + NA: 0x20755B8 + description: |- + r0: LFO pointer + return: LFO current output + - name: Crypto_RC4Init + address: + EU: 0x2075AB8 + NA: 0x2075720 + - name: Mtx_LookAt + address: + EU: 0x2075BC0 + NA: 0x2075828 + - name: Mtx_OrthoW + address: + EU: 0x2075CC8 + NA: 0x2075930 + - name: FX_Div + address: + EU: 0x2075ED0 + NA: 0x2075B38 + - name: FX_GetDivResultFx64c + address: + EU: 0x2075EE0 + NA: 0x2075B48 + - name: FX_GetDivResult + address: + EU: 0x2075F04 + NA: 0x2075B6C + - name: FX_InvAsync + address: + EU: 0x2075F3C + NA: 0x2075BA4 + - name: FX_DivAsync + address: + EU: 0x2075F6C + NA: 0x2075BD4 + - name: FX_DivS32 + address: + EU: 0x2075F94 + NA: 0x2075BFC + - name: FX_ModS32 + address: + EU: 0x2075FD0 + NA: 0x2075C38 + - name: Vec_DotProduct + address: + EU: 0x207600C + NA: 0x2075C74 + - name: Vec_CrossProduct + address: + EU: 0x2076048 + NA: 0x2075CB0 + - name: Vec_Normalize + address: + EU: 0x20760CC + NA: 0x2075D34 + - name: Vec_Distance + address: + EU: 0x20761E4 + NA: 0x2075E4C + - name: FX_Atan2Idx + address: + EU: 0x2076260 + NA: 0x2075EC8 + - name: GX_Init + address: + EU: 0x207640C + NA: 0x2076074 + - name: GX_HBlankIntr + address: + EU: 0x2076558 + NA: 0x20761C0 + - name: GX_VBlankIntr + address: + EU: 0x2076580 + NA: 0x20761E8 + - name: GX_DispOff + address: + EU: 0x20765B4 + NA: 0x207621C + - name: GX_DispOn + address: + EU: 0x20765F0 + NA: 0x2076258 + - name: GX_SetGraphicsMode + address: + EU: 0x2076638 + NA: 0x20762A0 + - name: Gxs_SetGraphicsMode + address: + EU: 0x20766A0 + NA: 0x2076308 + - name: GXx_SetMasterBrightness + address: + EU: 0x20766BC + NA: 0x2076324 + - name: GX_InitGxState + address: + EU: 0x20766E4 + NA: 0x207634C + - name: EnableVramBanksInSetDontSave + address: + EU: 0x2076744 + NA: 0x20763AC + JP: 0x2076694 + description: |- + Enable the VRAM bank marked in the input set, but don’t mark them as enabled in ENABLED_VRAM_BANKS + + r0: vram_banks_set + - name: GX_SetBankForBg + address: + EU: 0x20767FC + NA: 0x2076464 + - name: GX_SetBankForObj + address: + EU: 0x2076A8C + NA: 0x20766F4 + - name: GX_SetBankForBgExtPltt + address: + EU: 0x2076BDC + NA: 0x2076844 + - name: GX_SetBankForObjExtPltt + address: + EU: 0x2076CDC + NA: 0x2076944 + - name: GX_SetBankForTex + address: + EU: 0x2076D88 + NA: 0x20769F0 + - name: GX_SetBankForTexPltt + address: + EU: 0x2076F60 + NA: 0x2076BC8 + - name: GX_SetBankForClearImage + address: + EU: 0x2077048 + NA: 0x2076CB0 + - name: GX_SetBankForArm7 + address: + EU: 0x207717C + NA: 0x2076DE4 + - name: GX_SetBankForLcdc + address: + EU: 0x2077228 + NA: 0x2076E90 + - name: GX_SetBankForSubBg + address: + EU: 0x2077248 + NA: 0x2076EB0 + - name: GX_SetBankForSubObj + address: + EU: 0x20772F0 + NA: 0x2076F58 + - name: GX_SetBankForSubBgExtPltt + address: + EU: 0x2077360 + NA: 0x2076FC8 + - name: GX_SetBankForSubObjExtPltt + address: + EU: 0x20773E0 + NA: 0x2077048 + - name: EnableVramBanksInSet + address: + EU: 0x2077460 + NA: 0x20770C8 + JP: 0x20773B0 + description: |- + Enable the VRAM banks in the input set. Will reset the pointed set to 0, and update ENABLED_VRAM_BANKS + + r0: vram_banks_set * + - name: GX_ResetBankForBgExtPltt + address: + EU: 0x2077494 + NA: 0x20770FC + - name: GX_ResetBankForObjExtPltt + address: + EU: 0x20774B8 + NA: 0x2077120 + - name: GX_ResetBankForTex + address: + EU: 0x20774DC + NA: 0x2077144 + - name: GX_ResetBankForTexPltt + address: + EU: 0x20774F0 + NA: 0x2077158 + - name: GX_ResetBankForSubBgExtPltt + address: + EU: 0x2077504 + NA: 0x207716C + - name: GX_ResetBankForSubObjExtPltt + address: + EU: 0x207752C + NA: 0x2077194 + - name: DisableBankForX + address: + EU: 0x2077554 + NA: 0x20771BC + - name: GX_DisableBankForBg + address: + EU: 0x2077634 + NA: 0x207729C + - name: GX_DisableBankForObj + address: + EU: 0x2077648 + NA: 0x20772B0 + - name: GX_DisableBankForBgExtPltt + address: + EU: 0x207765C + NA: 0x20772C4 + - name: GX_DisableBankForObjExtPltt + address: + EU: 0x2077680 + NA: 0x20772E8 + - name: GX_DisableBankForTex + address: + EU: 0x20776A4 + NA: 0x207730C + - name: GX_DisableBankForTexPltt + address: + EU: 0x20776B8 + NA: 0x2077320 + - name: GX_DisableBankForClearImage + address: + EU: 0x20776CC + NA: 0x2077334 + - name: GX_DisableBankForArm7 + address: + EU: 0x20776E0 + NA: 0x2077348 + - name: GX_DisableBankForLcdc + address: + EU: 0x20776F4 + NA: 0x207735C + - name: GX_DisableBankForSubBg + address: + EU: 0x2077708 + NA: 0x2077370 + - name: GX_DisableBankForSubObj + address: + EU: 0x207771C + NA: 0x2077384 + - name: GX_DisableBankForSubBgExtPltt + address: + EU: 0x2077730 + NA: 0x2077398 + - name: GX_DisableBankForSubObjExtPltt + address: + EU: 0x2077758 + NA: 0x20773C0 + - name: G2_GetBG0ScrPtr + address: + EU: 0x2077780 + NA: 0x20773E8 + - name: G2S_GetBG0ScrPtr + address: + EU: 0x20777B4 + NA: 0x207741C + - name: G2_GetBG1ScrPtr + address: + EU: 0x20777D4 + NA: 0x207743C + - name: G2S_GetBG1ScrPtr + address: + EU: 0x2077808 + NA: 0x2077470 + - name: G2_GetBG2ScrPtr + address: + EU: 0x2077828 + NA: 0x2077490 + - name: G2_GetBG3ScrPtr + address: + EU: 0x20778AC + NA: 0x2077514 + - name: G2_GetBG0CharPtr + address: + EU: 0x2077930 + NA: 0x2077598 + - name: G2S_GetBG0CharPtr + address: + EU: 0x2077964 + NA: 0x20775CC + - name: G2_GetBG1CharPtr + address: + EU: 0x2077984 + NA: 0x20775EC + - name: G2S_GetBG1CharPtr + address: + EU: 0x20779B8 + NA: 0x2077620 + - name: G2_GetBG2CharPtr + address: + EU: 0x20779D8 + NA: 0x2077640 + - name: G2_GetBG3CharPtr + address: + EU: 0x2077A28 + NA: 0x2077690 + - name: G2x_SetBlendAlpha + address: + EU: 0x2077A80 + NA: 0x20776E8 + - name: G2x_SetBlendBrightness + address: + EU: 0x2077A9C + NA: 0x2077704 + - name: G2x_ChangeBlendBrightness + address: + EU: 0x2077AC4 + NA: 0x207772C + - name: G3_LoadMtx44 + address: + EU: 0x2077B08 + NA: 0x2077770 + - name: G3_LoadMtx43 + address: + EU: 0x2077B24 + NA: 0x207778C + JP: 0x2077A74 + description: |- + Send the MTX_LOAD_4x3 geometry engine command, through a GXFIFO command. See https://problemkaputt.de/gbatek.htm#ds3dgeometrycommands and https://problemkaputt.de/gbatek.htm#ds3dmatrixloadmultiply for more information. + + This pops the top of the current matrix stack (https://problemkaputt.de/gbatek.htm#ds3dmatrixstack) and sets it as the engine's "current" matrix. It's commonly preceded by a MTX_PUSH command to populate the matrix stack with a matrix. + + r0: matrix_4x3 pointer + - name: G3_MultMtx43 + address: + EU: 0x2077B40 + NA: 0x20777A8 + JP: 0x2077A90 + description: |- + Send the MTX_MULT_4x3 geometry engine command, through a GXFIFO command. See https://problemkaputt.de/gbatek.htm#ds3dgeometrycommands and https://problemkaputt.de/gbatek.htm#ds3dmatrixloadmultiply for more information. + + This pops the top of the current matrix stack (https://problemkaputt.de/gbatek.htm#ds3dmatrixstack) and left-multiplies the engine's "current" matrix by the new matrix. It's commonly preceded by a MTX_PUSH command to populate the matrix stack with a matrix. + + r0: matrix_4x3 pointer + - name: G3X_Init + address: + EU: 0x2077B5C + NA: 0x20777C4 + - name: G3X_Reset + address: + EU: 0x2077C68 + NA: 0x20778D0 + - name: G3X_ClearFifo + address: + EU: 0x2077CD4 + NA: 0x207793C + - name: G3X_InitMtxStack + address: + EU: 0x2077CFC + NA: 0x2077964 + - name: G3X_ResetMtxStack + address: + EU: 0x2077D94 + NA: 0x20779FC + - name: G3X_SetClearColor + address: + EU: 0x2077E24 + NA: 0x2077A8C + - name: G3X_InitTable + address: + EU: 0x2077E4C + NA: 0x2077AB4 + - name: G3X_GetMtxStackLevelPV + address: + EU: 0x2077EEC + NA: 0x2077B54 + - name: G3X_GetMtxStackLevelPJ + address: + EU: 0x2077F1C + NA: 0x2077B84 + - name: GXi_NopClearFifo128 + address: + EU: 0x2077F4C + NA: 0x2077BB4 + - name: G3i_OrthoW + address: + EU: 0x2077FE0 + NA: 0x2077C48 + - name: G3i_LookAt + address: + EU: 0x2078044 + NA: 0x2077CAC + - name: GX_LoadBgPltt + address: + EU: 0x2078090 + NA: 0x2077CF8 + - name: Gxs_LoadBgPltt + address: + EU: 0x20780E4 + NA: 0x2077D4C + - name: GX_LoadObjPltt + address: + EU: 0x207813C + NA: 0x2077DA4 + - name: Gxs_LoadObjPltt + address: + EU: 0x2078194 + NA: 0x2077DFC + - name: GX_LoadOam + address: + EU: 0x20781EC + NA: 0x2077E54 + - name: Gxs_LoadOam + address: + EU: 0x2078240 + NA: 0x2077EA8 + - name: GX_LoadObj + address: + EU: 0x2078298 + NA: 0x2077F00 + - name: Gxs_LoadObj + address: + EU: 0x20782F0 + NA: 0x2077F58 + - name: GX_LoadBg0Scr + address: + EU: 0x2078348 + NA: 0x2077FB0 + - name: GX_LoadBg1Scr + address: + EU: 0x20783A8 + NA: 0x2078010 + - name: Gxs_LoadBg1Scr + address: + EU: 0x2078408 + NA: 0x2078070 + - name: GX_LoadBg2Scr + address: + EU: 0x2078468 + NA: 0x20780D0 + - name: GX_LoadBg3Scr + address: + EU: 0x20784C8 + NA: 0x2078130 + - name: GX_LoadBg0Char + address: + EU: 0x2078528 + NA: 0x2078190 + - name: Gxs_LoadBg0Char + address: + EU: 0x2078588 + NA: 0x20781F0 + - name: GX_LoadBg1Char + address: + EU: 0x20785E8 + NA: 0x2078250 + - name: Gxs_LoadBg1Char + address: + EU: 0x2078648 + NA: 0x20782B0 + - name: GX_LoadBg2Char + address: + EU: 0x20786A8 + NA: 0x2078310 + - name: GX_LoadBg3Char + address: + EU: 0x2078708 + NA: 0x2078370 + - name: GX_BeginLoadBgExtPltt + address: + EU: 0x2078768 + NA: 0x20783D0 + - name: GX_EndLoadBgExtPltt + address: + EU: 0x2078808 + NA: 0x2078470 + - name: GX_BeginLoadObjExtPltt + address: + EU: 0x2078850 + NA: 0x20784B8 + - name: GX_EndLoadObjExtPltt + address: + EU: 0x2078898 + NA: 0x2078500 + - name: Gxs_BeginLoadBgExtPltt + address: + EU: 0x20788DC + NA: 0x2078544 + - name: Gxs_EndLoadBgExtPltt + address: + EU: 0x20788F4 + NA: 0x207855C + - name: Gxs_BeginLoadObjExtPltt + address: + EU: 0x2078934 + NA: 0x207859C + - name: Gxs_EndLoadObjExtPltt + address: + EU: 0x207894C + NA: 0x20785B4 + - name: GX_BeginLoadTex + address: + EU: 0x207898C + NA: 0x20785F4 + - name: GX_LoadTex + address: + EU: 0x20789E8 + NA: 0x2078650 + - name: GX_EndLoadTex + address: + EU: 0x2078B28 + NA: 0x2078790 + - name: GX_BeginLoadTexPltt + address: + EU: 0x2078B74 + NA: 0x20787DC + - name: GX_LoadTexPltt + address: + EU: 0x2078BA8 + NA: 0x2078810 + - name: GX_EndLoadTexPltt + address: + EU: 0x2078C14 + NA: 0x207887C + - name: GeomGxFifoSendMtx4x3 + address: + EU: 0x2078C58 + NA: 0x20788C0 + JP: 0x2078BA8 + description: |- + Send a 4x3 matrix argument for a GXFIFO geometry engine command. + + This function is used by GeomMtxLoad4x3 and GeomMtxMult4x3 to pass the matrix argument for a GXFIFO command after already having written the command code. See https://problemkaputt.de/gbatek.htm#ds3dgeometrycommands for more information. + + Note that the GXFIFO address is 0x4000400, but is (maybe) mirrored up to 0x400043F. This function is optimized to take advantage of this by writing 3 matrix entries at a time using ldmia and stmia instructions. + + r0: matrix_4x3 pointer + r1: GXFIFO pointer + - name: GX_SendFifo64B + address: + EU: 0x2078C7C + NA: 0x20788E4 + - name: OS_GetLockID + address: + EU: 0x20793C4 + NA: 0x207902C + - name: IncrementThreadCount + address: + EU: 0x20794E8 + NA: 0x2079150 + JP: 0x2079438 + description: |- + Increments thread_info::thread_count by 1 and returns the new value. + + return: New thread count + - name: InsertThreadIntoList + address: + EU: 0x2079630 + NA: 0x2079298 + JP: 0x2079580 + description: |- + Inserts a new thread into the linked thread list (see thread_info::thread_list_head). + + The thread is inserted in sorted order. + + r0: Thread to insert + - name: StartThread + address: + EU: 0x20798F8 + NA: 0x2079560 + JP: 0x2079848 + description: |- + Called to start a new thread. + + Initializes the specified thread struct and some values on its stack area. + + r0: Struct of the thread to init + r1: Pointer to the function to run on this thread + r2: Pointer to a thread struct. Sometimes equal to r0. Sometimes null. + r3: Pointer to the stack area for this thread. Not all the space is usable. See thread::usable_stack_pointer for more info. + stack[0]: Stack size + stack[1]: (?) Used to sort threads on a list + - name: ThreadExit + address: + EU: 0x20799F4 + NA: 0x207965C + JP: 0x2079944 + description: |- + Function called by threads on exit. + + Base functions that contain an infinite loop that is not supposed to return and that have their stacks in main RAM have this function as their return address. + + No params. + - name: SetThreadField0xB4 + address: + EU: 0x207A014 + NA: 0x2079C7C + JP: 0x2079F64 + description: |- + Sets the given thread's field_0xB4 to the specified value. + + r0: Thread + r1: Value to set + - name: InitThread + address: + EU: 0x207A01C + NA: 0x2079C84 + JP: 0x2079F6C + description: |- + Initializes some fields of the given thread struct. + + Most notably, thread::flags, thread::function_address_plus_4, thread::stack_pointer_minus_4 and thread::usable_stack_pointer. Also initializes a few more fields with a value of 0. + thread::flags is initialized to 0x1F, unless the address of the function is odd (???), in which case it's initialized to 0x3F. + + r0: Pointer to the thread to initialize + r1: Pointer to the function the thread will run + r2: Pointer to the start of the thread's stack area - 4 + - name: GetTimer0Control + address: + EU: 0x207B27C + NA: 0x207AEE4 + JP: 0x207B1CC + description: |- + Returns the value of the control register for hardware timer 0 + + return: Value of the control register + - name: ClearIrqFlag + address: + EU: 0x207BB68 + NA: 0x207B7D0 + JP: 0x207BAB8 + description: |- + Enables processor interrupts by clearing the i flag in the program status register (cpsr). + + return: Old value of cpsr & 0x80 (0x80 if interrupts were disabled, 0x0 if they were already enabled) + - name: EnableIrqFlag + address: + EU: 0x207BB7C + NA: 0x207B7E4 + JP: 0x207BACC + description: |- + Disables processor interrupts by setting the i flag in the program status register (cpsr). + + return: Old value of cpsr & 0x80 (0x80 if interrupts were already disabled, 0x0 if they were enabled) + - name: SetIrqFlag + address: + EU: 0x207BB90 + NA: 0x207B7F8 + JP: 0x207BAE0 + description: |- + Sets the value of the processor's interrupt flag according to the specified parameter. + + r0: Value to set the flag to (0x80 to set it, which disables interrupts; 0x0 to unset it, which enables interrupts) + return: Old value of cpsr & 0x80 (0x80 if interrupts were disabled, 0x0 if they were enabled) + - name: EnableIrqFiqFlags + address: + EU: 0x207BBA8 + NA: 0x207B810 + JP: 0x207BAF8 + description: |- + Disables processor all interrupts (both standard and fast) by setting the i and f flags in the program status register (cpsr). + + return: Old value of cpsr & 0xC0 (contains the previous values of the i and f flags) + - name: SetIrqFiqFlags + address: + EU: 0x207BBBC + NA: 0x207B824 + JP: 0x207BB0C + description: |- + Sets the value of the processor's interrupt flags (i and f) according to the specified parameter. + + r0: Value to set the flags to (0xC0 to set both flags, 0x80 to set the i flag and clear the f flag, 0x40 to set the f flag and clear the i flag and 0x0 to clear both flags) + return: Old value of cpsr & 0xC0 (contains the previous values of the i and f flags) + - name: GetIrqFlag + address: + EU: 0x207BBD4 + NA: 0x207B83C + JP: 0x207BB24 + description: |- + Gets the current value of the processor's interrupt request (i) flag + + return: cpsr & 0x80 (0x80 if interrupts are disabled, 0x0 if they are enabled) + - name: GetProcessorMode + address: + EU: 0x207BBE0 + NA: 0x207B848 + JP: 0x207BB30 + description: |- + Gets the processor's current operating mode. + + See https://problemkaputt.de/gbatek.htm#armcpuflagsconditionfieldcond + + return: cpsr & 0x1f (the cpsr mode bits M4-M0) + - name: CountLeadingZeros + address: + EU: 0x207BE24 + NA: 0x207BA8C + description: |- + Counts the number of leading zeros in a 32-bit integer. + + r0: x + return: clz(x) + - name: WaitForever2 + address: + EU: 0x207BFB8 + NA: 0x207BC20 + JP: 0x207BF08 + description: |- + Calls EnableIrqFlag and WaitForInterrupt in an infinite loop. + + This is called on fatal errors to hang the program indefinitely. + + No params. + - name: WaitForInterrupt + address: + EU: 0x207BFC8 + NA: 0x207BC30 + JP: 0x207BF18 + description: |- + Presumably blocks until the program receives an interrupt. + + This just calls (in Ghidra terminology) coproc_moveto_Wait_for_interrupt(0). See https://en.wikipedia.org/wiki/ARM_architecture_family#Coprocessors. + + No params. + - name: ArrayFill16 + address: + EU: 0x207C650 + NA: 0x207C2B8 + JP: 0x207C5A0 + description: |- + Fills an array of 16-bit values with a given value. + + r0: value + r1: ptr + r2: len (# bytes) + - name: ArrayCopy16 + address: + EU: 0x207C678 + NA: 0x207C2E0 + JP: 0x207C5C8 + description: |- + Copies an array of 16-bit values to another array of 16-bit values. + + This is essentially an alternate implementation of Memcpy16, but with a different parameter order. + + r0: src + r1: dest + r2: len (# bytes) + - name: ArrayFill32 + address: + EU: 0x207C6AC + NA: 0x207C314 + JP: 0x207C5FC + description: |- + Fills an array of 32-bit values with a given value. + + This is essentially an alternate implementation of Memset32, but with a different parameter order. + + r0: value + r1: ptr + r2: len (# bytes) + - name: ArrayCopy32 + address: + EU: 0x207C6C8 + NA: 0x207C330 + JP: 0x207C618 + description: |- + Copies an array of 32-bit values to another array of 32-bit values. + + This is essentially an alternate implementation of Memcpy32, but with a different parameter order. + + r0: src + r1: dest + r2: len (# bytes) + - name: ArrayFill32Fast + address: + EU: 0x207C6F0 + NA: 0x207C358 + JP: 0x207C640 + description: |- + Does the same thing as ArrayFill32, except the implementation uses an unrolled loop that sets 8 values per iteration, taking advantage of the stmia instruction. + + r0: value + r1: ptr + r2: len (# bytes) + - name: ArrayCopy32Fast + address: + EU: 0x207C74C + NA: 0x207C3B4 + JP: 0x207C69C + description: |- + Does the same thing as ArrayCopy32, except the implementation uses an unrolled loop that copies 8 values per iteration, taking advantage of the ldmia/stmia instructions. + + r0: src + r1: dest + r2: len (# bytes) + - name: MemsetFast + address: + EU: 0x207C7A4 + NA: 0x207C40C + JP: 0x207C6F4 + description: |- + A semi-optimized implementation of the memset(3) C library function. + + This function was probably manually implemented by the developers, or was included as part of a library other than libc (the Nitro SDK probably?). See memset for what's probably the real libc function. + + This function is optimized to set values in 4-byte chunks, properly dealing with pointer alignment. However, unlike the libc memset, there are no loop unrolling optimizations. + + r0: ptr + r1: value + r2: len (# bytes) + - name: MemcpyFast + address: + EU: 0x207C860 + NA: 0x207C4C8 + JP: 0x207C7B0 + description: |- + Copies bytes from one buffer to another, similar to memcpy(3). Note that the source/destination buffer parameters swapped relative to the standard memcpy. + + This function was probably manually implemented by the developers, or was included as part of a library other than libc (the Nitro SDK probably?). See memcpy for what's probably the real libc function. + + This function is optimized to copy values in 4-byte chunks, properly dealing with pointer alignment. + + r0: src + r1: dest + r2: n (# bytes) + - name: AtomicExchange + address: + EU: 0x207C9E0 + NA: 0x207C648 + JP: 0x207C930 + description: |- + Atomically replaces a pointer's pointee with a desired value, and returns the previous value. + + This function is just a single swp instruction. + + r0: desired value + r1: ptr + return: previous value + - name: FileInit + address: + EU: 0x207F77C + NA: 0x207F3E4 + JP: 0x207F6CC + description: |- + Initializes a file_stream structure for file I/O. + + This function must always be called before opening a file. + + r0: file_stream pointer + - name: GetOverlayInfo + address: + EU: 0x2080034 + NA: 0x207FC9C + JP: 0x207FF84 + description: |- + Returns the y9.bin entry for the specified overlay + + r0: [output] Overlay info struct + r1: ? + r2: Overlay ID + return: True if the entry could be loaded successfully? + - name: LoadOverlayInternal + address: + EU: 0x2080130 + NA: 0x207FD98 + JP: 0x2080080 + description: |- + Called by LoadOverlay to load an overlay into RAM given its info struct + + r0: Overlay info struct + Return: True if the overlay was loaded successfully? + - name: InitOverlay + address: + EU: 0x2080254 + NA: 0x207FEBC + JP: 0x20801A4 + description: |- + Performs overlay initialization right after loading an overlay with LoadOverlayInternal. + + This function is responsible for jumping to all the pointers located in the overlay's static init array, among other things. + + r0: Overlay info struct + - name: abs + address: + EU: 0x20868F4 + NA: 0x208655C + JP: 0x2086844 + description: |- + Takes the absolute value of an integer. + + r0: x + return: abs(x) + - name: mbtowc + address: + EU: 0x2087554 + NA: 0x20871BC + JP: 0x20874A4 + description: |- + The mbtowc(3) C library function. + + r0: pwc + r1: s + r2: n + return: number of consumed bytes, or -1 on failure + - name: TryAssignByte + address: + EU: 0x208758C + NA: 0x20871F4 + JP: 0x20874DC + description: |- + Assign a byte to the target of a pointer if the pointer is non-null. + + r0: pointer + r1: value + return: true on success, false on failure + - name: TryAssignByteWrapper + address: + EU: 0x20875A0 + NA: 0x2087208 + JP: 0x20874F0 + description: |- + Wrapper around TryAssignByte. + + Accesses the TryAssignByte function with a weird chain of pointer dereferences. + + r0: pointer + r1: value + return: true on success, false on failure + - name: wcstombs + address: + EU: 0x20875BC + NA: 0x2087224 + JP: 0x208750C + description: |- + The wcstombs(3) C library function. + + r0: dest + r1: src + r2: n + return: characters converted + - name: memcpy + address: + EU: 0x2087634 + NA: 0x208729C + JP: 0x2087584 + description: |- + The memcpy(3) C library function. + + r0: dest + r1: src + r2: n + return: dest + - name: memmove + address: + EU: 0x2087654 + NA: 0x20872BC + JP: 0x20875A4 + description: |- + The memmove(3) C library function. + + The implementation is nearly the same as memcpy, but it copies bytes from back to front if src < dst. + + r0: dest + r1: src + r2: n + return: dest + - name: memset + address: + EU: 0x20876A0 + NA: 0x2087308 + JP: 0x20875F0 + description: |- + The memset(3) C library function. + + This is just a wrapper around memset_internal that returns the pointer at the end. + + r0: s + r1: c (int, but must be a single-byte value) + r2: n + return: s + - name: memchr + address: + EU: 0x20876B4 + NA: 0x208731C + JP: 0x2087604 + description: |- + The memchr(3) C library function. + + r0: s + r1: c + r2: n + return: pointer to first occurrence of c in s, or a null pointer if no match + - name: memcmp + address: + EU: 0x20876E0 + NA: 0x2087348 + JP: 0x2087630 + description: |- + The memcmp(3) C library function. + + r0: s1 + r1: s2 + r2: n + return: comparison value + - name: memset_internal + address: + EU: 0x2087720 + NA: 0x2087388 + JP: 0x2087670 + description: |- + The actual memory-setting implementation for the memset(3) C library function. + + This function is optimized to set bytes in 4-byte chunks for n >= 32, correctly handling any unaligned bytes at the front/back. In this case, it also further optimizes by unrolling a for loop to set 8 4-byte values at once (effectively a 32-byte chunk). + + r0: s + r1: c (int, but must be a single-byte value) + r2: n + - name: __vsprintf_internal_slice + address: + EU: 0x208900C + NA: 0x2088C74 + JP: 0x2088F5C + description: |- + This is what implements the bulk of __vsprintf_internal. + + The __vsprintf_internal in the modern-day version of glibc relies on __vfprintf_internal; this function has a slightly different interface, but it serves a similar role. + + r0: function pointer to append to the string being built (__vsprintf_internal uses TryAppendToSlice) + r1: string buffer slice + r2: format + r3: ap + return: number of characters printed, excluding the null-terminator + - name: TryAppendToSlice + address: + EU: 0x2089830 + NA: 0x2089498 + JP: 0x2089780 + description: |- + Best-effort append the given data to a slice. If the slice's capacity is reached, any remaining data will be truncated. + + r0: slice pointer + r1: buffer of data to append + r2: number of bytes in the data buffer + return: true + - name: __vsprintf_internal + address: + EU: 0x2089874 + NA: 0x20894DC + JP: 0x20897C4 + description: |- + This is what implements vsprintf. It's akin to __vsprintf_internal in the modern-day version of glibc (in fact, it's probably an older version of this). + + r0: str + r1: maxlen (vsprintf passes UINT32_MAX for this) + r2: format + r3: ap + return: number of characters printed, excluding the null-terminator + - name: vsprintf + address: + EU: 0x20898DC + NA: 0x2089544 + JP: 0x208982C + description: |- + The vsprintf(3) C library function. + + r0: str + r1: format + r2: ap + return: number of characters printed, excluding the null-terminator + - name: snprintf + address: + EU: 0x20898F4 + NA: 0x208955C + JP: 0x2089844 + description: |- + The snprintf(3) C library function. + + This calls __vsprintf_internal directly, so it's presumably the real snprintf. + + r0: str + r1: n + r2: format + ...: variadic + return: number of characters printed, excluding the null-terminator + - name: sprintf + address: + EU: 0x208991C + NA: 0x2089584 + JP: 0x208986C + description: |- + The sprintf(3) C library function. + + This calls __vsprintf_internal directly, so it's presumably the real sprintf. + + r0: str + r1: format + ...: variadic + return: number of characters printed, excluding the null-terminator + - name: strlen + address: + EU: 0x2089A10 + NA: 0x2089678 + JP: 0x2089960 + description: |- + The strlen(3) C library function. + + r0: s + return: length of s + - name: strcpy + address: + EU: 0x2089A2C + NA: 0x2089694 + JP: 0x208997C + description: |- + The strcpy(3) C library function. + + This function is optimized to copy characters in aligned 4-byte chunks if possible, correctly handling any unaligned bytes at the front/back. + + r0: dest + r1: src + return: dest + - name: strncpy + address: + EU: 0x2089AF4 + NA: 0x208975C + JP: 0x2089A44 + description: |- + The strncpy(3) C library function. + + r0: dest + r1: src + r2: n + return: dest + - name: strcat + address: + EU: 0x2089B44 + NA: 0x20897AC + JP: 0x2089A94 + description: |- + The strcat(3) C library function. + + r0: dest + r1: src + return: dest + - name: strncat + address: + EU: 0x2089B74 + NA: 0x20897DC + JP: 0x2089AC4 + description: |- + The strncat(3) C library function. + + r0: dest + r1: src + r2: n + return: dest + - name: strcmp + address: + EU: 0x2089BC4 + NA: 0x208982C + JP: 0x2089B14 + description: |- + The strcmp(3) C library function. + + Similarly to strcpy, this function is optimized to compare characters in aligned 4-byte chunks if possible. + + r0: s1 + r1: s2 + return: comparison value + - name: strncmp + address: + EU: 0x2089CD8 + NA: 0x2089940 + JP: 0x2089C28 + description: |- + The strncmp(3) C library function. + + r0: s1 + r1: s2 + r2: n + return: comparison value + - name: strchr + address: + EU: 0x2089D0C + NA: 0x2089974 + JP: 0x2089C5C + description: |- + The strchr(3) C library function. + + r0: string + r1: c + return: pointer to the located byte c, or null pointer if no match + - name: strcspn + address: + EU: 0x2089D48 + NA: 0x20899B0 + JP: 0x2089C98 + description: |- + The strcspn(3) C library function. + + r0: string + r1: stopset + return: offset of the first character in string within stopset + - name: strstr + address: + EU: 0x2089E08 + NA: 0x2089A70 + JP: 0x2089D58 + description: |- + The strstr(3) C library function. + + r0: haystack + r1: needle + return: pointer into haystack where needle starts, or null pointer if no match + - name: wcslen + address: + EU: 0x208B780 + NA: 0x208B3E8 + JP: 0x208B6D0 + description: |- + The wcslen(3) C library function. + + r0: ws + return: length of ws + - name: _dadd + address: + EU: 0x208E260 + NA: 0x208DEC8 + description: |- + Implements the addition operator for IEEE 754 double-precision floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a + b + - name: _d2f + address: + EU: 0x208E578 + NA: 0x208E1E0 + description: |- + Implements the double to float cast operator for IEEE 754 floating-point numbers. + + r0: double (low bits) + r1: double (high bits) + return: (float)double + - name: _ll_ufrom_d + address: + EU: 0x208E67C + NA: 0x208E2E4 + description: |- + Implements the double to unsigned long long cast operation for IEEE 754 floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: double (low bits) + r1: double (high bits) + return: (unsigned long long)double + - name: _dflt + address: + EU: 0x208E708 + NA: 0x208E370 + description: |- + Implements the int to double cast operation for IEEE 754 floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: int + return: (double)int + - name: _dfltu + address: + EU: 0x208E748 + NA: 0x208E3B0 + description: |- + Implements the unsigned int to double cast operation for IEEE 754 floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: uint + return: (double)uint + - name: _dmul + address: + EU: 0x208E784 + NA: 0x208E3EC + description: |- + Implements the multiplication operator for IEEE 754 double-precision floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a * b + - name: _dsqrt + address: + EU: 0x208EAE8 + NA: 0x208E750 + description: |- + Analogous to the sqrt(3) C library function. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: x (low bits) + r1: x (high bits) + return: sqrt(x) + - name: _dsub + address: + EU: 0x208EC9C + NA: 0x208E904 + description: |- + Implements the subtraction operator for IEEE 754 double-precision floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a - b + - name: _fadd + address: + EU: 0x208F050 + NA: 0x208ECB8 + JP: 0x208EFA0 + description: |- + Implements the addition operator for IEEE 754 floating-point numbers. + + Analogous to __addsf3 in libgcc. + + r0: a + r1: b + return: a + b + - name: _dgeq + address: + EU: 0x208F274 + NA: 0x208EEDC + description: |- + Implements the >= operator for IEEE 754 double-precision floating-point numbers. + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a >= b + - name: _dleq + address: + EU: 0x208F30C + NA: 0x208EF74 + description: |- + Implements the <= operator for IEEE 754 double-precision floating-point numbers. + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a <= b + - name: _dls + address: + EU: 0x208F3B0 + NA: 0x208F018 + description: |- + Implements the < operator for IEEE 754 double-precision floating-point numbers. + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a < b + - name: _deq + address: + EU: 0x208F44C + NA: 0x208F0B4 + description: |- + Implements the == operator for IEEE 754 double-precision floating-point numbers. + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a == b + - name: _dneq + address: + EU: 0x208F4D8 + NA: 0x208F140 + description: |- + Implements the != operator for IEEE 754 double-precision floating-point numbers. + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a != b + - name: _fls + address: + EU: 0x208F564 + NA: 0x208F1CC + description: |- + Implements the < operator for IEEE 754 floating-point numbers. + + r0: a + r1: b + return: a < b + - name: _fdiv + address: + EU: 0x208F5CC + NA: 0x208F234 + JP: 0x208F51C + description: |- + Implements the division operator for IEEE 754 floating-point numbers. + + Analogous to __divsf3 in libgcc. + + r0: dividend + r1: divisor + return: dividend / divisor + - name: _f2d + address: + EU: 0x208F984 + NA: 0x208F5EC + JP: 0x208F8D4 + description: |- + Implements the float to double cast operation for IEEE 754 floating-point numbers. + + Analogous to __extendsfdf2 in libgcc. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: float + return: (double)float + - name: _ffix + address: + EU: 0x208FA08 + NA: 0x208F670 + JP: 0x208F958 + description: |- + Implements the float to int cast operation for IEEE 754 floating-point numbers. The output saturates if the input is out of the representable range for the int type. + + Analogous to __fixsfsi in libgcc. + + r0: float + return: (int)float + - name: _fflt + address: + EU: 0x208FA3C + NA: 0x208F6A4 + JP: 0x208F98C + description: |- + Implements the int to float cast operation for IEEE 754 floating-point numbers. + + Analogous to __floatsisf in libgcc. + + r0: int + return: (float)int + - name: _ffltu + address: + EU: 0x208FA84 + NA: 0x208F6EC + JP: 0x208F9D4 + description: |- + Implements the unsigned int to float cast operation for IEEE 754 floating-point numbers. + + Analogous to __floatunsisf in libgcc. + + r0: uint + return: (float)uint + - name: _fmul + address: + EU: 0x208FACC + NA: 0x208F734 + JP: 0x208FA1C + description: |- + Implements the multiplication operator for IEEE 754 floating-point numbers. + + Analogous to __mulsf3 in libgcc. + + r0: a + r1: b + return: a * b + - name: sqrtf + address: + EU: 0x208FCAC + NA: 0x208F914 + JP: 0x208FBFC + description: |- + The sqrtf(3) C library function. + + r0: x + return: sqrt(x) + - name: _fsub + address: + EU: 0x208FD9C + NA: 0x208FA04 + JP: 0x208FCEC + description: |- + Implements the subtraction operator for IEEE 754 floating-point numbers. + + Analogous to __subsf3 in libgcc. + + r0: a + r1: b + return: a - b + - name: _ll_mod + address: + EU: 0x2090014 + NA: 0x208FC7C + description: |- + Implements the modulus operator for signed long longs. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: dividend (low bits) + r1: dividend (high bits) + r2: divisor (low bits) + r3: divisor (high bits) + return: dividend % divisor + - name: _ll_sdiv + address: + EU: 0x2090024 + NA: 0x208FC8C + description: |- + Implements the division operator for signed long longs. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: dividend (low bits) + r1: dividend (high bits) + r2: divisor (low bits) + r3: divisor (high bits) + return: dividend / divisor + - name: _ll_udiv + address: + EU: 0x20901D4 + NA: 0x208FE3C + description: |- + Implements the division operator for unsigned long longs. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: dividend (low bits) + r1: dividend (high bits) + r2: divisor (low bits) + r3: divisor (high bits) + return: dividend / divisor + - name: _ull_mod + address: + EU: 0x20901E0 + NA: 0x208FE48 + description: |- + Implements the modulus operator for unsigned long longs. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: dividend (low bits) + r1: dividend (high bits) + r2: divisor (low bits) + r3: divisor (high bits) + return: dividend % divisor + - name: _ll_mul + address: + EU: 0x209021C + NA: 0x208FE84 + description: |- + Implements the multiplication operator for signed long longs. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: a (low bits) + r1: a (high bits) + r2: b (low bits) + r3: b (high bits) + return: a * b + - name: _s32_div_f + address: + EU: 0x209023C + NA: 0x208FEA4 + JP: 0x209018C + description: |- + Implements the division operator for signed ints. + + Analogous to __divsi3 in libgcc. + + The return value is a 64-bit integer, with the quotient (dividend / divisor) in the lower 32 bits and the remainder (dividend % divisor) in the upper 32 bits. In accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return), this means that the quotient is returned in r0 and the remainder is returned in r1. + + r0: dividend + r1: divisor + return: (quotient) | (remainder << 32) + - name: _u32_div_f + address: + EU: 0x2090448 + NA: 0x20900B0 + JP: 0x2090398 + description: |- + Implements the division operator for unsigned ints. + + Analogous to __udivsi3 in libgcc. + + The return value is a 64-bit integer, with the quotient (dividend / divisor) in the lower 32 bits and the remainder (dividend % divisor) in the upper 32 bits. In accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return), this means that the quotient is returned in r0 and the remainder is returned in r1. + Note: This function falls through to _u32_div_not_0_f. + + r0: dividend + r1: divisor + return: (quotient) | (remainder << 32) + - name: _u32_div_not_0_f + address: + EU: 0x2090450 + NA: 0x20900B8 + JP: 0x20903A0 + description: |- + Subsidiary function to _u32_div_f. Skips the initial check for divisor == 0. + + The return value is a 64-bit integer, with the quotient (dividend / divisor) in the lower 32 bits and the remainder (dividend % divisor) in the upper 32 bits. In accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return), this means that the quotient is returned in r0 and the remainder is returned in r1. + This function appears to only be called internally. + + r0: dividend + r1: divisor + return: (quotient) | (remainder << 32) + - name: _drdiv + address: + EU: 0x209062C + NA: 0x2090294 + description: |- + The same as _ddiv, but with the parameters reversed. + + This simply swaps the first and second parameters, then falls through to _ddiv. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: divisor (low bits) + r1: divisor (high bits) + r2: dividend (low bits) + r3: dividend (high bits) + return: dividend / divisor + - name: _ddiv + address: + EU: 0x2090644 + NA: 0x20902AC + description: |- + Implements the division operator for IEEE 754 double-precision floating-point numbers. + + The result is returned in r0 and r1, in accordance with the Procedure Call Standard for the Arm Architecture (see https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs32/aapcs32.rst#result-return). + + r0: dividend (low bits) + r1: dividend (high bits) + r2: divisor (low bits) + r3: divisor (high bits) + return: dividend / divisor + - name: _fp_init + address: + EU: 0x2090B88 + NA: 0x20907F0 + description: |- + Meant to do set up for floating point calculations? Does nothing. + + No params. + data: []