Jump to content



Photo
- - - - -

Pause in vpinmame


  • Please log in to reply
14 replies to this topic

#1 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 12 February 2013 - 04:52 PM

This is third time i'm writing this post. Every time i tried something happened. But at least something good came out of this cause now i know pretty close where the bug lies.
 
So few days ago i was setting replay levels for "El bueno, el feyo y el malo" (that's one table) and "el dorado" (another table - same rom). I did it in vpinmame setup utility which has test button and you can setup all your roms fast there. Only setup key is sometimes 7 sometimes 8 (for gottliebs setup key is always 7 in tables). So i started to look around why is setup sometimes on key 8, and couldn't find any readable config or ini or ctrlr file in pinmame dir but i found that vpinmame has tab menu for keys just like mame and there i found that p is pause key for pinmame.
 
Seeing this I remembered that there is a problem with fplaunch exit menu - when you open menu vp game will stop - but dmd will continue to run. So i thought great maybe i can send p to dmd window and pinmame will also stop while we are in exit menu in fplaunch.
 
So i go to some dmd game and put vp to window mode so that i can see vp and vpinmame on screen (one screen comp), and i test it. And really as soon as vp loses focus ball stops, but pinmame runs. Then i click on dmd to set focus and press p and voila - all animations stopped.
 
So this could be used to stop vpinmame in exit menu.
 
But then i continue to test this a bit more - what if table is uvp?
I opened uvp table in window (table is in window, uvp is full screen behind). As soon as vp loses focus (click on taskbar, or alt-tab) uvp stops, no numbers going around, same numbers stay. As soon as i click table uvp runs again.
 
So uvp is stopped with loss of focus on vp but vpinmame is not. Don't know about b2s and directb2s. Didn't test it.
 
Next test Esc key - when i play table and press Esc key - table is paused with grey vp pause dialog box - UVP is stopped also but vpinmame keeps running on non dmd games.
 
Another test - what if i close vp editor while grey pause window is on?
 
UVP table will crash, vpinmame table (dmd without uvp) - will exit clean.
 
So my conclusion is this - on close vp tries to save nvram. If pause is on - uvp pinmame is paused. Paused pinmame can't save nvram - it should be unpaused first. So it crashes. Normal pinmame is not paused so it will exit cleanly without crash and save nvram with all changes and last hiscore.
 
So what are the bugs here:
First bug is uvp crash - uvp should not crash because we closed editor - it should exit cleanly and save nvram - so it should unpause pinmame first and then save scores and exit.
Second bug is - on esc vpinmame should make pause also - this means that we will get crash bug on close so unpause will also be needed if we close editor while pause is on.
And third bug - same as above - on loss of focus when vp stops, vpinmame should stop also - and again if editor is closed while vp is not in focus unpause should be done on vpinmame so that it exits cleanly.
 
What do you think?

Edited by blur, 12 February 2013 - 04:55 PM.


#2 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 13 February 2013 - 12:38 PM

Here are some news.

I looked into some tables and found that code:

    Sub Table1_Paused:Controller.Pause = 1:End Sub

    Sub Table1_unPaused:Controller.Pause = 0:End Sub
stops the controller while you are in pause on any table dmd, uvp or db2s. If pinmame is not stopped that's because there is no table1_paused routine.
However if dmd table has this pause implemented it will also crash if you close vp editor while in pause.
But it helps to add this:
Sub Table1_Exit()
    Controller.Pause = 0
    Controller.Stop
End Sub

With this there is no crashing on exit.

Adding same code to UVP tables doesn't help - they still crash on exit - so there is some bug somewhere.

UVP tables are the only ones that stop pinmame on loss of focus.

I tested some directb2s tables - they also crash on exit, and adding table1_exit doesn't help, but they don't stop on loss of focus.


Edited by blur, 13 February 2013 - 12:56 PM.


#3 maceman

maceman

    Home Pinball Machine Collector/ Restorer

  • VIP
  • 2,271 posts
  • Location:Canada, Eh!

  • Flag: Canada

  • Favorite Pinball: ....**Haunted House**....



Posted 13 February 2013 - 03:45 PM

Interesting!!

 

I am happy to be  a gunea pig for any testing on my cab if you figure anything out further :)

 

On the latest FPlaunch i am using, i am still having issues with exiting FP, and some UVP. I think my B2S's are working.

 

Problem is that some UVP's close , some do not everytime and hang.

 

Blur, what do you mean by "Paused". Do you mean if WE Pause it using the menu, it will crash, or is it something it does itself upon exit. I don't understand the pause part.... When i exit, i normally just hold down for a couple seconds till the 3,2,1  shows and then i let go and it will exit to Main HP, but sometimes focus is lost, sometime focus is okay.

 

Cheers,

Maceman

 

EDIT:  I should mention that my system is still using the esc key because i have never yet been able to change it. I can change in VP, but never able to change in the ipac2 application so gave up. I tried several times and it doesn't like me :)


Edited by maceman, 13 February 2013 - 03:46 PM.

________________________________________________________________________________
Canada Eh!
hm_avatar.pngss_avatar.jpg MODS ys_avatar5.jpggenie_avatar.pngj2o_avatar.png

#4 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,338 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 13 February 2013 - 04:54 PM

If you have "vpminit me" in table_init it adds those lines for your automatically.

The routine for pausing is in core.vbs

 

Of course you can pause the DMD any time you like by clicking the dmd windows and pressing P (for pause) at which point the DMD will go dim to indicate it is paused, and press P again to unpause.  That is the basic MAME implementation.


Build a fire, vipers love the heat.


#5 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 14 February 2013 - 10:26 AM

On the latest FPlaunch i am using, i am still having issues with exiting FP, and some UVP. I think my B2S's are working.

Problem is that some UVP's close , some do not everytime and hang.

Blur, what do you mean by "Paused". Do you mean if WE Pause it using the menu, it will crash, or is it something it does itself upon exit. I don't understand the pause part.... When i exit, i normally just hold down for a couple seconds till the 3,2,1  shows and then i let go and it will exit to Main HP, but sometimes focus is lost, sometime focus is okay.

EDIT:  I should mention that my system is still using the esc key because i have never yet been able to change it. I can change in VP, but never able to change in the ipac2 application so gave up. I tried several times and it doesn't like me :)

Yup, you are having hangups because uvp table hangs up when it gets esc (which opens pause dialog box) and then you close vp editor. It's VP-UVP bug, you can't solve it from fplunch, except by not using Esc key. Also i can't send keys to close this dialog box cause some people have it, some don't - if i would send r (resume game) key anyway - some tables would open rules.

 

About this pause screen - i don't mean MY blue pause screen or exit menu - i mean grey vp dialog box that comes up only when you press Esc with "resume game" "debug window" and "quit to editor" buttons.


Edited by blur, 14 February 2013 - 10:31 AM.


#6 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 14 February 2013 - 10:39 AM

If you have "vpminit me" in table_init it adds those lines for your automatically.

The routine for pausing is in core.vbs

 

Of course you can pause the DMD any time you like by clicking the dmd windows and pressing P (for pause) at which point the DMD will go dim to indicate it is paused, and press P again to unpause.  That is the basic MAME implementation.

Yup vpinit me does the same thing, tnx for info. Didn't know that vpinit me does nothing else but creating table_paused and table_unpaused routines. Makes more sense now. Before i thought - f.. me what fu...ing init me? :)

Also pressing p on mame window is normal mame functionality but it doesn't solve these bugs - if table is launched and then it loses focus - it pauses the ball - so it should also pause vpinmame display. I can patch it from fplaunch - but that's basically vp bug.

Also I can send p to pinmame - but i can't send p to directB2S backglass which will soon replace all UVP and pinmame games -  so there will be no way to fix it from fplaunch.

And also crashing of uvp and b2s games when paused is also a bug - not really important cause you can avoid it by not using Esc - but still a bug.

It would be easier if esc is configurable so that you can put some other key for vp grey pause menu - but no - Esc is hardcoded and there's no way to change it even with koadic's additions - koadic - here is another idea - make Esc configurable in keys window?


Edited by blur, 14 February 2013 - 10:47 AM.


#7 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 14 February 2013 - 02:29 PM

It would be easier if esc is configurable so that you can put some other key for vp grey pause menu - but no - Esc is hardcoded and there's no way to change it even with koadic's additions - koadic - here is another idea - make Esc configurable in keys window?
 

I think that can be done, as I already set it up to use a gamepad button to pull up that menu (under Exit Game) when I altered it for that Nanotech "button 8" exit issue, I just guess that the keyboard key isn't doing the same thing I set the gamepad button up to do. I should be able to dig into it and set the 'Exit Game' key to perform the same function as the Esc key, as that is already configurable, but the Esc key will still be active... it won't kill the Esc key funtionality, just add it to another user defined key.

#8 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 14 February 2013 - 03:10 PM

Yup this Esc key is not the same as Exit key in keys config which is by default Q (which does nothing) and button 8 - which exits after you hold it for 3 seconds.

 

But since that Exit key (Q) really does nothing and nobody needs it - you can maybe connect it with this Esc key which is more like pause key - since it only brings pause.

Or you can introduce Pause key in config, whatever is easier - since q really doesn't do anything i think you can safely try to hijack it.

 

But changing this either new pause key or existing exit key - should make Esc do nothing - that's the point of this change.

Of course - in all dialog boxes - esc should work as before - closing it (althought Esc doesn't close every dialog box) - just while you play vp game Esc key should be removed or configurable.

 

 

Being able to remove Esc key from VP would be a major breakthrough for people that can't reprogram their ipac's.

Esc would still close old B2S style backglasses and fp tables - but new directb2s is on the way - all tables can be converted - and nobody uses fp anyway :) - just kidding of course - let's just say it will help a lot.

 

 

Do you maybe know is there any way to detect loss of focus in vp, and do something on that event?


Edited by blur, 14 February 2013 - 03:19 PM.


#9 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 15 February 2013 - 11:58 AM

