add a Sun3_60NoParity preliminary patch (untested)

This commit is contained in:
Romain Dolbeau
2025-07-19 14:23:00 +02:00
parent 968a715cab
commit e7422bc346
4 changed files with 117 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=68020 -mcpu=68020
CFLAGS=-O2 -mpcrel
GENLINK=../patcher/genlink
PATCHER=../patcher/patcher
all: sun3_60_v1.9.bin
show: rompatch.elf
$(NM) $< | sort
sun3_60_v1.9.bin: ../ rompatch.raw input.txt
/bin/cp ../sun3_60_v1.9 sun3_60_v1.9.bin
${PATCHER} -i rompatch.raw -p sun3_60_v1.9.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,7 @@
0x003a4, 6, fixIrq7Handler
0x0188c, 8, fixMonReset
0x026da, 10, bypassTest0Eand0Fpatch
0x028f2, 0, test_10_memory_test
0x02920, 8, patch_test_10_memory_test_1
0x0299c, 36, patch_test_10_memory_test_2
0x04070, 6, fixMonitor_Key_K

View File

@@ -0,0 +1,69 @@
.section .text.fixIrq7Handler
/* don't read the Memory Error Register in the Lvl 7 Interrupt Handler */
/* this is the most likely to reapper in an operating system... */
fixIrq7Handler:
move.b #0,%d0
nop
.section .text.fixMonReset
/* don't bother initializing the parity */
fixMonReset:
nop
nop
nop
nop
.section .text.bypassTest0Eand0Fpatch
/* bypass test_0E (parity memory error test)
and test_0F (forced parity error test)
*/
bypassTest0Eand0Fpatch:
jmp (%pc,test_10_memory_test)
nop
.section .text.test_10_memory_test
test_10_memory_test:
.section .text.patch_test_10_memory_test_1
/* don't bother setting the register */
patch_test_10_memory_test_1:
nop
nop
nop
nop
.section .text.patch_test_10_memory_test_2
/* wipe out the code testing the registers and resetting them */
patch_test_10_memory_test_2:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
/* there is a read of the register in the case MEMERR in commands.c::monitor(), but that shouldn't happen without the hardware as no irq will be raised ? */
.section .text.fixMonitor_Key_K
/* when resetting with 'k', the parity control is cleared */
fixMonitor_Key_K:
nop
nop
nop

Binary file not shown.