Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
epbarger committed Dec 3, 2023
0 parents commit e6e99a3
Show file tree
Hide file tree
Showing 81 changed files with 3,736 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
*.gb
*.zip
*.sav
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# If you move this project you can change the directory
# to match your GBDK root directory (ex: GBDK_HOME = "C:/GBDK/"
GBDK_HOME = ../../../

LCC = $(GBDK_HOME)bin/lcc

# You can uncomment the line below to turn on debug output
# LCC = $(LCC) -debug

# You can set the name of the .gb ROM file here
PROJECTNAME = magic-life

BINS = $(PROJECTNAME).gb
CSOURCES := $(wildcard src/*.c)
ASMSOURCES := $(wildcard src/*.s)

all: $(BINS)

compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat

# Compile and link all source files in a single call to LCC
# -Wm-yc : color support
# -Wl-yt0x1B : MBC5 ROM + RAM + Battery (for better compatibility with emulators)
# -Wl-ya1 : 1 RAM bank

$(BINS): $(CSOURCES) $(ASMSOURCES)
$(LCC) -Wm-yn"MAGICLIFE" -Wl-yt0x1B -Wl-ya1 -D_ram_func=0xD000 -o $@ $(CSOURCES) assets/*.c $(ASMSOURCES)

clean:
rm -f *.o *.lst *.map *.gb *.ihx *.sym *.cdb *.adb *.asm

dev:
make && (killall SameBoy || true) && open $(PROJECTNAME).gb
77 changes: 77 additions & 0 deletions assets/border2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//AUTOGENERATED FILE FROM png2asset

#include <stdint.h>
#include <gbdk/platform.h>
#include <gbdk/metasprites.h>

BANKREF(border2)

const palette_color_t border2_palettes[32] = {
RGB8( 0, 0, 0), RGB8( 34, 32, 52), RGB8( 69, 40, 60), RGB8(102, 57, 49)
,
RGB8(143, 86, 59), RGB8(223,113, 38), RGB8(217,160,102), RGB8(238,195,154)
,
RGB8(251,242, 54), RGB8(153,229, 80), RGB8(106,190, 48), RGB8( 55,148,110)
,
RGB8( 75,105, 47), RGB8( 82, 75, 36), RGB8( 50, 60, 57), RGB8( 63, 63,116)
,
RGB8( 48, 96,130), RGB8( 91,110,225), RGB8( 99,155,255), RGB8( 95,205,228)
,
RGB8(203,219,252), RGB8(255,255,255), RGB8(155,173,183), RGB8(132,126,135)
,
RGB8(105,106,106), RGB8( 89, 86, 82), RGB8(118, 66,138), RGB8(172, 50, 50)
,
RGB8(217, 87, 99), RGB8(215,123,186), RGB8(143,151, 74), RGB8(138,111, 48)

};

const uint8_t border2_tiles[144] = {
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x1f,0x1f,0x10,0x10,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xff,0xff,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xf8,0xf8,0x08,0x08,
0x10,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x08,0x08,0x08,0x08,
0x08,0x08,0x08,0x08,
0x08,0x08,0x08,0x08,
0x08,0x08,0x08,0x08,
0x10,0x10,0x1f,0x1f,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0xff,0xff,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x08,0x08,0xf8,0xf8,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};


const unsigned char border2_map[80] = {
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,
0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,
0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,
0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,
0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,
0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,
0x06,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x08,
};
27 changes: 27 additions & 0 deletions assets/border2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//AUTOGENERATED FILE FROM png2asset
#ifndef METASPRITE_border2_H
#define METASPRITE_border2_H

#include <stdint.h>
#include <gbdk/platform.h>
#include <gbdk/metasprites.h>

#define border2_TILE_ORIGIN 0
#define border2_TILE_W 8
#define border2_TILE_H 8
#define border2_WIDTH 80
#define border2_HEIGHT 64
#define border2_TILE_COUNT 9
#define border2_PALETTE_COUNT 8
#define border2_COLORS_PER_PALETTE 4
#define border2_TOTAL_COLORS 32
#define border2_MAP_ATTRIBUTES 0

BANKREF_EXTERN(border2)

extern const palette_color_t border2_palettes[32];
extern const uint8_t border2_tiles[144];

extern const unsigned char border2_map[80];

#endif
Binary file added assets/border2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions assets/font0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
//AUTOGENERATED FILE FROM png2asset

#include <stdint.h>
#include <gbdk/platform.h>
#include <gbdk/metasprites.h>

BANKREF(font0)

const palette_color_t font0_palettes[4] = {
RGB8( 0, 0, 0), RGB8( 0, 0, 0), RGB8( 0, 0, 0), RGB8( 0, 0, 0)

};

const uint8_t font0_tiles[336] = {
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x33,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xf8,0x00,0xfc,0x00,
0x00,0x00,0x00,0x00,
0x01,0x00,0x03,0x00,
0x03,0x00,0x07,0x00,
0x07,0x00,0x0f,0x00,
0x77,0x00,0xef,0x00,
0xef,0x00,0xdf,0x00,
0xbc,0x00,0xb0,0x00,
0x70,0x00,0x60,0x00,
0xff,0x00,0xff,0x00,
0xff,0x00,0xff,0x00,
0x3f,0x00,0x1f,0x00,
0x0f,0x00,0x0f,0x00,
0x00,0x00,0x80,0x00,
0x80,0x00,0xc0,0x00,
0xe0,0x00,0xe0,0x00,
0xe0,0x00,0xf0,0x00,
0x0e,0x00,0x1e,0x00,
0x1e,0x00,0x1e,0x00,
0x1e,0x00,0x3e,0x00,
0x3e,0x00,0x3e,0x00,
0x20,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x03,0x00,0x07,0x00,
0x07,0x00,0x03,0x00,
0x03,0x00,0x03,0x00,
0x01,0x00,0x01,0x00,
0x81,0x00,0x81,0x00,
0xf0,0x00,0xf0,0x00,
0xf8,0x00,0xf8,0x00,
0xf8,0x00,0xf8,0x00,
0xf8,0x00,0xf8,0x00,
0x3e,0x00,0x3e,0x00,
0x3f,0x00,0x3f,0x00,
0x3f,0x00,0x3f,0x00,
0x3f,0x00,0x1f,0x00,
0x07,0x00,0x07,0x00,
0x07,0x00,0x03,0x00,
0x03,0x00,0x00,0x00,
0x80,0x00,0x80,0x00,
0xc0,0x00,0xc0,0x00,
0xc0,0x00,0x80,0x00,
0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xf8,0x00,0xf8,0x00,
0xf8,0x00,0xf8,0x00,
0xf0,0x00,0xf0,0x00,
0xf0,0x00,0xf0,0x00,
0x1f,0x00,0x1f,0x00,
0x0f,0x00,0x0f,0x00,
0x07,0x00,0x07,0x00,
0x03,0x00,0x01,0x00,
0xc0,0x00,0xc0,0x00,
0xe0,0x00,0xe0,0x00,
0xf0,0x00,0xf8,0x00,
0xfe,0x00,0xff,0x00,
0x00,0x00,0x01,0x00,
0x01,0x00,0x03,0x00,
0x03,0x00,0x07,0x00,
0x1f,0x00,0xfe,0x00,
0xe0,0x00,0xe0,0x00,
0xe0,0x00,0xc0,0x00,
0xc0,0x00,0x80,0x00,
0x00,0x00,0x00,0x00,
0xff,0x00,0x3f,0x00,
0x0f,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xfc,0x00,0xf8,0x00,
0xc0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};


const unsigned char font0_map[24] = {
0x00,0x01,0x02,0x00,
0x03,0x04,0x05,0x06,
0x07,0x08,0x09,0x0a,
0x0b,0x0c,0x0d,0x0e,
0x0f,0x10,0x11,0x12,
0x00,0x13,0x14,0x00,
};
27 changes: 27 additions & 0 deletions assets/font0.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//AUTOGENERATED FILE FROM png2asset
#ifndef METASPRITE_font0_H
#define METASPRITE_font0_H

#include <stdint.h>
#include <gbdk/platform.h>
#include <gbdk/metasprites.h>

#define font0_TILE_ORIGIN 0
#define font0_TILE_W 8
#define font0_TILE_H 8
#define font0_WIDTH 32
#define font0_HEIGHT 48
#define font0_TILE_COUNT 21
#define font0_PALETTE_COUNT 1
#define font0_COLORS_PER_PALETTE 4
#define font0_TOTAL_COLORS 4
#define font0_MAP_ATTRIBUTES 0

BANKREF_EXTERN(font0)

extern const palette_color_t font0_palettes[4];
extern const uint8_t font0_tiles[336];

extern const unsigned char font0_map[24];

#endif
Binary file added assets/font0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions assets/font1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//AUTOGENERATED FILE FROM png2asset

#include <stdint.h>
#include <gbdk/platform.h>
#include <gbdk/metasprites.h>

BANKREF(font1)

const palette_color_t font1_palettes[4] = {
RGB8(255,255,255), RGB8( 0, 0, 0), RGB8( 0, 0, 0), RGB8( 0, 0, 0)

};

const uint8_t font1_tiles[160] = {
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x03,0x00,0x0f,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x80,0x00,0x80,0x00,
0x3f,0x00,0x3f,0x00,
0x1f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x80,0x00,0x80,0x00,
0x80,0x00,0x80,0x00,
0x80,0x00,0x80,0x00,
0x80,0x00,0x80,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x0f,0x00,0x0f,0x00,
0x1f,0x00,0x1f,0x00,
0x80,0x00,0x80,0x00,
0x80,0x00,0x80,0x00,
0x80,0x00,0x80,0x00,
0x80,0x00,0xc0,0x00,
0x7f,0x00,0x7f,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xe0,0x00,0xf0,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};


const unsigned char font1_map[24] = {
0x00,0x01,0x02,0x00,
0x00,0x03,0x04,0x00,
0x00,0x05,0x04,0x00,
0x00,0x05,0x04,0x00,
0x00,0x06,0x07,0x00,
0x00,0x08,0x09,0x00,
};
27 changes: 27 additions & 0 deletions assets/font1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//AUTOGENERATED FILE FROM png2asset
#ifndef METASPRITE_font1_H
#define METASPRITE_font1_H

#include <stdint.h>
#include <gbdk/platform.h>
#include <gbdk/metasprites.h>

#define font1_TILE_ORIGIN 0
#define font1_TILE_W 8
#define font1_TILE_H 8
#define font1_WIDTH 32
#define font1_HEIGHT 48
#define font1_TILE_COUNT 10
#define font1_PALETTE_COUNT 1
#define font1_COLORS_PER_PALETTE 4
#define font1_TOTAL_COLORS 4
#define font1_MAP_ATTRIBUTES 0

BANKREF_EXTERN(font1)

extern const palette_color_t font1_palettes[4];
extern const uint8_t font1_tiles[160];

extern const unsigned char font1_map[24];

#endif
Binary file added assets/font1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e6e99a3

Please sign in to comment.