# HG changeset patch # User Pascal Bellard # Date 1695834813 0 # Node ID 5d44015ce87815226d1d03bf1afb5e60cff08fa7 # Parent 1e55ea7da8ded97dcc1156b7607ead617e96488e boot-man: handle ESC key diff -r 1e55ea7da8de -r 5d44015ce878 boot-man/stuff/boot-man.asm --- a/boot-man/stuff/boot-man.asm Tue Sep 26 17:09:38 2023 +0000 +++ b/boot-man/stuff/boot-man.asm Wed Sep 27 17:13:33 2023 +0000 @@ -64,7 +64,6 @@ ; won't run on your machine. start: - sti ; Allow interrupts call copy ; Can run as bootsector or DOS COM file moved: @@ -161,11 +160,19 @@ je .no_key int 0x16 mov al,ah + dec ah ; Escape ? + jne .convert_scancode +.exit: + mov al,3 + int 0x10 ; Reset screen + int 0x20 ; Exit to DOS... + int 0x19 ; ...or reboot ; This code converts al from scancode to movement direction. ; Input: 0x48 (up), 0x4b (right), 0x50 (down), 0x4d (left) ; Output: 0xce (up), 0xca (right), 0xc6 (down), 0xc2 (left) +.convert_scancode: sub al, 0x47 ; 0x01 0x04 0x09 0x06 and al,0xfe ; 0x00 0x04 0x08 0x06 cmp al, 9 @@ -366,12 +373,8 @@ cbw int 0x16 ; Wait for any key %endif -.exit: - mov ax,3 - int 0x10 ; Reset screen - int 0x20 ; Exit to DOS... jump_start equ $ + 1 - mov si,0xFFFC ; ...or restart boot sector + mov si,0xFFFC ; restart boot sector push si ret @@ -412,6 +415,7 @@ mov di, moved ; Move self to a well known address push di mov cx, 512-3 + sti ; Allow interrupts cld ; Clear the direction flag. We use string instructions a lot as they have one-byte codes rep movsb ret diff -r 1e55ea7da8de -r 5d44015ce878 bootbricks/stuff/bricks.asm --- a/bootbricks/stuff/bricks.asm Tue Sep 26 17:09:38 2023 +0000 +++ b/bootbricks/stuff/bricks.asm Wed Sep 27 17:13:33 2023 +0000 @@ -28,6 +28,7 @@ ; Start of the game ; start: + sti ; Allow interrupts mov ax,0xb800 ; Address of video screen mov ds,ax ; Setup DS mov es,ax ; Setup ES diff -r 1e55ea7da8de -r 5d44015ce878 linux/stuff/bundle.S --- a/linux/stuff/bundle.S Tue Sep 26 17:09:38 2023 +0000 +++ b/linux/stuff/bundle.S Wed Sep 27 17:13:33 2023 +0000 @@ -185,11 +185,9 @@ orb %bl, %bl jnz scanboot decb %bh - jmp boot found: cli movb 0x1F1+BUFFER, %al // setup size -boot: pushw %ds pushw %bx pushw %ss