Merge pull request #231 from KDSKardabox/master

Player PC
This commit is contained in:
Marcus Huderle 2018-03-28 21:45:24 -07:00 committed by GitHub
commit a5cd6e8ef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 1522 additions and 3565 deletions

View File

@ -15413,7 +15413,7 @@ sub_81B8448: @ 81B8448
str r0, [sp] str r0, [sp]
ldr r0, =sub_81B1370 ldr r0, =sub_81B1370
str r0, [sp, 0x4] str r0, [sp, 0x4]
ldr r0, =sub_816BB28 ldr r0, =Mailbox_ReturnToMailListAfterDeposit
str r0, [sp, 0x8] str r0, [sp, 0x8]
movs r0, 0 movs r0, 0
movs r1, 0 movs r1, 0
@ -15442,7 +15442,7 @@ sub_81B8474: @ 81B8474
movs r0, 0 movs r0, 0
strb r0, [r1] strb r0, [r1]
ldr r2, =gSaveBlock1Ptr ldr r2, =gSaveBlock1Ptr
ldr r0, =gUnknown_0203BCB8 ldr r0, =playerPCItemPageInfo
ldrh r1, [r0] ldrh r1, [r0]
adds r1, 0x6 adds r1, 0x6
ldrh r0, [r0, 0x2] ldrh r0, [r0, 0x2]

File diff suppressed because it is too large Load Diff

View File

@ -20753,7 +20753,7 @@ sub_81D1C84: @ 81D1C84
ldr r0, [r0, 0x10] ldr r0, [r0, 0x10]
str r0, [sp] str r0, [sp]
str r1, [sp, 0x4] str r1, [sp, 0x4]
ldr r0, =gUnknown_085DFF04 ldr r0, =gMailboxMailOptions
movs r1, 0x4 movs r1, 0x4
bl GetMaxWidthInMenuTable bl GetMaxWidthInMenuTable
lsls r0, 24 lsls r0, 24

View File

@ -1788,7 +1788,7 @@ EventScript_271DBC:: @ 8271DBC
EventScript_271DF9:: @ 8271DF9 EventScript_271DF9:: @ 8271DF9
playse SE_PC_LOGIN playse SE_PC_LOGIN
msgbox gUnknown_082726C2, 4 msgbox gUnknown_082726C2, 4
special sub_816AE98 special PlayerPC
waitstate waitstate
goto EventScript_271DAC goto EventScript_271DAC
end end

View File

@ -1,75 +0,0 @@
#include "constants/items.h"
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnknown_085DFEA4:: @ 85DFEA4
.4byte gText_TakeOutItemsFromPC
.4byte gText_StoreItemsInPC
.4byte gText_ThrowAwayItemsInPC
.4byte gText_GoBackPrevMenu
.align 2
gUnknown_085DFEB4:: @ 85DFEB4
.4byte gText_ItemStorage, task_pc_itemstorage
.4byte gText_Mailbox, sub_816B0A8
.4byte gText_Decoration, sub_816B138
.4byte gText_TurnOff, sub_816B148
.align 2
gUnknown_085DFED4:: @ 85DFED4
.byte 0x00, 0x01, 0x02, 0x03
.align 2
gUnknown_085DFED8:: @ 85DFED8
.byte 0x00, 0x01, 0x03, 0x00
.align 2
gUnknown_085DFEDC:: @ 85DFEDC
.4byte gText_WithdrawItem, sub_816B398
.4byte gText_DepositItem, sub_816B2C8
.4byte gText_TossItem, sub_816B3E4
.4byte gText_Cancel, sub_816B4A4
.align 2
gUnknown_085DFEFC:: @ 85DFEFC
.2byte ITEM_POTION, 0x0001
.2byte 0x0000, 0x0000
.align 2
gUnknown_085DFF04:: @ 85DFF04
.4byte gText_Read, sub_816B878
.4byte gText_MoveToBag, sub_816B994
.4byte gText_Give2, sub_816BABC
.4byte gText_Cancel2, sub_816BBD4
.align 2
gUnknown_085DFF24:: @ 85DFF24
.4byte 0x09010100, 0x00010f06, 0x09010100, 0x00010f08, 0x0a010100, 0x00010f08
.align 2
gUnknown_085DFF3C:: @ 85DFF3C
.4byte sub_816CA94
.4byte sub_816CAC8
.align 2
gUnknown_085DFF44:: @ 85DFF44
.4byte 0x00000000, sub_816BDDC, fish4_goto_x5_or_x6, 0x00000000, 0x00080000, 0x07003129
.align 2
gUnknown_085DFF5C:: @ 85DFF5C
window_template 0x00, 0x10, 0x01, 0x0d, 0x12, 0x0f, 0x0001
window_template 0x00, 0x01, 0x0d, 0x0d, 0x06, 0x0f, 0x00eb
window_template 0x00, 0x01, 0x08, 0x03, 0x03, 0x0f, 0x0153
window_template 0x00, 0x01, 0x01, 0x0d, 0x02, 0x0f, 0x0139
window_template 0x00, 0x08, 0x09, 0x06, 0x02, 0x0f, 0x015c
.align 2
gUnknown_085DFF84:: @ 85DFF84
window_template 0x00, 0x09, 0x07, 0x05, 0x04, 0x0f, 0x0168
.align 2
gUnknown_085DFF8C:: @ 85DFF8C
.byte 0x01, 0x03, 0x02, 0x00

