From 97fb74f7612cc06090e065575b756e19dce5d5d9 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 12 Dec 2008 18:51:14 +0000 Subject: Add extra bit for default color support --- src/de/mud/terminal/VDUBuffer.java | 8 ++++---- src/de/mud/terminal/vt320.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/de/mud/terminal') 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: -- cgit v1.2.3