Skip to content

Commit

Permalink
Upload 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanquitas committed Oct 13, 2016
1 parent b1b82fa commit 0519100
Show file tree
Hide file tree
Showing 64 changed files with 2,023 additions and 154 deletions.
3 changes: 3 additions & 0 deletions BootNTR.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<ClInclude Include="source\draw.h" />
<ClInclude Include="source\drawableObject.h" />
<ClInclude Include="source\graphics.h" />
<ClInclude Include="source\json\json.h" />
<ClInclude Include="source\main.h" />
<ClInclude Include="source\mysvcs.h" />
<ClInclude Include="source\ns.h" />
Expand Down Expand Up @@ -169,13 +170,15 @@
<ClCompile Include="source\firstLaunchMenu.c" />
<ClCompile Include="source\graphics.c" />
<ClCompile Include="source\homemenu.c" />
<ClCompile Include="source\json\json.c" />
<ClCompile Include="source\kernel.c" />
<ClCompile Include="source\main.c" />
<ClCompile Include="source\mainMenu.c" />
<ClCompile Include="source\memory_functions.c" />
<ClCompile Include="source\ntr_launcher.c" />
<ClCompile Include="source\pathPatcher.c" />
<ClCompile Include="source\png.c" />
<ClCompile Include="source\updater.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
9 changes: 9 additions & 0 deletions BootNTR.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
<ClInclude Include="source\drawableObject.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="source\json\json.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="lib\ctrcommon\source\ctrcommon\app.cpp">
Expand Down Expand Up @@ -187,5 +190,11 @@
<ClCompile Include="source\mainMenu.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="source\updater.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="source\json\json.c">
<Filter>Fichiers sources</Filter>
</ClCompile>
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ APP_MAJOR_VERSION := $(shell echo $(APP_MAJOR_VERSION) | cut -c1-2)
APP_MINOR_VERSION := $(shell echo $(APP_MINOR_VERSION) | cut -c1-2)

BUILD := build
SOURCES := source
SOURCES := source source/json
DATA := data
ROMFS := $(TOPDIR)/romfs/romfsBuilt
ROMFS3DSX := $(TOPDIR)/romfs
INCLUDES := $(SOURCES) include
ICON := resources/icon.png
BANNER := $(TOPDIR)/resources/fonzd_banner2.bnr
#BANNER := $(TOPDIR)/resources/FONZD_banner.bnr
BANNER := $(TOPDIR)/resources/PabloMK7_banner.bnr
CITRA_D := "C:/Users/Nath/Desktop/citra"

#---------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions NTRCFWSelector-cia.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ AccessControlInfo:
GetThreadInfo: 44
GetThreadPriority: 11
InvalidateProcessDataCache : 82
KernelSetState: 124
MapMemoryBlock: 31
OpenProcess : 51
OutputDebugString: 61
Expand Down Expand Up @@ -181,6 +182,7 @@ AccessControlInfo:
- nim:aoc
- nwm::UDS
- ptm:u
- ptm:sysm
- qtm:u
- soc:U
- ssl:C
Expand Down
Binary file added output/BootNTRSelector - 13102016.zip
Binary file not shown.
Binary file added output/BootNTRSelector 2.0-FONZD-Banner.zip
Binary file not shown.
Binary file added output/BootNTRSelector 2.0-PabloMK7-Banner.zip
Binary file not shown.
Binary file not shown.
Binary file added output/BootNTRSelector.zip
Binary file not shown.
Binary file removed output/NTRCFWSelector.elf
Binary file not shown.
Binary file removed output/NTRCFWSelector.zip
Binary file not shown.
Binary file added output/output.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/AppInfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_TITLE = NTR CFW Selector
APP_TITLE = Boot NTR Selector
APP_DESCRIPTION = Enhanced NTR CFW Loader
APP_AUTHOR = Nanquitas
APP_PRODUCT_CODE = CTR-P-BNTR
Expand Down
Binary file removed resources/BOT.png
Binary file not shown.
Binary file removed resources/INFO.png
Binary file not shown.
File renamed without changes.
Binary file removed resources/TOP.png
Binary file not shown.
Binary file removed resources/blue_icon.png
Binary file not shown.
Binary file removed resources/data.rar
Binary file not shown.
Binary file modified resources/fonzd_banner.bnr
Binary file not shown.
Binary file removed resources/fonzd_banner2.bnr
Binary file not shown.
Binary file removed resources/green_banner.bnr
Binary file not shown.
Binary file removed resources/green_icon.png
Binary file not shown.
Binary file modified romfs/romfsBuilt
Binary file not shown.
Binary file modified romfs/sprites/Thumbs.db
Binary file not shown.
Binary file added romfs/sprites/largeButtonBackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed romfs/sprites/largeButtonBg.png
Binary file not shown.
Binary file modified romfs/sprites/textSprites/32Version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/33Version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/34Version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/Thumbs.db
Binary file not shown.
Binary file modified romfs/sprites/textSprites/binariesPath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/createCustom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/sprites/textSprites/ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/sprites/textSprites/pluginFolderWarning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/pluginsPath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/saveSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/sprites/textSprites/updaterTitle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/useDefault.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified romfs/sprites/textSprites/useSettings2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/sprites/tinyButtonBackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed romfs/sprites/tinyButtonBg.png
Binary file not shown.
14 changes: 13 additions & 1 deletion source/appInfo.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "appInfo.h"

