-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 45445ff
Showing
37 changed files
with
6,096 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake-build-debug | ||
data/*.o | ||
data/*.s | ||
data/*.h | ||
*.dol | ||
*.elf | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
cmake_minimum_required(VERSION 3.23) | ||
project(DominosAccountLinker CXX) | ||
|
||
include_directories(${LIBOGCDIR}/include) | ||
include_directories(${DEVKITPRO}/portlibs/wii/include) | ||
include_directories(${DEVKITPRO}/portlibs/ppc/include) | ||
include_directories(${DEVKITPRO}/portlibs/ppc/include/freetype2) | ||
include_directories(gui) | ||
include_directories(data) | ||
link_directories(${DEVKITPRO}/portlibs/wii/lib) | ||
link_directories(${DEVKITPRO}/portlibs/ppc/lib) | ||
link_directories(${DEVKITPRO}/libogc/lib/wii) | ||
|
||
# Binary linker stuff | ||
set(BIN2S ${DEVKITPRO}/tools/bin/bin2s) | ||
set(BINARY_AS ${DEVKITPPC}/bin/powerpc-eabi-as) | ||
|
||
set(MACHDEP "-DGEKKO -mrvl -mcpu=750 -meabi -mhard-float") | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
set(CMAKE_ASM_FLAGS "-x assembler-with-cpp") | ||
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-function -O2 ${CMAKE_CXX_FLAGS} ${MACHDEP}") | ||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-function -O2 ${CMAKE_CXX_FLAGS} ${MACHDEP} -fdiagnostics-color") | ||
set(CMAKE_EXECUTABLE_SUFFIX ".elf") | ||
|
||
add_subdirectory(data) | ||
add_subdirectory(gui) | ||
add_executable(dominos-account-linker | ||
main.cpp | ||
menu.cpp | ||
menu.h | ||
config.cpp | ||
config.h | ||
utils.cpp | ||
utils.h | ||
qr.h | ||
) | ||
|
||
target_link_libraries(dominos-account-linker PRIVATE png gui `freetype-config --libs` wiiuse bte asnd ogc qrencode mbedcrypto z fat | ||
# It absolutely hates glob here so we have to manually set it ourselves | ||
${CMAKE_CURRENT_SOURCE_DIR}/data/channel_gradient_bottom.png.o | ||
${CMAKE_CURRENT_SOURCE_DIR}/data/channel_gradient_top.png.o | ||
${CMAKE_CURRENT_SOURCE_DIR}/data/bg_stripes.png.o | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "config.h" | ||
#include "utils.h" | ||
#include <cstring> | ||
#include <iostream> | ||
#include <string_view> | ||
|
||
constexpr const char CONFIG_PATH[] = "/shared2/wc24/nwc24msg.cfg"; | ||
|
||
NWC24Config::NWC24Config() { ReadConfig(); } | ||
|
||
void NWC24Config::ReadConfig() { | ||
u32 readSize; | ||
void *fileBuffer = ISFS_GetFile(CONFIG_PATH, &readSize); | ||
m_data = *(reinterpret_cast<ConfigData *>(fileBuffer)); | ||
} | ||
|
||
std::string_view NWC24Config::GetPassword() const { return {m_data.paswd}; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include <gccore.h> | ||
#include <string> | ||
#include <string_view> | ||
|
||
enum class NWC24CreationStage : u32 { | ||
Initial = 0, | ||
Generated = 1, | ||
Registered = 2 | ||
}; | ||
|
||
class NWC24Config final { | ||
public: | ||
explicit NWC24Config(); | ||
void ReadConfig(); | ||
|
||
std::string_view GetPassword() const; | ||
|
||
private: | ||
enum { | ||
URL_COUNT = 0x05, | ||
MAX_URL_LENGTH = 0x80, | ||
MAX_EMAIL_LENGTH = 0x40, | ||
MAX_PASSWORD_LENGTH = 0x20, | ||
MAX_MLCHKID_LENGTH = 0x24, | ||
}; | ||
|
||
#pragma pack(push, 1) | ||
struct ConfigData final { | ||
u32 magic; // 'WcCf' 0x57634366 | ||
u32 version; // must be 8 | ||
u64 nwc24_id; | ||
u32 id_generation; | ||
NWC24CreationStage creation_stage; | ||
char email[MAX_EMAIL_LENGTH]; | ||
char paswd[MAX_PASSWORD_LENGTH]; | ||
char mlchkid[MAX_MLCHKID_LENGTH]; | ||
char http_urls[URL_COUNT][MAX_URL_LENGTH]; | ||
u8 reserved[0xDC]; | ||
u32 enable_booting; | ||
u32 checksum; | ||
}; | ||
#pragma pack(pop) | ||
|
||
ConfigData m_data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
file(GLOB pngs "*.png") | ||
|
||
foreach (png ${pngs}) | ||
execute_process( | ||
COMMAND ${BIN2S} -H ${png}.h ${png} | ||
OUTPUT_FILE ${png}.s | ||
) | ||
endforeach () | ||
|
||
# Only one font here | ||
execute_process( | ||
COMMAND ${BIN2S} -H noto_sans_jp_regular.otf.h noto_sans_jp_regular.otf | ||
OUTPUT_FILE noto_sans_jp_regular.otf.s | ||
) | ||
|
||
file(GLOB binaries "*.s") | ||
|
||
foreach (binary ${binaries}) | ||
string(REGEX REPLACE "\\.[^.]*$" "" binary_without_ext ${binary}) | ||
execute_process( | ||
COMMAND ${BINARY_AS} -o ${binary_without_ext}.o ${binary} | ||
) | ||
endforeach () |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
file(GLOB gui_src | ||
"*.cpp" | ||
"*.h" | ||
) | ||
|
||
add_library(gui | ||
${gui_src} | ||
) | ||
|
||
target_link_libraries(gui) |
Oops, something went wrong.