commit 6108b4d3d3221e2b4ba2dac5731bb87cfce735ab
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Sat Feb 13 10:31:55 2021 -0700
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Sat Feb 13 10:31:55 2021 -0700
WIP improve pause menu
---
source/p8GlobalLuaFunctions.h | 12 +++++++-----
source/picoluaapi.cpp | 2 +-
source/vm.cpp | 2 ++
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/source/p8GlobalLuaFunctions.h b/source/p8GlobalLuaFunctions.h
index cddfe2e..0cbca4d 100644
--- a/source/p8GlobalLuaFunctions.h
+++ b/source/p8GlobalLuaFunctions.h
@@ -116,7 +116,8 @@ end
__f08_menu_items = {
{"continue", __togglepausemenu},
- {"reset cart", __resetcart}
+ {"reset cart", __resetcart},
+ {"exit to menu", __loadbioscart}
}
__f08_menu_selected = 1
@@ -148,16 +149,17 @@ function __f08_menu_draw()
rectfill(menux, menuy, menux + menuwidth, menuy + menuheight, 0)
rect(menux+1, menuy+1, menux + menuwidth-1, menuy + menuheight-1, 7)
local itemx = menux + 8
- local itemy = menuy + 8
+ local itemy = menuy + 6
local itemidx = 1
for item in all(__f08_menu_items) do
print(item[1], itemx, itemy, 7)
+ --draw selection indicator
if itemidx == __f08_menu_selected then
- line(itemx-8, itemy, itemx-8, itemy+5, 7)
- line(itemx-7, itemy+1, itemx-7, itemy+4, 7)
- pset(itemx-6, itemy+3, 7)
+ line(itemx-5, itemy, itemx-5, itemy+4, 7)
+ line(itemx-4, itemy+1, itemx-4, itemy+3, 7)
+ pset(itemx-3, itemy+2, 7)
end
itemy = itemy + 10
diff --git a/source/picoluaapi.cpp b/source/picoluaapi.cpp
index 31986e4..3b2e9c7 100644
--- a/source/picoluaapi.cpp
+++ b/source/picoluaapi.cpp
@@ -917,7 +917,7 @@ int getbioserror(lua_State *L) {
}
int loadbioscart(lua_State *L) {
- //_vmForLuaApi->LoadBiosCart();
+ _vmForLuaApi->QueueCartChange("__FAKE08-BIOS.p8");
return 0;
}
diff --git a/source/vm.cpp b/source/vm.cpp
index e1ca79d..e1c139f 100644
--- a/source/vm.cpp
+++ b/source/vm.cpp
@@ -305,6 +305,7 @@ bool Vm::loadCart(Cart* cart) {
void Vm::LoadBiosCart(){
CloseCart();
+
Cart *cart = new Cart("__FAKE08-BIOS.p8");
@@ -454,6 +455,7 @@ void Vm::QueueCartChange(std::string filename){
_nextCartKey = filename;
_cartChangeQueued = true;
_pauseMenu = false;
+
}
int Vm::GetTargetFps() {