Added California & Colarado laws, copied & modifed from https://github.com/c3d/db48x/blob/stable/LEGAL-NOTICE.md
This commit is contained in:
@@ -20,8 +20,8 @@ os_read_input:
|
||||
keyboard_display_input:
|
||||
pusha
|
||||
mov di, ax
|
||||
mov ax, bx ; Lazy TODO
|
||||
mov cx, [prompt_length]
|
||||
mov ax, bx
|
||||
mov bx,20
|
||||
|
||||
.loop:
|
||||
jmp .check_key_pressed
|
||||
@@ -40,11 +40,11 @@ keyboard_display_input:
|
||||
cmp al, 1Bh
|
||||
je .esc_key
|
||||
|
||||
cmp cx, 0
|
||||
jb .check_key_pressed
|
||||
dec bx
|
||||
|
||||
cmp bx, 0
|
||||
jae .print_current_input ; Echo the user input back
|
||||
|
||||
call .print_current_input
|
||||
dec cx
|
||||
jmp .check_key_pressed
|
||||
|
||||
.esc_key:
|
||||
@@ -57,8 +57,9 @@ keyboard_display_input:
|
||||
ret ; Return to the parent function (whatever that may be)
|
||||
|
||||
.backspace:
|
||||
jmp .move_cursor_back ; then .move_cursor_back
|
||||
jmp .loop ; Else .loop
|
||||
cmp bx, 20 ; Cannot backspace if the cursor is at the start
|
||||
jb .move_cursor_back ; then .move_cursor_back
|
||||
jmp .loop ; Else .loop
|
||||
|
||||
.move_cursor_back:
|
||||
mov ah, 0Eh
|
||||
@@ -70,16 +71,15 @@ keyboard_display_input:
|
||||
mov al, 08h
|
||||
int 10h
|
||||
|
||||
inc bx
|
||||
dec di
|
||||
jmp .loop
|
||||
|
||||
.print_current_input: ; Echo back that character and return the key inputing
|
||||
stosb
|
||||
|
||||
mov ah, 0Eh
|
||||
int 10h
|
||||
|
||||
ret
|
||||
jmp .check_key_pressed
|
||||
|
||||
keyboard_get_cursor_pos: ;TODO
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user