Jump to content

Code change to enable SAM LE driver board support


DJRobX

Recommended Posts

Now that my knowledge of ARM assembly has increased, I went back to the bad MOV opcode that I determined was broken early on.   The issue was very similar to the carry flag bug that was screwing up AC/DC.     ARM MOV can be used with an S option (MOVS) to set processor flags if the value is zero or negative.   The JIT code was making an assumption that the Intel MOV works the same way, but Intel MOV does not ever set flags.  I added a TEST instruction to set the flags if compiling MOVS, and now it works correctly.   This gives a pretty significant speed-up, since MOV is a super common opcode.

 

Link to comment
Share on other sites

  • Replies 856
  • Created
  • Last Reply
On 30-9-2016 at 10:40 AM, CarnyPriest said:

Big thanks to DJRobX. He passed along his source code changes. This build merges in the Stern LED implementation and is up to date with official VPinMAME up to rev3987. 

** WARNING FOR PLAYERS !! **
I made some set name changes to match the set names documented in the official driver.c

This will require changing Const cGameName in VP table scripts:
Iron Man & Iron Man Vault Edition
X-Men
The Avengers

Added Iron Man V1.83. The rule set is identical to the Iron Man Vault Edition set.

For collectors, there are a couple of other set name fixes for older versions of some tables. I've included a PinMAME executable with which you can generate a dat file for use in a rom auditor.
 

 

VPinMAME_SAM_NON_PINDMD_PINDMD2_PIN2DMD_2.39.zip

to what Const cgamenames need to be change in scripts for the above tables ??

Link to comment
Share on other sites

not sure if this is where to post potential bugs in this alpha, but since this latest build vPinMAMELauncher.exe in pinballx is constantly crashing now. on restarts on its own and i'm not 100% sure the new .dll is causing it.  It wasnt doing it before and i'll reinstall the release build tomorrow to confirm.  just wondering if anyone else is experiencing this.  

Link to comment
Share on other sites

I've never used that feature but it sounds interesting.  Is it loading VPM for different tables in attract mode?    If so that's almost like having QA automation!  Knowing what table it's trying to load when it crashes would be key for us.   Or are you saying it never works? 

Here's a new build with the following features:

1) Sound code improvements.   The buffer now manages both over and underrun conditions.   This will help prevent it from getting too delayed/out of sync on some systems with "hot" sound clocks.   It will also fire an additional timer IRQ to nudge the ROM to feed it more samples if it gets behind.    I've also implemented what seems to be stereo support (mainly because I wanted the output rate correct), but I've never heard any real stereo effects on any stern game anyway. 

2) Previously mentioned JIT fixes. 

 

 

vpm100916.zip

Link to comment
Share on other sites

6 hours ago, DJRobX said:

I've never used that feature but it sounds interesting.  Is it loading VPM for different tables in attract mode?    If so that's almost like having QA automation!  Knowing what table it's trying to load when it crashes would be key for us.   Or are you saying it never works? 

Here's a new build with the following features:

1) Sound code improvements.   The buffer now manages both over and underrun conditions.   This will help prevent it from getting too delayed/out of sync on some systems with "hot" sound clocks.   It will also fire an additional timer IRQ to nudge the ROM to feed it more samples if it gets behind.    I've also implemented what seems to be stereo support (mainly because I wanted the output rate correct), but I've never heard any real stereo effects on any stern game anyway. 

2) Previously mentioned JIT fixes. 

 

 

vpm100916.zip

it is launching pinmame and replaces dmd video animations.  I only wanted it to display current high scores during table selection.  But iI cant find any support topics on it on any websites and i cant get the dmd to stay in front of db2s in pinballx (vp is fine) So I'm probably gonna go back do the old way.using animation files.  I will check to see if the crashing is because of new .dll or a specific table first

Link to comment
Share on other sites

5 hours ago, Jodannar said:

Anyone having sound distortion problems with the newer SAM Builds? This is not the performance related repeated/delayed sounds but rather static within the sounds themselves. 

 

Edit: not tested with DJRobX's latest build vpm100916.zip 

 

Please retest with latest build(s) and then please report the machine(s) affected, as i changed a whole ton of things regarding the sound cores lately.

Link to comment
Share on other sites

And please test with the latest build.  I also made some changes specifically trying to address sound quality in addition to delay issues.

The general problem is that not all sound cards are exactly the same.   Some are a little fast, some are a little slow.   The people who were having delay issues have systems that are playing sounds that are slightly slower than VPM expects..  If you're getting static you may be on the other side, where your system is consuming sound data a little faster than ROM sends data.   I added a hack to fire an additional IRQ to the game if the sound is getting behind.    It was always fine on my cab, but that improved things on my laptop's VM.

 

Link to comment
Share on other sites

Toxie: Just a report - I was playing the new Red & Ted's table.   Sounds were all fine.   Then maybe 2-3 minutes into the game, I heard a scratchy noise and all sounds stopped.     I restarted the game and it never happened again.   

What was funny is the last real Red & Ted's machine that I played did exactly the same thing.    Might just be a ROM fluke, but figured I'd report it anyway in case others do. :)

 

Link to comment
Share on other sites

3 hours ago, rickwn3 said:

it is launching pinmame and replaces dmd video animations.  I only wanted it to display current high scores during table selection.  But iI cant find any support topics on it on any websites and i cant get the dmd to stay in front of db2s in pinballx (vp is fine) So I'm probably gonna go back do the old way.using animation files.  I will check to see if the crashing is because of new .dll or a specific table first

