Skip to content
Snippets Groups Projects
Commit 91465682 authored by deuce's avatar deuce
Browse files

Allow separate control over translating attributes and characters.

parent 1511fa99
No related branches found
No related tags found
No related merge requests found
......@@ -1322,12 +1322,20 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_puttext(int a,int b,int c,int d,void *e)
}
else {
for (i=0; i<(c-a+1)*(d-b+1)*2; i+=2) {
if (((char *)e)[i] > 31 && ((char *)e)[i] < 127 && conio_fontdata[font].put_xlat != NULL)
buf[i] = conio_fontdata[font].put_xlat[((char *)e)[i]-32];
if (ciolib_xlat & CIOLIB_XLAT_CHARS) {
if (((char *)e)[i] > 31 && ((char *)e)[i] < 127 && conio_fontdata[font].put_xlat != NULL)
buf[i] = conio_fontdata[font].put_xlat[((char *)e)[i]-32];
else
buf[i] = ((char *)e)[i];
}
else
buf[i] = ((char *)e)[i];
if (cio_textinfo.currmode == C64_40X25)
buf[i+1]=c64_attr_xlat(((char *)e)[i+1]);
if (ciolib_xlat & CIOLIB_XLAT_ATTR) {
if (cio_textinfo.currmode == C64_40X25)
buf[i+1]=c64_attr_xlat(((char *)e)[i+1]);
else
buf[i+1]=((char *)e)[i+1];
}
else
buf[i+1]=((char *)e)[i+1];
}
......@@ -1359,14 +1367,18 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e)
if (font >= 0) {
if (conio_fontdata[font].put_xlat || cio_textinfo.currmode == C64_40X25) {
for (i=0; i<(c-a+1)*(d-b+1)*2; i+=2) {
if (conio_fontdata[font].put_xlat) {
xlat = ((char *)e)[i];
if ((ch = memchr(conio_fontdata[font].put_xlat, ((char *)e)[i], 128))!=NULL)
xlat = (char)(ch-conio_fontdata[font].put_xlat)+32;
((char *)e)[i] = xlat;
if (ciolib_xlat & CIOLIB_XLAT_CHARS) {
if (conio_fontdata[font].put_xlat) {
xlat = ((char *)e)[i];
if ((ch = memchr(conio_fontdata[font].put_xlat, ((char *)e)[i], 128))!=NULL)
xlat = (char)(ch-conio_fontdata[font].put_xlat)+32;
((char *)e)[i] = xlat;
}
}
if (cio_textinfo.currmode == C64_40X25) {
((char *)e)[i+1] = c64_attr_rev(((char *)e)[i+1]);;
if (ciolib_xlat & CIOLIB_XLAT_ATTR) {
if (cio_textinfo.currmode == C64_40X25) {
((char *)e)[i+1] = c64_attr_rev(((char *)e)[i+1]);;
}
}
}
}
......
......@@ -368,6 +368,11 @@ CIOLIBEXPORTVAR int directvideo;
CIOLIBEXPORTVAR int hold_update;
CIOLIBEXPORTVAR int puttext_can_move;
CIOLIBEXPORTVAR int ciolib_xlat;
#define CIOLIB_XLAT_NONE 0
#define CIOLIB_XLAT_CHARS 1
#define CIOLIB_XLAT_ATTR 2
#define CIOLIB_XLAT_ALL (CIOLIB_XLAT_CHARS | CIOLIB_XLAT_ATTR)
CIOLIBEXPORTVAR int ciolib_reaper;
#define _conio_kbhit() kbhit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment