diff --git a/config.nims b/config.nims index 56e3b9e..2f23edc 100644 --- a/config.nims +++ b/config.nims @@ -5,24 +5,8 @@ const # whether or not we should be able inspect the output here buildCacheHere = true -# GBDK dirs +# Precompile "scripts" #-------------------------------------# -let - gbdkRoot = getEnv("GBDK_ROOT") - -when not defined(nimsuggest): - doAssert( - gbdkRoot != "", "Please set the GBDK_ROOT env var." - ) - -let - gbdkBin = gbdkRoot / "bin" - gbdkInc = gbdkRoot / "include" -#-------------------------------------# - -# Setup scripts -#-------------------------------------# - proc precompileTools() = let tools = ["compile", "link"] @@ -33,7 +17,10 @@ proc precompileTools() = "c", "-d:release", "--hints:off", thisDir() / "tools" / toolName & ".nim" ].join(" ")) +#-------------------------------------# +# Setup toolchain +#-------------------------------------# proc setupGbdk() = # set c compiler as ""icc"" but is actually sdcc switch "cc", "icc" @@ -79,10 +66,10 @@ proc setupGbdk() = # switch "define", "gameDebug" #-------------------------------------# +# Set compile options specific to main file #-------------------------------------# if projectPath() == thisDir()/mainFile: setupGbdk() - #switch "include", thisDir()/"include"/"gbPrelude.nim" when buildCacheHere: switch "nimcache", "_build" switch "listCmd" diff --git a/include/nimbase.h b/include/nimbase.h index 4095a75..d9bd15b 100644 --- a/include/nimbase.h +++ b/include/nimbase.h @@ -1,13 +1,9 @@ // Minimal nimbase.h targetting GBDK '20 - #include #include #include - #define OLDCALL __sdcccall(0) #define NONBANKED __nonbanked -//#include - #define N_LIB_PRIVATE #define N_NIMCALL(rettype, name) rettype name #define N_NIMCALL_PTR(rettype, name) rettype (*name) @@ -18,10 +14,8 @@ #define N_CLOSURE(rettype, name) N_NIMCALL(rettype, name) #define N_CLOSURE_PTR(rettype, name) N_NIMCALL_PTR(rettype, name) #define N_CDECL(rettype, name) rettype name - typedef signed int NI; typedef unsigned int NU; - typedef int8_t NI8; typedef int16_t NI16; typedef int32_t NI32; @@ -29,30 +23,29 @@ typedef int64_t NI64; #define IL64(x) (x) typedef float NF; typedef float NF32; - typedef uint8_t NU8; typedef uint16_t NU16; typedef uint32_t NU32; typedef uint64_t NU64; - typedef char NIM_CHAR; typedef char* NCSTRING; - #define NIM_BOOL bool #define NIM_NIL 0 #define NIM_TRUE true #define NIM_FALSE false - #define NIM_ALIGNOF(x) _Alignof(x) #define NIM_CONST const - #define SEQ_DECL_SIZE - #define NIM_STRLIT_FLAG ((NU)(1) << ((16) - 2)) - #define NIM_LIKELY(x) (x) #define NIM_UNLIKELY(x) (x) // alias these functions at compiletime for now #define fwrite(a,b,c,d) 0 #define fflush(a) 0 + +// these are added by os:any +// #define FILE void +// #define TFrame void +// #define stderr (void*)0 +// + divulonglong, cannot use that diff --git a/src/panicoverride.nim b/src/panicoverride.nim index a06ddf5..3f2ede7 100644 --- a/src/panicoverride.nim +++ b/src/panicoverride.nim @@ -2,4 +2,4 @@ proc panic (s: string) = ## may be replaced with A Crash Screen discard -proc rawoutput (s: string) = discard \ No newline at end of file +proc rawoutput (s: string) = discard diff --git a/tools/compile.nim b/tools/compile.nim index e246054..8f5c62d 100755 --- a/tools/compile.nim +++ b/tools/compile.nim @@ -1,7 +1,7 @@ ## Mimics icc for compiling. Its purpose is to discern between ## C sources and ASM sources and makes it somewhat manageable. ## -## Calls sdcc and sdld directly. Same kinda hack as link.nims. +## Calls sdcc directly. ## ## Compilation is slow, but I guess that's the kinda ## price to pay for *full* control over the C compiler invocation.