--- uae/src/cia.c 2018/04/24 16:42:07 1.1.1.4 +++ uae/src/cia.c 2018/04/24 16:44:47 1.1.1.6 @@ -308,14 +308,14 @@ static uae_u8 ReadCIAA(unsigned int addr { unsigned int tmp; - switch(addr & 0xf){ + switch(addr & 0xf) { case 0: if (currprefs.use_serial && (serstat < 0)) /* Only read status when needed */ serstat=serial_readstatus(); /* and only once per frame */ tmp = (DISK_status() & 0x3C); - if ((JSEM_ISMOUSE (0, currprefs.fake_joystick) && !buttonstate[0]) - || (!JSEM_ISMOUSE (0, currprefs.fake_joystick) && !(joy0button & 1))) + if ((JSEM_ISMOUSE (0, &currprefs) && !buttonstate[0]) + || (!JSEM_ISMOUSE (0, &currprefs) && !(joy0button & 1))) tmp |= 0x40; if (!(joy1button & 1)) tmp |= 0x80; @@ -366,7 +366,7 @@ static uae_u8 ReadCIAB(unsigned int addr { unsigned int tmp; - switch(addr & 0xf){ + switch(addr & 0xf) { case 0: if (currprefs.use_serial && serstat < 0) /* Only read status when needed */ serstat=serial_readstatus(); /* and only once per frame */ @@ -416,7 +416,7 @@ static uae_u8 ReadCIAB(unsigned int addr static void WriteCIAA(uae_u16 addr,uae_u8 val) { int oldled, oldovl; - switch(addr & 0xf){ + switch(addr & 0xf) { case 0: oldovl = ciaapra & 1; oldled = ciaapra & 2; @@ -448,9 +448,9 @@ static void WriteCIAA(uae_u16 addr,uae_u } } else { #if defined(__unix) && !defined(__BEOS__) && !defined(__DOS__) - prttmp = (FILE *)popen ((const char *)prtname, "w"); + prttmp = (FILE *)popen ((const char *)currprefs.prtname, "w"); #else - prttmp = (FILE *)fopen ((const char *)prtname, "wb"); + prttmp = (FILE *)fopen ((const char *)currprefs.prtname, "wb"); #endif if (prttmp != NULL) { prtopen = 1; @@ -501,7 +501,7 @@ static void WriteCIAA(uae_u16 addr,uae_u CIA_calctimers(); break; case 8: - if (ciaacrb & 0x80){ + if (ciaacrb & 0x80) { ciaaalarm = (ciaaalarm & ~0xff) | val; } else { ciaatod = (ciaatod & ~0xff) | val; @@ -509,7 +509,7 @@ static void WriteCIAA(uae_u16 addr,uae_u } break; case 9: - if (ciaacrb & 0x80){ + if (ciaacrb & 0x80) { ciaaalarm = (ciaaalarm & ~0xff00) | (val << 8); } else { ciaatod = (ciaatod & ~0xff00) | (val << 8); @@ -517,7 +517,7 @@ static void WriteCIAA(uae_u16 addr,uae_u } break; case 10: - if (ciaacrb & 0x80){ + if (ciaacrb & 0x80) { ciaaalarm = (ciaaalarm & ~0xff0000) | (val << 16); } else { ciaatod = (ciaatod & ~0xff0000) | (val << 16); @@ -531,7 +531,7 @@ static void WriteCIAA(uae_u16 addr,uae_u case 14: CIA_update(); ciaacra = val; - if (ciaacra & 0x10){ + if (ciaacra & 0x10) { ciaacra &= ~0x10; ciaata = ciaala; } @@ -543,7 +543,7 @@ static void WriteCIAA(uae_u16 addr,uae_u case 15: CIA_update(); ciaacrb = val; - if (ciaacrb & 0x10){ + if (ciaacrb & 0x10) { ciaacrb &= ~0x10; ciaatb = ciaalb; } @@ -555,7 +555,7 @@ static void WriteCIAA(uae_u16 addr,uae_u static void WriteCIAB(uae_u16 addr,uae_u8 val) { int oldval; - switch(addr & 0xf){ + switch(addr & 0xf) { case 0: if (currprefs.use_serial) { oldval = ciabpra; @@ -602,7 +602,7 @@ static void WriteCIAB(uae_u16 addr,uae_u CIA_calctimers(); break; case 8: - if (ciabcrb & 0x80){ + if (ciabcrb & 0x80) { ciabalarm = (ciabalarm & ~0xff) | val; } else { ciabtod = (ciabtod & ~0xff) | val; @@ -610,7 +610,7 @@ static void WriteCIAB(uae_u16 addr,uae_u } break; case 9: - if (ciabcrb & 0x80){ + if (ciabcrb & 0x80) { ciabalarm = (ciabalarm & ~0xff00) | (val << 8); } else { ciabtod = (ciabtod & ~0xff00) | (val << 8); @@ -618,7 +618,7 @@ static void WriteCIAB(uae_u16 addr,uae_u } break; case 10: - if (ciabcrb & 0x80){ + if (ciabcrb & 0x80) { ciabalarm = (ciabalarm & ~0xff0000) | (val << 16); } else { ciabtod = (ciabtod & ~0xff0000) | (val << 16); @@ -634,7 +634,7 @@ static void WriteCIAB(uae_u16 addr,uae_u case 14: CIA_update(); ciabcra = val; - if (ciabcra & 0x10){ + if (ciabcra & 0x10) { ciabcra &= ~0x10; ciabta = ciabla; } @@ -643,7 +643,7 @@ static void WriteCIAB(uae_u16 addr,uae_u case 15: CIA_update(); ciabcrb = val; - if (ciabcrb & 0x10){ + if (ciabcrb & 0x10) { ciabcrb &= ~0x10; ciabtb = ciablb; }