mirror of
https://github.com/zeldaret/tmc
synced 2026-08-10 19:17:33 -04:00
renamed JumpSwitch to JumpTable
This commit is contained in:
+18
-18
@@ -36,29 +36,29 @@
|
||||
1: .2byte \s - 1b
|
||||
.endm
|
||||
|
||||
.macro JumpSwitchOpN n label labels:vararg
|
||||
.macro JumpTableOpN n label labels:vararg
|
||||
.ifnb \labels
|
||||
JumpSwitchOpN \n + 1 \labels
|
||||
JumpTableOpN \n + 1 \labels
|
||||
.else
|
||||
.2byte 0x400 * (\n) + 0x6
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro JumpSwitchOp labels:vararg
|
||||
JumpSwitchOpN 2 \labels
|
||||
.macro JumpTableOp labels:vararg
|
||||
JumpTableOpN 2 \labels
|
||||
.endm
|
||||
|
||||
.macro JumpSwitchLabel temp label labels:vararg
|
||||
.macro JumpTableLabel temp label labels:vararg
|
||||
.2byte \label - \temp
|
||||
.ifnb \labels
|
||||
JumpSwitchLabel \temp - 2 \labels
|
||||
JumpTableLabel \temp - 2 \labels
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro JumpSwitch labels:vararg
|
||||
JumpSwitchOp \labels
|
||||
.macro JumpTable labels:vararg
|
||||
JumpTableOp \labels
|
||||
1:
|
||||
JumpSwitchLabel 1b \labels
|
||||
JumpTableLabel 1b \labels
|
||||
.endm
|
||||
|
||||
.macro JumpAbsolute w
|
||||
@@ -76,28 +76,28 @@
|
||||
.4byte \w
|
||||
.endm
|
||||
|
||||
.macro JumpAbsoluteSwitchOpN n label labels:vararg
|
||||
.macro JumpAbsoluteTableOpN n label labels:vararg
|
||||
.ifnb \labels
|
||||
JumpAbsoluteSwitchOpN \n + 2 \labels
|
||||
JumpAbsoluteTableOpN \n + 2 \labels
|
||||
.else
|
||||
.2byte 0x400 * (\n) + 0xa
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro JumpAbsoluteSwitchOp labels:vararg
|
||||
JumpAbsoluteSwitchOpN 3 \labels
|
||||
.macro JumpAbsoluteTableOp labels:vararg
|
||||
JumpAbsoluteTableOpN 3 \labels
|
||||
.endm
|
||||
|
||||
.macro JumpAbsoluteSwitchLabel label labels:vararg
|
||||
.macro JumpAbsoluteTableLabel label labels:vararg
|
||||
.4byte \label
|
||||
.ifnb \labels
|
||||
JumpAbsoluteSwitchLabel \labels
|
||||
JumpAbsoluteTableLabel \labels
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro JumpAbsoluteSwitch labels:vararg
|
||||
JumpAbsoluteSwitchOp \labels
|
||||
JumpAbsoluteSwitchLabel \labels
|
||||
.macro JumpAbsoluteTable labels:vararg
|
||||
JumpAbsoluteTableOp \labels
|
||||
JumpAbsoluteTableLabel \labels
|
||||
.endm
|
||||
|
||||
.macro Call w
|
||||
|
||||
@@ -6,7 +6,7 @@ SCRIPT_START script_0800B0D0
|
||||
EndBlock
|
||||
script_0800B0E8:
|
||||
Call sub_0807F434
|
||||
JumpSwitch script_0800B0E8, script_0800B0F6, script_0800B134
|
||||
JumpTable script_0800B0E8, script_0800B0F6, script_0800B134
|
||||
script_0800B0F6:
|
||||
_0807E864
|
||||
Call sub_0807DF28
|
||||
|
||||
@@ -7,7 +7,7 @@ SCRIPT_START script_0800B9B4
|
||||
EndBlock
|
||||
script_0800B9CA:
|
||||
Call sub_0807F434
|
||||
JumpSwitch script_0800B9CA, script_0800B9D8, script_0800B9F4
|
||||
JumpTable script_0800B9CA, script_0800B9D8, script_0800B9F4
|
||||
script_0800B9D8:
|
||||
_0807E864
|
||||
_0807EB74
|
||||
|
||||
@@ -49,7 +49,7 @@ script_0800D4E4:
|
||||
Call sub_08062698
|
||||
Call sub_080626AC
|
||||
CallWithArg sub_0807F0EC, 0x00000009
|
||||
JumpSwitch script_0800D510, script_0800D51A, script_0800D524, script_0800D52E, script_0800D538, script_0800D542, script_0800D54C, script_0800D556, script_0800D560
|
||||
JumpTable script_0800D510, script_0800D51A, script_0800D524, script_0800D52E, script_0800D538, script_0800D542, script_0800D54C, script_0800D556, script_0800D560
|
||||
script_0800D510:
|
||||
_0807EE04 0x0038, 0x0068
|
||||
Jump script_0800D566
|
||||
@@ -104,7 +104,7 @@ script_0800D5AC:
|
||||
Call sub_08062698
|
||||
Call sub_080626AC
|
||||
CallWithArg sub_0807F0EC, 0x00000004
|
||||
JumpSwitch script_0800D5CE, script_0800D5D8, script_0800D5E2, script_0800D5EC
|
||||
JumpTable script_0800D5CE, script_0800D5D8, script_0800D5E2, script_0800D5EC
|
||||
script_0800D5CE:
|
||||
_0807EE04 0x0038, 0x0098
|
||||
Jump script_0800D5F2
|
||||
|
||||
@@ -139,7 +139,7 @@ script_0800E832:
|
||||
EndBlock
|
||||
_0807EA94
|
||||
_0807EB38
|
||||
JumpSwitch script_0800E910, script_0800E8D6, script_0800E8A4, script_0800E872
|
||||
JumpTable script_0800E910, script_0800E8D6, script_0800E8A4, script_0800E872
|
||||
script_0800E872:
|
||||
BeginBlock
|
||||
TextboxNoOverlapFollow 0x4505
|
||||
|
||||
@@ -3,7 +3,7 @@ SCRIPT_START script_0800FAE4
|
||||
SetEntityNonPlanarMovement 0x0100
|
||||
EndBlock
|
||||
Call sub_0807F584
|
||||
JumpSwitch script_0800FB06, script_0800FB10, script_0800FB06, script_0800FAFC
|
||||
JumpTable script_0800FB06, script_0800FB10, script_0800FB06, script_0800FAFC
|
||||
script_0800FAFC:
|
||||
CallWithArg sub_0807F4F8, 0x0000027c
|
||||
script_0800FB06:
|
||||
|
||||
@@ -64,7 +64,7 @@ script_08010314:
|
||||
Call sub_08062698
|
||||
Call sub_080626AC
|
||||
CallWithArg sub_0807F0EC, 0x00000009
|
||||
JumpSwitch script_08010340, script_0801034A, script_08010354, script_0801035E, script_08010368, script_08010372, script_0801037C, script_08010386, script_08010390
|
||||
JumpTable script_08010340, script_0801034A, script_08010354, script_0801035E, script_08010368, script_08010372, script_0801037C, script_08010386, script_08010390
|
||||
script_08010340:
|
||||
_0807EE04 0x0358, 0x0078
|
||||
Jump script_08010396
|
||||
@@ -205,7 +205,7 @@ script_08010502:
|
||||
_0807EA94
|
||||
script_0801052E:
|
||||
Call sub_080634E4
|
||||
JumpSwitch script_08010544, script_08010558, script_08010570, script_08010570, script_0801054C, script_08010564, script_08010570
|
||||
JumpTable script_08010544, script_08010558, script_08010570, script_08010570, script_0801054C, script_08010564, script_08010570
|
||||
script_08010544:
|
||||
TextboxNoOverlap 0x2b0d
|
||||
Jump script_080105E0
|
||||
|
||||
@@ -15,7 +15,7 @@ SCRIPT_START script_080112C4
|
||||
_0807ECC4 0x0010
|
||||
_0807E930 0x0002
|
||||
Call sub_08064050
|
||||
JumpSwitch script_08011312, script_080113AA, script_08011442, script_08011508
|
||||
JumpTable script_08011312, script_080113AA, script_08011442, script_08011508
|
||||
script_08011312:
|
||||
_0807E610 0x00000800
|
||||
_0807E5F8 0x00001000
|
||||
|
||||
@@ -3,7 +3,7 @@ SCRIPT_START script_080136D8
|
||||
SetEntityNonPlanarMovement 0x0100
|
||||
EndBlock
|
||||
Call sub_0807F584
|
||||
JumpSwitch script_080136F0, script_080136FA, script_08013704, script_080136FA
|
||||
JumpTable script_080136F0, script_080136FA, script_08013704, script_080136FA
|
||||
script_080136F0:
|
||||
CallWithArg sub_0807F464, 0x000000d0
|
||||
script_080136FA:
|
||||
|
||||
@@ -29,7 +29,7 @@ script_080144A2:
|
||||
JumpIfNot script_080144B8
|
||||
TextboxNoOverlapFollow 0x420b
|
||||
_0807EB38
|
||||
JumpSwitch script_080144B8, script_080144C0
|
||||
JumpTable script_080144B8, script_080144C0
|
||||
script_080144B8:
|
||||
ClearLocalFlag 0x0093
|
||||
Jump script_080144C8
|
||||
|
||||
@@ -5,11 +5,11 @@ script_08016384:
|
||||
Jump script_08016384
|
||||
JumpIf script_08016384
|
||||
JumpIfNot script_08016384
|
||||
JumpSwitch script_08016384, script_08016384
|
||||
JumpTable script_08016384, script_08016384
|
||||
JumpAbsolute script_08016384
|
||||
JumpAbsoluteIf script_08016384
|
||||
JumpAbsoluteIfNot script_08016384
|
||||
JumpAbsoluteSwitch script_08016384, script_08016384
|
||||
JumpAbsoluteTable script_08016384, script_08016384
|
||||
Call script_08016384
|
||||
CallWithArg script_08016384, 0x12345678
|
||||
LoadRoomEntityList script_08016384
|
||||
|
||||
+6
-6
@@ -18,11 +18,11 @@ void ScriptCommand_EndBlock(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_Jump(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpIf(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpIfNot(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpSwitch(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpTable(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpAbsolute(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpAbsoluteIf(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpAbsoluteIfNot(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpAbsoluteSwitch(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_JumpAbsoluteTable(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_Call(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_CallWithArg(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_LoadRoomEntityList(Entity* entity, ScriptExecutionContext* context);
|
||||
@@ -163,11 +163,11 @@ const ScriptCommand gScriptCommands[] = { ScriptCommandNop,
|
||||
ScriptCommand_Jump,
|
||||
ScriptCommand_JumpIf,
|
||||
ScriptCommand_JumpIfNot,
|
||||
ScriptCommand_JumpSwitch,
|
||||
ScriptCommand_JumpTable,
|
||||
ScriptCommand_JumpAbsolute,
|
||||
ScriptCommand_JumpAbsoluteIf,
|
||||
ScriptCommand_JumpAbsoluteIfNot,
|
||||
ScriptCommand_JumpAbsoluteSwitch,
|
||||
ScriptCommand_JumpAbsoluteTable,
|
||||
ScriptCommand_Call,
|
||||
ScriptCommand_CallWithArg,
|
||||
ScriptCommand_LoadRoomEntityList,
|
||||
@@ -657,7 +657,7 @@ void ScriptCommand_JumpIfNot(Entity* entity, ScriptExecutionContext* context) {
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptCommand_JumpSwitch(Entity* entity, ScriptExecutionContext* context) {
|
||||
void ScriptCommand_JumpTable(Entity* entity, ScriptExecutionContext* context) {
|
||||
if (gActiveScriptInfo.commandSize > context->unk_04) {
|
||||
context->scriptInstructionPointer += context->unk_04;
|
||||
ScriptCommand_Jump(entity, context);
|
||||
@@ -682,7 +682,7 @@ void ScriptCommand_JumpAbsoluteIfNot(Entity* entity, ScriptExecutionContext* con
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptCommand_JumpAbsoluteSwitch(Entity* entity, ScriptExecutionContext* context) {
|
||||
void ScriptCommand_JumpAbsoluteTable(Entity* entity, ScriptExecutionContext* context) {
|
||||
if (gActiveScriptInfo.commandSize > (context->unk_04 << 1) + 1) {
|
||||
context->scriptInstructionPointer += context->unk_04 << 1;
|
||||
ScriptCommand_JumpAbsolute(entity, context);
|
||||
|
||||
@@ -13,11 +13,11 @@ commands = [
|
||||
{'fun': 'ScriptCommand_Jump', 'params': 'j'},
|
||||
{'fun': 'ScriptCommand_JumpIf', 'params': 'j'},
|
||||
{'fun': 'ScriptCommand_JumpIfNot', 'params': 'j'},
|
||||
{'fun': 'ScriptCommand_JumpSwitch', 'params': ['jj', 'jjj', 'jjjj', 'jjjjjjj', 'jjjjjjjjj']},
|
||||
{'fun': 'ScriptCommand_JumpTable', 'params': ['jj', 'jjj', 'jjjj', 'jjjjjjj', 'jjjjjjjjj']},
|
||||
{'fun': 'ScriptCommand_JumpAbsolute', 'params': 'x'},
|
||||
{'fun': 'ScriptCommand_JumpAbsoluteIf', 'params': 'x'},
|
||||
{'fun': 'ScriptCommand_JumpAbsoluteIfNot', 'params': 'x'},
|
||||
{'fun': 'ScriptCommand_JumpAbsoluteSwitch', 'params': 'xx'},
|
||||
{'fun': 'ScriptCommand_JumpAbsoluteTable', 'params': 'xx'},
|
||||
{'fun': 'ScriptCommand_Call', 'params': 'p'},
|
||||
{'fun': 'ScriptCommand_CallWithArg', 'params': ['px', 'p']},
|
||||
{'fun': 'ScriptCommand_LoadRoomEntityList', 'params': 'd'},
|
||||
|
||||
Reference in New Issue
Block a user