static zstate_t zstate;
static volatile uint8_t timer; /* used for bus timeout */
-static bool reset_polarity;
/*---------------------------------------------------------*/
/* 10Hz timer interrupt generated by OC5A */
static void z80_reset_active(void)
{
- if (reset_polarity)
+ if (Stat & S_RESET_POLARITY)
Z80_O_RST = 1;
else
Z80_O_RST = 0;
static void z80_reset_inactive(void)
{
- if (reset_polarity)
+ if (Stat & S_RESET_POLARITY)
Z80_O_RST = 0;
else
Z80_O_RST = 1;
DDR_SS = (DDR_SS & ~_BV(WAIT)) | _BV(RUN) | _BV(STEP);
}
- reset_polarity = Z80_I_RST;
+ if (Z80_I_RST)
+ Stat |= S_RESET_POLARITY;
+ else
+ Stat &= ~S_RESET_POLARITY;
z80_reset_active();
DDR_RST |= _BV(RST);
extern volatile uint_least8_t Stat;
#endif /* __AVR__ */
-#define S_10MS_TO (1<<0)
-#define S_MSG_PENDING (1<<1)
-#define S_CON_PENDING (1<<2)
+#define S_10MS_TO (1<<0)
+#define S_MSG_PENDING (1<<1)
+#define S_CON_PENDING (1<<2)
+#define S_RESET_POLARITY (1<<3)
static inline
int my_puts(const char *s)