View File

@ -259,7 +259,7 @@ LittlerootTown_BrendansHouse_2F_EventScript_1F8626:: @ 81F8626
special DoPCTurnOnEffect special DoPCTurnOnEffect
playse SE_PC_ON playse SE_PC_ON
msgbox gUnknown_08272D87, 4 msgbox gUnknown_08272D87, 4
special sub_816AE58 special BedroomPC
waitstate waitstate
releaseall releaseall
end end

View File

@ -320,7 +320,7 @@ LittlerootTown_MaysHouse_2F_EventScript_1F9576:: @ 81F9576
special DoPCTurnOnEffect special DoPCTurnOnEffect
playse SE_PC_ON playse SE_PC_ON
msgbox gUnknown_08272D87, 4 msgbox gUnknown_08272D87, 4
special sub_816AE58 special BedroomPC
waitstate waitstate
releaseall releaseall
end end

View File

@ -260,8 +260,8 @@ gSpecials:: @ 81DBA64
def_special ValidateEReaderTrainer def_special ValidateEReaderTrainer
def_special sub_8139228 def_special sub_8139228
def_special sub_80F94E8 def_special sub_80F94E8
def_special sub_816AE58 def_special BedroomPC
def_special sub_816AE98 def_special PlayerPC
def_special FieldShowRegionMap def_special FieldShowRegionMap
def_special sub_807E73C def_special sub_807E73C
def_special sub_807EA10 def_special sub_807EA10

View File

@ -69,5 +69,6 @@ extern EWRAM_DATA u8 gCurDecorationIndex;
void sub_8126968(void); void sub_8126968(void);
void sub_8126AD8(u8 taskId); void sub_8126AD8(u8 taskId);
void sub_8127D38(u16 mapX, u16 mapY, u16 decor); void sub_8127D38(u16 mapX, u16 mapY, u16 decor);
void sub_8126B2C(u8 taskId);
#endif //GUARD_DECORATION_H #endif //GUARD_DECORATION_H

View File

@ -389,4 +389,8 @@ extern const u8 FieryPath_EventScript_2908FD[];
extern const u8 EventScript_290CAE[]; extern const u8 EventScript_290CAE[];
extern const u8 EventScript_2926F8[]; extern const u8 EventScript_2926F8[];
//player pc
extern const u8 LittlerootTown_BrendansHouse_2F_EventScript_1F863F[];
extern const u8 LittlerootTown_MaysHouse_2F_EventScript_1F958F[];
#endif //GUARD_EVENT_SCRIPTS_H #endif //GUARD_EVENT_SCRIPTS_H

