hylian-modding / Z64Online

Zelda64 Online
GNU General Public License v3.0
112 stars 14 forks source link

Fix bitwise offsets #26

Closed ElTipejoLoco closed 3 years ago

ElTipejoLoco commented 3 years ago

bitwise.integer actually treats the least significant bit in a number as its 0 index. So all these offsets in OotoSaveData.ts need to be changed as I was treating it like it would behave the same as rdramReadBit8, which appears to treat the 0 index as the most significant bit (or, more likely, the first entry in a bit array it parsed from the value it found at the RAM address).

denoflionsx commented 3 years ago

In future if you use byte instead of integer with bitwise it orders them in big endian so it matches the behavior of rdramReadBit8.

denoflionsx commented 3 years ago

Also you may need to rebase since I did a squash merge of your last PR.

ElTipejoLoco commented 3 years ago

Github Desktop's inability to overwrite branches via force push haunts me, I'll need to open a new PR as I could not easily recover from what I was hoping would be a proper rebase.

Also, I feel that using bitwise.byte is a bit unnecessary as I don't really need to read and store the entire array's worth of bits when the specific ones to target are known.