diff --git a/.gitignore b/.gitignore index 9cd5496..80a150d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ -*.bin -*.elf -*.o +##### TUP GITIGNORE ##### +##### Lines below automatically generated by Tup. +##### Do not edit. +.tup +/.gitignore +/rom.bin +/rom.elf +/rom.o diff --git a/Tupfile b/Tupfile new file mode 100644 index 0000000..f323c04 --- /dev/null +++ b/Tupfile @@ -0,0 +1,7 @@ +.gitignore +LDFLAGS = -z max-page-size=1 --orphan-handling=error -T rom.ld +ASFLAGS = -m68010 --register-prefix-optional + +: rom.68k |> m68k-elf-as $(ASFLAGS) -o %o %f |> rom.o +: rom.o |> m68k-elf-ld $(LDFLAGS) -o %o %f |> rom.elf +: rom.elf |> m68k-elf-objcopy -O binary %f %o |> rom.bin diff --git a/Tupfile.ini b/Tupfile.ini new file mode 100644 index 0000000..e69de29 diff --git a/build_rom.sh b/build_rom.sh deleted file mode 100755 index b6efc71..0000000 --- a/build_rom.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash -x -m68k-elf-as -m68010 --register-prefix-optional -o rom.o rom.68k -m68k-elf-ld -z max-page-size=1 -T rom.ld -o rom.elf rom.o -m68k-elf-objcopy -O binary rom.elf rom.bin diff --git a/rom.68k b/rom.68k index 00b3261..db8ebd9 100644 --- a/rom.68k +++ b/rom.68k @@ -1,5 +1,6 @@ - .long fakestack, start -start: +.long fakestack, _start +.global _start +_start: move.w #0x1, d0 | Find the ROM card bra.b find_first_card romfindret: diff --git a/rom.ld b/rom.ld index 539193c..04fee54 100644 --- a/rom.ld +++ b/rom.ld @@ -1,5 +1,7 @@ +ENTRY(_start) + SECTIONS { . = 0x0; - _etext = .; .text : { *(.text) } + /DISCARD/ : { *(.data) *(.bss) } }