Jump to content



Photo
* * * * * 6 votes

FastFlips script (bypassing pinmame flipper callback)


  • Please log in to reply
440 replies to this topic

#41 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 23 November 2017 - 07:30 PM

@nFozzy: due to real life and too much going on here in the forum(s), i completely forgot about your script here.. Still okay to add this to the VPX core collection? Or any newer version you have?



#42 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 23 November 2017 - 11:22 PM

I'm working on a version working with the core scripts. It works just by setting UseSolenoids to 2 and then the various system .vbs holds the various solenoid numbers and handles the keys. I'm trying to figure out a way to work in staged flipper button support.

 

There's one other improvement, I think setting pinmame updates to a 1 interval makes sense, Improves solenoid responsiveness on 60fps/vsync machines quite a bit. Not totally sure about the performance impact, the scripts is good about discarding redundant updates, but It may effect performance on VPX tables that put a lot of object updates on LampCallback / MotorCallback.



#43 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 941 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 24 November 2017 - 05:48 AM

Working great with HSII but how to disable flippers during video mode?

 

@nFozzy, for this case, what I was thinking would be good is a way to temporarily switch back to "slow" flippers.    So when the ball is in a scoop/kicker that potentially has a video mode, give VPM "classic" control of the flips.    Shouldn't be too noticeable since most of the time the single ball is not near the flips while in the kicker.   Might only be slightly noticeable if a ball happens to hit the kicker in multiball or something.  

 

Then you'd have something like:

 

sub swKicker_Hit()

    FastFlips.VPMControlEnabled = 1

end sub

 

sub swKicker_UnHIt()

   FastFlips.VPMControlEnabled = 0

end sub 

 

That would mean give control to VPM while the ball is sitting in the video mode kicker.


Edited by DJRobX, 24 November 2017 - 05:49 AM.


#44 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 24 November 2017 - 07:20 AM

Great stuff guys!

 

@nFozzy: Please shoot me a PM then if you think it's ready for prime time, cause i do not check all threads here all the time..



#45 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

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

  • Favorite Pinball: System 11

Posted 24 November 2017 - 09:27 AM

Thanks for working on flipper responsiveness, guys. VPX has made major strides toward real pin snappiness thanks to you.

#46 chokeee

chokeee

    Enthusiast

  • Members
  • PipPipPip
  • 333 posts

  • Flag: Poland

  • Favorite Pinball: High Speed

Posted 24 November 2017 - 02:53 PM

So if we are on topic ;) Is it even possible to add those fastflips to AFM? It work for listed in script systems.



#47 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 941 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 24 November 2017 - 04:38 PM

So if we are on topic ;) Is it even possible to add those fastflips to AFM? It work for listed in script systems.

As I mentioned to you on FB, the problem that needs solving in WPC95, WhiteStar, etc systems is determining whether the game has its flippers turned on.   If the game isn't giving you that information via a GameOn solenoid, we need another way. 

 

I think Congo was doing something fancy by "polling" VPM's flipper buttons, and then switching the VP table flippers on and off based on whether VPM responded back within a short period of time.  Something like that might be a good candidate to add to nFozzy's class.   I think something like that in conjunction with a control switcher for video modes could work well in a lot of cases.    

Another method might be to get into ROM hacking and try and ferret out what in-memory variable is holding the flipper on/off state.   While that sounds like an impossible task, it's not much different than trying to determine a game cheat, and people have been doing that for lots of MAME games for more than a decade.  The MAME debugger that people use to find such things does exist in VPM.


Edited by DJRobX, 24 November 2017 - 04:42 PM.


#48 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 25 November 2017 - 10:28 AM

Could

HRESULT NVRAM(/*[out, retval]*/ VARIANT *pVal); - Get the full NVRAM of the emulation (e.g. high scores, settings, etc. as a binary blob of 8bit values) 
HRESULT ChangedNVRAM(/*[out, retval]*/ VARIANT *pVal); - Get only the NVRAM parts that have changed since last call (similar to ChangedLamps), first dimension has the location, second the new value (only 8 bits are valid), third the previous value (only 8 bits are valid)

be an option, too, for some machines?

do some machines feature statistics for button presses?? but then again, this might also not be necessarily faster..



#49 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 941 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 25 November 2017 - 06:41 PM

If the right memory location was found, it would assuredly be faster.   We don't care too much about latency to activate/deactivate the flips, we just want the flips to be responsive when they're on.   It would work exactly like the GameOn solenoid does.   Next time I set up the VPM debugger I'll see if I can track one down as a pilot... :) 



