summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2019-03-30 14:36:52 -0400
committerhuderlem <huderlem@gmail.com>2019-03-31 15:43:51 -0500
commitaafe9df454f42c77146d76676cc477e876d6540b (patch)
tree2152f6a098ed59908f7d1d870c9381c60bc5eb44 /src
parentf34cda3b5209735fbf276b0f23e29549b1a1a3d9 (diff)
through sub_8018798
Diffstat (limited to 'src')
-rw-r--r--src/cable_club.c3
-rwxr-xr-xsrc/ereader_helpers.c2
-rwxr-xr-xsrc/ereader_screen.c2
-rw-r--r--src/link_rfu.c4
-rw-r--r--src/mevent_801BAAC.c1
-rw-r--r--src/mystery_gift.c245
-rwxr-xr-xsrc/party_menu.c2
-rw-r--r--src/start_menu.c1
-rw-r--r--src/trade.c3
-rw-r--r--src/union_room.c4
10 files changed, 256 insertions, 11 deletions
diff --git a/src/cable_club.c b/src/cable_club.c
index b80e76e99..fab187b07 100644
--- a/src/cable_club.c
+++ b/src/cable_club.c
@@ -17,7 +17,8 @@
#include "menu.h"
#include "overworld.h"
#include "palette.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
+#include "mevent2.h"
#include "script.h"
#include "script_pokemon_util_80F87D8.h"
#include "sound.h"
diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c
index 6c92b676f..cdb829ac8 100755
--- a/src/ereader_helpers.c
+++ b/src/ereader_helpers.c
@@ -4,7 +4,7 @@
#include "ereader_helpers.h"
#include "link.h"
#include "main.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "save.h"
#include "sprite.h"
#include "task.h"
diff --git a/src/ereader_screen.c b/src/ereader_screen.c
index b15c1fd0c..10a23e251 100755
--- a/src/ereader_screen.c
+++ b/src/ereader_screen.c
@@ -4,7 +4,7 @@
#include "ereader_helpers.h"
#include "link.h"
#include "main.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "save.h"
#include "sound.h"
#include "sprite.h"
diff --git a/src/link_rfu.c b/src/link_rfu.c
index 945806459..43d19be03 100644
--- a/src/link_rfu.c
+++ b/src/link_rfu.c
@@ -11,13 +11,13 @@
#include "overworld.h"
#include "random.h"
#include "palette.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "string_util.h"
#include "task.h"
#include "text.h"
#include "constants/species.h"
#include "save.h"
-#include "rom_8011DC0.h"
+#include "mystery_gift.h"
extern u16 gHeldKeyCodeToSend;
diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c
index 857ca3fde..d69ab0495 100644
--- a/src/mevent_801BAAC.c
+++ b/src/mevent_801BAAC.c
@@ -13,6 +13,7 @@
#include "string_util.h"
#include "link_rfu.h"
#include "mevent.h"
+#include "mystery_gift.h"
struct UnkStruct_8467FB8
{
diff --git a/src/mystery_gift.c b/src/mystery_gift.c
index b6c317281..3fbe11378 100644
--- a/src/mystery_gift.c
+++ b/src/mystery_gift.c
@@ -8,16 +8,24 @@
#include "text_window.h"
#include "bg.h"
#include "window.h"
+#include "strings.h"
#include "text_window.h"
#include "menu.h"
#include "palette.h"
#include "constants/songs.h"
#include "sound.h"
#include "mystery_gift.h"
+#include "union_room.h"
+#include "title_screen.h"
+#include "ereader_screen.h"
+#include "international_string_util.h"
+#include "list_menu.h"
void bgid_upload_textbox_1(u8 bgId);
-void sub_8018798(u8);
-void sub_80186EC(u8, u8);
+void task_add_00_mystery_gift(void);
+
+EWRAM_DATA u8 gUnknown_02022C58 = 0;
+EWRAM_DATA u8 gUnknown_02022C59 = 0;
const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal");
const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz");
@@ -168,6 +176,158 @@ const struct WindowTemplate gUnknown_082F0600 = {
.baseBlock = 0x0155
};
+const struct ListMenuItem gUnknown_082F0608[] = {
+ { gText_WonderCards, 0 },
+ { gText_WonderNews, 1 },
+ { gText_Exit3, -2 }
+};
+
+const struct ListMenuItem gUnknown_082F0620[] = {
+ { gText_WirelessCommunication, 0 },
+ { gText_Friend2, 1 },
+ { gText_Cancel2, -2 }
+};
+
+const struct ListMenuTemplate gUnknown_082F0638 = {
+ .items = NULL,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 3,
+ .maxShowed = 3,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+const struct ListMenuItem gUnknown_082F0650[] = {
+ { gText_Receive, 0 },
+ { gText_Send, 1 },
+ { gText_Toss, 2 },
+ { gText_Cancel2, -2 }
+};
+
+const struct ListMenuItem gUnknown_082F0670[] = {
+ { gText_Receive, 0 },
+ { gText_Toss, 2 },
+ { gText_Cancel2, -2 }
+};
+
+const struct ListMenuItem gUnknown_082F0688[] = {
+ { gText_Receive, 0 },
+ { gText_Send, 1 },
+ { gText_Cancel2, -2 }
+};
+
+const struct ListMenuItem gUnknown_082F06A0[] = {
+ { gText_Receive, 0 },
+ { gText_Cancel2, -2 }
+};
+
+const struct ListMenuTemplate gUnknown_082F06B0 = {
+ .items = gUnknown_082F0650,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 4,
+ .maxShowed = 4,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+const struct ListMenuTemplate gUnknown_082F06C8 = {
+ .items = gUnknown_082F0670,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 3,
+ .maxShowed = 3,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+const struct ListMenuTemplate gUnknown_082F06E0 = {
+ .items = gUnknown_082F0688,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 3,
+ .maxShowed = 3,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+const struct ListMenuTemplate gUnknown_082F06F8 = {
+ .items = gUnknown_082F06A0,
+ .moveCursorFunc = ListMenuDefaultCursorMoveFunc,
+ .itemPrintFunc = NULL,
+ .totalItems = 2,
+ .maxShowed = 2,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 1,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = 0,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = 0,
+ .fontId = 1,
+ .cursorKind = 0
+};
+
+const u8 *const Unref_082F0710[] = {
+ gText_VarietyOfEventsImportedWireless,
+ gText_WonderCardsInPossession,
+ gText_ReadNewsThatArrived,
+ gText_ReturnToTitle
+};
+
+ALIGNED(2) const u8 gUnknown_082F0720[] = { 0, 1, 2 };
+ALIGNED(2) const u8 gUnknown_082F0724[] = { 0, 1, 2 };
+ALIGNED(2) const u8 gUnknown_082F0728[] = { 1, 2, 3 };
+
void sub_8018424(void)
{
ProcessSpriteCopyRequests();
@@ -251,3 +411,84 @@ bool32 sub_8018450(s32 arg)
return FALSE;
}
+
+void c2_mystery_gift(void)
+{
+ if (sub_8018450(0))
+ {
+ SetMainCallback2(sub_8018438);
+ gUnknown_02022C60 = FALSE;
+ task_add_00_mystery_gift();
+ }
+ RunTasks();
+}
+
+void sub_801867C(void)
+{
+ if (sub_8018450(1))
+ {
+ SetMainCallback2(sub_8018438);
+ gUnknown_02022C60 = TRUE;
+ sub_81D5014();
+ }
+}
+
+void sub_80186A4(void)
+{
+ gUnknown_02022C60 = FALSE;
+ FreeAllWindowBuffers();
+ Free(GetBgTilemapBuffer(0));
+ Free(GetBgTilemapBuffer(1));
+ Free(GetBgTilemapBuffer(2));
+ Free(GetBgTilemapBuffer(3));
+ SetMainCallback2(CB2_InitTitleScreen);
+}
+
+void sub_80186EC(bool8 isJapanese, bool32 usePickOkCancel)
+{
+ const u8 * header;
+ const u8 * options;
+ FillWindowPixelBuffer(0, 0);
+ if (!isJapanese)
+ {
+ header = gText_MysteryGift;
+ options = !usePickOkCancel ? gText_PickOKExit : gText_PickOKCancel;
+ }
+ else
+ {
+ header = gJPText_MysteryGift;
+ options = gJPText_DecideStop;
+ }
+
+ AddTextPrinterParameterized4(0, 1, 4, 1, 0, 0, gUnknown_082F0720, -1, header);
+ AddTextPrinterParameterized4(0, 0, GetStringRightAlignXOffset(0, options, 0xDE), 1, 0, 0, gUnknown_082F0720, -1, options);
+ CopyWindowToVram(0, 2);
+ PutWindowTilemap(0);
+}
+
+void sub_8018784(u8 windowId)
+{
+ sub_8098858(windowId, 0x01, 0xF);
+}
+
+void sub_8018798(u32 bg)
+{
+ s32 i = 0, j;
+
+ FillBgTilemapBufferRect(bg, 0x003, 0, 0, 32, 2, 0x11);
+
+ for (i = 0; i < 18; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ if ((i & 1) != (j & 1))
+ {
+ FillBgTilemapBufferRect(bg, 1, j, i + 2, 1, 1, 0x11);
+ }
+ else
+ {
+ FillBgTilemapBufferRect(bg, 2, j, i + 2, 1, 1, 0x11);
+ }
+ }
+ }
+}
diff --git a/src/party_menu.c b/src/party_menu.c
index 7db24b6ca..6233558ff 100755
--- a/src/party_menu.c
+++ b/src/party_menu.c
@@ -49,7 +49,7 @@
#include "pokemon_summary_screen.h"
#include "region_map.h"
#include "reshow_battle_screen.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "scanline_effect.h"
#include "script.h"
#include "sound.h"
diff --git a/src/start_menu.c b/src/start_menu.c
index 4822c12e6..f573f9bdf 100644
--- a/src/start_menu.c
+++ b/src/start_menu.c
@@ -44,6 +44,7 @@
#include "window.h"
#include "constants/songs.h"
#include "rom_8011DC0.h"
+#include "union_room.h"
// Menu actions
enum
diff --git a/src/trade.c b/src/trade.c
index df8f493f1..34f49060f 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -19,6 +19,8 @@
#include "load_save.h"
#include "mail.h"
#include "main.h"
+#include "mevent2.h"
+#include "mystery_gift.h"
#include "overworld.h"
#include "palette.h"
#include "party_menu.h"
@@ -39,6 +41,7 @@
#include "text_window.h"
#include "trainer_card.h"
#include "trade.h"
+#include "union_room.h"
#include "util.h"
#include "window.h"
#include "constants/easy_chat.h"
diff --git a/src/union_room.c b/src/union_room.c
index 5050b04f1..df0137379 100644
--- a/src/union_room.c
+++ b/src/union_room.c
@@ -40,7 +40,7 @@
#include "strings.h"
#include "mevent.h"
#include "dynamic_placeholder_text_util.h"
-#include "rom_8011DC0.h"
+#include "union_room.h"
#include "easy_chat.h"
#include "event_obj_lock.h"
#include "union_room_chat.h"
@@ -102,8 +102,6 @@ void sub_802493C(u8 monId, MainCallback callback);
void sub_80149D8(void);
u16 sub_8019930(void);
void sub_8018784(u8 windowId);
-void sub_8018884(const u8 *src);
-bool32 mevent_0814257C(u8 *textState, const u8 *str);
s8 sub_8018B08(u8 *textState, u8 *arg1, u8 arg2, const u8 *str);
bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1);
u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2);