mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-04-24 07:17:11 -05:00
Add nxlinkStdio for debug
This commit is contained in:
parent
2385b2a6c2
commit
8e27e4515f
11
Makefile
11
Makefile
|
|
@ -46,12 +46,12 @@ ROMFS := romfs
|
|||
#---------------------------------------------------------------------------------
|
||||
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
|
||||
|
||||
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
||||
override CFLAGS += -g -Wall -O2 -ffunction-sections \
|
||||
$(ARCH) $(DEFINES)
|
||||
|
||||
CFLAGS += $(INCLUDE) -D__SWITCH__ `freetype-config --cflags`
|
||||
override CFLAGS += $(INCLUDE) -D__SWITCH__ `freetype-config --cflags`
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
CXXFLAGS:= $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
|
||||
ASFLAGS := -g $(ARCH)
|
||||
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||
|
|
@ -141,7 +141,7 @@ ifneq ($(ROMFS),)
|
|||
export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS)
|
||||
endif
|
||||
|
||||
.PHONY: $(BUILD) clean all
|
||||
.PHONY: $(BUILD) clean all debug
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
all: $(BUILD)
|
||||
|
|
@ -160,6 +160,9 @@ clean:
|
|||
send: $(BUILD)
|
||||
@nxlink $(TARGET).nro
|
||||
|
||||
debug: $(BUILD)
|
||||
@nxlink -s $(TARGET).nro
|
||||
|
||||
|
||||
else
|
||||
.PHONY: all
|
||||
|
|
|
|||
|
|
@ -28,5 +28,7 @@ namespace util
|
|||
std::string safeString(const std::string& s);
|
||||
|
||||
std::string getInfoString(data::user& u, data::titledata& d);
|
||||
|
||||
void debugPrintf(const char *format, ...);
|
||||
}
|
||||
#endif // UTIL_H
|
||||
|
|
|
|||
10
src/main.cpp
10
src/main.cpp
|
|
@ -37,6 +37,12 @@ int main(int argc, const char *argv[])
|
|||
data::loadDataInfo();
|
||||
ui::init();
|
||||
|
||||
//built with 'make debug CFLAGS:=-D__debug__'
|
||||
#ifdef __debug__
|
||||
socketInitializeDefault();
|
||||
nxlinkStdio();
|
||||
#endif
|
||||
|
||||
bool run = true;
|
||||
while(appletMainLoop() && run)
|
||||
{
|
||||
|
|
@ -66,6 +72,10 @@ int main(int argc, const char *argv[])
|
|||
|
||||
gfxHandleBuffs();
|
||||
}
|
||||
#ifdef __debug__
|
||||
socketExit();
|
||||
#endif
|
||||
|
||||
graphicsExit();
|
||||
ui::exit();
|
||||
data::exit();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <sys/stat.h>
|
||||
#include <pthread.h>
|
||||
#include <switch.h>
|
||||
|
||||
#include "ui.h"
|
||||
|
|
|
|||
11
src/util.cpp
11
src/util.cpp
|
|
@ -168,4 +168,15 @@ namespace util
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void debugPrintf(const char *format, ...)
|
||||
{
|
||||
#ifdef __debug__
|
||||
char buff[512];
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsnprintf(buff, 512, format, args);
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user