mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-26 08:16:02 -04:00
parent
ec0f45a488
commit
4740df2e2c
3 changed files with 89 additions and 2 deletions
|
@ -248,6 +248,9 @@ static void cmd_screenframe(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
auto evtd = getEventDispatcherInstance();
|
||||
evtd->enter_shell_working_mode();
|
||||
|
||||
for (int i = 0; i < ui::screen_height; i++) {
|
||||
std::array<ui::ColorRGB888, ui::screen_width> row;
|
||||
portapack::display.read_pixels({0, i, ui::screen_width, 1}, row);
|
||||
|
@ -258,6 +261,9 @@ static void cmd_screenframe(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
}
|
||||
chprintf(chp, "\r\n");
|
||||
}
|
||||
|
||||
evtd->exit_shell_working_mode();
|
||||
|
||||
chprintf(chp, "ok\r\n");
|
||||
}
|
||||
|
||||
|
@ -275,6 +281,9 @@ static void cmd_screenframeshort(BaseSequentialStream* chp, int argc, char* argv
|
|||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
auto evtd = getEventDispatcherInstance();
|
||||
evtd->enter_shell_working_mode();
|
||||
|
||||
for (int y = 0; y < ui::screen_height; y++) {
|
||||
std::array<ui::ColorRGB888, ui::screen_width> row;
|
||||
portapack::display.read_pixels({0, y, ui::screen_width, 1}, row);
|
||||
|
@ -288,8 +297,10 @@ static void cmd_screenframeshort(BaseSequentialStream* chp, int argc, char* argv
|
|||
chprintf(chp, "\r\n");
|
||||
}
|
||||
|
||||
evtd->exit_shell_working_mode();
|
||||
chprintf(chp, "ok\r\n");
|
||||
}
|
||||
|
||||
static void cmd_write_memory(BaseSequentialStream* chp, int argc, char* argv[]) {
|
||||
if (argc != 2) {
|
||||
chprintf(chp, "usage: write_memory <address> <value (1 or 4 bytes)>\r\n");
|
||||
|
@ -344,6 +355,11 @@ static void cmd_button(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
|
||||
control::debug::inject_switch(button);
|
||||
|
||||
// Wait two frame syncs to ensure action has painted
|
||||
auto evtd = getEventDispatcherInstance();
|
||||
evtd->wait_finish_frame();
|
||||
evtd->wait_finish_frame();
|
||||
|
||||
chprintf(chp, "ok\r\n");
|
||||
}
|
||||
|
||||
|
@ -366,6 +382,11 @@ static void cmd_touch(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
}
|
||||
evtd->emulateTouch({{x, y}, ui::TouchEvent::Type::Start});
|
||||
evtd->emulateTouch({{x, y}, ui::TouchEvent::Type::End});
|
||||
|
||||
// Wait two frame syncs to ensure action has painted
|
||||
evtd->wait_finish_frame();
|
||||
evtd->wait_finish_frame();
|
||||
|
||||
chprintf(chp, "ok\r\n");
|
||||
}
|
||||
|
||||
|
@ -404,6 +425,10 @@ static void cmd_keyboard(BaseSequentialStream* chp, int argc, char* argv[]) {
|
|||
evtd->emulateKeyboard(chr);
|
||||
}
|
||||
|
||||
// Wait two frame syncs to ensure action has painted
|
||||
evtd->wait_finish_frame();
|
||||
evtd->wait_finish_frame();
|
||||
|
||||
chprintf(chp, "ok\r\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue