Skip to content

Commit

Permalink
Fix missing result place-holder variable in the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raspiduino authored Apr 2, 2024
1 parent 6970cf9 commit 19da996
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];

Expand Down

0 comments on commit 19da996

Please sign in to comment.