static void epia_read_block( PIA *pi, char * buf, int count ) { int k, ph, a, b; switch (pi->mode) { case 0: w0(0x81); w2(1); w2(3); w0(0xc1); ph = 1; for (k=0;k<count;k++) { w2(2+ph); a = r1(); w2(4+ph); b = r1(); buf[k] = j44(a,b); ph = 1 - ph; } w0(0); w2(4); break; case 1: w0(0x91); w2(1); w0(0x10); w2(3); w0(0x51); w2(5); w0(0xd1); ph = 1; for (k=0;k<count;k++) { w2(4+ph); a = r1(); b = r2(); buf[k] = j53(a,b); ph = 1 - ph; } w0(0); w2(4); break; case 2: w0(0x89); w2(1); w2(0x23); w2(0x21); ph = 1; for (k=0;k<count;k++) { w2(0x24+ph); buf[k] = r0(); ph = 1 - ph; } w2(6); w2(4); break; case 3: if (count > 512) WR(0x84,3); w3(0); w2(0x24); for (k=0;k<count;k++) buf[k] = r4(); w2(4); WR(0x84,0); break; case 4: if (count > 512) WR(0x84,3); w3(0); w2(0x24); for (k=0;k<count/2;k++) ((u16 *)buf)[k] = r4w(); w2(4); WR(0x84,0); break; case 5: if (count > 512) WR(0x84,3); w3(0); w2(0x24); for (k=0;k<count/4;k++) ((u32 *)buf)[k] = r4l(); w2(4); WR(0x84,0); break; } }
static void kbic_read_block( PIA *pi, char * buf, int count ) { int k, a, b; switch (pi->mode) { case 0: w0(0x98); w2(4); w2(6); w2(4); for (k=0;k<count/2;k++) { w2(1); w0(8); a = r1(); w0(0x28); b = r1(); buf[2*k] = j44(a,b); w2(5); b = r1(); w0(8); a = r1(); buf[2*k+1] = j44(a,b); w2(4); } break; case 1: w0(0xb8); w2(4); w2(6); w2(4); for (k=0;k<count/4;k++) { w0(0xb8); w2(4); w2(5); w0(8); buf[4*k] = j53(r12w()); w0(0xb8); buf[4*k+1] = j53(r12w()); w2(4); w2(5); buf[4*k+3] = j53(r12w()); w0(8); buf[4*k+2] = j53(r12w()); } w2(4); break; case 2: w0(0x88); w2(4); w2(6); w2(4); for (k=0;k<count/2;k++) { w2(0xa0); w2(0xa1); buf[2*k] = r0(); w2(0xa5); buf[2*k+1] = r0(); } w2(4); break; case 3: w0(0xa0); w2(4); w2(6); w2(4); w3(0); for (k=0;k<count;k++) buf[k] = r4(); 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++) ((u16 *)buf)[k] = r4w(); 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++) ((u32 *)buf)[k] = r4l(); w2(4); w2(0); w2(4); break; } }
static void on26_read_block( PIA *pi, char * buf, int count ) { int k, a, b; switch (pi->mode) { case 0: w0(1); P1; w0(1); P2; w0(2); P1; w0(0x18); P2; w0(0); P1; udelay(10); for (k=0;k<count;k++) { w2(6); a = r1(); w2(4); b = r1(); buf[k] = j44(a,b); } w0(2); P1; w0(8); P2; break; case 1: w0(1); P1; w0(1); P2; w0(2); P1; w0(0x19); P2; w0(0); P1; udelay(10); for (k=0;k<count/2;k++) { w2(0x26); buf[2*k] = r0(); w2(0x24); buf[2*k+1] = r0(); } w0(2); P1; w0(9); P2; break; case 2: w3(1); w3(1); w2(5); w4(1); w2(4); w3(0); w3(0); w2(0x24); udelay(10); for (k=0;k<count;k++) buf[k] = r4(); w2(4); break; case 3: w3(1); w3(1); w2(5); w4(1); w2(4); w3(0); w3(0); w2(0x24); udelay(10); for (k=0;k<count/2;k++) ((u16 *)buf)[k] = r4w(); w2(4); break; case 4: w3(1); w3(1); w2(5); w4(1); w2(4); w3(0); w3(0); w2(0x24); udelay(10); for (k=0;k<count/4;k++) ((u32 *)buf)[k] = r4l(); w2(4); break; } }
static void dstr_read_block( PIA *pi, char * buf, int count ) { int k, a, b; w0(0x81); P1; if (pi->mode) { w0(0x19); } else { w0(9); } P2; w0(0x82); P1; P3; w0(0x20); P1; switch (pi->mode) { case 0: for (k=0;k<count;k++) { w2(6); a = r1(); w2(4); w2(6); b = r1(); w2(4); buf[k] = j44(a,b); } break; case 1: w0(0); for (k=0;k<count;k++) { w2(0x26); buf[k] = r0(); w2(0x24); } w2(4); break; case 2: w2(0x24); for (k=0;k<count;k++) buf[k] = r4(); w2(4); break; case 3: w2(0x24); for (k=0;k<count/2;k++) ((u16 *)buf)[k] = r4w(); w2(4); break; case 4: w2(0x24); for (k=0;k<count/4;k++) ((u32 *)buf)[k] = r4l(); w2(4); break; } }
static void comm_read_block( PIA *pi, char * buf, int count ) { int i, l, h; switch (pi->mode) { case 0: w0(0x48); P1; for(i=0;i<count;i++) { w0(0); w2(6); l = r1(); w0(0x80); h = r1(); w2(4); buf[i] = j44(l,h); } break; case 1: w0(0x68); P1; w0(0); for(i=0;i<count;i++) { w2(0x26); buf[i] = r0(); w2(0x24); } w2(4); break; case 2: w3(0x68); (void)r1(); w2(0x24); for (i=0;i<count;i++) buf[i] = r4(); w2(4); break; case 3: w3(0x68); (void)r1(); w2(0x24); for (i=0;i<count/2;i++) ((u16 *)buf)[i] = r4w(); w2(4); break; case 4: w3(0x68); (void)r1(); w2(0x24); for (i=0;i<count/4;i++) ((u32 *)buf)[i] = r4l(); w2(4); break; } }
static void epat_read_block( PIA *pi, char * buf, int count ) { int k, ph, a, b; switch (pi->mode) { case 0: w0(7); w2(1); w2(3); w0(0xff); ph = 0; for(k=0;k<count;k++) { if (k == count-1) w0(0xfd); w2(6+ph); a = r1(); if (a & 8) b = a; else { w2(4+ph); b = r1(); } buf[k] = j44(a,b); ph = 1 - ph; } w0(0); w2(4); break; case 1: w0(0x47); w2(1); w2(5); w0(0xff); ph = 0; for(k=0;k<count;k++) { if (k == count-1) w0(0xfd); w2(4+ph); a = r1(); b = r2(); buf[k] = j53(a,b); ph = 1 - ph; } w0(0); w2(4); break; case 2: w0(0x27); w2(1); w2(0x25); w0(0); ph = 0; for(k=0;k<count-1;k++) { w2(0x24+ph); buf[k] = r0(); ph = 1 - ph; } w2(0x26); w2(0x27); buf[count-1] = r0(); w2(0x25); w2(4); break; case 3: w3(0x80); w2(0x24); for(k=0;k<count-1;k++) buf[k] = r4(); w2(4); w3(0xa0); w2(0x24); buf[count-1] = r4(); w2(4); break; case 4: w3(0x80); w2(0x24); for(k=0;k<(count/2)-1;k++) ((u16 *)buf)[k] = r4w(); buf[count-2] = r4(); w2(4); w3(0xa0); w2(0x24); buf[count-1] = r4(); w2(4); break; case 5: w3(0x80); w2(0x24); for(k=0;k<(count/4)-1;k++) ((u32 *)buf)[k] = r4l(); for(k=count-4;k<count-1;k++) buf[k] = r4(); w2(4); w3(0xa0); w2(0x24); buf[count-1] = r4(); w2(4); break; } }