Diff for /np2/lio/gput1.c between versions 1.7 and 1.10

version 1.7, 2004/02/21 00:25:33 version 1.10, 2004/02/21 20:48:52
Line 321  const BYTE *src; Line 321  const BYTE *src;
   
 // ----  // ----
   
 static REG8 putsub(LIOWORK lio, const LIOPUT *lput) {  static REG8 putsub(GLIO lio, const LIOPUT *lput) {
   
         UINT    addr;          UINT    addr;
         PUTCNTX pt;          PUTCNTX pt;
Line 334  static REG8 putsub(LIOWORK lio, const LI Line 334  static REG8 putsub(LIOWORK lio, const LI
   
         if ((lput->x < lio->draw.x1) ||          if ((lput->x < lio->draw.x1) ||
                 (lput->y < lio->draw.y1) ||                  (lput->y < lio->draw.y1) ||
                 ((lput->x + lput->width) > lio->draw.x2) ||                  ((lput->x + lput->width - 1) > lio->draw.x2) ||
                 ((lput->y + lput->height) > lio->draw.y2)) {                  ((lput->y + lput->height - 1) > lio->draw.y2)) {
                 return(LIO_ILLEGALFUNC);                  return(LIO_ILLEGALFUNC);
         }          }
         if ((lput->width <= 0) || (lput->height <= 0)) {          if ((lput->width <= 0) || (lput->height <= 0)) {
Line 343  static REG8 putsub(LIOWORK lio, const LI Line 343  static REG8 putsub(LIOWORK lio, const LI
         }          }
   
         addr = (lput->x >> 3) + (lput->y * 80);          addr = (lput->x >> 3) + (lput->y * 80);
         if (lio->scrn.top) {          if (lio->draw.flag & LIODRAW_UPPER) {
                 addr += 16000;                  addr += 16000;
         }          }
         setdirty(addr, (lput->x & 7) + lput->width, lput->height, lio->draw.sbit);          setdirty(addr, (lput->x & 7) + lput->width, lput->height, lio->draw.sbit);
   
           pt.addr = addr;
         pt.sft = lput->x & 7;          pt.sft = lput->x & 7;
         pt.width = lput->width;          pt.width = lput->width;
         pt.maskl = (UINT8)(0xff >> pt.sft);          pt.maskl = (UINT8)(0xff >> pt.sft);
Line 357  static REG8 putsub(LIOWORK lio, const LI Line 358  static REG8 putsub(LIOWORK lio, const LI
         datacnt = (lput->width + 7) >> 3;          datacnt = (lput->width + 7) >> 3;
         off = lput->off;          off = lput->off;
   
         flag = (lio->gcolor1.palmode == 2)?0x0f:0x07;          flag = (lio->draw.flag & LIODRAW_4BPP)?0x0f:0x07;
         flag |= (lput->fg & 15) << 4;          flag |= (lput->fg & 15) << 4;
         flag |= (lput->bg & 15) << 8;          flag |= (lput->bg & 15) << 8;
   
         // さて表示。          // さて表示。
         writecnt = 0;          writecnt = 0;
         for (pl=0; pl<4; pl++) {          height = lput->height;
                 if (flag & 1) {          do {
                         pt.baseptr = mem + lio->draw.base + lioplaneadrs[pl];                  flag <<= 4;
                         pt.addr = addr;                  for (pl=0; pl<4; pl++) {
                         height = lput->height;                          flag >>= 1;
                         do {                          if (flag & 8) {
                                   pt.baseptr = mem + lio->draw.base + lioplaneadrs[pl];
                                 i286_memstr_read(lput->seg, off, pt.pat, datacnt);                                  i286_memstr_read(lput->seg, off, pt.pat, datacnt);
                                 off += datacnt;                                  if (lput->sw) {
                                           off += datacnt;
                                   }
                                 switch(lput->mode) {                                  switch(lput->mode) {
                                         case 0:         // PSET                                          case 0:         // PSET
                                                 if (flag & (1 << 4)) {                                                  if (flag & (8 << 4)) {
                                                         putor(&pt);                                                          putor(&pt);
                                                 }                                                  }
                                                 else {                                                  else {
                                                         putandn(&pt);                                                          putandn(&pt);
                                                 }                                                  }
                                                 if (flag & (1 << 8)) {                                                  if (flag & (8 << 8)) {
                                                         putorn(&pt);                                                          putorn(&pt);
                                                 }                                                  }
                                                 else {                                                  else {
Line 389  static REG8 putsub(LIOWORK lio, const LI Line 393  static REG8 putsub(LIOWORK lio, const LI
                                                 break;                                                  break;
   
                                         case 1:         // NOT                                          case 1:         // NOT
                                                 if (!(flag & (1 << 4))) {                                                  if (!(flag & (8 << 4))) {
                                                         putor(&pt);                                                          putor(&pt);
                                                 }                                                  }
                                                 else {                                                  else {
                                                         putandn(&pt);                                                          putandn(&pt);
                                                 }                                                  }
                                                 if (!(flag & (1 << 8))) {                                                  if (!(flag & (8 << 8))) {
                                                         putorn(&pt);                                                          putorn(&pt);
                                                 }                                                  }
                                                 else {                                                  else {
Line 405  static REG8 putsub(LIOWORK lio, const LI Line 409  static REG8 putsub(LIOWORK lio, const LI
                                                 break;                                                  break;
   
                                         case 2:         // OR                                          case 2:         // OR
                                                 if (flag & (1 << 4)) {                                                  if (flag & (8 << 4)) {
                                                         putor(&pt);                                                          putor(&pt);
                                                         writecnt++;                                                          writecnt++;
                                                 }                                                  }
                                                 if (flag & (1 << 8)) {                                                  if (flag & (8 << 8)) {
                                                         putorn(&pt);                                                          putorn(&pt);
                                                         writecnt++;                                                          writecnt++;
                                                 }                                                  }
                                                 break;                                                  break;
   
                                         case 3:         // AND                                          case 3:         // AND
                                                 if (!(flag & (1 << 4))) {                                                  if (!(flag & (8 << 4))) {
                                                         putandn(&pt);                                                          putandn(&pt);
                                                         writecnt++;                                                          writecnt++;
                                                 }                                                  }
                                                 if (!(flag & (1 << 8))) {                                                  if (!(flag & (8 << 8))) {
                                                         putand(&pt);                                                          putand(&pt);
                                                         writecnt++;                                                          writecnt++;
                                                 }                                                  }
                                                 break;                                                  break;
   
                                         case 4:         // XOR                                          case 4:         // XOR
                                                 if (flag & (1 << 4)) {                                                  if (flag & (8 << 4)) {
                                                         putxor(&pt);                                                          putxor(&pt);
                                                         writecnt++;                                                          writecnt++;
                                                 }                                                  }
                                                 if (flag & (1 << 8)) {                                                  if (flag & (8 << 8)) {
                                                         putxorn(&pt);                                                          putxorn(&pt);
                                                         writecnt++;                                                          writecnt++;
                                                 }                                                  }
                                                 break;                                                  break;
                                 }                                  }
                                 pt.addr += 80;  
                         } while(--height);  
                         if (!lput->sw) {  
                                 off = lput->off;  
                         }                          }
                 }                  }
                 flag >>= 1;                  pt.addr += 80;
         }                  if (!lput->sw) {
                           off += datacnt;
                   }
           } while(--height);
         lio->wait += writecnt * datacnt * (10 + 10 + 10);          lio->wait += writecnt * datacnt * (10 + 10 + 10);
         return(LIO_SUCCESS);          return(LIO_SUCCESS);
 }  }
Line 452  static REG8 putsub(LIOWORK lio, const LI Line 455  static REG8 putsub(LIOWORK lio, const LI
   
 // ---- GGET  // ---- GGET
   
 REG8 lio_gget(LIOWORK lio) {  REG8 lio_gget(GLIO lio) {
   
         GGET    dat;          GGET    dat;
         SINT32  x;          SINT32  x;
Line 465  REG8 lio_gget(LIOWORK lio) { Line 468  REG8 lio_gget(LIOWORK lio) {
         UINT32  size;          UINT32  size;
         UINT    datacnt;          UINT    datacnt;
         UINT    mask;          UINT    mask;
         UINT    addr;  
         GETCNTX gt;          GETCNTX gt;
         BYTE    pat[84];          BYTE    pat[84];
         UINT    pl;          UINT    pl;
         UINT    height;  
   
         lio_updatedraw(lio);          lio_updatedraw(lio);
         i286_memstr_read(CPU_DS, CPU_BX, &dat, sizeof(dat));          i286_memstr_read(CPU_DS, CPU_BX, &dat, sizeof(dat));
Line 492  REG8 lio_gget(LIOWORK lio) { Line 493  REG8 lio_gget(LIOWORK lio) {
         datacnt = (x2 + 7) >> 3;          datacnt = (x2 + 7) >> 3;
         size = datacnt * y2;          size = datacnt * y2;
         leng = LOADINTELWORD(dat.leng);          leng = LOADINTELWORD(dat.leng);
         if (lio->scrn.plane & 0x80) {          if (!(lio->draw.flag & LIODRAW_MONO)) {
                 if (lio->gcolor1.palmode == 2) {                  if (lio->draw.flag & LIODRAW_4BPP) {
                         size *= 4;                          size *= 4;
                         mask = 0x0f;                          mask = 0x0f;
                 }                  }
Line 503  REG8 lio_gget(LIOWORK lio) { Line 504  REG8 lio_gget(LIOWORK lio) {
                 }                  }
         }          }
         else {          else {
                 mask = 1 << (lio->scrn.plane & 3);                  mask = 1 << (lio->draw.flag & LIODRAW_PMASK);
         }          }
         if (leng < (size + 4)) {          if (leng < (size + 4)) {
                 return(LIO_ILLEGALFUNC);                  return(LIO_ILLEGALFUNC);
Line 511  REG8 lio_gget(LIOWORK lio) { Line 512  REG8 lio_gget(LIOWORK lio) {
         i286_memword_write(seg, off, (REG16)x2);          i286_memword_write(seg, off, (REG16)x2);
         i286_memword_write(seg, off+2, (REG16)y2);          i286_memword_write(seg, off+2, (REG16)y2);
         off += 4;          off += 4;
         addr = (x >> 3) + (y * 80);          gt.addr = (x >> 3) + (y * 80);
         if (lio->scrn.top) {          if (lio->draw.flag & LIODRAW_UPPER) {
                 addr += 16000;                  gt.addr += 16000;
         }          }
         gt.sft = x & 7;          gt.sft = x & 7;
         gt.width = x2;          gt.width = x2;
         gt.mask = (UINT8)((~0x7f) >> ((x2 - 1) & 7));          gt.mask = (UINT8)((~0x7f) >> ((x2 - 1) & 7));
         for (pl=0; pl<4; pl++) {          do {
                 if (mask & 1) {                  mask <<= 4;
                         gt.baseptr = mem + lio->draw.base + lioplaneadrs[pl];                  for (pl=0; pl<4; pl++) {
                         gt.addr = addr;                          mask >>= 1;
                         height = y2;                          if (mask & 8) {
                         do {                                  gt.baseptr = mem + lio->draw.base + lioplaneadrs[pl];
                                 getvram(&gt, pat);                                  getvram(&gt, pat);
                                 gt.addr += 80;  
                                 i286_memstr_write(seg, off, pat, datacnt);                                  i286_memstr_write(seg, off, pat, datacnt);
                                 off += datacnt;                                  off += datacnt;
                         } while(--height);                          }
                 }                  }
                 mask >>= 1;                  gt.addr += 80;
         }          } while(--y2);
         lio->wait = size * 12;          lio->wait = size * 12;
         return(LIO_SUCCESS);          return(LIO_SUCCESS);
 }  }
Line 539  REG8 lio_gget(LIOWORK lio) { Line 539  REG8 lio_gget(LIOWORK lio) {
   
 // ---- GPUT1  // ---- GPUT1
   
 REG8 lio_gput1(LIOWORK lio) {  REG8 lio_gput1(GLIO lio) {
   
         GPUT1   dat;          GPUT1   dat;
         LIOPUT  lput;          LIOPUT  lput;
Line 567  REG8 lio_gput1(LIOWORK lio) { Line 567  REG8 lio_gput1(LIOWORK lio) {
                         lput.bg = dat.bg;                          lput.bg = dat.bg;
                 }                  }
                 else {                  else {
                         lput.fg = lio->gcolor1.fgcolor;                          lput.fg = lio->work.fgcolor;
                         lput.bg = lio->gcolor1.bgcolor;                          lput.bg = lio->work.bgcolor;
                 }                  }
         }          }
         else {          else {
Line 583  REG8 lio_gput1(LIOWORK lio) { Line 583  REG8 lio_gput1(LIOWORK lio) {
                         lput.bg = 0;                          lput.bg = 0;
                 }                  }
         }          }
         TRACEOUT(("put1 - %d,%d / %d / %d %d %d", lput.width, lput.height, lput.mode, lput.sw, lput.fg, lput.bg));  
         return(putsub(lio, &lput));          return(putsub(lio, &lput));
 }  }
   
   
 // ---- GPUT2  // ---- GPUT2
   
 REG8 lio_gput2(LIOWORK lio) {  REG8 lio_gput2(GLIO lio) {
   
         GPUT2   dat;          GPUT2   dat;
         LIOPUT  lput;          LIOPUT  lput;
Line 622  REG8 lio_gput2(LIOWORK lio) { Line 621  REG8 lio_gput2(LIOWORK lio) {
                 lput.bg = dat.bg;                  lput.bg = dat.bg;
         }          }
         else {          else {
                 lput.fg = lio->gcolor1.fgcolor;                  lput.fg = lio->work.fgcolor;
                 lput.bg = lio->gcolor1.bgcolor;                  lput.bg = lio->work.bgcolor;
         }          }
         return(putsub(lio, &lput));          return(putsub(lio, &lput));
 }  }

Removed from v.1.7  
changed lines
  Added in v.1.10


RetroPC.NET-CVS <cvs@retropc.net>