Skip to content

Commit

Permalink
d_save_init OK
Browse files Browse the repository at this point in the history
  • Loading branch information
TakaRikka committed Sep 10, 2023
1 parent 1e1daca commit 5b7dc79
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 12 deletions.
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def NonMatching(obj_path, **kwargs):
Matching ("d/d_particle_name.cpp"),
NonMatching("d/d_s_title.cpp"),
NonMatching("d/d_save.cpp"),
NonMatching("d/d_save_init.cpp"),

# ?
NonMatching("DynamicLink.cpp"),
Expand Down
1 change: 1 addition & 0 deletions include/d/d_bg_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "global.h"
#include "SSystem/SComponent/c_sxyz.h"
#include "SSystem/SComponent/c_xyz.h"

class cBgS_LinChk;
class cBgS_GndChk;
Expand Down
16 changes: 14 additions & 2 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef D_COM_D_COM_INF_GAME_H
#define D_COM_D_COM_INF_GAME_H

#include "d/d_save.h"
#include "d/d_bg_s.h"
#include "d/d_cc_s.h"
#include "d/d_stage.h"
#include "d/d_event.h"
#include "d/d_event_manager.h"
#include "d/d_resorce.h"
#include "d/d_save.h"
#include "d/d_stage.h"

class JKRArchive;
class JKRExpHeap;
Expand Down Expand Up @@ -269,6 +269,10 @@ class dComIfG_inf_c {

extern dComIfG_inf_c g_dComIfG_gameInfo;

/**
* === SAVE ===
*/

inline u8 dComIfGs_getSelectEquip(int param_0) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(param_0);
}
Expand All @@ -277,4 +281,12 @@ inline u8 dComIfGs_getItem(int param_0) {
return g_dComIfG_gameInfo.info.getPlayer().getItem().getItem(param_0);
}

inline void dComIfGs_setEventReg(u16 i_reg, u8 i_no) {
g_dComIfG_gameInfo.info.getEvent().setEventReg(i_reg, i_no);
}

/**
* === PLAY ===
*/

#endif /* D_COM_D_COM_INF_GAME_H */
2 changes: 2 additions & 0 deletions include/d/d_save.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ class dSv_save_c {
/* 8005D860 */ void init();

dSv_player_c& getPlayer() { return mPlayer; }
dSv_event_c& getEvent() { return mEvent; }

dSv_memory_c& getSave(int i_stageNo) { return mMemory[i_stageNo]; }
void putSave(int i_stageNo, dSv_memory_c i_mem) { mMemory[i_stageNo] = i_mem; }
Expand Down Expand Up @@ -806,6 +807,7 @@ class dSv_info_c {
/* 8005ED00 */ int initdata_to_card(char*, int);

dSv_player_c& getPlayer() { return mSavedata.getPlayer(); }
dSv_event_c& getEvent() { return mSavedata.getEvent(); }

static const int MEMORY_SWITCH = 0x80;
static const int DAN_SWITCH = 0x40;
Expand Down
6 changes: 6 additions & 0 deletions include/d/d_save_init.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef D_D_SAVE_INIT_H
#define D_D_SAVE_INIT_H

void setInitEventBit();

#endif /* D_D_SAVE_INIT_H */
3 changes: 1 addition & 2 deletions src/d/d_save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
//

#include "d/d_save.h"
#include "d/d_save_init.h"
#include "d/d_com_inf_game.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "MSL_C/string.h"
#include "SSystem/SComponent/c_lib.h"
#include "SSystem/SComponent/c_math.h"
#include "MSL_C/stdio.h"

extern void setInitEventBit();

struct daNpc_Sarace_c {
static int ship_race_rupee;
static int ship_race_result;
Expand Down
21 changes: 13 additions & 8 deletions src/d/d_save_init.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
//
// Generated by dtk
// Translation Unit: d_save_init.cpp
//
/**
* d_save_init.cpp
*
*/

#include "d_save_init.h"
#include "dolphin/types.h"
#include "d/d_save_init.h"
#include "d/d_com_inf_game.h"

// move later
struct daNpc_Kg1_c {
static u8 m_highscore;
};

/* 8005EF88-8005EFDC .text setInitEventBit__Fv */
void setInitEventBit() {
/* Nonmatching */
dComIfGs_setEventReg(0xBEFF, daNpc_Kg1_c::m_highscore);
dComIfGs_setEventReg(0x7EFF, 0xE);
}

0 comments on commit 5b7dc79

Please sign in to comment.