mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-26 11:11:48 +01:00
[Core/MD] optimized SRAM word accesses on big-endian platform
This commit is contained in:
parent
0628db556f
commit
e329aa1cc7
@ -2,7 +2,7 @@
|
||||
* Genesis Plus
|
||||
* Backup RAM support
|
||||
*
|
||||
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2007-2019 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
@ -214,8 +214,7 @@ unsigned int sram_read_byte(unsigned int address)
|
||||
|
||||
unsigned int sram_read_word(unsigned int address)
|
||||
{
|
||||
address &= 0xfffe;
|
||||
return (sram.sram[address + 1] | (sram.sram[address] << 8));
|
||||
return READ_WORD(sram.sram, address & 0xfffe);
|
||||
}
|
||||
|
||||
void sram_write_byte(unsigned int address, unsigned int data)
|
||||
@ -225,7 +224,5 @@ void sram_write_byte(unsigned int address, unsigned int data)
|
||||
|
||||
void sram_write_word(unsigned int address, unsigned int data)
|
||||
{
|
||||
address &= 0xfffe;
|
||||
sram.sram[address] = data >> 8;
|
||||
sram.sram[address + 1] = data & 0xff;
|
||||
WRITE_WORD(sram.sram, address & 0xfffe, data);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Genesis Plus
|
||||
* Backup RAM support
|
||||
*
|
||||
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2007-2019 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
|
Loading…
Reference in New Issue
Block a user