--- np2/lio/gput1.c 2004/02/21 06:26:34 1.9 +++ np2/lio/gput1.c 2004/06/04 16:54:57 1.15 @@ -321,7 +321,7 @@ const BYTE *src; // ---- -static REG8 putsub(LIOWORK lio, const LIOPUT *lput) { +static REG8 putsub(GLIO lio, const LIOPUT *lput) { UINT addr; PUTCNTX pt; @@ -371,7 +371,7 @@ static REG8 putsub(LIOWORK lio, const LI flag >>= 1; if (flag & 8) { pt.baseptr = mem + lio->draw.base + lioplaneadrs[pl]; - i286_memstr_read(lput->seg, off, pt.pat, datacnt); + MEML_READSTR(lput->seg, off, pt.pat, datacnt); if (lput->sw) { off += datacnt; } @@ -455,7 +455,7 @@ static REG8 putsub(LIOWORK lio, const LI // ---- GGET -REG8 lio_gget(LIOWORK lio) { +REG8 lio_gget(GLIO lio) { GGET dat; SINT32 x; @@ -473,7 +473,7 @@ REG8 lio_gget(LIOWORK lio) { UINT pl; 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); y = (SINT16)LOADINTELWORD(dat.y1); x2 = (SINT16)LOADINTELWORD(dat.x2); @@ -509,8 +509,8 @@ REG8 lio_gget(LIOWORK lio) { if (leng < (size + 4)) { return(LIO_ILLEGALFUNC); } - i286_memword_write(seg, off, (REG16)x2); - i286_memword_write(seg, off+2, (REG16)y2); + MEML_WRITE16(seg, off, (REG16)x2); + MEML_WRITE16(seg, off+2, (REG16)y2); off += 4; gt.addr = (x >> 3) + (y * 80); if (lio->draw.flag & LIODRAW_UPPER) { @@ -526,7 +526,7 @@ REG8 lio_gget(LIOWORK lio) { if (mask & 8) { gt.baseptr = mem + lio->draw.base + lioplaneadrs[pl]; getvram(>, pat); - i286_memstr_write(seg, off, pat, datacnt); + MEML_WRITESTR(seg, off, pat, datacnt); off += datacnt; } } @@ -539,7 +539,7 @@ REG8 lio_gget(LIOWORK lio) { // ---- GPUT1 -REG8 lio_gput1(LIOWORK lio) { +REG8 lio_gput1(GLIO lio) { GPUT1 dat; LIOPUT lput; @@ -547,15 +547,15 @@ REG8 lio_gput1(LIOWORK lio) { UINT size; 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.y = (SINT16)LOADINTELWORD(dat.y); lput.off = (UINT16)(LOADINTELWORD(dat.off) + 4); lput.seg = LOADINTELWORD(dat.seg); lput.mode = dat.mode; leng = LOADINTELWORD(dat.leng); - lput.width = i286_memword_read(lput.seg, lput.off - 4); - lput.height = i286_memword_read(lput.seg, lput.off - 2); + lput.width = MEML_READ16(lput.seg, lput.off - 4); + lput.height = MEML_READ16(lput.seg, lput.off - 2); size = ((lput.width + 7) >> 3) * lput.height; if (leng < (size + 4)) { return(LIO_ILLEGALFUNC); @@ -567,8 +567,8 @@ REG8 lio_gput1(LIOWORK lio) { lput.bg = dat.bg; } else { - lput.fg = lio->mem.fgcolor; - lput.bg = lio->mem.bgcolor; + lput.fg = lio->work.fgcolor; + lput.bg = lio->work.bgcolor; } } else { @@ -589,31 +589,56 @@ REG8 lio_gput1(LIOWORK lio) { // ---- GPUT2 -REG8 lio_gput2(LIOWORK lio) { +REG8 lio_gput2(GLIO lio) { GPUT2 dat; LIOPUT lput; UINT16 jis; + int pat; REG16 size; 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.y = (SINT16)LOADINTELWORD(dat.y); + lput.off = 0x104e; + lput.seg = CPU_DS; jis = LOADINTELWORD(dat.chr); - if (jis & 0xff00) { - lput.off = 0x104e; - lput.seg = CPU_DS; - if (jis < 0x200) { // 1/4ANK + pat = 0; + if (jis < 0x200) { + if (jis < 0x80) { + 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; } + } + if (!pat) { size = bios0x18_14(lput.seg, 0x104c, jis); - lput.width = (size & 0xff00) >> (8 - 3); - lput.height = (size & 0xff) << 3; } 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.sw = 0; if (dat.colorsw) { @@ -621,8 +646,8 @@ REG8 lio_gput2(LIOWORK lio) { lput.bg = dat.bg; } else { - lput.fg = lio->mem.fgcolor; - lput.bg = lio->mem.bgcolor; + lput.fg = lio->work.fgcolor; + lput.bg = lio->work.bgcolor; } return(putsub(lio, &lput)); }