Merge remote-tracking branch 'pret/master' into RHH/pr/sync/pretmerge_20221030

# Conflicts:
#	src/pokemon_storage_system.c
This commit is contained in:
Eduardo Quezada 2022-11-09 19:33:26 -03:00
commit bd63ef18af
5 changed files with 21 additions and 12 deletions

View File

@ -21,7 +21,7 @@ SECTIONS {
*libc.a:locale.o(.data); *libc.a:locale.o(.data);
*libc.a:mallocr.o(.data); *libc.a:mallocr.o(.data);
. = 0x40000; . = 0x40000;
} }
. = 0x3000000; . = 0x3000000;

View File

@ -49,8 +49,11 @@ SECTIONS {
ALIGN(4) ALIGN(4)
{ {
src/rom_header.o(.text*); src/rom_header.o(.text*);
src/*.o(.text*); src/rom_header_gf.o(.text.*);
src/crt0.o(.text);
src/main.o(.text);
gflib/*.o(.text*); gflib/*.o(.text*);
src/*.o(.text*);
asm/*.o(.text*); asm/*.o(.text*);
} =0 } =0

View File

@ -8880,14 +8880,14 @@ static void TakeItemFromMon(u8 cursorArea, u8 cursorPos)
if (cursorArea == CURSOR_AREA_IN_BOX) if (cursorArea == CURSOR_AREA_IN_BOX)
{ {
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId); SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId);
SetBoxMonIconObjMode(cursorPos, 1); SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND);
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]); SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
} }
else else
{ {
struct Pokemon *mon = &gPlayerParty[cursorPos]; struct Pokemon *mon = &gPlayerParty[cursorPos];
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId); SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId);
SetPartyMonIconObjMode(cursorPos, 1); SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND);
SetMonFormPSS(&mon->box); SetMonFormPSS(&mon->box);
} }
@ -8952,14 +8952,14 @@ static void GiveItemToMon(u8 cursorArea, u8 cursorPos)
if (cursorArea == CURSOR_AREA_IN_BOX) if (cursorArea == CURSOR_AREA_IN_BOX)
{ {
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId); SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId);
SetBoxMonIconObjMode(cursorPos, 0); SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_NORMAL);
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]); SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
} }
else else
{ {
struct Pokemon *mon = &gPlayerParty[cursorPos]; struct Pokemon *mon = &gPlayerParty[cursorPos];
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId); SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId);
SetPartyMonIconObjMode(cursorPos, 0); SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_NORMAL);
SetMonFormPSS(&mon->box); SetMonFormPSS(&mon->box);
} }
} }
@ -8979,14 +8979,14 @@ static void MoveItemFromMonToBag(u8 cursorArea, u8 cursorPos)
if (cursorArea == CURSOR_AREA_IN_BOX) if (cursorArea == CURSOR_AREA_IN_BOX)
{ {
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId); SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId);
SetBoxMonIconObjMode(cursorPos, 1); SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND);
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]); SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
} }
else else
{ {
struct Pokemon *mon = &gPlayerParty[cursorPos]; struct Pokemon *mon = &gPlayerParty[cursorPos];
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId); SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId);
SetPartyMonIconObjMode(cursorPos, 1); SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND);
SetMonFormPSS(&mon->box); SetMonFormPSS(&mon->box);
} }
} }

View File

@ -6,6 +6,15 @@
#include "item.h" #include "item.h"
#include "pokeball.h" #include "pokeball.h"
// The purpose of this struct is for outside applications to be
// able to access parts of the ROM or its save file, like a public API.
// In vanilla, it was used by Colosseum and XD to access pokemon graphics.
//
// If this struct is rearranged in any way, it defeats the purpose of
// having it at all. Applications like PKHex or streaming HUDs may find
// these values useful, so there's some potential benefit to keeping it.
// If there's a compilation problem below, just comment out the assignment
// instead of changing this struct.
struct GFRomHeader struct GFRomHeader
{ {
u32 version; u32 version;

View File

@ -1153,10 +1153,7 @@ bool8 ScrCmd_resetobjectsubpriority(struct ScriptContext *ctx)
bool8 ScrCmd_faceplayer(struct ScriptContext *ctx) bool8 ScrCmd_faceplayer(struct ScriptContext *ctx)
{ {
if (gObjectEvents[gSelectedObjectEvent].active) if (gObjectEvents[gSelectedObjectEvent].active)
{ ObjectEventFaceOppositeDirection(&gObjectEvents[gSelectedObjectEvent], GetPlayerFacingDirection());
ObjectEventFaceOppositeDirection(&gObjectEvents[gSelectedObjectEvent],
GetPlayerFacingDirection());
}
return FALSE; return FALSE;
} }