# HG changeset patch # User Pascal Bellard # Date 1663833537 0 # Node ID 78727b04c00275cbf105e820de76a2ad2e3460af # Parent ec9531d04de1ae326bac4a7c183474c3661df847 oldrunner: add apple2 keys mapping diff -r ec9531d04de1 -r 78727b04c002 BootProg/receipt --- a/BootProg/receipt Sat Sep 17 08:17:46 2022 +0000 +++ b/BootProg/receipt Thu Sep 22 07:58:57 2022 +0000 @@ -8,17 +8,17 @@ LICENSE="MIT" WEB_SITE="https://wiki.osdev.org/BootProg" -BUILD_DEPENDS="nasm lzma" +BUILD_DEPENDS="nasm xz" # Rules to configure and make the package. compile_rules() { mkdir -p $src && cd $src - sed '1,/^exit 1/!d' $stuff/bootprog.sh > bootprog + sed '1,/^exit/!d' $stuff/bootprog.sh > bootprog for i in boot16 boot32 bootex ; do cp $stuff/$i.asm . nasm $i.asm -f bin -o $i.bin -l $i.lst && cat $i.bin - done | lzma -9 >> bootprog + done | xz -z --format=lzma --lzma1=lc=0,pb=0,nice=102,dict=4k >> bootprog chmod +x bootprog } diff -r ec9531d04de1 -r 78727b04c002 BootProg/stuff/boot16.asm --- a/BootProg/stuff/boot16.asm Sat Sep 17 08:17:46 2022 +0000 +++ b/BootProg/stuff/boot16.asm Thu Sep 22 07:58:57 2022 +0000 @@ -65,7 +65,7 @@ ;; Boot Image Startup (register values): ;; ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;; ;; ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier), ;; -;; bx = cx = 0, dl = BIOS boot drive number (e.g. 0, 80H) ;; +;; bx = 0, dl = BIOS boot drive number (e.g. 0, 80H) ;; ;; cs:ip = program entry point ;; ;; ss:sp = program stack (don't confuse with boot sector's stack) ;; ;; COM program defaults: cs = ds = es = ss = 50h, sp = 0, ip = 100h ;; @@ -261,7 +261,7 @@ FindNameCycle: push di - mov cl, 11 + mov cl, NameLength mov si, ProgramName ; ds:si -> program name repe cmpsb pop di @@ -306,9 +306,14 @@ FAT12 equ 1 FAT16 equ 1 +TINYFAT16 equ 1 push di ; up to 2 * 635K / BytesPerCluster = 2540 bytes %if FAT12 == 1 + %if TINYFAT16 == 0 && FAT16 == 1 + mov cl, 12 + %else mov cl, 4 + %endif %endif ClusterLoop: mov [di], si @@ -320,7 +325,11 @@ First64k: %if FAT12 == 1 mov dx, 0FFF8h + %if TINYFAT16 == 1 test [bx(bsFileSystem+4)], cl ; FAT12 or FAT16 ? clear C + %else + cmp [bx(bpbSectorsPerFAT)], cx ; 1..12 = FAT12, 16..256 = FAT16 + %endif jne ReadClusterFat16 mov dh, 0Fh %endif @@ -340,22 +349,24 @@ %endif %if FAT12 == 1 jnc ReadClusterEven + %if TINYFAT16 == 0 && FAT16 == 1 + rol ax, cl + %else shr ax, cl + %endif ReadClusterEven: -%endif scasw ; di += 2 -%if FAT12 == 1 && FAT16 == 1 + %if FAT16 == 1 and ah, dh ; mask cluster value cmp ax, dx -%else - %if FAT12 == 1 + %else and ah, 0Fh ; mask cluster value cmp ax, 0FF8h - %else + %endif +%else + scasw ; di += 2 cmp ax, 0FFF8h - %endif %endif - xchg ax, si jc ClusterLoop pop si @@ -379,13 +390,13 @@ dec ax dec ax - mov cl, [bx(bpbSectorsPerCluster)] + mov cl, [bx(bpbSectorsPerCluster)] ; 1..128 mul cx ; cx = sector count (ch = 0) add ax, bp ; LBA for cluster data adc dx, bx ; dx:ax = LBA - call ReadSector ; clear ax & cx, restore dx + call ReadSector ; clear ax, restore dx jne ReadClusters @@ -406,8 +417,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Setup and run a .COM program ;; ;; Set CS=DS=ES=SS SP=0 IP=100h ;; -;; AX=0ffffh BX=0 CX=0 DX=drive ;; -;; and cmdline=void ;; +;; AX=0ffffh BX=0 DX=drive and ;; +;; cmdline=void ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov di, 100h ; ip @@ -421,7 +432,7 @@ ;; Relocate, setup and run a .EXE program ;; ;; Set CS:IP, SS:SP, DS, ES and AX according ;; ;; to wiki.osdev.org/MZ#Initial_Program_State ;; -;; AX=0ffffh BX=0 CX=0 DX=drive cmdline=void ;; +;; AX=0ffffh BX=0 DX=drive cmdline=void ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ReloCycle: @@ -639,6 +650,7 @@ ProgramName db "STARTUP BIN" ; name and extension each must be times (510-($-$$)) db ' ' ; padded with spaces (11 bytes total) +NameLength equ $-ProgramName ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of the sector ID ;; diff -r ec9531d04de1 -r 78727b04c002 BootProg/stuff/boot32.asm --- a/BootProg/stuff/boot32.asm Sat Sep 17 08:17:46 2022 +0000 +++ b/BootProg/stuff/boot32.asm Thu Sep 22 07:58:57 2022 +0000 @@ -60,7 +60,7 @@ ;; Boot Image Startup (register values): ;; ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;; ;; ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier), ;; -;; bx = cx = 0, dl = BIOS boot drive number (e.g. 0, 80H) ;; +;; bx = 0, dl = BIOS boot drive number (e.g. 0, 80H) ;; ;; cs:ip = program entry point ;; ;; ss:sp = program stack (don't confuse with boot sector's stack) ;; ;; COM program defaults: cs = ds = es = ss = 50h, sp = 0, ip = 100h ;; @@ -234,7 +234,7 @@ je ErrFind ; end of root directory (NULL entry found) %endif pusha - mov cl, 11 + mov cl, NameLength mov si, ProgramName ; ds:si -> program name repe cmpsb je FindNameFound @@ -289,8 +289,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Setup and run a .COM program ;; ;; Set CS=DS=ES=SS SP=0 IP=100h ;; -;; AX=0ffffh BX=0 CX=0 DX=drive ;; -;; and cmdline=void ;; +;; AX=0ffffh BX=0 DX=drive and ;; +;; cmdline=void ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov di, 100h ; ip @@ -304,7 +304,7 @@ ;; Relocate, setup and run a .EXE program ;; ;; Set CS:IP, SS:SP, DS, ES and AX according ;; ;; to wiki.osdev.org/MZ#Initial_Program_State ;; -;; AX=0ffffh BX=0 CX=0 DX=drive cmdline=void ;; +;; AX=0ffffh BX=0 DX=drive cmdline=void ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ReloCycle: @@ -387,7 +387,7 @@ mul dword [bx(bsSectorsPerFAT32)] xchg eax, edi - movzx ecx, byte [bx(bpbSectorsPerCluster)] + movzx ecx, byte [bx(bpbSectorsPerCluster)] ; 8..128 mul ecx ; edx:eax=sector number in data area add eax, edi @@ -400,7 +400,7 @@ %if LBA48bits != 0 adc word [bx(HiLBA)], bx %endif - mov dx, word [bx(bpbReservedSectors)] + mov dx, [bx(bpbReservedSectors)] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reads a sector using BIOS Int 13h fn 42h ;; @@ -468,7 +468,7 @@ mov dl, [bx(DriveNumber)] ; restore BIOS boot drive number %endif -ReadSectorLBARetry: +ReadSectorRetry: mov si, sp mov ah, 42h ; ah = 42h = extended read function no. int 13h ; extended read sectors (DL, DS:SI) @@ -490,7 +490,7 @@ int 13h ; reset drive (DL) dec bp - jnz ReadSectorLBARetry + jnz ReadSectorRetry %endif call Error @@ -543,6 +543,7 @@ ProgramName db "STARTUP BIN" ; name and extension each must be times (510-($-$$)) db ' ' ; padded with spaces (11 bytes total) +NameLength equ $-ProgramName ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of the sector ID ;; diff -r ec9531d04de1 -r 78727b04c002 BootProg/stuff/bootex.asm --- a/BootProg/stuff/bootex.asm Sat Sep 17 08:17:46 2022 +0000 +++ b/BootProg/stuff/bootex.asm Thu Sep 22 07:58:57 2022 +0000 @@ -59,7 +59,7 @@ ;; Boot Image Startup (register values): ;; ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;; ;; ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier), ;; -;; bx = cx = 0, dl = BIOS boot drive number (e.g. 0, 80H) ;; +;; bx = 0, dl = BIOS boot drive number (e.g. 0, 80H) ;; ;; cs:ip = program entry point ;; ;; ss:sp = program stack (don't confuse with boot sector's stack) ;; ;; COM program defaults: cs = ds = es = ss = 50h, sp = 0, ip = 100h ;; @@ -188,7 +188,7 @@ ;; Look for the COM/EXE file to load and run ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - xor di, di ; es:di -> root entries array + ; es:di -> root entries array ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Looks for the file/dir ProgramName ;; @@ -240,7 +240,7 @@ popf ; restore carry="not last sector" flag jc RootDirReadContinue ; continue to the next root dir cluster FindNameFailed: ; end of root directory (dir end reached) - mov dx, [bx(DriveNumber)] ; restore BIOS boot drive number + mov dl, [bx(DriveNumber)] ; restore BIOS boot drive number call Error db "File not found." FindNameFound: @@ -261,7 +261,7 @@ sub [bx+FileSize], ebp ; max FileSize is < 640KB : check low 32 bits only ja FileReadContinue mov dx, [bx(DriveNumber)] ; restore BIOS boot drive number - xor ax, ax + xchg ax, di pop bp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -279,8 +279,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Setup and run a .COM program ;; ;; Set CS=DS=ES=SS SP=0 IP=100h ;; -;; AX=0ffffh BX=0 CX=0 DX=drive ;; -;; and cmdline=void ;; +;; AX=0ffffh BX=0 DX=drive and ;; +;; cmdline=void ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov di, 100h ; ip @@ -294,7 +294,7 @@ ;; Relocate, setup and run a .EXE program ;; ;; Set CS:IP, SS:SP, DS, ES and AX according ;; ;; to wiki.osdev.org/MZ#Initial_Program_State ;; -;; AX=0ffffh BX=0 CX=0 DX=drive cmdline=void ;; +;; AX=0ffffh BX=0 DX=drive cmdline=void ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ReloCycle: @@ -373,7 +373,7 @@ cdq add eax, [bx(bpbFatSectorStart)] ; sector # relative to exFAT - call ReadSectorC ; read 1 exFAT sector + call ReadSectorFAT ; read 1 exFAT sector, keep edx=0, set C mov esi, [es:si] ; esi=next cluster # @@ -385,6 +385,8 @@ add eax, [bx(bpbClusterSectorStart)] ReadSectorC: + mov di, bx +ReadSectorFAT: adc edx, ebx ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -413,12 +415,11 @@ push es push bx push bp ; sector count word = 1 + push byte 16 ; packet size byte = 16, reserved byte = 0 %if ReadRetry != 0 - mov cx, 16 - push cx ; packet size byte = 16, reserved byte = 0 + pop cx + push cx ReadSectorRetry: -%else - push byte 16 %endif mov si, sp mov ah, 42h ; ah = 42h = extended read function no. diff -r ec9531d04de1 -r 78727b04c002 BootProg/stuff/bootprog.sh --- a/BootProg/stuff/bootprog.sh Sat Sep 17 08:17:46 2022 +0000 +++ b/BootProg/stuff/bootprog.sh Thu Sep 22 07:58:57 2022 +0000 @@ -1,30 +1,31 @@ #!/bin/sh -[ ! -e "$1" ] && cat <] $0 device [file] Example: $0 /dev/fd0 STARTUP.BIN -EOT - -xd="dd of=$1 bs=1 conv=notrunc" -while read c o b f; do - [ "${FAT:-$(dd if="$1" bs=1 count=5 skip=$c)}" = "$f" ] || continue +S +r="dd if=$1 count" +w="dd of=$1 bs=1 conv=notrunc seek" +while read c o b f +do [ "${FAT:-$($r=5 bs=1 skip=$c)}" = "$f" ] || continue echo "Install $f bootsector on $1." - for a in "$((o+b)) seek=$o count=$((512-o))" "$b count=11"; do - sed '1,/^exit 1/d' $0 | unlzma | $xd skip=$a - done + for a in "$o skip=$((o+b)) count=$((512-o))" "0 skip=$b count=11" + do sed '1,/^exit/d' $0 | unlzma | $w=$a; done [ "$2" ] && echo "Set boot file '$2'" && echo -n "$2" | case "$f" in E*) sed 's| |.|;s| ||g' | cat - /dev/zero;; *) tr a-z A-Z | sed 's|\.| |;s|^\(.\{8\}\) *|\1|;s|$| |' - esac | $xd seek=499 count=11 - [ "$f" = "EXFAT" ] && dd if="$1" bs=512 count=11 | od -v -An -t u1 -w1 - | LANG=C awk ' -BEGIN { a=0;i=-1;m=0xFFFFFFFE } + esac | $w=499 count=11 + case "$f" in + *32) $w=1536 if=$1 count=512;; + E*) $r=11 bs=1b | od -vAn -tu1 -w1 - | LANG=C awk 'BEGIN { a=0;i=-1;m=0xFFFFFFFE } { if (++i!=106 && i!=107 && i!=112) a=or(and(lshift(a,31),m),and(rshift(a,1),m/2))+$1 } -END { b=a/256;c=b/256; for (i=0;i<128;i++) printf "%c%c%c%c",a%256,b%256,c%256,(c/256)%256 }' | $xd seek=5632 +END { b=a/256;c=b/256; for (;i>0;i-=44) printf "%c%c%c%c",a%256,b%256,c%256,(c/256)%256 }' | $w=5632 + esac exit 0 -done 2>/dev/null </dev/null +54 54 0 FAT12 +54 54 0 FAT16 +82 82 512 FAT32 3 113 1024 EXFAT -EOT +S exit 1 diff -r ec9531d04de1 -r 78727b04c002 dex2jar/receipt --- a/dex2jar/receipt Sat Sep 17 08:17:46 2022 +0000 +++ b/dex2jar/receipt Thu Sep 22 07:58:57 2022 +0000 @@ -9,7 +9,7 @@ WEB_SITE="https://sourceforge.net/projects/dex2jar/" TARBALL="$PACKAGE-$VERSION.zip" -WGET_URL="https://sourceforge.net/projects/$PACKAGE/files/$TARBALL" +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" DEPENDS="java-jre" BUILD_DEPENDS="" diff -r ec9531d04de1 -r 78727b04c002 oldrunner/receipt --- a/oldrunner/receipt Sat Sep 17 08:17:46 2022 +0000 +++ b/oldrunner/receipt Thu Sep 22 07:58:57 2022 +0000 @@ -25,6 +25,7 @@ { echo '#define LEVELS_PATH "/usr/share/oldrunner"' >> cfg.h export LDFLAGS="$LDFLAGS -ltinfo" + patch -p0 < $stuff/remap.u ./configure && make } diff -r ec9531d04de1 -r 78727b04c002 oldrunner/stuff/remap.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oldrunner/stuff/remap.u Thu Sep 22 07:58:57 2022 +0000 @@ -0,0 +1,82 @@ +--- oldrunner.c 2010-07-17 17:30:32.000000000 +0000 ++++ oldrunner.c 2022-09-22 07:31:51.585297479 +0000 +@@ -36,6 +36,8 @@ + + #include "oldrunner.h" + ++int remap_apple = 0; ++ + /* + * Oldrunner is a remake of the Loadrunner game from Broderbund, and one of the + * first computer games my father offered me. I wrote this in memory of him. +@@ -50,7 +52,7 @@ + int ch, startlvl; + + startlvl = 0; +- while ((ch = getopt (argc, argv, "l:v")) != -1) ++ while ((ch = getopt (argc, argv, "l:av")) != -1) + { + switch (ch) + { +@@ -62,6 +64,9 @@ + return 1; + } + break; ++ case 'a': ++ remap_apple++; ++ break; + case 'v': + fputs ("oldrunner-" VERSION "\n", stdout); + return 0; +@@ -74,7 +79,7 @@ + if (argc >= 1) + { + err: +- fputs ("usage: oldrunner [-v] [-l]\n", stderr); ++ fputs ("usage: oldrunner [-v] [-a] [-l]\n", stderr); + return 0; + } + +--- usr.c 2010-07-17 17:30:32.000000000 +0000 ++++ usr.c 2022-09-22 07:28:52.590988791 +0000 +@@ -43,6 +43,31 @@ + rec_input.key = ORKEY_NONE; + } + ++static int ++remap (int key) ++{ ++ extern int remap_apple; ++ if (remap_apple) ++ { ++ switch (key | 0x20) ++ { ++ case 'u': ++ return ORKEY_DIG_LEFT; ++ case 'i': ++ return ORKEY_MOVE_UP; ++ case 'o': ++ return ORKEY_DIG_RIGHT; ++ case 'j': ++ return ORKEY_MOVE_LEFT; ++ case 'k': ++ return ORKEY_MOVE_DOWN; ++ case 'l': ++ return ORKEY_MOVE_RIGHT; ++ } ++ } ++ return key; ++} ++ + void + usr_input (void) + { +@@ -63,7 +88,7 @@ + continue; + } + +- switch (rec_input.key) ++ switch (remap(rec_input.key)) + { + case ORKEY_EXIT: + return; diff -r ec9531d04de1 -r 78727b04c002 viewnior/receipt --- a/viewnior/receipt Sat Sep 17 08:17:46 2022 +0000 +++ b/viewnior/receipt Thu Sep 22 07:58:57 2022 +0000 @@ -7,7 +7,7 @@ SHORT_DESC="Fast and elegant image viewer." MAINTAINER="pankso@slitaz.org" LICENSE="GPL3" -WEB_SITE="https://siyanpanayotov.com/project/viewnior/" +WEB_SITE="https://github.com/hellosiyan/Viewnior" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="https://github.com/hellosiyan/Viewnior/archive/$TARBALL" diff -r ec9531d04de1 -r 78727b04c002 wol/receipt --- a/wol/receipt Sat Sep 17 08:17:46 2022 +0000 +++ b/wol/receipt Thu Sep 22 07:58:57 2022 +0000 @@ -8,7 +8,7 @@ LICENSE="GPL2" TARBALL="${PACKAGE}-${VERSION}.tar.gz" WGET_URL="$SF_MIRROR/ahh/$TARBALL" -WEB_SITE="http://wake-on-lan.sourceforge.net/" +WEB_SITE="https://wake-on-lan.sourceforge.net/" BUILD_DEPENDS="" DEPENDS=""