Merge pull request #407 from felipesanches/fix_replica1_indentation

fix code indentation in Replicator 1 driver (it was a mess!)
This commit is contained in:
R. Belmont 2015-10-20 09:26:15 -04:00
commit 201d777b33

View File

@ -5,7 +5,7 @@
driver by Felipe Correa da Silva Sanches <fsanches@metamaquina.com.br>
Changelog:
Changelog:
2013 DEC 28 [Felipe Sanches]:
* LCD now works. We can see the firmware boot screen :-)
@ -15,7 +15,6 @@ Changelog:
2013 DEC 18 [Felipe Sanches]:
* Initial driver skeleton
*/
// TODO:
@ -33,7 +32,6 @@ Changelog:
#include "sound/dac.h"
#define MASTER_CLOCK 16000000
#define LOG_PORTS 0
//Port A bits:
@ -284,7 +282,6 @@ WRITE8_MEMBER(replicator_state::port_w)
case AVR8_IO_PORTA:
{
if (data == m_port_a) break;
#if LOG_PORTS
UINT8 old_port_a = m_port_a;
UINT8 changed = data ^ old_port_a;
@ -297,14 +294,12 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & B_AXIS_DIR) printf("[A] B_AXIS_DIR: %s\n", data & B_AXIS_DIR ? "HIGH" : "LOW");
if(changed & B_AXIS_STEP) printf("[A] B_AXIS_STEP: %s\n", data & B_AXIS_STEP ? "HIGH" : "LOW");
#endif
m_port_a = data;
break;
}
case AVR8_IO_PORTB:
{
if (data == m_port_b) break;
#if LOG_PORTS
UINT8 old_port_b = m_port_b;
UINT8 changed = data ^ old_port_b;
@ -319,7 +314,6 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & EX2_FAN) printf("[B] EX2_FAN: %s\n", data & EX2_FAN ? "HIGH" : "LOW");
if(changed & BLINK) printf("[B] BLINK: %s\n", data & BLINK ? "HIGH" : "LOW");
#endif
m_port_b = data;
break;
}
@ -340,7 +334,6 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & GLED) printf("[C] GLED: %s\n", data & GLED ? "HIGH" : "LOW");
if(changed & DETECT) printf("[C] DETECT: %s\n", data & DETECT ? "HIGH" : "LOW");
#endif
if (changed & LCD_CLK){
/* The LCD is interfaced by an 8-bit shift register (74HC4094). */
if (data & LCD_CLK){//CLK positive edge
@ -373,7 +366,6 @@ WRITE8_MEMBER(replicator_state::port_w)
case AVR8_IO_PORTD:
{
if (data == m_port_d) break;
#if LOG_PORTS
UINT8 old_port_d = m_port_d;
UINT8 changed = data ^ old_port_d;
@ -384,14 +376,12 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & EX_RX_1280) printf("[D] EX_RX_1280: %s\n", data & EX_RX_1280 ? "HIGH" : "LOW");
if(changed & EX_TX_1280) printf("[D] EX_TX_1280: %s\n", data & EX_TX_1280 ? "HIGH" : "LOW");
#endif
m_port_d = data;
break;
}
case AVR8_IO_PORTE:
{
if (data == m_port_e) break;
#if LOG_PORTS
UINT8 old_port_e = m_port_e;
UINT8 changed = data ^ old_port_e;
@ -404,14 +394,12 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & THERMO_CS2) printf("[E] THERMO-CS2: %s\n", data & THERMO_CS2 ? "HIGH" : "LOW");
if(changed & THERMO_DO) printf("[E] THERMO-DO: %s\n", data & THERMO_DO ? "HIGH" : "LOW");
#endif
m_port_e = data;
break;
}
case AVR8_IO_PORTF:
{
if (data == m_port_f) break;
#if LOG_PORTS
UINT8 old_port_f = m_port_f;
UINT8 changed = data ^ old_port_f;
@ -426,7 +414,6 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & Y_AXIS_EN) printf("[F] Y_AXIS_EN: %s\n", data & Y_AXIS_EN ? "HIGH" : "LOW");
if(changed & Y_AXIS_POT) printf("[F] Y_AXIS_POT: %s\n", data & Y_AXIS_POT ? "HIGH" : "LOW");
#endif
m_port_f = data;
break;
}
@ -462,7 +449,6 @@ WRITE8_MEMBER(replicator_state::port_w)
case AVR8_IO_PORTH:
{
if (data == m_port_h) break;
#if LOG_PORTS
UINT8 old_port_h = m_port_h;
UINT8 changed = data ^ old_port_h;
@ -476,20 +462,17 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & SD_WP) printf("[H] SD_WP: %s\n", data & SD_WP ? "HIGH" : "LOW");
if(changed & SD_CD) printf("[H] SD_CD: %s\n", data & SD_CD ? "HIGH" : "LOW");
#endif
m_port_h = data;
break;
}
case AVR8_IO_PORTJ:
{
if (data == m_port_j) break;
#if LOG_PORTS
UINT8 old_port_j = m_port_j;
UINT8 changed = data ^ old_port_j;
printf("[%08X] ", m_maincpu->m_shifted_pc);
if(changed & BUTTON_CENTER) printf("[J] BUTTON_CENTER: %s\n", data & BUTTON_CENTER ? "HIGH" : "LOW");
if(changed & BUTTON_RIGHT) printf("[J] BUTTON_RIGHT: %s\n", data & BUTTON_RIGHT ? "HIGH" : "LOW");
if(changed & BUTTON_LEFT) printf("[J] BUTTON_LEFT: %s\n", data & BUTTON_LEFT ? "HIGH" : "LOW");
@ -498,20 +481,17 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & POTS_SCL) printf("[J] POTS_SCL: %s\n", data & POTS_SCL ? "HIGH" : "LOW");
if(changed & B_AXIS_POT) printf("[J] B_AXIS_POT: %s\n", data & B_AXIS_POT ? "HIGH" : "LOW");
#endif
m_port_j = data;
break;
}
case AVR8_IO_PORTK:
{
if (data == m_port_k) break;
#if LOG_PORTS
UINT8 old_port_k = m_port_k;
UINT8 changed = data ^ old_port_k;
printf("[%08X] ", m_maincpu->m_shifted_pc);
if(changed & Z_AXIS_DIR) printf("[K] Z_AXIS_DIR: %s\n", data & Z_AXIS_DIR ? "HIGH" : "LOW");
if(changed & Z_AXIS_STEP) printf("[K] Z_AXIS_STEP: %s\n", data & Z_AXIS_STEP ? "HIGH" : "LOW");
if(changed & Z_AXIS_EN) printf("[K] Z_AXIS_EN: %s\n", data & Z_AXIS_EN ? "HIGH" : "LOW");
@ -521,20 +501,17 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & EX5_1280) printf("[K] EX5_1280: %s\n", data & EX5_1280 ? "HIGH" : "LOW");
if(changed & HBP_THERM) printf("[K] HBP_THERM: %s\n", data & HBP_THERM ? "HIGH" : "LOW");
#endif
m_port_k = data;
break;
}
case AVR8_IO_PORTL:
{
if (data == m_port_l) break;
#if LOG_PORTS
UINT8 old_port_l = m_port_l;
UINT8 changed = data ^ old_port_l;
printf("[%08X] ", m_maincpu->m_shifted_pc);
if(changed & X_MIN) printf("[L] X_MIN: %s\n", data & X_MIN ? "HIGH" : "LOW");
if(changed & X_MAX) printf("[L] X_MAX: %s\n", data & X_MAX ? "HIGH" : "LOW");
if(changed & Y_MIN) printf("[L] Y_MIN: %s\n", data & Y_MIN ? "HIGH" : "LOW");
@ -544,7 +521,6 @@ WRITE8_MEMBER(replicator_state::port_w)
if(changed & Z_MIN) printf("[L] Z_MIN: %s\n", data & Z_MIN ? "HIGH" : "LOW");
if(changed & Z_MAX) printf("[L] Z_MAX: %s\n", data & Z_MAX ? "HIGH" : "LOW");
#endif
m_port_l = data;
break;
}