-extern inline void spi_enable() { bset((void*)&_io_ports[M6811_SPCR], M6811_SPE); }
-extern inline void spi_disable() { bclr((void*)&_io_ports[M6811_SPCR], M6811_SPE); }
+extern volatile u8 _switch_input;
+#define switch_input _switch_input
+extern volatile u8 _misc_input;
+#define misc_input _misc_input
+extern volatile u8 _home_sensors;
+#define home_sensors _home_sensors
+
+#define is_standalone() (misc_input & 0x01) /* DIP sw 1 */
+#define must_verify() (misc_input & 0x02) /* DIP sw 2 */
+#define cant_poke() (misc_input & 0x04) /* DIP sw 3 */
+
+extern u16 _stack;
+extern char _nvram[]; /* 2048 bytes of nvram! */
+// uncomment for testing.
+//char _nvram[20];
+/* NVRAM map:
+ *
+ * START LEN
+ * 0x800 0x02 mic.h - current challenge
+ * 0x802 0x10 mic.h - current secret password
+ * 0x812
+ *
+ */