finalburnneo / FBNeo

FinalBurn Neo - We are Team FBNeo.
http://neo-source.com
Other
945 stars 369 forks source link

MidWay engine - video bug #976

Closed BeWorld2018 closed 2 years ago

BeWorld2018 commented 2 years ago

My config: PowerPC / MorphOS / SDL2 (all renderer: opengl, renderer opengl and renderer software)

All games are glished (see screenshot), not sur if BigEndian bug. All others engines arer ok here.

i find ticket on mame testers (seem releated) on https://mametesters.org/view.php?id=5007

fbneo_midway fbneo_midway2 fbneo_midway3

barbudreadmon commented 2 years ago

not sur if BigEndian bug

Not happening on normal hardware, so a big endian issue is the most likely. @crystalct are you having the same issue ?

crystalct commented 2 years ago

No prob. image

barbudreadmon commented 2 years ago

@crystalct and @BeWorld2018, which macros are you using ? there have been several issues that were related to the usage of one or the other macro. It might be a good idea to use the GCC's __builtin_bswap functions since i believe they are the most standardized from a platform to another.

crystalct commented 2 years ago
#define BURN_ENDIAN_SWAP_INT8(x)                (x^1)
#define BURN_ENDIAN_SWAP_INT16(x)               ({uint16_t tt; __sthbrx(&tt, x); tt;})
#define BURN_ENDIAN_SWAP_INT32(x)               ({uint32_t tt; __stwbrx(&tt, x); tt;})

They are correct, fast and specific for CELL processor

crystalct commented 2 years ago
#define __sthbrx(base, value) do {          \
    typedef  struct {char a[2];} halfwordsize;      \
    halfwordsize *ptrp = (halfwordsize*)(void*)(base);      \
    __asm__ ("sthbrx %1,%y0"                \
       : "=Z" (*ptrp)               \
       : "r" (value));              \
   } while (0)

#define __stwbrx(base, value) do {      \
    typedef  struct {char a[4];} wordsize;  \
    wordsize *ptrp = (wordsize*)(void*)(base);      \
    __asm__ ("stwbrx %1,%y0"            \
       : "=Z" (*ptrp)           \
       : "r" (value));          \
   } while (0)
crystalct commented 2 years ago

Since BURN_ENDIAN_SWAP_INT are defined by checking #ifdef , for PS3 environment there are no problems.

barbudreadmon commented 2 years ago

@crystalct could you test with the __builtin_bswap functions ? I think that's what @BeWorld2018 is using

crystalct commented 2 years ago

No __builtin_bswap macro or function on old PS3 SDK

barbudreadmon commented 2 years ago

what about psl1ght ?

BeWorld2018 commented 2 years ago

For me, i test my build pass into GNUC for endian :

define BURN_ENDIAN_SWAP_INT8(x) (x^1)

define BURN_ENDIAN_SWAP_INT16(x) (__builtin_bswap16(x))

define BURN_ENDIAN_SWAP_INT32(x) (__builtin_bswap32(x))

define BURN_ENDIAN_SWAP_INT64(x) (__builtin_bswap64(x))

barbudreadmon commented 2 years ago

@vaguerant do you have that issue on wiiu ? iirc you use the builtin gcc functions too.

crystalct commented 2 years ago

On old PSL1GHT (most used - gcc4.1) it's not present. No include or libraries. On current PSL1GHT (gcc7.2) yes

vaguerant commented 2 years ago

@vaguerant do you have that issue on wiiu ? iirc you use the builtin gcc functions too.

Nope, I cannot reproduce this issue on Wii U. I tested nbajamte on 5ad211c. I did have the "Invalid CMOS" error on first boot, but I suspect that's normal with uninitialized saves and it does not occur on subsequent boots. The splash screens, e.g. "Tournament Edition Features" (third screenshot in issue filing) look normal and gameplay looks and works fine, albeit not quite full speed on Wii U. I also tested nbajam since I already had it on my SD card and saw no issues there either.

barbudreadmon commented 2 years ago

Hmmm ok, looks like an issue specific to the platform then, maybe the compiler is doing something weird ?

@BeWorld2018 What's the compiler (with version) on this morphos thing ?

BeWorld2018 commented 2 years ago

i use last SDK : https://www.morphos-team.net/news (9 March) I use GCC 11, but i test with GCC 10 and GCC 9 same....

barbudreadmon commented 2 years ago

@BeWorld2018 Maybe you are using a bad dump ? I don't think the sdl2 port prevents you from launching bad dumps.

If that's not the issue then sorry but i don't think i'll be able to help you, that's an issue specific to your platform and i don't have access to this platform. You'll probably have to debug this by yourself.

BeWorld2018 commented 2 years ago

arffff... i continue to test in my side... thanks for your help.