Skip to content

Commit

Permalink
Merge branch 'develop' into pin_and_anti_tamper
Browse files Browse the repository at this point in the history
  • Loading branch information
odudex committed Oct 25, 2024
2 parents ecf9342 + 754e65c commit 2fbe698
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ simulator-m5stickv = "python simulator/simulator.py --device maixpy_m5stickv"
simulator-dock = "python simulator/simulator.py --device maixpy_dock"
simulator-yahboom = "python simulator/simulator.py --device maixpy_yahboom"
simulator-cube = "python simulator/simulator.py --device maixpy_cube"
simulator-wonder-mv = "python simulator/simulator.py --device maixpy_wonder_mv"
# aliases
simulator.ref = "simulator-amigo"
simulator-m5.ref = "simulator-m5stickv"
Expand Down
Binary file added simulator/assets/maixpy_wonder_mv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added simulator/assets/maixpy_wonder_mv_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions simulator/kruxsim/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
DOCK = "maixpy_dock"
YAHBOOM = "maixpy_yahboom"
CUBE = "maixpy_cube"
WONDER_MV = "maixpy_wonder_mv"

WINDOW_SIZES = {
M5STICKV: (320, 640),
Expand All @@ -36,6 +37,7 @@
DOCK: (440, 820),
YAHBOOM: (450, 600),
CUBE: (484, 612),
WONDER_MV: (410, 590),
}


Expand Down Expand Up @@ -63,7 +65,7 @@ def load_image(device):
def load_font(device):
device = with_prefix(device)
if device not in fonts:
if device == M5STICKV or device == CUBE:
if device in (M5STICKV, CUBE):
fonts[device] = [
pg.freetype.Font(
os.path.join("..", "firmware", "font", "ter-u14n.bdf"),
Expand All @@ -72,7 +74,7 @@ def load_font(device):
os.path.join("..", "firmware", "font", "FusionPixel-14.bdf"),
),
]
elif device == DOCK or device == YAHBOOM:
elif device in (DOCK, YAHBOOM, WONDER_MV):
fonts[device] = [
pg.freetype.Font(
os.path.join("..", "firmware", "font", "ter-u16n.bdf")
Expand Down Expand Up @@ -135,4 +137,12 @@ def screenshot_rect(device):
screen.get_rect().center[0] + 1,
screen.get_rect().center[1] - 13,
)
elif device == WONDER_MV:
# Todo: Adjust the rect for the Wonder MV device
rect.width -= 134
rect.height -= 155
rect.center = (
screen.get_rect().center[0],
screen.get_rect().center[1] + 29,
)
return rect
6 changes: 6 additions & 0 deletions simulator/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def run_krux():
DOCK_SIZE = (151, 258)
YAHBOOM_SIZE = (156,220)
CUBE_SIZE = (200,212)
WONDER_MV_SIZE = (156, 220)

# Handle screenshots scale and alpha bg
# When exporting the mask from GIMP uncheck "Save info about transparent pixels color"
Expand Down Expand Up @@ -180,6 +181,11 @@ def run_krux():
mask_img = pg.image.load(
os.path.join("assets", "maixpy_cube_mask.png")
).convert_alpha()
elif (args.device == devices.WONDER_MV):
device_screenshot_size = WONDER_MV_SIZE
mask_img = pg.image.load(
os.path.join("assets", "maixpy_wonder_mv_mask.png")
).convert_alpha()

# Handle screenshots filename suffix when scaled
from krux.krux_settings import Settings
Expand Down

0 comments on commit 2fbe698

Please sign in to comment.