Subversion Repositories freemyipod

Rev

Rev 421 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 421 Rev 515
Line 86... Line 86...
86
void lcdconsole_puts_noblit(const char* string, int fgcolor, int bgcolor)
86
void lcdconsole_puts_noblit(const char* string, int fgcolor, int bgcolor)
87
{
87
{
88
    while (*string) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
88
    while (*string) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
89
}
89
}
90
 
90
 
91
void lcdconsole_write_noblit(const char* string, size_t length, int fgcolor, int bgcolor)
-
 
92
{
-
 
93
    while (length--) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
-
 
94
}
-
 
95
 
-
 
96
void lcdconsole_update()
91
void lcdconsole_update()
97
{
92
{
98
    uint32_t mode = enter_critical_section();
93
    uint32_t mode = enter_critical_section();
99
    if (displaylcd_busy())
94
    if (displaylcd_busy())
100
    {
95
    {
Line 108... Line 103...
108
               (LCD_HEIGHT - FRAMEBUF_HEIGHT) / 2,
103
               (LCD_HEIGHT - FRAMEBUF_HEIGHT) / 2,
109
               (LCD_HEIGHT - FRAMEBUF_HEIGHT) / 2 + FRAMEBUF_HEIGHT - 1,
104
               (LCD_HEIGHT - FRAMEBUF_HEIGHT) / 2 + FRAMEBUF_HEIGHT - 1,
110
               framebuf, 0);
105
               framebuf, 0);
111
}
106
}
112
 
107
 
113
void lcdconsole_putc(char string, int fgcolor, int bgcolor)
-
 
114
{
-
 
115
    lcdconsole_putc_noblit(string, fgcolor, bgcolor);
-
 
116
    lcdconsole_update();
-
 
117
}
-
 
118
    
-
 
119
void lcdconsole_puts(const char* string, int fgcolor, int bgcolor)
108
void lcdconsole_puts(const char* string, int fgcolor, int bgcolor)
120
{
109
{
121
    while (*string) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
110
    while (*string) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
122
    lcdconsole_update();
111
    lcdconsole_update();
123
}
112
}
124
 
113
 
125
void lcdconsole_write(const char* string, size_t length, int fgcolor, int bgcolor)
-
 
126
{
-
 
127
    while (length--) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
-
 
128
    lcdconsole_update();
-
 
129
}
-
 
130
 
-
 
131
void lcdconsole_callback()
114
void lcdconsole_callback()
132
{
115
{
133
    if (lcdconsole_needs_update)
116
    if (lcdconsole_needs_update)
134
    {
117
    {
135
        displaylcd((LCD_WIDTH - FRAMEBUF_WIDTH) / 2,
118
        displaylcd((LCD_WIDTH - FRAMEBUF_WIDTH) / 2,
Line 138... Line 121...
138
                   (LCD_HEIGHT - FRAMEBUF_HEIGHT) / 2 + FRAMEBUF_HEIGHT - 1,
121
                   (LCD_HEIGHT - FRAMEBUF_HEIGHT) / 2 + FRAMEBUF_HEIGHT - 1,
139
                   framebuf, 0);
122
                   framebuf, 0);
140
        lcdconsole_needs_update = false;
123
        lcdconsole_needs_update = false;
141
    }
124
    }
142
}
125
}
143
 
-
 
144
int lcdconsole_get_current_x()
-
 
145
{
-
 
146
    return (current_col + 1) * FONT_WIDTH + OFFSETX;
-
 
147
}
-
 
148
 
-
 
149
int lcdconsole_get_current_y()
-
 
150
{
-
 
151
    return current_row * FONT_HEIGHT + OFFSETY;
-
 
152
}
-
 
153
 
-
 
154
int lcdconsole_get_lineend_x()
-
 
155
{
-
 
156
    return LCDCONSOLE_COLS * FONT_WIDTH + OFFSETX - 1;
-
 
157
}
-
 
158
 
-
 
159
int lcdconsole_get_lineend_y()
-
 
160
{
-
 
161
    return (current_row + 1) * FONT_HEIGHT + OFFSETY - 1;
-
 
162
}
-