]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
bool reset_polarity --> Stat & S_RESET_POLARITY
authorLeo C <erbl259-lmu@yahoo.de>
Sat, 8 Sep 2018 18:31:49 +0000 (20:31 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Sat, 8 Sep 2018 18:31:49 +0000 (20:31 +0200)
avr/z80-if.c
include/common.h

index 7a953f06e9017b384615b69b0f6cb5fd5dda7c2e..9452ad1f18801f4e9d14cc42ed1a27169b62a94c 100644 (file)
@@ -144,7 +144,6 @@ void z80_bus_request_or_exit(void)
 
 static zstate_t zstate;
 static volatile uint8_t timer;         /* used for bus timeout */
-static bool reset_polarity;
 
 /*---------------------------------------------------------*/
 /* 10Hz timer interrupt generated by OC5A                  */
@@ -207,7 +206,7 @@ static void z80_dbus_set_out(void)
 
 static void z80_reset_active(void)
 {
-       if (reset_polarity)
+       if (Stat & S_RESET_POLARITY)
                Z80_O_RST = 1;
        else
                Z80_O_RST = 0;
@@ -215,7 +214,7 @@ static void z80_reset_active(void)
 
 static void z80_reset_inactive(void)
 {
-       if (reset_polarity)
+       if (Stat & S_RESET_POLARITY)
                Z80_O_RST = 0;
        else
                Z80_O_RST = 1;
@@ -255,7 +254,10 @@ void z80_setup_bus(void)
                        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);
 
index 12d87c48865a280eac621ba3e7df7ddc006b6e6b..9bd34181e78f0524d89ad31be828aca6ea55a567 100644 (file)
@@ -78,9 +78,10 @@ struct bits {
 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)