mirror of
https://github.com/pret/pokeheartgold.git
synced 2024-11-26 22:50:22 +00:00
Merge remote-tracking branch 'origin/master' into misc_documentation
This commit is contained in:
commit
232dc989d1
@ -124,7 +124,7 @@
|
||||
.public sub_0205DD94
|
||||
.public MapObject_GetMovement
|
||||
.public MapObject_GetType
|
||||
.public MapObject_GetScript
|
||||
.public MapObject_GetScriptID
|
||||
.public sub_0205F504
|
||||
.public MapObjectManager_PauseAllMovement
|
||||
.public MapObject_UnpauseMovement
|
||||
|
@ -115,7 +115,7 @@
|
||||
.public sub_0205CB38
|
||||
.public sub_0205CB40
|
||||
.public MapObject_GetSpriteID
|
||||
.public MapObject_GetScript
|
||||
.public MapObject_GetScriptID
|
||||
.public sub_0205F330
|
||||
.public Save_VarsFlags_CheckSafariSysFlag
|
||||
.public Save_VarsFlags_CheckBugContestFlag
|
||||
|
@ -77,7 +77,7 @@
|
||||
.public sub_0205CB38
|
||||
.public sub_0205CB40
|
||||
.public MapObject_GetSpriteID
|
||||
.public MapObject_GetScript
|
||||
.public MapObject_GetScriptID
|
||||
.public sub_0205F330
|
||||
.public FX_Atan2Idx
|
||||
.public GXS_SetGraphicsMode
|
||||
|
@ -30,7 +30,7 @@
|
||||
.public MapObject_SetSpriteID
|
||||
.public MapObject_GetMovement
|
||||
.public MapObject_GetType
|
||||
.public MapObject_GetScript
|
||||
.public MapObject_GetScriptID
|
||||
.public MapObject_SetFacingDirection
|
||||
.public MapObject_GetFacingDirection
|
||||
.public MapObject_SetOrQueueFacing
|
||||
|
@ -515,7 +515,7 @@ _021E6C50:
|
||||
beq _021E6C72
|
||||
ldr r5, [sp]
|
||||
add r0, r5, #0
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
add r1, r0, #0
|
||||
lsl r1, r1, #0x10
|
||||
add r0, r4, #0
|
||||
@ -776,7 +776,7 @@ _021E6E52:
|
||||
_021E6E88:
|
||||
ldr r4, [sp]
|
||||
add r0, r4, #0
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
add r1, r0, #0
|
||||
lsl r1, r1, #0x10
|
||||
add r0, r5, #0
|
||||
@ -883,7 +883,7 @@ _021E6F5A:
|
||||
bl sub_020380B0
|
||||
ldr r4, [sp]
|
||||
add r0, r4, #0
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
add r1, r0, #0
|
||||
lsl r1, r1, #0x10
|
||||
add r0, r5, #0
|
||||
@ -978,7 +978,7 @@ _021E7022:
|
||||
beq _021E7044
|
||||
ldr r5, [sp]
|
||||
add r0, r5, #0
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
add r1, r0, #0
|
||||
lsl r1, r1, #0x10
|
||||
add r0, r4, #0
|
||||
|
@ -782,7 +782,7 @@ _0225A5E6:
|
||||
add r1, sp, #0
|
||||
bl FieldSystem_GetFacingObject
|
||||
ldr r0, [sp]
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
bl ov01_021F6BD0
|
||||
cmp r0, #0
|
||||
bne _0225A616
|
||||
|
@ -51,7 +51,7 @@ ov28_0225D520: ; 0x0225D520
|
||||
add r1, sp, #8
|
||||
bl FieldSystem_GetFacingObject
|
||||
ldr r0, [sp, #8]
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
bl ov01_021F6BD0
|
||||
cmp r0, #1
|
||||
beq _0225D59E
|
||||
@ -2499,7 +2499,7 @@ _0225E860:
|
||||
add r1, sp, #0
|
||||
bl FieldSystem_GetFacingObject
|
||||
ldr r0, [sp]
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
bl ov01_021F6BD0
|
||||
cmp r0, #1
|
||||
beq _0225E88E
|
||||
|
@ -2122,7 +2122,7 @@ GetEngagingTrainerParams: ; 0x0206426C
|
||||
str r2, [r5]
|
||||
str r3, [r5, #4]
|
||||
add r0, r4, #0
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
str r0, [r5, #8]
|
||||
lsl r0, r0, #0x10
|
||||
lsr r0, r0, #0x10
|
||||
@ -2471,7 +2471,7 @@ _02064500:
|
||||
thumb_func_start MapObject_GetTrainerNum
|
||||
MapObject_GetTrainerNum: ; 0x02064508
|
||||
push {r3, lr}
|
||||
bl MapObject_GetScript
|
||||
bl MapObject_GetScriptID
|
||||
lsl r0, r0, #0x10
|
||||
lsr r0, r0, #0x10
|
||||
bl ScriptNumToTrainerNum
|
||||
|
@ -182,12 +182,8 @@ void MapObject_CreateFromMultipleObjectEvents(MapObjectManager *manager, u32 map
|
||||
LocalMapObject *MapObjectManager_GetFirstActiveObjectByID(MapObjectManager *manager, u32 id);
|
||||
LocalMapObject *MapObjectManager_GetFirstActiveObjectWithMovement(MapObjectManager *manager, u32 movement);
|
||||
BOOL MapObjectManager_GetNextObjectWithFlagFromIndex(MapObjectManager *manager, LocalMapObject **objectDest, s32 *index, MapObjectFlagBits flag);
|
||||
void sub_0205EFB4(LocalMapObject *object);
|
||||
BOOL MapObject_ScriptIdIsFFFF(LocalMapObject *object);
|
||||
void sub_0205F014(LocalMapObject *object, ObjectEvent *template, u32 map_no);
|
||||
void sub_0205F058(LocalMapObject *object, u32 map_no, ObjectEvent *template);
|
||||
u32 sub_0205F09C(LocalMapObject *obj, u32 a1);
|
||||
BOOL sub_0205F0A8(LocalMapObject *object, u32 id, u32 a2);
|
||||
u32 sub_0205F09C(LocalMapObject *object, u32 param1);
|
||||
BOOL sub_0205F0A8(LocalMapObject *object, u32 mapId, u32 flagId);
|
||||
BOOL sub_0205F0F8(LocalMapObject *object, u32 spriteId, u32 id, u32 a3);
|
||||
void sub_0205F12C(SysTask *task, LocalMapObject *object);
|
||||
void sub_0205F148(LocalMapObject *object);
|
||||
@ -233,8 +229,8 @@ void MapObject_SetType(LocalMapObject *mapObject, u32 type);
|
||||
u32 MapObject_GetType(LocalMapObject *mapObject);
|
||||
void MapObject_SetFlagID(LocalMapObject *mapObject, u32 flagId);
|
||||
u32 MapObject_GetFlagID(LocalMapObject *object);
|
||||
void MapObject_SetScript(LocalMapObject *mapObject, u32 script);
|
||||
u32 MapObject_GetScript(LocalMapObject *mapObject);
|
||||
void MapObject_SetScriptID(LocalMapObject *mapObject, u32 script);
|
||||
u32 MapObject_GetScriptID(LocalMapObject *mapObject);
|
||||
void MapObject_SetInitialFacingDirection(LocalMapObject *object, u32 initial_facing);
|
||||
u32 MapObject_GetInitialFacingDirection(LocalMapObject *object);
|
||||
void MapObject_SetFacingDirectionDirect(LocalMapObject *object, u32 direction);
|
||||
@ -314,7 +310,7 @@ u16 ObjectEvent_GetSpriteID(ObjectEvent *);
|
||||
u16 ObjectEvent_GetMovement(ObjectEvent *);
|
||||
u16 ObjectEvent_GetType(ObjectEvent *);
|
||||
s16 ObjectEvent_GetInitialFacingDirection(ObjectEvent *);
|
||||
u16 ObjectEvent_GetScript(ObjectEvent *);
|
||||
u16 ObjectEvent_GetScriptID(ObjectEvent *);
|
||||
u16 ObjectEvent_GetParam(ObjectEvent *, int param);
|
||||
s16 ObjectEvent_GetXRange(ObjectEvent *);
|
||||
s16 ObjectEvent_GetYRange(ObjectEvent *);
|
||||
|
@ -6136,7 +6136,7 @@ static void Task_GetExp(SysTask *task, void *inData) {
|
||||
|
||||
sub_0200E398(bgConfig, 2, 1, 0, HEAP_ID_BATTLE);
|
||||
PaletteData_LoadNarc(palette, NARC_a_0_3_8, sub_0200E3D8(), HEAP_ID_BATTLE, PLTTBUF_MAIN_BG, 0x20, 8 * 0x10);
|
||||
AddWindowParameterized(bgConfig, window, GF_BG_LYR_MAIN_2, 0x11, 0x7, 14, 12, 11, (9 + 1));
|
||||
AddWindowParameterized(bgConfig, window, GF_BG_LYR_MAIN_2, 0x11, 0x7, 14, 12, 11, 9 + 1);
|
||||
FillWindowPixelBuffer(window, 0xFF);
|
||||
DrawFrameAndWindow1(window, FALSE, 1, 8);
|
||||
|
||||
|
@ -1792,12 +1792,12 @@ void FillWindowPixelBuffer(Window *window, u8 fillValue) {
|
||||
if (window->bgConfig->bgs[window->bgId].tileSize == 0x20) {
|
||||
fillValue |= fillValue << 4;
|
||||
}
|
||||
MI_CpuFillFast(window->pixelBuffer, ((fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0)), window->bgConfig->bgs[window->bgId].tileSize * window->width * window->height);
|
||||
MI_CpuFillFast(window->pixelBuffer, (fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0), window->bgConfig->bgs[window->bgId].tileSize * window->width * window->height);
|
||||
}
|
||||
|
||||
void FillWindowPixelBufferText_AssumeTileSize32(Window *window, u8 fillValue) {
|
||||
fillValue |= fillValue << 4;
|
||||
MI_CpuFillFast(window->pixelBuffer, ((fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0)), 32 * window->width * window->height);
|
||||
MI_CpuFillFast(window->pixelBuffer, (fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0), 32 * window->width * window->height);
|
||||
}
|
||||
|
||||
void BlitBitmapRectToWindow(Window *window, void *src, u16 srcX, u16 srcY, u16 srcWidth, u16 srcHeight, u16 destX, u16 destY, u16 destWidth, u16 destHeight) {
|
||||
|
@ -772,13 +772,13 @@ void CallTask_02050960(TaskManager *taskManager, s32 target, s32 maxLevel, u32 f
|
||||
u32 mode;
|
||||
|
||||
if (flag == 0) {
|
||||
setup = BattleSetup_New(HEAP_ID_FIELD, (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER));
|
||||
setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER);
|
||||
mode = 0;
|
||||
} else if (flag == 1) {
|
||||
setup = BattleSetup_New(HEAP_ID_FIELD, (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER));
|
||||
setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER);
|
||||
mode = 7;
|
||||
} else {
|
||||
setup = BattleSetup_New(HEAP_ID_FIELD, (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_MULTI | BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER));
|
||||
setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_FRONTIER | BATTLE_TYPE_MULTI | BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER);
|
||||
|
||||
// these don't seem right
|
||||
setup->trainerId[BATTLER_ENEMY] = TRAINER_RIVAL_SILVER;
|
||||
|
@ -984,7 +984,7 @@ static LocalMapObject *ov01_02201F98(MapObjectManager *mapObjectManager, u8 unkA
|
||||
MapObject_SetID(mapObj, unkA + 0xf6);
|
||||
MapObject_SetType(mapObj, 0);
|
||||
MapObject_SetFlagID(mapObj, 0);
|
||||
MapObject_SetScript(mapObj, 0);
|
||||
MapObject_SetScriptID(mapObj, 0);
|
||||
MapObject_SetParam(mapObj, 0, 2);
|
||||
sub_02069F0C(mapObj, species, (u8)form, FALSE, spriteId);
|
||||
MapObject_SetXRange(mapObj, -1);
|
||||
|
@ -221,7 +221,7 @@ void CreatePlayerAvatarMapObject(PlayerAvatar *avatar, MapObjectManager *man, u3
|
||||
MapObject_SetID(mapObj, 255);
|
||||
MapObject_SetType(mapObj, 0);
|
||||
MapObject_SetFlagID(mapObj, 0);
|
||||
MapObject_SetScript(mapObj, 0);
|
||||
MapObject_SetScriptID(mapObj, 0);
|
||||
MapObject_SetParam(mapObj, 0, 0);
|
||||
MapObject_SetParam(mapObj, 0, 1);
|
||||
MapObject_SetParam(mapObj, 0, 2);
|
||||
|
@ -1902,7 +1902,7 @@ static LocalMapObject *FollowMon_CreateMapObject(MapObjectManager *mapObjectMana
|
||||
MapObject_SetID(mapObject, obj_partner_poke);
|
||||
MapObject_SetType(mapObject, 0);
|
||||
MapObject_SetFlagID(mapObject, 0);
|
||||
MapObject_SetScript(mapObject, std_following_mon);
|
||||
MapObject_SetScriptID(mapObject, std_following_mon);
|
||||
MapObject_SetParam(mapObject, 0, 2);
|
||||
FollowMon_SetObjectParams(mapObject, species, form, shiny);
|
||||
MapObject_SetXRange(mapObject, -1);
|
||||
|
@ -14,6 +14,7 @@
|
||||
extern void sub_020611DC(LocalMapObject *object);
|
||||
extern BOOL sub_02061248(FieldSystem *fieldSystem, VecFx32 *, BOOL);
|
||||
extern void MapObject_ClearHeldMovement(LocalMapObject *object);
|
||||
extern void ov01_021FA2B8(LocalMapObject *object, BOOL set);
|
||||
|
||||
static MapObjectManager *MapObjectManager_New(u32 objectCount);
|
||||
static LocalMapObject *MapObject_CreateFromObjectEvent(MapObjectManager *manager, ObjectEvent *objectEvent, u32 mapNo);
|
||||
@ -39,6 +40,10 @@ static void sub_0205EF5C(LocalMapObject *object);
|
||||
static void MapObject_NoOp(LocalMapObject *object);
|
||||
static u32 FieldSystem_ResolveObjectSpriteID(FieldSystem *fieldSystem, s32 spriteId);
|
||||
static void sub_0205EFA4(LocalMapObject *object);
|
||||
static void sub_0205EFB4(LocalMapObject *object);
|
||||
static BOOL MapObject_ScriptIDIsFFFF(LocalMapObject *object);
|
||||
static void sub_0205F014(LocalMapObject *object, ObjectEvent *objectEvent, u32 mapNo);
|
||||
static void sub_0205F058(LocalMapObject *object, u32 mapNo, ObjectEvent *objectEvent);
|
||||
|
||||
static void sub_0205EF8C(LocalMapObject *object);
|
||||
|
||||
@ -341,7 +346,7 @@ static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, Loca
|
||||
savedObject->movement = MapObject_GetMovement(localObject);
|
||||
savedObject->type = MapObject_GetType(localObject);
|
||||
savedObject->flagId = MapObject_GetFlagID(localObject);
|
||||
savedObject->script = MapObject_GetScript(localObject);
|
||||
savedObject->script = MapObject_GetScriptID(localObject);
|
||||
savedObject->initialFacing = MapObject_GetInitialFacingDirection(localObject);
|
||||
savedObject->currentFacing = MapObject_GetFacingDirection(localObject);
|
||||
savedObject->nextFacing = MapObject_GetNextFacingDirection(localObject);
|
||||
@ -383,7 +388,7 @@ static void LocalMapObject_InitFromSavedMapObject(LocalMapObject *localObject, S
|
||||
MapObject_SetMovement(localObject, savedObject->movement);
|
||||
MapObject_SetType(localObject, savedObject->type);
|
||||
MapObject_SetFlagID(localObject, savedObject->flagId);
|
||||
MapObject_SetScript(localObject, savedObject->script);
|
||||
MapObject_SetScriptID(localObject, savedObject->script);
|
||||
MapObject_SetInitialFacingDirection(localObject, savedObject->initialFacing);
|
||||
MapObject_SetFacingDirectionDirect(localObject, savedObject->currentFacing);
|
||||
MapObject_SetNextFacingDirection(localObject, savedObject->nextFacing);
|
||||
@ -524,7 +529,7 @@ static void MapObject_InitFromObjectEvent(LocalMapObject *object, ObjectEvent *o
|
||||
MapObject_SetMovement(object, ObjectEvent_GetMovement(objectEvent));
|
||||
MapObject_SetType(object, ObjectEvent_GetType(objectEvent));
|
||||
MapObject_SetFlagID(object, ObjectEvent_GetFlagID(objectEvent));
|
||||
MapObject_SetScript(object, ObjectEvent_GetScript(objectEvent));
|
||||
MapObject_SetScriptID(object, ObjectEvent_GetScriptID(objectEvent));
|
||||
MapObject_SetInitialFacingDirection(object, ObjectEvent_GetInitialFacingDirection(objectEvent));
|
||||
MapObject_SetParam(object, ObjectEvent_GetParam(objectEvent, 0), 0);
|
||||
MapObject_SetParam(object, ObjectEvent_GetParam(objectEvent, 1), 1);
|
||||
@ -561,7 +566,7 @@ static void MapObject_SetPositionVecFromObjectEvent(LocalMapObject *object, Obje
|
||||
|
||||
static void sub_0205EC90(LocalMapObject *object, MapObjectManager *manager) { // setup facing and flags? also sets manager?
|
||||
MapObject_SetFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK12 | MAPOBJECTFLAG_UNK11 | MAPOBJECTFLAG_ACTIVE));
|
||||
if (MapObject_ScriptIdIsFFFF(object) == TRUE) {
|
||||
if (MapObject_ScriptIDIsFFFF(object) == TRUE) {
|
||||
MapObject_SetFlag25(object, TRUE);
|
||||
}
|
||||
MapObject_SetManager(object, manager);
|
||||
@ -720,9 +725,7 @@ static void sub_0205EFA4(LocalMapObject *object) {
|
||||
sub_0205FD20(object);
|
||||
}
|
||||
|
||||
extern void ov01_021FA2B8(LocalMapObject *, BOOL set);
|
||||
|
||||
void sub_0205EFB4(LocalMapObject *object) {
|
||||
static void sub_0205EFB4(LocalMapObject *object) {
|
||||
if (!sub_0205F5D4(MapObject_GetManager(object))) {
|
||||
return;
|
||||
}
|
||||
@ -737,48 +740,48 @@ void sub_0205EFB4(LocalMapObject *object) {
|
||||
}
|
||||
}
|
||||
|
||||
BOOL MapObject_ScriptIdIsFFFF(LocalMapObject *object) {
|
||||
u16 script = MapObject_GetScript(object);
|
||||
static BOOL MapObject_ScriptIDIsFFFF(LocalMapObject *object) {
|
||||
u16 script = MapObject_GetScriptID(object);
|
||||
return script == 0xFFFF;
|
||||
}
|
||||
|
||||
void sub_0205F014(LocalMapObject *object, ObjectEvent *template, u32 map_no) {
|
||||
static void sub_0205F014(LocalMapObject *object, ObjectEvent *objectEvent, u32 mapNo) {
|
||||
GF_ASSERT(MapObject_CheckFlag25(object) == TRUE);
|
||||
|
||||
MapObject_SetFlag25(object, FALSE);
|
||||
sub_0205F250(object, map_no);
|
||||
MapObject_SetScript(object, ObjectEvent_GetScript(template));
|
||||
MapObject_SetFlagID(object, ObjectEvent_GetFlagID(template));
|
||||
sub_0205F250(object, mapNo);
|
||||
MapObject_SetScriptID(object, ObjectEvent_GetScriptID(objectEvent));
|
||||
MapObject_SetFlagID(object, ObjectEvent_GetFlagID(objectEvent));
|
||||
}
|
||||
|
||||
void sub_0205F058(LocalMapObject *object, u32 map_no, ObjectEvent *template) {
|
||||
GF_ASSERT(ObjectEvent_ScriptIDIsUnset(template) == TRUE);
|
||||
static void sub_0205F058(LocalMapObject *object, u32 mapNo, ObjectEvent *objectEvent) {
|
||||
GF_ASSERT(ObjectEvent_ScriptIDIsUnset(objectEvent) == TRUE);
|
||||
|
||||
MapObject_SetFlag25(object, TRUE);
|
||||
MapObject_SetScript(object, ObjectEvent_GetScript(template));
|
||||
MapObject_SetFlagID(object, ObjectEvent_GetFlagID_AssertScriptIDIsUnset(template));
|
||||
sub_0205F250(object, map_no);
|
||||
MapObject_SetScriptID(object, ObjectEvent_GetScriptID(objectEvent));
|
||||
MapObject_SetFlagID(object, ObjectEvent_GetFlagID_AssertScriptIDIsUnset(objectEvent));
|
||||
sub_0205F250(object, mapNo);
|
||||
}
|
||||
|
||||
u32 sub_0205F09C(LocalMapObject *object, u32 a1) {
|
||||
return (u32)(sub_0205F538(object) + a1);
|
||||
u32 sub_0205F09C(LocalMapObject *object, u32 param1) {
|
||||
return (u32)(sub_0205F538(object) + param1);
|
||||
}
|
||||
|
||||
BOOL sub_0205F0A8(LocalMapObject *object, u32 id, u32 a2) {
|
||||
BOOL sub_0205F0A8(LocalMapObject *object, u32 mapId, u32 flagId) {
|
||||
if (!MapObject_TestFlagsBits(object, MAPOBJECTFLAG_ACTIVE)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (id != MapObject_GetID(object)) {
|
||||
if (MapObject_GetID(object) != mapId) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (a2 != sub_0205F254(object)) {
|
||||
if (sub_0205F254(object) != flagId) {
|
||||
if (!MapObject_CheckFlag25(object)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (a2 != sub_0205F544(object)) {
|
||||
if (sub_0205F544(object) != flagId) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -997,11 +1000,11 @@ u32 MapObject_GetFlagID(LocalMapObject *object) {
|
||||
return object->evFlagId;
|
||||
}
|
||||
|
||||
void MapObject_SetScript(LocalMapObject *object, u32 script) {
|
||||
void MapObject_SetScriptID(LocalMapObject *object, u32 script) {
|
||||
object->scriptId = script;
|
||||
}
|
||||
|
||||
u32 MapObject_GetScript(LocalMapObject *object) {
|
||||
u32 MapObject_GetScriptID(LocalMapObject *object) {
|
||||
return object->scriptId;
|
||||
}
|
||||
|
||||
@ -1337,7 +1340,7 @@ void MapObjectManager_UnpauseAllMovement(MapObjectManager *manager) {
|
||||
}
|
||||
|
||||
BOOL sub_0205F5D4(MapObjectManager *manager) {
|
||||
return MapObjectManager_GetFlagsBitsMask(manager, (1 << 0)) != 0;
|
||||
return MapObjectManager_GetFlagsBitsMask(manager, 1 << 0) != 0;
|
||||
}
|
||||
|
||||
u32 sub_0205F5E8(LocalMapObject *object, u32 bits) {
|
||||
@ -1346,14 +1349,14 @@ u32 sub_0205F5E8(LocalMapObject *object, u32 bits) {
|
||||
|
||||
void sub_0205F5F8(MapObjectManager *manager, BOOL clear) {
|
||||
if (clear == FALSE) {
|
||||
MapObjectManager_SetFlagsBits(manager, (1 << 3));
|
||||
MapObjectManager_SetFlagsBits(manager, 1 << 3);
|
||||
} else {
|
||||
MapObjectManager_ClearFlagsBits(manager, (1 << 3));
|
||||
MapObjectManager_ClearFlagsBits(manager, 1 << 3);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL sub_0205F610(MapObjectManager *manager) {
|
||||
return MapObjectManager_GetFlagsBitsMask(manager, (1 << 3)) == 0;
|
||||
return MapObjectManager_GetFlagsBitsMask(manager, 1 << 3) == 0;
|
||||
}
|
||||
|
||||
BOOL MapObject_IsInUse(LocalMapObject *object) {
|
||||
@ -1537,7 +1540,7 @@ BOOL MapObject_CheckFlag29(LocalMapObject *object) {
|
||||
}
|
||||
|
||||
BOOL sub_0205F8D0(LocalMapObject *object) {
|
||||
return MapObject_GetFlags2Mask(object, (1 << 2)) != FALSE;
|
||||
return MapObject_GetFlags2Mask(object, 1 << 2) != FALSE;
|
||||
}
|
||||
|
||||
u32 MapObject_GetInitialX(LocalMapObject *object) {
|
||||
@ -1717,7 +1720,7 @@ void ObjectEvent_SetScript(ObjectEvent *template, u16 script) {
|
||||
template->scr = script;
|
||||
}
|
||||
|
||||
u16 ObjectEvent_GetScript(ObjectEvent *template) {
|
||||
u16 ObjectEvent_GetScriptID(ObjectEvent *template) {
|
||||
return template->scr;
|
||||
}
|
||||
|
||||
@ -1816,7 +1819,7 @@ ObjectEvent *ObjectEvent_GetById(u16 id, int num_templates, ObjectEvent *templat
|
||||
}
|
||||
|
||||
BOOL ObjectEvent_ScriptIDIsUnset(ObjectEvent *template) {
|
||||
u16 script = (u16)(u32)ObjectEvent_GetScript(template);
|
||||
u16 script = (u16)(u32)ObjectEvent_GetScriptID(template);
|
||||
return script == 0xFFFF;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ void ov26_022599D8(FieldSystem *fieldSystem, LocalMapObject *last_talked) {
|
||||
|
||||
static LocalMapObject *ov26_02259A24(FieldSystem *fieldSystem, LocalMapObject *a1, BOOL a2) {
|
||||
u32 num_events = Field_GetNumObjectEvents(fieldSystem);
|
||||
u16 script = MapObject_GetScript(a1);
|
||||
u16 script = MapObject_GetScriptID(a1);
|
||||
u32 trainer = ScriptNumToTrainerNum(script);
|
||||
|
||||
if (!TrainerNumIsDouble(trainer)) {
|
||||
@ -62,7 +62,7 @@ static LocalMapObject *ov26_02259A24(FieldSystem *fieldSystem, LocalMapObject *a
|
||||
case 7:
|
||||
case 8:
|
||||
case 1: {
|
||||
u32 script2 = MapObject_GetScript(object);
|
||||
u32 script2 = MapObject_GetScriptID(object);
|
||||
u32 trainer2 = ScriptNumToTrainerNum((u16)script2);
|
||||
if (script != script2 && (u32)trainer == trainer2) {
|
||||
return object;
|
||||
|
@ -324,13 +324,13 @@ RenderResult RenderText(TextPrinter *printer) {
|
||||
ScrollWindow(printer->template.window,
|
||||
0,
|
||||
printer->scrollDistance,
|
||||
(printer->template.bgColor | (printer->template.bgColor << 4)));
|
||||
printer->template.bgColor | (printer->template.bgColor << 4));
|
||||
printer->scrollDistance = 0;
|
||||
} else {
|
||||
ScrollWindow(printer->template.window,
|
||||
0,
|
||||
4,
|
||||
(printer->template.bgColor | (printer->template.bgColor << 4)));
|
||||
printer->template.bgColor | (printer->template.bgColor << 4));
|
||||
|
||||
printer->scrollDistance -= 4;
|
||||
}
|
||||
@ -413,34 +413,34 @@ static void TextPrinter_DrawDownArrow(TextPrinter *printer) {
|
||||
|
||||
FillBgTilemapRect(printer->template.window->bgConfig,
|
||||
bg_id,
|
||||
(baseTile + 18 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4),
|
||||
(x + width + 1),
|
||||
(y + height),
|
||||
baseTile + 18 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4,
|
||||
x + width + 1,
|
||||
y + height,
|
||||
1,
|
||||
1,
|
||||
0x10);
|
||||
|
||||
FillBgTilemapRect(printer->template.window->bgConfig,
|
||||
bg_id,
|
||||
(baseTile + 19 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4),
|
||||
(x + width + 2),
|
||||
(y + height),
|
||||
baseTile + 19 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4,
|
||||
x + width + 2,
|
||||
y + height,
|
||||
1,
|
||||
1,
|
||||
0x10);
|
||||
FillBgTilemapRect(printer->template.window->bgConfig,
|
||||
bg_id,
|
||||
(baseTile + 20 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4),
|
||||
(x + width + 1),
|
||||
(y + height + 1),
|
||||
baseTile + 20 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4,
|
||||
x + width + 1,
|
||||
y + height + 1,
|
||||
1,
|
||||
1,
|
||||
0x10);
|
||||
FillBgTilemapRect(printer->template.window->bgConfig,
|
||||
bg_id,
|
||||
(baseTile + 21 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4),
|
||||
(x + width + 2),
|
||||
(y + height + 1),
|
||||
baseTile + 21 + sDownArrowTileOffsets[subStruct->downArrowYPosIdx] * 4,
|
||||
x + width + 2,
|
||||
y + height + 1,
|
||||
1,
|
||||
1,
|
||||
0x10);
|
||||
@ -464,17 +464,17 @@ static void TextPrinter_ClearDownArrow(TextPrinter *printer) {
|
||||
|
||||
FillBgTilemapRect(printer->template.window->bgConfig,
|
||||
bg_id,
|
||||
(baseTile + 10),
|
||||
(x + width + 1),
|
||||
(y + height),
|
||||
baseTile + 10,
|
||||
x + width + 1,
|
||||
y + height,
|
||||
1,
|
||||
2,
|
||||
0x10);
|
||||
FillBgTilemapRect(printer->template.window->bgConfig,
|
||||
bg_id,
|
||||
(baseTile + 11),
|
||||
(x + width + 2),
|
||||
(y + height),
|
||||
baseTile + 11,
|
||||
x + width + 2,
|
||||
y + height,
|
||||
1,
|
||||
2,
|
||||
0x10);
|
||||
|
@ -187,7 +187,7 @@ static LocalMapObject *CreateDaycareMonSpriteInternal(MapObjectManager *object_m
|
||||
MapObject_SetID(lmo, obj_daycare_poke_1 + dc_mon_idx);
|
||||
MapObject_SetType(lmo, 0);
|
||||
MapObject_SetFlagID(lmo, 0);
|
||||
MapObject_SetScript(lmo, 0);
|
||||
MapObject_SetScriptID(lmo, 0);
|
||||
MapObject_SetParam(lmo, 0, 2);
|
||||
FollowMon_SetObjectParams(lmo, species, (u32)form, shiny);
|
||||
MapObject_SetXRange(lmo, -1);
|
||||
|
12
src/system.c
12
src/system.c
@ -323,9 +323,9 @@ void ReadKeypadAndTouchpad(void) {
|
||||
adrs |= tmp; \
|
||||
}
|
||||
|
||||
#define BUTTON_HIDE(adrs, pat) \
|
||||
{ \
|
||||
adrs &= (pat ^ 0xFFFF); \
|
||||
#define BUTTON_HIDE(adrs, pat) \
|
||||
{ \
|
||||
adrs &= ((pat) ^ 0xFFFF); \
|
||||
}
|
||||
|
||||
void sub_0201A5E8(void) {
|
||||
@ -346,9 +346,9 @@ void sub_0201A5E8(void) {
|
||||
BUTTON_COPY(gSystem.newKeys, PAD_BUTTON_L, PAD_BUTTON_A);
|
||||
BUTTON_COPY(gSystem.heldKeys, PAD_BUTTON_L, PAD_BUTTON_A);
|
||||
BUTTON_COPY(gSystem.newAndRepeatedKeys, PAD_BUTTON_L, PAD_BUTTON_A);
|
||||
BUTTON_HIDE(gSystem.newKeys, (PAD_BUTTON_L | PAD_BUTTON_R));
|
||||
BUTTON_HIDE(gSystem.heldKeys, (PAD_BUTTON_L | PAD_BUTTON_R));
|
||||
BUTTON_HIDE(gSystem.newAndRepeatedKeys, (PAD_BUTTON_L | PAD_BUTTON_R));
|
||||
BUTTON_HIDE(gSystem.newKeys, PAD_BUTTON_L | PAD_BUTTON_R);
|
||||
BUTTON_HIDE(gSystem.heldKeys, PAD_BUTTON_L | PAD_BUTTON_R);
|
||||
BUTTON_HIDE(gSystem.newAndRepeatedKeys, PAD_BUTTON_L | PAD_BUTTON_R);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user