diff --git a/mymcplusplus/gui/gui.py b/mymcplusplus/gui/gui.py index a7fa531..a7a7ad5 100644 --- a/mymcplusplus/gui/gui.py +++ b/mymcplusplus/gui/gui.py @@ -25,15 +25,18 @@ from pathlib import Path -# Work around a problem with mixing wx and py2exe -if os.name == "nt" and hasattr(sys, "setdefaultencoding"): - sys.setdefaultencoding("mbcs") +# Windows-specific fixes +if os.name == "nt": + # Work around a problem with mixing wx and py2exe + if hasattr(sys, "setdefaultencoding"): + sys.setdefaultencoding("mbcs") + + # Fix DPI awareness + import ctypes + try: ctypes.windll.shcore.SetProcessDpiAwareness(True) + except: pass import wx -import ctypes -try: ctypes.windll.shcore.SetProcessDpiAwareness(True) -except: pass - from .. import ps2mc, ps2iconsys from ..round import * from ..save import ps2save @@ -418,9 +421,9 @@ def evt_cmd_saveas(self, event): else: ecc = True params = (ecc, - ps2mc.PS2MC_STANDARD_PAGE_SIZE, - ps2mc.PS2MC_STANDARD_PAGES_PER_ERASE_BLOCK, - ps2mc.PS2MC_STANDARD_PAGES_PER_CARD + mc.page_size, + mc.pages_per_erase_block, + mc.clusters_per_card * mc.pages_per_cluster ) with open(fn, "w+b") as f: