This commit is contained in:
Ghost0159
2021-02-06 20:40:11 +01:00
parent cec3330443
commit c1e86c9d82
255 changed files with 54213 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_ANIMATION_HPP
#define _GHOST_ESHOP_ANIMATION_HPP
#include <3ds.h>
#include <string>
enum class ProgressBar {
Downloading,
Extracting,
Installing,
Copying
};
namespace Animation {
void DrawProgressBar(u64 currentProgress, u64 totalProgress);
void displayProgressBar();
void DrawQueue(int x, int y);
void QueueAnimHandle();
};
#endif
+47
View File
@@ -0,0 +1,47 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_ARGUMENT_PARSER_HPP
#define _GHOST_ESHOP_ARGUMENT_PARSER_HPP
#include "json.hpp"
#include "store.hpp"
#include <string>
class ArgumentParser {
public:
ArgumentParser(const std::string &file, const std::string &entry, int dlIndex);
void Load();
void Execute();
bool GetValid() const { return this->isValid; };
private:
std::unique_ptr<Store> store = nullptr;
bool isValid = false;
std::string file = "", executeEntry = "", entry = "";
int dlIndex = -1, entryIndex = -1;
};
#endif
+40
View File
@@ -0,0 +1,40 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_CIA_HPP
#define _GHOST_ESHOP_CIA_HPP
#include "common.hpp"
#include <3ds.h>
namespace Title {
Result Launch(u64 titleId, FS_MediaType mediaType);
Result DeletePrevious(u64 titleid, FS_MediaType media);
Result Install(const char *ciaPath, bool updateSelf);
};
#endif
+110
View File
@@ -0,0 +1,110 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_CONFIG_HPP
#define _GHOST_ESHOP_CONFIG_HPP
#include "json.hpp"
#include <3ds.h>
#include <string>
class Config {
public:
Config();
void save();
void initialize();
void sysLang();
/* Language. */
std::string language() const { return this->v_language; };
void language(const std::string &v) { this->v_language = v; if (!this->changesMade) this->changesMade = true; };
/* Dernier Magasin. */
std::string lastStore() const { return this->v_lastStore; };
void lastStore(const std::string &v) { this->v_lastStore = v; if (!this->changesMade) this->changesMade = true; };
/* Utilisation De La Liste Supérieure. */
bool list() const { return this->v_list; };
void list(bool v) { this->v_list = v; if (!this->changesMade) this->changesMade = true; };
/* Mise à Jour Automatique Au Démarrage. */
bool autoupdate() const { return this->v_autoUpdate; };
void autoupdate(bool v) { this->v_autoUpdate = v; if (!this->changesMade) this->changesMade = true; };
std::string _3dsxPath() const { return this->v_3dsxPath; };
void _3dsxPath(const std::string &v) { this->v_3dsxPath = v; if (!this->changesMade) this->changesMade = true; };
std::string ndsPath() const { return this->v_ndsPath; };
void ndsPath(const std::string &v) { this->v_ndsPath = v; if (!this->changesMade) this->changesMade = true; };
std::string archPath() const { return this->v_archivePath; };
void archPath(const std::string &v) { this->v_archivePath = v; if (!this->changesMade) this->changesMade = true; };
/* Récupération d'anciennes métadonnées. */
bool metadata() const { return this->v_metadata; };
void metadata(bool v) { this->v_metadata = v; if (!this->changesMade) this->changesMade = true; };
/* Vérification des Mises à Jour de Ghost eShop au Démarrage. */
bool updatecheck() const { return this->v_updateCheck; };
void updatecheck(bool v) { this->v_updateCheck = v; if (!this->changesMade) this->changesMade = true; };
/* Vérification des Mises à Jour de Ghost eShop au Démarrage. */
bool usebg() const { return this->v_showBg; };
void usebg(bool v) { this->v_showBg = v; if (!this->changesMade) this->changesMade = true; };
/* Si vous utilisez une police personnalisée. */
bool customfont() const { return this->v_customFont; };
void customfont(bool v) { this->v_customFont = v; if (!this->changesMade) this->changesMade = true; };
/* Le chemin du raccourci. */
std::string shortcut() const { return this->v_shortcutPath; };
void shortcut(const std::string &v) { this->v_shortcutPath = v; if (!this->changesMade) this->changesMade = true; };
/* If displaying changelog. */
bool changelog() const { return this->v_changelog; };
void changelog(bool v) { this->v_changelog = v; if (!this->changesMade) this->changesMade = true; };
private:
/* Principalement aide. */
bool getBool(const std::string &key);
void setBool(const std::string &key, bool v);
int getInt(const std::string &key);
void setInt(const std::string &key, int v);
std::string getString(const std::string &key);
void setString(const std::string &key, const std::string &v);
nlohmann::json json;
bool changesMade = false;
std::string v_language = "en", v_lastStore = "ghosteshop.eshop",
v_3dsxPath = "sdmc:/3ds", v_ndsPath = "sdmc:", v_archivePath = "sdmc:",
v_shortcutPath = "sdmc:/3ds/GhosteShop/shortcuts";
bool v_list = false, v_autoUpdate = true, v_metadata = true, v_updateCheck = true,
v_showBg = false, v_customFont = false, v_changelog = true;
};
#endif
+90
View File
@@ -0,0 +1,90 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_DOWNLOAD_HPP
#define _GHOST_ESHOP_DOWNLOAD_HPP
#include "common.hpp"
#define APP_TITLE "Ghost eShop"
#define VERSION_STRING "12.0"
enum DownloadError {
DL_ERROR_NONE = 0,
DL_ERROR_WRITEFILE,
DL_ERROR_ALLOC,
DL_ERROR_STATUSCODE,
DL_ERROR_GIT,
DL_CANCEL, // Aucune idée si cest nécessaire.
};
struct StoreList {
std::string Title;
std::string Author;
std::string URL;
std::string Description;
};
struct GEUpdate {
bool Available = false;
std::string Notes = "";
std::string Version = "";
};
Result downloadToFile(const std::string &url, const std::string &path);
Result downloadFromRelease(const std::string &url, const std::string &asset, const std::string &path, bool includePrereleases);
/*
Vérifiez l’état du Wi-Fi.
@return True si le Wi-Fi est connecté ; false si non.
*/
bool checkWifiStatus(void);
/*
Afficher "Veuillez vous connecter au Wi-Fi" pour 2s.
*/
void notConnectedMsg(void);
/*
Affiche "Not Implemented Yet" pour 2s.
*/
void notImplemented(void);
/*
Afficher le msg done.
*/
void doneMsg(void);
bool IsUpdateAvailable(const std::string &URL, int revCurrent);
bool DownloadEshop(const std::string &URL, int currentRev, std::string &fl, bool isDownload = false, bool isUDB = false);
bool DownloadSpriteSheet(const std::string &URL, const std::string &file);
GEUpdate IsGEUpdateAvailable();
void UpdateAction();
std::vector<StoreList> FetchStores();
C2D_Image FetchScreenshot(const std::string &URL);
std::string GetChangelog();
#endif
+46
View File
@@ -0,0 +1,46 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_EXTRACT_HPP
#define _GHOST_ESHOP_EXTRACT_HPP
#include "common.hpp"
enum ExtractError {
EXTRACT_ERROR_NONE = 0,
EXTRACT_ERROR_ARCHIVE,
EXTRACT_ERROR_ALLOC,
EXTRACT_ERROR_FIND,
EXTRACT_ERROR_READFILE,
EXTRACT_ERROR_OPENFILE,
EXTRACT_ERROR_WRITEFILE,
};
Result getExtractedSize(const std::string &archivePath, const std::string &wantedFile);
Result extractArchive(const std::string &archivePath, const std::string &wantedFile, const std::string &outputPath);
#endif
+66
View File
@@ -0,0 +1,66 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_FILE_BROWSE_HPP
#define _GHOST_ESHOP_FILE_BROWSE_HPP
#include <dirent.h>
#include <string>
#include <sys/stat.h>
#include <vector>
struct DirEntry {
std::string name;
std::string path;
bool isDirectory;
};
/*
Information de la structure de l'eShop
*/
struct EshopInfo {
std::string Title;
std::string Author;
std::string URL;
std::string File; // Permet de vérifier si le fichier ne contient PAS de barre oblique.
std::string FileName;
std::string Description;
int Version;
int Revision;
int StoreSize;
};
bool nameEndsWith(const std::string &name, const std::vector<std::string> &extensionList);
void getDirectoryContents(std::vector<DirEntry> &dirContents, const std::vector<std::string> &extensionList);
void getDirectoryContents(std::vector<DirEntry> &dirContents);
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList);
std::vector<EshopInfo> GetEshopInfo(const std::string &path);
void dirCopy(DirEntry *entry, const char *destinationPath, const char *sourcePath);
int fcopy(const char *sourcePath, const char *destinationPath);
#endif
+38
View File
@@ -0,0 +1,38 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_FILES_HPP
#define _GHOST_ESHOP_FILES_HPP
#include "common.hpp"
Result makeDirs(const char *path);
Result openFile(Handle *fileHandle, const char *path, bool write);
Result deleteFile(const char *path);
Result removeDir(const char *path);
Result removeDirRecursive(const char *path);
#endif
+25473
View File
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_LANG_HPP
#define _GHOST_ESHOP_LANG_HPP
#include "json.hpp"
#include <string>
namespace Lang {
std::string get(const std::string &key);
void load(const std::string &lang);
};
#endif
File diff suppressed because it is too large Load Diff
+68
View File
@@ -0,0 +1,68 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_QUEUE_SYSTEM_HPP
#define _GHOST_ESHOP_QUEUE_SYSTEM_HPP
#include "json.hpp"
#include <citro2d.h>
#include <deque>
#include <memory>
/*
Extend this, if more statuses are neccessary.
*/
enum class QueueStatus {
None,
Downloading,
Extracting,
Installing,
Failed,
Done
};
class Queue {
public:
Queue(nlohmann::json object, C2D_Image img, std::string name) : obj(object), icn(img), name(name) { };
QueueStatus status = QueueStatus::None;
nlohmann::json obj;
C2D_Image icn;
int total, current;
std::string name = "";
};
/*
Of course also a namespace to that part, so we can do that in a Thread.
*/
namespace QueueSystem {
void QueueHandle(); // Handles the Queue.
void AddToQueue(nlohmann::json obj, C2D_Image icn, std::string name); // Adds to Queue.
void ClearQueue(); // Clears the Queue.
extern LightLock lock;
};
#endif
+39
View File
@@ -0,0 +1,39 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_SCREENSHOT_HPP
#define _GHOST_ESHOP_SCREENSHOT_HPP
#include <citro2d.h>
#include <string>
#include <vector>
namespace Screenshot {
C2D_Image Convert(const std::string &filename);
C2D_Image ConvertFromBuffer(const std::vector<u8> &buffer);
};
#endif
+60
View File
@@ -0,0 +1,60 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_SCRIPT_UTILS_HPP
#define _GHOST_ESHOP_SCRIPT_UTILS_HPP
#include "json.hpp"
#include <3ds.h>
#include <string>
enum ScriptState {
NONE = 0,
FAILED_DOWNLOAD,
SCRIPT_CANCELED,
SYNTAX_ERROR,
COPY_ERROR,
MOVE_ERROR,
DELETE_ERROR
};
namespace ScriptUtils {
bool matchPattern(const std::string &pattern, const std::string &tested);
Result removeFile(const std::string &file, const std::string &message);
void bootTitle(const std::string &TitleID, bool isNAND, const std::string &message);
Result prompt(const std::string &message);
Result copyFile(const std::string &source, const std::string &destination, const std::string &message, bool isARG = false);
Result renameFile(const std::string &oldName, const std::string &newName, const std::string &message);
Result downloadRelease(const std::string &repo, const std::string &file, const std::string &output, bool includePrereleases, const std::string &message, bool isARG = false);
Result downloadFile(const std::string &file, const std::string &output, const std::string &message, bool isARG = false);
void installFile(const std::string &file, bool updatingSelf, const std::string &message, bool isARG = false);
void extractFile(const std::string &file, const std::string &input, const std::string &output, const std::string &message, bool isARG = false);
Result runFunctions(nlohmann::json storeJson, int selection, const std::string &entry);
};
#endif
+47
View File
@@ -0,0 +1,47 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_SOUND_HPP
#define _GHOST_ESHOP_SOUND_HPP
#include <3ds.h>
#include <string>
class Sound {
public:
Sound(const std::string &path, const int channel = 1, const bool toloop = true);
~Sound();
void play();
void stop();
private:
u32 dataSize;
bool good = true;
ndspWaveBuf waveBuf;
u8 *data = nullptr;
int chnl;
};
#endif
+42
View File
@@ -0,0 +1,42 @@
/*
* This file is part of Universal-Updater
* Copyright (C) 2019-2020 Universal-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version.
*/
#ifndef _GHOST_ESHOP_STRING_UTILS_HPP
#define _GHOST_ESHOP_STRING_UTILS_HPP
#include "meta.hpp"
#include <string>
#include <vector>
namespace StringUtils {
std::string lower_case(const std::string &str);
std::string FetchStringsFromVector(const std::vector<std::string> &fetch);
std::string formatBytes(int bytes);
std::string GetMarkString(int marks);
std::vector<std::string> GetMarks(int marks);
};
#endif