mirror of
https://github.com/pret/pokefirered.git
synced 2026-05-09 04:23:14 -05:00
commit
bc0fe11d16
|
|
@ -5484,7 +5484,7 @@ sub_810A9D4: @ 810A9D4
|
|||
mov r2, r8
|
||||
ldrh r1, [r2, 0x10]
|
||||
movs r2, 0x2
|
||||
bl sub_809C09C
|
||||
bl RecordItemPurchase
|
||||
mov r3, r8
|
||||
ldrb r0, [r3]
|
||||
ldr r4, _0810AAE4 @ =gUnknown_203ACFC
|
||||
|
|
|
|||
3563
asm/shop.s
3563
asm/shop.s
File diff suppressed because it is too large
Load Diff
|
|
@ -14008,17 +14008,17 @@ gBerryPouchSpritePalette:: @ 8E85C1C
|
|||
gBerryPouchBg1Tilemap:: @ 8E85C44
|
||||
.incbin "graphics/berry_pouch/unk_8E85C44.bin.lz"
|
||||
|
||||
gUnknown_8E85DC8:: @ 8E85DC8
|
||||
.incbin "baserom.gba", 0xE85DC8, 0x134
|
||||
gBuyMenuFrame_Gfx:: @ 8E85DC8
|
||||
.incbin "graphics/shop_menu/shop_menu.4bpp.lz"
|
||||
|
||||
gUnknown_8E85EFC:: @ 8E85EFC
|
||||
.incbin "baserom.gba", 0xE85EFC, 0x13C
|
||||
gBuyMenuFrame_Tilemap:: @ 8E85EFC
|
||||
.incbin "graphics/shop_menu/shop_tilemap.bin"
|
||||
|
||||
gUnknown_8E86038:: @ 8E86038
|
||||
.incbin "baserom.gba", 0xE86038, 0x138
|
||||
gBuyMenuFrame_TmHmTilemap:: @ 8E86038
|
||||
.incbin "graphics/shop_menu/shop_tm_hm_tilemap.bin"
|
||||
|
||||
gUnknown_8E86170:: @ 8E86170
|
||||
.incbin "baserom.gba", 0xE86170, 0x38
|
||||
gBuyMenuFrame_Pal:: @ 8E86170
|
||||
.incbin "graphics/shop_menu/shop_menu.gbapal.lz"
|
||||
|
||||
gUnknown_8E861A8:: @ 8E861A8
|
||||
.incbin "baserom.gba", 0xE861A8, 0x98
|
||||
|
|
|
|||
92
data/shop.s
92
data/shop.s
|
|
@ -1,92 +0,0 @@
|
|||
#include "constants/maps.h"
|
||||
#include "constants/species.h"
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnknown_83DF09C:: @ 83DF09C
|
||||
.4byte gUnknown_8416738, sub_809AC5C
|
||||
.4byte gUnknown_841673C, sub_809AC98
|
||||
.4byte gUnknown_8416741, sub_809ACF8
|
||||
|
||||
gUnknown_83DF0B4:: @ 83DF0B4
|
||||
.4byte sub_809BEA4
|
||||
.4byte sub_809BF98
|
||||
|
||||
gUnknown_83DF0BC:: @ 83DF0BC
|
||||
.byte 0, 2, 1, 12, 6, 15
|
||||
.2byte 0x0008
|
||||
@ {
|
||||
@ .bg = 0,
|
||||
@ .tilemapLeft = 2,
|
||||
@ .tilemapTop = 1,
|
||||
@ .width = 12,
|
||||
@ .height = 6,
|
||||
@ .paletteNum = 15,
|
||||
@ .baseBlock = 0x0008
|
||||
@ }
|
||||
|
||||
gUnknown_83DF0C4:: @ 83DF0C4
|
||||
.4byte 0x000001f8
|
||||
@ {
|
||||
@ .bg = 0,
|
||||
@ .charBaseIndex = 2,
|
||||
@ .mapBaseIndex = 31,
|
||||
@ .screenSize = 0,
|
||||
@ .paletteMode = 0,
|
||||
@ .priority = 0,
|
||||
@ .baseTile = 0x0000
|
||||
@ }
|
||||
.4byte 0x000011e1
|
||||
@ {
|
||||
@ .bg = 1,
|
||||
@ .charBaseIndex = 0,
|
||||
@ .mapBaseIndex = 30,
|
||||
@ .screenSize = 0,
|
||||
@ .paletteMode = 0,
|
||||
@ .priority = 1,
|
||||
@ .baseTile = 0x0000
|
||||
@ }
|
||||
.4byte 0x000021d2
|
||||
@ {
|
||||
@ .bg = 2,
|
||||
@ .charBaseIndex = 0,
|
||||
@ .mapBaseIndex = 29,
|
||||
@ .screenSize = 0,
|
||||
@ .paletteMode = 0,
|
||||
@ .priority = 2,
|
||||
@ .baseTile = 0x0000
|
||||
@ }
|
||||
.4byte 0x000031c3
|
||||
@ {
|
||||
@ .bg = 3,
|
||||
@ .charBaseIndex = 0,
|
||||
@ .mapBaseIndex = 28,
|
||||
@ .screenSize = 0,
|
||||
@ .paletteMode = 0,
|
||||
@ .priority = 3,
|
||||
@ .baseTile = 0x0000
|
||||
@ }
|
||||
|
||||
gUnknown_83DF0D4:: @ 83DF0D4
|
||||
.2byte 0x0308, 0x030a, 0x02d0
|
||||
|
||||
gUnknown_83DF0DA:: @ 83DF0DA
|
||||
.2byte 0x0309, 0x030b, 0x02d1
|
||||
|
||||
gUnknown_83DF0E0:: @ 83DF0E0
|
||||
.2byte 0x0310, 0x0312, 0x02d8
|
||||
|
||||
gUnknown_83DF0E6:: @ 83DF0E6
|
||||
.2byte 0x0311, 0x0313, 0x02d9
|
||||
|
||||
gUnknown_83DF0EC:: @ 83DF0EC
|
||||
.2byte 0x02e3, 0x0316, 0x0314
|
||||
|
||||
gUnknown_83DF0F2:: @ 83DF0F2
|
||||
.2byte 0x02e4, 0x0317, 0x0315
|
||||
|
||||
gUnknown_83DF0F8:: @ 83DF0F8
|
||||
.2byte 0x02eb, 0x031e, 0x031c
|
||||
|
|
@ -475,7 +475,7 @@ gUnknown_8416210:: @ 8416210
|
|||
gText_ThreeHyphens:: @ 8416213
|
||||
.string "---$"
|
||||
|
||||
gUnknown_8416217:: @ 8416217
|
||||
gText_SevenHyphens:: @ 8416217
|
||||
.string "-------$"
|
||||
|
||||
gText_MaleSymbol:: @ 841621F
|
||||
|
|
@ -720,26 +720,26 @@ gText_TheBerryPouchWillBePutAway:: @ 8416716
|
|||
.string "The BERRY POUCH will be\n"
|
||||
.string "put away.$"
|
||||
|
||||
gUnknown_8416738:: @ 0x8416738
|
||||
gText_ShopBuy:: @ 0x8416738
|
||||
.string "BUY$"
|
||||
|
||||
gUnknown_841673C:: @ 0x841673C
|
||||
gText_ShopSell:: @ 0x841673C
|
||||
.string "SELL$"
|
||||
|
||||
gUnknown_8416741:: @ 0x8416741
|
||||
gText_ShopQuit:: @ 0x8416741
|
||||
.string "SEE YA!$"
|
||||
|
||||
gUnknown_8416749:: @ 8416749
|
||||
gText_InBagVar1:: @ 8416749
|
||||
.string "IN BAG:{SMALL} {STR_VAR_1}$"
|
||||
|
||||
gUnknown_8416757:: @ 8416757
|
||||
gText_QuitShopping:: @ 8416757
|
||||
.string "Quit shopping.$"
|
||||
|
||||
gUnknown_8416766:: @ 8416766
|
||||
gText_Var1CertainlyHowMany:: @ 8416766
|
||||
.string "{STR_VAR_1}? Certainly.\n"
|
||||
.string "How many would you like?$"
|
||||
|
||||
gUnknown_841678E:: @ 841678E
|
||||
gText_Var1AndYouWantedVar2:: @ 841678E
|
||||
.string "{STR_VAR_1}, and you want {STR_VAR_2}.\n"
|
||||
.string "That will be ¥{STR_VAR_3}. Okay?$"
|
||||
|
||||
|
|
@ -751,7 +751,7 @@ gUnknown_84167D0:: @ 0x84167D0
|
|||
.string "{STR_VAR_1} ですね!\n"
|
||||
.string "{STR_VAR_2}¥ だけど かいますか?$"
|
||||
|
||||
gUnknown_84167E7:: @ 84167E7
|
||||
gText_HereYouGoThankYou:: @ 84167E7
|
||||
.string "Here you are!\n"
|
||||
.string "Thank you!$"
|
||||
|
||||
|
|
@ -763,10 +763,10 @@ gUnknown_8416822:: @ 0x8416822
|
|||
.string "どうも ありがとう!\n"
|
||||
.string "じたくの パソコンに おくって おくね!$"
|
||||
|
||||
gUnknown_8416842:: @ 8416842
|
||||
gText_YouDontHaveMoney:: @ 8416842
|
||||
.string "You don't have enough money.{PAUSE_UNTIL_PRESS}$"
|
||||
|
||||
gUnknown_8416861:: @ 8416861
|
||||
gText_NoMoreRoomForThis:: @ 8416861
|
||||
.string "You have no more room for this\n"
|
||||
.string "item.{PAUSE_UNTIL_PRESS}$"
|
||||
|
||||
|
|
@ -774,7 +774,7 @@ gUnknown_8416888:: @ 0x8416888
|
|||
.string "{STR_VAR_1}を\n"
|
||||
.string "いれる ばしょが いっぱいです{PAUSE_UNTIL_PRESS}$"
|
||||
|
||||
gUnknown_841689E:: @ 841689E
|
||||
gText_CanIHelpWithAnythingElse:: @ 841689E
|
||||
.string "Is there anything else I can do?$"
|
||||
|
||||
gUnknown_84168BF:: @ 0x84168BF
|
||||
|
|
|
|||
35
graphics/shop_menu/shop_menu.pal
Normal file
35
graphics/shop_menu/shop_menu.pal
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
JASC-PAL
|
||||
0100
|
||||
32
|
||||
238 230 172
|
||||
222 156 106
|
||||
255 189 131
|
||||
255 222 164
|
||||
255 255 213
|
||||
238 230 172
|
||||
106 106 106
|
||||
189 213 213
|
||||
238 255 255
|
||||
222 246 255
|
||||
255 255 255
|
||||
164 222 255
|
||||
16 172 222
|
||||
0 82 115
|
||||
0 115 139
|
||||
0 123 197
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
0 0 0
|
||||
189 213 213
|
||||
238 255 255
|
||||
222 246 255
|
||||
255 255 255
|
||||
164 222 255
|
||||
24 82 180
|
||||
0 90 131
|
||||
24 82 180
|
||||
24 82 180
|
||||
BIN
graphics/shop_menu/shop_menu.png
Normal file
BIN
graphics/shop_menu/shop_menu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 261 B |
BIN
graphics/shop_menu/shop_tilemap.bin
Normal file
BIN
graphics/shop_menu/shop_tilemap.bin
Normal file
Binary file not shown.
BIN
graphics/shop_menu/shop_tm_hm_tilemap.bin
Normal file
BIN
graphics/shop_menu/shop_tm_hm_tilemap.bin
Normal file
Binary file not shown.
|
|
@ -16,6 +16,7 @@ extern const struct MapData Route1_Layout;
|
|||
|
||||
u32 MapGridGetMetatileIdAt(int, int);
|
||||
u32 MapGridGetMetatileBehaviorAt(int, int);
|
||||
u8 MapGridGetMetatileLayerTypeAt(s16 x, s16 y);
|
||||
void MapGridSetMetatileIdAt(int, int, u16);
|
||||
void MapGridSetMetatileEntryAt(int, int, u16);
|
||||
void GetCameraCoords(u16*, u16*);
|
||||
|
|
|
|||
|
|
@ -4249,6 +4249,12 @@ extern const u16 gUnknown_8E97DDC[];
|
|||
extern const u32 gUnknown_8E97DFC[];
|
||||
extern const u32 gUnknown_8E97EC4[];
|
||||
|
||||
// shop menu
|
||||
extern const u32 gBuyMenuFrame_Gfx[];
|
||||
extern const u32 gBuyMenuFrame_Tilemap[];
|
||||
extern const u32 gBuyMenuFrame_TmHmTilemap[];
|
||||
extern const u32 gBuyMenuFrame_Pal[];
|
||||
|
||||
// battle_message
|
||||
extern const u16 gUnknown_8D2FBB4[];
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ bool8 AddBagItem(u16 itemId, u16 amount);
|
|||
void SortPocketAndPlaceHMsFirst(struct BagPocket * pocket);
|
||||
u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 itemId);
|
||||
u16 BagGetQuantityByPocketPosition(u8 pocketId, u16 itemId);
|
||||
u16 BagGetQuantityByItemId(u16 item);
|
||||
bool8 itemid_is_unique(u16 itemId);
|
||||
void BagPocketCompaction(struct ItemSlot * slots, u8 capacity);
|
||||
u16 GetPcItemQuantity(u16 *);
|
||||
|
|
|
|||
|
|
@ -30,25 +30,25 @@ struct ListMenu;
|
|||
|
||||
struct ListMenuTemplate
|
||||
{
|
||||
const struct ListMenuItem *items;
|
||||
void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list);
|
||||
void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y);
|
||||
u16 totalItems;
|
||||
u16 maxShowed;
|
||||
u8 windowId;
|
||||
u8 header_X;
|
||||
u8 item_X;
|
||||
u8 cursor_X;
|
||||
u8 upText_Y:4; // x1, x2, x4, x8 = xF
|
||||
u8 cursorPal:4; // x10, x20, x40, x80 = xF0
|
||||
u8 fillValue:4; // x1, x2, x4, x8 = xF
|
||||
u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0
|
||||
u8 lettersSpacing:3;
|
||||
u8 itemVerticalPadding:3;
|
||||
u8 scrollMultiple:2; // x40, x80 = xC0
|
||||
u8 fontId:6; // x1, x2, x4, x8, x10, x20 = x3F
|
||||
u8 cursorKind:2; // x40, x80
|
||||
};
|
||||
/*0x00*/ const struct ListMenuItem *items;
|
||||
/*0x04*/ void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list);
|
||||
/*0x08*/ void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y);
|
||||
/*0x0C*/ u16 totalItems;
|
||||
/*0x0E*/ u16 maxShowed;
|
||||
/*0x10*/ u8 windowId;
|
||||
/*0x11*/ u8 header_X;
|
||||
/*0x12*/ u8 item_X;
|
||||
/*0x13*/ u8 cursor_X;
|
||||
/*0x14*/ u8 upText_Y:4; // x1, x2, x4, x8 = xF
|
||||
u8 cursorPal:4; // x10, x20, x40, x80 = xF0
|
||||
/*0x15*/ u8 fillValue:4; // x1, x2, x4, x8 = xF
|
||||
u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0
|
||||
/*0x16*/ u8 lettersSpacing:3;
|
||||
u8 itemVerticalPadding:3;
|
||||
u8 scrollMultiple:2; // x40, x80 = xC0
|
||||
/*0x17*/ u8 fontId:6; // x1, x2, x4, x8, x10, x20 = x3F
|
||||
u8 cursorKind:2; // x40, x80
|
||||
}; /* size = 0x18 */
|
||||
|
||||
struct ListMenu
|
||||
{
|
||||
|
|
|
|||
12
include/sea_cottage_special_anim.h
Normal file
12
include/sea_cottage_special_anim.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef GUARD_SEA_COTTAGE_SPECIAL_ANIM_H
|
||||
#define GUARD_SEA_COTTAGE_SPECIAL_ANIM_H
|
||||
|
||||
#include "global.h"
|
||||
|
||||
void sub_809C448(u8 a0);
|
||||
void sub_809C460(void);
|
||||
bool8 sub_809C474(void);
|
||||
void sub_809C4A8(void);
|
||||
void sub_809C5FC(void);
|
||||
|
||||
#endif // GUARD_SEA_COTTAGE_SPECIAL_ANIM_H
|
||||
|
|
@ -4,18 +4,20 @@
|
|||
#include "global.h"
|
||||
#include "menu_helpers.h"
|
||||
|
||||
#define INDEX_CANCEL -2
|
||||
|
||||
extern EWRAM_DATA struct ItemSlot gUnknown_02039F80[3];
|
||||
|
||||
void CreatePokemartMenu(const u16 *);
|
||||
void CreatePokemartMenu(const u16 *itemsForSale);
|
||||
void CreateDecorationShop1Menu(const u16 *);
|
||||
void CreateDecorationShop2Menu(const u16 *);
|
||||
void sub_809C09C(u16, u16, u8);
|
||||
u8 sub_809B56C(void);
|
||||
u8 GetMartUnk16_4(void);
|
||||
void RecordItemPurchase(u16 a0, u16 a1, u8 a2);
|
||||
|
||||
// buy_menu_helper
|
||||
void BuyMenuInitWindows(bool32 isSellingTM);
|
||||
void BuyMenuDrawMoneyBox(void);
|
||||
void BuyMenuPrint(u8 windowId, u8 font, const u8 *text, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, s8 speed, u8 color);
|
||||
void BuyMenuPrint(u8 windowId, u8 font, const u8 *text, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 color);
|
||||
void BuyMenuDisplayMessage(u8 taskId, const u8 *text, TaskFunc callback);
|
||||
void BuyMenuQuantityBoxNormalBorder(u8 windowId, bool8 copyToVram);
|
||||
void BuyMenuQuantityBoxThinBorder(u8 windowId, bool8 copyToVram);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ extern const u8 gOtherText_Toss[];
|
|||
extern const u8 gOtherText_Give[];
|
||||
extern const u8 gOtherText_Exit[];
|
||||
extern const u8 gText_ThreeHyphens[];
|
||||
extern const u8 gText_SevenHyphens[];
|
||||
extern const u8 gOtherText_UnkF9_08_Clear_01[];
|
||||
extern const u8 gText_TimesStrVar1[];
|
||||
extern const u8 gText_IsSelected[];
|
||||
|
|
@ -928,4 +929,18 @@ extern const u8 gText_CongratsPkmnEvolved[];
|
|||
extern const u8 gText_EllipsisQuestionMark[];
|
||||
extern const u8 gText_PkmnStoppedEvolving[];
|
||||
|
||||
// shop
|
||||
extern const u8 gText_ShopBuy[];
|
||||
extern const u8 gText_ShopSell[];
|
||||
extern const u8 gText_ShopQuit[];
|
||||
extern const u8 gText_CanIHelpWithAnythingElse[];
|
||||
extern const u8 gText_QuitShopping[];
|
||||
extern const u8 gText_PokedollarVar1[];
|
||||
extern const u8 gText_YouDontHaveMoney[];
|
||||
extern const u8 gText_Var1CertainlyHowMany[];
|
||||
extern const u8 gText_InBagVar1[];
|
||||
extern const u8 gText_Var1AndYouWantedVar2[];
|
||||
extern const u8 gText_HereYouGoThankYou[];
|
||||
extern const u8 gText_NoMoreRoomForThis[];
|
||||
|
||||
#endif //GUARD_STRINGS_H
|
||||
|
|
|
|||
|
|
@ -140,7 +140,8 @@ SECTIONS {
|
|||
src/item_menu_icons.o(.text);
|
||||
src/battle_anim_mon_movement.o(.text);
|
||||
src/item.o(.text);
|
||||
asm/shop.o(.text);
|
||||
src/shop.o(.text);
|
||||
src/sea_cottage_special_anim.o(.text);
|
||||
src/berry.o(.text);
|
||||
src/script_menu.o(.text);
|
||||
asm/naming_screen.o(.text);
|
||||
|
|
@ -441,7 +442,8 @@ SECTIONS {
|
|||
src/item_menu_icons.o(.rodata);
|
||||
src/battle_anim_mon_movement.o(.rodata);
|
||||
src/item.o(.rodata);
|
||||
data/shop.o(.rodata);
|
||||
src/shop.o(.rodata);
|
||||
src/sea_cottage_special_anim.o(.rodata);
|
||||
src/berry.o(.rodata);
|
||||
src/script_menu.o(.rodata);
|
||||
data/naming_screen.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -1384,7 +1384,7 @@ static void Task_SellBerries_PlaySfxAndRemoveBerries(u8 taskId)
|
|||
PlaySE(SE_SHOP);
|
||||
RemoveBagItem(gSpecialVar_ItemId, data[8]);
|
||||
AddMoney(&gSaveBlock1Ptr->money, itemid_get_market_price(gSpecialVar_ItemId) / 2 * data[8]);
|
||||
sub_809C09C(gSpecialVar_ItemId, data[8], 2);
|
||||
RecordItemPurchase(gSpecialVar_ItemId, data[8], 2);
|
||||
DestroyListMenuTask(data[0], &sStaticCnt.listMenuScrollOffset, &sStaticCnt.listMenuSelectedRow);
|
||||
SortAndCountBerries();
|
||||
SanitizeListMenuSelectionParams();
|
||||
|
|
|
|||
|
|
@ -177,14 +177,14 @@ void BuyMenuDrawMoneyBox(void)
|
|||
PrintMoneyAmountInMoneyBoxWithBorder(0, 0xA, 0xF, GetMoney(&gSaveBlock1Ptr->money));
|
||||
}
|
||||
|
||||
void BuyMenuPrint(u8 windowId, u8 font, const u8 *text, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, s8 speed, u8 color)
|
||||
void BuyMenuPrint(u8 windowId, u8 font, const u8 *text, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 color)
|
||||
{
|
||||
AddTextPrinterParameterized4(windowId, font, x, y, letterSpacing, lineSpacing, sShopBuyMenuTextColors[color], speed, text);
|
||||
}
|
||||
|
||||
void BuyMenuDisplayMessage(u8 taskId, const u8 *text, TaskFunc callback)
|
||||
{
|
||||
DisplayMessageAndContinueTask(taskId, 2, 0x13, 0xE, sub_809B56C(), GetTextSpeedSetting(), text, callback);
|
||||
DisplayMessageAndContinueTask(taskId, 2, 0x13, 0xE, GetMartUnk16_4(), GetTextSpeedSetting(), text, callback);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ u32 MapGridGetMetatileBehaviorAt(s32 x, s32 y)
|
|||
return sub_8058F48(x, y, 0);
|
||||
}
|
||||
|
||||
u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y)
|
||||
u8 MapGridGetMetatileLayerTypeAt(s16 x, s16 y)
|
||||
{
|
||||
return sub_8058F48(x, y, 6);
|
||||
}
|
||||
|
|
|
|||
264
src/sea_cottage_special_anim.c
Normal file
264
src/sea_cottage_special_anim.c
Normal file
|
|
@ -0,0 +1,264 @@
|
|||
#include "global.h"
|
||||
#include "event_data.h"
|
||||
#include "task.h"
|
||||
#include "menu.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "fieldmap.h"
|
||||
#include "field_map_obj.h"
|
||||
#include "field_camera.h"
|
||||
|
||||
static EWRAM_DATA u8 gUnknown_2039984 = 0;
|
||||
|
||||
static void sub_809C1D8(u8 taskId, const s16 *a1, u16 a2);
|
||||
static void sub_809C334(u8 taskId);
|
||||
static void sub_809C500(u8 taskId);
|
||||
static void sub_809C640(u8 taskId);
|
||||
|
||||
static const u16 gUnknown_83DF0D4[] = {0x0308, 0x030a, 0x02d0};
|
||||
static const u16 gUnknown_83DF0DA[] = {0x0309, 0x030b, 0x02d1};
|
||||
static const u16 gUnknown_83DF0E0[] = {0x0310, 0x0312, 0x02d8};
|
||||
static const u16 gUnknown_83DF0E6[] = {0x0311, 0x0313, 0x02d9};
|
||||
static const u16 gUnknown_83DF0EC[] = {0x02e3, 0x0316, 0x0314};
|
||||
static const u16 gUnknown_83DF0F2[] = {0x02e4, 0x0317, 0x0315};
|
||||
static const u16 gUnknown_83DF0F8[] = {0x02eb, 0x031e, 0x031c};
|
||||
|
||||
// Functions
|
||||
static void sub_809C1D8(u8 taskId, const s16 *a1, u16 a2)
|
||||
{
|
||||
s16 r5, r3, r4;
|
||||
s16 i, j;
|
||||
|
||||
r5 = gTasks[taskId].data[4] - 1;
|
||||
r3 = gTasks[taskId].data[5] - 1;
|
||||
r4 = gTasks[taskId].data[1];
|
||||
|
||||
if (gTasks[taskId].data[2] == 0)
|
||||
{
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
s32 id = MapGridGetMetatileIdAt(r5 + j, r3 + i);
|
||||
|
||||
if (a1[r4] == (s16)id)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + j, r3 + i, a2 | a1[r4 + 1]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + j, r3 + i, a2 | a1[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
s32 id = MapGridGetMetatileIdAt(r5 + j, r3 + i);
|
||||
|
||||
if (a1[2 - r4] == (s16)id)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + j, r3 + i, a2 | a1[1 - r4]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + j, r3 + i, a2 | a1[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_809C334(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 v1;
|
||||
|
||||
data[3] = 1;
|
||||
switch (data[0])
|
||||
{
|
||||
case 0:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0D4, 0);
|
||||
break;
|
||||
case 1:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0DA, 0);
|
||||
break;
|
||||
case 2:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0E0, 0xC00);
|
||||
break;
|
||||
case 3:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0E6, 0);
|
||||
break;
|
||||
case 4:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0EC, 0xC00);
|
||||
break;
|
||||
case 5:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0F2, 0);
|
||||
break;
|
||||
case 6:
|
||||
sub_809C1D8(taskId, gUnknown_83DF0F8, 0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
data[0] = (data[0] + 1) & 7;
|
||||
v1 = data[0] & 7;
|
||||
if (v1 == 0)
|
||||
{
|
||||
DrawWholeMapView();
|
||||
data[1] = (data[1] + 1) % 3;
|
||||
data[3] = v1;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_809C3FC(u16 a0)
|
||||
{
|
||||
u8 taskId;
|
||||
s16 *data;
|
||||
|
||||
taskId = CreateTask(sub_809C334, 0);
|
||||
data = gTasks[taskId].data;
|
||||
PlayerGetDestCoords(&data[4], &data[5]);
|
||||
data[0] = 0;
|
||||
data[1] = 0;
|
||||
data[2] = a0;
|
||||
sub_809C334(taskId);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
void sub_809C448(u8 a0)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
taskId = sub_809C3FC(a0);
|
||||
gUnknown_2039984 = taskId;
|
||||
}
|
||||
|
||||
void sub_809C460(void)
|
||||
{
|
||||
DestroyTask(gUnknown_2039984);
|
||||
}
|
||||
|
||||
bool8 sub_809C474(void)
|
||||
{
|
||||
if (gTasks[gUnknown_2039984].data[3] == 0)
|
||||
{
|
||||
if (gTasks[gUnknown_2039984].data[1] != 2)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// special 0x1b5 - creates a tile animaiton one block left two-four up the player
|
||||
void sub_809C4A8(void)
|
||||
{
|
||||
u8 taskId;
|
||||
s16 *data;
|
||||
|
||||
taskId = CreateTask(sub_809C500, 0);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = 0;
|
||||
data = gTasks[taskId].data;
|
||||
PlayerGetDestCoords(&data[2], &data[3]);
|
||||
if (gSpecialVar_0x8004 == 0)
|
||||
{
|
||||
gTasks[taskId].data[2] += 6;
|
||||
gTasks[taskId].data[3] -= 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTasks[taskId].data[2]--;
|
||||
gTasks[taskId].data[3] -= 5;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_809C500(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (data[0] == 0)
|
||||
{
|
||||
if ((data[1] & 1) == 0)
|
||||
{
|
||||
MapGridSetMetatileIdAt(data[2], data[3], 0xEB5);
|
||||
MapGridSetMetatileIdAt(data[2], data[3] + 2, 0xEB7);
|
||||
}
|
||||
else
|
||||
{
|
||||
MapGridSetMetatileIdAt(data[2], data[3], 0xEB6);
|
||||
MapGridSetMetatileIdAt(data[2], data[3] + 2, 0xEB8);
|
||||
}
|
||||
CurrentMapDrawMetatileAt(data[2], data[3]);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3] + 2);
|
||||
}
|
||||
|
||||
data[0]++;
|
||||
if (data[0] != 0x10)
|
||||
return;
|
||||
|
||||
data[0] = 0;
|
||||
data[1]++;
|
||||
if (data[1] != 0xD)
|
||||
return;
|
||||
|
||||
MapGridSetMetatileIdAt(data[2], data[3], 0xE8A);
|
||||
MapGridSetMetatileIdAt(data[2], data[3] + 2, 0xE96);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3]);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3] + 2);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
// special 0x1B7 - creates a tile animation two-six blocks right from the top-left corner of the screen
|
||||
void sub_809C5FC(void)
|
||||
{
|
||||
u8 taskId;
|
||||
s16 *data;
|
||||
|
||||
taskId = CreateTask(sub_809C640, 0);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = 0;
|
||||
data = gTasks[taskId].data;
|
||||
PlayerGetDestCoords(&data[2], &data[3]);
|
||||
gTasks[taskId].data[2] += 4;
|
||||
gTasks[taskId].data[3] -= 5;
|
||||
}
|
||||
|
||||
static void sub_809C640(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (data[0] == 0)
|
||||
{
|
||||
if (data[1] != 0)
|
||||
{
|
||||
MapGridSetMetatileIdAt(data[2], data[3], 0xE85);
|
||||
MapGridSetMetatileIdAt(data[2], data[3] + 1, 0xEB4);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3]);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3] + 1);
|
||||
if (data[1] == 4)
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
data[2]--;
|
||||
}
|
||||
MapGridSetMetatileIdAt(data[2], data[3], 0xEB9);
|
||||
MapGridSetMetatileIdAt(data[2], data[3] + 1, 0xEBA);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3]);
|
||||
CurrentMapDrawMetatileAt(data[2], data[3] + 1);
|
||||
}
|
||||
|
||||
data[0]++;
|
||||
if (data[0] == 4)
|
||||
{
|
||||
data[0] = 0;
|
||||
data[1]++;
|
||||
}
|
||||
}
|
||||
|
||||
1161
src/shop.c
Normal file
1161
src/shop.c
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -1107,7 +1107,7 @@ static void Task_DoSaleOfTMs(u8 taskId)
|
|||
PlaySE(SE_SHOP);
|
||||
RemoveBagItem(gSpecialVar_ItemId, data[8]);
|
||||
AddMoney(&gSaveBlock1Ptr->money, itemid_get_market_price(gSpecialVar_ItemId) / 2 * data[8]);
|
||||
sub_809C09C(gSpecialVar_ItemId, data[8], 2);
|
||||
RecordItemPurchase(gSpecialVar_ItemId, data[8], 2);
|
||||
DestroyListMenuTask(data[0], &sTMCaseStaticResources.scrollOffset, &sTMCaseStaticResources.selectedRow);
|
||||
TMCaseSetup_GetTMCount();
|
||||
TMCaseSetup_InitListMenuPositions();
|
||||
|
|
|
|||
|
|
@ -306,48 +306,10 @@ gUnknown_2039874: @ 2039874
|
|||
gBagPockets: @ 203988C
|
||||
.space 0x28
|
||||
|
||||
gUnknown_20398B4: @ 20398B4
|
||||
.space 0x4
|
||||
|
||||
gUnknown_20398B8: @ 20398B8
|
||||
.space 0x2
|
||||
|
||||
gUnknown_20398BA: @ 20398BA
|
||||
.space 0x7A
|
||||
|
||||
gUnknown_2039934: @ 2039934
|
||||
.space 0xE
|
||||
|
||||
gUnknown_2039942: @ 2039942
|
||||
.space 0xE
|
||||
|
||||
gUnknown_2039950: @ 2039950
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039954: @ 2039954
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039958: @ 2039958
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203995C: @ 203995C
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039960: @ 2039960
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039964: @ 2039964
|
||||
.space 0x4
|
||||
|
||||
gUnknown_2039968: @ 2039968
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203996C: @ 203996C
|
||||
.space 0x18
|
||||
|
||||
gUnknown_2039984: @ 2039984
|
||||
.space 0x4
|
||||
|
||||
.align 2
|
||||
.include "src/shop.o"
|
||||
.align 2
|
||||
.include "src/sea_cottage_special_anim.o"
|
||||
.align 2
|
||||
.include "src/script_menu.o"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user