--- np2/vram/maketext.c 2003/12/12 01:04:41 1.5 +++ np2/vram/maketext.c 2004/02/19 03:04:02 1.9 @@ -14,12 +14,7 @@ static UINT32 text_table[512]; static UINT32 text_tblx2[512][2]; -void maketext_reset(void) { - - ZeroMemory(&tramflag, sizeof(tramflag)); -} - -void maketext_init(void) { +void maketext_initialize(void) { int i; int j; @@ -67,6 +62,11 @@ void maketext_init(void) { } } +void maketext_reset(void) { + + ZeroMemory(&tramflag, sizeof(tramflag)); +} + static BYTE dirtyonblink(void) { BYTE ret; @@ -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 & 1)))?0x20:0x00; TEXT_LR = gdc.m.para[GDC_CSRFORM] & 0x1f; TEXT_PL = crtc.reg.pl; TEXT_BL = crtc.reg.bl + 1; @@ -237,7 +239,7 @@ void maketext(int text_renewal) { edi = esi; gaiji1st = 0; kanji2nd = FALSE; - lastbitp = 0; // ver0.28 + lastbitp = 0; for (x=0; x= (gdc.m.para[GDC_CSRFORM+1] & 0x1f)) && (nowline <= (gdc.m.para[GDC_CSRFORM+2] >> 3))) { color[cur_line] |= 256; - if (curx[cur_line] & 0x80) { // ver0.28 + if (curx[cur_line] & 0x80) { color[cur_line+1] |= 256; } } else { color[cur_line] &= ~(256); - if (curx[cur_line] & 0x80) { // ver0.28 + if (curx[cur_line] & 0x80) { color[cur_line+1] &= ~(256); } } @@ -348,12 +349,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; @@ -387,7 +388,6 @@ void maketext(int text_renewal) { } q += 4; } - // virtical line ver0.27 if ((line_effect & TXTATR_VL) && (!(gdc.mode1 & 1))) { // width80 q -= TEXTXMAX * 8; @@ -434,6 +434,7 @@ void maketext(int text_renewal) { void maketext40(int text_renewal) { + UINT8 multiple; BYTE TEXT_LR; int TEXT_PL; int TEXT_BL; @@ -467,6 +468,7 @@ void maketext40(int text_renewal) { tramflag.gaiji = 0; } + multiple = ((!(gdc.mode1 & 8)) && (!(gdc.crt15khz & 1)))?0x20:0x00; TEXT_LR = gdc.m.para[GDC_CSRFORM] & 0x1f; TEXT_PL = crtc.reg.pl; TEXT_BL = crtc.reg.bl + 1; @@ -546,7 +548,7 @@ void maketext40(int text_renewal) { edi = esi; gaiji1st = 0; kanji2nd = 0; - lastbitp = 0; // ver0.28 + lastbitp = 0; for (x=0; x<(TEXTXMAX/2); x++) { // width40 if (edi == csrw) { cur_line = x; @@ -559,9 +561,9 @@ void maketext40(int text_renewal) { } if (kanji2nd) { kanji2nd = FALSE; - bitmap[x] = lastbitp + 0x800; // ver0.28 + bitmap[x] = lastbitp + 0x800; curx[x-1] |= 0x80; - curx[x] |= curx[x-1] & 0x20; // ver0.28 + curx[x] |= curx[x-1] & 0x20; } else if (!(mem[0xa0001 + edi*2] & gdc.bitac)) { gaiji1st = 0; @@ -574,10 +576,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; } } } @@ -586,7 +588,7 @@ void maketext40(int text_renewal) { kc = LOADINTELWORD(mem + 0xa0000 + edi*2); bitmap[x] = (kc & 0x7f7f) << 4; kc &= 0x7e; - if (kc == 0x56) { // ver0.28 + if (kc == 0x56) { tramflag.gaiji = 1; if ((gaiji1st) && (bitmap[x] == (lastbitp & (~15)))) { @@ -601,13 +603,12 @@ void maketext40(int text_renewal) { kanji2nd = TRUE; } } - // ver0.28 if ((curx[x] & TXTATR_BG) && (gdc.mode1 & 1)) { curx[x] |= 0x20; bitmap[x] += 8; } else if (!(gdc.mode1 & 8)) { - curx[x] |= 0x20; + curx[x] |= multiple; } } lastbitp = bitmap[x]; @@ -642,13 +643,13 @@ void maketext40(int text_renewal) { if ((nowline >= (gdc.m.para[GDC_CSRFORM+1] & 0x1f)) && (nowline <= (gdc.m.para[GDC_CSRFORM+2] >> 3))) { color[cur_line] |= 256; - if (curx[cur_line] & 0x80) { // ver0.28 + if (curx[cur_line] & 0x80) { color[cur_line+1] |= 256; } } else { color[cur_line] &= ~(256); - if (curx[cur_line] & 0x80) { // ver0.28 + if (curx[cur_line] & 0x80) { color[cur_line+1] &= ~(256); } } @@ -658,11 +659,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] + @@ -712,7 +713,6 @@ void maketext40(int text_renewal) { } q += 12; } - // virtical line ver0.27 if ((line_effect & TXTATR_VL) && (!(gdc.mode1 & 1))) { // width40 q -= TEXTXMAX * 8;