Batterycheck - PSP

Discussion in 'PSP - Hacking & Homebrew' started by Archerite, Dec 6, 2018 at 7:08 PM.

  1. Archerite

    Archerite Member

    Sep 16, 2018
    A few weeks ago I open a thread about a remake for an old PC game in the Wii section and I am hoping it's OK to open a second related thread for the PSP version here. To give you PSP homebrewers and idea of what Batterycheck is in case you did not read or follow the Wii section too I will tell a little about it:

    Back in 1998 there was a campaign to promote recycling batteries in the Netherlands and part of that was a PC game on CD-ROM you could get if you brought 15 batteries in for recycling. It was based on the same engine as Jazz Jackrabbit 2 and therefore uses the same fileformats for the Tileset, Levels and Sprites. About 10 years ago the game was released as Freeware by the publisher but they removed it after a while. After some digging I found one of the companies that worked on the game and I contacted them. The game is licensed as Creative Commons but I need to ask them which specific version. I did get permission to share their download page where the game is listed but they warned about it getting removed in the future. I posted the link and instructions to download in my other thread (here)

    With that introduction out of the way I want to talk about the PSP specific version in here. I have installed PSPDEV inside a docker container and with after a bit of trial and error I got it to compile some 'hello world' example I found on a wikibook tutorial. When I finally figured out which files were needed I got it running in the ppsspp emulator. When I tried to integrate my own code which is mostly C++ so many errors were generated that I had no idea what was wrong until I saw it tried to compile my source with GCC instead of G++! Coming from Devkitpro where things feel a little more smooth this feels like a huge step back to be honest. I also don't like that all the object files are all over the place next to the source files while I am used to those being in a ./build/ directory.

    I am still very new to the PSP Homebrew, PSPDEV and docker but I was hoping some of you might give me a few pointers on how to fix the Makefile. I have added a few minimal things from the Devkitpro Makefile to detect the .cpp sourcefiles and here is what I have now:
    TARGET    = batterycheck_psp
    BUILD     = build
    SOURCES   = source
    INCLUDES  = ../../include
    CFLAGS    = -G0 -Wall -O2
    CXXFLAGS  = $(CFLAGS) -fno-exceptions -fno-rtti
    CPPFILES  = $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.cpp))
    #CPPFILES = $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
    OBJS      = $(CPPFILES:.cpp=.o)
    LIBDIR    =
    LDFLAGS   =
    LIBS      = -lm
    BUILD_PRX = 1
    PSP_EBOOT_TITLE = Batterycheck - PSP
    PSPSDK   = $(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    I am going to try a few more things myself but any help is much appreciated.