amalgamation
[picodrive.git] / Pico / Memory.c
index 2b253d8..01e92f4 100644 (file)
 \r
 #include "PicoInt.h"\r
 \r
-#include "sound/sound.h"\r
 #include "sound/ym2612.h"\r
 #include "sound/sn76496.h"\r
 \r
+#ifndef UTYPES_DEFINED\r
 typedef unsigned char  u8;\r
 typedef unsigned short u16;\r
 typedef unsigned int   u32;\r
+#define UTYPES_DEFINED\r
+#endif\r
 \r
 extern unsigned int lastSSRamWrite; // used by serial SRAM code\r
 \r
@@ -88,14 +90,14 @@ static u32 CPU_CALL PicoCheckPc(u32 pc)
 }\r
 \r
 \r
-int PicoInitPc(u32 pc)\r
+PICO_INTERNAL int PicoInitPc(u32 pc)\r
 {\r
   PicoCheckPc(pc);\r
   return 0;\r
 }\r
 \r
 #ifndef _ASM_MEMORY_C\r
-void PicoMemReset()\r
+PICO_INTERNAL_ASM void PicoMemReset(void)\r
 {\r
 }\r
 #endif\r
@@ -266,7 +268,7 @@ static void OtherWrite8End(u32 a,u32 d,int realsize)
 //                     Read Rom and read Ram\r
 \r
 #ifndef _ASM_MEMORY_C\r
-u32 CPU_CALL PicoRead8(u32 a)\r
+PICO_INTERNAL_ASM u32 CPU_CALL PicoRead8(u32 a)\r
 {\r
   u32 d=0;\r
 \r
@@ -317,7 +319,7 @@ u32 CPU_CALL PicoRead8(u32 a)
   return d;\r
 }\r
 \r
-u32 CPU_CALL PicoRead16(u32 a)\r
+PICO_INTERNAL_ASM u32 CPU_CALL PicoRead16(u32 a)\r
 {\r
   u32 d=0;\r
 \r
@@ -353,7 +355,7 @@ u32 CPU_CALL PicoRead16(u32 a)
   return d;\r
 }\r
 \r
-u32 CPU_CALL PicoRead32(u32 a)\r
+PICO_INTERNAL_ASM u32 CPU_CALL PicoRead32(u32 a)\r
 {\r
   u32 d=0;\r
 \r
@@ -446,7 +448,7 @@ static void CPU_CALL PicoWrite32(u32 a,u32 d)
 \r
 \r
 // -----------------------------------------------------------------\r
-void PicoMemSetup()\r
+PICO_INTERNAL void PicoMemSetup(void)\r
 {\r
 #ifdef EMU_C68K\r
   // Setup memory callbacks:\r
@@ -623,7 +625,7 @@ void m68k_write_memory_32(unsigned int address, unsigned int value)
 // -----------------------------------------------------------------\r
 //                        z80 memhandlers\r
 \r
-unsigned char z80_read(unsigned short a)\r
+PICO_INTERNAL unsigned char z80_read(unsigned short a)\r
 {\r
   u8 ret = 0;\r
 \r
@@ -651,14 +653,14 @@ end:
   return ret;\r
 }\r
 \r
-unsigned short z80_read16(unsigned short a)\r
+PICO_INTERNAL unsigned short z80_read16(unsigned short a)\r
 {\r
   //dprintf("z80_read16");\r
 \r
   return (u16) ( (u16)z80_read(a) | ((u16)z80_read((u16)(a+1))<<8) );\r
 }\r
 \r
-void z80_write(unsigned char data, unsigned short a)\r
+PICO_INTERNAL_ASM void z80_write(unsigned char data, unsigned short a)\r
 {\r
   //if (a<0x4000)\r
   //  dprintf("z80 w8 : %06x,   %02x @%04x", a, data, mz80GetRegisterValue(NULL, 0));\r
@@ -697,7 +699,7 @@ void z80_write(unsigned char data, unsigned short a)
   if (a<0x4000) { Pico.zram[a&0x1fff]=data; return; }\r
 }\r
 \r
-void z80_write16(unsigned short data, unsigned short a)\r
+PICO_INTERNAL void z80_write16(unsigned short data, unsigned short a)\r
 {\r
   //dprintf("z80_write16");\r
 \r