DJRobX

Code change to enable SAM LE driver board support

846 posts in this topic

Good. Just updating that I did a quick game - trying to shoot that orbit. You don't need to be in a multiball. In that game I had one ball in the snake head. So that is one destroy/create ? Then coffin MB where I lost all three balls. After this I played regular on a single ball when I provoked the bug and yes. Same address in the crash.txt as before.

Share this post


Link to post
Good. Just updating that I did a quick game - trying to shoot that orbit. You don't need to be in a multiball. In that game I had one ball in the snake head. So that is one destroy/create ? Then coffin MB where I lost all three balls. After this I played regular on a single ball when I provoked the bug and yes. Same address in the crash.txt as before.


Thalamus didn't you have an issue once about left flipper double hitting in Mustang le and walking dead le? If that is you how did you fix it?

Sent from my SAMSUNG-SM-G935A using Tapatalk

Share this post


Link to post
50 minutes ago, umpa said:


Thalamus didn't you have an issue once about left flipper double hitting in Mustang le and walking dead le? If that is you how did you fix it?

Sent from my SAMSUNG-SM-G935A using Tapatalk
 

I noticed some chatter on my left flipper too but I thought it may be my leaf switches... I'll have to pay more attention as I think it was on the two games you mentioned.

Share this post


Link to post

@umpa Sorry, I don't see the same problems that you.

The only issue I have with TWD is that sometime the flipper can die on me for a short period. Happens on both my machines so I expect this is a known SAM or table related error. Believe that to be happening on Mustang as well. Don't remember.

So, not fixed.

Share this post


Link to post

I just had this bug happening once in ~half an hour of testing and i ended up with an invalid access when increasing the ref count inside of the ball to ball invoke???!!

Share this post


Link to post

@toxie

