summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/AgbRfu_LinkManager.h4
-rw-r--r--include/battle.h6
-rw-r--r--include/battle_message.h2
-rw-r--r--include/constants/battle_pyramid.h10
-rw-r--r--include/gba/m4a_internal.h92
-rw-r--r--include/global.h2
-rw-r--r--include/list_menu.h4
-rw-r--r--include/pokemon.h4
8 files changed, 68 insertions, 56 deletions
diff --git a/include/AgbRfu_LinkManager.h b/include/AgbRfu_LinkManager.h
index 4e1a879c2..d4ef13183 100644
--- a/include/AgbRfu_LinkManager.h
+++ b/include/AgbRfu_LinkManager.h
@@ -176,8 +176,8 @@ typedef struct linkManagerTag
/* 0x024 */ VBL_TIMER nameAcceptTimer;
/* 0x030 */ VBL_TIMER linkRecoveryTimer;
/* 0x03c */ INIT_PARAM *init_param;
- /* 0x040 */ void (*LMAN_callback)(u8 msg, u8 paramCount);
- /* 0x044 */ void (*MSC_callback)(u16 REQ_commandID);
+ /* 0x040 */ void (*LMAN_callback)(u8, u8);
+ /* 0x044 */ void (*MSC_callback)(u16);
} LINK_MANAGER;
extern struct linkManagerTag lman;
diff --git a/include/battle.h b/include/battle.h
index e4b773089..8dad6bc25 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -124,8 +124,8 @@ struct ProtectStruct
u32 flinchImmobility:1;
u32 notFirstStrike:1;
u32 palaceUnableToUseMove:1;
- s32 physicalDmg;
- s32 specialDmg;
+ u32 physicalDmg;
+ u32 specialDmg;
u8 physicalBattlerId;
u8 specialBattlerId;
};
@@ -254,7 +254,7 @@ struct BattleResults
u16 playerMon2Species; // 0x26
u16 caughtMonSpecies; // 0x28
u8 caughtMonNick[POKEMON_NAME_LENGTH + 1]; // 0x2A
- u8 filler35; // 0x35
+ u8 filler35; // 0x35
u8 catchAttempts[11]; // 0x36
};
diff --git a/include/battle_message.h b/include/battle_message.h
index af090a06c..011a1cb0c 100644
--- a/include/battle_message.h
+++ b/include/battle_message.h
@@ -145,7 +145,7 @@
{ \
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
textVar[1] = B_BUFF_STRING; \
- textVar[2] = (stringId & 0xFF); \
+ textVar[2] = stringId; \
textVar[3] = (stringId & 0xFF00) >> 8; \
textVar[4] = B_BUFF_EOS; \
}
diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h
index 378197a4d..004df7155 100644
--- a/include/constants/battle_pyramid.h
+++ b/include/constants/battle_pyramid.h
@@ -7,6 +7,16 @@
#define FLOOR_WALKABLE_METATILE 0x28D
#define FLOOR_EXIT_METATILE 0x28E
+#define HINT_EXIT_DIRECTION 0
+#define HINT_REMAINING_ITEMS 1
+#define HINT_REMAINING_TRAINERS 2
+#define HINT_EXIT_SHORT_REMAINING_TRAINERS 3
+#define HINT_EXIT_SHORT_REMAINING_ITEMS 4
+#define HINT_EXIT_MEDIUM_REMAINING_TRAINERS 5
+#define HINT_EXIT_MEDIUM_REMAINING_ITEMS 6
+#define HINT_EXIT_FAR_REMAINING_TRAINERS 7
+#define HINT_EXIT_FAR_REMAINING_ITEMS 8
+
#define OBJ_TRAINERS 0
#define OBJ_ITEMS 1
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index bdff1b865..e2836c6f6 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -140,13 +140,55 @@ struct SoundChannel
struct WaveData *wav;
u32 cp;
struct MusicPlayerTrack *track;
- void *pp;
- void *np;
- void *d4;
+ u32 pp;
+ u32 np;
+ u32 d4;
u16 xpi;
u16 xpc;
};
+#define MAX_DIRECTSOUND_CHANNELS 12
+
+#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer
+
+struct SoundInfo
+{
+ // This field is normally equal to ID_NUMBER but it is set to other
+ // values during sensitive operations for locking purposes.
+ // This field should be volatile but isn't. This could potentially cause
+ // race conditions.
+ u32 ident;
+
+ vu8 pcmDmaCounter;
+
+ // Direct Sound
+ u8 reverb;
+ u8 maxChans;
+ u8 masterVolume;
+ u8 freq;
+
+ u8 mode;
+ u8 c15;
+ u8 pcmDmaPeriod; // number of V-blanks per PCM DMA
+ u8 maxLines;
+ u8 gap[3];
+ s32 pcmSamplesPerVBlank;
+ s32 pcmFreq;
+ s32 divFreq;
+ struct CgbChannel *cgbChans;
+ u32 func;
+ u32 intp;
+ void (*CgbSound)(void);
+ void (*CgbOscOff)(u8);
+ u32 (*MidiKeyToCgbFreq)(u8, u8, u8);
+ u32 MPlayJumpTable;
+ u32 plynote;
+ u32 ExtVolPit;
+ u8 gap2[16];
+ struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS];
+ s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2];
+};
+
struct SongHeader
{
u8 trackCount;
@@ -270,7 +312,7 @@ struct MusicPlayerInfo
struct MusicPlayerTrack *tracks;
struct ToneData *tone;
u32 ident;
- void (*func)();
+ u32 func;
u32 intp;
};
@@ -292,47 +334,7 @@ struct Song
extern const struct MusicPlayer gMPlayTable[];
extern const struct Song gSongTable[];
-#define MAX_DIRECTSOUND_CHANNELS 12
-
-#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer
-
-struct SoundInfo
-{
- // This field is normally equal to ID_NUMBER but it is set to other
- // values during sensitive operations for locking purposes.
- // This field should be volatile but isn't. This could potentially cause
- // race conditions.
- u32 ident;
-
- vu8 pcmDmaCounter;
-
- // Direct Sound
- u8 reverb;
- u8 maxChans;
- u8 masterVolume;
- u8 freq;
- u8 mode;
- u8 c15;
- u8 pcmDmaPeriod; // number of V-blanks per PCM DMA
- u8 maxLines;
- u8 gap[3];
- s32 pcmSamplesPerVBlank;
- s32 pcmFreq;
- s32 divFreq;
- struct CgbChannel *cgbChans;
- void (*func)();
- u32 intp;
- void (*CgbSound)();
- void (*CgbOscOff)(u8);
- u32 (*MidiKeyToCgbFreq)(u8, u8, u8);
- void (**MPlayJumpTable)();
- void (*plynote)(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *);
- void (*ExtVolPit)(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
- u32 gap2[4];
- struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS];
- s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2];
-};
extern u8 gMPlayMemAccArea[];
@@ -446,7 +448,7 @@ void ply_tune(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_port(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_xcmd(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_endtie(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
-void ply_note(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *);
+void ply_note(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
// extended sound command handler functions
void ply_xxx(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
diff --git a/include/global.h b/include/global.h
index f5781bcb4..85166e0ec 100644
--- a/include/global.h
+++ b/include/global.h
@@ -98,7 +98,7 @@
#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr)
// Macros for checking the joypad
-#define TEST_BUTTON(field, button) ((field) & (button))
+#define TEST_BUTTON(field, button) ({(field) & (button);})
#define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button)
#define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button)
#define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button)
diff --git a/include/list_menu.h b/include/list_menu.h
index 4697ba5aa..0a54a069a 100644
--- a/include/list_menu.h
+++ b/include/list_menu.h
@@ -24,7 +24,7 @@ struct ListMenu;
struct ListMenuItem
{
const u8 *name;
- u32 id;
+ s32 id;
};
struct ListMenuTemplate
@@ -98,7 +98,7 @@ struct CursorStruct
extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
-u32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
+s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);
s32 ListMenu_ProcessInput(u8 listTaskId);
diff --git a/include/pokemon.h b/include/pokemon.h
index 81c17f545..a956b9c40 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -127,8 +127,8 @@ struct Unknown_806F160_Struct
u32 field_0_1:4;
u32 field_1:8;
u16 magic:8;
- u32 size:4;
- u16 field_3_1:4;
+ u32 field_3_0:4;
+ u32 field_3_1:4;
void *bytes;
u8 **byteArrays;
struct SpriteTemplate *templates;