* Term->user_hook = Perform user actions
* Term->xtra_hook = Perform extra actions
* Term->curs_hook = Draw (or Move) the cursor
+ * Term->bigcurs_hook = Draw (or Move) the big cursor (bigtile mode)
* Term->wipe_hook = Draw some blank spaces
* Term->text_hook = Draw some text in the window
* Term->pict_hook = Draw some attr/chars in the window
if (x < Term->x1[y]) Term->x1[y] = x;
if (x > Term->x2[y]) Term->x2[y] = x;
- if (scrn->a[y][x] == 255)
+ if ((scrn->a[y][x] & 0xf0) == 0xf0)
if ((x - 1) < Term->x1[y]) Term->x1[y]--;
}
/* Hack -- Ignore non-changes */
if ((*scr_aa == *a) && (*scr_cc == *c) &&
- (*scr_taa == *ta) && (*scr_tcc == *tc))
+ (*scr_taa == *ta) && (*scr_tcc == *tc))
{
x++;
a++;
byte *scr_aa = Term->scr->a[y];
#ifdef JP
- unsigned char *scr_cc = (unsigned char *)Term->scr->c[y];
+ char *scr_cc = Term->scr->c[y];
#ifdef USE_TRANSPARENCY
byte *scr_taa = Term->scr->ta[y];
- unsigned char *scr_tcc = Term->scr->tc[y];
+ char *scr_tcc = Term->scr->tc[y];
#endif /* USE_TRANSPARENCY */
#else
#ifdef JP
- /* ɽ¼¨Ê¸»ú¤Ê¤· */
- if (n == 0 || *s == 0) return;
- /*
- * Á´³Ñʸ»ú¤Î±¦È¾Ê¬¤«¤éʸ»ú¤òɽ¼¨¤¹¤ë¾ì¹ç¡¢
- * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Îº¸Éôʬ¤ò¾Ãµî¡£
- * ɽ¼¨³«»Ï°ÌÃÖ¤¬º¸Ã¼¤Ç¤Ê¤¤¤È²¾Äê¡£
- */
- if ((scr_aa[x] & KANJI2) && !(scr_aa[x] & 0x80))
- {
- plog_fmt("scr_aa[%d]=%d\n",x,scr_aa[x]);
- scr_cc[x - 1] = ' ';
- scr_aa[x - 1] &= KANJIC;
- x1 = x2 = x - 1;
- }
+ /* ɽ¼¨Ê¸»ú¤Ê¤· */
+ if (n == 0 || *s == 0) return;
+ /*
+ * Á´³Ñʸ»ú¤Î±¦È¾Ê¬¤«¤éʸ»ú¤òɽ¼¨¤¹¤ë¾ì¹ç¡¢
+ * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Îº¸Éôʬ¤ò¾Ãµî¡£
+ * ɽ¼¨³«»Ï°ÌÃÖ¤¬º¸Ã¼¤Ç¤Ê¤¤¤È²¾Äê¡£
+ */
+ if ((scr_aa[x] & KANJI2) && !(scr_aa[x] & 0x80))
+ {
+ scr_cc[x - 1] = ' ';
+ scr_aa[x - 1] &= KANJIC;
+ x1 = x2 = x - 1;
+ }
#endif
/* Queue the attr/chars */
for ( ; n; x++, s++, n--)
/* Æüìʸ»ú¤È¤·¤ÆMSB¤¬Î©¤Ã¤Æ¤¤¤ë²ÄǽÀ¤¬¤¢¤ë */
/* ¤½¤Î¾ì¹çattr¤ÎMSB¤âΩ¤Ã¤Æ¤¤¤ë¤Î¤Ç¤³¤ì¤Ç¼±Ê̤¹¤ë */
/* check */
- if (iskanji(*s) && !(a & 0x80))
+ if (!(a & 0x80) && iskanji(*s))
{
- int nc1 = *s++;
- int nc2 = *s;
+ char nc1 = *s++;
+ char nc2 = *s;
- int na1 = (a | KANJI1);
- int na2 = (a | KANJI2);
+ byte na1 = (a | KANJI1);
+ byte na2 = (a | KANJI2);
if((--n == 0) || !nc2) break;
#ifdef USE_TRANSPARENCY
else
{
#endif
- int oa = scr_aa[x];
- int oc = scr_cc[x];
+ byte oa = scr_aa[x];
+ char oc = scr_cc[x];
#ifdef USE_TRANSPARENCY
- int ota = scr_taa[x];
- int otc = scr_tcc[x];
+ byte ota = scr_taa[x];
+ char otc = scr_tcc[x];
/* Hack -- Ignore non-changes */
if ((oa == a) && (oc == *s) && (ota == 0) && (otc == 0)) continue;
if (x != w && !(scr_aa[x] & 0x80) && (scr_aa[x] & KANJI2))
{
scr_cc[x] = ' ';
- scr_aa[x] &= KANJIC;
+ scr_aa[x] &= KANJIC;
if (x1 < 0) x1 = x;
x2 = x;
}
#ifdef JP
if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc)
&&(!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
- scr_cc[x + 1] == old_cc[x + 1] &&
- scr_taa[x + 1] == old_taa[x + 1] &&
- scr_tcc[x + 1] == old_tcc[x + 1])))
+ scr_cc[x + 1] == old_cc[x + 1] &&
+ scr_taa[x + 1] == old_taa[x + 1] &&
+ scr_tcc[x + 1] == old_tcc[x + 1])))
#else
if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc))
#endif
#ifdef JP
if ((na == oa) && (nc == oc) &&
(!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
- scr_cc[x + 1] == old_cc[x + 1])))
+ scr_cc[x + 1] == old_cc[x + 1])))
#else
if ((na == oa) && (nc == oc))
#endif
#ifdef JP
if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc)&&
(!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
- scr_cc[x + 1] == old_cc[x + 1] &&
- scr_taa[x + 1] == old_taa[x + 1] &&
- scr_tcc[x + 1] == old_tcc[x + 1])))
+ scr_cc[x + 1] == old_cc[x + 1] &&
+ scr_taa[x + 1] == old_taa[x + 1] &&
+ scr_tcc[x + 1] == old_tcc[x + 1])))
#else
if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc))
#endif
#ifdef JP
if ((na == oa) && (nc == oc) &&
(!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
- scr_cc[x + 1] == old_cc[x + 1])))
+ scr_cc[x + 1] == old_cc[x + 1])))
#else
if ((na == oa) && (nc == oc))
#endif
#endif /* USE_TRANSPARENCY */
/* 2nd byte of bigtile */
- if (na == 255) continue;
+ if ((na & 0xf0) == 0xf0) continue;
/* Handle high-bit attr/chars */
if ((na & 0x80) && (nc & 0x80))
#ifdef JP
if ((na == oa) && (nc == oc) &&
(!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
- scr_cc[x + 1] == old_cc[x + 1])))
+ scr_cc[x + 1] == old_cc[x + 1])))
#else
if ((na == oa) && (nc == oc))
#endif
/* Paranoia -- use "fake" hooks to prevent core dumps */
if (!Term->curs_hook) Term->curs_hook = Term_curs_hack;
+ if (!Term->bigcurs_hook) Term->bigcurs_hook = Term->curs_hook;
if (!Term->wipe_hook) Term->wipe_hook = Term_wipe_hack;
if (!Term->text_hook) Term->text_hook = Term_text_hack;
if (!Term->pict_hook) Term->pict_hook = Term_pict_hack;
#ifdef CHUUKEI
send_text_to_chuukei_server(tx, ty, csize, (old_aa[tx] & 0xf), &old_cc[tx]);
#endif
- (void)((*Term->text_hook)(tx, ty, csize, (old_aa[tx] & 0xf), &old_cc[tx]));
+ (void)((*Term->text_hook)(tx, ty, csize, (unsigned char) (old_aa[tx] & 0xf), &old_cc[tx]));
}
/* Hack -- erase the grid */
if (!scr->cu && scr->cv)
{
#ifdef CHUUKEI
- send_curs_to_chuukei_server(scr->cx, scr->cy);
+ send_curs_to_chuukei_server(scr->cx, scr->cy);
#endif
- /* Call the cursor display routine */
- (void)((*Term->curs_hook)(scr->cx, scr->cy));
+
+#ifdef JP
+ if ((scr->cx + 1 < w) &&
+ ((old->a[scr->cy][scr->cx + 1] == 255) ||
+ (!(old->a[scr->cy][scr->cx] & 0x80) &&
+ iskanji(old->c[scr->cy][scr->cx]))))
+#else
+ if ((scr->cx + 1 < w) && (old->a[scr->cy][scr->cx + 1] == 255))
+#endif
+ {
+ /* Double width cursor for the Bigtile mode */
+ (void)((*Term->bigcurs_hook)(scr->cx, scr->cy));
+ }
+ else
+ {
+ /* Call the cursor display routine */
+ (void)((*Term->curs_hook)(scr->cx, scr->cy));
+ }
}
}
#endif /* USE_TRANSPARENCY */
#ifdef JP
- /*
- * Á´³Ñʸ»ú¤Î±¦È¾Ê¬¤«¤éʸ»ú¤òɽ¼¨¤¹¤ë¾ì¹ç¡¢
- * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Îº¸Éôʬ¤ò¾Ãµî¡£
- */
- if (n > 0 && ((scr_aa[x] & KANJI2) && !(scr_aa[x] & 0x80))
- || ((byte)scr_cc[x] == 255 && scr_aa[x] == 255))
+ /*
+ * Á´³Ñʸ»ú¤Î±¦È¾Ê¬¤«¤éʸ»ú¤òɽ¼¨¤¹¤ë¾ì¹ç¡¢
+ * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Îº¸Éôʬ¤ò¾Ãµî¡£
+ */
+ if (n > 0 && (((scr_aa[x] & KANJI2) && !(scr_aa[x] & 0x80))
+ || ((byte)scr_cc[x] == 255 && scr_aa[x] == 255)))
#else
- if (n > 0 && (byte)scr_cc[x] == 255 && scr_aa[x] == 255)
+ if (n > 0 && (byte)scr_cc[x] == 255 && scr_aa[x] == 255)
#endif
- {
- x--;
- n++;
- }
+ {
+ x--;
+ n++;
+ }
/* Scan every column */
for (i = 0; i < n; i++, x++)
if ((oa == na) && (oc == nc)) continue;
#ifdef JP
- /*
- * Á´³Ñʸ»ú¤Îº¸È¾Ê¬¤Çɽ¼¨¤ò½ªÎ»¤¹¤ë¾ì¹ç¡¢
- * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Î±¦Éôʬ¤ò¾Ãµî¡£
+ /*
+ * Á´³Ñʸ»ú¤Îº¸È¾Ê¬¤Çɽ¼¨¤ò½ªÎ»¤¹¤ë¾ì¹ç¡¢
+ * ½Å¤Ê¤Ã¤¿Ê¸»ú¤Î±¦Éôʬ¤ò¾Ãµî¡£
*
* 2001/04/29 -- Habu
* ¹Ô¤Î±¦Ã¼¤Î¾ì¹ç¤Ï¤³¤Î½èÍý¤ò¤·¤Ê¤¤¤è¤¦¤Ë½¤Àµ¡£
- */
- if ((oa & KANJI1) && (i + 1) == n && x != w - 1)
- n++;
+ */
+ if ((oa & KANJI1) && (i + 1) == n && x != w - 1)
+ n++;
#endif
/* Save the "literal" information */
scr_aa[x] = na;