--- xmil/io/ppi.c 2004/08/12 20:09:42 1.13 +++ xmil/io/ppi.c 2004/08/14 12:16:17 1.15 @@ -41,28 +41,24 @@ static REG8 getportb(void) { static void setportc(REG8 dat) { - REG8 oldc; - UINT8 xl; - - oldc = ppi.portc; - if (crtc.s.reg[CRTCREG_HDISP] == 40) { - oldc |= 0x40; - } - else { - oldc &= ~0x40; - } - ppi.portc = dat; + REG8 modify; + modify = ppi.portc ^ dat; // cmt_write((REG8)(dat & 1)); - if ((oldc & 0x20) && (!(dat & 0x20))) { + if ((modify & 0x20) && (!(dat & 0x20))) { iocore.s.mode = 1; } + if (modify & 0x40) { + crtc_setwidth((REG8)(dat & 0x40)); + } +#if 0 xl = ((dat & 0x40)?40:80); if (crtc.s.reg[CRTCREG_HDISP] != xl) { crtc.s.reg[CRTCREG_HDISP] = (UINT8)xl; crtc_bankupdate(); scrnallflash = 1; } +#endif } @@ -119,14 +115,7 @@ REG8 IOINPCALL ppi_i(UINT port) { return(getportb()); case 2: -#if 1 - if (crtc.s.reg[CRTCREG_HDISP] == 40) { - ppi.portc |= 0x40; - } - else { - ppi.portc &= ~0x40; - } -#endif + // mode? return(ppi.portc); case 3: @@ -143,7 +132,7 @@ void ppi_initialize(void) { ppi.porta = 0x00; ppi.portb = 0xff; ppi.portc = 0xff; - ppi.mode = 0x9b; + ppi.mode = 0x82; } void ppi_reset(void) {