git-svn-id: https://spexeah.com:8443/svn/Asuro@610 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+349
-183
File diff suppressed because it is too large
Load Diff
@@ -56,6 +56,7 @@ type
|
||||
PDouble = ^Double;
|
||||
|
||||
Void = ^uInt32;
|
||||
HWND = uint32;
|
||||
|
||||
//Alternate Types
|
||||
UBit1 = 0..(1 shl 01) - 1;
|
||||
|
||||
@@ -333,7 +333,7 @@ var
|
||||
|
||||
begin
|
||||
disable_cursor;
|
||||
closeAllWindows;
|
||||
console.forceQuitAll;
|
||||
if not BSOD_ENABLE then exit;
|
||||
console.setdefaultattribute(console.combinecolors($FFFF, $F800));
|
||||
console.clear;
|
||||
|
||||
+5
-1
@@ -45,7 +45,8 @@ uses
|
||||
faults,
|
||||
fonts,
|
||||
RTC,
|
||||
serial;
|
||||
serial,
|
||||
memview;
|
||||
|
||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||
|
||||
@@ -210,6 +211,9 @@ begin
|
||||
console.writestringln('Press any key to boot in to Asuro Terminal...');
|
||||
tracer.pop_trace;
|
||||
|
||||
{ Init Progs }
|
||||
memview.init();
|
||||
|
||||
tracer.push_trace('kmain.KEYHOOK');
|
||||
keyboard.hook(@temphook);
|
||||
tracer.pop_trace;
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
unit memview;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
console, terminal;
|
||||
|
||||
procedure init();
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
strings, tracer;
|
||||
|
||||
var
|
||||
Handle : HWND = 0;
|
||||
MEM_LOC : uint32;
|
||||
|
||||
procedure mvprintmemory(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);
|
||||
console.writestringlnWND(' ', Handle);
|
||||
console.writestringlnWND(' ', 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);
|
||||
end;
|
||||
console.writehexpairWND(buf[i], Handle);
|
||||
if i<>length-1 then begin
|
||||
if ((i+1) MOD col) = 0 then begin
|
||||
console.writestringlnWND(' ', Handle);
|
||||
if offset_row then begin
|
||||
console.writestringWND(' ', Handle);
|
||||
console.writehexWND(source + (i + 1), Handle);
|
||||
console.writestringWND(': ', Handle);
|
||||
end;
|
||||
end else begin
|
||||
console.writestringWND(delim, Handle);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
console.writestringlnWND(' ', Handle);
|
||||
end;
|
||||
|
||||
procedure OnClose();
|
||||
begin
|
||||
Handle:= 0;
|
||||
end;
|
||||
|
||||
procedure Draw();
|
||||
begin
|
||||
tracer.push_trace('memview.draw');
|
||||
if Handle <> 0 then begin
|
||||
clearWND(Handle);
|
||||
mvprintmemory(MEM_LOC, 176, 16, ' ', true);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure run(Params : PParamList);
|
||||
var
|
||||
loc : PChar;
|
||||
|
||||
begin
|
||||
tracer.push_trace('memview.run');
|
||||
if ParamCount(Params) < 1 then begin
|
||||
writestringlnWND('No memory location specified!', getTerminalHWND);
|
||||
end else begin
|
||||
loc:= GetParam(0, Params);
|
||||
if StringEquals(loc, 'close') then begin
|
||||
tracer.push_trace('memview.close');
|
||||
if Handle <> 0 then begin
|
||||
closeWindow(Handle);
|
||||
end;
|
||||
end else begin
|
||||
MEM_LOC:= stringToInt(loc);
|
||||
if Handle = 0 then begin
|
||||
Handle:= newWindow(20, 40, 63, 14, 'MEMVIEW');
|
||||
registerEventHandler(Handle, EVENT_DRAW, void(@Draw));
|
||||
registerEventHandler(Handle, EVENT_CLOSE, void(@OnClose));
|
||||
writestringWND('Memview started at location: ', getTerminalHWND);
|
||||
end else begin
|
||||
writestringWND('Memview location changed to: ', getTerminalHWND);
|
||||
end;
|
||||
writehexlnWND(MEM_LOC, getTerminalHWND);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
tracer.push_trace('memview.init');
|
||||
terminal.registerCommand('MEMVIEW', @Run, 'View a location in memory [MEMVIEW <Location>]');
|
||||
end;
|
||||
|
||||
end.
|
||||
+6
-3
@@ -22,9 +22,6 @@ uses
|
||||
asuro,
|
||||
serial;
|
||||
|
||||
const
|
||||
TERMINAL_HWND = 1;
|
||||
|
||||
type
|
||||
PParamList = ^TParamList;
|
||||
TParamList = record
|
||||
@@ -67,6 +64,9 @@ implementation
|
||||
uses
|
||||
RTC;
|
||||
|
||||
var
|
||||
TERMINAL_HWND : HWND = 1;
|
||||
|
||||
function getTerminalHWND : uint32;
|
||||
begin
|
||||
getTerminalHWND:= TERMINAL_HWND;
|
||||
@@ -387,6 +387,7 @@ begin
|
||||
success:= success AND Serial.Send(COM1, uint8('R'), 1000);
|
||||
success:= success AND Serial.Send(COM1, uint8('L'), 1000);
|
||||
success:= success AND Serial.Send(COM1, uint8('D'), 1000);
|
||||
success:= success AND Serial.Send(COM1, 10, 1000);
|
||||
success:= success AND Serial.Send(COM1, 13, 1000);
|
||||
if success then begin
|
||||
console.writestringlnWND('Send Success!', TERMINAL_HWND);
|
||||
@@ -416,6 +417,8 @@ end;
|
||||
|
||||
procedure run;
|
||||
begin
|
||||
TERMINAL_HWND:= newWindow(20, 10, 90, 20, 'ASURO TERMINAL');
|
||||
//newWindow(10, 10, 32, 32, 'MEMVIEW');
|
||||
keyboard.hook(@key_event);
|
||||
console.clearWND(TERMINAL_HWND);
|
||||
console.writestringWND('Asuro#', TERMINAL_HWND);
|
||||
|
||||
Reference in New Issue
Block a user