Regen 0.93 Beta 4

AamirM's Regen forum

Moderator: AamirM

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Regen 0.93 Beta 4

Post by AamirM » Fri Sep 12, 2008 8:34 am

Hi,

I've uploaded a new beta 4 of Regen which contains somewhat major sound emulation updates. I've added an option to boost PSG volume to whatever the user like since I remeber something else, someone else says something else and recordings sound something else. As such, I've been unable to find a way that fits for everyone.

Apart from that, hopefully all the reported sound problems might have been fixed in this release. So don't forget to test them out.

SSG-EG part of my YM2612 core has undergone a major overhaul. So it should be pretty much very close to the real thing now. If you want to check out yourself, here is a recording from the real thing and here is the test ROM to run in Regen and compare results. All credits for these both go out to Nemesis.

And I almost forgot, you can download the beta from here.

And my thanks goes out to a Russian guy for reporting many sound problems but wants to remain anonymous.

Please continue your discussions about the latest Regen beta in this topic.

stay safe,

AamirM

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Sun Sep 14, 2008 4:54 pm

Ecco - the Tide of Time

the "splash" sound when you dive back into the water after jumping out is weird, listen to Gens for something more correct, Kega handles this like Regen by the way so it should be checked on real hw but definitely not sound like a "splash"

there is some note in Gens code about how to fix it, it's related to attenuation level on Key ON

indeed, in my implementation, forcing attenuation level to MAX (1023) on Key ON fixed it, however, I'm not sure if this is correct behavior because it will break the "Flamethrower" sound effect in Alien 3

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Sun Sep 14, 2008 11:58 pm

I dunno, I think Regen has it right and Gens has it wrong, and this game is one of my favorites, so it know it pretty well. I think it definitely needs to be tested on the hardware. In fact, I might make a recording this afternoon, since the splash sound in Ecco II seems to be one of those infamous bugs everything gets wrong to start with.

I've found a pretty major bug while messing around today though. There seems to be a big problem with savestates. It seems the VRAM isn't being loaded back when a savestate is loaded. Try pretty much any game and take a savestate in a menu or something, then try and load it from a different area like in level and you'll see it.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Mon Sep 15, 2008 1:19 pm

deleted: my implementation was incorrect, sorry :oops:

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Wed Sep 17, 2008 8:26 pm

some other bugs I found recently:


Pacman 2: the new adventures


The game hangs if you don't hit START to jump to title screen after the sega logo (where the opening song should be played as well as the little intro sequence)

Note that the opening song is not played in Kega either (but the game does no hang), this is probably related to the same sound bug later in the game (music stops if you go into PAUSE menu)


Beavis & Butthead


The Chainsaw SFX is wrong in sound test. It appears to use SSG-EG with setting of 0x08 on operators 2,3,4 of channel #1 (with some operator using AR different from 1F). Kega seems to handle it right btw.

King Of Chaos
Very interested
Posts: 273
Joined: Fri Feb 29, 2008 8:12 pm
Location: United States

Post by King Of Chaos » Wed Sep 17, 2008 9:09 pm

Yep, I can confirm the Beavis & Butt-Head one. Can you check Robocop Vs. The Terminator against Genesis Plus to check the flamethrower weapon sound effect against Kega too?

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Wed Sep 17, 2008 11:24 pm

Heh, so there is a game out there which uses SSG-EG with an attack rate less than 0x1F. At least it's only using 0x08. An SSG-EG setting of 0x08 or 0x09 would be consistent and reliable with an attack rate less than 0x1F, because the inverted output flag is not used by those SSG-EG patterns.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Thu Sep 18, 2008 9:50 am

