From 19da9960775e74ee838eff5441d9a8ada6c2cf00 Mon Sep 17 00:00:00 2001 From: gvl610 <68118236+raspiduino@users.noreply.github.com> Date: Tue, 2 Apr 2024 23:54:23 +0700 Subject: [PATCH] Fix missing result place-holder variable in the previous commit --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 3a39d2b..ea34196 100644 --- a/main.c +++ b/main.c @@ -602,11 +602,12 @@ void addage(UInt8 id, UInt8 score) { } static UInt32 load4(UInt32 ofs) { - //UInt32 result; UInt16 r = ofs % 512; // Don't inline this UInt8 id = read_buf(ofs, 0); if (r >= 509) { + UInt32 result; + // 1 - 3 bytes are in nth sector, and the others in n + 1 sector // Read the nth sector and get the bytes in that sector UInt8 i = 0; @@ -644,11 +645,12 @@ static UInt32 load4(UInt32 ofs) { return *(UInt32*)&pool[id].buf[r]; } static UInt16 load2(UInt32 ofs) { - //UInt16 result; UInt16 r = ofs % 512; UInt8 id = read_buf(ofs, 0); if (r == 511) { + UInt16 result; + // LSB located in nth sector ((UInt8 *)&result)[0] = pool[id].buf[511];