foxygit / fake-08-xbox360 Log in
commit cabbb6714f9fbc6f58af362fcbfdd7dbdfc4bff7
Author:     jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Sat Mar 13 05:45:46 2021 -0700
Commit:     jtothebell <j.to.the.bell@gmail.com>
CommitDate: Sat Mar 13 05:45:46 2021 -0700

    implement pause, reset and shutdown extcmds
---
 source/vm.cpp | 13 +++++++++++--
 source/vm.h   |  2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/source/vm.cpp b/source/vm.cpp
index 71d8aad..1540a4e 100644
--- a/source/vm.cpp
+++ b/source/vm.cpp
@@ -781,6 +781,15 @@ void Vm::vm_run() {
     }
 }

-void Vm::vm_extcmd(const char* cmd){
-
+void Vm::vm_extcmd(std::string cmd){
+    //screenshots, recording, and breadcrumb not supported
+    if (cmd == "reset"){
+        QueueCartChange(CurrentCartFilename());
+    }
+    else if (cmd == "pause") {
+        togglePauseMenu();
+    }
+    else if (cmd == "shutdown") {
+        QueueCartChange("__FAKE08-BIOS.p8");
+    }
 }
diff --git a/source/vm.h b/source/vm.h
index 4c293f3..97da42e 100644
--- a/source/vm.h
+++ b/source/vm.h
@@ -122,6 +122,6 @@ class Vm {

     void vm_flip();
     void vm_run();
-    void vm_extcmd(const char* cmd);
+    void vm_extcmd(string  cmd);
 };