swkbd: Add support for multiple FW versions#62
swkbd: Add support for multiple FW versions#62german77 wants to merge 3 commits intoopen-ead:masterfrom
Conversation
Fuzzy2319
left a comment
There was a problem hiding this comment.
@Fuzzy2319 reviewed 1 file and all commit messages, and made 7 comments.
Reviewable status: 1 of 3 files reviewed, 7 unresolved discussions (waiting on german77).
include/nn/applet.h line 5 at r1 (raw file):
namespace nn::applet { enum class ExitReason { Normal = 0, Canceled = 1, Abnormal = 2, Unexpected = 10 }; typedef int LibraryAppletHandle;
please use using instead of typedef
suggestion:
using LibraryAppletHandle = s32;include/nn/swkbd/swkbd.h line 121 at r1 (raw file):
bool isUseUtf8; bool isUseBlurBackground; int initialStringOffset;
please use s32 instead of int
include/nn/swkbd/swkbd.h line 186 at r1 (raw file):
}; typedef TextCheckResult (*TextCheckCb)(void*, ulong*, String*);
suggestion:
using TextCheckCb = TextCheckResult (*)(void*, ulong*, String*);include/nn/swkbd/swkbd.h line 197 at r1 (raw file):
Result GetInteractiveOutStorageCallback(nn::applet::LibraryAppletHandle, String*, const ShowKeyboardArg&); ulong GetRequiredTextCheckWorkBufferSize();
Shouldn't this one return a size_t instead?
include/nn/swkbd/swkbd.h line 221 at r1 (raw file):
ulong GetRequiredWorkBufferSize(bool); #if NN_SDK_VER >= NN_MAKE_VER(1, 0, 0) && NN_SDK_VER < NN_MAKE_VER(2, 0, 0)
This function is listed in SMO's sdk which use NN_SDK_VER 3.5.1
include/nn/swkbd/swkbd.h line 226 at r1 (raw file):
#if NN_SDK_VER >= NN_MAKE_VER(3, 0, 0) ulong GetRequiredWorkBufferSize();
This function doesn't exist in SMO's sdk
include/nn/swkbd/swkbd.h line 256 at r1 (raw file):
#if NN_SDK_VER < NN_MAKE_VER(4, 0, 0) nn::applet::ExitReason GetExitReason();
For some reason this one start with g instead of G
suggestion:
nn::applet::ExitReason getExitReason();
german77
left a comment
There was a problem hiding this comment.
@german77 made 7 comments.
Reviewable status: 1 of 3 files reviewed, 7 unresolved discussions (waiting on Fuzzy2319).
include/nn/applet.h line 5 at r1 (raw file):
Previously, Fuzzy2319 wrote…
please use
usinginstead oftypedefsuggestion:
using LibraryAppletHandle = s32;
Done.
include/nn/swkbd/swkbd.h line 121 at r1 (raw file):
Previously, Fuzzy2319 wrote…
please use
s32instead ofint
Done.
include/nn/swkbd/swkbd.h line 186 at r1 (raw file):
Previously, Fuzzy2319 wrote…
suggestion:
using TextCheckCb = TextCheckResult (*)(void*, ulong*, String*);
Done.
include/nn/swkbd/swkbd.h line 197 at r1 (raw file):
Previously, Fuzzy2319 wrote…
Shouldn't this one return a
size_tinstead?
Done.
include/nn/swkbd/swkbd.h line 221 at r1 (raw file):
Previously, Fuzzy2319 wrote…
This function is listed in SMO's sdk which use
NN_SDK_VER3.5.1
Done. Fun this function moved places
include/nn/swkbd/swkbd.h line 226 at r1 (raw file):
Previously, Fuzzy2319 wrote…
This function doesn't exist in SMO's sdk
Done. I confused GetRequiredWorkBufferSize with GetRequiredStringBufferSize
include/nn/swkbd/swkbd.h line 256 at r1 (raw file):
Previously, Fuzzy2319 wrote…
For some reason this one start with
ginstead ofGsuggestion:
nn::applet::ExitReason getExitReason();
Done.
Fuzzy2319
left a comment
There was a problem hiding this comment.
@Fuzzy2319 reviewed all commit messages, made 1 comment, and resolved 6 discussions.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on german77).
include/nn/applet.h line 5 at r1 (raw file):
Previously, german77 (Narr the Reg) wrote…
Done.
Forgot what I said LibraryAppletHandle is a struct because it appear in the mangled name of _ZN2nn5swkbd24ReadCloseResultAndStringENS_6applet19LibraryAppletHandleEPNS0_11CloseResultEPNS0_6StringE and with a using or a typedef it will mangle like this _ZN2nn5swkbd24ReadCloseResultAndStringEiEPNS0_11CloseResultEPNS0_6StringE https://godbolt.org/z/f7jqcd98Y
german77
left a comment
There was a problem hiding this comment.
@german77 made 1 comment.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on Fuzzy2319).
include/nn/applet.h line 5 at r1 (raw file):
Previously, Fuzzy2319 wrote…
Forgot what I said
LibraryAppletHandleis a struct because it appear in the mangled name of_ZN2nn5swkbd24ReadCloseResultAndStringENS_6applet19LibraryAppletHandleEPNS0_11CloseResultEPNS0_6StringEand with ausingor atypedefit will mangle like this_ZN2nn5swkbd24ReadCloseResultAndStringEiEPNS0_11CloseResultEPNS0_6StringEhttps://godbolt.org/z/f7jqcd98Y
Done. I always forget who is an alias and who overrides the type. Thanks for checking. The handle is indeed a struct but handles are only a number in the client side.
Fuzzy2319
left a comment
There was a problem hiding this comment.
@Fuzzy2319 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on german77).
include/nn/applet.h line 5 at r1 (raw file):
Previously, german77 (Narr the Reg) wrote…
Done. I always forget who is an alias and who overrides the type. Thanks for checking. The handle is indeed a struct but handles are only a number in the client side.
Something happend on this file it was rolled back.
german77
left a comment
There was a problem hiding this comment.
@german77 made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on Fuzzy2319).
include/nn/applet.h line 5 at r1 (raw file):
Previously, Fuzzy2319 wrote…
Something happend on this file it was rolled back.
Not sure why it rolled back but I did a bit of research. This struct contains a service handle, applet id, applet mode, exit event, exit reason, indirect layer consumer handle along with other status flags.
I only have the locations but not the actual type so I decided to stub these for now.
Fuzzy2319
left a comment
There was a problem hiding this comment.
@Fuzzy2319 reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on german77).
Add headers for all swkbd revisions from 0x5 up to 0x8000D or firmware 0 to 16.
Apparently there's a new revision in fw 19 but I don't have anything higher than fw 16 to validate against.
NN_SDK_VERis null if the target definition is set to private for whatever reason on SMO. If anyone has an actual understanding on how that works you are welcome.closes #50
This change is