aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/de/mud/terminal/VDUBuffer.java8
-rw-r--r--src/de/mud/terminal/vt320.java16
-rw-r--r--src/org/connectbot/service/TerminalBridge.java4
3 files changed, 14 insertions, 14 deletions
diff --git a/src/de/mud/terminal/VDUBuffer.java b/src/de/mud/terminal/VDUBuffer.java
index 445d9f9..cc6869c 100644
--- a/src/de/mud/terminal/VDUBuffer.java
+++ b/src/de/mud/terminal/VDUBuffer.java
@@ -81,13 +81,13 @@ public class VDUBuffer {
/** how much to left shift the foreground color */
public final static int COLOR_FG_SHIFT = 5;
/** how much to left shift the background color */
- public final static int COLOR_BG_SHIFT = 13;
+ public final static int COLOR_BG_SHIFT = 14;
/** color mask */
- public final static int COLOR = 0x1fffe0;
+ public final static int COLOR = 0x7fffe0; /* 0000 0000 0111 1111 1111 1111 1110 0000 */
/** foreground color mask */
- public final static int COLOR_FG = 0x1fe0;
+ public final static int COLOR_FG = 0x3fe0; /* 0000 0000 0000 0000 0011 1111 1110 0000 */
/** background color mask */
- public final static int COLOR_BG = 0x1fe000;
+ public final static int COLOR_BG = 0x7fc000; /* 0000 0000 0111 1111 1100 0000 0000 0000 */
/**
* Create a new video display buffer with the passed width and height in
diff --git a/src/de/mud/terminal/vt320.java b/src/de/mud/terminal/vt320.java
index 3e1b7cc..9cdabf8 100644
--- a/src/de/mud/terminal/vt320.java
+++ b/src/de/mud/terminal/vt320.java
@@ -2695,13 +2695,13 @@ public abstract class vt320 extends VDUBuffer implements VDUInput {
case 36:
case 37:
attributes &= ~COLOR_FG;
- attributes |= (DCEvars[i] - 30) << COLOR_FG_SHIFT;
+ attributes |= ((DCEvars[i] - 30) + 1)<< COLOR_FG_SHIFT;
break;
case 38:
if (DCEvars[i+1] == 5) {
attributes &= ~COLOR_FG;
- attributes |= ((DCEvars[i+2]) & 0xff) << COLOR_FG_SHIFT;
- i+=2;
+ attributes |= ((DCEvars[i + 2]) + 1) << COLOR_FG_SHIFT;
+ i += 2;
}
break;
case 39:
@@ -2716,13 +2716,13 @@ public abstract class vt320 extends VDUBuffer implements VDUInput {
case 46:
case 47:
attributes &= ~COLOR_BG;
- attributes |= (DCEvars[i] - 40) << COLOR_BG_SHIFT;
+ attributes |= ((DCEvars[i] - 40) + 1) << COLOR_BG_SHIFT;
break;
case 48:
if (DCEvars[i+1] == 5) {
attributes &= ~COLOR_BG;
- attributes |= (DCEvars[i+2]) << COLOR_BG_SHIFT;
- i+=2;
+ attributes |= (DCEvars[i + 2] + 1) << COLOR_BG_SHIFT;
+ i += 2;
}
break;
case 49:
@@ -2737,7 +2737,7 @@ public abstract class vt320 extends VDUBuffer implements VDUInput {
case 96:
case 97:
attributes &= ~COLOR_FG;
- attributes |= (DCEvars[i] - 82) << COLOR_FG_SHIFT;
+ attributes |= ((DCEvars[i] - 82) + 1) << COLOR_FG_SHIFT;
break;
case 100:
case 101:
@@ -2748,7 +2748,7 @@ public abstract class vt320 extends VDUBuffer implements VDUInput {
case 106:
case 107:
attributes &= ~COLOR_BG;
- attributes |= (DCEvars[i] - 92) << COLOR_BG_SHIFT;
+ attributes |= ((DCEvars[i] - 92) + 1) << COLOR_BG_SHIFT;
break;
default:
diff --git a/src/org/connectbot/service/TerminalBridge.java b/src/org/connectbot/service/TerminalBridge.java
index 2e46628..8d57edb 100644
--- a/src/org/connectbot/service/TerminalBridge.java
+++ b/src/org/connectbot/service/TerminalBridge.java
@@ -1011,11 +1011,11 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal
// check if foreground color attribute is set
if ((currAttr & VDUBuffer.COLOR_FG) != 0)
- fg = color[(currAttr & VDUBuffer.COLOR_FG) >> VDUBuffer.COLOR_FG_SHIFT];
+ fg = color[((currAttr & VDUBuffer.COLOR_FG) >> VDUBuffer.COLOR_FG_SHIFT) - 1];
// check if background color attribute is set
if ((currAttr & VDUBuffer.COLOR_BG) != 0)
- bg = color[(currAttr & VDUBuffer.COLOR_BG) >> VDUBuffer.COLOR_BG_SHIFT];
+ bg = color[((currAttr & VDUBuffer.COLOR_BG) >> VDUBuffer.COLOR_BG_SHIFT) - 1];
// support character inversion by swapping background and foreground color
if ((currAttr & VDUBuffer.INVERT) != 0) {