Author Topic: dink's FBN Development & Fixes thread  (Read 1320623 times)

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Alright, I finally got the YM2151 savestate issues worked out, it all boiled down to the parameters being swapped for set_connect() in the postload-refresh function.  ugh  :eek:  :redface:
To my defence, the parameters were swapped way before I even touched the code!  Honest!  :biggrin:

...It will be perfect when I get done with it, even if it takes 5 tries.

best regards,
- dink

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Most likely that would be how it came out of MAME way back then...
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Most likely that would be how it came out of MAME way back then...
Holy bug from the beginning of time!


Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
hehe :) I figured so much..

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Hi guys,
Once in a while, I'll pause a game, and then turn off my pc (actually, Hibernate!), later when I wake the thing up, I'm greeted with a blank FBA window.  So thats fixed now :)

its a slow day..

best regards,
- dink

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Out of curiosity(or desperation), would anyone be interested in porting the ymf278b.c driver from the latest MAME to FBA?  :S
The FBA-current version of the driver is missing reverb/dampening, sometimes notes stick on forever (try the smartbomb in Tengai, for example).  Fortunately, all this has been added and fixed in the latest version.  The driver itself is relatively small :)



Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
I'm trying to port the [latest mame]/src/emu/sound/ymf278b.c to FBA, but the part that is confusing me is all of the timers needed by the driver.  The driver is really simple and straightforward other than the timers though.

http://mamedev.org/source/src/emu/sound/ymf278b.c.html

The timers are set up in ymf278b_init()
Manipulated in ymf278b_A_w() (the lines with chip->timer_a/b & the attotime stuff)
.. and around line 609-612.

I need someone to explain how these timers work, and how they translate to FBA. :)

best regards,
- dink

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
I got the new ymf278b chip driver ported to FBA! :biggrin:

What I did was check the mame svn and found where they changed the timer code over to the new timer code, which I'm not familiar with, and then I figured out from there how to integrate the old timer code from FBA into the new driver.
And it works, too, imagine that :)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
I got the new ymf278b chip driver ported to FBA! :biggrin:

What I did was check the mame svn and found where they changed the timer code over to the new timer code, which I'm not familiar with, and then I figured out from there how to integrate the old timer code from FBA into the new driver.
And it works, too, imagine that :)

Nice work! Looking forward to seeing it!


Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
I got the new ymf278b chip driver ported to FBA! :biggrin:
Well done!!!

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Thanks guys! :D

I spent a few hours today testing the new driver, and since everything checked out OK, I checked it in to svn.  I need to do a little cleaning up here and there, but for the most part, its complete.

One of my favorite games - Tengai (aka Sengoku Blade - Sengoku ace episode II aka Samurai Aces 2) is now much more enjoyable.  No more stuck sounds (try it - press the smartbomb button), no more missing music halfway through the game :D
Wait, thats not all, this new driver has reverb and dampening also.  In Tengai, try picking up a coin[during the game] with headphones on, its ear piercingly painfull, now try with the new version, ahh - perfection.  :wink:  For only 19.95, you get not one, but two.. Just pay separate shipping and handling.....  Just kidding, wait for the next version of FBA  :biggrin:

I thought that this driver port would fix the problems with Sol Divide, but I was wrong - it seems like something in Sol Divide's driver is skipping some irq's or interleaved wrong which is causing commands to the ymf278b to get skipped.  To see what I mean, run Sol Divide in MAME, insert a coin, watch the intro w/music & start playing, then do the same in FBA, notice something missing?  I will definitely be looking into this problem (in the sol divide driver/d_psikyosh) soon though, guys!

best regards and happy gaming,
- dink
« Last Edit: June 30, 2014, 03:53:29 PM by dink »

Offline Haze

  • MAME Devs
  • *****
  • Posts: 184
  • Karma: +47/-0
The SH2 has timers as well.. I seem to remember at least one of the Psikyo games needing them to work properly and idle skipping interfering with that, might have been Sol Divide.

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Haze, thanks for the info, I'll take into consideration on my debugging session :)

best regards,
- dink

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Big thanks to iq_132 for leading me in the right direction to fix a bug in the ymf278b driver that was driving me insane earlier tonight :)


Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Re: Playtesting...

Not much to write about today, but things are looking good :)

I played Strikers 1, 2, 3 & Tengai from beginning to end (again) as they are the games in FBA that make the most use of the ymf278b chip, and things are looking pretty good.  Looks like I forgot about Dragon Blaze.. .  Later today perhaps.

best regards,
- dink