diff --git a/asm/battle_4.s b/asm/battle_4.s index 683f61c79..02cb28d9c 100644 --- a/asm/battle_4.s +++ b/asm/battle_4.s @@ -17057,9 +17057,9 @@ _0804F470: bl DestroySprite ldr r4, =0x0000d75a adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _0804F48C: pop {r4} pop {r0} diff --git a/asm/battle_7.s b/asm/battle_7.s index f9d0f312f..0ad656454 100644 --- a/asm/battle_7.s +++ b/asm/battle_7.s @@ -1757,7 +1757,7 @@ sub_805DFE4: @ 805DFE4 lsrs r0, 13 adds r0, r1 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 .pool diff --git a/asm/battle_814AEAC.s b/asm/battle_814AEAC.s index c4487fc8c..ccc892141 100644 --- a/asm/battle_814AEAC.s +++ b/asm/battle_814AEAC.s @@ -111,7 +111,7 @@ sub_814AF54: @ 814AF54 adds r0, r1 lsls r0, 2 adds r0, r6 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -574,7 +574,7 @@ sub_814B340: @ 814B340 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -621,7 +621,7 @@ sub_814B3DC: @ 814B3DC lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -840,9 +840,9 @@ sub_814B5A8: @ 814B5A8 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, =c3_0802FDF4 movs r1, 0xA bl CreateTask @@ -3501,7 +3501,7 @@ _0814CE5C: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] diff --git a/asm/battle_anim.s b/asm/battle_anim.s index ebd501afd..fe48b22df 100644 --- a/asm/battle_anim.s +++ b/asm/battle_anim.s @@ -288,7 +288,7 @@ _080A3BC2: move_anim_8072740: @ 80A3BFC push {r4,lr} adds r4, r0, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite ldr r1, =gUnknown_020383FE @@ -496,9 +496,9 @@ ma01_080728D0: @ 80A3D8C adds r0, r1 ldrh r5, [r0, 0x6] adds r0, r5, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r5, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, [r6] adds r0, 0x2 str r0, [r6] @@ -823,12 +823,12 @@ _080A404A: lsls r0, 3 adds r0, r6 ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldrh r0, [r4] lsls r0, 3 adds r0, r6 ldrh r0, [r0, 0x6] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrh r1, [r4] adds r0, r7, 0 orrs r0, r1 diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s index c095c1b21..a60451ec8 100644 --- a/asm/battle_anim_80FE840.s +++ b/asm/battle_anim_80FE840.s @@ -8394,7 +8394,7 @@ _08102B1C: bl SetGpuRegBits _08102B26: ldr r0, =0x00002771 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 bl move_anim_task_del _08102B32: @@ -8598,7 +8598,7 @@ _08102CAA: lsls r0, 2 adds r0, r6 ldrh r0, [r0] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @@ -12098,7 +12098,7 @@ sub_81048F0: @ 81048F0 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl obj_delete_but_dont_free_vram _0810492E: @@ -13276,7 +13276,7 @@ sub_8105284: @ 8105284 cmp r0, 0 beq _0810529E adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl move_anim_8072740 _0810529E: @@ -14620,7 +14620,7 @@ sub_8105D60: @ 8105D60 movs r4, 0x2 _08105D6A: ldrh r0, [r5] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r5, 0x2 subs r4, 0x1 cmp r4, 0 @@ -19936,7 +19936,7 @@ sub_810886C: @ 810886C ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite _081088D8: @@ -20403,7 +20403,7 @@ sub_8108C54: @ 8108C54 cmp r0, 0 bne _08108C8C adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite _08108C8C: @@ -25102,7 +25102,7 @@ sub_810B1F0: @ 810B1F0 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite _0810B230: @@ -27886,7 +27886,7 @@ _0810C8D0: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r1, [r4, 0x1] movs r0, 0x4 negs r0, r0 @@ -28272,7 +28272,7 @@ _0810CBE6: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite b _0810CC32 @@ -28296,7 +28296,7 @@ _0810CC04: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite _0810CC32: @@ -28335,7 +28335,7 @@ sub_810CC3C: @ 810CC3C ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite _0810CC7C: @@ -28865,7 +28865,7 @@ sub_810D0B8: @ 810D0B8 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix movs r0, 0x3C ldrsh r1, [r5, r0] lsls r0, r1, 4 @@ -31064,7 +31064,7 @@ sub_810E2C8: @ 810E2C8 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r1, [r4, 0x1] movs r0, 0x4 negs r0, r0 @@ -33733,7 +33733,7 @@ _0810F786: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r1, [r4, 0x1] movs r0, 0x4 negs r0, r0 @@ -34515,7 +34515,7 @@ sub_810FDF0: @ 810FDF0 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite _0810FE0E: @@ -34833,7 +34833,7 @@ _0811006C: cmp r0, 0 bge _08110094 adds r0, r5, 0 - bl rotscale_free_entry + bl FreeOamMatrix mov r0, r8 bl move_anim_task_del b _08110116 @@ -35033,7 +35033,7 @@ _08110228: ldrh r0, [r4, 0x24] lsls r0, 24 lsrs r0, 24 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r5, 0 bl move_anim_task_del _08110238: @@ -38554,7 +38554,7 @@ _08111ED0: cmp r0, 0 bge _08111F0C adds r0, r7, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _08111EFE: adds r0, r4, 0 bl move_anim_task_del @@ -38934,7 +38934,7 @@ _081121F0: adds r0, r3 bl obj_delete_but_dont_free_vram ldr r0, =0x00002771 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x50 movs r1, 0 bl SetGpuReg diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s index cb73f3b31..ebc376f4c 100644 --- a/asm/battle_anim_8170478.s +++ b/asm/battle_anim_8170478.s @@ -576,9 +576,9 @@ sub_817094C: @ 817094C lsls r6, 24 lsrs r6, 24 ldr r0, =0x0000d709 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, =0x0000d70a - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, =0x0000d6ff bl IndexOfSpritePaletteTag adds r4, r0, 0 @@ -2401,7 +2401,7 @@ _08171880: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r7] adds r0, r4 ldrb r1, [r0] @@ -2554,7 +2554,7 @@ sub_81719C0: @ 81719C0 .pool _081719D8: adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite _081719E4: @@ -4415,7 +4415,7 @@ sub_8172944: @ 8172944 cmp r0, 0x1 bne _081729CA adds r0, r7, 0 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources b _081729E2 .pool _08172970: @@ -4454,9 +4454,9 @@ _081729AA: ldr r4, =gUnknown_085E50F4 _081729B4: ldrh r0, [r5, 0x6] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldrh r0, [r4, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r5, 0x8 adds r4, 0x8 adds r6, 0x1 @@ -5466,7 +5466,7 @@ sub_81731FC: @ 81731FC subs r1, 0x1 strh r1, [r0, 0x20] adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite _08173246: @@ -5517,7 +5517,7 @@ _08173264: subs r1, 0x1 strh r1, [r0, 0x20] adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite _081732A6: @@ -5555,9 +5555,9 @@ sub_81732E4: @ 81732E4 lsrs r4, 24 ldr r5, =0x0000281d adds r0, r5, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r5, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 bl move_anim_task_del pop {r4,r5} diff --git a/asm/battle_anin_80A9C70.s b/asm/battle_anin_80A9C70.s index 601cf0ab2..0d854c07a 100644 --- a/asm/battle_anin_80A9C70.s +++ b/asm/battle_anin_80A9C70.s @@ -315,7 +315,7 @@ _080A9EAA: cmp r0, 0 beq _080A9EE6 adds r0, r4, 0 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources b _080A9EEC _080A9EE6: adds r0, r4, 0 @@ -601,7 +601,7 @@ sub_80AA124: @ 80AA124 ldr r0, =gSprites adds r4, r0 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite b _080AA186 diff --git a/asm/battle_controller_linkopponent.s b/asm/battle_controller_linkopponent.s index 98c44bc58..1fa02c8da 100644 --- a/asm/battle_controller_linkopponent.s +++ b/asm/battle_controller_linkopponent.s @@ -138,7 +138,7 @@ sub_8064470: @ 8064470 adds r0, r1 lsls r0, 2 adds r0, r5 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] @@ -358,9 +358,9 @@ _08064600: strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag b _080646F2 .pool _0806469C: @@ -401,9 +401,9 @@ _0806469C: bne _080646F2 ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _080646F2: ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -946,9 +946,9 @@ _08064B7C: strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag bl sub_8065068 _08064BB6: pop {r4-r7} @@ -1050,7 +1050,7 @@ sub_8064C58: @ 8064C58 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -1296,9 +1296,9 @@ sub_8064E50: @ 8064E50 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] @@ -3932,7 +3932,7 @@ _0806666C: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -5864,7 +5864,7 @@ sub_80676FC: @ 80676FC ldrh r0, [r4, 0x6] bl sub_805DFE4 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite pop {r4} diff --git a/asm/battle_controller_opponent.s b/asm/battle_controller_opponent.s index a790956d9..7e08af4d4 100644 --- a/asm/battle_controller_opponent.s +++ b/asm/battle_controller_opponent.s @@ -138,7 +138,7 @@ sub_805F240: @ 805F240 adds r0, r1 lsls r0, 2 adds r0, r5 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] @@ -377,9 +377,9 @@ _0805F408: strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag b _0805F51A .pool _0805F494: @@ -417,9 +417,9 @@ _0805F494: bne _0805F53C ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _0805F4E4: mov r1, r8 ldr r0, [r1] @@ -1040,9 +1040,9 @@ _0805F9E0: strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag bl dp01_tbl7_exec_completed _0805FA48: pop {r4,r5} @@ -1144,7 +1144,7 @@ sub_805FB08: @ 805FB08 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -1390,9 +1390,9 @@ sub_805FD00: @ 805FD00 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] @@ -4094,7 +4094,7 @@ _080615B4: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -6216,7 +6216,7 @@ sub_806280C: @ 806280C ldrh r0, [r4, 0x6] bl sub_805DFE4 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite pop {r4} diff --git a/asm/battle_controller_player.s b/asm/battle_controller_player.s index 37ecb62de..f403f7e46 100644 --- a/asm/battle_controller_player.s +++ b/asm/battle_controller_player.s @@ -2324,7 +2324,7 @@ bx_802F7A0: @ 80588B4 adds r0, r1 lsls r0, 2 adds r0, r6 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -2528,9 +2528,9 @@ _08058A0E: strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r7, =gBattlePartyID ldrb r1, [r6] lsls r0, r1, 1 @@ -3064,9 +3064,9 @@ sub_8058EDC: @ 8058EDC strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, [r5] ldrb r2, [r6] ldr r1, [r0] @@ -3917,7 +3917,7 @@ sub_80596A8: @ 80596A8 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -3964,7 +3964,7 @@ sub_8059744: @ 8059744 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -7149,7 +7149,7 @@ _0805B41C: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -9842,13 +9842,13 @@ sub_805CC00: @ 805CC00 ldrh r4, [r5, 0x38] lsls r4, 24 lsrs r4, 24 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r5, 0x5] lsrs r0, 4 bl GetObjectPaletteTagBySlot lsls r0, 16 lsrs r0, 16 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r5, 0 bl DestroySprite ldr r1, =gBattlePartyID diff --git a/asm/battle_transition.s b/asm/battle_transition.s index 2013be6c2..edac5fdfc 100644 --- a/asm/battle_transition.s +++ b/asm/battle_transition.s @@ -7843,7 +7843,7 @@ sub_8149F08: @ 8149F08 thumb_func_start sub_8149F2C sub_8149F2C: @ 8149F2C push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/berry_blender.s b/asm/berry_blender.s index a39182e88..0f414082a 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -70,7 +70,7 @@ sub_807F764: @ 807F764 str r0, [sp, 0xC] movs r0, 0x2 bl SetBgAffine - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer add sp, 0x10 diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index f9aee3455..4ed568ed7 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -45,7 +45,7 @@ sub_8177C54: @ 8177C54 thumb_func_start sub_8177C70 sub_8177C70: @ 8177C70 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/cable_car.s b/asm/cable_car.s index 48ed673bf..24df7f488 100644 --- a/asm/cable_car.s +++ b/asm/cable_car.s @@ -1339,7 +1339,7 @@ sub_8150800: @ 8150800 ldrb r1, [r0, 0x9] movs r0, 0x12 bl SetGpuReg - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r4} diff --git a/asm/cable_car_util.s b/asm/cable_car_util.s index 35d3b1c7d..7f396b635 100644 --- a/asm/cable_car_util.s +++ b/asm/cable_car_util.s @@ -199,7 +199,7 @@ _08152208: cmp r5, r4 bcs _08152242 adds r3, r6, 0 - ldr r0, =gDefaultOamAttributes + ldr r0, =gDummyOamData mov r12, r0 movs r2, 0x4 mov r8, r2 @@ -254,7 +254,7 @@ _0815226C: bcs _08152292 ldr r0, =gUnknown_030024F8 mov r12, r0 - ldr r4, =gDefaultOamAttributes + ldr r4, =gDummyOamData adds r2, r5, 0 _0815227A: lsls r1, r3, 3 @@ -352,7 +352,7 @@ _08152322: lsls r0, r6, 3 ldr r1, =gUnknown_030024F8 adds r0, r1 - ldr r1, =gDefaultOamAttributes + ldr r1, =gDummyOamData ldm r1!, {r2,r3} stm r0!, {r2,r3} b _081523C0 @@ -748,7 +748,7 @@ _081525FC: lsls r1, r5, 3 ldr r0, =gUnknown_030024F8 adds r1, r0 - ldr r0, =gDefaultOamAttributes + ldr r0, =gDummyOamData ldm r0!, {r2,r3} stm r1!, {r2,r3} adds r0, r5, 0 diff --git a/asm/contest.s b/asm/contest.s index e665208f0..36ac223c3 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -1365,7 +1365,7 @@ vblank_cb_battle: @ 80D827C movs r0, 0x46 bl SetGpuReg bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl sub_80BA0A8 pop {r0} @@ -4604,7 +4604,7 @@ _080D9FEC: cmp r0, 0 bge _080DA100 adds r0, r6, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r6, 0 bl DestroySprite movs r0, 0x14 @@ -10029,11 +10029,11 @@ sub_80DCB78: @ 80DCB78 lsls r4, 2 adds r4, r1 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite adds r0, r5, 0 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources pop {r4,r5} pop {r0} bx r0 @@ -13526,7 +13526,7 @@ _080DE7EE: lsls r0, 2 ldr r1, =gSprites adds r0, r1 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r4, 0x1 cmp r4, 0x3 ble _080DE7EE diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 31fb693b2..a532ffb6a 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -489,7 +489,7 @@ sub_80F5C24: @ 80F5C24 ldrh r1, [r0] movs r0, 0x46 bl SetGpuReg - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80BA0A8 diff --git a/asm/contest_painting.s b/asm/contest_painting.s index dc5b2308f..8498ad9db 100644 --- a/asm/contest_painting.s +++ b/asm/contest_painting.s @@ -552,7 +552,7 @@ _081302C0: sub_81302D0: @ 81302D0 push {lr} bl sub_8130280 - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/credits.s b/asm/credits.s index 06f9007d4..c40af6aaf 100644 --- a/asm/credits.s +++ b/asm/credits.s @@ -8,7 +8,7 @@ thumb_func_start sub_81754C8 sub_81754C8: @ 81754C8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/decoration.s b/asm/decoration.s index 365fe4135..dbd4be580 100644 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -4148,7 +4148,7 @@ _08128C10: _08128C30: bl sub_812A3C8 ldr r0, =0x00000be5 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r1, =gUnknown_03005DAC ldr r0, =sub_8128CD4 str r0, [r1] @@ -5078,7 +5078,7 @@ gpu_pal_decompress_alloc_tag_and_upload: @ 8129334 cmp r0, 0x4 beq _081293B4 ldr r0, =0x00000be5 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r5, 0 bl sub_81291E8 ldr r0, [r5] @@ -7060,7 +7060,7 @@ _0812A3BE: sub_812A3C8: @ 812A3C8 push {lr} movs r0, 0x8 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 thumb_func_end sub_812A3C8 diff --git a/asm/diploma.s b/asm/diploma.s index d205921d4..aecb5f003 100644 --- a/asm/diploma.s +++ b/asm/diploma.s @@ -8,7 +8,7 @@ thumb_func_start sub_8177874 sub_8177874: @ 8177874 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/easy_chat.s b/asm/easy_chat.s index 09f956503..b549417fb 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -67,7 +67,7 @@ sub_811A278: @ 811A278 sub_811A290: @ 811A290 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests pop {r0} bx r0 diff --git a/asm/egg_hatch.s b/asm/egg_hatch.s index e4a29b9b0..51baf23ef 100644 --- a/asm/egg_hatch.s +++ b/asm/egg_hatch.s @@ -458,7 +458,7 @@ _08071712: thumb_func_start sub_807172C sub_807172C: @ 807172C push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s index c356a5544..06e57c336 100644 --- a/asm/evolution_scene.s +++ b/asm/evolution_scene.s @@ -3662,7 +3662,7 @@ sub_813FCDC: @ 813FCDC ldrh r1, [r0] movs r0, 0x1E bl SetGpuReg - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80BA0A8 @@ -3706,7 +3706,7 @@ sub_813FD64: @ 813FD64 ldrh r1, [r0] movs r0, 0x1E bl SetGpuReg - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80BA0A8 diff --git a/asm/field_effect.s b/asm/field_effect.s index 335d0a495..21231f87c 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -335,7 +335,7 @@ _080B5D48: cmp r2, 0x3F bls _080B5D1E adds r0, r3, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _080B5D58: pop {r4,r5} pop {r0} @@ -381,7 +381,7 @@ _080B5DA0: cmp r2, 0x3F bls _080B5D84 adds r0, r5, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _080B5DB0: pop {r4-r6} pop {r0} @@ -755,7 +755,7 @@ sub_80B6070: @ 80B6070 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix _080B608E: adds r0, r5, 0 bl sub_818D820 @@ -7331,7 +7331,7 @@ _080B95F6: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r1, [r4, 0x1] lsrs r1, 6 ldrb r2, [r4, 0x3] @@ -7507,7 +7507,7 @@ _080B9756: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s index 5f5356e32..9491ca9ff 100644 --- a/asm/field_effect_helpers.s +++ b/asm/field_effect_helpers.s @@ -3190,7 +3190,7 @@ sub_8155800: @ 8155800 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_082EC6AC + ldr r0, =gDummySpriteTemplate movs r1, 0 movs r2, 0 movs r3, 0xFF diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index e3091b2f6..6e5d4f0d9 100644 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -18079,7 +18079,7 @@ sub_80956F4: @ 80956F4 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r4, 0x1] movs r1, 0x4 negs r1, r1 diff --git a/asm/field_region_map.s b/asm/field_region_map.s index c9bc3d19d..9a44e67a4 100644 --- a/asm/field_region_map.s +++ b/asm/field_region_map.s @@ -87,7 +87,7 @@ sub_81701C4: @ 81701C4 thumb_func_start sub_8170260 sub_8170260: @ 8170260 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 42edce436..6de538368 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -2496,7 +2496,7 @@ _080FB07E: cmp r1, r0 bne _080FB098 adds r0, r4, 0 - bl FreeObjectPalette + bl FreeSpritePalette adds r0, r4, 0 bl DestroySprite _080FB098: diff --git a/asm/front_pic_anim.s b/asm/front_pic_anim.s index 5439964e3..55e2a511a 100644 --- a/asm/front_pic_anim.s +++ b/asm/front_pic_anim.s @@ -426,7 +426,7 @@ _0817F7D0: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r2, [r4, 0x3] lsls r1, r2, 26 lsrs r1, 27 diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s index f963aafdf..62947d7ef 100644 --- a/asm/hall_of_fame.s +++ b/asm/hall_of_fame.s @@ -8,7 +8,7 @@ thumb_func_start sub_817354C sub_817354C: @ 817354C push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -1356,7 +1356,7 @@ _081740DC: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl sub_818D820 _081740FA: @@ -3380,9 +3380,9 @@ _081752D4: bl sub_8152254 ldr r4, =0x000003e9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r4} pop {r0} bx r0 diff --git a/asm/intro.s b/asm/intro.s index 4a0332162..50431baeb 100644 --- a/asm/intro.s +++ b/asm/intro.s @@ -8,7 +8,7 @@ thumb_func_start sub_816CBE8 sub_816CBE8: @ 816CBE8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80BA0A8 diff --git a/asm/link.s b/asm/link.s index 179d619f2..22b8e0dbb 100644 --- a/asm/link.s +++ b/asm/link.s @@ -328,7 +328,7 @@ _0800969E: thumb_func_start sub_80096BC sub_80096BC: @ 80096BC push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -9528,7 +9528,7 @@ sub_800E084: @ 800E084 movs r0, 0x84 lsls r0, 3 adds r3, r0 - ldr r0, =gDefaultOamAttributes + ldr r0, =gDummyOamData ldr r1, [r0] ldr r2, [r0, 0x4] str r1, [r3] @@ -16588,7 +16588,7 @@ sub_8011AC8: @ 8011AC8 thumb_func_start sub_8011AE8 sub_8011AE8: @ 8011AE8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -28583,7 +28583,7 @@ sub_8018404: @ 8018404 sub_8018424: @ 8018424 push {lr} bl ProcessSpriteCopyRequests - bl LoadOamFromSprites + bl LoadOam bl TransferPlttBuffer pop {r0} bx r0 @@ -32554,7 +32554,7 @@ _0801A414: thumb_func_start sub_801A418 sub_801A418: @ 801A418 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -33539,7 +33539,7 @@ _0801AC38: thumb_func_start sub_801AC40 sub_801AC40: @ 801AC40 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -36741,9 +36741,9 @@ _0801C6A4: movs r4, 0x80 lsls r4, 8 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _0801C6B4: pop {r4-r7} pop {r0} @@ -39835,7 +39835,7 @@ _0801DF04: sub_801DF20: @ 801DF20 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl sub_80BA0A8 pop {r0} @@ -45843,7 +45843,7 @@ _08020F66: sub_8020F74: @ 8020F74 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests pop {r0} bx r0 @@ -46668,7 +46668,7 @@ _0802166E: ldr r0, =SpriteCallbackDummy str r0, [r5, 0x1C] adds r0, r5, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r5, 0 bl DestroySprite _0802169A: @@ -46692,9 +46692,9 @@ _080216B6: adds r0, r7 ldrh r4, [r0] adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -48910,19 +48910,19 @@ sub_8022960: @ 8022960 adds r5, r0, 0 movs r4, 0 movs r0, 0x4 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x3 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x2 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x1 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x4 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x2 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x1 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0xD8 lsls r0, 1 adds r6, r5, r0 @@ -55991,7 +55991,7 @@ sub_80261CC: @ 80261CC sub_80261E4: @ 80261E4 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests pop {r0} bx r0 @@ -60697,7 +60697,7 @@ _08028622: adds r0, r1 cmp r0, 0 beq _0802863C - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources _0802863C: adds r0, r4, 0x1 lsls r0, 24 @@ -60931,7 +60931,7 @@ _080287E8: adds r0, r1 cmp r0, 0 beq _08028806 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources _08028806: adds r0, r4, 0x1 lsls r0, 24 @@ -65138,7 +65138,7 @@ sub_802AC2C: @ 802AC2C sub_802AC58: @ 802AC58 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests pop {r0} bx r0 @@ -72875,14 +72875,14 @@ _0802E8FC: lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r1, =gUnknown_082FE6D8 movs r2, 0x8 ldrsh r0, [r4, r2] lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r4,r5} pop {r0} bx r0 @@ -73256,7 +73256,7 @@ _0802EC08: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix movs r3, 0xE ldrsh r1, [r5, r3] lsls r0, r1, 4 @@ -73291,9 +73291,9 @@ _0802EC4C: adds r0, r4 bl DestroySprite ldrh r0, [r5, 0x4] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldrh r0, [r5, 0x6] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r6, 0 bl DestroyTask _0802EC8A: diff --git a/asm/mail.s b/asm/mail.s index 6280b00ed..6d0e966f0 100644 --- a/asm/mail.s +++ b/asm/mail.s @@ -883,7 +883,7 @@ _08121BCC: thumb_func_start sub_8121C50 sub_8121C50: @ 8121C50 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/main_menu.s b/asm/main_menu.s index 6afdd2917..64b602fa8 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -21,7 +21,7 @@ CB2_MainMenu: @ 802F6B0 @ void VBlankCB_MainMenu() VBlankCB_MainMenu: @ 802F6C8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/menu_helpers.s b/asm/menu_helpers.s index b1a88dff3..a0b6f88d8 100644 --- a/asm/menu_helpers.s +++ b/asm/menu_helpers.s @@ -839,7 +839,7 @@ _081223C0: adds r0, r1 lsls r0, 2 adds r0, r7 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources b _081223EC .pool _081223DC: diff --git a/asm/mon_markings.s b/asm/mon_markings.s index 91b5c122b..391cf3ea6 100644 --- a/asm/mon_markings.s +++ b/asm/mon_markings.s @@ -257,13 +257,13 @@ _0811FAFE: adds r0, r5, r0 lsls r0, 16 lsrs r0, 16 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, [r4] ldrh r0, [r0, 0x2] adds r0, r5, r0 lsls r0, 16 lsrs r0, 16 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 diff --git a/asm/money.s b/asm/money.s index 586126721..3628fcc20 100644 --- a/asm/money.s +++ b/asm/money.s @@ -393,7 +393,7 @@ RemoveMoneyLabelObject: @ 80E53F4 lsls r0, 2 ldr r1, =gSprites adds r0, r1 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources pop {r0} bx r0 .pool diff --git a/asm/mystery_event_menu.s b/asm/mystery_event_menu.s index 5e64918ed..95927e8b3 100644 --- a/asm/mystery_event_menu.s +++ b/asm/mystery_event_menu.s @@ -8,7 +8,7 @@ thumb_func_start sub_8178944 sub_8178944: @ 8178944 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/naming_screen.s b/asm/naming_screen.s index da6bcc04a..185fb4cff 100644 --- a/asm/naming_screen.s +++ b/asm/naming_screen.s @@ -4090,7 +4090,7 @@ sub_80E4F84: @ 80E4F84 thumb_func_start sub_80E4F94 sub_80E4F94: @ 80E4F94 push {r4,r5,lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer ldr r5, =gUnknown_02039F94 diff --git a/asm/option_menu.s b/asm/option_menu.s index 78b4028fa..cc6acc5ac 100644 --- a/asm/option_menu.s +++ b/asm/option_menu.s @@ -19,7 +19,7 @@ sub_80BA4B0: @ 80BA4B0 thumb_func_start sub_80BA4C8 sub_80BA4C8: @ 80BA4C8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/player_pc.s b/asm/player_pc.s index abfde689e..57340cbfc 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -2173,9 +2173,9 @@ sub_816C060: @ 816C060 bne _0816C0B2 ldr r4, =0x000013f6 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 adds r1, r4, 0 adds r2, r6, 0 @@ -2218,9 +2218,9 @@ sub_816C0C8: @ 816C0C8 beq _0816C0FA ldr r4, =0x000013f6 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 diff --git a/asm/pokeblock_feed.s b/asm/pokeblock_feed.s index 2f0abf868..0d5994e5e 100644 --- a/asm/pokeblock_feed.s +++ b/asm/pokeblock_feed.s @@ -20,7 +20,7 @@ sub_8179B68: @ 8179B68 thumb_func_start sub_8179B84 sub_8179B84: @ 8179B84 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -1044,7 +1044,7 @@ sub_817A4F8: @ 817A4F8 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r4, 0x1] movs r1, 0x3 orrs r0, r1 @@ -1406,7 +1406,7 @@ _0817A8E0: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r2, =0x00001050 adds r1, r4, r2 movs r0, 0x46 @@ -1569,7 +1569,7 @@ sub_817AA3C: @ 817AA3C ldr r0, =gUnknown_0203BD18 ldr r0, [r0] ldr r0, [r0] - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix movs r0, 0 pop {r1} bx r1 diff --git a/asm/pokedex.s b/asm/pokedex.s index 8ce994a73..7331b4940 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -79,7 +79,7 @@ sub_80BB358: @ 80BB358 thumb_func_start sub_80BB370 sub_80BB370: @ 80BB370 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/pokedex_area_screen.s b/asm/pokedex_area_screen.s index cb6c2dc6b..27a15e153 100644 --- a/asm/pokedex_area_screen.s +++ b/asm/pokedex_area_screen.s @@ -1708,9 +1708,9 @@ _0813D7D8: sub_813D824: @ 813D824 push {r4,r5,lr} movs r0, 0x2 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x2 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r4, 0 ldr r1, =gUnknown_0203AB7C ldr r0, [r1] @@ -1742,9 +1742,9 @@ _0813D846: bcc _0813D846 _0813D86C: movs r0, 0x3 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x3 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r4, 0 _0813D87A: ldr r0, =gUnknown_0203AB7C diff --git a/asm/pokedex_cry_screen.s b/asm/pokedex_cry_screen.s index 50c438e59..38a1183d7 100644 --- a/asm/pokedex_cry_screen.s +++ b/asm/pokedex_cry_screen.s @@ -734,7 +734,7 @@ sub_8145914: @ 8145914 bl GetObjectPaletteTagBySlot lsls r0, 16 lsrs r0, 16 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, [r6] ldrh r1, [r0, 0x4] lsls r0, r1, 4 diff --git a/asm/region_map.s b/asm/region_map.s index e18529cd5..36c8636e8 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -430,11 +430,11 @@ sub_812305C: @ 812305C ldr r0, [r4] adds r0, 0x58 ldrh r0, [r0] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, [r4] adds r0, 0x5A ldrh r0, [r0] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _08123080: ldr r0, [r4] ldr r0, [r0, 0x20] @@ -444,11 +444,11 @@ _08123080: ldr r0, [r4] adds r0, 0x70 ldrh r0, [r0] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, [r4] adds r0, 0x72 ldrh r0, [r0] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _081230A0: pop {r4} pop {r0} @@ -2742,11 +2742,11 @@ sub_8124238: @ 8124238 ldr r0, [r4] adds r0, 0x58 ldrh r0, [r0] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, [r4] adds r0, 0x5A ldrh r0, [r0] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _0812425C: pop {r4} pop {r0} @@ -3516,7 +3516,7 @@ _081248AA: thumb_func_start sub_81248C0 sub_81248C0: @ 81248C0 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/reset_rtc_screen.s b/asm/reset_rtc_screen.s index 0cacd5bbd..38a7e04e6 100644 --- a/asm/reset_rtc_screen.s +++ b/asm/reset_rtc_screen.s @@ -343,7 +343,7 @@ sub_809EB8C: @ 809EB8C push {lr} ldr r0, =gUnknown_085104C4 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 .pool @@ -886,7 +886,7 @@ _0809EFCA: movs r0, 0 movs r1, 0x80 bl ResetOamRange - bl LoadOamFromSprites + bl LoadOam bl remove_some_task bl dp12_8087EA4 bl ResetSpriteData @@ -950,7 +950,7 @@ sub_809F090: @ 809F090 sub_809F0AC: @ 809F0AC push {lr} bl ProcessSpriteCopyRequests - bl LoadOamFromSprites + bl LoadOam bl TransferPlttBuffer pop {r0} bx r0 diff --git a/asm/rom4.s b/asm/rom4.s index 3b6d39cbb..649b0fb1e 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -3635,7 +3635,7 @@ SetFieldVBlankCallback: @ 8086380 thumb_func_start VBlankCB_Field VBlankCB_Field: @ 8086390 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl sub_80BA0A8 bl FieldUpdateBgTilemapScroll @@ -4169,7 +4169,7 @@ _08086816: movs r0, 0 movs r1, 0x80 bl ResetOamRange - bl LoadOamFromSprites + bl LoadOam add sp, 0x4 pop {r4-r7} pop {r0} diff --git a/asm/rom6.s b/asm/rom6.s index 57e0d3c71..e3087706d 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -581,7 +581,7 @@ sub_813591C: @ 813591C thumb_func_start sub_8135938 sub_8135938: @ 8135938 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -1920,7 +1920,7 @@ _081364B4: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r0, =SpriteCallbackDummy str r0, [r4, 0x1C] _081364E0: @@ -3428,7 +3428,7 @@ sub_81371D4: @ 81371D4 thumb_func_start sub_81371EC sub_81371EC: @ 81371EC push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -10378,9 +10378,9 @@ _0813AB18: _0813AB2C: ldr r4, =0x0000157c adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag lsls r0, r5, 24 lsrs r0, 24 str r4, [sp] @@ -10455,9 +10455,9 @@ sub_813ABD4: @ 813ABD4 lsrs r5, 16 ldr r4, =0x0000157c adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 adds r1, r4, 0 adds r2, r5, 0 @@ -10519,7 +10519,7 @@ sub_813AC44: @ 813AC44 lsls r0, 2 ldr r1, =gSprites adds r0, r1 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources _0813AC6A: ldr r1, =gUnknown_0203AB6C movs r0, 0x40 diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s index e7c308ca9..001dc0a5a 100644 --- a/asm/rom_8034C54.s +++ b/asm/rom_8034C54.s @@ -1015,7 +1015,7 @@ _08035426: lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x10] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _08035442: adds r0, r4, 0 bl sub_80355B4 @@ -1028,7 +1028,7 @@ _08035442: lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x12] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _0803545E: ldr r0, =gUnknown_02022E10 ldr r0, [r0] @@ -7021,7 +7021,7 @@ _08038A3A: ldrh r1, [r0] movs r0, 0x46 bl SetGpuReg - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80BA0A8 @@ -7079,11 +7079,11 @@ _08038B36: beq _08038B6A ldr r4, =0x00002710 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r5, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r5, 0 bl DestroySprite _08038B6A: @@ -8755,7 +8755,7 @@ sub_8039A48: @ 8039A48 cmp r0, 0 bge _08039A7C adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite b _08039AC8 diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s index 3b6b729ba..94ca15b58 100644 --- a/asm/rom_8072304.s +++ b/asm/rom_8072304.s @@ -3350,14 +3350,14 @@ _08073E96: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources mov r0, sp ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources b _08073F32 .pool _08073EFC: @@ -3367,7 +3367,7 @@ _08073EFC: ldr r5, =gSprites adds r4, r5 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite mov r0, sp @@ -3376,7 +3376,7 @@ _08073EFC: adds r0, r1 lsls r0, 2 adds r0, r5 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix mov r0, sp ldrb r1, [r0] lsls r0, r1, 4 @@ -3488,14 +3488,14 @@ _08073FE6: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources mov r0, sp ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources movs r5, 0x1 _08074016: mov r1, sp @@ -5887,10 +5887,10 @@ sub_8075370: @ 8075370 bne _080753A8 ldr r0, =gUnknown_0831C620 ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0831C628 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0 @@ -7453,7 +7453,7 @@ _0807605C: ands r0, r2 strb r0, [r1] adds r0, r5, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r5, 0 bl DestroySprite movs r3, 0 @@ -7531,7 +7531,7 @@ _08076130: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r4 @@ -7542,7 +7542,7 @@ _08076130: adds r0, r5 bl DestroySprite adds r0, r6, 0 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources ldr r0, =gMain ldr r1, =0x00000439 adds r0, r1 @@ -8245,7 +8245,7 @@ _080766FC: bl sub_806ED40 _08076708: adds r0, r4, 0 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources _0807670E: pop {r3,r4} mov r8, r3 @@ -8501,7 +8501,7 @@ _08076904: thumb_func_start obj_delete_and_free_associated_resources_ obj_delete_and_free_associated_resources_: @ 807690C push {lr} - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources pop {r0} bx r0 thumb_func_end obj_delete_and_free_associated_resources_ @@ -8740,11 +8740,11 @@ sub_8076AE8: @ 8076AE8 lsrs r4, 21 adds r0, r4, r0 ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0832C460 adds r4, r0 ldrh r0, [r4, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r4} pop {r0} bx r0 diff --git a/asm/rom_80A5C6C.s b/asm/rom_80A5C6C.s index c7858e764..fe7ae90e2 100644 --- a/asm/rom_80A5C6C.s +++ b/asm/rom_80A5C6C.s @@ -1419,7 +1419,7 @@ _080A6744: move_anim_8074EE0: @ 80A674C push {r4,lr} adds r4, r0, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl move_anim_8072740 pop {r4} @@ -5395,7 +5395,7 @@ _080A85EE: thumb_func_start sub_80A8610 sub_80A8610: @ 80A8610 push {lr} - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources pop {r0} bx r0 thumb_func_end sub_80A8610 @@ -6281,7 +6281,7 @@ _080A8D58: cmp r0, 0 bne _080A8D6C ldr r0, =0x00002771 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r5, 0 bl move_anim_task_del _080A8D6C: diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index 19580a2f0..99f64dae8 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -1141,21 +1141,21 @@ sub_80C7890: @ 80C7890 adds r2, 0x6 adds r0, r1, r2 ldrh r0, [r0] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _080C78AC: ldr r0, [r5] movs r4, 0x90 lsls r4, 2 adds r0, r4 ldrh r0, [r0] - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, [r5] adds r0, r4 ldrh r0, [r0] adds r0, 0x1 lsls r0, 16 lsrs r0, 16 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag pop {r4,r5} pop {r0} bx r0 @@ -1700,7 +1700,7 @@ _080C7D24: thumb_func_start sub_80C7D28 sub_80C7D28: @ 80C7D28 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl sub_80D2AA4 bl TransferPlttBuffer @@ -6002,9 +6002,9 @@ _080CA420: cmp r0, 0 bne _080CA43C movs r0, 0x2 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =0x0000dac6 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _080CA43C: add sp, 0x28 pop {r4-r7} @@ -9407,7 +9407,7 @@ sub_80CC020: @ 80CC020 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r0, [r4] ldr r1, =0x00000b04 adds r0, r1 @@ -11136,12 +11136,12 @@ sub_80CCEE0: @ 80CCEE0 cmp r0, 0 bne _080CCF00 movs r0, 0x4 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag b _080CCF06 .pool _080CCF00: movs r0, 0x3 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _080CCF06: ldr r0, =gUnknown_02039D08 ldr r0, [r0] @@ -23060,7 +23060,7 @@ _080D2FA2: lsls r0, r4, 3 adds r0, r5 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -23091,7 +23091,7 @@ _080D2FD2: lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 .pool @@ -23109,7 +23109,7 @@ sub_80D2FF0: @ 80D2FF0 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 .pool @@ -23296,7 +23296,7 @@ _080D312A: lsrs r1, 17 ldr r3, =0x06010000 adds r1, r3 - bl AddTilesToObjectCopyRequests + bl RequestSpriteCopy mov r0, r8 ldrb r1, [r0] ldr r0, [r4, 0x8] @@ -26701,16 +26701,16 @@ RemoveBagObject: @ 80D4CA8 beq _080D4CEE adds r4, 0x64 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 @@ -27022,9 +27022,9 @@ AddBagItemIconObject: @ 80D4F38 bne _080D4F86 adds r4, 0x66 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 adds r1, r4, 0 adds r2, r6, 0 @@ -27240,7 +27240,7 @@ sub_80D50D4: @ 80D50D4 sub_80D510C: @ 80D510C push {lr} ldr r0, =0x00007544 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 .pool @@ -27266,7 +27266,7 @@ sub_80D511C: @ 80D511C lsrs r0, 24 mov r8, r0 ldr r0, =0x00007544 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 bl sub_80D5070 ldr r0, =gUnknown_0857FC7C diff --git a/asm/rom_813C5BC.s b/asm/rom_813C5BC.s index 7abb66627..38098f04d 100644 --- a/asm/rom_813C5BC.s +++ b/asm/rom_813C5BC.s @@ -372,7 +372,7 @@ sub_813C890: @ 813C890 thumb_func_start sub_813C8D8 sub_813C8D8: @ 813C8D8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/rom_8158B30.s b/asm/rom_8158B30.s index aa9b8c9ec..b984efbb9 100644 --- a/asm/rom_8158B30.s +++ b/asm/rom_8158B30.s @@ -11204,7 +11204,7 @@ _0815E658: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 @@ -15099,7 +15099,7 @@ _08160618: thumb_func_start sub_8160624 sub_8160624: @ 8160624 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -25928,7 +25928,7 @@ sub_816631C: @ 816631C thumb_func_start sub_8166340 sub_8166340: @ 8166340 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer ldr r0, =gUnknown_0203BCAC @@ -26910,13 +26910,13 @@ _08166C70: cmp r4, 0x6 bls _08166C70 movs r0, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x1 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x1 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r4, 0 _08166CAE: ldr r0, [r5] @@ -28106,9 +28106,9 @@ sub_8167608: @ 8167608 cmp r1, 0x40 bne _081676AC movs r0, 0x64 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x64 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, [r7] add r0, r8 movs r1, 0xFF @@ -30181,9 +30181,9 @@ _08168842: strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, =c3_0802FDF4 movs r1, 0xA bl CreateTask @@ -30343,7 +30343,7 @@ sub_8168A20: @ 8168A20 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -32562,7 +32562,7 @@ _08169E80: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] diff --git a/asm/rom_8184DA4.s b/asm/rom_8184DA4.s index 0e2ce0c7a..727450668 100644 --- a/asm/rom_8184DA4.s +++ b/asm/rom_8184DA4.s @@ -2878,7 +2878,7 @@ sub_81865C8: @ 81865C8 adds r0, r1 lsls r0, 2 adds r0, r5 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] @@ -3125,9 +3125,9 @@ _0818676A: strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _08186816: ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -3668,9 +3668,9 @@ _08186CC0: strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag bl sub_81871AC _08186CFA: pop {r4-r7} @@ -3772,7 +3772,7 @@ sub_8186D9C: @ 8186D9C lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -4018,9 +4018,9 @@ sub_8186F94: @ 8186F94 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] @@ -6654,7 +6654,7 @@ _081887B0: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -8344,7 +8344,7 @@ sub_818962C: @ 818962C ldrh r0, [r4, 0x6] bl sub_805DFE4 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite pop {r4} @@ -8813,7 +8813,7 @@ sub_81899F0: @ 81899F0 adds r0, r1 lsls r0, 2 adds r0, r6 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -9025,9 +9025,9 @@ _08189B86: strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r7, =gBattlePartyID ldrb r1, [r5] lsls r0, r1, 1 @@ -9651,7 +9651,7 @@ sub_818A114: @ 818A114 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -9698,7 +9698,7 @@ sub_818A1B0: @ 818A1B0 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -9917,9 +9917,9 @@ sub_818A37C: @ 818A37C strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, =c3_0802FDF4 movs r1, 0xA bl CreateTask @@ -12578,7 +12578,7 @@ _0818BC30: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -15635,7 +15635,7 @@ _0818D5F0: bl GetObjectPaletteTagBySlot lsls r0, 16 lsrs r0, 16 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _0818D624: adds r0, r6, r4 lsls r0, 2 @@ -29411,7 +29411,7 @@ sub_8194B70: @ 8194B70 ldrh r1, [r0] movs r0, 0x1A bl SetGpuReg - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -29539,7 +29539,7 @@ sub_8194CE4: @ 8194CE4 movs r1, 0x80 movs r2, 0x1 bl ChangeBgY - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80BA0A8 @@ -40722,7 +40722,7 @@ sub_819A4C8: @ 819A4C8 thumb_func_start sub_819A4E4 sub_819A4E4: @ 819A4E4 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -43997,7 +43997,7 @@ sub_819C100: @ 819C100 ldrb r0, [r5, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r0, [r4] adds r0, r7 ldrb r1, [r0] @@ -44008,7 +44008,7 @@ sub_819C100: @ 819C100 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r0, [r4] ldr r1, =0x0000029d adds r0, r1 @@ -44020,7 +44020,7 @@ sub_819C100: @ 819C100 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r0, [r4] movs r1, 0xA8 lsls r1, 2 @@ -44795,7 +44795,7 @@ sub_819C7E0: @ 819C7E0 thumb_func_start sub_819C7FC sub_819C7FC: @ 819C7FC push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -50052,7 +50052,7 @@ sub_819F444: @ 819F444 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix lsrs r4, 24 lsls r0, r4, 4 adds r0, r4 @@ -50283,7 +50283,7 @@ sub_819F654: @ 819F654 ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0x1 @@ -61464,7 +61464,7 @@ _081A5520: bl SetGpuReg movs r0, 0xFA lsls r0, 2 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _081A553C: movs r6, 0x1 _081A553E: @@ -72294,7 +72294,7 @@ c2_bag_3: @ 81AAD5C thumb_func_start vblank_cb_bag_menu vblank_cb_bag_menu: @ 81AAD78 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -80843,12 +80843,12 @@ RemoveScrollIndicatorArrowPair: @ 81AF620 ldr r4, =0x0000ffff cmp r0, r4 beq _081AF63E - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _081AF63E: ldrh r0, [r5, 0x10] cmp r0, r4 beq _081AF648 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _081AF648: ldrb r1, [r5, 0xC] lsls r0, r1, 4 @@ -81179,7 +81179,7 @@ _081AF896: ldrh r1, [r6, 0x4] bl ListMenuSetUpRedOutlineCursorSpriteOamTable mov r1, sp - ldr r0, =gUnknown_082EC6AC + ldr r0, =gDummySpriteTemplate ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} @@ -81314,12 +81314,12 @@ ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 ldr r6, =0x0000ffff cmp r0, r6 beq _081AF9FC - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _081AF9FC: ldrh r0, [r4, 0x10] cmp r0, r6 beq _081AFA06 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _081AFA06: ldrb r1, [r4, 0xC] lsls r0, r1, 4 @@ -81526,12 +81526,12 @@ ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 ldr r6, =0x0000ffff cmp r0, r6 beq _081AFBBE - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _081AFBBE: ldrh r0, [r4, 0x4] cmp r0, r6 beq _081AFBC8 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _081AFBC8: ldrb r1, [r4] lsls r0, r1, 4 @@ -82311,7 +82311,7 @@ sub_81B01B0: @ 81B01B0 thumb_func_start sub_81B01CC sub_81B01CC: @ 81B01CC push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/rom_81BAD84.s b/asm/rom_81BAD84.s index c5df9bced..e555feb71 100644 --- a/asm/rom_81BAD84.s +++ b/asm/rom_81BAD84.s @@ -159,7 +159,7 @@ sub_81BAE98: @ 81BAE98 adds r0, r1 lsls r0, 2 adds r0, r6 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -1196,7 +1196,7 @@ sub_81BB78C: @ 81BB78C ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -1243,7 +1243,7 @@ sub_81BB828: @ 81BB828 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -1462,9 +1462,9 @@ sub_81BB9F4: @ 81BB9F4 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, =c3_0802FDF4 movs r1, 0xA bl CreateTask @@ -4123,7 +4123,7 @@ _081BD2A8: lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -6841,7 +6841,7 @@ sub_81BEA00: @ 81BEA00 lsrs r4, 24 movs r0, 0xFA lsls r0, 4 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 bl DestroyTask bl script_env_2_enable_and_set_ctx_running @@ -8770,7 +8770,7 @@ sub_81BFAB4: @ 81BFAB4 thumb_func_start sub_81BFAD0 sub_81BFAD0: @ 81BFAD0 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -10138,7 +10138,7 @@ _081C0786: lsls r0, 2 ldr r1, =gSprites adds r0, r1 - bl ResetSpriteAndFreeResources + bl DestroySpriteAndFreeResources b _081C08EC .pool _081C07A8: @@ -17532,7 +17532,7 @@ sub_81C47B4: @ 81C47B4 ldr r5, =gSprites adds r7, r4, r5 adds r0, r7, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrh r0, [r6, 0x2] movs r1, 0 strh r0, [r7, 0x2E] @@ -17782,7 +17782,7 @@ sub_81C49E0: @ 81C49E0 ldr r0, [r0, 0x8] bl DestroySprite ldr r0, =0x00007533 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 bl sub_81C4984 pop {r4} @@ -18539,7 +18539,7 @@ sub_81C501C: @ 81C501C thumb_func_start sub_81C5038 sub_81C5038: @ 81C5038 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -21972,16 +21972,16 @@ sub_81C6E38: @ 81C6E38 ldr r0, =0x00001024 adds r4, r0 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =gSprites adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 @@ -22124,9 +22124,9 @@ sub_81C6F90: @ 81C6F90 ldr r0, =0x00001025 adds r4, r0 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r0, r4, 0 adds r1, r4, 0 adds r2, r6, 0 @@ -22663,7 +22663,7 @@ sub_81C7400: @ 81C7400 sub_81C7418: @ 81C7418 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests pop {r0} bx r0 @@ -23780,9 +23780,9 @@ sub_81C7C94: @ 81C7C94 ldr r0, [r0, 0x18] bl DestroySprite movs r0, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 thumb_func_end sub_81C7C94 @@ -26263,9 +26263,9 @@ sub_81C8FE0: @ 81C8FE0 ldr r0, [r4, 0x44] bl DestroySprite movs r0, 0xA - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x14 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r4} pop {r0} bx r0 @@ -28314,21 +28314,21 @@ _081C9FCA: sub_81C9FEC: @ 81C9FEC push {lr} movs r0, 0x3 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x1 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x4 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x5 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x6 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x7 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x8 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x3 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag bl sub_81CA094 bl sub_81CA698 pop {r0} @@ -28402,7 +28402,7 @@ _081CA0A2: movs r5, 0x3 _081CA0AA: ldr r0, [r4] - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldm r4!, {r0} bl DestroySprite subs r5, 0x1 @@ -29023,7 +29023,7 @@ _081CA526: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldrb r1, [r4, 0x1] lsrs r1, 6 ldrb r2, [r4, 0x3] @@ -29510,7 +29510,7 @@ _081CA908: sub_81CA914: @ 81CA914 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl sub_80BA0A8 pop {r0} @@ -32820,13 +32820,13 @@ _081CC2C8: bl DestroySprite _081CC2D2: movs r0, 0x8 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x7 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0xC - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0xD - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r4} pop {r0} bx r0 @@ -33328,7 +33328,7 @@ sub_81CC670: @ 81CC670 sub_81CC6A4: @ 81CC6A4 push {lr} bl TransferPlttBuffer - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl sub_81237B4 pop {r0} @@ -33741,9 +33741,9 @@ sub_81CC9EC: @ 81CC9EC bl sub_81C763C adds r4, r0, 0 movs r0, 0x6 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0xB - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag adds r5, r4, 0 adds r5, 0xC movs r4, 0x2 @@ -37845,13 +37845,13 @@ sub_81CEBF4: @ 81CEBF4 ldr r0, [r0] bl DestroySprite movs r0, 0x6A - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x69 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x6A - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x69 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag b _081CEC68 .pool _081CEC28: @@ -37873,15 +37873,15 @@ _081CEC2A: cmp r4, 0x6 bls _081CEC2A movs r0, 0x65 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x66 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x67 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x65 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x66 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _081CEC68: ldr r0, =0x00001816 adds r1, r5, r0 @@ -37896,9 +37896,9 @@ _081CEC68: adds r0, r1 bl DestroySprite movs r0, 0x64 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x64 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag _081CEC8E: pop {r4,r5} pop {r0} @@ -38019,9 +38019,9 @@ sub_81CED30: @ 81CED30 cmp r0, 0x40 bne _081CEDBC movs r0, 0x64 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x64 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0xFF strb r0, [r7] b _081CEE26 @@ -38086,7 +38086,7 @@ sub_81CEE44: @ 81CEE44 push {r4,lr} bl sub_81CDC70 adds r4, r0, 0 - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer adds r0, r4, 0 @@ -41756,19 +41756,19 @@ sub_81D09F4: @ 81D09F4 adds r0, r4, 0 bl sub_81D1178 movs r0, 0x9 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0xF - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x10 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x11 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x12 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x13 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldr r0, [r4, 0x14] - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldr r0, [r4, 0x14] bl DestroySprite movs r0, 0xE @@ -47440,9 +47440,9 @@ sub_81D354C: @ 81D354C push {lr} bl sub_81D3520 movs r0, 0x68 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0x68 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag pop {r0} bx r0 thumb_func_end sub_81D354C @@ -53577,7 +53577,7 @@ sub_81D67D0: @ 81D67D0 thumb_func_start sub_81D67EC sub_81D67EC: @ 81D67EC push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -61497,9 +61497,9 @@ sub_81DAA20: @ 81DAA20 adds r5, r0, 0 ldr r4, =0x00002e90 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag movs r0, 0x10 ldrsh r1, [r5, r0] lsls r0, r1, 4 diff --git a/asm/rotating_gate.s b/asm/rotating_gate.s index ab8c9a457..271898d68 100644 --- a/asm/rotating_gate.s +++ b/asm/rotating_gate.s @@ -628,7 +628,7 @@ _080FBC94: ldr r0, =gSprites adds r4, r0 adds r0, r4, 0 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix adds r0, r4, 0 bl DestroySprite movs r0, 0x40 diff --git a/asm/roulette.s b/asm/roulette.s index 900c8bb1a..d1c6a99a8 100644 --- a/asm/roulette.s +++ b/asm/roulette.s @@ -30,7 +30,7 @@ _0814025A: sub_8140264: @ 8140264 push {r4,lr} sub sp, 0x4 - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_8142814 @@ -4874,11 +4874,11 @@ sub_8142C0C: @ 8142C0C .pool _08142C44: movs r0, 0xE - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0xD - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0xC - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag bl ResetObjectPaletteAllocator _08142C5A: pop {r0} @@ -9237,7 +9237,7 @@ _08144FC8: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix ldr r0, [r4] adds r0, 0x74 ldrb r1, [r0] diff --git a/asm/save_failed_screen.s b/asm/save_failed_screen.s index 2c23435d4..963db4988 100644 --- a/asm/save_failed_screen.s +++ b/asm/save_failed_screen.s @@ -71,7 +71,7 @@ fullscreen_save_activate: @ 8178F90 thumb_func_start sub_8178FC8 sub_8178FC8: @ 8178FC8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index 5f5765064..1beaae365 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -902,7 +902,7 @@ _080F8F42: bl GetObjectPaletteTagBySlot lsls r0, 16 lsrs r0, 16 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r0, [r4, 0x1] lsls r0, 30 cmp r0, 0 @@ -910,7 +910,7 @@ _080F8F42: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix _080F8F72: adds r0, r4, 0 bl DestroySprite diff --git a/asm/shop.s b/asm/shop.s index 5d6c9aa01..8e45ec598 100644 --- a/asm/shop.s +++ b/asm/shop.s @@ -378,7 +378,7 @@ CB2_BuyMenu: @ 80DFD64 @ void VBlankCB_BuyMenu() VBlankCB_BuyMenu: @ 80DFD80 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -1027,9 +1027,9 @@ BuyMenuRemoveItemIcon: @ 80E031C ldr r0, =0x0000083e adds r4, r0 adds r0, r4, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag adds r0, r4, 0 - bl FreeObjectPaletteByTag + bl FreeSpritePaletteByTag ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 diff --git a/asm/slot_machine.s b/asm/slot_machine.s index e05d5d9d7..9cb6f8efc 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -201,7 +201,7 @@ sub_812A670: @ 812A670 thumb_func_start sub_812A688 sub_812A688: @ 812A688 push {r4,lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer ldr r4, =gUnknown_0203AB34 @@ -9361,7 +9361,7 @@ sub_812EECC: @ 812EECC ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite pop {r4} @@ -9440,7 +9440,7 @@ sub_812EF6C: @ 812EF6C ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite pop {r4} diff --git a/asm/sprite.s b/asm/sprite.s index 278c0ed17..6e7585960 100644 --- a/asm/sprite.s +++ b/asm/sprite.s @@ -5,1956 +5,10 @@ .text - thumb_func_start AddSpritesToOamBuffer -@ void AddSpritesToOamBuffer() -AddSpritesToOamBuffer: @ 8006D68 - push {r4-r6,lr} - sub sp, 0x4 - movs r4, 0 - mov r0, sp - strb r4, [r0] -_08006D72: - ldr r0, =gSpriteOrder - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r2, r0, r1 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x5 - ands r0, r1 - cmp r0, 0x1 - bne _08006D9E - adds r0, r2, 0 - mov r1, sp - bl AddSprite - lsls r0, 24 - cmp r0, 0 - bne _08006DD8 -_08006D9E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3F - bls _08006D72 - mov r0, sp - ldr r4, =gOamLimit - ldrb r0, [r0] - ldrb r1, [r4] - cmp r0, r1 - bcs _08006DD8 - mov r1, sp - ldr r5, =gUnknown_030022F8 - ldr r0, =gDefaultOamAttributes - ldr r2, [r0] - ldr r3, [r0, 0x4] -_08006DBE: - ldrb r0, [r1] - lsls r0, 3 - adds r0, r5 - str r2, [r0] - str r3, [r0, 0x4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r6, [r4] - cmp r0, r6 - bcc _08006DBE -_08006DD8: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end AddSpritesToOamBuffer - thumb_func_start CreateSprite -@ u8 CreateSprite(struct objtemplate *template, u16 x, u16 y, u8 subpriority) -CreateSprite: @ 8006DF4 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r3, 24 - lsrs r4, r3, 24 - movs r3, 0 - ldr r0, =gSprites - mov r12, r0 - lsls r5, r1, 16 - lsls r6, r2, 16 -_08006E08: - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - add r0, r12 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _08006E34 - str r4, [sp] - adds r0, r3, 0 - adds r1, r7, 0 - asrs r2, r5, 16 - asrs r3, r6, 16 - bl CreateSpriteAt - lsls r0, 24 - lsrs r0, 24 - b _08006E40 - .pool -_08006E34: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3F - bls _08006E08 - movs r0, 0x40 -_08006E40: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CreateSprite - - thumb_func_start CreateSpriteAtEnd -@ u8 CreateSpriteAtEnd(struct objtemplate *template, u16 x, u16 y, u8 subpriority) -CreateSpriteAtEnd: @ 8006E48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - lsls r3, 24 - lsrs r6, r3, 24 - movs r3, 0x3F - ldr r0, =gSprites - mov r8, r0 - movs r0, 0x1 - negs r0, r0 - mov r12, r0 - lsls r4, r1, 16 - lsls r5, r2, 16 -_08006E66: - lsls r0, r3, 16 - asrs r1, r0, 16 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _08006E98 - lsls r0, r3, 24 - lsrs r0, 24 - str r6, [sp] - adds r1, r7, 0 - asrs r2, r4, 16 - asrs r3, r5, 16 - bl CreateSpriteAt - lsls r0, 24 - lsrs r0, 24 - b _08006EA6 - .pool -_08006E98: - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - asrs r0, 16 - cmp r0, r12 - bgt _08006E66 - movs r0, 0x40 -_08006EA6: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CreateSpriteAtEnd - - thumb_func_start CreateInvisibleSprite -@ int CreateInvisibleSprite(void ( *func)()) -CreateInvisibleSprite: @ 8006EB4 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =gUnknown_082EC6AC - movs r1, 0 - movs r2, 0 - movs r3, 0x1F - bl CreateSprite - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _08006EF4 - ldr r4, =gSprites - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r4 - adds r2, 0x3E - ldrb r0, [r2] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r2] - adds r4, 0x1C - adds r1, r4 - str r6, [r1] - adds r0, r5, 0 - b _08006EF6 - .pool -_08006EF4: - movs r0, 0x40 -_08006EF6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CreateInvisibleSprite - - thumb_func_start CreateSpriteAt -@ u8 CreateSpriteAt(u8 index, struct objtemplate *template, u16 x, u16 y, u8 subpriority) -CreateSpriteAt: @ 8006EFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r1 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 4 - add r0, r10 - lsls r0, 2 - ldr r1, =gSprites - adds r7, r0, r1 - adds r0, r7, 0 - bl ResetSprite - adds r2, r7, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x3F - adds r0, r7 - mov r9, r0 - ldrb r0, [r0] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x8 - orrs r0, r1 - movs r1, 0x40 - orrs r0, r1 - mov r1, r9 - strb r0, [r1] - adds r0, r7, 0 - adds r0, 0x43 - strb r4, [r0] - mov r1, r8 - ldr r0, [r1, 0x4] - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r7] - str r1, [r7, 0x4] - mov r1, r8 - ldr r0, [r1, 0x8] - str r0, [r7, 0x8] - ldr r0, [r1, 0x10] - str r0, [r7, 0x10] - str r1, [r7, 0x14] - ldr r0, [r1, 0x14] - str r0, [r7, 0x1C] - strh r5, [r7, 0x20] - strh r6, [r7, 0x22] - ldrb r3, [r7, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r7, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r7, 0 - bl CalcCenterToCornerVec - mov r0, r8 - ldrh r1, [r0] - ldr r4, =0xffff0000 - lsrs r0, r4, 16 - cmp r1, r0 - bne _08006FF8 - mov r1, r8 - ldr r0, [r1, 0xC] - str r0, [r7, 0xC] - ldrh r0, [r0, 0x4] - lsrs r0, 5 - lsls r0, 24 - lsrs r0, 24 - bl AllocSpriteTiles - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - asrs r1, r4, 16 - cmp r0, r1 - bne _08006FC8 - adds r0, r7, 0 - bl ResetSprite - movs r0, 0x40 - b _08007040 - .pool -_08006FC8: - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r2, r0 - ldrh r1, [r7, 0x4] - ldr r0, =0xfffffc00 - ands r0, r1 - orrs r0, r2 - strh r0, [r7, 0x4] - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - mov r1, r9 - strb r0, [r1] - adds r1, r7, 0 - adds r1, 0x40 - movs r0, 0 - strh r0, [r1] - b _0800700C - .pool -_08006FF8: - mov r1, r8 - ldrh r0, [r1] - bl GetSpriteTileStartByTag - adds r1, r7, 0 - adds r1, 0x40 - strh r0, [r1] - adds r0, r7, 0 - bl SetSpriteSheetFrameTileNum -_0800700C: - ldrb r0, [r7, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08007020 - adds r0, r7, 0 - bl InitSpriteAffineAnim -_08007020: - mov r0, r8 - ldrh r1, [r0, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0800703E - mov r1, r8 - ldrh r0, [r1, 0x2] - bl IndexOfSpritePaletteTag - lsls r0, 4 - ldrb r2, [r7, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x5] -_0800703E: - mov r0, r10 -_08007040: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CreateSpriteAt - - thumb_func_start CreateSpriteAndAnimate -@ u8 CreateSpriteAndAnimate(struct objtemplate *template, u16 x, u16 y, u8 subpriority) -CreateSpriteAndAnimate: @ 8007054 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r0 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - movs r3, 0 - ldr r5, =gSprites - lsls r1, 16 - mov r12, r1 - lsls r2, 16 - mov r8, r2 -_08007074: - lsls r0, r3, 4 - adds r0, r3 - lsls r6, r0, 2 - adds r4, r6, r5 - adds r7, r4, 0 - adds r7, 0x3E - ldrb r0, [r7] - lsls r0, 31 - cmp r0, 0 - bne _080070CC - mov r0, r9 - str r0, [sp] - adds r0, r3, 0 - mov r1, r10 - mov r3, r12 - asrs r2, r3, 16 - mov r5, r8 - asrs r3, r5, 16 - bl CreateSpriteAt - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - cmp r5, 0x40 - beq _080070D6 - ldr r1, =gSprites + 0x1C - adds r0, r6, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - ldrb r0, [r7] - lsls r0, 31 - cmp r0, 0 - beq _080070C0 - adds r0, r4, 0 - bl AnimateSprite -_080070C0: - adds r0, r5, 0 - b _080070D8 - .pool -_080070CC: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3F - bls _08007074 -_080070D6: - movs r0, 0x40 -_080070D8: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CreateSpriteAndAnimate - - thumb_func_start DestroySprite -@ void DestroySprite(struct obj *object) -DestroySprite: @ 80070E8 - push {r4-r7,lr} - adds r5, r0, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08007144 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0800713E - ldr r0, [r5, 0xC] - ldrh r2, [r0, 0x4] - lsrs r2, 5 - ldrh r0, [r5, 0x4] - lsls r0, 22 - lsrs r1, r0, 22 - adds r4, r1, r2 - adds r3, r1, 0 - cmp r3, r4 - bcs _0800713E - ldr r0, =gSpriteTileAllocBitmap - mov r12, r0 - movs r6, 0x7 - movs r7, 0x1 -_08007122: - lsrs r2, r3, 3 - add r2, r12 - adds r0, r3, 0 - ands r0, r6 - adds r1, r7, 0 - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _08007122 -_0800713E: - adds r0, r5, 0 - bl ResetSprite -_08007144: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DestroySprite - - thumb_func_start ResetOamRange -@ void ResetOamRange(u8 startIndex, u8 endIndex) -ResetOamRange: @ 8007150 - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcs _08007178 - ldr r6, =gUnknown_030022F8 - ldr r5, =gDefaultOamAttributes -_08007162: - lsls r0, r3, 3 - adds r0, r6 - ldr r1, [r5] - ldr r2, [r5, 0x4] - str r1, [r0] - str r2, [r0, 0x4] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcc _08007162 -_08007178: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ResetOamRange - - thumb_func_start LoadOamFromSprites -@ void LoadOamFromSprites() -LoadOamFromSprites: @ 8007188 - push {lr} - ldr r2, =gMain - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080071A8 - adds r0, r2, 0 - adds r0, 0x38 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x04000100 - bl CpuSet -_080071A8: - pop {r0} - bx r0 - .pool - thumb_func_end LoadOamFromSprites - - thumb_func_start ClearSpriteCopyRequests -@ void ClearSpriteCopyRequests() -ClearSpriteCopyRequests: @ 80071B8 - push {r4,r5,lr} - ldr r0, =gShouldProcessSpriteCopyRequests - movs r1, 0 - strb r1, [r0] - ldr r0, =gSpriteCopyRequestCount - strb r1, [r0] - movs r2, 0 - ldr r4, =gSpriteCopyRequests - movs r3, 0 - adds r5, r4, 0x4 -_080071CC: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r4 - str r3, [r1] - adds r0, r5 - str r3, [r0] - strh r3, [r1, 0x8] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3F - bls _080071CC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ClearSpriteCopyRequests - - thumb_func_start ResetOamMatrices -@ void ResetOamMatrices() -ResetOamMatrices: @ 80071F8 - push {r4,lr} - movs r1, 0 - ldr r4, =gOamMatrices - movs r3, 0 - movs r2, 0x80 - lsls r2, 1 -_08007204: - lsls r0, r1, 3 - adds r0, r4 - strh r2, [r0] - strh r3, [r0, 0x2] - strh r3, [r0, 0x4] - strh r2, [r0, 0x6] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _08007204 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ResetOamMatrices - - thumb_func_start SetOamMatrix -@ void SetOamMatrix(u8 index, u16 a, u16 b, u16 c, u16 d) -SetOamMatrix: @ 8007224 - push {r4,r5,lr} - ldr r5, [sp, 0xC] - lsls r0, 24 - ldr r4, =gOamMatrices - lsrs r0, 21 - adds r0, r4 - strh r1, [r0] - strh r2, [r0, 0x2] - strh r3, [r0, 0x4] - strh r5, [r0, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetOamMatrix - - thumb_func_start ResetSprite -@ void ResetSprite(struct obj *object) -ResetSprite: @ 8007244 - push {lr} - ldr r1, =sDummySprite - movs r2, 0x44 - bl memcpy - pop {r0} - bx r0 - .pool - thumb_func_end ResetSprite - - thumb_func_start CalcCenterToCornerVec -@ void CalcCenterToCornerVec(struct obj *object, u8 shape, u8 size, u8 affineMode) -CalcCenterToCornerVec: @ 8007258 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsls r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =gUnknown_082EC634 - lsrs r2, 23 - lsrs r1, 21 - adds r2, r1 - adds r0, r2, r4 - ldrb r5, [r0] - adds r4, 0x1 - adds r2, r4 - ldrb r1, [r2] - movs r0, 0x2 - ands r3, r0 - cmp r3, 0 - beq _08007286 - lsls r0, r5, 25 - lsrs r5, r0, 24 - lsls r0, r1, 25 - lsrs r1, r0, 24 -_08007286: - adds r0, r6, 0 - adds r0, 0x28 - strb r5, [r0] - adds r0, 0x1 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CalcCenterToCornerVec - - thumb_func_start AllocSpriteTiles -@ s16 AllocSpriteTiles(u16 numTiles) -AllocSpriteTiles: @ 800729C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _080072F2 - ldr r0, =gReservedSpriteTileCount - ldrh r3, [r0] - ldr r0, =0x000003ff - cmp r3, r0 - bhi _080072DA - ldr r7, =gSpriteTileAllocBitmap - movs r6, 0x7 - adds r4, r0, 0 - movs r5, 0x1 -_080072BE: - lsrs r2, r3, 3 - adds r2, r7 - adds r0, r3, 0 - ands r0, r6 - adds r1, r5, 0 - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bls _080072BE -_080072DA: - movs r0, 0 - b _080073A4 - .pool -_080072EC: - movs r0, 0x1 - negs r0, r0 - b _080073A4 -_080072F2: - ldr r0, =gReservedSpriteTileCount - ldrh r3, [r0] - ldr r0, =gSpriteTileAllocBitmap - mov r9, r0 - movs r7, 0x7 - movs r6, 0x1 -_080072FE: - lsrs r0, r3, 3 - add r0, r9 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r7 - asrs r1, r0 - ands r1, r6 - cmp r1, 0 - beq _08007332 - movs r5, 0x80 - lsls r5, 3 - ldr r2, =gSpriteTileAllocBitmap -_08007316: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r5 - beq _080072EC - lsrs r0, 19 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r7 - asrs r1, r0 - ands r1, r6 - cmp r1, 0 - bne _08007316 -_08007332: - mov r8, r3 - movs r2, 0x1 - cmp r2, r4 - beq _0800736C - movs r1, 0x80 - lsls r1, 3 - mov r12, r1 - ldr r5, =gSpriteTileAllocBitmap -_08007342: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r12 - beq _080072EC - lsrs r0, 19 - adds r0, r5 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r7 - asrs r1, r0 - ands r1, r6 - cmp r1, 0 - bne _08007368 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r4 - bne _08007342 -_08007368: - cmp r2, r4 - bne _080072FE -_0800736C: - mov r1, r8 - lsls r0, r1, 16 - lsrs r3, r0, 16 - asrs r1, r0, 16 - adds r1, r4, r1 - adds r6, r0, 0 - cmp r3, r1 - bge _080073A2 - ldr r0, =gSpriteTileAllocBitmap - mov r8, r0 - movs r7, 0x7 - adds r4, r1, 0 - movs r5, 0x1 -_08007386: - lsrs r2, r3, 3 - add r2, r8 - adds r1, r3, 0 - ands r1, r7 - adds r0, r5, 0 - lsls r0, r1 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - blt _08007386 -_080073A2: - asrs r0, r6, 16 -_080073A4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AllocSpriteTiles - - thumb_func_start Unused_ObjectTileAllocationBitArrayOp -@ unsigned int Unused_ObjectTileAllocationBitArrayOp(u16 tileNum, u8 op) -Unused_ObjectTileAllocationBitArrayOp: @ 80073B8 - push {r4-r6,lr} - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 24 - lsrs r1, 24 - lsrs r0, 19 - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - movs r0, 0x7 - ands r2, r0 - adds r4, r2, 0 - movs r5, 0 - cmp r1, 0 - bne _080073F0 - movs r0, 0x1 - lsls r0, r2 - mvns r0, r0 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gSpriteTileAllocBitmap - adds r0, r3, r0 - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - b _0800741C - .pool -_080073F0: - cmp r1, 0x1 - bne _0800740C - lsls r1, r2 - lsls r0, r1, 24 - lsrs r2, r0, 24 - ldr r0, =gSpriteTileAllocBitmap - adds r0, r3, r0 - ldrb r1, [r0] - orrs r2, r1 - strb r2, [r0] - b _0800741C - .pool -_0800740C: - movs r0, 0x80 - lsls r0, 17 - lsls r0, r4 - lsrs r5, r0, 24 - ldr r0, =gSpriteTileAllocBitmap - adds r0, r6, r0 - ldrb r0, [r0] - ands r5, r0 -_0800741C: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end Unused_ObjectTileAllocationBitArrayOp - - thumb_func_start SpriteCallbackDummy -@ void SpriteCallbackDummy(struct obj *object) -SpriteCallbackDummy: @ 8007428 - bx lr - thumb_func_end SpriteCallbackDummy - - thumb_func_start ProcessSpriteCopyRequests -@ void ProcessSpriteCopyRequests() -ProcessSpriteCopyRequests: @ 800742C - push {r4-r7,lr} - ldr r0, =gShouldProcessSpriteCopyRequests - ldrb r0, [r0] - cmp r0, 0 - beq _08007474 - movs r4, 0 - ldr r1, =gSpriteCopyRequestCount - ldrb r0, [r1] - cmp r0, 0 - beq _0800746E - ldr r6, =gSpriteCopyRequests - adds r7, r6, 0x4 - adds r5, r1, 0 -_08007446: - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r2, r1, r6 - ldr r0, [r2] - adds r1, r7 - ldr r1, [r1] - ldrh r2, [r2, 0x8] - lsrs r2, 1 - bl CpuSet - ldrb r1, [r5] - subs r1, 0x1 - strb r1, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - cmp r1, 0 - bne _08007446 -_0800746E: - ldr r1, =gShouldProcessSpriteCopyRequests - movs r0, 0 - strb r0, [r1] -_08007474: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ProcessSpriteCopyRequests - - thumb_func_start AddPicToObjectCopyRequests -@ void AddPicToObjectCopyRequests(u16 picIndex, u16 targetTileNum, struct obj_tiles *pics) -AddPicToObjectCopyRequests: @ 8007488 - push {r4-r6,lr} - adds r5, r2, 0 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r4, =gSpriteCopyRequestCount - ldrb r0, [r4] - cmp r0, 0x3F - bhi _080074D8 - ldr r3, =gSpriteCopyRequests - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - lsls r2, 3 - adds r2, r5 - ldr r1, [r2] - str r1, [r0] - ldrb r0, [r4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r0, r3, 0x4 - adds r1, r0 - lsls r0, r6, 5 - ldr r5, =0x06010000 - adds r0, r5 - str r0, [r1] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x8] - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] -_080074D8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end AddPicToObjectCopyRequests - - thumb_func_start AddTilesToObjectCopyRequests -@ void AddTilesToObjectCopyRequests(void *src, void *dest, u16 size) -AddTilesToObjectCopyRequests: @ 80074EC - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 16 - lsrs r6, r2, 16 - ldr r3, =gSpriteCopyRequestCount - ldrb r0, [r3] - cmp r0, 0x3F - bhi _0800752C - ldr r2, =gSpriteCopyRequests - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - str r4, [r0] - ldrb r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0x4 - adds r0, r1 - str r5, [r0] - ldrb r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x8] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] -_0800752C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end AddTilesToObjectCopyRequests - - thumb_func_start Unused_CopyFromObjects -@ void Unused_CopyFromObjects(void *dest) -Unused_CopyFromObjects: @ 800753C - push {r4,lr} - adds r1, r0, 0 - ldr r3, =gSprites - movs r2, 0 - ldr r4, =0x000010ff -_08007546: - ldrb r0, [r3] - strb r0, [r1] - adds r1, 0x1 - adds r3, 0x1 - adds r2, 0x1 - cmp r2, r4 - bls _08007546 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Unused_CopyFromObjects - - thumb_func_start Unused_CopyToObjects -@ void Unused_CopyToObjects(void *src) -Unused_CopyToObjects: @ 8007564 - push {r4,lr} - adds r1, r0, 0 - ldr r3, =gSprites - movs r2, 0 - ldr r4, =0x000010ff -_0800756E: - ldrb r0, [r1] - strb r0, [r3] - adds r1, 0x1 - adds r3, 0x1 - adds r2, 0x1 - cmp r2, r4 - bls _0800756E - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Unused_CopyToObjects - - thumb_func_start ResetAllSprites -@ void ResetAllSprites() -ResetAllSprites: @ 800758C - push {r4,r5,lr} - movs r4, 0 -_08007590: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl ResetSprite - ldr r0, =gSpriteOrder - adds r0, r4, r0 - strb r4, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3F - bls _08007590 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl ResetSprite - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ResetAllSprites - - thumb_func_start FreeObjectTiles -@ void FreeObjectTiles(struct obj *object) -FreeObjectTiles: @ 80075C8 - push {lr} - ldr r2, [r0, 0x14] - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080075DA - adds r0, r1, 0 - bl FreeObjectTilesByTag -_080075DA: - pop {r0} - bx r0 - .pool - thumb_func_end FreeObjectTiles - - thumb_func_start FreeObjectPalette -@ void FreeObjectPalette(struct obj *object) -FreeObjectPalette: @ 80075E4 - push {lr} - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - thumb_func_end FreeObjectPalette - - thumb_func_start obj_free_rotscale_entry -@ void obj_free_rotscale_entry(struct obj *obj) -obj_free_rotscale_entry: @ 80075F4 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0800761A - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] -_0800761A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end obj_free_rotscale_entry - - thumb_func_start ResetSpriteAndFreeResources -@ void ResetSpriteAndFreeResources(struct obj *object) -ResetSpriteAndFreeResources: @ 8007620 - push {r4,lr} - adds r4, r0, 0 - bl FreeObjectTiles - adds r0, r4, 0 - bl FreeObjectPalette - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl DestroySprite - pop {r4} - pop {r0} - bx r0 - thumb_func_end ResetSpriteAndFreeResources - - thumb_func_start AnimateSprite -@ void AnimateSprite(struct obj *object) -AnimateSprite: @ 8007640 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =gUnknown_082EC6C4 - adds r5, r4, 0 - adds r5, 0x3F - ldrb r1, [r5] - movs r0, 0x4 - ands r0, r1 - adds r0, r2 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - ldr r0, =gAffineAnimsDisabled - ldrb r0, [r0] - cmp r0, 0 - bne _08007676 - ldr r0, =gUnknown_082EC6CC - ldrb r1, [r5] - lsls r1, 28 - lsrs r1, 31 - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r4, 0 - bl _call_via_r1 -_08007676: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AnimateSprite - - thumb_func_start BeginObjectImageAnim -@ void BeginObjectImageAnim(struct obj *object) -BeginObjectImageAnim: @ 8007688 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x2B - movs r2, 0 - strb r2, [r3] - adds r5, r4, 0 - adds r5, 0x3F - ldrb r1, [r5] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r5] - adds r0, r4, 0 - adds r0, 0x2D - strb r2, [r0] - adds r2, r4, 0 - adds r2, 0x2A - ldrb r1, [r2] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r3] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0] - mov r9, r0 - lsls r0, 16 - mov r8, r0 - asrs r1, r0, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0800776C - ldrb r1, [r5] - subs r0, 0x4 - ands r0, r1 - strb r0, [r5] - ldrb r1, [r2] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r3] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r1, r0, 10 - lsrs r3, r1, 26 - lsls r1, r0, 9 - lsrs r7, r1, 31 - lsls r0, 8 - lsrs r6, r0, 31 - cmp r3, 0 - beq _08007704 - subs r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_08007704: - adds r2, r4, 0 - adds r2, 0x2C - movs r0, 0x3F - ands r3, r0 - ldrb r1, [r2] - subs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0800772E - adds r0, r4, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl obj_set_horizonal_and_vertical_flip -_0800772E: - ldrb r1, [r5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0800775C - adds r0, r4, 0 - adds r0, 0x40 - ldrh r1, [r0] - add r1, r9 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r4, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - b _0800776C - .pool -_0800775C: - mov r1, r8 - lsrs r0, r1, 16 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 22 - ldr r2, [r4, 0xC] - bl AddPicToObjectCopyRequests -_0800776C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end BeginObjectImageAnim - - thumb_func_start ContinueObjectImageAnim -@ void ContinueObjectImageAnim(struct obj *object) -ContinueObjectImageAnim: @ 8007778 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - beq _080077C8 - adds r0, r4, 0 - bl obj_anim_image_delay_progress - adds r0, r4, 0 - adds r0, 0x2A - ldrb r1, [r0] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r1, r0, 9 - lsrs r3, r1, 31 - lsls r0, 8 - lsrs r2, r0, 31 - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0800780E - adds r0, r4, 0 - adds r1, r3, 0 - bl obj_set_horizonal_and_vertical_flip - b _0800780E -_080077C8: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0800780E - adds r2, r4, 0 - adds r2, 0x2B - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x2A - ldrb r0, [r0] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r2] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - movs r2, 0x3 - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - bge _080077FE - adds r0, 0x3 - lsls r0, 16 - lsrs r2, r0, 16 -_080077FE: - ldr r0, =gUnknown_082EC6D4 - lsls r1, r2, 16 - asrs r1, 14 - adds r1, r0 - ldr r1, [r1] - adds r0, r4, 0 - bl _call_via_r1 -_0800780E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContinueObjectImageAnim - - thumb_func_start ImageAnimCmd_frame -@ void ImageAnimCmd_frame(struct obj *object) -ImageAnimCmd_frame: @ 8007818 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r0, 0x2A - ldrb r1, [r0] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r7, [r0] - mov r8, r7 - ldr r0, [r0] - lsls r1, r0, 10 - lsrs r3, r1, 26 - lsls r1, r0, 9 - lsrs r6, r1, 31 - lsls r0, 8 - lsrs r5, r0, 31 - cmp r3, 0 - beq _08007852 - subs r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_08007852: - adds r2, r4, 0 - adds r2, 0x2C - movs r0, 0x3F - ands r3, r0 - ldrb r1, [r2] - subs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0800787C - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl obj_set_horizonal_and_vertical_flip -_0800787C: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080078AC - adds r0, r4, 0 - adds r0, 0x40 - ldrh r1, [r0] - adds r1, r7 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r4, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - b _080078BA - .pool -_080078AC: - mov r0, r8 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 22 - ldr r2, [r4, 0xC] - bl AddPicToObjectCopyRequests -_080078BA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ImageAnimCmd_frame - - thumb_func_start ImageAnimCmd_end -@ void ImageAnimCmd_end(struct obj *object) -ImageAnimCmd_end: @ 80078C4 - adds r2, r0, 0 - adds r2, 0x2B - ldrb r1, [r2] - subs r1, 0x1 - strb r1, [r2] - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x10 - orrs r1, r2 - strb r1, [r0] - bx lr - thumb_func_end ImageAnimCmd_end - - thumb_func_start ImageAnimCmd_jump -@ void ImageAnimCmd_jump(struct obj *object) -ImageAnimCmd_jump: @ 80078DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x2A - ldrb r1, [r3] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - adds r2, r4, 0 - adds r2, 0x2B - ldrb r0, [r2] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 10 - lsrs r0, 26 - strb r0, [r2] - ldrb r0, [r3] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r2] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrh r7, [r1] - mov r8, r7 - ldr r0, [r1] - lsls r1, r0, 10 - lsrs r3, r1, 26 - lsls r1, r0, 9 - lsrs r6, r1, 31 - lsls r0, 8 - lsrs r5, r0, 31 - cmp r3, 0 - beq _08007930 - subs r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_08007930: - adds r2, r4, 0 - adds r2, 0x2C - movs r0, 0x3F - ands r3, r0 - ldrb r1, [r2] - subs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0800795A - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl obj_set_horizonal_and_vertical_flip -_0800795A: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0800798C - adds r0, r4, 0 - adds r0, 0x40 - ldrh r1, [r0] - adds r1, r7 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r4, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - b _0800799A - .pool -_0800798C: - mov r0, r8 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 22 - ldr r2, [r4, 0xC] - bl AddPicToObjectCopyRequests -_0800799A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ImageAnimCmd_jump - - thumb_func_start ImageAnimCmd_loop -@ void ImageAnimCmd_loop(struct obj *object) -ImageAnimCmd_loop: @ 80079A4 - push {lr} - adds r1, r0, 0 - adds r0, 0x2D - ldrb r0, [r0] - cmp r0, 0 - beq _080079B8 - adds r0, r1, 0 - bl ContinueImageAnimLoop - b _080079BE -_080079B8: - adds r0, r1, 0 - bl BeginImageAnimLoop -_080079BE: - pop {r0} - bx r0 - thumb_func_end ImageAnimCmd_loop - - thumb_func_start BeginImageAnimLoop -@ void BeginImageAnimLoop(struct obj *object) -BeginImageAnimLoop: @ 80079C4 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x2A - ldrb r1, [r0] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 10 - lsrs r0, 26 - adds r1, r4, 0 - adds r1, 0x2D - strb r0, [r1] - adds r0, r4, 0 - bl JumpToTopOfImageAnimLoop - adds r0, r4, 0 - bl ContinueObjectImageAnim - pop {r4} - pop {r0} - bx r0 - thumb_func_end BeginImageAnimLoop - - thumb_func_start ContinueImageAnimLoop -@ void ContinueImageAnimLoop(struct obj *object) -ContinueImageAnimLoop: @ 80079FC - push {r4,lr} - adds r4, r0, 0 - adds r1, r4, 0 - adds r1, 0x2D - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - bl JumpToTopOfImageAnimLoop - adds r0, r4, 0 - bl ContinueObjectImageAnim - pop {r4} - pop {r0} - bx r0 - thumb_func_end ContinueImageAnimLoop - - thumb_func_start JumpToTopOfImageAnimLoop -@ void JumpToTopOfImageAnimLoop(struct obj *object) -JumpToTopOfImageAnimLoop: @ 8007A1C - push {r4-r7,lr} - mov r12, r0 - adds r0, 0x2D - ldrb r0, [r0] - cmp r0, 0 - beq _08007A88 - mov r3, r12 - adds r3, 0x2B - ldrb r0, [r3] - subs r0, 0x1 - strb r0, [r3] - mov r5, r12 - adds r5, 0x2A - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2, 0x8] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r3] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - subs r0, 0x4 - movs r7, 0 - ldrsh r0, [r0, r7] - movs r1, 0x3 - negs r1, r1 - adds r4, r3, 0 - cmp r0, r1 - beq _08007A82 - adds r6, r1, 0 - adds r2, r4, 0 -_08007A5C: - ldrb r0, [r2] - cmp r0, 0 - beq _08007A82 - subs r0, 0x1 - strb r0, [r3] - ldrb r1, [r5] - mov r7, r12 - ldr r0, [r7, 0x8] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r2] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - subs r0, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, r6 - bne _08007A5C -_08007A82: - ldrb r0, [r4] - subs r0, 0x1 - strb r0, [r4] -_08007A88: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end JumpToTopOfImageAnimLoop - - thumb_func_start BeginObjectRotScalAnim -@ void BeginObjectRotScalAnim(struct obj *object) -BeginObjectRotScalAnim: @ 8007A90 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - ldrb r0, [r6, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08007B12 - ldr r0, [r6, 0x10] - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r0, =0x00007fff - cmp r1, r0 - beq _08007B12 - adds r0, r6, 0 - bl obj_get_rotscale_entry_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl rotscale_reset_half - mov r5, sp - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - bl rotscale_load_frame - adds r7, r6, 0 - adds r7, 0x3F - ldrb r1, [r7] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - strb r0, [r7] - adds r0, r4, 0 - mov r1, sp - bl sub_8008168 - ldr r1, =gUnknown_03000B70 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r5, 0x5] - strb r1, [r0, 0x2] - ldrb r1, [r7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08007B12 - movs r0, 0x3A - ldrsh r1, [r6, r0] - movs r0, 0x3C - ldrsh r2, [r6, r0] - adds r0, r6, 0 - bl obj_update_pos2 -_08007B12: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BeginObjectRotScalAnim - - thumb_func_start ContinueObjectRotScalAnim -@ void ContinueObjectRotScalAnim(struct obj *object) -ContinueObjectRotScalAnim: @ 8007B24 - push {r4,r5,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08007BC6 - adds r0, r4, 0 - bl obj_get_rotscale_entry_index - lsls r0, 24 - lsrs r2, r0, 24 - adds r5, r2, 0 - ldr r1, =gUnknown_03000B70 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x2] - cmp r0, 0 - beq _08007B60 - adds r0, r2, 0 - adds r1, r4, 0 - bl sub_8007BD8 - b _08007BAA - .pool -_08007B60: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08007BC6 - ldrb r0, [r3, 0x1] - adds r0, 0x1 - strb r0, [r3, 0x1] - ldrb r0, [r3] - ldr r1, [r4, 0x10] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r3, 0x1] - ldr r0, [r0] - lsls r1, 3 - adds r1, r0 - movs r2, 0x3 - movs r0, 0 - ldrsh r1, [r1, r0] - ldr r0, =0x00007ffc - cmp r1, r0 - ble _08007B98 - ldr r2, =0xffff8003 - adds r0, r1, r2 - lsls r0, 16 - lsrs r2, r0, 16 -_08007B98: - ldr r0, =gUnknown_082EC6E4 - lsls r1, r2, 16 - asrs r1, 14 - adds r1, r0 - ldr r2, [r1] - adds r0, r5, 0 - adds r1, r4, 0 - bl _call_via_r2 -_08007BAA: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08007BC6 - movs r0, 0x3A - ldrsh r1, [r4, r0] - movs r0, 0x3C - ldrsh r2, [r4, r0] - adds r0, r4, 0 - bl obj_update_pos2 -_08007BC6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ContinueObjectRotScalAnim - - thumb_func_start sub_8007BD8 -@ void sub_8007BD8(u8 index, struct obj *object) -sub_8007BD8: @ 8007BD8 + thumb_func_start AffineAnimDelay +@ void AffineAnimDelay(u8 index, struct obj *object) +AffineAnimDelay: @ 8007BD8 push {r4,r5,lr} sub sp, 0x8 adds r5, r1, 0 @@ -1962,32 +16,32 @@ sub_8007BD8: @ 8007BD8 lsrs r4, r0, 24 adds r0, r5, 0 adds r1, r4, 0 - bl obj_anim_rotscale_delay_progress + bl DecrementAffineAnimDelayCounter lsls r0, 24 cmp r0, 0 bne _08007C02 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl rotscale_load_frame + bl GetAffineAnimFrame adds r0, r4, 0 mov r1, sp - bl rotscale_frame_apply_relative_and_sync + bl ApplyAffineAnimFrameRelativeAndUpdateMatrix _08007C02: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_8007BD8 + thumb_func_end AffineAnimDelay - thumb_func_start RotScalAnimCmd_loop -@ void RotScalAnimCmd_loop(u8 index, struct obj *object) -RotScalAnimCmd_loop: @ 8007C0C + thumb_func_start AffineAnimCmd_loop +@ void AffineAnimCmd_loop(u8 index, struct obj *object) +AffineAnimCmd_loop: @ 8007C0C push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r2, r0, 24 - ldr r1, =gUnknown_03000B70 + ldr r1, =sAffineAnimStates lsls r0, r2, 1 adds r0, r2 lsls r0, 2 @@ -1997,26 +51,26 @@ RotScalAnimCmd_loop: @ 8007C0C beq _08007C34 adds r0, r2, 0 adds r1, r3, 0 - bl ContinueRotScalAnimLoop + bl ContinueAffineAnimLoop b _08007C3C .pool _08007C34: adds r0, r2, 0 adds r1, r3, 0 - bl BeginRotScalAnimLoop + bl BeginAffineAnimLoop _08007C3C: pop {r0} bx r0 - thumb_func_end RotScalAnimCmd_loop + thumb_func_end AffineAnimCmd_loop - thumb_func_start BeginRotScalAnimLoop -@ void BeginRotScalAnimLoop(u8 index, struct obj *object) -BeginRotScalAnimLoop: @ 8007C40 + thumb_func_start BeginAffineAnimLoop +@ void BeginAffineAnimLoop(u8 index, struct obj *object) +BeginAffineAnimLoop: @ 8007C40 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_03000B70 + ldr r1, =sAffineAnimStates lsls r3, r0, 1 adds r3, r0 lsls r3, 2 @@ -2034,21 +88,21 @@ BeginRotScalAnimLoop: @ 8007C40 adds r1, r4, 0 bl JumpToTopOfRotScalAnimLoop adds r0, r4, 0 - bl ContinueObjectRotScalAnim + bl ContinueAffineAnim pop {r4} pop {r0} bx r0 .pool - thumb_func_end BeginRotScalAnimLoop + thumb_func_end BeginAffineAnimLoop - thumb_func_start ContinueRotScalAnimLoop -@ void ContinueRotScalAnimLoop(u8 index, struct obj *object) -ContinueRotScalAnimLoop: @ 8007C7C + thumb_func_start ContinueAffineAnimLoop +@ void ContinueAffineAnimLoop(u8 index, struct obj *object) +ContinueAffineAnimLoop: @ 8007C7C push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -2059,12 +113,12 @@ ContinueRotScalAnimLoop: @ 8007C7C adds r1, r4, 0 bl JumpToTopOfRotScalAnimLoop adds r0, r4, 0 - bl ContinueObjectRotScalAnim + bl ContinueAffineAnim pop {r4} pop {r0} bx r0 .pool - thumb_func_end ContinueRotScalAnimLoop + thumb_func_end ContinueAffineAnimLoop thumb_func_start JumpToTopOfRotScalAnimLoop @ void JumpToTopOfRotScalAnimLoop(u8 index, struct obj *object) @@ -2073,7 +127,7 @@ JumpToTopOfRotScalAnimLoop: @ 8007CAC mov r12, r1 lsls r0, 24 lsrs r5, r0, 24 - ldr r1, =gUnknown_03000B70 + ldr r1, =sAffineAnimStates lsls r3, r5, 1 adds r0, r3, r5 lsls r0, 2 @@ -2126,15 +180,15 @@ _08007D0C: .pool thumb_func_end JumpToTopOfRotScalAnimLoop - thumb_func_start RotScalAnimCmd_jump -@ void RotScalAnimCmd_jump(u8 index, struct obj *object) -RotScalAnimCmd_jump: @ 8007D18 + thumb_func_start AffineAnimCmd_jump +@ void AffineAnimCmd_jump(u8 index, struct obj *object) +AffineAnimCmd_jump: @ 8007D18 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r0, =gUnknown_03000B70 + ldr r0, =sAffineAnimStates lsls r4, r5, 1 adds r4, r5 lsls r4, 2 @@ -2152,10 +206,10 @@ RotScalAnimCmd_jump: @ 8007D18 mov r6, sp adds r0, r5, 0 mov r2, sp - bl rotscale_load_frame + bl GetAffineAnimFrame adds r0, r5, 0 mov r1, sp - bl sub_8008168 + bl ApplyAffineAnimFrame ldrb r0, [r6, 0x5] strb r0, [r4, 0x2] add sp, 0x8 @@ -2163,11 +217,11 @@ RotScalAnimCmd_jump: @ 8007D18 pop {r0} bx r0 .pool - thumb_func_end RotScalAnimCmd_jump + thumb_func_end AffineAnimCmd_jump - thumb_func_start RotScalAnimCmd_end -@ void RotScalAnimCmd_end(u8 index, struct obj *object) -RotScalAnimCmd_end: @ 8007D64 + thumb_func_start AffineAnimCmd_end +@ void AffineAnimCmd_end(u8 index, struct obj *object) +AffineAnimCmd_end: @ 8007D64 push {lr} sub sp, 0x8 lsls r0, 24 @@ -2181,7 +235,7 @@ RotScalAnimCmd_end: @ 8007D64 movs r3, 0x20 orrs r2, r3 strb r2, [r1] - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -2190,16 +244,16 @@ RotScalAnimCmd_end: @ 8007D64 subs r2, 0x1 strb r2, [r1, 0x1] mov r1, sp - bl rotscale_frame_apply_relative_and_sync + bl ApplyAffineAnimFrameRelativeAndUpdateMatrix add sp, 0x8 pop {r0} bx r0 .pool - thumb_func_end RotScalAnimCmd_end + thumb_func_end AffineAnimCmd_end - thumb_func_start RotScalAnimCmd_frame -@ void RotScalAnimCmd_frame(u8 index, struct obj *object) -RotScalAnimCmd_frame: @ 8007DA0 + thumb_func_start AffineAnimCmd_frame +@ void AffineAnimCmd_frame(u8 index, struct obj *object) +AffineAnimCmd_frame: @ 8007DA0 push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 @@ -2208,11 +262,11 @@ RotScalAnimCmd_frame: @ 8007DA0 mov r5, sp adds r0, r4, 0 mov r2, sp - bl rotscale_load_frame + bl GetAffineAnimFrame adds r0, r4, 0 mov r1, sp - bl sub_8008168 - ldr r1, =gUnknown_03000B70 + bl ApplyAffineAnimFrame + ldr r1, =sAffineAnimStates lsls r0, r4, 1 adds r0, r4 lsls r0, 2 @@ -2224,11 +278,11 @@ RotScalAnimCmd_frame: @ 8007DA0 pop {r0} bx r0 .pool - thumb_func_end RotScalAnimCmd_frame + thumb_func_end AffineAnimCmd_frame - thumb_func_start rotscale_set_indirect -@ void rotscale_set_indirect(u8 rotscale_entry_index, s16 rotscale_data[]) -rotscale_set_indirect: @ 8007DD8 + thumb_func_start CopyOamMatrix +@ void CopyOamMatrix(u8 rotscale_entry_index, s16 rotscale_data[]) +CopyOamMatrix: @ 8007DD8 lsls r0, 24 ldr r2, =gOamMatrices lsrs r0, 21 @@ -2243,11 +297,11 @@ rotscale_set_indirect: @ 8007DD8 strh r1, [r0, 0x6] bx lr .pool - thumb_func_end rotscale_set_indirect + thumb_func_end CopyOamMatrix - thumb_func_start obj_get_rotscale_entry_index -@ int obj_get_rotscale_entry_index(struct obj *obj) -obj_get_rotscale_entry_index: @ 8007DF8 + thumb_func_start GetSpriteMatrixNum +@ int GetSpriteMatrixNum(struct obj *obj) +GetSpriteMatrixNum: @ 8007DF8 push {lr} adds r2, r0, 0 movs r3, 0 @@ -2265,7 +319,7 @@ _08007E12: adds r0, r3, 0 pop {r1} bx r1 - thumb_func_end obj_get_rotscale_entry_index + thumb_func_end GetSpriteMatrixNum thumb_func_start sub_8007E18 @ void sub_8007E18(struct obj *obj, s16 a2, s16 a3) @@ -2384,9 +438,9 @@ _08007EDA: .pool thumb_func_end obj_update_pos2 - thumb_func_start obj_set_horizonal_and_vertical_flip -@ void obj_set_horizonal_and_vertical_flip(struct obj *obj, u8 a2, char a3) -obj_set_horizonal_and_vertical_flip: @ 8007EF0 + thumb_func_start SetSpriteOamFlipBits +@ void SetSpriteOamFlipBits(struct obj *obj, u8 a2, char a3) +SetSpriteOamFlipBits: @ 8007EF0 push {r4-r6,lr} mov r6, r8 push {r6} @@ -2444,14 +498,14 @@ obj_set_horizonal_and_vertical_flip: @ 8007EF0 pop {r4-r6} pop {r0} bx r0 - thumb_func_end obj_set_horizonal_and_vertical_flip + thumb_func_end SetSpriteOamFlipBits - thumb_func_start rotscale_reset_half -@ void rotscale_reset_half(u8 index) -rotscale_reset_half: @ 8007F64 + thumb_func_start AffineAnimStateRestartAnim +@ void AffineAnimStateRestartAnim(u8 index) +AffineAnimStateRestartAnim: @ 8007F64 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -2462,14 +516,14 @@ rotscale_reset_half: @ 8007F64 strb r0, [r1, 0x3] bx lr .pool - thumb_func_end rotscale_reset_half + thumb_func_end AffineAnimStateRestartAnim thumb_func_start rotscale_reset_full_1 @ void rotscale_reset_full_1(u8 index, u8 a2) rotscale_reset_full_1: @ 8007F80 lsls r0, 24 lsrs r0, 24 - ldr r3, =gUnknown_03000B70 + ldr r3, =sAffineAnimStates lsls r2, r0, 1 adds r2, r0 lsls r2, 2 @@ -2493,7 +547,7 @@ rotscale_reset_full_1: @ 8007F80 rotscale_reset_full_2: @ 8007FA8 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -2517,7 +571,7 @@ rotscale_reset_full_2: @ 8007FA8 rotscale_frame_apply_absolute: @ 8007FD0 lsls r0, 24 lsrs r0, 24 - ldr r3, =gUnknown_03000B70 + ldr r3, =sAffineAnimStates lsls r2, r0, 1 adds r2, r0 lsls r2, 2 @@ -2533,8 +587,8 @@ rotscale_frame_apply_absolute: @ 8007FD0 .pool thumb_func_end rotscale_frame_apply_absolute - thumb_func_start obj_anim_image_delay_progress -obj_anim_image_delay_progress: @ 8007FF4 + thumb_func_start DecrementAnimDelayCounter +DecrementAnimDelayCounter: @ 8007FF4 push {lr} adds r3, r0, 0 adds r3, 0x2C @@ -2556,11 +610,11 @@ obj_anim_image_delay_progress: @ 8007FF4 _08008018: pop {r0} bx r0 - thumb_func_end obj_anim_image_delay_progress + thumb_func_end DecrementAnimDelayCounter - thumb_func_start obj_anim_rotscale_delay_progress -@ u8 obj_anim_rotscale_delay_progress(struct obj *object, u8 index) -obj_anim_rotscale_delay_progress: @ 800801C + thumb_func_start DecrementAffineAnimDelayCounter +@ u8 DecrementAffineAnimDelayCounter(struct obj *object, u8 index) +DecrementAffineAnimDelayCounter: @ 800801C push {lr} lsls r1, 24 lsrs r2, r1, 24 @@ -2571,7 +625,7 @@ obj_anim_rotscale_delay_progress: @ 800801C ands r0, r1 cmp r0, 0 bne _08008040 - ldr r0, =gUnknown_03000B70 + ldr r0, =sAffineAnimStates lsls r1, r2, 1 adds r1, r2 lsls r1, 2 @@ -2585,17 +639,17 @@ _08008040: pop {r1} bx r1 .pool - thumb_func_end obj_anim_rotscale_delay_progress + thumb_func_end DecrementAffineAnimDelayCounter - thumb_func_start rotscale_frame_apply_relative_and_sync -@ void rotscale_frame_apply_relative_and_sync(u8 index, int a2) -rotscale_frame_apply_relative_and_sync: @ 800804C + thumb_func_start ApplyAffineAnimFrameRelativeAndUpdateMatrix +@ void ApplyAffineAnimFrameRelativeAndUpdateMatrix(u8 index, int a2) +ApplyAffineAnimFrameRelativeAndUpdateMatrix: @ 800804C push {r4-r6,lr} sub sp, 0x10 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r0, =gUnknown_03000B70 + ldr r0, =sAffineAnimStates lsls r4, r5, 1 adds r4, r5 lsls r4, 2 @@ -2648,13 +702,13 @@ rotscale_frame_apply_relative_and_sync: @ 800804C bl ObjAffineSet adds r0, r5, 0 adds r1, r4, 0 - bl rotscale_set_indirect + bl CopyOamMatrix add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .pool - thumb_func_end rotscale_frame_apply_relative_and_sync + thumb_func_end ApplyAffineAnimFrameRelativeAndUpdateMatrix thumb_func_start divide_0x10000_by @ int divide_0x10000_by(int n) @@ -2672,13 +726,13 @@ divide_0x10000_by: @ 80080E4 bx r1 thumb_func_end divide_0x10000_by - thumb_func_start rotscale_load_frame -@ void rotscale_load_frame(u8 index, struct obj *obj, rotscale_frame *a3) -rotscale_load_frame: @ 80080FC + thumb_func_start GetAffineAnimFrame +@ void GetAffineAnimFrame(u8 index, struct obj *obj, rotscale_frame *a3) +GetAffineAnimFrame: @ 80080FC push {r4,lr} lsls r0, 24 lsrs r0, 24 - ldr r3, =gUnknown_03000B70 + ldr r3, =sAffineAnimStates lsls r4, r0, 1 adds r4, r0 lsls r4, 2 @@ -2727,10 +781,10 @@ rotscale_load_frame: @ 80080FC pop {r0} bx r0 .pool - thumb_func_end rotscale_load_frame + thumb_func_end GetAffineAnimFrame - thumb_func_start sub_8008168 -sub_8008168: @ 8008168 + thumb_func_start ApplyAffineAnimFrame +ApplyAffineAnimFrame: @ 8008168 push {r4,lr} sub sp, 0x8 adds r2, r1, 0 @@ -2747,7 +801,7 @@ sub_8008168: @ 8008168 strb r0, [r2, 0x5] adds r0, r4, 0 adds r1, r2, 0 - bl rotscale_frame_apply_relative_and_sync + bl ApplyAffineAnimFrameRelativeAndUpdateMatrix b _0800819E _0800818E: adds r0, r4, 0 @@ -2755,13 +809,13 @@ _0800818E: bl rotscale_frame_apply_absolute adds r0, r4, 0 mov r1, sp - bl rotscale_frame_apply_relative_and_sync + bl ApplyAffineAnimFrameRelativeAndUpdateMatrix _0800819E: add sp, 0x8 pop {r4} pop {r0} bx r0 - thumb_func_end sub_8008168 + thumb_func_end ApplyAffineAnimFrame thumb_func_start StartObjectImageAnim @ void StartObjectImageAnim(struct obj *object, u8 whichAnim) @@ -2837,7 +891,7 @@ SeekObjectImageAnim: @ 80081DC ands r0, r1 strb r0, [r4] adds r0, r3, 0 - bl ContinueObjectImageAnim + bl ContinueAnim ldrb r2, [r4] movs r0, 0x3F ands r0, r2 @@ -2871,7 +925,7 @@ StartObjectRotScalAnim: @ 8008258 adds r5, r0, 0 lsls r4, r1, 24 lsrs r4, 24 - bl obj_get_rotscale_entry_index + bl GetSpriteMatrixNum lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 @@ -2896,10 +950,10 @@ StartObjectRotScalAnimIfDifferent: @ 8008284 adds r5, r0, 0 lsls r1, 24 lsrs r4, r1, 24 - bl obj_get_rotscale_entry_index + bl GetSpriteMatrixNum lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -2923,10 +977,10 @@ sub_80082B8: @ 80082B8 adds r5, r0, 0 lsls r4, r1, 24 lsrs r4, 24 - bl obj_get_rotscale_entry_index + bl GetSpriteMatrixNum lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -2952,10 +1006,10 @@ sub_80082F0: @ 80082F0 adds r5, r0, 0 lsls r1, 24 lsrs r4, r1, 24 - bl obj_get_rotscale_entry_index + bl GetSpriteMatrixNum lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_03000B70 + ldr r2, =sAffineAnimStates lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -3080,9 +1134,9 @@ _080083E2: bx r1 thumb_func_end rotscale_alloc_entry - thumb_func_start rotscale_free_entry -@ void rotscale_free_entry(u8 rotscale_index) -rotscale_free_entry: @ 80083E8 + thumb_func_start FreeOamMatrix +@ void FreeOamMatrix(u8 rotscale_index) +FreeOamMatrix: @ 80083E8 push {lr} sub sp, 0x4 lsls r0, 24 @@ -3114,7 +1168,7 @@ _08008406: pop {r0} bx r0 .pool - thumb_func_end rotscale_free_entry + thumb_func_end FreeOamMatrix thumb_func_start InitSpriteAffineAnim @ void InitSpriteAffineAnim(struct obj *obj) @@ -3209,7 +1263,7 @@ sub_8008478: @ 8008478 bl ObjAffineSet adds r0, r6, 0 adds r1, r4, 0 - bl rotscale_set_indirect + bl CopyOamMatrix add sp, 0x10 pop {r3} mov r8, r3 @@ -3282,9 +1336,9 @@ _08008560: bx r0 thumb_func_end LoadObjectPics - thumb_func_start FreeObjectTilesByTag -@ void FreeObjectTilesByTag(u16 tag) -FreeObjectTilesByTag: @ 8008568 + thumb_func_start FreeSpriteTilesByTag +@ void FreeSpriteTilesByTag(u16 tag) +FreeSpriteTilesByTag: @ 8008568 push {r4-r7,lr} mov r7, r8 push {r7} @@ -3340,7 +1394,7 @@ _080085C6: pop {r0} bx r0 .pool - thumb_func_end FreeObjectTilesByTag + thumb_func_end FreeSpriteTilesByTag thumb_func_start FreeSpriteTileRanges @ void FreeSpriteTileRanges() @@ -3684,9 +1738,9 @@ GetObjectPaletteTagBySlot: @ 800883C .pool thumb_func_end GetObjectPaletteTagBySlot - thumb_func_start FreeObjectPaletteByTag -@ void FreeObjectPaletteByTag(int tag) -FreeObjectPaletteByTag: @ 800884C + thumb_func_start FreeSpritePaletteByTag +@ void FreeSpritePaletteByTag(int tag) +FreeSpritePaletteByTag: @ 800884C push {lr} lsls r0, 16 lsrs r0, 16 @@ -3704,7 +1758,7 @@ _08008868: pop {r0} bx r0 .pool - thumb_func_end FreeObjectPaletteByTag + thumb_func_end FreeSpritePaletteByTag thumb_func_start SetSpriteOamTables_NoPriorityFromTable @ void SetSpriteOamTables_NoPriorityFromTable(struct obj *object, u32 spriteOamTables) @@ -3716,9 +1770,9 @@ SetSpriteOamTables_NoPriorityFromTable: @ 8008874 bx lr thumb_func_end SetSpriteOamTables_NoPriorityFromTable - thumb_func_start AddSprite -@ u8 AddSprite(struct obj *obj, u8 *spriteIndex) -AddSprite: @ 8008880 + thumb_func_start AddSpriteToOamBuffer +@ u8 AddSpriteToOamBuffer(struct obj *obj, u8 *spriteIndex) +AddSpriteToOamBuffer: @ 8008880 push {r4,lr} adds r4, r0, 0 adds r3, r1, 0 @@ -3764,7 +1818,7 @@ _080088CC: adds r1, r0 adds r0, r4, 0 adds r2, r3, 0 - bl AddSpritesFromSpriteOamTable + bl AddSubspritesToOamBuffer lsls r0, 24 lsrs r0, 24 _080088E0: @@ -3772,11 +1826,11 @@ _080088E0: pop {r1} bx r1 .pool - thumb_func_end AddSprite + thumb_func_end AddSpriteToOamBuffer - thumb_func_start AddSpritesFromSpriteOamTable -@ u8 AddSpritesFromSpriteOamTable(struct obj *object, struct sprite *sprite, u8 *spriteIndex) -AddSpritesFromSpriteOamTable: @ 80088EC + thumb_func_start AddSubspritesToOamBuffer +@ u8 AddSubspritesToOamBuffer(struct obj *object, struct sprite *sprite, u8 *spriteIndex) +AddSubspritesToOamBuffer: @ 80088EC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -4049,6 +2103,6 @@ _08008AE6: pop {r1} bx r1 .pool - thumb_func_end AddSpritesFromSpriteOamTable + thumb_func_end AddSubspritesToOamBuffer .align 2, 0 @ Don't pad with nop. diff --git a/asm/starter_choose.s b/asm/starter_choose.s index 1841a8acc..8e7ad0755 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -26,7 +26,7 @@ _08133EE8: thumb_func_start sub_8133EF8 sub_8133EF8: @ 8133EF8 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -586,7 +586,7 @@ _08134450: ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl sub_818D820 ldrb r0, [r5, 0xC] @@ -597,7 +597,7 @@ _08134450: ldrb r0, [r4, 0x3] lsls r0, 26 lsrs r0, 27 - bl rotscale_free_entry + bl FreeOamMatrix adds r0, r4, 0 bl DestroySprite ldr r0, =sub_81344AC diff --git a/asm/title_screen.s b/asm/title_screen.s index f8bc69e97..57aa148b2 100644 --- a/asm/title_screen.s +++ b/asm/title_screen.s @@ -465,7 +465,7 @@ _080AA766: title_screen_vblank_callback: @ 80AA780 push {lr} bl sub_80BA0A8 - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer ldr r0, =gUnknown_02022E1A diff --git a/asm/trade.s b/asm/trade.s index 8892f1b8a..93690705d 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -1720,7 +1720,7 @@ _080780F6: thumb_func_start sub_807811C sub_807811C: @ 807811C push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -6960,7 +6960,7 @@ _0807AC1C: sub_807AC24: @ 807AC24 push {lr} bl sub_807ABCC - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} @@ -10453,7 +10453,7 @@ _0807CD1C: adds r0, r1 lsls r0, 2 adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] @@ -12558,7 +12558,7 @@ _0807E168: adds r0, r1 lsls r0, 2 adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] @@ -13527,7 +13527,7 @@ sub_807EA2C: @ 807EA2C adds r0, r1 lsls r0, 2 adds r0, r4 - bl obj_free_rotscale_entry + bl FreeSpriteOamMatrix ldr r0, =gUnknown_02032298 ldrb r4, [r0] ldrb r0, [r0, 0x1] diff --git a/asm/trainer_card.s b/asm/trainer_card.s index 345ed8beb..9e69e1e39 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -8,7 +8,7 @@ thumb_func_start sub_80C2690 sub_80C2690: @ 80C2690 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer bl sub_80C48C8 @@ -5226,7 +5226,7 @@ pokemon_details: @ 80C53AC movs r0, 0x2 bl SetBgAffine _080C5416: - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer add sp, 0x10 @@ -7096,9 +7096,9 @@ _080C642C: bls _080C6410 bl ResetObjectPaletteAllocator movs r0, 0x2 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag movs r0, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag pop {r4-r6} pop {r0} bx r0 @@ -7411,7 +7411,7 @@ _080C6732: beq _080C6746 bl DestroySprite movs r0, 0 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _080C6746: ldr r0, [r4] ldr r0, [r0, 0xC] @@ -7419,7 +7419,7 @@ _080C6746: beq _080C6758 bl DestroySprite movs r0, 0x1 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _080C6758: ldr r0, [r4] ldr r0, [r0, 0x8] @@ -7427,7 +7427,7 @@ _080C6758: beq _080C676A bl DestroySprite movs r0, 0x4 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _080C676A: bl FreeAllWindowBuffers b _080C67A4 diff --git a/asm/wallclock.s b/asm/wallclock.s index 816954e2f..22a895592 100644 --- a/asm/wallclock.s +++ b/asm/wallclock.s @@ -8,7 +8,7 @@ thumb_func_start sub_81347B4 sub_81347B4: @ 81347B4 push {lr} - bl LoadOamFromSprites + bl LoadOam bl ProcessSpriteCopyRequests bl TransferPlttBuffer pop {r0} diff --git a/asm/weather.s b/asm/weather.s index f5d18af6e..8e7b2fb7a 100644 --- a/asm/weather.s +++ b/asm/weather.s @@ -2833,7 +2833,7 @@ _080AC686: bls _080AC678 movs r0, 0x90 lsls r0, 5 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006de @@ -3910,7 +3910,7 @@ _080ACF6A: movs r1, 0 strb r1, [r0] ldr r0, =0x00001206 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag pop {r4-r7} pop {r0} bx r0 @@ -5552,7 +5552,7 @@ _080ADD8C: cmp r4, 0x13 bls _080ADD7E ldr r0, =0x00001201 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006fb @@ -5888,7 +5888,7 @@ _080AE03A: cmp r4, 0x13 bls _080AE02C ldr r0, =0x00001202 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0854C14C ldr r0, [r0] movs r1, 0xE0 @@ -6325,7 +6325,7 @@ _080AE3CE: cmp r4, 0x13 bls _080AE3C0 ldr r0, =0x00001203 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x00000724 @@ -6691,7 +6691,7 @@ _080AE6CA: movs r1, 0 strb r1, [r0] ldr r0, =0x00001204 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag _080AE6E6: ldr r0, =gUnknown_0854C14C ldr r1, [r0] @@ -7318,7 +7318,7 @@ _080AEBFE: cmp r4, 0x3F bls _080AEBE4 ldr r0, =0x00001205 - bl FreeObjectTilesByTag + bl FreeSpriteTilesByTag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x0000072c diff --git a/data/graphics/field_objects/field_effect_objects.inc b/data/graphics/field_objects/field_effect_objects.inc index b0f2dba85..3eb9adc11 100644 --- a/data/graphics/field_objects/field_effect_objects.inc +++ b/data/graphics/field_objects/field_effect_objects.inc @@ -825,7 +825,7 @@ gFieldEffectObjectRotScalAnimTable_Unknown21:: @ 850D284 gFieldEffectObjectTemplate_Unknown21:: @ 850D28C .2byte 0x0 @ tiles tag .2byte 0xFFFF @ palette tag - .4byte gDefaultOamAttributes + .4byte gDummyOamData .4byte gDummyObjectImageAnimTable .4byte NULL .4byte gFieldEffectObjectRotScalAnimTable_Unknown21 diff --git a/data/sprite.s b/data/sprite.s index ba7d5eaf8..2e5343eee 100644 --- a/data/sprite.s +++ b/data/sprite.s @@ -6,14 +6,14 @@ @ Unreferenced data. Also unreferenced in Ruby. .incbin "baserom.gba", 0x2ec61c, 0x18 -gUnknown_082EC634:: @ 82EC634 +sCenterToCornerVecTable:: @ 82EC634 .incbin "baserom.gba", 0x2ec634, 0x18 sDummySprite:: @ 82EC64C .incbin "baserom.gba", 0x2ec64c, 0x44 @ off-screen and low priority relative to background -gDefaultOamAttributes:: @ 82EC690 +gDummyOamData:: @ 82EC690 .2byte 160 @ Y .2byte 304 @ X .2byte 3 << 10 @ priority @@ -34,19 +34,19 @@ gDummyObjectRotScalAnim:: @ 82EC6A0 gDummyObjectRotScalAnimTable:: @ 82EC6A8 .4byte gDummyObjectRotScalAnim -gUnknown_082EC6AC:: @ 82EC6AC +gDummySpriteTemplate:: @ 82EC6AC .incbin "baserom.gba", 0x2ec6ac, 0x18 -gUnknown_082EC6C4:: @ 82EC6C4 +sAnimFuncs:: @ 82EC6C4 .incbin "baserom.gba", 0x2ec6c4, 0x8 -gUnknown_082EC6CC:: @ 82EC6CC +sAffineAnimFuncs:: @ 82EC6CC .incbin "baserom.gba", 0x2ec6cc, 0x8 -gUnknown_082EC6D4:: @ 82EC6D4 +sAnimCmdFuncs:: @ 82EC6D4 .incbin "baserom.gba", 0x2ec6d4, 0x10 -gUnknown_082EC6E4:: @ 82EC6E4 +sAffineAnimCmdFuncs:: @ 82EC6E4 .incbin "baserom.gba", 0x2ec6e4, 0x10 gUnknown_082EC6F4:: @ 82EC6F4 diff --git a/include/sprite.h b/include/sprite.h index 7c2af94d0..1885c3bdb 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -259,13 +259,45 @@ void RequestSpriteCopy(const u8 *src, u8 *dest, u16 size); void FreeSpriteTiles(struct Sprite *sprite); void FreeSpritePalette(struct Sprite *sprite); void FreeSpriteOamMatrix(struct Sprite *sprite); -void RequestSpriteCopy(const u8 *src, u8 *dest, u16 size); -void FreeSpriteTiles(struct Sprite *sprite); -void FreeSpritePalette(struct Sprite *sprite); -void FreeSpriteOamMatrix(struct Sprite *sprite); +void DestroySpriteAndFreeResources(struct Sprite *sprite); +void sub_800142C(u32 a1, u32 a2, u16 *a3, u16 a4, u32 a5); +void AnimateSprite(struct Sprite *sprite); +void StartSpriteAnim(struct Sprite *sprite, u8 animNum); +void StartSpriteAnimIfDifferent(struct Sprite *sprite, u8 animNum); +void SeekSpriteAnim(struct Sprite *sprite, u8 animCmdIndex); +void StartSpriteAffineAnim(struct Sprite *sprite, u8 animNum); +void StartSpriteAffineAnimIfDifferent(struct Sprite *sprite, u8 animNum); +void ChangeSpriteAffineAnim(struct Sprite *sprite, u8 animNum); +void ChangeSpriteAffineAnimIfDifferent(struct Sprite *sprite, u8 animNum); +void SetSpriteSheetFrameTileNum(struct Sprite *sprite); +u8 AllocOamMatrix(void); +void FreeOamMatrix(u8 matrixNum); +void InitSpriteAffineAnim(struct Sprite *sprite); +void SetOamMatrixRotationScaling(u8 matrixNum, s16 xScale, s16 yScale, u16 rotation); +u16 LoadSpriteSheet(const struct SpriteSheet *sheet); +void LoadSpriteSheets(const struct SpriteSheet *sheets); +u16 AllocTilesForSpriteSheet(struct SpriteSheet *sheet); +void AllocTilesForSpriteSheets(struct SpriteSheet *sheets); +void LoadTilesForSpriteSheet(const struct SpriteSheet *sheet); +void LoadTilesForSpriteSheets(struct SpriteSheet *sheets); void FreeSpriteTilesByTag(u16 tag); void FreeSpriteTileRanges(void); -void AnimateSprite(struct Sprite *sprite); +u16 GetSpriteTileStartByTag(u16 tag); +u16 GetSpriteTileTagByTileStart(u16 start); +void RequestSpriteSheetCopy(const struct SpriteSheet *sheet); +u16 LoadSpriteSheetDeferred(const struct SpriteSheet *sheet); +void FreeAllSpritePalettes(void); +u8 LoadSpritePalette(const struct SpritePalette *palette); +void LoadSpritePalettes(const struct SpritePalette *palettes); +u8 AllocSpritePalette(u16 tag); +u8 IndexOfSpritePaletteTag(u16 tag); +u16 GetSpritePaletteTagByPaletteNum(u8 paletteNum); +void FreeSpritePaletteByTag(u16 tag); +void SetSubspriteTables(struct Sprite *sprite, const struct SubspriteTable *subspriteTables); bool8 AddSpriteToOamBuffer(struct Sprite *object, u8 *oamIndex); +bool8 AddSubspritesToOamBuffer(struct Sprite *sprite, struct OamData *destOam, u8 *oamIndex); +void CopyToSprites(u8 *src); +void CopyFromSprites(u8 *dest); +u8 SpriteTileAllocBitmapOp(u16 bit, u8 op); #endif //GUARD_SPRITE_H diff --git a/src/sprite.c b/src/sprite.c index 245dc2660..8a19358f0 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -2,8 +2,29 @@ #include "sprite.h" #include "main.h" +#define MAX_SPRITE_COPY_REQUESTS 64 + #define OAM_MATRIX_COUNT 32 +#define SET_SPRITE_TILE_RANGE(index, start, count) \ +{ \ + sSpriteTileRanges[index * 2] = start; \ + (sSpriteTileRanges + 1)[index * 2] = count; \ +} + +#define ALLOC_SPRITE_TILE(n) \ +{ \ + gSpriteTileAllocBitmap[(n) / 8] |= (1 << ((n) % 8)); \ +} + +#define FREE_SPRITE_TILE(n) \ +{ \ + gSpriteTileAllocBitmap[(n) / 8] &= ~(1 << ((n) % 8)); \ +} + +#define SPRITE_TILE_IS_ALLOCATED(n) ((gSpriteTileAllocBitmap[(n) / 8] >> ((n) % 8)) & 1) + + struct SpriteCopyRequest { const u8 *src; @@ -60,6 +81,13 @@ void ResetAffineAnimData(void); u8 IndexOfSpriteTileTag(u16 tag); void AllocSpriteTileRange(u16 tag, u16 start, u16 count); void DoLoadSpritePalette(const u16 *src, u16 paletteOffset); +void obj_update_pos2(struct Sprite* sprite, s16 arg1, s16 arg2); + +typedef void (*AnimFunc)(struct Sprite *); +typedef void (*AnimCmdFunc)(struct Sprite *); +typedef void (*AffineAnimCmdFunc)(u8 matrixNum, struct Sprite *); + +extern struct AffineAnimState sAffineAnimStates[OAM_MATRIX_COUNT]; EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0}; EWRAM_DATA u16 gSpritePriorities[MAX_SPRITES] = {0}; @@ -75,6 +103,15 @@ EWRAM_DATA s16 gSpriteCoordOffsetY = 0; EWRAM_DATA struct OamMatrix gOamMatrices[OAM_MATRIX_COUNT] = {0}; EWRAM_DATA bool8 gAffineAnimsDisabled = 0; +extern const struct OamData gDummyOamData; +extern const struct SpriteTemplate gDummySpriteTemplate; +extern const struct Sprite sDummySprite; +extern const u8 sCenterToCornerVecTable[3][4][2]; +extern const AnimFunc sAnimFuncs[]; +extern const AnimFunc sAffineAnimFuncs[]; +extern const AnimCmdFunc sAnimCmdFuncs[]; +extern const AffineAnimCmdFunc sAffineAnimCmdFuncs[]; + void ResetSpriteData(void) { ResetOamRange(0, 128); @@ -259,3 +296,622 @@ void CopyMatricesToOamBuffer(void) } } +void AddSpritesToOamBuffer(void) +{ + u8 i = 0; + u8 oamIndex = 0; + + while (i < MAX_SPRITES) + { + struct Sprite *sprite = &gSprites[gSpriteOrder[i]]; + if (sprite->inUse && !sprite->invisible && AddSpriteToOamBuffer(sprite, &oamIndex)) + return; + i++; + } + + while (oamIndex < gOamLimit) + { + gMain.oamBuffer[oamIndex] = gDummyOamData; + oamIndex++; + } +} + +u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) +{ + u8 i; + + for (i = 0; i < MAX_SPRITES; i++) + if (!gSprites[i].inUse) + return CreateSpriteAt(i, template, x, y, subpriority); + + return MAX_SPRITES; +} + +u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) +{ + s16 i; + + for (i = MAX_SPRITES - 1; i > -1; i--) + if (!gSprites[i].inUse) + return CreateSpriteAt(i, template, x, y, subpriority); + + return MAX_SPRITES; +} + +u8 CreateInvisibleSprite(void (*callback)(struct Sprite *)) +{ + u8 index = CreateSprite(&gDummySpriteTemplate, 0, 0, 31); + + if (index == MAX_SPRITES) + { + return MAX_SPRITES; + } + else + { + gSprites[index].invisible = TRUE; + gSprites[index].callback = callback; + return index; + } +} + +u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) +{ + struct Sprite *sprite = &gSprites[index]; + + ResetSprite(sprite); + + sprite->inUse = TRUE; + sprite->animBeginning = TRUE; + sprite->affineAnimBeginning = TRUE; + sprite->usingSheet = TRUE; + + sprite->subpriority = subpriority; + sprite->oam = *template->oam; + sprite->anims = template->anims; + sprite->affineAnims = template->affineAnims; + sprite->template = template; + sprite->callback = template->callback; + sprite->pos1.x = x; + sprite->pos1.y = y; + + CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); + + if (template->tileTag == 0xFFFF) + { + s16 tileNum; + sprite->images = template->images; + tileNum = AllocSpriteTiles((u8)(sprite->images->size / TILE_SIZE_4BPP)); + if (tileNum == -1) + { + ResetSprite(sprite); + return MAX_SPRITES; + } + sprite->oam.tileNum = tileNum; + sprite->usingSheet = FALSE; + sprite->sheetTileStart = 0; + } + else + { + sprite->sheetTileStart = GetSpriteTileStartByTag(template->tileTag); + SetSpriteSheetFrameTileNum(sprite); + } + + if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK) + InitSpriteAffineAnim(sprite); + + if (template->paletteTag != 0xFFFF) + sprite->oam.paletteNum = IndexOfSpritePaletteTag(template->paletteTag); + + return index; +} + +u8 CreateSpriteAndAnimate(struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) +{ + u8 i; + + for (i = 0; i < MAX_SPRITES; i++) + { + struct Sprite *sprite = &gSprites[i]; + + if (!gSprites[i].inUse) + { + u8 index = CreateSpriteAt(i, template, x, y, subpriority); + + if (index == MAX_SPRITES) + return MAX_SPRITES; + + gSprites[i].callback(sprite); + + if (gSprites[i].inUse) + AnimateSprite(sprite); + + return index; + } + } + + return MAX_SPRITES; +} + +void DestroySprite(struct Sprite *sprite) +{ + if (sprite->inUse) + { + if (!sprite->usingSheet) + { + u16 i; + u16 tileEnd = (sprite->images->size / TILE_SIZE_4BPP) + sprite->oam.tileNum; + for (i = sprite->oam.tileNum; i < tileEnd; i++) + FREE_SPRITE_TILE(i); + } + ResetSprite(sprite); + } +} + +void ResetOamRange(u8 a, u8 b) +{ + u8 i; + + for (i = a; i < b; i++) + { + struct OamData *oamBuffer = gMain.oamBuffer; + oamBuffer[i] = *(struct OamData *)&gDummyOamData; + } +} + +void LoadOam(void) +{ + if (!gMain.oamLoadDisabled) + CpuCopy32(gMain.oamBuffer, (void *)OAM, sizeof(gMain.oamBuffer)); +} + +void ClearSpriteCopyRequests(void) +{ + u8 i; + + gShouldProcessSpriteCopyRequests = FALSE; + gSpriteCopyRequestCount = 0; + + for (i = 0; i < MAX_SPRITE_COPY_REQUESTS; i++) + { + gSpriteCopyRequests[i].src = 0; + gSpriteCopyRequests[i].dest = 0; + gSpriteCopyRequests[i].size = 0; + } +} + +void ResetOamMatrices(void) +{ + u8 i; + for (i = 0; i < OAM_MATRIX_COUNT; i++) + { + // set to identity matrix + gOamMatrices[i].a = 0x0100; + gOamMatrices[i].b = 0x0000; + gOamMatrices[i].c = 0x0000; + gOamMatrices[i].d = 0x0100; + } +} + +void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d) +{ + gOamMatrices[matrixNum].a = a; + gOamMatrices[matrixNum].b = b; + gOamMatrices[matrixNum].c = c; + gOamMatrices[matrixNum].d = d; +} + +void ResetSprite(struct Sprite *sprite) +{ + *sprite = sDummySprite; +} + +void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode) +{ + u8 x = sCenterToCornerVecTable[shape][size][0]; + u8 y = sCenterToCornerVecTable[shape][size][1]; + + if (affineMode & ST_OAM_AFFINE_DOUBLE_MASK) + { + x *= 2; + y *= 2; + } + + sprite->centerToCornerVecX = x; + sprite->centerToCornerVecY = y; +} + +s16 AllocSpriteTiles(u16 tileCount) +{ + u16 i; + s16 start; + u16 numTilesFound; + + if (tileCount == 0) + { + // Free all unreserved tiles if the tile count is 0. + for (i = gReservedSpriteTileCount; i < TOTAL_OBJ_TILE_COUNT; i++) + FREE_SPRITE_TILE(i); + + return 0; + } + + i = gReservedSpriteTileCount; + + for (;;) + { + while (SPRITE_TILE_IS_ALLOCATED(i)) + { + i++; + + if (i == TOTAL_OBJ_TILE_COUNT) + return -1; + } + + start = i; + numTilesFound = 1; + + while (numTilesFound != tileCount) + { + i++; + + if (i == TOTAL_OBJ_TILE_COUNT) + return -1; + + if (!SPRITE_TILE_IS_ALLOCATED(i)) + numTilesFound++; + else + break; + } + + if (numTilesFound == tileCount) + break; + } + + for (i = start; i < tileCount + start; i++) + ALLOC_SPRITE_TILE(i); + + return start; +} + +u8 SpriteTileAllocBitmapOp(u16 bit, u8 op) +{ + u8 index = bit / 8; + u8 shift = bit % 8; + u8 val = bit % 8; + u8 retVal = 0; + + if (op == 0) + { + val = ~(1 << val); + gSpriteTileAllocBitmap[index] &= val; + } + else if (op == 1) + { + val = (1 << val); + gSpriteTileAllocBitmap[index] |= val; + } + else + { + retVal = 1 << shift; + retVal &= gSpriteTileAllocBitmap[index]; + } + + return retVal; +} + +void SpriteCallbackDummy(struct Sprite *sprite) +{ +} + +void ProcessSpriteCopyRequests(void) +{ + if (gShouldProcessSpriteCopyRequests) + { + u8 i = 0; + + while (gSpriteCopyRequestCount > 0) + { + CpuCopy16(gSpriteCopyRequests[i].src, gSpriteCopyRequests[i].dest, gSpriteCopyRequests[i].size); + gSpriteCopyRequestCount--; + i++; + } + + gShouldProcessSpriteCopyRequests = FALSE; + } +} + +void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFrameImage *images) +{ + if (gSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS) + { + gSpriteCopyRequests[gSpriteCopyRequestCount].src = images[index].data; + gSpriteCopyRequests[gSpriteCopyRequestCount].dest = (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * tileNum; + gSpriteCopyRequests[gSpriteCopyRequestCount].size = images[index].size; + gSpriteCopyRequestCount++; + } +} + +void RequestSpriteCopy(const u8 *src, u8 *dest, u16 size) +{ + if (gSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS) + { + gSpriteCopyRequests[gSpriteCopyRequestCount].src = src; + gSpriteCopyRequests[gSpriteCopyRequestCount].dest = dest; + gSpriteCopyRequests[gSpriteCopyRequestCount].size = size; + gSpriteCopyRequestCount++; + } +} + +void CopyFromSprites(u8 *dest) +{ + u32 i; + u8 *src = (u8 *)gSprites; + for (i = 0; i < sizeof(struct Sprite) * MAX_SPRITES; i++) + { + *dest = *src; + dest++; + src++; + } +} + +void CopyToSprites(u8 *src) +{ + u32 i; + u8 *dest = (u8 *)gSprites; + for (i = 0; i < sizeof(struct Sprite) * MAX_SPRITES; i++) + { + *dest = *src; + src++; + dest++; + } +} + +void ResetAllSprites(void) +{ + u8 i; + + for (i = 0; i < MAX_SPRITES; i++) + { + ResetSprite(&gSprites[i]); + gSpriteOrder[i] = i; + } + + ResetSprite(&gSprites[i]); +} + +void FreeSpriteTiles(struct Sprite *sprite) +{ + if (sprite->template->tileTag != 0xFFFF) + FreeSpriteTilesByTag(sprite->template->tileTag); +} + +void FreeSpritePalette(struct Sprite *sprite) +{ + FreeSpritePaletteByTag(sprite->template->paletteTag); +} + +void FreeSpriteOamMatrix(struct Sprite *sprite) +{ + if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK) + { + FreeOamMatrix(sprite->oam.matrixNum); + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; + } +} + +void DestroySpriteAndFreeResources(struct Sprite *sprite) +{ + FreeSpriteTiles(sprite); + FreeSpritePalette(sprite); + FreeSpriteOamMatrix(sprite); + DestroySprite(sprite); +} + +void AnimateSprite(struct Sprite *sprite) +{ + sAnimFuncs[sprite->animBeginning](sprite); + + if (!gAffineAnimsDisabled) + sAffineAnimFuncs[sprite->affineAnimBeginning](sprite); +} + +void BeginAnim(struct Sprite *sprite) +{ + s16 imageValue; + u8 duration; + u8 hFlip; + u8 vFlip; + + sprite->animCmdIndex = 0; + sprite->animEnded = FALSE; + sprite->animLoopCounter = 0; + imageValue = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.imageValue; + + if (imageValue != -1) + { + sprite->animBeginning = FALSE; + duration = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.duration; + hFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.hFlip; + vFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.vFlip; + + if (duration) + duration--; + + sprite->animDelayCounter = duration; + + if (!(sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)) + SetSpriteOamFlipBits(sprite, hFlip, vFlip); + + if (sprite->usingSheet) + sprite->oam.tileNum = sprite->sheetTileStart + imageValue; + else + RequestSpriteFrameImageCopy(imageValue, sprite->oam.tileNum, sprite->images); + } +} + +void ContinueAnim(struct Sprite *sprite) +{ + if (sprite->animDelayCounter) + { + u8 hFlip; + u8 vFlip; + DecrementAnimDelayCounter(sprite); + hFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.hFlip; + vFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.vFlip; + if (!(sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)) + SetSpriteOamFlipBits(sprite, hFlip, vFlip); + } + else if (!sprite->animPaused) + { + s16 type; + s16 funcIndex; + sprite->animCmdIndex++; + type = sprite->anims[sprite->animNum][sprite->animCmdIndex].type; + funcIndex = 3; + if (type < 0) + funcIndex = type + 3; + sAnimCmdFuncs[funcIndex](sprite); + } +} + +void AnimCmd_frame(struct Sprite *sprite) +{ + s16 imageValue; + u8 duration; + u8 hFlip; + u8 vFlip; + + imageValue = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.imageValue; + duration = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.duration; + hFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.hFlip; + vFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.vFlip; + + if (duration) + duration--; + + sprite->animDelayCounter = duration; + + if (!(sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)) + SetSpriteOamFlipBits(sprite, hFlip, vFlip); + + if (sprite->usingSheet) + sprite->oam.tileNum = sprite->sheetTileStart + imageValue; + else + RequestSpriteFrameImageCopy(imageValue, sprite->oam.tileNum, sprite->images); +} + +void AnimCmd_end(struct Sprite *sprite) +{ + sprite->animCmdIndex--; + sprite->animEnded = TRUE; +} + +void AnimCmd_jump(struct Sprite *sprite) +{ + s16 imageValue; + u8 duration; + u8 hFlip; + u8 vFlip; + + sprite->animCmdIndex = sprite->anims[sprite->animNum][sprite->animCmdIndex].jump.target; + + imageValue = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.imageValue; + duration = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.duration; + hFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.hFlip; + vFlip = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.vFlip; + + if (duration) + duration--; + + sprite->animDelayCounter = duration; + + if (!(sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)) + SetSpriteOamFlipBits(sprite, hFlip, vFlip); + + if (sprite->usingSheet) + sprite->oam.tileNum = sprite->sheetTileStart + imageValue; + else + RequestSpriteFrameImageCopy(imageValue, sprite->oam.tileNum, sprite->images); +} + +void AnimCmd_loop(struct Sprite *sprite) +{ + if (sprite->animLoopCounter) + ContinueAnimLoop(sprite); + else + BeginAnimLoop(sprite); +} + +void BeginAnimLoop(struct Sprite *sprite) +{ + sprite->animLoopCounter = sprite->anims[sprite->animNum][sprite->animCmdIndex].loop.count; + JumpToTopOfAnimLoop(sprite); + ContinueAnim(sprite); +} + +void ContinueAnimLoop(struct Sprite *sprite) +{ + sprite->animLoopCounter--; + JumpToTopOfAnimLoop(sprite); + ContinueAnim(sprite); +} + +void JumpToTopOfAnimLoop(struct Sprite *sprite) +{ + if (sprite->animLoopCounter) + { + sprite->animCmdIndex--; + + while (sprite->anims[sprite->animNum][sprite->animCmdIndex - 1].type != -3) + { + if (sprite->animCmdIndex == 0) + break; + sprite->animCmdIndex--; + } + + sprite->animCmdIndex--; + } +} + +void BeginAffineAnim(struct Sprite *sprite) +{ + if ((sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK) && sprite->affineAnims[0][0].type != 32767) + { + struct AffineAnimFrameCmd frameCmd; + u8 matrixNum = GetSpriteMatrixNum(sprite); + AffineAnimStateRestartAnim(matrixNum); + GetAffineAnimFrame(matrixNum, sprite, &frameCmd); + sprite->affineAnimBeginning = FALSE; + sprite->affineAnimEnded = FALSE; + ApplyAffineAnimFrame(matrixNum, &frameCmd); + sAffineAnimStates[matrixNum].delayCounter = frameCmd.duration; + if (sprite->flags_f) + obj_update_pos2(sprite, sprite->data6, sprite->data7); + } +} + +void ContinueAffineAnim(struct Sprite *sprite) +{ + if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK) + { + u8 matrixNum = GetSpriteMatrixNum(sprite); + + if (sAffineAnimStates[matrixNum].delayCounter) + AffineAnimDelay(matrixNum, sprite); + else if (sprite->affineAnimPaused) + return; + else + { + s16 type; + s16 funcIndex; + sAffineAnimStates[matrixNum].animCmdIndex++; + type = sprite->affineAnims[sAffineAnimStates[matrixNum].animNum][sAffineAnimStates[matrixNum].animCmdIndex].type; + funcIndex = 3; + if (type >= 32765) + funcIndex = type - 32765; + sAffineAnimCmdFuncs[funcIndex](matrixNum, sprite); + } + if (sprite->flags_f) + obj_update_pos2(sprite, sprite->data6, sprite->data7); + } +} diff --git a/sym_bss.txt b/sym_bss.txt index 57c8a145f..f3c5ad304 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -46,7 +46,7 @@ gUnknown_030009F0: @ 30009F0 gUnknown_03000A70: @ 3000A70 .space 0x100 -gUnknown_03000B70: @ 3000B70 +sAffineAnimStates: @ 3000B70 .space 0x180 gUnknown_03000CF0: @ 3000CF0