summaryrefslogtreecommitdiff
path: root/uisimulator/common/lcd-playersim.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/common/lcd-playersim.c')
-rw-r--r--uisimulator/common/lcd-playersim.c119
1 files changed, 0 insertions, 119 deletions
diff --git a/uisimulator/common/lcd-playersim.c b/uisimulator/common/lcd-playersim.c
deleted file mode 100644
index 14efded5d4..0000000000
--- a/uisimulator/common/lcd-playersim.c
+++ /dev/null
@@ -1,119 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alan Korr
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "hwcompat.h"
23
24#include "lcd.h"
25#include "lcd-charcell.h"
26#include "kernel.h"
27#include "thread.h"
28#include <string.h>
29#include <stdlib.h>
30#include "debug.h"
31#include "system.h"
32
33#include "font-player.h"
34#include "lcd-playersim.h"
35
36/*** definitions ***/
37
38bool sim_lcd_framebuffer[SIM_LCD_HEIGHT][SIM_LCD_WIDTH];
39
40static int double_height = 1;
41
42void lcd_print_icon(int x, int icon_line, bool enable, char **icon)
43{
44 int row = 0, col = 0; /* shut up gcc */
45 int y = (ICON_HEIGHT+(CHAR_HEIGHT*2+2)*CHAR_PIXEL) * icon_line;
46
47 y += BORDER_MARGIN;
48 x += BORDER_MARGIN;
49
50 for (; icon[row]; row++)
51 {
52 for (col = 0; icon[row][col]; col++)
53 {
54 switch (icon[row][col])
55 {
56 case '*':
57 sim_lcd_framebuffer[y+row][x+col] = enable;
58 break;
59
60 case ' ':
61 sim_lcd_framebuffer[y+row][x+col] = false;
62 break;
63 }
64 }
65 }
66 sim_lcd_update_rect(x, y, col, row);
67 /* icon drawing updates immediately */
68}
69
70void lcd_print_char(int x, int y, unsigned char ch)
71{
72 int xpos = x * CHAR_WIDTH*CHAR_PIXEL;
73 int ypos = y * CHAR_HEIGHT*CHAR_PIXEL + ICON_HEIGHT;
74 int row, col, r, c;
75
76 if (double_height > 1 && y == 1)
77 return; /* only one row available if text is double height */
78
79 for (row = 0; row < 7; row ++)
80 {
81 unsigned fontbitmap = (*font_player)[ch][row];
82 int height = (row == 3) ? 1 : double_height;
83
84 y = ypos + row * CHAR_PIXEL * double_height;
85 for (col = 0; col < 5; col++)
86 {
87 bool fontbit = fontbitmap & (0x10 >> col);
88
89 x = xpos + col * CHAR_PIXEL;
90 for (r = 0; r < height * CHAR_PIXEL; r++)
91 for (c = 0; c < CHAR_PIXEL; c++)
92 sim_lcd_framebuffer[y+r][x+c] = fontbit;
93 }
94 }
95 if (double_height > 1)
96 {
97 y = ypos + 15*CHAR_PIXEL;
98 for (r = 0; r < CHAR_PIXEL; r++)
99 for (c = 0; c < 5*CHAR_PIXEL; c++)
100 sim_lcd_framebuffer[y+r][xpos+c] = false;
101 }
102}
103
104void lcd_double_height(bool on)
105{
106 int newval = (is_new_player() && on) ? 2 : 1;
107
108 if (newval != double_height)
109 {
110 double_height = newval;
111 lcd_update();
112 }
113}
114
115void sim_lcd_define_pattern(int pat, const char *pattern)
116{
117 if (pat < lcd_pattern_count)
118 memcpy((*font_player)[pat], pattern, 7);
119}