mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 03:31:49 +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
|
* Genesis Plus
|
||||||
* Backup RAM support
|
* 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
|
* Redistribution and use of this code or any derivative works are permitted
|
||||||
* provided that the following conditions are met:
|
* 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)
|
unsigned int sram_read_word(unsigned int address)
|
||||||
{
|
{
|
||||||
address &= 0xfffe;
|
return READ_WORD(sram.sram, address & 0xfffe);
|
||||||
return (sram.sram[address + 1] | (sram.sram[address] << 8));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sram_write_byte(unsigned int address, unsigned int data)
|
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)
|
void sram_write_word(unsigned int address, unsigned int data)
|
||||||
{
|
{
|
||||||
address &= 0xfffe;
|
WRITE_WORD(sram.sram, address & 0xfffe, data);
|
||||||
sram.sram[address] = data >> 8;
|
|
||||||
sram.sram[address + 1] = data & 0xff;
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* Genesis Plus
|
* Genesis Plus
|
||||||
* Backup RAM support
|
* 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
|
* Redistribution and use of this code or any derivative works are permitted
|
||||||
* provided that the following conditions are met:
|
* provided that the following conditions are met:
|
||||||
|
Loading…
Reference in New Issue
Block a user