Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ogre Battle Gaiden: Zenobia no Ouji. No sound when meet a enemy. #48

Closed
leoxxx opened this issue Oct 29, 2018 · 5 comments
Closed

Ogre Battle Gaiden: Zenobia no Ouji. No sound when meet a enemy. #48

leoxxx opened this issue Oct 29, 2018 · 5 comments

Comments

@leoxxx
Copy link

leoxxx commented Oct 29, 2018

It's no problem in NGP.EMU.
When meet a enemy, play a nosie sound till battale beginning in NEOPOP.

@stellarporter
Copy link
Contributor

On NGP.EMU, it plays the entire digitized speech correctly?

With NEOPOP, I get partial speech and then glitched until battle tune starts.

Latest Mednafen gets broken speech + no battle music / sfx either (same with Beetle core). Guess I'll ping Mednafen author again if I get somewhere.

@stellarporter
Copy link
Contributor

stellarporter commented Mar 30, 2019

NGP.EMU = incorrect. No DAC speech: Fight it out, Liberation, Lucky, Boo Boo, Thank you, etc.

This looks to be a hard one.

DIS  366DF3: DEC 1,XDE               "EA 69"
DIS  366DF5: LD (0x6E90),XDE         "F1 90 6E 62"  ==  DAC counter  [1a34]

DIS  366DF9: LD W,A                  "C9 88"
DIS  366DFB: LD (0xA2),WA            "F0 A2 50"
DIS  366DFE: LD (0x6E8C),XHL         "F1 8C 6E 63"  ==  DAC src  [2b0e88]

DAC src and/or counter gets reset to new values in the middle of playback, causing static and garble. It's random but very likely to trigger. At best, you'll hear most of the speech sample or some of it. Usually you get trash. And if unlucky, it never stops trashing and carries over everywhere.

Created a dirty, ugly Ogre Battle hack for NEOPOP that will pretty often play speech correctly. Inside TLCS900h_interpret, we can save those 2 ram values before executing opcode. If opcode changes it to bad values, we rewind ram values back again.

Not so likely I'll find cause of this error, maybe ever. And not too interested in figuring it out given difficulty. But I will try merging this into beetle core. Leave it to core maintainers whether to accept such hack.

edit: Better idea. Do checks in storeL.

@leoxxx
Copy link
Author

leoxxx commented Mar 30, 2019

@stellarporter
I don't understand these assemble. Maybe you're right.
I‘m sure you're right. Because Neo Geo World Cup 98 Plus no speech in NGP.EMU.

@stellarporter
Copy link
Contributor

stellarporter commented Mar 30, 2019

@leoxxx
Don't worry. Just writing up everything for documentation. When someone smarter comes around and picks up the notes.

You can test the Windows fix here. (edit: new link)
https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23469499

I'll add it later for the Android tester kits.

@ghost
Copy link

ghost commented Apr 7, 2019

While the hack works, this is the fix we need:

void interrupt(uint8_t index, uint8_t level)
{
   push32(pc);
   push16(sr);

   //Up the IFF
   if (level < 7) level++;
   setStatusIFF(level);

   //Access the interrupt vector table to find the jump destination
   pc = loadL(0x6FB8 + index * 4);
}

We are supposed to raise the firing interrupt by 1, not the actual current IFF. This will prevent game from firing IRQs inside the DAC IRQ routine, which breaks the speech.

As I do not know the interrupt levels, I am hesitant to submit an actual fix to the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants