Discussion Does anyone have a working method of text input?

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by jfmherokiller, Aug 8, 2018.

  1. jfmherokiller
    OP

    jfmherokiller Member

    Newcomer
    1
    Jan 6, 2017
    United States
    I would like to attempt to port something like Zork to the switch but I'm unable to devise my own method of allowing the player to input text.

    Something like the input method used in godmode9 as linked below would work just fine.
    https://github.com/d0k3/GodMode9/blob/master/arm9/source/common/ui.c#L636

    I also found this
    https://github.com/zrafa/onscreenkeyboard

    I'm asking if this exists because as far as my reading of the libnx source code allowed me to observe. It does not have the ability to launch library applets yet.
    So what I would like to know is if someone has already created a good method.

    I attempted to copy the behavior of godmode9 myself and my attempt which is still in the early stages can be seen in the gist below.

    https://gist.github.com/jfmherokiller/288b95479593ea0e25f3c866b537d718
     
    Darksabre72 and Meepers55 like this.
  2. filfat

    filfat Musician, Developer & Entrepreneur

    Member
    8
    GBAtemp Patron
    filfat is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Nov 24, 2012
    Why not just use the keyboard applet? I'm sure someone over at reswitch would help you out.
     
  3. jfmherokiller
    OP

    jfmherokiller Member

    Newcomer
    1
    Jan 6, 2017
    United States
    I dont know how to reach them and I did my research and both libtransistor and libnx do not have the code required to launch applets.
     
  4. daxtsu

    daxtsu GBAtemp Guru

    Member
    14
    Jun 9, 2007
    Antarctica
    jfmherokiller likes this.
  5. jfmherokiller
    OP

    jfmherokiller Member

    Newcomer
    1
    Jan 6, 2017
    United States
    Thank you for that I was attempting to launch it via code copied from the file https://github.com/switchbrew/libnx/blob/master/nx/source/services/applet.c

    Which wasnt exactly working, only issue with what you linked is its using the libtransistor library while I primarily use libnx. But ill see if i can convert it.
     
    Last edited by jfmherokiller, Aug 9, 2018
  6. jfmherokiller
    OP

    jfmherokiller Member

    Newcomer
    1
    Jan 6, 2017
    United States
    In terms of converting thier code into something i can use I seem to have hit a snag. I seem to be unable to replicate thier IStorageAccessor Write function using libnx.
    Their implementation correctly calls the function in yuzu. While, my implementation seems to just crash yuzu with no output on why it crashed (In the log It does not even show the api being called).
    I know its something with my implementation because my GetSize implementation works correctly and shows up in the yuzu log.
    If I had to guess I'd say something is going on with the buffer it needs.

    heres how its being called in context
    Warning: Spoilers inside!

    My Implementation
    Warning: Spoilers inside!
    their implementation
    Warning: Spoilers inside!
    Below is how the buffer is implemented in libnx and libtransistor
    Warning: Spoilers inside!
     
    Last edited by jfmherokiller, Aug 10, 2018
Loading...