Skip to content

Commit

Permalink
Use existing memory card params for Save As
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Feb 18, 2024
1 parent 27e77d4 commit fcd9465
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions mymcplusplus/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fcd9465

Please sign in to comment.