Diff for /np2/lio/gpset.c between versions 1.1.1.1 and 1.7

version 1.1.1.1, 2003/10/16 17:58:27 version 1.7, 2004/02/21 04:48:35
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "i286.h"  #include        "cpucore.h"
 #include        "memory.h"  
 #include        "lio.h"  #include        "lio.h"
   
   
Line 8  typedef struct { Line 7  typedef struct {
         BYTE    x[2];          BYTE    x[2];
         BYTE    y[2];          BYTE    y[2];
         BYTE    pal;          BYTE    pal;
 } MEMGPSET;  } GPSET;
   
   typedef struct {
           BYTE    x[2];
           BYTE    y[2];
   } GPOINT2;
   
   
   // ---- CLS
   
   REG8 lio_gcls(LIOWORK lio) {
   
           SINT16  y;
   
           lio_updatedraw(lio);
           for (y=lio->draw.y1; y<=lio->draw.y2; y++) {
                   lio_line(lio, lio->draw.x1, lio->draw.x2, y, lio->mem.bgcolor);
           }
           return(LIO_SUCCESS);
   }
   
   
 BYTE lio_gpset(void) {  // ---- PSET
   
         MEMGPSET        gpset;  REG8 lio_gpset(LIOWORK lio) {
         SINT16          x;  
         SINT16          y;  
   
         i286_memstr_read(I286_DS, I286_BX, &gpset, sizeof(gpset));          GPSET   dat;
         if (gpset.pal >= lio.gcolor1.palmax) {          SINT16  x;
                 if (I286_AH == 2) {          SINT16  y;
                         gpset.pal = lio.gcolor1.bgcolor;  
           lio_updatedraw(lio);
           i286_memstr_read(CPU_DS, CPU_BX, &dat, sizeof(dat));
           x = (SINT16)LOADINTELWORD(dat.x);
           y = (SINT16)LOADINTELWORD(dat.y);
           if (dat.pal == 0xff) {
                   if (CPU_AH == 1) {
                           dat.pal = lio->mem.fgcolor;
                   }
                   else {
                           dat.pal = lio->mem.bgcolor;
                   }
           }
           lio_pset(lio, x, y, dat.pal);
           return(LIO_SUCCESS);
   }
   
   
   // ---- GPOINT2
   
   REG8 lio_gpoint2(LIOWORK lio) {
   
           GPOINT2 dat;
           SINT16  x;
           SINT16  y;
           REG8    ret;
           UINT32  addr;
           UINT    sft;
           UINT    pl;
   const BYTE      *ptr;
   
           lio_updatedraw(lio);
           i286_memstr_read(CPU_DS, CPU_BX, &dat, sizeof(dat));
           x = (SINT16)LOADINTELWORD(dat.x);
           y = (SINT16)LOADINTELWORD(dat.y);
           if ((lio->draw.x1 > x) || (lio->draw.x2 < x) ||
                   (lio->draw.y1 > y) || (lio->draw.y2 < y)) {
                   ret = 0xff;
           }
           else {
                   ret = 0;
                   addr = (x >> 3) + (y * 80);
                   if (lio->draw.flag & LIODRAW_UPPER) {
                           addr += 16000;
                   }
                   addr += lio->draw.base;
                   sft = (~x) & 7;
                   if (!(lio->draw.flag & LIODRAW_MONO)) {
                           for (pl=0; pl<3; pl++) {
                                   ptr = mem + addr + lioplaneadrs[pl];
                                   ret += (((*ptr) >> sft) & 1) << pl;
                           }
                           if (lio->palmode == 2) {
                                   ptr = mem + addr + lioplaneadrs[3];
                                   ret += (((*ptr) >> sft) & 1) << 3;
                           }
                 }                  }
                 else {                  else {
                         gpset.pal = lio.gcolor1.fgcolor;                          ptr = mem + addr + lioplaneadrs[lio->draw.flag & LIODRAW_PMASK];
                           ret = ((*ptr) >> sft) & 1;
                 }                  }
         }          }
         x = (SINT16)LOADINTELWORD(gpset.x);          CPU_AL = ret;
         y = (SINT16)LOADINTELWORD(gpset.y);          return(LIO_SUCCESS);
         lio_pset(x, y, gpset.pal);  
         return(0);  
 }  }
   

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


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