diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/crt0.s | 48 | ||||
-rw-r--r-- | src/daycare.c | 16 | ||||
-rwxr-xr-x | src/item_menu.c | 10 | ||||
-rw-r--r-- | src/pokemon_storage_system.c | 24 |
4 files changed, 61 insertions, 37 deletions
diff --git a/src/crt0.s b/src/crt0.s index 49f214f80..cc83a04df 100644 --- a/src/crt0.s +++ b/src/crt0.s @@ -1,3 +1,4 @@ +#include "constants/global.h" .include "constants/gba_constants.inc" .syntax unified @@ -34,8 +35,8 @@ GPIOPortReadEnable: @ 80000C8 @ 80000CC .space 0x34 - .4byte 3 - .4byte 2 + .4byte GAME_VERSION + .4byte GAME_LANGUAGE .ascii "pokemon emerald version" .space 9 @@ -51,17 +52,33 @@ GPIOPortReadEnable: @ 80000C8 .4byte gMoveNames .4byte gDecorations - .4byte 0x00001270, 0x0000139c, 0x00000018, 0x00000988 - .4byte 0x00003b24, 0x00000046, 0x000008e4, 0x000008ac - .4byte 0x00000182 + .4byte 0x00001270 @ offsetof(struct SaveBlock1, flags) + .4byte 0x0000139c @ offsetof(struct SaveBlock1, vars) + .4byte 0x00000018 @ offsetof(struct SaveBlock2, pokedex) + .4byte 0x00000988 @ offsetof(struct SaveBlock1, seen1) + .4byte 0x00003b24 @ offsetof(struct SaveBlock1, seen2) + .4byte 0x00000046 @ ? + .4byte 0x000008e4 @ ? + .4byte 0x000008ac @ ? + .4byte 0x00000182 @ NATIONAL_DEX_COUNT? .byte 0x07, 0x0a, 0x0a, 0x0a, 0x0c, 0x0c, 0x06, 0x0c .byte 0x06, 0x10, 0x12, 0x0c, 0x0f, 0x0b, 0x01, 0x08 - .4byte 0x0000000c, 0x00000f2c, 0x00003d88, 0x00000234 - .4byte 0x00000238, 0x00000009, 0x0000000a, 0x00000000 - .4byte 0x00000008, 0x00000ca8, 0x00000ca8, 0x000031c7 - .4byte 0x000031b3, 0x00000000 + .4byte 0x0000000c @ ? + .4byte 0x00000f2c @ sizeof(struct SaveBlock2) + .4byte 0x00003d88 @ sizeof(struct SaveBlock1) + .4byte 0x00000234 @ offsetof(struct SaveBlock1, playerPartyCount) + .4byte 0x00000238 @ offsetof(struct SaveBlock1, playerParty) + .4byte 0x00000009 @ offsetof(struct SaveBlock2, specialSaveWarpFlags) + .4byte 0x0000000a @ offsetof(struct SaveBlock2, playerTrainerId) + .4byte 0x00000000 @ offsetof(struct SaveBlock2, playerName) + .4byte 0x00000008 @ offsetof(struct SaveBlock2, playerGender) + .4byte 0x00000ca8 @ offsetof(struct SaveBlock2, frontier.challengeStatus) + .4byte 0x00000ca8 @ offsetof(struct SaveBlock2, frontier.challengeStatus) + .4byte 0x000031c7 @ offsetof(struct SaveBlock1, ? part-way into giftRibbons) + .4byte 0x000031b3 @ offsetof(struct SaveBlock1, ? part-way into giftRibbons) + .4byte 0x00000000 .4byte gBaseStats .4byte gAbilityNames @@ -71,12 +88,19 @@ GPIOPortReadEnable: @ 80000C8 .4byte gBallSpriteSheets .4byte gBallSpritePalettes - .4byte 0x000000a8, 0x00000864, 0x0000089b + .4byte 0x000000a8 @ offsetof(struct SaveBlock2, gcnLinkFlags) + .4byte 0x00000864 @ ? + .4byte 0x0000089b @ ? .byte 0x1e, 0x1e, 0x10, 0x40 - .4byte 0x0000322e, 0x00000498, 0x000031a8, 0x000031f8 - .4byte 0x00000034, 0x00000000, 0x00000000 + .4byte 0x0000322e @ offsetof(struct SaveBlock1, ? part-way into unk_322C) + .4byte 0x00000498 @ offsetof(struct SaveBlock1, pcItems) + .4byte 0x000031a8 @ offsetof(struct SaveBlock1, giftRibbons) + .4byte 0x000031f8 @ offsetof(struct SaveBlock1, enigmaBerry) + .4byte 0x00000034 @ offsetof(struct SaveBlock1, mapView) + .4byte 0x00000000 + .4byte 0x00000000 .arm .align 2, 0 diff --git a/src/daycare.c b/src/daycare.c index 2a1efefcc..7ae1e72c4 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -894,8 +894,8 @@ static bool8 TryProduceOrHatchEgg(struct DayCare *daycare) // Check if an egg should be produced if (daycare->offspringPersonality == 0 && validEggs == DAYCARE_MON_COUNT && (daycare->mons[1].steps & 0xFF) == 0xFF) { - u8 compatability = GetDaycareCompatibilityScore(daycare); - if (compatability > (Random() * 100u) / USHRT_MAX) + u8 compatibility = GetDaycareCompatibilityScore(daycare); + if (compatibility > (Random() * 100u) / USHRT_MAX) TriggerPendingDaycareEgg(); } @@ -1050,7 +1050,7 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare) if (trainerIds[0] == trainerIds[1]) return PARENTS_LOW_COMPATIBILITY; - return PARENTS_MED_COMPATABILITY; + return PARENTS_MED_COMPATIBILITY; } // neither parent is Ditto else @@ -1065,14 +1065,14 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare) if (species[0] == species[1]) { if (trainerIds[0] == trainerIds[1]) - return PARENTS_MED_COMPATABILITY; // same species, same trainer + return PARENTS_MED_COMPATIBILITY; // same species, same trainer - return PARENTS_MAX_COMPATABILITY; // same species, different trainers + return PARENTS_MAX_COMPATIBILITY; // same species, different trainers } else { if (trainerIds[0] != trainerIds[1]) - return PARENTS_MED_COMPATABILITY; // different species, different trainers + return PARENTS_MED_COMPATIBILITY; // different species, different trainers return PARENTS_LOW_COMPATIBILITY; // different species, same trainer } @@ -1095,9 +1095,9 @@ void SetDaycareCompatibilityString(void) whichString = 3; if (relationshipScore == PARENTS_LOW_COMPATIBILITY) whichString = 2; - if (relationshipScore == PARENTS_MED_COMPATABILITY) + if (relationshipScore == PARENTS_MED_COMPATIBILITY) whichString = 1; - if (relationshipScore == PARENTS_MAX_COMPATABILITY) + if (relationshipScore == PARENTS_MAX_COMPATIBILITY) whichString = 0; StringCopy(gStringVar4, sCompatibilityMessages[whichString]); diff --git a/src/item_menu.c b/src/item_menu.c index c63342041..375e15cab 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -86,7 +86,7 @@ u16 BagGetQuantityByPocketPosition(u8, u16); void BagDestroyPocketSwitchArrowPair(void); void TaskCloseBagMenu_2(u8); u8 AddItemMessageWindow(u8); -void BagMenu_RemoveBagItemMessageindow(u8); +void BagMenu_RemoveBagItemMessageWindow(u8); void set_callback3_to_bag(u8); void PrintItemDepositAmount(u8, s16); static u8 BagMenu_AddWindow(u8); @@ -1115,7 +1115,7 @@ void BagMenu_InitListsMenu(u8 taskId) s16* data = gTasks[taskId].data; u16* scrollPos = &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket]; u16* cursorPos = &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]; - BagMenu_RemoveBagItemMessageindow(4); + BagMenu_RemoveBagItemMessageWindow(4); DestroyListMenuTask(data[0], scrollPos, cursorPos); UpdatePocketItemList(gBagPositionStruct.pocket); SetInitialScrollAndCursorPositions(gBagPositionStruct.pocket); @@ -2035,7 +2035,7 @@ void BagMenu_CancelSell(u8 taskId) s16* data = gTasks[taskId].data; RemoveMoneyWindow(); - BagMenu_RemoveBagItemMessageindow(4); + BagMenu_RemoveBagItemMessageWindow(4); BagMenu_PrintCursor_(data[0], 0); set_callback3_to_bag(taskId); } @@ -2070,7 +2070,7 @@ static void Task_SellHowManyDialogueHandleInput(u8 taskId) BagMenu_PrintCursor_(data[0], 0); RemoveMoneyWindow(); BagMenu_RemoveWindow(8); - BagMenu_RemoveBagItemMessageindow(4); + BagMenu_RemoveBagItemMessageWindow(4); set_callback3_to_bag(taskId); } } @@ -2420,7 +2420,7 @@ u8 AddItemMessageWindow(u8 which) return *ptr; } -void BagMenu_RemoveBagItemMessageindow(u8 which) +void BagMenu_RemoveBagItemMessageWindow(u8 which) { u8 *ptr = &gBagMenu->windowPointers[which]; if (*ptr != 0xFF) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 50fc04372..eaa9416cf 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -5898,12 +5898,12 @@ static bool8 sub_80CD554(void) return TRUE; } -static void sub_80CD6AC(u8 newCurosrArea, u8 newCursorPosition) +static void sub_80CD6AC(u8 newCursorArea, u8 newCursorPosition) { u16 x, y; - sub_80CD444(newCurosrArea, newCursorPosition, &x, &y); - sPSSData->field_CD4 = newCurosrArea; + sub_80CD444(newCursorArea, newCursorPosition, &x, &y); + sPSSData->field_CD4 = newCursorArea; sPSSData->field_CD5 = newCursorPosition; sPSSData->field_CCC = x; sPSSData->field_CCE = y; @@ -5955,9 +5955,9 @@ static void sub_80CD70C(void) sPSSData->field_CC0 = sPSSData->field_CB4->pos1.y << 8; } -static void sub_80CD894(u8 newCurosrArea, u8 newCursorPosition) +static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) { - sub_80CD6AC(newCurosrArea, newCursorPosition); + sub_80CD6AC(newCursorArea, newCursorPosition); sub_80CD70C(); if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) { @@ -5977,19 +5977,19 @@ static void sub_80CD894(u8 newCurosrArea, u8 newCursorPosition) else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) sub_80D0E50(CURSOR_AREA_IN_PARTY, sBoxCursorPosition); - if (newCurosrArea == CURSOR_AREA_IN_BOX) - sub_80D0D8C(newCurosrArea, newCursorPosition); - else if (newCurosrArea == CURSOR_AREA_IN_PARTY) - sub_80D0D8C(newCurosrArea, newCursorPosition); + if (newCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0D8C(newCursorArea, newCursorPosition); + else if (newCursorArea == CURSOR_AREA_IN_PARTY) + sub_80D0D8C(newCursorArea, newCursorPosition); } - if (newCurosrArea == CURSOR_AREA_IN_PARTY && sBoxCursorArea != CURSOR_AREA_IN_PARTY) + if (newCursorArea == CURSOR_AREA_IN_PARTY && sBoxCursorArea != CURSOR_AREA_IN_PARTY) { - sPSSData->field_CD6 = newCurosrArea; + sPSSData->field_CD6 = newCursorArea; sPSSData->field_CB8->invisible = TRUE; } - switch (newCurosrArea) + switch (newCursorArea) { case CURSOR_AREA_IN_PARTY: case CURSOR_AREA_BOX: |