commit 3cbe5bd731d442dc12058e3cf061c845d240a4d3 Author: flo Date: Mon Apr 17 16:55:21 2017 +0200 wings diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..299c268 --- /dev/null +++ b/Makefile @@ -0,0 +1,70 @@ +#!/usr/bin/make -f +# INCLUDE CONFIGURATION +include $(CURDIR)/Makefile.config + +# DEDUCED VARS +ALLOBJ = $(patsubst %,$(OBJDIR)/%.o,$(SRC) $(FONT) $(IMG)) +ALLINC = $(INC:%=$(INCDIR)/%) + +# RULES +## Make it all (default rule) +all: $(NAME).g1a + +## Make the object directory +$(OBJDIR): + mkdir -p $(OBJDIR) + +## Compile sprites +$(OBJDIR)/%.bmp.o: $(IMGDIR)/%.bmp + fxconv $< -o $@ -n $(basename $(notdir $<)) + +## Compile fonts +$(OBJDIR)/%.bmp.o: $(FONTDIR)/%.bmp + fxconv $< -o $@ -n $(basename $(notdir $<)) --font + +## Make an object file out of an ASM source file +$(OBJDIR)/%.s.o: $(SRCDIR)/%.s + $(AS) -c -o $@ $< + +## Make an object file out of a C source file +$(OBJDIR)/%.c.o: $(SRCDIR)/%.c $(ALLINC) + $(CC) -c -o $@ $< $(CFLAGS) + +## Make the ELF file +$(NAME).elf: $(OBJDIR) $(ALLOBJ) + $(LD) -o $@ $(ALLOBJ) $(LFLAGS) + +## Make the BIN file +$(NAME).bin: $(NAME).elf + $(OBJCPY) -R .comment -R .bss -R '$$iop' -O binary $< $@ + +## Make the G1A file +$(NAME).g1a: $(NAME).bin + $(WRAPR) $< -o $(NAME).g1a -i $(ICON) + @stat -c "Build finished -- output size is %s bytes." $(NAME).g1a + +## Clean up your mess +clean: + $(RM) $(OBJDIR) + $(RM) $(NAME).elf + $(RM) $(NAME).bin + +## Clean up everything +fclean: clean + $(RM) $(NAME).g1a + $(RM) $(NAME).txt + +dump: + $(OBJDUMP) -d $(NAME).elf > $(NAME).txt + @stat -c "Dump file -- dump file put in %n ." $(NAME).txt + +## Remake +re: fclean all + +## Send to calc +send: + $(SENDR) send $(NAME).g1a -f + +## Phuneral phuture ? +.PHONY: all clean fclean dump re send +# END OF FILE diff --git a/Makefile.config b/Makefile.config new file mode 100755 index 0000000..910c78d --- /dev/null +++ b/Makefile.config @@ -0,0 +1,50 @@ +#!/usr/bin/make -f +# PROJECT INFORMATION +NAME = wings +ICON = misc/icon.bmp +LIB = gcc + +## DIRECTORIES +SRCDIR = ./src +INCDIR = ./include +OBJDIR = ./obj +LIBDIR = ./lib +SCPTDIR = ./scripts +IMGDIR = ./img +FONTDIR = ./font + +# TOOLCHAIN +## Directory maker +MD = mkdir -p +## File remover +RM = rm -f -r +## Assembler +AS = sh3eb-elf-as +## C compiler +CC = sh3eb-elf-gcc +CFLAGS = -m3 -mb -Os -nostdlib -Wall -Wextra -Wno-main -pedantic -std=c11 -I $(INCDIR) `fxsdk --cflags` +## Linker +LD = sh3eb-elf-gcc +LFLAGS = `fxsdk --cflags` `fxsdk --libs` +## Object copier +OBJCPY = sh3eb-elf-objcopy +## Object dump +OBJDUMP = sh3eb-elf-objdump +## G1A Wrapper +WRAPR = g1a-wrapper +## Sender +SENDR = p7 + +# SOURCES +SRC = $(notdir $(wildcard $(SRCDIR)/*.[cs])) + +# INCLUDES +INC = $(notdir $(wildcard $(INCDIR)/*.h)) + +#IMAGE +IMG = $(notdir $(wildcard $(IMGDIR)/*.bmp)) + +# FONTS +FONT = $(notdir $(wildcard $(FONTDIR)/*.bmp)) + +# END OF FILE diff --git a/img/plane.png b/img/plane.png new file mode 100644 index 0000000..b2b9952 Binary files /dev/null and b/img/plane.png differ diff --git a/include/wings.h b/include/wings.h new file mode 100644 index 0000000..8691934 --- /dev/null +++ b/include/wings.h @@ -0,0 +1,6 @@ +#ifndef WINGS + #define WINGS + + + +#endif diff --git a/misc/icon.bmp b/misc/icon.bmp new file mode 100644 index 0000000..542e05b Binary files /dev/null and b/misc/icon.bmp differ diff --git a/obj/wings.c.o b/obj/wings.c.o new file mode 100644 index 0000000..be2fcfd Binary files /dev/null and b/obj/wings.c.o differ diff --git a/src/wings.c b/src/wings.c new file mode 100644 index 0000000..0103e69 --- /dev/null +++ b/src/wings.c @@ -0,0 +1,21 @@ +#include "wings.h" + +#include "display.h" // bopti.h => images // tales.h => fonts +#include "keyboard.h" + +#include "stdio.h" +#include "stdlib.h" + + +extern image_t plane; + +int main() +{ + dimage(0, 0, &plane); + return 1; +} + +void menu() +{ + +}