start decompiling emitters

This commit is contained in:
DizzyEggg 2017-10-13 19:46:27 +02:00
parent c78679ae66
commit 20d158cf4a
5 changed files with 378 additions and 727 deletions

View File

@ -7,687 +7,12 @@
thumb_func_start EmitGetMonData
EmitGetMonData: @ 80338B4
push {r4,lr}
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r3, 0
strb r3, [r1]
strb r4, [r1, 0x1]
strb r2, [r1, 0x2]
strb r3, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end EmitGetMonData
thumb_func_start dp01_build_cmdbuf_x01_a_b_0
dp01_build_cmdbuf_x01_a_b_0: @ 80338D8
push {r4,r5,lr}
adds r5, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r4, 0
movs r3, 0x1
strb r3, [r1]
strb r5, [r1, 0x1]
strb r2, [r1, 0x2]
strb r4, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x01_a_b_0
thumb_func_start EmitSetMonData
EmitSetMonData: @ 8033900
push {r4-r6,lr}
ldr r4, [sp, 0x10]
lsls r0, 24
lsrs r6, r0, 24
lsls r3, 24
lsrs r5, r3, 24
ldr r0, =gUnknown_02022D10
movs r3, 0x2
strb r3, [r0]
strb r1, [r0, 0x1]
strb r2, [r0, 0x2]
adds r1, r0, 0
cmp r5, 0
beq _0803392E
adds r3, r1, 0x3
adds r2, r5, 0
_08033920:
ldrb r0, [r4]
strb r0, [r3]
adds r4, 0x1
adds r3, 0x1
subs r2, 0x1
cmp r2, 0
bne _08033920
_0803392E:
adds r2, r5, 0x3
adds r0, r6, 0
bl PrepareBufferDataTransfer
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end EmitSetMonData
thumb_func_start sub_8033940
sub_8033940: @ 8033940
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
lsls r2, 24
lsrs r4, r2, 24
ldr r0, =gUnknown_02022D10
movs r2, 0x3
strb r2, [r0]
strb r1, [r0, 0x1]
strb r4, [r0, 0x2]
adds r5, r0, 0
cmp r4, 0
beq _0803396C
adds r1, r5, 0x3
adds r2, r4, 0
_0803395E:
ldrb r0, [r3]
strb r0, [r1]
adds r3, 0x1
adds r1, 0x1
subs r2, 0x1
cmp r2, 0
bne _0803395E
_0803396C:
adds r2, r4, 0x3
adds r0, r6, 0
adds r1, r5, 0
bl PrepareBufferDataTransfer
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8033940
thumb_func_start EmitLoadMonSprite
EmitLoadMonSprite: @ 8033980
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0x4
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitLoadMonSprite
thumb_func_start EmitSwitchInAnim
EmitSwitchInAnim: @ 80339A0
push {r4,lr}
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r3, 0x5
strb r3, [r1]
strb r4, [r1, 0x1]
strb r2, [r1, 0x2]
strb r3, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end EmitSwitchInAnim
thumb_func_start EmitReturnPokeToBall
EmitReturnPokeToBall: @ 80339C4
push {lr}
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0x6
strb r2, [r1]
strb r3, [r1, 0x1]
movs r2, 0x2
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitReturnPokeToBall
thumb_func_start EmitDrawTrainerPic
EmitDrawTrainerPic: @ 80339E4
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0x7
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitDrawTrainerPic
thumb_func_start EmitTrainerSlide
EmitTrainerSlide: @ 8033A04
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0x8
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitTrainerSlide
thumb_func_start EmitTrainerSlideBack
EmitTrainerSlideBack: @ 8033A24
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0x9
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitTrainerSlideBack
thumb_func_start EmitFaintAnimation
EmitFaintAnimation: @ 8033A44
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0xA
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitFaintAnimation
thumb_func_start dp01_build_cmdbuf_x0B_B_B_B
dp01_build_cmdbuf_x0B_B_B_B: @ 8033A64
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0xB
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x0B_B_B_B
thumb_func_start dp01_build_cmdbuf_x0C_C_C_C
dp01_build_cmdbuf_x0C_C_C_C: @ 8033A84
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0xC
strb r2, [r1]
strb r2, [r1, 0x1]
strb r2, [r1, 0x2]
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x0C_C_C_C
thumb_func_start EmitBallThrow
EmitBallThrow: @ 8033AA4
push {lr}
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
movs r2, 0xD
strb r2, [r1]
strb r3, [r1, 0x1]
movs r2, 0x2
bl PrepareBufferDataTransfer
pop {r0}
bx r0
.pool
thumb_func_end EmitBallThrow
thumb_func_start sub_8033AC4
sub_8033AC4: @ 8033AC4
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
lsls r1, 24
lsrs r4, r1, 24
ldr r1, =gUnknown_02022D10
movs r0, 0xE
strb r0, [r1]
strb r4, [r1, 0x1]
lsls r0, r4, 1
adds r0, r4
adds r5, r1, 0
cmp r0, 0
beq _08033AF2
adds r1, r5, 0x2
adds r3, r0, 0
_08033AE4:
ldrb r0, [r2]
strb r0, [r1]
adds r2, 0x1
adds r1, 0x1
subs r3, 0x1
cmp r3, 0
bne _08033AE4
_08033AF2:
lsls r2, r4, 1
adds r2, r4
adds r2, 0x2
adds r0, r6, 0
adds r1, r5, 0
bl PrepareBufferDataTransfer
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8033AC4
thumb_func_start EmitMoveAnimation
EmitMoveAnimation: @ 8033B0C
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
sub sp, 0x4
ldr r4, [sp, 0x20]
ldr r5, [sp, 0x24]
ldr r6, [sp, 0x2C]
mov r8, r6
lsls r0, 24
lsrs r0, 24
mov r9, r0
lsls r1, 16
lsrs r1, 16
lsls r3, 16
lsrs r3, 16
ldr r7, =gUnknown_02022D10
movs r0, 0
mov r12, r0
movs r0, 0xF
strb r0, [r7]
strb r1, [r7, 0x1]
lsrs r1, 8
strb r1, [r7, 0x2]
strb r2, [r7, 0x3]
strb r3, [r7, 0x4]
movs r6, 0xFF
lsls r6, 8
lsrs r3, 8
strb r3, [r7, 0x5]
strb r4, [r7, 0x6]
adds r0, r4, 0
ands r0, r6
asrs r0, 8
strb r0, [r7, 0x7]
movs r0, 0xFF
lsls r0, 16
ands r0, r4
asrs r0, 16
strb r0, [r7, 0x8]
lsrs r4, 24
strb r4, [r7, 0x9]
strb r5, [r7, 0xA]
mov r0, r8
strb r0, [r7, 0xB]
mov r0, r12
str r0, [sp]
movs r0, 0xE
movs r1, 0
movs r2, 0xD
movs r3, 0
bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
bne _08033BAC
str r0, [sp]
movs r0, 0xE
movs r1, 0
movs r2, 0x4D
movs r3, 0
bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _08033BAC
ldr r0, =gBattleWeather
ldrh r0, [r0]
strb r0, [r7, 0xC]
ands r6, r0
lsrs r0, r6, 8
strb r0, [r7, 0xD]
adds r4, r7, 0
b _08033BB6
.pool
_08033BAC:
ldr r0, =gUnknown_02022D10
movs r1, 0
strb r1, [r0, 0xC]
strb r1, [r0, 0xD]
adds r4, r0, 0
_08033BB6:
movs r0, 0
strb r0, [r4, 0xE]
strb r0, [r4, 0xF]
adds r0, r4, 0
adds r0, 0x10
ldr r1, [sp, 0x28]
movs r2, 0x1C
bl memcpy
mov r0, r9
adds r1, r4, 0
movs r2, 0x2C
bl PrepareBufferDataTransfer
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end EmitMoveAnimation
thumb_func_start EmitPrintString
EmitPrintString: @ 8033BE4
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r0, 24
lsrs r0, 24
mov r10, r0
lsls r1, 16
lsrs r1, 16
ldr r2, =gUnknown_02022D10
movs r0, 0x10
strb r0, [r2]
ldr r0, =gBattleOutcome
ldrb r0, [r0]
strb r0, [r2, 0x1]
strb r1, [r2, 0x2]
lsrs r1, 8
strb r1, [r2, 0x3]
adds r0, r2, 0x4
mov r12, r0
ldr r4, =gCurrentMove
ldrh r0, [r4]
strh r0, [r2, 0x4]
ldr r0, =gLastUsedMove
ldrh r0, [r0]
mov r1, r12
strh r0, [r1, 0x2]
ldr r0, =gLastUsedItem
ldrh r0, [r0]
strh r0, [r1, 0x4]
ldr r0, =gLastUsedAbility
ldrb r0, [r0]
strb r0, [r1, 0x6]
ldr r0, =gBattleScripting
ldrb r0, [r0, 0x17]
strb r0, [r1, 0x7]
ldr r0, =gBattleStruct
ldr r0, [r0]
adds r1, r0, 0
adds r1, 0x52
ldrb r1, [r1]
mov r3, r12
strb r1, [r3, 0x8]
adds r0, 0xB1
ldrb r0, [r0]
strb r0, [r3, 0x9]
ldr r0, =gStringBank
ldrb r0, [r0]
strb r0, [r3, 0xA]
ldr r3, =gBattleMoves
ldrh r1, [r4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r3
ldrb r0, [r0, 0x2]
mov r7, r12
strb r0, [r7, 0xB]
movs r3, 0
mov r9, r2
ldr r0, =gBattleTextBuff3
mov r8, r0
adds r2, 0x10
ldr r0, =gBattleMons
adds r4, r0, 0
adds r4, 0x20
_08033C6A:
adds r1, r2, r3
ldrb r0, [r4]
strb r0, [r1]
adds r4, 0x58
adds r3, 0x1
cmp r3, 0x3
ble _08033C6A
movs r3, 0
mov r5, r12
adds r5, 0x10
mov r4, r12
adds r4, 0x20
ldr r6, =gBattleTextBuff2
mov r2, r12
adds r2, 0x30
_08033C88:
adds r1, r5, r3
ldr r7, =gBattleTextBuff1
adds r0, r3, r7
ldrb r0, [r0]
strb r0, [r1]
adds r1, r4, r3
adds r0, r3, r6
ldrb r0, [r0]
strb r0, [r1]
adds r1, r2, r3
mov r7, r8
adds r0, r3, r7
ldrb r0, [r0]
strb r0, [r1]
adds r3, 0x1
cmp r3, 0xF
ble _08033C88
mov r0, r10
mov r1, r9
movs r2, 0x44
bl PrepareBufferDataTransfer
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end EmitPrintString
thumb_func_start EmitPrintStringPlayerOnly
EmitPrintStringPlayerOnly: @ 8033CFC
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r0, 24
lsrs r0, 24
mov r10, r0
lsls r1, 16
lsrs r1, 16
ldr r2, =gUnknown_02022D10
movs r0, 0x11
strb r0, [r2]
strb r0, [r2, 0x1]
strb r1, [r2, 0x2]
lsrs r1, 8
strb r1, [r2, 0x3]
adds r0, r2, 0x4
mov r12, r0
ldr r0, =gCurrentMove
ldrh r0, [r0]
strh r0, [r2, 0x4]
ldr r0, =gLastUsedMove
ldrh r0, [r0]
mov r1, r12
strh r0, [r1, 0x2]
ldr r0, =gLastUsedItem
ldrh r0, [r0]
strh r0, [r1, 0x4]
ldr r0, =gLastUsedAbility
ldrb r0, [r0]
strb r0, [r1, 0x6]
ldr r0, =gBattleScripting
ldrb r0, [r0, 0x17]
strb r0, [r1, 0x7]
ldr r0, =gBattleStruct
ldr r0, [r0]
adds r0, 0x52
ldrb r0, [r0]
strb r0, [r1, 0x8]
movs r3, 0
mov r9, r2
ldr r7, =gBattleTextBuff3
mov r8, r7
mov r4, r9
adds r4, 0x10
ldr r0, =gBattleMons
adds r2, r0, 0
adds r2, 0x20
_08033D5E:
adds r1, r4, r3
ldrb r0, [r2]
strb r0, [r1]
adds r2, 0x58
adds r3, 0x1
cmp r3, 0x3
ble _08033D5E
movs r3, 0
mov r5, r12
adds r5, 0x10
mov r4, r12
adds r4, 0x20
ldr r6, =gBattleTextBuff2
mov r2, r12
adds r2, 0x30
_08033D7C:
adds r1, r5, r3
ldr r7, =gBattleTextBuff1
adds r0, r3, r7
ldrb r0, [r0]
strb r0, [r1]
adds r1, r4, r3
adds r0, r3, r6
ldrb r0, [r0]
strb r0, [r1]
adds r1, r2, r3
mov r7, r8
adds r0, r3, r7
ldrb r0, [r0]
strb r0, [r1]
adds r3, 0x1
cmp r3, 0xF
ble _08033D7C
mov r0, r10
mov r1, r9
movs r2, 0x44
bl PrepareBufferDataTransfer
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end EmitPrintStringPlayerOnly
thumb_func_start EmitChooseAction
EmitChooseAction: @ 8033DE4
push {r4,lr}
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
lsls r2, 16
lsrs r2, 16
ldr r1, =gUnknown_02022D10
movs r3, 0x12
strb r3, [r1]
strb r4, [r1, 0x1]
strb r2, [r1, 0x2]
lsrs r2, 8
strb r2, [r1, 0x3]
movs r2, 0x4
bl PrepareBufferDataTransfer
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end EmitChooseAction
thumb_func_start EmitCmd13
EmitCmd13: @ 8033E10
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x13
strb r2, [r1]
strb r2, [r1, 0x1]
@ -706,7 +31,7 @@ EmitChooseMove: @ 8033E30
adds r5, r3, 0
lsls r0, 24
lsrs r6, r0, 24
ldr r3, =gUnknown_02022D10
ldr r3, =gBattleBuffersTransferData
movs r4, 0
movs r0, 0x14
strb r0, [r3]
@ -739,7 +64,7 @@ EmitOpenBag: @ 8033E6C
adds r4, r1, 0
lsls r0, 24
lsrs r5, r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r0, 0x15
strb r0, [r1]
movs r2, 0
@ -767,7 +92,7 @@ EmitChoosePokemon: @ 8033EA0
ldr r6, [sp, 0x10]
lsls r0, 24
lsrs r5, r0, 24
ldr r4, =gUnknown_02022D10
ldr r4, =gBattleBuffersTransferData
movs r0, 0x16
strb r0, [r4]
strb r1, [r4, 0x1]
@ -798,7 +123,7 @@ dp01_build_cmdbuf_x17_17_17_17: @ 8033EDC
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x17
strb r2, [r1]
strb r2, [r1, 0x1]
@ -818,7 +143,7 @@ EmitHealthBarUpdate: @ 8033EFC
lsrs r0, 24
lsls r1, 16
lsrs r1, 16
ldr r3, =gUnknown_02022D10
ldr r3, =gBattleBuffersTransferData
movs r4, 0
movs r2, 0x18
strb r2, [r3]
@ -848,7 +173,7 @@ EmitExpUpdate: @ 8033F34
lsrs r0, 24
lsls r2, 16
lsrs r2, 16
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r3, 0x19
strb r3, [r1]
strb r4, [r1, 0x1]
@ -874,7 +199,7 @@ EmitStatusIconUpdate: @ 8033F68
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r3, 0x1A
strb r3, [r1]
strb r4, [r1, 0x1]
@ -917,7 +242,7 @@ EmitStatusAnimation: @ 8033FBC
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r3, 0x1B
strb r3, [r1]
strb r4, [r1, 0x1]
@ -948,7 +273,7 @@ dp01_build_cmdbuf_x1C_a: @ 8033FF8
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x1C
strb r2, [r1]
strb r3, [r1, 0x1]
@ -966,7 +291,7 @@ dp01_build_cmdbuf_x1D_1D_numargs_varargs: @ 8034018
lsrs r6, r0, 24
lsls r1, 16
lsrs r4, r1, 16
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r0, 0x1D
strb r0, [r1]
strb r0, [r1, 0x1]
@ -1007,7 +332,7 @@ sub_8034060: @ 8034060
lsrs r6, r0, 24
lsls r2, 16
lsrs r5, r2, 16
ldr r2, =gUnknown_02022D10
ldr r2, =gBattleBuffersTransferData
movs r0, 0x1E
strb r0, [r2]
strb r1, [r2, 0x1]
@ -1061,7 +386,7 @@ sub_80340C8: @ 80340C8
lsrs r6, r0, 24
lsls r1, 16
lsrs r4, r1, 16
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r0, 0x1F
strb r0, [r1]
strb r4, [r1, 0x1]
@ -1100,7 +425,7 @@ sub_8034110: @ 8034110
lsrs r6, r0, 24
lsls r1, 16
lsrs r4, r1, 16
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r0, 0x20
strb r0, [r1]
strb r4, [r1, 0x1]
@ -1140,7 +465,7 @@ EmitCmd_x21: @ 8034158
lsrs r0, 24
lsls r2, 16
lsrs r2, 16
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r3, 0x21
strb r3, [r1]
strb r4, [r1, 0x1]
@ -1161,7 +486,7 @@ dp01_build_cmdbuf_x22_a_three_bytes: @ 8034184
adds r4, r2, 0
lsls r0, 24
lsrs r5, r0, 24
ldr r2, =gUnknown_02022D10
ldr r2, =gBattleBuffersTransferData
movs r0, 0x22
strb r0, [r2]
strb r1, [r2, 0x1]
@ -1192,7 +517,7 @@ dp01_build_cmdbuf_x23_aa_0: @ 80341BC
lsrs r0, 24
lsls r1, 16
lsrs r1, 16
ldr r3, =gUnknown_02022D10
ldr r3, =gBattleBuffersTransferData
movs r4, 0
movs r2, 0x23
strb r2, [r3]
@ -1216,7 +541,7 @@ dp01_build_cmdbuf_x24_aa_0: @ 80341E8
lsrs r0, 24
lsls r1, 16
lsrs r1, 16
ldr r3, =gUnknown_02022D10
ldr r3, =gBattleBuffersTransferData
movs r4, 0
movs r2, 0x24
strb r2, [r3]
@ -1238,7 +563,7 @@ dp01_build_cmdbuf_x25_25_25_25: @ 8034214
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x25
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1257,7 +582,7 @@ dp01_build_cmdbuf_x26_a: @ 8034234
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x26
strb r2, [r1]
strb r3, [r1, 0x1]
@ -1273,7 +598,7 @@ dp01_build_cmdbuf_x27_27_27_27: @ 8034254
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x27
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1291,7 +616,7 @@ dp01_build_cmdbuf_x28_28_28_28: @ 8034274
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x28
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1309,7 +634,7 @@ EmitHitAnimation: @ 8034294
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x29
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1327,7 +652,7 @@ Emit_x2A: @ 80342B4
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x2A
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1347,7 +672,7 @@ EmitEffectivenessSound: @ 80342D4
lsrs r0, 24
lsls r1, 16
lsrs r1, 16
ldr r3, =gUnknown_02022D10
ldr r3, =gBattleBuffersTransferData
movs r4, 0
movs r2, 0x2B
strb r2, [r3]
@ -1371,7 +696,7 @@ EmitPlaySound: @ 8034300
lsrs r0, 24
lsls r1, 16
lsrs r1, 16
ldr r4, =gUnknown_02022D10
ldr r4, =gBattleBuffersTransferData
movs r3, 0x2C
strb r3, [r4]
strb r1, [r4, 0x1]
@ -1392,7 +717,7 @@ EmitFaintingCry: @ 803432C
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x2D
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1411,7 +736,7 @@ EmitIntroSlide: @ 803434C
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x2E
strb r2, [r1]
strb r3, [r1, 0x1]
@ -1427,7 +752,7 @@ EmitIntroTrainerBallThrow: @ 803436C
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x2F
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1448,7 +773,7 @@ EmitDrawPartyStatusSummary: @ 803438C
lsrs r5, r0, 24
lsls r2, 24
lsrs r2, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r3, 0x30
strb r3, [r1]
movs r0, 0x7F
@ -1484,7 +809,7 @@ EmitCmd49: @ 80343D4
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x31
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1502,7 +827,7 @@ Emit_x32: @ 80343F4
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x32
strb r2, [r1]
strb r2, [r1, 0x1]
@ -1521,7 +846,7 @@ EmitSpriteInvisibility: @ 8034414
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x33
strb r2, [r1]
strb r3, [r1, 0x1]
@ -1542,7 +867,7 @@ EmitBattleAnimation: @ 8034438
lsrs r0, 24
lsls r2, 16
lsrs r2, 16
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r3, 0x34
strb r3, [r1]
strb r4, [r1, 0x1]
@ -1564,7 +889,7 @@ EmitLinkStandbyMsg: @ 8034464
lsrs r5, r0, 24
lsls r2, 24
lsrs r2, 24
ldr r4, =gUnknown_02022D10
ldr r4, =gBattleBuffersTransferData
movs r0, 0x35
strb r0, [r4]
strb r1, [r4, 0x1]
@ -1580,7 +905,7 @@ _0803448C:
strb r2, [r4, 0x2]
strb r2, [r4, 0x3]
_08034490:
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
ldrb r2, [r1, 0x2]
adds r2, 0x4
adds r0, r5, 0
@ -1597,7 +922,7 @@ EmitResetActionMoveSelection: @ 80344A8
adds r3, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_02022D10
ldr r1, =gBattleBuffersTransferData
movs r2, 0x36
strb r2, [r1]
strb r3, [r1, 0x1]
@ -1614,7 +939,7 @@ Emit_x37: @ 80344C8
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
ldr r4, =gUnknown_02022D10
ldr r4, =gBattleBuffersTransferData
movs r0, 0x37
strb r0, [r4]
strb r1, [r4, 0x1]

View File

@ -46,6 +46,69 @@ struct ChooseMoveStruct
u8 monType2;
};
enum
{
CONTROLLER_GETMONDATA,
CONTROLLER_GETRAWMONDATA,
CONTROLLER_SETMONDATA,
CONTROLLER_SETRAWMONDATA,
CONTROLLER_LOADMONSPRITE,
CONTROLLER_SWITCHINANIM,
CONTROLLER_RETURNPOKETOBALL,
CONTROLLER_DRAWTRAINERPIC,
CONTROLLER_TRAINERSLIDE,
CONTROLLER_TRAINERSLIDEBACK,
CONTROLLER_FAINTANIMATION,
CONTROLLER_11,
CONTROLLER_12,
CONTROLLER_BALLTHROW,
CONTROLLER_PAUSE,
CONTROLLER_MOVEANIMATION,
CONTROLLER_PRINTSTRING,
CONTROLLER_PRINTSTRINGPLAYERONLY,
CONTROLLER_CHOOSEACTION,
CONTROLLER_19,
CONTROLLER_20,
CONTROLLER_OPENBAG,
CONTROLLER_22,
CONTROLLER_23,
CONTROLLER_HEALTHBARUPDATE,
CONTROLLER_EXPBARUPDATE,
CONTROLLER_STATUSICONUPDATE,
CONTROLLER_STATUSANIMATION,
CONTROLLER_STATUSXOR,
CONTROLLER_29,
CONTROLLER_DMATRANSFER,
CONTROLLER_31,
CONTROLLER_32,
CONTROLLER_33,
CONTROLLER_34,
CONTROLLER_35,
CONTROLLER_36,
CONTROLLER_37,
CONTROLLER_38,
CONTROLLER_39,
CONTROLLER_40,
CONTROLLER_HITANIMATION,
CONTROLLER_42,
CONTROLLER_EFFECTIVENESSSOUND,
CONTROLLER_44,
CONTROLLER_FAINTINGCRY,
CONTROLLER_INTROSLIDE,
CONTROLLER_TRAINERBALLTHROW,
CONTROLLER_48,
CONTROLLER_49,
CONTROLLER_50,
CONTROLLER_SPRITEINVISIBILITY,
CONTROLLER_BATTLEANIMATION,
CONTROLLER_LINKSTANDBYMSG,
CONTROLLER_RESETACTIONMOVESELECTION,
CONTROLLER_55,
CONTROLLER_56
};
#define LAST_CONTROLLER_CMD_ID CONTROLLER_56 + 1
// general functions
void HandleLinkBattleSetup(void);
void SetUpBattleVarsAndBirchZigzagoon(void);
@ -53,24 +116,36 @@ void sub_8032768(void);
void sub_8033648(void);
// emitters
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2);
void EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes); // unused
void EmitSetMonData(u8 bufferId, u8 request, u8 c, u8 bytes, void *data);
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct* disableStructPtr, u8 multihit);
void EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data); // unused
void EmitLoadMonSprite(u8 bufferId);
void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
void EmitReturnPokeToBall(u8 bufferId, u8 arg1);
void EmitDrawTrainerPic(u8 bufferId);
void EmitTrainerSlide(u8 bufferId);
void EmitTrainerSlideBack(u8 bufferId);
void EmitFaintAnimation(u8 bufferId);
void EmitCmd11(u8 bufferId); // unused
void EmitCmd12(u8 bufferId); // unused
void EmitBallThrow(u8 bufferId, u8 caseId);
void EmitPause(u8 bufferId, u8 toWait, void *data); // unused
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit);
void EmitPrintString(u8 bufferId, u16 stringId);
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringId);
void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
void EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
void EmitEffectivenessSound(u8 bufferId, u16 songId);
void EmitPlaySound(u8 bufferId, u16 songId, u8 arg2);
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringId);
void EmitFaintAnimation(u8 bufferId);
void Emit_x2A(u8 bufferId);
void EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints);
void EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument);
void EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);
void EmitReturnPokeToBall(u8 bufferId, u8 arg1);
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2);
void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4);
void EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 arg2);
void EmitTrainerSlide(u8 bufferId);
void EmitTrainerSlideBack(u8 bufferId);
void EmitFaintingCry(u8 bufferId);
void Emit_x37(u8 bufferId, u8 arg1);
void EmitHitAnimation(u8 bufferId);
@ -80,16 +155,12 @@ void EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
void EmitCmd13(u8 bufferId);
void EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
void EmitIntroSlide(u8 bufferId, u8 terrainId);
void EmitDrawTrainerPic(u8 bufferId);
void EmitLoadMonSprite(u8 bufferId);
void EmitIntroTrainerBallThrow(u8 bufferId);
void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
void EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct* movePpData);
void EmitOpenBag(u8 bufferId, u8* arg1);
void Emit_x32(u8 bufferId);
void EmitPrintString(u8 bufferId, u16 stringId);
void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
void EmitBallThrow(u8 bufferId, u8 caseId);
void EmitCmd_x21(u8 bufferId, u8 arg1, u16 arg2);
// player controller

