diff --git a/Makefile b/Makefile index edb1a67d5..d34ee28f7 100644 --- a/Makefile +++ b/Makefile @@ -302,10 +302,10 @@ ifneq ($(KEEP_TEMPS),1) @echo "$(CC1) -o $@ $<" @$(CPP) $(CPPFLAGS) $< | $(PREPROC) -i $< charmap.txt | $(CC1) $(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $(AS) $(ASFLAGS) -o $@ - else - @$(CPP) $(CPPFLAGS) $< -o $*.i - @$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s - @echo -e ".text\n\t.align\t2, 0\n" >> $*.s - $(AS) $(ASFLAGS) -o $@ $*.s + @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i + @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s + @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s + $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s endif $(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c diff --git a/data/maps/TwoIsland_House/scripts.inc b/data/maps/TwoIsland_House/scripts.inc index 010f0fa10..903e093c0 100644 --- a/data/maps/TwoIsland_House/scripts.inc +++ b/data/maps/TwoIsland_House/scripts.inc @@ -48,7 +48,7 @@ TwoIsland_House_EventScript_AskTutorMon:: TwoIsland_House_EventScript_ChooseMonToTutor:: msgbox TwoIsland_House_Text_TutorWhichMon - special SelectMoveTutorMon + special ChooseMonForMoveRelearner waitstate goto_if_ge VAR_0x8004, PARTY_SIZE, TwoIsland_House_EventScript_EndTutorMove special IsSelectedMonEgg @@ -59,7 +59,7 @@ TwoIsland_House_EventScript_ChooseMonToTutor:: TwoIsland_House_EventScript_ChooseMoveToTeach:: msgbox TwoIsland_House_Text_TeachWhichMove - special DisplayMoveTutorMenu + special TeachMoveRelearnerMove waitstate goto_if_eq VAR_0x8004, 0, TwoIsland_House_EventScript_ChooseMonToTutor goto_if_set HAS_BOTH_MUSHROOMS, TwoIsland_House_EventScript_ChooseMushroom diff --git a/data/specials.inc b/data/specials.inc index 059f29015..d880bf6b9 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -227,12 +227,12 @@ gSpecials:: def_special GetElevatorFloor def_special NullFieldSpecial @ Lottery Corner specials def_special NullFieldSpecial - def_special SelectMoveTutorMon + def_special ChooseMonForMoveRelearner def_special SelectMoveDeleterMove def_special MoveDeleterForgetMove def_special BufferMoveDeleterNicknameAndMove def_special GetNumMovesSelectedMonHas - def_special DisplayMoveTutorMenu + def_special TeachMoveRelearnerMove def_special NullFieldSpecial @ Hoenn Cycling Road specials def_special NullFieldSpecial def_special GetPlayerAvatarBike diff --git a/graphics/fonts/down_arrow.png b/graphics/fonts/down_arrow.png deleted file mode 100644 index e74ed47ef..000000000 Binary files a/graphics/fonts/down_arrow.png and /dev/null differ diff --git a/graphics/fonts/down_arrow_2.png b/graphics/fonts/down_arrow_2.png deleted file mode 100644 index aefcf4f08..000000000 Binary files a/graphics/fonts/down_arrow_2.png and /dev/null differ diff --git a/graphics/fonts/down_arrow_RS.png b/graphics/fonts/down_arrow_RS.png deleted file mode 100644 index c0aae894f..000000000 Binary files a/graphics/fonts/down_arrow_RS.png and /dev/null differ diff --git a/graphics/fonts/down_arrow_RS_2.png b/graphics/fonts/down_arrow_RS_2.png deleted file mode 100644 index de9d9cf47..000000000 Binary files a/graphics/fonts/down_arrow_RS_2.png and /dev/null differ diff --git a/graphics/fonts/down_arrows.png b/graphics/fonts/down_arrows.png new file mode 100644 index 000000000..b89fa6bfe Binary files /dev/null and b/graphics/fonts/down_arrows.png differ diff --git a/include/constants/global.h b/include/constants/global.h index d83b878d9..21c781a0d 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -47,12 +47,13 @@ #define UNION_ROOM_KB_ROW_COUNT 10 #define GIFT_RIBBONS_COUNT 11 -#define POCKET_ITEMS 1 -#define POCKET_KEY_ITEMS 2 -#define POCKET_POKE_BALLS 3 -#define POCKET_TM_CASE 4 -#define POCKET_BERRY_POUCH 5 -#define NUM_BAG_POCKETS 5 +#define POCKET_ITEMS 1 +#define POCKET_KEY_ITEMS 2 +#define POCKET_POKE_BALLS 3 +#define POCKET_TM_CASE 4 +#define POCKET_BERRY_POUCH 5 +#define NUM_BAG_POCKETS 5 +#define NUM_BAG_POCKETS_NO_CASES 3 // number of pockets without considering TM case or berry pouch // Contests #define CONTEST_CATEGORIES_COUNT 5 diff --git a/include/item_menu.h b/include/item_menu.h index 3ba3de4a9..1a8e4c567 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -15,8 +15,8 @@ struct BagStruct u8 location; bool8 bagOpen; u16 pocket; - u16 itemsAbove[3]; - u16 cursorPos[3]; + u16 itemsAbove[NUM_BAG_POCKETS_NO_CASES]; + u16 cursorPos[NUM_BAG_POCKETS_NO_CASES]; }; extern struct BagStruct gBagMenuState; diff --git a/src/item.c b/src/item.c index c2400583a..0587adf7d 100644 --- a/src/item.c +++ b/src/item.c @@ -331,7 +331,7 @@ void ClearBag(void) { u16 i; - for (i = 0; i < 5; i++) + for (i = 0; i < NUM_BAG_POCKETS; i++) { ClearItemSlots(gBagPockets[i].itemSlots, gBagPockets[i].capacity); } diff --git a/src/item_menu.c b/src/item_menu.c index b0c288383..8f52ead00 100644 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -47,8 +47,8 @@ struct BagMenuAlloc u16 contextMenuSelectedItem; u8 pocketScrollArrowsTask; u8 pocketSwitchArrowsTask; - u8 nItems[3]; - u8 maxShowed[3]; + u8 nItems[NUM_BAG_POCKETS_NO_CASES]; + u8 maxShowed[NUM_BAG_POCKETS_NO_CASES]; u8 data[4]; }; @@ -57,8 +57,8 @@ struct BagSlots struct ItemSlot bagPocket_Items[BAG_ITEMS_COUNT]; struct ItemSlot bagPocket_KeyItems[BAG_KEYITEMS_COUNT]; struct ItemSlot bagPocket_PokeBalls[BAG_POKEBALLS_COUNT]; - u16 itemsAbove[3]; - u16 cursorPos[3]; + u16 itemsAbove[NUM_BAG_POCKETS_NO_CASES]; + u16 cursorPos[NUM_BAG_POCKETS_NO_CASES]; u16 registeredItem; u16 pocket; }; @@ -832,7 +832,7 @@ void ResetBagCursorPositions(void) u8 i; gBagMenuState.pocket = POCKET_ITEMS - 1; gBagMenuState.bagOpen = FALSE; - for (i = 0; i < 3; i++) + for (i = 0; i < NUM_BAG_POCKETS_NO_CASES; i++) { gBagMenuState.itemsAbove[i] = 0; gBagMenuState.cursorPos[i] = 0; @@ -857,7 +857,7 @@ void PocketCalculateInitialCursorPosAndItemsAbove(u8 pocketId) static void CalculateInitialCursorPosAndItemsAbove(void) { u8 i; - for (i = 0; i < 3; i++) + for (i = 0; i < NUM_BAG_POCKETS_NO_CASES; i++) { PocketCalculateInitialCursorPosAndItemsAbove(i); } @@ -868,7 +868,7 @@ static void UpdatePocketScrollPositions(void) u8 i; u8 j; - for (i = 0; i < 3; i++) + for (i = 0; i < NUM_BAG_POCKETS_NO_CASES; i++) { if (gBagMenuState.itemsAbove[i] > 3) { @@ -1011,7 +1011,7 @@ void Pocket_CalculateNItemsAndMaxShowed(u8 pocketId) static void All_CalculateNItemsAndMaxShowed(void) { u8 i; - for (i = 0; i < 3; i++) + for (i = 0; i < NUM_BAG_POCKETS_NO_CASES; i++) Pocket_CalculateNItemsAndMaxShowed(i); } @@ -2067,7 +2067,7 @@ static void BackUpPlayerBag(void) memcpy(sBackupPlayerBag->bagPocket_PokeBalls, gSaveBlock1Ptr->bagPocket_PokeBalls, BAG_POKEBALLS_COUNT * sizeof(struct ItemSlot)); sBackupPlayerBag->registeredItem = gSaveBlock1Ptr->registeredItem; sBackupPlayerBag->pocket = gBagMenuState.pocket; - for (i = 0; i < 3; i++) + for (i = 0; i < NUM_BAG_POCKETS_NO_CASES; i++) { sBackupPlayerBag->itemsAbove[i] = gBagMenuState.itemsAbove[i]; sBackupPlayerBag->cursorPos[i] = gBagMenuState.cursorPos[i]; @@ -2087,7 +2087,7 @@ static void RestorePlayerBag(void) memcpy(gSaveBlock1Ptr->bagPocket_PokeBalls, sBackupPlayerBag->bagPocket_PokeBalls, BAG_POKEBALLS_COUNT * sizeof(struct ItemSlot)); gSaveBlock1Ptr->registeredItem = sBackupPlayerBag->registeredItem; gBagMenuState.pocket = sBackupPlayerBag->pocket; - for (i = 0; i < 3; i++) + for (i = 0; i < NUM_BAG_POCKETS_NO_CASES; i++) { gBagMenuState.itemsAbove[i] = sBackupPlayerBag->itemsAbove[i]; gBagMenuState.cursorPos[i] = sBackupPlayerBag->cursorPos[i]; diff --git a/src/learn_move.c b/src/learn_move.c index 2f7f04b01..0529644fa 100644 --- a/src/learn_move.c +++ b/src/learn_move.c @@ -364,7 +364,7 @@ static void VBlankCB_MoveRelearner(void) TransferPlttBuffer(); } -void DisplayMoveTutorMenu(void) +void TeachMoveRelearnerMove(void) { LockPlayerFieldControls(); CreateTask(Task_InitMoveRelearnerMenu, 10); diff --git a/src/party_menu_specials.c b/src/party_menu_specials.c index 567f6b860..d71c6a495 100644 --- a/src/party_menu_specials.c +++ b/src/party_menu_specials.c @@ -21,7 +21,7 @@ void ChoosePartyMon(void) BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); } -void SelectMoveTutorMon(void) +void ChooseMonForMoveRelearner(void) { u8 taskId; diff --git a/src/text.c b/src/text.c index b2dcff3b5..baaefe2e6 100644 --- a/src/text.c +++ b/src/text.c @@ -10,6 +10,8 @@ #define CURSOR_DELAY 8 +#define DARK_DOWN_ARROW_OFFSET 256 + extern const struct OamData gOamData_AffineOff_ObjNormal_16x16; static void DecompressGlyph_NormalCopy1(u16 glyphId, bool32 isJapanese); @@ -26,12 +28,9 @@ static void SpriteCB_TextCursor(struct Sprite *sprite); COMMON_DATA TextFlags gTextFlags = {0}; -static const u8 sDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow.4bpp"); -static const u8 sDarkDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_RS.4bpp"); -static const u8 sTinyArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_2.4bpp"); -static const u8 sTinyDarkDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_RS_2.4bpp"); -static const u8 sDoubleArrowTiles1[] = INCBIN_U8("graphics/fonts/down_arrow_3.4bpp"); -static const u8 sDoubleArrowTiles2[] = INCBIN_U8("graphics/fonts/down_arrow_4.4bpp"); +static const u8 sDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrows.4bpp"); +static const u8 sDoubleArrowTiles1[] = INCBIN_U8("graphics/fonts/down_arrow_3.4bpp"); +static const u8 sDoubleArrowTiles2[] = INCBIN_U8("graphics/fonts/down_arrow_4.4bpp"); static const u8 sDownArrowYCoords[] = { 0, 16, 32, 16 }; static const u8 sWindowVerticalScrollSpeeds[] = { @@ -497,7 +496,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter) arrowTiles = sDownArrowTiles; break; case 1: - arrowTiles = sDarkDownArrowTiles; + arrowTiles = &sDownArrowTiles[DARK_DOWN_ARROW_OFFSET]; break; } @@ -605,7 +604,7 @@ void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *c arrowTiles = sDownArrowTiles; break; case 1: - arrowTiles = sDarkDownArrowTiles; + arrowTiles = &sDownArrowTiles[DARK_DOWN_ARROW_OFFSET]; break; }