View File

@ -10,12 +10,12 @@ s32 GetStringRightAlignXOffset(s32 fontId, const u8 *str, s32 totalWidth);
s32 GetStringCenterAlignXOffsetWithLetterSpacing(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing); s32 GetStringCenterAlignXOffsetWithLetterSpacing(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing);
s32 GetStringWidthDifference(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing); s32 GetStringWidthDifference(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing);
s32 GetMaxWidthInMenuTable(const struct MenuAction *str, s32 arg1); s32 GetMaxWidthInMenuTable(const struct MenuAction *str, s32 arg1);
s32 sub_81DB3D8(const struct MenuAction *str, u8* arg1, s32 arg2); s32 sub_81DB3D8(const struct MenuAction *str, const u8* arg1, s32 arg2);
// sub_81DB41C // sub_81DB41C
// CopyMonCategoryText // CopyMonCategoryText
// sub_81DB494 // sub_81DB494
void PadNameString(u8 *dst, u8 padWith); void PadNameString(u8 *dst, u8 padWith);
// sub_81DB554 void sub_81DB554(u8 *, u8);
// sub_81DB5AC // sub_81DB5AC
u32 sub_81DB604(const u8 *); u32 sub_81DB604(const u8 *);
// sub_81DB620 // sub_81DB620

View File

@ -64,5 +64,9 @@ u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 pocketPos);
void sub_80D6FB4(struct BagPocket*); void sub_80D6FB4(struct BagPocket*);
void sub_80D6F64(struct BagPocket*); void sub_80D6F64(struct BagPocket*);
void sub_80D702C(struct ItemSlot*, s16, u16); void sub_80D702C(struct ItemSlot*, s16, u16);
u8 sub_80D6CE4();
bool8 itemid_is_unique(u16 itemId);
void sub_80D6E48(u8, u16);
void sub_80D6E84(void);
#endif // ITEM_H #endif // ITEM_H

View File

@ -51,6 +51,7 @@ extern struct UnkBagStruct *gUnknown_0203CE54;
extern u16 gSpecialVar_ItemId; extern u16 gSpecialVar_ItemId;
// Exported ROM declarations // Exported ROM declarations
void sub_81AAC14(void);
void sub_81AAC50(void); void sub_81AAC50(void);
void sub_81AAC70(void); void sub_81AAC70(void);
void bag_menu_mail_related(void); void bag_menu_mail_related(void);

View File

@ -55,6 +55,7 @@ struct WindowTemplate sub_8198A50(u8, u8, u8, u8, u8, u8, u16);
void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos); void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos);
void copy_decompressed_tile_data_to_vram_autofree(u8 bgId, const void *src, int size, u16 offset, u8 mode); void copy_decompressed_tile_data_to_vram_autofree(u8 bgId, const void *src, int size, u16 offset, u8 mode);
s8 ProcessMenuInputNoWrap_(void); s8 ProcessMenuInputNoWrap_(void);
s8 ProcessMenuInput_other(void);
void do_scheduled_bg_tilemap_copies_to_vram(void); void do_scheduled_bg_tilemap_copies_to_vram(void);
void clear_scheduled_bg_copies_to_vram(void); void clear_scheduled_bg_copies_to_vram(void);
void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str);

View File

