Skip to content

Commit

Permalink
3.29
Browse files Browse the repository at this point in the history
  • Loading branch information
lesserkuma committed May 14, 2023
1 parent de9721b commit fe0221d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions FlashGBX/FlashGBX_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(self, args):
# List devices
self.layout_devices = QtWidgets.QHBoxLayout()
self.lblDevice = QtWidgets.QLabel()
self.lblDevice.mousePressEvent = self.WriteDebugLogOnShiftKey
self.lblDevice.mousePressEvent = self.WriteDebugLog
self.cmbDevice = QtWidgets.QComboBox()
self.cmbDevice.setStyleSheet("QComboBox { border: 0; margin: 0; padding: 0; max-width: 0px; }")
self.layout_devices.addWidget(self.lblDevice)
Expand Down Expand Up @@ -621,7 +621,7 @@ def WriteDebugLogOnShiftKey(self, event=None):
if kbmod == QtCore.Qt.ShiftModifier:
self.WriteDebugLog()

def WriteDebugLog(self):
def WriteDebugLog(self, event=None):
try:
Util.dprint("{:s} version: {:s} ({:d})".format(Util.APPNAME, Util.VERSION_PEP440, Util.VERSION_TIMESTAMP))
Util.dprint("Platform: {:s}".format(platform.platform()))
Expand Down
2 changes: 1 addition & 1 deletion FlashGBX/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
APPNAME = "FlashGBX"
VERSION_PEP440 = "3.29"
VERSION = "v{:s}".format(VERSION_PEP440)
VERSION_TIMESTAMP = 1684078059
VERSION_TIMESTAMP = 1684079394
DEBUG = False
DEBUG_LOG = []
APP_PATH = ""
Expand Down
7 changes: 3 additions & 4 deletions FlashGBX/hw_GBxCartRW.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ def ReadFlashSaveID(self):

def ReadROM(self, address, length, skip_init=False, max_length=64):
num = math.ceil(length / max_length)
#dprint("Reading 0x{:X} bytes from cartridge ROM at 0x{:X} in {:d} iteration(s)".format(length, address, num))
dprint("Reading 0x{:X} bytes from cartridge ROM at 0x{:X} in {:d} iteration(s)".format(length, address, num))
if length > max_length: length = max_length

buffer = bytearray()
Expand All @@ -1103,10 +1103,9 @@ def ReadROM(self, address, length, skip_init=False, max_length=64):
for n in range(0, num):
self._write(self.DEVICE_CMD[command])
temp = self._read(length)
if isinstance(temp, int): temp = bytearray([temp])
if temp is not False and isinstance(temp, int): temp = bytearray([temp])
if temp is False or len(temp) != length:
if Util.DEBUG:
print("{:s}Error while trying to read 0x{:X} bytes from cartridge ROM at 0x{:X} in iteration {:d} of {:d}:{:s}\n{:s}".format(ANSI.RED, length, address, n, num, ANSI.RESET, str(temp)))
dprint("Error while trying to read 0x{:X} bytes from cartridge ROM at 0x{:X} in iteration {:d} of {:d} (response: {:s})".format(length, address, n, num, str(temp)))
return bytearray()
buffer += temp
if self.INFO["action"] in (self.ACTIONS["ROM_READ"], self.ACTIONS["SAVE_READ"], self.ACTIONS["ROM_WRITE_VERIFY"]) and not self.NO_PROG_UPDATE:
Expand Down

0 comments on commit fe0221d

Please sign in to comment.