mirror of
https://github.com/lesserkuma/GBA_MultiMenu.git
synced 2026-04-25 15:49:11 -05:00
0.7
This commit is contained in:
parent
cbe17ef7c5
commit
a3c4a44893
|
|
@ -15,7 +15,8 @@ The following section must be edited in order to specify the cartridge type to u
|
||||||
```json
|
```json
|
||||||
"cartridge": {
|
"cartridge": {
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"battery_present": false
|
"battery_present": false,
|
||||||
|
"min_rom_size": 4194304
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
Set `type` to `1` or `2`:
|
Set `type` to `1` or `2`:
|
||||||
|
|
@ -24,6 +25,8 @@ Set `type` to `1` or `2`:
|
||||||
|
|
||||||
Set `battery_present` to `true` or `false`. This will enable enhanced save data handling which will only be functional with a working battery.
|
Set `battery_present` to `true` or `false`. This will enable enhanced save data handling which will only be functional with a working battery.
|
||||||
|
|
||||||
|
Set `min_rom_size` to whatever your cartridge supports as the smallest possible ROM size. Many newer cartridges only support ROMs no smaller than 4 MiB (`4194304`) while some older cartridges can go as low as 512 KiB (`524288`).
|
||||||
|
|
||||||
In the `games` section, you can edit the game-related stuff:
|
In the `games` section, you can edit the game-related stuff:
|
||||||
```json
|
```json
|
||||||
"games": [
|
"games": [
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
import sys, os, glob, json, math, re, struct, hashlib, argparse, datetime
|
import sys, os, glob, json, math, re, struct, hashlib, argparse, datetime
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
app_version = "0.6"
|
app_version = "0.7"
|
||||||
default_file = "LK_MULTIMENU_<CODE>.gba"
|
default_file = "LK_MULTIMENU_<CODE>.gba"
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
|
@ -83,6 +83,7 @@ if not os.path.exists(args.config):
|
||||||
games = []
|
games = []
|
||||||
cartridge_type = 1
|
cartridge_type = 1
|
||||||
battery_present = False
|
battery_present = False
|
||||||
|
min_rom_size = 0x400000
|
||||||
for file in files:
|
for file in files:
|
||||||
d = {
|
d = {
|
||||||
"enabled": True,
|
"enabled": True,
|
||||||
|
|
@ -102,6 +103,7 @@ if not os.path.exists(args.config):
|
||||||
"cartridge": {
|
"cartridge": {
|
||||||
"type": cartridge_type + 1,
|
"type": cartridge_type + 1,
|
||||||
"battery_present": battery_present,
|
"battery_present": battery_present,
|
||||||
|
"min_rom_size": min_rom_size,
|
||||||
},
|
},
|
||||||
"games": games,
|
"games": games,
|
||||||
}
|
}
|
||||||
|
|
@ -124,6 +126,10 @@ else:
|
||||||
games = j["games"]
|
games = j["games"]
|
||||||
cartridge_type = j["cartridge"]["type"] - 1
|
cartridge_type = j["cartridge"]["type"] - 1
|
||||||
battery_present = j["cartridge"]["battery_present"]
|
battery_present = j["cartridge"]["battery_present"]
|
||||||
|
if "min_rom_size" in j["cartridge"]:
|
||||||
|
min_rom_size = j["cartridge"]["min_rom_size"]
|
||||||
|
else:
|
||||||
|
min_rom_size = 0x400000
|
||||||
|
|
||||||
# Prepare compilation
|
# Prepare compilation
|
||||||
flash_size = cartridge_types[cartridge_type]["flash_size"]
|
flash_size = cartridge_types[cartridge_type]["flash_size"]
|
||||||
|
|
@ -176,7 +182,9 @@ for game in games:
|
||||||
with open(f"roms/{game['file']}", "rb") as f:
|
with open(f"roms/{game['file']}", "rb") as f:
|
||||||
buffer = f.read()
|
buffer = f.read()
|
||||||
if b"Batteryless mod by Lesserkuma" in buffer:
|
if b"Batteryless mod by Lesserkuma" in buffer:
|
||||||
size = 0x400000
|
size = max(0x400000, min_rom_size)
|
||||||
|
else:
|
||||||
|
size = max(size, min_rom_size)
|
||||||
game["index"] = index
|
game["index"] = index
|
||||||
game["size"] = size
|
game["size"] = size
|
||||||
if "title_font" in game:
|
if "title_font" in game:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user