diff options
Diffstat (limited to 'uisimulator/win32/lcd-win32.c')
-rw-r--r-- | uisimulator/win32/lcd-win32.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/uisimulator/win32/lcd-win32.c b/uisimulator/win32/lcd-win32.c new file mode 100644 index 0000000000..4539696cef --- /dev/null +++ b/uisimulator/win32/lcd-win32.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Felix Arends | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include <windows.h> | ||
21 | #include <process.h> | ||
22 | #include "uisw32.h" | ||
23 | #include "lcd.h" | ||
24 | |||
25 | // | ||
26 | // simulator specific code | ||
27 | // | ||
28 | |||
29 | // varaibles | ||
30 | unsigned char display[LCD_WIDTH][LCD_HEIGHT/8]; // the display | ||
31 | char bitmap[LCD_WIDTH][LCD_HEIGHT]; // the ui display | ||
32 | |||
33 | BITMAPINFO2 bmi = | ||
34 | { | ||
35 | sizeof (BITMAPINFOHEADER), | ||
36 | LCD_WIDTH, -LCD_HEIGHT, 1, 8, | ||
37 | BI_RGB, 0, 0, 0, 2, 2, | ||
38 | UI_LCD_COLOR, 0, // green background color | ||
39 | UI_LCD_BLACK, 0 // black color | ||
40 | }; // bitmap information | ||
41 | |||
42 | |||
43 | // lcd_init | ||
44 | // init lcd controler | ||
45 | void lcd_init() | ||
46 | { | ||
47 | lcd_clear_display (); | ||
48 | } | ||
49 | |||
50 | // lcd_update | ||
51 | // update lcd | ||
52 | void lcd_update() | ||
53 | { | ||
54 | int x, y; | ||
55 | if (hGUIWnd == NULL) | ||
56 | _endthread (); | ||
57 | |||
58 | for (x = 0; x < LCD_WIDTH; x++) | ||
59 | for (y = 0; y < LCD_HEIGHT; y++) | ||
60 | bitmap[y][x] = ((display[x][y/8] >> (y & 7)) & 1); | ||
61 | |||
62 | InvalidateRect (hGUIWnd, NULL, FALSE); | ||
63 | |||
64 | // natural sleep :) | ||
65 | Sleep (50); | ||
66 | } \ No newline at end of file | ||