Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"Doom Launcher","publisher":"MicroPythonOS","short_description":"Legendary 3D shooter","long_description":"Plays Doom 1, 2 and modded .wad files from internal storage or SD card. Place them in /roms/doom/. Uses ducalex's retro-go port of PrBoom. Supports zipped wad files too.","fullname":"com.micropythonos.doom_launcher","version":"0.4.4","category":"game","activities":[{"entrypoint":"doom_launcher.py","classname":"DoomLauncher","intent_filters":[{"action":"main","category":"launcher"}]}]}
{"name":"Doom Launcher","publisher":"MicroPythonOS","short_description":"Legendary 3D shooter","long_description":"Plays Doom 1, 2 and modded .wad files from internal storage or SD card. Place them in /roms/doom/. Uses ducalex's retro-go port of PrBoom. Supports zipped wad files too.","fullname":"com.micropythonos.doom_launcher","version":"0.4.5","category":"game","activities":[{"entrypoint":"doom_launcher.py","classname":"DoomLauncher","intent_filters":[{"action":"main","category":"launcher"}]}]}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ def onCreate(self):
.putExtra("boot_name", "doom")
.putExtra("game_name", "Doom")
.putExtra("file_extensions", (".wad", ".zip"))
.putExtra("skip_crc32", True)
)
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def onCreate(self):
self.boot_name = extras.get("boot_name")
self.game_name = extras.get("game_name", "Game")
self.file_extensions = extras.get("file_extensions", (".wad", ".zip"))
self.skip_crc32 = extras.get("skip_crc32", False)

self.romdir = "roms"
self.romartdir = "romart"
Expand Down Expand Up @@ -291,7 +292,7 @@ def refresh_file_list(self):
gamedir = self.romdir + "/" + self.roms_subdir
fullpath = gamedir + "/" + self.current_subdir + "/" + f if self.current_subdir else gamedir + "/" + f
diskpath = self.bootfile_prefix + fullpath
romart = self._find_romart(diskpath, f) if has_romart else None
romart = self._find_romart(diskpath, f) if (has_romart and not self.skip_crc32) else None
button = self.wadlist.add_button(romart, f)
button.add_event_cb(
lambda e, p=fullpath: self._launch_game(p),
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name": "Duke Nukem 3D", "publisher": "MicroPythonOS", "short_description": "Legendary 3D shooter", "long_description": "Plays Duke Nukem 3D .grp files from internal storage or SD card. Place them in /roms/duke3d/. Uses ducalex's retro-go port. Supports zipped grp files too.", "fullname": "com.micropythonos.duke_launcher", "version": "0.3.4", "category": "game", "activities": [{"entrypoint": "duke_launcher.py", "classname": "DukeLauncher", "intent_filters": [{"action": "main", "category": "launcher"}]}]}
{"name": "Duke Nukem 3D", "publisher": "MicroPythonOS", "short_description": "Legendary 3D shooter", "long_description": "Plays Duke Nukem 3D .grp files from internal storage or SD card. Place them in /roms/duke3d/. Uses ducalex's retro-go port. Supports zipped grp files too.", "fullname": "com.micropythonos.duke_launcher", "version": "0.3.5", "category": "game", "activities": [{"entrypoint": "duke_launcher.py", "classname": "DukeLauncher", "intent_filters": [{"action": "main", "category": "launcher"}]}]}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ def onCreate(self):
.putExtra("boot_name", "duke3d")
.putExtra("game_name", "Duke Nukem 3D")
.putExtra("file_extensions", (".grp", ".zip"))
.putExtra("skip_crc32", True)
.putExtra("starting_text", help_text)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "REPL Shell", "publisher": "MicroPythonOS", "short_description": "Interactive Python REPL shell", "long_description": "Run Python code interactively. Output and errors are displayed inline.", "fullname": "com.micropythonos.repl_shell", "version": "0.1.0", "category": "development", "activities": [{"entrypoint": "repl_shell.py", "classname": "ReplShell", "intent_filters": [{"action": "main", "category": "launcher"}]}]}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from collections import deque

import lvgl as lv
from mpos import Activity, MposKeyboard


class ReplShell(Activity):
def onCreate(self):
self.namespace = {}
self.buffer = deque((), 200)

main = lv.obj()
main.set_flex_flow(lv.FLEX_FLOW.COLUMN)
main.set_style_pad_gap(10, 0)

self.input_area = lv.textarea(main)
self.input_area.set_placeholder_text("Python code...")
self.input_area.set_one_line(True)
self.input_area.set_width(lv.pct(100))
self.input_area.add_event_cb(self._show_keyboard, lv.EVENT.CLICKED, None)

self.keyboard = MposKeyboard(main)
self.keyboard.set_textarea(self.input_area)
self.keyboard.add_event_cb(self._on_submit, lv.EVENT.READY, None)
self.keyboard.add_flag(lv.obj.FLAG.HIDDEN)

self.output = lv.label(main)
self.output.set_text("")
self.output.set_long_mode(lv.label.LONG_MODE.WRAP)
self.output.set_flex_grow(1)

self.setContentView(main)

def _show_keyboard(self, event):
self.keyboard.remove_flag(lv.obj.FLAG.HIDDEN)

def _on_submit(self, event):
self.keyboard.add_flag(lv.obj.FLAG.HIDDEN)
code = self.input_area.get_text()
if not code:
return
self.input_area.set_text("")

self._append(">>> %s" % code)
captured = []

def _print(*args, sep=" ", end="\n"):
captured.append(sep.join(str(a) for a in args) + end)

self.namespace["print"] = _print
error = None
try:
exec(code, self.namespace)
except Exception as e:
error = "!!! %s: %s" % (type(e).__name__, e)
for line in "".join(captured).rstrip("\n").split("\n"):
if line:
self._append(line)
if error:
self._append(error)

def _append(self, line):
self.buffer.append(line)
self.output.set_text("\n".join(self.buffer))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"Retro Core Launcher","publisher":"MicroPythonOS","short_description":"Classic 8-bit and handheld games","long_description":"Plays NES and Gameboy ROMs from storage or SD card. Place in /roms/nes/ or /roms/gb/. Uses retro-go. Zipped ROMs supported.","fullname":"com.micropythonos.retrocore_launcher","version":"0.5.2","category":"game","activities":[{"entrypoint":"retrocore_launcher.py","classname":"RetroCoreLauncher","intent_filters":[{"action":"main","category":"launcher"}]}]}
{"name":"Retro Core Launcher","publisher":"MicroPythonOS","short_description":"Classic 8-bit and handheld games","long_description":"Plays NES and Gameboy ROMs from storage or SD card. Place in /roms/nes/ or /roms/gb/. Uses retro-go. Zipped ROMs supported.","fullname":"com.micropythonos.retrocore_launcher","version":"0.5.3","category":"game","activities":[{"entrypoint":"retrocore_launcher.py","classname":"RetroCoreLauncher","intent_filters":[{"action":"main","category":"launcher"}]}]}
Loading