├── inst ├── platform │ ├── macos │ │ ├── PkgInfo │ │ ├── arrow.zzt │ │ ├── dmg.DS_Store │ │ ├── kevedit.icns │ │ ├── background.tiff │ │ ├── dmg background.png │ │ ├── dmg background@2x.png │ │ ├── appdmg.json │ │ ├── extract_sdk.sh │ │ ├── Info.plist.in │ │ └── build_macos.sh │ ├── dos │ │ ├── cwsdpmi.exe │ │ ├── gcc12.10-poisoned-calloc-musl.patch │ │ └── build_dos.sh │ ├── windows │ │ ├── kevedit.ico │ │ ├── install-big.bmp │ │ ├── install-small.bmp │ │ ├── kevedit.rc.in │ │ ├── build_windows.sh │ │ └── kevedit.iss.in │ └── linux │ │ ├── kevedit.desktop │ │ ├── build_source.sh │ │ └── build_linux.sh ├── .dockerignore ├── icon128.png ├── icon16.png ├── icon24.png ├── icon256.png ├── icon32.png ├── icon48.png ├── icon512.png ├── Dockerfile.source ├── Dockerfile.appimage ├── Dockerfile.macos_sdk_extractor ├── Dockerfile.dos ├── Dockerfile.windows └── Dockerfile.macos ├── src ├── display │ ├── ega.pal │ ├── default.chr │ ├── Makefile.am │ ├── display_stdio.h │ ├── display_dos.h │ ├── colours.h │ ├── unicode.h │ ├── palette.h │ ├── casing.h │ ├── charset.h │ ├── display.c │ ├── display_sdl.h │ ├── textblock.h │ ├── textblock.c │ ├── test.c │ ├── palette.c │ ├── unicode.c │ └── display.h ├── themes │ ├── Makefile.am │ ├── rusty │ │ ├── Makefile.am │ │ ├── tbox.c │ │ ├── c2bin.py │ │ ├── tdialog.c │ │ ├── panel_f1.c │ │ └── panel_f2.c │ └── theme.h ├── Makefile.am ├── dialogs │ ├── Makefile.am │ ├── infobox.h │ ├── files.h │ └── dialog.h ├── structures │ ├── Makefile.am │ ├── gradient.h │ ├── selection.h │ └── svector.h ├── zlaunch │ ├── Makefile.am │ ├── dosbox.h │ ├── zlaunch.h │ └── zlmain.c ├── help │ ├── Makefile.am │ ├── hypertxt.h │ ├── help.h │ ├── helplist.h │ └── hypertxt.c ├── libzzt2 │ ├── Makefile.am │ └── strtools.h ├── synth │ ├── Makefile.am │ ├── synth.h │ ├── pcspeaker.h │ ├── zzm.h │ ├── sdl_synth.h │ ├── pcspeaker.c │ ├── play.c │ └── notes.h ├── texteditor │ ├── Makefile.am │ ├── display.h │ ├── select.h │ ├── zzm.h │ ├── test.c │ ├── zzl.h │ ├── register.h │ ├── zoopdraw.h │ └── lineeditor.h └── kevedit │ ├── Makefile.am │ ├── macos.h │ ├── menu.h │ ├── patbuffer.h │ └── misc.h ├── docs ├── terrain.hlp ├── index.hlp ├── makehelp.sh ├── kadvance.hlp ├── Makefile.am ├── ksupport.hlp ├── kevedit.hlp ├── lang.hlp ├── kkeys.hlp ├── kwldinfo.hlp ├── kbrdinfo.hlp ├── kbackbuf.hlp ├── kobjedit.hlp ├── kselect.hlp ├── ktileinf.hlp └── creature.hlp ├── dosbox ├── image │ ├── skip.com │ ├── zzt.dat │ └── zzt.exe ├── Makefile.am └── README ├── glob ├── SCOPTIONS ├── Makefile.am ├── configure.bat ├── SMakefile ├── Makefile.ami └── fnmatch.h ├── default.zln ├── .gitignore ├── AUTHORS ├── .github └── workflows │ └── build.yml ├── Makefile.am ├── legal.md ├── bootstrap.sh ├── README.md └── soundfx.zzm /inst/platform/macos/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? 2 | -------------------------------------------------------------------------------- /inst/.dockerignore: -------------------------------------------------------------------------------- 1 | dist 2 | vendor/xcode 3 | work 4 | -------------------------------------------------------------------------------- /src/display/ega.pal: -------------------------------------------------------------------------------- 1 | ***********???????????? -------------------------------------------------------------------------------- /src/themes/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = rusty 2 | 3 | EXTRA_DIST = theme.h 4 | -------------------------------------------------------------------------------- /docs/terrain.hlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/docs/terrain.hlp -------------------------------------------------------------------------------- /inst/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon128.png -------------------------------------------------------------------------------- /inst/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon16.png -------------------------------------------------------------------------------- /inst/icon24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon24.png -------------------------------------------------------------------------------- /inst/icon256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon256.png -------------------------------------------------------------------------------- /inst/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon32.png -------------------------------------------------------------------------------- /inst/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon48.png -------------------------------------------------------------------------------- /inst/icon512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/icon512.png -------------------------------------------------------------------------------- /dosbox/image/skip.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/dosbox/image/skip.com -------------------------------------------------------------------------------- /dosbox/image/zzt.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/dosbox/image/zzt.dat -------------------------------------------------------------------------------- /dosbox/image/zzt.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/dosbox/image/zzt.exe -------------------------------------------------------------------------------- /src/display/default.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/src/display/default.chr -------------------------------------------------------------------------------- /inst/platform/dos/cwsdpmi.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/dos/cwsdpmi.exe -------------------------------------------------------------------------------- /inst/platform/macos/arrow.zzt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/macos/arrow.zzt -------------------------------------------------------------------------------- /inst/platform/macos/dmg.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/macos/dmg.DS_Store -------------------------------------------------------------------------------- /inst/platform/macos/kevedit.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/macos/kevedit.icns -------------------------------------------------------------------------------- /inst/platform/windows/kevedit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/windows/kevedit.ico -------------------------------------------------------------------------------- /inst/platform/macos/background.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/macos/background.tiff -------------------------------------------------------------------------------- /inst/platform/macos/dmg background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/macos/dmg background.png -------------------------------------------------------------------------------- /inst/platform/windows/install-big.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/windows/install-big.bmp -------------------------------------------------------------------------------- /inst/platform/windows/install-small.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/windows/install-small.bmp -------------------------------------------------------------------------------- /inst/platform/macos/dmg background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cknave/kevedit/HEAD/inst/platform/macos/dmg background@2x.png -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit source tree 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | SUBDIRS = libzzt2 structures display synth themes texteditor help dialogs zlaunch kevedit 6 | -------------------------------------------------------------------------------- /inst/platform/linux/kevedit.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=KevEdit 4 | Comment=ZZT Editor 5 | Exec=kevedit 6 | Icon=kevedit 7 | Terminal=false 8 | Type=Application 9 | StartupNotify=false 10 | Categories=Game; 11 | -------------------------------------------------------------------------------- /src/dialogs/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit dialogs 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | noinst_LIBRARIES = libdialogs.a 6 | 7 | libdialogs_a_SOURCES = \ 8 | dialog.c files.c infobox.c paramed.c \ 9 | dialog.h files.h infobox.h paramed.h 10 | -------------------------------------------------------------------------------- /src/structures/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for structures library 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | noinst_LIBRARIES = libstructures.a 6 | 7 | libstructures_a_SOURCES = \ 8 | gradient.c selection.c svector.c \ 9 | gradient.h selection.h svector.h 10 | -------------------------------------------------------------------------------- /src/zlaunch/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for zlaunch zzt launcher 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | EXTRA_DIST = zlmain.c 6 | 7 | noinst_LIBRARIES = libzlaunch.a 8 | 9 | libzlaunch_a_SOURCES = \ 10 | dosbox.c zlaunch.c \ 11 | dosbox.h zlaunch.h 12 | -------------------------------------------------------------------------------- /glob/SCOPTIONS: -------------------------------------------------------------------------------- 1 | ERRORREXX 2 | OPTIMIZE 3 | NOVERSION 4 | OPTIMIZERTIME 5 | OPTIMIZERALIAS 6 | DEFINE INCLUDEDIR="include:" 7 | DEFINE LIBDIR="lib:" 8 | DEFINE NO_ALLOCA 9 | DEFINE NO_FLOAT 10 | DEFINE NO_ARCHIVES 11 | IGNORE=161 12 | IGNORE=100 13 | STARTUP=cres 14 | -------------------------------------------------------------------------------- /src/help/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for help system 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | AM_CPPFLAGS = -DDATAPATH=\"$(pkgdatadir)\" 6 | 7 | noinst_LIBRARIES = libhelp.a 8 | 9 | libhelp_a_SOURCES = \ 10 | help.c helplist.c hypertxt.c \ 11 | help.h helplist.h hypertxt.h 12 | -------------------------------------------------------------------------------- /src/libzzt2/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*-Makefile-*-, or close enough 2 | 3 | #AUTOMAKE_OPTIONS = 1.6.3 foreign 4 | 5 | EXTRA_DIST = test.c 6 | 7 | noinst_LIBRARIES = libzzt2.a 8 | 9 | libzzt2_a_SOURCES = board.c file.c params.c tiles.c world.c zzt.h\ 10 | zztoop.c zztoop.h strtools.c strtools.h 11 | -------------------------------------------------------------------------------- /docs/index.hlp: -------------------------------------------------------------------------------- 1 | @Help 2 | $Help 3 | 4 | !-kevedit;Using Kevedit 5 | !-kkeys;Keystroke Quick Reference 6 | !-langref;ZZT OOP Language reference 7 | !-knew;New Features 8 | 9 | $ZZT Documentation 10 | !-about;About ZZT / ZZTWeb 11 | !-game;Playing ZZT / In-Game Help 12 | !-editor;ZZT Editor 13 | -------------------------------------------------------------------------------- /inst/platform/macos/appdmg.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "KevEdit", 3 | "background": "dmg background.png", 4 | "contents": [ 5 | { 6 | "x": 125, 7 | "y": 175, 8 | "type": "file", 9 | "path": "KevEdit.app" 10 | }, 11 | { 12 | "x": 355, 13 | "y": 175, 14 | "type": "link", 15 | "path": "/Applications" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /dosbox/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit DOSBox support 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | if WITH_DOSBOX 6 | isofile = kevedos.iso 7 | endif 8 | 9 | pkgdata_DATA = kevedos.cfg $(isofile) 10 | 11 | EXTRA_DIST = README image kevedos.cfg 12 | 13 | MOSTLYCLEANFILES = kevedos.iso 14 | 15 | kevedos.iso: $(srcdir)/image $(wildcard $(srcdir)/image/*) 16 | @MKISOFS@ -o $@ $(srcdir)/image 17 | -------------------------------------------------------------------------------- /src/synth/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*-Makefile-*-, or close enough 2 | 3 | #AUTOMAKE_OPTIONS = 1.6.3 foreign 4 | 5 | noinst_LIBRARIES = libsynth.a 6 | 7 | libsynth_a_SOURCES = notes.c notes.h synth.h zzm.c zzm.h 8 | 9 | if SDL 10 | libsynth_a_SOURCES += sdl_synth.c sdl_synth.h 11 | endif 12 | 13 | if DOS 14 | libsynth_a_SOURCES += pcspeaker.c pcspeaker.h 15 | endif 16 | 17 | EXTRA_DIST = $(OPTIONAL_SRC) play.c 18 | -------------------------------------------------------------------------------- /src/themes/rusty/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am for Rusty KevEdit theme 2 | 3 | noinst_LIBRARIES = librusty.a 4 | 5 | librusty_a_SOURCES = cbox.c scroll.c tbox.c tdialog.c \ 6 | panel.c panel_board_dialog.c panel_board_info.c panel_dir_dialog.c panel_editor.c panel_f1.c panel_f2.c panel_f3.c panel_file_dialog.c panel_filename_dialog.c panel_gradient1.c panel_gradient2.c panel_help_dialog.c panel_stats_dialog.c panel_tile_info.c panel_world_info.c \ 7 | rusty.h 8 | -------------------------------------------------------------------------------- /inst/platform/macos/extract_sdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e -x 3 | 4 | XCODE_VERSION="$1" 5 | SDK_VERSION="$2" 6 | if test -z "$XCODE_VERSION" -o -z "$SDK_VERSION"; then 7 | echo "USAGE: extract_sdk.sh " 8 | exit 1 9 | fi 10 | 11 | cd /osxcross 12 | echo "Extracting Xcode. This is going to take a while..." 13 | ./tools/gen_sdk_package_pbzx.sh /vendor/xcode/Xcode_${XCODE_VERSION}.xip 14 | cp MacOSX${SDK_VERSION}.sdk.tar.bz2 /vendor/ 15 | -------------------------------------------------------------------------------- /docs/makehelp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SRCDIR=. 4 | OUTDIR=.. 5 | 6 | if [ $# -gt 0 ]; then 7 | SRCDIR=$1 8 | fi 9 | 10 | if [ $# -gt 1 ]; then 11 | OUTDIR=$2 12 | fi 13 | 14 | HELPFILE=$OUTDIR/kevedit.zml 15 | SRCFILES=$SRCDIR/*.hlp 16 | 17 | rm -f $HELPFILE 18 | 19 | for i in $SRCFILES; do 20 | basename=`basename $i` && 21 | echo @@$basename >> $HELPFILE && 22 | cat $i >> $HELPFILE || exit 1 23 | done 24 | 25 | echo "Help metafile $HELPFILE generated from $SRCFILES" 26 | -------------------------------------------------------------------------------- /docs/kadvance.hlp: -------------------------------------------------------------------------------- 1 | @Advanced Editing Tools 2 | $Advanced Editing Tools 3 | 4 | :backbuffer;Re-sizable Backbuffer 5 | :buflock;Backbuffer Locking 6 | :acquire;Acquire Mode 7 | :gradient;Gradient Draw Mode 8 | 9 | Information on backbuffer functions can 10 | now be found in: 11 | !-kbackbuf;The Backbuffer 12 | 13 | :gradtool;Gradient Tool 14 | :randfill;Random Flood Fill 15 | 16 | Information on tools involving selected 17 | areas can now be found in: 18 | !-kselect.hlp;Tile Selection 19 | 20 | -------------------------------------------------------------------------------- /default.zln: -------------------------------------------------------------------------------- 1 | ' zlaunch configuration file 2 | 3 | ' List of optional actions to perform: 4 | ' (remove "zztkeys" to disable virtual keystrokes) 5 | perform zztkeys 6 | 7 | ' List of actions and optional actions: 8 | action copydat displace docs/zzt.dat 9 | action copyhlp copy docs/*.hlp 10 | action copyhlp copy docs/*.HLP 11 | optional screenthief run st/st.exe 12 | optional zzfont run zzfont.com i 13 | optional zztkeys keystrokes kc 14 | optional play keystrokes p 15 | action zzt run zzt %1 16 | -------------------------------------------------------------------------------- /inst/Dockerfile.source: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17.2 2 | ARG MAKE_OPTS=-j12 3 | 4 | RUN apk add --no-cache autoconf automake build-base cdrkit gzip libtool linux-headers pkgconf zip 5 | 6 | ARG SDL_VERSION 7 | COPY vendor/SDL2-${SDL_VERSION}.tar.gz /tmp/ 8 | RUN cd /tmp \ 9 | && tar xzf SDL2-${SDL_VERSION}.tar.gz \ 10 | && cd SDL2-${SDL_VERSION} \ 11 | && ./configure \ 12 | && make ${MAKE_OPTS} \ 13 | && make install \ 14 | && echo "/usr/local/share/aclocal" > /usr/share/aclocal/dirlist \ 15 | && rm -rf /tmp/SDL2-${SDL_VERSION}* 16 | -------------------------------------------------------------------------------- /inst/platform/linux/build_source.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # KevEdit source distribution build script 3 | # Run in kevedit/build_source container 4 | set -e -x 5 | 6 | SOURCE="$1" 7 | KEVEDIT_VERSION="$2" 8 | if [ -z "$SOURCE" ] || [ -z "$KEVEDIT_VERSION" ]; then 9 | echo "USAGE: build_linux.sh " 10 | exit 1 11 | fi 12 | export KEVEDIT_VERSION 13 | 14 | rm -rf /work/kevedit 15 | mkdir /work/kevedit 16 | cd /work/kevedit 17 | 18 | unzip /vendor/$SOURCE 19 | 20 | ./bootstrap.sh --configure 21 | make -C build distcheck 22 | mv build/kevedit-*.tar.gz /dist 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.o 3 | *.a 4 | .deps 5 | .DS_Store 6 | .dirstamp 7 | compile_commands.json 8 | 9 | /docs/kevedit.zml 10 | /dosbox/kevedos.iso 11 | /inst/dist 12 | /inst/platform/macos/Info.plist 13 | /inst/platform/windows/kevedit.iss 14 | /inst/platform/windows/kevedit.rc 15 | /inst/vendor 16 | /inst/work 17 | /src/config.h 18 | /src/config.h.in 19 | /src/stamp-h1 20 | /src/**/test 21 | /src/kevedit/kevedit 22 | 23 | Makefile 24 | Makefile.in 25 | /INSTALL 26 | /aclocal.m4 27 | /autom4te.cache 28 | /build 29 | /buildinfo.h 30 | /compile 31 | /config.guess 32 | /config.log 33 | /config.status 34 | /config.sub 35 | /configure 36 | /depcomp 37 | /install-sh 38 | /missing 39 | 40 | *.swp 41 | -------------------------------------------------------------------------------- /src/texteditor/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit text editor 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | noinst_LIBRARIES = libtexteditor.a 6 | 7 | libtexteditor_a_SOURCES = \ 8 | lineeditor.c lineeditor.h \ 9 | display.c editbox.c register.c select.c zoopdraw.c zzl.c zzm.c \ 10 | display.h editbox.h register.h select.h zoopdraw.h zzl.h zzm.h \ 11 | texteditor.c texteditor.h 12 | 13 | if MACOS 14 | macos_SOURCES = $(top_srcdir)/src/kevedit/macos.m 15 | macos_frameworks = -framework Cocoa 16 | endif 17 | 18 | noinst_PROGRAMS = test 19 | test_SOURCES = test.c $(macos_SOURCES) 20 | test_LDADD = libtexteditor.a ../display/libdisplay.a ../libzzt2/libzzt2.a 21 | test_LDFLAGS = $(macos_frameworks) 22 | -------------------------------------------------------------------------------- /inst/platform/windows/kevedit.rc.in: -------------------------------------------------------------------------------- 1 | 1 VERSIONINFO 2 | FILEVERSION @WINDRES_VERSION@ 3 | PRODUCTVERSION @WINDRES_VERSION@ 4 | BEGIN 5 | BLOCK "StringFileInfo" 6 | BEGIN 7 | BLOCK "040904E4" 8 | BEGIN 9 | VALUE "CompanyName", "Kevin Vance et al." 10 | VALUE "FileDescription", "KevEdit ZZT Editor" 11 | VALUE "FileVersion", "@VERSION@" 12 | VALUE "InternalName", "kevedit" 13 | VALUE "LegalCopyright", "Kevin Vance et al." 14 | VALUE "OriginalFilename", "kevedit.exe" 15 | VALUE "ProductName", "KevEdit" 16 | VALUE "ProductVersion", "@VERSION@" 17 | END 18 | END 19 | BLOCK "VarFileInfo" 20 | BEGIN 21 | VALUE "Translation", 0x409, 1252 22 | END 23 | END 24 | kevedit ICON "kevedit.ico" 25 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | KevEdit was written, conceived, and directed by: 2 | Kev Vance 3 | 4 | KevEdit was thoroughly hacked into a final product by: 5 | Ryan Phillips 6 | 7 | The first bug was discovered by: 8 | Scott Hammack 9 | 10 | Another bug was found by: 11 | Elchonon Edelson 12 | 13 | DOS Music playback adapted from code by: 14 | Jacob Hammond 15 | WeP 16 | 17 | Some documentation written by: 18 | Chronos 19 | 20 | SDL textmode emulation originally written by: 21 | Gilead ``Exophase'' Kutnick 22 | 23 | Tokenizer ';' crash bug reported by: 24 | ``Thor Gonzales'' 25 | -------------------------------------------------------------------------------- /inst/Dockerfile.appimage: -------------------------------------------------------------------------------- 1 | FROM centos:7.9.2009 2 | ARG MAKE_OPTS=-j12 3 | 4 | RUN yum groupinstall -y "Development Tools" && \ 5 | yum install -y alsa-lib-devel dbus-devel fuse-devel libX11-devel \ 6 | libXcursor-devel libXrandr-devel libXScrnSaver-devel \ 7 | libXinerama-devel libXi-devel mesa-libEGL-devel \ 8 | mesa-libGL-devel mkisofs pulseaudio-libs-devel sudo unzip 9 | 10 | ARG SDL_VERSION 11 | COPY vendor/SDL2-${SDL_VERSION}.tar.gz /tmp/ 12 | RUN cd /tmp && \ 13 | tar xzf SDL2-${SDL_VERSION}.tar.gz && \ 14 | cd SDL2-${SDL_VERSION} && \ 15 | ./configure && \ 16 | make ${MAKE_OPTS} && \ 17 | make install && \ 18 | echo "/usr/local/share/aclocal" > /usr/share/aclocal/dirlist && \ 19 | rm -rf /tmp/SDL2-${SDL_VERSION}* 20 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit documentation 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | pkgdata_DATA = kevedit.zml 6 | 7 | HELPFILES = creature.hlp index.hlp item.hlp kadvance.hlp kbackbuf.hlp kbasics.hlp kbrdinfo.hlp kevedit.hlp kkeys.hlp \ 8 | knew.hlp kobjedit.hlp kselect.hlp kstats.hlp ksupport.hlp ktileinf.hlp kwldinfo.hlp lang.hlp langref.hlp \ 9 | langtut.hlp terrain.hlp 10 | 11 | EXTRA_DIST = kevedit.dox makehelp.sh $(HELPFILES) 12 | 13 | MOSTLYCLEANFILES = kevedit.zml -R kevedit/ 14 | 15 | kevedit.zml: $(srcdir)/*.hlp 16 | chmod a+x $(srcdir)/makehelp.sh 17 | $(srcdir)/makehelp.sh $(srcdir) . 18 | 19 | # Rules to generate doxygen documentation 20 | dox: kevedit/html/index.html 21 | 22 | kevedit/html/index.html: $(srcdir)/kevedit.dox 23 | SRCPREFIX=$(srcdir)/ doxygen $(srcdir)/kevedit.dox 24 | 25 | -------------------------------------------------------------------------------- /src/display/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for textmode display library 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | noinst_LIBRARIES = libdisplay.a 6 | 7 | libdisplay_a_SOURCES = casing.c casing.h charset.c charset.h display.c display.h \ 8 | display_stdio.c display_stdio.h textblock.c textblock.h keys.h colours.h \ 9 | palette.c palette.h 10 | 11 | # Test program 12 | noinst_PROGRAMS = test 13 | test_SOURCES = test.c 14 | test_LDADD = libdisplay.a 15 | 16 | if DOS 17 | libdisplay_a_SOURCES += display_dos.c display_dos.h 18 | endif 19 | 20 | if SDL 21 | libdisplay_a_SOURCES += display_sdl.c display_sdl.h unicode.c unicode.h 22 | endif 23 | 24 | if MACOS 25 | libdisplay_a_SOURCES += $(top_srcdir)/src/kevedit/macos.m 26 | test_SOURCES += $(top_srcdir)/src/kevedit/macos.m 27 | test_LDFLAGS = -framework Cocoa 28 | endif 29 | 30 | EXTRA_DIST = default.chr ega.pal 31 | 32 | -------------------------------------------------------------------------------- /inst/Dockerfile.macos_sdk_extractor: -------------------------------------------------------------------------------- 1 | # Extract macOS SDK from Xcode archive 2 | FROM alpine:3.17 3 | ARG MAKE_OPTS=-j12 4 | 5 | COPY platform/macos/extract_sdk.sh / 6 | 7 | RUN apk update \ 8 | && apk add autoconf automake bash binutils bzip2-dev clang cmake cpio gcc git libressl-dev \ 9 | libxml2-dev make musl-dev musl-fts-dev patch xz-dev 10 | 11 | ARG OSXCROSS_VERSION=6525b2b7d33abc371ad889f205377dc5cf81f23e 12 | COPY vendor/osxcross-${OSXCROSS_VERSION}.zip /tmp 13 | RUN cd / \ 14 | && unzip /tmp/osxcross-${OSXCROSS_VERSION}.zip \ 15 | && ln -s osxcross-${OSXCROSS_VERSION} osxcross \ 16 | # Something hates a struct field called stdin, I think it's musl 17 | && sed -i -e "s@get_sources.*pbzx.*@\0; sed -i -e 's/\\\\(bool \\\\|\\\\.\\\\|->\\\\)stdin/\\\\1stdin_/g' pbzx/pbzx.c@" \ 18 | osxcross/tools/gen_sdk_package_pbzx.sh \ 19 | && cd /tmp \ 20 | && rm osxcross-${OSXCROSS_VERSION}.zip 21 | 22 | ENTRYPOINT ["/extract_sdk.sh"] 23 | -------------------------------------------------------------------------------- /src/kevedit/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit program 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | AM_CPPFLAGS = -DDATAPATH=\"$(pkgdatadir)\" 6 | 7 | bin_PROGRAMS = kevedit 8 | 9 | if WINDOWS 10 | windres_SOURCES = $(top_builddir)/inst/platform/windows/kevedit.rc 11 | endif 12 | 13 | if MACOS 14 | macos_SOURCES = macos.m 15 | macos_frameworks = -framework Cocoa 16 | endif 17 | EXTRA_DIST = macos.h 18 | 19 | kevedit_SOURCES = \ 20 | kevedit.c main.c menu.c misc.c patbuffer.c screen.c \ 21 | kevedit.h menu.h misc.h patbuffer.h screen.h $(windres_SOURCES) \ 22 | ../mkdtemp/mkdtemp.c $(macos_SOURCES) 23 | 24 | kevedit_LDADD = ../zlaunch/libzlaunch.a ../texteditor/libtexteditor.a ../dialogs/libdialogs.a ../help/libhelp.a ../themes/rusty/librusty.a ../synth/libsynth.a ../display/libdisplay.a ../structures/libstructures.a ../libzzt2/libzzt2.a $(GLOBLIB) 25 | kevedit_LDFLAGS = $(macos_frameworks) 26 | 27 | .rc.o: 28 | $(WINDRES) -o $@ $< 29 | 30 | resources.o: $(windres_SOURCES) 31 | -------------------------------------------------------------------------------- /inst/platform/linux/build_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # KevEdit linux AppImage build script 3 | # Run in kevedit/build_appimage container 4 | set -e -x 5 | 6 | SOURCE="$1" 7 | KEVEDIT_VERSION="$2" 8 | if [ -z "$SOURCE" ] || [ -z "$KEVEDIT_VERSION" ]; then 9 | echo "USAGE: build_linux.sh " 10 | exit 1 11 | fi 12 | export KEVEDIT_VERSION 13 | 14 | rm -rf /work/appdir 15 | mkdir -p /work/appdir/KevEdit.AppDir 16 | 17 | rm -rf /work/kevedit 18 | mkdir /work/kevedit 19 | cd /work/kevedit 20 | 21 | unzip /vendor/$SOURCE 22 | 23 | ./bootstrap.sh 24 | ./configure --prefix=/work/appdir/KevEdit.AppDir/usr CFLAGS='-O3' 25 | make 26 | make install 27 | 28 | cp -a /platform/linux/kevedit.desktop /work/appdir/KevEdit.AppDir/ 29 | cp -a /work/kevedit/inst/icon512.png /work/appdir/KevEdit.AppDir/kevedit.png 30 | cp /vendor/AppRun-${KEVEDIT_VERSION}-x86_64 /work/appdir/KevEdit.AppDir/AppRun 31 | 32 | mkdir -p /work/appdir/KevEdit.AppDir/usr/lib 33 | cp -a /usr/local/lib/libSDL2*.so* /work/appdir/KevEdit.AppDir/usr/lib/ 34 | -------------------------------------------------------------------------------- /inst/platform/dos/gcc12.10-poisoned-calloc-musl.patch: -------------------------------------------------------------------------------- 1 | --- build/djcross-gcc-12.1.0/gnu/gcc-1210/gcc/cp/mapper-client.cc.orig 2 | +++ build/djcross-gcc-12.1.0/gnu/gcc-1210/gcc/cp/mapper-client.cc 3 | @@ -19,4 +19,5 @@ 4 | . */ 5 | 6 | +#include 7 | #include "config.h" 8 | #if defined (__unix__) && !defined(__DJGPP__) 9 | --- build/djcross-gcc-12.1.0/gnu/gcc-1210/gcc/cp/module.cc.orig 10 | +++ build/djcross-gcc-12.1.0/gnu/gcc-1210/gcc/cp/module.cc 11 | @@ -19,4 +19,6 @@ 12 | . */ 13 | 14 | +#include 15 | + 16 | /* Comments in this file have a non-negligible chance of being wrong 17 | or at least inaccurate. Due to (a) my misunderstanding, (b) 18 | --- build/djcross-gcc-12.1.0/gnu/gcc-1210/gcc/cp/mapper-resolver.cc.orig 19 | +++ build/djcross-gcc-12.1.0/gnu/gcc-1210/gcc/cp/mapper-resolver.cc 20 | @@ -21,4 +21,5 @@ 21 | /* Forward to the resolver in c++tools. */ 22 | 23 | +#include 24 | #include "config.h" 25 | #define INCLUDE_STRING 26 | -------------------------------------------------------------------------------- /dosbox/README: -------------------------------------------------------------------------------- 1 | Running ZZT under DOSBox 2 | ------------------------ 3 | ZZT works great in DOSBox. To automatically test worlds, we set up the 4 | following virtual DOS drives: 5 | 6 | C: -> ISO image containing ZZT runtime files 7 | D: -> Temporary directory containing TEST.ZZT (created by KevEdit) 8 | 9 | DOSBox starts up, and mounts those virtual drives. It runs skip.com, a simple 10 | program that injects [K] [C] [ENTER] into the keyboard buffer, conveniently 11 | skipping over the ZZT intro crap. It then copies all the ZZT stuff to the 12 | temporary D: drive, and runs ZZT with the test world. When ZZT exits, DOSBox 13 | runs EXIT, terminating the emulator. 14 | 15 | Painless! :) 16 | 17 | I was hoping to have DOSBox run ZZT directly from the ISO image, but ZZT seems 18 | to have trouble running worlds from the commandline that are not in its 19 | current directory. 20 | 21 | (Note: zzt.exe and zzt.dat are in the public domain. I wrote skip.com, and 22 | that is in the public domain also. Have fun with that.) 23 | 24 | -- kvance 2005 25 | -------------------------------------------------------------------------------- /src/themes/theme.h: -------------------------------------------------------------------------------- 1 | /* theme.h -- theme character arrays 2 | * $Id: theme.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2003 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #ifndef THEMES_THEME_H 21 | #define THEMES_THEME_H 1 22 | 23 | #include "rusty/rusty.h" 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/synth/synth.h: -------------------------------------------------------------------------------- 1 | /* sdl_synth.h -- SDL music synthesizer 2 | * $Id: synth.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2002 bitman 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef SYNTH_H 21 | #define SYNTH_H 1 22 | 23 | #ifdef SDL 24 | #include "sdl_synth.h" 25 | #elif defined DOS 26 | #include "pcspeaker.h" 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/display/display_stdio.h: -------------------------------------------------------------------------------- 1 | /* display_stdio.h -- Dummy display using stdio 2 | * $Id: display_stdio.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2003 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "display.h" 21 | 22 | #ifndef DISPLAY_STDIO_H 23 | #define DISPLAY_STDIO_H 1 24 | 25 | extern displaymethod display_stdio; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/kevedit/macos.h: -------------------------------------------------------------------------------- 1 | /* macos.m -- macOS specific functions 2 | * Copyright (C) 2019 Kev Vance 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef _MACOS_H 20 | #define _MACOS_H 21 | 22 | #include "SDL2/SDL.h" 23 | 24 | void installTouchBar(SDL_Window *window); 25 | 26 | void enableTouchBarWithTextMode(bool textMode); 27 | void disableTouchBar(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/display/display_dos.h: -------------------------------------------------------------------------------- 1 | /* display_dos.h -- DOS display method 2 | * $Id: display_dos.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2000 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef DISPLAY_DOS_H 21 | #define DISPLAY_DOS_H 1 22 | 23 | #include "display.h" 24 | 25 | extern displaymethod display_dos; 26 | 27 | #endif /* _DISPLAY_DOS_H */ 28 | -------------------------------------------------------------------------------- /src/texteditor/display.h: -------------------------------------------------------------------------------- 1 | /**@file texteditor/display.h Text editor display functions. 2 | * $Id: display.h,v 1.1 2003/12/20 09:12:21 bitman Exp $ 3 | * @author Ryan Phillips 4 | * 5 | * Copyright (C) 2003 Ryan Phillips 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef TEXTEDITOR_DISPLAY_H 23 | #define TEXTEDITOR_DISPLAY_H 24 | 25 | void texteditUpdateDisplay(texteditor * editor); 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | tags: 8 | - '*' 9 | pull_request: 10 | branches: 11 | - main 12 | 13 | jobs: 14 | build: 15 | timeout-minutes: 30 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | target: 20 | - appimage 21 | - dos 22 | - macos 23 | - source 24 | - windows 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v3 28 | with: 29 | fetch-depth: 0 30 | - run: | 31 | # build script for ${{ matrix.target }} 32 | cd inst 33 | ./build.py ${{ matrix.target }} 34 | - name: per-target artifact 35 | uses: actions/upload-artifact@v3 36 | with: 37 | name: kevedit-${{ matrix.target }} 38 | path: inst/dist/* 39 | if: github.event_name != 'pull_request' 40 | - name: combined artifact 41 | uses: actions/upload-artifact@v3 42 | with: 43 | name: all 44 | path: inst/dist/* 45 | if: github.event_name != 'pull_request' 46 | -------------------------------------------------------------------------------- /src/display/colours.h: -------------------------------------------------------------------------------- 1 | /* colours.h -- colour defines 2 | * $Id: colours.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | */ 4 | 5 | #ifndef __COLOURS_H 6 | #define __COLOURS_H 7 | 8 | #define BLACK_F 0x00 9 | #define BLUE_F 0x01 10 | #define GREEN_F 0x02 11 | #define RED_F 0x04 12 | #define CYAN_F 0x03 13 | #define MAGENTA_F 0x05 14 | #define YELLOW_F 0x06 15 | #define BROWN_F 0x06 16 | #define WHITE_F 0x07 17 | #define BRIGHT_F 0x08 18 | 19 | #define BLACK_B 0x00 20 | #define BLUE_B 0x10 21 | #define GREEN_B 0x20 22 | #define RED_B 0x40 23 | #define CYAN_B 0x30 24 | #define MAGENTA_B 0x50 25 | #define YELLOW_B 0x60 26 | #define BROWN_B 0x60 27 | #define WHITE_B 0x70 28 | #define BRIGHT_B 0x80 29 | 30 | typedef struct textcolor { 31 | int fg, bg; 32 | int blink; 33 | } textcolor; 34 | 35 | #define encodecolor(tcolor) (((tcolor.fg) & 0x0F) | ((tcolor.bg) << 4) | ((tcolor.blink) << 7)) 36 | #define makecolor(fg, bg, blink) (((fg) & 0x0F) | ((bg) << 4) | ((blink) << 7)) 37 | #define colorfg(color) ((color) & 0x0F) 38 | #define colorbg(color) (((color) & 0x70) >> 4) 39 | #define colorblink(color) ((color) >> 7) 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for KevEdit 2 | 3 | AUTOMAKE_OPTIONS = 1.6.3 4 | 5 | SUBDIRS = docs dosbox glob src 6 | 7 | EXTRA_DIST = README.md bootstrap.sh default.zln inst/.dockerignore inst/build.py inst/Dockerfile.appimage \ 8 | inst/Dockerfile.dos inst/Dockerfile.macos inst/Dockerfile.macos_sdk_extractor inst/Dockerfile.source \ 9 | inst/Dockerfile.windows inst/icon16.png inst/icon24.png inst/icon32.png inst/icon48.png inst/icon128.png \ 10 | inst/icon256.png inst/icon512.png inst/icon.svg inst/platform legal.md soundfx.zzm \ 11 | src/themes/rusty/c2bin.py 12 | 13 | pkgdata_DATA = soundfx.zzm 14 | 15 | #if FREEDESKTOP 16 | desktopdir = $(datadir)/applications 17 | desktop_DATA = inst/platform/linux/kevedit.desktop 18 | 19 | ICON_SIZES = 16 32 128 256 512 20 | 21 | install-icons: 22 | for size in $(ICON_SIZES); do \ 23 | $(INSTALL_DATA) -D $(srcdir)/inst/icon$${size}.png $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/kevedit.png; \ 24 | done 25 | 26 | uninstall-icons: 27 | for size in $(ICON_SIZES); do \ 28 | rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/kevedit.png; \ 29 | done 30 | 31 | install-data-local: install-icons 32 | uninstall-local: uninstall-icons 33 | #endif 34 | -------------------------------------------------------------------------------- /inst/platform/dos/build_dos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # KevEdit DOS build script 3 | # Run in kevedit/build_dos container 4 | set -e -x 5 | 6 | SOURCE="$1" 7 | KEVEDIT_VERSION="$2" 8 | if [ -z "$SOURCE" ] || [ -z "$KEVEDIT_VERSION" ]; then 9 | echo "USAGE: build_dos.sh " 10 | exit 1 11 | fi 12 | export KEVEDIT_VERSION 13 | 14 | rm -rf /work/kevedit 15 | mkdir /work/kevedit 16 | cd /work/kevedit 17 | 18 | unzip /vendor/$SOURCE 19 | 20 | ./bootstrap.sh 21 | ./configure --host=i586-pc-msdosdjgpp --without-dosbox --without-sdl CFLAGS='-O3' 22 | make 23 | i586-pc-msdosdjgpp-strip src/kevedit/kevedit.exe 24 | 25 | rm -rf /work/kevedit_zip 26 | mkdir /work/kevedit_zip 27 | cp src/kevedit/kevedit.exe \ 28 | docs/kevedit.zml \ 29 | soundfx.zzm \ 30 | inst/platform/dos/cwsdpmi.exe \ 31 | /work/kevedit_zip/ 32 | 33 | # Add .txt and fix newlines 34 | for fn in AUTHORS ChangeLog COPYING; do 35 | sed -e 's/$/\r/' <$fn >/work/kevedit_zip/$fn.txt 36 | done 37 | # Fix markdown newlines 38 | for fn in README.md legal.md; do 39 | sed -e 's/$/\r/' <$fn >/work/kevedit_zip/$fn 40 | done 41 | 42 | dist_zip=/dist/kevedit-${KEVEDIT_VERSION}-dos.zip 43 | rm -f "$dist_zip" 44 | cd /work/kevedit_zip 45 | zip -9 "$dist_zip" * 46 | -------------------------------------------------------------------------------- /glob/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*-Makefile-*-, or close enough 2 | # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 3 | # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 4 | # This file is part of GNU Make. 5 | # 6 | # GNU Make is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 3 of the License, or (at your option) any later 9 | # version. 10 | # 11 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 12 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | # details. 15 | # 16 | # You should have received a copy of the GNU General Public License along with 17 | # this program. If not, see . 18 | 19 | AUTOMAKE_OPTIONS = foreign 20 | 21 | # Only build the library when the system doesn't already have GNU glob. 22 | if USE_LOCAL_GLOB 23 | noinst_LIBRARIES = libglob.a 24 | endif 25 | 26 | libglob_a_SOURCES = glob.c glob.h fnmatch.c fnmatch.h 27 | 28 | 29 | EXTRA_DIST = COPYING.LIB Makefile.ami SCOPTIONS SMakefile \ 30 | configure.bat 31 | -------------------------------------------------------------------------------- /src/texteditor/select.h: -------------------------------------------------------------------------------- 1 | /**@file texteditor/select.h Text editor selection, copy, and paste. 2 | * $Id: select.h,v 1.1 2003/12/21 03:21:29 bitman Exp $ 3 | * @author Ryan Phillips 4 | * 5 | * Copyright (C) 2003 Ryan Phillips 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "texteditor.h" 23 | 24 | void texteditHandleCopy(texteditor * editor); 25 | void texteditHandleSelection(texteditor * editor); 26 | 27 | void texteditClearSelectedText(texteditor * editor); 28 | void texteditPaste(texteditor * editor); 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/kevedit/menu.h: -------------------------------------------------------------------------------- 1 | /* menu.h -- Code for using the F1-3 panels 2 | * $Id: menu.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2000 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef _MENU_H 21 | #define _MENU_H 22 | 23 | #include "kevedit.h" 24 | 25 | #include "display/display.h" 26 | 27 | int itemmenu(keveditor * myeditor); 28 | int creaturemenu(keveditor * myeditor); 29 | int terrainmenu(keveditor * myeditor); 30 | int objectlibrarymenu(keveditor * myeditor); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /inst/platform/windows/build_windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # KevEdit windows build script 3 | # Run in kevedit/build_windows container 4 | set -e -x 5 | 6 | SOURCE="$1" 7 | KEVEDIT_VERSION="$2" 8 | SDL_VERSION="$3" 9 | if [ -z "$SOURCE" ] || [ -z "$KEVEDIT_VERSION" ] || [ -z "$SDL_VERSION" ]; then 10 | echo "USAGE: build_windows.sh " 11 | exit 1 12 | fi 13 | export KEVEDIT_VERSION 14 | 15 | rm -rf /work/kevedit 16 | mkdir /work/kevedit 17 | cd /work/kevedit 18 | 19 | unzip /vendor/$SOURCE 20 | 21 | ./bootstrap.sh 22 | ./configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 CFLAGS="-O3" 23 | make 24 | 25 | # Add .txt and fix newlines 26 | for fn in AUTHORS ChangeLog COPYING; do 27 | cp /work/kevedit/$fn /work/$fn.txt 28 | sed -e 's/$/\r/' /work/$fn.txt 29 | done 30 | # Fix markdown newlines 31 | for fn in README.md legal.md; do 32 | sed -i -e 's/$/\r/' /work/kevedit/$fn 33 | done 34 | 35 | # Extract SDL runtime 36 | rm -rf /work/sdl 37 | mkdir /work/sdl 38 | cd /work/sdl 39 | unzip -j /vendor/SDL2-${SDL_VERSION}-win32-x64.zip 40 | 41 | HOME=/work wine /innosetup/app/ISCC.exe - if you have any 27 | questions, problems, or praise. Also 28 | consider posting to the "ZZT Editors" 29 | forum on http://zzt.the-underdogs.org/ if 30 | you have a general question. For 31 | announcements and general discussion of 32 | KevEdit, visit the Forums on KevEdit's 33 | development page: 34 | 35 | http://sourceforge.net/projects/kevedit/ 36 | 37 | If you find a bug, try to fix it and send 38 | in a patch. :) If you can't fix it, 39 | report it. For the overzealous, you can do 40 | what bitman did join in on the development 41 | if you find sending in patches too 42 | tedious. CVS is great for that sort of 43 | thing. 44 | -------------------------------------------------------------------------------- /src/synth/pcspeaker.h: -------------------------------------------------------------------------------- 1 | /* pcspeaker.c -- PC speaker music synthesizer 2 | * $Id: pcspeaker.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2001 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef PC_SPEAKER_H 21 | #define PC_SPEAKER_H 1 22 | 23 | #include "notes.h" 24 | 25 | /* Play a single note. Program will halt until playback has finished. */ 26 | void pcSpeakerPlayNote(musicalNote note, musicSettings settings); 27 | 28 | /* Call immediately after note playback to silence the speaker */ 29 | void pcSpeakerFinish(void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/zlaunch/dosbox.h: -------------------------------------------------------------------------------- 1 | /* dosbox.h -- Routines for calling DOSBox to run ZZT 2 | * $Id: dosbox.h,v 1.1 2005/06/29 03:22:57 kvance Exp $ 3 | * Copyright (C) 2002 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | /* Only do this if we want DOSBox support */ 25 | #ifdef DOSBOX 26 | 27 | #ifndef _DOSBOX_H 28 | #define _DOSBOX_H 1 29 | 30 | /* DOSBox launch function */ 31 | int dosbox_launch(char *datapath, char *worldpath, char *world); 32 | 33 | #endif /* _DOSBOX_H */ 34 | 35 | #endif /* DOSBOX */ 36 | -------------------------------------------------------------------------------- /legal.md: -------------------------------------------------------------------------------- 1 | # Copyright Notices 2 | 3 | KevEdit includes code from the Reconstruction of ZZT. 4 | 5 | Copyright (c) 2020 Adrian Siekierka 6 | 7 | Based on a reconstruction of code from ZZT, 8 | Copyright 1991 Epic MegaGames, used with permission. 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | -------------------------------------------------------------------------------- /src/display/unicode.h: -------------------------------------------------------------------------------- 1 | /* unicode.h -- Unicode to CP437 lookup table 2 | * $Id: unicode.h,v 1.0 2023/08/30 18:58:49 kristomu Exp $ 3 | * Copyright (C) 2023 Kristofer Munsterhjelm 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef UNICODE_DEFS_H 21 | #define UNICODE_DEFS_H 1 22 | 23 | #include "stddef.h" 24 | 25 | extern char unicode_to_CP437[65536]; 26 | extern int unicode_conversion_inited; 27 | 28 | void init_unicode_conversion(); 29 | 30 | /* Returns 0 if either the code point is out of range 31 | or there's no CP437 character for it. */ 32 | char get_CP437_from_UTF8(char * utf8_str); 33 | 34 | #endif -------------------------------------------------------------------------------- /src/dialogs/infobox.h: -------------------------------------------------------------------------------- 1 | /* infobox.h - board/world information dialogs 2 | * $Id: infobox.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __INFOBOX_H 21 | #define __INFOBOX_H 22 | 23 | #include "libzzt2/zzt.h" 24 | #include "display/display.h" 25 | #include "kevedit/kevedit.h" 26 | 27 | /* editboardinfo() - brings up dialog box for editing board info */ 28 | int editboardinfo(ZZTworld* myworld, displaymethod* d); 29 | 30 | /* editworldinfo() - brings up dialog box for editing world info */ 31 | int editworldinfo(keveditor *myeditor); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /inst/Dockerfile.windows: -------------------------------------------------------------------------------- 1 | FROM debian:11.6-slim 2 | ARG MAKE_OPTS=-j12 3 | 4 | RUN dpkg --add-architecture i386 && \ 5 | apt-get update && \ 6 | apt-get install -y automake autotools-dev build-essential genisoimage mingw-w64 pkgconf \ 7 | unzip wine32 && \ 8 | ln -sf /usr/bin/genisoimage /usr/bin/mkisofs 9 | 10 | ARG INNOEXTRACT_VERSION 11 | COPY vendor/innoextract-${INNOEXTRACT_VERSION}-linux.tar.xz /tmp/ 12 | RUN cd /tmp && \ 13 | tar xf innoextract-${INNOEXTRACT_VERSION}-linux.tar.xz && \ 14 | cp innoextract-${INNOEXTRACT_VERSION}-linux/bin/amd64/innoextract /usr/local/bin && \ 15 | rm -rf /tmp/innoextract-${INNOEXTRACT_VERSION}* 16 | 17 | ENV PATH="/usr/x86_64-w64-mingw32/bin:${PATH}" 18 | ARG SDL_VERSION 19 | COPY vendor/SDL2-${SDL_VERSION}.tar.gz /tmp/ 20 | RUN cd /tmp && \ 21 | tar xzf SDL2-${SDL_VERSION}.tar.gz && \ 22 | cd SDL2-${SDL_VERSION} && \ 23 | ./configure --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 && \ 24 | make ${MAKE_OPTS} && \ 25 | make install && \ 26 | echo "/usr/x86_64-w64-mingw32/share/aclocal" > /usr/share/aclocal/dirlist && \ 27 | rm -rf /tmp/SDL2-${SDL_VERSION}* 28 | 29 | ARG INNOSETUP_VERSION 30 | COPY vendor/innosetup-${INNOSETUP_VERSION}.exe /tmp/ 31 | RUN mkdir /innosetup && \ 32 | innoextract -d /innosetup /tmp/innosetup-${INNOSETUP_VERSION}.exe && \ 33 | rm -f /tmp/innosetup-${INNOSETUP_VERSION}.exe 34 | 35 | -------------------------------------------------------------------------------- /src/display/palette.h: -------------------------------------------------------------------------------- 1 | /* charset.h -- Defines for custom color palette 2 | * Copyright (C) 2023 Kev Vance 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef PALETTE_H 20 | #define PALETTE_H 1 21 | 22 | #include 23 | 24 | /* Palette size, in bytes. */ 25 | #define PALETTE_SIZE (48) 26 | 27 | typedef struct { 28 | char *path; 29 | uint8_t data[PALETTE_SIZE]; 30 | } palette; 31 | 32 | extern const palette default_palette; 33 | 34 | /* Return a new palette from the file at this path, or NULL if it could not be loaded. */ 35 | palette *palette_load(char *path); 36 | 37 | /* Free a palette returned from load_palette */ 38 | void palette_free(palette *char_set); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/structures/gradient.h: -------------------------------------------------------------------------------- 1 | /* gradient.h -- mathematical routines for drawing a gradient 2 | * $Id: gradient.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __GRADIENT_H 21 | #define __GRADIENT_H 1 22 | 23 | /* Types of gradients */ 24 | #define GRAD_LINEAR 0 25 | #define GRAD_BILINEAR 1 26 | #define GRAD_RADIAL 2 27 | #define GRAD_SCALEDRADIAL 3 28 | 29 | typedef struct gradline { 30 | int x1, y1; 31 | int x2, y2; 32 | int type; 33 | int randomness; 34 | } gradline; 35 | 36 | float gradientdistance(gradline grad, int x, int y); 37 | int gradientscaledistance(gradline grad, int x, int y, int length); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/texteditor/zzm.h: -------------------------------------------------------------------------------- 1 | /* zzm.h -- zzm file routines 2 | * $Id: zzm.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __ZZM_H 21 | #define __ZZM_H 22 | 23 | #include "structures/svector.h" 24 | #include "display/display.h" 25 | 26 | 27 | /* zzmpullsong() - pulls song #songnum out of zzmv and returns it */ 28 | stringvector zzmpullsong(stringvector * zzmv, int songnum); 29 | 30 | /* zzmpicksong() - presents a dialog to choose a song based on title */ 31 | int zzmpicksong(stringvector * zzmv, displaymethod * d); 32 | 33 | /* zzmripsong() - rip a song from zzt object code */ 34 | stringvector zzmripsong(stringvector * zoc, int maxseparation); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/display/casing.h: -------------------------------------------------------------------------------- 1 | /* casing.h -- Upper/lowercase functions for code page 437. 2 | * Copyright (C) 2023 Kristofer Munsterhjelm 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef CASING_H 20 | #define CASING_H 1 21 | 22 | /* Note that the following tables follow the unicode.c convention that 23 | uppercase phi is theta, to simulate ø and Ø. */ 24 | 25 | /* The corresponding uppercase code page 437 character for any CP437 character */ 26 | extern const char cp437_uppercase[256]; 27 | 28 | /* The corresponding lowercase code page 437 character for any CP437 character */ 29 | extern const char cp437_uppercase[256]; 30 | 31 | /* Uppercasing and lowercasing functions */ 32 | char tocupper(int c); 33 | char toclower(int c); 34 | 35 | #endif -------------------------------------------------------------------------------- /src/display/charset.h: -------------------------------------------------------------------------------- 1 | /* charset.h -- Defines for character set 2 | * Copyright (C) 2023 Kev Vance 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef CHARSET_H 20 | #define CHARSET_H 1 21 | 22 | #include 23 | 24 | /* Character set buffer size, in bytes. */ 25 | #define CHARSET_SIZE (3584) 26 | 27 | /* Character height, in pixels. */ 28 | #define CHARACTER_HEIGHT (14) 29 | 30 | typedef struct { 31 | char *path; 32 | uint8_t data[CHARSET_SIZE]; 33 | } charset; 34 | 35 | extern const charset default_charset; 36 | 37 | /* Return a new charset from the file at this path, or NULL if it could not be loaded. */ 38 | charset *charset_load(char *path); 39 | 40 | /* Free a charset returned from load_charset */ 41 | void charset_free(charset *char_set); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/synth/zzm.h: -------------------------------------------------------------------------------- 1 | /* zzm.h -- zzm music format 2 | * $Id: zzm.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SYNTH_ZZM_H 21 | #define __SYNTH_ZZM_H 22 | 23 | #include "notes.h" 24 | 25 | #define ZZM_MAXOCTAVE 3 26 | #define ZZM_MINOCTAVE -2 27 | 28 | /* Generate default ZZM note settings */ 29 | musicalNote zzmGetDefaultNote(void); 30 | 31 | /* Generate default ZZM playback settings */ 32 | musicSettings zzmGetDefaultSettings(void); 33 | 34 | /* Read a note from a tune, using the previous note for defaults */ 35 | musicalNote zzmGetNote(char* tune, musicalNote previousNote); 36 | 37 | /* Read a chain of notes from a tune (use deleteNoteChain() when done) */ 38 | musicalNote* zzmGetNoteChain(char* tune, musicalNote defNote); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/texteditor/test.c: -------------------------------------------------------------------------------- 1 | /**@file texteditor/test.c Test texteditor. 2 | * $Id: test.c,v 1.2 2005/05/28 03:17:46 bitman Exp $ 3 | * @author Ryan Phillips 4 | * 5 | * Copyright (C) 2003 Ryan Phillips 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | 27 | #include "lineeditor.h" 28 | #include "display/display.h" 29 | #include "display/colours.h" 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | displaymethod * d; 34 | lineeditor * editor; 35 | 36 | RegisterDisplays(); 37 | d = &display; 38 | 39 | d->init(); 40 | 41 | editor = createlineeditor(2, 5, "Foo bar", 16, d); 42 | editor->visiblewidth = 10; 43 | editor->colour = BLUE_B | WHITE_F | BRIGHT_F; 44 | editline(editor); 45 | deletelineeditor(editor); 46 | 47 | d->end(); 48 | 49 | return 0; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/display/display.c: -------------------------------------------------------------------------------- 1 | /* display.c -- Functions for the modular display 2 | * $Id: display.c,v 1.3 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2000 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #if defined HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "display.h" 25 | #include "display_stdio.h" 26 | 27 | #if defined(SDL) 28 | #include "display_sdl.h" 29 | #endif 30 | #if defined(VCSA) 31 | #include "display_vcsa.h" 32 | #endif 33 | #if defined(DOS) 34 | #include "display_dos.h" 35 | #endif 36 | 37 | displaymethod display; 38 | 39 | void RegisterDisplays() 40 | { 41 | #if defined(DOS) 42 | display = display_dos; 43 | #elif defined(SDL) 44 | display = display_sdl; 45 | #if defined(VCSA) 46 | display.next = &display_vcsa; 47 | #endif 48 | #else 49 | display = display_stdio; 50 | #endif 51 | } 52 | -------------------------------------------------------------------------------- /src/texteditor/zzl.h: -------------------------------------------------------------------------------- 1 | /* zzl.c -- ZZT Object Library file routines 2 | * $Id: zzl.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __ZZL_H 21 | #define __ZZL_H 22 | 23 | #include "kevedit/kevedit.h" 24 | #include "structures/svector.h" 25 | #include "display/display.h" 26 | 27 | /* zzlpickobject() - presents a list of objects in the zzl file. zzlv->cur is 28 | * set to the title line of the selected object */ 29 | int zzlpickobject(stringvector * zzlv, displaymethod * d); 30 | 31 | /* zzlpullobject() - pulls the object who's zzl definition starts on the 32 | * currentt line. */ 33 | ZZTtile zzlpullobject(stringvector zzlv, int x, int y, int undert, int underc); 34 | 35 | /* zzlappendobject() - appends an object to a zzl with given title */ 36 | int zzlappendobject(stringvector * zzlv, ZZTtile obj, char* title, int editwidth); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /docs/kevedit.hlp: -------------------------------------------------------------------------------- 1 | @Using KevEdit 2 | $----------------------------------------- 3 | KevEdit 1.2.1 4 | Powerful ZZT Editing 5 | $----------------------------------------- 6 | Copyright (C) 2000-2005, 2017-2023 7 | Kev Vance 8 | With many contributions by 9 | bitman 10 | :top; 11 | :contents;Using Kevedit 12 | !-knew;* New features * 13 | !-kbasics;Basics of Using KevEdit 14 | !-kkeys;Keystroke Quick Reference 15 | 16 | !-kbackbuf;The Backbuffer 17 | !-kselect;Tile Selection 18 | !-kstats;Stats Editor 19 | !-kobjedit;The Object Code Editor 20 | 21 | !-kbrdinfo;Board Information 22 | !-kwldinfo;World Information 23 | !-ktileinf;Tile Information 24 | 25 | !-item;Items 26 | !-creature;Creatures 27 | !-terrain;Terrain 28 | 29 | !-ksupport;Support and Troubleshooting 30 | !help;The Help System 31 | !quit;Quitting 32 | !enjoy;Enjoy! 33 | 34 | :help;Help! 35 | 36 | KevEdit includes a fully functional help 37 | system, as you are very much aware since 38 | you are reading this. 39 | !-kobjedit:help;Object Editor Help 40 | 41 | :quit;Quitting 42 | 43 | For your safety, pressing 'q' will ask if 44 | you really want to quit. If you answer in 45 | the affirmative, KevEdit will terminate. 46 | It will not ask you if you really /really/ 47 | want to quit, or perhaps you would just 48 | like to save your work instead, because I 49 | hate it when programs doubt my quititude. 50 | 51 | :enjoy;Enjoy! 52 | 53 | We hope you enjoy using KevEdit as much as 54 | we enjoyed creating it. Feedback is always 55 | welcome; we'd love to hear what you think 56 | of our work. 57 | 58 | Kev Vance 59 | Ryan Phillips 60 | November 16, 2023 61 | -------------------------------------------------------------------------------- /src/help/hypertxt.h: -------------------------------------------------------------------------------- 1 | /* hypertxt.h -- hypertext link system 2 | * $Id: hypertxt.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __HYPERTXT_H 21 | #define __HYPERTXT_H 1 22 | 23 | #include "structures/svector.h" 24 | 25 | /* Test for !message;text on current line of sv. !;text returns true */ 26 | int ishypermessage(stringvector sv); 27 | 28 | /* Retrieve message from sv->cur if hyperline into malloc()ed string */ 29 | char* gethypermessage(stringvector sv); 30 | 31 | /* Move sv->cur to first instance of message msg in sv */ 32 | int findhypermessage(char* msg, stringvector* sv); 33 | 34 | /* Determines whether a message refers to a section as well */ 35 | int ishypersection(char* msg); 36 | 37 | /* Retrieve the section component of msg into malloc()ed string */ 38 | char* gethypersection(char* msg); 39 | 40 | /* Retrieve the msg component of msg into malloc()ed string */ 41 | char* gethypersectionmessage(char* msg); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /inst/platform/macos/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | kevedit 9 | CFBundleIconFile 10 | kevedit.icns 11 | CFBundleIdentifier 12 | com.kvance.kevedit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | KevEdit 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | @MACOS_PLIST_VERSION@ 21 | CFBundleVersion 22 | @MACOS_PLIST_VERSION@ 23 | LSMinimumSystemVersion 24 | 10.7 25 | NSHumanReadableCopyright 26 | Copyright © 2000-2023 Kevin Vance et al. 27 | NSHighResolutionCapable 28 | 29 | CFBundleDocumentTypes 30 | 31 | 32 | CFBundleTypeName 33 | ZZT World 34 | LSHandlerRank 35 | Alternate 36 | CFBundleTypeExtensions 37 | 38 | zzt 39 | 40 | CFBundleTypeRole 41 | Editor 42 | 43 | 44 | CFBundleTypeName 45 | ZZT Saved Game 46 | LSHandlerRank 47 | Alternate 48 | CFBundleTypeExtensions 49 | 50 | sav 51 | 52 | CFBundleTypeRole 53 | Editor 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/themes/rusty/tbox.c: -------------------------------------------------------------------------------- 1 | /* Image Saved In ACiDDRAW v1.1 */ 2 | /* $Id: tbox.c,v 1.1 2003/11/01 23:45:57 bitman Exp $ */ 3 | 4 | #define TITLE_BOX_WIDTH 39 5 | #define TITLE_BOX_DEPTH 3 6 | #define TITLE_BOX_LENGTH 234 7 | unsigned char TITLE_BOX[] = 8 | { 9 | '\xda', 0x2F, '\xc4', 0x2F, '\xc4', 0x2F, '\xc4', 0x2F, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 10 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 11 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 12 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 13 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 14 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xbf', 0x2A, '\xb3', 0x2A, ' ', 0x2A, ' ', 0x0F, 15 | ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, 16 | ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, 17 | ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, 18 | ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, 19 | ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x0F, ' ', 0x2A, 20 | '\xb3', 0x2A, '\xc0', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 21 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 22 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 23 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 24 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 25 | '\xc4', 0x2A, '\xc4', 0x2F, '\xc4', 0x2F, '\xc4', 0x2F, '\xd9', 0x2F}; 26 | -------------------------------------------------------------------------------- /src/themes/rusty/c2bin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Script to convert ANSI panel *.C source code to editable *.BIN files.""" 3 | import argparse 4 | import os.path 5 | import re 6 | import sys 7 | 8 | parser = argparse.ArgumentParser(description='Convert an ANSI image from .c to .bin') 9 | parser.add_argument('input', help='input .c file, or - for stdin') 10 | parser.add_argument('output', 11 | nargs=argparse.OPTIONAL, 12 | help='output .bin file, renaming *.c to *.bin if not given, or - for stdout') 13 | args = parser.parse_args() 14 | 15 | if args.input == '-': 16 | fin = sys.stdin 17 | else: 18 | fin = open(args.input, 'rt') 19 | source = fin.read() 20 | 21 | match = re.search(r'unsigned char [^{]+\{([^}]+)}', source, re.MULTILINE) 22 | if not match: 23 | print('Could not find unsigned char array in input', file=sys.stderr) 24 | sys.exit(1) 25 | items = [item.strip() for item in match.group(1).split(',')] 26 | 27 | 28 | def parse_array_item(s: str) -> int: 29 | original = s 30 | if m := re.match(r"'(.)'", s): 31 | result = ord(m.group(1)) 32 | else: 33 | if m := re.match(r"'\\x([0-9a-f]{1,2})'", s): 34 | s = f'0x{m.group(1)}' 35 | try: 36 | result = int(s, 0) 37 | except ValueError: 38 | print(f'Could not parse {original} as integer', file=sys.stderr) 39 | sys.exit(1) 40 | if result < 0 or result > 255: 41 | print(f'Value {original} out of range', file=sys.stderr) 42 | sys.exit(1) 43 | return result 44 | 45 | 46 | values = bytes(parse_array_item(item) for item in items) 47 | output = args.output 48 | if output is None: 49 | output = os.path.splitext(args.input)[0] + '.bin' 50 | if output == '-': 51 | fout = sys.stdout 52 | else: 53 | fout = open(output, 'wb') 54 | fout.write(values) 55 | -------------------------------------------------------------------------------- /src/synth/sdl_synth.h: -------------------------------------------------------------------------------- 1 | /* sdl_synth.h -- SDL music synthesizer 2 | * $Id: sdl_synth.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2002 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef _SYNTH_H 21 | #define _SYNTH_H 1 22 | 23 | #include "SDL2/SDL.h" 24 | 25 | #include "notes.h" 26 | 27 | /* Open the synthesizer and store audio spec in "spec" (true on error) */ 28 | int OpenSynth(SDL_AudioDeviceID *id, SDL_AudioSpec * spec); 29 | 30 | /* Close the synthesizer */ 31 | void CloseSynth(SDL_AudioDeviceID *id); 32 | 33 | /* Returns true if the buffer is empty */ 34 | int IsSynthBufferEmpty(); 35 | 36 | /* Play a note on to the SDL synthesizer */ 37 | void SynthPlayNote(SDL_AudioSpec audiospec, musicalNote note, musicSettings settings); 38 | 39 | /* Add a frequency and duration to the SDL audio buffer */ 40 | void AddToBuffer(SDL_AudioSpec spec, float freq, float seconds, size_t *counter); 41 | 42 | /* Internal audio callback function (don't call manually!) */ 43 | void AudioCallback(void *userdata, Uint8 *stream, int len); 44 | 45 | /* Cleanup memory used by audio system */ 46 | void AudioCleanUp(); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /glob/configure.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 3 | rem 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 4 | rem This file is part of GNU Make. 5 | rem 6 | rem GNU Make is free software; you can redistribute it and/or modify it under 7 | rem the terms of the GNU General Public License as published by the Free 8 | rem Software Foundation; either version 3 of the License, or (at your option) 9 | rem any later version. 10 | rem 11 | rem GNU Make is distributed in the hope that it will be useful, but WITHOUT 12 | rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for. 14 | rem more details. 15 | rem 16 | rem You should have received a copy of the GNU General Public License along 17 | rem with this program. If not, see . 18 | 19 | echo Configuring glob for DJGPP 20 | rem This batch file assumes a unix-type "sed" program 21 | 22 | echo # Makefile generated by "configure.bat"> Makefile 23 | 24 | if exist config.sed del config.sed 25 | 26 | echo "s/@srcdir@/./ ">> config.sed 27 | echo "s/@CC@/gcc/ ">> config.sed 28 | echo "s/@CFLAGS@/-O2 -g/ ">> config.sed 29 | echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -I../ ">> config.sed 30 | echo "s/@AR@/ar/ ">> config.sed 31 | echo "s/@RANLIB@/ranlib/ ">> config.sed 32 | echo "s/@LDFLAGS@// ">> config.sed 33 | echo "s/@DEFS@// ">> config.sed 34 | echo "s/@ALLOCA@// ">> config.sed 35 | echo "s/@LIBS@// ">> config.sed 36 | echo "s/@LIBOBJS@// ">> config.sed 37 | echo "s/^Makefile *:/_Makefile:/ ">> config.sed 38 | echo "s/^config.h *:/_config.h:/ ">> config.sed 39 | 40 | sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed 41 | sed -f config2.sed Makefile.in >> Makefile 42 | del config.sed 43 | del config2.sed 44 | -------------------------------------------------------------------------------- /src/texteditor/register.h: -------------------------------------------------------------------------------- 1 | /* register.h -- text editor memory registers 2 | * $Id: register.h,v 1.2 2003/12/21 03:21:29 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __REGISTER_H 21 | #define __REGISTER_H 1 22 | 23 | 24 | #include "structures/svector.h" 25 | 26 | /* yanktext() stores data into a register. 27 | * puttext() pulls data from a register, storing it in a stringvector 28 | * clearregister() empties a register 29 | * deleteregister() frees all memory used by registers 30 | */ 31 | 32 | /** 33 | * Boundaries for a selected area of text. 34 | **/ 35 | typedef struct { 36 | stringnode * startLine; /**< First selected line. */ 37 | stringnode * endLine; /**< Last selected line. */ 38 | 39 | /** Position of selection start on first line. */ 40 | int startPos; 41 | /** Position of selection end on last line. */ 42 | int endPos; 43 | } selectionBounds; 44 | 45 | 46 | void regyank(char whichreg, selectionBounds bounds); 47 | void regstore(char whichreg, stringvector src); 48 | int regput(char whichreg, stringvector * dest, int inspos, int wrapwidth, int editwidth); 49 | void clearregister(char whichreg); 50 | void deleteregisters(void); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/kevedit/patbuffer.h: -------------------------------------------------------------------------------- 1 | /* patbuffer.h -- Pattern buffer (backbuffer) utilities 2 | * $Id: patbuffer.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2000 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef _PATBUFFER_H 21 | #define _PATBUFFER_H 1 22 | 23 | #include "libzzt2/zzt.h" 24 | #include "display/display.h" 25 | #include "display/colours.h" 26 | 27 | 28 | #define MAX_BACKBUF 1024 29 | 30 | /* Various levels of patbuffer locking */ 31 | #define PATBUF_UNLOCK 0x00 32 | #define PATBUF_NOPUSH 0x01 33 | #define PATBUF_NOREPLACE 0x02 34 | #define PATBUF_LOCK 0xFF 35 | 36 | typedef struct patbuffer { 37 | ZZTtile* patterns; 38 | int size; 39 | int pos; 40 | 41 | int lock; 42 | } patbuffer; 43 | 44 | typedef struct backbuffers { 45 | /* Pattern buffers */ 46 | patbuffer* pbuf; 47 | patbuffer* standard_patterns; 48 | patbuffer* backbuffer; 49 | } backbuffers; 50 | 51 | 52 | patbuffer* patbuffer_create(int size); 53 | void deletepatternbuffer(patbuffer* pbuf); 54 | void patbuffer_resize(patbuffer * pbuf, int delta); 55 | 56 | void pat_applycolordata(patbuffer * pbuf, textcolor color); 57 | 58 | void push(patbuffer* pbuf, ZZTtile tile); 59 | void patreplace(patbuffer * pbuf, ZZTtile pattern); 60 | 61 | #endif /* _PATBUFFER_H */ 62 | -------------------------------------------------------------------------------- /src/help/help.h: -------------------------------------------------------------------------------- 1 | /* help.h -- hypertext help system 2 | * $Id: help.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __HELP_H 21 | #define __HELP_H 1 22 | 23 | #include "display/display.h" 24 | #include "structures/svector.h" 25 | 26 | /* inithelpsystem() - init help system and load the given help metafile. true 27 | * on error */ 28 | int inithelpsystem(char* datapath); 29 | 30 | /* deletehelpsystem() - clear out the help system (use upon exit) */ 31 | void deletehelpsystem(void); 32 | 33 | /* help() - Displays copyright and default help section */ 34 | int help(displaymethod* d); 35 | 36 | /* For both helptopic() and helpfiletopic(): 37 | * Return value is true when browsing should continue (i.e. "back") */ 38 | 39 | /* helptopic() - Displays help topic for topic in given section. For NULL or "" 40 | * topic, browsing begins current position in section */ 41 | int helptopic(stringvector section, char* topic, displaymethod* d); 42 | 43 | /* helptopic() - Displags help for given section title and topic. For NULL or 44 | * "" topic, browsing begins at the top of the section */ 45 | int helpsectiontopic(char* sectiontitle, char* topic, displaymethod* d); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/display/display_sdl.h: -------------------------------------------------------------------------------- 1 | /* display_sdl.h -- SDL display 2 | * $Id: display_sdl.h,v 1.3 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2002 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "SDL2/SDL.h" 21 | 22 | #include "textblock.h" 23 | 24 | #include 25 | #include 26 | 27 | #ifndef DISPLAY_SDL 28 | #define DISPLAY_SDL 1 29 | 30 | /* This structure has pointers to all important video information */ 31 | typedef struct 32 | { 33 | SDL_Window *window; 34 | SDL_Renderer *renderer; 35 | SDL_Texture *texture; /* GPU texture to be updated */ 36 | Uint32 *pixels; /* Screen pixels, each element an ARGB */ 37 | textBlock *buffer; /* Emualted VRAM */ 38 | Uint8 *char_set; /* Pointer to character set */ 39 | Uint32 *palette; /* Pointer to expanded palette */ 40 | Uint32 write_x; /* Current x write position in VRAM */ 41 | Uint32 write_y; /* Current y write position in VRAM */ 42 | 43 | /* Info for reinitializing the screen */ 44 | Uint32 width, height, depth, vflags; 45 | 46 | bool is_fullscreen; 47 | bool is_dirty; 48 | 49 | enum displaycontext context; 50 | } video_info; 51 | 52 | /* For RegisterDisplays() */ 53 | extern displaymethod display_sdl; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /inst/Dockerfile.macos: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17.2 2 | ARG MAKE_OPTS=-j12 3 | 4 | # Install OS packages required for osxcross 5 | RUN apk update \ 6 | && apk add autoconf automake bash cdrkit clang clang-dev libressl libuuid llvm-dev llvm-static \ 7 | make musl-fts patch pkgconf xz-libs \ 8 | && apk add --virtual dev-deps autoconf automake bsd-compat-headers cmake g++ git libressl-dev \ 9 | libtool libxml2-dev linux-headers musl-dev musl-fts-dev patch python3 tar util-linux-dev xz \ 10 | xz-dev zlib-dev 11 | 12 | # Build osxcross 13 | ARG DARWIN_VERSION 14 | ARG MACOS_SDK_VERSION 15 | ARG OSXCROSS_VERSION=50e86ebca7d14372febd0af8cd098705049161b9 16 | COPY vendor/MacOSX${MACOS_SDK_VERSION}.sdk.tar.bz2 /tmp 17 | COPY vendor/osxcross-${OSXCROSS_VERSION}.zip /tmp 18 | RUN cd /tmp \ 19 | && unzip osxcross-${OSXCROSS_VERSION}.zip \ 20 | && cd osxcross-${OSXCROSS_VERSION} \ 21 | && mv /tmp/MacOSX${MACOS_SDK_VERSION}.sdk.tar.bz2 tarballs \ 22 | # Environment variable collission! Build script assumes a bunch of other env vars are set 23 | # if OSXCROSS_VERSION is set! 24 | && export OSXCROSS_VERSION= \ 25 | && export TARGET_DIR=/opt/osxcross \ 26 | && export UNATTENDED=1 \ 27 | && export ENABLE_COMPILER_RT_INSTALL=1 \ 28 | && ./build.sh \ 29 | && PATH=$PATH:/opt/osxcross/bin LD_LIBRARY_PATH=/opt/osxcross/lib ./build_compiler_rt.sh \ 30 | #Clean up 31 | && cd /tmp \ 32 | && rm -rf osxcross-${OSXCROSS_VERSION}* \ 33 | && apk del dev-deps 34 | 35 | ENV PATH=$PATH:/opt/osxcross/bin 36 | ENV LD_LIBRARY_PATH=/opt/osxcross/lib 37 | 38 | # Now that we have a toolchain, we can install SDL 39 | ARG SDL_VERSION 40 | COPY vendor/SDL2-${SDL_VERSION}.dmg /tmp 41 | RUN cd /tmp \ 42 | && apk add 7zip sdl2-dev \ 43 | # We installed the distro's sdl2-dev for autoconf's sake, but we want to use SDL2.framework, 44 | # not the build environment's copy of SDL so delete it from pkgconfig. 45 | && 7zz x SDL2-${SDL_VERSION}.dmg \ 46 | && rm /usr/lib/pkgconfig/sdl2.pc \ 47 | && cd /opt/osxcross/SDK/MacOSX${MACOS_SDK_VERSION}.sdk \ 48 | && mkdir -p ./Library/Frameworks \ 49 | && cp -a /tmp/SDL2/SDL2.framework ./Library/Frameworks/ \ 50 | && rm -rf SDL2-${SDL_VERSION}.dmg SDL2 \ 51 | && apk del 7zip 52 | -------------------------------------------------------------------------------- /src/synth/pcspeaker.c: -------------------------------------------------------------------------------- 1 | /* pcspeaker.c -- PC speaker music synthesizer 2 | * $Id: pcspeaker.c,v 1.3 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2001 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "pcspeaker.h" 25 | 26 | #include 27 | 28 | void pcSpeakerPlayNote(musicalNote note, musicSettings settings) 29 | { 30 | int frequency = noteFrequency(note, settings); 31 | int wait = noteDuration(note, settings); 32 | int spacing = noteSpacing(note, settings); 33 | int drumbreaktime = wait - DRUMBREAK * DRUMCYCLES; 34 | 35 | if (note.type == NOTETYPE_NOTE) { 36 | /* Play the sound at the frequency for a duration */ 37 | sound(frequency); 38 | delay(wait); 39 | } 40 | 41 | /* Rests are simple */ 42 | if (note.type == NOTETYPE_REST) { 43 | nosound(); 44 | delay(wait); 45 | } 46 | 47 | /* Drums */ 48 | if (note.type == NOTETYPE_DRUM) { 49 | int i; 50 | 51 | /* Loop through each drum cycle */ 52 | for (i = 0; i < DRUMCYCLES; i++) { 53 | sound(drums[note.index][i]); 54 | delay(DRUMBREAK); 55 | } 56 | nosound(); 57 | 58 | /* Add a break based on the current duration */ 59 | if( drumbreaktime > 0 ) { 60 | delay(drumbreaktime); 61 | } 62 | } 63 | 64 | if (spacing != 0.0) { 65 | nosound(); 66 | delay(spacing); 67 | } 68 | } 69 | 70 | void pcSpeakerFinish(void) 71 | { 72 | nosound(); 73 | } 74 | -------------------------------------------------------------------------------- /src/display/textblock.h: -------------------------------------------------------------------------------- 1 | /* textblock.h -- A block of coloured display text 2 | * $Id: textblock.h,v 1.2 2003/11/02 22:20:01 bitman Exp $ 3 | * Copyright (C) 2003 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #ifndef DISPLAY_TEXTBLOCK_H 21 | #define DISPLAY_TEXTBLOCK_H 1 22 | 23 | #include 24 | 25 | typedef uint8_t textDatum; 26 | 27 | /* A block of text with given width and height */ 28 | typedef struct textBlock { 29 | int width; 30 | int height; 31 | 32 | /* Char and colour data */ 33 | textDatum *data; 34 | } textBlock; 35 | 36 | #define textBlockChar(block, x, y) (block->data[((y) * block->width + (x)) * 2]) 37 | #define textBlockColour(block, x, y) (block->data[((y) * block->width + (x)) * 2 + 1]) 38 | #define textBlockDataSize(width, height) ((width) * (height) * 2) 39 | 40 | /* Create an empty textBlock */ 41 | textBlock * createTextBlock(int width, int height); 42 | 43 | /* Destroy a textBlock */ 44 | void deleteTextBlock(textBlock * block); 45 | 46 | /* Write a character to a text block */ 47 | void textBlockPutch(textBlock * block, int x, int y, 48 | textDatum ch, textDatum co); 49 | 50 | /* Copy one text block onto another */ 51 | /* Copies from src at (srcx, srcy)-(srcx+width, srcy+height) to 52 | (destx,desty)-(destx+width, desty+height). No error checking. */ 53 | void textBlockBlit(textBlock * src, textBlock * dest, int srcx, int srcy, 54 | int width, int height, int destx, int desty); 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/help/helplist.h: -------------------------------------------------------------------------------- 1 | /* helplist.h -- very simple linked list of help sections 2 | * $Id: helplist.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __HELPLIST_H 21 | #define __HELPLIST_H 22 | 23 | #include "structures/svector.h" 24 | 25 | /* Very simple linked list for compilation of helpsections */ 26 | typedef struct helpsection { 27 | /* Title (file name) and string vector containing the text of the section. 28 | * NULL for title indicates a control node, which is safely ignored */ 29 | char* title; 30 | stringvector sv; 31 | 32 | /* Next node in list (NULL indicates last node) */ 33 | struct helpsection* next; 34 | } helpsection; 35 | 36 | 37 | /* inithelpsection() - creates an empty help section */ 38 | void inithelpsection(helpsection* section); 39 | 40 | /* deletesectionlist() - free()s everything but the section itself */ 41 | void deletesectionlist(helpsection* section); 42 | 43 | /* appendsection() - appends src to the end of dest */ 44 | void appendsection(helpsection* dest, helpsection* src); 45 | 46 | /* findsection() - locates a section with given title in a section list */ 47 | helpsection* findsection(helpsection* sectionlist, char* title); 48 | 49 | /* loadhelpmetafile() - loads a help meta into the given help section list. 50 | * the original meta is destroyed in the process. true on 51 | * error */ 52 | int loadhelpmeta(helpsection* section, stringvector* meta); 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /glob/SMakefile: -------------------------------------------------------------------------------- 1 | # Makefile for standalone distribution of libglob.a (fnmatch, glob). 2 | # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 | # 2005, 2006, 2007 Free Software Foundation, Inc. 4 | # This file is part of GNU Make. 5 | # 6 | # GNU Make is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 3 of the License, or (at your option) any later 9 | # version. 10 | # 11 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 12 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | # details. 15 | # 16 | # You should have received a copy of the GNU General Public License along with 17 | # this program. If not, see . 18 | 19 | # Ultrix 2.2 make doesn't expand the value of VPATH. 20 | VPATH = /glob/ 21 | # This must repeat the value, because configure will remove `VPATH = .'. 22 | srcdir = /glob/ 23 | 24 | CC = sc 25 | CPPFLAGS = 26 | CFLAGS = 27 | MAKE = smake 28 | RM = delete 29 | 30 | # Information determined by configure. 31 | DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \ 32 | Define HAVE_DIRENT_H 33 | 34 | # How to invoke ar. 35 | AR = join 36 | ARFLAGS = as 37 | 38 | # How to invoke ranlib. 39 | RANLIB = ; 40 | 41 | .PHONY: all 42 | all: glob.lib 43 | 44 | glob.lib : glob.o fnmatch.o 45 | $(AR) $(ARFLAGS) $@ glob.o fnmatch.o 46 | $(RANLIB) $@ 47 | 48 | # For some reason, Unix make wants the dependencies on the source files. 49 | # Otherwise it refuses to use an implicit rule! 50 | # And, get this: it doesn't work to use $(srcdir)foo.c!! 51 | glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c 52 | fnmatch.o: $(srcdir)fnmatch.h fnmatch.c 53 | 54 | .c.o: 55 | $(CC) IDir "" \ 56 | $(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION) 57 | 58 | .PHONY: clean realclean glob-clean glob-realclean distclean 59 | clean glob-clean: 60 | -$(RM) -f glob.lib *.o core 61 | distclean glob-realclean: clean 62 | -$(RM) -f TAGS tags Makefile config.status config.h config.log 63 | realcean: distclean 64 | 65 | # For inside the C library. 66 | glob.tar glob.tar.Z: 67 | $(MAKE) -C .. $@ 68 | -------------------------------------------------------------------------------- /glob/Makefile.ami: -------------------------------------------------------------------------------- 1 | # Makefile for standalone libglob.a (fnmatch, glob). -*-Makefile-*- 2 | # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 | # 2005, 2006, 2007 Free Software Foundation, Inc. 4 | # This file is part of GNU Make. 5 | # 6 | # GNU Make is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 3 of the License, or (at your option) any later 9 | # version. 10 | # 11 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY 12 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | # details. 15 | # 16 | # You should have received a copy of the GNU General Public License along with 17 | # this program. If not, see . 18 | 19 | # Ultrix 2.2 make doesn't expand the value of VPATH. 20 | VPATH = /glob/ 21 | # This must repeat the value, because configure will remove `VPATH = .'. 22 | srcdir = /glob/ 23 | 24 | CC = sc 25 | RM = delete 26 | CPPFLAGS = 27 | CFLAGS = 28 | 29 | # Information determined by configure. 30 | DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \ 31 | Define HAVE_DIRENT_H 32 | 33 | # How to invoke ar. 34 | AR = join 35 | ARFLAGS = as 36 | 37 | # How to invoke ranlib. 38 | RANLIB = ; 39 | 40 | .PHONY: all 41 | all: glob.lib 42 | 43 | glob.lib : glob.o fnmatch.o 44 | $(AR) $(ARFLAGS) $@ glob.o fnmatch.o 45 | $(RANLIB) $@ 46 | 47 | # For some reason, Unix make wants the dependencies on the source files. 48 | # Otherwise it refuses to use an implicit rule! 49 | # And, get this: it doesn't work to use $(srcdir)foo.c!! 50 | glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c 51 | fnmatch.o: $(srcdir)fnmatch.h fnmatch.c 52 | 53 | OUTPUT_OPTION = 54 | .c.o: 55 | $(CC) IDir "" \ 56 | $(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION) 57 | 58 | .PHONY: clean realclean glob-clean glob-realclean distclean 59 | clean glob-clean: 60 | -$(RM) glob.lib "#?.o" core 61 | distclean glob-realclean: clean 62 | -$(RM) TAGS tags Makefile config.status config.h config.log 63 | realcean: distclean 64 | 65 | # For inside the C library. 66 | glob.tar glob.tar.Z: 67 | $(MAKE) -C .. $@ 68 | -------------------------------------------------------------------------------- /inst/platform/macos/build_macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # KevEdit macOS build script 3 | # Run in kevedit/build_macos container 4 | set -e -x 5 | 6 | SOURCE="$1" 7 | KEVEDIT_VERSION="$2" 8 | if [ -z "$SOURCE" ] || [ -z "$KEVEDIT_VERSION" ]; then 9 | echo "USAGE: build_macos.sh " 10 | exit 1 11 | fi 12 | export KEVEDIT_VERSION 13 | 14 | export MACOSX_DEPLOYMENT_TARGET=10.7 15 | 16 | rm -rf /work/KevEdit.app 17 | mkdir -p \ 18 | /work/KevEdit.app/Contents/MacOS \ 19 | /work/KevEdit.app/Contents/Resources \ 20 | /work/KevEdit.app/Contents/Frameworks 21 | cp -a /platform/macos/PkgInfo /work/KevEdit.app/Contents/ 22 | 23 | rm -rf /work/kevedit 24 | mkdir /work/kevedit 25 | cd /work/kevedit 26 | 27 | unzip /vendor/$SOURCE 28 | 29 | ./bootstrap.sh 30 | # Build binaries for both x86_64 and arm64 31 | for arch in x86_64 arm64; do 32 | test -f Makefile && make clean 33 | ./configure \ 34 | --host=$arch-apple-darwin20.4 \ 35 | --target=$arch-apple-darwin20.4 \ 36 | --with-sdl-framework \ 37 | CFLAGS="-O3" 38 | make AR=llvm-ar 39 | mv src/kevedit/kevedit /work/kevedit.bin.$arch 40 | done 41 | 42 | # Combine them into a universal binary 43 | lipo -create \ 44 | -output /work/KevEdit.app/Contents/MacOS/kevedit \ 45 | /work/kevedit.bin.* 46 | 47 | cp -a docs/kevedit.zml \ 48 | soundfx.zzm \ 49 | dosbox/kevedos.cfg \ 50 | dosbox/kevedos.iso \ 51 | /platform/macos/kevedit.icns \ 52 | /work/KevEdit.app/Contents/Resources/ 53 | cp -a inst/platform/macos/Info.plist /work/KevEdit.app/Contents/ 54 | 55 | `osxcross-conf` 56 | cp -a $OSXCROSS_SDK/Library/Frameworks/SDL2.framework /work/KevEdit.app/Contents/Frameworks 57 | rm /work/KevEdit.app/Contents/Frameworks/SDL2.framework/Headers 58 | rm -rf /work/KevEdit.app/Contents/Frameworks/SDL2.framework/Versions/Current/Headers 59 | 60 | rm -rf /work/dmg 61 | mkdir /work/dmg 62 | 63 | cp -a /work/KevEdit.app /work/dmg/ 64 | ln -s /Applications /work/dmg/ 65 | 66 | mkdir /work/dmg/.background 67 | cp -a /platform/macos/background.tiff \ 68 | /work/dmg/.background/dmg\ background.tiff 69 | 70 | cp -a /platform/macos/dmg.DS_Store \ 71 | /work/dmg/.DS_Store 72 | 73 | genisoimage -V KevEdit -D -R -apple -no-pad \ 74 | -o "/dist/kevedit-${KEVEDIT_VERSION}.dmg" \ 75 | /work/dmg/ 76 | -------------------------------------------------------------------------------- /src/texteditor/zoopdraw.h: -------------------------------------------------------------------------------- 1 | /* zoopdraw - draw zzt oop to a text display */ 2 | /* $Id: zoopdraw.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ */ 3 | /* Copyright (C) 2002 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #ifndef ZOOPDRAW_H 21 | #define ZOOPDRAW_H 1 22 | 23 | #include "libzzt2/zztoop.h" 24 | 25 | #include "display/display.h" 26 | 27 | /* Music string components */ 28 | #define ZOOPMUSIC_NOTE 0 29 | #define ZOOPMUSIC_REST 1 30 | #define ZOOPMUSIC_DRUM 2 31 | #define ZOOPMUSIC_TIME 3 32 | #define ZOOPMUSIC_TIMEMOD 4 33 | #define ZOOPMUSIC_OCTAVE 5 34 | #define ZOOPMUSIC_PITCH 6 35 | 36 | #define ZOOPMUSIC_MAX 6 37 | 38 | typedef struct ZZTOOPdrawer { 39 | displaymethod * display; /* Draw here */ 40 | 41 | int x, y; /* Position to draw at */ 42 | int length; /* Maximum length of drawn line */ 43 | 44 | int helpformatting; /* True if output should be formatted */ 45 | 46 | int *colours; /* Array of colours indexed by ZZTOOPcomponent.type */ 47 | int *textcolours; /* Array of colours for displaying text */ 48 | int *musiccolours; /* Array of colours for displaying music */ 49 | } ZZTOOPdrawer; 50 | 51 | /* Default colour arrays */ 52 | extern int zztoopdefaultcolours[ZOOPTYPE_MAX + 1]; 53 | extern int zztoopdefaulttextcolours[ZOOPTEXT_MAX + 1]; 54 | extern int zztoopdefaultmusiccolours[ZOOPMUSIC_MAX + 1]; 55 | 56 | /* Initialize a drawer with default colours */ 57 | void zztoopInitDrawer(ZZTOOPdrawer * drawer); 58 | 59 | /* Draw a component chain */ 60 | void zztoopDraw(ZZTOOPdrawer drawer, ZZTOOPcomponent * components); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/display/textblock.c: -------------------------------------------------------------------------------- 1 | /* textblock.c -- A block of coloured display text 2 | * $Id: textblock.c,v 1.2 2005/05/28 03:17:45 bitman Exp $ 3 | * Copyright (C) 2003 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "textblock.h" 25 | 26 | #include 27 | #include 28 | 29 | /* Create an empty textBlock */ 30 | textBlock * 31 | createTextBlock(int width, int height) 32 | { 33 | textBlock * block = (textBlock *) malloc(sizeof(textBlock)); 34 | int dataSize = textBlockDataSize(width, height); 35 | 36 | block->width = width; 37 | block->height = height; 38 | 39 | block->data = (textDatum *) malloc(sizeof(textDatum) * dataSize); 40 | memset(block->data, 0, sizeof(textDatum) * dataSize); 41 | 42 | return block; 43 | } 44 | 45 | 46 | /* Destroy a textBlock */ 47 | void 48 | deleteTextBlock(textBlock * block) 49 | { 50 | if (block == NULL) 51 | return; 52 | 53 | if (block->data != NULL) { 54 | free(block->data); 55 | block->data = NULL; 56 | } 57 | 58 | free(block); 59 | } 60 | 61 | 62 | /* Write a character to a text block */ 63 | void 64 | textBlockPutch(textBlock * block, int x, int y, 65 | textDatum ch, textDatum co) 66 | { 67 | textBlockChar(block, x, y) = ch; 68 | textBlockColour(block, x, y) = co; 69 | } 70 | 71 | void textBlockBlit(textBlock * src, textBlock * dest, int srcx, int srcy, 72 | int width, int height, int destx, int desty) 73 | { 74 | int x, y; 75 | 76 | for (y = 0; y < height; ++y) { 77 | for (x = 0; x < width; ++x) { 78 | textBlockPutch(dest, x+destx, y+desty, 79 | textBlockChar(src, x+srcx, y+srcy), 80 | textBlockColour(src, x+srcx, y+srcy)); 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | builddir=build/ 4 | 5 | this="`basename $0`" 6 | here="`dirname $0`" 7 | 8 | usage="\ 9 | Usage: $this [--fast] [--keep] [--clear] [--rebuild] 10 | \t[--configure] [--make] [--install] [--all] 11 | \t[--builddir=dirname] 12 | 13 | $this runs all necessary programs to build a configure script. It can 14 | also run the configure script, make, and install the program. If you are not a 15 | developer, follow the instrutions in INSTALL instead of using $this. 16 | 17 | Use $this to create the configure script 18 | Use $this --all to build and install with default settings 19 | Use $this --clear to delete all files generated by the autotools 20 | Use $this --fast ... if configure need not be rebuilt 21 | 22 | --builddir specifies where compilation should occur [default=$builddir]" 23 | 24 | while test $# -gt 0; do 25 | case "$1" in 26 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 27 | *) optarg= ;; 28 | esac 29 | 30 | case $1 in 31 | --fast) 32 | # Only do fast build if configure and Makefile.in already exist 33 | if test -f configure -a -f Makefile.in; then 34 | fast=yes 35 | fi;; 36 | --clear) clear=yes fast=yes;; 37 | --rebuild) clear=yes;; 38 | --configure) configure=yes;; 39 | --make) make=yes;; 40 | --install) install=yes;; 41 | --all) configure=yes; make=yes;; 42 | 43 | --builddir=*) builddir=$optarg;; 44 | 45 | --help) echo -e "$usage" && exit 0 46 | esac 47 | shift 48 | done 49 | 50 | if test $clear; then 51 | echo "$this: Deleting files created by automake and autoconf" 52 | rm -f aclocal.m4 config.* configure depcomp install install-sh missing mkinstalldirs 53 | rm -f *.lnk 54 | rm -f -R autom4te.cache/ 55 | fi 56 | 57 | if test -z $fast; then 58 | echo "$this: Running aclocal..." && \ 59 | aclocal && \ 60 | echo "$this: Running autoconf..." && \ 61 | autoconf && \ 62 | echo "$this: Running autoheader..." && \ 63 | autoheader && \ 64 | echo "$this: Running automake..." && \ 65 | automake --add-missing || exit 66 | fi 67 | 68 | if test ! -d $builddir; then 69 | echo "$this: Making and entering $builddir directory..." 70 | mkdir -p $builddir 71 | fi 72 | 73 | cd $builddir 74 | 75 | if test $configure; then 76 | echo "$this: Running configure..." 77 | ../configure -C || exit 78 | fi 79 | 80 | if test $make; then 81 | echo "$this: Running make..." 82 | make || exit 83 | fi 84 | 85 | if test $install; then 86 | echo "$this: Installing..." 87 | make install || exit 88 | fi 89 | -------------------------------------------------------------------------------- /src/display/test.c: -------------------------------------------------------------------------------- 1 | /* test.c -- Test display routines 2 | * $Id: test.c,v 1.3 2005/05/28 03:17:45 bitman Exp $ 3 | * Copyright (C) 2003 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include 24 | #endif 25 | 26 | #include "display.h" 27 | #include "textblock.h" 28 | 29 | void 30 | interactiveDisplayTest() 31 | { 32 | displaymethod * mydisplay; 33 | int key; 34 | int x = 0, y = 4; 35 | 36 | RegisterDisplays(); 37 | mydisplay = &display; 38 | 39 | /* Start the display */ 40 | mydisplay->init(); 41 | 42 | /* Draw some things */ 43 | mydisplay->print_discrete(20, 0, 0x3F, "Display test program"); 44 | mydisplay->putch_discrete(18, 0, '~', 0x09); 45 | mydisplay->putch_discrete(41, 0, '~', 0x09); 46 | 47 | mydisplay->print_discrete(4, 2, 0x40, "Press keys to test input (esp. SHIFT), \'q\' or ESC to quit"); 48 | 49 | /* Update first line */ 50 | mydisplay->update(0, 0, 80, 3); 51 | 52 | /* A simple i/o test loop */ 53 | do { 54 | if (mydisplay->shift()) 55 | mydisplay->print(10, 6, 0x4F, " SHIFT down "); 56 | else 57 | mydisplay->print(10, 6, 0x00, " "); 58 | 59 | mydisplay->cursorgo(x, y); 60 | key = mydisplay->getch(); 61 | mydisplay->putch(x, y, key, 0x0F); 62 | x = (x + 1) % 40; 63 | } while (key != 'q' && key != DKEY_ESC); 64 | 65 | /* End the display */ 66 | mydisplay->end(); 67 | } 68 | 69 | void 70 | testTextBlock() 71 | { 72 | textBlock * block = createTextBlock(80, 25); 73 | 74 | textBlockPutch(block, 5, 7, 'c', 0x03); 75 | 76 | printf("Char: %c, Color: %2X\n", 77 | textBlockChar(block, 5, 7), textBlockColour(block, 5, 7)); 78 | 79 | deleteTextBlock(block); 80 | } 81 | 82 | int 83 | main(int argc, char ** argv) 84 | { 85 | interactiveDisplayTest(); 86 | /* 87 | testTextBlock(); 88 | */ 89 | 90 | return 0; 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/display/palette.c: -------------------------------------------------------------------------------- 1 | /* palette.c -- Custom color palette 2 | * Copyright (C) 2023 Kev Vance 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "palette.h" 24 | 25 | 26 | palette *palette_load(char *path) { 27 | FILE *fp = fopen(path, "rb"); 28 | if(!fp) { 29 | return NULL; 30 | } 31 | 32 | // Detect the file type by its size 33 | fseek(fp, 0, SEEK_END); 34 | size_t file_size = ftell(fp); 35 | if(file_size == PALETTE_SIZE) { 36 | // Raw palette data 37 | fseek(fp, 0, SEEK_SET); 38 | } else { 39 | // Unknown size, bail out 40 | fclose(fp); 41 | return NULL; 42 | } 43 | 44 | palette *result = malloc(sizeof(palette)); 45 | result->path = strdup(path); 46 | if(fread(result->data, 1, PALETTE_SIZE, fp) != PALETTE_SIZE) { 47 | // Read error 48 | free(result); 49 | result = NULL; 50 | } 51 | fclose(fp); 52 | return result; 53 | } 54 | 55 | void palette_free(palette *pal) { 56 | free(pal->path); 57 | free(pal); 58 | } 59 | 60 | const palette default_palette = { 61 | .path = "(default)", 62 | .data = { 63 | '\x00', '\x00', '\x00', '\x00', '\x00', '\x2A', '\x00', '\x2A', 64 | '\x00', '\x00', '\x2A', '\x2A', '\x2A', '\x00', '\x00', '\x2A', 65 | '\x00', '\x2A', '\x2A', '\x15', '\x00', '\x2A', '\x2A', '\x2A', 66 | '\x15', '\x15', '\x15', '\x15', '\x15', '\x3F', '\x15', '\x3F', 67 | '\x15', '\x15', '\x3F', '\x3F', '\x3F', '\x15', '\x15', '\x3F', 68 | '\x15', '\x3F', '\x3F', '\x3F', '\x15', '\x3F', '\x3F', '\x3F' 69 | }, 70 | }; 71 | -------------------------------------------------------------------------------- /src/libzzt2/strtools.h: -------------------------------------------------------------------------------- 1 | /* strtools -- portable string-handling functions */ 2 | /* $Id: strtools.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ */ 3 | /* Copyright (C) 2002 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #ifndef LIBZZT2_STRTOOLS_H 21 | #define LIBZZT2_STRTOOLS_H 1 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #define STREQU_UNCASE 0x01 /* Capitalization is ignored */ 28 | #define STREQU_FRONT 0x02 /* Equal if the fronts of the strings 29 | are the same */ 30 | #define STREQU_RFRONT (0x04 | STREQU_FRONT) 31 | /* Equal if the right string is the front 32 | * of the left string */ 33 | 34 | /* String duplication using malloc 35 | * str_dup() - reserves just enough space for the string 36 | * str_dupmin() - reserves at least min+1 space 37 | * str_dupmax() - reserves at most max+1 space 38 | * str_duplen() - reserves exactly len+1 space 39 | * str_dupadd() - reserves just enough space for the string + add chars 40 | */ 41 | char * str_dup (char * s); 42 | char * str_dupmin(char * s, unsigned int min); 43 | char * str_dupmax(char * s, unsigned int max); 44 | char * str_duplen(char * s, unsigned int len); 45 | char * str_dupadd(char * s, unsigned int add); 46 | 47 | /* Create an empty string of given length using malloc */ 48 | char * str_create(unsigned int len); 49 | 50 | /* str_lowercase - changes string to lowercase and returns it */ 51 | char* str_lowercase(char* string); 52 | 53 | /* str_equ - compares two strings, ignoring case & length based on flags */ 54 | int str_equ(const char *str1, const char *str2, int flags); 55 | 56 | /* lookupString - Table lookup for a string using str_equ() 57 | * Returns index of string if found, otherwise -1 */ 58 | int lookupString(const char * table[], int size, char * value, int equflags); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* LIBZZT2_STRTOOLS_H */ 65 | -------------------------------------------------------------------------------- /src/synth/play.c: -------------------------------------------------------------------------------- 1 | /* play.c -- Play ZZM music 2 | * $Id: play.c,v 1.3 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2001 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "notes.h" 25 | #include "zzm.h" 26 | #include "synth.h" 27 | 28 | #include 29 | #include 30 | 31 | void printNoteData(musicalNote note, musicSettings settings) 32 | { 33 | #if 0 34 | printf("index: %d, len: %d, dots: %d, freq: %f, len: %f\n", 35 | note.index, note.length, note.dots, 36 | noteFrequency(note, settings), 37 | noteDuration(note, settings)); 38 | #endif 39 | } 40 | 41 | #ifdef SDL 42 | SDL_AudioSpec spec; 43 | SDL_AudioDeviceID audioid; 44 | #endif 45 | 46 | void start() { 47 | #ifdef SDL 48 | SDL_Init(SDL_INIT_AUDIO); 49 | 50 | atexit(SDL_Quit); 51 | 52 | OpenSynth(&audioid, &spec); 53 | #endif 54 | } 55 | 56 | void end() { 57 | #ifdef SDL 58 | while (!IsSynthBufferEmpty()) 59 | ; 60 | CloseSynth(&audioid); 61 | SDL_Quit(); 62 | #elif defined DOS 63 | pcSpeakerFinish(); 64 | #endif 65 | } 66 | 67 | void playSong(musicalNote* song, musicSettings settings) 68 | { 69 | if (song == NULL) 70 | return; 71 | 72 | printf("Playing note\n"); 73 | #ifdef DOS 74 | pcSpeakerPlayNote(*song, settings); 75 | #elif defined SDL 76 | SynthPlayNote(spec, *song, settings); 77 | #endif 78 | 79 | playSong(song->next, settings); 80 | } 81 | 82 | void play(char* tune) 83 | { 84 | musicalNote* song = zzmGetNoteChain(tune, zzmGetDefaultNote()); 85 | 86 | playSong(song, zzmGetDefaultSettings()); 87 | 88 | deleteNoteChain(song); 89 | } 90 | 91 | int main(int argc, char* argv[]) 92 | { 93 | int i; 94 | 95 | start(); 96 | 97 | /* Default tune */ 98 | if (argc <= 1) 99 | play("icdefgab+c"); 100 | 101 | /* Play all the arguments as seperate lines */ 102 | for (i = 1; i < argc; i++) 103 | play(argv[i]); 104 | 105 | end(); 106 | 107 | return 0; 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/zlaunch/zlaunch.h: -------------------------------------------------------------------------------- 1 | /* zlaunch - zzt launching library (everything necessary to run zzt smoothly) 2 | * $Id: zlaunch.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (c) 2001 Ryan Phillips 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include "structures/svector.h" 20 | 21 | #ifndef _ZLAUNCH_H 22 | #define _ZLAUNCH_H 1 23 | 24 | /* Default config file to use */ 25 | #define ZL_DEFAULTCONFIG "default.zln" 26 | #define ZL_RMFILENAME "rmlist.tmp" 27 | 28 | /* Actions to be performed by the launcher */ 29 | #define ZL_NONE 0 30 | #define ZL_RUN 1 31 | #define ZL_KEYSTROKES 2 32 | #define ZL_COPY 3 33 | #define ZL_DISPLACE 4 34 | #define ZL_PERMCOPY 5 35 | #define ZL_PERMCOPYOVER 6 36 | 37 | /* Action structure */ 38 | typedef struct zlauchaction { 39 | char* name; /* name of the action */ 40 | int optional; /* false will force this action to be performed */ 41 | 42 | int type; /* Type of action (one of above defines) */ 43 | char* command; /* Action command */ 44 | 45 | struct zlauchaction* next; /* Next action in the list */ 46 | } zlaunchaction; 47 | 48 | /* Configuration settings for the zlauncher */ 49 | typedef struct zlaunchinfo { 50 | stringvector actionstoperform; /* list of action names to actually use */ 51 | stringvector paramlist; /* list of parameters */ 52 | char* bindir; /* location of binaries */ 53 | char* datadir; /* location of datafiles */ 54 | 55 | zlaunchaction* actions; /* Linked list of actions */ 56 | } zlaunchinfo; 57 | 58 | 59 | /* Info operations */ 60 | void initzlinfo(zlaunchinfo* zli); 61 | void deletezlinfo(zlaunchinfo* zli); 62 | 63 | stringvector defaultzlinfo(void); 64 | zlaunchinfo loadzlinfofromsvector(stringvector info); 65 | 66 | /* Load info from a number of sources */ 67 | stringvector loadinfo(char* datapath, char* worldfile); 68 | 69 | /* zlaunching */ 70 | void zlaunchact(zlaunchinfo* zli); 71 | void zlaunchcleanup(zlaunchinfo* zli); 72 | 73 | /* Keboard buffer stuffing routines */ 74 | void performkeystrokes(char* keystrokes); 75 | void stuffkbdbuffer(unsigned char scancode, unsigned char ch); 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /docs/lang.hlp: -------------------------------------------------------------------------------- 1 | $ZZT-OOP 2 | $Programming Language 3 | 4 | Table of contents: 5 | !ov;Overview 6 | !-langtut;Tutorial 7 | !-langref;Reference manual 8 | 9 | :Ov;Overview 10 | 11 | ZZT provides a special type of 12 | creature, the Object, that can be made to 13 | interact with the player and the 14 | environment by using a small object- 15 | oriented command language. Objects are 16 | very versatile, and can move, talk and 17 | bargain with the player, and communicate 18 | with other Objects. 19 | 20 | To put an Object on the playing 21 | field, type F2 O. Next, you can choose a 22 | character to represent the Object. 23 | Finally, you can enter a program to 24 | control it. 25 | 26 | To change an Object's program, move 27 | the cursor to the Object and press Enter. 28 | 29 | $How they work. 30 | 31 | During game play, the Objects are 32 | actively controlled by their associated 33 | programs. Commands are executed in tempo 34 | with the game. Usually, an Object is 35 | updated 4 or 5 times per second, and 36 | several commands are executed on each 37 | update. 38 | 39 | Objects communicate with each other 40 | and with the environment by sending and 41 | receiving messages. Understanding ZZT-OOP 42 | is often difficult because it is possible 43 | to have many objects operating at the same 44 | time, and each object can interact with 45 | any other object at any time. 46 | 47 | $Interaction. 48 | 49 | A programmable creature can put 50 | flashing one or two-line messages at the 51 | bottom of the screen. It can also put 52 | multi-line scrolling messages on the 53 | screen. These messages can be interactive, 54 | so that the player can pick choices from a 55 | menu. 56 | 57 | Objects can also move, shoot, and interact 58 | with other objects. 59 | 60 | $Messages - What are they? 61 | 62 | ZZT's programming language is object- 63 | oriented, meaning that a program's flow of 64 | execution is controlled by sending and 65 | receiving messages. Whenever an important 66 | event occurs, a message is sent to an 67 | object. This causes the program to 68 | execute specific instructions to handle 69 | the event. Messages can come from two 70 | sources: from other programmable creatures 71 | and from the game itself. 72 | 73 | For example, whenever the player 74 | touches an object, that object receives 75 | the message, "TOUCH". The object can then 76 | act on the message, for example by 77 | greeting the player or attacking. Or, the 78 | object can ignore the message. 79 | 80 | Similarly, objects can communicate 81 | with each other by exchanging messages. 82 | For example, a board contains a "BUTTON" 83 | object and a "GATE" object. The player 84 | touches the button. Upon being touched, 85 | the button sends the message "OPEN" to the 86 | gate object. The gate, upon receiving 87 | this message, moves aside. 88 | 89 | The first step to learning ZZT-OOP is 90 | seeing actual programs with explanations: 91 | 92 | !-langtut;ZZT-OOP Tutorial 93 | -------------------------------------------------------------------------------- /src/structures/selection.h: -------------------------------------------------------------------------------- 1 | /* selection.h -- selected area 2 | * $Id: selection.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SELECTION_H 21 | #define __SELECTION_H 1 22 | 23 | typedef unsigned int bitfieldtype; 24 | 25 | typedef struct selection { 26 | /* Width and height of the selection */ 27 | int width, height; 28 | 29 | /* Bitfield and its descriptors */ 30 | bitfieldtype* field; 31 | int fieldlength; 32 | int fieldwidth; 33 | } selection; 34 | 35 | /* initselection() - allocates the bit field and clears the selection */ 36 | void initselection(selection * sel, int width, int height); 37 | 38 | /* deleteselection() - free()s any memory used by the selection */ 39 | void deleteselection(selection * sel); 40 | 41 | /* clearselection() - unsets all values */ 42 | void clearselection(selection sel); 43 | 44 | /* setselection() - sets all values */ 45 | void setselection(selection sel); 46 | 47 | 48 | /* copyselection() - copy one selection onto another of the same size. 49 | * Returns zero on success. */ 50 | int copyselection(selection dest, selection src); 51 | 52 | /* mergeselection() - merges selected areas in src onto dest */ 53 | int mergeselection(selection dest, selection src); 54 | 55 | 56 | /* selectpos() - sets a given position to selected */ 57 | void selectpos (selection sel, int x, int y); 58 | 59 | /* unselectpos() - unsets a given position */ 60 | void unselectpos (selection sel, int x, int y); 61 | 62 | /* isselected() - determines whether a given position is set as selected */ 63 | int isselected (selection sel, int x, int y); 64 | 65 | 66 | /* selectblock() - select a block of positions */ 67 | void selectblock(selection sel, int x1, int y1, int x2, int y2); 68 | 69 | 70 | /* nextselected() - advances x and y to the next set position, returning false 71 | * on success and true on failure (end of bitfield) */ 72 | int nextselected(selection sel, int * x, int * y); 73 | 74 | /* firstselected() - advances x and y to the first set position, returning 75 | * false on success and true on failure */ 76 | int firstselected(selection sel, int * x, int * y); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KevEdit 2 | 3 | KevEdit is a ZZT editor that was under development from 2000-2005 by Kevin 4 | Vance and Ryan Phillips. It runs under DOS, Windows, macOS, and Linux. 5 | 6 | As of 2023 it is maintained by Kevin Vance on github. Maintenance is focused 7 | on improvements for running KevEdit on modern computers while still supporting 8 | DOS. 9 | 10 | 11 | ## Download 12 | 13 | Binary releases are available for 32-bit DOS, 64-bit Linux and Windows, and 14 | macOS (x86_64 and arm64) from 15 | [github releases](https://github.com/cknave/kevedit/releases/). 16 | 17 | 18 | ## Usage 19 | 20 | $ kevedit [file.zzt] 21 | 22 | Press `H` in the editor to access the interactive help. 23 | 24 | 25 | ## Building from source 26 | 27 | $ ./bootstrap.sh # only if building from git 28 | $ ./configure 29 | $ make 30 | $ sudo make install 31 | 32 | If building from git, the bootstrap script requires that you have [pkg-config] 33 | and [SDL2] installed. If you are using a source tarball, you can skip directly 34 | to running the configure script. 35 | 36 | [pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/ 37 | [SDL2]: https://www.libsdl.org/download-2.0.php 38 | 39 | 40 | ## Creating binary artifacts 41 | 42 | Docker containers are provided for building Linux AppImage binaries, as well as 43 | cross-compiling to macOS, Windows, and DOS. This is automated by a python 44 | build script: 45 | 46 | $ cd inst 47 | $ ./build.py [appimage] [dos] [macos] [windows] 48 | $ ls dist 49 | 50 | 51 | ## Building docker images 52 | 53 | To build the docker images and tag them as 'latest' instead of pulling them 54 | from Docker Hub: 55 | 56 | $ cd inst 57 | $ ./build.py -i build -t [appimage] [dos] [macos] [windows] 58 | 59 | 60 | ## Screenshots 61 | 62 | ![The main KevEdit interface](https://cloud.githubusercontent.com/assets/4196901/22183137/b51c68e6-e084-11e6-874d-3458041f4308.gif) 63 | ![KevEdit navigates a world with the Board Selector](https://cloud.githubusercontent.com/assets/4196901/22183135/b515754a-e084-11e6-9fe3-2483eb67ca79.gif) 64 | ![The character picker for objects](https://cloud.githubusercontent.com/assets/4196901/22183134/b514af02-e084-11e6-9ca7-7b21bedb479d.gif) 65 | ![Using the large backbuffer to copy a whole gradient](https://cloud.githubusercontent.com/assets/4196901/22183131/b5142230-e084-11e6-95c1-19133c677388.gif) 66 | ![Loading a world from any directory](https://cloud.githubusercontent.com/assets/4196901/22183132/b5142208-e084-11e6-8ab1-568d217391ec.gif) 67 | ![Sophisticated stats editing](https://cloud.githubusercontent.com/assets/4196901/22183133/b51426b8-e084-11e6-8ce7-e01b7d6a06ed.gif) 68 | ![The very colorful program editor](https://cloud.githubusercontent.com/assets/4196901/22183136/b516dd4a-e084-11e6-8e9b-30201734480a.gif) 69 | 70 | 71 | ## Legal 72 | 73 | KevEdit is distributed under the GNU general public license v2. 74 | 75 | Additional copyright notices are included in 76 | [legal.md](https://github.com/cknave/kevedit/blob/master/legal.md). 77 | -------------------------------------------------------------------------------- /soundfx.zzm: -------------------------------------------------------------------------------- 1 | ; ZZT Music File v1.0 2 | ; Generated by bitman from Chronos' soundfx.hlp 3 | ; $TITLE ZZT Sound Effects 4 | ; $SONGS BEGIN 5 | ; $SONG TITLE 1 Ricochet 6 | ; $SONG 1 7 | t9 8 | ; $SONG ENDS 9 | ; $SONG TITLE 2 Transport 10 | ; $SONG 2 11 | tc+d-e+f#-g#+a#c+d 12 | ; $SONG ENDS 13 | ; $SONG TITLE 3 Forest 14 | ; $SONG 3 15 | ta 16 | ; $SONG ENDS 17 | ; $SONG TITLE 4 Locked Door 18 | ; $SONG 4 19 | t--gc 20 | ; $SONG ENDS 21 | ; $SONG TITLE 5 Water 22 | ; $SONG 5 23 | t+c+c 24 | ; $SONG ENDS 25 | ; $SONG TITLE 6 Energize 26 | ; $SONG 6 27 | s.-cd#e 28 | ; $SONG ENDS 29 | ; $SONG TITLE 7 Energizer Song 30 | ; $SONG 7 31 | s.-f+f-fd#c+c-d#ef+f-fd#c+c-d#e 32 | s.-f+f-fd#c+c-d#ef+f-fd#c+c-d#e 33 | s.-f+f-fd#c+c-d#e 34 | ; $SONG ENDS 35 | ; $SONG TITLE 8 Energizer End 36 | ; $SONG 8 37 | s.-c-a#gf#fd#c 38 | ; $SONG ENDS 39 | ; $SONG TITLE 9 No Key 40 | ; $SONG 9 41 | sc-c 42 | ; $SONG ENDS 43 | ; $SONG TITLE 10 10 Seconds Left 44 | ; $SONG 10 45 | i.+cfc-f+cfq.c 46 | ; $SONG ENDS 47 | ; $SONG TITLE 11 Object Shoot 48 | ; $SONG 11 49 | tc-f# 50 | ; $SONG ENDS 51 | ; $SONG TITLE 12 Cheat 52 | ; $SONG 12 53 | i-g 54 | ; $SONG ENDS 55 | ; $SONG TITLE 13 OOP Error 56 | ; $SONG 13 57 | ++q.c 58 | ; $SONG ENDS 59 | ; $SONG TITLE 14 Endgame 60 | ; $SONG 14 61 | s.-cd#g+c-ga#+dgfg#+cf----q.c 62 | ; $SONG ENDS 63 | ; $SONG TITLE 15 Key 64 | ; $SONG 15 65 | t+cegcegceg+sc 66 | ; $SONG ENDS 67 | ; $SONG TITLE 16 Door 68 | ; $SONG 16 69 | tcgbcgb+ic 70 | ; $SONG ENDS 71 | ; $SONG TITLE 17 Gem 72 | ; $SONG 17 73 | t+c-gec 74 | ; $SONG ENDS 75 | ; $SONG TITLE 18 Ammo 76 | ; $SONG 18 77 | tcc#d 78 | ; $SONG ENDS 79 | ; $SONG TITLE 19 Torch 80 | ; $SONG 19 81 | tcase 82 | ; $SONG ENDS 83 | ; $SONG TITLE 20 Player Shoot 84 | ; $SONG 20 85 | t+c-c-c 86 | ; $SONG ENDS 87 | ; $SONG TITLE 21 Ouch! 88 | ; $SONG 21 89 | t--c+c---c+d# 90 | ; $SONG ENDS 91 | ; $SONG TITLE 22 Passage 92 | ; $SONG 22 93 | tcegc#fg#df#ad#ga#eg#+c 94 | ; $SONG ENDS 95 | ; $SONG TITLE 23 Push 96 | ; $SONG 23 97 | t--f 98 | ; $SONG ENDS 99 | ; $SONG TITLE 24 Break 100 | ; $SONG 24 101 | t-c 102 | ; $SONG ENDS 103 | ; $SONG TITLE 25 KillEnemy 104 | ; $SONG 25 105 | t+c---c++++c--c 106 | ; $SONG ENDS 107 | ; $SONG TITLE 26 Torch Go Out 108 | ; $SONG 26 109 | tc-c-c 110 | ; $SONG ENDS 111 | ; $SONG TITLE 27 Invisible Wall 112 | ; $SONG 27 113 | t--dc 114 | ; $SONG ENDS 115 | ; $SONG TITLE 28 Scroll 116 | ; $SONG 28 117 | tc-c+d-d+e-e+f-f+g-g 118 | ; $SONG ENDS 119 | ; $SONG TITLE 29 Duplicator 120 | ; $SONG 29 121 | tcdefg 122 | ; $SONG ENDS 123 | ; $SONG TITLE 30 Set Bomb 124 | ; $SONG 30 125 | tcf+cf+c 126 | ; $SONG ENDS 127 | ; $SONG TITLE 31 Bomb Tick 128 | ; $SONG 31 129 | t5 130 | ; $SONG ENDS 131 | ; $SONG TITLE 32 Bomb Tock 132 | ; $SONG 32 133 | t8 134 | ; $SONG ENDS 135 | ; $SONG TITLE 33 Bomb Boom 136 | ; $SONG 33 137 | t+++c-c-c-c-c-c 138 | ; $SONG ENDS 139 | ; $SONG TITLE 34 No Edit 140 | ; $SONG 34 141 | s004x664x0 142 | ; $SONG ENDS 143 | ; $SONG TITLE 35 No Dupe 144 | ; $SONG 35 145 | --g#f# 146 | ; $SONG ENDS 147 | ; $SONGS END 148 | ; $EOF 149 | -------------------------------------------------------------------------------- /src/texteditor/lineeditor.h: -------------------------------------------------------------------------------- 1 | /**@file texteditor/lineeditor.h Editor for a single line. 2 | * $Id: lineeditor.h,v 1.1 2004/02/01 06:36:44 bitman Exp $ 3 | * @author Ryan Phillips 4 | * 5 | * Copyright (C) 2002 Ryan Phillips 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either listersion 2 of the License, or 10 | * (at your option) any later listersion. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef TEXTEDITOR_LINEEDITOR_H 23 | #define TEXTEDITOR_LINEEDITOR_H 24 | 25 | #include "display/display.h" 26 | 27 | /* Valid input flags. */ 28 | #define LINED_NORMAL 0x00 /**< All normal input allowed. */ 29 | #define LINED_NOUPPER 0x01 /**< No uppercase letters used. */ 30 | #define LINED_NOLOWER 0x02 /**< No lowercase letters used. */ 31 | #define LINED_NOALPHA LINED_NOUPPER | LINED_NOLOWER /**< No letters allowed. */ 32 | #define LINED_NODIGITS 0x04 /**< No digits 0-9 allowed. */ 33 | #define LINED_NOPUNCT 0x08 /**< No punctuation allowed. */ 34 | #define LINED_NOSPACES 0x10 /**< No spaces allowed. */ 35 | #define LINED_NOPERIOD 0x20 /**< No period character allowed. */ 36 | 37 | #define LINED_FILENAME 0x40 /**< Input must be a valid filename. */ 38 | #define LINED_NOPATH 0x80 /**< Input must contain no path characters (e.g. /) */ 39 | 40 | /** Input is restricted to integers. */ 41 | #define LINED_NUMBER 0x100 42 | /** Input is restricted to signed integers. */ 43 | #define LINED_SNUMBER 0x200 44 | 45 | /* Return values. */ 46 | #define LINED_QUIT 2 /**< User cancelled and requested quit. */ 47 | #define LINED_CANCEL 1 /**< User cancelled input, so disregard value of line. */ 48 | #define LINED_OK 0 /**< User confirmed input. */ 49 | 50 | 51 | /** 52 | * A powerful editor for a single line of text. 53 | **/ 54 | typedef struct { 55 | char * line; /**< A line of text to edit. */ 56 | int editwidth; /**< Maximum length of the line. */ 57 | int visiblewidth; /**< Visible width of the line. */ 58 | 59 | int x, y; /**< Line screen coordinates. */ 60 | int pos; /**< Cursor position. */ 61 | int colour; /**< Line colour. */ 62 | 63 | int validinputflags; /**< Flags controlling valid input. */ 64 | 65 | displaymethod * d; /**< Display method to use. */ 66 | 67 | } lineeditor; 68 | 69 | lineeditor * createlineeditor(int x, int y, char * line, int width, displaymethod * d); 70 | void deletelineeditor(lineeditor * editor); 71 | int editline(lineeditor * editor); 72 | 73 | void lineeditorUpdateDisplay(lineeditor * editor); 74 | void lineeditorHandleKey(lineeditor * editor, int key); 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /docs/kkeys.hlp: -------------------------------------------------------------------------------- 1 | @Keystroke Quick Reference 2 | $Keystroke Quick Reference 3 | 4 | !general;General 5 | !info;Info Dialogs 6 | !move;Movement 7 | !file;File Operations 8 | !color;Color 9 | !draw;Drawing 10 | !patbuf;Pattern Buffer 11 | !select;Tile Selection 12 | !menu;Tile Menus 13 | 14 | :general;General 15 | 16 | ENTER 17 | Modifies the tile under the cursor and 18 | copies it to the backbuffer. 19 | INSERT 20 | Copies the tile under the cursor to the 21 | backbuffer. 22 | q - Quits KevEdit 23 | n - Creates a new world 24 | z - Clears the current board 25 | ALT-T - Runs zzt 26 | h - Help 27 | ! - Loads text editor 28 | CTRL-O 29 | Reveal hidden objects 30 | ALT-ENTER 31 | Toggle fullscreen (GUI only) 32 | CTRL-MINUS 33 | Decrease zoom level (GUI only) 34 | CTRL-PLUS / CTRL-EQUALS 35 | Increase zoom level (GUI only) 36 | 37 | 38 | :info;Info Dialogs 39 | i - Board Info 40 | w - World Info 41 | CTRL-T 42 | Tile Info 43 | CTRL-S 44 | Stats Info 45 | CTRL-A 46 | Show character selector (when editing 47 | text) 48 | 49 | :move;Movement 50 | 51 | CURSOR KEYS 52 | Move the cursor. 53 | ALT+CURSOR KEYS 54 | Move the cursor faster. 55 | PAGEUP 56 | Previous Board 57 | PAGEDOWN 58 | Next Board 59 | CTRL+CURSOR KEYS 60 | Switch to linked boards. 61 | CTRL+PAGEUP/PAGEDOWN 62 | Skip 7 boards at once. 63 | b - Switch/edit boards 64 | 65 | :file;File Operations 66 | 67 | s - Saves the world 68 | l - Loads a world 69 | t - Board transfer 70 | o - Object Library load/save 71 | 72 | :color;Color 73 | 74 | c - Cycles through foreground colors 75 | C - Cycles through background colors 76 | r - Reverses foreground and background 77 | k - Kolor dialog 78 | v - Toggles blinking colors 79 | d - Toggles default color mode 80 | CTRL-K 81 | Kolor dialog (use with F4) 82 | 83 | :draw;Drawing 84 | 85 | SPACEBAR 86 | Plots the currently selected pattern in 87 | the backbuffer. 88 | TAB 89 | Continuously plots with cursor movement. 90 | SHIFT-TAB 91 | Continuously plots with cursor movement 92 | while cycling through the backbuffer. 93 | BACKSPACE 94 | Erases tile under the cursor. 95 | DELETE 96 | Erases tile under the cursor. 97 | f - Floodfills the current tile 98 | F - Randomly floodfills the current tile 99 | g - Draws a faded gradient 100 | F4 - Text Entry 101 | 102 | :patbuf;Pattern Buffer 103 | 104 | p - Cycles through backbuffer 105 | P - Cycles backward through backbuffer 106 | a - Acquires tiles to the backbuffer 107 | < - Reduces size of backbuffer 108 | > - Increases size of backbuffer 109 | / - Locks backbuffer 110 | 0 - Selects empty pattern 111 | 1-9 - Selects backbuffer position 112 | 113 | :select;Tile Selection 114 | 115 | ESCAPE 116 | Clears selected area 117 | SHIFT+CURSOR KEYS 118 | Select a block of tiles 119 | x - Flood select 120 | X - Select all similar tiles 121 | f - Fill 122 | F - Random Fill 123 | g - Gradient 124 | CTRL-C 125 | Copy selected tiles 126 | CTRL-V 127 | Paste copied tiles 128 | CTRL-X 129 | Cut selected tiles 130 | 131 | :menu;Tile Menus 132 | 133 | F1 - Item Menu 134 | F2 - Creature Menu 135 | F3 - Terrain Menu 136 | 137 | -------------------------------------------------------------------------------- /glob/fnmatch.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 Free Software 2 | Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | 5 | The GNU C Library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public License as 7 | published by the Free Software Foundation; either version 2 of the 8 | License, or (at your option) any later version. 9 | 10 | The GNU C Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to the Free 17 | Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 18 | USA. */ 19 | 20 | #ifndef _FNMATCH_H 21 | #define _FNMATCH_H 1 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 28 | # if !defined __GLIBC__ 29 | # undef __P 30 | # define __P(protos) protos 31 | # endif 32 | #else /* Not C++ or ANSI C. */ 33 | # undef __P 34 | # define __P(protos) () 35 | /* We can get away without defining `const' here only because in this file 36 | it is used only inside the prototype for `fnmatch', which is elided in 37 | non-ANSI C where `const' is problematical. */ 38 | #endif /* C++ or ANSI C. */ 39 | 40 | #ifndef const 41 | # if (defined __STDC__ && __STDC__) || defined __cplusplus || defined WINDOWS32 42 | # define __const const 43 | # else 44 | # define __const 45 | # endif 46 | #endif 47 | 48 | /* We #undef these before defining them because some losing systems 49 | (HP-UX A.08.07 for example) define these in . */ 50 | #undef FNM_PATHNAME 51 | #undef FNM_NOESCAPE 52 | #undef FNM_PERIOD 53 | 54 | /* Bits set in the FLAGS argument to `fnmatch'. */ 55 | #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ 56 | #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ 57 | #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ 58 | 59 | #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE 60 | # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ 61 | # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ 62 | # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ 63 | #endif 64 | 65 | /* Value returned by `fnmatch' if STRING does not match PATTERN. */ 66 | #define FNM_NOMATCH 1 67 | 68 | /* This value is returned if the implementation does not support 69 | `fnmatch'. Since this is not the case here it will never be 70 | returned but the conformance test suites still require the symbol 71 | to be defined. */ 72 | #ifdef _XOPEN_SOURCE 73 | # define FNM_NOSYS (-1) 74 | #endif 75 | 76 | /* Match NAME against the filename pattern PATTERN, 77 | returning zero if it matches, FNM_NOMATCH if not. */ 78 | extern int fnmatch __P ((__const char *__pattern, __const char *__name, 79 | int __flags)); 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* fnmatch.h */ 86 | -------------------------------------------------------------------------------- /docs/kwldinfo.hlp: -------------------------------------------------------------------------------- 1 | $World Info 2 | 3 | !name;World Name 4 | !keys;Keys 5 | !inv;Inventory 6 | !misc;Miscellaneous 7 | !flags;Set/Clear Flags 8 | 9 | :name;World Name 10 | 11 | The name of the world need not necessarily 12 | match the filename of the world, although 13 | it usually should (minus the .zzt 14 | extension). 15 | 16 | If you do not modify the world name and 17 | you save your world under a new name, the 18 | world name will be changed to match. If, 19 | however, you either change the world name, 20 | or rename the file outside of KevEdit (so 21 | that the two do not match before a save 22 | occurs), then KevEdit will leave the world 23 | name as-is when saving. 24 | 25 | If a different name is used, that name 26 | will appear under the word "World" on the 27 | title screen menu in ZZT. When a user 28 | quits from the world, then presses 'p' to 29 | play again, a different world will be 30 | loaded! Simply use a "file name" for the 31 | second world based on the "world name" of 32 | the first world. 33 | 34 | Example: 35 | 36 | The player loads "test.zzt" which has the 37 | world name "newworld". After the player 38 | dies in "test.zzt", he/she presses 'p' to 39 | play again, but instead of starting in 40 | "test.zzt", zzt loads "newworld.zzt". 41 | Consult the ZZT Encyclopedia Online for an 42 | example. 43 | 44 | :keys;Keys 45 | 46 | Keys which the player possesses are 47 | displayed as keys. Doors represent keys 48 | which the player could obtain. Place the 49 | cursor over a key or door and press ENTER 50 | or SPACEBAR to give or take that key from 51 | the player. 52 | 53 | :inv;Inventory 54 | 55 | The initial inventory of the player may be 56 | modified easily. Pressing ENTER edits the 57 | value of the item. Left and right change 58 | the value by ten units at a time. To 59 | change the value by one unit at a time, 60 | use '+' and '-'. 61 | 62 | :misc;Miscellaneous 63 | 64 | Torch Cycles 65 | * Usually used exclusively in saved 66 | games, the number of torch cycles 67 | remaining indicates how long the player 68 | has before a torch burns out. 69 | Energizer Cycles 70 | * Energizer cycles, by a similar measure, 71 | indicate how much longer an energizer 72 | will last. 73 | Time Elapsed 74 | * How much time within the current 75 | board's timelimit countdown has been 76 | used up 77 | Is Saved Game 78 | * For saved games, this is set to true, 79 | and is false for normal worlds. ZZT 80 | uses the same file format for both 81 | worlds and saved games, using this flag 82 | to ensure that one does not impersonate 83 | the other. ZZT will not play or edit 84 | saved games and will not restore 85 | worlds, regardless of extension. 86 | 87 | :flags;Set/Clear Flags 88 | 89 | Pressing enter on the Set/Clear Flags 90 | option will present a list of the 91 | currently set flags. DELETE or BACKSPACE 92 | will clear a flag. 93 | 94 | ZZT supports up to ten flags. The order of 95 | the flags is determined by zzt. When a 96 | flag is set, it is placed in the first 97 | available slot and removed from that slot 98 | when cleared. Thus the order of the flags 99 | is completely arbitrary, but may be useful 100 | in debugging saved games. 101 | -------------------------------------------------------------------------------- /docs/kbrdinfo.hlp: -------------------------------------------------------------------------------- 1 | @Board Info Dialog 2 | $Board Info Dialog 3 | 4 | !title;Title 5 | !darkness;Board is Dark 6 | !zap;Re-enter When Zapped 7 | !timelimit;Time Limit 8 | !maxshots;Maximum Shots 9 | !boards;Adjacent Boards 10 | !boardlink;* Link feature * 11 | !size;Board Size 12 | 13 | Use ENTER to toggle or edit each of these 14 | properties. The LEFT and RIGHT arrows, as 15 | well as + and - will increase and 16 | decrease each option, where possible. 17 | 18 | :title;Title 19 | 20 | Press enter to change the title of the 21 | board. The title may be up to 34 22 | characters and may use the $ and !; zzt 23 | markup characters for special effects in 24 | the board dialogs. 25 | 26 | :darkness;Board is Dark 27 | 28 | Enter will toggle between darkness and 29 | brightness. The player must use torches to 30 | see in a dark room. 31 | 32 | :zap;Re-Enter When Zapped 33 | 34 | When this option is on and the player is 35 | shot or is touched by an enemy, he will 36 | be moved back to the position where he 37 | entered the room. 38 | !-zap;Ways the player is "zapped" 39 | 40 | When the player is zapped, he or she is 41 | returned to the position set by Re-Enter X 42 | and Re-Enter Y. Modifying these values is 43 | usually not useful, however, because ZZT 44 | sets them whenever the player enters a 45 | board. 46 | 47 | :timelimit;Time Limit 48 | 49 | A limit can be imposed on the amount the 50 | player may spend in a room. Once the time 51 | expires, the player is zapped and the 52 | counter starts over. 53 | 54 | This is most useful in combination with 55 | "Re-enter when zapped". 56 | 57 | Objects can #give and #take time. 58 | However, #give moves the counter closer 59 | to zero, while #take gives the player 60 | more time. If #take would put the timer 61 | over the time limit, it does not work and 62 | the message in take is sent. 63 | 64 | :maxshots;Maximum Shots 65 | 66 | This option determines how many shots the 67 | player may fire at the same time on a 68 | board. A player cannot fire until less 69 | than this number of his or her bullets 70 | remain on the board. 71 | 72 | :boards;Adjacent Boards 73 | 74 | This option links boards together so that 75 | the player can travel from one room to 76 | another by moving off the screen. 77 | 78 | :boardlink;* Link feature * 79 | 80 | KevEdit has a special feature to aid in 81 | the proper linkage of boards. An asterisk 82 | will appear next to any adjacent board 83 | which links back to the current board in 84 | the opposite direction. To force the other 85 | board to link backward, simply press '*' 86 | when that board is selected. 87 | 88 | Take that ZZT Editor. 89 | 90 | :size;Board Size 91 | 92 | The size of the current board is displayed 93 | at the bottom of the Board Info Dialog in 94 | units of both bytes and kilobytes, with 95 | 1024 bytes to a kilobyte (not 1000!). If 96 | this value exceeds 20,000 bytes then the 97 | number will show red. 98 | 99 | There is much debate over exactly what the 100 | board size limit is for ZZT. By consensus, 101 | boards become unstable somewhere near 102 | 20KB, but no one has yet proven any 103 | specific value. 20,000 bytes, which is 104 | just 469 bytes short of 20KB, seems as 105 | likely a candidate as any number. 106 | -------------------------------------------------------------------------------- /src/themes/rusty/tdialog.c: -------------------------------------------------------------------------------- 1 | /* TheDraw C Screen Image. Date: 02/16/02 */ 2 | #define TRANSFER_DIALOG_WIDTH 33 3 | #define TRANSFER_DIALOG_DEPTH 7 4 | #define TRANSFER_DIALOG_LENGTH 462 5 | unsigned char TRANSFER_DIALOG [] = { 6 | '\xda', 0x2F, '\xc4', 0x2F, '\xc4', 0x2F, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 7 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 'T', 0x2F, 'r', 0x2F, 'a', 0x2F, 8 | 'n', 0x2F, 's', 0x2F, 'f', 0x2F, 'e', 0x2F, 'r', 0x2F, ' ', 0x2F, 9 | 'B', 0x2F, 'o', 0x2F, 'a', 0x2F, 'r', 0x2F, 'd', 0x2F, '\xc4', 0x2A, 10 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 11 | '\xc4', 0x2A, '\xc4', 0x2A, '\xbf', 0x2A, '\xb3', 0x2A, ' ', 0x2A, ' ', 0x07, 12 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 13 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 14 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 15 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 16 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x2A, '\xb3', 0x2A, 17 | '\xb3', 0x2A, ' ', 0x2A, ' ', 0x07, ' ', 0x07, ' ', 0x07, 'I', 0x0A, 18 | 'm', 0x0A, 'p', 0x0A, 'o', 0x0A, 'r', 0x0A, 't', 0x0A, ' ', 0x0A, 19 | 'F', 0x0A, 'r', 0x0A, 'o', 0x0A, 'm', 0x0A, ' ', 0x0A, ' ', 0x0A, 20 | ' ', 0x0A, 'Z', 0x0A, 'Z', 0x0A, 'T', 0x0A, ' ', 0x0A, 'W', 0x0A, 21 | 'o', 0x0A, 'r', 0x0A, 'l', 0x0A, 'd', 0x0A, ' ', 0x07, ' ', 0x07, 22 | ' ', 0x07, ' ', 0x2A, '\xb3', 0x2A, '\xb3', 0x2A, ' ', 0x2A, ' ', 0x07, 23 | ' ', 0x07, ' ', 0x07, 'I', 0x0A, 'm', 0x0A, 'p', 0x0A, 'o', 0x0A, 24 | 'r', 0x0A, 't', 0x0A, ' ', 0x0A, 'F', 0x0A, 'r', 0x0A, 'o', 0x0A, 25 | 'm', 0x0A, ' ', 0x0A, 'B', 0x0A, 'o', 0x0A, 'a', 0x0A, 'r', 0x0A, 26 | 'd', 0x0A, ' ', 0x0A, ' ', 0x0A, 'F', 0x0A, 'i', 0x0A, 'l', 0x0A, 27 | 'e', 0x0A, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x2A, '\xb3', 0x2A, 28 | '\xb3', 0x2A, ' ', 0x2A, ' ', 0x0A, ' ', 0x0A, ' ', 0x0A, 'E', 0x0A, 29 | 'x', 0x0A, 'p', 0x0A, 'o', 0x0A, 'r', 0x0A, 't', 0x0A, ' ', 0x0A, 30 | 'T', 0x0A, 'o', 0x0A, ' ', 0x0A, ' ', 0x0A, ' ', 0x0A, 'B', 0x0A, 31 | 'o', 0x0A, 'a', 0x0A, 'r', 0x0A, 'd', 0x0A, ' ', 0x0A, ' ', 0x0A, 32 | 'F', 0x0A, 'i', 0x0A, 'l', 0x0A, 'e', 0x0A, ' ', 0x07, ' ', 0x07, 33 | ' ', 0x07, ' ', 0x2A, '\xb3', 0x2A, '\xb3', 0x2A, ' ', 0x2A, ' ', 0x07, 34 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 35 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 36 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 37 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, 38 | ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x07, ' ', 0x2A, '\xb3', 0x2A, 39 | '\xc0', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 40 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 41 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 42 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 43 | '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, '\xc4', 0x2A, 44 | '\xc4', 0x2F, '\xc4', 0x2F, '\xd9', 0x2F}; 45 | -------------------------------------------------------------------------------- /src/synth/notes.h: -------------------------------------------------------------------------------- 1 | /* notes.h -- Generate musical notes 2 | * $Id: notes.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2002 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef _NOTES_H 21 | #define _NOTES_H 1 22 | 23 | #include 24 | #include 25 | 26 | /* Note types */ 27 | #define NOTETYPE_NONE 0 /* Usually end-of-input */ 28 | #define NOTETYPE_NOTE 1 /* Just a note */ 29 | #define NOTETYPE_REST 2 /* Rest for a moment */ 30 | #define NOTETYPE_DRUM 3 /* Tick-tock */ 31 | 32 | /* Note lengths */ 33 | #define NOTELEN_WHOLE 0x20 34 | #define NOTELEN_HALF 0x10 35 | #define NOTELEN_QUARTER 0x08 36 | #define NOTELEN_EIGHTH 0x04 37 | #define NOTELEN_SIXTEENTH 0x02 38 | #define NOTELEN_THIRTYSECOND 0x01 39 | 40 | /* Note indexes */ 41 | #define NOTE_C 0 42 | #define NOTE_Cs 1 43 | #define NOTE_D 2 44 | #define NOTE_Ds 3 45 | #define NOTE_E 4 46 | #define NOTE_F 5 47 | #define NOTE_Fs 6 48 | #define NOTE_G 7 49 | #define NOTE_Gs 8 50 | #define NOTE_A 9 51 | #define NOTE_As 10 52 | #define NOTE_B 11 53 | 54 | /* Drum information */ 55 | #define DRUMBREAK 1 /* 1 millisecond delay between drum changes */ 56 | #define DRUMCOUNT 10 /* 10 drums in all */ 57 | #define DRUMCYCLES 14 /* 14 cycles per drum */ 58 | extern short drums[DRUMCOUNT][DRUMCYCLES]; 59 | 60 | typedef struct musicalNote { 61 | int type; /* Type of note */ 62 | uint8_t length; /* Note length */ 63 | int index; /* Frequency index or drum index */ 64 | int octave; /* Octave of note (0 is middle octave) */ 65 | int slur; /* TRUE if note is to slur/tie with the next */ 66 | 67 | int src_pos; /* Position of next note in source string */ 68 | struct musicalNote* next; /* Notes can be chained together */ 69 | } musicalNote; 70 | 71 | typedef struct musicSettings { 72 | /* If true, apply PIT-style rounding. */ 73 | bool pitRounding; 74 | 75 | /* Duration of a whole note, in milliseconds */ 76 | float wholeDuration; 77 | 78 | /* Spacing between notes, in milliseconds */ 79 | float noteSpacing; 80 | } musicSettings; 81 | 82 | /* Delete a chain of notes */ 83 | void deleteNoteChain(musicalNote* chain); 84 | 85 | /* Apply filters to a given frequency. */ 86 | float noteFilter(float freq, musicSettings settings); 87 | 88 | /* Return the frequency of a given musical note. */ 89 | float noteFrequency(musicalNote mnote, musicSettings settings); 90 | 91 | /* Return the duration of a note. */ 92 | float noteDuration(musicalNote note, musicSettings settings); 93 | 94 | /* Return the spacing expected after a note (when not sluring) */ 95 | float noteSpacing(musicalNote note, musicSettings settings); 96 | 97 | #endif /* _NOTES_H */ 98 | -------------------------------------------------------------------------------- /inst/platform/windows/kevedit.iss.in: -------------------------------------------------------------------------------- 1 | ; Install program generation script for KevEdit in windows 2 | ; Requires Inno Setup 3 | 4 | [Setup] 5 | AppName=KevEdit 6 | AppPublisher=Kev Vance and Ryan Phillips 7 | AppPublisherURL=http://github.com/cknave/kevedit 8 | AppSupportURL=https://github.com/cknave/kevedit/issues 9 | AppUpdatesURL=https://github.com/cknave/kevedit/releases 10 | AppVerName=KevEdit @VERSION@ 11 | ArchitecturesAllowed=x64 12 | ArchitecturesInstallIn64BitMode=x64 13 | ChangesAssociations=yes 14 | DefaultDirName={autopf}\KevEdit 15 | DefaultGroupName=Games\ZZT 16 | InfoBeforeFile=Z:\work\kevedit\README.md 17 | OutputDir=Z:\dist 18 | PrivilegesRequired=lowest 19 | PrivilegesRequiredOverridesAllowed=dialog 20 | 21 | ; Cosmetics 22 | WindowVisible=no 23 | WizardImageFile=Z:\platform\windows\install-big.bmp 24 | WizardSmallImageFile=Z:\platform\windows\install-small.bmp 25 | WizardStyle=modern 26 | 27 | [Files] 28 | Source: "Z:\work\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion 29 | Source: "Z:\work\ChangeLog.txt"; DestDir: "{app}"; Flags: ignoreversion 30 | Source: "Z:\work\COPYING.txt"; DestDir: "{app}"; Flags: ignoreversion 31 | Source: "Z:\work\kevedit\src\kevedit\kevedit.exe"; DestDir: "{app}"; Flags: ignoreversion 32 | Source: "Z:\work\kevedit\docs\kevedit.zml"; DestDir: "{app}"; Flags: ignoreversion 33 | Source: "Z:\work\kevedit\README.md"; DestDir: "{app}"; Flags: ignoreversion 34 | Source: "Z:\work\kevedit\legal.md"; DestDir: "{app}"; Flags: ignoreversion 35 | Source: "Z:\work\sdl\README-SDL.txt"; Destdir: "{app}"; Flags: ignoreversion 36 | Source: "Z:\work\sdl\SDL2.dll"; Destdir: "{app}"; Flags: ignoreversion 37 | 38 | [Icons] 39 | Name: "{group}\KevEdit"; Filename: "{app}\kevedit.exe"; WorkingDir: "{userdocs}" 40 | Name: "{group}\KevEdit Readme"; Filename: "{app}\README.md" 41 | Name: "{group}\Uninstall KevEdit"; Filename: "{uninstallexe}" 42 | 43 | [Run] 44 | Filename: "{app}\kevedit.exe"; Description: "Launch kevedit"; WorkingDir: "{userdocs}"; Flags: nowait postinstall skipifsilent 45 | 46 | [Registry] 47 | ; Associate KevEdit with ZZT worlds 48 | Root: HKA; Subkey: "Software\Classes\.zzt\OpenWithProgids"; ValueType: string; ValueName: "KevEdit.zzt"; ValueData: ""; Flags: uninsdeletevalue 49 | Root: HKA; Subkey: "Software\Classes\.sav\OpenWithProgids"; ValueType: string; ValueName: "KevEdit.sav"; ValueData: ""; Flags: uninsdeletevalue 50 | 51 | Root: HKA; Subkey: "Software\Classes\KevEdit.zzt"; ValueType: string; ValueName: ""; ValueData: "ZZT World"; Flags: uninsdeletekey 52 | Root: HKA; Subkey: "Software\Classes\KevEdit.sav"; ValueType: string; ValueName: ""; ValueData: "ZZT Save"; Flags: uninsdeletekey 53 | 54 | Root: HKA; Subkey: "Software\Classes\KevEdit.zzt\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\kevedit.exe,0" 55 | Root: HKA; Subkey: "Software\Classes\KevEdit.sav\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\kevedit.exe,0" 56 | 57 | Root: HKA; Subkey: "Software\Classes\KevEdit.zzt\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\kevedit.exe"" ""%1""" 58 | Root: HKA; Subkey: "Software\Classes\KevEdit.sav\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\kevedit.exe"" ""%1""" 59 | 60 | Root: HKA; Subkey: "Software\Classes\Applications\kevedit.exe\SupportedTypes"; ValueType: string; ValueName: ".zzt"; ValueData: "" 61 | Root: HKA; Subkey: "Software\Classes\Applications\kevedit.exe\SupportedTypes"; ValueType: string; ValueName: ".sav"; ValueData: "" 62 | -------------------------------------------------------------------------------- /docs/kbackbuf.hlp: -------------------------------------------------------------------------------- 1 | @The Backbuffer 2 | $The Backbuffer 3 | 4 | In KevEdit, the backbuffer is a valuable 5 | tool for storing tiles, as well as 6 | customized gradients. 7 | 8 | !quick;Quick Keys 9 | !resize;Resizing the Backbuffer 10 | !lock;Backbuffer Locking 11 | !acquire;Acquire Mode 12 | !draw;Draw Mode 13 | !gradient;Gradient Draw Mode 14 | 15 | :quick;Quick Keys 16 | 17 | To quickly access a position in the 18 | pattern selector, the numbers 0-9 can be 19 | used. Pressing 0 will select the Empty 20 | pattern, which you will probably need 21 | frequently. Pressing one of 1-9 will 22 | select a slot in the backbuffer. 23 | 24 | :resize;Resizing the Backbuffer 25 | 26 | The backbuffer may be resized using 27 | the '<' and '>' keys. Some gradients may 28 | not fit in the default ten-tile 29 | backbuffer, so this will prove useful. 30 | Only ten tiles will be visible at once, 31 | but the backbuffer will scroll 32 | automatically. 33 | 34 | The Gradient Tool, Gradient Draw Mode, and 35 | Random Fill all use the ENTIRE backbuffer, 36 | so feel free to resize the backbuffer as 37 | necessary using '<' and '>'. 38 | 39 | :lock;Backbuffer Locking 40 | 41 | By default, using ENTER to modify a tile, 42 | plotting an uncommon tile from the F1 - F3 43 | menus, or pressing INSERT will copy a tile 44 | into the backbuffer. Backbuffer locking 45 | prevents the backbuffer from being 46 | modified, except that when INSERT is 47 | pressed, the tile under the cursor will be 48 | inserted into the currently selected 49 | backbuffer slot, if the pattern selector 50 | is over the backbuffer. This mimics ZZTAE 51 | behavior. 52 | 53 | To toggle backbuffer locking, press '/'. 54 | 55 | :acquire;Acquire Mode 56 | 57 | Acquire mode lifts tiles into the 58 | backbuffer as the cursor is moved. By 59 | using acquire mode, one can load a large 60 | gradient or line of objects into the 61 | backbuffer with relatively few keystrokes. 62 | Press 'a' to toggle acquire mode. The 'a' 63 | next to the backbuffer will indicate 64 | whether acquire mode is on or off. 65 | 66 | By default, the backbuffer will be resized 67 | so that no non-empty tiles are lost. To 68 | force the backbuffer to stay the same 69 | size, use SHIFT+'A'. 70 | 71 | Holding down ALT while moving the cursor 72 | will acquire several tiles at once. 73 | 74 | :draw;Draw Mode 75 | 76 | This drawing tool should be familiar from 77 | the original ZZT editor. Simply press TAB 78 | and the currently selected pattern will be 79 | plotted everywhere the cursor goes. Press 80 | TAB again to exit Draw Mode. 81 | 82 | :gradient;Gradient Draw Mode 83 | 84 | Gradient Draw Mode works much in the same 85 | way as Draw Mode, except that KevEdit 86 | cycles through the backbuffer with each 87 | cursor movement. This can be used to 88 | easily plot gradients or other patterns. 89 | 90 | Use SHIFT-TAB to activate gradient mode 91 | and TAB to turn it off. When gradient mode 92 | is on, KevEdit will cycle through the 93 | backbuffer backward so that tiles are laid 94 | down in the same order they enter the 95 | buffer. To cycle forward, press SHIFT-TAB 96 | a second time. 97 | 98 | Holding down ALT while moving will 99 | continuously paint the gradient for ten 100 | spaces at a time horizontally and five 101 | tiles at a time vertically. 102 | 103 | If the one of the standard patterns is 104 | selected, a fade from foreground color to 105 | background color will be used instead of 106 | the backbuffer. 107 | -------------------------------------------------------------------------------- /src/dialogs/files.h: -------------------------------------------------------------------------------- 1 | /* files.h -- filesystem routines 2 | * $Id: files.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __FILES_H 21 | #define __FILES_H 22 | 23 | #include "structures/svector.h" 24 | 25 | /* Copy flags */ 26 | #define COPY_NOOVERWRITE 0 27 | #define COPY_OVERWRITE 1 28 | #define COPY_DISPLACE 2 29 | 30 | /* Copy results */ 31 | #define COPY_SUCCESS 0 /* Ok */ 32 | #define COPY_EXISTS 1 /* Destination file already exists */ 33 | #define COPY_BADSOURCE 2 /* Can't open source file */ 34 | #define COPY_BADDEST 3 /* Can't open destination file */ 35 | 36 | /* General file types */ 37 | #define FTYPE_FILE 1 38 | #define FTYPE_DIR 2 39 | #define FTYPE_ALL 3 40 | 41 | /* Types of slashes */ 42 | #define SLASH_FORWARD 0 43 | #define SLASH_BACK 1 44 | 45 | #ifdef WIN32 46 | #define SLASH_DEFAULT SLASH_BACK 47 | #else 48 | #define SLASH_DEFAULT SLASH_FORWARD 49 | #endif 50 | 51 | /* Displacement constants */ 52 | #define DISPLACE_LEADER "~" 53 | #define DISPLACE_SEPERATOR "?" 54 | 55 | /* filetosvector() - loads a textfile into a new stringvector */ 56 | stringvector filetosvector(char* filename, int wrapwidth, int editwidth); 57 | 58 | /* svectortofile() - copies a stringvector into a file. sv is not changed */ 59 | void svectortofile(stringvector * sv, char *filename); 60 | 61 | /* readdirectorytosvector() - reads a directory listing into an svector */ 62 | stringvector readdirectorytosvector(char *dir, stringvector *extensions, int filetypes); 63 | 64 | /* globtosvector() - put raw glob information in an svector */ 65 | stringvector globtosvector(char * pattern, int filetypes); 66 | 67 | /* globdirectorytosvector() - globs a directory listing into an svector */ 68 | stringvector globdirectorytosvector(char * dir, char * pattern, int filetypes); 69 | 70 | /* File access */ 71 | int fileexists(char* filename); 72 | int fileisdir(char* filename); 73 | 74 | /* File copying */ 75 | int copyfile(char* srcname, char* destname, int flags); 76 | int copyfilebydir(char* srcdir, char* destdir, char* filename, int flags); 77 | int copyfilepatternbydir(char* srcdir, char* destdir, char* pattern, int flags, stringvector* successlist); 78 | 79 | /* Determine path of self from main's argv[0] */ 80 | char* locateself(char* argv0); 81 | 82 | /* Deduce filename or path from a file's full path */ 83 | char* fileof(char* buffer, char* fullpath, int buflen); 84 | char* pathof(char* buffer, char* fullpath, int buflen); 85 | char* fullpath(char* path, char* file, int slashtype); 86 | 87 | /* Change all the slashes in a pathname */ 88 | char* reslash(char* pathname, int slashtype); 89 | 90 | /* Run a program with given path and arguments in current directory */ 91 | int run(char* path, char* program, char* args); 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /docs/kobjedit.hlp: -------------------------------------------------------------------------------- 1 | @The All-Powerful Object Code Editor 2 | $The Object Code Editor 3 | 4 | !copy;Copy & Paste 5 | !wordwrap;Word Wrap 6 | !ascii;ASCII Charater Insertion 7 | !files;Loading and Saving Text Files 8 | !zzm;Importing ZZT Music 9 | !play;Testing ZZT Music 10 | !help;Context Sensitive Help 11 | !txted;Text Editor (! editor) 12 | 13 | Objects and scrolls are programmed in the 14 | ZZT-OOP language. When you edit these 15 | types, you will be presented with the 16 | object editor. This is a simple text 17 | editor with features specific to ZZT 18 | programming. ARROW KEYS move the cursor, 19 | ESCAPE quits, ctrl+'y' deletes a line, et 20 | cetera. A text editor may also be accessed 21 | by pressing '!' on the main screen, a la 22 | zzt. 23 | !txted;More information on ! editor 24 | 25 | :copy;Copy & Paste 26 | 27 | The Object editor features copy and paste. 28 | Use SHIFT to select a region of text, then 29 | press CTRL+'c' to copy. CTRL-'v' may then 30 | be used to paste the copied text later. 31 | CTRL-'x' will cut the selected text while 32 | CTRL-DELETE simply clears without copying. 33 | 34 | :wordwrap;Word Wrap 35 | 36 | On by default, word wrap allows text to 37 | spill over onto the next line when typing 38 | paragraphs. The editor is just intelligent 39 | enough to identify zzt commands and avoid 40 | word-wrapping them improperly. Use ALT+'-' 41 | and ALT+'+' (or ALT+'=') to increase or 42 | decrease the maximum length of a line. 43 | Between 42 and 1, word wrap is set to off, 44 | which prevents wrapping of any kind. 45 | 46 | :ascii;ASCII Charater Insertion 47 | 48 | Arbitrary ASCII may be inserted characters 49 | into your program by pressing ctrl+'a'. 50 | If the cursor is on the same line as a 51 | #char command, it will place the number of 52 | the character into the program. 53 | 54 | :files;Loading and Saving Text Files 55 | 56 | The Object Code Editor can be used to load 57 | and save text files. ALT+'s' will save the 58 | program to a file and ALT+'o' will load a 59 | previously saved file, replacing any text 60 | already in the editor. ALT+'i' will insert 61 | a file without destroying existing work. 62 | 63 | :zzm;Importing ZZT Music 64 | 65 | Music stored in ZZM formatted files can be 66 | loaded into the Object Editor quite 67 | easily. Simply press ALT+'m', select a ZZM 68 | file and a song to load. 69 | 70 | NOTE: Due to extreme laziness and the 71 | complexities of programming, KevEdit will 72 | only recognize songs for which titles are 73 | provided. The music ripper does not 74 | provide titles, so ripped files will have 75 | to be edited before using. See the 76 | included file soundfx.zzm for an example 77 | of how to do this. 78 | 79 | :play;Testing ZZT Music 80 | 81 | To test a song in KevEdit, simply move the 82 | cursor to the beginning of the song and 83 | press CTRL-T. To hear the music without 84 | the slurring problem (that is, with tiny 85 | breaks between notes), use ALT-T. 86 | 87 | :help;Context Sensitive Help 88 | 89 | Pressing F1 will bring up the ZZT-OOP 90 | Programming Reference. If the cursor is on 91 | the same line as a #command, it will look 92 | that command up in the help. 93 | 94 | :txted;Text Editor (! editor) 95 | 96 | Pressing '!' while editing a ZZT World 97 | will open a general text editor with 98 | similar functions to the object editor. 99 | When you exit the text editor by pressing 100 | ESC, your work will be remembered for the 101 | next time you open the text editor, until 102 | you exit KevEdit. If you wish to save your 103 | work to a file, use ALT-S. 104 | -------------------------------------------------------------------------------- /docs/kselect.hlp: -------------------------------------------------------------------------------- 1 | @Tile Selection 2 | $Tile Selection 3 | 4 | Tile selection is a very powerful tool 5 | offered by KevEdit. Once a set of tiles 6 | has been selected, it can be copied, 7 | pasted into, or filled in various ways. 8 | 9 | !selecting;Selecting Tiles 10 | !copy;Copy and Paste 11 | !fill;Filling 12 | !randfill;Random Filling 13 | !gradtool;Gradient Tool 14 | 15 | :selecting;Selecting Tiles 16 | 17 | Selecting tiles is easy. To quickly select 18 | a block of tiles, hold down SHIFT while 19 | moving the cursor with the arrow keys. 20 | Release shift, move the cursor, and repeat 21 | to add another block to the selection. 22 | 23 | To flood select a group of similar tiles, 24 | press lowercase 'x'. To select all tiles 25 | on the current board which are similar to 26 | the tile under the cursor, press 27 | SHIFT+'X'. 28 | 29 | The current selection can be reset by 30 | pressing ESCAPE. 31 | 32 | :copy;Copy and Paste 33 | 34 | To copy the selected area, press CTRL-C. 35 | You may then press CTRL-V to paste the 36 | copied tiles. Use the arrow keys to move 37 | the copied tiles to where you want 38 | them, then press SPACEBAR or ENTER. To 39 | cancel pasting, press ESCAPE. 40 | 41 | To cut a selected area, press CTRL-X. 42 | This will copy the selected area and then 43 | fill it with the currently selected 44 | pattern. 45 | 46 | If an area is selected when you paste a 47 | group of tiles, then only the selected 48 | area will be affected. This can be very 49 | useful, especially when combined with the 50 | gradient tool. 51 | 52 | :fill;Filling 53 | 54 | Once an area has been selected, it can be 55 | filled with the current pattern by 56 | pressing lowercase 'f'. 57 | 58 | If an area is not selected, pressing 'f' 59 | will floodfill around the cursor. This is 60 | equivalent to pressing 'x' then 'f'. 61 | 62 | :randfill;Random Filling 63 | 64 | Pressing SHIFT+'F' will fill the 65 | selected area with tiles chosen at random 66 | from the pattern buffer. If the backbuffer 67 | is selected, tiles will be randomly chosen 68 | from there. If the standard patterns are 69 | selected, a mix of the current foreground 70 | and background colours will be used. 71 | 72 | If no tiles are selected, a random 73 | floodfill will occur. 74 | 75 | BEWARE: once an area is filled with 76 | random tiles, it is difficult to undo. 77 | Save beforehand if possible. An undo 78 | feature is in the works, but don't get 79 | your hopes up too high. 80 | 81 | In a random flood fill, all tiles used are 82 | given equal probability. To increase the 83 | occurrence of a certain kind of tile, put 84 | more than one copy in the backbuffer. 85 | 86 | !-kbackbuf;See Backbuffer Documentation 87 | 88 | :gradtool;Gradient Tool 89 | 90 | One of the most versatile drawing tools 91 | offered by KevEdit, the Gradient tool 92 | allows a custom or built-in gradient to be 93 | drawn in various ways. 94 | 95 | Press 'g' to activate the Gradient Tool 96 | and follow the provided instructions. 97 | 98 | If an area is not selected, you will be 99 | able to select one block or flooded 100 | region. This will be depreciated in future 101 | releases. 102 | 103 | If the pattern selector is above the 104 | standard patterns (left of the 105 | backbuffer), then the gradient tool will 106 | use the current colour settings to create 107 | a gradient of walls fading from the 108 | foreground colour to the background 109 | colour. 110 | 111 | If the pattern selector is above the 112 | backbuffer, the patterns in the backbuffer 113 | will be used by the gradient tool. 114 | 115 | !-kbackbuf;See Backbuffer Documentation 116 | -------------------------------------------------------------------------------- /src/dialogs/dialog.h: -------------------------------------------------------------------------------- 1 | /* dialog.h - general dialog tools 2 | * $Id: dialog.h,v 1.1 2003/11/01 23:45:56 bitman Exp $ 3 | * Copyright (C) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef _DIALOG_H 21 | #define _DIALOG_H 1 22 | 23 | #include "display/display.h" 24 | 25 | /* Component types */ 26 | #define DIALOG_COMP_TITLE 0 27 | #define DIALOG_COMP_HEADING 1 28 | #define DIALOG_COMP_LABEL 2 29 | #define DIALOG_COMP_OPTION 3 30 | 31 | typedef struct dialogComponent { 32 | int type; 33 | int x, y; /* Position in dialog */ 34 | unsigned char color; 35 | 36 | char * text; 37 | 38 | int id; /* Unique identifier */ 39 | } dialogComponent; 40 | 41 | typedef struct dialog { 42 | dialogComponent * components; /* Static components */ 43 | dialogComponent * options; /* Selectable options */ 44 | 45 | int componentcount; 46 | int optioncount; 47 | 48 | int curoption; /* Current option */ 49 | 50 | } dialog; 51 | 52 | /* dialogInit(dialog) 53 | * Initialize empty dialog 54 | */ 55 | void dialogInit(dialog * dia); 56 | 57 | /* dialogFree(dialog) 58 | * Free and empty a dialog 59 | */ 60 | void dialogFree(dialog * dia); 61 | 62 | /* dialogComponentMake(type, x, y, color, text, id) 63 | * Generate a component from the given values 64 | * Memory is shared in the case of "text" 65 | */ 66 | dialogComponent dialogComponentMake(int type, int x, int y, unsigned char color, char * text, int id); 67 | 68 | /* dialogAddComponent(dialog, component) 69 | * Add a component to a dialog 70 | * Component is copied completely 71 | */ 72 | void dialogAddComponent(dialog * dia, dialogComponent component); 73 | 74 | /* dialogAddCompList(dialog, complist, size) 75 | * Add a list of components to a dialog 76 | */ 77 | void dialogAddCompList(dialog * dia, dialogComponent * complist, int size); 78 | 79 | /* dialogDraw(display, dialog) 80 | * Draw a dialog to the given display 81 | */ 82 | void dialogDraw(displaymethod * mydisplay, dialog dia); 83 | 84 | /* dialogEraseComponent(display, component) 85 | * Erase the given component from the screen (rarely useful) */ 86 | void dialogEraseComponent(displaymethod * mydisplay, dialogComponent * component); 87 | 88 | /* dialogComponentEdit(display, component, editwidth, linedflags) 89 | * Edit the current component in the line_editor 90 | * using the given flags and editwidth */ 91 | int dialogComponentEdit(displaymethod * mydisplay, dialogComponent * comp, int editwidth, int linedflags); 92 | 93 | /* dialogGetCurOption(dialog) 94 | * Returns a pointer to the current option 95 | */ 96 | dialogComponent * dialogGetCurOption(dialog dia); 97 | 98 | /* dialogNextOption(dialog) 99 | * dialogPrevOption(dialog) 100 | * Switches the currently selected option 101 | */ 102 | void dialogNextOption(dialog * dia); 103 | void dialogPrevOption(dialog * dia); 104 | 105 | 106 | /* Testing code */ 107 | void dialogTest(displaymethod * mydisplay); 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /src/display/unicode.c: -------------------------------------------------------------------------------- 1 | #include "unicode.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | /* The all-powerful min/max macros */ 14 | #define min(a, b) ((a) < (b) ? (a) : (b)) 15 | #define max(a, b) ((a) > (b) ? (a) : (b)) 16 | #define swap(a, b, t) { (t) = (a); (a) = (b); (b) = (t); } 17 | 18 | /* Credits go to Ben Russell (iamgreaser) for the CP437 to 19 | Unicode table. 20 | Note, 0xED now redirects to U+03D5 as identified by IBM; 21 | see Wikipedia note. https://bit.ly/39t1732 */ 22 | 23 | char unicode_to_CP437[65536]; 24 | int unicode_table_inited = 0; 25 | 26 | wchar_t CP437_to_unicode[256] = { 27 | 0x20, 0x263a, 0x263b, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, 28 | 0x25d8, 0x25cb, 0x25d9, 0x2642, 0x2640, 0x266a, 0x266b, 0x263c, 29 | 0x25ba, 0x25c4, 0x2195, 0x203c, 0xb6, 0xa7, 0x25ac, 0x21a8, 30 | 0x2191, 0x2193, 0x2192, 0x2190, 0x221f, 0x2194, 0x25b2, 0x25bc, 31 | 32 | 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 33 | 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 34 | 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 35 | 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 36 | 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 37 | 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 38 | 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 39 | 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 40 | 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 41 | 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 42 | 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 43 | 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x2302, 44 | 45 | 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, 46 | 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5, 47 | 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, 48 | 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0x20a7, 0x192, 49 | 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, 50 | 0xbf, 0x2310, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb, 51 | 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 52 | 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, 53 | 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, 54 | 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, 55 | 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, 56 | 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, 57 | 0x3b1, 0xdf, 0x393, 0x3c0, 0x3a3, 0x3c3, 0xb5, 0x3c4, 58 | 0x3a6, 0x398, 0x3a9, 0x3b4, 0x221e, 0x3d5, 0x3b5, 0x2229, 59 | 0x2261, 0xb1, 0x2265, 0x2264, 0x2320, 0x2321, 0xf7, 0x2248, 60 | 0xb0, 0x2219, 0xb7, 0x221a, 0x207f, 0xb2, 0x25a0, 0xa0 61 | }; 62 | 63 | void init_unicode_conversion() { 64 | setlocale(LC_CTYPE, "en_US.utf8"); 65 | bzero(unicode_to_CP437, 65536); 66 | 67 | /* First reverse the cp437 to unicode codepoint table. */ 68 | int i; 69 | for (i = 0; i <= 255; ++i) { 70 | unicode_to_CP437[CP437_to_unicode[i]] = i; 71 | } 72 | 73 | /* Then add some "near-equivalents" */ 74 | /*lowercase ø: make it look like phi*/ 75 | unicode_to_CP437[248] = 237; 76 | 77 | /*uppercase Ø: make it look like Theta*/ 78 | unicode_to_CP437[216] = 233; 79 | 80 | unicode_table_inited = 1; 81 | } 82 | 83 | char get_CP437_from_UTF8(char * utf8_str) { 84 | wchar_t codepoint; 85 | 86 | assert(unicode_table_inited); 87 | 88 | size_t bytes_converted = mbtowc(&codepoint, utf8_str, 89 | min(2, strlen(utf8_str))); 90 | 91 | /* Check if something went wrong. If so, abort. */ 92 | if (bytes_converted == (size_t)-1 || bytes_converted == (size_t)-2) { 93 | return 0; 94 | } 95 | 96 | if (codepoint >= 65536) { 97 | return 0; 98 | } 99 | 100 | return unicode_to_CP437[codepoint]; 101 | 102 | } 103 | -------------------------------------------------------------------------------- /src/kevedit/misc.h: -------------------------------------------------------------------------------- 1 | /* misc.h -- General routines for everyday KevEditing 2 | * $Id: misc.h,v 1.3 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2000 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef _MISC_H 21 | #define _MISC_H 1 22 | 23 | #include 24 | 25 | #include "kevedit.h" 26 | 27 | #include "display/display.h" 28 | 29 | #include "structures/selection.h" 30 | #include "structures/gradient.h" 31 | #include "structures/svector.h" 32 | 33 | /* TODO: Everything in this file needs to be sorted 34 | * very thoroughly. Most should be moved to other files. */ 35 | 36 | /* Copy and paste */ 37 | void copy(keveditor * myeditor); 38 | int paste(keveditor * myeditor); 39 | int countparams(ZZTblock *block); 40 | int pasteblock(ZZTblock *dest, ZZTblock *src, selection destsel, selection srcsel, int x, int y); 41 | 42 | /* Change a tile's color, taking text into account */ 43 | void encodetilecolor(ZZTtile * tile, textcolor color); 44 | 45 | /* Plot from the backbuffer to the cursor */ 46 | void plot(keveditor * myeditor); 47 | 48 | /* Make objects more obvious */ 49 | int showObjects(keveditor * myeditor); 50 | 51 | /* Running zzt */ 52 | void runzzt(char* path, char* world); 53 | 54 | int texteditordialog(displaymethod * mydisplay); 55 | 56 | void clearboard(ZZTworld * myworld); 57 | ZZTworld * clearworld(ZZTworld * myworld); 58 | 59 | void entergradientmode(keveditor * myeditor); 60 | void exitgradientmode(keveditor * myeditor); 61 | int toggledrawmode(keveditor * myeditor); 62 | int togglegradientmode(keveditor * myeditor); 63 | 64 | int saveworld(displaymethod * mydisplay, ZZTworld * myworld); 65 | ZZTworld * loadworld(displaymethod * mydisplay, ZZTworld * myworld, char *filename, bool *quit); 66 | 67 | int boardtransfer(displaymethod * mydisplay, ZZTworld * myworld); 68 | int importfromworld(displaymethod * mydisplay, ZZTworld * myworld); 69 | int importfromboard(displaymethod * mydisplay, ZZTworld * myworld); 70 | int exporttoboard(displaymethod * mydisplay, ZZTworld * myworld); 71 | 72 | void previouspattern(keveditor * myeditor); 73 | void nextpattern(keveditor * myeditor); 74 | 75 | patbuffer* createfillpatterns(keveditor* myeditor); 76 | patbuffer* createstandardpatterns(void); 77 | 78 | void floodselect(ZZTblock* block, selection fillsel, int x, int y); 79 | void tileselect (ZZTblock* block, selection fillsel, ZZTtile tile); 80 | 81 | void fillbyselection(keveditor *myeditor, ZZTworld* world, selection fillsel, patbuffer pbuf, int randomflag); 82 | 83 | void dofloodfill(keveditor * myeditor, int randomflag); 84 | 85 | /* Gradient fill helpers */ 86 | void movebykeystroke(int key, int* x, int* y, int minx, int miny, int maxx, int maxy, displaymethod * mydisplay); 87 | int promptforselection(selection sel, gradline * grad, keveditor* myeditor); 88 | int pickgradientpoint(ZZTworld * myworld, int* x, int* y, selection fillsel, patbuffer pbuf, gradline * grad, int randomseed, displaymethod* mydisplay); 89 | 90 | void gradientfillbyselection(ZZTworld * myworld, selection fillsel, patbuffer pbuf, gradline grad, int randomseed, int preview, displaymethod * mydisplay); 91 | 92 | /* Do the gradient */ 93 | int dogradient(keveditor * myeditor); 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /src/structures/svector.h: -------------------------------------------------------------------------------- 1 | /* svector.h -- string vectors 2 | * $Id: svector.h,v 1.1 2003/11/01 23:45:57 bitman Exp $ 3 | * Copyright (C) 2000 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SVECTOR_H 21 | #define __SVECTOR_H 1 22 | 23 | #include "libzzt2/strtools.h" 24 | 25 | /* basic structures for a string vector */ 26 | 27 | typedef struct stringnode { 28 | char *s; 29 | struct stringnode *next; 30 | struct stringnode *prev; 31 | 32 | } stringnode; 33 | 34 | typedef struct stringvector { 35 | stringnode *first; 36 | stringnode *last; 37 | stringnode *cur; 38 | 39 | } stringvector; 40 | 41 | /* Allways initialize a string vector to all NULLs before use */ 42 | void initstringvector(stringvector * v); 43 | 44 | /* The string() functions return 1 on error, 0 on success. 45 | * In each function, the pointer s is copied, not the string. 46 | * Insert functions do not change cur. 47 | * Delete functions move to the next node, unless there isn't one. 48 | */ 49 | 50 | /* pushstring - pushes string s to end of vector v */ 51 | int pushstring(stringvector * v, char *s); 52 | 53 | /* insertstring - inserts string s after cur in vector v */ 54 | int insertstring(stringvector * v, char *s); 55 | 56 | /* preinsertstring - inserts string s before cur in vector v */ 57 | int preinsertstring(stringvector * v, char *s); 58 | 59 | /* removestring - removes cur node and returns pointer to s */ 60 | char *removestring(stringvector * v); 61 | 62 | /* deletestring - free()s cur node & s */ 63 | int deletestring(stringvector * v); 64 | 65 | /* deletestringvector - deletes entire vector and every s */ 66 | int deletestringvector(stringvector * v); 67 | 68 | /* removestringvector - empties a stringvector without free()ing any s */ 69 | void removestringvector(stringvector * v); 70 | 71 | /* duplcatestringvector - allocate a copy of an svector */ 72 | stringvector duplicatestringvector(stringvector v, int minlen); 73 | 74 | /* stringvectorcat - concatinates two string vectors. BOTH vectors 75 | * thereafter share the same memory, only cur differs! */ 76 | stringvector * stringvectorcat(stringvector * v1, stringvector * v2); 77 | 78 | /* svmovetofirst() - move to first element */ 79 | void svmovetofirst(stringvector* v); 80 | 81 | /* svmoveby() - move by a number of steps, negative for backward */ 82 | int svmoveby(stringvector* v, int delta); 83 | 84 | /* svgetposoiton() - count how far cur is from first */ 85 | int svgetposition(stringvector* v); 86 | 87 | /* inssortstringvector() - insertion sort vector using strcmp()-like funct */ 88 | void inssortstringvector(stringvector* v, int (*compare)(const char* s1, const char* s2)); 89 | 90 | /***** Wordwrap **********************************/ 91 | 92 | /* wordwrap() - wrap text in sv */ 93 | int wordwrap(stringvector * sv, char *str, int inspos, int pos, int wrapwidth, int editwidth); 94 | 95 | /* Token manipulation (TODO: may be obsolete) */ 96 | 97 | /* advance token in source from pos, returning token length */ 98 | int tokenadvance(char *token, char *source, int *pos); 99 | 100 | /* grow token in source from pos, returning token length */ 101 | int tokengrow(char *token, char *source, int *pos); 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /docs/ktileinf.hlp: -------------------------------------------------------------------------------- 1 | @Tile Info 2 | $Tile Info 3 | 4 | !info;Tile Info 5 | !warn;Warning 6 | !kind;ZZT-OOP Kind 7 | !id;Id Number 8 | !color;Color 9 | !coord;Coordinate 10 | 11 | !stats;Stats 12 | !sindex;Stat Index 13 | !under;Tile Underneath 14 | !len;Code Length 15 | !inst;Current Code 16 | 17 | :info;Tile Info 18 | 19 | The Tile Info dialog displays advanced 20 | information about the tile under the 21 | cursor, some of which can be modified. 22 | Press CTRL-T to access the dialog. 23 | 24 | :warn;Warning 25 | 26 | Modifying these values may cause your 27 | world to become unstable when run in ZZT. 28 | Stability in KevEdit will not be 29 | affected. 30 | 31 | :kind;ZZT-OOP Kind 32 | 33 | The ZZT-OOP Kind is the name of the tile 34 | used in the ZZT-OOP commands #change 35 | and #become. A description in parenthesis 36 | is used for types which cannot be accessed 37 | in ZZT-OOP, such as blink wall rays. The 38 | board edge type has an empty ZZT-OOP kind 39 | because it is created by default if no 40 | kind is specified. 41 | 42 | Modifying this value will allow you to 43 | choose from the list of known types. 44 | Changing the type will not modify the 45 | objects stats in any way! This can be used 46 | to create walls with object code, for 47 | example, though the code will not execute. 48 | Removing and re-adding a tile's stats will 49 | correct this. 50 | 51 | :id;Id Number 52 | 53 | This is the number internally assigned to 54 | the tile which identifies its type. The 55 | number is given in both decimal and 56 | hexadecimal notation. 57 | 58 | Be careful when modifying this value. Any 59 | values above 53 are more than likely to 60 | cause a crash in ZZT. Only change this if 61 | you are testing the effects of these 62 | types. 63 | 64 | :color;Color 65 | 66 | The color of the tile is given in 67 | hexadecimal with a textual description. 68 | Note that ZZT-OOP uses only light colors 69 | and cannot change a tile's background 70 | color. 71 | 72 | Color is completely safe to modify. 73 | 74 | :coord;Coordinate 75 | 76 | This is the position of the tile on the 77 | board, starting at (1, 1) in the 78 | upper-left hand corner. 79 | 80 | :stats;Stats 81 | 82 | Only certain tiles have stats by default. 83 | However, any tile can have stats and any 84 | tile can have no stats. Creatures without 85 | stats are unable to move, but can still 86 | harm the player. Empty tiles with stats 87 | are often called Black Holes. Giving stats 88 | to other tiles that usually do not have 89 | them does not generally affect their 90 | behavior. Remember that each board can 91 | only have 150 (151) tiles with stats. 92 | 93 | :sindex;Stat Index 94 | 95 | The stats for each board are stored in a 96 | specific order. This index tells where an 97 | item's stats are in the list of stats. 98 | This value cannot currently be edited. 99 | 100 | :under;Tile Underneath 101 | 102 | A tile with stats can have either a fake 103 | wall, water, or empty underneath it. 104 | KevEdit automatically handles this by 105 | storing this information when you plot a 106 | tile with stats onto a fake wall, water, 107 | or empty. On the main editing screen, 108 | use DELETE to remove a tile with stats 109 | and restore the tile underneath. 110 | 111 | Changing this value should be safe. Try 112 | putting unusual types (such as walls) 113 | under a lion, tiger, or bear. 114 | 115 | :len;Code Length 116 | 117 | For objects and scrolls which have code or 118 | text, Code Length is the size of that 119 | text. If an object or scroll is empty then 120 | this will not be displayed. 121 | 122 | :inst;Current Code 123 | 124 | An object's current code is determined by 125 | the Program Instruction. This is the first 126 | line of code which will execute when the 127 | program begins executing. If the object is 128 | not executing, the message "(Program 129 | Execution #end-ed)" will be given. 130 | 131 | More on the Program Instruction can be 132 | found in: 133 | !-kstats:adv;Advanced Stats Tweaking 134 | 135 | -------------------------------------------------------------------------------- /src/display/display.h: -------------------------------------------------------------------------------- 1 | /* display.h -- Defines for modular display 2 | * $Id: display.h,v 1.2 2005/06/29 03:20:34 kvance Exp $ 3 | * Copyright (C) 2000 Kev Vance 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef DISPLAY_H 21 | #define DISPLAY_H 1 22 | 23 | #include 24 | 25 | #include "charset.h" 26 | #include "keys.h" 27 | #include "palette.h" 28 | #include "textblock.h" 29 | 30 | enum displaycontext { 31 | undefined = 0, 32 | board_editor, 33 | board_editor_text, 34 | }; 35 | 36 | typedef struct displaymethod { 37 | /* Next display method, if more than one is available */ 38 | struct displaymethod *next; 39 | 40 | /* Descriptive name of the display driver */ 41 | char *name; 42 | 43 | /* Version number of the display driver */ 44 | char *version; 45 | 46 | /* Initialize the display */ 47 | int (*init) (void); 48 | 49 | /* Close the display. The display may be initialized again later. */ 50 | void (*end) (void); 51 | 52 | /* Copy what's on the screen to the given text block */ 53 | void (*getblock) (textBlock * dest, int srcx, int srcy, int width, int height, 54 | int destx, int desty); 55 | 56 | /* Copy the text block's contents to the screen. 57 | This one could probably be refactored to use putch. Later, TODO. */ 58 | void (*putblock) (textBlock * src, int srcx, int srcy, int width, int height, 59 | int destx, int desty); 60 | 61 | /* Put ch[ar] of co[lour] at x,y */ 62 | void (*putch) (int x, int y, int ch, int co); 63 | 64 | /* Wait for an input event and return the key value */ 65 | int (*getch) (void); 66 | 67 | /* Wait for an input event and return the key value, with this context. */ 68 | int (*getch_with_context) (enum displaycontext context); 69 | 70 | /* Non-blocking getch() 71 | * Returns DKEY_NONE when there are no pending events */ 72 | int (*getkey) (void); 73 | 74 | /* Move the cursor to a given position */ 75 | void (*cursorgo) (int x, int y); 76 | 77 | /* Print a line of text */ 78 | void (*print) (int x, int y, int c, char *s); 79 | 80 | /* Set a descriptive string for the titlebar if available */ 81 | void (*titlebar) (char *); 82 | 83 | /* Check state of shift key 84 | * Returns true if shift is depressed, otherwise false */ 85 | int (*shift) (void); 86 | 87 | /* Put a character without necessarily updating the screen */ 88 | void (*putch_discrete) (int x, int y, int ch, int co); 89 | 90 | /* Print a line without necessarily updating the screen */ 91 | void (*print_discrete) (int x, int y, int c, char *s); 92 | 93 | /* Update a region of the screen after a discrete write */ 94 | void (*update) (int x, int y, int w, int h); 95 | 96 | /* Copy this character set to the display's character set. */ 97 | void (*set_charset)(const charset *charset); 98 | 99 | /* Copy this palette to the display's palette. */ 100 | void (*set_palette)(const palette *palette); 101 | 102 | /** Path of the last file drop event. */ 103 | char *dropped_file; 104 | 105 | } displaymethod; 106 | 107 | /* The main display method. Set by RegisterDisplays() */ 108 | extern displaymethod display; 109 | 110 | /* Find available displays */ 111 | extern void RegisterDisplays(); 112 | 113 | 114 | #endif /* DISPLAY_H */ 115 | -------------------------------------------------------------------------------- /src/zlaunch/zlmain.c: -------------------------------------------------------------------------------- 1 | /* zlmain.c - utility for launching zzt for zzt worlds in any directory 2 | * $Id: zlmain.c,v 1.2 2005/05/28 03:17:46 bitman Exp $ 3 | * Copyright (c) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "zlaunch.h" 25 | #include "files.h" 26 | 27 | #include 28 | #include 29 | #include /* For chdir() */ 30 | #include 31 | 32 | 33 | void 34 | launch(char* datapath, stringvector files, stringvector options, 35 | stringvector info) 36 | { 37 | zlaunchinfo zli = loadzlinfofromsvector(info); 38 | 39 | /* Configure */ 40 | zli.datadir = str_dup(datapath); 41 | zli.bindir = str_dup(datapath); 42 | /* Merge the lists. We are no longer responible for them. */ 43 | zli.paramlist = files; 44 | stringvectorcat(&(zli.actionstoperform), &options); 45 | 46 | /* Try it */ 47 | zlaunchact(&zli); 48 | 49 | /* Cleanup */ 50 | zlaunchcleanup(&zli); 51 | deletezlinfo(&zli); 52 | } 53 | 54 | 55 | int 56 | main(int argc, char* argv[]) 57 | { 58 | char* datapath = NULL; 59 | char* worldpath = NULL; 60 | stringvector files, options; 61 | stringvector info; 62 | int i; 63 | 64 | initstringvector(&files); 65 | initstringvector(&options); 66 | 67 | for (i = 1; i < argc; i++) { 68 | if (argv[i][0] != '\0') { 69 | if (argv[i][0] == '-') { 70 | /* Options go into one list */ 71 | int pos = 1; 72 | if (argv[i][pos] == '-') pos++; 73 | pushstring(&options, str_dup(argv[i] + pos)); 74 | } else if (worldpath == NULL) { 75 | /* The path of the first non-option is extracted */ 76 | char* worldfile; 77 | worldpath = (char*) malloc(sizeof(char) * (strlen(argv[i]) + 1)); 78 | worldfile = (char*) malloc(sizeof(char) * (strlen(argv[i]) + 1)); 79 | pathof(worldpath, argv[i], strlen(argv[i])); 80 | fileof(worldfile, argv[i], strlen(argv[i])); 81 | pushstring(&files, worldfile); 82 | } else { 83 | /* All other non-options are added as files verbatum */ 84 | pushstring(&files, str_dup(argv[i])); 85 | } 86 | } 87 | } 88 | 89 | if (worldpath == NULL) { 90 | printf("zlaunch " zlaunchVERSION "\n" 91 | "Copyright (c) 2001 Ryan Phillips \n" 92 | "This program may be freely redistributed under the terms of the " 93 | "GNU GPL\n\n" 94 | 95 | "Usage: zlaunch path\\world.zzt\n" 96 | " zlaunch cleanly runs zzt for the given world, after switching\n" 97 | " to the directory of that world and copying zzt.dat there.\n\n" 98 | 99 | "zlaunch MUST be in the same directory as zzt!\n"); 100 | 101 | return 1; 102 | } 103 | 104 | /* Switch into the directory of the given zzt world */ 105 | if (chdir(worldpath)) { 106 | /* Failed to change directory! */ 107 | perror(worldpath); 108 | 109 | deletestringvector(&files); 110 | deletestringvector(&options); 111 | free(worldpath); 112 | return 1; 113 | } 114 | 115 | datapath = locateself(argv[0]); 116 | 117 | info = loadinfo(datapath, files.first->s); 118 | 119 | launch(datapath, files, options, info); 120 | 121 | deletestringvector(&info); 122 | free(worldpath); 123 | free(datapath); 124 | return 0; 125 | } 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/creature.hlp: -------------------------------------------------------------------------------- 1 | $Creatures 2 | :top; 3 | From the world editor, press F2 to 4 | bring up the menu of creatures. A wide 5 | variety are available, each with dif- 6 | ferent characteristics. 7 | 8 | !bears;Bears 9 | !centis;Centipedes 10 | !lions;Lions 11 | !tigers;Tigers 12 | !objects;Objects 13 | !pushers;Pushers 14 | !ruffians;Ruffians 15 | !shark;Sharks 16 | !slime;Slime 17 | !guns;Spinning guns 18 | 19 | Attributes: 20 | 21 | Many types of creatures have 22 | attributes, such as intelligence, 23 | sensitivity, and direction, that can be 24 | customized. These attributes affect 25 | different aspects of a creature's 26 | movement. 27 | 28 | Some creatures have an Intelligence 29 | setting. This affects how well the 30 | creature will find the player. One with a 31 | low intelligence moves largely at random, 32 | while an intelligent creature actively 33 | follows the player. 34 | 35 | Note: 36 | 37 | There is not space to describe each 38 | creature in much detail. You must learn 39 | by experimenting and watching the 40 | behavior of all of the creatures. 41 | 42 | :bears;Bears: 43 | 44 | Bears are attracted to the player 45 | when the two are close together. Their 46 | goal is to attack the player. 47 | 48 | When a bear comes into contact with a 49 | Breakable Wall, both disappear. 50 | 51 | :ruffians;Ruffians: 52 | 53 | Ruffians move sporadically, 54 | alternately moving and resting. They will 55 | try to catch the player. 56 | 57 | :objects;Objects: 58 | 59 | Objects are a versatile kind of 60 | creature and can be customized using the 61 | ZZT-OOP programming language. 62 | 63 | When placing an Object on the board, 64 | you may pick any character to represent 65 | it. Then, you enter commands to control 66 | the creature during game play. 67 | 68 | If you want to modify the program of 69 | an already-existing Object, position the 70 | cursor above it and press [ENTER]. 71 | 72 | !-lang;Programming instructions. 73 | 74 | :shark;Sharks: 75 | 76 | Sharks cannot move on land; they can 77 | only move in water. Be careful when 78 | walking around shark infested waters, 79 | because they can very quickly jump out and 80 | harm you. 81 | 82 | :slime;Slime: 83 | 84 | A single Slime will spread out by 85 | replicating itself until an entire 86 | region is filled. Slime only oozes 87 | through empty space, so it is blocked by 88 | walls. 89 | 90 | As slime spreads out, it leaves a 91 | trail of breakable walls. The player can 92 | stop the slime by touching it; the only 93 | threat it poses is in trapping the player. 94 | 95 | :guns;Spinning guns: 96 | 97 | Spinning guns rotate and shoot in 98 | random directions. By placing walls on 99 | various sides of a gun, it can be aimed in 100 | any desired direction. 101 | 102 | :pushers;Pushers: 103 | 104 | Pushers move slowly in a given 105 | direction, pushing Boulders and Sliders 106 | ahead of them. They can move the player, 107 | but do not pose a direct threat. 108 | 109 | :lions;Lions: 110 | 111 | Lions move quickly about the board, 112 | attracted to the player according to their 113 | intelligence. Lions can not shoot. 114 | 115 | :tigers;Tigers: 116 | 117 | Tigers move toward the player and 118 | shoot bullets. 119 | 120 | These bullets are harmful only to 121 | the player. In fact, no creatures will 122 | directly harm other creatures. 123 | 124 | :centis;Centipedes: 125 | 126 | These are the most interesting type 127 | of creature, because they can contain 128 | many different parts linked together. 129 | 130 | A Centipede consists of a Head and 131 | several body Segments. The Head decides 132 | where to move, and the body follows 133 | behind. 134 | 135 | To place a Centipede on the board, 136 | first place the Head, then put Body 137 | segments along side, in a line. All parts 138 | must be in contact. 139 | 140 | When a Centipede is shot, it will 141 | break up into two smaller centipedes, 142 | which move independently. 143 | 144 | -------------------------------------------------------------------------------- /src/help/hypertxt.c: -------------------------------------------------------------------------------- 1 | /* hypertxt.c -- hypertext link system 2 | * $Id: hypertxt.c,v 1.2 2005/05/28 03:17:45 bitman Exp $ 3 | * Copyright (C) 2001 Ryan Phillips 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include "hypertxt.h" 25 | #include "structures/svector.h" 26 | 27 | #include 28 | #include 29 | 30 | /* Returns true if sv.cur contains a line in the form of "!message;text" 31 | * In the case of message == "", returns false. 32 | * Pre-condition: sv, sv.cur, and sv.cur->s != NULL */ 33 | int ishypermessage(stringvector sv) 34 | { 35 | char* sptr = sv.cur->s; // Only for looking, not for touching 36 | if (sptr[0] != '!') // Must start with '!' 37 | return 0; 38 | 39 | // Advance token to ';' or end of string 40 | do { 41 | sptr++; 42 | } while (*sptr != '\0' && *sptr != ';'); 43 | if (*sptr == '\0') // Reach the end w/o finding a ';' 44 | return 0; 45 | 46 | // When all other possibilities are ruled out... 47 | return 1; 48 | } 49 | 50 | /* Retrieve message from sv->cur if hyperline into malloc()ed string */ 51 | char* gethypermessage(stringvector sv) 52 | { 53 | if (ishypermessage(sv)) { 54 | int end = 1; /* Start after the '!' */ 55 | 56 | while (sv.cur->s[end] != 0 && sv.cur->s[end] != ';') 57 | end++; 58 | 59 | /* Copy end chars, starting at position 1 */ 60 | return str_dupmax(sv.cur->s + 1, end - 1); 61 | } else { 62 | return str_dup(""); 63 | } 64 | } 65 | 66 | /* Locates :msg in sv and points sv->cur there. Returns true on success. 67 | * Pre-condition: no NULLs */ 68 | int findhypermessage(char* msg, stringvector* sv) 69 | { 70 | stringnode* curNode = sv->first; 71 | 72 | /* Scour sv for any sign of :msg */ 73 | while (curNode != NULL) { 74 | if (curNode->s[0] == ':') { 75 | /* Could this be it? */ 76 | if (str_equ(curNode->s + 1, msg, STREQU_UNCASE | STREQU_RFRONT)) { 77 | if (curNode->s[strlen(msg) + 1] == '\0' || 78 | curNode->s[strlen(msg) + 1] == ';') { 79 | /* This is it! */ 80 | sv->cur = curNode; 81 | return 1; 82 | } 83 | } 84 | } 85 | 86 | curNode = curNode->next; 87 | } 88 | 89 | /* Found nothing, report falure */ 90 | return 0; 91 | } 92 | 93 | 94 | /* Determines whether a message refers to a section as well */ 95 | int ishypersection(char* msg) 96 | { 97 | if (msg[0] == '-') 98 | return 1; 99 | else 100 | return 0; 101 | } 102 | 103 | /* Retrieve the section component of msg into malloc()ed string */ 104 | char* gethypersection(char* msg) 105 | { 106 | if (ishypersection(msg)) { 107 | int end = 1; /* Start after the '-' */ 108 | 109 | while (msg[end] != 0 && msg[end] != ':') 110 | end++; 111 | 112 | /* Copy end chars, starting at position 1 */ 113 | return str_dupmax(msg + 1, end - 1); 114 | } else { 115 | return str_dup(""); 116 | } 117 | } 118 | 119 | /* Retrieve the msg component of msg into malloc()ed string */ 120 | char* gethypersectionmessage(char* msg) 121 | { 122 | char * colon; 123 | 124 | /* Advance to the colon if it exists */ 125 | colon = strchr(msg, ':'); 126 | 127 | if (colon != NULL) { 128 | /* Copy everything after the colon */ 129 | return str_dup(colon + 1); 130 | } else { 131 | /* No colon: return empty string */ 132 | return str_dup(""); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/themes/rusty/panel_f1.c: -------------------------------------------------------------------------------- 1 | /* Image Saved In ACiDDRAW v1.1 */ 2 | /* $Id: panel_f1.c,v 1.1 2003/11/01 23:45:57 bitman Exp $ */ 3 | 4 | #define PANEL_F1_WIDTH 20 5 | #define PANEL_F1_DEPTH 17 6 | #define PANEL_F1_LENGTH 680 7 | unsigned char PANEL_F1[] = 8 | { 9 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 'I', 0x1E, 't', 0x1E, 10 | 'e', 0x1E, 'm', 0x1E, 's', 0x1E, ':', 0x1E, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 11 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 12 | ' ', 0x60, 'Z', 0x60, ' ', 0x60, ' ', 0x1F, 'P', 0x1F, 'l', 0x1F, 'a', 0x1F, 13 | 'y', 0x1F, 'e', 0x1F, 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 14 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 15 | 'A', 0x40, ' ', 0x40, ' ', 0x1F, 'A', 0x1F, 'm', 0x1F, 'm', 0x1F, 'o', 0x1F, 16 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 17 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 'T', 0x60, 18 | ' ', 0x60, ' ', 0x1F, 'T', 0x1F, 'o', 0x1F, 'r', 0x1F, 'c', 0x1F, 'h', 0x1F, 19 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 20 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 'G', 0x40, ' ', 0x40, 21 | ' ', 0x1F, 'G', 0x1F, 'e', 0x1F, 'm', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 22 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 23 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 'K', 0x60, ' ', 0x60, ' ', 0x1F, 24 | 'K', 0x1F, 'e', 0x1F, 'y', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 25 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 26 | ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 'D', 0x40, ' ', 0x40, ' ', 0x1F, 'D', 0x1F, 27 | 'o', 0x1F, 'o', 0x1F, 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 28 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 29 | ' ', 0x1F, ' ', 0x60, 'S', 0x60, ' ', 0x60, ' ', 0x1F, 'S', 0x1F, 'c', 0x1F, 30 | 'r', 0x1F, 'o', 0x1F, 'l', 0x1F, 'l', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 31 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 32 | ' ', 0x40, 'P', 0x40, ' ', 0x40, ' ', 0x1F, 'P', 0x1F, 'a', 0x1F, 's', 0x1F, 33 | 's', 0x1F, 'a', 0x1F, 'g', 0x1F, 'e', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 34 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 35 | 'U', 0x60, ' ', 0x60, ' ', 0x1F, 'D', 0x1F, 'u', 0x1F, 'p', 0x1F, 'l', 0x1F, 36 | 'i', 0x1F, 'c', 0x1F, 'a', 0x1F, 't', 0x1F, 'o', 0x1F, 'r', 0x1F, ' ', 0x1F, 37 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 'B', 0x40, 38 | ' ', 0x40, ' ', 0x1F, 'B', 0x1F, 'o', 0x1F, 'm', 0x1F, 'b', 0x1F, ' ', 0x1F, 39 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 40 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 'E', 0x60, ' ', 0x60, 41 | ' ', 0x1F, 'E', 0x1F, 'n', 0x1F, 'e', 0x1F, 'r', 0x1F, 'g', 0x1F, 'i', 0x1F, 42 | 'z', 0x1F, 'e', 0x1F, 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 43 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 44 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 45 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 46 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 'C', 0x1E, 47 | 'o', 0x1E, 'n', 0x1E, 'v', 0x1E, 'e', 0x1E, 'y', 0x1E, 'o', 0x1E, 'r', 0x1E, 48 | 's', 0x1E, ':', 0x1E, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 49 | ' ', 0x1F, ' ', 0x40, '1', 0x40, ' ', 0x40, ' ', 0x1F, 'C', 0x1F, 'l', 0x1F, 50 | 'o', 0x1F, 'c', 0x1F, 'k', 0x1F, 'w', 0x1F, 'i', 0x1F, 's', 0x1F, 'e', 0x1F, 51 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 52 | ' ', 0x60, '2', 0x60, ' ', 0x60, ' ', 0x1F, 'C', 0x1F, 'o', 0x1F, 'u', 0x1F, 53 | 'n', 0x1F, 't', 0x1F, 'e', 0x1F, 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 54 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 55 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 56 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 57 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F}; 58 | -------------------------------------------------------------------------------- /src/themes/rusty/panel_f2.c: -------------------------------------------------------------------------------- 1 | /* Image Saved In ACiDDRAW v1.1 */ 2 | /* $Id: panel_f2.c,v 1.1 2003/11/01 23:45:57 bitman Exp $ */ 3 | 4 | #define PANEL_F2_WIDTH 20 5 | #define PANEL_F2_DEPTH 17 6 | #define PANEL_F2_LENGTH 680 7 | unsigned char PANEL_F2[] = 8 | { 9 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 'C', 0x1E, 'r', 0x1E, 10 | 'e', 0x1E, 'a', 0x1E, 't', 0x1E, 'u', 0x1E, 'r', 0x1E, 'e', 0x1E, 's', 0x1E, 11 | ':', 0x1E, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 12 | ' ', 0x60, 'B', 0x60, ' ', 0x60, ' ', 0x1F, 'B', 0x1F, 'e', 0x1F, 'a', 0x1F, 13 | 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 14 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 15 | 'R', 0x40, ' ', 0x40, ' ', 0x1F, 'R', 0x1F, 'u', 0x1F, 'f', 0x1F, 'f', 0x1F, 16 | 'i', 0x1F, 'a', 0x1F, 'n', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 17 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 'O', 0x60, 18 | ' ', 0x60, ' ', 0x1F, 'O', 0x1F, 'b', 0x1F, 'j', 0x1F, 'e', 0x1F, 'c', 0x1F, 19 | 't', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 20 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 'V', 0x40, ' ', 0x40, 21 | ' ', 0x1F, 'S', 0x1F, 'l', 0x1F, 'i', 0x1F, 'm', 0x1F, 'e', 0x1F, ' ', 0x1F, 22 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 23 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 'Y', 0x60, ' ', 0x60, ' ', 0x1F, 24 | 'S', 0x1F, 'h', 0x1F, 'a', 0x1F, 'r', 0x1F, 'k', 0x1F, ' ', 0x1F, ' ', 0x1F, 25 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 26 | ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 'G', 0x40, ' ', 0x40, ' ', 0x1F, 'S', 0x1F, 27 | 'p', 0x1F, 'i', 0x1F, 'n', 0x1F, 'n', 0x1F, 'i', 0x1F, 'n', 0x1F, 'g', 0x1F, 28 | ' ', 0x1F, 'g', 0x1F, 'u', 0x1F, 'n', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 29 | ' ', 0x1F, ' ', 0x60, 'P', 0x60, ' ', 0x60, ' ', 0x1F, 'P', 0x1F, 'u', 0x1F, 30 | 's', 0x1F, 'h', 0x1F, 'e', 0x1F, 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 31 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 32 | ' ', 0x40, 'L', 0x40, ' ', 0x40, ' ', 0x1F, 'L', 0x1F, 'i', 0x1F, 'o', 0x1F, 33 | 'n', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 34 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 35 | 'T', 0x60, ' ', 0x60, ' ', 0x1F, 'T', 0x1F, 'i', 0x1F, 'g', 0x1F, 'e', 0x1F, 36 | 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 37 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 38 | ' ', 0x1F, ' ', 0x1F, 'P', 0x1E, 'r', 0x1E, 'o', 0x1E, 'j', 0x1E, 'e', 0x1E, 39 | 'c', 0x1E, 't', 0x1E, 'i', 0x1E, 'l', 0x1E, 'e', 0x1E, 's', 0x1E, ':', 0x1E, 40 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x40, 'U', 0x40, ' ', 0x40, 41 | ' ', 0x1F, 'B', 0x1F, 'u', 0x1F, 'l', 0x1F, 'l', 0x1F, 'e', 0x1F, 't', 0x1F, 42 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 43 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x60, 'A', 0x60, ' ', 0x60, ' ', 0x1F, 44 | 'S', 0x1F, 't', 0x1F, 'a', 0x1F, 'r', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 45 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 46 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 'C', 0x1E, 47 | 'e', 0x1E, 'n', 0x1E, 't', 0x1E, 'i', 0x1E, 'p', 0x1E, 'e', 0x1E, 'd', 0x1E, 48 | 'e', 0x1E, 's', 0x1E, ':', 0x1E, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 49 | ' ', 0x1F, ' ', 0x40, 'H', 0x40, ' ', 0x40, ' ', 0x1F, 'H', 0x1F, 'e', 0x1F, 50 | 'a', 0x1F, 'd', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 51 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 52 | ' ', 0x60, 'S', 0x60, ' ', 0x60, ' ', 0x1F, 'S', 0x1F, 'e', 0x1F, 'g', 0x1F, 53 | 'm', 0x1F, 'e', 0x1F, 'n', 0x1F, 't', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 54 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 55 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 56 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, 57 | ' ', 0x1F, ' ', 0x1F, ' ', 0x1F, ' ', 0x1F}; 58 | --------------------------------------------------------------------------------