2020-07-18 02:47:33 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
2020-07-19 06:15:50 +02:00
|
|
|
INCLUDE_ASM(code_fe0b0_len_5a0, SetSpriteShading);
|
2020-07-18 02:47:33 +02:00
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 EnableSpriteShading(ScriptInstance* script) {
|
2020-07-18 02:47:33 +02:00
|
|
|
if (get_variable(script, *script->ptrReadPos) != 0) {
|
|
|
|
*D_80151328 |= 1;
|
|
|
|
} else {
|
|
|
|
*D_80151328 &= ~1;
|
|
|
|
}
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 getDemoState(ScriptInstance* script) {
|
2020-07-19 06:15:50 +02:00
|
|
|
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->demoState);
|
2020-07-18 02:47:33 +02:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 DemoPressButton(ScriptInstance* script) {
|
2020-07-19 06:15:50 +02:00
|
|
|
(*gGameStatusPtr)->demoButtonInput |= get_variable(script, *script->ptrReadPos);
|
2020-07-18 02:47:33 +02:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 DemoReleaseButton(ScriptInstance* script) {
|
2020-07-19 06:15:50 +02:00
|
|
|
(*gGameStatusPtr)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
|
2020-07-18 02:47:33 +02:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 DemoSetButtons(ScriptInstance* script) {
|
2020-07-19 06:15:50 +02:00
|
|
|
(*gGameStatusPtr)->demoButtonInput = get_variable(script, *script->ptrReadPos);
|
2020-07-18 02:47:33 +02:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 DemoJoystickRadial(ScriptInstance* script) {
|
2020-07-19 06:15:50 +02:00
|
|
|
f32 a;
|
|
|
|
f32 b;
|
2020-07-18 23:26:22 +02:00
|
|
|
s32* thisPos = script->ptrReadPos;
|
2020-07-18 02:47:33 +02:00
|
|
|
|
2020-07-18 23:26:22 +02:00
|
|
|
a = get_float_variable(script, *thisPos++);
|
2020-07-19 05:56:17 +02:00
|
|
|
b = get_float_variable(script, *thisPos++);
|
2020-07-18 02:47:33 +02:00
|
|
|
|
2020-07-19 06:15:50 +02:00
|
|
|
(*gGameStatusPtr)->demoStickX = a * sin_deg(b);
|
|
|
|
(*gGameStatusPtr)->demoStickY = a * cos_deg(b);
|
2020-08-12 04:08:48 +02:00
|
|
|
|
2020-07-18 02:47:33 +02:00
|
|
|
return 2;
|
|
|
|
}
|
2020-07-18 23:26:22 +02:00
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 DemoJoystickXY(ScriptInstance* script) {
|
2020-08-13 07:03:47 +02:00
|
|
|
f32 x;
|
|
|
|
f32 y;
|
2020-07-18 02:47:33 +02:00
|
|
|
s32* thisPos = script->ptrReadPos;
|
|
|
|
|
2020-08-13 07:03:47 +02:00
|
|
|
x = get_float_variable(script, *thisPos++);
|
|
|
|
y = get_float_variable(script, *thisPos++);
|
2020-07-18 23:26:22 +02:00
|
|
|
|
2020-08-13 07:03:47 +02:00
|
|
|
(*gGameStatusPtr)->demoStickX = x;
|
|
|
|
(*gGameStatusPtr)->demoStickY = y;
|
2020-07-18 02:47:33 +02:00
|
|
|
|
|
|
|
return 2;
|
2020-07-18 23:26:22 +02:00
|
|
|
}
|