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

Trying to compile a split core for Midway arcade games for Wii. Kinda stuck when compiling the final dol. #1696

Open
saulfabregwiivc opened this issue Feb 23, 2024 · 10 comments

Comments

@saulfabregwiivc
Copy link

Hi there! :)
Seeing that i can still make split cores of MAME2003+, specifically for Wii, today i tried to compile a new core for the Wii, targeting Midway arcade games such Mortal Kombat.
(See saulfabregwiivc@f6a855d)

But i'm kinda stuck when compiling the final dol.

I get these error messages when compiling the final dol for the Wii:

/opt/devkitpro/devkitPPC/bin/powerpc-eabi-g++ -oretroarch_wii.elf -DHW_RVL -mrvl -DGEKKO -mcpu=750 -meabi -mhard-float -Wl,-Map,retroarch_wii.elf.map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size -T bootstrap/gx/rvl.ld -Lwii/libogc/libs/wii -L. griffin/griffin.o  wii/app_booter/app_booter.binobj   -lretro_wii  -lwiiuse -lbte -logc
wii/libogc/libs/wii\libwiiuse.a(wpad.o): In function `__wpad_assign_slot':
wpad.c:(.text.__wpad_assign_slot+0x64): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_used'
wpad.c:(.text.__wpad_assign_slot+0xec): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_used'
wpad.c:(.text.__wpad_assign_slot+0xfc): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_used'
wpad.c:(.text.__wpad_assign_slot+0x104): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_used'
wpad.c:(.text.__wpad_assign_slot+0x11c): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads'
wpad.c:(.text.__wpad_assign_slot+0x12c): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_used'
wpad.c:(.text.__wpad_assign_slot+0x134): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_used'
wpad.c:(.text.__wpad_assign_slot+0x14c): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads'
wii/libogc/libs/wii\libwiiuse.a(wpad.o): In function `__readlinkkey_finished':
wpad.c:(.text.__readlinkkey_finished+0x14): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_ponded'
wii/libogc/libs/wii\libwiiuse.a(wpad.o): In function `__wpad_init_finished':
wpad.c:(.text.__wpad_init_finished+0xd0): relocation truncated to fit: R_PPC_EMB_SDA21 against `.sbss.__wpads_inited'
wpad.c:(.text.__wpad_init_finished+0xe4): additional relocation overflows omitted from the output
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile.griffin:1247: retroarch_wii.elf] Error 1

Since all the rest of the splitted cores compile fine, i gonna ask: am i doing something wrong, or what's happening here that i can't compile my custom split core?
Thanks. :)

@mahoneyt944
Copy link
Collaborator

mahoneyt944 commented Feb 24, 2024

relocation truncated to fit means the executable is too big. It will need stripped further to compile, though some driver requirements will still be too large just compiling the cpus.

You might try dividing the split cores further into yunit, wunit, xunit, tunit to reduce source files.

@saulfabregwiivc
Copy link
Author

@mahoneyt944 Thanks for the advice.

I tried reducing the drivers to only the Mortal Kombat 1 ones, and it compiled.
However, trying to load any ROM just crashed at a black screen, softlocking the Wii.
Same with the rest of the official split drivers.

Last time i compiled something of recent MAME2003+ for Wii, it worked fine in various games.

I think a bad commit broke big-endian support? (The Wii is a big-endian platform)

@mahoneyt944
Copy link
Collaborator

mahoneyt944 commented Feb 24, 2024

We haven't made any endian changes. What's probably happening is the core plus the game rom size is too big to fit into memory together.

If it's not working with the ones I made, it might be your compile environment. I built mine through the libretro buildbot, so I don't have advice to setup this environment. Might be able to ask on the libretro forums.

@saulfabregwiivc
Copy link
Author

What's probably happening is the core plus the game rom size is too big to fit into memory together.

I think @Wiimpathy said time ago he tried to implement "virtual memory" on Wii for be able to run larger ROMs on the Wii, by using some NAND memory as virtual RAM?
Have you guys tried to add that?
(See #1416 (comment) and other comments from Wiimpathy)

@arcadez2003
Copy link
Collaborator

arcadez2003 commented Feb 24, 2024

Im thinking it might be worth a try to create a split core just for the Midway Y-Unit games strip it down to just
the bare bones of what these games would require to function, the mem footprint for these ones would be less
than T or W Unit games as they're not using the DCS sound which is a large and resourse eating soundcore.

You'd still get Mortal Kombat 1 as some versions of that game are on the Y board

EDIT

I forgot all games in the T-Unit driver barring Mortal Kombat 2 dont require the DCS sound so it would be easy to
just remove mk2 and related DCS code from the tunit driver remove the dcs sound from the core and see if that will
leave enough mem for the still supported games in the Y and T unit drivers to work.

Ofcourse a virtual memory hookup for these games would be the ideal scenario.

@mahoneyt944
Copy link
Collaborator

Virtual memory would be beneficial in some games. That might take a deal of work to implement it in a way that's reasonable though.

@grant2258
Copy link
Contributor

seems the code is already done from the links #1696 (comment) . It also seems its limited to one region for a specific fix would be simple to implement globally with Wiimpathys permission.

@Wiimpathy
Copy link

You're absolutely free to use this code and to improve it. That was already used and more polished in fbalpha2012_neogeo.
But the games that consume a lot of RAM may also suffer from the Wii slow CPU.

@grant2258
Copy link
Contributor

Thats great news @Wiimpathy por permission to use the code. @mahoneyt944 the region mallocs where the patch addresses this needs to be done globally and the auto_mallocs if you choose to add it. Thankfully the hard works been done! You will probably need testers when doing this as well.

@saulfabregwiivc
Copy link
Author

You will probably need testers when doing this as well.

If you need beta testers i can help with that.
I sometimes do tests of new Wii apps or homebrew in my free time.

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

5 participants