diff --git a/passion.ans b/passion.ans index 739428a..b5fa004 100644 --- a/passion.ans +++ b/passion.ans @@ -1,5 +1,5 @@ -ANSI art is my -passion +ANSI art is my passion + diff --git a/shell.asm b/shell.asm index 517c1c6..ed28991 100644 --- a/shell.asm +++ b/shell.asm @@ -43,13 +43,7 @@ initialize: .not_relaunch: ; Set wallpaper - mov si, wallpaper_name - xor dx, dx - call PONYDOS_SEG:SYS_OPEN_FILE - - mov bx, GLOBAL_WALLPAPER - xor di, di ; read - call PONYDOS_SEG:SYS_MODIFY_SECTORS + call set_wallpaper ; Create icon for the disk on the desktop mov ax, cs @@ -340,10 +334,33 @@ hide_file_window: launch: mov si, launch_filename - ; Is it a .bin file? + ; Is it a .wall file? call strlen + cmp cx, 5 + jb .not_wall + add si, cx + sub si, 5 + mov di, wall_extension + call strcmp + jne .not_wall + + mov ax, cs + mov es, ax + mov si, launch_filename + mov di, wallpaper_name + mov cx, FS_DIRENT_NAME_SIZE + rep movsb + + call set_wallpaper + call request_redraw + jmp .end + + .not_wall: + + ; Is it a .bin file? cmp cx, 4 jb .end ; No, too short + mov si, launch_filename add si, cx sub si, 4 mov di, bin_extension @@ -402,6 +419,20 @@ launch: .end: ret +; out: +; clobbers everything +set_wallpaper: + mov ax, PONYDOS_SEG + mov es, ax + mov si, wallpaper_name + xor dx, dx + call PONYDOS_SEG:SYS_OPEN_FILE + + mov bx, GLOBAL_WALLPAPER + xor di, di ; read + call PONYDOS_SEG:SYS_MODIFY_SECTORS + ret + ; in: ; al = WM_KEYBOARD ; bx = window ID @@ -748,9 +779,11 @@ forward_event: pop bp ret -wallpaper_name db 'ponydos.wall', 0 +wallpaper_name db 'ponydos.wall' + times FS_DIRENT_NAME_SIZE-12 db 0 bin_extension db '.bin', 0 +wall_extension db '.wall', 0 %include "debug.inc"