Help trying to update an old source (QuakeGX)

Post Reply
yummt
Posts: 4
Joined: Fri Mar 08, 2024 4:24 am

Help trying to update an old source (QuakeGX)

Post by yummt » Fri Mar 08, 2024 4:36 am

Hello,

I'm attempting to build QuakeGX for Wii, but run into issues while compiling. The output of msys2:

Code: Select all

$ make -f Makefile.wii
input.c
C:/msys64/home/user/quake-wii/src/wii/input.c:80:26: error: 'true' undeclared here (not in a functi
on)
   80 | bool wiimote_connected = true;
      |                          ^~~~
C:/msys64/home/user/quake-wii/src/wii/input.c:66:1: note: 'true' is defined in header '<stdbool.h>'
; did you forget to '#include <stdbool.h>'?
   65 | #include "input_wiimote.h"
  +++ |+#include <stdbool.h>
   66 |
Which is odd to me because "true" and "false" should be builtin C functions, right?

Here is the Makefile if that helps:


Thanks!

WinterMute
Site Admin
Posts: 1859
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Help trying to update an old source (QuakeGX)

Post by WinterMute » Sat Mar 09, 2024 12:53 am

yummt wrote: Fri Mar 08, 2024 4:36 am Which is odd to me because "true" and "false" should be builtin C functions, right?
No. bool is a C++ built in type which requires stdbool.h to use in C.

Here is the Makefile if that helps:
It doesn't, no. It's also not very useful to put these things on random filesharing sites. In our experience these things are prone to disappearing.
Help keep devkitPro toolchains free, Donate today

Personal Blog

yummt
Posts: 4
Joined: Fri Mar 08, 2024 4:24 am

Re: Help trying to update an old source (QuakeGX)

Post by yummt » Sat Mar 09, 2024 3:33 am

I got it to compile up to the linking stage.

Code: Select all