@ -14,7 +14,7 @@ struct YesNoFuncTable
// Exported RAM declarations // Exported RAM declarations
// Exported ROM declarations // Exported ROM declarations
void sub_812220C(struct ItemSlot *, u8, u8 *, u8 *, u8);
void sub_812225C(u16 *, u16 *, u8, u8); void sub_812225C(u16 *, u16 *, u8, u8);
void sub_8122298(u16 *, u16 *, u8, u8, u8); void sub_8122298(u16 *, u16 *, u8, u8, u8);
void sub_8121F68(u8 taskId, const struct YesNoFuncTable *data); void sub_8121F68(u8 taskId, const struct YesNoFuncTable *data);
@ -24,7 +24,8 @@ void ResetVramOamAndBgCntRegs(void);
void SetVBlankHBlankCallbacksToNull(void); void SetVBlankHBlankCallbacksToNull(void);
void ResetAllBgsCoordinates(void); void ResetAllBgsCoordinates(void);
bool16 RunTextPrintersRetIsActive(u8 textPrinterId); bool16 RunTextPrintersRetIsActive(u8 textPrinterId);
void sub_8122344(void *arg0, u8 arg1); void sub_8122344(u8 *arg0, u8 arg1);
void sub_81223B0(u8 *arg0, u8 arg1);
void LoadListMenuArrowsGfx(void); void LoadListMenuArrowsGfx(void);
void sub_81223FC(u8 *a0, u8 count, u8 a2); void sub_81223FC(u8 *a0, u8 count, u8 a2);
void sub_8122448(u8 *a0, u8 count, u16 x, u16 y); void sub_8122448(u8 *a0, u8 count, u16 x, u16 y);

View File

@ -37,5 +37,6 @@ void display_pokemon_menu_message(u8 windowId);
void sub_81B1F18(u8 taskId, u8 pokemonIdx, s8 a, s16 hp, TaskFunc func); void sub_81B1F18(u8 taskId, u8 pokemonIdx, s8 a, s16 hp, TaskFunc func);
void sub_81B1B5C(void *a, u8 b); void sub_81B1B5C(void *a, u8 b);
u8 sub_81B1BD4(); u8 sub_81B1BD4();
void sub_81B8448();
#endif // GUARD_PARTY_MENU_H #endif // GUARD_PARTY_MENU_H

View File

@ -1,13 +1,88 @@
#ifndef GUARD_PLAYER_PC_H #ifndef GUARD_PLAYER_PC_H
#define GUARD_PLAYER_PC_H #define GUARD_PLAYER_PC_H
// local task defines
#define PAGE_INDEX data[0]
#define ITEMS_ABOVE_TOP data[1]
#define NUM_ITEMS data[1]
#define NUM_QUANTITY_ROLLER data[3]
#define NUM_PAGE_ITEMS data[4]
// not used
#define CURRENT_ITEM_STORAGE_MENU data[3]
// not used
#define SWAP_ITEM_INDEX data[8]
#define SWITCH_MODE_ACTIVE data[9]
// this is potentially an ewram access occuring in high ewram. TODO: investigate this further.
#define NEW_GAME_PC_ITEMS(i, type) ((u16)((u16 *)gNewGamePCItems + type)[i * 2])
// defined and used in the above macro
enum
{
PC_ITEM_ID,
PC_QUANTITY
};
// player PC menu options
enum
{
PLAYERPC_MENU_ITEMSTORAGE,
PLAYERPC_MENU_MAILBOX,
PLAYERPC_MENU_DECORATION,
PLAYERPC_MENU_TURNOFF
};
// item storage menus
enum
{
ITEMPC_MENU_WITHDRAW,
ITEMPC_MENU_DEPOSIT,
ITEMPC_MENU_TOSS,
ITEMPC_MENU_EXIT
};
// mailbox mail options
enum
{
MAILBOX_READ,
MAILBOX_MOVE_TO_BAG,
MAILBOX_GIVE,
MAILBOX_CANCEL,
};
// special item description handlers
enum
{
ITEMPC_SWITCH_WHICH_ITEM = 0xFFF7,
ITEMPC_OKAY_TO_THROW_AWAY,
ITEMPC_TOO_IMPORTANT,
ITEMPC_NO_MORE_ROOM,
ITEMPC_THREW_AWAY_ITEM,
ITEMPC_HOW_MANY_TO_TOSS,
ITEMPC_WITHDREW_THING,
ITEMPC_HOW_MANY_TO_WITHDRAW,
ITEMPC_GO_BACK_TO_PREV
};
struct PlayerPCItemPageStruct
{
u16 cursorPos;
u16 itemsAbove;
u8 pageItems;
u8 count;
u8 filler[3];
u8 scrollIndicatorId;
};
// Exported type declarations // Exported type declarations
// Exported RAM declarations // Exported RAM declarations
extern struct PlayerPCItemPageStruct playerPCItemPageInfo;
// Exported ROM declarations // Exported ROM declarations
extern const struct MenuAction gMailboxMailOptions[];
void sub_816B060(u8 taskId); void ReshowPlayerPC(u8 taskId);
void sub_816B31C(void); void sub_816B31C(void);
#endif //GUARD_PLAYER_PC_H #endif //GUARD_PLAYER_PC_H

