d0nk
10-30-2007, 02:03 AM
Hello everyone. I've been playing lockjaw quite a bit lately, then today in class I was wanting to play (boring lecture), but I was in linux (I dual boot my laptop, and linux lasts FAR longer on battery than windows).
I'm running Ubuntu 7.10 Gutsy Gibbon on an HP laptop, by the way.
I took a look at the libs that tepples used in lockjaw, and made sure to get them. The libraries that I needed were: [note, there are more, but these covered the dependencies]
libvorbis-dev liballegro4.2-dev libaldum1
I needed to download and compile JPGalleg (I used the link on tepples' site). Compiling JPGalleg was simple
./fix unix
make
sudo make install
Once I did that, I needed to edit the makefile to be more "linux friendly" Here is a shortened version:
EXE := lj
CFLAGS := -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -DHAS_FPU
CC := gcc
LD := gcc
LDFLAGS := -Wall -s
srcdir := src
objdir := obj/linux
MUSICOBJS := $(objdir)/ljvorbis.o
MUSICLIBS := -laldmb -ldumb -lvorbisfile -lvorbis -logg
LDLIBS := -ljpgal -lalleg
DEPOBJS := $(objdir)/ljpc.o $(objdir)/lj.o $(objdir)/ljplay.o $(objdir)/pcjoy.o $(objdir)/gimmicks.o $(objdir)/wktables.o $(objdir)/options.o $(objdir)/debrief.o $(objdir)/macro.o $(objdir)/ljreplay.o $(objdir)/ljmusic.o $(objdir)/old_pc_options.o $(objdir)/pcsound.o $(MUSICOBJS)
.PHONY: linux win32 clean all
# Scripts to coordinate building the PC, GBA, and DS versions
linux: $(EXE)
all: $(EXE) lj.gba lj.nds
# Content of executable
$(EXE): $(DEPOBJS) $(OTHEROBJS)
$(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@
# Compilation rules
$(objdir)/%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) -MMD -c -o $@ $<
@cp $(objdir)/$*.d $(objdir)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \
rm -f $(objdir)/$*.d
# Header dependencies
-include $(DEPOBJS:%.o=%.P)
# Cleanup rules
clean:
-rm $(objdir)/*.o
-rm $(objdir)/*.P
-rm $(EXE)
The above may need some tweaking, I tried to chop out the linux relevant stuff only. I have my makefile set up for compiling both the windows bin and the linux bin, so it differs a bit.
To compile, simply:
mkdir object/linux # this directory will be needed...
make
The final step is to copy the DAT files from the windows/gba/nds binary .zip file to your source directory.
Then in under 10 minutes I was playing my favorite tetrimino stacking game, under my favorite OS. The default theme and sounds work, not sure if BGM plays, as I had my volume set really low. Skins should work too.
Thanks for a great game, tepples! http://www.tetrisconcept.net/forum/images/smilies/icon_biggrin.gif
I'm running Ubuntu 7.10 Gutsy Gibbon on an HP laptop, by the way.
I took a look at the libs that tepples used in lockjaw, and made sure to get them. The libraries that I needed were: [note, there are more, but these covered the dependencies]
libvorbis-dev liballegro4.2-dev libaldum1
I needed to download and compile JPGalleg (I used the link on tepples' site). Compiling JPGalleg was simple
./fix unix
make
sudo make install
Once I did that, I needed to edit the makefile to be more "linux friendly" Here is a shortened version:
EXE := lj
CFLAGS := -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -DHAS_FPU
CC := gcc
LD := gcc
LDFLAGS := -Wall -s
srcdir := src
objdir := obj/linux
MUSICOBJS := $(objdir)/ljvorbis.o
MUSICLIBS := -laldmb -ldumb -lvorbisfile -lvorbis -logg
LDLIBS := -ljpgal -lalleg
DEPOBJS := $(objdir)/ljpc.o $(objdir)/lj.o $(objdir)/ljplay.o $(objdir)/pcjoy.o $(objdir)/gimmicks.o $(objdir)/wktables.o $(objdir)/options.o $(objdir)/debrief.o $(objdir)/macro.o $(objdir)/ljreplay.o $(objdir)/ljmusic.o $(objdir)/old_pc_options.o $(objdir)/pcsound.o $(MUSICOBJS)
.PHONY: linux win32 clean all
# Scripts to coordinate building the PC, GBA, and DS versions
linux: $(EXE)
all: $(EXE) lj.gba lj.nds
# Content of executable
$(EXE): $(DEPOBJS) $(OTHEROBJS)
$(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@
# Compilation rules
$(objdir)/%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) -MMD -c -o $@ $<
@cp $(objdir)/$*.d $(objdir)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \
rm -f $(objdir)/$*.d
# Header dependencies
-include $(DEPOBJS:%.o=%.P)
# Cleanup rules
clean:
-rm $(objdir)/*.o
-rm $(objdir)/*.P
-rm $(EXE)
The above may need some tweaking, I tried to chop out the linux relevant stuff only. I have my makefile set up for compiling both the windows bin and the linux bin, so it differs a bit.
To compile, simply:
mkdir object/linux # this directory will be needed...
make
The final step is to copy the DAT files from the windows/gba/nds binary .zip file to your source directory.
Then in under 10 minutes I was playing my favorite tetrimino stacking game, under my favorite OS. The default theme and sounds work, not sure if BGM plays, as I had my volume set really low. Skins should work too.
Thanks for a great game, tepples! http://www.tetrisconcept.net/forum/images/smilies/icon_biggrin.gif