Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CarteSD/games/DinoBlaster/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 320,
"title_h": 240,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 3
}
3 changes: 2 additions & 1 deletion CarteSD/games/DinoInvaders/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 320,
"title_h": 240,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 30
}
3 changes: 2 additions & 1 deletion CarteSD/games/DinoLife/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 320,
"title_h": 240,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 3
}
3 changes: 2 additions & 1 deletion CarteSD/games/FlappyPtera/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 320,
"title_h": 240,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 30
}
3 changes: 2 additions & 1 deletion CarteSD/games/JurassicBrickBreaker/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 320,
"title_h": 240,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 3
}
3 changes: 2 additions & 1 deletion CarteSD/games/ParaRunner/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"title_w": 0,
"title_h": 0,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 3
}
20 changes: 0 additions & 20 deletions CarteSD/games/PokemonBleu_GB/README.txt

This file was deleted.

6 changes: 0 additions & 6 deletions CarteSD/games/PokemonBleu_GB/boot.json

This file was deleted.

Binary file removed CarteSD/games/PokemonBleu_GB/gb_emulator.bin
Binary file not shown.
Binary file removed CarteSD/games/PokemonBleu_GB/icon.raw
Binary file not shown.
16 changes: 0 additions & 16 deletions CarteSD/games/PokemonBleu_GB/meta.json

This file was deleted.

Empty file.
Binary file removed CarteSD/games/PokemonBleu_GB/roms/PokemonBleu.gb
Binary file not shown.
Binary file removed CarteSD/games/PokemonBleu_GB/title.raw
Binary file not shown.
3 changes: 2 additions & 1 deletion CarteSD/games/RaptorSDKTestLab/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 320,
"title_h": 240,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 1
}
3 changes: 2 additions & 1 deletion CarteSD/games/WiFiTouchConsole/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"title_w": 0,
"title_h": 0,
"bin": "game.bin",
"save": "sauv.json"
"save": "sauv.json",
"index": 2
}
47 changes: 25 additions & 22 deletions CarteSD/games/index.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
{
"version": 1,
"description": "Index manuel des jeux (ordre de menu recommande via indice).",
"description": "Index manuel des jeux (ordre de menu recommande via index/indice).",
"entries": [
{
"indice": 3,
"folder": "DinoLife",
"meta": "DinoLife/meta.json"
"index": 1,
"indice": 1,
"folder": "RaptorSDKTestLab",
"meta": "RaptorSDKTestLab/meta.json"
},
{
"index": 2,
"indice": 2,
"folder": "WiFiTouchConsole",
"meta": "WiFiTouchConsole/meta.json"
},
{
"index": 3,
"indice": 3,
"folder": "DinoBlaster",
"meta": "DinoBlaster/meta.json"
},
{
"indice": 30,
"folder": "DinoInvaders",
"meta": "DinoInvaders/meta.json"
},
{
"indice": 30,
"folder": "FlappyPtera",
"meta": "FlappyPtera/meta.json"
"index": 3,
"indice": 3,
"folder": "DinoLife",
"meta": "DinoLife/meta.json"
},
{
"index": 3,
"indice": 3,
"folder": "JurassicBrickBreaker",
"meta": "JurassicBrickBreaker/meta.json"
},
{
"index": 3,
"indice": 3,
"folder": "ParaRunner",
"meta": "ParaRunner/meta.json"
},
{
"index": 30,
"indice": 30,
"folder": "PokemonBleu_GB",
"meta": "PokemonBleu_GB/meta.json"
},
{
"indice": 1,
"folder": "RaptorSDKTestLab",
"meta": "RaptorSDKTestLab/meta.json"
"folder": "DinoInvaders",
"meta": "DinoInvaders/meta.json"
},
{
"indice": 2,
"folder": "WiFiTouchConsole",
"meta": "WiFiTouchConsole/meta.json"
"index": 30,
"indice": 30,
"folder": "FlappyPtera",
"meta": "FlappyPtera/meta.json"
}
]
}
20 changes: 0 additions & 20 deletions RaptorLauncher_V4/launcher_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "led_manager.h"
#include "mcp23017_manager.h"
#include "game_boot_manager.h"
#include "gb_launch_config.h"
#include "config.h"
#include "types.h"

Expand Down Expand Up @@ -455,25 +454,6 @@ static void launchGameFromIndex(int index) {
const GameInfo& game = gameList[index];
showGameTitleScreen(game);

if (game.type == "emulationGB") {
if (game.rom.length() == 0) {
Serial.println("[GB] rom manquante dans meta.json");
gSaveStatusText = "ROM manquante";
currentScreen = SCREEN_HOME;
gNeedsRedraw = true;
return;
}

String romPath = resolveGamePath(game, game.rom);
if (!gbLaunchSavePendingRom(romPath, game.name)) {
Serial.println("[GB] impossible d'ecrire .gb_launch.json");
gSaveStatusText = "Config GB KO";
currentScreen = SCREEN_HOME;
gNeedsRedraw = true;
return;
}
}

String binPath = resolveGamePath(game, game.bin);
bool ok = gameBootLaunchFromPath(binPath);
if (!ok) {
Expand Down
23 changes: 17 additions & 6 deletions RaptorLauncher_V4/storage_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <SPI.h>
#include <SD.h>
#include <ArduinoJson.h>
#include <algorithm>
#include <cctype>
#include "storage_manager.h"

#define SD_CS 5
Expand Down Expand Up @@ -71,7 +73,7 @@ std::vector<GameInfo> storageListGames() {

game.bin = "game.bin";
game.save = "sauv.json";
game.rom = "";
game.index = 30;

String metaPath = "/games" + folderName + "/meta.json";

Expand Down Expand Up @@ -111,7 +113,7 @@ std::vector<GameInfo> storageListGames() {

game.bin = doc["bin"] | "game.bin";
game.save = doc["save"] | "sauv.json";
game.rom = doc["rom"] | "";
game.index = doc["index"] | (doc["indice"] | 30);

Serial.print("[JSON] name = ");
Serial.println(game.name);
Expand Down Expand Up @@ -139,10 +141,8 @@ std::vector<GameInfo> storageListGames() {

Serial.print("[JSON] save = ");
Serial.println(game.save);
if (game.rom.length() > 0) {
Serial.print("[JSON] rom = ");
Serial.println(game.rom);
}
Serial.print("[JSON] index = ");
Serial.println(game.index);
}
} else {
Serial.println("[SD] meta.json absent ou impossible a ouvrir");
Expand All @@ -155,5 +155,16 @@ std::vector<GameInfo> storageListGames() {
}

root.close();

std::sort(list.begin(), list.end(), [](const GameInfo& a, const GameInfo& b) {
if (a.index != b.index) return a.index < b.index;

String an = a.name;
String bn = b.name;
an.toLowerCase();
bn.toLowerCase();
return an < bn;
});

return list;
}
2 changes: 1 addition & 1 deletion RaptorLauncher_V4/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ struct GameInfo {

String bin;
String save;
String rom;
int index;
};