papermario/src/code_fe0b0_len_5a0.c

61 lines
1.4 KiB
C
Raw Normal View History

2020-07-18 02:47:33 +02:00
#include "common.h"
INCLUDE_ASM(code_fe0b0_len_5a0, SetSpriteShading);
2020-07-18 02:47:33 +02:00
2020-08-16 05:19:00 +02:00
s32 EnableSpriteShading(Script* 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 05:19:00 +02:00
s32 getDemoState(Script* script) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->demoState);
2020-07-18 02:47:33 +02:00
return 2;
}
2020-08-16 05:19:00 +02:00
s32 DemoPressButton(Script* script) {
(*gGameStatusPtr)->demoButtonInput |= get_variable(script, *script->ptrReadPos);
2020-07-18 02:47:33 +02:00
return 2;
}
2020-08-16 05:19:00 +02:00
s32 DemoReleaseButton(Script* script) {
(*gGameStatusPtr)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
2020-07-18 02:47:33 +02:00
return 2;
}
2020-08-16 05:19:00 +02:00
s32 DemoSetButtons(Script* script) {
(*gGameStatusPtr)->demoButtonInput = get_variable(script, *script->ptrReadPos);
2020-07-18 02:47:33 +02:00
return 2;
}
2020-08-16 05:19:00 +02:00
s32 DemoJoystickRadial(Script* script) {
f32 a;
f32 b;
s32* thisPos = script->ptrReadPos;
2020-07-18 02:47:33 +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
(*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-08-16 05:19:00 +02:00
s32 DemoJoystickXY(Script* 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-08-13 07:03:47 +02:00
(*gGameStatusPtr)->demoStickX = x;
(*gGameStatusPtr)->demoStickY = y;
2020-07-18 02:47:33 +02:00
return 2;
}