Diff for /np2/lio/gput1.c between versions 1.8 and 1.15

version 1.8, 2004/02/21 04:48:35 version 1.15, 2004/06/04 16:54:57
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 348  static REG8 putsub(LIOWORK lio, const LI Line 348  static REG8 putsub(LIOWORK lio, const LI
         }          }
         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->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) {
                                 i286_memstr_read(lput->seg, off, pt.pat, datacnt);                                  pt.baseptr = mem + lio->draw.base + lioplaneadrs[pl];
                                 off += datacnt;                                  MEML_READSTR(lput->seg, off, pt.pat, 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));          MEML_READSTR(CPU_DS, CPU_BX, &dat, sizeof(dat));
         x = (SINT16)LOADINTELWORD(dat.x1);          x = (SINT16)LOADINTELWORD(dat.x1);
         y = (SINT16)LOADINTELWORD(dat.y1);          y = (SINT16)LOADINTELWORD(dat.y1);
         x2 = (SINT16)LOADINTELWORD(dat.x2);          x2 = (SINT16)LOADINTELWORD(dat.x2);
Line 508  REG8 lio_gget(LIOWORK lio) { Line 509  REG8 lio_gget(LIOWORK lio) {
         if (leng < (size + 4)) {          if (leng < (size + 4)) {
                 return(LIO_ILLEGALFUNC);                  return(LIO_ILLEGALFUNC);
         }          }
         i286_memword_write(seg, off, (REG16)x2);          MEML_WRITE16(seg, off, (REG16)x2);
         i286_memword_write(seg, off+2, (REG16)y2);          MEML_WRITE16(seg, off+2, (REG16)y2);
         off += 4;          off += 4;
         addr = (x >> 3) + (y * 80);          gt.addr = (x >> 3) + (y * 80);
         if (lio->draw.flag & LIODRAW_UPPER) {          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;                                  MEML_WRITESTR(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 547  REG8 lio_gput1(LIOWORK lio) { Line 547  REG8 lio_gput1(LIOWORK lio) {
         UINT    size;          UINT    size;
   
         lio_updatedraw(lio);          lio_updatedraw(lio);
         i286_memstr_read(CPU_DS, CPU_BX, &dat, sizeof(dat));          MEML_READSTR(CPU_DS, CPU_BX, &dat, sizeof(dat));
         lput.x = (SINT16)LOADINTELWORD(dat.x);          lput.x = (SINT16)LOADINTELWORD(dat.x);
         lput.y = (SINT16)LOADINTELWORD(dat.y);          lput.y = (SINT16)LOADINTELWORD(dat.y);
         lput.off = (UINT16)(LOADINTELWORD(dat.off) + 4);          lput.off = (UINT16)(LOADINTELWORD(dat.off) + 4);
         lput.seg = LOADINTELWORD(dat.seg);          lput.seg = LOADINTELWORD(dat.seg);
         lput.mode = dat.mode;          lput.mode = dat.mode;
         leng = LOADINTELWORD(dat.leng);          leng = LOADINTELWORD(dat.leng);
         lput.width = i286_memword_read(lput.seg, lput.off - 4);          lput.width = MEML_READ16(lput.seg, lput.off - 4);
         lput.height = i286_memword_read(lput.seg, lput.off - 2);          lput.height = MEML_READ16(lput.seg, lput.off - 2);
         size = ((lput.width + 7) >> 3) * lput.height;          size = ((lput.width + 7) >> 3) * lput.height;
         if (leng < (size + 4)) {          if (leng < (size + 4)) {
                 return(LIO_ILLEGALFUNC);                  return(LIO_ILLEGALFUNC);
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->mem.fgcolor;                          lput.fg = lio->work.fgcolor;
                         lput.bg = lio->mem.bgcolor;                          lput.bg = lio->work.bgcolor;
                 }                  }
         }          }
         else {          else {
Line 589  REG8 lio_gput1(LIOWORK lio) { Line 589  REG8 lio_gput1(LIOWORK lio) {
   
 // ---- GPUT2  // ---- GPUT2
   
 REG8 lio_gput2(LIOWORK lio) {  REG8 lio_gput2(GLIO lio) {
   
         GPUT2   dat;          GPUT2   dat;
         LIOPUT  lput;          LIOPUT  lput;
         UINT16  jis;          UINT16  jis;
           int             pat;
         REG16   size;          REG16   size;
   
         lio_updatedraw(lio);          lio_updatedraw(lio);
         i286_memstr_read(CPU_DS, CPU_BX, &dat, sizeof(dat));          MEML_READSTR(CPU_DS, CPU_BX, &dat, sizeof(dat));
         lput.x = (SINT16)LOADINTELWORD(dat.x);          lput.x = (SINT16)LOADINTELWORD(dat.x);
         lput.y = (SINT16)LOADINTELWORD(dat.y);          lput.y = (SINT16)LOADINTELWORD(dat.y);
           lput.off = 0x104e;
           lput.seg = CPU_DS;
         jis = LOADINTELWORD(dat.chr);          jis = LOADINTELWORD(dat.chr);
         if (jis & 0xff00) {          pat = 0;
                 lput.off = 0x104e;          if (jis < 0x200) {
                 lput.seg = CPU_DS;                  if (jis < 0x80) {
                 if (jis < 0x200) {                      // 1/4ANK                          if (jis == 0x7c) {
                                   pat = 1;
                           }
                           else if (jis == 0x7e) {
                                   pat = 2;
                           }
                           else {
                                   jis += 0x2900;
                           }
                   }
                   else if (jis < 0x100) {
                           if ((jis - 0x20) & 0x40) {
                                   pat = (jis & 0x3f) + 3;
                           }
                           else {
                                   jis += 0x2980;
                           }
                   }
                   else {
                         jis &= 0xff;                          jis &= 0xff;
                 }                  }
           }
           if (!pat) {
                 size = bios0x18_14(lput.seg, 0x104c, jis);                  size = bios0x18_14(lput.seg, 0x104c, jis);
                 lput.width = (size & 0xff00) >> (8 - 3);  
                 lput.height = (size & 0xff) << 3;  
         }          }
         else {          else {
                 return(0);                  MEML_WRITESTR(lput.seg, lput.off, mem + (LIO_SEGMENT << 4) +
                                                                                   LIO_FONT + ((pat - 1) << 4), 0x10);
                   size = 0x0102;
         }          }
           lput.width = (size & 0xff00) >> (8 - 3);
           lput.height = (size & 0xff) << 3;
         lput.mode = dat.mode;          lput.mode = dat.mode;
         lput.sw = 0;          lput.sw = 0;
         if (dat.colorsw) {          if (dat.colorsw) {
Line 621  REG8 lio_gput2(LIOWORK lio) { Line 646  REG8 lio_gput2(LIOWORK lio) {
                 lput.bg = dat.bg;                  lput.bg = dat.bg;
         }          }
         else {          else {
                 lput.fg = lio->mem.fgcolor;                  lput.fg = lio->work.fgcolor;
                 lput.bg = lio->mem.bgcolor;                  lput.bg = lio->work.bgcolor;
         }          }
         return(putsub(lio, &lput));          return(putsub(lio, &lput));
 }  }

Removed from v.1.8  
changed lines
  Added in v.1.15


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