From ad4c9a2209094753c1cd27207bb0d0513cfcf984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 27 Mar 2023 14:08:48 +0300 Subject: [PATCH] Complete shell refactor --- README.md | 2 -- shell.asm | 32 +++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b7ef551..e09da08 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Feel free to add anything you think would fit in ### Basic stuff -* refactor shell.asm a bit: - - add/verify function header comments * a release-able README ### Nice to have diff --git a/shell.asm b/shell.asm index 0d7353d..0c3fc93 100644 --- a/shell.asm +++ b/shell.asm @@ -37,6 +37,8 @@ org 0 jmp near process_event ; 0x0003 +; out: +; clobbers everything but ds initialize: push ds @@ -100,6 +102,12 @@ initialize: pop ds retf +; in: +; al = event +; bx = window ID +; cx, dx = event specific +; out: +; ax = event specific process_event: push bx push cx @@ -801,8 +809,8 @@ raise_window: mov cx, ax call unhook_window - xchg [es:GLOBAL_WINDOW_CHAIN_HEAD], cx - mov [si + window.next], cx + call hook_window + mov [si + window.next], ax call request_redraw @@ -825,6 +833,7 @@ render_file_window: push ax push cx push dx + push di push es mov ax, cs @@ -852,6 +861,7 @@ render_file_window: call print_ls pop es + pop di pop dx pop cx pop ax @@ -859,13 +869,13 @@ render_file_window: request_redraw: push es - push bp + push ax - mov bp, PONYDOS_SEG - mov es, bp + mov ax, PONYDOS_SEG + mov es, ax mov byte [es:GLOBAL_REDRAW], 1 - pop bp + pop ax pop es ret @@ -1077,15 +1087,15 @@ strcmp: pop si ret -wallpaper_name db 'ponydos.wall' - times FS_DIRENT_NAME_SIZE-12 db 0 +; ------------------------------------------------------------------ +; Variables +; ------------------------------------------------------------------ bin_extension db '.bin', 0 wall_extension db '.wall', 0 -%include "debug.inc" - -file_window_visible db 0 +wallpaper_name db 'ponydos.wall' + times FS_DIRENT_NAME_SIZE-12 db 0 disk_icon: db 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f