diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-04-25 20:35:26 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-04-25 20:35:26 -0400 |
commit | 76a421f6f1787c013e8f8ba4403f5b995c648c41 (patch) | |
tree | 15d956c3e33233179b7e59ccea37b0e47a59376d | |
parent | d3057e7ae686750f561a6b23552a072f53dd8f63 (diff) |
Port data from emerald
-rw-r--r-- | asm/list_menu.s | 6 | ||||
-rw-r--r-- | asm/pokedex_screen.s | 8 | ||||
-rw-r--r-- | data/data_83FECCC.s | 52 | ||||
-rw-r--r-- | data/mystery_gift_menu.s | 54 | ||||
-rw-r--r-- | include/list_menu.h | 1 | ||||
-rw-r--r-- | ld_script.txt | 1 | ||||
-rw-r--r-- | src/mystery_gift_menu.c | 297 |
7 files changed, 311 insertions, 108 deletions
diff --git a/asm/list_menu.s b/asm/list_menu.s index ac7078053..4615e249b 100644 --- a/asm/list_menu.s +++ b/asm/list_menu.s @@ -1635,8 +1635,8 @@ sub_8107A9C: @ 8107A9C _08107AE8: .4byte gUnknown_3005E60 thumb_func_end sub_8107A9C - thumb_func_start sub_8107AEC -sub_8107AEC: @ 8107AEC + thumb_func_start ListMenuDefaultCursorMoveFunc +ListMenuDefaultCursorMoveFunc: @ 8107AEC push {lr} lsls r1, 24 cmp r1, 0 @@ -1646,7 +1646,7 @@ sub_8107AEC: @ 8107AEC _08107AFA: pop {r0} bx r0 - thumb_func_end sub_8107AEC + thumb_func_end ListMenuDefaultCursorMoveFunc thumb_func_start sub_8107B00 sub_8107B00: @ 8107B00 diff --git a/asm/pokedex_screen.s b/asm/pokedex_screen.s index 68b30e43b..1d0be1b23 100644 --- a/asm/pokedex_screen.s +++ b/asm/pokedex_screen.s @@ -1545,7 +1545,7 @@ sub_810317C: @ 810317C movs r0, 0x1 movs r1, 0xFF bl FillWindowPixelBuffer - ldr r0, _08103234 @ =gUnknown_8415F51 + ldr r0, _08103234 @ =gText_PickOKExit bl sub_8104C2C movs r0, 0 movs r1, 0x2 @@ -1562,7 +1562,7 @@ _08103224: .4byte gUnknown_845216C _08103228: .4byte gUnknown_203ACF0 _0810322C: .4byte gUnknown_8452174 _08103230: .4byte gUnknown_8415F3D -_08103234: .4byte gUnknown_8415F51 +_08103234: .4byte gText_PickOKExit thumb_func_end sub_810317C thumb_func_start sub_8103238 @@ -1874,7 +1874,7 @@ sub_810345C: @ 810345C movs r0, 0x1 movs r1, 0xFF bl FillWindowPixelBuffer - ldr r0, _08103514 @ =gUnknown_8415F51 + ldr r0, _08103514 @ =gText_PickOKExit bl sub_8104C2C movs r0, 0 movs r1, 0x2 @@ -1891,7 +1891,7 @@ _08103504: .4byte gUnknown_845216C _08103508: .4byte gUnknown_203ACF0 _0810350C: .4byte gUnknown_8452174 _08103510: .4byte gUnknown_8415F4A -_08103514: .4byte gUnknown_8415F51 +_08103514: .4byte gText_PickOKExit thumb_func_end sub_810345C thumb_func_start sub_8103518 diff --git a/data/data_83FECCC.s b/data/data_83FECCC.s index dae35f9b3..203b1ee9d 100644 --- a/data/data_83FECCC.s +++ b/data/data_83FECCC.s @@ -644,7 +644,7 @@ gUnknown_8415F3D:: @ 8415F3D gUnknown_8415F4A:: @ 8415F4A .incbin "baserom.gba", 0x415F4A, 0x7 -gUnknown_8415F51:: @ 8415F51 +gText_PickOKExit:: @ 8415F51 .incbin "baserom.gba", 0x415F51, 0x15 gUnknown_8415F66:: @ 8415F66 @@ -2252,10 +2252,10 @@ gUnknown_841D18D:: @ 841D18D gUnknown_841D198:: @ 841D198 .incbin "baserom.gba", 0x41D198, 0xCB8 -gUnknown_841DE50:: @ 841DE50 +gJPText_MysteryGift:: @ 841DE50 .string "$" -gUnknown_841DE51:: @ 841DE51 +gJPText_DecideStop:: @ 841DE51 .string "$" gUnknown_841DE52:: @ 841DE52 @@ -2432,16 +2432,18 @@ gFameCheckerBillName:: @ 841E5F3 gFameCheckerMrFujiName:: @ 841E5F8 .string "FUJI$" -gUnknown_841E5FD:: @ 841E5FD - .string "A variety of events will be imported\nover Wireless Communication.$" +gText_VarietyOfEventsImportedWireless:: @ 841E5FD + .string "A variety of events will be imported\n" + .string "over Wireless Communication.$" -gUnknown_841E63F:: @ 841E63F - .string "Read the WONDER CARDS in your\npossession.$" +gText_WonderCardsInPossession:: @ 841E63F + .string "Read the WONDER CARDS in your\n" + .string "possession.$" -gUnknown_841E669:: @ 841E669 +gText_ReadNewsThatArrived:: @ 841E669 .string "Read the NEWS that arrived.$" -gUnknown_841E685:: @ 841E685 +gText_ReturnToTitle:: @ 841E685 .string "Return to the title screen.$" gUnknown_841E6A1:: @ 841E6A1 @@ -2576,11 +2578,35 @@ gUnknown_841ED7B:: @ 841ED7B gUnknown_841ED9C:: @ 841ED9C .incbin "baserom.gba", 0x41ED9C, 0x21 -gUnknown_841EDBD:: @ 841EDBD - .incbin "baserom.gba", 0x41EDBD, 0xD +gText_MysteryGift:: @ 841EDBD + .string "MYSTERY GIFT$" -gUnknown_841EDCA:: @ 841EDCA - .incbin "baserom.gba", 0x41EDCA, 0x61 +gText_PickOKCancel:: @ 841EDCA + .string "{KEYGFX_DPAD_UP_DOWN}PICK {KEYGFX_A_BUTTON}OK {KEYGFX_B_BUTTON}EXIT$" + +gText_WonderCards:: + .string "WONDER CARDS$" + +gText_WonderNews:: + .string "WONDER NEWS$" + +gText_WirelessCommunication:: + .string "WIRELESS COMMUNICATION$" + +gText_Friend2:: + .string "FRIEND$" + +gText_Exit3:: + .string "EXIT$" + +gText_Receive:: + .string "RECEIVE$" + +gText_Send:: + .string "SEND$" + +gText_Toss:: + .string "TOSS$" gUnknown_841EE2B:: @ 841EE2B .incbin "baserom.gba", 0x41EE2B, 0x17 diff --git a/data/mystery_gift_menu.s b/data/mystery_gift_menu.s deleted file mode 100644 index 7f891e2e5..000000000 --- a/data/mystery_gift_menu.s +++ /dev/null @@ -1,54 +0,0 @@ - .section .rodata - - .align 2 - -sWindowTemplate_PromptYesOrNo_Width28:: @ 8466D90 - .incbin "baserom.gba", 0x466D90, 0x8 - -sWindowTemplate_PromptYesOrNo_Width20:: @ 8466D98 - .incbin "baserom.gba", 0x466D98, 0x8 - -sMysteryGiftMenuWindowTemplate:: @ 8466DA0 - .incbin "baserom.gba", 0x466DA0, 0x8 - -sWindowTemplate_ThreeOptions:: @ 8466DA8 - .incbin "baserom.gba", 0x466DA8, 0x8 - -sWindowTemplate_YesNoBox:: @ 8466DB0 - .incbin "baserom.gba", 0x466DB0, 0x8 - -sWindowTemplate_7by8:: @ 8466DB8 - .incbin "baserom.gba", 0x466DB8, 0x8 - -sWindowTemplate_7by6:: @ 8466DC0 - .incbin "baserom.gba", 0x466DC0, 0x8 - -sWindowTemplate_7by4:: @ 8466DC8 - .incbin "baserom.gba", 0x466DC8, 0x8 - -sListMenuItems_CardsOrNews:: @ 8466DD0 - .incbin "baserom.gba", 0x466DD0, 0x18 - -sListMenuItems_WirelessOrFriend:: @ 8466DE8 - .incbin "baserom.gba", 0x466DE8, 0x18 - -sListMenuTemplate_ThreeOptions:: @ 8466E00 - .incbin "baserom.gba", 0x466E00, 0x78 - -sListMenu_ReceiveSendToss:: @ 8466E78 - .incbin "baserom.gba", 0x466E78, 0x18 - -sListMenu_ReceiveToss:: @ 8466E90 - .incbin "baserom.gba", 0x466E90, 0x18 - -sListMenu_ReceiveSend:: @ 8466EA8 - .incbin "baserom.gba", 0x466EA8, 0x18 - -sListMenu_Receive:: @ 8466EC0 - .incbin "baserom.gba", 0x466EC0, 0x28 - -sMG_Ereader_TextColor_1:: @ 8466EE8 - .incbin "baserom.gba", 0x466EE8, 0x8 - -sMG_Ereader_TextColor_2:: @ 8466EF0 - .incbin "baserom.gba", 0x466EF0, 0x10 diff --git a/include/list_menu.h b/include/list_menu.h index 393872017..8ff65da0b 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -60,5 +60,6 @@ void DestroyListMenu(u8, u16 *, u16 *); u16 ListMenuGetYCoordForPrintingArrowCursor(u8); void sub_8107D38(u8, u8); s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +void ListMenuDefaultCursorMoveFunc(s32, u8, struct ListMenu *); #endif //GUARD_LIST_MENU_H diff --git a/ld_script.txt b/ld_script.txt index 429cc7533..fb24a9060 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -410,7 +410,6 @@ SECTIONS { data/slot_machine.o(.rodata); src/roamer.o(.rodata); src/mystery_gift_menu.o(.rodata); - data/mystery_gift_menu.o(.rodata); src/mevent.o(.rodata); src/mevent_server_helpers.o(.rodata); src/mevent_server.o(.rodata); diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index f7bf7a207..015865592 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -26,8 +26,30 @@ EWRAM_DATA bool8 gGiftIsFromEReader = FALSE; void task_add_00_mystery_gift(void); void task_add_00_ereader(void); -static const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); -static const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); +extern const u8 gText_PickOKExit[]; +extern const u8 gText_PickOKCancel[]; +extern const u8 gText_MysteryGift[]; +extern const u8 gJPText_MysteryGift[]; +extern const u8 gJPText_DecideStop[]; +extern const u8 gText_WhatToDoWithCards[]; +extern const u8 gText_WhatToDoWithNews[]; + +extern const u8 gText_WonderCards[]; +extern const u8 gText_WonderNews[]; +extern const u8 gText_Exit3[]; +extern const u8 gText_WirelessCommunication[]; +extern const u8 gText_Friend2[]; +extern const u8 gFameCheckerText_Cancel[]; +extern const u8 gText_Receive[]; +extern const u8 gText_Send[]; +extern const u8 gText_Toss[]; +extern const u8 gText_VarietyOfEventsImportedWireless[]; +extern const u8 gText_WonderCardsInPossession[]; +extern const u8 gText_ReadNewsThatArrived[]; +extern const u8 gText_ReturnToTitle[]; + +const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); +const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); struct MysteryGiftTaskData { @@ -45,7 +67,7 @@ struct MysteryGiftTaskData u8 * buffer; }; -static const struct BgTemplate sBGTemplates[] = { +const struct BgTemplate sBGTemplates[] = { { .bg = 0, .charBaseIndex = 2, @@ -81,7 +103,7 @@ static const struct BgTemplate sBGTemplates[] = { } }; -static const struct WindowTemplate sMainWindows[] = { +const struct WindowTemplate sMainWindows[] = { { .priority = 0x00, .tilemapLeft = 0x00, @@ -111,23 +133,240 @@ static const struct WindowTemplate sMainWindows[] = { } }; -extern const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width28; -extern const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width20; -extern const struct WindowTemplate sMysteryGiftMenuWindowTemplate; -extern const struct WindowTemplate sWindowTemplate_ThreeOptions; -extern const struct WindowTemplate sWindowTemplate_YesNoBox; -extern const struct WindowTemplate sWindowTemplate_7by8; -extern const struct WindowTemplate sWindowTemplate_7by6; -extern const struct WindowTemplate sWindowTemplate_7by4; -extern const struct ListMenuItem sListMenuItems_CardsOrNews[]; -extern const struct ListMenuItem sListMenuItems_WirelessOrFriend[]; -extern const struct ListMenuTemplate sListMenuTemplate_ThreeOptions; -extern const struct ListMenuTemplate sListMenu_ReceiveSendToss; -extern const struct ListMenuTemplate sListMenu_ReceiveToss; -extern const struct ListMenuTemplate sListMenu_ReceiveSend; -extern const struct ListMenuTemplate sListMenu_Receive; -extern const struct TextColor sMG_Ereader_TextColor_1; -extern const struct TextColor sMG_Ereader_TextColor_2; +const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width28 = { + .priority = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x1c, + .height = 0x04, + .paletteNum = 0x0f, + .baseBlock = 0x00e5 +}; + +const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width20 = { + .priority = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x14, + .height = 0x04, + .paletteNum = 0x0f, + .baseBlock = 0x00e5 +}; + +const struct WindowTemplate sMysteryGiftMenuWindowTemplate = { + .priority = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x13, + .height = 0x04, + .paletteNum = 0x0f, + .baseBlock = 0x00e5 +}; + +const struct WindowTemplate sWindowTemplate_ThreeOptions = { + .priority = 0x00, + .tilemapLeft = 0x08, + .tilemapTop = 0x05, + .width = 0x0e, + .height = 0x05, + .paletteNum = 0x0e, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate sWindowTemplate_YesNoBox = { + .priority = 0x00, + .tilemapLeft = 0x17, + .tilemapTop = 0x0f, + .width = 0x06, + .height = 0x04, + .paletteNum = 0x0e, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate sWindowTemplate_7by8 = { + .priority = 0x00, + .tilemapLeft = 0x16, + .tilemapTop = 0x0c, + .width = 0x07, + .height = 0x07, + .paletteNum = 0x0e, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate sWindowTemplate_7by6 = { + .priority = 0x00, + .tilemapLeft = 0x16, + .tilemapTop = 0x0e, + .width = 0x07, + .height = 0x05, + .paletteNum = 0x0e, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate sWindowTemplate_7by4 = { + .priority = 0x00, + .tilemapLeft = 0x16, + .tilemapTop = 0x0f, + .width = 0x07, + .height = 0x04, + .paletteNum = 0x0e, + .baseBlock = 0x0155 +}; + +const struct ListMenuItem sListMenuItems_CardsOrNews[] = { + { gText_WonderCards, 0 }, + { gText_WonderNews, 1 }, + { gText_Exit3, -2 } +}; + +const struct ListMenuItem sListMenuItems_WirelessOrFriend[] = { + { gText_WirelessCommunication, 0 }, + { gText_Friend2, 1 }, + { gFameCheckerText_Cancel, -2 } +}; + +const struct ListMenuTemplate sListMenuTemplate_ThreeOptions = { + .items = NULL, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 3, + .maxShowed = 3, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 0, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0 +}; + +const struct ListMenuItem sListMenuItems_ReceiveSendToss[] = { + { gText_Receive, 0 }, + { gText_Send, 1 }, + { gText_Toss, 2 }, + { gFameCheckerText_Cancel, -2 } +}; + +const struct ListMenuItem sListMenuItems_ReceiveToss[] = { + { gText_Receive, 0 }, + { gText_Toss, 2 }, + { gFameCheckerText_Cancel, -2 } +}; + +const struct ListMenuItem sListMenuItems_ReceiveSend[] = { + { gText_Receive, 0 }, + { gText_Send, 1 }, + { gFameCheckerText_Cancel, -2 } +}; + +const struct ListMenuItem sListMenuItems_Receive[] = { + { gText_Receive, 0 }, + { gFameCheckerText_Cancel, -2 } +}; + +const struct ListMenuTemplate sListMenu_ReceiveSendToss = { + .items = sListMenuItems_ReceiveSendToss, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 4, + .maxShowed = 4, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 2, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0 +}; + +const struct ListMenuTemplate sListMenu_ReceiveToss = { + .items = sListMenuItems_ReceiveToss, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 3, + .maxShowed = 3, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 0, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0 +}; + +const struct ListMenuTemplate sListMenu_ReceiveSend = { + .items = sListMenuItems_ReceiveSend, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 3, + .maxShowed = 3, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 0, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0 +}; + +const struct ListMenuTemplate sListMenu_Receive = { + .items = sListMenuItems_Receive, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 2, + .maxShowed = 2, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 0, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 2, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0 +}; + +const u8 *const Unref_08366ED8[] = { + gText_VarietyOfEventsImportedWireless, + gText_WonderCardsInPossession, + gText_ReadNewsThatArrived, + gText_ReturnToTitle +}; + +ALIGNED(4) const struct TextColor sMG_Ereader_TextColor_1 = { 0, 1, 2 }; +ALIGNED(4) const struct TextColor sMG_Ereader_TextColor_1_Copy = { 0, 1, 2 }; +ALIGNED(4) const struct TextColor sMG_Ereader_TextColor_2 = { 1, 2, 3 }; + +const u8 gUnknown_8466EF3[] = _("テスト"); +const u8 gUnknown_8466EF7[] = _("むげんのチケット"); void vblankcb_mystery_gift_e_reader_run(void) { @@ -243,14 +482,6 @@ void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void) SetMainCallback2(CB2_InitTitleScreen); } -extern const u8 gUnknown_8415F51[]; -extern const u8 gUnknown_841EDCA[]; -extern const u8 gUnknown_841EDBD[]; -extern const u8 gUnknown_841DE50[]; -extern const u8 gUnknown_841DE51[]; -extern const u8 gText_WhatToDoWithCards[]; -extern const u8 gText_WhatToDoWithNews[]; - void PrintMysteryGiftOrEReaderTopMenu(bool8 mg_or_ereader, bool32 usePickOkCancel) { const u8 * src; @@ -258,15 +489,15 @@ void PrintMysteryGiftOrEReaderTopMenu(bool8 mg_or_ereader, bool32 usePickOkCance FillWindowPixelBuffer(0, 0x00); if (!mg_or_ereader) { - src = usePickOkCancel == TRUE ? gUnknown_8415F51 : gUnknown_841EDCA; - AddTextPrinterParametrized2(0, 2, 2, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gUnknown_841EDBD); + src = usePickOkCancel == TRUE ? gText_PickOKExit : gText_PickOKCancel; + AddTextPrinterParametrized2(0, 2, 2, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gText_MysteryGift); width = 222 - GetStringWidth(0, src, 0); AddTextPrinterParametrized2(0, 0, width, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, src); } else { - AddTextPrinterParametrized2(0, 2, 2, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gUnknown_841DE50); - AddTextPrinterParametrized2(0, 0, 0x78, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gUnknown_841DE51); + AddTextPrinterParametrized2(0, 2, 2, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gJPText_MysteryGift); + AddTextPrinterParametrized2(0, 0, 0x78, 2, 0, 0, &sMG_Ereader_TextColor_1, 0, gJPText_DecideStop); } CopyWindowToVram(0, 2); PutWindowTilemap(0); |