Skip to content

Commit fa44804

Browse files
Move NES and GameBoy launcher to Retro Core Launcher
1 parent 5f1c4f1 commit fa44804

9 files changed

Lines changed: 81 additions & 79 deletions

File tree

internal_filesystem/apps/com.micropythonos.gameboy_launcher/META-INF/MANIFEST.JSON

Lines changed: 0 additions & 23 deletions
This file was deleted.

internal_filesystem/apps/com.micropythonos.gameboy_launcher/assets/gb_launcher.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

internal_filesystem/apps/com.micropythonos.nes_launcher/META-INF/MANIFEST.JSON

Lines changed: 0 additions & 23 deletions
This file was deleted.

internal_filesystem/apps/com.micropythonos.nes_launcher/assets/nes_launcher.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

internal_filesystem/apps/com.micropythonos.nes_launcher/assets/retrogo_launcher.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Retro Core Launcher",
3+
"publisher": "MicroPythonOS",
4+
"short_description": "Classic 8-bit and handheld games",
5+
"long_description": "Plays NES ROMs (.nes, .fc, .fds, .nsf) and Gameboy ROMs (.gb, .gbc) from internal storage or SD card. Place them in /roms/nes/ or /roms/gb/. Uses ducalex's retro-go port. Supports zipped ROMs too.",
6+
"icon_url": "https://apps.micropythonos.com/apps/com.micropythonos.retrocore_launcher/icons/com.micropythonos.retrocore_launcher_0.1.0_64x64.png",
7+
"download_url": "https://apps.micropythonos.com/apps/com.micropythonos.retrocore_launcher/mpks/com.micropythonos.retrocore_launcher_0.1.0.mpk",
8+
"fullname": "com.micropythonos.retrocore_launcher",
9+
"version": "0.1.0",
10+
"category": "games",
11+
"activities": [
12+
{
13+
"entrypoint": "assets/retrocore_launcher.py",
14+
"classname": "RetroCoreLauncher",
15+
"intent_filters": [
16+
{
17+
"action": "main",
18+
"category": "launcher"
19+
}
20+
]
21+
}
22+
]
23+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
from mpos import Activity, Intent
2+
from retrogo_launcher import RetroGoLauncher
3+
import lvgl as lv
4+
5+
6+
class RetroCoreLauncher(Activity):
7+
def onCreate(self):
8+
screen = lv.obj()
9+
screen.set_style_pad_all(15, lv.PART.MAIN)
10+
11+
title_label = lv.label(screen)
12+
title_label.set_text("Choose your console:")
13+
title_label.align(lv.ALIGN.TOP_LEFT, 0, 0)
14+
15+
button_list = lv.list(screen)
16+
button_list.set_size(lv.pct(100), lv.pct(70))
17+
button_list.center()
18+
19+
nes_btn = button_list.add_button(
20+
None, "NES"
21+
)
22+
nes_btn.add_event_cb(
23+
lambda e: self.launch_retrogo(
24+
"nes",
25+
"NES",
26+
"Choose your NES ROM:",
27+
(".nes", ".fc", ".fds", ".nsf", ".zip"),
28+
),
29+
lv.EVENT.CLICKED,
30+
None,
31+
)
32+
33+
gb_btn = button_list.add_button(
34+
None, "Gameboy"
35+
)
36+
gb_btn.add_event_cb(
37+
lambda e: self.launch_retrogo(
38+
"gb",
39+
"GB",
40+
"Choose your Gameboy ROM:",
41+
(".gb", ".gbc", ".zip"),
42+
),
43+
lv.EVENT.CLICKED,
44+
None,
45+
)
46+
47+
self.setContentView(screen)
48+
49+
def launch_retrogo(self, roms_subdir, game_name, title, file_extensions):
50+
self.startActivity(
51+
Intent(activity_class=RetroGoLauncher)
52+
.putExtra("title", title)
53+
.putExtra("roms_subdir", roms_subdir)
54+
.putExtra("partition_label", "retro-core")
55+
.putExtra("boot_name", roms_subdir)
56+
.putExtra("game_name", game_name)
57+
.putExtra("file_extensions", file_extensions)
58+
)

internal_filesystem/apps/com.micropythonos.gameboy_launcher/assets/retrogo_launcher.py renamed to internal_filesystem/apps/com.micropythonos.retrocore_launcher/assets/retrogo_launcher.py

File renamed without changes.
179 Bytes
Loading

0 commit comments

Comments
 (0)