diff --git a/BootROMs/logo-compress.c b/BootROMs/logo-compress.c index ff291436..2274eb28 100644 --- a/BootROMs/logo-compress.c +++ b/BootROMs/logo-compress.c @@ -1,6 +1,10 @@ #include #include -#include +#include +#ifdef _WIN32 +#include +#include +#endif void pair(size_t count, uint8_t byte) { @@ -35,7 +39,12 @@ int main(int argc, char *argv[]) size_t count = 1; uint8_t byte = getchar(); int new; - size_t position = 0; + size_t position = 0; + +#ifdef _WIN32 + _setmode(0,_O_BINARY); + _setmode(1,_O_BINARY); +#endif while ((new = getchar()) != EOF) { if (byte == new) { diff --git a/Makefile b/Makefile index 4bc4f3da..02466160 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,11 @@ ifneq ($(findstring MSYS,$(PLATFORM)),) PLATFORM := windows32 endif +LOGO_COMPRESS := build/logo-compress + ifeq ($(PLATFORM),windows32) _ := $(shell chcp 65001) +LOGO_COMPRESS := build/logo-compress.exe endif ifeq ($(PLATFORM),Darwin) @@ -326,10 +329,10 @@ $(OBJ)/%.1bpp: %.png -@$(MKDIR) -p $(dir $@) rgbgfx -d 1 -h -o $@ $< -$(OBJ)/BootROMs/SameBoyLogo.rle: $(OBJ)/BootROMs/SameBoyLogo.1bpp build/logo-compress - ./build/logo-compress < $< > $@ +$(OBJ)/BootROMs/SameBoyLogo.rle: $(OBJ)/BootROMs/SameBoyLogo.1bpp $(LOGO_COMPRESS) + $(realpath $(LOGO_COMPRESS)) < $< > $@ -build/logo-compress: BootROMs/logo-compress.c +$(LOGO_COMPRESS): BootROMs/logo-compress.c $(CC) $< -o $@ $(BIN)/BootROMs/agb_boot.bin: BootROMs/cgb_boot.asm