From 3cbe5bd731d442dc12058e3cf061c845d240a4d3 Mon Sep 17 00:00:00 2001 From: flo Date: Mon, 17 Apr 2017 16:55:21 +0200 Subject: [PATCH] wings --- Makefile | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.config | 50 ++++++++++++++++++++++++++++++++++ img/plane.png | Bin 0 -> 617 bytes include/wings.h | 6 +++++ misc/icon.bmp | Bin 0 -> 1802 bytes obj/wings.c.o | Bin 0 -> 812 bytes src/wings.c | 21 +++++++++++++++ 7 files changed, 147 insertions(+) create mode 100755 Makefile create mode 100755 Makefile.config create mode 100644 img/plane.png create mode 100644 include/wings.h create mode 100644 misc/icon.bmp create mode 100644 obj/wings.c.o create mode 100644 src/wings.c 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 0000000000000000000000000000000000000000..b2b9952a9550705eed637f575d1a764a28d7b2a2 GIT binary patch literal 617 zcmV-v0+#)WP)j}1&N(g67$g2< zW@ZViL}Ls|hR1QLyQ4Fszrdl|OybW1Ac9~7vVawU(HRPk6GuIf09{)udMn#zK6)|C zRaT(2*}6HWEKk*2@vIBcob$_&@xCKd!Pp_>{GBh%HUV%OkT+5{2zG0j3Z&@lCIC}C z*nKEEmrY|JR<`~MfRhMTqt63oiFIry^Qp|sh|zze&G>{u`jG7xy}Y3K-IqSZQ-QBa zE#m0}W0qwK)-IuaXHJN`-K1k?3TEHK%%FswgOI?;A4?E2fZ7%ozZ!H1Gqb+CZnwVE z5AxEH3CWL2YM z_p|~a2knG21CQrNdUsh@J{fNTy>~<(ofSbqhhU8S00000NkvXXu0mjf DdAJ)U literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..542e05b4f35dff9c7edef6c3f3210ecdcfa02057 GIT binary patch literal 1802 zcmb`FF%H5o3`Ii+kXTumm^lFlVCRaQilvuH`N|g`*KtJC5-H~U$9Xo8`{Q^>W!(_3 z*ca>*_AZ?fQ+n;o$1F_KG|T^&j04!)S7V?SnB}cg=ZEa}+#x&X3@W3=hwPMW33Xi< z^6bU>N^xunG(0*imv&_?UB=cW%a+*^o$MB7pi*^yGiD%?l+K&`vnxPyOX!_Ouq&K^< zaaQ=CcdN0*T+*Xns~wff_3PW6(t)a~y`(S}Br|OK{z_M}WAk}9WhUyNMux;5Ws!ag zx$IM1jO%lvnU90ziG1xhx1qP_zUOyB)gs5!J)fL*&(j^3oIzjvaGvWAS-wP+mvgLO zWE`vT(KEV9Dl|dtyAm1q!H{Zeqe(TxkW}FIwPF@x9hl*ORO`+|eUk A;Q#;t literal 0 HcmV?d00001 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() +{ + +}