Skip to content
Browse files

MegaZeux 2.80h release.

  • Loading branch information...
1 parent 98c1ee0 commit 1b766c6eae29343c1ce4bd356b2fb5b75c302057 @ajs1984 committed Aug 11, 2008
Showing with 5,152 additions and 4,123 deletions.
  1. +10 −28 Makefile
  2. +20 −12 Makefile.in
  3. +21 −4 Makefile.platform
  4. +6 −0 arch/Makefile.dist
  5. +20 −4 arch/Makefile.linux
  6. +5 −4 arch/Makefile.macos
  7. +4 −4 arch/Makefile.win32
  8. +15 −0 config.sh
  9. +10 −2 config.txt
  10. +0 −16 contrib/README.1ST
  11. 0 contrib/gdm2s3m/build.bat
  12. +15 −23 contrib/gdm2s3m/src/Makefile
  13. +21 −38 contrib/libmodplug/src/Makefile
  14. +117 −0 docs/changelog.txt
  15. BIN mzx_edit.chr
  16. +17 −4 package.sh
  17. +10 −3 src/Makefile
  18. +25 −7 src/audio.cpp
  19. +5 −3 src/audio.h
  20. +152 −217 src/block.cpp
  21. +1 −3 src/block.h
  22. +17 −13 src/board.cpp
  23. +2 −3 src/board.h
  24. +1,327 −590 src/char_ed.cpp
  25. +3 −3 src/char_ed.h
  26. +1 −3 src/charset.h
  27. +2 −0 src/config.h
  28. +34 −13 src/configure.cpp
  29. +7 −4 src/configure.h
  30. +1 −3 src/const.h
  31. +42 −7 src/counter.cpp
  32. +3 −3 src/counter.h
  33. +0 −40 src/counter_first_letter.h
  34. +6 −7 src/data.cpp
  35. +3 −5 src/data.h
  36. +3 −10 src/decrypt.cpp
  37. +2 −4 src/decrypt.h
  38. +2 −3 src/delay.cpp
  39. +2 −3 src/delay.h
  40. +388 −286 src/edit.cpp
  41. +1 −3 src/edit.h
  42. +424 −614 src/edit_di.cpp
  43. +4 −3 src/edit_di.h
  44. +1 −3 src/error.cpp
  45. +1 −3 src/error.h
  46. +86 −34 src/event.cpp
  47. +12 −4 src/event.h
  48. +74 −77 src/expr.cpp
  49. +24 −6 src/expr.h
  50. +4 −3 src/fill.cpp
  51. +1 −3 src/fill.h
  52. +2 −4 src/fix.cpp
  53. +2 −3 src/fsafeopen.cpp
  54. +1 −2 src/fsafeopen.h
  55. +189 −318 src/game.cpp
  56. +4 −3 src/game.h
  57. +3 −5 src/game2.cpp
  58. +1 −3 src/game2.h
  59. +1 −3 src/getpw.cpp
  60. +388 −164 src/graphics.cpp
  61. +47 −16 src/graphics.h
  62. +1 −3 src/helpsys.cpp
  63. +1 −3 src/helpsys.h
  64. +1 −3 src/hexchar.cpp
  65. +1 −3 src/hexchar.h
  66. +4 −4 src/idarray.cpp
  67. +1 −3 src/idarray.h
  68. +3 −4 src/idput.cpp
  69. +1 −3 src/idput.h
  70. +90 −24 src/intake.cpp
  71. +6 −7 src/intake.h
  72. +2 −4 src/killgbl.cpp
  73. +5 −6 src/macro.cpp
  74. +3 −5 src/macro.h
  75. +17 −31 src/main.cpp
  76. +25 −26 src/mzm.cpp
  77. +2 −4 src/mzm.h
  78. +2 −4 src/pal_ed.cpp
  79. +1 −3 src/pal_ed.h
  80. +671 −638 src/param.cpp
  81. +1 −3 src/param.h
  82. +0 −138 src/password.cpp
  83. +0 −41 src/password.h
  84. +164 −162 src/rasm.cpp
  85. +27 −27 src/rasm.h
  86. +470 −284 src/robo_ed.cpp
  87. +3 −4 src/robo_ed.h
  88. +49 −30 src/robot.cpp
  89. +12 −10 src/robot.h
