git-svn-id: https://spexeah.com:8443/svn/Asuro@653 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron
2018-05-03 01:45:14 +00:00
parent c113935be7
commit a5bae52f09
81 changed files with 131 additions and 35 deletions

View File

@ -136,6 +136,7 @@ procedure writewordexWND(i: DWORD; attributes: uint32; WND : uint32);
procedure writewordlnexWND(i: DWORD; attributes: uint32; WND : uint32);
procedure writehexpairWND(b : uint8; WND : uint32);
procedure writehexpairExWND(b : uint8; Attributes : uint32; WND : uint32);
procedure writehexWND(i: DWORD; WND : uint32);
procedure writehexlnWND(i: DWORD; WND : uint32);
procedure writehexexWND(i : DWORD; attributes: uint32; WND : uint32);
@ -888,7 +889,7 @@ begin
Default_Char.visible:= true;
Window_Border.Character:= ' ';
Window_Border.Attributes:= console.combinecolors($01C3, $07EE);//$0000FFFF;
Window_Border.Attributes:= console.combinecolors($01C3, $07EE);
Window_Border.visible:= true;
For w:=0 to MAX_WINDOWS-1 do begin
@ -1771,6 +1772,11 @@ begin
end;
procedure writehexpairWND(b : uint8; WND : uint32);
begin
writehexpairExWND(b, Console_Properties.Default_Attribute, WND);
end;
procedure writehexpairExWND(b : uint8; Attributes : uint32; WND : uint32);
var
bn : Array[0..1] of uint8;
i : uint8;
@ -1780,22 +1786,22 @@ begin
bn[1]:= b AND $0F;
for i:=0 to 1 do begin
case bn[i] of
0 :writestringWND('0', WND);
1 :writestringWND('1', WND);
2 :writestringWND('2', WND);
3 :writestringWND('3', WND);
4 :writestringWND('4', WND);
5 :writestringWND('5', WND);
6 :writestringWND('6', WND);
7 :writestringWND('7', WND);
8 :writestringWND('8', WND);
9 :writestringWND('9', WND);
10:writestringWND('A', WND);
11:writestringWND('B', WND);
12:writestringWND('C', WND);
13:writestringWND('D', WND);
14:writestringWND('E', WND);
15:writestringWND('F', WND);
0 :writestringExWND('0', Attributes, WND);
1 :writestringExWND('1', Attributes, WND);
2 :writestringExWND('2', Attributes, WND);
3 :writestringExWND('3', Attributes, WND);
4 :writestringExWND('4', Attributes, WND);
5 :writestringExWND('5', Attributes, WND);
6 :writestringExWND('6', Attributes, WND);
7 :writestringExWND('7', Attributes, WND);
8 :writestringExWND('8', Attributes, WND);
9 :writestringExWND('9', Attributes, WND);
10:writestringExWND('A', Attributes, WND);
11:writestringExWND('B', Attributes, WND);
12:writestringExWND('C', Attributes, WND);
13:writestringExWND('D', Attributes, WND);
14:writestringExWND('E', Attributes, WND);
15:writestringExWND('F', Attributes, WND);
end;
end;
end;

View File

@ -97,6 +97,19 @@ type
TMask = bitpacked array[0..7] of Boolean;
PMask = ^TMask;
TRGB565 = bitpacked record
B : UBit5;
G : UBit6;
R : UBit5
end;
PRGB565 = ^TRGB565;
TRGB565Pair = bitpacked record
Background : TRGB565;
Foreground : TRGB565;
end;
PRGB565Pair = ^TRGB565Pair;
implementation
end.

View File

@ -346,7 +346,8 @@ var
z : uint32;
begin
disable_cursor;
console.disable_cursor;
console.mouseEnabled(false);
console.forceQuitAll;
if not BSOD_ENABLE then exit;
console.setdefaultattribute(console.combinecolors($FFFF, $F800));

View File

