Rename wrappers for now

This commit is contained in:
Joey Yakimowich-Payne 2018-06-22 16:19:15 +09:00
commit 54d10731d3
131 changed files with 179 additions and 236 deletions

View file

@ -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: "<stdio.h>".}

View file

@ -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"

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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,

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -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.

View file

@ -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

View file

@ -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.}

View file

@ -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",

View file

@ -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

View file

@ -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.}

View file

@ -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

View file

@ -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

View file

@ -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.}

View file

@ -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.}

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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]

View file

@ -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.}

View file

@ -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

View file

@ -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,

View file

@ -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.}

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more