after much testing this morning..  it is the most recent walking dead rom that is causing the crashing issue.  however i don't know if this has anything to do with the pinmame update.   could be a problem with pinballx

Link to comment
Share on other sites

15 minutes ago, DJRobX said:

Toxie: Just a report - I was playing the new Red & Ted's table.   Sounds were all fine.   Then maybe 2-3 minutes into the game, I heard a scratchy noise and all sounds stopped.     I restarted the game and it never happened again.   

What was funny is the last real Red & Ted's machine that I played did exactly the same thing.    Might just be a ROM fluke, but figured I'd report it anyway in case others do. :)

 

Interesting.. There you see how accurate the emulation is nowadays..  ;)

Link to comment
Share on other sites

Bad news. Crash in VP 10.2 with Devil's Dare/dvlsdre on my system. Apparently sound related. 

Tested: Carny's 2.39: no crash
Rob's vpm093016: no crash
Rob's vpm100916 at91jit=1: crash
Rob's vpm100916 at91jit=0: crash

The good news? Reproducible on my system. VP crashes about 3 seconds after the game ejects the first ball into the shooter lane. Even after a reboot.

Edit: Long day. I guess testing at91jit=0 is kinda pointless on this MPU

Link to comment
Share on other sites

Thanks for the bug report.    Yep.  JIT will only affect WhiteStar II and Stern SAM games. 

Either I merged Toxie's code incorrectly or there's a bug in it.    Not to worry, stuff that crashes outright like that tends to be easy to solve.   It's the stuff that's hard to reproduce that's a nightmare.   :) 

 

  

Link to comment
Share on other sites

12 hours ago, rickwn3 said:

after much testing this morning..  it is the most recent walking dead rom that is causing the crashing issue.  however i don't know if this has anything to do with the pinmame update.   could be a problem with pinballx

Sorry I missed this post.  What ROM are you using and does it work on the table?    I tested TWD Pro and don't see any issues inside VP

Link to comment
Share on other sites

12 hours ago, toxie said:

Interesting.. There you see how accurate the emulation is nowadays..  ;)

Hi Toxie, 

I checked out SirCheddar's problem. It's crashing here in vortrax.c on the memcpy

      		samplesToCopy = (length<=votraxsc01_locals.iRemainingSamples)?length:votraxsc01_locals.iRemainingSamples;
			memcpy(buffer, votraxsc01_locals.pActPos, samplesToCopy*sizeof(INT16));
			buffer += samplesToCopy;

I double checked the merging and I don't see anything missing.  I grabbed your latest latest and it still does the same.    I'll let you take a first stab at it since you've recently been modifying that code. :)

Link to comment
Share on other sites

Well, I can't help myself when I run into a crash

I see two bugs:

In streams.c the routine does not check to see if the requested buffer fill is greater than the buffer size.  I added code in bold. 

              if (buflen > 0)
                {
                    INT16 *buf;

                    buf = stream_buffer[channel] + stream_buffer_pos[channel];
                    if (buflen  + stream_buffer_pos[channel] > BUFFER_LEN)
                        buflen = BUFFER_LEN-stream_buffer_pos[channel];

                    (*stream_callback[channel])(stream_param[channel],buf,buflen);
                }

in vortrax.c, the "delay" routine does not take away from length, allowing the loop to write data longer than length.  Added code in bold

       if ( votraxsc01_locals.iDelay ) {
            samplesToCopy = (length<=votraxsc01_locals.iDelay)?length:votraxsc01_locals.iDelay;

            memset(buffer, 0x00, samplesToCopy*sizeof(INT16));
            buffer += samplesToCopy;
            length -= samplesToCopy;
            votraxsc01_locals.iDelay -= samplesToCopy;
        }

Now, this stops the crashing, but it is all incidental to whatever the real problem is.   The requested sample size is normally tiny (100-500 samples).   When this bug hits it tries to request that vortrax create massive 94,000 sample input.   Might be some kind of performance thing, and it's trying to catch up. 

 

Link to comment
Share on other sites

Fixed in trunk.. Its still weird that there is this larger chunk of data incoming, but apparently if limiting this, the speech is garbled..

So the 'real' issue might be hidden deep inside the votrax emulation (maybe some weird frequency set??)..

Link to comment
Share on other sites

Right, the speech will be garbled because it's requesting too large a chunk that won't fit in the buffer.     My fix mainly just prevents a crash from the buffer overflow.    Still need to figure out why it wants such a huge chunk of sound.     It's way out of line with sample sizes normally requested.  

 

Link to comment
Share on other sites

Probably crashing for the same reason.    There's a function "mixer_need_samples_this_frame" that didn't seem prepared for the possibility of more samples pending than fit in a frame.   Due to resampling changes (?), now sometimes no samples are needed.   When no samples were needed, it was getting negative values that rolled over to a huge number.    I set these to be 0 and it seems to work better.  

Try this build and let me know how it goes please.   

I also added a little hack for SAM EOS errors.   It seems to work but it still may complain about a missing UR flipper switch, because VP+VPM doesn't implement staged flipper switches (press halfway in for lower flipper only, press fully for upper and lower). 

VPM101116.zip

*Edit* I checked out Sea Witch and it seemed to run fine on my cab with the update. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...