View File

@ -33,6 +33,7 @@
#define ITEMEFFECT_ON_SWITCH_IN 0x0
#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0)))
#define WEATHER_HAS_EFFECT2 ((!AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_AIR_LOCK, 0, 0)))
#define BS_GET_TARGET 0
#define BS_GET_ATTACKER 1

View File

@ -9,6 +9,8 @@
#include "species.h"
#include "recorded_battle.h"
#include "util.h"
#include "abilities.h"
#include "battle_message.h"
extern u32 gBattleTypeFlags;
extern u32 gBattleExecBuffer;
@ -25,6 +27,7 @@ extern u8 gUnknown_0203C7B4;
extern u16 gBattlePartyID[BATTLE_BANKS_COUNT];
extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200];
extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200];
extern u8 gBattleBuffersTransferData[0x100];
extern u8 gUnknown_02022D08;
extern u8 gUnknown_02022D09;
extern u8 gUnknown_02022D0A;
@ -32,6 +35,9 @@ extern u8 gBankAttacker;
extern u8 gBankTarget;
extern u8 gAbsentBankFlags;
extern u8 gEffectBank;
extern u16 gBattleWeather;
extern const struct BattleMove gBattleMoves[];
extern void task00_08081A90(u8 taskId); // cable_club
extern void sub_81B8D64(u8 bank, u8 arg1); // party_menu
@ -926,3 +932,251 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
gTasks[taskId].data[15] = gTasks[taskId].data[15] + blockSize + LINK_BUFF_DATA;
}
}
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2)
{
gBattleBuffersTransferData[0] = CONTROLLER_GETMONDATA;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = arg2;
gBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
{
gBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA;
gBattleBuffersTransferData[1] = monId;
gBattleBuffersTransferData[2] = bytes;
gBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitSetMonData(u8 bufferId, u8 request, u8 c, u8 bytes, void *data)
{
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_SETMONDATA;
gBattleBuffersTransferData[1] = request;
gBattleBuffersTransferData[2] = c;
for (i = 0; i < bytes; i++)
gBattleBuffersTransferData[3 + i] = *(u8*)(data++);
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 3 + bytes);
}
void EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
{
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_SETRAWMONDATA;
gBattleBuffersTransferData[1] = monId;
gBattleBuffersTransferData[2] = bytes;
for (i = 0; i < bytes; i++)
gBattleBuffersTransferData[3 + i] = *(u8*)(data++);
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, bytes + 3);
}
void EmitLoadMonSprite(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[1] = 4;
gBattleBuffersTransferData[2] = 4;
gBattleBuffersTransferData[3] = 4;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit)
{
gBattleBuffersTransferData[0] = CONTROLLER_SWITCHINANIM;
gBattleBuffersTransferData[1] = partyId;
gBattleBuffersTransferData[2] = dontClearSubstituteBit;
gBattleBuffersTransferData[3] = 5;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
// TODO: change Poke to Mon to be consistent
void EmitReturnPokeToBall(u8 bufferId, u8 arg1)
{
gBattleBuffersTransferData[0] = CONTROLLER_RETURNPOKETOBALL;
gBattleBuffersTransferData[1] = arg1;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 2);
}
void EmitDrawTrainerPic(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[1] = 7;
gBattleBuffersTransferData[2] = 7;
gBattleBuffersTransferData[3] = 7;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitTrainerSlide(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[1] = 8;
gBattleBuffersTransferData[2] = 8;
gBattleBuffersTransferData[3] = 8;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitTrainerSlideBack(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[1] = 9;
gBattleBuffersTransferData[2] = 9;
gBattleBuffersTransferData[3] = 9;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitFaintAnimation(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_FAINTANIMATION;
gBattleBuffersTransferData[1] = 10;
gBattleBuffersTransferData[2] = 10;
gBattleBuffersTransferData[3] = 10;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd11(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_11;
gBattleBuffersTransferData[1] = 11;
gBattleBuffersTransferData[2] = 11;
gBattleBuffersTransferData[3] = 11;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd12(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_12;
gBattleBuffersTransferData[1] = 12;
gBattleBuffersTransferData[2] = 12;
gBattleBuffersTransferData[3] = 12;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitBallThrow(u8 bufferId, u8 caseId)
{
gBattleBuffersTransferData[0] = CONTROLLER_BALLTHROW;
gBattleBuffersTransferData[1] = caseId;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 2);
}
void EmitPause(u8 bufferId, u8 toWait, void *data)
{
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_PAUSE;
gBattleBuffersTransferData[1] = toWait;
for (i = 0; i < toWait * 3; i++)
gBattleBuffersTransferData[2 + i] = *(u8*)(data++);
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, toWait * 3 + 2);
}
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit)
{
gBattleBuffersTransferData[0] = CONTROLLER_MOVEANIMATION;
gBattleBuffersTransferData[1] = move;
gBattleBuffersTransferData[2] = (move & 0xFF00) >> 8;
gBattleBuffersTransferData[3] = turnOfMove;
gBattleBuffersTransferData[4] = movePower;
gBattleBuffersTransferData[5] = (movePower & 0xFF00) >> 8;
gBattleBuffersTransferData[6] = dmg;
gBattleBuffersTransferData[7] = (dmg & 0x0000FF00) >> 8;
gBattleBuffersTransferData[8] = (dmg & 0x00FF0000) >> 16;
gBattleBuffersTransferData[9] = (dmg & 0xFF000000) >> 24;
gBattleBuffersTransferData[10] = friendship;
gBattleBuffersTransferData[11] = multihit;
if (WEATHER_HAS_EFFECT2)
{
gBattleBuffersTransferData[12] = gBattleWeather;
gBattleBuffersTransferData[13] = (gBattleWeather & 0xFF00) >> 8;
}
else
{
gBattleBuffersTransferData[12] = 0;
gBattleBuffersTransferData[13] = 0;
}
gBattleBuffersTransferData[14] = 0;
gBattleBuffersTransferData[15] = 0;
memcpy(&gBattleBuffersTransferData[16], disableStructPtr, sizeof(struct DisableStruct));
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 16 + sizeof(struct DisableStruct));
}
extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT];
extern u16 gCurrentMove;
extern u16 gLastUsedMove;
extern u16 gLastUsedItem;
extern u8 gBattleOutcome;
extern u8 gLastUsedAbility;
extern u8 gStringBank;
void EmitPrintString(u8 bufferId, u16 stringID)
{
s32 i;
struct StringInfoBattle* stringInfo;
gBattleBuffersTransferData[0] = CONTROLLER_PRINTSTRING;
gBattleBuffersTransferData[1] = gBattleOutcome;
gBattleBuffersTransferData[2] = stringID;
gBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8;
stringInfo = (struct StringInfoBattle*)(&gBattleBuffersTransferData[4]);
stringInfo->currentMove = gCurrentMove;
stringInfo->lastMove = gLastUsedMove;
stringInfo->lastItem = gLastUsedItem;
stringInfo->lastAbility = gLastUsedAbility;
stringInfo->scrActive = gBattleScripting.bank;
stringInfo->unk1605E = gBattleStruct->field_52;
stringInfo->hpScale = gBattleStruct->hpScale;
stringInfo->StringBank = gStringBank;
stringInfo->moveType = gBattleMoves[gCurrentMove].type;
for (i = 0; i < BATTLE_BANKS_COUNT; i++)
stringInfo->abilities[i] = gBattleMons[i].ability;
for (i = 0; i < TEXT_BUFF_ARRAY_COUNT; i++)
{
stringInfo->textBuffs[0][i] = gBattleTextBuff1[i];
stringInfo->textBuffs[1][i] = gBattleTextBuff2[i];
stringInfo->textBuffs[2][i] = gBattleTextBuff3[i];
}
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, sizeof(struct StringInfoBattle) + 4);
}
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringID)
{
s32 i;
struct StringInfoBattle* stringInfo;
gBattleBuffersTransferData[0] = CONTROLLER_PRINTSTRINGPLAYERONLY;
gBattleBuffersTransferData[1] = 17;
gBattleBuffersTransferData[2] = stringID;
gBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8;
stringInfo = (struct StringInfoBattle*)(&gBattleBuffersTransferData[4]);
stringInfo->currentMove = gCurrentMove;
stringInfo->lastMove = gLastUsedMove;
stringInfo->lastItem = gLastUsedItem;
stringInfo->lastAbility = gLastUsedAbility;
stringInfo->scrActive = gBattleScripting.bank;
stringInfo->unk1605E = gBattleStruct->field_52;
for (i = 0; i < BATTLE_BANKS_COUNT; i++)
stringInfo->abilities[i] = gBattleMons[i].ability;
for (i = 0; i < TEXT_BUFF_ARRAY_COUNT; i++)
{
stringInfo->textBuffs[0][i] = gBattleTextBuff1[i];
stringInfo->textBuffs[1][i] = gBattleTextBuff2[i];
stringInfo->textBuffs[2][i] = gBattleTextBuff3[i];
}
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, sizeof(struct StringInfoBattle) + 4);
}
void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2)
{
gBattleBuffersTransferData[0] = CONTROLLER_CHOOSEACTION;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = arg2;
gBattleBuffersTransferData[3] = (arg2 & 0xFF00) >> 8;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}

View File

@ -196,7 +196,7 @@ gUnknown_02022D0A: @ 2022D0A
gUnknown_02022D0C: @ 2022D0C
.space 0x4
gUnknown_02022D10: @ 2022D10
gBattleBuffersTransferData: @ 2022D10
.space 0x100
gUnknown_02022E10: @ 2022E10