Skip to content

Commit

Permalink
Implement & link m_diary, m_scene_table
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuyler36 committed Nov 1, 2024
1 parent 541fddf commit 97487ed
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 509 deletions.
6 changes: 3 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ def MatchingFor(*versions):
Object(Matching, "game/m_debug_mode.c"),
Object(Matching, "game/m_demo.c"),
Object(NonMatching, "game/m_design_ovl.c"),
Object(NonMatching, "game/m_diary.c"),
Object(Matching, "game/m_diary.c"),
Object(NonMatching, "game/m_diary_ovl.c"),
Object(Matching, "game/m_eappli.c"),
Object(Matching, "game/m_editEndChk_ovl.c"),
Expand Down Expand Up @@ -1464,9 +1464,9 @@ def MatchingFor(*versions):
Object(Matching, "game/m_room_type.c"),
Object(Matching, "game/m_scene.c"),
Object(Matching, "game/m_scene_ftr.c"),
Object(NonMatching, "game/m_scene_table.c"),
Object(Matching, "game/m_scene_table.c"),
Object(Matching, "game/m_select.c"),
Object(NonMatching, "game/m_shop.c"),
Object(Equivalent, "game/m_shop.c"),
Object(Matching, "game/m_skin_matrix.c"),
Object(Matching, "game/m_snowman.c"),
Object(Matching, "game/m_soncho.c"),
Expand Down
1 change: 1 addition & 0 deletions include/m_diary.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ typedef struct diary_data_s {
} mDi_data_c;

extern int mDi_strlen(u8* str, int max_len, u8 end_char);
extern void mDi_init_diary(mDi_entry_c* entry_p);

#ifdef __cplusplus
}
Expand Down
28 changes: 28 additions & 0 deletions src/game/m_diary.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "m_diary.h"

#include "libultra/libultra.h"
#include "m_lib.h"
#include "m_font.h"

extern int mDi_strlen(u8* str, int max_len, u8 end_char) {
int i;

str += max_len - 1;
for (i = max_len; i != 0; i--) {
if (*str != end_char) {
return i;
}
str--;
}

return 0;
}

static void mDi_clear_diary(mDi_entry_c* entry_p) {
bzero(entry_p->text, sizeof(entry_p->text));
mem_clear(entry_p->text, sizeof(entry_p->text), CHAR_SPACE);
}

extern void mDi_init_diary(mDi_entry_c* entry_p) {
mDi_clear_diary(entry_p);
}
3 changes: 3 additions & 0 deletions src/game/m_scene_table.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "m_scene.h"

Scene_data_status_c scene_data_status[SCENE_NUM] = {};
Loading

0 comments on commit 97487ed

Please sign in to comment.