static bool autoUpdate = true;
static bool showBackground = true;

void appInfoDisableAutoUpdate(void)
{
Expand All @@ -12,6 +13,16 @@ void appInfoEnableAutoUpdate(void)
autoUpdate = true;
}

void appInfoHideBackground(void)
{
showBackground = false;
}

void appInfoShowBackground(void)
{
showBackground = true;
}

appInfoObject_t *newAppInfoObject(sprite_t *sprite, u32 maxEntryCount, u32 posX, u32 posY)
{
appInfoObject_t *object;
Expand Down Expand Up @@ -246,7 +257,8 @@ void drawAppInfo(appInfoObject_t *object)
cursorXBak = cursor->posX;
cursorYBak = cursor->posY;
setSpritePos(object->sprite, object->spritePosX, object->spritePosY);
drawSprite(object->sprite);
if (showBackground)
drawSprite(object->sprite);
for (i = 0; i < entryCount; i++)
{
if (cursor->posY >= boundY) break;
Expand Down
2 changes: 2 additions & 0 deletions source/appInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ void clearAppInfo(appInfoObject_t *object, bool updateScreen);
void drawAppInfo(appInfoObject_t *object);
void appInfoDisableAutoUpdate(void);
void appInfoEnableAutoUpdate(void);
void appInfoHideBackground(void);
void appInfoShowBackground(void);
/*
** graphic.h
*/
Expand Down
4 changes: 2 additions & 2 deletions source/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ void drawButton(button_t *button)
setSpritePos(button->buttonSprite, posX, posY);
drawSprite(button->buttonSprite);
marginX = button->buttonSprite->width - button->textSprite->width;
marginX /= 2;
if (marginX > 1) marginX = (float)((u32)marginX / 2);
posX += marginX;
marginY = button->buttonSprite->height - button->textSprite->height;
marginY /= 2;
if (marginY > 1) marginY = (float)((u32)marginY / 2);
posY += marginY;
setSpritePos(button->textSprite, posX, posY);
drawSprite(button->textSprite);
Expand Down
4 changes: 2 additions & 2 deletions source/common_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ void waitAllKeysReleased(void)
}
}

void debug(char *str)
void debug(char *str, int seconds)
{
time_t t;

newAppTop(DEFAULT_COLOR, 0, "%s", str);
t = time(NULL);
while (t + 2 != time(NULL))
while (t + seconds != time(NULL))
updateUI();
}

Expand Down
16 changes: 12 additions & 4 deletions source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ bool checkPath(void)
if (strncmp(bnConfig->config->pluginPath, "sdmc:/", 6)) goto error;
tmp = bnConfig->config->binariesPath;
while (*(tmp + 1)) tmp++;
if (*tmp != '/') *tmp = '/';
if (*tmp != '/') *(tmp + 1) = '/';
tmp = bnConfig->config->pluginPath;
while (*(tmp + 1)) tmp++;
if (*tmp != '/') *tmp = '/';
if (*tmp != '/') *(tmp + 1) = '/';
return (true);
error:
return (false);
if (*bnConfig->config->binariesPath == '/')
strInsert(bnConfig->config->binariesPath, "sdmc:", 0);
else
strInsert(bnConfig->config->binariesPath, "sdmc:/", 0);
if (*bnConfig->config->pluginPath == '/')
strInsert(bnConfig->config->pluginPath, "sdmc:", 0);
else
strInsert(bnConfig->config->pluginPath, "sdmc:/", 0);
return (checkPath());
}

bool loadConfigFromFile(config_t *config)
Expand All @@ -48,7 +56,7 @@ bool saveConfig(void)

