git-svn-id: https://spexeah.com:8443/svn/Asuro@543 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
72f2b6da93
commit
11542b4c34
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
Binary file not shown.
BIN
lib/ACE.ppu
BIN
lib/ACE.ppu
Binary file not shown.
BIN
lib/BPE.ppu
BIN
lib/BPE.ppu
Binary file not shown.
BIN
lib/BTSSE.ppu
BIN
lib/BTSSE.ppu
Binary file not shown.
BIN
lib/CFE.ppu
BIN
lib/CFE.ppu
Binary file not shown.
BIN
lib/CSOE.ppu
BIN
lib/CSOE.ppu
Binary file not shown.
BIN
lib/DBGE.ppu
BIN
lib/DBGE.ppu
Binary file not shown.
BIN
lib/DBZ.ppu
BIN
lib/DBZ.ppu
Binary file not shown.
BIN
lib/DFE.ppu
BIN
lib/DFE.ppu
Binary file not shown.
BIN
lib/E1000.ppu
BIN
lib/E1000.ppu
Binary file not shown.
BIN
lib/GPF.ppu
BIN
lib/GPF.ppu
Binary file not shown.
BIN
lib/IDE.ppu
BIN
lib/IDE.ppu
Binary file not shown.
BIN
lib/IDOE.ppu
BIN
lib/IDOE.ppu
Binary file not shown.
BIN
lib/IOPE.ppu
BIN
lib/IOPE.ppu
Binary file not shown.
BIN
lib/MCE.ppu
BIN
lib/MCE.ppu
Binary file not shown.
BIN
lib/NCE.ppu
BIN
lib/NCE.ppu
Binary file not shown.
BIN
lib/NMIE.ppu
BIN
lib/NMIE.ppu
Binary file not shown.
BIN
lib/OOBE.ppu
BIN
lib/OOBE.ppu
Binary file not shown.
BIN
lib/PCI.ppu
BIN
lib/PCI.ppu
Binary file not shown.
BIN
lib/PF.ppu
BIN
lib/PF.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/RTC.ppu
BIN
lib/RTC.ppu
Binary file not shown.
BIN
lib/SFE.ppu
BIN
lib/SFE.ppu
Binary file not shown.
BIN
lib/SNPE.ppu
BIN
lib/SNPE.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/UIE.ppu
BIN
lib/UIE.ppu
Binary file not shown.
BIN
lib/USB.ppu
BIN
lib/USB.ppu
Binary file not shown.
BIN
lib/arp.ppu
BIN
lib/arp.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/console.o
BIN
lib/console.o
Binary file not shown.
BIN
lib/console.ppu
BIN
lib/console.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/eth2.ppu
BIN
lib/eth2.ppu
Binary file not shown.
BIN
lib/fat32.ppu
BIN
lib/fat32.ppu
Binary file not shown.
BIN
lib/fonts.ppu
BIN
lib/fonts.ppu
Binary file not shown.
BIN
lib/gdt.ppu
BIN
lib/gdt.ppu
Binary file not shown.
BIN
lib/idt.ppu
BIN
lib/idt.ppu
Binary file not shown.
BIN
lib/ipv4.ppu
BIN
lib/ipv4.ppu
Binary file not shown.
BIN
lib/irq.ppu
BIN
lib/irq.ppu
Binary file not shown.
BIN
lib/isr.ppu
BIN
lib/isr.ppu
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.ppu
Binary file not shown.
BIN
lib/keyboard.ppu
BIN
lib/keyboard.ppu
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/libpsystem.a
BIN
lib/libpsystem.a
Binary file not shown.
BIN
lib/lists.ppu
BIN
lib/lists.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/mouse.ppu
BIN
lib/mouse.ppu
Binary file not shown.
BIN
lib/net.ppu
BIN
lib/net.ppu
Binary file not shown.
BIN
lib/netutils.ppu
BIN
lib/netutils.ppu
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/strings.ppu
BIN
lib/strings.ppu
Binary file not shown.
BIN
lib/terminal.ppu
BIN
lib/terminal.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/tracer.ppu
BIN
lib/tracer.ppu
Binary file not shown.
BIN
lib/tss.ppu
BIN
lib/tss.ppu
Binary file not shown.
BIN
lib/util.ppu
BIN
lib/util.ppu
Binary file not shown.
Binary file not shown.
113
src/console.pas
113
src/console.pas
@ -97,9 +97,17 @@ procedure _safeincrement_x();
|
|||||||
procedure _newline();
|
procedure _newline();
|
||||||
|
|
||||||
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16);
|
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16);
|
||||||
function getPixel(x : uint32; y : uint32) : uint16;
|
procedure outputCharToScreenSpace(c : char; x : uint8; y : uint8; fgcolor : uint16);
|
||||||
|
procedure outputCharTransparent(c : char; x : uint8; y : uint8; fgcolor : uint16);
|
||||||
|
|
||||||
|
function getPixel(x : uint32; y : uint32) : uint16;
|
||||||
procedure drawPixel(x : uint32; y : uint32; color : uint16);
|
procedure drawPixel(x : uint32; y : uint32; color : uint16);
|
||||||
|
function getPixel32(x : uint32; y : uint32) : uint32;
|
||||||
|
procedure drawPixel32(x : uint32; y : uint32; pixel : uint32);
|
||||||
|
function getPixel64(x : uint32; y : uint32) : uint64;
|
||||||
|
procedure drawPixel64(x : uint32; y : uint32; pixel : uint64);
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -129,8 +137,7 @@ type
|
|||||||
|
|
||||||
var
|
var
|
||||||
Console_Properties : TConsoleProperties;
|
Console_Properties : TConsoleProperties;
|
||||||
//Console_Memory : PVideoMemory = PVideoMemory($C00b8000);
|
Console_Matrix : T2DVideoMemory;
|
||||||
Console_Matrix : T2DVideoMemory;//P2DVideoMemory = P2DVideoMemory($C00b8000);
|
|
||||||
Console_Cursor : TCoord;
|
Console_Cursor : TCoord;
|
||||||
Ready : Boolean = false;
|
Ready : Boolean = false;
|
||||||
|
|
||||||
@ -139,12 +146,10 @@ var
|
|||||||
dest : puint16;
|
dest : puint16;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//push_trace('console.getPixel');
|
|
||||||
if not ready then exit;
|
if not ready then exit;
|
||||||
dest:= puint16(multibootinfo^.framebuffer_addr);
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
dest:= dest + (y * 1280) + x;
|
dest:= dest + (y * 1280) + x;
|
||||||
getPixel:= dest^;
|
getPixel:= dest^;
|
||||||
//pop_trace;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure drawPixel(x : uint32; y : uint32; color : uint16);
|
procedure drawPixel(x : uint32; y : uint32; color : uint16);
|
||||||
@ -152,12 +157,104 @@ var
|
|||||||
dest : puint16;
|
dest : puint16;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//push_trace('console.drawPixel');
|
|
||||||
if not ready then exit;
|
if not ready then exit;
|
||||||
dest:= puint16(multibootinfo^.framebuffer_addr);
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
dest:= dest + (y * 1280) + x;
|
dest:= dest + (y * 1280) + x;
|
||||||
dest^:= color;
|
dest^:= color;
|
||||||
//pop_trace;
|
end;
|
||||||
|
|
||||||
|
function getPixel32(x : uint32; y : uint32) : uint32;
|
||||||
|
var
|
||||||
|
dest : puint16;
|
||||||
|
dest32 : puint32;
|
||||||
|
|
||||||
|
begin
|
||||||
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
|
dest:= dest + (y * 1280) + x;
|
||||||
|
dest32:= puint32(dest);
|
||||||
|
getPixel32:= dest32[0];
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure drawPixel32(x : uint32; y : uint32; pixel : uint32);
|
||||||
|
var
|
||||||
|
dest : puint16;
|
||||||
|
dest32 : puint32;
|
||||||
|
|
||||||
|
begin
|
||||||
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
|
dest:= dest + (y * 1280) + x;
|
||||||
|
dest32:= puint32(dest);
|
||||||
|
dest32[0]:= pixel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function getPixel64(x : uint32; y : uint32) : uint64;
|
||||||
|
var
|
||||||
|
dest : puint16;
|
||||||
|
dest64 : puint64;
|
||||||
|
|
||||||
|
begin
|
||||||
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
|
dest:= dest + (y * 1280) + x;
|
||||||
|
dest64:= puint64(dest);
|
||||||
|
getPixel64:= dest64[0];
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure drawPixel64(x : uint32; y : uint32; pixel : uint64);
|
||||||
|
var
|
||||||
|
dest : puint16;
|
||||||
|
dest64 : puint64;
|
||||||
|
|
||||||
|
begin
|
||||||
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
|
dest:= dest + (y * 1280) + x;
|
||||||
|
dest64:= puint64(dest);
|
||||||
|
dest64[0]:= pixel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure outputCharToScreenSpace(c : char; x : uint8; y : uint8; fgcolor : uint16);
|
||||||
|
var
|
||||||
|
dest : puint16;
|
||||||
|
dest32 : puint32;
|
||||||
|
fgcolor32, bgcolor32 : uint32;
|
||||||
|
mask : puint32;
|
||||||
|
i : uint32;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if not ready then exit;
|
||||||
|
fgcolor32:= fgcolor OR (fgcolor SHL 16);
|
||||||
|
mask:= puint32(@Std_Mask[uint32(c) * (16 * 8)]);
|
||||||
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
|
dest:= dest + (y*1280) + x;
|
||||||
|
dest32:= puint32(dest);
|
||||||
|
for i:=0 to 15 do begin
|
||||||
|
dest32[(i*640)+0]:= (dest32[(i*640)+0] AND NOT(mask[(i*4)+0])) OR (fgcolor32 AND mask[(i*4)+0]);
|
||||||
|
dest32[(i*640)+1]:= (dest32[(i*640)+1] AND NOT(mask[(i*4)+1])) OR (fgcolor32 AND mask[(i*4)+1]);
|
||||||
|
dest32[(i*640)+2]:= (dest32[(i*640)+2] AND NOT(mask[(i*4)+2])) OR (fgcolor32 AND mask[(i*4)+2]);
|
||||||
|
dest32[(i*640)+3]:= (dest32[(i*640)+3] AND NOT(mask[(i*4)+3])) OR (fgcolor32 AND mask[(i*4)+3]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure outputCharTransparent(c : char; x : uint8; y : uint8; fgcolor : uint16);
|
||||||
|
var
|
||||||
|
dest : puint16;
|
||||||
|
dest32 : puint32;
|
||||||
|
fgcolor32, bgcolor32 : uint32;
|
||||||
|
mask : puint32;
|
||||||
|
i : uint32;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if not ready then exit;
|
||||||
|
fgcolor32:= fgcolor OR (fgcolor SHL 16);
|
||||||
|
mask:= puint32(@Std_Mask[uint32(c) * (16 * 8)]);
|
||||||
|
dest:= puint16(multibootinfo^.framebuffer_addr);
|
||||||
|
dest:= dest + (y*(1280 * 16)) + (x * 8);
|
||||||
|
dest32:= puint32(dest);
|
||||||
|
for i:=0 to 15 do begin
|
||||||
|
dest32[(i*640)+0]:= (dest32[(i*640)+0] AND NOT(mask[(i*4)+0])) OR (fgcolor32 AND mask[(i*4)+0]);
|
||||||
|
dest32[(i*640)+1]:= (dest32[(i*640)+1] AND NOT(mask[(i*4)+1])) OR (fgcolor32 AND mask[(i*4)+1]);
|
||||||
|
dest32[(i*640)+2]:= (dest32[(i*640)+2] AND NOT(mask[(i*4)+2])) OR (fgcolor32 AND mask[(i*4)+2]);
|
||||||
|
dest32[(i*640)+3]:= (dest32[(i*640)+3] AND NOT(mask[(i*4)+3])) OR (fgcolor32 AND mask[(i*4)+3]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16);
|
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16);
|
||||||
|
@ -47,7 +47,7 @@ implementation
|
|||||||
var
|
var
|
||||||
Current, Last : TMousePos;
|
Current, Last : TMousePos;
|
||||||
FirstDraw : boolean = true;
|
FirstDraw : boolean = true;
|
||||||
BackPixels : Array[0..1] of Array[0..1] of uint16;
|
BackPixels : Array[0..1] of Array[0..7] of uint64;
|
||||||
Cycle : uint32 = 0;
|
Cycle : uint32 = 0;
|
||||||
Mouse_Byte : Array[0..2] of uint8;
|
Mouse_Byte : Array[0..2] of uint8;
|
||||||
Packet : uint32;
|
Packet : uint32;
|
||||||
@ -65,20 +65,31 @@ begin
|
|||||||
if not NeedsRedraw then exit;
|
if not NeedsRedraw then exit;
|
||||||
NeedsRedraw:= false;
|
NeedsRedraw:= false;
|
||||||
if not FirstDraw then begin
|
if not FirstDraw then begin
|
||||||
for y:=0 to 1 do begin
|
{for y:=0 to 1 do begin
|
||||||
for x:=0 to 1 do begin
|
for x:=0 to 1 do begin
|
||||||
DrawPixel(Last.x + x, Last.y + y, BackPixels[x][y]);
|
DrawPixel(Last.x + x, Last.y + y, BackPixels[x][y]);
|
||||||
end;
|
end;
|
||||||
|
end;}
|
||||||
|
for y:=0 to 7 do begin
|
||||||
|
for x:=0 to 1 do begin
|
||||||
|
drawPixel64(Last.x + x * 4, Last.y + y, BackPixels[x][y]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Last.x:= nx;
|
Last.x:= nx;
|
||||||
Last.y:= ny;
|
Last.y:= ny;
|
||||||
for y:=0 to 1 do begin
|
{for y:=0 to 1 do begin
|
||||||
for x:=0 to 1 do begin
|
for x:=0 to 1 do begin
|
||||||
BackPixels[x][y]:= GetPixel(nx + x, ny + y);
|
BackPixels[x][y]:= GetPixel(nx + x, ny + y);
|
||||||
DrawPixel(nx + x, ny + y, $FFFF);
|
DrawPixel(nx + x, ny + y, $FFFF);
|
||||||
end;
|
end;
|
||||||
|
end;}
|
||||||
|
for y:=0 to 7 do begin
|
||||||
|
for x:=0 to 1 do begin
|
||||||
|
BackPixels[x][y]:= GetPixel64(nx + x * 4, ny + y);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
outputCharToScreenSpace(char(0), nx, ny, $FFFF);
|
||||||
FirstDraw:= false;
|
FirstDraw:= false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -126,7 +137,6 @@ var
|
|||||||
r : pchar;
|
r : pchar;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//push_trace('mouse.main');
|
|
||||||
while mouse_wait(0) do begin
|
while mouse_wait(0) do begin
|
||||||
b:= mouse_read;
|
b:= mouse_read;
|
||||||
if Cycle = 0 then begin
|
if Cycle = 0 then begin
|
||||||
@ -145,8 +155,8 @@ begin
|
|||||||
Packet.y_sign:= (f AND %00100000) = %00100000;
|
Packet.y_sign:= (f AND %00100000) = %00100000;
|
||||||
Packet.x_overflow:= (f AND $40) = $40;
|
Packet.x_overflow:= (f AND $40) = $40;
|
||||||
Packet.y_overflow:= (f AND $80) = $80;
|
Packet.y_overflow:= (f AND $80) = $80;
|
||||||
Packet.x_movement:= Mouse_Byte[1] - ((f SHL 4) AND $100);//Packet.x_movement div 4;
|
Packet.x_movement:= Mouse_Byte[1] - ((f SHL 4) AND $100);
|
||||||
Packet.y_movement:= Mouse_Byte[2] - ((f SHL 3) AND $100);//Packet.y_movement div 4;
|
Packet.y_movement:= Mouse_Byte[2] - ((f SHL 3) AND $100);
|
||||||
if not(Packet.x_overflow) and not(Packet.y_overflow) then begin
|
if not(Packet.x_overflow) and not(Packet.y_overflow) then begin
|
||||||
Current.x:= Current.x + Packet.x_movement;
|
Current.x:= Current.x + Packet.x_movement;
|
||||||
Current.y:= Current.y - Packet.y_movement;
|
Current.y:= Current.y - Packet.y_movement;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -287,6 +287,8 @@ begin
|
|||||||
|
|
||||||
tracer.push_trace('kmain.END');
|
tracer.push_trace('kmain.END');
|
||||||
|
|
||||||
|
outputCharToScreenSpace(char(0), 10, 10, $FFFF);
|
||||||
|
|
||||||
while true do begin
|
while true do begin
|
||||||
mouse.DrawCursor();
|
mouse.DrawCursor();
|
||||||
end;
|
end;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user