       if (LCD) printAddr(addr, 8, 0);
       if (LCD) printByte(val, 14, 0);
       return val;
-    /*
-    case 0xf: 
-      printAddr(addr, 8, 0);
-      val = rom[addr & 0xff];
-      printByte(val, 14, 0);
-      return val;
-    */
   }
 }
 
-void memWrite(uint16_t addr, uint8_t val) {
+void memWrite(const uint16_t addr, const uint8_t val) {
   switch (addr >> 12) {
     default:
       // nothing in the address space ignore the write;

    if (PINB & _BV(PB2)) {
      // read cycle
      DDRL = 0xff;
      PORTL = memRead((addrh << 8) | addrl);
    } else {
      // write cycle
      DDRL = 0x00;
      PORTL = 0;
      memWrite((addrh << 8) | addrl, PINL);
    }
  }
}

extern byte ram[];
extern byte pia[];

#define ADDR ((addrh << 8) | addrl)

uint8_t memRead(const uint8_t addrh, const uint8_t addrl) {
  const uint16_t addr = ADDR;
  uint8_t val;
  switch (addr >> 12) {
    default:
