Author Topic: FB Alpha 0.2.97.43 Bug Reports  (Read 479038 times)

Offline jan_klaassen

  • FBNeo Dev
  • ******
  • Posts: 315
  • Karma: +10/-0
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #840 on: December 04, 2017, 02:45:47 PM »
IIRC the speed hack was put in for s1945p specifically. in the stone age when cpu speed was still measured in MHz. (That game talks to the sound cpu differently from other neo geo games, and requires the emulation to switch back and forth between the emulated cpus a lot).

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #841 on: December 06, 2017, 01:55:24 AM »
Actually, with or without the speedhack, karnovr doesn't seem to have music in selection screen and ingame when using mvs bios. aes and unibios seems fine though.

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #842 on: December 06, 2017, 08:20:38 AM »
Actually, with or without the speedhack, karnovr doesn't seem to have music in selection screen and ingame when using mvs bios. aes and unibios seems fine though.

I remember fixing this problem in karnovr, but, I don't know where the fix is.  I checked the entire neogeo svn history and I don't see it.  IIRC it was something to do with irq's getting skipped.  If it comes back to me, I'll say something :)  but verify: 2610 soundcore & interface, z80 interface and cpu core are all up to date.  It seems like the only thing I can find relating to it is: http://http://neo-source.com/index.php?topic=2879.msg21278#msg21278

best regards,
- dink

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #843 on: December 07, 2017, 01:52:54 AM »
I remember fixing this problem in karnovr, but, I don't know where the fix is.  I checked the entire neogeo svn history and I don't see it.  IIRC it was something to do with irq's getting skipped.  If it comes back to me, I'll say something :)  but verify: 2610 soundcore & interface, z80 interface and cpu core are all up to date.  It seems like the only thing I can find relating to it is: http://http://neo-source.com/index.php?topic=2879.msg21278#msg21278

best regards,
- dink
Could it be related to those 2 commit ?
https://github.com/libretro/fbalpha/commit/c197019873817680fda27d8e8fbdb9b5e5129e5c
https://github.com/libretro/fbalpha/commit/310d3e2a8d9eb65e2495faae28302f497266ecb2

That's the 2 hotfix you gave me for s1945p in february, Karnov's irq issue was mentioned in the code before the changes.

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #844 on: December 07, 2017, 07:24:16 AM »
barbudreadmon, ahh yes - now I remember - after properly fixing the Z80's ZetRunEnd() also fixed karnovr (without having to disable ZetRunEnd() of course).  I can confirm karnovr is working in FBA with or without speedhacks using the default dips, though.  I wish I had some helpfull information for you, but, this is a strange one.

best regards,
- dink

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #845 on: December 07, 2017, 09:34:27 AM »
barbudreadmon, ahh yes - now I remember - after properly fixing the Z80's ZetRunEnd() also fixed karnovr (without having to disable ZetRunEnd() of course).  I can confirm karnovr is working in FBA with or without speedhacks using the default dips, though.  I wish I had some helpfull information for you, but, this is a strange one.

best regards,
- dink
Hmm the neogeo driver in lr-fbalpha should be in sync with the one in standalone fbalpha, so perhaps some kind of issue related to the compiler/cflags ? Did you use gcc or msvc for your test ? And if gcc, which version ? I'll also try without the -O3 cflag when i'm back home.

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #846 on: December 07, 2017, 11:06:03 AM »
Hmm the neogeo driver in lr-fbalpha should be in sync with the one in standalone fbalpha, so perhaps some kind of issue related to the compiler/cflags ? Did you use gcc or msvc for your test ? And if gcc, which version ? I'll also try without the -O3 cflag when i'm back home.

The ZetRunEnd fix would be in the Z80 Interface/Core though - so external to the driver itself....
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: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #847 on: December 07, 2017, 11:07:29 AM »
Hmm the neogeo driver in lr-fbalpha should be in sync with the one in standalone fbalpha, so perhaps some kind of issue related to the compiler/cflags ? Did you use gcc or msvc for your test ? And if gcc, which version ? I'll also try without the -O3 cflag when i'm back home.

I'm using gcc 4.8.1 with -O3 here, I wonder about this :/  do any errors/warnings come up when compiling?  can you try asan-ing it?

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #848 on: December 08, 2017, 02:10:53 AM »
My bad, it seems an old karnovr.fs was at fault here, i should have tried removing it first.

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #849 on: December 08, 2017, 09:10:09 AM »
No problem, I'm relieved to know it was something simple :)

