In case you didn't notice, 0.1.8 was released yesterday and it (well, the unreleased 0.1.7) adds a new MENUITEM function, which allows us to add new options to the pause menu (and also doesn't have the syntax coloring in the code editor, just saying). This is a very nice addition and I think we should have a bit more control over the pause menu. I think there should be special update and draw functions specifically for when the pause menu is open, and maybe even pause and unpause functions. This idea, oddly enough, comes from the Nintendo Wii, which allows games to do things while the HOME Menu is up. For example, some puzzle or quick-action (WarioWare) games might show a black screen behind the HOME Menu, so you can't see the game, and one game I had actually rendered a moving snow effect over the game in the background of the HOME Menu. I liked this small detail on the Wii, and think some PICO-8 games might benefit from this. For example, maybe a timed game might want to keep the timer running while the game's paused, or a game could say "PAUSED" above the menu, along with the player's score and time. Of course, the pause menu should always render over everything, and the menuitem command (and maybe some others, like BTN) probably shouldn't work while the game is paused. Let me know what you think of my idea down below.
I just found out that pressing a pause button is returned as "64" by btn() and btnp(). Not that it's actually very helpful since it doesn't prevent the pause menu from appearing but at least it allows to do something before pausing. Now if only there was a way to disable the pause menu by poking a value stares @gamax92
There's also little remnants of the old pause function, you can call it with _paused(), but I think it's just some leftover from zep.
EDIT : I think I found the address! poke(0x5f30,1) seems to disable the pause menu, can anyone confirm?
Here's an example :
function _update() if(btnp() == 64)then print("custom menu") poke(0x5f30,1) end end
Yep. That seems to disable the pause menu. zep should really fix these ram issues. Being able to cancel the pause menu seems like a fairly big bug, considering that there's no normal way to disable it normally. Next thing we know, we'll find a way to disable the Esc key...
EDIT: Speaking of, HOW DID YOU FIND THAT ANYWAYS? o_O
Trial and error mostly, we found a hacking hotspot around 0x5F20 ( 0x5F2D : mouse listener , 0x5F2C : graphic modes) so I just poked a couple of addresses around that and found it!
EDIT : And I think we should keep these little hacks, I really like having hidden features like this and if we break something while using them we have no one else to blame than us, I mean, we're changing values into the ram after all, there's tons of ways to break a game when using poke, for instance :
//THIS WILL CHANGE EVERY SINGLE COLOR TO BLACK, USE AT YOUR OWN RISK poke(0x5f2e,1) for i=0x5f10,0x5f1f do poke(i,0) end
I think we should be able to disable pause menu if we want to. For example it would be usable when we want to create our own that looks better then the provided one. This isn't diss on zep, but pause menu is kinda basic in Pico, just black rectangle with red arrow cursor and some text. Being able to disable it and customize would be better, so my vote is to leave the poke alone.
Also I think Pause button should be additional, third (not counting dpad) button on controller. Having it as separate one and one game coder has little control over kinda breaks Pico's philosophy so either we should get rid of pause function at all and having to make our own or get third button (let call it button "P") that we could program to be anything we want it, just like start/select on the NES controller).
"I think we should be able to disable pause menu if we want to."
Apparently zep thinks differently. In regards to the MENUITEM:
"I opted to keep this simple and quite rigid, so there's no way to have extra stuff going on in the background while the cart is paused, or to re-appropriate the pause button as an in-game button."
I know you can you use the console to reboot the game, but I like the idea of a system-defined menu that lets you get out of a badly coded game.
Also, speaking of syntax coloring, I don't think that "in" or "all" are pink'd in the editor ... I think they're default Lua keywords
Thanks for this tip - I'm working on a game where the animation is synced to the music, and when the game is paused it would go slightly out of sync. This has helped me detect the pause state and edit my sync code so it works!
Wow, I'm glad this resurfaced.
It prompted me to add the poke() trick for suppressing the pause menu to the pico-8 wiki, and then to look for other stuff people had uncovered that hadn't been added to the wiki yet. I found about half a dozen new gems to add to the hoard.
You can check out the current documentation of PICO-8's memory map here:
I think dddaaannn's done a great job getting the wiki set up, and I've been doing what I can to add more, so always keep it in mind when you're wondering how stuff works, folks. :)
Here's a little demo which captures the pause button and does something different than the standard menu.
Does anyone know if it's possible to replicate the functionality of the system pause menu such as favoriting a cart, exiting to SPLORE, or resetting the cart?
Alternatively, you could imagine an option in the custom pause menu which allows bringing up the system pause via X or O. Not sure if that's possible. You could just not block the system pause menu once your custom pause menu is up.
[Please log in to post a comment]