diff options
author | Ian C <ianc@noddybox.co.uk> | 2007-03-02 23:18:38 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2007-03-02 23:18:38 +0000 |
commit | eeef0966f0448d71e79ad43d53769afebd47b459 (patch) | |
tree | 542dcd6a3e8112a81ec550c819ced78fb42552f4 /source/textmode.c | |
parent | 6be2806499299bb13edde3481803f28416429902 (diff) |
Added support for text rotation modes to textmode interface
Diffstat (limited to 'source/textmode.c')
-rw-r--r-- | source/textmode.c | 27 |
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(); } |