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

This commit is contained in:
kieron committed 2018-05-01 17:34:47 +00:00
1 parent 8b7a8182b8
commit 6d8717a7fc
17 files changed
+148 -92

No files matched your search

+95 -52
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -3,11 +3,11 @@ unit asuro;
interface
const
VERSION = '1.0.0-632a';
VERSION = '1.0.0-634a';
VERSION_MAJOR = '1';
VERSION_MINOR = '0';
VERSION_SUB = '0';
REVISION = '632';
REVISION = '634';
RELEASE = 'a';
implementation
+7 -8
View File
@@ -208,19 +208,18 @@ begin
console.setdefaultattribute(console.combinecolors($17E0, $0000));
console.writestringln('Asuro Booted Correctly!');
console.setdefaultattribute(console.combinecolors($FFFF, $0000));
console.writestringln('');
console.writestringln('Press any key to boot in to Asuro Terminal...');
tracer.pop_trace;
//console.writestringln('');
//console.writestringln('Press any key to boot in to Asuro Terminal...');
//tracer.pop_trace;
{ Init Progs }
shell.init();
memview.init();
console.writehexln(uint32(multibootinfo^.framebuffer_addr));
tracer.push_trace('kmain.KEYHOOK');
keyboard.hook(@temphook);
tracer.pop_trace;
//console.writehexln(uint32(multibootinfo^.framebuffer_addr));
//tracer.push_trace('kmain.KEYHOOK');
//keyboard.hook(@temphook);
//tracer.pop_trace;
tracer.push_trace('kmain.END');
+13 -1
View File
@@ -3,7 +3,7 @@ unit shell;
interface
uses
Console, RTC;
Console, RTC, terminal;
procedure init();
@@ -49,6 +49,17 @@ begin
writeIntExWND(DateTime.Seconds, Colors, Handle);
end;
procedure OnMouseClick(x : uint32; y : uint32; left : boolean);
begin
//WriteIntLn(x);
//WriteIntLn(y);
if left then begin
if (y = 0) and (x < 10) then begin
terminal.run;
end;
end;
end;
procedure init();
begin
colors:= console.combinecolors($0000, $FFFF);
@@ -58,6 +69,7 @@ begin
//console.clearWNDEx(Handle, colors);
console.setShellWindow(Handle, false);
console.registerEventHandler(Handle, EVENT_DRAW, void(@Draw));
console.registerEventHandler(Handle, EVENT_MOUSE_CLICK, void(@OnMouseClick));
end;
end.
+31 -29
View File
@@ -65,7 +65,7 @@ uses
RTC;
var
TERMINAL_HWND : HWND = 1;
TERMINAL_HWND : HWND = 0;
function getTerminalHWND : uint32;
begin
@@ -340,23 +340,25 @@ end;
procedure key_event(info : TKeyInfo);
begin
if (info.key_code >= 32) and (info.key_code <= 126) then begin
if bIndex < 1024 then begin
buffer[bIndex]:= info.key_code;
inc(bIndex);
console.writecharWND(char(info.key_code), TERMINAL_HWND);
if TERMINAL_HWND <> 0 then begin
if (info.key_code >= 32) and (info.key_code <= 126) then begin
if bIndex < 1024 then begin
buffer[bIndex]:= info.key_code;
inc(bIndex);
console.writecharWND(char(info.key_code), TERMINAL_HWND);
end;
end;
if info.key_code = 8 then begin //backspace
if bIndex > 0 then begin
console.backspaceWND(TERMINAL_HWND);
dec(bIndex);
buffer[bIndex]:= 0;
end;
end;
end;
if info.key_code = 8 then begin //backspace
if bIndex > 0 then begin
console.backspaceWND(TERMINAL_HWND);
dec(bIndex);
buffer[bIndex]:= 0;
if info.key_code = 13 then begin //return
process_command;
end;
end;
if info.key_code = 13 then begin //return
process_command;
end;
end;
procedure change_dir(Params : PParamList);
@@ -366,11 +368,6 @@ begin
end;
end;
procedure ToggleWND1(Params : PParamList);
begin
console.toggleWNDVisible(1);
end;
procedure SendSerial(Params : PParamList);
var
success : boolean;
@@ -409,22 +406,27 @@ begin
registerCommand('TEST', @test, 'Command for testing.');
registerCommand('CD', @change_dir, 'Change Directory test.');
registerCommand('PATTERN', @cockwomble, 'Print an animated pattern to the screen.');
registerCommand('TOGGLEWND1', @ToggleWND1, 'Toggle WND 1 Visibility.');
registerCommand('TIME', @printTime, 'Print the current time.');
registerCommand('SERIAL', @SendSerial, 'Send ''helloworld'' through COM1.');
console.writestringln('TERMINAL: INIT END.');
end;
procedure OnClose();
begin
TERMINAL_HWND:= 0;
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);
console.writestringWND(Working_Directory, TERMINAL_HWND);
console.writestringWND('> ', TERMINAL_HWND);
console.setWNDVisible(TERMINAL_HWND, true);
if TERMINAL_HWND = 0 then begin
TERMINAL_HWND:= newWindow(20, 10, 90, 20, 'ASURO TERMINAL');
console.registerEventHandler(TERMINAL_HWND, EVENT_KEY_PRESSED, void(@key_event));
console.registerEventHandler(TERMINAL_HWND, EVENT_CLOSE, void(@OnClose));
console.clearWND(TERMINAL_HWND);
console.writestringWND('Asuro#', TERMINAL_HWND);
console.writestringWND(Working_Directory, TERMINAL_HWND);
console.writestringWND('> ', TERMINAL_HWND);
end;
end;
end.