static void dstr_write_block( PIA *pi, char * buf, int count ) { int k; w0(0x81); P1; if (pi->mode) { w0(0x19); } else { w0(9); } P2; w0(0x82); P1; P3; w0(0x20); P1; switch (pi->mode) { case 0: case 1: for (k=0;k<count;k++) { w2(5); w0(buf[k]); w2(7); } w2(5); w2(4); break; case 2: w2(0xc5); for (k=0;k<count;k++) w4(buf[k]); w2(0xc4); break; case 3: w2(0xc5); for (k=0;k<count/2;k++) w4w(((u16 *)buf)[k]); w2(0xc4); break; case 4: w2(0xc5); for (k=0;k<count/4;k++) w4l(((u32 *)buf)[k]); w2(0xc4); break; } }
static void epat_write_block( PIA *pi, char * buf, int count ) { int ph, k; switch (pi->mode) { case 0: case 1: case 2: w0(0x67); w2(1); w2(5); ph = 0; for(k=0;k<count;k++) { w0(buf[k]); w2(4+ph); ph = 1 - ph; } w2(7); w2(4); break; case 3: w3(0xc0); for(k=0;k<count;k++) w4(buf[k]); w2(4); break; case 4: w3(0xc0); for(k=0;k<(count/2);k++) w4w(((u16 *)buf)[k]); w2(4); break; case 5: w3(0xc0); for(k=0;k<(count/4);k++) w4l(((u32 *)buf)[k]); w2(4); break; } }
static void comm_write_block( PIA *pi, char * buf, int count ) { int k; switch (pi->mode) { case 0: case 1: w0(0x68); P1; for (k=0;k<count;k++) { w2(5); w0(buf[k^1]); w2(7); } w2(5); w2(4); break; case 2: w3(0x48); (void)r1(); for (k=0;k<count;k++) w4(buf[k^1]); break; case 3: w3(0x48); (void)r1(); for (k=0;k<count/2;k++) w4w(pi_swab16(buf,k)); break; case 4: w3(0x48); (void)r1(); for (k=0;k<count/4;k++) w4l(pi_swab32(buf,k)); break; } }
static void on26_write_block( PIA *pi, char * buf, int count ) { int k; switch (pi->mode) { case 0: case 1: w0(1); P1; w0(1); P2; w0(2); P1; w0(0x18+pi->mode); P2; w0(0); P1; udelay(10); for (k=0;k<count/2;k++) { w2(5); w0(buf[2*k]); w2(7); w0(buf[2*k+1]); } w2(5); w2(4); w0(2); P1; w0(8+pi->mode); P2; break; case 2: w3(1); w3(1); w2(5); w4(1); w2(4); w3(0); w3(0); w2(0xc5); udelay(10); for (k=0;k<count;k++) w4(buf[k]); w2(0xc4); break; case 3: w3(1); w3(1); w2(5); w4(1); w2(4); w3(0); w3(0); w2(0xc5); udelay(10); for (k=0;k<count/2;k++) w4w(((u16 *)buf)[k]); w2(0xc4); break; case 4: w3(1); w3(1); w2(5); w4(1); w2(4); w3(0); w3(0); w2(0xc5); udelay(10); for (k=0;k<count/4;k++) w4l(((u32 *)buf)[k]); w2(0xc4); break; } }
static void epia_write_block( PIA *pi, char * buf, int count ) { int ph, k, last, d; switch (pi->mode) { case 0: case 1: case 2: w0(0xa1); w2(1); w2(3); w2(1); w2(5); ph = 0; last = 0x8000; for (k=0;k<count;k++) { d = buf[k]; if (d != last) { last = d; w0(d); } w2(4+ph); ph = 1 - ph; } w2(7); w2(4); break; case 3: if (count < 512) WR(0x84,1); w3(0x40); for (k=0;k<count;k++) w4(buf[k]); if (count < 512) WR(0x84,0); break; case 4: if (count < 512) WR(0x84,1); w3(0x40); for (k=0;k<count/2;k++) w4w(((u16 *)buf)[k]); if (count < 512) WR(0x84,0); break; case 5: if (count < 512) WR(0x84,1); w3(0x40); for (k=0;k<count/4;k++) w4l(((u32 *)buf)[k]); if (count < 512) WR(0x84,0); break; } }
static void kbic_write_block( PIA *pi, char * buf, int count ) { int k; switch (pi->mode) { case 0: case 1: case 2: w0(0x90); w2(4); w2(6); w2(4); for(k=0;k<count/2;k++) { w0(buf[2*k+1]); w2(0); w2(4); w0(buf[2*k]); w2(5); w2(4); } break; case 3: w0(0xa0); w2(4); w2(6); w2(4); w3(0); for(k=0;k<count/2;k++) { w4(buf[2*k+1]); w4(buf[2*k]); } w2(4); w2(0); w2(4); break; case 4: w0(0xa0); w2(4); w2(6); w2(4); w3(0); for(k=0;k<count/2;k++) w4w(pi_swab16(buf,k)); w2(4); w2(0); w2(4); break; case 5: w0(0xa0); w2(4); w2(6); w2(4); w3(0); for(k=0;k<count/4;k++) w4l(pi_swab32(buf,k)); w2(4); w2(0); w2(4); break; } }