Skip to content

Commit

Permalink
commit fread buffer to appease win32?
Browse files Browse the repository at this point in the history
  • Loading branch information
stong committed Apr 24, 2020
1 parent b23e87a commit b81879e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions emulator/tl45/TL45EmulatorState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ int TL45EmulatorState::load(std::string fileName) {
fseek(f, 0, SEEK_END);
long fsize = ftell(f);
fseek(f, 0, SEEK_SET);
#ifdef _WIN32
// FUCK YOU WINDOWS!
VirtualAlloc(state.memory, fsize, MEM_COMMIT, PAGE_READWRITE);
#endif
size_t bytesLoaded = fread(state.memory, 1, fsize, f);
fclose(f);
printf("%zul bytes loaded.\n", bytesLoaded);
return bytesLoaded > 0 ? 0 : -1;
}
Expand Down

0 comments on commit b81879e

Please sign in to comment.