Skip to content

Commit

Permalink
sync SvarLANG lib with upstream (enable .LNG compression)
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann committed Oct 11, 2024
1 parent f7f287b commit 407c246
Show file tree
Hide file tree
Showing 8 changed files with 642 additions and 156 deletions.
4 changes: 2 additions & 2 deletions source/fdisk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ bootnorm.c : bintoc/bintoc.exe bootnorm.bin

# --- NLS -------------------------------------------------------------------

nls/out.lng : svarlang/tlumacz.exe nls/en.txt nls/es.txt nls/de.txt nls/fr.txt nls/it.txt nls/pl.txt nls/tr.txt
nls/out.lng : svarlang/tlumacz.exe nls/en.txt nls/de.txt nls/es.txt nls/fr.txt nls/it.txt nls/pl.txt nls/tr.txt
@cd nls
$(TLUMACZ) en es de fr it pl tr
$(TLUMACZ) /excref en de es fr it pl tr
@cd ..

fdisk.lng : nls/out.lng
Expand Down
2 changes: 1 addition & 1 deletion source/fdisk/Makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ deflang.c : nls/deflang.c
$(CP) $< $@

nls/deflang.c nls/out.lng : svarlang/tlumacz nls/en.txt nls/de.txt nls/es.txt nls/fr.txt nls/it.txt nls/pl.txt nls/tr.txt
cd nls; ../svarlang/tlumacz en de es fr it pl tr
cd nls; ../svarlang/tlumacz /excref en de es fr it pl tr

nls/out.lng : nls/deflang.c

Expand Down
16 changes: 16 additions & 0 deletions source/fdisk/svarlang/history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
20241010
- improved the MVCOMP compression algorithm (ca. 5% more efficient on text)
- added /nodef to TLUMACZ (skips deflang generation)
- MVCOMP-packed data is loaded to RAM before unpacking (60x faster on an 8086)
- assembly version of the MVCOMP depacker used by default (saves 27 bytes)

20240929
- LNG strings may be optionally MVCOMP-compressed (disabled with /nocomp)
- reference language can be excluded from the LNG file (/excref)

20240915
- fixed svarlang_strid() when id=0 and string does not exist (Bernd Boeckmann)

20240227
- replaced inline _asm by pragma aux (more compact code, open watcom only)

20230730
- dropped svarlang_autoload() (replaced by more specialized functions below)
- added svarlang_autoload_exepath() and svarlang_autoload_nlspath()
Expand Down
73 changes: 39 additions & 34 deletions source/fdisk/svarlang/makefile
Original file line number Diff line number Diff line change
@@ -1,64 +1,69 @@
#
# make instructions to build svarlang and tlumacz.exe with OpenWatcom
# Copyright (C) 2021-2023 Mateusz Viste
# Copyright (C) 2021-2024 Mateusz Viste
#

ALLBIN = svarlngs.lib svarlngc.lib svarlngm.lib svarlngl.lib tlumacz.exe
all: $(ALLBIN)

CFLAGS = -0 -wx -we -os -s
CFLAGS = -q -0 -wx -we -os -s

# uncomment this if you prefer SvarLANG to use fopen() and friends to handle
# file access instead of raw DOS calls. this might make the program larger if
# it does not use FILE already, but it allows for 100% ANSI C compliancy.
#CFLAGS += -DWITHSTDIO

# uncomment this if you'd like to enable an assembly version of the mvcomp
# depacker instead of the native C routine. This saves 27 bytes of footprint.
CFLAGS += -DMVUCOMP_ASM

ALLFILES = auto_exe.c auto_nls.c svarlang.c version.c


