Make file system type read byte by byte
The GBA (and other platforms?) seems to have possible alignment issues with reading from ROM when it's not byte by byte.
This commit is contained in:
parent
a243a38d4d
commit
c4da8394d2
9
deps/ox/src/ox/fs/filestore.hpp
vendored
9
deps/ox/src/ox/fs/filestore.hpp
vendored
@ -647,9 +647,14 @@ int FileStore<Header>::read(Inode *inode, typename Header::FsSize_t readStart,
|
||||
}
|
||||
|
||||
readSize /= sizeof(T);
|
||||
T *it = (T*) &(inode->getData()[readStart]);
|
||||
uint8_t *it = &(inode->getData()[readStart]);
|
||||
for (typename Header::FsSize_t i = 0; i < readSize; i++) {
|
||||
*(data++) = *(it++);
|
||||
T val;
|
||||
ox_memset(&val, 0, sizeof(T));
|
||||
for (size_t i = 0; i < sizeof(T); i++) {
|
||||
((uint8_t*) (&val))[i] = *(it++);
|
||||
}
|
||||
*(data++) = val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user