#50 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

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

  • Favorite Pinball: System 11

Posted 25 November 2017 - 08:04 PM

I love all the visual improvements to the engine, but reducing flipper latency is the probably the most exciting development arena, IMO. Thanks for your work, guys.

#51 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 17 December 2017 - 02:22 PM

Fastflips core integration is about ready and needs testing. There are two parts to it: low-latency flippers, double-leaf-switch flipper support.


VPMFlips:
Works with all* pre-solid-state flipper games + most Data East / early Segas.
*except Zaccaria and LTD (Can't find any solenoids or lamps that would work for these)
Bally/Williams WPCs will work perfectly up until Fliptronics (More info in WPC.vbs). Whitestar, WPC95 (Congo/AFM), and Capcom onward will not work at all.
Quick setup: change UseSolenoids = 2, add  'VpmInit me' to the table _init section if it's not there already. These modifications are backwards compatible and won't break tables if your core scripts are reverted.

(If the table uses it's own flipper scripts for this, don't bother.)


Double leaf switch support: For the two or so people who have pincabs with double leaf switches, I think this will be really cool.
For now the staged flipper key bindings are handled in vpmkeys. Temporary solution.

Installation:

1. Bind new keys in vpmkeys.vbs. For now that's what enables the separate switch handling. (If your table is a WPC95, you may be already be done)
2. Pre-solid state flippers have to go through VPMFlips, so enable that.

3. New subs will have to be created to separate the lower flippers from the upper flippers. Assign upper flipper subs to SolCallback(sULFlipper) and SolCallback(sURFlipper).

That's it. This modification isn't fully backwards compatible with earlier script revisions - Pinmame won't call upper flipper subs normally on most games, so your upper flippers won't work without VPMflips.
For solid state flippers: only WPCs have upper flipper switch info in their system vbs. All others, such as Segas, Capcoms and Sterns, must be scripted manually.

 

https://www.dropbox....ips_a1.zip?dl=0
If anything goes horribly wrong just overwrite the script files with one of the ones from the beta


Edited by nFozzy, 17 December 2017 - 03:08 PM.


#52 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 18 December 2017 - 07:02 PM

I hope you're still okay with including this into the VP distribution when it's finished?



#53 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 19 December 2017 - 03:04 AM

Ya that's the idea



#54 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 19 December 2017 - 08:48 AM

I looked at it now, and is there any reason why you didn't modify capcom.vbs, LTD.vbs, sam.vbs, sega.vbs and the zac's.vbs? Unnecessary or an oversight (capcom seems to be unnecessary as you mentioned)?!

 

EDIT: And the 'This may break compatibility with some older WPC tables that use the 'cSingleLFlip' method (More info in WPC.vbs)' part: Does this mean it's not

fully compatible with already released tables?

 

Thanks!!


Edited by toxie, 19 December 2017 - 09:00 AM.


#55 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 19 December 2017 - 09:25 AM

EDIT: And the 'This may break compatibility with some older WPC tables that use the 'cSingleLFlip' method (More info in WPC.vbs)' part: Does this mean it's not

fully compatible with already released tables?

 

That's a good question, It would break split flippers for those tables, but would not break flippers entirely. If there are any pincabs out there that actually use that script method along with double leaf springs I'd like to know...  Could be scripted to use both just to be safe.

 

Regarding Sega, Capcom, Stern tables: These don't currently have upper flipper switches defined in their VBS files. If any of these systems used consistent switch numbers, that could be added. If there's no consistency then the modifications should be done table-by-table. Could use a little investigation.

 

Zaccaria and LTD tables don't have game-on solenoids or lamps that I could find, and they also don't receive separate upper flipper signals from pinmame for staged flipper support. So nothing can be done for them.



#56 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 19 December 2017 - 10:37 AM

Sounds good to me.. If you don't mind then i'd include it already into 10.4 beta so that more people will test the backwards compatibility..



#57 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 19 December 2017 - 10:44 AM

Sure



#58 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 19 December 2017 - 11:58 AM

These are the tables i have on my laptop setup that use cSingleLFlip

Attached Files



#59 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 19 December 2017 - 07:58 PM

I looked at all of these, and none actually sets cSingleLFlip (or cSingleRFlip) to true/1, and as i have ~1400 VP8,VP9 and VPX (the latter should be pretty much a complete set even) tables in there, i guess it's safe to say that there is most likely no 'modern' table that actually uses it..

 

So your current version has been included into SVN, thanks again!!!



#60 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 27 December 2017 - 10:35 AM

@nFozzy: Could you please have a look at http://www.vpforums....=38450&p=396133 ?