Log In  

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.

P#23638 2016-06-25 19:57 ( Edited 2018-04-24 17:45)

1

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
P#23648 2016-06-25 22:52 ( Edited 2016-06-26 03:51)

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

P#23650 2016-06-26 00:08 ( Edited 2016-06-26 04:09)
1

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
P#23651 2016-06-26 00:19 ( Edited 2016-06-26 05:11)

Yeah, but it kinda ruins the fun of PICO-8, especially knowing what carts you run can potentially do to the program.

P#23657 2016-06-26 04:00 ( Edited 2016-06-26 08:00)

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).

P#23675 2016-06-26 13:12 ( Edited 2016-06-26 17:12)

"I think we should be able to disable pause menu if we want to."

https://www.lexaloffle.com/bbs/?tid=3706
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."

P#23688 2016-06-26 16:04 ( Edited 2016-06-26 20:04)

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

P#23698 2016-06-26 18:08 ( Edited 2016-06-26 22:08)

What's weird is that ENDIF is syntax-colored, and it's not a keyword at all. :)

P#23734 2016-06-27 04:23 ( Edited 2016-06-27 08:23)

@le_gars:

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!

Neil

P#43902 2017-09-03 18:46 ( Edited 2017-09-03 22:46)

You can also use:

if btnp(6, 0) then...

to allow the pause button to be pressed at the same time as another button.

P#43999 2017-09-08 03:50 ( Edited 2017-09-08 07:50)

Thanks @le_gars was looking for that memory address all morning!

P#51946 2018-04-24 05:24 ( Edited 2018-04-24 09:24)

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:

http://pico-8.wikia.com/wiki/Memory

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. :)

P#51949 2018-04-24 07:24 ( Edited 2018-04-24 11:24)
1

Wow, this actually saves one of my games that I thought was just stuck because of the pause menu. :D

P#51950 2018-04-24 07:49 ( Edited 2018-04-24 11:49)
4

Here's a little demo which captures the pause button and does something different than the standard menu.

Cart #51952 | 2018-04-24 | Code ▽ | Embed ▽ | No License
4

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.

P#51953 2018-04-24 13:45 ( Edited 2018-04-24 17:46)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-19 02:00:05 | 0.019s | Q:37