From 27567719586859201cab665f9406ef8f39a39748 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 4 Dec 2019 21:00:45 -0500 Subject: [PATCH] More usage of ST_OAM constants and SPRITE macros --- gflib/sprite.c | 43 +- src/battle_anim_effects_1.c | 4 +- src/battle_anim_effects_2.c | 2 +- src/battle_anim_effects_3.c | 2 +- src/battle_anim_mons.c | 4 +- src/battle_anim_status_effects.c | 36 +- src/battle_controller_link_opponent.c | 4 +- src/battle_controller_link_partner.c | 4 +- src/battle_controller_opponent.c | 4 +- src/battle_controller_player.c | 6 +- src/battle_controller_player_partner.c | 6 +- src/battle_controller_recorded_opponent.c | 4 +- src/battle_controller_recorded_player.c | 6 +- src/battle_controller_wally.c | 4 +- src/battle_interface.c | 275 ++- src/battle_transition.c | 18 +- src/contest.c | 10 +- src/credits.c | 4 +- .../field_event_obj/event_object_subsprites.h | 1530 +++++++++++++++-- src/electric.c | 8 +- src/event_object_movement.c | 16 +- src/evolution_graphics.c | 20 +- src/field_effect.c | 96 +- src/field_effect_helpers.c | 4 +- src/field_player_avatar.c | 4 +- src/field_weather_effect.c | 6 +- src/flying.c | 2 +- src/hall_of_fame.c | 2 +- src/intro.c | 40 +- src/intro_credits_graphics.c | 2 +- src/item_menu_icons.c | 2 +- src/main_menu.c | 40 +- src/mon_markings.c | 6 +- src/naming_screen.c | 172 +- src/pokeblock.c | 4 +- src/pokeblock_feed.c | 8 +- src/pokedex.c | 12 +- src/pokemon_animation.c | 6 +- src/pokemon_icon.c | 32 +- src/pokemon_storage_system.c | 10 +- src/pokenav_unk_2.c | 2 +- src/pokenav_unk_7.c | 4 +- src/psychic.c | 4 +- src/rayquaza_scene.c | 4 +- src/region_map.c | 12 +- src/rock.c | 4 +- src/rom_8034C54.c | 28 +- src/roulette.c | 2 +- src/shop.c | 4 +- src/title_screen.c | 12 +- src/trade.c | 8 +- src/use_pokeblock.c | 4 +- 52 files changed, 2078 insertions(+), 468 deletions(-) diff --git a/gflib/sprite.c b/gflib/sprite.c index e25eac62e..2e96acf2c 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -264,23 +264,26 @@ static const s32 sUnknown_082EC6F4[3][4][2] = static const struct OamDimensions sOamDimensions[3][4] = { - { // square - { 8, 8 }, - { 16, 16 }, - { 32, 32 }, - { 64, 64 }, + [ST_OAM_SQUARE] = + { + [SPRITE_SIZE(8x8)] = { 8, 8 }, + [SPRITE_SIZE(16x16)] = { 16, 16 }, + [SPRITE_SIZE(32x32)] = { 32, 32 }, + [SPRITE_SIZE(64x64)] = { 64, 64 }, }, - { // horizontal rectangle - { 16, 8 }, - { 32, 8 }, - { 32, 16 }, - { 64, 32 }, + [ST_OAM_H_RECTANGLE] = + { + [SPRITE_SIZE(16x8)] = { 16, 8 }, + [SPRITE_SIZE(32x8)] = { 32, 8 }, + [SPRITE_SIZE(32x16)] = { 32, 16 }, + [SPRITE_SIZE(64x32)] = { 64, 32 }, }, - { // vertical rectangle - { 8, 16 }, - { 8, 32 }, - { 16, 32 }, - { 32, 64 }, + [ST_OAM_V_RECTANGLE] = + { + [SPRITE_SIZE(8x16)] = { 8, 16 }, + [SPRITE_SIZE(8x32)] = { 8, 32 }, + [SPRITE_SIZE(16x32)] = { 16, 32 }, + [SPRITE_SIZE(32x64)] = { 32, 64 }, }, }; @@ -406,10 +409,10 @@ void SortSprites(void) sprite2Y = sprite2Y - 256; if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite1->oam.size == 3) + && sprite1->oam.size == ST_OAM_SIZE_3) { u32 shape = sprite1->oam.shape; - if (shape == ST_OAM_SQUARE || shape == 2) + if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) { if (sprite1Y > 128) sprite1Y = sprite1Y - 256; @@ -417,7 +420,7 @@ void SortSprites(void) } if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite2->oam.size == 3) + && sprite2->oam.size == ST_OAM_SIZE_3) { u32 shape = sprite2->oam.shape; if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) @@ -455,7 +458,7 @@ void SortSprites(void) sprite2Y = sprite2Y - 256; if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite1->oam.size == 3) + && sprite1->oam.size == ST_OAM_SIZE_3) { u32 shape = sprite1->oam.shape; if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) @@ -466,7 +469,7 @@ void SortSprites(void) } if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite2->oam.size == 3) + && sprite2->oam.size == ST_OAM_SIZE_3) { u32 shape = sprite2->oam.shape; if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 1efa860d3..1efb29ecd 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -4947,8 +4947,8 @@ void AnimMoon(struct Sprite* sprite) sprite->pos1.y = gBattleAnimArgs[1]; } - sprite->oam.shape = 0; - sprite->oam.size = 3; + sprite->oam.shape = SPRITE_SHAPE(64x64); + sprite->oam.size = SPRITE_SIZE(64x64); sprite->data[0] = 0; sprite->callback = AnimMoonStep; } diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 273dedc38..dcbcced39 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -2124,7 +2124,7 @@ static void CreateMinimizeSprite(struct Task* task, u8 taskId) gSprites[spriteId].data[2] = 6; gSprites[spriteId].callback = ClonedMinizeSprite_Step; SetSpriteRotScale(spriteId, task->data[4], task->data[4], 0); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); } } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 248228847..1778ce881 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -4709,7 +4709,7 @@ void AnimTask_MonToSubstitute(u8 taskId) if (gTasks[taskId].data[0] == 0) { - PrepareBattlerSpriteForRotScale(spriteId, FALSE); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); gTasks[taskId].data[1] = 0x100; gTasks[taskId].data[2] = 0x100; gTasks[taskId].data[0]++; diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 43890f24a..b356d57e0 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -1253,7 +1253,7 @@ void ResetSpriteRotScale(u8 spriteId) { SetSpriteRotScale(spriteId, 0x100, 0x100, 0); gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteId].oam.objMode = 0; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_NORMAL; gSprites[spriteId].affineAnimPaused = FALSE; CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); } @@ -2267,7 +2267,7 @@ u8 sub_80A89C8(int battlerId, u8 spriteId, int species) gSprites[newSpriteId] = gSprites[spriteId]; gSprites[newSpriteId].usingSheet = TRUE; gSprites[newSpriteId].oam.priority = 0; - gSprites[newSpriteId].oam.objMode = 2; + gSprites[newSpriteId].oam.objMode = ST_OAM_OBJ_WINDOW; gSprites[newSpriteId].oam.tileNum = gSprites[spriteId].oam.tileNum; gSprites[newSpriteId].callback = SpriteCallbackDummy; return newSpriteId; diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index e608cf041..003b6d2ef 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -206,10 +206,38 @@ const struct SpriteTemplate gUnknown_0853EF18 = static const struct Subsprite gUnknown_0853EF30[] = { - {.x = -16, .y = -16, .shape = ST_OAM_SQUARE, .size = 3, .tileOffset = 0, .priority = 2}, - {.x = -16, .y = 48, .shape = ST_OAM_H_RECTANGLE, .size = 3, .tileOffset = 64, .priority = 2}, - {.x = 48, .y = -16, .shape = ST_OAM_V_RECTANGLE, .size = 3, .tileOffset = 96, .priority = 2}, - {.x = 48, .y = 48, .shape = ST_OAM_SQUARE, .size = 2, .tileOffset = 128, .priority = 2}, + { + .x = -16, + .y = -16, + .shape = SPRITE_SHAPE(64x64), + .size = SPRITE_SIZE(64x64), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = 48, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 64, + .priority = 2 + }, + { + .x = 48, + .y = -16, + .shape = SPRITE_SHAPE(32x64), + .size = SPRITE_SIZE(32x64), + .tileOffset = 96, + .priority = 2 + }, + { + .x = 48, + .y = 48, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 128, + .priority = 2 + }, }; static const struct SubspriteTable gUnknown_0853EF40[] = diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index d3842e416..e888531cb 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1429,7 +1429,7 @@ static void LinkOpponentDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1438,7 +1438,7 @@ static void LinkOpponentDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 1c92aaaad..1382e3a8b 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1253,7 +1253,7 @@ static void LinkPartnerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1262,7 +1262,7 @@ static void LinkPartnerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index e096536c9..daf2c260e 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1465,7 +1465,7 @@ static void OpponentDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1474,7 +1474,7 @@ static void OpponentDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 57239bca6..0bd1ea363 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2313,7 +2313,7 @@ static void PlayerHandleDrawTrainerPic(void) gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; - gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1; } // Use the back pic in any other scenario. @@ -2485,7 +2485,7 @@ static void PlayerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -2494,7 +2494,7 @@ static void PlayerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index e625f24de..21c1fdd5b 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1334,7 +1334,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; - gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1; } @@ -1444,7 +1444,7 @@ static void PlayerPartnerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1453,7 +1453,7 @@ static void PlayerPartnerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index b21d8288c..7c1bff64a 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1355,7 +1355,7 @@ static void RecordedOpponentDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1364,7 +1364,7 @@ static void RecordedOpponentDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index b59a4f25d..5f3b3ea65 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1238,7 +1238,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; - gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1; } else @@ -1359,7 +1359,7 @@ static void RecordedPlayerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1368,7 +1368,7 @@ static void RecordedPlayerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index f7035540b..a5b1ae2f7 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1134,7 +1134,7 @@ static void WallyDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(0); + sub_805EB9C(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1143,7 +1143,7 @@ static void WallyDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(1); + sub_805EB9C(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); diff --git a/src/battle_interface.c b/src/battle_interface.c index 05d34d6c5..cf9aa7f1b 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -330,45 +330,178 @@ static const struct SpriteTemplate sHealthbarSpriteTemplates[MAX_BATTLERS_COUNT] static const struct Subsprite sUnknown_0832C220[] = { - {240, 0, 1, 3, 0, 1}, - {48, 0, 0, 2, 32, 1}, - {240, 32, 1, 1, 48, 1}, - {16, 32, 1, 1, 52, 1}, - {48, 32, 1, 1, 56, 1} + { + .x = 240, + .y = 0, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 48, + .y = 0, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 32, + .priority = 1 + }, + { + .x = 240, + .y = 32, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 48, + .priority = 1 + }, + { + .x = 16, + .y = 32, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 52, + .priority = 1 + }, + { + .x = 48, + .y = 32, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 56, + .priority = 1 + } }; static const struct Subsprite sUnknown_0832C234[] = { - {240, 0, 1, 3, 64, 1}, - {48, 0, 0, 2, 96, 1}, - {240, 32, 1, 1, 112, 1}, - {16, 32, 1, 1, 116, 1}, - {48, 32, 1, 1, 120, 1} + { + .x = 240, + .y = 0, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 64, + .priority = 1 + }, + { + .x = 48, + .y = 0, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 96, + .priority = 1 + }, + { + .x = 240, + .y = 32, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 112, + .priority = 1 + }, + { + .x = 16, + .y = 32, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 116, + .priority = 1 + }, + { + .x = 48, + .y = 32, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 120, + .priority = 1 + } }; static const struct Subsprite sUnknown_0832C248[] = { - {240, 0, 1, 3, 0, 1}, - {48, 0, 0, 2, 32, 1} + { + .x = 240, + .y = 0, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 48, + .y = 0, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 32, + .priority = 1 + } }; static const struct Subsprite sUnknown_0832C250[] = { - {240, 0, 1, 3, 0, 1}, - {48, 0, 0, 2, 32, 1} + { + .x = 240, + .y = 0, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 48, + .y = 0, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 32, + .priority = 1 + } }; static const struct Subsprite sUnknown_0832C258[] = { - {240, 0, 1, 1, 0, 1}, - {16, 0, 1, 1, 4, 1} + { + .x = 240, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 16, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + } }; static const struct Subsprite sUnknown_0832C260[] = { - {240, 0, 1, 1, 0, 1}, - {16, 0, 1, 1, 4, 1}, - {224, 0, 0, 0, 8, 1} + { + .x = 240, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 16, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 224, + .y = 0, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 8, + .priority = 1 + } }; // unused subsprite table @@ -388,20 +521,90 @@ static const struct SubspriteTable sUnknown_0832C28C[] = static const struct Subsprite sStatusSummaryBar_Subsprites_0[] = { - {160, 0, 1, 1, 0, 1}, - {192, 0, 1, 1, 4, 1}, - {224, 0, 1, 1, 8, 1}, - {0, 0, 1, 1, 12, 1} + { + .x = 160, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 192, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 224, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = 0, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 1 + } }; static const struct Subsprite sUnknown_0832C2AC[] = { - {160, 0, 1, 1, 0, 1}, - {192, 0, 1, 1, 4, 1}, - {224, 0, 1, 1, 8, 1}, - {0, 0, 1, 1, 8, 1}, - {32, 0, 1, 1, 8, 1}, - {64, 0, 1, 1, 12, 1} + { + .x = 160, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 192, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 224, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = 0, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = 32, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = 64, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 1 + } }; static const struct SubspriteTable sStatusSummaryBar_SubspriteTable[] = @@ -910,9 +1113,9 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) healthboxLeftSpriteId = CreateSprite(&sHealthboxPlayerSpriteTemplates[0], 240, 160, 1); healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[0], 240, 160, 1); - gSprites[healthboxLeftSpriteId].oam.shape = 0; + gSprites[healthboxLeftSpriteId].oam.shape = ST_OAM_SQUARE; - gSprites[healthboxRightSpriteId].oam.shape = 0; + gSprites[healthboxRightSpriteId].oam.shape = ST_OAM_SQUARE; gSprites[healthboxRightSpriteId].oam.tileNum += 64; } else @@ -962,7 +1165,7 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) healthbarSpriteId = CreateSpriteAtEnd(&sHealthbarSpriteTemplates[gBattlerPositions[battlerId]], 140, 60, 0); healthBarSpritePtr = &gSprites[healthbarSpriteId]; SetSubspriteTables(healthBarSpritePtr, &sUnknown_0832C28C[GetBattlerSide(battlerId)]); - healthBarSpritePtr->subspriteMode = 2; + healthBarSpritePtr->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; healthBarSpritePtr->oam.priority = 1; CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void*)(OBJ_VRAM0 + healthBarSpritePtr->oam.tileNum * TILE_SIZE_4BPP), 64); @@ -987,8 +1190,8 @@ u8 CreateSafariPlayerHealthboxSprites(void) healthboxLeftSpriteId = CreateSprite(&sHealthboxSafariSpriteTemplate, 240, 160, 1); healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxSafariSpriteTemplate, 240, 160, 1); - gSprites[healthboxLeftSpriteId].oam.shape = 0; - gSprites[healthboxRightSpriteId].oam.shape = 0; + gSprites[healthboxLeftSpriteId].oam.shape = ST_OAM_SQUARE; + gSprites[healthboxRightSpriteId].oam.shape = ST_OAM_SQUARE; gSprites[healthboxRightSpriteId].oam.tileNum += 64; @@ -1711,9 +1914,9 @@ void Task_HidePartyStatusSummary(u8 taskId) gTasks[taskId].tData15 = 16; for (i = 0; i < PARTY_SIZE; i++) - gSprites[ballIconSpriteIds[i]].oam.objMode = 1; + gSprites[ballIconSpriteIds[i]].oam.objMode = ST_OAM_OBJ_BLEND; - gSprites[summaryBarSpriteId].oam.objMode = 1; + gSprites[summaryBarSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; if (isBattleStart) { diff --git a/src/battle_transition.c b/src/battle_transition.c index bfaaa5f7c..9e66b8938 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1672,7 +1672,7 @@ bool8 FldEff_Pokeball(void) { u8 spriteId = CreateSpriteAtEnd(&gUnknown_085C8E68, gFieldEffectArguments[0], gFieldEffectArguments[1], 0); gSprites[spriteId].oam.priority = 0; - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].data[0] = gFieldEffectArguments[2]; gSprites[spriteId].data[1] = gFieldEffectArguments[3]; gSprites[spriteId].data[2] = -1; @@ -2394,20 +2394,20 @@ static void Mugshots_CreateOpponentPlayerSprites(struct Task *task) opponentSprite->callback = sub_8148380; playerSprite->callback = sub_8148380; - opponentSprite->oam.affineMode = 3; - playerSprite->oam.affineMode = 3; + opponentSprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; + playerSprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; opponentSprite->oam.matrixNum = AllocOamMatrix(); playerSprite->oam.matrixNum = AllocOamMatrix(); - opponentSprite->oam.shape = 1; - playerSprite->oam.shape = 1; + opponentSprite->oam.shape = SPRITE_SHAPE(64x32); + playerSprite->oam.shape = SPRITE_SHAPE(64x32); - opponentSprite->oam.size = 3; - playerSprite->oam.size = 3; + opponentSprite->oam.size = SPRITE_SIZE(64x32); + playerSprite->oam.size = SPRITE_SIZE(64x32); - CalcCenterToCornerVec(opponentSprite, 1, 3, 3); - CalcCenterToCornerVec(playerSprite, 1, 3, 3); + CalcCenterToCornerVec(opponentSprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE); + CalcCenterToCornerVec(playerSprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE); SetOamMatrixRotationScaling(opponentSprite->oam.matrixNum, sMugshotsOpponentRotationScales[mugshotId][0], sMugshotsOpponentRotationScales[mugshotId][1], 0); SetOamMatrixRotationScaling(playerSprite->oam.matrixNum, -512, 512, 0); diff --git a/src/contest.c b/src/contest.c index 2b2007f7c..e538b5ae0 100644 --- a/src/contest.c +++ b/src/contest.c @@ -414,16 +414,16 @@ const struct Subsprite gSubspriteTable_8587B78[] = { .x = -28, .y = -4, - .shape = ST_OAM_H_RECTANGLE, - .size = 1, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), .tileOffset = 0, .priority = 0 }, { .x = 4, .y = -4, - .shape = ST_OAM_H_RECTANGLE, - .size = 1, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), .tileOffset = 4, .priority = 0 } @@ -5021,7 +5021,7 @@ static void sub_80DE69C(u8 a) for (i = 0; i < CONTESTANT_COUNT; i++) { gSprites[gContestResources->field_14[i].unk0].oam.matrixNum = AllocOamMatrix(); - gSprites[gContestResources->field_14[i].unk0].oam.affineMode = 1; + gSprites[gContestResources->field_14[i].unk0].oam.affineMode = ST_OAM_AFFINE_NORMAL; StartSpriteAffineAnim(&gSprites[gContestResources->field_14[i].unk0], a); if (a == 2) { diff --git a/src/credits.c b/src/credits.c index a76dabd16..a8bed9a3f 100644 --- a/src/credits.c +++ b/src/credits.c @@ -2183,7 +2183,7 @@ static void sub_8177050(struct Sprite *sprite) { case 0: default: - sprite->oam.affineMode = 1; + sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; sprite->oam.matrixNum = sprite->data[1]; sprite->data[2] = 16; SetOamMatrix(sprite->data[1], 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]); @@ -2225,7 +2225,7 @@ static void sub_8177050(struct Sprite *sprite) { SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0)); - sprite->oam.objMode = 1; + sprite->oam.objMode = ST_OAM_OBJ_BLEND; sprite->data[3] = 16; sprite->data[0] += 1; } diff --git a/src/data/field_event_obj/event_object_subsprites.h b/src/data/field_event_obj/event_object_subsprites.h index 5da262731..0b4a80f72 100755 --- a/src/data/field_event_obj/event_object_subsprites.h +++ b/src/data/field_event_obj/event_object_subsprites.h @@ -1,24 +1,80 @@ const struct Subsprite gEventObjectSpriteOamTable_16x16_0[] = { - { -8, -8, 0, 1, 0, 2} + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x16_1[] = { - { -8, -8, 0, 1, 0, 1} + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x16_2[] = { - { -8, -8, 1, 0, 0, 2}, - { -8, 0, 1, 0, 2, 3} + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -8, + .y = 0, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 2, + .priority = 3 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x16_3[] = { - { -8, -8, 0, 1, 0, 2}, - { -8, -8, 0, 1, 0, 3} + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 3 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x16_4[] = { - { -8, -8, 0, 1, 0, 1}, - { -8, -8, 0, 1, 0, 3} + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -8, + .y = -8, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 3 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_16x16[] = { @@ -31,27 +87,90 @@ const struct SubspriteTable gEventObjectSpriteOamTables_16x16[] = { }; const struct Subsprite gEventObjectSpriteOamTable_16x32_0[] = { - { -8, -16, 2, 2, 0, 2} + { + .x = -8, + .y = -16, + .shape = SPRITE_SHAPE(16x32), + .size = SPRITE_SIZE(16x32), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x32_1[] = { - { -8, -16, 2, 2, 0, 1} + { + .x = -8, + .y = -16, + .shape = SPRITE_SHAPE(16x32), + .size = SPRITE_SIZE(16x32), + .tileOffset = 0, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x32_2[] = { - { -8, -16, 0, 1, 0, 2}, - { -8, 0, 1, 0, 4, 2}, - { -8, 8, 1, 0, 6, 3} + { + .x = -8, + .y = -16, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -8, + .y = 0, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = -8, + .y = 8, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 6, + .priority = 3 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x32_3[] = { - { -8, -16, 0, 1, 0, 2}, - { -8, 0, 0, 1, 4, 3} + { + .x = -8, + .y = -16, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -8, + .y = 0, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 4, + .priority = 3 + } }; const struct Subsprite gEventObjectSpriteOamTable_16x32_4[] = { - { -8, -16, 0, 1, 0, 1}, - { -8, 0, 0, 1, 4, 3} + { + .x = -8, + .y = -16, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -8, + .y = 0, + .shape = SPRITE_SHAPE(16x16), + .size = SPRITE_SIZE(16x16), + .tileOffset = 4, + .priority = 3 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_16x32[] = { @@ -64,27 +183,90 @@ const struct SubspriteTable gEventObjectSpriteOamTables_16x32[] = { }; const struct Subsprite gEventObjectSpriteOamTable_32x32_0[] = { - {-16, -16, 0, 2, 0, 2} + { + .x = -16, + .y = -16, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_32x32_1[] = { - {-16, -16, 0, 2, 0, 1} + { + .x = -16, + .y = -16, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .tileOffset = 0, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_32x32_2[] = { - {-16, -16, 1, 2, 0, 2}, - {-16, 0, 1, 1, 8, 2}, - {-16, 8, 1, 1, 12, 3} + { + .x = -16, + .y = -16, + .shape = SPRITE_SHAPE(32x16), + .size = SPRITE_SIZE(32x16), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 2 + }, + { + .x = -16, + .y = 8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 3 + } }; const struct Subsprite gEventObjectSpriteOamTable_32x32_3[] = { - {-16, -16, 1, 2, 0, 2}, - {-16, 0, 1, 2, 8, 3} + { + .x = -16, + .y = -16, + .shape = SPRITE_SHAPE(32x16), + .size = SPRITE_SIZE(32x16), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = 0, + .shape = SPRITE_SHAPE(32x16), + .size = SPRITE_SIZE(32x16), + .tileOffset = 8, + .priority = 3 + } }; const struct Subsprite gEventObjectSpriteOamTable_32x32_4[] = { - {-16, -16, 1, 2, 0, 1}, - {-16, 0, 1, 2, 8, 3} + { + .x = -16, + .y = -16, + .shape = SPRITE_SHAPE(32x16), + .size = SPRITE_SIZE(32x16), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -16, + .y = 0, + .shape = SPRITE_SHAPE(32x16), + .size = SPRITE_SIZE(32x16), + .tileOffset = 8, + .priority = 3 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_32x32[] = { @@ -97,18 +279,102 @@ const struct SubspriteTable gEventObjectSpriteOamTables_32x32[] = { }; const struct Subsprite gEventObjectSpriteOamTable_Truck_0[] = { - {-24, -24, 1, 1, 0, 2}, - { 8, -24, 1, 0, 4, 2}, - {-24, -16, 1, 1, 6, 2}, - { 8, -16, 1, 0, 10, 2}, - {-24, -8, 1, 1, 12, 2}, - { 8, -8, 1, 0, 16, 2}, - {-24, 0, 1, 1, 18, 2}, - { 8, 0, 1, 0, 22, 2}, - {-24, 8, 1, 1, 24, 2}, - { 8, 8, 1, 0, 28, 2}, - {-24, 16, 1, 1, 30, 2}, - { 8, 16, 1, 0, 34, 2} + { + .x = -24, + .y = -24, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = 8, + .y = -24, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = -24, + .y = -16, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 6, + .priority = 2 + }, + { + .x = 8, + .y = -16, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 10, + .priority = 2 + }, + { + .x = -24, + .y = -8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 2 + }, + { + .x = 8, + .y = -8, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 16, + .priority = 2 + }, + { + .x = -24, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 18, + .priority = 2 + }, + { + .x = 8, + .y = 0, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 22, + .priority = 2 + }, + { + .x = -24, + .y = 8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 24, + .priority = 2 + }, + { + .x = 8, + .y = 8, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 28, + .priority = 2 + }, + { + .x = -24, + .y = 16, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 30, + .priority = 2 + }, + { + .x = 8, + .y = 16, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 34, + .priority = 2 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_Truck[] = { @@ -121,19 +387,47 @@ const struct SubspriteTable gEventObjectSpriteOamTables_Truck[] = { }; const struct Subsprite gEventObjectSpriteOamTable_Unused_0[] = { - {-32, -16, 1, 3, 0, 2} + { + .x = -32, + .y = -16, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_Unused_1[] = { - {-32, -16, 1, 3, 0, 1} + { + .x = -32, + .y = -16, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_Unused_2[] = { - {-32, -16, 1, 3, 0, 2} + { + .x = -32, + .y = -16, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_Unused_3[] = { - {-32, -16, 1, 3, 0, 2} + { + .x = -32, + .y = -16, + .shape = SPRITE_SHAPE(64x32), + .size = SPRITE_SIZE(64x32), + .tileOffset = 0, + .priority = 2 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_Unused[] = { @@ -146,19 +440,47 @@ const struct SubspriteTable gEventObjectSpriteOamTables_Unused[] = { }; const struct Subsprite gEventObjectSpriteOamTable_64x64_0[] = { - {-32, -32, 0, 3, 0, 2} + { + .x = -32, + .y = -32, + .shape = SPRITE_SHAPE(64x64), + .size = SPRITE_SIZE(64x64), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_64x64_1[] = { - {-32, -32, 0, 3, 0, 1} + { + .x = -32, + .y = -32, + .shape = SPRITE_SHAPE(64x64), + .size = SPRITE_SIZE(64x64), + .tileOffset = 0, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_64x64_2[] = { - {-32, -32, 0, 3, 0, 2} + { + .x = -32, + .y = -32, + .shape = SPRITE_SHAPE(64x64), + .size = SPRITE_SIZE(64x64), + .tileOffset = 0, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_64x64_3[] = { - {-32, -32, 0, 3, 0, 2} + { + .x = -32, + .y = -32, + .shape = SPRITE_SHAPE(64x64), + .size = SPRITE_SIZE(64x64), + .tileOffset = 0, + .priority = 2 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_64x64[] = { @@ -171,75 +493,495 @@ const struct SubspriteTable gEventObjectSpriteOamTables_64x64[] = { }; const struct Subsprite gEventObjectSpriteOamTable_SSTidal_0[] = { - {-48, -20, 1, 1, 0, 2}, - {-16, -20, 1, 1, 4, 2}, - { 16, -20, 1, 1, 8, 2}, - {-48, -12, 1, 1, 12, 2}, - {-16, -12, 1, 1, 16, 2}, - { 16, -12, 1, 1, 20, 2}, - {-48, -4, 1, 1, 24, 2}, - {-16, -4, 1, 1, 28, 2}, - { 16, -4, 1, 1, 32, 2}, - {-48, 4, 1, 1, 36, 2}, - {-16, 4, 1, 1, 40, 2}, - { 16, 4, 1, 1, 44, 2}, - {-48, 12, 1, 1, 48, 2}, - {-16, 12, 1, 1, 52, 2}, - { 16, 12, 1, 1, 56, 2} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 2 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 2 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 16, + .priority = 2 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 20, + .priority = 2 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 24, + .priority = 2 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 28, + .priority = 2 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 36, + .priority = 2 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 40, + .priority = 2 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 44, + .priority = 2 + }, + { + .x = -48, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 48, + .priority = 2 + }, + { + .x = -16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 52, + .priority = 2 + }, + { + .x = 16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 56, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_SSTidal_1[] = { - {-48, -20, 1, 1, 0, 1}, - {-16, -20, 1, 1, 4, 1}, - { 16, -20, 1, 1, 8, 1}, - {-48, -12, 1, 1, 12, 1}, - {-16, -12, 1, 1, 16, 1}, - { 16, -12, 1, 1, 20, 1}, - {-48, -4, 1, 1, 24, 1}, - {-16, -4, 1, 1, 28, 1}, - { 16, -4, 1, 1, 32, 1}, - {-48, 4, 1, 1, 36, 1}, - {-16, 4, 1, 1, 40, 1}, - { 16, 4, 1, 1, 44, 1}, - {-48, 12, 1, 1, 48, 1}, - {-16, 12, 1, 1, 52, 1}, - { 16, 12, 1, 1, 56, 1} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 1 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 16, + .priority = 1 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 20, + .priority = 1 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 24, + .priority = 1 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 28, + .priority = 1 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 32, + .priority = 1 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 36, + .priority = 1 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 40, + .priority = 1 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 44, + .priority = 1 + }, + { + .x = -48, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 48, + .priority = 1 + }, + { + .x = -16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 52, + .priority = 1 + }, + { + .x = 16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 56, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_SSTidal_2[] = { - {-48, -20, 1, 1, 0, 2}, - {-16, -20, 1, 1, 4, 2}, - { 16, -20, 1, 1, 8, 2}, - {-48, -12, 1, 1, 12, 2}, - {-16, -12, 1, 1, 16, 2}, - { 16, -12, 1, 1, 20, 2}, - {-48, -4, 1, 1, 24, 2}, - {-16, -4, 1, 1, 28, 2}, - { 16, -4, 1, 1, 32, 2}, - {-48, 4, 1, 1, 36, 2}, - {-16, 4, 1, 1, 40, 2}, - { 16, 4, 1, 1, 44, 2}, - {-48, 12, 1, 1, 48, 2}, - {-16, 12, 1, 1, 52, 2}, - { 16, 12, 1, 1, 56, 2} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 2 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 2 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 16, + .priority = 2 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 20, + .priority = 2 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 24, + .priority = 2 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 28, + .priority = 2 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 36, + .priority = 2 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 40, + .priority = 2 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 44, + .priority = 2 + }, + { + .x = -48, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 48, + .priority = 2 + }, + { + .x = -16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 52, + .priority = 2 + }, + { + .x = 16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 56, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_SSTidal_3[] = { - {-48, -20, 1, 1, 0, 1}, - {-16, -20, 1, 1, 4, 1}, - { 16, -20, 1, 1, 8, 1}, - {-48, -12, 1, 1, 12, 1}, - {-16, -12, 1, 1, 16, 1}, - { 16, -12, 1, 1, 20, 1}, - {-48, -4, 1, 1, 24, 2}, - {-16, -4, 1, 1, 28, 2}, - { 16, -4, 1, 1, 32, 2}, - {-48, 4, 1, 1, 36, 2}, - {-16, 4, 1, 1, 40, 2}, - { 16, 4, 1, 1, 44, 2}, - {-48, 12, 1, 1, 48, 2}, - {-16, 12, 1, 1, 52, 2}, - { 16, 12, 1, 1, 56, 2} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 1 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 16, + .priority = 1 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 20, + .priority = 1 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 24, + .priority = 2 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 28, + .priority = 2 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 36, + .priority = 2 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 40, + .priority = 2 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 44, + .priority = 2 + }, + { + .x = -48, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 48, + .priority = 2 + }, + { + .x = -16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 52, + .priority = 2 + }, + { + .x = 16, + .y = 12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 56, + .priority = 2 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_SSTidal[] = { @@ -252,79 +994,527 @@ const struct SubspriteTable gEventObjectSpriteOamTables_SSTidal[] = { }; const struct Subsprite gEventObjectSpriteOamTable_SubmarineShadow_0[] = { - {-48, -20, 1, 1, 0, 2}, - {-16, -20, 1, 1, 4, 2}, - { 16, -20, 1, 0, 8, 2}, - { 32, -20, 0, 0, 10, 2}, - {-48, -12, 1, 1, 11, 2}, - {-16, -12, 1, 1, 15, 2}, - { 16, -12, 1, 0, 19, 2}, - { 32, -12, 0, 0, 21, 2}, - {-48, -4, 1, 1, 22, 2}, - {-16, -4, 1, 1, 26, 2}, - { 16, -4, 1, 0, 30, 2}, - { 32, -4, 0, 0, 32, 2}, - {-48, 4, 1, 1, 33, 2}, - {-16, 4, 1, 1, 37, 2}, - { 16, 4, 1, 0, 41, 2}, - { 32, 4, 0, 0, 43, 2} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 8, + .priority = 2 + }, + { + .x = 32, + .y = -20, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 10, + .priority = 2 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 11, + .priority = 2 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 15, + .priority = 2 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 19, + .priority = 2 + }, + { + .x = 32, + .y = -12, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 21, + .priority = 2 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 22, + .priority = 2 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 26, + .priority = 2 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 30, + .priority = 2 + }, + { + .x = 32, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 33, + .priority = 2 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 37, + .priority = 2 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 41, + .priority = 2 + }, + { + .x = 32, + .y = 4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 43, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_SubmarineShadow_1[] = { - {-48, -20, 1, 1, 0, 1}, - {-16, -20, 1, 1, 4, 1}, - { 16, -20, 1, 0, 8, 1}, - { 32, -20, 0, 0, 10, 1}, - {-48, -12, 1, 1, 11, 1}, - {-16, -12, 1, 1, 15, 1}, - { 16, -12, 1, 0, 19, 1}, - { 32, -12, 0, 0, 21, 1}, - {-48, -4, 1, 1, 22, 1}, - {-16, -4, 1, 1, 26, 1}, - { 16, -4, 1, 0, 30, 1}, - { 32, -4, 0, 0, 32, 1}, - {-48, 4, 1, 1, 33, 1}, - {-16, 4, 1, 1, 37, 1}, - { 16, 4, 1, 0, 41, 1}, - { 32, 4, 0, 0, 43, 1} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = 32, + .y = -20, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 10, + .priority = 1 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 11, + .priority = 1 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 15, + .priority = 1 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 19, + .priority = 1 + }, + { + .x = 32, + .y = -12, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 21, + .priority = 1 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 22, + .priority = 1 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 26, + .priority = 1 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 30, + .priority = 1 + }, + { + .x = 32, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 32, + .priority = 1 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 33, + .priority = 1 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 37, + .priority = 1 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 41, + .priority = 1 + }, + { + .x = 32, + .y = 4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 43, + .priority = 1 + } }; const struct Subsprite gEventObjectSpriteOamTable_SubmarineShadow_2[] = { - {-48, -20, 1, 1, 0, 2}, - {-16, -20, 1, 1, 4, 2}, - { 16, -20, 1, 0, 8, 2}, - { 32, -20, 0, 0, 10, 2}, - {-48, -12, 1, 1, 11, 2}, - {-16, -12, 1, 1, 15, 2}, - { 16, -12, 1, 0, 19, 2}, - { 32, -12, 0, 0, 21, 2}, - {-48, -4, 1, 1, 22, 2}, - {-16, -4, 1, 1, 26, 2}, - { 16, -4, 1, 0, 30, 2}, - { 32, -4, 0, 0, 32, 2}, - {-48, 4, 1, 1, 33, 2}, - {-16, 4, 1, 1, 37, 2}, - { 16, 4, 1, 0, 41, 2}, - { 32, 4, 0, 0, 43, 2} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 8, + .priority = 2 + }, + { + .x = 32, + .y = -20, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 10, + .priority = 2 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 11, + .priority = 2 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 15, + .priority = 2 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 19, + .priority = 2 + }, + { + .x = 32, + .y = -12, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 21, + .priority = 2 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 22, + .priority = 2 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 26, + .priority = 2 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 30, + .priority = 2 + }, + { + .x = 32, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 33, + .priority = 2 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 37, + .priority = 2 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 41, + .priority = 2 + }, + { + .x = 32, + .y = 4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 43, + .priority = 2 + } }; const struct Subsprite gEventObjectSpriteOamTable_SubmarineShadow_3[] = { - {-48, -20, 1, 1, 0, 1}, - {-16, -20, 1, 1, 4, 1}, - { 16, -20, 1, 0, 8, 1}, - { 32, -20, 0, 0, 10, 1}, - {-48, -12, 1, 1, 11, 1}, - {-16, -12, 1, 1, 15, 1}, - { 16, -12, 1, 0, 19, 1}, - { 32, -12, 0, 0, 21, 1}, - {-48, -4, 1, 1, 22, 2}, - {-16, -4, 1, 1, 26, 2}, - { 16, -4, 1, 0, 30, 2}, - { 32, -4, 0, 0, 32, 2}, - {-48, 4, 1, 1, 33, 2}, - {-16, 4, 1, 1, 37, 2}, - { 16, 4, 1, 0, 41, 2}, - { 32, 4, 0, 0, 43, 2} + { + .x = -48, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -16, + .y = -20, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = 16, + .y = -20, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 8, + .priority = 1 + }, + { + .x = 32, + .y = -20, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 10, + .priority = 1 + }, + { + .x = -48, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 11, + .priority = 1 + }, + { + .x = -16, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 15, + .priority = 1 + }, + { + .x = 16, + .y = -12, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 19, + .priority = 1 + }, + { + .x = 32, + .y = -12, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 21, + .priority = 1 + }, + { + .x = -48, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 22, + .priority = 2 + }, + { + .x = -16, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 26, + .priority = 2 + }, + { + .x = 16, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 30, + .priority = 2 + }, + { + .x = 32, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = -48, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 33, + .priority = 2 + }, + { + .x = -16, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 37, + .priority = 2 + }, + { + .x = 16, + .y = 4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 41, + .priority = 2 + }, + { + .x = 32, + .y = 4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 43, + .priority = 2 + } }; const struct SubspriteTable gEventObjectSpriteOamTables_SubmarineShadow[] = { diff --git a/src/electric.c b/src/electric.c index 7a0cd542c..3344db7bf 100644 --- a/src/electric.c +++ b/src/electric.c @@ -757,13 +757,13 @@ static void sub_810A9DC(struct Sprite *sprite) { if (!sprite->data[0]) { - sprite->oam.shape = 2; - sprite->oam.size = 0; + sprite->oam.shape = SPRITE_SHAPE(8x16); + sprite->oam.size = SPRITE_SIZE(8x16); } else { - sprite->oam.shape = 0; - sprite->oam.size = 1; + sprite->oam.shape = SPRITE_SHAPE(16x16); + sprite->oam.size = SPRITE_SIZE(16x16); } if (++sprite->data[1] == 15) DestroySprite(sprite); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index c746f08b1..634dab58f 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1121,13 +1121,13 @@ void ResetEventObjects(void) static void CreateReflectionEffectSprites(void) { u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; InitSpriteAffineAnim(&gSprites[spriteId]); StartSpriteAffineAnim(&gSprites[spriteId], 0); gSprites[spriteId].invisible = TRUE; spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; InitSpriteAffineAnim(&gSprites[spriteId]); StartSpriteAffineAnim(&gSprites[spriteId], 1); gSprites[spriteId].invisible = TRUE; @@ -1676,7 +1676,7 @@ u8 AddPseudoEventObject(u16 graphicsId, void (*callback)(struct Sprite *), s16 x { sprite = &gSprites[spriteId]; SetSubspriteTables(sprite, subspriteTables); - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; } return spriteId; } @@ -1721,7 +1721,7 @@ u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) if (subspriteTables != NULL) { SetSubspriteTables(sprite, subspriteTables); - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; } InitObjectPriorityByZCoord(sprite, z); SetObjectSubpriorityByZCoord(z, sprite, 1); @@ -4586,7 +4586,7 @@ void MovementType_Hidden(struct Sprite *sprite) if (!sprite->data[7]) { gEventObjects[sprite->data[0]].fixedPriority = TRUE; - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; sprite->oam.priority = 3; sprite->data[7]++; } @@ -6814,7 +6814,7 @@ bool8 MovementAction_InitAffineAnim_Step0(struct EventObject *eventObject, struc sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; InitSpriteAffineAnim(sprite); sprite->affineAnimPaused = TRUE; - sprite->subspriteMode = 0; + sprite->subspriteMode = SUBSPRITES_OFF; return TRUE; } @@ -8844,12 +8844,12 @@ void sub_8097BB4(u8 var1, u8 graphicsId) { sprite->subspriteTables = NULL; sprite->subspriteTableNum = 0; - sprite->subspriteMode = 0; + sprite->subspriteMode = SUBSPRITES_OFF; } else { SetSubspriteTables(sprite, graphicsInfo->subspriteTables); - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; } StartSpriteAnim(sprite, 0); } diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index b63f28754..849c676b3 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -141,7 +141,7 @@ static void CreatePreEvoSparkleSet1(u8 arg0) gSprites[spriteID].data[5] = 48; gSprites[spriteID].data[6] = arg0; gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = 1; + gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteID].oam.matrixNum = 31; gSprites[spriteID].callback = SpriteCB_PreEvoSparkleSet1; } @@ -169,7 +169,7 @@ static void CreatePreEvoSparkleSet2(u8 arg0) gSprites[spriteID].data[5] = 8; gSprites[spriteID].data[6] = arg0; gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = 1; + gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteID].oam.matrixNum = 25; gSprites[spriteID].subpriority = 1; gSprites[spriteID].callback = SpriteCB_PreEvoSparkleSet2; @@ -198,7 +198,7 @@ static void CreatePostEvoSparkleSet1(u8 arg0, u8 arg1) gSprites[spriteID].data[5] = 120; gSprites[spriteID].data[6] = arg0; gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = 1; + gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteID].oam.matrixNum = 31; gSprites[spriteID].subpriority = 1; gSprites[spriteID].callback = SpriteCB_PostEvoSparkleSet1; @@ -243,7 +243,7 @@ static void CreatePostEvoSparkleSet2(u8 arg0) gSprites[spriteID].data[3] = 3 - (Random() % 7); gSprites[spriteID].data[5] = 48 + (Random() & 0x3F); gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = 1; + gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteID].oam.matrixNum = 31; gSprites[spriteID].subpriority = 20; gSprites[spriteID].callback = SpriteCB_PostEvoSparkleSet2; @@ -497,13 +497,13 @@ u8 sub_817C3A0(u8 preEvoSpriteID, u8 postEvoSpriteID) SetOamMatrix(31, toDiv / gTasks[taskID].data[4], 0, 0, toDiv / gTasks[taskID].data[4]); gSprites[preEvoSpriteID].callback = PokeEvoSprite_DummySpriteCB; - gSprites[preEvoSpriteID].oam.affineMode = 1; + gSprites[preEvoSpriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[preEvoSpriteID].oam.matrixNum = 30; gSprites[preEvoSpriteID].invisible = FALSE; CpuSet(stack, &gPlttBufferFaded[0x100 + (gSprites[preEvoSpriteID].oam.paletteNum * 16)], 16); gSprites[postEvoSpriteID].callback = PokeEvoSprite_DummySpriteCB; - gSprites[postEvoSpriteID].oam.affineMode = 1; + gSprites[postEvoSpriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[postEvoSpriteID].oam.matrixNum = 31; gSprites[postEvoSpriteID].invisible = FALSE; CpuSet(stack, &gPlttBufferFaded[0x100 + (gSprites[postEvoSpriteID].oam.paletteNum * 16)], 16); @@ -587,11 +587,11 @@ static void sub_817C560(u8 taskID) static void PreEvoInvisible_PostEvoVisible_KillTask(u8 taskID) { - gSprites[gTasks[taskID].tPreEvoSpriteID].oam.affineMode = 0; + gSprites[gTasks[taskID].tPreEvoSpriteID].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gTasks[taskID].tPreEvoSpriteID].oam.matrixNum = 0; gSprites[gTasks[taskID].tPreEvoSpriteID].invisible = TRUE; - gSprites[gTasks[taskID].tPostEvoSpriteID].oam.affineMode = 0; + gSprites[gTasks[taskID].tPostEvoSpriteID].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gTasks[taskID].tPostEvoSpriteID].oam.matrixNum = 0; gSprites[gTasks[taskID].tPostEvoSpriteID].invisible = FALSE; @@ -600,11 +600,11 @@ static void PreEvoInvisible_PostEvoVisible_KillTask(u8 taskID) static void PreEvoVisible_PostEvoInvisible_KillTask(u8 taskID) { - gSprites[gTasks[taskID].tPreEvoSpriteID].oam.affineMode = 0; + gSprites[gTasks[taskID].tPreEvoSpriteID].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gTasks[taskID].tPreEvoSpriteID].oam.matrixNum = 0; gSprites[gTasks[taskID].tPreEvoSpriteID].invisible = FALSE; - gSprites[gTasks[taskID].tPostEvoSpriteID].oam.affineMode = 0; + gSprites[gTasks[taskID].tPostEvoSpriteID].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gTasks[taskID].tPostEvoSpriteID].oam.matrixNum = 0; gSprites[gTasks[taskID].tPostEvoSpriteID].invisible = TRUE; diff --git a/src/field_effect.c b/src/field_effect.c index 99abcdcb0..f7667597c 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -406,20 +406,76 @@ const struct SpriteFrameImage gSpriteImageTable_855C294[] = const struct Subsprite gSubspriteTable_855C29C[] = { - {.x = -12, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 0}, - {.x = 4, .y = -8, .priority = 2, .tileOffset = 2, .shape = 0, .size = 0}, - {.x = -12, .y = 0, .priority = 2, .tileOffset = 3, .shape = 1, .size = 0}, - {.x = 4, .y = 0, .priority = 2, .tileOffset = 5, .shape = 0, .size = 0} + { + .x = -12, + .y = -8, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = 4, + .y = -8, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 2, + .priority = 2 + }, + { + .x = -12, + .y = 0, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 3, + .priority = 2 + }, + { + .x = 4, + .y = 0, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 5, + .priority = 2 + } }; const struct SubspriteTable gUnknown_0855C2AC = subsprite_table(gSubspriteTable_855C29C); const struct Subsprite gSubspriteTable_855C2B4[] = { - {.x = -32, .y = -8, .priority = 2, .tileOffset = 0, .shape = 1, .size = 1}, - {.x = 0, .y = -8, .priority = 2, .tileOffset = 4, .shape = 1, .size = 1}, - {.x = -32, .y = 0, .priority = 2, .tileOffset = 8, .shape = 1, .size = 1}, - {.x = 0, .y = 0, .priority = 2, .tileOffset = 12, .shape = 1, .size = 1} + { + .x = -32, + .y = -8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 2 + }, + { + .x = 0, + .y = -8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 4, + .priority = 2 + }, + { + .x = -32, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 8, + .priority = 2 + }, + { + .x = 0, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 12, + .priority = 2 + } }; const struct SubspriteTable gUnknown_0855C2C4 = subsprite_table(gSubspriteTable_855C2B4); @@ -870,7 +926,7 @@ u8 CreateMonSprite_FieldMove(u16 species, u32 d, u32 g, s16 x, s16 y, u8 subprio void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId) { ResetPreservedPalettesInWeather(); - if (sprite->oam.affineMode != 0) + if (sprite->oam.affineMode != ST_OAM_AFFINE_OFF) { FreeOamMatrix(sprite->oam.matrixNum); } @@ -1473,7 +1529,7 @@ static bool8 sub_80B6BCC(struct Task *task) // gUnknown_0855C3C8[0] task->data[4] = playerSprite->subspriteMode; playerObject->fixedPriority = 1; playerSprite->oam.priority = 1; - playerSprite->subspriteMode = 2; + playerSprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; task->data[0]++; return TRUE; } @@ -2021,7 +2077,7 @@ static bool8 sub_80B7704(struct Task *task, struct EventObject *eventObject, str task->data[5]++; eventObject->fixedPriority = 1; sprite->oam.priority = 1; - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; } if (task->data[1] == 0 && task->data[4] != 0) { @@ -2396,9 +2452,9 @@ static void TeleportFieldEffectTask3(struct Task *task) { task->data[3] <<= 1; } - if (task->data[4] > 8 && (sprite->oam.priority = 1, sprite->subspriteMode != 0)) + if (task->data[4] > 8 && (sprite->oam.priority = 1, sprite->subspriteMode != SUBSPRITES_OFF)) { - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; } if (task->data[4] >= 0xa8) { @@ -2487,9 +2543,9 @@ static void sub_80B830C(struct Task *task) } else { sprite->oam.priority = 1; - if (sprite->subspriteMode != 0) + if (sprite->subspriteMode != SUBSPRITES_OFF) { - sprite->subspriteMode = 2; + sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; } } if (sprite->pos2.y >= -0x30 && task->data[1] > 1 && !(sprite->pos2.y & 1)) @@ -3284,7 +3340,7 @@ static void sub_80B957C(struct Sprite *sprite) { if (sprite->data[0] == 0) { - sprite->oam.affineMode = 3; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; sprite->affineAnims = gSpriteAffineAnimTable_0855C548; InitSpriteAffineAnim(sprite); StartSpriteAffineAnim(sprite, 0); @@ -3304,9 +3360,9 @@ static void sub_80B957C(struct Sprite *sprite) if (sprite->data[1] > 0x81) { sprite->data[7]++; - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; FreeOamMatrix(sprite->oam.matrixNum); - CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, 0); + CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, ST_OAM_AFFINE_OFF); } } } @@ -3337,7 +3393,7 @@ void sub_80B96B0(struct Sprite *sprite) { if (sprite->data[0] == 0) { - sprite->oam.affineMode = 3; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; sprite->affineAnims = gSpriteAffineAnimTable_0855C548; InitSpriteAffineAnim(sprite); StartSpriteAffineAnim(sprite, 1); @@ -3368,7 +3424,7 @@ void sub_80B96B0(struct Sprite *sprite) if (sprite->data[3] >= 60) { sprite->data[7]++; - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; FreeOamMatrix(sprite->oam.matrixNum); sprite->invisible = TRUE; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 8db58ad7a..547a2851b 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -129,7 +129,7 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) reflectionSprite->oam.paletteNum = gReflectionEffectPaletteMap[mainSprite->oam.paletteNum]; reflectionSprite->oam.shape = mainSprite->oam.shape; reflectionSprite->oam.size = mainSprite->oam.size; - reflectionSprite->oam.matrixNum = mainSprite->oam.matrixNum | 0x10; + reflectionSprite->oam.matrixNum = mainSprite->oam.matrixNum | ST_OAM_VFLIP; reflectionSprite->oam.tileNum = mainSprite->oam.tileNum; reflectionSprite->subspriteTables = mainSprite->subspriteTables; reflectionSprite->subspriteTableNum = mainSprite->subspriteTableNum; @@ -153,7 +153,7 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) // matrix based on whether or not the main sprite is horizontally flipped. // If the sprite is facing to the east, then it is flipped, and its matrixNum is 8. reflectionSprite->oam.matrixNum = 0; - if (mainSprite->oam.matrixNum & 0x8) + if (mainSprite->oam.matrixNum & ST_OAM_HFLIP) reflectionSprite->oam.matrixNum = 1; } } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 229e5aedb..20d338e23 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -2092,7 +2092,7 @@ static void sub_808D094(u8 taskId) object->fixedPriority = TRUE; sprite->oam.priority = 0; sprite->subpriority = 0; - sprite->subspriteMode = 0; + sprite->subspriteMode = SUBSPRITES_OFF; data[0]++; case 1: sub_808D38C(object, &data[1]); @@ -2156,7 +2156,7 @@ static void sub_808D1FC(u8 taskId) object->fixedPriority = TRUE; sprite->oam.priority = 1; sprite->subpriority = 0; - sprite->subspriteMode = 0; + sprite->subspriteMode = SUBSPRITES_OFF; data[0]++; case 1: sub_808D38C(object, &data[1]); diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 711b76633..5a48f3434 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1245,7 +1245,7 @@ static const struct OamData gOamData_839AB2C = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, - .objMode = 1, + .objMode = ST_OAM_OBJ_BLEND, .mosaic = 0, .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), @@ -2137,14 +2137,14 @@ static void CreateSwirlSandstormSprites(void) if (spriteId != MAX_SPRITES) { gWeatherPtr->sprites.s2.sandstormSprites2[i] = &gSprites[spriteId]; - gWeatherPtr->sprites.s2.sandstormSprites2[i]->oam.size = 2; + gWeatherPtr->sprites.s2.sandstormSprites2[i]->oam.size = ST_OAM_SIZE_2; gWeatherPtr->sprites.s2.sandstormSprites2[i]->tSpriteRow = i * 51; gWeatherPtr->sprites.s2.sandstormSprites2[i]->tRadius = 8; gWeatherPtr->sprites.s2.sandstormSprites2[i]->tRadiusCounter = 0; gWeatherPtr->sprites.s2.sandstormSprites2[i]->data[4] = 0x6730; // unused value gWeatherPtr->sprites.s2.sandstormSprites2[i]->tEntranceDelay = sSwirlEntranceDelays[i]; StartSpriteAnim(gWeatherPtr->sprites.s2.sandstormSprites2[i], 1); - CalcCenterToCornerVec(gWeatherPtr->sprites.s2.sandstormSprites2[i], 0, 2, 0); + CalcCenterToCornerVec(gWeatherPtr->sprites.s2.sandstormSprites2[i], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_OFF); gWeatherPtr->sprites.s2.sandstormSprites2[i]->callback = WaitSandSwirlSpriteEntrance; } else diff --git a/src/flying.c b/src/flying.c index 43682ee42..774018f0f 100644 --- a/src/flying.c +++ b/src/flying.c @@ -540,7 +540,7 @@ void sub_810E2C8(struct Sprite *sprite) if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK) { FreeOamMatrix(sprite->oam.matrixNum); - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; } DestroySprite(sprite); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index a580f3f02..7c519c830 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -580,7 +580,7 @@ static void Task_Hof_PrintMonInfoAfterAnimating(u8 taskId) if (monSprite->callback == SpriteCallbackDummy) { - monSprite->oam.affineMode = 0; + monSprite->oam.affineMode = ST_OAM_AFFINE_OFF; HallOfFame_PrintMonInfo(currMon, 0, 14); gTasks[taskId].tFrameCount = 120; gTasks[taskId].func = Task_Hof_TryDisplayAnotherMon; diff --git a/src/intro.c b/src/intro.c index 904f6d67c..539b07a75 100644 --- a/src/intro.c +++ b/src/intro.c @@ -2568,9 +2568,9 @@ static void sub_816F3A4(struct Sprite *sprite) sprite->data[2] = 1024; sprite->data[3] = 8 * (sprite->data[1] & 3); sprite->callback = sub_816F318; - sprite->oam.shape = 1; - sprite->oam.size = 3; - CalcCenterToCornerVec(sprite, 1, 3, 2); + sprite->oam.shape = SPRITE_SHAPE(64x32); + sprite->oam.size = SPRITE_SIZE(64x32); + CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_ERASE); } else { @@ -2690,9 +2690,9 @@ static void SpriteCB_WaterDropFall(struct Sprite *sprite) sprite->data[2] = 1024; sprite->data[3] = 8 * (sprite->data[1] & 3); sprite->callback = sub_816F318; - sprite->oam.shape = 1; - sprite->oam.size = 3; - CalcCenterToCornerVec(sprite, 1, 3, 2); + sprite->oam.shape = SPRITE_SHAPE(64x32); + sprite->oam.size = SPRITE_SIZE(64x32); + CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_ERASE); } } @@ -2713,9 +2713,9 @@ static void SpriteCB_WaterDropFall_2(struct Sprite *sprite) sprite->data[2] = 1024; sprite->data[3] = 8 * (sprite->data[1] & 3); sprite->callback = sub_816F318; - sprite->oam.shape = 1; - sprite->oam.size = 3; - CalcCenterToCornerVec(sprite, 1, 3, 2); + sprite->oam.shape = SPRITE_SHAPE(64x32); + sprite->oam.size = SPRITE_SIZE(64x32); + CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_ERASE); } } @@ -2732,9 +2732,9 @@ static u8 CreateWaterDrop(s16 x, s16 y, u16 c, u16 d, u16 e, u8 fallImmediately) gSprites[spriteId].data[3] = c; gSprites[spriteId].data[5] = e; gSprites[spriteId].data[6] = c; - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; gSprites[spriteId].oam.matrixNum = d; - CalcCenterToCornerVec(&gSprites[spriteId], 0, 2, 2); + CalcCenterToCornerVec(&gSprites[spriteId], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_ERASE); StartSpriteAnim(&gSprites[spriteId], 2); if (!fallImmediately) gSprites[spriteId].callback = sub_816F454; @@ -2745,18 +2745,18 @@ static u8 CreateWaterDrop(s16 x, s16 y, u16 c, u16 d, u16 e, u8 fallImmediately) spriteId = CreateSprite(&gIntroWaterDropSprite, x, y, 1); gSprites[spriteId].data[7] = oldSpriteId; gSprites[spriteId].data[1] = d + 1; - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; gSprites[spriteId].oam.matrixNum = d + 1; - CalcCenterToCornerVec(&gSprites[spriteId], 0, 2, 2); + CalcCenterToCornerVec(&gSprites[spriteId], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_ERASE); gSprites[spriteId].callback = sub_816F3A4; spriteId = CreateSprite(&gIntroWaterDropSprite, x, y, 1); gSprites[spriteId].data[7] = oldSpriteId; gSprites[spriteId].data[1] = d + 2; StartSpriteAnim(&gSprites[spriteId], 1); - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; gSprites[spriteId].oam.matrixNum = d + 2; - CalcCenterToCornerVec(&gSprites[spriteId], 0, 2, 2); + CalcCenterToCornerVec(&gSprites[spriteId], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_ERASE); gSprites[spriteId].callback = sub_816F3A4; SetOamMatrix(d, c + 32, 0, 0, c + 32); @@ -2915,7 +2915,7 @@ static void sub_816FB38(struct Sprite *sprite) if (gIntroFrameCounter == 0x110) { StartSpriteAffineAnim(sprite, 2); - sprite->oam.objMode = 1; + sprite->oam.objMode = ST_OAM_OBJ_BLEND; sprite->data[0]++; } break; @@ -3008,9 +3008,9 @@ static void sub_816FEDC(struct Sprite *sprite) { case 0: default: - sprite->oam.affineMode = 3; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; sprite->oam.matrixNum = 1; - CalcCenterToCornerVec(sprite, 1, 3, 3); + CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE); sprite->invisible = FALSE; sprite->data[0] = 1; sprite->data[1] = 0x80; @@ -3054,9 +3054,9 @@ static void SpriteCB_IntroRayquazaHyperbeam(struct Sprite *sprite) case 0: default: sprite->invisible = FALSE; - sprite->oam.affineMode = 3; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; sprite->oam.matrixNum = 18; - CalcCenterToCornerVec(sprite, 0, 3, 3); + CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); sprite->data[1] = 0; sprite->data[0] = 1; //fall through diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c index 059c1079e..04e2216f6 100644 --- a/src/intro_credits_graphics.c +++ b/src/intro_credits_graphics.c @@ -1026,7 +1026,7 @@ static void sub_817B698(u8 a, const struct IntroCreditsSpriteMetadata *b, const for(i = 0; i < d; i++) { u8 sprite = CreateSprite(&gUnknown_085F504C, b[i].x, b[i].y, b[i].subpriority); - CalcCenterToCornerVec(&gSprites[sprite], b[i].shape, b[i].size, 0); + CalcCenterToCornerVec(&gSprites[sprite], b[i].shape, b[i].size, ST_OAM_AFFINE_OFF); gSprites[sprite].oam.priority = 3; gSprites[sprite].oam.shape = b[i].shape; gSprites[sprite].oam.size = b[i].size; diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index 8c22d2481..cbc038d8c 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -492,7 +492,7 @@ static void UpdateSwitchPocketRotatingBallCoords(struct Sprite *sprite) static void SpriteCB_SwitchPocketRotatingBallInit(struct Sprite *sprite) { - sprite->oam.affineMode = 1; + sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; if (sprite->data[0] == -1) sprite->affineAnims = sRotatingBallAnimCmds; else diff --git a/src/main_menu.c b/src/main_menu.c index 95c64b3bd..ee63b1810 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1312,7 +1312,7 @@ static void Task_NewGameBirchSpeech_WaitToShowBirch(u8 taskId) gSprites[spriteId].pos1.x = 136; gSprites[spriteId].pos1.y = 60; gSprites[spriteId].invisible = FALSE; - gSprites[spriteId].oam.objMode = 1; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeInTarget1OutTarget2(taskId, 10); NewGameBirchSpeech_StartFadePlatformOut(taskId, 20); gTasks[taskId].tTimer = 80; @@ -1324,7 +1324,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId) { if (gTasks[taskId].tIsDoneFadingSprites) { - gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = 0; + gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = ST_OAM_OBJ_NORMAL; if (gTasks[taskId].tTimer) { gTasks[taskId].tTimer--; @@ -1392,7 +1392,7 @@ static void Task_NewGameBirchSpeechSub_WaitForLotad(u8 taskId) case 0: if (sprite->callback == SpriteCallbackDummy) { - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; goto incrementStateAndTimer; } break; @@ -1430,8 +1430,8 @@ static void Task_NewGameBirchSpeech_StartBirchLotadPlatformFade(u8 taskId) { if (!RunTextPrintersAndIsPrinter0Active()) { - gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = 1; - gSprites[gTasks[taskId].tLotadSpriteId].oam.objMode = 1; + gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; + gSprites[gTasks[taskId].tLotadSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeOutTarget1InTarget2(taskId, 2); NewGameBirchSpeech_StartFadePlatformIn(taskId, 1); gTasks[taskId].tTimer = 64; @@ -1470,7 +1470,7 @@ static void Task_NewGameBirchSpeech_StartPlayerFadeIn(u8 taskId) gSprites[spriteId].pos1.x = 180; gSprites[spriteId].pos1.y = 60; gSprites[spriteId].invisible = FALSE; - gSprites[spriteId].oam.objMode = 1; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; gTasks[taskId].tPlayerSpriteId = spriteId; gTasks[taskId].tPlayerGender = MALE; NewGameBirchSpeech_StartFadeInTarget1OutTarget2(taskId, 2); @@ -1484,7 +1484,7 @@ static void Task_NewGameBirchSpeech_WaitForPlayerFadeIn(u8 taskId) { if (gTasks[taskId].tIsDoneFadingSprites) { - gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = 0; + gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = ST_OAM_OBJ_NORMAL; gTasks[taskId].func = Task_NewGameBirchSpeech_BoyOrGirl; } } @@ -1530,7 +1530,7 @@ static void Task_NewGameBirchSpeech_ChooseGender(u8 taskId) if (gender2 != gTasks[taskId].tPlayerGender) { gTasks[taskId].tPlayerGender = gender2; - gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = 1; + gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeOutTarget1InTarget2(taskId, 0); gTasks[taskId].func = Task_NewGameBirchSpeech_SlideOutOldGenderSprite; } @@ -1554,7 +1554,7 @@ static void Task_NewGameBirchSpeech_SlideOutOldGenderSprite(u8 taskId) gSprites[spriteId].pos1.y = 60; gSprites[spriteId].invisible = FALSE; gTasks[taskId].tPlayerSpriteId = spriteId; - gSprites[spriteId].oam.objMode = 1; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeInTarget1OutTarget2(taskId, 0); gTasks[taskId].func = Task_NewGameBirchSpeech_SlideInNewGenderSprite; } @@ -1573,7 +1573,7 @@ static void Task_NewGameBirchSpeech_SlideInNewGenderSprite(u8 taskId) gSprites[spriteId].pos1.x = 180; if (gTasks[taskId].tIsDoneFadingSprites) { - gSprites[spriteId].oam.objMode = 0; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_NORMAL; gTasks[taskId].func = Task_NewGameBirchSpeech_ChooseGender; } } @@ -1637,7 +1637,7 @@ static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8 taskId) { case 0: PlaySE(SE_SELECT); - gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = 1; + gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeOutTarget1InTarget2(taskId, 2); NewGameBirchSpeech_StartFadePlatformIn(taskId, 1); gTasks[taskId].func = Task_NewGameBirchSpeech_SlidePlatformAway2; @@ -1674,12 +1674,12 @@ static void Task_NewGameBirchSpeech_ReshowBirchLotad(u8 taskId) gSprites[spriteId].pos1.x = 136; gSprites[spriteId].pos1.y = 60; gSprites[spriteId].invisible = FALSE; - gSprites[spriteId].oam.objMode = 1; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; spriteId = gTasks[taskId].tLotadSpriteId; gSprites[spriteId].pos1.x = 100; gSprites[spriteId].pos1.y = 75; gSprites[spriteId].invisible = FALSE; - gSprites[spriteId].oam.objMode = 1; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeInTarget1OutTarget2(taskId, 2); NewGameBirchSpeech_StartFadePlatformOut(taskId, 1); NewGameBirchSpeech_ClearWindow(0); @@ -1693,12 +1693,12 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInAndTextPrinter(u8 taskId) { if (gTasks[taskId].tIsDoneFadingSprites) { - gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = 0; - gSprites[gTasks[taskId].tLotadSpriteId].oam.objMode = 0; + gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = ST_OAM_OBJ_NORMAL; + gSprites[gTasks[taskId].tLotadSpriteId].oam.objMode = ST_OAM_OBJ_NORMAL; if (!RunTextPrintersAndIsPrinter0Active()) { - gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = 1; - gSprites[gTasks[taskId].tLotadSpriteId].oam.objMode = 1; + gSprites[gTasks[taskId].tBirchSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; + gSprites[gTasks[taskId].tLotadSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; NewGameBirchSpeech_StartFadeOutTarget1InTarget2(taskId, 2); NewGameBirchSpeech_StartFadePlatformIn(taskId, 1); gTasks[taskId].tTimer = 64; @@ -1727,7 +1727,7 @@ static void Task_NewGameBirchSpeech_AreYouReady(u8 taskId) gSprites[spriteId].pos1.x = 120; gSprites[spriteId].pos1.y = 60; gSprites[spriteId].invisible = FALSE; - gSprites[spriteId].oam.objMode = 1; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; gTasks[taskId].tPlayerSpriteId = spriteId; NewGameBirchSpeech_StartFadeInTarget1OutTarget2(taskId, 2); NewGameBirchSpeech_StartFadePlatformOut(taskId, 1); @@ -1743,11 +1743,11 @@ static void Task_NewGameBirchSpeech_ShrinkPlayer(u8 taskId) if (gTasks[taskId].tIsDoneFadingSprites) { - gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = 0; + gSprites[gTasks[taskId].tPlayerSpriteId].oam.objMode = ST_OAM_OBJ_NORMAL; if (!RunTextPrintersAndIsPrinter0Active()) { spriteId = gTasks[taskId].tPlayerSpriteId; - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_PlayerShrink; InitSpriteAffineAnim(&gSprites[spriteId]); StartSpriteAffineAnim(&gSprites[spriteId], 0); diff --git a/src/mon_markings.c b/src/mon_markings.c index d73cbf318..db5df07e8 100644 --- a/src/mon_markings.c +++ b/src/mon_markings.c @@ -520,12 +520,12 @@ static void sub_811FC80(s16 x, s16 y, u16 baseTileTag, u16 basePaletteTag) if (spriteId != MAX_SPRITES) { sMenu->menuTextSprite = &gSprites[spriteId]; - sMenu->menuTextSprite->oam.shape = ST_OAM_SQUARE; - sMenu->menuTextSprite->oam.size = 2; + sMenu->menuTextSprite->oam.shape = SPRITE_SHAPE(32x32); + sMenu->menuTextSprite->oam.size = SPRITE_SIZE(32x32); StartSpriteAnim(sMenu->menuTextSprite, 9); sMenu->menuTextSprite->pos1.x = x + MENU_TEXT_SPRITE_X_OFFSET; sMenu->menuTextSprite->pos1.y = y + 80; - CalcCenterToCornerVec(sMenu->menuTextSprite, 1, 2, 0); + CalcCenterToCornerVec(sMenu->menuTextSprite, SPRITE_SHAPE(32x16), SPRITE_SIZE(32x16), ST_OAM_AFFINE_OFF); } else { diff --git a/src/naming_screen.c b/src/naming_screen.c index 73eda32c8..ebf57be0c 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -914,7 +914,7 @@ static void CursorInit(void) gNamingScreenData->cursorSpriteId = CreateSprite(&gUnknown_0858C138, 38, 88, 1); sub_80E3E3C(1); gSprites[gNamingScreenData->cursorSpriteId].oam.priority = 1; - gSprites[gNamingScreenData->cursorSpriteId].oam.objMode = 1; + gSprites[gNamingScreenData->cursorSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; gSprites[gNamingScreenData->cursorSpriteId].data[6] = 1; gSprites[gNamingScreenData->cursorSpriteId].data[6] = 2; SetCursorPos(0, 0); @@ -1949,37 +1949,169 @@ const struct OamData gOamData_858BFFC = static const struct Subsprite gUnknown_0858C004[] = { - {-20, -16, 1, 1, 0, 1}, - { 12, -16, 0, 0, 4, 1}, - {-20, -8, 1, 1, 5, 1}, - { 12, -8, 0, 0, 9, 1}, - {-20, 0, 1, 1, 10, 1}, - { 12, 0, 0, 0, 14, 1}, - {-20, 8, 1, 1, 15, 1}, - { 12, 8, 0, 0, 19, 1} + { + .x = -20, + .y = -16, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 12, + .y = -16, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = -20, + .y = -8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 5, + .priority = 1 + }, + { + .x = 12, + .y = -8, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 9, + .priority = 1 + }, + { + .x = -20, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 10, + .priority = 1 + }, + { + .x = 12, + .y = 0, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 14, + .priority = 1 + }, + { + .x = -20, + .y = 8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 15, + .priority = 1 + }, + { + .x = 12, + .y = 8, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 19, + .priority = 1 + } }; static const struct Subsprite gUnknown_0858C024[] = { - {-12, -4, 1, 0, 0, 1}, - { 4, -4, 0, 0, 2, 1} + { + .x = -12, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 4, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 2, + .priority = 1 + } }; static const struct Subsprite gUnknown_0858C02C[] = { - {-20, -12, 1, 1, 0, 1}, - { 12, -12, 0, 0, 4, 1}, - {-20, -4, 1, 1, 5, 1}, - { 12, -4, 0, 0, 9, 1}, - {-20, 4, 1, 1, 10, 1}, - { 12, 4, 0, 0, 14, 1} + { + .x = -20, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 12, + .y = -12, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = -20, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 5, + .priority = 1 + }, + {.x = 12, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 9, + .priority = 1 + }, + { + .x = -20, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 10, + .priority = 1 + }, + { + .x = 12, + .y = 4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 14, + .priority = 1 + } }; static const struct Subsprite gUnknown_0858C044[] = { - {-8, -12, 1, 0, 0, 3}, - {-8, -4, 1, 0, 2, 3}, - {-8, 4, 1, 0, 4, 3} + { + .x = -8, + .y = -12, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 0, + .priority = 3 + }, + { + .x = -8, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 2, + .priority = 3 + }, + { + .x = -8, + .y = 4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 4, + .priority = 3 + } }; static const struct SubspriteTable gUnknown_0858C050[] = diff --git a/src/pokeblock.c b/src/pokeblock.c index 5e7651650..03d5f4da4 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -928,7 +928,7 @@ static void sub_8136470(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - sprite->oam.affineMode = 1; + sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; sprite->affineAnims = sSpriteAffineAnimTable_85B26F0; InitSpriteAffineAnim(sprite); sprite->data[0] = 1; @@ -937,7 +937,7 @@ static void sub_8136470(struct Sprite *sprite) case 1: if (++sprite->data[1] > 11) { - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; sprite->data[0] = 0; sprite->data[1] = 0; FreeOamMatrix(sprite->oam.matrixNum); diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 4cb1c7a3e..5edf14309 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -833,7 +833,7 @@ static u8 CreateMonSprite(struct Pokemon* mon) if (!IsMonSpriteNotFlipped(species)) { gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_MonNoFlip; - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); sPokeblockFeed->noMonFlip = FALSE; } @@ -869,7 +869,7 @@ static void sub_817A468(struct Sprite* sprite) static u8 CreatePokeblockCaseSpriteForFeeding(void) { u8 spriteId = CreatePokeblockCaseSprite(188, 100, 2); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_85F0664; gSprites[spriteId].callback = SpriteCallbackDummy; InitSpriteAffineAnim(&gSprites[spriteId]); @@ -879,7 +879,7 @@ static u8 CreatePokeblockCaseSpriteForFeeding(void) static void DoPokeblockCaseThrowEffect(u8 spriteId, bool8 a1) { FreeOamMatrix(gSprites[spriteId].oam.matrixNum); - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; if (!a1) gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_85F0668; @@ -947,7 +947,7 @@ static void sub_817A634(void) sub_817A91C(); if (sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] != 0) { - pokeblockFeed->monSpritePtr->oam.affineMode = 3; + pokeblockFeed->monSpritePtr->oam.affineMode = ST_OAM_AFFINE_DOUBLE; pokeblockFeed->monSpritePtr->oam.matrixNum = 0; pokeblockFeed->monSpritePtr->affineAnims = sSpriteAffineAnimTable_85F04FC; InitSpriteAffineAnim(pokeblockFeed->monSpritePtr); diff --git a/src/pokedex.c b/src/pokedex.c index 1821b6007..3cf08263c 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2467,7 +2467,7 @@ u32 sub_80BDACC(u16 num, s16 x, s16 y) { u8 spriteId = CreateMonSpriteFromNationalDexNumber(num, x, y, i); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.priority = 3; gSprites[spriteId].data[0] = 0; gSprites[spriteId].data[1] = i; @@ -2506,13 +2506,13 @@ static void CreateInterfaceSprites(u8 a) StartSpriteAnim(&gSprites[spriteId], 1); spriteId = CreateSprite(&sRotatingPokeballSpriteTemplate, 0, 80, 2); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.matrixNum = 30; gSprites[spriteId].data[0] = 0x1E; gSprites[spriteId].data[1] = 0; spriteId = CreateSprite(&sRotatingPokeballSpriteTemplate, 0, 80, 2); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.matrixNum = 31; gSprites[spriteId].data[0] = 0x1F; gSprites[spriteId].data[1] = 0x80; @@ -2698,7 +2698,7 @@ void sub_80BE44C(struct Sprite *sprite) void MoveMonIntoPosition(struct Sprite *sprite) { sprite->oam.priority = 0; - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; sprite->pos2.x = 0; sprite->pos2.y = 0; if (sprite->pos1.x != 48 || sprite->pos1.y != 56) @@ -3449,7 +3449,7 @@ void LoadSizeScreen(u8 taskId) break; case 5: spriteId = sub_80C0EF8(PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender), 152, 56, 0); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.matrixNum = 1; gSprites[spriteId].oam.priority = 0; gSprites[spriteId].pos2.y = gPokedexEntries[sPokedexListItem->dexNum].trainerOffset; @@ -3460,7 +3460,7 @@ void LoadSizeScreen(u8 taskId) break; case 6: spriteId = CreateMonSpriteFromNationalDexNumber(sPokedexListItem->dexNum, 88, 56, 1); - gSprites[spriteId].oam.affineMode = 1; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.matrixNum = 2; gSprites[spriteId].oam.priority = 0; gSprites[spriteId].pos2.y = gPokedexEntries[sPokedexListItem->dexNum].pokemonOffset; diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 340327475..622e1d584 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -970,7 +970,7 @@ static void SetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rot static void HandleStartAffineAnim(struct Sprite *sprite) { - sprite->oam.affineMode = 3; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; sprite->affineAnims = sSpriteAffineAnimTable_860AD68; if (sUnknown_03001274 == TRUE) @@ -1028,7 +1028,7 @@ static u8 sub_817F758(void) static void sub_817F77C(struct Sprite *sprite) { - sprite->oam.affineMode = 1; + sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); if (sUnknown_03001274 == TRUE) @@ -1040,7 +1040,7 @@ static void sub_817F77C(struct Sprite *sprite) FreeOamMatrix(sprite->oam.matrixNum); sprite->oam.matrixNum |= (sprite->hFlip << 3); - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; } } diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index 70af9f956..2c11ca293 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -1004,28 +1004,26 @@ const union AffineAnimCmd *const sMonIconAffineAnims[] = const u16 sSpriteImageSizes[3][4] = { - // square + [ST_OAM_SQUARE] = { - 0x20, // 1×1 - 0x80, // 2×2 - 0x200, // 4×4 - 0x800, // 8×8 + [SPRITE_SIZE(8x8)] = 0x20, + [SPRITE_SIZE(16x16)] = 0x80, + [SPRITE_SIZE(32x32)] = 0x200, + [SPRITE_SIZE(64x64)] = 0x800, }, - - // horizontal rectangle + [ST_OAM_H_RECTANGLE] = { - 0x40, // 2×1 - 0x80, // 4×1 - 0x100, // 4×2 - 0x400, // 8×4 + [SPRITE_SIZE(16x8)] = 0x40, + [SPRITE_SIZE(32x8)] = 0x80, + [SPRITE_SIZE(32x16)] = 0x100, + [SPRITE_SIZE(64x32)] = 0x400, }, - - // vertical rectangle + [ST_OAM_V_RECTANGLE] = { - 0x40, // 1×2 - 0x80, // 1×4 - 0x100, // 2×4 - 0x400, // 4×8 + [SPRITE_SIZE(8x16)] = 0x40, + [SPRITE_SIZE(8x32)] = 0x80, + [SPRITE_SIZE(16x32)] = 0x100, + [SPRITE_SIZE(32x64)] = 0x400, }, }; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index df9bf0cf7..bddf24cb1 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -4569,7 +4569,7 @@ static void sub_80CB028(u8 boxId) for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) { if (GetBoxMonDataAt(boxId, boxPosition, MON_DATA_HELD_ITEM) == 0) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = 1; + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } } } @@ -4586,7 +4586,7 @@ static void sub_80CB140(u8 boxPosition) sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_ROWS)); if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = 1; + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } } @@ -4699,7 +4699,7 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) sPSSData->boxMonsSprites[boxPosition]->data[3] = xDest; sPSSData->boxMonsSprites[boxPosition]->callback = sub_80CB234; if (GetBoxMonDataAt(sPSSData->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == 0) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = 1; + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; count++; } } @@ -4846,7 +4846,7 @@ static void CreatePartyMonsSprites(bool8 arg0) for (i = 0; i < PARTY_SIZE; i++) { if (sPSSData->partySprites[i] != NULL && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == 0) - sPSSData->partySprites[i]->oam.objMode = 1; + sPSSData->partySprites[i]->oam.objMode = ST_OAM_OBJ_BLEND; } } } @@ -5087,7 +5087,7 @@ static void sub_80CBF14(u8 mode, u8 position) if (*sPSSData->field_B04 != NULL) { InitSpriteAffineAnim(*sPSSData->field_B04); - (*sPSSData->field_B04)->oam.affineMode = 1; + (*sPSSData->field_B04)->oam.affineMode = ST_OAM_AFFINE_NORMAL; (*sPSSData->field_B04)->affineAnims = gSpriteAffineAnimTable_857291C; StartSpriteAffineAnim(*sPSSData->field_B04, 0); } diff --git a/src/pokenav_unk_2.c b/src/pokenav_unk_2.c index 2a8a083ff..e335d74e9 100644 --- a/src/pokenav_unk_2.c +++ b/src/pokenav_unk_2.c @@ -1030,7 +1030,7 @@ static void sub_81CA4AC(struct Sprite * sprite) { sprite->invisible = TRUE; FreeOamMatrix(sprite->oam.matrixNum); - CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, 0); + CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, ST_OAM_AFFINE_OFF); sprite->oam.affineMode = ST_OAM_AFFINE_OFF; sprite->oam.objMode = ST_OAM_OBJ_NORMAL; sprite->callback = SpriteCallbackDummy; diff --git a/src/pokenav_unk_7.c b/src/pokenav_unk_7.c index 34432a077..bcc608380 100644 --- a/src/pokenav_unk_7.c +++ b/src/pokenav_unk_7.c @@ -719,8 +719,8 @@ void sub_81CE9E4(void) if (spriteId != MAX_SPRITES) { structPtr->unk1806[i] = spriteId; - gSprites[spriteId].oam.shape = 1; - gSprites[spriteId].oam.size = 2; + gSprites[spriteId].oam.shape = SPRITE_SHAPE(32x16); + gSprites[spriteId].oam.size = SPRITE_SIZE(32x16); } else { diff --git a/src/psychic.c b/src/psychic.c index 7ad8e14cb..656608740 100644 --- a/src/psychic.c +++ b/src/psychic.c @@ -659,7 +659,7 @@ void sub_810F6B0(struct Sprite *sprite) static void sub_810F740(struct Sprite *sprite) { - sprite->oam.affineMode = 1; + sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; sprite->affineAnims = gUnknown_08596740; sprite->data[0] = 0; InitSpriteAffineAnim(sprite); @@ -674,7 +674,7 @@ static void sub_810F774(struct Sprite *sprite) if (sprite->affineAnimEnded) { FreeOamMatrix(sprite->oam.matrixNum); - sprite->oam.affineMode = 0; + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; sprite->data[1] = 18; sprite->data[0]++; } diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index 1e2d69796..cef7f4cdd 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -2045,8 +2045,8 @@ static void sub_81D81A4(u8 taskId) (sUnknown_0862AAB8[data[0]][1] * 4) + 80, 0); gSprites[spriteId].data[0] = (s8)(data[0]); - gSprites[spriteId].oam.objMode = 1; - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; gSprites[spriteId].oam.priority = 2; InitSpriteAffineAnim(&gSprites[spriteId]); if (data[0] == 9) diff --git a/src/region_map.c b/src/region_map.c index 9929de382..b1ba2795c 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1416,14 +1416,14 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) gRegionMap->cursorSprite = &gSprites[spriteId]; if (gRegionMap->zoomed == TRUE) { - gRegionMap->cursorSprite->oam.size = 2; + gRegionMap->cursorSprite->oam.size = SPRITE_SIZE(32x32); gRegionMap->cursorSprite->pos1.x -= 8; gRegionMap->cursorSprite->pos1.y -= 8; StartSpriteAnim(gRegionMap->cursorSprite, 1); } else { - gRegionMap->cursorSprite->oam.size = 1; + gRegionMap->cursorSprite->oam.size = SPRITE_SIZE(16x16); gRegionMap->cursorSprite->pos1.x = 8 * gRegionMap->cursorPosX + 4; gRegionMap->cursorSprite->pos1.y = 8 * gRegionMap->cursorPosY + 4; } @@ -1863,15 +1863,15 @@ static void sub_8124AD4(void) y = (y + MAPCURSOR_Y_MIN) * 8 + 4; if (width == 2) { - shape = ST_OAM_H_RECTANGLE; + shape = SPRITE_SHAPE(16x8); } else if (height == 2) { - shape = ST_OAM_V_RECTANGLE; + shape = SPRITE_SHAPE(8x16); } else { - shape = ST_OAM_SQUARE; + shape = SPRITE_SHAPE(8x8); } spriteId = CreateSprite(&gUnknown_085A1F7C, x, y, 10); if (spriteId != MAX_SPRITES) @@ -1913,7 +1913,7 @@ static void sub_8124BE4(void) spriteId = CreateSprite(&gUnknown_085A1F7C, x, y, 10); if (spriteId != MAX_SPRITES) { - gSprites[spriteId].oam.size = 1; + gSprites[spriteId].oam.size = SPRITE_SIZE(16x16); gSprites[spriteId].callback = sub_8124CBC; StartSpriteAnim(&gSprites[spriteId], 6); gSprites[spriteId].data[0] = mapSecId; diff --git a/src/rock.c b/src/rock.c index 7bba6f603..28566f1b7 100644 --- a/src/rock.c +++ b/src/rock.c @@ -136,8 +136,8 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8596BA0 = const struct Subsprite gUnknown_08596BB8[] = { - {.x = -16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .size = 2, .tileOffset = 0, .priority = 1}, - {.x = 16, .y = 0, .shape = ST_OAM_H_RECTANGLE, .size = 2, .tileOffset = 8, .priority = 1}, + {.x = -16, .y = 0, .shape = SPRITE_SHAPE(32x16), .size = SPRITE_SIZE(32x16), .tileOffset = 0, .priority = 1}, + {.x = 16, .y = 0, .shape = SPRITE_SHAPE(32x16), .size = SPRITE_SIZE(32x16), .tileOffset = 8, .priority = 1}, }; const struct SubspriteTable gUnknown_08596BC0[] = diff --git a/src/rom_8034C54.c b/src/rom_8034C54.c index 7cc30c775..029696526 100644 --- a/src/rom_8034C54.c +++ b/src/rom_8034C54.c @@ -189,7 +189,7 @@ static void sub_8034EFC(struct UnkStruct2 *arg0) oamId--; gMain.oamBuffer[oamId].x = arg0->x - arg0->xDelta; - gMain.oamBuffer[oamId].affineMode = 2; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE; gMain.oamBuffer[oamId].tileNum = arg0->tileStart + (arg0->field_9 * 10); } @@ -244,9 +244,9 @@ static void sub_80350B0(struct UnkStruct2 *arg0, s32 arg1, bool32 arg2) } if (arg2) - gMain.oamBuffer[oamId].affineMode = 0; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF; else - gMain.oamBuffer[oamId].affineMode = 2; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE; } static void sub_8035164(struct UnkStruct2 *arg0, s32 arg1, bool32 arg2) @@ -265,14 +265,14 @@ static void sub_8035164(struct UnkStruct2 *arg0, s32 arg1, bool32 arg2) if (r4 != 0 || gUnknown_03000DDC != -1 || r5 == 0) { gMain.oamBuffer[gUnknown_03000DD4].tileNum = (r4 * arg0->field_9) + arg0->tileStart; - gMain.oamBuffer[gUnknown_03000DD4].affineMode = 0; + gMain.oamBuffer[gUnknown_03000DD4].affineMode = ST_OAM_AFFINE_OFF; if (gUnknown_03000DDC == -1) gUnknown_03000DDC = gUnknown_03000DD8; } else { - gMain.oamBuffer[gUnknown_03000DD4].affineMode = 2; + gMain.oamBuffer[gUnknown_03000DD4].affineMode = ST_OAM_AFFINE_ERASE; } gUnknown_03000DD4++; @@ -281,12 +281,12 @@ static void sub_8035164(struct UnkStruct2 *arg0, s32 arg1, bool32 arg2) if (arg2) { - gMain.oamBuffer[gUnknown_03000DD4].affineMode = 0; + gMain.oamBuffer[gUnknown_03000DD4].affineMode = ST_OAM_AFFINE_OFF; gMain.oamBuffer[gUnknown_03000DD4].x = arg0->x + ((gUnknown_03000DDC - 1) * arg0->xDelta); } else { - gMain.oamBuffer[gUnknown_03000DD4].affineMode = 2; + gMain.oamBuffer[gUnknown_03000DD4].affineMode = ST_OAM_AFFINE_ERASE; } } @@ -307,7 +307,7 @@ static void sub_80352C0(struct UnkStruct2 *arg0, s32 arg1, bool32 arg2) { var_28 = 1; gMain.oamBuffer[oamId].tileNum = (r4 * arg0->field_9) + arg0->tileStart; - gMain.oamBuffer[oamId].affineMode = 0; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF; oamId++; r9++; @@ -316,15 +316,15 @@ static void sub_80352C0(struct UnkStruct2 *arg0, s32 arg1, bool32 arg2) while (r9 < arg0->oamCount) { - gMain.oamBuffer[oamId].affineMode = 2; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE; oamId++; r9++; } if (arg2) - gMain.oamBuffer[oamId].affineMode = 0; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF; else - gMain.oamBuffer[oamId].affineMode = 2; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE; } void sub_80353DC(u32 id) @@ -340,7 +340,7 @@ void sub_80353DC(u32 id) oamId = gUnknown_02022E10->array[id].firstOamId; for (i = 0; i < oamCount; i++, oamId++) - gMain.oamBuffer[oamId].affineMode = 2; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE; if (!SharesTileWithAnyActive(id)) FreeSpriteTilesByTag(gUnknown_02022E10->array[id].tileTag); @@ -364,12 +364,12 @@ void sub_803547C(u32 id, bool32 arg1) if (arg1) { for (i = 0; i < oamCount; i++, oamId++) - gMain.oamBuffer[oamId].affineMode = 2; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_ERASE; } else { for (i = 0; i < oamCount; i++, oamId++) - gMain.oamBuffer[oamId].affineMode = 0; + gMain.oamBuffer[oamId].affineMode = ST_OAM_AFFINE_OFF; sub_8035044(id, gUnknown_02022E10->array[id].field_18); } diff --git a/src/roulette.c b/src/roulette.c index 26002e773..fb0677cbf 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -4043,7 +4043,7 @@ static void sub_81446DC(struct Sprite *sprite) gUnknown_0203AB88->var3C[55] = CreateSprite(&gSpriteTemplate_85B79F8, 36, -12, 50); gUnknown_0203AB88->var3C[56] = CreateSprite(&gSpriteTemplate_85B7ABC[0], s[sprite->data[0]][0], s[sprite->data[0]][1], 59); gUnknown_0203AB88->var3C[57] = CreateSprite(&gSpriteTemplate_85B7ABC[1], 36, 140, 51); - gSprites[gUnknown_0203AB88->var3C[57]].oam.objMode = 1; + gSprites[gUnknown_0203AB88->var3C[57]].oam.objMode = ST_OAM_OBJ_BLEND; for (i = 0; i < 3; i++) { gSprites[gUnknown_0203AB88->var3C[i + 55]].coordOffsetEnabled = FALSE; diff --git a/src/shop.c b/src/shop.c index c9cd1919a..324154d2e 100755 --- a/src/shop.c +++ b/src/shop.c @@ -439,7 +439,7 @@ static void CB2_InitBuyMenu(void) { case 0: SetVBlankHBlankCallbacksToNull(); - CpuFastFill(0, (void *)OAM, 0x400); + CpuFastFill(0, (void *)OAM, OAM_SIZE); ScanlineEffect_Stop(); reset_temp_tile_data_buffers(); FreeAllSpritePalettes(); @@ -856,7 +856,7 @@ static void BuyMenuDrawEventObjects(void) if (BuyMenuCheckIfEventObjectOverlapsMenuBg(gShopDataPtr->viewportObjects[i]) == TRUE) { gSprites[spriteId].subspriteTableNum = 4; - gSprites[spriteId].subspriteMode = 1; + gSprites[spriteId].subspriteMode = SUBSPRITES_ON; } StartSpriteAnim(&gSprites[spriteId], gShopDataPtr->viewportObjects[i][ANIM_NUM]); diff --git a/src/title_screen.c b/src/title_screen.c index f95d7685e..c20e1ba70 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -353,7 +353,7 @@ static void SpriteCB_VersionBannerLeft(struct Sprite *sprite) { if (gTasks[sprite->data[1]].data[1] != 0) { - sprite->oam.objMode = 0; + sprite->oam.objMode = ST_OAM_OBJ_NORMAL; sprite->pos1.y = VERSION_BANNER_Y_GOAL; } else @@ -370,7 +370,7 @@ static void SpriteCB_VersionBannerRight(struct Sprite *sprite) { if (gTasks[sprite->data[1]].data[1] != 0) { - sprite->oam.objMode = 0; + sprite->oam.objMode = ST_OAM_OBJ_NORMAL; sprite->pos1.y = VERSION_BANNER_Y_GOAL; } else @@ -484,22 +484,22 @@ static void StartPokemonLogoShine(u8 flashBg) case 0: case 2: spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, 0, 68, 0); - gSprites[spriteId].oam.objMode = 2; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW; gSprites[spriteId].data[0] = flashBg; break; case 1: spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, 0, 68, 0); - gSprites[spriteId].oam.objMode = 2; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW; gSprites[spriteId].data[0] = flashBg; gSprites[spriteId].invisible = TRUE; spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, 0, 68, 0); gSprites[spriteId].callback = SpriteCB_PokemonLogoShine2; - gSprites[spriteId].oam.objMode = 2; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW; spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, -80, 68, 0); gSprites[spriteId].callback = SpriteCB_PokemonLogoShine2; - gSprites[spriteId].oam.objMode = 2; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW; break; } } diff --git a/src/trade.c b/src/trade.c index 909abe540..91b514067 100644 --- a/src/trade.c +++ b/src/trade.c @@ -3672,8 +3672,8 @@ static bool8 AnimateTradeSequenceCable(void) if (!IsMonSpriteNotFlipped(sTradeData->monSpecies[TRADE_PLAYER])) { gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].affineAnims = gSpriteAffineAnimTable_8338ECC; - gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].oam.affineMode = 3; - CalcCenterToCornerVec(&gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]], 0, 3, 3); + gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].oam.affineMode = ST_OAM_AFFINE_DOUBLE; + CalcCenterToCornerVec(&gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]], SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); StartSpriteAffineAnim(&gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]], 0); } else @@ -4170,8 +4170,8 @@ static bool8 AnimateTradeSequenceWireless(void) if (!IsMonSpriteNotFlipped(sTradeData->monSpecies[TRADE_PLAYER])) { gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].affineAnims = gSpriteAffineAnimTable_8338ECC; - gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].oam.affineMode = 3; - CalcCenterToCornerVec(&gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]], 0, 3, 3); + gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].oam.affineMode = ST_OAM_AFFINE_DOUBLE; + CalcCenterToCornerVec(&gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]], SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE); StartSpriteAffineAnim(&gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]], 0); } else diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 794c2989c..bd3abe0e4 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -1302,8 +1302,8 @@ void sub_8167760(void) if (spriteId != MAX_SPRITES) { gUnknown_0203BCAC->field_7B06[i] = spriteId; - gSprites[spriteId].oam.shape = 1; - gSprites[spriteId].oam.size = 2; + gSprites[spriteId].oam.shape = SPRITE_SHAPE(32x16); + gSprites[spriteId].oam.size = SPRITE_SIZE(32x16); } else {