Author Topic: What I've been working on (iq_132's work in progress)  (Read 1126312 times)

Offline Haze

  • MAME Devs
  • *****
  • Posts: 184
  • Karma: +47/-0
Re: What I've been working on (iq_132's work in progress)
« Reply #705 on: August 13, 2014, 06:58:25 AM »
The Sand Scorpion banking code in MAME looks like nonsense, I guess the music will be broken on later levels but nobody has noticed.

For the rest, make sure your latch behavior is correct, make sure you give the CPU time to reply (it needs 2 way communications) make sure the YM is generated the interrupt on the Z80, make sure the comms generate the NMI, and you should be good.

For music the YM interrupt driving the Z80 might be the key, for dipswitch reading the 2 way comms is important, reminds me a bit of Seibu.

Offline iq_132

  • Administrator
  • *****
  • Posts: 3733
  • Karma: +413/-0
  • Definitely not Dink!
    • NeoSource
Re: What I've been working on (iq_132's work in progress)
« Reply #706 on: August 13, 2014, 08:45:12 AM »
The Sand Scorpion banking code in MAME looks like nonsense, I guess the music will be broken on later levels but nobody has noticed.

For the rest, make sure your latch behavior is correct, make sure you give the CPU time to reply (it needs 2 way communications) make sure the YM is generated the interrupt on the Z80, make sure the comms generate the NMI, and you should be good.

For music the YM interrupt driving the Z80 might be the key, for dipswitch reading the 2 way comms is important, reminds me a bit of Seibu.

Latch behavior is same as MAME's, nmi is triggered, the soundlatch is read, but soundlatch2 is never written. The sound irqs are triggered and cleared, but I'm not sure if they're fast enough? Everything else has been written and re-written. :(
I even tried to overclock the z80 a bit like you have to with Nostradamus (another Face shmup) in older MAME versions. No luck.


Offline dink

  • Administrator
  • *****
  • Posts: 5332
  • Karma: +522/-1
  • pie? I nearly bought one!
Re: What I've been working on (iq_132's work in progress)
« Reply #707 on: August 13, 2014, 09:56:36 AM »
MAME:
      m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
      space.device().execute().spin_until_time(attotime::from_usec(100)); // Allow the other cpu to reply
FBA:
         ZetNmi(); <- does that pulse the line, or just send a nmi?  I need an explanation of what pulse_line means.
         ZetRun(100); // ?

Perhaps we need to better emulate the spin_until_time() functionality of MAME, instead of a ZetRun(100); after sending the nmi to the z80?  IIRC & please correct me if I'm wrong: spinning does everything _except_ process instructions.


Offline Haze

  • MAME Devs
  • *****
  • Posts: 184
  • Karma: +47/-0
Re: What I've been working on (iq_132's work in progress)
« Reply #708 on: August 13, 2014, 10:44:07 AM »
yeah, PULSE_LINE just triggers the line for an instance, with an NMI that's all you need, because it can't be masked by the CPU, so it always triggers it.

HOLD_LINE generally holds the line high until the CPU takes the interrupt (a bit of a hack but many drivers do this, and some hardware can auto-ack)
ASSERT_LINE holds the line until it gets cleared
CLEAR_LINE clears an asserted line

for the FBA cores, I'm not sure.

in MAME
 space.device().execute().spin_until_time(attotime::from_usec(100));

will cause the 68k to do nothing for a while, so that everything else (the z80, ym etc. can run) when otherwise it would wait until the next timeslice, bit of a hack because simply running with a tighter sync overall would probably be as good but at performance cost.

not really sure what else to suggest, maybe there's a bug with your z80, or timers in the ym if you're 100% sure everything else is good.

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: What I've been working on (iq_132's work in progress)
« Reply #709 on: August 13, 2014, 03:47:39 PM »
Latch behavior is same as MAME's, nmi is triggered, the soundlatch is read, but soundlatch2 is never written. The sound irqs are triggered and cleared, but I'm not sure if they're fast enough? Everything else has been written and re-written. :(
I even tried to overclock the z80 a bit like you have to with Nostradamus (another Face shmup) in older MAME versions. No luck.

