-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Red screen with as simple a Makefile that I could manage.
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.o | ||
*.d | ||
|
||
*.elf | ||
*.elf.map | ||
*.gba | ||
|
||
*.sav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.SUFFIXES: | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
ifeq ($(strip $(DEVKITARM)),) | ||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM) | ||
endif | ||
|
||
include ${DEVKITARM}/gba_rules | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
OUTPUT = scratch | ||
OFILES = scratch.o | ||
|
||
INCLUDE = -I${LIBGBA}/include | ||
OPTIMISE = -fomit-frame-pointer -ffast-math | ||
ARCH = -mthumb -mthumb-interwork | ||
CFLAGS = -g -Wall -O3 -mcpu=arm7tdmi -mtune=arm7tdmi ${OPTIMISE} ${ARCH} ${INCLUDE} | ||
|
||
LD := ${CC} | ||
LDFLAGS = -g ${ARCH} -Wl,-Map,$(notdir $@).map | ||
LIBPATHS=-L${LIBGBA}/lib | ||
LIBS := -lgba | ||
|
||
DEPSDIR=${CURDIR} | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
${OUTPUT}.gba : ${OUTPUT}.elf | ||
|
||
${OUTPUT}.elf : ${OFILES} | ||
|
||
all : ${OUTPUT}.gba | ||
|
||
clean : | ||
rm -f *.o *.d *.elf* *.gba | ||
|
||
# -------------------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <gba.h> | ||
|
||
#define SCREENBUFFER ((volatile uint16_t*)0x06000000) | ||
|
||
int main() { | ||
REG_DISPCNT = MODE_3 | BG2_ENABLE; | ||
|
||
for (int pix_idx = 0; pix_idx < SCREEN_WIDTH * SCREEN_HEIGHT; ++pix_idx) { | ||
SCREENBUFFER[pix_idx] = 0x001F; | ||
} | ||
|
||
while(1) {} | ||
|
||
return 0; | ||
} |