Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kliao2016 committed Nov 12, 2017
0 parents commit 6aa913b
Show file tree
Hide file tree
Showing 21 changed files with 3,411 additions and 0 deletions.
Binary file added BrickBreaker.elf
Binary file not shown.
Binary file added BrickBreaker.gba
Binary file not shown.
74 changes: 74 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
################################################################################
# These are variables for the GBA toolchain build
# You can add others if you wish to
# ***** Kevin Liao *****
################################################################################

# The name of your desired GBA game
# This should be a just a name i.e MyFirstGBAGame
# No SPACES AFTER THE NAME.
PROGNAME = BrickBreaker

# Here you must put a list of all of the object files
# that will be compiled into your program. For example
# if you have main.c and myLib.c then in the following
# line you would put main.o and myLib.o
OFILES = main.o myLib.o font.o game.o

# The header files you have created.
# This is necessary to determine when to recompile for files.
# This should be a space (SPACE!) separated list of .h files
HFILES = game.h myLib.h

################################################################################
# These are various settings used to make the GBA toolchain work
# DO NOT EDIT BELOW.
################################################################################
include res/GBAVariables.mak

.PHONY: all
all : CFLAGS += $(CRELEASE)
all: $(PROGNAME).gba
@echo "[FINISH] Created $(PROGNAME).gba"

$(PROGNAME).gba : $(PROGNAME).elf
@echo "[LINK] Linking objects together to create $(PROGNAME).gba"
@$(OBJCOPY) -O binary $(PROGNAME).elf $(PROGNAME).gba

$(PROGNAME).elf : res/crt0.o $(GCCLIB)/crtbegin.o $(GCCLIB)/crtend.o $(GCCLIB)/crti.o $(GCCLIB)/crtn.o $(OFILES)
@$(CC) $(LINKFLAGS) -o $(PROGNAME).elf $^ -lgcc -lc $(LDDEBUG)
@rm -f *.d


%.o : %.c
@echo "[COMPILE] Compiling $<"
@$(CC) $(CFLAGS) -c $< -o $@

%.o : %.s
@echo "[ASSEMBLE] Assembling $<"
@$(AS) $(MODEL) $< -o $@

.PHONY : vba
vba : CFLAGS += $(CRELEASE)
vba : $(PROGNAME).gba
@echo "[EXECUTE] Running Emulator VBA-M"
@vbam $(VBAOPT) $(PROGNAME).gba > /dev/null 2> /dev/null

.PHONY : mgba
mgba : CFLAGS += $(CRELEASE)
mgba : $(PROGNAME).gba
@echo "[EXECUTE] Running Emulator VBA-M"
@mgba $(PROGNAME).gba > /dev/null 2> /dev/null

.PHONY : med
med : CFLAGS += $(CRELEASE)
med : $(PROGNAME).gba
@echo "[EXECUTE] Running emulator Mednafen"
@mednafen $(PROGNAME).gba > /dev/null 2>&1

.PHONY : clean
clean :
@echo "[CLEAN] Removing all compiled files"
@rm -f *.o *.elf *.gba *.d res/*.o res/*.d

-include $(CFILES:%.c=%.d)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Kevin Liao - CS 2110 Fall 2017
Implementation of a classic GBA Brick Breaker game using C
Loading

0 comments on commit 6aa913b

Please sign in to comment.