scognito / wiicross

A funny puzzle game available for Nintendo Wii and Gamecube
https://scognito.wordpress.com/2008/12/02/pieros-wiicross-for-wii-and-gamecube-is-out/
9 stars 5 forks source link

GameCube build? #1

Closed coolaj86 closed 10 months ago

coolaj86 commented 4 years ago

I've been searching for the GameCube build of this for a while and only just now stumbled upon the source here.

How does one get the GameCube build (not the Wii build)?

Update

Here's a nasty diff that builds for me: https://gist.github.com/coolaj86/2d87d975fdd27ce7fcbcffd29deda184

It's probably so nasty because there are probably a lot of junk build files in the original. I'll try to get all of my steps documented in the near future, and put into a PR. If I Slack off on that, please ping me.

pdivita commented 3 years ago

Unfortunately, the original site where all my projects were hosted is down and the mantainer didn’t respond. You can install the toolchain and build it yourself. I did ages ago and forgot how to do that. Here is a tutorial though. Are you a retrogaming fan? Italiano?

coolaj86 commented 3 years ago

Are you a retrogaming fan? Italiano?

Yes, and No. :)

I'm a big GameCube fan and I've been collecting and curating the different indie games and homebrew.

Here is a tutorial though.

I finally got around to trying to build this. I was able to get a Hello World going, and run it on the GameCube, so I know the toolchain is installed properly.

However, when I try to build wiicross I get an error.

git clone git@github.com:scognito/wiicross.git
pushd ./wiicross
make -f MakefileGc
levelSelect.c
In file included from /home/app/game-wiicross/include/levelSelect.h:1,
                 from /home/app/game-wiicross/source/levelSelect.c:1:
/home/app/game-wiicross/include/wiicross.h:10:10: fatal error: snd.h: No such file or directory
   10 | #include "snd.h"
      |          ^~~~~~~
compilation terminated.
make[1]: *** [/opt/devkitpro/devkitPPC/base_rules:18: levelSelect.o] Error 1
make: *** [MakefileGc:101: build] Error 2

I haven't done C code in ages, and it was never that fun to begin with, but since I don't see an exact match for libsnd.h I'm guessing that perhaps the library has been renamed?

/opt/devkitpro/libogc/lib/wii/libasnd.a
/opt/devkitpro/libogc/lib/wii/libaesnd.a
/opt/devkitpro/libogc/lib/cube/libasnd.a
/opt/devkitpro/libogc/lib/cube/libaesnd.a
/opt/devkitpro/libogc/include/asndlib.h
/opt/devkitpro/libogc/include/aesndlib.h

Do you have any immediate thoughts on what I might need to do?

Would you be willing to get on a call and step through with me?

Or if you give me an SSH public key I could let you into the linux box that is all set up for such development.

Other notes (to self)

pushd ./tremor/
# manuall remove occurrences of `--enable-maintainer-mode`
bash ./automake.sh
make
diff --git a/MakefileGc b/MakefileGc
index 6ddc6dd..a75e42a 100644
--- a/MakefileGc
+++ b/MakefileGc
@@ -34,7 +34,8 @@ LDFLAGS       =       -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
 # any extra libraries we wish to link with the project
 #---------------------------------------------------------------------------------
 #LIBS  := -lfat -lmodplay -lmad -logc -lpng -lz -lm
-LIBS   := -lfat -lmodplay -lmad -logc -lpng -lz -lm  ../lib/libtremor.a
+LIBS   := -lfat -lmodplay -lasnd -lmad -logc -lpng -lz -lm -ltremor
+#../lib/libtremor.a

 #---------------------------------------------------------------------------------
 # list of directories containing libraries, this must be the top level containing
diff --git a/include/oggplayer.h b/include/oggplayer.h
index 7328288..0344f6b 100644
--- a/include/oggplayer.h
+++ b/include/oggplayer.h
@@ -28,7 +28,7 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-#include "snd.h"       // sound library
+#include "asndlib.h"       // sound library

 #include "../tremor/ivorbiscodec.h"
 #include "../tremor/ivorbisfile.h"