Alright, let me know what you think of this...
 
keys-setup_t.png

It seems the "Exit" key does actually do something... if you are in the Pause menu and hit it, it will quit the table, useful for killing the table via gamepad if no keyboard is connected. Regardless, I am hesitant to remove this outright, so I am going to add a dedicated pause key which will do what the ESC currently does and the ability to turn off the ESC key for visual pinball, and revert the exit/quit key to it's intended function for the gamepad controls. This will effect current setups using the Exit key to bring up the pause menu with a gamepad, and the function will be moved to the Pause key.

I also hope to implement a couple user defined keys that will be able to be used for some custom keymapping for gamepads while running visual pinball. As I have it planned, you will define a key you want to be pressed and when the associated gamepad button is pressed, that defined key is sent to vp. It won't perform any functions on it's own, but can be useful for custom buttons in table scripts and such.

This is along with a few other changes I plan on making like removing the Nudge Force as I have yet to determine if this actually has any effect on anything, as well as removing the table options from the editor interface that are now in the Keys menu, like enabling the accelerometer, mounting orientation, mount rotation, gain settings, and dead zone, in addition to removing jolt amount/trigger time and tilt amount/trigger time as I also can't determine if these actually have any effect on anything anyway.

#10 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 15 February 2013 - 12:37 PM

great, that's it

so Pause key is replacement key for Esc but it can't be Esc

and enabling/disabling Esc key is done on checkbox

 

as for using Quit key in pause menu - it doesn't work - q is there because it is first letter in quit to editor - it is hardcoded and doesn't change if you change quit key - tested with keyboard, didn't try joystick buttons. And it will quit to editor - it will not close vp. So we are still looking what that key really does :)

 

 

Is there a way for VP to find out that focus is lost?


Edited by blur, 15 February 2013 - 12:51 PM.


#11 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 17 February 2013 - 02:04 PM

Ok, until I get around to making further changes, revision 445 on will utilize the 'Exit Game' key to act like the ESC key and pause VP. There is also an added checkbox to disable ESC from pausing VP.

There are a few other UI changes too, removed the Jolt settings from the Keys menu as in my testing I couldn't get it to effect anything regardless of how high or low I had it set. I also removed the options for the table for the accelerometer and stuff as the usable settings are mirrored in the Keys menu anyway. I also changed the 3 state buttons for enabling the accelerometer and for the mounting orientation to standard 2 state on/off buttons and will now override any table settings.

#12 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 18 February 2013 - 08:49 AM

Great, tnx!

 

Maceman here is the vp exe you can try - it has checkbox for using Esc key for pause - so if you disable Esc key in vp and put for example Q for exit key - you will have no problems with closing of uvp tables!

 

 

 

Every body that has problems with Esc key in VP, and can't reprogram ipac to send e - here is the solution - use this vp and disable Esc key!



#13 nebrunner

nebrunner

    Enthusiast

  • Platinum Supporter
  • 259 posts
  • Location:Omaha

  • Flag: ---------

  • Favorite Pinball: BIG GUNS!!!

Posted 28 February 2013 - 06:29 PM

Hey Blur I know that you have built in a pause feature but I would kind of like to add a real PAUSE button to my cabinet that would work for both VP and HP tables when in hyperpin. FP pause is defaulted to the "Pause/Break" key on keyboard, VP we can use Koadic's build I think and maybe remap the exit game key to also be the "Pause/Break" key on the keyboard, then I could map a front panel cabinet button into the Ipac to send "Pause/Break" for keypress? My goal would be to have this button pause any pinball game and then unpause it, without being able to accidentally exit out of hyperpin.

#14 htamas

htamas

    Pinball Wizard

  • VIP
  • 2,228 posts
  • Location:California

  • Flag: Hungary

  • Favorite Pinball: cannot pick just one, and they change anyway



Posted 28 February 2013 - 07:01 PM

You can already use the Exit button as Pause in both programs if you use HyperPin.

In VP a short press on Exit acts as pause out of the box. In FP, you have to enable the mouse as controller and map the Pause function to the right (or middle) mouse button. Of course this requires a mouse to be attached to the motherboard at all times, but with a wireless mouse receiver plugged in, this is no problem.

Check the FPlaunch manual for the details.

 

And I even have the Exit key mapped as Esc... it still works fine.



#15 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 28 February 2013 - 08:33 PM

exit menu really stops fp (sends right button which should be configured as pause in fp), but not vp - vpplayer is stopped but vpinmame continues to run

 

if you want to really stop vp and fp on same key you can do it with pause key if you can reprogram it to ipac

 

i've just tried it in vp and it works with real pause key - but to unpause it you have to press enter (plunger), not pause again

 

for this to work you don't need anything configured in fplaunch - it's all on relation ipac-vp, ipac-fp

 

hopefully vp will be fixed one day so that when it loses focus and stops - vpinmame is also stoped, or if only in script we would get table_focus and table_unfocus events which would fire up when table loses or gains focus - then we could do it from table script also (or from core.vbs for all tables)


Edited by blur, 28 February 2013 - 08:34 PM.