From 5b657c017f83eb4ca3907f86bab27a0475c6cc38 Mon Sep 17 00:00:00 2001 From: Romain Dolbeau Date: Sat, 28 Jun 2025 10:13:56 +0200 Subject: [PATCH] add checksum --- RomPatcher/Sun3_160MaxMemory/README.md | 5 +++-- RomPatcher/Sun3_160MaxMemory/input.txt | 1 + RomPatcher/Sun3_160MaxMemory/rompatch.s | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RomPatcher/Sun3_160MaxMemory/README.md b/RomPatcher/Sun3_160MaxMemory/README.md index ca65335..e14e350 100644 --- a/RomPatcher/Sun3_160MaxMemory/README.md +++ b/RomPatcher/Sun3_160MaxMemory/README.md @@ -4,7 +4,8 @@ This small patch enables the Sun 3/160 memory to recongnize more than 32 MiB of * "replace1" patches the upper bound of the memory-sizing loop * "replace2" patches an assumption at one point in the ROM that only 32 MiB is installed. The original test is to check for >=32 MiB and if so, subtract 128 KiB. This replaces the subtraction with a hardwired (32MiB - 128 KiB) value. +* "checksum" replaces the checksum by the appropriate value, which is just the 16 lower bits of the sum of all bytes but the last two (where the checksum lives). This need to be recomputed if the patch is modified -The combinations of both patches is enough that 128 MiB of memory can be specified in the TME config file: +The combinations of those patches is enough that 128 MiB of memory can be specified in the TME config file: `ram0 at obmem0 addr 0x0: tme/host/posix/memory ram 128MB` -And both the ROM and NetBSD (tested 9.0) will recognize 128 MiB. \ No newline at end of file +And both the ROM and NetBSD (tested 9.0) will recognize 128 MiB. diff --git a/RomPatcher/Sun3_160MaxMemory/input.txt b/RomPatcher/Sun3_160MaxMemory/input.txt index 22460bc..31f05fa 100644 --- a/RomPatcher/Sun3_160MaxMemory/input.txt +++ b/RomPatcher/Sun3_160MaxMemory/input.txt @@ -1,2 +1,3 @@ 0x0c5a2, 6, replace1 0x0c60a, 6, replace2 +0x0fffe, 2, checksum diff --git a/RomPatcher/Sun3_160MaxMemory/rompatch.s b/RomPatcher/Sun3_160MaxMemory/rompatch.s index d2e3892..9142afe 100644 --- a/RomPatcher/Sun3_160MaxMemory/rompatch.s +++ b/RomPatcher/Sun3_160MaxMemory/rompatch.s @@ -7,3 +7,8 @@ replace1: replace2: move.l #0x01fe0000,%D5 .section .text.finishedreplace2 + + .section .text.checksum +checksum: + .byte 0xdf + .byte 0x2a