Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions config/RSPE01_01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6969,7 +6969,7 @@ fn_80186054 = .text:0x80186054; // type:function size:0xAC
fn_80186100 = .text:0x80186100; // type:function size:0x8
fn_80186108 = .text:0x80186108; // type:function size:0x12C
setLanguage__17RPSysProjectLocalFQ217RPSysProjectLocal5EArea = .text:0x80186234; // type:function size:0x8
setDialect__17RPSysProjectLocalFQ217RPSysProjectLocal5EArea = .text:0x8018623C; // type:function size:0x8
setLocale__17RPSysProjectLocalFQ217RPSysProjectLocal5EArea = .text:0x8018623C; // type:function size:0x8
appendLocalDirectory__17RPSysProjectLocalFPcPCc = .text:0x80186244; // type:function size:0x120
__dt__17RPSysProjectLocalFv = .text:0x80186364; // type:function size:0x40
CreateInstance__17RPSysProjectLocalFPQ23EGG4Heap = .text:0x801863A4; // type:function size:0x8C
Expand Down Expand Up @@ -7613,16 +7613,16 @@ fn_8019FFE0 = .text:0x8019FFE0; // type:function size:0x11C
fn_801A00FC = .text:0x801A00FC; // type:function size:0x134
fn_801A0230 = .text:0x801A0230; // type:function size:0x60
fn_801A0290 = .text:0x801A0290; // type:function size:0x2C
fn_801A02BC = .text:0x801A02BC; // type:function size:0xB4
fn_801A0370 = .text:0x801A0370; // type:function size:0xA8
fn_801A0418 = .text:0x801A0418; // type:function size:0x6C
fn_801A0484 = .text:0x801A0484; // type:function size:0xFC
fn_801A0580 = .text:0x801A0580; // type:function size:0x1F4
fn_801A0774 = .text:0x801A0774; // type:function size:0xFC
fn_801A0870 = .text:0x801A0870; // type:function size:0xDC
fn_801A094C = .text:0x801A094C; // type:function size:0x64
fn_801A09B0 = .text:0x801A09B0; // type:function size:0x60
fn_801A0A10 = .text:0x801A0A10; // type:function size:0x50
ChangePointHalfFull__18RPSysStringUtilityFPw = .text:0x801A02BC; // type:function size:0xB4
ChangePoint__18RPSysStringUtilityFPw = .text:0x801A0370; // type:function size:0xA8
GetFloat__18RPSysStringUtilityFPCw = .text:0x801A0418; // type:function size:0x6C
GetStringHalfSizeTime__18RPSysStringUtilityFUlUlPw = .text:0x801A0484; // type:function size:0xFC
GetStringHalfSizeDate__18RPSysStringUtilityFUlUlUlPwUll = .text:0x801A0580; // type:function size:0x1F4
GetStringHalfSizeNumber__18RPSysStringUtilityFfllPwUlbQ218RPSysStringUtility8FillType = .text:0x801A0774; // type:function size:0xFC
GetStringFullSizeNumber__18RPSysStringUtilityFlPwUlb = .text:0x801A0870; // type:function size:0xDC
GetStringHalfSizeNumber__18RPSysStringUtilityFlPwUlb = .text:0x801A094C; // type:function size:0x64
IsSingular__18RPSysStringUtilityFf = .text:0x801A09B0; // type:function size:0x60
IsSingular__18RPSysStringUtilityFl = .text:0x801A0A10; // type:function size:0x50
calc__26RPSysKokeshiCtrlDataLoaderFv = .text:0x801A0A60; // type:function size:0x84
isIdle__26RPSysKokeshiCtrlDataLoaderCFv = .text:0x801A0AE4; // type:function size:0x18
load__26RPSysKokeshiCtrlDataLoaderFv = .text:0x801A0AFC; // type:function size:0x70
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ def MatchingFor(*versions):
Object(NonMatching, "Pack/RPKernel/RPSysLytDynamicAnm.cpp"),
Object(Matching, "Pack/RPKernel/RPSysKokeshiIterater.cpp"),
Object(NonMatching, "Pack/RPKernel/RPSysCursorDrawMgr.cpp"),
Object(NonMatching, "Pack/RPKernel/RPSysStringUtility.cpp"),
Object(Matching, "Pack/RPKernel/RPSysStringUtility.cpp"),
Object(Matching, "Pack/RPKernel/RPSysKokeshiCtrlDataLoader.cpp"),
Object(NonMatching, "Pack/RPKernel/RPSysPauseMenu.cpp"),
Object(NonMatching, "Pack/RPKernel/RPSysSystemWinMgr.cpp"),
Expand Down
1 change: 1 addition & 0 deletions include/Pack/RPKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <Pack/RPKernel/RPSysNWC24Manager.h>
#include <Pack/RPKernel/RPSysOfficialDB.h>
#include <Pack/RPKernel/RPSysParticleManager.h>
#include <Pack/RPKernel/RPSysStringUtility.h>
#include <Pack/RPKernel/RPSysTagProcessor.h>
#include <Pack/RPKernel/RPSysTextWriter.h>
#include <Pack/RPKernel/RPSysWideTextWriter.h>
Expand Down
130 changes: 130 additions & 0 deletions include/Pack/RPKernel/RPSysStringUtility.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#ifndef RP_KERNEL_STRING_UTILITY_H
#define RP_KERNEL_STRING_UTILITY_H
#include <Pack/types_pack.h>