@ -12,41 +12,95 @@ implementation
uses
strings, tracer;
type
TMode = (tmHex, tmChar);
var
Handle : HWND = 0;
MEM_LOC : uint32;
NEW_LOC : Boolean;
Colors : uint32;
Changed : uint32;
Data : Array[0..176] of byte;
Mode : TMode;
procedure mvprintmemory(source : uint32; length : uint32; col : uint32; delim : PChar; offset_row : boolean);
procedure printmemoryaschar(source : uint32; length : uint32; col : uint32; delim : PChar; offset_row : boolean);
var
buf : puint8;
i : uint32;
begin
begin
tracer.push_trace('memview.printmemory');
buf:= puint8(source);
console.writestringlnWND(' ', Handle);
console.writestringlnWND(' ', Handle);
if NEW_LOC then begin
NEW_LOC:= false;
for i:=0 to length-1 do begin
Data[i]:= buf[i];
end;
end;
console.writestringlnExWND(' ', Colors, Handle);
console.writestringlnExWND(' ', Colors, Handle);
for i:=0 to length-1 do begin
if offset_row and (i = 0) then begin
console.writestringWND(' ', Handle);
console.writehexWND(source + (i), Handle);
console.writestringWND(': ', Handle);
console.writestringExWND(' ', Colors, Handle);
console.writehexExWND(source + (i), Colors, Handle);
console.writestringExWND(': ', Colors, Handle);
end;
console.writehexpairWND(buf[i], Handle);
if buf[i] = Data[i] then console.writecharExWND(char(buf[i]), Colors, Handle) else console.writecharExWND(char(buf[i]), Changed, Handle);
console.writecharExWND(' ', Colors, Handle);
if i<>length-1 then begin
if ((i+1) MOD col) = 0 then begin
console.writestringlnWND(' ', Handle);
console.writestringlnExWND(' ', Colors, Handle);
if offset_row then begin
console.writestringWND(' ', Handle);
console.writehexWND(source + (i + 1), Handle);
console.writestringWND(': ', Handle);
console.writestringExWND(' ', Colors, Handle);
console.writehexExWND(source + (i + 1), Colors, Handle);
console.writestringExWND(': ', Colors, Handle);
end;
end else begin
console.writestringWND(delim, Handle);
console.writestringExWND(delim, Colors, Handle);
end;
end;
end;
console.writestringlnWND(' ', Handle);
console.writestringlnExWND(' ', Colors, Handle);
end;
procedure printmemoryashex(source : uint32; length : uint32; col : uint32; delim : PChar; offset_row : boolean);
var
buf : puint8;
i : uint32;
begin
tracer.push_trace('memview.printmemory');
buf:= puint8(source);
if NEW_LOC then begin
NEW_LOC:= false;
for i:=0 to length-1 do begin
Data[i]:= buf[i];
end;
end;
console.writestringlnExWND(' ', Colors, Handle);
console.writestringlnExWND(' ', Colors, Handle);
for i:=0 to length-1 do begin
if offset_row and (i = 0) then begin
console.writestringExWND(' ', Colors, Handle);
console.writehexExWND(source + (i), Colors, Handle);
console.writestringExWND(': ', Colors, Handle);
end;
if buf[i] = Data[i] then console.writehexpairExWND(buf[i], Colors, Handle) else console.writehexpairExWND(buf[i], Changed, Handle);
if i<>length-1 then begin
if ((i+1) MOD col) = 0 then begin
console.writestringlnExWND(' ', Colors, Handle);
if offset_row then begin
console.writestringExWND(' ', Colors, Handle);
console.writehexExWND(source + (i + 1), Colors, Handle);
console.writestringExWND(': ', Colors, Handle);
end;
end else begin
console.writestringExWND(delim, Colors, Handle);
end;
end;
end;
console.writestringlnExWND(' ', Colors, Handle);
end;
procedure OnClose();
@ -58,8 +112,12 @@ procedure Draw();
begin
tracer.push_trace('memview.draw');
if Handle <> 0 then begin
clearWND(Handle);
mvprintmemory(MEM_LOC, 176, 16, ' ', true);
clearWNDEx(Handle, Colors);
case mode of
tmHex:printmemoryashex(MEM_LOC, 176, 16, ' ', true);
tmChar:printmemoryaschar(MEM_LOC, 176, 16, ' ', true);
end;
end;
end;
@ -67,9 +125,17 @@ procedure OnKeyPressed(info : TKeyInfo);
begin
if info.key_code = 16 then begin
dec(MEM_LOC, 16);
NEW_LOC:= true;
end;
if info.key_code = 18 then begin
inc(MEM_LOC, 16);
NEW_LOC:= true;
end;
if info.key_code = uint8('c') then begin
Mode:= tmChar;
end;
if info.key_code = uint8('h') then begin
Mode:= tmHex;
end;
end;
@ -100,6 +166,7 @@ begin
end;
end else begin
MEM_LOC:= stringToInt(loc);
NEW_LOC:= true;
if Handle = 0 then begin
Handle:= newWindow(20, 40, 63, 14, 'MEMVIEW');
registerEventHandler(Handle, EVENT_DRAW, void(@Draw));
@ -118,6 +185,9 @@ procedure init();
begin
tracer.push_trace('memview.init');
terminal.registerCommand('MEMVIEW', @Run, 'View a location in memory [MEMVIEW <Location>]');
Colors:= combineColors($0000, $FFFF);
Changed:= combineColors($F800, $FFFF);
Mode:= tmHex;
end;
end.

View File

@ -92,7 +92,7 @@ procedure init();
begin
Takbar_Colors:= console.combinecolors($0000, $FFFF);
Explore_Colors:= console.combinecolors($01C3, $07EE);
Desktop_Colors:= console.combinecolors($01C3, $A55F);
Desktop_Colors:= console.combinecolors($01C3, $34DB);
DesktopHandle:= Console.newWindow(0, 0, 159, 63, 'DESKTOP');
TaskBarHandle:= Console.newWindow(0, 63, 159, 1, 'SHELL');

View File

@ -428,6 +428,11 @@ begin
resetSystem;
end;
procedure teapot(Params : PParamList);
begin
console.writestringlnWND('Teapot?', getTerminalHWND);
end;
procedure init;
begin
console.writestringln('TERMINAL: INIT BEGIN.');
@ -440,6 +445,7 @@ begin
registerCommand('TIME', @printTime, 'Print the current time.');
registerCommandEx('SERIAL', @SendSerial, 'Send ''helloworld'' through COM1.', true);
registerCommand('REBOOT', @Reboot, 'Reboot the system.');
registerCommandEx('LOLWUT', @teapot, '?', true);
console.writestringln('TERMINAL: INIT END.');
end;