diff --git a/core/cart_hw/sram.c b/core/cart_hw/sram.c index c5e4d55..8455ee9 100644 --- a/core/cart_hw/sram.c +++ b/core/cart_hw/sram.c @@ -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); } diff --git a/core/cart_hw/sram.h b/core/cart_hw/sram.h index da32a95..c6eea27 100644 --- a/core/cart_hw/sram.h +++ b/core/cart_hw/sram.h @@ -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: