Improved VGA scroll performance using memcpy(3).
This commit is contained in:
parent
ebc0b064c3
commit
476ba278da
|
@ -24,9 +24,12 @@
|
||||||
|
|
||||||
#include <sortix/kernel/platform.h>
|
#include <sortix/kernel/platform.h>
|
||||||
#include <sortix/kernel/log.h>
|
#include <sortix/kernel/log.h>
|
||||||
|
#include <libmaxsi/memory.h>
|
||||||
#include "vga.h"
|
#include "vga.h"
|
||||||
#include "vgaterminal.h"
|
#include "vgaterminal.h"
|
||||||
|
|
||||||
|
using namespace Maxsi;
|
||||||
|
|
||||||
namespace Sortix
|
namespace Sortix
|
||||||
{
|
{
|
||||||
namespace VGATerminal
|
namespace VGATerminal
|
||||||
|
@ -102,13 +105,11 @@ namespace Sortix
|
||||||
{
|
{
|
||||||
for ( nat y = 1; y < height; y++ )
|
for ( nat y = 1; y < height; y++ )
|
||||||
{
|
{
|
||||||
for ( nat x = 0; x < width; x++ )
|
size_t linesize = width * sizeof(uint16_t);
|
||||||
{
|
size_t fromoff = (y-0) * width;
|
||||||
unsigned oldindex = y * width + x;
|
size_t destoff = (y-1) * width;
|
||||||
unsigned newindex = (y-1) * width + x;
|
Memory::Copy(vga + destoff, vga + fromoff, linesize);
|
||||||
vga[newindex] = vga[oldindex];
|
Memory::Copy(vgaattr + destoff, vgaattr + fromoff, linesize);
|
||||||
vgaattr[newindex] = vgaattr[oldindex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( nat x = 0; x < width; x++ )
|
for ( nat x = 0; x < width; x++ )
|
||||||
|
@ -124,13 +125,11 @@ namespace Sortix
|
||||||
{
|
{
|
||||||
for ( nat y = 1; y < height; y++ )
|
for ( nat y = 1; y < height; y++ )
|
||||||
{
|
{
|
||||||
for ( nat x = 0; x < width; x++ )
|
size_t linesize = width * sizeof(uint16_t);
|
||||||
{
|
size_t fromoff = (y-1) * width;
|
||||||
unsigned oldindex = (y-1) * width + x;
|
size_t destoff = (y-0) * width;
|
||||||
unsigned newindex = y * width + x;
|
Memory::Copy(vga + destoff, vga + fromoff, linesize);
|
||||||
vga[newindex] = vga[oldindex];
|
Memory::Copy(vgaattr + destoff, vgaattr + fromoff, linesize);
|
||||||
vgaattr[newindex] = vgaattr[oldindex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( nat x = 0; x < width; x++ )
|
for ( nat x = 0; x < width; x++ )
|
||||||
|
|
Loading…
Reference in New Issue