View File

@ -1,5 +1,6 @@
#ifndef GUARD_POKENAV_H #ifndef GUARD_POKENAV_H
#define GUARD_POKENAV_H #define GUARD_POKENAV_H
#include "player_pc.h"
bool8 sub_81D5C18(void); bool8 sub_81D5C18(void);
bool8 sub_81D20BC(void *arg0); bool8 sub_81D20BC(void *arg0);
@ -13,5 +14,12 @@ void sub_81D3480(void *arg0, u8 arg1);
void sub_81D2754(void *arg0, void *arg1); void sub_81D2754(void *arg0, void *arg1);
void sub_81D1F84(void *arg0, void *arg1, void *arg2); void sub_81D1F84(void *arg0, void *arg1, void *arg2);
const u8 *sub_81D62AC(void); const u8 *sub_81D62AC(void);
u8 sub_81D1C84(u8);
u8 sub_81D1DC0(struct PlayerPCItemPageStruct *);
void sub_81D1E90(struct PlayerPCItemPageStruct *);
void sub_81D1EC0(void);
void sub_81D1D04(u8);
bool8 sub_81D1C44(u8);
#endif //GUARD_POKENAV_H #endif //GUARD_POKENAV_H

View File

@ -389,4 +389,45 @@ extern const u8 gBirchDexRatingText_LessThan190[];
extern const u8 gBirchDexRatingText_LessThan200[]; extern const u8 gBirchDexRatingText_LessThan200[];
extern const u8 gBirchDexRatingText_DexCompleted[]; extern const u8 gBirchDexRatingText_DexCompleted[];
//player pc text
extern const u8 gText_WhatWouldYouLike[];
extern const u8 gText_NoMailHere[];
extern const u8 gText_TakeOutItemsFromPC[];
extern const u8 gText_StoreItemsInPC[];
extern const u8 gText_ThrowAwayItemsInPC[];
extern const u8 gText_GoBackPrevMenu[];
extern const u8 gText_ItemStorage[];
extern const u8 gText_Mailbox[];
extern const u8 gText_Decoration[];
extern const u8 gText_TurnOff[];
extern const u8 gText_WithdrawItem[];
extern const u8 gText_DepositItem[];
extern const u8 gText_TossItem[];
extern const u8 gText_Cancel[];
extern const u8 gText_Read[];
extern const u8 gText_MoveToBag[];
extern const u8 gText_Give2[];
extern const u8 gText_Cancel2[];
extern const u8 gText_NoItems[];
extern const u8 gText_WhatToDoWithVar1sMail[];
extern const u8 gText_MessageWillBeLost[];
extern const u8 gText_BagIsFull[];
extern const u8 gText_MailToBagMessageErased[];
extern const u8 gText_GoBackPrevMenu[];
extern const u8 gText_WithdrawHowManyItems[];
extern const u8 gText_WithdrawXItems[];
extern const u8 gText_TossHowManyVar1s[];
extern const u8 gText_ThrewAwayVar2Var1s[];
extern const u8 gText_NoRoomInBag[];
extern const u8 gText_TooImportantToToss[];
extern const u8 gText_ConfirmTossItems[];
extern const u8 gText_MoveVar1Where[];
#endif //GUARD_STRINGS_H #endif //GUARD_STRINGS_H

View File

