diff options
Diffstat (limited to 'uisimulator/lcd-recorder.c')
-rw-r--r-- | uisimulator/lcd-recorder.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/uisimulator/lcd-recorder.c b/uisimulator/lcd-recorder.c index 37f4d3b142..f7623937c5 100644 --- a/uisimulator/lcd-recorder.c +++ b/uisimulator/lcd-recorder.c | |||
@@ -79,6 +79,7 @@ void lcd_update (void) | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | #if 0 | ||
82 | /* | 83 | /* |
83 | * Display a string at current position | 84 | * Display a string at current position |
84 | */ | 85 | */ |
@@ -107,42 +108,8 @@ void lcd_string (const char *text, BOOL invert) | |||
107 | } | 108 | } |
108 | } | 109 | } |
109 | } | 110 | } |
111 | #endif | ||
110 | 112 | ||
111 | /* | ||
112 | * Display a character. | ||
113 | * This writes a 5x8 character within a 6x8 cell. | ||
114 | * The cell does not have to be aligned to a display byte. | ||
115 | * The top left of the cell is displayed at the current position. | ||
116 | * invert is TRUE to display in reverse video. | ||
117 | */ | ||
118 | void lcd_char (int ch, BOOL invert) | ||
119 | { | ||
120 | uchar (*dp)[DISP_X] = (void *) &display[lcd_y/8][lcd_x]; | ||
121 | uint32 shift, mask, col; | ||
122 | |||
123 | /* Limit to char generation table */ | ||
124 | if (ch < ASCII_MIN || ch > ASCII_MAX) | ||
125 | ch = ASCII_MAX; | ||
126 | |||
127 | /* Calculate shift and masks for cell bit position */ | ||
128 | shift = (lcd_y & 0x7); | ||
129 | mask = ~(COL_MASK << shift); | ||
130 | if (invert) | ||
131 | invert = ~mask; | ||
132 | |||
133 | /* Write each char column */ | ||
134 | for (col = 0; col < CHAR_X-1; col++) { | ||
135 | uint32 data = (char_gen[ch-ASCII_MIN][col] << shift) ^ invert; | ||
136 | dp[0][col] = (dp[0][col] & mask) | data; | ||
137 | if (lcd_y < DISP_Y-8) | ||
138 | dp[1][col] = (dp[1][col] & (mask >> 8)) | (data >> 8); | ||
139 | } | ||
140 | |||
141 | /* Column after char */ | ||
142 | dp[0][CHAR_X-1] = (dp[0][CHAR_X-1] & mask) | invert; | ||
143 | if (lcd_y < DISP_Y-8) | ||
144 | dp[1][CHAR_X-1] = (dp[1][CHAR_X-1] & (mask >> 8)) | (invert >> 8); | ||
145 | } | ||
146 | 113 | ||
147 | /* | 114 | /* |
148 | * Write a byte to LCD controller. | 115 | * Write a byte to LCD controller. |