[Solved] Sound errors when compiling wii mahjong
July 08, 2014 07:17AM
I obtained the source for 0.97 of wii mahjong from here: [github.com]

I have never compiled wii software before, and I don't consider myself a programmer, but I thought I would try to compile wii mahjong with the newest devkitPro so that it will work with the newest wii remotes. Unfortunately I get the following errors when I run make:

linking ... wii-mahjong-master.elf
c:/devkitPro/libogc/lib/wii\libmodplay.a(gcmodplay.o): In function `SndBufStart': /Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:164: undefined reference to `AESND_SetVoiceStop'
c:/devkitPro/libogc/lib/wii\libmodplay.a(gcmodplay.o): In function `__aesndvoice callback':/Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:80: undefined reference to `AESND_SetVoiceBuffer'
c:/devkitPro/libogc/lib/wii\libmodplay.a(gcmodplay.o): In function `SndBufStop': /Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:180: undefined reference to `AESND_SetVoiceStop'
c:/devkitPro/libogc/lib/wii\libmodplay.a(gcmodplay.o): In function `MODPlay_Init':
/Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:230: undefined reference to `AESND_AllocateVoice'
/Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:232: undefined reference to `AESND_SetVoiceFormat'
/Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:233: undefined reference to `AESND_SetVoiceFrequency'
/Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:234: undefined reference to `AESND_SetVoiceVolume'
/Users/davem/projects/devkitpro/libogc/libmodplay/gcmodplay.c:235: undefined reference to `AESND_SetVoiceStream'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [/c/wii-mahjong-master/wii-mahjong-master.elf] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/c/wii-mahjong-master'
make: *** [wiimahjongg.dol] Error 2


Since this is erroring in the libogc stuff instead of the source code I downloaded...I don't know what to do. Hopefully someone here can tell me what is wrong, and help me compile it successfully.



Edited 1 time(s). Last edit at 07/18/2014 03:15PM by pharmville.
Re: sound errors when compiling wii mahjong
July 08, 2014 10:55AM
Try adding -laesnd to LIBS variable in Makefile.DevKit file. Try different positions in the list order.
Re: sound errors when compiling wii mahjong
July 09, 2014 07:49AM
Thank you for your expert advice. It compiles successfully when I add -laesnd to the end. Now I have another problem...the dol loads to a black screen or sometimes just crashes instead.
Re: sound errors when compiling wii mahjong
July 10, 2014 08:24PM
It means that there is a problem in the code or in the compilation. It is very difficult to find the reason.
Re: sound errors when compiling wii mahjong
July 11, 2014 07:05AM
Quote
oibaf
It means that there is a problem in the code or in the compilation. It is very difficult to find the reason.

I expected to hear this. I do want to dig deeper into this, but I have to put this project on hold for about a week because I don't have time to look into it right now. If I ever figure out a solution though, I will post it here. I'll gladly take any future suggestions, since my skills in this area are limited.

One last thing, here is the dump screen for your reference:

pic of my tv
Re: sound errors when compiling wii mahjong
July 11, 2014 02:58PM
You have to put the option -g in CFLAGS and LDFLAGS variables in Makefile.DevKit file before compiling and then use this command:

powerpc-gekko-addr2line -e wiimahjongg.elf

If you insert the address indicated in the Stack dump of the dump screen (the first one of the list) you obtain the instruction which raised the exception. Also the other addresses are useful.

More details in:

[wiibrew.org]
Re: sound errors when compiling wii mahjong
July 15, 2014 03:01AM
I just get question marks from doing that. (?:?? or something like that). I wonder if the exception is happening in one of the libraries outside of the code I downloaded. I think I'm going to try porting the code to the latest GRRLIB since it is trying to use a really old version. I've got a lot of reading to do. If I get anywhere with it I will report back.
Re: sound errors when compiling wii mahjong
July 16, 2014 04:05PM
Quote
pharmville
I just get question marks from doing that. (?:?? or something like that). I wonder if the exception is happening in one of the libraries outside of the code I downloaded.

It is likely that it is in the libraries.
Re: sound errors when compiling wii mahjong
July 18, 2014 08:04AM
Yeah...I'm not going to try converting the code to use the latest grrlib...WAY too much needs to change, and I'm not sure how to deal with a few of the depreciated functions, most notably GRRLIB_GPrintf(). But I do have good news.

Partially solved! Now my new wiimote plus works inside the game, along with my old remotes. All I did was downgrade to devkitPPC r25 and libogc 1.8.10 (a version that still supports the newest wii plus remotes). When i downgraded and compiled, I was able to run the resulting dol on my wii without any crashes.

I say partially solved because the music doesn't play in my compiled version anywhere in the game. The music comes from .mod files. Sound effects do work though, and everything else seems to work. I don't really care about the music, but I'll still see if I can figure out what went wrong for curiosity sake. If I get the music working I will see if I can add a download link for my .dol on the bottom of the wii mahjongg wiki page.
Re: sound errors when compiling wii mahjong
July 18, 2014 08:42AM
Solved! I used an older version of the modplay code (2009 era cant remember) and pasted it into the latest libogc and recompiled. Now bug free.
Sorry, only registered users may post in this forum.

Click here to login