├── .gitignore
├── Changes.txt
├── Makefile
├── README-devcpp.txt
├── README.md
├── build_release.sh
├── components
├── GP2X
│ ├── fmopl.cpp
│ ├── fmopl.h
│ ├── fmopl_940
│ │ ├── Makefile
│ │ ├── fmopl_core.c
│ │ ├── fmopl_core.h
│ │ ├── fmopl_shared.h
│ │ ├── main.c
│ │ └── memory_layout.h
│ ├── gp2x.cpp
│ └── gp2x.h
├── SDL
│ ├── Kconfig.projbuild
│ ├── Kconfig.projbuild.old2
│ ├── LICENSE
│ ├── SDL.h
│ ├── SDL_audio.c
│ ├── SDL_audio.h
│ ├── SDL_blit.c
│ ├── SDL_blit.h
│ ├── SDL_blit.h.old
│ ├── SDL_config.h
│ ├── SDL_config_minimal.h
│ ├── SDL_dynapi.h
│ ├── SDL_dynapi_overrides.h
│ ├── SDL_endian.h
│ ├── SDL_error.c
│ ├── SDL_error.h
│ ├── SDL_error_c.h
│ ├── SDL_event.c
│ ├── SDL_event.h
│ ├── SDL_input.c
│ ├── SDL_input.h
│ ├── SDL_internal.h
│ ├── SDL_log.c
│ ├── SDL_log.h
│ ├── SDL_mixer.c
│ ├── SDL_mutex.h
│ ├── SDL_rwops.c
│ ├── SDL_rwops.h
│ ├── SDL_scancode.h
│ ├── SDL_stdinc.h
│ ├── SDL_stdlib.c
│ ├── SDL_system.c
│ ├── SDL_system.h
│ ├── SDL_timer.h
│ ├── SDL_types.h
│ ├── SDL_version.h
│ ├── SDL_video.c
│ ├── SDL_video.h
│ ├── SDL_wave.c
│ ├── SDL_wave.h
│ ├── begin_code.h
│ ├── close_code.h
│ ├── component.mk
│ ├── esp32_compat.h
│ ├── spi_lcd.c
│ └── spi_lcd.h
├── SDL_mixer-1.2.12
│ ├── CHANGES
│ ├── COPYING
│ ├── CWProjects.sea.bin
│ ├── MPWmake.sea.bin
│ ├── Makefile.in
│ ├── README
│ ├── SDL_mixer.h
│ ├── SDL_mixer.pc.in
│ ├── SDL_mixer.qpg.in
│ ├── SDL_mixer.spec
│ ├── SDL_mixer.spec.in
│ ├── acinclude
│ │ ├── libtool.m4
│ │ ├── ltdl.m4
│ │ ├── ltoptions.m4
│ │ ├── ltsugar.m4
│ │ ├── ltversion.m4
│ │ ├── lt~obsolete.m4
│ │ ├── pkg.m4
│ │ ├── sdl.m4
│ │ └── smpeg.m4
│ ├── component.mk
│ ├── dynamic_flac.c
│ ├── dynamic_flac.h
│ ├── dynamic_fluidsynth.c
│ ├── dynamic_fluidsynth.h
│ ├── dynamic_mod.c
│ ├── dynamic_mod.h
│ ├── dynamic_mp3.c
│ ├── dynamic_mp3.h
│ ├── dynamic_ogg.c
│ ├── dynamic_ogg.h
│ ├── effect_position.c
│ ├── effect_stereoreverse.c
│ ├── effects_internal.c
│ ├── effects_internal.h
│ ├── fluidsynth.c
│ ├── fluidsynth.h
│ ├── libmikmod-3.1.12.zip
│ ├── load_aiff.c
│ ├── load_aiff.h
│ ├── load_flac.c
│ ├── load_flac.h
│ ├── load_ogg.c
│ ├── load_ogg.h
│ ├── load_voc.c
│ ├── load_voc.h
│ ├── mixer.c
│ ├── music.c
│ ├── music_cmd.c
│ ├── music_cmd.h
│ ├── music_flac.c
│ ├── music_flac.h
│ ├── music_mad.c
│ ├── music_mad.h
│ ├── music_mod.c
│ ├── music_mod.h
│ ├── music_modplug.c
│ ├── music_modplug.h
│ ├── music_ogg.c
│ ├── music_ogg.h
│ ├── native_midi
│ │ ├── native_midi.h
│ │ ├── native_midi_common.c
│ │ ├── native_midi_common.h
│ │ ├── native_midi_haiku.cpp
│ │ ├── native_midi_mac.c
│ │ ├── native_midi_macosx.c
│ │ └── native_midi_win32.c
│ ├── playmus.c
│ ├── playwave.c
│ ├── timidity
│ │ ├── COPYING
│ │ ├── FAQ
│ │ ├── README
│ │ ├── common.c
│ │ ├── common.h
│ │ ├── config.h
│ │ ├── ctrlmode.c
│ │ ├── ctrlmode.h
│ │ ├── filter.c
│ │ ├── filter.h
│ │ ├── instrum.c
│ │ ├── instrum.h
│ │ ├── mix.c
│ │ ├── mix.h
│ │ ├── output.c
│ │ ├── output.h
│ │ ├── playmidi.c
│ │ ├── playmidi.h
│ │ ├── readmidi.c
│ │ ├── readmidi.h
│ │ ├── resample.c
│ │ ├── resample.h
│ │ ├── sdl_a.c
│ │ ├── sdl_c.c
│ │ ├── tables.c
│ │ ├── tables.h
│ │ ├── timidity.c
│ │ └── timidity.h
│ ├── version.rc
│ ├── wavestream.c
│ └── wavestream.h
├── dc
│ ├── dc_cd.cpp
│ ├── dc_main.cpp
│ ├── dc_main.h
│ ├── dc_maple.cpp
│ ├── dc_video.cpp
│ ├── dc_vmu.cpp
│ └── dc_vmu.h
└── wl_main
│ ├── audiosod.h
│ ├── audiowl6.h
│ ├── component.mk
│ ├── f_spear.h
│ ├── fmopl.cpp
│ ├── fmopl.h
│ ├── foreign.h
│ ├── gfxv_apo.h
│ ├── gfxv_sod.h
│ ├── gfxv_wl6.h
│ ├── gp2x.h
│ ├── id_ca.cpp
│ ├── id_ca.h
│ ├── id_in.cpp
│ ├── id_in.h
│ ├── id_pm.cpp
│ ├── id_pm.h
│ ├── id_sd.cpp
│ ├── id_sd.h
│ ├── id_us.h
│ ├── id_us_1.cpp
│ ├── id_vh.cpp
│ ├── id_vh.h
│ ├── id_vl.cpp
│ ├── id_vl.h
│ ├── sdl_winmain.cpp
│ ├── signon.cpp
│ ├── sodpal.inc
│ ├── version.h
│ ├── wl_act1.cpp
│ ├── wl_act2.cpp
│ ├── wl_agent.cpp
│ ├── wl_atmos.cpp
│ ├── wl_atmos.h
│ ├── wl_cloudsky.cpp
│ ├── wl_cloudsky.h
│ ├── wl_debug.cpp
│ ├── wl_def.h
│ ├── wl_dir3dspr.cpp
│ ├── wl_draw.cpp
│ ├── wl_floorceiling.cpp
│ ├── wl_game.cpp
│ ├── wl_inter.cpp
│ ├── wl_main.cpp
│ ├── wl_main.h
│ ├── wl_menu.cpp
│ ├── wl_menu.h
│ ├── wl_parallax.cpp
│ ├── wl_play.cpp
│ ├── wl_shade.cpp
│ ├── wl_shade.h
│ ├── wl_state.cpp
│ ├── wl_text.cpp
│ └── wolfpal.inc
├── config.default
├── images
├── Tile.data
├── Tile.png
├── TileSOD.png
├── tile.raw
└── tileSOD.raw
├── license-id.txt
├── license-mame.txt
├── main
├── app_main.cpp
└── component.mk
├── release
├── README.md
├── Spear Of Destiny Demo.fw
├── Spear Of Destiny.fw
├── Wolf3D_Full_APOGEE_1_1.fw
├── Wolf3D_Full_APOGEE_1_4.fw
├── Wolf3D_Full_ID_ACTIVISION_1_4.fw
├── Wolf3D_Shareware_1_0.fw
├── Wolf3D_Shareware_1_1.fw
├── Wolf3D_Shareware_1_2.fw
└── Wolf3D_Shareware_1_4.fw
├── sdkconfig
└── sdkconfig.old
/.gitignore:
--------------------------------------------------------------------------------
1 | .pioenvs
2 | .piolibdeps
3 | .vscode/.browse.c_cpp.db*
4 | .vscode/c_cpp_properties.json
5 | .vscode/launch.json
6 | build/*
7 | data/*
8 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This is a project Makefile. It is assumed the directory this Makefile resides in is a
3 | # project subdirectory.
4 | #
5 |
6 | PROJECT_NAME := Wolf3D
7 | #CFLAGS += -Wno-error=char-subscripts -Xlinker -Map=./output.map
8 |
9 | include $(IDF_PATH)/make/project.mk
10 |
--------------------------------------------------------------------------------
/README-devcpp.txt:
--------------------------------------------------------------------------------
1 | This file explains how you can compile Wolf4SDL using Bloodshed's Dev-C++.
2 | Keep in mind, that Dev-C++ is a dead project since 2005. The recommended way
3 | to compile Wolf4SDL on Windows is using Visual Studio 2005 C++ or the free
4 | Visual C++ 2005 Express. But for dial-up users Dev-C++ is probably still a
5 | good option.
6 |
7 | Needed files:
8 | - "Dev-C++ 5.0 Beta 9.2 (4.9.9.2)" with Mingw/GCC 3.4.2 (about 9 MB)
9 | http://www.bloodshed.net/dev/devcpp.html
10 | - SDL-1.2.13-1chaos.DevPak (544 kB)
11 | http://www.chaos-software.de.vu -> Downloads
12 | - SDL_mixer-1.2.6-2mol.DevPak (347 kB)
13 | http://sourceforge.net/project/showfiles.php?group_id=94270&package_id=151751
14 |
15 | Installation:
16 | - Install Dev-C++ to C:\Dev-Cpp
17 | - Open Wolf4SDL.dev
18 | - Go to "Tools" -> "Package Manager"
19 | - Click on the "Install" button in the toolbar
20 | - Select "SDL-1.2.13-1chaos.DevPak" (where ever you saved it)
21 | - Some "Next" buttons and a "Finish" button later...
22 | - Click on the "Install" button in the toolbar
23 | - Select "SDL_mixer-1.2.6-2mol.DevPak" (where ever you saved it)
24 | - Some "Next" buttons and a "Finish" button later...
25 | - Close the Package Manager
26 |
27 | Data file setup:
28 | - Copy the data files (e.g. *.WL6) you want to use to the Wolf4SDL
29 | source code folder
30 | - If you want to use the data files of the full Activision version of
31 | Wolfenstein 3D v1.4, you can just skip to the next section
32 | - Otherwise open "version.h" and comment/uncomment the definitions
33 | according to the description given in this file
34 |
35 | Compiling Wolf4SDL:
36 | - Compile via "Execute" -> "Compile"
37 | - No errors should be displayed
38 | - Run Wolf4SDL via "Execute" -> "Run"
39 |
40 | Troubleshooting:
41 | - If you get an error message "undefined reference to `__cpu_features_init'",
42 | make sure, there is no c:\mingw folder. Otherwise Dev-C++ will mix different
43 | versions of MinGW libraries...
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Wolf4SDL ESP32 Port
2 | by Gadget Workbench
3 |
4 | Demo video:
5 |
6 | (https://youtu.be/QCEx_Ir7iFU)
7 |
8 | Credits:
9 | --------
10 |
11 | Wolf4SDL by Moritz "Ripper" Kroll (http://www.chaos-software.de.vu)
12 |
13 | Original Wolfenstein 3D by id Software (http://www.idsoftware.com)
14 |
15 | Wolf4SDL is an open-source port of id Software's classic first-person shooter
16 | Wolfenstein 3D to the cross-plattform multimedia library "Simple DirectMedia
17 | Layer (SDL)" (http://www.libsdl.org). It is meant to keep the original feel
18 | while taking advantage of some improvements.
19 |
20 | Installation:
21 | -------------
22 |
23 | Wolfenstein 3D
24 |
25 | Game Data:
26 |
27 | - Put the game data for Wolfenstein 3D Full v1.4 GT/ID/Activision version in the folder:
28 |
29 | SD Card: /data/Wolfenstein 3D/base/
30 |
31 | Note - this is the same version and folder structure as the Steam version of Wolfenstein 3D. (https://store.steampowered.com/app/2270/Wolfenstein_3D/)
32 |
33 | Firmware:
34 |
35 | - Place the Wolf3D.fw file on your Odroid-Go SD card in the /odroid/firmware/ folder.
36 | - Power off the ODROID-GO, hold B, and power on the ODROID-GO.
37 | - When the ODROID-GO menu displays, select Wolf3D, press A, then press Start.
38 |
39 |
40 | Spear of Destiny
41 |
42 | Game Data:
43 |
44 | - Put the game data for Spear of Destiny Full and Mission Disks in the folder:
45 | SD Card: /data/Spear Of Destiny/base/
46 |
47 | Note - this is the same version and folder structure as the Steam version of Spear Of Destiny. (https://store.steampowered.com/app/9000/Spear_of_Destiny/)
48 |
49 | Firmware:
50 |
51 | - Place the Spear Of Destiny.fw file on your Odroid-Go SD card in the /odroid/firmware/ folder.
52 | - Power off the ODROID-GO, hold B, and power on the ODROID-GO.
53 | - When the ODROID-GO menu displays, select Spear Of Destiny, press A, then press Start.
54 |
55 | Mission Packs:
56 |
57 | - Hold Select during power on for Mission 2: Return to Danger
58 | - Hold Start during power on for Mission 3: Ultimate Challenge
59 |
60 | Sample folder format for the mission packs:
61 | ```
62 | /data/Spear Of Destiny/base/vswap.sod
63 | /data/Spear Of Destiny/base/vswap.sd1
64 | /data/Spear Of Destiny/base/vswap.sd2
65 |
66 | /data/Spear Of Destiny/base/gamemaps.sod
67 | /data/Spear Of Destiny/base/gamemaps.sd1
68 | /data/Spear Of Destiny/base/gamemaps.sd2
69 |
70 | /data/Spear Of Destiny/base/maphead.sod
71 | /data/Spear Of Destiny/base/maphead.sd1
72 | /data/Spear Of Destiny/base/maphead.sd2
73 | ```
74 |
75 | Licenses:
76 | ---------
77 |
78 | - The original source code of Wolfenstein 3D: license-id.txt
79 | - The OPL2 emulator (fmopl.cpp): license-mame.txt
80 | - ESP32 Parts by me are licensed under GNU General Public License v2.0 (see LICENSE).
81 | - SDL - Simple DirectMedia Layer license - see: /components/SDL/LICENSE
82 | - SDL-Mixer - GNU LESSER GENERAL PUBLIC LICENSE - see: /components/SDL_mixer-1.2.12/COPYING
83 |
--------------------------------------------------------------------------------
/build_release.sh:
--------------------------------------------------------------------------------
1 | make clean
2 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DGOODTIMES=1 -DCARMACIZED=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
3 | /Applications/ffmpeg -i ./images/Tile.png -f rawvideo -pix_fmt rgb565 ./images/tile.raw
4 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
5 | rm ./release/Wolf3D_Full_ID_ACTIVISION_1_4.fw
6 | mv firmware.fw ./release/Wolf3D_Full_ID_ACTIVISION_1_4.fw
7 |
8 | make clean
9 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DCARMACIZED=1 -DAPOGEE_1_1=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
10 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
11 | rm ./release/Wolf3D_Full_APOGEE_1_1.fw
12 | mv firmware.fw ./release/Wolf3D_Full_APOGEE_1_1.fw
13 |
14 | make clean
15 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DCARMACIZED=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
16 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
17 | rm ./release/Wolf3D_Full_APOGEE_1_4.fw
18 | mv firmware.fw ./release/Wolf3D_Full_APOGEE_1_4.fw
19 |
20 | make clean
21 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DUPLOAD=1 -DAPOGEE_1_0=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
22 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
23 | rm ./release/Wolf3D_Shareware_1_0.fw
24 | mv firmware.fw ./release/Wolf3D_Shareware_1_0.fw
25 |
26 | make clean
27 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DCARMACIZED=1 -DUPLOAD=1 -DAPOGEE_1_1=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
28 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
29 | rm ./release/Wolf3D_Shareware_1_1.fw
30 | mv firmware.fw ./release/Wolf3D_Shareware_1_1.fw
31 |
32 | make clean
33 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DCARMACIZED=1 -DUPLOAD=1 -DAPOGEE_1_2=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
34 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
35 | rm ./release/Wolf3D_Shareware_1_2.fw
36 | mv firmware.fw ./release/Wolf3D_Shareware_1_2.fw
37 |
38 | make clean
39 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DCARMACIZED=1 -DUPLOAD=1 -DDATADIR="\"/sd/data/Wolfenstein 3D/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
40 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw Wolf3D ./images/tile.raw 0 16 1048576 app ./build/Wolf3D.bin
41 | rm ./release/Wolf3D_Shareware_1_4.fw
42 | mv firmware.fw ./release/Wolf3D_Shareware_1_4.fw
43 |
44 | make clean
45 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DGOODTIMES=1 -DCARMACIZED=1 -DSPEAR=1 -DDATADIR="\"/sd/data/Spear Of Destiny/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
46 | /Applications/ffmpeg -i ./images/TileSOD.png -f rawvideo -pix_fmt rgb565 ./images/tileSOD.raw
47 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw SpearOfDestiny ./images/tileSOD.raw 0 16 1048576 app ./build/Wolf3D.bin
48 | rm ./release/Spear\ Of\ Destiny.fw
49 | mv firmware.fw ./release/Spear\ Of\ Destiny.fw
50 |
51 | make clean
52 | make -j2 EXTRA_CPPFLAGS='-DVERSIONALREADYCHOSEN=1 -DCARMACIZED=1 -DSPEAR=1 -DSPEARDEMO=1 -DDATADIR="\"/sd/data/Spear Of Destiny/base/\"" -DPLAYDEMOLIKEORIGINAL=1 -DDEMOSEXTERN=1 -DARTSEXTERN=1'
53 | ~/Documents/GitHub/odroid-go-firmware-20181001/tools/mkfw/mkfw SpearOfDestiny ./images/tileSOD.raw 0 16 1048576 app ./build/Wolf3D.bin
54 | rm ./release/Spear\ Of\ Destiny\ Demo.fw
55 | mv firmware.fw ./release/Spear\ Of\ Destiny\ Demo.fw
--------------------------------------------------------------------------------
/components/GP2X/fmopl.h:
--------------------------------------------------------------------------------
1 | #ifndef __FMOPL_H_
2 | #define __FMOPL_H_
3 |
4 | #define HAS_YM3812 1
5 |
6 | /* --- select emulation chips --- */
7 | #define BUILD_YM3812 (HAS_YM3812)
8 | #define BUILD_YM3526 (HAS_YM3526)
9 | #define BUILD_Y8950 (HAS_Y8950)
10 |
11 | /* select output bits size of output : 8 or 16 */
12 | #define OPL_SAMPLE_BITS 16
13 |
14 | /* compiler dependence */
15 | #ifndef OSD_CPU_H
16 | #define OSD_CPU_H
17 | typedef unsigned char UINT8; /* unsigned 8bit */
18 | typedef unsigned short UINT16; /* unsigned 16bit */
19 | typedef unsigned int UINT32; /* unsigned 32bit */
20 | typedef signed char INT8; /* signed 8bit */
21 | typedef signed short INT16; /* signed 16bit */
22 | typedef signed int INT32; /* signed 32bit */
23 | #endif
24 |
25 | #if (OPL_SAMPLE_BITS==16)
26 | typedef INT16 OPLSAMPLE;
27 | #endif
28 | #if (OPL_SAMPLE_BITS==8)
29 | typedef INT8 OPLSAMPLE;
30 | #endif
31 |
32 |
33 | typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec);
34 | typedef void (*OPL_IRQHANDLER)(int param,int irq);
35 | typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us);
36 | typedef void (*OPL_PORTHANDLER_W)(int param,unsigned char data);
37 | typedef unsigned char (*OPL_PORTHANDLER_R)(int param);
38 |
39 |
40 | #if BUILD_YM3812
41 |
42 | int YM3812Init(int num, int clock, int rate);
43 | void YM3812Shutdown(void);
44 | void YM3812ResetChip(int which);
45 | int YM3812Write(int which, int a, int v);
46 | unsigned char YM3812Read(int which, int a);
47 | int YM3812TimerOver(int which, int c);
48 | void YM3812UpdateOne(int which, INT16 *buffer, int length);
49 |
50 | void YM3812SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset);
51 | void YM3812SetIRQHandler(int which, OPL_IRQHANDLER IRQHandler, int param);
52 | void YM3812SetUpdateHandler(int which, OPL_UPDATEHANDLER UpdateHandler, int param);
53 |
54 | INT16 Amp( INT16 );
55 |
56 | #endif
57 |
58 | #endif
59 |
--------------------------------------------------------------------------------
/components/GP2X/fmopl_940/Makefile:
--------------------------------------------------------------------------------
1 |
2 | CROSS_COMPILE = /mythtv/media/devel/toolchains/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-
3 | LDFLAGS = -static
4 |
5 | CXX = $(CROSS_COMPILE)gcc
6 | CPP = $(CROSS_COMPILE)g++
7 | LD = $(CROSS_COMPILE)ld
8 | STRIP = $(CROSS_COMPILE)strip
9 |
10 | CXXFLAGS = -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -Wall -Werror -Os -fomit-frame-pointer
11 | LIBS = -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib
12 |
13 | CODE940_TARGET = code940.gpe
14 | CODE940_OBJS = main.o fmopl_core.o
15 |
16 | all : $(CODE940_TARGET)
17 |
18 | $(CODE940_TARGET) : $(CODE940_OBJS)
19 | $(LD) -marmelf -e code940 -Ttext 0x0 $(CODE940_OBJS) -o $(CODE940_TARGET)
20 | $(CROSS_COMPILE)objcopy -O binary code940.gpe code940.bin
21 | ls -l code940.bin
22 |
23 | main.o: main.c
24 | $(CXX) $(CXXFLAGS) -O0 -c main.c
25 |
26 | fmopl_core.o: fmopl_core.c fmopl_core.h fmopl_shared.h memory_layout.h
27 | $(CPP) $(CXXFLAGS) -Os -c fmopl_core.c
28 |
--------------------------------------------------------------------------------
/components/GP2X/fmopl_940/fmopl_core.h:
--------------------------------------------------------------------------------
1 | #ifndef __FMOPL_H_
2 | #define __FMOPL_H_
3 |
4 | #define HAS_YM3812 1
5 |
6 | /* --- select emulation chips --- */
7 | #define BUILD_YM3812 (HAS_YM3812)
8 | #define BUILD_YM3526 (HAS_YM3526)
9 | #define BUILD_Y8950 (HAS_Y8950)
10 |
11 | /* select output bits size of output : 8 or 16 */
12 | #define OPL_SAMPLE_BITS 16
13 |
14 | /* compiler dependence */
15 | #ifndef OSD_CPU_H
16 | #define OSD_CPU_H
17 | typedef unsigned char UINT8; /* unsigned 8bit */
18 | typedef unsigned short UINT16; /* unsigned 16bit */
19 | typedef unsigned int UINT32; /* unsigned 32bit */
20 | typedef signed char INT8; /* signed 8bit */
21 | typedef signed short INT16; /* signed 16bit */
22 | typedef signed int INT32; /* signed 32bit */
23 | #endif
24 |
25 | #if (OPL_SAMPLE_BITS==16)
26 | typedef INT16 OPLSAMPLE;
27 | #endif
28 | #if (OPL_SAMPLE_BITS==8)
29 | typedef INT8 OPLSAMPLE;
30 | #endif
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/components/GP2X/fmopl_940/main.c:
--------------------------------------------------------------------------------
1 | extern void fmopl_Init();
2 | extern int fmopl_core_control();
3 |
4 | void Main940();
5 |
6 | void code940(void) __attribute__((naked))
7 | {
8 | asm ("b .DzzBegin"); // reset, interrupt table
9 | asm ("b .DzzBegin");
10 | asm ("b .DzzBegin");
11 | asm ("b .DzzBegin");
12 | asm ("b .DzzBegin");
13 | asm ("b .DzzBegin");
14 | asm ("b .DzzBegin");
15 | asm ("b .DzzBegin");
16 | asm (".DzzBegin:");
17 | asm ("mov sp, #0x100000"); // set the stack top (1M)
18 | asm ("sub sp, sp, #4"); // minus 4
19 |
20 | // set up memory region 0 -- the whole 4GB address space
21 | asm ("mov r0, #63"); // region data
22 | asm ("mcr p15, 0, r0, c6, c0, 0");
23 | asm ("mcr p15, 0, r0, c6, c0, 1");
24 | // set up region 1 which is the first 2 megabytes.
25 | asm ("mov r0, #0x00000029"); // region data
26 | asm ("mcr p15, 0, r0, c6, c1, 0");
27 | asm ("mcr p15, 0, r0, c6, c1, 1");
28 | // set region 1 to be cacheable (so the first 2M will be cacheable)
29 | asm ("mov r0, #2");
30 | asm ("mcr p15, 0, r0, c2, c0, 0");
31 | asm ("mcr p15, 0, r0, c2, c0, 1");
32 | // set region 1 to be bufferable too (only data)
33 | asm ("mcr p15, 0, r0, c3, c0, 0");
34 | // set protection on for all regions
35 | asm ("mov r0, #15");
36 | asm ("mcr p15, 0, r0, c5, c0, 0");
37 | asm ("mcr p15, 0, r0, c5, c0, 1");
38 |
39 | asm ("mrc p15, 0, r0, c1, c0, 0"); // fetch current control reg
40 | asm ("orr r0, r0, #1"); // 0x00000001: enable protection unit
41 | asm ("orr r0, r0, #4"); // 0x00000004: enable D cache
42 | asm ("orr r0, r0, #0x1000"); // 0x00001000: enable I cache
43 | asm ("orr r0, r0, #0xC0000000"); // 0xC0000000: async+fastbus
44 | asm ("mcr p15, 0, r0, c1, c0, 0"); // set control reg
45 |
46 | Main940();
47 | }
48 |
49 | void Main940(void)
50 | {
51 | fmopl_Init();
52 |
53 | while(fmopl_core_control()) {};
54 | }
55 |
--------------------------------------------------------------------------------
/components/GP2X/fmopl_940/memory_layout.h:
--------------------------------------------------------------------------------
1 | /*
2 | memory layout for OPL2+OPL3
3 | */
4 |
5 | #define OPL2_MSG_BASE 0x200000
6 | #define OPL2_MSG_SIZE 0x100000
7 | #define OPL2_DAT_BASE 0x14C000
8 | #define OPL2_DAT_SIZE 0x14000
9 |
10 | #define OPL3_MSG_BASE 0x300000
11 | #define OPL3_MSG_SIZE 0x100000
12 | #define OPL3_DAT_BASE 0x160000
13 | #define OPL3_DAT_SIZE 0x40000
14 |
15 | #undef BUFF_BASE_ADDRESS
16 | #undef NSUB_OFFSET
17 | #undef NEX_OFFSET
18 | #undef MSG_BUF_OFFSET
19 | #undef BUFPOS_OFFSET
20 | #undef READPOS_OFFSET
21 | #undef DATA_OFFSET
22 | #undef FNTAB_OFFSET
23 | #undef END_OFFSET
24 |
25 | #undef DATA_BASE_ADDRESS
26 | #undef NUMCHIP_OFFSET
27 | #undef TL_TAB_OFFSET
28 | #undef SIN_TAB_OFFSET
29 | #undef OPL_OFFSET
30 | #undef END_OFFSET2
31 |
32 | #undef MSG_BUF_SIZE
33 | #undef SHARED_BUF_SIZE
34 | #undef OPL_SIZE
35 |
--------------------------------------------------------------------------------
/components/GP2X/gp2x.h:
--------------------------------------------------------------------------------
1 | #ifndef GP2X_H
2 | #define GP2X_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include "../wl_def.h"
11 | #if defined(GP2X_940)
12 | #include "fmopl.h"
13 | #include
14 | #endif
15 |
16 | #define GP2X_BUTTON_UP (0)
17 | #define GP2X_BUTTON_DOWN (4)
18 | #define GP2X_BUTTON_LEFT (2)
19 | #define GP2X_BUTTON_RIGHT (6)
20 | #define GP2X_BUTTON_UPLEFT (1)
21 | #define GP2X_BUTTON_UPRIGHT (7)
22 | #define GP2X_BUTTON_DOWNLEFT (3)
23 | #define GP2X_BUTTON_DOWNRIGHT (5)
24 | #define GP2X_BUTTON_CLICK (18)
25 | #define GP2X_BUTTON_A (12)
26 | #define GP2X_BUTTON_B (13)
27 | #define GP2X_BUTTON_X (14)
28 | #define GP2X_BUTTON_Y (15)
29 | #define GP2X_BUTTON_L (10)
30 | #define GP2X_BUTTON_R (11)
31 | #define GP2X_BUTTON_START (8)
32 | #define GP2X_BUTTON_SELECT (9)
33 | #define GP2X_BUTTON_VOLUP (16)
34 | #define GP2X_BUTTON_VOLDOWN (17)
35 |
36 | #define VOLUME_MIN 0
37 | #define VOLUME_MAX 100
38 | #define VOLUME_CHANGE_RATE 2
39 | #define VOLUME_NOCHG 0
40 | #define VOLUME_DOWN 1
41 | #define VOLUME_UP 2
42 | #define KEY_DOWN 1
43 | #define KEY_UP 0
44 |
45 | void GP2X_MemoryInit(void);
46 | void GP2X_Shutdown(void);
47 |
48 | void GP2X_AdjustVolume( int direction );
49 | void GP2X_ButtonDown( int button );
50 | void GP2X_ButtonUp( int button );
51 | void Screenshot( void );
52 | void SetKeyboard( unsigned int key, int press );
53 |
54 | #endif // GP2X_H
55 |
--------------------------------------------------------------------------------
/components/SDL/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2018 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
--------------------------------------------------------------------------------
/components/SDL/SDL.h:
--------------------------------------------------------------------------------
1 | #ifndef SDL_h_
2 | #define SDL_h_
3 | #include
4 | #include
5 | #include
6 |
7 | #include "SDL_system.h"
8 |
9 | #include "SDL_input.h"
10 | #include "SDL_stdinc.h"
11 | #include "SDL_endian.h"
12 | #include "SDL_audio.h"
13 | #include "SDL_wave.h"
14 |
15 | #include "SDL_video.h"
16 | #include "SDL_event.h"
17 |
18 | #include "SDL_scancode.h"
19 | #include "SDL_blit.h"
20 | #include "SDL_event.h"
21 |
22 | typedef int SDLMod;
23 | //typedef int SDL_Joystick;
24 |
25 | #define PLATFORM_ESP32 1
26 |
27 | #define SDLK_FIRST 0
28 | #define SDLK_LAST 1024
29 |
30 | #define SDLK_KP4 SDLK_LEFT
31 | #define SDLK_KP6 SDLK_RIGHT
32 | #define SDLK_KP8 SDLK_UP
33 | #define SDLK_KP2 SDLK_DOWN
34 | #define SDLK_KP5 SDLK_BACKSLASH
35 | #define SDLK_KP0 SDLK_RETURN
36 | #define SDLK_KP9 SDLK_PAGEUP
37 | #define SDLK_KP3 SDLK_PAGEDOWN
38 |
39 | #define SDLK_KP7 0
40 | #define SDLK_KP1 0
41 | #define SDLK_PRINT 0
42 |
43 | #define SDL_BUTTON_LEFT 0
44 | #define SDL_BUTTON_RIGHT 1
45 | #define SDL_BUTTON_MIDDLE 2
46 | #define SDLK_NUMLOCK 999
47 | #define SDLK_SCROLLOCK 1000
48 |
49 | #define SDL_strlcpy strlcpy
50 | #define SDL_snprintf snprintf
51 |
52 | #define SDL_INIT_TIMER 0x00000001u
53 | #define SDL_INIT_AUDIO 0x00000010u
54 | #define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
55 | #define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
56 | #define SDL_INIT_HAPTIC 0x00001000u
57 | #define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
58 | #define SDL_INIT_EVENTS 0x00004000u
59 | #define SDL_INIT_SENSOR 0x00008000u
60 | #define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
61 | #define SDL_INIT_EVERYTHING ( \
62 | SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
63 | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
64 | )
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/components/SDL/SDL_blit.h.old:
--------------------------------------------------------------------------------
1 | #ifndef SDL_BLIT_H
2 | #define SDL_BLIT_H
3 |
4 | #include "SDL.h"
5 | #include "SDL_video.h"
6 |
7 | /** typedef for private surface blitting functions */
8 | typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
9 | struct SDL_Surface *dst, SDL_Rect *dstrect);
10 |
11 | /* The structure passed to the low level blit functions */
12 | typedef struct {
13 | Uint8 *s_pixels;
14 | int s_width;
15 | int s_height;
16 | int s_skip;
17 | Uint8 *d_pixels;
18 | int d_width;
19 | int d_height;
20 | int d_skip;
21 | void *aux_data;
22 | SDL_PixelFormat *src;
23 | Uint8 *table;
24 | SDL_PixelFormat *dst;
25 | } SDL_BlitInfo;
26 |
27 | /* The type definition for the low level blit functions */
28 | typedef void (*SDL_loblit)(SDL_BlitInfo *info);
29 |
30 | /* This is the private info structure for software accelerated blits */
31 | struct private_swaccel {
32 | SDL_loblit blit;
33 | void *aux_data;
34 | };
35 |
36 |
37 | /* Blit mapping definition */
38 | typedef struct SDL_BlitMap {
39 | void *dst; //SDL_Surfce
40 | int identity;
41 | Uint8 *table;
42 | SDL_blit hw_blit;
43 | SDL_blit sw_blit;
44 | struct private_hwaccel *hw_data;
45 | struct private_swaccel *sw_data;
46 |
47 | /* the version count matches the destination; mismatch indicates
48 | an invalid mapping */
49 | unsigned int format_version;
50 | } SDL_BlitMap;
51 |
52 | #endif
--------------------------------------------------------------------------------
/components/SDL/SDL_config.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 |
23 | #ifndef _SDL_config_h
24 | #define _SDL_config_h
25 |
26 | //#include "SDL_platform.h"
27 |
28 | /* Add any platform that doesn't build using the configure system */
29 | #if defined(__DREAMCAST__)
30 | #include "SDL_config_dreamcast.h"
31 | #elif defined(__MACOS__)
32 | #include "SDL_config_macos.h"
33 | #elif defined(__MACOSX__)
34 | #include "SDL_config_macosx.h"
35 | #elif defined(__SYMBIAN32__)
36 | #include "SDL_config_symbian.h" /* must be before win32! */
37 | #elif defined(__WIN32__)
38 | #include "SDL_config_win32.h"
39 | #elif defined(__OS2__)
40 | #include "SDL_config_os2.h"
41 | #else
42 | #include "SDL_config_minimal.h"
43 | #endif /* platform config */
44 |
45 | #endif /* _SDL_config_h */
46 |
--------------------------------------------------------------------------------
/components/SDL/SDL_config_minimal.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 |
23 | #ifndef _SDL_config_minimal_h
24 | #define _SDL_config_minimal_h
25 |
26 | //#include "SDL_platform.h"
27 |
28 | /* This is the minimal configuration that can be used to build SDL */
29 |
30 | #include
31 |
32 | typedef signed char int8_t;
33 | typedef unsigned char uint8_t;
34 | typedef signed short int16_t;
35 | typedef unsigned short uint16_t;
36 | typedef signed int int32_t;
37 | typedef unsigned int uint32_t;
38 | typedef unsigned int size_t;
39 | //typedef unsigned long uintptr_t;
40 |
41 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
42 | #define SDL_AUDIO_DRIVER_DUMMY 1
43 |
44 | /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
45 | #define SDL_CDROM_DISABLED 1
46 |
47 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
48 | #define SDL_JOYSTICK_DISABLED 1
49 |
50 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
51 | #define SDL_LOADSO_DISABLED 1
52 |
53 | /* Enable the stub thread support (src/thread/generic/\*.c) */
54 | #define SDL_THREADS_DISABLED 1
55 |
56 | /* Enable the stub timer support (src/timer/dummy/\*.c) */
57 | #define SDL_TIMERS_DISABLED 1
58 |
59 | /* Enable the dummy video driver (src/video/dummy/\*.c) */
60 | #define SDL_VIDEO_DRIVER_DUMMY 1
61 |
62 | #endif /* _SDL_config_minimal_h */
63 |
--------------------------------------------------------------------------------
/components/SDL/SDL_dynapi.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2017 Sam Lantinga
4 | This software is provided 'as-is', without any express or implied
5 | warranty. In no event will the authors be held liable for any damages
6 | arising from the use of this software.
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 | 1. The origin of this software must not be misrepresented; you must not
11 | claim that you wrote the original software. If you use this software
12 | in a product, an acknowledgment in the product documentation would be
13 | appreciated but is not required.
14 | 2. Altered source versions must be plainly marked as such, and must not be
15 | misrepresented as being the original software.
16 | 3. This notice may not be removed or altered from any source distribution.
17 | */
18 |
19 | #ifndef SDL_dynapi_h_
20 | #define SDL_dynapi_h_
21 |
22 | /* IMPORTANT:
23 | This is the master switch to disabling the dynamic API. We made it so you
24 | have to hand-edit an internal source file in SDL to turn it off; you
25 | can do it if you want it badly enough, but hopefully you won't want to.
26 | You should understand the ramifications of turning this off: it makes it
27 | hard to update your SDL in the field, and impossible if you've statically
28 | linked SDL into your app. Understand that platforms change, and if we can't
29 | drop in an updated SDL, your application can definitely break some time
30 | in the future, even if it's fine today.
31 | To be sure, as new system-level video and audio APIs are introduced, an
32 | updated SDL can transparently take advantage of them, but your program will
33 | not without this feature. Think hard before turning it off.
34 | */
35 | #ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */
36 | #error Nope, you have to edit this file to force this off.
37 | #endif
38 |
39 | #ifdef __APPLE__
40 | #include "TargetConditionals.h"
41 | #endif
42 |
43 | #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* probably not useful on iOS. */
44 | #define SDL_DYNAMIC_API 0
45 | #elif defined(__native_client__) && __native_client__ /* probably not useful on NACL. */
46 | #define SDL_DYNAMIC_API 0
47 | #elif defined(__EMSCRIPTEN__) && __EMSCRIPTEN__ /* probably not useful on Emscripten. */
48 | #define SDL_DYNAMIC_API 0
49 | #elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT /* probably not useful on WinRT, given current .dll loading restrictions */
50 | #define SDL_DYNAMIC_API 0
51 | #elif defined(__PSP__) && __PSP__
52 | #define SDL_DYNAMIC_API 0
53 | #elif defined(__clang_analyzer__)
54 | #define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */
55 | #endif
56 |
57 | /* everyone else. This is where we turn on the API if nothing forced it off. */
58 | #ifndef SDL_DYNAMIC_API
59 | #define SDL_DYNAMIC_API 1
60 | #endif
61 |
62 | #endif
63 |
64 | /* vi: set ts=4 sw=4 expandtab: */
65 |
--------------------------------------------------------------------------------
/components/SDL/SDL_dynapi_overrides.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL/SDL_dynapi_overrides.h
--------------------------------------------------------------------------------
/components/SDL/SDL_error.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 |
23 | /**
24 | * @file SDL_error.h
25 | * Simple error message routines for SDL
26 | */
27 |
28 | #ifndef _SDL_error_h
29 | #define _SDL_error_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * @name Public functions
41 | */
42 | /*@{*/
43 | extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...);
44 | extern DECLSPEC const char * SDLCALL SDL_GetError(void);
45 | extern DECLSPEC void SDLCALL SDL_ClearError(void);
46 | /*@}*/
47 |
48 | /**
49 | * @name Private functions
50 | * @internal Private error message function - used internally
51 | */
52 | /*@{*/
53 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
54 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
55 | typedef enum {
56 | SDL_ENOMEM,
57 | SDL_EFREAD,
58 | SDL_EFWRITE,
59 | SDL_EFSEEK,
60 | SDL_UNSUPPORTED,
61 | SDL_LASTERROR
62 | } SDL_errorcode;
63 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
64 | /*@}*/
65 |
66 | /* Ends C function definitions when using C++ */
67 | #ifdef __cplusplus
68 | }
69 | #endif
70 | #include "close_code.h"
71 |
72 | #endif /* _SDL_error_h */
73 |
--------------------------------------------------------------------------------
/components/SDL/SDL_error_c.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 | #include "SDL_config.h"
23 |
24 | /* This file defines a structure that carries language-independent
25 | error messages
26 | */
27 |
28 | #ifndef _SDL_error_c_h
29 | #define _SDL_error_c_h
30 |
31 | #define ERR_MAX_STRLEN 128
32 | #define ERR_MAX_ARGS 5
33 |
34 | typedef struct SDL_error {
35 | /* This is a numeric value corresponding to the current error */
36 | int error;
37 |
38 | /* This is a key used to index into a language hashtable containing
39 | internationalized versions of the SDL error messages. If the key
40 | is not in the hashtable, or no hashtable is available, the key is
41 | used directly as an error message format string.
42 | */
43 | char key[ERR_MAX_STRLEN];
44 |
45 | /* These are the arguments for the error functions */
46 | int argc;
47 | union {
48 | void *value_ptr;
49 | #if 0 /* What is a character anyway? (UNICODE issues) */
50 | unsigned char value_c;
51 | #endif
52 | int value_i;
53 | double value_f;
54 | char buf[ERR_MAX_STRLEN];
55 | } args[ERR_MAX_ARGS];
56 | } SDL_error;
57 |
58 | #endif /* _SDL_error_c_h */
59 |
--------------------------------------------------------------------------------
/components/SDL/SDL_internal.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2018 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 | #ifndef SDL_internal_h_
22 | #define SDL_internal_h_
23 |
24 | /* Many of SDL's features require _GNU_SOURCE on various platforms */
25 | #ifndef _GNU_SOURCE
26 | #define _GNU_SOURCE
27 | #endif
28 |
29 | /* This is for a variable-length array at the end of a struct:
30 | struct x { int y; char z[SDL_VARIABLE_LENGTH_ARRAY]; };
31 | Use this because GCC 2 needs different magic than other compilers. */
32 | #if (defined(__GNUC__) && (__GNUC__ <= 2)) || defined(__CC_ARM) || defined(__cplusplus)
33 | #define SDL_VARIABLE_LENGTH_ARRAY 1
34 | #else
35 | #define SDL_VARIABLE_LENGTH_ARRAY
36 | #endif
37 |
38 | #include "SDL_dynapi.h"
39 |
40 | #if SDL_DYNAMIC_API
41 | #include "SDL_dynapi_overrides.h"
42 | /* force DECLSPEC and SDLCALL off...it's all internal symbols now.
43 | These will have actual #defines during SDL_dynapi.c only */
44 | #define DECLSPEC
45 | #define SDLCALL
46 | #endif
47 |
48 | //#include "SDL_config.h"
49 |
50 | #endif /* SDL_internal_h_ */
51 |
52 | /* vi: set ts=4 sw=4 expandtab: */
53 |
--------------------------------------------------------------------------------
/components/SDL/SDL_mutex.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL/SDL_mutex.h
--------------------------------------------------------------------------------
/components/SDL/SDL_system.h:
--------------------------------------------------------------------------------
1 | #ifndef SDL_system_h_
2 | #define SDL_system_h_
3 |
4 | #include "freertos/FreeRTOS.h"
5 | #include "freertos/task.h"
6 | #include "SDL_stdinc.h"
7 | #include "SDL.h"
8 |
9 | #include "esp_vfs_fat.h"
10 | #include "driver/sdmmc_host.h"
11 | #include "driver/sdspi_host.h"
12 |
13 | #include
14 | #include
15 |
16 | typedef struct {
17 | Uint8 major;
18 | Uint8 minor;
19 | Uint8 patch;
20 | } SDL_version;
21 |
22 | #define SDL_MAJOR_VERSION 2
23 | #define SDL_MINOR_VERSION 0
24 | #define SDL_PATCHLEVEL 9
25 |
26 | #define SDL_VERSION(x) \
27 | { \
28 | (x)->major = SDL_MAJOR_VERSION; \
29 | (x)->minor = SDL_MINOR_VERSION; \
30 | (x)->patch = SDL_PATCHLEVEL; \
31 | }
32 | const SDL_version* SDL_Linked_Version();
33 |
34 | int SDL_Init(Uint32 flags);
35 | void SDL_Quit(void);
36 |
37 | void SDL_Delay(Uint32 ms);
38 |
39 | const char *SDL_GetError(void);
40 |
41 | struct SDL_mutex;
42 | typedef struct SDL_mutex SDL_mutex;
43 |
44 | char *** allocateTwoDimenArrayOnHeapUsingMalloc(int row, int col);
45 |
46 | #define SDL_mutexP(mutex) SDL_LockMutex(mutex)
47 | #define SDL_mutexV(mutex) SDL_UnlockMutex(mutex)
48 |
49 | void SDL_DestroyMutex(SDL_mutex* mutex);
50 | SDL_mutex* SDL_CreateMutex(void);
51 | int SDL_LockMutex(SDL_mutex* mutex);
52 | int SDL_UnlockMutex(SDL_mutex* mutex);
53 |
54 | #define MODE_SPI 1
55 | void SDL_InitSD(void);
56 |
57 | void Check(const char *str);
58 |
59 | // File operations - safely lock/unlock display during operations...
60 | int __mkdir(const char *path, mode_t mode);
61 | FILE *__fopen( const char *path, const char *mode );
62 | long __ftell( FILE *f );
63 | int __feof ( FILE * stream );
64 | int __fputc ( int character, FILE * stream );
65 | int __fgetc ( FILE * stream );
66 | size_t __fwrite ( const void * ptr, size_t size, size_t count, FILE * stream );
67 | int __fclose ( FILE * stream );
68 | int __fseek( FILE * stream, long int offset, int origin );
69 | size_t __fread( void *buffer, size_t size, size_t num, FILE *stream );
70 | int __stat(const char *path, struct stat *buf);
71 |
72 | int __open(const char *path, int oflag, ... );
73 | int __close(int fildes);
74 | ssize_t __read(int fildes, void *buf, size_t nbyte);
75 | ssize_t __write(int fildes, const void *buf, size_t nbyte);
76 | off_t __lseek(int fd, off_t offset, int whence);
77 | int __unlink(const char *pathname);
78 | #endif
--------------------------------------------------------------------------------
/components/SDL/SDL_timer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL/SDL_timer.h
--------------------------------------------------------------------------------
/components/SDL/SDL_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 |
23 | /** @file SDL_types.h
24 | * @deprecated Use SDL_stdinc.h instead.
25 | */
26 |
27 | /* DEPRECATED */
28 | #include "SDL_stdinc.h"
29 |
--------------------------------------------------------------------------------
/components/SDL/SDL_version.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 |
23 | /** @file SDL_version.h
24 | * This header defines the current SDL version
25 | */
26 |
27 | #ifndef _SDL_version_h
28 | #define _SDL_version_h
29 |
30 | #include "SDL_stdinc.h"
31 |
32 |
33 | #endif /* _SDL_version_h */
34 |
--------------------------------------------------------------------------------
/components/SDL/SDL_wave.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL - Simple DirectMedia Layer
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This library is SDL_free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | Sam Lantinga
20 | slouken@libsdl.org
21 | */
22 | #include "SDL_config.h"
23 |
24 | #ifndef SDL_wave_h_
25 | #define SDL_wave_h_
26 |
27 | /* WAVE files are little-endian */
28 |
29 | /*******************************************/
30 | /* Define values for Microsoft WAVE format */
31 | /*******************************************/
32 | #define RIFF 0x46464952 /* "RIFF" */
33 | #define WAVE 0x45564157 /* "WAVE" */
34 | #define FACT 0x74636166 /* "fact" */
35 | #define LIST 0x5453494c /* "LIST" */
36 | #define FMT 0x20746D66 /* "fmt " */
37 | #define DATA 0x61746164 /* "data" */
38 | #define PCM_CODE 0x0001
39 | #define MS_ADPCM_CODE 0x0002
40 | #define IMA_ADPCM_CODE 0x0011
41 | #define MP3_CODE 0x0055
42 | #define WAVE_MONO 1
43 | #define WAVE_STEREO 2
44 |
45 | /* Normally, these three chunks come consecutively in a WAVE file */
46 | typedef struct {
47 | /* Not saved in the chunk we read:
48 | Uint32 FMTchunk;
49 | Uint32 fmtlen;
50 | */
51 | Uint16 encoding;
52 | Uint16 channels; /* 1 = mono, 2 = stereo */
53 | Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */
54 | Uint32 byterate; /* Average bytes per second */
55 | Uint16 blockalign; /* Bytes per sample block */
56 | Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
57 | } WaveFMT;
58 |
59 | /* The general chunk found in the WAVE file */
60 | typedef struct {
61 | Uint32 magic;
62 | Uint32 length;
63 | Uint8 *data;
64 | } Chunk;
65 |
66 | #endif
--------------------------------------------------------------------------------
/components/SDL/close_code.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2018 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file close_code.h
24 | *
25 | * This file reverses the effects of begin_code.h and should be included
26 | * after you finish any function and structure declarations in your headers
27 | */
28 |
29 | #undef _begin_code_h
30 |
31 | /* Reset structure packing at previous byte alignment */
32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
33 | #ifdef __BORLANDC__
34 | #pragma nopackwarning
35 | #endif
36 | #pragma pack(pop)
37 | #endif /* Compiler needs structure packing set */
--------------------------------------------------------------------------------
/components/SDL/component.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Component Makefile
3 | #
4 | # This Makefile should, at the very least, just include $(SDK_PATH)/make/component.mk. By default,
5 | # this will take the sources in the src/ directory, compile them and link them into
6 | # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
7 | # please read the SDK documents if you need to do this.
8 | #
9 |
10 | #include $(IDF_PATH)/make/component_common.mk
11 |
12 | COMPONENT_ADD_INCLUDEDIRS += ../SDL_mixer-1.2.12
13 |
--------------------------------------------------------------------------------
/components/SDL/esp32_compat.h:
--------------------------------------------------------------------------------
1 | #ifndef esp32_compat_h_
2 | #define esp32_compat_h_
3 |
4 | #include "stdint.h"
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | //#include
13 | #include
14 | #include
15 | #include
16 | #define HAVE_ASSERT_H 1
17 | #define PLATFORM_SUPPORTS_SDL
18 | #define kkfree(x) free(x)
19 | #define kkmalloc(x) malloc(x)
20 | #define kmalloc(x) malloc(x)
21 | #define strcmpi(x, y) strcasecmp(x, y)
22 | #define stricmp strcasecmp
23 | #define __int64 int64_t
24 | #define min(x,y) (((x) < (y)) ? (x) : (y))
25 | #define max(x,y) (((x) > (y)) ? (x) : (y))
26 | #define FP_OFF(x) ((int32_t) (x))
27 | #define O_BINARY 0
28 |
29 | #define BYTE_ORDER 1234
30 | #define HAVE_ENET_ENET_H 1
31 | #define UDP_NETWORKING 1
32 |
33 | #define SOL_SOCKET 0xffff
34 | #define SOL_IP SOL_SOCKET
35 |
36 | #define SO_BROADCAST 0x0020
37 | #define IP_RECVERR SO_BROADCAST
38 |
39 | #define USER_DUMMY_NETWORK 1
40 |
41 | #define STUBBED(x) fprintf(stderr,"STUB: %s (%s, %s:%d)\n",x,__FUNCTION__,__FILE__,__LINE__)
42 |
43 | #define getch getchar
44 | #define printchrasm(x,y,ch) printf("%c", (uint8_t ) (ch & 0xFF))
45 |
46 | #define Z_AvailHeap() ((4 * 1024) * 1024)
47 |
48 | #define mkdir(X) mkdir(X,0777)
49 | //#define PLATFORM_UNIX 1
50 | #define PLATFORM_ESP32 1
51 |
52 | #define MAX_PATH 255
53 |
54 | struct find_t
55 | {
56 | DIR *dir;
57 | char pattern[MAX_PATH];
58 | char name[MAX_PATH];
59 | };
60 | int _dos_findfirst(char *filename, int x, struct find_t *f);
61 | int _dos_findnext(struct find_t *f);
62 |
63 | struct dosdate_t
64 | {
65 | uint8_t day;
66 | uint8_t month;
67 | unsigned int year;
68 | uint8_t dayofweek;
69 | };
70 |
71 | void _dos_getdate(struct dosdate_t *date);
72 |
73 | #define PATH_SEP_CHAR '/'
74 | #define PATH_SEP_STR "/"
75 | #define ROOTDIR "/"
76 | #define CURDIR "./"
77 | #endif
--------------------------------------------------------------------------------
/components/SDL/spi_lcd.h:
--------------------------------------------------------------------------------
1 | #ifndef TFT_LCD_H
2 | #define TFT_LCD_H
3 | #include "stdint.h"
4 | #include "driver/ledc.h"
5 |
6 | void spi_lcd_wait_finish();
7 | void spi_lcd_send(uint16_t *scr);
8 | void spi_lcd_send_boarder(uint16_t *scr, int boarder);
9 | void spi_lcd_clear();
10 | void spi_lcd_init();
11 | extern int16_t lcdpal[256];
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/CHANGES:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/CHANGES
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/COPYING:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/CWProjects.sea.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/CWProjects.sea.bin
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/MPWmake.sea.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/MPWmake.sea.bin
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/README:
--------------------------------------------------------------------------------
1 |
2 | SDL_mixer 1.2
3 |
4 | The latest version of this library is available from:
5 | http://www.libsdl.org/projects/SDL_mixer/
6 |
7 | Due to popular demand, here is a simple multi-channel audio mixer.
8 | It supports 8 channels of 16 bit stereo audio, plus a single channel
9 | of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3
10 | libraries.
11 |
12 | See the header file SDL_mixer.h and the examples playwave.c and playmus.c
13 | for documentation on this mixer library.
14 |
15 | The mixer can currently load Microsoft WAVE files and Creative Labs VOC
16 | files as audio samples, and can load MIDI files via Timidity and the
17 | following music formats via MikMod: .MOD .S3M .IT .XM. It can load
18 | Ogg Vorbis streams as music if built with Ogg Vorbis or Tremor libraries,
19 | and finally it can load MP3 music using the SMPEG or libmad libraries.
20 |
21 | Tremor decoding is disabled by default; you can enable it by passing
22 | --enable-music-ogg-tremor
23 | to configure, or by defining OGG_MUSIC and OGG_USE_TREMOR.
24 |
25 | libmad decoding is disabled by default; you can enable it by passing
26 | --enable-music-mp3-mad
27 | to configure, or by defining MP3_MAD_MUSIC
28 | vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
29 | WARNING: The license for libmad is GPL, which means that in order to
30 | use it your application must also be GPL!
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 |
33 | The process of mixing MIDI files to wave output is very CPU intensive,
34 | so if playing regular WAVE files sound great, but playing MIDI files
35 | sound choppy, try using 8-bit audio, mono audio, or lower frequencies.
36 |
37 | To play MIDI files, you'll need to get a complete set of GUS patches
38 | from:
39 | http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz
40 | and unpack them in /usr/local/lib under UNIX, and C:\ under Win32.
41 |
42 | This library is under the zlib license, see the file "COPYING" for details.
43 |
44 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/SDL_mixer.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@prefix@
2 | exec_prefix=@exec_prefix@
3 | libdir=@libdir@
4 | includedir=@includedir@
5 |
6 | Name: SDL_mixer
7 | Description: mixer library for Simple DirectMedia Layer
8 | Version: @VERSION@
9 | Requires: sdl >= @SDL_VERSION@
10 | Libs: -L${libdir} -lSDL_mixer
11 | Cflags: -I${includedir}/SDL
12 |
13 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/SDL_mixer.spec:
--------------------------------------------------------------------------------
1 | %define name SDL_mixer
2 | %define version 1.2.12
3 | %define release 1
4 |
5 | Summary: Simple DirectMedia Layer - Sample Mixer Library
6 | Name: %{name}
7 | Version: %{version}
8 | Release: %{release}
9 | Source0: %{name}-%{version}.tar.gz
10 | License: LGPL
11 | Group: System Environment/Libraries
12 | BuildRoot: /var/tmp/%{name}-buildroot
13 | Prefix: %{_prefix}
14 |
15 | %description
16 | Due to popular demand, here is a simple multi-channel audio mixer.
17 | It supports 4 channels of 16 bit stereo audio, plus a single channel
18 | of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
19 | Tremor, SMPEG MP3, and libmad MP3 libraries.
20 |
21 | %package devel
22 | Summary: Libraries, includes and more to develop SDL applications.
23 | Group: Development/Libraries
24 | Requires: %{name}
25 |
26 | %description devel
27 | Due to popular demand, here is a simple multi-channel audio mixer.
28 | It supports 4 channels of 16 bit stereo audio, plus a single channel
29 | of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
30 | Tremor, SMPEG MP3, and libmad MP3 libraries.
31 |
32 | %prep
33 | %setup
34 |
35 | %build
36 | CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
37 | make
38 |
39 | %install
40 | rm -rf $RPM_BUILD_ROOT
41 | make install prefix=$RPM_BUILD_ROOT/%{prefix}
42 |
43 | %clean
44 | rm -rf $RPM_BUILD_ROOT
45 |
46 | %files
47 | %defattr(-,root,root)
48 | %doc README CHANGES COPYING
49 | %{prefix}/lib/lib*.so.*
50 |
51 | %files devel
52 | %defattr(-,root,root)
53 | %{prefix}/lib/lib*.a
54 | %{prefix}/lib/lib*.la
55 | %{prefix}/lib/lib*.so
56 | %{prefix}/include/SDL/
57 | %{prefix}/lib/pkgconfig/*.pc
58 |
59 | %changelog
60 | * Wed Jan 19 2000 Sam Lantinga
61 | - converted to get package information from configure
62 | * Sun Jan 16 2000 Hakan Tandogan
63 | - initial spec file
64 |
65 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/SDL_mixer.spec.in:
--------------------------------------------------------------------------------
1 | %define name SDL_mixer
2 | %define version @VERSION@
3 | %define release 1
4 |
5 | Summary: Simple DirectMedia Layer - Sample Mixer Library
6 | Name: %{name}
7 | Version: %{version}
8 | Release: %{release}
9 | Source0: %{name}-%{version}.tar.gz
10 | License: LGPL
11 | Group: System Environment/Libraries
12 | BuildRoot: /var/tmp/%{name}-buildroot
13 | Prefix: %{_prefix}
14 |
15 | %description
16 | Due to popular demand, here is a simple multi-channel audio mixer.
17 | It supports 4 channels of 16 bit stereo audio, plus a single channel
18 | of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
19 | Tremor, SMPEG MP3, and libmad MP3 libraries.
20 |
21 | %package devel
22 | Summary: Libraries, includes and more to develop SDL applications.
23 | Group: Development/Libraries
24 | Requires: %{name}
25 |
26 | %description devel
27 | Due to popular demand, here is a simple multi-channel audio mixer.
28 | It supports 4 channels of 16 bit stereo audio, plus a single channel
29 | of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis,
30 | Tremor, SMPEG MP3, and libmad MP3 libraries.
31 |
32 | %prep
33 | %setup
34 |
35 | %build
36 | CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
37 | make
38 |
39 | %install
40 | rm -rf $RPM_BUILD_ROOT
41 | make install prefix=$RPM_BUILD_ROOT/%{prefix}
42 |
43 | %clean
44 | rm -rf $RPM_BUILD_ROOT
45 |
46 | %files
47 | %defattr(-,root,root)
48 | %doc README CHANGES COPYING
49 | %{prefix}/lib/lib*.so.*
50 |
51 | %files devel
52 | %defattr(-,root,root)
53 | %{prefix}/lib/lib*.a
54 | %{prefix}/lib/lib*.la
55 | %{prefix}/lib/lib*.so
56 | %{prefix}/include/SDL/
57 | %{prefix}/lib/pkgconfig/*.pc
58 |
59 | %changelog
60 | * Wed Jan 19 2000 Sam Lantinga
61 | - converted to get package information from configure
62 | * Sun Jan 16 2000 Hakan Tandogan
63 | - initial spec file
64 |
65 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/acinclude/ltversion.m4:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # ltversion.m4 -- version numbers -*- Autoconf -*-
3 | #
4 | # Copyright (C) 2004 Free Software Foundation, Inc.
5 | # Written by Scott James Remnant, 2004
6 | #
7 | # This file is free software; the Free Software Foundation gives
8 | # unlimited permission to copy and/or distribute it, with or without
9 | # modifications, as long as this notice is preserved.
10 |
11 | # Generated from ltversion.in.
12 |
13 | # serial 3012 ltversion.m4
14 | # This file is part of GNU Libtool
15 |
16 | m4_define([LT_PACKAGE_VERSION], [2.2.6])
17 | m4_define([LT_PACKAGE_REVISION], [1.3012])
18 |
19 | AC_DEFUN([LTVERSION_VERSION],
20 | [macro_version='2.2.6'
21 | macro_revision='1.3012'
22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
23 | _LT_DECL(, macro_revision, 0)
24 | ])
25 |
26 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/component.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Component Makefile
3 | #
4 | # This Makefile should, at the very least, just include $(SDK_PATH)/make/component.mk. By default,
5 | # this will take the sources in the src/ directory, compile them and link them into
6 | # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
7 | # please read the SDK documents if you need to do this.
8 | #
9 |
10 | #include $(IDF_PATH)/make/component_common.mk
11 |
12 | COMPONENT_ADD_INCLUDEDIRS += ../SDL
13 | CFLAGS += -Wno-error=unused-label
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_flac.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | The following file defines all of the functions/objects used to dynamically
22 | link to the libFLAC library.
23 | ~ Austen Dicken (admin@cvpcs.org)
24 | */
25 |
26 | #ifdef FLAC_MUSIC
27 |
28 | #include
29 |
30 | typedef struct {
31 | int loaded;
32 | void *handle;
33 | FLAC__StreamDecoder *(*FLAC__stream_decoder_new)();
34 | void (*FLAC__stream_decoder_delete)(FLAC__StreamDecoder *decoder);
35 | FLAC__StreamDecoderInitStatus (*FLAC__stream_decoder_init_stream)(
36 | FLAC__StreamDecoder *decoder,
37 | FLAC__StreamDecoderReadCallback read_callback,
38 | FLAC__StreamDecoderSeekCallback seek_callback,
39 | FLAC__StreamDecoderTellCallback tell_callback,
40 | FLAC__StreamDecoderLengthCallback length_callback,
41 | FLAC__StreamDecoderEofCallback eof_callback,
42 | FLAC__StreamDecoderWriteCallback write_callback,
43 | FLAC__StreamDecoderMetadataCallback metadata_callback,
44 | FLAC__StreamDecoderErrorCallback error_callback,
45 | void *client_data);
46 | FLAC__bool (*FLAC__stream_decoder_finish)(FLAC__StreamDecoder *decoder);
47 | FLAC__bool (*FLAC__stream_decoder_flush)(FLAC__StreamDecoder *decoder);
48 | FLAC__bool (*FLAC__stream_decoder_process_single)(
49 | FLAC__StreamDecoder *decoder);
50 | FLAC__bool (*FLAC__stream_decoder_process_until_end_of_metadata)(
51 | FLAC__StreamDecoder *decoder);
52 | FLAC__bool (*FLAC__stream_decoder_process_until_end_of_stream)(
53 | FLAC__StreamDecoder *decoder);
54 | FLAC__bool (*FLAC__stream_decoder_seek_absolute)(
55 | FLAC__StreamDecoder *decoder,
56 | FLAC__uint64 sample);
57 | FLAC__StreamDecoderState (*FLAC__stream_decoder_get_state)(
58 | const FLAC__StreamDecoder *decoder);
59 | } flac_loader;
60 |
61 | extern flac_loader flac;
62 |
63 | #endif /* FLAC_MUSIC */
64 |
65 | extern int Mix_InitFLAC();
66 | extern void Mix_QuitFLAC();
67 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_fluidsynth.c:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | James Le Cuirot
22 | chewi@aura-online.co.uk
23 | */
24 |
25 | #ifdef USE_FLUIDSYNTH_MIDI
26 |
27 | #include "SDL_loadso.h"
28 | #include "dynamic_fluidsynth.h"
29 |
30 | fluidsynth_loader fluidsynth = {
31 | 0, NULL
32 | };
33 |
34 | #ifdef FLUIDSYNTH_DYNAMIC
35 | #define FLUIDSYNTH_LOADER(FUNC, SIG) \
36 | fluidsynth.FUNC = (SIG) SDL_LoadFunction(fluidsynth.handle, #FUNC); \
37 | if (fluidsynth.FUNC == NULL) { SDL_UnloadObject(fluidsynth.handle); return -1; }
38 | #else
39 | #define FLUIDSYNTH_LOADER(FUNC, SIG) \
40 | fluidsynth.FUNC = FUNC;
41 | #endif
42 |
43 | int Mix_InitFluidSynth()
44 | {
45 | if ( fluidsynth.loaded == 0 ) {
46 | #ifdef FLUIDSYNTH_DYNAMIC
47 | fluidsynth.handle = SDL_LoadObject(FLUIDSYNTH_DYNAMIC);
48 | if ( fluidsynth.handle == NULL ) return -1;
49 | #endif
50 |
51 | FLUIDSYNTH_LOADER(delete_fluid_player, int (*)(fluid_player_t*));
52 | FLUIDSYNTH_LOADER(delete_fluid_settings, void (*)(fluid_settings_t*));
53 | FLUIDSYNTH_LOADER(delete_fluid_synth, int (*)(fluid_synth_t*));
54 | FLUIDSYNTH_LOADER(fluid_player_add, int (*)(fluid_player_t*, const char*));
55 | FLUIDSYNTH_LOADER(fluid_player_add_mem, int (*)(fluid_player_t*, const void*, size_t));
56 | FLUIDSYNTH_LOADER(fluid_player_get_status, int (*)(fluid_player_t*));
57 | FLUIDSYNTH_LOADER(fluid_player_play, int (*)(fluid_player_t*));
58 | FLUIDSYNTH_LOADER(fluid_player_set_loop, int (*)(fluid_player_t*, int));
59 | FLUIDSYNTH_LOADER(fluid_player_stop, int (*)(fluid_player_t*));
60 | FLUIDSYNTH_LOADER(fluid_settings_setnum, int (*)(fluid_settings_t*, const char*, double));
61 | FLUIDSYNTH_LOADER(fluid_synth_get_settings, fluid_settings_t* (*)(fluid_synth_t*));
62 | FLUIDSYNTH_LOADER(fluid_synth_set_gain, void (*)(fluid_synth_t*, float));
63 | FLUIDSYNTH_LOADER(fluid_synth_sfload, int(*)(fluid_synth_t*, const char*, int));
64 | FLUIDSYNTH_LOADER(fluid_synth_write_s16, int(*)(fluid_synth_t*, int, void*, int, int, void*, int, int));
65 | FLUIDSYNTH_LOADER(new_fluid_player, fluid_player_t* (*)(fluid_synth_t*));
66 | FLUIDSYNTH_LOADER(new_fluid_settings, fluid_settings_t* (*)(void));
67 | FLUIDSYNTH_LOADER(new_fluid_synth, fluid_synth_t* (*)(fluid_settings_t*));
68 | }
69 | ++fluidsynth.loaded;
70 |
71 | return 0;
72 | }
73 |
74 | void Mix_QuitFluidSynth()
75 | {
76 | if ( fluidsynth.loaded == 0 ) {
77 | return;
78 | }
79 | if ( fluidsynth.loaded == 1 ) {
80 | #ifdef FLUIDSYNTH_DYNAMIC
81 | SDL_UnloadObject(fluidsynth.handle);
82 | #endif
83 | }
84 | --fluidsynth.loaded;
85 | }
86 |
87 | #endif /* USE_FLUIDSYNTH_MIDI */
88 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_fluidsynth.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | James Le Cuirot
22 | chewi@aura-online.co.uk
23 | */
24 |
25 | #ifdef USE_FLUIDSYNTH_MIDI
26 |
27 | #include
28 |
29 | typedef struct {
30 | int loaded;
31 | void *handle;
32 |
33 | int (*delete_fluid_player)(fluid_player_t*);
34 | void (*delete_fluid_settings)(fluid_settings_t*);
35 | int (*delete_fluid_synth)(fluid_synth_t*);
36 | int (*fluid_player_add)(fluid_player_t*, const char*);
37 | int (*fluid_player_add_mem)(fluid_player_t*, const void*, size_t);
38 | int (*fluid_player_get_status)(fluid_player_t*);
39 | int (*fluid_player_play)(fluid_player_t*);
40 | int (*fluid_player_set_loop)(fluid_player_t*, int);
41 | int (*fluid_player_stop)(fluid_player_t*);
42 | int (*fluid_settings_setnum)(fluid_settings_t*, const char*, double);
43 | fluid_settings_t* (*fluid_synth_get_settings)(fluid_synth_t*);
44 | void (*fluid_synth_set_gain)(fluid_synth_t*, float);
45 | int (*fluid_synth_sfload)(fluid_synth_t*, const char*, int);
46 | int (*fluid_synth_write_s16)(fluid_synth_t*, int, void*, int, int, void*, int, int);
47 | fluid_player_t* (*new_fluid_player)(fluid_synth_t*);
48 | fluid_settings_t* (*new_fluid_settings)(void);
49 | fluid_synth_t* (*new_fluid_synth)(fluid_settings_t*);
50 | } fluidsynth_loader;
51 |
52 | extern fluidsynth_loader fluidsynth;
53 |
54 | #endif /* USE_FLUIDSYNTH_MIDI */
55 |
56 | extern int Mix_InitFluidSynth();
57 | extern void Mix_QuitFluidSynth();
58 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_mod.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifdef MOD_MUSIC
23 |
24 | #include "mikmod.h"
25 |
26 | typedef struct {
27 | int loaded;
28 | void *handle;
29 |
30 | void (*MikMod_Exit)(void);
31 | CHAR* (*MikMod_InfoDriver)(void);
32 | CHAR* (*MikMod_InfoLoader)(void);
33 | BOOL (*MikMod_Init)(CHAR*);
34 | void (*MikMod_RegisterAllLoaders)(void);
35 | void (*MikMod_RegisterDriver)(struct MDRIVER*);
36 | int* MikMod_errno;
37 | char* (*MikMod_strerror)(int);
38 | BOOL (*Player_Active)(void);
39 | void (*Player_Free)(MODULE*);
40 | MODULE* (*Player_LoadGeneric)(MREADER*,int,BOOL);
41 | void (*Player_SetPosition)(UWORD);
42 | void (*Player_SetVolume)(SWORD);
43 | void (*Player_Start)(MODULE*);
44 | void (*Player_Stop)(void);
45 | ULONG (*VC_WriteBytes)(SBYTE*,ULONG);
46 | struct MDRIVER* drv_nos;
47 | UWORD* md_device;
48 | UWORD* md_mixfreq;
49 | UWORD* md_mode;
50 | UBYTE* md_musicvolume;
51 | UBYTE* md_pansep;
52 | UBYTE* md_reverb;
53 | UBYTE* md_sndfxvolume;
54 | UBYTE* md_volume;
55 | } mikmod_loader;
56 |
57 | extern mikmod_loader mikmod;
58 |
59 | #endif /* MOD_MUSIC */
60 |
61 | extern int Mix_InitMOD();
62 | extern void Mix_QuitMOD();
63 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_mp3.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifdef MP3_MUSIC
23 | #include "smpeg.h"
24 |
25 | typedef struct {
26 | int loaded;
27 | void *handle;
28 | void (*SMPEG_actualSpec)( SMPEG *mpeg, SDL_AudioSpec *spec );
29 | void (*SMPEG_delete)( SMPEG* mpeg );
30 | void (*SMPEG_enableaudio)( SMPEG* mpeg, int enable );
31 | void (*SMPEG_enablevideo)( SMPEG* mpeg, int enable );
32 | SMPEG* (*SMPEG_new_rwops)(SDL_RWops *src, SMPEG_Info* info, int sdl_audio);
33 | void (*SMPEG_play)( SMPEG* mpeg );
34 | int (*SMPEG_playAudio)( SMPEG *mpeg, Uint8 *stream, int len );
35 | void (*SMPEG_rewind)( SMPEG* mpeg );
36 | void (*SMPEG_setvolume)( SMPEG* mpeg, int volume );
37 | void (*SMPEG_skip)( SMPEG* mpeg, float seconds );
38 | SMPEGstatus (*SMPEG_status)( SMPEG* mpeg );
39 | void (*SMPEG_stop)( SMPEG* mpeg );
40 | } smpeg_loader;
41 |
42 | extern smpeg_loader smpeg;
43 |
44 | #endif /* MUSIC_MP3 */
45 |
46 | extern int Mix_InitMP3();
47 | extern void Mix_QuitMP3();
48 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_ogg.c:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifdef OGG_MUSIC
23 |
24 | #include "SDL_loadso.h"
25 |
26 | #include "dynamic_ogg.h"
27 |
28 | vorbis_loader vorbis = {
29 | 0, NULL
30 | };
31 |
32 | #ifdef OGG_DYNAMIC
33 | int Mix_InitOgg()
34 | {
35 | if ( vorbis.loaded == 0 ) {
36 | vorbis.handle = SDL_LoadObject(OGG_DYNAMIC);
37 | if ( vorbis.handle == NULL ) {
38 | return -1;
39 | }
40 | vorbis.ov_clear =
41 | (int (*)(OggVorbis_File *))
42 | SDL_LoadFunction(vorbis.handle, "ov_clear");
43 | if ( vorbis.ov_clear == NULL ) {
44 | SDL_UnloadObject(vorbis.handle);
45 | return -1;
46 | }
47 | vorbis.ov_info =
48 | (vorbis_info *(*)(OggVorbis_File *,int))
49 | SDL_LoadFunction(vorbis.handle, "ov_info");
50 | if ( vorbis.ov_info == NULL ) {
51 | SDL_UnloadObject(vorbis.handle);
52 | return -1;
53 | }
54 | vorbis.ov_open_callbacks =
55 | (int (*)(void *, OggVorbis_File *, char *, long, ov_callbacks))
56 | SDL_LoadFunction(vorbis.handle, "ov_open_callbacks");
57 | if ( vorbis.ov_open_callbacks == NULL ) {
58 | SDL_UnloadObject(vorbis.handle);
59 | return -1;
60 | }
61 | vorbis.ov_pcm_total =
62 | (ogg_int64_t (*)(OggVorbis_File *,int))
63 | SDL_LoadFunction(vorbis.handle, "ov_pcm_total");
64 | if ( vorbis.ov_pcm_total == NULL ) {
65 | SDL_UnloadObject(vorbis.handle);
66 | return -1;
67 | }
68 | vorbis.ov_read =
69 | #ifdef OGG_USE_TREMOR
70 | (long (*)(OggVorbis_File *,char *,int,int *))
71 | #else
72 | (long (*)(OggVorbis_File *,char *,int,int,int,int,int *))
73 | #endif
74 | SDL_LoadFunction(vorbis.handle, "ov_read");
75 | if ( vorbis.ov_read == NULL ) {
76 | SDL_UnloadObject(vorbis.handle);
77 | return -1;
78 | }
79 | vorbis.ov_time_seek =
80 | #ifdef OGG_USE_TREMOR
81 | (long (*)(OggVorbis_File *,ogg_int64_t))
82 | #else
83 | (int (*)(OggVorbis_File *,double))
84 | #endif
85 | SDL_LoadFunction(vorbis.handle, "ov_time_seek");
86 | if ( vorbis.ov_time_seek == NULL ) {
87 | SDL_UnloadObject(vorbis.handle);
88 | return -1;
89 | }
90 | }
91 | ++vorbis.loaded;
92 |
93 | return 0;
94 | }
95 | void Mix_QuitOgg()
96 | {
97 | if ( vorbis.loaded == 0 ) {
98 | return;
99 | }
100 | if ( vorbis.loaded == 1 ) {
101 | SDL_UnloadObject(vorbis.handle);
102 | }
103 | --vorbis.loaded;
104 | }
105 | #else
106 | int Mix_InitOgg()
107 | {
108 | if ( vorbis.loaded == 0 ) {
109 | vorbis.ov_clear = ov_clear;
110 | vorbis.ov_info = ov_info;
111 | vorbis.ov_open_callbacks = ov_open_callbacks;
112 | vorbis.ov_pcm_total = ov_pcm_total;
113 | vorbis.ov_read = ov_read;
114 | vorbis.ov_time_seek = ov_time_seek;
115 | }
116 | ++vorbis.loaded;
117 |
118 | return 0;
119 | }
120 | void Mix_QuitOgg()
121 | {
122 | if ( vorbis.loaded == 0 ) {
123 | return;
124 | }
125 | if ( vorbis.loaded == 1 ) {
126 | }
127 | --vorbis.loaded;
128 | }
129 | #endif /* OGG_DYNAMIC */
130 |
131 | #endif /* OGG_MUSIC */
132 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/dynamic_ogg.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifdef OGG_MUSIC
23 | #ifdef OGG_USE_TREMOR
24 | #include
25 | #else
26 | #include
27 | #endif
28 |
29 | typedef struct {
30 | int loaded;
31 | void *handle;
32 | int (*ov_clear)(OggVorbis_File *vf);
33 | vorbis_info *(*ov_info)(OggVorbis_File *vf,int link);
34 | int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
35 | ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i);
36 | #ifdef OGG_USE_TREMOR
37 | long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream);
38 | #else
39 | long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream);
40 | #endif
41 | #ifdef OGG_USE_TREMOR
42 | int (*ov_time_seek)(OggVorbis_File *vf,ogg_int64_t pos);
43 | #else
44 | int (*ov_time_seek)(OggVorbis_File *vf,double pos);
45 | #endif
46 | } vorbis_loader;
47 |
48 | extern vorbis_loader vorbis;
49 |
50 | #endif /* OGG_MUSIC */
51 |
52 | extern int Mix_InitOgg();
53 | extern void Mix_QuitOgg();
54 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/effect_stereoreverse.c:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | This file by Ryan C. Gordon (icculus@icculus.org)
22 |
23 | These are some internally supported special effects that use SDL_mixer's
24 | effect callback API. They are meant for speed over quality. :)
25 | */
26 |
27 | /* $Id$ */
28 |
29 | #include
30 | #include
31 |
32 | #include "SDL.h"
33 | #include "SDL_mixer.h"
34 |
35 | #define __MIX_INTERNAL_EFFECT__
36 | #include "effects_internal.h"
37 |
38 | /* profile code:
39 | #include
40 | #include
41 | struct timeval tv1;
42 | struct timeval tv2;
43 |
44 | gettimeofday(&tv1, NULL);
45 |
46 | ... do your thing here ...
47 |
48 | gettimeofday(&tv2, NULL);
49 | printf("%ld\n", tv2.tv_usec - tv1.tv_usec);
50 | */
51 |
52 |
53 |
54 | /*
55 | * Stereo reversal effect...this one's pretty straightforward...
56 | */
57 |
58 | static void _Eff_reversestereo16(int chan, void *stream, int len, void *udata)
59 | {
60 | /* 16 bits * 2 channels. */
61 | Uint32 *ptr = (Uint32 *) stream;
62 | int i;
63 |
64 | for (i = 0; i < len; i += sizeof (Uint32), ptr++) {
65 | *ptr = (((*ptr) & 0xFFFF0000) >> 16) | (((*ptr) & 0x0000FFFF) << 16);
66 | }
67 | }
68 |
69 |
70 | static void _Eff_reversestereo8(int chan, void *stream, int len, void *udata)
71 | {
72 | /* 8 bits * 2 channels. */
73 | Uint32 *ptr = (Uint32 *) stream;
74 | int i;
75 |
76 | /* get the last two bytes if len is not divisible by four... */
77 | if (len % sizeof (Uint32) != 0) {
78 | Uint16 *p = (Uint16 *) (((Uint8 *) stream) + (len - 2));
79 | *p = (Uint16)((((*p) & 0xFF00) >> 8) | (((*ptr) & 0x00FF) << 8));
80 | len -= 2;
81 | }
82 |
83 | for (i = 0; i < len; i += sizeof (Uint32), ptr++) {
84 | *ptr = (((*ptr) & 0x0000FF00) >> 8) | (((*ptr) & 0x000000FF) << 8) |
85 | (((*ptr) & 0xFF000000) >> 8) | (((*ptr) & 0x00FF0000) << 8);
86 | }
87 | }
88 |
89 |
90 | int Mix_SetReverseStereo(int channel, int flip)
91 | {
92 | Mix_EffectFunc_t f = NULL;
93 | int channels;
94 | Uint16 format;
95 |
96 | Mix_QuerySpec(NULL, &format, &channels);
97 |
98 | if (channels == 2) {
99 | if ((format & 0xFF) == 16)
100 | f = _Eff_reversestereo16;
101 | else if ((format & 0xFF) == 8)
102 | f = _Eff_reversestereo8;
103 | else {
104 | Mix_SetError("Unsupported audio format");
105 | return(0);
106 | }
107 |
108 | if (!flip) {
109 | return(Mix_UnregisterEffect(channel, f));
110 | } else {
111 | return(Mix_RegisterEffect(channel, f, NULL, NULL));
112 | }
113 | }
114 |
115 | return(1);
116 | }
117 |
118 |
119 | /* end of effect_stereoreverse.c ... */
120 |
121 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/effects_internal.c:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | This file by Ryan C. Gordon (icculus@icculus.org)
22 |
23 | These are some helper functions for the internal mixer special effects.
24 | */
25 |
26 | /* $Id$ */
27 |
28 |
29 | /* ------ These are used internally only. Don't touch. ------ */
30 |
31 |
32 |
33 | #include
34 | #include
35 | #include "SDL_mixer.h"
36 |
37 | #define __MIX_INTERNAL_EFFECT__
38 | #include "effects_internal.h"
39 |
40 | /* Should we favor speed over memory usage and/or quality of output? */
41 | int _Mix_effects_max_speed = 0;
42 |
43 |
44 | void _Mix_InitEffects(void)
45 | {
46 | _Mix_effects_max_speed = (SDL_getenv(MIX_EFFECTSMAXSPEED) != NULL);
47 | }
48 |
49 | void _Mix_DeinitEffects(void)
50 | {
51 | _Eff_PositionDeinit();
52 | }
53 |
54 |
55 | void *_Eff_volume_table = NULL;
56 |
57 |
58 | /* Build the volume table for Uint8-format samples.
59 | *
60 | * Each column of the table is a possible sample, while each row of the
61 | * table is a volume. Volume is a Uint8, where 0 is silence and 255 is full
62 | * volume. So _Eff_volume_table[128][mysample] would be the value of
63 | * mysample, at half volume.
64 | */
65 | void *_Eff_build_volume_table_u8(void)
66 | {
67 | int volume;
68 | int sample;
69 | Uint8 *rc;
70 |
71 | if (!_Mix_effects_max_speed) {
72 | return(NULL);
73 | }
74 |
75 | if (!_Eff_volume_table) {
76 | rc = SDL_malloc(256 * 256);
77 | if (rc) {
78 | _Eff_volume_table = (void *) rc;
79 | for (volume = 0; volume < 256; volume++) {
80 | for (sample = -128; sample < 128; sample ++) {
81 | *rc = (Uint8)(((float) sample) * ((float) volume / 255.0))
82 | + 128;
83 | rc++;
84 | }
85 | }
86 | }
87 | }
88 |
89 | return(_Eff_volume_table);
90 | }
91 |
92 |
93 | /* Build the volume table for Sint8-format samples.
94 | *
95 | * Each column of the table is a possible sample, while each row of the
96 | * table is a volume. Volume is a Uint8, where 0 is silence and 255 is full
97 | * volume. So _Eff_volume_table[128][mysample+128] would be the value of
98 | * mysample, at half volume.
99 | */
100 | void *_Eff_build_volume_table_s8(void)
101 | {
102 | int volume;
103 | int sample;
104 | Sint8 *rc;
105 |
106 | if (!_Eff_volume_table) {
107 | rc = SDL_malloc(256 * 256);
108 | if (rc) {
109 | _Eff_volume_table = (void *) rc;
110 | for (volume = 0; volume < 256; volume++) {
111 | for (sample = -128; sample < 128; sample ++) {
112 | *rc = (Sint8)(((float) sample) * ((float) volume / 255.0));
113 | rc++;
114 | }
115 | }
116 | }
117 | }
118 |
119 | return(_Eff_volume_table);
120 | }
121 |
122 |
123 | /* end of effects.c ... */
124 |
125 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/effects_internal.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /* $Id$ */
23 |
24 | #ifndef _INCLUDE_EFFECTS_INTERNAL_H_
25 | #define _INCLUDE_EFFECTS_INTERNAL_H_
26 |
27 | #ifndef __MIX_INTERNAL_EFFECT__
28 | #error You should not include this file or use these functions.
29 | #endif
30 |
31 | #include "SDL_mixer.h"
32 |
33 | /* Set up for C function definitions, even when using C++ */
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | extern int _Mix_effects_max_speed;
39 | extern void *_Eff_volume_table;
40 | void *_Eff_build_volume_table_u8(void);
41 | void *_Eff_build_volume_table_s8(void);
42 |
43 | void _Mix_InitEffects(void);
44 | void _Mix_DeinitEffects(void);
45 | void _Eff_PositionDeinit(void);
46 |
47 | int _Mix_RegisterEffect_locked(int channel, Mix_EffectFunc_t f,
48 | Mix_EffectDone_t d, void *arg);
49 | int _Mix_UnregisterEffect_locked(int channel, Mix_EffectFunc_t f);
50 | int _Mix_UnregisterAllEffects_locked(int channel);
51 |
52 |
53 | /* Set up for C function definitions, even when using C++ */
54 | #ifdef __cplusplus
55 | }
56 | #endif
57 |
58 |
59 | #endif
60 |
61 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/fluidsynth.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | James Le Cuirot
22 | chewi@aura-online.co.uk
23 | */
24 |
25 | #ifndef _FLUIDSYNTH_H_
26 | #define _FLUIDSYNTH_H_
27 |
28 | #ifdef USE_FLUIDSYNTH_MIDI
29 |
30 | #include "dynamic_fluidsynth.h"
31 | #include
32 | #include
33 |
34 | typedef struct {
35 | SDL_AudioCVT convert;
36 | fluid_synth_t *synth;
37 | fluid_player_t* player;
38 | } FluidSynthMidiSong;
39 |
40 | int fluidsynth_init(SDL_AudioSpec *mixer);
41 | FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw, int freerw);
42 | void fluidsynth_freesong(FluidSynthMidiSong *song);
43 | void fluidsynth_start(FluidSynthMidiSong *song);
44 | void fluidsynth_stop(FluidSynthMidiSong *song);
45 | int fluidsynth_active(FluidSynthMidiSong *song);
46 | void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume);
47 | int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len);
48 |
49 | #endif /* USE_FLUIDSYNTH_MIDI */
50 |
51 | #endif /* _FLUIDSYNTH_H_ */
52 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/libmikmod-3.1.12.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/libmikmod-3.1.12.zip
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/load_aiff.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/load_aiff.c
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/load_aiff.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/load_aiff.h
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/load_flac.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | This is the source needed to decode a FLAC into a waveform.
22 | ~ Austen Dicken (admin@cvpcs.org).
23 | */
24 |
25 | /* $Id: $ */
26 |
27 | #ifdef FLAC_MUSIC
28 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
29 | SDL_AudioSpec *Mix_LoadFLAC_RW (SDL_RWops *src, int freesrc,
30 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
31 | #endif
32 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/load_ogg.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | This is the source needed to decode an Ogg Vorbis into a waveform.
22 | This file by Vaclav Slavik (vaclav.slavik@matfyz.cz).
23 | */
24 |
25 | /* $Id$ */
26 |
27 | #ifdef OGG_MUSIC
28 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
29 | SDL_AudioSpec *Mix_LoadOGG_RW (SDL_RWops *src, int freesrc,
30 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
31 | #endif
32 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/load_voc.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | This is the source needed to decode a Creative Labs VOC file into a
22 | waveform. It's pretty straightforward once you get going. The only
23 | externally-callable function is Mix_LoadVOC_RW(), which is meant to
24 | act as identically to SDL_LoadWAV_RW() as possible.
25 |
26 | This file by Ryan C. Gordon (icculus@icculus.org).
27 |
28 | Heavily borrowed from sox v12.17.1's voc.c.
29 | (http://www.freshmeat.net/projects/sox/)
30 | */
31 |
32 | /* $Id$ */
33 |
34 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */
35 | SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc,
36 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
37 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/music_cmd.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /* This file supports an external command for playing music */
23 |
24 | #ifdef CMD_MUSIC
25 |
26 | #include
27 | #include
28 | #include
29 | #if defined(__linux__) && defined(__arm__)
30 | # include
31 | #endif
32 | typedef struct {
33 | char file[PATH_MAX];
34 | char cmd[PATH_MAX];
35 | pid_t pid;
36 | } MusicCMD;
37 |
38 | /* Unimplemented */
39 | extern void MusicCMD_SetVolume(int volume);
40 |
41 | /* Load a music stream from the given file */
42 | extern MusicCMD *MusicCMD_LoadSong(const char *cmd, const char *file);
43 |
44 | /* Start playback of a given music stream */
45 | extern void MusicCMD_Start(MusicCMD *music);
46 |
47 | /* Stop playback of a stream previously started with MusicCMD_Start() */
48 | extern void MusicCMD_Stop(MusicCMD *music);
49 |
50 | /* Pause playback of a given music stream */
51 | extern void MusicCMD_Pause(MusicCMD *music);
52 |
53 | /* Resume playback of a given music stream */
54 | extern void MusicCMD_Resume(MusicCMD *music);
55 |
56 | /* Close the given music stream */
57 | extern void MusicCMD_FreeSong(MusicCMD *music);
58 |
59 | /* Return non-zero if a stream is currently playing */
60 | extern int MusicCMD_Active(MusicCMD *music);
61 |
62 | #endif /* CMD_MUSIC */
63 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/music_flac.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 | Header to handle loading FLAC music files in SDL.
22 | ~ Austen Dicken (admin@cvpcs.org)
23 | */
24 |
25 | /* $Id: $ */
26 |
27 | #ifdef FLAC_MUSIC
28 |
29 | #include
30 |
31 | typedef struct {
32 | FLAC__uint64 sample_size;
33 | unsigned sample_rate;
34 | unsigned channels;
35 | unsigned bits_per_sample;
36 | FLAC__uint64 total_samples;
37 |
38 | // the following are used to handle the callback nature of the writer
39 | int max_to_read;
40 | char *data; // pointer to beginning of data array
41 | int data_len; // size of data array
42 | int data_read; // amount of data array used
43 | char *overflow; // pointer to beginning of overflow array
44 | int overflow_len; // size of overflow array
45 | int overflow_read; // amount of overflow array used
46 | } FLAC_Data;
47 |
48 | typedef struct {
49 | int playing;
50 | int volume;
51 | int section;
52 | FLAC__StreamDecoder *flac_decoder;
53 | FLAC_Data flac_data;
54 | SDL_RWops *rwops;
55 | int freerw;
56 | SDL_AudioCVT cvt;
57 | int len_available;
58 | Uint8 *snd_available;
59 | } FLAC_music;
60 |
61 | /* Initialize the FLAC player, with the given mixer settings
62 | This function returns 0, or -1 if there was an error.
63 | */
64 | extern int FLAC_init(SDL_AudioSpec *mixer);
65 |
66 | /* Set the volume for a FLAC stream */
67 | extern void FLAC_setvolume(FLAC_music *music, int volume);
68 |
69 | /* Load an FLAC stream from an SDL_RWops object */
70 | extern FLAC_music *FLAC_new_RW(SDL_RWops *rw, int freerw);
71 |
72 | /* Start playback of a given FLAC stream */
73 | extern void FLAC_play(FLAC_music *music);
74 |
75 | /* Return non-zero if a stream is currently playing */
76 | extern int FLAC_playing(FLAC_music *music);
77 |
78 | /* Play some of a stream previously started with FLAC_play() */
79 | extern int FLAC_playAudio(FLAC_music *music, Uint8 *stream, int len);
80 |
81 | /* Stop playback of a stream previously started with FLAC_play() */
82 | extern void FLAC_stop(FLAC_music *music);
83 |
84 | /* Close the given FLAC stream */
85 | extern void FLAC_delete(FLAC_music *music);
86 |
87 | /* Jump (seek) to a given position (time is in seconds) */
88 | extern void FLAC_jump_to_time(FLAC_music *music, double time);
89 |
90 | #endif /* FLAC_MUSIC */
91 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/music_mad.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifdef MP3_MAD_MUSIC
23 |
24 | #include "mad.h"
25 | #include "SDL_rwops.h"
26 | #include "SDL_audio.h"
27 | #include "SDL_mixer.h"
28 |
29 | #define MAD_INPUT_BUFFER_SIZE (5*8192)
30 | #define MAD_OUTPUT_BUFFER_SIZE 8192
31 |
32 | enum {
33 | MS_input_eof = 0x0001,
34 | MS_input_error = 0x0001,
35 | MS_decode_eof = 0x0002,
36 | MS_decode_error = 0x0004,
37 | MS_error_flags = 0x000f,
38 |
39 | MS_playing = 0x0100,
40 | MS_cvt_decoded = 0x0200,
41 | };
42 |
43 | typedef struct {
44 | SDL_RWops *rw;
45 | int freerw;
46 | struct mad_stream stream;
47 | struct mad_frame frame;
48 | struct mad_synth synth;
49 | int frames_read;
50 | mad_timer_t next_frame_start;
51 | int volume;
52 | int status;
53 | int output_begin, output_end;
54 | SDL_AudioSpec mixer;
55 | SDL_AudioCVT cvt;
56 |
57 | unsigned char input_buffer[MAD_INPUT_BUFFER_SIZE + MAD_BUFFER_GUARD];
58 | unsigned char output_buffer[MAD_OUTPUT_BUFFER_SIZE];
59 | } mad_data;
60 |
61 | mad_data *mad_openFileRW(SDL_RWops *rw, SDL_AudioSpec *mixer, int freerw);
62 | void mad_closeFile(mad_data *mp3_mad);
63 |
64 | void mad_start(mad_data *mp3_mad);
65 | void mad_stop(mad_data *mp3_mad);
66 | int mad_isPlaying(mad_data *mp3_mad);
67 |
68 | int mad_getSamples(mad_data *mp3_mad, Uint8 *stream, int len);
69 | void mad_seek(mad_data *mp3_mad, double position);
70 | void mad_setVolume(mad_data *mp3_mad, int volume);
71 |
72 | #endif
73 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/music_mod.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /* $Id: music_mod.h 4211 2008-12-08 00:27:32Z slouken $ */
23 |
24 | #ifdef MOD_MUSIC
25 |
26 | /* This file supports MOD tracker music streams */
27 |
28 | struct MODULE;
29 |
30 | /* Initialize the Ogg Vorbis player, with the given mixer settings
31 | This function returns 0, or -1 if there was an error.
32 | */
33 | extern int MOD_init(SDL_AudioSpec *mixer);
34 |
35 | /* Uninitialize the music players */
36 | extern void MOD_exit(void);
37 |
38 | /* Set the volume for a MOD stream */
39 | extern void MOD_setvolume(struct MODULE *music, int volume);
40 |
41 | /* Load a MOD stream from an SDL_RWops object */
42 | extern struct MODULE *MOD_new_RW(SDL_RWops *rw, int freerw);
43 |
44 | /* Start playback of a given MOD stream */
45 | extern void MOD_play(struct MODULE *music);
46 |
47 | /* Return non-zero if a stream is currently playing */
48 | extern int MOD_playing(struct MODULE *music);
49 |
50 | /* Play some of a stream previously started with MOD_play() */
51 | extern int MOD_playAudio(struct MODULE *music, Uint8 *stream, int len);
52 |
53 | /* Stop playback of a stream previously started with MOD_play() */
54 | extern void MOD_stop(struct MODULE *music);
55 |
56 | /* Close the given MOD stream */
57 | extern void MOD_delete(struct MODULE *music);
58 |
59 | /* Jump (seek) to a given position (time is in seconds) */
60 | extern void MOD_jump_to_time(struct MODULE *music, double time);
61 |
62 | #endif /* MOD_MUSIC */
63 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/music_modplug.h:
--------------------------------------------------------------------------------
1 | #ifdef MODPLUG_MUSIC
2 |
3 | #include "modplug.h"
4 | #include "SDL_rwops.h"
5 | #include "SDL_audio.h"
6 | #include "SDL_mixer.h"
7 |
8 | typedef struct {
9 | ModPlugFile *file;
10 | int playing;
11 | } modplug_data;
12 |
13 | int modplug_init(SDL_AudioSpec *mixer);
14 |
15 | /* Uninitialize the music players */
16 | void modplug_exit(void);
17 |
18 | /* Set the volume for a modplug stream */
19 | void modplug_setvolume(modplug_data *music, int volume);
20 |
21 | /* Load a modplug stream from an SDL_RWops object */
22 | modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw);
23 |
24 | /* Start playback of a given modplug stream */
25 | void modplug_play(modplug_data *music);
26 |
27 | /* Return non-zero if a stream is currently playing */
28 | int modplug_playing(modplug_data *music);
29 |
30 | /* Play some of a stream previously started with modplug_play() */
31 | int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
32 |
33 | /* Stop playback of a stream previously started with modplug_play() */
34 | void modplug_stop(modplug_data *music);
35 |
36 | /* Close the given modplug stream */
37 | void modplug_delete(modplug_data *music);
38 |
39 | /* Jump (seek) to a given position (time is in seconds) */
40 | void modplug_jump_to_time(modplug_data *music, double time);
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/music_ogg.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /* $Id$ */
23 |
24 | #ifdef OGG_MUSIC
25 |
26 | /* This file supports Ogg Vorbis music streams */
27 |
28 | #ifdef OGG_USE_TREMOR
29 | #include
30 | #else
31 | #include
32 | #endif
33 |
34 | typedef struct {
35 | SDL_RWops *rw;
36 | int freerw;
37 | int playing;
38 | int volume;
39 | OggVorbis_File vf;
40 | int section;
41 | SDL_AudioCVT cvt;
42 | int len_available;
43 | Uint8 *snd_available;
44 | } OGG_music;
45 |
46 | /* Initialize the Ogg Vorbis player, with the given mixer settings
47 | This function returns 0, or -1 if there was an error.
48 | */
49 | extern int OGG_init(SDL_AudioSpec *mixer);
50 |
51 | /* Set the volume for an OGG stream */
52 | extern void OGG_setvolume(OGG_music *music, int volume);
53 |
54 | /* Load an OGG stream from an SDL_RWops object */
55 | extern OGG_music *OGG_new_RW(SDL_RWops *rw, int freerw);
56 |
57 | /* Start playback of a given OGG stream */
58 | extern void OGG_play(OGG_music *music);
59 |
60 | /* Return non-zero if a stream is currently playing */
61 | extern int OGG_playing(OGG_music *music);
62 |
63 | /* Play some of a stream previously started with OGG_play() */
64 | extern int OGG_playAudio(OGG_music *music, Uint8 *stream, int len);
65 |
66 | /* Stop playback of a stream previously started with OGG_play() */
67 | extern void OGG_stop(OGG_music *music);
68 |
69 | /* Close the given OGG stream */
70 | extern void OGG_delete(OGG_music *music);
71 |
72 | /* Jump (seek) to a given position (time is in seconds) */
73 | extern void OGG_jump_to_time(OGG_music *music, double time);
74 |
75 | #endif /* OGG_MUSIC */
76 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/native_midi/native_midi.h:
--------------------------------------------------------------------------------
1 | /*
2 | native_midi: Hardware Midi support for the SDL_mixer library
3 | Copyright (C) 2000 Florian 'Proff' Schulze
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _NATIVE_MIDI_H_
23 | #define _NATIVE_MIDI_H_
24 |
25 | #include
26 |
27 | typedef struct _NativeMidiSong NativeMidiSong;
28 |
29 | int native_midi_detect();
30 | NativeMidiSong *native_midi_loadsong_RW(SDL_RWops *rw, int freerw);
31 | void native_midi_freesong(NativeMidiSong *song);
32 | void native_midi_start(NativeMidiSong *song, int loops);
33 | void native_midi_stop();
34 | int native_midi_active();
35 | void native_midi_setvolume(int volume);
36 | const char *native_midi_error(void);
37 |
38 | #endif /* _NATIVE_MIDI_H_ */
39 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/native_midi/native_midi_common.h:
--------------------------------------------------------------------------------
1 | /*
2 | native_midi: Hardware Midi support for the SDL_mixer library
3 | Copyright (C) 2000,2001 Florian 'Proff' Schulze
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _NATIVE_MIDI_COMMON_H_
23 | #define _NATIVE_MIDI_COMMON_H_
24 |
25 | #include "SDL.h"
26 |
27 | /* Midi Status Bytes */
28 | #define MIDI_STATUS_NOTE_OFF 0x8
29 | #define MIDI_STATUS_NOTE_ON 0x9
30 | #define MIDI_STATUS_AFTERTOUCH 0xA
31 | #define MIDI_STATUS_CONTROLLER 0xB
32 | #define MIDI_STATUS_PROG_CHANGE 0xC
33 | #define MIDI_STATUS_PRESSURE 0xD
34 | #define MIDI_STATUS_PITCH_WHEEL 0xE
35 | #define MIDI_STATUS_SYSEX 0xF
36 |
37 | /* We store the midi events in a linked list; this way it is
38 | easy to shuffle the tracks together later on; and we are
39 | flexible in the size of each elemnt.
40 | */
41 | typedef struct MIDIEvent
42 | {
43 | Uint32 time; /* Time at which this midi events occurs */
44 | Uint8 status; /* Status byte */
45 | Uint8 data[2]; /* 1 or 2 bytes additional data for most events */
46 |
47 | Uint32 extraLen; /* For some SysEx events, we need additional storage */
48 | Uint8 *extraData;
49 |
50 | struct MIDIEvent *next;
51 | } MIDIEvent;
52 |
53 |
54 | /* Load a midifile to memory, converting it to a list of MIDIEvents.
55 | This function returns a linked lists of MIDIEvents, 0 if an error occured.
56 | */
57 | MIDIEvent *CreateMIDIEventList(SDL_RWops *rw, Uint16 *division);
58 |
59 | /* Release a MIDIEvent list after usage. */
60 | void FreeMIDIEventList(MIDIEvent *head);
61 |
62 |
63 | #endif /* _NATIVE_MIDI_COMMON_H_ */
64 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/README:
--------------------------------------------------------------------------------
1 | [This version of timidity has been stripped for simplicity in porting to SDL]
2 | ---------------------------------*-text-*---------------------------------
3 |
4 | From http://www.cgs.fi/~tt/discontinued.html :
5 |
6 | If you'd like to continue hacking on TiMidity, feel free. I'm
7 | hereby extending the TiMidity license agreement: you can now
8 | select the most convenient license for your needs from (1) the
9 | GNU GPL, (2) the GNU LGPL, or (3) the Perl Artistic License.
10 |
11 | --------------------------------------------------------------------------
12 |
13 | This is the README file for TiMidity v0.2i
14 |
15 | TiMidity is a MIDI to WAVE converter that uses Gravis
16 | Ultrasound(*)-compatible patch files to generate digital audio data
17 | from General MIDI files. The audio data can be played through any
18 | sound device or stored on disk. On a fast machine, music can be
19 | played in real time. TiMidity runs under Linux, FreeBSD, HP-UX, SunOS, and
20 | Win32, and porting to other systems with gcc should be easy.
21 |
22 | TiMidity Features:
23 |
24 | * 32 or more dynamically allocated fully independent voices
25 | * Compatibility with GUS patch files
26 | * Output to 16- or 8-bit PCM or uLaw audio device, file, or
27 | stdout at any sampling rate
28 | * Optional interactive mode with real-time status display
29 | under ncurses and SLang terminal control libraries. Also
30 | a user friendly motif interface since version 0.2h
31 | * Support for transparent loading of compressed MIDI files and
32 | patch files
33 |
34 | * Support for the following MIDI events:
35 | - Program change
36 | - Key pressure
37 | - Channel main volume
38 | - Tempo
39 | - Panning
40 | - Damper pedal (Sustain)
41 | - Pitch wheel
42 | - Pitch wheel sensitivity
43 | - Change drum set
44 |
45 | * TiMidity requires sampled instruments (patches) to play MIDI files. You
46 | should get the file "timidity-lib-0.1.tar.gz" and unpack it in the same
47 | directory where you unpacked the source code archive. You'll want more
48 | patches later -- read the file "FAQ" for pointers.
49 |
50 | * Timidity is no longer supported, but can be found by searching the web.
51 |
52 |
53 | Tuukka Toivonen
54 |
55 | [(*) Any Registered Trademarks used anywhere in the documentation or
56 | source code for TiMidity are acknowledged as belonging to their
57 | respective owners.]
58 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/common.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | #include
10 |
11 | #ifndef PATH_MAX /* GNU Hurd doesn't limit path size, thus no PATH_MAX... */
12 | #define PATH_MAX 1024 /* ...so we'll just impose an arbitrary limit. */
13 | #endif
14 |
15 | extern char *program_name, current_filename[];
16 |
17 | extern FILE *msgfp;
18 |
19 | extern int num_ochannels;
20 |
21 | #define MULTICHANNEL_OUT
22 | #define MAX_OUT_CHANNELS 6
23 |
24 | typedef struct {
25 | char *path;
26 | void *next;
27 | } PathList;
28 |
29 | /* Noise modes for open_file */
30 | #define OF_SILENT 0
31 | #define OF_NORMAL 1
32 | #define OF_VERBOSE 2
33 |
34 | extern FILE *open_file(const char *name, int decompress, int noise_mode);
35 | extern void add_to_pathlist(const char *s);
36 | extern void free_pathlist(void);
37 | extern void close_file(FILE *fp);
38 | extern void skip(FILE *fp, size_t len);
39 | extern void *safe_malloc(size_t count);
40 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/ctrlmode.c:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | #include "config.h"
10 | #include "ctrlmode.h"
11 |
12 | #ifdef SDL
13 | extern ControlMode sdl_control_mode;
14 | # ifndef DEFAULT_CONTROL_MODE
15 | # define DEFAULT_CONTROL_MODE &sdl_control_mode
16 | # endif
17 | #endif
18 |
19 | ControlMode *ctl_list[]={
20 | #ifdef SDL
21 | &sdl_control_mode,
22 | #endif
23 | 0
24 | };
25 |
26 | ControlMode *ctl=DEFAULT_CONTROL_MODE;
27 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/ctrlmode.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | /* Return values for ControlMode.read */
10 |
11 | #define RC_ERROR -1
12 | #define RC_NONE 0
13 | #define RC_QUIT 1
14 | #define RC_NEXT 2
15 | #define RC_PREVIOUS 3 /* Restart this song at beginning, or the previous
16 | song if we're less than a second into this one. */
17 | #define RC_FORWARD 4
18 | #define RC_BACK 5
19 | #define RC_JUMP 6
20 | #define RC_TOGGLE_PAUSE 7 /* Pause/continue */
21 | #define RC_RESTART 8 /* Restart song at beginning */
22 |
23 | #define RC_PAUSE 9 /* Really pause playing */
24 | #define RC_CONTINUE 10 /* Continue if paused */
25 | #define RC_REALLY_PREVIOUS 11 /* Really go to the previous song */
26 | #define RC_CHANGE_VOLUME 12
27 | #define RC_LOAD_FILE 13 /* Load a new midifile */
28 | #define RC_TUNE_END 14 /* The tune is over, play it again sam? */
29 |
30 | #define CMSG_INFO 0
31 | #define CMSG_WARNING 1
32 | #define CMSG_ERROR 2
33 | #define CMSG_FATAL 3
34 | #define CMSG_TRACE 4
35 | #define CMSG_TIME 5
36 | #define CMSG_TOTAL 6
37 | #define CMSG_FILE 7
38 | #define CMSG_TEXT 8
39 |
40 | #define VERB_NORMAL 0
41 | #define VERB_VERBOSE 1
42 | #define VERB_NOISY 2
43 | #define VERB_DEBUG 3
44 | #define VERB_DEBUG_SILLY 4
45 |
46 | typedef struct {
47 | char *id_name, id_character;
48 | int verbosity, trace_playing, opened;
49 |
50 | int (*open)(int using_stdin, int using_stdout);
51 | void (*pass_playing_list)(int number_of_files, char *list_of_files[]);
52 | void (*close)(void);
53 | int (*read)(int32 *valp);
54 | int (*cmsg)(int type, int verbosity_level, char *fmt, ...);
55 |
56 | void (*refresh)(void);
57 | void (*reset)(void);
58 | void (*file_name)(char *name);
59 | void (*total_time)(int tt);
60 | void (*current_time)(int ct);
61 |
62 | void (*note)(int v);
63 | void (*master_volume)(int mv);
64 | void (*program)(int channel, int val); /* val<0 means drum set -val */
65 | void (*volume)(int channel, int val);
66 | void (*expression)(int channel, int val);
67 | void (*panning)(int channel, int val);
68 | void (*sustain)(int channel, int val);
69 | void (*pitch_bend)(int channel, int val);
70 |
71 | } ControlMode;
72 |
73 | extern ControlMode *ctl_list[], *ctl;
74 | extern char timidity_error[];
75 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/filter.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 |
8 | filter.h : written by Vincent Pagel ( pagel@loria.fr )
9 |
10 | implements fir antialiasing filter : should help when setting sample
11 | rates as low as 8Khz.
12 |
13 | */
14 |
15 | /* Order of the FIR filter = 20 should be enough ! */
16 | #define ORDER 20
17 | #define ORDER2 ORDER/2
18 |
19 | #ifndef PI
20 | #define PI 3.14159265
21 | #endif
22 |
23 | extern void antialiasing(Sample *sp, int32 output_rate);
24 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/instrum.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 |
10 | typedef struct {
11 | int32
12 | loop_start, loop_end, data_length,
13 | sample_rate, low_freq, high_freq, root_freq;
14 | uint8
15 | root_tune, fine_tune;
16 | int32
17 | envelope_rate[7], envelope_offset[7],
18 | modulation_rate[7], modulation_offset[7];
19 | FLOAT_T
20 | volume, resonance,
21 | modEnvToFilterFc, modEnvToPitch, modLfoToFilterFc;
22 | sample_t *data;
23 | int32
24 | tremolo_sweep_increment, tremolo_phase_increment,
25 | lfo_sweep_increment, lfo_phase_increment,
26 | vibrato_sweep_increment, vibrato_control_ratio,
27 | cutoff_freq;
28 | uint8
29 | reverberation, chorusdepth,
30 | tremolo_depth, vibrato_depth,
31 | modes;
32 | uint8
33 | attenuation, freq_center;
34 | int8
35 | panning, note_to_use, exclusiveClass;
36 | int16
37 | scale_tuning, keyToModEnvHold, keyToModEnvDecay,
38 | keyToVolEnvHold, keyToVolEnvDecay;
39 | int32
40 | freq_scale, vibrato_delay;
41 | } Sample;
42 |
43 | /* Bits in modes: */
44 | #define MODES_16BIT (1<<0)
45 | #define MODES_UNSIGNED (1<<1)
46 | #define MODES_LOOPING (1<<2)
47 | #define MODES_PINGPONG (1<<3)
48 | #define MODES_REVERSE (1<<4)
49 | #define MODES_SUSTAIN (1<<5)
50 | #define MODES_ENVELOPE (1<<6)
51 | #define MODES_FAST_RELEASE (1<<7)
52 |
53 | #if 0
54 | typedef struct {
55 | int samples;
56 | Sample *sample;
57 | } Instrument;
58 | #endif
59 |
60 | #define INST_GUS 0
61 | #define INST_SF2 1
62 |
63 | typedef struct {
64 | int type;
65 | int samples;
66 | Sample *sample;
67 | int left_samples;
68 | Sample *left_sample;
69 | int right_samples;
70 | Sample *right_sample;
71 | unsigned char *contents;
72 | } Instrument;
73 |
74 |
75 | typedef struct _InstrumentLayer {
76 | uint8 lo, hi;
77 | int size;
78 | Instrument *instrument;
79 | struct _InstrumentLayer *next;
80 | } InstrumentLayer;
81 |
82 | struct cfg_type {
83 | int font_code;
84 | int num;
85 | const char *name;
86 | };
87 |
88 | #define FONT_NORMAL 0
89 | #define FONT_FFF 1
90 | #define FONT_SBK 2
91 | #define FONT_TONESET 3
92 | #define FONT_DRUMSET 4
93 | #define FONT_PRESET 5
94 |
95 |
96 | typedef struct {
97 | char *name;
98 | InstrumentLayer *layer;
99 | int font_type, sf_ix, last_used, tuning;
100 | int note, amp, pan, strip_loop, strip_envelope, strip_tail;
101 | } ToneBankElement;
102 |
103 | #if 0
104 | typedef struct {
105 | char *name;
106 | Instrument *instrument;
107 | int note, amp, pan, strip_loop, strip_envelope, strip_tail;
108 | } ToneBankElement;
109 | #endif
110 | /* A hack to delay instrument loading until after reading the
111 | entire MIDI file. */
112 | #define MAGIC_LOAD_INSTRUMENT ((InstrumentLayer *)(-1))
113 |
114 | #define MAXPROG 128
115 | #define MAXBANK 130
116 | #define SFXBANK (MAXBANK-1)
117 | #define SFXDRUM1 (MAXBANK-2)
118 | #define SFXDRUM2 (MAXBANK-1)
119 | #define XGDRUM 1
120 |
121 | #if 0
122 | typedef struct {
123 | ToneBankElement tone[128];
124 | } ToneBank;
125 | #endif
126 |
127 | typedef struct {
128 | char *name;
129 | ToneBankElement tone[MAXPROG];
130 | } ToneBank;
131 |
132 |
133 | extern char *sf_file;
134 |
135 | extern ToneBank *tonebank[], *drumset[];
136 |
137 | #if 0
138 | extern Instrument *default_instrument;
139 | #endif
140 | extern InstrumentLayer *default_instrument;
141 | extern int default_program;
142 | extern int antialiasing_allowed;
143 | extern int fast_decay;
144 | extern int free_instruments_afterwards;
145 |
146 | #define SPECIAL_PROGRAM -1
147 |
148 | extern int load_missing_instruments(void);
149 | extern void free_instruments(void);
150 | extern void end_soundfont(void);
151 | extern int set_default_instrument(const char *name);
152 |
153 |
154 | extern int32 convert_tremolo_sweep(uint8 sweep);
155 | extern int32 convert_vibrato_sweep(uint8 sweep, int32 vib_control_ratio);
156 | extern int32 convert_tremolo_rate(uint8 rate);
157 | extern int32 convert_vibrato_rate(uint8 rate);
158 |
159 | extern int init_soundfont(char *fname, int oldbank, int newbank, int level);
160 | extern InstrumentLayer *load_sbk_patch(const char *name, int gm_num, int bank, int percussion,
161 | int panning, int amp, int note_to_use, int sf_ix);
162 | extern int current_tune_number;
163 | extern int max_patch_memory;
164 | extern int current_patch_memory;
165 | #define XMAPMAX 800
166 | extern int xmap[XMAPMAX][5];
167 | extern void pcmap(int *b, int *v, int *p, int *drums);
168 |
169 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/mix.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | extern void mix_voice(int32 *buf, int v, int32 c);
10 | extern int recompute_envelope(int v);
11 | extern void apply_envelope_to_amp(int v);
12 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/output.c:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | #include "config.h"
10 | #include "output.h"
11 | #include "tables.h"
12 |
13 |
14 | #ifdef SDL
15 | extern PlayMode sdl_play_mode;
16 | #define DEFAULT_PLAY_MODE &sdl_play_mode
17 | #endif
18 |
19 | PlayMode *play_mode_list[] = {
20 | #ifdef DEFAULT_PLAY_MODE
21 | DEFAULT_PLAY_MODE,
22 | #endif
23 | 0
24 | };
25 |
26 | #ifdef DEFAULT_PLAY_MODE
27 | PlayMode *play_mode=DEFAULT_PLAY_MODE;
28 | #endif
29 |
30 | /*****************************************************************/
31 | /* Some functions to convert signed 32-bit data to other formats */
32 |
33 | void s32tos8(void *dp, int32 *lp, int32 c)
34 | {
35 | int8 *cp=(int8 *)(dp);
36 | int32 l;
37 | while (c--)
38 | {
39 | l=(*lp++)>>(32-8-GUARD_BITS);
40 | if (l>127) l=127;
41 | else if (l<-128) l=-128;
42 | *cp++ = (int8) (l);
43 | }
44 | }
45 |
46 | void s32tou8(void *dp, int32 *lp, int32 c)
47 | {
48 | uint8 *cp=(uint8 *)(dp);
49 | int32 l;
50 | while (c--)
51 | {
52 | l=(*lp++)>>(32-8-GUARD_BITS);
53 | if (l>127) l=127;
54 | else if (l<-128) l=-128;
55 | *cp++ = 0x80 ^ ((uint8) l);
56 | }
57 | }
58 |
59 | void s32tos16(void *dp, int32 *lp, int32 c)
60 | {
61 | int16 *sp=(int16 *)(dp);
62 | int32 l;
63 | while (c--)
64 | {
65 | l=(*lp++)>>(32-16-GUARD_BITS);
66 | if (l > 32767) l=32767;
67 | else if (l<-32768) l=-32768;
68 | *sp++ = (int16)(l);
69 | }
70 | }
71 |
72 | void s32tou16(void *dp, int32 *lp, int32 c)
73 | {
74 | uint16 *sp=(uint16 *)(dp);
75 | int32 l;
76 | while (c--)
77 | {
78 | l=(*lp++)>>(32-16-GUARD_BITS);
79 | if (l > 32767) l=32767;
80 | else if (l<-32768) l=-32768;
81 | *sp++ = 0x8000 ^ (uint16)(l);
82 | }
83 | }
84 |
85 | void s32tos16x(void *dp, int32 *lp, int32 c)
86 | {
87 | int16 *sp=(int16 *)(dp);
88 | int32 l;
89 | while (c--)
90 | {
91 | l=(*lp++)>>(32-16-GUARD_BITS);
92 | if (l > 32767) l=32767;
93 | else if (l<-32768) l=-32768;
94 | *sp++ = XCHG_SHORT((int16)(l));
95 | }
96 | }
97 |
98 | void s32tou16x(void *dp, int32 *lp, int32 c)
99 | {
100 | uint16 *sp=(uint16 *)(dp);
101 | int32 l;
102 | while (c--)
103 | {
104 | l=(*lp++)>>(32-16-GUARD_BITS);
105 | if (l > 32767) l=32767;
106 | else if (l<-32768) l=-32768;
107 | *sp++ = XCHG_SHORT(0x8000 ^ (uint16)(l));
108 | }
109 | }
110 |
111 | void s32toulaw(void *dp, int32 *lp, int32 c)
112 | {
113 | uint8 *up=(uint8 *)(dp);
114 | int32 l;
115 | while (c--)
116 | {
117 | l=(*lp++)>>(32-13-GUARD_BITS);
118 | if (l > 4095) l=4095;
119 | else if (l<-4096) l=-4096;
120 | *up++ = _l2u[l];
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/output.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | /* Data format encoding bits */
10 |
11 | #define PE_MONO 0x01 /* versus stereo */
12 | #define PE_SIGNED 0x02 /* versus unsigned */
13 | #define PE_16BIT 0x04 /* versus 8-bit */
14 | #define PE_ULAW 0x08 /* versus linear */
15 | #define PE_BYTESWAP 0x10 /* versus the other way */
16 |
17 | typedef struct {
18 | int32 rate, encoding;
19 | char *id_name;
20 | } PlayMode;
21 |
22 | extern PlayMode *play_mode_list[], *play_mode;
23 | extern int init_buffers(int kbytes);
24 |
25 | /* Conversion functions -- These overwrite the int32 data in *lp with
26 | data in another format */
27 |
28 | /* The size of the output buffers */
29 | extern int AUDIO_BUFFER_SIZE;
30 |
31 | /* Actual copy function */
32 | extern void (*s32tobuf)(void *dp, int32 *lp, int32 c);
33 |
34 | /* 8-bit signed and unsigned*/
35 | extern void s32tos8(void *dp, int32 *lp, int32 c);
36 | extern void s32tou8(void *dp, int32 *lp, int32 c);
37 |
38 | /* 16-bit */
39 | extern void s32tos16(void *dp, int32 *lp, int32 c);
40 | extern void s32tou16(void *dp, int32 *lp, int32 c);
41 |
42 | /* byte-exchanged 16-bit */
43 | extern void s32tos16x(void *dp, int32 *lp, int32 c);
44 | extern void s32tou16x(void *dp, int32 *lp, int32 c);
45 |
46 | /* uLaw (8 bits) */
47 | extern void s32toulaw(void *dp, int32 *lp, int32 c);
48 |
49 | /* little-endian and big-endian specific */
50 | #if SDL_BYTEORDER == SDL_LIL_ENDIAN
51 | #define s32tou16l s32tou16
52 | #define s32tou16b s32tou16x
53 | #define s32tos16l s32tos16
54 | #define s32tos16b s32tos16x
55 | #else
56 | #define s32tou16l s32tou16x
57 | #define s32tou16b s32tou16
58 | #define s32tos16l s32tos16x
59 | #define s32tos16b s32tos16
60 | #endif
61 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/playmidi.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | typedef struct {
10 | int32 time;
11 | uint8 channel, type, a, b;
12 | } MidiEvent;
13 |
14 | /* Midi events */
15 | #define ME_NONE 0
16 | #define ME_NOTEON 1
17 | #define ME_NOTEOFF 2
18 | #define ME_KEYPRESSURE 3
19 | #define ME_MAINVOLUME 4
20 | #define ME_PAN 5
21 | #define ME_SUSTAIN 6
22 | #define ME_EXPRESSION 7
23 | #define ME_PITCHWHEEL 8
24 | #define ME_PROGRAM 9
25 | #define ME_TEMPO 10
26 | #define ME_PITCH_SENS 11
27 |
28 | #define ME_ALL_SOUNDS_OFF 12
29 | #define ME_RESET_CONTROLLERS 13
30 | #define ME_ALL_NOTES_OFF 14
31 | #define ME_TONE_BANK 15
32 |
33 | #define ME_LYRIC 16
34 | #define ME_TONE_KIT 17
35 | #define ME_MASTERVOLUME 18
36 | #define ME_CHANNEL_PRESSURE 19
37 |
38 | #define ME_HARMONICCONTENT 71
39 | #define ME_RELEASETIME 72
40 | #define ME_ATTACKTIME 73
41 | #define ME_BRIGHTNESS 74
42 |
43 | #define ME_REVERBERATION 91
44 | #define ME_CHORUSDEPTH 93
45 |
46 | #define ME_EOT 99
47 |
48 |
49 | #define SFX_BANKTYPE 64
50 |
51 | typedef struct {
52 | int
53 | bank, program, volume, sustain, panning, pitchbend, expression,
54 | mono, /* one note only on this channel -- not implemented yet */
55 | /* new stuff */
56 | variationbank, reverberation, chorusdepth, harmoniccontent,
57 | releasetime, attacktime, brightness, kit, sfx,
58 | /* end new */
59 | pitchsens;
60 | FLOAT_T
61 | pitchfactor; /* precomputed pitch bend factor to save some fdiv's */
62 | char transpose;
63 | char *name;
64 | } Channel;
65 |
66 | /* Causes the instrument's default panning to be used. */
67 | #define NO_PANNING -1
68 | /* envelope points */
69 | #define MAXPOINT 7
70 |
71 | typedef struct {
72 | uint8
73 | status, channel, note, velocity, clone_type;
74 | Sample *sample;
75 | Sample *left_sample;
76 | Sample *right_sample;
77 | int32 clone_voice;
78 | int32
79 | orig_frequency, frequency,
80 | sample_offset, loop_start, loop_end;
81 | int32
82 | envelope_volume, modulation_volume;
83 | int32
84 | envelope_target, modulation_target;
85 | int32
86 | tremolo_sweep, tremolo_sweep_position, tremolo_phase,
87 | lfo_sweep, lfo_sweep_position, lfo_phase,
88 | vibrato_sweep, vibrato_sweep_position, vibrato_depth, vibrato_delay,
89 | starttime, echo_delay_count;
90 | int32
91 | echo_delay,
92 | sample_increment,
93 | envelope_increment,
94 | modulation_increment,
95 | tremolo_phase_increment,
96 | lfo_phase_increment;
97 |
98 | final_volume_t left_mix, right_mix, lr_mix, rr_mix, ce_mix, lfe_mix;
99 |
100 | FLOAT_T
101 | left_amp, right_amp, lr_amp, rr_amp, ce_amp, lfe_amp,
102 | volume, tremolo_volume, lfo_volume;
103 | int32
104 | vibrato_sample_increment[VIBRATO_SAMPLE_INCREMENTS];
105 | int32
106 | envelope_rate[MAXPOINT], envelope_offset[MAXPOINT];
107 | int32
108 | vibrato_phase, vibrato_control_ratio, vibrato_control_counter,
109 | envelope_stage, modulation_stage, control_counter,
110 | modulation_delay, modulation_counter, panning, panned;
111 | } Voice;
112 |
113 | /* Voice status options: */
114 | #define VOICE_FREE 0
115 | #define VOICE_ON 1
116 | #define VOICE_SUSTAINED 2
117 | #define VOICE_OFF 3
118 | #define VOICE_DIE 4
119 |
120 | /* Voice panned options: */
121 | #define PANNED_MYSTERY 0
122 | #define PANNED_LEFT 1
123 | #define PANNED_RIGHT 2
124 | #define PANNED_CENTER 3
125 | /* Anything but PANNED_MYSTERY only uses the left volume */
126 |
127 | /* Envelope stages: */
128 | #define ATTACK 0
129 | #define HOLD 1
130 | #define DECAY 2
131 | #define RELEASE 3
132 | #define RELEASEB 4
133 | #define RELEASEC 5
134 | #define DELAY 6
135 |
136 | extern Channel channel[16];
137 | extern Voice voice[MAX_VOICES];
138 | extern signed char drumvolume[MAXCHAN][MAXNOTE];
139 | extern signed char drumpanpot[MAXCHAN][MAXNOTE];
140 | extern signed char drumreverberation[MAXCHAN][MAXNOTE];
141 | extern signed char drumchorusdepth[MAXCHAN][MAXNOTE];
142 |
143 | extern int32 control_ratio, amp_with_poly, amplification;
144 | extern int32 drumchannels;
145 | extern int adjust_panning_immediately;
146 | extern int voices;
147 |
148 | #define ISDRUMCHANNEL(c) ((drumchannels & (1<<(c))))
149 |
150 | extern int GM_System_On;
151 | extern int XG_System_On;
152 | extern int GS_System_On;
153 |
154 | extern int XG_System_reverb_type;
155 | extern int XG_System_chorus_type;
156 | extern int XG_System_variation_type;
157 |
158 | extern int play_midi(MidiEvent *el, int32 events, int32 samples);
159 | extern int play_midi_file(const char *fn);
160 | extern void dumb_pass_playing_list(int number_of_files, char *list_of_files[]);
161 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/readmidi.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | typedef struct {
10 | MidiEvent event;
11 | void *next;
12 | } MidiEventList;
13 |
14 | extern int32 quietchannels;
15 |
16 | extern MidiEvent *read_midi_file(SDL_RWops *mrw, int32 *count, int32 *sp);
17 |
18 | extern char midi_name[FILENAME_MAX+1];
19 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/resample.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | extern resample_t *resample_voice(int v, int32 *countptr);
10 | extern void pre_resample(Sample *sp);
11 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/sdl_a.c:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | #include "config.h"
10 | #include "output.h"
11 |
12 | /* export the playback mode */
13 |
14 | #define dpm sdl_play_mode
15 |
16 | PlayMode dpm = {
17 | DEFAULT_RATE, PE_16BIT|PE_SIGNED,
18 | "SDL audio"
19 | };
20 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/sdl_c.c:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | #include "config.h"
14 | #include "common.h"
15 | #include "output.h"
16 | #include "ctrlmode.h"
17 | #include "instrum.h"
18 | #include "playmidi.h"
19 |
20 | static void ctl_refresh(void);
21 | static void ctl_total_time(int tt);
22 | static void ctl_master_volume(int mv);
23 | static void ctl_file_name(char *name);
24 | static void ctl_current_time(int ct);
25 | static void ctl_note(int v);
26 | static void ctl_program(int ch, int val);
27 | static void ctl_volume(int channel, int val);
28 | static void ctl_expression(int channel, int val);
29 | static void ctl_panning(int channel, int val);
30 | static void ctl_sustain(int channel, int val);
31 | static void ctl_pitch_bend(int channel, int val);
32 | static void ctl_reset(void);
33 | static int ctl_open(int using_stdin, int using_stdout);
34 | static void ctl_close(void);
35 | static int ctl_read(int32 *valp);
36 | static int cmsg(int type, int verbosity_level, char *fmt, ...);
37 |
38 | /**********************************/
39 | /* export the interface functions */
40 |
41 | #define ctl sdl_control_mode
42 |
43 | ControlMode ctl=
44 | {
45 | "SDL interface", 's',
46 | 1,0,0,
47 | ctl_open,NULL, ctl_close, ctl_read, cmsg,
48 | ctl_refresh, ctl_reset, ctl_file_name, ctl_total_time, ctl_current_time,
49 | ctl_note,
50 | ctl_master_volume, ctl_program, ctl_volume,
51 | ctl_expression, ctl_panning, ctl_sustain, ctl_pitch_bend
52 | };
53 |
54 | static int ctl_open(int using_stdin, int using_stdout)
55 | {
56 | ctl.opened=1;
57 | return 0;
58 | }
59 |
60 | static void ctl_close(void)
61 | {
62 | ctl.opened=0;
63 | }
64 |
65 | static int ctl_read(int32 *valp)
66 | {
67 | return RC_NONE;
68 | }
69 |
70 | static int cmsg(int type, int verbosity_level, char *fmt, ...)
71 | {
72 | #ifdef GREGS_DEBUG
73 | va_list ap;
74 | int flag_newline = 1;
75 | if ((type==CMSG_TEXT || type==CMSG_INFO || type==CMSG_WARNING) &&
76 | ctl.verbosity
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | #ifdef LOOKUP_SINE
10 | extern FLOAT_T sine(int x);
11 | #else
12 | #include
13 | #define sine(x) (sin((2*PI/1024.0) * (x)))
14 | #endif
15 |
16 | #define SINE_CYCLE_LENGTH 1024
17 | extern int32 freq_table[];
18 | extern double vol_table[];
19 | extern double expr_table[];
20 | extern double bend_fine[];
21 | extern double bend_coarse[];
22 | extern uint8 *_l2u; /* 13-bit PCM to 8-bit u-law */
23 | extern uint8 _l2u_[]; /* used in LOOKUP_HACK */
24 | #ifdef LOOKUP_HACK
25 | extern int16 _u2l[];
26 | extern int32 *mixup;
27 | #ifdef LOOKUP_INTERPOLATION
28 | extern int8 *iplookup;
29 | #endif
30 | #endif
31 |
32 | extern void init_tables(void);
33 |
34 | #define XMAPMAX 800
35 | extern int xmap[XMAPMAX][5];
36 |
37 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/timidity/timidity.h:
--------------------------------------------------------------------------------
1 | /*
2 | TiMidity -- Experimental MIDI to WAVE converter
3 | Copyright (C) 1995 Tuukka Toivonen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the Perl Artistic License, available in COPYING.
7 | */
8 |
9 | typedef struct _MidiSong MidiSong;
10 |
11 | extern int Timidity_Init(int rate, int format, int channels, int samples);
12 | extern const char *Timidity_Error(void);
13 | extern void Timidity_SetVolume(int volume);
14 | extern int Timidity_PlaySome(void *stream, int samples);
15 | extern MidiSong *Timidity_LoadSong_RW(SDL_RWops *rw, int freerw);
16 | extern void Timidity_Start(MidiSong *song);
17 | extern int Timidity_Active(void);
18 | extern void Timidity_Stop(void);
19 | extern void Timidity_FreeSong(MidiSong *song);
20 | extern void Timidity_Close(void);
21 |
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/version.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/components/SDL_mixer-1.2.12/version.rc
--------------------------------------------------------------------------------
/components/SDL_mixer-1.2.12/wavestream.h:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_mixer: An audio mixer library based on the SDL library
3 | Copyright (C) 1997-2012 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /* $Id$ */
23 |
24 | /* This file supports streaming WAV files, without volume adjustment */
25 |
26 | #include
27 |
28 | typedef struct {
29 | SDL_RWops *rw;
30 | SDL_bool freerw;
31 | long start;
32 | long stop;
33 | SDL_AudioCVT cvt;
34 | } WAVStream;
35 |
36 | /* Initialize the WAVStream player, with the given mixer settings
37 | This function returns 0, or -1 if there was an error.
38 | */
39 | extern int WAVStream_Init(SDL_AudioSpec *mixer);
40 |
41 | /* Unimplemented */
42 | extern void WAVStream_SetVolume(int volume);
43 |
44 | /* Load a WAV stream from an SDL_RWops object */
45 | extern WAVStream *WAVStream_LoadSong_RW(SDL_RWops *rw, const char *magic, int freerw);
46 |
47 | /* Start playback of a given WAV stream */
48 | extern void WAVStream_Start(WAVStream *wave);
49 |
50 | /* Play some of a stream previously started with WAVStream_Start() */
51 | extern int WAVStream_PlaySome(Uint8 *stream, int len);
52 |
53 | /* Stop playback of a stream previously started with WAVStream_Start() */
54 | extern void WAVStream_Stop(void);
55 |
56 | /* Close the given WAV stream */
57 | extern void WAVStream_FreeSong(WAVStream *wave);
58 |
59 | /* Return non-zero if a stream is currently playing */
60 | extern int WAVStream_Active(void);
61 |
--------------------------------------------------------------------------------
/components/dc/dc_cd.cpp:
--------------------------------------------------------------------------------
1 | //Wolf4SDL\DC
2 | //dc_cd.cpp
3 | //2009 - Cyle Terry
4 |
5 | #if defined(_arch_dreamcast)
6 |
7 | #include "dc/cdrom.h"
8 |
9 | int DC_CheckDrive() {
10 | int disc_status;
11 | int disc_type;
12 | cdrom_get_status(&disc_status, &disc_type);
13 | return disc_status;
14 | }
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/components/dc/dc_main.h:
--------------------------------------------------------------------------------
1 | //Wolf4SDL\DC
2 | //dc_main.h
3 | //2009 - Cyle Terry
4 |
5 | #ifndef __DC_MAIN_H_
6 | #define __DC_MAIN_H_
7 |
8 | typedef uint8 uint8_t;
9 | typedef uint16 uint16_t;
10 | typedef uint32 uint32_t;
11 | typedef int8 int8_t;
12 | typedef int16 int16_t;
13 | typedef int32 int32_t;
14 | typedef int64 int64_t;
15 | typedef ptr_t uintptr_t;
16 |
17 | //dc_cd.cpp
18 | int DC_CheckDrive();
19 |
20 | //dc_main.cpp
21 | void DC_Init();
22 | void DC_CheckArguments();
23 | int DC_CheckForMaps(char *path);
24 | #ifdef SPEAR
25 | #ifndef SPEARDEMO
26 | int DC_SetMission(char *path);
27 | #endif
28 | #endif
29 |
30 | //dc_maple.cpp
31 | int DC_ButtonPress(int button);
32 | int DC_MousePresent();
33 | void DC_WaitButtonPress(int button);
34 | void DC_WaitButtonRelease(int button);
35 |
36 | //dc_video.cpp
37 | void DC_VideoInit();
38 | void DC_DrawString(int x, int y, char *str);
39 | void DC_CLS();
40 | void DC_Flip();
41 |
42 | //dc_vmu.cpp
43 | extern void DiskFlopAnim(int x, int y);
44 | void DC_StatusDrawLCD(int index);
45 | void DC_StatusClearLCD();
46 | void DC_SaveToVMU(char *fname, char *str);
47 | int DC_LoadFromVMU(char *fname);
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/components/dc/dc_maple.cpp:
--------------------------------------------------------------------------------
1 | //Wolf4SDL\DC
2 | //dc_maple.cpp
3 | //2009 - Cyle Terry
4 |
5 | #if defined(_arch_dreamcast)
6 |
7 | #include
8 | #include "dc/maple.h"
9 | #include "dc/maple/controller.h"
10 | #include "dc/maple/vmu.h"
11 |
12 | int DC_MousePresent() {
13 | return maple_first_mouse() != 0;
14 | }
15 |
16 | void DC_WaitButtonPress(int button)
17 | {
18 | int first_controller = 0;
19 | cont_cond_t controller_condition;
20 |
21 | first_controller = maple_first_controller();
22 | cont_get_cond(first_controller, &controller_condition);
23 |
24 | while((controller_condition.buttons & button)) {
25 | SDL_Delay(5);
26 | cont_get_cond(first_controller, &controller_condition);
27 | }
28 | }
29 |
30 |
31 | void DC_WaitButtonRelease(int button)
32 | {
33 | int first_controller = 0;
34 | cont_cond_t controller_condition;
35 |
36 | first_controller = maple_first_controller();
37 | cont_get_cond(first_controller, &controller_condition);
38 |
39 | while(!(controller_condition.buttons & button)) {
40 | SDL_Delay(5);
41 | cont_get_cond(first_controller, &controller_condition);
42 | }
43 | }
44 |
45 |
46 | int DC_ButtonPress(int button)
47 | {
48 | int first_controller = 0;
49 | cont_cond_t controller_condition;
50 |
51 | first_controller = maple_first_controller();
52 | cont_get_cond(first_controller, &controller_condition);
53 |
54 | if(!(controller_condition.buttons & button))
55 | return 1;
56 | else
57 | return 0;
58 | }
59 |
60 | #endif
61 |
--------------------------------------------------------------------------------
/components/dc/dc_video.cpp:
--------------------------------------------------------------------------------
1 | //Wolf4SDL\DC
2 | //dc_video.cpp
3 | //2009 - Cyle Terry
4 |
5 | #if defined(_arch_dreamcast)
6 |
7 | #include
8 | #include
9 | #include "../wl_def.h"
10 | #include "dc/biosfont.h"
11 | #include "dc/video.h"
12 |
13 | static uint16 *bbuffer;
14 |
15 | void DC_VideoInit() {
16 | bbuffer = (uint16 *)malloc(640 * 480 * 2);
17 | DC_CLS();
18 | }
19 |
20 | void DC_DrawString(int x, int y, char *str) {
21 | bfont_draw_str(bbuffer + ((y + 1) * 24 * 640) + (x * 12), 640, 0, str);
22 | }
23 |
24 | void DC_Flip() {
25 | memcpy(vram_s, bbuffer, 640 * 480 * 2);
26 | }
27 |
28 | void DC_CLS() {
29 | int x, y, ofs;
30 | for(y = 0; y < 480; y++) {
31 | ofs = (640 * y);
32 | for(x = 0; x < 640; x++)
33 | bbuffer[ofs + x] = 0;
34 | }
35 | }
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/components/wl_main/audiosod.h:
--------------------------------------------------------------------------------
1 | /////////////////////////////////////////////////
2 | //
3 | // MUSE Header for .SOD
4 | // Created Thu Aug 13 09:25:58 1992
5 | //
6 | /////////////////////////////////////////////////
7 |
8 | #define NUMSOUNDS 81
9 | #define NUMSNDCHUNKS 267
10 |
11 | //
12 | // Sound names & indexes
13 | //
14 | typedef enum {
15 | HITWALLSND, // 0
16 | MISSILEHITSND, // 1
17 | SELECTITEMSND, // 2
18 | GHOSTSIGHTSND, // 3
19 | MOVEGUN2SND, // 4
20 | MOVEGUN1SND, // 5
21 | NOWAYSND, // 6
22 | NAZIHITPLAYERSND, // 7
23 | MISSILEFIRESND, // 8
24 | PLAYERDEATHSND, // 9
25 | DOGDEATHSND, // 10
26 | ATKGATLINGSND, // 11
27 | GETKEYSND, // 12
28 | NOITEMSND, // 13
29 | WALK1SND, // 14
30 | WALK2SND, // 15
31 | TAKEDAMAGESND, // 16
32 | GAMEOVERSND, // 17
33 | OPENDOORSND, // 18
34 | CLOSEDOORSND, // 19
35 | DONOTHINGSND, // 20
36 | HALTSND, // 21
37 | DEATHSCREAM2SND, // 22
38 | ATKKNIFESND, // 23
39 | ATKPISTOLSND, // 24
40 | DEATHSCREAM3SND, // 25
41 | ATKMACHINEGUNSND, // 26
42 | HITENEMYSND, // 27
43 | SHOOTDOORSND, // 28
44 | DEATHSCREAM1SND, // 29
45 | GETMACHINESND, // 30
46 | GETAMMOSND, // 31
47 | SHOOTSND, // 32
48 | HEALTH1SND, // 33
49 | HEALTH2SND, // 34
50 | BONUS1SND, // 35
51 | BONUS2SND, // 36
52 | BONUS3SND, // 37
53 | GETGATLINGSND, // 38
54 | ESCPRESSEDSND, // 39
55 | LEVELDONESND, // 40
56 | DOGBARKSND, // 41
57 | ENDBONUS1SND, // 42
58 | ENDBONUS2SND, // 43
59 | BONUS1UPSND, // 44
60 | BONUS4SND, // 45
61 | PUSHWALLSND, // 46
62 | NOBONUSSND, // 47
63 | PERCENT100SND, // 48
64 | BOSSACTIVESND, // 49
65 | DEATHSCREAM4SND, // 50
66 | SCHUTZADSND, // 51
67 | AHHHGSND, // 52
68 | DEATHSCREAM5SND, // 53
69 | DEATHSCREAM7SND, // 54
70 | DEATHSCREAM8SND, // 55
71 | LEBENSND, // 56
72 | DEATHSCREAM6SND, // 57
73 | NAZIFIRESND, // 58
74 | BOSSFIRESND, // 59
75 | SSFIRESND, // 60
76 | SLURPIESND, // 61
77 | GHOSTFADESND, // 62
78 | DEATHSCREAM9SND, // 63
79 | GETAMMOBOXSND, // 64
80 | ANGELSIGHTSND, // 65
81 | SPIONSND, // 66
82 | NEINSOVASSND, // 67
83 | DOGATTACKSND, // 68
84 | ANGELFIRESND, // 69
85 | TRANSSIGHTSND, // 70
86 | TRANSDEATHSND, // 71
87 | WILHELMSIGHTSND, // 72
88 | WILHELMDEATHSND, // 73
89 | UBERDEATHSND, // 74
90 | KNIGHTSIGHTSND, // 75
91 | KNIGHTDEATHSND, // 76
92 | ANGELDEATHSND, // 77
93 | KNIGHTMISSILESND, // 78
94 | GETSPEARSND, // 79
95 | ANGELTIREDSND, // 80
96 | LASTSOUND
97 | } soundnames;
98 |
99 | //
100 | // Base offsets
101 | //
102 | #define STARTPCSOUNDS 0
103 | #define STARTADLIBSOUNDS 81
104 | #define STARTDIGISOUNDS 162
105 | #define STARTMUSIC 243
106 |
107 | //
108 | // Music names & indexes
109 | //
110 | typedef enum {
111 | XFUNKIE_MUS, // 0
112 | DUNGEON_MUS, // 1
113 | XDEATH_MUS, // 2
114 | GETTHEM_MUS, // 3
115 | XTIPTOE_MUS, // 4
116 | GOINGAFT_MUS, // 5
117 | URAHERO_MUS, // 6
118 | XTHEEND_MUS, // 7
119 | NAZI_OMI_MUS, // 8
120 | POW_MUS, // 9
121 | TWELFTH_MUS, // 10
122 | SEARCHN_MUS, // 11
123 | SUSPENSE_MUS, // 12
124 | ZEROHOUR_MUS, // 13
125 | WONDERIN_MUS, // 14
126 | ULTIMATE_MUS, // 15
127 | ENDLEVEL_MUS, // 16
128 | XEVIL_MUS, // 17
129 | XJAZNAZI_MUS, // 18
130 | COPYPRO_MUS, // 19
131 | XAWARD_MUS, // 20
132 | XPUTIT_MUS, // 21
133 | XGETYOU_MUS, // 22
134 | XTOWER2_MUS, // 23
135 | LASTMUSIC
136 | } musicnames;
137 |
138 | /////////////////////////////////////////////////
139 | //
140 | // Thanks for playing with MUSE!
141 | //
142 | /////////////////////////////////////////////////
143 |
--------------------------------------------------------------------------------
/components/wl_main/component.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Component Makefile
3 | #
4 | # This Makefile should, at the very least, just include $(SDK_PATH)/make/component.mk. By default,
5 | # this will take the sources in the src/ directory, compile them and link them into
6 | # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
7 | # please read the SDK documents if you need to do this.
8 | #
9 |
10 | #include $(IDF_PATH)/make/component_common.mk
11 |
12 | COMPONENT_ADD_INCLUDEDIRS += ../SDL ../SDL_mixer-1.2.12
13 | CPPFLAGS += -Wno-error=maybe-uninitialized -Wno-error=parentheses -Wno-error=switch -Wno-error=unknown-pragmas -Wno-error=narrowing -Wno-error=char-subscripts
--------------------------------------------------------------------------------
/components/wl_main/f_spear.h:
--------------------------------------------------------------------------------
1 | #define STR_ENDGAME1 "We owe you a great debt, Mr. Blazkowicz."
2 | #define STR_ENDGAME2 "You have served your country well."
3 | #define STR_ENDGAME3 "With the spear gone, the Allies will finally"
4 | #define STR_ENDGAME4 "by able to destroy Hitler..."
5 |
6 | #define STR_COPY1 "That's close, but not close enough to get"
7 | #define STR_COPY2 "you into the game."
8 |
9 | #define STR_COPY3 "Wow, you must have the early version of the"
10 | #define STR_COPY4 "manual with the totally false information in it."
11 |
12 | #define STR_COPY5 "I would let you into the game, but seeing"
13 | #define STR_COPY6 "as that was not at all the right answer..."
14 |
15 | #define STR_COPY7 "It's just too bad we can't get together on"
16 | #define STR_COPY8 "this one. Sorry."
17 |
18 | #define STR_COPY9 "Hey, you're just SO off base!"
19 |
20 | #define STR_COPY10 "You know, I once typed that myself when"
21 | #define STR_COPY11 "I was your age."
22 |
23 | #define STR_COPY12 "Nops. Zero points. Zugga."
24 |
25 | #define STR_COPY13 "Yeah...right."
26 |
27 | #define STR_COPY14 "You must like these quizzes."
28 |
29 | #define STR_COPY15 "Could be called \"PixelMeister\"?"
30 |
31 | #define STR_COPY16 "Might engineer some software?"
32 |
33 | #define STR_COPY17 "Would be found"
34 | #define STR_COPY18 "directing creatively?"
35 |
36 | #define STR_COPY19 "Might be found"
37 | #define STR_COPY20 "handling operations?"
38 |
39 | #define STR_COPY21 "Has a name familiar"
40 | #define STR_COPY22 "to your weatherman?"
41 |
42 | #define STR_NOPE1 "Welcome to the DOS prompt, pirate!"
43 | #define STR_NOPE2 "Eat hot DOS prompt, goober!"
44 | #define STR_NOPE3 "Ya know, this program doesn't cost that much."
45 | #define STR_NOPE4 "Hey...weren't you just AT this DOS prompt?"
46 | #define STR_NOPE5 "What's a nice user like you doin' at a DOS prompt like this?"
47 | #define STR_NOPE6 "Well, I'm sure you just \"misplaced\" the manual..."
48 | #define STR_NOPE7 "Run me again when you've boned up on your manual a bit."
49 | #define STR_NOPE8 "Nice try, but no Spear."
50 | #define STR_NOPE9 "That information is in the Spear of Destiny manual, by the way."
51 |
52 | #define STR_MISC1 "Under \"Killing the Enemy\", what"
53 | #define STR_MISC2 "type of enemy is pictured?"
54 |
55 | #define STR_MISC3 "How many eyelets are on B.J.'s"
56 | #define STR_MISC4 "boots? (see page 2)"
57 |
58 | #define STR_MISC5 "The word \"minister\" appears in"
59 | #define STR_MISC6 "what gray shape on page 2?"
60 |
61 | #define STR_MISC7 "How many bullets does B.J. have"
62 | #define STR_MISC8 "on the screen-shot in the middle"
63 | #define STR_MISC9 "of page 9?"
64 |
65 | #define STR_STAR "star"
66 | #define STR_DEBRIEF " DEBRIEFING\n SESSION\n"
67 | #define STR_ENEMY1 "Name the member of the"
68 | #define STR_ENEMY2 "enemy forces shown above"
69 |
70 | #define STR_CHECKMAN "CHECK YER MANUAL!"
71 | #define STR_MAN1 "Which manual page"
72 | #define STR_MAN2 "is the Options Menu"
73 | #define STR_MAN3 "function"
74 | #define STR_MAN4 "on?"
75 |
76 | #define STR_ID1 "Which member of Id Software:"
77 |
--------------------------------------------------------------------------------
/components/wl_main/fmopl.h:
--------------------------------------------------------------------------------
1 | #ifndef __FMOPL_H_
2 | #define __FMOPL_H_
3 |
4 | #define HAS_YM3812 1
5 |
6 | /* --- select emulation chips --- */
7 | #define BUILD_YM3812 (HAS_YM3812)
8 | #define BUILD_YM3526 (HAS_YM3526)
9 | #define BUILD_Y8950 (HAS_Y8950)
10 |
11 | /* select output bits size of output : 8 or 16 */
12 | #define OPL_SAMPLE_BITS 16
13 |
14 | /* compiler dependence */
15 | #ifndef OSD_CPU_H
16 | #define OSD_CPU_H
17 | typedef unsigned char UINT8; /* unsigned 8bit */
18 | typedef unsigned short UINT16; /* unsigned 16bit */
19 | typedef unsigned int UINT32; /* unsigned 32bit */
20 | typedef signed char INT8; /* signed 8bit */
21 | typedef signed short INT16; /* signed 16bit */
22 | typedef signed int INT32; /* signed 32bit */
23 |
24 | typedef int BOOL;
25 | #endif
26 |
27 | #if (OPL_SAMPLE_BITS==16)
28 | typedef INT16 OPLSAMPLE;
29 | #endif
30 | #if (OPL_SAMPLE_BITS==8)
31 | typedef INT8 OPLSAMPLE;
32 | #endif
33 |
34 |
35 | typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec);
36 | typedef void (*OPL_IRQHANDLER)(int param,int irq);
37 | typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us);
38 | typedef void (*OPL_PORTHANDLER_W)(int param,unsigned char data);
39 | typedef unsigned char (*OPL_PORTHANDLER_R)(int param);
40 |
41 |
42 | #if BUILD_YM3812
43 |
44 | int YM3812Init(int num, int clock, int rate);
45 | void YM3812Shutdown(void);
46 | void YM3812ResetChip(int which);
47 | int YM3812Write(int which, int a, int v);
48 | unsigned char YM3812Read(int which, int a);
49 | void YM3812Mute(int which,int channel,BOOL mute);
50 | int YM3812TimerOver(int which, int c);
51 | void YM3812UpdateOne(int which, INT16 *buffer, int length);
52 |
53 | void YM3812SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset);
54 | void YM3812SetIRQHandler(int which, OPL_IRQHANDLER IRQHandler, int param);
55 | void YM3812SetUpdateHandler(int which, OPL_UPDATEHANDLER UpdateHandler, int param);
56 |
57 | #endif
58 |
59 |
60 | #if BUILD_YM3526
61 |
62 | /*
63 | ** Initialize YM3526 emulator(s).
64 | **
65 | ** 'num' is the number of virtual YM3526's to allocate
66 | ** 'clock' is the chip clock in Hz
67 | ** 'rate' is sampling rate
68 | */
69 | int YM3526Init(int num, int clock, int rate);
70 | /* shutdown the YM3526 emulators*/
71 | void YM3526Shutdown(void);
72 | void YM3526ResetChip(int which);
73 | int YM3526Write(int which, int a, int v);
74 | unsigned char YM3526Read(int which, int a);
75 | int YM3526TimerOver(int which, int c);
76 | /*
77 | ** Generate samples for one of the YM3526's
78 | **
79 | ** 'which' is the virtual YM3526 number
80 | ** '*buffer' is the output buffer pointer
81 | ** 'length' is the number of samples that should be generated
82 | */
83 | void YM3526UpdateOne(int which, INT16 *buffer, int length);
84 |
85 | void YM3526SetTimerHandler(int which, OPL_TIMERHANDLER TimerHandler, int channelOffset);
86 | void YM3526SetIRQHandler(int which, OPL_IRQHANDLER IRQHandler, int param);
87 | void YM3526SetUpdateHandler(int which, OPL_UPDATEHANDLER UpdateHandler, int param);
88 |
89 | #endif
90 |
91 |
92 | #if BUILD_Y8950
93 |
94 | /* Y8950 port handlers */
95 | void Y8950SetPortHandler(int which, OPL_PORTHANDLER_W PortHandler_w, OPL_PORTHANDLER_R PortHandler_r, int param);
96 | void Y8950SetKeyboardHandler(int which, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, int param);
97 | void Y8950SetDeltaTMemory(int which, void * deltat_mem_ptr, int deltat_mem_size );
98 |
99 | int Y8950Init (int num, int clock, int rate);
100 | void Y8950Shutdown (void);
101 | void Y8950ResetChip (int which);
102 | int Y8950Write (int which, int a, int v);
103 | unsigned char Y8950Read (int which, int a);
104 | int Y8950TimerOver (int which, int c);
105 | void Y8950UpdateOne (int which, INT16 *buffer, int length);
106 |
107 | void Y8950SetTimerHandler (int which, OPL_TIMERHANDLER TimerHandler, int channelOffset);
108 | void Y8950SetIRQHandler (int which, OPL_IRQHANDLER IRQHandler, int param);
109 | void Y8950SetUpdateHandler (int which, OPL_UPDATEHANDLER UpdateHandler, int param);
110 |
111 | #endif
112 |
113 |
114 | #endif /* __FMOPL_H_ */
115 |
--------------------------------------------------------------------------------
/components/wl_main/gp2x.h:
--------------------------------------------------------------------------------
1 | #ifndef GP2X_H
2 | #define GP2X_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | #include "wl_def.h"
11 |
12 | #define GP2X_BUTTON_UP (0)
13 | #define GP2X_BUTTON_DOWN (4)
14 | #define GP2X_BUTTON_LEFT (2)
15 | #define GP2X_BUTTON_RIGHT (6)
16 | #define GP2X_BUTTON_UPLEFT (1)
17 | #define GP2X_BUTTON_UPRIGHT (7)
18 | #define GP2X_BUTTON_DOWNLEFT (3)
19 | #define GP2X_BUTTON_DOWNRIGHT (5)
20 | #define GP2X_BUTTON_CLICK (18)
21 | #define GP2X_BUTTON_A (12)
22 | #define GP2X_BUTTON_B (13)
23 | #define GP2X_BUTTON_X (15)
24 | #define GP2X_BUTTON_Y (14)
25 | #define GP2X_BUTTON_L (11)
26 | #define GP2X_BUTTON_R (10)
27 | #define GP2X_BUTTON_START (8)
28 | #define GP2X_BUTTON_SELECT (9)
29 | #define GP2X_BUTTON_VOLUP (16)
30 | #define GP2X_BUTTON_VOLDOWN (17)
31 |
32 | #define VOLUME_MIN 0
33 | #define VOLUME_MAX 100
34 | #define VOLUME_CHANGE_RATE 2
35 | #define VOLUME_NOCHG 0
36 | #define VOLUME_DOWN 1
37 | #define VOLUME_UP 2
38 | #define KEY_DOWN 1
39 | #define KEY_UP 0
40 |
41 | void GP2X_Init();
42 | void GP2X_Shutdown();
43 | void GP2X_StartMMUHack();
44 |
45 | void GP2X_AdjustVolume( int direction );
46 | void GP2X_ButtonDown( int button );
47 | void GP2X_ButtonUp( int button );
48 | void Screenshot( void );
49 | void SetKeyboard( unsigned int key, int press );
50 |
51 | #endif // GP2X_H
52 |
--------------------------------------------------------------------------------
/components/wl_main/id_ca.h:
--------------------------------------------------------------------------------
1 | #ifndef __ID_CA__
2 | #define __ID_CA__
3 |
4 | //===========================================================================
5 |
6 | #define NUMMAPS 60
7 | #ifdef USE_FLOORCEILINGTEX
8 | #define MAPPLANES 3
9 | #else
10 | #define MAPPLANES 2
11 | #endif
12 |
13 | #define UNCACHEGRCHUNK(chunk) {if(grsegs[chunk]) {free(grsegs[chunk]); grsegs[chunk]=NULL;}}
14 | #define UNCACHEAUDIOCHUNK(chunk) {if(audiosegs[chunk]) {free(audiosegs[chunk]); audiosegs[chunk]=NULL;}}
15 |
16 | //===========================================================================
17 |
18 | typedef struct
19 | {
20 | int32_t planestart[3];
21 | word planelength[3];
22 | word width,height;
23 | char name[16];
24 | } maptype;
25 |
26 | //===========================================================================
27 |
28 | extern int mapon;
29 |
30 | extern word *mapsegs[MAPPLANES];
31 | extern byte *audiosegs[NUMSNDCHUNKS];
32 | extern byte *grsegs[NUMCHUNKS];
33 |
34 | extern char extension[5];
35 | extern char graphext[5];
36 | extern char audioext[5];
37 |
38 | //===========================================================================
39 |
40 | boolean CA_LoadFile (const char *filename, memptr *ptr);
41 | boolean CA_WriteFile (const char *filename, void *ptr, int32_t length);
42 |
43 | int32_t CA_RLEWCompress (word *source, int32_t length, word *dest, word rlewtag);
44 |
45 | void CA_RLEWexpand (word *source, word *dest, int32_t length, word rlewtag);
46 |
47 | void CA_Startup (void);
48 | void CA_Shutdown (void);
49 |
50 | int32_t CA_CacheAudioChunk (int chunk);
51 | void CA_LoadAllSounds (void);
52 |
53 | void CA_CacheGrChunk (int chunk);
54 | void CA_CacheMap (int mapnum);
55 |
56 | void CA_CacheScreen (int chunk);
57 |
58 | void CA_CannotOpen(const char *name);
59 |
60 | #endif
61 |
--------------------------------------------------------------------------------
/components/wl_main/id_pm.cpp:
--------------------------------------------------------------------------------
1 | #include "wl_def.h"
2 |
3 | int ChunksInFile;
4 | int PMSpriteStart;
5 | int PMSoundStart;
6 |
7 | bool PMSoundInfoPagePadded = false;
8 |
9 | // holds the whole VSWAP
10 | uint32_t *PMPageData;
11 | size_t PMPageDataSize;
12 |
13 | // ChunksInFile+1 pointers to page starts.
14 | // The last pointer points one byte after the last page.
15 | uint8_t **PMPages;
16 |
17 | void PM_Startup()
18 | {
19 | char fname[13 + sizeof(DATADIR)] = DATADIR "vswap.";
20 | strcat(fname,extension);
21 |
22 | FILE *file = __fopen(fname,"rb");
23 | if(!file)
24 | CA_CannotOpen(fname);
25 |
26 | ChunksInFile = 0;
27 | __fread(&ChunksInFile, sizeof(word), 1, file);
28 | PMSpriteStart = 0;
29 | __fread(&PMSpriteStart, sizeof(word), 1, file);
30 | PMSoundStart = 0;
31 | __fread(&PMSoundStart, sizeof(word), 1, file);
32 |
33 | uint32_t* pageOffsets = (uint32_t *) malloc((ChunksInFile + 1) * sizeof(int32_t));
34 | CHECKMALLOCRESULT(pageOffsets);
35 | __fread(pageOffsets, sizeof(uint32_t), ChunksInFile, file);
36 |
37 | word *pageLengths = (word *) malloc(ChunksInFile * sizeof(word));
38 | CHECKMALLOCRESULT(pageLengths);
39 | __fread(pageLengths, sizeof(word), ChunksInFile, file);
40 |
41 | __fseek(file, 0, SEEK_END);
42 | long fileSize = __ftell(file);
43 | long pageDataSize = fileSize - pageOffsets[0];
44 | if(pageDataSize > (size_t) -1)
45 | Quit("The page file \"%s\" is too large!", fname);
46 |
47 | pageOffsets[ChunksInFile] = fileSize;
48 |
49 | uint32_t dataStart = pageOffsets[0];
50 | int i;
51 |
52 | // Check that all pageOffsets are valid
53 | for(i = 0; i < ChunksInFile; i++)
54 | {
55 | if(!pageOffsets[i]) continue; // sparse page
56 | if(pageOffsets[i] < dataStart || pageOffsets[i] >= (size_t) fileSize)
57 | Quit("Illegal page offset for page %i: %u (filesize: %u)",
58 | i, pageOffsets[i], fileSize);
59 | }
60 |
61 | // Calculate total amount of padding needed for sprites and sound info page
62 | int alignPadding = 0;
63 | for(i = PMSpriteStart; i < PMSoundStart; i++)
64 | {
65 | if(!pageOffsets[i]) continue; // sparse page
66 | uint32_t offs = pageOffsets[i] - dataStart + alignPadding;
67 | if(offs & 1)
68 | alignPadding++;
69 | }
70 |
71 | if((pageOffsets[ChunksInFile - 1] - dataStart + alignPadding) & 1)
72 | alignPadding++;
73 |
74 | PMPageDataSize = (size_t) pageDataSize + alignPadding;
75 | PMPageData = (uint32_t *) malloc(PMPageDataSize);
76 | CHECKMALLOCRESULT(PMPageData);
77 |
78 | PMPages = (uint8_t **) malloc((ChunksInFile + 1) * sizeof(uint8_t *));
79 | CHECKMALLOCRESULT(PMPages);
80 |
81 | // Load pages and initialize PMPages pointers
82 | uint8_t *ptr = (uint8_t *) PMPageData;
83 | for(i = 0; i < ChunksInFile; i++)
84 | {
85 | if(((i >= PMSpriteStart) && (i < PMSoundStart)) || i == ChunksInFile - 1)
86 | {
87 | size_t offs = ptr - (uint8_t *) PMPageData;
88 |
89 | // pad with zeros to make it 2-byte aligned
90 | if(offs & 1)
91 | {
92 | *ptr++ = 0;
93 | if(i == ChunksInFile - 1) PMSoundInfoPagePadded = true;
94 | }
95 | }
96 |
97 | PMPages[i] = ptr;
98 |
99 | if(!pageOffsets[i])
100 | continue; // sparse page
101 |
102 | // Use specified page length, when next page is sparse page.
103 | // Otherwise, calculate size from the offset difference between this and the next page.
104 | uint32_t size;
105 | if(!pageOffsets[i + 1]) size = pageLengths[i];
106 | else size = pageOffsets[i + 1] - pageOffsets[i];
107 |
108 | __fseek(file, pageOffsets[i], SEEK_SET);
109 | __fread(ptr, 1, size, file);
110 | ptr += size;
111 | }
112 |
113 | // last page points after page buffer
114 | PMPages[ChunksInFile] = ptr;
115 |
116 | free(pageLengths);
117 | free(pageOffsets);
118 | __fclose(file);
119 | }
120 |
121 | void PM_Shutdown()
122 | {
123 | free(PMPages);
124 | free(PMPageData);
125 | }
126 |
--------------------------------------------------------------------------------
/components/wl_main/id_pm.h:
--------------------------------------------------------------------------------
1 | #ifndef __ID_PM__
2 | #define __ID_PM__
3 |
4 | #ifdef USE_HIRES
5 | #define PMPageSize 16384
6 | #else
7 | #define PMPageSize 4096
8 | #endif
9 |
10 | extern int ChunksInFile;
11 | extern int PMSpriteStart;
12 | extern int PMSoundStart;
13 |
14 | extern bool PMSoundInfoPagePadded;
15 |
16 | // ChunksInFile+1 pointers to page starts.
17 | // The last pointer points one byte after the last page.
18 | extern uint8_t **PMPages;
19 |
20 | void PM_Startup();
21 | void PM_Shutdown();
22 |
23 | static inline uint32_t PM_GetPageSize(int page)
24 | {
25 | if(page < 0 || page >= ChunksInFile)
26 | Quit("PM_GetPageSize: Tried to access illegal page: %i", page);
27 | return (uint32_t) (PMPages[page + 1] - PMPages[page]);
28 | }
29 |
30 | static inline uint8_t *PM_GetPage(int page)
31 | {
32 | if(page < 0 || page >= ChunksInFile)
33 | Quit("PM_GetPage: Tried to access illegal page: %i", page);
34 | return PMPages[page];
35 | }
36 |
37 | static inline uint8_t *PM_GetEnd()
38 | {
39 | return PMPages[ChunksInFile];
40 | }
41 |
42 | static inline byte *PM_GetTexture(int wallpic)
43 | {
44 | return PM_GetPage(wallpic);
45 | }
46 |
47 | static inline uint16_t *PM_GetSprite(int shapenum)
48 | {
49 | // correct alignment is enforced by PM_Startup()
50 | return (uint16_t *) (void *) PM_GetPage(PMSpriteStart + shapenum);
51 | }
52 |
53 | static inline byte *PM_GetSound(int soundpagenum)
54 | {
55 | return PM_GetPage(PMSoundStart + soundpagenum);
56 | }
57 |
58 | #endif
59 |
--------------------------------------------------------------------------------
/components/wl_main/id_sd.h:
--------------------------------------------------------------------------------
1 | //
2 | // ID Engine
3 | // ID_SD.h - Sound Manager Header
4 | // Version for Wolfenstein
5 | // By Jason Blochowiak
6 | //
7 |
8 | #ifndef __ID_SD__
9 | #define __ID_SD__
10 |
11 | #define alOut(n,b) YM3812Write(0, n, b)
12 |
13 | #define TickBase 70 // 70Hz per tick - used as a base for timer 0
14 |
15 | typedef enum
16 | {
17 | sdm_Off,
18 | sdm_PC,sdm_AdLib,
19 | } SDMode;
20 |
21 | typedef enum
22 | {
23 | smm_Off,smm_AdLib
24 | } SMMode;
25 |
26 | typedef enum
27 | {
28 | sds_Off,sds_PC,sds_SoundBlaster
29 | } SDSMode;
30 |
31 | typedef struct
32 | {
33 | longword length;
34 | word priority;
35 | } SoundCommon;
36 |
37 | #define ORIG_SOUNDCOMMON_SIZE 6
38 |
39 | // PC Sound stuff
40 | #define pcTimer 0x42
41 | #define pcTAccess 0x43
42 | #define pcSpeaker 0x61
43 |
44 | #define pcSpkBits 3
45 |
46 | typedef struct
47 | {
48 | SoundCommon common;
49 | byte data[1];
50 | } PCSound;
51 |
52 | // Register addresses
53 | // Operator stuff
54 | #define alChar 0x20
55 | #define alScale 0x40
56 | #define alAttack 0x60
57 | #define alSus 0x80
58 | #define alWave 0xe0
59 | // Channel stuff
60 | #define alFreqL 0xa0
61 | #define alFreqH 0xb0
62 | #define alFeedCon 0xc0
63 | // Global stuff
64 | #define alEffects 0xbd
65 |
66 | typedef struct
67 | {
68 | byte mChar,cChar,
69 | mScale,cScale,
70 | mAttack,cAttack,
71 | mSus,cSus,
72 | mWave,cWave,
73 | nConn,
74 |
75 | // These are only for Muse - these bytes are really unused
76 | voice,
77 | mode;
78 | byte unused[3];
79 | } Instrument;
80 |
81 | #define ORIG_INSTRUMENT_SIZE 16
82 |
83 | typedef struct
84 | {
85 | SoundCommon common;
86 | Instrument inst;
87 | byte block;
88 | byte data[1];
89 | } AdLibSound;
90 |
91 | #define ORIG_ADLIBSOUND_SIZE (ORIG_SOUNDCOMMON_SIZE + ORIG_INSTRUMENT_SIZE + 2)
92 |
93 | //
94 | // Sequencing stuff
95 | //
96 | #define sqMaxTracks 10
97 |
98 | typedef struct
99 | {
100 | word length;
101 | word values[1];
102 | } MusicGroup;
103 |
104 | typedef struct
105 | {
106 | int valid;
107 | fixed globalsoundx, globalsoundy;
108 | } globalsoundpos;
109 |
110 | extern globalsoundpos channelSoundPos[];
111 |
112 | // Global variables
113 | extern boolean AdLibPresent,
114 | SoundBlasterPresent,
115 | SoundPositioned;
116 | extern SDMode SoundMode;
117 | extern SDSMode DigiMode;
118 | extern SMMode MusicMode;
119 | extern int DigiMap[];
120 | extern int DigiChannel[];
121 |
122 | #define GetTimeCount() ((SDL_GetTicks()*7)/100)
123 |
124 | inline void Delay(int wolfticks)
125 | {
126 | if(wolfticks>0) SDL_Delay(wolfticks * 100 / 7);
127 | }
128 |
129 | // Function prototypes
130 | extern void SD_Startup(void),
131 | SD_Shutdown(void);
132 |
133 | extern int SD_GetChannelForDigi(int which);
134 | extern void SD_PositionSound(int leftvol,int rightvol);
135 | extern boolean SD_PlaySound(soundnames sound);
136 | extern void SD_SetPosition(int channel, int leftvol,int rightvol);
137 | extern void SD_StopSound(void),
138 | SD_WaitSoundDone(void);
139 |
140 | extern void SD_StartMusic(int chunk);
141 | extern void SD_ContinueMusic(int chunk, int startoffs);
142 | extern void SD_MusicOn(void),
143 | SD_FadeOutMusic(void);
144 | extern int SD_MusicOff(void);
145 |
146 | extern boolean SD_MusicPlaying(void);
147 | extern boolean SD_SetSoundMode(SDMode mode);
148 | extern boolean SD_SetMusicMode(SMMode mode);
149 | extern word SD_SoundPlaying(void);
150 |
151 | extern void SD_SetDigiDevice(SDSMode);
152 | extern void SD_PrepareSound(int which);
153 | extern int SD_PlayDigitized(word which,int leftpos,int rightpos);
154 | extern void SD_StopDigitized(void);
155 |
156 | #endif
157 |
--------------------------------------------------------------------------------
/components/wl_main/id_us.h:
--------------------------------------------------------------------------------
1 | //
2 | // ID Engine
3 | // ID_US.h - Header file for the User Manager
4 | // v1.0d1
5 | // By Jason Blochowiak
6 | //
7 |
8 | #ifndef __ID_US__
9 | #define __ID_US__
10 |
11 | #ifdef __DEBUG__
12 | #define __DEBUG_UserMgr__
13 | #endif
14 |
15 | //#define HELPTEXTLINKED
16 |
17 | #define MaxX 320
18 | #define MaxY 200
19 |
20 | #define MaxHelpLines 500
21 |
22 | #define MaxHighName 57
23 | #define MaxScores 7
24 | typedef struct
25 | {
26 | char name[MaxHighName + 1];
27 | int32_t score;
28 | word completed,episode;
29 | } HighScore;
30 |
31 | #define MaxGameName 32
32 | #define MaxSaveGames 6
33 | typedef struct
34 | {
35 | char signature[4];
36 | word *oldtest;
37 | boolean present;
38 | char name[MaxGameName + 1];
39 | } SaveGame;
40 |
41 | #define MaxString 128 // Maximum input string size
42 |
43 | typedef struct
44 | {
45 | int x,y,
46 | w,h,
47 | px,py;
48 | } WindowRec; // Record used to save & restore screen windows
49 |
50 | extern boolean ingame, // Set by game code if a game is in progress
51 | loadedgame; // Set if the current game was loaded
52 | extern word PrintX,PrintY; // Current printing location in the window
53 | extern word WindowX,WindowY,// Current location of window
54 | WindowW,WindowH;// Current size of window
55 |
56 | extern void (*USL_MeasureString)(const char *,word *,word *);
57 | extern void (*USL_DrawString)(const char *);
58 |
59 | extern boolean (*USL_SaveGame)(int),(*USL_LoadGame)(int);
60 | extern void (*USL_ResetGame)(void);
61 | extern SaveGame Games[MaxSaveGames];
62 | extern HighScore Scores[];
63 |
64 | #define US_HomeWindow() {PrintX = WindowX; PrintY = WindowY;}
65 |
66 | void US_Startup(void);
67 | void US_Shutdown(void);
68 | void US_TextScreen(void),
69 | US_UpdateTextScreen(void),
70 | US_FinishTextScreen(void);
71 | void US_DrawWindow(word x,word y,word w,word h);
72 | void US_CenterWindow(word,word);
73 | void US_SaveWindow(WindowRec *win),
74 | US_RestoreWindow(WindowRec *win);
75 | void US_ClearWindow(void);
76 | void US_SetPrintRoutines(void (*measure)(const char *,word *,word *),
77 | void (*print)(const char *));
78 | void US_PrintCentered(const char *s),
79 | US_CPrint(const char *s),
80 | US_CPrintLine(const char *s),
81 | US_Print(const char *s);
82 | void US_Printf(const char *formatStr, ...);
83 | void US_CPrintf(const char *formatStr, ...);
84 |
85 | void US_PrintUnsigned(longword n);
86 | void US_PrintSigned(int32_t n);
87 | void US_StartCursor(void),
88 | US_ShutCursor(void);
89 | void US_CheckHighScore(int32_t score,word other);
90 | void US_DisplayHighScores(int which);
91 | extern boolean US_UpdateCursor(void);
92 | boolean US_LineInput(int x,int y,char *buf,const char *def,boolean escok,
93 | int maxchars,int maxwidth);
94 |
95 | void USL_PrintInCenter(const char *s,Rect r);
96 | char *USL_GiveSaveName(word game);
97 |
98 | void US_InitRndT(int randomize);
99 | int US_RndT();
100 |
101 | #endif
102 |
--------------------------------------------------------------------------------
/components/wl_main/id_vh.h:
--------------------------------------------------------------------------------
1 | // ID_VH.H
2 |
3 |
4 | #define WHITE 15 // graphics mode independant colors
5 | #define BLACK 0
6 | #define FIRSTCOLOR 1
7 | #define SECONDCOLOR 12
8 | #define F_WHITE 15
9 | #define F_BLACK 0
10 | #define F_FIRSTCOLOR 1
11 | #define F_SECONDCOLOR 12
12 |
13 | //===========================================================================
14 |
15 | #define MAXSHIFTS 1
16 |
17 | typedef struct
18 | {
19 | int16_t width,height;
20 | } pictabletype;
21 |
22 |
23 | typedef struct
24 | {
25 | int16_t height;
26 | int16_t location[256];
27 | int8_t width[256];
28 | } fontstruct;
29 |
30 |
31 | //===========================================================================
32 |
33 |
34 | extern pictabletype *pictable;
35 | extern pictabletype *picmtable;
36 |
37 | extern byte fontcolor,backcolor;
38 | extern int fontnumber;
39 | extern int px,py;
40 |
41 | #define SETFONTCOLOR(f,b) fontcolor=f;backcolor=b;
42 |
43 | //
44 | // mode independant routines
45 | // coordinates in pixels, rounded to best screen res
46 | // regions marked in double buffer
47 | //
48 |
49 | void VWB_DrawPropString (const char *string);
50 |
51 | void VWB_DrawTile8 (int x, int y, int tile);
52 | void VWB_DrawTile8M (int x, int y, int tile);
53 | void VWB_DrawTile16 (int x, int y, int tile);
54 | void VWB_DrawTile16M (int x, int y, int tile);
55 | void VWB_DrawPic (int x, int y, int chunknum);
56 | void VWB_DrawPicScaledCoord (int x, int y, int chunknum);
57 | void VWB_DrawMPic(int x, int y, int chunknum);
58 | void VWB_Bar (int x, int y, int width, int height, int color);
59 | #define VWB_BarScaledCoord VL_BarScaledCoord
60 | void VWB_Plot (int x, int y, int color);
61 | #define VWB_PlotScaledCoord VW_Plot
62 | void VWB_Hlin (int x1, int x2, int y, int color);
63 | void VWB_Vlin (int y1, int y2, int x, int color);
64 | #define VWB_HlinScaledCoord VW_Hlin
65 | #define VWB_VlinScaledCoord VW_Vlin
66 |
67 | void VH_UpdateScreen();
68 | #define VW_UpdateScreen VH_UpdateScreen
69 |
70 | //
71 | // wolfenstein EGA compatability stuff
72 | //
73 |
74 |
75 | #define VW_Shutdown VL_Shutdown
76 | #define VW_Bar VL_Bar
77 | #define VW_Plot VL_Plot
78 | #define VW_Hlin(x,z,y,c) VL_Hlin(x,y,(z)-(x)+1,c)
79 | #define VW_Vlin(y,z,x,c) VL_Vlin(x,y,(z)-(y)+1,c)
80 | #define VW_DrawPic VH_DrawPic
81 | #define VW_WaitVBL VL_WaitVBL
82 | #define VW_FadeIn() VL_FadeIn(0,255,gamepal,30);
83 | #define VW_FadeOut() VL_FadeOut(0,255,0,0,0,30);
84 | #define VW_ScreenToScreen VL_ScreenToScreen
85 | void VW_MeasurePropString (const char *string, word *width, word *height);
86 |
87 | #define LatchDrawChar(x,y,p) VL_LatchToScreen(latchpics[0],((p)&7)*8,((p)>>3)*8*64,8,8,x,y)
88 | #define LatchDrawTile(x,y,p) VL_LatchToScreen(latchpics[1],(p)*64,0,16,16,x,y)
89 |
90 | void LatchDrawPic (unsigned x, unsigned y, unsigned picnum);
91 | void LatchDrawPicScaledCoord (unsigned scx, unsigned scy, unsigned picnum);
92 | void LoadLatchMem (void);
93 |
94 | void VH_Startup();
95 | boolean FizzleFade (SDL_Surface *source, int x1, int y1,
96 | unsigned width, unsigned height, unsigned frames, boolean abortable);
97 |
98 | #define NUMLATCHPICS 100
99 | extern SDL_Surface *latchpics[NUMLATCHPICS];
100 |
--------------------------------------------------------------------------------
/components/wl_main/id_vl.h:
--------------------------------------------------------------------------------
1 | // ID_VL.H
2 |
3 | // wolf compatability
4 |
5 | void Quit (const char *error,...);
6 |
7 | //===========================================================================
8 |
9 | #define CHARWIDTH 2
10 | #define TILEWIDTH 4
11 |
12 | //===========================================================================
13 |
14 | extern SDL_Surface *screen, *screenBuffer, *curSurface;
15 |
16 | extern boolean fullscreen, usedoublebuffering;
17 | extern unsigned screenWidth, screenHeight, screenBits, screenPitch, bufferPitch, curPitch;
18 | extern unsigned scaleFactor;
19 |
20 | extern boolean screenfaded;
21 | extern unsigned bordercolor;
22 |
23 | extern SDL_Color gamepal[256];
24 |
25 | //===========================================================================
26 |
27 | //
28 | // VGA hardware routines
29 | //
30 |
31 | #define VL_WaitVBL(a) SDL_Delay((a)*8)
32 |
33 | void VL_SetVGAPlaneMode (void);
34 | void VL_SetTextMode (void);
35 | void VL_Shutdown (void);
36 |
37 | void VL_ConvertPalette(byte *srcpal, SDL_Color *destpal, int numColors);
38 | void VL_FillPalette (int red, int green, int blue);
39 | void VL_SetColor (int color, int red, int green, int blue);
40 | void VL_GetColor (int color, int *red, int *green, int *blue);
41 | void VL_SetPalette (SDL_Color *palette, bool forceupdate);
42 | void VL_GetPalette (SDL_Color *palette);
43 | void VL_FadeOut (int start, int end, int red, int green, int blue, int steps);
44 | void VL_FadeIn (int start, int end, SDL_Color *palette, int steps);
45 |
46 | byte *VL_LockSurface(SDL_Surface *surface);
47 | void VL_UnlockSurface(SDL_Surface *surface);
48 |
49 | #define LOCK() VL_LockSurface(curSurface)
50 | #define UNLOCK() VL_UnlockSurface(curSurface)
51 |
52 | byte VL_GetPixel (int x, int y);
53 | void VL_Plot (int x, int y, int color);
54 | void VL_Hlin (unsigned x, unsigned y, unsigned width, int color);
55 | void VL_Vlin (int x, int y, int height, int color);
56 | void VL_BarScaledCoord (int scx, int scy, int scwidth, int scheight, int color);
57 | void inline VL_Bar (int x, int y, int width, int height, int color)
58 | {
59 | VL_BarScaledCoord(scaleFactor*x, scaleFactor*y,
60 | scaleFactor*width, scaleFactor*height, color);
61 | }
62 | void inline VL_ClearScreen(int color)
63 | {
64 | SDL_FillRect(curSurface, NULL, color);
65 | }
66 |
67 | void VL_MungePic (byte *source, unsigned width, unsigned height);
68 | void VL_DrawPicBare (int x, int y, byte *pic, int width, int height);
69 | void VL_MemToLatch (byte *source, int width, int height,
70 | SDL_Surface *destSurface, int x, int y);
71 | void VL_ScreenToScreen (SDL_Surface *source, SDL_Surface *dest);
72 | void VL_MemToScreenScaledCoord (byte *source, int width, int height, int scx, int scy);
73 | void VL_MemToScreenScaledCoord (byte *source, int origwidth, int origheight, int srcx, int srcy,
74 | int destx, int desty, int width, int height);
75 |
76 | void inline VL_MemToScreen (byte *source, int width, int height, int x, int y)
77 | {
78 | VL_MemToScreenScaledCoord(source, width, height,
79 | scaleFactor*x, scaleFactor*y);
80 | }
81 |
82 | void VL_MaskedToScreen (byte *source, int width, int height, int x, int y);
83 |
84 | void VL_LatchToScreenScaledCoord (SDL_Surface *source, int xsrc, int ysrc,
85 | int width, int height, int scxdest, int scydest);
86 |
87 | void inline VL_LatchToScreen (SDL_Surface *source, int xsrc, int ysrc,
88 | int width, int height, int xdest, int ydest)
89 | {
90 | VL_LatchToScreenScaledCoord(source,xsrc,ysrc,width,height,
91 | scaleFactor*xdest,scaleFactor*ydest);
92 | }
93 | void inline VL_LatchToScreenScaledCoord (SDL_Surface *source, int scx, int scy)
94 | {
95 | VL_LatchToScreenScaledCoord(source,0,0,source->w,source->h,scx,scy);
96 | }
97 | void inline VL_LatchToScreen (SDL_Surface *source, int x, int y)
98 | {
99 | VL_LatchToScreenScaledCoord(source,0,0,source->w,source->h,
100 | scaleFactor*x,scaleFactor*y);
101 | }
102 |
--------------------------------------------------------------------------------
/components/wl_main/sodpal.inc:
--------------------------------------------------------------------------------
1 | RGB( 0, 0, 0),RGB( 0, 0, 42),RGB( 0, 42, 0),RGB( 0, 42, 42),RGB( 42, 0, 0),
2 | RGB( 42, 0, 42),RGB( 42, 21, 0),RGB( 42, 42, 42),RGB( 21, 21, 21),RGB( 21, 21, 63),
3 | RGB( 21, 63, 21),RGB( 21, 63, 63),RGB( 63, 21, 21),RGB( 63, 21, 63),RGB( 63, 63, 21),
4 | RGB( 63, 63, 63),RGB( 59, 59, 59),RGB( 55, 55, 55),RGB( 52, 52, 52),RGB( 48, 48, 48),
5 | RGB( 45, 45, 45),RGB( 42, 42, 42),RGB( 38, 38, 38),RGB( 35, 35, 35),RGB( 31, 31, 31),
6 | RGB( 28, 28, 28),RGB( 25, 25, 25),RGB( 21, 21, 21),RGB( 18, 18, 18),RGB( 14, 14, 14),
7 | RGB( 11, 11, 11),RGB( 8, 8, 8),RGB( 63, 0, 0),RGB( 59, 0, 0),RGB( 56, 0, 0),
8 | RGB( 53, 0, 0),RGB( 50, 0, 0),RGB( 47, 0, 0),RGB( 44, 0, 0),RGB( 41, 0, 0),
9 | RGB( 38, 0, 0),RGB( 34, 0, 0),RGB( 31, 0, 0),RGB( 28, 0, 0),RGB( 25, 0, 0),
10 | RGB( 22, 0, 0),RGB( 19, 0, 0),RGB( 16, 0, 0),RGB( 63, 54, 54),RGB( 63, 46, 46),
11 | RGB( 63, 39, 39),RGB( 63, 31, 31),RGB( 63, 23, 23),RGB( 63, 16, 16),RGB( 63, 8, 8),
12 | RGB( 63, 0, 0),RGB( 63, 42, 23),RGB( 63, 38, 16),RGB( 63, 34, 8),RGB( 63, 30, 0),
13 | RGB( 57, 27, 0),RGB( 51, 24, 0),RGB( 45, 21, 0),RGB( 39, 19, 0),RGB( 63, 63, 54),
14 | RGB( 63, 63, 46),RGB( 63, 63, 39),RGB( 63, 63, 31),RGB( 63, 62, 23),RGB( 63, 61, 16),
15 | RGB( 63, 61, 8),RGB( 63, 61, 0),RGB( 57, 54, 0),RGB( 51, 49, 0),RGB( 45, 43, 0),
16 | RGB( 39, 39, 0),RGB( 33, 33, 0),RGB( 28, 27, 0),RGB( 22, 21, 0),RGB( 16, 16, 0),
17 | RGB( 52, 63, 23),RGB( 49, 63, 16),RGB( 45, 63, 8),RGB( 40, 63, 0),RGB( 36, 57, 0),
18 | RGB( 32, 51, 0),RGB( 29, 45, 0),RGB( 24, 39, 0),RGB( 54, 63, 54),RGB( 47, 63, 46),
19 | RGB( 39, 63, 39),RGB( 32, 63, 31),RGB( 24, 63, 23),RGB( 16, 63, 16),RGB( 8, 63, 8),
20 | RGB( 0, 63, 0),RGB( 0, 63, 0),RGB( 0, 59, 0),RGB( 0, 56, 0),RGB( 0, 53, 0),
21 | RGB( 1, 50, 0),RGB( 1, 47, 0),RGB( 1, 44, 0),RGB( 1, 41, 0),RGB( 1, 38, 0),
22 | RGB( 1, 34, 0),RGB( 1, 31, 0),RGB( 1, 28, 0),RGB( 1, 25, 0),RGB( 1, 22, 0),
23 | RGB( 1, 19, 0),RGB( 1, 16, 0),RGB( 54, 63, 63),RGB( 46, 63, 63),RGB( 39, 63, 63),
24 | RGB( 31, 63, 62),RGB( 23, 63, 63),RGB( 16, 63, 63),RGB( 8, 63, 63),RGB( 0, 63, 63),
25 | RGB( 0, 57, 57),RGB( 0, 51, 51),RGB( 0, 45, 45),RGB( 0, 39, 39),RGB( 0, 33, 33),
26 | RGB( 0, 28, 28),RGB( 0, 22, 22),RGB( 0, 16, 16),RGB( 23, 47, 63),RGB( 16, 44, 63),
27 | RGB( 8, 42, 63),RGB( 0, 39, 63),RGB( 0, 35, 57),RGB( 0, 31, 51),RGB( 0, 27, 45),
28 | RGB( 0, 23, 39),RGB( 54, 54, 63),RGB( 46, 47, 63),RGB( 39, 39, 63),RGB( 31, 32, 63),
29 | RGB( 23, 24, 63),RGB( 16, 16, 63),RGB( 8, 9, 63),RGB( 0, 1, 63),RGB( 0, 0, 63),
30 | RGB( 0, 0, 59),RGB( 0, 0, 56),RGB( 0, 0, 53),RGB( 0, 0, 50),RGB( 0, 0, 47),
31 | RGB( 0, 0, 44),RGB( 0, 0, 41),RGB( 0, 0, 38),RGB( 0, 0, 34),RGB( 0, 0, 31),
32 | RGB( 0, 0, 28),RGB( 0, 0, 25),RGB( 0, 0, 22),RGB( 0, 0, 19),RGB( 0, 0, 16),
33 | RGB( 10, 10, 10),RGB( 63, 56, 13),RGB( 63, 53, 9),RGB( 63, 51, 6),RGB( 63, 48, 2),
34 | RGB( 63, 45, 0),RGB( 0, 14, 0),RGB( 0, 10, 0),RGB( 38, 0, 57),RGB( 32, 0, 51),
35 | RGB( 29, 0, 45),RGB( 24, 0, 39),RGB( 20, 0, 33),RGB( 17, 0, 28),RGB( 13, 0, 22),
36 | RGB( 10, 0, 16),RGB( 63, 54, 63),RGB( 63, 46, 63),RGB( 63, 39, 63),RGB( 63, 31, 63),
37 | RGB( 63, 23, 63),RGB( 63, 16, 63),RGB( 63, 8, 63),RGB( 63, 0, 63),RGB( 56, 0, 57),
38 | RGB( 50, 0, 51),RGB( 45, 0, 45),RGB( 39, 0, 39),RGB( 33, 0, 33),RGB( 27, 0, 28),
39 | RGB( 22, 0, 22),RGB( 16, 0, 16),RGB( 63, 58, 55),RGB( 63, 56, 52),RGB( 63, 54, 49),
40 | RGB( 63, 53, 47),RGB( 63, 51, 44),RGB( 63, 49, 41),RGB( 63, 47, 39),RGB( 63, 46, 36),
41 | RGB( 63, 44, 32),RGB( 63, 41, 28),RGB( 63, 39, 24),RGB( 60, 37, 23),RGB( 58, 35, 22),
42 | RGB( 55, 34, 21),RGB( 52, 32, 20),RGB( 50, 31, 19),RGB( 47, 30, 18),RGB( 45, 28, 17),
43 | RGB( 42, 26, 16),RGB( 40, 25, 15),RGB( 39, 24, 14),RGB( 36, 23, 13),RGB( 34, 22, 12),
44 | RGB( 32, 20, 11),RGB( 29, 19, 10),RGB( 27, 18, 9),RGB( 23, 16, 8),RGB( 21, 15, 7),
45 | RGB( 18, 14, 6),RGB( 16, 12, 6),RGB( 14, 11, 5),RGB( 10, 8, 3),RGB( 24, 0, 25),
46 | RGB( 0, 25, 25),RGB( 0, 24, 24),RGB( 0, 0, 7),RGB( 0, 0, 11),RGB( 12, 9, 4),
47 | RGB( 18, 0, 18),RGB( 20, 0, 20),RGB( 0, 0, 13),RGB( 7, 7, 7),RGB( 19, 19, 19),
48 | RGB( 23, 23, 23),RGB( 16, 16, 16),RGB( 12, 12, 12),RGB( 13, 13, 13),RGB( 54, 61, 61),
49 | RGB( 46, 58, 58),RGB( 39, 55, 55),RGB( 29, 50, 50),RGB( 18, 48, 48),RGB( 8, 45, 45),
50 | RGB( 8, 44, 44),RGB( 0, 41, 41),RGB( 0, 38, 38),RGB( 0, 35, 35),RGB( 0, 33, 33),
51 | RGB( 0, 31, 31),RGB( 0, 30, 30),RGB( 0, 29, 29),RGB( 0, 28, 28),RGB( 0, 27, 27),
52 | RGB( 38, 0, 34)
53 |
--------------------------------------------------------------------------------
/components/wl_main/version.h:
--------------------------------------------------------------------------------
1 | #ifndef _VERSION_H_
2 | #define _VERSION_H_
3 |
4 | #ifndef VERSIONALREADYCHOSEN // used for batch compiling
5 |
6 | #ifndef DATADIR
7 | #define DATADIR "/sd/data/Spear Of Destiny/base/"
8 | #endif
9 |
10 | /* Defines used for different versions */
11 |
12 | #define SPEAR
13 | //#define SPEARDEMO
14 | //#define UPLOAD
15 | #define GOODTIMES
16 | #define CARMACIZED
17 | //#define APOGEE_1_0
18 | //#define APOGEE_1_1
19 | //#define APOGEE_1_2
20 |
21 | /*
22 | Wolf3d Full v1.1 Apogee (with ReadThis) - define CARMACIZED and APOGEE_1_1
23 | Wolf3d Full v1.4 Apogee (with ReadThis) - define CARMACIZED
24 | Wolf3d Full v1.4 GT/ID/Activision - define CARMACIZED and GOODTIMES
25 | Wolf3d Shareware v1.0 - define UPLOAD and APOGEE_1_0
26 | Wolf3d Shareware v1.1 - define CARMACIZED and UPLOAD and APOGEE_1_1
27 | Wolf3d Shareware v1.2 - define CARMACIZED and UPLOAD and APOGEE_1_2
28 | Wolf3d Shareware v1.4 - define CARMACIZED and UPLOAD
29 | Spear of Destiny Full and Mission Disks - define CARMACIZED and SPEAR
30 | (and GOODTIMES for no FormGen quiz)
31 | Spear of Destiny Demo - define CARMACIZED and SPEAR and SPEARDEMO
32 | */
33 |
34 | #endif
35 |
36 | //#define USE_FEATUREFLAGS // Enables the level feature flags (see bottom of wl_def.h)
37 | //#define USE_SHADING // Enables shading support (see wl_shade.cpp)
38 | //#define USE_DIR3DSPR // Enables directional 3d sprites (see wl_dir3dspr.cpp)
39 | //#define USE_FLOORCEILINGTEX // Enables floor and ceiling textures stored in the third mapplane (see wl_floorceiling.cpp)
40 | //#define USE_HIRES // Enables high resolution textures/sprites (128x128)
41 | //#define USE_PARALLAX 16 // Enables parallax sky with 16 textures per sky (see wl_parallax.cpp)
42 | //#define USE_CLOUDSKY // Enables cloud sky support (see wl_cloudsky.cpp)
43 | //#define USE_STARSKY // Enables star sky support (see wl_atmos.cpp)
44 | //#define USE_RAIN // Enables rain support (see wl_atmos.cpp)
45 | //#define USE_SNOW // Enables snow support (see wl_atmos.cpp)
46 | //#define FIXRAINSNOWLEAKS // Enables leaking ceilings fix (by Adam Biser, only needed if maps with rain/snow and ceilings exist)
47 |
48 | #define DEBUGKEYS // Comment this out to compile without the Tab debug keys
49 | #define ARTSEXTERN
50 | #define DEMOSEXTERN
51 | #define PLAYDEMOLIKEORIGINAL // When playing or recording demos, several bug fixes do not take
52 | // effect to let the original demos work as in the original Wolf3D v1.4
53 | // (actually better, as the second demo rarely worked)
54 |
55 | #endif
56 |
--------------------------------------------------------------------------------
/components/wl_main/wl_atmos.h:
--------------------------------------------------------------------------------
1 | #ifndef _WL_ATMOS_H_
2 | #define _WL_ATMOS_H_
3 |
4 | #if defined(USE_STARSKY) || defined(USE_RAIN) || defined(USE_SNOW)
5 | void Init3DPoints();
6 | #endif
7 |
8 | #ifdef USE_STARSKY
9 | void DrawStarSky(byte *vbuf, uint32_t vbufPitch);
10 | #endif
11 |
12 | #ifdef USE_RAIN
13 | void DrawRain(byte *vbuf, uint32_t vbufPitch);
14 | #endif
15 |
16 | #ifdef USE_SNOW
17 | void DrawSnow(byte *vbuf, uint32_t vbufPitch);
18 | #endif
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/components/wl_main/wl_cloudsky.h:
--------------------------------------------------------------------------------
1 | #if defined(USE_CLOUDSKY) && !defined(_WL_CLOUDSKY_H_)
2 | #define _WL_CLOUDSKY_H_
3 |
4 | typedef struct
5 | {
6 | int length;
7 | int startAndDir;
8 | } colormapentry_t;
9 |
10 | typedef struct
11 | {
12 | int numColors;
13 | colormapentry_t *entries;
14 | } colormap_t;
15 |
16 | typedef struct
17 | {
18 | // The seed defines the look of the sky and every value (0-4294967295)
19 | // describes an unique sky. You can play around with these inside the game
20 | // when pressing +Z in debug mode. There you'll be able to change the
21 | // active seed to find out a value, which is suitable for your needs.
22 | uint32_t seed;
23 |
24 | // The speed defines how fast the clouds will move (0-65535)
25 | uint32_t speed;
26 |
27 | // The angle defines the move direction (0-359)
28 | uint32_t angle;
29 |
30 | // An index selecting the color map to be used for this sky definition.
31 | // This value can also be chosen with +Z
32 | uint32_t colorMapIndex;
33 | } cloudsky_t;
34 |
35 | extern cloudsky_t *curSky;
36 | extern colormap_t colorMaps[];
37 | extern const int numColorMaps;
38 |
39 | void InitSky();
40 | void DrawClouds(byte *vbuf, unsigned vbufPitch, int min_wallheight);
41 |
42 | #ifndef USE_FEATUREFLAGS
43 | int GetCloudSkyDefID();
44 | #endif
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/components/wl_main/wl_floorceiling.cpp:
--------------------------------------------------------------------------------
1 | #include "version.h"
2 |
3 | #ifdef USE_FLOORCEILINGTEX
4 |
5 | #include "wl_def.h"
6 | #include "wl_shade.h"
7 |
8 | // Textured Floor and Ceiling by DarkOne
9 | // With multi-textured floors and ceilings stored in lower and upper bytes of
10 | // according tile in third mapplane, respectively.
11 | void DrawFloorAndCeiling(byte *vbuf, unsigned vbufPitch, int min_wallheight)
12 | {
13 | fixed dist; // distance to row projection
14 | fixed tex_step; // global step per one screen pixel
15 | fixed gu, gv, du, dv; // global texture coordinates
16 | int u, v; // local texture coordinates
17 | byte *toptex, *bottex;
18 | unsigned lasttoptex = 0xffffffff, lastbottex = 0xffffffff;
19 |
20 | int halfheight = viewheight >> 1;
21 | int y0 = min_wallheight >> 3; // starting y value
22 | if(y0 > halfheight)
23 | return; // view obscured by walls
24 | if(!y0) y0 = 1; // don't let division by zero
25 | unsigned bot_offset0 = vbufPitch * (halfheight + y0);
26 | unsigned top_offset0 = vbufPitch * (halfheight - y0 - 1);
27 |
28 | // draw horizontal lines
29 | for(int y = y0, bot_offset = bot_offset0, top_offset = top_offset0;
30 | y < halfheight; y++, bot_offset += vbufPitch, top_offset -= vbufPitch)
31 | {
32 | dist = (heightnumerator / (y + 1)) << 5;
33 | gu = viewx + FixedMul(dist, viewcos);
34 | gv = -viewy + FixedMul(dist, viewsin);
35 | tex_step = (dist << 8) / viewwidth / 175;
36 | du = FixedMul(tex_step, viewsin);
37 | dv = -FixedMul(tex_step, viewcos);
38 | gu -= (viewwidth >> 1) * du;
39 | gv -= (viewwidth >> 1) * dv; // starting point (leftmost)
40 | #ifdef USE_SHADING
41 | byte *curshades = shadetable[GetShade(y << 3)];
42 | #endif
43 | for(int x = 0, bot_add = bot_offset, top_add = top_offset;
44 | x < viewwidth; x++, bot_add++, top_add++)
45 | {
46 | if(wallheight[x] >> 3 <= y)
47 | {
48 | int curx = (gu >> TILESHIFT) & (MAPSIZE - 1);
49 | int cury = (-(gv >> TILESHIFT) - 1) & (MAPSIZE - 1);
50 | unsigned curtex = MAPSPOT(curx, cury, 2);
51 | if(curtex)
52 | {
53 | unsigned curtoptex = curtex >> 8;
54 | if (curtoptex != lasttoptex)
55 | {
56 | lasttoptex = curtoptex;
57 | toptex = PM_GetTexture(curtoptex);
58 | }
59 | unsigned curbottex = curtex & 0xff;
60 | if (curbottex != lastbottex)
61 | {
62 | lastbottex = curbottex;
63 | bottex = PM_GetTexture(curbottex);
64 | }
65 | u = (gu >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);
66 | v = (gv >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);
67 | unsigned texoffs = (u << TEXTURESHIFT) + (TEXTURESIZE - 1) - v;
68 | #ifdef USE_SHADING
69 | if(curtoptex)
70 | vbuf[top_add] = curshades[toptex[texoffs]];
71 | if(curbottex)
72 | vbuf[bot_add] = curshades[bottex[texoffs]];
73 | #else
74 | if(curtoptex)
75 | vbuf[top_add] = toptex[texoffs];
76 | if(curbottex)
77 | vbuf[bot_add] = bottex[texoffs];
78 | #endif
79 | }
80 | }
81 | gu += du;
82 | gv += dv;
83 | }
84 | }
85 | }
86 |
87 | #endif
88 |
--------------------------------------------------------------------------------
/components/wl_main/wl_main.h:
--------------------------------------------------------------------------------
1 | extern int main (int argc, char *argv[]);
2 | void WriteConfig(void);
--------------------------------------------------------------------------------
/components/wl_main/wl_parallax.cpp:
--------------------------------------------------------------------------------
1 | #include "version.h"
2 |
3 | #ifdef USE_PARALLAX
4 |
5 | #include "wl_def.h"
6 |
7 | #ifdef USE_FEATUREFLAGS
8 |
9 | // The lower left tile of every map determines the start texture of the parallax sky.
10 | static int GetParallaxStartTexture()
11 | {
12 | int startTex = ffDataBottomLeft;
13 | assert(startTex >= 0 && startTex < PMSpriteStart);
14 | return startTex;
15 | }
16 |
17 | #else
18 |
19 | static int GetParallaxStartTexture()
20 | {
21 | int startTex;
22 | switch(gamestate.episode * 10 + mapon)
23 | {
24 | case 0: startTex = 20; break;
25 | default: startTex = 0; break;
26 | }
27 | assert(startTex >= 0 && startTex < PMSpriteStart);
28 | return startTex;
29 | }
30 |
31 | #endif
32 |
33 | void DrawParallax(byte *vbuf, unsigned vbufPitch)
34 | {
35 | int startpage = GetParallaxStartTexture();
36 | int midangle = player->angle * (FINEANGLES / ANGLES);
37 | int skyheight = viewheight >> 1;
38 | int curtex = -1;
39 | byte *skytex;
40 |
41 | startpage += USE_PARALLAX - 1;
42 |
43 | for(int x = 0; x < viewwidth; x++)
44 | {
45 | int curang = pixelangle[x] + midangle;
46 | if(curang < 0) curang += FINEANGLES;
47 | else if(curang >= FINEANGLES) curang -= FINEANGLES;
48 | int xtex = curang * USE_PARALLAX * TEXTURESIZE / FINEANGLES;
49 | int newtex = xtex >> TEXTURESHIFT;
50 | if(newtex != curtex)
51 | {
52 | curtex = newtex;
53 | skytex = PM_GetTexture(startpage - curtex);
54 | }
55 | int texoffs = TEXTUREMASK - ((xtex & (TEXTURESIZE - 1)) << TEXTURESHIFT);
56 | int yend = skyheight - (wallheight[x] >> 3);
57 | if(yend <= 0) continue;
58 |
59 | for(int y = 0, offs = x; y < yend; y++, offs += vbufPitch)
60 | vbuf[offs] = skytex[texoffs + (y * TEXTURESIZE) / skyheight];
61 | }
62 | }
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/components/wl_main/wl_shade.cpp:
--------------------------------------------------------------------------------
1 | #include "version.h"
2 |
3 | #ifdef USE_SHADING
4 | #include "wl_def.h"
5 | #include "wl_shade.h"
6 |
7 | typedef struct {
8 | uint8_t destRed, destGreen, destBlue; // values between 0 and 255
9 | uint8_t fogStrength;
10 | } shadedef_t;
11 |
12 | shadedef_t shadeDefs[] = {
13 | { 0, 0, 0, LSHADE_NOSHADING },
14 | { 0, 0, 0, LSHADE_NORMAL },
15 | { 0, 0, 0, LSHADE_FOG },
16 | { 40, 40, 40, LSHADE_NORMAL },
17 | { 60, 60, 60, LSHADE_FOG }
18 | };
19 |
20 | uint8_t shadetable[SHADE_COUNT][256];
21 | int LSHADE_flag;
22 |
23 | #ifdef USE_FEATUREFLAGS
24 |
25 | // The lower 8-bit of the upper left tile of every map determine
26 | // the used shading definition of shadeDefs.
27 | static inline int GetShadeDefID()
28 | {
29 | int shadeID = ffDataTopLeft & 0x00ff;
30 | assert(shadeID >= 0 && shadeID < lengthof(shadeDefs));
31 | return shadeID;
32 | }
33 |
34 | #else
35 |
36 | static int GetShadeDefID()
37 | {
38 | int shadeID;
39 | switch(gamestate.episode * 10 + mapon)
40 | {
41 | case 0: shadeID = 4; break;
42 | case 1:
43 | case 2:
44 | case 6: shadeID = 1; break;
45 | case 3: shadeID = 0; break;
46 | case 5: shadeID = 2; break;
47 | default: shadeID = 3; break;
48 | }
49 | assert(shadeID >= 0 && shadeID < lengthof(shadeDefs));
50 | return shadeID;
51 | }
52 |
53 | #endif
54 |
55 |
56 | // Returns the palette index of the nearest matching color of the
57 | // given RGB color in given palette
58 | byte GetColor(byte red, byte green, byte blue, SDL_Color *palette)
59 | {
60 | byte mincol = 0;
61 | double mindist = 200000.F, curdist, DRed, DGreen, DBlue;
62 |
63 | SDL_Color *palPtr = palette;
64 |
65 | for(int col = 0; col < 256; col++, palPtr++)
66 | {
67 | DRed = (double) (red - palPtr->r);
68 | DGreen = (double) (green - palPtr->g);
69 | DBlue = (double) (blue - palPtr->b);
70 | curdist = DRed * DRed + DGreen * DGreen + DBlue * DBlue;
71 | if(curdist < mindist)
72 | {
73 | mindist = curdist;
74 | mincol = (byte) col;
75 | }
76 | }
77 | return mincol;
78 | }
79 |
80 | // Fade all colors in 32 steps down to the destination-RGB
81 | // (use gray for fogging, black for standard shading)
82 | void GenerateShadeTable(byte destRed, byte destGreen, byte destBlue,
83 | SDL_Color *palette, int fog)
84 | {
85 | double curRed, curGreen, curBlue, redStep, greenStep, blueStep;
86 | SDL_Color *palPtr = palette;
87 |
88 | // Set the fog-flag
89 | LSHADE_flag=fog;
90 |
91 | // Color loop
92 | for(int i = 0; i < 256; i++, palPtr++)
93 | {
94 | // Get original palette color
95 | curRed = palPtr->r;
96 | curGreen = palPtr->g;
97 | curBlue = palPtr->b;
98 |
99 | // Calculate increment per step
100 | redStep = ((double) destRed - curRed) / (SHADE_COUNT + 8);
101 | greenStep = ((double) destGreen - curGreen) / (SHADE_COUNT + 8);
102 | blueStep = ((double) destBlue - curBlue) / (SHADE_COUNT + 8);
103 |
104 | // Calc color for each shade of the current color
105 | for (int shade = 0; shade < SHADE_COUNT; shade++)
106 | {
107 | shadetable[shade][i] = GetColor((byte) curRed, (byte) curGreen, (byte) curBlue, palette);
108 |
109 | // Inc to next shade
110 | curRed += redStep;
111 | curGreen += greenStep;
112 | curBlue += blueStep;
113 | }
114 | }
115 | }
116 |
117 | void NoShading()
118 | {
119 | for(int shade = 0; shade < SHADE_COUNT; shade++)
120 | for(int i = 0; i < 256; i++)
121 | shadetable[shade][i] = i;
122 | }
123 |
124 | void InitLevelShadeTable()
125 | {
126 | shadedef_t *shadeDef = &shadeDefs[GetShadeDefID()];
127 | if(shadeDef->fogStrength == LSHADE_NOSHADING)
128 | NoShading();
129 | else
130 | GenerateShadeTable(shadeDef->destRed, shadeDef->destGreen, shadeDef->destBlue, gamepal, shadeDef->fogStrength);
131 | }
132 |
133 | int GetShade(int scale)
134 | {
135 | int shade = (scale >> 1) / (((viewwidth * 3) >> 8) + 1 + LSHADE_flag); // TODO: reconsider this...
136 | if(shade > 32) shade = 32;
137 | else if(shade < 1) shade = 1;
138 | shade = 32 - shade;
139 |
140 | return shade;
141 | }
142 |
143 | #endif
144 |
--------------------------------------------------------------------------------
/components/wl_main/wl_shade.h:
--------------------------------------------------------------------------------
1 | #if defined(USE_SHADING) && !defined(_WL_SHADE_H_)
2 | #define _WL_SHADE_H_
3 |
4 | #define SHADE_COUNT 32
5 |
6 | #define LSHADE_NOSHADING 0xff
7 | #define LSHADE_NORMAL 0
8 | #define LSHADE_FOG 5
9 |
10 | extern uint8_t shadetable[SHADE_COUNT][256];
11 |
12 | void InitLevelShadeTable();
13 | int GetShade(int scale);
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/components/wl_main/wolfpal.inc:
--------------------------------------------------------------------------------
1 | RGB( 0, 0, 0),RGB( 0, 0, 42),RGB( 0, 42, 0),RGB( 0, 42, 42),RGB( 42, 0, 0),
2 | RGB( 42, 0, 42),RGB( 42, 21, 0),RGB( 42, 42, 42),RGB( 21, 21, 21),RGB( 21, 21, 63),
3 | RGB( 21, 63, 21),RGB( 21, 63, 63),RGB( 63, 21, 21),RGB( 63, 21, 63),RGB( 63, 63, 21),
4 | RGB( 63, 63, 63),RGB( 59, 59, 59),RGB( 55, 55, 55),RGB( 52, 52, 52),RGB( 48, 48, 48),
5 | RGB( 45, 45, 45),RGB( 42, 42, 42),RGB( 38, 38, 38),RGB( 35, 35, 35),RGB( 31, 31, 31),
6 | RGB( 28, 28, 28),RGB( 25, 25, 25),RGB( 21, 21, 21),RGB( 18, 18, 18),RGB( 14, 14, 14),
7 | RGB( 11, 11, 11),RGB( 8, 8, 8),RGB( 63, 0, 0),RGB( 59, 0, 0),RGB( 56, 0, 0),
8 | RGB( 53, 0, 0),RGB( 50, 0, 0),RGB( 47, 0, 0),RGB( 44, 0, 0),RGB( 41, 0, 0),
9 | RGB( 38, 0, 0),RGB( 34, 0, 0),RGB( 31, 0, 0),RGB( 28, 0, 0),RGB( 25, 0, 0),
10 | RGB( 22, 0, 0),RGB( 19, 0, 0),RGB( 16, 0, 0),RGB( 63, 54, 54),RGB( 63, 46, 46),
11 | RGB( 63, 39, 39),RGB( 63, 31, 31),RGB( 63, 23, 23),RGB( 63, 16, 16),RGB( 63, 8, 8),
12 | RGB( 63, 0, 0),RGB( 63, 42, 23),RGB( 63, 38, 16),RGB( 63, 34, 8),RGB( 63, 30, 0),
13 | RGB( 57, 27, 0),RGB( 51, 24, 0),RGB( 45, 21, 0),RGB( 39, 19, 0),RGB( 63, 63, 54),
14 | RGB( 63, 63, 46),RGB( 63, 63, 39),RGB( 63, 63, 31),RGB( 63, 62, 23),RGB( 63, 61, 16),
15 | RGB( 63, 61, 8),RGB( 63, 61, 0),RGB( 57, 54, 0),RGB( 51, 49, 0),RGB( 45, 43, 0),
16 | RGB( 39, 39, 0),RGB( 33, 33, 0),RGB( 28, 27, 0),RGB( 22, 21, 0),RGB( 16, 16, 0),
17 | RGB( 52, 63, 23),RGB( 49, 63, 16),RGB( 45, 63, 8),RGB( 40, 63, 0),RGB( 36, 57, 0),
18 | RGB( 32, 51, 0),RGB( 29, 45, 0),RGB( 24, 39, 0),RGB( 54, 63, 54),RGB( 47, 63, 46),
19 | RGB( 39, 63, 39),RGB( 32, 63, 31),RGB( 24, 63, 23),RGB( 16, 63, 16),RGB( 8, 63, 8),
20 | RGB( 0, 63, 0),RGB( 0, 63, 0),RGB( 0, 59, 0),RGB( 0, 56, 0),RGB( 0, 53, 0),
21 | RGB( 1, 50, 0),RGB( 1, 47, 0),RGB( 1, 44, 0),RGB( 1, 41, 0),RGB( 1, 38, 0),
22 | RGB( 1, 34, 0),RGB( 1, 31, 0),RGB( 1, 28, 0),RGB( 1, 25, 0),RGB( 1, 22, 0),
23 | RGB( 1, 19, 0),RGB( 1, 16, 0),RGB( 54, 63, 63),RGB( 46, 63, 63),RGB( 39, 63, 63),
24 | RGB( 31, 63, 62),RGB( 23, 63, 63),RGB( 16, 63, 63),RGB( 8, 63, 63),RGB( 0, 63, 63),
25 | RGB( 0, 57, 57),RGB( 0, 51, 51),RGB( 0, 45, 45),RGB( 0, 39, 39),RGB( 0, 33, 33),
26 | RGB( 0, 28, 28),RGB( 0, 22, 22),RGB( 0, 16, 16),RGB( 23, 47, 63),RGB( 16, 44, 63),
27 | RGB( 8, 42, 63),RGB( 0, 39, 63),RGB( 0, 35, 57),RGB( 0, 31, 51),RGB( 0, 27, 45),
28 | RGB( 0, 23, 39),RGB( 54, 54, 63),RGB( 46, 47, 63),RGB( 39, 39, 63),RGB( 31, 32, 63),
29 | RGB( 23, 24, 63),RGB( 16, 16, 63),RGB( 8, 9, 63),RGB( 0, 1, 63),RGB( 0, 0, 63),
30 | RGB( 0, 0, 59),RGB( 0, 0, 56),RGB( 0, 0, 53),RGB( 0, 0, 50),RGB( 0, 0, 47),
31 | RGB( 0, 0, 44),RGB( 0, 0, 41),RGB( 0, 0, 38),RGB( 0, 0, 34),RGB( 0, 0, 31),
32 | RGB( 0, 0, 28),RGB( 0, 0, 25),RGB( 0, 0, 22),RGB( 0, 0, 19),RGB( 0, 0, 16),
33 | RGB( 10, 10, 10),RGB( 63, 56, 13),RGB( 63, 53, 9),RGB( 63, 51, 6),RGB( 63, 48, 2),
34 | RGB( 63, 45, 0),RGB( 45, 8, 63),RGB( 42, 0, 63),RGB( 38, 0, 57),RGB( 32, 0, 51),
35 | RGB( 29, 0, 45),RGB( 24, 0, 39),RGB( 20, 0, 33),RGB( 17, 0, 28),RGB( 13, 0, 22),
36 | RGB( 10, 0, 16),RGB( 63, 54, 63),RGB( 63, 46, 63),RGB( 63, 39, 63),RGB( 63, 31, 63),
37 | RGB( 63, 23, 63),RGB( 63, 16, 63),RGB( 63, 8, 63),RGB( 63, 0, 63),RGB( 56, 0, 57),
38 | RGB( 50, 0, 51),RGB( 45, 0, 45),RGB( 39, 0, 39),RGB( 33, 0, 33),RGB( 27, 0, 28),
39 | RGB( 22, 0, 22),RGB( 16, 0, 16),RGB( 63, 58, 55),RGB( 63, 56, 52),RGB( 63, 54, 49),
40 | RGB( 63, 53, 47),RGB( 63, 51, 44),RGB( 63, 49, 41),RGB( 63, 47, 39),RGB( 63, 46, 36),
41 | RGB( 63, 44, 32),RGB( 63, 41, 28),RGB( 63, 39, 24),RGB( 60, 37, 23),RGB( 58, 35, 22),
42 | RGB( 55, 34, 21),RGB( 52, 32, 20),RGB( 50, 31, 19),RGB( 47, 30, 18),RGB( 45, 28, 17),
43 | RGB( 42, 26, 16),RGB( 40, 25, 15),RGB( 39, 24, 14),RGB( 36, 23, 13),RGB( 34, 22, 12),
44 | RGB( 32, 20, 11),RGB( 29, 19, 10),RGB( 27, 18, 9),RGB( 23, 16, 8),RGB( 21, 15, 7),
45 | RGB( 18, 14, 6),RGB( 16, 12, 6),RGB( 14, 11, 5),RGB( 10, 8, 3),RGB( 24, 0, 25),
46 | RGB( 0, 25, 25),RGB( 0, 24, 24),RGB( 0, 0, 7),RGB( 0, 0, 11),RGB( 12, 9, 4),
47 | RGB( 18, 0, 18),RGB( 20, 0, 20),RGB( 0, 0, 13),RGB( 7, 7, 7),RGB( 19, 19, 19),
48 | RGB( 23, 23, 23),RGB( 16, 16, 16),RGB( 12, 12, 12),RGB( 13, 13, 13),RGB( 54, 61, 61),
49 | RGB( 46, 58, 58),RGB( 39, 55, 55),RGB( 29, 50, 50),RGB( 18, 48, 48),RGB( 8, 45, 45),
50 | RGB( 8, 44, 44),RGB( 0, 41, 41),RGB( 0, 38, 38),RGB( 0, 35, 35),RGB( 0, 33, 33),
51 | RGB( 0, 31, 31),RGB( 0, 30, 30),RGB( 0, 29, 29),RGB( 0, 28, 28),RGB( 0, 27, 27),
52 | RGB( 38, 0, 34)
53 |
--------------------------------------------------------------------------------
/config.default:
--------------------------------------------------------------------------------
1 | CFLAGS += -O2
2 |
--------------------------------------------------------------------------------
/images/Tile.data:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/images/Tile.data
--------------------------------------------------------------------------------
/images/Tile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/images/Tile.png
--------------------------------------------------------------------------------
/images/TileSOD.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/images/TileSOD.png
--------------------------------------------------------------------------------
/images/tile.raw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/images/tile.raw
--------------------------------------------------------------------------------
/images/tileSOD.raw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/images/tileSOD.raw
--------------------------------------------------------------------------------
/license-mame.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 1997-2005, Nicola Salmoria and the MAME team
2 | All rights reserved.
3 |
4 | Redistribution and use of this code or any derivative works are permitted
5 | provided that the following conditions are met:
6 |
7 | * Redistributions may not be sold, nor may they be used in a commercial
8 | product or activity.
9 |
10 | * Redistributions that are modified from the original source must include the
11 | complete source code, including the source code for all components used by a
12 | binary built from the modified sources. However, as a special exception, the
13 | source code distributed need not include anything that is normally distributed
14 | (in either source or binary form) with the major components (compiler, kernel,
15 | and so on) of the operating system on which the executable runs, unless that
16 | component itself accompanies the executable.
17 |
18 | * Redistributions must reproduce the above copyright notice, this list of
19 | conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | POSSIBILITY OF SUCH DAMAGE.
33 |
--------------------------------------------------------------------------------
/main/app_main.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #include "freertos/FreeRTOS.h"
10 | #include "freertos/task.h"
11 |
12 | #include "sys/uio.h"
13 | #include "wl_main.h"
14 | extern "C"
15 | {
16 | #include "SDL.h"
17 | }
18 |
19 | void wolfTask(void *pvParameters)
20 | {
21 | char *argv[]={"", NULL};
22 | main(1, argv);
23 | }
24 |
25 | extern "C" void app_main(void)
26 | //void app_main(void)
27 | {
28 | xTaskCreatePinnedToCore(&wolfTask, "wolfTask", 12000, NULL, 5, NULL, 0/*tskNO_AFFINITY*/);
29 | }
30 |
--------------------------------------------------------------------------------
/main/component.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Main Makefile. This is basically the same as a component makefile.
3 | #
4 | # This Makefile should, at the very least, just include $(SDK_PATH)/make/component.mk. By default,
5 | # this will take the sources in the src/ directory, compile them and link them into
6 | # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
7 | # please read the SDK documents if you need to do this.
8 | #
9 |
10 | #include $(IDF_PATH)/make/component_common.mk
11 |
12 | COMPONENT_ADD_INCLUDEDIRS += ../components/wl_main ../components/SDL ../components/SDL_mixer-1.2.12
--------------------------------------------------------------------------------
/release/README.md:
--------------------------------------------------------------------------------
1 | # Wolfenstein 3D
2 | This is the firmware for the Steam version:
3 |
4 | Wolf3D_Full_ID_ACTIVISION_1_4.fw
5 |
--------------------------------------------------------------------------------
/release/Spear Of Destiny Demo.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Spear Of Destiny Demo.fw
--------------------------------------------------------------------------------
/release/Spear Of Destiny.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Spear Of Destiny.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Full_APOGEE_1_1.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Full_APOGEE_1_1.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Full_APOGEE_1_4.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Full_APOGEE_1_4.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Full_ID_ACTIVISION_1_4.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Full_ID_ACTIVISION_1_4.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Shareware_1_0.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Shareware_1_0.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Shareware_1_1.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Shareware_1_1.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Shareware_1_2.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Shareware_1_2.fw
--------------------------------------------------------------------------------
/release/Wolf3D_Shareware_1_4.fw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jkirsons/wolf4sdl/de11ccbd24263e136b06df5ec9a884afdd592b6e/release/Wolf3D_Shareware_1_4.fw
--------------------------------------------------------------------------------