diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a87f1e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.vpj +*.vpw +*.vpwhistxml +*.vtg diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..70b1bdb --- /dev/null +++ b/Makefile @@ -0,0 +1,203 @@ +#-------------------------------------------------------- +# +# xrickjr GNU Makefile +# +# In config.h, I have temporarily disabled sound +# +SHELL = /bin/sh +MKDIR = mkdir + +TARGET = rickjr + +PROJROOT = . + +#F256 = $(PROJROOT)/../f256 +F256 = $(HOME)/code/f256 + +# Compiler needs to be in the PATH, before typing "Make" +# export PATH := $(F256)/llvm-mos/bin:$(PATH) +# +# I had to just add this to my path, before typing make +# +# I have a dumb script for this +# ". fixpath.sh" +# + +# Global Defines + +#SYSTEM = /usr +#SYSLIBDIR = $(SYSTEM)/lib +#SYSINCDIR = $(SYSTEM)/include + +TMPFLAGS = -D F256=1 -Wno-unknown-pragmas + + +INCCMD = -I$(SYSINCDIR) +INCCMD += -I$(PROJROOT)/src +INCCMD += -I$(PROJROOT)/include +INCCMD += -I$(F256)/include +INCCMD += -I$(F256)/f256lib + +OBJDIR = $(PROJROOT)/obj +DEPDIR = $(PROJROOT)/dep +LSTDIR = $(PROJROOT)/lst + +# +# Special GnuMake Search Path Directive +# +VPATH = $(PROJROOT)/src + +# +# Dedicated Search Paths for Specific Types +# +# Can be used to speed up compile by using this feature +# for each filetype (reducing the amount of searching) +# +vpath %.o $(OBJDIR) +vpath %.d $(DEPDIR) + +#LIBCMD +=-lm -lpng + +OBJS := xrick.o +OBJS += control.o +OBJS += data.o +OBJS += dat_ents.o +OBJS += dat_maps.o +OBJS += dat_screens.o +OBJS += dat_snd.o +OBJS += devtools.o +OBJS += draw.o +OBJS += e_bomb.o +OBJS += e_bonus.o +OBJS += e_box.o +OBJS += e_bullet.o +OBJS += ents.o +OBJS += e_rick.o +OBJS += e_sbonus.o +OBJS += e_them.o +OBJS += game.o +OBJS += maps.o +OBJS += rects.o +OBJS += scr_credit.o +OBJS += scr_gameover.o +OBJS += scr_getname.o +OBJS += scr_imain.o +OBJS += scr_imap.o +#OBJS += scr_joykey.o +OBJS += scroller.o +OBJS += scr_pause.o +OBJS += scr_xrick.o +OBJS += sysarg.o +OBJS += sysevt.o +OBJS += sysjoy.o +OBJS += syskbd.o +OBJS += syssnd.o +OBJS += system.o +OBJS += sysvid.o +OBJS += util.o +OBJS += f256.o + + +# change list of .o's into a list of .d's + +DEPS := $(OBJS:%.o=%.d) + +AS = merlin32 +CC = mos-f256k-clang +LD = mos-f256k-clang +RM = /bin/rm -rfv + +CFLAGS = -Os -Wall -Werror -Wa,-al -fno-common +CXXFLAGS = -Os -Wall -Werror -Wa,-al -fno-common +#ASFLAGS = -c -xassembler-with-cpp -Wa,-al +#LDFLAGS = -Wl,-Map,$(TARGET).map $(LIBCMD) + +# Clear Default Suffixes +.SUFFIXES: +# Set my Own Suffixes +.SUFFIXES: .c .s .cc .d .o + +all: $(TARGET) + +$(TARGET): $(DEPS) $(OBJS) $(LIBS) + ${CC} $(CFLAGS) $(TMPFLAGS) $(INCCMD) -c ${F256}/f256lib/f256.c -o $(OBJDIR)/f256.o > $(LSTDIR)/$*.lst + $(LD) -o $@ $(addprefix $(OBJDIR)/,$(OBJS)) $(LIBS) $(LDFLAGS) + +# Object Rules + +.s.o: + $(AS) $(ASFLAGS) $(TMPFLAGS) $(INCCMD) -o $(OBJDIR)/$@ $< > $(LSTDIR)/$*.lst + +.c.o: + $(CC) $(CFLAGS) $(TMPFLAGS) $(INCCMD) -c $< -o $(OBJDIR)/$*.o > $(LSTDIR)/$*.lst + +.cc.o: + $(CC) $(CXXFLAGS) $(TMPFLAGS) $(INCCMD) -c $< -o $(OBJDIR)/$*.o > $(LSTDIR)/$*.lst + +# Dependencie Rules +# +# for now just touch, to create the file if its not defined +# +.s.d: + touch $(DEPDIR)/$*.d + +.c.d: + set -e; $(CC) -M $(CFLAGS) $(TMPFLAGS) $(INCCMD) $< \ + | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $(DEPDIR)/$@; \ + [ -s $(DEPDIR)/$@ ] || rm -f $(DEPDIR)/$@ + +.cc.d: + set -e; $(CC) -M $(CXXFLAGS) $(TMPFLAGS) $(INCCMD) $< \ + | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $(DEPDIR)/$@; \ + [ -s $(DEPDIR)/$@ ] || rm -f $(DEPDIR)/$@ + +#.PHONY: install +#install: $(TARGET) +# cp $(TARGET).exe $(PROJROOT)/../bin + +.PHONY: clean +clean: + $(RM) $(OBJDIR) *.o $(DEPDIR) *.map $(LSTDIR) $(TARGET) $(TARGET).elf $(TARGET).pgz + + +######################################## +# +# HELPER TARGET RULES +# +######################################## + +# +# Target that forces all of the objects to be rebuilt if the makefile changes +# + +$(OBJS) : Makefile +$(DEPS) : Makefile +# +# Targets that create the output object directory if it doesn't already exist +# + +Makefile : $(OBJDIR) $(DEPDIR) $(LSTDIR) + +$(OBJDIR) : + $(MKDIR) $(OBJDIR) + +# +# Targets that create the output dependency directory if it doesn't already exist +# + +$(DEPDIR) : + $(MKDIR) $(DEPDIR) + +# +# Targets that create the output list directory if it doesn't already exist +# + +$(LSTDIR) : + $(MKDIR) $(LSTDIR) + +# +# Generated Dependencie Files +# +-include $(wildcard $(DEPDIR)/*.d) + + diff --git a/data/congrats.256 b/data/congrats.256 new file mode 100644 index 0000000..3b04082 Binary files /dev/null and b/data/congrats.256 differ diff --git a/data/congrats.png b/data/congrats.png new file mode 100644 index 0000000..bb28cf9 Binary files /dev/null and b/data/congrats.png differ diff --git a/data/haf.256 b/data/haf.256 new file mode 100644 index 0000000..21b0a39 Binary files /dev/null and b/data/haf.256 differ diff --git a/data/haf.png b/data/haf.png new file mode 100644 index 0000000..4013423 Binary files /dev/null and b/data/haf.png differ diff --git a/data/img_icon.png b/data/img_icon.png new file mode 100644 index 0000000..4ada7e5 Binary files /dev/null and b/data/img_icon.png differ diff --git a/data/img_splash.png b/data/img_splash.png new file mode 100644 index 0000000..dd3aff0 Binary files /dev/null and b/data/img_splash.png differ diff --git a/data/songs/egypt.mod b/data/songs/egypt.mod new file mode 100644 index 0000000..594d450 Binary files /dev/null and b/data/songs/egypt.mod differ diff --git a/data/songs/mbase.mod b/data/songs/mbase.mod new file mode 100644 index 0000000..747489c Binary files /dev/null and b/data/songs/mbase.mod differ diff --git a/data/songs/rick1.mod b/data/songs/rick1.mod new file mode 100644 index 0000000..6949b48 Binary files /dev/null and b/data/songs/rick1.mod differ diff --git a/data/songs/rick1victory.mod b/data/songs/rick1victory.mod new file mode 100644 index 0000000..8a08a3d Binary files /dev/null and b/data/songs/rick1victory.mod differ diff --git a/data/songs/samerica.mod b/data/songs/samerica.mod new file mode 100644 index 0000000..45f731d Binary files /dev/null and b/data/songs/samerica.mod differ diff --git a/data/songs/schwarz.mod b/data/songs/schwarz.mod new file mode 100644 index 0000000..c661c27 Binary files /dev/null and b/data/songs/schwarz.mod differ diff --git a/data/splash.256 b/data/splash.256 new file mode 100644 index 0000000..4427140 Binary files /dev/null and b/data/splash.256 differ diff --git a/data/splash.png b/data/splash.png new file mode 100644 index 0000000..de89f77 Binary files /dev/null and b/data/splash.png differ diff --git a/data/sprites_data.256 b/data/sprites_data.256 new file mode 100644 index 0000000..de46313 Binary files /dev/null and b/data/sprites_data.256 differ diff --git a/data/sprites_data.png b/data/sprites_data.png new file mode 100644 index 0000000..6eab28c Binary files /dev/null and b/data/sprites_data.png differ diff --git a/data/tiles_data.256 b/data/tiles_data.256 new file mode 100644 index 0000000..e73cb2a Binary files /dev/null and b/data/tiles_data.256 differ diff --git a/data/tiles_data.png b/data/tiles_data.png new file mode 100644 index 0000000..09b215f Binary files /dev/null and b/data/tiles_data.png differ