Previous 199869 Revisions Next

r26868 Wednesday 1st January, 2014 at 16:58:28 UTC by hap
endian safe array access
[src/emu/video]epic12.c

trunk/src/emu/video/epic12.c
r26867r26868
137137inline UINT16 epic12_device::READ_NEXT_WORD(offs_t *addr)
138138{
139139//  UINT16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticably slower
140   UINT16 data =  use_ram[((*addr&(m_main_rammask))>>1)^3]; // this probably needs to be made endian safe tho
140   UINT16 data = use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
141   
141142   *addr += 2;
142143
143144//  printf("data %04x\n", data);
r26867r26868
147148inline UINT16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr)
148149{
149150//  UINT16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticably slower
150   UINT16 data =  epic12_device_ram16[((*addr&(m_main_rammask))>>1)^3]; // this probably needs to be made endian safe tho
151   epic12_device_ram16_copy[((*addr&(m_main_rammask))>>1)^3] = data;
151   UINT16 data = epic12_device_ram16[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
152   epic12_device_ram16_copy[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)] = data;
152153
153154   *addr += 2;
154155

Previous 199869 Revisions Next


© 1997-2024 The MAME Team