u32 SRAMRead(u32 a)\r
{\r
unsigned int sreg = Pico.m.sram_reg;\r
- if(!(sreg & 0x10) && (sreg & 1) && a > 0x200001) { // not yet detected SRAM\r
+ if (!(sreg & 0x10) && (sreg & 1) && a > 0x200001) { // not yet detected SRAM\r
elprintf(EL_SRAMIO, "normal sram detected.");\r
Pico.m.sram_reg|=0x10; // should be normal SRAM\r
}\r
- if(sreg & 4) // EEPROM read\r
+ if (sreg & 4) // EEPROM read\r
return SRAMReadEEPROM();\r
else // if(sreg & 1) // (sreg&5) is one of prerequisites\r
return *(u8 *)(SRam.data-SRam.start+a);\r
}\r
\r
+#ifndef _ASM_MEMORY_C\r
+static\r
+#endif\r
+u32 SRAMRead16(u32 a)\r
+{\r
+ u32 d;\r
+ if (Pico.m.sram_reg & 4) {\r
+ d = SRAMReadEEPROM();\r
+ d |= d << 8;\r
+ } else {\r
+ u8 *pm=(u8 *)(SRam.data-SRam.start+a);\r
+ d =*pm++ << 8;\r
+ d|=*pm++;\r
+ }\r
+ return d;\r
+}\r
+\r
static void SRAMWrite(u32 a, u32 d)\r
{\r
unsigned int sreg = Pico.m.sram_reg;\r
#ifndef EMU_CORE_DEBUG\r
// sram\r
if (a >= SRam.start && a <= SRam.end && (Pico.m.sram_reg&5)) {\r
- d = SRAMRead(a);\r
- d |= d<<8;\r
+ d = SRAMRead16(a);\r
elprintf(EL_SRAMIO, "sram r16 [%06x] %04x @ %06x", a, d, SekPc);\r
goto end;\r
}\r
\r
// sram\r
if(a >= SRam.start && a <= SRam.end && (Pico.m.sram_reg&5)) {\r
- d = (SRAMRead(a)<<16)|SRAMRead(a+2);\r
- d |= d<<8;\r
+ d = (SRAMRead16(a)<<16)|SRAMRead16(a+2);\r
elprintf(EL_SRAMIO, "sram r32 [%06x] %08x @ %06x", a, d, SekPc);\r
goto end;\r
}\r
tst r1, #5\r
beq m_read16_nosram\r
stmfd sp!,{lr}\r
- bl SRAMRead\r
- orr r0, r0, r0, lsl #8\r
+ bl SRAMRead16\r
ldmfd sp!,{pc}\r
m_read16_nosram:\r
ldr r1, [r3, #4] @ romsize\r
tst r1, #5\r
beq m_read16_ar_nosram\r
stmfd sp!,{lr}\r
- bl SRAMRead\r
- orr r0, r0, r0, lsl #8\r
+ bl SRAMRead16\r
ldmfd sp!,{pc}\r
m_read16_ar_nosram:\r
mov r1, #16\r
tst r1, #5\r
beq m_read32_nosram\r
stmfd sp!,{r0,lr}\r
- bl SRAMRead\r
+ bl SRAMRead16\r
ldmfd sp!,{r1,lr}\r
stmfd sp!,{r0,lr}\r
add r0, r1, #2\r
- bl SRAMRead\r
+ bl SRAMRead16\r
ldmfd sp!,{r1,lr}\r
orr r0, r0, r1, lsl #16\r
- orr r0, r0, r0, lsl #8\r
bx lr\r
m_read32_nosram:\r
ldr r1, [r3, #4] @ romsize\r
#ifndef _CD_MEMORY_C
if (a >= SRam.start && a <= SRam.end) {
elprintf(EL_SRAMIO, "sram w16 [%06x] %04x @ %06x", a, d, SekPc);
- if ((a&0x16)==0x10) { // detected, not EEPROM, write not disabled
+ if ((Pico.m.sram_reg&0x16)==0x10) { // detected, not EEPROM, write not disabled
u8 *pm=(u8 *)(SRam.data-SRam.start+a);
*pm++=d>>8;
*pm++=d;
#include "../common/lprintf.h"
#include "../../Pico/PicoInt.h"
-#define OSD_FPS_X 424
+#define OSD_FPS_X 432
// additional pspaudio imports, credits to crazyc
int sceAudio_38553111(unsigned short samples, unsigned short freq, char unknown); // play with conversion?