     return baud;
 }
 
-void updateEEPROM(byte address, byte value)
+void updateEEPROMByte(byte address, byte value)
 {
     if (EEPROM.read(address) != value)
         EEPROM.write(address, value);
 }
 
-
+//void updateEEPROMPhoneBook(byte address, String host, int port)
+void updateEEPROMPhoneBook(byte address, String host)
+{
+    int i=0;
+    for (; i < 38; i++)
+    {
+        EEPROM.write(address + i, host.c_str()[i]);
+    }
+    
+    /*byte a = BAUD_RATE / 256;
+    byte b = BAUD_RATE % 256;
+
+    updateEEPROMByte(address+i++,a);
+    updateEEPROMByte(address+i,b);*/
+}
+
+String readEEPROMPhoneBook(byte address)
+{
+    char host[38];
+    int i=0;
+    for (; i < 38; i++)
+    {
+        host[i] = EEPROM.read(address + i);
+    }
+    return host;
+    
+    //lastHost = host;
+
+    //lastPort = (EEPROM.read(address+i++) * 256 + EEPROM.read(address+i));
+}
+
+
+void processC64Inbound()
+{
+    lastC64input = C64Serial.read();
+    if (lastC64input == '+')
+    {
+        if (!escapeTimer)      // First time
+        {
+            escapeCount++;
+            escapeTimer = millis();
+        }
+        else
+        {
+            if ((millis() - 200) > escapeTimer)
+            escapeCount++;
+            escapeTimer = millis();
+        }
+    }
+    else
+        escapeCount = 0;
+
+    if (escapeCount == 3) {
+        Display("Escape!");
+        escapeReceived = true;
+        escapeCount = 0;
+        escapeTimer = 0;
+    }
+      
+    wifly.write(lastC64input);
+    //wifly.write(C64Serial.read());
+}
+

            //while (digitalReadFast(C64_RTS) == LOW);   // If not...  C64 RTS and CTS are inverted.
                C64Serial.write(buffer[i]);

            while (C64Serial.available() > 0)
                {
            wifly.write(C64Serial.read());
                }
            }


void SetPETSCIIMode(boolean mode)
{
    petscii_mode = mode;
    updateEEPROMByte(ADDR_PETSCII,petscii_mode);
}