//! @addtogroup rp_kernel
//! @{

/**
* @brief String utility functions
*/
class RPSysStringUtility {
public:
/**
* @brief Decimal point fill type
*/
enum FillType {
FillType_HalfWidth, //!< Use half-width characters
FillType_FullWidth, //!< Use full-width characters
};

public:
/**
* @brief Tests whether the specified integral value is a singular noun
*
* @param x Integral value
*/
static bool IsSingular(s32 x);

/**
* @brief Tests whether the specified decimal value is a singular noun
*
* @param x Decimal value
*/
static bool IsSingular(f32 x);

/**
* @brief Converts the specified integer to a half-width string
*
* @param x Integer value
* @param[out] pBuffer String buffer
* @param maxLen Buffer length
* @param plusSign Whether to include signage for positive values
*/
static void GetStringHalfSizeNumber(s32 x, wchar_t* pBuffer, u32 maxLen,
bool plusSign = false);

/**
* @brief Converts the specified integer to a full-width string
*
* @param x Integer value
* @param[out] pBuffer String buffer
* @param maxLen Buffer length
* @param plusSign Whether to include signage for positive values
*/
static void GetStringFullSizeNumber(s32 x, wchar_t* pBuffer, u32 maxLen,
bool plusSign = false);

/**
* @brief Converts the specified decimal to a half-width string
*
* @param x Decimal value
* @param width Value string width
* @param precision Value string precision
* @param[out] pBuffer String buffer
* @param maxLen Buffer length
* @param plusSign Whether to include signage for positive values
* @param fillType Decimal point fill type
*/
static void GetStringHalfSizeNumber(f32 x, s32 width, s32 precision,
wchar_t* pBuffer, u32 maxLen,
bool plusSign, FillType fillType);

/**
* @brief Converts half-width characters in the specified string to
* full-width characters
*
* @param[in,out] pStr Input string
*/
static void ChangeToFullSize(wchar_t* pStr);

/**
* @brief Converts the specified date to a half-width string
*
* @param year Year
* @param month Month
* @param day Day
* @param[out] pBuffer String buffer
* @param maxLen Buffer length
* @param yearSize Number of digits to use when expressing the year
*/
static void GetStringHalfSizeDate(u32 year, u32 month, u32 day,
wchar_t* pBuffer, u32 maxLen,
s32 yearSize = 4);

/**
* @brief Converts the specified time to a half-width string
*
* @param hour Hour
* @param min Minute
* @param[out] pBuffer String buffer
*/
static void GetStringHalfSizeTime(u32 hour, u32 min, wchar_t* pBuffer);

/**
* @brief Parses a float value from the specified string
* @details This function supports strings using commas as the decimal
*
* @param pStr Input string
*/
static f32 GetFloat(const wchar_t* pStr);

/**
* @brief Changes decimal points in the specified string to match the locale
*
* @param pStr Input string
*/
static void ChangePoint(wchar_t* pStr);

/**
* @brief Swaps decimal points in the specified string between half and full
* width
*
* @param pStr Input string
*/
static void ChangePointHalfFull(wchar_t* pStr);
};

//! @}

#endif
16 changes: 8 additions & 8 deletions include/Pack/RPSystem/RPSysProjectLocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ class RPSysProjectLocal {
void appendLocalDirectory(char* pPath, const char* pSuffix = "");

/**
* @brief Sets the current dialect
* @brief Sets the current locale
*
* @param dialect Dialect area
* @param locale Locale area
*/
void setDialect(EArea dialect);
void setLocale(EArea locale);

/**
* @brief Sets the current language
Expand All @@ -88,10 +88,10 @@ class RPSysProjectLocal {
}

/**
* @brief Gets the current language dialect
* @brief Gets the current game locale
*/
EArea getDialect() const {
return mDialect;
EArea getLocale() const {
return mLocale;
}

/**
Expand Down Expand Up @@ -120,8 +120,8 @@ class RPSysProjectLocal {
ERegion mRegion; // at 0x8
//! Pack Project title
RPSysSceneCreator::EPackID mPack; // at 0xC
//! Language dialect
EArea mDialect; // at 0x10
//! Game locale
EArea mLocale; // at 0x10
//! Game language
EArea mLanguage; // at 0x14
//! Whether the display is 50Hz
Expand Down
2 changes: 1 addition & 1 deletion include/nw4r/ut/ut_FileStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FileStream : public IOStream {
public:
NW4R_UT_RTTI_DECL(FileStream);

enum SeekOrigin { SEEK_BEG, SEEK_CUR, SEEK_END };
enum SeekOrigin { SEEK_ORIGIN_BEG, SEEK_ORIGIN_CUR, SEEK_ORIGIN_END };

public:
FileStream() {}
Expand Down
Loading
Loading