Writing my genesis emulator i'm asking myself question about memory Chip.
Does a memory chip is made to take part or in MSB or LSB system?
If i take the example of M68000.
If I write 0x1100 at 0x000000, the processor waiting that :
- If I read data at 0x000000 it return 0x11 (MSB)
- If I read data at 0x000001 it return 0x00 (LSB)
So I conclude that genesis RAM couldn't work in LSB system?
Does Memory Chip have endianness?
I think whatever th access m68000 do (word or byte) the 68000 always do word access. Lds and uds complete the access.
In exemple i take the m68000 do word access and because uds is set (access to addr 0x000000 so msb) the CPU takes only thé msb of the word and put in register.
That s my point of view. I hope this is correct
I would emulate the bus access this way :
CPU 68K readByte Internal Method (without optimization)
In exemple i take the m68000 do word access and because uds is set (access to addr 0x000000 so msb) the CPU takes only thé msb of the word and put in register.
That s my point of view. I hope this is correct
I would emulate the bus access this way :
CPU 68K readByte Internal Method (without optimization)
Code: Select all
u8 M68000::readByte(u32 addr)
{
u8 data;
data = bus->readWord(addr & 0xFFFFE);
if (addr & 0x01)
data &= 0xFF); // A0 = 1 <=> LDS Low <=> LSB of Word
else
data = (data >> 8) & 0xFF; // A0 = 0 <=> UDS Low <=> MSB of Word
return (data);
}