Sorry, we could not display the entire diff because it was too big.
View
38 Makefile
@@ -1,37 +1,19 @@
#
# Slave MegaZeux makefile
#
-include Makefile.platform
-include Makefile.in
-
-SUBDIRS = contrib/gdm2s3m/src contrib/libmodplug/src src
-all: subdir
+include Makefile.platform
subdir:
- list='$(SUBDIRS)'; \
- for subdir in $$list; do \
- pwd=`pwd`; \
- cd $$subdir && make && cd $$pwd; \
- done;
+ cd contrib/libmodplug/src && make && cd ../../..
+ cd contrib/gdm2s3m/src && make && cd ../../..
+ cd src && make && cd ..
clean:
- list='$(SUBDIRS)'; \
- for subdir in $$list; do \
- pwd=`pwd`; \
- cd $$subdir && make clean && cd $$pwd; \
- done;
+ cd contrib/libmodplug/src && make clean && cd ../../..
+ cd contrib/gdm2s3m/src && make clean && cd ../../..
+ cd src && make clean && cd ..
-install:
- mkdir -p ${PREFIX}/share/megazeux && \
- chown root:root ${PREFIX}/share/megazeux && \
- chmod 0755 ${PREFIX}/share/megazeux && \
- install -o root -m 0644 mzx_default.chr ${PREFIX}/share/megazeux && \
- install -o root -m 0644 mzx_blank.chr ${PREFIX}/share/megazeux && \
- install -o root -m 0644 mzx_smzx.chr ${PREFIX}/share/megazeux && \
- install -o root -m 0644 mzx_ascii.chr ${PREFIX}/share/megazeux && \
- install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
- install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
- install -o root -m 0644 config.txt /etc/megazeux-config && \
- install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
- ln -sf ${TARGET} ${PREFIX}/bin/megazeux
+distclean: clean
+ rm -f src/config.h
+ cp -f arch/Makefile.dist Makefile.platform
View
32 Makefile.in
@@ -4,24 +4,32 @@
CC = gcc
CXX = g++
+# path to gdm2s3m sources
+GDM2S3M = contrib/gdm2s3m/src
+MODPLUG = contrib/libmodplug/src
+
# default target name
-TARGET = mzx280g
-VERSION = 2.80g
+TARGET = mzx280h
+VERSION = 2.80h
-ifdef DEBUG
-# debug C++ flags
-CXXFLAGS = -g -funsigned-char -Wall -DMZX_VERSION=\"${VERSION}\" -DDEBUG
+ifneq ("${DATE}", "0")
+VERSTRING = ${VERSION}\ \(`date +%Y%m%d`\)
else
-# optimised C++ flags
-CXXFLAGS = -O2 -funsigned-char -ffast-math -Wall -DMZX_VERSION=\"${VERSION}\"
+VERSTRING = ${VERSION}
endif
-CXXFLAGS += -I../contrib/libmodplug/src -I../contrib/libmodplug/src/include
-CXXFLAGS += -I../contrib/gdm2s3m/src
-LIBS += ../contrib/libmodplug/src/libmodplug.a
-LIBS += ../contrib/gdm2s3m/src/libgdm2s3m.a
+ifdef DEBUG
+CFLAGS = -g -Wall -DDEBUG
+CXXFLAGS = -g -Wall -DDEBUG
+else
+CFLAGS += -O2 -Wall
+CXXFLAGS += -O2 -Wall
+endif
-.SUFFIXES: .cpp
+.SUFFIXES: .cpp .c
%.o: %.cpp
${CXX} ${CXXFLAGS} ${INCLUDES} -c $<
+
+%.o: %.c
+ ${CC} ${CFLAGS} ${INCLUDES} -c $<
View
25 Makefile.platform
@@ -2,14 +2,31 @@
# linux makefile generics
#
+all: subdir
+
# location of strip (must be defined)
STRIP = strip --strip-unneeded
-# standard linker includes
-INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL
-
# standard libraries
-LIBS = -L${PREFIX}/lib -lSDL -lpthread
+LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
+ -L${PREFIX}/lib -lSDL -lpthread -lX11
+
+# linux os specific install target
+install:
+ mkdir -p ${PREFIX}/share/megazeux && \
+ chown root:root ${PREFIX}/share/megazeux && \
+ chmod 0755 ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_default.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_blank.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_smzx.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_ascii.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_edit.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 config.txt /etc/megazeux-config && \
+ install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
+ ln -sf ${TARGET} ${PREFIX}/bin/megazeux
# install prefix
PREFIX=/usr
+TARGET=mzx280h
View
6 arch/Makefile.dist
@@ -0,0 +1,6 @@
+# placebo makefile
+
+all:
+ @echo "Please run config.sh before make!"
+ @echo "usage: ./config.sh <linux|win32|macos> <prefix>"
+ @echo " e.g.: ./config.sh win32 /usr"
View
24 arch/Makefile.linux
@@ -2,11 +2,27 @@
# linux makefile generics
#
+all: subdir
+
# location of strip (must be defined)
STRIP = strip --strip-unneeded
-# standard linker includes
-INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL
-
# standard libraries
-LIBS = -L${PREFIX}/lib -lSDL -lpthread
+LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
+ -L${PREFIX}/lib -lSDL -lpthread -lX11
+
+# linux os specific install target
+install:
+ mkdir -p ${PREFIX}/share/megazeux && \
+ chown root:root ${PREFIX}/share/megazeux && \
+ chmod 0755 ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_default.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_blank.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_smzx.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_ascii.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_edit.chr ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
+ install -o root -m 0644 config.txt /etc/megazeux-config && \
+ install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
+ ln -sf ${TARGET} ${PREFIX}/bin/megazeux
View
9 arch/Makefile.macos
@@ -2,11 +2,12 @@
# macos makefile generics
#
+all: subdir
+
# location of strip (must be defined)
STRIP = strip
-# standard linker includes
-INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL
-
# standard libraries
-LIBS = -L${PREFIX}/lib -lSDLmain -lSDL -lpthread -framework Cocoa
+LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
+ -L${PREFIX}/lib -lSDLmain -lSDL -lpthread \
+ -framework Cocoa
View
8 arch/Makefile.win32
@@ -2,17 +2,17 @@
# win32 makefile generics
#
+all: subdir
+
# windows requires a binary extension
BINEXT = .exe
# location of strip (must be defined)
STRIP = strip --strip-unneeded
-# standard linker includes
-INCLUDES = -I${PREFIX}/include -I${PREFIX}/include/SDL
-
# standard libraries
-LIBS = -L${PREFIX}/lib -lmingw32 -lSDLmain -lSDL
+LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
+ -L/usr/lib -lmingw32 -lSDLmain -lSDL
# debug does something different
ifdef DEBUG
View
15 config.sh
@@ -36,6 +36,7 @@ if [ "$ARCH" = "win32" -o "$ARCH" = "macos" ]; then
echo "#define MZX_BLANK_CHR \"mzx_blank.chr\"" >> src/config.h
echo "#define MZX_SMZX_CHR \"mzx_smzx.chr\"" >> src/config.h
echo "#define MZX_ASCII_CHR \"mzx_ascii.chr\"" >> src/config.h
+ echo "#define MZX_EDIT_CHR \"mzx_edit.chr\"" >> src/config.h
echo "#define SMZX_PAL \"smzx.pal\"" >> src/config.h
echo "#define MZX_HELP_FIL \"mzx_help.fil\"" >> src/config.h
echo "#define CONFIG_TXT \"config.txt\"" >> src/config.h
@@ -46,9 +47,23 @@ if [ "$ARCH" = "linux" ]; then
echo "#define MZX_BLANK_CHR \"$PREFIX/share/megazeux/mzx_blank.chr\"" >> src/config.h
echo "#define MZX_SMZX_CHR \"$PREFIX/share/megazeux/mzx_smzx.chr\"" >> src/config.h
echo "#define MZX_ASCII_CHR \"$PREFIX/share/megazeux/mzx_ascii.chr\"" >> src/config.h
+ echo "#define MZX_EDIT_CHR \"$PREFIX/share/megazeux/mzx_edit.chr\"" >> src/config.h
echo "#define SMZX_PAL \"$PREFIX/share/megazeux/smzx.pal\"" >> src/config.h
echo "#define MZX_HELP_FIL \"$PREFIX/share/megazeux/mzx_help.fil\"" >> src/config.h
echo "#define CONFIG_TXT \"/etc/megazeux-config\"" >> src/config.h
+
+ echo "TARGET=`grep TARGET Makefile.in | cut -d ' ' -f 6`" \
+ >> Makefile.platform
+fi
+
+if [ "$ARCH" != "win32" ]; then
+ # try to run X
+ X -version >/dev/null 2>&1
+
+ # X queried successfully
+ if [ "$?" = "0" ]; then
+ echo "#define CONFIG_X11" >> src/config.h
+ fi
fi
echo "All done!"
View
12 config.txt
@@ -83,6 +83,9 @@
# Volume samples play at
#sample_volume = 8
+# Volume PC speaker SFX play at
+#pc_speaker_volume = 8
+
### Game options ###
@@ -199,7 +202,7 @@
# How many backups to be made. Set to zero to disable backups.
-#backup_count = 0
+#backup_count = 3
# How often (in seconds) backups should be made
@@ -252,4 +255,9 @@
#pause_on_unfocus = 0
-include Cmacro.cnf
+# Set to 0 if you want input boxes and strings in the robot editor
+# to use the game set for characters 32-127, as opposed to the protected
+# GUI set.
+
+#mask_midchars = 1
+
View
16 contrib/README.1ST
@@ -1,16 +0,0 @@
-This subdirectory wasn't actually present in the old tarballs,
-but you need it to compile MegaZeux. The gdm2s3m library is too
-obscure to find elsewhere on the internet, so we package it locally.
-
-The version of libmodplug from 2.80h is included because this was the
-first really portable, patched version. However in the interests of
-good history, we won't patch it forwards to 0.8.4, and we stick with
-version 0.7.2. This may have some bugs 0.8.4 didn't, but it should
-be the most "realistic" interpretation of these old source packages.
-
-It's also worth noticing that big endian platforms weren't supported
-in these old MegaZeux versions, so there will be bugs there and the
-same fix applied to libmodplug later isn't present in versions with
-this "hacked" directory.
-
---ajs
View
0 contrib/gdm2s3m/build.bat 100644 → 100755
File mode changed.
View
38 contrib/gdm2s3m/src/Makefile
@@ -1,31 +1,23 @@
-##
-# gdm2s3m Makefile fragment
-##
+#
+# src/ makefile
+#
-.PHONY: all clean
+include ../../../Makefile.in
+include ../../../Makefile.platform
-.SUFFIXES: .c
+# must be build with c99
+CFLAGS += -std=c99
-CFLAGS := -Wall -std=c99
-o := o
+#
+# objects to build
+#
-gdm2s3m_base = .
-gdm2s3m_cflags := -W -Wmissing-format-attribute -Wpointer-arith -Wcast-align
-gdm2s3m_cflags += -Wwrite-strings -pedantic -I${gdm2s3m_base}
-gdm2s3m = ${gdm2s3m_base}/libgdm2s3m.a
+objs = error.o gdm.o s3m.o utility.o gdm2s3m.o
-gdm2s3m_objs = \
- ${gdm2s3m_base}/error.${o} ${gdm2s3m_base}/gdm.${o} \
- ${gdm2s3m_base}/s3m.${o} ${gdm2s3m_base}/utility.${o} \
- ${gdm2s3m_base}/gdm2s3m.${o}
+subdir: libs
-${gdm2s3m_base}/%.${o}: ${gdm2s3m_base}/%.c
- ${CC} ${CFLAGS} ${gdm2s3m_cflags} -c $< -o $@
-
-all: ${gdm2s3m}
-
-${gdm2s3m}: ${gdm2s3m_objs}
- ar crus ${gdm2s3m} ${gdm2s3m_objs}
+libs: ${objs}
+ ar crus libgdm2s3m.a ${objs}
clean:
- rm -f ${gdm2s3m} ${gdm2s3m_objs}
+ rm -f ${objs} libgdm2s3m.a
View
59 contrib/libmodplug/src/Makefile
@@ -1,46 +1,29 @@
-##
-# libmodplug Makefile fragment
-##
+#
+# src/ makefile
+#
-.PHONY: all clean
+include ../../../Makefile.in
+include ../../../Makefile.platform
-.SUFFIXES: .cpp
+# need to include local headers
+INCLUDES += -Ilibmodplug -I.
-CXXFLAGS := -Wall
-o := o
+#
+# objects to build
+#
-libmodplug_base = .
+objs = fastmix.o load_669.o load_amf.o load_ams.o load_dbm.o \
+ load_dmf.o load_dsm.o load_far.o load_it.o load_j2b.o \
+ load_mdl.o load_med.o load_mod.o load_mt2.o load_mtm.o \
+ load_okt.o load_psm.o load_ptm.o load_s3m.o load_stm.o \
+ load_ult.o load_umx.o load_wav.o load_xm.o mmcmp.o \
+ modplug.o snd_dsp.o sndfile.o snd_flt.o snd_fx.o \
+ sndmix.o tables.o
-libmodplug_cflags = -DHAVE_INTTYPES_H -I${libmodplug_base} \
- -I${libmodplug_base}/libmodplug
+subdir: libs
-libmodplug_objs = \
- ${libmodplug_base}/fastmix.${o} ${libmodplug_base}/load_669.${o} \
- ${libmodplug_base}/load_amf.${o} ${libmodplug_base}/load_ams.${o} \
- ${libmodplug_base}/load_dbm.${o} ${libmodplug_base}/load_dmf.${o} \
- ${libmodplug_base}/load_dsm.${o} ${libmodplug_base}/load_far.${o} \
- ${libmodplug_base}/load_it.${o} ${libmodplug_base}/load_mdl.${o} \
- ${libmodplug_base}/load_med.${o} ${libmodplug_base}/load_mod.${o} \
- ${libmodplug_base}/load_mt2.${o} ${libmodplug_base}/load_mtm.${o} \
- ${libmodplug_base}/load_okt.${o} ${libmodplug_base}/load_psm.${o} \
- ${libmodplug_base}/load_ptm.${o} ${libmodplug_base}/load_s3m.${o} \
- ${libmodplug_base}/load_stm.${o} ${libmodplug_base}/load_ult.${o} \
- ${libmodplug_base}/load_umx.${o} ${libmodplug_base}/load_wav.${o} \
- ${libmodplug_base}/load_xm.${o} ${libmodplug_base}/mmcmp.${o} \
- ${libmodplug_base}/modplug.${o} ${libmodplug_base}/snd_dsp.${o} \
- ${libmodplug_base}/sndfile.${o} ${libmodplug_base}/snd_flt.${o} \
- ${libmodplug_base}/snd_fx.${o} ${libmodplug_base}/sndmix.${o} \
- ${libmodplug_base}/tables.${o}
-
-libmodplug = ${libmodplug_base}/libmodplug.a
-
-${libmodplug_base}/%.${o}: ${libmodplug_base}/%.cpp
- ${CXX} ${CXXFLAGS} ${libmodplug_cflags} -c $< -o $@
-
-${libmodplug}: ${libmodplug_objs}
- ar crus ${libmodplug} ${libmodplug_objs}
-
-all: ${libmodplug}
+libs: ${objs}
+ ar crus libmodplug.a ${objs}
clean:
- rm -f ${libmodplug_objs} ${libmodplug}
+ rm -f ${objs} libmodplug.a
View
117 docs/changelog.txt
@@ -1,3 +1,118 @@
+June 6, 2005 - MZX 2.80h
+
++ Fixed a bug which could cause crashes when quiting the game.
++ Fixed some bugs when changing boards and other things that can
+ cause duplicate players.. I think.
++ Fixed a bug that could cause crashes when adding boards
++ Improved response time in editor for slower computers/high load
+ situations
++ Fixed some endian issues with the GUI
++ Fixed some crash when moving the mouse cursor around in the editor
++ Fixed bug where you if you had a robot whose name is the same as
+ the global robot it wouldn't get messages (fixes yoyo in Weirdness)
++ Fixed debug box not moving with text input
++ Fixed bug with duplicate player appearing when killed and a new one
+ can't be put at 0, 0
++ Added copy/paste for outside of MZX to/from the robot editor. It
+ only works in Windows and X11, and functionality may be limited in
+ X11 right now (currently seems to work in native X11 apps and
+ GTK 2.6 apps but not earlier GTK or QT, also try shift + insert to
+ paste)
++ Fixed bug in resizing involving overlay blanking.
++ Fixed clear messages/projectiles not working (and damaging the game
+ instead)
++ Fixed behavior of P key in editor for wildweasel.
++ Fixed random in Robotic not correctly swapping the range if they're
+ given in the wrong order
++ Fixed clip length in [ messages
++ Fixed crash when changing volume without a game loaded
++ Redid internal GUI system, fixes some minor things
++ New file loading/saving window - press del to delete a file/dir,
+ alt + n to create a new directory, alt + r to rename a file/dir.
++ Added PC speaker volume control to F2 settings and config.txt
++ Fixed yet another crash bug with resizing boards
++ Fixed inability to type * in text placement in the editor
+ (although this adds inability to turn on mod * while F2 is on...)
++ Added ctrl + n in the editor to load a module for listening only
+ (won't set the current board's module, and will let you choose
+ ones from different directories)
++ Fixed crash on macros with more variables than can be displayed
+ in their configuration.
++ Fixed bug that causes char selection cursor to reset to 0 on
+ unhandled keys (and continuously do so for lock keys)
++ Tweaked ctrl + dir in text entry boxes.
++ Added gdm2s3m in-tree to the contrib/ directory. gdm2s3m no longer
+ needs to be installed on the system before compiling mzx.
++ Improved the build system to automatically build .c and .cpp files
+ with compound system CFLAGS/CXXFLAGS, respectively.
++ Made package.sh automatically ship the source package with a
+ Makefile.dist to warn the user that they need to run config.sh before
+ 'make'.
++ Rectified inconsistency in source copyrights.
++ Added multicharacter editor. Select multiple keys in the character
+ selection with shift. The char editor also now has the ability to
+ perform operations (delete, copy, scroll, etc) on subblocks. Hold
+ down shift or press alt + b to highlight a region (press escape to
+ remove the latter). Blocks copied like this will be pasted to where
+ the cursor is at. Other small things in chareditor tweaked/changed...
+ No longer press tab to toggle through set/clear/toggle draw modes,
+ instead tab for set mode and shift + tab for clear (no more toggle).
+ Mouse behavior is modified as well. In non-SMZX left click sets,
+ right click clears. Shift + F2 will cut a block (clear + copy)
+
+ alt + x/alt + i can now be used to import/export partial charsets
+ while in the char editor. You can do so for several in series:
+ put a # in the name of the charset then set the First for the
+ first number # will be replaced with and the Count value to
+ indicate how many in series to work with.
+ For instance, saving s#.chr with first = 0, count = 3, starting
+ at offset 100, with a 2x2 char selection will save charsets
+ s0.chr from 100, s1.chr from 104, s2.chr from 108, and
+ s3.chr from 112.
+
+ *** NOTE *** Series import/export will only work correctly with
+ char selections that are one in height (can still be split up
+ another way in the editor itself). So if you want to use
+ partial charsets on your edits it's important that you select
+ all the chars in a row.
+
++ Made characters for the editor/GUI use another charset that's
+ protected. Please notify me if any characters are incorrect.
+ Modify mzx_edit.chr to change this charset.
++ The same thing goes for colors. It doesn't work for SMZX, which
+ also might look a bit different in the editor...
++ Added option (defaults on) to protect chars 32-127 in input
+ boxes and strings in the robot editor.
++ Mouse warping goes to middle instead of top corner now, so there
+ isn't a biased towards moving up.
++ Hopefully fixed another bug with the cursor and changing boards...
++ Fixed module looping problem in modplug...
++ Added libmodplug 0.7 with both patches (see contrib/) in-tree.
+ Removes system dependency on libmodplug.
++ Made auto-backup on by default (3 count)
++ Made if touching idle, beneath always false instead of like nodir
++ Fixed bug that caused bad things to happen if you pressed too many
+ different keys too rapidly.
++ Made mouse wheel emulate up/down in dialog boxes and list menu.
++ Added ctrl + backspace to intake (delete previous word)
++ Made modulo operator use floored instead of truncated mod (uses
+ positive remainder instead of negative)
++ Fixed crash when testing after using ctrl + z to clear a board.
++ Fixed bug where sending other robots to subroutines caused the
+ return address to be to the next instruction like local subroutine
+ calling works.
++ Fixed bug where going to a label on the last line of the robot could
+ screw the game up.
++ Fixed a bug where the editor froze if you tried to fill the board with
+ players (eheh...)
++ Fixed a bug that could cause crashes when sending all sensors something.
++ Fixed some crashes when exporting/saving fails.
++ Fixed import world's ability to go over the board limit and cause
+ crashes.
++ Allowed input of decimal numbers for params.
+
+April 1, 2005 - MZX 2.80g
+
+ Fixed crash on alt + x in robot editor.
+ Fixed missing line on alt + h in robot editor.
+ Introduced incorrect enter action in robot editor (didn't reset to beginning
@@ -53,6 +168,8 @@
+ Fixed crash bugs with placing sensors and maybe scrolls.
+ Fixed sending sensors when you have robots of the same name (fixes
Weirdness chapter 1)
++ Fixed bug that can screw up your world when placing scrolls or sensors..
+ sometimes.
December 26, 2004 - MZX 2.80f
View
BIN mzx_edit.chr
Binary file not shown.
View
21 package.sh
@@ -21,7 +21,7 @@ fi
# build deps below.
#
BINARY_DEPS="smzx.pal mzx_ascii.chr mzx_blank.chr mzx_default.chr \
- mzx_help.fil mzx_smzx.chr config.txt"
+ mzx_help.fil mzx_smzx.chr mzx_edit.chr config.txt"
#
# Documents that the binary zip should contain (pathname will be stored too).
@@ -48,7 +48,7 @@ SUBDIRS="arch contrib docs"
# What we actually care about; the complete sources to MegaZeux. Try to
# extract crap Exo's left in the wrong place. Feel free to update this.
#
-SRC="src/*.cpp src/*.h src/makefile"
+SRC="src/*.cpp src/*.h src/Makefile"
echo Generating sources in $TARGET and binary package with $TARGET.exe..
@@ -67,7 +67,14 @@ mkdir -p dist/$TARGET &&
mkdir -p dist/$TARGET/src &&
cp -pv $BINARY_DEPS $BUILD_DEPS dist/$TARGET &&
cp -pvr $SUBDIRS dist/$TARGET &&
-cp -pv $SRC dist/$TARGET/src
+cp -pv $SRC dist/$TARGET/src &&
+
+# hack for gdm2s3m & libmodplug
+rm -f dist/$TARGET/contrib/gdm2s3m/src/{*.a,*.o} &&
+rm -f dist/$TARGET/contrib/libmodplug/src/{*.a,*.o} &&
+
+# hack for "dist" makefile
+cp dist/$TARGET/arch/Makefile.dist dist/$TARGET/Makefile.platform
if [ "$?" != "0" ]; then
echo Some error occured during source build, aborted.
@@ -79,7 +86,7 @@ rm -f dist/$TARGET/src/config.h
echo Creating source tar ${TARGET}src.tar.gz..
cd dist
-tar -zcvf ${TARGET}src.tar.gz $TARGET
+tar --exclude CVS -jcvf ${TARGET}src.tar.bz2 $TARGET
cd ..
if [ "$?" != "0" ]; then
@@ -91,6 +98,12 @@ rm -rf dist/$TARGET
echo Built source distribution successfully!
+
+# no binary package is required
+if [ "$1" != "-b" ]; then
+ exit 0
+fi
+
#
# Do binary package.
#
View
13 src/Makefile
@@ -1,8 +1,15 @@
#
# core MegaZeux makefile
#
-include ../Makefile.platform
include ../Makefile.in
+include ../Makefile.platform
+
+# MZX requires some additional flags
+CXXFLAGS += -ffast-math -funsigned-char -DMZX_VERSION=\"${VERSTRING}\"
+
+# standard MZX includes
+INCLUDES = -I${PREFIX}/include -I../${MODPLUG} -I../${GDM2S3M} \
+ -I../${MODPLUG}/libmodplug -I${PREFIX}/include/SDL
OBJS = main.o graphics.o window.o hexchar.o event.o \
error.o helpsys.o world.o board.o robot.o idput.o \
@@ -13,8 +20,8 @@ OBJS = main.o graphics.o window.o hexchar.o event.o \
robo_ed.o configure.o fsafeopen.o macro.o
MZX = ../${TARGET}
-
-all: mzx
+
+subdir: mzx
ifdef DEBUG
mzx: ${OBJS}
View
32 src/audio.cpp
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
* Copyright (C) 2004 madbrain
*
* This program is free software; you can redistribute it and/or
@@ -29,8 +28,8 @@
#include "audio.h"
#include "modplug.h"
-#include "libmodplug/stdafx.h"
-#include "libmodplug/sndfile.h"
+#include "stdafx.h"
+#include "sndfile.h"
#include "SDL.h"
#include "sfx.h"
#include "data.h"
@@ -62,9 +61,13 @@ void audio_callback(void *userdata, Uint8 *stream, int len)
Sint32 cur_sample;
int sample_duration, end_duration;
int increment_value, increment_buffer;
+ int sfx_scale = audio.sfx_volume * 1024;
+ int sfx_scale_half = sfx_scale / 2;
if(audio.mod_playing && audio.music_on)
{
+ memset(audio.mod_buffer, -1, len / 2);
+
int read_len =
ModPlug_Read(audio.current_mod, audio.mod_buffer, len);
@@ -113,7 +116,8 @@ void audio_callback(void *userdata, Uint8 *stream, int len)
for(i = 0; i < sample_duration; i++)
{
- cur_sample = (Uint32)((increment_buffer & 0x80000000) >> 18) - 4096;
+ cur_sample = (Uint32)((increment_buffer & 0x80000000) >> 31) *
+ sfx_scale - sfx_scale_half;
*mix_dest_ptr += cur_sample;
*(mix_dest_ptr + 1) += cur_sample;
increment_buffer += increment_value;
@@ -156,7 +160,8 @@ void audio_callback(void *userdata, Uint8 *stream, int len)
for(i = 0; i < sample_duration; i++)
{
- cur_sample = (Uint32)((increment_buffer & 0x80000000) >> 18) - 4096;
+ cur_sample = (Uint32)((increment_buffer & 0x80000000) >> 31) *
+ sfx_scale - sfx_scale_half;
*mix_dest_ptr += cur_sample;
*(mix_dest_ptr + 1) += cur_sample;
increment_buffer += increment_value;
@@ -402,6 +407,8 @@ void play_sample(int freq, char *filename)
if(sample_loaded)
{
+ // These shouldn't repeat
+ sample_loaded->mSoundFile.SetRepeatCount(0);
// A little hack to modify the pitch
sample_loaded->mSoundFile.Ins[1].nC4Speed = (freq_conversion / freq) / 2;
sample_loaded->mSoundFile.Ins[2].nC4Speed = (freq_conversion / freq) / 2;
@@ -625,6 +632,11 @@ int get_sound_volume()
return audio.sound_volume;
}
+int get_sfx_volume()
+{
+ return audio.sfx_volume;
+}
+
void set_music_volume(int volume)
{
audio.music_volume = volume;
@@ -635,3 +647,9 @@ void set_sound_volume(int volume)
audio.sound_volume = volume;
}
+void set_sfx_volume(int volume)
+{
+ audio.sfx_volume = volume;
+}
+
+
View
8 src/audio.h
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -57,6 +56,7 @@ typedef struct
Uint32 sfx_on;
Uint32 music_volume;
Uint32 sound_volume;
+ Uint32 sfx_volume;
} audio_struct;
void init_audio(config_info *conf);
@@ -83,8 +83,10 @@ int get_music_on_state();
int get_sfx_on_state();
int get_music_volume();
int get_sound_volume();
+int get_sfx_volume();
void set_music_volume(int volume);
void set_sound_volume(int volume);
+void set_sfx_volume(int volume);
extern int error_mode;
View
369 src/block.cpp
@@ -1,8 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -48,264 +46,201 @@
//
//--------------------------
-char bdi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
-char bdi_xs[3] = { 2, 5, 15 };
-char bdi_ys[3] = { 2, 12, 12 };
-
-char *bdi_strs[3] =
-{
- "Copy block\n"
- "Copy block (repeated)\n"
- "Move block\n"
- "Clear block\n"
- "Flip block\n"
- "Mirror block\n"
- "Paint block\n"
- "Copy to/from overlay\n"
- "Save as MZM",
- "OK", "Cancel"
-};
-
-int bdi_p1s[3] = { 9, 0, -1};
-int bdi_p2s[1] = { 21 };
-int block_op = 0;
-void *bdi_storage[1] = { &block_op };
-
-dialog bdi =
-{
- 26, 3, 54, 17, "Choose block command", 3, bdi_types, bdi_xs,
- bdi_ys, bdi_strs, bdi_p1s, bdi_p2s, bdi_storage, 0
-};
-
int block_cmd(World *mzx_world)
{
- int dialog_ret;
+ int dialog_result;
+ element *elements[3];
+ dialog di;
+ int block_operation = 0;
+ char *radio_button_strings[] =
+ {
+ "Copy block",
+ "Copy block (repeated)",
+ "Move block",
+ "Clear block",
+ "Flip block",
+ "Mirror block",
+ "Paint block",
+ "Copy to/from overlay",
+ "Save as MZM"
+ };
+
set_context(73);
- dialog_ret = run_dialog(mzx_world, &bdi, 1, 0, 0);
+ elements[0] = construct_radio_button(2, 2, radio_button_strings,
+ 9, 21, &block_operation);
+ elements[1] = construct_button(5, 12, "OK", 0);
+ elements[2] = construct_button(15, 12, "Cancel", -1);
+
+ construct_dialog(&di, "Choose block command", 26, 3, 29, 15,
+ elements, 3, 0);
+
+ dialog_result = run_dialog(mzx_world, &di);
pop_context();
- if(dialog_ret)
- return -1;
- return block_op;
-}
+ destruct_dialog(&di);
-char adi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
-char adi_xs[3] = { 6, 5, 15 };
-char adi_ys[3] = { 4, 11, 11 };
-char *adi_strs[3] = { "Custom Block\nCustom Floor\nText", "OK", "Cancel" };
-int adi_p1s[3] = { 3, 0, -1 };
-int adi_p2s[1] = { 12 };
-int obj_type = 0;
-void *adi_storage[1] = { &obj_type };
+ if(dialog_result)
+ return -1;
-dialog adi =
-{
- 26, 4, 53, 17, "Object type", 3, adi_types, adi_xs, adi_ys, adi_strs,
- adi_p1s, adi_p2s, adi_storage, 0
-};
+ return block_operation;
+}
int rtoo_obj_type(World *mzx_world)
{
+ int dialog_result;
+ element *elements[3];
+ dialog di;
+ int object_type = 0;
+ char *radio_button_strings[] =
+ {
+ "Custom Block",
+ "Custom Floor",
+ "Text"
+ };
+
set_context(74);
+ elements[0] = construct_radio_button(6, 4, radio_button_strings,
+ 3, 12, &object_type);
+ elements[1] = construct_button(5, 11, "OK", 0);
+ elements[2] = construct_button(15, 11, "Cancel", -1);
- if(run_dialog(mzx_world, &adi, 1, 0, 0))
- {
- pop_context();
- return -1;
- }
+ construct_dialog(&di, "Object type", 26, 4, 28, 14,
+ elements, 3, 0);
+
+ dialog_result = run_dialog(mzx_world, &di);
+ destruct_dialog(&di);
pop_context();
- return obj_type;
-}
-char csdi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
-char csdi_xs[3] = { 4, 5, 15 };
-char csdi_ys[3] = { 4, 11, 11 };
-char *csdi_strs[3] =
-{
- "MegaZeux default\n"
- "ASCII set\n"
- "SMZX set\n"
- "Blank set", "OK", "Cancel"
-};
-
-int csdi_p1s[3] = { 4, 0, -1};
-int csdi_p2s[1] = { 16 };
-int cs_type = 0;
-void *csdi_storage[1] = { &cs_type };
-
-dialog csdi =
-{
- 26, 4, 53, 17, "Character set", 3, csdi_types, csdi_xs, csdi_ys,
- csdi_strs, csdi_p1s, csdi_p2s, csdi_storage, 0
-};
+ if(dialog_result)
+ return -1;
+
+ return object_type;
+}
int choose_char_set(World *mzx_world)
{
- set_context(75);
- if(run_dialog(mzx_world, &csdi, 1, 0, 0))
+ int dialog_result;
+ element *elements[3];
+ dialog di;
+ int charset_type = 0;
+ char *radio_button_strings[] =
{
- pop_context();
- return -1;
- }
- pop_context();
- return cs_type;
-}
+ "MegaZeux default",
+ "ASCII set",
+ "SMZX set",
+ "Blank set"
+ };
-char ed_types[3] = { DE_INPUT, DE_BUTTON, DE_BUTTON };
-char ed_xs[3] = { 5, 15, 37 };
-char ed_ys[3] = { 2, 4, 4 };
-char *ed_strs[3] = { NULL, "OK", "Cancel" };
-int ed_p1s[3] = { 32, 0, 1 };
-int ed_p2s = 192;
-void *fe_ptr = NULL;
+ set_context(75);
+ elements[0] = construct_radio_button(4, 4, radio_button_strings,
+ 4, 16, &charset_type);
+ elements[1] = construct_button(5, 11, "OK", 0);
+ elements[2] = construct_button(15, 11, "Cancel", -1);
-dialog e_di =
-{
- 10, 8, 69, 14, NULL, 3, ed_types, ed_xs, ed_ys, ed_strs, ed_p1s,
- &ed_p2s, &fe_ptr, 0
-};
-
-char edc_types[5] = { DE_INPUT, DE_NUMBER, DE_NUMBER, DE_BUTTON, DE_BUTTON };
-char edc_xs[5] = { 5, 5, 28, 15, 37 };
-char edc_ys[5] = { 2, 3, 3, 5, 5 };
-char *edc_strs[5] = { "Save as: ", "Offset: ", "Size: ", "OK", "Cancel" };
-int edc_p1s[5] = { 32, 0, 1, 0, 1 };
-int edc_p2s[5] = { 192, 255, 256, 0, 0 };
-void *edc_storage[5] = { NULL };
-
-dialog ec_di =
-{
- 10, 8, 69, 15, "Export", 5, edc_types, edc_xs, edc_ys, edc_strs, edc_p1s,
- edc_p2s, edc_storage, 0
-};
+ construct_dialog(&di, "Object type", 26, 4, 28, 14,
+ elements, 3, 0);
-int save_file_dialog(World *mzx_world, char *title, char *prompt, char *dest)
-{
- fe_ptr = (void *)dest;
- ed_strs[0] = prompt;
- e_di.title = title;
- return run_dialog(mzx_world, &e_di, 1, 0, 0);
-}
-
-int save_char_dialog(World *mzx_world, char *dest, int *char_offset,
- int *char_size)
-{
- edc_storage[0] = dest;
- edc_storage[1] = char_offset;
- edc_storage[2] = char_size;
- return run_dialog(mzx_world, &ec_di, 1, 0, 0);
-}
+ dialog_result = run_dialog(mzx_world, &di);
-// The ansi prefix code
-char ansi_pre[3] = "[";
-// EGA colors to ANSi colors
-char col2ansi[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
-// Mini func to output meta codes to transform color from one to another.
-// Curr color is the current color and dest color is the color we want.
+ destruct_dialog(&di);
+ pop_context();
-char exdi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
-char exdi_xs[3] = { 2, 5, 15 };
-char exdi_ys[3] = { 3, 8, 8 };
+ if(dialog_result)
+ return -1;
-char *exdi_strs[3] =
-{
- "Board file (MZB)\n"
- "Character set (CHR)\n"
- "Palette (PAL)\n"
- "Sound effects (SFX)",
- "OK", "Cancel"
-};
-
-int exdi_p1s[3] = { 4, 0, -1 };
-int exdi_p2s[1] = { 19 };
-void *exdi_storage[1] = { NULL };
-
-dialog exdi =
-{
- 26, 5, 53, 15, "Export as:", 3, exdi_types, exdi_xs, exdi_ys,
- exdi_strs, exdi_p1s, exdi_p2s, exdi_storage, 0
-};
+ return charset_type;
+}
int export_type(World *mzx_world)
{
- int storage = 0;
+ int export_choice = 0;
+ int dialog_result;
+ element *elements[3];
+ dialog di;
+ char *radio_strings[] =
+ {
+ "Board file (MZB)", "Character set (CHR)",
+ "Palette (PAL)", "Sound effects (SFX)"
+ };
+
set_context(77);
- exdi_storage[0] = &storage;
- if(run_dialog(mzx_world, &exdi, 1, 0, 0))
- {
- pop_context();
- return -1;
- }
+ elements[0] = construct_radio_button(2, 3, radio_strings,
+ 4, 19, &export_choice);
+ elements[1] = construct_button(5, 8, "OK", 0);
+ elements[2] = construct_button(15, 8, "Cancel", -1);
+
+ construct_dialog(&di, "Export as:", 26, 5, 28, 11,
+ elements, 3, 0);
+
+ dialog_result = run_dialog(mzx_world, &di);
+ destruct_dialog(&di);
pop_context();
- return storage;
-}
-char imdi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
-char imdi_xs[3] = { 2, 5, 15 };
-char imdi_ys[3] = { 3, 10, 10 };
+ if(dialog_result)
+ return -1;
-char *imdi_strs[3] =
-{
- "Board file (MZB)\n"
- "Character set (CHR)\n"
- "World file (MZX)\n"
- "Palette (PAL)\n"
- "Sound effects (SFX)\n"
- "MZM (choose pos.)",
- "OK", "Cancel"
-};
-
-int imdi_p1s[3] = { 6, 0, -1 };
-int imdi_p2s[1] = { 19 };
-void *imdi_storage[1] = { NULL };
-
-dialog imdi =
-{
- 26, 4, 53, 16, "Import:", 3, imdi_types, imdi_xs, imdi_ys,
- imdi_strs, imdi_p1s, imdi_p2s, imdi_storage, 0
-};
+ return export_choice;
+}
int import_type(World *mzx_world)
{
- int storage = 0;
- set_context(78);
- imdi_storage[0] = &storage;
- if(run_dialog(mzx_world, &imdi, 1, 0, 0))
+ int import_choice = 0;
+ int dialog_result;
+ element *elements[3];
+ dialog di;
+ char *radio_strings[] =
{
- pop_context();
- return -1;
- }
+ "Board file (MZB)", "Character set (CHR)",
+ "World file (MZX)", "Palette (PAL)",
+ "Sound effects (SFX)", "MZM (choose pos.)"
+ };
+
+ set_context(77);
+
+ elements[0] = construct_radio_button(2, 3, radio_strings,
+ 6, 19, &import_choice);
+ elements[1] = construct_button(5, 10, "OK", 0);
+ elements[2] = construct_button(15, 10, "Cancel", -1);
+
+ construct_dialog(&di, "Import:", 26, 4, 28, 13,
+ elements, 3, 0);
+
+ dialog_result = run_dialog(mzx_world, &di);
+ destruct_dialog(&di);
pop_context();
- return storage;
-}
-char imzdi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
-char imzdi_xs[3] = { 6, 5, 15 };
-char imzdi_ys[3] = { 5, 11, 11 };
-char *imzdi_strs[3] = { "Board\nOverlay", "OK", "Cancel" };
-int imzdi_p1s[3] = { 2, 0, -1 };
-int imzdi_p2s[1] = { 12 };
-int imz_type = 0;
-void *imzdi_storage[1] = { &imz_type };
+ if(dialog_result)
+ return -1;
-dialog imzdi =
-{
- 26, 4, 53, 17, "Import MZM as-", 3, imzdi_types, imzdi_xs,
- imzdi_ys, imzdi_strs, imzdi_p1s, imzdi_p2s, imzdi_storage, 0
-};
+ return import_choice;
+}
int import_mzm_obj_type(World *mzx_world)
{
+ int import_choice = 0;
+ int dialog_result;
+ element *elements[3];
+ dialog di;
+ char *radio_strings[] = { "Board", "Overlay" };
+
set_context(78);
- if(run_dialog(mzx_world, &imzdi, 1, 0, 0))
- {
- pop_context();
- return -1;
- }
+ elements[0] = construct_radio_button(6, 5, radio_strings,
+ 2, 19, &import_choice);
+ elements[1] = construct_button(5, 11, "OK", 0);
+ elements[2] = construct_button(15, 11, "Cancel", -1);
+
+ construct_dialog(&di, "Import MZM as-", 26, 4, 28, 13,
+ elements, 3, 0);
+
+ dialog_result = run_dialog(mzx_world, &di);
+ destruct_dialog(&di);
pop_context();
- return imz_type;
-}
+ if(dialog_result)
+ return -1;
+
+ return import_choice;
+}
View
4 src/block.h
@@ -1,8 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
View
30 src/board.cpp
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -427,13 +426,17 @@ Board *create_blank_board()
void save_board_file(Board *cur_board, char *name)
{
FILE *board_file = fopen(name, "wb");
- fputc(0xFF, board_file);
- fputs(world_version_string, board_file);
- optimize_null_objects(cur_board);
- save_board(cur_board, board_file, 0);
- // Write name
- fwrite(cur_board->board_name, 25, 1, board_file);
- fclose(board_file);
+
+ if(board_file)
+ {
+ fputc(0xFF, board_file);
+ fputs(world_version_string, board_file);
+ optimize_null_objects(cur_board);
+ save_board(cur_board, board_file, 0);
+ // Write name
+ fwrite(cur_board->board_name, 25, 1, board_file);
+ fclose(board_file);
+ }
}
int save_board(Board *cur_board, FILE *fp, int savegame)
@@ -736,7 +739,8 @@ void change_board_size(Board *src_board, int new_width, int new_height)
int offset;
int check_id;
- for(offset = new_size; offset < board_size - new_size; offset++)
+ for(offset = new_height * board_width; offset < board_size;
+ offset++)
{
check_id = level_id[offset];
@@ -951,8 +955,8 @@ void change_board_size(Board *src_board, int new_width, int new_height)
if(overlay_mode)
{
- memset(overlay + board_size, 32, size_difference);
- memset(overlay_color + board_size, 7, size_difference);
+ memset(overlay + offset, 32, size_difference);
+ memset(overlay_color + offset, 7, size_difference);
}
}
View
5 src/board.h
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
View
1,917 src/char_ed.cpp
1,327 additions, 590 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 src/char_ed.h
@@ -1,8 +1,7 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -25,6 +24,7 @@
#define __CHAR_ED_H
int char_editor(World *mzx_world);
+int char_editor_ext(World *mzx_world);
int smzx_char_editor(World *mzx_world);
void fill_region(char *matrix, int x, int y, int check, int draw);
void fill_region_smzx(char *matrix, int x, int y, int check, int draw);
View
4 src/charset.h
@@ -1,8 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
View
2 src/config.h
@@ -2,6 +2,8 @@
#define MZX_BLANK_CHR "/usr/share/megazeux/mzx_blank.chr"
#define MZX_SMZX_CHR "/usr/share/megazeux/mzx_smzx.chr"
#define MZX_ASCII_CHR "/usr/share/megazeux/mzx_ascii.chr"
+#define MZX_EDIT_CHR "/usr/share/megazeux/mzx_edit.chr"
#define SMZX_PAL "/usr/share/megazeux/smzx.pal"
#define MZX_HELP_FIL "/usr/share/megazeux/mzx_help.fil"
#define CONFIG_TXT "/etc/megazeux-config"
+#define CONFIG_X11
View
47 src/configure.cpp
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -308,12 +307,6 @@ void config_resampling_mode(config_info *conf, char *name, char *value,
}
}
-void redit_dpalette(config_info *conf, char *name, char *value,
- char *extended_data)
-{
- conf->redit_dpalette = strtol(value, NULL, 10);
-}
-
void redit_hhelp(config_info *conf, char *name, char *value,
char *extended_data)
{
@@ -395,6 +388,26 @@ void include_config(config_info *conf, char *name, char *value,
set_config_from_file(conf, name + 7);
}
+void config_set_sfx_volume(config_info *conf, char *name,
+ char *value, char *extended_data)
+{
+ int new_volume = strtol(value, NULL, 10);
+
+ if(new_volume < 1)
+ new_volume = 1;
+
+ if(new_volume > 8)
+ new_volume = 8;
+
+ conf->pc_speaker_volume = new_volume;
+}
+
+void config_mask_midchars(config_info *conf, char *name,
+ char *value, char *extended_data)
+{
+ conf->mask_midchars = strtol(value, NULL, 10);
+}
+
config_entry config_options[] =
{
{ "audio_buffer", config_set_audio_buffer },
@@ -425,13 +438,14 @@ config_entry config_options[] =
{ "joy?1-2axis?1-2", joy_axis_set },
{ "joy?1-2button?1-2", joy_button_set },
{ "macro_*", config_macro },
+ { "mask_midchars", config_mask_midchars },
{ "music_on", config_set_music },
{ "music_volume", config_set_mod_volume },
{ "mzx_speed", config_set_mzx_speed },
{ "pause_on_unfocus", pause_on_unfocus },
{ "pc_speaker_on", config_set_pc_speaker },
+ { "pc_speaker_volume", config_set_sfx_volume },
{ "resampling_mode", config_resampling_mode },
- { "robot_editor_default_palette", redit_dpalette },
{ "robot_editor_hide_help", redit_hhelp },
{ "sample_volume", config_set_sam_volume },
{ "save_file", config_save_file },
@@ -479,6 +493,7 @@ config_info default_options =
1,
8,
8,
+ 8,
1,
1,
@@ -495,13 +510,19 @@ config_info default_options =
1,
{ "char ", "color ", "goto ", "send ", ": playershot^" },
0,
- 0,
- 0,
+
+ // Backup options
+ 3,
60,
"backup",
+
+ // Macro options
0,
0,
- NULL
+ NULL,
+
+ // Misc options
+ 1
};
void default_config(config_info *conf)
View
11 src/configure.h
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -38,6 +37,7 @@ struct _config_info
int resampling_mode;
int music_volume;
int sam_volume;
+ int pc_speaker_volume;
int music_on;
int pc_speaker_on;
@@ -53,17 +53,20 @@ struct _config_info
int disassemble_base;
int default_invalid_status;
char default_macros[5][64];
- int redit_dpalette;
int redit_hhelp;
// Backup options
int backup_count;
int backup_interval;
char backup_name[256];
+ // Macro options
int num_extended_macros;
int num_macros_allocated;
ext_macro **extended_macros;
+
+ // Misc option
+ int mask_midchars;
};
typedef void (* config_function)(config_info *conf,
View
4 src/const.h
@@ -1,8 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
* Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
View
49 src/counter.cpp
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -398,9 +397,10 @@ void board_param_write(World *mzx_world, Function_counter *counter,
int board_size = src_board->board_width * src_board->board_height;
if((src_board->level_id[offset] < 122) &&
- (src_board->level_id[offset] < 122) && (offset >= 0) &&
- (offset < board_size))
+ (offset >= 0) && (offset < board_size))
+ {
src_board->level_param[offset] = value;
+ }
}
int red_value_read(World *mzx_world, Function_counter *counter,
@@ -1819,15 +1819,21 @@ int set_counter_special(World *mzx_world, int spec_type,
case FOPEN_SMZX_PALETTE:
{
- load_palette(char_value, 0);
+ load_palette(char_value);
pal_update = 1;
return 0;
}
case FOPEN_SAVE_GAME:
{
int faded = get_fade_status();
- save_world(mzx_world, char_value, 1, faded);
+ char translated_name[MAX_PATH];
+
+ if(!fsafetranslate(char_value, translated_name))
+ {
+ save_world(mzx_world, char_value, 1, faded);
+ }
+
return 0;
}
@@ -2956,3 +2962,32 @@ int is_string(char *buffer)
}
return 0;
}
+
+void counter_fsg()
+{
+ char cur_char = (builtin_counters[0]).counter_name[0];
+ char old_char;
+ int i, i2;
+
+ for(i = 0, i2 = 0; i < 256; i++)
+ {
+ if(i != cur_char)
+ {
+ counter_first_letter[i * 2] = -1;
+ counter_first_letter[(i * 2) + 1] = -1;
+ }
+ else
+ {
+ counter_first_letter[i * 2] = i2;
+ old_char = cur_char;
+
+ do
+ {
+ i2++;
+ cur_char = (builtin_counters[i2]).counter_name[0];
+ } while(cur_char == old_char);
+
+ counter_first_letter[(i * 2) + 1] = i2 - 1;
+ }
+ }
+}
View
6 src/counter.h
@@ -1,8 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
* Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
@@ -107,6 +105,8 @@ int translate_coordinates(char *src, unsigned int *x, unsigned int *y);
int is_string(char *buffer);
void get_string_size_offset(char *name, int *ssize, int *soffset);
+void counter_fsg();
+
// Even old games tended to use at least this many.
#define MIN_COUNTER_ALLOCATE 32
View
40 src/counter_first_letter.h
@@ -1,40 +0,0 @@
-int counter_first_letter[512] =
-{
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , 0 , 0 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , 1 , 4 ,
- 5 , 14 , 15 , 18 , 19 , 22 , -1 , -1 , 23 , 32 , 33 , 33 , 34 , 34 ,
- 35 , 37 , -1 , -1 , 38 , 41 , 42 , 47 , 48 , 54 , -1 , -1 , 55 , 57 ,
- 58 , 63 , -1 , -1 , 64 , 68 , 69 , 105, 106, 114, -1 , -1 , 115, 119,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ,
- -1 , -1 , -1 , -1 , -1 , -1 , 120, 128
-};
View
13 src/data.cpp
@@ -1,9 +1,8 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
- * Copyright (C) 2004 B.D.A - Gilead Kutnick
+ * Copyright (C) 2004 B.D.A
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -28,15 +27,15 @@
// Some globals that still lurk.. should be moved to other places.
// Current MZX file information
-char curr_file[FILENAME_SIZE] = "CAVERNS.MZX";
+char curr_file[512] = "CAVERNS.MZX";
// Current SAVE file
-char curr_sav[FILENAME_SIZE] = "SAVED.SAV";
+char curr_sav[512] = "SAVED.SAV";
char help_file[PATHNAME_SIZE]; // Drive + Path + Filename
char megazeux_dir[PATHNAME_SIZE]; // Directory started in
char current_dir[PATHNAME_SIZE]; // Current directory
unsigned char megazeux_drive = 2; // Startup drive (0=A...)
unsigned char current_drive = 2; // Current drive (0=A...)
-char quicksave_file[FILENAME_SIZE]; // Current quicksave filename
+char quicksave_file[512]; // Current quicksave filename
// Some global world values that haven't been removed yet.
View
8 src/data.h
@@ -1,8 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -47,8 +45,8 @@ extern unsigned char music_device;
extern unsigned int mixing_rate;
extern unsigned char sfx_channels;
extern unsigned char overall_speed;
-extern char curr_file[FILENAME_SIZE];
-extern char curr_sav[FILENAME_SIZE];
+extern char curr_file[512];
+extern char curr_sav[512];
extern char help_file[PATHNAME_SIZE]; // Drive + Path + Filename
extern char megazeux_dir[PATHNAME_SIZE]; // Directory started in
extern char current_dir[PATHNAME_SIZE]; // Current directory
View
13 src/decrypt.cpp
@@ -1,10 +1,7 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
- * Copyright (C) 1999 Charles Goetzman
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -25,12 +22,8 @@
#include <string.h>
#include <stdlib.h>
-char magic_code[16] = "æRëòmMJ·‡²’ˆÞ‘$";
-
-/* Replacement - test this before using it.
-char magic_code[16] =
+char magic_code[16] =
"\xE6\x52\xEB\xF2\x6D\x4D\x4A\xB7\x87\xB2\x92\x88\xDE\x91\x24";
-*/
int get_pw_xor_code(char *password, int pro_method)
{
View
6 src/decrypt.h
@@ -1,10 +1,8 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
* Copyright (C) 1999 Charles Goetzman
- * Copyright (C) 2004 Gilead Kutnick
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
View
5 src/delay.cpp
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick - exophase@adelphia.net
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
View
5 src/delay.h
@@ -1,7 +1,6 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
- * Copyright (C) 2004 Gilead Kutnick - exophase@adelphia.net
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
View
674 src/edit.cpp
@@ -1,8 +1,7 @@
-/* $Id$
- * MegaZeux
+/* MegaZeux
*
* Copyright (C) 1996 Greg Janson
- * Copyright (C) 2004 Gilead Kutnick - exophase@adelphia.net
+ * Copyright (C) 2004 Gilead Kutnick <exophase@adelphia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -72,45 +71,6 @@
The menu line turns to "Overlay editing-" and the lower portion shows
overlay commands on overlay mode.
-ÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
-X/Y: nnn/nnn³
-Board: nnn³
-(module) ³
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
- WORLD BOARD THING CURSOR SHOW MISC Drawing:_!_ (_#_ PushableRobot p00)
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
- L:Load S:Save G:Global Info Alt+R:Restart Alt+T:Test *:Protection
- Alt+S:Status Info Alt+C:Char Edit Alt+E:Palette Alt+F:Sound Effects
-
- Alt+Z:Clear X:Exits Alt+P:Size/Pos I:Info A:Add D:Delete V:View
- Alt+I:Import Alt+X:Export B:Select Board Alt+O:Edit Overlay
-
- F3:Terrain F4:Item F5:Creature F6:Puzzle F7:Transport F8:Element
- F9:Misc F10:Objects P:Parameter C:Color
-
- :Move Space:Place Enter:Modify+Grab Alt+M:Modify Ins:Grab Del:Delete
- F:Fill Tab:Draw F2:Text Alt+B:Block Alt+:Move 10
-
- Shift+F1:Show InvisWalls Shift+F2:Show Robots Shift+F3:Show Fakes
- Shift+F4:Show Spaces
-
- F1!Help R:Redraw Screen Alt+A:Select Char Set Alt+D:Default Colors
- ESC:Exit Alt+L:Test SAM Alt+Y:Debug Mode Alt+N:Music
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄPgup/Pgdn:MenuÄ
-
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
- OVERLAY EDITING- (Alt+O to end) Current:_!_ (_#_ Character p00)
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
- :Move Space:Place Ins:Grab Enter:Character Del:Delete F:Fill
- C:Color Alt+B:Block Tab:Draw Alt+:Move 10 Alt+S:Show level F2:Text
-ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
-
-Undocumented keys:
-
-End: LR corner
-Home: UL corner
-ESC: Cancel mode/overlay mode if active (otherwise exit)
-Backspace: Delete (move left one in text)
*/
#define synchronize_board_values() \
@@ -144,18 +104,24 @@ Backspace: Delete (move left one in text)
scroll_y = 0; \
} \
\
- if((cursor_board_x + scroll_x) \
+ if((cursor_x + scroll_x) \
>= board_width) \
{ \
scroll_x = (board_width - 80); \
} \
\
- if((cursor_board_y + scroll_y) \
+ if((cursor_y + scroll_y) \
>= board_height) \
{ \
scroll_y = \
(board_height - edit_screen_height); \
} \
+ \
+ if(scroll_x < 0) \
+ scroll_x = 0; \
+ \
+ if(scroll_y < 0) \
+ scroll_y = 0; \
#define fix_board(new_board) \
@@ -231,110 +197,110 @@ char *thing_menus[8][20] =
{
// Terrain (F3)
{
- "Space ~1",
- "Normal ~E²",
- "Solid ~",
- "Tree ~A",
- "Line ~",
+ "Space ~1 ",
+ "Normal ~E\xB2",
+ "Solid ~D\xDB",
+ "Tree ~A\x06",
+ "Line ~B\xCD",
"Custom Block ~F?",
- "Breakaway ~C±",
+ "Breakaway ~C\xB1",
"Custom Break ~F?",
- "Fake ~9²",
- "Carpet ~4±",
- "Floor ~6°",
- "Tiles ~",
+ "Fake ~9\xB2",
+ "Carpet ~4\xB1",
+ "Floor ~6\xB0",
+ "Tiles ~0\xFE",
"Custom Floor ~F?",
- "Web ~",
- "Thick Web ~",
- "Forest ~2²",
+ "Web ~7\xC5",
+ "Thick Web ~7\xCE",
+ "Forest ~2\xB2",
"Invis. Wall ~1 "
},
// Item (F4)
{
- "Gem ~A",
- "Magic Gem ~E",
- "Health ~C",
- "Ring ~E\x9",
- "Potion ~B–",
- "Energizer ~D",
- "Ammo ~3¤",
- "Bomb ~8",
- "Key ~F",
- "Lock ~F\xA",
- "Coin ~E",
- "Life ~B›",
- "Pouch ~7Ÿ",
- "Chest ~6 "
+ "Gem ~A\x04",
+ "Magic Gem ~E\x04",
+ "Health ~C\x03",
+ "Ring ~E\x09",
+ "Potion ~B\x96",
+ "Energizer ~D\x07",
+ "Ammo ~3\xA4",
+ "Bomb ~8\x0B",
+ "Key ~F\x0C",
+ "Lock ~F\x0A",
+ "Coin ~E\x07",
+ "Life ~B\x9B",
+ "Pouch ~7\x9F",
+ "Chest ~6\xA0"
},
// Creature (F5)
{
- "Snake ~",
- "Eye ~",
- "Thief ~C",
+ "Snake ~2\xE7",
+ "Eye ~F\xE8",
+ "Thief ~C\x05",
"Slime Blob ~A*",
- "Runner ~4",
- "Ghost ~",
- "Dragon ~4",
- "Fish ~",
- "Shark ~7",
- "Spider ~7•",
- "Goblin ~D",
- "Spitting Tiger ~",
- "Bear ~6¬",
- "Bear Cub ~6­",
- "Lazer Gun ~",
- "Bullet Gun ~F",
- "Spinning Gun ~F",
- "Missile Gun ~8"
+ "Runner ~4\x02",
+ "Ghost ~7\xE6",
+ "Dragon ~4\x15",
+ "Fish ~E\xE0",
+ "Shark ~7\x7F",
+ "Spider ~7\x95",
+ "Goblin ~D\x05",
+ "Spitting Tiger ~B\xE3",
+ "Bear ~6\xAC",
+ "Bear Cub ~6\xAD",
+ "Lazer Gun ~4\xCE",
+ "Bullet Gun ~F\x1B",
+ "Spinning Gun ~F\x1B",
+ "Missile Gun ~8\x11"
},
// Puzzle (F6)
{
- "Boulder ~",
- "Crate ~",
+ "Boulder ~7\xE9",
+ "Crate ~6\xFE",
"Custom Push ~F?",
- "Box ~",
+ "Box ~E\xFE",
"Custom Box ~F?",
- "Pusher ~D",
- "Slider NS ~D",
- "Slider EW ~D"
+ "Pusher ~D\x1F",
+ "Slider NS ~D\x12",
+ "Slider EW ~D\x1D"
},
// Tranport (F7)
{
- "Stairs ~A¢",
+ "Stairs ~A\xA2",
"Cave ~6¡",
"Transport ~E<",
- "Whirlpool ~B—",
+ "Whirlpool ~B\x97",
"CWRotate ~9/",
"CCWRotate ~9\\"
},
// Element (F8)
{
- "Still Water ~9°",
+ "Still Water ~9\xB0",
"N Water ~9\x18",
"S Water ~9\x19",
"E Water ~9\x1A",
"W Water ~9\x1B",
- "Ice ~",
- "Lava ~C²",
- "Fire ~E±",
- "Goop ~8°",
- "Lit Bomb ~8«",
- "Explosion ~E±"
+ "Ice ~B\xFD",