How does this SFX sounds in your emulator , Nemesis?
Because my implementation (and certainly Aamir's one) follows your indications and reproduce your Test ROM correctly but failed on this one specifically.

As Steve Snake seems to have appeared back again here, maybe did he remember how he fixed/tested this one ?

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Thu Sep 18, 2008 1:05 pm

I'm in the middle of some pretty major changes, so I can't actually compile a build which works right now, but as soon as I've got everything back together (maybe a couple of days) I'll give it a try. The SSG-EG test rom I posted only tested SSG-EG with an attack rate set to 0x1F however. The attack phase in SSG-EG could be totally messed up, and the test rom I posted would still work fine. I might compile an alternate version which includes an attack phase, since we now know of an in-game case which relies on it.

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM » Fri Sep 19, 2008 2:23 am

Hi,

Maybe its fixed in my latest build since I made some changes to SSG-EG but I haven't checked because I've been very busy (will check out today). But yeah, I think attack rates of 0x8-0x9 or less might not be handled correctly. IIRC, Nemesis did explain what happens with an attack rate less than 0x1F but I didn't really looked at it :) (no game used that).

stay safe,

AamirM

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Fri Sep 19, 2008 2:57 am

Alrighty, I've just got everything back together, and I've got the same problem with this chainsaw sound effect in my emulator.

The problem is related to the point at which SSG-EG mode triggers a "loop". I said that SSG-EG loops when attenuation hits max. The YM2608 documentation tells us that when all 4 bits of the sustain level are set, the sustain level is set to 93db (0x370). One of these two statements is incorrect.

OP3 of the chainsaw sound sets the sustain level to max, with a sustain rate of 0, so the level never changes during the sustain phase. If SSG-EG really looped when attenuation hit max, and the sustain level was really 0x370 when set to max, the envelope for OP3 should never loop under SSG-EG, but it does. Either SSG-EG actually loops when it hits the max sustain level (0x370) or some earlier point, or the sustain level is actually 96db (0x3FF) when all bits are set.

Kega Fusion seems to loop SSG-EG when the output reaches 0x370. This fixes the chainsaw sound, but is actually the cause of clear errors in the SSG-EG output from Kega with the inverted held note patterns 0xB and 0xD. I'll do some tests, and try to get a definitive answer as to how to solve this problem.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Fri Sep 19, 2008 8:55 am

Indeed, adding Alone Coder's fixes from TFM Maker in MAME implementation (see below) fixed this sound
if ( SLOT->volume >= 512 /* áûëî MAX_ATT_INDEX */ ) //Alone Coder
{
SLOT->volume = MAX_ATT_INDEX;

if (SLOT->ssg&0x01) /* bit 0 = hold */
{
if (SLOT->ssgn&1) /* have we swapped once ??? */
{
/* yes, so do nothing, just hold current level */
}
else
swap_flag = (SLOT->ssg&0x02) | 1 ; /* bit 1 = alternate */

}
else
{
/* same as KEY-ON operation */

/* restart of the Phase Generator should be here,
only if AR is not maximum ??? ALWAYS! */
SLOT->phase = 0; //Alone Coder

/* phase -> Attack */
SLOT->volume = 511; //Alone Coder
SLOT->state = EG_ATT;

swap_flag = (SLOT->ssg&0x02); /* bit 1 = alternate */
}
/* negate output (changes come from alternate bit, init comes from attack bit) */
if ((SLOT->ssg&0x08) && (SLOT->ssgn&2) && (SLOT->state > EG_REL))
out ^= 511;
not sure if it's right though but he claimed to have made test on real YM2203, let's wait for your own test on this


ona side note, he is doing this on KEY ON, I wonder if it's right also:
if ( SLOT->volume >= MAX_ATT_INDEX )SLOT->volume = 511; /* Alone Coder */

AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM » Fri Sep 19, 2008 5:26 pm

Hi,

I tried that with the latest build today but its not fixed in there. Will try Eke's suggested fix soon too. Maybe it works only if attack rate is not maximum(?). Does Nemesis test ROM sounds correct with that? I think envelopes will loop a little fast with those changes so Nemesis test ROM may not sound right.
Nemesis wrote:I've found a pretty major bug while messing around today though. There seems to be a big problem with savestates. It seems the VRAM isn't being loaded back when a savestate is loaded. Try pretty much any game and take a savestate in a menu or something, then try and load it from a different area like in level and you'll see it.
Yeah, looked at it today and I found not one but two pretty nasty bugs. VRAM was being loaded correctly but the VDP registers weren't being loaded correctly. I wrote "vdp.registers = data[0xFA + i]" when in fact I should have written "vdp_set_register(i, data[0xFA + i])" :oops: . Secondly the FM state was not being restored correctly either :oops: . Its embarassing I know. Now the states load correctly. Thanks for pointing these bugs out.

EDIT:

Okay, I tried Eke's suggested fix and it fixes the problem and Nemesis' test ROM sound fine to me too.

stay safe,

AamirM

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Sat Sep 20, 2008 5:23 pm

Mouse capture not working. I used "Cannon Fodder" and "Sega mouse" as input device, but "Capture mouse" do nothing.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Sat Sep 20, 2008 7:20 pm

AamirM wrote:
Okay, I tried Eke's suggested fix and it fixes the problem and Nemesis' test ROM sound fine to me too.

stay safe,

AamirM
the "Zap" sound effect also use SSG-EG on one of the operator, you might want to check it back ;-)

this one uses really extreme timings :

YM CH1 SLOT3, TL=0x0
YM CH1 SLOT3, AR=0x1f, KSR=0x2
YM CH1 SLOT3, DR=0x1f, AM=0
YM CH1 SLOT3, SR=0xf
YM CH1 SLOT3, SL=0x0, RR=0xf
YM CH1 SLOT3, SSG=0x8

I wonder how this is supposed to sound ? Is it supposed to repeatetely restart a very fast Substain again and again (again, the frequency is modified several time to distort the sound)?

Generally speaking, it would be interesting to know how the Enveloppe Generator behaves in some extreme case or when events (key ON/OFF) occurs at uncommmon moment (key OFF/ON during attack, key ON with attenuation level being still very low,...)

Also I wonder if the TL level could have some effect when looking for transition between decay & substain ?

Sorry to be a little off-topic again, thi swould be betterin the YM2612 thread maybe :oops:

Post Reply