From: notaz Date: Mon, 16 May 2011 21:15:55 +0000 (+0300) Subject: hexed: use bin size for reloc; minor updates X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=megadrive.git;a=commitdiff_plain;h=6f93f411b27296f8a96761061312cd70a15c8884 hexed: use bin size for reloc; minor updates --- diff --git a/hexed/Makefile b/hexed/Makefile index 8b992bd..894c439 100644 --- a/hexed/Makefile +++ b/hexed/Makefile @@ -10,24 +10,28 @@ CPPFLAGS += -Wa,-m68000 -Wa,--register-prefix-optional -Wa,--bitwise-or -Wa,-pic TARGET = hexed.bin OBJS = sega_gcc.o hexed.o transfer.o font.o -all : $(TARGET) +all: $(TARGET) -$(TARGET) : a.out +$(TARGET): a.out $(OBJCOPY) -I elf32-m68k -O binary $^ $@ -a.out : $(OBJS) +a.out: $(OBJS) $(LD) -Tmd.ld -Map $(TARGET).map $^ clean: - $(RM) $(TARGET) $(OBJS) $(TARGET).map a.out + $(RM) $(TARGET) $(OBJS) $(TARGET).map a.out pc_transfer + pc_transfer: pc_transfer.c gcc -Wall -O2 -ggdb -o $@ $^ - -.S.o: +%.o: %.S $(CC) -c -o $@ $^ $(CPPFLAGS) +%.bin: %.o + $(OBJCOPY) -I elf32-m68k -O binary $^ $@ + + # ----------- release ----------- ifneq ($(findstring rel,$(MAKECMDGOALS)),) ifeq ($(VER),) diff --git a/hexed/hexed.s b/hexed/hexed.s index 3746191..b7d9186 100644 --- a/hexed/hexed.s +++ b/hexed/hexed.s @@ -215,6 +215,9 @@ safe_addrs: dc.l 0xa13000, 0xa130ff safe_addrs_end: +sizeof_bin: + dc.l _edata + txt_edit: .ascii "- edit -\0" txt_a_confirm: @@ -269,7 +272,8 @@ main: bne 0f move.l #0,a0 - move.w #0x2000/8-1,d0 + move.l (sizeof_bin,pc),d0 + lsr.l #3,d0 1: move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ @@ -286,7 +290,8 @@ main: /* copy, assume 8K size */ move.l #0xFF0100,a1 - move.w #0x2000/8-1,d0 + move.l (sizeof_bin,pc),d0 + lsr.l #3,d0 1: move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ diff --git a/hexed/sega_gcc.s b/hexed/sega_gcc.s index ca0c0f9..580d496 100644 --- a/hexed/sega_gcc.s +++ b/hexed/sega_gcc.s @@ -8,8 +8,8 @@ dc.l INT,INT,INT,INT,INT,INT,INT,INT dc.l INT,INT,INT,INT,INT,INT,INT .ascii "SEGA GENESIS " - .ascii "hexed (c) notaz, 2009 " - .ascii "HEXED (C) NOTAZ, 2009 " + .ascii "hexed (c) notaz, 2009-2011 " + .ascii "HEXED (C) NOTAZ, 2009-2011 " .ascii "GM 00000000-00" .byte 0x00,0x00 .ascii "JD "