ClassiCube
ClassiCube copied to clipboard
GameCube version does not compile?
No matter what I do, I cannot get the GameCube version to compile under MinGW-W64, even though I have installed LiboGC and the other required things. The error looks like this:
User@GK-PC MINGW64 ~/ClassiCube $ make gamecube make -f Makefile_gamecube PLAT=gamecube make[1]: Entering directory '/home/User/ClassiCube' make[1]: Makefile_gamecube: No such file or directory make[1]: *** No rule to make target 'Makefile_gamecube'. Stop. make[1]: Leaving directory '/home/User/ClassiCube' make: *** [Makefile:157: gamecube] Error 2
I guess the makefile for GameCube does not exist?
I might be wrong but I don't think GameCube/Wii are buildable at this point in time
Ok, thanks for letting me know. I'll have to pay attention to see when they become buildable. Thanks for your reply.
You should be able to build for Wii/GameCube (although I may sometimes accidentally break them unintentionally)
It's due to a mistake in the main makefile which I forgot to fix in the actual live code (I only fixed the copy in my testing VM)
If you look at the wii
entry, you'll notice it is structured like this:
wii:
$(MAKE) -f src/Makefile_wii ...
Whereas the gamecube
entry is structured like this:
gamecube:
$(MAKE) -f Makefile_gamecube ..
Changing it to src/Makefile_gamecube
instead should fix the error
(I have only tested compiling Wii/GameCube builds on Linux though)
Ok, I tried that, and came up with this:
linking ... ClassiCube-gc.elf
c:/msys64/opt/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: c:/msys64/opt/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: DWARF error: can't find .debug_ranges section.
C:/msys64/opt/devkitpro/libogc/lib/cube\libogc.a(lwp_threads.o): in function __lwp_thread_start': lwp_threads.c:(.text.__lwp_thread_start+0xce): undefined reference to
__sf'
c:/msys64/opt/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: lwp_threads.c:(.text.__lwp_thread_start+0xd6): undefined reference to `__sf'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/devkitPPC/gamecube_rules:30: ClassiCube-gc.elf] Error 1
make[1]: Leaving directory '/home/User/ClassiCube'
make: *** [Makefile:157: gamecube] Error 2
Any ideas?
Update: Nevermind, I was using the wrong MSYS install. I had to use the DevkitPRO version, then it built correctly.
Well, starting it up gives this error:
Is this supposed to happen?
Is this supposed to happen?
It isn't, although the GameCube build hasn't been tested on real hardware before (as far as I know), so I probably did something wrong that doesn't work on real hardware
If you can, please upload or send me your ClassiCube-gc.elf
so I can look into the crash
Here: ClassiCube-gc.zip
Based on disassembling the provided .elf file, it's crashing in the mkdir
function due to trying to create a directory on an invalid device (probably because there's no SD card)
Although I has tried to work around this in the past by not calling mkdir
/open
etc if fatInitDefault
failed, I need to do something more than just that (because e.g. fatInitDefault
may succeed, but be mounted on memory card 0 instead of SD card)
Although probably not of interest, here's what I did to work that out:
- Open up
ClassiCube-gc.elf
in Ghidra - Based on the core dump, the address of the instruction crashed was probably
0x800b59bc
- Navigated to
0x800b59bc
in Ghidra and verified that the instructions there did indeed match the values in the core dump - Cleaned up the decompiled
mkdir
code a bit by renaming some variables - Became suspicious of the fact that
mkdir
accesseddevoptab_list
without checking device ID is >= 0 - Checked whether
FindDevice
can return-1
in some circumstances - and it can - Checked the PowerPC documentation for what CPU register is used to store a function return value, and it's
GPR03
. Hmmm - Working through the instructions from
FindDevice
to the crash, noticed that therlwinm
instruction was being used to multiplyGPR03
by 4, which would explain why it had the value of-4
(akaFFFFFFFC
) at the point of crash - Realised that I had just rediscovered the same problem I found 2 months ago, oops
Can you please try compiling and running this test program that prints the working directory?
https://gist.github.com/UnknownShadow200/af17394f87d13f19457d738239eacd47
Yes, I'll try that on my GameCube when I get home later. Also, I have SD cards in Serial port 2 and in an SD Gecko in Memory card slot A. I can try switching to slot B to see if that makes a difference, I know that some homebrew applications work better there.
It reports the current directory as Card A. Do I need to put any files on the card, like textures or other resources?
What's the full path that is being reported as the current directory?
Current directory: carda:/ It repeats this constantly.
Can you please try again with the latest commit? I tried to address this in c47f48d18750126b5d9af25b0487cdb0b723d891
Yes, I'll try that in a bit.
Got this error upon trying the latest commit.
Oops. The perils of trying to write code very late at night
Should be fixed with latest commit
Okay, it booted up this time. However, the game does not have any text, and all blocks are white. Also, the camera stick is the left stick and movement is done on the DPAD. I would suggest having the camera work on the right (c) stick and having movement on the left joystick. Also, camera acceleration is very slow. Pictures may look a bit strange because my phone camera really doesn't work that well with CRT displays.
If you try again with latest commit, launcher menus should display text now
For this line of code in Drawer2D.c
you'll probably also want to change false
to true
:
Drawer2D.BitmappedText = Game_ClassicMode || !Options_GetBool(OPT_USE_CHAT_FONT, false);
That way in-game should also display text too
Also, the camera stick is the left stick and movement is done on the DPAD. I would suggest having the camera work on the right (c) stick and having movement on the left joystick.
I've changed the camera to use the right stick instead, thanks for the suggestion
Having movement on the left joystick is a bit trickier - ClassiCube actually doesn't currently support joystick input for player movement, hence why I just use the DPAD currently
Also, camera acceleration is very slow.
Unfortunately, it's challenging for me to work out what joystick scaling factors should be used, as I am unable to test on real hardware myself
I would suggest altering the scaling factors in ProcessPAD_Game
in Window_GCWii.c
to see if you can get better behaviour
Event_RaiseRawMove(&PointerEvents.RawMoved, dx / 32.0f, dy / 32.0f);
Ok, text works now, but only on the title menu, and it errors when downloading resources, since it does not have internet connectivity. Can I get these resources and load them onto the SD card somehow? Also there is no deadzone for the joystick, so there is some drifting that happens. I was able to fix camera movement by reducing the values above. The Y-Axis was also inverted, so I fixed that. You could just bind D-pad controls to the left josytick for now, too, since the GameCube controller's D-pad is very tiny.
Event_RaiseRawMove(&PointerEvents.RawMoved, dx / 6.0f, dy / -6.0f);
Also set this to true:
Drawer2D.BitmappedText = Game_ClassicMode || !Options_GetBool(OPT_USE_CHAT_FONT, true);
This did not change in game text, the pause menu and inventory is still blank.
Ok, text works now, but only on the title menu, and it errors when downloading resources, since it does not have internet connectivity. Can I get these resources and load them onto the SD card somehow?
If ClassiCube was able to successfully access the SD card, then there should be a classicube
folder generated on the SD card. Inside that there should be a texpacks
folder, and you can copy either default.zip
or classicube.zip
from a PC copy of ClassiCube into that folder
Also set this to true:
Drawer2D.BitmappedText = Game_ClassicMode || !Options_GetBool(OPT_USE_CHAT_FONT, true);
This did not change in game text, the pause menu and inventory is still blank.
Maybe just do Drawer2D.BitmappedText = false;
@GK6475 Are you using an SD2SP2 or an SDgecko?
I am using both, technically, but I am booting from a GC-Loader. I just tried making a classicube folder on the SD Gecko and it worked. Textures appear now, and the original font loads. Sound doesn't work, however, and I cannot make any selections in the pause menu.
I cannot make any selections in the pause menu.
All the in-game menus are currently only really designed for using with mouse (or touch) input, so it will take me a bit more time to change them to work properly with controller input too
I've attempted to add a deadzone for the gamecube controller, and changed the scaling factors so that the camera is more responsive by default
Ok, that helps. What I did for the responsiveness was a value of 4.0f or 6.0f and I made the Y negative to make the camera feel more natural, similar to how it worked on the console versions of Minecraft. Also, after testing, the deadzone needs to be a little bigger, maybe around 5-10% of the stick or so.
I made the Y negative to make the camera feel more natural, similar to how it worked on the console versions of Minecraft. Also, after testing, the deadzone needs to be a little bigger, maybe around 5-10% of the stick or so.
Not sure if it's enough, but I tired increasing the deadzone
Y has also been inverted too now
That fixed the drift issues completely. Works much better now.
Is broadband adapter multiplayer support in the works? I don't own one but it would be really neat for the people that do.
Is broadband adapter multiplayer support in the works? I don't own one but it would be really neat for the people that do.
Yes. I own one and have been testing with it lately. It hasn't worked so far (testing over LAN for now) but eventually it probably will.