Skip to content

Commit

Permalink
enable writtenblocks globally again
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Jul 29, 2023
1 parent 8924dca commit 32c653d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/asar/libsmw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ asar_error_id openromerror;
autoarray<writtenblockdata> writtenblocks;

// RPG Hacker: Uses binary search to find the insert position of our ROM write
#ifdef ASAR_SHARED
static int findromwritepos(int snesoffset, int searchstartpos, int searchendpos)
{
if (searchendpos == searchstartpos)
Expand Down Expand Up @@ -101,30 +100,23 @@ static void addromwrite(int pcoffset, int numbytes)

addromwriteforbank(snesaddr, bytesleft);
}
#endif

void writeromdata(int pcoffset, const void * indata, int numbytes)
{
memcpy(const_cast<unsigned char*>(romdata) + pcoffset, indata, (size_t)numbytes);
#ifdef ASAR_SHARED
addromwrite(pcoffset, numbytes);
#endif
addromwrite(pcoffset, numbytes);
}

void writeromdata_byte(int pcoffset, unsigned char indata)
{
memcpy(const_cast<unsigned char*>(romdata) + pcoffset, &indata, 1);
#ifdef ASAR_SHARED
addromwrite(pcoffset, 1);
#endif
addromwrite(pcoffset, 1);
}

void writeromdata_bytes(int pcoffset, unsigned char indata, int numbytes)
{
memset(const_cast<unsigned char*>(romdata) + pcoffset, indata, (size_t)numbytes);
#ifdef ASAR_SHARED
addromwrite(pcoffset, numbytes);
#endif
addromwrite(pcoffset, numbytes);
}

int ratsstart(int snesaddr)
Expand Down

0 comments on commit 32c653d

Please sign in to comment.