Disassemble some more tables and the first graphic (#71)

* Sync tools/ directory with pokeemerald

We really ought to have a central repository for this mess

* Make incremental builds faster

Scientists hate him!
He made NODEP disappear with this ONE SIMPLE TRICK!!!
Want to know more? -> __click here__ <-

* Disassemble some more tables and the first graphic
This commit is contained in:
mid-kid 2021-11-04 21:07:26 +00:00 committed by GitHub
parent f1394cbb03
commit 681ca68ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 2194 additions and 949 deletions

View File

@ -146,14 +146,6 @@ endif
.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl %.pcm %.bin .PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl %.pcm %.bin
# Disable dependency scanning when NODEP is used for quick building
ifeq ($(NODEP),1)
$(C_BUILDDIR)/%.o: C_DEP :=
else
$(C_BUILDDIR)/%.o: C_DEP = $(shell [[ -f $(C_SUBDIR)/$*.c ]] && $(SCANINC) -I include -I tools/agbcc/include -I gflib $(C_SUBDIR)/$*.c)
endif
# Create build subdirectories # Create build subdirectories
$(shell mkdir -p $(SUBDIRS)) $(shell mkdir -p $(SUBDIRS))
@ -167,15 +159,17 @@ include dungeon_floor.mk
include data_pokemon.mk include data_pokemon.mk
include data_item.mk include data_item.mk
include data_move.mk include data_move.mk
include graphics.mk
$(TOOLDIRS): $(TOOLDIRS):
@$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX) @$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX)
$(SCANINC): tools/scaninc
compare: all compare: all
@$(SHA1SUM) $(BUILD_NAME).sha1 @$(SHA1SUM) $(BUILD_NAME).sha1
clean: tidy clean-tools clean: tidy clean-tools
$(RM) $(ALL_OBJECTS) $(RM) $(ALL_OBJECTS) $(ALL_OBJECTS:.o=.d)
clean-tools: clean-tools:
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);)
@ -185,18 +179,30 @@ tidy:
$(RM) -r $(BUILD_DIR) $(RM) -r $(BUILD_DIR)
@$(MAKE) clean -C libagbsyscall @$(MAKE) clean -C libagbsyscall
$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.c $$(C_DEP) $(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.c
@$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i
@$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CC1FLAGS) -o $(C_BUILDDIR)/$*.s @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CC1FLAGS) -o $(C_BUILDDIR)/$*.s
@echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s
$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(ASM_DEP) dungeon_pokemon dungeon_floor data_pokemon data_item data_move $(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c $(SCANINC)
@echo -n "$(@:.d=.o): " > $@
@$(SCANINC) -I include -I tools/agbcc/include -I gflib $< | xargs printf "%s " >> $@
$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s dungeon_pokemon dungeon_floor data_pokemon data_item data_move
$(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@
$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(ASM_DEP) $(DATA_ASM_BUILDDIR)/%.d: $(DATA_ASM_SUBDIR)/%.s $(SCANINC)
@echo -n "$(@:.d=.o): " > $@
@$(SCANINC) -I include $< | xargs printf "%s " >> $@
$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s
$(AS) $(ASFLAGS) $< -o $@ $(AS) $(ASFLAGS) $< -o $@
$(ASM_BUILDDIR)/%.d: $(ASM_SUBDIR)/%.s $(SCANINC)
@echo -n "$(@:.d=.o): " > $@
@$(SCANINC) $< | xargs printf "%s " >> $@
libagbsyscall: libagbsyscall:
@$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN)
@ -213,3 +219,6 @@ $(ROM): %.gba: $(ELF)
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0xA000000 $< $@ $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0xA000000 $< $@
$(GBAFIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent $(GBAFIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
ifeq (,$(filter clean,$(MAKECMDGOALS)))
include $(ALL_OBJECTS:.o=.d)
endif

View File

@ -1012,7 +1012,7 @@ MemoryLocate_LocalCreateText:
.global gUnknown_80B7F88 .global gUnknown_80B7F88
gUnknown_80B7F88: @ 80B7F88 gUnknown_80B7F88: @ 80B7F88
.4byte gUnknown_80B7E8C, 1109, MemoryLocate_LocalCreateText .4byte gUnknown_80B7E8C, 1109, MemoryLocate_LocalCreateText
.global gLocalCreateErrorMessage .global gLocalCreateErrorMessage
gLocalCreateErrorMessage: @ 80B7F94 gLocalCreateErrorMessage: @ 80B7F94
@ -1029,35 +1029,681 @@ gLocalCreateErrorMessage: @ 80B7F94
.global gUnknown_80B8008 .global gUnknown_80B8008
gUnknown_80B8008: @ 80B8008 gUnknown_80B8008: @ 80B8008
.byte 0x10, 0x00, 0x0c, 0x00 .2byte 16, 12, 9, 7, 6, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0
.byte 0x09, 0x00, 0x07, 0x00
.byte 0x06, 0x00, 0x05, 0x00
.byte 0x04, 0x00, 0x03, 0x00
.byte 0x02, 0x00, 0x02, 0x00
.byte 0x01, 0x00, 0x01, 0x00
.byte 0x01, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00
.global gUnknown_80B802A .global gUnknown_80B802A
gUnknown_80B802A: @ 80B802A gUnknown_80B802A: @ 80B802A
.incbin "baserom.gba", 0xB802A, 0x140 .2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x846C
.2byte 0x8967
.2byte 0x8C64
.2byte 0x8E62
.2byte 0x9060
.2byte 0x915F
.2byte 0x935D
.2byte 0x945C
.2byte 0x955B
.2byte 0x965A
.2byte 0x965A
.2byte 0x9759
.2byte 0x9858
.2byte 0x9858
.2byte 0x9957
.2byte 0x9957
.2byte 0x9A56
.2byte 0x9A56
.2byte 0x9A56
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9C55
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9C54
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9B55
.2byte 0x9A56
.2byte 0x9A56
.2byte 0x9A56
.2byte 0x9957
.2byte 0x9957
.2byte 0x9858
.2byte 0x9858
.2byte 0x9759
.2byte 0x965A
.2byte 0x965A
.2byte 0x955B
.2byte 0x945C
.2byte 0x935D
.2byte 0x915F
.2byte 0x9060
.2byte 0x8E62
.2byte 0x8C64
.2byte 0x8967
.2byte 0x846C
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.global gUnknown_80B816A .global gUnknown_80B816A
gUnknown_80B816A: @ 80B816A gUnknown_80B816A: @ 80B816A
.incbin "baserom.gba", 0xB816A, 0x140 .2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x8071
.2byte 0x866B
.2byte 0x8A67
.2byte 0x8D64
.2byte 0x8F62
.2byte 0x9160
.2byte 0x935E
.2byte 0x955C
.2byte 0x975A
.2byte 0x9958
.2byte 0x9A57
.2byte 0x9B56
.2byte 0x9D54
.2byte 0x9E53
.2byte 0xA051
.2byte 0xA051
.2byte 0xA150
.2byte 0xA24F
.2byte 0xA44D
.2byte 0xA54C
.2byte 0xA54C
.2byte 0xA64B
.2byte 0xA74A
.2byte 0xA849
.2byte 0xA948
.2byte 0xA948
.2byte 0xAA47
.2byte 0xAA47
.2byte 0xAB46
.2byte 0xAC45
.2byte 0xAC45
.2byte 0xAD44
.2byte 0xAD44
.2byte 0xAE43
.2byte 0xAE43
.2byte 0xAF42
.2byte 0xAF42
.2byte 0xB041
.2byte 0xB041
.2byte 0xB140
.2byte 0xB140
.2byte 0xB140
.2byte 0xB23F
.2byte 0xB23F
.2byte 0xB23F
.2byte 0xB23F
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB43D
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB33E
.2byte 0xB23F
.2byte 0xB23F
.2byte 0xB23F
.2byte 0xB23F
.2byte 0xB140
.2byte 0xB140
.2byte 0xB140
.2byte 0xB041
.2byte 0xB041
.2byte 0xAF42
.2byte 0xAF42
.2byte 0xAE43
.2byte 0xAE43
.2byte 0xAD44
.2byte 0xAD44
.2byte 0xAC45
.2byte 0xAC45
.2byte 0xAB46
.2byte 0xAA47
.2byte 0xAA47
.2byte 0xA948
.2byte 0xA948
.2byte 0xA849
.2byte 0xA74A
.2byte 0xA64B
.2byte 0xA54C
.2byte 0xA54C
.2byte 0xA44D
.2byte 0xA24F
.2byte 0xA150
.2byte 0xA051
.2byte 0xA051
.2byte 0x9E53
.2byte 0x9D54
.2byte 0x9B56
.2byte 0x9A57
.2byte 0x9958
.2byte 0x975A
.2byte 0x955C
.2byte 0x935E
.2byte 0x9160
.2byte 0x8F62
.2byte 0x8D64
.2byte 0x8A67
.2byte 0x866B
.2byte 0x8071
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.global gUnknown_80B82AA .global gUnknown_80B82AA
gUnknown_80B82AA: @ 80B82AA gUnknown_80B82AA: @ 80B82AA
.incbin "baserom.gba", 0xB82AA, 0x140 .2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x9392
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.2byte 0x0100
.global gUnknown_80B83EA .global gUnknown_80B83EA
gUnknown_80B83EA: @ 80B83EA gUnknown_80B83EA: @ 80B83EA
.incbin "baserom.gba", 0xB83EA, 0x152 .2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.2byte 0x0000
.align 2, 0
.string "pksdir0\0"
.string "pksdir0\0"
.global gUnknown_80B853C .global gUnknown_80B853C
gUnknown_80B853C: @ 80B853C gUnknown_80B853C: @ 80B853C
.incbin "baserom.gba", 0xB853C, 0x40 .4byte 0x66666666
.4byte 0x00000000
.4byte 0x11111111
.4byte 0x22222222
.4byte 0x33333333
.4byte 0x44444444
.4byte 0x55555555
.4byte 0x66666666
.4byte 0x77777777
.4byte 0x88888888
.4byte 0x99999999
.4byte 0xAAAAAAAA
.4byte 0xBBBBBBBB
.4byte 0xCCCCCCCC
.4byte 0xDDDDDDDD
.4byte 0xEEEEEEEE
.global gUnknown_80B857C .global gUnknown_80B857C
gUnknown_80B857C: @ 80B857C gUnknown_80B857C: @ 80B857C
@ -1065,18 +1711,41 @@ gUnknown_80B857C: @ 80B857C
.global gUnknown_80B85DC .global gUnknown_80B85DC
gUnknown_80B85DC: @ 80B85DC gUnknown_80B85DC: @ 80B85DC
.incbin "baserom.gba", 0xB85DC, 0xC8 @ Some kind of bit shifting and masking table
@ byte1, byte2, shift_left, shift_right
.4byte 0xFFFFFFFF, 0x00000000, 0x00, 0x20
.4byte 0x0FFFFFFF, 0xF0000000, 0x04, 0x1C
.4byte 0x00FFFFFF, 0xFF000000, 0x08, 0x18
.4byte 0x000FFFFF, 0xFFF00000, 0x0C, 0x14
.4byte 0x0000FFFF, 0xFFFF0000, 0x10, 0x10
.4byte 0x00000FFF, 0xFFFFF000, 0x14, 0x0C
.4byte 0x000000FF, 0xFFFFFF00, 0x18, 0x08
.4byte 0x0000000F, 0xFFFFFFF0, 0x1C, 0x04
.global gUnknown_80B865C
gUnknown_80B865C:
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80B86A4 .global gUnknown_80B86A4
gUnknown_80B86A4: @ 80B86A4 gUnknown_80B86A4: @ 80B86A4
.byte 0x5C, 0x86, 0x0B, 0x08 @ Fallback character with bitmap?
.byte 0xA1, 0x81, 0x07, 0x00 .4byte gUnknown_80B865C
.byte 0x0A, 0x00, 0x00, 0x00 .4byte 0x781A1, 10, 8
.byte 0x08, 0x00, 0x00, 0x00
.global gUnknown_80B86B4 .global gUnknown_80B86B4
gUnknown_80B86B4: @ 80B86B4 gUnknown_80B86B4: @ 80B86B4
.incbin "baserom.gba", 0xB86B4, 0x100 .incbin "graphics/warning.4bpp"
.global gKanjiA_file_string .global gKanjiA_file_string
gKanjiA_file_string: @ 80B87B4 gKanjiA_file_string: @ 80B87B4

2
graphics.mk Normal file
View File

@ -0,0 +1,2 @@
%.4bpp: %.png
$(GBAGFX) $< $@

BIN
graphics/warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

View File

@ -1,20 +1,20 @@
Copyright (c) 2016 huderlem Copyright (c) 2016 huderlem
Copyright (c) 2005, 2006 by Marco Trillo <marcotrillo@gmail.com> Copyright (c) 2005, 2006 by Marco Trillo <marcotrillo@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -6,12 +6,18 @@ LIBS = -lm
SRCS = main.c extended.c SRCS = main.c extended.c
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: aif2pcm all: aif2pcm$(EXE)
@: @:
aif2pcm: $(SRCS) aif2pcm$(EXE): $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
clean: clean:

View File

@ -351,6 +351,12 @@ const int gDeltaEncodingTable[] = {
-64, -49, -36, -25, -16, -9, -4, -1, -64, -49, -36, -25, -16, -9, -4, -1,
}; };
#define POSITIVE_DELTAS_START 0
#define POSITIVE_DELTAS_END 8
#define NEGATIVE_DELTAS_START 8
#define NEGATIVE_DELTAS_END 16
struct Bytes *delta_decompress(struct Bytes *delta, unsigned int expected_length) struct Bytes *delta_decompress(struct Bytes *delta, unsigned int expected_length)
{ {
struct Bytes *pcm = malloc(sizeof(struct Bytes)); struct Bytes *pcm = malloc(sizeof(struct Bytes));
@ -418,15 +424,32 @@ struct Bytes *delta_decompress(struct Bytes *delta, unsigned int expected_length
return pcm; return pcm;
} }
#define U8_TO_S8(value) ((value) < 128 ? (value) : (value) - 256)
#define ABS(value) ((value) >= 0 ? (value) : -(value))
int get_delta_index(uint8_t sample, uint8_t prev_sample) int get_delta_index(uint8_t sample, uint8_t prev_sample)
{ {
int best_error = INT_MAX; int best_error = INT_MAX;
int best_index = -1; int best_index = -1;
int delta_table_start_index;
int delta_table_end_index;
int sample_signed = U8_TO_S8(sample);
int prev_sample_signed = U8_TO_S8(prev_sample);
for (int i = 0; i < 16; i++) // if we're going up (or equal), only choose positive deltas
if (prev_sample_signed <= sample_signed) {
delta_table_start_index = POSITIVE_DELTAS_START;
delta_table_end_index = POSITIVE_DELTAS_END;
} else {
delta_table_start_index = NEGATIVE_DELTAS_START;
delta_table_end_index = NEGATIVE_DELTAS_END;
}
for (int i = delta_table_start_index; i < delta_table_end_index; i++)
{ {
uint8_t new_sample = prev_sample + gDeltaEncodingTable[i]; uint8_t new_sample = prev_sample + gDeltaEncodingTable[i];
int error = sample > new_sample ? sample - new_sample : new_sample - sample; int new_sample_signed = U8_TO_S8(new_sample);
int error = ABS(new_sample_signed - sample_signed);
if (error < best_error) if (error < best_error)
{ {

View File

@ -1,19 +1,19 @@
Copyright (c) 2016 YamaArashi Copyright (c) 2016 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -6,10 +6,16 @@ CFLAGS = -Wall -Wextra -Werror -std=c11 -O2
SRCS = bin2c.c SRCS = bin2c.c
all: bin2c ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
all: bin2c$(EXE)
@: @:
bin2c: $(SRCS) bin2c$(EXE): $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

File diff suppressed because it is too large Load Diff

View File

@ -3,10 +3,16 @@ CC ?= gcc
SRCS = gbafix.c SRCS = gbafix.c
all: gbafix ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
all: gbafix$(EXE)
@: @:
gbafix: $(SRCS) gbafix$(EXE): $(SRCS)
$(CC) $(SRCS) -o $@ $(LDFLAGS) $(CC) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -28,14 +28,14 @@
// gbafix.c // gbafix.c
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
/* /*
Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome) Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Sierraffinity)
Validates header of GBA roms. Validates header of GBA roms.
History History
------- -------
v1.07 - added support for ELF input, (PikalaxALT) v1.07 - added support for ELF input, (PikalaxALT)
v1.06 - added output silencing, (Diegoisawesome) v1.06 - added output silencing, (Sierraffinity)
v1.05 - added debug offset argument, (Diegoisawesome) v1.05 - added debug offset argument, (Sierraffinity)
v1.04 - converted to plain C, (WinterMute) v1.04 - converted to plain C, (WinterMute)
v1.03 - header.fixed, header.device_type v1.03 - header.fixed, header.device_type
v1.02 - redefined the options (rgbfix style), checksum=0 v1.02 - redefined the options (rgbfix style), checksum=0
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
// show syntax // show syntax
if (argc <= 1) if (argc <= 1)
{ {
printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n"); printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Sierraffinity \n");
printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n"); printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n");
printf("\n"); printf("\n");
printf("parameters:\n"); printf("parameters:\n");

View File

@ -1,19 +1,19 @@
Copyright (c) 2015 YamaArashi Copyright (c) 2015 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -6,15 +6,21 @@ LIBS = -lpng -lz
SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: gbagfx all: gbagfx$(EXE)
@: @:
gbagfx-debug: $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h gbagfx-debug$(EXE): $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h
$(CC) $(CFLAGS) -DDEBUG $(SRCS) -o $@ $(LDFLAGS) $(LIBS) $(CC) $(CFLAGS) -DDEBUG $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
gbagfx: $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h gbagfx$(EXE): $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
clean: clean:

View File

@ -282,7 +282,7 @@ static void HflipTile(unsigned char * tile, int bitDepth)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
SWAP_NYBBLES(&tile[4 * i + 0], &tile[4 * i + 3]); SWAP_NYBBLES(&tile[4 * i + 0], &tile[4 * i + 3]);
SWAP_NYBBLES(&tile[4 * i + 1], &tile[4 * i + 2]);; SWAP_NYBBLES(&tile[4 * i + 1], &tile[4 * i + 2]);
} }
break; break;
case 8: case 8:

View File

@ -92,6 +92,7 @@ void HandleGbaToPngCommand(char *inputPath, char *outputPath, int argc, char **a
options.width = 1; options.width = 1;
options.metatileWidth = 1; options.metatileWidth = 1;
options.metatileHeight = 1; options.metatileHeight = 1;
options.tilemapFilePath = NULL;
options.isAffineMap = false; options.isAffineMap = false;
for (int i = 3; i < argc; i++) for (int i = 3; i < argc; i++)

View File

@ -101,7 +101,7 @@ unsigned char *RLCompress(unsigned char *src, int srcSize, int *compressedSize)
srcPos++; srcPos++;
uncompressedLength++; uncompressedLength++;
} }
if (uncompressedLength > 0) if (uncompressedLength > 0)
{ {
dest[destPos++] = uncompressedLength - 1; dest[destPos++] = uncompressedLength - 1;

0
tools/jsonproc/.gitignore vendored Normal file → Executable file
View File

10
tools/jsonproc/Makefile Normal file → Executable file
View File

@ -8,12 +8,18 @@ SRCS := jsonproc.cpp
HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: jsonproc all: jsonproc$(EXE)
@: @:
jsonproc: $(SRCS) $(HEADERS) jsonproc$(EXE): $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

0
tools/jsonproc/inja.hpp Normal file → Executable file
View File

0
tools/jsonproc/jsonproc.cpp Normal file → Executable file
View File

0
tools/jsonproc/jsonproc.h Normal file → Executable file
View File

0
tools/jsonproc/nlohmann/json.hpp Normal file → Executable file
View File

0
tools/mapjson/.gitignore vendored Normal file → Executable file
View File

View File

@ -6,12 +6,18 @@ SRCS := json11.cpp mapjson.cpp
HEADERS := mapjson.h HEADERS := mapjson.h
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: mapjson all: mapjson$(EXE)
@: @:
mapjson: $(SRCS) $(HEADERS) mapjson$(EXE): $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -77,6 +77,10 @@ string generate_map_header_text(Json map_data, Json layouts_data, string version
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/"
<< map_data["name"].string_value()
<< "/map.json\n@\n\n";
text << map_data["name"].string_value() << ":\n" text << map_data["name"].string_value() << ":\n"
<< "\t.4byte " << layout["name"].string_value() << "\n"; << "\t.4byte " << layout["name"].string_value() << "\n";
@ -124,6 +128,10 @@ string generate_map_connections_text(Json map_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/"
<< map_data["name"].string_value()
<< "/map.json\n@\n\n";
text << map_data["name"].string_value() << "_MapConnectionsList:\n"; text << map_data["name"].string_value() << "_MapConnectionsList:\n";
for (auto &connection : map_data["connections"].array_items()) { for (auto &connection : map_data["connections"].array_items()) {
@ -146,6 +154,10 @@ string generate_map_events_text(Json map_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/"
<< map_data["name"].string_value()
<< "/map.json\n@\n\n";
string objects_label, warps_label, coords_label, bgs_label; string objects_label, warps_label, coords_label, bgs_label;
if (map_data["object_events"].array_items().size() > 0) { if (map_data["object_events"].array_items().size() > 0) {
@ -286,6 +298,8 @@ void process_map(string map_filepath, string layouts_filepath, string version) {
string generate_groups_text(Json groups_data) { string generate_groups_text(Json groups_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n@\n\n";
for (auto &key : groups_data["group_order"].array_items()) { for (auto &key : groups_data["group_order"].array_items()) {
string group = key.string_value(); string group = key.string_value();
text << group << "::\n"; text << group << "::\n";
@ -325,6 +339,8 @@ string generate_connections_text(Json groups_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n@\n\n";
for (Json map_name : map_names) for (Json map_name : map_names)
text << "\t.include \"data/maps/" << map_name.string_value() << "/connections.inc\"\n"; text << "\t.include \"data/maps/" << map_name.string_value() << "/connections.inc\"\n";
@ -340,6 +356,8 @@ string generate_headers_text(Json groups_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n@\n\n";
for (string map_name : map_names) for (string map_name : map_names)
text << "\t.include \"data/maps/" << map_name << "/header.inc\"\n"; text << "\t.include \"data/maps/" << map_name << "/header.inc\"\n";
@ -355,6 +373,8 @@ string generate_events_text(Json groups_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n@\n\n";
for (string map_name : map_names) for (string map_name : map_names)
text << "\t.include \"data/maps/" << map_name << "/events.inc\"\n"; text << "\t.include \"data/maps/" << map_name << "/events.inc\"\n";
@ -370,10 +390,12 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n" text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n"
<< "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n"; << "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n";
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
int group_num = 0; int group_num = 0;
for (auto &group : groups_data["group_order"].array_items()) { for (auto &group : groups_data["group_order"].array_items()) {
text << "// Map Group " << group_num << "\n"; text << "// " << group.string_value() << "\n";
vector<Json> map_ids; vector<Json> map_ids;
size_t max_length = 0; size_t max_length = 0;
@ -428,6 +450,8 @@ void process_groups(string groups_filepath) {
string generate_layout_headers_text(Json layouts_data) { string generate_layout_headers_text(Json layouts_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n@\n\n";
for (auto &layout : layouts_data["layouts"].array_items()) { for (auto &layout : layouts_data["layouts"].array_items()) {
string border_label = layout["name"].string_value() + "_Border"; string border_label = layout["name"].string_value() + "_Border";
string blockdata_label = layout["name"].string_value() + "_Blockdata"; string blockdata_label = layout["name"].string_value() + "_Blockdata";
@ -451,6 +475,8 @@ string generate_layout_headers_text(Json layouts_data) {
string generate_layouts_table_text(Json layouts_data) { string generate_layouts_table_text(Json layouts_data) {
ostringstream text; ostringstream text;
text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n@\n\n";
text << "\t.align 2\n" text << "\t.align 2\n"
<< layouts_data["layouts_table_label"].string_value() << "::\n"; << layouts_data["layouts_table_label"].string_value() << "::\n";
@ -466,6 +492,8 @@ string generate_layouts_constants_text(Json layouts_data) {
text << "#ifndef GUARD_CONSTANTS_LAYOUTS_H\n" text << "#ifndef GUARD_CONSTANTS_LAYOUTS_H\n"
<< "#define GUARD_CONSTANTS_LAYOUTS_H\n\n"; << "#define GUARD_CONSTANTS_LAYOUTS_H\n\n";
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n//\n\n";
int i = 0; int i = 0;
for (auto &layout : layouts_data["layouts"].array_items()) for (auto &layout : layouts_data["layouts"].array_items())
text << "#define " << layout["id"].string_value() << " " << ++i << "\n"; text << "#define " << layout["id"].string_value() << " " << ++i << "\n";

View File

@ -1,19 +1,19 @@
Copyright (c) 2016 YamaArashi Copyright (c) 2016 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -6,12 +6,18 @@ SRCS := agb.cpp error.cpp main.cpp midi.cpp tables.cpp
HEADERS := agb.h error.h main.h midi.h tables.h HEADERS := agb.h error.h main.h midi.h tables.h
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: mid2agb all: mid2agb$(EXE)
@: @:
mid2agb: $(SRCS) $(HEADERS) mid2agb$(EXE): $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -1,19 +1,19 @@
Copyright (c) 2016 YamaArashi Copyright (c) 2016 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -8,12 +8,18 @@ SRCS := asm_file.cpp c_file.cpp charmap.cpp preproc.cpp string_parser.cpp \
HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \ HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \
utf8.h utf8.h
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: preproc all: preproc$(EXE)
@: @:
preproc: $(SRCS) $(HEADERS) preproc$(EXE): $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -26,6 +26,7 @@
#include "char_util.h" #include "char_util.h"
#include "utf8.h" #include "utf8.h"
#include "string_parser.h" #include "string_parser.h"
#include "characters.h"
AsmFile::AsmFile(std::string filename) : m_filename(filename) AsmFile::AsmFile(std::string filename) : m_filename(filename)
{ {
@ -281,7 +282,7 @@ int AsmFile::ReadString(unsigned char* s)
while (length < padLength) while (length < padLength)
{ {
s[length++] = 0; s[length++] = CHAR_SPACE;
} }
} }
@ -290,40 +291,92 @@ int AsmFile::ReadString(unsigned char* s)
return length; return length;
} }
void AsmFile::VerifyStringLength(int length)
{
if (length == kMaxStringLength)
RaiseError("mapped string longer than %d bytes", kMaxStringLength);
}
int AsmFile::ReadBraille(unsigned char* s) int AsmFile::ReadBraille(unsigned char* s)
{ {
static std::map<char, unsigned char> encoding = static std::map<char, unsigned char> encoding =
{ {
{ 'A', 0x01 }, { 'A', BRAILLE_CHAR_A },
{ 'B', 0x05 }, { 'B', BRAILLE_CHAR_B },
{ 'C', 0x03 }, { 'C', BRAILLE_CHAR_C },
{ 'D', 0x0B }, { 'D', BRAILLE_CHAR_D },
{ 'E', 0x09 }, { 'E', BRAILLE_CHAR_E },
{ 'F', 0x07 }, { 'F', BRAILLE_CHAR_F },
{ 'G', 0x0F }, { 'G', BRAILLE_CHAR_G },
{ 'H', 0x0D }, { 'H', BRAILLE_CHAR_H },
{ 'I', 0x06 }, { 'I', BRAILLE_CHAR_I },
{ 'J', 0x0E }, { 'J', BRAILLE_CHAR_J },
{ 'K', 0x11 }, { 'K', BRAILLE_CHAR_K },
{ 'L', 0x15 }, { 'L', BRAILLE_CHAR_L },
{ 'M', 0x13 }, { 'M', BRAILLE_CHAR_M },
{ 'N', 0x1B }, { 'N', BRAILLE_CHAR_N },
{ 'O', 0x19 }, { 'O', BRAILLE_CHAR_O },
{ 'P', 0x17 }, { 'P', BRAILLE_CHAR_P },
{ 'Q', 0x1F }, { 'Q', BRAILLE_CHAR_Q },
{ 'R', 0x1D }, { 'R', BRAILLE_CHAR_R },
{ 'S', 0x16 }, { 'S', BRAILLE_CHAR_S },
{ 'T', 0x1E }, { 'T', BRAILLE_CHAR_T },
{ 'U', 0x31 }, { 'U', BRAILLE_CHAR_U },
{ 'V', 0x35 }, { 'V', BRAILLE_CHAR_V },
{ 'W', 0x2E }, { 'W', BRAILLE_CHAR_W },
{ 'X', 0x33 }, { 'X', BRAILLE_CHAR_X },
{ 'Y', 0x3B }, { 'Y', BRAILLE_CHAR_Y },
{ 'Z', 0x39 }, { 'Z', BRAILLE_CHAR_Z },
{ ' ', 0x00 }, { 'a', BRAILLE_CHAR_A },
{ ',', 0x04 }, { 'b', BRAILLE_CHAR_B },
{ '.', 0x2C }, { 'c', BRAILLE_CHAR_C },
{ '$', 0xFF }, { 'd', BRAILLE_CHAR_D },
{ 'e', BRAILLE_CHAR_E },
{ 'f', BRAILLE_CHAR_F },
{ 'g', BRAILLE_CHAR_G },
{ 'h', BRAILLE_CHAR_H },
{ 'i', BRAILLE_CHAR_I },
{ 'j', BRAILLE_CHAR_J },
{ 'k', BRAILLE_CHAR_K },
{ 'l', BRAILLE_CHAR_L },
{ 'm', BRAILLE_CHAR_M },
{ 'n', BRAILLE_CHAR_N },
{ 'o', BRAILLE_CHAR_O },
{ 'p', BRAILLE_CHAR_P },
{ 'q', BRAILLE_CHAR_Q },
{ 'r', BRAILLE_CHAR_R },
{ 's', BRAILLE_CHAR_S },
{ 't', BRAILLE_CHAR_T },
{ 'u', BRAILLE_CHAR_U },
{ 'v', BRAILLE_CHAR_V },
{ 'w', BRAILLE_CHAR_W },
{ 'x', BRAILLE_CHAR_X },
{ 'y', BRAILLE_CHAR_Y },
{ 'z', BRAILLE_CHAR_Z },
{ '0', BRAILLE_CHAR_0 },
{ '1', BRAILLE_CHAR_1 },
{ '2', BRAILLE_CHAR_2 },
{ '3', BRAILLE_CHAR_3 },
{ '4', BRAILLE_CHAR_4 },
{ '5', BRAILLE_CHAR_5 },
{ '6', BRAILLE_CHAR_6 },
{ '7', BRAILLE_CHAR_7 },
{ '8', BRAILLE_CHAR_8 },
{ '9', BRAILLE_CHAR_9 },
{ ' ', BRAILLE_CHAR_SPACE },
{ ',', BRAILLE_CHAR_COMMA },
{ '.', BRAILLE_CHAR_PERIOD },
{ '?', BRAILLE_CHAR_QUESTION_MARK },
{ '!', BRAILLE_CHAR_EXCL_MARK },
{ ':', BRAILLE_CHAR_COLON },
{ ';', BRAILLE_CHAR_SEMICOLON },
{ '-', BRAILLE_CHAR_HYPHEN },
{ '/', BRAILLE_CHAR_SLASH },
{ '(', BRAILLE_CHAR_PAREN },
{ ')', BRAILLE_CHAR_PAREN },
{ '\'', BRAILLE_CHAR_APOSTROPHE },
{ '#', BRAILLE_CHAR_NUMBER },
{ '$', EOS },
}; };
SkipWhitespace(); SkipWhitespace();
@ -335,14 +388,13 @@ int AsmFile::ReadBraille(unsigned char* s)
m_pos++; m_pos++;
bool inNumber = false;
while (m_buffer[m_pos] != '"') while (m_buffer[m_pos] != '"')
{ {
if (length == kMaxStringLength)
RaiseError("mapped string longer than %d bytes", kMaxStringLength);
if (m_buffer[m_pos] == '\\' && m_buffer[m_pos + 1] == 'n') if (m_buffer[m_pos] == '\\' && m_buffer[m_pos + 1] == 'n')
{ {
s[length++] = 0xFE; VerifyStringLength(length);
s[length++] = CHAR_NEWLINE;
m_pos += 2; m_pos += 2;
} }
else else
@ -357,6 +409,21 @@ int AsmFile::ReadBraille(unsigned char* s)
RaiseError("character '\\x%02X' not valid in braille string", m_buffer[m_pos]); RaiseError("character '\\x%02X' not valid in braille string", m_buffer[m_pos]);
} }
if (!inNumber && c >= '0' && c <= '9' )
{
// Output number indicator at start of a number
inNumber = true;
VerifyStringLength(length);
s[length++] = BRAILLE_CHAR_NUMBER;
}
else if (inNumber && encoding[c] == BRAILLE_CHAR_SPACE)
{
// Number ends at a space.
// Non-number characters encountered before a space will simply be output as is.
inNumber = false;
}
VerifyStringLength(length);
s[length++] = encoding[c]; s[length++] = encoding[c];
m_pos++; m_pos++;
} }

View File

@ -67,6 +67,7 @@ private:
void ReportDiagnostic(const char* type, const char* format, std::va_list args); void ReportDiagnostic(const char* type, const char* format, std::va_list args);
void RaiseError(const char* format, ...); void RaiseError(const char* format, ...);
void RaiseWarning(const char* format, ...); void RaiseWarning(const char* format, ...);
void VerifyStringLength(int length);
}; };
#endif // ASM_FILE_H #endif // ASM_FILE_H

View File

@ -23,32 +23,59 @@
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <memory> #include <memory>
#include <cstring>
#include <cerrno>
#include "preproc.h" #include "preproc.h"
#include "c_file.h" #include "c_file.h"
#include "char_util.h" #include "char_util.h"
#include "utf8.h" #include "utf8.h"
#include "string_parser.h" #include "string_parser.h"
CFile::CFile(std::string filename) : m_filename(filename) CFile::CFile(const char * filenameCStr, bool isStdin)
{ {
FILE *fp = std::fopen(filename.c_str(), "rb"); FILE *fp;
if (isStdin) {
fp = stdin;
m_filename = std::string{"<stdin>/"}.append(filenameCStr);
} else {
fp = std::fopen(filenameCStr, "rb");
m_filename = std::string(filenameCStr);
}
std::string& filename = m_filename;
if (fp == NULL) if (fp == NULL)
FATAL_ERROR("Failed to open \"%s\" for reading.\n", filename.c_str()); FATAL_ERROR("Failed to open \"%s\" for reading.\n", filename.c_str());
std::fseek(fp, 0, SEEK_END); m_size = 0;
m_buffer = (char *)malloc(CHUNK_SIZE + 1);
if (m_buffer == NULL) {
FATAL_ERROR("Failed to allocate memory to process file \"%s\"!", filename.c_str());
}
m_size = std::ftell(fp); std::size_t numAllocatedBytes = CHUNK_SIZE + 1;
std::size_t bufferOffset = 0;
std::size_t count;
if (m_size < 0) while ((count = std::fread(m_buffer + bufferOffset, 1, CHUNK_SIZE, fp)) != 0) {
FATAL_ERROR("File size of \"%s\" is less than zero.\n", filename.c_str()); if (!std::ferror(fp)) {
m_size += count;
m_buffer = new char[m_size + 1]; if (std::feof(fp)) {
break;
}
std::rewind(fp); numAllocatedBytes += CHUNK_SIZE;
bufferOffset += CHUNK_SIZE;
if (std::fread(m_buffer, m_size, 1, fp) != 1) m_buffer = (char *)realloc(m_buffer, numAllocatedBytes);
FATAL_ERROR("Failed to read \"%s\".\n", filename.c_str()); if (m_buffer == NULL) {
FATAL_ERROR("Failed to allocate memory to process file \"%s\"!", filename.c_str());
}
} else {
FATAL_ERROR("Failed to read \"%s\". (error: %s)", filename.c_str(), std::strerror(errno));
}
}
m_buffer[m_size] = 0; m_buffer[m_size] = 0;
@ -56,6 +83,7 @@ CFile::CFile(std::string filename) : m_filename(filename)
m_pos = 0; m_pos = 0;
m_lineNum = 1; m_lineNum = 1;
m_isStdin = isStdin;
} }
CFile::CFile(CFile&& other) : m_filename(std::move(other.m_filename)) CFile::CFile(CFile&& other) : m_filename(std::move(other.m_filename))
@ -64,13 +92,14 @@ CFile::CFile(CFile&& other) : m_filename(std::move(other.m_filename))
m_pos = other.m_pos; m_pos = other.m_pos;
m_size = other.m_size; m_size = other.m_size;
m_lineNum = other.m_lineNum; m_lineNum = other.m_lineNum;
m_isStdin = other.m_isStdin;
other.m_buffer = nullptr; other.m_buffer = NULL;
} }
CFile::~CFile() CFile::~CFile()
{ {
delete[] m_buffer; free(m_buffer);
} }
void CFile::Preproc() void CFile::Preproc()

View File

@ -30,7 +30,7 @@
class CFile class CFile
{ {
public: public:
CFile(std::string filename); CFile(const char * filenameCStr, bool isStdin);
CFile(CFile&& other); CFile(CFile&& other);
CFile(const CFile&) = delete; CFile(const CFile&) = delete;
~CFile(); ~CFile();
@ -42,6 +42,7 @@ private:
long m_size; long m_size;
long m_lineNum; long m_lineNum;
std::string m_filename; std::string m_filename;
bool m_isStdin;
bool ConsumeHorizontalWhitespace(); bool ConsumeHorizontalWhitespace();
bool ConsumeNewline(); bool ConsumeNewline();
@ -55,4 +56,6 @@ private:
void RaiseWarning(const char* format, ...); void RaiseWarning(const char* format, ...);
}; };
#define CHUNK_SIZE 4096
#endif // C_FILE_H #endif // C_FILE_H

339
tools/preproc/characters.h Normal file
View File

@ -0,0 +1,339 @@
#ifndef GUARD_CHARACTERS_H
#define GUARD_CHARACTERS_H
#define CHAR_SPACE 0x00
#define CHAR_A_GRAVE 0x01
#define CHAR_A_ACUTE 0x02
#define CHAR_A_CIRCUMFLEX 0x03
#define CHAR_C_CEDILLA 0x04
#define CHAR_E_GRAVE 0x05
#define CHAR_E_ACUTE 0x06
#define CHAR_E_CIRCUMFLEX 0x07
#define CHAR_E_DIAERESIS 0x08
#define CHAR_I_GRAVE 0x09
//#define CHAR_I_ACUTE 0x0A // Is 0x5A instead
#define CHAR_I_CIRCUMFLEX 0x0B
#define CHAR_I_DIAERESIS 0x0C
#define CHAR_O_GRAVE 0x0D
#define CHAR_O_ACUTE 0x0E
#define CHAR_O_CIRCUMFLEX 0x0F
#define CHAR_OE 0x10
#define CHAR_U_GRAVE 0x11
#define CHAR_U_ACUTE 0x12
#define CHAR_U_CIRCUMFLEX 0x13
#define CHAR_N_TILDE 0x14
#define CHAR_ESZETT 0x15
#define CHAR_a_GRAVE 0x16
#define CHAR_a_ACUTE 0x17
//#define CHAR_a_CIRCUMFLEX 0x18 // Is 0x68 instead
#define CHAR_c_CEDILLA 0x19
#define CHAR_e_GRAVE 0x1A
#define CHAR_e_ACUTE 0x1B
#define CHAR_e_CIRCUMFLEX 0x1C
#define CHAR_e_DIAERESIS 0x1D
#define CHAR_i_GRAVE 0x1E
//#define CHAR_i_ACUTE 0x1F // Is 0x6F instead
#define CHAR_i_CIRCUMFLEX 0x20
#define CHAR_i_DIAERESIS 0x21
#define CHAR_o_GRAVE 0x22
#define CHAR_o_ACUTE 0x23
#define CHAR_o_CIRCUMFLEX 0x24
#define CHAR_oe 0x25
#define CHAR_u_GRAVE 0x26
#define CHAR_u_ACUTE 0x27
#define CHAR_u_CIRCUMFLEX 0x28
#define CHAR_n_TILDE 0x29
#define CHAR_MASCULINE_ORDINAL 0x2A
#define CHAR_FEMININE_ORDINAL 0x2B
#define CHAR_SUPER_ER 0x2C
#define CHAR_AMPERSAND 0x2D
#define CHAR_PLUS 0x2E
//
#define CHAR_LV 0x34
#define CHAR_EQUALS 0x35
#define CHAR_SEMICOLON 0x36
#define CHAR_BARD_WORD_DELIMIT 0x37 // Empty space to separate words in Bard's song
#define CHAR_INV_QUESTION_MARK 0x51
#define CHAR_INV_EXCL_MARK 0x52
#define CHAR_PK 0x53
#define CHAR_MN 0x54
#define CHAR_PO 0x55
#define CHAR_KE 0x56
#define CHAR_BLOCK_1 0x57 // Each of these 3
#define CHAR_BLOCK_2 0x58 // chars contains 1/3
#define CHAR_BLOCK_3 0x59 // of the word BLOCK
#define CHAR_I_ACUTE 0x5A
#define CHAR_PERCENT 0x5B
#define CHAR_LEFT_PAREN 0x5C
#define CHAR_RIGHT_PAREN 0x5D
//
#define CHAR_a_CIRCUMFLEX 0x68
//
#define CHAR_i_ACUTE 0x6F
//
#define CHAR_SPACER 0x77 // Empty space
//
#define CHAR_UP_ARROW 0x79
#define CHAR_DOWN_ARROW 0x7A
#define CHAR_LEFT_ARROW 0x7B
#define CHAR_RIGHT_ARROW 0x7C
//
#define CHAR_SUPER_E 0x84
#define CHAR_LESS_THAN 0x85
#define CHAR_GREATER_THAN 0x86
//
#define CHAR_SUPER_RE 0xA0
#define CHAR_0 0xA1
#define CHAR_1 0xA2
#define CHAR_2 0xA3
#define CHAR_3 0xA4
#define CHAR_4 0xA5
#define CHAR_5 0xA6
#define CHAR_6 0xA7
#define CHAR_7 0xA8
#define CHAR_8 0xA9
#define CHAR_9 0xAA
#define CHAR_EXCL_MARK 0xAB
#define CHAR_QUESTION_MARK 0xAC
#define CHAR_PERIOD 0xAD
#define CHAR_HYPHEN 0xAE
#define CHAR_BULLET 0xAF
#define CHAR_ELLIPSIS 0xB0
#define CHAR_DBL_QUOTE_LEFT 0xB1
#define CHAR_DBL_QUOTE_RIGHT 0xB2
#define CHAR_SGL_QUOTE_LEFT 0xB3
#define CHAR_SGL_QUOTE_RIGHT 0xB4
#define CHAR_MALE 0xB5
#define CHAR_FEMALE 0xB6
#define CHAR_CURRENCY 0xB7
#define CHAR_COMMA 0xB8
#define CHAR_MULT_SIGN 0xB9
#define CHAR_SLASH 0xBA
#define CHAR_A 0xBB
#define CHAR_B 0xBC
#define CHAR_C 0xBD
#define CHAR_D 0xBE
#define CHAR_E 0xBF
#define CHAR_F 0xC0
#define CHAR_G 0xC1
#define CHAR_H 0xC2
#define CHAR_I 0xC3
#define CHAR_J 0xC4
#define CHAR_K 0xC5
#define CHAR_L 0xC6
#define CHAR_M 0xC7
#define CHAR_N 0xC8
#define CHAR_O 0xC9
#define CHAR_P 0xCA
#define CHAR_Q 0xCB
#define CHAR_R 0xCC
#define CHAR_S 0xCD
#define CHAR_T 0xCE
#define CHAR_U 0xCF
#define CHAR_V 0xD0
#define CHAR_W 0xD1
#define CHAR_X 0xD2
#define CHAR_Y 0xD3
#define CHAR_Z 0xD4
#define CHAR_a 0xD5
#define CHAR_b 0xD6
#define CHAR_c 0xD7
#define CHAR_d 0xD8
#define CHAR_e 0xD9
#define CHAR_f 0xDA
#define CHAR_g 0xDB
#define CHAR_h 0xDC
#define CHAR_i 0xDD
#define CHAR_j 0xDE
#define CHAR_k 0xDF
#define CHAR_l 0xE0
#define CHAR_m 0xE1
#define CHAR_n 0xE2
#define CHAR_o 0xE3
#define CHAR_p 0xE4
#define CHAR_q 0xE5
#define CHAR_r 0xE6
#define CHAR_s 0xE7
#define CHAR_t 0xE8
#define CHAR_u 0xE9
#define CHAR_v 0xEA
#define CHAR_w 0xEB
#define CHAR_x 0xEC
#define CHAR_y 0xED
#define CHAR_z 0xEE
#define CHAR_BLACK_TRIANGLE 0xEF
#define CHAR_COLON 0xF0
#define CHAR_A_DIAERESIS 0xF1
#define CHAR_O_DIAERESIS 0xF2
#define CHAR_U_DIAERESIS 0xF3
#define CHAR_a_DIAERESIS 0xF4
#define CHAR_o_DIAERESIS 0xF5
#define CHAR_u_DIAERESIS 0xF6
#define CHAR_DYNAMIC 0xF7
#define CHAR_KEYPAD_ICON 0xF8
#define CHAR_EXTRA_SYMBOL 0xF9
#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog
#define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog
#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code
#define PLACEHOLDER_BEGIN 0xFD // string placeholder
#define CHAR_NEWLINE 0xFE
#define EOS 0xFF // end of string
// CHAR_KEYPAD_ICON chars
#define CHAR_A_BUTTON 0x00
#define CHAR_B_BUTTON 0x01
#define CHAR_L_BUTTON 0x02
#define CHAR_R_BUTTON 0x03
#define CHAR_START_BUTTON 0x04
#define CHAR_SELECT_BUTTON 0x05
#define CHAR_DPAD_UP 0x06
#define CHAR_DPAD_DOWN 0x07
#define CHAR_DPAD_LEFT 0x08
#define CHAR_DPAD_RIGHT 0x09
#define CHAR_DPAD_UPDOWN 0x0A
#define CHAR_DPAD_LEFTRIGHT 0x0B
#define CHAR_DPAD_NONE 0x0C
// CHAR_EXTRA_SYMBOL chars
#define CHAR_UP_ARROW_2 0x00
#define CHAR_DOWN_ARROW_2 0x01
#define CHAR_LEFT_ARROW_2 0x02
#define CHAR_RIGHT_ARROW_2 0x03
#define CHAR_PLUS_2 0x04
#define CHAR_LV_2 0x05
#define CHAR_PP 0x06
#define CHAR_ID 0x07
#define CHAR_NO 0x08
#define CHAR_UNDERSCORE 0x09
#define EXT_CTRL_CODE_COLOR 0x01
#define EXT_CTRL_CODE_HIGHLIGHT 0x02
#define EXT_CTRL_CODE_SHADOW 0x03
#define EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW 0x04
#define EXT_CTRL_CODE_PALETTE 0x05
#define EXT_CTRL_CODE_FONT 0x06
#define EXT_CTRL_CODE_RESET_SIZE 0x07
#define EXT_CTRL_CODE_PAUSE 0x08
#define EXT_CTRL_CODE_PAUSE_UNTIL_PRESS 0x09
#define EXT_CTRL_CODE_WAIT_SE 0x0A
#define EXT_CTRL_CODE_PLAY_BGM 0x0B
#define EXT_CTRL_CODE_ESCAPE 0x0C
#define EXT_CTRL_CODE_SHIFT_TEXT 0x0D
#define EXT_CTRL_CODE_SHIFT_DOWN 0x0E
#define EXT_CTRL_CODE_FILL_WINDOW 0x0F
#define EXT_CTRL_CODE_PLAY_SE 0x10
#define EXT_CTRL_CODE_CLEAR 0x11
#define EXT_CTRL_CODE_SKIP 0x12
#define EXT_CTRL_CODE_CLEAR_TO 0x13
#define EXT_CTRL_CODE_MIN_LETTER_SPACING 0x14
#define EXT_CTRL_CODE_JPN 0x15
#define EXT_CTRL_CODE_ENG 0x16
#define EXT_CTRL_CODE_PAUSE_MUSIC 0x17
#define EXT_CTRL_CODE_RESUME_MUSIC 0x18
#define TEXT_COLOR_TRANSPARENT 0x0
#define TEXT_COLOR_WHITE 0x1
#define TEXT_COLOR_DARK_GRAY 0x2
#define TEXT_COLOR_LIGHT_GRAY 0x3
#define TEXT_COLOR_RED 0x4
#define TEXT_COLOR_LIGHT_RED 0x5
#define TEXT_COLOR_GREEN 0x6
#define TEXT_COLOR_LIGHT_GREEN 0x7
#define TEXT_COLOR_BLUE 0x8
#define TEXT_COLOR_LIGHT_BLUE 0x9
#define TEXT_DYNAMIC_COLOR_1 0xA // Usually white
#define TEXT_DYNAMIC_COLOR_2 0xB // Usually white w/ tinge of green
#define TEXT_DYNAMIC_COLOR_3 0xC // Usually white
#define TEXT_DYNAMIC_COLOR_4 0xD // Usually aquamarine
#define TEXT_DYNAMIC_COLOR_5 0xE // Usually blue-green
#define TEXT_DYNAMIC_COLOR_6 0xF // Usually cerulean
#define PLACEHOLDER_ID_UNKNOWN 0x0
#define PLACEHOLDER_ID_PLAYER 0x1
#define PLACEHOLDER_ID_STRING_VAR_1 0x2
#define PLACEHOLDER_ID_STRING_VAR_2 0x3
#define PLACEHOLDER_ID_STRING_VAR_3 0x4
#define PLACEHOLDER_ID_KUN 0x5
#define PLACEHOLDER_ID_RIVAL 0x6
#define PLACEHOLDER_ID_VERSION 0x7
#define PLACEHOLDER_ID_AQUA 0x8
#define PLACEHOLDER_ID_MAGMA 0x9
#define PLACEHOLDER_ID_ARCHIE 0xA
#define PLACEHOLDER_ID_MAXIE 0xB
#define PLACEHOLDER_ID_KYOGRE 0xC
#define PLACEHOLDER_ID_GROUDON 0xD
// battle placeholders are located in battle_message.h
// Hiragana from 0x1-0x50, Katakana from 0x51-0xA0.
// This excludes Japanese punctuation, which end at 0xB0
#define JAPANESE_CHAR_END 0xA0
// Note that while all dot combinations are represented in
// the Braille font, they are not all meaningful characters.
// Only those that have direct single-character translations are listed.
#define BRAILLE_CHAR_SPACE 0x00
#define BRAILLE_CHAR_A 0x01
//
#define BRAILLE_CHAR_C 0x03
#define BRAILLE_CHAR_COMMA 0x04
#define BRAILLE_CHAR_B 0x05
#define BRAILLE_CHAR_I 0x06
#define BRAILLE_CHAR_F 0x07
//
#define BRAILLE_CHAR_E 0x09
//
#define BRAILLE_CHAR_D 0x0B
#define BRAILLE_CHAR_COLON 0x0C
#define BRAILLE_CHAR_H 0x0D
#define BRAILLE_CHAR_J 0x0E
#define BRAILLE_CHAR_G 0x0F
#define BRAILLE_CHAR_APOSTROPHE 0x10
#define BRAILLE_CHAR_K 0x11
#define BRAILLE_CHAR_SLASH 0x12
#define BRAILLE_CHAR_M 0x13
#define BRAILLE_CHAR_SEMICOLON 0x14
#define BRAILLE_CHAR_L 0x15
#define BRAILLE_CHAR_S 0x16
#define BRAILLE_CHAR_P 0x17
//
#define BRAILLE_CHAR_O 0x19
//
#define BRAILLE_CHAR_N 0x1B
#define BRAILLE_CHAR_EXCL_MARK 0x1C
#define BRAILLE_CHAR_R 0x1D
#define BRAILLE_CHAR_T 0x1E
#define BRAILLE_CHAR_Q 0x1F
//
#define BRAILLE_CHAR_PERIOD 0x2C
//
#define BRAILLE_CHAR_W 0x2E
//
#define BRAILLE_CHAR_HYPHEN 0x30
#define BRAILLE_CHAR_U 0x31
//
#define BRAILLE_CHAR_X 0x33
#define BRAILLE_CHAR_QUESTION_MARK 0x34 // Also double quote left
#define BRAILLE_CHAR_V 0x35
//
#define BRAILLE_CHAR_DBL_QUOTE_RIGHT 0x38
#define BRAILLE_CHAR_Z 0x39
#define BRAILLE_CHAR_NUMBER 0x3A
#define BRAILLE_CHAR_Y 0x3B
#define BRAILLE_CHAR_PAREN 0x3C
//
#define NUM_BRAILLE_CHARS 0x40
// Digits must be preceded by BRAILLE_CHAR_NUMBER
#define BRAILLE_CHAR_1 BRAILLE_CHAR_A
#define BRAILLE_CHAR_2 BRAILLE_CHAR_B
#define BRAILLE_CHAR_3 BRAILLE_CHAR_C
#define BRAILLE_CHAR_4 BRAILLE_CHAR_D
#define BRAILLE_CHAR_5 BRAILLE_CHAR_E
#define BRAILLE_CHAR_6 BRAILLE_CHAR_F
#define BRAILLE_CHAR_7 BRAILLE_CHAR_G
#define BRAILLE_CHAR_8 BRAILLE_CHAR_H
#define BRAILLE_CHAR_9 BRAILLE_CHAR_I
#define BRAILLE_CHAR_0 BRAILLE_CHAR_J
#endif // GUARD_CHARACTERS_H

View File

@ -103,9 +103,9 @@ void PreprocAsmFile(std::string filename)
} }
} }
void PreprocCFile(std::string filename) void PreprocCFile(const char * filename, bool isStdin)
{ {
CFile cFile(filename); CFile cFile(filename, isStdin);
cFile.Preproc(); cFile.Preproc();
} }
@ -132,9 +132,9 @@ char* GetFileExtension(char* filename)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
if (argc != 3) if (argc < 3 || argc > 4)
{ {
std::fprintf(stderr, "Usage: %s SRC_FILE CHARMAP_FILE", argv[0]); std::fprintf(stderr, "Usage: %s SRC_FILE CHARMAP_FILE [-i]\nwhere -i denotes if input is from stdin\n", argv[0]);
return 1; return 1;
} }
@ -147,9 +147,17 @@ int main(int argc, char **argv)
if ((extension[0] == 's') && extension[1] == 0) if ((extension[0] == 's') && extension[1] == 0)
PreprocAsmFile(argv[1]); PreprocAsmFile(argv[1]);
else if ((extension[0] == 'c' || extension[0] == 'i') && extension[1] == 0) else if ((extension[0] == 'c' || extension[0] == 'i') && extension[1] == 0) {
PreprocCFile(argv[1]); if (argc == 4) {
else if (argv[3][0] == '-' && argv[3][1] == 'i' && argv[3][2] == '\0') {
PreprocCFile(argv[1], true);
} else {
FATAL_ERROR("unknown argument flag \"%s\".\n", argv[3]);
}
} else {
PreprocCFile(argv[1], false);
}
} else
FATAL_ERROR("\"%s\" has an unknown file extension of \"%s\".\n", argv[1], extension); FATAL_ERROR("\"%s\" has an unknown file extension of \"%s\".\n", argv[1], extension);
return 0; return 0;

View File

@ -1,19 +1,19 @@
Copyright (c) 2016 YamaArashi Copyright (c) 2016 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -8,10 +8,16 @@ HEADERS := ramscrgen.h sym_file.h elf.h char_util.h
.PHONY: all clean .PHONY: all clean
all: ramscrgen ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
all: ramscrgen$(EXE)
@: @:
ramscrgen: $(SRCS) $(HEADERS) ramscrgen$(EXE): $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -1,19 +1,19 @@
Copyright (c) 2015-2016 YamaArashi Copyright (c) 2015-2016 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -8,10 +8,16 @@ SRCS = main.c convert_png.c util.c font.c
.PHONY: all clean .PHONY: all clean
all: rsfont ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
all: rsfont$(EXE)
@: @:
rsfont: $(SRCS) convert_png.h gfx.h global.h util.h font.h rsfont$(EXE): $(SRCS) convert_png.h gfx.h global.h util.h font.h
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
clean: clean:

View File

@ -1,19 +1,19 @@
Copyright (c) 2015 YamaArashi Copyright (c) 2015 YamaArashi
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@ -8,10 +8,16 @@ HEADERS := scaninc.h asm_file.h c_file.h source_file.h
.PHONY: all clean .PHONY: all clean
all: scaninc ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
all: scaninc$(EXE)
@: @:
scaninc: $(SRCS) $(HEADERS) scaninc$(EXE): $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -108,7 +108,7 @@ int main(int argc, char **argv)
break; break;
} }
} }
if (!exists && file.FileType() == SourceFileType::Asm) if (!exists && (file.FileType() == SourceFileType::Asm || file.FileType() == SourceFileType::Inc))
{ {
path = include; path = include;
} }