1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-07-25 05:24:02 +00:00

Change 16-bit references to respect little-endianness

As the Apple II (or rather the 6502 chip) is little-endian, meaning the
least significant byte is the first byte you read going forward, rather
than the last byte.
This commit is contained in:
Peter Evans
2018-01-08 17:10:26 -06:00
parent 01174b63dd
commit a8bba409c3
5 changed files with 23 additions and 23 deletions

View File

@@ -157,8 +157,8 @@ vm_segment_get16(vm_segment *segment, size_t addr)
{
vm_16bit msb, lsb;
msb = (vm_16bit)vm_segment_get(segment, addr);
lsb = (vm_16bit)vm_segment_get(segment, addr+1);
lsb = (vm_16bit)vm_segment_get(segment, addr);
msb = (vm_16bit)vm_segment_get(segment, addr+1);
return (msb << 8) | lsb;
}