trunk/src/mess/drivers/minicom.c
| r31366 | r31367 | |
| 91 | 91 | { |
| 92 | 92 | switch (offset) |
| 93 | 93 | { |
| 94 | | case 1: |
| 95 | | //P1.3 seems to be an indicator of whether or not we have a printer device attached. |
| 96 | | // at address 0xABF the code checks this flag in order to decide which string to display: |
| 97 | | // "MINIPRINT IS RESET" or "MINICOM IS RESET" |
| 98 | | return PRINTER_ATTACHED << 3; |
| 94 | case 1: |
| 95 | //P1.3 seems to be an indicator of whether or not we have a printer device attached. |
| 96 | // at address 0xABF the code checks this flag in order to decide which string to display: |
| 97 | // "MINIPRINT IS RESET" or "MINICOM IS RESET" |
| 98 | return PRINTER_ATTACHED << 3; |
| 99 | 99 | case 2: |
| 100 | | // return 0; //para a palestra no Garoa... :-) |
| 101 | | return 1; //to skip the "NO POWER" warning. I'm not sure why. |
| 102 | | default: |
| 100 | // return 0; //para a palestra no Garoa... :-) |
| 101 | return 1; //to skip the "NO POWER" warning. I'm not sure why. |
| 102 | default: |
| 103 | 103 | #if LOG_IO_PORTS |
| 104 | | printf("Unhandled I/O Read at offset 0x%02X (return 0)\n", offset); |
| 104 | printf("Unhandled I/O Read at offset 0x%02X (return 0)\n", offset); |
| 105 | 105 | #endif |
| 106 | | return 0; |
| 106 | return 0; |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | #if LOG_IO_PORTS |
| 111 | 111 | static void printbits(UINT8 v) { |
| 112 | | int i; |
| 113 | | for(i = 7; i >= 0; i--) putchar('0' + ((v >> i) & 1)); |
| 112 | int i; |
| 113 | for(i = 7; i >= 0; i--) putchar('0' + ((v >> i) & 1)); |
| 114 | 114 | } |
| 115 | 115 | #endif |
| 116 | 116 | |
| r31366 | r31367 | |
| 134 | 134 | if (data != m_p[offset]) |
| 135 | 135 | { |
| 136 | 136 | #if LOG_IO_PORTS |
| 137 | | UINT8 changed = m_p[offset] ^ data; |
| 138 | | if (changed ^ P1_UNKNOWN_BITS){ |
| 137 | UINT8 changed = m_p[offset] ^ data; |
| 138 | if (changed ^ P1_UNKNOWN_BITS) |
| 139 | { |
| 139 | 140 | printf("Write to P1: %02X changed: ( ) (", data); |
| 140 | | printbits(changed); |
| 141 | | printf(") ( ) ( )\n"); |
| 142 | | } |
| 141 | printbits(changed); |
| 142 | printf(") ( ) ( )\n"); |
| 143 | } |
| 143 | 144 | #endif |
| 144 | | if (FALLING_EDGE(m_p[offset], data, 2)){ |
| 145 | | m_digit_index--; |
| 146 | | if (m_digit_index<0) m_digit_index = 19; |
| 147 | | } |
| 145 | if (FALLING_EDGE(m_p[offset], data, 2)) |
| 146 | { |
| 147 | m_digit_index--; |
| 148 | if (m_digit_index<0) m_digit_index = 19; |
| 149 | } |
| 148 | 150 | m_p[offset]=data; |
| 149 | 151 | } |
| 150 | 152 | break; |
| r31366 | r31367 | |
| 154 | 156 | if (data != m_p[offset]) |
| 155 | 157 | { |
| 156 | 158 | #if LOG_IO_PORTS |
| 157 | | UINT8 changed = m_p[offset] ^ data; |
| 158 | | if (changed ^ P2_UNKNOWN_BITS){ |
| 159 | UINT8 changed = m_p[offset] ^ data; |
| 160 | if (changed ^ P2_UNKNOWN_BITS) |
| 161 | { |
| 159 | 162 | printf("Write to P2: %02X changed: ( ) ( ) (", data); |
| 160 | | printbits(changed); |
| 161 | | printf(") ( )\n"); |
| 162 | | } |
| 163 | printbits(changed); |
| 164 | printf(") ( )\n"); |
| 165 | } |
| 163 | 166 | #endif |
| 164 | 167 | m_p[offset]=data; |
| 165 | 168 | } |
| r31366 | r31367 | |
| 169 | 172 | { |
| 170 | 173 | if (data != m_p[offset]) |
| 171 | 174 | { |
| 172 | | UINT8 changed = m_p[offset] ^ data; |
| 175 | UINT8 changed = m_p[offset] ^ data; |
| 173 | 176 | #if LOG_IO_PORTS |
| 174 | | if (changed ^ P3_UNKNOWN_BITS){ |
| 177 | if (changed ^ P3_UNKNOWN_BITS) |
| 178 | { |
| 175 | 179 | printf("Write to P3: %02X changed: ( ) ( ) ( ) (", data); |
| 176 | | printbits(changed); |
| 177 | | printf(")\n"); |
| 178 | | } |
| 180 | printbits(changed); |
| 181 | printf(")\n"); |
| 182 | } |
| 179 | 183 | #endif |
| 180 | 184 | |
| 181 | | if (FALLING_EDGE(m_p[offset], data, 4)){ //P3.4 = T0 |
| 182 | | m_display_data &= 0xFF00; |
| 183 | | m_display_data |= m_p[0]; |
| 184 | | } |
| 185 | if (FALLING_EDGE(m_p[offset], data, 4)) //P3.4 = T0 |
| 186 | { |
| 187 | m_display_data &= 0xFF00; |
| 188 | m_display_data |= m_p[0]; |
| 189 | } |
| 185 | 190 | |
| 186 | | if (FALLING_EDGE(m_p[offset], data, 5)){ //P3.5 = T1 |
| 187 | | m_display_data &= 0xFF; |
| 188 | | m_display_data |= (m_p[0] << 8); |
| 189 | | } |
| 191 | if (FALLING_EDGE(m_p[offset], data, 5)) //P3.5 = T1 |
| 192 | { |
| 193 | m_display_data &= 0xFF; |
| 194 | m_display_data |= (m_p[0] << 8); |
| 195 | } |
| 190 | 196 | |
| 191 | | if (BIT(changed,4) || BIT(changed,5)){ |
| 192 | | output_set_digit_value(m_digit_index, BITSWAP16(m_display_data, 9, 1, 3, 11, 12, 4, 2, 10, 14, 6, 7, 5, 0, 15, 13, 8) & 0x3FFF); |
| 193 | | } |
| 197 | if (BIT(changed,4) || BIT(changed,5)) |
| 198 | { |
| 199 | output_set_digit_value(m_digit_index, BITSWAP16(m_display_data, 9, 1, 3, 11, 12, 4, 2, 10, 14, 6, 7, 5, 0, 15, 13, 8) & 0x3FFF); |
| 200 | } |
| 194 | 201 | m_p[offset]=data; |
| 195 | 202 | } |
| 196 | 203 | break; |