best regards,
- dink

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #850 on: December 08, 2017, 05:57:18 PM »
I was wrong, removing karnovr.fs didn't solve this issue, and i think i was finally able to reproduce this issue consistently :

1. start the game (any mvs or unibios arcade)
2. insert coin so that the game go to the title screen
3. wait for title screen music to start, immediately insert coin => music stop
4. process further by pressing start, there is no music

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #851 on: December 08, 2017, 08:22:08 PM »
barbudreadmon, I can't reproduce that here at all using MVS USA ver.5 2slot, MVS Asia Europe ver.6 2slot, Universe Bios v3.0.  I tried it 10 times for each bios just to make sure.   These tests were made with "#undef USE_SPEEDHACKS".  I also tried twice with Unibios and the default "MVS Asia/Europe ver.6" with the speedhacks enabled, and still no problem.  I'm really not sure what's going on :/

best regards,
- dink

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #852 on: December 09, 2017, 02:57:24 AM »
Weirdest issue ever :
- The guy who reported this get no sound when in non-aes mode, whatever he does
- I get music as long as i don't press coin when the title screen music is running
- You don't have this issue at all.

I'll try to get to the bottom of this, perhaps using different gcc version with various sanitizer will help.

Also, this is the other thing that comes to mind, perhaps it is worth mentioning the audio settings described here are hardcoded in the libretro port.

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #853 on: December 09, 2017, 06:25:54 AM »
- Same issue with all audio sample rate and interpolation settings i tried
- Same issue with every arch and gcc i tried (arm x86_64, gcc-4 gcc-5 gcc-6, sadly i don't have a x86_32 test bed)
- Same issue with any c(xx)flags i tried
- Asan didn't say anything
- Ubsan said the following but i remember you told me it was normal behavior from the m68k (every m68k game output the same iirc) :
Code: [Select]
src/cpu/m68000_intf.cpp:394:48: runtime error: load of misaligned address 0x0000021e151a for type 'UINT32', which requires 4 byte alignment
0x0000021e151a: note: pointer points here
 02 00  f9 4e c1 00 02 00 f9 4e  c1 00 02 00 f9 4e c1 00  02 00 f9 4e c1 00 02 00  f9 4e c1 00 02 00
              ^
src/cpu/m68000_intf.cpp:457:39: runtime error: store to misaligned address 0x000002294ede for type 'UINT32', which requires 4 byte alignment
0x000002294ede: note: pointer points here
 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00
             ^
src/cpu/m68000_intf.cpp:413:47: runtime error: load of misaligned address 0x0000021f148a for type 'UINT32', which requires 4 byte alignment
0x0000021f148a: note: pointer points here
 04 00  d0 4e c1 00 96 03 c1 00  32 04 c1 00 9a 04 c1 00  52 04 c1 00 c8 04 c1 00  e2 04 c1 00 fc 04
              ^
src/burn/snd/fm.c:1526:65: runtime error: left shift of negative value -577
src/burn/snd/fm.c:1147:68: runtime error: left shift of negative value -581
src/cpu/m68k/m68kops.c:8228:16: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
The first 5 appear on bios screen, the last one when you enter select character screen, none appear on the title screen

All tests with the speedhack disabled. Deleted my karnovr.fs file a couple of times too.
At this point i don't know what to do anymore.

For what it's worth, i captured a video at default settings, in case something comes to mind.

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: FB Alpha 0.2.97.42 Bug Reports
« Reply #854 on: December 09, 2017, 08:17:27 AM »
barbudreadmon, Just a guess, but this might be the problem:
src/cpu/m68k/m68kops.c:8228:16: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

code: uint mask = 1 << (OPER_I_8() & 0x1f);

uint is defined as "unsigned int" in m68kcpu.h.  that should be ok.  1<<31 or 1<<0x1f is the top bit in a 32bit int, so that should also be ok.  But if it can't set the top bit when it needs to - there's going to be a problem.
try to get rid of that error.  Some things I can think of... uint mask = ((uint) 1 << (OPER_I_8() & 0x1f)); .. maybe?  Does it work if you disable optimization for the 68k cpu?  if not, try disabling optimization for everything that neogeo requires (68k, z80, snd/*2610*, fm.c, drv/neogeo/*) and see if that helps. 

bye for now,
- dink