From eeef0966f0448d71e79ad43d53769afebd47b459 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 2 Mar 2007 23:18:38 +0000 Subject: Added support for text rotation modes to textmode interface --- source/textmode.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'source/textmode.c') 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(); } -- cgit v1.2.3