diff --git a/Makefile b/Makefile index 6c3de0b..3c9badf 100644 --- a/Makefile +++ b/Makefile @@ -1,35 +1,37 @@ # fxengine makefile # fxengine needs gint (@Lephenixnoir) -target ?= sh3eb-elf - cflags := -m3 -mb -D FX9860G -ffreestanding -nostdlib -fstrict-volatile-bitfields -Wall \ - -Wextra -Os -Iinclude -I . + -Wextra -Os -Iinclude -I . + +dflags = -MT $@ -MMD -MP -MF $(@:%.o=%.d) lib := libfxengine.a header := include/ -prefix := $(shell $(target)-gcc -print-search-dirs | grep install \ +prefix := $(shell sh3eb-elf-gcc -print-search-dirs | grep install \ | sed 's/install: //') ifeq "$(prefix)" "" -$(error "Can't find install directory") +$(error "Can't find install directory... Leaving installation process") endif -src := $(shell find src -name '*.c') - -obj := $(src:%=build/%.o) +#src := $(shell find src -name '*.c') +src = $(wildcard src/*.c) +obj = $(src:%=build/%.o) all: $(lib) $(lib): $(obj) - $(target)-ar rcs $@ $^ + sh3eb-elf-ar rcs $@ $^ build/%.c.o: %.c @ mkdir -p $(dir $@) - $(target)-gcc -c $< -o $@ $(cflags) + sh3eb-elf-gcc -c $< -o $@ $(cflags) $(dflags) + +include $(wildcard build/*/*.d) clean: @ rm -rf build @@ -47,3 +49,7 @@ install: sh3eb-elf-ar -t $(lib) cp $(lib) $(prefix) cp -r $(header) $(prefix)/include/fxengine + +uninstall: + rm -f $(prefix)/$(lib) + rm -rf $(prefix)/include/fxengine diff --git a/build/src/event/keyboard.c.o b/build/src/event/keyboard.c.o deleted file mode 100644 index ad82dd2..0000000 Binary files a/build/src/event/keyboard.c.o and /dev/null differ diff --git a/build/src/render/translate.c.o b/build/src/render/translate.c.o deleted file mode 100644 index 192b981..0000000 Binary files a/build/src/render/translate.c.o and /dev/null differ diff --git a/build/src/render/zbuffer.c.o b/build/src/render/zbuffer.c.o deleted file mode 100644 index 94e41bf..0000000 Binary files a/build/src/render/zbuffer.c.o and /dev/null differ diff --git a/include/render/bitmap.h b/include/render/bitmap.h index b65d66c..1871016 100644 --- a/include/render/bitmap.h +++ b/include/render/bitmap.h @@ -1,14 +1,11 @@ #include #include -/* bitmap codé bit à bit - 0 dans layout -> transparent - 1 dans layout -> 1 dans color -> noir - 0 dans color -> blanc */ -/** bitmap rich type -* @warning Monochrome only ! -* transparency is in the layout -*/ +/** + * @brief bitmap rich type + * transparency is in the layout + * @warning Monochrome only ! + */ struct bitmap_rich { uint32_t size_px_x; @@ -20,31 +17,38 @@ struct bitmap_rich }; typedef struct bitmap_rich bitmap_rich; -/** get the color of pixel from rich bitmap -* @return the color coded in a unsigned char : -* if (color >> 1) -* switch (color%2) -* { -* case 0: -* // WHITE -* break; -* case 1: -* // BLACK -* } -* else -* // TRANSPARENT -* @param the bitmap -* @param x coordinate -* @param y coordinate -*/ + +/** + * @brief get the color of pixel from rich bitmap + * + * @param[in] bmp The bitmap + * @param[in] x The bitmap x coordinate (in pixels) + * @param[in] y The bitmap y coordinate (in pixels) + * + * @return the color coded in a unsigned char : + * if (color >> 1) + * switch (color%2) + * { + * case 0: + * // WHITE + * break; + * case 1: + * // BLACK + * } + * else + */ inline uint8_t bitmap_get_pixel_r(const bitmap_rich * bmp, uint32_t x, uint32_t y); -/** display a pixel from rich bitmap -* // TRANSPARENT -* @param the bitmap -* @param x coordinate -* @param y coordinate -*/ + +/** + * @brief display a specific rich bitmap pixel on the screen + * + * @param[in] bmp The bitmap + * @param[in] bmp_x The bitmap x coordinate (in pixels) + * @param[in] bmp_y The bitmap y coordinate (in pixels) + * @param[in] x screen : x coordinate + * @param[in] y screen : y coordinate + */ void bitmap_display_pixel_r(const bitmap_rich * bmp, uint32_t bmp_x, uint32_t bmp_y, uint32_t x, uint32_t y); diff --git a/libfxengine.a b/libfxengine.a index 0878c63..8b277f0 100644 Binary files a/libfxengine.a and b/libfxengine.a differ