I had a quick look at it the other day and the YM was barfing. It does an IRQ at the beginning, lowers it, and then raises another, and then that's it. Never managed to find the reason though.
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 dink

  • Administrator
  • *****
  • Posts: 5332
  • Karma: +522/-1
  • pie? I nearly bought one!
Re: What I've been working on (iq_132's work in progress)
« Reply #710 on: August 13, 2014, 04:17:41 PM »
Thanks for the info, Haze!

Offline dink

  • Administrator
  • *****
  • Posts: 5332
  • Karma: +522/-1
  • pie? I nearly bought one!
Re: What I've been working on (iq_132's work in progress)
« Reply #711 on: August 13, 2014, 06:14:50 PM »
Hmm, I've tried just about everything I could think of, and can't seem to get the z80 to reply after sending the nmi.  There's gotta be something we're overlooking.  It just won't write to z80 port 0x06, or read from the 2203 ports(dips)..


Offline iq_132

  • Administrator
  • *****
  • Posts: 3733
  • Karma: +413/-0
  • Definitely not Dink!
    • NeoSource
Re: What I've been working on (iq_132's work in progress)
« Reply #712 on: August 16, 2014, 01:53:35 PM »
Added driver for DJ Boy.

Also fixed a z80 bug with a little direction from Dink. This fixes the music in Raiden (and a lot of Irem games too!). ^^


Offline dink

  • Administrator
  • *****
  • Posts: 5332
  • Karma: +522/-1
  • pie? I nearly bought one!
Re: What I've been working on (iq_132's work in progress)
« Reply #713 on: August 16, 2014, 03:13:27 PM »
Tag-team fixes today!!  I got sound working in Air-Duel :)

Offline Huggybaby

  • Jr. Member
  • **
  • Posts: 92
  • Karma: +2/-0
Re: What I've been working on (iq_132's work in progress)
« Reply #714 on: August 16, 2014, 04:19:26 PM »
Awesome, goooo Irem!

Offline Arcadez

  • Expert
  • *****
  • Posts: 558
  • Karma: +15/-0
  • Arcade Addict
Re: What I've been working on (iq_132's work in progress)
« Reply #715 on: August 16, 2014, 05:33:13 PM »
Nice work fellas new games playable and sound fixes are always welcome additions to FBA  :biggrin:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3733
  • Karma: +413/-0
  • Definitely not Dink!
    • NeoSource
Re: What I've been working on (iq_132's work in progress)
« Reply #716 on: August 20, 2014, 09:15:36 PM »
Started porting the Kaneko16 games that aren't in fba; Shogun Warriors and B. Rap Boys.

Shogun Warriors came right along after a little fudging around.
B. Rap Boys, for some reason, is stuck at the post. :(


Offline dink

  • Administrator
  • *****
  • Posts: 5332
  • Karma: +522/-1
  • pie? I nearly bought one!
Re: What I've been working on (iq_132's work in progress)
« Reply #717 on: August 21, 2014, 03:22:17 AM »
Nice!
btw, check your pm, I found some info re:brapboys getting hung @ crc check

Offline iq_132

  • Administrator
  • *****
  • Posts: 3733
  • Karma: +413/-0
  • Definitely not Dink!
    • NeoSource
Re: What I've been working on (iq_132's work in progress)
« Reply #718 on: August 21, 2014, 02:10:17 PM »
Nice!
btw, check your pm, I found some info re:brapboys getting hung @ crc check
I've already mucked around with interrupts. :( I'm not sure why it's fighting me.


Offline iq_132

  • Administrator
  • *****
  • Posts: 3733
  • Karma: +413/-0
  • Definitely not Dink!
    • NeoSource
Re: What I've been working on (iq_132's work in progress)
« Reply #719 on: August 21, 2014, 04:25:31 PM »
I came up with a small hack to bypass the check, implemented a few fixes, and hooked up save states.  :)

Code: [Select]
if (Kaneko16MCURam[0xE3] == 0x7F) {
Kaneko16MCURam[0xE3] |= 0x80;
}