papermario/src/code_fe0b0_len_5a0.c

61 lines
1.6 KiB
C
Raw Normal View History

2020-07-18 02:47:33 +02:00
#include "common.h"
INCLUDE_API_ASM("code_fe0b0_len_5a0", SetSpriteShading);
2020-07-18 02:47:33 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus EnableSpriteShading(ScriptInstance* script, s32 isInitialCall) {
2020-07-18 02:47:33 +02:00
if (get_variable(script, *script->ptrReadPos) != 0) {
*D_80151328 |= 1;
} else {
*D_80151328 &= ~1;
}
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-07-18 02:47:33 +02:00
}
2020-09-24 05:16:13 +02:00
s32 GetDemoState(ScriptInstance* script) {
2020-09-14 01:03:22 +02:00
set_variable(script, *script->ptrReadPos, GAME_STATUS->demoState);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-07-18 02:47:33 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus DemoPressButton(ScriptInstance* script, s32 isInitialCall) {
2020-09-14 01:03:22 +02:00
GAME_STATUS->demoButtonInput |= get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-07-18 02:47:33 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus DemoReleaseButton(ScriptInstance* script, s32 isInitialCall) {
2020-09-14 01:03:22 +02:00
GAME_STATUS->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-07-18 02:47:33 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus DemoSetButtons(ScriptInstance* script, s32 isInitialCall) {
2020-09-14 01:03:22 +02:00
GAME_STATUS->demoButtonInput = get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-07-18 02:47:33 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus DemoJoystickRadial(ScriptInstance* script, s32 isInitialCall) {
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
2020-09-14 01:03:22 +02:00
GAME_STATUS->demoStickX = a * sin_deg(b);
GAME_STATUS->demoStickY = a * cos_deg(b);
2020-08-12 04:08:48 +02:00
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-07-18 02:47:33 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus DemoJoystickXY(ScriptInstance* script, s32 isInitialCall) {
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-09-14 01:03:22 +02:00
GAME_STATUS->demoStickX = x;
GAME_STATUS->demoStickY = y;
2020-07-18 02:47:33 +02:00
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
}