From a110e1da1b242a341e350c7b7471878437d19629 Mon Sep 17 00:00:00 2001 From: shikhin Date: Sat, 18 Mar 2023 12:12:18 +0530 Subject: [PATCH] Save some bytes --- Makefile | 2 +- wallpaper.ansi => bg.ansi | 0 ponydos.asm | 21 +++++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) rename wallpaper.ansi => bg.ansi (100%) diff --git a/Makefile b/Makefile index 8b0de76..9f0683d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PYTHON = python3 all: ponydos.img -FS_FILES = wallpaper.bin shell.bin +FS_FILES = bg.bin shell.bin ponydos.img: ponydos.bin $(FS_FILES) $(PYTHON) assemble_floppy.py $@ ponydos.bin $(FS_FILES) diff --git a/wallpaper.ansi b/bg.ansi similarity index 100% rename from wallpaper.ansi rename to bg.ansi diff --git a/ponydos.asm b/ponydos.asm index 499c273..a8e9f30 100644 --- a/ponydos.asm +++ b/ponydos.asm @@ -72,8 +72,8 @@ load_wallpaper: ; TODO: error management? Surely this works... load_shell: - mov ax, 0x1000 - mov es, ax + push word 0x1000 + pop es mov si, shell_name call open_file xor bx, bx @@ -118,15 +118,20 @@ mainloop: draw_wallpaper: pusha push es + push ds - mov bx, 0xb800 - mov es, bx + xor ax, ax + mov ds, ax + + push word 0xb800 + pop es mov si, WALLPAPER xor di, di mov cx, 80*25 rep movsw + pop ds pop es popa ret @@ -135,8 +140,8 @@ flip_mouse_cursor: pusha push es - mov bx, 0xb800 - mov es, bx + push word 0xb800 + pop es ; Column xor bh, bh @@ -224,7 +229,7 @@ modify_sector: ret .error: - ; Reset the disk system unconditinoally, as we have no + ; Reset the disk system unconditionally, as we have no ; kernel panic handler to go to after 3 tries and proper ; error handling would take too much code xor ah, ah @@ -235,7 +240,7 @@ modify_sector: ; Filesystem ; ------------------------------------------------------------------ -wallpaper_name: db 'wallpaper.bin', 0 +wallpaper_name: db 'bg.bin', 0 shell_name: db 'shell.bin', 0 ; in: