use parallel headers rather than functions.h

This commit is contained in:
Alex Bates 2020-10-14 23:37:23 +01:00
parent ff3fbdfa8f
commit 87e7d5bf7e
No known key found for this signature in database
GPG Key ID: 5E11C2DB78877706
7 changed files with 49 additions and 19 deletions

View File

@ -86,7 +86,7 @@ $(BUILD_DIR)/$(TARGET).elf: $(O_FILES) $(LD_SCRIPT)
$(BUILD_DIR)/%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(BUILD_DIR)/%.o: %.c $(H_FILES)
$(BUILD_DIR)/%.o: %.c %.h $(H_FILES)
cpp $(CPPFLAGS) $< | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) - -o $@
$(BUILD_DIR)/%.o: %.bin

View File

@ -1,9 +1,4 @@
#include "common.h"
void set_curtain_scale_goal(f32 arg0);
void set_curtain_fade_goal(f32 arg0);
void intro_logos_set_fade_alpha(s16 new_alpha);
void intro_logos_set_fade_color(s16 arg0);
#include "code_11a50_len_7a0.h"
#ifdef NON_MATCHING
void begin_state_intro(void) {

8
src/code_11a50_len_7a0.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef _CODE_11A50_LEN_7A0_H_
#define _CODE_11A50_LEN_7A0_H_
#include "common.h"
#include "code_ebd0_len_6a0.h"
#include "code_6e40_len_500.h"
#endif

View File

@ -1,4 +1,4 @@
#include "common.h"
#include "code_6e40_len_500.h"
void initialize_curtains(void) {
D_8009BAA0 = 0;

15
src/code_6e40_len_500.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef _CODE_6E40_LEN_500_H_
#define _CODE_6E40_LEN_500_H_
#include "common.h"
void initialize_curtains(void);
void update_curtains(void);
// render_curtains
void set_curtain_scale_goal(f32 arg0);
void set_curtain_scale(f32 arg0);
void set_curtain_draw_callback(s32 arg0);
void set_curtain_fade_goal(f32 arg0);
void set_curtain_fade(f32 arg0);
#endif

View File

@ -1,24 +1,24 @@
#include "common.h"
#include "code_ebd0_len_6a0.h"
void intro_logos_set_fade_alpha(s16 new_alpha) {
void intro_logos_set_fade_alpha(s16 alpha) {
GameStatus* gameStatus = GAME_STATUS;
gameStatus->bootAlpha = new_alpha;
gameStatus->bootAlpha = alpha;
}
void intro_logos_set_fade_color(s16 arg0) {
void intro_logos_set_fade_color(s16 color) {
GameStatus* gameStatus = GAME_STATUS;
gameStatus->bootRed = arg0;
gameStatus->bootGreen = arg0;
gameStatus->bootBlue = arg0;
gameStatus->bootRed = color;
gameStatus->bootGreen = color;
gameStatus->bootBlue = color;
}
s16 intro_logos_fade_in(subtract_val) {
s16 intro_logos_fade_in(s16 subtractAlpha) {
GameStatus* gameStatus = GAME_STATUS;
if (gameStatus->bootAlpha != 0) {
gameStatus->bootAlpha -= subtract_val;
gameStatus->bootAlpha -= subtractAlpha;
if (gameStatus->bootAlpha << 16 < 0) {
gameStatus->bootAlpha = 0;
}
@ -28,11 +28,11 @@ s16 intro_logos_fade_in(subtract_val) {
return 0;
}
s16 intro_logos_fade_out(add_val) {
s16 intro_logos_fade_out(s16 addAlpha) {
GameStatus* gameStatus = GAME_STATUS;
if (gameStatus->bootAlpha != 0xFF) {
gameStatus->bootAlpha += add_val;
gameStatus->bootAlpha += addAlpha;
if ((gameStatus->bootAlpha > 0xFF)) {
gameStatus->bootAlpha = 0xFF;
}

12
src/code_ebd0_len_6a0.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef _CODE_EBD0_LEN_6A0_H_
#define _CODE_EBD0_LEN_6A0_H_
#include "common.h"
void intro_logos_set_fade_alpha(s16 alpha);
void intro_logos_set_fade_color(s16 color);
s16 intro_logos_fade_in(s16 subtractAlpha);
s16 intro_logos_fade_out(s16 addAlpha);
void intro_logos_update_fade(void);
#endif