tmc/asm/macros/scripts.inc

755 lines
8.9 KiB
PHP

@ All the macro functions for scripts
@ Generated by disassemble_script.py
.macro SCRIPT_START name
.globl \name
.section .text
\name:
.endm
.macro SCRIPT_END
.2byte 0xffff
.endm
.macro ScriptCommandNop
.2byte 0x0400
.endm
.macro BeginBlock
.2byte 0x0401
.endm
.macro EndBlock
.2byte 0x0402
.endm
.macro Jump s
.2byte 0x0803
1: .2byte \s - 1b
.endm
.macro JumpIf s
.2byte 0x0804
1: .2byte \s - 1b
.endm
.macro JumpIfNot s
.2byte 0x0805
1: .2byte \s - 1b
.endm
.macro JumpTableOpN n label labels:vararg
.ifnb \labels
JumpTableOpN \n + 1 \labels
.else
.2byte 0x400 * (\n) + 0x6
.endif
.endm
.macro JumpTableOp labels:vararg
JumpTableOpN 2 \labels
.endm
.macro JumpTableLabel temp label labels:vararg
.2byte \label - \temp
.ifnb \labels
JumpTableLabel \temp - 2 \labels
.endif
.endm
.macro JumpTable labels:vararg
JumpTableOp \labels
1:
JumpTableLabel 1b \labels
.endm
.macro JumpAbsolute w
.2byte 0x0c07
.4byte \w
.endm
.macro JumpAbsoluteIf w
.2byte 0x0c08
.4byte \w
.endm
.macro JumpAbsoluteIfNot w
.2byte 0x0c09
.4byte \w
.endm
.macro JumpAbsoluteTableOpN n label labels:vararg
.ifnb \labels
JumpAbsoluteTableOpN \n + 2 \labels
.else
.2byte 0x400 * (\n) + 0xa
.endif
.endm
.macro JumpAbsoluteTableOp labels:vararg
JumpAbsoluteTableOpN 3 \labels
.endm
.macro JumpAbsoluteTableLabel label labels:vararg
.4byte \label
.ifnb \labels
JumpAbsoluteTableLabel \labels
.endif
.endm
.macro JumpAbsoluteTable labels:vararg
JumpAbsoluteTableOp \labels
JumpAbsoluteTableLabel \labels
.endm
.macro Call w
.2byte 0x0c0b
.4byte \w
.endm
.macro CallWithArg a,b
.2byte 0x140c
.4byte \a
.4byte \b
.endm
.macro CallWithArg_2 w
.2byte 0x0c0c
.4byte \w
.endm
.macro LoadRoomEntityList w
.2byte 0x0c0d
.4byte \w
.endm
.macro TestBit w
.2byte 0x0c0e
.4byte \w
.endm
.macro CheckInventory1 s
.2byte 0x080f
.2byte \s
.endm
.macro CheckInventory2 s
.2byte 0x0810
.2byte \s
.endm
.macro HasRoomItemForSale
.2byte 0x0411
.endm
.macro CheckLocalFlag s
.2byte 0x0812
.2byte \s
.endm
.macro CheckLocalFlagByOffset a,b
.2byte 0x0c13
.2byte \a
.2byte \b
.endm
.macro CheckGlobalFlag s
.2byte 0x0814
.2byte \s
.endm
.macro CheckRoomFlag s
.2byte 0x0815
.2byte \s
.endm
.macro CheckPlayerInRegion a,b,c
.2byte 0x1016
.2byte \a
.2byte \b
.2byte \c
.endm
.macro CheckPlayerInRegion2 s
.2byte 0x0817
.2byte \s
.endm
.macro CheckEntityInteractType
.2byte 0x0418
.endm
.macro _0807E30C
.2byte 0x0419
.endm
.macro HasRupees s
.2byte 0x081a
.2byte \s
.endm
.macro _0807E3BC s
.2byte 0x081b
.2byte \s
.endm
.macro _0807E3E8
.2byte 0x041c
.endm
.macro CheckKinstoneFused s
.2byte 0x081d
.2byte \s
.endm
.macro BuyItem a,b
.2byte 0x0c1e
.2byte \a
.2byte \b
.endm
.macro _0807E48C s
.2byte 0x081f
.2byte \s
.endm
.macro _0807E4CC w
.2byte 0x0c20
.4byte \w
.endm
.macro _0807E4EC w
.2byte 0x0c21
.4byte \w
.endm
.macro _0807E514 w
.2byte 0x0c22
.4byte \w
.endm
.macro CheckPlayerFlags w
.2byte 0x0c23
.4byte \w
.endm
.macro _0807E564
.2byte 0x0424
.endm
.macro EntityHasHeight
.2byte 0x0425
.endm
.macro ComparePlayerAction s
.2byte 0x0826
.2byte \s
.endm
.macro ComparePlayerAnimationState s
.2byte 0x0827
.2byte \s
.endm
.macro _0807E5F8 w
.2byte 0x0c28
.4byte \w
.endm
.macro _0807E610 w
.2byte 0x0c29
.4byte \w
.endm
.macro SetLocalFlag s
.2byte 0x082a
.2byte \s
.endm
.macro SetLocalFlagByOffset a,b
.2byte 0x0c2b
.2byte \a
.2byte \b
.endm
.macro ClearLocalFlag s
.2byte 0x082c
.2byte \s
.endm
.macro SetGlobalFlag s
.2byte 0x082d
.2byte \s
.endm
.macro ClearGlobalFlag s
.2byte 0x082e
.2byte \s
.endm
.macro SetRoomFlag s
.2byte 0x082f
.2byte \s
.endm
.macro ClearRoomFlag s
.2byte 0x0830
.2byte \s
.endm
.macro Wait s
.2byte 0x0831
.2byte \s
.endm
.macro WaitForSomething w
.2byte 0x0c32
.4byte \w
.endm
.macro WaitForSomething2 w
.2byte 0x0c33
.4byte \w
.endm
.macro WaitPlayerAction8
.2byte 0x0434
.endm
.macro WaitForPlayerAction0x17
.2byte 0x0435
.endm
.macro WaitFor_1
.2byte 0x0436
.endm
.macro WaitFor_2
.2byte 0x0437
.endm
.macro _0807E778 s
.2byte 0x0838
.2byte \s
.endm
.macro _0807E788 w
.2byte 0x0c39
.4byte \w
.endm
.macro _0807E79C
.2byte 0x043a
.endm
.macro ScriptCommandNop2 s
.2byte 0x083b
.2byte \s
.endm
.macro DoFade4
.2byte 0x043c
.endm
.macro DoFade5
.2byte 0x043d
.endm
.macro DoFade6
.2byte 0x043e
.endm
.macro DoFade7
.2byte 0x043f
.endm
.macro _0807E800 w
.2byte 0x0c40
.4byte \w
.endm
.macro _0807E80C w
.2byte 0x0c41
.4byte \w
.endm
.macro _0807E858 s
.2byte 0x0842
.2byte \s
.endm
.macro _0807E858_0
.2byte 0x0442
.endm
.macro _0807E864
.2byte 0x0443
.endm
.macro _0807E878
.2byte 0x0444
.endm
.macro _0807E888
.2byte 0x0445
.endm
.macro SetPlayerAction w
.2byte 0x0c46
.4byte \w
.endm
.macro StartPlayerScript w
.2byte 0x0c47
.4byte \w
.endm
.macro _0807E8D4 s
.2byte 0x0848
.2byte \s
.endm
.macro _0807E8E4_0
.2byte 0x0449
.endm
.macro _0807E8E4_1
.2byte 0x044a
.endm
.macro _0807E8E4_2
.2byte 0x044b
.endm
.macro _0807E8E4_3
.2byte 0x044c
.endm
.macro _0807E908 s
.2byte 0x084d
.2byte \s
.endm
.macro SetIntVariable w
.2byte 0x0c4e
.4byte \w
.endm
.macro _0807E924
.2byte 0x044f
.endm
.macro _0807E930 s
.2byte 0x0850
.2byte \s
.endm
.macro _0807E944
.2byte 0x0451
.endm
.macro _0807E974 s
.2byte 0x0852
.2byte \s
.endm
.macro _0807E9D4
.2byte 0x0453
.endm
.macro _0807E9DC
.2byte 0x0454
.endm
.macro _0807E9E4 s
.2byte 0x0855
.2byte \s
.endm
.macro _0807E9F0
.2byte 0x0456
.endm
.macro _0807EA4C
.2byte 0x0457
.endm
.macro _0807EA88 s
.2byte 0x0858
.2byte \s
.endm
.macro _0807EA94
.2byte 0x0459
.endm
.macro TextboxNoOverlapFollow s
.2byte 0x085a
.2byte \s
.endm
.macro TextboxNoOverlap s
.2byte 0x085b
.2byte \s
.endm
.macro TextboxNoOverlapFollowPos a,b
.2byte 0x0c5c
.2byte \a
.2byte \b
.endm
.macro TextboxNoOverlapFollowPos_1 s
.2byte 0x085c
.2byte \s
.endm
.macro TextboxNoOverlapFollowTableOpN n label labels:vararg
.ifnb \labels
TextboxNoOverlapFollowTableOpN \n + 1 \labels
.else
.2byte 0x400 * (\n) + 0x5d
.endif
.endm
.macro TextboxNoOverlapFollowTableOp labels:vararg
TextboxNoOverlapFollowTableOpN 2 \labels
.endm
.macro TextboxNoOverlapFollowTableLabel label labels:vararg
.2byte \label
.ifnb \labels
TextboxNoOverlapFollowTableLabel \labels
.endif
.endm
.macro TextboxNoOverlapFollowTable labels:vararg
TextboxNoOverlapFollowTableOp \labels
TextboxNoOverlapFollowTableLabel \labels
.endm
.macro TextboxNoOverlapVar
.2byte 0x045e
.endm
.macro _0807EB28 s
.2byte 0x085f
.2byte \s
.endm
.macro _0807EB38
.2byte 0x0460
.endm
.macro _0807EB44 s
.2byte 0x0861
.2byte \s
.endm
.macro _0807EB4C a,b
.2byte 0x0c62
.2byte \a
.2byte \b
.endm
.macro _0807EB74
.2byte 0x0463
.endm
.macro _0807EB8C
.2byte 0x0464
.endm
.macro SetEntityDirection s
.2byte 0x0865
.2byte \s
.endm
.macro SetEntityDirectionWithAnimationState s
.2byte 0x0866
.2byte \s
.endm
.macro SetEntityNonPlanarMovement s
.2byte 0x0867
.2byte \s
.endm
.macro SetEntity0x20 w
.2byte 0x0c68
.4byte \w
.endm
.macro SetEntityPositionRelative a,b
.2byte 0x0c69
.2byte \a
.2byte \b
.endm
.macro SetEntityPosition a,b
.2byte 0x0c6a
.2byte \a
.2byte \b
.endm
.macro MoveEntityToPlayer
.2byte 0x046b
.endm
.macro ScriptCommandNop3
.2byte 0x046c
.endm
.macro _0807EC1C s
.2byte 0x086d
.2byte \s
.endm
.macro _0807EC64 s
.2byte 0x086e
.2byte \s
.endm
.macro _0807EC94 s
.2byte 0x086f
.2byte \s
.endm
.macro _0807ECC4 s
.2byte 0x0870
.2byte \s
.endm
.macro _0807ECF4 s
.2byte 0x0871
.2byte \s
.endm
.macro _0807ED24 a,b,c
.2byte 0x1072
.2byte \a
.2byte \b
.2byte \c
.endm
.macro _0807EDD4 a,b
.2byte 0x0c73
.2byte \a
.2byte \b
.endm
.macro _0807EE04 a,b
.2byte 0x0c74
.2byte \a
.2byte \b
.endm
.macro _0807EE30
.2byte 0x0475
.endm
.macro _0807EEB4
.2byte 0x0476
.endm
.macro _0807EEF4 a,b
.2byte 0x0c77
.2byte \a
.2byte \b
.endm
.macro _0807EF3C a,b
.2byte 0x0c78
.2byte \a
.2byte \b
.endm
.macro _0807EF80 s
.2byte 0x0879
.2byte \s
.endm
.macro _0807EF90 s
.2byte 0x087a
.2byte \s
.endm
.macro SoundReq s
.2byte 0x087b
.2byte \s
.endm
.macro SoundReq2 s
.2byte 0x087c
.2byte \s
.endm
.macro SoundReq3 w
.2byte 0x0c7d
.4byte \w
.endm
.macro SoundReq0x80100000
.2byte 0x047e
.endm
.macro ModRupees s
.2byte 0x087f
.2byte \s
.endm
.macro ModHealth s
.2byte 0x0880
.2byte \s
.endm
.macro IncreaseMaxHealth s
.2byte 0x0881
.2byte \s
.endm
.macro _0807F034 s
.2byte 0x0882
.2byte \s
.endm
.macro _0807F050 s
.2byte 0x0883
.2byte \s
.endm
.macro GetInventoryValue s
.2byte 0x0884
.2byte \s
.endm
.macro _0807F078 a,b
.2byte 0x0c85
.2byte \a
.2byte \b
.endm
.macro _0807F088 s
.2byte 0x0886
.2byte \s
.endm
.macro CameraTargetEntity
.2byte 0x0487
.endm
.macro CameraTargetPlayer
.2byte 0x0488
.endm
.macro _0807F0B4 s
.2byte 0x0889
.2byte \s
.endm
.macro _0807F0C8 a,b
.2byte 0x0c8a
.2byte \a
.2byte \b
.endm