config = g_bnConfig.config;
if (!fileExists(configDir))
mkdir(configDir, 777);
createDir(configDir);
if (!fileExists(configDir)) goto error;
file = fopen(configPath, "wb");
if (!file) goto error;
Expand Down
7 changes: 4 additions & 3 deletions source/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static cursor_t cursor[2] = { { 10, 10 },{ 10, 10 } };

#define TEXT_VTX_ARRAY_COUNT (8 * 1024)

#define TEX_MIN_SIZE 32
#define TEX_MIN_SIZE 64

//Grabbed from: http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
unsigned int nextPow2(unsigned int v)
Expand Down Expand Up @@ -92,7 +92,6 @@ void drawSprite(sprite_t *sprite)

//Bind the sprite's texture
bindTexture(texture);

C3D_BufInfo *bufInfo = C3D_GetBufInfo();
BufInfo_Init(bufInfo);
BufInfo_Add(bufInfo, textVtxArray, sizeof(textVertex_s), 2, 0x10);
Expand Down Expand Up @@ -121,7 +120,9 @@ sprite_t *newSprite(int width, int height)
//Create and init the sprite's texture
result = C3D_TexInit(texture, nextPow2(width), nextPow2(height), GPU_RGBA8);
if (!result) goto texInitError;
C3D_TexSetWrap(texture, GPU_CLAMP_TO_BORDER, GPU_CLAMP_TO_BORDER);
//C3D_TexSetWrap(texture, GPU_CLAMP_TO_BORDER, GPU_CLAMP_TO_BORDER);
texture->param = GPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR)
| GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_BORDER) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_BORDER);

sprite->width = (float)width;
sprite->height = (float)height;
Expand Down
27 changes: 15 additions & 12 deletions source/draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ typedef struct
{
float position[3];
float texcoord[2];
} textVertex_s;
} textVertex_s;

typedef struct drawTarget_s
typedef struct drawTarget_s
{
C3D_RenderTarget *target;
C3D_Mtx projection;
Expand All @@ -63,7 +63,6 @@ void drawInit(void);
void drawExit(void);
void drawEndFrame(void);
void getTextSizeInfos(float *width, float scaleX, float scaleY, const char *text);
void resetTextColor(void);
void setTextColor(u32 color);
void renderText(float x, float y, float scaleX, float scaleY, bool baseline, const char *text, cursor_t *cursor);
void drawText(screenPos_t pos, float size, u32 color, char *text, ...);
Expand All @@ -77,15 +76,19 @@ void deleteSprite(sprite_t *sprite);
void setSpritePos(sprite_t *sprite, float posX, float posY);
void drawSprite(sprite_t *sprite);

#define COLOR_BLUE 0xFFFF0000
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0xFF00FF00
#define COLOR_BLANK 0xFFFFFFFF
#define COLOR_BLACK 0xFF000000
#define COLOR_GREY 0xFF989898
#define COLOR_ORANGE 0xFF00A5FF

#define COLOR_DARKGREEN 0xFF006400
#define COLOR_BLUE 0xFFFF0000
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0xFF00FF00
#define COLOR_BLANK 0xFFFFFFFF
#define COLOR_BLACK 0xFF000000
#define COLOR_GREY 0xFF989898
#define COLOR_ORANGE 0xFF00A5FF
#define COLOR_LIMEGREEN 0xFF32CD32
#define COLOR_SALMON 0xFF7280FA
#define COLOR_SILVER 0xFFC0C0C0
#define COLOR_CORAL 0xFF507FFF

#define COLOR_DARKGREEN 0xFF006400



Expand Down
28 changes: 28 additions & 0 deletions source/files.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "main.h"
#include <errno.h>
#include <sys/stat.h>

extern char *g_primary_error;

Expand Down Expand Up @@ -44,3 +46,29 @@ int copy_file(char *old_filename, char *new_filename)
remove("sdmc:/ntr.bin");
return (RESULT_ERROR);
}

int createDir(const char *path)
{
u32 len = strlen(path);
char _path[0x100];
char *p;

errno = 0;
if (len > 0x100) goto error;
strcpy(_path, path);
for (p = _path + 1; *p; p++)
{
if (*p == '/')
{
*p = '\0';
if (mkdir(_path, 777) != 0)
if (errno != EEXIST) goto error;
*p = '/';
}
}
if (mkdir(_path, 777) != 0)
if (errno != EEXIST) goto error;
return (0);
error:
return (-1);
}
Loading

0 comments on commit 0519100

Please sign in to comment.