Fix aligned memory read of unanligend memory
This commit is contained in:
11
include/PSX/Auxiliary/unaligned_read.hpp
Normal file
11
include/PSX/Auxiliary/unaligned_read.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __JABYENGINE_UNALIGNED_READ_HPP__
|
||||
#define __JABYENGINE_UNALIGNED_READ_HPP__
|
||||
#include "../../stdint.h"
|
||||
|
||||
namespace JabyEngine {
|
||||
uint16_t unaligned_lhu(const uint8_t* adr) {
|
||||
return (static_cast<uint16_t>(adr[0]) | static_cast<uint16_t>(adr[1]) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
#endif //!__JABYENGINE_UNALIGNED_READ_HPP__
|
Reference in New Issue
Block a user