In kdtree.cpp there is a member variable m_org_idx.   It is only cleared if the vector size grows, which it rarely will since the number of total balls is relatively constant.    Later, in FillFromVector, the idx keeps getting added to every time a ball is created or destroyed.    I don't think we want that!   After changing this I haven't been able to reproduce a crash (but see previous comments, this one is a timing sensitive bugger).   I also don't claim to be an expert in this code, I'm still trying to understand what all is going on.   I think the bug triggers when a ball goes to the outer loop because the ball Y rect goes below 0 (-9 in every crash I've seen), which I think is making the invalid entries contenders for a hit test.  

 m_num_items = num_items;

   m_org_idx.clear();         <-----

   

   if (m_num_items > m_max_items)

   {

#ifdef KDTREE_SSE_LEAFTEST

      if (l_r_t_b_zl_zh)

         _aligned_free(l_r_t_b_zl_zh);

      l_r_t_b_zl_zh = (float*)_aligned_malloc(sizeof(float) * ((m_num_items + 3) & 0xFFFFFFFC) * 6, 16);

#endif

      m_max_items = m_num_items;

      // m_org_idx.clear();      <------

      m_org_idx.reserve(m_num_items);

 

      tmp.clear();

      tmp.resize(m_num_items)

 

24 minutes ago, toxie said:

I just had this bug happening once in ~half an hour of testing and i ended up with an invalid access when increasing the ref count inside of the ball to ball invoke???!!

 

That makes sense to me, in every case I've seen, the HitTest compares the active ball (the one in the orbit) to an invalid object in the dynamic collision list, which HAS to be another ball, since balls are the only things being added and removed with that list.  

Share this post


Link to post

The above fix seems to have done the trick.  I used to be able to repro it in under 5 minutes.     With that fix in place, I ran for over 3 hours in the loop without the crash.   While that was running I also tried to crash the normal game on my cab and was unable to there also.

My VP build is attached if you want to try it.   

 

vpinballx.zip

Share this post


Link to post

D'oh! That's why i hate vectors in combination with push_back().. And also scary that this did not become apparent like already 2 years ago.. ;)

Thanks for tracking that down, did not have much time on the weekend to do it myself.

Share this post


Link to post
22 hours ago, umpa said:


Thalamus didn't you have an issue once about left flipper double hitting in Mustang le and walking dead le? If that is you how did you fix it?
 

Can you describe in more detail what you mean by double hitting? 

If you hold the flipper in, is the flipper releasing, and re-activating again?     Or is it more of a phantom flip after you let go?    Little details are important in terms of trying to track down the source.    Does it always happen or is it say 1 in x flips?  

 

Share this post


Link to post

@DJRobX Wow,  Thanks for tracking that down!!  Going to put in a few tests to double confirm.

@DozerAUS Would you mind sharing your version with me?  You always have fantastic tables.  I'd like to get some of your lighting bits.

-Mike

 

Share this post


Link to post
Can you describe in more detail what you mean by double hitting? 

If you hold the flipper in, is the flipper releasing, and re-activating again?     Or is it more of a phantom flip after you let go?    Little details are important in terms of trying to track down the source.    Does it always happen or is it say 1 in x flips?  

 


Sure. It happens 1 in 10 times or so. Sometimes I can play a whole game and no issue. When I press the button to hold the flipper up to catch a ball it will very quickly go down back up and down all while I have the button held in. So if I see it in time I just release the button and hold it in again to catch the ball. Again it's a lot better now that I cleaned out my old files but it does still happen.

Sent from my SAMSUNG-SM-G935A using Tapatalk

Share this post


Link to post
3 minutes ago, umpa said:


Sure. It happens 1 in 10 times or so. Sometimes I can play a whole game and no issue. When I press the button to hold the flipper up to catch a ball it will very quickly go down back up and down all while I have the button held in. 
 

So when it triggers, it continues to go up and down while holding in.   How rapidly is it doing it?   It continues to do that for the entire duration that you hold the button?  

Is your DOF solenoid or flipper sound firing while that goes on?   

  

Share this post


Link to post
So when it triggers, it continues to go up and down while holding in.   How rapidly is it doing it?   It continues to do that for the entire duration that you hold the button?  

Is your DOF solenoid or flipper sound firing while that goes on?   

  


It's does it for one cycle. Starts in up position goes down back up the down very fast. Solenoid only triggers the first time when I hold the button in

Sent from my SAMSUNG-SM-G935A using Tapatalk

Share this post


Link to post

I noticed looking at the script for TWD and Mustang there is some code that appears to try to release the flipper solenoids "early"

If Keycode = LeftFlipperKey then 
        SolLFlipper false
    End If

You might try commenting that out or just delete those three lines.   It's there for the right flipper too so I'm not sure why the left would be different.

You're looking for the ones on KeyUp.   The ones on KeyDown are already commented out. 

 

Share this post


Link to post

@DJRobX Very nice find I must say !! Played metallica LE for over an hour without a problem at all.

But, I must admit that when I loaded the new Tee'd off I could not hit anything. It felt like I had some kind of lag. Rolled back to the original and played much better. THIS is probably just me, or some weird issue that I've sometime experienced that a table need to be reloaded again. Thought I just mention it if anyone where to experience the same. It is probably a one time issue, Just haven't had the time to re-check.

 

Share this post


Link to post
2 hours ago, Thalamus said:
@DJRobX Very nice find I must say !! Played metallica LE for over an hour without a problem at all.

But, I must admit that when I loaded the new Tee'd off I could not hit anything. It felt like I had some kind of lag. Rolled back to the original and played much better. THIS is probably just me, or some weird issue that I've sometime experienced that a table need to be reloaded again. Thought I just mention it if anyone where to experience the same. It is probably a one time issue, Just haven't had the time to re-check.


Rolled back to original what? Vp? Probably optimization or something with the build. The particular build I posted has debug symbols enabled and some other things so I could analyze things if a crash occurs.    The fix itself is unlikely to have a big impact on performance (it plugs a bit of a leak actually, so it might improve).. 

Sounds like Toxie will update official vp with the fix.

Share this post


Link to post

Works with my own build, so the fix is fine. Its an ancient leftover from some optimization i did during VPX development. Really strange that it never lead to any other problems so far.

We will enter the 10.3 cycle soon, Fuzzel wants to finish up some stuff first i think.

Share this post


Link to post
4 hours ago, sliderpoint said:

@DozerAUS Would you mind sharing your version with me?  You always have fantastic tables.  I'd like to get some of your lighting bits.

Looking at that video, some of the difference is that he's using the modulated solenoid feature.   In this case it seems particularly noticeable in the snake and the coffin.    Look at his Walking Dead or Mustang table script, you'll see UseVPMModSol=1 at the top, then instead of SolCallback there's SolModCallback for those flashers.    This allows the ROM to control the intensity level of those lights, instead of just on/off.  

 

Share this post


Link to post
31 minutes ago, DJRobX said:

Looking at that video, some of the difference is that he's using the modulated solenoid feature.   In this case it seems particularly noticeable in the snake and the coffin.    Look at his Walking Dead or Mustang table script, you'll see UseVPMModSol=1 at the top, then instead of SolCallback there's SolModCallback for those flashers.    This allows the ROM to control the intensity level of those lights, instead of just on/off.  

 

Yep, I was just looking at that and testing putting the modulated flashers.

-Mike

Share this post


Link to post
I noticed looking at the script for TWD and Mustang there is some code that appears to try to release the flipper solenoids "early"

If Keycode = LeftFlipperKey then 
        SolLFlipper false
    End If

You might try commenting that out or just delete those three lines.   It's there for the right flipper too so I'm not sure why the left would be different.

You're looking for the ones on KeyUp.   The ones on KeyDown are already commented out. 

 


I'm going to try this right now. I will take a quick video of the flipper in action

Sent from my SAMSUNG-SM-G935A using Tapatalk

Share this post


Link to post

Thanks for the video.   That kind of looks like what I saw on my cab (and removing that line in the script fixes).  On mine it's super rare, but it manifests more as a phantom flip after you let go of the flipper button.    

The reason is that that line of script tells the flipper to release immediately when you let go of the button, but VPM may be "behind", and continues to send the "Flipper on" signal, so it may "blip" the flipper back on before VP catches up completely with VPM events.

 

Share this post


Link to post
Thanks for the video.   That kind of looks like what I saw on my cab (and removing that line in the script fixes).  On mine it's super rare, but it manifests more as a phantom flip after you let go of the flipper button.    

The reason is that that line of script tells the flipper to release immediately when you let go of the button, but VPM may be "behind", and continues to send the "Flipper on" signal, so it may "blip" the flipper back on before VP catches up completely with VPM events.

 


Yes commenting out those lines worked! On both Mustang and TWD! Thank you so much yet again!

Sent from my SAMSUNG-SM-G935A using Tapatalk

Share this post


Link to post

I'm thankful for DJRobX's work every time I look at a DMD in truefullscreen mode -- no more big blank bars! :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now