recognize the MED ssf2 header
[picodrive.git] / pico / eeprom.c
index f0f1b70..16f6c05 100644 (file)
@@ -1,5 +1,9 @@
 /*\r
  * rarely used EEPROM code\r
+ * (C) notaz, 2007-2009\r
+ *\r
+ * This work is licensed under the terms of MAME license.\r
+ * See COPYING file in the top-level directory.\r
  *\r
  * (see Genesis Plus for Wii/GC code and docs for info,\r
  * full game list and better code).\r
@@ -17,7 +21,7 @@ static void EEPROM_write_do(unsigned int d) // ???? ??la (l=SCL, a=SDA)
   unsigned int scyc = Pico.m.eeprom_cycle, ssa = Pico.m.eeprom_slave;\r
 \r
   elprintf(EL_EEPROM, "eeprom: scl/sda: %i/%i -> %i/%i, newtime=%i", (sreg&2)>>1, sreg&1,\r
-    (d&2)>>1, d&1, SekCyclesDoneT() - last_write);\r
+    (d&2)>>1, d&1, SekCyclesDone() - last_write);\r
   saddr &= 0x1fff;\r
 \r
   if(sreg & d & 2) {\r
@@ -138,17 +142,17 @@ static void EEPROM_upd_pending(unsigned int d)
 void EEPROM_write16(unsigned int d)\r
 {\r
   // this diff must be at most 16 for NBA Jam to work\r
-  if (SekCyclesDoneT() - last_write < 16) {\r
+  if (SekCyclesDone() - last_write < 16) {\r
     // just update pending state\r
     elprintf(EL_EEPROM, "eeprom: skip because cycles=%i",\r
-        SekCyclesDoneT() - last_write);\r
+        SekCyclesDone() - last_write);\r
     EEPROM_upd_pending(d);\r
   } else {\r
     int srs = Pico.m.eeprom_status;\r
     EEPROM_write_do(srs >> 6); // execute pending\r
     EEPROM_upd_pending(d);\r
     if ((srs ^ Pico.m.eeprom_status) & 0xc0) // update time only if SDA/SCL changed\r
-      last_write = SekCyclesDoneT();\r
+      last_write = SekCyclesDone();\r
   }\r
 }\r
 \r
@@ -168,7 +172,7 @@ unsigned int EEPROM_read(void)
   EEPROM_write_do(Pico.m.eeprom_status>>6);\r
 \r
   sreg = Pico.m.eeprom_status; saddr = Pico.m.eeprom_addr&0x1fff; scyc = Pico.m.eeprom_cycle; ssa = Pico.m.eeprom_slave;\r
-  interval = SekCyclesDoneT() - last_write;\r
+  interval = SekCyclesDone() - last_write;\r
   d = (sreg>>6)&1; // use SDA as "open bus"\r
 \r
   // NBA Jam is nasty enough to read <before> raising the SCL and starting the new cycle.\r