Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const myArray = new ArrayBuffer(0x800) // populated from elsewhere
- const readInt32 = (array, index) => {
- const typedArray = new Uint32Array(array, index, 1)
- return typedArray[0]
- }
- const writeInt32 = (array, index, value) => {
- const typedArray = new Uint32Array(array, index, 1)
- typedArray[0] = value
- }
- const sourceAddress = readInt32(myArray, 0)
- const targetAddress = readInt32(myArray, 4)
- const value = readInt32(myArray, sourceAddress)
- writeInt32(myArray, targetAddress, value + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement