Issues moving from DevKit Advance to devkitARM

Post Reply
FireFox
Posts: 8
Joined: Sun Mar 17, 2019 10:16 am

Issues moving from DevKit Advance to devkitARM

Post by FireFox » Sun Mar 17, 2019 10:41 am

Hi all, currently having some issues with trying to run a ROM compiled by devkitARM, however I'm not compiling things in the manner as recommended since the original project wasn't set up in the way devkitPro's example code works.
I'm trying to move my existing project over from devkitadv-r5-beta-3 over to devkitARM to get access to C++11 and beyond features, and
currently I've managed to get it compiling with a few makefile tweaks, but since I'm using my own makefile and not building this in the way recommended for this compiler, I run into "Unsupported ARM mode 00" when trying to run the compiled gba file.

I can progress past this error if I run the ROM through the "gbafix.exe" but running the ROM again simply produces a white screen, when I would normally have a few dancing sprites when compiling with DevKit Advance. Reducing the "main" function down to nothing but an empty loop doesn't fix it either, I still get the same white screen.

Not sure of what else I could be missing at this point. Any help would be greatly appreciated cause the lack of C++11 features are killing me right now.

Things of note-
  • I am on WIndows 8.1.
  • I am running the ROM through VisualBoyAdvance.
  • I am building through Visual Studio as a makefile project, with the build command

Code: Select all

set path=E:\devkitPro\devkitARM\bin; %PATH%
make
  • When using gbafix.exe I am simply dragging the .gba file onto the exe to get it to run.
  • My makefile is

Code: Select all

TARGET := TestGba
CC := gcc
CXX := g++
SRCDIR := src
OBJDIR := obj
BUILD := bin
DEPDIR := dep
ARCH	:= #-mthumb -mthumb-interwork
CFLAGS	:= -g -Wall -O3 \
		#-mcpu=arm7tdmi -mtune=arm7tdmi\
		$(ARCH)
LDFLAGS :=

ifeq ($(DEBUG_PC),1)
	CXXFLAGS := $(CFLAGS) -pedantic -fno-exceptions -I $(SRCDIR)/ -std=c++0x -fpermissive
	EXE := exe
else
	CXXFLAGS := $(CFLAGS) -pedantic -fno-exceptions -I $(SRCDIR)/ -std=c++0x -fpermissive
	EXE := gba
endif

# Recursively search through subdirectories of subdirectories to find files
rfilesearch = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rfilesearch,$d/,$2))

CFILES		:=	$(call rfilesearch,$(SRCDIR)/,*.c)
CPPFILES	:=	$(call rfilesearch,$(SRCDIR)/,*.cpp)
SFILES		:=	$(call rfilesearch,$(SRCDIR)/,*.s)

OBJFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
DEPFILES := $(OBJFILES:.o=.d)

ALL_DEPFILES := $(call rfilesearch,$(SRCDIR)/,*.d)
ALL_OBJFILES := $(call rfilesearch,$(SRCDIR)/,*.o)

# Configure for windows commands
ifeq ($(OS),Windows_NT)
	RMCMD = rm
	CLEANFILES := $(subst /,\,$(ALL_OBJFILES)) $(subst /,\,$(ALL_DEPFILES))
else
	RMCMD = rm
	CLEANFILES = DEPFILES OBJFILES
endif

#---------------------------------------------------------------------------------

all: $(BUILD)\$(TARGET).$(EXE)

# Build an exe
ifeq ($(DEBUG_PC),1)

$(BUILD)\$(TARGET).$(EXE): $(OBJFILES)
	$(CXX) -o $@ $^ $(LDFLAGS)

else

$(BUILD)\$(TARGET).$(EXE): $(BUILD)\$(TARGET).elf
	objcopy -O binary $(BUILD)\$(TARGET).elf $(BUILD)\$(TARGET).gba

# Pre-GBA compiled binary
$(BUILD)\$(TARGET).elf: $(OBJFILES)
	$(CXX) -o $@ $^ $(LDFLAGS)

endif

-include $(DEPFILES) 

%.d: %.cpp
	@$(CXX) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@

clean : 
	$(RMCMD) $(CLEANFILES)
	#$(RMCMD) -fr $(TARGET).elf $(TARGET).gba

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

Re: Issues moving from DevKit Advance to devkitARM

Post by WinterMute » Sun Mar 17, 2019 2:15 pm

Firstly please note that devkitPro is an organisation not a toolchain. You're attempting to move to devkitARM, not devkitPro - I've edited the post accordingly.
FireFox wrote: Sun Mar 17, 2019 10:41 am Hi all, currently having some issues with trying to run a ROM compiled by devkitARM, however I'm not compiling things in the manner as recommended since the original project wasn't set up in the way devkitPro's example code works.
Looking at the Makefile you provided it appears you have a src subdirectory in the same directory as the Makefile - it should therefore be relatively easy to just replace your Makefile with our GBA template and edit some variables.
Reducing the "main" function down to nothing but an empty loop doesn't fix it either, I still get the same white screen.
Not having any code other than an empty loop will display a white screen, I'm not sure what else you'd expect.
  • I am running the ROM through VisualBoyAdvance.
mGBA is a much better emulator these days & still maintained. See https://mgba.io/
  • I am building through Visual Studio as a makefile project, with the build command

