From 0dfcfd175f6b30ae2ed5ba87d4f91e92e00a73d2 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 25 Aug 2015 12:09:32 -0500 Subject: [PATCH] removed duplicates!! wwww renamed: 16/v2/source/archives/V2GPL.ZIP -> 16/v2/archives/V2GPL.ZIP deleted: 16/v2/source/ENGINE/MAKE.BAT modified: 16/v2/source/ENGINE/MAKEFILE modified: 16/v2/source/MAPED/GUI.C modified: 16/v2/source/MAPED/RENDER.H deleted: 16/v2/source/verge/ENGINE/AUDIO.H deleted: 16/v2/source/verge/ENGINE/A_MEMORY.C deleted: 16/v2/source/verge/ENGINE/A_MEMORY.H deleted: 16/v2/source/verge/ENGINE/CONLIB.C deleted: 16/v2/source/verge/ENGINE/CONLIB.H deleted: 16/v2/source/verge/ENGINE/CONSOLE.C deleted: 16/v2/source/verge/ENGINE/CONSOLE.H deleted: 16/v2/source/verge/ENGINE/CONTROLS.C deleted: 16/v2/source/verge/ENGINE/CONTROLS.H deleted: 16/v2/source/verge/ENGINE/ENGINE.C deleted: 16/v2/source/verge/ENGINE/ENGINE.H deleted: 16/v2/source/verge/ENGINE/ENTITY.C deleted: 16/v2/source/verge/ENGINE/ENTITY.H deleted: 16/v2/source/verge/ENGINE/FLI.C deleted: 16/v2/source/verge/ENGINE/FLI.H deleted: 16/v2/source/verge/ENGINE/FONT.C deleted: 16/v2/source/verge/ENGINE/FONT.H deleted: 16/v2/source/verge/ENGINE/IMAGE.C deleted: 16/v2/source/verge/ENGINE/IMAGE.H deleted: 16/v2/source/verge/ENGINE/INTER.H deleted: 16/v2/source/verge/ENGINE/KEYBOARD.H deleted: 16/v2/source/verge/ENGINE/KEYBOARD.S deleted: 16/v2/source/verge/ENGINE/MAIN.H deleted: 16/v2/source/verge/ENGINE/MAKEFILE deleted: 16/v2/source/verge/ENGINE/MESSAGE.C deleted: 16/v2/source/verge/ENGINE/MESSAGE.H deleted: 16/v2/source/verge/ENGINE/MIKMOD.A deleted: 16/v2/source/verge/ENGINE/MIKMOD.C deleted: 16/v2/source/verge/ENGINE/MIKMOD.H deleted: 16/v2/source/verge/ENGINE/MODE13H.C deleted: 16/v2/source/verge/ENGINE/MODEINIT.C deleted: 16/v2/source/verge/ENGINE/MODEX.C deleted: 16/v2/source/verge/ENGINE/MTYPES.H deleted: 16/v2/source/verge/ENGINE/PCX.H deleted: 16/v2/source/verge/ENGINE/RENDER.C deleted: 16/v2/source/verge/ENGINE/RENDER.H deleted: 16/v2/source/verge/ENGINE/SINCOS.H deleted: 16/v2/source/verge/ENGINE/SOUND.C deleted: 16/v2/source/verge/ENGINE/SOUND.H deleted: 16/v2/source/verge/ENGINE/STARTUP.C deleted: 16/v2/source/verge/ENGINE/TIMER.C deleted: 16/v2/source/verge/ENGINE/TIMER.H deleted: 16/v2/source/verge/ENGINE/VC.C deleted: 16/v2/source/verge/ENGINE/VC.H deleted: 16/v2/source/verge/ENGINE/VCCODE.H deleted: 16/v2/source/verge/ENGINE/VDRIVER.C deleted: 16/v2/source/verge/ENGINE/VDRIVER.H deleted: 16/v2/source/verge/ENGINE/VERGE.C deleted: 16/v2/source/verge/ENGINE/VERGE.H deleted: 16/v2/source/verge/ENGINE/VESA.C deleted: 16/v2/source/verge/ENGINE/VFILE.C deleted: 16/v2/source/verge/ENGINE/VFILE.H deleted: 16/v2/source/verge/MAPED/A_MEMORY.C deleted: 16/v2/source/verge/MAPED/COLBAK.H deleted: 16/v2/source/verge/MAPED/COLSTUFF.H deleted: 16/v2/source/verge/MAPED/COLUMNS.C deleted: 16/v2/source/verge/MAPED/COLUMNS.H deleted: 16/v2/source/verge/MAPED/CONFIG.C deleted: 16/v2/source/verge/MAPED/CONFIG.H deleted: 16/v2/source/verge/MAPED/CONTROLS.C deleted: 16/v2/source/verge/MAPED/GUI.C deleted: 16/v2/source/verge/MAPED/GUI.H deleted: 16/v2/source/verge/MAPED/GUICOMP.C deleted: 16/v2/source/verge/MAPED/GUICOMP.H deleted: 16/v2/source/verge/MAPED/INTER.H deleted: 16/v2/source/verge/MAPED/KEYBOARD.C deleted: 16/v2/source/verge/MAPED/KEYBOARD.H deleted: 16/v2/source/verge/MAPED/MAKEFILE deleted: 16/v2/source/verge/MAPED/MAPED.C deleted: 16/v2/source/verge/MAPED/MAPED.H deleted: 16/v2/source/verge/MAPED/MIKMOD.C deleted: 16/v2/source/verge/MAPED/MIKMOD.H deleted: 16/v2/source/verge/MAPED/MIKMOD.LIB deleted: 16/v2/source/verge/MAPED/MINIMAP.C deleted: 16/v2/source/verge/MAPED/MINIMAP.H deleted: 16/v2/source/verge/MAPED/MODE13H.C deleted: 16/v2/source/verge/MAPED/MODE13H.H deleted: 16/v2/source/verge/MAPED/MODEX.C deleted: 16/v2/source/verge/MAPED/MODEX.H deleted: 16/v2/source/verge/MAPED/MOUSE.C deleted: 16/v2/source/verge/MAPED/MOUSE.H deleted: 16/v2/source/verge/MAPED/MTYPES.H deleted: 16/v2/source/verge/MAPED/PCX.C deleted: 16/v2/source/verge/MAPED/RENDER.C deleted: 16/v2/source/verge/MAPED/RENDER.H deleted: 16/v2/source/verge/MAPED/SMALFONT.C deleted: 16/v2/source/verge/MAPED/SMALFONT.H deleted: 16/v2/source/verge/MAPED/SSAVER.C deleted: 16/v2/source/verge/MAPED/SSAVER.H deleted: 16/v2/source/verge/MAPED/SSAVER1.C deleted: 16/v2/source/verge/MAPED/TILEED.C deleted: 16/v2/source/verge/MAPED/TILEED.H deleted: 16/v2/source/verge/MAPED/TILESEL.C deleted: 16/v2/source/verge/MAPED/TILESEL.H deleted: 16/v2/source/verge/MAPED/TIMER.C deleted: 16/v2/source/verge/MAPED/TIMER.H deleted: 16/v2/source/verge/MAPED/VDRIVER.C deleted: 16/v2/source/verge/MAPED/VDRIVER.H deleted: 16/v2/source/verge/MAPED/VERGEPAL.H deleted: 16/v2/source/verge/README.TXT deleted: 16/v2/source/verge/UTIL/CHRCONV/CHRCONV.C deleted: 16/v2/source/verge/UTIL/CHRCONV/CHRCONV.TXT deleted: 16/v2/source/verge/UTIL/CHRCONV/DARIN.CHR deleted: 16/v2/source/verge/UTIL/CHRCONV/MAKEDJ.BAT deleted: 16/v2/source/verge/UTIL/CHRMAK/CHRMAK.CC deleted: 16/v2/source/verge/UTIL/CHRMAK/CHRMAK.TXT deleted: 16/v2/source/verge/UTIL/CHRMAK/MAKEDJ.BAT deleted: 16/v2/source/verge/UTIL/CHRMAK/MAKEWAT.BAT deleted: 16/v2/source/verge/UTIL/CHRMAK/VECNA.MAK deleted: 16/v2/source/verge/UTIL/CHRMAK/VECNA.PCX deleted: 16/v2/source/verge/UTIL/CHRMAK/VER deleted: 16/v2/source/verge/UTIL/PACK/MAKEDJ.BAT deleted: 16/v2/source/verge/UTIL/PACK/PACK.C deleted: 16/v2/source/verge/UTIL/PACK/PACK.TXT deleted: 16/v2/source/verge/UTIL/PACK/TEST deleted: 16/v2/source/verge/UTIL/PACK/TODO deleted: 16/v2/source/verge/UTIL/PCX2FNT/FONT0.PCX deleted: 16/v2/source/verge/UTIL/PCX2FNT/FONT02B.PCX deleted: 16/v2/source/verge/UTIL/PCX2FNT/MAKEDJ.BAT deleted: 16/v2/source/verge/UTIL/PCX2FNT/PCX2FNT.C deleted: 16/v2/source/verge/UTIL/PCX2FNT/PCX2FNT.TXT deleted: 16/v2/source/verge/UTIL/TRANS/MAKEDJ.BAT deleted: 16/v2/source/verge/UTIL/TRANS/SULLY.PDF deleted: 16/v2/source/verge/UTIL/TRANS/TRANS.C deleted: 16/v2/source/verge/UTIL/TRANS/TRANS.TXT deleted: 16/v2/source/verge/UTIL/TRANS/TYRIAN.PDF deleted: 16/v2/source/verge/UTIL/TRANS/TYRPAL.PCX deleted: 16/v2/source/verge/UTIL/TRANS/VERGE.PDF deleted: 16/v2/source/verge/UTIL/UNPACK/MAKEDJ.BAT deleted: 16/v2/source/verge/UTIL/UNPACK/TEST deleted: 16/v2/source/verge/UTIL/UNPACK/TODO deleted: 16/v2/source/verge/UTIL/UNPACK/UNPACK.C deleted: 16/v2/source/verge/UTIL/UNPACK/UNPACK.TXT deleted: 16/v2/source/verge/VCC/CLEAN.BAT deleted: 16/v2/source/verge/VCC/CODE.H deleted: 16/v2/source/verge/VCC/COMPILE.C deleted: 16/v2/source/verge/VCC/COMPILE.H deleted: 16/v2/source/verge/VCC/FUNCLIB.C deleted: 16/v2/source/verge/VCC/FUNCLIB.H deleted: 16/v2/source/verge/VCC/LEXICAL.C deleted: 16/v2/source/verge/VCC/LEXICAL.H deleted: 16/v2/source/verge/VCC/MAKEDJ.BAT deleted: 16/v2/source/verge/VCC/PREPROC.C deleted: 16/v2/source/verge/VCC/PREPROC.H deleted: 16/v2/source/verge/VCC/VCC.C deleted: 16/v2/source/verge/VCC/VCC.H deleted: 16/v2/source/verge/VCC/VCCODE.H deleted: 16/v2/source/verge/gnu.txt --- 16/v2/{source => }/archives/V2GPL.ZIP | Bin 16/v2/source/ENGINE/MAKE.BAT | 23 - 16/v2/source/ENGINE/MAKEFILE | 4 +- 16/v2/source/MAPED/GUI.C | 2 +- 16/v2/source/MAPED/RENDER.H | 3 +- 16/v2/source/verge/ENGINE/AUDIO.H | 340 -- 16/v2/source/verge/ENGINE/A_MEMORY.C | 201 - 16/v2/source/verge/ENGINE/A_MEMORY.H | 41 - 16/v2/source/verge/ENGINE/CONLIB.C | 285 -- 16/v2/source/verge/ENGINE/CONLIB.H | 46 - 16/v2/source/verge/ENGINE/CONSOLE.C | 455 -- 16/v2/source/verge/ENGINE/CONSOLE.H | 61 - 16/v2/source/verge/ENGINE/CONTROLS.C | 105 - 16/v2/source/verge/ENGINE/CONTROLS.H | 29 - 16/v2/source/verge/ENGINE/ENGINE.C | 746 --- 16/v2/source/verge/ENGINE/ENGINE.H | 106 - 16/v2/source/verge/ENGINE/ENTITY.C | 716 --- 16/v2/source/verge/ENGINE/ENTITY.H | 88 - 16/v2/source/verge/ENGINE/FLI.C | 702 --- 16/v2/source/verge/ENGINE/FLI.H | 28 - 16/v2/source/verge/ENGINE/FONT.C | 103 - 16/v2/source/verge/ENGINE/FONT.H | 37 - 16/v2/source/verge/ENGINE/IMAGE.C | 709 --- 16/v2/source/verge/ENGINE/IMAGE.H | 25 - 16/v2/source/verge/ENGINE/INTER.H | 41 - 16/v2/source/verge/ENGINE/KEYBOARD.H | 115 - 16/v2/source/verge/ENGINE/KEYBOARD.S | 227 - 16/v2/source/verge/ENGINE/MAIN.H | 42 - 16/v2/source/verge/ENGINE/MAKEFILE | 7 - 16/v2/source/verge/ENGINE/MESSAGE.C | 110 - 16/v2/source/verge/ENGINE/MESSAGE.H | 24 - 16/v2/source/verge/ENGINE/MIKMOD.A | Bin 96814 -> 0 bytes 16/v2/source/verge/ENGINE/MIKMOD.C | 310 -- 16/v2/source/verge/ENGINE/MIKMOD.H | 580 --- 16/v2/source/verge/ENGINE/MODE13H.C | 881 ---- 16/v2/source/verge/ENGINE/MODEINIT.C | 432 -- 16/v2/source/verge/ENGINE/MODEX.C | 1055 ---- 16/v2/source/verge/ENGINE/MTYPES.H | 73 - 16/v2/source/verge/ENGINE/PCX.H | 32 - 16/v2/source/verge/ENGINE/RENDER.C | 291 -- 16/v2/source/verge/ENGINE/RENDER.H | 27 - 16/v2/source/verge/ENGINE/SINCOS.H | 1106 ---- 16/v2/source/verge/ENGINE/SOUND.C | 113 - 16/v2/source/verge/ENGINE/SOUND.H | 27 - 16/v2/source/verge/ENGINE/STARTUP.C | 123 - 16/v2/source/verge/ENGINE/TIMER.C | 141 - 16/v2/source/verge/ENGINE/TIMER.H | 26 - 16/v2/source/verge/ENGINE/VC.C | 2242 -------- 16/v2/source/verge/ENGINE/VC.H | 56 - 16/v2/source/verge/ENGINE/VCCODE.H | 111 - 16/v2/source/verge/ENGINE/VDRIVER.C | 2814 ----------- 16/v2/source/verge/ENGINE/VDRIVER.H | 140 - 16/v2/source/verge/ENGINE/VERGE.C | 325 -- 16/v2/source/verge/ENGINE/VERGE.H | 55 - 16/v2/source/verge/ENGINE/VESA.C | 776 --- 16/v2/source/verge/ENGINE/VFILE.C | 269 - 16/v2/source/verge/ENGINE/VFILE.H | 65 - 16/v2/source/verge/MAPED/A_MEMORY.C | 211 - 16/v2/source/verge/MAPED/COLBAK.H | 4946 ------------------ 16/v2/source/verge/MAPED/COLSTUFF.H | 269 - 16/v2/source/verge/MAPED/COLUMNS.C | 420 -- 16/v2/source/verge/MAPED/COLUMNS.H | 34 - 16/v2/source/verge/MAPED/CONFIG.C | 200 - 16/v2/source/verge/MAPED/CONFIG.H | 28 - 16/v2/source/verge/MAPED/CONTROLS.C | 837 --- 16/v2/source/verge/MAPED/GUI.C | 5062 ------------------- 16/v2/source/verge/MAPED/GUI.H | 64 - 16/v2/source/verge/MAPED/GUICOMP.C | 137 - 16/v2/source/verge/MAPED/GUICOMP.H | 29 - 16/v2/source/verge/MAPED/INTER.H | 38 - 16/v2/source/verge/MAPED/KEYBOARD.C | 84 - 16/v2/source/verge/MAPED/KEYBOARD.H | 115 - 16/v2/source/verge/MAPED/MAKEFILE | 32 - 16/v2/source/verge/MAPED/MAPED.C | 1624 ------ 16/v2/source/verge/MAPED/MAPED.H | 180 - 16/v2/source/verge/MAPED/MIKMOD.C | 311 -- 16/v2/source/verge/MAPED/MIKMOD.H | 580 --- 16/v2/source/verge/MAPED/MIKMOD.LIB | Bin 94720 -> 0 bytes 16/v2/source/verge/MAPED/MINIMAP.C | 151 - 16/v2/source/verge/MAPED/MINIMAP.H | 24 - 16/v2/source/verge/MAPED/MODE13H.C | 350 -- 16/v2/source/verge/MAPED/MODE13H.H | 36 - 16/v2/source/verge/MAPED/MODEX.C | 404 -- 16/v2/source/verge/MAPED/MODEX.H | 35 - 16/v2/source/verge/MAPED/MOUSE.C | 94 - 16/v2/source/verge/MAPED/MOUSE.H | 30 - 16/v2/source/verge/MAPED/MTYPES.H | 73 - 16/v2/source/verge/MAPED/PCX.C | 210 - 16/v2/source/verge/MAPED/RENDER.C | 475 -- 16/v2/source/verge/MAPED/RENDER.H | 56 - 16/v2/source/verge/MAPED/SMALFONT.C | 655 --- 16/v2/source/verge/MAPED/SMALFONT.H | 30 - 16/v2/source/verge/MAPED/SSAVER.C | 136 - 16/v2/source/verge/MAPED/SSAVER.H | 22 - 16/v2/source/verge/MAPED/SSAVER1.C | 32 - 16/v2/source/verge/MAPED/TILEED.C | 2164 -------- 16/v2/source/verge/MAPED/TILEED.H | 34 - 16/v2/source/verge/MAPED/TILESEL.C | 1448 ------ 16/v2/source/verge/MAPED/TILESEL.H | 47 - 16/v2/source/verge/MAPED/TIMER.C | 118 - 16/v2/source/verge/MAPED/TIMER.H | 29 - 16/v2/source/verge/MAPED/VDRIVER.C | 105 - 16/v2/source/verge/MAPED/VDRIVER.H | 49 - 16/v2/source/verge/MAPED/VERGEPAL.H | 82 - 16/v2/source/verge/README.TXT | 40 - 16/v2/source/verge/UTIL/CHRCONV/CHRCONV.C | 125 - 16/v2/source/verge/UTIL/CHRCONV/CHRCONV.TXT | 15 - 16/v2/source/verge/UTIL/CHRCONV/DARIN.CHR | Bin 15360 -> 0 bytes 16/v2/source/verge/UTIL/CHRCONV/MAKEDJ.BAT | 2 - 16/v2/source/verge/UTIL/CHRMAK/CHRMAK.CC | 653 --- 16/v2/source/verge/UTIL/CHRMAK/CHRMAK.TXT | 118 - 16/v2/source/verge/UTIL/CHRMAK/MAKEDJ.BAT | 2 - 16/v2/source/verge/UTIL/CHRMAK/MAKEWAT.BAT | 2 - 16/v2/source/verge/UTIL/CHRMAK/VECNA.MAK | 21 - 16/v2/source/verge/UTIL/CHRMAK/VECNA.PCX | Bin 15740 -> 0 bytes 16/v2/source/verge/UTIL/CHRMAK/VER | 4 - 16/v2/source/verge/UTIL/PACK/MAKEDJ.BAT | 2 - 16/v2/source/verge/UTIL/PACK/PACK.C | 166 - 16/v2/source/verge/UTIL/PACK/PACK.TXT | 36 - 16/v2/source/verge/UTIL/PACK/TEST | 5 - 16/v2/source/verge/UTIL/PACK/TODO | 3 - 16/v2/source/verge/UTIL/PCX2FNT/FONT0.PCX | Bin 11576 -> 0 bytes 16/v2/source/verge/UTIL/PCX2FNT/FONT02B.PCX | Bin 21809 -> 0 bytes 16/v2/source/verge/UTIL/PCX2FNT/MAKEDJ.BAT | 2 - 16/v2/source/verge/UTIL/PCX2FNT/PCX2FNT.C | 147 - 16/v2/source/verge/UTIL/PCX2FNT/PCX2FNT.TXT | 15 - 16/v2/source/verge/UTIL/TRANS/MAKEDJ.BAT | 2 - 16/v2/source/verge/UTIL/TRANS/SULLY.PDF | 19 - 16/v2/source/verge/UTIL/TRANS/TRANS.C | 156 - 16/v2/source/verge/UTIL/TRANS/TRANS.TXT | 32 - 16/v2/source/verge/UTIL/TRANS/TYRIAN.PDF | 17 - 16/v2/source/verge/UTIL/TRANS/TYRPAL.PCX | Bin 13450 -> 0 bytes 16/v2/source/verge/UTIL/TRANS/VERGE.PDF | 17 - 16/v2/source/verge/UTIL/UNPACK/MAKEDJ.BAT | 2 - 16/v2/source/verge/UTIL/UNPACK/TEST | 5 - 16/v2/source/verge/UTIL/UNPACK/TODO | 3 - 16/v2/source/verge/UTIL/UNPACK/UNPACK.C | 122 - 16/v2/source/verge/UTIL/UNPACK/UNPACK.TXT | 13 - 16/v2/source/verge/VCC/CLEAN.BAT | 4 - 16/v2/source/verge/VCC/CODE.H | 70 - 16/v2/source/verge/VCC/COMPILE.C | 1256 ----- 16/v2/source/verge/VCC/COMPILE.H | 80 - 16/v2/source/verge/VCC/FUNCLIB.C | 445 -- 16/v2/source/verge/VCC/FUNCLIB.H | 54 - 16/v2/source/verge/VCC/LEXICAL.C | 676 --- 16/v2/source/verge/VCC/LEXICAL.H | 47 - 16/v2/source/verge/VCC/MAKEDJ.BAT | 7 - 16/v2/source/verge/VCC/PREPROC.C | 799 --- 16/v2/source/verge/VCC/PREPROC.H | 23 - 16/v2/source/verge/VCC/VCC.C | 342 -- 16/v2/source/verge/VCC/VCC.H | 38 - 16/v2/source/verge/VCC/VCCODE.H | 111 - 16/v2/source/verge/gnu.txt | 87 - 153 files changed, 4 insertions(+), 45362 deletions(-) rename 16/v2/{source => }/archives/V2GPL.ZIP (100%) delete mode 100755 16/v2/source/ENGINE/MAKE.BAT delete mode 100755 16/v2/source/verge/ENGINE/AUDIO.H delete mode 100755 16/v2/source/verge/ENGINE/A_MEMORY.C delete mode 100755 16/v2/source/verge/ENGINE/A_MEMORY.H delete mode 100755 16/v2/source/verge/ENGINE/CONLIB.C delete mode 100755 16/v2/source/verge/ENGINE/CONLIB.H delete mode 100755 16/v2/source/verge/ENGINE/CONSOLE.C delete mode 100755 16/v2/source/verge/ENGINE/CONSOLE.H delete mode 100755 16/v2/source/verge/ENGINE/CONTROLS.C delete mode 100755 16/v2/source/verge/ENGINE/CONTROLS.H delete mode 100755 16/v2/source/verge/ENGINE/ENGINE.C delete mode 100755 16/v2/source/verge/ENGINE/ENGINE.H delete mode 100755 16/v2/source/verge/ENGINE/ENTITY.C delete mode 100755 16/v2/source/verge/ENGINE/ENTITY.H delete mode 100755 16/v2/source/verge/ENGINE/FLI.C delete mode 100755 16/v2/source/verge/ENGINE/FLI.H delete mode 100755 16/v2/source/verge/ENGINE/FONT.C delete mode 100755 16/v2/source/verge/ENGINE/FONT.H delete mode 100755 16/v2/source/verge/ENGINE/IMAGE.C delete mode 100755 16/v2/source/verge/ENGINE/IMAGE.H delete mode 100755 16/v2/source/verge/ENGINE/INTER.H delete mode 100755 16/v2/source/verge/ENGINE/KEYBOARD.H delete mode 100755 16/v2/source/verge/ENGINE/KEYBOARD.S delete mode 100755 16/v2/source/verge/ENGINE/MAIN.H delete mode 100755 16/v2/source/verge/ENGINE/MAKEFILE delete mode 100755 16/v2/source/verge/ENGINE/MESSAGE.C delete mode 100755 16/v2/source/verge/ENGINE/MESSAGE.H delete mode 100755 16/v2/source/verge/ENGINE/MIKMOD.A delete mode 100755 16/v2/source/verge/ENGINE/MIKMOD.C delete mode 100755 16/v2/source/verge/ENGINE/MIKMOD.H delete mode 100755 16/v2/source/verge/ENGINE/MODE13H.C delete mode 100755 16/v2/source/verge/ENGINE/MODEINIT.C delete mode 100755 16/v2/source/verge/ENGINE/MODEX.C delete mode 100755 16/v2/source/verge/ENGINE/MTYPES.H delete mode 100755 16/v2/source/verge/ENGINE/PCX.H delete mode 100755 16/v2/source/verge/ENGINE/RENDER.C delete mode 100755 16/v2/source/verge/ENGINE/RENDER.H delete mode 100755 16/v2/source/verge/ENGINE/SINCOS.H delete mode 100755 16/v2/source/verge/ENGINE/SOUND.C delete mode 100755 16/v2/source/verge/ENGINE/SOUND.H delete mode 100755 16/v2/source/verge/ENGINE/STARTUP.C delete mode 100755 16/v2/source/verge/ENGINE/TIMER.C delete mode 100755 16/v2/source/verge/ENGINE/TIMER.H delete mode 100755 16/v2/source/verge/ENGINE/VC.C delete mode 100755 16/v2/source/verge/ENGINE/VC.H delete mode 100755 16/v2/source/verge/ENGINE/VCCODE.H delete mode 100755 16/v2/source/verge/ENGINE/VDRIVER.C delete mode 100755 16/v2/source/verge/ENGINE/VDRIVER.H delete mode 100755 16/v2/source/verge/ENGINE/VERGE.C delete mode 100755 16/v2/source/verge/ENGINE/VERGE.H delete mode 100755 16/v2/source/verge/ENGINE/VESA.C delete mode 100755 16/v2/source/verge/ENGINE/VFILE.C delete mode 100755 16/v2/source/verge/ENGINE/VFILE.H delete mode 100755 16/v2/source/verge/MAPED/A_MEMORY.C delete mode 100755 16/v2/source/verge/MAPED/COLBAK.H delete mode 100755 16/v2/source/verge/MAPED/COLSTUFF.H delete mode 100755 16/v2/source/verge/MAPED/COLUMNS.C delete mode 100755 16/v2/source/verge/MAPED/COLUMNS.H delete mode 100755 16/v2/source/verge/MAPED/CONFIG.C delete mode 100755 16/v2/source/verge/MAPED/CONFIG.H delete mode 100755 16/v2/source/verge/MAPED/CONTROLS.C delete mode 100755 16/v2/source/verge/MAPED/GUI.C delete mode 100755 16/v2/source/verge/MAPED/GUI.H delete mode 100755 16/v2/source/verge/MAPED/GUICOMP.C delete mode 100755 16/v2/source/verge/MAPED/GUICOMP.H delete mode 100755 16/v2/source/verge/MAPED/INTER.H delete mode 100755 16/v2/source/verge/MAPED/KEYBOARD.C delete mode 100755 16/v2/source/verge/MAPED/KEYBOARD.H delete mode 100755 16/v2/source/verge/MAPED/MAKEFILE delete mode 100755 16/v2/source/verge/MAPED/MAPED.C delete mode 100755 16/v2/source/verge/MAPED/MAPED.H delete mode 100755 16/v2/source/verge/MAPED/MIKMOD.C delete mode 100755 16/v2/source/verge/MAPED/MIKMOD.H delete mode 100755 16/v2/source/verge/MAPED/MIKMOD.LIB delete mode 100755 16/v2/source/verge/MAPED/MINIMAP.C delete mode 100755 16/v2/source/verge/MAPED/MINIMAP.H delete mode 100755 16/v2/source/verge/MAPED/MODE13H.C delete mode 100755 16/v2/source/verge/MAPED/MODE13H.H delete mode 100755 16/v2/source/verge/MAPED/MODEX.C delete mode 100755 16/v2/source/verge/MAPED/MODEX.H delete mode 100755 16/v2/source/verge/MAPED/MOUSE.C delete mode 100755 16/v2/source/verge/MAPED/MOUSE.H delete mode 100755 16/v2/source/verge/MAPED/MTYPES.H delete mode 100755 16/v2/source/verge/MAPED/PCX.C delete mode 100755 16/v2/source/verge/MAPED/RENDER.C delete mode 100755 16/v2/source/verge/MAPED/RENDER.H delete mode 100755 16/v2/source/verge/MAPED/SMALFONT.C delete mode 100755 16/v2/source/verge/MAPED/SMALFONT.H delete mode 100755 16/v2/source/verge/MAPED/SSAVER.C delete mode 100755 16/v2/source/verge/MAPED/SSAVER.H delete mode 100755 16/v2/source/verge/MAPED/SSAVER1.C delete mode 100755 16/v2/source/verge/MAPED/TILEED.C delete mode 100755 16/v2/source/verge/MAPED/TILEED.H delete mode 100755 16/v2/source/verge/MAPED/TILESEL.C delete mode 100755 16/v2/source/verge/MAPED/TILESEL.H delete mode 100755 16/v2/source/verge/MAPED/TIMER.C delete mode 100755 16/v2/source/verge/MAPED/TIMER.H delete mode 100755 16/v2/source/verge/MAPED/VDRIVER.C delete mode 100755 16/v2/source/verge/MAPED/VDRIVER.H delete mode 100755 16/v2/source/verge/MAPED/VERGEPAL.H delete mode 100755 16/v2/source/verge/README.TXT delete mode 100755 16/v2/source/verge/UTIL/CHRCONV/CHRCONV.C delete mode 100755 16/v2/source/verge/UTIL/CHRCONV/CHRCONV.TXT delete mode 100755 16/v2/source/verge/UTIL/CHRCONV/DARIN.CHR delete mode 100755 16/v2/source/verge/UTIL/CHRCONV/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/CHRMAK.CC delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/CHRMAK.TXT delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/MAKEWAT.BAT delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/VECNA.MAK delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/VECNA.PCX delete mode 100755 16/v2/source/verge/UTIL/CHRMAK/VER delete mode 100755 16/v2/source/verge/UTIL/PACK/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/UTIL/PACK/PACK.C delete mode 100755 16/v2/source/verge/UTIL/PACK/PACK.TXT delete mode 100755 16/v2/source/verge/UTIL/PACK/TEST delete mode 100755 16/v2/source/verge/UTIL/PACK/TODO delete mode 100755 16/v2/source/verge/UTIL/PCX2FNT/FONT0.PCX delete mode 100755 16/v2/source/verge/UTIL/PCX2FNT/FONT02B.PCX delete mode 100755 16/v2/source/verge/UTIL/PCX2FNT/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/UTIL/PCX2FNT/PCX2FNT.C delete mode 100755 16/v2/source/verge/UTIL/PCX2FNT/PCX2FNT.TXT delete mode 100755 16/v2/source/verge/UTIL/TRANS/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/UTIL/TRANS/SULLY.PDF delete mode 100755 16/v2/source/verge/UTIL/TRANS/TRANS.C delete mode 100755 16/v2/source/verge/UTIL/TRANS/TRANS.TXT delete mode 100755 16/v2/source/verge/UTIL/TRANS/TYRIAN.PDF delete mode 100755 16/v2/source/verge/UTIL/TRANS/TYRPAL.PCX delete mode 100755 16/v2/source/verge/UTIL/TRANS/VERGE.PDF delete mode 100755 16/v2/source/verge/UTIL/UNPACK/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/UTIL/UNPACK/TEST delete mode 100755 16/v2/source/verge/UTIL/UNPACK/TODO delete mode 100755 16/v2/source/verge/UTIL/UNPACK/UNPACK.C delete mode 100755 16/v2/source/verge/UTIL/UNPACK/UNPACK.TXT delete mode 100755 16/v2/source/verge/VCC/CLEAN.BAT delete mode 100755 16/v2/source/verge/VCC/CODE.H delete mode 100755 16/v2/source/verge/VCC/COMPILE.C delete mode 100755 16/v2/source/verge/VCC/COMPILE.H delete mode 100755 16/v2/source/verge/VCC/FUNCLIB.C delete mode 100755 16/v2/source/verge/VCC/FUNCLIB.H delete mode 100755 16/v2/source/verge/VCC/LEXICAL.C delete mode 100755 16/v2/source/verge/VCC/LEXICAL.H delete mode 100755 16/v2/source/verge/VCC/MAKEDJ.BAT delete mode 100755 16/v2/source/verge/VCC/PREPROC.C delete mode 100755 16/v2/source/verge/VCC/PREPROC.H delete mode 100755 16/v2/source/verge/VCC/VCC.C delete mode 100755 16/v2/source/verge/VCC/VCC.H delete mode 100755 16/v2/source/verge/VCC/VCCODE.H delete mode 100755 16/v2/source/verge/gnu.txt diff --git a/16/v2/source/archives/V2GPL.ZIP b/16/v2/archives/V2GPL.ZIP similarity index 100% rename from 16/v2/source/archives/V2GPL.ZIP rename to 16/v2/archives/V2GPL.ZIP diff --git a/16/v2/source/ENGINE/MAKE.BAT b/16/v2/source/ENGINE/MAKE.BAT deleted file mode 100755 index 291b92ef..00000000 --- a/16/v2/source/ENGINE/MAKE.BAT +++ /dev/null @@ -1,23 +0,0 @@ -wcc386 a_memory.c -wcc386 conlib.c -wcc386 console.c -wcc386 controls.c -wcc386 engine.c -wcc386 entity.c -wcc386 fli.c -wcc386 font.c -wcc386 image.c -wcc386 message.c -wcc386 mikmod.c -wcc386 mode13h.c -wcc386 modeinit.c -wcc386 modex.c -wcc386 render.c -wcc386 sound.c -wcc386 startup.c -wcc386 timer.c -wcc386 vc.c -wcc386 vdriver.c -wcc386 verge.c -wcc386 vesa.c -wcc386 vfile.c diff --git a/16/v2/source/ENGINE/MAKEFILE b/16/v2/source/ENGINE/MAKEFILE index db5016da..f557fa31 100755 --- a/16/v2/source/ENGINE/MAKEFILE +++ b/16/v2/source/ENGINE/MAKEFILE @@ -1,7 +1,7 @@ -CC = wcc386 +CC = gcc CFLAGS = -s -Wall -Werror -OBJ = a_memory.obj conlib.obj console.obj controls.obj engine.obj entity.obj font.obj image.obj keyboard.obj message.obj modeinit.obj render.obj startup.obj timer.obj verge.obj vc.obj vdriver.obj vfile.obj fli.obj sound.obj mikmod.a +OBJ = a_memory.o conlib.o console.o controls.o engine.o entity.o font.o image.o keyboard.o message.o modeinit.o render.o startup.o timer.o verge.o vc.o vdriver.o vfile.o fli.o sound.o mikmod.a verge: $(OBJ) diff --git a/16/v2/source/MAPED/GUI.C b/16/v2/source/MAPED/GUI.C index d4869d42..49bdc469 100755 --- a/16/v2/source/MAPED/GUI.C +++ b/16/v2/source/MAPED/GUI.C @@ -260,7 +260,7 @@ void MainMenu(int dx, int dy) if (my>dy+47 && mydy+53 && mydy+59 && mydy+65 && mydy+65 && mydy+71 && mydy+80 && my>8)) -#define LOWORD(l) ((WORD)(l)) -#define HIWORD(l) ((WORD)((DWORD)(l)>>16)) -#define MAKEWORD(l,h) ((WORD)(((BYTE)(l))|(((WORD)((BYTE)(h)))<<8))) -#define MAKELONG(l,h) ((DWORD)(((WORD)(l))|(((DWORD)((WORD)(h)))<<16))) - -#endif - - -/* audio system version number */ -#define AUDIO_SYSTEM_VERSION 0x0101 - -/* audio capabilities bit fields definitions */ -#define AUDIO_FORMAT_1M08 0x00000001 -#define AUDIO_FORMAT_1S08 0x00000002 -#define AUDIO_FORMAT_1M16 0x00000004 -#define AUDIO_FORMAT_1S16 0x00000008 -#define AUDIO_FORMAT_2M08 0x00000010 -#define AUDIO_FORMAT_2S08 0x00000020 -#define AUDIO_FORMAT_2M16 0x00000040 -#define AUDIO_FORMAT_2S16 0x00000080 -#define AUDIO_FORMAT_4M08 0x00000100 -#define AUDIO_FORMAT_4S08 0x00000200 -#define AUDIO_FORMAT_4M16 0x00000400 -#define AUDIO_FORMAT_4S16 0x00000800 - -/* audio format bit fields defines for devices and waveforms */ -#define AUDIO_FORMAT_8BITS 0x0000 -#define AUDIO_FORMAT_16BITS 0x0001 -#define AUDIO_FORMAT_LOOP 0x0010 -#define AUDIO_FORMAT_BIDILOOP 0x0020 -#define AUDIO_FORMAT_REVERSE 0x0080 -#define AUDIO_FORMAT_MONO 0x0000 -#define AUDIO_FORMAT_STEREO 0x0100 -#define AUDIO_FORMAT_FILTER 0x8000 - -/* audio resource limits defines */ -#define AUDIO_MAX_VOICES 32 -#define AUDIO_MAX_SAMPLES 16 -#define AUDIO_MAX_PATCHES 128 -#define AUDIO_MAX_PATTERNS 256 -#define AUDIO_MAX_ORDERS 256 -#define AUDIO_MAX_NOTES 96 -#define AUDIO_MAX_POINTS 12 -#define AUDIO_MIN_PERIOD 1 -#define AUDIO_MAX_PERIOD 31999 -#define AUDIO_MIN_VOLUME 0x00 -#define AUDIO_MAX_VOLUME 0x40 -#define AUDIO_MIN_PANNING 0x00 -#define AUDIO_MAX_PANNING 0xFF -#define AUDIO_MIN_POSITION 0x00000000L -#define AUDIO_MAX_POSITION 0x00100000L -#define AUDIO_MIN_FREQUENCY 0x00000200L -#define AUDIO_MAX_FREQUENCY 0x00080000L - -/* audio error code defines */ -#define AUDIO_ERROR_NONE 0x0000 -#define AUDIO_ERROR_INVALHANDLE 0x0001 -#define AUDIO_ERROR_INVALPARAM 0x0002 -#define AUDIO_ERROR_NOTSUPPORTED 0x0003 -#define AUDIO_ERROR_BADDEVICEID 0x0004 -#define AUDIO_ERROR_NODEVICE 0x0005 -#define AUDIO_ERROR_DEVICEBUSY 0x0006 -#define AUDIO_ERROR_BADFORMAT 0x0007 -#define AUDIO_ERROR_NOMEMORY 0x0008 -#define AUDIO_ERROR_NODRAMMEMORY 0x0009 -#define AUDIO_ERROR_FILENOTFOUND 0x000A -#define AUDIO_ERROR_BADFILEFORMAT 0x000B -#define AUDIO_LAST_ERROR 0x000B - -/* audio device identifiers */ -#define AUDIO_DEVICE_NONE 0x0000 -#define AUDIO_DEVICE_MAPPER 0xFFFF - -/* audio product identifiers */ -#define AUDIO_PRODUCT_NONE 0x0000 -#define AUDIO_PRODUCT_SB 0x0001 -#define AUDIO_PRODUCT_SB15 0x0002 -#define AUDIO_PRODUCT_SB20 0x0003 -#define AUDIO_PRODUCT_SBPRO 0x0004 -#define AUDIO_PRODUCT_SB16 0x0005 -#define AUDIO_PRODUCT_AWE32 0x0006 -#define AUDIO_PRODUCT_WSS 0x0007 -#define AUDIO_PRODUCT_ESS 0x0008 -#define AUDIO_PRODUCT_GUS 0x0009 -#define AUDIO_PRODUCT_GUSDB 0x000A -#define AUDIO_PRODUCT_GUSMAX 0x000B -#define AUDIO_PRODUCT_IWAVE 0x000C -#define AUDIO_PRODUCT_PAS 0x000D -#define AUDIO_PRODUCT_PAS16 0x000E -#define AUDIO_PRODUCT_ARIA 0x000F -#define AUDIO_PRODUCT_WINDOWS 0x0100 -#define AUDIO_PRODUCT_LINUX 0x0101 -#define AUDIO_PRODUCT_SPARC 0x0102 -#define AUDIO_PRODUCT_SGI 0x0103 -#define AUDIO_PRODUCT_DSOUND 0x0104 - -/* audio envelope bit fields */ -#define AUDIO_ENVELOPE_ON 0x0001 -#define AUDIO_ENVELOPE_SUSTAIN 0x0002 -#define AUDIO_ENVELOPE_LOOP 0x0004 - -/* audio pattern bit fields */ -#define AUDIO_PATTERN_PACKED 0x0080 -#define AUDIO_PATTERN_NOTE 0x0001 -#define AUDIO_PATTERN_SAMPLE 0x0002 -#define AUDIO_PATTERN_VOLUME 0x0004 -#define AUDIO_PATTERN_COMMAND 0x0008 -#define AUDIO_PATTERN_PARAMS 0x0010 - -/* audio module bit fields */ -#define AUDIO_MODULE_AMIGA 0x0000 -#define AUDIO_MODULE_LINEAR 0x0001 -#define AUDIO_MODULE_PANNING 0x8000 - -#pragma pack(1) - -/* audio capabilities structure */ -typedef struct { - WORD wProductId; /* product identifier */ - CHAR szProductName[30]; /* product name */ - DWORD dwFormats; /* formats supported */ -} AUDIOCAPS, *LPAUDIOCAPS; - -/* audio format structure */ -typedef struct { - UINT nDeviceId; /* device identifier */ - WORD wFormat; /* playback format */ - WORD nSampleRate; /* sampling frequency */ -} AUDIOINFO, *LPAUDIOINFO; - -/* audio waveform structure */ -typedef struct { - LPBYTE lpData; /* data pointer */ - DWORD dwHandle; /* waveform handle */ - DWORD dwLength; /* waveform length */ - DWORD dwLoopStart; /* loop start point */ - DWORD dwLoopEnd; /* loop end point */ - WORD nSampleRate; /* sampling rate */ - WORD wFormat; /* format bits */ -} AUDIOWAVE, *LPAUDIOWAVE; - - -/* audio envelope point structure */ -typedef struct { - WORD nFrame; /* envelope frame */ - WORD nValue; /* envelope value */ -} AUDIOPOINT, *LPAUDIOPOINT; - -/* audio envelope structure */ -typedef struct { - AUDIOPOINT aEnvelope[AUDIO_MAX_POINTS]; /* envelope points */ - BYTE nPoints; /* number of points */ - BYTE nSustain; /* sustain point */ - BYTE nLoopStart; /* loop start point */ - BYTE nLoopEnd; /* loop end point */ - WORD wFlags; /* envelope flags */ - WORD nSpeed; /* envelope speed */ -} AUDIOENVELOPE, *LPAUDIOENVELOPE; - -/* audio sample structure */ -typedef struct { - CHAR szSampleName[32]; /* sample name */ - BYTE nVolume; /* default volume */ - BYTE nPanning; /* default panning */ - BYTE nRelativeNote; /* relative note */ - BYTE nFinetune; /* finetune */ - AUDIOWAVE Wave; /* waveform handle */ -} AUDIOSAMPLE, *LPAUDIOSAMPLE; - -/* audio patch structure */ -typedef struct { - CHAR szPatchName[32]; /* patch name */ - BYTE aSampleNumber[AUDIO_MAX_NOTES]; /* multi-sample table */ - WORD nSamples; /* number of samples */ - BYTE nVibratoType; /* vibrato type */ - BYTE nVibratoSweep; /* vibrato sweep */ - BYTE nVibratoDepth; /* vibrato depth */ - BYTE nVibratoRate; /* vibrato rate */ - WORD nVolumeFadeout; /* volume fadeout */ - AUDIOENVELOPE Volume; /* volume envelope */ - AUDIOENVELOPE Panning; /* panning envelope */ - LPAUDIOSAMPLE aSampleTable; /* sample table */ -} AUDIOPATCH, *LPAUDIOPATCH; - -/* audio pattern structure */ -typedef struct { - WORD nPacking; /* packing type */ - WORD nTracks; /* number of tracks */ - WORD nRows; /* number of rows */ - WORD nSize; /* data size */ - LPBYTE lpData; /* data pointer */ -} AUDIOPATTERN, *LPAUDIOPATTERN; - -/* audio module structure */ -typedef struct { - CHAR szModuleName[32]; /* module name */ - WORD wFlags; /* module flags */ - WORD nOrders; /* number of orders */ - WORD nRestart; /* restart position */ - WORD nTracks; /* number of tracks */ - WORD nPatterns; /* number of patterns */ - WORD nPatches; /* number of patches */ - WORD nTempo; /* initial tempo */ - WORD nBPM; /* initial BPM */ - BYTE aOrderTable[AUDIO_MAX_ORDERS]; /* order table */ - BYTE aPanningTable[AUDIO_MAX_VOICES]; /* panning table */ - LPAUDIOPATTERN aPatternTable; /* pattern table */ - LPAUDIOPATCH aPatchTable; /* patch table */ -} AUDIOMODULE, *LPAUDIOMODULE; - -/* audio callback function defines */ -typedef VOID (AIAPI* LPFNAUDIOWAVE)(LPBYTE, UINT); -typedef VOID (AIAPI* LPFNAUDIOTIMER)(VOID); -typedef VOID (AIAPI* LPFNAUDIOCALLBACK)(BYTE, UINT, UINT); - -/* audio handle defines */ -typedef HANDLE HAC; -typedef HAC* LPHAC; - -#pragma pack() - - -/* audio interface API prototypes */ -UINT AIAPI AInitialize(VOID); -UINT AIAPI AGetVersion(VOID); -UINT AIAPI AGetAudioNumDevs(VOID); -UINT AIAPI AGetAudioDevCaps(UINT nDeviceId, LPAUDIOCAPS lpCaps); -UINT AIAPI AGetErrorText(UINT nErrorCode, LPSTR lpText, UINT nSize); - -UINT AIAPI APingAudio(LPUINT lpnDeviceId); -UINT AIAPI AOpenAudio(LPAUDIOINFO lpInfo); -UINT AIAPI ACloseAudio(VOID); -UINT AIAPI AUpdateAudio(VOID); - -UINT AIAPI AOpenVoices(UINT nVoices); -UINT AIAPI ACloseVoices(VOID); - -UINT AIAPI ASetAudioCallback(LPFNAUDIOWAVE lpfnAudioWave); -UINT AIAPI ASetAudioTimerProc(LPFNAUDIOTIMER lpfnAudioTimer); -UINT AIAPI ASetAudioTimerRate(UINT nTimerRate); - -LONG AIAPI AGetAudioDataAvail(VOID); -UINT AIAPI ACreateAudioData(LPAUDIOWAVE lpWave); -UINT AIAPI ADestroyAudioData(LPAUDIOWAVE lpWave); -UINT AIAPI AWriteAudioData(LPAUDIOWAVE lpWave, DWORD dwOffset, UINT nCount); - -UINT AIAPI ACreateAudioVoice(LPHAC lphVoice); -UINT AIAPI ADestroyAudioVoice(HAC hVoice); - -UINT AIAPI APlayVoice(HAC hVoice, LPAUDIOWAVE lpWave); -UINT AIAPI APrimeVoice(HAC hVoice, LPAUDIOWAVE lpWave); -UINT AIAPI AStartVoice(HAC hVoice); -UINT AIAPI AStopVoice(HAC hVoice); - -UINT AIAPI ASetVoicePosition(HAC hVoice, LONG dwPosition); -UINT AIAPI ASetVoiceFrequency(HAC hVoice, LONG dwFrequency); -UINT AIAPI ASetVoiceVolume(HAC hVoice, UINT nVolume); -UINT AIAPI ASetVoicePanning(HAC hVoice, UINT nPanning); - -UINT AIAPI AGetVoicePosition(HAC hVoice, LPLONG lpdwPosition); -UINT AIAPI AGetVoiceFrequency(HAC hVoice, LPLONG lpdwFrequency); -UINT AIAPI AGetVoiceVolume(HAC hVoice, LPUINT lpnVolume); -UINT AIAPI AGetVoicePanning(HAC hVoice, LPUINT lpnPanning); -UINT AIAPI AGetVoiceStatus(HAC hVoice, LPBOOL lpnStatus); - -UINT AIAPI APlayModule(LPAUDIOMODULE lpModule); -UINT AIAPI AStopModule(VOID); -UINT AIAPI APauseModule(VOID); -UINT AIAPI AResumeModule(VOID); -UINT AIAPI ASetModuleVolume(UINT nVolume); -UINT AIAPI ASetModulePosition(UINT nOrder, UINT nRow); -UINT AIAPI AGetModuleVolume(LPUINT lpnVolume); -UINT AIAPI AGetModulePosition(LPUINT pnOrder, LPUINT lpnRow); -UINT AIAPI AGetModuleStatus(LPBOOL lpnStatus); -UINT AIAPI ASetModuleCallback(LPFNAUDIOCALLBACK lpfnAudioCallback); - -UINT AIAPI ALoadModuleFile(LPSTR lpszFileName, - LPAUDIOMODULE* lplpModule, DWORD dwFileOffset); -UINT AIAPI AFreeModuleFile(LPAUDIOMODULE lpModule); - -UINT AIAPI ALoadWaveFile(LPSTR lpszFileName, - LPAUDIOWAVE* lplpWave, DWORD dwFileOffset); -UINT AIAPI AFreeWaveFile(LPAUDIOWAVE lpWave); - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/16/v2/source/verge/ENGINE/A_MEMORY.C b/16/v2/source/verge/ENGINE/A_MEMORY.C deleted file mode 100755 index 9ce7f4c8..00000000 --- a/16/v2/source/verge/ENGINE/A_MEMORY.C +++ /dev/null @@ -1,201 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include "verge.h" - -// ***** -// TODO: Move the chunk list from an array to a linked list? -// Would eliminate hardcoded chunk limit, but would make -// general operation slower. Probably not The Right Thing, -// sides the chunk limit can be interesting sometimes. If -// it becomes problematic, consider a Binary Tree. -// ***** - -// ***************************** Data ***************************** - -#define MAXCHUNKS 1000 -#define PARANOID -#define PADFILLVALUE 254 -#define PADSIZE 256 - -typedef struct -{ - void *pointer; - int size; - int owner; - char desc[40]; -} memblockType; - -memblockType chunks[MAXCHUNKS+1]; -int numchunks=0; - -// ***************************** Code ***************************** - -void *valloc(int amount, char *desc, int owner) -{ - if (numchunks == MAXCHUNKS) - err("Failed allocated %d bytes (%s), reason: Out of chunks.", - amount, desc); - -#ifdef PARANOID - CheckCorruption(); - chunks[numchunks].pointer = (void *) ((int) malloc(amount + (PADSIZE * 2)) + PADSIZE); - chunks[numchunks].size = amount; - memset((char *) chunks[numchunks].pointer - PADSIZE, PADFILLVALUE, PADSIZE); - memset((char *) chunks[numchunks].pointer + - chunks[numchunks].size, PADFILLVALUE, PADSIZE); -#else - chunks[numchunks].pointer = malloc(amount); - chunks[numchunks].size = amount; -#endif - chunks[numchunks].owner = owner; - strncpy(chunks[numchunks].desc, desc, 39); - return chunks[numchunks++].pointer; -} - -void *qvalloc(int amount) -{ - void *ptr; - - // Quick and dirty memory allocation. Should be used ONLY - // for temporary blocks in speed-critical loops. - - ptr = malloc(amount); - if (!ptr) err("qvalloc: Failed allocating %d bytes.", amount); - return ptr; -} - -void qvfree(void *ptr) -{ - free(ptr); -} - -int TotalBytesAllocated(void) -{ - int i, tally=0; - - for (i=0; is) - { - sprintf(strbuf,"File is in €%s~, index %d~",pack[f->v].mountname, f->i); - Con_Printf(strbuf); - sprintf(strbuf,"Packofs: %d~ current ofs: %d~",pack[f->v].files[f->i].packofs,pack[f->v].files[f->i].curofs); - Con_Printf(strbuf); - if (pack[f->v].files[f->i].extractable) - Con_Printf("File is extractable."); - else Con_Printf("File is not extractable."); - if (pack[f->v].files[f->i].override) - Con_Printf("Override allowed."); - else Con_Printf("Override not allowed."); - } - else Con_Printf("File is external."); - sprintf(strbuf,"File is %d~ bytes.",filesize(f)); - Con_Printf(strbuf); - vclose(f); -} - -void vid_mode() -{ int xres,yres; - - xres=atoi((char *)args[1]); - yres=atoi((char *)args[2]); - Con_NextLine(); - - ShutdownVideo(0); - if (InitVideo(xres, yres)) - { - Con_Printf("{||||||||||||}"); - Con_Printf("Loading new video driver..."); - Con_Printf(DriverDesc); - Con_Printf("{||||||||||||}"); - } - else Con_Printf("Unsupported/unknown video mode."); - set_intensity(63); -} - -void CPU_Usage() -{ - if (numargs==1) - { - sprintf(strbuf,"cpu_usage is %d~", cpu_watch); - Con_Printf(strbuf); - } - else cpu_watch=atoi((char *) args[1]); -} - -void Mount() -{ - MountVFile((char *) args[1]); - sprintf(strbuf,"%s mounted.",args[1]); - Con_Printf(strbuf); -} - -void ZeroConWarp(char **args) -{ - player->x=atoi(args[1])*16; - player->y=atoi(args[2])*16; - player->tx=atoi(args[1]); - player->ty=atoi(args[2]); -} - -void ZeroConBrowseTiles(void) -{ - int x,y,n,k=0,a=0; - - while(last_pressed!=SCAN_Q) - { - ClearScreen(); - UpdateControls(); - CheckMessages(); - if(last_pressed==SCAN_A) { if(a) a=0; else a=1; last_pressed=0; } - if(last_pressed==SCAN_DOWN&&(k+(ty-3)*(tx-3)-tx+4)0) - { - k-=tx-4; - last_pressed=0; - } - for(y=1; yx, player->y); Con_Printf(strbuf); - sprintf(strbuf,"xtc: ‚%d~ ytc: ‚%d~", player->x>>4, player->y>>4); Con_Printf(strbuf); -} - -void PlayerSpeed() -{ - if (!player) - { - Con_Printf("No player."); - return; - } - if (numargs==1) - { - Con_NextLine(); - sprintf(strbuf,"speed is is %d~", player->speed); - Con_Printf(strbuf); - } - else - { - player->speed=atoi((char *) args[1]); - player->speedct=0; - } -} - -void Player() -{ int i; - - i=atoi((char *) args[1]); - if (i', '?', 0, '*', 0, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0, - 0, 0, 1, 127, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 13, 0, '/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', 0, 0, 0, 0, 0 -}; - -#define NUMCMDS 31 -char *concmds[] = { - "CONSOLEBG","LISTMOUNTS","PACKINFO","LISTCMDS","CD_PLAY","CD_STOP", - "CD_OPEN","CD_CLOSE","EXIT","VID_MODE","CPU_USAGE","MOUNT","MAP", - "VER","BROWSETILES","WARP","CAMERATRACKING","RSTRING","SHOWOBS", - "PHANTOM","ENTITYSTAT","ACTIVEENTS","ENTITY","CURPOS","PLAYERSPEED", - "SPEEDDEMON","RV","SV","PLAYER","SPAWNENTITY","SHOWZONES" - }; -byte sortedcmds[NUMCMDS]; - -// ================================= Code ==================================== - -void SortConCmds(void) -/* -- ric: 03/Jun/98 -- - * creates the sorted index into concmds - */ -{ - int i,j; - int temp; - - for (i=0; i=i; j--) - if (strcmp(concmds[sortedcmds[j-1]],concmds[sortedcmds[j]])>0) - { - // swap the indices - temp=sortedcmds[j-1]; - sortedcmds[j-1]=sortedcmds[j]; - sortedcmds[j]=temp; - } - } -} - -void InitConsole(void) -{ - Logp("Initialize console."); - LoadFont("system.fnt"); - consolebg=VLoadImageBuf("console.gif"); - - consoletext=(char *) valloc(45*50, "consoletext", OID_MISC); - cmd=(byte *) valloc(40, "InitConsole:cmd", OID_MISC); - cmd2=(byte *) valloc(40, "InitConsole:cmd2", OID_MISC); - memset(cmd, 0, 40); - memset(cmd2, 0, 40); - memset(consoletext, 0, 2250); - - lastcmds=(char *) valloc(400, "InitConsole:lastcmds", OID_MISC); - memset(lastcmds, 0, 400); - - SortConCmds(); - LogDone(); -} - -void DrawConsole(); - -void Con_Printf(char *str) -{ char tbuf[2250]; - - // move buffer up a line - memcpy(tbuf, consoletext+50, 2200); - memcpy(consoletext, tbuf, 2200); - - memcpy(consoletext+2200, str, strlen(str)+1); - lines++; -} - -void Con_NextLine(void) -{ - Con_Printf(""); - lines=0; -} - -int ShowConsole(void) -{ - conlines+=2; - if (conlines > 120) - { - callback=0; - conlines=120; - } - return 0; -} - -int HideConsole(void) -{ - if (conlines > 3) - { - conlines-=2; - } - else - { - conlines=1; - callback=0; - } - return 0; -} - -void DrawConsole(void) -{ int i; - int tagline=0; - - lines=0; - tagline=conlines; - - Render(); - CopySpriteZoomClip(0,-120+tagline, 320,120, sx,120, consolebg); - - // write console text - - for (i=0; i<9; i++) - { - GotoXY(1, 1+(i*10)-(120-tagline)); - printstring(0,consoletext+((startln+i)*50)); - } - - GotoXY(1,101-(120-tagline)); - printstring(0,"]"); - printstring(0,(char *) cmd); - - if (systemtime>=cswtime) - { - cursor ^= 1; - cswtime = systemtime+40; - } - - if (cursor) printstring(0, "&"); - - if (startln<36) - { - GotoXY(1, 91-(120-tagline)); - printstring(0, "^ ^ ^ ^ ^ ^ ^ ^ ^ ^"); - } -} - -int Args(int num) -{ - if (numargs>=num) return 1; - sprintf(strbuf,"This function needs %d~ arguments.",num-1); - Con_Printf(strbuf); - return 0; -} - -void ListCmds(void) -{ int i; - - Con_NextLine(); - for (i=0; i ~"); } break; - case 16: CameraTracking(); break; - case 17: if (numargs==1) ZeroGetRString(); - if (numargs==2) ZeroSetRString((char**)args); break; - case 18: Obstructions(); break; - case 19: Phantom(); break; - case 20: EntityStat(); break; - case 21: ListActiveEnts(); break; - case 22: if (Args(2)) EntityS(); break; - case 23: CurPos(); break; - case 24: PlayerSpeed(); break; - case 25: speeddemon=1; break; - case 26: ReadVCVar(); break; - case 27: WriteVCVar(); break; - case 28: if (Args(2)) Player(); break; - case 29: if (Args(4)) SpawnEntity(); break; - case 30: ShowZones(); break; - case NUMCMDS: Con_Printf((char *) cmd); break; - } -} - -void ParseCommand(void) -{ byte *src; - // breaks the command string into arguements and stuff. (in cmd2) - - numargs=0; - src=(byte *) cmd2; - args[0]=src; - - while (*src==' ') src++; - - if (!*src) return; - - while (1) - { - if (*src==' ') - { - while (*src== ' ') - { - *src=0; - src++; - } - if (*src) - { - numargs++; - args[numargs]=src; - } - src--; - } - src++; - if (!*src) - { - numargs++; - return; - } - } -} - -void ProcessCommand(void) -{ byte i; - - memcpy(cmd2, cmd, 40); - strupr((char *) cmd2); - ParseCommand(); - - i=0; - while (i 1) - { - CheckMessages(); - DrawConsole(); - ShowPage(); - } - conlines=0; - key[SCAN_RQUOTA]=0; - timer_count=0; -} diff --git a/16/v2/source/verge/ENGINE/CONSOLE.H b/16/v2/source/verge/ENGINE/CONSOLE.H deleted file mode 100755 index e4e60907..00000000 --- a/16/v2/source/verge/ENGINE/CONSOLE.H +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef CONSOLE_H -#define CONSOLE_H - -#include "main.h" - -// -- externs -- - -extern byte *consolebg; // Console background image -extern byte *consoletext; // Console text buffer -extern byte *cmd, *cmd2, cmdlen; // command line buffer -extern char *lastcmds, numcmds, cmdpos; // last-command memory -extern byte *args[10], numargs; // command argument pointers -extern char cursor, more; // flag on/off cursor visible -extern int cswtime; // cursor switch time. -extern int conlines; // Number of visible lines -extern int lines; // number of lines entered since last draw -extern char startln; // Start display ofs (for scrollback) -extern char allowconsole; -extern char consoleoverride; - -extern byte key_ascii_tbl[128]; -extern byte key_shift_tbl[128]; - -extern char *concmds[]; - -// -- prototypes -- - -extern void InitConsole(void); -extern void Con_Printf(char *str); -extern void Con_NextLine(void); - -extern int ShowConsole(void); -extern int HideConsole(void); - -extern void DrawConsole(void); -extern int Args(int num); -extern void ListCmds(void); -extern void LastCmds(void); -extern void ExecuteCommand(int i); -extern void ParseCommand(void); -extern void ProcessCommand(void); -extern void CommandInput(void); -extern void ActivateConsole(void); - -#endif // CONSOLE_H diff --git a/16/v2/source/verge/ENGINE/CONTROLS.C b/16/v2/source/verge/ENGINE/CONTROLS.C deleted file mode 100755 index 728274a8..00000000 --- a/16/v2/source/verge/ENGINE/CONTROLS.C +++ /dev/null @@ -1,105 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "verge.h" - -// ================================= Data ==================================== - -// -- Hardware Dependent -- // - -int kb1, kb2, kb3, kb4; // keyboard controls -int jb1, jb2, jb3, jb4; // joystick controls - -// -- Unified Interface -- // - -char b1, b2, b3, b4; -char up, down, left, right; - -// -- UnPress support variables -- // - -char wb1, wb2, wb3, wb4; -char wup, wdown, wleft, wright; - -char rb1, rb2, rb3, rb4; -char rup, rdown, rleft, rright; - -// ================================= Code ==================================== - -void UpdateControls() -{ - rb1=0; rb2=0; rb3=0; rb4=0; - rup=0; rdown=0; rleft=0; rright=0; - - if (key[SCAN_UP]) rup=1; - if (key[SCAN_DOWN]) rdown=1; - if (key[SCAN_RIGHT]) rright=1; - if (key[SCAN_LEFT]) rleft=1; - - if (key[kb1]) rb1=1; - if (key[kb2]) rb2=1; - if (key[kb3]) rb3=1; - if (key[kb4]) rb4=1; - - if (wb1 && rb1) rb1=0; - else if (wb1 && !rb1) wb1=0; - b1=rb1; - - if (wb2 && rb2) rb2=0; - else if (wb2 && !rb2) wb2=0; - b2=rb2; - - if (wb3 && rb3) rb3=0; - else if (wb3 && !rb3) wb3=0; - b3=rb3; - - if (wb4 && rb4) rb4=0; - else if (wb4 && !rb4) wb4=0; - b4=rb4; - - if (wup && rup) rup=0; - else if (wup && !rup) wup=0; - up=rup; - - if (wdown && rdown) rdown=0; - else if (wdown && !rdown) wdown=0; - down=rdown; - - if (wleft && rleft) rleft=0; - else if (wleft && !rleft) wleft=0; - left=rleft; - - if (wright && rright) rright=0; - else if (wright && !rright) wright=0; - right=rright; -} - -void UnPress(int control) -{ - switch (control) - { - case 0: wb1=1; wb2=1; wb3=1; wb4=1; - b1=0; b2=0; b3=0; b4=0; - key[kb1]=0; key[kb2]=0; key[kb3]=0; key[kb4]=0; break; - case 1: wb1=1; b1=0; key[kb1]=0; break; - case 2: wb2=1; b2=0; key[kb2]=0; break; - case 3: wb3=1; b3=0; key[kb3]=0; break; - case 4: wb4=1; b4=0; key[kb4]=0; break; - case 5: wup=1; up=0; key[SCAN_UP]=0; break; - case 6: wdown=1; down=0; key[SCAN_DOWN]=0; break; - case 7: wleft=1; left=0; key[SCAN_LEFT]=0; break; - case 8: wright=1; right=0; key[SCAN_RIGHT]=0; break; - } -} diff --git a/16/v2/source/verge/ENGINE/CONTROLS.H b/16/v2/source/verge/ENGINE/CONTROLS.H deleted file mode 100755 index aabd402d..00000000 --- a/16/v2/source/verge/ENGINE/CONTROLS.H +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef CONTROL_H -#define CONTROL_H - -extern int kb1, kb2, kb3, kb4; -extern int jb1, jb2, jb3, jb4; - -extern char b1, b2, b3, b4; -extern char up, down, left, right; - -void UpdateControls(); -void UnPress(int); - -#endif diff --git a/16/v2/source/verge/ENGINE/ENGINE.C b/16/v2/source/verge/ENGINE/ENGINE.C deleted file mode 100755 index 13ca67cd..00000000 --- a/16/v2/source/verge/ENGINE/ENGINE.C +++ /dev/null @@ -1,746 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -// CHANGELOG: -// -// + added ScreenShot() on F11 -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - -#define ENGINE_H -#include "verge.h" - -// ================================= Data ==================================== - -typedef struct -{ - word start; // strand start - word finish; // strand end - word delay; // tile-switch delay - word mode; // tile-animation mode -} vspanim_r; - -typedef struct -{ - char pmultx,pdivx; // parallax multiplier/divisor for X - char pmulty,pdivy; // parallax multiplier/divisor for Y - unsigned short sizex, sizey; // layer dimensions. - unsigned char trans, hline; // transparency flag | hline (raster fx) -} layer_r; - -typedef struct -{ - char name[40]; // zone name/desc - unsigned short script; // script to call thingy - unsigned short percent; // chance of executing - unsigned short delay; // step-delay - unsigned short aaa; // Accept Adjacent Activation - unsigned short entityscript; // script to call for entities -} zoneinfo; - -zoneinfo zones[256]; // zone data records -layer_r layer[6]; // Array of layer data -vspanim_r vspanim[100]; // tile animation data -unsigned short vadelay[100]; // Tile animation delay ctr - -char mapname[60]; // MAP filename -char vspname[60]; // VSP filemap -char musname[60]; // MAP bkgrd music default filename -char rstring[20]; // render-order string -char numlayers; // number of layers in map -byte *obstruct, *zone; // obstruction and zone buffers -char layertoggle[8]; // layer visible toggles -word xstart, ystart; // MAP start x/y location -int bufsize; // how many bytes need to be written -int numzones; // number of active zones - -word *layers[6]; // Raw layer data -int xwin=0, ywin=0; // camera offset - -// -- vsp data -- - -byte *vsp=0,*vspmask; // VSP data buffer. -unsigned short numtiles; // number of tiles in VSP. -unsigned short *tileidx; // tile index thingamajig -char *flipped; // bi-direction looping flag - -// entity stuffs - -char *msbuf[100]; // ptr-table to script offset -char *ms; // script text buffer -byte nms; // number of movescripts - -char numfollowers=0; // number of party followers -byte follower[10]; // maximum of 10 followers. -char laststeps[10]={ 0 }; // record of last movements -int lastent; - -// -- stuff -- - -byte movegranularity; // means nothing now, please remove -byte movectr=0; - -byte phantom=0; // walk-through-walls -byte speeddemon=0; // doublespeed cheat -int bindarray[128]; // bind script offset - -// ================================= Code ==================================== - -void ReadCompressedLayer1(byte *dest, int len, char *buf) -{ - int j,n; - byte run, w; - - n=0; - do - { - w=*buf; buf++; - if (w==0xFF) - { - run=*buf; buf++; - w=*buf; buf++; - for (j=0; jtx, player->ty+1)) return 1; break; - case 1: if (ObstructionAt(player->tx, player->ty-1)) return 1; break; - case 2: if (ObstructionAt(player->tx-1, player->ty)) return 1; break; - case 3: if (ObstructionAt(player->tx+1, player->ty)) return 1; break; - } - switch (dir) - { - case 0: if (EntityObsAt(player->tx, player->ty+1)) return 1; break; - case 1: if (EntityObsAt(player->tx, player->ty-1)) return 1; break; - case 2: if (EntityObsAt(player->tx-1, player->ty)) return 1; break; - case 3: if (EntityObsAt(player->tx+1, player->ty)) return 1; break; - } - return 0; -} - -void CheckZone() -{ - int curzone; - static int lz=0, zonedelay=0; - - curzone=zone[(player->ty * layer[0].sizex) + player->tx]; - if (lz!=curzone) - { - zonedelay=0; - lz=curzone; - } - if (!zones[curzone].percent) return; - if (zonedelay < zones[curzone].delay) - { - zonedelay++; - return; - } - if (curzone) - if (zones[curzone].script && - zones[curzone].percent >= rnd(0,255)) - { - ExecuteEvent(zones[curzone].script); - zonedelay=0; - } -} - -int InvFace() -{ - switch(player -> facing) - { - case 0: return 1; - case 1: return 0; - case 2: return 3; - case 3: return 2; - } - return -1; -} - -void Activate() -{ - byte tz; - int ax=0, ay=0; - - switch(player->facing) - { - case 0: ax=player->tx; ay=player->ty+1; break; - case 1: ax=player->tx; ay=player->ty-1; break; - case 2: ax=player->tx-1; ay=player->ty; break; - case 3: ax=player->tx+1; ay=player->ty; break; - } - tz=zone[(ay*layer[0].sizex)+ax]; - if (zones[tz].aaa) - { - ExecuteEvent(zones[tz].script); - return; - } - if ((tz=EntityAt(ax, ay))) - { - tz--; - if (entity[tz].face) - { - entity[tz].facing=InvFace(); - AnimateEntity(&entity[tz]); - } - if (entity[tz].actscript) - { - lastent=tz; - ExecuteEvent(entity[tz].actscript); - } - } -} - -void ResetFollowers() -{ - int i; - - player->x=player->tx<<4; - player->y=player->ty<<4; - player->moving=0; - player->movecnt=0; - player->reset=1; - for (i=0; ix; - entity[follower[i]].y=player->y; - entity[follower[i]].tx=player->tx; - entity[follower[i]].ty=player->ty; - entity[follower[i]].facing=player->facing; - entity[follower[i]].reset=1; - } - memset(laststeps, 0, 10); -} - -void MoveFollowers() -{ - int i; - - for (i=0; ianimofs=chr[player->chrindex].uanim; - entity[follower[i]].delayct=0; - entity[follower[i]].reset=0; - } - entity[follower[i]].facing=laststeps[i+1]-1; - } -} - -//--- zero 5.7.99 - -void WritePalette(FILE *f) -{ char b; - int i; - byte pal3[768]; - - for (i=0; i<768; i++) - pal3[i]=pal2[i] << 2; - - b=12; fwrite(&b, 1, 1, f); - fwrite(pal3, 1, 768, f); -} - -void WritePCXLine(unsigned char *p,int len,FILE *pcxf) -{ int i; - unsigned char byt, samect, repcode; - - i=0; - do - { byt=p[i++]; - samect=1; - while (samect<(unsigned) 63 && i1 || (byt & 0xC0) != 0) - { - repcode=0xC0 | samect; - fwrite(&repcode,1,1,pcxf); - } - fwrite(&byt,1,1,pcxf); - } while (i16 colors - b1=1; fwrite(&b1, 1, 1, pcxf); // encoding always = 1 - b1=8; fwrite(&b1, 1, 1, pcxf); // 8 bits per pixel, for 256 colors - w1=0; fwrite(&w1, 1, 2, pcxf); // xmin = 0; - w1=0; fwrite(&w1, 1, 2, pcxf); // ymin = 0; - w1=sx-1; fwrite(&w1, 1, 2, pcxf); // xmax = 319; - w1=sy-1; fwrite(&w1, 1, 2, pcxf); // ymax = 199; - w1=sx; fwrite(&w1, 1, 2, pcxf); // hres = 320; - w1=sy; fwrite(&w1, 1, 2, pcxf); // vres = 200; - - fwrite(screen,1,48,pcxf); - - b1=0; fwrite(&b1, 1, 1, pcxf); // reserved always = 0. - b1=1; fwrite(&b1, 1, 1, pcxf); // number of color planes. Just 1 for 8bit. - w1=sx; fwrite(&w1, 1, 2, pcxf); // number of bytes per line - - w1=0; fwrite(&w1, 1, 1, pcxf); - fwrite(screen, 1, 59, pcxf); // filler - - for (w1=0; w1moving) - { - if (down && !PlayerObstructed(0)) - { - player->ty++; - player->moving=1; - player->movecnt=15; - player->y++; - if (player->reset || player->facing != 0) - { - player->animofs=chr[player->chrindex].danim; - player->delayct=0; - player->reset=0; - } - player->facing=0; - LastMove(1); - return; - } - if (up && !PlayerObstructed(1)) - { - player->ty--; - player->moving=2; - player->movecnt=15; - player->y--; - if (player->reset || player->facing != 1) - { - player->animofs=chr[player->chrindex].uanim; - player->delayct=0; - player->reset=0; - } - player->facing=1; - LastMove(2); - return; - } - if (left && !PlayerObstructed(2)) - { - player->tx--; - player->moving=3; - player->movecnt=15; - player->x--; - if (player->reset || player->facing != 2) - { - player->animofs=chr[player->chrindex].lanim; - player->delayct=0; - player->reset=0; - } - player->facing=2; - LastMove(3); - return; - } - if (right && !PlayerObstructed(3)) - { - player->tx++; - player->moving=4; - player->movecnt=15; - player->x++; - if (player->reset || player->facing != 3) - { - player->animofs=chr[player->chrindex].ranim; - player->delayct=0; - player->reset=0; - } - player->facing=3; - LastMove(4); - return; - } - if (down) player->facing=0; - if (up) player->facing=1; - if (left) player->facing=2; - if (right) player->facing=3; - } - - switch (player->moving) - { - case 0: player->reset=1; player->animofs=0; player->delayct=0; break; - case 1: player->y++; player->movecnt--; break; - case 2: player->y--; player->movecnt--; break; - case 3: player->x--; player->movecnt--; break; - case 4: player->x++; player->movecnt--; break; - } - if (!player->movecnt && player->moving) - { - player->moving=0; - CheckZone(); - } - if (!player->movecnt && b1) Activate(); -} - -void ProcessControls() -{ int i; - - if (key[SCAN_RQUOTA]) - { - key[SCAN_RQUOTA]=0; last_pressed=0; - ActivateConsole(); - } - if (key[SCAN_ALT] && key[SCAN_X]) err("Exiting: ALT-X pressed."); -//--- zero 5.7.99 - if (key[SCAN_F11]) - { - Message("ss",50); - ScreenShot(); - key[SCAN_F11]=0; - } -//--- - if (!player) return; - - if (player->speed<4) - { - switch (player->speed) - { - case 1: if (player->speedct<3) { player->speedct++; return; } break; - case 2: if (player->speedct<2) { player->speedct++; return; } break; - case 3: if (player->speedct<1) { player->speedct++; return; } break; - } - } - if (player->speed<5) - { - ProcessControls1(); - player->speedct=0; - AnimateEntity(player); - } - switch (player->speed) - { - case 5: for (i=0; i<2; i++) { ProcessControls1(); AnimateEntity(player); } return; - case 6: for (i=0; i<3; i++) { ProcessControls1(); AnimateEntity(player); } return; - case 7: for (i=0; i<4; i++) { ProcessControls1(); AnimateEntity(player); } return; - } -} - -void GameTick() -{ - UpdateControls(); - CheckMessages(); - if (bindarray[last_pressed]) - HookKey(bindarray[last_pressed]); - ProcessControls(); - if (speeddemon && key[SCAN_CTRL]) ProcessControls(); - ProcessEntities(); -} - diff --git a/16/v2/source/verge/ENGINE/ENGINE.H b/16/v2/source/verge/ENGINE/ENGINE.H deleted file mode 100755 index d65545fe..00000000 --- a/16/v2/source/verge/ENGINE/ENGINE.H +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -// CHANGELOG: -// -// + added ScreenShot() headers -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - -#ifndef ENGINE_H -#define ENGINE_H - -typedef struct -{ - word start; // strand start - word finish; // strand end - word delay; // tile-switch delay - word mode; // tile-animation mode -} vspanim_r; - -typedef struct -{ - char pmultx,pdivx; // parallax multiplier/divisor for X - char pmulty,pdivy; // parallax multiplier/divisor for Y - unsigned short sizex, sizey; // layer dimensions. - unsigned char trans, hline; // transparency flag | hline (raster fx) -} layer_r; - -typedef struct -{ - char name[40]; // zone name/desc - unsigned short script; // script to call thingy - unsigned short percent; // chance of executing - unsigned short delay; // step-delay - unsigned short aaa; // Accept Adjacent Activation - unsigned short entityscript; // script to call for entities -} zoneinfo; - -extern layer_r layer[4]; // Array of layer data -extern vspanim_r vspanim[100]; // tile animation data -extern unsigned short vadelay[100]; // Tile animation delay ctr - -extern char mapname[60]; // MAP filename -extern char vspname[60]; // VSP filemap -extern char rstring[20]; // render-order string -extern char numlayers; // number of layers in map -extern byte *obstruct, *zone; // obstruction and zone buffers -extern int bufsize; // how many bytes need to be written -extern char layertoggle[4]; // layer visible toggles - -extern word *layers[4]; // Raw layer data -extern int xwin, ywin; - -// -- entity things -- - -extern char *msbuf[100]; // ptr-table to script offset -extern char *ms; // script text buffer -extern byte nms; // number of movescripts - -extern char numfollowers; // number of party followers -extern byte follower[10]; // maximum of 10 followers. -extern char laststeps[10]; // record of last movements -extern int lastent; - -// -- vsp data -- - -extern byte *vsp,*vspmask; // VSP data buffer. -extern unsigned short numtiles; // number of tiles in VSP. -extern unsigned short *tileidx; // tile index thingamajig -extern char *flipped; // bi-direction looping flag -extern byte movegranularity, phantom, speeddemon, movectr; -extern int bindarray[128]; - -// -- prototypes -- - -extern void LoadVSP(char *fname); -extern void FreeVSP(void); -extern void LoadMAP(char *fname); -extern void FreeMAP(void); -extern void MAPswitch(void); -extern void MAPstats(void); -extern void ProcessControls(void); -extern void GameTick(void); - -extern void ReadCompressedLayer1(byte*, int, char*); - -//--- zero 5.7.99 -void WritePalette(FILE *f); -void WritePCXLine(unsigned char *p,int len,FILE *pcxf); -void ScreenShot(); -// -#endif // ENGINE_H diff --git a/16/v2/source/verge/ENGINE/ENTITY.C b/16/v2/source/verge/ENGINE/ENTITY.C deleted file mode 100755 index add3758a..00000000 --- a/16/v2/source/verge/ENGINE/ENTITY.C +++ /dev/null @@ -1,716 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -// CHANGELOG: -// -// + corrected oversight in movement script management by sticking a hack in -// MoveScript(). Bug caused Fx commands to not work sometimes. -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -#define ENTITY_H -#include "verge.h" - -// ================================= Data ==================================== - -typedef struct -{ - int x, y; // xwc, ywx position - word tx, ty; // xtc, ytc position - byte facing; // direction entity is facing - byte moving, movecnt; // direction entity is moving - byte frame; // bottom-line frame to display - byte specframe; // special-frame set thingo - byte chrindex, reset; // CHR index | Reset animation - byte obsmode1, obsmode2; // can be obstructed | Is an obstruction - byte speed, speedct; // entity speed, speedcount :) - byte delayct; // animation frame-delay - char *animofs, *scriptofs; // anim script | move script - byte face, actm; // auto-face | activation mode - byte movecode, movescript; // movement type | movement script - byte ctr, mode; // sub-tile move ctr, mode flag (internal) - word step, delay; // step, delay - word stepctr, delayctr; // internal use counters - word data1, data2, data3; // - word data4, data5, data6; // - int actscript; // activation script - int expand1, expand2; // - int expand3, expand4; // - char desc[20]; // Entity description. -} entity_r; - -typedef struct -{ - byte *imagedata; // CHR frame data - int fxsize, fysize; // frame x/y dimensions - int hx, hy; // x/y obstruction hotspot - int totalframes; // total # of frames. - int lidle, ridle; - int uidle, didle; - char lanim[100]; - char ranim[100]; - char uanim[100]; - char danim[100]; -} chrdata; - -typedef struct -{ - char t[60]; -} chrlist_r; - -chrlist_r chrlist[100]; -byte nmchr,playernum; -entity_r *player=0; -entity_r entity[256]; -byte entities=0; -chrdata chr[100]; -byte numchrs=0; -byte entidx[256], cc; -byte movesuccess; - -// ================================= Code ==================================== - -int ObstructionAt(int tx, int ty) -{ - if (obstruct[(ty*layer[0].sizex)+tx]) return 1; - if (tx==-1 || ty==-1) return 1; - if (tx==layer[0].sizex || ty==layer[0].sizey) return 1; - return 0; -} - -int Zone(int tx, int ty) -{ - return zone[(ty*layer[0].sizex)+tx]; -} - -void LoadCHR(char *fname, chrdata *c) -{ - VFILE *f; - char b, *ptr=0; - int i; - - f=vopen(fname); - if (!f) err("Could not open CHR file %s.",fname); - vread(&b, 1, f); - if (b!=2) err("CHR %s incorrect CHR format version.",fname); - vread(&c->fxsize, 2, f); - vread(&c->fysize, 2, f); - vread(&c->hx, 2, f); - vread(&c->hy, 2, f); - vread(strbuf, 4, f); // skip the hotspot size. - vread(&c->totalframes, 2, f); - - vread(&i, 4, f); - ptr=(char *) valloc(i, "LoadCHR:ptr", OID_TEMP); - vread(ptr, i, f); - c->imagedata=(byte *) valloc(c->fxsize * c->fysize * c->totalframes, "LoadCHR:c->imagedata", OID_IMAGE); - ReadCompressedLayer1(c->imagedata, c->fxsize * c->fysize * c->totalframes, ptr); - vfree(ptr); - - - vread(&c->lidle, 4, f); - vread(&c->ridle, 4, f); - vread(&c->uidle, 4, f); - vread(&c->didle, 4, f); - - for (b=0; b<4; b++) - { - switch (b) - { - case 0: ptr=c->lanim; break; - case 1: ptr=c->ranim; break; - case 2: ptr=c->uanim; break; - case 3: ptr=c->danim; break; - } - vread(&i, 4, f); - if (i>100) err("Animation strand too long. %d",i); - vread(ptr, i, f); - } - vclose(f); -} - -int CacheCHR(char *fname) -{ - LoadCHR(fname, &chr[numchrs]); - numchrs++; - return (numchrs-1); -} - -void FreeCHRList() -{ - int i; - - for (i=0; i=numchrs) return; - b=entity[i].specframe ? entity[i].specframe : entity[i].frame; - TCopySpriteClip(dx-chr[a].hx, dy-chr[a].hy, chr[a].fxsize, chr[a].fysize, - (byte *) (chr[a].imagedata+(b*chr[a].fxsize* - chr[a].fysize))); -} - -static int cmpent(const void* a, const void* b) -{ - return entity[*(byte*)a].y - entity[*(byte*)b].y; -} - -void RenderEntities() -{ - int i; - - qsort(entidx, cc, 1, cmpent); - for (i=0; ianimofs==' ') p->animofs++; - while (*p->animofs>=48 && *p->animofs<=57) - { - token[j]=*p->animofs; - p->animofs++; - j++; - } - token[j]=0; - return atoi(token); -} - -void GetNextCommand(entity_r *p) -{ - byte s; - - while (*p->animofs==' ') p->animofs++; - s=*p->animofs; - p->animofs++; - switch (s) - { - case 'F': p->frame=GetArg(p); break; - case 'W': p->delayct=GetArg(p); break; - case 0: if (p->moving) - switch (p->facing) - { - case 0: p->animofs=chr[p->chrindex].danim; break; - case 1: p->animofs=chr[p->chrindex].uanim; break; - case 2: p->animofs=chr[p->chrindex].lanim; break; - case 3: p->animofs=chr[p->chrindex].ranim; break; - } - else - switch (p->facing) - { - case 0: p->animofs=0; p->frame=chr[p->chrindex].didle; break; - case 1: p->animofs=0; p->frame=chr[p->chrindex].uidle; break; - case 2: p->animofs=0; p->frame=chr[p->chrindex].lidle; break; - case 3: p->animofs=0; p->frame=chr[p->chrindex].ridle; break; - } - p->delayct=0; break; - } -} - -void AnimateEntity(entity_r *p) -{ - if (!p->animofs && p->moving) - { - switch (p->facing) - { - case 0: p->animofs=chr[p->chrindex].danim; break; - case 1: p->animofs=chr[p->chrindex].uanim; break; - case 2: p->animofs=chr[p->chrindex].lanim; break; - case 3: p->animofs=chr[p->chrindex].ranim; break; - } - p->delayct=0; - } - if (!p->animofs && !p->moving) - { - switch (p->facing) - { - case 0: p->animofs=0; p->frame=chr[p->chrindex].didle; break; - case 1: p->animofs=0; p->frame=chr[p->chrindex].uidle; break; - case 2: p->animofs=0; p->frame=chr[p->chrindex].lidle; break; - case 3: p->animofs=0; p->frame=chr[p->chrindex].ridle; break; - } - p->delayct=0; - } - if (p->delayct) - { - p->delayct--; - } - else GetNextCommand(p); -} - -int EntityAt(int ex, int ey) -{ int i; - - for (i=0; isx+chr[entity[i].chrindex].fxsize) continue; - if (dy<0 || dy>sy+chr[entity[i].chrindex].fysize) continue; - entidx[cc]=i; cc++; - } -} - -void MoveRight(int i) -{ - int tx,ty; - - tx=entity[i].tx+1; ty=entity[i].ty; - if (entity[i].obsmode1 && (ObstructionAt(tx,ty) || AEntityObsAt(tx,ty))) - { movesuccess=0; return; } - if (entity[i].facing!=3) - { - entity[i].delayct=0; - entity[i].animofs=0; - } - entity[i].x++; entity[i].facing=3; entity[i].moving=4; entity[i].ctr=15; - entity[i].tx++; movesuccess=1; entity[i].reset=0; -} - -void MoveLeft(int i) -{ - int tx, ty; - - tx=entity[i].tx-1; ty=entity[i].ty; - if (entity[i].obsmode1 && (ObstructionAt(tx,ty) || AEntityObsAt(tx,ty))) - { movesuccess=0; return; } - - if (entity[i].facing!=2) - { - entity[i].delayct=0; - entity[i].animofs=0; - } - entity[i].x--; entity[i].facing=2; entity[i].moving=3; entity[i].ctr=15; - entity[i].tx--; movesuccess=1; entity[i].reset=0; -} - -void MoveUp(int i) -{ - int tx, ty; - - tx=entity[i].tx; ty=entity[i].ty-1; - if (entity[i].obsmode1 && (ObstructionAt(tx,ty) || AEntityObsAt(tx,ty))) - { movesuccess=0; return; } - if (entity[i].facing!=1) - { - entity[i].delayct=0; - entity[i].animofs=0; - } - entity[i].y--; entity[i].facing=1; entity[i].moving=2; entity[i].ctr=15; - entity[i].ty--; movesuccess=1; entity[i].reset=0; -} - -void MoveDown(int i) -{ - int tx, ty; - - tx=entity[i].tx; ty=entity[i].ty+1; - if (entity[i].obsmode1 && (ObstructionAt(tx,ty) || AEntityObsAt(tx,ty))) - { movesuccess=0; return; } - if (entity[i].facing!=0) - { - entity[i].delayct=0; - entity[i].animofs=0; - } - entity[i].y++; entity[i].facing=0; entity[i].moving=1; entity[i].ctr=15; - entity[i].ty++; movesuccess=1; entity[i].reset=0; -} - -void Wander1(int i) -{ - if (!entity[i].data1) - { - entity[i].data2=rnd(0,3); - entity[i].data1=entity[i].step+1; - } - if (entity[i].data1==1) - { - entity[i].delayctr++; - if (entity[i].delayctr>=entity[i].delay) - entity[i].data1=0; - return; - } - if (entity[i].data1>1) - { - switch(entity[i].data2) - { - case 0: MoveUp(i); break; - case 1: MoveDown(i); break; - case 2: MoveLeft(i); break; - case 3: MoveRight(i); break; - } - entity[i].data1--; - if (entity[i].data1==1) - { - entity[i].delayctr=0; - entity[i].animofs=0; - entity[i].delayct=0; - } - } -} - -void Wander2(int i) -{ - if (!entity[i].data1) - { - entity[i].data3=rnd(0,3); - entity[i].data1=entity[i].step+1; - } - if (entity[i].data1==1) - { - entity[i].delayctr++; - if (entity[i].delayctr>=entity[i].delay) - entity[i].data1=0; - return; - } - if (entity[i].data1>1) - { - switch(entity[i].data3) - { - case 0: if (Zone(entity[i].tx,entity[i].ty-1)==entity[i].data2) MoveUp(i); break; - case 1: if (Zone(entity[i].tx,entity[i].ty+1)==entity[i].data2) MoveDown(i); break; - case 2: if (Zone(entity[i].tx-1,entity[i].ty)==entity[i].data2) MoveLeft(i); break; - case 3: if (Zone(entity[i].tx+1,entity[i].ty)==entity[i].data2) MoveRight(i); break; - } - entity[i].data1--; - if (entity[i].data1==1) entity[i].delayctr=0; - } -} - -void Wander3(int i) -{ - if (!entity[i].data1) - { - entity[i].data2=rnd(0,3); - entity[i].data1=entity[i].step+1; - } - if (entity[i].data1==1) - { - entity[i].delayctr++; - if (entity[i].delayctr>=entity[i].delay) - entity[i].data1=0; - return; - } - if (entity[i].data1>1) - { - switch(entity[i].data2) - { - case 0: if (entity[i].ty>entity[i].data3) MoveUp(i); break; - case 1: if (entity[i].tyentity[i].data2) MoveLeft(i); break; - case 3: if (entity[i].tx=48 && *entity[i].scriptofs<=57) - { - token[j]=*entity[i].scriptofs; - entity[i].scriptofs++; - j++; - } - token[j]=0; - entity[i].data1=atoi(token); -} - -void GetNextCommandMS(int i) -{ unsigned char s; - - Whitespace(i); - s=*entity[i].scriptofs; - entity[i].scriptofs++; - switch (s) - { - case 'U': entity[i].mode=1; GetArgMS(i); break; - case 'D': entity[i].mode=2; GetArgMS(i); break; - case 'L': entity[i].mode=3; GetArgMS(i); break; - case 'R': entity[i].mode=4; GetArgMS(i); break; - case 'S': entity[i].mode=5; GetArgMS(i); break; - case 'W': entity[i].mode=6; GetArgMS(i); entity[i].animofs=0; - entity[i].delayct=0; break; - case 0: switch (entity[i].facing) - { - case 0: entity[i].animofs=0; entity[i].frame=chr[entity[i].chrindex].didle; break; - case 1: entity[i].animofs=0; entity[i].frame=chr[entity[i].chrindex].uidle; break; - case 2: entity[i].animofs=0; entity[i].frame=chr[entity[i].chrindex].lidle; break; - case 3: entity[i].animofs=0; entity[i].frame=chr[entity[i].chrindex].ridle; break; - } - entity[i].movecode=0; entity[i].mode=7; entity[i].data1=0; - entity[i].scriptofs=0; entity[i].delayct=0; break; - case 'C': entity[i].mode=8; GetArgMS(i); break; - case 'B': entity[i].mode=9; break; - case 'X': entity[i].mode=10; GetArgMS(i); break; - case 'Y': entity[i].mode=11; GetArgMS(i); break; - case 'F': entity[i].mode=12; GetArgMS(i); break; - case 'Z': entity[i].mode=13; GetArgMS(i); break; - default: err("Invalid entity movement script."); - } -} - -void MoveScript(int i) -{ - if (!entity[i].scriptofs) entity[i].scriptofs=(char *) (int) ms+(int) msbuf[entity[i].movescript]; - if (!entity[i].mode) GetNextCommandMS(i); - - switch(entity[i].mode) - { - case 1: MoveUp(i); if (movesuccess) entity[i].data1--; break; - case 2: MoveDown(i); if (movesuccess) entity[i].data1--; break; - case 3: MoveLeft(i); if (movesuccess) entity[i].data1--; break; - case 4: MoveRight(i); if (movesuccess) entity[i].data1--; break; - case 5: entity[i].speed=entity[i].data1; entity[i].data1=0; break; - case 6: entity[i].data1--; break; - case 7: return; - case 8: ExecuteEvent(entity[i].data1); entity[i].data1=0; break; - case 9: entity[i].scriptofs=(char *) (int) ms+(int) msbuf[entity[i].movescript]; - entity[i].data1=0; break; - case 10: if (entity[i].txentity[i].data1) MoveLeft(i); - if (entity[i].tx==entity[i].data1) entity[i].data1=0; break; - break; - case 11: if (entity[i].tyentity[i].data1) MoveUp(i); - if (entity[i].ty==entity[i].data1) entity[i].data1=0; break; - break; - case 12: entity[i].facing=entity[i].data1; - entity[i].data1=0; - //--- zero 5.6.99 - switch(entity[i].facing) - { - case 0: entity[i].frame=chr[entity[i].chrindex].didle; break; - case 1: entity[i].frame=chr[entity[i].chrindex].uidle; break; - case 2: entity[i].frame=chr[entity[i].chrindex].lidle; break; - case 3: entity[i].frame=chr[entity[i].chrindex].ridle; break; - } - //--- - break; - case 13: entity[i].specframe=entity[i].data1; - entity[i].data1=0; break; - } - if (!entity[i].data1) entity[i].mode=0; -} - -void TestActive(int i) -{ - int dx, dy; - - dx=abs(entity[i].x - player->x); - dy=abs(entity[i].y - player->y); - if ((dx<=16 && dy<=3) || (dx<=3 && dy<=16)) - { - if (!entity[i].expand4 && !invc) - { - entity[i].expand4=1; - ExecuteEvent(entity[i].actscript); - } - } - else - entity[i].expand4=0; -} - -void ProcessEntity1(int i) -{ - entity[i].speedct=0; - if (entity[i].actm) TestActive(i); - - if (!entity[i].moving) - { - switch(entity[i].movecode) - { - case 0: return; - case 1: Wander1(i); break; - case 2: Wander2(i); break; - case 3: Wander3(i); break; - case 4: MoveScript(i); break; - default: err("unknown entity movement pattern."); - } - if (!entity[i].reset) return; - } - - if (entity[i].reset) - { - entity[i].animofs=0; - entity[i].delayct=0; - entity[i].reset=0; - } - - if (entity[i].moving) - { - if (entity[i].moving==1) - { entity[i].y++; entity[i].ctr--; AnimateEntity(&entity[i]); } - if (entity[i].moving==2) - { entity[i].y--; entity[i].ctr--; AnimateEntity(&entity[i]); } - if (entity[i].moving==4) - { entity[i].x++; entity[i].ctr--; AnimateEntity(&entity[i]); } - if (entity[i].moving==3) - { entity[i].x--; entity[i].ctr--; AnimateEntity(&entity[i]); } - if (!entity[i].ctr) { entity[i].reset=1; entity[i].moving=0; } - } -} - -void ProcessEntity(int i) -{ int j; - - if (player==&entity[i]) return; - if (entity[i].speed<4) - { - switch (entity[i].speed) - { - case 1: if (entity[i].speedct<3) { entity[i].speedct++; return; } - case 2: if (entity[i].speedct<2) { entity[i].speedct++; return; } - case 3: if (entity[i].speedct<1) { entity[i].speedct++; return; } - } - } - if (entity[i].speed<5) - { - ProcessEntity1(i); - entity[i].speedct=0; - } - switch (entity[i].speed) - { - case 5: for (j=0; j<2; j++) { ProcessEntity1(i); } return; - case 6: for (j=0; j<3; j++) { ProcessEntity1(i); } return; - case 7: for (j=0; j<4; j++) { ProcessEntity1(i); } return; - } -} - -void ProcessEntities() -{ - int i; - - SiftEntities(); - for (i=0; i -#include -#include -#include "verge.h" - -// ================================= Data ==================================== - -#ifndef __WATCOMC__ -#define INT_MAX 0xFFFFFFFF -#define INT_MIN 0 -#endif - -#ifndef MIN -#define MIN(x,y) (((x) < (y)) ? (x) : (y)) -#define MAX(x,y) (((x) > (y)) ? (x) : (y)) -#define MID(x,y,z) MAX((x), MIN((y), (z))) -#endif - -#ifndef ABS -#define ABS(x) (((x) >= 0) ? (x) : (-(x))) -#endif - -#ifndef SGN -#define SGN(x) (((x) >= 0) ? 1 : -1) -#endif - -#define FLI_MAGIC 0xAF11 // file header magic number -#define FLC_MAGIC 0xAF12 // file magic number (Pro) -#define FLI_FRAME_MAGIC 0xF1FA // frame header magic number -#define FLI_FRAME_PREFIX 0xF100 // FLC's prefix info -#define FLI_FRAME_USELESS 0x00A1 // FLC's garbage frame - -typedef struct -{ - int w,h; - byte *data; -} BITMAP; - -#define FLI_OK 0 /* FLI player return values */ -#define FLI_EOF -1 -#define FLI_ERROR -2 -#define FLI_NOT_OPEN -3 - -#ifdef __WATCOMC__ -#define PACKED -#pragma pack(1); -#endif - -#ifdef __DJGPP__ -#define PACKED __attribute__ ((packed)) -#endif - -typedef struct -{ - long size PACKED; - word type PACKED; - word frame_count PACKED; - word width PACKED; - word height PACKED; - word bpp PACKED; - word flags PACKED; - word speed PACKED; - long next_head PACKED; - long frames_in_table PACKED; - char reserved[102] PACKED; -} FLI_HEADER; - -typedef struct -{ - quad size PACKED; - word type PACKED; - word chunks PACKED; - char pad[8] PACKED; -} FLI_FRAME; - -typedef struct -{ - quad size PACKED; - word type PACKED; -} FLI_CHUNK; - -#ifdef __WATCOMC__ -#pragma pack(); -#endif - -static int fli_status = FLI_NOT_OPEN; // current state of the FLI player - -int fli_bitmap_width = 0; -int fli_bitmap_height = 0; -byte *fli_bitmap_data = NULL; // current frame of the FLI -byte fli_palette[768]; // current palette the FLI is using - -int fli_bmp_dirty_from = INT_MAX; // what part of fli_bitmap is dirty -int fli_bmp_dirty_to = INT_MIN; -int fli_pal_dirty_from = INT_MAX; // what part of fli_palette is dirty -int fli_pal_dirty_to = INT_MIN; - -int fli_frame = 0; // current frame number in the FLI -long speed; - -static int fli_file = 0; // the file we are reading - -static byte *fli_mem_data = NULL; // the memory FLI we are playing -static int fli_mem_pos = 0; // position in the memory FLI - -static FLI_HEADER fli_header; // header structure -static FLI_FRAME frame_header; // frame header structure - -// a block of temporary working memory -byte *_scratch_mem = NULL; -int _scratch_mem_size = 0; - -// ================================= Code ==================================== - -void reset_fli_variables(void); -void close_fli(void); -int next_fli_frame(int); -int open_fli(char *); -int open_memory_fli(byte *); - -void _grow_scratch_mem(int size) -{ - if (size > _scratch_mem_size) { - size = (size+1023) & 0xFFFFFC00; - _scratch_mem = realloc(_scratch_mem, size); - _scratch_mem_size = size; - } -} - -void vsync() -{ - while (!(inp(986) & 8)); -} - -void set_palette_range(byte *pal, int from, int to, int sync) -{ - int i; - - // swap? - if (to=256) to=255; - - if (sync) vsync(); - - outp(968, from); - for (i=from; i<=to; i++) - { - outp(969, pal[(i*3)+0]); - outp(969, pal[(i*3)+1]); - outp(969, pal[(i*3)+2]); - } -} - -static byte *fli_read(byte *buf, int size) -{ - int result; - - if (fli_mem_data) - { - if (buf) - memcpy(buf, fli_mem_data+fli_mem_pos, size); - else - buf = fli_mem_data+fli_mem_pos; - - fli_mem_pos += size; - } - else - { - if (!buf) - { - _grow_scratch_mem(size); - buf = _scratch_mem; - } - - result = read(fli_file, buf, size); - if (result != size) - return NULL; - } - return buf; -} - -static void fli_seek(int offset, int mode) -{ - if (fli_mem_data) - { - if (mode == SEEK_CUR) - fli_mem_pos += offset; - else - fli_mem_pos = offset; - } - else - lseek(fli_file, offset, mode); -} - -// helpers for reading FLI chunk data -#define READ_BYTE() ((sz-- > 0) ? *(((byte *)p)++) : 0) -#define READ_CHAR() ((sz-- > 0) ? *(((signed char *)p)++) : 0) -#define READ_SHORT() (((sz-=2) > 0) ? *(((signed short *)p)++) : 0) - -#define READ_BLOCK(pos, size) \ - { \ - if (sz >= (size)) \ - { \ - memcpy(pos, p, size); \ - p += (size); \ - sz -= (size); \ - } \ - else \ - { \ - char *_p = (char *)(pos); \ - int _c; \ - \ - for (_c=0; _c < (size); _c++) \ - *(_p++) = READ_BYTE(); \ - } \ - } - -#define READ_RLE_BYTE(pos, size) \ - { \ - memset(pos, READ_BYTE(), size); \ - } - -#define READ_RLE_WORD(pos, size) \ - { \ - short *_p = (short *)(pos); \ - short _v = READ_SHORT(); \ - int _c; \ - \ - for (_c=0; _c < (size); _c++) \ - *(_p++) = _v; \ - } - -static void do_fli_256_color(byte *p, int sz) -{ - int packets; - int c, c2; - int offset; - int length; - - offset = 0; - packets = READ_SHORT(); - for (c=0; c 0) - { - packets = READ_SHORT(); - - while (packets < 0) - { - if (packets & 0x4000) - y -= packets; - else - fli_bitmap_data[(y*fli_bitmap_width)+fli_bitmap_width-1]=packets&0xff; - //fli_bitmap->line[y][fli_bitmap->w-1] = packets & 0xFF; - - packets = READ_SHORT(); - } - x=0; - while (packets-- > 0) - { - // skip bytes - x += READ_BYTE(); - - size = READ_CHAR(); - - // copy size words - if (size > 0) - { - READ_BLOCK(fli_bitmap_data+(y*fli_bitmap_width)+x, size*2); - //READ_BLOCK(fli_bitmap->line[y]+x, size*2); - x += size*2; - } - // repeat word -size times - else if (size < 0) - { - READ_RLE_WORD(fli_bitmap_data+(y*fli_bitmap_width)+x, -size); - //READ_RLE_WORD(fli_bitmap->line[y]+x, -size); - x -= size*2; - } - } - fli_bmp_dirty_from = MIN(fli_bmp_dirty_from, y); - fli_bmp_dirty_to = MAX(fli_bmp_dirty_to, y); - y++; - } -} - -static void do_fli_color(byte *p, int sz) -{ - int packets; - int c, c2; - int offset; - int length; - - offset = 0; - packets = READ_SHORT(); - - for (c=0; c 0) - { - packets = READ_BYTE(); - x = 0; - while (packets-- > 0) - { - x += READ_BYTE(); - size = READ_CHAR(); - - // copy size bytes - if (size > 0) - { - READ_BLOCK(fli_bitmap_data+(y*fli_bitmap_width)+x, size); - //READ_BLOCK(fli_bitmap->line[y]+x, size); - x += size; - } - else if (size < 0) - { - READ_RLE_BYTE(fli_bitmap_data+(y*fli_bitmap_width)+x, -size); - //READ_RLE_BYTE(fli_bitmap->line[y]+x, -size); - x -= size; - } - } - y++; - } -} - -static void do_fli_black(byte *p, int sz) -{ - memset(fli_bitmap_data, 0, fli_bitmap_width*fli_bitmap_height); - //clear(fli_bitmap); - - fli_bmp_dirty_from = 0; - fli_bmp_dirty_to = fli_bitmap_height-1; -} - -static void do_fli_brun(byte *p, int sz) -{ - int packets; - int size; - int x, y; - - // for each line... - for (y=0; y 0) - { - size = READ_CHAR(); - if (size < 0) - { - READ_BLOCK(fli_bitmap_data+(y*fli_bitmap_width)+x, -size); - //READ_BLOCK(fli_bitmap->line[y]+x, -size); - x -= size; - } - // repeat byte size times - else if (size > 0) - { - READ_RLE_BYTE(fli_bitmap_data+(y*fli_bitmap_width)+x, size); - //READ_RLE_BYTE(fli_bitmap->line[y]+x, size); - x += size; - } - } - } - fli_bmp_dirty_from = 0; - fli_bmp_dirty_to = fli_bitmap_height-1; -} - -static void do_fli_copy(byte *p, int sz) -{ - READ_BLOCK(fli_bitmap_data, fli_bitmap_width * fli_bitmap_height); - //READ_BLOCK(fli_bitmap->dat, fli_bitmap->w * fli_bitmap->h); - - fli_bmp_dirty_from = 0; - fli_bmp_dirty_to = fli_bitmap_height-1; -} - -static void read_frame() -{ - byte *p; - FLI_CHUNK *chunk; - int c, sz; - - if (fli_status != FLI_OK) - return; - -get_another_frame: - if (!fli_read((byte *)&frame_header, sizeof(FLI_FRAME))) - { - fli_status = FLI_ERROR; - return; - } - - if ((frame_header.type == FLI_FRAME_PREFIX) - || (frame_header.type == FLI_FRAME_USELESS)) - { - fli_seek(frame_header.size-sizeof(FLI_FRAME), SEEK_CUR); - fli_frame++; - - goto get_another_frame; - } - - if (frame_header.type != FLI_FRAME_MAGIC) - { - fli_status = FLI_ERROR; - return; - } - - if (frame_header.size == sizeof(FLI_FRAME)) - { - fli_frame++; - return; - } - p = fli_read(NULL, frame_header.size-sizeof(FLI_FRAME)); - if (!p) - { - fli_status = FLI_ERROR; - return; - } - for (c=0; csize - sizeof(FLI_CHUNK); - p += sizeof(FLI_CHUNK); - switch (chunk->type) - { - case 4: do_fli_256_color(p, sz); break; - case 7: do_fli_delta(p, sz); break; - case 11: do_fli_color(p, sz); break; - case 12: do_fli_lc(p, sz); break; - case 13: do_fli_black(p, sz); break; - case 15: do_fli_brun(p, sz); break; - case 16: do_fli_copy(p, sz); break; - default: err("Corrupt FLI chunk."); - } - p = ((byte *)chunk) + chunk->size; - } - fli_frame++; -} - -static int do_play_fli(BITMAP *bmp, int loop, int (*callback)()) -{ - int ret; - - ret = next_fli_frame(loop); - while (ret == FLI_OK) - { - if (fli_pal_dirty_from <= fli_pal_dirty_to) - set_palette_range(fli_palette, fli_pal_dirty_from, fli_pal_dirty_to, 1); - - if (fli_bmp_dirty_from <= fli_bmp_dirty_to) - { - int i,to=fli_bmp_dirty_to; - if (to>=bmp->h) to=bmp->h-1; - -// vsync(); - for (i=fli_bmp_dirty_from; i<=to; i++) - { - memcpy(bmp->data+(i*bmp->w), fli_bitmap_data+(i*fli_bitmap_width), - (fli_bitmap_width>bmp->w) ? bmp->w : fli_bitmap_width); - } - - //blit( - // fli_bitmap, bmp, 0, fli_bmp_dirty_from, 0, fli_bmp_dirty_from, - // fli_bitmap->w, 1+fli_bmp_dirty_to-fli_bmp_dirty_from); - } - - reset_fli_variables(); - - if (callback) - { - ret = (*callback)(); - if (ret != FLI_OK) - break; - } - ret = next_fli_frame(loop); - while (timer_count= fli_header.frame_count) - { - if (loop) - { - fli_seek(sizeof(FLI_HEADER), SEEK_SET); - fli_frame = 0; - } - else - { - fli_status = FLI_EOF; - return fli_status; - } - } - read_frame(); - return fli_status; -} - -void reset_fli_variables() -{ - fli_bmp_dirty_from = INT_MAX; - fli_bmp_dirty_to = INT_MIN; - fli_pal_dirty_from = INT_MAX; - fli_pal_dirty_to = INT_MIN; -} diff --git a/16/v2/source/verge/ENGINE/FLI.H b/16/v2/source/verge/ENGINE/FLI.H deleted file mode 100755 index b18995b4..00000000 --- a/16/v2/source/verge/ENGINE/FLI.H +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef FLI_H -#define FLI_H - -typedef struct -{ - int w,h; - byte *data; -} BITMAP; - -int play_fli(char *filename, BITMAP *bmp, int loop, int (*callback)()); -int play_memory_fli(byte *fli_data, BITMAP *bmp, int loop, int (*callback)()); -#endif diff --git a/16/v2/source/verge/ENGINE/FONT.C b/16/v2/source/verge/ENGINE/FONT.C deleted file mode 100755 index d9621ae4..00000000 --- a/16/v2/source/verge/ENGINE/FONT.C +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define FONT_H -#include "verge.h" - -// ================================= Data ==================================== - -struct fontstruct -{ - byte width, height; // Font character dimensions - byte *data; // Font bitmap data -}; - -struct fontstruct font[10]; // Font stuff; -int numfonts=0; // number of loaded fonts. -int curx, cury; // x/y font location -char tc=0; // text color - -// ================================= Code ==================================== - -int LoadFont(char *fname) -{ VFILE *f=0; - struct fontstruct *cfont=0; - int z=0; - - if (!(f=vopen(fname))) - err("Could not open font %s. \n",fname); - - // alias current font struct - cfont=font+numfonts; - - if (vgetc(f) != 1) - err("Font file incorrect version number. \n"); - - // font dims - cfont->width=vgetw(f); - cfont->height=vgetw(f); - - // get num of sub-set; calc total bytes as well - z=vgetw(f) * 96 * cfont->width*cfont->height; - - // nab room for font and read it in - cfont->data=(byte *)valloc(z, "LoadFont:cfont->data", OID_IMAGE); - vread(cfont->data, z, f); - - vclose(f); - - return numfonts++; -} - -void TextColor(int c) -{ - tc=c; -} - -void GotoXY(int x, int y) -{ - curx=x; - cury=y; -} - -static void pchar(int fnt, int x, int y, unsigned char c) -{ - int w; - if (c>31 && c<127) - { - w=font[fnt].width,h=font[fnt].height; - TCopySpriteClip(x,y, w,h, font[fnt].data+((c-32)*w*h)+((tc&3)*96*w*h)); - } -} - -void printstring(int fnt, char *str) -{ - if (fnt<0 || fnt >= numfonts) - return; - for (; *str; str++) - { - unsigned char c=*str; - switch (c) - { - case 126: tc=0; str++; continue; - case 128: tc=1; str++; continue; - case 129: tc=2; str++; continue; - case 130: tc=3; str++; continue; - } - pchar(fnt,curx,cury,c); - curx+=font[fnt].width; - } -} \ No newline at end of file diff --git a/16/v2/source/verge/ENGINE/FONT.H b/16/v2/source/verge/ENGINE/FONT.H deleted file mode 100755 index f8300c2d..00000000 --- a/16/v2/source/verge/ENGINE/FONT.H +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef FONT_H -#define FONT_H - -struct fontstruct -{ - byte width, height; // Font character dimensions - byte *data; // Font bitmap data -}; - -extern struct fontstruct font[10]; // Font stuff; -extern int numfonts; // number of loaded fonts. -extern int curx, cury; - -extern int LoadFont(char *fname); -extern void TextColor(int c); -extern void NumColor(int c); -extern void GotoXY(int x, int y); -extern void printstring(int fnt, char *str); -extern void dec_to_asciiz(int num, char *buf); - -#endif // FONT_H diff --git a/16/v2/source/verge/ENGINE/IMAGE.C b/16/v2/source/verge/ENGINE/IMAGE.C deleted file mode 100755 index 25c57ec4..00000000 --- a/16/v2/source/verge/ENGINE/IMAGE.C +++ /dev/null @@ -1,709 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// Mega kudos to aen for porting that GIF code. - -#include -#include "verge.h" - -// ========================= PCX Imaging routines ============================ - -char manufacturer; // pcx header -char version; -char encoding; -char bits_per_pixel; -word xmin, ymin; -word xmax, ymax; -word hres, vres; -char palette[48]; -char reserved; -char color_planes; -word bytes_per_line; -word palette_type; -char filler[58]; - -word width, depth; -word bytes; -byte c, run, ss=0; -quad vidoffset, n=0; -VFILE *pcxf; -char *cb,*src; -int i; - -// ================================= Code ==================================== - -void ReadPCXLine(byte *dest) -{ n=0; - while (n=0xc0) //(c & 0xc0)==0xc0) - { - run=c & 0x3f; - c=vgetc(pcxf); //*src++; - } - while (run--) - dest[vidoffset+n++]=c; - } - vseek(pcxf, bytes_per_line-width, 1); -} - -void LoadPCXHeader(char *fname) -{ - if (!(pcxf=vopen(fname))) err("Could not open PCX file %s.",fname); - vread(&manufacturer,1,pcxf); - vread(&version,1,pcxf); - vread(&encoding,1,pcxf); - vread(&bits_per_pixel,1,pcxf); - vread(&xmin,2,pcxf); - vread(&ymin,2,pcxf); - vread(&xmax,2,pcxf); - vread(&ymax,2,pcxf); - vread(&hres,2,pcxf); - vread(&vres,2,pcxf); - vread(&palette,48,pcxf); - vread(&reserved,1,pcxf); - vread(&color_planes,1,pcxf); - vread(&bytes_per_line,2,pcxf); - vread(&palette_type,2,pcxf); - vread(&filler,58,pcxf); - //vseek(pcxf,filesize(pcxf)-768,SEEK_SET); - //vread(&pal,768,pcxf); - vseek(pcxf,128L,SEEK_SET); - width=xmax-xmin+1; - depth=ymax-ymin+1; - - bytes=bytes_per_line; - - //for (i=0; i<768; i++) - // pal[i]=pal[i] >> 2; -// SetPalette((byte *) &pal); - - //i=filesize(pcxf); - //cb=(char *) valloc(i-896, "LoadPCXHeader:cb", OID_TEMP); - //vread(cb, i-(128+768+1), pcxf); -} - -void LoadPCXHeaderNP(char *fname) -{ - if (!(pcxf=vopen(fname))) err("Could not open PCX file %s.",fname); - vread(&manufacturer,1,pcxf); - vread(&version,1,pcxf); - vread(&encoding,1,pcxf); - vread(&bits_per_pixel,1,pcxf); - vread(&xmin,2,pcxf); - vread(&ymin,2,pcxf); - vread(&xmax,2,pcxf); - vread(&ymax,2,pcxf); - vread(&hres,2,pcxf); - vread(&vres,2,pcxf); - vread(&palette,48,pcxf); - vread(&reserved,1,pcxf); - vread(&color_planes,1,pcxf); - vread(&bytes_per_line,2,pcxf); - vread(&palette_type,2,pcxf); - vread(&filler,58,pcxf); - vseek(pcxf,filesize(pcxf)-768,SEEK_SET); - vread(&pal,768,pcxf); - vseek(pcxf,128L,SEEK_SET); - width=xmax-xmin+1; - depth=ymax-ymin+1; - bytes=bytes_per_line; - - i=filesize(pcxf); - cb=(char *) valloc(i-896, "LoadPCXHeaderNP:cb", OID_TEMP); - vread(cb, i-896, pcxf); -} - -void LoadPCX(char *fname, byte *dest) -{ - LoadPCXHeader(fname); - - src=cb; - for (i=0; i>=2; - } - //vfree(cb); - vclose(pcxf); - return buf; -} - -// ========================= BMP Imaging routines ============================ - -struct RGBQUAD -{ - unsigned char r,g,b,a; -}; - -struct RGBQUAD bmppalette[256]; - -// ================================= Code ==================================== - -byte *LoadBMPBuf(char *fname) -{ byte pad[4], *buf; - VFILE* bmpfile; - int bwidth, bheight, y; - - if (!(bmpfile=vopen(fname))) err("Could not open BMP file %s.",fname); - vseek(bmpfile, 18, SEEK_SET); - vread(&bwidth, 4, bmpfile); width=bwidth; - vread(&bheight, 4, bmpfile); depth=bheight; - vseek(bmpfile, 54, SEEK_SET); - vread(bmppalette, 1024, bmpfile); - buf=(byte*) valloc(bwidth*bheight, "LoadBMPBuf:buf", OID_IMAGE); - - for (y=bheight-1; y>=0; y--) - { - vread((char *)((int)buf+y*width),width,bmpfile); - vread(pad,width%4,bmpfile); - } - for (y=0; y<256; y++) - { - pal[y*3]=bmppalette[y].b >> 2; - pal[y*3+1]=bmppalette[y].g >> 2; - pal[y*3+2]=bmppalette[y].r >> 2; - } - SetPalette((byte*)pal); - vclose(bmpfile); - return buf; -} - -// ========================== GIF Imaging routines =========================== - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned long u32; - -typedef signed char s8; -typedef signed short s16; -typedef signed long s32; - -typedef struct -{ - u8 bits; - u8 background; - u8 * palette; - u8 * image; - s16 wide, deep; -} gif_image_info; - -typedef struct -{ - char sig[7]; - s16 screenwide, screendeep; - u8 hflags; - u8 background; - u8 aspect; -} gif_header; - -typedef struct -{ - s16 top, left; - s16 wide, deep; - u8 iflags; -} gif_image_descriptor; - -int NO_CODE = -1,// TRUE = 1, - ERROR_EOF = 0, ERROR_BAD_CODE = 1, - ERROR_BAD_HEADER = 2, ERROR_BAD_STARTCODE = 3, - ERROR_BAD_FIRST_CODE = 4, ERROR_BAD_FILE = 5, - ERROR_NO_IMAGE = 6; - -char* gif_error_messages[] = -{ - "Unexpected end of file\n", - "Bad code\n", - "Bad gif header\n", - "Bad symbol size\n", - "Bad first code\n", - "Error opening file\n", - "This file doesn't contain an image\n" -}; - -// read colour palette, vga palette values are 6 bit numbers -// while gif allows for 8 bit so shift right to get correct colours - -u8* gif_read_palette(FILE* fp, s32 bytes) -{ - s32 i = 0; - u8* block = 0L; - s32 components = (bytes / 3) * 3; - - block = (unsigned char *)valloc(components, "gif_read_palette:block", OID_IMAGE); - - for (i = 0; i < components; ++i) - block[i] = fgetc(fp) >> 2; - - return block; -} - -// read a block of bytes into memory -s32 block_mem_read(FILE* fp, u8* buffer, s32 bytes) -{ - s32 status = 0; - - status = fread(buffer, 1, bytes, fp); - if (status != bytes) return EOF; - - return TRUE; -} - -// read a unsigned 16 bit value from file, low byte first; note that this -// is reverse endian-ness (ie. fwrite(&s,1,2,fp); writes high byte first). - -s16 read_word_lbf(FILE* fp) -{ - s32 a, b; - - a = fgetc(fp); - b = fgetc(fp); - - return (b << 8) | a; -} - -// read the GIF file header structure into a sequence -gif_header* get_gif_header(FILE* fp) -{ - gif_header* h = 0L; - - h = (gif_header *)valloc(sizeof(gif_header), "get_gif_header:h", OID_IMAGE); - - fread(h->sig, 1, 6, fp); - h->sig[6] = 0; - - if (strncmp(h->sig, "GIF", 3) != 0) - return NULL; - - h->screenwide = read_word_lbf(fp); width=h->screenwide; - h->screendeep = read_word_lbf(fp); depth=h->screendeep; - h->hflags = fgetc(fp); - h->background = fgetc(fp); - h->aspect = fgetc(fp); - - return h; -} - -// gif file can contain more than one image, -// each image is preceeded by a header structure -gif_image_descriptor* get_image_descriptor(FILE* fp) -{ - gif_image_descriptor* id = 0L; - - id = (gif_image_descriptor *)valloc(sizeof(gif_image_descriptor), "get_image_descriptor:id", OID_IMAGE); - - id->left = read_word_lbf(fp); - id->top = read_word_lbf(fp); - id->wide = read_word_lbf(fp); - id->deep = read_word_lbf(fp); - id->iflags = fgetc(fp); - - return id; -} - -static u16 word_mask_table[] = -{ - 0x0000, 0x0001, 0x0003, 0x0007, - 0x000F, 0x001F, 0x003F, 0x007F, - 0x00FF, 0x01FF, 0x03FF, 0x07FF, - 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF -}; - -static u8 inc_table[] = { 8,8,4,2,0 }; -static u8 start_table[] = { 0,4,2,1,0 }; - -// enables me to use indices as per EUPHORiA (ie. converts to C's 0 base) -#define eui(i) ((i)-1) - -// unpack an LZW compressed image -// returns a sequence containing screen display lines of the image -u8* unpack_image(FILE* fp, s32 start_code_size, u32 width, u32 depth, u32 flags) -{ - u8* buffer; - u8* line_buffer; - - u16 first_code_stack[4096]; - u16 last_code_stack[4096]; - u16 code_stack[4096]; - - s32 bits_left; - s32 clear_code; - s32 code_size; - s32 code_size2; - s32 next_code; - s32 this_code; - s32 old_token; - s32 current_code; - s32 old_code; - s32 block_size=0; - s32 line; - s32 a_byte; - s32 pass; - s32 u; - - u8 b[256]; // read buffer; for block reads - u8* p; // current byte in read buffer - u8* q; // last byte in read buffer + 1 - - line_buffer = (u8 *)valloc(width, "unpack_image:line_buffer", OID_TEMP); - buffer = (u8 *)valloc(width * depth, "unpack_image:buffer", OID_IMAGE); - - a_byte = 0; - line = 0; - pass = 0; - bits_left = 8; - - if (start_code_size < 2 || start_code_size > 8) - err("\nERROR_BAD_STARTCODE"); // bad symbol size - - p = b; - q = b; - - clear_code = 1 << start_code_size; //pow(2, start_code_size); - next_code = clear_code + 2; - code_size = start_code_size + 1; - code_size2 = 1 << code_size; //pow(2, code_size); - old_code = NO_CODE; - old_token = NO_CODE; - - while (1) - { - if (bits_left == 8) - { - ++p; - if (p >= q) - { - block_size = fgetc(fp); - if (block_mem_read(fp, b, block_size) == EOF) - err("\nERROR_EOF"); - p = b; - q = b + block_size; - } - bits_left = 0; - } - - this_code = *p; - current_code = code_size + bits_left; - - if (current_code <= 8) - { - *p = *p >> code_size; - bits_left = current_code; - } - else - { - ++p; - if (p >= q) - { - block_size = fgetc(fp); - if (block_mem_read(fp, b, block_size) == EOF) - err("\nERROR_EOF"); - p = b; - q = b + block_size; - } - - this_code |= (*p << (8 - bits_left)); - - if (current_code <= 16) - { - bits_left = current_code - 8; - *p = *p >> bits_left; - } - else - { - if (++p >= q) - { - block_size = fgetc(fp); - if (block_mem_read(fp, b, block_size) == EOF) - err("\nERROR_EOF"); - p = b; - q = b + block_size; - } - - this_code |= (*p << (16 - bits_left)); - - bits_left = current_code - 16; - *p = *p >> bits_left; - } - } - - this_code &= word_mask_table[code_size]; - current_code = this_code; - - if (this_code == (clear_code+1) || block_size == 0) - break; - if (this_code > next_code) - err("\nERROR_BAD_CODE"); - - if (this_code == clear_code) - { - next_code = clear_code + 2; - code_size = start_code_size + 1; - code_size2 = 1 << code_size; //pow(2, code_size); - old_code = NO_CODE; - old_token = NO_CODE; - } - else - { - u = 1; - if (this_code == next_code) - { - if (old_code == NO_CODE) - err("\nERROR_BAD_FIRST_CODE"); - - first_code_stack[eui(u)] = old_token; - u++; - this_code = old_code; - } - - while (this_code >= clear_code) - { - first_code_stack[eui(u)] = last_code_stack[eui(this_code)]; - u++; - this_code = code_stack[eui(this_code)]; - } - - old_token = this_code; - while (1) - { - line_buffer[a_byte] = this_code; - a_byte++; - if (a_byte >= width) - { - // full image line so add it into screen image - memcpy(buffer + (line * width), line_buffer, width); - - a_byte = 0; - if (flags & 0x40) - { - line += inc_table[pass]; - if (line >= depth) - { - pass++; - line = start_table[pass]; - } - } - else - { - line++; - } - } - - // no more bytes on stack - if (u == 1) break; - - u--; - this_code = first_code_stack[eui(u)]; - } - - if (next_code < 4096 && old_code != NO_CODE) - { - code_stack[eui(next_code)] = old_code; - last_code_stack[eui(next_code)] = old_token; - next_code++; - if (next_code >= code_size2 && code_size < 12) - { - code_size++; - code_size2 = 1 << code_size; //pow(2, code_size); - } - } - - old_code = current_code; - } - } - - // completed reading the image so return it - free(b); - return buffer; -} - -// skip the extension blocks as we are only after the image -void skip_extension(FILE* fp) -{ - s32 n; - char temp[256]; - - n = fgetc(fp); // throwaway extension function code - n = fgetc(fp); // get length of block - - while (n > 0 && n != EOF) - { - // throwaway block - fread(temp, 1, n, fp); - - n = fgetc(fp); // get length of next block - } -} - -// unpack the GIF file -// returns ImageInfo sequence containing image and image data -gif_image_info* unpack_gif(char* filename) -{ - VFILE *f; - FILE* fp; - s32 c, b; - gif_header* h = 0L; - gif_image_info* ii = 0L; - gif_image_descriptor* id = 0L; - u8* local_palette = 0L; - - ii = (gif_image_info *)valloc(sizeof(gif_image_info), "unpack_gif:ii", OID_IMAGE); - - f = vopen(filename); - if (!f) err("Could not open GIF file %s.",filename); - fp = f->fp; - if (!fp) err("\nBad filename"); - - // file starts with the Logical Screen Descriptor structure - h = get_gif_header(fp); - - // Size of Global Color Table - ii->bits = (h->hflags & 7) + 1; - ii->background = h->background; - - // get Global colour palette if there is one - if (h->hflags & 0x80) // is flags bit 8 set? - { - c = 3 << ii->bits; // size of global colour map - ii->palette = gif_read_palette(fp, c); - -/* outp(968, 0); - // enforce global color map - for (s32 i=0; i < 768; ++i) - outp(969, ii->palette[i]); */ - memcpy(pal, ii->palette, 768); - } - - c = fgetc(fp); - - while (c == 0x2c || c == 0x21 || c == 0) - { - // image separator so unpack the image - if (c == 0x2c) - { - id = get_image_descriptor(fp); // get the Image Descriptor - // if there is a local Color Table then overwrite the global table - if (id->iflags & 0x80) - { - ii->bits = (id->iflags & 7) + 1; - b = 3 << ii->bits; - if (local_palette) - free(local_palette); - local_palette = gif_read_palette(fp, b); - } - - c = fgetc(fp); // get the LZW Minimum Code Size - ii->image = unpack_image(fp, c, id->wide, id->deep, id->iflags); - vclose(f); - - // error reading image - if (!ii->image) - err("\nerror reading image data"); - - ii->wide = id->wide; - ii->deep = id->deep; - - // return imagedata - return ii; - } - // extension introducer - else if (c == 0x21) - { - skip_extension(fp); // throw the extension away - } - - c = fgetc(fp); - } - - // no image? - return NULL; -} - -byte *LoadGIFBuf(char *fname) -{ - gif_image_info *ii=0; - byte *t; - - ii=unpack_gif(fname); - width=ii->wide; - depth=ii->deep; - t=ii->image; - free(ii); - return t; -} - -// ====================== Universal Imaging Interface ======================== - -byte imagetype; - -// ================================= Code ==================================== - -void DetermineFileType(char *fname) -{ - strlwr(fname); - if (!strcmp(fname+(strlen(fname)-3),"pcx")) imagetype=0; - if (!strcmp(fname+(strlen(fname)-3),"gif")) imagetype=1; - if (!strcmp(fname+(strlen(fname)-3),"bmp")) imagetype=2; -} - -void VLoadImage(char *fname, byte *dest) -{ - imagetype=255; - DetermineFileType(fname); - switch (imagetype) - { - case 0: LoadPCX(fname, dest); break; - case 1: err("VLoadImage() for GIF not supported; use VLoadImageBuf()"); break; - case 2: err("VLoadImage() for BMP not supported; use VLoadImageBuf()"); break; - default: err("%s: Unrecognized image type.",fname); - } -} - -byte *VLoadImageBuf(char *fname) -{ - imagetype=255; - DetermineFileType(fname); - switch (imagetype) - { - case 0: return LoadPCXBuf(fname); break; - case 1: return LoadGIFBuf(fname); break; - case 2: return LoadBMPBuf(fname); break; - default: err("%s: Unrecognized image type.",fname); - } - return 0; -} diff --git a/16/v2/source/verge/ENGINE/IMAGE.H b/16/v2/source/verge/ENGINE/IMAGE.H deleted file mode 100755 index 5b0ac2bc..00000000 --- a/16/v2/source/verge/ENGINE/IMAGE.H +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef IMAGE_H -#define IMAGE_H - -word width, depth; - -void VLoadImage(char *fname, byte *dest); -byte *VLoadImageBuf(char *fname); - -#endif diff --git a/16/v2/source/verge/ENGINE/INTER.H b/16/v2/source/verge/ENGINE/INTER.H deleted file mode 100755 index 93bc667c..00000000 --- a/16/v2/source/verge/ENGINE/INTER.H +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(INTERINC) -#define INTERINC - -#ifdef __WATCOMC__ - #include - #define REGISTERS union REGS - #define SET_AX(r,v) (r).w.ax=(short)(v) - #define SET_BX(r,v) (r).w.bx=(short)(v) - #define SET_CX(r,v) (r).w.cx=(short)(v) - #define SET_DX(r,v) (r).w.dx=(short)(v) - #define INTERRUPT(i,r) int386((i),&(r),&(r)) -#elif defined(__DJGPP__) - #include - #define REGISTERS __dpmi_regs - #define SET_AX(r,v) (r).x.ax=(short)(v) - #define SET_BX(r,v) (r).x.bx=(short)(v) - #define SET_CX(r,v) (r).x.cx=(short)(v) - #define SET_DX(r,v) (r).x.dx=(short)(v) - #define INTERRUPT(i,r) __dpmi_int((i),&(r)) -// #define inp inportb - #define outp outportb - #define outpw outportw -#endif // watcom | djgpp - -#endif // INTERINC diff --git a/16/v2/source/verge/ENGINE/KEYBOARD.H b/16/v2/source/verge/ENGINE/KEYBOARD.H deleted file mode 100755 index e39d3296..00000000 --- a/16/v2/source/verge/ENGINE/KEYBOARD.H +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef KEYBOARD_H -#define KEYBOARD_H - -extern volatile byte key[128]; -extern volatile byte last_pressed; -extern int InitKeyboard(void); -extern void ShutdownKeyboard(void); -#ifdef DJGPP -extern void keyboard_chain(int toggle); -#endif - -/* Constants for keyboard scan-codes */ - -#define SCAN_ESC 0x01 -#define SCAN_1 0x02 -#define SCAN_2 0x03 -#define SCAN_3 0x04 -#define SCAN_4 0x05 -#define SCAN_5 0x06 -#define SCAN_6 0x07 -#define SCAN_7 0x08 -#define SCAN_8 0x09 -#define SCAN_9 0x0a -#define SCAN_0 0x0b -#define SCAN_MINUS 0x0c -#define SCAN_EQUALS 0x0d -#define SCAN_BACKSP 0x0e -#define SCAN_TAB 0x0f -#define SCAN_Q 0x10 -#define SCAN_W 0x11 -#define SCAN_E 0x12 -#define SCAN_R 0x13 -#define SCAN_T 0x14 -#define SCAN_Y 0x15 -#define SCAN_U 0x16 -#define SCAN_I 0x17 -#define SCAN_O 0x18 -#define SCAN_P 0x19 -#define SCAN_LANGLE 0x1a -#define SCAN_RANGLE 0x1b -#define SCAN_ENTER 0x1c -#define SCAN_CTRL 0x1d -#define SCAN_A 0x1e -#define SCAN_S 0x1f -#define SCAN_D 0x20 -#define SCAN_F 0x21 -#define SCAN_G 0x22 -#define SCAN_H 0x23 -#define SCAN_J 0x24 -#define SCAN_K 0x25 -#define SCAN_L 0x26 -#define SCAN_SCOLON 0x27 -#define SCAN_QUOTA 0x28 -#define SCAN_RQUOTA 0x29 -#define SCAN_LSHIFT 0x2a -#define SCAN_BSLASH 0x2b -#define SCAN_Z 0x2c -#define SCAN_X 0x2d -#define SCAN_C 0x2e -#define SCAN_V 0x2f -#define SCAN_B 0x30 -#define SCAN_N 0x31 -#define SCAN_M 0x32 -#define SCAN_COMA 0x33 -#define SCAN_DOT 0x34 -#define SCAN_SLASH 0x35 -#define SCAN_RSHIFT 0x36 -#define SCAN_GREY_STAR 0x37 -#define SCAN_ALT 0x38 -#define SCAN_SPACE 0x39 -#define SCAN_CAPS 0x3a -#define SCAN_F1 0x3b -#define SCAN_F2 0x3c -#define SCAN_F3 0x3d -#define SCAN_F4 0x3e -#define SCAN_F5 0x3f -#define SCAN_F6 0x40 -#define SCAN_F7 0x41 -#define SCAN_F8 0x42 -#define SCAN_F9 0x43 -#define SCAN_F10 0x44 -#define SCAN_NUMLOCK 0x45 -#define SCAN_SCRLOCK 0x46 -#define SCAN_HOME 0x47 -#define SCAN_UP 0x48 -#define SCAN_PGUP 0x49 -#define SCAN_GREY_MINUS 0x4a -#define SCAN_LEFT 0x4b -#define SCAN_PAD_5 0x4c -#define SCAN_RIGHT 0x4d -#define SCAN_GREY_PLUS 0x4e -#define SCAN_END 0x4f -#define SCAN_DOWN 0x50 -#define SCAN_PGDN 0x51 -#define SCAN_INSERT 0x52 -#define SCAN_DEL 0x53 -#define SCAN_F11 0x57 -#define SCAN_F12 0x58 -#endif diff --git a/16/v2/source/verge/ENGINE/KEYBOARD.S b/16/v2/source/verge/ENGINE/KEYBOARD.S deleted file mode 100755 index a781cded..00000000 --- a/16/v2/source/verge/ENGINE/KEYBOARD.S +++ /dev/null @@ -1,227 +0,0 @@ -# -# Copyright (C) 1998 BJ Eirich (aka vecna) -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU General Public Lic -# See the GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - - .file "keyboard.s" - - .extern ___djgpp_base_address - .extern ___djgpp_ds_alias - .extern ___djgpp_dos_sel - - # public functions and variables: - - .global _key - .global _InitKeyboard - .global _ShutdownKeyboard - .global _keyboard_chain - .global _last_pressed - - .text - - .align 4 - -locking_region_start: - -_key: .space 0x80, 0 -_last_pressed: .byte 0 -old_vector: -old_vector_ofs: .long 0 -old_vector_sel: .word 0 -chain_flag: .long 1 - - - .align 4 - -handler_procedure: - - # - # .. will be called every time a key is pressed/released - # - pushl %eax - pushl %edx - pushw %ds - # - # Load DS with our data selector - # - movw %cs:___djgpp_ds_alias, %ds - # - # Read the scancode from keyboard port and update key[] - # - inb $0x60, %al - movb %al, %dl - andl $0x7f, %edx - testb $0x80, %al - setz _key(%edx) - cmp $127, %al - ja nolastpressed - movb %edx, _last_pressed -nolastpressed: - - # - # Chain if flag is set, otherwise do what's necessary and return - # - cmpl $0, chain_flag - jne handler_chain - # - # Acknowledge keyboard and interrupt contollers - # - inb $0x61, %al - orb $0x80, %al - outb %al, $0x61 - andb $0x7f, %al - outb %al, $0x61 - movb $0x20, %al - outb %al, $0x20 - - popw %ds - popl %edx - popl %eax - sti - iret - - .align 4 - -handler_chain: popw %ds - popl %edx - popl %eax - ljmp %cs:(old_vector) - -locking_region_end: - - - .align 4 -_InitKeyboard: - - # - # int keyboard_init(void); - # - # Initializes the keyboard handler and hooks the keyboard interrupt. - # Returns -1 on failure, zero on success - # - pushl %esi - pushl %edi - pushl %ebx - # - # First, we need to lock the handler and memory it touches, so - # it doesn't get swapped out to disk. - # - leal locking_region_start, %ecx - leal locking_region_end, %edi - subl %ecx, %edi - addl ___djgpp_base_address, %ecx - shldl $16, %ecx, %ebx # ecx -> bx:cx - shldl $16, %edi, %esi # edi -> si:di - movw $0x0600, %ax # lock linear region - int $0x31 - jc init_error - # - # Now we need to save the old interrupt vector, so we can restore - # it later and also to know where to jump if chaining. - # - movw $0x0204, %ax # get pm int vector - movb $0x09, %bl - int $0x31 - movw %cx, old_vector_sel - movl %edx, old_vector_ofs - # - # Make sure we chain after initialization. - # - movl $1, chain_flag - # - # Set the interrupt vector to point to our handler. - # - movw %cs, %cx - leal handler_procedure, %edx - movb $0x09, %bl - movw $0x0205, %ax # set pm int vector - int $0x31 - #* - #* Actually we would have to unlock the locked region on failure - #* here. But since most programs would exit with an error message - #* in such case, there's no need to worry. - #* - -init_error: - - # - # This sets EAX to -1 if CF is set and to 0 atherwise - # - movl $0, %eax - sbbl $0, %eax - - popl %ebx - popl %edi - popl %esi - ret - - - .align 4 -_ShutdownKeyboard: - - # - # void keyboard_close(void); - # - # Shuts the keyboard handler down. - # - pushl %esi - pushl %edi - pushl %ebx - # - # Unlock the region we locked at initialization - # - leal locking_region_start, %ecx - leal locking_region_end, %edi - subl %ecx, %edi - addl ___djgpp_base_address, %ecx - shldl $16, %ecx, %ebx - shldl $16, %edi, %esi - movw $0x0601, %ax # unlock linear region - int $0x31 - # - # Restore the interrupt vector to its previous value - # - movw old_vector_sel, %cx - movl old_vector_ofs, %edx - movb $0x09, %bl - movw $0x0205, %ax # set pm int vector - int $0x31 - - popl %ebx - popl %edi - popl %esi - ret - # - # void keyboard_chain(int toggle); - # - .align 4 -_keyboard_chain: - cmpl $0, 4(%esp) - je chain_off -chain_on: - - # - # Set the chain_flag and clear BIOS shift/ctrl/alt status bits: - # - movl $1, chain_flag - - push %es - movw ___djgpp_dos_sel, %es - andb $0xf0, %es:0x417 - pop %es - jmp chain_done -chain_off: - movl $0, chain_flag -chain_done: ret - diff --git a/16/v2/source/verge/ENGINE/MAIN.H b/16/v2/source/verge/ENGINE/MAIN.H deleted file mode 100755 index fde93675..00000000 --- a/16/v2/source/verge/ENGINE/MAIN.H +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef MAIN_H -#define MAIN_H - -//void *valloc(int amount); -void err(char *message, ...); -int sgn(int x); -void ver(); -void CheckMessages(); -void Log(char *message, ...); -void Logp(char *message, ...); -void LogDone(); -void InitMouse(int, int); -void ReadMouse(); -void SetMouse(int, int); - -extern char startmap[80], nocdaudio; -extern int mx, my, mb; - -#define vfree(x) if (x) { free(x); x=0; } - -#ifndef DJGPP -#define strncasecmp strnicmp -#define strcasecmp strcmpi -#endif - -#endif diff --git a/16/v2/source/verge/ENGINE/MAKEFILE b/16/v2/source/verge/ENGINE/MAKEFILE deleted file mode 100755 index f557fa31..00000000 --- a/16/v2/source/verge/ENGINE/MAKEFILE +++ /dev/null @@ -1,7 +0,0 @@ -CC = gcc -CFLAGS = -s -Wall -Werror - -OBJ = a_memory.o conlib.o console.o controls.o engine.o entity.o font.o image.o keyboard.o message.o modeinit.o render.o startup.o timer.o verge.o vc.o vdriver.o vfile.o fli.o sound.o mikmod.a - -verge: $(OBJ) - diff --git a/16/v2/source/verge/ENGINE/MESSAGE.C b/16/v2/source/verge/ENGINE/MESSAGE.C deleted file mode 100755 index dd3520e6..00000000 --- a/16/v2/source/verge/ENGINE/MESSAGE.C +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "verge.h" - -// ================================= Data ==================================== - -struct message -{ - char text[44]; // message text - int exptime; // message expire time -}; - -struct message messages[6]; // 5-message buffer -byte num_msgs=0; // number of active messages - -// -- cpu usage -- - -int cputimer=0, frames=0; -char runprf[3]; -// -- final numbers -- -int fps=0; -char profile[3]; - -// ================================= Code ==================================== - -void CheckMessageExpirations() -{ int i; - - for (i=0; imessages[i].exptime) - { - memcpy(messages[i].text, messages[i+1].text, (48*(num_msgs-i+1))); - num_msgs--; - } -} - -void RenderGUI() -{ int i; - - CheckMessageExpirations(); - for (i=0; iaH@cyhzU1|MNLR1Kp`;X2DV}n$P7sgNlYdITF}9P zI+GzbpS6~@R-vd>Yb&-0s8w^J0j*U^twm{-s%^G0wktF(_3r=vy=0=M{g2*-@VDlp|GE2)&6@U~-aF1{+85nVLeH1oukO;cf%oe- zY1;o&_j}_tZQ$KKQq%rd-)DL>?f+x9O*Cu&zqs>Un(cq)zVUg@X5K67HQWDwcS%vT zzrL)%>!0h%(@N$Q6_ga!m6!Rw3NNZHD>v903oodt^efiA&P1N-vh@Z2vU)?HjJ0*j z+Jc6{3U9rkv$(c$l@}fs*H$;K8NlV%dv9&@)~s5u+?iHAWi>UGHLIgY(yxp;jce8b zme)6xtZr=3N){KCuy?=(WozoHy(;W%EUKxN5hJ@YE&wVj08uev6Ga3DGidPDO#jT~mv26KGhemDJVO;(@HX#apkHG*E(?247i&pAD5Y4e2x4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^=!Q&zsvKmP3ayk%K18g@F;$n^av5;B;hU4`|xgJhON z#)`K`3ug_WQ^z!eG2xBiGPb;Uw$hpOYHN&TRfTuyd=)VmU^ZD^_J=$#+>zdQBa2o)Kx7AojWB?tDG7a91xe z$&Q7`H0Z(NiY+aTS64>!TSNrRC9$Hik}qgR8YnB`aub;Yo6NUj2AVBoR_?)GUTl{u zc$iFp2ZmdPZ${AiWqwI3u-WQr=E$#VunZiMgO@D(P}=fjUqP{uS(T*VR5NV9%s3lL a2eu`Ylw(ykU@fyp#b8y%Dy*VdA^kszY7JWe diff --git a/16/v2/source/verge/ENGINE/MIKMOD.C b/16/v2/source/verge/ENGINE/MIKMOD.C deleted file mode 100755 index 7f90de04..00000000 --- a/16/v2/source/verge/ENGINE/MIKMOD.C +++ /dev/null @@ -1,310 +0,0 @@ -/* - -Name: -MIKMOD.C - -Description: -Modplaying example of mikmod. - -MSDOS: BC(y) Watcom(y) DJGPP(y) -Win95: BC(y*) -Os2: y -Linux: n - -* console mode only -(y) - yes -(n) - no (not possible or not useful) -(?) - may be possible, but not tested - -*/ -#ifdef __WIN32__ -#include -#endif - -#include -#include -#include -#include - -#ifndef __OS2__ -#include -#endif - -#include "wildfile.h" -#include "mikmod.h" - -char helptext[]= - -"Available switches (CaSe SeNsItIvE!):\n" -"\n" -" /d x use device-driver #x for output (0 is autodetect). Default=0\n" -" /ld List all available device-drivers\n" -" /ll List all available loaders\n" -" /x disables protracker extended speed\n" -" /p disables panning effects (9fingers.mod)\n" -" /v xx Sets volume from 0 (silence) to 100. Default=100\n" -" /f xxxx Sets mixing frequency. Default=44100\n" -" /m Force mono output (so sb-pro can mix at 44100)\n" -" /8 Force 8 bit output\n" -" /i Use interpolated mixing\n" -" /r Restart a module when it's done playing"; - - -/* - declarations for boring old sys-v style getopt *yawn*: -*/ -int getopt(int argc, char *argv[], char *optionS); -extern char *optarg; -extern int optind; -extern int opterr; - - -void tickhandler(void) -{ - MP_HandleTick(); /* play 1 tick of the module */ - MD_SetBPM(mp_bpm); -} - - -int main(int argc,char *argv[]) -{ - UNIMOD *mf; - int cmderr=0; /* error in commandline flag */ - int morehelp=0; /* set if user wants more help */ - int quit; - int t; - static int nargc; - static char **nargv; - - puts(mikbanner); - - /* Expand wildcards on commandline */ - - nargc=argc; nargv=argv; -#ifndef __DJGPP__ - MyGlob(&nargc,&nargv,0); -#else - setvbuf(stdout, NULL, _IONBF, 0); - __djgpp_set_ctrl_c(0); -#endif - - /* - Initialize soundcard parameters.. you _have_ to do this - before calling MD_Init(), and it's illegal to change them - after you've called MD_Init() - */ - - md_mixfreq =44100; /* standard mixing freq */ - md_dmabufsize =20000; /* standard dma buf size */ - md_mode =DMODE_16BITS|DMODE_STEREO; /* standard mixing mode */ - md_device =0; /* standard device: autodetect */ - - /* - Register the loaders we want to use.. - */ - - ML_RegisterLoader(&load_m15); /* if you use m15load, register it as first! */ - ML_RegisterLoader(&load_mod); - ML_RegisterLoader(&load_mtm); - ML_RegisterLoader(&load_s3m); - ML_RegisterLoader(&load_stm); - ML_RegisterLoader(&load_ult); - ML_RegisterLoader(&load_uni); - ML_RegisterLoader(&load_xm); - - /* - Register the drivers we want to use: - */ - - MD_RegisterDriver(&drv_nos); -#ifdef __OS2__ - MD_RegisterDriver(&drv_os2); -#elif defined(__WIN32__) - MD_RegisterDriver(&drv_w95); -#else - MD_RegisterDriver(&drv_ss); - MD_RegisterDriver(&drv_sb); - MD_RegisterDriver(&drv_gus); -#endif - - MD_RegisterPlayer(tickhandler); - - /* Parse option switches using standard getopt function: */ - - opterr=0; - - while( !cmderr && - (t=getopt(nargc,nargv,"ohxpm8irv:f:l:d:")) != EOF ){ - - switch(t){ - - case 'd': - md_device=atoi(optarg); - break; - - case 'l': - if(optarg[0]=='d') MD_InfoDriver(); - else if(optarg[0]=='l') ML_InfoLoader(); - else{ - cmderr=1; - break; - } - exit(0); - - case 'r': - mp_loop=1; - break; - - case 'm': - md_mode&=~DMODE_STEREO; - break; - - case '8': - md_mode&=~DMODE_16BITS; - break; - - case 'i': - md_mode|=DMODE_INTERP; - break; - - case 'x': - mp_extspd=0; - break; - - case 'p': - mp_panning=0; - break; - - case 'v': - if((mp_volume=atoi(optarg))>100) mp_volume=100; - break; - - case 'f': - md_mixfreq=atol(optarg); - break; - - case 'h': - morehelp=1; - cmderr=1; - break; - - case '?': - puts("\07Invalid switch or option needs an argument\n"); - cmderr=1; - break; - } - } - - if(cmderr || optind>=nargc){ - - /* - there was an error in the commandline, or there were no true - arguments, so display a usage message - */ - - puts("Usage: MIKMOD [switches] ... \n"); - - if(morehelp) - puts(helptext); - else - puts("Type MIKMOD /h for more help."); - - exit(-1); - } - - /* initialize soundcard */ - - if(!MD_Init()){ - printf("Driver error: %s.\n",myerr); - return 0; - } - - printf("Using %s for %d bit %s %s sound at %u Hz\n\n", - md_driver->Name, - (md_mode&DMODE_16BITS) ? 16:8, - (md_mode&DMODE_INTERP) ? "interpolated":"normal", - (md_mode&DMODE_STEREO) ? "stereo":"mono", - md_mixfreq); - -#ifdef __OS2__ - DosSetPriority( PRTYS_THREAD, PRTYC_TIMECRITICAL, 5L, 0UL ); -#endif - - for(quit=0; !quit && optind exit with errormsg. */ - - if(mf==NULL){ - printf("MikMod Error: %s\n",myerr); - break; - } - - /* initialize modplayer to play this module */ - - MP_Init(mf); - - printf( "Songname: %s\n" - "Modtype : %s\n" - "Periods : %s,%s\n", - mf->songname, - mf->modtype, - (mf->flags&UF_XMPERIODS) ? "XM type" : "mod type", - (mf->flags&UF_LINEAR) ? "Linear" : "Log"); - - /* - set the number of voices to use.. you - could add extra channels here (e.g. md_numchn=mf->numchn+4; ) - to use for your own soundeffects: - */ - - md_numchn=mf->numchn; - - /* start playing the module: */ - - MD_PlayStart(); - - while(!MP_Ready()){ - - char c; - - c=kbhit() ? getch() : 0; - - if(c=='+') - MP_NextPosition(); - else if(c=='-') - MP_PrevPosition(); - else if(c==0x1b){ - quit=1; - break; - } - else if(c==' ') break; - - MD_Update(); - - /* wait a bit */ - -#if defined(__OS2__) - DosSleep(40); /* hmmmm */ -#elif defined(__WIN32__) - Sleep(10); -#elif defined(__DJGPP__) - /* no wait for djgpp ? */ -#else - delay(10); -#endif - printf("\rsngpos:%d patpos:%d sngspd %d bpm %d ",mp_sngpos,mp_patpos,mp_sngspd,mp_bpm); - } - - MD_PlayStop(); /* stop playing */ - ML_Free(mf); /* and free the module */ - puts("\n"); - } - MD_Exit(); - return 0; -} diff --git a/16/v2/source/verge/ENGINE/MIKMOD.H b/16/v2/source/verge/ENGINE/MIKMOD.H deleted file mode 100755 index 0111ccb3..00000000 --- a/16/v2/source/verge/ENGINE/MIKMOD.H +++ /dev/null @@ -1,580 +0,0 @@ -#ifndef MIKMOD_H -#define MIKMOD_H - -#include -#include "mtypes.h" /* include atomic mikmod types */ - - -#define mikbanner \ -"=======================================================================\n" \ -"MIKMOD v2.10 - Portable version - Programmed by MikMak of HaRDCoDE '95\n" \ -"=======================================================================\n" \ -"This program is SHAREWARE - Read MIKMOD.TXT for more info\n" \ -"E-Mail : mikmak@stack.urc.tue.nl\n" - - -/* - error variables: - =============== -*/ - -extern char *ERROR_ALLOC_STRUCT; -extern char *ERROR_LOADING_PATTERN; -extern char *ERROR_LOADING_TRACK; -extern char *ERROR_LOADING_HEADER; -extern char *ERROR_NOT_A_MODULE; -extern char *ERROR_LOADING_SAMPLEINFO; -extern char *ERROR_OUT_OF_HANDLES; -extern char *ERROR_SAMPLE_TOO_BIG; -extern char *myerr; - - - -#define _mm_rewind(x) _mm_fseek(x,0,SEEK_SET) -int _mm_fseek(FILE *stream,long offset,int whence); -void _mm_setiobase(long iobase); -long _mm_ftell(FILE *stream); - - -extern SBYTE _mm_read_SBYTE (FILE *fp); -extern UBYTE _mm_read_UBYTE (FILE *fp); - -extern SWORD _mm_read_M_SWORD (FILE *fp); -extern SWORD _mm_read_I_SWORD (FILE *fp); - -extern UWORD _mm_read_M_UWORD(FILE *fp); -extern UWORD _mm_read_I_UWORD(FILE *fp); - -extern SLONG _mm_read_M_SLONG (FILE *fp); -extern SLONG _mm_read_I_SLONG (FILE *fp); - -extern ULONG _mm_read_M_ULONG(FILE *fp); -extern ULONG _mm_read_I_ULONG(FILE *fp); - -extern int _mm_read_str(char *str, int size, FILE *fp); - -extern int _mm_read_SBYTES (SBYTE *buffer, int number, FILE *fp); -extern int _mm_read_UBYTES (UBYTE *buffer, int number, FILE *fp); - -extern int _mm_read_M_SWORDS (SWORD *buffer, int number, FILE *fp); -extern int _mm_read_I_SWORDS (SWORD *buffer, int number, FILE *fp); - -extern int _mm_read_M_UWORDS (UWORD *buffer, int number, FILE *fp); -extern int _mm_read_I_UWORDS (UWORD *buffer, int number, FILE *fp); - -extern int _mm_read_M_SLONGS (SLONG *buffer, int number, FILE *fp); -extern int _mm_read_I_SLONGS (SLONG *buffer, int number, FILE *fp); - -extern int _mm_read_M_ULONGS (ULONG *buffer, int number, FILE *fp); -extern int _mm_read_I_ULONGS (ULONG *buffer, int number, FILE *fp); - - -extern void _mm_write_SBYTE (SBYTE data,FILE *fp); -extern void _mm_write_UBYTE (UBYTE data,FILE *fp); - -extern void _mm_write_M_SWORD (SWORD data,FILE *fp); -extern void _mm_write_I_SWORD (SWORD data,FILE *fp); - -extern void _mm_write_M_UWORD (UWORD data,FILE *fp); -extern void _mm_write_I_UWORD (UWORD data,FILE *fp); - -extern void _mm_write_M_SLONG (SLONG data,FILE *fp); -extern void _mm_write_I_SLONG (SLONG data,FILE *fp); - -extern void _mm_write_M_ULONG (ULONG data,FILE *fp); -extern void _mm_write_I_ULONG (ULONG data,FILE *fp); - -extern void _mm_write_SBYTES (SBYTE *data, int number,FILE *fp); -extern void _mm_write_UBYTES (UBYTE *data, int number,FILE *fp); - -extern void _mm_write_M_SWORDS (SWORD *data, int number,FILE *fp); -extern void _mm_write_I_SWORDS (SWORD *data, int number,FILE *fp); - -extern void _mm_write_M_UWORDS (UWORD *data, int number,FILE *fp); -extern void _mm_write_I_UWORDS (UWORD *data, int number,FILE *fp); - -extern void _mm_write_M_SLONGS (SLONG *data, int number,FILE *fp); -extern void _mm_write_I_SLONGS (SLONG *data, int number,FILE *fp); - -extern void _mm_write_M_ULONGS (ULONG *data, int number,FILE *fp); -extern void _mm_write_I_ULONGS (ULONG *data, int number,FILE *fp); - - -/************************************************************************** -****** Unitrack stuff: **************************************************** -**************************************************************************/ - -/* - prototypes: -*/ - -void UniSetRow(UBYTE *t); -UBYTE UniGetByte(void); -UBYTE *UniFindRow(UBYTE *t,UWORD row); -void UniReset(void); -void UniWrite(UBYTE data); -void UniNewline(void); -void UniInstrument(UBYTE ins); -void UniNote(UBYTE note); -void UniPTEffect(UBYTE eff,UBYTE dat); -UBYTE *UniDup(void); -void UniSkipOpcode(UBYTE op); -BOOL UniInit(void); -void UniCleanup(void); -UWORD TrkLen(UBYTE *t); -BOOL MyCmp(UBYTE *a,UBYTE *b,UWORD l); - -/* - all known effects: -*/ - -enum { - UNI_NOTE=1, - UNI_INSTRUMENT, - UNI_PTEFFECT0, - UNI_PTEFFECT1, - UNI_PTEFFECT2, - UNI_PTEFFECT3, - UNI_PTEFFECT4, - UNI_PTEFFECT5, - UNI_PTEFFECT6, - UNI_PTEFFECT7, - UNI_PTEFFECT8, - UNI_PTEFFECT9, - UNI_PTEFFECTA, - UNI_PTEFFECTB, - UNI_PTEFFECTC, - UNI_PTEFFECTD, - UNI_PTEFFECTE, - UNI_PTEFFECTF, - UNI_S3MEFFECTA, - UNI_S3MEFFECTD, - UNI_S3MEFFECTE, - UNI_S3MEFFECTF, - UNI_S3MEFFECTI, - UNI_S3MEFFECTQ, - UNI_S3MEFFECTT, - UNI_XMEFFECTA, - UNI_XMEFFECTG, - UNI_XMEFFECTH, - UNI_XMEFFECTP -}; - - -/************************************************************************** -****** mikmod types: ****************************************************** -**************************************************************************/ - - -/* - Sample format flags: -*/ - -#define SF_16BITS 1 -#define SF_SIGNED 2 -#define SF_DELTA 4 -#define SF_BIG_ENDIAN 8 -#define SF_LOOP 16 -#define SF_BIDI 32 -#define SF_OWNPAN 64 -#define SF_REVERSE 128 - - -/* - Envelope flags: -*/ - -#define EF_ON 1 -#define EF_SUSTAIN 2 -#define EF_LOOP 4 - - -/* - Unimod flags -*/ - -#define UF_XMPERIODS 1 /* if set use XM periods/finetuning */ -#define UF_LINEAR 2 /* if set use LINEAR periods */ - - -typedef struct ENVPT{ - SWORD pos; - SWORD val; -} ENVPT; - - -typedef struct SAMPLE{ - UWORD c2spd; /* finetune frequency */ - SBYTE transpose; /* transpose value */ - UBYTE volume; /* volume 0-64 */ - UBYTE panning; /* panning */ - ULONG length; /* length of sample (in samples!) */ - ULONG loopstart; /* repeat position (relative to start, in samples) */ - ULONG loopend; /* repeat end */ - UWORD flags; /* sample format */ - ULONG seekpos; /* seek position in file */ - char *samplename; /* name of the sample */ - SWORD handle; /* sample handle */ -} SAMPLE; - - -typedef struct INSTRUMENT{ - UBYTE numsmp; - UBYTE samplenumber[96]; - - UBYTE volflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE volpts; - UBYTE volsus; - UBYTE volbeg; - UBYTE volend; - ENVPT volenv[12]; - - UBYTE panflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE panpts; - UBYTE pansus; - UBYTE panbeg; - UBYTE panend; - ENVPT panenv[12]; - - UBYTE vibtype; - UBYTE vibsweep; - UBYTE vibdepth; - UBYTE vibrate; - - UWORD volfade; - char *insname; - SAMPLE *samples; -} INSTRUMENT; - - -/* - MikMod UNImod types: - ==================== -*/ - -typedef struct UNIMOD{ - UBYTE numchn; /* number of channels */ - UWORD numpos; /* number of positions in this song */ - UWORD reppos; /* restart position */ - UWORD numpat; /* number of patterns in this song */ - UWORD numtrk; /* number of tracks */ - UWORD numins; /* number of samples */ - UBYTE initspeed; /* */ - UBYTE inittempo; /* */ - UBYTE positions[256]; /* all positions */ - UBYTE panning[32]; /* 32 panning positions */ - UBYTE flags; /* */ - char *songname; /* name of the song */ - char *modtype; /* string type of module */ - char *comment; /* module comments */ - INSTRUMENT *instruments; /* all samples */ - UWORD *patterns; /* array of PATTERN */ - UWORD *pattrows; /* array of number of rows for each pattern */ - UBYTE **tracks; /* array of pointers to tracks */ -} UNIMOD; - - -/************************************************************************** -****** Loader stuff: ****************************************************** -**************************************************************************/ - -/* - loader structure: -*/ - -typedef struct LOADER{ - struct LOADER *next; - char *type; - char *version; - BOOL (*Init)(void); - BOOL (*Test)(void); - BOOL (*Load)(void); - void (*Cleanup)(void); -} LOADER; - - -/* - public loader variables: -*/ - -extern UNIMOD of; -extern FILE *modfp; -extern UWORD finetune[16]; - - -/* - main loader prototypes: -*/ - -void ML_InfoLoader(void); -void ML_RegisterLoader(LOADER *ldr); -UNIMOD *ML_LoadFP(FILE *fp); -UNIMOD *ML_LoadFN(char *filename); -void ML_Free(UNIMOD *mf); - - -/* - other loader prototypes: (used by the loader modules) -*/ - -BOOL InitTracks(void); -void AddTrack(UBYTE *tr); -BOOL ReadComment(UWORD len); -BOOL AllocPatterns(void); -BOOL AllocTracks(void); -BOOL AllocInstruments(void); -BOOL AllocSamples(INSTRUMENT *i); -char *DupStr(char *s,UWORD len); -void *MyMalloc(size_t size); -void *MyCalloc(size_t nitems,size_t size); - - -/* - Declare external loaders: -*/ -extern LOADER load_uni; -extern LOADER load_mod; -extern LOADER load_m15; -extern LOADER load_mtm; -extern LOADER load_s3m; -extern LOADER load_stm; -extern LOADER load_ult; -extern LOADER load_xm; - - -/************************************************************************** -****** Wavload stuff: ***************************************************** -**************************************************************************/ - -SAMPLE *MW_LoadWavFP(FILE *fp); -SAMPLE *MW_LoadWavFN(char *filename); -void MW_FreeWav(SAMPLE *si); - - -/************************************************************************** -****** Driver stuff: ****************************************************** -**************************************************************************/ - -/* - max. number of handles a driver has to provide. (not strict) -*/ - -#define MAXSAMPLEHANDLES 128 - - -/* - possible mixing mode bits: -*/ - -#define DMODE_STEREO 1 -#define DMODE_16BITS 2 -#define DMODE_INTERP 4 - - -/* - driver structure: -*/ - -typedef struct DRIVER{ - struct DRIVER *next; - char *Name; - char *Version; - BOOL (*IsPresent) (void); - SWORD (*SampleLoad) (FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags); - void (*SampleUnLoad) (SWORD handle); - BOOL (*Init) (void); - void (*Exit) (void); - void (*PlayStart) (void); - void (*PlayStop) (void); - void (*Update) (void); - void (*VoiceSetVolume) (UBYTE voice,UBYTE vol); - void (*VoiceSetFrequency) (UBYTE voice,ULONG frq); - void (*VoiceSetPanning) (UBYTE voice,UBYTE pan); - void (*VoicePlay) (UBYTE voice,SWORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -} DRIVER; - - -/* - public driver variables: -*/ - -extern DRIVER *md_driver; -extern UWORD md_device; -extern UWORD md_mixfreq; -extern UWORD md_dmabufsize; -extern UWORD md_mode; -extern UBYTE md_numchn; -extern UBYTE md_bpm; -extern void (*md_player)(void); - -/* - main driver prototypes: -*/ - -void MD_InfoDriver(void); -void MD_RegisterDriver(DRIVER *drv); -void MD_RegisterPlayer(void (*plr)(void)); -SWORD MD_SampleLoad(FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -void MD_SampleUnLoad(SWORD handle); -BOOL MD_Init(void); -void MD_Exit(void); -void MD_PlayStart(void); -void MD_PlayStop(void); -void MD_SetBPM(UBYTE bpm); -void MD_Update(void); -void MD_VoiceSetVolume(UBYTE voice,UBYTE ivol); -void MD_VoiceSetFrequency(UBYTE voice,ULONG frq); -void MD_VoiceSetPanning(UBYTE voice,ULONG pan); -void MD_VoicePlay(UBYTE voice,SWORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -void SL_Init(FILE *fp,UWORD infmt,UWORD outfmt); -void SL_Load(void *buffer,ULONG length); - -/* - Declare external drivers: -*/ - -extern DRIVER drv_gus; /* gravis ultrasound driver */ -extern DRIVER drv_sb; /* soundblaster DSP driver */ -extern DRIVER drv_ss; /* ensoniq soundscape driver */ -extern DRIVER drv_nos; /* nosound driver */ -extern DRIVER drv_raw; /* file output driver */ -extern DRIVER drv_w95; /* win95 driver */ -extern DRIVER drv_awe; /* experimental SB-AWE driver */ -extern DRIVER drv_vox; /* linux voxware driver */ -extern DRIVER drv_af; /* Dec Alpha AudioFile driver */ -extern DRIVER drv_sun; /* Sun driver */ -extern DRIVER drv_os2; /* Os2 driver */ -extern DRIVER drv_tim; /* timing driver */ - -/************************************************************************** -****** Player stuff: ****************************************************** -**************************************************************************/ - - -typedef struct ENVPR{ - UBYTE flg; /* envelope flag */ - UBYTE pts; /* number of envelope points */ - UBYTE sus; /* envelope sustain index */ - UBYTE beg; /* envelope loop begin */ - UBYTE end; /* envelope loop end */ - SWORD p; /* current envelope counter */ - UWORD a; /* envelope index a */ - UWORD b; /* envelope index b */ - ENVPT *env; /* envelope points */ -} ENVPR; - - -typedef struct AUDTMP{ - INSTRUMENT *i; - SAMPLE *s; - - UWORD fadevol; /* fading volume */ - - ENVPR venv; - ENVPR penv; - - UBYTE keyon; /* if true=key is pressed. */ - UBYTE kick; /* if true=sample has to be restarted */ - UBYTE sample; /* which sample number (0-31) */ - SWORD handle; /* which sample-handle */ - - ULONG start; /* The start byte index in the sample */ - - UBYTE panning; /* panning position */ - UBYTE pansspd; /* panslide speed */ - - SBYTE volume; /* amiga volume (0 t/m 64) to play the sample at */ - UWORD period; /* period to play the sample at */ - - /* You should not have to use the values - below in the player routine */ - - SBYTE transpose; - - UBYTE note; /* */ - - SWORD ownper; - SWORD ownvol; - - UBYTE *row; /* row currently playing on this channel */ - - SBYTE retrig; /* retrig value (0 means don't retrig) */ - UWORD c2spd; /* what finetune to use */ - - SBYTE tmpvolume; /* tmp volume */ - - UWORD tmpperiod; /* tmp period */ - UWORD wantedperiod; /* period to slide to (with effect 3 or 5) */ - - UWORD slidespeed; /* */ - UWORD portspeed; /* noteslide speed (toneportamento) */ - - UBYTE s3mtremor; /* s3m tremor (effect I) counter */ - UBYTE s3mtronof; /* s3m tremor ontime/offtime */ - - UBYTE s3mvolslide; /* last used volslide */ - - UBYTE s3mrtgspeed; /* last used retrig speed */ - UBYTE s3mrtgslide; /* last used retrig slide */ - - UBYTE glissando; /* glissando (0 means off) */ - UBYTE wavecontrol; /* */ - - SBYTE vibpos; /* current vibrato position */ - UBYTE vibspd; /* "" speed */ - UBYTE vibdepth; /* "" depth */ - - SBYTE trmpos; /* current tremolo position */ - UBYTE trmspd; /* "" speed */ - UBYTE trmdepth; /* "" depth */ - - UWORD soffset; /* last used sample-offset (effect 9) */ -} AUDTMP; - - -extern AUDTMP mp_audio[32]; /* max eight channels */ -extern UBYTE mp_bpm; /* beats-per-minute speed */ -extern UWORD mp_patpos; /* current row number (0-63) */ -extern SWORD mp_sngpos; /* current song position */ -extern UWORD mp_sngspd; /* current songspeed */ - -extern BOOL mp_loop; -extern BOOL mp_panning; -extern BOOL mp_extspd; -extern UBYTE mp_volume; - -/* - player prototypes: -*/ - -int MP_Ready(void); -void MP_NextPosition(void); -void MP_PrevPosition(void); -void MP_SetPosition(UWORD pos); -void MP_HandleTick(void); -void MP_Init(UNIMOD *m); - - -/************************************************************************** -****** Virtual channel stuff: ********************************************* -**************************************************************************/ - -BOOL VC_Init(void); -void VC_Exit(void); - -void VC_PlayStart(void); -void VC_PlayStop(void); - -SWORD VC_SampleLoad(FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -void VC_SampleUnload(SWORD handle); - -void VC_WriteSamples(SBYTE *buf,UWORD todo); -UWORD VC_WriteBytes(SBYTE *buf,UWORD todo); -void VC_SilenceBytes(SBYTE *buf,UWORD todo); - -void VC_VoiceSetVolume(UBYTE voice,UBYTE vol); -void VC_VoiceSetFrequency(UBYTE voice,ULONG frq); -void VC_VoiceSetPanning(UBYTE voice,UBYTE pan); -void VC_VoicePlay(UBYTE voice,SWORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags); - -#endif diff --git a/16/v2/source/verge/ENGINE/MODE13H.C b/16/v2/source/verge/ENGINE/MODE13H.C deleted file mode 100755 index 2dcbf9ce..00000000 --- a/16/v2/source/verge/ENGINE/MODE13H.C +++ /dev/null @@ -1,881 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include "verge.h" - -// ================================= Data ==================================== - -byte *screen, *screenx; // virscr | realscr - -// ================================= Code ==================================== - -void SetMode(int mode) -{ - REGISTERS r; - SET_AX(r, mode); - INTERRUPT(0x10, r); -} - -int Mode13hShutdown(void) -{ - SetMode(0x3); - free(screen); - return 0; -} - -void xShowPage(int startofs) -{ - asm("movl _screen, %%esi \n\t" - "addl %0, %%esi \n\t" - "movl _screenx, %%edi \n\t" - "movl $200, %%eax \n\t" -"lineloop: \n\t" - "movl $80, %%ecx \n\t" - "rep \n\t" - "movsl \n\t" - "addl $32, %%esi \n\t" - "decl %%eax \n\t" - "jnz lineloop \n\t" - : - : "m" (startofs) - : "esi", "edi", "cc", "eax", "ecx"); -} - -int Mode13hShowPage(void) -{ - RenderGUI(); - cpubyte=PFLIP; - xShowPage((16*352)+16); - cpubyte=ETC; - return 0; -} - -int Mode13hCopySprite(int x, int y, int width, int height, byte *src) -{ - cpubyte=RENDER; - - asm("movl %3, %%edx \n\t" - "movl %4, %%esi \n\t" -"csl0: \n\t" - "movl %1, %%eax \n\t" - "imul $352, %%eax \n\t" - "addl %0, %%eax \n\t" - "addl _screen, %%eax \n\t" - "movl %%eax, %%edi \n\t" - "movl %2, %%ecx \n\t" - "shrl $2, %%ecx \n\t" - "repz \n\t" - "movsl \n\t" - "incl %1 \n\t" - "decl %%edx \n\t" - "jnz csl0 \n\t" - : - : "m" (x), "m" (y), "m" (width), "m" (height), "m" (src) - : "eax","edx","esi","edi","ecx","cc" ); - cpubyte=ETC; - return 0; -} - -int Mode13hCopyTile(int x, int y, byte *spr) -{ - cpubyte=RENDER; - - asm("movl $16, %%ecx \n\t" - "movl %2, %%esi \n\t" - "movl %1, %%edi \n\t" - "imul $352, %%edi \n\t" - "addl %0, %%edi \n\t" - "addl _screen, %%edi \n\t" -" ctl0: \n\t" - "movl (%%edi), %%eax \n\t" - "andl $0, %%eax \n\t" - "orl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - "movl 4(%%edi), %%eax \n\t" - "andl $0, %%eax \n\t" - "orl 4(%%esi), %%eax \n\t" - "movl %%eax, 4(%%edi) \n\t" - "movl 8(%%edi), %%eax \n\t" - "andl $0, %%eax \n\t" - "orl 8(%%esi), %%eax \n\t" - "movl %%eax, 8(%%edi) \n\t" - "movl 12(%%edi), %%eax \n\t" - "andl $0, %%eax \n\t" - "orl 12(%%esi), %%eax \n\t" - "movl %%eax, 12(%%edi) \n\t" - "addl $16, %%esi \n\t" - "addl $352, %%edi \n\t" - "decl %%ecx \n\t" - "jnz ctl0 \n\t" - : - : "m" (x), "m" (y), "m" (spr) - : "eax","ecx","esi","edi","cc" ); - cpubyte=ETC; - return 0; -} - -int Mode13hTCopySprite(int x, int y, int width, int height, byte *src) -{ - cpubyte=RENDER; - - asm("movl %3, %%ecx \n\t" - "movl %4, %%esi \n\t" -"tcsl0: \n\t" - "movl %1, %%eax \n\t" - "imul $352, %%eax \n\t" - "addl %0, %%eax \n\t" - "addl _screen, %%eax \n\t" - "movl %%eax, %%edi \n\t" - "movl %2, %%edx \n\t" -"drawloop: \n\t" - "lodsb \n\t" - "orb %%al, %%al \n\t" - "jz nodraw \n\t" - "stosb \n\t" - "decl %%edx \n\t" - "jz endline \n\t" - "jmp drawloop \n\t" -"nodraw: \n\t" - "incl %%edi \n\t" - "decl %%edx \n\t" - "jnz drawloop \n\t" -"endline: \n\t" - "incl %1 \n\t" - "decl %%ecx \n\t" - "jnz tcsl0 \n\t" - : - : "m" (x), "m" (y), "m" (width), "m" (height), "m" (src) - : "eax","edx","esi","edi","ecx","cc" ); - - cpubyte=ETC; - return 0; -} - -int Mode13hTCopyTile(int x, int y, byte *spr, byte *matte) -{ - cpubyte=RENDER; - asm("movl $16, %%ecx \n\t" - "movl %2, %%esi \n\t" - "movl %1, %%edi \n\t" - "imul $352, %%edi \n\t" - "addl %0, %%edi \n\t" - "addl _screen, %%edi \n\t" - "movl %3, %%edx \n\t" -"tctl0: \n\t" - "movl (%%edi), %%eax \n\t" - "andl (%%edx), %%eax \n\t" - "orl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - "movl 4(%%edi), %%eax \n\t" - "andl 4(%%edx), %%eax \n\t" - "orl 4(%%esi), %%eax \n\t" - "movl %%eax, 4(%%edi) \n\t" - "movl 8(%%edi), %%eax \n\t" - "andl 8(%%edx), %%eax \n\t" - "orl 8(%%esi), %%eax \n\t" - "movl %%eax, 8(%%edi) \n\t" - "movl 12(%%edi), %%eax \n\t" - "andl 12(%%edx), %%eax \n\t" - "orl 12(%%esi), %%eax \n\t" - "movl %%eax, 12(%%edi) \n\t" - "addl $16, %%esi \n\t" - "addl $352, %%edi \n\t" - "addl $16, %%edx \n\t" - "decl %%ecx \n\t" - "jnz tctl0 \n\t" - : - : "m" (x), "m" (y), "m" (spr), "m" (matte) - : "eax","ecx","edx","esi","edi","cc" ); - - cpubyte=ETC; - return 0; -} - -int Mode13hCCopySprite(int x,int y,int width,int height,byte *src) -{ - byte *s,*d; - int xl,yl,xs,ys; - int cx1=0, cy1=0, cx2=tsx-1, cy2=tsy-1; - - cpubyte=RENDER; - - xl=width; - yl=height; - xs=ys=0; - - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (x0 && th>0) dys=tsx-xm; - else if (tw>0 && th<0) dys=(0-tsx)-xm; - else if (tw<0 && th>0) dys=tsx+xm; - else if (tw<0 && th<0) dys=(0-tsx)+xm; - - d = screen+(y*tsx)+x; - for (i=0;i>16)]; - d+=xd; - sx+=xs; - } - d+=dys; - sy+=ys; - s+=(sy>>16)*w; - sy&=0xffff; - } - cpubyte=ETC; - return 0; -} - -int Mode13hRenderMAPLine(int x, int y, int yofs, word *map) -{ - cpubyte=RENDER; - asm("movl %1, %%edi \n\t" - "imul $352, %%edi \n\t" - "addl %0, %%edi \n\t" - "addl _screen, %%edi \n\t" - "movl $22, %%ebx \n\t" - "movl %3, %%ecx \n\t" -"tileloop: \n\t" - "movw (%%ecx), %%ax \n\t" - "movzwl %%ax, %%edx \n\t" - "shll $1, %%edx \n\t" - "addl _tileidx, %%edx \n\t" - "movw (%%edx), %%ax \n\t" - "movzwl %%ax, %%esi \n\t" - "shll $8, %%esi \n\t" - "addl _vsp, %%esi \n\t" - "movl %2, %%eax \n\t" - "shll $4, %%eax \n\t" - "addl %%eax, %%esi \n\t" - "movl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - "movl 4(%%esi), %%eax \n\t" - "movl %%eax, 4(%%edi) \n\t" - "movl 8(%%esi), %%eax \n\t" - "movl %%eax, 8(%%edi) \n\t" - "movl 12(%%esi), %%eax \n\t" - "movl %%eax, 12(%%edi) \n\t" - "addl $16, %%edi \n\t" - "addl $2, %%ecx \n\t" - "decl %%ebx \n\t" - "jnz tileloop \n\t" - : - : "m" (x), "m" (y), "m" (yofs), "m" (map) - : "eax","ebx","ecx","edx","esi","edi","cc" ); - - cpubyte=ETC; - return 0; -} - -int Mode13hTRenderMAPLine(int x, int y, int yofs, word *map) -{ - cpubyte=RENDER; - asm("movl %1, %%edi \n\t" - "imul $352, %%edi \n\t" - "addl %0, %%edi \n\t" - "addl _screen, %%edi \n\t" - "movl $22, %%ebx \n\t" - "movl %3, %%ecx \n\t" -"tileloop1: \n\t" - "movw (%%ecx), %%ax \n\t" - "movzwl %%ax, %%edx \n\t" - "shll $1, %%edx \n\t" - "addl _tileidx, %%edx \n\t" - "movw (%%edx), %%ax \n\t" - "orw %%ax, %%ax \n\t" - "jz next1 \n\t" - "movzwl %%ax, %%esi \n\t" - "shll $8, %%esi \n\t" - "movl %%esi, %%edx \n\t" - "addl _vspmask, %%edx \n\t" - "addl _vsp, %%esi \n\t" - "movl %2, %%eax \n\t" - "shll $4, %%eax \n\t" - "addl %%eax, %%esi \n\t" - "addl %%eax, %%edx \n\t" - "movl (%%edi), %%eax \n\t" - "andl (%%edx), %%eax \n\t" - "orl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - "movl 4(%%edi), %%eax \n\t" - "andl 4(%%edx), %%eax \n\t" - "orl 4(%%esi), %%eax \n\t" - "movl %%eax, 4(%%edi) \n\t" - "movl 8(%%edi), %%eax \n\t" - "andl 8(%%edx), %%eax \n\t" - "orl 8(%%esi), %%eax \n\t" - "movl %%eax, 8(%%edi) \n\t" - "movl 12(%%edi), %%eax \n\t" - "andl 12(%%edx), %%eax \n\t" - "orl 12(%%esi), %%eax \n\t" - "movl %%eax, 12(%%edi) \n\t" -"next1: \n\t" - "addl $16, %%edi \n\t" - "addl $2, %%ecx \n\t" - "decl %%ebx \n\t" - "jnz tileloop1 \n\t" - : - : "m" (x), "m" (y), "m" (yofs), "m" (map) - : "eax","ebx","ecx","edx","esi","edi","cc" ); - - cpubyte=ETC; - return 0; -} - -int Mode13hColorField(int x, int y, byte c) -{ - cpubyte=RENDER; - asm("movl %1, %%eax \n\t" - "imul $352, %%eax \n\t" - "addl %0, %%eax \n\t" - "addl _screen, %%eax \n\t" - "movl %%eax, %%edi \n\t" - "movl $8, %%ecx \n\t" - "movb %2, %%al \n\t" -"lineloop1: \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "addl $336, %%edi \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "addl $336, %%edi \n\t" - "decl %%ecx \n\t" - "jnz lineloop1 \n\t" - : - : "m" (x), "m" (y), "m" (c) - : "eax","edi","ecx","cc" ); - cpubyte=ETC; - return 0; -} - -int Mode13hClearScreen() -{ - cpubyte=RENDER; - memset(screen+(352*16)+16,0,(352*200)); - cpubyte=ETC; - return 0; -} - -int Mode13hPutPixel(int x, int y, int color) -{ - cpubyte=RENDER; - - if (xcx2 || y>cy2) - { - cpubyte=ETC; - return 0; - } - - x+=16; - y+=16; - - screen[(y*tsx)+x]=color; - - cpubyte=ETC; - return 0; -} - -int Mode13hGetPixel(int x, int y) -{ - cpubyte=RENDER; - - if (xcx2 || y>cy2) - { - cpubyte=ETC; - return 0; - } - - x+=16; - y+=16; - - cpubyte=ETC; - return screen[(y*tsx)+x]; -} - -int Mode13hHLine(int x, int y, int x2, int color) -{ byte *d; - int width; - - cpubyte=RENDER; - - // swap? - if (x2cx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (xcx2 || y>cy2 || x cy2) height=cy2-y+1; - if (ycx2 && x2>cx2) - || (y1cy2 && y2>cy2)) - { - cpubyte=ETC; - return 0; - } - - if (x1>x2) - { - i=x1; x1=x2; x2=i; - i=y1; y1=y2; y2=i; - } - - // clip the left side - if (x1cx2) - { int myy=(y2-y1); - int mxx=(x2-x1),b; - if (!mxx) - { - cpubyte=ETC; - return 0; - } - if (myy) - { - b=y1-(y2-y1)*x1/mxx; - y2=myy*cx2/mxx+b; - x2=cx2; - } - else x2=cx2; - } - - if (y1>y2) - { - i=x1; x1=x2; x2=i; - i=y1; y1=y2; y2=i; - } - - // clip the bottom - if (y2>cy2) - { int mxx=(x2-x1); - int myy=(y2-y1),b; - if (!myy) - { - cpubyte=ETC; - return 0; - } - if (mxx) - { - b=y1-(y2-y1)*x1/mxx; - x2=(cy2-b)*mxx/myy; - y2=cy2; - } - else y2=cy2; - } - - // clip the top - if (y1cx2 || x2>cx2 || y1cy2 || y2>cy2) - { - cpubyte=ETC; - return 0; - } - - if (x1>x2) - { xc=x2; xi=x1; } - else { xi=x2; xc=x1; } - - x1+=16;y1+=16; // aen; adjust these here?? - x2+=16;y2+=16; - - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - screen[(dcy*tsx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - screen[(dcy*tsx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - - cpubyte=ETC; - return 0; -} - -int Mode13hCircle(int x, int y, int radius, int color) -{ int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do { - Mode13hPutPixel(x+cx,y+cy,color); - if (cx) Mode13hPutPixel(x-cx,y+cy,color); - if (cy) Mode13hPutPixel(x+cx,y-cy,color); - if ((cx) && (cy)) Mode13hPutPixel(x-cx,y-cy,color); - - if (cx != cy) - { - Mode13hPutPixel(x+cy,y+cx,color); - if (cx) Mode13hPutPixel(x+cy,y-cx,color); - if (cy) Mode13hPutPixel(x-cy,y+cx,color); - if (cx && cy) Mode13hPutPixel(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - - cx++; - - } while (cx <= cy); - - cpubyte=ETC; - return 0; -} - -int Mode13hCircleFill(int x, int y, int radius, int color) -{ int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do { - Mode13hHLine(x-cy,y-cx,x+cy,color); - if (cx) Mode13hHLine(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - Mode13hHLine(x-cx,y-cy,x+cx,color); - if (cy) Mode13hHLine(x-cx,y+cy,x+cx,color); - } - - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - - cx++; - - } while (cx <= cy); - - cpubyte=ETC; - return 0; -} - -int Mode13hRect(int x, int y, int x2, int y2, int color) -{ - Mode13hHLine(x,y,x2,color); - Mode13hHLine(x,y2,x2,color); - Mode13hVLine(x,y+1,y2-1,color); - Mode13hVLine(x2,y+1,y2-1,color); - return 0; -} - -int Mode13hRectFill(int x, int y, int x2, int y2, int color) -{ - cpubyte=RENDER; - - if (y2 -#include -#include "verge.h" - -void BIOS_SetVideoMode(int mode) -{ - REGISTERS r; - SET_AX(r, mode); - INTERRUPT(0x10, r); -} - -// =============================== Mode 13h =================================== - -int Mode13hShutdown(int i) -{ - if (i) BIOS_SetVideoMode(0x3); - free(screen); - return 0; -} - -void InitMode13h(void) -{ - BIOS_SetVideoMode(0x13); - - DriverDesc = "320x200 (Mode 13h, linear)"; - sx=320, sy=200; - tx=20, ty=13; - cx1=0, cy1=0; - cx2=sx-1, cy2=sy-1; - - // setup function drivers - ShowPage=LFB_ShowPage; - ShutdownVideo=Mode13hShutdown; - - video=(byte *) 0xA0000 + __djgpp_conventional_base; - vscreen=(byte *) valloc(sx*sy, "vscreen", 0); - screen=vscreen; - memset(screen, 0, sx*sy); -} - -// ================================= Mode-X ================================== - -#define SEQU_ADDR 0x3c4 -#define CRTC_ADDR 0x3d4 -#define MISC_OUTPUT 0x3c2 - -#define ATTRCON_ADDR 0x3c0 -#define MISC_ADDR 0x3c2 -#define VGAENABLE_ADDR 0x3c3 -#define SEQ_ADDR 0x3c4 -#define GRACON_ADDR 0x3ce -#define CRTC_ADDR 0x3d4 -#define STATUS_ADDR 0x3da - -typedef struct -{ - unsigned port; - byte index, value; -} Register; - -typedef Register *RegisterPtr; - -Register scr256x256[] = -{ - { 0x3c2, 0x00, 0xe3},{ 0x3d4, 0x00, 0x5f},{ 0x3d4, 0x01, 0x3f}, - { 0x3d4, 0x02, 0x40},{ 0x3d4, 0x03, 0x82},{ 0x3d4, 0x04, 0x4A}, - { 0x3d4, 0x05, 0x9A},{ 0x3d4, 0x06, 0x23},{ 0x3d4, 0x07, 0xb2}, - { 0x3d4, 0x08, 0x00},{ 0x3d4, 0x09, 0x61},{ 0x3d4, 0x10, 0x0a}, - { 0x3d4, 0x11, 0xac},{ 0x3d4, 0x12, 0xff},{ 0x3d4, 0x13, 0x20}, - { 0x3d4, 0x14, 0x40},{ 0x3d4, 0x15, 0x07},{ 0x3d4, 0x16, 0x1a}, - { 0x3d4, 0x17, 0xa3},{ 0x3c4, 0x01, 0x01},{ 0x3c4, 0x04, 0x0e}, - { 0x3ce, 0x05, 0x40},{ 0x3ce, 0x06, 0x05},{ 0x3c0, 0x10, 0x41}, - { 0x3c0, 0x13, 0x00} -}; - -// ================================= Code ==================================== - -void plane(byte p) -{ - int hi=1<>2; - - for (y=0; y= sx) - { memcpy(d,s,sx); - bytes-=sx; - s+=sx; - d+=sx; - } - else - { memcpy(d,s,bytes); - s+=bytes; - span=sx-bytes; - - VESASetBank(bank++); - d=video; - bytes=65536; - - memcpy(d,s,span); - bytes-=span; - s+=span; - d+=span; - } - } - cpubyte=ETC; - return 0; -} - -void Set640x480() -{ - REGISTERS r; - - DriverDesc = "640x480 (VESA, Banked)"; - - SET_BX(r, 0x0101); - SET_AX(r, 0x4f02); - INTERRUPT(0x10, r); - - sx=640; sy=480; - tx=40; ty=30; - cx1=0; cy1=0; - cx2=sx-1;cy2=sy-1; -} - -void InitVESA(int xres, int yres) -{ - int found; - - found=0; - if (xres==640 && yres==480) { Set640x480(); found=1; } - - if (!found) - err("Internal error: unknown VESA resolution"); - - // setup driver functions - ShowPage = VESAShowPage; // reassign for banked VESA video blt - ShutdownVideo = VESAShutdown; - - video=(byte *) 0xA0000 + __djgpp_conventional_base; - vscreen=(byte *) valloc(sx*sy, "vscreen", 0); - screen=vscreen; - memset(screen, 0, sx*sy); -} - -// ============================================================================ - -int InitVideo(int xres, int yres) -{ - int found; - - found=0; - if (xres==320 && yres==200) { InitMode13h(); found=1; } - if (xres==320 && yres==240) { InitModeX(xres,yres); found=1; } - if (xres==360 && yres==240) { InitModeX(xres,yres); found=1; } - if (xres==256 && yres==256) { InitModeX(xres,yres); found=1; } - if (xres==640 && yres==480) { InitVESA(xres,yres); found=1; } - - if (found) - { - tsx=xres; tsy=yres; - Logp("Sys: Initializing %s.", DriverDesc); - InitMouse(tsx, tsy); - } - else - { - InitMode13h(); - tsx=320; tsy=200; - Logp("Unknown video mode %dx%d; defaulting to mode 13h.", xres, yres); - InitMouse(tsx, tsy); - } - LogDone(); - return found; -} diff --git a/16/v2/source/verge/ENGINE/MODEX.C b/16/v2/source/verge/ENGINE/MODEX.C deleted file mode 100755 index 6247f8eb..00000000 --- a/16/v2/source/verge/ENGINE/MODEX.C +++ /dev/null @@ -1,1055 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include -#include -#include "verge.h" - -// ================================= Data ==================================== - -#define SEQU_ADDR 0x3c4 -#define CRTC_ADDR 0x3d4 -#define MISC_OUTPUT 0x3c2 - -byte *screenbase; // ptr to A000:0000 -int endcol,nextl; // end column number thingy | next line -int winofs; - -// ================================= Code ==================================== - -void ModeXSetMode(int mode) -{ - REGISTERS r; - SET_AX(r, mode); - INTERRUPT(0x10, r); -} - -void plane(byte p) -{ - int hi=1<> 8) | 0x0c); - outportb(0x3d4, (offset & 0xff) | 0x0d); - - _enable(); -} - -int ModeXShowPage() -{ - byte *s,*d; - int x,y,k; - int sx2; - int b; - - RenderGUI(); - cpubyte=PFLIP; - - //s=screen+(16*tsx)+16; - b=(16*tsx)+16; - d=screenbase; - sx2=sx>>2; - - //while (!(inp(986) & 8)); - - for (y=0; ycx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (x0 && th>0) dys=tsx-xm; - else if (tw>0 && th<0) dys=(0-tsx)-xm; - else if (tw<0 && th>0) dys=tsx+xm; - else if (tw<0 && th<0) dys=(0-tsx)+xm; - - d = screen+(y*tsx)+x; - for (i=0;i>16)]; - d+=xd; - sx+=xs; - } - d+=dys; - sy+=ys; - s+=(sy>>16)*w; - sy&=0xffff; - } - cpubyte=ETC; - return 0; -} - -int ModeXRenderMAPLine(int x, int y, int yofs, word *map) -{ - cpubyte=RENDER; - asm("movl %1, %%edi \n\t" - "imul _tsx, %%edi \n\t" - "addl %0, %%edi \n\t" - "addl _screen, %%edi \n\t" - "movl _tx, %%ebx \n\t" - "incl %%ebx \n\t" - "movl %3, %%ecx \n\t" -"tileloop: \n\t" - "movw (%%ecx), %%ax \n\t" - "movzwl %%ax, %%edx \n\t" - "shll $1, %%edx \n\t" - "addl _tileidx, %%edx \n\t" - "movw (%%edx), %%ax \n\t" - "movzwl %%ax, %%esi \n\t" - "shll $8, %%esi \n\t" - "addl _vsp, %%esi \n\t" - "movl %2, %%eax \n\t" - "shll $4, %%eax \n\t" - "addl %%eax, %%esi \n\t" - "movl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - "movl 4(%%esi), %%eax \n\t" - "movl %%eax, 4(%%edi) \n\t" - "movl 8(%%esi), %%eax \n\t" - "movl %%eax, 8(%%edi) \n\t" - "movl 12(%%esi), %%eax \n\t" - "movl %%eax, 12(%%edi) \n\t" - "addl $16, %%edi \n\t" - "addl $2, %%ecx \n\t" - "decl %%ebx \n\t" - "jnz tileloop \n\t" - : - : "m" (x), "m" (y), "m" (yofs), "m" (map) - : "eax","ebx","ecx","edx","esi","edi","cc" ); - - cpubyte=ETC; - return 0; -} - -int ModeXTRenderMAPLine(int x, int y, int yofs, word *map) -{ - cpubyte=RENDER; - asm("movl %1, %%edi \n\t" - "imul _tsx, %%edi \n\t" - "addl %0, %%edi \n\t" - "addl _screen, %%edi \n\t" - "movl _tx, %%ebx \n\t" - "incl %%ebx \n\t" - "movl %3, %%ecx \n\t" -"tileloop1: \n\t" - "movw (%%ecx), %%ax \n\t" - "movzwl %%ax, %%edx \n\t" - "shll $1, %%edx \n\t" - "addl _tileidx, %%edx \n\t" - "movw (%%edx), %%ax \n\t" - "orw %%ax, %%ax \n\t" - "jz next1 \n\t" - "movzwl %%ax, %%esi \n\t" - "shll $8, %%esi \n\t" - "movl %%esi, %%edx \n\t" - "addl _vspmask, %%edx \n\t" - "addl _vsp, %%esi \n\t" - "movl %2, %%eax \n\t" - "shll $4, %%eax \n\t" - "addl %%eax, %%esi \n\t" - "addl %%eax, %%edx \n\t" - "movl (%%edi), %%eax \n\t" - "andl (%%edx), %%eax \n\t" - "orl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - "movl 4(%%edi), %%eax \n\t" - "andl 4(%%edx), %%eax \n\t" - "orl 4(%%esi), %%eax \n\t" - "movl %%eax, 4(%%edi) \n\t" - "movl 8(%%edi), %%eax \n\t" - "andl 8(%%edx), %%eax \n\t" - "orl 8(%%esi), %%eax \n\t" - "movl %%eax, 8(%%edi) \n\t" - "movl 12(%%edi), %%eax \n\t" - "andl 12(%%edx), %%eax \n\t" - "orl 12(%%esi), %%eax \n\t" - "movl %%eax, 12(%%edi) \n\t" -"next1: \n\t" - "addl $16, %%edi \n\t" - "addl $2, %%ecx \n\t" - "decl %%ebx \n\t" - "jnz tileloop1 \n\t" - : - : "m" (x), "m" (y), "m" (yofs), "m" (map) - : "eax","ebx","ecx","edx","esi","edi","cc" ); - - cpubyte=ETC; - return 0; -} - -int ModeXColorField(int x, int y, byte c) -{ - cpubyte=RENDER; - asm("movl %1, %%eax \n\t" - "imul _tsx, %%eax \n\t" - "addl %0, %%eax \n\t" - "addl _screen, %%eax \n\t" - "movl %%eax, %%edi \n\t" - "movl $8, %%ecx \n\t" - "movb %2, %%al \n\t" -"lineloop1: \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "addl _sx, %%edi \n\t" - "addl $16, %%edi \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "incl %%edi \n\t" - "stosb \n\t" - "addl _sx, %%edi \n\t" - "addl $16, %%edi \n\t" - "decl %%ecx \n\t" - "jnz lineloop1 \n\t" - : - : "m" (x), "m" (y), "m" (c) - : "eax","edi","ecx","cc" ); - cpubyte=ETC; - return 0; -} - -int ModeXClearScreen() -{ - cpubyte=RENDER; - memset(screen+(tsx*16)+16,0,(tsx*sy)); - cpubyte=ETC; - return 0; -} - -int ModeXPutPixel(int x, int y, int color) -{ - cpubyte=RENDER; - - if (xcx2 || y>cy2) - { - cpubyte=ETC; - return 0; - } - - x+=16; - y+=16; - - screen[(y*tsx)+x]=color; - - cpubyte=ETC; - return 0; -} - -int ModeXGetPixel(int x, int y) -{ - cpubyte=RENDER; - - if (xcx2 || y>cy2) - { - cpubyte=ETC; - return 0; - } - - x+=16; - y+=16; - - cpubyte=ETC; - return screen[(y*tsx)+x]; -} - -int ModeXHLine(int x, int y, int x2, int color) -{ byte *d; - int width; - - cpubyte=RENDER; - - // swap? - if (x2cx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (xcx2 || y>cy2 || x cy2) height=cy2-y+1; - if (ycx2 && x2>cx2) - || (y1cy2 && y2>cy2)) - { - cpubyte=ETC; - return 0; - } - - if (x1>x2) - { - i=x1; x1=x2; x2=i; - i=y1; y1=y2; y2=i; - } - - // clip the left side - if (x1cx2) - { int myy=(y2-y1); - int mxx=(x2-x1),b; - if (!mxx) - { - cpubyte=ETC; - return 0; - } - if (myy) - { - b=y1-(y2-y1)*x1/mxx; - y2=myy*cx2/mxx+b; - x2=cx2; - } - else x2=cx2; - } - - if (y1>y2) - { - i=x1; x1=x2; x2=i; - i=y1; y1=y2; y2=i; - } - - // clip the bottom - if (y2>cy2) - { int mxx=(x2-x1); - int myy=(y2-y1),b; - if (!myy) - { - cpubyte=ETC; - return 0; - } - if (mxx) - { - b=y1-(y2-y1)*x1/mxx; - x2=(cy2-b)*mxx/myy; - y2=cy2; - } - else y2=cy2; - } - - // clip the top - if (y1cx2 || x2>cx2 || y1cy2 || y2>cy2) - { - cpubyte=ETC; - return 0; - } - - if (x1>x2) - { xc=x2; xi=x1; } - else { xi=x2; xc=x1; } - - x1+=16;y1+=16; // aen; adjust these here?? - x2+=16;y2+=16; - - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - screen[(dcy*tsx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - screen[(dcy*tsx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - - cpubyte=ETC; - return 0; -} - -int ModeXCircle(int x, int y, int radius, int color) -{ int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do { - ModeXPutPixel(x+cx,y+cy,color); - if (cx) ModeXPutPixel(x-cx,y+cy,color); - if (cy) ModeXPutPixel(x+cx,y-cy,color); - if ((cx) && (cy)) ModeXPutPixel(x-cx,y-cy,color); - - if (cx != cy) - { - ModeXPutPixel(x+cy,y+cx,color); - if (cx) ModeXPutPixel(x+cy,y-cx,color); - if (cy) ModeXPutPixel(x-cy,y+cx,color); - if (cx && cy) ModeXPutPixel(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - - cx++; - - } while (cx <= cy); - - cpubyte=ETC; - return 0; -} - -int ModeXCircleFill(int x, int y, int radius, int color) -{ int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do { - ModeXHLine(x-cy,y-cx,x+cy,color); - if (cx) ModeXHLine(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - ModeXHLine(x-cx,y-cy,x+cx,color); - if (cy) ModeXHLine(x-cx,y+cy,x+cx,color); - } - - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - - cx++; - - } while (cx <= cy); - - cpubyte=ETC; - return 0; -} - -int ModeXRect(int x, int y, int x2, int y2, int color) -{ - ModeXHLine(x,y,x2,color); - ModeXHLine(x,y2,x2,color); - ModeXVLine(x,y+1,y2-1,color); - ModeXVLine(x2,y+1,y2-1,color); - return 0; -} - -int ModeXRectFill(int x, int y, int x2, int y2, int color) -{ - cpubyte=RENDER; - - if (y20 true */ - -#else - -typedef char SBYTE; /* has to be 1 byte signed */ -typedef unsigned char UBYTE; /* has to be 1 byte unsigned */ -typedef short SWORD; /* has to be 2 bytes signed */ -typedef unsigned short UWORD; /* has to be 2 bytes unsigned */ -typedef long SLONG; /* has to be 4 bytes signed */ -typedef unsigned long ULONG; /* has to be 4 bytes unsigned */ -typedef int BOOL; /* doesn't matter.. 0=FALSE, <>0 true */ - -#endif - - -#ifdef __OS2__ -#define INCL_DOS -#define INCL_MCIOS2 -#define INCL_MMIOOS2 -#include -#include -#include -#endif - - -#ifdef __WATCOMC__ -#define inportb(x) inp(x) -#define outportb(x,y) outp(x,y) -#define inport(x) inpw(x) -#define outport(x,y) outpw(x,y) -#define disable() _disable() -#define enable() _enable() -#endif - - -#ifdef __DJGPP__ -#include -#include -#include -#define inp inportw -#define outport outportw -#define inport inportw -#define interrupt -#endif - -#endif diff --git a/16/v2/source/verge/ENGINE/PCX.H b/16/v2/source/verge/ENGINE/PCX.H deleted file mode 100755 index 844e5c7a..00000000 --- a/16/v2/source/verge/ENGINE/PCX.H +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef PCX_H -#define PCX_H - -// -- globals -- - -extern word width,depth; - -// -- prototypes -- - -extern void ReadPCXLine(byte *dest); -extern void LoadPCXHeader(char *fname); -extern void LoadPCXHeaderNP(char *fname); -extern void LoadPCX(char *fname, byte *dest); -extern byte *LoadPCXBuf(char *fname); - -#endif // PCX_H diff --git a/16/v2/source/verge/ENGINE/RENDER.C b/16/v2/source/verge/ENGINE/RENDER.C deleted file mode 100755 index 31151541..00000000 --- a/16/v2/source/verge/ENGINE/RENDER.C +++ /dev/null @@ -1,291 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "verge.h" -#include - -// ================================= Data ==================================== - -int oxw, oyw; -int xofs, yofs; -int xtc, ytc; - -byte curlayer, animate=0; -byte cameratracking=1, tracker=0; -byte showobs=0, showzone=0; - -// ================================= Code ==================================== - -void BlitBackLayer(byte l) -{ - int i,j,c; - byte *img; - - if (!layertoggle[l]) return; - - // Adjust view - - oxw=xwin*layer[l].pmultx/layer[l].pdivx; - oyw=ywin*layer[l].pmulty/layer[l].pdivy; - xofs=-(oxw&15); //(16-(oxw&15)); - yofs=-(oyw&15); //(16-(oyw&15)); - xtc=oxw>>4; - ytc=oyw>>4; - - // Draw it, bitch! - - for (i=0; i>4; - ytc=oyw>>4; - - // Draw it, bitch! - - for (i=0; i>4; - ytc=oyw>>4; - - // Draw it, bitch! - - for (i=0; i>4; - ytc=oyw>>4; - - for (i=0; ix+7)/16)==(xtc+j) && ((player->y+7)/16)==(ytc+i)) - { - ColorField((j*16)+xofs,(i*16)+yofs,31); - } - } - } -} - -void HookScriptThing(char *src) -{ - char mystr[10]; - - src++; - strcpy(mystr, src); - src=mystr; - while (*src != 'X') src++; - *src=0; - ExecuteEvent(atoi(mystr)); -} - -void RenderMAP() -{ char *src; - - curlayer=0; - src=rstring; - while (*src) - { - switch (*src) - { - case '1': BlitLayer(0); break; - case '2': BlitLayer(1); break; - case '3': BlitLayer(2); break; - case '4': BlitLayer(3); break; - case '5': BlitLayer(4); break; - case '6': BlitLayer(5); break; - case 'E': RenderEntities(); break; - case 'S': HookScriptThing(src); break; - case 'R': HookRetrace(); - curlayer++; break; - } - src++; - } - if (!curlayer) ClearScreen(); - if (showobs) DrawObstructions(); - if (showzone) DrawZones(); -} - -void Render() -{ - if (cameratracking==1 && player) - { - if (player->x+8>(sx/2)) xwin=(player->x+8-(sx/2)); else xwin=0; - if (player->y+8>(sy/2)) ywin=(player->y+8-(sy/2)); else ywin=0; - if (xwin>((layer[0].sizex*16)-sx)) xwin=((layer[0].sizex*16)-sx); - if (ywin>((layer[0].sizey*16)-sy)) ywin=((layer[0].sizey*16)-sy); - } - if (cameratracking==2) - { - if (entity[tracker].x+8>(sx/2)) xwin=(entity[tracker].x+8-(sx/2)); else xwin=0; - if (entity[tracker].y+8>(sy/2)) ywin=(entity[tracker].y+8-(sy/2)); else ywin=0; - if (xwin>((layer[0].sizex*16)-sx)) xwin=((layer[0].sizex*16)-sx); - if (ywin>((layer[0].sizey*16)-sy)) ywin=((layer[0].sizey*16)-sy); - } - SiftEntities(); - RenderMAP(); -} - -int rnd(int lo, int hi) -{ - int range=hi-lo+1; - int i=rand() % range; - return i+lo; -} - -void AnimateTile(byte i, int l) -{ - switch (vspanim[i].mode) - { - case 0: if (tileidx[l]vspanim[i].start) tileidx[l]--; - else tileidx[l]=vspanim[i].finish; - break; - case 2: tileidx[l]=rnd(vspanim[i].start,vspanim[i].finish); - break; - case 3: if (flipped[l]) - { - if (tileidx[l]!=vspanim[i].start) tileidx[l]--; - else { tileidx[l]++; flipped[l]=0; } - } - else - { - if (tileidx[l]!=vspanim[i].finish) tileidx[l]++; - else { tileidx[l]--; flipped[l]=1; } - } - } -} - -void Animate(byte i) -{ static int l; - - vadelay[i]=0; - for (l=vspanim[i].start; l<=vspanim[i].finish; l++) - AnimateTile(i,l); -} - -void CheckTileAnimation() -{ static byte i; - - if (!animate) return; - if (!vsp) return; - for (i=0; i<100; i++) - { - if ((vspanim[i].delay) && (vspanim[i].delaynumchn+2; - mp_loop=1; mp_volume=100; - MD_PlayStart(); - PlaySound(0, 0, 0); - PlaySound(0, 0, 0); -} - -void StopMusic() -{ - if (MP_Ready()) return; - MD_PlayStop(); - ML_Free(mf); -} - -int CacheSound(char *fname) -{ - if (!(sfx[nsfx]=MW_LoadWavFN(fname))) - err("WAV [%s] load error: %s", fname, myerr); - return nsfx++; -} - -void FreeAllSounds() -{ - int i; - - for (i=0; i= nsfx) return; - switcher ^= 1; - chanl=md_numchn-1-switcher; - MD_VoiceSetVolume(chanl, vol); - MD_VoiceSetPanning(chanl, pan); - MD_VoiceSetFrequency(chanl, sfx[index]->c2spd); - MD_VoicePlay(chanl, sfx[index]->handle, 0, sfx[index]->length, - 0, 0, sfx[index]->flags); -} diff --git a/16/v2/source/verge/ENGINE/SOUND.H b/16/v2/source/verge/ENGINE/SOUND.H deleted file mode 100755 index 63c71a04..00000000 --- a/16/v2/source/verge/ENGINE/SOUND.H +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef SOUND_H -#define SOUND_H - -void InitMusicSystem(); -void PlayMusic(char *); -void StopMusic(); -int CacheSound(char *); -void FreeAllSounds(); -void PlaySound(int, int, int); - -#endif diff --git a/16/v2/source/verge/ENGINE/STARTUP.C b/16/v2/source/verge/ENGINE/STARTUP.C deleted file mode 100755 index 87ee07dc..00000000 --- a/16/v2/source/verge/ENGINE/STARTUP.C +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include // va_*() -#include - -#define MAIN_H -#include "verge.h" -extern void vmain(int argc, char *argv[]); -extern void Log(char *message, ...); - -int mx, my, mb; - -// ================================= Code ==================================== - -void err(char *message, ...) -{ - char tempbuf[256]; - va_list lst; - - ShutdownVideo(1); - ShutdownTimer(); - ShutdownKeyboard(); -// CD_Deinit(); - MD_PlayStop(); - MD_Exit(); - - va_start(lst, message); - vsprintf(tempbuf, message, lst); - va_end(lst); - - printf(tempbuf); - fflush(stdout); - - Log("Sys: Exiting with message: %s", tempbuf); - - exit(-1); -} - -int sgn(int x) -{ - if (x>=0) return 1; - return 0; -} - -void ver() -{ char temp[256]; - - Con_NextLine(); - Con_Printf("{|||||||||||||||||}"); - sprintf(temp,"VERGE v.%s Copyright (C)1998 vecna",VERSION); - Con_Printf(temp); - Con_Printf("All rights reserved. DJGPP/DOS build."); - sprintf(strbuf,"Timestamp %s at %s.",__DATE__, __TIME__); - Con_Printf(strbuf); - Con_Printf("Options: -Wall -m486 -O1 -ffast-math"); - Con_Printf("{|||||||||||||||||}"); -} - -void CheckMessages() -{ - // Win95 can bite me. -} - -void InitMouse(int x, int y) -{ REGISTERS r; - - SET_AX(r,7); - SET_CX(r,0); - SET_DX(r,x); - INTERRUPT(0x33, r); - - SET_AX(r,8); - SET_CX(r,0); - SET_DX(r,y); - INTERRUPT(0x33, r); -} - -void ReadMouse() -{ REGISTERS r; - - SET_AX(r,3); - INTERRUPT(0x33, r); - - mx=r.x.cx; - my=r.x.dx; - mb=r.x.bx; -} - -void SetMouse(int x, int y) -{ REGISTERS r; - - SET_AX(r, 4); - SET_CX(r, x); - SET_DX(r, y); - INTERRUPT(0x33, r); -} - -int main(int argc, char *argv[]) -{ - if (argc==1) - { - printf("VERGE v.%s build %s at %s. \n",VERSION,__DATE__,__TIME__); - printf("Copyright (C)1998 vecna \n"); - delay(500); - } - srand(time(NULL)); - vmain(argc, argv); - return 0; -} diff --git a/16/v2/source/verge/ENGINE/TIMER.C b/16/v2/source/verge/ENGINE/TIMER.C deleted file mode 100755 index b0c9274e..00000000 --- a/16/v2/source/verge/ENGINE/TIMER.C +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define TIMER_H -#include -#include -#include -#include "verge.h" - -#define PIT0 0x40 -#define PIT1 0x41 -#define PIT2 0x42 -#define PITMODE 0x43 -#define PITCONST 1193180L - -#define OCR1 0x20 -#define IMR1 0x21 - -#define OCR2 0xA0 -#define IMR2 0xA1 - -// ================================= Data ==================================== - -int _crt0_startup_flags = _CRT0_FLAG_NEARPTR; -typedef __dpmi_paddr *PVI; -static PVI oldhandler; - -unsigned int systemtime=0, timer_count=0; -int (*callback) (void); - -// ================================= Code ==================================== - -PVI DJSetHandlerFunc(unsigned char irqno, void (*handler)(), int len) -{ - PVI oldvect = (PVI) malloc(sizeof(__dpmi_paddr)); - int vecno=(irqno>7) ? irqno+0x68 : irqno+0x8; - _go32_dpmi_seginfo wrapper; - __dpmi_paddr new; - - wrapper.pm_offset = (long int) handler; - wrapper.pm_selector = _my_cs(); - _go32_dpmi_allocate_iret_wrapper(&wrapper); - new.offset32 = wrapper.pm_offset; - new.selector = wrapper.pm_selector; - __dpmi_get_and_disable_virtual_interrupt_state(); - if (len) _go32_dpmi_lock_code(handler,len); - _go32_dpmi_lock_data(&wrapper,sizeof(_go32_dpmi_seginfo)); - __dpmi_get_protected_mode_interrupt_vector(vecno,oldvect); - __dpmi_set_protected_mode_interrupt_vector(vecno,&new); - __dpmi_get_and_enable_virtual_interrupt_state(); - return oldvect; -} - -void DJSetHandlerAddr(unsigned char irqno, PVI handler) -{ - int vecno=(irqno>7) ? irqno+0x68 : irqno+0x8; - _go32_dpmi_seginfo wrapper; - __dpmi_paddr oldhandler; - - __dpmi_get_and_disable_virtual_interrupt_state(); - __dpmi_get_protected_mode_interrupt_vector(vecno, &oldhandler); - wrapper.pm_offset = oldhandler.offset32; - wrapper.pm_selector = oldhandler.selector; - _go32_dpmi_free_iret_wrapper(&wrapper); - __dpmi_set_protected_mode_interrupt_vector(vecno,handler); - __dpmi_get_and_enable_virtual_interrupt_state(); - free(handler); -} - -static void SendEOI (unsigned char irqno) -{ - unsigned char ocr=(irqno>7) ? OCR2 : OCR1; - unsigned char eoi=0x60|(irqno&7); - - outportb(ocr,eoi); - if (irqno>7) outportb(OCR1,0x20); -} - -static void newhandler(void) -{ - systemtime++; - timer_count++; - if (cpu_watch) CPUTick(); - if (callback) callback(); - CheckTileAnimation(); - HookTimer(); - MD_Update(); - SendEOI(0); -} - -static void EndNewHandler() { } - -void sethz(unsigned int hz) -{ unsigned int pit0_set, pit0_value; - - disable(); - - outportb(PITMODE, 0x34); - pit0_value=PITCONST / hz; - pit0_set=(pit0_value & 0x00ff); - outportb(PIT0, pit0_set); - pit0_set=(pit0_value >> 8); - outportb(PIT0, pit0_set); - - enable(); -} - -void restorehz() -{ - disable(); - outportb(PITMODE, 0x34); - outportb(PIT0, 0x00); - outportb(PIT0, 0x00); - enable(); -} - -void InitTimer() -{ - oldhandler = DJSetHandlerFunc(0, (void *) newhandler, - ((int) EndNewHandler) - ((int) newhandler)); - sethz(100); -} - -void ShutdownTimer() -{ - DJSetHandlerAddr(0, oldhandler); - restorehz(); -} diff --git a/16/v2/source/verge/ENGINE/TIMER.H b/16/v2/source/verge/ENGINE/TIMER.H deleted file mode 100755 index e195f924..00000000 --- a/16/v2/source/verge/ENGINE/TIMER.H +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef TIMER_H -#define TIMER_H - -void InitTimer(); -void ShutdownTimer(); - -extern int systemtime, timer_count; -extern int (*callback) (void); - -#endif diff --git a/16/v2/source/verge/ENGINE/VC.C b/16/v2/source/verge/ENGINE/VC.C deleted file mode 100755 index 36e86f2c..00000000 --- a/16/v2/source/verge/ENGINE/VC.C +++ /dev/null @@ -1,2242 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -#define VC_H -#include -#include "verge.h" -#include "vccode.h" -#include "sincos.h" -#include "mikmod.h" - -#define USERFUNC_MARKER 10000 - -// ================================= Data ==================================== - -char *sysvc, *mapvc, *basevc; // VC pool ptrs -char *code; // VC current instruction pointer (IP) - -int *globalint; // system.vc global int variables -int maxint; // maximum allocated # of ints -char *stringbuf; // vc string workspace -int vcreturn; // return value of last function -char *movescriptbuf; // VC EntityMove buffer -char vctrack=0; // VC call tracking to verge.log - -quad *vcstack; // VC stack (seperate from main stack) -quad *vcsp; // VC stack pointer [esp] - -int mapevents; // number of map events in this VC -char *mapvctbl[1024]; // map VC offset table - -int hookretrace=0; -int hooktimer=0; -int invc=0; - -// ----------------- - -typedef struct -{ - char fname[40]; - char argtype[20]; - int numargs, numlocals; - int returntype; - int syscodeofs; -} funcdecl; - -funcdecl *funcs; -int numfuncs; - -typedef struct -{ - char vname[40]; - int vsofs; - int arraylen; -} strdecl; - -strdecl *str; -int numstr=0; -int stralloc; - -typedef struct -{ - char vname[40]; - int varstartofs; - int arraylen; -} vardecl; - -vardecl *vars; -int numvars; -char kill=0; - -// -- local func vars -- - -typedef struct -{ - int nargs[20]; - char s[2560]; -} lvars; - -//lvars *lvar; -lvars lvar; - -// ============================== Prototypes ================================= - -void ResolveString(char *buffer); -void ExecuteSection(); -void ExecuteEvent(int i); -void ExecuteUserFunc(int i); - -// ================================= Code ==================================== - -int ProcessOperand(); // Mutually dependant functions suck. -int ProcessIfOperand(); // Hell yeah they do, bitch. -void HandleExternFunc(); -void HandleStdLib(); -void ExecuteBlock(); - -void LoadSystemVC() -{ - VFILE *f=0; - int i=0; - - Log("Initializing VC interpreter"); - if (!(f=vopen("system.idx"))) err("Could not open system.idx."); - vread(&numvars, 4, f); - vars=(vardecl *) valloc(numvars*sizeof(vardecl), "LoadSystemVC:vars", OID_VC); - vread(vars, numvars*48, f); - vread(&numfuncs, 4, f); - funcs=(funcdecl *) valloc(numfuncs*sizeof(funcdecl), "LoadSystemVC:funcs", OID_VC); - vread(funcs, numfuncs*76, f); - vread(&numstr, 4, f); - str=(strdecl *) valloc(numstr*sizeof(strdecl), "LoadSystemVC:str", OID_VC); - vread(str, numstr*44, f); - vclose(f); - - if (!(f=vopen("system.vcs"))) err("Could not open system.vcs"); - i=filesize(f); - sysvc=(char *) valloc(i, "LoadSystemVC:sysvc", OID_VC); - vread(&numfuncs, 4, f); - vread(&maxint, 4, f); - vread(&stralloc, 4, f); - - globalint=(int *) valloc(maxint ? maxint*4 : 4, "globalint", OID_VC); - if (stralloc) - { - stringbuf=(char *) valloc((stralloc*256), - "LoadSystemVC:stringbuf", OID_VC); - } - else - { - stringbuf=(char *) valloc(256, - "LoadSystemVC:stringbuf (256)", OID_VC); - } - vread(sysvc, i, f); - vclose(f); - - // Initialize VC stack - vcstack=(quad *) valloc(6000, "vcstack", OID_VC); - vcsp=vcstack; - - movescriptbuf=(char *) valloc(65535, "movescriptbuf", OID_VC); - -Log("system vclib init: %d funcs, %d ints (%d bytes), %d strings (%d bytes)", - numfuncs, numvars, maxint*4, numstr, stralloc*256); -} - -void LoadMapVC(VFILE *f) -{ int codesize=0; - - vread(&mapevents, 4, f); - vread(mapvctbl, 4*mapevents, f); - vread(&codesize, 4, f); - mapvc=(char *) valloc(codesize, "mapvc", OID_VC); - vread(mapvc, codesize, f); -} - -byte GrabC() -{ - return *code++; -} - -word GrabW(void) -{ - word *ptr=(word *) code; - code+=2; - return *ptr; -} - -quad GrabD(void) -{ - quad *ptr=(quad *) code; - code+=4; - return *ptr; -} - -void GrabString(char *str) -{ int i=0; - - i=0; - while (*code) - { - str[i]=*code; - code++; - i++; - } - str[i]=0; - code++; -} - -int ReadInt(char category, int loc, int ofs) -{ - switch (category) - { - case op_UVAR: return globalint[loc]; - case op_UVARRAY: return globalint[loc]; - case op_HVAR0: switch (loc) - { - case 0: return xwin; - case 1: return ywin; - case 2: return cameratracking; - case 3: return timer_count; - case 4: return up; - case 5: return down; - case 6: return left; - case 7: return right; - case 8: return b1; - case 9: return b2; - case 10: return b3; - case 11: return b4; - case 12: return sx; - case 13: return sy; - case 14: return playernum; - case 15: return cc; - case 16: return tracker; - case 17: return mx; - case 18: return my; - case 19: return mb; - case 20: return vctrack; - case 21: return width; - case 22: return depth; - case 23: return mp_volume; - case 24: return (int)vsp; - case 25: return lastent; - case 26: return last_pressed; - } - case op_HVAR1: switch (loc) - { - case 0: return (int) screen[ofs]; - case 1: return entity[ofs].x; - case 2: return entity[ofs].y; - case 3: return entity[ofs].tx; - case 4: return entity[ofs].ty; - case 5: return entity[ofs].facing; - case 6: return entity[ofs].moving; - case 7: return entity[ofs].specframe; - case 8: return entity[ofs].speed; -// case 9: return entity[ofs].movecode; - case 10: return entidx[ofs]; - case 11: return key[ofs]; - case 12: return layer[ofs].hline; - case 13: return (int) (*(byte *)ofs); - case 14: return (int) (*(word *)ofs); - case 15: return (int) (*(quad *)ofs); - case 16: return (int) pal[ofs]; - case 17: return (int) (*(char *)ofs); - case 18: return (int) (*(short*)ofs); - case 19: return (int) (*(int *)ofs); - } - case op_LVAR: return lvar.nargs[loc]; - default: - err("VC Execution error: Invalid ReadInt category %d", (int) category); - } - return 0; -} - -void WriteInt(char category, int loc, int ofs, int value) -{ - switch (category) - { - case op_UVAR: globalint[loc]=value; break; - case op_UVARRAY: globalint[loc]=value; break; - case op_HVAR0: switch (loc) - { - case 0: xwin=value; return; - case 1: ywin=value; return; - case 2: cameratracking=value; return; - case 3: timer_count=value; return; - case 16: tracker=value; return; - case 20: vctrack=value; return; - case 23: mp_volume=value; return; - case 26: last_pressed=value; return; - } - case op_HVAR1: switch (loc) - { - case 0: screen[ofs]=(byte) value; return; - case 1: entity[ofs].x=value; return; - case 2: entity[ofs].y=value; return; - case 3: entity[ofs].tx=value; return; - case 4: entity[ofs].ty=value; return; - case 5: entity[ofs].facing=value; return; - case 6: entity[ofs].moving=value; return; - case 7: entity[ofs].specframe=value; return; - case 8: entity[ofs].speed=value; return; -// case 9: entity[ofs].movecode=value; return; -// case 10: - case 11: key[ofs]=value; return; - case 12: layer[ofs].hline=value; return; - case 13: (*(byte *)ofs)=(byte) value; return; - case 14: (*(word *)ofs)=(word) value; return; - case 15: (*(quad *)ofs)=(quad) value; return; - case 16: pal[ofs]=value; return; - case 17: (*(char *)ofs)=(byte) value; return; - case 18: (*(short*)ofs)=(word) value; return; - case 19: (*(int *)ofs)=(quad) value; return; - } - case op_LVAR: lvar.nargs[loc]=value; return; - default: - err("VC Execution error: Invalid WriteInt category %d", (int) category); - } -} - -int ResolveOperand() -{ - int cr=0; - int d=0; - byte c=0; - - cr=ProcessOperand(); // Get base number - while (1) - { - c=GrabC(); - switch (c) - { - case op_ADD: cr += ProcessOperand(); continue; - case op_SUB: cr -= ProcessOperand(); continue; - case op_DIV: d=ProcessOperand(); - if (!d) cr=0; else cr /= d; continue; - case op_MULT: cr = cr * ProcessOperand(); continue; - case op_MOD: d=ProcessOperand(); - if (!d) cr=0; else cr %= d; continue; - case op_SHL: cr = cr << ProcessOperand(); continue; - case op_SHR: cr = cr >> ProcessOperand(); continue; - case op_AND: cr = cr & ProcessOperand(); continue; - case op_OR: cr = cr | ProcessOperand(); continue; - case op_XOR: cr = cr ^ ProcessOperand(); continue; - case op_END: break; - } - break; - } - return cr; -} - -int ProcessOperand() -{ byte op_desc=0; - byte c=0; - quad d=0; - quad ofs=0; - - op_desc=GrabC(); - switch (op_desc) - { - case op_IMMEDIATE: return GrabD(); - case op_HVAR0: c=GrabC(); return ReadInt(op_HVAR0, c, 0); - case op_HVAR1: c=GrabC(); ofs=ResolveOperand(); return ReadInt(op_HVAR1, c, ofs); - case op_UVAR: d=GrabD(); return ReadInt(op_UVAR, d, 0); - case op_UVARRAY: d=GrabD(); d+=ResolveOperand(); return ReadInt(op_UVARRAY, d, 0); - case op_LVAR: c=GrabC(); return lvar.nargs[c]; - case op_BFUNC: HandleStdLib(); - return vcreturn; - case op_UFUNC: HandleExternFunc(); - return vcreturn; - case op_GROUP: return ResolveOperand(); - default: sprintf(strbuf,"VC Execution error: Invalid operand %d.",op_desc); - err(strbuf); break; - } - return 0; -} - -void HandleStringOperand(char *buffer) -{ - char tbuf[256]; - char *d=0; - word w=0; - int c=0; - int i=0; - int j=0; - int z=0; - - c=GrabC(); - switch (c) - { - case s_IMMEDIATE: GrabString(buffer); break; - case s_GLOBAL: w=GrabW(); - d=(char *) (int) stringbuf + (w*256); - z=strlen(d); - if (strlen(buffer)+z+1>250) - err("Combined string length exceeds 250 char max."); - memcpy(buffer, d, z+1); - break; - case s_ARRAY: w=GrabW(); - w+=ResolveOperand(); - d=(char *) (int) stringbuf + (w*256); - z=strlen(d); - if (strlen(buffer)+z+1>250) - err("Combined string length exceeds 250 char max."); - memcpy(buffer, d, z+1); - break; - case s_NUMSTR: i=ResolveOperand(); - sprintf(buffer,"%d",i); - break; - case s_LEFT: ResolveString(tbuf); - i=ResolveOperand(); - c=i250) - err("Combined string length exceeds 250 char max."); - memcpy(buffer, tbuf, c); - buffer[c]=0; - break; - case s_RIGHT: ResolveString(tbuf); - i=ResolveOperand(); - c=i250) - err("Combined string length exceeds 250 char max."); - memcpy(buffer, tbuf+strlen(tbuf)-c, c); - buffer[c]=0; - break; - case s_MID: ResolveString(tbuf); - i=ResolveOperand(); - j=ResolveOperand(); - i=i250) - err("Combined string length exceeds 250 char max."); - memcpy(buffer, tbuf+i, j); - buffer[j]=0; - break; - case s_CHR: if (strlen(buffer)+2>50) - err("Combined string length exceeds 250 char max."); - buffer[0]=(char) ResolveOperand(); - buffer[1]=0; - break; - case s_LOCAL: c=GrabC(); - d=&lvar.s[c*256]; - z=strlen(d); - if (strlen(buffer)+z+1>250) - err("Combined string length exceeds 250 char max."); - memcpy(buffer, d, z+1); - break; - default: err("Invalid VC string operand %d", (int) c); - } -} - -void ResolveString(char *buffer) -{ char c=0; - - HandleStringOperand(buffer); - while (1) - { - c=GrabC(); - switch (c) - { - case s_ADD: - HandleStringOperand((char *) (int) buffer + strlen(buffer)); break; - case s_END: return; - default: - err("VC execution error: Unknown string operator %d",(int) c); - } - } -} - -void vcpush(quad info) -{ - if (vcsp>=vcstack+1500) err("VC stack overflow."); - *vcsp=info; - vcsp++; -} - -quad vcpop() -{ - if (vcsp==vcstack) err("VC stack underflow."); - vcsp--; - return *vcsp; -} - -void ReadVCVar() -{ int i=0; - int j=0; - - strlwr((char *) args[1]); - for (i=0; i<=numvars; i++) - if (!strcmp(vars[i].vname, (char *) args[1])) break; - if (i1) - j+=atoi((char *) args[2]); - j=globalint[j]; - sprintf(strbuf,"%s:%d",vars[i].vname, j); - Con_Printf(strbuf); - return; - } - for (i=0; i<=numstr; i++) - if (!strcmp(str[i].vname, (char *) args[1])) break; - if (i1) - { - j+=atoi((char *) args[2]); - globalint[j]=atoi((char *) args[3]); - } - else globalint[j]=atoi((char *) args[2]); - sprintf(strbuf,"%s:%d", vars[i].vname, atoi((char *) args[2])); - Con_Printf(strbuf); - return; - } - for (i=0; i<=numstr; i++) - if (!strcmp(str[i].vname, (char *) args[1])) break; - if (i=entities) err("SetPlayer(): Entity index out of range"); - - player=&entity[i]; - playernum=i; - -// entity[i].movecode=0; - entity[i].moving=0; -} - -void vc_Map() -{ - hookretrace=0; - hooktimer=0; - kill=1; - ResolveString(startmap); -} - -void vc_LoadFont() -{ - char vcstr[80]; - - ResolveString(vcstr); - vcreturn=LoadFont(vcstr); -} - -void vc_PlayFLI() -{ - char s[256]; - BITMAP flibuf; - byte *data=0; - VFILE *f=0; - int i=0; - - ResolveString(s); - flibuf.w=sx; - flibuf.h=sy; - flibuf.data=screen; - if (!(f=vopen(s))) err("PlayFLI: Could not open %s.",s); - i=filesize(f); - data=(byte *) malloc(i); - if (!data) err("Not enough memory to play FLI."); - vread(data, i, f); - vclose(f); - play_memory_fli(data, &flibuf, 0, ShowPage); - timer_count=0; - set_intensity(63); -} - -void vc_PrintString() -{ - char s[256]; - int i=0; - - i=ResolveOperand(); - ResolveString(s); - printstring(i,s); -} - -void vc_LoadRaw() -{ - char s[256]; - char *t=0; - VFILE *f=0; - int i=0; - - ResolveString(s); - if (!(f=vopen(s))) err("LoadRaw(): Could not open file %s",s); - i=filesize(f); - t=(char *) valloc(i, "LoadRaw:t", OID_VC); - vread(t, i, f); - vclose(f); - vcreturn=(int) t; -} - -void vc_SetTile() -{ - int x=0; - int y=0; - int layr=0; - int value=0; - - x=ResolveOperand(); - y=ResolveOperand(); - layr=ResolveOperand(); - value=ResolveOperand(); - - switch (layr) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: layers[layr][(y*layer[layr].sizex)+x] = (short) value; break; - case 6: obstruct[(y*layer[0].sizex)+x] = (byte) value; break; - case 7: zone[(y*layer[0].sizex)+x] = (byte) value; break; - default: err("SetTile(): Invalid layer value"); - } -} - -void vc_ScaleSprite() -{ - int x,y,iw,ih,dw,dh,image; - - x=ResolveOperand(); - y=ResolveOperand(); - iw=ResolveOperand(); - ih=ResolveOperand(); - dw=ResolveOperand(); - dh=ResolveOperand(); - image=ResolveOperand(); - if (!LucentOn) CopySpriteZoomClip(x,y,iw,ih,dw,dh,(byte *)image); - if ( LucentOn) CopySpriteZoomLucentClip(x,y,iw,ih,dw,dh,(byte *)image); -} - -void vc_EntityMove() -{ - int i; - - i=ResolveOperand(); - entity[i].moving=0; - entity[i].speedct=0; - - entity[i].delayct=0; - entity[i].mode=0; - entity[i].data1=0; - - ResolveString((char *) (int) movescriptbuf + (int) (i*256)); - entity[i].scriptofs=(char *) (int) movescriptbuf + (int) (i*256); - entity[i].movecode=4; -} - -void vc_HLine() -{ - int x, y, x2, c; - - x=ResolveOperand(); - y=ResolveOperand(); - x2=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) HLineClip(x,y,x2,c); - if ( LucentOn) HLineLucentClip(x,y,x2,c); - -} - -void vc_VLine() -{ - int x, y, y2, c; - - x=ResolveOperand(); - y=ResolveOperand(); - y2=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) VLineClip(x,y,y2,c); - if ( LucentOn) VLineLucentClip(x,y,y2,c); -} - -void vc_Line() -{ - int x, y, x2, y2, c; - - x=ResolveOperand(); - y=ResolveOperand(); - x2=ResolveOperand(); - y2=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) LineClip(x,y,x2,y2,c); - if ( LucentOn) LineLucentClip(x,y,x2,y2,c); -} - -void vc_Circle() -{ - int x, y, radius, c; - - x=ResolveOperand(); - y=ResolveOperand(); - radius=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) CircleClip(x,y,radius,c); - if ( LucentOn) CircleLucentClip(x,y,radius,c); -} - -void vc_CircleFill() -{ - int x, y, radius, c; - - x=ResolveOperand(); - y=ResolveOperand(); - radius=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) CircleFillClip(x,y,radius,c); - if ( LucentOn) CircleFillLucentClip(x,y,radius,c); -} - -void vc_Rect() -{ - int x, y, x2, y2, c; - - x=ResolveOperand(); - y=ResolveOperand(); - x2=ResolveOperand(); - y2=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) RectClip(x,y,x2,y2,c); - if ( LucentOn) RectLucentClip(x,y,x2,y2,c); -} - -void vc_RectFill() -{ - int x, y, x2, y2, c; - - x=ResolveOperand(); - y=ResolveOperand(); - x2=ResolveOperand(); - y2=ResolveOperand(); - c=ResolveOperand(); - if (!LucentOn) RectFillClip(x,y,x2,y2,c); - if ( LucentOn) RectFillLucentClip(x,y,x2,y2,c); -} - -void vc_strlen() -{ - char str[256]; - - ResolveString(str); - vcreturn=strlen(str); -} - -void vc_strcmp() -{ - char str1[256], str2[256]; - - ResolveString(str1); - ResolveString(str2); - vcreturn=strcmp(str1, str2); -} - -void vc_FontWidth() -{ - int i; - - i=ResolveOperand(); - if (i>=numfonts) - { - vcreturn=0; - return; - } - vcreturn=font[i].width; -} - -void vc_FontHeight() -{ - int i; - - i=ResolveOperand(); - if (i>=numfonts) - { - vcreturn=0; - return; - } - vcreturn=font[i].height; -} - -void vc_SetPixel() -{ - int x, y, c; - - x=ResolveOperand(); - y=ResolveOperand(); - c=ResolveOperand(); - SetPixelClip(x,y,c); -} - -void vc_GetPixel() -{ - int x, y; - - x=ResolveOperand(); - y=ResolveOperand(); - vcreturn=GetPixelClip(x,y); -} - -void vc_EntityOnScreen() -{ - int i,j; - - i=ResolveOperand(); - for (j=0; j63) r=63; - g=ResolveOperand(); if (g<0) g=0; if (g>63) g=63; - b=ResolveOperand(); if (b<0) b=0; if (b>63) b=63; - percent=100-ResolveOperand(); - intensity=ResolveOperand(); - - for (i=0; i<256; i++) - { - wr=pal[(i*3)]; - wg=pal[(i*3)+1]; - wb=pal[(i*3)+2]; - - wr=((wr*percent)+(r*(100-percent)))/100; - wg=((wg*percent)+(g*(100-percent)))/100; - wb=((wb*percent)+(b*(100-percent)))/100; - - pal2[(i*3)]=wr*intensity/63; - pal2[(i*3)+1]=wg*intensity/63; - pal2[(i*3)+2]=wb*intensity/63; - } - SetPalette(pal2); -} - -void EnforceNoDirectories(char *s) -{ - char y[256], *p; - - strcpy(y, s); - p=(char *) (int) y + (int) strlen(y); - while (p>y && *p != '/' && *p != '\\') - p--; - if (*p == '/' || *p == '\\') p++; - strcpy(s, p); -} - -void vc_OpenFile() -{ - VFILE *f; - char fname[256]; - - ResolveString(fname); - EnforceNoDirectories(fname); - - f=vopen(fname); - vcreturn=(quad) f; - - Log(" --> VC opened file %s, ptr %u", fname, (quad) f); -} - -void vc_CloseFile() -{ - VFILE *f; - - f=(VFILE *) ResolveOperand(); - vclose(f); - - Log(" --> VC closed file at ptr %u", (quad) f); -} - -void vc_QuickRead() -{ - char fname[256], c, *p; - int d=0, l, i; - VFILE *f; - word w=0; - - ResolveString(fname); - EnforceNoDirectories(fname); - c=GrabC(); - if (c==op_STRING) - { - w=GrabW(); - d=0; - } - if (c==op_SARRAY) - { - w=GrabW(); - d=ResolveOperand(); - } - l=ResolveOperand(); - l=l ? l : 1; - if (!(f=vopen(fname))) err("QuickRead() - could not open %s",fname); - - p=(char *) (quad) stringbuf + ((w+d)*256); - for (i=0; i=entities) err("AddFollower(): Not a valid entity index. (%d)",i); - follower[(int)numfollowers]=i; - numfollowers++; -// ResetFollowers(); -} - -void vc_FlatPoly() -{ - int a, b, c, d, e, f, g; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - d=ResolveOperand(); - e=ResolveOperand(); - f=ResolveOperand(); - g=ResolveOperand(); - FlatPoly(a,b,c,d,e,f,g); -} - -void vc_TMapPoly() -{ - int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - d=ResolveOperand(); - e=ResolveOperand(); - f=ResolveOperand(); - g=ResolveOperand(); - h=ResolveOperand(); - i=ResolveOperand(); - j=ResolveOperand(); - k=ResolveOperand(); - l=ResolveOperand(); - m=ResolveOperand(); - n=ResolveOperand(); - o=ResolveOperand(); - TMapPoly(a,b,c,d,e,f,g,h,i,j,k,l,m,n,(char *) o); -} - -void vc_CacheSound() -{ - char fname[256]; - - ResolveString(fname); - vcreturn=CacheSound(fname); - -} - -void vc_PlaySound() -{ - int a, b, c; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - PlaySound(a, b, c); -} - -void vc_RotScale() -{ - int a, b, c, d, e, f, g; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - d=ResolveOperand(); - e=ResolveOperand(); - f=ResolveOperand(); - g=ResolveOperand(); - - RotScale(a, b, c, d, e*3.14159 / 180, (float) f/1000, (byte *) g); -} - -void vc_MapLine() -{ - int x, y, sy, l; - int xtc, ytc, xofs, yofs; - - x=ResolveOperand(); - y=ResolveOperand(); - sy=ResolveOperand(); - l=ResolveOperand(); - - xtc=x >> 4; - ytc=y >> 4; - xofs= -(x&15); - yofs= (y&15); - - MapLine(xofs, sy, yofs, (word *) (layers[l]+((ytc*layer[l].sizex)+xtc))); -} - -void vc_TMapLine() -{ - int x, y, sy, l; - int xtc, ytc, xofs, yofs; - - x=ResolveOperand(); - y=ResolveOperand(); - sy=ResolveOperand(); - l=ResolveOperand(); - - xtc=x >> 4; - ytc=y >> 4; - xofs= -(x&15); - yofs= (y&15); - - TMapLine(xofs, sy, yofs, (word *) (layers[l]+((ytc*layer[l].sizex)+xtc))); -} - -void vc_val() -{ - char s[256]; - - ResolveString(s); - vcreturn=atoi(s); -} - -void vc_TScaleSprite() -{ - int x,y,iw,ih,dw,dh,image; - - x=ResolveOperand(); - y=ResolveOperand(); - iw=ResolveOperand(); - ih=ResolveOperand(); - dw=ResolveOperand(); - dh=ResolveOperand(); - image=ResolveOperand(); - if (!LucentOn) TCopySpriteZoomClip(x,y,iw,ih,dw,dh,(byte *) image); - if ( LucentOn) TCopySpriteZoomLucentClip(x,y,iw,ih,dw,dh,(byte *) image); -} - -void vc_GrabRegion() -{ - int x1, y1, x2, y2; - int i, j, w, h; - char *ptr; - - x1=ResolveOperand(); - y1=ResolveOperand(); - x2=ResolveOperand()+1; - y2=ResolveOperand()+1; - ptr=(char *) ResolveOperand(); - - if (x2>sx-1) x2=sx-1; - if (y2>sy-1) y2=sy-1; - if (x1<0) x1=0; - if (y1<0) y1=0; - - w=x2 - x1; - h=y2 - y1; - - for (j=y1; j VC renamed %s to %s.", s1, s2); -} - -void vc_fdelete() -{ - char s[256]; - - ResolveString(s); - EnforceNoDirectories(s); - remove(s); - - Log(" --> VC deleted %s.", s); -} - -void vc_fwopen() -{ - char s[256]; - - ResolveString(s); - EnforceNoDirectories(s); - vcreturn=(int) fopen(s,"wb"); - - Log(" --> VC opened %s for writing, ptr %u.", s, vcreturn); -} - -void vc_fwclose() -{ - FILE *f; - - f=(FILE *) ResolveOperand(); - fclose(f); - - Log(" --> VC close file opened for writing, ptr %u.", (int) f); -} - -void vc_memcpy() -{ - int a, b, c; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - memcpy((char *) a, (char *) b, c); -} - -void vc_memset() -{ - int a, b, c; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - memset((char *) a, (byte) b, c); -} - -void vc_Silhouette() -{ - int x=ResolveOperand(); - int y=ResolveOperand(); - int w=ResolveOperand(); - int h=ResolveOperand(); - byte *img=(byte *) ResolveOperand(); - byte c=(byte) ResolveOperand(); - - if (ClipOn) - { - LucentOn ? SilhouetteLucentClip(x,y,w,h,c,img) - : SilhouetteClip(x,y,w,h,c,img); - } - else - { - LucentOn ? SilhouetteLucent(x,y,w,h,c,img) - : Silhouette(x,y,w,h,c,img); - } -} - -void vc_SilhouetteScale() -{ - int x=ResolveOperand(); - int y=ResolveOperand(); - int sw=ResolveOperand(); - int sh=ResolveOperand(); - int dw=ResolveOperand(); - int dh=ResolveOperand(); - byte *img=(byte *) ResolveOperand(); - byte c=(byte) ResolveOperand(); - - if (ClipOn) - { - LucentOn ? SilhouetteZoomLucentClip(x,y,sw,sh,dw,dh,c,img) - : SilhouetteZoomClip(x,y,sw,sh,dw,dh,c,img); - } - else - { - LucentOn ? SilhouetteZoomLucent(x,y,sw,sh,dw,dh,c,img) - : SilhouetteZoom(x,y,sw,sh,dw,dh,c,img); - } -} - -void vc_Tint() -{ - int x=ResolveOperand(); - int y=ResolveOperand(); - int w=ResolveOperand(); - int h=ResolveOperand(); - byte *img=(byte *)ResolveOperand(); - byte c=(byte)ResolveOperand(); - - ClipOn ? TintClip(x,y,w,h,c,img) - : Tint(x,y,w,h,c,img); -} - -void vc_TintScale() -{ - int x=ResolveOperand(); - int y=ResolveOperand(); - int sw=ResolveOperand(); - int sh=ResolveOperand(); - int dw=ResolveOperand(); - int dh=ResolveOperand(); - byte *img=(byte *) ResolveOperand(); - byte c=(byte) ResolveOperand(); - - ClipOn ? TintZoomClip(x,y,sw,sh,dw,dh,c,img) - : TintZoom(x,y,sw,sh,dw,dh,c,img); -} - -void vc_Mosaic() -{ - int a,b,c,d,e,f,g; - - a=ResolveOperand(); - b=ResolveOperand(); - c=ResolveOperand(); - d=ResolveOperand(); - e=ResolveOperand(); - f=ResolveOperand(); - g=ResolveOperand(); - Mosaic(a,b,(byte *) c,d,e,f,g); -} - -void vc_WriteVars() -{ - FILE *f; - - f=(FILE *) ResolveOperand(); - fwrite(globalint, 4, maxint, f); - fwrite(stringbuf, 256, stralloc, f); -} - -void vc_ReadVars() -{ - VFILE *f; - - f=(VFILE *) ResolveOperand(); - vread(globalint, 4*maxint, f); - vread(stringbuf, 256*stralloc, f); -} - -void vc_Asc() -{ - char s[256]; - - ResolveString(s); - vcreturn=(int) s[0]; -} - -void vc_NumForScript() -{ - vcreturn=GrabD(); -} - -void vc_Filesize() -{ - char s[256]; - VFILE *f; - - ResolveString(s); - f=vopen(s); - vcreturn=filesize(f); - vclose(f); -} - -void vc_FTell() -{ - VFILE *f=(VFILE *)ResolveOperand(); - vcreturn=vtell(f); -} - -void vc_CheckCorrupt() -{ - Log("checking for corruption..."); - CheckCorruption(); -} - -void HandleStdLib() -{ - int x=0; - byte c=0; - - c=GrabC(); - switch (c) - { - case 1: vc_Exit_(); break; - case 2: vc_Message(); break; - case 3: vc_Malloc(); break; - case 4: vc_Free(); break; - case 5: vc_pow(); break; - case 6: vc_loadimage(); break; - case 7: vc_copysprite(); break; - case 8: vc_tcopysprite(); break; - case 9: Render(); break; - case 10: ShowPage(); break; - case 11: vc_EntitySpawn(); break; - case 12: vc_SetPlayer(); break; - case 13: vc_Map(); break; - case 14: vc_LoadFont(); break; - case 15: vc_PlayFLI(); break; - case 16: curx=ResolveOperand(); cury=ResolveOperand(); break; - case 17: vc_PrintString(); break; - case 18: vc_LoadRaw(); break; - case 19: vc_SetTile(); break; - case 20: allowconsole=ResolveOperand(); break; - case 21: vc_ScaleSprite(); break; - case 22: ProcessEntities(); break; - case 23: UpdateControls(); break; - case 24: UnPress(ResolveOperand()); break; - case 25: vc_EntityMove(); break; - case 26: vc_HLine(); break; - case 27: vc_VLine(); break; - case 28: vc_Line(); break; - case 29: vc_Circle(); break; - case 30: vc_CircleFill(); break; - case 31: vc_Rect(); break; - case 32: vc_RectFill(); break; - case 33: vc_strlen(); break; - case 34: vc_strcmp(); break; - case 35: break; //CD_Stop(); break; - case 36: ResolveOperand(); break; //CD_Play(ResolveOperand()); break; - case 37: vc_FontWidth(); break; - case 38: vc_FontHeight(); break; - case 39: vc_SetPixel(); break; - case 40: vc_GetPixel(); break; - case 41: vc_EntityOnScreen(); break; - case 42: vcreturn=0; - if ((x=ResolveOperand())) - vcreturn=rand()%x; - break; - case 43: vc_GetTile(); break; - case 44: vc_HookRetrace(); break; - case 45: vc_HookTimer(); break; - case 46: vc_SetResolution(); break; - case 47: vc_SetRString(); break; - case 48: vc_SetClipRect(); break; - case 49: vc_SetRenderDest(); break; - case 50: vc_RestoreRenderSettings(); break; - case 51: vc_PartyMove(); break; - case 52: vcreturn=sintbl[ResolveOperand()]; break; - case 53: vcreturn=costbl[ResolveOperand()]; break; - case 54: vcreturn=tantbl[ResolveOperand()]; break; - case 55: ReadMouse(); break; - case 56: ClipOn=ResolveOperand(); break; - case 57: LucentOn=ResolveOperand(); break; - case 58: vc_WrapBlit(); break; - case 59: vc_TWrapBlit(); break; - case 60: vc_SetMousePos(); break; - case 61: vc_HookKey(); break; - case 62: vc_PlayMusic(); break; - case 63: StopMusic(); break; - case 64: vc_PaletteMorph(); break; - case 65: vc_OpenFile(); break; - case 66: vc_CloseFile(); break; - case 67: vc_QuickRead(); break; - case 68: vc_AddFollower(); break; -// case 69: vc_KillFollower(); break; -// case 70: vc_KillAllFollowers(); break; -// case 71: ResetFollowers(); - case 72: vc_FlatPoly(); break; - case 73: vc_TMapPoly(); break; - case 74: vc_CacheSound(); break; - case 75: FreeAllSounds(); break; - case 76: vc_PlaySound(); break; - case 77: vc_RotScale(); break; - case 78: vc_MapLine(); break; - case 79: vc_TMapLine(); break; - case 80: vc_val(); break; - case 81: vc_TScaleSprite(); break; - case 82: vc_GrabRegion(); break; - case 83: vc_Log(); break; - case 84: vc_fseekline(); break; - case 85: vc_fseekpos(); break; - case 86: vc_fread(); break; - case 87: vc_fgetbyte(); break; - case 88: vc_fgetword(); break; - case 89: vc_fgetquad(); break; - case 90: vc_fgetline(); break; - case 91: vc_fgettoken(); break; - case 92: vc_fwritestring(); break; - case 93: vc_fwrite(); break; - case 94: vc_frename(); break; - case 95: vc_fdelete(); break; - case 96: vc_fwopen(); break; - case 97: vc_fwclose(); break; - case 98: vc_memcpy(); break; - case 99: vc_memset(); break; - case 100: vc_Silhouette(); break; - case 101: vcreturn=(int) InitMosaicTable(); break; - case 102: vc_Mosaic(); break; - case 103: vc_WriteVars(); break; - case 104: vc_ReadVars(); break; - case 105: ExecuteEvent(ResolveOperand()); break; - case 106: vc_Asc(); break; - case 107: ExecuteUserFunc(ResolveOperand()); break; - case 108: vc_NumForScript(); break; - case 109: vc_Filesize(); break; - case 110: vc_FTell(); break; - case 111: vc_CheckCorrupt(); break; - default: err("VC Execution error: Invalid STDLIB index. (%d)",(int) c); - } -} - -// ========================== VC Interpretation Core ========================== - -int ProcessIf() -{ - byte exec, c; - - exec=ProcessIfOperand(); // Get base value; - - while (1) - { - c=GrabC(); - switch (c) - { - case i_AND: exec=exec & ProcessIfOperand(); continue; - case i_OR: exec=exec | ProcessIfOperand(); continue; - case i_UNGROUP: break; - } - break; - } - return exec; -} - -int ProcessIfOperand() -{ - byte op_desc; - int eval; - - eval=ResolveOperand(); - op_desc=GrabC(); - switch (op_desc) - { - case i_ZERO: if (!eval) return 1; else return 0; - case i_NONZERO: if (eval) return 1; else return 0; - case i_EQUALTO: if (eval == ResolveOperand()) return 1; else return 0; - case i_NOTEQUAL: if (eval != ResolveOperand()) return 1; else return 0; - case i_GREATERTHAN: if (eval > ResolveOperand()) return 1; else return 0; - case i_GREATERTHANOREQUAL: if (eval >= ResolveOperand()) return 1; else return 0; - case i_LESSTHAN: if (eval < ResolveOperand()) return 1; else return 0; - case i_LESSTHANOREQUAL: if (eval <= ResolveOperand()) return 1; else return 0; - case i_GROUP: if (ProcessIf()) return 1; else return 0; - } - return 0; -} - -void HandleIf() -{ - char *d; - - if (ProcessIf()) - { - GrabD(); - return; - } - d=(char *) GrabD(); - code=(char *) (int) basevc + (int) d; - - return; -} - -void HandleExternFunc() -{ - word i, j, k; - //lvars *ob = NULL; - //lvars *save = NULL; - lvars temp; - lvars ob; - - // save lvar - memcpy(&temp, &lvar, sizeof(lvars)); - - memset(&ob, 0, sizeof(lvars)); - //ob = (lvars *)valloc(sizeof(lvars)); //2640); //sizeof(lvars)); //2640); - //MSS_CHECK_POINTER_VALIDITY(ob); - //MSS_SET_BLOCK_LABEL(ob, "ob"); - - k = 0; - i = GrabW(); - for (j=0; j Entering user func %s, codeofs %d", - funcs[i].fname, funcs[i].syscodeofs); - } - - ExecuteBlock(); - basevc = (char *)vcpop(); - - // restore lvar - memcpy(&lvar, &temp, sizeof(lvars)); - //memcpy(lvar, &temp, sizeof(lvars)); - //vfree(lvar); - //lvar = ob; - - if (vctrack) - { - Log(" --> Returned from %s", funcs[i].fname); - } - -// MSS_CHECK_ALL_BLOCKS; -} - -void HandleAssign() -{ - byte c, d; - word w; - quad location=0, value, ofs=0; - - c=GrabC(); - if (c==op_STRING) - { - w=GrabW(); - c=GrabC(); - if (c!=a_SET) err("VC execution error: Corrupt string assignment"); - location=(quad) stringbuf + (w*256); - ResolveString((char *) location); - return; - } - if (c==op_SARRAY) - { - w=GrabW(); - w+=ResolveOperand(); - c=GrabC(); - if (c!=a_SET) err("VC execution error: Corrupt string assignment"); - location=(quad) stringbuf + (w*256); - ResolveString((char *) location); - return; - } - if (c==op_SLOCAL) - { - w=GrabW(); - c=GrabC(); - if (c!=a_SET) err("VC execution error: Corrupt string assignment"); - location=(quad) &lvar.s[w*256]; - ResolveString((char *) location); - return; - } - switch (c) - { - case op_UVAR: location=GrabD(); break; - case op_UVARRAY: location=GrabD(); location+=ResolveOperand(); break; - case op_HVAR0: location=(int) GrabC(); break; - case op_HVAR1: location=(int) GrabC(); ofs=ResolveOperand(); break; - case op_LVAR: location=(int) GrabC(); break; - default: err("VC Execution error: Unknown assignment category."); - } - value=ReadInt(c, location, ofs); - d=GrabC(); - switch(d) - { - case a_SET: value=ResolveOperand(); break; - case a_INC: value++; break; - case a_DEC: value--; break; - case a_INCSET: value+=ResolveOperand(); break; - case a_DECSET: value-=ResolveOperand(); break; - default: - err("VC Execution error: Invalid assignment operator %d.", (int) d); - } - WriteInt(c, location, ofs, value); -} - -void HandleSwitch() -{ - int realvalue=0; - int compvalue=0; - byte c=0; - byte *next=0; - - realvalue=ResolveOperand(); - c=GrabC(); - while (c!=opRETURN) - { - compvalue=ResolveOperand(); - next=(byte *) GrabD(); - if (compvalue!=realvalue) - { - code=(char *) (int) basevc+(int) next; - c=GrabC(); - continue; - } - ExecuteSection(); - c=GrabC(); - } -} - -void ExecuteVC() -{ - byte c=0; - - while (1) - { - if (kill) break; - c=GrabC(); - switch (c) - { - case opEXEC_STDLIB: HandleStdLib(); break; - case opEXEC_LOCALFUNC: break; - case opEXEC_EXTERNFUNC: HandleExternFunc(); break; - case opIF: HandleIf(); break; - case opELSE: break; - case opGOTO: code=basevc+GrabD(); break; - case opSWITCH: HandleSwitch(); break; - case opASSIGN: HandleAssign(); break; - case opRETURN: code=(char *) vcpop(); break; - case opSETRETVAL: vcreturn=ResolveOperand(); break; - default: - err("Internal VC execution error. (%d)",(int) code - (int) basevc); - } - if ((int) code != -1) continue; else break; - } -} - -void ExecuteBlock() -{ - byte c=0; - - while (1) - { - if (kill) break; - c=GrabC(); - switch (c) - { - case opEXEC_STDLIB: HandleStdLib(); break; - case opEXEC_LOCALFUNC: break; - case opEXEC_EXTERNFUNC: HandleExternFunc(); break; - case opIF: HandleIf(); break; - case opELSE: break; - case opGOTO: code=basevc+GrabD(); break; - case opSWITCH: HandleSwitch(); break; - case opASSIGN: HandleAssign(); break; - case opRETURN: code=(char *) vcpop(); break; - case opSETRETVAL: vcreturn=ResolveOperand(); break; - default: - err("Internal VC execution error. (%d)",(int) code - (int) basevc); - } - if (c != opRETURN) continue; else break; - } -} - -void ExecuteSection() -{ - byte c=0; - - while (1) - { - if (kill) break; - c=GrabC(); - switch (c) - { - case opEXEC_STDLIB: HandleStdLib(); break; - case opEXEC_LOCALFUNC: break; - case opEXEC_EXTERNFUNC: HandleExternFunc(); break; - case opIF: HandleIf(); break; - case opELSE: break; - case opGOTO: code=basevc+GrabD(); break; - case opSWITCH: HandleSwitch(); break; - case opASSIGN: HandleAssign(); break; - case opRETURN: break; - case opSETRETVAL: vcreturn=ResolveOperand(); break; - default: - err("Internal VC execution error. (%d)", (int) code - (int) basevc); - } - if (c != opRETURN) continue; else break; - } -} - -void ExecuteEvent(int i) -{ - invc++; - vcpush((quad) code); - vcpush((quad) basevc); - if (i>mapevents) err("VC event out of bounds (%d)",i); - basevc=mapvc; - code=(char *) (int) mapvc + (int) mapvctbl[i]; - vcpush(-1); - ExecuteVC(); - basevc=(char *) vcpop(); - code=(char *) vcpop(); - invc--; -} - -void ExecuteUserFunc(int i) -{ - //lvars *ob=0; - lvars temp; - - // save lvar - memcpy(&temp, &lvar, sizeof(lvars)); - - vcpush((quad) code); - vcpush((quad) basevc); - - if (i > numfuncs) - err("VC event out of bounds"); - - basevc = sysvc; - code = (char *)(sysvc + funcs[i].syscodeofs); - - vcpush(-1); - - memset(&lvar, 0, sizeof(lvar)); - //ob = lvar; - //lvar = (lvars *)valloc(sizeof(lvars)); //2640); - //MSS_SET_BLOCK_LABEL(lvar, "lvar"); - - ExecuteVC(); - basevc = (char *) vcpop(); - code = (char *) vcpop(); - - //free(lvar); - //lvar = ob; - - // restore lvar - memcpy(&lvar, &temp, sizeof(lvars)); -} - -void HookRetrace() -{ - if (!hookretrace) return; - if (hookretrace=USERFUNC_MARKER) ExecuteUserFunc(hookretrace-USERFUNC_MARKER); -} - -void HookTimer() -{ - if (!hooktimer) return; - if (hooktimer=USERFUNC_MARKER) ExecuteUserFunc(hooktimer-USERFUNC_MARKER); -} - -void HookKey(int script) -{ - if (!script) return; - if (script=USERFUNC_MARKER) ExecuteUserFunc(script-USERFUNC_MARKER); -} diff --git a/16/v2/source/verge/ENGINE/VC.H b/16/v2/source/verge/ENGINE/VC.H deleted file mode 100755 index 00906ceb..00000000 --- a/16/v2/source/verge/ENGINE/VC.H +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef VC_H -#define VC_H - -typedef struct -{ - char fname[40]; - char argtype[12]; - int numargs; - int returntype; - int syscodeofs; -} funcdecl; - -extern funcdecl funcs[100]; -extern int numfuncs, mapevents; -extern int hookretrace, hooktimer; - -typedef struct -{ - char vname[40]; - int varstartofs; - int arraylen; -} vardecl; - -extern vardecl vars[100]; -extern int numvars, invc; -extern char *mapvc, kill; -extern char *vcsp, *vcstack; - -void LoadSystemVC(); -void LoadMapVC(VFILE *f); -void ReadVCVar(); -void WriteVCVar(); -void ExecuteEvent(int); -void ExecuteUserFunc(int); - -void HookRetrace(); -void HookTimer(); -void HookKey(int script); - -#endif diff --git a/16/v2/source/verge/ENGINE/VCCODE.H b/16/v2/source/verge/ENGINE/VCCODE.H deleted file mode 100755 index 74495139..00000000 --- a/16/v2/source/verge/ENGINE/VCCODE.H +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// We never use zero as a tag. This makes it easier to track down misbehaving -// VC code, since zero is commonly come-by when going off into uncharted -// depths of memory. - -#define ERROR 0 - -// Opcode values. - -#define opEXEC_STDLIB 1 -#define opEXEC_LOCALFUNC 2 -#define opEXEC_EXTERNFUNC 3 -#define opIF 4 -#define opELSE 5 -#define opGOTO 6 -#define opSWITCH 7 -#define opCASE 8 -#define opRETURN 9 -#define opASSIGN 10 -#define opSETRETVAL 11 -#define opSETLOCALSTACK 12 - -// Operand types. - -#define op_IMMEDIATE 1 -#define op_HVAR0 2 -#define op_HVAR1 3 -#define op_UVAR 4 -#define op_UVARRAY 5 -#define op_LVAR 6 -#define op_BFUNC 7 -#define op_UFUNC 8 -#define op_GROUP 9 -#define op_STRING 10 -#define op_SARRAY 11 -#define op_SLOCAL 12 - -// Variable types. - -#define v_IMMEDIATE 1 // is this necessary? -#define v_CHAR 2 -#define v_PTR 3 -#define v_INT 4 - -// IF relational operators. - -#define i_ZERO 1 -#define i_NONZERO 2 -#define i_EQUALTO 3 -#define i_NOTEQUAL 4 -#define i_GREATERTHAN 5 -#define i_LESSTHAN 6 -#define i_GREATERTHANOREQUAL 7 -#define i_LESSTHANOREQUAL 8 -#define i_GROUP 9 -#define i_UNGROUP 10 -#define i_AND 11 -#define i_OR 12 - -// Assignment operators. - -#define a_SET 1 -#define a_INC 2 -#define a_DEC 3 -#define a_INCSET 4 -#define a_DECSET 5 -#define a_MULTSET 6 -#define a_DIVSET 7 - -// Operand combination operators. - -#define op_ADD 1 -#define op_SUB 2 -#define op_MULT 3 -#define op_DIV 4 -#define op_MOD 5 -#define op_SHL 6 -#define op_SHR 7 -#define op_AND 8 -#define op_OR 9 -#define op_XOR 10 -#define op_END 11 - -// String components - -#define s_IMMEDIATE 1 -#define s_GLOBAL 2 -#define s_ARRAY 3 -#define s_NUMSTR 4 -#define s_LEFT 5 -#define s_RIGHT 6 -#define s_MID 7 -#define s_LOCAL 8 -#define s_ADD 9 -#define s_CHR 10 -#define s_END 11 diff --git a/16/v2/source/verge/ENGINE/VDRIVER.C b/16/v2/source/verge/ENGINE/VDRIVER.C deleted file mode 100755 index 69008c64..00000000 --- a/16/v2/source/verge/ENGINE/VDRIVER.C +++ /dev/null @@ -1,2814 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define VDRIVER_H - -#include -#include -#include -#include -#include "verge.h" - -#define SWAP(a,b) { a-=b; b+=a; a=b-a; } - -// ================================= Data ==================================== - -char *DriverDesc; - -byte *screen,*video,*vscreen; -byte pal[768], pal2[768]; -byte *translucency_table; - -int sx, sy; -int tx, ty; -int tsx, tsy; -int cx1=0,cy1=0,cx2=319,cy2=199; - -// Driver function-pointers. -int (*ShutdownVideo) (int i); -int (*ShowPage) (void); - -// ================================= Code ==================================== - -void SetPalette(byte *pall) -{ quad i; - - outp(0x03c8, 0); - for (i=0; i<768; i++) - outp(0x03c9, pall[i]); -} - -void GetPalette() -{ quad i; - - outp(0x03c7, 0); - for (i=0; i<768; i++) - pal[i]=inp(0x03c9); -} - -void set_intensity(quad n) -{ quad i; - - for (i=0; i<768; i++) - pal2[i] = (pal[i] * n) >> 6; - - SetPalette(pal2); -} - -int LFB_ShowPage(void) -{ - if (key[SCAN_ALT] && key[SCAN_X]) err("Exiting: ALT-X pressed."); - RenderGUI(); - cpubyte=PFLIP; - memcpy(video,screen,sx*sy); - cpubyte=ETC; - return 0; -} - -void CopySprite(int x, int y, int width, int height, byte *src) -{ - byte *d; - - cpubyte=RENDER; - d=screen+(y*sx)+x; - for (; height; height--) - { - memcpy(d,src,width); - src+=width; - d+=sx; - } - cpubyte=ETC; -} - -void TCopySprite(int x, int y, int width, int height, byte *src) -{ - byte *d, c; - - cpubyte=RENDER; - d=screen+(y*sx)+x; - for (; height; height--) - { - for (x=0; x>16)]; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void TCopySpriteZoom(int x, int y, int sw, int sh, int dw, int dh, byte *src) -{ - int i,j; - int xerr,yerr; - int xadj,yadj; - byte *d; - byte c; - - cpubyte=RENDER; - if (dw<1 || dh<1) return; - xadj = (sw<<16)/dw; - yadj = (sh<<16)/dh; - d = screen+(y*sx)+x; - yerr=0; - for (i=0; i>16)]; - if (c) - d[j]=c; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void CopySpriteZoomLucent(int x, int y, int sw, int sh, int dw, int dh, byte *src) -{ - int i,j; - int xerr,yerr; - int xadj,yadj; - byte *d; - - cpubyte=RENDER; - if (dw<1 || dh<1) return; - xadj = (sw<<16)/dw; - yadj = (sh<<16)/dh; - d = screen+(y*sx)+x; - yerr=0; - - for (i=0; i>16)]<<8)]; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void TCopySpriteZoomLucent(int x, int y, int sw, int sh, int dw, int dh, byte *src) -{ - int i,j; - int xerr,yerr; - int xadj,yadj; - byte *d; - byte c; - - cpubyte=RENDER; - if (dw<1 || dh<1) return; - xadj = (sw<<16)/dw; - yadj = (sh<<16)/dh; - d = screen+(y*sx)+x; - yerr=0; - - for (i=0; i>16)]; - if (c) - d[j]=c; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void Silhouette(int x, int y, int width, int height, int color, byte *src) -{ - byte *d=0; - - cpubyte=RENDER; - if (height<1 || width<1) return; - d=screen+(y*sx)+x; - do { - for (x=0; x>16)]) - d[x]=color; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } while (--dh); - cpubyte=ETC; -} - -void SilhouetteLucent(int x, int y, int width, int height, int color, byte *src) -{ - byte *d=0; - byte *range=0; - - cpubyte=RENDER; - if (width<1 || height<1) return; - d=screen+(y*sx)+x; - range=translucency_table+(color<<8); - do { - for (x=0; x>16)]) - d[x]=range[d[x]]; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } while (--dh); - cpubyte=ETC; -} - -// aen -void Tint(int x, int y, int width, int height, int color, byte *src) -{ - byte *d=0; - byte *range=0; - byte c=0; - - cpubyte=RENDER; - if (width<1 || height<1) return; - d=screen+(y*sx)+x; - range=translucency_table+(color<<8); - do { - for (x=0; x>16)]; - if (c) - d[x]=range[c]; - xerr+=xadj; - } - d+=sx; - yerr+=yadj; - src+=(yerr>>16)*sw; - yerr &= 0xffff; - } while (--dh); - cpubyte=ETC; -} - -void CopySpriteClip(int x, int y, int width, int height, byte *src) -{ - byte *s,*d; - int xl,yl,xs,ys; - - cpubyte=RENDER; - xl=width; - yl=height; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - yerr = yerr_start & 0xffff; - for (i=0; i>16)]; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void TCopySpriteZoomClip(int x, int y, int sw, int sh, int dw, int dh, byte *src) -{ - int i,j; - int xerr,yerr; - int xerr_start, yerr_start; - int xadj,yadj; - byte *d; - byte c; - int xl,yl,xs,ys; - - cpubyte=RENDER; - if (dw<1 || dh<1) return; - - xl=dw; - yl=dh; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - yerr = yerr_start & 0xffff; - for (i=0; i>16)]; - if (c) - d[j]=c; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void CopySpriteZoomLucentClip(int x, int y, int sw, int sh, int dw, int dh, byte *src) -{ - int i,j; - int xerr,yerr; - int xerr_start, yerr_start; - int xadj,yadj; - byte *d; - int xl,yl,xs,ys; - - cpubyte=RENDER; - if (dw<1 || dh<1) return; - xl=dw; - yl=dh; - xs=ys=0; - - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - yerr = yerr_start & 0xffff; - for (i=0; i>16)]<<8)]; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void TCopySpriteZoomLucentClip(int x, int y, int sw, int sh, int dw, int dh, byte *src) -{ - int i,j; - int xerr,yerr; - int xerr_start, yerr_start; - int xadj,yadj; - byte *d; - int c; - int xl,yl,xs,ys; - - cpubyte=RENDER; - if (dw<1 || dh<1) return; - xl=dw; - yl=dh; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - yerr = yerr_start & 0xffff; - for (i=0; i>16)]; - if (c) - d[j]=translucency_table[d[j]|(c<<8)]; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void SilhouetteClip(int x, int y, int width, int height, int color, byte *src) -{ - byte *s=0,*d=0; - int xl=0,yl=0,xs=0,ys=0; - - cpubyte=RENDER; - xl=width; - yl=height; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - yerr = yerr_start & 0xffff; - for (y=0; y>16)]) - d[x]=color; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void SilhouetteLucentClip(int x, int y, int width, int height, int color, byte *src) -{ - byte *s=0,*d=0; - int xl=0,yl=0,xs=0,ys=0; - byte *range=0; - - cpubyte=RENDER; - xl=width; - yl=height; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - range=translucency_table+(color<<8); - yerr = yerr_start & 0xffff; - for (y=0; y>16)]) - d[x]=range[d[x]]; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -// aen -void TintClip(int x, int y, int width, int height, int color, byte *src) -{ - byte *s=0,*d=0; - int xl=0,yl=0,xs=0,ys=0; - byte *range=0; - byte c=0; - - cpubyte=RENDER; - xl=width; - yl=height; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x>16)*sw); - d = screen+(y*sx)+x; - range=translucency_table+(color<<8); - yerr = yerr_start & 0xffff; - for (y=0; y>16)]; - if (c) - d[x]=range[c]; - xerr+=xadj; - } - d+=sx; - yerr += yadj; - src += (yerr>>16)*sw; - yerr &= 0xffff; - } - cpubyte=ETC; -} - -void CopyTile(int x, int y, byte *src) -{ - CopySpriteClip(x,y,16,16,src); -} - -void TCopyTile(int x, int y, byte *src, byte *matte) -{ - matte=matte; - TCopySpriteClip(x,y,16,16,src); -} - -void CopyTileLucent(int x, int y, byte *src) -{ - CopySpriteLucentClip(x,y,16,16,src); -} - -void TCopyTileLucent(int x, int y, byte *src) -{ - TCopySpriteLucentClip(x,y,16,16,src); -} - -void CopyTileClip(int x, int y, byte *src) -{ - CopySpriteClip(x,y,16,16,src); -} - -void TCopyTileClip(int x, int y, byte *src, byte *matte) -{ - matte=matte; - TCopySpriteClip(x,y,16,16,src); -} - -void CopyTileLucentClip(int x, int y, byte *src) -{ - CopySpriteLucentClip(x,y,16,16,src); -} - -void TCopyTileLucentClip(int x, int y, byte *src) -{ - TCopySpriteLucentClip(x,y,16,16,src); -} - -// aen -void MapLine(int x, int y, int yofs, word *map) -{ - byte *d; - int tilesx,startx; - int counter; - int span, s; - - cpubyte=RENDER; - - // y clipping - if (y<0 || y>=tsy) return; - // x clipping - startx=0; - if (x<0) { startx=-x; x=0; } - - d=screen+(y*sx)+x; - tilesx=(tsx/16); - - // do clipped left tile - counter=0; - s=tileidx[*map]; - memcpy(d, vsp+((s16) span=16; - s=tileidx[*map]; - memcpy(d, vsp+((s=tsy) return; - // x clipping - startx=0; - if (x<0) { startx=-x; x=0; } - - d=screen+(y*sx)+x; - tilesx=(tsx/16); - - // do clipped left tile - counter=0; - s=vsp+(256*tileidx[*map])+(16*yofs)+startx; - for (x=0; x<16-startx; x++) - { - c=s[x]; - if (c) - d[x]=c; - } - d+=16-startx; - counter+=16-startx; - map++; - // do midsection of line - for (y=1; y16) span=16; - s=vsp+(256*tileidx[*map])+(16*yofs); - for (x=0; xcx2 || y>cy2) return; - screen[(y*sx)+x]=color; -} - -void SetPixelLucentClip(int x, int y, int color) -{ - byte *d; - - if (xcx2 || y>cy2) return; - d=screen+(y*sx)+x; - *d=translucency_table[*d|(color<<8)]; -} - -int GetPixel(int x, int y) -{ - return screen[(y*sx)+x]; -} - -int GetPixelClip(int x, int y) -{ - if (xcx2 || y>cy2) return 0; - return screen[(y*sx)+x]; -} - -void ColorField(int x, int y, char c) -{ - int i; - - cpubyte=RENDER; - i=0; - do - { - SetPixelClip(x+0, y+i, 0); - SetPixelClip(x+2, y+i, 0); - SetPixelClip(x+4, y+i, 0); - SetPixelClip(x+6, y+i, 0); - SetPixelClip(x+8, y+i, 0); - SetPixelClip(x+10, y+i, 0); - SetPixelClip(x+12, y+i, 0); - SetPixelClip(x+14, y+i, 0); - i++; - - SetPixelClip(x+0 +1, y+i, 0); - SetPixelClip(x+2 +1, y+i, 0); - SetPixelClip(x+4 +1, y+i, 0); - SetPixelClip(x+6 +1, y+i, 0); - SetPixelClip(x+8 +1, y+i, 0); - SetPixelClip(x+10 +1, y+i, 0); - SetPixelClip(x+12 +1, y+i, 0); - SetPixelClip(x+14 +1, y+i, 0); - i++; - } while (i<16); - cpubyte=ETC; -} - -void HLine(int x, int y, int x2, int color) -{ - cpubyte=RENDER; - if (x2cx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (xcx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (xcx2 || y>cy2 || x cy2) height=cy2-y+1; - if (ycx2 || y>cy2 || x cy2) height=cy2-y+1; - if (yx2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - - if (y1>y2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - cpubyte=ETC; -} - -// grabbed/modded from Abuse source -void LineClip(int x1, int y1, int x2, int y2, int color) -{ - short i,xc,yc,er,n,m,xi,yi,xcxi,ycyi,xcyi; - unsigned dcy,dcx; - - cpubyte=RENDER; - // check to see if the line is completly clipped off - if ((x1cx2 && x2>cx2) - || (y1cy2 && y2>cy2)) - { - cpubyte=ETC; - return; - } - - if (x1>x2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - - // clip the left side - if (x1cx2) - { int myy=(y2-y1); - int mxx=(x2-x1),b; - if (!mxx) - { - cpubyte=ETC; - return; - } - if (myy) - { - b=y1-(y2-y1)*x1/mxx; - y2=myy*cx2/mxx+b; - x2=cx2; - } - else x2=cx2; - } - - if (y1>y2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - - // clip the bottom - if (y2>cy2) - { int mxx=(x2-x1); - int myy=(y2-y1),b; - if (!myy) - { - cpubyte=ETC; - return; - } - if (mxx) - { - b=y1-(y2-y1)*x1/mxx; - x2=(cy2-b)*mxx/myy; - y2=cy2; - } - else y2=cy2; - } - - // clip the top - if (y1cx2 || x2>cx2 || y1cy2 || y2>cy2) - { - cpubyte=ETC; - return; - } - - if (x1>x2) - { xc=x2; xi=x1; } - else { xi=x2; xc=x1; } - - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - cpubyte=ETC; - return; -} - -void LineLucent(int x1, int y1, int x2, int y2, int color) -{ - short i,xc,yc,er,n,m,xi,yi,xcxi,ycyi,xcyi; - unsigned dcy,dcx; - byte *d; - int c; - - cpubyte=RENDER; - if (x1>x2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - if (y1>y2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - c=color<<8; // for translucency - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - d=screen+(dcy*sx)+dcx; - *d=translucency_table[c|*d]; - //screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - d=screen+(dcy*sx)+dcx; - *d=translucency_table[c|*d]; - //screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - cpubyte=ETC; -} - -void LineLucentClip(int x1, int y1, int x2, int y2, int color) -{ - short i,xc,yc,er,n,m,xi,yi,xcxi,ycyi,xcyi; - unsigned dcy,dcx; - byte *d; - int c; - - cpubyte=RENDER; - // check to see if the line is completly clipped off - if ((x1cx2 && x2>cx2) - || (y1cy2 && y2>cy2)) - { - cpubyte=ETC; - return; - } - - if (x1>x2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - - // clip the left side - if (x1cx2) - { int myy=(y2-y1); - int mxx=(x2-x1),b; - if (!mxx) - { - cpubyte=ETC; - return; - } - if (myy) - { - b=y1-(y2-y1)*x1/mxx; - y2=myy*cx2/mxx+b; - x2=cx2; - } - else x2=cx2; - } - - if (y1>y2) - { - SWAP(x1,x2); - SWAP(y1,y2); - } - - // clip the bottom - if (y2>cy2) - { int mxx=(x2-x1); - int myy=(y2-y1),b; - if (!myy) - { - cpubyte=ETC; - return; - } - if (mxx) - { - b=y1-(y2-y1)*x1/mxx; - x2=(cy2-b)*mxx/myy; - y2=cy2; - } - else y2=cy2; - } - - // clip the top - if (y1cx2 || x2>cx2 || y1cy2 || y2>cy2) - { - cpubyte=ETC; - return; - } - - if (x1>x2) - { xc=x2; xi=x1; } - else { xi=x2; xc=x1; } - - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - c=color<<8; // for translucency - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - d=screen+(dcy*sx)+dcx; - *d=translucency_table[c|*d]; - //screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - d=screen+(dcy*sx)+dcx; - *d=translucency_table[c|*d]; - //screen[(dcy*sx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - cpubyte=ETC; -} - -// All the Circle* routines were grabbed/modded from Allegro source - -void Circle(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - do - { - SetPixel(x+cx,y+cy,color); - if (cx) SetPixel(x-cx,y+cy,color); - if (cy) SetPixel(x+cx,y-cy,color); - if ((cx) && (cy)) SetPixel(x-cx,y-cy,color); - - if (cx != cy) - { - SetPixel(x+cy,y+cx,color); - if (cx) SetPixel(x+cy,y-cx,color); - if (cy) SetPixel(x-cy,y+cx,color); - if (cx && cy) SetPixel(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleClip(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - do { - SetPixelClip(x+cx,y+cy,color); - if (cx) SetPixelClip(x-cx,y+cy,color); - if (cy) SetPixelClip(x+cx,y-cy,color); - if ((cx) && (cy)) SetPixelClip(x-cx,y-cy,color); - - if (cx != cy) - { - SetPixelClip(x+cy,y+cx,color); - if (cx) SetPixelClip(x+cy,y-cx,color); - if (cy) SetPixelClip(x-cy,y+cx,color); - if (cx && cy) SetPixelClip(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleLucent(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do - { - SetPixelLucent(x+cx,y+cy,color); - if (cx) SetPixelLucent(x-cx,y+cy,color); - if (cy) SetPixelLucent(x+cx,y-cy,color); - if ((cx) && (cy)) SetPixelLucent(x-cx,y-cy,color); - - if (cx != cy) - { - SetPixelLucent(x+cy,y+cx,color); - if (cx) SetPixelLucent(x+cy,y-cx,color); - if (cy) SetPixelLucent(x-cy,y+cx,color); - if (cx && cy) SetPixelLucent(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleLucentClip(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - do - { - SetPixelLucentClip(x+cx,y+cy,color); - if (cx) SetPixelLucentClip(x-cx,y+cy,color); - if (cy) SetPixelLucentClip(x+cx,y-cy,color); - if ((cx) && (cy)) SetPixelLucentClip(x-cx,y-cy,color); - - if (cx != cy) - { - SetPixelLucentClip(x+cy,y+cx,color); - if (cx) SetPixelLucentClip(x+cy,y-cx,color); - if (cy) SetPixelLucentClip(x-cy,y+cx,color); - if (cx && cy) SetPixelLucentClip(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleFill(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do - { - HLine(x-cy,y-cx,x+cy,color); - if (cx) HLine(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - HLine(x-cx,y-cy,x+cx,color); - if (cy) HLine(x-cx,y+cy,x+cx,color); - } - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleFillClip(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - do - { - HLineClip(x-cy,y-cx,x+cy,color); - if (cx) HLineClip(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - HLineClip(x-cx,y-cy,x+cx,color); - if (cy) HLineClip(x-cx,y+cy,x+cx,color); - } - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleFillLucent(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - do - { - HLineLucent(x-cy,y-cx,x+cy,color); - if (cx) HLineLucent(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - HLineLucent(x-cx,y-cy,x+cx,color); - if (cy) HLineLucent(x-cx,y+cy,x+cx,color); - } - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void CircleFillLucentClip(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - do - { - HLineLucentClip(x-cy,y-cx,x+cy,color); - if (cx) HLineLucentClip(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - HLineLucentClip(x-cx,y-cy,x+cx,color); - if (cy) HLineLucentClip(x-cx,y+cy,x+cx,color); - } - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - cx++; - } while (cx <= cy); - cpubyte=ETC; -} - -void Rect(int x, int y, int x2, int y2, int color) -{ - HLine(x,y,x2,color); - HLine(x,y2,x2,color); - VLine(x,y+1,y2-1,color); - VLine(x2,y+1,y2-1,color); -} - -void RectClip(int x, int y, int x2, int y2, int color) -{ - HLineClip(x,y,x2,color); - HLineClip(x,y2,x2,color); - VLineClip(x,y+1,y2-1,color); - VLineClip(x2,y+1,y2-1,color); -} - -void RectLucent(int x, int y, int x2, int y2, int color) -{ - HLineLucent(x,y,x2,color); - HLineLucent(x,y2,x2,color); - VLineLucent(x,y+1,y2-1,color); - VLineLucent(x2,y+1,y2-1,color); -} - -void RectLucentClip(int x, int y, int x2, int y2, int color) -{ - HLineLucentClip(x,y,x2,color); - HLineLucentClip(x,y2,x2,color); - VLineLucentClip(x,y+1,y2-1,color); - VLineLucentClip(x2,y+1,y2-1,color); -} - -void RectFill(int x, int y, int x2, int y2, int color) -{ - cpubyte=RENDER; - if (y2=clipw) - spanx=clipw-curx; - source=src+(y*wide)+x; - dest=screen+(cy1*sx)+cx1+curx; - cury=0; - - do - { - spany=high-(cury?0:y); - if (cury+spany>=cliph) - spany=cliph-cury; - - for (i=0; i=clipw) - spanx=clipw-curx; - source=src+(y*wide)+x; - dest=screen+(cy1*sx)+cx1+curx; - cury=0; - - do - { - spany=high-(cury?0:y); - if (cury+spany>=cliph) - spany=cliph-cury; - for (i=0; i=clipw) - spanx=clipw-curx; - source=src+(y*wide)+x; - dest=screen+(cy1*sx)+cx1+curx; - cury=0; - - do - { - spany=high-(cury?0:y); - if (cury+spany>=cliph) - spany=cliph-cury; - for (i=0; i=clipw) - spanx=clipw-curx; - source=src+(y*wide)+x; - dest=screen+(cy1*sx)+cx1+curx; - cury=0; - - do - { - spany=high-(cury?0:y); - if (cury+spany>=cliph) - spany=cliph-cury; - for (i=0; i>1; - T_HEIGHT_CENTER=height>>1; - W_WIDTH=((float)width/scale*sin(ft) + (float)height/scale*cos(ft)); - W_HEIGHT=W_WIDTH; - W_HEIGHT_CENTER=W_HEIGHT>>1; - W_WIDTH_CENTER=W_HEIGHT_CENTER; //W_WIDTH/2; - - sinas=sin(-angle)*65536*scale; - cosas=cos(-angle)*65536*scale; - - xc=T_WIDTH_CENTER*65536 - (W_HEIGHT_CENTER*(cosas+sinas)); - yc=T_HEIGHT_CENTER*65536 - (W_WIDTH_CENTER*(cosas-sinas)); - posx-=W_WIDTH_CENTER; - posy-=W_HEIGHT_CENTER; - - // clipping - if (W_WIDTH<2 || W_HEIGHT<2) return; - xl=W_WIDTH; - yl=W_HEIGHT; - xs=ys=0; - if (posx>cx2 || posy>cy2 || posx+xl cx2) xl=cx2-posx+1; - if (posy+yl > cy2) yl=cy2-posy+1; - if (posx>16); - tempy=(srcy>>16); - - if (tempx>=0 && tempx=0 && tempy y3) - { - swaptemp=x1; x1=x3; x3=swaptemp; - swaptemp=y1; y1=y3; y3=swaptemp; - } - if (y2 > y3) - { - swaptemp=x2; x2=x3; x3=swaptemp; - swaptemp=y2; y2=y3; y3=swaptemp; - } - if (y1 > y2) - { - swaptemp=x1; x1=x2; x2=swaptemp; - swaptemp=y1; y1=y2; y2=swaptemp; - } - - xstep2=((x3-x1) << 16) / (y3-y1); - xval2=x1 << 16; - - if (y1 != y2) - { - xstep = ((x2-x1) << 16) / (y2-y1); - xval = x1 << 16; - for (yon=y1;yon < y2; yon++) - { - if ((yon > -1) && (yon < 200)) - { - HLineClip(xval>>16,yon,xval2>>16,color); - } - xval+=xstep; - xval2+=xstep2; - } - } - if (y2 != y3) - { - xstep = ((x3-x2) << 16) / (y3-y2); - xval = x2 << 16; - for (yon=y2;yon < y3; yon++) - { - if ((yon > -1) && (yon < 200)) - { - HLineClip(xval>>16,yon,xval2>>16,color); - } - xval+=xstep; - xval2+=xstep2; - } - } -} - -char *image; -int texw,texh; // those damn bastards want EVERYTHING! - -void tmaphline(int x1, int x2, int y, int tx1, int tx2, int ty1, int ty2) -{ - int i; - int txstep,txval; - int tystep,tyval; - - if (x1 != x2) - { - if (x2 < x1) - { - i=x1; x1=x2; x2=i; - i=tx1; tx1=tx2; tx2=i; - i=ty1; ty1=ty2; ty2=i; - } - if ((x1 > sx) || (x2 < 0)) return; - txstep=((tx2-tx1)<<16)/(x2-x1); - tystep=((ty2-ty1)<<16)/(x2-x1); - txval=tx1<<16; - tyval=ty1<<16; - - for (i=x1;i>16)*texw+(txval>>16)]; - txval+=txstep; - tyval+=tystep; - } - } -} - -void TMapPoly(int x1, int y1, int x2, int y2, int x3, int y3, - int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, - int tw, int th, char *img) -{ - int xstep,xstep2; - int xval,xval2; - int txstep,txstep2; - int tystep,tystep2; - int txval,txval2; - int tyval,tyval2; - int yon; - int swaptemp; - - image=img; texw=tw; texh=th; - if (y1 > y3) - { - swaptemp=x1; x1=x3; x3=swaptemp; - swaptemp=y1; y1=y3; y3=swaptemp; - swaptemp=tx1; tx1=tx3; tx3=swaptemp; - swaptemp=ty1; ty1=ty3; ty3=swaptemp; - } - if (y2 > y3) - { - swaptemp=x2; x2=x3; x3=swaptemp; - swaptemp=y2; y2=y3; y3=swaptemp; - swaptemp=tx2; tx2=tx3; tx3=swaptemp; - swaptemp=ty2; ty2=ty3; ty3=swaptemp; - } - if (y1 > y2) - { - swaptemp=x1; x1=x2; x2=swaptemp; - swaptemp=y1; y1=y2; y2=swaptemp; - swaptemp=tx1; tx1=tx2; tx2=swaptemp; - swaptemp=ty1; ty1=ty2; ty2=swaptemp; - } - xstep2=((x3-x1) << 16) / (y3-y1); - xval2=x1 << 16; - txstep2=((tx3-tx1) << 16) / (y3-y1); - txval2=tx1 << 16; - tystep2=((ty3-ty1) << 16) / (y3-y1); - tyval2=ty1 << 16; - - if (y1 != y2) - { - xstep = ((x2-x1) << 16) / (y2-y1); - xval = x1 << 16; - txstep = ((tx2-tx1) << 16) / (y2-y1); - txval = tx1 << 16; - tystep = ((ty2-ty1) << 16) / (y2-y1); - tyval = ty1 << 16; - - for (yon=y1;yon < y2; yon++) - { - if ((yon > -1) && (yon < 200)) - { - tmaphline(xval>>16,xval2>>16,yon,txval>>16,txval2>>16, - tyval>>16,tyval2>>16); - } - xval+=xstep; - xval2+=xstep2; - txval+=txstep; - txval2+=txstep2; - tyval+=tystep; - tyval2+=tystep2; - } - } - if (y2 != y3) - { - xstep = ((x3-x2) << 16) / (y3-y2); - xval = x2 << 16; - txstep = ((tx3-tx2) << 16) / (y3-y2); - txval = tx2 << 16; - tystep = ((ty3-ty2) << 16) / (y3-y2); - tyval = ty2 << 16; - - for (yon=y2;yon < y3; yon++) - { - if ((yon > -1) && (yon < 200)) - { - tmaphline(xval>>16,xval2>>16,yon,txval>>16,txval2>>16, - tyval>>16,tyval2>>16); - } - xval+=xstep; - xval2+=xstep2; - txval+=txstep; - txval2+=txstep2; - tyval+=tystep; - tyval2+=tystep2; - } - } -} - -/* -// ============================================================================ -// = aen's ripple-blitter = -// ============================================================================ - -int thresh; -int dispx[64],dispy[64]; - -void InitDisplaceStuff(float xmag, float ymag) -{ - int x, y, *d; - - xmag=4.0,d=dispx; - for (y=0; y<32; y++) - *d++=sin(y * (360.0/32) * (3.14/180))*xmag; - - ymag=3.9,d=dispy; - for (x=0; x<32; x++) - *d++=cos(x * (360.0/32) * (3.14/180))*ymag; - - thresh=14; -} - -void CopyTileDisplace(int x, int y, unsigned char *spr) -{ - int i, j; - int xx, yy, xt, yt; - int xin, yin; - byte *dest; - - xin = ((x+xwin)&31)<16 ? 0 : 16; - yin = ((y+ywin)&31)<16 ? 0 : 16; - dest=screen+(y*sx)+x; - - // in the yy and xx calcs, +y and +x keep the start position correct - // within the 32 element lookup tables (ie. so they flow continuously - // across the 16x16 images). - - for (j=0; j<16; j++) - { - yy = (j+yin+thresh) & 31; - for (i=0; i<16; i++) - { - xx = (i+xin+thresh) & 31; - xt = (i+dispx[yy]) & 15; - yt = (j+dispy[xx]) & 15; - - dest[i]=spr[(yt*16)+xt]; - } - dest+=sx; - } -} - -void CopyTileDisplaceClip(int x, int y, unsigned char *spr) -{ - byte *s,*d; - int xl,yl,xs,ys; - int i, j; - int xx, yy, xt, yt; - int xin, yin; - - cpubyte=RENDER; - xl=16; - yl=16; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x // va_* - -#include "verge.h" - -// ================================= Data ==================================== - -// declared in VDRIVER.C -extern byte* translucency_table; - -char *strbuf=0; // Universal temporary string buffer. :) -char joyflag=0; -int vidxres=0,vidyres=0; // Joystick on/off | Video mode to use -char logoutput=0; // Verbose debugging startup mode -char nocdaudio=0; // do not use CD audio -char startmap[80]; // startup map -FILE *logf=0; // logfile file handle - -// ================================= Code ==================================== - -void InitializeDefaults() -{ - kb1=28; kb2=56; kb3=1; kb4=57; // default keyboard controls - jb1=1; jb2=2; jb3=3; jb4=4; // default joystick controls - joyflag=0; // joystick defaults to disabled - vidxres=320; vidyres=200; - logoutput=0; // Don't be annoyingly verbose - strbuf=(char *) valloc(2000, "strbuf", OID_TEMP); - memcpy(startmap,"test.map\0",9); - - md_mixfreq=44100; - md_dmabufsize=2000; - md_mode=DMODE_16BITS|DMODE_STEREO; - md_device=0; -} - -static VFILE *user_cfg_file=0; -static char parse_str[256]; - -static char *parse_cfg_token() -{ - vscanf(user_cfg_file, "%s", parse_str); - return parse_str; -} - -// compares string against parse_str (grabbed by parse_cfg_token) -// 0=mismatch, 1=match -static int parse_match(char *str) -{ - return !strcmp(parse_str, str); -} - -void ParseStartupFiles() -{ - user_cfg_file = vopen("user.cfg"); - if (!user_cfg_file) - { - printf("Could not open user.cfg. \n"); - exit(-1); - } - - while (1) - { - parse_cfg_token(); - - // mounts a pack file; up to 3? (perhaps gaurd against more?) - if (parse_match("mount")) - { MountVFile(parse_cfg_token()); continue; } - // set video resolution - else if (parse_match("vidmode")) - { - vidxres = atoi(parse_cfg_token()); - vidyres = atoi(parse_cfg_token()); - - // check validity - if (vidxres != 256 && vidxres != 320 - && vidxres != 360 && vidxres != 640) - { - Log("user.cfg: invalid resolution width %i passed to vidmode", - vidxres); - } - if (vidyres != 200 && vidyres != 240 - && vidyres != 256 && vidyres != 480) - { - Log("user.cfg: invalid resolution height %i passed to vidmode", - vidyres); - } - - continue; - } - // log to VERGE.LOG - else if (parse_match("log")) - { - logoutput=1; - continue; - } - // disable CD playing - else if (parse_match("nocdaudio")) - { - nocdaudio=1; - continue; - } - // map VERGE.EXE will run first when executed - else if (parse_match("startmap")) - { - strcpy(startmap, parse_cfg_token()); - continue; - } - // 0=auto detect, 1=???, 2=???, 3=nosound - else if (parse_match("sound_device")) - { - md_device = atoi(parse_cfg_token()); - continue; - } - // sound lib setting - else if (parse_match("mixrate")) - { - md_mixfreq = atoi(parse_cfg_token()); - continue; - } - // sound lib setting - else if (parse_match("dmabufsize")) - { - md_dmabufsize = atoi(parse_cfg_token()); - continue; - } - // sound lib setting - else if (parse_match("force8bit")) - { - continue; - } - // sound lib setting - else if (parse_match("forcemono")) - { - continue; - } - - // unknown command, assume end - break; - } - - // done parsing config - vclose(user_cfg_file); -} - -void ParseAutoCFG() -{ VFILE *f; - int i; - - if (!(f=vopen("auto.cfg"))) return; - - while (1) - { - vgets((char *) cmd, 40, f); - for (i=0; i<(signed) strlen((char *) cmd); i++) - if (cmd[i]==10 || cmd[i]==13) cmd[i]=0; - if (strlen((char*) cmd)<2) break; - ProcessCommand(); - } - vclose(f); -} - -void InitLog() -{ - if (logoutput) - { - remove("verge.log"); - } -} - -void Log(char *message, ...) -{ - char tempbuf[256]; - va_list lst; - - if (!logoutput) return; - - va_start(lst, message); - vsprintf(tempbuf, message, lst); - va_end(lst); - - logf = fopen("verge.log", "aw"); - if (!logf) err("unable to log to verge.log"); - - fprintf(logf, "%s \n", tempbuf); - fflush(logf); - - fclose(logf); -} - -// used in conjunction with LogDone() -void Logp(char *message, ...) -{ - char tempbuf[256]; - va_list lst; - - if (!logoutput) return; - - va_start(lst, message); - vsprintf(tempbuf, message, lst); - va_end(lst); - - logf = fopen("verge.log", "aw"); - if (!logf) err("unable to log to verge.log"); - - fprintf(logf, "%s", tempbuf); - fflush(logf); - - fclose(logf); -} - -void LogDone() -{ - if (!logoutput) return; - - logf = fopen("verge.log", "aw"); - if (!logf) err("unable to log to verge.log"); - - fprintf(logf, "... OK \n"); - fflush(logf); - - fclose(logf); -} - -void InitSystems() -{ - InitLog(); - Log("V2 startup. Logfile initialized."); - Logp("Sys: Initializing keyboard handler."); - InitKeyboard(); - LogDone(); -#ifdef __DJGPP__ - keyboard_chain(0); -#endif - Logp("Sys: Initializing timer. Set 100hz."); - InitTimer(); - LogDone(); - - /* - Logp("Sys: Initializing CD Audio."); - CD_Init(); - LogDone(); - */ - - Logp("Sys: Initializing music system."); - InitMusicSystem(); - LogDone(); - - InitVideo(vidxres, vidyres); -} - -void LoadTransTable() -{ - FILE *fp=0; - - if (translucency_table) - { free(translucency_table); translucency_table=0; } - translucency_table=(byte *)valloc(65536, "translucency_table", OID_MISC); - - fp = fopen("trans.tbl", "rb"); - if (!fp) err("Could not open trans.tbl."); - - fread(translucency_table, 65536, 1, fp); - - fclose(fp); -} - -void vmain(int argc, char *argv[]) -{ - char temp[256]; - - InitializeDefaults(); - ParseStartupFiles(); - InitSystems(); - if (argc==2) - { - memcpy(startmap, argv[1], strlen(argv[1])); - } - - InitConsole(); - sprintf(temp,"VERGE System Version %s", VERSION); - Con_Printf(temp); - Con_Printf("Copyright (C)1998 vecna"); - - ParseAutoCFG(); - LoadTransTable(); - LoadSystemVC(); - LoadMAP(startmap); - - while (1) - { - while (timer_count!=0) - { - timer_count--; - GameTick(); - } - Render(); - - ShowPage(); - if (kill) - { - FreeVSP(); - FreeMAP(); - FreeCHRList(); - vcsp=vcstack; - kill=0; - LoadMAP(startmap); - } - } -} diff --git a/16/v2/source/verge/ENGINE/VERGE.H b/16/v2/source/verge/ENGINE/VERGE.H deleted file mode 100755 index 3d782c32..00000000 --- a/16/v2/source/verge/ENGINE/VERGE.H +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// Wee. A generic #include. I feel so warm and fuzzy inside. :) - -#define VERSION "2.01b" - -#include - -#include -#include -#include - -#define byte unsigned char -#define word unsigned short int -#define quad unsigned int - -#define TRUE 1 -#define FALSE 0 - -#include "inter.h" -#include "a_memory.h" -#include "vfile.h" -#include "conlib.h" -#include "console.h" -#include "controls.h" -#include "engine.h" -#include "entity.h" -#include "fli.h" -#include "font.h" -#include "image.h" -#include "keyboard.h" -#include "main.h" -#include "message.h" -#include "mikmod.h" -#include "render.h" -#include "sound.h" -#include "timer.h" -#include "vc.h" -#include "vdriver.h" - -extern char *strbuf; \ No newline at end of file diff --git a/16/v2/source/verge/ENGINE/VESA.C b/16/v2/source/verge/ENGINE/VESA.C deleted file mode 100755 index a97fbe6a..00000000 --- a/16/v2/source/verge/ENGINE/VESA.C +++ /dev/null @@ -1,776 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include -#include -#include "verge.h" - -// ================================= Data ==================================== - -byte *vesascreen, *vesascreenx; // virscr | realscr - -// ================================= Code ==================================== - -void VESASetMode(int mode) -{ - REGISTERS r; - SET_AX(r, mode); - INTERRUPT(0x10, r); -} - -int VESAShutdown(void) -{ - VESASetMode(0x3); - free(vesascreen); - return 0; -} - -void VESASetBank(int bank) -{ - REGISTERS r; - SET_AX(r, 0x4f05); - SET_BX(r, 0); - SET_DX(r, bank); - INTERRUPT(0x10, r); -} - -int VESAShowPage(void) -{ byte *s,*d; - int y,bytes,bank; - int span; - - RenderGUI(); - cpubyte=PFLIP; - - s=vesascreen+(16*tsx)+16; - d=vesascreenx; - - bank=0; - bytes=65536; - VESASetBank(bank++); - - for (y=sy; y; y--) - { - if (bytes >= sx) - { memcpy(d,s,sx); - bytes-=sx; - s+=sx; - d+=sx; - } - else - { memcpy(d,s,bytes); - s+=bytes; - span=sx-bytes; - - VESASetBank(bank++); - d=vesascreenx; - bytes=65536; - - memcpy(d,s,span); - bytes-=span; - s+=span; - d+=span; - } - s+=32; - } - - cpubyte=ETC; - return 0; -} - -int VESACopySprite(int x, int y, int width, int height, byte *src) -{ - cpubyte=RENDER; - - asm("movl %3, %%edx \n\t" - "movl %4, %%esi \n\t" -"csl0: \n\t" - "movl %1, %%eax \n\t" - "imul $672, %%eax \n\t" - "addl %0, %%eax \n\t" - "addl _vesascreen, %%eax \n\t" - "movl %%eax, %%edi \n\t" - "movl %2, %%ecx \n\t" - "shrl $2, %%ecx \n\t" - "repz \n\t" - "movsl \n\t" - "incl %1 \n\t" - "decl %%edx \n\t" - "jnz csl0 \n\t" - : - : "m" (x), "m" (y), "m" (width), "m" (height), "m" (src) - : "eax","edx","esi","edi","ecx","cc" ); - cpubyte=ETC; - return 0; -} - -int VESACCopySprite(int x,int y,int width,int height,byte *src) -{ - byte *s,*d; - int xl,yl,xs,ys; - int cx1=0, cy1=0, cx2=tsx-1, cy2=tsy-1; - - cpubyte=RENDER; - - xl=width; - yl=height; - xs=ys=0; - - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (x0 && th>0) dys=tsx-xm; - else if (tw>0 && th<0) dys=(0-tsx)-xm; - else if (tw<0 && th>0) dys=tsx+xm; - else if (tw<0 && th<0) dys=(0-tsx)+xm; - - d = vesascreen+(y*tsx)+x; - for (i=0;i>16)]; - d+=xd; - sx+=xs; - } - d+=dys; - sy+=ys; - s+=(sy>>16)*w; - sy&=0xffff; - } - cpubyte=ETC; - return 0; -} - -int VESARenderMAPLine(int x, int y, int yofs, word *map) -{ - cpubyte=RENDER; - // ... - cpubyte=ETC; - return 0; -} - -int VESATRenderMAPLine(int x, int y, int yofs, word *map) -{ - cpubyte=RENDER; - // ... - cpubyte=ETC; - return 0; -} - -int VESAColorField(int x, int y, byte c) -{ - cpubyte=RENDER; - // ... - cpubyte=ETC; - return 0; -} - -int VESAClearScreen() -{ - cpubyte=RENDER; - memset(vesascreen+(672*16)+16,0,(672*480)); - cpubyte=ETC; - return 0; -} - -int VESAPutPixel(int x, int y, int color) -{ - cpubyte=RENDER; - - if (xcx2 || y>cy2) - { - cpubyte=ETC; - return 0; - } - - x+=16; - y+=16; - - vesascreen[(y*tsx)+x]=color; - - cpubyte=ETC; - return 0; -} - -int VESAGetPixel(int x, int y) -{ - cpubyte=RENDER; - - if (xcx2 || y>cy2) - { - cpubyte=ETC; - return 0; - } - - x+=16; - y+=16; - - cpubyte=ETC; - return vesascreen[(y*tsx)+x]; - return 0; -} - -int VESAHLine(int x, int y, int x2, int color) -{ - byte *d; - int width; - - cpubyte=RENDER; - - // swap? - if (x2cx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (xcx2 || y>cy2 || x cy2) height=cy2-y+1; - if (ycx2 && x2>cx2) - || (y1cy2 && y2>cy2)) - { - cpubyte=ETC; - return 0; - } - - if (x1>x2) - { - i=x1; x1=x2; x2=i; - i=y1; y1=y2; y2=i; - } - - // clip the left side - if (x1cx2) - { int myy=(y2-y1); - int mxx=(x2-x1),b; - if (!mxx) - { - cpubyte=ETC; - return 0; - } - if (myy) - { - b=y1-(y2-y1)*x1/mxx; - y2=myy*cx2/mxx+b; - x2=cx2; - } - else x2=cx2; - } - - if (y1>y2) - { - i=x1; x1=x2; x2=i; - i=y1; y1=y2; y2=i; - } - - // clip the bottom - if (y2>cy2) - { int mxx=(x2-x1); - int myy=(y2-y1),b; - if (!myy) - { - cpubyte=ETC; - return 0; - } - if (mxx) - { - b=y1-(y2-y1)*x1/mxx; - x2=(cy2-b)*mxx/myy; - y2=cy2; - } - else y2=cy2; - } - - // clip the top - if (y1cx2 || x2>cx2 || y1cy2 || y2>cy2) - { - cpubyte=ETC; - return 0; - } - - if (x1>x2) - { xc=x2; xi=x1; } - else { xi=x2; xc=x1; } - - x1+=16;y1+=16; // aen; adjust these here?? - x2+=16;y2+=16; - - // assume y1<=y2 from above swap operation - yi=y2; yc=y1; - - dcx=x1; dcy=y1; - xc=(x2-x1); yc=(y2-y1); - if (xc<0) xi=-1; else xi=1; - if (yc<0) yi=-1; else yi=1; - n=abs(xc); m=abs(yc); - ycyi=abs(2*yc*xi); - er=0; - - if (n>m) - { - xcxi=abs(2*xc*xi); - for (i=0;i<=n;i++) - { - vesascreen[(dcy*tsx)+dcx]=color; - if (er>0) - { dcy+=yi; - er-=xcxi; - } - er+=ycyi; - dcx+=xi; - } - } - else - { - xcyi=abs(2*xc*yi); - for (i=0;i<=m;i++) - { - vesascreen[(dcy*tsx)+dcx]=color; - if (er>0) - { dcx+=xi; - er-=ycyi; - } - er+=xcyi; - dcy+=yi; - } - } - - cpubyte=ETC; - return 0; -} - -int VESACircle(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do { - VESAPutPixel(x+cx,y+cy,color); - if (cx) VESAPutPixel(x-cx,y+cy,color); - if (cy) VESAPutPixel(x+cx,y-cy,color); - if ((cx) && (cy)) VESAPutPixel(x-cx,y-cy,color); - - if (cx != cy) - { - VESAPutPixel(x+cy,y+cx,color); - if (cx) VESAPutPixel(x+cy,y-cx,color); - if (cy) VESAPutPixel(x-cy,y+cx,color); - if (cx && cy) VESAPutPixel(x-cy,y-cx,color); - } - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - - cx++; - - } while (cx <= cy); - - cpubyte=ETC; - return 0; -} - -int VESACircleFill(int x, int y, int radius, int color) -{ - int cx=0; - int cy=radius; - int df=1-radius; - int d_e=3; - int d_se=-2*radius+5; - - cpubyte=RENDER; - - do { - VESAHLine(x-cy,y-cx,x+cy,color); - if (cx) VESAHLine(x-cy,y+cx,x+cy,color); - - if (df<0) - { - df+=d_e; - d_e+=2; - d_se+=2; - } - else - { - if (cx != cy) - { - VESAHLine(x-cx,y-cy,x+cx,color); - if (cy) VESAHLine(x-cx,y+cy,x+cx,color); - } - - df+=d_se; - d_e+=2; - d_se+=4; - cy--; - } - - cx++; - - } while (cx <= cy); - - cpubyte=ETC; - return 0; -} - -int VESARect(int x, int y, int x2, int y2, int color) -{ - VESAHLine(x,y,x2,color); - VESAHLine(x,y2,x2,color); - VESAVLine(x,y+1,y2-1,color); - VESAVLine(x2,y+1,y2-1,color); - return 0; -} - -int VESARectFill(int x, int y, int x2, int y2, int color) -{ - cpubyte=RENDER; - - if (y2=0; i--) - { - for (j=0; jfp=pack[i].vhandle; - tmp->s=1; - tmp->v=i; - tmp->i=j; - pack[i].files[j].curofs=0; - fseek(tmp->fp, pack[i].files[j].packofs, 0); - pack[i].curofs=pack[i].files[j].packofs; - return tmp; - } - - tmp->fp=fopen(fname,"rb"); - tmp->s=0; tmp->v=0; tmp->i=0; - return tmp; -} - -void vread(char *dest, int len, VFILE *f) -{ - // This is fairly simple.. Just make sure our filepointer is at the right - // place, then do a straight fread. - - if (f->s) - { - if (pack[f->v].curofs != (pack[f->v].files[f->i].packofs + pack[f->v].files[f->i].curofs)) - fseek(f->fp, pack[f->v].files[f->i].curofs+pack[f->v].files[f->i].packofs, 0); - pack[f->v].files[f->i].curofs+=len; - pack[f->v].curofs+=len; - } - fread(dest, 1, len, f->fp); -} - -void vclose(VFILE *f) -{ - if (!f) return; - if (!f->s) fclose(f->fp); - f->fp=0; - vfree(f); -} - -int filesize(VFILE *f) -{ - int oldpos, tmp; - - // Filesize for Vfiles is real simple. - if (f->s) return pack[f->v].files[f->i].size; - - // It's a bit more complex for external files. - oldpos=ftell(f->fp); - fseek(f->fp, 0, 2); - tmp=ftell(f->fp); - fseek(f->fp, oldpos, 0); - return tmp; -} - -int vtell(VFILE *f) -{ - if (!f->s) - { - return ftell(f->fp); - } - - return pack[f->v].files[f->i].curofs; -} - -void vseek(VFILE *f, int offset, int origin) -{ - if (!f->s) - { - fseek(f->fp, offset, origin); - return; - } - - switch(origin) - { - case 0: pack[f->v].files[f->i].curofs=offset; - fseek(f->fp, offset+pack[f->v].files[f->i].packofs, 0); - return; - case 1: pack[f->v].files[f->i].curofs+=offset; - fseek(f->fp, offset, 1); - return; - case 2: pack[f->v].files[f->i].curofs=pack[f->v].files[f->i].size-offset; - fseek(f->fp, pack[f->v].files[f->i].curofs+pack[f->v].files[f->i].packofs, 0); - return; - } -} - -void _vscanf(VFILE *f, char *format, char *dest) -{ - fscanf(f->fp, format, dest); - if (f->s) - pack[f->v].files[f->i].curofs=ftell(f->fp)-pack[f->v].files[f->i].packofs; -} - -char vgetc(VFILE *f) -{ char c=0; - - vread(&c, 1, f); - return c; -} - -word vgetw(VFILE *f) -{ word c=0; - - vread((char *) &c, 2, f); - return c; -} - -void vgets(char *str, int len, VFILE *f) -{ - if (f->s) - { - if (pack[f->v].curofs != (pack[f->v].files[f->i].packofs + pack[f->v].files[f->i].curofs)) - fseek(f->fp, pack[f->v].files[f->i].curofs+pack[f->v].files[f->i].packofs, 0); - pack[f->v].files[f->i].curofs+=len; - pack[f->v].curofs+=len; - } - fgets(str, len, f->fp); -} diff --git a/16/v2/source/verge/ENGINE/VFILE.H b/16/v2/source/verge/ENGINE/VFILE.H deleted file mode 100755 index b6beb802..00000000 --- a/16/v2/source/verge/ENGINE/VFILE.H +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef VFILE_H -#define VFILE_H - -#define vscanf _vscanf - -typedef struct -{ - FILE *fp; // real file pointer. - byte s; // 0=real file 1=vfile; - byte v; // if vfile, which vfile index - byte i; // which file index in vfile is it? - byte p; // data alignment pad. :) -} VFILE; - -struct filestruct -{ - unsigned char fname[84]; // pathname thingo - int size; // size of the file - int packofs; // where the file can be found in PACK - int curofs; // current file offset. - char extractable; // irrelevant to runtime, but... - char override; // should we override? -}; - -struct mountstruct -{ - char mountname[80]; // name of VRG packfile. - FILE *vhandle; // Real file-handle of packfile. - struct filestruct *files; // File record array. - int numfiles; // number of files in pack. - int curofs; // Current filepointer. -}; - -extern struct mountstruct pack[3]; -extern char filesmounted; - -int Exist(char *fname); -VFILE *vopen(char *fname); -void MountVFile(char *fname); -void vread(void *dest, int len, VFILE *f); -void vclose(VFILE *f); -int filesize(VFILE *f); -int vtell(VFILE *f); -void vseek(VFILE *f, int offset, int origin); -void vscanf(VFILE *f, char *format, char *dest); -char vgetc(VFILE *f); -word vgetw(VFILE *f); -void vgets(char *str, int len, VFILE *f); -#endif diff --git a/16/v2/source/verge/MAPED/A_MEMORY.C b/16/v2/source/verge/MAPED/A_MEMORY.C deleted file mode 100755 index c8f1598b6..00000000 --- a/16/v2/source/verge/MAPED/A_MEMORY.C +++ /dev/null @@ -1,211 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -void err(char *str, ...); -void Log(char *str, ...); - -// ***** -// TODO: Move the chunk list from an array to a linked list? -// Would eliminate hardcoded chunk limit, but would make -// general operation slower. Probably not The Right Thing, -// sides the chunk limit can be interesting sometimes. If -// it becomes problematic, consider a Binary Tree. -// ***** - -// ***************************** Data ***************************** - -#define MAXCHUNKS 200 -#define PARANOID 1 -#define PADFILLVALUE 254 -#define PADSIZE 256 - -void MemReport(void); - -#define errm MemReport(), err - -typedef struct -{ - void *pointer; - int size; - int owner; - char desc[20]; -} memblockType; - -memblockType chunks[MAXCHUNKS+1]; -int numchunks=0; - -// ***************************** Code ***************************** - -void *valloc(int amount, char *desc, int owner) -{ - if (numchunks == MAXCHUNKS) - err("Failed allocated %d bytes (%s), reason: Out of chunks.", - amount, desc); - -#ifdef PARANOID - CheckCorruption(); - chunks[numchunks].pointer = (void *) ((int) malloc(amount + (PADSIZE * 2)) + PADSIZE); - chunks[numchunks].size = amount; - memset((char *) chunks[numchunks].pointer - PADSIZE, PADFILLVALUE, PADSIZE); - memset((char *) chunks[numchunks].pointer + - chunks[numchunks].size, PADFILLVALUE, PADSIZE); -#else - chunks[numchunks].pointer = malloc(amount); - chunks[numchunks].size = amount; -#endif - chunks[numchunks].owner = owner; - strncpy(chunks[numchunks].desc, desc, 19); - memset(chunks[numchunks].pointer, 0, chunks[numchunks].size); - return chunks[numchunks++].pointer; -} - -void *qvalloc(int amount) -{ - void *ptr; - - // Quick and dirty memory allocation. Should be used ONLY - // for temporary blocks in speed-critical loops. - - ptr = malloc(amount); - if (!ptr) errm("qvalloc: Failed allocating %d bytes.", amount); - return ptr; -} - -void qvfree(void *ptr) -{ - free(ptr); -} - -int TotalBytesAllocated(void) -{ - int i, tally=0; - - for (i=0; i -#include -#include -#include -#include - -#include "config.h" -#include "keyboard.h" -#include "timer.h" -#include "vdriver.h" - -#include "colbak.h" -#include "colstuff.h" - -#include "smalfont.h" -#include "gui.h" - -#include "tilesel.h" - -#define byte unsigned char -#define word unsigned short - -// ================================= Data ==================================== - -char *field, *destruct; -char *background, *sprites; -int startofs=16; -int turnlength, turnctr; -int destructed, difficulty=4; -int blocks, score, scoremultiplier; -int level; - -// Current piece falling - -char piece[3], tempspot; -int xpos, ypos, ypofs; -char newpiece; -char nextpiece[3]; - -// ================================= Code ==================================== - -void BlitPlayField() -{ - int i, j; - char c; - - for (i=0; i<12; i++) - for (j=0; j<6; j++) - { - c=field[(i*6)+j]; - if (c) TCopySprite(128+(j*16), startofs+4+(i*16), 16, 16, sprites+((c+1)*256)); - } -} - -void BlitPlayFieldwDestruct(char flash) -{ - int i, j; - char c; - - for (i=0; i<12; i++) - for (j=0; j<6; j++) - { - c=field[(i*6)+j]; - if (c && !destruct[(i*6)+j]) - TCopySprite(128+(j*16), startofs+4+(i*16), 16, 16, sprites+((c+1)*256)); - if (destruct[(i*6)+j]) - TCopySprite(128+(j*16), startofs+4+(i*16), 16, 16, sprites+(flash*256)); - } -} - -void BlitPiece() -{ - ypofs=((100 * turnctr) / turnlength) * 16 / 100; - - TCopySprite(128+(xpos*16), startofs+4+(ypos*16)+ypofs, 16, 16, sprites+((piece[0]+1)*256)); - TCopySprite(128+(xpos*16), startofs+20+(ypos*16)+ypofs, 16, 16, sprites+((piece[1]+1)*256)); - TCopySprite(128+(xpos*16), startofs+36+(ypos*16)+ypofs, 16, 16, sprites+((piece[2]+1)*256)); - - TCopySprite(276, startofs+70, 16, 16, sprites+((nextpiece[0]+1)*256)); - TCopySprite(276, startofs+90, 16, 16, sprites+((nextpiece[1]+1)*256)); - TCopySprite(276, startofs+110, 16, 16, sprites+((nextpiece[2]+1)*256)); -} - -void GenerateNewPiece() -{ - newpiece=0; - xpos=2; - ypos=0; - if (field[2]) key[SCAN_ESC]=1; - if (field[8]) key[SCAN_ESC]=1; - if (field[14]) key[SCAN_ESC]=1; - if (field[20]) key[SCAN_ESC]=1; - - if (key[SCAN_ESC]) - { - if (difficulty==4 && blocks<240) Message("You really suck at columns, man.",300); - if (difficulty==5 && blocks<80) Message("You really suck at columns, man.",300); - if (score>3200 && score<=6400) Message("Not bad.",300); - if (score>6400) Message("Behold, the Columns God walks among us.",500); - } - - memcpy(&piece, &nextpiece, 3); - nextpiece[0]=random(1,difficulty); - nextpiece[1]=random(1,difficulty); - nextpiece[2]=random(1,difficulty); -} - -void DestroyBlock(int x, int y) -{ - int i; - - for (i=y; i>0; i--) - { - field[(i*6)+x]=field[((i-1)*6)+x]; - } - blocks++; - score+=scoremultiplier; -} - -void ClearConsecutiveColumns() -{ - int x, y; - char c; - - // Scan for things to destroy, but don't destroy them, just mark - // them in the Destroy field. - - destructed=0; - memset(destruct, 0, (6*13)); - - for (y=0; y<12; y++) - for (x=0; x<6; x++) - { - c=field[(y*6)+x]; - - // Test vertical match - if (y<10) - { - if ((field[((y+1)*6)+x]==c) && (field[((y+2)*6)+x]==c) && c) - { - // vertical match. Set destruct field. - destruct[((y+0)*6)+x]=1; - destruct[((y+1)*6)+x]=1; - destruct[((y+2)*6)+x]=1; - destructed=1; - } - } - // Test horizontal match - if (x<4) - { - if ((field[(y*6)+x+1]==c) && (field[(y*6)+x+2]==c) && c) - { - // horizontal match. Set destruct field. - destruct[(y*6)+x+0]=1; - destruct[(y*6)+x+1]=1; - destruct[(y*6)+x+2]=1; - destructed=1; - } - } - // Test negative diagonal match - if (x<4 && y<10) - { - if ((field[((y+1)*6)+x+1]==c) && (field[((y+2)*6)+x+2]==c) && c) - { - // negative diagonal match. set destruct field. - destruct[((y+0)*6)+x+0]=1; - destruct[((y+1)*6)+x+1]=1; - destruct[((y+2)*6)+x+2]=1; - destructed=1; - } - } - // Test positive diagonal match - if (x>=2 && y<10) - { - if ((field[((y+1)*6)+x-1]==c) && (field[((y+2)*6)+x-2]==c) && c) - { - // positive diagonal match. set destruct field. - destruct[((y+0)*6)+x-0]=1; - destruct[((y+1)*6)+x-1]=1; - destruct[((y+2)*6)+x-2]=1; - destructed=1; - } - } - } - - // Show which tiles are being destroyed before clearing out for increase - // visual coolishness. - - if (destructed) - { - timer_count=0; - while (timer_count<50) - { - if (timer_count<10 || (timer_count>20 && timer_count<30) || - (timer_count>40 && timer_count<50)) c=1; - else c=0; - - CopySprite(16,16,320,200,background); - BlitPlayFieldwDestruct(c); - TCopySprite(276, startofs+70, 16, 16, sprites+((nextpiece[0]+1)*256)); - TCopySprite(276, startofs+90, 16, 16, sprites+((nextpiece[1]+1)*256)); - TCopySprite(276, startofs+110, 16, 16, sprites+((nextpiece[2]+1)*256)); - -GotoXY(55,130); -sprintf(strbuf,"Blocks: %d", blocks); -printstring(strbuf); -GotoXY(55,140); -sprintf(strbuf,"Score: %d", score); -printstring(strbuf); -GotoXY(55,150); -sprintf(strbuf,"Level: %d", level); -printstring(strbuf); - - ShowPage(); - } - } - - // Apply destruct-o patch to the field. - - for (y=0; y<12; y++) - for (x=0; x<6; x++) - if (destruct[(y*6)+x]) DestroyBlock(x,y); -} - -void NextTurn() -{ - ypos++; - if (field[((ypos+3)*6)+xpos]) - { - if (ypos<3) key[SCAN_ESC]=1; - // Hit something; set piece here. - field[(ypos*6)+xpos]=piece[0]; - field[((ypos+1)*6)+xpos]=piece[1]; - field[((ypos+2)*6)+xpos]=piece[2]; - newpiece=1; - - // Scan for consecutive things to delete. - do - { - ClearConsecutiveColumns(); - scoremultiplier*=2; - } while (destructed); - } -} - -int CanGoLeft() -{ - if (!xpos) return 0; - if (field[((ypos+1)*6)+xpos-1]) return 0; - if (field[((ypos+2)*6)+xpos-1]) return 0; - if (field[((ypos+3)*6)+xpos-1]) return 0; - return 1; -} - -int CanGoRight() -{ - if (xpos==5) return 0; - if (field[((ypos+1)*6)+xpos+1]) return 0; - if (field[((ypos+2)*6)+xpos+1]) return 0; - if (field[((ypos+3)*6)+xpos+1]) return 0; - return 1; -} - -void RotatePiece() -{ - tempspot=piece[0]; - piece[0]=piece[1]; - piece[1]=piece[2]; - piece[2]=tempspot; -} - -void ProcessLevels() -{ - if (blocks>80) { level=2; turnlength=90; } - if (blocks>160) { level=3; turnlength=80; } - if (blocks>240) { level=4; turnlength=70; } - if (blocks>320) { level=5; turnlength=60; } - if (blocks>400) { level=6; turnlength=50; } - if (blocks>480) { level=7; turnlength=40; } - if (blocks>560) { level=8; turnlength=30; } - if (blocks>640) { level=9; turnlength=20; } -} - -extern FILE *pcxf; -extern int width, depth; -extern int bytes; -extern int vidoffset; - -void LoadBackground() -{ - int i; - - if (!(pcxf=fopen("colback.pcx","rb"))) - { - background=background_; - } - else - { - fclose(pcxf); - background=(char *) valloc(64000,"col bakg",0); - LoadPCXHeaderNP("colback.pcx"); - for (i=0; i=turnlength) - { - NextTurn(); - turnctr-=turnlength; - } - if (newpiece) GenerateNewPiece(); - BlitPlayField(); - BlitPiece(); - -GotoXY(55,130); -sprintf(strbuf,"Blocks: %d", blocks); -printstring(strbuf); -GotoXY(55,140); -sprintf(strbuf,"Score: %d", score); -printstring(strbuf); -GotoXY(55,150); -sprintf(strbuf,"Level: %d", level); -printstring(strbuf); - - ShowPage(); - } - vfree(sprites); - vfree(background); - vfree(field); - vfree(destruct); -} diff --git a/16/v2/source/verge/MAPED/COLUMNS.H b/16/v2/source/verge/MAPED/COLUMNS.H deleted file mode 100755 index 2c1b4c1e..00000000 --- a/16/v2/source/verge/MAPED/COLUMNS.H +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef COLUMNS_INC -#define COLUMNS_INC - -extern void BlitPlayField(); -extern void BlitPlayFieldwDestruct(char flash); -extern void BlitPiece(); -extern void GenerateNewPiece(); -extern void DestroyBlock(int x, int y); -extern void ClearConsecutiveColumns(); -extern void NextTurn(); -extern int CanGoLeft(); -extern int CanGoRight(); -extern void RotatePiece(); -extern void ProcessLevels(); -extern void LoadBackground(); -extern void Columns(); - -#endif // COLUMNS_INC diff --git a/16/v2/source/verge/MAPED/CONFIG.C b/16/v2/source/verge/MAPED/CONFIG.C deleted file mode 100755 index 0e3f10ec..00000000 --- a/16/v2/source/verge/MAPED/CONFIG.C +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include "gui.h" -#include "mikmod.h" -#include "maped.h" - -#include "smalfont.h" - -// ================================= Data ==================================== - -FILE *cfg; -char *strbuf; - -char vm=0; // Video mode -char white=0, black=0; // Color definitions -char pad=0; // Padding mode in tile selector. -char th=0, mh=0; // tile-highlight, map highlight - -// GUI default colors - -char winbg=23; -char titlebg=125; -char brightw=31; -char darkw=13; -char darkred=44; - -// ------------------ - -extern char scrollmode, vcedprog[80]; -extern int difficulty; - -// ================================= Code ==================================== - -void InitializeDefaults() -{ - vm=0; - white=31; - black=1; - pad=1; - th=1; - mh=1; - mouse_scroll=1; - scrollmode=1; - memcpy(vcedprog,"edit",5); -} - -void GetConfig(char *fname) -{ - strbuf=(char *) valloc(2000,"strbuf!",0); - InitializeDefaults(); - if (!(cfg=fopen(fname,"r"))) - { - printf("Unable to open config file. Using defaults... \n"); - return; - } - - while (1) - { - fscanf(cfg,"%s",strbuf); - - if (!strcmp(strbuf,"difficulty")) - { fscanf(cfg,"%s",strbuf); - difficulty=atoi(strbuf); continue; } - if (!strcmp(strbuf,"nocdaudio")) - { - //nocdaudio=1; - continue; - } - if (!strcmp(strbuf,"vidmode")) - { fscanf(cfg,"%s",strbuf); - vm=atoi(strbuf); continue; } - if (!strcmp(strbuf,"white")) - { fscanf(cfg,"%s",strbuf); - white=atoi(strbuf); brightw=atoi(strbuf); - TextColor(atoi(strbuf)); continue; } - if (!strcmp(strbuf,"black")) - { fscanf(cfg,"%s",strbuf); - black=atoi(strbuf); continue; } - if (!strcmp(strbuf,"winbg")) - { fscanf(cfg,"%s",strbuf); - winbg=atoi(strbuf); continue; } - if (!strcmp(strbuf,"shadow")) - { fscanf(cfg,"%s",strbuf); - darkw=atoi(strbuf); continue; } - if (!strcmp(strbuf,"darkred")) - { fscanf(cfg,"%s",strbuf); - darkred=atoi(strbuf); continue; } - if (!strcmp(strbuf,"titlebg")) - { fscanf(cfg,"%s",strbuf); - titlebg=atoi(strbuf); continue; } - if (!strcmp(strbuf,"pad")) - { fscanf(cfg,"%s",strbuf); - pad=atoi(strbuf); continue; } - if (!strcmp(strbuf, "scrollmode")) - { fscanf(cfg,"%s",strbuf); - scrollmode=atoi(strbuf); continue; } - // aen - if (!strcmp(strbuf, "mouse_scroll")) - { fscanf(cfg,"%s",strbuf); - mouse_scroll=atoi(strbuf)&1; continue; } - if (!strcmp(strbuf, "md_device")) - { fscanf(cfg, "%s", strbuf); - md_device=atoi(strbuf); continue; } - if (!strcmp(strbuf, "th")) - { fscanf(cfg,"%s",strbuf); - th=atoi(strbuf); continue; } - if (!strcmp(strbuf, "mh")) - { fscanf(cfg,"%s",strbuf); - mh=atoi(strbuf); continue; } - if (!strcmp(strbuf, "amxofs")) - { fscanf(cfg,"%s",strbuf); - amxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "amyofs")) - { fscanf(cfg,"%s",strbuf); - amyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "mmxofs")) - { fscanf(cfg,"%s",strbuf); - mmxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "mmyofs")) - { fscanf(cfg,"%s",strbuf); - mmyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "cnxofs")) - { fscanf(cfg,"%s",strbuf); - cnxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "cnyofs")) - { fscanf(cfg,"%s",strbuf); - cnyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "lmxofs")) - { fscanf(cfg,"%s",strbuf); - lmyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "lmyofs")) - { fscanf(cfg,"%s",strbuf); - lmyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "lvxofs")) - { fscanf(cfg,"%s",strbuf); - lvxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "lvyofs")) - { fscanf(cfg,"%s",strbuf); - lvyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "mpxofs")) - { fscanf(cfg,"%s",strbuf); - mpxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "mpyofs")) - { fscanf(cfg,"%s",strbuf); - mpyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "vaxofs")) - { fscanf(cfg,"%s",strbuf); - vaxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "vayofs")) - { fscanf(cfg,"%s",strbuf); - vayofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "zexofs")) - { fscanf(cfg,"%s",strbuf); - zexofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "zeyofs")) - { fscanf(cfg,"%s",strbuf); - zeyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "exofs")) - { fscanf(cfg,"%s",strbuf); - exofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "eyofs")) - { fscanf(cfg,"%s",strbuf); - eyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "prxofs")) - { fscanf(cfg,"%s",strbuf); - prxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "pryofs")) - { fscanf(cfg,"%s",strbuf); - pryofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "rsxofs")) - { fscanf(cfg,"%s",strbuf); - rsxofs=atoi(strbuf); continue; } - if (!strcmp(strbuf, "rsyofs")) - { fscanf(cfg,"%s",strbuf); - rsyofs=atoi(strbuf); continue; } - if (!strcmp(strbuf,"vcedprog")) - { fscanf(cfg,"%s",vcedprog); - continue; } - break; - } - fclose(cfg); -} diff --git a/16/v2/source/verge/MAPED/CONFIG.H b/16/v2/source/verge/MAPED/CONFIG.H deleted file mode 100755 index d026fcda..00000000 --- a/16/v2/source/verge/MAPED/CONFIG.H +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef CONFIG_INC -#define CONFIG_INC - -extern char vm; -extern char *strbuf; -extern char white,black,darkred,pad,th,mh; -extern char winbg,titlebg,brightw,darkw; - -extern void InitializeDefaults(); -extern void GetConfig(char *fname); - -#endif // CONFIG_INC diff --git a/16/v2/source/verge/MAPED/CONTROLS.C b/16/v2/source/verge/MAPED/CONTROLS.C deleted file mode 100755 index be58e951..00000000 --- a/16/v2/source/verge/MAPED/CONTROLS.C +++ /dev/null @@ -1,837 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -// CHANGELOG: -// -// + fixed ScreenShot() to properly save screenshots with -// the sequential filenames. -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -// ================================= Data ==================================== - -// ================================= Code ==================================== - -int CheckMouseTabs() -{ int i; - - for (i=0; i<10; i++) - { - if (i<6 && i>=numlayers) continue; - if (mb==1 && mx>17+(i*10) && mx<26+(i*10) && my>(tsy-7) && my17+(i*10) && mx<26+(i*10) && my>(tsy-7) && my1 || (byt & 0xC0) != 0) - { - repcode=0xC0 | samect; - fwrite(&repcode,1,1,pcxf); - } - fwrite(&byt,1,1,pcxf); - } while (i> 2; -} - -void OutputVSPpcx() -{ int i,j,_x,_y; - unsigned char *ptr; - char b1; - short int w1,w2; - - // First figure out the filename - - i=0; - ptr=&vspname; - while (*ptr != '.') - { - strbuf[i]=*ptr; - ptr++; - i++; - } - strbuf[i++]='.'; - strbuf[i++]='P'; - strbuf[i++]='C'; - strbuf[i++]='X'; - strbuf[i++]=0; - - pcxf=fopen(strbuf,"wb"); - -// Write PCX header - - b1=10; fwrite(&b1, 1, 1, pcxf); // manufacturer always = 10 - b1=5; fwrite(&b1, 1, 1, pcxf); // version = 3.0, >16 colors - b1=1; fwrite(&b1, 1, 1, pcxf); // encoding always = 1 - b1=8; fwrite(&b1, 1, 1, pcxf); // 8 bits per pixel, for 256 colors - w1=0; fwrite(&w1, 1, 2, pcxf); // xmin = 0; - w1=0; fwrite(&w1, 1, 2, pcxf); // ymin = 0; - w1=319; fwrite(&w1, 1, 2, pcxf); // xmax = 319; - - // At this point we need to figure out how many vertical rows tall the - // PCX needs to be in order to accomidate the number of tiles in the VSP. - - w2=numtiles/18; w2++; - w2=(w2*17); fwrite(&w2, 1, 2, pcxf); // ymax = ?; - w1=320; fwrite(&w1, 1, 2, pcxf); // hres = 320; - w2++; fwrite(&w2, 1, 2, pcxf); // vres = ?; - - fwrite(screen, 1, 48, pcxf); // 16-color palette data. Who knows what's - // actually in here. It doesn't matter since - // the 256-color palette is stored elsewhere. - - b1=0; fwrite(&b1, 1, 1, pcxf); // reserved always = 0. - b1=1; fwrite(&b1, 1, 1, pcxf); // number of color planes. Just 1 for 8bit. - w1=320; fwrite(&w1, 1, 2, pcxf); // number of bytes per line - - w1=0; fwrite(&w1, 1, 1, pcxf); - fwrite(screen, 1, 59, pcxf); // filler - - // The header is written. Now we need to generate a large buffer where we'll - // "draw" the PCX, and then encode the data and save the PCX. - - ptr=(char *) malloc(320*w2); - memset(ptr,255,(320*w2)); // Give the PCX a white background - - // Now we "draw" the tiles into the buffer. - - for (i=0; i16 colors - b1=1; fwrite(&b1, 1, 1, pcxf); // encoding always = 1 - b1=8; fwrite(&b1, 1, 1, pcxf); // 8 bits per pixel, for 256 colors - w1=0; fwrite(&w1, 1, 2, pcxf); // xmin = 0; - w1=0; fwrite(&w1, 1, 2, pcxf); // ymin = 0; - w1=sx-1; fwrite(&w1, 1, 2, pcxf); // xmax = 319; - w1=sy-1; fwrite(&w1, 1, 2, pcxf); // ymax = 199; - w1=sx; fwrite(&w1, 1, 2, pcxf); // hres = 320; - w1=sy; fwrite(&w1, 1, 2, pcxf); // vres = 200; - - fwrite(screen,1,48,pcxf); - - b1=0; fwrite(&b1, 1, 1, pcxf); // reserved always = 0. - b1=1; fwrite(&b1, 1, 1, pcxf); // number of color planes. Just 1 for 8bit. - w1=sx; fwrite(&w1, 1, 2, pcxf); // number of bytes per line - - w1=0; fwrite(&w1, 1, 1, pcxf); - fwrite(screen, 1, 59, pcxf); // filler - - for (w1=0; w1(tsy-2)) ms_down=1; - if (mx>334) ms_right=1; - if (mx<18) ms_left=1; - } - - if (key[SCAN_UP] || ms_up) - { - if (scrollmode) - { - ywin -= map_scroll_y; - if (ywin < 0) ywin = 0; - } - else - { - if (key[SCAN_UP] || (!(systemtime%10))) - { - key[SCAN_UP]=0; - ywin -= 16; - if (ywin < 0) ywin = 0; - systemtime++; - } - } - } - if (key[SCAN_DOWN] || ms_down) - { - if (scrollmode) - { - ywin += map_scroll_y; - if (ywin > ymax) - ywin = ymax; - } - else - { - if (key[SCAN_DOWN] || (!(systemtime%10))) - { - key[SCAN_DOWN]=0; - ywin += 16; - if (ywin > ymax) - ywin = ymax; - systemtime++; - } - } - } - if (key[SCAN_RIGHT] || ms_right) - { - if (scrollmode) - { - xwin += map_scroll_x; - if (xwin > xmax) - xwin = xmax; - } - else - { - if (key[SCAN_RIGHT] || (!(systemtime%10))) - { - key[SCAN_RIGHT]=0; - xwin += 16; - if (xwin > xmax) - xwin = xmax; - systemtime++; - } - } - } - if (key[SCAN_LEFT] || ms_left) - { - if (scrollmode) - { - xwin -= map_scroll_x; - if (xwin < 0) xwin=0; - } - else - { - if (key[SCAN_LEFT] || (!(systemtime%10))) - { - key[SCAN_LEFT]=0; - xwin -= 16; - if (xwin < 0) xwin = 0; - systemtime++; - } - } - } -} - -ProcessControls() -{ - int xmax, ymax; - - xmax = (layer[0].sizex * 16) - sx; - ymax = (layer[0].sizey * 16) - sy; - - if (key[SCAN_F5]) { key[SCAN_F5]=0; ShellMAP(); } - if (key[SCAN_F6]) { key[SCAN_F6]=0; CompileAll(); } - if (key[SCAN_F8]) { key[SCAN_F8]=0; ShellVERGE(); } - if (key[SCAN_ALT] && key[SCAN_D]) { key[SCAN_D]=0; ShellToDOS(); } - if (key[SCAN_ALT] && key[SCAN_L]) LoadMAPDialog(); - if (key[SCAN_ALT] && key[SCAN_V]) ShellEditMAP(); - if (key[SCAN_ALT] && key[SCAN_S]) ShellEditSystem(); - if (key[SCAN_ALT] && key[SCAN_N]) NewMAP(); - if (key[SCAN_ALT] && key[SCAN_P]) MPDialog(); - if (!key[SCAN_ALT] && key[SCAN_P]) { pasting^=1; key[SCAN_P]=0; } // aen - - if (key[SCAN_A] && el<6) - { - lt++; - if (lt==numtiles) lt=0; - key[SCAN_A]=0; - } - if (key[SCAN_Z] && el<6) - { - if (lt) lt--; - else lt=numtiles-1; - key[SCAN_Z]=0; - } - if (key[SCAN_A] && el==7) - { - curzone++; - key[SCAN_A]=0; - } - if (key[SCAN_Z] && el==7) - { - curzone--; - key[SCAN_Z]=0; - } - if (key[SCAN_S]) - { - rt++; - if (rt==numtiles) rt=0; - key[SCAN_S]=0; - } - if (key[SCAN_X]) - { - if (rt) rt--; - else rt=numtiles-1; - key[SCAN_X]=0; - } - if (key[SCAN_F10]) - { - key[SCAN_F10]=0; - if (random(0,255)<15) HAL(); - SaveMAP(mapname); - SaveVSP(vspname); - CompileMAP(); - Message("MAP/VSP saved.",100); - modified=0; - } - if (key[SCAN_C]) - { - key[SCAN_C]=0; - sprintf(strbuf,"Left: %d Right: %d", lt, rt); - Message(strbuf, 300); - } - if (key[SCAN_M]) - { - key[SCAN_M]=0; - GenerateMiniVSP(); - MiniMAP(); - } - if (key[SCAN_H]) - { - key[SCAN_H]=0; - mh=mh^1; - if (mh) Message("MAP Tile Highlight enabled.",100); - else Message("MAP Tile Highlight disabled.",100); - } - - // *** - // movement code moved to PollMovement() - // *** - - if (key[SCAN_PGUP]) - { - key[SCAN_PGUP]=0; - ywin -= sy; - if (ywin < 0) - ywin = 0; - } - if (key[SCAN_HOME]) - { - key[SCAN_HOME]=0; - xwin -= sx; - if (xwin < 0) - xwin = 0; - } - if (key[SCAN_END]) - { - key[SCAN_END]=0; - xwin += sx; - if (xwin > xmax) - xwin = xmax; - } - if (key[SCAN_PGDN]) - { - key[SCAN_PGDN]=0; - ywin += sy; - if (ywin > ymax) - ywin = ymax; - } - - if (key[SCAN_CTRL] && el<6) - { - key[SCAN_CTRL]=0; - TileSelector(); - } - if (key[SCAN_CTRL] && el==7) - { - key[SCAN_CTRL]=0; - ZoneEdDialog(); - } - - if (key[SCAN_TAB]) - { - key[SCAN_TAB]=0; - if (scrollmode) - { - scrollmode=0; - xwin=xwin/16; xwin=xwin*16; - ywin=ywin/16; ywin=ywin*16; - Message("Tile scroll.",150); - } - else - { - scrollmode=1; - Message("Pixel scroll.",150); - } - } - - if (key[SCAN_1]) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) - { - layertoggle[0]=0; - return; - } - layertoggle[0]=1; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - el=0; - key[SCAN_1]=0; - } - if (key[SCAN_2]) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) - { - layertoggle[1]=0; - return; - } - key[SCAN_2]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - if (numlayers>1) - { layertoggle[1]=1; - el=1; } - } - if (key[SCAN_3]) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) - { - layertoggle[2]=0; - return; - } - key[SCAN_3]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - if (numlayers>2) - { layertoggle[2]=1; - el=2; } - } - if (key[SCAN_4]) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) - { - layertoggle[3]=0; - return; - } - key[SCAN_4]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - if (numlayers>3) - { layertoggle[3]=1; - el=3; } - } - if (key[SCAN_5]) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) - { - layertoggle[4]=0; - return; - } - key[SCAN_5]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - if (numlayers>4) - { layertoggle[4]=1; - el=4; } - } - if (key[SCAN_6]) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) - { - layertoggle[5]=0; - return; - } - key[SCAN_6]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - if (numlayers>5) - { layertoggle[5]=1; - el=5; } - } - if (key[SCAN_O]) - { - key[SCAN_O]=0; - layertoggle[6]=1; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=0; - el=6; - } - if (key[SCAN_N]) - { - key[SCAN_N]=0; - layertoggle[6]=0; layertoggle[7]=1; - layertoggle[8]=0; layertoggle[9]=0; - el=7; - } - if (key[SCAN_E]) - { - key[SCAN_E]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=1; layertoggle[9]=0; - el=8; - } - if (key[SCAN_T]) - { - key[SCAN_T]=0; - layertoggle[6]=0; layertoggle[7]=0; - layertoggle[8]=0; layertoggle[9]=1; - el=9; - } - if (key[SCAN_F9]) - { // aen - key[SCAN_F9]=0; - mouse_scroll^=1; - sprintf(strbuf,"Mouse scroll %sabled.", mouse_scroll ? "en" : "dis"); - Message(strbuf, 100); - } - if (key[SCAN_F11]) - { - key[SCAN_F11]=0; - ScreenShot(); - Message("Screen capture saved.",300); - } - if (key[SCAN_F12]) - { - key[SCAN_F12]=0; - OutputVSPpcx(); - Message("PCX file exported.",300); - } - if (key[SCAN_LANGLE]) - { - key[SCAN_LANGLE]=0; - ShutdownVideo(); - vm=0; - InitVideo(0); - set_intensity(63); - InitMouse(); - - // aen -- gotta recalc this if you're in a lower res at the bottom of - // the map and jump to a higher res. - xmax = (layer[0].sizex * 16) - sx; - ymax = (layer[0].sizey * 16) - sy; - if (xwin > xmax) xwin=xmax; - if (ywin > ymax) ywin=ymax; - } - if (key[SCAN_RANGLE]) - { - key[SCAN_RANGLE]=0; - ShutdownVideo(); - vm=1; - InitVideo(1); - set_intensity(63); - InitMouse(); - - // aen -- gotta recalc this if you're in a lower res at the bottom of - // the map and jump to a higher res. - xmax = (layer[0].sizex * 16) - sx; - ymax = (layer[0].sizey * 16) - sy; - if (xwin > xmax) xwin=xmax; - if (ywin > ymax) ywin=ymax; - } - - if (CheckMouseTabs()) return; - - if (mb>=3) MainMenu(mx-4,my-5); - if (key[SCAN_ESC]) DoMainMenu(); - - if (mb==1 && key[SCAN_SLASH] && el<6) - { - lt=layers[el][((((ywin*layer[el].pmulty/layer[el].pdivy)+my-16)/16) * - layer[el].sizex)+(((xwin*layer[el].pmultx/layer[el].pdivx)+mx-16)/16)]; - - return; - } - - if (mb==2 && key[SCAN_SLASH] && el<6) - { - rt=layers[el][((((ywin*layer[el].pmulty/layer[el].pdivy)+my-16)/16) * - layer[el].sizex)+(((xwin*layer[el].pmultx/layer[el].pdivx)+mx-16)/16)]; - return; - } - - // aen; these must come before the tile plotting code just below - // to work correctly. - if (mb && el<6 && key[SCAN_LSHIFT] && !shifted) - { - selx1=(((xwin*layer[el].pmultx/layer[el].pdivx)+mx-16)/16); - sely1=(((ywin*layer[el].pmulty/layer[el].pdivy)+my-16)/16); - selx2=selx1; - sely2=sely1; - shifted=mb; - return; - } - if (mb && el<6 && shifted) - { - selx2=(((xwin*layer[el].pmultx/layer[el].pdivx)+mx-16)/16); - sely2=(((ywin*layer[el].pmulty/layer[el].pdivy)+my-16)/16); - return; - } - if (!mb && el<6 && shifted) - { int i,j; - int x1,y1,x2,y2; - - x1=selx1; - y1=sely1; - x2=selx2; - y2=sely2; - - if (x2335) mx=334; - modified=1; - layers[el][((((ywin*layer[el].pmulty/layer[el].pdivy)+my-16)/16) * - layer[el].sizex)+(((xwin*layer[el].pmultx/layer[el].pdivx)+mx-16) - /16)]=lt; - } - if (mb==2 && el<6 && !shifted) - { - if (mx>335) mx=334; - modified=1; - layers[el][((((ywin*layer[el].pmulty/layer[el].pdivy)+my-16)/16) * - layer[el].sizex)+(((xwin*layer[el].pmultx/layer[el].pdivx)+mx-16) - /16)]=rt; - } - - if (mb==1 && el==6) - { - modified=1; - obstruct[((((ywin*layer[0].pmulty/layer[0].pdivy)+my-16)/16) * - layer[0].sizex)+(((xwin*layer[0].pmultx/layer[0].pdivx)+mx-16) - /16)]=1; - } - if (mb==2 && el==6) - { - modified=1; - obstruct[((((ywin*layer[0].pmulty/layer[0].pdivy)+my-16)/16) * - layer[0].sizex)+(((xwin*layer[0].pmultx/layer[0].pdivx)+mx-16) - /16)]=0; - } - if (mb==1 && el==7 && (key[SCAN_LSHIFT] || key[SCAN_RSHIFT])) - { - curzone=zone[((((ywin*layer[0].pmulty/layer[0].pdivy)+my-16)/16) * - layer[0].sizex)+(((xwin*layer[0].pmultx/layer[0].pdivx)+mx-16) - /16)]; - WaitRelease(); - ZoneEdDialog(); - return; - } - if (mb==1 && el==7) - { - modified=1; - zone[((((ywin*layer[0].pmulty/layer[0].pdivy)+my-16)/16) * - layer[0].sizex)+(((xwin*layer[0].pmultx/layer[0].pdivx)+mx-16) - /16)]=curzone; - } - if (mb==2 && el==7) - { - modified=1; - zone[((((ywin*layer[0].pmulty/layer[0].pdivy)+my-16)/16) * - layer[0].sizex)+(((xwin*layer[0].pmultx/layer[0].pdivx)+mx-16) - /16)]=0; - } - if (mb==1 && el==8) - { - WaitRelease(); - ProcessEntity((xwin+(mx-16))/16,(ywin+(my-16))/16); - modified=1; - } - if (el==8 && EntityThere((mx-16+xwin)/16,(my+ywin-16)/16) && - key[SCAN_DEL]) - { - WaitRelease(); - DeleteEntity((mx-16+xwin)/16,(my-16+ywin)/16); - modified=1; - } -} diff --git a/16/v2/source/verge/MAPED/GUI.C b/16/v2/source/verge/MAPED/GUI.C deleted file mode 100755 index 49bdc469..00000000 --- a/16/v2/source/verge/MAPED/GUI.C +++ /dev/null @@ -1,5062 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include - -#include "config.h" -#include "guicomp.h" -#include "maped.h" -#include "mouse.h" -#include "render.h" -#include "timer.h" -#include "vdriver.h" -#include "keyboard.h" - -#include "smalfont.h" -#include "columns.h" -#include "tilesel.h" - -// ================================= Data ==================================== - -struct message -{ - char text[44]; // message text - int exptime; // message expire time -}; - -struct message messages[6]; // 5-message buffer -char num_msgs=0; // number of active messages -char playingmod[80]; // currently playing mod. -extern char scrollmode; - -// ================================= Code ==================================== - -void CheckMessageExpirations() -{ int i; - - for (i=0; imessages[i].exptime) - { - memcpy(messages[i].text, messages[i+1].text, (48*(num_msgs-i+1))); - num_msgs--; - } -} - -void Message(char *text, int duration) -{ - if (num_msgs<5) - { - memcpy(messages[num_msgs].text, text, strlen(text)); - messages[num_msgs].exptime=systemtime+duration; - num_msgs++; - return; - } - - memcpy(&messages[0].text, &messages[1].text, 192); - memcpy(messages[4].text, text, strlen(text)+1); - messages[num_msgs].exptime=systemtime+duration; -} - -void DrawScreenControls() -{ int i; - byte c; - - if (el<6) - { - if (pasting) - { - GotoXY(298-5,tsy-19+13); - printstring("P"); - } - } - - // Put current-tile boxes if applicable. - if (el<6) - { - FilledBox(298,tsy-19,18,18,white); - FilledBox(317,tsy-19,18,18,white); - CopySprite(299,tsy-18,16,16,vsp+(256*lt)); - CopySprite(318,tsy-18,16,16,vsp+(256*rt)); - } - - if (el==7) - { - sprintf(strbuf,"Zone %d",curzone); - GotoXY(280,tsy-16); - printstring(strbuf); - GotoXY(280,tsy-10); - printstring(zones[curzone].name); - - c=zone[((((ywin*layer[0].pmulty/layer[0].pdivy)+my-16)/16) * - layer[0].sizex)+(((xwin*layer[0].pmultx/layer[0].pdivx)+mx-16)/16)]; - - if (c) - { - sprintf(strbuf,"zone %d",c); - GotoXY(280,17); - printstring(strbuf); - GotoXY(280,23); - printstring(zones[c].name); - } - } - - if (el==8) - { - sprintf(strbuf,"%d entities",entities); - GotoXY(285,17); printstring(strbuf); - - if (c=EntityThere((mx+xwin-16)/16,(my+ywin-16)/16)) - { - c--; - GotoXY(285,tsy-10); - printstring(entity[c].desc); - } - } - - // Put the current-tile mouse thingy. - GotoXY(17,17); - dec_to_asciiz((xwin+mx-16)/16,strbuf); - printstring(strbuf); printstring(", "); - dec_to_asciiz((ywin+my-16)/16,strbuf); - printstring(strbuf); - - // Put the layer editor/selector. - - for (i=0; i<6; i++) - { - if (el==i) c=white; else c=darkw; - FilledBox(17+(i*10),tsy-7,9,7,c); - if (layertoggle[i]) c=darkred; else c=0; - FilledBox(18+(i*10),tsy-6,7,6,c); - GotoXY(20+(i*10),tsy-5); dec_to_asciiz(i+1,strbuf); - if (i335) dx=336-80; - if (dy+89>sy+16) dy=(sy+16)-89; - - RenderMap(); - RenderGUI(); - stdwindow(dx, dy, dx+80, dy+89); - - if (mx>dx && mxdy+2 && mydy+8 && mydy+14 && mydy+20 && mydy+29 && mydy+35 && mydy+41 && mydy+47 && mydy+53 && mydy+59 && mydy+65 && mydy+71 && mydy+80 && my"); - GotoXY(dx+3, dy+42); printstring("Options"); - GotoXY(dx+3, dy+48); printstring("MOD Player"); - GotoXY(dx+3, dy+54); printstring("CD Player"); - GotoXY(dx+3, dy+60); printstring("Columns"); - GotoXY(dx+3, dy+66); printstring("Execute"); GotoXY(dx+73, dy+66); printstring(">"); - GotoXY(dx+3, dy+72); printstring("Exit to DOS"); - HLine(dx+2, dy+79, 76, white); - GotoXY(dx+3, dy+81); printstring("About MapEd"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - if (mb==1 && mx>dx && mxdy+2 && mydy+8 && mydy+14 && mydy+20 && mydy+29 && mydy+35 && mydy+41 && mydy+47 && mydy+53 && mydy+59 && mydy+65 && mydy+71 && mydy+80 && my= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - ilxofs = (mx-mxo); - ilyofs = (my-myo); - if (!mb) moving=0; - if (ilxofs<16) ilxofs = 16; - if (ilyofs<16) ilyofs = 16; - if (ilxofs+ilxsize>335) ilxofs = 336-ilxsize; - if (ilyofs+ilysize>sy+16) ilyofs = (sy+16)-ilysize; - } - - Window(ilxofs, ilyofs, ilxofs+ilxsize, ilyofs+ilysize, "Import Image As Layer"); - Button(ilxofs+109, ilyofs+12, "Browse"); - Button(ilxofs+109, ilyofs+30, "OK"); - GotoXY(ilxofs+5, ilyofs+25); printstring("Layer:"); - // layer select radio buttons - for (i=0; i<6; i++) - { - CheckBox(ilxofs+29+(i*10), ilyofs+33, chk_layer & (1<ilxofs+109 && mxilyofs+12 && myilxofs+109 && mxilyofs+30 && mynumlayers) - { - numlayers++; - sprintf(rstring, "%s%i", rstring, ly+1); // update render-order - } - - vfree(t); - vfree(ovsp); - } - // ... - WaitRelease(); continue; - } - - if (mb==1 && mx>ilxofs+29 && mxilyofs+33 && myilxofs+39 && mxilyofs+33 && my= 2) - { - chk_layer ^= 2; - chk_layer &= 2; - //chk_2 ^= 1; - //chk_1=0,chk_3=0,chk_4=0,chk_5=0,chk_6=0; - WaitRelease(); continue; - } - } - - if (mb==1 && mx>ilxofs+49 && mxilyofs+33 && my= 3) - { - chk_layer ^= 4; - chk_layer &= 4; - //chk_3 ^= 1; - //chk_1=0,chk_2=0,chk_4=0,chk_5=0,chk_6=0; - WaitRelease(); continue; - } - } - - if (mb==1 && mx>ilxofs+59 && mxilyofs+33 && my= 4) - { - chk_layer ^= 8; - chk_layer &= 8; - //chk_4 ^= 1; - //chk_1=0,chk_2=0,chk_3=0,chk_5=0,chk_6=0; - WaitRelease(); continue; - } - } - - if (mb==1 && mx>ilxofs+69 && mxilyofs+33 && my= 5) - { - chk_layer ^= 16; - chk_layer &= 16; - //chk_5 ^= 1; - //chk_1=0,chk_2=0,chk_3=0,chk_4=0,chk_6=0; - WaitRelease(); continue; - } - } - - if (mb==1 && mx>ilxofs+79 && mxilyofs+33 && my= 6) - { - chk_layer ^= 32; - chk_layer &= 32; - //chk_6 ^= 1; - //chk_1=0,chk_2=0,chk_3=0,chk_4=0,chk_5=0; - WaitRelease(); continue; - } - } - - // if no checkboxes are marked, mark the first. - //if (!(chk_1+chk_2+chk_3+chk_4+chk_5+chk_6)) chk_1=1; - if (!chk_layer) chk_layer=1; - -// if (mb==1 && mx>ilxofs+29 && mxilyofs+12 && myilxofs+74 && mxilyofs+58 && myilxofs+74 && mxilyofs+69 && myilxofs+5 && mxilyofs+101 && my - if (excessx+excessy) - { - if (chk_grabexcess) - { - if (excessx) tilesx++; - if (excessy) tilesy++; - } - else - { - if (excessx) tilesx--; - if (excessy) tilesy--; - } - if (tilesxilxofs+5 && mxilyofs+110 && myilxofs+5 && mxilyofs+119 && my(ilxofs+ilxsize-9) && (mx(ilyofs+1) && (myilxofs && mxilyofs && my<(ilyofs+9) && !moving) - { - moving=1; - mxo=mx-ilxofs; - myo=my-ilyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - - // keep minimally required padding - if (ctf==1) - { - if (atoi(str)= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - dtxofs = (mx-mxo); - dtyofs = (my-myo); - if (!mb) moving=0; - if (dtxofs<16) dtxofs = 16; - if (dtyofs<16) dtyofs = 16; - if (dtxofs+dtxsize>335) dtxofs = 336-dtxsize; - if (dtyofs+dtysize>sy+16) dtyofs = (sy+16)-dtysize; - } - - Window(dtxofs, dtyofs, dtxofs+dtxsize, dtyofs+dtysize, "Destroyer"); - CheckBox(dtxofs+4, dtyofs+11, zn_check); - CheckBox(dtxofs+4, dtyofs+31, ob_check); - CheckBox(dtxofs+4, dtyofs+21, zd_check); - GotoXY(dtxofs+15, dtyofs+12); printstring("Zones"); - GotoXY(dtxofs+15, dtyofs+32); printstring("Obstructions"); - GotoXY(dtxofs+15, dtyofs+22); printstring("Zone Data"); - Button(dtxofs+68, dtyofs+11, "ok"); - Button(dtxofs+68, dtyofs+24, "cancel"); - CheckBox(dtxofs+4, dtyofs+41, ent_check); - GotoXY(dtxofs+15, dtyofs+42); printstring("Entities"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>dtxofs+4 && mxdtyofs+11 && mydtxofs+4 && mxdtyofs+21 && mydtxofs+4 && mxdtyofs+31 && mydtxofs+4 && mxdtyofs+41 && mydtxofs+68 && mxdtyofs+11 && mydtxofs+68 && mxdtyofs+24 && my(dtxofs+dtxsize-9) && (mx(dtyofs+1) && (mydtxofs && mxdtyofs && my<(dtyofs+9) && !moving) - { - moving=1; - mxo=mx-dtxofs; - myo=my-dtyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -void LayersSubMenu(int dx, int dy) -{ char done=0; - //int mxo, myo, cursorblink; - - do - { - if (dx<16) dx=16; - if (dy<16) dy=16; - if (dx+80>335) dx=336-80; - if (dy+89>sy+16) dy=(sy+16)-89; - - RenderMap(); - RenderGUI(); - stdwindow(dx, dy, dx+80, dy+29); - - if (mx>dx && mxdy+2 && mydy+8 && mydy+14 && mydy+20 && mydx && mxdy+2 && mydy+8 && mydy+14 && mydy+20 && my335) dx=336-80; - if (dy+89>sy+16) dy=(sy+16)-89; - - RenderMap(); - RenderGUI(); - stdwindow(dx, dy, dx+80, dy+23); - - if (mx>dx && mxdy+2 && mydy+8 && mydy+14 && mydx && mxdy+2 && mydy+8 && mydy+14 && my5) i=0; - if (i>=numlayers) i=0; - - sprintf(nstr1, "%d", layer[i].pmultx); - sprintf(nstr2, "%d", layer[i].pdivx); - sprintf(nstr3, "%d", layer[i].pmulty); - sprintf(nstr4, "%d", layer[i].pdivy); - sprintf(nstr5, "%d", layer[i].trans); - sprintf(nstr6, "%d", layer[i].hline); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - lpxofs = (mx-mxo); - lpyofs = (my-myo); - if (!mb) moving=0; - if (lpxofs<16) lpxofs = 16; - if (lpyofs<16) lpyofs = 16; - if (lpxofs+lpxsize>335) lpxofs = 336-lpxsize; - if (lpyofs+lpysize>sy+16) lpyofs = (sy+16)-lpysize; - } - - Window(lpxofs, lpyofs, lpxofs+lpxsize, lpyofs+lpysize, "Edit Layer Properties"); - GotoXY(lpxofs+3, lpyofs+10); printstring("Parallax controls:"); - GotoXY(lpxofs+4, lpyofs+21); printstring("MultX:"); - GotoXY(lpxofs+12, lpyofs+31); printstring("DivX:"); - GotoXY(lpxofs+93, lpyofs+21); printstring("MultY:"); - GotoXY(lpxofs+101, lpyofs+31); printstring("DivY:"); - TextField(lpxofs+29, lpyofs+19, 60, nstr1, ctf == 1 ? cb : 0); - TextField(lpxofs+29, lpyofs+29, 60, nstr2, ctf == 2 ? cb : 0); - TextField(lpxofs+118, lpyofs+19, 60, nstr3, ctf == 3 ? cb : 0); - TextField(lpxofs+118, lpyofs+29, 60, nstr4, ctf == 4 ? cb : 0); - HLine(lpxofs+1, lpyofs+43, 188, white); - GotoXY(lpxofs+9, lpyofs+48); printstring("Transparent"); - GotoXY(lpxofs+36, lpyofs+58); printstring("HLine"); - TextField(lpxofs+56, lpyofs+46, 60, nstr5, ctf == 5 ? cb : 0); - TextField(lpxofs+56, lpyofs+56, 60, nstr6, ctf == 6 ? cb : 0); - Button(lpxofs+156, lpyofs+55, "OK"); - GotoXY(lpxofs+144, lpyofs+47); printstring("Layer"); - sprintf(strbuf,"%d",i); GotoXY(lpxofs+168, lpyofs+47); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>lpxofs+29 && mxlpyofs+19 && mylpxofs+29 && mxlpyofs+29 && mylpxofs+118 && mxlpyofs+19 && mylpxofs+118 && mxlpyofs+29 && mylpxofs+56 && mxlpyofs+46 && mylpxofs+56 && mxlpyofs+56 && mylpxofs+156 && mxlpyofs+55 && my(lpxofs+lpxsize-9) && (mx(lpyofs+1) && (mylpxofs && mxlpyofs && my<(lpyofs+9) && !moving) - { - moving=1; - mxo=mx-lpxofs; - myo=my-lpyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_UP) - { - layer[i].pmultx=atoi(nstr1); - layer[i].pdivx=atoi(nstr2); - layer[i].pmulty=atoi(nstr3); - layer[i].pdivy=atoi(nstr4); - layer[i].trans=atoi(nstr5); - layer[i].hline=atoi(nstr6); - last_pressed=0; key[SCAN_UP]=0; - if (i) i--; else i=numlayers-1; - sprintf(nstr1, "%d", layer[i].pmultx); - sprintf(nstr2, "%d", layer[i].pdivx); - sprintf(nstr3, "%d", layer[i].pmulty); - sprintf(nstr4, "%d", layer[i].pdivy); - sprintf(nstr5, "%d", layer[i].trans); - sprintf(nstr6, "%d", layer[i].hline); - } - if (last_pressed==SCAN_DOWN) - { - layer[i].pmultx=atoi(nstr1); - layer[i].pdivx=atoi(nstr2); - layer[i].pmulty=atoi(nstr3); - layer[i].pdivy=atoi(nstr4); - layer[i].trans=atoi(nstr5); - layer[i].hline=atoi(nstr6); - last_pressed=0; key[SCAN_DOWN]=0; - if (i5) i=0; - if (i>=numlayers) i=0; - - sprintf(nstr1, "%d", layer[i].pmultx); - sprintf(nstr2, "%d", layer[i].pdivx); - sprintf(nstr3, "%d", layer[i].pmulty); - sprintf(nstr4, "%d", layer[i].pdivy); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - lpxofs = (mx-mxo); - lpyofs = (my-myo); - if (!mb) moving=0; - if (lpxofs<16) lpxofs = 16; - if (lpyofs<16) lpyofs = 16; - if (lpxofs+lpxsize>335) lpxofs = 336-lpxsize; - if (lpyofs+lpysize>sy+16) lpyofs = (sy+16)-lpysize; - } - - Window(lpxofs, lpyofs, lpxofs+lpxsize, lpyofs+lpysize, "Edit Layer Properties"); - GotoXY(lpxofs+3, lpyofs+10); printstring("Parallax controls:"); - GotoXY(lpxofs+4, lpyofs+21); printstring("MultX:"); - GotoXY(lpxofs+12, lpyofs+31); printstring("DivX:"); - GotoXY(lpxofs+93, lpyofs+21); printstring("MultY:"); - GotoXY(lpxofs+101, lpyofs+31); printstring("DivY:"); - TextField(lpxofs+29, lpyofs+19, 60, nstr1, ctf == 1 ? cb : 0); - TextField(lpxofs+29, lpyofs+29, 60, nstr2, ctf == 2 ? cb : 0); - TextField(lpxofs+118, lpyofs+19, 60, nstr3, ctf == 3 ? cb : 0); - TextField(lpxofs+118, lpyofs+29, 60, nstr4, ctf == 4 ? cb : 0); - HLine(lpxofs+1, lpyofs+43, 188, white); - GotoXY(lpxofs+6, lpyofs+49); printstring("Transparent"); - GotoXY(lpxofs+32, lpyofs+56); printstring("HLine"); - CheckBox(lpxofs+56, lpyofs+48, layer[i].trans); - CheckBox(lpxofs+56, lpyofs+56, layer[i].hline); - Button(lpxofs+156, lpyofs+55, "OK"); - GotoXY(lpxofs+144, lpyofs+47); printstring("Layer"); - sprintf(strbuf,"%d",i); GotoXY(lpxofs+168, lpyofs+47); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>lpxofs+29 && mxlpyofs+19 && mylpxofs+29 && mxlpyofs+29 && mylpxofs+118 && mxlpyofs+19 && mylpxofs+118 && mxlpyofs+29 && mylpxofs+56 && mxlpyofs+48 && mylpxofs+56 && mxlpyofs+56 && mylpxofs+156 && mxlpyofs+55 && my(lpxofs+lpxsize-9) && (mx(lpyofs+1) && (mylpxofs && mxlpyofs && my<(lpyofs+9) && !moving) - { - moving=1; - mxo=mx-lpxofs; - myo=my-lpyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_UP) - { - layer[i].pmultx=atoi(nstr1); - layer[i].pdivx=atoi(nstr2); - layer[i].pmulty=atoi(nstr3); - layer[i].pdivy=atoi(nstr4); - last_pressed=0; key[SCAN_UP]=0; - if (i) i--; else i=numlayers-1; - sprintf(nstr1, "%d", layer[i].pmultx); - sprintf(nstr2, "%d", layer[i].pdivx); - sprintf(nstr3, "%d", layer[i].pmulty); - sprintf(nstr4, "%d", layer[i].pdivy); - } - if (last_pressed==SCAN_DOWN) - { - layer[i].pmultx=atoi(nstr1); - layer[i].pdivx=atoi(nstr2); - layer[i].pmulty=atoi(nstr3); - layer[i].pdivy=atoi(nstr4); - last_pressed=0; key[SCAN_DOWN]=0; - if (i= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - amxofs = (mx-mxo); - amyofs = (my-myo); - if (!mb) moving=0; - if (amxofs<16) amxofs = 16; - if (amyofs<16) amyofs = 16; - if (amxofs+amxsize>335) amxofs = 336-amxsize; - if (amyofs+amysize>sy+16) amyofs = (sy+16)-amysize; - } - - sprintf(strbuf, "About MapEd %s", ME2_VERSION); - Window(amxofs, amyofs, amxofs+amxsize, amyofs+amysize, strbuf); - sprintf(strbuf, "MapEd v.%s", ME2_VERSION); - GotoXY(amxofs+52, amyofs+16); printstring(strbuf); - GotoXY(amxofs+31, amyofs+22); printstring("Copyright (C) 1998 vecna"); - GotoXY(amxofs+40, amyofs+28); printstring("All Rights Reserved"); - GotoXY(amxofs+(75-pixels("Additional code by Ric")/2), amyofs+41); - printstring("Additional code by Ric"); - GotoXY(amxofs+(75-pixels("Additional code by aen")/2), amyofs+47); - printstring("Additional code by aen"); - GotoXY(amxofs+(75-pixels("Additional code by zeromus")/2), amyofs+53); - printstring("Additional code by zeromus"); - Button(amxofs+60, amyofs+68, "OK"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if ((mb==1 && mx>amxofs+66 && mxamyofs+68 && my(amxofs+amxsize-9) && (mx(amyofs+1) && (myamxofs && mxamyofs && my<(amyofs+9) && !moving) - { - moving=1; - mxo=mx-amxofs; - myo=my-amyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB) - { - switch (ctf) - { - case 0: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - - } while (!done); -} - -int cnxsize=125, cnysize=50; -int cnxofs=114, cnyofs=70; - -int Confirm(char *message) -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - WaitRelease(); - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - cnxofs = (mx-mxo); - cnyofs = (my-myo); - if (!mb) moving=0; - if (cnxofs<16) cnxofs = 16; - if (cnyofs<16) cnyofs = 16; - if (cnxofs+cnxsize>335) cnxofs = 336-cnxsize; - if (cnyofs+cnysize>sy+16) cnyofs = (sy+16)-cnysize; - } - - Window(cnxofs, cnyofs, cnxofs+cnxsize, cnyofs+cnysize, "Confirm? (Y/N)"); - GotoXY(cnxofs+125/2-(pixels(message)/2), cnyofs+15); printstring(message); - - Button(cnxofs+24, cnyofs+30, "Yes"); - Button(cnxofs+69, cnyofs+30, "No"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>cnxofs+24 && mxcnyofs+30 && mycnxofs+69 && mxcnyofs+30 && my(cnxofs+cnxsize-9) && (mx(cnyofs+1) && (mycnxofs && mxcnyofs && my<(cnyofs+9) && !moving) - { - moving=1; - mxo=mx-cnxofs; - myo=my-cnyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - if (last_pressed==SCAN_N) - { - key[SCAN_N]=0; - done=1; - break; - } - if (last_pressed==SCAN_Y) - { - key[SCAN_Y]=0; - return 1; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB) - { - switch (ctf) - { - case 0: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - - } while (!done); - return 0; -} - -int lmxsize=145, lmysize=36; -int lmxofs=80, lmyofs=50; - -void LoadMAPDialog() -{ char lmapname[80]; - char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - memset(lmapname, 0, 80); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - lmxofs = (mx-mxo); - lmyofs = (my-myo); - if (!mb) moving=0; - if (lmxofs<16) lmxofs = 16; - if (lmyofs<16) lmyofs = 16; - if (lmxofs+lmxsize>335) lmxofs = 336-lmxsize; - if (lmyofs+lmysize>sy+16) lmyofs = (sy+16)-lmysize; - } - - Window(lmxofs, lmyofs, lmxofs+lmxsize, lmyofs+lmysize, "Load MAP"); - GotoXY(lmxofs+2, lmyofs+13); printstring("Load MAP:"); - TextField(lmxofs+38, lmyofs+11, 70, lmapname, ctf == 1 ? cb : 0); - Button(lmxofs+79, lmyofs+22, "OK"); - Button(lmxofs+111, lmyofs+22, "Cancel"); - Button(lmxofs+111, lmyofs+11, "Browse"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>lmxofs+38 && mxlmyofs+11 && mylmxofs+79 && mxlmyofs+22 && mylmxofs+111 && mxlmyofs+22 && mylmxofs+111 && mxlmyofs+11 && my(lmxofs+lmxsize-9) && (mx(lmyofs+1) && (mylmxofs && mxlmyofs && my<(lmyofs+9) && !moving) - { - moving=1; - mxo=mx-lmxofs; - myo=my-lmyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB) - { - switch (ctf) - { - case 0: ctf=1; str=lmapname; break; - case 1: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - - } while (!done); -} - -int lvxsize=145, lvysize=35; -int lvxofs=80, lvyofs=50; - -void LoadVSPDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - char lvspname[80]; - - last_pressed=0; - memset(lvspname,0,80); - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - lvxofs = (mx-mxo); - lvyofs = (my-myo); - if (!mb) moving=0; - if (lvxofs<16) lvxofs = 16; - if (lvyofs<16) lvyofs = 16; - if (lvxofs+lvxsize>335) lvxofs = 336-lvxsize; - if (lvyofs+lvysize>sy+16) lvyofs = (sy+16)-lvysize; - } - - Window(lvxofs, lvyofs, lvxofs+lvxsize, lvyofs+lvysize, "Load VSP"); - GotoXY(lvxofs+2, lvyofs+13); printstring("Load VSP:"); - TextField(lvxofs+38, lvyofs+11, 70, lvspname, ctf == 1 ? cb : 0); - Button(lvxofs+79, lvyofs+21, "OK"); - Button(lvxofs+111, lvyofs+21, "Cancel"); - Button(lvxofs+111, lvyofs+10, "Browse"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>lvxofs+38 && mxlvyofs+11 && mylvxofs+79 && mxlvyofs+21 && mylvxofs+111 && mxlvyofs+21 && mylvxofs+111 && mxlvyofs+10 && my(lvxofs+lvxsize-9) && (mx(lvyofs+1) && (mylvxofs && mxlvyofs && my<(lvyofs+9) && !moving) - { - moving=1; - mxo=mx-lvxofs; - myo=my-lvyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=lvspname; break; - case 1: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=lvspname; break; - case 1: ctf=0; str=lvspname; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} -int mpxsize=175, mpysize=37; -int mpxofs=60, mpyofs=60; - -void MPDialog() -{ char done=0, moving=0, playmod[80]; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - memset(playmod, 0, 80); - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - mpxofs = (mx-mxo); - mpyofs = (my-myo); - if (!mb) moving=0; - if (mpxofs<16) mpxofs = 16; - if (mpyofs<16) mpyofs = 16; - if (mpxofs+mpxsize>335) mpxofs = 336-mpxsize; - if (mpyofs+mpysize>sy+16) mpyofs = (sy+16)-mpysize; - } - - Window(mpxofs, mpyofs, mpxofs+mpxsize, mpyofs+mpysize, "MOD Player Controls"); - GotoXY(mpxofs+2, mpyofs+15); printstring("MOD Playing:"); - TextField(mpxofs+49, mpyofs+13, 90, playmod, ctf == 1 ? cb : 0); - Button(mpxofs+110, mpyofs+24, "Play"); - Button(mpxofs+142, mpyofs+24, "Stop"); - Button(mpxofs+78, mpyofs+24, "OK"); - Button(mpxofs+142, mpyofs+12, "Browse"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>mpxofs+49 && mxmpyofs+13 && mympxofs+110 && mxmpyofs+24 && mympxofs+142 && mxmpyofs+24 && mympxofs+78 && mxmpyofs+24 && mympxofs+142 && mxmpyofs+12 && my(mpxofs+mpxsize-9) && (mx(mpyofs+1) && (mympxofs && mxmpyofs && my<(mpyofs+9) && !moving) - { - moving=1; - mxo=mx-mpxofs; - myo=my-mpyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=playmod; break; - case 1: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=playmod; break; - case 1: ctf=0; str=playmod; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -int zexsize=135, zeysize=86; -int zexofs=80, zeyofs=40; - -void ZoneEdDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink, i=0; - char ctf=0, cb=0, c, t, *str; - char nstr1[80], nstr2[80], nstr3[80], nstr4[80]; - - i=curzone; - sprintf(nstr1, "%d", zones[i].script); - sprintf(nstr2, "%d", zones[i].percent); - sprintf(nstr3, "%d", zones[i].delay); - sprintf(nstr4, "%d", zones[i].entityscript); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - zexofs = (mx-mxo); - zeyofs = (my-myo); - if (!mb) moving=0; - if (zexofs<16) zexofs = 16; - if (zeyofs<16) zeyofs = 16; - if (zexofs+zexsize>335) zexofs = 336-zexsize; - if (zeyofs+zeysize>sy+16) zeyofs = (sy+16)-zeysize; - } - - Window(zexofs, zeyofs, zexofs+zexsize, zeyofs+zeysize, "Zone Editor"); - GotoXY(zexofs+8, zeyofs+12); printstring("Name:"); - TextField(zexofs+30, zeyofs+10, 100, zones[i].name, ctf == 1 ? cb : 0); - GotoXY(zexofs+5, zeyofs+22); printstring("Script:"); - TextField(zexofs+30, zeyofs+20, 100, nstr1, ctf == 2 ? cb : 0); - GotoXY(zexofs+2, zeyofs+32); printstring("Chance:"); - TextField(zexofs+30, zeyofs+30, 100, nstr2, ctf == 3 ? cb : 0); - GotoXY(zexofs+7, zeyofs+42); printstring("Delay:"); - TextField(zexofs+30, zeyofs+40, 100, nstr3, ctf == 4 ? cb : 0); - GotoXY(zexofs+4, zeyofs+52); printstring("Entity:"); - TextField(zexofs+30, zeyofs+50, 100, nstr4, ctf == 5 ? cb : 0); - CheckBox(zexofs+20, zeyofs+61, zones[i].aaa); - GotoXY(zexofs+31, zeyofs+62); printstring("Allow Adjacent Activation"); - Button(zexofs+99, zeyofs+71, "OK"); - GotoXY(zexofs+12, zeyofs+73); printstring("Zone"); - GotoXY(zexofs+30, zeyofs+73); - sprintf(strbuf,"%d",i); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>zexofs+30 && mxzeyofs+10 && myzexofs+30 && mxzeyofs+20 && myzexofs+30 && mxzeyofs+30 && myzexofs+30 && mxzeyofs+40 && myzexofs+30 && mxzeyofs+50 && myzexofs+20 && mxzeyofs+61 && myzexofs+99 && mxzeyofs+71 && my(zexofs+zexsize-9) && (mx(zeyofs+1) && (myzexofs && mxzeyofs && my<(zeyofs+9) && !moving) - { - moving=1; - mxo=mx-zexofs; - myo=my-zeyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - if (last_pressed==SCAN_UP) - { - zones[i].script=atoi(nstr1); - zones[i].percent=atoi(nstr2); - zones[i].delay=atoi(nstr3); - zones[i].entityscript=atoi(nstr4); - if (i<255) i++; else i=0; - last_pressed=0; key[SCAN_UP]=0; - sprintf(nstr1, "%d", zones[i].script); - sprintf(nstr2, "%d", zones[i].percent); - sprintf(nstr3, "%d", zones[i].delay); - sprintf(nstr4, "%d", zones[i].entityscript); - continue; - } - if (last_pressed==SCAN_DOWN) - { - zones[i].script=atoi(nstr1); - zones[i].percent=atoi(nstr2); - zones[i].delay=atoi(nstr3); - zones[i].entityscript=atoi(nstr4); - if (i) i--; else i=255; - last_pressed=0; key[SCAN_DOWN]=0; - sprintf(nstr1, "%d", zones[i].script); - sprintf(nstr2, "%d", zones[i].percent); - sprintf(nstr3, "%d", zones[i].delay); - sprintf(nstr4, "%d", zones[i].entityscript); - continue; - } - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=zones[i].name; break; - case 1: ctf=2; str=nstr1; break; - case 2: ctf=3; str=nstr2; break; - case 3: ctf=4; str=nstr3; break; - case 4: ctf=5; str=nstr4; break; - case 5: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=5; str=nstr4; break; - case 1: ctf=0; str=0; break; - case 2: ctf=1; str=zones[i].name; break; - case 3: ctf=2; str=nstr1; break; - case 4: ctf=3; str=nstr2; break; - case 5: ctf=4; str=nstr3; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - - } while (!done); - curzone=i; - zones[i].script=atoi(nstr1); - zones[i].percent=atoi(nstr2); - zones[i].delay=atoi(nstr3); - zones[i].entityscript=atoi(nstr4); -} - -int exsize=180, eysize=175; -int exofs=70, eyofs=30; - -void EntityEditor(int i) -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - char nstr1[80], nstr2[80], nstr3[80], nstr4[80], nstr5[80], nstr6[80], nstr7[80], nstr8[80], nstr9[80], nstr10[80], nstr11[80], nstr12[80], nstr13[80]; - - sprintf(nstr1, "%d", entity[i].x); - sprintf(nstr2, "%d", entity[i].y); - sprintf(nstr3, "%d", entity[i].chrindex); - sprintf(nstr4, "%d", entity[i].speed); - sprintf(nstr5, "%d", entity[i].actscript); - sprintf(nstr6, "%d", entity[i].movecode); - sprintf(nstr7, "%d", entity[i].step); - sprintf(nstr8, "%d", entity[i].data2); - sprintf(nstr9, "%d", entity[i].data3); - sprintf(nstr10, "%d", entity[i].delay); - sprintf(nstr11, "%d", entity[i].data5); - sprintf(nstr12, "%d", entity[i].data6); - sprintf(nstr13, "%d", entity[i].movescript); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - exofs = (mx-mxo); - eyofs = (my-myo); - if (!mb) moving=0; - if (exofs<16) exofs = 16; - if (eyofs<16) eyofs = 16; - if (exofs+exsize>335) exofs = 336-exsize; - if (eyofs+eysize>sy+16) eyofs = (sy+16)-eysize; - } - - Window(exofs, eyofs, exofs+exsize, eyofs+eysize, "Entity Editor"); - GotoXY(exofs+7, eyofs+13); printstring("Desc:"); - TextField(exofs+26, eyofs+11, 80, entity[i].desc, ctf == 1 ? cb : 0); - GotoXY(exofs+19, eyofs+23); printstring("X:"); - TextField(exofs+26, eyofs+21, 80, nstr1, ctf == 2 ? cb : 0); - GotoXY(exofs+19, eyofs+33); printstring("Y:"); - TextField(exofs+26, eyofs+31, 80, nstr2, ctf == 3 ? cb : 0); - GotoXY(exofs+11, eyofs+43); printstring("CHR:"); - TextField(exofs+26, eyofs+41, 80, nstr3, ctf == 4 ? cb : 0); - - // *** - // entity image goes here (just above chr list button) - // *** - - BigButton(exofs+116, eyofs+61, "CHR List"); - BigButton(exofs+115, eyofs+153, "Scripts"); - GotoXY(exofs+2, eyofs+155); printstring("Movescript:"); - HLine(exofs+1, eyofs+73, 178, white); - GotoXY(exofs+3, eyofs+53); printstring("Speed:"); - TextField(exofs+26, eyofs+51, 80, nstr4, ctf == 5 ? cb : 0); - TextField(exofs+26, eyofs+61, 80, nstr5, ctf == 6 ? cb : 0); - GotoXY(exofs+107, eyofs+79); printstring("Is Obstruction"); - CheckBox(exofs+161, eyofs+87, entity[i].obsmode1); - GotoXY(exofs+102, eyofs+88); printstring("Is Obstructable"); - CheckBox(exofs+161, eyofs+78, entity[i].obsmode2); - GotoXY(exofs+24, eyofs+79); printstring("Auto Face"); - CheckBox(exofs+61, eyofs+78, entity[i].face); - GotoXY(exofs+10, eyofs+88); printstring("Activ. Method"); - CheckBox(exofs+61, eyofs+87, entity[i].actm); - HLine(exofs+1, eyofs+98, 178, white); - GotoXY(exofs+126, eyofs+166); printstring("Entity"); - GotoXY(exofs+6, eyofs+104); printstring("Move Code:"); - TextField(exofs+47, eyofs+103, 80, nstr6, ctf == 7 ? cb : 0); - TextField(exofs+30, eyofs+115, 40, nstr7, ctf == 8 ? cb : 0); - TextField(exofs+30, eyofs+125, 40, nstr8, ctf == 9 ? cb : 0); - TextField(exofs+30, eyofs+135, 40, nstr9, ctf == 10 ? cb : 0); - TextField(exofs+113, eyofs+115, 40, nstr10, ctf == 11 ? cb : 0); - TextField(exofs+113, eyofs+125, 40, nstr11, ctf == 12 ? cb : 0); - TextField(exofs+113, eyofs+135, 40, nstr12, ctf == 13 ? cb : 0); - HLine(exofs+1, eyofs+148, 178, white); - TextField(exofs+46, eyofs+153, 60, nstr13, ctf == 14 ? cb : 0); - GotoXY(exofs+5, eyofs+63); printstring("Activ:"); - GotoXY(exofs+152, eyofs+166); - sprintf(strbuf, "%d/%d", i, entities-1); printstring(strbuf); - entity[i].movecode=atoi(nstr6); - if (ctf!=4) entity[i].chrindex=atoi(nstr3); - - switch (entity[i].movecode) - { - case 0: GotoXY(exofs+131, eyofs+104); printstring("Stopped"); break; - case 1: GotoXY(exofs+131, eyofs+104); printstring("Wander"); - GotoXY(exofs+11, eyofs+116); printstring("Step:"); - GotoXY(exofs+90, eyofs+116); printstring("Delay:"); break; - case 2: GotoXY(exofs+131, eyofs+104); printstring("Wander Zone"); - GotoXY(exofs+11, eyofs+116); printstring("Step:"); - GotoXY(exofs+90, eyofs+116); printstring("Delay:"); - GotoXY(exofs+10, eyofs+126); printstring("Zone:"); break; - case 3: GotoXY(exofs+131, eyofs+104); printstring("Wander Box"); - GotoXY(exofs+11, eyofs+116); printstring("Step:"); - GotoXY(exofs+90, eyofs+116); printstring("Delay:"); - GotoXY(exofs+21, eyofs+126); printstring("X1:"); - GotoXY(exofs+21, eyofs+136); printstring("Y1:"); - GotoXY(exofs+102, eyofs+126); printstring("X2:"); - GotoXY(exofs+102, eyofs+136); printstring("Y2:"); break; - case 4: GotoXY(exofs+131, eyofs+104); printstring("Scripted"); break; - } - switch (entity[i].actm) - { - case 0: GotoXY(exofs+72, eyofs+88); printstring("Actv"); break; - case 1: GotoXY(exofs+72, eyofs+88); printstring("Adjc"); break; - } - - if (chrs[entity[i].chrindex].frame) - TCopySprite(exofs+143-(chrs[entity[i].chrindex].fx/2), - eyofs+31-(chrs[entity[i].chrindex].fy/2), - chrs[entity[i].chrindex].fx, chrs[entity[i].chrindex].fy, - chrs[entity[i].chrindex].frame); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>exofs+26 && mxeyofs+11 && myexofs+26 && mxeyofs+21 && myexofs+26 && mxeyofs+31 && myexofs+26 && mxeyofs+41 && myexofs+116 && mxeyofs+61 && myexofs+26 && mxeyofs+51 && myexofs+26 && mxeyofs+61 && myexofs+115 && mxeyofs+153 && myexofs+161 && mxeyofs+87 && myexofs+161 && mxeyofs+78 && myexofs+61 && mxeyofs+78 && myexofs+61 && mxeyofs+87 && myexofs+47 && mxeyofs+103 && myexofs+30 && mxeyofs+115 && myexofs+30 && mxeyofs+125 && myexofs+30 && mxeyofs+135 && myexofs+113 && mxeyofs+115 && myexofs+113 && mxeyofs+125 && myexofs+113 && mxeyofs+135 && myexofs+46 && mxeyofs+153 && my(exofs+exsize-9) && (mx(eyofs+1) && (myexofs && mxeyofs && my<(eyofs+9) && !moving) - { - moving=1; - mxo=mx-exofs; - myo=my-eyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_UP) - { - entity[i].x=atoi(nstr1); - entity[i].y=atoi(nstr2); - entity[i].chrindex=atoi(nstr3); - entity[i].speed=atoi(nstr4); - entity[i].actscript=atoi(nstr5); - entity[i].movecode=atoi(nstr6); - entity[i].step=atoi(nstr7); - entity[i].data2=atoi(nstr8); - entity[i].data3=atoi(nstr9); - entity[i].delay=atoi(nstr10); - entity[i].data5=atoi(nstr11); - entity[i].data6=atoi(nstr12); - entity[i].movescript=atoi(nstr13); - - if (i= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - clxofs = (mx-mxo); - clyofs = (my-myo); - if (!mb) moving=0; - if (clxofs<16) clxofs = 16; - if (clyofs<16) clyofs = 16; - if (clxofs+clxsize>335) clxofs = 336-clxsize; - if (clyofs+clysize>sy+16) clyofs = (sy+16)-clysize; - } - - Window(clxofs, clyofs, clxofs+clxsize, clyofs+clysize, "Entity CHR Reference Index"); - TextField(clxofs+14, clyofs+11, 120, chrlist[base].t, ctf == 1 ? cb : 0); - TextField(clxofs+14, clyofs+22, 120, chrlist[base+1].t, ctf == 2 ? cb : 0); - TextField(clxofs+14, clyofs+33, 120, chrlist[base+2].t, ctf == 3 ? cb : 0); - TextField(clxofs+14, clyofs+44, 120, chrlist[base+3].t, ctf == 4 ? cb : 0); - TextField(clxofs+14, clyofs+55, 120, chrlist[base+4].t, ctf == 5 ? cb : 0); - Button(clxofs+137, clyofs+65, "OK"); - Button(clxofs+137, clyofs+10, "Browse"); - Button(clxofs+137, clyofs+21, "Browse"); - Button(clxofs+137, clyofs+32, "Browse"); - Button(clxofs+137, clyofs+43, "Browse"); - Button(clxofs+137, clyofs+54, "Browse"); - GotoXY(clxofs+3, clyofs+11); sprintf(strbuf,"%d:", base); printstring(strbuf); - GotoXY(clxofs+3, clyofs+22); sprintf(strbuf,"%d:", base+1); printstring(strbuf); - GotoXY(clxofs+3, clyofs+33); sprintf(strbuf,"%d:", base+2); printstring(strbuf); - GotoXY(clxofs+3, clyofs+44); sprintf(strbuf,"%d:", base+3); printstring(strbuf); - GotoXY(clxofs+3, clyofs+55); sprintf(strbuf,"%d:", base+4); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>clxofs+14 && mxclyofs+11 && myclxofs+14 && mxclyofs+22 && myclxofs+14 && mxclyofs+33 && myclxofs+14 && mxclyofs+44 && myclxofs+14 && mxclyofs+55 && myclxofs+137 && mxclyofs+65 && myclxofs+137 && mxclyofs+10 && myclxofs+137 && mxclyofs+21 && myclxofs+137 && mxclyofs+32 && myclxofs+137 && mxclyofs+43 && myclxofs+137 && mxclyofs+54 && my(clxofs+clxsize-9) && (mx(clyofs+1) && (myclxofs && mxclyofs && my<(clyofs+9) && !moving) - { - moving=1; - mxo=mx-clxofs; - myo=my-clyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - if (key[SCAN_UP]) - { - key[SCAN_UP]=0; - if (base) base--; - last_pressed=0; - continue; - } - if (key[SCAN_DOWN]) - { - key[SCAN_DOWN]=0; - if (base<95) base++; - last_pressed=0; - continue; - } - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=chrlist[base].t; break; - case 1: ctf=2; str=chrlist[base+1].t; break; - case 2: ctf=3; str=chrlist[base+2].t; break; - case 3: ctf=4; str=chrlist[base+3].t; break; - case 4: ctf=5; str=chrlist[base+4].t; break; - case 5: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=5; str=chrlist[base].t; break; - case 1: ctf=0; str=chrlist[base].t; break; - case 2: ctf=1; str=chrlist[base+1].t; break; - case 3: ctf=2; str=chrlist[base+2].t; break; - case 4: ctf=3; str=chrlist[base+3].t; break; - case 5: ctf=4; str=chrlist[base+4].t; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -int msxsize=181, msysize=77; -int msxofs=70, msyofs=50; -char base1=0; - -void MoveScriptDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - msxofs = (mx-mxo); - msyofs = (my-myo); - if (!mb) moving=0; - if (msxofs<16) msxofs = 16; - if (msyofs<16) msyofs = 16; - if (msxofs+msxsize>335) msxofs = 336-msxsize; - if (msyofs+msysize>sy+16) msyofs = (sy+16)-msysize; - } - - Window(msxofs, msyofs, msxofs+msxsize, msyofs+msysize, "Movement Script Editor"); - TextField(msxofs+15, msyofs+12, 160, ms[base1].t, ctf == 1 ? cb : 0); - TextField(msxofs+15, msyofs+22, 160, ms[base1+1].t, ctf == 2 ? cb : 0); - TextField(msxofs+15, msyofs+32, 160, ms[base1+2].t, ctf == 3 ? cb : 0); - TextField(msxofs+15, msyofs+42, 160, ms[base1+3].t, ctf == 4 ? cb : 0); - TextField(msxofs+15, msyofs+52, 160, ms[base1+4].t, ctf == 5 ? cb : 0); - Button(msxofs+146, msyofs+63, "OK"); - GotoXY(msxofs+3, msyofs+11); sprintf(strbuf,"%d:", base1); printstring(strbuf); - GotoXY(msxofs+3, msyofs+22); sprintf(strbuf,"%d:", base1+1); printstring(strbuf); - GotoXY(msxofs+3, msyofs+33); sprintf(strbuf,"%d:", base1+2); printstring(strbuf); - GotoXY(msxofs+3, msyofs+44); sprintf(strbuf,"%d:", base1+3); printstring(strbuf); - GotoXY(msxofs+3, msyofs+55); sprintf(strbuf,"%d:", base1+4); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>msxofs+15 && mxmsyofs+12 && mymsxofs+15 && mxmsyofs+22 && mymsxofs+15 && mxmsyofs+32 && mymsxofs+15 && mxmsyofs+42 && mymsxofs+15 && mxmsyofs+52 && mymsxofs+146 && mxmsyofs+63 && my(msxofs+msxsize-9) && (mx(msyofs+1) && (mymsxofs && mxmsyofs && my<(msyofs+9) && !moving) - { - moving=1; - mxo=mx-msxofs; - myo=my-msyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - if (key[SCAN_UP]) - { - key[SCAN_UP]=0; - if (base1) base1--; - last_pressed=0; - continue; - } - if (key[SCAN_DOWN]) - { - key[SCAN_DOWN]=0; - if (base1<95) base1++; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=ms[base1].t; break; - case 1: ctf=2; str=ms[base1+1].t; break; - case 2: ctf=3; str=ms[base1+2].t; break; - case 3: ctf=4; str=ms[base1+3].t; break; - case 4: ctf=5; str=ms[base1+4].t; break; - case 5: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=5; str=ms[base1+4].t; break; - case 1: ctf=0; str=0; break; - case 2: ctf=1; str=ms[base1].t; break; - case 3: ctf=2; str=ms[base1+1].t; break; - case 4: ctf=3; str=ms[base1+2].t; break; - case 5: ctf=4; str=ms[base1+3].t; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -int prxsize=150, prysize=80; -int prxofs=50, pryofs=60; - -void MapPropertiesDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - prxofs = (mx-mxo); - pryofs = (my-myo); - if (!mb) moving=0; - if (prxofs<16) prxofs = 16; - if (pryofs<16) pryofs = 16; - if (prxofs+prxsize>335) prxofs = 336-prxsize; - if (pryofs+prysize>sy+16) pryofs = (sy+16)-prysize; - } - - Window(prxofs, pryofs, prxofs+prxsize, pryofs+prysize, "MAP Properties"); - GotoXY(prxofs+10, pryofs+23); printstring("Music:"); - TextField(prxofs+33, pryofs+11, 112, mapname, ctf == 1 ? cb : 0); - TextField(prxofs+33, pryofs+21, 112, musname, ctf == 2 ? cb : 0); - GotoXY(prxofs+18, pryofs+33); printstring("VSP:"); - TextField(prxofs+33, pryofs+31, 112, vspname, ctf == 3 ? cb : 0); - GotoXY(prxofs+3, pryofs+43); printstring("rstring:"); - TextField(prxofs+33, pryofs+41, 112, rstring, ctf == 4 ? cb : 0); - BigButton(prxofs+97, pryofs+56, "Resize MAP"); - HLine(prxofs+1, pryofs+53, 148, white); - GotoXY(prxofs+3, pryofs+58); printstring("xsize:"); - sprintf(strbuf,"%d",layer[0].sizex); printstring(strbuf); - GotoXY(prxofs+49, pryofs+58); printstring("ysize:"); - sprintf(strbuf,"%d",layer[0].sizey); printstring(strbuf); - Button(prxofs+117, pryofs+67, "OK"); - GotoXY(prxofs+16, pryofs+13); printstring("MAP:"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>prxofs+33 && mxpryofs+11 && myprxofs+33 && mxpryofs+21 && myprxofs+33 && mxpryofs+31 && myprxofs+33 && mxpryofs+41 && myprxofs+97 && mxpryofs+56 && myprxofs+117 && mxpryofs+67 && my(prxofs+prxsize-9) && (mx(pryofs+1) && (myprxofs && mxpryofs && my<(pryofs+9) && !moving) - { - moving=1; - mxo=mx-prxofs; - myo=my-pryofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=mapname; break; - case 1: ctf=2; str=musname; break; - case 2: ctf=3; str=vspname; break; - case 3: ctf=4; str=rstring; break; - case 4: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=4; str=rstring; break; - case 1: ctf=0; str=0; break; - case 2: ctf=1; str=mapname; break; - case 3: ctf=2; str=musname; break; - case 4: ctf=3; str=vspname; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - - } while (!done); - -} - -int rsxsize=134, rsysize=44; -int rsxofs=20, rsyofs=20; - -static void PutByte(byte *to, byte v, int x, int y, int w, int h) -{ - if (x<0 || x>=w || y<0 || y>=h) - return; - - to[(y*w)+x]=v; -} - -static byte GetByte(byte *from, int x, int y, int w, int h) -{ - if (x<0 || x>=w || y<0 || y>=h) - return 0; - - return from[(y*w)+x]; -} - -static void PutWord(word *to, word v, int x, int y, int w, int h) -{ - if (x<0 || x>=w || y<0 || y>=h) - return; - - to[(y*w)+x]=v; -} - -static word GetWord(word *from, int x, int y, int w, int h) -{ - if (x<0 || x>=w || y<0 || y>=h) - return 0; - - return from[(y*w)+x]; -} - -void ResizeMapDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink, basex, basey, i; //, xl, yl; - char ctf=0, cb=0, c, t; - char *str, *tb; //, *s1, *d1; - char nstr1[80], nstr2[80]; - word *tbw; //, *s=NULL,*d=NULL; - //int temp_width; - int a,b; - - basex=layer[0].sizex; - basey=layer[0].sizey; - sprintf(nstr1, "%d", basex); - sprintf(nstr2, "%d", basey); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - rsxofs = (mx-mxo); - rsyofs = (my-myo); - if (!mb) moving=0; - if (rsxofs<16) rsxofs = 16; - if (rsyofs<16) rsyofs = 16; - if (rsxofs+rsxsize>335) rsxofs = 336-rsxsize; - if (rsyofs+rsysize>sy+16) rsyofs = (sy+16)-rsysize; - } - - Window(rsxofs, rsyofs, rsxofs+rsxsize, rsyofs+rsysize, "Resize MAP"); - GotoXY(rsxofs+4, rsyofs+12); printstring("Base X:"); - GotoXY(rsxofs+4, rsyofs+22); printstring("Base Y:"); - TextField(rsxofs+30, rsyofs+10, 100, nstr1, ctf == 1 ? cb : 0); - TextField(rsxofs+30, rsyofs+20, 100, nstr2, ctf == 2 ? cb : 0); - Button(rsxofs+69, rsyofs+31, "Resize"); - Button(rsxofs+101, rsyofs+31, "Cancel"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>rsxofs+30 && mxrsyofs+10 && myrsxofs+30 && mxrsyofs+20 && myrsxofs+69 && mxrsyofs+31 && myrsxofs+101 && mxrsyofs+31 && my(rsxofs+rsxsize-9) && (mx(rsyofs+1) && (myrsxofs && mxrsyofs && my<(rsyofs+9) && !moving) - { - moving=1; - mxo=mx-rsxofs; - myo=my-rsyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=nstr1; break; - case 1: ctf=2; str=nstr2; break; - case 2: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=2; str=nstr2; break; - case 1: ctf=0; str=0; break; - case 2: ctf=1; str=nstr1; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); - basex=atoi(nstr1); - basey=atoi(nstr2); -} - -int cdxsize=150, cdysize=45; -int cdxofs=110, cdyofs=70; -char curtrack=1; - -void CDDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - cdxofs = (mx-mxo); - cdyofs = (my-myo); - if (!mb) moving=0; - if (cdxofs<16) cdxofs = 16; - if (cdyofs<16) cdyofs = 16; - if (cdxofs+cdxsize>335) cdxofs = 336-cdxsize; - if (cdyofs+cdysize>sy+16) cdyofs = (sy+16)-cdysize; - } - - Window(cdxofs, cdyofs, cdxofs+cdxsize, cdyofs+cdysize, "CD Player"); - Button(cdxofs+53, cdyofs+10, "Play"); - Button(cdxofs+53, cdyofs+21, "Stop"); - Button(cdxofs+85, cdyofs+10, "Eject"); - Button(cdxofs+85, cdyofs+21, "Close"); - Button(cdxofs+117, cdyofs+10, "Next"); - Button(cdxofs+117, cdyofs+21, "Prev"); - Button(cdxofs+117, cdyofs+32, "OK"); - GotoXY(cdxofs+4, cdyofs+18); printstring("Track "); - sprintf(strbuf,"%d",curtrack); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>cdxofs+53 && mxcdyofs+10 && mycdxofs+53 && mxcdyofs+21 && mycdxofs+85 && mxcdyofs+10 && mycdxofs+85 && mxcdyofs+21 && mycdxofs+117 && mxcdyofs+10 && mycdxofs+117 && mxcdyofs+21 && my1) curtrack--; - while (mb) - { - ReadMouse(); - ShowPage(); - ReadMouse(); - } - WaitRelease(); continue; - } - - if ((mb==1 && mx>cdxofs+117 && mxcdyofs+32 && my(cdxofs+cdxsize-9) && (mx(cdyofs+1) && (mycdxofs && mxcdyofs && my<(cdyofs+9) && !moving) - { - moving=1; - mxo=mx-cdxofs; - myo=my-cdyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -int ntxsize=130, nytsize=51; -int ntxofs=110, ntyofs=70; - -void NoticeDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - ntxofs = (mx-mxo); - ntyofs = (my-myo); - if (!mb) moving=0; - if (ntxofs<16) ntxofs = 16; - if (ntyofs<16) ntyofs = 16; - if (ntxofs+ntxsize>335) ntxofs = 336-ntxsize; - if (ntyofs+nytsize>sy+16) ntyofs = (sy+16)-nytsize; - } - - Window(ntxofs, ntyofs, ntxofs+ntxsize, ntyofs+nytsize, "Notice!"); - GotoXY(ntxofs+20, ntyofs+20); printstring("Don't forget to add this"); - GotoXY(ntxofs+14, ntyofs+26); printstring("layer to the Render String!"); - Button(ntxofs+50, ntyofs+36, "OK"); - GotoXY(ntxofs+25, ntyofs+14); printstring("Layer has been added."); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if ((mb==1 && mx>ntxofs+50 && mxntyofs+36 && my(ntxofs+ntxsize-9) && (mx(ntyofs+1) && (myntxofs && mxntyofs && my<(ntyofs+9) && !moving) - { - moving=1; - mxo=mx-ntxofs; - myo=my-ntyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -int oxsize=150, oysize=98; -int oxofs=120, oyofs=70; -extern char vcedprog[80]; - -void OptionsDialog() -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - char nstr1[80], nstr2[80], nstr3[80], nstr4[80]; - - sprintf(nstr1, "%d", winbg); - sprintf(nstr2, "%d", titlebg); - sprintf(nstr3, "%d", brightw); - sprintf(nstr4, "%d", darkw); - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - oxofs = (mx-mxo); - oyofs = (my-myo); - if (!mb) moving=0; - if (oxofs<16) oxofs = 16; - if (oyofs<16) oyofs = 16; - if (oxofs+oxsize>335) oxofs = 336-oxsize; - if (oyofs+oysize>sy+16) oyofs = (sy+16)-oysize; - } - - Window(oxofs, oyofs, oxofs+oxsize, oyofs+oysize, "MapEd Options"); - GotoXY(oxofs+16, oyofs+12); printstring("Smooth Scroll"); - CheckBox(oxofs+5, oyofs+11, scrollmode); - GotoXY(oxofs+16, oyofs+20); printstring("Tile Highlight"); - CheckBox(oxofs+5, oyofs+19, mh); - GotoXY(oxofs+38, oyofs+31); printstring("Window Background"); - TextField(oxofs+5, oyofs+29, 30, nstr1, ctf == 1 ? cb : 0); - TextField(oxofs+5, oyofs+39, 30, nstr2, ctf == 2 ? cb : 0); - GotoXY(oxofs+38, oyofs+41); printstring("Titlebar Background"); - CheckBox(oxofs+74, oyofs+11, vm); - GotoXY(oxofs+84, oyofs+12); printstring("320x240 driver"); - CheckBox(oxofs+74, oyofs+19, mouse_scroll); - GotoXY(oxofs+84, oyofs+20); printstring("Mouse Scrolling"); - TextField(oxofs+5, oyofs+49, 30, nstr3, ctf == 3 ? cb : 0); - TextField(oxofs+5, oyofs+59, 30, nstr4, ctf == 4 ? cb : 0); - GotoXY(oxofs+38, oyofs+51); printstring("White"); - GotoXY(oxofs+38, oyofs+61); printstring("Shadow"); - Button(oxofs+60, oyofs+85, "OK"); - HLine(oxofs+1, oyofs+71, 148, white); - GotoXY(oxofs+3, oyofs+76); printstring("Editor:"); - TextField(oxofs+28, oyofs+74, 118, vcedprog, ctf == 5 ? cb : 0); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>oxofs+5 && mxoyofs+11 && my>4; xwin=xwin<<4; - ywin=ywin>>4; ywin=ywin<<4; - scrollmode ^= 1; WaitRelease(); continue; - } - - if (mb==1 && mx>oxofs+5 && mxoyofs+19 && myoxofs+5 && mxoyofs+29 && myoxofs+5 && mxoyofs+39 && myoxofs+74 && mxoyofs+11 && myoxofs+74 && mxoyofs+19 && myoxofs+5 && mxoyofs+49 && myoxofs+5 && mxoyofs+59 && myoxofs+60 && mxoyofs+85 && myoxofs+28 && mxoyofs+74 && my(oxofs+oxsize-9) && (mx(oyofs+1) && (myoxofs && mxoyofs && my<(oyofs+9) && !moving) - { - moving=1; - mxo=mx-oxofs; - myo=my-oyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=nstr1; break; - case 1: ctf=2; str=nstr2; break; - case 2: ctf=3; str=nstr3; break; - case 3: ctf=4; str=nstr4; break; - case 4: ctf=5; str=vcedprog; break; - case 5: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=5; str=vcedprog; break; - case 1: ctf=0; str=0; break; - case 2: ctf=1; str=nstr1; break; - case 3: ctf=2; str=nstr2; break; - case 4: ctf=3; str=nstr3; break; - case 5: ctf=4; str=nstr4; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); - winbg=atoi(nstr1); - titlebg=atoi(nstr2); - brightw=atoi(nstr3); - darkw=atoi(nstr4); -} - -int vcexsize=200, vceysize=60; -int vcexofs=76, vceyofs=70; - -void VCNotify(char *msg) -{ char done=0, moving=0; - int mxo, myo, cursorblink; - char ctf=0, cb=0, c, t, *str; - - last_pressed=0; - do - { - RenderMap(); - RenderGUI(); - - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - vcexofs = (mx-mxo); - vceyofs = (my-myo); - if (!mb) moving=0; - if (vcexofs<16) vcexofs = 16; - if (vceyofs<16) vceyofs = 16; - if (vcexofs+vcexsize>335) vcexofs = 336-vcexsize; - if (vceyofs+vceysize>sy+16) vceyofs = (sy+16)-vceysize; - } - - Window(vcexofs, vceyofs, vcexofs+vcexsize, vceyofs+vceysize, "VergeC Error Report"); - Button(vcexofs+85, vceyofs+41, "OK"); - GotoXY(vcexofs+29, vceyofs+17); printstring("VCC has reported the following error:"); - GotoXY(vcexofs+100-(pixels(msg)/2), vceyofs+23); printstring(msg); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if ((mb==1 && mx>vcexofs+85 && mxvceyofs+41 && my(vcexofs+vcexsize-9) && (mx(vceyofs+1) && (myvcexofs && mxvceyofs && my<(vceyofs+9) && !moving) - { - moving=1; - mxo=mx-vcexofs; - myo=my-vceyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} diff --git a/16/v2/source/verge/MAPED/GUI.H b/16/v2/source/verge/MAPED/GUI.H deleted file mode 100755 index 1662db7f..00000000 --- a/16/v2/source/verge/MAPED/GUI.H +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef GUI_INC -#define GUI_INC - -extern int amxofs, amyofs; -extern int mmxofs, mmyofs; -extern int cnxofs, cnyofs; -extern int lmxofs, lmyofs; -extern int lvxofs, lvyofs; -extern int vaxofs, vayofs; -extern int mpxofs, mpyofs; -extern int zexofs, zeyofs; -extern int exofs, eyofs; -extern int prxofs, pryofs; -extern int rsxofs, rsyofs; - -extern void CheckMessageExpirations(); -extern void Message(char *text, int duration); -extern void DrawScreenControls(); -extern void RenderMessages(); -extern void RenderGUI(); -extern void DoMainMenu(); -extern void MainMenu(int dx, int dy); -#define byte unsigned char -extern byte TileCmp(byte *one, byte *two); -extern void ImageToLayer(); -extern void Destroyer(); -extern void LayersSubMenu(int dx, int dy); -extern void ExecuteSubMenu(int dx, int dy); -extern void AddLayer(); -extern void EditLayerProperties(); -extern void NewMAP(); -extern void About(); -extern int Confirm(char *message); -extern void LoadMAPDialog(); -extern void LoadVSPDialog(); -extern void MPDialog(); -extern void ZoneEdDialog(); -extern void EntityEditor(int i); -extern void CHRList(); -extern void MoveScriptDialog(); -extern void MapPropertiesDialog(); -extern void ResizeMapDialog(); -extern void CDDialog(); -extern void NoticeDialog(); -extern void OptionsDialog(); -extern void VCNotify(char *msg); - -#endif // GUI_INC diff --git a/16/v2/source/verge/MAPED/GUICOMP.C b/16/v2/source/verge/MAPED/GUICOMP.C deleted file mode 100755 index e9f87795..00000000 --- a/16/v2/source/verge/MAPED/GUICOMP.C +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// Additional code by Richard Lau (aka Ric) - -#include "config.h" // Colour definitions -#include "vdriver.h" // Video driver functions -#include "smalfont.h" - -// ================================= Code ==================================== - -void stdwindow(int x1, int y1, int x2, int y2) -{ - FilledBox(x1, y1, x2-x1, y2-y1, winbg); - HLine(x1, y1, x2-x1, black); /* -- ric: 13/Jun/98 -- */ - VLine(x1, y1, y2-y1, black); /* Outline window in black */ - HLine(x1+1, y2-1, x2-x1-1, black); - VLine(x2-1, y1+1, y2-y1-1, black); - - HLine(x1+1, y1+1, x2-x1-2, brightw); - VLine(x1+1, y1+1, y2-y1-2, brightw); - HLine(x1+2, y2-2, x2-x1-3, darkw); - VLine(x2-2, y1+2, y2-y1-3, darkw); -} - -void Window(int x1, int y1, int x2, int y2, char *title) -{ - FilledBox(x1, y1, x2-x1, y2-y1, winbg); - FilledBox(x1, y1, x2-x1, 8, titlebg); - HLine(x1, y1, x2-x1, brightw); - VLine(x1, y1, y2-y1, brightw); - HLine(x1+1, y2-1, x2-x1-1, darkw); - VLine(x2-1, y1+1, y2-y1-1, darkw); - FilledBox(x2-8, y1+2, 5, 5, winbg); - HLine(x2-8, y1+2, 6, brightw); - VLine(x2-8, y1+2, 5, brightw); - HLine(x2-7, y1+6, 4, darkw); - VLine(x2-3, y1+3, 4, darkw); - - GotoXY(x1+2, y1+2); - printstring(title); -} - -void CheckBox(int x, int y, char checked) -{ - FilledBox(x, y, 7, 6, 0); - HLine(x, y, 8, darkw); - VLine(x, y, 7, darkw); - HLine(x+1, y+6, 7, brightw); - VLine(x+7, y+1, 5, brightw); - if (checked) - { - GotoXY(x+2, y+2); - printstring("*"); - } -} - -void Button(int x, int y, char *str) -{ - stdwindow(x,y,x+30,y+10); -// HLine(x, y, 30, black); /* -- ric: 13/Jun/98 -- */ -// VLine(x, y, 10, black); /* Outline buttons in black */ -/* HLine(x+1, y+9, 29, black); - VLine(x+29, y+1, 9, black); - - HLine(x+1, y+1, 28, white); - VLine(x+1, y+1, 8, white); - HLine(x+2, y+8, 27, darkw); - VLine(x+28, y+2, 7, darkw); */ - GotoXY(x+(15-(pixels(str)/2)), y+2); - printstring(str); -} - -void BigButton(int x, int y, char *str) -{ - stdwindow(x,y,x+50,y+10); -// HLine(x, y, 50, black); /* -- ric: 13/Jun/98 -- */ -// VLine(x, y, 10, black); /* Outline buttons in black */ -/* HLine(x+1, y+9, 49, black); - VLine(x+49, y+1, 9, black); - - HLine(x+1, y+1, 48, white); - VLine(x+1, y+1, 8, white); - HLine(x+2, y+8, 47, darkw); - VLine(x+48, y+2, 7, darkw); */ - GotoXY(x+(25-(pixels(str)/2)), y+2); - printstring(str); -} - -void ButtonPressed(int x, int y, char *str) -/* -- ric: 13/Jun/98 -- */ -/* Draws a depressed button */ -{ - stdwindow(x,y,x+30,y+10); - HLine(x+1, y+1, 28, darkw); - VLine(x+1, y+1, 8, darkw); - HLine(x+2, y+8, 27, winbg); - VLine(x+28, y+2, 7, winbg); - GotoXY(x+1+(15-(pixels(str)/2)), y+3); - printstring(str); -} - -void BigButtonPressed(int x, int y, char *str) -{ - stdwindow(x,y,x+50,y+10); - HLine(x+1, y+1, 48, darkw); - VLine(x+1, y+1, 8, darkw); - HLine(x+2, y+8, 47, winbg); - VLine(x+48, y+2, 7, winbg); - GotoXY(x+1+(25-(pixels(str)/2)), y+3); - printstring(str); -} - -void TextField(int x, int y, int width, char *str, char blink) -{ - FilledBox(x, y, width, 9, 0); - HLine(x, y, width+1, darkw); - VLine(x, y, 9, darkw); - HLine(x+1, y+8, width-1, brightw); - VLine(x+width, y+1, 8, brightw); - GotoXY(x+2, y+2); - printstring(str); - if (blink) printstring("_"); -} diff --git a/16/v2/source/verge/MAPED/GUICOMP.H b/16/v2/source/verge/MAPED/GUICOMP.H deleted file mode 100755 index 1df18b69..00000000 --- a/16/v2/source/verge/MAPED/GUICOMP.H +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef GUICOMP_INC -#define GUICOMP_INC - -extern void stdwindow(int x1, int y1, int x2, int y2); -extern void Window(int x1, int y1, int x2, int y2, char *title); -extern void CheckBox(int x, int y, char checked); -extern void Button(int x, int y, char *str); -extern void BigButton(int x, int y, char *str); -extern void ButtonPressed(int x, int y, char *str); -extern void BigButtonPressed(int x, int y, char *str); -extern void TextField(int x, int y, int width, char *str, char blink); - -#endif // GUICOMP_INC diff --git a/16/v2/source/verge/MAPED/INTER.H b/16/v2/source/verge/MAPED/INTER.H deleted file mode 100755 index 9c50ae70..00000000 --- a/16/v2/source/verge/MAPED/INTER.H +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(INTERINC) -#define INTERINC - -#ifdef __WATCOMC__ - #include - #define REGISTERS union REGS - #define SET_AX(r,v) (r).w.ax=(short)(v) - #define SET_BX(r,v) (r).w.bx=(short)(v) - #define SET_CX(r,v) (r).w.cx=(short)(v) - #define SET_DX(r,v) (r).w.dx=(short)(v) - #define INTERRUPT(i,r) int386((i),&(r),&(r)) -#elif defined(__DJGPP__) - #include - #define REGISTERS __dpmi_regs - #define SET_AX(r,v) (r).x.ax=(short)(v) - #define SET_BX(r,v) (r).x.bx=(short)(v) - #define SET_CX(r,v) (r).x.cx=(short)(v) - #define SET_DX(r,v) (r).x.dx=(short)(v) - #define INTERRUPT(i,r) __dpmi_int((i),&(r)) -#endif // watcom | djgpp - -#endif // INTERINC diff --git a/16/v2/source/verge/MAPED/KEYBOARD.C b/16/v2/source/verge/MAPED/KEYBOARD.C deleted file mode 100755 index 246db5f0..00000000 --- a/16/v2/source/verge/MAPED/KEYBOARD.C +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include "timer.h" - -// ================================= Data ==================================== - -char key[128]; -char keycode,last_pressed=0; -char codeBuffer[16]; -void (__interrupt __far *biosKeyboardHandler)(); -char handlerinstalled=0; - -unsigned char key_ascii_tbl[128] = -{ - 0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 8, 9, - 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 13, 0, 'a', 's', - 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 39, 0, 0, 92, 'z', 'x', 'c', 'v', - 'b', 'n', 'm', ',', '.', '/', 0, '*', 0, ' ', 0, 3, 3, 3, 3, 8, - 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0, - 0, 0, 0, 127, 0, 0, 92, 3, 3, 0, 0, 0, 0, 0, 0, 0, - 13, 0, '/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', 0, 0, 0, 0, 0 -}; - -unsigned char key_shift_tbl[128] = -{ - 0, 0, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 126, 126, - 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 126, 0, 'A', 'S', - 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', 34, 0, 0, '|', 'Z', 'X', 'C', 'V', - 'B', 'N', 'M', '<', '>', '?', 0, '*', 0, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0, - 0, 0, 1, 127, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 13, 0, '/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', 0, 0, 0, 0, 0 -}; - -// ================================= Data ==================================== - -void __interrupt __far KeyboardHandler() -{ - keycode=inp(0x60); - if (keycode>128) - key[keycode-128]=0; - else - { - key[keycode]=1; - last_pressed=keycode; - } - idlect=0; - outp(0x20,0x20); -} - -void InitKeyboard() -{ - if (handlerinstalled) return; - - biosKeyboardHandler=_dos_getvect(0x09); - _dos_setvect(0x09, KeyboardHandler); - handlerinstalled=1; -} - -void ShutdownKeyboard() -{ - if (handlerinstalled) - _dos_setvect(0x09, biosKeyboardHandler); - handlerinstalled=0; -} diff --git a/16/v2/source/verge/MAPED/KEYBOARD.H b/16/v2/source/verge/MAPED/KEYBOARD.H deleted file mode 100755 index 5a2d2948..00000000 --- a/16/v2/source/verge/MAPED/KEYBOARD.H +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef KEYBOARD_INC -#define KEYBOARD_INC - -extern char key[128],last_pressed; -extern unsigned char key_ascii_tbl[128]; -extern unsigned char key_shift_tbl[128]; - -extern void InitKeyboard(); -extern void ShutdownKeyboard(); - -/* Constants for keyboard scan-codes */ - -#define SCAN_ESC 0x01 -#define SCAN_1 0x02 -#define SCAN_2 0x03 -#define SCAN_3 0x04 -#define SCAN_4 0x05 -#define SCAN_5 0x06 -#define SCAN_6 0x07 -#define SCAN_7 0x08 -#define SCAN_8 0x09 -#define SCAN_9 0x0a -#define SCAN_0 0x0b -#define SCAN_MINUS 0x0c -#define SCAN_EQUALS 0x0d -#define SCAN_BACKSP 0x0e -#define SCAN_TAB 0x0f -#define SCAN_Q 0x10 -#define SCAN_W 0x11 -#define SCAN_E 0x12 -#define SCAN_R 0x13 -#define SCAN_T 0x14 -#define SCAN_Y 0x15 -#define SCAN_U 0x16 -#define SCAN_I 0x17 -#define SCAN_O 0x18 -#define SCAN_P 0x19 -#define SCAN_LANGLE 0x1a -#define SCAN_RANGLE 0x1b -#define SCAN_ENTER 0x1c -#define SCAN_CTRL 0x1d -#define SCAN_A 0x1e -#define SCAN_S 0x1f -#define SCAN_D 0x20 -#define SCAN_F 0x21 -#define SCAN_G 0x22 -#define SCAN_H 0x23 -#define SCAN_J 0x24 -#define SCAN_K 0x25 -#define SCAN_L 0x26 -#define SCAN_SCOLON 0x27 -#define SCAN_QUOTA 0x28 -#define SCAN_RQUOTA 0x29 -#define SCAN_LSHIFT 0x2a -#define SCAN_BSLASH 0x2b -#define SCAN_Z 0x2c -#define SCAN_X 0x2d -#define SCAN_C 0x2e -#define SCAN_V 0x2f -#define SCAN_B 0x30 -#define SCAN_N 0x31 -#define SCAN_M 0x32 -#define SCAN_COMA 0x33 -#define SCAN_DOT 0x34 -#define SCAN_SLASH 0x35 -#define SCAN_RSHIFT 0x36 -#define SCAN_GREY_STAR 0x37 -#define SCAN_ALT 0x38 -#define SCAN_SPACE 0x39 -#define SCAN_CAPS 0x3a -#define SCAN_F1 0x3b -#define SCAN_F2 0x3c -#define SCAN_F3 0x3d -#define SCAN_F4 0x3e -#define SCAN_F5 0x3f -#define SCAN_F6 0x40 -#define SCAN_F7 0x41 -#define SCAN_F8 0x42 -#define SCAN_F9 0x43 -#define SCAN_F10 0x44 -#define SCAN_NUMLOCK 0x45 -#define SCAN_SCRLOCK 0x46 -#define SCAN_HOME 0x47 -#define SCAN_UP 0x48 -#define SCAN_PGUP 0x49 -#define SCAN_GREY_MINUS 0x4a -#define SCAN_LEFT 0x4b -#define SCAN_PAD_5 0x4c -#define SCAN_RIGHT 0x4d -#define SCAN_GREY_PLUS 0x4e -#define SCAN_END 0x4f -#define SCAN_DOWN 0x50 -#define SCAN_PGDN 0x51 -#define SCAN_INSERT 0x52 -#define SCAN_DEL 0x53 -#define SCAN_F11 0x57 -#define SCAN_F12 0x58 - -#endif // KEYBOARD_INC diff --git a/16/v2/source/verge/MAPED/MAKEFILE b/16/v2/source/verge/MAPED/MAKEFILE deleted file mode 100755 index d627200b..00000000 --- a/16/v2/source/verge/MAPED/MAKEFILE +++ /dev/null @@ -1,32 +0,0 @@ -# Use the C or C++ compiler -Compiler = wcc386 - -# compiler options -#comp = /oneatx /zp4 /5 /d0 -comp = /bt=dos /oneatx /5 /fp5 /wx /d0 - -Linker_options = option stack=60000 - -# Compile using dos4g or pmodew -#System = dos4g -System = pmodew - -Exe_file = maped.exe - -Objs = maped.obj config.obj gui.obj guicomp.obj mode13h.obj modex.obj keyboard.obj & - minimap.obj mouse.obj render.obj smalfont.obj ssaver.obj tileed.obj & - tilesel.obj timer.obj vdriver.obj columns.obj a_memory.obj mikmod.lib - -#################### - -maped.exe : $(Objs) - - *wlink system $(System) $(Linker_Options) name maped.exe & - file {$<} -# *pmwlite -c4 maped.exe - -.c.obj: - $(Compiler) $(comp) $< - -.asm.obj: - wasm -3pr $< diff --git a/16/v2/source/verge/MAPED/MAPED.C b/16/v2/source/verge/MAPED/MAPED.C deleted file mode 100755 index 9e172742..00000000 --- a/16/v2/source/verge/MAPED/MAPED.C +++ /dev/null @@ -1,1624 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -const char *const ME2_VERSION = "2.01a"; - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -// CHANGELOG: -// -// + erased valloc(), replaced with a_memory.c -// + added Log() -- output to MAPED.LOG -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -#include -#include - -#include -#include -#include -#include - -#include "config.h" -#include "gui.h" -#include "keyboard.h" -#include "mikmod.h" -#include "mouse.h" -#include "render.h" -#include "timer.h" -#include "vdriver.h" - -#include "ssaver.h" -#include "smalfont.h" -#include "tilesel.h" -#include "minimap.h" -#include "guicomp.h" -#include "config.h" - -#define byte unsigned char -#define word unsigned short - -// Includes for a_memory.c - -void *valloc(int amount, char *desc, int owner); -void *qvalloc(int amount); -int vfree(void *pointer); -void qvfree(void *pointer); -void FreeByOwner(int owner); -void MemReport(void); -void CheckCorruption(void); - -// ================================= Data ==================================== - -typedef struct -{ - unsigned short start; // strand start - unsigned short finish; // strand end - unsigned short delay; // tile-switch delay - unsigned short mode; // tile-animation mode -} vspanim_r; - -typedef struct -{ - char pmultx,pdivx; // parallax multiplier/divisor for X - char pmulty,pdivy; // parallax multiplier/divisor for Y - unsigned short sizex, sizey; // layer dimensions. - unsigned char trans, hline; // transparency flag | hline (raster fx) -} layer_r; - -typedef struct -{ - char name[40]; // zone name/desc - unsigned short script; // script to call thingy - unsigned short percent; // chance of executing - unsigned short delay; // step-delay - unsigned short aaa; // Accept Adjacent Activation - unsigned short entityscript; // script to call for entities -} zoneinfo; - -typedef struct -{ - char zonename[16]; // zone description - unsigned short int callevent; // event number to call - unsigned char percent; // chance (in 255) of event occurance - unsigned char delay; // step-delay before last occurance - unsigned char aaa; // accept adjacent activation - char savedesc[31]; // savegame description -} oldzone; - -typedef struct -{ - int x, y; // xwc, ywx position - word tx, ty; // xtc, ytc position - byte facing; // direction entity is facing - byte moving, movecnt; // direction entity is moving - byte frame; // bottom-line frame to display - byte specframe; // special-frame set thingo - byte chrindex, reset; // CHR index | Reset animation - byte obsmode1, obsmode2; // can be obstructed | Is an obstruction - byte speed, speedct; // entity speed, speedcount :) - byte delayct; // animation frame-delay - char *animofs, *moveofs; // anim script | move script - byte face, actm; // auto-face | activation mode - byte movecode, movescript; // movement type | movement script - byte ctr, mode; // sub-tile move ctr, mode flag (internal) - word step, delay; // step, delay - word stepctr, delayctr; // internal use counters - word data1, data2, data3; // - word data4, data5, data6; // - int actscript; // activation script - int expand1, expand2; // - int expand3, expand4; // - char desc[20]; // Entity description. -} entity_r; - -typedef struct -{ - char t[60]; -} chrlist_r; - -typedef struct -{ - char t[200]; -} movescript; - -typedef struct -{ - unsigned short x; // xwc position - unsigned short y; // ywc position - unsigned char facing; // direction entity is facing - unsigned char moving; // direction entity is moving - unsigned char movcnt; // how far left to move in this tile - unsigned char framectr; // frame sequence counter - unsigned char specframe; // special-frame set thingo - unsigned char chrindex, movecode; // CHR index / movement pattern code - unsigned char activmode, obsmode; // activation mode, obstruction mode - unsigned char v1,v2,v3; // packing stuff. - unsigned int actscript, movescript; // script references - unsigned char speed, speedct; // entity speed, speedcount :) - unsigned short step, delay, // Misc data entries - data1, data2, // More misc data - data3, data4, // yet more crappy misc data. - delayct,adjactv; // yet more internal crap - unsigned short x1,y1,x2,y2; // bounding box coordinates - unsigned char curcmd, cmdarg; // Script commands/arguments - unsigned char *scriptofs; // offset in script parsing - unsigned char face,chasing, // face player when activated | chasing - chasespeed, chasedist; // chasing variables - unsigned short cx,cy; // current-tile pos (moving adjusted) - int expand1; // always room for improvement - char entitydesc[20]; // Editing description -} oldent_r; - -zoneinfo zones[256]; // zone stuff. -layer_r layer[6]; // Array of layer data -vspanim_r vspanim[100]; // tile animation data -unsigned short vadelay[100]; // Tile animation delay ctr -oldzone tzone; // zone for oldmap-to-v2 converting -entity_r entity[256]; // Entity records. -oldent_r oldent; // entity for oldmap-to-v2 converting -byte entities=0; // number of allocated entities. -chrlist_r chrlist[100]; // Max. 100 CHRs per map. -movescript ms[100]; // move scripts arrays -byte nmchr=0; // number of active/loaded CHRs. -byte nms=0; // number of movement scripts - -char mapname[60]; // MAP filename -char vspname[60]; // VSP filemap -char rstring[20]; // render-order string -char musname[60]; // MAP default music -char numlayers; // number of layers in map -short xstart, ystart; // MAP start locations -char *obstruct, *zone; // obstruction and zone buffers -int numzones=0; // Number of active zones. -unsigned short *layers[6]; // Raw layer data -char wrap, soundokay=0; - -// -- vsp related data -- - -unsigned short numtiles; // number of allocated tiles in VSP -unsigned char *vsp; // VSP ptr -char vsp_locked=0; -char vsp_pw[8]; - -// -- map compression - -char *cb,*csrc; // compression workspace buffer -int bufsize; // how many bytes need to be written - -// -- editing related data -- - -int xwin=0, ywin=0; // Editing viewplane -short lt=0, rt=0; // left-button tile, right-button tile -char curzone=0; // current zone. -char scrollmode=0; // tile or pixel scroll modes. -char mouse_scroll=1; -char layertoggle[10]; // layer visible toggles -char el=0; // current editing layer. -char modified=0; // Current buffer modified or not. - -// -- music stuff -- - -char is_playing=0; -char cmname[60]; -UNIMOD *mf=0; - -// -- copy/paste & block fill -- - -word *copybuf=0; -int copybuf_wide=0,copybuf_deep=0; -int selx1=0, sely1=0, selx2=0, sely2=0; -int shifted=0, pasting=0; -extern char curtrack; - -char vcedprog[80]; -byte* translucency_table; //zero - -int moving_up=0,moving_down=0,moving_left=0,moving_right=0; // aen - -// ================================= Code ==================================== - -//added by zero -void LoadTransTable() -{ - FILE *fp; - - if (!translucency_table) - translucency_table=(byte *) valloc(65536,"trans tbl",0); - - fp=fopen("trans.tbl","rb"); - if (!fp) - { - vfree(translucency_table); - translucency_table=0; - return; - } - - fread(translucency_table, 65536, 1, fp); - fclose(fp); -} - -int Exist(char *fname) -{ FILE *tempf; - - tempf=fopen(fname,"rb"); - if (tempf) - { - fclose(tempf); - return 1; - } - else return 0; -} - -void err(char *str, ...) -{ - va_list argptr; - char msg[256]; - - va_start(argptr, str); - vsprintf(msg, str, argptr); - va_end(argptr); - - ShutdownVideo(); - ShutdownTimer(); - ShutdownKeyboard(); - //CD_DeInit(); // wasn't even valid! CD_Deinit() was incorrect - // Actually, Wat is by default case insensitive, so nyeh.;) - //if (curtrack != 1) //CD_Stop(); - - printf("%s \n",msg); - exit(-1); -} - -void errf(char *str, char *str1) -{ - sprintf(strbuf,str,str1); - err(strbuf); -} - -void errn(char *str, int n) -{ - sprintf(strbuf,str,n); - err(strbuf); -} - -int random(int lo, int hi) -{ - int range=hi-lo+1; - int i=rand() % range; - return i+lo; -} - -void PlayMusic(char *fname) -{ - if (!soundokay) return; - if (is_playing) - { - MD_PlayStop(); - ML_Free(mf); - is_playing=0; - } - mf=ML_LoadFN(fname); - if (!mf) - { - Message("Could not load specified music.",500); - return; - } - MP_Init(mf); - md_numchn=mf->numchn; mp_loop=1; - MD_PlayStart(); - is_playing=1; -} - -void StopMusic() -{ - if (!soundokay) return; - MD_PlayStop(); - ML_Free(mf); - is_playing=0; -} - -void LoadVSP(char *fname) -{ FILE *f; - short ver; - - if (!(f=fopen(fname,"rb"))) - errf("VSP file %s not found.",fname); - - fread(&ver, 1, 2, f); - if (ver!=2 && ver!=3) - errf("VSP file %s is not the correct VSP format.",fname); - if (ver==2) - { - fread(&pal, 1, 768, f); - set_intensity(63); - fread(&numtiles, 1, 2, f); - vsp=(char *) valloc(256*numtiles, "vsp data", 0); - fread(vsp, 256, numtiles, f); - fread(&vspanim, 8, 100, f); - fclose(f); - } - if (ver==3) - { - fread(&pal, 1, 768, f); - set_intensity(63); - fread(&numtiles, 1, 2, f); - vsp=(char *) valloc(256*numtiles, "vsp data", 0); - fread(&bufsize, 1, 4, f); - ReadCompressedLayer1(vsp, 256*numtiles, f); - fread(&vspanim, 8, 100, f); - fclose(f); - } -} - -void SaveVSP(char *fname) -{ FILE *f; - short ver; - - f=fopen(fname,"wb"); - ver=3; - fwrite(&ver, 1, 2, f); - fwrite(&pal, 1, 768, f); - fwrite(&numtiles, 1, 2, f); - cb=(char *) valloc(numtiles*256, "vsp tempbuf", 0); - bufsize=0; - WriteCompressedLayer1(vsp, numtiles*256); - fwrite(&bufsize, 1, 4, f); - fwrite(cb, 1, bufsize, f); - //free(bufsize); // what the hell??? @_@ - fwrite(&vspanim, 8, 100, f); - fclose(f); -} - -void EmitC (char c) -{ - *csrc=c; - csrc++; - bufsize++; -} - -void EmitW (short int w) -{ - char *ptr; - - ptr=(char *)&w; - *csrc=*ptr; - csrc++; - ptr++; - *csrc=*ptr; - csrc++; - bufsize+=2; -} - -void WriteCompressedLayer1(unsigned char *p, int len) -{ int i; - unsigned char byt,samect; - unsigned char repcode; - - csrc=cb; - i=0; bufsize=0; - do - { byt=p[i++]; - samect=1; - while (samect<254 && i3 || byt == 0xFF) - { - repcode=0xFF; - EmitC(repcode); - repcode=(char) samect; - EmitC(repcode); - } - EmitC(byt); - } while (i1) - { - repcode=(char) samect; - EmitC(repcode); - repcode=0xFF; - EmitC(repcode); - } - EmitW(byt); - } while (i> 1; - zone[(j*layer[0].sizex)+i]=c; - } - vfree(cb); - - // Load and convert zone data records. - - for (i=0; i<128; i++) - { - fread(&tzone, 1, sizeof tzone, f); - zones[i].script=tzone.callevent; - zones[i].percent=tzone.percent; - zones[i].delay=tzone.delay; - zones[i].aaa=tzone.aaa; - zones[i].entityscript=0; - memcpy(zones[i].name, tzone.zonename, 16); - } - - for (i=0; i<100; i++) // Load and convert CHR list - fread(&chrlist[i].t, 1, 13, f); -// DoCHRdealy(); - - fread(&entities, 1, 1, f); fseek(f, 3, 1); - memset(&entity, 0, sizeof entity); - for (i=0; i30000) - { - Message("Generating Auto-backup",150); - SaveMAP("$$BACKUP.MAP"); - SaveVSP("$$BACKUP.VSP"); - backupct=0; - } - if (idlect>8000 && !inss) - { - inss=1; - ScreenSaver(); - idlect=0; - inss=0; - } -} - -extern int difficulty; - -void SaveNewCFG() -{ FILE *f; - - f=fopen("maped.cfg","w"); - //if (nocdaudio) fprintf(f,"nocdaudio\n"); - fprintf(f,"vidmode %d \n", vm); - fprintf(f,"pad %d \n", pad); - fprintf(f,"scrollmode %d \n",scrollmode); - fprintf(f,"mouse_scroll %d \n",mouse_scroll&1); // aen - fprintf(f,"black %d \n",black); - fprintf(f,"white %d \n",brightw); - fprintf(f,"winbg %d \n",winbg); - fprintf(f,"shadow %d \n",darkw); - fprintf(f,"darkred %d \n",darkred); - fprintf(f,"titlebg %d \n",titlebg); - fprintf(f,"th %d \n", th); - fprintf(f,"mh %d \n", mh); - fprintf(f,"md_device %d \n", md_device==3?3:0); - fprintf(f,"amxofs %d \n",amxofs); - fprintf(f,"amyofs %d \n",amyofs); - fprintf(f,"mmxofs %d \n",mmxofs); - fprintf(f,"mmyofs %d \n",mmyofs); - fprintf(f,"cnxofs %d \n",cnxofs); - fprintf(f,"cnyofs %d \n",cnyofs); - fprintf(f,"lmxofs %d \n",lmxofs); - fprintf(f,"lmyofs %d \n",lmyofs); - fprintf(f,"lvxofs %d \n",lvxofs); - fprintf(f,"lvyofs %d \n",lvyofs); - fprintf(f,"mpxofs %d \n",mpxofs); - fprintf(f,"mpyofs %d \n",mpyofs); - fprintf(f,"vaxofs %d \n",vaxofs); - fprintf(f,"vayofs %d \n",vayofs); - fprintf(f,"zexofs %d \n",zexofs); - fprintf(f,"zeyofs %d \n",zeyofs); - fprintf(f,"exofs %d \n",exofs); - fprintf(f,"eyofs %d \n",eyofs); - fprintf(f,"prxofs %d \n",prxofs); - fprintf(f,"pryofs %d \n",pryofs); - fprintf(f,"rsxofs %d \n",rsxofs); - fprintf(f,"rsyofs %d \n",rsyofs); - fprintf(f,"vced %s \n",vcedprog); - fprintf(f,"difficulty %d \n",difficulty); - fclose(f); -} - -#include "controls.c" - -void ShellToDOS() -{ - ShutdownVideo(); - ShutdownKeyboard(); - ShutdownTimer(); - MD_PlayStop(); - MD_Exit(); - - system("COMMAND.COM"); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - InitVideo(vm); - set_intensity(63); - InitMouse(); - InitKeyboard(); - InitTimer(); -} - -void ShellVERGE() -{ - ShutdownVideo(); - ShutdownKeyboard(); - ShutdownTimer(); - MD_PlayStop(); - MD_Exit(); - - system("VERGE"); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - InitVideo(vm); - set_intensity(63); - InitMouse(); - InitKeyboard(); - InitTimer(); -} - -void ShellMAP() -{ - ShutdownVideo(); - ShutdownKeyboard(); - ShutdownTimer(); - MD_PlayStop(); - MD_Exit(); - - sprintf(strbuf,"verge %s",mapname); - system(strbuf); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - InitVideo(vm); - set_intensity(63); - InitMouse(); - InitKeyboard(); - InitTimer(); -} - -void ShellEditMAP() -{ - char fn[80],*p; - - key[SCAN_ALT]=0; - key[SCAN_V]=0; - ShutdownVideo(); - ShutdownKeyboard(); - ShutdownTimer(); - MD_PlayStop(); - MD_Exit(); - - sprintf(fn,"%s",mapname); - p=fn; - while (*p) - { - if (*p=='.') *p=0; - p++; - } - sprintf(strbuf,"%s %s.vc", vcedprog, fn); - system(strbuf); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - InitVideo(vm); - set_intensity(63); - InitMouse(); - InitKeyboard(); - InitTimer(); -} - -void ShellEditSystem() -{ - key[SCAN_ALT]=0; - key[SCAN_S]=0; - ShutdownVideo(); - ShutdownKeyboard(); - ShutdownTimer(); - MD_PlayStop(); - MD_Exit(); - - sprintf(strbuf,"%s system.vc", vcedprog); - system(strbuf); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - InitVideo(vm); - set_intensity(63); - InitMouse(); - InitKeyboard(); - InitTimer(); -} - -char s[256]; - -void CompileAll() -{ - FILE *f; - char *p; - - MD_PlayStop(); - MD_Exit(); - - sprintf(strbuf,"vcc all q",mapname); - system(strbuf); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - - if (!(f=fopen("error.txt","r"))) - { - Message("All VC scripts sucessfully compiled.",300); - return; - } - - fgets(s,99,f); - fclose(f); - p=s; - while (*p) - { - if (*p==13 || *p==10) *p=0; - p++; - } - VCNotify(s); -} - -void CompileMAP() -{ - FILE *f; - char *p; - - MD_PlayStop(); - MD_Exit(); - - sprintf(strbuf,"vcc %s q",mapname); - system(strbuf); - - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - if (strlen(musname)) PlayMusic(musname); - - if (!(f=fopen("error.txt","r"))) return; - - fgets(s,99,f); - fclose(f); - p=s; - while (*p) - { - if (*p==13 || *p==10) *p=0; - p++; - } - VCNotify(s); -} - -void tickhandler(void) -{ - MP_HandleTick(); - MD_SetBPM(mp_bpm); -} - -void RenderHighlight() -{ int zx, zy; - int xw, yw; - - if (mh) - { - xw=xwin&15; - yw=ywin&15; - zx=((mx+xw)&~15)-xw; - zy=((my+yw)&~15)-yw; - - DrawHighlight(zx-1, zy-1); - } -} - -int EntityThere(int xw, int yw) -{ int i; - - for (i=0; i - mb=0; - return; - } - EntityEditor(a-1); -} - -void DeleteEntity(int xw, int yw) -{ int i,a; - char t[60]; - - a=EntityThere(xw,yw)-1; - sprintf(t,"Delete entity %d?",a); - if (!Confirm(t)) return; - for (i=a; iname, 13); fc++; - while (!_dos_findnext(f)) - { - memcpy(blah+(fc*13), f->name, 13); fc++; - } - } - vfree(f); - last_pressed=0; - a=fc<22?117:2574/fc; -// errn("%d",fc); - do - { - if (!bmode) - { - RenderMap(); - RenderGUI(); - } - else - { - RenderSelector(); - RenderMessages(); - } - if (ctf && systemtime >= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - bxofs = (mx-mxo); - byofs = (my-myo); - if (!mb) moving=0; - if (bxofs<16) bxofs = 16; - if (byofs<16) byofs = 16; - if (bxofs+bxsize>335) bxofs = 336-bxsize; - if (byofs+bysize>sy+16) byofs = (sy+16)-bysize; - } - - Window(bxofs, byofs, bxofs+bxsize, byofs+bysize, "Browse"); - Button(bxofs+65, byofs+157, "OK"); - Button(bxofs+96, byofs+157, "Cancel"); - FilledBox(bxofs+20, byofs+15, 80, 135, black); - FilledBox(bxofs+100, byofs+15, 10, 135, 2); - HLine(bxofs+20, byofs+15, 90, darkw); - VLine(bxofs+20, byofs+15, 135, darkw); - VLine(bxofs+99, byofs+16, 134, white); - VLine(bxofs+109, byofs+16, 134, white); - HLine(bxofs+21, byofs+149, 89, white); - stdwindow(bxofs+100, byofs+16, bxofs+109, byofs+25); - stdwindow(bxofs+100, byofs+140, bxofs+109, byofs+149); - b=byofs+24+(fc != 22 ? ((117-a)*ofs)/(fc-22) : 0); - - //draws the drag box - stdwindow(bxofs+100, b, bxofs+109, b+a); - - FilledBox(bxofs+21, byofs+((cfs-ofs)*6)+16, 78, 6, darkw); - - // Render actual filename thingies - i=0; - while (1) - { - if (i+ofsbxofs+100&&mxbyofs+25&&myb&&myb+a) - { - if (ofs+45>fc) ofs=fc-22; - else ofs+=22; - cfs=ofs; - } - } - } - if(!dragging) - { - if (mb==1 && mx>bxofs+20 && mxbyofs+15 && mybxofs+100 && mxbyofs+15 && mybxofs+100 && mxbyofs+139 && mybxofs+65 && mxbyofs+157 && mybxofs+96 && mxbyofs+157 && my(bxofs+bxsize-9) && (mx(byofs+1) && (mybxofs && mxbyofs && my<(byofs+9) && !moving) - { - moving=1; - mxo=mx-bxofs; - myo=my-byofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - if (key[SCAN_PGUP]) - { - if (ofs<22) ofs=0; - else ofs-=22; - cfs=ofs; - key[SCAN_PGUP]=0; - continue; - } - if (key[SCAN_PGDN]) - { - if (ofs+45>fc) ofs=fc-22; - else ofs+=22; - if (fc<22) ofs=0; - cfs=ofs; - key[SCAN_PGDN]=0; - continue; - } - if (key[SCAN_UP]) - { - if (cfs) cfs--; - if (ofs>cfs) ofs--; - key[SCAN_UP]=0; - last_pressed=0; - continue; - } - if (key[SCAN_DOWN]) - { - if (cfs21) ofs++; - key[SCAN_DOWN]=0; - last_pressed=0; - continue; - } - if (last_pressed==SCAN_ENTER) - { - memcpy(dest,blah+(cfs*13),13); - key[SCAN_ENTER]=0; - done=1; - ctf=0; - str=0; - last_pressed=0; - break; - } - - if (last_pressed==SCAN_TAB) - { - switch (ctf) - { - case 0: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } - } while (!done); - vfree(blah); -} - -#include "vergepal.h" -#define LOGFILE "maped.log" - -void Log(char *text, ...) -{ - va_list argptr; - char msg[256]; - FILE *logf; - - va_start(argptr, text); - vsprintf(msg, text, argptr); - va_end(argptr); - - logf=fopen(LOGFILE,"aw"); - fprintf(logf,"%s\n",msg); - fflush(logf); - fclose(logf); -} - -int main(int argc, char *argv[]) -{ - - remove(LOGFILE); - md_mixfreq=44100; - md_dmabufsize=5000; - md_mode=DMODE_16BITS|DMODE_STEREO; - md_device=0; - memset(&chrs, 0, sizeof chrs); - - Log("GetConfig"); - GetConfig("maped.cfg"); - Log("LoadTransTbl"); - translucency_table=0; //zero - LoadTransTable(); //zero - - Log("RegisterModLoaders"); - ML_RegisterLoader(&load_mod); - ML_RegisterLoader(&load_s3m); - ML_RegisterLoader(&load_xm); - ML_RegisterLoader(&load_uni); - - Log("RegisterSndDrivers"); - MD_RegisterDriver(&drv_nos); - MD_RegisterDriver(&drv_sb); - MD_RegisterDriver(&drv_gus); - MD_RegisterPlayer(tickhandler); - soundokay=1; - Log("Initialize snd lib"); - if (!MD_Init()) - { - printf("Couldn't initialize sound: %s.\n", myerr); - delay(500); - soundokay=0; - } - - //Log("Initialize CD audio"); - //CD_Init(); - - Log("Initialize timer"); - InitTimer(); - Log("Initialize video"); - InitVideo(vm); - Log("Initialize mouse"); - InitMouse(); - Log("Initialize keyboard IRQ handler"); - InitKeyboard(); - - Log("Initializing map data"); - if (argc==1 && !Exist("untitled.map")) - { - SetPalette(vergepal); - memcpy(pal, vergepal, 768); - memcpy(mapname,"UNTITLED.MAP",13); - memcpy(vspname,"UNTITLED.VSP",13); - memcpy(rstring,"1E",2); - numlayers=1; - - // aen: default newmap dimensions set to 100x100 - layer[0].pmultx=1; layer[0].pmulty=1; - layer[0].pdivx=1; layer[0].pdivy=1; - layer[0].sizex=100; layer[0].sizey=100; - layer[0].trans=0; layer[0].hline=0; - - layers[0]=(unsigned short *) valloc((layer[0].sizex*layer[0].sizey*2)+4,"layer data",0); - //memset(layers[0],0,(layer[0].sizex*layer[0].sizey)*2); - obstruct=(char *) valloc((layer[0].sizex*layer[0].sizey)+4,"obstruct map",0); - zone=(char *) valloc((layer[0].sizex*layer[0].sizey)+4,"zone map", 0); - - // aen: default number of tiles set to 100 - numtiles=100; - vsp=(char *) valloc(256 * numtiles,"vsp data", 0); - wrap=0; el=0; layertoggle[0]=1; - InitTileIDX(); - } - else - { - if (argc==1) memcpy(mapname, "untitled.map",13); - else memcpy(mapname, argv[1], strlen(argv[1])); - LoadMAP(mapname); - InitTileIDX(); - } -Log("Entering main loop"); -thingy: - while (!(key[SCAN_ALT] && key[SCAN_X])) - { - ProcessControls(); - while (tick) - { - tick--; - PollMovement(); - } - RenderMap(); - RenderHighlight(); - RenderGUI(); - ShowPage(); - } - if (modified) - if (!Confirm("Lose unsaved changes?")) - { - key[SCAN_ALT]=0; - key[SCAN_X]=0; - goto thingy; - } - - ShutdownVideo(); - ShutdownKeyboard(); - ShutdownTimer(); - SaveNewCFG(); - remove("$$BACKUP.MAP"); - remove("$$BACKUP.VSP"); - - //if (curtrack != 1) CD_Stop(); - //CD_DeInit(); // wasn't even valid! CD_Deinit() was incorrect - MD_PlayStop(); // Mordred - ML_Free(mf); - - MD_Exit(); - if (translucency_table) - vfree(translucency_table); //zero - return 0; -} diff --git a/16/v2/source/verge/MAPED/MAPED.H b/16/v2/source/verge/MAPED/MAPED.H deleted file mode 100755 index 431bcd27..00000000 --- a/16/v2/source/verge/MAPED/MAPED.H +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef MAPED_INC -#define MAPED_INC - -extern const char *const ME2_VERSION; - -#include - -#define byte unsigned char -#define word unsigned short - -typedef struct -{ - unsigned short start; // strand start - unsigned short finish; // strand end - unsigned short delay; // tile-switch delay - unsigned short mode; // tile-animation mode -} vspanim_r; - -typedef struct -{ - char pmultx,pdivx; // parallax multiplier/divisor for X - char pmulty,pdivy; // parallax multiplier/divisor for Y - unsigned short sizex, sizey; // layer dimensions. - unsigned char trans, hline; // transparency flag | hline (raster fx) -} layer_r; - -typedef struct -{ - char name[40]; // zone name/desc - unsigned short script; // script to call thingy - unsigned short percent; // chance of executing - unsigned short delay; // step-delay - unsigned short aaa; // Accept Adjacent Activation - unsigned short entityscript; // script to call for entities -} zoneinfo; - -typedef struct -{ - int x, y; // xwc, ywx position - word tx, ty; // xtc, ytc position - byte facing; // direction entity is facing - byte moving, movecnt; // direction entity is moving - byte frame; // bottom-line frame to display - byte specframe; // special-frame set thingo - byte chrindex, reset; // CHR index | Reset animation - byte obsmode1, obsmode2; // can be obstructed | Is an obstruction - byte speed, speedct; // entity speed, speedcount :) - byte delayct; // animation frame-delay - char *animofs, *moveofs; // anim script | move script - byte face, actm; // auto-face | activation mode - byte movecode, movescript; // movement type | movement script - byte ctr, mode; // sub-tile move ctr, mode flag (internal) - word step, delay; // step, delay - word stepctr, delayctr; // internal use counters - word data1, data2, data3; // - word data4, data5, data6; // - int actscript; // activation script - int expand1, expand2; // - int expand3, expand4; // - char desc[20]; // Entity description. -} entity_r; - -typedef struct -{ - char t[60]; -} chrlist_r; - -typedef struct { - char t[200]; -} movescript; - -extern layer_r layer[4]; -extern vspanim_r vspanim[100]; -extern zoneinfo zones[256]; -extern unsigned short vadelay[100]; -extern entity_r entity[256]; // Entity records. -extern byte entities; // number of allocated entities. -extern chrlist_r chrlist[100]; -extern byte nmchr; -extern movescript ms[100]; // move scripts arrays -extern byte nms; // number of movement scripts - -extern char *obstruct, *zone, curzone; -extern char numlayers, wrap; -extern unsigned short *layers[6]; -extern char rstring[20]; -extern char mapname[60], vspname[60]; -extern char musname[60]; -extern short xstart, ystart; - -// -- vsp related data -- - -extern unsigned short numtiles; -extern unsigned char *vsp; - -// -- editing related data -- - -extern int xwin, ywin, bmode; -extern char mouse_scroll; -extern short lt, rt; -extern char layertoggle[10], el, modified; - -extern word *copybuf; -extern int copybuf_wide,copybuf_deep; -extern int selx1, sely1, selx2, sely2; -extern int shifted, pasting; - -extern int numzones; // Number of active zones. - -extern int moving_up,moving_down,moving_left,moving_right; - -extern void LoadTransTable(); -extern int Exist(char *fname); -extern void err(char *str, ...); -extern void errf(char *str, char *str1); -extern void errn(char *str, int n); -extern int random(int min, int max); -extern void PlayMusic(char *fname); -extern void StopMusic(); -extern void LoadVSP(char *fname); -extern void SaveVSP(char *fname); -extern void EmitC (char c); -extern void EmitW (short int w); -extern void WriteCompressedLayer1(unsigned char *p, int len); -extern void ReadCompressedLayer1(unsigned char *dest, int len, FILE *f); -extern void WriteCompressedLayer2(unsigned short *p,int len); -extern void ReadCompressedLayer2(unsigned short *dest, int len, FILE *f); -extern void CountUsedZones(); -extern void CountMoveScripts(); -extern void CountCHRs(); -extern void SaveMAP(char *fname); -extern void LoadOldMAP(FILE *f); -extern void LoadMAP(char *fname); -extern void InitTileIDX(); -extern void CheckTimerStuff(); -extern void SaveNewCFG(); -extern void ShellToDOS(); -extern void ShellVERGE(); -extern void ShellMAP(); -extern void ShellEditMAP(); -extern void ShellEditSystem(); -extern void CompileAll(); -extern void CompileMAP(); -extern void tickhandler(void); -extern void RenderHighlight(); -extern int EntityThere(int xw, int yw); -extern void AllocateEntity(int xw, int yw); -extern void ProcessEntity(int xw, int yw); -extern void DeleteEntity(int xw, int yw); -extern void Browse(char n, char *m1, char *m2, char *m3, char *m4, char *dest); - -// Includes for a_memory.c - -void *valloc(int amount, char *desc, int owner); -void *qvalloc(int amount); -int vfree(void *pointer); -void qvfree(void *pointer); -void FreeByOwner(int owner); -void MemReport(void); -void CheckCorruption(void); - -#define free ERROR_YEAH_REPLACE_THIS_WITH_VFREE - -#endif // MAPED_INC diff --git a/16/v2/source/verge/MAPED/MIKMOD.C b/16/v2/source/verge/MAPED/MIKMOD.C deleted file mode 100755 index 2ab62d2a..00000000 --- a/16/v2/source/verge/MAPED/MIKMOD.C +++ /dev/null @@ -1,311 +0,0 @@ -/* - -Name: -MIKMOD.C - -Description: -Modplaying example of mikmod. - -MSDOS: BC(y) Watcom(y) DJGPP(y) -Win95: BC(y*) -Os2: y -Linux: n - -* console mode only -(y) - yes -(n) - no (not possible or not useful) -(?) - may be possible, but not tested - -*/ -#ifdef __WIN32__ -#include -#endif - -#include -#include -#include -#include - -#ifndef __OS2__ -#include -#endif - -#include "wildfile.h" -#include "mikmod.h" - -char helptext[]= - -"Available switches (CaSe SeNsItIvE!):\n" -"\n" -" /d x use device-driver #x for output (0 is autodetect). Default=0\n" -" /ld List all available device-drivers\n" -" /ll List all available loaders\n" -" /x disables protracker extended speed\n" -" /p disables panning effects (9fingers.mod)\n" -" /v xx Sets volume from 0 (silence) to 100. Default=100\n" -" /f xxxx Sets mixing frequency. Default=44100\n" -" /m Force mono output (so sb-pro can mix at 44100)\n" -" /8 Force 8 bit output\n" -" /i Use interpolated mixing\n" -" /r Restart a module when it's done playing"; - - -/* - declarations for boring old sys-v style getopt *yawn*: -*/ -int getopt(int argc, char *argv[], char *optionS); -extern char *optarg; -extern int optind; -extern int opterr; - - -void tickhandler(void) -{ - MP_HandleTick(); /* play 1 tick of the module */ - MD_SetBPM(mp_bpm); -} - - -int main(int argc,char *argv[]) -{ - UNIMOD *mf; - int cmderr=0; /* error in commandline flag */ - int morehelp=0; /* set if user wants more help */ - int quit; - int t; - static int nargc; - static char **nargv; - - puts(mikbanner); - - /* Expand wildcards on commandline */ - - nargc=argc; nargv=argv; -#ifndef __DJGPP__ - MyGlob(&nargc,&nargv,0); -#else - setvbuf(stdout, NULL, _IONBF, 0); - __djgpp_set_ctrl_c(0); -#endif - - /* - Initialize soundcard parameters.. you _have_ to do this - before calling MD_Init(), and it's illegal to change them - after you've called MD_Init() - */ - - md_mixfreq =44100; /* standard mixing freq */ - md_dmabufsize =20000; /* standard dma buf size */ - md_mode =DMODE_16BITS|DMODE_STEREO; /* standard mixing mode */ - md_device =0; /* standard device: autodetect */ - - /* - Register the loaders we want to use.. - */ - - ML_RegisterLoader(&load_m15); /* if you use m15load, register it as first! */ - ML_RegisterLoader(&load_mod); - ML_RegisterLoader(&load_mtm); - ML_RegisterLoader(&load_s3m); - ML_RegisterLoader(&load_stm); - ML_RegisterLoader(&load_ult); - ML_RegisterLoader(&load_uni); - ML_RegisterLoader(&load_xm); - - /* - Register the drivers we want to use: - */ - - MD_RegisterDriver(&drv_nos); -#ifdef __OS2__ - MD_RegisterDriver(&drv_os2); -#elif defined(__WIN32__) - MD_RegisterDriver(&drv_w95); -#else - MD_RegisterDriver(&drv_ss); - MD_RegisterDriver(&drv_sb); - MD_RegisterDriver(&drv_gus); -#endif - - MD_RegisterPlayer(tickhandler); - - /* Parse option switches using standard getopt function: */ - - opterr=0; - - while( !cmderr && - (t=getopt(nargc,nargv,"ohxpm8irv:f:l:d:")) != EOF ){ - - switch(t){ - - case 'd': - md_device=atoi(optarg); - break; - - case 'l': - if(optarg[0]=='d') MD_InfoDriver(); - else if(optarg[0]=='l') ML_InfoLoader(); - else{ - cmderr=1; - break; - } - exit(0); - - case 'r': - mp_loop=1; - break; - - case 'm': - md_mode&=~DMODE_STEREO; - break; - - case '8': - md_mode&=~DMODE_16BITS; - break; - - case 'i': - md_mode|=DMODE_INTERP; - break; - - case 'x': - mp_extspd=0; - break; - - case 'p': - mp_panning=0; - break; - - case 'v': - if((mp_volume=atoi(optarg))>100) mp_volume=100; - break; - - case 'f': - md_mixfreq=atol(optarg); - break; - - case 'h': - morehelp=1; - cmderr=1; - break; - - case '?': - puts("\07Invalid switch or option needs an argument\n"); - cmderr=1; - break; - } - } - - if(cmderr || optind>=nargc){ - - /* - there was an error in the commandline, or there were no true - arguments, so display a usage message - */ - - puts("Usage: MIKMOD [switches] ... \n"); - - if(morehelp) - puts(helptext); - else - puts("Type MIKMOD /h for more help."); - - exit(-1); - } - - /* initialize soundcard */ - - if(!MD_Init()){ - printf("Driver error: %s.\n",myerr); - return 0; - } - - printf("Using %s for %d bit %s %s sound at %u Hz\n\n", - md_driver->Name, - (md_mode&DMODE_16BITS) ? 16:8, - (md_mode&DMODE_INTERP) ? "interpolated":"normal", - (md_mode&DMODE_STEREO) ? "stereo":"mono", - md_mixfreq); - -#ifdef __OS2__ - DosSetPriority( PRTYS_THREAD, PRTYC_TIMECRITICAL, 5L, 0UL ); -#endif - - for(quit=0; !quit && optind exit with errormsg. */ - - if(mf==NULL){ - printf("MikMod Error: %s\n",myerr); - break; - } - - /* initialize modplayer to play this module */ - - MP_Init(mf); - - printf( "Songname: %s\n" - "Modtype : %s\n" - "Periods : %s,%s\n", - mf->songname, - mf->modtype, - (mf->flags&UF_XMPERIODS) ? "XM type" : "mod type", - (mf->flags&UF_LINEAR) ? "Linear" : "Log"); - - /* - set the number of voices to use.. you - could add extra channels here (e.g. md_numchn=mf->numchn+4; ) - to use for your own soundeffects: - */ - - md_numchn=mf->numchn; - - /* start playing the module: */ - - MD_PlayStart(); - - while(!MP_Ready()){ - - char c; - - c=kbhit() ? getch() : 0; - - if(c=='+') - MP_NextPosition(); - else if(c=='-') - MP_PrevPosition(); - else if(c==0x1b){ - quit=1; - break; - } - else if(c==' ') break; - - MD_Update(); - - /* wait a bit */ - -#if defined(__OS2__) - DosSleep(40); /* hmmmm */ -#elif defined(__WIN32__) - Sleep(10); -#elif defined(__DJGPP__) - /* no wait for djgpp ? */ -#else - delay(10); -#endif - printf("\rsngpos:%d patpos:%d sngspd %d bpm %d ",mp_sngpos,mp_patpos,mp_sngspd,mp_bpm); - } - - MD_PlayStop(); /* stop playing */ - ML_Free(mf); /* and free the module */ - puts("\n"); - } - - MD_Exit(); - return 0; -} diff --git a/16/v2/source/verge/MAPED/MIKMOD.H b/16/v2/source/verge/MAPED/MIKMOD.H deleted file mode 100755 index 0111ccb3..00000000 --- a/16/v2/source/verge/MAPED/MIKMOD.H +++ /dev/null @@ -1,580 +0,0 @@ -#ifndef MIKMOD_H -#define MIKMOD_H - -#include -#include "mtypes.h" /* include atomic mikmod types */ - - -#define mikbanner \ -"=======================================================================\n" \ -"MIKMOD v2.10 - Portable version - Programmed by MikMak of HaRDCoDE '95\n" \ -"=======================================================================\n" \ -"This program is SHAREWARE - Read MIKMOD.TXT for more info\n" \ -"E-Mail : mikmak@stack.urc.tue.nl\n" - - -/* - error variables: - =============== -*/ - -extern char *ERROR_ALLOC_STRUCT; -extern char *ERROR_LOADING_PATTERN; -extern char *ERROR_LOADING_TRACK; -extern char *ERROR_LOADING_HEADER; -extern char *ERROR_NOT_A_MODULE; -extern char *ERROR_LOADING_SAMPLEINFO; -extern char *ERROR_OUT_OF_HANDLES; -extern char *ERROR_SAMPLE_TOO_BIG; -extern char *myerr; - - - -#define _mm_rewind(x) _mm_fseek(x,0,SEEK_SET) -int _mm_fseek(FILE *stream,long offset,int whence); -void _mm_setiobase(long iobase); -long _mm_ftell(FILE *stream); - - -extern SBYTE _mm_read_SBYTE (FILE *fp); -extern UBYTE _mm_read_UBYTE (FILE *fp); - -extern SWORD _mm_read_M_SWORD (FILE *fp); -extern SWORD _mm_read_I_SWORD (FILE *fp); - -extern UWORD _mm_read_M_UWORD(FILE *fp); -extern UWORD _mm_read_I_UWORD(FILE *fp); - -extern SLONG _mm_read_M_SLONG (FILE *fp); -extern SLONG _mm_read_I_SLONG (FILE *fp); - -extern ULONG _mm_read_M_ULONG(FILE *fp); -extern ULONG _mm_read_I_ULONG(FILE *fp); - -extern int _mm_read_str(char *str, int size, FILE *fp); - -extern int _mm_read_SBYTES (SBYTE *buffer, int number, FILE *fp); -extern int _mm_read_UBYTES (UBYTE *buffer, int number, FILE *fp); - -extern int _mm_read_M_SWORDS (SWORD *buffer, int number, FILE *fp); -extern int _mm_read_I_SWORDS (SWORD *buffer, int number, FILE *fp); - -extern int _mm_read_M_UWORDS (UWORD *buffer, int number, FILE *fp); -extern int _mm_read_I_UWORDS (UWORD *buffer, int number, FILE *fp); - -extern int _mm_read_M_SLONGS (SLONG *buffer, int number, FILE *fp); -extern int _mm_read_I_SLONGS (SLONG *buffer, int number, FILE *fp); - -extern int _mm_read_M_ULONGS (ULONG *buffer, int number, FILE *fp); -extern int _mm_read_I_ULONGS (ULONG *buffer, int number, FILE *fp); - - -extern void _mm_write_SBYTE (SBYTE data,FILE *fp); -extern void _mm_write_UBYTE (UBYTE data,FILE *fp); - -extern void _mm_write_M_SWORD (SWORD data,FILE *fp); -extern void _mm_write_I_SWORD (SWORD data,FILE *fp); - -extern void _mm_write_M_UWORD (UWORD data,FILE *fp); -extern void _mm_write_I_UWORD (UWORD data,FILE *fp); - -extern void _mm_write_M_SLONG (SLONG data,FILE *fp); -extern void _mm_write_I_SLONG (SLONG data,FILE *fp); - -extern void _mm_write_M_ULONG (ULONG data,FILE *fp); -extern void _mm_write_I_ULONG (ULONG data,FILE *fp); - -extern void _mm_write_SBYTES (SBYTE *data, int number,FILE *fp); -extern void _mm_write_UBYTES (UBYTE *data, int number,FILE *fp); - -extern void _mm_write_M_SWORDS (SWORD *data, int number,FILE *fp); -extern void _mm_write_I_SWORDS (SWORD *data, int number,FILE *fp); - -extern void _mm_write_M_UWORDS (UWORD *data, int number,FILE *fp); -extern void _mm_write_I_UWORDS (UWORD *data, int number,FILE *fp); - -extern void _mm_write_M_SLONGS (SLONG *data, int number,FILE *fp); -extern void _mm_write_I_SLONGS (SLONG *data, int number,FILE *fp); - -extern void _mm_write_M_ULONGS (ULONG *data, int number,FILE *fp); -extern void _mm_write_I_ULONGS (ULONG *data, int number,FILE *fp); - - -/************************************************************************** -****** Unitrack stuff: **************************************************** -**************************************************************************/ - -/* - prototypes: -*/ - -void UniSetRow(UBYTE *t); -UBYTE UniGetByte(void); -UBYTE *UniFindRow(UBYTE *t,UWORD row); -void UniReset(void); -void UniWrite(UBYTE data); -void UniNewline(void); -void UniInstrument(UBYTE ins); -void UniNote(UBYTE note); -void UniPTEffect(UBYTE eff,UBYTE dat); -UBYTE *UniDup(void); -void UniSkipOpcode(UBYTE op); -BOOL UniInit(void); -void UniCleanup(void); -UWORD TrkLen(UBYTE *t); -BOOL MyCmp(UBYTE *a,UBYTE *b,UWORD l); - -/* - all known effects: -*/ - -enum { - UNI_NOTE=1, - UNI_INSTRUMENT, - UNI_PTEFFECT0, - UNI_PTEFFECT1, - UNI_PTEFFECT2, - UNI_PTEFFECT3, - UNI_PTEFFECT4, - UNI_PTEFFECT5, - UNI_PTEFFECT6, - UNI_PTEFFECT7, - UNI_PTEFFECT8, - UNI_PTEFFECT9, - UNI_PTEFFECTA, - UNI_PTEFFECTB, - UNI_PTEFFECTC, - UNI_PTEFFECTD, - UNI_PTEFFECTE, - UNI_PTEFFECTF, - UNI_S3MEFFECTA, - UNI_S3MEFFECTD, - UNI_S3MEFFECTE, - UNI_S3MEFFECTF, - UNI_S3MEFFECTI, - UNI_S3MEFFECTQ, - UNI_S3MEFFECTT, - UNI_XMEFFECTA, - UNI_XMEFFECTG, - UNI_XMEFFECTH, - UNI_XMEFFECTP -}; - - -/************************************************************************** -****** mikmod types: ****************************************************** -**************************************************************************/ - - -/* - Sample format flags: -*/ - -#define SF_16BITS 1 -#define SF_SIGNED 2 -#define SF_DELTA 4 -#define SF_BIG_ENDIAN 8 -#define SF_LOOP 16 -#define SF_BIDI 32 -#define SF_OWNPAN 64 -#define SF_REVERSE 128 - - -/* - Envelope flags: -*/ - -#define EF_ON 1 -#define EF_SUSTAIN 2 -#define EF_LOOP 4 - - -/* - Unimod flags -*/ - -#define UF_XMPERIODS 1 /* if set use XM periods/finetuning */ -#define UF_LINEAR 2 /* if set use LINEAR periods */ - - -typedef struct ENVPT{ - SWORD pos; - SWORD val; -} ENVPT; - - -typedef struct SAMPLE{ - UWORD c2spd; /* finetune frequency */ - SBYTE transpose; /* transpose value */ - UBYTE volume; /* volume 0-64 */ - UBYTE panning; /* panning */ - ULONG length; /* length of sample (in samples!) */ - ULONG loopstart; /* repeat position (relative to start, in samples) */ - ULONG loopend; /* repeat end */ - UWORD flags; /* sample format */ - ULONG seekpos; /* seek position in file */ - char *samplename; /* name of the sample */ - SWORD handle; /* sample handle */ -} SAMPLE; - - -typedef struct INSTRUMENT{ - UBYTE numsmp; - UBYTE samplenumber[96]; - - UBYTE volflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE volpts; - UBYTE volsus; - UBYTE volbeg; - UBYTE volend; - ENVPT volenv[12]; - - UBYTE panflg; /* bit 0: on 1: sustain 2: loop */ - UBYTE panpts; - UBYTE pansus; - UBYTE panbeg; - UBYTE panend; - ENVPT panenv[12]; - - UBYTE vibtype; - UBYTE vibsweep; - UBYTE vibdepth; - UBYTE vibrate; - - UWORD volfade; - char *insname; - SAMPLE *samples; -} INSTRUMENT; - - -/* - MikMod UNImod types: - ==================== -*/ - -typedef struct UNIMOD{ - UBYTE numchn; /* number of channels */ - UWORD numpos; /* number of positions in this song */ - UWORD reppos; /* restart position */ - UWORD numpat; /* number of patterns in this song */ - UWORD numtrk; /* number of tracks */ - UWORD numins; /* number of samples */ - UBYTE initspeed; /* */ - UBYTE inittempo; /* */ - UBYTE positions[256]; /* all positions */ - UBYTE panning[32]; /* 32 panning positions */ - UBYTE flags; /* */ - char *songname; /* name of the song */ - char *modtype; /* string type of module */ - char *comment; /* module comments */ - INSTRUMENT *instruments; /* all samples */ - UWORD *patterns; /* array of PATTERN */ - UWORD *pattrows; /* array of number of rows for each pattern */ - UBYTE **tracks; /* array of pointers to tracks */ -} UNIMOD; - - -/************************************************************************** -****** Loader stuff: ****************************************************** -**************************************************************************/ - -/* - loader structure: -*/ - -typedef struct LOADER{ - struct LOADER *next; - char *type; - char *version; - BOOL (*Init)(void); - BOOL (*Test)(void); - BOOL (*Load)(void); - void (*Cleanup)(void); -} LOADER; - - -/* - public loader variables: -*/ - -extern UNIMOD of; -extern FILE *modfp; -extern UWORD finetune[16]; - - -/* - main loader prototypes: -*/ - -void ML_InfoLoader(void); -void ML_RegisterLoader(LOADER *ldr); -UNIMOD *ML_LoadFP(FILE *fp); -UNIMOD *ML_LoadFN(char *filename); -void ML_Free(UNIMOD *mf); - - -/* - other loader prototypes: (used by the loader modules) -*/ - -BOOL InitTracks(void); -void AddTrack(UBYTE *tr); -BOOL ReadComment(UWORD len); -BOOL AllocPatterns(void); -BOOL AllocTracks(void); -BOOL AllocInstruments(void); -BOOL AllocSamples(INSTRUMENT *i); -char *DupStr(char *s,UWORD len); -void *MyMalloc(size_t size); -void *MyCalloc(size_t nitems,size_t size); - - -/* - Declare external loaders: -*/ -extern LOADER load_uni; -extern LOADER load_mod; -extern LOADER load_m15; -extern LOADER load_mtm; -extern LOADER load_s3m; -extern LOADER load_stm; -extern LOADER load_ult; -extern LOADER load_xm; - - -/************************************************************************** -****** Wavload stuff: ***************************************************** -**************************************************************************/ - -SAMPLE *MW_LoadWavFP(FILE *fp); -SAMPLE *MW_LoadWavFN(char *filename); -void MW_FreeWav(SAMPLE *si); - - -/************************************************************************** -****** Driver stuff: ****************************************************** -**************************************************************************/ - -/* - max. number of handles a driver has to provide. (not strict) -*/ - -#define MAXSAMPLEHANDLES 128 - - -/* - possible mixing mode bits: -*/ - -#define DMODE_STEREO 1 -#define DMODE_16BITS 2 -#define DMODE_INTERP 4 - - -/* - driver structure: -*/ - -typedef struct DRIVER{ - struct DRIVER *next; - char *Name; - char *Version; - BOOL (*IsPresent) (void); - SWORD (*SampleLoad) (FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags); - void (*SampleUnLoad) (SWORD handle); - BOOL (*Init) (void); - void (*Exit) (void); - void (*PlayStart) (void); - void (*PlayStop) (void); - void (*Update) (void); - void (*VoiceSetVolume) (UBYTE voice,UBYTE vol); - void (*VoiceSetFrequency) (UBYTE voice,ULONG frq); - void (*VoiceSetPanning) (UBYTE voice,UBYTE pan); - void (*VoicePlay) (UBYTE voice,SWORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -} DRIVER; - - -/* - public driver variables: -*/ - -extern DRIVER *md_driver; -extern UWORD md_device; -extern UWORD md_mixfreq; -extern UWORD md_dmabufsize; -extern UWORD md_mode; -extern UBYTE md_numchn; -extern UBYTE md_bpm; -extern void (*md_player)(void); - -/* - main driver prototypes: -*/ - -void MD_InfoDriver(void); -void MD_RegisterDriver(DRIVER *drv); -void MD_RegisterPlayer(void (*plr)(void)); -SWORD MD_SampleLoad(FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -void MD_SampleUnLoad(SWORD handle); -BOOL MD_Init(void); -void MD_Exit(void); -void MD_PlayStart(void); -void MD_PlayStop(void); -void MD_SetBPM(UBYTE bpm); -void MD_Update(void); -void MD_VoiceSetVolume(UBYTE voice,UBYTE ivol); -void MD_VoiceSetFrequency(UBYTE voice,ULONG frq); -void MD_VoiceSetPanning(UBYTE voice,ULONG pan); -void MD_VoicePlay(UBYTE voice,SWORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -void SL_Init(FILE *fp,UWORD infmt,UWORD outfmt); -void SL_Load(void *buffer,ULONG length); - -/* - Declare external drivers: -*/ - -extern DRIVER drv_gus; /* gravis ultrasound driver */ -extern DRIVER drv_sb; /* soundblaster DSP driver */ -extern DRIVER drv_ss; /* ensoniq soundscape driver */ -extern DRIVER drv_nos; /* nosound driver */ -extern DRIVER drv_raw; /* file output driver */ -extern DRIVER drv_w95; /* win95 driver */ -extern DRIVER drv_awe; /* experimental SB-AWE driver */ -extern DRIVER drv_vox; /* linux voxware driver */ -extern DRIVER drv_af; /* Dec Alpha AudioFile driver */ -extern DRIVER drv_sun; /* Sun driver */ -extern DRIVER drv_os2; /* Os2 driver */ -extern DRIVER drv_tim; /* timing driver */ - -/************************************************************************** -****** Player stuff: ****************************************************** -**************************************************************************/ - - -typedef struct ENVPR{ - UBYTE flg; /* envelope flag */ - UBYTE pts; /* number of envelope points */ - UBYTE sus; /* envelope sustain index */ - UBYTE beg; /* envelope loop begin */ - UBYTE end; /* envelope loop end */ - SWORD p; /* current envelope counter */ - UWORD a; /* envelope index a */ - UWORD b; /* envelope index b */ - ENVPT *env; /* envelope points */ -} ENVPR; - - -typedef struct AUDTMP{ - INSTRUMENT *i; - SAMPLE *s; - - UWORD fadevol; /* fading volume */ - - ENVPR venv; - ENVPR penv; - - UBYTE keyon; /* if true=key is pressed. */ - UBYTE kick; /* if true=sample has to be restarted */ - UBYTE sample; /* which sample number (0-31) */ - SWORD handle; /* which sample-handle */ - - ULONG start; /* The start byte index in the sample */ - - UBYTE panning; /* panning position */ - UBYTE pansspd; /* panslide speed */ - - SBYTE volume; /* amiga volume (0 t/m 64) to play the sample at */ - UWORD period; /* period to play the sample at */ - - /* You should not have to use the values - below in the player routine */ - - SBYTE transpose; - - UBYTE note; /* */ - - SWORD ownper; - SWORD ownvol; - - UBYTE *row; /* row currently playing on this channel */ - - SBYTE retrig; /* retrig value (0 means don't retrig) */ - UWORD c2spd; /* what finetune to use */ - - SBYTE tmpvolume; /* tmp volume */ - - UWORD tmpperiod; /* tmp period */ - UWORD wantedperiod; /* period to slide to (with effect 3 or 5) */ - - UWORD slidespeed; /* */ - UWORD portspeed; /* noteslide speed (toneportamento) */ - - UBYTE s3mtremor; /* s3m tremor (effect I) counter */ - UBYTE s3mtronof; /* s3m tremor ontime/offtime */ - - UBYTE s3mvolslide; /* last used volslide */ - - UBYTE s3mrtgspeed; /* last used retrig speed */ - UBYTE s3mrtgslide; /* last used retrig slide */ - - UBYTE glissando; /* glissando (0 means off) */ - UBYTE wavecontrol; /* */ - - SBYTE vibpos; /* current vibrato position */ - UBYTE vibspd; /* "" speed */ - UBYTE vibdepth; /* "" depth */ - - SBYTE trmpos; /* current tremolo position */ - UBYTE trmspd; /* "" speed */ - UBYTE trmdepth; /* "" depth */ - - UWORD soffset; /* last used sample-offset (effect 9) */ -} AUDTMP; - - -extern AUDTMP mp_audio[32]; /* max eight channels */ -extern UBYTE mp_bpm; /* beats-per-minute speed */ -extern UWORD mp_patpos; /* current row number (0-63) */ -extern SWORD mp_sngpos; /* current song position */ -extern UWORD mp_sngspd; /* current songspeed */ - -extern BOOL mp_loop; -extern BOOL mp_panning; -extern BOOL mp_extspd; -extern UBYTE mp_volume; - -/* - player prototypes: -*/ - -int MP_Ready(void); -void MP_NextPosition(void); -void MP_PrevPosition(void); -void MP_SetPosition(UWORD pos); -void MP_HandleTick(void); -void MP_Init(UNIMOD *m); - - -/************************************************************************** -****** Virtual channel stuff: ********************************************* -**************************************************************************/ - -BOOL VC_Init(void); -void VC_Exit(void); - -void VC_PlayStart(void); -void VC_PlayStop(void); - -SWORD VC_SampleLoad(FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags); -void VC_SampleUnload(SWORD handle); - -void VC_WriteSamples(SBYTE *buf,UWORD todo); -UWORD VC_WriteBytes(SBYTE *buf,UWORD todo); -void VC_SilenceBytes(SBYTE *buf,UWORD todo); - -void VC_VoiceSetVolume(UBYTE voice,UBYTE vol); -void VC_VoiceSetFrequency(UBYTE voice,ULONG frq); -void VC_VoiceSetPanning(UBYTE voice,UBYTE pan); -void VC_VoicePlay(UBYTE voice,SWORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags); - -#endif diff --git a/16/v2/source/verge/MAPED/MIKMOD.LIB b/16/v2/source/verge/MAPED/MIKMOD.LIB deleted file mode 100755 index 0f55de9509397675e1f2f6354e32380a510ae977..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94720 zcmeFa3w%`7wLgAlGLuY_ArnZ50eJ*O1w~90lpsnHl8}TX|v6jzOtcwbzODk@F&Jf zl5Y0A)HJ=hD6OSmGzaixwZAH%d5?JHUhAm+8Q5ZnO6GL zf$E>v9NXCwq>-dz)6QT^E8p^PoBH=`LR&%mXFAhXlU9=C-^r)jFNQmHF`6ScxT2d` zQgcm(FE(HI=pgy?4S@p2!SW*m`O$;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c_{|Pq3z$~uYY;) z{q*ZIAIBfh(OQQ8*)Z;Mx>WeleyI!W;;Q0bS0W#kP7RV?h6l87uunqM%~l*BWhD@H znifPyWPge%#5S=?^RsV4kJOySBPt>s~3cCX%sG4oUjsbd9!YA2d z;H#eTV7*7*&JWP2)jLHB8Wj^5EDx)YKopOW&cjZtd+%J{#9dT -#include -#include - -#include "config.h" -#include "keyboard.h" -#include "maped.h" -#include "mouse.h" -#include "vdriver.h" - -// ============================ Data ============================ - -unsigned char mvsp[2048]; // mini-VSP dominant color -int xoff=0, yoff=0; // x-offset, y-offset - -// ============================ Code ============================ -/* -FindDominantColor(int i) -{ unsigned char *src; - int j,tally=0; - - // This is a cheap-ass method. I have a more proper method in mind, but - // I'm going to do this for now b/c I'm lazy. Actually, the real reason is - // speed. - - src=vsp+(i*256); - - for (j=0; j<256; j++) - { - tally+=*src; - src++; - } - tally=tally/256; - mvsp[i]=(unsigned char) tally; -} -*/ - -void FindDominantColor(int i) -{ unsigned char *src, tally[256], tab; - int j; - - src=vsp+(i*256); - memset(&tally, 0, 256); - - for (j=0; j<256; j++) - { - tally[*src]++; - src++; - } - tab=0; - for (j=0; j<256; j++) - { - if (tally[j] > tab) tab=j; - } - mvsp[i]=(unsigned char) tab; -} - -void GenerateMiniVSP() -{ int i; - - for (i=0; i 0) xoff-=16; - key[SCAN_LEFT]=0; - } - if (key[SCAN_UP] && yoff) - { - if (yoff > 0) yoff-=16; - key[SCAN_UP]=0; - } - if (key[SCAN_DOWN]) - { - if (yoff < layer[0].sizey) - yoff+=16; - key[SCAN_DOWN]=0; - } - if (key[SCAN_RIGHT]) - { - if (xoff < layer[0].sizex) - xoff+=16; - key[SCAN_RIGHT]=0; - } - if (mb) - { - xwin=(xoff+mx-16)*16; - ywin=(yoff+my-16)*16; - if (xwin>=(layer[0].sizex*16)-320) xwin=(layer[0].sizex*16)-320; - if (ywin>=(layer[0].sizey*16)-tsy-15) ywin=(layer[0].sizey*16)-tsy-15; - WaitRelease(); - break; - } - } - key[SCAN_ESC]=0; - vfree(ptr); -} diff --git a/16/v2/source/verge/MAPED/MINIMAP.H b/16/v2/source/verge/MAPED/MINIMAP.H deleted file mode 100755 index 254b13bd..00000000 --- a/16/v2/source/verge/MAPED/MINIMAP.H +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef MINIMAP_INC -#define MINIMAP_INC - -extern void FindDominantColor(int i); -extern void GenerateMiniVSP(); -extern void MiniMAP(); - -#endif // MINIMAP_INC diff --git a/16/v2/source/verge/MAPED/MODE13H.C b/16/v2/source/verge/MAPED/MODE13H.C deleted file mode 100755 index 38336e14..00000000 --- a/16/v2/source/verge/MAPED/MODE13H.C +++ /dev/null @@ -1,350 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include "mode13h.h" -#include "vdriver.h" - -// ================================= Data ==================================== - -char *screenr; // realscr -char startline=16; // virtual scroll around 240 vert. pixels -extern unsigned char* translucency_table; //zero - -extern void *valloc(int amount, char*, int); -extern int vfree(void *); -extern void CheckTimerStuff(); // in maped.c - -// ================================= Code ==================================== - - -void SetMode(int mode) -{ - REGISTERS r; - SET_AX(r, mode); - INTERRUPT(0x10, r); -} - -int Mode13hShutdown() -{ - SetMode(0x3); - vfree(screen); - screen=0; - return 0; -} - -int Mode13hShowPage() -{ int rows; - char *s,*d; - - CheckTimerStuff(); - - s=screen+(16*tsx)+16; - d=screenr; - rows=sy; - - for (; rows; rows--) - { - memcpy(d,s,sx); - s+=tsx; - d+=sx; - } - - return 0; -} - -int Mode13hCopySprite(int x, int y, int width, int height, char *src) -{ char *d; - - d=screen+(y*tsx)+x; - for (; height; height--) - { - memcpy(d,src,width); - src+=width; - d+=tsx; - } - - return 0; -} - -int Mode13hCCopySprite(int x,int y,int width,int height,char *src) -{ int cx1,cy1,cx2,cy2; - char *s,*d; - int xl,yl,xs,ys; - - xl=width; - yl=height; - xs=ys=0; - - cx1=0; - cy1=0; - cx2=tsx-1; - cy2=tsy-1; - - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x cy2) length=cy2-y+1; - if (ycx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (x336 || y<0 || y>256) return 0; - d=screen+(y*tsx)+x; - for (y=0; y<8; y++) - { - d[0]=c; d[2]=c; d[4]=c; d[6]=c; - d[8]=c; d[10]=c; d[12]=c; d[14]=c; - - d+=(tsx+1); - - d[0]=c; d[2]=c; d[4]=c; d[6]=c; - d[8]=c; d[10]=c; d[12]=c; d[14]=c; - - d+=(tsx-1); - } - - return 0; -} - -int Mode13hClearScreen() -{ - memset(screen,0,76032); - return 0; -} - -int Mode13hCopySpriteLucentClip(int x, int y, int width, int height, unsigned char *src) -{ - int cx1,cy1,cx2,cy2; - unsigned char *s,*d,c; - int xl,yl,xs,ys; - - cx1=0; - cy1=0; - cx2=tsx-1; - cy2=tsy-1; - - xl=width; - yl=height; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x -#include -#include - -#include "mode13h.h" // SetMode() -#include "modex.h" -#include "vdriver.h" - -// ================================= Data ==================================== - -#define SEQU_ADDR 0x3c4 -#define CRTC_ADDR 0x3d4 -#define MISC_OUTPUT 0x3c2 - -char *screen1, *screen2; // page banks; -char *screenx, curscr; // ptr to active page | page flip ctr -char *screenbase; // ptr to A000:0000 - -extern unsigned char* translucency_table; //zero - -extern void CheckTimerStuff(); -extern void *valloc(int amount,char*,int); -extern int vfree(void *); - -// ================================= Code ==================================== - -static void plane(char p) -{ - int hi=1<>2); - - while (d>2); - } - - s+=tsx; - d+=(sx>>2); - } - return 0; -} - -int ModeXCopySprite(int x, int y, int width, int height, char *src) -{ char *d; - - d=screen+(y*tsx)+x; - for (; height; height--) - { - memcpy(d,src,width); - src+=width; - d+=tsx; - } - - return 0; -} - -int ModeXCCopySprite(int x,int y,int width,int height,char *src) -{ int cx1,cy1,cx2,cy2; - char *s,*d; - int xl,yl,xs,ys; - - xl=width; - yl=height; - xs=ys=0; - - cx1=0; - cy1=0; - cx2=tsx-1; - cy2=tsy-1; - - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - - if (xcx2 || y>cy2 || x cy2) length=cy2-y+1; - if (ycx2 || y>cy2 || x+width cx2) width=cx2-x+1; - if (x336 || y<0 || y>256) return 0; - d=screen+(y*tsx)+x; - for (y=0; y<8; y++) - { - d[0]=c; d[2]=c; d[4]=c; d[6]=c; - d[8]=c; d[10]=c; d[12]=c; d[14]=c; - - d+=(tsx+1); - - d[0]=c; d[2]=c; d[4]=c; d[6]=c; - d[8]=c; d[10]=c; d[12]=c; d[14]=c; - - d+=(tsx-1); - } - - return 0; -} - -int ModeXClearScreen() -{ - memset(screen,0,90117); - return 0; -} - -int ModeXCopySpriteLucentClip(int x, int y, int width, int height, unsigned char *src) -{ - int cx1,cy1,cx2,cy2; - unsigned char *s,*d,c; - int xl,yl,xs,ys; - - cx1=0; - cy1=0; - cx2=tsx-1; - cy2=tsy-1; - - xl=width; - yl=height; - xs=ys=0; - if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; - if (y+yl > cy2) yl=cy2-y+1; - if (x -#include -#include - -#include "timer.h" -#include "vdriver.h" - -// ================================= Data ==================================== - -extern char mousepic[]; // blah - -static union REGS regs; - -int mx=0,my=0,mb=0; -int rb=0,wb=0; -int lmx=0,lmy=0,lmb=0; - -// ================================= Code ==================================== - -void PutMouse(int x, int y) -{ - lmx=mx; lmy=my; lmb=mb; - memset(®s, 0, sizeof regs); - regs.w.ax=4; - regs.w.cx=x*2; - regs.w.dx=y*2; - int386(0x33,®s,®s); - - mx=x; my=y; -} - -void InitMouse() -{ - memset(®s, 0, sizeof regs); - int386(0x33,®s,®s); - - regs.w.ax=7; - regs.w.cx=0; - regs.w.dx=640; /*320;*/ /* -- ric:13/Jun/98 - fix horizontal jumps -- */ - int386(0x33,®s,®s); - - regs.w.ax=8; - regs.w.cx=0; - regs.w.dx=sy; // aen - int386(0x33,®s,®s); - - PutMouse(sx/2,(sy/2) /2); // aen -} - -void ReadMouse() -{ - lmx=mx; lmy=my; lmb=mb; - memset(®s, 0, sizeof regs); - regs.w.ax=3; - int386(0x33,®s,®s); - - mx=((regs.w.cx)>>1)+16; /* -- ric:13/Jun/98 - fix horizontal jumps -- */ - my=(regs.w.dx)+16; - rb=regs.w.bx; - - if (rb && wb) { mb=0; return; } - if (wb && !rb) wb=0; - mb=rb; - - if ((lmx!=mx) || (lmy!=my) || (lmb!=mb)) idlect=0; -} - -void DrawMouse() -{ - ReadMouse(); - TCopySprite(mx,my,4,5,mousepic); -} - -void WaitRelease() -{ - wb=1; - mb=0; -} diff --git a/16/v2/source/verge/MAPED/MOUSE.H b/16/v2/source/verge/MAPED/MOUSE.H deleted file mode 100755 index d0e9a1d2..00000000 --- a/16/v2/source/verge/MAPED/MOUSE.H +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef MOUSE_INC -#define MOUSE_INC - -extern int mx,my,mb; -extern int rb,wb; -extern int lmx,lmy,lmb; - -extern void PutMouse(int x, int y); -extern void InitMouse(); -extern void ReadMouse(); -extern void DrawMouse(); -extern void WaitRelease(); - -#endif // MOUSE_INC diff --git a/16/v2/source/verge/MAPED/MTYPES.H b/16/v2/source/verge/MAPED/MTYPES.H deleted file mode 100755 index a57d0879..00000000 --- a/16/v2/source/verge/MAPED/MTYPES.H +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef MTYPES_H -#define MTYPES_H - -/* - MikMod atomic types: - ==================== -*/ - - -#ifdef __OS2__ - -typedef signed char SBYTE; /* has to be 1 byte signed */ -typedef unsigned char UBYTE; /* has to be 1 byte unsigned */ -typedef short SWORD; /* has to be 2 bytes signed */ -typedef unsigned short UWORD; /* has to be 2 bytes unsigned */ -typedef long SLONG; /* has to be 4 bytes signed */ -/* ULONG and BOOL are already defined in OS2.H */ - -#elif defined(__alpha) - -typedef char SBYTE; /* has to be 1 byte signed */ -typedef unsigned char UBYTE; /* has to be 1 byte unsigned */ -typedef short SWORD; /* has to be 2 bytes signed */ -typedef unsigned short UWORD; /* has to be 2 bytes unsigned */ -/* long is 8 bytes on dec alpha - RCA */ -typedef int SLONG; /* has to be 4 bytes signed */ -typedef unsigned int ULONG; /* has to be 4 bytes unsigned */ -typedef int BOOL; /* doesn't matter.. 0=FALSE, <>0 true */ - -#else - -typedef char SBYTE; /* has to be 1 byte signed */ -typedef unsigned char UBYTE; /* has to be 1 byte unsigned */ -typedef short SWORD; /* has to be 2 bytes signed */ -typedef unsigned short UWORD; /* has to be 2 bytes unsigned */ -typedef long SLONG; /* has to be 4 bytes signed */ -typedef unsigned long ULONG; /* has to be 4 bytes unsigned */ -typedef int BOOL; /* doesn't matter.. 0=FALSE, <>0 true */ - -#endif - - -#ifdef __OS2__ -#define INCL_DOS -#define INCL_MCIOS2 -#define INCL_MMIOOS2 -#include -#include -#include -#endif - - -#ifdef __WATCOMC__ -#define inportb(x) inp(x) -#define outportb(x,y) outp(x,y) -#define inport(x) inpw(x) -#define outport(x,y) outpw(x,y) -#define disable() _disable() -#define enable() _enable() -#endif - - -#ifdef __DJGPP__ -#include -#include -#include -#define inp inportw -#define outport outportw -#define inport inportw -#define interrupt -#endif - -#endif diff --git a/16/v2/source/verge/MAPED/PCX.C b/16/v2/source/verge/MAPED/PCX.C deleted file mode 100755 index 5ab55f66..00000000 --- a/16/v2/source/verge/MAPED/PCX.C +++ /dev/null @@ -1,210 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include "timer.h" -#include "vga.h" - -char manufacturer; // pcx header -char version; -char encoding; -char bits_per_pixel; -short int xmin,ymin; -short int xmax,ymax; -short int hres; -short int vres; -char palette[48]; -char reserved; -char color_planes; -short int bytes_per_line; -short int palette_type; -char filler[58]; - -unsigned short int width,depth; -unsigned short int bytes, i; -unsigned char c, run, ss=0; -unsigned int vidoffset, n=0; -FILE *pcxf; - -void ReadPCXLine(unsigned char *dest) -{ int j; - n=0; - - do { - c=fgetc(pcxf) & 0xff; - if ((c & 0xc0)==0xc0) { - run=c & 0x3f; - c=fgetc(pcxf); - for (j=0; j> 2; - set_intensity(63); -} - -void LoadPCXHeaderNP(char *fname) -{ - if (!(pcxf=fopen(fname,"rb"))) err("Could not open specified PCX file."); - fread(&manufacturer,1,1,pcxf); - fread(&version,1,1,pcxf); - fread(&encoding,1,1,pcxf); - fread(&bits_per_pixel,1,1,pcxf); - fread(&xmin,1,2,pcxf); - fread(&ymin,1,2,pcxf); - fread(&xmax,1,2,pcxf); - fread(&ymax,1,2,pcxf); - fread(&hres,1,2,pcxf); - fread(&vres,1,2,pcxf); - fread(&palette,1,48,pcxf); - fread(&reserved,1,1,pcxf); - fread(&color_planes,1,1,pcxf); - fread(&bytes_per_line,1,2,pcxf); - fread(&palette_type,1,2,pcxf); - fread(&filler,1,58,pcxf); - width=xmax-xmin+1; - depth=ymax-ymin+1; - bytes=bytes_per_line; -} - -void loadpcx(char *fname, char *dest) -{ - LoadPCXHeader(fname); - - for (i=0; i1 || (byte & 0xC0) != 0) - { - repcode=0xC0 | samect; - fwrite(&repcode,1,1,pcxf); - } - fwrite(&byte,1,1,pcxf); - } while (i<320); -} - -void WritePalette() -{ char b; - int i; - - for (i=0; i<768; i++) - pal[i]=pal[i] << 2; - - b=12; fwrite(&b, 1, 1, pcxf); - fwrite(pal, 1, 768, pcxf); - - for (i=0; i<768; i++) - pal[i]=pal[i] >> 2; -} - -void ScreenShot() -{ unsigned char b1; - unsigned short int w1; - char fnamestr[13]; - - // Takes a snapshot of the current screen. - - dec_to_asciiz(ss,&fnamestr); - b1=strlen(&fnamestr); - fnamestr[b1++]='.'; - fnamestr[b1++]='P'; - fnamestr[b1++]='C'; - fnamestr[b1++]='X'; - fnamestr[b1++]=0; - - pcxf=fopen(&fnamestr,"wb"); - ss++; - -// Write PCX header - - b1=10; fwrite(&b1, 1, 1, pcxf); // manufacturer always = 10 - b1=5; fwrite(&b1, 1, 1, pcxf); // version = 3.0, >16 colors - b1=1; fwrite(&b1, 1, 1, pcxf); // encoding always = 1 - b1=8; fwrite(&b1, 1, 1, pcxf); // 8 bits per pixel, for 256 colors - w1=0; fwrite(&w1, 1, 2, pcxf); // xmin = 0; - w1=0; fwrite(&w1, 1, 2, pcxf); // ymin = 0; - w1=319; fwrite(&w1, 1, 2, pcxf); // xmax = 319; - w1=199; fwrite(&w1, 1, 2, pcxf); // ymax = 199; - w1=320; fwrite(&w1, 1, 2, pcxf); // hres = 320; - w1=200; fwrite(&w1, 1, 2, pcxf); // vres = 200; - - fwrite(virscr,1,48,pcxf); // 16-color palette data. Who knows what's - // actually in here. It doesn't matter since - // the 256-color palette is stored elsewhere. - - b1=0; fwrite(&b1, 1, 1, pcxf); // reserved always = 0. - b1=1; fwrite(&b1, 1, 1, pcxf); // number of color planes. Just 1 for 8bit. - w1=320; fwrite(&w1, 1, 2, pcxf); // number of bytes per line - - w1=0; fwrite(&w1, 1, 1, pcxf); - fwrite(virscr, 1, 59, pcxf); // filler - - for (w1=0; w1<200; w1++) - WritePCXLine(screen+(w1*320)); - - WritePalette(); - fclose(pcxf); - timer_count=0; -} diff --git a/16/v2/source/verge/MAPED/RENDER.C b/16/v2/source/verge/MAPED/RENDER.C deleted file mode 100755 index e1067755..00000000 --- a/16/v2/source/verge/MAPED/RENDER.C +++ /dev/null @@ -1,475 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include "config.h" -#include "maped.h" -#include "vdriver.h" - -#include "render.h" // MAXTILES - -// ================================= Data ==================================== - -extern char stipple[256]; - -int oxw=0, oyw=0; -int xofs=0, yofs=0; -int xtc=0, ytc=0; - -char curlayer=0; -short tileidx[MAXTILES]; -char flipped[MAXTILES]; - -// ------ - -chri chrs[100]; - -// ================================= Code ==================================== - -void DoCHR(int i) // hee hee! -{ - FILE *f; - char b; - int q; - short numframes; - -// free(chrs[i].frame); -// chrs[i].frame=0; -// return; - - if (!strlen(chrlist[i].t)) - { - if (chrs[i].frame) vfree(chrs[i].frame); - chrs[i].frame=0; - chrs[i].fx=chrs[i].fy=0; - chrs[i].hx=chrs[i].hy=0; - return; - } - if (!(f=fopen(chrlist[i].t,"rb"))) - { - if (chrs[i].frame) vfree(chrs[i].frame); - chrs[i].frame=0; - chrs[i].fx=chrs[i].fy=0; - chrs[i].hx=chrs[i].hy=0; - return; - } - if (chrs[i].frame) vfree(chrs[i].frame); - fread(&b, 1, 1, f); - if (b!=2) - { - // This should really not work with V1 CHRs, but.. - chrs[i].frame=(char *) malloc(512); - fseek(f, 0, 0); - fread(chrs[i].frame, 1, 512, f); - fclose(f); - chrs[i].fx=16; chrs[i].fy=32; - chrs[i].hx=0; chrs[i].hy=16; - return; - } - chrs[i].fx=0; fread(&chrs[i].fx, 1, 2, f); - chrs[i].fy=0; fread(&chrs[i].fy, 1, 2, f); - chrs[i].hx=0; fread(&chrs[i].hx, 1, 2, f); - chrs[i].hy=0; fread(&chrs[i].hy, 1, 2, f); - fread(strbuf, 2, 2, f); - fread(&numframes, 1, 2, f); - chrs[i].frame=(char *) valloc(chrs[i].fx*chrs[i].fy*numframes,"chr preview",i); - fread(&q, 1, 4, f); - - ReadCompressedLayer1(chrs[i].frame, chrs[i].fx*chrs[i].fy*numframes,f); - - fclose(f); -} - -void DoCHRdealy() -{ - int i; - - for (i=0; i<100; i++) - DoCHR(i); -} - -void BlitBackLayer(char l) -{ - int i,j; - //int a; - char *img; - //char *d; - unsigned short *lay; - //int v; - int mapx,mapy; - int x,y; - unsigned int tile; - - if (!layertoggle[l]) return; - - mapx = layer[l].sizex; - mapy = layer[l].sizey; - lay = layers[l]; - - // Adjust view - oxw = xwin * layer[l].pmultx / layer[l].pdivx; - oyw = ywin * layer[l].pmulty / layer[l].pdivy; - xofs = 16 - (oxw & 15); - yofs = 16 - (oyw & 15); - xtc = oxw / 16; - ytc = oyw / 16; - - // Draw it, bitch! - for (i=0; i <= ty; i++) - { - for (j=0; j <= tx; j++) - { - x = xtc+j; - y = ytc+i; - - // write better clipping sometime - if (y >= 0 || y < mapy || x >=0 || x < mapx) - { - // what the HELL @_@ - tile = lay[(y * mapx) + x]; - if (tile >= numtiles) tile = numtiles-1; - tile = tileidx[tile]; - if (tile >= numtiles) tile = numtiles-1; - - img = &vsp[tile * 256]; - - x = (j * 16) + xofs; - y = (i * 16) + yofs; - - //CopyTile(x, y, img); - CCopySprite(x, y, 16, 16, img); - } - } - } - - curlayer++; -} - -//zero -extern char* translucency_table; -void LucentBlitLayer(char l) -{ - int i,j; - //int a,b; - char *img; - //char *d; - unsigned short *lay; - //int v; - int mapx,mapy; - int x,y; - unsigned int tile; - - if (!layertoggle[l]) return; - if(!translucency_table) - { - TransBlitlayer(l); - return; - } - - mapx = layer[l].sizex; - mapy = layer[l].sizey; - lay = layers[l]; - - // Adjust view - oxw = xwin * layer[l].pmultx / layer[l].pdivx; - oyw = ywin * layer[l].pmulty / layer[l].pdivy; - xofs = 16 - (oxw & 15); - yofs = 16 - (oyw & 15); - xtc = oxw / 16; - ytc = oyw / 16; - - // Draw it, bitch! - for (i=0; i <= ty; i++) - { - for (j=0; j <= tx; j++) - { - x = xtc+j; - y = ytc+i; - - // write better clipping sometime - if (y >= 0 || y < mapy || x >=0 || x < mapx) - { - // what the HELL @_@ - tile = lay[(y * mapx) + x]; - if (tile >= numtiles) tile = numtiles-1; - tile = tileidx[tile]; - if (tile >= numtiles) tile = numtiles-1; - - img = &vsp[tile * 256]; - if (img != vsp) - { - x = (j * 16) + xofs; - y = (i * 16) + yofs; - CopySpriteLucentClip(x, y, 16, 16, img); - } - } - } - } - curlayer++; -} - - -void TransBlitlayer(char l) -{ - int i,j; - //int a,b; - char *img; - //char *d; - unsigned short *lay; - //int v; - int mapx,mapy; - int x,y; - unsigned int tile; - - if (!layertoggle[l]) return; - - lay = layers[l]; - - mapx = layer[l].sizex; - mapy = layer[l].sizey; - - // Adjust view - oxw = xwin * layer[l].pmultx / layer[l].pdivx; - oyw = ywin * layer[l].pmulty / layer[l].pdivy; - xofs = 16 - (oxw & 15); - yofs = 16 - (oyw & 15); - xtc = oxw / 16; - ytc = oyw / 16; - - // Draw it, bitch! - for (i=0; i <= ty; i++) - { - for (j=0; j <= tx; j++) - { - x = xtc+j; - y = ytc+i; - - // write better clipping sometime - if (y >= 0 || y < mapy || x >=0 || x < mapx) - { - // what the HELL @_@ - tile = lay[(y * mapx) + x]; - if (tile >= numtiles) tile = numtiles-1; - tile = tileidx[tile]; - if (tile >= numtiles) tile = numtiles-1; - - img = &vsp[tile * 256]; - if (img != vsp) - { - x = (j * 16) + xofs; - y = (i * 16) + yofs; - //TCopySprite(x, y, 16, 16, img); - TCCopySprite(x, y, 16, 16, img); - } - } - } - } - - curlayer++; -} - -void BlitLayer(char c) -{ - if(layer[c].trans) { LucentBlitLayer(c); return; } //zero - if (curlayer) TransBlitLayer(c); - else BlitBackLayer(c); -} - -void DrawObstructions() -{ int i,j; - int mapx; - - mapx = layer[0].sizex; - - oxw=xwin*layer[0].pmultx/layer[0].pdivx; - oyw=ywin*layer[0].pmulty/layer[0].pdivy; - xofs=16-(oxw&15); - yofs=16-(oyw&15); - xtc=oxw>>4; - ytc=oyw>>4; - - for (i=0; i>4; - ytc=oyw>>4; - - for (i=0; i=(xwin/16)) && (entity[m].x<(xwin/16)+22) && - (entity[m].y>=(ywin/16)) && (entity[m].y<(ywin/16)+ty+2)) - { - if (chrs[entity[m].chrindex].frame) - TCCopySprite((entity[m].x*16)-xwin+16-chrs[entity[m].chrindex].hx, - (entity[m].y*16)-ywin+16-chrs[entity[m].chrindex].hy, - chrs[entity[m].chrindex].fx, - chrs[entity[m].chrindex].fy, - chrs[entity[m].chrindex].frame); - else - { - TCCopySprite( - (entity[m].x*16)-xwin+16,(entity[m].y*16)-ywin+16,16,16,stipple); - //ColorGrid((entity[m].x*16)-xwin+16, - // (entity[m].y*16)-ywin+16, 0); - } - } -} - -// aen -void DrawSelection() -{ int i,j; - int x1,y1,x2,y2; - - oxw=xwin*layer[el].pmultx/layer[el].pdivx; - oyw=ywin*layer[el].pmulty/layer[el].pdivy; - xofs=16-(oxw&15); - yofs=16-(oyw&15); - xtc=oxw>>4; - ytc=oyw>>4; - - x1=selx1; - y1=sely1; - x2=selx2; - y2=sely2; - - if (x2= x1 && xtc+j <= x2 - && ytc+i >= y1 && ytc+i <= y2) - { - TCCopySprite((j*16)+xofs, (i*16)+yofs, 16,16, stipple); - //ColorGrid((j*16)+xofs,(i*16)+yofs,7); - } - } -} - -void RenderMap() -{ char *src; - //char rs[2]; - - curlayer=0; - src=rstring; - - /* - rs[1]=0; // aen - for (; *src; ++src) - { - rs[0]=*src; - BlitLayer(atoi(rs) -1); - } - */ - while (*src) - { - switch (*src) - { - case '1': BlitLayer(0); break; - case '2': BlitLayer(1); break; - case '3': BlitLayer(2); break; - case '4': BlitLayer(3); break; - case '5': BlitLayer(4); break; - case '6': BlitLayer(5); break; - } - src++; - } - - if (!curlayer) memset(screen+5648,0,84480); - if (layertoggle[6]) DrawObstructions(); - if (layertoggle[7]) DrawZones(); - if (layertoggle[8]) DrawEntities(); - if (shifted) DrawSelection(); -} - -void AnimateTile(char i, int l) -{ - switch (vspanim[i].mode) - { - case 0: if (tileidx[l]vspanim[i].start) tileidx[l]--; - else tileidx[l]=vspanim[i].finish; - break; - case 2: tileidx[l]=random(vspanim[i].start,vspanim[i].finish); - break; - case 3: if (flipped[l]) - { - if (tileidx[l]!=vspanim[i].start) tileidx[l]--; - else { tileidx[l]++; flipped[l]=0; } - } - else - { - if (tileidx[l]!=vspanim[i].finish) tileidx[l]++; - else { tileidx[l]--; flipped[l]=1; } - } - } -} - -void Animate(char i) -{ static int l; - - vadelay[i]=0; - for (l=vspanim[i].start; l<=vspanim[i].finish; l++) - AnimateTile(i,l); -} - -void CheckTileAnimation() -{ static char i; - - for (i=0; i<100; i++) - { if ((vspanim[i].delay) && (vspanim[i].delay - -#include "vdriver.h" - -#define xx 31 - -int fontx=0; -int fonty=0; - -char sbA[]={3, - 00,xx,00, - xx,00,xx, - xx,xx,xx, - xx,00,xx, - xx,00,xx}; - -char ssA[]={3, - 00,00,00, - 00,xx,00, - xx,00,xx, - xx,xx,xx, - xx,00,xx}; - -char sbB[]={3, - xx,xx,00, - xx,00,xx, - xx,xx,00, - xx,00,xx, - xx,xx,00}; - -char ssB[]={3, - 00,00,00, - xx,xx,00, - xx,xx,00, - xx,00,xx, - xx,xx,xx}; - -char sbC[]={3, - 00,xx,xx, - xx,00,00, - xx,00,00, - xx,00,00, - 00,xx,xx}; - -char ssC[]={3, - 00,00,00, - 00,xx,xx, - xx,00,00, - xx,00,00, - 00,xx,xx}; - -char sbD[]={3, - xx,xx,00, - xx,00,xx, - xx,00,xx, - xx,00,xx, - xx,xx,00}; - -char ssD[]={3, - 00,00,00, - xx,xx,00, - xx,00,xx, - xx,00,xx, - xx,xx,00}; - -char sbE[]={3, - xx,xx,xx, - xx,00,00, - xx,xx,00, - xx,00,00, - xx,xx,xx}; - -char ssE[]={3, - 00,00,00, - xx,xx,xx, - xx,xx,00, - xx,00,00, - xx,xx,xx}; - -char sbF[]={3, - xx,xx,xx, - xx,00,00, - xx,xx,00, - xx,00,00, - xx,00,00}; - -char ssF[]={3, - 00,00,00, - xx,xx,xx, - xx,00,00, - xx,xx,00, - xx,00,00}; - -char sbG[]={3, - 00,xx,xx, - xx,00,00, - xx,00,xx, - xx,00,xx, - 00,xx,xx}; - -char ssG[]={3, - 00,00,00, - 00,xx,xx, - xx,00,00, - xx,00,xx, - 00,xx,xx}; - -char sbH[]={3, - xx,00,xx, - xx,00,xx, - xx,xx,xx, - xx,00,xx, - xx,00,xx}; - -char ssH[]={3, - 00,00,00, - xx,00,xx, - xx,00,xx, - xx,xx,xx, - xx,00,xx}; - -char sbI[]={1, - xx, - xx, - xx, - xx, - xx}; - -char ssI[]={1, - 00, - xx, - xx, - xx, - xx}; - -char sbJ[]={3, - 00,00,xx, - 00,00,xx, - 00,00,xx, - xx,00,xx, - 00,xx,00}; - -char ssJ[]={3, - 00,00,00, - 00,00,xx, - 00,00,xx, - xx,00,xx, - 00,xx,00}; - -char sbK[]={3, - xx,00,xx, - xx,00,xx, - xx,xx,00, - xx,00,xx, - xx,00,xx}; - -char ssK[]={3, - 00,00,00, - xx,00,xx, - xx,xx,00, - xx,00,xx, - xx,00,xx}; - -char sbL[]={3, - xx,00,00, - xx,00,00, - xx,00,00, - xx,00,00, - xx,xx,xx}; - -char ssL[]={3, - 00,00,00, - xx,00,00, - xx,00,00, - xx,00,00, - xx,xx,xx}; - -char sbM[]={5, - xx,00,00,00,xx, - xx,xx,00,xx,xx, - xx,00,xx,00,xx, - xx,00,00,00,xx, - xx,00,00,00,xx}; - -char ssM[]={5, - 00,00,00,00,00, - xx,00,00,00,xx, - xx,xx,00,xx,xx, - xx,00,xx,00,xx, - xx,00,00,00,xx}; - -char sbN[]={4, - xx,00,00,xx, - xx,xx,00,xx, - xx,00,xx,xx, - xx,00,00,xx, - xx,00,00,xx}; - -char ssN[]={4, - 00,00,00,00, - xx,00,00,xx, - xx,xx,00,xx, - xx,00,xx,xx, - xx,00,00,xx}; - -char sbO[]={3, - 00,xx,00, - xx,00,xx, - xx,00,xx, - xx,00,xx, - 00,xx,00}; - -char ssO[]={3, - 00,00,00, - 00,xx,00, - xx,00,xx, - xx,00,xx, - 00,xx,00}; - -char sbP[]={3, - xx,xx,00, - xx,00,xx, - xx,xx,00, - xx,00,00, - xx,00,00}; - -char ssP[]={3, - 00,00,00, - xx,xx,00, - xx,00,xx, - xx,xx,00, - xx,00,00}; - -char sbQ[]={4, - 00,xx,xx,00, - xx,00,00,xx, - xx,00,00,xx, - xx,00,xx,00, - 00,xx,00,xx}; - -char ssQ[]={3, - 00,00,00, - xx,xx,00, - xx,00,xx, - xx,xx,00, - 00,xx,xx}; - -char sbR[]={3, - xx,xx,00, - xx,00,xx, - xx,xx,00, - xx,00,xx, - xx,00,xx}; - -char ssR[]={3, - 00,00,00, - xx,xx,00, - xx,00,xx, - xx,xx,00, - xx,00,xx}; - -char sbS[]={3, - 00,xx,xx, - xx,00,00, - 00,xx,00, - 00,00,xx, - xx,xx,00}; - -char ssS[]={3, - 00,00,00, - 00,xx,xx, - xx,00,00, - 00,xx,xx, - xx,xx,00}; - -char sbT[]={3, - xx,xx,xx, - 00,xx,00, - 00,xx,00, - 00,xx,00, - 00,xx,00}; - -char ssT[]={3, - 00,00,00, - xx,xx,xx, - 00,xx,00, - 00,xx,00, - 00,xx,00}; - -char sbU[]={3, - xx,00,xx, - xx,00,xx, - xx,00,xx, - xx,00,xx, - xx,xx,xx}; - -char ssU[]={3, - 00,00,00, - xx,00,xx, - xx,00,xx, - xx,00,xx, - xx,xx,xx}; - -char sbV[]={3, - xx,00,xx, - xx,00,xx, - xx,00,xx, - xx,00,xx, - 00,xx,00}; - -char ssV[]={3, - 00,00,00, - xx,00,xx, - xx,00,xx, - xx,00,xx, - 00,xx,00}; - -char sbW[]={5, - xx,00,00,00,xx, - xx,00,00,00,xx, - xx,00,xx,00,xx, - xx,xx,00,xx,xx, - xx,00,00,00,xx}; - -char ssW[]={5, - 00,00,00,00,00, - xx,00,00,00,xx, - xx,00,xx,00,xx, - xx,xx,00,xx,xx, - xx,00,00,00,xx}; - -char sbX[]={3, - xx,00,xx, - xx,00,xx, - 00,xx,00, - xx,00,xx, - xx,00,xx}; - -char ssX[]={3, - 00,00,00, - xx,00,xx, - 00,xx,00, - xx,00,xx, - xx,00,xx}; - -char sbY[]={3, - xx,00,xx, - xx,00,xx, - 00,xx,00, - 00,xx,00, - 00,xx,00}; - -char ssY[]={3, - 00,00,00, - xx,00,xx, - xx,00,xx, - 00,xx,00, - 00,xx,00}; - -char sbZ[]={3, - xx,xx,xx, - 00,00,xx, - 00,xx,00, - xx,00,00, - xx,xx,xx}; - -char ssZ[]={2, - 00,00, - xx,xx, - 00,xx, - xx,00, - xx,xx}; - -char s1[]={1, - xx, - xx, - xx, - xx, - xx}; - -char s2[]={3, - xx,xx,xx, - 00,00,xx, - xx,xx,xx, - xx,00,00, - xx,xx,xx}; - -char s3[]={3, - xx,xx,xx, - 00,00,xx, - 00,xx,xx, - 00,00,xx, - xx,xx,xx}; - -char s4[]={3, - xx,00,xx, - xx,00,xx, - xx,xx,xx, - 00,00,xx, - 00,00,xx}; - -char s5[]={3, - xx,xx,xx, - xx,00,00, - xx,xx,xx, - 00,00,xx, - xx,xx,xx}; - -char s6[]={3, - xx,xx,xx, - xx,00,00, - xx,xx,xx, - xx,00,xx, - xx,xx,xx}; - -char s7[]={3, - xx,xx,xx, - 00,00,xx, - 00,00,xx, - 00,00,xx, - 00,00,xx}; - -char s8[]={3, - xx,xx,xx, - xx,00,xx, - xx,xx,xx, - xx,00,xx, - xx,xx,xx}; - -char s9[]={3, - xx,xx,xx, - xx,00,xx, - xx,xx,xx, - 00,00,xx, - xx,xx,xx}; - -char s0[]={3, - xx,xx,xx, - xx,00,xx, - xx,00,xx, - xx,00,xx, - xx,xx,xx}; - -char sQuote[]={3, - xx,00,xx, - xx,00,xx, - 00,00,00, - 00,00,00, - 00,00,00}; - -char sYow[]={1, - xx, - xx, - xx, - 00, - xx}; - -char sQuotes[]={1, - xx, - xx, - 00, - 00, - 00}; - - -char sComma[]={2, - 00,00, - 00,00, - 00,00, - 00,xx, - xx,00}; -char sPeriod[]={1, - 00, - 00, - 00, - 00, - xx}; - -char sMinus[]={2, - 00,00, - 00,00, - xx,xx, - 00,00, - 00,00}; - -char sQuest[]={3, - xx,xx,xx, - 00,00,xx, - 00,xx,xx, - 00,00,00, - 00,xx,00}; - -char sColon[]={1, - 00, - xx, - 00, - xx, - 00}; - -char sch[]={3, - 00,xx,00, - xx,xx,xx, - xx,xx,xx, - xx,xx,xx, - 00,xx,00}; - -char usc[]={2, - 00,00, - 00,00, - 00,00, - 00,00, - xx,xx}; - -char star[]={4, - 00,00,00,xx, - xx,00,xx,00, - 00,xx,00,00, - 00,00,00,00, - 00,00,00,00}; - -char ss[]={2, - xx,xx, - xx,xx, - xx,xx, - xx,xx, - xx,xx}; - -char sra[]={3, - xx,00,00, - xx,xx,00, - xx,xx,xx, - xx,xx,00, - xx,00,00}; - -char slParen[]={2, - 00,xx, - xx,00, - xx,00, - xx,00, - 00,xx}; - -char srParen[]={2, - xx,00, - 00,xx, - 00,xx, - 00,xx, - xx,00}; - -char ssemic[]={2, - xx,xx, - 00,00, - xx,xx, - 00,xx, - xx,00}; - -char sSlash[]={3, - 00,00,xx, - 00,00,xx, - 00,xx,00, - xx,00,00, - xx,00,00}; - -char sBlank[]={2, - 00,00, - 00,00, - 00,00, - 00,00, - 00,00}; - -// ... -char mousepic[] = { xx,00,00,00, - xx,xx,00,00, - xx,xx,xx,00, - xx,xx,xx,xx, - 00,00,xx,00, - 00,00,xx,00}; - -char *smal_tbl[]= -{ sBlank, - sYow, sQuote, ss, ss, ss, ss, sQuotes, slParen, // 40 - srParen, star, ss, sComma, sMinus,sPeriod, sSlash, s0, // 48 - s1, s2, s3, s4, s5, s6, s7, s8, // 56 - s9, sColon, ssemic, ss, ss, sra, sQuest, ss, // 64 - sbA, sbB, sbC, sbD, sbE, sbF, sbG, sbH, // 72 - sbI, sbJ, sbK, sbL, sbM, sbN, sbO, sbP, // 80 - sbQ, sbR, sbS, sbT, sbU, sbV, sbW, sbX, // 88 - sbY, sbZ, ss, ss, ss, ss, usc, sch, // 96 - ssA, ssB, ssC, ssD, ssE, ssF, ssG, ssH, // 102 - ssI, ssJ, ssK, ssL, ssM, ssN, ssO, ssP, // 110 - ssQ, ssR, ssS, ssT, ssU, ssV, ssW, ssX, // 118 - ssY, ssZ }; // 120 - -unsigned char lastcol=31; - -void GotoXY(int x1, int y1) -{ - fontx=x1; - fonty=y1; -} - -void print_char(char c) -{ char* img; - - c-=32; - if (c>90) c=2; - img=smal_tbl[c]; - TCopySprite(fontx,fonty,img[0],5,img+1); - fontx+=img[0]+1; -} - -void printstring(char *str) -{ - for (; *str; ++str) - print_char(*str); -} - -int pixels(char *str) -{ int pix; - - for (pix=0; *str; ++str) - pix += *smal_tbl[*str-32]+1; - return pix; -} - -void dec_to_asciiz(int num, char *buf) -{ - sprintf(buf,"%d",num); -} - -void TextColor(unsigned char newc) -{ char *src; - - src=sbA; - while ((int)src < (int) smal_tbl) - { - if (*src==lastcol) *src=newc; - src++; - } -} diff --git a/16/v2/source/verge/MAPED/SMALFONT.H b/16/v2/source/verge/MAPED/SMALFONT.H deleted file mode 100755 index 77688538..00000000 --- a/16/v2/source/verge/MAPED/SMALFONT.H +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef SMALFONT_INC -#define SMALFONT_INC - -extern int fontx; -extern int fonty; - -extern void GotoXY(int x1, int y1); -extern void print_char(char c); -extern void printstring(char *str); -extern int pixels(char *str); -extern void dec_to_asciiz(int num, char *buf); -extern void TextColor(unsigned char newc); - -#endif // SMALFONT_INC diff --git a/16/v2/source/verge/MAPED/SSAVER.C b/16/v2/source/verge/MAPED/SSAVER.C deleted file mode 100755 index b2ce0a55..00000000 --- a/16/v2/source/verge/MAPED/SSAVER.C +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include "maped.h" -#include "timer.h" -#include "vdriver.h" - -#include "mouse.h" - -// ================================= Data ==================================== - -static int *dmapx = NULL; -static int *dmapy = NULL; -static unsigned char *dscr = NULL; -static int recalc_distort = 1; -static long build = 0; - -// ================================= Code ==================================== - -// aen -static void init_distort(void) - { - int x = 0; - int y = 0; - int *dx = NULL; - int *dy = NULL; - - if (dmapx) vfree(dmapx); dmapx=NULL; - if (dmapy) vfree(dmapy); dmapy=NULL; - if (dscr) vfree(dscr); dscr=NULL; - - // allocate distort lookups - dmapx = (int *) valloc(tsx*tsy*4,"ssaver X",0); - dmapy = (int *) valloc(tsx*tsy*4,"ssaver Y",0); - - // allocate distort image buffer - dscr = (unsigned char *) valloc(tsx*tsy,"ssaver scrn",0); - - // copy viewport into distort buffer - memcpy(dscr, screen, tsx*tsy); - - dx = dmapx; - dy = dmapy; - - // generate distort lookups - for (y=0; y= tsy) yy -= tsy; - xt += (dmapx[(yy*tsx)+x] * build) >> 16; - - xx = (x+((thresh*tsx)/tsy)); - if (xx >= tsx) xx -= tsx; - yt += (dmapy[(yy*tsx)+xx] * build) >> 16; - - if (xt < 0) xt += tsx; - if (yt < 0) yt += tsy; - if (xt >= tsx) xt -= tsx; - if (yt >= tsy) yt -= tsy; - - *ds++ = dscr[(yt*tsx)+xt]; - - ++x; - if (x >= tsx) { - x = 0; - ++y; - //ds+=32; - } - - xt = x; - yt = y; - - } while (y < tsy); - - thresh += 2; - if (thresh >= tsy) - thresh -= tsy; - - if (build < 85196) //1.5 - build += 3276; - } - -void ScreenSaver(void) - { - while (idlect > 750) - { - ReadMouse(); - do_distort(); - ShowPage(); - } - recalc_distort=1; - build = 0; - } diff --git a/16/v2/source/verge/MAPED/SSAVER.H b/16/v2/source/verge/MAPED/SSAVER.H deleted file mode 100755 index 1a6a5296..00000000 --- a/16/v2/source/verge/MAPED/SSAVER.H +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef SSAVER_INC -#define SSAVER_INC - -extern void ScreenSaver(void); - -#endif // SSAVER_INC diff --git a/16/v2/source/verge/MAPED/SSAVER1.C b/16/v2/source/verge/MAPED/SSAVER1.C deleted file mode 100755 index 2e1846c1..00000000 --- a/16/v2/source/verge/MAPED/SSAVER1.C +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "timer.h" -#include "vdriver.h" - -// ================================= Data ==================================== - -// ================================= Code ==================================== - -void ScreenSaver() -{ - while (idlect>750) - { - ReadMouse(); - ClearScreen(); - ShowPage(); - } -} diff --git a/16/v2/source/verge/MAPED/TILEED.C b/16/v2/source/verge/MAPED/TILEED.C deleted file mode 100755 index 807f67cc..00000000 --- a/16/v2/source/verge/MAPED/TILEED.C +++ /dev/null @@ -1,2164 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// Additional code by Richard Lau (aka Ric) - -/* Date started: 08/Jul/98 */ -/* -- 29/Jul/98 -- - * Heh, I've actually done quite a lot of work on this even though I intend - * to replace it. Oh well :) - * - * I've now made clicking on the mask indicator button (labelled with a small - * "m") drop back to draw mode if you're in select mode (since it makes no - * sense to select an area with the mask turned off). Holding down shift - * and dragging the mouse when you're in select mode will allow you to select - * a rectangle. The PgUp/PgDn colour shifters will now work in paste mode - * (affecting the image in the copy buffer). - * - * The fill routine is now in place and I've put a button in for the pick - * colour/eyedropper tool so that I don't get asked to put in a function for - * like I continuously did with ACE. Due to the extra buttons I've had to - * shift some of the other buttons around to make them all fit onto the - * screen. It's probably not the best arrangement but if anyone comes up with - * a better layout I'm open to suggestions. - * - * The wierd button labelling problem I had last time has been corrected - the - * problem was traced back to the pixels routine in SMALFONT.C. Aen pointed - * out that I wasn't allocating space for the NULL terminator for all the - * strings so that has now been fixed (by adding 1 to strlen). - * - * - Ric - */ -/* - * Keys: - * CTRL/S + mouse click - (over edit window) Pick up colour under mouse - * SHIFT+mb down+drag mouse - select rectangle (select mode only) - * SPACEBAR - toggle between draw mode and select mode - * CTRL+Z or U - one level undo - * CTRL+A - select all - * CTRL+U - unselect all - * CTRL+C - copy selected area - * CTRL+X - cut selected area - * CTRL+V - paste - * DEL - clears selected area - * CTRL+R - reverts the tile to the original (like undo in maped 1) - * (self note: modify to ask for confirmation) - * G - toggles grid on/off - * H - toggles hilight on/off - * M - toggles mask on/off - * I - inverts mask - * X - mirrors image - * Y - flips image - * L/R - Rotates tile 90 degrees anti-clockwise/clockwise - * Q/W - Steps through animation (in tile edit mode) if any - * A/Z and S/X - changes the left or right drawing colours - * PGUP/PGDN - Colour shift up/down - * [ and ] - toggle screen resolutions - * ALT+X - quits to DOS - */ -/* -- 26/Jul/98 -- - * I've actually decided to start the editor over in a new file so that the - * code is a bit more elegant. As it stands some bits of this are messy but - * it currently works ;). Anyway I've decided that what I'll do is to in - * effect write two tile editors - continuing work on this one and working - * on the rewrite as a "side project". The eventual aim will be to replace - * this editor with the rewrite but if factors intervene preventing me from - * completing the rewrite then there'll always be this editor to fall back on. - * - * New in this release is a copy/cut/paste system. New buttons have been added. - * For some reason I haven't figured out yet I can't call the two rotate - * buttons "Rotate ACW" and "Rotate CW" (it causes MapEd to crash) so I've had - * to resort to calling them "Turn_L" and "Turn_R". - * - Ric - */ - -#include -#include - -#include "config.h" -#include "guicomp.h" -#include "keyboard.h" -#include "maped.h" -#include "mouse.h" -#include "render.h" -#include "vdriver.h" - -#include "smalfont.h" - -#undef free - -#define TRUE 1 -#define FALSE 0 -// #define NULL ((void *)0) - -#define MOUSENONE 0 // No mouse buttons pressed -#define MOUSERELEASE 1 // Mouse button released -#define MOUSEPRESSED 2 // Mouse button held down -#define MOUSECLICKED 4 // Mouse button pressed - -// Setup some defines for the regions/areas/windows where everything goes -#define MAX_REGIONS 29 // Number of regions -#define BASEREG 0 // Window coords + title -#define HELPBAR 1 // Helpbar - put helpful messages here :) -#define PALETTE 2 // The palette -#define EDITREG 3 // Main edit window -#define PREVIEW 4 // Preview of image being edited -#define SCOLBOX 5 // Selected colour box -#define SCTXTBX 6 // Text box to show info on the selected colours -#define QUITBUT 7 // Quit button -#define DRAWBUT 8 // Draw mode indicator -#define FILLBUT 9 // Fill mode indicator -#define PICKBUT 10 // Pick mode indicator -#define MASKBUT 11 // Mask mode indicator -#define PSTEBUT 12 // Paste mode indicator -#define EDMDFRM 13 // Frame for edit mode radio buttons -#define MASKIND 14 // Indicator showing if mask is shown -#define GRIDIND 15 // Indicator showing if grid is shown -#define ANIMIND 16 // Indicator showing if animations are shown -#define PXHLIND 17 // Indicator showing if pixel highlight shown -#define IND_FRM 18 // Frame for indicators (push buttons) -#define BUT_FRM 19 // Frame for buttons -#define UNDOBUT 20 // Undo button -#define COPYBUT 21 // Copy button -#define CUT_BUT 22 // Cut button -#define CLR_BUT 23 // Clear button -#define TOOLFRM 24 // Frame for tools -#define FLIPBUT 25 // Flip image button -#define MIRRBUT 26 // Mirror image button -#define RIACBUT 27 // Rotate anticlockwise button -#define RIC_BUT 28 // Rotate clockwise button - -// Define TEbitflags values -#define TEQUITCUR 1 -#define TEANIMATE 2 -#define TEGRID 4 -#define TEHILIGHT 8 -#define TESHOWMSK 16 - -// Define TEREGION->bitflags values -#define REGVISIBLE 1 -#define REGACTIVE 2 -#define REGNOCLICK 4 -#define REGTWOCLICK 8 // wait for a second click - -// TEeditmode defs -#define EDDRAW 1 -#define EDFILL 2 -#define EDPICK 4 -#define EDMASK 8 -#define EDPASTE 16 - -// TEtype defs -#define TEUNKNOWN 0 -#define TETILE 1 - -// DATABUTTON buttontypes: -#define CLICKBUTTON 1 // normal button -#define PUSHBUTTON 2 // can be pushed in/out (toggle bit bitvalue) -#define RADIOBUTTON 4 // for button banks (set *bitflag=bitvalue) - -// DATABASEREGION windowtypes: -#define DBRSTDWINDOW 0 // window and title bar -#define DBRPANEL 1 // no title bar - -// INFOTYPEs: -#define DITREGION 1 -#define DITBASEREGION 2 -#define DITBUTTON 4 -#define DITEDITREG 8 - -// Button flag action - has this button been clicked? -#define BFANONE 0 -#define BFAUNDO 1 -#define BFACOPY 2 -#define BFACUT 4 -#define BFACLEAR 8 -#define BFARIAC 16 -#define BFARIC 32 -#define BFAMIRROR 64 -#define BFAFLIP 128 - -// Variables -typedef struct TEREGION - { - int infotype; // type of struct - unsigned int x1, x2, y1, y2; // bounding coordinates - char *caption; // helpbar text - int bitflags; // see defines above - void (*drawproc)(struct TEREGION *); // region's draw procedure - // - allows nice and short RenderTileEdit proc ;) - void *data; // extended information - } TEREGION; -typedef struct DATABASEREGION - { - int infotype; // type of struct - int numofregs; // total number of regions (including base) - int windowtype; // type of window to draw - } DATABASEREGION; -typedef struct DATABUTTON - { - int infotype; // type of struct - int *bitflag; // address of bitflag - char *text; // addition text (eg helptext) - int bitvalue; // 1st bit/value - int buttontype; // type - } DATABUTTON; -typedef struct DATAEDITREG - { - int infotype; // type of struct - int firstx, firsty; // first coords for two-click operation - } DATAEDITREG; - - -static TEREGION *TEregs=NULL; // pointer to the regions -static unsigned char lcolor=255; // left mouse colour -static unsigned char rcolor=0; // right mouse colour -static TEREGION *TEOldReg=NULL; -static unsigned int MBStatus[3]={MOUSENONE,MOUSENONE,MOUSENONE}; -static int TEanimstrand=0; // Animation strand -static int TEbitflags=TEANIMATE; // Set default bitflags -static int TEbfa=BFANONE; // Set default button action flags -static int TEeditmode=EDDRAW; // Default edit region mode -static int TExoffs=16; // X offset for region "windows" -static int TEyoffs=16; // Y offset for region "windows" -unsigned int TEtype=TEUNKNOWN; // type of graphic being edited -unsigned int TEtile; // tile to edit - may possibly expand this to an array for simultaneous editing -unsigned int TExsize=0; // width of graphic being edited -unsigned int TEysize=0; // height of graphic being edited -unsigned int TEcopyxsize=0; // width of copy buffer -unsigned int TEcopyysize=0; // height of copy buffer -unsigned char *TEsource=NULL; // pointer to original image being edited -static unsigned char *TEimage=NULL; // pointer to image being edited -static unsigned char *TEmask=NULL; // pointer to image mask -static unsigned char *TEundo=NULL; // pointer to undo buffer -static unsigned char *TEcopy=NULL; // pointer to copy buffer -static unsigned char *TEcmsk=NULL; // pointer to copy mask -static char TEtempstr[256]; // Temporary string buffer - -// Function prototypes -static void *TEAlloc(unsigned long amount, char *whatfor); - -#define TEFree(ptr) if (ptr) free(ptr); ptr=NULL; -#define TEFreeReg(ptr) DestroyRegions(&ptr); if (ptr) free(ptr); ptr=NULL; -#define TENewText(text, whatfor) (char *) strcpy(TEAlloc(strlen(text)+1, whatfor), text); -//static void TEFree(void *TETmpBuf); -static void MBClickHandler(TEREGION *TEBaseReg); -static void AboutTE(void); -static void DestroyRegions(TEREGION **TEBaseReg); -static void SetupRegions(void); -static void InitTEImage(void); -static void DeinitTEImage(void); -static int MouseOverTEreg(TEREGION *TEr); -static void RenderTileEdit(TEREGION *TEBaseReg); -static void RestartTileEditor(void); -static void SetCaption(TEREGION *TEr, char *helptext); -static void TEDrawHilight(int x1, int y1, int width, int height, unsigned char colour); -static void TEDrawCheckeredBox(int x1, int y1, int width, int height, unsigned char colour); -static void TERegFill(TEREGION *TEr, int colour); -static void TERegText(TEREGION *TEr, char *message); -static void TEClearImage(void); -static void TECopyImage(void); -static void TEFlipImage(unsigned char *TERILsrc, int TERILxsize, int TERILysize); -static void TEMirrorImage(unsigned char *TERILsrc, int TERILxsize, int TERILysize); -static void TERotateImageAntiClockwise(unsigned char *TERILsrc, int TERILxsize, int TERILysize); -static void TERotateImageClockwise(unsigned char *TERILsrc, int TERILxsize, int TERILysize); -static void TEFillImage(char *TEFIimage, char *TEFImask, int TEFIxsize, int TEFIysize, int TEFIx, int TEFIy, char TEFIcolour); -static void TERFillImage(char *TERFIimage, char *TERFImask, int TERFIxsize, int TERFIysize, int TERFIx, int TERFIy); -static void TEShiftColours(char *TESCimage, char *TESCmask, int TESCxsize, int TESCysize, int amount); -static void TEUndo(void); -static void DrawButton(TEREGION *TEr); -static void DrawEditReg(TEREGION *TEr); -static void DrawHelpBar(TEREGION *TEr); -static void DrawPalette(TEREGION *TEr); -static void DrawPreview(TEREGION *TEr); -static void DrawSColBox(TEREGION *TEr); -static void DrawSCTxtBx(TEREGION *TEr); -static void DrawSunkRegion(TEREGION *TEr); -void TileEdit(void); - - -static int MouseOverTEreg(TEREGION *TEr) - { - unsigned int testx=mx-TExoffs; - unsigned int testy=my-TEyoffs; - unsigned int width=(TEr->x2)-(TEr->x1); - unsigned int height=(TEr->y2)-(TEr->y1); - testx-=(TEr->x1); - testy-=(TEr->y1); - - if (testx >= width || testy >= height) return FALSE; - return TRUE; - } - -static void DrawButton(TEREGION *TEr) -// -- ric: 20/Jul/98 - generic button routine - { - unsigned int x=TEr->x1+TExoffs; - unsigned int y=TEr->y1+TEyoffs; - unsigned int width=(TEr->x2)-(TEr->x1); - unsigned int height=(TEr->y2)-(TEr->y1); - - strcpy(TEtempstr,"Button data not declared."); - if (!TEr->data) - err(TEtempstr); - if (((struct DATABUTTON *)(TEr->data))->infotype!=DITBUTTON) - err(TEtempstr); - - // draw raised button - stdwindow(x-1, y-1, x+width+1, y+height+1); - if (TEr->caption) - { - GotoXY(x+(width-(pixels(TEr->caption)))/2, y+(height-6)/2); - printstring(TEr->caption); - } - switch (((struct DATABUTTON *)(TEr->data))->buttontype) - { - case CLICKBUTTON: - if (MouseOverTEreg(TEr) && TEr->bitflags®ACTIVE) - { - if (((struct DATABUTTON *)(TEr->data))->text) - SetCaption(&TEregs[HELPBAR], (((struct DATABUTTON *)(TEr->data))->text)); - - // Handle mouse clicks - if (TEOldReg==TEr) - { - if ((MBStatus[0]|MBStatus[1])==MOUSEPRESSED) - { - // draw button down - FilledBox(x, y, width, height, winbg); - HLine(x, y, width, darkw); - VLine(x, y, height, darkw); - if (TEr->caption) - { - GotoXY(x+1+(width-(pixels(TEr->caption)))/2, y+1+(height-6)/2); - printstring(TEr->caption); - } - } - if ((MBStatus[0]|MBStatus[1])==MOUSERELEASE) - { - *(((struct DATABUTTON *)(TEr->data))->bitflag)^=((struct DATABUTTON *)(TEr->data))->bitvalue; - } - } - } - break; - case PUSHBUTTON: - if (*(((struct DATABUTTON *)(TEr->data))->bitflag)&(((struct DATABUTTON *)(TEr->data))->bitvalue)) - { - // draw button down - FilledBox(x, y, width, height, winbg); - HLine(x, y, width, darkw); - VLine(x, y, height, darkw); - if (TEr->caption) - { - GotoXY(x+1+(width-(pixels(TEr->caption)))/2, y+1+(height-6)/2); - printstring(TEr->caption); - } - } - if (MouseOverTEreg(TEr) && TEr->bitflags®ACTIVE) - { - if (((struct DATABUTTON *)(TEr->data))->text) - { - sprintf(TEtempstr, "Toggle %s on/off", ((struct DATABUTTON *)(TEr->data))->text); - SetCaption(&TEregs[HELPBAR], TEtempstr); - } - - // Handle mouse clicks - if (TEOldReg==TEr) - { - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED) - { - *(((struct DATABUTTON *)(TEr->data))->bitflag)^=((struct DATABUTTON *)(TEr->data))->bitvalue; - } - } - } - break; - case RADIOBUTTON: - if (*(((struct DATABUTTON *)(TEr->data))->bitflag)==((struct DATABUTTON *)(TEr->data))->bitvalue) - { - // draw button down - FilledBox(x, y, width, height, winbg); - HLine(x, y, width, darkw); - VLine(x, y, height, darkw); - if (TEr->caption) - { - GotoXY(x+1+(width-(pixels(TEr->caption)))/2, y+1+(height-6)/2); - printstring(TEr->caption); - } - } - if (MouseOverTEreg(TEr) && TEr->bitflags®ACTIVE) - { - if (((struct DATABUTTON *)(TEr->data))->text) - SetCaption(&TEregs[HELPBAR], (((struct DATABUTTON *)(TEr->data))->text)); - - // Handle mouse clicks - if (TEOldReg==TEr) - { - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED) - { - *(((struct DATABUTTON *)(TEr->data))->bitflag)=((struct DATABUTTON *)(TEr->data))->bitvalue; - } - } - } - break; - } - } - -static void DrawSunkRegion(TEREGION *TEr) - { - unsigned int x=TEr->x1+TExoffs; - unsigned int y=TEr->y1+TEyoffs; - unsigned int width=(TEr->x2)-(TEr->x1); - unsigned int height=(TEr->y2)-(TEr->y1); - -// FilledBox(x, y, width, height, black); - HLine(x, y, width, darkw); - VLine(x, y, height, darkw); - HLine(x+1, y+height-1, width-1, brightw); - VLine(x+width-1, y+1, height-1, brightw); - } - -static void DrawEditReg(TEREGION *TEr) - { - int i,j,i2,j2,c; - int minx,miny,maxx,maxy; - int blocksize=8; - int visblocksize=blocksize; - char *img; - TEREGION tempr; - tempr.x1=TEr->x1+2; - tempr.x2=TEr->x2-2; - tempr.y1=TEr->y1+2; - tempr.y2=TEr->y2-2; - - img=TEimage; //vsp+(256*TEtile); - - TERegFill(TEr, black); - DrawSunkRegion(TEr); - FilledBox(TEr->x1+TExoffs+2, TEr->y1+TEyoffs+2, (blocksize<<4), (blocksize<<4), titlebg); - - if (TEbitflags&TEGRID) visblocksize-=1; - - for (j=0; jx1+TExoffs+2+i*blocksize, TEr->y1+TEyoffs+2+j*blocksize, visblocksize, visblocksize, *img++); - if (TEbitflags&TESHOWMSK && !TEmask[j*TExsize+i]) - TEDrawCheckeredBox(TEr->x1+TExoffs+2+i*blocksize, TEr->y1+TEyoffs+2+j*blocksize, visblocksize, visblocksize, titlebg); - } - - img=TEimage; - if (TEr->bitflags®ACTIVE && !(MouseOverTEreg(&tempr)) && (MBStatus[0]|MBStatus[1])==MOUSERELEASE) - if (TEr->bitflags®TWOCLICK) TEr->bitflags^=REGTWOCLICK; - if (MouseOverTEreg(&tempr) && TEr->bitflags®ACTIVE) - { - i=(mx-TExoffs-(tempr.x1))/blocksize; - j=(my-TEyoffs-(tempr.y1))/blocksize; - c=img[(j*TExsize)+i]; - sprintf(TEtempstr, "Tile: %d, (%02d, %02d), Color: %03d (rgb: %03d/%03d/%03d)", TEtile, i, j, c, pal[(c*3)], pal[(c*3)+1], pal[(c*3)+2]); - SetCaption(&TEregs[HELPBAR], TEtempstr); - if (TEbitflags&TEHILIGHT) - TEDrawHilight(TExoffs+i*blocksize+tempr.x1, TEyoffs+j*blocksize+tempr.y1, visblocksize, visblocksize, white); - - // if pasting draw the image being pasted - if (TEeditmode==EDPASTE) - { - for (j2=0; j2x1+TExoffs+2+(i+i2)*blocksize, TEr->y1+TEyoffs+2+(j+j2)*blocksize, visblocksize, visblocksize, TEcopy[j2*TEcopyxsize+i2]); - else - if (TEmask[(j+j2)*TExsize+i+i2]) - FilledBox(TEr->x1+TExoffs+2+(i+i2)*blocksize, TEr->y1+TEyoffs+2+(j+j2)*blocksize, visblocksize, visblocksize, TEcopy[j2*TEcopyxsize+i2]); - } - if (TEeditmode==EDMASK) - { - // draw reg - if (TEr->bitflags®TWOCLICK) - for (j2=0; j2=j && j2<=((struct DATAEDITREG *)(TEr->data))->firsty) || - (j2>=((struct DATAEDITREG *)(TEr->data))->firsty && j2<=j)) && - ((i2>=i && i2<=((struct DATAEDITREG *)(TEr->data))->firstx) || - (i2>=((struct DATAEDITREG *)(TEr->data))->firstx && i2<=i))) - TEDrawCheckeredBox(TEr->x1+TExoffs+2+i2*blocksize, TEr->y1+TEyoffs+2+j2*blocksize, visblocksize, visblocksize, darkred); - - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED && (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) && !(TEr->bitflags®TWOCLICK)) - { - ((struct DATAEDITREG *)(TEr->data))->firstx=i; - ((struct DATAEDITREG *)(TEr->data))->firsty=j; - TEr->bitflags^=REGTWOCLICK; - } - if ((MBStatus[0]|MBStatus[1])==MOUSERELEASE && TEr->bitflags®TWOCLICK) - { - if (MBStatus[1]==MOUSERELEASE) c=0x0; - else c=0xf; - miny=j; - maxy=((struct DATAEDITREG *)(TEr->data))->firsty; - minx=i; - maxx=((struct DATAEDITREG *)(TEr->data))->firstx; - if (j>((struct DATAEDITREG *)(TEr->data))->firsty) - { - maxy=j; - miny=((struct DATAEDITREG *)(TEr->data))->firsty; - } - if (i>((struct DATAEDITREG *)(TEr->data))->firstx) - { - maxx=i; - minx=((struct DATAEDITREG *)(TEr->data))->firstx; - } - for (j2=miny; j2<=maxy; j2++) - for (i2=minx; i2<=maxx; i2++) - TEmask[j2*TExsize+i2]=(char)c; - TEr->bitflags^=REGTWOCLICK; - } - } - // Handle mouse clicks - -#ifdef JUNK - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED && (key[SCAN_CTRL]||key[SCAN_S])) - { - // put code to lock out draw mode here - } -#endif - if (TEOldReg==TEr) - { - // Update undo buffer - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED && TEeditmode!=EDMASK && TEeditmode!=EDPICK && !(key[SCAN_CTRL]||key[SCAN_S])) - memcpy(TEundo, TEimage, TExsize*TEysize); - if (MBStatus[0]==MOUSECLICKED && TEeditmode==EDFILL) - TEFillImage(TEimage, (TEbitflags&TESHOWMSK ? TEmask : NULL), TExsize, TEysize, i, j, lcolor); - if (MBStatus[1]==MOUSECLICKED && TEeditmode==EDFILL) - TEFillImage(TEimage, (TEbitflags&TESHOWMSK ? TEmask : NULL), TExsize, TEysize, i, j, rcolor); - - // Draw - if ((MBStatus[0]|MBStatus[1])==MOUSEPRESSED) - { - if (TEeditmode==EDPASTE) - { - for (j2=0; j2bitflags®TWOCLICK)) - TEmask[(j*TExsize)+i]=0xf; - if (MBStatus[1]==MOUSEPRESSED) - if (key[SCAN_CTRL]||key[SCAN_S]||(TEeditmode==EDPICK)) - rcolor=TEimage[(j*TExsize)+i]; - else - if ((TEeditmode==EDDRAW)&&!(TEbitflags&TESHOWMSK && !TEmask[j*TExsize+i])) - TEimage[(j*TExsize)+i]=rcolor; - else - if (TEeditmode==EDMASK && !(TEr->bitflags®TWOCLICK)) - TEmask[(j*TExsize)+i]=0x0; - } - } - } - -static void DrawHelpBar(TEREGION *TEr) - { - //int i, htext=0; - TERegFill(TEr, black); - DrawSunkRegion(TEr); - if (TEr->caption) TERegText(TEr, TEr->caption); - TEFree(TEr->caption); // Blank caption - //TEr->caption=NULL; // why doesn't this work in TEFree? -#ifdef JUNK - i=MAX_REGIONS; - do - { - i--; - if (MouseOverTEreg(&TEregs[i])) htext=i; - } while (i>0); - if (htext && TEregs[htext].helptext) TERegText(TEr, TEr->caption); -#endif - } - -static void DrawPalette(TEREGION *TEr) - { - int i,j; - unsigned int width=(TEr->x2)-(TEr->x1); - unsigned int height=(TEr->y2)-(TEr->y1); - int xscale=(width-4)>>6; - int yscale=(height-4)>>2; - int x=(TEr->x1)+TExoffs; - int y=(TEr->y1)+TEyoffs; - TEREGION tempr; - tempr.x1=TEr->x1+2; - tempr.x2=TEr->x2-2; - tempr.y1=TEr->y1+2; - tempr.y2=TEr->y2-2; - - x+=2; - y+=2; - TERegFill(TEr, black); - DrawSunkRegion(TEr); - i=64; - do - { - i--; - FilledBox(x+(i*xscale), y, xscale, yscale, i); - FilledBox(x+(i*xscale), y+yscale, xscale, yscale, i+64); - FilledBox(x+(i*xscale), y+yscale*2, xscale, yscale, i+128); - FilledBox(x+(i*xscale), y+yscale*3, xscale, yscale, i+192); - } while (i>0); - - i=lcolor&63; - j=lcolor>>6; - TEDrawHilight(x+i*xscale, y+j*yscale, xscale, yscale, titlebg); - - i=rcolor&63; - j=rcolor>>6; - TEDrawHilight(x+i*xscale, y+j*yscale, xscale, yscale, titlebg); - - if (MouseOverTEreg(&tempr) && TEr->bitflags®ACTIVE) - { - i=(mx-TExoffs-(tempr.x1))/xscale; - j=(my-TExoffs-(tempr.y1))/yscale; - i+=(j<<6); - j=i*3; - sprintf(TEtempstr, "Color: %03d (rgb: %03d/%03d/%03d)", i, pal[j], pal[j+1], pal[j+2]); - SetCaption(&TEregs[HELPBAR], TEtempstr); - // Handle mouse clicks - if (TEOldReg==TEr) - { - if (MBStatus[0]==MOUSEPRESSED) lcolor=i; - if (MBStatus[1]==MOUSEPRESSED) rcolor=i; - } - } - } - -static void DrawPreview(TEREGION *TEr) - { - char *img; - int i; - TERegFill(TEr, black); - DrawSunkRegion(TEr); -// img=vsp+(256*TEtile); - img=TEimage; - i=tileidx[TEtile]; - if ((TEbitflags&TEANIMATE) && i!=TEtile) img=vsp+(256*i); - CopyTile(TEr->x1+TExoffs+2, TEr->y1+TEyoffs+2, img); - - if (MouseOverTEreg(TEr) && TEr->bitflags®ACTIVE) - { - strcpy(TEtempstr, (TEbitflags&TEANIMATE ? "Click to halt animation" : "Click to animate tile")); - SetCaption(&TEregs[HELPBAR], TEtempstr); - - // Handle mouse clicks - if (TEOldReg==TEr) - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED && MouseOverTEreg(TEr)) - TEbitflags^=TEANIMATE; - } - } - -static void DrawSColBox(TEREGION *TEr) -// -- ric: 15/Jul/98 - Draw selected colour box - { - int halfwidth=TEr->x2-TEr->x1-4; - int height=TEr->y2-TEr->y1-4; - char DSCBtempcolor; - TERegFill(TEr, black); - DrawSunkRegion(TEr); - FilledBox(TExoffs+2+TEr->x1, TEyoffs+2+TEr->y1, halfwidth, height, titlebg); - height-=2; - halfwidth-=2; - halfwidth>>=1; - FilledBox(TExoffs+3+TEr->x1, TEyoffs+3+TEr->y1, halfwidth, height, lcolor); - FilledBox(TExoffs+3+TEr->x1+halfwidth, TEyoffs+3+TEr->y1, halfwidth, height, rcolor); - - if (MouseOverTEreg(TEr) && TEr->bitflags®ACTIVE) - { - strcpy(TEtempstr, "Click to swap colors"); - SetCaption(&TEregs[HELPBAR], TEtempstr); - - // Handle mouse clicks - if (TEOldReg==TEr) - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED && MouseOverTEreg(TEr)) - { - DSCBtempcolor=lcolor; - lcolor=rcolor; - rcolor=DSCBtempcolor; - } - } - } - -static void DrawSCTxtBx(TEREGION *TEr) -// -- ric: 15/Jul/98 - Draw selected colour text box - { -// char DSCTBTextBuf[256]; - int i; - int DSCTBx=TEr->x1+TExoffs+2; - int DSCTBy=TEr->y1+TEyoffs+2; - TERegFill(TEr, black); - DrawSunkRegion(TEr); - i=lcolor*3; - sprintf(TEtempstr, "Left: %03d (rgb: %03d/%03d/%03d)", lcolor, pal[i], pal[i+1], pal[i+2]); - GotoXY(DSCTBx, DSCTBy); - printstring(TEtempstr); - i=rcolor*3; - sprintf(TEtempstr, "Right: %03d (rgb: %03d/%03d/%03d)", rcolor, pal[i], pal[i+1], pal[i+2]); - GotoXY(DSCTBx, DSCTBy+7); - printstring(TEtempstr); - } - -static void SetCaption(TEREGION *TEr, char *helptext) - { - TEFree(TEr->caption); - TEr->caption=(char *)strcpy((char *)TEAlloc(strlen(helptext)+1,helptext), helptext); - } - -static void TEDrawHilight(int x1, int y1, int width, int height, unsigned char colour) -// -- ric: 15/Jul/98 - Draws hilight around given rectangle - { - VLine(x1-1, y1, height, colour); - VLine(x1+width, y1, height, colour); - HLine(x1-1, y1-1, width+2, colour); - HLine(x1-1, y1+height, width+2, colour); - } - -static void TEDrawCheckeredBox(int x1, int y1, int width, int height, unsigned char colour) -// -- ric: 17/Jul/98 - Draws a checkered box - { - int i,j; - unsigned char c; - for (j=0; j-1) - FilledBox(TEr->x1+TExoffs, TEr->y1+TEyoffs, (TEr->x2)-(TEr->x1), (TEr->y2)-(TEr->y1), colour); - } - -static void TERegText(TEREGION *TEr, char *message) -// Prints given message in the specified region - { - int tempx, tempy; - tempx=(TEr->x1)+TExoffs+2; - - tempy=(TEr->y2)-(TEr->y1); - tempy>>=1; - tempy+=(TEr->y1)-3; - - GotoXY(tempx,tempy+TEyoffs); - printstring(message); - - } - -static void TEClearImage(void) -// -- ric: 26/Jul/98 - clear selected image - { - int j; - if (TEbitflags&TESHOWMSK) - { - j=TEysize*TExsize; - memcpy(TEundo, TEimage, j); // backup image to undo buffer - do - { - j--; - if (*(TEmask+j)) *(TEimage+j)=rcolor; - } while (j>0); - } - } - -static void TECopyImage(void) -// -- ric: 26/Jul/98 - copy selected image to copy buffer - { - int i, j, TECIxstart, TECIystart, TECIxsize, TECIysize; - if (TEbitflags&TESHOWMSK) // only makes sense if selected region is shown - { - TECIxstart=TExsize; - TECIystart=TEysize; - TECIxsize=-1; - TECIysize=-1; - // loop through image to find the starting and ending x and y coords - // of the image to copy - for (j=0; jTECIxsize) TECIxsize=i; - if (jTECIysize) TECIysize=j; - } - } - - TECIxsize-=TECIxstart-1; - TECIysize-=TECIystart-1; - - if (TECIxsize>0 && TECIysize>0) - { - // free and create TEcopy and TEcmsk buffers - TEFree(TEcopy); - TEFree(TEcmsk); - - // make copy buffer square (allows for rotation) - TEcopyxsize=TECIysize; - TEcopyysize=TECIysize; - if (TECIxsize>TECIysize) - { - TEcopyxsize=TECIxsize; - TEcopyysize=TECIxsize; - } - TEcopy=(char *)TEAlloc(TEcopyxsize*TEcopyysize, "copy buffer"); - TEcmsk=(char *)TEAlloc(TEcopyxsize*TEcopyysize, "copy mask"); - - // copy image into buffer - for (j=0; j0); - } while (j>0); - TEFree(TERILimg); - } - } - -static void TERotateImageClockwise(unsigned char *TERILsrc, int TERILxsize, int TERILysize) -// -- ric: 16/Jul/98 - rotates image (must be square) 90 degrees clockwise - { - unsigned char *TERILimg=NULL; - int i, j, amount; - if (TERILxsize==TERILysize) - { - amount=TERILxsize*TERILysize; - TERILimg=(char *) TEAlloc(amount, "temporary image buffer for TERotateImageClockwise"); - memcpy(TERILimg, TERILsrc, amount); - j=TERILysize; - do - { - j--; - i=TERILxsize; - do - { - i--; - TERILsrc[(j*TERILxsize)+i]=TERILimg[((TERILxsize-1-i)*TERILxsize)+(j)]; - } while (i>0); - } while (j>0); - TEFree(TERILimg); - } - } - -static void TEFlipImage(unsigned char *TERILsrc, int TERILxsize, int TERILysize) -// -- ric: 15/Jul/98 - flips image - { - unsigned char *TERILimg=NULL; - int i, j, amount; - amount=TERILxsize*TERILysize; - TERILimg=(char *) TEAlloc(amount, "temporary image buffer for TEFlipImage"); - memcpy(TERILimg, TERILsrc, amount); - j=TERILysize; - do - { - j--; - i=TERILxsize; - do - { - i--; - TERILsrc[(j*TERILxsize)+i]=TERILimg[((TERILysize-1-j)*TERILxsize)+i]; - } while (i>0); - } while (j>0); - TEFree(TERILimg); - } - -static void TEMirrorImage(unsigned char *TERILsrc, int TERILxsize, int TERILysize) -// -- ric: 15/Jul/98 - mirrors image - { - unsigned char *TERILimg=NULL; - int i, j, amount; - amount=TERILxsize*TERILysize; - TERILimg=(char *) TEAlloc(amount, "temporary image buffer for TEMirrorImage"); - memcpy(TERILimg, TERILsrc, amount); - j=TERILysize; - do - { - j--; - i=TERILxsize; - do - { - i--; - TERILsrc[(j*TERILxsize)+i]=TERILimg[(j*TERILxsize)+(TERILxsize-1-i)]; - } while (i>0); - } while (j>0); - TEFree(TERILimg); - } - -static void TEFillImage(char *TEFIimage, char *TEFImask, int TEFIxsize, int TEFIysize, int TEFIx, int TEFIy, char TEFIcolour) -// -- ric: 29/Jul/98 - Fill procedure - sets up and calls recursive procedure below - { - int i,j; - unsigned char *TEFIfillmask=NULL; // will eventually contain 0 for ignore and 1 for fill - TEFIfillmask=(char *) TEAlloc(TEFIxsize*TEFIysize, "temporary fill buffer for TEFillImage"); - TERFillImage(TEFIimage, TEFIfillmask, TEFIxsize, TEFIysize, TEFIx, TEFIy); - - if (TEFImask) - for (j=0; j=0 && x=0 && y=0 && x=0 && y=0 && x=0 && y=0 && x=0 && y0); - } while (j>0); - } - - -static void TEUndo (void) - { - unsigned char *tempimg=TEimage; - TEimage=TEundo; - TEundo=tempimg; - } - -static void *TEAlloc(unsigned long amount, char *whatfor) -// -- ric: 14/Jul/98 - TE's custom, error-handling memory allocation routine - { - char *TETmpBuf=NULL; - - amount += 3; // aen - amount &= ~3; - -// static char DebugBuf[256]; - TETmpBuf=(char *) malloc(amount); - if (!TETmpBuf) - { - sprintf(TEtempstr, "Unable to allocate %ld bytes for %s.", amount, whatfor); - err(TEtempstr); - } - memset(TETmpBuf,0, amount); // Clear allocated mem - /* - __asm { // aen - mov edi,TETmpBuf - mov ecx,amount - shr ecx,2 - xor eax,eax - cld - rep stosd - } ; - */ - return TETmpBuf; - } - -#ifdef JUNK -static void TEFree(void *TETmpBuf) -// -- ric: 14/Jul/98 - TE's custom memory freeing routine - { - if (TETmpBuf) free(TETmpBuf); // Only free memory if previously allocated - TETmpBuf=NULL; // Set freed memory to point to NULL - } -#endif - -static void MBClickHandler(TEREGION *TEBaseReg) -// -- ric: 20/Jul/98 - Mouse button click handler - { - int i,j; - ReadMouse(); - if (TEBaseReg) - { - if (!TEBaseReg->data) err("No region data defined."); - if (((struct DATABASEREGION *)TEBaseReg->data)->infotype!=DITBASEREGION) - err("MBClickHandler called with invalid base region."); - } - - for (i=0; i<3; ++i) - { - if (mb & (i+1)) - { - if (MBStatus[i] == MOUSECLICKED) - MBStatus[i]=MOUSEPRESSED; - else if (MBStatus[i] == MOUSENONE) - { - MBStatus[i] = MOUSECLICKED; - if (TEBaseReg) - { - TEOldReg = NULL; - for (j=0; j<((struct DATABASEREGION *)TEBaseReg->data)->numofregs; ++j) - if (MouseOverTEreg(TEBaseReg+j)&&!((TEBaseReg+j)->bitflags®NOCLICK)) - TEOldReg = TEBaseReg+j; - } - } - } - else - { - if (MBStatus[i] <= MOUSERELEASE) - MBStatus[i] = MOUSENONE; - else if (MBStatus[i]>MOUSERELEASE) - MBStatus[i] = MOUSERELEASE; - } - } - } - -static void AboutTE (void) -// Just here to test the mouse input loop - remove this later - { - TEREGION *TEr=NULL; - TEREGION *TEaboutwin=NULL; -// int amxsize=150, amysize=82; - int amxofs=60, amyofs=60; - int i,i2,j,j2; - int QuitAW=FALSE; - int moving=FALSE; - - // Allocate memory - TEaboutwin=(struct TEREGION *) TEAlloc((sizeof (struct TEREGION))*4,"about window regions"); - TEr=TEaboutwin; - TEr->infotype=DITREGION; - TEr->x1=amxofs; - TEr->x2=TEr->x1+150; - TEr->y1=amyofs; - TEr->y2=TEr->y1+82; - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; -// TEr->drawproc=NULL; - sprintf(strbuf, "About MapEd %s Tile Editor", ME2_VERSION); - TEr->caption=TENewText(strbuf, "About window"); - TEr->data=(struct DATABASEREGION *) TEAlloc(sizeof (struct DATABASEREGION), "base region data"); - ((struct DATABASEREGION *)(TEr->data))->infotype=DITBASEREGION; - ((struct DATABASEREGION *)(TEr->data))->numofregs=4; - ((struct DATABASEREGION *)(TEr->data))->windowtype=DBRSTDWINDOW; - - TEr+=1; - TEr->infotype=DITREGION; - TEr->x1=0; - TEr->x2=TEaboutwin->x2-TEaboutwin->x1-9; - TEr->y1=0; - TEr->y2=8; - TEr->bitflags=REGACTIVE; -// TEr->drawproc=NULL; -// TEr->caption=NULL; - - TEr+=1; - TEr->infotype=DITREGION; - TEr->x1=TEaboutwin->x2-TEaboutwin->x1-9; - TEr->x2=TEaboutwin->x2-TEaboutwin->x1-3; - TEr->y1=3; - TEr->y2=6; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; -// TEr->caption=NULL; - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "quit button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=NULL; - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&QuitAW; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TRUE; - - TEr+=1; - TEr->infotype=DITREGION; - TEr->x1=60; - TEr->x2=90; - TEr->y1=62; - TEr->y2=72; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=TENewText("ok","ok button caption"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "quit button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=NULL; - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&QuitAW; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TRUE; - TEr=TEaboutwin+1; // point to title bar area - - while (!QuitAW) - { - // Mouse button click handler routines - MBClickHandler(TEaboutwin); - - amxofs=TEaboutwin->x1; - amyofs=TEaboutwin->y1; - if ((MBStatus[0]|MBStatus[1])==MOUSERELEASE) - moving=FALSE; - - // Draw loop - RenderTileEdit(TEregs); - RenderTileEdit(TEaboutwin); - - sprintf(strbuf, "MapEd v.%s", ME2_VERSION); - GotoXY(amxofs+52, amyofs+16); printstring(strbuf); - GotoXY(amxofs+31, amyofs+22); printstring("Copyright (C) 1998 vecna"); - GotoXY(amxofs+40, amyofs+28); printstring("All Rights Reserved"); - sprintf(strbuf, "MapEd v.%s Tile Editor", ME2_VERSION); - GotoXY(amxofs+29, amyofs+41); printstring(strbuf); - GotoXY(amxofs+20, amyofs+47); printstring("Additional code by Richard Lau"); - DrawMouse(); - ShowPage(); - - // Move window? - if (MouseOverTEreg(TEr) && TEOldReg==TEr) - { - if ((MBStatus[0]|MBStatus[1])==MOUSECLICKED) - { - i2=TEaboutwin->x2-TEaboutwin->x1; - j2=TEaboutwin->y2-TEaboutwin->y1; - i=mx-TEaboutwin->x1; - j=my-TEaboutwin->y1; - moving=TRUE; - } - } - if ((MBStatus[0]|MBStatus[1])==MOUSEPRESSED && moving) - { - if (((mx-i)<16)) TEaboutwin->x1=16; - else if (((mx-i+i2)>=(16+sx))) TEaboutwin->x1=16+(sx-i2); - else TEaboutwin->x1=mx-i; - if (((my-j)<16)) TEaboutwin->y1=16; - else if (((my-j+j2)>=(16+sy))) TEaboutwin->y1=16+(sy-j2); - else TEaboutwin->y1=my-j; - TEaboutwin->x2=TEaboutwin->x1+i2; - TEaboutwin->y2=TEaboutwin->y1+j2; - } - - if (key[SCAN_ESC]) - { - key[SCAN_ESC]=0; - QuitAW=TRUE; - } - - } - // free TEaboutwin - TEFreeReg(TEaboutwin); - } - -static void RestartTileEditor(void) -// -- ric: 17/Jul/98 - reinit the tile editor - { - int i,j, amount; - unsigned char *TERTEmask=NULL; - - switch (TEtype) - { - case TETILE: // edit tile TEtile - i=TExsize; - j=TEysize; - amount=i*j; - TERTEmask=(unsigned char *) TEAlloc(amount, "tile editor mask backup buffer"); - - // backup mask - memcpy(TERTEmask, TEmask, amount); - - // Restart editor - DeinitTEImage(); - TEFreeReg(TEregs); - TEtype=TETILE; - TExsize=i; - TEysize=j; - TEsource=vsp+(256*TEtile); - InitTEImage(); - SetupRegions(); - - // Restore mask - memcpy(TEmask, TERTEmask, amount); - TEFree(TERTEmask); - break; - } - } - -static void InitTEImage (void) -// Copy the image data being edited and allocate memory for the image buffers - { - int i; - int amount=TExsize*TEysize; - if (TEtype==TEUNKNOWN) err("Unrecognised tile editor graphics type."); - if (!TEsource) err("Invalid input image."); - TEimage=(unsigned char *) TEAlloc(amount, "tile editor image buffer"); - TEmask=(unsigned char *) TEAlloc(amount, "tile editor mask buffer"); - TEundo=(unsigned char *) TEAlloc(amount, "tile editor undo buffer"); -// if (!TEimage || !TEundo) err("Cannot allocate memory for tile editor image buffers."); - memcpy(TEimage, TEsource, amount); // copy original image into edit buffer - memcpy(TEundo, TEimage, amount); // copy original image into undo buffer - - // if editing tile find the animation strand (if any) tile belongs to - TEanimstrand=0; // Does not belong to an animation strand - if (TEtype==TETILE) - { - i=100; - do - { - i--; - if (vspanim[i].delay && TEtile<=vspanim[i].finish && TEtile>=vspanim[i].start) - TEanimstrand=i+1; - } while (i>0); - } - } - -static void DeinitTEImage(void) -// Unallocate allocated image buffers - copy edited buffer into original - { - memcpy(TEsource, TEimage, (TExsize*TEysize)); - TEFree(TEimage); - TEFree(TEmask); - TEFree(TEundo); - TEtype=TEUNKNOWN; // Clear type info for error checking purposes - TExsize=0; - TEysize=0; - } - -static void SetupRegions (void) - { - int temp; - TEREGION *TEr=NULL; - - // Allocate memory - TEregs=(struct TEREGION *) TEAlloc((sizeof (struct TEREGION))*MAX_REGIONS,"tile edit regions"); - - TEr=TEregs+BASEREG; - TEr->infotype=DITREGION; - TEr->x1=16; - TEr->x2=TEr->x1+sx; - TEr->y1=16; - TEr->y2=TEr->y1+sy; - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=NULL; - TEr->caption=NULL; - switch (TEtype) - { - case TETILE: - sprintf(TEtempstr, "MapEd %s Tile Editor - Tile: %d", ME2_VERSION, TEtile); - if (TEanimstrand) - sprintf(TEtempstr, "MapEd %s Tile Editor - Tile: %d (anim strand: %d, frame: %d/%d)", - ME2_VERSION, - TEtile, TEanimstrand-1, TEtile-vspanim[TEanimstrand-1].start+1, - vspanim[TEanimstrand-1].finish-vspanim[TEanimstrand-1].start+1); - SetCaption(TEr, TEtempstr); - break; - } - TEr->data=(struct DATABASEREGION *) TEAlloc(sizeof (struct DATABASEREGION), "base region data"); - ((struct DATABASEREGION *)(TEr->data))->infotype=DITBASEREGION; - ((struct DATABASEREGION *)(TEr->data))->numofregs=MAX_REGIONS; - ((struct DATABASEREGION *)(TEr->data))->windowtype=DBRSTDWINDOW; - - TEr=TEregs+HELPBAR; - TEr->infotype=DITREGION; - TEr->x1=3; - TEr->x2=TEregs->x2-TEregs->x1-3; - TEr->y1=TEregs->y2-TEregs->y1-13; - TEr->y2=TEregs->y2-TEregs->y1-3; - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=&DrawHelpBar; - TEr->caption=NULL; - TEr->data=NULL; - - temp=(((TEregs->x2-TEregs->x1-8)>>6)<<5)+2; - TEr=TEregs+PALETTE; - TEr->infotype=DITREGION; - TEr->x1=((TEregs->x2-TEregs->x1)>>1)-temp; - TEr->x2=((TEregs->x2-TEregs->x1)>>1)+temp; - TEr->y1=TEregs->y2-TEregs->y1-36; - TEr->y2=TEregs->y2-TEregs->y1-16; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawPalette; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+EDITREG; - TEr->infotype=DITREGION; - TEr->x1=3; - TEr->x2=3+128+4; - TEr->y1=10; - TEr->y2=10+128+4; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawEditReg; - TEr->caption=NULL; - TEr->data=(struct DATAEDITREG *) TEAlloc(sizeof (struct DATAEDITREG), "edit region data"); - ((struct DATAEDITREG *)(TEr->data))->infotype=DITEDITREG; - - TEr=TEregs+PREVIEW; - TEr->infotype=DITREGION; - TEr->x1=TEregs->x2-TEregs->x1-23; - TEr->x2=TEregs->x2-TEregs->x1-3; - TEr->y1=10; - TEr->y2=10+20; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawPreview; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+SCOLBOX; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDITREG].x1; - TEr->x2=TEr->x1+20; - TEr->y1=TEregs[EDITREG].y2+2; - TEr->y2=TEr->y1+16; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawSColBox; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+SCTXTBX; - TEr->infotype=DITREGION; - TEr->x1=TEregs[SCOLBOX].x2+2; - TEr->x2=TEregs[EDITREG].x2; - TEr->y1=TEregs[SCOLBOX].y1; - TEr->y2=TEregs[SCOLBOX].y2; - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=&DrawSCTxtBx; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+QUITBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs->x2-TEregs->x1-9; - TEr->x2=TEregs->x2-TEregs->x1-3; - TEr->y1=3; - TEr->y2=6; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "quit button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Exit", "quit button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbitflags; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TEQUITCUR; - - TEr=TEregs+EDMDFRM; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDITREG].x2+3; - TEr->x2=TEr->x1+34; - TEr->y1=TEregs[EDITREG].y1; - TEr->y2=TEr->y1+11*5+3; // 10*number of buttons - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=&DrawSunkRegion; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+DRAWBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDMDFRM].x1+2; - TEr->x2=TEregs[EDMDFRM].x2-2; - TEr->y1=TEregs[EDMDFRM].y1+2; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"Draw"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "draw button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Draw mode", "draw button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=RADIOBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEeditmode; - ((struct DATABUTTON *)(TEr->data))->bitvalue=EDDRAW; - - TEr=TEregs+FILLBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDMDFRM].x1+2; - TEr->x2=TEregs[EDMDFRM].x2-2; - TEr->y1=TEregs[EDMDFRM].y1+2+11; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"Fill"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "fill button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Fill mode", "fill button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=RADIOBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEeditmode; - ((struct DATABUTTON *)(TEr->data))->bitvalue=EDFILL; - - TEr=TEregs+PICKBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDMDFRM].x1+2; - TEr->x2=TEregs[EDMDFRM].x2-2; - TEr->y1=TEregs[EDMDFRM].y1+2+22; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"Pick"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "pick button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Pick color mode", "pick button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=RADIOBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEeditmode; - ((struct DATABUTTON *)(TEr->data))->bitvalue=EDPICK; - - TEr=TEregs+MASKBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDMDFRM].x1+2; - TEr->x2=TEregs[EDMDFRM].x2-2; - TEr->y1=TEregs[EDMDFRM].y1+2+33; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"Select"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "select button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Select mode", "select button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=RADIOBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEeditmode; - ((struct DATABUTTON *)(TEr->data))->bitvalue=EDMASK; - - TEr=TEregs+PSTEBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDMDFRM].x1+2; - TEr->x2=TEregs[EDMDFRM].x2-2; - TEr->y1=TEregs[EDMDFRM].y1+2+44; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"Paste"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "paste button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Paste mode", "paste button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=RADIOBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEeditmode; - ((struct DATABUTTON *)(TEr->data))->bitvalue=EDPASTE; - - TEr=TEregs+IND_FRM; - TEr->infotype=DITREGION; - TEr->x1=TEregs[SCTXTBX].x2+2; - TEr->x2=TEr->x1+12*4-1; // 10*number of buttons - TEr->y1=TEregs[SCTXTBX].y1; - TEr->y2=TEr->y1+13; - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=&DrawSunkRegion; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+MASKIND; - TEr->infotype=DITREGION; - TEr->x1=TEregs[IND_FRM].x1+2; - TEr->x2=TEr->x1+10; - TEr->y1=TEregs[IND_FRM].y1+2; - TEr->y2=TEregs[IND_FRM].y2-2; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"m"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "mask indicator data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("mask", "mask indicator text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=PUSHBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbitflags; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TESHOWMSK; - - TEr=TEregs+GRIDIND; - TEr->infotype=DITREGION; - TEr->x1=TEregs[MASKIND].x2+1; - TEr->x2=TEr->x1+10; - TEr->y1=TEregs[IND_FRM].y1+2; - TEr->y2=TEregs[IND_FRM].y2-2; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"g"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "grid button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("grid", "grid indicator text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=PUSHBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbitflags; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TEGRID; - - TEr=TEregs+ANIMIND; - TEr->infotype=DITREGION; - TEr->x1=TEregs[GRIDIND].x2+1; - TEr->x2=TEr->x1+10; - TEr->y1=TEregs[IND_FRM].y1+2; - TEr->y2=TEregs[IND_FRM].y2-2; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"a"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "animation button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("animation", "animation indicator text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=PUSHBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbitflags; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TEANIMATE; - - TEr=TEregs+PXHLIND; - TEr->infotype=DITREGION; - TEr->x1=TEregs[ANIMIND].x2+1; - TEr->x2=TEr->x1+10; - TEr->y1=TEregs[IND_FRM].y1+2; - TEr->y2=TEregs[IND_FRM].y2-2; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr,"h"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "highlight button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("pixel highlight", "highlight indicator text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=PUSHBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbitflags; - ((struct DATABUTTON *)(TEr->data))->bitvalue=TEHILIGHT; - - TEr=TEregs+BUT_FRM; - TEr->infotype=DITREGION; - TEr->x1=TEregs[EDMDFRM].x1; - TEr->x2=TEregs[EDMDFRM].x2; - TEr->y1=TEregs[EDMDFRM].y2+2; - TEr->y2=TEr->y1+11*4+3; // 10*number of buttons - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=&DrawSunkRegion; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+UNDOBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[BUT_FRM].x1+2; - TEr->x2=TEregs[BUT_FRM].x2-2; - TEr->y1=TEregs[BUT_FRM].y1+2; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Undo"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "undo button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Undo last action", "undo button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFAUNDO; - - TEr=TEregs+COPYBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[BUT_FRM].x1+2; - TEr->x2=TEregs[BUT_FRM].x2-2; - TEr->y1=TEregs[BUT_FRM].y1+2+11; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Copy"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "copy button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Copy selected area", "copy button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFACOPY; - - TEr=TEregs+CUT_BUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[BUT_FRM].x1+2; - TEr->x2=TEregs[BUT_FRM].x2-2; - TEr->y1=TEregs[BUT_FRM].y1+2+22; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Cut"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "cut button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Cut selected area", "cut button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFACUT; - - TEr=TEregs+CLR_BUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[BUT_FRM].x1+2; - TEr->x2=TEregs[BUT_FRM].x2-2; - TEr->y1=TEregs[BUT_FRM].y1+2+33; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Clear"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "clear button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Clear selected area", "clear button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFACLEAR; - - TEr=TEregs+TOOLFRM; - TEr->infotype=DITREGION; - TEr->x1=TEregs[BUT_FRM].x2+2; - TEr->x2=TEr->x1+34; - TEr->y1=TEregs[BUT_FRM].y1; - TEr->y2=TEr->y1+11*4+3; // 10*number of buttons - TEr->bitflags=REGACTIVE|REGVISIBLE|REGNOCLICK; - TEr->drawproc=&DrawSunkRegion; - TEr->caption=NULL; - TEr->data=NULL; - - TEr=TEregs+RIACBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[TOOLFRM].x1+2; - TEr->x2=TEregs[TOOLFRM].x2-2; - TEr->y1=TEregs[TOOLFRM].y1+2; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Turn L"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "rotate button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Rotate anticlockwise", "rotate button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFARIAC; - - TEr=TEregs+RIC_BUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[TOOLFRM].x1+2; - TEr->x2=TEregs[TOOLFRM].x2-2; - TEr->y1=TEregs[TOOLFRM].y1+2+11; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Turn R"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "rotate button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Rotate clockwise", "rotate button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFARIC; - - TEr=TEregs+FLIPBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[TOOLFRM].x1+2; - TEr->x2=TEregs[TOOLFRM].x2-2; - TEr->y1=TEregs[TOOLFRM].y1+2+22; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Flip"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "flip button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Flip", "flip button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFAFLIP; - - TEr=TEregs+MIRRBUT; - TEr->infotype=DITREGION; - TEr->x1=TEregs[TOOLFRM].x1+2; - TEr->x2=TEregs[TOOLFRM].x2-2; - TEr->y1=TEregs[TOOLFRM].y1+2+33; - TEr->y2=TEr->y1+10; - TEr->bitflags=REGACTIVE|REGVISIBLE; - TEr->drawproc=&DrawButton; - TEr->caption=NULL; - SetCaption(TEr, "Mirror"); - TEr->data=(struct DATABUTTON *) TEAlloc(sizeof (struct DATABUTTON), "mirror button data"); - ((struct DATABUTTON *)(TEr->data))->infotype=DITBUTTON; - ((struct DATABUTTON *)(TEr->data))->text=TENewText("Mirror", "mirror button text"); - ((struct DATABUTTON *)(TEr->data))->buttontype=CLICKBUTTON; - ((struct DATABUTTON *)(TEr->data))->bitflag=&TEbfa; - ((struct DATABUTTON *)(TEr->data))->bitvalue=BFAMIRROR; - - } - -static void DestroyRegions (TEREGION **TEBaseReg) - { - TEREGION *TEr=NULL; - int i; - if (!(*TEBaseReg)->data) err("No region data defined."); - if (((struct DATABASEREGION *)(*TEBaseReg)->data)->infotype!=DITBASEREGION) - err("DestroyRegions called with invalid base region."); - - i=((struct DATABASEREGION *)(*TEBaseReg)->data)->numofregs; - do - { - i--; - TEr=(*TEBaseReg)+i; - TEFree(TEr->caption); - if (TEr->data) - { - switch (((struct DATABASEREGION *)(TEr->data))->infotype) - { - case DITBASEREGION: - break; - case DITBUTTON: - TEFree(((struct DATABUTTON *)TEr->data)->text); - break; - } - } - TEFree(TEr->data); - } while (i>0); - TEFree(*TEBaseReg); -// if (*TEBaseReg) err("Not freed"); - } - -static void RenderTileEdit (TEREGION *TEBaseReg) -// -- ric: 20/Jul/98 - updatedt to be a little more generic ;) - { - int i; - TExoffs=TEBaseReg->x1; - TEyoffs=TEBaseReg->y1; - if (!TEBaseReg->data) err("No region data defined."); - if (((struct DATABASEREGION *)TEBaseReg->data)->infotype!=DITBASEREGION) - err("RenderTileEdit called with invalid base region."); - switch (((struct DATABASEREGION *)TEBaseReg->data)->windowtype) - { - case DBRSTDWINDOW: - Window(TExoffs,TEyoffs,TEBaseReg->x2,TEBaseReg->y2, ((TEBaseReg->caption) ? TEBaseReg->caption : "")); - break; - case DBRPANEL: - stdwindow(TExoffs,TEyoffs,TEBaseReg->x2,TEBaseReg->y2); - break; - } - - i=((struct DATABASEREGION *)TEBaseReg->data)->numofregs; - do - { - i--; - if ((TEBaseReg+i)->bitflags®VISIBLE) (TEBaseReg+i)->drawproc(TEBaseReg+i); - } while (i>1); - } - -void TileEdit (void) - { - int i,j; - int TEoldeditmode=EDDRAW; - if (TEbitflags&TEQUITCUR) TEbitflags^=TEQUITCUR; - - InitTEImage(); - SetupRegions(); - TEeditmode=EDDRAW; // Default to drawing mode - if (TEbitflags&TESHOWMSK) TEbitflags^=TESHOWMSK; - - while (!(TEbitflags&TEQUITCUR)) - { - // Mouse button click handler routines - MBClickHandler(TEregs); - - TEbfa=BFANONE; // Reset button action flag - if (TEeditmode==EDMASK && TEoldeditmode!=EDMASK) TEbitflags|=TESHOWMSK; - if (TEeditmode==EDMASK && TEoldeditmode==EDMASK && !(TEbitflags&TESHOWMSK)) - TEeditmode=EDDRAW; - TEoldeditmode=TEeditmode; - - // Draw loop - RenderTileEdit(TEregs); - DrawMouse(); - ShowPage(); - - if (key[SCAN_ESC]) - { - key[SCAN_ESC]=0; - TEbitflags|=TEQUITCUR; - } - if ((key[SCAN_CTRL] && key[SCAN_Z]) || (TEbfa&BFAUNDO) || (key[SCAN_U] && !(key[SCAN_CTRL])) && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_U]=0; - key[SCAN_Z]=0; - TEUndo(); - } - if (key[SCAN_CTRL] && key[SCAN_R]) - { - key[SCAN_R]=0; - memcpy(TEundo, TEimage, TExsize*TEysize); // copy image into undo buffer - memcpy(TEimage, TEsource, TExsize*TEysize); // copy original image into edit buffer - } - if (key[SCAN_CTRL] && key[SCAN_A]) - { - key[SCAN_A]=0; - j=TEysize*TExsize; - memset(TEmask, 0xf, j); - } - if (key[SCAN_CTRL] && key[SCAN_U]) - { - key[SCAN_U]=0; - j=TEysize*TExsize; - memset(TEmask, 0x0, j); - } - if ((TEbfa&BFACOPY) || (key[SCAN_CTRL] && key[SCAN_C]) && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_C]=0; - TECopyImage(); - } - if ((TEbfa&BFACUT) || (key[SCAN_CTRL] && key[SCAN_X]) && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_X]=0; - TECopyImage(); - TEClearImage(); - } - if (key[SCAN_CTRL] && key[SCAN_V] && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_V]=0; - TEeditmode=EDPASTE; - } - if ((TEbfa&BFACLEAR) || key[SCAN_DEL] && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_DEL]=0; - TEClearImage(); - } - if (key[SCAN_Q] && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_Q]=0; - if (TEtype==TETILE && TEanimstrand) - { - if (TEtile>vspanim[TEanimstrand-1].start) - { - // Change tile index - TEtile-=1; - i=TExsize; - j=TEysize; - - // Restart editor - RestartTileEditor(); - } - } - } - if (key[SCAN_W] && ((MBStatus[0]|MBStatus[1])==MOUSENONE)) - { - key[SCAN_W]=0; - if (TEtype==TETILE && TEanimstrand) - { - if (TEtile0); - } - if (key[SCAN_M]) - { - key[SCAN_M]=0; - if (TEeditmode==EDMASK) - TEeditmode=EDDRAW; - TEbitflags^=TESHOWMSK; - } - if (key[SCAN_SPACE]) - { - key[SCAN_SPACE]=0; - if (TEeditmode==EDDRAW) - { - TEeditmode=EDMASK; - TEbitflags|=TESHOWMSK; - } - else - TEeditmode=EDDRAW; - } - if (key[SCAN_PGUP]) - { - key[SCAN_PGUP]=0; - switch (TEeditmode) - { - case EDDRAW: - case EDMASK: - memcpy(TEundo, TEimage, TExsize*TEysize); - if (TEbitflags&TESHOWMSK) - TEShiftColours(TEimage, TEmask, TExsize, TEysize, 1); - else - TEShiftColours(TEimage, NULL, TExsize, TEysize, 1); - break; - case EDPASTE: - if (TEcopy) - TEShiftColours(TEcopy, TEcmsk, TEcopyxsize, TEcopyysize, 1); - break; - } - } - if (key[SCAN_PGDN]) - { - key[SCAN_PGDN]=0; - switch (TEeditmode) - { - case EDDRAW: - case EDMASK: - memcpy(TEundo, TEimage, TExsize*TEysize); - if (TEbitflags&TESHOWMSK) - TEShiftColours(TEimage, TEmask, TExsize, TEysize, -1); - else - TEShiftColours(TEimage, NULL, TExsize, TEysize, -1); - break; - case EDPASTE: - if (TEcopy) - TEShiftColours(TEcopy, TEcmsk, TEcopyxsize, TEcopyysize, -1); - break; - } - } - - if (key[SCAN_LANGLE]) - { - key[SCAN_LANGLE]=0; - ShutdownVideo(); - TEFreeReg(TEregs); - vm=0; - InitVideo(0); - SetupRegions(); - set_intensity(63); - InitMouse(); - } - if (key[SCAN_RANGLE]) - { - key[SCAN_RANGLE]=0; - ShutdownVideo(); - TEFreeReg(TEregs); - vm=1; - InitVideo(1); - SetupRegions(); - set_intensity(63); - InitMouse(); - } - } - DeinitTEImage(); - TEFreeReg(TEregs); - } diff --git a/16/v2/source/verge/MAPED/TILEED.H b/16/v2/source/verge/MAPED/TILEED.H deleted file mode 100755 index 11419f6a..00000000 --- a/16/v2/source/verge/MAPED/TILEED.H +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef TILEED_INC -#define TILEED_INC - -// TEtype defs -#define TEUNKNOWN 0 -#define TETILE 1 - -// external functions -extern void TileEdit(void); - -// external variables -extern unsigned int TEtype; // type of graphic being edited -extern unsigned int TEtile; // tile to edit - may possibly expand this to an array for simultaneous editing -extern unsigned int TExsize; // width of graphic being edited -extern unsigned int TEysize; // height of graphic being edited -extern unsigned char *TEsource; // pointer to original image being edited - -#endif diff --git a/16/v2/source/verge/MAPED/TILESEL.C b/16/v2/source/verge/MAPED/TILESEL.C deleted file mode 100755 index 834ad9d7..00000000 --- a/16/v2/source/verge/MAPED/TILESEL.C +++ /dev/null @@ -1,1448 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include - -#include "config.h" -#include "keyboard.h" -#include "maped.h" -#include "mouse.h" -#include "render.h" -#include "tileed.h" -#include "timer.h" -#include "vdriver.h" - -#include "smalfont.h" -#include "guicomp.h" -#include "gui.h" - -extern byte TileCmp(byte *one, byte *two); //zero - -// ================================= Data ==================================== - -int selofs=0; -char ttile[256], ttile2[256]; -char curastd=0; -char curmode=0; - -// ================================= Code ==================================== - -int curtileptr(int row) -{ - int jumper,wide; - int x,y; - - jumper=16+pad; - wide=320/jumper; - - x=(mx-16)/jumper; - y=((my-16)/jumper)*wide; - - return x+y+row; -} - -void NormalButton(int x1, int y1, int x2, int y2, char *str) -{ - FilledBox(x1, y1, x2, y2, winbg); - HLine(x1, y1, x2, black); - VLine(x1, y1, y2, black); - HLine(x1+1, y1+y2-1, x2-1, black); - VLine(x1+x2-1, y1+1, y2-1, black); - - HLine(x1+1, y1+1, x2-2, brightw); - VLine(x1+1, y1+1, y2-2, brightw); - HLine(x1+2, y1+y2-2, x2-3, darkw); - VLine(x1+x2-2, y1+2, y2-3, darkw); - GotoXY(x1+((x2-pixels(str))/2), y1+3); - printstring(str); -} - -void PressdButton(int x1, int y1, int x2, int y2, char *str) -{ - FilledBox(x1, y1, x2, y2, winbg); - HLine(x1, y1, x2, black); - VLine(x1, y1, y2, black); - HLine(x1+1, y1+y2-1, x2-1, black); - VLine(x1+x2-1, y1+1, y2-1, black); - - HLine(x1+1, y1+1, x2-2, darkw); - VLine(x1+1, y1+1, y2-2, darkw); - GotoXY(x1+((x2-pixels(str))/2)+1, y1+4); - printstring(str); -} - -void RenderSelector() -{ unsigned char *img,i,j; - int z; - int tskip=16+pad; - int twide=320/tskip; - int tdeep=((200+15)&~15)/tskip; - - ClearScreen(); - - for (i=0; i=numtiles) img=vsp; - CopyTile((j*tskip)+16,(i*tskip)+16,img); - } - if (th) - { - if (my<(tsy-40)) - DrawHighlight( ((mx/tskip)*tskip)-(1+pad), - ((my/tskip)*tskip)-(1+pad)); - } - z=tsy-40; - sprintf(strbuf,"MapEd %s Tile Selector - Tile %d/%d",ME2_VERSION,curtileptr(selofs),numtiles); - Window(16,z,336,z+40,strbuf); - HLine(278, z+11, 53, darkw); - VLine(278, z+11, 25, darkw); - VLine(330, z+12, 24, brightw); - HLine(279, z+35, 51, brightw); - if (curmode==0) PressdButton(290, z+12, 40, 12, "Select"); - else NormalButton(290, z+12, 40, 12, "Select"); - if (curmode==1) PressdButton(290, z+23, 40, 12, "Edit"); - else NormalButton(290, z+23, 40, 12, "Edit"); - if (th) PressdButton(279, z+12, 12, 12, "H"); - else NormalButton(279, z+12, 12, 12, "H"); - if (pad) PressdButton(279, z+23, 12, 12, "P"); - else NormalButton(279, z+23, 12, 12, "P"); - - HLine(219, z+11, 52, darkw); - VLine(219, z+11, 25, darkw); - VLine(270, z+12, 24, brightw); - HLine(220, z+35, 50, brightw); - NormalButton(220, z+12, 50, 12, "Import VSP"); - NormalButton(220, z+23, 50, 12, "Import PCX"); - - HLine(160, z+11, 52, darkw); - VLine(160, z+11, 25, darkw); - VLine(211, z+12, 24, brightw); - HLine(161, z+35, 50, brightw); - NormalButton(161, z+12, 50, 12, "Add Tiles"); - NormalButton(161, z+23, 50, 12, "Animation"); - - HLine(26, z+10, 20, darkw); - VLine(26, z+10, 20, darkw); - HLine(27, z+29, 19, brightw); - VLine(45, z+11, 19, brightw); - FilledBox(27, z+11, 18, 18, black); - CopyTile(28, z+12, ttile2); - GotoXY(20, z+32); printstring("Clipboard"); -} - -void FlipX(unsigned short edtile) -{ int i,j; - - key[SCAN_X]=0; - if (edtile>=numtiles) return; - memcpy(ttile,&vsp[edtile*256],256); - modified=1; - - for (i=0;i<16;i++) - for (j=0;j<16;j++) - vsp[((edtile)*256)+(j*16)+i]=ttile[(j*16)+(15-i)]; -} - -void FlipY(unsigned short edtile) -{ int i,j; - - key[SCAN_Y]=0; - if (edtile>=numtiles) return; - memcpy(ttile,&vsp[edtile*256],256); - modified=1; - - for (i=0;i<16;i++) - for (j=0;j<16;j++) - vsp[((edtile)*256)+(j*16)+i]=ttile[((15-j)*16)+i]; -} - -void FlipZ(unsigned short edtile) -{ int i,j; - - key[SCAN_Z]=0; - if (edtile>=numtiles) return; - memcpy(ttile,&vsp[edtile*256],256); - modified=1; - - for (i=0;i<16;i++) - for (j=0;j<16;j++) - vsp[((edtile)*256)+(j*16)+i]=ttile[(i*16)+j]; -} - -void DrawHighlight(int x, int y) -{ - if (x<10 || y<10 || x>330 || y>sy+10) return; - HLine(x, y, 18, white); - HLine(x, y+17, 18, white); - VLine(x, y, 18, white); - VLine(x+17, y, 18, white); -} - -void TileSelector() -{ int z, ct, k,j,m; - char *s, *d; - - int ms_down=0; // aen - int ms_up=0; - - while (!key[SCAN_ESC]) - { - RenderSelector(); - RenderMessages(); - DrawMouse(); - ShowPage(); - - ms_down=0; - ms_up=0; - if (mouse_scroll) - { - if (my>tsy-2) ms_down=1; - if (my<18) ms_up=1; - } - - if ((key[SCAN_DOWN] || (ms_down && (!(systemtime%10)))) && selofs<65319) - { - if (!pad) selofs=selofs+20; - else selofs+=18; - key[SCAN_DOWN]=0; - systemtime++; - } - if ((key[SCAN_UP] || (ms_up && (!(systemtime%10)))) && selofs>17) - { - if (!pad) selofs-=20; - else selofs-=18; - key[SCAN_UP]=0; - systemtime++; - } - if (key[SCAN_P]) - { - key[SCAN_P]=0; - pad=pad ^ 1; - selofs=0; - if (pad) Message("Tile padding enabled.",100); - else Message("Tile padding disabled.",100); - } - if (key[SCAN_H]) - { - key[SCAN_H]=0; - th=th ^ 1; - if (th) Message("Tile Highlight enabled.",100); - else Message("Tile Highlight disabled.",100); - } - - if (key[SCAN_X]) FlipX(curtileptr(selofs)); - if (key[SCAN_Y]) FlipY(curtileptr(selofs)); - if (key[SCAN_Z]) FlipZ(curtileptr(selofs)); - if (key[SCAN_V]) VSPAnimDialog(); - if (key[SCAN_CTRL] && key[SCAN_C]) - { - memcpy(ttile2, (char *) (vsp+(256*curtileptr(selofs))), 256); - key[SCAN_C]=0; - } - if (key[SCAN_CTRL] && key[SCAN_S]) - { - if (curtileptr(selofs) >= numtiles) return; - memcpy((char *) (vsp+(256*curtileptr(selofs))), ttile2, 256); - modified=1; - key[SCAN_S]=0; - } - if (key[SCAN_CTRL] && key[SCAN_T]) - { - if (curtileptr(selofs) >= numtiles) return; - modified=1; - s=ttile2; - d=(char *) (vsp+(256*curtileptr(selofs))); - for (z=0; z<256; z++) - { - if (*s) *d=*s; - d++; - s++; - } - key[SCAN_T]=0; - } - if (key[SCAN_CTRL] && key[SCAN_D] && !key[SCAN_ALT]) - { - key[SCAN_D]=0; - modified=1; - z=curtileptr(selofs); - if (zz) layers[k][j*layer[k].sizex+m]--; - } - } - } - } - } - } -// zero: Super Insert Mode! -// wimpy insert irks me. - if (key[SCAN_CTRL] && key[SCAN_I] && key[SCAN_ALT]) - { - key[SCAN_I]=0; - ct=curtileptr(selofs); - if (ct <= numtiles) - { - modified=1; - s=(char *) valloc((numtiles+1)*256, "s_ins",0); - memcpy(s, vsp, (numtiles*256)); - vfree(vsp); vsp=s; s=0; - for (z=numtiles-1; z>=ct; z--) - memcpy(vsp+((z+1)*256),vsp+(z*256),256); - memset(vsp+(ct*256), 0, 256); - numtiles++; - } - for(k=0;k=ct) layers[k][j*layer[k].sizex+m]++; - } - } - } - } - - if (key[SCAN_CTRL] && key[SCAN_I] && !key[SCAN_ALT]) - { - key[SCAN_I]=0; - ct=curtileptr(selofs); - if (ct <= numtiles) - { - modified=1; - s=(char *)valloc((numtiles+1)*256,"s_ins",0); - memcpy(s, vsp, (numtiles*256)); - vfree(vsp); vsp=s; s=0; - for (z=numtiles-1; z>=ct; z--) - memcpy(vsp+((z+1)*256),vsp+(z*256),256); - memset(vsp+(ct*256), 0, 256); - numtiles++; - } - } - if (key[SCAN_E]) - { - modified=1; - TEtile=curtileptr(selofs); // middle tile initially - if (TEtile290 && mx<330 && my>z+12 && my290 && mx<330 && my>z+23 && my278 && mx<289 && my>z+12 && my278 && mx<289 && my>z+23 && my161 && mx<210 && my>z+12 && my161 && mx<210 && my>z+23 && my220 && mx<270 && my>z+12 && my220 && mx<270 && my>z+23 && my= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - vaxofs = (mx-mxo); - vayofs = (my-myo); - if (!mb) moving=0; - if (vaxofs<16) vaxofs = 16; - if (vayofs<16) vayofs = 16; - if (vaxofs+vaxsize>335) vaxofs = 336-vaxsize; - if (vayofs+vaysize>sy+16) vayofs = (sy+16)-vaysize; - } - - Window(vaxofs, vayofs, vaxofs+vaxsize, vayofs+vaysize, "VSP Animation Editor"); - CopyTile(vaxofs+110, vayofs+16, (char *) (vsp+(256*tileidx[vspanim[i].start]))); - GotoXY(vaxofs+4, vayofs+12); printstring("Start"); - TextField(vaxofs+25, vayofs+11, 60, nstr1, ctf == 1 ? cb : 0); - GotoXY(vaxofs+11, vayofs+22); printstring("End"); - TextField(vaxofs+25, vayofs+21, 60, nstr2, ctf == 2 ? cb : 0); - GotoXY(vaxofs+4, vayofs+32); printstring("Delay"); - TextField(vaxofs+25, vayofs+31, 60, nstr3, ctf == 3 ? cb : 0); - GotoXY(vaxofs+6, vayofs+42); printstring("Mode"); - TextField(vaxofs+25, vayofs+41, 60, nstr4, ctf == 4 ? cb : 0); - GotoXY(vaxofs+2, vayofs+56); printstring("Strand"); - GotoXY(vaxofs+104, vayofs+33); printstring("Preview"); - HLine(vaxofs+1, vayofs+51, 148, white); - Button(vaxofs+85, vayofs+54, "OK"); - Button(vaxofs+117, vayofs+54, "Update"); - GotoXY(vaxofs+30, vayofs+56); - sprintf(strbuf, "%d", i); printstring(strbuf); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>vaxofs+25 && mxvayofs+11 && myvaxofs+25 && mxvayofs+21 && myvaxofs+25 && mxvayofs+31 && myvaxofs+25 && mxvayofs+41 && myvaxofs+85 && mxvayofs+54 && myvaxofs+117 && mxvayofs+54 && my(vaxofs+vaxsize-9) && (mx(vayofs+1) && (myvaxofs && mxvayofs && my<(vayofs+9) && !moving) - { - moving=1; - mxo=mx-vaxofs; - myo=my-vayofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_UP) - { - vspanim[i].start=atoi(nstr1); - vspanim[i].finish=atoi(nstr2); - vspanim[i].delay=atoi(nstr3); - vspanim[i].mode=atoi(nstr4); - if (i<99) i++; else i=0; - last_pressed=0; key[SCAN_UP]=0; - sprintf(nstr1, "%d", vspanim[i].start); - sprintf(nstr2, "%d", vspanim[i].finish); - sprintf(nstr3, "%d", vspanim[i].delay); - sprintf(nstr4, "%d", vspanim[i].mode); - continue; - } - if (last_pressed==SCAN_DOWN) - { - vspanim[i].start=atoi(nstr1); - vspanim[i].finish=atoi(nstr2); - vspanim[i].delay=atoi(nstr3); - vspanim[i].mode=atoi(nstr4); - if (i) i--; else i=99; - last_pressed=0; key[SCAN_DOWN]=0; - sprintf(nstr1, "%d", vspanim[i].start); - sprintf(nstr2, "%d", vspanim[i].finish); - sprintf(nstr3, "%d", vspanim[i].delay); - sprintf(nstr4, "%d", vspanim[i].mode); - continue; - } - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=nstr1; break; - case 1: ctf=2; str=nstr2; break; - case 2: ctf=3; str=nstr3; break; - case 3: ctf=4; str=nstr4; break; - case 4: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=4; str=nstr4; break; - case 1: ctf=0; str=0; break; - case 2: ctf=1; str=nstr1; break; - case 3: ctf=2; str=nstr2; break; - case 4: ctf=3; str=nstr3; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -// memset(&vadelay, 0, 100); -// for (i=0; i= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - atxofs = (mx-mxo); - atyofs = (my-myo); - if (!mb) moving=0; - if (atxofs<16) atxofs = 16; - if (atyofs<16) atyofs = 16; - if (atxofs+atxsize>335) atxofs = 336-atxsize; - if (atyofs+atysize>sy+16) atyofs = (sy+16)-atysize; - } - - Window(atxofs, atyofs, atxofs+atxsize, atyofs+atysize, "Allocate Additional Tiles"); - GotoXY(atxofs+12, atyofs+15); printstring("Alloc Tiles:"); - TextField(atxofs+56, atyofs+13, 80, nstr1, ctf == 1 ? cb : 0); - Button(atxofs+85, atyofs+26, "OK"); - Button(atxofs+117, atyofs+26, "Cancel"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>atxofs+56 && mxatyofs+13 && myatxofs+85 && mxatyofs+26 && myatxofs+117 && mxatyofs+26 && my(atxofs+atxsize-9) && (mx(atyofs+1) && (myatxofs && mxatyofs && my<(atyofs+9) && !moving) - { - moving=1; - mxo=mx-atxofs; - myo=my-atyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (last_pressed==SCAN_TAB && !key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=nstr1; break; - case 1: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (last_pressed==SCAN_TAB && key[SCAN_LSHIFT]) - { - switch (ctf) - { - case 0: ctf=1; str=nstr1; break; - case 1: ctf=0; str=0; break; - } - key[SCAN_TAB]=0; - last_pressed=0; - cb=1; cursorblink=systemtime+40; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); - at=atoi(nstr1); - th=bleh; -// memset(&vadelay, 0, 100); -// for (i=0; i=ontiles) img=ovsp; - CopyTile((j*jumper)+16,(i*jumper)+16,img); - if(at17) - { - if (!pad) sofs-=20; - else sofs-=18; - key[SCAN_UP]=0; - } -/*all by zero here in this scan_b thing*/ - if (key[SCAN_B]) - { - key[SCAN_B]=0; - Message("Building duplicate import list",200); - for(bloop1=0; bloop1= cursorblink) - { - cb ^= 1; - cursorblink = systemtime+40; - } - if (moving) - { - OPxofs = (mx-mxo); - OPyofs = (my-myo); - if (!mb) moving=0; - if (OPxofs<16) OPxofs = 16; - if (OPyofs<16) OPyofs = 16; - if (OPxofs+OPxsize>335) OPxofs = 336-OPxsize; - if (OPyofs+OPysize>sy+16) OPyofs = (sy+16)-OPysize; - } - - Window(OPxofs, OPyofs, OPxofs+OPxsize, OPyofs+OPysize, "Open PCX As"); - Button(OPxofs+21, OPyofs+18, "Tileset"); - Button(OPxofs+50, OPyofs+18, "Image"); - - DrawMouse(); - ShowPage(); - CheckTimerStuff(); - - // input phase - if (mb==1 && mx>OPxofs+21 && mxOPyofs+18 && myOPxofs+50 && mxOPyofs+18 && my(OPxofs+OPxsize-9) && (mx(OPyofs+1) && (myOPxofs && mxOPyofs && my<(OPyofs+9) && !moving) - { - moving=1; - mxo=mx-OPxofs; - myo=my-OPyofs; - continue; - } - - if (mb==1 && !moving) - { - ctf=0; - cb=0; - str=0; - WaitRelease(); - } - - if (last_pressed) - { - if (key[SCAN_LSHIFT] || key[SCAN_RSHIFT]) c=key_shift_tbl[last_pressed]; - else c=key_ascii_tbl[last_pressed]; - - if (last_pressed==SCAN_ESC) - { - key[SCAN_ESC]=0; - done=1; - break; - } - - if (last_pressed==SCAN_ENTER) - { - key[SCAN_ENTER]=0; - ctf=0; - str=0; - last_pressed=0; - continue; - } - - if (!ctf) - continue; - - if (last_pressed==SCAN_BACKSP && strlen(str)) - { - str[strlen(str)-1]=0; - key[SCAN_BACKSP]=0; - last_pressed=0; - continue; - } - else if (last_pressed==SCAN_BACKSP) - { - last_pressed=0; - continue; - } - - t=strlen(str); - str[t]=c; - str[t+1]=0; - last_pressed=0; - } - } while (!done); -} - -char manufacturer; -char version; -char encoding; -char bits_per_pixel; -short xmin,ymin; -short xmax,ymax; -short hres; -short vres; -char palette[48]; -char reserved; -char color_planes; -short bytes_per_line; -short palette_type; -char filler[58]; -char *t; - -int width,depth; -int bytes; -int vidoffset; -FILE *pcxf; - -void ReadPCXLine(unsigned char *dest) -{ int i, n; - char c, run; - - n=0; - do { - c=fgetc(pcxf) & 0xff; - - if ((c & 0xc0)==0xc0) - { run=c & 0x3f; - c=fgetc(pcxf); - for (i=0; i> 2; - set_intensity(63); -} - -void LoadPCXHeaderNP(char *fname) -{ - pcxf=fopen(fname,"rb"); - if (!pcxf) err("Could not open specified PCX file."); - fread(&manufacturer,1,1,pcxf); - fread(&version,1,1,pcxf); - fread(&encoding,1,1,pcxf); - fread(&bits_per_pixel,1,1,pcxf); - fread(&xmin,1,2,pcxf); - fread(&ymin,1,2,pcxf); - fread(&xmax,1,2,pcxf); - fread(&ymax,1,2,pcxf); - fread(&hres,1,2,pcxf); - fread(&vres,1,2,pcxf); - fread(&palette,1,48,pcxf); - fread(&reserved,1,1,pcxf); - fread(&color_planes,1,1,pcxf); - fread(&bytes_per_line,1,2,pcxf); - fread(&palette_type,1,2,pcxf); - fread(&filler,1,58,pcxf); - width=xmax-xmin+1; - depth=ymax-ymin+1; - bytes=bytes_per_line; -} - -// grabs a tile from the ovsp buffer (transit tile bay) -int GrabTileAt(int x, int y, int z, int check_dup) -{ int a; - char tvsp[256]; - char *s; - - s=t+(y*width)+x; - - for (a=0; a<16; a++) - { - memcpy(tvsp+(a*16), s, 16); - s+=width; - } - - if (check_dup) - { - for (a=0; a -#include -#include - -#include "mikmod.h" - -#include "render.h" - -#define PIT0 0x40 -#define PIT1 0x41 -#define PIT2 0x42 -#define PITMODE 0x43 -#define PITCONST 1193180L - -#define OCR1 0x20 -#define IMR1 0x21 - -#define OCR2 0xA0 -#define IMR2 0xA1 - -// ================================= Data ==================================== - -void (__interrupt __far *biosTimerHandler)(); -char timerinstalled=0; -extern char soundokay; - -volatile unsigned int systemtime=0, timer_count=0, tick=0; -volatile int backupct=0, idlect=0; - -// ================================= Code ==================================== - -#pragma aux disable =\ - "cli"; - -#pragma aux enable =\ - "sti"; - -static void SendEOI (unsigned char irqno) -{ - static unsigned char ocr; - static unsigned char eoi; - - ocr=(irqno>7) ? OCR2 : OCR1; - eoi=0x60|(irqno&7); - outp(ocr,eoi); - if (irqno>7) outp(OCR1,0x20); -} - -void __interrupt __far newhandler(void) -{ - systemtime++; - timer_count++; - tick++; - backupct++; - idlect++; - CheckTileAnimation(); - if (soundokay) MD_Update(); - SendEOI(0); -} - -void SetHZ(unsigned int hz) -{ unsigned int pit0_set, pit0_value; - - disable(); - - outp(PITMODE, 0x34); - pit0_value=PITCONST / hz; - pit0_set=(pit0_value & 0x00ff); - outp(PIT0, pit0_set); - pit0_set=(pit0_value >> 8); - outp(PIT0, pit0_set); - - enable(); -} - -void RestoreHZ() -{ - disable(); - outp(PITMODE, 0x34); - outp(PIT0, 0x00); - outp(PIT0, 0x00); - enable(); -} - -void InitTimer() -{ - if (timerinstalled) return; - - biosTimerHandler=_dos_getvect(0x08); - _dos_setvect(0x08, newhandler); - timerinstalled=1; - SetHZ(100); -} - -void ShutdownTimer() -{ - if (!timerinstalled) return; - - _dos_setvect(0x08, biosTimerHandler); - RestoreHZ(); - timerinstalled=0; -} diff --git a/16/v2/source/verge/MAPED/TIMER.H b/16/v2/source/verge/MAPED/TIMER.H deleted file mode 100755 index 9a74f633..00000000 --- a/16/v2/source/verge/MAPED/TIMER.H +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef TIMER_INC -#define TIMER_INC - -extern unsigned int systemtime, timer_count, tick; -extern int backupct, idlect; -//extern int (*callback) (void); // ??? - -extern void SetHZ(unsigned int hz); -extern void RestoreHZ(); -extern void InitTimer(); -extern void ShutdownTimer(); - -#endif // TIMER_INC diff --git a/16/v2/source/verge/MAPED/VDRIVER.C b/16/v2/source/verge/MAPED/VDRIVER.C deleted file mode 100755 index 14ca28fe..00000000 --- a/16/v2/source/verge/MAPED/VDRIVER.C +++ /dev/null @@ -1,105 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include "mode13h.h" -#include "modex.h" - -// ================================= Data ==================================== - -// Driver function-pointers. -int (*ShutdownVideo) (void); -int (*ShowPage) (void); -int (*CopySprite) (int x, int y, int width, int height, char *src); -int (*CCopySprite) (int x, int y, int width, int height, char *src); -int (*TCCopySprite) (int x, int y, int width, int height, char *src); -int (*TCopySprite) (int x, int y, int width, int height, char *src); -int (*CopyTile) (int x, int y, char *src); -int (*FilledBox) (int x, int y, int width, int height, char c); -int (*VLine) (int x, int y, int height, char color); -int (*HLine) (int x, int y, int width, char color); -int (*ColorGrid) (int x, int y, char c); -int (*ClearScreen) (void); -int (*CopySpriteLucentClip) (int x, int y, int width, int height, unsigned char *src); - -unsigned char pal[768], pal2[768]; -unsigned char *screen=0; - -int sx=0, sy=0; -int tx=0, ty=0; -int tsx=0, tsy=0; -int map_scroll_x=1; -int map_scroll_y=1; - -// ================================= Code ==================================== - -void InitVideo(int mode) -{ - switch (mode) - { - case 0: InitMode13h(); break; - case 1: InitModeX(); // 320x240 - break; - } -} - -void SetPalette(unsigned char *pall) -{ unsigned int i; - - outp(0x03c8,0); - for (i=0; i<768; i++) - outp(0x03c9,pall[i]); -} - -void GetPalette(void) -{ unsigned int i; - - outp(0x03c7,0); - for (i=0; i<768; i++) - pal[i]=inp(0x03c9); -} - -void set_intensity(unsigned int n) -{ unsigned int i; - - for (i=0; i<768; i++) - pal2[i]=(pal[i]*n)>>6; - - SetPalette(pal2); -} - -#define byte unsigned char -int cx1=16, cy1=16, cx2=336, cy2=256; - -char stipple[256]={ - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, - 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, -}; diff --git a/16/v2/source/verge/MAPED/VDRIVER.H b/16/v2/source/verge/MAPED/VDRIVER.H deleted file mode 100755 index b04b194b..00000000 --- a/16/v2/source/verge/MAPED/VDRIVER.H +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef VDRIVER_INC -#define VDRIVER_INC - -#include "inter.h" - -extern int (*ShutdownVideo) (void); -extern int (*ShowPage) (void); -extern int (*CopySprite) (int x, int y, int width, int height, char *src); -extern int (*CCopySprite) (int x, int y, int width, int height, char *src); -extern int (*TCCopySprite) (int x, int y, int width, int height, char *src); -extern int (*TCopySprite) (int x, int y, int width, int height, char *src); -extern int (*CopySpriteLucentClip) (int x, int y, int width, int height, unsigned char *src); -extern int (*CopyTile) (int x, int y, char *src); -extern int (*FilledBox) (int x, int y, int width, int height, char c); -extern int (*VLine) (int x, int y, int height, char color); -extern int (*HLine) (int x, int y, int width, char color); -extern int (*ColorGrid) (int x, int y, char c); -extern int (*ClearScreen) (void); - -extern unsigned char pal[768], pal2[768]; -extern unsigned char *screen; - -extern int sx, sy, tx, ty, tsx, tsy; -extern int map_scroll_x, map_scroll_y; - -extern void InitVideo(int mode); -extern void SetPalette(unsigned char *pall); -extern void GetPalette(void); -extern void set_intensity(unsigned int n); - -extern int cx1, cy1, cx2, cy2; - -#endif // VDRIVER_INC diff --git a/16/v2/source/verge/MAPED/VERGEPAL.H b/16/v2/source/verge/MAPED/VERGEPAL.H deleted file mode 100755 index 75adcd68..00000000 --- a/16/v2/source/verge/MAPED/VERGEPAL.H +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define VERGEPAL_LEN 768 - - static unsigned char vergepal[]= - { - 0x00,0x00,0x00,0x02,0x02,0x02,0x03,0x03,0x03,0x05,0x05,0x05,0x07, - 0x07,0x07,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0e,0x0e, - 0x0e,0x0f,0x0f,0x0f,0x11,0x11,0x11,0x13,0x13,0x13,0x15,0x15,0x15, - 0x16,0x16,0x16,0x18,0x18,0x18,0x1a,0x1a,0x1a,0x1c,0x1c,0x1c,0x1d, - 0x1d,0x1d,0x1f,0x1f,0x1f,0x21,0x21,0x21,0x22,0x22,0x22,0x24,0x24, - 0x24,0x26,0x26,0x26,0x28,0x28,0x28,0x29,0x29,0x29,0x2b,0x2b,0x2b, - 0x2e,0x2e,0x2e,0x31,0x31,0x31,0x34,0x34,0x34,0x36,0x36,0x36,0x39, - 0x39,0x39,0x3c,0x3c,0x3c,0x3f,0x00,0x00,0x3b,0x00,0x00,0x38,0x00, - 0x00,0x35,0x00,0x00,0x32,0x00,0x00,0x2f,0x00,0x00,0x2c,0x00,0x00, - 0x29,0x00,0x00,0x26,0x00,0x00,0x22,0x00,0x00,0x1f,0x00,0x00,0x1c, - 0x00,0x00,0x19,0x00,0x00,0x16,0x00,0x00,0x13,0x00,0x00,0x10,0x00, - 0x00,0x3f,0x36,0x36,0x3f,0x2e,0x2e,0x3f,0x27,0x27,0x3f,0x1f,0x1f, - 0x3f,0x17,0x17,0x3f,0x10,0x10,0x3f,0x08,0x08,0x3f,0x00,0x00,0x11, - 0x0b,0x06,0x13,0x0d,0x07,0x15,0x0f,0x09,0x17,0x11,0x0a,0x18,0x13, - 0x0b,0x1a,0x15,0x0c,0x1c,0x17,0x0e,0x1e,0x19,0x0f,0x3f,0x3f,0x36, - 0x3f,0x3f,0x2e,0x3f,0x3f,0x27,0x3f,0x3f,0x1f,0x3f,0x3e,0x17,0x3f, - 0x3d,0x10,0x3f,0x3d,0x08,0x3f,0x3d,0x00,0x39,0x36,0x00,0x33,0x31, - 0x00,0x2d,0x2b,0x00,0x27,0x27,0x00,0x21,0x21,0x00,0x1c,0x1b,0x00, - 0x16,0x15,0x00,0x10,0x10,0x00,0x34,0x3f,0x17,0x31,0x3f,0x10,0x2d, - 0x3f,0x08,0x28,0x3f,0x00,0x24,0x39,0x00,0x20,0x33,0x00,0x1d,0x2d, - 0x00,0x18,0x27,0x00,0x36,0x3f,0x36,0x2e,0x3d,0x2e,0x27,0x3b,0x27, - 0x1f,0x39,0x1f,0x17,0x36,0x17,0x0f,0x34,0x0f,0x08,0x32,0x08,0x00, - 0x30,0x00,0x00,0x2d,0x00,0x00,0x2b,0x00,0x00,0x28,0x00,0x00,0x26, - 0x00,0x00,0x23,0x00,0x00,0x21,0x00,0x00,0x1e,0x00,0x00,0x1c,0x00, - 0x00,0x19,0x00,0x00,0x17,0x00,0x00,0x14,0x00,0x00,0x12,0x00,0x00, - 0x0f,0x00,0x02,0x0d,0x02,0x03,0x0a,0x03,0x05,0x08,0x05,0x36,0x3f, - 0x3f,0x2e,0x3f,0x3f,0x27,0x3f,0x3f,0x1f,0x3f,0x3f,0x17,0x3f,0x3f, - 0x0f,0x3f,0x3f,0x08,0x3f,0x3f,0x00,0x3f,0x3f,0x00,0x39,0x39,0x00, - 0x33,0x33,0x00,0x2d,0x2d,0x00,0x27,0x27,0x00,0x22,0x22,0x00,0x1c, - 0x1c,0x00,0x16,0x16,0x00,0x10,0x10,0x17,0x2f,0x3f,0x10,0x2c,0x3f, - 0x08,0x2a,0x3f,0x00,0x27,0x3f,0x00,0x23,0x39,0x00,0x1f,0x33,0x00, - 0x1b,0x2d,0x00,0x17,0x27,0x36,0x36,0x3f,0x2e,0x2f,0x3f,0x27,0x27, - 0x3f,0x1f,0x20,0x3f,0x17,0x18,0x3f,0x10,0x10,0x3f,0x08,0x09,0x3f, - 0x00,0x01,0x3f,0x00,0x00,0x3f,0x00,0x00,0x3b,0x00,0x00,0x38,0x00, - 0x00,0x35,0x00,0x00,0x32,0x00,0x00,0x2f,0x00,0x00,0x2c,0x00,0x00, - 0x29,0x00,0x00,0x26,0x00,0x00,0x22,0x00,0x00,0x1f,0x00,0x00,0x1c, - 0x00,0x00,0x19,0x00,0x00,0x16,0x00,0x00,0x13,0x00,0x00,0x10,0x0d, - 0x08,0x00,0x0f,0x09,0x00,0x12,0x0a,0x00,0x14,0x0b,0x00,0x16,0x0c, - 0x00,0x19,0x0d,0x00,0x1b,0x0e,0x00,0x1e,0x0f,0x00,0x20,0x10,0x00, - 0x22,0x11,0x00,0x25,0x12,0x00,0x28,0x15,0x03,0x2c,0x18,0x06,0x2f, - 0x1b,0x09,0x32,0x1e,0x0c,0x35,0x21,0x0e,0x39,0x24,0x11,0x3c,0x27, - 0x14,0x3f,0x2a,0x17,0x3f,0x2e,0x1c,0x3f,0x31,0x22,0x3f,0x35,0x27, - 0x3f,0x38,0x2c,0x22,0x1c,0x12,0x25,0x1f,0x14,0x29,0x22,0x17,0x2c, - 0x25,0x19,0x2f,0x28,0x1c,0x32,0x2a,0x1e,0x36,0x2d,0x20,0x39,0x30, - 0x23,0x3c,0x33,0x25,0x3f,0x3a,0x37,0x3f,0x38,0x34,0x3f,0x36,0x31, - 0x3f,0x35,0x2f,0x3f,0x33,0x2c,0x3f,0x31,0x29,0x3f,0x2f,0x27,0x3f, - 0x2e,0x24,0x3f,0x2c,0x20,0x3f,0x29,0x1c,0x3f,0x27,0x18,0x3c,0x25, - 0x17,0x3a,0x23,0x16,0x37,0x22,0x15,0x34,0x20,0x14,0x32,0x1f,0x13, - 0x2f,0x1e,0x12,0x2d,0x1c,0x11,0x2a,0x1a,0x10,0x28,0x19,0x0f,0x27, - 0x18,0x0e,0x24,0x17,0x0d,0x22,0x16,0x0c,0x20,0x14,0x0b,0x1d,0x13, - 0x0a,0x1b,0x12,0x09,0x17,0x10,0x08,0x15,0x0f,0x07,0x12,0x0e,0x06, - 0x10,0x0c,0x06,0x0e,0x0b,0x05,0x0a,0x08,0x03,0x3f,0x00,0x00,0x3f, - 0x04,0x00,0x3f,0x08,0x00,0x3f,0x0d,0x00,0x3f,0x11,0x00,0x3f,0x15, - 0x00,0x3f,0x19,0x00,0x3f,0x1d,0x00,0x3f,0x22,0x00,0x3f,0x26,0x00, - 0x3f,0x2a,0x00,0x3f,0x2e,0x00,0x3f,0x32,0x00,0x3f,0x37,0x00,0x3f, - 0x3b,0x00,0x3f,0x3f,0x00,0x3f,0x2f,0x00,0x36,0x28,0x00,0x2d,0x22, - 0x00,0x24,0x1b,0x00,0x1b,0x14,0x00,0x12,0x0d,0x00,0x09,0x07,0x00, - 0x00,0x00,0x00,0x29,0x00,0x28,0x23,0x00,0x2b,0x1d,0x00,0x2f,0x17, - 0x00,0x32,0x12,0x00,0x35,0x0c,0x00,0x38,0x06,0x00,0x3c,0x3f,0x3f, - 0x3f,0x3f - }; - diff --git a/16/v2/source/verge/README.TXT b/16/v2/source/verge/README.TXT deleted file mode 100755 index 84e756b6..00000000 --- a/16/v2/source/verge/README.TXT +++ /dev/null @@ -1,40 +0,0 @@ - -VERGE version 2.01a, Copyright (C) 1998 BJ Eirich (aka vecna) -VERGE comes with ABSOLUTELY NO WARRANTY. This is free software, -and you are welcome to redistribute it under certain conditions. -For details refer to GNU.TXT. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - ->Jan 1, 2000< - -Hey Guys, - -This is the old source for V2 (DJGPP), along with the sources for the utils (mostly DJGPP), the VCC compiler (DJGPP; though it should compiler under Watcom), and MapEd 2 (Watcom). Just getting this out the door. The new source will be released and updated regularly a week or so from now, so you can futz around with this until that time. - -I'm not sure the main engine even runs in this build, as all I got from compiling and running it was a fistful of page faults. Sorry, I don't feel like trying to make it work. It's old and stinky (enjoy! ^_^). It may be VC incompatibilities with newer stuff, it may be some minor oversight on my part from tweaking it at some point, it could by anything. - -The utils and MapEd 2 seemed to be in working order, however. Didn't include all the util sources, because they're hidden somewhere on my hard drive. I'll find them later (like when I clean this cluttered mess of a hard drive). - -I removed the CD audio code, because of GPL issues and it was a shoddy interface to begin with. I didn't take the FLI code out, though I can't remember where I got it from. It's likely I nabbed it up from X2FTP or some similar archive. If you can figure out where it's from and if I'm violating the GPL by including it (though I hacked it up a bit), just send me some proof of its origin and license and I'll remove it. - -Otherwise, wham. There ya go. If you have any questions about it, just drop me a line and I'll see what I can do. Happy New Year, and have fun with it... Or possibly heaping gobs of frustration. :-) - -- aen - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -Pertaining to MikMod: - -Parts of the library (in playercode/mdulaw.c) are derived from the files -libst.h and raw.c from an old version of the sox (SOund eXchange) package -written by Lance Norskog and Jef Poskanzer. The following copyright notice -applies to these parts: - -Copyright (C) 1989 by Jef Poskanzer. -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. This software is provided "as is" without express or -implied warranty. diff --git a/16/v2/source/verge/UTIL/CHRCONV/CHRCONV.C b/16/v2/source/verge/UTIL/CHRCONV/CHRCONV.C deleted file mode 100755 index 91ac6ac1..00000000 --- a/16/v2/source/verge/UTIL/CHRCONV/CHRCONV.C +++ /dev/null @@ -1,125 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -char c[100]; -FILE *f; -char *jalblkasd; -char byte, *t; -short word; -int quad; - -int bufsize=0; -unsigned char *csrc, *cb; - -void EmitC (unsigned char c) -{ - *csrc++=c; - bufsize++; -} - -void Compress(unsigned char *p, int len) -{ - int i; - unsigned char byt,samect; - unsigned char repcode; - - csrc=cb; - i=0; bufsize=0; - do - { byt=p[i++]; - samect=1; - while (samect<254 && i3 || byt == 0xFF) - { - repcode=0xFF; - EmitC(repcode); - repcode=(char) samect; - EmitC(repcode); - } - EmitC(byt); - } while (i v2 chr ---- -Chrconv is a remarkably simple utility, and that is a shame, because eventually you won't use it much at all. But initially it will be of great value to everyone, because it converts from old v1 chrs to new v2 chrs. - -The v2 chr it creates will emulate the animation behavior of a v1 exactly, so it should look and operate like you're used to. This is useful, because writing animation strings and handling odd-shaped chrs may not be something that appeals to you just yet. For example, the default animation string used by chrconv for walking north is:F16W10F17W10F16W10F15W10F18W10F19W10F18W10F15W10. - -To use chrconv, simply execute it. It will ask for the filename of the source v1 chr, and will convert it to v2 format. NOTE: it will overwrite the old chr, so you may want to back it up first. - -enjoy! \ No newline at end of file diff --git a/16/v2/source/verge/UTIL/CHRCONV/DARIN.CHR b/16/v2/source/verge/UTIL/CHRCONV/DARIN.CHR deleted file mode 100755 index 15b6debb84b5aa6bee7ba657b029e512b918bf49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15360 zcmeI3?`~8_62+(A!Z?;dQQm;f3t$^~9=_xy@Gu^aJg*bW3`UU>Su7y&2FQ?IK1O`n z-#OLQx9@nsV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dhv2#{B8LE_%R7!IFrf8zy1nAt{>S_=gZ^wEn$QN?^yV~oR~hwi%>%yd{SWx%{g1B24ex*8 z0NEdgB0v4X8>XAz|Km&$`Z(3l1O9-04*2Qc|FP|gCV7B4%F0Zl5-OH69LHw-<}ng(_^<_ubS=p8uu6&F?>=Kb{vn%Q_m; zJO;PRt(w diff --git a/16/v2/source/verge/UTIL/CHRCONV/MAKEDJ.BAT b/16/v2/source/verge/UTIL/CHRCONV/MAKEDJ.BAT deleted file mode 100755 index 5ad2d1f3..00000000 --- a/16/v2/source/verge/UTIL/CHRCONV/MAKEDJ.BAT +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -gcc -s -Wall -Werror -m486 -O3 chrconv.c -o chrconv.exe diff --git a/16/v2/source/verge/UTIL/CHRMAK/CHRMAK.CC b/16/v2/source/verge/UTIL/CHRMAK/CHRMAK.CC deleted file mode 100755 index d3ebd7ee..00000000 --- a/16/v2/source/verge/UTIL/CHRMAK/CHRMAK.CC +++ /dev/null @@ -1,653 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// CHRMAK.CC -// V2 PCX to CHR converter w/ makefiles -// -// coded by aen -// aen@verge-rpg.com - -#include -#include -#include -#include -#include -#include - -#include - -//////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// - -typedef unsigned char byte; -typedef unsigned short word; -typedef unsigned long quad; - -static void fputw(word w, FILE *fp) { fwrite(&w,1,2,fp); } -static void fputd(quad d, FILE *fp) { fwrite(&d,1,4,fp); } -static word fgetw(FILE *fp) { word w; fread(&w,1,2,fp); return w; } -quad fgetd(FILE *fp) { quad d; fread(&d,1,4,fp); return d; } - -// skips the number of bytes in the file; just seeks past them -static void fskip(int bytes, FILE *fp) - { fseek(fp,bytes,SEEK_CUR); } - -static void fputraw(char *raw, int bytes, FILE *fp) - { fwrite(raw, 1,bytes, fp); } - -// writes a null-terminated string to the file -void fputstrz(char *str, FILE *fp) - { fputraw(str, strlen(str)+1, fp); } - -// writes a string to the file (without the null-terminator), preceeded by -// a quad length marker -static void fputstrn(char *str, FILE *fp) - { int n=strlen(str)+1; fputd(n,fp); fputraw(str,n,fp); } - -//////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// - -#define CHRMAK_VER_MAJ 0 -#define CHRMAK_VER_MIN 1 -#define CHRMAK_VER_STR "0.1b" -#define CHRMAK_AUTHORS "aen" - -// parsing vars -static char *mak_base=0; -static char *makp=0; -static int mak_bytes=0; -static char mak_tok_ident[256]; -static char mak_tok_val[256]; -static int mak_tok_valn=0; // numeric val of mak_tok -static int mak_line=0; - -// makefile vars -static char chrmak_makefile[256]; - -static char pcx_name[256]; static int got_pcx_name=0; -static char chr_name[256]; static int got_chr_name=0; -static int frame_w=0; static int got_frame_w=0; -static int frame_h=0; static int got_frame_h=0; -static int hot_x=0; static int got_hot_x=0; -static int hot_y=0; static int got_hot_y=0; -static int hot_w=0; static int got_hot_w=0; -static int hot_h=0; static int got_hot_h=0; -static int per_row=0; static int got_per_row=0; -static int total_frames=0; static int got_total_frames=0; -static int lidle=0; static int got_lidle=0; -static int ridle=0; static int got_ridle=0; -static int uidle=0; static int got_uidle=0; -static int didle=0; static int got_didle=0; -static char lscript[256]; static int got_lscript=0; -static char rscript[256]; static int got_rscript=0; -static char uscript[256]; static int got_uscript=0; -static char dscript[256]; static int got_dscript=0; - -void warning(char *message, ...) -{ - static char buffer[256]; - va_list args; - - va_start(args, message); - vsprintf(buffer, message, args); - va_end(args); - - printf("%s \n", buffer); -} - -static void fatal(char *message, ...) -{ - static char buffer[256]; - va_list args; - - va_start(args, message); - vsprintf(buffer, message, args); - va_end(args); - - printf("%s \n", buffer); - - exit(0); -} - -//#ifdef __DJGPP__ -// Watcom has one of these -static int filelength(int handle) -{ - struct stat fileinfo; - if (-1 == fstat(handle, &fileinfo)) - fatal("error fstating"); - return fileinfo.st_size; -} -//#endif - -static int streq(char *a, char *b) -{ - while (*a) - { - if (*a++ != *b++) - return 0; - } - return !*b; -} - -static void usage() -{ - printf("usage: chrmak \n"); - exit(0); -} - -static void banner() -{ - printf("chrmak v%s  by %s \n", CHRMAK_VER_STR, CHRMAK_AUTHORS); -} - -static void parse_args(int argc, char *argv[]) -{ - if (argc != 2) - usage(); - - strcpy(chrmak_makefile, argv[1]); -} - -static void skip_cpp_comment() -{ - makp+=2; - while (*makp && '\n'!=*makp) - makp++; - if (*makp) - makp++; -} - -static void skip_c_comment() -{ - makp+=2; - while (*makp && ('*'!=makp[0] || '/'!=makp[1])) - { - if ('\n'==*makp) - mak_line++; - if ('/'==makp[0] && '*'==makp[1]) - skip_c_comment(); - else makp++; - } - if (*makp) - makp+=2; -} - -static void parse_whitespace() -{ - do { - if (!*makp) - return; - if (isspace(*makp)) - { - while (*makp && isspace(*makp)) - { - if ('\n'==*makp) - mak_line++; - makp++; - } - continue; - } - if ('/'==makp[0] && '/'==makp[1]) - { skip_cpp_comment(); continue; } - if ('/'==makp[0] && '*'==makp[1]) - { skip_c_comment(); continue; } - break; - } while (1); -} - -static void grab_ident() -{ - char *t=mak_tok_ident; - while (isalnum(*makp) || '_'==*makp) - *t++=*makp++; - *t=0; - strlwr(mak_tok_ident); -} - -static void grab_val() -{ - char *t=mak_tok_val; - while (isalnum(*makp) || '_'==*makp) - *t++=*makp++; - *t=0; - mak_tok_valn=atoi(mak_tok_val); -} - -static int ident_is(char *id) { return streq(mak_tok_ident,id); } - -static void do_assign() -{ - if (ident_is("pcx_name")) - { strcpy(pcx_name, mak_tok_val); got_pcx_name=1; return; } - else if (ident_is("chr_name")) - { strcpy(chr_name, mak_tok_val); got_chr_name=1; return; } - else if (ident_is("frame_w")) - { frame_w=mak_tok_valn; got_frame_w=1; return; } - else if (ident_is("frame_h")) - { frame_h=mak_tok_valn; got_frame_h=1; return; } - else if (ident_is("hot_x")) - { hot_x=mak_tok_valn; got_hot_x=1; return; } - else if (ident_is("hot_y")) - { hot_y=mak_tok_valn; got_hot_y=1; return; } - else if (ident_is("hot_w")) - { hot_w=mak_tok_valn; got_hot_w=1; return; } - else if (ident_is("hot_h")) - { hot_h=mak_tok_valn; got_hot_h=1; return; } - else if (ident_is("per_row")) - { per_row=mak_tok_valn; got_per_row=1; return; } - else if (ident_is("total_frames")) - { total_frames=mak_tok_valn; got_total_frames=1; return; } - else if (ident_is("lidle")) - { lidle=mak_tok_valn; got_lidle=1; return; } - else if (ident_is("ridle")) - { ridle=mak_tok_valn; got_ridle=1; return; } - else if (ident_is("uidle")) - { uidle=mak_tok_valn; got_uidle=1; return; } - else if (ident_is("didle")) - { didle=mak_tok_valn; got_didle=1; return; } - else if (ident_is("lscript")) - { strcpy(lscript, mak_tok_val); got_lscript=1; return; } - else if (ident_is("rscript")) - { strcpy(rscript, mak_tok_val); got_rscript=1; return; } - else if (ident_is("uscript")) - { strcpy(uscript, mak_tok_val); got_uscript=1; return; } - else if (ident_is("dscript")) - { strcpy(dscript, mak_tok_val); got_dscript=1; return; } - - fatal("%s: unknown ident '%s' on line %i", - chrmak_makefile, mak_tok_ident, mak_line); -} - -static int parse_assign() -{ - int last_line=0; // helper for error detection - - parse_whitespace(); - if (!*makp) - return 1; - else if (isalpha(*makp)) - { - grab_ident(); // get ident - last_line=mak_line; - - parse_whitespace(); // expect - if ('=' != *makp++) - fatal("%s: expected = on line %i", chrmak_makefile, last_line); - - parse_whitespace(); // get val - grab_val(); - last_line=mak_line; - - do_assign(); - - parse_whitespace(); // expect - if (';' != *makp++) - fatal("%s: expected ; on line %i", chrmak_makefile, last_line); - else while (';'==*makp) makp++; - - return 0; - } - fatal("%s: expected ident, got '%c' on line %i", - chrmak_makefile, *makp, mak_line); - return 1; -} - -static void check_needs() -{ - if (!got_pcx_name) fatal("%s: pcx_name missing", chrmak_makefile); - if (!got_chr_name) fatal("%s: chr_name missing", chrmak_makefile); - if (!got_frame_w) fatal("%s: frame_w missing", chrmak_makefile); - if (!got_frame_h) fatal("%s: frame_h missing", chrmak_makefile); - if (!got_hot_x) fatal("%s: hot_x missing", chrmak_makefile); - if (!got_hot_y) fatal("%s: hot_y missing", chrmak_makefile); - if (!got_hot_w) fatal("%s: hot_w missing", chrmak_makefile); - if (!got_hot_h) fatal("%s: hot_h missing", chrmak_makefile); - if (!got_per_row) fatal("%s: per_row missing", chrmak_makefile); - if (!got_total_frames) fatal("%s: total_frames missing", chrmak_makefile); - if (!got_lidle) fatal("%s: lidle missing", chrmak_makefile); - if (!got_ridle) fatal("%s: ridle missing", chrmak_makefile); - if (!got_uidle) fatal("%s: uidle missing", chrmak_makefile); - if (!got_didle) fatal("%s: didle missing", chrmak_makefile); - if (!got_lscript) fatal("%s: lscript missing", chrmak_makefile); - if (!got_rscript) fatal("%s: rscript missing", chrmak_makefile); - if (!got_uscript) fatal("%s: uscript missing", chrmak_makefile); - if (!got_dscript) fatal("%s: dscript missing", chrmak_makefile); -} - -static void parse_makefile() -{ - FILE *fp=0; - - printf("ú parsing %s \r", chrmak_makefile); - fflush(stdout); - - fp=fopen(chrmak_makefile, "rb"); - if (!fp) fatal("unable to open %s", chrmak_makefile); - - mak_bytes=filelength(fileno(fp)); // calc bytes - mak_base=new char [mak_bytes+1]; // alloc room - fread(mak_base,1,mak_bytes,fp); // read bytes - mak_base[mak_bytes]=0; // null-term - makp=mak_base; // setup cur byte ptr - mak_line=1; - - while (!parse_assign()) - ; - - // got everything we need? - check_needs(); - - delete[]mak_base; mak_base=0; - makp=0; - - fclose(fp); - - printf("û \n"); - fflush(stdout); -} - -//////////////////////////////////////////////////////////////////////////// -// PCX & COMPRESS STUFF //////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// - -static FILE *chrfp=0; -static FILE *pcxfp=0; -static byte *virscr=0; - -int manufacturer=0; // pcx header -int version=0; -int encoding=0; -int bpp=0; -int xmin=0,ymin=0; -int xmax=0,ymax=0; -int hres=0,vres=0; -char palette[48]; -int reserved=0; -int color_planes=0; -int bpl=0; -int palette_type=0; -char filler[58]; -byte pal[768]; - -int image_width=0,image_depth=0; -quad vidoffset=0; - -void LoadPCXHeader() -{ - manufacturer = fgetc(pcxfp); // always 10 - version = fgetc(pcxfp); // should be 5? - encoding = fgetc(pcxfp); // always 1 - bpp = fgetc(pcxfp); // bits per pixel - - xmin = fgetw(pcxfp); // grab window - ymin = fgetw(pcxfp); - xmax = fgetw(pcxfp); - ymax = fgetw(pcxfp); - image_width = xmax-xmin+1; // calc dims - image_depth = ymax-ymin+1; - - hres = fgetw(pcxfp); - vres = fgetw(pcxfp); - - fread(palette,1,48,pcxfp); // ega color map - - reserved = fgetc(pcxfp); - color_planes = fgetc(pcxfp); // should be 1 - - bpl = fgetw(pcxfp); // bytes per line - palette_type = fgetw(pcxfp); - - fread(filler,1,58,pcxfp); // nothing important here -} - -void ReadPCXLine(byte *dest) -{ - int i=0,c=0,n=0,run=0; - - // decode a row - for (n=0; n3 || byt == 0xFF) - { - emitc(0xFF); - emitc(samect); - } - emitc(byt); - - } while (i dumping %s \n", chr_name); - fflush(stdout); - - chrfp=fopen(chr_name, "wb"); - if (!chrfp) fatal("unable to open %s", chr_name); - - WriteInfo(chrfp); - WriteFrames(pcx_name,chrfp); - WriteScripts(chrfp); - - fclose(chrfp); - - printf("complete! \n"); - fflush(stdout); -} - -int main(int argc, char *argv[]) -{ - banner(); - - parse_args(argc, argv); - parse_makefile(); - - write_chr(); - - return 0; -} diff --git a/16/v2/source/verge/UTIL/CHRMAK/CHRMAK.TXT b/16/v2/source/verge/UTIL/CHRMAK/CHRMAK.TXT deleted file mode 100755 index b8767f13..00000000 --- a/16/v2/source/verge/UTIL/CHRMAK/CHRMAK.TXT +++ /dev/null @@ -1,118 +0,0 @@ -chrmak.exe -the utility with bloated code perpetrated by aen (aen@verge-rpg.com for hate mail) -documentation -by zeromus 5.8.99 -zermous@verge-rpg.com -(be sure word wrap is on) ---- -USE: creates v2 chr from pcx file ---- -You'll use this bad boy a lot, unless you have one of those newfangled graphical chr editors. What we do here is have a character ready in the standard pcx-graphics format (that is, with a one-pixel buffer between frames), and give it to chrmak, along with a text file describing what characteristics the output v2 chr should have. - -to run chrmak, simply execute chrmak with the makefile, with extension (ex: vecna.mak) as the first and only argument. (ex: "chrmak vecna.mak") - -The characteristics file is technically called a make file, or .mak. it containst several variables, and what they should be. for example: - -/* comment */ -pcx_name=rath; //comment -chr_name=rath; - -these variables can be scattered around anywhere in the mak file, so long as they have a semicolon after each command. you can stick comments anywhere like a c or vc file. here is a list of all the variables you need to set in the make file, what they are, and their typical values. In most cases, however, you should be able to just replace the values found in the samples rath.mak and vecna.mak with your own. - ---- - -**pcx_name** the file name of the source pcx file, sans extension. note in the above examples or in the sampel .mak files it is not pcx_name = rath.pcx, only rath. -**chr_name** the filename, sans extension, of the chr file to output. same as above in all other respects. - -**frame_w** the width of each frame of the chr (DEFAULT 16) -**frame_h** the height of each frame (DEFAULT 32) - -**hot_x** the x-coord of the chr's hotspot. See appendix A for info on chr hotspots. (DEFAULT 0) -**hot_y** the same, but y-coord (DEFAULT 16) -**hot_w** the width of the obstructing region of the hotspot. (DEFAULT 16) -**hot_h** the height of the obstructing region of the hotspot. (DEFAULT 16) - -**per_row** the number of frames per row in the pcx file. in old v1 chr/pcx files, this was 5. (DEFAULT 5) -**total frames** total number of frames in the pcx file. (DEFAULT 20) - -**lidle** the frame to show when the chr is idling, facing the left (DEFAULT 10) -**ridle** the frame to show when the chr is idling, facing the right (DEFAULT 15) -**uidle** the frame to show when the chr is idling, facing up (DEFAULT 5) -**didle** the frame to show when the chr is idling, facing down (DEFAULT 0) - -**lscript** the animation script for when the chr moves to the left. See appendix B for discussion of animation scripts. (DEFAULT F10W10F11W10F12W10F11W10F10W10F13W10F14W10F13W10) -**rscript** the animation script for when the chr moves to the right. (DEFAULT F15W10F16W10F17W10F16W10F15W10F18W10F19W10F18W10) -**uscript** the animation script for when the chr moves up (DEFAULT F5W10F6W10F7W10F6W10F5W10F8W10F9W10F8W10) -**dscript** the animation script for when the chr moves down (DEFAULT F0W10F1W10F2W10F2W10F0W10F3W10F4W10F3W10) - ---- - -APPENDIX A: Hotspots - -If a chr is located at coordinates (x,y) on the screen, then the pixel under the hotspot on the chr will be drawn at (x,y). - -You may think--"I tell a chr to go to (5,4) on the screen... but where exactly does it go? (4,4) from the middle, the left edge, or what?" -Imagine three scenarios: a 4x4 sprite with the hotspot at top left, bottom left, and middle left, respectively: - - Top Left Bottom Left Middle Left -0123456789ABCDEF 0123456789ABCDEF 0123456789ABCEDEF -1 1 **** 1 -2 +---hotspot 2 **** 2 **** -3 \|/ 3 **** 3 \**** -4 @*** 4 @*** 4 +--@*** -5 **** 5 /|\ 5 | /**** -6 **** 6 +---hotspot 6 | -7 **** 7 7 +---hotspot -8 8 8 - -So you can see how the hotspot determines how the sprite is oriented, relative to its current screen position. - -The default hotspot, (and its equivalent in v1) is at (0,16). That is, 0 to the right and 16 down from the upper-left corner of the sprite. Remember, default chr size is 16x32, and on computer, the (+,+) quadrant is quadrant IV. In other words - - -32 - -24 - -16 - -8 --16 -12 -8 -4 0 4 8 12 16 - 8 * * * * - 16 * * * * <--- sprite goes there. - 24 @ * * * @ is where hotspot would be - 32 * * * * - -Hotspots also have an obstruction width and height. This is the area of the chr that touches the ground, and cannot walk over things. In your game, you may want your head to be drawn on top of a wall, if your feet are against the bottom of the wall, right? But you don't want your feet drawn on top of the wall. - -+----------------------+ -| | -| | -| | -| | -| +---+ | -| |***| | -+------|@@@|-----------+ - +---+ - -The messy area is the chr; the @@@, and the --- beneath it, would be OBSTRUCTIVE. If the player tried to walk up, he couldnt--you would be walking into the wall. The *** and the --- above it would not be obstructive. - -Obstructive areas are defined by declaring their width and height, based from the chr's hotspot. the default values, a width and height of 16, would count over 16 and down 16 from the hotspot, effectively making the bottom 16x16 square of the 16x32 chr obstructive. - -Final example: -A 32x64 giant might be defined like this: - -... -hot_x=8; -hot_y=48; -hot_w=16; -hot_h=16; -... - ---- - -APPENDIX B: Animation scripts - -Animation scripts are made of a string of no more than 255 characters. This string can contain any combination of COMMAND CODES, of which there are two. - -The two COMMAND CODES are F and W. - -**F** sets the current frame that should be shown. So, if you want your animation, when walking to go from frame 12 to 15, you would make the script: "F12F13F14F15F14F13F12". The F can have any number of digits after it, so you don't have to do F03F05, etc.. you can just do F3F5. - -**W** makes the animation string wait the specified number of milliseconds. If you peek at the default animation strings mentioned a ways up, you'll see that there is a Wxx between each frame. This pauses the frame so you can see it, effectively slowing the animation down. In fact, the animation we just maed an example of, "F12F13F14F15F14F13F12", would g oby *waaay* too fast. Now that we know the W command we can fix it: "F12W10F13W10F14W10F15W10F14W10F13W10F12W10". \ No newline at end of file diff --git a/16/v2/source/verge/UTIL/CHRMAK/MAKEDJ.BAT b/16/v2/source/verge/UTIL/CHRMAK/MAKEDJ.BAT deleted file mode 100755 index 6283a1f4..00000000 --- a/16/v2/source/verge/UTIL/CHRMAK/MAKEDJ.BAT +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -gxx -s -Wall -Werror -m486 -O3 chrmak.cc -o chrmak.exe diff --git a/16/v2/source/verge/UTIL/CHRMAK/MAKEWAT.BAT b/16/v2/source/verge/UTIL/CHRMAK/MAKEWAT.BAT deleted file mode 100755 index 21b58471..00000000 --- a/16/v2/source/verge/UTIL/CHRMAK/MAKEWAT.BAT +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -wcl386 /bt=dos /l=pmodew /mf /os /5r /fp5 /wx /we chrmak.cc diff --git a/16/v2/source/verge/UTIL/CHRMAK/VECNA.MAK b/16/v2/source/verge/UTIL/CHRMAK/VECNA.MAK deleted file mode 100755 index baa4a9c4..00000000 --- a/16/v2/source/verge/UTIL/CHRMAK/VECNA.MAK +++ /dev/null @@ -1,21 +0,0 @@ - -/* CHRMAK makefile - û aen */ - -pcx_name=vecna; // image source -chr_name=vecna; // output .CHR name - -frame_w=16; frame_h=32; // frame dims - -hot_x=0; hot_y=16; // hotspot coord -hot_w=16; hot_h=16; // hotspot dims - -per_row=5; total_frames=20; // frames per row, total - -lidle=10; ridle=15;; // left/right idle frames -uidle=5; didle=0; // up/down idle frames - -lscript=F10W10F11W10F12W10F11W10F10W10F13W10F14W10F13W10; // movement scripts -rscript=F15W10F16W10F17W10F16W10F15W10F18W10F19W10F18W10; -uscript=F5W10F6W10F7W10F6W10F5W10F8W10F9W10F8W10; -dscript=F0W10F1W10F2W10F2W10F0W10F3W10F4W10F3W10; diff --git a/16/v2/source/verge/UTIL/CHRMAK/VECNA.PCX b/16/v2/source/verge/UTIL/CHRMAK/VECNA.PCX deleted file mode 100755 index 2e82dcb2c21a298e83e627bb78df6ac4ff97bebb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15740 zcmds8O=uiRmVQCXNT|(Vj1NBeAQ}y01`i0Y4n7E02e+jLAAHe4hdKz_4LWFq4nFvx zgAYE)q=YAGEo(`$ zweGjbA#&Uaz7_I0puYuph*WcpoMjsENN$!&0^pnAdGIp$Mn1*aOPqh>N$|Dq$)z}! zyUQ;yP)-1Y1v$42dn!l;2}WHb1X&k-4fG@KHHG+88;Q3;B4Uh?xs zrgBuc469WsPRRBXQdC#X7*<1VKpUF!{SSA zF$T;y2sEQ1)JtF#_z3Fg#ERt{FiC7enppB~{v@iRU9LpZWGjT*M!Uxxk;X!c>F`(7?Jy<-dC8C!b#Eg8W*&lY^;24BEDfkkKq&2@aZUcAgXb_0Ec7RxzEj96lDhwdM(CL=IaPBjKqRIhZjvaXO1PpmkiTi?=XqK_EDD+^jReOaMMi) zI+s+ti_mmiGH%=4$!qgM;D$anj5*{k_?eBG4Z9hqYB@6>#+jM6noS*i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JU1k7Zg7`)5ZE)my#dq;i0jaqxDT5`1Y9enIpez$psAS!{>=#v;F^WUrI0?zhMX5 zq^B|h>%U=0gJ*v&#` zQ0%}{i7mDgcq(L--Y;*og#6UcQGNeBvrBy(4aaijm+*J_^CX*AvpG_Z?QghPECtiz z5vCRad3Gm(jD!P8j*WGVY!;7sj#-;SmJx7zL`|YDP=+k69kb#uFV=El!Da+uo{j&% zL6dIGbIaN+RaOkTiq6P*+~?AIG3}Cuu+XlC(;qDzNqE#gi)Q5;-)pT7{P4Mp@jeB| zxX0;tab0!CIC*XBpH_0NVlzJcUbCk-KZ*Y;daVCzIx#VE+9?Fdi}|hCwqH)`}_Ov-n~;quZeyjdPcNGv_bTU=swXr(G<}n z(FD!AaRR38}KliJjyVTFLzen43T3ez@g>K)bi7^@;qW*q*q6&4@zoxnt z6y4pYTibMFjYcZ8r}ox=Ua!2aOzuw>_6mJZ`ntBdND{3PEfFo~jHiii6WvUbE)ZQK z8YJqYj^2)w=TDyLI^$%c3Q8frE~T*FN&EY>y-jOtoY2%1O-#`6FcKw%(* zqUn8_+@`TLDpa@(8@dd)RAEGyp<7WKDsjAu_I6QUHw~VrYZqv^hpzY1*d@BzN4NTE z>N3p@(!$WmM}EK|!rgsQQ$8R#87Znwl7#o4j^^s_4^PxyT|L`S+mBTJzS^j$^}FiPEp>lFRYu;;75*_j z{QcC>lUvueCa-SX99)~Y{9v?y;d)S5t!o!NL?p&gVYqMc~TEZtrNCh)%T=cbD7l!?JdyS6x|)8 kv1>HgOWo)AzeC@rg=t#4K^q0y8l-1E^ut+thfCqV06|dMLjV8( diff --git a/16/v2/source/verge/UTIL/CHRMAK/VER b/16/v2/source/verge/UTIL/CHRMAK/VER deleted file mode 100755 index 12088dab..00000000 --- a/16/v2/source/verge/UTIL/CHRMAK/VER +++ /dev/null @@ -1,4 +0,0 @@ - - current version - - chrmak.exe 0.1b diff --git a/16/v2/source/verge/UTIL/PACK/MAKEDJ.BAT b/16/v2/source/verge/UTIL/PACK/MAKEDJ.BAT deleted file mode 100755 index dcc8a93a..00000000 --- a/16/v2/source/verge/UTIL/PACK/MAKEDJ.BAT +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -gcc -s -Wall -Werror -m486 -O3 pack.c -o pack.exe diff --git a/16/v2/source/verge/UTIL/PACK/PACK.C b/16/v2/source/verge/UTIL/PACK/PACK.C deleted file mode 100755 index f349ab0d..00000000 --- a/16/v2/source/verge/UTIL/PACK/PACK.C +++ /dev/null @@ -1,166 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#define byte unsigned char - -// ================================= Data ==================================== - -FILE *pack; -FILE *list; -FILE *src; -char *strbuf,*filebuf; -int numfiles,curofs; -char headertag[]="VRGPACK"; - -typedef struct -{ - unsigned char fname[84]; // pathname thingo - int size; // size of the file - int packofs; // where the file can be found in PACK - int count; // internal (engine-runtime) use - char extractable; // can UNPACK .. unpack it? - char override; // should the engine override it w/ - // local files? -} filestruct; - -filestruct filetbl[512]; -byte *ptr; - -// ================================= Code ==================================== - -void CreatePackHeader() -{ char a; - - fwrite(&headertag, 1, 7, pack); - a=1; fwrite(&a, 1, 1, pack); // pack version 1 - fwrite(&numfiles, 1, 4, pack); // number of files in archive - - // Hmm.. that's it. What a boring header. :) -} - -void EncryptHeader() -{ byte lastvalue; //, precodebyte; - - ptr=(byte *) filetbl; - lastvalue=*ptr; - ptr++; - - while (ptr < (byte *) (int) filetbl + (int) 5120) - { - (*ptr)+=lastvalue; - lastvalue=*ptr; - ptr++; - } -} - -void DecryptHeader() -{ byte lastvalue, precodebyte; - - ptr=(byte *) filetbl; - lastvalue=*ptr; - ptr++; - - while (ptr < (byte *) (int) filetbl + (int) 5120) - { - precodebyte=*ptr; - (*ptr)-=lastvalue; - lastvalue=precodebyte; - ptr++; - } -} - -void BuildFileTable() -{ int i; - - curofs=12+(numfiles*100); - memset(filetbl, 0, sizeof filetbl); - - for (i=0; i \n"); - exit(-1); - } - - if (!(list=fopen(argv[1],"r"))) - { - printf("Unable to open file %s. \n",argv[1]); - exit(-1); - } - - strbuf=(char *) malloc(100); - fscanf(list,"%s",strbuf); - - if (!(pack=fopen(strbuf,"wb"))) - { - printf("Unable to create file %s. \n",strbuf); - exit(0); - } - fscanf(list,"%d",&numfiles); - - CreatePackHeader(); - BuildFileTable(); - DumpFiles(); - - fclose(list); - fclose(pack); - - return 0; -} diff --git a/16/v2/source/verge/UTIL/PACK/PACK.TXT b/16/v2/source/verge/UTIL/PACK/PACK.TXT deleted file mode 100755 index b3f565b1..00000000 --- a/16/v2/source/verge/UTIL/PACK/PACK.TXT +++ /dev/null @@ -1,36 +0,0 @@ -pack.exe -documentation -by zeromus 5.8.99 -zeromus@verge-rpg.com -(be sure word wrap is on) ---- -USE: creates v2 pakfile ---- -v2 enjoys its own built-in pakfile system. v2 can use files in any number of pakfiles at the same time it can read files from your computer's regular directory structure. This allows for simplified distribution and management of v2 games, as well as adding a small measure of security to the data you worked so hard to create for your game--it will be a pain for losers to remove (read: rip) data from pakfiles, although we make no gurantees that your data is safe. This should help the situation some. - -To create a packfile, pack.exe takes a makefile of the following format: - ---- <--cut below this line :) -pakfile_to_create.vrg -number_of_files -file_name_1 flag_extrractable flag_overrideable -file_name_2 flag_extrractable flag_overrideable -file_name_3 flag_extrractable flag_overrideable ---- - -Here it is with sample data. - ---- -test.vrg -3 -pack.c 0 0 -test.mak 1 0 -test.obj 0 1 ---- - -This would create test.vrg with three files: pack.c, neither overrideable nor extractable, test.mak, extractable, but not overrideable, and test.obj, only overrideable. - -Extractable means that the file will be extracted by unpack.exe. Files you want to keep secret should have a 0 for this. - -Overrideable files will be overridden by a file of the same name in the game directory. That means, if there is a file in the game directory, it will use that one instead of the one in the pakfile. Otherwise, the copy in the pakfile will always be used. You'll usually want this set to 1, as it facilitates patches, etc. For example, if battle.map had a bug in it, you could just distribute a copy of the corrected battle.map for users to chunk in the game directory, and v2 would use the corrected copy instead. - diff --git a/16/v2/source/verge/UTIL/PACK/TEST b/16/v2/source/verge/UTIL/PACK/TEST deleted file mode 100755 index 7de7a6ca..00000000 --- a/16/v2/source/verge/UTIL/PACK/TEST +++ /dev/null @@ -1,5 +0,0 @@ -test.vrg -3 -pack.c 1 1 -pack.exe 1 1 -todo 1 1 diff --git a/16/v2/source/verge/UTIL/PACK/TODO b/16/v2/source/verge/UTIL/PACK/TODO deleted file mode 100755 index f873c218..00000000 --- a/16/v2/source/verge/UTIL/PACK/TODO +++ /dev/null @@ -1,3 +0,0 @@ -entity/entity, point makes contact w/entity, entity/bbox,b -box/bbox,and a line intersect/entity and line intersect/bbox. -sin,cos and tan() functions. diff --git a/16/v2/source/verge/UTIL/PCX2FNT/FONT0.PCX b/16/v2/source/verge/UTIL/PCX2FNT/FONT0.PCX deleted file mode 100755 index a8eee682ba982a0293ecff8843112f128ec73ce1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11576 zcmeHNEl^`w7QTorwzg;U1OkCTL_{!EEg}#RY*j=AA_9SEfrvmL5G^7i5G^7i5D|zj z3W10~AX*?0R6*0sRBDUaWvjYsB3krLA*fn*XTuYOktyZhuZg;!gy}iA` zU~qbRIvfs1qtV^nU7qJ|=1((R^h^K!n0;HyGyeQD%f5DamE>K=dRe-3`=xW2o#W$@ zDuvfONDGoY`%z3m{?1_?re!(Sy>+FxrdzszRIc|i%=BuS3$+h37e&3d3h6DR4|$|f zzB0FeNo}`(4wsajBM^_kTyp|I_Dh)OAPv(9fCj@6OBakpmZ$@p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SB+4UmN_LoFLoS9?aEZp*VQD-ugZ3!ebwmAPKOiRSxdhOL1ogejm>8A!n+B1|9^ zd=kTm15|{{v~We>t1Ix#wixF*xQwI*=N)1jT?Aw<3hDE+JSUM+izLxjkso%-}*J6PGeW1JYCo zfIVEA3kFUkRcEY-7}@%UFejT8FN(E3h*$kNldcGl~|R)gGIbpJiw2U2EjBHN>AntCk;?R zmIat9NoHh;k}tU~n8wpv{ElE8r#Ke?b`pveq)8{tzide>Ksx8IXA;=`ngEchiF_Ph zVpYMhrHdJHI81e8;r zGJoDifmu{xtl!C=63!VA`l*&TX>Gg>2Ww-F;%-qmtgtZ^y%eH^tjTFJA~)`jg#+366)9fo1NKC|5<;K4Nm7zZx(NE%eVRSJYUW8tvv7L`B9z^^R1rFUzU|gJZlmY6_FQM+dMEDn zg*(1+XCK_ny}Qk;-RnmGX5(PgKK{@@yFI?X8-DoV?uVbQyY8kx|Nfx*;kfznbo*|& zdp|n<_uWl>X@0f3uwE;->Xq&0^Uiv;+p6`q>Id!B!K?K*yBlY(H;03l@85Jjo^|hs z{q5>}ySA`XFZWiL`fJtK8!Lm&#_`Lwlbwx=-qvuheRJ6TaJ+YWc6dKL`Dt{uyzs1E z&YDYe8`b%(+F~0KH<$YB)q_^;c)M}hZeG1wf4|%M_-|pau=n!h;MMTW-soa*|Nb<;yIv}1%S&_h<+-($`Hj{2?X`u@ hi-lfmVQ*{x@a6oQ_T1Ud-1Vz$)O&WfJ3BKo^Izq~R<-~D diff --git a/16/v2/source/verge/UTIL/PCX2FNT/FONT02B.PCX b/16/v2/source/verge/UTIL/PCX2FNT/FONT02B.PCX deleted file mode 100755 index 26f4cd95ef83b691afbc8a8f572a65ff1a1c3a99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21809 zcmds9Eo@v_mcAwJDy!|a3Is&5L4biljnu#(k_|GFfkA*lKtMo%K|p{(0|SGM)WEx$nNR)06E@OEWvJe(&AC zbH4MPpL^e%R{#6I4*sp+e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0b;f%hB!Ew?}W5)+e{_y}SA7Vz~S9 zn`gh=I0nBrSIW|AS>7n$Zk6>%Wn-t@-z$#}%9H11@2DKSDK94F_Wso_4CQj<@vKu7svl~`F>+` z>)z_pgZ1U@jg_6PZ}%Ro?r*OjKG}G=d++G`2R}S}^!CN$^P}&6`eE=jH#)q(`r^^uqsN=a-`#)n^wH$t$@%l$_pkOp96$f~_SL8JH@{x|cxUOG zjpgCi=;ou91mWE~J z);FumH#fdr+FBny++5#zu=(`KgTuY;R|ns{dHMbM56>?qN1uK=nO(jcEf4REZf@MU xdH?RMNB3^+++W&zxOA|+^!&-KSKr -#include - -char fname1[100], fname2[100]; -int xs, ys, ns; -FILE *fnt,*pcxf; -char *virscr; - -char manufacturer; // pcx header -char version; -char encoding; -char bits_per_pixel; -short int xmin,ymin; -short int xmax,ymax; -short int hres; -short int vres; -char palette[48]; -char reserved; -char color_planes; -short int bytes_per_line; -short int palette_type; -char filler[58]; -unsigned char pal[768]; - -unsigned short int width,depth; -unsigned short int bytes; -unsigned char c, run, ss=0; -unsigned int vidoffset, n=0; - -void ReadPCXLine(unsigned char *dest) -{ - int j; - n=0; - - do { - c=fgetc(pcxf) & 0xff; - if ((c & 0xc0)==0xc0) { - run=c & 0x3f; - c=fgetc(pcxf); - for (j=0; j -#include -#include - -// ================================= Data ==================================== - -struct span -{ - int begin, end; // begin & end location of span - int len, inverse; // lenth of span and inverse on/off -}; - -struct span spans[32]; // maximum of 32 spans. -char numspans; // number of active spans in PDF - -unsigned char *transparencytbl; // full transparency table (64k) -char outname[100]; // output filename -char paldefname[100]; // palette definition filename -char *strbuf; // generic string buffer - -char spanidx[256]; // Color -> Span xlat table - -// ================================= Code ==================================== - -void ParsePaletteDefinition(FILE *f) -{ int i; - - fscanf(f,"%s",strbuf); - if (stricmp("gradients",strbuf)) - { - printf("Not a valid PDF file. \n"); - exit(-1); - } - fscanf(f,"%s",strbuf); - numspans=atoi(strbuf); - - for (i=0; iW@ct_adCBZ^=`SWwm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HPuw|ox;#&j zNHp5e($d)8-rCjG-qX|B+tT0vP(W6#(Mb{3u+&+@hb`NK^?>)R@|FQn@sa=z&Moyj0 zoSiv*zBoC*c|Bct z-|0JedtmC;@R_yb`BnI*C92w+8@k#Ww|BPe=L z%XI42(oA`65%jH5)!D3i+9EqTql4YeBYka|{?75C?y0?fXATdZpBz~{v;W5V$y-;? zf?jngwO!y0!e*s1N{uTu8Ht>VHk@mYQd{F#-HcJpUd5m75MXDl|OHn%SfH} vhPGHkdtXEQKttO|q%jkX9BWt8eU0aKcN8ajm(LHa-8ft>pF`%C%jJ&)|DKjP diff --git a/16/v2/source/verge/UTIL/TRANS/VERGE.PDF b/16/v2/source/verge/UTIL/TRANS/VERGE.PDF deleted file mode 100755 index c55b015e..00000000 --- a/16/v2/source/verge/UTIL/TRANS/VERGE.PDF +++ /dev/null @@ -1,17 +0,0 @@ -gradients 16 -starts 0 ends 31 endspan -starts 32 ends 47 inverse endspan -starts 48 ends 55 inverse endspan -starts 56 ends 63 endspan -starts 64 ends 79 inverse endspan -starts 80 ends 87 inverse endspan -starts 88 ends 111 inverse endspan -starts 112 ends 127 inverse endspan -starts 128 ends 135 inverse endspan -starts 136 ends 159 inverse endspan -starts 160 ends 182 endspan -starts 183 ends 191 endspan -starts 191 ends 223 inverse endspan -starts 224 ends 239 endspan -starts 240 ends 247 inverse endspan -starts 248 ends 254 inverse endspan diff --git a/16/v2/source/verge/UTIL/UNPACK/MAKEDJ.BAT b/16/v2/source/verge/UTIL/UNPACK/MAKEDJ.BAT deleted file mode 100755 index 1077e24c..00000000 --- a/16/v2/source/verge/UTIL/UNPACK/MAKEDJ.BAT +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -gcc -s -Wall -Werror -m486 -O3 unpack.c -o unpack.exe diff --git a/16/v2/source/verge/UTIL/UNPACK/TEST b/16/v2/source/verge/UTIL/UNPACK/TEST deleted file mode 100755 index 7de7a6ca..00000000 --- a/16/v2/source/verge/UTIL/UNPACK/TEST +++ /dev/null @@ -1,5 +0,0 @@ -test.vrg -3 -pack.c 1 1 -pack.exe 1 1 -todo 1 1 diff --git a/16/v2/source/verge/UTIL/UNPACK/TODO b/16/v2/source/verge/UTIL/UNPACK/TODO deleted file mode 100755 index f873c218..00000000 --- a/16/v2/source/verge/UTIL/UNPACK/TODO +++ /dev/null @@ -1,3 +0,0 @@ -entity/entity, point makes contact w/entity, entity/bbox,b -box/bbox,and a line intersect/entity and line intersect/bbox. -sin,cos and tan() functions. diff --git a/16/v2/source/verge/UTIL/UNPACK/UNPACK.C b/16/v2/source/verge/UTIL/UNPACK/UNPACK.C deleted file mode 100755 index d6c79bef..00000000 --- a/16/v2/source/verge/UTIL/UNPACK/UNPACK.C +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#define byte unsigned char -// ================================= Data ==================================== - -FILE *pack; -FILE *src; -char strbuf[2048],*filebuf; -int numfiles; -char headertag[]={ 'V','R','G','P','A','C','K',0 }; - -struct filestruct -{ - unsigned char fname[84]; // pathname thingo - int size; // size of the file - int packofs; // where the file can be found in PACK - int count; // internal (engine-runtime) use - char extractable; // can UNPACK .. unpack it? - char override; // should the engine override it w/ - // local files? -}; - -struct filestruct filetbl[512]; - -// ================================= Code ==================================== - -void DecryptHeader() -{ byte lastvalue, precodebyte, *ptr; - - ptr=(byte *) filetbl; - lastvalue=*ptr; - ptr++; - - while (ptr < (byte *) (int) filetbl + (int) 5120) - { - precodebyte=*ptr; - (*ptr)-=lastvalue; - lastvalue=precodebyte; - ptr++; - } -} - -void CheckPackHeader() -{ char a; - - fread(strbuf, 1, 7, pack); - strbuf[8]=0; - if (strcmp(strbuf,headertag)) - { - printf("*error* Not a valid VRG packfile. \n"); - exit(-1); - } - fread(&a, 1, 1, pack); - if (a!=1) - { - printf("*error* Incorrect VRG packfile version. \n"); - exit(-1); - } - fread(&numfiles, 1, 4, pack); - fread(&filetbl, 100, numfiles, pack); - DecryptHeader(); -} - -void DumpFiles() -{ int i; - - printf("UNPACK v.0.1 Copyright (C)1997 BJ Eirich\n"); - for (i=0; i \n"); - exit(-1); - } - - if (!(pack=fopen(argv[1],"rb"))) - { - printf("Unable to open file %s. \n",argv[1]); - exit(-1); - } - - CheckPackHeader(); - DumpFiles(); - - fclose(pack); - - return 0; -} diff --git a/16/v2/source/verge/UTIL/UNPACK/UNPACK.TXT b/16/v2/source/verge/UTIL/UNPACK/UNPACK.TXT deleted file mode 100755 index e75838d9..00000000 --- a/16/v2/source/verge/UTIL/UNPACK/UNPACK.TXT +++ /dev/null @@ -1,13 +0,0 @@ -unpack.exe -documentation -by zeromus 5.8.99 -zeromus@verge-rpg.com -(be sure word wrap is on) ---- -USE: extracts files from v2 pakfile ---- -It doesnt get any better than this. type unpack followed by the name of the packfile you want to unpack. if you can't get that right, unpack.exe will give you even more explicit instructions. unpack.exe will then dump all the files contained in the pakfile with their extractable flags set into the directory you ran unpack.exe from. - -Use this only if the author of a demo/game gives you permission to use his stuff, or else we'll hunt you down and break your legs. - -That is all. \ No newline at end of file diff --git a/16/v2/source/verge/VCC/CLEAN.BAT b/16/v2/source/verge/VCC/CLEAN.BAT deleted file mode 100755 index c30021ab..00000000 --- a/16/v2/source/verge/VCC/CLEAN.BAT +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -if exist *.obj del *.obj -if exist *.o del *.o -if exist *.err del *.err diff --git a/16/v2/source/verge/VCC/CODE.H b/16/v2/source/verge/VCC/CODE.H deleted file mode 100755 index bbcfca2c..00000000 --- a/16/v2/source/verge/VCC/CODE.H +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(__CODE_INC) -#define __CODE_INC - -// Single-byte opcode descriptors - -#define EXEC 1 -#define VAR0_ASSIGN 2 -#define VAR1_ASSIGN 3 -#define VAR2_ASSIGN 4 -#define GENERAL_IF 5 -#define ELSE 6 -#define GOTO 7 -#define FOR_LOOP0 8 -#define FOR_LOOP1 9 -#define SWITCH 10 -#define CASE 11 -#define ENDSCRIPT 255 - -// Single-byte operand descriptors - -#define OP_IMMEDIATE 1 -#define OP_VAR0 2 -#define OP_VAR1 3 -#define OP_VAR2 4 -#define OP_GROUP 5 - -// Single-byte IF handler parameters - -#define ZERO 0 -#define NONZERO 1 -#define EQUALTO 2 -#define NOTEQUAL 3 -#define GREATERTHAN 4 -#define GREATERTHANOREQUAL 5 -#define LESSTHAN 6 -#define LESSTHANOREQUAL 7 - -// Single byte assignment descriptors - -#define SET 1 -#define INCREMENT 2 -#define DECREMENT 3 -#define INCSET 4 -#define DECSET 5 - -// Operand combination descriptors -#define ADD 1 -#define SUB 2 -#define MULT 3 -#define DIV 4 -#define MOD 5 -#define OP_END 255 - -#endif // __CODE_INC diff --git a/16/v2/source/verge/VCC/COMPILE.C b/16/v2/source/verge/VCC/COMPILE.C deleted file mode 100755 index 2de7ce56..00000000 --- a/16/v2/source/verge/VCC/COMPILE.C +++ /dev/null @@ -1,1256 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -// ³ The VergeC Compiler version 2.01 ³ -// ³ Copyright (C)1998 BJ Eirich (aka vecna) ³ -// ³ Code Generation module ³ -// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -#include -#include -#include - -#include "funclib.h" -#include "vcc.h" -#include "vccode.h" -#include "lexical.h" -#include "preproc.h" - -// ================================= Data ==================================== - -#define LETTER 1 -#define SPECIAL 3 - -// -- Function arguements type defs - -#define VOID 1 -#define INT 1 -#define CHARPTR 2 -#define STRING 3 - -unsigned char *source, *src; -unsigned char *outbuf, *code; -unsigned char inevent=0; - -typedef struct -{ - char fname[40]; - char argtype[20]; - int numargs, numlocals; - int returntype; - int syscodeofs; -} funcdecl; - -funcdecl funcs[700]; -int numfuncs=0; - -typedef struct -{ - char vname[40]; - int varstartofs; - int arraylen; -} vardecl; - -vardecl vars[500]; -int curstartofs=0; -int numvars=0; -int varidx; - -typedef struct -{ - char vname[40]; - int vsofs; - int arraylen; -} strdecl; - -strdecl str[300]; -int sstartofs=0; -int numstr=0; - -int vctype; // 0 / 1 :: map / system - -// -- local function parameters -- - -char larg[20][40]; - -// -- MAP vc stuff -- - -char *functbl[512]; -int mfuncs=0; - -// ================================= Code ==================================== - -void HandleString(); -void HandleFunction(); -void HandleUserFunction(); -void HandleFunctionType(); -void EmitOperand(); - -void EmitC (char c) -{ - if (locate && locate == (int)(code - outbuf)) - vcerr("Located."); - - *code++ = c; -} - -void EmitW (short w) -{ - short *c=(short *)code; - - if (locate && locate == (int)(code - outbuf)) - vcerr("Located."); - - *c=w; code+=2; -} - -void EmitD (int d) -{ - long *c=(long *)code; - - if (locate && locate == (int)(code - outbuf)) - vcerr("Located."); - - *c=d; code+=4; -} - -void EmitString(char *str) - { while ((*code++ = *str++)) ; } - -void HandleStringOperand() -{ - if (NextIs("\"")) - { - EmitC(s_IMMEDIATE); - GetString(); - EmitString(token); - return; - } - GetToken(); - if (token_type==IDENTIFIER && varcategory==op_STRING) - { - EmitC(s_GLOBAL); - EmitW(str[varidx].vsofs); - return; - } - if (token_type==IDENTIFIER && varcategory==op_SARRAY) - { - EmitC(s_ARRAY); - EmitW(str[varidx].vsofs); - Expect("["); - EmitOperand(); - Expect("]"); - return; - } - if (token_type==IDENTIFIER && varcategory==op_SLOCAL) - { - EmitC(s_LOCAL); - EmitC((char) varidx); - return; - } - if (TokenIs("str")) - { - EmitC(s_NUMSTR); - Expect("("); - EmitOperand(); - Expect(")"); - return; - } - if (TokenIs("left")) - { - EmitC(s_LEFT); - Expect("("); - HandleString(); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - if (TokenIs("right")) - { - EmitC(s_RIGHT); - Expect("("); - HandleString(); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - if (TokenIs("mid")) - { - EmitC(s_MID); - Expect("("); - HandleString(); - Expect(","); - EmitOperand(); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - if (TokenIs("chr")) - { - EmitC(s_CHR); - Expect("("); - EmitOperand(); - Expect(")"); - return; - } - else vcerr("Unknown string operand. "); -} - -void HandleString() -{ - while (1) - { - HandleStringOperand(); - if (NextIs("+")) - { - EmitC(s_ADD); - GetToken(); - continue; - } - else - { - EmitC(s_END); - break; - } - } -} - -void EmitOperand(); -void DoSomething(); - -void HandleOperand() -{ - GetToken(); - if (token_type==DIGIT) - { - EmitC(op_IMMEDIATE); - EmitD(token_nvalue); - return; - } - if (token_type==IDENTIFIER) - { - if (varcategory==op_UVAR) - { - EmitC(op_UVAR); - EmitD(vars[varidx].varstartofs); - return; - } - if (varcategory==op_UVARRAY) - { - EmitC(op_UVARRAY); - EmitD(vars[varidx].varstartofs); - Expect("["); - EmitOperand(); - Expect("]"); - return; - } - if (varcategory==op_LVAR) - { - EmitC(op_LVAR); - EmitC((char) varidx); - return; - } - if (varcategory==op_HVAR0) - { - EmitC(op_HVAR0); - EmitC((char) varidx); - return; - } - if (varcategory==op_HVAR1) - { - EmitC(op_HVAR1); - EmitC((char) varidx); - Expect("["); - EmitOperand(); - Expect("]"); - return; - } - } - if (token_type==FUNCTION && token_subtype==op_BFUNC) - { - if (!returntypes[funcidx]) - { - vcerr("%s() does not return a vlue.", token); - } - EmitC(op_BFUNC); - HandleFunction(); - return; - } - if (token_type==FUNCTION && token_subtype==op_UFUNC) - { - if (!funcs[funcidx].returntype) - { - vcerr("%s() does not return a vlue.", token); - } - EmitC(op_UFUNC); - HandleUserFunction(); - return; - } - vcerr("Unknown token."); -} - -void EmitOperand() -{ - while (1) // Modifier-process loop. - { - if (NextIs("(")) - { - EmitC(op_GROUP); - GetToken(); - EmitOperand(); - Expect(")"); - } - else HandleOperand(); - - if (NextIs("+")) - { - EmitC(op_ADD); - GetToken(); - continue; - } - else if (NextIs("-")) - { - EmitC(op_SUB); - GetToken(); - continue; - } - else if (NextIs("/")) - { - EmitC(op_DIV); - GetToken(); - continue; - } - else if (NextIs("*")) - { - EmitC(op_MULT); - GetToken(); - continue; - } - else if (NextIs("%")) - { - EmitC(op_MOD); - GetToken(); - continue; - } - else if (NextIs(">>")) - { - EmitC(op_SHR); - GetToken(); - continue; - } - else if (NextIs("<<")) - { - EmitC(op_SHL); - GetToken(); - continue; - } - else if (NextIs("&")) - { - EmitC(op_AND); - GetToken(); - continue; - } - else if (NextIs("|")) - { - EmitC(op_OR); - GetToken(); - continue; - } - else if (NextIs("^")) - { - EmitC(op_XOR); - GetToken(); - continue; - } - else - { - EmitC(op_END); - break; - } - } -} - -void HandleFunction() -{ - switch (funcidx) - { - case 0: vcfunc_Exit(); break; - case 1: Message(); break; - case 2: GenericFunc(3,1); break; - case 3: GenericFunc(4,1); break; - case 4: GenericFunc(5,1); break; - case 5: vc_loadimage(); break; - case 6: GenericFunc(7,5); break; - case 7: GenericFunc(8,5); break; - case 8: GenericFunc(9,0); break; - case 9: GenericFunc(10,0); break; - case 10: vc_AllocateEntity(); break; - case 11: GenericFunc(12,1); break; - case 12: vc_Map(); break; - case 13: vc_LoadFont(); break; - case 14: vc_PlayFLI(); break; - case 15: GenericFunc(16,2); break; - case 16: vc_PrintString(); break; - case 17: vc_LoadRaw(); break; - case 18: GenericFunc(19,4); break; - case 19: GenericFunc(20,1); break; - case 20: GenericFunc(21,7); break; - case 21: GenericFunc(22,0); break; - case 22: GenericFunc(23,0); break; - case 23: GenericFunc(24,1); break; - case 24: vc_EntityMove(); break; - case 25: GenericFunc(26,4); break; - case 26: GenericFunc(27,4); break; - case 27: GenericFunc(28,5); break; - case 28: GenericFunc(29,4); break; - case 29: GenericFunc(30,4); break; - case 30: GenericFunc(31,5); break; - case 31: GenericFunc(32,5); break; - case 32: vc_strlen(); break; - case 33: vc_strcmp(); break; - case 34: GenericFunc(35,0); break; - case 35: GenericFunc(36,1); break; - case 36: GenericFunc(37,1); break; - case 37: GenericFunc(38,1); break; - case 38: GenericFunc(39,3); break; - case 39: GenericFunc(40,2); break; - case 40: GenericFunc(41,1); break; - case 41: GenericFunc(42,1); break; - case 42: GenericFunc(43,3); break; - case 43: vc_HookRetrace(); break; - case 44: vc_HookTimer(); break; - case 45: GenericFunc(46,2); break; - case 46: vc_SetRString(); break; - case 47: GenericFunc(48,4); break; - case 48: GenericFunc(49,3); break; - case 49: GenericFunc(50,0); break; - case 50: vc_PartyMove(); break; - case 51: GenericFunc(52,1); break; - case 52: GenericFunc(53,1); break; - case 53: GenericFunc(54,1); break; - case 54: GenericFunc(55,0); break; - case 55: GenericFunc(56,1); break; - case 56: GenericFunc(57,1); break; - case 57: GenericFunc(58,5); break; - case 58: GenericFunc(59,5); break; - case 59: GenericFunc(60,2); break; - case 60: vc_HookKey(); break; - case 61: vc_PlayMusic(); break; - case 62: GenericFunc(63,0); break; - case 63: GenericFunc(64,5); break; - case 64: vc_OpenFile(); break; - case 65: GenericFunc(66,1); break; - case 66: vc_QuickRead(); break; - case 67: GenericFunc(68,1); break; - case 68: GenericFunc(69,1); break; - case 69: GenericFunc(70,0); break; - case 70: GenericFunc(71,0); break; - case 71: GenericFunc(72,7); break; - case 72: GenericFunc(73,15); break; - case 73: vc_CacheSound(); break; - case 74: GenericFunc(75,0); break; - case 75: GenericFunc(76,3); break; - case 76: GenericFunc(77,7); break; - case 77: GenericFunc(78,4); break; - case 78: GenericFunc(79,4); break; - case 79: vc_val(); break; - case 80: GenericFunc(81,7); break; - case 81: GenericFunc(82,5); break; - case 82: vc_Log(); break; - case 83: GenericFunc(84,2); break; - case 84: GenericFunc(85,2); break; - case 85: GenericFunc(86,3); break; - case 86: GenericFunc(87,1); break; - case 87: GenericFunc(88,1); break; - case 88: GenericFunc(89,1); break; - case 89: vc_fgetline(); break; - case 90: vc_fgettoken(); break; - case 91: vc_fwritestring(); break; - case 92: GenericFunc(93, 3); break; - case 93: vc_frename(); break; - case 94: vc_fdelete(); break; - case 95: vc_fwopen(); break; - case 96: GenericFunc(97, 1); break; - case 97: GenericFunc(98, 3); break; - case 98: GenericFunc(99, 3); break; - case 99: GenericFunc(100, 6); break; - case 100: GenericFunc(101, 0); break; - case 101: GenericFunc(102, 7); break; - case 102: GenericFunc(103, 1); break; - case 103: GenericFunc(104, 1); break; - case 104: GenericFunc(105, 1); break; - case 105: vc_asc(); break; - case 106: GenericFunc(107, 1); break; - case 107: vc_NumForScript(); break; - case 108: vc_FileSize(); break; - case 109: GenericFunc(110, 1); break; - case 110: GenericFunc(111, 0); break; - default: vcerr("Internal error. Unknown standard function."); - } -} - -void HandleUserFunction() -{ - int i, idx; - - idx=funcidx; - EmitW((short) idx); - Expect("("); - for (i=0; i")) { ot=i_GREATERTHAN; GetToken(); } - if (NextIs(">=")) { ot=i_GREATERTHANOREQUAL; GetToken(); } - if (NextIs("<")) { ot=i_LESSTHAN; GetToken(); } - if (NextIs("<=")) { ot=i_LESSTHANOREQUAL; GetToken(); } - - if (!ot) EmitC(i_NONZERO); - else if (ot==i_ZERO) EmitC(i_ZERO); - else - { - EmitC(ot); - EmitOperand(); - } -} - -void HandleIfGroup() -{ - while (1) - { - HandleIfComponent(); - - if (NextIs("&&")) - { - EmitC(i_AND); - GetToken(); - continue; - } - else if (NextIs("||")) - { - EmitC(i_OR); - GetToken(); - continue; - } - else - { - GetToken(); - if (!TokenIs(")") && !TokenIs(";")) - vcerr("Syntax error."); - EmitC(i_UNGROUP); - break; - } - } -} - -void ProcessIf() -{ - char *falseofs = 0; - char *elseofs = 0; - char *b = 0; - - EmitC(opIF); - Expect("("); - HandleIfGroup(); - - falseofs=code; - EmitD(0); // We'll come back to this and fix it up. - - if (!NextIs("{")) - { - DoSomething(); - if (NextIs("else")) - { - EmitC(opGOTO); - elseofs=code; - EmitD(0); - } - } - else - { - Expect("{"); - while (!NextIs("}")) DoSomething(); - Expect("}"); - if (NextIs("else")) - { - EmitC(opGOTO); - elseofs=code; - EmitD(0); - } - } - - b=code; // Put correct false-execution offset thingy. - code=falseofs; - EmitD((int) b - (int) outbuf); - code=b; - - if (NextIs("else")) - { - GetToken(); - if (!NextIs("{")) - { - DoSomething(); - } - else - { - Expect("{"); - while (!NextIs("}")) DoSomething(); - Expect("}"); - } - b=code; // Put correct else-execution offset thingy. - code=elseofs; - EmitD((int) b - (int) outbuf); - code=b; - } -} - -void ProcessWhile() -{ char *falseofs, *top, *b; - - top=code; - EmitC(opIF); - Expect("("); - HandleIfGroup(); - - falseofs=code; - EmitD(0); // We'll come back to this and fix it up. - - if (!NextIs("{")) - { - DoSomething(); - EmitC(opGOTO); - EmitD((int) top - (int) outbuf); - } - else - { - Expect("{"); - while (!NextIs("}")) DoSomething(); - Expect("}"); - EmitC(opGOTO); - EmitD((int) top - (int) outbuf); - } - - b=code; // Put correct false-execution offset thingy. - code=falseofs; - EmitD((int) b - (int) outbuf); - code=b; -} - -void ProcessFor() -{ char *src1, *src2, *loopstartpos, *srctmp; - - Expect("("); - while (!TokenIs(";")) - DoSomething(); // Emit initialization code. - - src1=src; // Store position of loop conditional - while (!NextIs(";")) GetToken(); GetToken(); - src2=src; // Store position of end-of-loop code - - while (!NextIs(")")) GetToken(); GetToken(); - loopstartpos=(char *) (int) code - (int) outbuf; - - if (!NextIs("{")) - { - DoSomething(); - } - else - { - Expect("{"); - while (!NextIs("}")) DoSomething(); - Expect("}"); - } - srctmp=src; - src=src2; - while (!TokenIs(")")) - DoSomething(); - src=src1; - EmitC(opIF); - HandleIfGroup(); - EmitD((int) code - (int) outbuf +9); - EmitC(opGOTO); - EmitD((int) loopstartpos); - - src=srctmp; -} - -void HandleAssign() -{ - int vc; - - vc=varcategory; - EmitC(opASSIGN); - if (vc==op_UVAR) - { - EmitC(op_UVAR); - EmitD(vars[varidx].varstartofs); - } - else if (vc==op_UVARRAY) - { - EmitC(op_UVARRAY); - EmitD(vars[varidx].varstartofs); - Expect("["); - EmitOperand(); - Expect("]"); - } - else if (vc==op_LVAR) - { - EmitC(op_LVAR); - EmitC((char) varidx); - } - else if (vc==op_HVAR0) - { - EmitC(op_HVAR0); - EmitC((char) varidx); - } - else if (vc==op_HVAR1) - { - EmitC(op_HVAR1); - EmitC((char) varidx); - Expect("["); - EmitOperand(); - Expect("]"); - } - else if (vc==op_STRING) - { - EmitC(op_STRING); - EmitW((short) str[varidx].vsofs); - } - else if (vc==op_SARRAY) - { - EmitC(op_SARRAY); - EmitW((short) str[varidx].vsofs); - Expect("["); - EmitOperand(); - Expect("]"); - } - else if (vc==op_SLOCAL) - { - EmitC(op_SLOCAL); - EmitW((short) varidx); - } - GetToken(); - if (TokenIs("++")) { EmitC(a_INC); GetToken(); return; } else - if (TokenIs("--")) { EmitC(a_DEC); GetToken(); return; } else - if (TokenIs("+=")) { EmitC(a_INCSET); } else - if (TokenIs("-=")) { EmitC(a_DECSET); } else - if (TokenIs("=")) { EmitC(a_SET); } else - vcerr("Invalid assignment operator."); - if (vc==op_STRING) HandleString(); - else if (vc==op_SARRAY) HandleString(); - else if (vc==op_SLOCAL) HandleString(); - else EmitOperand(); - GetToken(); -} - -int c=0; - -void HandleReturn() -{ - if (!vctype) - { - Expect(";"); - EmitC(opRETURN); - return; - } - if (!funcs[c].returntype) - { - Expect(";"); - EmitC(opRETURN); - return; - } - if (funcs[c].returntype==1) - { - EmitC(opSETRETVAL); - EmitOperand(); - Expect(";"); - EmitC(opRETURN); - return; - } -} - -void ProcessSwitch() -{ char *buf,*retrptr; - - EmitC(opSWITCH); - Expect("("); - EmitOperand(); - Expect(")"); - Expect("{"); - - // case .. option loop - - while (!NextIs("}")) - { - Expect("case"); - EmitC(opCASE); - EmitOperand(); - Expect(":"); - retrptr=code; - EmitD(0); - while (!NextIs("case") && !NextIs("}")) DoSomething(); - EmitC(opRETURN); - buf=code; - code=retrptr; - EmitD((int) buf - (int) outbuf); - code=buf; - } - Expect("}"); - EmitC(opRETURN); -} - -void DoSomething(void) -{ - GetToken(); - if (TokenIs("return")) { HandleReturn(); return; } - if (token_type==FUNCTION) { HandleFunctionType(); Expect(";"); return; } - if (token_type==IDENTIFIER) { HandleAssign(); return; } - if (TokenIs("if")) { ProcessIf(); return; } - if (TokenIs("while")) { ProcessWhile(); return; } - if (TokenIs("for")) { ProcessFor(); return; } - if (TokenIs("switch")) { ProcessSwitch(); return; } - vcerr("Unknown token."); -} - -void DumpSystemIdx() -{ FILE *f; - - vprint("Dumping system.idx index file."); - f=fopen("system.idx","wb"); - - fwrite(&numvars, 1, 4, f); - fwrite(&vars, sizeof vars / 500, numvars, f); - fwrite(&numfuncs, 1, 4, f); - fwrite(&funcs, sizeof funcs / 700, numfuncs, f); - fwrite(&numstr, 1, 4, f); - fwrite(&str, sizeof str / 300, numstr, f); - fclose(f); -} - -void ReadSystemIdx() -{ FILE *f; - - if (!(f=fopen("system.idx","rb"))) - err("Could not access system.idx."); - - fread(&numvars, 1, 4, f); - fread(&vars, sizeof vars / 500, numvars, f); - fread(&numfuncs, 1, 4, f); - fread(&funcs, sizeof funcs / 700, numfuncs, f); - fread(&numstr, 1, 4, f); - fread(&str, sizeof str / 300, numstr, f); - fclose(f); -} - -void DoLocalVariables(int c) -{ - int na; - - na=funcs[c].numargs; - while (NextIs("int") || NextIs("string")) - { - GetToken(); - if (TokenIs("int")) - { - funcs[c].argtype[na]=INT; - GetToken(); - memcpy(larg[na++], token, 40); - while (!NextIs(";")) - { - Expect(","); - funcs[c].argtype[na]=INT; - GetToken(); - memcpy(larg[na++], token, 40); - } - Expect(";"); - } - if (TokenIs("string")) - { - funcs[c].argtype[na]=STRING; - GetToken(); - memcpy(larg[na++], token, 40); - while (!NextIs(";")) - { - Expect(","); - funcs[c].argtype[na]=STRING; - GetToken(); - memcpy(larg[na++], token, 40); - } - Expect(";"); - } - } - funcs[c].numlocals=na; -} - -void CompileMAP(char *fname) -{ FILE *f; - int i; - - // Compiles a map-based VC. - i=strlen(fname); - memcpy(strbuf, fname, i); - strbuf[i]='.'; - strbuf[i+1]='V'; - strbuf[i+2]='C'; - strbuf[i+3]=0; - - PreProcess(strbuf); - - source=(char *) malloc(1000000); - memset(source, 0, 1000000); - outbuf=(char *) malloc(1000000); - memset(outbuf, 0, 1000000); - if (!(f=fopen("vcctemp.$$$","rb"))) - err("Could not open source file."); - fread(source, 1, 1000000, f); - fclose(f); - - ReadSystemIdx(); - - src=source; - code=outbuf; - vctype=0; - - while (*src) - { - functbl[mfuncs]=(char *) (int) code - (int) outbuf; - mfuncs++; - Expect("event"); - Expect("{"); - while (!NextIs("}")) DoSomething(); - Expect("}"); - EmitC(opRETURN); - ParseWhitespace(); - } - dprint("%s.vc (%i lines)", fname, lines); -} - -void SkipBrackets() -{ - while (!NextIs("}")) - { - if (!*src) - err("No matching bracket."); - GetToken(); - if (TokenIs("{")) SkipBrackets(); - } - GetToken(); -} - -void CheckDup() -{ - int i=0; // bitch! - - while (i -#include -#include -#include "compile.h" -#include "funclib.h" -#include "vcc.h" -#include "vccode.h" -#include "lexical.h" - -// ================================= Data ==================================== - -// ================================= Code ==================================== - -void vcfunc_Exit() -{ - EmitC(1); - Expect("("); - HandleString(); - Expect(")"); -} - -void Message() -{ - EmitC(2); - Expect("("); - HandleString(); - Expect(","); - EmitOperand(); - Expect(")"); -} - -void vc_loadimage() -{ - EmitC(6); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_AllocateEntity() -{ - EmitC(11); - Expect("("); - EmitOperand(); - Expect(","); - EmitOperand(); - Expect(","); - HandleString(); - Expect(")"); -} - -void vc_Map() -{ - EmitC(13); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_LoadFont() -{ - EmitC(14); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_PlayFLI() -{ - EmitC(15); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_PrintString() -{ - EmitC(17); - Expect("("); - EmitOperand(); - Expect(","); - HandleString(); - Expect(")"); -} - -void vc_LoadRaw() -{ - EmitC(18); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_EntityMove() -{ - EmitC(25); - Expect("("); - EmitOperand(); - Expect(","); - HandleString(); - Expect(")"); -} - -void vc_strlen() -{ - EmitC(33); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_strcmp() -{ - EmitC(34); - Expect("("); - HandleString(); - Expect(","); - HandleString(); - Expect(")"); -} - -void vc_SetRString() -{ - EmitC(47); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_PartyMove() -{ - EmitC(51); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_PlayMusic() -{ - EmitC(62); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_OpenFile() -{ - EmitC(65); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_HookRetrace() -{ - char *na; - - EmitC(44); - Expect("("); - na=src; - GetToken(); - if (token_subtype == op_UFUNC) - { - EmitC(2); - EmitD(funcidx); - } - else - { - src=na; - EmitC(1); - EmitOperand(); - } - Expect(")"); -} - -void vc_HookTimer() -{ - char *na; - - EmitC(45); - Expect("("); - na=src; - GetToken(); - if (token_subtype == op_UFUNC) - { - EmitC(2); - EmitD(funcidx); - } - else - { - src=na; - EmitC(1); - EmitOperand(); - } - Expect(")"); -} - -void vc_HookKey() -{ - char *na; - - EmitC(61); - Expect("("); - EmitOperand(); - Expect(","); - na=src; - GetToken(); - if (token_subtype == op_UFUNC) - { - EmitC(2); - EmitD(funcidx); - } - else - { - src=na; - EmitC(1); - EmitOperand(); - } - Expect(")"); -} - -void vc_QuickRead() -{ - EmitC(67); - Expect("("); - HandleString(); - Expect(","); - GetToken(); - if (varcategory == op_STRING) - { - EmitC(op_STRING); - EmitW(str[varidx].vsofs); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - if (varcategory == op_SARRAY) - { - EmitC(op_SARRAY); - EmitW(str[varidx].vsofs); - Expect("["); - EmitOperand(); - Expect("]"); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - vcerr("String variable expected."); -} - -void vc_CacheSound() -{ - EmitC(74); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_val() -{ - EmitC(80); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_Log() -{ - EmitC(83); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_fgetline() -{ - EmitC(90); - Expect("("); - GetToken(); - if (varcategory == op_STRING) - { - EmitC(op_STRING); - EmitW(str[varidx].vsofs); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - if (varcategory == op_SARRAY) - { - EmitC(op_SARRAY); - EmitW(str[varidx].vsofs); - Expect("["); - EmitOperand(); - Expect("]"); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - vcerr("String variable expected."); -} - -void vc_fgettoken() -{ - EmitC(91); - Expect("("); - GetToken(); - if (varcategory == op_STRING) - { - EmitC(op_STRING); - EmitW(str[varidx].vsofs); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - if (varcategory == op_SARRAY) - { - EmitC(op_SARRAY); - EmitW(str[varidx].vsofs); - Expect("["); - EmitOperand(); - Expect("]"); - Expect(","); - EmitOperand(); - Expect(")"); - return; - } - vcerr("String variable expected."); -} - -void vc_fwritestring() -{ - EmitC(92); - Expect("("); - HandleString(); - Expect(","); - EmitOperand(); - Expect(")"); -} - -void vc_frename() -{ - EmitC(94); - Expect("("); - HandleString(); - Expect(","); - HandleString(); - Expect(")"); -} - -void vc_fdelete() -{ - EmitC(95); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_fwopen() -{ - EmitC(96); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_asc() -{ - EmitC(106); - Expect("("); - HandleString(); - Expect(")"); -} - -void vc_NumForScript() -{ - EmitC(108); - Expect("("); - GetToken(); - if (token_subtype == op_UFUNC) - EmitD(funcidx); - else vcerr("system script expected."); - Expect(")"); -} - -void vc_FileSize() -{ - EmitC(109); - Expect("("); - HandleString(); - Expect(")"); -} - -void GenericFunc(unsigned char idcode, int numargs) -{ char i; - - EmitC(idcode); - if (!numargs) - { - Expect("("); - Expect(")"); - return; - } - if (numargs==1) - { - Expect("("); - EmitOperand(); - Expect(")"); - return; - } - Expect("("); - for (i=1; i -// + ConvHexToDec() was severely screwed (would not return correct values at -// *all*; own fault)--fixed -// -// + fixed some problems with tick mark parsing. didn't like certain chars. -// -// + fixed floating point exception crash in ConvHexToDec(), which occured -// when using very large hex numbers (i think; like $ffffffff). was due to -// use of pow() -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -#include -#include -#include -#include -#include "compile.h" -#include "vcc.h" -#include "vccode.h" - -// ================================= Data ==================================== - -// Character types - -#define LETTER 1 -#define DIGIT 2 -#define SPECIAL 3 - -// --------------- - -char token[2000]; // Token buffer -int token_nvalue; // int value of token if it's type DIGIT -char token_type; // type of current token. -char token_subtype; // This is just crap. -unsigned char chr_table[256]; // Character type table. - -int lines, tlines; // current line number being processed in -char *source_file; // the current source file - -// ---------------- - -char *hardfuncs[]= -{ - // A - "exit", "message", "malloc", - "free", "pow", "loadimage", - "copysprite", "tcopysprite", "render", - "showpage", "entityspawn", "setplayer", - "map", "loadfont", "playfli", - - // B - "gotoxy", "printstring", "loadraw", - "settile", "allowconsole", "scalesprite", - "processentities", "updatecontrols", "unpress", - "entitymove", "hline", "vline", - "line", "circle", "circlefill", // 30 - - // C - "rect", "rectfill", "strlen", - "strcmp", "cd_stop", "cd_play", - "fontwidth", "fontheight", "setpixel", - "getpixel", "entityonscreen", "random", - "gettile", "hookretrace", "hooktimer", - - // D - "setresolution", "setrstring", "setcliprect", - "setrenderdest", "restorerendersettings","partymove", - "sin", "cos", "tan", - "readmouse", "setclip", "setlucent", - "wrapblit", "twrapblit", "setmousepos", // 60 - - // E - "hookkey", "playmusic", "stopmusic", - "palettemorph", "fopen", "fclose", - "quickread", "addfollower", "killfollower", - "killallfollowers", "resetfollowers", "flatpoly", - "tmappoly", "cachesound", "freeallsounds", - - // F - "playsound", "rotscale", "mapline", - "tmapline", "val", "tscalesprite", - "grabregion", "log", "fseekline", - "fseekpos", "fread", "fgetbyte", - "fgetword", "fgetquad", "fgetline", // 90 - - // G - "fgettoken", "fwritestring", "fwrite", - "frename", "fdelete", "fwopen", - "fwclose", "memcpy", "memset", - "silhouette", "initmosaictable", "mosaic", - "writevars", "readvars", "callevent", // 105 - - // H - "asc", "callscript", "numforscript", - "filesize", "ftell", "checkcorrupt" - }; - -char returntypes[]= -{ - // A - 0, 0, 1, - 0, 1, 1, - 0, 0, 0, - 0, 1, 0, - 0, 1, 0, - - // B - 0, 0, 1, - 0, 0, 0, - 0, 0, 0, - 0, 0, 0, - 0, 0, 0, - - // C - 0, 0, 1, - 1, 0, 0, - 1, 1, 0, - 1, 1, 1, - 1, 0, 0, - - // D - 0, 0, 0, - 0, 0, 0, - 1, 1, 1, - 0, 0, 0, - 0, 0, 0, - - // E - 0, 0, 0, - 0, 1, 0, - 0, 0, 0, - 0, 0, 0, - 0, 1, 0, - - // F - 0, 0, 0, - 0, 1, 0, - 0, 0, 0, - 0, 0, 1, - 1, 1, 0, - - // G - 0, 0, 0, - 0, 0, 1, - 0, 0, 0, - 0, 1, 0, - 0, 0, 0, - - // H - 1, 0, 1, - 1, 1, 0 -}; - -char *hardvar0[]= -{ - "xwin", "ywin", "cameratracking", - "timer", "up", "down", - "left", "right", "b1", - "b2", "b3", "b4", - "screenx", "screeny", "player", // 15 - - "numentsonscreen", "tracker", "mx", - "my", "mb", "vctrace", - "image_width", "image_height", "music_volume", // 24 - "vsp", "lastent", "last_pressed" -}; - -char *hardvar1[]= -{ - "screen", "entity.x", "entity.y", - "entity.tx", "entity.ty", "entity.facing", - "entity.moving", "entity.specframe", "entity.speed", - "entity.movecode", "entsonscreen", "key", - "layer.hline", "byte", "word", // 15 - - "quad", "pal", "sbyte", - "sword", "squad" -}; - -int funcidx = 0; -int varcategory = 0; - -int numhardfuncs = 111; -int numhardvar0 = 27; -int numhardvar1 = 20; - -// ================================= Code ==================================== - -int streq(char *a, char *b) -{ - while (*a) - { - if (*a++ != *b++) - return 0; - } - return (*b==0); -} - -char TokenIs(char *str) - { return streq(str,token); } - -void ParseWhitespace(void) -{ - while (1) - { - while (*src<=' ' && *src>2) - if (!*src++) - return; - - if (src[0]=='/' && src[1]=='/') - { - while (*src && (*src != '\n')) - src++; - continue; - } - - if (src[0]=='/' && src[1]=='*') - { - while (!(src[0]=='*' && src[1]=='/')) - { - src++; - if (!*src) - return; - if (*src == 1) - { - src++; - source_file = src; - while (*src++); - tlines++; - continue; - } - if (*src==2) - { - src++; - lines = (int) *(int *)src; - src += 4; - continue; - } - } - src+=2; - continue; - } - - if (*src == 1) - { - src++; - source_file = src; - while (*src++); - continue; - } - if (*src==2) - { - src++; - lines = (int) *(int *)src; - src += 4; - tlines++; - continue; - } - break; - } -} - -int GetStringIdx(char i) -{ - int j, k=0; - - for (j=0; j1) varcategory=op_UVARRAY; - } - i=0; - while (i1) varcategory=op_SARRAY; - } -} - -void GetIdentifier(void) -{ - int i; - - i=0; - while ((chr_table[*src] == LETTER) || (chr_table[*src] == DIGIT)) - token[i++] = *src++; - token[i]=0; - strlwr(token); - CheckLibFunc(); -} - -void ConvHexToDec() -{ - static const char *const hextbl="0123456789abcdef\0"; - static int pow_lut[]={1,16,256,4096,65536,1048576,16777216,268435456}; - int i=0, pos=0, z=0; - unsigned int j=0; - - if (strlen(token)>9) - vcerr("Hex number exceeds 8 digit maximum."); - - strlwr(token); - i=strlen(token)-1; - token_nvalue=0; - for (pos=0; i>0; pos++,i--) - { - z=token[i]; - for (j=0; j<16; j++) - if (hextbl[j]==z) break; - if (j>=16) - vcerr("Invalid hex number."); - token_nvalue += (j * pow_lut[pos]); - } -} - -void DoTickMarks() -{ - token_nvalue=token[1]; -} - -void GetNumber() -{ - int i; - - if ('\'' == *src) - { - token[0]=*src++; - token[1]=*src++; - token[2]=*src++; - token[3]=0; - } - else - { - i=0; - while (chr_table[*src] != SPECIAL) - token[i++]=*src++; - token[i]=0; - } - if (token[0]=='$') ConvHexToDec(); - else if (token[0]=='\'') DoTickMarks(); - else token_nvalue=atoi(token); -} - -void GetPunctuation() -{ char c; - - c=*src; - switch (c) - { - case '(': token[0]='('; token[1]=0; src++; break; - case ')': token[0]=')'; token[1]=0; src++; break; - case '{': token[0]='{'; token[1]=0; src++; break; - case '}': token[0]='}'; token[1]=0; src++; break; - case '[': token[0]='['; token[1]=0; src++; break; - case ']': token[0]=']'; token[1]=0; src++; break; - case ',': token[0]=','; token[1]=0; src++; break; - case ':': token[0]=':'; token[1]=0; src++; break; - case ';': token[0]=';'; token[1]=0; src++; break; - case '/': token[0]='/'; token[1]=0; src++; break; - case '*': token[0]='*'; token[1]=0; src++; break; - case '^': token[0]='^'; token[1]=0; src++; break; - case '%': token[0]='%'; token[1]=0; src++; break; - case '\"': token[0]='\"'; token[1]=0; src++; break; - case '+' : token[0]='+'; - src++; - if (*src=='+') - { token[1]='+'; - src++; } - else if (*src=='=') - { token[1]='='; - src++; } - else token[1]=0; - token[2]=0; - break; - case '-' : token[0]='-'; - src++; - if (*src=='-') - { token[1]='-'; - src++; } - else if (*src=='=') - { token[1]='='; - src++; } - else token[1]=0; - token[2]=0; - break; - case '>' : token[0]='>'; - src++; - if (*src=='=') - { token[1]='='; - token[2]=0; - src++; break; } - if (*src=='>') - { token[1]='>'; - token[2]=0; - src++; break; } - token[1]=0; - break; - case '<': token[0]='<'; - src++; - if (*src=='=') - { token[1]='='; - token[2] = 0; - src++; break; } - if (*src=='<') - { token[1]='<'; - token[2] = 0; - src++; break; } - token[1]=0; - break; - case '!': token[0]='!'; - src++; - if (*src=='=') - { token[1]='='; - token[2]=0; - src++; break; } - token[1]=0; - break; - case '=': token[0]='='; - src++; - if (*src=='=') - { token[1]=0; - src++; } - else token[1]=0; - break; - case '&': token[0]='&'; - src++; - if (*src=='&') - { token[1]='&'; - token[2]=0; - src++; break; } - token[1]=0; - break; - case '|': token[0]='|'; - src++; - if (*src=='|') - { token[1]='|'; - token[2]=0; - src++; break; } - token[1]=0; - break; - default: src++; // This should be an error. - } -} - -void GetString(void) -{ - int i; - - // Expects a "quoted" string. Places the contents of the string in - // token[] but does not include the quotes. - - Expect("\""); - i=0; - while (*src!='\"') - { - token[i++]=*src++; - if (i>250) - vcerr("String exceeds 250 character maximum."); - } - src++; - token[i]=0; -} - -void GetToken(void) -{ - int i; - - // Simply reads in the next statement and places it in the - // token buffer. - - ParseWhitespace(); - i=0; - - switch (chr_table[*src]) - { - case LETTER: { token_type = IDENTIFIER; GetIdentifier(); break; } - case DIGIT: { token_type = DIGIT; GetNumber(); break; } - case SPECIAL: { token_type = CONTROL; GetPunctuation(); break; } - } - - if (!*src && inevent) - err("Unexpected end of file"); -} - -void Expect(char *str) -{ - GetToken(); - if (TokenIs(str)) return; - vcerr("error: %s expected, %s got", str, token); -} - -int ExpectNumber() -{ - GetToken(); - if (token_type!=DIGIT) err("error: Numerical value expected"); - return token_nvalue; -} - -void InitCompileSystem() -{ int i; - - vprint("Building chr_table[]."); - for (i=0; i<256; i++) chr_table[i]=SPECIAL; - for (i='0'; i<='9'; i++) chr_table[i]=DIGIT; - for (i='A'; i<='Z'; i++) chr_table[i]=LETTER; - for (i='a'; i<='z'; i++) chr_table[i]=LETTER; - - chr_table[10]=0; - chr_table[13]=0; - chr_table[' ']=0; - chr_table['_']=LETTER; - chr_table['.']=LETTER; - chr_table['$']=DIGIT; - chr_table[39]=DIGIT; -} - -char lasttoken[2048]; - -int NextIs(char *str) -{ char *ptr,tt,tst; - int i,nv; - - ptr=src; - tt=token_type; - tst=token_subtype; - nv=token_nvalue; - memcpy(lasttoken, token, 2048); - GetToken(); - src=ptr; - token_nvalue=nv; - tst=token_subtype; - tt=token_type; - //if (!strcmp(str,token)) i=1; else i=0; - i=streq(str,token); - memcpy(token, lasttoken, 2048); - return i; -} diff --git a/16/v2/source/verge/VCC/LEXICAL.H b/16/v2/source/verge/VCC/LEXICAL.H deleted file mode 100755 index 7f9d02bb..00000000 --- a/16/v2/source/verge/VCC/LEXICAL.H +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(__LEXICAL_INC) -#define __LEXICAL_INC - -extern void ParseWhitespace(); -extern void GetNumber(); -extern void GetToken(); -extern void InitCompileSystem(); -extern int NextIs(char *str); - -extern void GetString(void); - -extern char token[2000]; // Token buffer -extern unsigned int token_nvalue; // int value of token if it's type DIGIT -extern char token_type; // type of current token. -extern char token_subtype; // This is just crap. -extern unsigned char chr_table[256]; // Character type table. -extern char returntypes[]; -extern int lines, tlines; -extern char *source_file; - -extern char TokenIs(char *str); -extern void Expect(char *str); - -extern int numhardfuncs, funcidx; -extern int varcategory, numhardvar0; -extern int numhardvar1; -extern char *hardfuncs[]; -extern char *hardvar0[]; -extern char *hardvar1[]; - -#endif // __LEXICAL_INC diff --git a/16/v2/source/verge/VCC/MAKEDJ.BAT b/16/v2/source/verge/VCC/MAKEDJ.BAT deleted file mode 100755 index 1804dc67..00000000 --- a/16/v2/source/verge/VCC/MAKEDJ.BAT +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -if exist vcc.exe del vcc.exe -gcc -s -Wall -Werror -m486 -O3 vcc.c preproc.c lexical.c compile.c funclib.c -o dj\vcc.exe -rem gcc -Wall -Werror -pg vcc.c preproc.c lexical.c compile.c funclib.c -o dj\vcc -if not exist dj\vcc.exe goto end -if exist ..\djp.exe djp dj\vcc.exe -:end diff --git a/16/v2/source/verge/VCC/PREPROC.C b/16/v2/source/verge/VCC/PREPROC.C deleted file mode 100755 index f930e857..00000000 --- a/16/v2/source/verge/VCC/PREPROC.C +++ /dev/null @@ -1,799 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -// ³ The VergeC Compiler version 2.01 ³ -// ³ Copyright (C)1998 BJ Eirich (aka vecna) ³ -// ³ Pre Processor module ³ -// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -// CHANGELOG: -// -// + fixed incorrect file markers and last character omission. -// + one more incorrect file marker fix; was not restoring correctly after -// #included files. -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -#ifdef __WATCOMC__ -#include -#endif - -#include -#include -#include -#include -#include - -#include "vcc.h" -#include "lexical.h" - -int pp_dump; -int pp_nomark; -static int pp_tempct = 0; - -typedef struct - { - char *sym; - int sym_len; - - char *resolve; - int resolve_len; - - } pp_def; - -typedef struct - { - char *filename; - char *data; - - } pp_include; - -void Process(char *filename); -char *pp_token(char *p); - -//////////////////////////////////////////////////////////////////////////// -// DATA //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// - -pp_def *pp_defarr = NULL; - -int pp_num_defs = 0; -int pp_defs_allocated = 0; -int PP_DEFS_BLOCK = 25; - -pp_include pp_incarr[100]; -//pp_include *pp_icur = NULL; // get rid of this -char *cur_filename=0; -char *last_filename=0; - -int pp_num_includes = 0; - -int pp_line = 0; -int pp_total_lines = 0; - -const int EOF_CHAR = 0x00; - -char pp_chr_table[256]; - -enum - { - PP_ERROR, - PP_WHITE, - PP_PUNC, - PP_DIGIT, - PP_LETTER, - PP_QUOTE, - PP_DIRECTIVE, - PP_NEWLINE, - PP_EOF - }; - -FILE *pp_out = NULL; - -char pp_tok[1024]; -int pp_toktype = 0; - -int pp_last_delim = 1; - -//////////////////////////////////////////////////////////////////////////// -// CODE //////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// - -int logging=1; -void log(char *str) -{ - if (logging) - { - FILE *fp = fopen("error.log", "a"); - fprintf(fp, str); - fflush(fp); - fclose(fp); - } -} - -void init_pp_chr_table() -{ - int x; - - memset(pp_chr_table, PP_ERROR, 256); - - pp_chr_table[EOF_CHAR] = PP_EOF; - - for (x='A'; x<='Z'; x++) pp_chr_table[x] = PP_LETTER; - for (x='a'; x<='z'; x++) pp_chr_table[x] = PP_LETTER; - pp_chr_table['_'] = PP_LETTER; - pp_chr_table['.'] = PP_LETTER; - - for (x='0'; x<='9'; x++) pp_chr_table[x] = PP_DIGIT; - pp_chr_table['$'] = PP_DIGIT; - pp_chr_table['\''] = PP_DIGIT; - - pp_chr_table['+'] = pp_chr_table['-'] = PP_PUNC; - pp_chr_table['*'] = pp_chr_table['/'] = PP_PUNC; - pp_chr_table['%'] = PP_PUNC; - pp_chr_table['|'] = pp_chr_table['&'] = PP_PUNC; - pp_chr_table['='] = pp_chr_table['^'] = PP_PUNC; - pp_chr_table[','] = PP_PUNC; - pp_chr_table['<'] = pp_chr_table['>'] = PP_PUNC; - pp_chr_table['('] = pp_chr_table[')'] = PP_PUNC; - pp_chr_table['['] = pp_chr_table[']'] = PP_PUNC; - pp_chr_table['{'] = pp_chr_table['}'] = PP_PUNC; - pp_chr_table[':'] = pp_chr_table[';'] = PP_PUNC; - pp_chr_table['\\'] = pp_chr_table['!'] = PP_PUNC; - - pp_chr_table[' '] = pp_chr_table['\t'] = PP_WHITE; - pp_chr_table['\r'] = PP_WHITE; - - pp_chr_table['\n'] = PP_NEWLINE; - - pp_chr_table['\"'] = PP_QUOTE; - - pp_chr_table['#'] = PP_DIRECTIVE; -} - -void pp_line_marker() -{ - if (pp_nomark) return; - - fputc(2, pp_out); - fwrite(&pp_line, 1, 4, pp_out); -} - -void pp_file_marker() -{ - if (pp_nomark) return; - - fputc(1, pp_out); - fwrite(cur_filename, 1, strlen(cur_filename)+1, pp_out); -} - -void pp_error(const char *error, ...) -{ - va_list lst; - char string[1024]; - - va_start (lst, error); - vsprintf (string, error, lst); - va_end (lst); - - printf ("*preproc error* "); - err (string); -} - -void pp_line_error(const char *error, ...) -{ - va_list lst; - char string[1024]; - - va_start (lst, error); - vsprintf (string, error, lst); - va_end (lst); - - printf ("%s(%d) ", cur_filename, pp_line); - pp_error (string); -} - -int pp_is_punc(int c) - { return (PP_PUNC == pp_chr_table[c]); } - -int pp_is_letter(int c) - { return (PP_LETTER == pp_chr_table[c]); } - -int pp_is_digit(int c) - { return (PP_DIGIT == pp_chr_table[c]); } - -int pp_is_ident(int c) - { return (pp_is_letter(c) || pp_is_digit(c)); } - -int pp_is_white(int c) - { return (PP_WHITE == pp_chr_table[c]); } - -int pp_is_directive(int c) - { return (PP_DIRECTIVE == pp_chr_table[c]); } - -int pp_is_eof(int c) - { return (PP_EOF == pp_chr_table[c]); } - -pp_def *pp_def_add(char *sym, char *resolve) -{ - pp_def *pp = NULL; - pp_def *p = NULL; - - if (!(pp_defs_allocated % PP_DEFS_BLOCK)) - { - pp_defs_allocated += PP_DEFS_BLOCK; - - p = (pp_def *)realloc( - pp_defarr, pp_defs_allocated * sizeof(pp_def)); - if (!p) pp_error("unable to grow #define list"); - - pp_defarr = p; - } - - pp = &pp_defarr[pp_num_defs]; - ++pp_num_defs; - - pp->sym = (char *)malloc(strlen(sym) +1); - if (!pp->sym) - pp_error("memory exhausted"); - strcpy(pp->sym, sym); - pp->sym_len = strlen(sym); - - pp->resolve = (char *)malloc(strlen(resolve) +1); - if (!pp->resolve) - pp_error("memory exhausted"); - strcpy(pp->resolve, resolve); - pp->resolve_len = strlen(resolve); - - return pp; -} - -pp_include *pp_include_add(char *filename) -{ - FILE *in = NULL; - pp_include *pp = NULL; - int z = 0; - - if (pp_num_includes) - { - int i; - for (i=0; idata = (char *)malloc((z +2) * sizeof(char)); - if (!pp->data) pp_error("memory exhausted"); - fread(pp->data, 1, z, in); - fclose(in); - - pp->data[z++] = 32; // - pp->data[z] = EOF_CHAR; - - pp->filename = (char *)malloc(strlen(filename) +1); - if (!pp->filename) pp_error("memory exhausted"); - strcpy(pp->filename, filename); - cur_filename=pp->filename; - - return pp; -} - -char *pp_skip_c_comment(char *p) -{ - p += 2; - while (*p && ('*' != *p || '/' != p[1])) - { - if ('\n' == *p) - { - ++pp_line; - pp_line_marker(); - } - if ('/' == *p && '*' == p[1]) - p = pp_skip_c_comment(p); - else ++p; - } - if (*p) p += 2; - - return p; -} - -char *pp_skip_cpp_comment(char *p) -{ - p += 2; - while (*p && '\n' != *p) - ++p; - if (*p) - { - ++p; - - ++pp_line; - pp_line_marker(); - } - - return p; -} - -char *pp_skipwhite(char *p) -{ - for (;;) - { - while (*p && PP_WHITE == pp_chr_table[(int) *p]) - ++p; - - if ('\n' == *p) - { - ++p; - - ++pp_line; - pp_line_marker(); - continue; - } - - // skip comments - if ('/' == *p) - { - switch (p[1]) - { - case '/': p = pp_skip_cpp_comment(p); continue; - case '*': p = pp_skip_c_comment(p); continue; - } - } - - break; - } - - return p; -} - -char *pp_token_punc(char *p) -{ - char *s = pp_tok; - - do { - *s++ = *p++; - } while (*p && pp_is_punc(*p)); - *s = 0; - - return p; -} - -/* -int is_hex(int c) -{ - return ( - (c >= '0' && c <= '9') - || (c >= 'A' && c <= 'F') - || (c >= 'a' && c <= 'f')); -} -*/ - -char *pp_token_digit(char *p) -{ - char *s = pp_tok; - - if ('\'' == *p) - { - *s++ = *p++; - if (!*p) return NULL; - *s++ = *p++; - if (!*p) return NULL; - *s++ = *p++; - if (!*p) return NULL; - *s = 0; - } - else - { - do { - *s++ = *p++; - } while (*p && pp_is_digit(*p)); - if (*p) *s = 0; - } - - return p; -} - -char *pp_token_letter(char *p) -{ - char *s = pp_tok; - - do { - *s++ = *p++; - } while (*p && pp_is_ident(*p)); - if (*p) *s = 0; - - return p; -} - -char *pp_token_directive(char *p) -{ - char *s = pp_tok; - - ++p; // skip # - - // directive name - do { - *s++ = *p++; - } while (pp_is_ident(*p)); - *s = 0; - - // #include - if (!strcmp(pp_tok, "include")) - { - // boogly boogly boogly! - int l = 0; - char *e = NULL; - - //printf("#include detected \n"); - - // any whitespace after 'include' - p = pp_skipwhite(p); - - // skip, but don't expect, a " - if ('\"' == *p) ++p; - - // grab the filename - e = pp_tok; - while (*p && '\"' != *p) - *e++ = *p++; - // if we didn't hit eof...? - if (*p) - { - // zero term filename - *e = 0; - // skip closing " - ++p; - - last_filename=cur_filename; // - l = pp_line; // save - Process(pp_tok); - pp_line = l; // restore - cur_filename=last_filename; // - // reset file marker - pp_file_marker(); - - // disregard rest of line - while (*p && '\n' != *p) - ++p; - // if we didn't hit eof...? - if (*p) - { - // skip newline char - ++p; - - // update line - ++pp_line; - pp_line_marker(); - - // dump null token... writes nothing i think... - pp_tok[0]='\0'; - } - //else pp_error("screw you!"); - } - } - // #define - else if (!strcmp(pp_tok, "define")) - { - char *e = NULL; - char sym[256]; - char resolve[1024]; - - // find start of symbol - while (' ' == *p || '\t' == *p) - ++p; - - // parse symbol - e = sym; - while (pp_is_ident(*p)) - { *e++ = *p++; } - *e = 0; - - // check for duplicate #defines - if (pp_num_defs) - { - int i; - int z = strlen(sym); - for (i=0; i", *p, *p); - } - - return p; -} - -void Process(char *filename) -{ - char *s = NULL; - pp_include *ppi = NULL; - - // starts fresh for each #include file - pp_line = 1; - //pp_line_marker(); // hmm... did this kill the wat ver? i forget.. - - // push file - ppi = pp_include_add(filename); - s = ppi->data; - - pp_file_marker(); - - pp_last_delim = 1; - s = pp_token(s); - - // loop until we hit an EOF token - while (*s && PP_EOF != pp_toktype) - { - // for compactor; this is absolutely required for the parsing to - // work correctly for hex numbers - if (PP_LETTER == pp_toktype || PP_DIGIT == pp_toktype) - { - if (!pp_last_delim) - fputc(' ', pp_out); - } - - if (pp_num_defs) - { - // #define replacement - if (PP_LETTER == pp_toktype) - { - pp_def *ppd = NULL; - int pp_token_len = strlen(pp_tok); - int i = 0; - - for (i=0; isym_len == pp_token_len) - { - // lengths match, compare bytes - if (!stricmp(pp_tok, ppd->sym)) - { - // match! overwrite token with resolve - memcpy(pp_tok, ppd->resolve, strlen(ppd->resolve)+1); - break; - } - } - } - } - } - - // write whatever we got - fwrite(pp_tok, 1, strlen(pp_tok), pp_out); - - pp_last_delim = (PP_LETTER != pp_toktype); - s = pp_token(s); - } - - // pop file - free(ppi->data); - free(ppi->filename); - --pp_num_includes; - //pp_icur = &pp_incarr[pp_num_includes]; // oops! :-) - - pp_total_lines += pp_line; -} - -void pp_dump_output() -{ - char strx[1024]; - - sprintf(strx, "copy vcctemp.$$$ vcc%i.$$$", pp_tempct); - ++pp_tempct; - - system(strx); -} - -void PreProcess(char *filename) -{ - pp_num_includes = 0; - init_pp_chr_table(); - - pp_out = fopen("VCCTEMP.$$$", "wb"); - if (!pp_out) pp_error("unable to open VCCTEMP.$$$"); - - Process(filename); - - fclose(pp_out); - - // dump preproc output? - if (0 != pp_dump) - pp_dump_output(); -} diff --git a/16/v2/source/verge/VCC/PREPROC.H b/16/v2/source/verge/VCC/PREPROC.H deleted file mode 100755 index e5f8784d..00000000 --- a/16/v2/source/verge/VCC/PREPROC.H +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(__PREPROC_INC) -#define __PREPROC_INC - -extern void PreProcess(char *fname); -extern void Process(char *fname); - -#endif // __PREPROC_INC diff --git a/16/v2/source/verge/VCC/VCC.C b/16/v2/source/verge/VCC/VCC.C deleted file mode 100755 index 0a8a5c33..00000000 --- a/16/v2/source/verge/VCC/VCC.C +++ /dev/null @@ -1,342 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -// ³ The VergeC Compiler ³ -// ³ Copyright (C)1998 BJ Eirich (aka vecna) ³ -// ³ Main module ³ -// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - -#define VERSION "2.01c" - -#ifdef __DJGPP__ -#define BUILD_TAG "DJGPP V2\0" -#endif - -#ifdef __WATCOMC__ -#define BUILD_TAG "Watcom 11.0\0" -#endif - -#include -#include -#include -#include -#include - -#include "compile.h" -#include "lexical.h" - -extern int pp_dump; -extern int pp_nomark; - -// ================================= Data ==================================== - -char outmode, cmode; -char fname[80]; -char quiet, verbose; -char *strbuf; -int locate=0; - -// -- locals -- - -//FILE *f; -//int i; -//struct find_t *ft; - -// ================================= Code ==================================== - -void dprint(char *message, ...) -{ - va_list lst; - char string[1024]; - - if (quiet) return; - - // compose message - va_start (lst, message); - vsprintf (string, message, lst); - va_end (lst); - - printf ("%s \n", string); -} - -void vprint(char *message, ...) -{ - va_list lst; - char string[1024]; - - if (!verbose) return; - - // compose message - va_start (lst, message); - vsprintf (string, message, lst); - va_end (lst); - - printf ("%s \n", string); -} - -void err(char *message, ...) -{ - va_list lst; - char string[1024]; - - // compose message - va_start (lst, message); - vsprintf (string, message, lst); - va_end (lst); - - if (quiet) - { - FILE *efile = fopen("ERROR.TXT", "w"); - - fprintf(efile, "%s \n", string); - fclose(efile); - } - else - { - printf("%s \n", string); - } - - remove("vcctemp.$$$"); - exit(-1); -} - -void vcerr(char *message, ...) -{ - va_list lst; - char string[1024]; - - // compose message - va_start (lst, message); - vsprintf (string, message, lst); - va_end (lst); - - err("%s(%d) %s", source_file, lines, string); -} - -void vcc_compile_mode_map(char *filename) -{ - FILE *o=0; - FILE *f=0; - char *x=0; - int z=0; - - x = filename; - while ('.' != *x) ++x; - *x = 0; - - CompileMAP(filename); - - sprintf(strbuf, "%s.map", filename); - f = fopen(strbuf, "rb+"); - if (!f) - err("unable to open %s.", strbuf); - - fread(strbuf, 1, 6, f); - fread(&z, 1, 4, f); - fseek(f, 0, 0); - - o = fopen("outtemp.$$$", "wb"); - if (!o) - err("unable to open outtemp.$$$"); - x = (char *) malloc(z); - fread(x, 1, z, f); - fwrite(x, 1, z, o); - fclose(f); - - fwrite(&mfuncs, 1, 4, o); - fwrite(&functbl, 4, mfuncs, o); - mfuncs = (int) code - (int) outbuf; - fwrite(&mfuncs, 1, 4, o); - fwrite(outbuf, 1, code-outbuf, o); - fclose(o); - - // remove existing map file - sprintf(strbuf,"%s.map", filename); remove(strbuf); - // rename temp file to map file name - rename("outtemp.$$$", strbuf); -} - -void vcc_compile_mode_system() -{ - FILE *dump=0; - - CompileSystem(); - - dump = fopen("system.vcs", "wb"); - if (!dump) err("unable to open system.vcs"); - - fwrite(&numfuncs, 1, 4, dump); - fwrite(&curstartofs, 1, 4, dump); - fwrite(&sstartofs, 1, 4, dump); - fwrite(outbuf, 1, code-outbuf, dump); - fputc(255, dump); - - fclose(dump); -} - -void vcc_compile_mode_all() -{ - FILE *o=0; - FILE *f=0; - char *x=0; - int z=0; - struct find_t fileinfo; - - CompileSystem(); - f=fopen("system.vcs","wb"); - fwrite(&numfuncs, 1, 4, f); - fwrite(&curstartofs, 1, 4, f); - fwrite(&sstartofs, 1, 4, f); - fwrite(outbuf, 1, code-outbuf, f); - fputc(255, f); - fclose(f); - free(source); - free(outbuf); - - if (_dos_findfirst("*.MAP", _A_NORMAL, &fileinfo)) - err("No mapfiles found."); - - while (1) - { - int i; - memcpy(fname, fileinfo.name, 13); - - i=0; - while (fname[i]!='.') i++; - fname[i]=0; - - strlwr(fname); - mfuncs=0; - - CompileMAP(fname); - - sprintf(strbuf,"%s.map", fname); - f=fopen(strbuf,"rb+"); - fread(strbuf, 1, 6, f); - fread(&z, 1, 4, f); - fseek(f, 0, 0); - - o=fopen("outtemp.$$$","wb"); - x=(char *) malloc(z); - fread(x, 1, z, f); - fwrite(x, 1, z, o); - fclose(f); - free(x); - - fwrite(&mfuncs, 1, 4, o); - fwrite(&functbl, 4, mfuncs, o); - mfuncs=(int) code - (int) outbuf; - fwrite(&mfuncs, 1, 4, o); - fwrite(outbuf, 1, code-outbuf, o); - fclose(o); - - sprintf(strbuf,"%s.map", fname); - remove(strbuf); - rename("outtemp.$$$",strbuf); - - free(source); - free(outbuf); - - if (!_dos_findnext(&fileinfo)) - continue; - - break; - } - - dprint("%i total VC lines compiled.", tlines); -} - -int main(int argc, char *argv[]) -{ - int loop = 0; - char c = 0; - char *argstr = 0; - - strbuf= (char *) malloc(2000); - - cmode = 0; - pp_dump = 0; - pp_nomark = 0; - - for (loop = 1; loop < argc; loop++) - { - // point to argument string - argstr = &loop[argv][0]; - - c = *argstr; - // skip leading punctuators, if any - if ('-' == c || '+' == c || '/' == c) - ++argstr; - - if (!stricmp(argstr, "v")) - { verbose = 1; continue; } - - if (!stricmp(argstr, "q")) - { quiet = 1; continue; } - - // compile SYSTEM.VC only - if (!stricmp(argstr, "system")) - { cmode = 2; continue; } - - // compile all available .VC files - if (!stricmp(argstr, "all")) - { cmode = 3; continue; } - - // disable line/#include markers - if (!stricmp(argstr, "ppnomark")) - { pp_nomark = 1; continue; } - - // dump preprocessor output to temp files - if (!stricmp(argstr, "ppdump")) - { pp_dump = 1; continue; } - - // debug locator option - if ('.' == *argstr) - { locate = atoi(argstr+1); continue; } - - // at this point, the argument is assumed to be a file - - if (strlen(argstr) > 79) - { printf("filename '%s' too long!", argstr); argstr[79] = 0; } - memcpy(fname, argstr, strlen(argstr)+1); - - cmode = 1; - continue; - } - - dprint("vcc v.%s Copyright (C)1998 Benjamin Eirich. All rights reserved.", VERSION); - vprint("%s build %s on %s %s", BUILD_TAG, __FILE__, __DATE__, __TIME__); - - if (!cmode) - err("No input files."); - - InitCompileSystem(); - - switch (cmode) - { - case 1: vcc_compile_mode_map(fname); break; - case 2: vcc_compile_mode_system(); break; - case 3: vcc_compile_mode_all(); break; - - default: err("you have now entered the twilight zone."); - } - - remove("vcctemp.$$$"); - remove("ERROR.TXT"); - - return 0; -} diff --git a/16/v2/source/verge/VCC/VCC.H b/16/v2/source/verge/VCC/VCC.H deleted file mode 100755 index 99a91f72..00000000 --- a/16/v2/source/verge/VCC/VCC.H +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(__VCC_INC) -#define __VCC_INC - -#define QUIET 0 -#define DEFAULT 1 -#define VERBOSE 2 - -#define CONTROL 1 -#define DIGIT 2 -#define IDENTIFIER 3 -#define RESERVED 4 -#define FUNCTION 5 - -extern char *strbuf; -extern int locate; - -extern void err(char *message, ...); -extern void vcerr(char *message, ...); -extern void dprint(char *message, ...); -extern void vprint(char *message, ...); - -#endif // __VCC_INC diff --git a/16/v2/source/verge/VCC/VCCODE.H b/16/v2/source/verge/VCC/VCCODE.H deleted file mode 100755 index 74495139..00000000 --- a/16/v2/source/verge/VCC/VCCODE.H +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright (C) 1998 BJ Eirich (aka vecna) -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public Lic -See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// We never use zero as a tag. This makes it easier to track down misbehaving -// VC code, since zero is commonly come-by when going off into uncharted -// depths of memory. - -#define ERROR 0 - -// Opcode values. - -#define opEXEC_STDLIB 1 -#define opEXEC_LOCALFUNC 2 -#define opEXEC_EXTERNFUNC 3 -#define opIF 4 -#define opELSE 5 -#define opGOTO 6 -#define opSWITCH 7 -#define opCASE 8 -#define opRETURN 9 -#define opASSIGN 10 -#define opSETRETVAL 11 -#define opSETLOCALSTACK 12 - -// Operand types. - -#define op_IMMEDIATE 1 -#define op_HVAR0 2 -#define op_HVAR1 3 -#define op_UVAR 4 -#define op_UVARRAY 5 -#define op_LVAR 6 -#define op_BFUNC 7 -#define op_UFUNC 8 -#define op_GROUP 9 -#define op_STRING 10 -#define op_SARRAY 11 -#define op_SLOCAL 12 - -// Variable types. - -#define v_IMMEDIATE 1 // is this necessary? -#define v_CHAR 2 -#define v_PTR 3 -#define v_INT 4 - -// IF relational operators. - -#define i_ZERO 1 -#define i_NONZERO 2 -#define i_EQUALTO 3 -#define i_NOTEQUAL 4 -#define i_GREATERTHAN 5 -#define i_LESSTHAN 6 -#define i_GREATERTHANOREQUAL 7 -#define i_LESSTHANOREQUAL 8 -#define i_GROUP 9 -#define i_UNGROUP 10 -#define i_AND 11 -#define i_OR 12 - -// Assignment operators. - -#define a_SET 1 -#define a_INC 2 -#define a_DEC 3 -#define a_INCSET 4 -#define a_DECSET 5 -#define a_MULTSET 6 -#define a_DIVSET 7 - -// Operand combination operators. - -#define op_ADD 1 -#define op_SUB 2 -#define op_MULT 3 -#define op_DIV 4 -#define op_MOD 5 -#define op_SHL 6 -#define op_SHR 7 -#define op_AND 8 -#define op_OR 9 -#define op_XOR 10 -#define op_END 11 - -// String components - -#define s_IMMEDIATE 1 -#define s_GLOBAL 2 -#define s_ARRAY 3 -#define s_NUMSTR 4 -#define s_LEFT 5 -#define s_RIGHT 6 -#define s_MID 7 -#define s_LOCAL 8 -#define s_ADD 9 -#define s_CHR 10 -#define s_END 11 diff --git a/16/v2/source/verge/gnu.txt b/16/v2/source/verge/gnu.txt deleted file mode 100755 index 358ef6fb..00000000 --- a/16/v2/source/verge/gnu.txt +++ /dev/null @@ -1,87 +0,0 @@ -GNU GENERAL PUBLIC LICENSE -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. -Preamble -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. - -Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification follow. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - -a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. - -b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. - -c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - -a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - -b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - -c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) -The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. -If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - -END OF TERMS AND CONDITIONS -- 2.39.5