Patch to Rev R Sun-2 boot rom to speed up booting in simulation

This commit is contained in:
Romain Dolbeau
2025-09-28 14:03:05 +02:00
parent 4d626b2911
commit 18db46f61f
5 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
RETRO68=/home/dolbeau/Retro68/build/toolchain
AS=${RETRO68}/bin/m68k-apple-macos-as
CC=${RETRO68}/bin/m68k-apple-macos-gcc
LD=${RETRO68}/bin/m68k-apple-macos-ld
STRIP=${RETRO68}/bin/m68k-apple-macos-strip
OBJCOPY=${RETRO68}/bin/m68k-apple-macos-objcopy
NM=${RETRO68}/bin/m68k-apple-macos-nm
HOSTCC=gcc
HOSTCFLAGS=-O2
ARCHFLAGS=-march=68010 -mcpu=68010
CFLAGS=-O2 -mpcrel
GENLINK=../patcher/genlink
PATCHER=../patcher/patcher
all: sun2-multi-rev-R.bin
show: rompatch.elf
$(NM) $< | sort
sun2-multi-rev-R.bin: ../ rompatch.raw input.txt
/bin/cp ../sun2-multi-rev-R.bin sun2-multi-rev-R.bin
${PATCHER} -i rompatch.raw -p sun2-multi-rev-R.bin -d input.txt
linker.ld: input.txt rompatch.s
${GENLINK} -d $< >| $@
echo $(shell for X in `grep .section rompatch.s | awk '{ print $$2 }' `; do grep -q $$X linker.ld || echo " $$X has no entry in linker.ld" && /bin/false; done)
rompatch.o: rompatch.s
${AS} ${ARCHFLAGS} $< -o $@ -a > rompatch.l
rompatch.elf: linker.ld rompatch.o ${CSRC:.c=.o} # linker script must be first
${LD} -o $@ -T $^
rompatch.raw: rompatch.elf
${OBJCOPY} $^ $@ --input-target=elf32-m68k --output-target=binary
clean:
rm -f res.inc ${CSRC_ASM} *.o rompatch.srec rompatch.raw rompatch.dir rompatch.l linker.ld rompatch.elf

View File

@@ -0,0 +1,2 @@
loweritercount: reduce the count of iteration in the wite loop between LED value.
Mconstop: skip memory testing

View File

@@ -0,0 +1,3 @@
0x0001b6, 0, diagret
0x000b80, 2, loweritercount
0x000e80, 4, Mconstop

View File

@@ -0,0 +1,11 @@
.section .text.diagret
diagret:
.section .text.loweritercount
loweritercount:
.short 2
.section .text.Mconstop
Mconstop:
jmp (%pc,diagret)

Binary file not shown.