Code: Select all

set path=E:\devkitPro\devkitARM\bin; %PATH%
make
If you'd used a standard Makefile you'd only need to call make.
  • When using gbafix.exe I am simply dragging the .gba file onto the exe to get it to run.
And the standard Makefiles run gbafix as part of the build.
  • My makefile is
Quite bad, sorry. You appear to be using the wrong compiler to start with. Please don't tell me you renamed devkitARM binaries .

It would be easier to help if we can see the actual project you're working on. Hit us up on IRC if you can & you don't want to post links to it here yet.
Help keep devkitPro toolchains free, Donate today

Personal Blog

FireFox
Posts: 8
Joined: Sun Mar 17, 2019 10:16 am

Re: Issues moving from DevKit Advance to devkitARM

Post by FireFox » Sun Mar 17, 2019 10:33 pm

WinterMute wrote: Sun Mar 17, 2019 2:15 pm Firstly please note that devkitPro is an organisation not a toolchain. You're attempting to move to devkitARM, not devkitPro - I've edited the post accordingly.
Yeah, that'smy bad. Noticed that after I had already posted.
WinterMute wrote: Sun Mar 17, 2019 2:15 pm Looking at the Makefile you provided it appears you have a src subdirectory in the same directory as the Makefile - it should therefore be relatively easy to just replace your Makefile with our GBA template and edit some variables.
My file structure is fairly different, which is the main reason the makefile didn't work off the bat. Currently I've got each .h and .cpp paired up, using subdirectories to organise everything.
WinterMute wrote: Sun Mar 17, 2019 2:15 pm Not having any code other than an empty loop will display a white screen, I'm not sure what else you'd expect.

mGBA is a much better emulator these days & still maintained. See https://mgba.io/
VisualBoyAdvance normally displays a black screen in these cases. Will look into mGBA.
WinterMute wrote: Sun Mar 17, 2019 2:15 pm Quite bad, sorry. You appear to be using the wrong compiler to start with. Please don't tell me you renamed devkitARM binaries .
Yeah, it's had been a long time since I had ever written any make file since my Uni days and that was the first time I had written a 'generic' makefile. I haven't touched any of the devkitARM binaries, but you might be right about it running the wrong compiler since the "-mcpu=arm7tdmi -mtune=arm7tdmi" gives errors that they aren't supported. Will try modifying the example makefile to my file structure next instead of modifying my makefile to fit this new compiler.
WinterMute wrote: Sun Mar 17, 2019 2:15 pm It would be easier to help if we can see the actual project you're working on. Hit us up on IRC if you can & you don't want to post links to it here yet.
Will definitely check out the irc when I get the chance. My project is up on Github but it's a little out of date as I'm in the process of re-writing a bunch of things and getting this compiler to work- https://github.com/FireFox2000000/GbaGameEngine

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

Re: Issues moving from DevKit Advance to devkitARM

Post by WinterMute » Mon Mar 18, 2019 3:43 am

Fairly minimal changes to the template Makefile
Makefile.zip
modified template Makefile
(1.58 KiB) Downloaded 459 times

Code: Select all

--- /opt/devkitpro/examples/gba/template/Makefile	2019-01-22 15:34:19.000000000 +0000
+++ Makefile	2019-03-18 01:53:30.000000000 +0000
@@ -22,8 +22,10 @@
 #---------------------------------------------------------------------------------
 TARGET		:= $(notdir $(CURDIR))
 BUILD		:= build
-SOURCES		:= source
-INCLUDES	:= include
+ifneq ($(BUILD),$(notdir $(CURDIR)))
+SOURCES		:= $(shell find src -type d)
+endif
+INCLUDES	:= src
 DATA		:=
 MUSIC		:=
 
@@ -38,7 +40,7 @@
 
 CFLAGS	+=	$(INCLUDE)
 
-CXXFLAGS	:=	$(CFLAGS) -fno-rtti -fno-exceptions
+CXXFLAGS	:=	$(CFLAGS)
 
 ASFLAGS	:=	-g $(ARCH)
 LDFLAGS	=	-g $(ARCH) -Wl,-Map,$(notdir $*.map)
@@ -46,21 +48,19 @@
 #---------------------------------------------------------------------------------
 # any extra libraries we wish to link with the project
 #---------------------------------------------------------------------------------
-LIBS	:= -lmm -lgba
+LIBS	:=
 
 
 #---------------------------------------------------------------------------------
 # list of directories containing libraries, this must be the top level containing
 # include and lib
 #---------------------------------------------------------------------------------
-LIBDIRS	:=	$(LIBGBA)
+LIBDIRS	:=
 
 #---------------------------------------------------------------------------------
 # no real need to edit anything past this point unless you need to add additional
 # rules for different file extensions
 #---------------------------------------------------------------------------------
-
-
 ifneq ($(BUILD),$(notdir $(CURDIR)))
 #---------------------------------------------------------------------------------
 
Image
Help keep devkitPro toolchains free, Donate today

Personal Blog

FireFox
Posts: 8
Joined: Sun Mar 17, 2019 10:16 am

Re: Issues moving from DevKit Advance to devkitARM

Post by FireFox » Tue Mar 19, 2019 3:05 am

That worked great! Thank you very much :D

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests