Initial badges work

Additional cleanup probably necessary, some more feature work still in progress (zip files)
This commit is contained in:
2024-05-30 15:45:03 -04:00
parent 8c42a23eeb
commit 4d9cde01c4
11 changed files with 681 additions and 2 deletions

42
include/badges.h Normal file
View File

@@ -0,0 +1,42 @@
/*
* This file is part of Anemone3DS
* Copyright (C) 2016-2024 Contributors in CONTRIBUTORS.md
*
* 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 BADGES_H
#define BADGES_H
#include "common.h"
#include "fs.h"
#include "conversion.h"
#include "unicode.h"
#define MAX_BADGE 1000
#define BADGE_DATA_SIZE 0xF4DF80
#define BADGE_MNG_SIZE 0xD4A8
Result install_badges(void);
Result dump_badge_extdata(void);
#endif

View File

@@ -5,5 +5,6 @@
size_t bin_to_abgr(char ** bufp, size_t size);
size_t png_to_abgr(char ** bufp, size_t size, u32 *height);
int pngToRGB565(char *png_buf, u64 fileSize, u16 *rgb_buf_64x64, u8 *alpha_buf_64x64, u16 *rgb_buf_32x32, u8 *alpha_buf_32x32, bool set_icon);
#endif

View File

@@ -57,6 +57,7 @@ typedef enum InstallType_e {
INSTALL_DUMPING_THEME,
INSTALL_DUMPING_ALL_THEMES,
INSTALL_BADGES,
INSTALL_NONE,
} InstallType;
@@ -86,6 +87,7 @@ typedef enum {
TEXT_INSTALL_DUMPING_THEME,
TEXT_INSTALL_DUMPING_ALL_THEMES,
TEXT_INSTALL_BADGES,
// Other text
TEXT_VERSION,

View File

@@ -28,12 +28,14 @@
#define FS_H
#include "common.h"
#include "badges.h"
#define ILLEGAL_CHARS "><\"?;:/\\+,.|[=]*"
extern FS_Archive ArchiveSD;
extern FS_Archive ArchiveHomeExt;
extern FS_Archive ArchiveThemeExt;
extern FS_Archive ArchiveBadgeExt;
typedef struct {
u32 enable : 1;

View File

@@ -79,6 +79,7 @@ typedef struct {
const char *download_bgm;
const char *dump_single;
const char *dump_all_official;
const char *install_badges;
float start_pos;
const char *shuffle;
} Draw_Strings_s;
@@ -161,6 +162,10 @@ typedef struct {
const char *done;
} Themes_Strings_s;
typedef struct {
const char *extdata_locked;
} Badge_Strings_s;
typedef struct {
Instructions_s normal_instructions[MODE_AMOUNT];
Instructions_s install_instructions;
@@ -175,6 +180,7 @@ typedef struct {
Instructions_s remote_extra_instructions;
Splashes_Strings_s splashes;
Themes_Strings_s themes;
Badge_Strings_s badges;
} Language_s;
typedef enum {