aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/mud
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2008-12-12 18:51:14 +0000
committerKenny Root <kenny@the-b.org>2008-12-12 18:51:14 +0000
commit97fb74f7612cc06090e065575b756e19dce5d5d9 (patch)
tree19671a82162f3c497136fd971a62f6bd1e0c5703 /src/de/mud
parent5d8c2880c73c8d4dada456b43f34f8982992143e (diff)
downloadconnectbot-97fb74f7612cc06090e065575b756e19dce5d5d9.tar.gz
connectbot-97fb74f7612cc06090e065575b756e19dce5d5d9.tar.bz2
connectbot-97fb74f7612cc06090e065575b756e19dce5d5d9.zip
Add extra bit for default color support
Diffstat (limited to 'src/de/mud')
-rw-r--r--src/de/mud/terminal/VDUBuffer.java8
-rw-r--r--src/de/mud/terminal/vt320.java16
2 files changed, 12 insertions, 12 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: