Split console into two pages

This commit is contained in:
josh committed 2023-10-21 20:15:11 -04:00
1 parent 8638840cd8
commit f7dde241ad
2 files changed
+84 -34

No files matched your search

+28
View File
@@ -199,6 +199,34 @@ struct Fb
(m_stride * height));
}
/**
* Copy a rectangle in the framebuffer.
*
* @param sx X coordinate of left of source rectangle.
* @param sy Y coordinate of top of source rectangle.
* @param width Width of rectangle to copy.
* @param height Height of rectangle to copy.
* @param dx X coordinate of left of destination rectangle.
* @param dy Y coordinate of top of destination rectangle.
*/
static void copy_rect(size_t sx, size_t sy, size_t width, size_t height,
size_t dx, size_t dy)
{
size_t dest_buffer_index = buffer_index(dx, dy);
size_t src_buffer_index = buffer_index(sx, sy);
for (size_t y = 0u; y < height; y++)
{
memcpy32(&m_buffer1[dest_buffer_index],
&m_buffer1[src_buffer_index],
width);
memcpy32(&m_device_buffer[dest_buffer_index],
&m_buffer1[dest_buffer_index],
width);
dest_buffer_index += m_stride;
src_buffer_index += m_stride;
}
}
/**
* Return the buffer index for the given X and Y coordinates.
*