diff --git a/pyproject.toml b/pyproject.toml index 9833116bd..3489ec16a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/simulator/assets/maixpy_wonder_mv.png b/simulator/assets/maixpy_wonder_mv.png new file mode 100644 index 000000000..dd02760f8 Binary files /dev/null and b/simulator/assets/maixpy_wonder_mv.png differ diff --git a/simulator/assets/maixpy_wonder_mv_mask.png b/simulator/assets/maixpy_wonder_mv_mask.png new file mode 100644 index 000000000..0b9b1c43f Binary files /dev/null and b/simulator/assets/maixpy_wonder_mv_mask.png differ diff --git a/simulator/kruxsim/devices.py b/simulator/kruxsim/devices.py index 60c0b16f6..cdedc55fc 100644 --- a/simulator/kruxsim/devices.py +++ b/simulator/kruxsim/devices.py @@ -28,6 +28,7 @@ DOCK = "maixpy_dock" YAHBOOM = "maixpy_yahboom" CUBE = "maixpy_cube" +WONDER_MV = "maixpy_wonder_mv" WINDOW_SIZES = { M5STICKV: (320, 640), @@ -36,6 +37,7 @@ DOCK: (440, 820), YAHBOOM: (450, 600), CUBE: (484, 612), + WONDER_MV: (410, 590), } @@ -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"), @@ -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") @@ -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 diff --git a/simulator/simulator.py b/simulator/simulator.py index 92a415b52..2bc221bed 100644 --- a/simulator/simulator.py +++ b/simulator/simulator.py @@ -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" @@ -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