├── .cproject ├── .github └── workflows │ ├── build-sdl1.yaml │ └── build.yaml ├── .gitignore ├── .project ├── .settings ├── org.eclipse.cdt.core.prefs ├── org.eclipse.cdt.ui.prefs ├── org.eclipse.core.resources.prefs ├── org.eclipse.core.runtime.prefs └── org.eclipse.ltk.core.refactoring.prefs ├── AUTHORS ├── COPYING ├── GPL3 ├── Makefile.am ├── README.md ├── bfariadne ├── include │ ├── delaunay.h │ ├── trfind8.h │ ├── trfringe.h │ ├── triangls.h │ ├── tringops.h │ ├── trlog.h │ ├── trpath.h │ ├── trpoints.h │ └── trstate.h └── src │ ├── delaunay.c │ ├── trfind8.c │ ├── trfringe.c │ ├── triangls.c │ ├── tringops.c │ ├── trpoints.c │ └── trstate.c ├── bflibrary ├── .gitignore ├── Makefile.am ├── configure.ac ├── include │ ├── bfanywnd.h │ ├── bfbox.h │ ├── bfbuffer.h │ ├── bfcircle.h │ ├── bfdata.h │ ├── bfdir.h │ ├── bfdos.h │ ├── bfdrive.h │ ├── bfendian.h │ ├── bfexe_key.h │ ├── bffile.h │ ├── bfflic.h │ ├── bffnuniq.h │ ├── bffont.h │ ├── bfgentab.h │ ├── bfiff.h │ ├── bfini.h │ ├── bfkeybd.h │ ├── bfline.h │ ├── bflog.h │ ├── bfmath.h │ ├── bfmemory.h │ ├── bfmemut.h │ ├── bfmouse.h │ ├── bfpalcrss.h │ ├── bfpalette.h │ ├── bfpixel.h │ ├── bfplanar.h │ ├── bfpng.h │ ├── bfscrcopy.h │ ├── bfscreen.h │ ├── bfscrsurf.h │ ├── bfsemphr.hpp │ ├── bfsprite.h │ ├── bfstrut.h │ ├── bftext.h │ ├── bftime.h │ ├── bftringl.h │ ├── bftypes.h │ ├── bfutility.h │ ├── bfwindows.h │ ├── insprite.h │ ├── insspr.h │ ├── mshandler.hpp │ ├── mspointer.hpp │ ├── poly.h │ ├── poly_gp.h │ ├── poly_trigp.h │ ├── poly_trigr.h │ ├── privbflog.h │ ├── rnc_1fm.h │ ├── rom.h │ └── svesa.h ├── m4 │ ├── ax_prefix_config_h.m4 │ ├── pkg.m4 │ ├── sdl.m4 │ └── sdl2.m4 ├── src │ ├── general │ │ ├── arctan.c │ │ ├── box_clip.c │ │ ├── ganywnd.c │ │ ├── gbox.c │ │ ├── gbuffer.cpp │ │ ├── gcircle.c │ │ ├── gdata.c │ │ ├── gendian.c │ │ ├── gerrorlg.c │ │ ├── gexe_key.c │ │ ├── gfile.c │ │ ├── gflicply.c │ │ ├── gflicrec.c │ │ ├── gfnuniq.c │ │ ├── gfont.c │ │ ├── ggenf.c │ │ ├── ggengh.c │ │ ├── giff.c │ │ ├── gini.c │ │ ├── gkeybd.c │ │ ├── gline.c │ │ ├── gmemut.c │ │ ├── gmouse.c │ │ ├── gpalcrss.c │ │ ├── gpalette.c │ │ ├── gplanar.c │ │ ├── gpng.c │ │ ├── gscreen.c │ │ ├── gspr_col.c │ │ ├── gspr_enc.c │ │ ├── gspr_map.c │ │ ├── gspr_std.c │ │ ├── gsprite.c │ │ ├── gstrut.c │ │ ├── gtext.c │ │ ├── gtrig.c │ │ ├── gtringl.c │ │ ├── gutility.c │ │ ├── hvline.c │ │ ├── mshandler.cpp │ │ ├── mspointer.cpp │ │ ├── pixel.c │ │ ├── poly.c │ │ ├── poly_gp.c │ │ ├── poly_trigp.c │ │ ├── poly_trigp_s.c │ │ ├── poly_trigr.c │ │ ├── poly_trigr_s.c │ │ ├── rnc_1fm.c │ │ ├── rom.c │ │ ├── scr_copy.c │ │ ├── spr_mcur.c │ │ ├── spr_scl.c │ │ ├── spr_scol.c │ │ ├── spr_smap.c │ │ ├── spr_ssta.c │ │ ├── spr_sstd.c │ │ ├── spr_ssts.c │ │ └── sqroot.c │ ├── x86-dos-watcom │ │ ├── sdir.c │ │ ├── sfile.c │ │ ├── skeybd.c │ │ ├── smemory.cpp │ │ ├── smouse.cpp │ │ ├── spalette.cpp │ │ ├── sscreen.cpp │ │ ├── stime.cpp │ │ ├── svesa.cpp │ │ └── swindows.cpp │ ├── x86-win-sdl │ │ ├── sdir.c │ │ ├── sdrive.c │ │ ├── sffind.c │ │ ├── sfile.c │ │ ├── skeybd.cpp │ │ ├── slog.c │ │ ├── smemory.c │ │ ├── smouse.cpp │ │ ├── spalette.c │ │ ├── sscreen.c │ │ ├── sscrsurf.c │ │ ├── ssemphr.cpp │ │ ├── stime.c │ │ ├── svesa.c │ │ └── swindows.c │ └── x86-win-sdl2 │ │ ├── sdir.c │ │ ├── sdrive.c │ │ ├── sffind.c │ │ ├── sfile.c │ │ ├── skeybd.cpp │ │ ├── slog.c │ │ ├── smemory.c │ │ ├── smouse.cpp │ │ ├── spalette.c │ │ ├── sscreen.c │ │ ├── sscrsurf.c │ │ ├── ssemphr.cpp │ │ ├── stime.c │ │ ├── svesa.c │ │ └── swindows.c └── tests │ ├── bflib_test_math.c │ ├── bflib_test_memory.c │ ├── bflib_test_pogpol.c │ ├── bflib_test_poline.c │ ├── bflib_test_potrig.c │ ├── bflib_test_sprdrw.c │ ├── bflib_test_tringl.c │ ├── bftstlog.h │ ├── helpers_fr_swars01.c │ ├── helpers_frame.h │ ├── helpers_screen.c │ ├── helpers_screen.h │ ├── helpers_sprite.c │ ├── helpers_sprite.h │ ├── mock_bfmouse.h │ ├── mock_bfpalette.h │ ├── mock_bfscreen.h │ ├── mock_bfwindows.h │ ├── mock_mouse.c │ ├── mock_palette.c │ ├── mock_screen.c │ ├── mock_windows.c │ └── referenc │ ├── spr_devpac-mans16.png │ ├── tst_gpoly1_rf.png │ ├── tst_gpoly2_rf.png │ ├── tst_gpoly3_rf.png │ ├── tst_gpoly4_rf.png │ ├── tst_gpoly5_rf.png │ ├── tst_gpoly6_rf.png │ ├── tst_gpoly7_rf.png │ ├── tst_gpoly8_rf.png │ ├── tst_gpoly_frame01_rf.png │ ├── tst_pline1_rf.png │ ├── tst_pline2_rf.png │ ├── tst_pline3_rf.png │ ├── tst_pline4_rf.png │ ├── tst_pline5_rf.png │ ├── tst_pline6_rf.png │ ├── tst_pline7_rf.png │ ├── tst_pline8_rf.png │ ├── tst_trig1_rf.png │ ├── tst_trig2_rf.png │ ├── tst_trig3_rf.png │ ├── tst_trig4_rf.png │ ├── tst_trig5_rf.png │ ├── tst_trig6_rf.png │ ├── tst_trig7_rf.png │ ├── tst_trig8_rf.png │ ├── tst_tringl1_rf.png │ ├── tst_tringl2_rf.png │ ├── tst_tringl3_rf.png │ ├── tst_tringl4_rf.png │ ├── tst_tringl5_rf.png │ ├── tst_tringl6_rf.png │ ├── tst_tringl7_rf.png │ └── tst_tringl8_rf.png ├── bfsmacklib ├── include │ ├── bfsmack.h │ ├── smack.h │ └── smack2ail.h └── src │ ├── bfsmack.c │ ├── bfsmacklib_s.sx │ └── smack2ail.c ├── bfsoundlib ├── Makefile.am ├── configure.ac ├── include │ ├── ail.h │ ├── aila.h │ ├── aildebug.h │ ├── ailss.h │ ├── awe32.h │ ├── bfaudio.h │ ├── bfdanger.h │ ├── bfmusic.h │ ├── bfscd.h │ ├── bfsound.h │ ├── bfsvaribl.h │ ├── dllload.h │ ├── dpmi.h │ ├── drv_oal.h │ ├── memfile.h │ ├── miscutil.h │ ├── mssal.h │ ├── mssdig.h │ ├── msssys.h │ ├── mssxdig.h │ ├── mssxmidi.h │ ├── oggvorbis.h │ ├── sb16.h │ ├── snderr.h │ ├── sndtimer.h │ ├── ssampfad.h │ ├── ssamplst.h │ ├── ssampply.h │ └── streamfx.h ├── m4 │ ├── ax_prefix_config_h.m4 │ ├── openal.m4 │ └── pkg.m4 └── src │ ├── ail.c │ ├── aila.c │ ├── aildebug.c │ ├── ailss.c │ ├── ailssa.sx │ ├── ailvoc.c │ ├── ailwav.c │ ├── awe32.c │ ├── awe32use.c │ ├── bfaudio.c │ ├── cd.c │ ├── dllload.c │ ├── dpmi.c │ ├── drv_oal.c │ ├── init_mus.c │ ├── init_snd.c │ ├── memfile.c │ ├── miscutil.c │ ├── mseqnfad.c │ ├── mseqnlst.c │ ├── mseqnply.c │ ├── mssdig.c │ ├── msssys.c │ ├── mssxdig.c │ ├── mssxmidi.c │ ├── oggvorbis.c │ ├── sb16.c │ ├── snderr.c │ ├── sndtimer.c │ ├── ssampfad.c │ ├── ssamplst.c │ ├── ssampply.c │ ├── streamfx.c │ └── variable.c ├── conf ├── Makefile.am ├── Tone_000 │ ├── 000_Acoustic_Grand_Piano.pat │ └── 004_Electric_Piano_1_Rhodes.pat ├── char_encoding_tbl_eu.txt ├── char_encoding_tblm_eu.txt ├── cities.ini ├── cybmods.ini ├── fnmap_posix.conf ├── fnmap_windows.conf ├── midipats.cfg ├── miss000.ini ├── miss001.ini ├── miss002.ini ├── miss003.ini ├── miss099.ini ├── panel0-0.ini ├── panel0-1.ini ├── panel0-3.ini ├── people.ini ├── pop0-0.ini ├── pop0-1.ini ├── pop0-3.ini ├── rules.ini ├── weapons.ini ├── wrappers_dos.conf ├── wrappers_game.conf ├── wrappers_libc.conf └── wrappers_util.conf ├── configure.ac ├── doc ├── TODO ├── campaign-church-missions.md ├── campaign-punk-missions.md └── campaign-syndict-missions.md ├── lang ├── Makefile.am ├── alltext_church_eng.pot ├── alltext_church_fre.po ├── alltext_church_ger.po ├── alltext_church_ita.po ├── alltext_church_jap.po ├── alltext_church_spa.po ├── alltext_church_swe.po ├── alltext_comm_eng.pot ├── alltext_comm_fre.po ├── alltext_comm_ger.po ├── alltext_comm_ita.po ├── alltext_comm_jap.po ├── alltext_comm_spa.po ├── alltext_comm_swe.po ├── alltext_punks_eng.pot ├── alltext_punks_fre.po ├── alltext_punks_ger.po ├── alltext_punks_ita.po ├── alltext_punks_jap.po ├── alltext_punks_spa.po ├── alltext_punks_swe.po ├── alltext_syndct_eng.pot ├── alltext_syndct_fre.po ├── alltext_syndct_ger.po ├── alltext_syndct_ita.po ├── alltext_syndct_jap.po ├── alltext_syndct_spa.po └── alltext_syndct_swe.po ├── m4 ├── openal.m4 ├── pkg.m4 ├── sdl.m4 └── sdl2.m4 ├── res ├── lang_n_cdrom.ini ├── license-eng.txt ├── swars-config.nsh.in ├── swars-setup.nsi ├── swars.icns ├── swars_icon.ico ├── swars_icon.png └── swars_stdres.rc ├── src ├── Makefile.am ├── ap_gspr_map.c ├── ap_spr_smap.c ├── app_gengh.c ├── app_gentab.h ├── app_spr_init.c ├── app_sprite.h ├── bat.sx ├── bflib_joyst.c ├── bflib_joyst.h ├── bflib_joyst_s.sx ├── bflib_render_drspr.c ├── bflib_render_drspr.h ├── bflib_render_drspr_s.sx ├── bflib_render_gpoly.c ├── bflib_render_gpoly_s.sx ├── bflib_render_plin_s.sx ├── bflib_snd_mss_s.sx ├── bflib_sndlib_s.sx ├── bflib_vidraw.c ├── bflib_vidraw.h ├── bflib_vidraw_s.sx ├── bigmap.c ├── bigmap.h ├── bmbang.c ├── bmbang.h ├── building.c ├── building.h ├── campaign.c ├── campaign.h ├── command.c ├── command.h ├── cybmod.c ├── cybmod.h ├── display.c ├── display.h ├── dos.c ├── dos.h ├── drawtext.c ├── drawtext.h ├── enginbckt.c ├── enginbckt.h ├── engindrwlstm.c ├── engindrwlstm.h ├── engindrwlstx.c ├── engindrwlstx.h ├── enginfexpl.c ├── enginfexpl.h ├── enginfloor.c ├── enginfloor.h ├── enginlights.c ├── enginlights.h ├── enginpeff.c ├── enginpeff.h ├── enginpriobjs.c ├── enginpriobjs.h ├── enginpritxtr.c ├── enginpritxtr.h ├── enginshadws.c ├── enginshadws.h ├── enginshrapn.c ├── enginshrapn.h ├── enginsngobjs.c ├── enginsngobjs.h ├── enginsngtxtr.c ├── enginsngtxtr.h ├── engintrns.c ├── engintrns.h ├── enginzoom.c ├── enginzoom.h ├── febrief.c ├── febrief.h ├── fecntrls.c ├── fecntrls.h ├── fecryo.c ├── fecryo.h ├── fedebrief.c ├── fedebrief.h ├── feequip.c ├── feequip.h ├── felogin.c ├── felogin.h ├── femail.c ├── femail.h ├── femain.c ├── femain.h ├── fenet.c ├── fenet.h ├── feoptions.c ├── feoptions.h ├── fepanet.c ├── fepanet.h ├── fepause.c ├── fepause.h ├── feresearch.c ├── feresearch.h ├── festorage.c ├── festorage.h ├── feworld.c ├── feworld.h ├── game.c ├── game.h ├── game_bstype.h ├── game_data.c ├── game_data.h ├── game_save.c ├── game_save.h ├── game_speed.c ├── game_speed.h ├── game_sprani.c ├── game_sprani.h ├── game_sprts.c ├── game_sprts.h ├── globals.h ├── guiboxes.c ├── guiboxes.h ├── guigraph.c ├── guigraph.h ├── guitext.c ├── guitext.h ├── hud_panecfg.c ├── hud_panecfg.h ├── hud_panel.c ├── hud_panel.h ├── hud_target.c ├── hud_target.h ├── joy_grip.c ├── joy_grip.h ├── joy_modul1.sx ├── joy_modul2.sx ├── joy_rt_spbal.c ├── joy_rt_spbal.h ├── joy_sbconfig.c ├── joy_sbconfig.h ├── joy_splib.h ├── keyboard.c ├── keyboard.h ├── linksmk.c ├── linksmk.h ├── lvdraw3d.c ├── lvdraw3d.h ├── lvfiles.c ├── lvfiles.h ├── lvobjctv.c ├── lvobjctv.h ├── main.c ├── matrix.c ├── matrix.h ├── misstat.c ├── misstat.h ├── mouse.c ├── mouse.h ├── mydraw.c ├── mydraw.h ├── netipx1.sx ├── netser1.sx ├── network.c ├── network.h ├── osunix.c ├── osunix.h ├── oswindws.c ├── oswindws.h ├── packet.c ├── packet.h ├── pathtrig.c ├── pathtrig.h ├── pathtrig_debug.c ├── people.c ├── people.h ├── pepgroup.c ├── pepgroup.h ├── player.c ├── player.h ├── plyr_packet.c ├── plyr_packet.h ├── plyr_usrinp.c ├── plyr_usrinp.h ├── purpldrw.c ├── purpldrw.h ├── purpldrwlst.c ├── purpldrwlst.h ├── radica1.sx ├── radica2.sx ├── radica3.sx ├── research.c ├── research.h ├── rules.c ├── rules.h ├── scandraw.c ├── scandraw.h ├── scanner.c ├── scanner.h ├── sound.c ├── sound.h ├── specblit.c ├── specblit.h ├── swars.sx ├── swars_ver.h ├── swlog.h ├── thing.c ├── thing.h ├── thing_debug.c ├── thing_debug_s.sx ├── thing_search.c ├── thing_search.h ├── timer.c ├── timer.h ├── tngcolisn.c ├── tngcolisn.h ├── tngobjdrw.c ├── tngobjdrw.h ├── util.c ├── util.h ├── vehicle.c ├── vehicle.h ├── vehtraffic.c ├── vehtraffic.h ├── wadfile.c ├── wadfile.h ├── weapon.c ├── weapon.h ├── wrcities.c └── wrcities.h └── util ├── Makefile.am ├── asfilter ├── chgcalls ├── install ├── mkbundle ├── mkwrappers └── textwad.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.h.in 2 | /debug 3 | /release 4 | /autom4te.cache 5 | config.guess 6 | config.sub 7 | config.log 8 | Makefile.in 9 | aclocal.m4 10 | compile 11 | configure 12 | depcomp 13 | install-sh 14 | ltmain.sh 15 | missing 16 | *~ 17 | test-driver 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.cdt.ui.prefs: -------------------------------------------------------------------------------- 1 | #Sat Jan 16 16:19:42 CET 2010 2 | eclipse.preferences.version=1 3 | formatter_profile=_SWars 4 | formatter_settings_version=1 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Sat Jan 16 16:16:06 CET 2010 2 | eclipse.preferences.version=1 3 | encoding/=UTF-8 4 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | #Sat Jan 16 16:19:42 CET 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 4 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Programming: 2 | 3 | Unavowed 4 | Gynvael Coldwind 5 | 6 | 7 | Guest contributions: 8 | 9 | Memek 10 | oshogbo 11 | Blount 12 | 13 | 14 | Icons: 15 | 16 | Xa 17 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | All source code except the code in src/*.sx is licensed under the GNU 2 | General Public License, version 3 or any later version. src/*.sx files are 3 | modified disassembled version of the original game's main.exe by Bullfrog. The 4 | project is distributed without charge and in good faith that it will be useful 5 | to those who purchased the original game but cannot play it anymore because 6 | they do not have access to an old DOS system. However, should the original 7 | copyright holders complain, we will take down the code they have the rights to. 8 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = --install -I m4 2 | 3 | SUBDIRS = bflibrary bfsoundlib conf lang src util 4 | 5 | # Do not install static libraries. 6 | install installdirs: SUBDIRS = conf lang src util 7 | 8 | doc_DATA = AUTHORS COPYING GPL3 9 | docdir = $(prefix)/$(PACKAGE) 10 | 11 | res_DATA = 12 | resdir = $(prefix)/$(PACKAGE) 13 | 14 | if TARGET_WINDOWS 15 | res_DATA += res/swars_icon.ico 16 | else 17 | res_DATA += res/swars.icns res/swars_icon.png 18 | endif 19 | 20 | instscript_DATA = util/install 21 | instscriptdir = $(prefix)/$(PACKAGE) 22 | 23 | EXTRA_DIST = doc res instscript 24 | -------------------------------------------------------------------------------- /bfariadne/include/delaunay.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Ariadne Pathfinding Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file delaunay.h 6 | * Header file for delaunay.c. 7 | * @par Purpose: 8 | * Triangulation optimization support using Delaunay algorithm. 9 | * @par Comment: 10 | * Just a header file - #defines, typedefs, function prototypes etc. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 02 Jan 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef ARIADNE_DELAUNAY_H 21 | #define ARIADNE_DELAUNAY_H 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /******************************************************************************/ 30 | #pragma pack(1) 31 | 32 | 33 | #pragma pack() 34 | /******************************************************************************/ 35 | 36 | /** Optimize the triangulation data using Delaunay mesh generation. 37 | * 38 | * The map triangulation data is prepared by adding points and dividing 39 | * nearby triangles. This leads to some triangles being unnecesarily 40 | * long, and makes some paths go through much more triangles than the 41 | * optimal mesh would require. This function re-geerates the mesh to 42 | * optimal state, using Delaunay algoithm. 43 | */ 44 | void delaunay_step(void); 45 | 46 | /******************************************************************************/ 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | #endif 51 | -------------------------------------------------------------------------------- /bfariadne/include/trfind8.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Ariadne Pathfinding Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file trfind8.h 6 | * Header file for trfind8.c. 7 | * @par Purpose: 8 | * Routines for finding features in the triangulation data. 9 | * @par Comment: 10 | * Just a header file - #defines, typedefs, function prototypes etc. 11 | * @author Tomasz Lis 12 | * @date 29 Sep 2023 - 09 Feb 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef ARIADNE_TRFIND8_H 21 | #define ARIADNE_TRFIND8_H 22 | 23 | #include "bftypes.h" 24 | #include "triangls.h" 25 | #include "trpoints.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /******************************************************************************/ 32 | 33 | int triangle_find8(TrFineCoord pt_x, TrFineCoord pt_y); 34 | 35 | /******************************************************************************/ 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /bfariadne/include/trpath.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Ariadne Pathfinding Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file trpath.h 6 | * Header file for trpath.c. 7 | * @par Purpose: 8 | * Triangulated path declaration and support. 9 | * @par Comment: 10 | * Just a header file - #defines, typedefs, function prototypes etc. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 02 Jan 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef ARIADNE_TRPATH_H 21 | #define ARIADNE_TRPATH_H 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /******************************************************************************/ 30 | #pragma pack(1) 31 | 32 | struct Path; 33 | 34 | #pragma pack() 35 | /******************************************************************************/ 36 | 37 | /******************************************************************************/ 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /bfariadne/src/trfind8.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Ariadne Pathfinding Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file trfind8.c 6 | * Routines for finding features in the triangulation data. 7 | * @par Purpose: 8 | * Implement functions for searching through the triangles and points. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 29 Sep 2023 - 09 Feb 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "triangls.h" 21 | 22 | #include 23 | #include 24 | #include "trstate.h" 25 | #include "trlog.h" 26 | /******************************************************************************/ 27 | 28 | 29 | /******************************************************************************/ 30 | -------------------------------------------------------------------------------- /bfariadne/src/trstate.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Ariadne Pathfinding Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file trstate.c 6 | * Triangulation state declaration and support. 7 | * @par Purpose: 8 | * Implement functions for handling whole triangulation states. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 29 Sep 2023 - 02 Jan 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "triangls.h" 21 | 22 | #include 23 | #include 24 | #include "trstate.h" 25 | #include "trlog.h" 26 | /******************************************************************************/ 27 | 28 | void triangulation_select(int trglno) 29 | { 30 | asm volatile ("call ASM_triangulation_select\n" 31 | : : "a" (trglno)); 32 | } 33 | 34 | void triangulation_clear_enter_into_solid(void) 35 | { 36 | ubyte seltr; 37 | 38 | seltr = selected_triangulation_no; 39 | 40 | triangulation_select(1); 41 | triangulation_clear_enter_into_solid_gnd(); 42 | 43 | triangulation_select(2); 44 | triangulation_clear_enter_into_solid_air(); 45 | 46 | triangulation_select(seltr); 47 | } 48 | 49 | /******************************************************************************/ 50 | -------------------------------------------------------------------------------- /bflibrary/.gitignore: -------------------------------------------------------------------------------- 1 | include/bfconfig.h.in 2 | /autom4te.cache 3 | config.guess 4 | config.sub 5 | Makefile.in 6 | aclocal.m4 7 | compile 8 | configure 9 | depcomp 10 | install-sh 11 | ltmain.sh 12 | missing 13 | *~ 14 | -------------------------------------------------------------------------------- /bflibrary/include/bfcircle.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfcircle.h 6 | * Header file for gcircle.c. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFCIRCLE_H_ 21 | #define BFLIBRARY_BFCIRCLE_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | TbResult LbDrawCircle(long x, long y, ulong radius, TbPixel colour); 30 | 31 | TbResult LbDrawCircleOutline(long x, long y, ulong radius, TbPixel colour); 32 | TbResult LbDrawCircleFilled(long x, long y, ulong radius, TbPixel colour); 33 | 34 | #ifdef __cplusplus 35 | }; 36 | #endif 37 | 38 | #endif // BFLIBRARY_BFCIRCLE_H_ 39 | /******************************************************************************/ 40 | -------------------------------------------------------------------------------- /bflibrary/include/bfexe_key.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfexe_key.h 6 | * Header file for gexe_key.cpp. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * Just a header file - #defines, typedefs, function prototypes etc. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFEXE_KEY_H_ 21 | #define BFLIBRARY_BFEXE_KEY_H_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | unsigned long LbExeReferenceNumber(void); 28 | 29 | #ifdef __cplusplus 30 | }; 31 | #endif 32 | 33 | #endif // BFLIBRARY_BFEXE_KEY_H_ 34 | /******************************************************************************/ 35 | -------------------------------------------------------------------------------- /bflibrary/include/bfline.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfline.h 6 | * Header file for gline.cpp, hvline.asm. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFLINE_H_ 21 | #define BFLIBRARY_BFLINE_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Draws a line on current graphics window. 30 | * 31 | * Truncates the coordinates if they go off the window. Requires the screen 32 | * to be locked. 33 | */ 34 | TbResult LbDrawLine(long X1, long Y1, long X2, long Y2, TbPixel colour); 35 | 36 | TbResult LbDrawHVLine(long X1, long Y1, long X2, long Y2, TbPixel colour); 37 | 38 | #ifdef __cplusplus 39 | }; 40 | #endif 41 | 42 | #endif // BFLIBRARY_BFLINE_H_ 43 | /******************************************************************************/ 44 | -------------------------------------------------------------------------------- /bflibrary/include/bfmemut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfmemut.h 6 | * Header file for gmemut.cpp. 7 | * @par Purpose: 8 | * Memory related utility functions. 9 | * @par Comment: 10 | * Provides custom wrappers to memory routines, helpful for debug. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFMEMUT_H_ 21 | #define BFLIBRARY_BFMEMUT_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Fills memory range with given byte value. 30 | */ 31 | void * LbMemorySet(void *dst, unsigned char c, TbMemSize size); 32 | 33 | /** Copies memory range over given destination. 34 | */ 35 | void * LbMemoryCopy(void *in_dst, const void *in_src, TbMemSize size); 36 | 37 | /** Copies memory range over given destination, allows overlapping. 38 | */ 39 | void * LbMemoryMove(void *in_dst, const void *in_src, TbMemSize size); 40 | 41 | /** Compare two memory blocks. 42 | * 43 | * @param ptr1 The first pointer. 44 | * @param size Amount of bytes to compare. 45 | */ 46 | int LbMemoryCompare(void *ptr1, void *ptr2, TbMemSize size); 47 | 48 | #ifdef __cplusplus 49 | }; 50 | #endif 51 | 52 | #endif // BFLIBRARY_BFMEMUT_H_ 53 | /******************************************************************************/ 54 | -------------------------------------------------------------------------------- /bflibrary/include/bfpalcrss.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfpalcrss.h 6 | * Header file for bfpalcrss.c. 7 | * @par Purpose: 8 | * Palette changing functions. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2021 - 05 Jun 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFPALCRSS_H_ 21 | #define BFLIBRARY_BFPALCRSS_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Generate a table for converting an image between two palettes. 30 | * 31 | * @param cross_lut Output lookup table for converting each pixel. 32 | * @param src_palette Source palette. 33 | * @param dst_palette Destination palette. 34 | */ 35 | TbResult LbCrossPaletteLutGen(ubyte *cross_lut, const ubyte *src_palette, 36 | const ubyte *dst_palette); 37 | 38 | /** Computes histogram for given memory buffer. 39 | * 40 | * @param hist Output histogram array. 41 | * @param buf Input data. 42 | * @param buf_len Length of the input data. 43 | */ 44 | TbResult LbBufferHistogram(ulong *hist, const TbPixel *buf, ulong buf_len); 45 | 46 | short LbImageBuffersMaxDifference(const TbPixel *buf1, const ubyte *pal1, 47 | const TbPixel *buf2, const ubyte *pal2, ulong buf_len, ulong *pos); 48 | 49 | #ifdef __cplusplus 50 | }; 51 | #endif 52 | 53 | #endif // BFLIBRARY_BFPALCRSS_H_ 54 | /******************************************************************************/ 55 | -------------------------------------------------------------------------------- /bflibrary/include/bfpixel.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfpixel.h 6 | * Header file for pixel.asm. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFPIXEL_H_ 21 | #define BFLIBRARY_BFPIXEL_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Draw pixel on graphics window, with clipping. 30 | * 31 | */ 32 | TbResult LbDrawPixelClip(long x, long y, TbPixel colour); 33 | 34 | /** Draw pixel on graphics window, without checking coords. 35 | * 36 | * This function just sets the pixel to given colour, ignoring DrawFlags. 37 | */ 38 | TbResult LbDrawPixel(long x, long y, TbPixel colour); 39 | 40 | #ifdef __cplusplus 41 | }; 42 | #endif 43 | 44 | #endif // BFLIBRARY_BFPIXEL_H_ 45 | /******************************************************************************/ 46 | -------------------------------------------------------------------------------- /bflibrary/include/bfplanar.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfplanar.h 6 | * Header file for gplanar.c. 7 | * @par Purpose: 8 | * Basic planar integer geometry. 9 | * @par Comment: 10 | * Just a header file - #defines, typedefs, function prototypes etc. 11 | * @author Tomasz Lis 12 | * @date 24 Jan 2009 - 08 Mar 2009 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFPLANAR_H_ 21 | #define BFLIBRARY_BFPLANAR_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | struct TbRect { 30 | long left; 31 | long top; 32 | long right; 33 | long bottom; 34 | }; 35 | 36 | struct TbPoint { 37 | long x; 38 | long y; 39 | }; 40 | 41 | /******************************************************************************/ 42 | 43 | void LbSetRect(struct TbRect *rect, long xLeft, long yTop, long xRight, long yBottom); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif // BFLIBRARY_BFPLANAR_H_ 49 | /******************************************************************************/ 50 | -------------------------------------------------------------------------------- /bflibrary/include/bfsemphr.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfsemphr.hpp 6 | * Header file for ssemphr.cpp. 7 | * @par Purpose: 8 | * Semaphores wrapper. 9 | * @par Comment: 10 | * Just a header file - #defines, typedefs, function prototypes etc. 11 | * @author Tomasz Lis 12 | * @date 21 May 2009 - 20 Jul 2009 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFSEMPHR_H_ 21 | #define BFLIBRARY_BFSEMPHR_H_ 22 | 23 | /******************************************************************************/ 24 | 25 | class LbSemaphore { 26 | public: 27 | LbSemaphore(void); 28 | virtual ~LbSemaphore(void); 29 | #if defined(WIN32) 30 | union { 31 | void *pHandle; 32 | int iHandle; 33 | }; 34 | #else 35 | #endif 36 | }; 37 | 38 | /******************************************************************************/ 39 | 40 | class LbSemaLock { 41 | public: 42 | LbSemaLock(class LbSemaphore *sem, bool isLocked); 43 | virtual ~LbSemaLock(void); 44 | int Lock(bool wait_forever); 45 | void Release(void); 46 | #if defined(WIN32) 47 | union { 48 | void *pHandle; 49 | int iHandle; 50 | }; 51 | #else 52 | #endif 53 | bool locked:1; 54 | bool invalid:1; 55 | }; 56 | 57 | #endif // BFLIBRARY_BFSEMPHR_H_ 58 | /******************************************************************************/ 59 | -------------------------------------------------------------------------------- /bflibrary/include/bfstrut.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfstrut.h 6 | * Header file for sstrut.c. 7 | * @par Purpose: 8 | * String utility routines wrapper. 9 | * @par Comment: 10 | * Wraps standard c string routines with additional checks. Implements 11 | * a few new ones as well. 12 | * @author Tomasz Lis 13 | * @date 12 Nov 2008 - 25 Apr 2022 14 | * @par Copying and copyrights: 15 | * This program is free software; you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation; either version 2 of the License, or 18 | * (at your option) any later version. 19 | */ 20 | /******************************************************************************/ 21 | #ifndef BFLIBRARY_BFSTRUT_H_ 22 | #define BFLIBRARY_BFSTRUT_H_ 23 | 24 | #include "bftypes.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | extern char lbEmptyString[]; 31 | 32 | 33 | void * LbStringCopy(char *dst, const char *src, const ulong dst_buflen); 34 | 35 | /** Appends characters of source to destination, plus a terminating null-character. 36 | * Prevents string in dst of getting bigger than dst_buflen characters. 37 | */ 38 | void * LbStringConcat(char *dst, const char *src, const ulong dst_buflen); 39 | 40 | ulong LbStringLength(const char *str); 41 | 42 | void * LbStringToLower(char *str); 43 | void * LbStringToLowerCopy(char *dst, const char *src, const ulong dst_buflen); 44 | void * LbStringToUpper(char *str); 45 | 46 | #ifdef __cplusplus 47 | }; 48 | #endif 49 | 50 | #endif // BFLIBRARY_BFSTRUT_H_ 51 | /******************************************************************************/ 52 | -------------------------------------------------------------------------------- /bflibrary/include/bftringl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bftringl.h 6 | * Header file for gtringl.c. 7 | * @par Purpose: 8 | * Drawing triangles. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 27 May 2022 - 22 Sep 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFTRINGL_H_ 21 | #define BFLIBRARY_BFTRINGL_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Draw clipped triangle on graphics window at given 3 points, with colour. 30 | * 31 | * Graphics window needs to be set and locked. Coordinates are clipped if they 32 | * exceed the current graphics window. For the triangle to be visible, points 33 | * need to be provided in clockwise order, which means the inequality need to 34 | * be met: `(y3 - y2) * (x2 - x1) > (y2 - y1) * (x3 - x2)`. 35 | * This function honors DrawFlags. 36 | */ 37 | void LbDrawTriangle(short x1, short y1, short x2, short y2, short x3, short y3, 38 | TbPixel colour); 39 | 40 | #ifdef __cplusplus 41 | }; 42 | #endif 43 | 44 | #endif // BFLIBRARY_BFTRINGL_H_ 45 | /******************************************************************************/ 46 | -------------------------------------------------------------------------------- /bflibrary/include/bfutility.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfutility.h 6 | * Header file for gutility.cpp. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_BFUTILITY_H_ 21 | #define BFLIBRARY_BFUTILITY_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #ifndef __cplusplus 30 | #ifndef max 31 | #define max(a,b) ((a)>(b)?(a):(b)) 32 | #endif 33 | #ifndef min 34 | #define min(a,b) ((a)<(b)?(a):(b)) 35 | #endif 36 | #endif 37 | 38 | /** 39 | * Seed for LbRandomAnyShort() function; originally named just `seed`. 40 | */ 41 | extern ulong lbSeed; 42 | 43 | /** 44 | * Seed for LbRandomPosShort() function; originally named `seed_ps`. 45 | */ 46 | extern ulong lbSeed_ps; 47 | 48 | /** 49 | * Generates a random number, by using just a simple multiplication 50 | * and simple addition on the seed. Very simplistic, but fast. 51 | * Uses well though constants: 3141592621 (pi) for multiplier, 52 | * 0xD15C (disc) for addition. 53 | */ 54 | ushort LbRandomAnyShort(void); 55 | 56 | short LbRandomPosShort(void); 57 | 58 | #ifdef __cplusplus 59 | }; 60 | #endif 61 | 62 | #endif // BFLIBRARY_BFUTILITY_H_ 63 | /******************************************************************************/ 64 | -------------------------------------------------------------------------------- /bflibrary/include/rom.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file rom.h 6 | * Header file for rom.asm. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_ROM_H_ 21 | #define BFLIBRARY_ROM_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Width of tab character in pixels while drawing simple 5x6 font. 30 | */ 31 | extern long tabwidth; 32 | 33 | /** Draw text on screen using simple built-in 5x6 font. 34 | */ 35 | void prop_text(const char *text, TbPixel *out, long scanline, TbPixel colour); 36 | 37 | /** Generate table for fading to and from given colour. 38 | */ 39 | void make_fade_table(const ubyte *pal, ubyte *out, ubyte cr, ubyte cg, ubyte cb, 40 | ubyte ir, ubyte ig, ubyte ib); 41 | 42 | #ifdef __cplusplus 43 | }; 44 | #endif 45 | 46 | #endif // BFLIBRARY_ROM_H_ 47 | /******************************************************************************/ 48 | -------------------------------------------------------------------------------- /bflibrary/include/svesa.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file svesa.hpp 6 | * Header file for svesa.cpp. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFLIBRARY_SVESA_H_ 21 | #define BFLIBRARY_SVESA_H_ 22 | 23 | #include "bftypes.h" 24 | #include "bfscreen.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #define LB_VESA_DATA_SIZE 0x100 31 | 32 | extern ubyte *lbVesaData; 33 | 34 | TbResult LbVesaGetGran(long mode); 35 | TbResult LbVesaSetMode(long mode); 36 | TbResult LbVesaSetPage(ushort pageNo); 37 | TbResult LbVesaGetInfo(void); 38 | 39 | /** Checks if a VESA mode with given flags is available. 40 | */ 41 | TbBool LbVesaIsModeAvailable(long mode); 42 | 43 | #ifdef __cplusplus 44 | }; 45 | #endif 46 | 47 | #endif // BFLIBRARY_SVESA_H_ 48 | /******************************************************************************/ 49 | -------------------------------------------------------------------------------- /bflibrary/src/general/gexe_key.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file gexe_key.c 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfexe_key.h" 21 | 22 | const unsigned char exe_key[] = { 23 | 0x89, 0x0C, 0x0D5, 0x11, 24 | 0x00, 0x00, 0x00, 0x00, 25 | 0xE9, 0x2A, 0x80, 0x0C5, 26 | }; 27 | 28 | unsigned long LbExeReferenceNumber(void) 29 | { 30 | return *(unsigned long *)&exe_key[4]; 31 | } 32 | 33 | 34 | /******************************************************************************/ 35 | -------------------------------------------------------------------------------- /bflibrary/src/general/gmemut.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file gmemut.c 6 | * Memory related utility functions. 7 | * @par Purpose: 8 | * Provides custom wrappers to memory routines, helpful for debug. 9 | * @par Comment: 10 | * Wrappers to standard C memory handling. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfmemut.h" 21 | #include 22 | 23 | void * LbMemoryCopy(void *in_dst, const void *in_src, TbMemSize size) 24 | { 25 | return memcpy(in_dst, in_src, size); 26 | } 27 | 28 | void * LbMemoryMove(void *in_dst, const void *in_src, TbMemSize size) 29 | { 30 | return memmove(in_dst, in_src, size); 31 | } 32 | 33 | void * LbMemorySet(void *dst, unsigned char c, TbMemSize size) 34 | { 35 | return memset(dst, c, size); 36 | } 37 | 38 | int LbMemoryCompare(void *ptr1, void *ptr2, TbMemSize size) 39 | { 40 | return memcmp(ptr1, ptr2, size); 41 | } 42 | /******************************************************************************/ 43 | -------------------------------------------------------------------------------- /bflibrary/src/general/gplanar.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file gplanar.c 6 | * Basic planar integer geometry. 7 | * @par Purpose: 8 | * Simple geometry transformations unification. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 24 Jan 2009 - 08 Mar 2009 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfplanar.h" 21 | 22 | /******************************************************************************/ 23 | 24 | void LbSetRect(struct TbRect *rect, long xLeft, long yTop, long xRight, long yBottom) 25 | { 26 | if (rect == NULL) 27 | return; 28 | rect->left = xLeft; 29 | rect->top = yTop; 30 | rect->right = xRight; 31 | rect->bottom = yBottom; 32 | } 33 | 34 | /******************************************************************************/ 35 | -------------------------------------------------------------------------------- /bflibrary/src/general/gutility.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file gutility.c 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfutility.h" 21 | 22 | ulong lbSeed = 0xD15C1234; 23 | ulong lbSeed_ps = 0xD15C1234; 24 | 25 | ushort LbRandomAnyShort(void) 26 | { 27 | lbSeed = 3141592621 * lbSeed + 0xD15C; 28 | return (lbSeed >> 8); 29 | } 30 | 31 | short LbRandomPosShort(void) 32 | { 33 | lbSeed_ps *= 3141592621; 34 | return (lbSeed_ps >> 8) & 0x7FFF; 35 | } 36 | 37 | /******************************************************************************/ 38 | -------------------------------------------------------------------------------- /bflibrary/src/general/pixel.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file pixel.asm 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include 21 | #include "bfpixel.h" 22 | #include "bfscreen.h" 23 | 24 | TbResult LbDrawPixelClip(long x, long y, TbPixel colour) 25 | { 26 | ubyte *ptr; 27 | 28 | if ((x < 0) || (x >= lbDisplay.GraphicsWindowWidth)) 29 | return Lb_FAIL; 30 | if ((y < 0) || (y >= lbDisplay.GraphicsWindowHeight)) 31 | return Lb_FAIL; 32 | 33 | ptr = &lbDisplay.GraphicsWindowPtr[lbDisplay.GraphicsScreenWidth * y + x]; 34 | if (lbDisplay.DrawFlags & Lb_SPRITE_TRANSPAR4) 35 | { 36 | *ptr = lbDisplay.GlassMap[(colour << 8) + *ptr]; 37 | } 38 | else if (lbDisplay.DrawFlags & Lb_SPRITE_TRANSPAR8) 39 | { 40 | *ptr = lbDisplay.GlassMap[(*ptr << 8) + colour]; 41 | } 42 | else 43 | { 44 | *ptr = colour; 45 | } 46 | return Lb_SUCCESS; 47 | } 48 | 49 | TbResult LbDrawPixel(long x, long y, TbPixel colour) 50 | { 51 | ubyte *ptr; 52 | ptr = &lbDisplay.GraphicsWindowPtr[x + lbDisplay.GraphicsScreenWidth * y]; 53 | *ptr = colour; 54 | return Lb_SUCCESS; 55 | } 56 | 57 | 58 | /******************************************************************************/ 59 | -------------------------------------------------------------------------------- /bflibrary/src/general/sqroot.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file sqroot.asm 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfmath.h" 21 | 22 | unsigned short const lbSqrTable[] = { 23 | 1, 2, 2, 4, 5, 8, 11, 16, 24 | 22, 32, 45, 64, 90, 128, 181, 256, 25 | 362, 512, 724, 1024, 1448, 2048, 2896, 4096, 26 | 5792, 8192,11585,16384,23170,32768, 46340, 65535, 27 | }; 28 | 29 | /** Returns position of most significant set bit in the non-zero value x. 30 | * TODO: For GCC, can be implemented as (untested!): *y = 31 - __builtin_clz(x). 31 | */ 32 | static inline void _BitScanReverse(ulong *y, ulong x) 33 | { 34 | asm ("bsrl %1, %%eax;\n" 35 | "movl %%eax, (%0);\n" 36 | : // output (none as we derefenence input pointer) 37 | :"r" (y), "r" (x) // input 38 | :"%eax", "memory" // clobbered 39 | ); 40 | } 41 | 42 | long LbSqrL(ulong x) 43 | { 44 | ulong y; 45 | 46 | if (x <= 0) 47 | return 0; 48 | 49 | _BitScanReverse(&y, x); 50 | 51 | y = lbSqrTable[y]; 52 | while ((x/y) < y) 53 | y = ((x/y) + y) >> 1; 54 | return y; 55 | } 56 | 57 | 58 | /******************************************************************************/ 59 | -------------------------------------------------------------------------------- /bflibrary/src/x86-dos-watcom/smouse.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file smouse.cpp 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfmouse.h" 21 | 22 | #include "bfscreen.h" 23 | 24 | volatile TbBool lbMouseInstalled = false; 25 | 26 | int LbMousePlace() 27 | { 28 | // code at 0001:000a6810 29 | } 30 | 31 | int LbMouseRemove() 32 | { 33 | // code at 0001:000a6968 34 | } 35 | 36 | int LbMouseChangeSpriteOffset(long hsX, long hsY) 37 | { 38 | // code at 0001:000a6a44 39 | } 40 | 41 | int LbMouseChangeSprite(struct TbSprite *spr) 42 | { 43 | // code at 0001:000a6a7c 44 | } 45 | 46 | int LbMouseChangeMoveRatio() 47 | { 48 | // code at 0001:000a6c04 49 | } 50 | 51 | int LbMouseSetup() 52 | { 53 | // code at 0001:000a6c7c 54 | } 55 | 56 | int LbMouseReset() 57 | { 58 | // code at 0001:000a6e24 59 | } 60 | 61 | int LbMouseSuspend() 62 | { 63 | // code at 0001:000a6ea8 64 | } 65 | 66 | int LbMouseSetWindow() 67 | { 68 | // code at 0001:000a6f0c 69 | } 70 | 71 | int LbMouseSetPosition() 72 | { 73 | // code at 0001:000a6f78 74 | } 75 | 76 | /******************************************************************************/ 77 | -------------------------------------------------------------------------------- /bflibrary/src/x86-dos-watcom/spalette.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file spalette.cpp 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfpalette.h" 21 | 22 | int LbPaletteGet() 23 | { 24 | // code at 0001:000989f0 25 | } 26 | 27 | int LbPaletteSet() 28 | { 29 | // code at 0001:00098a54 30 | } 31 | 32 | 33 | /******************************************************************************/ 34 | -------------------------------------------------------------------------------- /bflibrary/src/x86-dos-watcom/stime.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file stime.cpp 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bftime.h" 21 | #include 22 | 23 | int LbDate() 24 | { 25 | // code at 0001:000b0f50 26 | } 27 | 28 | int LbTime() 29 | { 30 | // code at 0001:000b0f90 31 | } 32 | 33 | /** 34 | * Returns the number of milliseconds elapsed since the program was launched. 35 | */ 36 | TbClockMSec LbTimerClock(void) 37 | { 38 | // code at 0001:000b0fd0 39 | #if CLOCKS_PER_SEC >= 10000 40 | return clock() / (CLOCKS_PER_SEC / 1000); 41 | #elif CLOCKS_PER_SEC > 1000 42 | return ((TbClockMSec)clock() << 3) / (CLOCKS_PER_SEC / 125); 43 | #elif CLOCKS_PER_SEC == 1000 44 | return clock(); 45 | #elif CLOCKS_PER_SEC >= 500 46 | return ((TbClockMSec)clock() * (8000 / CLOCKS_PER_SEC)) >> 3; 47 | #else 48 | return (TbClockMSec)clock() * (1000 / CLOCKS_PER_SEC); 49 | #endif 50 | } 51 | 52 | /******************************************************************************/ 53 | -------------------------------------------------------------------------------- /bflibrary/src/x86-dos-watcom/swindows.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file swindows.cpp 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "bfwindows.h" 21 | 22 | int LbWindowsControl() 23 | { 24 | // code at 0001:000b1350 25 | } 26 | 27 | 28 | /******************************************************************************/ 29 | -------------------------------------------------------------------------------- /bflibrary/src/x86-win-sdl/svesa.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file svesa.cpp 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "svesa.h" 21 | 22 | ubyte *lbVesaData; 23 | 24 | TbResult LbVesaGetGran(long mode) 25 | { 26 | return Lb_FAIL; 27 | } 28 | 29 | TbResult LbVesaSetMode(long mode) 30 | { 31 | return Lb_FAIL; 32 | } 33 | 34 | TbResult LbVesaSetPage(ushort pageNo) 35 | { 36 | return Lb_FAIL; 37 | } 38 | 39 | TbResult LbVesaGetInfo(void) 40 | { 41 | return Lb_FAIL; 42 | } 43 | 44 | TbBool LbVesaIsModeAvailable(long mode) 45 | { 46 | /* low level access to VESA modes not available with SDL */ 47 | return false; 48 | } 49 | 50 | /******************************************************************************/ 51 | -------------------------------------------------------------------------------- /bflibrary/src/x86-win-sdl2/svesa.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file svesa.cpp 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "svesa.h" 21 | 22 | ubyte *lbVesaData; 23 | 24 | TbResult LbVesaGetGran(long mode) 25 | { 26 | return Lb_FAIL; 27 | } 28 | 29 | TbResult LbVesaSetMode(long mode) 30 | { 31 | return Lb_FAIL; 32 | } 33 | 34 | TbResult LbVesaSetPage(ushort pageNo) 35 | { 36 | return Lb_FAIL; 37 | } 38 | 39 | TbResult LbVesaGetInfo(void) 40 | { 41 | return Lb_FAIL; 42 | } 43 | 44 | TbBool LbVesaIsModeAvailable(long mode) 45 | { 46 | /* low level access to VESA modes not available with SDL */ 47 | return false; 48 | } 49 | 50 | /******************************************************************************/ 51 | -------------------------------------------------------------------------------- /bflibrary/tests/bflib_test_memory.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bflib_test_memory.c 6 | * Test application for allocating and freeing memory. 7 | * @par Purpose: 8 | * Testing implementation of bflibrary routines. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 25 May 2022 - 29 Jun 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include 21 | #include "bfmemory.h" 22 | #include "mock_bfwindows.h" 23 | #include "bftstlog.h" 24 | 25 | /******************************************************************************/ 26 | 27 | /** Test memory module setup and allocation. 28 | */ 29 | TbBool test_memory(void) 30 | { 31 | void *p; 32 | 33 | if (MockBaseInitialise() != Lb_SUCCESS) { 34 | LOGERR("bullfrog library initialization failed"); 35 | return false; 36 | } 37 | LbMemorySetup(); 38 | 39 | p = LbMemoryAlloc(2048); 40 | LbMemoryFree(p); 41 | 42 | LbMemoryReset(); 43 | LOGSYNC("passed"); 44 | return true; 45 | } 46 | 47 | int main(int argc, char *argv[]) 48 | { 49 | if (!test_memory()) 50 | exit(52); 51 | exit(0); 52 | } 53 | 54 | /******************************************************************************/ 55 | -------------------------------------------------------------------------------- /bflibrary/tests/bftstlog.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file tstlog.h 6 | * Application debug logging macros. 7 | * @par Purpose: 8 | * Macros to simplify logging within the application. 9 | * @par Comment: 10 | * Any libraries should have its own collection of macros. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 25 May 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFTSTLOG_H_ 21 | #define BFTSTLOG_H_ 22 | 23 | #include "bflog.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Macro for logging messages of error severity within this module. */ 30 | #define LOGERR(format,args...) LbErrorLog("BfTest: %s: " format "\n", __func__ , ## args) 31 | 32 | /** Macro for logging messages of warning severity within this module. */ 33 | #define LOGWARN(format,args...) LbWarnLog("BfTest: %s: " format "\n", __func__ , ## args) 34 | 35 | #ifdef DEBUG 36 | #define LOGSYNC(format,args...) LbSyncLog("BfTest: %s: " format "\n", __func__ , ## args) 37 | #define LOGDBG(format,args...) LbDbgLog("BfTest: %s: " format "\n", __func__ , ## args) 38 | #else 39 | #define LOGSYNC(format,args...) 40 | #define LOGDBG(format,args...) 41 | #endif 42 | 43 | /** Macro for messages which are only for developers and disabled in normal builds. */ 44 | #define LOGNO(format,args...) 45 | 46 | #ifdef __cplusplus 47 | }; 48 | #endif 49 | 50 | #endif // BFTSTLOG_H_ 51 | /******************************************************************************/ 52 | -------------------------------------------------------------------------------- /bflibrary/tests/helpers_frame.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file helpers_frame.h 6 | * Header file for all test frames. 7 | * @par Purpose: 8 | * Single frames from games, as helper functions for tests. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef HELPERS_FRAME_H_ 21 | #define HELPERS_FRAME_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef void (*TestFrameFunc)(void); 30 | 31 | void test_frame_swars01(void); 32 | 33 | #ifdef __cplusplus 34 | }; 35 | #endif 36 | 37 | #endif // HELPERS_FRAME_H_ 38 | /******************************************************************************/ 39 | -------------------------------------------------------------------------------- /bflibrary/tests/helpers_screen.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file helpers_screen.h 6 | * Header file for helpers_screen.c. 7 | * @par Purpose: 8 | * Implementation of screen-related helper functions for tests. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef HELPERS_SCREEN_H_ 21 | #define HELPERS_SCREEN_H_ 22 | 23 | #include "bftypes.h" 24 | #include "bfscreen.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | void generate_example_texture_map_xor_based(const ubyte *pal, ubyte *texmap); 31 | void raw_to_wscreen(short X, short Y, ushort Width, ushort Height, ubyte *Raw); 32 | 33 | #ifdef __cplusplus 34 | }; 35 | #endif 36 | 37 | #endif // HELPERS_SCREEN_H_ 38 | /******************************************************************************/ 39 | -------------------------------------------------------------------------------- /bflibrary/tests/helpers_sprite.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file helpers_sprite.h 6 | * Header file for helpers_sprite.c. 7 | * @par Purpose: 8 | * Implementation of sample sprite data creation for tests. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 25 Nov 2024 - 21 Mar 2025 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef HELPERS_SPRITE_H_ 21 | #define HELPERS_SPRITE_H_ 22 | 23 | #include "bftypes.h" 24 | #include "bfsprite.h" 25 | #include "bfscreen.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | void get_example_sprites_file_name(int sprfile_no, char *fname); 32 | TbScreenMode get_example_sprites_screen_mode(int sprfile_no); 33 | int get_example_sprites_total_count(int sprfile_no); 34 | void palette_remap_to_screen(TbPixel *p_remap, const TbPixel *p_altpal); 35 | 36 | int generate_example_sprites_from_screen(int sprfile_no, const ubyte *pal, 37 | ubyte *p_dat, TbSprite *p_tab); 38 | 39 | #ifdef __cplusplus 40 | }; 41 | #endif 42 | 43 | #endif // HELPERS_SPRITE_H_ 44 | /******************************************************************************/ 45 | -------------------------------------------------------------------------------- /bflibrary/tests/mock_bfmouse.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file mock_bfmouse.h 6 | * Header file for mock_mouse.c. 7 | * @par Purpose: 8 | * Implementation which only pretends to do stuff, for test purposes. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef MOCK_BFMOUSE_H_ 21 | #define MOCK_BFMOUSE_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | struct TbSprite; 30 | struct TbPoint; 31 | 32 | TbBool MockMouseIsInstalled(void); 33 | TbResult MockMouseChangeSprite(const struct TbSprite *pointer_spr); 34 | TbResult MockMouseChangeSpriteOffset(long hot_x, long hot_y); 35 | TbResult MockMouseGetSpriteOffset(long *hot_x, long *hot_y); 36 | 37 | #ifdef __cplusplus 38 | }; 39 | #endif 40 | 41 | #endif // MOCK_BFMOUSE_H_ 42 | /******************************************************************************/ 43 | -------------------------------------------------------------------------------- /bflibrary/tests/mock_bfpalette.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file mock_bfpalette.h 6 | * Header file for mock_palette.c. 7 | * @par Purpose: 8 | * Implementation which only pretends to do stuff, for test purposes. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef MOCK_BFPALETTE_H_ 21 | #define MOCK_BFPALETTE_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | TbResult MockPaletteSet(const ubyte *palette); 30 | 31 | /** Make simple and fairly universal palette. 32 | */ 33 | void make_general_palette(ubyte *pal); 34 | 35 | #ifdef __cplusplus 36 | }; 37 | #endif 38 | 39 | #endif // MOCK_BFPALETTE_H_ 40 | /******************************************************************************/ 41 | -------------------------------------------------------------------------------- /bflibrary/tests/mock_bfscreen.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file mock_bfscreen.h 6 | * Header file for mock_screen.c. 7 | * @par Purpose: 8 | * Implementation which only pretends to do stuff, for test purposes. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef MOCK_BFSCREEN_H_ 21 | #define MOCK_BFSCREEN_H_ 22 | 23 | #include "bftypes.h" 24 | #include "bfscreen.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | TbResult MockScreenFindVideoModes(void); 31 | TbBool MockScreenIsModeAvailable(TbScreenMode mode); 32 | TbResult MockScreenSetupAnyMode(TbScreenMode mode, TbScreenCoord width, 33 | TbScreenCoord height, ubyte *palette); 34 | TbResult MockScreenReset(void); 35 | TbBool MockScreenIsLocked(void); 36 | TbResult MockScreenLock(void); 37 | TbResult MockScreenUnlock(void); 38 | 39 | #ifdef __cplusplus 40 | }; 41 | #endif 42 | 43 | #endif // MOCK_BFSCREEN_H_ 44 | /******************************************************************************/ 45 | -------------------------------------------------------------------------------- /bflibrary/tests/mock_bfwindows.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file mock_bfwindows.h 6 | * Header file for mock_windows.c. 7 | * @par Purpose: 8 | * Implementation which only pretends to do stuff, for test purposes. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef MOCK_BFWINDOWS_H_ 21 | #define MOCK_BFWINDOWS_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** Initialize for tests which do not use real video or input. 30 | */ 31 | TbResult MockBaseInitialise(void); 32 | 33 | #ifdef __cplusplus 34 | }; 35 | #endif 36 | 37 | #endif // MOCK_BFWINDOWS_H_ 38 | /******************************************************************************/ 39 | -------------------------------------------------------------------------------- /bflibrary/tests/mock_windows.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file mock_windows.c 6 | * Implementation which only pretends to do stuff, for test purposes. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 05 Nov 2021 - 29 Jul 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "mock_bfwindows.h" 21 | #include "mock_bfpalette.h" 22 | #include "bfwindows.h" 23 | #include "bfutility.h" 24 | #include "bfmouse.h" 25 | #include "bfscreen.h" 26 | #include "bftstlog.h" 27 | 28 | void LbRegisterStandardVideoModes(void); 29 | 30 | TbResult MockBaseInitialise(void) 31 | { 32 | // Clear global variables 33 | lbScreenInitialised = false; 34 | lbAppActive = true; 35 | LbMouseChangeMoveRatio(256, 256); 36 | // Register default video modes 37 | if (lbScreenModeInfoNum == 0) { 38 | LbRegisterStandardVideoModes(); 39 | } 40 | lbLibInitialised = true; 41 | return Lb_SUCCESS; 42 | } 43 | 44 | /******************************************************************************/ 45 | -------------------------------------------------------------------------------- /bflibrary/tests/referenc/spr_devpac-mans16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/spr_devpac-mans16.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly1_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly1_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly2_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly2_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly3_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly3_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly4_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly4_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly5_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly5_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly6_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly6_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly7_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly7_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly8_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly8_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_gpoly_frame01_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_gpoly_frame01_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline1_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline1_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline2_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline2_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline3_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline3_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline4_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline4_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline5_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline5_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline6_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline6_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline7_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline7_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_pline8_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_pline8_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig1_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig1_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig2_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig2_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig3_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig3_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig4_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig4_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig5_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig5_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig6_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig6_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig7_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig7_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_trig8_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_trig8_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl1_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl1_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl2_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl2_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl3_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl3_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl4_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl4_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl5_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl5_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl6_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl6_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl7_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl7_rf.png -------------------------------------------------------------------------------- /bflibrary/tests/referenc/tst_tringl8_rf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/bflibrary/tests/referenc/tst_tringl8_rf.png -------------------------------------------------------------------------------- /bfsmacklib/include/smack2ail.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Smacker Playback Library - for use to remake classic games 3 | // like Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file smack2ail.h 6 | * Header file for smack2ail.c. 7 | * @par Purpose: 8 | * External interface of the smacker playback library. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2011 - 13 Jun 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSMACKLIB_SMACK2AIL_H_ 21 | #define BFSMACKLIB_SMACK2AIL_H_ 22 | 23 | #include 24 | #include "smack.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /******************************************************************************/ 31 | 32 | 33 | /******************************************************************************/ 34 | 35 | /** Link Smacker audio output to AIL library interface. 36 | * 37 | * @param speed Frequency of the timer sending buffers to AIL output. 38 | * @param digdrv Digital Audio Driver instance from the AIL library. 39 | */ 40 | uint8_t RADAPI SMACKSOUNDUSEMSS(uint32_t speed, void *digdrv); 41 | 42 | /******************************************************************************/ 43 | 44 | #ifdef __cplusplus 45 | }; 46 | #endif 47 | 48 | #endif // BFSMACKLIB_SMACK2AIL_H_ 49 | /******************************************************************************/ 50 | -------------------------------------------------------------------------------- /bfsoundlib/include/bfdanger.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bfdanger.h 6 | * Header file for ???. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 22 Jun 2024 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_BFDANGER_H_ 21 | #define BFSOUNDLIB_BFDANGER_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | #pragma pack(1) 30 | 31 | 32 | #pragma pack() 33 | /******************************************************************************/ 34 | 35 | void DangerMusicFadeSwitch(ubyte direction, ubyte freq); 36 | 37 | /******************************************************************************/ 38 | #ifdef __cplusplus 39 | }; 40 | #endif 41 | 42 | #endif // BFSOUNDLIB_BFDANGER_H_ 43 | -------------------------------------------------------------------------------- /bfsoundlib/include/dllload.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file dllload.h 6 | * Header file for dllload.c. 7 | * @par Purpose: 8 | * File load functions from MSS API. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef AIL2OAL_DLLLOAD_H_ 21 | #define AIL2OAL_DLLLOAD_H_ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | /** Return size of file, or -1 if error. 30 | */ 31 | int32_t FILE_size(char const *fname); 32 | 33 | /** Read file into memory at *dest, allocating memory first if dest=NULL. 34 | */ 35 | void *FILE_read(const char *fname, void *dest); 36 | /******************************************************************************/ 37 | #ifdef __cplusplus 38 | }; 39 | #endif 40 | 41 | #endif // AIL2OAL_DLLLOAD_H_ 42 | -------------------------------------------------------------------------------- /bfsoundlib/include/dpmi.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file dpmi.h 6 | * Header file for dpmi.c. 7 | * @par Purpose: 8 | * OpenAL based reimplementation of MSS API. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef AIL2OAL_DPMI_H_ 21 | #define AIL2OAL_DPMI_H_ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | 30 | /** 31 | * Allocates memory block in the first megabyte of RAM. 32 | * 33 | * @param sel Returns DPMI selector of the new block (originally returned in DX reg). 34 | * @param size Memory block size in bytes. 35 | * @return protected mode pointer to the allocated block, NULL if failed. 36 | */ 37 | void *AllocDOSmem(uint16_t *sel, long size); 38 | 39 | /** Frees a memory block allocated by AllocDOSmem(). 40 | * 41 | * @param block Protected mode pointer to memory block. 42 | * @param sel DPMI selector of the block. 43 | * @return OK (0) or ERROR (-1) 44 | */ 45 | int FreeDOSmem(void *block, uint16_t sel); 46 | 47 | /******************************************************************************/ 48 | #ifdef __cplusplus 49 | }; 50 | #endif 51 | 52 | #endif // AIL2OAL_DPMI_H_ 53 | -------------------------------------------------------------------------------- /bfsoundlib/include/msssys.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file msssys.h 6 | * Header file for msssys.c. 7 | * @par Purpose: 8 | * OpenAL based reimplementation of MSS API. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef AIL2OAL_MSSSYS_H_ 21 | #define AIL2OAL_MSSSYS_H_ 22 | 23 | #include 24 | #include "mssal.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | /******************************************************************************/ 30 | 31 | typedef void *(*AILMEMALLOCCB)(uint32_t size); 32 | typedef void (*AILMEMFREECB)(void *); 33 | 34 | /******************************************************************************/ 35 | extern AILMEMALLOCCB MEM_alloc; 36 | extern AILMEMFREECB MEM_free; 37 | 38 | void *AIL_MEM_use_malloc(AILMEMALLOCCB fn); 39 | void *AIL_MEM_use_free(AILMEMFREECB fn); 40 | /******************************************************************************/ 41 | #ifdef __cplusplus 42 | }; 43 | #endif 44 | 45 | #endif // AIL2OAL_MSSSYS_H_ 46 | -------------------------------------------------------------------------------- /bfsoundlib/include/sb16.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file sb16.h 6 | * Header file for sb16.c. 7 | * @par Purpose: 8 | * SoundBlaster 16 specific routines. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_SB16_H_ 21 | #define BFSOUNDLIB_SB16_H_ 22 | 23 | #include 24 | #include "bftypes.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | /******************************************************************************/ 30 | 31 | extern ushort current_SB16_left_master_volume; 32 | extern ushort current_SB16_right_master_volume; 33 | extern ubyte sb16_mixer_set; 34 | 35 | void prepare_SB16_volumes(void); 36 | void reset_SB16_volumes(void); 37 | 38 | /******************************************************************************/ 39 | #ifdef __cplusplus 40 | }; 41 | #endif 42 | 43 | #endif // BFSOUNDLIB_SB16_H_ 44 | -------------------------------------------------------------------------------- /bfsoundlib/include/snderr.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file snderr.h 6 | * Header file for snderr.c. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_SNDERROR_H_ 21 | #define BFSOUNDLIB_SNDERROR_H_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | /******************************************************************************/ 27 | 28 | extern char SoundProgressMessage[256]; 29 | 30 | void InitDebugAudio(void); 31 | void SoundProgressLog(const char *msg); 32 | 33 | /******************************************************************************/ 34 | #ifdef __cplusplus 35 | }; 36 | #endif 37 | 38 | #endif // BFSOUNDLIB_SNDERROR_H_ 39 | -------------------------------------------------------------------------------- /bfsoundlib/include/sndtimer.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file sndtimer.h 6 | * Header file for sndtimer.c. 7 | * @par Purpose: 8 | * Bullfrog sound timers. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_SNDTIMER_H_ 21 | #define BFSOUNDLIB_SNDTIMER_H_ 22 | 23 | #include "bftypes.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | #pragma pack(1) 30 | 31 | struct sound_timer_inf { 32 | ulong handle; 33 | ubyte used; 34 | }; 35 | 36 | #pragma pack() 37 | /******************************************************************************/ 38 | 39 | void InitAllBullfrogSoundTimers(void); 40 | ushort SetupBullfrogSoundTimer(ushort freq, void (*cb)(void*)); 41 | void ReleaseBullfrogSoundTimer(ushort st); 42 | 43 | /******************************************************************************/ 44 | #ifdef __cplusplus 45 | }; 46 | #endif 47 | 48 | #endif // BFSOUNDLIB_SNDTIMER_H_ 49 | -------------------------------------------------------------------------------- /bfsoundlib/include/ssampfad.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file ssampfad.h 6 | * Header file for ssampfad.c. 7 | * @par Purpose: 8 | * Sound Sample Fade support routines. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_SSAMPFAD_H_ 21 | #define BFSOUNDLIB_SSAMPFAD_H_ 22 | 23 | #include 24 | #include "bftypes.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | /******************************************************************************/ 30 | 31 | void FadeSample(long source_id, short smp_id, ushort to_volume, 32 | ubyte step, ubyte stop); 33 | 34 | void StopAllSampleFadeTimers(void); 35 | 36 | /******************************************************************************/ 37 | #ifdef __cplusplus 38 | }; 39 | #endif 40 | 41 | #endif // BFSOUNDLIB_SSAMPFAD_H_ 42 | -------------------------------------------------------------------------------- /bfsoundlib/include/ssamplst.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file ssamplst.h 6 | * Header file for ssamplst.c. 7 | * @par Purpose: 8 | * Sound Sample List support routines. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_SSAMPLST_H_ 21 | #define BFSOUNDLIB_SSAMPLST_H_ 22 | 23 | #include 24 | #include "bftypes.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | /******************************************************************************/ 30 | #pragma pack(1) 31 | 32 | struct BfSoundBankHead { 33 | long TabPos; 34 | long DatPos; 35 | long TabSize; 36 | long DatSize; 37 | }; 38 | 39 | struct BfSfxInfo { // sizeof=32 40 | char FileName[12]; 41 | long sffld_12; 42 | short sffld_16; 43 | ubyte *DataBeg; 44 | long sffld_22; 45 | ubyte *DataEnd; 46 | short sffld_30; 47 | }; 48 | 49 | #pragma pack() 50 | /******************************************************************************/ 51 | 52 | void PlaySampleList(int sfx1, int sfx2, int sfx3, int sfx4, 53 | int sfx5, int sfx6, int sfx7, int sfx8); 54 | 55 | void StopSampleQueueList(void); 56 | 57 | /******************************************************************************/ 58 | #ifdef __cplusplus 59 | }; 60 | #endif 61 | 62 | #endif // BFSOUNDLIB_SSAMPLST_H_ 63 | -------------------------------------------------------------------------------- /bfsoundlib/include/streamfx.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file streamfx.h 6 | * Header file for streamfx.c. 7 | * @par Purpose: 8 | * Streamed digital sound playback implementation. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef BFSOUNDLIB_STREAMFX_H_ 21 | #define BFSOUNDLIB_STREAMFX_H_ 22 | 23 | #include 24 | #include "bftypes.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | /******************************************************************************/ 30 | 31 | //int StreamedSampleFinished(); 32 | void InitStreamedSound(void); 33 | void FreeStreamedSound(void); 34 | //int PlayStreamedSample(); 35 | //int MonitorStreamedSoundTrack(); 36 | //int SetStreamedSampleVolume(); 37 | //int StopStreamedSample(); 38 | void SwitchOffStreamedSound(void); 39 | //void SwitchOnStreamedSound(); 40 | //int GetStreamedSoundPosition(); 41 | //int SetStreamedSoundPosition(); 42 | //int SwapStreamedSoundTrack(); 43 | 44 | /******************************************************************************/ 45 | #ifdef __cplusplus 46 | }; 47 | #endif 48 | 49 | #endif // BFSOUNDLIB_STREAMFX_H_ 50 | -------------------------------------------------------------------------------- /bfsoundlib/m4/openal.m4: -------------------------------------------------------------------------------- 1 | # Configure headers/flags for OpenAL 2 | # Unavowed 3 | 4 | dnl AM_PATH_OPENAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 5 | dnl 6 | dnl AC_DEFINE OPENAL_AL_H/OPENAL_ALC_H to the equivalent of 7 | dnl / so you can do #include OPENAL_AL_H. Define 8 | dnl OPENAL_CFLAGS and OPENAL_LIBS. 9 | AC_DEFUN([AM_PATH_OPENAL], [ 10 | OPENAL_CFLAGS= 11 | OPENAL_LIBS= 12 | 13 | # First check for headers 14 | for header in "AL/al.h" "OpenAL/al.h"; do 15 | AC_CHECK_HEADER([$header], [ 16 | ac_cv_openal_al_h="$header" 17 | break 18 | ]) 19 | done 20 | AS_IF([test -n "$ac_cv_openal_al_h"], [ 21 | ac_cv_openal_alc_h=$(echo "$ac_cv_openal_al_h" | sed 's/al\.h$/alc.h/') 22 | AC_DEFINE_UNQUOTED([OPENAL_AL_H], [<$ac_cv_openal_al_h>], 23 | [Define to the equivalent of on your system]) 24 | AC_DEFINE_UNQUOTED([OPENAL_ALC_H], [<$ac_cv_openal_alc_h>], 25 | [Define to the equivalent of on your system]) 26 | ]) 27 | 28 | # Then check for libs 29 | ac_cv_openal_al_libs= 30 | AS_IF([test -n "$ac_cv_openal_al_h" && test -n "$ac_cv_openal_alc_h"], [ 31 | OLD_LIBS="$LIBS" 32 | for lib in "-framework OpenAL" "-lopenal" "-lopenal32"; do 33 | LIBS="$OLD_LIBS $lib" 34 | AC_MSG_CHECKING([for alGenSources in $lib]) 35 | AC_TRY_LINK([#include OPENAL_AL_H], [alGenSources (1, 0);], [ 36 | ac_cv_openal_al_libs="$lib" 37 | AC_MSG_RESULT([yes]) 38 | break 39 | ], [ 40 | AC_MSG_RESULT([no]) 41 | ]) 42 | done 43 | 44 | LIBS="$OLD_LIBS" 45 | OPENAL_LIBS="$ac_cv_openal_al_libs" 46 | ]) 47 | 48 | AC_SUBST([OPENAL_CFLAGS]) 49 | AC_SUBST([OPENAL_LIBS]) 50 | 51 | AS_IF([test -z "$OPENAL_CFLAGS" && test -z "$OPENAL_LIBS"], [$2], [$1]) 52 | ]) 53 | -------------------------------------------------------------------------------- /bfsoundlib/src/mseqnfad.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file ssamplst.c 6 | * Music Sequence List support routines. 7 | * @par Purpose: 8 | * Functions for handling a list/queue of music sequences. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "bfmusic.h" 26 | #include "aildebug.h" 27 | #include "mssal.h" 28 | /******************************************************************************/ 29 | 30 | extern TbBool MusicInstalled; 31 | extern TbBool MusicAble; 32 | extern TbBool MusicActive; 33 | 34 | extern ushort SongCurrentlyPlaying; 35 | extern SNDSEQUENCE *SongHandle; 36 | 37 | /******************************************************************************/ 38 | 39 | void SetMusicVolume(int msec, ubyte volume) 40 | { 41 | if (!MusicAble || !MusicInstalled) 42 | return; 43 | 44 | if (!MusicActive || !SongCurrentlyPlaying) 45 | return; 46 | 47 | if (volume > 127) 48 | return; 49 | 50 | if (AIL_sequence_status(SongHandle) == 2) 51 | return; 52 | 53 | AIL_set_sequence_volume(SongHandle, volume, msec); 54 | } 55 | 56 | /******************************************************************************/ 57 | -------------------------------------------------------------------------------- /bfsoundlib/src/msssys.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file msssys.c 6 | * OpenAL based reimplementation of MSS API. 7 | * @par Purpose: 8 | * SS functions from MSS API. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "msssys.h" 27 | /******************************************************************************/ 28 | AILMEMALLOCCB MEM_alloc; 29 | AILMEMFREECB MEM_free; 30 | 31 | /******************************************************************************/ 32 | 33 | void *AIL_MEM_use_malloc(AILMEMALLOCCB fn) 34 | { 35 | void *ret = MEM_alloc; 36 | MEM_alloc = fn; 37 | return ret; 38 | } 39 | 40 | void *AIL_MEM_use_free(AILMEMFREECB fn) 41 | { 42 | void *ret = MEM_free; 43 | MEM_free = fn; 44 | return ret; 45 | } 46 | 47 | /******************************************************************************/ 48 | -------------------------------------------------------------------------------- /bfsoundlib/src/snderr.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Sound Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file snderr.c 6 | * OpenAL based reimplementation of MSS API. 7 | * @par Purpose: 8 | * SS functions from MSS API. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Jun 2022 - 05 Sep 2022 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "snderr.h" 27 | 28 | #include "bftypes.h" 29 | #include "bflog.h" 30 | /******************************************************************************/ 31 | char SoundProgressMessage[256]; 32 | 33 | TbBool DebugAudio = false; 34 | 35 | /******************************************************************************/ 36 | 37 | void InitDebugAudio(void) 38 | { 39 | if (getenv("DEBUG_BF_AUDIO")) 40 | DebugAudio = 1; 41 | } 42 | 43 | void SoundProgressLog(const char *msg) 44 | { 45 | if (!DebugAudio) 46 | return; 47 | 48 | if (LbErrorLogReady()) { 49 | LbSyncLog("Bfsnd: %s", msg); 50 | } else { 51 | fputs(msg, stdout); 52 | } 53 | } 54 | 55 | 56 | /******************************************************************************/ 57 | -------------------------------------------------------------------------------- /conf/Makefile.am: -------------------------------------------------------------------------------- 1 | confdir = $(prefix)/$(PACKAGE)/conf 2 | conf_DATA = \ 3 | cities.ini \ 4 | cybmods.ini \ 5 | people.ini \ 6 | panel0-0.ini \ 7 | panel0-1.ini \ 8 | panel0-3.ini \ 9 | pop0-0.ini \ 10 | pop0-1.ini \ 11 | pop0-3.ini \ 12 | rules.ini \ 13 | weapons.ini \ 14 | miss000.ini \ 15 | miss001.ini \ 16 | miss002.ini \ 17 | miss003.ini \ 18 | miss099.ini \ 19 | midipats.cfg 20 | 21 | tone000dir = $(prefix)/$(PACKAGE)/conf/Tone_000 22 | tone000_DATA = \ 23 | Tone_000/000_Acoustic_Grand_Piano.pat \ 24 | Tone_000/004_Electric_Piano_1_Rhodes.pat 25 | 26 | EXTRA_DIST = \ 27 | conf \ 28 | tone000 \ 29 | fnmap_posix.conf \ 30 | fnmap_windows.conf \ 31 | wrappers_dos.conf \ 32 | wrappers_game.conf \ 33 | wrappers_libc.conf \ 34 | wrappers_util.conf 35 | -------------------------------------------------------------------------------- /conf/Tone_000/000_Acoustic_Grand_Piano.pat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/conf/Tone_000/000_Acoustic_Grand_Piano.pat -------------------------------------------------------------------------------- /conf/Tone_000/004_Electric_Piano_1_Rhodes.pat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/conf/Tone_000/004_Electric_Piano_1_Rhodes.pat -------------------------------------------------------------------------------- /conf/fnmap_posix.conf: -------------------------------------------------------------------------------- 1 | stricmp strcasecmp 2 | strnicmp strncasecmp 3 | -------------------------------------------------------------------------------- /conf/fnmap_windows.conf: -------------------------------------------------------------------------------- 1 | # msvcrt exports some functions with additional underscore 2 | # this file tries to make up the msvcrt stupidity 3 | # srcname msvcrtname 4 | access _access 5 | chdir _chdir 6 | close _close 7 | getcwd _getcwd 8 | isatty _isatty 9 | lseek _lseek 10 | read _read 11 | rmdir _rmdir 12 | stat _stat 13 | strcasecmp _stricmp 14 | strncasecmp _strnicmp 15 | tzset _tzset 16 | unlink _unlink 17 | write _write 18 | -------------------------------------------------------------------------------- /conf/midipats.cfg: -------------------------------------------------------------------------------- 1 | # Instrument PAT files for Syndicate Wars Port MIDI playback 2 | # Picked from FreePats project: 3 | # http://freepats.zenvoid.org/about.html 4 | 5 | bank 0 6 | 7 | 4 Tone_000/004_Electric_Piano_1_Rhodes.pat amp=120 8 | 8 Tone_000/000_Acoustic_Grand_Piano.pat amp=120 pan=center 9 | -------------------------------------------------------------------------------- /conf/rules.ini: -------------------------------------------------------------------------------- 1 | [engine] 2 | ; Minimum user zoom (when most area is visible) for the in-game camera. 3 | ; Valid values ranged 1..296, where 1 would reveal most area. 4 | ; Value must not be higher than ZoomMax. 5 | ZoomMin = 145 6 | ; Maxumum user zoom (largest magnification) for the in-game camera. 7 | ; Valid values ranged 1..296, where 296 allows the most closeup. 8 | ; Value must not be lower than ZoomMin. 9 | ZoomMax = 263 10 | 11 | [scanner] 12 | ; Factor of how much map area fits on the ingame scanner map. 13 | ; Valid values ranged 16..512, where 512 would make the whole map visible. 14 | ; In original game, this value was around 180 for high res mode. 15 | BaseZoomFactor = 180 16 | ; Factor of how the user-controlled zoom level (weapon zoom) increases area visible on scanner map. 17 | ; In original game, this value was around 64 for low res mode and around 256 for high res. 18 | UserZoomFactor = 192 19 | ; Whether the dots and circles representing things and objectives on the scanner should be sized 20 | ; to current resolution and zoom level. 21 | ScaleDotsCircles = True 22 | 23 | [interface] 24 | ShowTargetHealth = False 25 | 26 | [research] 27 | DailyScientistDeathChancePermil = 20 28 | ScientistsPerGroup = 4 29 | WeaponDonateResearchIncrPermil = 125 30 | DailyProgressRtcMinutes = 0 31 | 32 | [revenue] 33 | PersuadedPersonWeaponsSellCostPermil = 0 34 | -------------------------------------------------------------------------------- /conf/wrappers_dos.conf: -------------------------------------------------------------------------------- 1 | # Watcom-to-native wrappers generation input data 2 | # See `wrappers_libc.conf` for format explanation 3 | # name cnv typ args 4 | dos_access W i sx 5 | dos_clock W i 6 | dos_fopen W i ss 7 | dos_getvect W i i 8 | dos_int386 W i xpp 9 | dos_int386x W i xppp 10 | dos_low_level_close C i i 11 | dos_low_level_open C i sxx 12 | dos_low_level_read C i ipxip 13 | dos_low_level_seek C i ii 14 | dos_low_level_seek_relative C i ii 15 | dos_lseek W i iii 16 | dos_open C i sxv 17 | dos_setmode W i ix 18 | dos_setvect W i ip 19 | dos_sopen C i sxxv 20 | -------------------------------------------------------------------------------- /conf/wrappers_libc.conf: -------------------------------------------------------------------------------- 1 | # Watcom-to-native wrappers generation input data 2 | # 3 | # `name` can be just plain C symbol name, or a variable 4 | # which stores pointer to the function to be called (in 5 | # which case the name should be preceded with *). 6 | # 7 | # `cnv` is one of: 8 | # W - watcom: args passed in eax, edx, ebx, ecx 9 | # C - cdecl: args pushed on to stack, but regs preserved 10 | # V - vararg: like cdecl but used for functions with v[name] variant 11 | # 12 | # `typ` is a return type, taken from the `args` value pool or: 13 | # v - void (only for return type) 14 | # 15 | # `args` is a sequence of zero or more of: 16 | # i - int 17 | # x - int (displayed in hex) 18 | # p - void * (general pointer) 19 | # s - char * 20 | # c - char 21 | # v - ... (variadic args) 22 | # l - va_list 23 | # 24 | # name cnv typ args 25 | access W i sx 26 | asctime W i p 27 | atoi W i s 28 | calloc W i ii 29 | chdir W i s 30 | clock W i 31 | close W i i 32 | exit W i i 33 | fclose W i p 34 | fflush W i p 35 | fgetc W i p 36 | fgets W i pip 37 | fileno W i p 38 | fopen W i ss 39 | fprintf V i psv 40 | fputc W i cp 41 | fputs W i sp 42 | fread W i piip 43 | free W i p 44 | fseek W i pii 45 | ftell W i p 46 | getcwd W i pi 47 | getenv W i s 48 | gets W i p 49 | isatty W i i 50 | localtime W i p 51 | malloc W i i 52 | memcpy W i ppi 53 | memmove W i ppi 54 | memset W i pci 55 | mktime W i p 56 | printf V i sv 57 | puts W i s 58 | putchar W i i 59 | qsort W i piip 60 | rand W i 61 | read W i ipi 62 | realloc W i pi 63 | rename W i ss 64 | rmdir W i s 65 | setbuf W i pp 66 | sprintf V i psv 67 | srand W i x 68 | sscanf V i ssv 69 | stat W i sp 70 | strcat W i ss 71 | strchr W i sc 72 | strcmp W i ss 73 | strcpy W i ps 74 | stricmp W i ss 75 | strlen W i s 76 | strncmp W i ssi 77 | strncpy W i psi 78 | strnicmp W i ssi 79 | strpbrk W i ss 80 | strrchr W i sc 81 | strtol W i spi 82 | time W i p 83 | tolower W i c 84 | toupper W i c 85 | tzset W i 86 | unlink W i s 87 | vfprintf C i psl 88 | vsprintf C i psl 89 | write W i ipi 90 | -------------------------------------------------------------------------------- /conf/wrappers_util.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/conf/wrappers_util.conf -------------------------------------------------------------------------------- /doc/TODO: -------------------------------------------------------------------------------- 1 | The possible enhancenemts and bugs to fix are listed here: 2 | • github.com/mefistotelis/swars/issues 3 | 4 | Far future: 5 | • Re-write the game in C? 6 | -------------------------------------------------------------------------------- /lang/alltext_punks_fre.po: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | # ***************************************************************************** 4 | # @file alltext_punks_fre.po 5 | # Menu text for SW Port translation file 6 | # @par Purpose: 7 | # Contains translation of the national text in the game. 8 | # @par Comment: 9 | # Use this file to improve the translation for specific language. 10 | # @author Syndicate Wars Fans 11 | # @date 20 Aug 2023 - 02 Sep 2023 12 | # @par Copying and copyrights: 13 | # This program is free software; you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation; either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # ***************************************************************************** 19 | msgid "" 20 | msgstr "" 21 | "Project-Id-Version: Menu text for SW Port\n" 22 | "Report-Msgid-Bugs-To: https://github.com/swfans/swars/issues\n" 23 | "POT-Creation-Date: 2023-08-20 01:12+0200\n" 24 | "PO-Revision-Date: 2023-09-02 12:00+0100\n" 25 | "Last-Translator: Mefistotelis \n" 26 | "Language-Team: Syndicate Wars Fans \n" 27 | "Language: fr_FR\n" 28 | "MIME-Version: 1.0\n" 29 | "Content-Type: text/plain; charset=UTF-8\n" 30 | "Content-Transfer-Encoding: 8bit\n" 31 | "X-Poedit-SourceCharset: utf-8\n" 32 | -------------------------------------------------------------------------------- /lang/alltext_punks_ger.po: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | # ***************************************************************************** 4 | # @file alltext_punks_ger.po 5 | # Menu text for SW Port translation file 6 | # @par Purpose: 7 | # Contains translation of the national text in the game. 8 | # @par Comment: 9 | # Use this file to improve the translation for specific language. 10 | # @author Syndicate Wars Fans 11 | # @date 20 Aug 2023 - 02 Sep 2023 12 | # @par Copying and copyrights: 13 | # This program is free software; you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation; either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # ***************************************************************************** 19 | msgid "" 20 | msgstr "" 21 | "Project-Id-Version: Menu text for SW Port\n" 22 | "Report-Msgid-Bugs-To: https://github.com/swfans/swars/issues\n" 23 | "POT-Creation-Date: 2023-08-20 01:12+0200\n" 24 | "PO-Revision-Date: 2023-09-02 12:00+0100\n" 25 | "Last-Translator: Mefistotelis \n" 26 | "Language-Team: Syndicate Wars Fans \n" 27 | "Language: de_DE\n" 28 | "MIME-Version: 1.0\n" 29 | "Content-Type: text/plain; charset=UTF-8\n" 30 | "Content-Transfer-Encoding: 8bit\n" 31 | "X-Poedit-SourceCharset: utf-8\n" 32 | -------------------------------------------------------------------------------- /lang/alltext_punks_ita.po: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | # ***************************************************************************** 4 | # @file alltext_punks_ita.po 5 | # Menu text for SW Port translation file 6 | # @par Purpose: 7 | # Contains translation of the national text in the game. 8 | # @par Comment: 9 | # Use this file to improve the translation for specific language. 10 | # @author Syndicate Wars Fans 11 | # @date 20 Aug 2023 - 02 Sep 2023 12 | # @par Copying and copyrights: 13 | # This program is free software; you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation; either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # ***************************************************************************** 19 | msgid "" 20 | msgstr "" 21 | "Project-Id-Version: Menu text for SW Port\n" 22 | "Report-Msgid-Bugs-To: https://github.com/swfans/swars/issues\n" 23 | "POT-Creation-Date: 2023-08-20 01:12+0200\n" 24 | "PO-Revision-Date: 2023-09-02 12:00+0100\n" 25 | "Last-Translator: Mefistotelis \n" 26 | "Language-Team: Syndicate Wars Fans \n" 27 | "Language: it_IT\n" 28 | "MIME-Version: 1.0\n" 29 | "Content-Type: text/plain; charset=UTF-8\n" 30 | "Content-Transfer-Encoding: 8bit\n" 31 | "X-Poedit-SourceCharset: utf-8\n" 32 | -------------------------------------------------------------------------------- /lang/alltext_punks_jap.po: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | # ***************************************************************************** 4 | # @file alltext_punks_jap.po 5 | # Menu text for SW Port translation file 6 | # @par Purpose: 7 | # Contains translation of the national text in the game. 8 | # @par Comment: 9 | # Use this file to improve the translation for specific language. 10 | # @author Syndicate Wars Fans 11 | # @date 20 Aug 2023 - 02 Sep 2023 12 | # @par Copying and copyrights: 13 | # This program is free software; you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation; either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # ***************************************************************************** 19 | msgid "" 20 | msgstr "" 21 | "Project-Id-Version: Menu text for SW Port\n" 22 | "Report-Msgid-Bugs-To: https://github.com/swfans/swars/issues\n" 23 | "POT-Creation-Date: 2023-08-20 01:12+0200\n" 24 | "PO-Revision-Date: 2023-09-02 12:00+0100\n" 25 | "Last-Translator: Mefistotelis \n" 26 | "Language-Team: Syndicate Wars Fans \n" 27 | "Language: ja_JP\n" 28 | "MIME-Version: 1.0\n" 29 | "Content-Type: text/plain; charset=UTF-8\n" 30 | "Content-Transfer-Encoding: 8bit\n" 31 | "X-Poedit-SourceCharset: utf-8\n" 32 | -------------------------------------------------------------------------------- /lang/alltext_punks_spa.po: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | # ***************************************************************************** 4 | # @file alltext_punks_spa.po 5 | # Menu text for SW Port translation file 6 | # @par Purpose: 7 | # Contains translation of the national text in the game. 8 | # @par Comment: 9 | # Use this file to improve the translation for specific language. 10 | # @author Syndicate Wars Fans 11 | # @date 20 Aug 2023 - 02 Sep 2023 12 | # @par Copying and copyrights: 13 | # This program is free software; you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation; either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # ***************************************************************************** 19 | msgid "" 20 | msgstr "" 21 | "Project-Id-Version: Menu text for SW Port\n" 22 | "Report-Msgid-Bugs-To: https://github.com/swfans/swars/issues\n" 23 | "POT-Creation-Date: 2023-08-20 01:12+0200\n" 24 | "PO-Revision-Date: 2023-09-02 12:00+0100\n" 25 | "Last-Translator: Mefistotelis \n" 26 | "Language-Team: Syndicate Wars Fans \n" 27 | "Language: es_ES\n" 28 | "MIME-Version: 1.0\n" 29 | "Content-Type: text/plain; charset=UTF-8\n" 30 | "Content-Transfer-Encoding: 8bit\n" 31 | "X-Poedit-SourceCharset: utf-8\n" 32 | -------------------------------------------------------------------------------- /lang/alltext_punks_swe.po: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | # ***************************************************************************** 4 | # @file alltext_punks_swe.po 5 | # Menu text for SW Port translation file 6 | # @par Purpose: 7 | # Contains translation of the national text in the game. 8 | # @par Comment: 9 | # Use this file to improve the translation for specific language. 10 | # @author Syndicate Wars Fans 11 | # @date 20 Aug 2023 - 02 Sep 2023 12 | # @par Copying and copyrights: 13 | # This program is free software; you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation; either version 2 of the License, or 16 | # (at your option) any later version. 17 | # 18 | # ***************************************************************************** 19 | msgid "" 20 | msgstr "" 21 | "Project-Id-Version: Menu text for SW Port\n" 22 | "Report-Msgid-Bugs-To: https://github.com/swfans/swars/issues\n" 23 | "POT-Creation-Date: 2023-08-20 01:12+0200\n" 24 | "PO-Revision-Date: 2023-09-02 12:00+0100\n" 25 | "Last-Translator: Mefistotelis \n" 26 | "Language-Team: Syndicate Wars Fans \n" 27 | "Language: sv_SE\n" 28 | "MIME-Version: 1.0\n" 29 | "Content-Type: text/plain; charset=UTF-8\n" 30 | "Content-Transfer-Encoding: 8bit\n" 31 | "X-Poedit-SourceCharset: utf-8\n" 32 | -------------------------------------------------------------------------------- /m4/openal.m4: -------------------------------------------------------------------------------- 1 | # Configure headers/flags for OpenAL 2 | # Unavowed 3 | 4 | dnl AM_PATH_OPENAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 5 | dnl 6 | dnl AC_DEFINE OPENAL_AL_H/OPENAL_ALC_H to the equivalent of 7 | dnl / so you can do #include OPENAL_AL_H. Define 8 | dnl OPENAL_CFLAGS and OPENAL_LIBS. 9 | AC_DEFUN([AM_PATH_OPENAL], [ 10 | OPENAL_CFLAGS= 11 | OPENAL_LIBS= 12 | 13 | # First check for headers 14 | for header in "AL/al.h" "OpenAL/al.h"; do 15 | AC_CHECK_HEADER([$header], [ 16 | ac_cv_openal_al_h="$header" 17 | break 18 | ]) 19 | done 20 | AS_IF([test -n "$ac_cv_openal_al_h"], [ 21 | ac_cv_openal_alc_h=$(echo "$ac_cv_openal_al_h" | sed 's/al\.h$/alc.h/') 22 | AC_DEFINE_UNQUOTED([OPENAL_AL_H], [<$ac_cv_openal_al_h>], 23 | [Define to the equivalent of on your system]) 24 | AC_DEFINE_UNQUOTED([OPENAL_ALC_H], [<$ac_cv_openal_alc_h>], 25 | [Define to the equivalent of on your system]) 26 | ]) 27 | 28 | # Then check for libs 29 | ac_cv_openal_al_libs= 30 | AS_IF([test -n "$ac_cv_openal_al_h" && test -n "$ac_cv_openal_alc_h"], [ 31 | OLD_LIBS="$LIBS" 32 | for lib in "-framework OpenAL" "-lopenal" "-lopenal32"; do 33 | LIBS="$OLD_LIBS $lib" 34 | AC_MSG_CHECKING([for alGenSources in $lib]) 35 | AC_TRY_LINK([#include OPENAL_AL_H], [alGenSources (1, 0);], [ 36 | ac_cv_openal_al_libs="$lib" 37 | AC_MSG_RESULT([yes]) 38 | break 39 | ], [ 40 | AC_MSG_RESULT([no]) 41 | ]) 42 | done 43 | 44 | LIBS="$OLD_LIBS" 45 | OPENAL_LIBS="$ac_cv_openal_al_libs" 46 | ]) 47 | 48 | AC_SUBST([OPENAL_CFLAGS]) 49 | AC_SUBST([OPENAL_LIBS]) 50 | 51 | AS_IF([test -z "$OPENAL_CFLAGS" && test -z "$OPENAL_LIBS"], [$2], [$1]) 52 | ]) 53 | -------------------------------------------------------------------------------- /res/lang_n_cdrom.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=6 3 | 4 | [Field 1] 5 | Type=GroupBox 6 | Left=0 7 | Right=-1 8 | Top=0 9 | Bottom=-5 10 | Text="Additional game settings" 11 | 12 | [Field 2] 13 | Type=droplist 14 | ListItems=Choose the language|English|French|German|Italian|Spanish|Swedish 15 | State='Choose the language' 16 | Left=10 17 | Right=-10 18 | Top=17 19 | Bottom=128 20 | 21 | [Field 3] 22 | Type=droplist 23 | ListItems= 24 | State='' 25 | Left=10 26 | Right=-10 27 | Top=34 28 | Bottom=128 29 | 30 | [Field 4] 31 | Type=checkbox 32 | Text=Portable install 33 | Left=10 34 | Right=-10 35 | Top=51 36 | Bottom=60 37 | State=0 38 | Flags=NOTABSTOP 39 | 40 | [Field 5] 41 | Type=checkbox 42 | Text=Create an entry in the Start Menu 43 | Left=10 44 | Right=-10 45 | Top=61 46 | Bottom=69 47 | State=1 48 | Flags=NOTABSTOP 49 | 50 | [Field 6] 51 | Type=checkbox 52 | Text=Create a shortcut on the desktop 53 | Left=10 54 | Right=-10 55 | Top=70 56 | Bottom=78 57 | State=1 58 | Flags=NOTABSTOP 59 | 60 | -------------------------------------------------------------------------------- /res/swars-config.nsh.in: -------------------------------------------------------------------------------- 1 | ; Syndicate Wars Port config header for NSIS-2 install script 2 | 3 | ; Version number of package 4 | !define PRODUCT_VERSION "@VERSION@" 5 | 6 | ; Version number and file name for levels package 7 | !define LEVELS_VERSION "1.0.1.31" 8 | !define LEVELS_PACKAGE "swars-levels-1_0_1_31" 9 | !define LEVELS_PKG_MD5 "57ca7bf586aa7d75f94808dde6f525c7" 10 | 11 | ; Version number and file name for gfx package 12 | !define GFX_VERSION "1.0.3.218" 13 | !define GFX_PACKAGE "swars-gfx-1_0_3_218" 14 | !define GFX_PKG_MD5 "7a86388f7b50260497db411cb80d1b22" 15 | 16 | ; Version number and file name for sfx package 17 | !define SFX_VERSION "1.0.0.22" 18 | !define SFX_PACKAGE "swars-sfx-1_0_0_22" 19 | !define SFX_PKG_MD5 "f222a89bfe0a2c931394c2ae25508a6d" -------------------------------------------------------------------------------- /res/swars.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/res/swars.icns -------------------------------------------------------------------------------- /res/swars_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/res/swars_icon.ico -------------------------------------------------------------------------------- /res/swars_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swfans/swars/9d3c7fff9f94673ff48085e55b691b5056777a5c/res/swars_icon.png -------------------------------------------------------------------------------- /res/swars_stdres.rc: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Free implementation of Bullfrog's Syndicate Wars strategy game. 3 | /******************************************************************************/ 4 | /** @file swars_stdres.rc 5 | * Standard Windows resoures used by SWars application. 6 | * @par Purpose: 7 | * Defines icons and executable information data (VersionInfo) 8 | * used by Ms Windows as description of the application. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 10 Oct 2012 - 13 Oct 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | 21 | #include // include for version info constants 22 | #include "swars_ver.h" // define values for version info 23 | 24 | A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "swars_icon.ico" 25 | 26 | // Create version info block, using defines from the header file 27 | 1 VERSIONINFO 28 | FILEVERSION VER_MAJOR,VER_MINOR,VER_RELEASE,VER_BUILD 29 | PRODUCTVERSION VER_MAJOR,VER_MINOR,VER_RELEASE,VER_BUILD 30 | { 31 | BLOCK "StringFileInfo" 32 | { 33 | BLOCK "040904E4" 34 | { 35 | VALUE "CompanyName", COMPANY_NAME 36 | VALUE "FileVersion", FILE_VERSION 37 | VALUE "FileDescription", FILE_DESCRIPTION 38 | VALUE "InternalName", INTERNAL_NAME 39 | VALUE "LegalCopyright", LEGAL_COPYRIGHT 40 | VALUE "LegalTrademarks", LEGAL_TRADEMARKS 41 | VALUE "OriginalFilename", ORIGINAL_FILENAME 42 | VALUE "ProductName", PRODUCT_NAME 43 | VALUE "ProductVersion", PRODUCT_VERSION 44 | } 45 | } 46 | BLOCK "VarFileInfo" 47 | { 48 | VALUE "Translation", 0x0809, 1252 49 | } 50 | } 51 | /******************************************************************************/ 52 | -------------------------------------------------------------------------------- /src/app_gengh.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file app_gengh.c 6 | * Implementation of related functions. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "app_gentab.h" 21 | 22 | 23 | struct ApColorTables appixmap; 24 | 25 | /******************************************************************************/ 26 | -------------------------------------------------------------------------------- /src/app_gentab.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file app_gentab.h 6 | * Header file for ap_gengh.c. 7 | * @par Purpose: 8 | * Unknown. 9 | * @par Comment: 10 | * None. 11 | * @author Tomasz Lis 12 | * @date 12 Nov 2008 - 05 Nov 2021 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #ifndef APP_GENTAB_H_ 21 | #define APP_GENTAB_H_ 22 | 23 | #include "bftypes.h" 24 | #include "bfpalette.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #pragma pack(1) 31 | 32 | /** Colour tables, used for fading and merging colours in palette mode. 33 | */ 34 | struct ApColorTables { 35 | /** Table used for adding two colors without brightness schange of the first. */ 36 | TbPixel ghost_add_table[PALETTE_8b_COLORS*PALETTE_8b_COLORS]; 37 | }; 38 | 39 | #pragma pack() 40 | 41 | extern struct ApColorTables appixmap; 42 | 43 | TbResult LbScreenTableGenerate(const ubyte *pal, short intens, const char *fname); 44 | TbResult LbScreenTableLoad(const ubyte *pal, short intens, const char *fname); 45 | 46 | #ifdef __cplusplus 47 | }; 48 | #endif 49 | 50 | #endif // APP_GENTAB_H_ 51 | /******************************************************************************/ 52 | -------------------------------------------------------------------------------- /src/bflib_render_drspr.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Bullfrog Engine Emulation Library - for use to remake classic games like 3 | // Syndicate Wars, Magic Carpet or Dungeon Keeper. 4 | /******************************************************************************/ 5 | /** @file bflib_render_drspr.c 6 | * Rendering function draw_gpoly() for drawing 3D view elements. 7 | * @par Purpose: 8 | * Function for rendering 3D elements. 9 | * @par Comment: 10 | * Go away from here, you bad optimizer! Do not compile this with optimizations. 11 | * @author Tomasz Lis 12 | * @date 20 Mar 2009 - 14 Feb 2010 13 | * @par Copying and copyrights: 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | */ 19 | /******************************************************************************/ 20 | #include "poly.h" 21 | 22 | #include "globals.h" 23 | #include "swlog.h" 24 | 25 | /******************************************************************************/ 26 | 27 | 28 | /******************************************************************************/ 29 | 30 | void LbSpriteDraw_1(int x, int y, struct TbSprite *spr) 31 | { 32 | asm volatile ( 33 | "call ASM_LbSpriteDraw_1\n" 34 | : : "a" (x), "d" (y), "b" (spr)); 35 | } 36 | 37 | void LbSpriteDraw_2(int x, int y, struct TbSprite *spr) 38 | { 39 | asm volatile ( 40 | "call ASM_LbSpriteDraw_2\n" 41 | : : "a" (x), "d" (y), "b" (spr)); 42 | } 43 | 44 | /******************************************************************************/ 45 | -------------------------------------------------------------------------------- /src/bflib_render_drspr.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file bflib_render_drspr.h 5 | * Header file for bflib_render_drspr.c. 6 | * @par Purpose: 7 | * Special variants os sprite drawing functs. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2024 - 12 May 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef BFLIB_RENDER_DRSPR_H 20 | #define BFLIB_RENDER_DRSPR_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | 29 | #pragma pack(1) 30 | 31 | struct TbSprite; 32 | 33 | #pragma pack() 34 | /******************************************************************************/ 35 | 36 | void LbSpriteDraw_1(int x, int y, struct TbSprite *spr); 37 | void LbSpriteDraw_2(int x, int y, struct TbSprite *spr); 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bflib_vidraw.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file bflib_vidraw.h 5 | * Header file for bflib_vidraw.c. 6 | * @par Purpose: 7 | * Routines to be moved to bflibrary. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 27 May 2022 - 12 Jun 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef BFLIB_VIDRAW_H 20 | #define BFLIB_VIDRAW_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | void draw_noise_box(short X, short Y, ushort a3, ushort a4); 35 | 36 | /******************************************************************************/ 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /src/bmbang.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file bmbang.c 5 | * On-map explosion effect implementation. 6 | * @par Purpose: 7 | * Implement functions displaying an explosion within the game world. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 19 Sep 2023 - 17 Mar 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "bmbang.h" 20 | 21 | /******************************************************************************/ 22 | 23 | void new_bang(int x, int y, int z, int type, int owner, int c) 24 | { 25 | asm volatile ( 26 | "push %5\n" 27 | "push %4\n" 28 | "call ASM_new_bang\n" 29 | : : "a" (x), "d" (y), "b" (z), "c" (type), "g" (owner), "g" (c)); 30 | } 31 | 32 | void bang_new5(int x, int y, int z, int type, int owner) 33 | { 34 | new_bang(x, y, z, type, owner, 0); 35 | } 36 | 37 | void bang_new4(int x, int y, int z, int type) 38 | { 39 | new_bang(x, y, z, type, 0, 0); 40 | } 41 | 42 | /******************************************************************************/ 43 | -------------------------------------------------------------------------------- /src/bmbang.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file bmbang.h 5 | * Header file for bmbang.c. 6 | * @par Purpose: 7 | * On-map explosion effect implementation. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Sep 2023 - 17 Mar 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef BMBANG_H 20 | #define BMBANG_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | void new_bang(int x, int y, int z, int type, int owner, int c); 35 | void bang_new5(int x, int y, int z, int type, int owner); 36 | void bang_new4(int x, int y, int z, int type); 37 | 38 | /******************************************************************************/ 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /src/dos.h: -------------------------------------------------------------------------------- 1 | #ifndef DOS_H 2 | #define DOS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "bfdos.h" 9 | 10 | #define DOS_O_RDONLY 0x0000 11 | #define DOS_O_WRONLY 0x0001 12 | #define DOS_O_RDWR 0x0002 13 | #define DOS_O_APPEND 0x0010 14 | #define DOS_O_CREAT 0x0020 15 | #define DOS_O_TRUNC 0x0040 16 | #define DOS_O_NOINHERIT 0x0080 17 | #define DOS_O_TEXT 0x0100 18 | #define DOS_O_BINARY 0x0200 19 | #define DOS_O_EXCL 0x0400 20 | 21 | #define DOS_CLOCKS_PER_SEC 100 22 | 23 | 24 | struct dostime_t 25 | { 26 | uint8_t hour; 27 | uint8_t minute; 28 | uint8_t second; 29 | uint8_t hsecond; /* .01 of a sec */ 30 | }; 31 | 32 | 33 | struct dosdate_t 34 | { 35 | uint8_t day; 36 | uint8_t month; 37 | uint16_t year; 38 | uint8_t dayofweek; 39 | }; 40 | 41 | 42 | int dos_open_flags_to_native (int flags); 43 | 44 | bool dos_path_to_native (const char *path, char *buffer, size_t len); 45 | 46 | int dos_sopen (const char *path, int open_flags, int share_flags, ...); 47 | 48 | int dos_open (const char *path, int open_flags, ...); 49 | 50 | uint32_t dos_clock(void); 51 | 52 | void dos_free(unsigned short n); 53 | 54 | int dos_int386 (int num, union REGS *regs, union REGS *out_regs) 55 | __attribute__ ((noreturn)); 56 | 57 | int dos_int386x (int num, union REGS *regs, union REGS *out_regs, 58 | SREGS *sregs) 59 | __attribute__ ((noreturn)); 60 | 61 | void *dos_getvect (int num) __attribute__ ((noreturn)); 62 | 63 | void dos_setvect (int num, void *function) __attribute__ ((noreturn)); 64 | 65 | int dos_access(const char *path, int access_flags); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/drawtext.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file drawtext.h 5 | * Header file for drawtext.c. 6 | * @par Purpose: 7 | * Math transformations required by the 3D engine. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 27 Aug 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef DRAWTEXT_H 20 | #define DRAWTEXT_H 21 | 22 | #include "bftypes.h" 23 | #include "poly.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | #pragma pack(1) 30 | 31 | 32 | #pragma pack() 33 | /******************************************************************************/ 34 | 35 | void draw_text(short x, short y, const char *text, ubyte colour); 36 | 37 | void draw_text_transformed(int coord_x, int coord_y, int coord_z, const char *text); 38 | void draw_number_transformed(int coord_x, int coord_y, int coord_z, int num); 39 | 40 | void draw_line_transformed_at_ground(int x1, int y1, int x2, int y2, TbPixel colour); 41 | void draw_number_transformed_at_ground(int coord_x, int coord_z, int num); 42 | void draw_text_transformed_at_ground(int coord_x, int coord_z, const char *text); 43 | 44 | /******************************************************************************/ 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif 49 | -------------------------------------------------------------------------------- /src/enginfloor.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginfloor.c 5 | * Support for 3D map floor tiles. 6 | * @par Purpose: 7 | * Implement functions for handling map floor tiles. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 13 Oct 2024 - 06 Nov 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "enginfloor.h" 20 | 21 | #include "bigmap.h" 22 | #include "display.h" 23 | #include "enginzoom.h" 24 | #include "swlog.h" 25 | /******************************************************************************/ 26 | 27 | 28 | /******************************************************************************/ 29 | -------------------------------------------------------------------------------- /src/enginfloor.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginfloor.h 5 | * Header file for enginfloor.c. 6 | * @par Purpose: 7 | * Support for 3D map floor tiles. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 13 Oct 2024 - 06 Nov 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef ENGINFLOOR_H 20 | #define ENGINFLOOR_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | struct SingleFloorTexture; 31 | 32 | struct FloorTile { // sizeof=39 33 | short X[4]; 34 | short Y[4]; 35 | struct SingleFloorTexture *Texture; 36 | ubyte V[4]; 37 | short Shade[4]; 38 | ubyte Col; 39 | ubyte Flags; 40 | ubyte Flags2; 41 | ubyte Flags2b; 42 | ubyte Page; 43 | short Offset; 44 | }; 45 | 46 | #pragma pack() 47 | /******************************************************************************/ 48 | extern struct FloorTile *game_floor_tiles; 49 | extern short next_floor_tile; 50 | 51 | /******************************************************************************/ 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /src/enginlights.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginlights.c 5 | * Lights structures required by the 3D engine. 6 | * @par Purpose: 7 | * Implement functions for handling lights in 3D world. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 27 Aug 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "enginlights.h" 20 | 21 | #include "bfmemut.h" 22 | #include "swlog.h" 23 | /******************************************************************************/ 24 | 25 | void refresh_old_full_light_format(struct FullLight *p_fulight, 26 | struct FullLightOldV12 *p_oldfulight, ulong fmtver) 27 | { 28 | LbMemorySet(p_fulight, 0, sizeof(struct FullLight)); 29 | 30 | p_fulight->Intensity = p_oldfulight->Intensity; 31 | p_fulight->TrueIntensity = p_oldfulight->TrueIntensity; 32 | p_fulight->Command = p_oldfulight->Command; 33 | p_fulight->NextFull = p_oldfulight->NextFull; 34 | p_fulight->X = p_oldfulight->X; 35 | p_fulight->Y = p_oldfulight->Y; 36 | p_fulight->Z = p_oldfulight->Z; 37 | p_fulight->lgtfld_E = p_oldfulight->lgtfld_E; 38 | p_fulight->lgtfld_10 = p_oldfulight->lgtfld_10; 39 | p_fulight->lgtfld_12 = p_oldfulight->lgtfld_12; 40 | 41 | if (fmtver <= 11) { 42 | p_fulight->TrueIntensity = p_fulight->Intensity; 43 | } 44 | } 45 | 46 | /******************************************************************************/ 47 | -------------------------------------------------------------------------------- /src/enginpeff.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginpeff.h 5 | * Header file for enginpeff.c. 6 | * @par Purpose: 7 | * Engine scene pre-/post-processing effects. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 29 Oct 2023 - 02 May 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef ENGINPEFF_H 20 | #define ENGINPEFF_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | enum GamePostSceneEffectType { 31 | ScEff_NONE = 0, 32 | ScEff_RAIN, 33 | ScEff_SNOW, 34 | ScEff_SPACE, 35 | }; 36 | 37 | #pragma pack() 38 | /******************************************************************************/ 39 | extern ushort gamep_scene_effect_type; 40 | extern ushort gamep_scene_effect_intensity; 41 | 42 | void scene_post_effect_prepare(void); 43 | void scene_post_effect_for_bucket(short bckt); 44 | 45 | void draw_background_stars(void); 46 | /******************************************************************************/ 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | #endif 51 | -------------------------------------------------------------------------------- /src/enginpritxtr.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginpritxtr.c 5 | * Primitive textures support required by the 3D engine. 6 | * @par Purpose: 7 | * Implement functions for handling primitive textures in 3D world. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 29 Sep 2023 - 02 Jan 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "enginpritxtr.h" 20 | 21 | #include "swlog.h" 22 | /******************************************************************************/ 23 | 24 | 25 | /******************************************************************************/ 26 | -------------------------------------------------------------------------------- /src/enginpritxtr.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginpritxtr.h 5 | * Header file for enginpritxtr.c. 6 | * @par Purpose: 7 | * Primitive textures support required by the 3D engine. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 29 Sep 2023 - 02 Jan 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef ENGINPRITXTR_H 20 | #define ENGINPRITXTR_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | typedef struct { 31 | char field_0[15]; 32 | char field_F; 33 | } PrimFaceTexture; 34 | 35 | typedef struct { 36 | char field_0[17]; 37 | char field_11; 38 | } Prim4Texture; 39 | 40 | #pragma pack() 41 | /******************************************************************************/ 42 | extern Prim4Texture *prim4_textures; 43 | extern PrimFaceTexture *prim_face_textures; 44 | extern ushort prim4_textures_count; 45 | extern ushort prim_face_textures_count; 46 | 47 | /******************************************************************************/ 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | #endif 52 | -------------------------------------------------------------------------------- /src/enginshadws.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginshadws.h 5 | * Header file for enginshadws.c. 6 | * @par Purpose: 7 | * Shadows preparation and drawing required by the 3D engine. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 13 Sep 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef ENGINSHADWS_H 20 | #define ENGINSHADWS_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | #pragma pack() 31 | /******************************************************************************/ 32 | 33 | void draw_person_shadow(ushort face); 34 | void draw_vehicle_shadow(ushort veh, ushort sort); 35 | 36 | void generate_shadows_for_multicolor_sprites(void); 37 | 38 | /******************************************************************************/ 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /src/enginshrapn.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file enginshrapn.c 5 | * Shrapnel structures required by the 3D engine. 6 | * @par Purpose: 7 | * Implement functions for handling shrapnel in 3D world. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 27 Aug 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "enginshrapn.h" 20 | 21 | #include "bfmemut.h" 22 | #include "swlog.h" 23 | /******************************************************************************/ 24 | 25 | /******************************************************************************/ 26 | -------------------------------------------------------------------------------- /src/fecntrls.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file fecntrls.h 5 | * Header file for fecntrls.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, research screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FECNTRLS_H 20 | #define FECNTRLS_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | void init_controls_screen_boxes(void); 35 | void reset_controls_screen_boxes_flags(void); 36 | void set_flag01_controls_screen_boxes(void); 37 | void clear_someflags_controls_screen_boxes(void); 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/fedebrief.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file fedebrief.h 5 | * Header file for fedebrief.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, mission debrief screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FEDEBRIEF_H 20 | #define FEDEBRIEF_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | struct DebriefReport { 31 | short RefNo; 32 | short BriefNo; 33 | short Status; 34 | ulong Income; 35 | ulong Expenditure; 36 | ulong WeaponsResearched; 37 | ulong ModsResearched; 38 | ubyte ScientistsLost; 39 | ubyte SciLostReason; 40 | }; 41 | 42 | #pragma pack() 43 | /******************************************************************************/ 44 | 45 | void show_debrief_screen(void); 46 | 47 | void init_debrief_screen_boxes(void); 48 | void reset_debrief_screen_boxes_flags(void); 49 | 50 | /******************************************************************************/ 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | #endif 55 | -------------------------------------------------------------------------------- /src/felogin.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file felogin.h 5 | * Header file for felogin.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, login screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FELOGIN_H 20 | #define FELOGIN_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | ubyte show_login_screen(void); 35 | void init_login_screen_boxes(void); 36 | void reset_login_screen_boxes_flags(void); 37 | void set_flag01_login_screen_boxes(void); 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/femail.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file femail.h 5 | * Header file for femail.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, emails handling. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FEMAIL_H 20 | #define FEMAIL_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | struct EmailItem { // sizeof=5 31 | ubyte RefNum; 32 | ubyte RecvDay; 33 | ubyte RecvMonth; 34 | ubyte RecvYear; 35 | ubyte Mission; 36 | }; 37 | 38 | struct NewMailItem { // sizeof=5 39 | ubyte RecvDay; 40 | ubyte RecvMonth; 41 | ubyte RecvYear; 42 | ubyte Mission; 43 | ubyte Flag; 44 | }; 45 | 46 | #pragma pack() 47 | /******************************************************************************/ 48 | extern ubyte new_mail; 49 | extern struct NewMailItem newmail_store[29]; 50 | extern ushort next_email; 51 | extern struct EmailItem email_store[20]; 52 | extern struct EmailItem brief_store[10]; 53 | 54 | ushort activate_queued_mail(void); 55 | void delete_mail(ushort mailnum, ubyte type); 56 | void queue_up_new_mail(ubyte emtype, short missi); 57 | 58 | /******************************************************************************/ 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #endif 63 | -------------------------------------------------------------------------------- /src/fenet.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file fenet.h 5 | * Header file for fenet.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, multiplayer screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FENET_H 20 | #define FENET_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | void init_net_screen_boxes(void); 35 | void reset_net_screen_boxes_flags(void); 36 | void reset_net_screen_EJECT_flags(void); 37 | void set_flag01_net_screen_boxes(void); 38 | void switch_net_screen_boxes_to_initiate(void); 39 | void switch_net_screen_boxes_to_execute(void); 40 | 41 | /******************************************************************************/ 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /src/feoptions.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file feoptions.h 5 | * Header file for feoptions.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, options screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FEOPTIONS_H 20 | #define FEOPTIONS_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | extern char options_title_text[]; 34 | 35 | void init_options_audio_screen_boxes(void); 36 | void init_options_visual_screen_boxes(void); 37 | void update_options_screen_state(void); 38 | void reset_options_screen_boxes_flags(void); 39 | 40 | /******************************************************************************/ 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /src/fepanet.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file fepanet.c 5 | * Front-end desktop and menu system, P. A. Network screen. 6 | * @par Purpose: 7 | * Implement functions for Public Access Network screen in front-end desktop. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 05 Apr 2024 - 22 May 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "fepanet.h" 20 | 21 | #include "femain.h" 22 | #include "guiboxes.h" 23 | #include "guitext.h" 24 | #include "display.h" 25 | #include "swlog.h" 26 | /******************************************************************************/ 27 | 28 | ubyte show_panet_screen(void) 29 | { 30 | ubyte drawn = true; 31 | 32 | // Draw sequentially 33 | if (drawn) 34 | drawn = draw_heading_box(); 35 | 36 | //TODO PANET screen not implemented 37 | 38 | return drawn; 39 | } 40 | 41 | /******************************************************************************/ 42 | -------------------------------------------------------------------------------- /src/fepanet.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file fepanet.h 5 | * Header file for fepanet.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, P. A. Network screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 05 Apr 2024 - 22 May 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FEPANET_H 20 | #define FEPANET_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | ubyte show_panet_screen(void); 35 | 36 | /******************************************************************************/ 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /src/fepause.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file fepause.h 5 | * Header file for fepause.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, in-game pause screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FEPAUSE_H 20 | #define FEPAUSE_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | TbBool pause_screen_handle(void); 35 | 36 | /******************************************************************************/ 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /src/festorage.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file festorage.h 5 | * Header file for festorage.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, file storage screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FESTORAGE_H 20 | #define FESTORAGE_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | 34 | void init_storage_screen_boxes(void); 35 | void reset_storage_screen_boxes_flags(void); 36 | void set_flag01_storage_screen_boxes(void); 37 | void clear_someflags_storage_screen_boxes(void); 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/feworld.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file feworld.h 5 | * Header file for feworld.c. 6 | * @par Purpose: 7 | * Front-end desktop and menu system, world view screen. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2023 - 22 Oct 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef FEWORLD_H 20 | #define FEWORLD_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | #pragma pack() 31 | /******************************************************************************/ 32 | 33 | ubyte show_worldmap_screen(void); 34 | void init_world_screen_boxes(void); 35 | void reset_world_screen_boxes_flags(void); 36 | void set_flag01_world_screen_boxes(void); 37 | void set_flag02_world_screen_boxes(void); 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/game_save.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file game_save.h 5 | * Header file for game_save.c. 6 | * @par Purpose: 7 | * Loading and saving the game and user profile. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 10 Feb 2024 - 02 May 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef GAME_SAVE_H 20 | #define GAME_SAVE_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | 29 | extern ulong save_mortal_salt; 30 | 31 | extern ubyte *save_game_buffer; 32 | extern char save_active_desc[28]; 33 | extern char login_name[16]; 34 | 35 | extern short save_slot; // = -1; 36 | extern char save_slot_names[8][25]; 37 | extern long save_slot_base; 38 | 39 | /******************************************************************************/ 40 | 41 | void read_user_settings(void); 42 | TbBool save_user_settings(void); 43 | 44 | int save_game_write(ubyte slot, char *desc); 45 | ubyte load_game(int slot, char *desc); 46 | 47 | /******************************************************************************/ 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | #endif 52 | -------------------------------------------------------------------------------- /src/game_speed.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file game_speed.h 5 | * Header file for game_speed.c. 6 | * @par Purpose: 7 | * Control of the game speed. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 10 Feb 2024 - 02 May 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef GAME_SPEED_H 20 | #define GAME_SPEED_H 21 | 22 | #include "bftypes.h" 23 | #include "game_bstype.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | 30 | /******************************************************************************/ 31 | extern ulong curr_tick_time; 32 | extern ulong prev_tick_time; 33 | extern GameTurn gameturn; 34 | extern GameTurn prev_gameturn; 35 | extern ulong turns_delta; 36 | extern ushort fifties_per_gameturn; 37 | 38 | /** Amount of frames per second drawn by the game, and also aount of game 39 | * turns per second. */ 40 | extern ushort game_num_fps; 41 | 42 | TbBool get_speed_control_inputs(void); 43 | 44 | void wait_next_gameturn(void); 45 | 46 | TbBool display_needs_redraw_this_turn(void); 47 | void update_tick_time(void); 48 | 49 | /******************************************************************************/ 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /src/hud_panecfg.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file hud_panecfg.h 5 | * Header file for hud_panecfg.c. 6 | * @par Purpose: 7 | * Ingame panel config loading from file. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 21 Mar 2024 - 11 Jan 2025 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef HUD_PANECFG_H 20 | #define HUD_PANECFG_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | #define GAME_PANELS_LIMIT 32 31 | 32 | #pragma pack() 33 | /******************************************************************************/ 34 | TbBool read_panel_config(const char *name, ushort styleno, ushort detail); 35 | void size_panels_for_detail(short detail); 36 | 37 | int panel_get_objective_info_height(short screen_height); 38 | void panel_get_scanner_screen_size(short *p_margin, short *p_width, short *p_height, 39 | short screen_width, short screen_height, short spr_scale); 40 | 41 | /******************************************************************************/ 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /src/hud_target.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file hud_target.h 5 | * Header file for hud_target.c. 6 | * @par Purpose: 7 | * Ingame Heads-Up Display targetted thing draw. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 27 Aug 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef HUD_TARGET_H 20 | #define HUD_TARGET_H 21 | 22 | #include "bftypes.h" 23 | #include "game_bstype.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | #pragma pack(1) 30 | 31 | struct Thing; 32 | 33 | #pragma pack() 34 | /******************************************************************************/ 35 | extern TbBool hud_show_target_health; 36 | 37 | 38 | void draw_hud_lock_target(void); 39 | void draw_target_person(struct Thing *p_person, uint radius); 40 | void draw_hud_target2(short dcthing, short target); 41 | 42 | /******************************************************************************/ 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /src/joy_rt_spbal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1994-1995 Apogee Software, Ltd. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | //*************************************************************************** 21 | // 22 | // RT_spbal.h - SpaceBall stuff 23 | // 24 | //*************************************************************************** 25 | 26 | #ifndef _rt_spbal_public 27 | #define _rt_spbal_public 28 | 29 | 30 | unsigned GetSpaceBallButtons (void); 31 | void OpenSpaceBall (void); 32 | void CloseSpaceBall (void); 33 | void PollSpaceBall (void); 34 | #endif 35 | -------------------------------------------------------------------------------- /src/linksmk.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file linksmk.c 5 | * Link between the main game and smacker playback library. 6 | * @par Purpose: 7 | * Callback and setup functions to integrate bfsmacklib with the game. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 12 Nov 2011 - 13 Jun 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "linksmk.h" 20 | 21 | #include "bfsmack.h" 22 | 23 | /******************************************************************************/ 24 | extern ulong smack_malloc_used_tot; 25 | 26 | /******************************************************************************/ 27 | void *ASM_smack_malloc(int msize); 28 | void ASM_smack_mfree(void *ptr); 29 | 30 | 31 | void smack_malloc_free_all(void) 32 | { 33 | smack_malloc_used_tot = 0; 34 | } 35 | 36 | void smack_malloc_setup(void) 37 | { 38 | set_smack_malloc(ASM_smack_malloc); 39 | set_smack_free(ASM_smack_mfree); 40 | } 41 | 42 | /******************************************************************************/ 43 | -------------------------------------------------------------------------------- /src/linksmk.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file linksmk.h 5 | * Header file for linksmk.c. 6 | * @par Purpose: 7 | * Link between the main game and smacker playback library. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 12 Nov 2011 - 13 Jun 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef LINKSMK_H 20 | #define LINKSMK_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | void smack_malloc_setup(void); 29 | void smack_malloc_free_all(void); 30 | 31 | #ifdef __cplusplus 32 | }; 33 | #endif 34 | 35 | #endif // LINKSMK_H 36 | /******************************************************************************/ 37 | -------------------------------------------------------------------------------- /src/lvdraw3d.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file lvdraw3d.h 5 | * Header file for lvdraw3d.c. 6 | * @par Purpose: 7 | * Routines for level and map drawing using 3D rendering. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 24 Dec 2023 - 10 Nov 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef LVDRAW3D_H 20 | #define LVDRAW3D_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | extern ubyte byte_1C8444; 34 | 35 | void clear_super_quick_lights(void); 36 | 37 | void lvdraw_do_floor(void); 38 | void func_2e440(void); 39 | 40 | void draw_screen(void); 41 | /******************************************************************************/ 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /src/lvfiles.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file lvfiles.h 5 | * Header file for lvfiles.c. 6 | * @par Purpose: 7 | * Routines for level and map files handling. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 27 May 2022 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef LVFILES_H 20 | #define LVFILES_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | struct QuickLoad { 31 | ushort *Numb; 32 | void **Ptr; 33 | ushort Size; 34 | ushort Extra; 35 | }; 36 | 37 | struct LevelMisc { // sizeof=22 38 | short X; 39 | short Y; 40 | short Z; 41 | short Group; 42 | short Weapon; 43 | ubyte Flag; 44 | ubyte Type; 45 | ubyte field_C[9]; 46 | ubyte field_15; 47 | }; 48 | 49 | #pragma pack() 50 | /******************************************************************************/ 51 | extern struct LevelMisc *game_level_miscs; 52 | extern TbBool level_deep_fix; 53 | 54 | 55 | TbResult load_mad_pc(ushort mapno); 56 | 57 | void load_level_pc(short level, short missi, ubyte reload); 58 | 59 | /******************************************************************************/ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif 64 | -------------------------------------------------------------------------------- /src/matrix.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file matrix.h 5 | * Header file for matrix.c. 6 | * @par Purpose: 7 | * Routines implementing matrix support. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 27 May 2022 - 12 Jun 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef MATRIX_H 20 | #define MATRIX_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | struct M33 { 31 | int R[3][3]; 32 | }; 33 | 34 | struct M31 { 35 | int R[3]; 36 | }; 37 | 38 | #pragma pack() 39 | /******************************************************************************/ 40 | extern struct M33 local_mats[100]; 41 | 42 | void matrix_identity_fill(struct M33 *p_mat); 43 | void matrix_transform(struct M31 *p_result, struct M33 *p_trans, struct M31 *p_source); 44 | void rotate_object_axis(struct M33 *p_base, short xangle, short yangle, short zangle); 45 | 46 | void vec_cross_prod(struct M31 *vecr, struct M31 *vec1, struct M31 *vec2); 47 | void object_vec_normalisation(struct M33 *vec, ubyte col); 48 | /******************************************************************************/ 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /src/mouse.h: -------------------------------------------------------------------------------- 1 | #ifndef MOUSE_H 2 | #define MOUSE_H 3 | 4 | #include "bftypes.h" 5 | 6 | struct TbPoint; 7 | 8 | TbResult load_mouse_pointers_sprites_for_current_mode(void); 9 | 10 | ubyte process_mouse_imputs(void); 11 | void do_change_mouse(ushort mouse); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/mydraw.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file mydraw.c 5 | * Modified drawing routines adjusted for the specific app. 6 | * @par Purpose: 7 | * Functions which one of original devs apparently considered his. 8 | * @par Comment: 9 | * None. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2024 - 28 Sep 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #include "mydraw.h" 20 | #include "bfsprite.h" 21 | 22 | #include "display.h" 23 | #include "game_sprts.h" 24 | #include "swlog.h" 25 | /******************************************************************************/ 26 | 27 | ubyte my_char_to_upper(ubyte c) 28 | { 29 | ubyte ret; 30 | asm volatile ("call ASM_my_char_to_upper\n" 31 | : "=r" (ret) : "a" (c)); 32 | return ret; 33 | } 34 | 35 | int font_word_length(const char *text) 36 | { 37 | const ubyte *p; 38 | int len; 39 | 40 | len = 0; 41 | for (p = (const ubyte *)text; *p != '\0'; p++) 42 | { 43 | struct TbSprite *spr; 44 | 45 | if (*p == 32) 46 | break; 47 | spr = &small_font[*p - 31]; 48 | len += spr->SWidth; 49 | } 50 | return len; 51 | } 52 | 53 | ushort my_draw_text(short x, short y, const char *text, ushort startline) 54 | { 55 | ushort ret; 56 | asm volatile ("call ASM_my_draw_text\n" 57 | : "=r" (ret) : "a" (x), "d" (y), "b" (text), "c" (startline)); 58 | return ret; 59 | } 60 | 61 | /******************************************************************************/ 62 | -------------------------------------------------------------------------------- /src/mydraw.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file mydraw.h 5 | * Header file for mydraw.c. 6 | * @par Purpose: 7 | * Modified drawing routines adjusted for the specific app. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 22 Apr 2024 - 28 Sep 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef MYDRAW_H 20 | #define MYDRAW_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | 29 | #pragma pack(1) 30 | 31 | 32 | #pragma pack() 33 | /******************************************************************************/ 34 | 35 | ubyte my_char_to_upper(ubyte c); 36 | int font_word_length(const char *text); 37 | ushort my_draw_text(short x, short y, const char *text, ushort startline); 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/osunix.c: -------------------------------------------------------------------------------- 1 | #ifdef __unix__ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "bffile.h" 8 | #include "osunix.h" 9 | #include "util.h" 10 | 11 | void 12 | unix_restore_signal_handlers (void) 13 | { 14 | signal (SIGINT, SIG_DFL); 15 | signal (SIGTERM, SIG_DFL); 16 | } 17 | 18 | bool 19 | sys_get_user_path (char *buffer, size_t size) 20 | { 21 | char *xdg_config_home; 22 | char *home; 23 | 24 | xdg_config_home = getenv ("XDG_CONFIG_HOME"); 25 | if (xdg_config_home != NULL) 26 | { 27 | snprintf (buffer, size, 28 | "%s" FS_SEP_STR "swars", xdg_config_home); 29 | return true; 30 | } 31 | 32 | home = getenv ("HOME"); 33 | if (home == NULL) 34 | { 35 | fprintf (stderr, "Warning: HOME is not set.\n"); 36 | return false; 37 | } 38 | 39 | #ifndef __APPLE__ 40 | snprintf (buffer, size, 41 | "%s" FS_SEP_STR ".config" FS_SEP_STR "swars", home); 42 | #else 43 | snprintf (buffer, size, 44 | "%s/Library/Preferences/Syndicate Wars", home); 45 | #endif 46 | 47 | return true; 48 | } 49 | 50 | bool 51 | sys_get_data_path (char *buffer, size_t size) 52 | { 53 | snprintf (buffer, size, GAME_DATA_PATH); 54 | return true; 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/osunix.h: -------------------------------------------------------------------------------- 1 | #ifndef OSUNIX_H 2 | #define OSUNIX_H 3 | 4 | #ifdef __unix__ 5 | 6 | #include 7 | 8 | void unix_restore_signal_handlers (void); 9 | bool sys_get_user_path (char *buffer, size_t size); 10 | bool sys_get_data_path (char *buffer, size_t size); 11 | 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/oswindws.h: -------------------------------------------------------------------------------- 1 | #ifndef OSWINDWS_H 2 | #define OSWINDWS_H 3 | 4 | #ifdef WIN32 5 | #include 6 | #include 7 | #include 8 | 9 | bool sys_get_user_path (char *buffer, size_t size); 10 | bool sys_get_data_path (char *buffer, size_t size); 11 | 12 | #endif /* WIN32 */ 13 | 14 | #endif /* OSWINDWS_H */ 15 | -------------------------------------------------------------------------------- /src/plyr_packet.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file plyr_packet.h 5 | * Header file for plyr_packet.c. 6 | * @par Purpose: 7 | * Players User Input handling. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 11 Dec 2024 - 01 Feb 2025 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef PLYR_PACKET_H 20 | #define PLYR_PACKET_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | 29 | /******************************************************************************/ 30 | 31 | void process_packets(void); 32 | 33 | /******************************************************************************/ 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /src/rules.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file rules.h 5 | * Header file for rules.c. 6 | * @par Purpose: 7 | * Ingame rules loading from file. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Sep 2023 - 17 Mar 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef RULES_H 20 | #define RULES_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | 31 | #pragma pack() 32 | /******************************************************************************/ 33 | TbBool read_rules_file(void); 34 | 35 | /******************************************************************************/ 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /src/scandraw.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file scandraw.h 5 | * Header file for scandraw.c. 6 | * @par Purpose: 7 | * Ingame scanner (minimap/radar) drawing. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 19 Apr 2022 - 27 Aug 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef SCANDRAW_H 20 | #define SCANDRAW_H 21 | 22 | #include "bftypes.h" 23 | #include "game_bstype.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | #pragma pack(1) 30 | 31 | 32 | #pragma pack() 33 | /******************************************************************************/ 34 | extern ubyte SCANNER_colour[5]; 35 | extern ubyte byte_1DB2E9; 36 | extern ubyte byte_1C5C30[8]; 37 | extern TbPixel SCANNER_people_colours[15]; 38 | 39 | void unkn_draw_transformed_point(short x, short y, long ptX, long ptY, long ptZ, ubyte colour); 40 | void draw_objective_point(long x, long y, ThingIdx thing, short a4, ubyte colour); 41 | void draw_map_flat_circle(short cor_x, short cor_y, short cor_z, short radius, TbPixel colour); 42 | void draw_map_flat_rect(int cor_x, int cor_y, int cor_z, int size_x, int size_z, TbPixel colour); 43 | 44 | void SCANNER_draw_new_transparent(void); 45 | /******************************************************************************/ 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | #endif 50 | -------------------------------------------------------------------------------- /src/swars_ver.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Free implementation of Bullfrog's Syndicate Wars strategy game. 3 | /******************************************************************************/ 4 | /** @file swars_ver.h 5 | * Project name, version, copyrights and global definitions. 6 | * @par Purpose: 7 | * Header file for global names and defines used by resource compiler. 8 | * @par Comment: 9 | * Can only contain commands which resource compiler can understand. 10 | * @author Tomasz Lis 11 | * @date 10 Oct 2012 - 13 Oct 2021 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef SWARS_VER_H_ 20 | #define SWARS_VER_H_ 21 | 22 | /* Version definitions */ 23 | #include "config.h" 24 | //#define VER_MAJOR 1 25 | //#define VER_MINOR 2 26 | //#define VER_RELEASE 3 27 | //#define VER_BUILD 4 28 | //#define VERSION "1.2.3.4" 29 | 30 | /* Program name, copyrights and file names */ 31 | #define PROGRAM_NAME "Syndicate Wars Port" 32 | #define PROGRAM_FULL_NAME "Open-source reimplementation of Syndicate Wars game" 33 | #define PROGRAM_AUTHORS "see AUTHORS file" 34 | #define COMPANY_NAME "Community based" 35 | #define INTERNAL_NAME "swars" 36 | #define LEGAL_COPYRIGHT "GNU General Public License" 37 | #define LEGAL_TRADEMARKS "" 38 | #define FILE_VERSION VERSION 39 | #define FILE_DESCRIPTION PROGRAM_NAME 40 | #define ORIGINAL_FILENAME INTERNAL_NAME".exe" 41 | #define PRODUCT_NAME PROGRAM_FULL_NAME 42 | #define PRODUCT_VERSION VERSION 43 | #define DEFAULT_LOG_FILENAME INTERNAL_NAME".log" 44 | 45 | #endif // SWARS_VER_H_ 46 | /******************************************************************************/ 47 | -------------------------------------------------------------------------------- /src/swlog.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file swlog.h 5 | * Application debug logging macros. 6 | * @par Purpose: 7 | * Macros to simplify logging within the application. 8 | * @par Comment: 9 | * Any libraries should have its own collection of macros. 10 | * @author Tomasz Lis 11 | * @date 12 Nov 2008 - 25 May 2022 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef SWLOG_H_ 20 | #define SWLOG_H_ 21 | 22 | #include "bflog.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** Macro for logging messages of error severity within this module. */ 29 | #define LOGERR(format,args...) LbErrorLog("SWars: %s: " format "\n", __func__ , ## args) 30 | 31 | /** Macro for logging messages of warning severity within this module. */ 32 | #define LOGWARN(format,args...) LbWarnLog("SWars: %s: " format "\n", __func__ , ## args) 33 | 34 | #ifdef DEBUG 35 | #define LOGSYNC(format,args...) LbSyncLog("SWars: %s: " format "\n", __func__ , ## args) 36 | #define LOGDBG(format,args...) LbDbgLog("SWars: %s: " format "\n", __func__ , ## args) 37 | #else 38 | #define LOGSYNC(format,args...) 39 | #define LOGDBG(format,args...) 40 | #endif 41 | 42 | /** Macro for messages which are only for developers and disabled in normal builds. */ 43 | #define LOGNO(format,args...) 44 | 45 | #ifdef __cplusplus 46 | }; 47 | #endif 48 | 49 | #endif // SWLOG_H_ 50 | /******************************************************************************/ 51 | -------------------------------------------------------------------------------- /src/timer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "timer.h" 6 | 7 | #include "sound.h" 8 | 9 | uint32_t 10 | timer_get_18_2_hz_ticks (void) 11 | { 12 | return (((uint64_t) SDL_GetTicks () * 1193182 / 1000) >> 15); 13 | } 14 | -------------------------------------------------------------------------------- /src/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMER_H 2 | #define TIMER_H 3 | 4 | #include 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/tngobjdrw.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file tngobjdrw.h 5 | * Header file for tngobjdrw.c. 6 | * @par Purpose: 7 | * Draws thing objects using drawlist. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 04 Sep 2024 - 11 Nov 2024 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef TNGOBJDRW_H 20 | #define TNGOBJDRW_H 21 | 22 | #include "bftypes.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | /******************************************************************************/ 28 | #pragma pack(1) 29 | 30 | struct Thing; 31 | 32 | #pragma pack() 33 | /******************************************************************************/ 34 | 35 | short draw_thing_object(struct Thing *p_thing); 36 | 37 | #define draw_sthing_object(p_sthing) draw_thing_object((struct Thing *)p_sthing) 38 | 39 | /******************************************************************************/ 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/util.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #ifdef HAVE_UNISTD_H 11 | # include 12 | #endif 13 | 14 | #include "util.h" 15 | #include "bffile.h" 16 | 17 | void 18 | strtolower (char *string) 19 | { 20 | while (*string != '\0') 21 | { 22 | *string = tolower (*string); 23 | string++; 24 | } 25 | } 26 | 27 | void 28 | strtocapwords(char *s) 29 | { 30 | TbBool word_start = 1; 31 | 32 | while (*s != '\0') 33 | { 34 | if (word_start) { 35 | if (isalpha(*s)) { 36 | *s = toupper(*s); 37 | word_start = 0; 38 | } 39 | } else { 40 | *s = tolower(*s); 41 | if (*s == ' ') 42 | word_start = 1; 43 | } 44 | s++; 45 | } 46 | } 47 | 48 | const char * 49 | extract_path_segment (const char *path, char *buffer, size_t size) 50 | { 51 | const char *sep; 52 | int seg_len; 53 | 54 | sep = strchr (path, FS_SEP); 55 | if (sep == NULL) 56 | { 57 | snprintf (buffer, size, "%s", path); 58 | return NULL; 59 | } 60 | 61 | if (sep == path) 62 | { 63 | snprintf (buffer, size, "%s", FS_SEP_STR); 64 | return (path + 1); 65 | } 66 | 67 | seg_len = MIN (sep - path, (int) size); 68 | snprintf (buffer, size, "%.*s", seg_len, path); 69 | 70 | return sep; 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifndef MIN 9 | # define MIN(a, b) ((a) < (b) ? (a) : (b)) 10 | #endif 11 | 12 | #ifndef MAX 13 | # define MAX(a, b) ((a) > (b) ? (a) : (b)) 14 | #endif 15 | 16 | #ifdef WIN32 17 | #ifndef strcasecmp 18 | # define strcasecmp stricmp 19 | # define strncasecmp strnicmp 20 | #endif 21 | # define mkdir(path, mode) mkdir (path) 22 | #endif 23 | 24 | void strtolower (char *string); 25 | void strtocapwords(char *s); 26 | 27 | const char *extract_path_segment (const char *path, 28 | char *buffer, size_t size); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/wadfile.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************/ 2 | // Syndicate Wars Port, source port of the classic strategy game from Bullfrog. 3 | /******************************************************************************/ 4 | /** @file wadfile.h 5 | * Header file for wadfile.c. 6 | * @par Purpose: 7 | * Support for WAD files, used as an aggregate for a set of small files. 8 | * @par Comment: 9 | * Just a header file - #defines, typedefs, function prototypes etc. 10 | * @author Tomasz Lis 11 | * @date 27 May 2022 - 19 Aug 2023 12 | * @par Copying and copyrights: 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | */ 18 | /******************************************************************************/ 19 | #ifndef WADFILE_H 20 | #define WADFILE_H 21 | 22 | #include "bftypes.h" 23 | #include "bffile.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | /******************************************************************************/ 29 | #pragma pack(1) 30 | 31 | struct WADIndexEntry { 32 | char Filename[12]; 33 | ulong Offset; 34 | ulong Length; 35 | }; 36 | 37 | #pragma pack() 38 | /******************************************************************************/ 39 | 40 | TbFileHandle open_file_from_wad(const char *filename, const char *wadfile); 41 | int load_file_wad(const char *filename, const char *wadfile, void *outbuf); 42 | 43 | int load_file_alltext(const char *filename, void *outbuf); 44 | 45 | /******************************************************************************/ 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | #endif 50 | -------------------------------------------------------------------------------- /util/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = asfilter chgcalls install mkbundle mkwrappers 2 | -------------------------------------------------------------------------------- /util/mkbundle: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SRC="src" 4 | DST="." 5 | 6 | NAME="Syndicate Wars" 7 | BDIR="$DST/$NAME.app" 8 | CDIR="$BDIR/Contents" 9 | XDIR="$CDIR/MacOS" 10 | FDIR="$CDIR/Frameworks" 11 | RDIR="$CDIR/Resources" 12 | EXEC="$XDIR/$NAME" 13 | 14 | install_dyn_libs() 15 | { 16 | local FILE="$1" 17 | 18 | otool -L "$FILE" \ 19 | | grep '^ /sw/' \ 20 | | sed 's/^[^\/]*\([^ ]*\) (.*$/\1/' \ 21 | | while read LIB; do 22 | install_dyn_lib "$FILE" "$LIB" || return 1 23 | done 24 | 25 | return 0 26 | } 27 | 28 | install_dyn_lib() 29 | { 30 | local PARENT="$1" 31 | local LIB="$2" 32 | local BN=`basename "$LIB"` 33 | local DN="$FDIR/$BN" 34 | local RN="@executable_path/../Frameworks/$BN" 35 | 36 | install_name_tool -change "$LIB" "$RN" "$PARENT" || return 1 37 | 38 | if [ -f "$DN" ]; then 39 | return 0 40 | fi 41 | 42 | install -v -m 0644 "$LIB" "$DN" || return 1 43 | install_name_tool -id "$RN" "$DN" || return 1 44 | install_dyn_libs "$DN" || return 1 45 | 46 | return 0 47 | } 48 | 49 | make_info_plist() 50 | { 51 | PLIST="$CDIR/Info.plist" 52 | cat << EOF > "$PLIST" 53 | 54 | 56 | 57 | 58 | CFBundleIconFile 59 | swars.icns 60 | 61 | 62 | EOF 63 | return $? 64 | } 65 | 66 | if [ $# -lt 1 ]; then 67 | echo "Usage: $0 DATA_PATH" >&2 68 | exit 1 69 | fi 70 | 71 | rm -rf "$BDIR" || exit 1 72 | mkdir -p "$XDIR" || exit 1 73 | mkdir -p "$FDIR" || exit 1 74 | 75 | make_info_plist || exit 1 76 | 77 | cp -Rv "$1" "$RDIR" 78 | 79 | find "$RDIR" -type d \ 80 | | while read DIR; do 81 | chmod 755 "$DIR" || exit 1 82 | done 83 | 84 | find "$RDIR" -type f \ 85 | | while read FILE; do 86 | chmod 644 "$FILE" || exit 1 87 | done 88 | 89 | install -v "$SRC/swars" "$EXEC" || exit 1 90 | install_dyn_libs "$EXEC" || exit 1 91 | --------------------------------------------------------------------------------