diff --git a/libnxGen.cfg b/libnxGen.cfg index e3ccdec..614b47c 100644 --- a/libnxGen.cfg +++ b/libnxGen.cfg @@ -248,7 +248,7 @@ search.key_right = " KEY_RIGHT = KEY_DRIGHT or KEY_LSTICK_RIGHT or KEY_RSTICK replace.key_right = "" search.key_rstick_down = " KEY_RSTICK_DOWN" prepend.key_rstick_down = """ - KEY_RIGHT = KEY_DRIGHT.int or KEY_LSTICK_RIGHT.int or KEY_RSTICK_RIGHT.int ## /< D-Pad Right or Sticks Right + KEY_RIGHT = KEY_DRIGHT.int or KEY_LSTICK_RIGHT.int or KEY_RSTICK_RIGHT.int, ## /< D-Pad Right or Sticks Right """ search.key_up = " KEY_UP = KEY_DUP or KEY_LSTICK_UP or KEY_RSTICK_UP, ## /< D-Pad Up or Sticks Up" diff --git a/src/libnx/wrapper/fatal.nim b/src/libnx/wrapper/fatal.nim index 0936a22..8c43ae1 100644 --- a/src/libnx/wrapper/fatal.nim +++ b/src/libnx/wrapper/fatal.nim @@ -2,4 +2,12 @@ import strutils import ospaths const headerfatal = currentSourcePath().splitPath().head & "/nx/include/switch/services/fatal.h" import libnx/wrapper/types -proc fatalSimple*(err: Result) {.cdecl, importc: "fatalSimple", header: headerfatal.} \ No newline at end of file +type + FatalType* {.size: sizeof(cint).} = enum + FatalType_ErrorReportAndErrorScreen = 0, FatalType_ErrorReport = 1, + FatalType_ErrorScreen = 2 + + +proc fatalSimple*(err: Result) {.cdecl, importc: "fatalSimple", header: headerfatal.} +proc fatalWithType*(err: Result; `type`: FatalType) {.cdecl, + importc: "fatalWithType", header: headerfatal.} \ No newline at end of file diff --git a/src/libnx/wrapper/hid.nim b/src/libnx/wrapper/hid.nim index 3a6e0ec..9805468 100644 --- a/src/libnx/wrapper/hid.nim +++ b/src/libnx/wrapper/hid.nim @@ -120,7 +120,7 @@ type KEY_RSTICK_UP = BIT(21), ## /< Right Stick Up KEY_UP = KEY_DUP.int or KEY_LSTICK_UP.int or KEY_RSTICK_UP.int, ## /< D-Pad Up or Sticks Up KEY_RSTICK_RIGHT = BIT(22), ## /< Right Stick Right - KEY_RIGHT = KEY_DRIGHT.int or KEY_LSTICK_RIGHT.int or KEY_RSTICK_RIGHT.int ## /< D-Pad Right or Sticks Right + KEY_RIGHT = KEY_DRIGHT.int or KEY_LSTICK_RIGHT.int or KEY_RSTICK_RIGHT.int, ## /< D-Pad Right or Sticks Right KEY_RSTICK_DOWN = BIT(23), ## /< Right Stick Down KEY_DOWN = KEY_DDOWN.int or KEY_LSTICK_DOWN.int or KEY_RSTICK_DOWN.int, ## /< D-Pad Down or Sticks Down KEY_SL = BIT(24), ## /< SL diff --git a/src/libnx/wrapper/nx/include/switch/services/fatal.h b/src/libnx/wrapper/nx/include/switch/services/fatal.h index 28fc530..e446fb9 100644 --- a/src/libnx/wrapper/nx/include/switch/services/fatal.h +++ b/src/libnx/wrapper/nx/include/switch/services/fatal.h @@ -7,9 +7,23 @@ #pragma once #include "../types.h" +typedef enum { + FatalType_ErrorReportAndErrorScreen = 0, + FatalType_ErrorReport = 1, + FatalType_ErrorScreen = 2 +} FatalType; + /** * @brief Triggers a system fatal error. * @param err[in] Result code to throw. * @note This function does not return. */ void NORETURN fatalSimple(Result err); + +/** + * @brief Triggers a system fatal error with a custom FatalType. + * @param err[in] Result code to throw. + * @param err[in] Type of fatal error to throw. + * @note This function does not return. + */ +void NORETURN fatalWithType(Result err, FatalType type);