Merge pull request #112 from RibShark/vastfame

Add support for dumping Vast Fame protected GBA carts
This commit is contained in:
Lesserkuma 2024-06-10 12:19:15 +02:00 committed by GitHub
commit 53cf1050b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 390 additions and 290 deletions

View File

@ -807,12 +807,13 @@ class FlashGBX_CLI():
if "flash_type" in header:
print("Selected cartridge type: {:s}\n".format(cart_types[0][header["flash_type"]]))
cart_type = header["flash_type"]
elif header['logo_correct'] and header['3d_memory'] is True:
elif header['logo_correct']:
for i in range(0, len(cart_types[0])):
if "3d_memory" in cart_types[1][i]:
print("Selected cartridge type: {:s}\n".format(cart_types[0][i]))
cart_type = i
break
if ((header['3d_memory'] is True and "3d_memory" in cart_types[1][i]) or
(header['vast_fame'] is True and "vast_fame" in cart_types[1][i])):
print("Selected cartridge type: {:s}\n".format(cart_types[0][i]))
cart_type = i
break
self.CONN.TransferData(args={ 'mode':1, 'path':path, 'mbc':mbc, 'rom_size':rom_size, 'agb_rom_size':rom_size, 'start_addr':0, 'fast_read_mode':True, 'cart_type':cart_type }, signal=self.PROGRESS.SetProgress)
def FlashROM(self, args, header):

View File

@ -2286,11 +2286,12 @@ class FlashGBX_GUI(QtWidgets.QWidget):
self.cmbAGBSaveTypeResult.setCurrentIndex(0)
else:
self.lblAGBGameNameResult.setStyleSheet(self.lblDMGRomTitleResult.styleSheet())
if data['logo_correct'] and data['3d_memory'] is True:
if data['logo_correct']:
cart_types = self.CONN.GetSupportedCartridgesAGB()
for i in range(0, len(cart_types[0])):
if "3d_memory" in cart_types[1][i]:
self.cmbAGBCartridgeTypeResult.setCurrentIndex(i)
if ((data['3d_memory'] is True and "3d_memory" in cart_types[1][i]) or
(data['vast_fame'] is True and "vast_fame" in cart_types[1][i])):
self.cmbAGBCartridgeTypeResult.setCurrentIndex(i)
if data["dacs_8m"] is True:
self.cmbAGBSaveTypeResult.setCurrentIndex(6)

View File

@ -85,6 +85,11 @@ class RomFileAGB:
data["save_type"] = None
data["save_size"] = 0
# Vast Fame (unlicensed protected carts)
data["vast_fame"] = False
if buffer[0x15C:0x16C] == bytearray([ 0xB4, 0x00, 0x9F, 0xE5, 0x99, 0x10, 0xA0, 0xE3, 0x00, 0x10, 0xC0, 0xE5, 0xAC, 0x00, 0x9F, 0xE5 ]): # Initialization code always present in Vast Fame carts
data["vast_fame"] = True
# 8M FLASH DACS
data["dacs_8m"] = False
if (data["game_title"] == "NGC-HIKARU3" and data["game_code"] == "GHTJ" and data["header_checksum"] == 0xB3):
@ -105,7 +110,7 @@ class RomFileAGB:
data["3d_memory"] = False
if data["db"] is not None and "3d" in data["db"]:
data["3d_memory"] = data["db"]["3d"]
return data
def GetDatabaseEntry(self):

View File

@ -9,7 +9,7 @@ from enum import Enum
APPNAME = "FlashGBX"
VERSION_PEP440 = "3.37"
VERSION = "v{:s}".format(VERSION_PEP440)
VERSION_TIMESTAMP = 1709318129
VERSION_TIMESTAMP = 1709318129
DEBUG = False
DEBUG_LOG = []
APP_PATH = ""
@ -734,6 +734,11 @@ def GetDumpReport(di, device):
if "eeprom_data" in di:
s += "* EEPROM area: {:s}\n".format(''.join(format(x, '02X') for x in di["eeprom_data"]))
if di["cart_type"] == "Vast Fame":
s += "\n== Vast Fame Protection Information ==\n"
s += "* Address Reordering: {:s}\n".format(str(di["vf_addr_reorder"]))
s += "* Value Reordering: {:s}\n".format(str(di["vf_value_reorder"]))
if header["db"] is not None and header["db"]["rc"] == di["hash_crc32"]:
db = header["db"]
s += "\n== Database Match ==\n"

View File

@ -0,0 +1,10 @@
{
"type":"AGB",
"names":[
"Vast Fame"
],
"voltage":3.3,
"vast_fame":true,
"command_set":"VASTFAME",
"commands":{}
}

File diff suppressed because it is too large Load Diff