From 15e0eb04f632bc10ddf7d816ab3033c17425bbb0 Mon Sep 17 00:00:00 2001 From: Toad King Date: Mon, 3 Sep 2012 19:46:21 -0400 Subject: [PATCH] (NGC) fix dol loading error --- ngc/sidestep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ngc/sidestep.c b/ngc/sidestep.c index 4b362ac064..733e28feb6 100644 --- a/ngc/sidestep.c +++ b/ngc/sidestep.c @@ -282,14 +282,14 @@ int DOLtoARAM(const char *dol_name) for (j = 0; j < count; j++) { fread(dol_readbuf, 1, sizeof(dol_readbuf), f); - ARAMPut(dol_readbuf, (char *) ((dolhdr->textAddress[i] - minaddress) + (sizeof(dol_readbuf) * i) + ARAMSTART), + ARAMPut(dol_readbuf, (char *) ((dolhdr->textAddress[i] - minaddress) + (sizeof(dol_readbuf) * j) + ARAMSTART), sizeof(dol_readbuf)); } unsigned remaining = dolhdr->textLength[i] % sizeof(dol_readbuf); if (remaining) { fread(dol_readbuf, 1, remaining, f); - ARAMPut(dol_readbuf, (char *) ((dolhdr->textAddress[i] - minaddress) + (count * i) + ARAMSTART), + ARAMPut(dol_readbuf, (char *) ((dolhdr->textAddress[i] - minaddress) + (sizeof(dol_readbuf) * count) + ARAMSTART), remaining); } } @@ -305,14 +305,14 @@ int DOLtoARAM(const char *dol_name) for (j = 0; j < count; j++) { fread(dol_readbuf, 1, sizeof(dol_readbuf), f); - ARAMPut(dol_readbuf, (char *) ((dolhdr->dataAddress[i] - minaddress) + (sizeof(dol_readbuf) * i) + ARAMSTART), + ARAMPut(dol_readbuf, (char *) ((dolhdr->dataAddress[i] - minaddress) + (sizeof(dol_readbuf) * j) + ARAMSTART), sizeof(dol_readbuf)); } unsigned remaining = dolhdr->dataLength[i] % sizeof(dol_readbuf); if (remaining) { fread(dol_readbuf, 1, remaining, f); - ARAMPut(dol_readbuf, (char *) ((dolhdr->dataAddress[i] - minaddress) + (count * i) + ARAMSTART), + ARAMPut(dol_readbuf, (char *) ((dolhdr->dataAddress[i] - minaddress) + (sizeof(dol_readbuf) * count) + ARAMSTART), remaining); } }