diff --git a/include/wiicross.h b/include/wiicross.h
index 2abf141..0320f62 100644
--- a/include/wiicross.h
+++ b/include/wiicross.h
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include <string.h>
 //#include <mp3player.h>
-#include "snd.h"
+#include "asndlib.h"
 #include <fat.h>

 #include "libscognito.h"
diff --git a/include/png.h b/include/png.h
index 2e194b7..a4cfe21 100644
--- a/include/png.h
+++ b/include/png.h
@@ -437,7 +437,7 @@

 #ifndef PNG_VERSION_INFO_ONLY
 /* include the compression library's header */
-#include "zlib.h"
+#include "/opt/devkitpro/portlibs/ppc/include/zlib.h"
 #endif

 /* include all user configurable info, including optional assembler routines */
diff --git a/MakefileGc b/MakefileGc
index 6ddc6dd..3c968c5 100644
--- a/MakefileGc
+++ b/MakefileGc
@@ -33,14 +33,14 @@ LDFLAGS     =       -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
 #---------------------------------------------------------------------------------
 # any extra libraries we wish to link with the project
 #---------------------------------------------------------------------------------
-#LIBS  := -lfat -lmodplay -lmad -logc -lpng -lz -lm
-LIBS   := -lfat -lmodplay -lmad -logc -lpng -lz -lm  ../lib/libtremor.a
+LIBS   := -lfat -lmodplay -lasnd -laesnd -lmad -logc -lpng -lz -lm ../lib/libtremor.a
+#LIBS   := -lfat -lmodplay -lasnd         -lmad -logc -lpng -lz -lm ../lib/libtremor.a

 #---------------------------------------------------------------------------------
 # list of directories containing libraries, this must be the top level containing
 # include and lib
 #---------------------------------------------------------------------------------
-LIBDIRS        := $(CURDIR)
+LIBDIRS        := $(CURDIR) $(PORTLIBS)

 #---------------------------------------------------------------------------------
 # no real need to edit anything past this point unless you need to add additional
@@ -98,7 +98,7 @@ export OUTPUT :=      $(CURDIR)/$(TARGET)
 #---------------------------------------------------------------------------------
 $(BUILD):
        @[ -d $@ ] || mkdir -p $@
-       @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
+       @make --no-print-directory -C $(BUILD) -f $(CURDIR)/MakefileGc

 #---------------------------------------------------------------------------------
 clean:
sudo dkp-pacman -S ppc-zlib
export PORTLIBS_PATH=/opt/devkitpro/portlibs
coolaj86 commented 3 years ago

Update

Making a few changes and hard-coding a few values (as noted above) I was able to get to a point of linker errors:

/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld: optionScreen.o:/home/app/game-wiicross/source/../include/wiicross.h:185: multiple definition of `song'; levelSelect.o:/home/app/game-wiicross/include/wiicross.h:185: first defined here
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld: optionScreen.o:/home/app/game-wiicross/source/../include/wiicross.h:169: multiple definition of `wpads'; levelSelect.o:/home/app/game-wiicross/include/wiicross.h:169: first defined here
...
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld: storage.o:/home/app/game-wiicross/source/../include/libscognito.h:27: multiple definition of `systemReset'; levelSelect.o:/home/app/game-wiicross/include/libscognito.h:27: first defined here
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld: cannot find -lwiiuse
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld: cannot find -lbte
/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld: cannot find -lz

But I'm not clear where to go from there. I know that libz is installed in the devkit tools. I don't know if the Makefile needs to change in some way to understand that.

Another Update

Well, well, well. Looky what we have here!

Screen Shot 2021-05-01 at 4 28 46 AM

I had to do a bunch of hacky things to get this to work (10 years of bitrot and all that). I'll try to clean it up and make a PR.

coolaj86 commented 3 years ago

I'll make the PR, but here's a working binary just in case I get hit by a bus before then. :)

wiicross-gc.zip

scognito commented 3 years ago

Thank you and thanks for the work!

MethodOrMadness commented 2 years ago

@coolaj86 i was wondering if you got around to making that PR, as ive been trying to build this for a bit and cant seem to get it working, and your patch seems to fail(atleast on my machine running linux)

scognito commented 10 months ago

Thank you guys! Merged :)