summaryrefslogtreecommitdiff
path: root/source/textmode.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/textmode.c')
-rw-r--r--source/textmode.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source/textmode.c b/source/textmode.c
index aa6de44..0de43f6 100644
--- a/source/textmode.c
+++ b/source/textmode.c
@@ -54,15 +54,26 @@ static inline void Plot_Text(int x, int y, int c)
static inline void Plot_RS(int x, int y, int c)
{
- int xw;
- int yw;
+ uint16 ch;
+ int odd;
+ uint16 *off;
- xw = x/32;
- yw = y/32;
- x %= 32;
- y %= 32;
+ odd = x&1;
- *(text + x + y*32 + (xw+yw) * 1024) = c;
+ off = text + x/2 + y*mapw/2;
+
+ ch = *off;
+
+ if (odd)
+ {
+ ch = (c<<8) | (ch&0xff);
+ }
+ else
+ {
+ ch = c | (ch&0xff00);
+ }
+
+ *off = ch;
}
@@ -97,7 +108,7 @@ void TM_Init(uint16 *vram, int map_width, int map_height, int map_is_rotation)
is_rot = map_is_rotation;
- draw_string = map_is_rotation ? Text_Put : RS_Put;
+ draw_string = map_is_rotation ? RS_Put : Text_Put;
TM_Cls();
}