}
// See load_bg_bottom for an explanation on the magic value.
- dim_factor_top = (max - 178);
-
- if (dim_factor_top < 0)
- dim_factor_top = 0;
+ dim_factor_top = 0;
+ if (max > 178)
+ dim_factor_top = max - 178;
}
void load_bg_bottom(char* fname_bottom) {
// The minimum transparency with pure black overlay (I find) is 70% to be readable.
// 70% of 255 is approximately 178, and 255 - 178 is 77. That's therefore the maximum we want to subtract.
// Thus this is the value for 70% transparency.
- dim_factor_bottom = (max - 178);
-
- if (dim_factor_bottom < 0)
- dim_factor_bottom = 0;
+ dim_factor_bottom = 0;
+ if (max > 178)
+ dim_factor_bottom = max - 178;
}
void set_font(const char* filename) {
unsigned char char_dat = ((char*)FCRAM_FONT_LOC)[(character - ' ') * (c_font_w * font_h) + yy];
for(unsigned int i=0; i < font_w + font_kern; i++) {
if (color_bg == 0) {
- screen[pos] = buffer_bg[pos];
- screen[pos + 1] = buffer_bg[pos + 1];
- screen[pos + 2] = buffer_bg[pos + 2];
+ screen[pos] = 0;
+ screen[pos + 1] = 0;
+ screen[pos + 2] = 0;
if (buffer_bg[pos] >= dim_factor)
screen[pos] = buffer_bg[pos] - dim_factor;
if (buffer_bg[pos + 1] >= dim_factor)
if (char_dat & 0x80) {
if (color_fg == 0) {
- screen[pos] = buffer_bg[pos];
- screen[pos + 1] = buffer_bg[pos + 1];
- screen[pos + 2] = buffer_bg[pos + 2];
+ screen[pos] = 0;
+ screen[pos + 1] = 0;
+ screen[pos + 2] = 0;
if (buffer_bg[pos] >= dim_factor)
screen[pos] = buffer_bg[pos] - dim_factor;
if (buffer_bg[pos + 1] >= dim_factor)