linking ... QuakeGX.elf
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libfat.a(disc.o): in function `get_io_wiisd':
/home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c:49:(.
text.get_io_wiisd+0x2): undefined reference to `__io_wiisd'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c
:49:(.text.get_io_wiisd+0x6): undefined reference to `__io_wiisd'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libfat.a(disc.o): in function `get_io_usbstorage':
/home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c:52:(.
text.get_io_usbstorage+0x2): undefined reference to `__io_usbstorage'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c
:52:(.text.get_io_usbstorage+0x6): undefined reference to `__io_usbstorage'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libfat.a(disc.o): in function `get_io_gcsda':
/home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c:56:(.
text.get_io_gcsda+0x2): undefined reference to `__io_gcsda'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c
:56:(.text.get_io_gcsda+0x6): undefined reference to `__io_gcsda'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libfat.a(disc.o): in function `get_io_gcsdb':
/home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c:60:(.
text.get_io_gcsdb+0x2): undefined reference to `__io_gcsdb'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libfat/src/libfat-1.2.0/libogc/../source/disc.c
:60:(.text.get_io_gcsdb+0x6): undefined reference to `__io_gcsdb'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(wpad.o): in function `__readlinkkey_finishe
d':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:283:(.text.__re
adlinkkey_finished+0x1c): undefined reference to `BTE_ApplyPatch'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(wpad.o): in function `__wpad_patch_finished
':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:274:(.text.__wp
ad_patch_finished+0x14): undefined reference to `BTE_InitSub'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(wpad.o): in function `__initcore_finished':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:293:(.text.__in
itcore_finished+0x30): undefined reference to `BTE_ReadStoredLinkKey'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(wpad.o): in function `WPAD_Shutdown':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:1139:(.text.WPA
D_Shutdown+0x110): undefined reference to `BTE_Shutdown'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(wpad.o): in function `WPAD_Init':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:715:(.text.WPAD
_Init+0x16c): undefined reference to `BTE_Init'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:716:(.tex
t.WPAD_Init+0x178): undefined reference to `BTE_SetDisconnectCallback'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/wpad.c:717:(.tex
t.WPAD_Init+0x184): undefined reference to `BTE_InitCore'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(io_wii.o): in function `__wiiuse_connected'
:
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:89:(.text.__w
iiuse_connected+0x80): undefined reference to `bte_disconnect'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(io_wii.o): in function `wiiuse_register':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:127:(.text.wi
iuse_register+0x50): undefined reference to `bte_new'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:131:(.t
ext.wiiuse_register+0x68): undefined reference to `bte_arg'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:132:(.t
ext.wiiuse_register+0x78): undefined reference to `bte_received'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:133:(.t
ext.wiiuse_register+0x88): undefined reference to `bte_disconnected'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:135:(.t
ext.wiiuse_register+0x9c): undefined reference to `bte_registerdeviceasync'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(io_wii.o): in function `wiiuse_disconnect':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:146:(.text.wi
iuse_disconnect+0x20): undefined reference to `bte_disconnect'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiiuse.a(io_wii.o): in function `wiiuse_io_write':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/wiiuse/io_wii.c:171:(.text.wi
iuse_io_write+0x10): undefined reference to `bte_senddata'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(keyboard.o): in function `KEYBOARD_Ini
t':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/keyboard.c:488
:(.text.KEYBOARD_Init+0x18): undefined reference to `USB_Initialize'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `_get_prot
ocol':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
130:(.text._get_protocol+0x5c): undefined reference to `USB_WriteCtrlMsg'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `_set_outp
ut_report':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
197:(.text._set_output_report+0x64): undefined reference to `USB_WriteCtrlMsg'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `USBKeyboa
rd_Close':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
391:(.text.USBKeyboard_Close+0x48): undefined reference to `USB_ClearHalt'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:392:(.text.USBKeyboard_Close+0x54): undefined reference to `USB_CloseDevice'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `USBKeyboa
rd_Open':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
243:(.text.USBKeyboard_Open+0x48): undefined reference to `USB_GetDeviceList'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:270:(.text.USBKeyboard_Open+0xcc): undefined reference to `USB_OpenDevice'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:273:(.text.USBKeyboard_Open+0xe0): undefined reference to `USB_GetDescriptors'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:324:(.text.USBKeyboard_Open+0x20c): undefined reference to `USB_FreeDescriptors'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:329:(.text.USBKeyboard_Open+0x214): undefined reference to `USB_CloseDevice'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:324:(.text.USBKeyboard_Open+0x2a0): undefined reference to `USB_FreeDescriptors'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:337:(.text.USBKeyboard_Open+0x2bc): undefined reference to `USB_GetConfiguration'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:351:(.text.USBKeyboard_Open+0x2f4): undefined reference to `USB_SetAlternativeInterface'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `_set_prot
ocol':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
142:(.text.USBKeyboard_Open+0x33c): undefined reference to `USB_WriteCtrlMsg'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `USBKeyboa
rd_Open':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
372:(.text.USBKeyboard_Open+0x368): undefined reference to `USB_DeviceRemovalNotifyAsync'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:344:(.text.USBKeyboard_Open+0x3ac): undefined reference to `USB_SetConfiguration'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: /home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeybo
ard.c:250:(.text.USBKeyboard_Open+0x3d0): undefined reference to `USB_CloseDevice'
C:/msys64/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld
.exe: C:/msys64/opt/devkitpro/libogc/lib/wii\libwiikeyboard.a(usbkeyboard.o): in function `_get_inpu
t_report':
/home/davem/projects/devkitpro/pacman-packages/libogc/src/libogc-2.5.0/libwiikeyboard/usbkeyboard.c:
156:(.text.USBKeyboard_Scan+0x50): undefined reference to `USB_ReadIntrMsg'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/devkitPPC/wii_rules:31: /home/tyler/quake-wii/QuakeGX.elf] Error 1
make: *** [Makefile.wii:95: obj] Error 2
Here is my makefile embedded:

Code: Select all

#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET		:=	QuakeGX
TARGETDIR   	:=  	dist/wii/apps/quake
BUILD		:=	obj
SOURCES		:=	src/wii \ src/wii/gx \ src/generic

INCLUDES	:=	$(DEVKITPRO)/libogc/include \
			$(DEVKITPRO)/libogc/include/ogc

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS	= -D_WII_ -DNOOPENGL -g -O3 -Wall $(MACHDEP) $(INCLUDE) `$(PREFIX)pkg-config --cflags sdl`
CXXFLAGS	=	$(CFLAGS) -std=c++03

LDFLAGS	=	-g $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:= -lasnd -logc -lfat -lbte -lwiiuse -ldb -lm -lwiikeyboard
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS	:= $(PORTLIBS)

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT	:=	$(CURDIR)/$(TARGETDIR)/$(TARGET)
export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir))
export DEPSDIR	:=	$(CURDIR)/$(BUILD)
export DEVKITPPC := $(DEVKITPPC)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
	
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
	export LD	:=	$(CC)
else
	export LD	:=	$(CXX)
endif

export OFILES	:=	$(CPPFILES:.cpp=.o) $(CFILES:.c=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE	:=	$(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					-I$(CURDIR)/$(BUILD) \
					-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
					-L$(LIBOGC_LIB)

export OUTPUT	:=	$(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
	@[ -d $@ ] || mkdir -p $@
	@[ -d $(TARGETDIR) ] || mkdir -p $(TARGETDIR)
	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.wii

#---------------------------------------------------------------------------------
clean:
	@echo clean ...
	@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
run:
	wiiload $(OUTPUT).dol

#---------------------------------------------------------------------------------
reload:
	wiiload -r $(OUTPUT).dol


#---------------------------------------------------------------------------------
else

DEPENDS	:=	$(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------

WinterMute
Site Admin
Posts: 1859
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Help trying to update an old source (QuakeGX)

Post by WinterMute » Sat Mar 09, 2024 4:06 pm

yummt wrote: Sat Mar 09, 2024 3:33 am I got it to compile up to the linking stage.

Code: Select all

linking ... QuakeGX.elf
This is just a link order problem.

Code: Select all

INCLUDES	:=	$(DEVKITPRO)/libogc/include \
			$(DEVKITPRO)/libogc/include/ogc
This part is wrong, these includes are handled automatically by stock Makefile. INCLUDES should just be blank here.

Code: Select all

LIBS	:= -lasnd -logc -lfat -lbte -lwiiuse -ldb -lm -lwiikeyboard

And this is the source of your link errors. -logc -lm should be at the end after all the rest of the libraries.

Code: Select all

LIBS	:= -lasnd -lfat -lbte -lwiiuse -ldb  -lwiikeyboard -logc -lm 

Code: Select all

export DEVKITPPC := $(DEVKITPPC)
This shouldn't be here either, this should be set in your environment. With your setup these should be added when you start the msys2 shell (there's a file that's read by bash shells in /etc/profile.d/devkit-env.sh)

That should hopefully get you built. Whether or not it actually works is another matter :P
Help keep devkitPro toolchains free, Donate today

Personal Blog

yummt
Posts: 4
Joined: Fri Mar 08, 2024 4:24 am

Re: Help trying to update an old source (QuakeGX)

Post by yummt » Sat Mar 09, 2024 4:41 pm

I appreciate the help! I did end up getting it to compile last night by referencing your GitHub and parsing newer wii projects' makefile and matching that.

The game boots up fine. Most things seem to be working, the biggest issue I see so far is missing parts of the viewmodel. Lighting, and BSP loading/drawing are working correctly though.

I'm going to try and compare the differences in libogc from the last time it was built to now. (Unless you know a better way to pinpoint toolchain changes to update sourcecode).

If it helps, one compilation error I had to fix was on a "Vector" define. I changed it to guVector, and that got it to compile but truthfully I don't know the implications of what that did.

I have no doubt that you know a better way to go about this than whatever I'd come up with.
Last edited by yummt on Sat Mar 09, 2024 4:44 pm, edited 1 time in total.

yummt
Posts: 4
Joined: Fri Mar 08, 2024 4:24 am

Re: Help trying to update an old source (QuakeGX)

Post by yummt » Sat Mar 09, 2024 5:30 pm

I can't figure out how to edit messages on here, but that Vector define is used in R_RotateForEntity, which is called in R_DrawAliasModel, so I'm fairly certain this most likely the problem area for alias viewmodel drawling. Im just not sure what the correct Vector define would be.

Before I changed it:

Code: Select all

Vector axis2 = {0,0,1};
My edit:

Code: Select all

guVector axis2 = {0,0,1};
Clearly this is wrong, by looking at the code it seems guVector is not what i need here. I'm going to look at other projects to see if there's an alternative or something I'm missing. Maybe I need to include another header and revert back to Vector?

WinterMute
Site Admin
Posts: 1859
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Help trying to update an old source (QuakeGX)

Post by WinterMute » Sun Mar 10, 2024 5:28 pm

Why is it clearly wrong?

Vector was changed to guVector to avoid collisions here https://github.com/devkitPro/libogc/com ... 1792cc4403 so I think that's right.

You can look at libogc commit messages for things that might be relevant to your compile errors although we were working with gcc 3/4 back then I think. We've also updated parts of libogc for changes in newlib, gcc and our newlib patches along the way. I expect old projects may well have some issues with latest gcc but usually it's a matter of getting rid of warnings.

What might be helpful is a list of the original compile errors. We might recognise something from the dim & distant past :P
Help keep devkitPro toolchains free, Donate today

Personal Blog

yummt
Posts: 4
Joined: Fri Mar 08, 2024 4:24 am

Re: Help trying to update an old source (QuakeGX)

Post by yummt » Tue Mar 12, 2024 4:17 pm

Well, I did end up getting it to compile and run successfully. I played through the first two levels with no noticeable issues. Since then I've started work on adding in some features from newer Quake engines, starting with HLBSP loading.

I've noticed with Quake sourceports they usually have a lot of warnings on compile. This one is of course no different, but I'm wondering if I should go through and attempt to get rid of those. By the original compilation errors, do you mean the ones I got from trying to compile the newest source? (2009ish) If so, you've pretty much seen it all. Reordering the libs and changing the Vector define was all that I ended up doing I believe. I also had a problem with true/false, but that was because of an #undef in common.h (what??)

I've also been struggling to translate GL calls for GX when porting features. I can't seem to find very much documentation on that.

WinterMute
Site Admin
Posts: 1859
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Help trying to update an old source (QuakeGX)

Post by WinterMute » Thu Mar 14, 2024 3:52 am

There's some doxygen generated documentation that can be found at https://libogc.devkitpro.org/index.html as well as some rough translations of the nehe tutorial code to GX in the supplied examples - found under <path to>/devkitpro/examples/wii/graphics/gx/neheGX. They're in our git repo at https://github.com/devkitPro/wii-exampl ... /gx/neheGX
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests