--- np2/lio/gpset.c 2004/02/21 04:48:35 1.7 +++ np2/lio/gpset.c 2005/02/07 14:46:12 1.12 @@ -4,49 +4,35 @@ typedef struct { - BYTE x[2]; - BYTE y[2]; - BYTE pal; + UINT8 x[2]; + UINT8 y[2]; + UINT8 pal; } GPSET; typedef struct { - BYTE x[2]; - BYTE y[2]; + UINT8 x[2]; + UINT8 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); -} - - // ---- PSET -REG8 lio_gpset(LIOWORK lio) { +REG8 lio_gpset(GLIO lio) { GPSET dat; SINT16 x; SINT16 y; 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.x); y = (SINT16)LOADINTELWORD(dat.y); if (dat.pal == 0xff) { if (CPU_AH == 1) { - dat.pal = lio->mem.fgcolor; + dat.pal = lio->work.fgcolor; } else { - dat.pal = lio->mem.bgcolor; + dat.pal = lio->work.bgcolor; } } lio_pset(lio, x, y, dat.pal); @@ -56,7 +42,7 @@ REG8 lio_gpset(LIOWORK lio) { // ---- GPOINT2 -REG8 lio_gpoint2(LIOWORK lio) { +REG8 lio_gpoint2(GLIO lio) { GPOINT2 dat; SINT16 x; @@ -65,10 +51,10 @@ REG8 lio_gpoint2(LIOWORK lio) { UINT32 addr; UINT sft; UINT pl; -const BYTE *ptr; +const UINT8 *ptr; 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.x); y = (SINT16)LOADINTELWORD(dat.y); if ((lio->draw.x1 > x) || (lio->draw.x2 < x) || @@ -88,7 +74,7 @@ const BYTE *ptr; ptr = mem + addr + lioplaneadrs[pl]; ret += (((*ptr) >> sft) & 1) << pl; } - if (lio->palmode == 2) { + if (lio->draw.flag & LIODRAW_4BPP) { ptr = mem + addr + lioplaneadrs[3]; ret += (((*ptr) >> sft) & 1) << 3; }