diff --git a/examples/helloworld/helloworld.nim b/examples/helloworld/helloworld.nim index 0ddc66a..8e93c2c 100644 --- a/examples/helloworld/helloworld.nim +++ b/examples/helloworld/helloworld.nim @@ -1,7 +1,7 @@ -import libnx/gfx -import libnx/console -import libnx/hid -import libnx/applet +import libnx_wrapper/gfx +import libnx_wrapper/console +import libnx_wrapper/hid +import libnx_wrapper/applet proc printf(formatstr: cstring) {.importc: "printf", varargs, header: "".} diff --git a/examples/helloworld/helloworld.nims b/examples/helloworld/helloworld.nims deleted file mode 100644 index 7dba2c2..0000000 --- a/examples/helloworld/helloworld.nims +++ /dev/null @@ -1,57 +0,0 @@ -let buildDir = "build" -let dkpPath = getEnv("DEVKITPRO") -let toolsPath = dkpPath & "/tools/bin" -let dkpCompilerPath = dkpPath & "/devkitA64/bin" - -switch("path", toolsPath) -switch("path", dkpCompilerPath) - -task build, "Build hello world": - - let author = "Unspecified Author" - let version = "1.0.0" - - if existsDir buildDir: - rmDir buildDir - - echo "Building..." - - mkDir buildDir - - - exec "nim c --os:nintendoswitch helloworld.nim" - - echo "Making nso..." - exec "elf2nso helloworld.elf " & buildDir & "/helloworld.nso" - - echo "Making pfs0..." - mkdir buildDir & "/exefs" - exec "cp " & buildDir & "/helloworld.nso " & buildDir & "/exefs/main" - exec "build_pfs0 " & buildDir & "/exefs " & buildDir & "/helloworld.pfs0" - - echo "Making lst..." - exec "aarch64-none-elf-gcc-nm helloworld.elf > " & buildDir & "/helloworld.lst" - - echo "Making nacp..." - # Some meta data for the homebrew launcher - exec "nacptool --create helloworld '" & author & "' '" & version & "' " & buildDir & "/helloworld.nacp" - - echo "Making nro..." - # This is the important one. The above are just extras. - exec "elf2nro helloworld.elf helloworld.nro --icon=" & dkpPath & "/libnx/default_icon.jpg --nacp=" & buildDir & "/helloworld.nacp" - - echo "Done! helloworld.nro is now in the current directory." - echo "Other build files are in the build folder." - -task clean, "Cleanup files": - if existsDir buildDir: - rmDir buildDir - - if existsDir "nimcache": - rmDir "nimcache" - - if existsFile "helloworld.elf": - rmFile "helloworld.elf" - - if existsFile "helloworld.nro": - rmFile "helloworld.nro" diff --git a/libnxGen.cfg b/libnxGen.cfg index 32ef1b6..3d84bc9 100644 --- a/libnxGen.cfg +++ b/libnxGen.cfg @@ -1,5 +1,5 @@ [n.global] -output="src/libnx" +output="src/libnx_wrapper" c_compiler="aarch64-none-elf-gcc" cpp_compiler="aarch64-none-elf-g++" filter=lock @@ -44,23 +44,23 @@ replace.u32 = "uint32" search.u64 = "u64" replace.u64 = "uint64" -search.lib = " src/libnx" -replace.lib = " libnx" +search.lib = " src/libnx_wrapper" +replace.lib = " libnx_wrapper" search.timport = "../types" -replace.timport = "libnx/types" +replace.timport = "libnx_wrapper/types" search.kimport = "../kernel/" -replace.kimport = "libnx/" +replace.kimport = "libnx_wrapper/" search.servimport = "../services/" -replace.servimport = "libnx/" +replace.servimport = "libnx_wrapper/" search.resimport = "../result" -replace.resimport = "libnx/result" +replace.resimport = "libnx_wrapper/result" search.armimport = "../arm/" -replace.armimport = "libnx/" +replace.armimport = "libnx_wrapper/" search.lock = "_LOCK" replace.lock = "LOCK" @@ -68,7 +68,7 @@ replace.lock = "LOCK" search.cdecl = "stdcall" replace.cdecl = "cdecl" -[src/libnx/nim.cfg] +[src/libnx_wrapper/nim.cfg] create = """ --path:"../" """ @@ -171,7 +171,7 @@ template BIT*(n): auto = (1.uint shl n) search.import = "type\n" prepend.import = """ -import libnx/types +import libnx_wrapper/types """ search.permx = "Perm_X = BIT(2), ## /< Execute permission." @@ -186,13 +186,13 @@ replace.permrx = "Perm_Rx = Perm_R.int or Perm_X.int, ## /< Read/execute permi [shmem.nim] search.import = "type\n" prepend.import = """ -import libnx/svc +import libnx_wrapper/svc """ [nacp.nim] search.t = "type" prepend.t = """ -import libnx/types +import libnx_wrapper/types """ [lock.nim] @@ -204,7 +204,7 @@ replace.nlock_t = "= DUlock_t" search.import = "type" prepend.import = """ -import libnx/types +import libnx_wrapper/types """ search.proc_under = "proc __" @@ -216,19 +216,19 @@ replace.o = "uint32.high" search.import = "import\n" append.import = """ - libnx/types, + libnx_wrapper/types, """ [audin.nim] search.o = "import " prepend.o = """ -import libnx/types +import libnx_wrapper/types """ [audout.nim] search.o = "import " prepend.o = """ -import libnx/types +import libnx_wrapper/types """ [hid.nim] @@ -267,32 +267,32 @@ prepend.key_sl = """ [nifm.nim] search.o = "import libnx" prepend.o = """ -import libnx/types +import libnx_wrapper/types """ [set.nim] search.o = "import libnx" prepend.o = """ -import libnx/types +import libnx_wrapper/types """ [parcel.nim] search.o = "import libnx" prepend.o = """ -import libnx/types +import libnx_wrapper/types """ [fs_dev.nim] search.o = "import libnx" prepend.o = """ -import libnx/types +import libnx_wrapper/types """ [buffer_producer.nim] search.o = "import libnx" prepend.o = """ -import libnx/types -import libnx/binder +import libnx_wrapper/types +import libnx_wrapper/binder """ [nxlink.nim] diff --git a/src/libnx/switch.nim b/src/libnx/switch.nim deleted file mode 100644 index e2df830..0000000 --- a/src/libnx/switch.nim +++ /dev/null @@ -1,62 +0,0 @@ -import strutils -import ospaths -const headerswitch = currentSourcePath().splitPath().head & "/nx/include/switch.h" -import libnx/types -import libnx/result -import libnx/nro -import libnx/nacp -import libnx/tls -import libnx/cache -import libnx/svc -import libnx/tmem -import libnx/shmem -import libnx/mutex -import libnx/rwlock -import libnx/condvar -import libnx/thread -import libnx/virtmem -import libnx/detect -import libnx/random -import libnx/jit -import libnx/ipc -import libnx/sm -import libnx/smm -import libnx/fs -import libnx/fsldr -import libnx/fspr -import libnx/acc -import libnx/apm -import libnx/applet -import libnx/audin -import libnx/audout -import libnx/csrng -import libnx/fatal -import libnx/time -import libnx/usb -import libnx/hid -import libnx/irs -import libnx/pl -import libnx/vi -import libnx/nv -import libnx/nifm -import libnx/ns -import libnx/ldr -import libnx/pm -import libnx/set -import libnx/lr -import libnx/spl -import libnx/gfx -import libnx/binder -import libnx/parcel -import libnx/buffer_producer -import libnx/ioctl -import libnx/nvioctl -import libnx/nvgfx -import libnx/env -import libnx/nxlink -import libnx/utf -import libnx/console -import libnx/usb_comms -import libnx/fs_dev -import libnx/romfs_dev -import libnx/socket diff --git a/src/libnx/acc.nim b/src/libnx_wrapper/acc.nim similarity index 97% rename from src/libnx/acc.nim rename to src/libnx_wrapper/acc.nim index 9fec992..435be14 100644 --- a/src/libnx/acc.nim +++ b/src/libnx_wrapper/acc.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headeracc = currentSourcePath().splitPath().head & "/nx/include/switch/services/acc.h" -import libnx/types -import libnx/sm +import libnx_wrapper/types +import libnx_wrapper/sm type AccountProfile* {.importc: "AccountProfile", header: headeracc, bycopy.} = object s* {.importc: "s".}: Service diff --git a/src/libnx/apm.nim b/src/libnx_wrapper/apm.nim similarity index 96% rename from src/libnx/apm.nim rename to src/libnx_wrapper/apm.nim index 23d3dbd..285bbf9 100644 --- a/src/libnx/apm.nim +++ b/src/libnx_wrapper/apm.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerapm = currentSourcePath().splitPath().head & "/nx/include/switch/services/apm.h" -import libnx/types +import libnx_wrapper/types proc apmInitialize*(): Result {.cdecl, importc: "apmInitialize", header: headerapm.} proc apmExit*() {.cdecl, importc: "apmExit", header: headerapm.} proc apmSetPerformanceConfiguration*(PerformanceMode: uint32; diff --git a/src/libnx/applet.nim b/src/libnx_wrapper/applet.nim similarity index 99% rename from src/libnx/applet.nim rename to src/libnx_wrapper/applet.nim index 3559b39..b681899 100644 --- a/src/libnx/applet.nim +++ b/src/libnx_wrapper/applet.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerapplet = currentSourcePath().splitPath().head & "/nx/include/switch/services/applet.h" -import libnx/types +import libnx_wrapper/types type AppletType* {.size: sizeof(cint).} = enum AppletType_None = -2, AppletType_Default = -1, AppletType_Application = 0, diff --git a/src/libnx/audin.nim b/src/libnx_wrapper/audin.nim similarity index 98% rename from src/libnx/audin.nim rename to src/libnx_wrapper/audin.nim index cfea603..e9e878a 100644 --- a/src/libnx/audin.nim +++ b/src/libnx_wrapper/audin.nim @@ -1,8 +1,8 @@ -import libnx/types +import libnx_wrapper/types import strutils import ospaths const headeraudin = currentSourcePath().splitPath().head & "/nx/include/switch/services/audin.h" -import libnx/audio +import libnx_wrapper/audio type AudioInState* {.size: sizeof(cint).} = enum AudioInState_Started = 0, AudioInState_Stopped = 1 diff --git a/src/libnx/audio.nim b/src/libnx_wrapper/audio.nim similarity index 92% rename from src/libnx/audio.nim rename to src/libnx_wrapper/audio.nim index ef82328..083cb00 100644 --- a/src/libnx/audio.nim +++ b/src/libnx_wrapper/audio.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headeraudio = currentSourcePath().splitPath().head & "/nx/include/switch/audio/audio.h" -import libnx/types +import libnx_wrapper/types type PcmFormat* {.size: sizeof(cint).} = enum PcmFormat_Invalid = 0, PcmFormat_Int8 = 1, PcmFormat_Int16 = 2, PcmFormat_Int24 = 3, diff --git a/src/libnx/audout.nim b/src/libnx_wrapper/audout.nim similarity index 98% rename from src/libnx/audout.nim rename to src/libnx_wrapper/audout.nim index 782fc70..f42be44 100644 --- a/src/libnx/audout.nim +++ b/src/libnx_wrapper/audout.nim @@ -1,8 +1,8 @@ -import libnx/types +import libnx_wrapper/types import strutils import ospaths const headeraudout = currentSourcePath().splitPath().head & "/nx/include/switch/services/audout.h" -import libnx/audio +import libnx_wrapper/audio type AudioOutState* {.size: sizeof(cint).} = enum AudioOutState_Started = 0, AudioOutState_Stopped = 1 diff --git a/src/libnx/binder.nim b/src/libnx_wrapper/binder.nim similarity index 98% rename from src/libnx/binder.nim rename to src/libnx_wrapper/binder.nim index 44364c5..6eb2907 100644 --- a/src/libnx/binder.nim +++ b/src/libnx_wrapper/binder.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerbinder = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/binder.h" -import libnx/types +import libnx_wrapper/types const BINDER_FIRST_CALL_TRANSACTION* = 0x00000001 diff --git a/src/libnx/buffer_producer.nim b/src/libnx_wrapper/buffer_producer.nim similarity index 98% rename from src/libnx/buffer_producer.nim rename to src/libnx_wrapper/buffer_producer.nim index ccfdb82..63027c0 100644 --- a/src/libnx/buffer_producer.nim +++ b/src/libnx_wrapper/buffer_producer.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerbuffer_producer = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/buffer_producer.h" -import libnx/types -import libnx/binder -import libnx/nvioctl +import libnx_wrapper/types +import libnx_wrapper/binder +import libnx_wrapper/nvioctl type INNER_C_STRUCT_3208597589* {.importc: "no_name", header: headerbuffer_producer, bycopy.} = object diff --git a/src/libnx/cache.nim b/src/libnx_wrapper/cache.nim similarity index 95% rename from src/libnx/cache.nim rename to src/libnx_wrapper/cache.nim index 7ad42aa..4886d93 100644 --- a/src/libnx/cache.nim +++ b/src/libnx_wrapper/cache.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headercache = currentSourcePath().splitPath().head & "/nx/include/switch/arm/cache.h" -import libnx/types +import libnx_wrapper/types proc armDCacheFlush*(`addr`: pointer; size: csize) {.cdecl, importc: "armDCacheFlush", header: headercache.} proc armDCacheClean*(`addr`: pointer; size: csize) {.cdecl, diff --git a/src/libnx/condvar.nim b/src/libnx_wrapper/condvar.nim similarity index 98% rename from src/libnx/condvar.nim rename to src/libnx_wrapper/condvar.nim index 8e16b22..226d36e 100644 --- a/src/libnx/condvar.nim +++ b/src/libnx_wrapper/condvar.nim @@ -9,7 +9,7 @@ const headercondvar = currentSourcePath().splitPath().head & "/nx/include/switch ## import - libnx/types, libnx/mutex + libnx_wrapper/types, libnx_wrapper/mutex ## / Condition variable structure. diff --git a/src/libnx/console.nim b/src/libnx_wrapper/console.nim similarity index 98% rename from src/libnx/console.nim rename to src/libnx_wrapper/console.nim index eb743d3..1dfa416 100644 --- a/src/libnx/console.nim +++ b/src/libnx_wrapper/console.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerconsole = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/devices/console.h" -import libnx/types +import libnx_wrapper/types type ConsolePrint* = proc (con: pointer; c: cint): bool {.cdecl.} ConsoleFont* {.importc: "ConsoleFont", header: headerconsole, bycopy.} = object diff --git a/src/libnx/csrng.nim b/src/libnx_wrapper/csrng.nim similarity index 94% rename from src/libnx/csrng.nim rename to src/libnx_wrapper/csrng.nim index 0c1ab45..436b148 100644 --- a/src/libnx/csrng.nim +++ b/src/libnx_wrapper/csrng.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headercsrng = currentSourcePath().splitPath().head & "/nx/include/switch/services/csrng.h" -import libnx/types +import libnx_wrapper/types proc csrngInitialize*(): Result {.cdecl, importc: "csrngInitialize", header: headercsrng.} proc csrngExit*() {.cdecl, importc: "csrngExit", header: headercsrng.} diff --git a/src/libnx/detect.nim b/src/libnx_wrapper/detect.nim similarity index 96% rename from src/libnx/detect.nim rename to src/libnx_wrapper/detect.nim index 43f9c5f..67f3afb 100644 --- a/src/libnx/detect.nim +++ b/src/libnx_wrapper/detect.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerdetect = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/detect.h" -import libnx/types +import libnx_wrapper/types proc kernelAbove200*(): bool {.cdecl, importc: "kernelAbove200", header: headerdetect.} proc kernelAbove300*(): bool {.cdecl, importc: "kernelAbove300", diff --git a/src/libnx/env.nim b/src/libnx_wrapper/env.nim similarity index 98% rename from src/libnx/env.nim rename to src/libnx_wrapper/env.nim index 3d3de82..aa3bed3 100644 --- a/src/libnx/env.nim +++ b/src/libnx_wrapper/env.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerenv = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/env.h" -import libnx/types +import libnx_wrapper/types type ConfigEntry* {.importc: "ConfigEntry", header: headerenv, bycopy.} = object Key* {.importc: "Key".}: uint32 diff --git a/src/libnx/fatal.nim b/src/libnx_wrapper/fatal.nim similarity index 88% rename from src/libnx/fatal.nim rename to src/libnx_wrapper/fatal.nim index fc36125..ab0ee21 100644 --- a/src/libnx/fatal.nim +++ b/src/libnx_wrapper/fatal.nim @@ -1,5 +1,5 @@ import strutils import ospaths const headerfatal = currentSourcePath().splitPath().head & "/nx/include/switch/services/fatal.h" -import libnx/types +import libnx_wrapper/types proc fatalSimple*(err: Result) {.cdecl, importc: "fatalSimple", header: headerfatal.} \ No newline at end of file diff --git a/src/libnx/fs.nim b/src/libnx_wrapper/fs.nim similarity index 99% rename from src/libnx/fs.nim rename to src/libnx_wrapper/fs.nim index 062daf0..f21773b 100644 --- a/src/libnx/fs.nim +++ b/src/libnx_wrapper/fs.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headerfs = currentSourcePath().splitPath().head & "/nx/include/switch/services/fs.h" -import libnx/types -import libnx/sm +import libnx_wrapper/types +import libnx_wrapper/sm const FS_MAX_PATH* = 0x00000301 FS_SAVEDATA_CURRENT_TITLEID* = 0 diff --git a/src/libnx/fs_dev.nim b/src/libnx_wrapper/fs_dev.nim similarity index 95% rename from src/libnx/fs_dev.nim rename to src/libnx_wrapper/fs_dev.nim index 3b4fb87..d34c522 100644 --- a/src/libnx/fs_dev.nim +++ b/src/libnx_wrapper/fs_dev.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headerfs_dev = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/devices/fs_dev.h" -import libnx/types -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/fs const FSDEV_DIRITER_MAGIC* = 0x66736476 diff --git a/src/libnx/fsldr.nim b/src/libnx_wrapper/fsldr.nim similarity index 91% rename from src/libnx/fsldr.nim rename to src/libnx_wrapper/fsldr.nim index d94d5b0..5290f89 100644 --- a/src/libnx/fsldr.nim +++ b/src/libnx_wrapper/fsldr.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerfsldr = currentSourcePath().splitPath().head & "/nx/include/switch/services/fsldr.h" -import libnx/types -import libnx/sm -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/sm +import libnx_wrapper/fs proc fsldrInitialize*(): Result {.cdecl, importc: "fsldrInitialize", header: headerfsldr.} proc fsldrExit*() {.cdecl, importc: "fsldrExit", header: headerfsldr.} diff --git a/src/libnx/fspr.nim b/src/libnx_wrapper/fspr.nim similarity index 93% rename from src/libnx/fspr.nim rename to src/libnx_wrapper/fspr.nim index 2d965f3..227cc1f 100644 --- a/src/libnx/fspr.nim +++ b/src/libnx_wrapper/fspr.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerfspr = currentSourcePath().splitPath().head & "/nx/include/switch/services/fspr.h" -import libnx/types -import libnx/sm -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/sm +import libnx_wrapper/fs proc fsprInitialize*(): Result {.cdecl, importc: "fsprInitialize", header: headerfspr.} proc fsprExit*() {.cdecl, importc: "fsprExit", header: headerfspr.} diff --git a/src/libnx/gfx.nim b/src/libnx_wrapper/gfx.nim similarity index 99% rename from src/libnx/gfx.nim rename to src/libnx_wrapper/gfx.nim index a8b8122..e85f44f 100644 --- a/src/libnx/gfx.nim +++ b/src/libnx_wrapper/gfx.nim @@ -10,7 +10,7 @@ const headergfx = currentSourcePath().splitPath().head & "/nx/include/switch/gfx ## import - libnx/types + libnx_wrapper/types ## / Converts red, green, blue, and alpha components to packed RGBA8. diff --git a/src/libnx/hid.nim b/src/libnx_wrapper/hid.nim similarity index 99% rename from src/libnx/hid.nim rename to src/libnx_wrapper/hid.nim index 702eaa1..5acce7d 100644 --- a/src/libnx/hid.nim +++ b/src/libnx_wrapper/hid.nim @@ -10,7 +10,7 @@ const headerhid = currentSourcePath().splitPath().head & "/nx/include/switch/ser ## import - libnx/types, libnx/sm + libnx_wrapper/types, libnx_wrapper/sm ## Begin enums and output structs diff --git a/src/libnx/ioctl.nim b/src/libnx_wrapper/ioctl.nim similarity index 100% rename from src/libnx/ioctl.nim rename to src/libnx_wrapper/ioctl.nim diff --git a/src/libnx/ipc.nim b/src/libnx_wrapper/ipc.nim similarity index 99% rename from src/libnx/ipc.nim rename to src/libnx_wrapper/ipc.nim index a54b08e..0c6a005 100644 --- a/src/libnx/ipc.nim +++ b/src/libnx_wrapper/ipc.nim @@ -9,8 +9,8 @@ const headeripc = currentSourcePath().splitPath().head & "/nx/include/switch/ker ## import - libnx/types, - libnx/result, libnx/tls, libnx/svc + libnx_wrapper/types, + libnx_wrapper/result, libnx_wrapper/tls, libnx_wrapper/svc ## / IPC input header magic diff --git a/src/libnx/irs.nim b/src/libnx_wrapper/irs.nim similarity index 97% rename from src/libnx/irs.nim rename to src/libnx_wrapper/irs.nim index d8e3513..14f5899 100644 --- a/src/libnx/irs.nim +++ b/src/libnx_wrapper/irs.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerirs = currentSourcePath().splitPath().head & "/nx/include/switch/services/irs.h" -import libnx/types -import libnx/sm -import libnx/hid +import libnx_wrapper/types +import libnx_wrapper/sm +import libnx_wrapper/hid type IrsPackedMomentProcessorConfig* {.importc: "IrsPackedMomentProcessorConfig", header: headerirs, bycopy.} = object diff --git a/src/libnx/jit.nim b/src/libnx_wrapper/jit.nim similarity index 97% rename from src/libnx/jit.nim rename to src/libnx_wrapper/jit.nim index 5b64374..b4cfbfe 100644 --- a/src/libnx/jit.nim +++ b/src/libnx_wrapper/jit.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerjit = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/jit.h" -import libnx/types +import libnx_wrapper/types type JitType* {.size: sizeof(cint).} = enum JitType_CodeMemory, JitType_JitMemory diff --git a/src/libnx/ldr.nim b/src/libnx_wrapper/ldr.nim similarity index 97% rename from src/libnx/ldr.nim rename to src/libnx_wrapper/ldr.nim index aca4a07..23a5d8a 100644 --- a/src/libnx/ldr.nim +++ b/src/libnx_wrapper/ldr.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerldr = currentSourcePath().splitPath().head & "/nx/include/switch/services/ldr.h" -import libnx/types -import libnx/sm -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/sm +import libnx_wrapper/fs type LoaderProgramInfo* {.importc: "LoaderProgramInfo", header: headerldr, bycopy.} = object main_thread_priority* {.importc: "main_thread_priority".}: uint8 diff --git a/src/libnx/lock.nim b/src/libnx_wrapper/lock.nim similarity index 98% rename from src/libnx/lock.nim rename to src/libnx_wrapper/lock.nim index fe95f8b..37b182a 100644 --- a/src/libnx/lock.nim +++ b/src/libnx_wrapper/lock.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerlock = "/opt/devkitpro/devkitA64/aarch64-none-elf/include/sys/lock.h" -import libnx/types +import libnx_wrapper/types type LOCK_T* = int32_t DUlock_t* {.importc: "__lock_t", header: headerlock, bycopy.} = object diff --git a/src/libnx/lr.nim b/src/libnx_wrapper/lr.nim similarity index 97% rename from src/libnx/lr.nim rename to src/libnx_wrapper/lr.nim index 08ce55b..967aceb 100644 --- a/src/libnx/lr.nim +++ b/src/libnx_wrapper/lr.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerlr = currentSourcePath().splitPath().head & "/nx/include/switch/services/lr.h" -import libnx/types -import libnx/sm -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/sm +import libnx_wrapper/fs type LrLocationResolver* {.importc: "LrLocationResolver", header: headerlr, bycopy.} = object s* {.importc: "s".}: Service diff --git a/src/libnx/mutex.nim b/src/libnx_wrapper/mutex.nim similarity index 94% rename from src/libnx/mutex.nim rename to src/libnx_wrapper/mutex.nim index add01da..ba262b6 100644 --- a/src/libnx/mutex.nim +++ b/src/libnx_wrapper/mutex.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headermutex = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/mutex.h" -import libnx/lock -import libnx/types +import libnx_wrapper/lock +import libnx_wrapper/types type Mutex* = LOCK_T RMutex* = LOCK_RECURSIVE_T diff --git a/src/libnx/nacp.nim b/src/libnx_wrapper/nacp.nim similarity index 98% rename from src/libnx/nacp.nim rename to src/libnx_wrapper/nacp.nim index 856a7eb..081a5fa 100644 --- a/src/libnx/nacp.nim +++ b/src/libnx_wrapper/nacp.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headernacp = currentSourcePath().splitPath().head & "/nx/include/switch/nacp.h" -import libnx/types +import libnx_wrapper/types type NacpLanguageEntry* {.importc: "NacpLanguageEntry", header: headernacp, bycopy.} = object name* {.importc: "name".}: array[0x00000200, char] diff --git a/src/libnx/nifm.nim b/src/libnx_wrapper/nifm.nim similarity index 80% rename from src/libnx/nifm.nim rename to src/libnx_wrapper/nifm.nim index 87d8828..d25c076 100644 --- a/src/libnx/nifm.nim +++ b/src/libnx_wrapper/nifm.nim @@ -1,10 +1,10 @@ import strutils import ospaths const headernifm = currentSourcePath().splitPath().head & "/nx/include/switch/services/nifm.h" -import libnx/types -import libnx/ipc -import libnx/detect -import libnx/sm +import libnx_wrapper/types +import libnx_wrapper/ipc +import libnx_wrapper/detect +import libnx_wrapper/sm proc nifmInitialize*(): Result {.cdecl, importc: "nifmInitialize", header: headernifm.} proc nifmExit*() {.cdecl, importc: "nifmExit", header: headernifm.} diff --git a/src/libnx/nim.cfg b/src/libnx_wrapper/nim.cfg similarity index 100% rename from src/libnx/nim.cfg rename to src/libnx_wrapper/nim.cfg diff --git a/src/libnx/nro.nim b/src/libnx_wrapper/nro.nim similarity index 100% rename from src/libnx/nro.nim rename to src/libnx_wrapper/nro.nim diff --git a/src/libnx/ns.nim b/src/libnx_wrapper/ns.nim similarity index 95% rename from src/libnx/ns.nim rename to src/libnx_wrapper/ns.nim index e534c25..4634f07 100644 --- a/src/libnx/ns.nim +++ b/src/libnx_wrapper/ns.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerns = currentSourcePath().splitPath().head & "/nx/include/switch/services/ns.h" -import libnx/types -import libnx/nacp -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/nacp +import libnx_wrapper/fs type NsApplicationControlData* {.importc: "NsApplicationControlData", header: headerns, bycopy.} = object diff --git a/src/libnx/nv.nim b/src/libnx_wrapper/nv.nim similarity index 97% rename from src/libnx/nv.nim rename to src/libnx_wrapper/nv.nim index b50f103..54b8490 100644 --- a/src/libnx/nv.nim +++ b/src/libnx_wrapper/nv.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headernv = currentSourcePath().splitPath().head & "/nx/include/switch/services/nv.h" -import libnx/types +import libnx_wrapper/types type nvServiceType* {.size: sizeof(cint).} = enum NVSERVTYPE_Default = -1, NVSERVTYPE_Application = 0, NVSERVTYPE_Applet = 1, diff --git a/src/libnx/nvgfx.nim b/src/libnx_wrapper/nvgfx.nim similarity index 96% rename from src/libnx/nvgfx.nim rename to src/libnx_wrapper/nvgfx.nim index b1001d8..5545349 100644 --- a/src/libnx/nvgfx.nim +++ b/src/libnx_wrapper/nvgfx.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headernvgfx = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/nvgfx.h" -import libnx/types +import libnx_wrapper/types proc nvgfxInitialize*(): Result {.cdecl, importc: "nvgfxInitialize", header: headernvgfx.} proc nvgfxExit*() {.cdecl, importc: "nvgfxExit", header: headernvgfx.} diff --git a/src/libnx/nvioctl.nim b/src/libnx_wrapper/nvioctl.nim similarity index 99% rename from src/libnx/nvioctl.nim rename to src/libnx_wrapper/nvioctl.nim index f4fe415..682527a 100644 --- a/src/libnx/nvioctl.nim +++ b/src/libnx_wrapper/nvioctl.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headernvioctl = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/nvioctl.h" -import libnx/types +import libnx_wrapper/types type gpu_characteristics* {.importc: "gpu_characteristics", header: headernvioctl, bycopy.} = object diff --git a/src/libnx/nx/include/switch.h b/src/libnx_wrapper/nx/include/switch.h similarity index 100% rename from src/libnx/nx/include/switch.h rename to src/libnx_wrapper/nx/include/switch.h diff --git a/src/libnx/nx/include/switch/arm/atomics.h b/src/libnx_wrapper/nx/include/switch/arm/atomics.h similarity index 100% rename from src/libnx/nx/include/switch/arm/atomics.h rename to src/libnx_wrapper/nx/include/switch/arm/atomics.h diff --git a/src/libnx/nx/include/switch/arm/cache.h b/src/libnx_wrapper/nx/include/switch/arm/cache.h similarity index 100% rename from src/libnx/nx/include/switch/arm/cache.h rename to src/libnx_wrapper/nx/include/switch/arm/cache.h diff --git a/src/libnx/nx/include/switch/arm/tls.h b/src/libnx_wrapper/nx/include/switch/arm/tls.h similarity index 100% rename from src/libnx/nx/include/switch/arm/tls.h rename to src/libnx_wrapper/nx/include/switch/arm/tls.h diff --git a/src/libnx/nx/include/switch/audio/audio.h b/src/libnx_wrapper/nx/include/switch/audio/audio.h similarity index 100% rename from src/libnx/nx/include/switch/audio/audio.h rename to src/libnx_wrapper/nx/include/switch/audio/audio.h diff --git a/src/libnx/nx/include/switch/gfx/binder.h b/src/libnx_wrapper/nx/include/switch/gfx/binder.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/binder.h rename to src/libnx_wrapper/nx/include/switch/gfx/binder.h diff --git a/src/libnx/nx/include/switch/gfx/buffer_producer.h b/src/libnx_wrapper/nx/include/switch/gfx/buffer_producer.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/buffer_producer.h rename to src/libnx_wrapper/nx/include/switch/gfx/buffer_producer.h diff --git a/src/libnx/nx/include/switch/gfx/gfx.h b/src/libnx_wrapper/nx/include/switch/gfx/gfx.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/gfx.h rename to src/libnx_wrapper/nx/include/switch/gfx/gfx.h diff --git a/src/libnx/nx/include/switch/gfx/ioctl.h b/src/libnx_wrapper/nx/include/switch/gfx/ioctl.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/ioctl.h rename to src/libnx_wrapper/nx/include/switch/gfx/ioctl.h diff --git a/src/libnx/nx/include/switch/gfx/nvgfx.h b/src/libnx_wrapper/nx/include/switch/gfx/nvgfx.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/nvgfx.h rename to src/libnx_wrapper/nx/include/switch/gfx/nvgfx.h diff --git a/src/libnx/nx/include/switch/gfx/nvioctl.h b/src/libnx_wrapper/nx/include/switch/gfx/nvioctl.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/nvioctl.h rename to src/libnx_wrapper/nx/include/switch/gfx/nvioctl.h diff --git a/src/libnx/nx/include/switch/gfx/parcel.h b/src/libnx_wrapper/nx/include/switch/gfx/parcel.h similarity index 100% rename from src/libnx/nx/include/switch/gfx/parcel.h rename to src/libnx_wrapper/nx/include/switch/gfx/parcel.h diff --git a/src/libnx/nx/include/switch/kernel/condvar.h b/src/libnx_wrapper/nx/include/switch/kernel/condvar.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/condvar.h rename to src/libnx_wrapper/nx/include/switch/kernel/condvar.h diff --git a/src/libnx/nx/include/switch/kernel/detect.h b/src/libnx_wrapper/nx/include/switch/kernel/detect.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/detect.h rename to src/libnx_wrapper/nx/include/switch/kernel/detect.h diff --git a/src/libnx/nx/include/switch/kernel/ipc.h b/src/libnx_wrapper/nx/include/switch/kernel/ipc.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/ipc.h rename to src/libnx_wrapper/nx/include/switch/kernel/ipc.h diff --git a/src/libnx/nx/include/switch/kernel/jit.h b/src/libnx_wrapper/nx/include/switch/kernel/jit.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/jit.h rename to src/libnx_wrapper/nx/include/switch/kernel/jit.h diff --git a/src/libnx/nx/include/switch/kernel/mutex.h b/src/libnx_wrapper/nx/include/switch/kernel/mutex.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/mutex.h rename to src/libnx_wrapper/nx/include/switch/kernel/mutex.h diff --git a/src/libnx/nx/include/switch/kernel/random.h b/src/libnx_wrapper/nx/include/switch/kernel/random.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/random.h rename to src/libnx_wrapper/nx/include/switch/kernel/random.h diff --git a/src/libnx/nx/include/switch/kernel/rwlock.h b/src/libnx_wrapper/nx/include/switch/kernel/rwlock.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/rwlock.h rename to src/libnx_wrapper/nx/include/switch/kernel/rwlock.h diff --git a/src/libnx/nx/include/switch/kernel/shmem.h b/src/libnx_wrapper/nx/include/switch/kernel/shmem.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/shmem.h rename to src/libnx_wrapper/nx/include/switch/kernel/shmem.h diff --git a/src/libnx/nx/include/switch/kernel/svc.h b/src/libnx_wrapper/nx/include/switch/kernel/svc.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/svc.h rename to src/libnx_wrapper/nx/include/switch/kernel/svc.h diff --git a/src/libnx/nx/include/switch/kernel/thread.h b/src/libnx_wrapper/nx/include/switch/kernel/thread.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/thread.h rename to src/libnx_wrapper/nx/include/switch/kernel/thread.h diff --git a/src/libnx/nx/include/switch/kernel/tmem.h b/src/libnx_wrapper/nx/include/switch/kernel/tmem.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/tmem.h rename to src/libnx_wrapper/nx/include/switch/kernel/tmem.h diff --git a/src/libnx/nx/include/switch/kernel/virtmem.h b/src/libnx_wrapper/nx/include/switch/kernel/virtmem.h similarity index 100% rename from src/libnx/nx/include/switch/kernel/virtmem.h rename to src/libnx_wrapper/nx/include/switch/kernel/virtmem.h diff --git a/src/libnx/nx/include/switch/nacp.h b/src/libnx_wrapper/nx/include/switch/nacp.h similarity index 100% rename from src/libnx/nx/include/switch/nacp.h rename to src/libnx_wrapper/nx/include/switch/nacp.h diff --git a/src/libnx/nx/include/switch/nro.h b/src/libnx_wrapper/nx/include/switch/nro.h similarity index 100% rename from src/libnx/nx/include/switch/nro.h rename to src/libnx_wrapper/nx/include/switch/nro.h diff --git a/src/libnx/nx/include/switch/result.h b/src/libnx_wrapper/nx/include/switch/result.h similarity index 100% rename from src/libnx/nx/include/switch/result.h rename to src/libnx_wrapper/nx/include/switch/result.h diff --git a/src/libnx/nx/include/switch/runtime/devices/console.h b/src/libnx_wrapper/nx/include/switch/runtime/devices/console.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/devices/console.h rename to src/libnx_wrapper/nx/include/switch/runtime/devices/console.h diff --git a/src/libnx/nx/include/switch/runtime/devices/fs_dev.h b/src/libnx_wrapper/nx/include/switch/runtime/devices/fs_dev.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/devices/fs_dev.h rename to src/libnx_wrapper/nx/include/switch/runtime/devices/fs_dev.h diff --git a/src/libnx/nx/include/switch/runtime/devices/romfs_dev.h b/src/libnx_wrapper/nx/include/switch/runtime/devices/romfs_dev.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/devices/romfs_dev.h rename to src/libnx_wrapper/nx/include/switch/runtime/devices/romfs_dev.h diff --git a/src/libnx/nx/include/switch/runtime/devices/socket.h b/src/libnx_wrapper/nx/include/switch/runtime/devices/socket.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/devices/socket.h rename to src/libnx_wrapper/nx/include/switch/runtime/devices/socket.h diff --git a/src/libnx/nx/include/switch/runtime/devices/usb_comms.h b/src/libnx_wrapper/nx/include/switch/runtime/devices/usb_comms.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/devices/usb_comms.h rename to src/libnx_wrapper/nx/include/switch/runtime/devices/usb_comms.h diff --git a/src/libnx/nx/include/switch/runtime/env.h b/src/libnx_wrapper/nx/include/switch/runtime/env.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/env.h rename to src/libnx_wrapper/nx/include/switch/runtime/env.h diff --git a/src/libnx/nx/include/switch/runtime/nxlink.h b/src/libnx_wrapper/nx/include/switch/runtime/nxlink.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/nxlink.h rename to src/libnx_wrapper/nx/include/switch/runtime/nxlink.h diff --git a/src/libnx/nx/include/switch/runtime/util/utf.h b/src/libnx_wrapper/nx/include/switch/runtime/util/utf.h similarity index 100% rename from src/libnx/nx/include/switch/runtime/util/utf.h rename to src/libnx_wrapper/nx/include/switch/runtime/util/utf.h diff --git a/src/libnx/nx/include/switch/services/acc.h b/src/libnx_wrapper/nx/include/switch/services/acc.h similarity index 100% rename from src/libnx/nx/include/switch/services/acc.h rename to src/libnx_wrapper/nx/include/switch/services/acc.h diff --git a/src/libnx/nx/include/switch/services/apm.h b/src/libnx_wrapper/nx/include/switch/services/apm.h similarity index 100% rename from src/libnx/nx/include/switch/services/apm.h rename to src/libnx_wrapper/nx/include/switch/services/apm.h diff --git a/src/libnx/nx/include/switch/services/applet.h b/src/libnx_wrapper/nx/include/switch/services/applet.h similarity index 100% rename from src/libnx/nx/include/switch/services/applet.h rename to src/libnx_wrapper/nx/include/switch/services/applet.h diff --git a/src/libnx/nx/include/switch/services/audin.h b/src/libnx_wrapper/nx/include/switch/services/audin.h similarity index 100% rename from src/libnx/nx/include/switch/services/audin.h rename to src/libnx_wrapper/nx/include/switch/services/audin.h diff --git a/src/libnx/nx/include/switch/services/audout.h b/src/libnx_wrapper/nx/include/switch/services/audout.h similarity index 100% rename from src/libnx/nx/include/switch/services/audout.h rename to src/libnx_wrapper/nx/include/switch/services/audout.h diff --git a/src/libnx/nx/include/switch/services/bsd.h b/src/libnx_wrapper/nx/include/switch/services/bsd.h similarity index 100% rename from src/libnx/nx/include/switch/services/bsd.h rename to src/libnx_wrapper/nx/include/switch/services/bsd.h diff --git a/src/libnx/nx/include/switch/services/csrng.h b/src/libnx_wrapper/nx/include/switch/services/csrng.h similarity index 100% rename from src/libnx/nx/include/switch/services/csrng.h rename to src/libnx_wrapper/nx/include/switch/services/csrng.h diff --git a/src/libnx/nx/include/switch/services/fatal.h b/src/libnx_wrapper/nx/include/switch/services/fatal.h similarity index 100% rename from src/libnx/nx/include/switch/services/fatal.h rename to src/libnx_wrapper/nx/include/switch/services/fatal.h diff --git a/src/libnx/nx/include/switch/services/fs.h b/src/libnx_wrapper/nx/include/switch/services/fs.h similarity index 100% rename from src/libnx/nx/include/switch/services/fs.h rename to src/libnx_wrapper/nx/include/switch/services/fs.h diff --git a/src/libnx/nx/include/switch/services/fsldr.h b/src/libnx_wrapper/nx/include/switch/services/fsldr.h similarity index 100% rename from src/libnx/nx/include/switch/services/fsldr.h rename to src/libnx_wrapper/nx/include/switch/services/fsldr.h diff --git a/src/libnx/nx/include/switch/services/fspr.h b/src/libnx_wrapper/nx/include/switch/services/fspr.h similarity index 100% rename from src/libnx/nx/include/switch/services/fspr.h rename to src/libnx_wrapper/nx/include/switch/services/fspr.h diff --git a/src/libnx/nx/include/switch/services/hid.h b/src/libnx_wrapper/nx/include/switch/services/hid.h similarity index 100% rename from src/libnx/nx/include/switch/services/hid.h rename to src/libnx_wrapper/nx/include/switch/services/hid.h diff --git a/src/libnx/nx/include/switch/services/irs.h b/src/libnx_wrapper/nx/include/switch/services/irs.h similarity index 100% rename from src/libnx/nx/include/switch/services/irs.h rename to src/libnx_wrapper/nx/include/switch/services/irs.h diff --git a/src/libnx/nx/include/switch/services/ldr.h b/src/libnx_wrapper/nx/include/switch/services/ldr.h similarity index 100% rename from src/libnx/nx/include/switch/services/ldr.h rename to src/libnx_wrapper/nx/include/switch/services/ldr.h diff --git a/src/libnx/nx/include/switch/services/lr.h b/src/libnx_wrapper/nx/include/switch/services/lr.h similarity index 100% rename from src/libnx/nx/include/switch/services/lr.h rename to src/libnx_wrapper/nx/include/switch/services/lr.h diff --git a/src/libnx/nx/include/switch/services/nifm.h b/src/libnx_wrapper/nx/include/switch/services/nifm.h similarity index 100% rename from src/libnx/nx/include/switch/services/nifm.h rename to src/libnx_wrapper/nx/include/switch/services/nifm.h diff --git a/src/libnx/nx/include/switch/services/ns.h b/src/libnx_wrapper/nx/include/switch/services/ns.h similarity index 100% rename from src/libnx/nx/include/switch/services/ns.h rename to src/libnx_wrapper/nx/include/switch/services/ns.h diff --git a/src/libnx/nx/include/switch/services/nv.h b/src/libnx_wrapper/nx/include/switch/services/nv.h similarity index 100% rename from src/libnx/nx/include/switch/services/nv.h rename to src/libnx_wrapper/nx/include/switch/services/nv.h diff --git a/src/libnx/nx/include/switch/services/pl.h b/src/libnx_wrapper/nx/include/switch/services/pl.h similarity index 100% rename from src/libnx/nx/include/switch/services/pl.h rename to src/libnx_wrapper/nx/include/switch/services/pl.h diff --git a/src/libnx/nx/include/switch/services/pm.h b/src/libnx_wrapper/nx/include/switch/services/pm.h similarity index 100% rename from src/libnx/nx/include/switch/services/pm.h rename to src/libnx_wrapper/nx/include/switch/services/pm.h diff --git a/src/libnx/nx/include/switch/services/set.h b/src/libnx_wrapper/nx/include/switch/services/set.h similarity index 100% rename from src/libnx/nx/include/switch/services/set.h rename to src/libnx_wrapper/nx/include/switch/services/set.h diff --git a/src/libnx/nx/include/switch/services/sfdnsres.h b/src/libnx_wrapper/nx/include/switch/services/sfdnsres.h similarity index 100% rename from src/libnx/nx/include/switch/services/sfdnsres.h rename to src/libnx_wrapper/nx/include/switch/services/sfdnsres.h diff --git a/src/libnx/nx/include/switch/services/sm.h b/src/libnx_wrapper/nx/include/switch/services/sm.h similarity index 100% rename from src/libnx/nx/include/switch/services/sm.h rename to src/libnx_wrapper/nx/include/switch/services/sm.h diff --git a/src/libnx/nx/include/switch/services/smm.h b/src/libnx_wrapper/nx/include/switch/services/smm.h similarity index 100% rename from src/libnx/nx/include/switch/services/smm.h rename to src/libnx_wrapper/nx/include/switch/services/smm.h diff --git a/src/libnx/nx/include/switch/services/spl.h b/src/libnx_wrapper/nx/include/switch/services/spl.h similarity index 100% rename from src/libnx/nx/include/switch/services/spl.h rename to src/libnx_wrapper/nx/include/switch/services/spl.h diff --git a/src/libnx/nx/include/switch/services/time.h b/src/libnx_wrapper/nx/include/switch/services/time.h similarity index 100% rename from src/libnx/nx/include/switch/services/time.h rename to src/libnx_wrapper/nx/include/switch/services/time.h diff --git a/src/libnx/nx/include/switch/services/usb.h b/src/libnx_wrapper/nx/include/switch/services/usb.h similarity index 100% rename from src/libnx/nx/include/switch/services/usb.h rename to src/libnx_wrapper/nx/include/switch/services/usb.h diff --git a/src/libnx/nx/include/switch/services/vi.h b/src/libnx_wrapper/nx/include/switch/services/vi.h similarity index 100% rename from src/libnx/nx/include/switch/services/vi.h rename to src/libnx_wrapper/nx/include/switch/services/vi.h diff --git a/src/libnx/nx/include/switch/types.h b/src/libnx_wrapper/nx/include/switch/types.h similarity index 100% rename from src/libnx/nx/include/switch/types.h rename to src/libnx_wrapper/nx/include/switch/types.h diff --git a/src/libnx/nxlink.nim b/src/libnx_wrapper/nxlink.nim similarity index 100% rename from src/libnx/nxlink.nim rename to src/libnx_wrapper/nxlink.nim diff --git a/src/libnx/parcel.nim b/src/libnx_wrapper/parcel.nim similarity index 96% rename from src/libnx/parcel.nim rename to src/libnx_wrapper/parcel.nim index d5e5033..f5c78e5 100644 --- a/src/libnx/parcel.nim +++ b/src/libnx_wrapper/parcel.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headerparcel = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/parcel.h" -import libnx/types -import libnx/result -import libnx/binder +import libnx_wrapper/types +import libnx_wrapper/result +import libnx_wrapper/binder type Parcel* {.importc: "Parcel", header: headerparcel, bycopy.} = object payload* {.importc: "payload".}: array[0x00000400, uint8] diff --git a/src/libnx/pl.nim b/src/libnx_wrapper/pl.nim similarity index 97% rename from src/libnx/pl.nim rename to src/libnx_wrapper/pl.nim index e19fee6..e83182a 100644 --- a/src/libnx/pl.nim +++ b/src/libnx_wrapper/pl.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerpl = currentSourcePath().splitPath().head & "/nx/include/switch/services/pl.h" -import libnx/types +import libnx_wrapper/types type PlSharedFontType* {.size: sizeof(cint).} = enum PlSharedFontType_Standard = 0, PlSharedFontType_ChineseSimplified = 1, diff --git a/src/libnx/pm.nim b/src/libnx_wrapper/pm.nim similarity index 98% rename from src/libnx/pm.nim rename to src/libnx_wrapper/pm.nim index 018f8aa..f0ad3a2 100644 --- a/src/libnx/pm.nim +++ b/src/libnx_wrapper/pm.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerpm = currentSourcePath().splitPath().head & "/nx/include/switch/services/pm.h" -import libnx/types +import libnx_wrapper/types proc pmdmntInitialize*(): Result {.cdecl, importc: "pmdmntInitialize", header: headerpm.} proc pmdmntExit*() {.cdecl, importc: "pmdmntExit", header: headerpm.} diff --git a/src/libnx/random.nim b/src/libnx_wrapper/random.nim similarity index 92% rename from src/libnx/random.nim rename to src/libnx_wrapper/random.nim index ad475f6..72334ec 100644 --- a/src/libnx/random.nim +++ b/src/libnx_wrapper/random.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerrandom = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/random.h" -import libnx/types +import libnx_wrapper/types proc randomGet*(buf: pointer; len: csize) {.cdecl, importc: "randomGet", header: headerrandom.} proc randomGet64*(): uint64 {.cdecl, importc: "randomGet64", header: headerrandom.} \ No newline at end of file diff --git a/src/libnx/result.nim b/src/libnx_wrapper/result.nim similarity index 100% rename from src/libnx/result.nim rename to src/libnx_wrapper/result.nim diff --git a/src/libnx/romfs_dev.nim b/src/libnx_wrapper/romfs_dev.nim similarity index 98% rename from src/libnx/romfs_dev.nim rename to src/libnx_wrapper/romfs_dev.nim index c10d246..354f02e 100644 --- a/src/libnx/romfs_dev.nim +++ b/src/libnx_wrapper/romfs_dev.nim @@ -11,7 +11,7 @@ const headerromfs_dev = currentSourcePath().splitPath().head & "/nx/include/swit ## import - ../libnx/types, ../libnx/fs + ../libnx_wrapper/types, ../libnx_wrapper/fs ## / RomFS header. diff --git a/src/libnx/rwlock.nim b/src/libnx_wrapper/rwlock.nim similarity index 96% rename from src/libnx/rwlock.nim rename to src/libnx_wrapper/rwlock.nim index 3b99d4e..ed712ba 100644 --- a/src/libnx/rwlock.nim +++ b/src/libnx_wrapper/rwlock.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerrwlock = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/rwlock.h" -import libnx/mutex +import libnx_wrapper/mutex type RwLock* {.importc: "RwLock", header: headerrwlock, bycopy.} = object r* {.importc: "r".}: RMutex diff --git a/src/libnx/set.nim b/src/libnx_wrapper/set.nim similarity index 98% rename from src/libnx/set.nim rename to src/libnx_wrapper/set.nim index d3fc76f..a36310c 100644 --- a/src/libnx/set.nim +++ b/src/libnx_wrapper/set.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headerset = currentSourcePath().splitPath().head & "/nx/include/switch/services/set.h" -import libnx/types -import libnx/result +import libnx_wrapper/types +import libnx_wrapper/result const SET_MAX_NAME_SIZE* = 0x00000048 diff --git a/src/libnx/shmem.nim b/src/libnx_wrapper/shmem.nim similarity index 98% rename from src/libnx/shmem.nim rename to src/libnx_wrapper/shmem.nim index e3dd76d..6a81eac 100644 --- a/src/libnx/shmem.nim +++ b/src/libnx_wrapper/shmem.nim @@ -10,11 +10,11 @@ const headershmem = currentSourcePath().splitPath().head & "/nx/include/switch/k ## import - libnx/types + libnx_wrapper/types ## / Shared memory information structure. -import libnx/svc +import libnx_wrapper/svc type SharedMemory* {.importc: "SharedMemory", header: headershmem, bycopy.} = object handle* {.importc: "handle".}: Handle ## /< Kernel object handle. diff --git a/src/libnx/sm.nim b/src/libnx_wrapper/sm.nim similarity index 99% rename from src/libnx/sm.nim rename to src/libnx_wrapper/sm.nim index 0229637..48d4389 100644 --- a/src/libnx/sm.nim +++ b/src/libnx_wrapper/sm.nim @@ -10,7 +10,7 @@ const headersm = currentSourcePath().splitPath().head & "/nx/include/switch/serv ## import - libnx/types, libnx/svc, libnx/ipc + libnx_wrapper/types, libnx_wrapper/svc, libnx_wrapper/ipc ## / Service type. diff --git a/src/libnx/smm.nim b/src/libnx_wrapper/smm.nim similarity index 90% rename from src/libnx/smm.nim rename to src/libnx_wrapper/smm.nim index 39b0e45..90ff365 100644 --- a/src/libnx/smm.nim +++ b/src/libnx_wrapper/smm.nim @@ -1,9 +1,9 @@ import strutils import ospaths const headersmm = currentSourcePath().splitPath().head & "/nx/include/switch/services/smm.h" -import libnx/types -import libnx/sm -import libnx/fs +import libnx_wrapper/types +import libnx_wrapper/sm +import libnx_wrapper/fs proc smManagerInitialize*(): Result {.cdecl, importc: "smManagerInitialize", header: headersmm.} proc smManagerExit*() {.cdecl, importc: "smManagerExit", header: headersmm.} diff --git a/src/libnx/socket.nim b/src/libnx_wrapper/socket.nim similarity index 98% rename from src/libnx/socket.nim rename to src/libnx_wrapper/socket.nim index 580620f..c366a13 100644 --- a/src/libnx/socket.nim +++ b/src/libnx_wrapper/socket.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headersocket = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/devices/socket.h" -import libnx/types +import libnx_wrapper/types type SocketInitConfig* {.importc: "SocketInitConfig", header: headersocket, bycopy.} = object bsdsockets_version* {.importc: "bsdsockets_version".}: uint32 diff --git a/src/libnx/spl.nim b/src/libnx_wrapper/spl.nim similarity index 99% rename from src/libnx/spl.nim rename to src/libnx_wrapper/spl.nim index 74d0c06..224c0ea 100644 --- a/src/libnx/spl.nim +++ b/src/libnx_wrapper/spl.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerspl = currentSourcePath().splitPath().head & "/nx/include/switch/services/spl.h" -import libnx/types +import libnx_wrapper/types type SplConfigItem* {.size: sizeof(cint).} = enum SplConfigItem_DisableProgramVerification = 1, SplConfigItem_DramId = 2, diff --git a/src/libnx/svc.nim b/src/libnx_wrapper/svc.nim similarity index 99% rename from src/libnx/svc.nim rename to src/libnx_wrapper/svc.nim index 188f032..cf7614f 100644 --- a/src/libnx/svc.nim +++ b/src/libnx_wrapper/svc.nim @@ -8,7 +8,7 @@ const headersvc = currentSourcePath().splitPath().head & "/nx/include/switch/ker ## import - libnx/types + libnx_wrapper/types ## / Pseudo handle for the current process. @@ -22,7 +22,7 @@ const ## / Memory type enumeration (lower 8 bits of \ref MemoryState) -import libnx/types +import libnx_wrapper/types type MemoryType* {.size: sizeof(cint).} = enum MemType_Unmapped = 0x00000000, ## /< Unmapped memory. diff --git a/src/libnx_wrapper/switch.nim b/src/libnx_wrapper/switch.nim new file mode 100644 index 0000000..fb67c35 --- /dev/null +++ b/src/libnx_wrapper/switch.nim @@ -0,0 +1,62 @@ +import strutils +import ospaths +const headerswitch = currentSourcePath().splitPath().head & "/nx/include/switch.h" +import libnx_wrapper/types +import libnx_wrapper/result +import libnx_wrapper/nro +import libnx_wrapper/nacp +import libnx_wrapper/tls +import libnx_wrapper/cache +import libnx_wrapper/svc +import libnx_wrapper/tmem +import libnx_wrapper/shmem +import libnx_wrapper/mutex +import libnx_wrapper/rwlock +import libnx_wrapper/condvar +import libnx_wrapper/thread +import libnx_wrapper/virtmem +import libnx_wrapper/detect +import libnx_wrapper/random +import libnx_wrapper/jit +import libnx_wrapper/ipc +import libnx_wrapper/sm +import libnx_wrapper/smm +import libnx_wrapper/fs +import libnx_wrapper/fsldr +import libnx_wrapper/fspr +import libnx_wrapper/acc +import libnx_wrapper/apm +import libnx_wrapper/applet +import libnx_wrapper/audin +import libnx_wrapper/audout +import libnx_wrapper/csrng +import libnx_wrapper/fatal +import libnx_wrapper/time +import libnx_wrapper/usb +import libnx_wrapper/hid +import libnx_wrapper/irs +import libnx_wrapper/pl +import libnx_wrapper/vi +import libnx_wrapper/nv +import libnx_wrapper/nifm +import libnx_wrapper/ns +import libnx_wrapper/ldr +import libnx_wrapper/pm +import libnx_wrapper/set +import libnx_wrapper/lr +import libnx_wrapper/spl +import libnx_wrapper/gfx +import libnx_wrapper/binder +import libnx_wrapper/parcel +import libnx_wrapper/buffer_producer +import libnx_wrapper/ioctl +import libnx_wrapper/nvioctl +import libnx_wrapper/nvgfx +import libnx_wrapper/env +import libnx_wrapper/nxlink +import libnx_wrapper/utf +import libnx_wrapper/console +import libnx_wrapper/usb_comms +import libnx_wrapper/fs_dev +import libnx_wrapper/romfs_dev +import libnx_wrapper/socket diff --git a/src/libnx/thread.nim b/src/libnx_wrapper/thread.nim similarity index 97% rename from src/libnx/thread.nim rename to src/libnx_wrapper/thread.nim index 18c829f..d2ba7ff 100644 --- a/src/libnx/thread.nim +++ b/src/libnx_wrapper/thread.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerthread = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/thread.h" -import libnx/types +import libnx_wrapper/types type Thread* {.importc: "Thread", header: headerthread, bycopy.} = object handle* {.importc: "handle".}: Handle diff --git a/src/libnx/time.nim b/src/libnx_wrapper/time.nim similarity index 94% rename from src/libnx/time.nim rename to src/libnx_wrapper/time.nim index 04e668b..8d342f0 100644 --- a/src/libnx/time.nim +++ b/src/libnx_wrapper/time.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headertime = currentSourcePath().splitPath().head & "/nx/include/switch/services/time.h" -import libnx/types -import libnx/sm +import libnx_wrapper/types +import libnx_wrapper/sm type TimeType* {.size: sizeof(cint).} = enum TimeType_UserSystemClock, TimeType_NetworkSystemClock, diff --git a/src/libnx/tls.nim b/src/libnx_wrapper/tls.nim similarity index 95% rename from src/libnx/tls.nim rename to src/libnx_wrapper/tls.nim index bf79462..9389e6d 100644 --- a/src/libnx/tls.nim +++ b/src/libnx_wrapper/tls.nim @@ -9,7 +9,7 @@ const headertls = currentSourcePath().splitPath().head & "/nx/include/switch/arm ## import - libnx/types + libnx_wrapper/types ## * ## @brief Gets the thread local storage buffer. diff --git a/src/libnx/tmem.nim b/src/libnx_wrapper/tmem.nim similarity index 95% rename from src/libnx/tmem.nim rename to src/libnx_wrapper/tmem.nim index 03f5ee0..effb0fe 100644 --- a/src/libnx/tmem.nim +++ b/src/libnx_wrapper/tmem.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headertmem = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/tmem.h" -import libnx/types -import libnx/svc +import libnx_wrapper/types +import libnx_wrapper/svc type TransferMemory* {.importc: "TransferMemory", header: headertmem, bycopy.} = object handle* {.importc: "handle".}: Handle diff --git a/src/libnx/types.nim b/src/libnx_wrapper/types.nim similarity index 100% rename from src/libnx/types.nim rename to src/libnx_wrapper/types.nim diff --git a/src/libnx/usb.nim b/src/libnx_wrapper/usb.nim similarity index 99% rename from src/libnx/usb.nim rename to src/libnx_wrapper/usb.nim index 783f5ac..4185217 100644 --- a/src/libnx/usb.nim +++ b/src/libnx_wrapper/usb.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headerusb = currentSourcePath().splitPath().head & "/nx/include/switch/services/usb.h" -import libnx/types -import libnx/sm +import libnx_wrapper/types +import libnx_wrapper/sm const USBDS_DEFAULT_InterfaceNumber* = 0x00000004 USB_DT_INTERFACE_SIZE* = 9 diff --git a/src/libnx/usb_comms.nim b/src/libnx_wrapper/usb_comms.nim similarity index 97% rename from src/libnx/usb_comms.nim rename to src/libnx_wrapper/usb_comms.nim index 4e1e725..cc6127b 100644 --- a/src/libnx/usb_comms.nim +++ b/src/libnx_wrapper/usb_comms.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerusb_comms = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/devices/usb_comms.h" -import libnx/types +import libnx_wrapper/types proc usbCommsInitialize*(): Result {.cdecl, importc: "usbCommsInitialize", header: headerusb_comms.} proc usbCommsExit*() {.cdecl, importc: "usbCommsExit", header: headerusb_comms.} diff --git a/src/libnx/utf.nim b/src/libnx_wrapper/utf.nim similarity index 98% rename from src/libnx/utf.nim rename to src/libnx_wrapper/utf.nim index d1e1746..51cd822 100644 --- a/src/libnx/utf.nim +++ b/src/libnx_wrapper/utf.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headerutf = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/util/utf.h" -import libnx/types +import libnx_wrapper/types proc decode_utf8*(`out`: ptr uint32_t; `in`: ptr uint8_t): ssize_t {.cdecl, importc: "decode_utf8", header: headerutf.} proc decode_utf16*(`out`: ptr uint32_t; `in`: ptr uint16_t): ssize_t {.cdecl, diff --git a/src/libnx/vi.nim b/src/libnx_wrapper/vi.nim similarity index 98% rename from src/libnx/vi.nim rename to src/libnx_wrapper/vi.nim index c1a7877..000afcc 100644 --- a/src/libnx/vi.nim +++ b/src/libnx_wrapper/vi.nim @@ -1,8 +1,8 @@ import strutils import ospaths const headervi = currentSourcePath().splitPath().head & "/nx/include/switch/services/vi.h" -import libnx/types -import libnx/sm +import libnx_wrapper/types +import libnx_wrapper/sm type ViDisplay* {.importc: "ViDisplay", header: headervi, bycopy.} = object display_id* {.importc: "display_id".}: uint64 diff --git a/src/libnx/virtmem.nim b/src/libnx_wrapper/virtmem.nim similarity index 95% rename from src/libnx/virtmem.nim rename to src/libnx_wrapper/virtmem.nim index 3750b97..b23257d 100644 --- a/src/libnx/virtmem.nim +++ b/src/libnx_wrapper/virtmem.nim @@ -1,7 +1,7 @@ import strutils import ospaths const headervirtmem = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/virtmem.h" -import libnx/types +import libnx_wrapper/types proc virtmemReserve*(size: csize): pointer {.cdecl, importc: "virtmemReserve", header: headervirtmem.} proc virtmemFree*(`addr`: pointer; size: csize) {.cdecl, importc: "virtmemFree",