v2.9.0: MBMNET Shop (eigene App, auf Wunsch installierbar)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nico Meister
2026-10-18 17:46:42 +02:00
co-authored by Claude Opus 5.5
parent d264cd93cd
commit ca77952a9d
16 changed files with 1710 additions and 19 deletions
+43
View File
@@ -0,0 +1,43 @@
#pragma once
#include <3ds/types.h>
#include <stdbool.h>
#include <stddef.h>
#define SHOP_SERVER "mbmnetapi.mbm.wtf:81"
#define SHOP_DIR "sdmc:/3ds/mbmnet-shop"
typedef enum { APP_NEW, APP_INSTALLED, APP_UPDATE } AppStatus;
typedef struct {
char slug[72], title[64], author[44], version[28], category[16], kind[6], file[72], updated[12];
int sheet, icon; // Symbol: Blatt und Nummer darin (-1 = keins)
u32 size, stars;
char *description;
// Installiert (aus SHOP_DIR/installed.txt)
bool installed;
char installedVersion[28];
u64 titleId; // bei CIAs, 0 sonst
} App;
// --- Katalog (läuft im Hintergrund) ---
typedef enum { CAT_IDLE, CAT_LOADING, CAT_READY, CAT_ERROR } CatalogState;
void catalog_start(void);
CatalogState catalog_state(void);
const char *catalog_message(void); // Fortschritt bzw. Fehler
bool catalog_offline(void); // aus dem Zwischenspeicher auf der SD (Server nicht erreichbar)
int catalog_count(void);
App *catalog_app(int i);
int catalog_sheet_count(void);
const char *catalog_sheet_path(int n); // Symbol-Blatt auf der SD (leer, wenn nicht da)
AppStatus app_status(const App *a);
// --- Installieren / Entfernen (läuft im Hintergrund) ---
typedef enum { JOB_IDLE, JOB_RUNNING, JOB_DONE, JOB_FAILED } JobState;
void job_install(App *a);
void job_remove(App *a);
JobState job_state(void);
float job_progress(void); // 0..1, < 0 wenn unbekannt
const char *job_message(void);
void job_acknowledge(void); // Ergebnis gesehen, zurück auf JOB_IDLE
void store_exit(void);