Move Atk sprites to Frame Buffer from RAM
Jump to navigation
Jump to search
00085a18: 27bdffc8 addiu r29,r29,0xffc8 00085a1c: afb40028 sw r20,0x0028(r29) 00085a20: 0080a021 addu r20,r4,r0 misc. data pointer 00085a24: afb20020 sw r18,0x0020(r29) 00085a28: 00a09021 addu r18,r5,r0 No. invalid units so far? (0xff) 00085a2c: 00061100 sll r2,r6,0x04 first/second unit? 00085a30: 00461023 subu r2,r2,r6 00085a34: 000210c0 sll r2,r2,0x03 00085a38: 00461023 subu r2,r2,r6 00085a3c: 00021080 sll r2,r2,0x02 00085a40: 00461021 addu r2,r2,r6 00085a44: afb30024 sw r19,0x0024(r29) 00085a48: 00029980 sll r19,r2,0x06 00085a4c: 02629823 subu r19,r19,r2 00085a50: 02669821 addu r19,r19,r6 first/second unit * 0x7564 (that looks familiar) 00085a54: afb1001c sw r17,0x001c(r29) 00085a58: 3c11800b lui r17,0x800b 00085a5c: 26318928 addiu r17,r17,0x8928 0x800a8928 00085a60: afb5002c sw r21,0x002c(r29) 00085a64: 0271a821 addu r21,r19,r17 0x800a8928 + 0 (if first unit) or 0x7564 (if second unit) 00085a68: afbf0030 sw r31,0x0030(r29) 00085a6c: afb00018 sw r16,0x0018(r29) 00085a70: 92830005 lbu r3,0x0005(r20) Load spritesheet VRAM slot 00085a74: 02a02821 addu r5,r21,r0 00085a78: 00031100 sll r2,r3,0x04 00085a7c: 00431023 subu r2,r2,r3 VRAM slot * 0xf 00085a80: 00021100 sll r2,r2,0x04 00085a84: 00431021 addu r2,r2,r3 VRAM * F1 00085a88: 00022080 sll r4,r2,0x02 00085a8c: 00822023 subu r4,r4,r2 VRAM * 2D3 00085a90: 000410c0 sll r2,r4,0x03 00085a94: 00822021 addu r4,r4,r2 VRAM * 196B 00085a98: 00042040 sll r4,r4,0x01 VRAM * 32D6 00085a9c: 3c02800c lui r2,0x800c 00085aa0: 24427cea addiu r2,r2,0x7cea 00085aa4: 0c01ea8d jal 0x0007aa34 I'm deep enough already. something VRAM. 0007aa34 - 0007abcc 00085aa8: 00822021 addu r4,r4,r2 0x800c7cea + VRAM slot ID * 32D6 00085aac: 00121100 sll r2,r18,0x04 00085ab0: 00521023 subu r2,r2,r18 00085ab4: 000210c0 sll r2,r2,0x03 00085ab8: 00521023 subu r2,r2,r18 00085abc: 00021080 sll r2,r2,0x02 00085ac0: 00521021 addu r2,r2,r18 00085ac4: 00028180 sll r16,r2,0x06 00085ac8: 02028023 subu r16,r16,r2 00085acc: 02128021 addu r16,r16,r18 No. invalid units * 0x7564 00085ad0: 2631eea8 addiu r17,r17,0xeea8 0x800a77d0 00085ad4: 02112021 addu r4,r16,r17 0x800a77d0 + No. invalid units * 0x7564 00085ad8: 0c00923f jal 0x000248fc ? 0x248fc 00085adc: 02a02821 addu r5,r21,r0 0x800a8928 + 0 (if first unit) or 0x7564 (if second unit) 00085ae0: 92820005 lbu r2,0x0005(r20) VRAM slot ID 00085ae4: 27a40010 addiu r4,r29,0x0010 00085ae8: 000210c2 srl r2,r2,0x03 ignores VRAM slots 0 -> 7(map, active unit sprite sheet, formation screen, the last loaded menu and the billboard) 00085aec: 00021180 sll r2,r2,0x06 VRAM slot ID * 8 00085af0: 24420340 addiu r2,r2,0x0340 VRAM slot ID * 8 + 0x340 00085af4: a7a20010 sh r2,0x0010(r29) store in 0x10 stack 00085af8: 92820005 lbu r2,0x0005(r20) 00085afc: 34030040 ori r3,r0,0x0040 00085b00: a7a30014 sh r3,0x0014(r29) store 0x40 in 0x14 stack 00085b04: 34030020 ori r3,r0,0x0020 00085b08: a7a30016 sh r3,0x0016(r29) store 0x20 in 0x16 stack 00085b0c: 30420007 andi r2,r2,0x0007 grabs only the first 7 VRAM slots 00085b10: 00021140 sll r2,r2,0x05 VRAM slot ID * 0x20 00085b14: 24420100 addiu r2,r2,0x0100 VRAM slot ID * 0x20 + 0x100 00085b18: a7a20012 sh r2,0x0012(r29) store in 0x12 stack 00085b1c: 3c01800a lui r1,0x800a 00085b20: 00300821 addu r1,r1,r16 0x800a0000 + No. invalid units * 0x7564 00085b24: 842677d2 lh r6,0x77d2(r1) ? (unless negative, just treated as 0?) 00085b28: 3c01800a lui r1,0x800a 00085b2c: 00300821 addu r1,r1,r16 0x800a0000 + No. invalid units * 0x7564 00085b30: 842577d0 lh r5,0x77d0(r1) ? 00085b34: 0c009271 jal 0x000249c4 ? 0x249c4 00085b38: 24c600c8 addiu r6,r6,0x00c8 00085b3c: 92820004 lbu r2,0x0004(r20) Misc unit ID 00085b40: 34030001 ori r3,r0,0x0001 1 00085b44: 3c018004 lui r1,0x8004 00085b48: ac235990 sw r3,0x5990(r1) store 1 at 0x80045990 00085b4c: 34420080 ori r2,r2,0x0080 enable flag 0x80? (ooh, first case I've seen this!) 00085b50: 3c01800a lui r1,0x800a 00085b54: 00300821 addu r1,r1,r16 00085b58: ac2277c4 sw r2,0x77c4(r1) store at 0x800a77c4 (yada yada no. invalid units) 00085b5c: 34020002 ori r2,r0,0x0002 00085b60: 3c01800a lui r1,0x800a 00085b64: 00330821 addu r1,r1,r19 00085b68: ac2277c8 sw r2,0x77c8(r1) store 0x2 at 0x800a77c8 (yada yada first/second unit) 00085b6c: 3c01800a lui r1,0x800a 00085b70: 00300821 addu r1,r1,r16 00085b74: ac2377cc sw r3,0x77cc(r1) store 0x1 at 0x800a77cc (yada yada no. invalid units) 00085b78: 8fbf0030 lw r31,0x0030(r29) 00085b7c: 8fb5002c lw r21,0x002c(r29) 00085b80: 8fb40028 lw r20,0x0028(r29) 00085b84: 8fb30024 lw r19,0x0024(r29) 00085b88: 8fb20020 lw r18,0x0020(r29) 00085b8c: 8fb1001c lw r17,0x001c(r29) 00085b90: 8fb00018 lw r16,0x0018(r29) 00085b94: 27bd0038 addiu r29,r29,0x0038 00085b98: 03e00008 jr r31 00085b9c: 00000000 nop