wok-tiny rev 182

Update bootpillman & bootsokoban
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Sep 24 17:53:05 2023 +0000 (7 months ago)
parents 2a1ec9d88ac0
children 1e55ea7da8de
files boot-man/receipt bootbricks/receipt bootbricks/stuff/bricks.asm bootfbird/receipt bootfbird/stuff/fbird.asm bootinvaders/receipt bootinvaders/stuff/invaders.asm bootmine/receipt bootmine/stuff/mine.asm bootpillman/receipt bootpillman/stuff/pillman.asm bootris/receipt bootris/stuff/tetranglix.asm bootsokoban/receipt bootsokoban/stuff/sokoban.asm linux/stuff/bundle linux/stuff/bundle.S memtest/receipt plop/receipt
line diff
     1.1 --- a/boot-man/receipt	Wed Sep 20 13:53:13 2023 +0000
     1.2 +++ b/boot-man/receipt	Sun Sep 24 17:53:05 2023 +0000
     1.3 @@ -25,12 +25,12 @@
     1.4  genpkg_rules()
     1.5  {
     1.6  	mkdir -p $fs/boot
     1.7 -	cp $src/boot-man.img $fs/boot/$PACKAGE
     1.8 +	cp $src/boot-man.img $fs/boot/pacman
     1.9  }
    1.10  
    1.11  # Post install/remove commands for Tazpkg.
    1.12  post_install()
    1.13  {
    1.14  	grep -qs ^boot-man $1/boot/bootmenu ||
    1.15 -	echo "boot-man	pacman		Bootable pacman game (may run under DOS if renamed to pacman.com)" >> $1/boot/bootmenu
    1.16 +	echo "pacman	Pacman,pacman		Pacman (may run under DOS if renamed to pacman.com)" >> $1/boot/bootmenu
    1.17  }
     2.1 --- a/bootbricks/receipt	Wed Sep 20 13:53:13 2023 +0000
     2.2 +++ b/bootbricks/receipt	Sun Sep 24 17:53:05 2023 +0000
     2.3 @@ -25,12 +25,12 @@
     2.4  genpkg_rules()
     2.5  {
     2.6  	mkdir -p $fs/boot
     2.7 -	cp $src/bricks.img $fs/boot/$PACKAGE
     2.8 +	cp $src/bricks.img $fs/boot/bricks
     2.9  }
    2.10  
    2.11  # Post install/remove commands for Tazpkg.
    2.12  post_install()
    2.13  {
    2.14  	grep -qs ^bootbricks $1/boot/bootmenu ||
    2.15 -	echo "bootbricks	bricks		Bootable bricks game (may run under DOS if renamed to bricks.com)" >> $1/boot/bootmenu
    2.16 +	echo "bricks	Bricks,bricks,breakout		Breakout (may run under DOS if renamed to bricks.com)" >> $1/boot/bootmenu
    2.17  }
     3.1 --- a/bootbricks/stuff/bricks.asm	Wed Sep 20 13:53:13 2023 +0000
     3.2 +++ b/bootbricks/stuff/bricks.asm	Sun Sep 24 17:53:05 2023 +0000
     3.3 @@ -28,17 +28,17 @@
     3.4  	; Start of the game
     3.5  	;
     3.6  start:
     3.7 -	mov ax,0x0002		; Text mode 80x25x16 colors
     3.8 -	int 0x10		; Setup
     3.9  	mov ax,0xb800		; Address of video screen
    3.10  	mov ds,ax		; Setup DS
    3.11  	mov es,ax		; Setup ES
    3.12  	sub sp,32
    3.13 -	xor ax,ax
    3.14 +	cbw
    3.15  	push ax			; Reset score
    3.16  	mov al,4		
    3.17  	push ax			; Balls remaining
    3.18  	mov bp,sp		; Setup stack frame for globals
    3.19 +	mov al,0x02		; Text mode 80x25x16 colors
    3.20 +	int 0x10		; Setup
    3.21  	;
    3.22  	; Start another level 
    3.23  	;
    3.24 @@ -93,10 +93,18 @@
    3.25  game_loop:
    3.26  	call wait_frame		; Wait 1/18.2 secs.
    3.27  
    3.28 -	mov word [si],0x0000	; Erase ball
    3.29 +	and word [si],0x0000	; Erase ball
    3.30  	
    3.31  	call update_score	; Update score
    3.32  	
    3.33 +	mov ah,0x01		; Check for keys
    3.34 +	int 0x16
    3.35 +	jz .0
    3.36 +	cbw			; Eat key
    3.37 +	int 0x16
    3.38 +	cmp al,27		; ESC key ?
    3.39 +	je exit
    3.40 +.0:	
    3.41  	mov ah,0x02		; Read modifier keys
    3.42  	int 0x16
    3.43  	test al,0x04		; Left ctrl
    3.44 @@ -226,20 +234,27 @@
    3.45  	mov cx,10846		; 1193180 / 110
    3.46  	call speaker		; Generate sound
    3.47  
    3.48 -	mov word [si],0		; Erase ball
    3.49 +	and word [si],0		; Erase ball
    3.50  	dec byte [bp+balls]	; One ball less
    3.51  	js .1			; All finished? Yes, jump
    3.52  	jmp another_ball	; Start another ball
    3.53  
    3.54  .1:	call wait_frame.2	; Turn off sound
    3.55 +	stc
    3.56  exit:
    3.57 +	pushf
    3.58  	mov ax,0x0003		; Text mode 80x25x16 colors
    3.59  	int 0x10		; Setup
    3.60  	int 0x20		; Exit to DOS / bootOS
    3.61 +	popf
    3.62 +	jc .1
    3.63 +	int 0x19
    3.64 +.1:
    3.65  	jmp start
    3.66  
    3.67  wait_frame:
    3.68  .0:
    3.69 +	hlt                     ; Wait for clock interrupt
    3.70  	mov ah,0x00		; Read ticks
    3.71  	int 0x1a		; Call BIOS
    3.72  	cmp dx,[bp+old_time]	; Wait for change
     4.1 --- a/bootfbird/receipt	Wed Sep 20 13:53:13 2023 +0000
     4.2 +++ b/bootfbird/receipt	Sun Sep 24 17:53:05 2023 +0000
     4.3 @@ -24,12 +24,12 @@
     4.4  genpkg_rules()
     4.5  {
     4.6  	mkdir -p $fs/boot
     4.7 -	cp $src/fbird.img $fs/boot/$PACKAGE
     4.8 +	cp $src/fbird.img $fs/boot/fbird
     4.9  }
    4.10  
    4.11  # Post install/remove commands for Tazpkg.
    4.12  post_install()
    4.13  {
    4.14  	grep -qs ^bootfbird $1/boot/bootmenu ||
    4.15 -	echo "bootfbird	fbird		Bootable flappy bird game (may run under DOS if renamed to fbird.com)" >> $1/boot/bootmenu
    4.16 +	echo "fbird	Fbird,fbird,flappy,bird		Flappy bird (may run under DOS if renamed to fbird.com)" >> $1/boot/bootmenu
    4.17  }
     5.1 --- a/bootfbird/stuff/fbird.asm	Wed Sep 20 13:53:13 2023 +0000
     5.2 +++ b/bootfbird/stuff/fbird.asm	Sun Sep 24 17:53:05 2023 +0000
     5.3 @@ -47,11 +47,10 @@
     5.4          stosw
     5.5          mov al,0x44     ; 'D'
     5.6          stosw
     5.7 -        mov cx,80       ; Introduce 80 columns of scenery
     5.8 -fb1:    push cx
     5.9 -        call scroll_scenery
    5.10 -        pop cx
    5.11 -        loop fb1
    5.12 +        mov bp,80       ; Introduce 80 columns of scenery
    5.13 +fb1:    call scroll_scenery
    5.14 +        dec bp
    5.15 +        jnz fb1
    5.16  
    5.17  fb23:   mov ah,0x01     ; Check if key pressed
    5.18          int 0x16
    5.19 @@ -105,11 +104,10 @@
    5.20          stosw
    5.21          mov al,0x21     ; '!'
    5.22          stosw
    5.23 -        mov cx,100      ; Wait 100 frames
    5.24 -fb20:   push cx
    5.25 -        call wait_frame 
    5.26 -        pop cx
    5.27 -        loop fb20
    5.28 +        mov bp,100      ; Wait 100 frames
    5.29 +fb20:   call wait_frame 
    5.30 +        dec bp
    5.31 +        jnz fb20
    5.32          jmp fb21        ; Restart
    5.33  
    5.34  fb19:   call wait_frame ; Wait for frame
    5.35 @@ -153,7 +151,7 @@
    5.36          mov al,3
    5.37          int 0x10
    5.38          int 0x20        ; Exit to DOS or to oblivion (boot sector)
    5.39 -        jmp restart
    5.40 +        int 0x19
    5.41  fb4:    mov ax,[bird]
    5.42          sub ax,0x10     ; Move bird two rows upward
    5.43          cmp ax,0x08     ; Make sure the bird doesn't fly free outside screen
    5.44 @@ -262,7 +260,8 @@
    5.45  wait_frame:
    5.46  
    5.47          mov bx, tick
    5.48 -fb14:   mov ah,0x00     ; Use base clock tick
    5.49 +fb14:   hlt             ; Wait for clock interrupt
    5.50 +        mov ah,0x00     ; Use base clock tick
    5.51          int 0x1a
    5.52          cmp dx,[bx]
    5.53          jz fb14
     6.1 --- a/bootinvaders/receipt	Wed Sep 20 13:53:13 2023 +0000
     6.2 +++ b/bootinvaders/receipt	Sun Sep 24 17:53:05 2023 +0000
     6.3 @@ -24,12 +24,12 @@
     6.4  genpkg_rules()
     6.5  {
     6.6  	mkdir -p $fs/boot
     6.7 -	cp $src/invaders.img $fs/boot/$PACKAGE
     6.8 +	cp $src/invaders.img $fs/boot/invaders
     6.9  }
    6.10  
    6.11  # Post install/remove commands for Tazpkg.
    6.12  post_install()
    6.13  {
    6.14  	grep -qs ^bootinvaders $1/boot/bootmenu ||
    6.15 -	echo "bootinvaders	invaders		Bootable invaders game (may run under DOS if renamed to invaders.com)" >> $1/boot/bootmenu
    6.16 +	echo "invaders	Invaders,invaders		Invaders (may run under DOS if renamed to invaders.com)" >> $1/boot/bootmenu
    6.17  }
     7.1 --- a/bootinvaders/stuff/invaders.asm	Wed Sep 20 13:53:13 2023 +0000
     7.2 +++ b/bootinvaders/stuff/invaders.asm	Sun Sep 24 17:53:05 2023 +0000
     7.3 @@ -179,6 +179,7 @@
     7.4          mov si,shots                    ; Point to shots list
     7.5          jne in12
     7.6  in22:
     7.7 +        hlt                     ; Wait for clock interrupt
     7.8          mov ah,0x00           
     7.9          int 0x1a                ; BIOS clock read
    7.10          cmp dx,[si+old_time-shots] ; Wait for change
     8.1 --- a/bootmine/receipt	Wed Sep 20 13:53:13 2023 +0000
     8.2 +++ b/bootmine/receipt	Sun Sep 24 17:53:05 2023 +0000
     8.3 @@ -24,12 +24,12 @@
     8.4  genpkg_rules()
     8.5  {
     8.6  	mkdir -p $fs/boot
     8.7 -	cp $src/mine.com $fs/boot/$PACKAGE
     8.8 +	cp $src/mine.com $fs/boot/mine
     8.9  }
    8.10  
    8.11  # Post install/remove commands for Tazpkg.
    8.12  post_install()
    8.13  {
    8.14  	grep -qs ^bootmine $1/boot/bootmenu ||
    8.15 -	echo "bootmine	mine,minesweeper		Bootable minesweeper game (may run under DOS if renamed to mine.com)" >> $1/boot/bootmenu
    8.16 +	echo "mine	Mine,mine		Mine sweeper (may run under DOS if renamed to mine.com)" >> $1/boot/bootmenu
    8.17  }
     9.1 --- a/bootmine/stuff/mine.asm	Wed Sep 20 13:53:13 2023 +0000
     9.2 +++ b/bootmine/stuff/mine.asm	Sun Sep 24 17:53:05 2023 +0000
     9.3 @@ -48,7 +48,7 @@
     9.4  
     9.5  ;; Keyboard ASCII codes
     9.6  %assign Key.Ascii.RestartGame 'r'
     9.7 -%assign Key.Ascii.QuitGame 'q'
     9.8 +%assign Key.Ascii.QuitGame 27
     9.9  
    9.10  ;; This is a convenience macro for creating VGA characters. VGA characters are
    9.11  ;; 16 bit words, with the lower byte as the ASCII value and the upper byte
    9.12 @@ -150,9 +150,14 @@
    9.13  %ifndef USE_RDTSC
    9.14    ; Initialyze the simple pseudo-random number generator
    9.15    ; seed = set_system_time()
    9.16 + %if 1
    9.17    cbw
    9.18    int 0x1a
    9.19    push dx
    9.20 + %else
    9.21 +  in al,(0x40)    ; Read timer
    9.22 +  push ax
    9.23 + %endif
    9.24  %endif
    9.25  
    9.26  ;; Populate text buffer with mines and digits
    9.27 @@ -273,6 +278,10 @@
    9.28    ; http://www.delorie.com/djgpp/doc/rbinter/id/63/17.html
    9.29    xor ax, ax
    9.30    int 0x16
    9.31 +%ifdef DOS_QUIT
    9.32 +  cmp al, Key.Ascii.QuitGame
    9.33 +  je Quit
    9.34 +%endif
    9.35  
    9.36    ; bx and cx are zeroed from the PopulateTextBuf loops above
    9.37    ; bx = y coord
    9.38 @@ -322,10 +331,12 @@
    9.39    int 0x16
    9.40  %ifdef DOS_QUIT
    9.41    cmp al, Key.Ascii.QuitGame
    9.42 -  jnz .notQuit
    9.43 +  jnz Quit.notQuit
    9.44 +Quit:
    9.45    mov ax,0x0003           ; Restore text mode
    9.46    int 0x10
    9.47    int 0x20
    9.48 +  int 0x19
    9.49  .notQuit:
    9.50  %endif
    9.51    cmp al, Key.Ascii.RestartGame
    10.1 --- a/bootpillman/receipt	Wed Sep 20 13:53:13 2023 +0000
    10.2 +++ b/bootpillman/receipt	Sun Sep 24 17:53:05 2023 +0000
    10.3 @@ -24,12 +24,12 @@
    10.4  genpkg_rules()
    10.5  {
    10.6  	mkdir -p $fs/boot
    10.7 -	cp $src/pillman.img $fs/boot/$PACKAGE
    10.8 +	cp $src/pillman.img $fs/boot/pillman
    10.9  }
   10.10  
   10.11  # Post install/remove commands for Tazpkg.
   10.12  post_install()
   10.13  {
   10.14  	grep -qs ^bootpillman $1/boot/bootmenu ||
   10.15 -	echo "bootpillman	pillman		Bootable pillman game (may run under DOS if renamed to pillman.com)" >> $1/boot/bootmenu
   10.16 +	echo "pillman	Pillman,pillman,pacman		Pillman (may run under DOS if renamed to pillman.com)" >> $1/boot/bootmenu
   10.17  }
    11.1 --- a/bootpillman/stuff/pillman.asm	Wed Sep 20 13:53:13 2023 +0000
    11.2 +++ b/bootpillman/stuff/pillman.asm	Sun Sep 24 17:53:05 2023 +0000
    11.3 @@ -84,10 +84,10 @@
    11.4          dw 0b0100_0010_0100_0000
    11.5          dw 0b0111_1110_0111_1110
    11.6          dw 0b0000_0010_0000_0010
    11.7 -        dw 0b0000_0010_0111_1111
    11.8 -        dw 0b0000_0011_1100_0000
    11.9 -        dw 0b0000_0010_0100_0000
   11.10 -        dw 0b0000_0010_0111_1111
   11.11 +        dw 0b0111_1110_0111_1111
   11.12 +        dw 0b0100_0011_1100_0000
   11.13 +        dw 0b0100_0010_0100_0000
   11.14 +        dw 0b0111_1110_0111_1111
   11.15          dw 0b0000_0010_0100_0000
   11.16          dw 0b0111_1111_1111_1110
   11.17          dw 0b0100_0010_0000_0010
   11.18 @@ -248,6 +248,7 @@
   11.19          ; Main game loop
   11.20          ;
   11.21  game_loop:
   11.22 +        hlt                     ; Wait for clock interrupt
   11.23          mov ah,0x00
   11.24          int 0x1a                ; BIOS clock read
   11.25          cmp dx,[bp+old_time_]   ; Wait for time change
   11.26 @@ -259,22 +260,22 @@
   11.27          cbw                     ; BIOS Read Key
   11.28          je no_key
   11.29          int 0x16
   11.30 -no_key:
   11.31 +        dec ah
   11.32          mov al,ah
   11.33 -        cmp al,0x01             ; Esc key
   11.34          jne no_esc
   11.35 -        mov ax,0x0003           ; Restore text mode
   11.36 +        mov al,0x03             ; Restore text mode
   11.37          int 0x10
   11.38          int 0x20
   11.39 +        int 0x19
   11.40  no_esc:
   11.41 -        sub al,0x48             ; Code for arrow up?
   11.42 -        jc no_key2              ; Out of range, jump.
   11.43 +        sub al,0x48-1           ; Code for arrow up?
   11.44 +        jc no_key               ; Out of range, jump.
   11.45          cmp al,0x09             ; Farther than arrow down?
   11.46 -        jnc no_key2             ; Out of range, jump.
   11.47 +        jnc no_key              ; Out of range, jump.
   11.48          lea bx,[bp+dirs_]
   11.49          cs xlat                 ; Translate direction to internal code
   11.50          mov [intended_dir],al   ; Save as desired direction
   11.51 -no_key2:
   11.52 +no_key:
   11.53          mov si,pos1             ; SI points to data for player
   11.54          lodsw                   ; Load screen position
   11.55          xchg ax,di
    12.1 --- a/bootris/receipt	Wed Sep 20 13:53:13 2023 +0000
    12.2 +++ b/bootris/receipt	Sun Sep 24 17:53:05 2023 +0000
    12.3 @@ -24,12 +24,12 @@
    12.4  genpkg_rules()
    12.5  {
    12.6  	mkdir -p $fs/boot
    12.7 -	cp $src/tetranglix.img $fs/boot/$PACKAGE
    12.8 +	cp $src/tetranglix.img $fs/boot/tetris
    12.9  }
   12.10  
   12.11  # Post install/remove commands for Tazpkg.
   12.12  post_install()
   12.13  {
   12.14  	grep -qs ^bootris $1/boot/bootmenu ||
   12.15 -	echo "bootris	tetris		Bootable tetris game (may run under DOS if renamed to tetris.com)" >> $1/boot/bootmenu
   12.16 +	echo "tetris	Tetris,tetris		Tetris (may run under DOS if renamed to tetris.com)" >> $1/boot/bootmenu
   12.17  }
    13.1 --- a/bootris/stuff/tetranglix.asm	Wed Sep 20 13:53:13 2023 +0000
    13.2 +++ b/bootris/stuff/tetranglix.asm	Sun Sep 24 17:53:05 2023 +0000
    13.3 @@ -59,7 +59,7 @@
    13.4      ; White spaces on black background.
    13.5      xor di, di
    13.6      mov ax, 0x0F00
    13.7 -    mov cx, ax                   ; At least 80x25x2.
    13.8 +    mov ch, 8                    ; At least 80x25x2.
    13.9      rep stosw
   13.10      call pop_check
   13.11  
   13.12 @@ -89,7 +89,10 @@
   13.13      ; Calculate first index into screen.
   13.14      lodsw
   13.15      aad 0x10
   13.16 -    cmp byte [si-1], 0x10
   13.17 +
   13.18 +    mov cl, 0x10
   13.19 +
   13.20 +    cmp [si-1], cl
   13.21      sbb ah, ah
   13.22      xchg bx, ax
   13.23      lea di, [si + (STACK - OFFSET) + 0xFE + bx]
   13.24 @@ -97,8 +100,6 @@
   13.25  
   13.26      mov si, CUR_TETRAMINO
   13.27  
   13.28 -    mov cl, 0x10
   13.29 -
   13.30      .loop:
   13.31          test cl, 0x13;0b1011
   13.32          jnz .load_loop
   13.33 @@ -148,6 +149,14 @@
   13.34      or [di], al
   13.35      ret
   13.36  
   13.37 +exit_game_over:
   13.38 +    je start
   13.39 +exit_dos:
   13.40 +    mov al,0x03           ; Clear screen
   13.41 +    int 0x10
   13.42 +    int 0x20              ; Return to bootOS
   13.43 +    int 0x19
   13.44 +
   13.45  ; All tetraminos in bitmap format.
   13.46  tetraminos:
   13.47      db 0xF0;0b11110000   ; I
   13.48 @@ -196,6 +205,7 @@
   13.49  .busy_loop2:
   13.50          pushf
   13.51  .busy_loop1:
   13.52 +        hlt                 ; Wait for clock interrupt
   13.53          mov ah,0x00
   13.54          int 0x1a
   13.55          cmp [bx],dx
   13.56 @@ -205,7 +215,7 @@
   13.57          cmc
   13.58          jc .busy_loop2
   13.59          pop dx
   13.60 -        xor cx,cx       ; Or rotation doesn't work
   13.61 +        xor cx,cx           ; Or rotation doesn't work
   13.62      %endif
   13.63          ; If we don't need to load a new tetramino, yayy!
   13.64          test dl, dl
   13.65 @@ -267,37 +277,30 @@
   13.66  
   13.67          .exit:
   13.68              dec ah
   13.69 -            jne .left
   13.70 -
   13.71 -        .exit_dos:
   13.72 -            mov al,0x03           ; Clear screen
   13.73 -            int 0x10
   13.74 -            int 0x20              ; Return to bootOS
   13.75 -            jmp start
   13.76 +            je exit_dos
   13.77 +            mov al, ah
   13.78  
   13.79          ; Go left.
   13.80          .left:
   13.81 -            cmp ah, LEFT_SCANCODE-1
   13.82 -            jne .right
   13.83 -
   13.84 -            dec byte [si]
   13.85 -            jmp .call_bp
   13.86 +            cmp al, LEFT_SCANCODE-1
   13.87 +            je .call_bp
   13.88  
   13.89          ; Go right.
   13.90          .right:
   13.91 -            cmp ah, RIGHT_SCANCODE-1
   13.92 +            cmp al, RIGHT_SCANCODE-1
   13.93              jne .rotate
   13.94  
   13.95 -            inc byte [si]
   13.96 +            add byte [si],2
   13.97  
   13.98          .call_bp:
   13.99 -            xor ah, (LEFT_SCANCODE-1) ^ (RIGHT_SCANCODE-1)
  13.100 +            dec byte [si]
  13.101 +            xor al, (LEFT_SCANCODE-1) ^ (RIGHT_SCANCODE-1)
  13.102              call bp
  13.103              jc .left
  13.104  
  13.105          ; Rotate it.
  13.106          .rotate:
  13.107 -            cmp ah, UP_SCANCODE-1
  13.108 +            cmp al, UP_SCANCODE-1
  13.109              jne .vertical_increment
  13.110  
  13.111              inc cx
  13.112 @@ -408,8 +411,9 @@
  13.113          .game_over:             ; Game Over
  13.114              xor ax, ax
  13.115              int 0x16            ; wait for and key
  13.116 -            jmp .exit_dos
  13.117 -            
  13.118 +            dec ah
  13.119 +            jmp exit_game_over
  13.120 +           
  13.121          .next_iter:             
  13.122              ; Display the stack.
  13.123              push si
    14.1 --- a/bootsokoban/receipt	Wed Sep 20 13:53:13 2023 +0000
    14.2 +++ b/bootsokoban/receipt	Sun Sep 24 17:53:05 2023 +0000
    14.3 @@ -24,12 +24,12 @@
    14.4  genpkg_rules()
    14.5  {
    14.6  	mkdir -p $fs/boot
    14.7 -	cp $src/sokoban.img $fs/boot/$PACKAGE
    14.8 +	cp $src/sokoban.img $fs/boot/sokoban
    14.9  }
   14.10  
   14.11  # Post install/remove commands for Tazpkg.
   14.12  post_install()
   14.13  {
   14.14  	grep -qs ^bootsokoban $1/boot/bootmenu ||
   14.15 -	echo "bootsokoban	sokoban,digger		Bootable sokoban game (may run under DOS if renamed to sokoban.com)" >> $1/boot/bootmenu
   14.16 +	echo "sokoban	Sokoban,sokoban		Sokoban (may run under DOS if renamed to sokoban.com)" >> $1/boot/bootmenu
   14.17  }
    15.1 --- a/bootsokoban/stuff/sokoban.asm	Wed Sep 20 13:53:13 2023 +0000
    15.2 +++ b/bootsokoban/stuff/sokoban.asm	Sun Sep 24 17:53:05 2023 +0000
    15.3 @@ -5,9 +5,13 @@
    15.4  %define CURRENT_LEVEL_4 0x7E04
    15.5  %define SCREEN_DS 0xb800
    15.6  
    15.7 +%define MOVE_COUNT
    15.8 +
    15.9  boot:
   15.10      ; clear screen (re-set text mode)
   15.11 -    mov ax, 0x0003  ; text mode 80x25 16 colours
   15.12 +    mov ax, 0x0001  ; text mode 40x25 16 colours
   15.13 +%define COLS  40
   15.14 +%define LINES 25
   15.15      int 0x10
   15.16  
   15.17      ; disable cursor
   15.18 @@ -37,60 +41,61 @@
   15.19  ;  0000 1000 PLAYER
   15.20  ;  0000 1001 PLAYER ON SPOT
   15.21  test_level:
   15.22 -    ; this was the original level format, which was quite big:
   15.23  
   15.24 -    ; db 9, 7 ; width, height
   15.25 -    ; dw 32 ; playerxy
   15.26 -    ; db 4,4,4,4,4,4,0,0,0
   15.27 -    ; db 4,0,0,0,0,4,0,0,0
   15.28 -    ; db 4,0,0,2,0,4,4,0,0
   15.29 -    ; db 4,0,2,4,1,9,4,4,4
   15.30 -    ; db 4,4,0,0,3,1,2,0,4
   15.31 -    ; db 0,4,0,0,0,0,0,0,4
   15.32 -    ; db 0,4,4,4,4,4,4,4,4
   15.33 -    ; db 14, 10 ;width, height
   15.34 -    ; dw 63     ;playerxy
   15.35 +%define p(a,b,c) ((c&7)+((b&7)*6)+((a&7)*6*6))
   15.36 +%if 1
   15.37 +    db 15, 14 ;width, height
   15.38 +    dw 15*7+13     ;playerxy
   15.39 +%define PLAYER 9
   15.40 +    db p(4,4,4), p(4,5,5), p(5,5,5), p(4,4,4), p(4,5,5)
   15.41 +    db p(4,0,0), p(4,4,4), p(4,4,4), p(4,1,1), p(4,4,4)
   15.42 +    db p(4,0,2), p(0,2,0), p(2,0,0), p(4,1,1), p(1,1,4)
   15.43 +    db p(4,0,2), p(0,0,0), p(2,2,0), p(4,3,3), p(3,1,4)
   15.44 +    db p(4,0,2), p(0,2,0), p(2,0,0), p(4,1,1), p(3,1,4)
   15.45 +    db p(4,0,0), p(2,0,2), p(0,2,0), p(4,3,1), p(3,1,4)
   15.46 +    db p(4,4,0), p(2,0,2), p(0,2,0), p(1,3,1), p(3,1,4)
   15.47 +    db p(4,0,0), p(2,0,2), p(0,2,0), p(1,3,1), p(3,PLAYER,4)
   15.48 +    db p(4,0,0), p(2,0,2), p(0,2,0), p(4,3,1), p(3,1,4)
   15.49 +    db p(4,0,2), p(0,2,0), p(2,0,0), p(4,1,1), p(3,1,4)
   15.50 +    db p(4,0,2), p(0,0,0), p(2,2,0), p(4,3,3), p(3,1,4)
   15.51 +    db p(4,0,2), p(0,2,0), p(2,0,0), p(4,1,1), p(1,1,4)
   15.52 +    db p(4,0,0), p(4,4,4), p(4,4,4), p(4,1,1), p(4,4,4)
   15.53 +    db p(4,4,4), p(4,5,5), p(5,5,5), p(4,4,4), p(4,5,5)
   15.54 +%else
   15.55 +    db 21, 18 ;width, height
   15.56 +    dw 21+8     ;playerxy
   15.57 +%define PLAYER 8
   15.58 +    db p(5,5,5), p(5,5,5), p(5,4,4), p(4,5,5), p(5,5,5), p(5,5,5), p(5,5,5)
   15.59 +    db p(5,5,4), p(4,4,4), p(4,0,8), p(0,4,4), p(4,4,4), p(4,4,5), p(5,5,5)
   15.60 +    db p(5,5,4), p(0,0,0), p(4,0,2), p(0,4,0), p(0,0,0), p(0,4,4), p(5,5,5)
   15.61 +    db p(5,4,4), p(0,2,0), p(4,4,0), p(0,4,2), p(0,0,0), p(0,0,4), p(4,5,5)
   15.62 +    db p(5,4,0), p(2,0,2), p(0,4,0), p(0,4,0), p(2,4,4), p(0,2,0), p(4,5,5)
   15.63 +    db p(4,4,0), p(3,1,1), p(0,4,4), p(0,4,2), p(0,4,4), p(2,0,0), p(4,5,5)
   15.64 +    db p(4,0,2), p(1,1,3), p(0,0,4), p(0,4,0), p(2,0,0), p(0,0,4), p(4,5,5)
   15.65 +    db p(4,0,3), p(2,4,2), p(3,0,4), p(2,0,0), p(0,2,0), p(0,4,4), p(5,5,5)
   15.66 +    db p(4,1,1), p(0,4,0), p(1,1,4), p(0,0,4), p(4,4,2), p(4,4,5), p(5,5,5)
   15.67 +    db p(4,0,4), p(4,4,4), p(4,0,4), p(0,2,0), p(0,2,0), p(0,4,4), p(5,5,5)
   15.68 +    db p(4,0,2), p(0,4,0), p(2,0,0), p(2,0,2), p(0,2,0), p(2,0,4), p(4,5,5)
   15.69 +    db p(4,0,1), p(1,4,1), p(1,0,2), p(0,4,0), p(0,0,2), p(0,2,0), p(4,5,5)
   15.70 +    db p(4,0,1), p(1,2,1), p(1,0,4), p(0,4,0), p(2,4,4), p(0,0,0), p(4,5,5)
   15.71 +    db p(4,0,1), p(1,1,1), p(1,2,4), p(0,4,0), p(0,0,0), p(0,2,0), p(4,5,5)
   15.72 +    db p(4,0,1), p(1,1,1), p(1,0,4), p(0,4,2), p(2,2,0), p(2,0,4), p(4,5,5)
   15.73 +    db p(4,0,1), p(1,1,1), p(1,2,4), p(0,4,0), p(0,0,0), p(0,4,4), p(5,5,5)
   15.74 +    db p(4,0,1), p(1,1,1), p(1,0,4), p(0,4,4), p(4,4,4), p(4,4,5), p(5,5,5)
   15.75 +    db p(5,4,4), p(4,4,4), p(4,4,5), p(4,5,5), p(5,5,5), p(5,5,5), p(5,5,5)
   15.76 +%endif
   15.77  
   15.78 -    ; when i tried to put in THIS level (from https://www.youtube.com/watch?v=fg8QImlvB-k)
   15.79 -    ; i passed the 512 byte limit...
   15.80  
   15.81 -    ; db 4,4,4,4,4,4,4,4,4,4,4,4,0,0
   15.82 -    ; db 4,1,1,0,0,4,0,0,0,0,0,4,4,4
   15.83 -    ; db 4,1,1,0,0,4,0,2,0,0,2,0,0,4
   15.84 -    ; db 4,1,1,0,0,4,2,4,4,4,4,0,0,4
   15.85 -    ; db 4,1,1,0,0,0,0,8,0,4,4,0,0,4
   15.86 -    ; db 4,1,1,0,0,4,0,4,0,0,2,0,4,4
   15.87 -    ; db 4,4,4,4,4,4,0,4,4,2,0,2,0,4
   15.88 -    ; db 0,0,4,0,2,0,0,2,0,2,0,2,0,4
   15.89 -    ; db 0,0,4,0,0,0,0,4,0,0,0,0,0,4
   15.90 -    ; db 0,0,4,4,4,4,4,4,4,4,4,4,4,4
   15.91 -
   15.92 -    ; so i compressed it! high nybble first, low nybble second
   15.93 -    db 14, 10 ;width, height
   15.94 -    dw 63     ;playerxy
   15.95 -    db 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x00
   15.96 -    db 0x41, 0x10, 0x04, 0x00, 0x00, 0x04, 0x44
   15.97 -    db 0x41, 0x10, 0x04, 0x02, 0x00, 0x20, 0x04
   15.98 -    db 0x41, 0x10, 0x04, 0x24, 0x44, 0x40, 0x04
   15.99 -    db 0x41, 0x10, 0x00, 0x08, 0x04, 0x40, 0x04
  15.100 -    db 0x41, 0x10, 0x04, 0x04, 0x00, 0x20, 0x44
  15.101 -    db 0x44, 0x44, 0x44, 0x04, 0x42, 0x02, 0x04
  15.102 -    db 0x00, 0x40, 0x20, 0x02, 0x02, 0x02, 0x04
  15.103 -    db 0x00, 0x40, 0x00, 0x04, 0x00, 0x00, 0x04
  15.104 -    db 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
  15.105 -
  15.106 -
  15.107 -
  15.108 -display_chars: db 0,   0x07 ; blank
  15.109 -               db 249, 0x07 ; spot
  15.110 -               db 4,   0x0C ; brick
  15.111 -               db 4,   0x0A ; brick on spot
  15.112 -               db 178, 0x71 ; wall
  15.113 -               db "5", 0x07 ; (no 5)
  15.114 -               db "6", 0x07 ; (no 6)
  15.115 -               db "7", 0x07 ; (no 7)
  15.116 -               db 1,   0x0F ; player
  15.117 -               db 1,   0x0F ; player on spot
  15.118 +display_chars: db 0,    0x07 ; blank
  15.119 +               db 249,  0x07 ; spot
  15.120 +               db 0xFE, 0x0A ; brick
  15.121 +               db 0xFE, 0x0C ; brick on spot
  15.122 +               db 176,  0x71 ; wall
  15.123 +               db 0,    0x07 ; out blank 
  15.124 +               db "6",  0x07 ; (no 6)
  15.125 +               db "7",  0x07 ; (no 7)
  15.126 +               db 1,    0x0F ; player
  15.127 +               db 1,    0x0F ; player on spot
  15.128  
  15.129  str_you_win: db 'YOU WIN! ',1,1,1,0
  15.130  
  15.131 @@ -101,38 +106,38 @@
  15.132      mov si, bp
  15.133  
  15.134      ; get width and height and multiply by each other
  15.135 -    mov ax, [cs:si]
  15.136 +    lodsw
  15.137 +
  15.138 +    mov di, CURRENT_LEVEL ; next address to copy to
  15.139 +
  15.140 +    ; copy map size and player position ("uncompressed")
  15.141 +    stosw
  15.142      mul ah
  15.143  
  15.144      ; set multiplied width and height + 4 as counter
  15.145      mov cx, ax
  15.146      ;add cx, 4
  15.147  
  15.148 -    mov di, CURRENT_LEVEL ; next address to copy to
  15.149 +    lodsw
  15.150 +    stosw
  15.151  
  15.152 -    ; copy map size and player position ("uncompressed")
  15.153 -    cs movsw
  15.154 -    cs movsw
  15.155 +    xchg ax,bx
  15.156 +    add bx,di		;save player location
  15.157 +    mov dx,36*256+6
  15.158  
  15.159  .copy_level_loop:
  15.160 -    ; load "compressed" byte: e.g. 0x28 or 0x44 into AL
  15.161 -    cs lodsb
  15.162 -%if 0
  15.163 -    aam 16
  15.164 -    xchg al, ah
  15.165 -%else
  15.166 -    mov ah, al     ; AX = 0x2828
  15.167 -    and ax, 0x0FF0 ; AX = 0x0820 (little endian: 20 08)
  15.168 -    push cx
  15.169 -    mov cl, 4
  15.170 -    shr al, cl     ; AX = 0x0802 (little endian: 02 08)
  15.171 -    pop cx
  15.172 -%endif
  15.173 -
  15.174 -    ; save "uncompressed" word: e.g. 02 08 or 04 04 from AX
  15.175 -    stosw
  15.176 +    ; load one "compressed" byte and store 3 "uncompressed" bytes
  15.177 +    lodsb
  15.178 +    mov ah,0
  15.179 +    div dh
  15.180 +    stosb	; p/6/6
  15.181 +    mov al,ah
  15.182 +    cbw
  15.183 +    div dl
  15.184 +    stosw	; p/6%6 p%6
  15.185  
  15.186      loop .copy_level_loop
  15.187 +    mov byte [bx],PLAYER
  15.188  
  15.189      call draw_current_level
  15.190  
  15.191 @@ -145,10 +150,10 @@
  15.192      dec ah ; esc
  15.193      jne .not_boot
  15.194  .exit:
  15.195 -    mov ax, 0x0003  ; text mode 80x25 16 colours
  15.196 +    mov al, 0x03  ; text mode 80x25 16 colours
  15.197      int 0x10
  15.198      int 0x20
  15.199 -    jmp boot
  15.200 +    int 0x19
  15.201      
  15.202  .not_boot:
  15.203      cmp ah, 0x50-1 ; down arrow
  15.204 @@ -169,18 +174,16 @@
  15.205      neg al
  15.206  .try_move_right:
  15.207  .try_move_down:
  15.208 -%if 1
  15.209 -SCORE_DIGITS    EQU 4
  15.210 +%ifdef MOVE_COUNT
  15.211      push ax
  15.212      push ds
  15.213      mov bx, SCREEN_DS
  15.214      mov ds, bx
  15.215 -    mov bx, SCORE_DIGITS * 2
  15.216 +    mov bx, COLS + 2 + (LINES-1)*COLS*2
  15.217  
  15.218  .chk_score:
  15.219      dec bx
  15.220      dec bx
  15.221 -    js .exit
  15.222      mov al, '0'
  15.223      xchg [bx], al
  15.224      or al, 0x30
  15.225 @@ -227,7 +230,7 @@
  15.226      ; destination position on screen
  15.227      mov ax, SCREEN_DS
  15.228      mov es, ax
  15.229 -    mov di, (80 * 12 + 40 - 6) * 2
  15.230 +    mov di, (COLS * 12 + COLS/2 - 6) * 2
  15.231  
  15.232      mov ah, 0x0F
  15.233  .loop:
  15.234 @@ -246,7 +249,7 @@
  15.235  
  15.236      dec ah ; esc
  15.237      je get_data.exit
  15.238 -    jmp wait_for_esc
  15.239 +    jmp boot
  15.240  ; halt:
  15.241  ;     cli ; clear interrupt flag
  15.242  ;     hlt ; halt execution
  15.243 @@ -260,7 +263,7 @@
  15.244      push cx ; put it in the stack for later reuse
  15.245  
  15.246      ; print in the middle and not in the corner
  15.247 -    mov di, 2000; middle of screen
  15.248 +    mov di, 25*COLS; middle of screen
  15.249  
  15.250      ; offset by half of width
  15.251      mov bx, 0x00FE
  15.252 @@ -270,7 +273,7 @@
  15.253      ; offset by half of height
  15.254      mov cl, ch
  15.255      and cx, 0x00FE
  15.256 -    mov ax, 80
  15.257 +    mov ax, COLS
  15.258      mul cx
  15.259      sub di, ax
  15.260  
  15.261 @@ -287,7 +290,7 @@
  15.262      cbw
  15.263      xchg ax, si
  15.264      add si, si
  15.265 -    mov ax, [cs:bp+si+display_chars-test_level]
  15.266 +    mov ax, [bp+si+display_chars-test_level]
  15.267      pop si
  15.268      
  15.269      stosw
  15.270 @@ -308,7 +311,7 @@
  15.271      ; jump to next row down
  15.272      xor ch, ch
  15.273      neg cx
  15.274 -    add cx, 80
  15.275 +    add cx, COLS
  15.276      add cx, cx
  15.277      add di, cx
  15.278  
  15.279 @@ -320,7 +323,6 @@
  15.280  try_move:
  15.281      ; try to move the player
  15.282      ; al = offset of how much to move by
  15.283 -    push dx
  15.284  
  15.285      ; extend al into ax (signed)
  15.286      test al, al ; check if negative
  15.287 @@ -416,8 +418,6 @@
  15.288      mov [di - 2], bx
  15.289  
  15.290  .finished:
  15.291 -
  15.292 -    pop dx
  15.293      ret
  15.294  
  15.295  
    16.1 --- a/linux/stuff/bundle	Wed Sep 20 13:53:13 2023 +0000
    16.2 +++ b/linux/stuff/bundle	Sun Sep 24 17:53:05 2023 +0000
    16.3 @@ -49,7 +49,7 @@
    16.4  	pos=$(($pos+${#2}+1))
    16.5  	shift 2
    16.6  	free=$((0x1F1 - 2 - $pos - $crc))
    16.7 -	while [ -n "$2" -a $free -ge ${#2} ]; do
    16.8 +	while [ -n "$2" -a $((free-=${#2}+4+$crc)) -ge 0 ]; do
    16.9  		echo "$((($(stat -Lc "%s" "$1")+511)/512))?$1?$2"
   16.10  		shift 2
   16.11  	done | awk -F? 'BEGIN { nxt=1; i=0 }
    17.1 --- a/linux/stuff/bundle.S	Wed Sep 20 13:53:13 2023 +0000
    17.2 +++ b/linux/stuff/bundle.S	Sun Sep 24 17:53:05 2023 +0000
    17.3 @@ -17,17 +17,17 @@
    17.4  	pushw	%cx			// bootloader may want to pull 0
    17.5  	movw	$0x78, %bx
    17.6  	movw	%cx, %ds
    17.7 -	ldsw	(%bx), %si	
    17.8 +	ldsw	(%bx), %si		// %ds:0x78 is parameter table address
    17.9  	pushw	%ss
   17.10  	popw	%es
   17.11 -	movb	$6, %cl
   17.12 +	movb	$6, %cl			// copy 12 bytes
   17.13  	pushw	%di
   17.14  	rep
   17.15  	 movsw
   17.16 -	movb	$63, %es:4-12(%di)
   17.17 +	movb	$63, %es:4-12(%di)	// patch max sector count
   17.18  	movw	%cx, %ds
   17.19  	popw	(%bx)
   17.20 -	movw	%es, 2(%bx)
   17.21 +	movw	%es, 2(%bx)		// update parameter table address
   17.22  
   17.23  	// data segments setup
   17.24  	movw	$0x7C0, %ax
   17.25 @@ -43,39 +43,42 @@
   17.26  	incw	%bp
   17.27  menustartlp:
   17.28  	movw	$3, %ax
   17.29 -	int	$0x10		// clear screen
   17.30 +	int	$0x10			// clear screen
   17.31  	movb	$1, %ah
   17.32  	movw	$0x1000, %cx
   17.33 -	int	$0x10		// clear cursor
   17.34 +	int	$0x10			// clear cursor
   17.35  	movw	$menu, %si
   17.36  	call	puts
   17.37  	call	putcr
   17.38  	movw	%bp, %cx
   17.39  menulp:
   17.40 +
   17.41  	.macro	entry
   17.42 -	movb	$' ', %bl
   17.43 +	movb	$' ', %bl		// not selected by default
   17.44  	lodsw
   17.45  	loop	notcur
   17.46  	xchgw	%ax, %di
   17.47 -	movb	$'>', %bl
   17.48 +	movb	$'>', %bl		// selected when cx = 0
   17.49  notcur:
   17.50  	xchgw	%ax, %bx
   17.51  	.endm
   17.52 +
   17.53  #ifdef CHECK_FILES
   17.54  	call	putentry
   17.55 -	lodsw		// CRC16
   17.56 -	lodsw		// sector count
   17.57 +	lodsw				// CRC16
   17.58 +	lodsw				// sector count
   17.59  #else
   17.60  	entry
   17.61  	call	putcs
   17.62  #endif
   17.63 -	cmpw	$0, (%si)
   17.64 +	cmpw	$0, (%si)		// end of list ?
   17.65  	jne	menulp
   17.66  #ifdef CHECK_FILES
   17.67  	movw	$msgcrc-2, %si
   17.68  	call	putentry
   17.69  #endif
   17.70  menustartz:
   17.71 +
   17.72  	.macro	waitkbdcode
   17.73  #ifdef TIMEOUT
   17.74  clock	= 0x46C
   17.75 @@ -104,6 +107,7 @@
   17.76  	int	$0x16
   17.77  #endif
   17.78  	.endm
   17.79 +
   17.80  #ifdef CHECK_FILES
   17.81  	call	wait4kbd
   17.82  #else
   17.83 @@ -174,14 +178,18 @@
   17.84  scanboot:
   17.85  	incw	%bx
   17.86  	cmpw	$0x5897, -3(%bx)	// xchgw %ax, %di; popw	%ax
   17.87 -	jne	scanboot
   17.88 +	jne	nofound
   17.89  	cmpw	$0xE841, -1(%bx)	// incw %cx ; call ...
   17.90 -	jne	scanboot
   17.91 +	je	found
   17.92 +nofound:
   17.93 +	orb	%bl, %bl
   17.94 +	jnz	scanboot
   17.95 +	decb	%bh
   17.96  found:
   17.97  	pushw	%ds
   17.98  	pushw	%bx
   17.99 -	cli
  17.100 -	movb	0x1F1+BUFFER, %al	// setup size
  17.101 +//	cli
  17.102 +//	movb	0x1F1+BUFFER, %al	// setup size
  17.103  	pushw	%ss
  17.104  	popw	%ds
  17.105  	pushw	%ss
    18.1 --- a/memtest/receipt	Wed Sep 20 13:53:13 2023 +0000
    18.2 +++ b/memtest/receipt	Sun Sep 24 17:53:05 2023 +0000
    18.3 @@ -59,5 +59,5 @@
    18.4  post_install()
    18.5  {
    18.6  	grep -qs ^memtest $1/boot/bootmenu ||
    18.7 -	echo "memtest	Memtest,test,mem	Check memory (may run under DOS, in real mode or with emm386, if renamed to memtest.exe)" >> $1/boot/bootmenu
    18.8 +	echo "memtest	Memtest,memtest,mem,test	Check memory (may run under DOS, in real mode or with emm386, if renamed to memtest.exe)" >> $1/boot/bootmenu
    18.9  }
    19.1 --- a/plop/receipt	Wed Sep 20 13:53:13 2023 +0000
    19.2 +++ b/plop/receipt	Sun Sep 24 17:53:05 2023 +0000
    19.3 @@ -55,5 +55,5 @@
    19.4  post_install()
    19.5  {
    19.6  	grep -qs ^plop $1/boot/bootmenu ||
    19.7 -	echo "plop	Plop,boot	Boot manager (may run under DOS, in real mode or with emm386, if renamed to plop.exe)" >> $1/boot/bootmenu
    19.8 +	echo "plop	Plop,plop,boot,usb	Boot manager (may run under DOS, in real mode or with emm386, if renamed to plop.exe)" >> $1/boot/bootmenu
    19.9  }