From 6202ae1df00b84628d4d444ee05d766b6c75e3a2 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Wed, 2 Jan 2019 16:40:40 -0600 Subject: [PATCH] Extract rodata from roulette --- data/roulette.s | 928 ----------------------- include/gba/types.h | 4 +- ld_script.txt | 2 +- src/roulette.c | 1731 ++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 1647 insertions(+), 1018 deletions(-) delete mode 100644 data/roulette.s diff --git a/data/roulette.s b/data/roulette.s deleted file mode 100644 index 3cb412084..000000000 --- a/data/roulette.s +++ /dev/null @@ -1,928 +0,0 @@ - - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 1 -gUnknown_085B5BFC:: @ 85B5BFC - .incbin "graphics/roulette/85B5BFC.gbapal" - - .align 2 -gUnknown_085B5DFC:: @ 85B5DFC - .incbin "graphics/roulette/85B5DFC.bin.lz" - - .align 2 -gUnknown_085B5FA0:: @ 85B5FA0 - .incbin "graphics/roulette/wheel_map.bin.lz" - - .align 2 -gUnknown_085B6140:: @ 85B6140 - .4byte 0x000001f8, 0x00001241, 0x00002a66 - - .align 2 -gUnknown_085B614C:: @ 85B614C - window_template 0x00, 0x03, 0x0f, 0x18, 0x04, 0x0f, 0x00c5 - - .align 2 -gUnknown_085B6154:: @ 85B6154 - .byte 0xFF, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x0C, 0x14, 0x00, 0x11, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x42, 0x08, 0x01, 0x00, 0x00, 0xE0, 0x00, 0x00 - .byte 0x0D, 0x24, 0x00, 0x14, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x84, 0x10, 0x02, 0x00, 0x00, 0xE0, 0x00, 0x00 - .byte 0x0E, 0x34, 0x00, 0x17, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x21, 0x04, 0x00, 0x00, 0xE0, 0x00, 0x00 - .byte 0x0F, 0x44, 0x00, 0x1A, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x42, 0x08, 0x00, 0x00, 0xE0, 0x00, 0x00 - .byte 0x10, 0x03, 0x01, 0x0E, 0x0A, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00 - .byte 0x00, 0x1C, 0x01, 0x11, 0x0A, 0x03, 0x03, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00 - .byte 0x09, 0x2C, 0x01, 0x14, 0x0A, 0x03, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00 - .byte 0x06, 0x3C, 0x01, 0x17, 0x0A, 0x03, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00 - .byte 0x03, 0x4C, 0x01, 0x1A, 0x0A, 0x03, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00 - .byte 0x11, 0x03, 0x02, 0x0E, 0x0D, 0x03, 0x0F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x92, 0x04, 0x00, 0x00 - .byte 0x04, 0x1C, 0x02, 0x11, 0x0D, 0x06, 0x06, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00 - .byte 0x01, 0x2C, 0x02, 0x14, 0x0D, 0x06, 0x06, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00 - .byte 0x0A, 0x3C, 0x02, 0x17, 0x0D, 0x06, 0x06, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00 - .byte 0x07, 0x4C, 0x02, 0x1A, 0x0D, 0x06, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00 - .byte 0x12, 0x03, 0x03, 0x0E, 0x10, 0x06, 0x12, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x24, 0x09, 0x00, 0x00 - .byte 0x08, 0x1C, 0x03, 0x11, 0x10, 0x09, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x21, 0x00, 0x00 - .byte 0x05, 0x2C, 0x03, 0x14, 0x10, 0x09, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20, 0x20, 0x00, 0x00 - .byte 0x02, 0x3C, 0x03, 0x17, 0x10, 0x09, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x20, 0x00, 0x00 - .byte 0x0B, 0x4C, 0x03, 0x1A, 0x10, 0x09, 0x09, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x28, 0x00, 0x00 - - .align 2 -gUnknown_085B62E4:: @ 85B62E4 - .byte 0, 1, 6, 0, 64, 0, 0, 0 - .byte 1, 3, 12, 0, 0, 16, 0, 0 - .byte 2, 5, 18, 0, 0, 0, 4, 0 - .byte 3, 7, 9, 0, 0, 2, 0, 0 - .byte 4, 9, 11, 0, 0, 8, 0, 0 - .byte 5, 11, 17, 0, 0, 0, 2, 0 - .byte 6, 13, 8, 0, 0, 1, 0, 0 - .byte 7, 15, 14, 0, 0, 64, 0, 0 - .byte 8, 17, 16, 0, 0, 0, 1, 0 - .byte 9, 19, 7, 0, 128, 0, 0, 0 - .byte 10, 21, 13, 0, 0, 32, 0, 0 - .byte 11, 23, 19, 0, 0, 0, 8, 0 - -gUnknown_085B6344:: @ 85B6344 - .byte 1, 3 - .byte 1, 6 - - .align 2 -gUnknown_085B6348:: @ 85B6348 - .byte 0x01, 0x3C, 0x1E, 0x01, 0x01, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x1E, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x1B, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0xBF - .byte 0x03, 0x1E, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x3C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x30, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x0E, 0x01, 0x00, 0x00, 0x80, 0xBF - - .align 2 -gUnknown_085B6388:: @ 85B6388 - .byte 0x00, 0x80, 0x05, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x0A, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x15, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x55, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x5A, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x65, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x75, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x7A, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x85, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x95, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0x9A, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0x00, 0x80, 0xA5, 0x00, 0x01, 0x01, 0xFF, 0x48 - .byte 0xD6, 0x77, 0x28, 0x00, 0x02, 0x0A, 0xFF, 0x4E - - .align 1 -gUnknown_085B63F0:: @ 85B63F0 - .2byte 0x53FF - .2byte 0x0101 - .2byte 0x1E05 - .2byte 0x4EFF - .2byte 0x7FFB - .2byte 0x0106 - .2byte 0x1E05 - .2byte 0x4EFF - .2byte 0x7F7F - .2byte 0x010B - .2byte 0x1E05 - .2byte 0x4EFF - - .align 2 -gUnknown_085B6408:: @ 85B6408 - .4byte sub_8142918 - .4byte sub_814297C - - .align 2 -gUnknown_085B6410:: @ 85B6410 - .4byte sub_8140968 - .4byte sub_8140994 - - .align 1 -gUnknown_085B6418:: @ 85B6418 - .2byte 0x2898 - .2byte 0x1A6A - .2byte 0x2898 - -gUnknown_085B641E:: @ 85B641E - .byte 0xFB, 0x05, 0xFF, 0x01 - - .align 1 -gUnknown_085B6422:: @ 85B6422 - .2byte 0, 180 - .2byte 90, 270 - - .align 2 -gUnknown_085B642C:: @ 85B642C - .4byte 0x10842 - .4byte 0x21084 - .4byte 0x42108 - .4byte 0x84210 - - .align 2 -gUnknown_085B643C:: @ 85B643C - .4byte 0x3E0 - .4byte 0x7C00 - .4byte 0xF8000 - -gUnknown_085B6448:: @ 85B6448 - .byte 0, 3, 4, 6, 12 - - .align 2 -RouletteSpritePalette_01: @ 85B6450 - .incbin "graphics/roulette/shadow.gbapal" - - .align 2 -RouletteSpritePalette_02: @ 85B6470 - .incbin "graphics/roulette/ball.gbapal" - - .align 2 -RouletteSpritePalette_03: @ 85B6490 - .incbin "graphics/roulette/ball_counter.gbapal" - - .align 2 -RouletteSpritePalette_04: @ 85B64B0 - .incbin "graphics/roulette/cursor.gbapal" - - .align 2 -RouletteSpritePalette_05: @ 85B64D0 - .incbin "graphics/roulette/credit.gbapal" - - .align 2 -RouletteSpritePalette_06: @ 85B64F0 - .incbin "graphics/roulette/shroomish.gbapal" - - .align 2 -RouletteSpritePalette_07: @ 85B6510 - .incbin "graphics/roulette/tailow.gbapal" - - .align 2 -RouletteSpritePalette_08: @ 85B6530 - .incbin "graphics/roulette/poke_icons.gbapal" - - .align 2 -RouletteSpritePalette_09: @ 85B6550 - .incbin "graphics/roulette/wynaut.gbapal" - - .align 2 -RouletteSpritePalette_10: @ 85B6570 - .incbin "graphics/roulette/azurill.gbapal" - - .align 2 -RouletteSpritePalette_11: @ 85B6590 - .incbin "graphics/roulette/skitty.gbapal" - - .align 2 -RouletteSpritePalette_12: @ 85B65B0 - .incbin "graphics/roulette/makuhita.gbapal" - - .align 2 -RouletteSpritePalette_13: @ 85B65D0 - .incbin "graphics/roulette/85B65D0.gbapal" - - .align 2 -RouletteSpritePalette_14: @ 85B65F0 - .incbin "graphics/roulette/85B65F0.gbapal" - - .align 2 -RouletteSpritePalette_15: @ 85B6610 - .incbin "graphics/roulette/85B6610.gbapal" - - .align 2 -RouletteSpritePalette_16: @ 85B6630 - .incbin "graphics/roulette/85B6630.gbapal" - - .align 2 -gUnknown_085B6650:: @ 85B6650 - .incbin "graphics/roulette/ball.4bpp.lz" - - .align 2 -RouletteBallCounterTiles: @ 85B6798 - .incbin "graphics/roulette/ball_counter.4bpp.lz" - - .align 2 -gUnknown_085B67FC:: @ 85B67FC - .incbin "graphics/roulette/roulette_tilt.4bpp.lz" - - .align 2 -RoulettePokeIconsTiles: @ 85B6BEC - .incbin "graphics/roulette/poke_icons.4bpp.lz" - - .align 2 -RoulettePokeIcons2Tiles: @ 85B6D90 - .incbin "graphics/roulette/poke_icons2.4bpp.lz" - - .align 2 -gUnknown_085B7290:: @ 85B7290 - .incbin "graphics/roulette/shadow.4bpp.lz" - - .align 2 -RouletteCursorTiles: @ 85B7328 - .incbin "graphics/roulette/cursor.4bpp.lz" - - .align 2 -gUnknown_085B7384:: @ 85B7384 - obj_pal RouletteSpritePalette_01, 1 - obj_pal RouletteSpritePalette_02, 2 - obj_pal RouletteSpritePalette_03, 3 - obj_pal RouletteSpritePalette_04, 4 - obj_pal RouletteSpritePalette_05, 5 - obj_pal RouletteSpritePalette_06, 6 - obj_pal RouletteSpritePalette_07, 7 - obj_pal RouletteSpritePalette_08, 8 - obj_pal RouletteSpritePalette_09, 9 - obj_pal RouletteSpritePalette_10, 10 - obj_pal RouletteSpritePalette_11, 11 - obj_pal RouletteSpritePalette_12, 12 - null_obj_pal - - .align 2 -gOamData_85B73EC:: @ 85B73EC - .2byte 0x0000 - .2byte 0x8000 - .2byte 0x0400 - - .align 2 -gOamData_85B73F4:: @ 85B73F4 - .2byte 0x0000 - .2byte 0x4000 - .2byte 0x0400 - - .align 2 -gOamData_85B73FC:: @ 85B73FC - .2byte 0x833C - .2byte 0x8000 - .2byte 0x0800 - - .align 2 -gSpriteAnim_85B7404:: @ 85B7404 - obj_image_anim_frame 0, 0 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B740C:: @ 85B740C - .4byte gSpriteAnim_85B7404 - - .align 2 -gSpriteAffineAnim_85B7410:: @ 85B7410 - obj_rot_scal_anim_end - - .align 2 -gSpriteAffineAnimTable_85B7418:: @ 85B7418 - .4byte gSpriteAffineAnim_85B7410 - - .align 2 -gUnknown_085B741C:: @ 85B741C - obj_tiles RoulettePokeIcons2Tiles, 0xC00, 0 - - .align 2 -gSpriteAnim_85B7420:: @ 85B7420 - obj_image_anim_frame 0, 0 - obj_image_anim_frame 32, 0 - obj_image_anim_frame 64, 0 - obj_image_anim_frame 72, 0 - obj_image_anim_frame 8, 0 - obj_image_anim_frame 40, 0 - obj_image_anim_frame 48, 0 - obj_image_anim_frame 80, 0 - obj_image_anim_frame 16, 0 - obj_image_anim_frame 24, 0 - obj_image_anim_frame 56, 0 - obj_image_anim_frame 88, 0 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B7458:: @ 85B7458 - .4byte gSpriteAnim_85B7420 - - .align 2 -gSpriteAnimTable_85B745C:: @ 85B745C - .4byte gSpriteAnim_85B7420 + 0x4 - - .align 2 -gSpriteAnimTable_85B7460:: @ 85B7460 - .4byte gSpriteAnim_85B7420 + 0x8 - - .align 2 -gSpriteAnimTable_85B7464:: @ 85B7464 - .4byte gSpriteAnim_85B7420 + 0xC - - .align 2 -gSpriteAnimTable_85B7468:: @ 85B7468 - .4byte gSpriteAnim_85B7420 + 0x10 - - .align 2 -gSpriteAnimTable_85B746C:: @ 85B746C - .4byte gSpriteAnim_85B7420 + 0x14 - - .align 2 -gSpriteAnimTable_85B7470:: @ 85B7470 - .4byte gSpriteAnim_85B7420 + 0x18 - - .align 2 -gSpriteAnimTable_85B7474:: @ 85B7474 - .4byte gSpriteAnim_85B7420 + 0x1C - - .align 2 -gSpriteAnimTable_85B7478:: @ 85B7478 - .4byte gSpriteAnim_85B7420 + 0x20 - - .align 2 -gSpriteAnimTable_85B747C:: @ 85B747C - .4byte gSpriteAnim_85B7420 + 0x24 - - .align 2 -gSpriteAnimTable_85B7480:: @ 85B7480 - .4byte gSpriteAnim_85B7420 + 0x28 - - .align 2 -gSpriteAnimTable_85B7484:: @ 85B7484 - .4byte gSpriteAnim_85B7420 + 0x2C - - .align 2 -gUnknown_085B7488:: @ 85B7488 - obj_tiles gRouletteHeadersTiles, 0x1600, 4 - - .align 2 -gUnknown_085B7490:: @ 85B7490 - obj_tiles RoulettePokeIconsTiles, 0x400, 5 - - .align 2 -gSpriteAnim_85B7498:: @ 85B7498 - obj_image_anim_frame 0, 0 - obj_image_anim_frame 16, 0 - obj_image_anim_frame 32, 0 - obj_image_anim_frame 48, 0 - obj_image_anim_frame 64, 0 - obj_image_anim_frame 80, 0 - obj_image_anim_frame 96, 0 - obj_image_anim_frame 112, 0 - obj_image_anim_frame 128, 0 - obj_image_anim_frame 144, 0 - obj_image_anim_frame 160, 0 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B74C8:: @ 85B74C8 - obj_image_anim_frame 0, 0 - obj_image_anim_frame 4, 0 - obj_image_anim_frame 8, 0 - obj_image_anim_frame 12, 0 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B74DC:: @ 85B74DC - .4byte gSpriteAnim_85B7498 - - .align 2 -gSpriteAnimTable_85B74E0:: @ 85B74E0 - .4byte gSpriteAnim_85B7498 + 0x8 - - .align 2 -gSpriteAnimTable_85B74E4:: @ 85B74E4 - .4byte gSpriteAnim_85B7498 + 0x10 - - .align 2 -gSpriteAnimTable_85B74E8:: @ 85B74E8 - .4byte gSpriteAnim_85B7498 + 0x18 - - .align 2 -gSpriteAnimTable_85B74EC:: @ 85B74EC - .4byte gSpriteAnim_85B7498 + 0x20 - - .align 2 -gSpriteAnimTable_85B74F0:: @ 85B74F0 - .4byte gSpriteAnim_85B7498 + 0x24 - - .align 2 -gSpriteAnimTable_85B74F4:: @ 85B74F4 - .4byte gSpriteAnim_85B7498 + 0x28 - - .align 2 -gSpriteAnimTable_85B74F8:: @ 85B74F8 - .4byte gSpriteAnim_85B74C8 - - .align 2 -gSpriteAnimTable_85B74FC:: @ 85B74FC - .4byte gSpriteAnim_85B74C8 + 0x4 - - .align 2 -gSpriteAnimTable_85B7500:: @ 85B7500 - .4byte gSpriteAnim_85B74C8 + 0x8 - - .align 2 -gSpriteAnimTable_85B7504:: @ 85B7504 - .4byte gSpriteAnim_85B74C8 + 0xC - - .align 2 -gSpriteTemplate_85B7508:: @ 85B7508 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74DC, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7520:: @ 85B7520 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74E0, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7538:: @ 85B7538 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74E4, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7550:: @ 85B7550 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74E8, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7568:: @ 85B7568 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74EC, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7580:: @ 85B7580 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74F0, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7598:: @ 85B7598 - spr_template 4, 8, gOamData_85B73EC, gSpriteAnimTable_85B74F4, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B75B0:: @ 85B75B0 - spr_template 5, 8, gOamData_85B73F4, gSpriteAnimTable_85B74F8, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B75C8:: @ 85B75C8 - spr_template 5, 8, gOamData_85B73F4, gSpriteAnimTable_85B74FC, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B75E0:: @ 85B75E0 - spr_template 5, 8, gOamData_85B73F4, gSpriteAnimTable_85B7500, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B75F8:: @ 85B75F8 - spr_template 5, 8, gOamData_85B73F4, gSpriteAnimTable_85B7504, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gSpriteTemplate_85B7610:: @ 85B7610 - spr_template 0, 9, gOamData_85B73FC, gSpriteAnimTable_85B7458, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7628:: @ 85B7628 - spr_template 0, 10, gOamData_85B73FC, gSpriteAnimTable_85B745C, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7640:: @ 85B7640 - spr_template 0, 11, gOamData_85B73FC, gSpriteAnimTable_85B7460, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7658:: @ 85B7658 - spr_template 0, 12, gOamData_85B73FC, gSpriteAnimTable_85B7464, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7670:: @ 85B7670 - spr_template 0, 9, gOamData_85B73FC, gSpriteAnimTable_85B7468, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7688:: @ 85B7688 - spr_template 0, 10, gOamData_85B73FC, gSpriteAnimTable_85B746C, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B76A0:: @ 85B76A0 - spr_template 0, 11, gOamData_85B73FC, gSpriteAnimTable_85B7470, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B76B8:: @ 85B76B8 - spr_template 0, 12, gOamData_85B73FC, gSpriteAnimTable_85B7474, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B76D0:: @ 85B76D0 - spr_template 0, 9, gOamData_85B73FC, gSpriteAnimTable_85B7478, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B76E8:: @ 85B76E8 - spr_template 0, 10, gOamData_85B73FC, gSpriteAnimTable_85B747C, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7700:: @ 85B7700 - spr_template 0, 11, gOamData_85B73FC, gSpriteAnimTable_85B7480, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gSpriteTemplate_85B7718:: @ 85B7718 - spr_template 0, 12, gOamData_85B73FC, gSpriteAnimTable_85B7484, NULL, gDummySpriteAffineAnimTable, sub_8143280 - - .align 2 -gOamData_85B7730:: @ 85B7730 - .2byte 0x4000 - .2byte 0xC000 - .2byte 0x0400 - - .align 2 -gOamData_85B7738:: @ 85B7738 - .2byte 0x8000 - .2byte 0x0000 - .2byte 0x0400 - - .align 2 -gOamData_85B7740:: @ 85B7740 - .2byte 0x4000 - .2byte 0x8000 - .2byte 0x0400 - - .align 2 -gOamData_85B7748:: @ 85B7748 - .2byte 0x4000 - .2byte 0x0000 - .2byte 0x0400 - - .align 2 -gUnknown_085B7750:: @ 85B7750 - obj_tiles gRouletteCreditTiles, 0x400, 7 - obj_tiles gRouletteNumbersTiles, 0x280, 8 - obj_tiles gRouletteMultiplierTiles, 0x500, 9 - obj_tiles RouletteBallCounterTiles, 0x140, 10 - obj_tiles RouletteCursorTiles, 0x200, 11 - null_obj_tiles - - .align 2 -gSpriteAnim_85B7780:: @ 85B7780 - obj_image_anim_frame 0, 0 - obj_image_anim_frame 2, 0 - obj_image_anim_frame 4, 0 - obj_image_anim_frame 6, 0 - obj_image_anim_frame 8, 0 - obj_image_anim_frame 10, 0 - obj_image_anim_frame 12, 0 - obj_image_anim_frame 14, 0 - obj_image_anim_frame 16, 0 - obj_image_anim_frame 18, 0 - - .align 2 -gSpriteAnimTable_85B77A8:: @ 85B77A8 - .4byte gSpriteAnim_85B7780 - - .align 2 -gSpriteAnim_85B77AC:: @ 85B77AC - obj_image_anim_frame 0, 0 - obj_image_anim_frame 8, 0 - obj_image_anim_frame 16, 0 - obj_image_anim_frame 24, 0 - obj_image_anim_frame 32, 0 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B77C4:: @ 85B77C4 - .4byte gSpriteAnim_85B77AC - - .align 2 -gSpriteAnim_85B77C8:: @ 85B77C8 - obj_image_anim_frame 0, 0 - obj_image_anim_frame 2, 0 - obj_image_anim_frame 4, 0 - obj_image_anim_frame 6, 0 - obj_image_anim_frame 8, 0 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B77E0:: @ 85B77E0 - .4byte gSpriteAnim_85B77C8 - - .align 2 -gSpriteTemplate_85B77E4:: @ 85B77E4 - spr_template 7, 5, gOamData_85B7730, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085B77FC:: @ 85B77FC - spr_template 8, 5, gOamData_85B7738, gSpriteAnimTable_85B77A8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085B7814:: @ 85B7814 - spr_template 9, 5, gOamData_85B7740, gSpriteAnimTable_85B77C4, NULL, gDummySpriteAffineAnimTable, sub_814390C - - .align 2 -gUnknown_085B782C:: @ 85B782C - spr_template 10, 3, gOamData_85B7748, gSpriteAnimTable_85B77E0, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085B7844:: @ 85B7844 - spr_template 11, 5, gOamData_85B73EC, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gOamData_85B785C:: @ 85B785C - .2byte 0x0000 - .2byte 0x4000 - .2byte 0x0800 - - .align 2 -gUnknown_085B7864:: @ 85B7864 - obj_tiles gUnknown_085B6650, 0x200, 0xC - - .align 2 -gSpriteAnim_85B786C:: @ 85B786C - obj_image_anim_frame 0, 5 - obj_image_anim_frame 4, 5 - obj_image_anim_frame 8, 5 - obj_image_anim_frame 4, 5 - obj_image_anim_jump 0 - - .align 2 -gSpriteAnim_85B7880:: @ 85B7880 - obj_image_anim_frame 0, 10 - obj_image_anim_frame 4, 10 - obj_image_anim_frame 8, 10 - obj_image_anim_frame 4, 10 - obj_image_anim_jump 0 - - .align 2 -gSpriteAnim_85B7894:: @ 85B7894 - obj_image_anim_frame 0, 15 - obj_image_anim_frame 4, 15 - obj_image_anim_frame 8, 15 - obj_image_anim_frame 4, 15 - obj_image_anim_jump 0 - - .align 2 -gSpriteAnim_85B78A8:: @ 85B78A8 - obj_image_anim_frame 4, 2 - obj_image_anim_frame 8, 5 - obj_image_anim_frame 4, 5 - obj_image_anim_frame 12, 5 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B78BC:: @ 85B78BC - obj_image_anim_frame 4, 2 - obj_image_anim_frame 0, 4 - obj_image_anim_frame 4, 4 - obj_image_anim_frame 8, 4 - obj_image_anim_frame 12, 4 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B78D4:: @ 85B78D4 - obj_image_anim_frame 0, 2 - obj_image_anim_frame 4, 5 - obj_image_anim_frame 8, 5 - obj_image_anim_frame 12, 5 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B78E8:: @ 85B78E8 - obj_image_anim_frame 12, 0 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B78F0:: @ 85B78F0 - obj_image_anim_frame 8, 2 - obj_image_anim_frame 4, 5 - obj_image_anim_frame 0, 5 - obj_image_anim_frame 12, 5 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B7904:: @ 85B7904 - .4byte gSpriteAnim_85B786C - .4byte gSpriteAnim_85B7880 - .4byte gSpriteAnim_85B7894 - .4byte gSpriteAnim_85B78A8 - .4byte gSpriteAnim_85B78F0 - .4byte gSpriteAnim_85B78BC - .4byte gSpriteAnim_85B78D4 - .4byte gSpriteAnim_85B78D4 - .4byte gSpriteAnim_85B78E8 - - .align 2 -gSpriteTemplate_85B7928:: @ 85B7928 - spr_template 12, 2, gOamData_85B785C, gSpriteAnimTable_85B7904, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gOamData_85B7940:: @ 85B7940 - .2byte 0x0351 - .2byte 0xC000 - .2byte 0x0800 - - .align 2 -gUnknown_085B7948:: @ 85B7948 - obj_tiles gRouletteCenter_Gfx, 2048, 0x0006 - - .align 2 -gSpriteTemplate_85B7950:: @ 85B7950 - spr_template 6, 2, gOamData_85B7940, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_814399C - - .align 2 -gOamData_85B7968:: @ 85B7968 - .2byte 0x0000 - .2byte 0x8000 - .2byte 0x0800 - - .align 2 -gOamData_85B7970:: @ 85B7970 - .2byte 0x0000 - .2byte 0x8000 - .2byte 0x0800 - - .align 2 -gUnknown_085B7978:: @ 85B7978 - obj_tiles gUnknown_085B67FC, 0xE00, 0x000D - - .align 2 -gSpriteAnim_85B7980:: @ 85B7980 - obj_image_anim_frame 0x00, 6 - obj_image_anim_frame 0x10, 6 - obj_image_anim_frame 0x20, 6 - obj_image_anim_frame 0x30, 6 - obj_image_anim_frame 0x20, 6 - obj_image_anim_frame 0x40, 6 - obj_image_anim_jump 2 - - .align 2 -gSpriteAnim_85B799C:: @ 85B799C - obj_image_anim_frame 0x50, 10 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B79A4:: @ 85B79A4 - obj_image_anim_frame 0x50, 10, OBJ_IMAGE_ANIM_H_FLIP - obj_image_anim_end - - .align 2 -gSpriteAnim_85B79AC:: @ 85B79AC - obj_image_anim_frame 0x50, 20 - obj_image_anim_frame 0x60, 20 - obj_image_anim_jump 0 - - .align 2 -gSpriteAnim_85B79B8:: @ 85B79B8 - obj_image_anim_frame 0x50, 20, OBJ_IMAGE_ANIM_H_FLIP - obj_image_anim_frame 0x60, 20, OBJ_IMAGE_ANIM_H_FLIP - obj_image_anim_jump 0 - - .align 2 -gSpriteAnim_85B79C4:: @ 85B79C4 - obj_image_anim_frame 0x50, 10 - obj_image_anim_frame 0x60, 10 - obj_image_anim_jump 0 - - .align 2 -gSpriteAnim_85B79D0:: @ 85B79D0 - obj_image_anim_frame 0x50, 10, OBJ_IMAGE_ANIM_H_FLIP - obj_image_anim_frame 0x60, 10, OBJ_IMAGE_ANIM_H_FLIP - obj_image_anim_jump 0 - - .align 2 -gSpriteAnimTable_85B79DC:: @ 85B79DC - .4byte gSpriteAnim_85B7980 - - .align 2 -gSpriteAnimTable_85B79E0:: @ 85B79E0 - .4byte gSpriteAnim_85B799C - .4byte gSpriteAnim_85B79A4 - .4byte gSpriteAnim_85B79AC - .4byte gSpriteAnim_85B79B8 - .4byte gSpriteAnim_85B79C4 - .4byte gSpriteAnim_85B79D0 - - .align 2 -gSpriteTemplate_85B79F8:: @ 85B79F8 - spr_template 13, 6, gOamData_85B7968, gSpriteAnimTable_85B79DC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gSpriteTemplate_85B7A10:: @ 85B7A10 - spr_template 13, 7, gOamData_85B7970, gSpriteAnimTable_85B79E0, NULL, gDummySpriteAffineAnimTable, sub_8145294 - - .align 2 -gOamData_85B7A28:: @ 85B7A28 - .2byte 0x0000 - .2byte 0x4000 - .2byte 0x0800 - - .align 2 -gOamData_85B7A30:: @ 85B7A30 - .2byte 0x4000 - .2byte 0x8000 - .2byte 0x0800 - - .align 2 -gOamData_85B7A38:: @ 85B7A38 - .2byte 0x4100 - .2byte 0x8000 - .2byte 0x0800 - - .align 2 -gUnknown_085B7A40:: @ 85B7A40 - obj_tiles gUnknown_085B7290, 0x180, 0x000E - - .align 2 -gSpriteAffineAnim_85B7A48:: @ 85B7A48 - obj_rot_scal_anim_frame 0x80, 0x80, 0, 0 - obj_rot_scal_anim_frame 0x2, 0x2, 0, 60 - obj_rot_scal_anim_end - - .align 2 -gSpriteAffineAnim_85B7A60:: @ 85B7A60 - obj_rot_scal_anim_frame 0x100, 0x100, 0, 0 - obj_rot_scal_anim_frame 0xFFFE, 0x0, 0, 15 - obj_rot_scal_anim_frame 0xFFFF, 0xFFFE, 0, 15 - obj_rot_scal_anim_frame 0xFFFF, 0xFFFB, 0, 24 - obj_rot_scal_anim_end - - .align 2 -gSpriteAffineAnimTable_85B7A88:: @ 85B7A88 - .4byte gSpriteAffineAnim_85B7A48 - - .align 2 -gSpriteAffineAnimTable_85B7A8C:: @ 85B7A8C - .4byte gSpriteAffineAnim_85B7A60 - - .align 2 -gSpriteAffineAnim_85B7A90:: @ 85B7A90 - obj_rot_scal_anim_frame 0x100, 0x100, 0, 0 - obj_rot_scal_anim_end - - .align 2 -gSpriteAffineAnimTable_85B7AA0:: @ 85B7AA0 - .4byte gSpriteAffineAnim_85B7A90 - - .align 2 -gSpriteAnim_85B7AA4:: @ 85B7AA4 - obj_image_anim_frame 0, 0 - obj_image_anim_end - - .align 2 -gSpriteAnim_85B7AAC:: @ 85B7AAC - obj_image_anim_frame 4, 0 - obj_image_anim_end - - .align 2 -gSpriteAnimTable_85B7AB4:: @ 85B7AB4 - .4byte gSpriteAnim_85B7AA4 - - .align 2 -gSpriteAnimTable_85B7AB8:: @ 85B7AB8 - .4byte gSpriteAnim_85B7AAC - - .align 2 -gSpriteTemplate_85B7ABC:: @ 85B7ABC - spr_template 14, 1, gOamData_85B7A28, gSpriteAnimTable_85B7AB4, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gSpriteTemplate_83FA5D8:: @ 83FA5D8 - spr_template 14, 1, gOamData_85B7A30, gSpriteAnimTable_85B7AB8, NULL, gDummySpriteAffineAnimTable, sub_8144E60 - - .align 2 -gUnknown_085B7AEC:: @ 85B7AEC - spr_template 14, 1, gOamData_85B7A38, gSpriteAnimTable_85B7AB8, NULL, gSpriteAffineAnimTable_85B7A8C, sub_8145294 - -gUnknown_085B7B04:: @ 85B7B04 - .byte 0, 1, 2, 3, 4 - - .align 1 -gUnknown_085B7B0A:: @ 85B7B0A - .2byte 0x74, 0x2C - .2byte 0x74, 0x70 - - .align 1 -gUnknown_085B7B12:: @ 85B7B12 - .2byte 256, 84 - .2byte -16, 84 - - .align 1 -gUnknown_085B7B1A:: @ 85B7B1A - .2byte 0x907 - .2byte 0x808 - .2byte 0x709 - .2byte 0x60A - .2byte 0x50B - .2byte 0x40C - .2byte 0x30D - .2byte 0x20E - .2byte 0x10F - .2byte 0x10 - - .align 1 -gUnknown_085B7B2E:: @ 85B7B2E - .2byte -1, 0, 1, 0 - .2byte -2, 0, 2, 0 - .2byte -3, 0, 3, 0 - -gUnknown_085B7B46:: @ 85B7B46 - .byte -1, 1 - -gUnknown_085B7B48:: @ 85B7B48 - .byte 2, 0 - .byte 2, 0 - .byte 2, -1 - .byte 2, -1 - .byte 2, -1 - .byte 2, -1 - .byte 2, -2 - .byte 2, -2 diff --git a/include/gba/types.h b/include/gba/types.h index fff48d437..3d78b5b5e 100644 --- a/include/gba/types.h +++ b/include/gba/types.h @@ -59,8 +59,8 @@ struct OamData u32 shape:2; // 0x40, 0x80 -> 0xC0 /*0x02*/ u32 x:9; - u32 matrixNum:5; // bits 3/4 are h-flip/v-flip if not in affine mode - u32 size:2; + u32 matrixNum:5; // bits 3/4 are h-flip/v-flip if not in affine mode + u32 size:2; // 0x4000, 0x8000 -> 0xC000 /*0x04*/ u16 tileNum:10; // 0x3FF u16 priority:2; // 0x400, 0x800 -> 0xC00 diff --git a/ld_script.txt b/ld_script.txt index 559b375f5..f675b6a91 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -524,7 +524,7 @@ SECTIONS { src/battle_records.o(.rodata); src/pokedex_area_screen.o(.rodata); src/evolution_scene.o(.rodata); - data/roulette.o(.rodata); + src/roulette.o(.rodata); src/pokedex_cry_screen.o(.rodata); src/landmark.o(.rodata); src/battle_transition.o(.rodata); diff --git a/src/roulette.c b/src/roulette.c index eab2bcd7a..209ddefc9 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -36,15 +36,15 @@ struct StructgUnknown_083F8DF4 u8 var02; u8 var03; u8 var04; - u8 v[0x3]; + u8 filler_05[3]; u16 var08; u16 var0A; u16 var0C; - u16 v13[0x1]; + u8 filler_0E[2]; u16 var10; u16 var12; u16 var14; - u8 v1[0x2]; + u8 filler_16[2]; u16 var18; u16 var1A; float var1C; @@ -60,11 +60,9 @@ struct StructgUnknown_085B6154 u8 var04; u8 var05; u8 var06; - u8 var07; u32 var08; u32 var0C; u16 var10; - u16 var12; }; struct StructgUnknown_083F8D90 @@ -72,7 +70,6 @@ struct StructgUnknown_083F8D90 u8 var00; u8 var01; u8 var02; - u8 var03; u32 var04; }; @@ -139,6 +136,7 @@ extern u8 gUnknown_0203AB8C; /*static*/ void sub_8140814(u8); /*static*/ void sub_81408A8(u8); /*static*/ void sub_8140968(u8); +/*static*/ void sub_8140994(u8); /*static*/ void sub_8140BD0(u8); /*static*/ void sub_8141040(u8); /*static*/ void sub_81410FC(u8); @@ -157,6 +155,8 @@ extern u8 gUnknown_0203AB8C; /*static*/ void sub_8141F7C(u8 taskId, TaskFunc r1, u16 r2, u16 r3); /*static*/ void sub_8141FF4(u8); /*static*/ void sub_8142070(void); +/*static*/ void sub_8142918(u8); +/*static*/ void sub_814297C(u8); /*static*/ u8 sub_81420D0(u8, u8); /*static*/ bool8 sub_81421E8(u8, u8); /*static*/ void sub_8142284(u8); @@ -170,18 +170,22 @@ extern u8 gUnknown_0203AB8C; /*static*/ void sub_8143038(u8, u8); /*static*/ void sub_8143150(u8); /*static*/ void sub_81431E4(void); +/*static*/ void sub_8143280(struct Sprite *); /*static*/ void sub_8143314(void); /*static*/ void sub_8143514(u16); /*static*/ void sub_81436D0(u8); /*static*/ void sub_814372C(u8); /*static*/ void sub_814390C(struct Sprite *); /*static*/ void sub_814391C(void); +/*static*/ void sub_814399C(struct Sprite *); /*static*/ void sub_81439C8(void); /*static*/ void sub_8143A40(void); /*static*/ void sub_81446AC(struct Sprite *); /*static*/ void sub_81446DC(struct Sprite *); /*static*/ void sub_81448B8(struct Sprite *); /*static*/ void sub_8144A24(struct Sprite *); +/*static*/ void sub_8144E60(struct Sprite *); +/*static*/ void sub_8145294(struct Sprite *); extern const struct BgTemplate gUnknown_085B6140[3]; extern const struct WindowTemplate gUnknown_085B614C[]; @@ -209,7 +213,7 @@ extern const u8 gUnknown_082A5B4E[]; extern const struct YesNoFuncTable gUnknown_085B6410; extern const struct StructgUnknown_085B6154 gUnknown_085B6154[]; extern const u8 gUnknown_085B641E[]; -extern const u16 gUnknown_085B6422; +extern const u16 gUnknown_085B6422[]; extern const u32 gUnknown_085B642C[]; extern const u32 gUnknown_085B643C[]; extern const struct StructgUnknown_083F8D90 gUnknown_085B62E4[]; @@ -249,6 +253,609 @@ extern const s8 gUnknown_085B7B46[]; extern const s8 gUnknown_085B7B48[]; extern const s8 gUnknown_085B7B46[]; +static const u16 gUnknown_085B5BFC[] = INCBIN_U16("graphics/roulette/85B5BFC.gbapal"); +static const u32 gUnknown_085B5DFC[] = INCBIN_U32("graphics/roulette/85B5DFC.bin.lz"); +static const u32 gUnknown_085B5FA0[] = INCBIN_U32("graphics/roulette/wheel_map.bin.lz"); +static const struct BgTemplate gUnknown_085B6140[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 4, + .screenSize = 1, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 6, + .screenSize = 1, + .paletteMode = 1, + .priority = 2, + .baseTile = 0 + } +}; +static const struct WindowTemplate gUnknown_085B614C[] = +{ + { + .bg = 0, + .tilemapLeft = 3, + .tilemapTop = 15, + .width = 24, + .height = 4, + .paletteNum = 15, + .baseBlock = 0xC5 + }, + // BUG: Array not terminated properly + //DUMMY_WIN_TEMPLATE +}; +static const struct StructgUnknown_085B6154 gUnknown_085B6154[] = +{ + { + .var00 = 0xFF, + .var01_0 = 0, + .var01_4 = 0, + .var02 = 0, + .var03 = 7, + .var04 = 7, + .var05 = 0, + .var06 = 0, + .var08 = 0x0, + .var0C = 0x0, + .var10 = 0x0, + }, + { + .var00 = 12, + .var01_0 = 4, + .var01_4 = 1, + .var02 = 0, + .var03 = 17, + .var04 = 7, + .var05 = 0, + .var06 = 0, + .var08 = 0x2, + .var0C = 0x10842, + .var10 = 0xE000, + }, + { + .var00 = 13, + .var01_0 = 4, + .var01_4 = 2, + .var02 = 0, + .var03 = 20, + .var04 = 7, + .var05 = 0, + .var06 = 0, + .var08 = 0x4, + .var0C = 0x21084, + .var10 = 0xE000, + }, + { + .var00 = 14, + .var01_0 = 4, + .var01_4 = 3, + .var02 = 0, + .var03 = 23, + .var04 = 7, + .var05 = 0, + .var06 = 0, + .var08 = 0x8, + .var0C = 0x42108, + .var10 = 0xE000, + }, + { + .var00 = 15, + .var01_0 = 4, + .var01_4 = 4, + .var02 = 0, + .var03 = 26, + .var04 = 7, + .var05 = 0, + .var06 = 0, + .var08 = 0x10, + .var0C = 0x84210, + .var10 = 0xE000, + }, + { + .var00 = 16, + .var01_0 = 3, + .var01_4 = 0, + .var02 = 1, + .var03 = 14, + .var04 = 10, + .var05 = 0, + .var06 = 12, + .var08 = 0x20, + .var0C = 0x3E0, + .var10 = 0x249, + }, + { + .var00 = 0, + .var01_0 = 12, + .var01_4 = 1, + .var02 = 1, + .var03 = 17, + .var04 = 10, + .var05 = 3, + .var06 = 3, + .var08 = 0x40, + .var0C = 0x40, + .var10 = 0x2001, + }, + { + .var00 = 9, + .var01_0 = 12, + .var01_4 = 2, + .var02 = 1, + .var03 = 20, + .var04 = 10, + .var05 = 3, + .var06 = 3, + .var08 = 0x80, + .var0C = 0x80, + .var10 = 0x2200, + }, + { + .var00 = 6, + .var01_0 = 12, + .var01_4 = 3, + .var02 = 1, + .var03 = 23, + .var04 = 10, + .var05 = 3, + .var06 = 3, + .var08 = 0x100, + .var0C = 0x100, + .var10 = 0x2040, + }, + { + .var00 = 3, + .var01_0 = 12, + .var01_4 = 4, + .var02 = 1, + .var03 = 26, + .var04 = 10, + .var05 = 3, + .var06 = 3, + .var08 = 0x200, + .var0C = 0x200, + .var10 = 0x2008, + }, + { + .var00 = 17, + .var01_0 = 3, + .var01_4 = 0, + .var02 = 2, + .var03 = 14, + .var04 = 13, + .var05 = 3, + .var06 = 15, + .var08 = 0x400, + .var0C = 0x7C00, + .var10 = 0x492, + }, + { + .var00 = 4, + .var01_0 = 12, + .var01_4 = 1, + .var02 = 2, + .var03 = 17, + .var04 = 13, + .var05 = 6, + .var06 = 6, + .var08 = 0x800, + .var0C = 0x800, + .var10 = 0x2010, + }, + { + .var00 = 1, + .var01_0 = 12, + .var01_4 = 2, + .var02 = 2, + .var03 = 20, + .var04 = 13, + .var05 = 6, + .var06 = 6, + .var08 = 0x1000, + .var0C = 0x1000, + .var10 = 0x2002, + }, + { + .var00 = 10, + .var01_0 = 12, + .var01_4 = 3, + .var02 = 2, + .var03 = 23, + .var04 = 13, + .var05 = 6, + .var06 = 6, + .var08 = 0x2000, + .var0C = 0x2000, + .var10 = 0x2400, + }, + { + .var00 = 7, + .var01_0 = 12, + .var01_4 = 4, + .var02 = 2, + .var03 = 26, + .var04 = 13, + .var05 = 6, + .var06 = 6, + .var08 = 0x4000, + .var0C = 0x4000, + .var10 = 0x2080, + }, + { + .var00 = 18, + .var01_0 = 3, + .var01_4 = 0, + .var02 = 3, + .var03 = 14, + .var04 = 16, + .var05 = 6, + .var06 = 18, + .var08 = 0x8000, + .var0C = 0xF8000, + .var10 = 0x924, + }, + { + .var00 = 8, + .var01_0 = 12, + .var01_4 = 1, + .var02 = 3, + .var03 = 17, + .var04 = 16, + .var05 = 9, + .var06 = 9, + .var08 = 0x10000, + .var0C = 0x10000, + .var10 = 0x2100, + }, + { + .var00 = 5, + .var01_0 = 12, + .var01_4 = 2, + .var02 = 3, + .var03 = 20, + .var04 = 16, + .var05 = 9, + .var06 = 9, + .var08 = 0x20000, + .var0C = 0x20000, + .var10 = 0x2020, + }, + { + .var00 = 2, + .var01_0 = 12, + .var01_4 = 3, + .var02 = 3, + .var03 = 23, + .var04 = 16, + .var05 = 9, + .var06 = 9, + .var08 = 0x40000, + .var0C = 0x40000, + .var10 = 0x2004, + }, + { + .var00 = 11, + .var01_0 = 12, + .var01_4 = 4, + .var02 = 3, + .var03 = 26, + .var04 = 16, + .var05 = 9, + .var06 = 9, + .var08 = 0x80000, + .var0C = 0x80000, + .var10 = 0x2800, + }, +}; + +static const struct StructgUnknown_083F8D90 gUnknown_085B62E4[] = +{ + { + .var00 = 0, + .var01 = 1, + .var02 = 6, + .var04 = 0x40, + }, + { + .var00 = 1, + .var01 = 3, + .var02 = 12, + .var04 = 0x1000, + }, + { + .var00 = 2, + .var01 = 5, + .var02 = 18, + .var04 = 0x40000, + }, + { + .var00 = 3, + .var01 = 7, + .var02 = 9, + .var04 = 0x200, + }, + { + .var00 = 4, + .var01 = 9, + .var02 = 11, + .var04 = 0x800, + }, + { + .var00 = 5, + .var01 = 11, + .var02 = 17, + .var04 = 0x20000, + }, + { + .var00 = 6, + .var01 = 13, + .var02 = 8, + .var04 = 0x100, + }, + { + .var00 = 7, + .var01 = 15, + .var02 = 14, + .var04 = 0x4000, + }, + { + .var00 = 8, + .var01 = 17, + .var02 = 16, + .var04 = 0x10000, + }, + { + .var00 = 9, + .var01 = 19, + .var02 = 7, + .var04 = 0x80, + }, + { + .var00 = 10, + .var01 = 21, + .var02 = 13, + .var04 = 0x2000, + }, + { + .var00 = 11, + .var01 = 23, + .var02 = 19, + .var04 = 0x80000, + }, +}; +static const u8 gUnknown_085B6344[] = {1, 3, 1, 6}; +static const struct StructgUnknown_083F8DF4 gUnknown_085B6348[] = +{ + { + .var00 = 1, + .var01 = 60, + .var02 = 30, + .var03 = 1, + .var04 = 1, + .var08 = 45, + .var0A = 30, + .var0C = 1, + .var10 = 75, + .var12 = 27, + .var14 = 24, + .var18 = 10, + .var1A = 360, + .var1C = -0.5f + }, + { + .var00 = 3, + .var01 = 30, + .var02 = 15, + .var03 = 1, + .var04 = 0, + .var08 = 75, + .var0A = 60, + .var0C = 2, + .var10 = 0, + .var12 = 54, + .var14 = 48, + .var18 = 10, + .var1A = 270, + .var1C = -1.0f + } +}; + +static const struct UnkStruct1 gUnknown_085B6388[] = +{ + { + .var00 = 0x8000, + .var02 = 0x0005, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x000A, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x0015, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x0055, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x005A, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x0065, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x0075, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x007A, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x0085, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x0095, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x009A, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x8000, + .var02 = 0x00A5, + .var04 = 1, + .var05 = 1, + .var06 = 0xFF, + .var07_0 = 8, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x77D6, + .var02 = 0x0028, + .var04 = 2, + .var05 = 10, + .var06 = 0xFF, + .var07_0 = 14, + .var07_5 = 2, + .var07_7 = 0 + }, +}; + +static const struct UnkStruct1 gUnknown_085B63F0[] = +{ + { + .var00 = 0x53FF, + .var02 = 0x0101, + .var04 = 5, + .var05 = 30, + .var06 = 0xFF, + .var07_0 = 14, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x7FFB, + .var02 = 0x0106, + .var04 = 5, + .var05 = 30, + .var06 = 0xFF, + .var07_0 = 14, + .var07_5 = 2, + .var07_7 = 0 + }, + { + .var00 = 0x7F7F, + .var02 = 0x010B, + .var04 = 5, + .var05 = 30, + .var06 = 0xFF, + .var07_0 = 14, + .var07_5 = 2, + .var07_7 = 0 + } +}; + +static const struct YesNoFuncTable gUnknown_085B6408 = +{ + sub_8142918, + sub_814297C +}; + +static const struct YesNoFuncTable gUnknown_085B6410 = +{ + sub_8140968, + sub_8140994 +}; + void sub_8140238(void) { RunTasks(); @@ -324,9 +931,8 @@ void sub_8140418(void) void sub_8140470(void) { u8 i; - u16 arr[3]; // the third is never used ? + u16 arr[3] = {RGB(24, 4, 10), RGB(10, 19, 6), RGB(24, 4, 10)}; // the third is never used ? - memcpy(arr, &gUnknown_085B6418, sizeof(arr)); gUnknown_0203AB88->var04_0 = (gSpecialVar_0x8004 & 1); if (gSpecialVar_0x8004 & 0x80) @@ -588,10 +1194,9 @@ u8 sub_8140CA8(s16 *r0, u8 r1) { s8 temp1 = 0; s8 temp = 0; - s8 arr[4]; + s8 arr[4] = {-5, 5, -1, 1}; s8 t; - memcpy(&arr, gUnknown_085B641E, sizeof(arr)); t = *r0; switch (r1) @@ -838,9 +1443,8 @@ void sub_8141344(u8 taskId) u16 g = 0; u16 rand; u16 randmod; - u16 angles[4]; // angles in 90 degree steps + u16 angles[4] = {0, 180, 90, 270}; // angles in 90 degree steps - memcpy(angles, &gUnknown_085B6422, sizeof(angles)); rand = Random(); randmod = rand % 100; gUnknown_0203AB88->var7C = gTasks[taskId].data[6]; @@ -875,6 +1479,7 @@ void sub_8141344(u8 taskId) gTasks[taskId].func = sub_814155C; } #else +static const u16 gUnknown_085B6422[4] = {0, 180, 90, 270}; NAKED void sub_8141344(u8 taskId) { @@ -1507,12 +2112,9 @@ u8 sub_81420D0(u8 taskId, u8 r1) { u8 i; u8 z; - u32 t0[4]; - u32 t1[3]; + u32 t0[4] = {0x10842, 0x21084, 0x42108, 0x84210}; + u32 t1[3] = {0x3E0, 0x7C00, 0xF8000}; - memcpy(t0, gUnknown_085B642C, sizeof(t0)); - memcpy(t1, gUnknown_085B643C, sizeof(t1)); - if (r1 > 11) return 0; @@ -1694,8 +2296,7 @@ void sub_81424FC(u8 r0) u8 sub_8142758(u8 r0) { - u8 var0[5]; - memcpy(var0, gUnknown_085B6448, sizeof(var0)); + u8 var0[5] = {0, 3, 4, 6, 12}; if (r0 > 19) r0 = 0; @@ -1845,6 +2446,988 @@ void PlayRoulette(void) gTasks[taskId].data[13] = GetCoins(); } +static const u8 sFiller_085B644D[3] = {}; +static const u16 RouletteSpritePalette_01[] = INCBIN_U16("graphics/roulette/shadow.gbapal"); +static const u16 RouletteSpritePalette_02[] = INCBIN_U16("graphics/roulette/ball.gbapal"); +static const u16 RouletteSpritePalette_03[] = INCBIN_U16("graphics/roulette/ball_counter.gbapal"); +static const u16 RouletteSpritePalette_04[] = INCBIN_U16("graphics/roulette/cursor.gbapal"); +static const u16 RouletteSpritePalette_05[] = INCBIN_U16("graphics/roulette/credit.gbapal"); +static const u16 RouletteSpritePalette_06[] = INCBIN_U16("graphics/roulette/shroomish.gbapal"); +static const u16 RouletteSpritePalette_07[] = INCBIN_U16("graphics/roulette/tailow.gbapal"); +static const u16 RouletteSpritePalette_08[] = INCBIN_U16("graphics/roulette/poke_icons.gbapal"); +static const u16 RouletteSpritePalette_09[] = INCBIN_U16("graphics/roulette/wynaut.gbapal"); +static const u16 RouletteSpritePalette_10[] = INCBIN_U16("graphics/roulette/azurill.gbapal"); +static const u16 RouletteSpritePalette_11[] = INCBIN_U16("graphics/roulette/skitty.gbapal"); +static const u16 RouletteSpritePalette_12[] = INCBIN_U16("graphics/roulette/makuhita.gbapal"); +static const u16 RouletteSpritePalette_13[] = INCBIN_U16("graphics/roulette/85B65D0.gbapal"); +static const u16 RouletteSpritePalette_14[] = INCBIN_U16("graphics/roulette/85B65F0.gbapal"); +static const u16 RouletteSpritePalette_15[] = INCBIN_U16("graphics/roulette/85B6610.gbapal"); +static const u16 RouletteSpritePalette_16[] = INCBIN_U16("graphics/roulette/85B6630.gbapal"); +static const u32 gUnknown_085B6650[] = INCBIN_U32("graphics/roulette/ball.4bpp.lz"); +static const u32 RouletteBallCounterTiles[] = INCBIN_U32("graphics/roulette/ball_counter.4bpp.lz"); +static const u32 gUnknown_085B67FC[] = INCBIN_U32("graphics/roulette/roulette_tilt.4bpp.lz"); +static const u32 RoulettePokeIconsTiles[] = INCBIN_U32("graphics/roulette/poke_icons.4bpp.lz"); +static const u32 RoulettePokeIcons2Tiles[] = INCBIN_U32("graphics/roulette/poke_icons2.4bpp.lz"); +static const u32 gUnknown_085B7290[] = INCBIN_U32("graphics/roulette/shadow.4bpp.lz"); +static const u32 RouletteCursorTiles[] = INCBIN_U32("graphics/roulette/cursor.4bpp.lz"); + +static const struct SpritePalette gUnknown_085B7384[] = +{ + { RouletteSpritePalette_01, 1 }, + { RouletteSpritePalette_02, 2 }, + { RouletteSpritePalette_03, 3 }, + { RouletteSpritePalette_04, 4 }, + { RouletteSpritePalette_05, 5 }, + { RouletteSpritePalette_06, 6 }, + { RouletteSpritePalette_07, 7 }, + { RouletteSpritePalette_08, 8 }, + { RouletteSpritePalette_09, 9 }, + { RouletteSpritePalette_10, 10 }, + { RouletteSpritePalette_11, 11 }, + { RouletteSpritePalette_12, 12 }, + {} +}; + +static const struct OamData gOamData_85B73EC = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 2, + .priority = 1, +}; + +static const struct OamData gOamData_85B73F4 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 1, + .priority = 1, +}; + +static const struct OamData gOamData_85B73FC = +{ + .y = 60, + .affineMode = ST_OAM_AFFINE_DOUBLE, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_V_RECTANGLE, + .size = 2, + .priority = 2, +}; + +static const union AnimCmd gSpriteAnim_85B7404[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B740C[] = { + gSpriteAnim_85B7404 +}; + +static const union AffineAnimCmd gSpriteAffineAnim_85B7410[] = { + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const gSpriteAffineAnimTable_85B7418[] = { + gSpriteAffineAnim_85B7410 +}; + +extern const u32 RoulettePokeIcons2Tiles[]; +static const struct CompressedSpriteSheet gUnknown_085B741C = { + .data = RoulettePokeIcons2Tiles, + .size = 0xC00, + .tag = 0 +}; + +static const union AnimCmd gSpriteAnim_85B7420[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_FRAME(32, 0), + ANIMCMD_FRAME(64, 0), + ANIMCMD_FRAME(72, 0), + ANIMCMD_FRAME(8, 0), + ANIMCMD_FRAME(40, 0), + ANIMCMD_FRAME(48, 0), + ANIMCMD_FRAME(80, 0), + ANIMCMD_FRAME(16, 0), + ANIMCMD_FRAME(24, 0), + ANIMCMD_FRAME(56, 0), + ANIMCMD_FRAME(88, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7458[] = { + &gSpriteAnim_85B7420[0] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B745C[] = { + &gSpriteAnim_85B7420[1] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7460[] = { + &gSpriteAnim_85B7420[2] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7464[] = { + &gSpriteAnim_85B7420[3] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7468[] = { + &gSpriteAnim_85B7420[4] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B746C[] = { + &gSpriteAnim_85B7420[5] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7470[] = { + &gSpriteAnim_85B7420[6] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7474[] = { + &gSpriteAnim_85B7420[7] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7478[] = { + &gSpriteAnim_85B7420[8] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B747C[] = { + &gSpriteAnim_85B7420[9] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7480[] = { + &gSpriteAnim_85B7420[10] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7484[] = { + &gSpriteAnim_85B7420[11] +}; + +extern const u32 gRouletteHeadersTiles[]; +static const struct CompressedSpriteSheet gUnknown_085B7488 = { + .data = gRouletteHeadersTiles, + .size = 0x1600, + .tag = 4 +}; + +extern const u32 RoulettePokeIconsTiles[]; +static const struct CompressedSpriteSheet gUnknown_085B7490 = { + .data = RoulettePokeIconsTiles, + .size = 0x400, + .tag = 5 +}; + +static const union AnimCmd gSpriteAnim_85B7498[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_FRAME(16, 0), + ANIMCMD_FRAME(32, 0), + ANIMCMD_FRAME(48, 0), + ANIMCMD_FRAME(64, 0), + ANIMCMD_FRAME(80, 0), + ANIMCMD_FRAME(96, 0), + ANIMCMD_FRAME(112, 0), + ANIMCMD_FRAME(128, 0), + ANIMCMD_FRAME(144, 0), + ANIMCMD_FRAME(160, 0), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B74C8[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_FRAME(4, 0), + ANIMCMD_FRAME(8, 0), + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74DC[] = { + &gSpriteAnim_85B7498[0] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74E0[] = { + &gSpriteAnim_85B7498[2] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74E4[] = { + &gSpriteAnim_85B7498[4] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74E8[] = { + &gSpriteAnim_85B7498[6] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74EC[] = { + &gSpriteAnim_85B7498[8] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74F0[] = { + &gSpriteAnim_85B7498[9] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74F4[] = { + &gSpriteAnim_85B7498[10] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74F8[] = { + &gSpriteAnim_85B74C8[0] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B74FC[] = { + &gSpriteAnim_85B74C8[1] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7500[] = { + &gSpriteAnim_85B74C8[2] +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7504[] = { + &gSpriteAnim_85B74C8[3] +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7508[] = +{ + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74DC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74E0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74E4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74E8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + } +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7568[] = +{ + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74EC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74F0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 4, + .paletteTag = 8, + .oam = &gOamData_85B73EC, + .anims = gSpriteAnimTable_85B74F4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + } +}; + +static const struct SpriteTemplate gSpriteTemplate_85B75B0[] = +{ + { + .tileTag = 5, + .paletteTag = 8, + .oam = &gOamData_85B73F4, + .anims = gSpriteAnimTable_85B74F8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 5, + .paletteTag = 8, + .oam = &gOamData_85B73F4, + .anims = gSpriteAnimTable_85B74FC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 5, + .paletteTag = 8, + .oam = &gOamData_85B73F4, + .anims = gSpriteAnimTable_85B7500, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + }, + { + .tileTag = 5, + .paletteTag = 8, + .oam = &gOamData_85B73F4, + .anims = gSpriteAnimTable_85B7504, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C + } +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7610[] = +{ + { + .tileTag = 0, + .paletteTag = 9, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7458, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 10, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B745C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 11, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7460, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 12, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7464, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 9, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7468, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 10, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B746C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 11, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7470, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 12, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7474, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 9, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7478, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 10, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B747C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 11, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7480, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + }, + { + .tileTag = 0, + .paletteTag = 12, + .oam = &gOamData_85B73FC, + .anims = gSpriteAnimTable_85B7484, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8143280 + } +}; + +extern const struct OamData gOamData_85B73EC; +static const struct OamData gOamData_85B7730 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_H_RECTANGLE, + .size = 3, + .priority = 1, +}; + +static const struct OamData gOamData_85B7738 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_V_RECTANGLE, + .size = 0, + .priority = 1, +}; + +static const struct OamData gOamData_85B7740 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_H_RECTANGLE, + .size = 2, + .priority = 1, +}; + +static const struct OamData gOamData_85B7748 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_H_RECTANGLE, + .size = 0, + .priority = 1, +}; + +extern const u32 gRouletteCreditTiles[]; +extern const u32 gRouletteNumbersTiles[]; +extern const u32 gRouletteMultiplierTiles[]; +extern const u32 RouletteBallCounterTiles[]; +extern const u32 RouletteCursorTiles[]; +static const struct CompressedSpriteSheet gUnknown_085B7750[] = +{ + { + .data = gRouletteCreditTiles, + .size = 0x400, + .tag = 7 + }, + { + .data = gRouletteNumbersTiles, + .size = 0x280, + .tag = 8 + }, + { + .data = gRouletteMultiplierTiles, + .size = 0x500, + .tag = 9 + }, + { + .data = RouletteBallCounterTiles, + .size = 0x140, + .tag = 10 + }, + { + .data = RouletteCursorTiles, + .size = 0x200, + .tag = 11 + }, + {} +}; + +static const union AnimCmd gSpriteAnim_85B7780[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_FRAME(2, 0), + ANIMCMD_FRAME(4, 0), + ANIMCMD_FRAME(6, 0), + ANIMCMD_FRAME(8, 0), + ANIMCMD_FRAME(10, 0), + ANIMCMD_FRAME(12, 0), + ANIMCMD_FRAME(14, 0), + ANIMCMD_FRAME(16, 0), + ANIMCMD_FRAME(18, 0), + // BUG: Animation not terminated properly + //ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B77A8[] = { + gSpriteAnim_85B7780 +}; + +static const union AnimCmd gSpriteAnim_85B77AC[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_FRAME(8, 0), + ANIMCMD_FRAME(16, 0), + ANIMCMD_FRAME(24, 0), + ANIMCMD_FRAME(32, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B77C4[] = { + gSpriteAnim_85B77AC +}; + +static const union AnimCmd gSpriteAnim_85B77C8[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_FRAME(2, 0), + ANIMCMD_FRAME(4, 0), + ANIMCMD_FRAME(6, 0), + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B77E0[] = { + gSpriteAnim_85B77C8 +}; + +static const struct SpriteTemplate gSpriteTemplate_85B77E4 = +{ + .tileTag = 7, + .paletteTag = 5, + .oam = &gOamData_85B7730, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct SpriteTemplate gUnknown_085B77FC = +{ + .tileTag = 8, + .paletteTag = 5, + .oam = &gOamData_85B7738, + .anims = gSpriteAnimTable_85B77A8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct SpriteTemplate gUnknown_085B7814 = +{ + .tileTag = 9, + .paletteTag = 5, + .oam = &gOamData_85B7740, + .anims = gSpriteAnimTable_85B77C4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814390C +}; + +static const struct SpriteTemplate gUnknown_085B782C = +{ + .tileTag = 10, + .paletteTag = 3, + .oam = &gOamData_85B7748, + .anims = gSpriteAnimTable_85B77E0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct SpriteTemplate gUnknown_085B7844 = +{ + .tileTag = 11, + .paletteTag = 5, + .oam = &gOamData_85B73EC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct OamData gOamData_85B785C = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 1, + .priority = 2, +}; + +extern const u32 gUnknown_085B6650[]; +static const struct CompressedSpriteSheet gUnknown_085B7864 = { + .data = gUnknown_085B6650, + .size = 0x200, + .tag = 12 +}; + +static const union AnimCmd gSpriteAnim_85B786C[] = { + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(8, 5), + ANIMCMD_FRAME(4, 5), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd gSpriteAnim_85B7880[] = { + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(4, 10), + ANIMCMD_FRAME(8, 10), + ANIMCMD_FRAME(4, 10), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd gSpriteAnim_85B7894[] = { + ANIMCMD_FRAME(0, 15), + ANIMCMD_FRAME(4, 15), + ANIMCMD_FRAME(8, 15), + ANIMCMD_FRAME(4, 15), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd gSpriteAnim_85B78A8[] = { + ANIMCMD_FRAME(4, 2), + ANIMCMD_FRAME(8, 5), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(12, 5), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B78BC[] = { + ANIMCMD_FRAME(4, 2), + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(12, 4), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B78D4[] = { + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(8, 5), + ANIMCMD_FRAME(12, 5), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B78E8[] = { + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B78F0[] = { + ANIMCMD_FRAME(8, 2), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(12, 5), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7904[] = { + gSpriteAnim_85B786C, + gSpriteAnim_85B7880, + gSpriteAnim_85B7894, + gSpriteAnim_85B78A8, + gSpriteAnim_85B78F0, + gSpriteAnim_85B78BC, + gSpriteAnim_85B78D4, + gSpriteAnim_85B78D4, + gSpriteAnim_85B78E8 +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7928 = +{ + .tileTag = 12, + .paletteTag = 2, + .oam = &gOamData_85B785C, + .anims = gSpriteAnimTable_85B7904, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct OamData gOamData_85B7940 = +{ + .y = 81, + .affineMode = ST_OAM_AFFINE_DOUBLE, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 3, + .priority = 2, +}; + +extern const u32 gRouletteCenter_Gfx[]; +static const struct CompressedSpriteSheet gUnknown_085B7948 = { + .data = gRouletteCenter_Gfx, + .size = 0x800, + .tag = 6 +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7950 = +{ + .tileTag = 6, + .paletteTag = 2, + .oam = &gOamData_85B7940, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_814399C +}; + +static const struct OamData gOamData_85B7968 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 2, + .priority = 2, +}; + +static const struct OamData gOamData_85B7970 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 2, + .priority = 2, +}; + +extern const u32 gUnknown_085B67FC[]; +static const struct CompressedSpriteSheet gUnknown_085B7978 = { + .data = gUnknown_085B67FC, + .size = 0xE00, + .tag = 13 +}; + +static const union AnimCmd gSpriteAnim_85B7980[] = { + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(16, 6), + ANIMCMD_FRAME(32, 6), + ANIMCMD_FRAME(48, 6), + ANIMCMD_FRAME(32, 6), + ANIMCMD_FRAME(64, 6), + ANIMCMD_JUMP(2) +}; + +static const union AnimCmd gSpriteAnim_85B799C[] = { + ANIMCMD_FRAME(80, 10), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B79A4[] = { + ANIMCMD_FRAME(80, 10, .hFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B79AC[] = { + ANIMCMD_FRAME(80, 20), + ANIMCMD_FRAME(96, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd gSpriteAnim_85B79B8[] = { + ANIMCMD_FRAME(80, 20, .hFlip = TRUE), + ANIMCMD_FRAME(96, 20, .hFlip = TRUE), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd gSpriteAnim_85B79C4[] = { + ANIMCMD_FRAME(80, 10), + ANIMCMD_FRAME(96, 10), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd gSpriteAnim_85B79D0[] = { + ANIMCMD_FRAME(80, 10, .hFlip = TRUE), + ANIMCMD_FRAME(96, 10, .hFlip = TRUE), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const gSpriteAnimTable_85B79DC[] = { + gSpriteAnim_85B7980 +}; + +static const union AnimCmd *const gSpriteAnimTable_85B79E0[] = { + gSpriteAnim_85B799C, + gSpriteAnim_85B79A4, + gSpriteAnim_85B79AC, + gSpriteAnim_85B79B8, + gSpriteAnim_85B79C4, + gSpriteAnim_85B79D0 +}; + +static const struct SpriteTemplate gSpriteTemplate_85B79F8 = +{ + .tileTag = 13, + .paletteTag = 6, + .oam = &gOamData_85B7968, + .anims = gSpriteAnimTable_85B79DC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7A10 = +{ + .tileTag = 13, + .paletteTag = 7, + .oam = &gOamData_85B7970, + .anims = gSpriteAnimTable_85B79E0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8145294 +}; + +static const struct OamData gOamData_85B7A28 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_SQUARE, + .size = 1, + .priority = 2, +}; + +static const struct OamData gOamData_85B7A30 = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_H_RECTANGLE, + .size = 2, + .priority = 2, +}; + +static const struct OamData gOamData_85B7A38 = +{ + .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = ST_OAM_H_RECTANGLE, + .size = 2, + .priority = 2, +}; +extern const u32 gUnknown_085B7290[]; +static const struct CompressedSpriteSheet gUnknown_085B7A40 = { + .data = gUnknown_085B7290, + .size = 0x180, + .tag = 14 +}; + +static const union AffineAnimCmd gSpriteAffineAnim_85B7A48[] = { + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(2, 2, 0, 60), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd gSpriteAffineAnim_85B7A60[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(-2, 0x0, 0, 15), + AFFINEANIMCMD_FRAME(-1, -2, 0, 15), + AFFINEANIMCMD_FRAME(-1, -5, 0, 24), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const gSpriteAffineAnimTable_85B7A88[] = { + gSpriteAffineAnim_85B7A48 +}; + +static const union AffineAnimCmd *const gSpriteAffineAnimTable_85B7A8C[] = { + gSpriteAffineAnim_85B7A60 +}; + +static const union AffineAnimCmd gSpriteAffineAnim_85B7A90[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const gSpriteAffineAnimTable_85B7AA0[] = { + gSpriteAffineAnim_85B7A90 +}; + +static const union AnimCmd gSpriteAnim_85B7AA4[] = { + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_85B7AAC[] = { + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7AB4[] = { + gSpriteAnim_85B7AA4 +}; + +static const union AnimCmd *const gSpriteAnimTable_85B7AB8[] = { + gSpriteAnim_85B7AAC +}; + +static const struct SpriteTemplate gSpriteTemplate_85B7ABC[] = +{ + { + .tileTag = 14, + .paletteTag = 1, + .oam = &gOamData_85B7A28, + .anims = gSpriteAnimTable_85B7AB4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy + }, + { + .tileTag = 14, + .paletteTag = 1, + .oam = &gOamData_85B7A30, + .anims = gSpriteAnimTable_85B7AB8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8144E60 + } +}; + +static const struct SpriteTemplate gUnknown_085B7AEC = +{ + .tileTag = 14, + .paletteTag = 1, + .oam = &gOamData_85B7A38, + .anims = gSpriteAnimTable_85B7AB8, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_85B7A8C, + .callback = sub_8145294 +}; + void sub_8142C0C(u8 r0) { if (!r0) @@ -2116,9 +3699,8 @@ void sub_8143514(u16 r0) u8 sub_8143614(u8 r0) { - u8 t[5]; - memcpy(t, gUnknown_085B7B04, sizeof(t)); - + u8 t[5] = {0, 1, 2, 3, 4}; + if (r0 >= 20) r0 = 0; switch (gUnknown_085B6154[r0].var01_0) @@ -2703,10 +4285,12 @@ void sub_81446DC(struct Sprite *sprite) { u16 t; u8 i; - s16 s[2][2]; + s16 s[2][2] = { + {116, 44}, + {116, 112} + }; struct Roulette *p; - memcpy(s, gUnknown_085B7B0A, sizeof(s)); t = sprite->data[7] - 2; p = gUnknown_0203AB88; // why??? gUnknown_0203AB88->var3C[55] = CreateSprite(&gSpriteTemplate_85B79F8, 36, -12, 50); @@ -2734,9 +4318,11 @@ void sub_81448B8(struct Sprite *sprite) { u8 i = 0; s16 t; - s16 s[2][2]; + s16 s[2][2] = { + {256, 84}, + {-16, 84} + }; - memcpy(s, &gUnknown_085B7B12, sizeof(s)); t = sprite->data[7] - 2; gUnknown_0203AB88->var3C[55] = CreateSprite(&gSpriteTemplate_85B7A10, s[sprite->data[0]][0], s[sprite->data[0]][1], 50); StartSpriteAnim(&gSprites[gUnknown_0203AB88->var3C[55]], sprite->data[0]); @@ -3140,6 +4726,19 @@ _08144C54:\n\ } #endif // NONMATCHING +const u16 gUnknown_085B7B1A[] = { + 0x907, + 0x808, + 0x709, + 0x60A, + 0x50B, + 0x40C, + 0x30D, + 0x20E, + 0x10F, + 0x010, +}; + void sub_8144C70(struct Sprite *sprite) { if (sprite->data[1]++ >= sprite->data[3]) @@ -3158,10 +4757,13 @@ void sub_8144C70(struct Sprite *sprite) void sub_8144CD0(struct Sprite *sprite) { - u16 t[3][4]; int p; + u16 t[][4] = { + {-1, 0, 1, 0}, + {-2, 0, 2, 0}, + {-3, 0, 3, 0}, + }; - memcpy(t, gUnknown_085B7B2E, 24); if (sprite->data[1]++ < sprite->data[3]) { if (sprite->data[1] & 1) @@ -3201,58 +4803,6 @@ void sub_8144D94(struct Sprite *sprite) } } -/*void sub_8144E60(struct Sprite *sprite) -{ - register u32 t asm("r2"); - u32 z; - if (sprite->data[7] == 0) - { - if (gUnknown_0203AB88->var38->data[0] == 0) - { - t = gUnknown_0203AB88->var38->data[3]; - z = gUnknown_085B6348[gUnknown_0203AB88->var04_0].var08; - } - else - { - t = gUnknown_0203AB88->var38->data[3]; - z = gUnknown_085B6348[gUnknown_0203AB88->var04_0].var08; - z += 180; - } - if (t == z) - { - sprite->invisible = FALSE; - sprite->data[7]++; - m4aSongNumStart(SE_RU_HYUU); - gUnknown_0203AB88->var01 = 1; - gUnknown_0203AB88->var34 = gUnknown_085B7B1A[0]; - } - } - else - { - gUnknown_0203AB88->var34 = gUnknown_085B7B1A[(gUnknown_0203AB88->var01 - 1) / 2]; - if (gUnknown_0203AB88->var01 < 19) - gUnknown_0203AB88->var01++; - if (gUnknown_0203AB88->var38->data[0] == 0) - { - t = gUnknown_0203AB88->var38->data[3]; - z = gUnknown_085B6348[gUnknown_0203AB88->var04_0].var0A; - } - else - { - t = gUnknown_0203AB88->var38->data[3]; - z = gUnknown_085B6348[gUnknown_0203AB88->var04_0].var0A; - z += 180; - } - if (t == z) - { - gSprites[sprite->data[4]].callback = sub_8144D94; - gSprites[sprite->data[4]].invisible = FALSE; - sprite->callback = &SpriteCallbackDummy; - sprite->data[7] = 0; - } - } -}*/ - void sub_8144E60(struct Sprite *sprite) { if (sprite->data[7] == 0) @@ -3355,11 +4905,18 @@ void sub_8145030(struct Sprite *sprite) void sub_81450D8(struct Sprite *sprite) { - s8 t[2]; //sign - s8 z[8][2]; + s8 t[2] = {-1, 1}; + s8 z[][2] = { + {2, 0}, + {2, 0}, + {2, -1}, + {2, -1}, + {2, -1}, + {2, -1}, + {2, -2}, + {2, -2}, + }; - memcpy(t, gUnknown_085B7B46, sizeof(t)); - memcpy(z, gUnknown_085B7B48, sizeof(z)); if (sprite->data[1]-- > 7) { sprite->pos1.x += t[gUnknown_0203AB88->var38->data[0]] * 2; @@ -3393,8 +4950,8 @@ void sub_81450D8(struct Sprite *sprite) void sub_8145218(struct Sprite *sprite) { - s8 t[2]; //sign - memcpy(t, gUnknown_085B7B46, sizeof(t)); + s8 t[2] = {-1, 1}; + if (sprite->data[1]-- >= 0) { sprite->pos1.x += t[gUnknown_0203AB88->var38->data[0]] * 2;