mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
rename gGameStatus and add INCLUDE_ASM macro
This commit is contained in:
parent
dd36e2bf12
commit
9d777793c7
@ -5,5 +5,6 @@
|
||||
#include "common_structs.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "macros.h"
|
||||
|
||||
#endif
|
||||
|
7
papermario/include/macros.h
Normal file
7
papermario/include/macros.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef _MACROS_H_
|
||||
#define _MACROS_H_
|
||||
|
||||
#define INCLUDE_ASM(FOLDER, NAME) \
|
||||
void __attribute__((naked)) NAME(void) { __asm__( ".include \"asm/"#FOLDER"/"#NAME".s\"\n"); }
|
||||
|
||||
#endif
|
@ -4,7 +4,7 @@
|
||||
#include "ultra64.h"
|
||||
#include "common_structs.h"
|
||||
|
||||
extern game_status* gGameStatus[1];
|
||||
extern game_status* gGameStatusPtr[1];
|
||||
extern s16* D_80151328;
|
||||
|
||||
#endif
|
||||
|
@ -14,14 +14,6 @@ void func_80147230(void) {
|
||||
D_8015C7C0 = D_8014F140;
|
||||
}
|
||||
|
||||
void __attribute__((naked)) UpdateMusicPlayers(void) {
|
||||
__asm__(
|
||||
".include \"asm/code_dd930_len_1c0/UpdateMusicPlayers.s\"\n"
|
||||
);
|
||||
}
|
||||
INCLUDE_ASM(code_dd930_len_1c0, UpdateMusicPlayers);
|
||||
|
||||
void __attribute__((naked)) play_ambient_sounds(void) {
|
||||
__asm__(
|
||||
".include \"asm/code_dd930_len_1c0/play_ambient_sounds.s\"\n"
|
||||
);
|
||||
}
|
||||
INCLUDE_ASM(code_dd930_len_1c0, play_ambient_sounds);
|
@ -1,10 +1,6 @@
|
||||
#include "common.h"
|
||||
|
||||
void __attribute__((naked)) SetSpriteShading(void) {
|
||||
__asm__(
|
||||
".include \"asm/code_fe0b0_len_5a0/SetSpriteShading.s\"\n"
|
||||
);
|
||||
}
|
||||
INCLUDE_ASM(code_fe0b0_len_5a0, SetSpriteShading);
|
||||
|
||||
s32 EnableSpriteShading(ScriptContext* script) {
|
||||
if (get_variable(script, *script->ptrReadPos) != 0) {
|
||||
@ -16,49 +12,49 @@ s32 EnableSpriteShading(ScriptContext* script) {
|
||||
}
|
||||
|
||||
s32 getDemoState(ScriptContext* script) {
|
||||
set_variable(script, *script->ptrReadPos, (*gGameStatus)->demoState);
|
||||
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->demoState);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoPressButton(ScriptContext* script) {
|
||||
(*gGameStatus)->demoButtonInput |= get_variable(script, *script->ptrReadPos);
|
||||
(*gGameStatusPtr)->demoButtonInput |= get_variable(script, *script->ptrReadPos);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoReleaseButton(ScriptContext* script) {
|
||||
(*gGameStatus)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
|
||||
(*gGameStatusPtr)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoSetButtons(ScriptContext* script) {
|
||||
(*gGameStatus)->demoButtonInput = get_variable(script, *script->ptrReadPos);
|
||||
(*gGameStatusPtr)->demoButtonInput = get_variable(script, *script->ptrReadPos);
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoJoystickRadial(ScriptContext* script) {
|
||||
float a;
|
||||
float b;
|
||||
f32 a;
|
||||
f32 b;
|
||||
s32* thisPos = script->ptrReadPos;
|
||||
|
||||
a = get_float_variable(script, *thisPos++);
|
||||
b = get_float_variable(script, *thisPos++);
|
||||
|
||||
(*gGameStatus)->demoStickX = a * sin_deg(b);
|
||||
(*gGameStatus)->demoStickY = a * cos_deg(b);
|
||||
(*gGameStatusPtr)->demoStickX = a * sin_deg(b);
|
||||
(*gGameStatusPtr)->demoStickY = a * cos_deg(b);
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 DemoJoystickXY(ScriptContext* script) {
|
||||
float a;
|
||||
float b;
|
||||
f32 a;
|
||||
f32 b;
|
||||
s32* thisPos = script->ptrReadPos;
|
||||
|
||||
a = get_float_variable(script, *thisPos++);
|
||||
b = get_float_variable(script, *thisPos++);
|
||||
|
||||
(*gGameStatus)->demoStickX = a;
|
||||
(*gGameStatus)->demoStickY = b;
|
||||
(*gGameStatusPtr)->demoStickX = a;
|
||||
(*gGameStatusPtr)->demoStickY = b;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ D_00316C00 = 0x00316C00;
|
||||
D_00316D90 = 0x00316D90;
|
||||
D_00316F30 = 0x00316F30;
|
||||
|
||||
gGameStatus = 0x8007419C;
|
||||
gGameStatusPtr = 0x8007419C;
|
||||
|
||||
D_8014F140 = 0x8014F140;
|
||||
D_80151328 = 0x80151328;
|
||||
|
Loading…
Reference in New Issue
Block a user