svarlngs.lib: $(ALLFILES)
wcc $(CFLAGS) -ms auto_exe.c
wcc $(CFLAGS) -ms auto_nls.c
wcc $(CFLAGS) -ms svarlang.c
wcc $(CFLAGS) -ms version.c
if exist svarlngs.lib del svarlngs.lib
wlib -n svarlngs.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj
wcc $(CFLAGS) -ms -Fo=auto_exe.obj auto_exe.c
wcc $(CFLAGS) -ms -Fo=auto_nls.obj auto_nls.c
wcc $(CFLAGS) -ms -Fo=svarlang.obj svarlang.c
wcc $(CFLAGS) -ms -Fo=version.obj version.c
if exist svarlngs.lib rm -f svarlngs.lib
wlib -q -n svarlngs.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj

svarlngc.lib: $(ALLFILES)
wcc $(CFLAGS) -mc auto_exe.c
wcc $(CFLAGS) -mc auto_nls.c
wcc $(CFLAGS) -mc svarlang.c
wcc $(CFLAGS) -mc version.c
if exist svarlngc.lib del svarlngc.lib
wlib -n svarlngc.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj
wcc $(CFLAGS) -mc -Fo=auto_exe.obj auto_exe.c
wcc $(CFLAGS) -mc -Fo=auto_nls.obj auto_nls.c
wcc $(CFLAGS) -mc -Fo=svarlang.obj svarlang.c
wcc $(CFLAGS) -mc -Fo=version.obj version.c
if exist svarlngc.lib rm -f svarlngc.lib
wlib -q -n svarlngc.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj

svarlngm.lib: $(ALLFILES)
wcc $(CFLAGS) -mm auto_exe.c
wcc $(CFLAGS) -mm auto_nls.c
wcc $(CFLAGS) -mm svarlang.c
wcc $(CFLAGS) -mm version.c
if exist svarlngm.lib del svarlngm.lib
wlib -n svarlngm.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj
wcc $(CFLAGS) -mm -Fo=auto_exe.obj auto_exe.c
wcc $(CFLAGS) -mm -Fo=auto_nls.obj auto_nls.c
wcc $(CFLAGS) -mm -Fo=svarlang.obj svarlang.c
wcc $(CFLAGS) -mm -Fo=version.obj version.c
if exist svarlngm.lib rm -f svarlngm.lib
wlib -q -n svarlngm.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj

svarlngl.lib: $(ALLFILES)
wcc $(CFLAGS) -ml auto_exe.c
wcc $(CFLAGS) -ml auto_nls.c
wcc $(CFLAGS) -ml svarlang.c
wcc $(CFLAGS) -ml version.c
if exist svarlngl.lib del svarlngl.lib
wlib -n svarlngl.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj
wcc $(CFLAGS) -ml -Fo=auto_exe.obj auto_exe.c
wcc $(CFLAGS) -ml -Fo=auto_nls.obj auto_nls.c
wcc $(CFLAGS) -ml -Fo=svarlang.obj svarlang.c
wcc $(CFLAGS) -ml -Fo=version.obj version.c
if exist svarlngl.lib rm -f svarlngl.lib
wlib -q -n svarlngl.lib +auto_exe.obj +auto_nls.obj +svarlang.obj +version.obj

release: $(ALLBIN) .symbolic
if exist svarlang.zip del svarlang.zip
if exist svrl_src.zip del svrl_src.zip
if exist svarlang.zip rm -f svarlang.zip
if exist svrl_src.zip rm -f svrl_src.zip
zip -9rkDX svarlang.zip *.lib *.h *.txt tlumacz.exe
zip -9rkDX svrl_src.zip *.c *.txt *.h makefile

tlumacz.exe: tlumacz.c
wcl -0 -y -cc -wx -mc -lr -we -ox tlumacz.c
del *.obj
wcl -q -0 -y -cc -wx -mc -lr -we -ox tlumacz.c
rm -f *.obj

clean: .symbolic
del *.exe
del *.obj
del *.lib
del *.zip
rm -f *.exe
rm -f *.obj
rm -f *.lib
rm -f *.zip
Loading

0 comments on commit 407c246

Please sign in to comment.