X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Feeprom.c;h=16f6c05c45866a4df2bc44eea3494677ceb0fbe7;hb=40d22a8e7610b2fdde5cfe6178605262ef0d61d7;hp=f0f1b70bf08a8e77f7e7bab5e87078609ee08b46;hpb=45f2f245f51ef0c0d37df3c998595c132bfcaffa;p=picodrive.git diff --git a/pico/eeprom.c b/pico/eeprom.c index f0f1b70..16f6c05 100644 --- a/pico/eeprom.c +++ b/pico/eeprom.c @@ -1,5 +1,9 @@ /* * rarely used EEPROM code + * (C) notaz, 2007-2009 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. * * (see Genesis Plus for Wii/GC code and docs for info, * full game list and better code). @@ -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; elprintf(EL_EEPROM, "eeprom: scl/sda: %i/%i -> %i/%i, newtime=%i", (sreg&2)>>1, sreg&1, - (d&2)>>1, d&1, SekCyclesDoneT() - last_write); + (d&2)>>1, d&1, SekCyclesDone() - last_write); saddr &= 0x1fff; if(sreg & d & 2) { @@ -138,17 +142,17 @@ static void EEPROM_upd_pending(unsigned int d) void EEPROM_write16(unsigned int d) { // this diff must be at most 16 for NBA Jam to work - if (SekCyclesDoneT() - last_write < 16) { + if (SekCyclesDone() - last_write < 16) { // just update pending state elprintf(EL_EEPROM, "eeprom: skip because cycles=%i", - SekCyclesDoneT() - last_write); + SekCyclesDone() - last_write); EEPROM_upd_pending(d); } else { int srs = Pico.m.eeprom_status; EEPROM_write_do(srs >> 6); // execute pending EEPROM_upd_pending(d); if ((srs ^ Pico.m.eeprom_status) & 0xc0) // update time only if SDA/SCL changed - last_write = SekCyclesDoneT(); + last_write = SekCyclesDone(); } } @@ -168,7 +172,7 @@ unsigned int EEPROM_read(void) EEPROM_write_do(Pico.m.eeprom_status>>6); sreg = Pico.m.eeprom_status; saddr = Pico.m.eeprom_addr&0x1fff; scyc = Pico.m.eeprom_cycle; ssa = Pico.m.eeprom_slave; - interval = SekCyclesDoneT() - last_write; + interval = SekCyclesDone() - last_write; d = (sreg>>6)&1; // use SDA as "open bus" // NBA Jam is nasty enough to read raising the SCL and starting the new cycle.