public int handler(int offset) {
            int res;

            /* bit 0 is EEPROM data */
            /* bit 1 is EEPROM ready */
            /* bit 3 is VBLANK (???) */
            /* bit 7 is service button */
            res = (EEPROM_read_bit() << 8) | input_port_1_r.handler(0);
            toggle_thndrx2 ^= 0x0800;
            return (res ^ toggle_thndrx2);
        }