And another one

This commit is contained in:
twinaphex 2014-12-12 01:05:32 +01:00
parent 5bcda4e05e
commit 76b4e3f2df
1 changed files with 126 additions and 2 deletions

128
video.c
View File

@ -1333,7 +1333,69 @@ static void render_scanline_text_base_color16(u32 layer,
*/ */
/* Render a single scanline of text tiles */ /* Render a single scanline of text tiles */
tile_render(8bpp, base, color16); u32 vertical_pixel_offset = (vertical_offset % 8) *
tile_width_8bpp;
u32 vertical_pixel_flip =
((tile_size_8bpp - tile_width_8bpp) -
vertical_pixel_offset) - vertical_pixel_offset;
tile_extra_variables_8bpp();
u8 *tile_base = vram + (((bg_control >> 2) & 0x03) * (1024 * 16)) +
vertical_pixel_offset;
u32 pixel_run = 256 - (horizontal_offset % 256);
u32 current_tile;
map_base += ((vertical_offset % 256) / 8) * 32;
partial_tile_offset = (horizontal_offset % 8);
if(pixel_run >= end)
{
if(partial_tile_offset)
{
partial_tile_run = 8 - partial_tile_offset;
if(end < partial_tile_run)
{
partial_tile_run = end;
partial_tile_mid_map(base, 8bpp, color16);
return;
}
else
{
end -= partial_tile_run;
partial_tile_right_map(base, 8bpp, color16);
}
}
tile_run = end / 8;
multiple_tile_map(base, 8bpp, color16);
partial_tile_run = end % 8;
if(partial_tile_run)
{
partial_tile_left_map(base, 8bpp, color16);
}
}
else
{
if(partial_tile_offset)
{
partial_tile_run = 8 - partial_tile_offset;
partial_tile_right_map(base, 8bpp, color16);
}
tile_run = (pixel_run - partial_tile_run) / 8;
multiple_tile_map(base, 8bpp, color16);
map_ptr = second_ptr;
end -= pixel_run;
tile_run = end / 8;
multiple_tile_map(base, 8bpp, color16);
partial_tile_run = end % 8;
if(partial_tile_run)
{
partial_tile_left_map(base, 8bpp, color16);
}
}
} }
else else
{ {
@ -1343,7 +1405,69 @@ static void render_scanline_text_base_color16(u32 layer,
*/ */
/* Render a single scanline of text tiles */ /* Render a single scanline of text tiles */
tile_render(4bpp, base, color16); u32 vertical_pixel_offset = (vertical_offset % 8) *
tile_width_4bpp;
u32 vertical_pixel_flip =
((tile_size_4bpp - tile_width_4bpp) -
vertical_pixel_offset) - vertical_pixel_offset;
tile_extra_variables_4bpp();
u8 *tile_base = vram + (((bg_control >> 2) & 0x03) * (1024 * 16)) +
vertical_pixel_offset;
u32 pixel_run = 256 - (horizontal_offset % 256);
u32 current_tile;
map_base += ((vertical_offset % 256) / 8) * 32;
partial_tile_offset = (horizontal_offset % 8);
if(pixel_run >= end)
{
if(partial_tile_offset)
{
partial_tile_run = 8 - partial_tile_offset;
if(end < partial_tile_run)
{
partial_tile_run = end;
partial_tile_mid_map(base, 4bpp, color16);
return;
}
else
{
end -= partial_tile_run;
partial_tile_right_map(base, 4bpp, color16);
}
}
tile_run = end / 8;
multiple_tile_map(base, 4bpp, color16);
partial_tile_run = end % 8;
if(partial_tile_run)
{
partial_tile_left_map(base, 4bpp, color16);
}
}
else
{
if(partial_tile_offset)
{
partial_tile_run = 8 - partial_tile_offset;
partial_tile_right_map(base, 4bpp, color16);
}
tile_run = (pixel_run - partial_tile_run) / 8;
multiple_tile_map(base, 4bpp, color16);
map_ptr = second_ptr;
end -= pixel_run;
tile_run = end / 8;
multiple_tile_map(base, 4bpp, color16);
partial_tile_run = end % 8;
if(partial_tile_run)
{
partial_tile_left_map(base, 4bpp, color16);
}
}
} }
} }