Skip to content

Commit

Permalink
Move MY_COMMENT_LENGTH to iosu_fpd.h for nn_fp.cpp (and some other th…
Browse files Browse the repository at this point in the history
…ings)
  • Loading branch information
gf2p8affineqb committed Aug 8, 2024
1 parent 5b72056 commit 58cc2ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Cafe/IOSU/legacy/iosu_fpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,6 @@ namespace iosu
{
if(numVecIn != 0 || numVecOut != 1)
return FPResult_InvalidIPCParam;
static constexpr uint32 MY_COMMENT_LENGTH = 0x12;
std::basic_string<uint16be> myComment;
if(g_fpd.nexFriendSession)
{
Expand Down
1 change: 1 addition & 0 deletions src/Cafe/IOSU/legacy/iosu_fpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ namespace iosu
static const int RELATIONSHIP_FRIEND = 3;

static const int GAMEMODE_MAX_MESSAGE_LENGTH = 0x80; // limit includes null-terminator character, so only 0x7F actual characters can be used
static const int MY_COMMENT_LENGTH = 0x12;

enum class FPD_REQUEST_ID
{
Expand Down
8 changes: 4 additions & 4 deletions src/Cafe/OS/libs/nn_fp/nn_fp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,11 @@ namespace nn
return ipcCtx->Submit(std::move(ipcCtx));
}

nnResult GetMyComment(iosu::fpd::FPDPreference* myPreference)
nnResult GetMyComment(uint16be* myComment)
{
FP_API_BASE();
auto ipcCtx = std::make_unique<FPIpcContext>(iosu::fpd::FPD_REQUEST_ID::GetMyComment);
ipcCtx->AddOutput(myPreference, sizeof(uint16be)*0x12);
ipcCtx->AddOutput(myComment, iosu::fpd::MY_COMMENT_LENGTH * sizeof(uint16be));
return ipcCtx->Submit(std::move(ipcCtx));
}

Expand Down Expand Up @@ -627,8 +627,8 @@ namespace nn
{
FP_API_BASE();
auto ipcCtx = std::make_unique<FPIpcContext>(iosu::fpd::FPD_REQUEST_ID::UpdateCommentAsync);
uint32 commentLen = CafeStringHelpers::Length(newComment, 17);
if (commentLen >= 17)
uint32 commentLen = CafeStringHelpers::Length(newComment, iosu::fpd::MY_COMMENT_LENGTH-1);
if (commentLen >= iosu::fpd::MY_COMMENT_LENGTH-1)
{
cemuLog_log(LogType::Force, "UpdateCommentAsync: message too long");
return FPResult_InvalidIPCParam;
Expand Down

0 comments on commit 58cc2ac

Please sign in to comment.