--- np2/vram/maketext.c 2003/11/15 07:10:03 1.3 +++ np2/vram/maketext.c 2004/02/07 21:23:22 1.6 @@ -1,5 +1,5 @@ #include "compiler.h" -#include "memory.h" +#include "cpucore.h" #include "pccore.h" #include "iocore.h" #include "vram.h" @@ -125,6 +125,7 @@ BYTE maketext_curblink(void) { void maketext(int text_renewal) { + UINT8 multiple; BYTE TEXT_LR; int TEXT_PL; int TEXT_BL; @@ -158,6 +159,7 @@ void maketext(int text_renewal) { tramflag.gaiji = 0; } + multiple = ((!(gdc.mode1 & 8)) && (!gdc.crt15khz))?0x20:0x00; TEXT_LR = gdc.m.para[GDC_CSRFORM] & 0x1f; TEXT_PL = crtc.reg.pl; TEXT_BL = crtc.reg.bl + 1; @@ -191,10 +193,9 @@ void maketext(int text_renewal) { pitch = gdc.m.para[GDC_PITCH] & 0xfe; csrw = LOADINTELWORD(gdc.m.para + GDC_CSRW); - esi = LOADINTELWORD(gdc.m.para + GDC_SCROLL); - esi &= 0xfff; + esi = LOW12(LOADINTELWORD(gdc.m.para + GDC_SCROLL)); scroll = LOADINTELWORD(gdc.m.para + GDC_SCROLL + 2); - scroll = (scroll >> 4) & 0x3ff; + scroll = LOW14(scroll) >> 4; scrp = 0; wait1 = 0; @@ -227,7 +228,7 @@ void maketext(int text_renewal) { new_flag = 1; break; } - edi = (edi + 1) & 0xfff; + edi = LOW12(edi + 1); } } if (new_flag) { @@ -266,10 +267,10 @@ void maketext(int text_renewal) { } else { bitmap[x] = 0x82000 + - (mem[0xa0000 + edi*2] << 3); - curx[x] |= 0x20; // ver0.28 + (mem[0xa0000 + edi*2] << 4); + curx[x] |= multiple; // ver0.74 if ((curx[x] & TXTATR_BG) && (gdc.mode1 & 1)) { - bitmap[x] += 0x800; + bitmap[x] += 8; } } } @@ -299,7 +300,7 @@ void maketext(int text_renewal) { bitmap[x] += 8; } else if (!(gdc.mode1 & 8)) { - curx[x] |= 0x20; + curx[x] |= multiple; } } lastbitp = bitmap[x]; @@ -312,13 +313,13 @@ void maketext(int text_renewal) { bitmap[x] = 0; } } - edi = (edi+1) & 0x0fff; // width80 + edi = LOW12(edi + 1); } if (!tramflag.curdisp) { cur_line = -1; } } - esi = (esi + pitch) & 0x0fff; // ver0.26 + esi = LOW12(esi + pitch); } if ((!TEXT_SDR) && (nowline >= topline + crtc.reg.ssl)) { @@ -349,12 +350,12 @@ void maketext(int text_renewal) { // width80 for (x=0; x>= 1; } - data = fontrom[bitmap[x] + fntline]; + data = fontrom[bitmap[x] + (fntline & 0x0f)]; *(UINT32 *)(q+0) = text_table[color[x] + (data >> 4)]; *(UINT32 *)(q+4) = text_table[color[x] + (data & 15)]; q += 8; @@ -410,10 +411,9 @@ void maketext(int text_renewal) { y++; if (!(--scroll)) { scrp = (scrp + 4) & 0x0c; - esi = LOADINTELWORD(gdc.m.para + GDC_SCROLL + scrp); - esi &= 0xfff; + esi = LOW12(LOADINTELWORD(gdc.m.para + GDC_SCROLL + scrp)); scroll = LOADINTELWORD(gdc.m.para + GDC_SCROLL + scrp + 2); - scroll = (scroll >> 4) & 0x3ff; + scroll = LOW14(scroll) >> 4; reloadline = TRUE; } } @@ -436,6 +436,7 @@ void maketext(int text_renewal) { void maketext40(int text_renewal) { + UINT8 multiple; BYTE TEXT_LR; int TEXT_PL; int TEXT_BL; @@ -469,6 +470,7 @@ void maketext40(int text_renewal) { tramflag.gaiji = 0; } + multiple = ((!(gdc.mode1 & 8)) && (!gdc.crt15khz))?0x20:0x00; TEXT_LR = gdc.m.para[GDC_CSRFORM] & 0x1f; TEXT_PL = crtc.reg.pl; TEXT_BL = crtc.reg.bl + 1; @@ -502,10 +504,9 @@ void maketext40(int text_renewal) { pitch = gdc.m.para[GDC_PITCH] & 0xfe; csrw = LOADINTELWORD(gdc.m.para + GDC_CSRW); - esi = LOADINTELWORD(gdc.m.para + GDC_SCROLL); - esi &= 0xfff; + esi = LOW12(LOADINTELWORD(gdc.m.para + GDC_SCROLL)); scroll = LOADINTELWORD(gdc.m.para + GDC_SCROLL + 2); - scroll = (scroll >> 4) & 0x3ff; + scroll = LOW14(scroll) >> 4; scrp = 0; wait1 = 0; @@ -538,7 +539,7 @@ void maketext40(int text_renewal) { new_flag = 1; break; } - edi = (edi + 1) & 0xfff; + edi = LOW12(edi + 1); } } if (new_flag) { @@ -577,10 +578,10 @@ void maketext40(int text_renewal) { } else { bitmap[x] = 0x82000 + - (mem[0xa0000 + edi*2] << 3); - curx[x] |= 0x20; // ver0.28 + (mem[0xa0000 + edi*2] << 4); + curx[x] |= multiple; // ver0.74 if ((curx[x] & TXTATR_BG) && (gdc.mode1 & 1)) { - bitmap[x] += 0x800; + bitmap[x] += 8; } } } @@ -610,7 +611,7 @@ void maketext40(int text_renewal) { bitmap[x] += 8; } else if (!(gdc.mode1 & 8)) { - curx[x] |= 0x20; + curx[x] |= multiple; } } lastbitp = bitmap[x]; @@ -623,13 +624,13 @@ void maketext40(int text_renewal) { bitmap[x] = 0; } } - edi = (edi+2) & 0x0fff; // width40 + edi = LOW12(edi + 2); // width40 } if (!tramflag.curdisp) { cur_line = -1; } } - esi = (esi + pitch) & 0x0fff; // ver0.26 + esi = LOW12(esi + pitch); } if ((!TEXT_SDR) && (nowline >= topline + crtc.reg.ssl)) { @@ -661,11 +662,11 @@ void maketext40(int text_renewal) { for (x=0; x<(TEXTXMAX/2); x++) { int fntline; BYTE data; - fntline = nowline & 0x0f; + fntline = nowline; if (curx[x] & 0x20) { fntline >>= 1; } - data = fontrom[bitmap[x] + fntline]; + data = fontrom[bitmap[x] + (fntline & 0x0f)]; *(UINT32 *)(q+ 0) = text_tblx2[color[x] + (data>>4)][0]; *(UINT32 *)(q+ 4) = text_tblx2[color[x] + @@ -735,10 +736,9 @@ void maketext40(int text_renewal) { y++; if (!(--scroll)) { scrp = (scrp + 4) & 0x0c; - esi = LOADINTELWORD(gdc.m.para + GDC_SCROLL + scrp); - esi &= 0xfff; + esi = LOW12(LOADINTELWORD(gdc.m.para + GDC_SCROLL + scrp)); scroll = LOADINTELWORD(gdc.m.para + GDC_SCROLL + scrp + 2); - scroll = (scroll >> 4) & 0x3ff; + scroll = LOW14(scroll) >> 4; reloadline = TRUE; } }