@ -216,7 +216,7 @@ SECTIONS {
src/use_pokeblock.o(.text); src/use_pokeblock.o(.text);
asm/use_pokeblock.o(.text); asm/use_pokeblock.o(.text);
src/battle_controller_wally.o(.text); src/battle_controller_wally.o(.text);
asm/player_pc.o(.text); src/player_pc.o(.text);
src/intro.o(.text); src/intro.o(.text);
src/reset_save_heap.o(.text); src/reset_save_heap.o(.text);
src/field_region_map.o(.text); src/field_region_map.o(.text);
@ -495,7 +495,7 @@ SECTIONS {
src/use_pokeblock.o(.rodata); src/use_pokeblock.o(.rodata);
data/use_pokeblock.o(.rodata); data/use_pokeblock.o(.rodata);
src/battle_controller_wally.o(.rodata); src/battle_controller_wally.o(.rodata);
data/player_pc.o(.rodata); src/player_pc.o(.rodata);
src/intro.o(.rodata); src/intro.o(.rodata);
src/field_region_map.o(.rodata); src/field_region_map.o(.rodata);
data/battle_anim_8170478.o(.rodata); data/battle_anim_8170478.o(.rodata);

View File

@ -562,7 +562,7 @@ void SecretBasePC_Cancel(u8 taskId)
} }
else else
{ {
sub_816B060(taskId); ReshowPlayerPC(taskId);
} }
} }

View File

@ -42,7 +42,7 @@ s32 GetMaxWidthInMenuTable(const struct MenuAction *str, s32 arg1)
return convert_pixel_width_to_tile_width(var); return convert_pixel_width_to_tile_width(var);
} }
s32 sub_81DB3D8(const struct MenuAction *str, u8* arg1, s32 arg2) s32 sub_81DB3D8(const struct MenuAction *str, const u8* arg1, s32 arg2)
{ {
s32 i, var; s32 i, var;

1364
src/player_pc.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -460,7 +460,7 @@ static bool8 InitPokeblockMenu(void)
gMain.state++; gMain.state++;
break; break;
case 10: case 10:
sub_8122344(&sPokeblockMenu->field_E75, FIELD_E75_COUNT); sub_8122344(sPokeblockMenu->field_E75, FIELD_E75_COUNT);
gMain.state++; gMain.state++;
break; break;
case 11: case 11:

View File

@ -805,25 +805,7 @@ gUnknown_0203BC8C: @ 203BC8C
.space 0x4 .space 0x4
.include "src/use_pokeblock.o" .include "src/use_pokeblock.o"
.include "src/player_pc.o"
gUnknown_0203BCB0: @ 203BCB0
.space 0x4
gUnknown_0203BCB4: @ 203BCB4
.space 0x4
gUnknown_0203BCB8: @ 203BCB8
.space 0x2
gUnknown_0203BCBA: @ 203BCBA
.space 0x2
gUnknown_0203BCBC: @ 203BCBC
.space 0x8
gUnknown_0203BCC4: @ 203BCC4
.space 0x4
.include "src/intro.o" .include "src/intro.o"
.include "src/field_region_map.o" .include "src/field_region_map.o"
@ -954,23 +936,8 @@ gUnknown_0203CEFC: @ 203CEFC
gUnknown_0203CF00: @ 203CF00 gUnknown_0203CF00: @ 203CF00
.space 0x4 .space 0x4
gUnknown_0203CF04: @ 203CF04 .include "src/fossil_specials.o"
.space 0x4 .include "src/fldeff_groundshake.o"
gUnknown_0203CF08: @ 203CF08
.space 0x4
gUnknown_0203CF0C: @ 203CF0C
.space 0x4
gUnknown_0203CF10: @ 203CF10
.space 0x4
gUnknown_0203CF14: @ 203CF14
.space 0x4
gUnknown_0203CF18: @ 203CF18
.space 0x4
gUnknown_0203CF1C: @ 203CF1C gUnknown_0203CF1C: @ 203CF1C
.space 0x4 .space 0x4