FlashGBX 4.2__tar.gz → 4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/DataTransfer.py +1 -2
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/FlashGBX.py +1 -1
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/FlashGBX_CLI.py +16 -12
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/FlashGBX_GUI.py +167 -81
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/Flashcart.py +1 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/LK_Device.py +192 -68
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/Mapper.py +42 -3
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/PocketCamera.py +2 -2
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/PocketCameraWindow.py +4 -4
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/RomFileDMG.py +6 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/Util.py +58 -10
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/fw_GBFlash.py +0 -5
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/fw_GBxCartRW_v1_4.py +2 -5
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/fw_JoeyJr.py +15 -7
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/hw_GBFlash.py +15 -6
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/hw_GBxCartRW.py +4 -2
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/Third Party Notices.md +21 -1
- FlashGBX-4.3/FlashGBX/res/config.zip +0 -0
- FlashGBX-4.3/FlashGBX/res/fw_GBFlash.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX.egg-info/PKG-INFO +32 -22
- {FlashGBX-4.2 → FlashGBX-4.3}/PKG-INFO +32 -22
- {FlashGBX-4.2 → FlashGBX-4.3}/README.md +31 -21
- {FlashGBX-4.2 → FlashGBX-4.3}/setup.py +1 -1
- FlashGBX-4.2/FlashGBX/res/config.zip +0 -0
- FlashGBX-4.2/FlashGBX/res/fw_GBFlash.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/GBMemory.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/RomFileAGB.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/UserInputDialog.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/__init__.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/__main__.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/fw_GBxCartRW_v1_3.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/hw_JoeyJr.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/pyside.py +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_GBxCart_RW_Mini_v1_0.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_GBxCart_RW_XMAS_v1_0.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_GBxCart_RW_v1_1_v1_2.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_GBxCart_RW_v1_3.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_GBxCart_RW_v1_4.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_GBxCart_RW_v1_4a.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/fw_JoeyJr.zip +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/icon.ico +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/icon.png +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX/res/pc_frame.png +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX.egg-info/SOURCES.txt +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX.egg-info/dependency_links.txt +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX.egg-info/entry_points.txt +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX.egg-info/requires.txt +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/FlashGBX.egg-info/top_level.txt +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/LICENSE +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/MANIFEST.in +0 -0
- {FlashGBX-4.2 → FlashGBX-4.3}/setup.cfg +0 -0
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import traceback
|
|
6
6
|
from serial import SerialException
|
|
7
7
|
from . import pyside as PySide2
|
|
8
|
-
from . import Util
|
|
9
8
|
from .Util import dprint
|
|
10
9
|
|
|
11
10
|
class DataTransfer(PySide2.QtCore.QThread):
|
|
@@ -54,5 +53,5 @@ class DataTransfer(PySide2.QtCore.QThread):
|
|
|
54
53
|
if error is not None:
|
|
55
54
|
print(tb)
|
|
56
55
|
dprint(tb)
|
|
57
|
-
self.updateProgress.emit({"action":"ABORT", "info_type":"msgbox_critical", "fatal":True, "info_msg":"An unresolvable error has occured. See
|
|
56
|
+
self.updateProgress.emit({"action":"ABORT", "info_type":"msgbox_critical", "fatal":True, "info_msg":"An unresolvable error has occured. See the debug log file for more information. Reconnect the device, restart the software and try again.\n\n{:s}: {:s}".format(type(error).__name__, str(error)), "abortable":False})
|
|
58
57
|
self.FINISHED = True
|
|
@@ -133,7 +133,7 @@ def main(portableMode=False):
|
|
|
133
133
|
ap_cli1.add_argument("path", nargs="?", default="auto", help="target or source file path (optional when reading, required when writing)")
|
|
134
134
|
|
|
135
135
|
ap_cli2 = parser.add_argument_group('optional command line interface arguments')
|
|
136
|
-
ap_cli2.add_argument("--dmg-romsize", choices=["auto", "32kb", "64kb", "128kb", "256kb", "512kb", "1mb", "2mb", "4mb", "8mb", "16mb", "32mb"], type=str.lower, default="auto", help="set size of Game Boy cartridge ROM data")
|
|
136
|
+
ap_cli2.add_argument("--dmg-romsize", choices=["auto", "32kb", "64kb", "128kb", "256kb", "512kb", "1mb", "2mb", "4mb", "8mb", "16mb", "32mb", "64mb", "128mb"], type=str.lower, default="auto", help="set size of Game Boy cartridge ROM data")
|
|
137
137
|
ap_cli2.add_argument("--dmg-mbc", type=str.lower, default="auto", help="set memory bank controller type of Game Boy cartridge")
|
|
138
138
|
ap_cli2.add_argument("--dmg-savesize", choices=["auto", "4k", "16k", "64k", "256k", "512k", "1m", "eeprom2k", "eeprom4k", "tama5", "4m"], type=str.lower, default="auto", help="set size of Game Boy cartridge save data")
|
|
139
139
|
ap_cli2.add_argument("--agb-romsize", choices=["auto", "32kb", "64kb", "128kb", "256kb", "512kb", "1mb", "2mb", "4mb", "8mb", "16mb", "32mb", "64mb", "128mb", "256mb", "512mb"], type=str.lower, default="auto", help="set size of Game Boy Advance cartridge ROM data")
|
|
@@ -624,7 +624,8 @@ class FlashGBX_CLI():
|
|
|
624
624
|
|
|
625
625
|
header = self.CONN.ReadInfo()
|
|
626
626
|
self.ReadCartridge(header)
|
|
627
|
-
|
|
627
|
+
self.CONN._DetectCartridge(args={"limitVoltage":limitVoltage, "checkSaveType":True})
|
|
628
|
+
ret = self.CONN.INFO["detect_cart"]
|
|
628
629
|
(header, _, save_type, save_chip, sram_unstable, cart_types, cart_type_id, cfi_s, _, flash_id, detected_size) = ret
|
|
629
630
|
|
|
630
631
|
# Save Type
|
|
@@ -638,6 +639,8 @@ class FlashGBX_CLI():
|
|
|
638
639
|
supp_cart_types = self.CONN.GetSupportedCartridgesDMG()
|
|
639
640
|
elif self.CONN.GetMode() == "AGB":
|
|
640
641
|
supp_cart_types = self.CONN.GetSupportedCartridgesAGB()
|
|
642
|
+
else:
|
|
643
|
+
raise NotImplementedError
|
|
641
644
|
|
|
642
645
|
if len(cart_types) > 0:
|
|
643
646
|
cart_type = cart_type_id
|
|
@@ -654,6 +657,7 @@ class FlashGBX_CLI():
|
|
|
654
657
|
|
|
655
658
|
# Save Type
|
|
656
659
|
msg_save_type_s = ""
|
|
660
|
+
temp = ""
|
|
657
661
|
if save_chip is not None:
|
|
658
662
|
temp = "{:s} ({:s})".format(Util.AGB_Header_Save_Types[save_type], save_chip)
|
|
659
663
|
else:
|
|
@@ -695,6 +699,7 @@ class FlashGBX_CLI():
|
|
|
695
699
|
else:
|
|
696
700
|
if (len(flash_id.split("\n")) > 2) and ((self.CONN.GetMode() == "DMG") or ("dacs_8m" in header and header["dacs_8m"] is not True)):
|
|
697
701
|
msg_cart_type_s = "Cartridge Type: Unknown flash cartridge."
|
|
702
|
+
try_this = ""
|
|
698
703
|
if ("[ 0/90]" in flash_id):
|
|
699
704
|
try_this = "Generic Flash Cartridge (0/90)"
|
|
700
705
|
elif ("[ AAA/AA]" in flash_id):
|
|
@@ -767,7 +772,7 @@ class FlashGBX_CLI():
|
|
|
767
772
|
print("{:s}Couldn’t determine ROM size, will use 8 MiB. It can also be manually set with the “--dmg-romsize” command line switch.{:s}".format(ANSI.YELLOW, ANSI.RESET))
|
|
768
773
|
rom_size = 8 * 1024 * 1024
|
|
769
774
|
else:
|
|
770
|
-
sizes = [ "auto", "32kb", "64kb", "128kb", "256kb", "512kb", "1mb", "2mb", "4mb", "8mb", "16mb", "32mb" ]
|
|
775
|
+
sizes = [ "auto", "32kb", "64kb", "128kb", "256kb", "512kb", "1mb", "2mb", "4mb", "8mb", "16mb", "32mb", "64mb", "128mb" ]
|
|
771
776
|
rom_size = Util.DMG_Header_ROM_Sizes_Flasher_Map[sizes.index(args.dmg_romsize) - 1]
|
|
772
777
|
|
|
773
778
|
elif self.CONN.GetMode() == "AGB":
|
|
@@ -820,6 +825,9 @@ class FlashGBX_CLI():
|
|
|
820
825
|
carts = self.CONN.GetSupportedCartridgesDMG()[1]
|
|
821
826
|
elif self.CONN.GetMode() == "AGB":
|
|
822
827
|
carts = self.CONN.GetSupportedCartridgesAGB()[1]
|
|
828
|
+
else:
|
|
829
|
+
raise NotImplementedError
|
|
830
|
+
|
|
823
831
|
cart_type = 0
|
|
824
832
|
for i in range(0, len(carts)):
|
|
825
833
|
if not "names" in carts[i]: continue
|
|
@@ -978,6 +986,9 @@ class FlashGBX_CLI():
|
|
|
978
986
|
s_mbc = " using Mapper Type 0x{:X}".format(mbc)
|
|
979
987
|
elif self.CONN.GetMode() == "AGB":
|
|
980
988
|
hdr = RomFileAGB(buffer).GetHeader()
|
|
989
|
+
else:
|
|
990
|
+
raise NotImplementedError
|
|
991
|
+
|
|
981
992
|
if not hdr["logo_correct"] and (self.CONN.GetMode() == "AGB" or (self.CONN.GetMode() == "DMG" and mbc not in (0x203, 0x205))):
|
|
982
993
|
print("{:s}Warning: The ROM file you selected will not boot on actual hardware due to invalid boot logo data.{:s}".format(ANSI.YELLOW, ANSI.RESET))
|
|
983
994
|
bootlogo = None
|
|
@@ -1249,14 +1260,6 @@ class FlashGBX_CLI():
|
|
|
1249
1260
|
print("\n{:s}Done! The writable save data size is {:s} out of {:s} checked.{:s}".format(ANSI.GREEN, Util.formatFileSize(size=found_length), Util.formatFileSize(size=Util.DMG_Header_RAM_Sizes_Flasher_Map[Util.DMG_Header_RAM_Sizes_Map.index(save_type)]), ANSI.RESET))
|
|
1250
1261
|
elif self.CONN.GetMode() == "AGB":
|
|
1251
1262
|
print("\n{:s}Done! The writable save data size using save type “{:s}” is {:s}.{:s}".format(ANSI.GREEN, Util.AGB_Header_Save_Types[save_type], Util.formatFileSize(size=found_length), ANSI.RESET))
|
|
1252
|
-
|
|
1253
|
-
try:
|
|
1254
|
-
(_, _, cfi) = self.CONN.CheckFlashChip(limitVoltage=False)
|
|
1255
|
-
if len(cfi["raw"]) > 0:
|
|
1256
|
-
with open(Util.CONFIG_PATH + "/cfi.bin", "wb") as f: f.write(cfi["raw"])
|
|
1257
|
-
print("CFI data was extracted to “cfi.bin”.")
|
|
1258
|
-
except:
|
|
1259
|
-
pass
|
|
1260
1263
|
|
|
1261
1264
|
def UpdateFirmware_PrintText(self, text, enableUI=False, setProgress=None):
|
|
1262
1265
|
if setProgress is not None:
|
|
@@ -1415,8 +1418,8 @@ class FlashGBX_CLI():
|
|
|
1415
1418
|
with zf.open("fw.ini") as f: ini_file = f.read()
|
|
1416
1419
|
ini_file = ini_file.decode(encoding="utf-8")
|
|
1417
1420
|
self.INI = Util.IniSettings(ini=ini_file, main_section="Firmware")
|
|
1418
|
-
fw_ver = self.INI.GetValue("fw_ver")
|
|
1419
|
-
fw_buildts = self.INI.GetValue("fw_buildts")
|
|
1421
|
+
#fw_ver = self.INI.GetValue("fw_ver")
|
|
1422
|
+
#fw_buildts = self.INI.GetValue("fw_buildts")
|
|
1420
1423
|
|
|
1421
1424
|
print("Select the firmware to install:\n1) Lesserkuma’s FlashGBX firmware\n2) BennVenn’s Drag’n’Drop firmware\n3) BennVenn’s JoeyGUI firmware\n")
|
|
1422
1425
|
answer = input("Enter number 1-3: ").lower().strip()
|
|
@@ -1454,6 +1457,7 @@ class FlashGBX_CLI():
|
|
|
1454
1457
|
FWUPD = FirmwareUpdater(port=port)
|
|
1455
1458
|
file_name = Util.APP_PATH + "/res/fw_JoeyJr.zip"
|
|
1456
1459
|
with zipfile.ZipFile(file_name) as archive:
|
|
1460
|
+
fw_data = None
|
|
1457
1461
|
if fw_choice == 1:
|
|
1458
1462
|
with archive.open("FIRMWARE_LK.JR") as f: fw_data = bytearray(f.read())
|
|
1459
1463
|
elif fw_choice == 2:
|