├── playym ├── config.h ├── stsoundlib │ ├── YmMusic.cpp │ ├── Makefile │ └── digidrum.h ├── lzh │ └── Makefile ├── ymtype.h ├── README ├── ymplay.h ├── ChangeLog └── Makefile ├── ocp-sdl ├── ocp-sdl2 ├── ocp-vcsa ├── ocp-x11 ├── ocp-curses ├── devp └── Makefile-static ├── mingw ├── Makefile-static ├── ocp.ico ├── Makefile ├── versionsconf.sh └── ocp.rc.in ├── doc ├── opencp.dox.in ├── screenshot-01.png ├── Makefile ├── cmdline.txt ├── texi │ ├── Makefile │ └── support.texi └── ocp.1.in ├── playay ├── driver.h ├── aytype.h ├── main.c ├── ayplay.h ├── portmap.txt ├── sound.h ├── main.h └── z80.h ├── plugins ├── freverb.c ├── ireverb.c └── Makefile ├── goodies ├── tga2wav │ ├── c.tga │ ├── makefile.gnu │ └── makefile.wat ├── wap │ ├── wap_eng.txt │ ├── wap_ger.txt │ └── makefile ├── pack │ └── Makefile.in ├── helpc │ └── Makefile.in └── Makefile ├── desktop ├── opencubicplayer-16x16.png ├── opencubicplayer-22x22.png ├── opencubicplayer-24x24.png ├── opencubicplayer-32x32.png ├── opencubicplayer-48x48.png ├── opencubicplayer-64x64.png ├── opencubicplayer-128x128.png └── opencubicplayer.desktop.in ├── KEYBOARD_REMAPS ├── filesel ├── cdfs │ ├── main.h │ ├── audio.h │ ├── Makefile-static │ ├── cue.h │ ├── toc.h │ ├── wave.h │ └── Makefile ├── filesystem-z.h ├── filesystem-pak.h ├── filesystem-rpg.h ├── filesystem-tar.h ├── filesystem-zip.h ├── filesystem-gzip.h ├── fsptype.h ├── filesystem-bzip2.h ├── modland.com │ ├── Makefile-static │ └── Makefile ├── filesystem-playlist-m3u.h ├── filesystem-playlist-pls.h ├── filesystem-textfile.h ├── charsets.h ├── filesystem-unix.h ├── filesystem-filehandle-cache.h ├── filesystem-setup.h ├── cphlpfs.h ├── filesystem-windows.h ├── filesystem-file-mem.h ├── filesystem-ancient.h ├── filesystem-dir-mem.h ├── cdrom.h ├── adbmeta.h ├── musicbrainz.h ├── filesystem-drive.h ├── filesystem-playlist.h ├── Makefile-static ├── download.h ├── filesystem-setup.c ├── cphlpfs.c └── modlist.h ├── cpiface ├── cpiptype.h ├── png.h ├── jpeg.h ├── fft.h ├── cpipic.h ├── vol.h ├── Makefile-static ├── mcpedit.h ├── cpiptype.c └── cpiface-private.h ├── stuff ├── poutput-vcsa.h ├── poutput-curses.h ├── poutput-x11.h ├── poutput-sdl.h ├── poutput-sdl2.h ├── poll.h ├── poutput-fb.h ├── latin1.h ├── compat-test.sh ├── framelock.h ├── x11-common.h ├── err.h ├── CaseFoldingTable-3.c ├── cp437.h ├── poutput-keyboard.h ├── codepage.h ├── pfonts.h ├── piperun.h ├── sets.h ├── utf-16.h ├── ttf.h ├── utf-8.h ├── Makefile-static ├── pfonts.c ├── pagesize.inc.c ├── poutput-fontengine.h ├── imsrtns.h ├── poutput-swtext.h ├── file.h └── poll.c ├── medialib ├── Makefile-static └── Makefile ├── boot ├── console.h ├── Makefile-static ├── pmain.h ├── plinkman_end.c ├── compdate.c └── Makefile ├── playhvl ├── hvlpchan.h ├── hvlpinst.h ├── hvlptrak.h ├── hvlpdots.h ├── hvltype.h ├── loader.h ├── hvlpdots.c └── hvlplay.h ├── TODO ├── playopl ├── oplptrak.h ├── opltype.h ├── oplconfig.h ├── oplplay.h ├── oplNuked.h ├── oplWoody.h ├── oplKen.h ├── oplRetroWave.h ├── oplWoody.cpp ├── oplNuked.cpp └── oplSatoh.h ├── playgmd ├── gmdpdots.h ├── gmdptrak.h ├── gmdpchan.h ├── gmdtype.h ├── gmdinst.h └── gmdpdots.c ├── dev ├── plrasm.h ├── Makefile-static ├── mixclip.h ├── mixasm.h ├── mchasm.h ├── deviwave.h ├── deviplay.h ├── postproc.h ├── mix.h ├── smpman_asminctest.c ├── player.h └── smpman_asminc.c ├── help ├── Makefile-static ├── cphelper.h └── Makefile ├── playsid ├── cpiinfo.h ├── cpisidsetup.h ├── sidconfig.h ├── sidtype.h └── sidplayfp-config │ └── config.h.in ├── SUID ├── playit ├── itchan.h └── ittype.h ├── playtimidity ├── cpitimiditysetup.h ├── timidityconfig.h ├── timiditytype.h ├── cpikaraoke.h ├── timidityplay.h ├── interface.h └── timiditypdots.c ├── playxm ├── xmchan.h └── xmtype.h ├── playgme ├── gmetype.h ├── gmeplay.h └── Makefile ├── playcda ├── cdatype.h ├── cdaudio.h ├── Makefile └── cdatype.c ├── playogg ├── oggtype.h ├── oggplay.h └── Makefile ├── playwav ├── wavtype.h ├── wave.h └── Makefile ├── playmp2 ├── mptype.h └── mpplay.h ├── playflac ├── flactype.h ├── flacplay.h └── Makefile ├── X11-keymap ├── devw ├── dwmixa.h ├── dwmixqa.h ├── dwmix.h ├── dwmixa.c ├── dwmixqa.c └── dwmixfa.c ├── no-curses.h ├── .gitmodules ├── README.Darwin ├── crashreport.txt ├── aclocal.m4 ├── m4 ├── ax_require_defined.m4 ├── ax_cxx_compile_stdcxx_14.m4 ├── ax_cxx_compile_stdcxx_17.m4 └── ax_cxx_compile_stdcxx_11.m4 ├── .gitignore └── AUTHORS /playym/config.h: -------------------------------------------------------------------------------- 1 | #include "../config.h" 2 | -------------------------------------------------------------------------------- /ocp-sdl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec ocp -dsdl "$@" 3 | -------------------------------------------------------------------------------- /ocp-sdl2: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec ocp -dsdl2 "$@" 3 | -------------------------------------------------------------------------------- /ocp-vcsa: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec ocp -dvcsa "$@" 3 | -------------------------------------------------------------------------------- /ocp-x11: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec ocp -dx11 "$@" 3 | -------------------------------------------------------------------------------- /ocp-curses: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec ocp -dcurses "$@" 3 | -------------------------------------------------------------------------------- /devp/Makefile-static: -------------------------------------------------------------------------------- 1 | LIBOCP_OBJECTS += devp/devpdisk.o 2 | -------------------------------------------------------------------------------- /mingw/Makefile-static: -------------------------------------------------------------------------------- 1 | ifeq ($(WINDOWS),1) 2 | OCP_OBJECTS+=mingw/ocp.res 3 | endif 4 | -------------------------------------------------------------------------------- /mingw/ocp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/mingw/ocp.ico -------------------------------------------------------------------------------- /doc/opencp.dox.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/doc/opencp.dox.in -------------------------------------------------------------------------------- /playay/driver.h: -------------------------------------------------------------------------------- 1 | OCP_INTERNAL void ay_driver_frame (int16_t *stereo_samples, size_t bytes); 2 | -------------------------------------------------------------------------------- /plugins/freverb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/plugins/freverb.c -------------------------------------------------------------------------------- /plugins/ireverb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/plugins/ireverb.c -------------------------------------------------------------------------------- /doc/screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/doc/screenshot-01.png -------------------------------------------------------------------------------- /goodies/tga2wav/c.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/goodies/tga2wav/c.tga -------------------------------------------------------------------------------- /goodies/wap/wap_eng.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/goodies/wap/wap_eng.txt -------------------------------------------------------------------------------- /goodies/wap/wap_ger.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/goodies/wap/wap_ger.txt -------------------------------------------------------------------------------- /playym/stsoundlib/YmMusic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/playym/stsoundlib/YmMusic.cpp -------------------------------------------------------------------------------- /desktop/opencubicplayer-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-16x16.png -------------------------------------------------------------------------------- /desktop/opencubicplayer-22x22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-22x22.png -------------------------------------------------------------------------------- /desktop/opencubicplayer-24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-24x24.png -------------------------------------------------------------------------------- /desktop/opencubicplayer-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-32x32.png -------------------------------------------------------------------------------- /desktop/opencubicplayer-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-48x48.png -------------------------------------------------------------------------------- /desktop/opencubicplayer-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-64x64.png -------------------------------------------------------------------------------- /desktop/opencubicplayer-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mywave82/opencubicplayer/HEAD/desktop/opencubicplayer-128x128.png -------------------------------------------------------------------------------- /KEYBOARD_REMAPS: -------------------------------------------------------------------------------- 1 | ctrl-enter -> alt-enter 2 | ctrl-right -> > 3 | ctrl-left -> < 4 | ctrl-f9 -> | (song message) 5 | ctrl-f12 -> \ 6 | -------------------------------------------------------------------------------- /filesel/cdfs/main.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAIN_H 2 | #define _MAIN_H 3 | 4 | #include 5 | 6 | extern iconv_t UTF16BE_cd; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /filesel/filesystem-z.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_Z_H 2 | #define _FILESYSTEM_Z_H 1 3 | 4 | void filesystem_Z_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/filesystem-pak.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_PAK_H 2 | #define _FILESYSTEM_PAK_H 1 3 | 4 | void filesystem_pak_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/filesystem-rpg.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_RPG_H 2 | #define _FILESYSTEM_RPG_H 1 3 | 4 | void filesystem_rpg_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/filesystem-tar.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_TAR_H 2 | #define _FILESYSTEM_TAR_H 1 3 | 4 | void filesystem_tar_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/filesystem-zip.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_ZIP_H 2 | #define _FILESYSTEM_ZIP_H 1 3 | 4 | void filesystem_zip_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/filesystem-gzip.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_GZIP_H 2 | #define _FILESYSTEM_GZIP_H 1 3 | 4 | void filesystem_gzip_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/fsptype.h: -------------------------------------------------------------------------------- 1 | #ifndef FILESEL_FSTYPE_H 2 | #define FILESEL_FSTYPE_H 1 3 | 4 | extern struct mdbreadinforegstruct fsReadInfoReg; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /cpiface/cpiptype.h: -------------------------------------------------------------------------------- 1 | #ifndef CPIFACE_CPIPTYPE_H 2 | #define CPIFACE_CPIPTYPE_H 1 3 | 4 | extern struct mdbreadinforegstruct cpiReadInfoReg; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /filesel/filesystem-bzip2.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_BZIP2_H 2 | #define _FILESYSTEM_BZIP2_H 1 3 | 4 | void filesystem_bzip2_register (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /goodies/tga2wav/makefile.gnu: -------------------------------------------------------------------------------- 1 | CXXFLAGS+= -Wall -O2 2 | 3 | tga2wav: tga2wav.o 4 | $(CXX) -o $@ $^ -lm 5 | 6 | clean: 7 | rm -f tga2wav *.o *~ *.wav 8 | -------------------------------------------------------------------------------- /stuff/poutput-vcsa.h: -------------------------------------------------------------------------------- 1 | #ifndef _VCSA_OCP 2 | #define _VCSA_OCP 1 3 | 4 | extern int vcsa_init(int minor); 5 | extern void vcsa_done(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /filesel/cdfs/audio.h: -------------------------------------------------------------------------------- 1 | #ifndef _AUDIO_H 2 | #define _AUDIO_H 1 3 | 4 | struct cdfs_disc_t; 5 | 6 | void Check_Audio (struct cdfs_disc_t *disc); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /medialib/Makefile-static: -------------------------------------------------------------------------------- 1 | medialib_so=medialib.o 2 | 3 | ifeq ($(STATIC_CORE),1) 4 | STATIC_OBJECTS += $(patsubst %.o,medialib/%.o,$(medialib_so)) 5 | endif 6 | -------------------------------------------------------------------------------- /stuff/poutput-curses.h: -------------------------------------------------------------------------------- 1 | #ifndef _CURSES_OCP 2 | #define _CURSES_OCP 1 3 | 4 | extern int curses_init(void); 5 | extern void curses_done(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /stuff/poutput-x11.h: -------------------------------------------------------------------------------- 1 | #ifndef _X11_OCP 2 | #define _X11_OCP 1 3 | 4 | extern int x11_init(int use_explicit); 5 | extern void x11_done(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /boot/console.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONSOLE 2 | #define _CONSOLE 1 3 | 4 | struct consoleDriver_t; 5 | extern const struct consoleDriver_t dummyConsoleDriver; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /playhvl/hvlpchan.h: -------------------------------------------------------------------------------- 1 | #ifndef _HVLPCHAN_H 2 | #define _HVLPCHAN_H 3 | 4 | OCP_INTERNAL void hvlChanSetup (struct cpifaceSessionAPI_t *cpifaceSession); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /stuff/poutput-sdl.h: -------------------------------------------------------------------------------- 1 | #ifndef STUFF_POUTPUT_SDL_H 2 | #define STUFF_POUTPUT_SDL_H 1 3 | 4 | extern int sdl_init(void); 5 | extern void sdl_done(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /stuff/poutput-sdl2.h: -------------------------------------------------------------------------------- 1 | #ifndef STUFF_POUTPUT_SDL2_H 2 | #define STUFF_POUTPUT_SDL2_H 1 3 | 4 | extern int sdl2_init(void); 5 | extern void sdl2_done(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /stuff/poll.h: -------------------------------------------------------------------------------- 1 | #ifndef _POLL_H 2 | #define _POLL_H 3 | 4 | int pollInit(void (*)(void)); 5 | void pollClose(void); 6 | 7 | void tmTimerHandler(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /filesel/modland.com/Makefile-static: -------------------------------------------------------------------------------- 1 | modland_com_so=modland-com.o 2 | 3 | ifeq ($(STATIC_CORE),1) 4 | STATIC_OBJECTS += $(patsubst %.o,filesel/modland.com/%.o,$(modland_com_so)) 5 | endif 6 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | * http://www.zophar.net/tech/files/psf_format15.txt 2 | 3 | * make adb.c and mdb.c use mmap instead of malloc+fread.. makes swapping better 4 | for the host if the files grows like.. BIG 5 | -------------------------------------------------------------------------------- /playhvl/hvlpinst.h: -------------------------------------------------------------------------------- 1 | #ifndef _HVLPINST_H 2 | #define _HVLPINST_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL void hvlInstSetup (struct cpifaceSessionAPI_t *cpifaceSession); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /playhvl/hvlptrak.h: -------------------------------------------------------------------------------- 1 | #ifndef _HVLPTRAK_H 2 | #define _HVLPTRAK_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL void hvlTrkSetup (struct cpifaceSessionAPI_t *cpifaceSession); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /stuff/poutput-fb.h: -------------------------------------------------------------------------------- 1 | #ifndef _FB_OCP 2 | #define _FB_OCP 1 3 | 4 | struct consoleDriver_t; 5 | 6 | int fb_init (int minor, struct consoleDriver_t *driver); 7 | void fb_done (void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /playopl/oplptrak.h: -------------------------------------------------------------------------------- 1 | #ifndef _OPLPTRAK_H 2 | #define _OPLPTRAK_H 1 3 | 4 | OCP_INTERNAL void oplTrkSetup (struct cpifaceSessionAPI_t *cpifaceSession, CPlayer *p); 5 | OCP_INTERNAL void oplTrkDone (void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /playgmd/gmdpdots.h: -------------------------------------------------------------------------------- 1 | #ifndef __GMDPDOTS_H 2 | #define __GMDPDOTS_H 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL int gmdGetDots (struct cpifaceSessionAPI_t *cpifaceSession, struct notedotsdata *, int); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /playgmd/gmdptrak.h: -------------------------------------------------------------------------------- 1 | #ifndef __GMDTRK_H 2 | #define __GMDTRK_H 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL void gmdTrkSetup (struct cpifaceSessionAPI_t *cpifaceSession, const struct gmdmodule *m); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /dev/plrasm.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLRASM_H 2 | #define _PLRASM_H 3 | 4 | extern void plrConvertBufferFromStereo16BitSigned (void *dstbuf, int16_t *srcbuf, int samples, int to16bit, int tosigned, int tostereo, int revstereo); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /playhvl/hvlpdots.h: -------------------------------------------------------------------------------- 1 | #ifndef _HVLPDOTS_H 2 | #define _HVLPDOTS_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL int hvlGetDots (struct cpifaceSessionAPI_t *cpifaceSession, struct notedotsdata *d, int max); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /filesel/cdfs/Makefile-static: -------------------------------------------------------------------------------- 1 | cdfs_so=audio.o cdfs.o cue.o iso9660.o main.o toc.o udf.o wave.o 2 | 3 | ifeq ($(STATIC_CORE),1) 4 | STATIC_OBJECTS += $(patsubst %.o,filesel/cdfs/%.o,$(cdfs_so)) 5 | STATIC_LIBS += $(LIBDISCID_LIBS) 6 | endif 7 | -------------------------------------------------------------------------------- /help/Makefile-static: -------------------------------------------------------------------------------- 1 | cphelper_so=cphelper.o 2 | 3 | cphlpif_so=cphlpif.o 4 | 5 | ifeq ($(STATIC_CORE),1) 6 | STATIC_OBJECTS += $(patsubst %.o,help/%.o,$(cphelper_so)) 7 | STATIC_OBJECTS += $(patsubst %.o,help/%.o,$(cphlpif_so)) 8 | endif 9 | -------------------------------------------------------------------------------- /goodies/pack/Makefile.in: -------------------------------------------------------------------------------- 1 | TOPDIR=../../ 2 | include $(TOPDIR)Rules.make 3 | 4 | CFLAGS+=-I../../ 5 | 6 | all: pack 7 | 8 | clean: 9 | rm -f pack *.o 10 | 11 | install: 12 | 13 | uninstall: 14 | 15 | pack: pack.o 16 | $(CC) -o $@ $^ 17 | -------------------------------------------------------------------------------- /playgmd/gmdpchan.h: -------------------------------------------------------------------------------- 1 | #ifndef __GMDPCHAN_H 2 | #define __GMDPCHAN_H 3 | 4 | struct gmdmodule; 5 | struct cpifaceSessionAPI_t; 6 | OCP_INTERNAL void gmdChanSetup (struct cpifaceSessionAPI_t *cpifaceSession, const struct gmdmodule *); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /playsid/cpiinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLAYSID_CPIINFO_H 2 | #define _PLAYSID_CPIINFO_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL void SidInfoInit (struct cpifaceSessionAPI_t *cpifaceSession); 6 | OCP_INTERNAL void SidInfoDone (struct cpifaceSessionAPI_t *cpifaceSession); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /filesel/filesystem-playlist-m3u.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_PLAYLIST_M3U_H 2 | #define _FILESYSTEM_PLAYLIST_M3U_H 1 3 | 4 | struct ocpdir_t *m3u_check (const struct ocpdirdecompressor_t *self, struct ocpfile_t *file, const char *filetype); 5 | 6 | void filesystem_m3u_register (void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /filesel/filesystem-playlist-pls.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_PLAYLIST_PLS_H 2 | #define _FILESYSTEM_PLAYLIST_PLS_H 1 3 | 4 | struct ocpdir_t *pls_check (const struct ocpdirdecompressor_t *self, struct ocpfile_t *file, const char *filetype); 5 | 6 | void filesystem_pls_register (void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /SUID: -------------------------------------------------------------------------------- 1 | When Open Cubic Player is ran ssetuid, the kickstart program (the ocp 2 | executable) will not allow the libocp.so to be symlinked. 3 | 4 | TODO: Use the global configuration when ran setuid and not ~/.ocp/ocp.ini ? 5 | 6 | if (getuid()==0)&&(geteuid()==0) 7 | a seteuid(getuid()); will be issued 8 | -------------------------------------------------------------------------------- /goodies/wap/makefile: -------------------------------------------------------------------------------- 1 | .silent 2 | .erase 3 | 4 | wap.exe: wap.obj 5 | @echo $@ 6 | wlink option quiet file $< name $@ system dos4g 7 | 8 | wap.obj: wap.cpp 9 | @echo $< 10 | wpp386 /zq /otexan /zp1 /4r /s /I../../binfile $< 11 | 12 | clean: .symbolic 13 | @del wap.obj wap.exe >nul 14 | -------------------------------------------------------------------------------- /playsid/cpisidsetup.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLAYSID_CPISIDSETUP_H 2 | #define _PLAYSID_CPISIDSETUP_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL void cpiSidSetupInit (struct cpifaceSessionAPI_t *cpifaceSession); 6 | OCP_INTERNAL void cpiSidSetupDone (struct cpifaceSessionAPI_t *cpifaceSession); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /playsid/sidconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef SIDPLAY_SIDCONFIG_H 2 | #define SIDPLAY_SIDCONFIG_H 1 3 | 4 | struct PluginInitAPI_t; 5 | struct PluginCloseAPI_t; 6 | 7 | OCP_INTERNAL int sid_config_init (struct PluginInitAPI_t *API); 8 | OCP_INTERNAL void sid_config_done (struct PluginCloseAPI_t *API); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /playit/itchan.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYIT_ITPCHAN_H 2 | #define PLAYIT_ITPCHAN_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | struct it_instrument; 6 | struct it_sample; 7 | 8 | OCP_INTERNAL void itChanSetup (struct cpifaceSessionAPI_t *cpifaceSession, struct it_instrument *insts, struct it_sample *samps); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /playtimidity/cpitimiditysetup.h: -------------------------------------------------------------------------------- 1 | #ifndef _CPITIMIDITYSETUP_H 2 | #define _CPITIMIDITYSETUP_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | OCP_INTERNAL void cpiTimiditySetupInit (struct cpifaceSessionAPI_t *cpifaceSession); 6 | OCP_INTERNAL void cpiTimiditySetupDone (struct cpifaceSessionAPI_t *cpifaceSession); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /playxm/xmchan.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYXM_XMPCHAN_H 2 | #define PLAYXM_XMPCHAN_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | struct xmpinstrument; 6 | struct xmpsample; 7 | 8 | OCP_INTERNAL void xmChanSetup (struct cpifaceSessionAPI_t *cpifaceSession, struct xmpinstrument *insts, struct xmpsample *samps); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /goodies/helpc/Makefile.in: -------------------------------------------------------------------------------- 1 | TOPDIR=../../ 2 | include $(TOPDIR)Rules.make 3 | 4 | all: ocphhc 5 | 6 | clean: 7 | rm -f ocphhc *.o 8 | 9 | install: 10 | 11 | uninstall: 12 | 13 | ocphhc.o: ocphhc.c 14 | $(CC_FOR_BUILD) -I../../ ocphhc.c -o $@ -c 15 | 16 | ocphhc: ocphhc.o 17 | $(CC_FOR_BUILD) -o $@ $^ -lz @EFENCE_LIBS@ @DUMA_LIBS@ 18 | -------------------------------------------------------------------------------- /playtimidity/timidityconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYTIMIDITY_TIMIDITYCONFIG_H 2 | #define PLAYTIMIDITY_TIMIDITYCONFIG_H 1 3 | 4 | struct PluginInitAPI_t; 5 | struct PluginCloseAPI_t; 6 | 7 | OCP_INTERNAL int timidity_config_init (struct PluginInitAPI_t *API); 8 | OCP_INTERNAL void timidity_config_done (struct PluginCloseAPI_t *API); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /playym/lzh/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../.. 2 | include $(TOPDIR)/Rules.make 3 | 4 | all: liblzh.a 5 | 6 | install: 7 | 8 | liblzh.a: lzhlib.o 9 | $(AR) cr liblzh.a lzhlib.o 10 | 11 | lzhlib.o: lzhlib.cpp lzh.h $(TOPDIR)/config.h ../stsoundlib/YmTypes.h 12 | $(CXX) $(CXXFLAGS) -c lzhlib.cpp 13 | 14 | clean: 15 | $(RM) *~ *.o *.a 16 | 17 | dist: 18 | -------------------------------------------------------------------------------- /playgme/gmetype.h: -------------------------------------------------------------------------------- 1 | #ifndef _GME_TYPE 2 | #define _GME_TYPE 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int gme_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void gme_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmePlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /boot/Makefile-static: -------------------------------------------------------------------------------- 1 | boot_libocp_start_so=plinkman.o 2 | boot_libocp_so=compdate.o psetting.o pmain.o console.o 3 | boot_libocp_end_so=plinkman_end.o 4 | 5 | LIBOCP_START_OBJECTS += $(patsubst %.o,boot/%.o,$(boot_libocp_start_so)) 6 | LIBOCP_OBJECTS += $(patsubst %.o,boot/%.o,$(boot_libocp_so)) 7 | LIBOCP_END_OBJECTS += $(patsubst %.o,boot/%.o,$(boot_libocp_end_so)) 8 | -------------------------------------------------------------------------------- /goodies/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | .PHONY: all clean 5 | 6 | all: 7 | $(MAKE) -C helpc TOPDIR=../$(TOPDIR) 8 | 9 | clean: 10 | -$(MAKE) -C helpc TOPDIR=../$(TOPDIR) clean 11 | 12 | install: 13 | $(MAKE) -C helpc TOPDIR=../$(TOPDIR) install 14 | 15 | uninstall: 16 | $(MAKE) -C helpc TOPDIR=../$(TOPDIR) uninstall 17 | -------------------------------------------------------------------------------- /playay/aytype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYAY_AYTYPE_H 2 | #define PLAYAY_AYTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int ay_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void ay_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct ayPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playit/ittype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYIT_ITTYPE_H 2 | #define PLAYIT_ITTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int it_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void it_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct itPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /cpiface/png.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2020-'24 Stian Skjelstad 3 | * 4 | * PNG decoder using libpng 5 | */ 6 | 7 | #ifndef _CPIFACE_PNG_H 8 | #define _CPIFACE_PNG_H 1 9 | 10 | int try_open_png (uint16_t *width, uint16_t *height, uint8_t **data_bgra, const uint8_t *src, uint_fast32_t srclen); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playxm/xmtype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYXM_XMTYPE_H 2 | #define PLAYXM_XMTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int xm_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void xm_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct xmpPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /stuff/latin1.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_LATIN1_H 2 | 3 | /* table to convert latin1 into OCP style cp437 */ 4 | extern const uint8_t latin1_table[256]; 5 | 6 | /* table to convert latin1 into Unicode (UTF-8) */ 7 | extern const uint16_t latin1_to_unicode[256]; 8 | 9 | void latin1_f_to_utf8_z (const char *src, size_t srclen, char *dst, size_t dstlen); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /playcda/cdatype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYCDA_CDATYPE_H 2 | #define PLAYCDA_CDATYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int cda_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void cda_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct cdaPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playhvl/hvltype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYHVL_HVLTYPE_H 2 | #define PLAYHVL_HVLTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int hvl_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void hvl_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct hvlPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playogg/oggtype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYOGG_OGGTYPE_H 2 | #define PLAYOGG_OGGTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int ogg_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void ogg_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct oggPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playsid/sidtype.h: -------------------------------------------------------------------------------- 1 | #ifndef SIDPLAY_SIDTYPE_H 2 | #define SIDPLAY_SIDTYPE_H 3 | 4 | struct PluginInitAPI_t; 5 | struct PluginCloseAPI_t; 6 | 7 | OCP_INTERNAL int sid_type_init (struct PluginInitAPI_t *API); 8 | OCP_INTERNAL void sid_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct sidPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playwav/wavtype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYWAV_WAVTYPE_H 2 | #define PLAYWAV_WAVTYPE_H 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int wav_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void wav_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct wavPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /filesel/filesystem-textfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESEL_FILESYSTEM_TEXTFILE_H 2 | #define _FILESEL_FILESYSTEM_TEXTFILE_H 3 | 4 | struct textfile_t; 5 | struct ocpfilehandle_t; 6 | 7 | struct textfile_t *textfile_start (struct ocpfilehandle_t *filehandle); 8 | void textfile_stop (struct textfile_t *self); 9 | const char *textfile_fgets (struct textfile_t *self); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /playmp2/mptype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYMP2_MPTYPE_H 2 | #define PLAYMP2_MPTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int ampeg_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void ampeg_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct mpegPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playflac/flactype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYFLAC_FLACTYPE_H 2 | #define PLAYFLAC_FLACTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int flac_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void flac_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct flacPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /cpiface/jpeg.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2020-'24 Stian Skjelstad 3 | * 4 | * JPEG decoder, using libjpeg/libturbojpeg 5 | */ 6 | 7 | #ifndef _CPIFACE_JPEG_H 8 | #define _CPIFACE_JPEG_H 1 9 | 10 | int try_open_jpeg (uint16_t *width, uint16_t *height, uint8_t **data_bgra, const uint8_t *src, uint_fast32_t srclen); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /dev/Makefile-static: -------------------------------------------------------------------------------- 1 | plrbase_so=deviplay.o plrasm.o player.o 2 | 3 | mcpbase_so=deviwave.o mix.o mixasm.o ringbuffer.o postproc.o 4 | 5 | mchasm_so=mchasm.o 6 | 7 | ifeq ($(STATIC_CORE),1) 8 | STATIC_OBJECTS += $(patsubst %.o,dev/%.o,$(plrbase_so)) 9 | STATIC_OBJECTS += $(patsubst %.o,dev/%.o,$(mcpbase_so)) 10 | STATIC_OBJECTS += $(patsubst %.o,dev/%.o,$(mchasm_so)) 11 | endif 12 | -------------------------------------------------------------------------------- /X11-keymap: -------------------------------------------------------------------------------- 1 | 9 -> esc 2 | 3 | 22 -> backspace 4 | 23 -> tab 5 | 6 | 36 -> enter 7 | 37 -> left ctrl 8 | 50 -> left shift 9 | 64 -> left alt 10 | 67 -> f1 11 | .. 12 | 76 -> f10 13 | 95 -> f11 14 | 96 -> f12 15 | 97 -> home 16 | 98 -> up 17 | 99 -> page up 18 | 100 -> left 19 | 102 -> right 20 | 103 -> end 21 | 104 -> down 22 | 105 -> page down 23 | 106 -> insert 24 | 107 -> delete 25 | 26 | -------------------------------------------------------------------------------- /boot/pmain.h: -------------------------------------------------------------------------------- 1 | #ifndef __PMAIN_H 2 | #define __PMAIN_H 3 | 4 | struct bootupstruct 5 | { 6 | int (*main)(int argc, char *argv[], const char *ConfigHome, const char *ConfigHomeDir, const char *ConfigDataDir, const char *DataDir, const char *ProgramDir); 7 | }; 8 | struct mainstruct 9 | { 10 | int (*main)(int argc, char *argv[]); 11 | }; 12 | 13 | extern struct mainstruct *ocpmain; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /playtimidity/timiditytype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYTIMIDITY_TIMIDITYTYPE_H 2 | #define PLAYTIMIDITY_TIMIDITYTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | struct PluginCloseAPI_t; 6 | 7 | OCP_INTERNAL int timidity_type_init (struct PluginInitAPI_t *API); 8 | OCP_INTERNAL void timidity_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct timidityPlayer; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /playym/ymtype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYYM_YMTYPE_H 2 | #define PLAYYM_YMTYPE_H 1 3 | 4 | extern "C" 5 | { 6 | struct PluginInitAPI_t; 7 | struct PluginCloseAPI_t; 8 | } 9 | 10 | OCP_INTERNAL int ym_type_init (PluginInitAPI_t *API); 11 | 12 | OCP_INTERNAL void ym_type_done (PluginCloseAPI_t *API); 13 | 14 | extern "C" 15 | { 16 | extern OCP_INTERNAL const struct cpifaceplayerstruct ymPlayer; 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /playopl/opltype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYOPL_OPLTYPE_H 2 | #define PLAYOPL_OPLTYPE_H 1 3 | 4 | extern "C" 5 | { 6 | struct PluginInitAPI_t; 7 | struct PluginCloseAPI_t; 8 | } 9 | 10 | OCP_INTERNAL int opl_type_init (PluginInitAPI_t *API); 11 | OCP_INTERNAL void opl_type_done (PluginCloseAPI_t *API); 12 | 13 | extern "C" 14 | { 15 | extern OCP_INTERNAL const struct cpifaceplayerstruct oplPlayer; 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /filesel/cdfs/cue.h: -------------------------------------------------------------------------------- 1 | #ifndef _CUE_H 2 | #define _CUE_H 1 3 | 4 | #include "filesel/filesystem.h" 5 | 6 | struct cue_parser_t; 7 | struct cdfs_disc_t; 8 | 9 | void cue_parser_free (struct cue_parser_t *cue_parser); 10 | 11 | struct cue_parser_t *cue_parser_from_data (const char *input); 12 | 13 | struct cdfs_disc_t *cue_parser_to_cdfs_disc (struct ocpfile_t *file, struct cue_parser_t *cue_parser); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /filesel/charsets.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHARSETS_H 2 | #define _CHARSETS_H 1 3 | 4 | struct ocp_charset_info_t 5 | { 6 | const char *key; 7 | const char *label; 8 | const char *description; 9 | }; 10 | 11 | struct ocp_charset_collection_t 12 | { 13 | const char *label; 14 | const struct ocp_charset_info_t *entries; /* zero terminated */ 15 | }; 16 | 17 | extern const struct ocp_charset_collection_t charset_collections[]; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /filesel/filesystem-unix.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESEL_FILESYSTEM_UNIX_H 2 | #define _FILESEL_FILESYSTEM_UNIX_H 1 3 | 4 | #ifndef _WIN32 5 | 6 | struct ocpdir_t; 7 | struct ocpfile_t; 8 | struct ocpfilehandle_t; 9 | 10 | struct dmDrive; 11 | 12 | extern struct dmDrive *dmFile; 13 | 14 | struct ocpdir_t *file_unix_root (void); 15 | 16 | int filesystem_unix_init (void); 17 | void filesystem_unix_done (void); 18 | 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /dev/mixclip.h: -------------------------------------------------------------------------------- 1 | #ifndef MIXCLIP_H 2 | 3 | #if 0 4 | This was used when amplification was configured - non of the players in Linux/Unix used this 5 | 6 | extern void mixClipAlt(uint16_t *dst, const uint16_t *src, uint32_t len, const uint16_t *tab); 7 | extern void mixClipAlt2(uint16_t *dst, const uint16_t *src, uint32_t len, const uint16_t *tab); 8 | extern void mixCalcClipTab(uint16_t *ct, int32_t amp); 9 | 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /filesel/cdfs/toc.h: -------------------------------------------------------------------------------- 1 | #ifndef _TOC_H 2 | #define _TOC_H 1 3 | 4 | #include "filesel/filesystem.h" 5 | 6 | struct toc_parser_t; 7 | struct cdfs_disc_t; 8 | 9 | void toc_parser_free (struct toc_parser_t *toc_parser); 10 | 11 | struct toc_parser_t *toc_parser_from_data (const char *input /* null terminated */); 12 | 13 | struct cdfs_disc_t *toc_parser_to_cdfs_disc (struct ocpfile_t *file, struct toc_parser_t *toc_parser); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /mingw/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | include Makefile-static 4 | 5 | ifeq ($(WINDOWS),1) 6 | all: ocp.res 7 | else 8 | all: 9 | endif 10 | 11 | uninstall: 12 | 13 | install: 14 | 15 | clean: 16 | rm -f ocp.res 17 | 18 | ocp.ico: ../desktop/opencubicplayer.svg 19 | convert $< -define icon:auto-resize=256,128,64,48,32,16 $@ 20 | touch ocp.ico 21 | 22 | ocp.res: ocp.rc ocp.ico 23 | $(WINDRES) $< -O coff -o $@ 24 | -------------------------------------------------------------------------------- /filesel/filesystem-filehandle-cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESEL_FILESYSTEM_FILEHANDLE_CACHE_H 2 | #define _FILESEL_FILESYSTEM_FILEHANDLE_CACHE_H 1 3 | 4 | struct ocpdir_t; 5 | struct ocpfile_t; 6 | struct ocpfilehandle_t; 7 | 8 | /* Common caching code for ocpfilehandle_t */ 9 | 10 | /* for general cached version, we go directly for an open handle */ 11 | struct ocpfilehandle_t *cache_filehandle_open (struct ocpfilehandle_t *parent); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /stuff/compat-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | failed=no 4 | 5 | echo "Going to run unit test as-is" 6 | if ! ./compat-test; then 7 | echo failed 8 | failed=yes 9 | fi 10 | 11 | echo "Going to run unit test via valgrind" 12 | if ! valgrind --error-exitcode=1 --leak-check=full ./compat-test; then 13 | echo failed 14 | failed=yes; 15 | fi 16 | 17 | if test x$failed != xno; then 18 | echo "One or more test failed" 19 | exit 1 20 | fi 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /dev/mixasm.h: -------------------------------------------------------------------------------- 1 | #ifndef MIXASM_H 2 | #define MIXASM_H 3 | 4 | extern void mixAddAbs(const struct mixchannel *ch, uint32_t len, uint32_t *l, uint32_t *r); 5 | extern void mixPlayChannel(int32_t *buf, uint32_t len, struct mixchannel *ch, int st); 6 | extern void mixClip(int16_t *dst, const int32_t *src, uint32_t len, int16_t (*tab)[256], int32_t max); 7 | 8 | extern int8_t (*mixIntrpolTab)[256][2]; 9 | extern int16_t (*mixIntrpolTab2)[256][2]; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /filesel/filesystem-setup.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_SETUP_H 2 | #define _FILESYSTEM_SETUP_H 1 3 | 4 | extern struct dmDrive *dmSetup; 5 | 6 | void filesystem_setup_register (void); 7 | 8 | void filesystem_setup_register_dir (struct ocpdir_t *dir); 9 | void filesystem_setup_unregister_dir (struct ocpdir_t *dir); 10 | void filesystem_setup_register_file (struct ocpfile_t *file); 11 | void filesystem_setup_unregister_file (struct ocpfile_t *file); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /devw/dwmixa.h: -------------------------------------------------------------------------------- 1 | #ifndef _DWMIXA_H 2 | #define _DWMIXA_H 3 | 4 | extern void mixrPlayChannel(int32_t *buf, int32_t *fade, uint32_t len, struct channel *ch); 5 | extern void mixrFadeChannel(int32_t *fade, struct channel *ch); 6 | extern void mixrFade(int32_t *buf, int32_t *fade, int len); 7 | extern void mixrClip(void *dst, int32_t *src, int len, void *, int32_t max); 8 | extern void mixrSetupAddresses(int32_t (*vol)[256], uint8_t (*intr)[256][2]); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /filesel/cphlpfs.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) '94-'05 Niklas Beisert 3 | * 4 | * CP hypertext help viewer fileselector wrapper 5 | * 6 | * revision history: (please note changes here) 7 | * -fg980924 Fabian Giesen 8 | * -first version (mainly for wrappers) 9 | */ 10 | 11 | #ifndef _cphlpfs_h 12 | #define _cphlpfs_h 13 | 14 | extern unsigned char fsHelp2(void); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /playopl/oplconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYOPL_OPLCONFIG_H 2 | 3 | #define PLAYOPL_OPLCONFIG_H 1 4 | 5 | struct PluginInitAPI_t; 6 | struct PluginCloseAPI_t; 7 | struct configAPI_t; 8 | 9 | OCP_INTERNAL char *opl_config_retrowave_device (const struct PipeProcessAPI_t *PipeProcess, const struct configAPI_t *configAPI); 10 | 11 | OCP_INTERNAL int opl_config_init (struct PluginInitAPI_t *API); 12 | OCP_INTERNAL void opl_config_done (struct PluginCloseAPI_t *API); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=.. 2 | include $(TOPDIR)/Rules.make 3 | 4 | all: 5 | $(MAKE) -C texi all TOPDIR="../$(TOPDIR)" 6 | 7 | clean: 8 | $(MAKE) -C texi clean TOPDIR="../$(TOPDIR)" 9 | 10 | install: 11 | $(MAKE) -C texi install TOPDIR="../$(TOPDIR)" DESTDIR="$(DESTDIR)" 12 | mkdir -p $(DESTDIR)$(MANDIR)/man1 13 | $(CP) ocp.1 $(DESTDIR)$(MANDIR)/man1 14 | 15 | uninstall: 16 | $(MAKE) -C texi uninstall TOPDIR="../$(TOPDIR)" DESTDIR="$(DESTDIR)" 17 | rm -f $(DESTDIR)$(MANDIR)/man1/ocp.1 18 | -------------------------------------------------------------------------------- /stuff/framelock.h: -------------------------------------------------------------------------------- 1 | #ifndef _FRAMELOCK_H 2 | #define _FRAMELOCK_H 1 3 | 4 | void framelock_init (void); 5 | 6 | void framelock(void); /* sleeps until next timeout */ 7 | 8 | int poll_framelock(void); /* returns non-zero at framelock intervals, to be used for culling when I/O is expected to be high */ 9 | void preemptive_framelock (void); /* called by I/O intensive sections, but return return value is delayed until the next call to poll_framelock */ 10 | 11 | extern int fsFPS; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /filesel/filesystem-windows.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESEL_FILESYSTEM_WINDOWS_H 2 | #define _FILESEL_FILESYSTEM_WINDOWS_H 1 3 | 4 | # ifdef _WIN32 5 | 6 | extern struct dmDrive *dmDriveLetters[26]; 7 | extern char dmLastActiveDriveLetter; /* A-Z, or NULL - last active drive, updated by pfilesel.c */ 8 | 9 | struct dmDrive *filesystem_windows_init (void); /* returns CWD-drive */ 10 | void filesystem_windows_refresh_drives (void); 11 | void filesystem_windows_done (void); 12 | 13 | # endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /dev/mchasm.h: -------------------------------------------------------------------------------- 1 | #ifndef _MCHASM_H 2 | #define _MCHASM_H 3 | 4 | typedef uint32_t (*mixAddAbsfn)(const void *ch, uint32_t len); 5 | 6 | extern uint32_t mixAddAbs16SS(const void *ch, uint32_t len); 7 | 8 | typedef void (*mixGetMasterSamplefn)(int16_t *dst, const void *src, uint32_t len, uint32_t step); 9 | 10 | extern void mixGetMasterSampleSS16M(int16_t *dst, const void *src, uint32_t len, uint32_t step); 11 | extern void mixGetMasterSampleSS16S(int16_t *dst, const void *src, uint32_t len, uint32_t step); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /goodies/tga2wav/makefile.wat: -------------------------------------------------------------------------------- 1 | copt = /otexan /fpi87 2 | lopt = 3 | 4 | exefile = tga2wav 5 | objects = tga2wav.obj 6 | 7 | $(exefile).exe: $(objects) 8 | *wlink $(lopt) & 9 | system dos4g & 10 | name $^*.exe & 11 | debug watcom all & 12 | file {$(objects)} & 13 | option map & 14 | option eliminate 15 | 16 | .cpp.obj: 17 | *wpp386 $(copt) $< 18 | 19 | clean: 20 | del *.obj 21 | del *.err 22 | del *.map 23 | del *.bak 24 | del $(exefile).exe 25 | del *.wav 26 | -------------------------------------------------------------------------------- /no-curses.h: -------------------------------------------------------------------------------- 1 | #ifndef NO_CURSES_H 2 | #define NO_CURSES_H 1 3 | 4 | #define KEY_DOWN 258 5 | #define KEY_UP 259 6 | #define KEY_LEFT 260 7 | #define KEY_RIGHT 261 8 | #define KEY_HOME 262 9 | #define KEY_BACKSPACE 263 10 | #define KEY_F(n) (264+(n)) 11 | #define KEY_DC 330 12 | #define KEY_IC 331 13 | 14 | #define KEY_NPAGE 338 15 | #define KEY_PPAGE 339 16 | #define KEY_BTAB 353 17 | 18 | #define KEY_END 360 19 | #define KEY_EXIT 361 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /filesel/filesystem-file-mem.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESEL_FILESYSTEM_FILE_MEM_H 2 | #define _FILESEL_FILESYSTEM_FILE_MEM_H 1 3 | 4 | struct ocpdir_t; 5 | struct ocpfile_t; 6 | struct ocpfilehandle_t; 7 | 8 | /* Memory-mapped ocpfilehandle_t */ 9 | 10 | /* takes ownership of memory */ 11 | struct ocpfilehandle_t *mem_filehandle_open (int dirdb_ref, char *ptr, uint32_t len); 12 | 13 | /* takes ownership of memory */ 14 | struct ocpfile_t *mem_file_open (struct ocpdir_t *parent, int dirdb_ref, char *ptr, uint32_t len); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /filesel/filesystem-ancient.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_ANCIENT_H 2 | #define _FILESYSTEM_ANCIENT_H 1 3 | 4 | struct ocpfilehandle_t; 5 | 6 | 7 | /* compressionmethod + compressionmethod_len: if provided, the compression method detected will be filled in here 8 | * s: te source filehandle 9 | * 10 | * returns a new filehandle refers to a if a compatiable and intact compressed file 11 | */ 12 | struct ocpfilehandle_t *ancient_filehandle (char *compressionmethod, int compressionmethod_len, struct ocpfilehandle_t *s); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /mingw/versionsconf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | BZIP2_VERSION="1.0.8" 5 | LIBMAD_VERSION="0.15.1b" 6 | LIBJPEGTURBO_VERSION="3.1.0" 7 | LIBPNG_VERSION="1.6.44" 8 | LIBOGG_VERSION="1.3.5" 9 | LIBVORBIS_VERSION="1.3.7" 10 | FLAC_VERSION="1.4.3" 11 | SDL2_VERSION="2.30.10" 12 | BROTLI_VERSION="1.1.0" 13 | HARFBUZZ_VERSION="10.1.0" 14 | FREETYPE2_VERSION="2.13.3" 15 | LIBDISCID_VERSION="0.6.4" 16 | CJSON_VERSION="1.7.18" 17 | ANCIENT_VERSION="2.2.0" 18 | LIBICONV_VERSION="1.18" 19 | GAMEMUSICEMU_VERSION="0.6.3" 20 | UNIFONT_VERSION="16.0.02" 21 | -------------------------------------------------------------------------------- /stuff/x11-common.h: -------------------------------------------------------------------------------- 1 | #ifndef _X11_COMMON 2 | #define _X11_COMMON 1 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | extern uint32_t x11_palette32[256]; 9 | extern uint16_t x11_palette16[256]; 10 | extern uint16_t x11_palette15[256]; 11 | 12 | void x11_gUpdatePal (uint8_t color, uint8_t _red, uint8_t _green, uint8_t _blue); 13 | void x11_gFlushPal (void); 14 | 15 | extern Display *mDisplay; 16 | extern int mLocalDisplay; 17 | extern int mScreen; 18 | extern int x11_depth; 19 | 20 | int x11_connect (void); 21 | void x11_disconnect (void); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /filesel/cdfs/wave.h: -------------------------------------------------------------------------------- 1 | #ifndef _WAVE_H 2 | #define _WAVE_H 1 3 | 4 | #include 5 | 6 | int wave_filename(const char *filename); 7 | 8 | #warning this operation should be redesigned for iterations 9 | int wave_openfile (struct ocpdir_t *dir, const char *filename, struct ocpfile_t **file, struct ocpfilehandle_t **handle, uint64_t *offset, uint64_t *length); 10 | 11 | #warning this operation should be redesigned for iterations 12 | int data_openfile (struct ocpdir_t *dir, const char *filename, struct ocpfile_t **file, struct ocpfilehandle_t **handle, uint64_t *length); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /devw/dwmixqa.h: -------------------------------------------------------------------------------- 1 | #ifndef _DWMIXQ_H 2 | #define _DWMIXQ_H 3 | 4 | extern void mixqPlayChannel(int16_t *buf, uint32_t len, struct channel *ch, int quiet); 5 | extern void mixqSetupAddresses(int16_t (*voltab)[2][256], int16_t (*interpoltabq)[32][256][2], int16_t (*interpoltabq2)[16][256][4]); 6 | extern void mixqAmplifyChannel(int32_t *buf, const int16_t *src, uint32_t len, const int32_t vol); 7 | extern void mixqAmplifyChannelUp(int32_t *buf, const int16_t *src, uint32_t len, int32_t vol); 8 | extern void mixqAmplifyChannelDown(int32_t *buf, const int16_t *src, uint32_t len, int32_t vol); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /stuff/err.h: -------------------------------------------------------------------------------- 1 | #ifndef __ERR_H 2 | #define __ERR_H 3 | 4 | enum 5 | { 6 | errOk=0, 7 | errGen=-1, 8 | errAllocMem=-9, 9 | errAllocSamp=-10, 10 | errFileOpen=-17, 11 | errFileRead=-18, 12 | errFileWrite=-19, 13 | errFileMiss=-20, 14 | errFormStruc=-25, 15 | errFormSig=-26, 16 | errFormOldVer=-27, 17 | errFormNewVer=-28, 18 | errFormSupp=-29, 19 | errFormMiss=-30, 20 | errPlay=-33, 21 | errSymSym=-41, 22 | errSymMod=-42, 23 | 24 | errHelpPrinted=-100 25 | }; 26 | 27 | const char *errGetShortString(int err); 28 | const char *errGetLongString(int err); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /stuff/CaseFoldingTable-3.c: -------------------------------------------------------------------------------- 1 | {0x0390, 0x03B9, 0x0308, 0x0301}, 2 | {0x03B0, 0x03C5, 0x0308, 0x0301}, 3 | {0x1F52, 0x03C5, 0x0313, 0x0300}, 4 | {0x1F54, 0x03C5, 0x0313, 0x0301}, 5 | {0x1F56, 0x03C5, 0x0313, 0x0342}, 6 | {0x1FB7, 0x03B1, 0x0342, 0x03B9}, 7 | {0x1FC7, 0x03B7, 0x0342, 0x03B9}, 8 | {0x1FD2, 0x03B9, 0x0308, 0x0300}, 9 | {0x1FD3, 0x03B9, 0x0308, 0x0301}, 10 | {0x1FD7, 0x03B9, 0x0308, 0x0342}, 11 | {0x1FE2, 0x03C5, 0x0308, 0x0300}, 12 | {0x1FE3, 0x03C5, 0x0308, 0x0301}, 13 | {0x1FE7, 0x03C5, 0x0308, 0x0342}, 14 | {0x1FF7, 0x03C9, 0x0342, 0x03B9}, 15 | {0xFB03, 0x0066, 0x0066, 0x0069}, 16 | {0xFB04, 0x0066, 0x0066, 0x006C}, 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "playgmi/timidity-git"] 2 | path = playtimidity/timidity-git 3 | url = https://github.com/mywave82/timidity.git 4 | branch = ocp 5 | [submodule "playsid/libsidplayfp-git"] 6 | path = playsid/libsidplayfp-git 7 | url = https://github.com/mywave82/libsidplayfp.git 8 | branch = ocp 9 | [submodule "playopl/libbinio-git"] 10 | path = playopl/libbinio-git 11 | url = https://github.com/mywave82/libbinio.git 12 | [submodule "playopl/adplug-git"] 13 | path = playopl/adplug-git 14 | url = https://github.com/mywave82/adplug.git 15 | branch = ocp 16 | [submodule "playopl/adplugdb-git"] 17 | path = playopl/adplugdb-git 18 | url = https://github.com/adplug/database.git 19 | -------------------------------------------------------------------------------- /playhvl/loader.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLAY_HVL_LOADER_H 2 | #define _PLAY_HVL_LOADER_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | 6 | OCP_INTERNAL struct hvl_tune *hvl_load_ahx (struct cpifaceSessionAPI_t *cpifaceSession, const uint8_t *buf, uint32_t buflen, uint32_t defstereo, uint32_t freq ); 7 | OCP_INTERNAL struct hvl_tune *hvl_load_hvl (struct cpifaceSessionAPI_t *cpifaceSession, const uint8_t *buf, uint32_t buflen, uint32_t defstereo, uint32_t freq ); 8 | OCP_INTERNAL struct hvl_tune *hvl_LoadTune_memory (struct cpifaceSessionAPI_t *cpifaceSession, const uint8_t *buf, uint32_t buflen, uint32_t defstereo, uint32_t freq); 9 | OCP_INTERNAL void hvl_FreeTune (struct hvl_tune *ht); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /cpiface/fft.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) '94-'05 Niklas Beisert 3 | * 4 | * FFT routines for the spectrum analysers 5 | * 6 | * revision history: (please note changes here) 7 | * -doj980928 Dirk Jagdmann 8 | * -initial release 9 | * 10 | * -doj981105 Dirk Jagdmann 11 | * - changed paramter declaration of fftanalyseall() 12 | * - deletet isqrt() from this file 13 | */ 14 | 15 | #ifndef FFT__H 16 | #define FFT__H 17 | 18 | void fftanalyseall(uint16_t *ana, 19 | const int16_t *samp, 20 | const int inc, 21 | const int bits); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /README.Darwin: -------------------------------------------------------------------------------- 1 | If you use liboss, you might need to edit /opt/local/lib/pkgconfig/liboss.pc and remove -Wno-precomp (liboss 0.0.1 is known to be broken and crashes, so I discourage the use of liboss) 2 | 3 | To configure Darwin, my experience is that you need to run configure like this: 4 | 5 | PATH=$PATH:/opt/local/bin LDFLAGS=-L/opt/local/lib CFLAGS=-I/opt/local/include CXXFLAGS=-I/opt/local/include CPPFLAGS=-I/opt/local/include CPPCXXFLAGS=-I/opt/local/include ./configure 6 | 7 | and optionally add things like --prefix etc. 8 | 9 | To get curses up and running with colors, you need to run ocp like this 10 | 11 | TERM=xterm-color ocp 12 | 13 | or 14 | 15 | export TERM=xterm-color 16 | 17 | before you run ocp 18 | -------------------------------------------------------------------------------- /stuff/cp437.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_CP437_H 2 | 3 | /* Tables to convert codepage 437 into Unicode (UTF-8). 4 | * 5 | * OpenCubicPlayer on real "hardware" - VCSA and 8x8 charsets 6 | * at the moment uses a modified version, to fit volume-bars for the analyzer. 7 | */ 8 | 9 | extern const uint32_t ocp_cp437_to_unicode[256]; 10 | extern const uint16_t cp437_to_unicode[256]; 11 | 12 | /* destination is not zero-terminated if full */ 13 | void utf8_to_cp437(const char *src, size_t srclen, char *dst, size_t dstlen); 14 | 15 | /* destination is not zero-terminated if full */ 16 | /* fixed buffer to zero-terminated buffer */ 17 | void cp437_f_to_utf8_z(const char *src, size_t srclen, char *dst, size_t dstlen); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /stuff/poutput-keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __POUTPUT_KEYBOARD_H 2 | #define __POUTPUT_KEYBOARD_H 3 | 4 | #ifdef _CONSOLE_DRIVER 5 | 6 | /* kbhit and getch will be called on ekbhit() and egetch() - they can be dummy callbacks to refresh the console. 7 | * 8 | * Console drivers that implemented getch() are expected to return keyboard/console escape codes. 9 | * 10 | * Console drivers that decode keyboard themself should use ___push_key(), and international characters are split up into UTF-8 bytes 11 | */ 12 | void ___setup_key (int(*kbhit)(void), int(*getch)(void)); 13 | void ___push_key (uint16_t); 14 | #endif 15 | 16 | int consoleHasKey (uint16_t key); 17 | 18 | int ekbhit (void); 19 | int egetch (void); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /stuff/codepage.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_CODEPAGE_H 2 | #define _STUFF_CODEPAGE_H 1 3 | 4 | struct codepage_database_entry 5 | { 6 | const char *internal_name; 7 | const char *display_name; 8 | const char *description; 9 | const uint8_t undefined[32]; 10 | /* 0 = undefined[0] 0x01 11 | 1 = undefined[0] 0x02 12 | 7 = undefined[0] 0x80 13 | 16 = undefined[2] 0x01 14 | */ 15 | } 16 | 17 | struct codepage_database 18 | { 19 | const char *title; 20 | const codepage_database_entry **entries; 21 | }; 22 | 23 | struct codepage_databases 24 | { 25 | struct codepage_database **database; 26 | }; 27 | 28 | 29 | struct codepage_database codepage_all; 30 | struct codepage_databases codepage_databases; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /playcda/cdaudio.h: -------------------------------------------------------------------------------- 1 | #ifndef _CDAUDIO_H 2 | #define _CDAUDIO_H 3 | 4 | struct ocpfilehandle_t; 5 | 6 | struct cdStat 7 | { 8 | int error; /* boolean */ 9 | int looped; /* boolean */ 10 | uint32_t position; 11 | }; 12 | 13 | struct cpifaceSessionAPI_t; 14 | OCP_INTERNAL void cdClose (struct cpifaceSessionAPI_t *cpifaceSession); 15 | OCP_INTERNAL void cdJump (struct cpifaceSessionAPI_t *cpifaceSession, unsigned long start); 16 | OCP_INTERNAL int cdOpen (unsigned long start, unsigned long len, struct ocpfilehandle_t *file, struct cpifaceSessionAPI_t *cpifaceSession); 17 | OCP_INTERNAL void cdGetStatus (struct cdStat *stat); 18 | OCP_INTERNAL void cdSetLoop (int loop); 19 | OCP_INTERNAL void cdIdle (struct cpifaceSessionAPI_t *cpifaceSession); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /filesel/filesystem-dir-mem.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESEL_FILESYSTEM_DIR_MEM_H 2 | #define _FILESEL_FILESYSTEM_DIR_MEM_H 1 3 | 4 | /* Memory-mapped "static" dir_t */ 5 | 6 | struct ocpdir_mem_t; /* private */ 7 | struct ocpdir_t; 8 | struct ocpfile_t; 9 | 10 | /* parent will be ref'ed if non-null */ 11 | struct ocpdir_mem_t *ocpdir_mem_alloc (struct ocpdir_t *parent, const char *name); 12 | 13 | void ocpdir_mem_add_dir (struct ocpdir_mem_t *, struct ocpdir_t *child); 14 | void ocpdir_mem_remove_dir (struct ocpdir_mem_t *, struct ocpdir_t *child); 15 | 16 | void ocpdir_mem_add_file (struct ocpdir_mem_t *, struct ocpfile_t *child); 17 | void ocpdir_mem_remove_file (struct ocpdir_mem_t *, struct ocpfile_t *child); 18 | 19 | struct ocpdir_t *ocpdir_mem_getdir_t (struct ocpdir_mem_t *); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /dev/deviwave.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEVIWAVE_H 2 | #define __DEVIWAVE_H 3 | 4 | struct mcpDevAPI_t; 5 | struct configAPI_t; 6 | struct mixAPI_t; 7 | 8 | struct mcpDriver_t 9 | { 10 | char name[32]; /* includes the NULL termination */ 11 | char description[64]; /* includes the NULL termination */ 12 | 13 | int (*Detect) (const struct mcpDriver_t *driver); /* 0 = driver not functional, 1 = driver is functional */ 14 | const struct mcpDevAPI_t *(*Open) (const struct mcpDriver_t *driver, const struct configAPI_t *config, const struct mixAPI_t *mixAPI); 15 | void (*Close) (const struct mcpDriver_t *driver); 16 | }; 17 | void mcpRegisterDriver (const struct mcpDriver_t *driver); 18 | void mcpUnregisterDriver(const struct mcpDriver_t *driver); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /stuff/pfonts.h: -------------------------------------------------------------------------------- 1 | #ifndef _PFONTS_H 2 | #define _PFONTS_H 3 | 4 | /* cp437_to_unicode gives lookup for these - with some few exceptions TODO*/ 5 | extern unsigned char plFont88[256][8]; 6 | extern unsigned char plFont816[256][16]; 7 | extern unsigned char plFont1632[256][64]; 8 | 9 | struct FontData_8x8_t 10 | { 11 | uint16_t codepoint; 12 | uint8_t data[8]; 13 | }; 14 | 15 | struct FontData_8x16_t 16 | { 17 | uint16_t codepoint; 18 | uint8_t data[16]; 19 | }; 20 | 21 | struct FontData_16x32_t 22 | { 23 | uint16_t codepoint; 24 | uint8_t data[64]; 25 | }; 26 | 27 | extern const struct FontData_8x8_t plFont_8x8_latin1_addons [41]; 28 | extern const struct FontData_8x16_t plFont_8x16_latin1_addons [41]; 29 | extern const struct FontData_16x32_t plFont_16x32_latin1_addons[41]; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /cpiface/cpipic.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) '94-'98 Niklas Beisert 3 | * 4 | * CPIFace background picture loader 5 | * 6 | * revision history: (please note changes here) 7 | * -doj980928 Dirk Jagdmann 8 | * -initial release of this file 9 | */ 10 | 11 | #ifndef CPIPIC__H 12 | #define CPIPIC__H 13 | 14 | extern unsigned char *plOpenCPPict; /* an array containing the raw picture */ 15 | extern unsigned char plOpenCPPal[]; /* the palette for the picture */ 16 | 17 | struct configAPI_t; 18 | struct dirdbAPI_t; 19 | 20 | void plReadOpenCPPic (const struct configAPI_t *configAPI, const struct dirdbAPI_t *dirdb); /* load a new background picture into *plOpenCPPict and *plOpenCPPal */ 21 | 22 | void plOpenCPPicDone (void); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /cpiface/vol.h: -------------------------------------------------------------------------------- 1 | #ifndef __VOL_H 2 | #define __VOL_H 3 | 4 | struct ocpvolstruct 5 | { 6 | int val, /* the current value */ 7 | min, /* the minimal value */ 8 | max, /* the maximal value */ 9 | step, /* stepping */ 10 | log; /* log scale? (not yet supported) */ 11 | const char *name; 12 | }; 13 | 14 | /* min<=val<=max !! */ 15 | /* (max-min)%step==0 !! */ 16 | 17 | struct ocpvolregstruct 18 | { 19 | int (*GetVolumes)(void); /* returns the number of setable volumes */ 20 | int (*GetVolume)(struct ocpvolstruct *, int); /* gets a volume (min, max, step and log should be same on every call!) */ 21 | int (*SetVolume)(struct ocpvolstruct *, int); /* sets a volume (only val should be changed!) */ 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /mingw/ocp.rc.in: -------------------------------------------------------------------------------- 1 | 1 VERSIONINFO 2 | FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0 3 | PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0 4 | BEGIN 5 | BLOCK "StringFileInfo" 6 | BEGIN 7 | BLOCK "080904E4" 8 | BEGIN 9 | VALUE "CompanyName", "Cubic Team and Stian Skjelstad" 10 | VALUE "FileDescription", "Audio Media Player" 11 | VALUE "FileVersion", "@PACKAGE_VERSION@" 12 | VALUE "InternalName", "ocp" 13 | VALUE "LegalCopyright", "© 2023 Stian Skjelstad" 14 | VALUE "OriginalFilename", "ocp.exe" 15 | VALUE "ProductName", "Open Cubic Player" 16 | VALUE "ProductVersion", "@PACKAGE_VERSION@" 17 | END 18 | END 19 | BLOCK "VarFileInfo" 20 | BEGIN 21 | VALUE "Translation", 0x809, 1252 22 | END 23 | END 24 | 25 | iconresourceid ICON "ocp.ico" 26 | -------------------------------------------------------------------------------- /stuff/piperun.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF__PIPERUN_H 2 | #define _STUFF__PIPERUN_H 3 | 4 | void *ocpPipeProcess_create (const char * const commandLine[]); 5 | int ocpPipeProcess_destroy (void *process); 6 | int ocpPipeProcess_terminate (void *process); 7 | 8 | int ocpPipeProcess_read_stdout (void *process, char *const buffer, unsigned size); 9 | int ocpPipeProcess_read_stderr (void *process, char *const buffer, unsigned size); 10 | 11 | struct PipeProcessAPI_t 12 | { 13 | void *(*Create) (const char * const commandLine[]); 14 | int (*Destroy) (void *process); 15 | int (*Terminate) (void *process); 16 | 17 | int (*ReadStdOut) (void *process, char *const buffer, unsigned size); 18 | int (*ReadStdErr) (void *process, char *const buffer, unsigned size); 19 | }; 20 | 21 | extern const struct PipeProcessAPI_t PipeProcess; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /stuff/sets.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETS_H 2 | #define __SETS_H 3 | 4 | struct settings 5 | { 6 | int16_t amp; /* [4..508] 64=nominal */ 7 | int16_t speed; /* [16..2048] 256=nominal */ 8 | int16_t pitch; /* [16..2048] 256=nominal */ 9 | int16_t pan; /* [-64..64] 64=nominal */ 10 | int16_t bal; /* [-64..64] 0=nomimal */ 11 | int16_t vol; /* [0..64] 64=nominal */ 12 | int16_t srnd; /* 0: normal stereo 1: one channel is inverted */ 13 | int16_t reverb; /* [-64..64] 0=nominal */ 14 | int16_t chorus; /* [-64..64] 0=nominal */ 15 | uint8_t filter; 16 | uint8_t useecho; 17 | uint8_t splock; /* 0: speed,pitch are independent 1: speed,pitch are locked */ 18 | uint8_t viewfx; /* 0: volume,panning,balance,surround 1: echo,revert,chorous (not implemented yet) */ 19 | }; 20 | 21 | extern struct settings set; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /stuff/utf-16.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_UTF_16_H 2 | #define _STUFF_UTF_16_H 1 3 | 4 | #include 5 | 6 | /* returns non-zero if stream is broken... *length tells how many words was consumed, even if stream is broken */ 7 | uint32_t utf16_decode (const uint16_t *src, size_t srclen, int *inc); 8 | 9 | /* returns number of words needed, excluding zero-termination */ 10 | int utf16_encoded_length (uint32_t codepoint); 11 | 12 | /* returns number of words used... up to 2 + NULL terminator */ 13 | int utf16_encode (uint16_t *dst, uint32_t code); 14 | 15 | char *utf16_to_utf8(const uint16_t *src); 16 | 17 | uint16_t *utf8_to_utf16(const char *src); 18 | 19 | uint16_t *utf8_to_utf16(const char *src); 20 | 21 | #if defined(_WIN32) || defined(TESTING) 22 | uint16_t *utf8_to_utf16_LFN(const char *src, const int slashstar); 23 | #endif 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /playym/README: -------------------------------------------------------------------------------- 1 | STYMulator v0.2 - GNU/Linux player for Atari ST YM files. 2 | Copyright (c) 1995-2005 by Arnaud Carre 3 | Copyright (c) 2005-2006 by Grzegorz Tomasz Stanczyk 4 | Copyright (c) 2019 by Stian Skjelstad 5 | Project Home Page: http://stian.cubic.org/project-stymulator.php 6 | Old Project Home Page: http://atariarea.krap.pl/stymulator 7 | Old Old Project Home Page: http://leonard.oxg.free.fr/stsound.html 8 | 9 | 10 | ST-Sound (YM files player library) 11 | GNU/Linux port by Grzegorz Tomasz Stanczyk 12 | Fork/Maintainer by Stian Skjelstad 13 | 14 | 15 | Description: 16 | ------------ 17 | 18 | STYMulator is a free (under GNU GPL license - see gpl.txt) YM files music player with curses-based terminal interface for GNU/Linux. 19 | It uses GNU/Linux port (stdoundlib directory) of the original ST-Sound then GPL v1.2, now BSD library by Arnaud Carre (http://leonard.oxg.free.fr) 20 | -------------------------------------------------------------------------------- /playym/stsoundlib/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../.. 2 | include $(TOPDIR)/Rules.make 3 | 4 | LIB = digidrum.o Ymload.o Ym2149Ex.o YmMusic.o YmUserInterface.o 5 | 6 | all: libym.a 7 | 8 | install: 9 | 10 | libym.a: $(LIB) 11 | $(AR) cr libym.a $(LIB) 12 | 13 | digidrum.o: digidrum.cpp YmTypes.h $(TOPDIR)/config.h 14 | $(CXX) $(CXXFLAGS) -c digidrum.cpp 15 | 16 | Ym2149Ex.o: Ym2149Ex.cpp Ym2149Ex.h YmTypes.h $(TOPDIR)/config.h 17 | $(CXX) $(CXXFLAGS) -c Ym2149Ex.cpp 18 | 19 | Ymload.o: Ymload.cpp YmMusic.h ../lzh/lzh.h $(TOPDIR)/config.h YmTypes.h 20 | $(CXX) $(CXXFLAGS) -c Ymload.cpp -I.. 21 | 22 | YmMusic.o: YmMusic.cpp YmMusic.h $(TOPDIR)/config.h 23 | $(CXX) $(CXXFLAGS) -c YmMusic.cpp 24 | 25 | YmUserInterface.o: YmUserInterface.cpp StSoundLibrary.h YmMusic.h $(TOPDIR)/config.h 26 | $(CXX) $(CXXFLAGS) -c YmUserInterface.cpp 27 | 28 | clean: 29 | $(RM) *~ *.o *.a 30 | 31 | dist: 32 | -------------------------------------------------------------------------------- /filesel/cdrom.h: -------------------------------------------------------------------------------- 1 | #ifndef _CDROM_H 2 | #define _CDROM_H 1 3 | 4 | #define IOCTL_CDROM_READTOC "CDROM_READTOC" 5 | 6 | struct _ioctl_cdrom_tocentry 7 | { 8 | uint32_t lba_addr; 9 | uint8_t is_data; 10 | }; 11 | 12 | struct ioctl_cdrom_readtoc_request_t 13 | { 14 | uint8_t starttrack; 15 | uint8_t lasttrack; 16 | // uint8_t is_xa; this would be stored in the session / multisession header - only relevant for non-audio */ 17 | 18 | /* track at endtrack+1 is LEADOUT... 0xaa in the Linux ioctl */ 19 | struct _ioctl_cdrom_tocentry track[101]; 20 | }; 21 | 22 | #define IOCTL_CDROM_READAUDIO_ASYNC_REQUEST "CDROM_READAUDIO_ASYNC_REQUEST" 23 | #define IOCTL_CDROM_READAUDIO_ASYNC_PULL "CDROM_READAUDIO_ASYNC_PULL" 24 | 25 | struct ioctl_cdrom_readaudio_request_t 26 | { 27 | uint32_t lba_addr; 28 | uint32_t lba_count; 29 | uint8_t *ptr; 30 | int retval; 31 | }; 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /crashreport.txt: -------------------------------------------------------------------------------- 1 | If you hit a crashbug (and you have compiled yourself from source): 2 | 3 | Go back into the source directory, and rerun configure with the same options 4 | and settings, just add --with-debug: 5 | 6 | ./configure --prefix=/usr/local --with-debug 7 | 8 | 9 | 10 | The force rebuild everything again and install (cflags changes isn't detected 11 | by make) 12 | 13 | make clean all install 14 | 15 | 16 | 17 | The run ocp again within gdb, and give gdb command r for run (and hit enter) 18 | 19 | gdb ocp 20 | (gdb) r 21 | 22 | 23 | 24 | Next time ocp crashes, give gdb command bt (and maybe other commands if you are in contact with 25 | me). This is the stuff I want sent to me (along with config.log from the 26 | source tree). 27 | 28 | (gdb) bt 29 | #1 123123 30 | #2 123123 31 | #3 32131 32 | 33 | 34 | 35 | In order to quit gdb and ocp, give gdb the command quit. 36 | 37 | (gdb) quit 38 | -------------------------------------------------------------------------------- /playay/main.c: -------------------------------------------------------------------------------- 1 | /* aylet 0.5, a .AY music file player. 2 | * Copyright (C) 2001-2010 Russell Marks and Ian Collier. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #define AYLET_VER "0.5" 20 | -------------------------------------------------------------------------------- /filesel/adbmeta.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADB_META_H 2 | #define _ADB_META_H 3 | 4 | // Some archievers might need to store some information that in not quickly accessible, like the uncompressed filesize, location of frames, .. 5 | 6 | struct configAPI_t; 7 | int adbMetaInit (const struct configAPI_t *configAPI); 8 | void adbMetaCommit (void); 9 | void adbMetaClose (void); 10 | // ZIP, GZ, BZ2, etc - who owns this meta-data 11 | int adbMetaAdd (const char *filename, const uint64_t filesize, const char *SIG, const unsigned char *data, const uint32_t datasize); // Replaces too 12 | int adbMetaRemove (const char *filename, const uint64_t filesize, const char *SIG); 13 | 14 | // when done, use free() 15 | int adbMetaGet (const char *filename, const uint64_t filesize, const char *SIG, unsigned char **data, uint32_t *datasize); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /stuff/ttf.h: -------------------------------------------------------------------------------- 1 | /* Based on SDL_ttf: Copyright (C) 2001-2020 Sam Lantinga */ 2 | 3 | #ifndef _STUFF_TTF_H_ 4 | #define _STUFF_TTF_H_ 5 | 6 | #include 7 | 8 | typedef struct 9 | { 10 | int w, h, pitch; 11 | uint8_t pixels[]; 12 | } TTF_Surface; 13 | 14 | typedef struct _TTF_Font TTF_Font; 15 | 16 | int TTF_Init(void); 17 | void TTF_Quit(void); 18 | 19 | 20 | TTF_Font * TTF_OpenFontFilename(const char *filename, int ptsize, long index, unsigned int hdpi, unsigned int vdpi); 21 | TTF_Font * TTF_OpenFontFILE(FILE *src, int ptsize, long index, unsigned int hdpi, unsigned int vdpi); 22 | void TTF_CloseFont(TTF_Font *font); 23 | 24 | int TTF_SetFontSizeDPI(TTF_Font *font, int ptsize, unsigned int hdpi, unsigned int vdpi); 25 | 26 | TTF_Surface * TTF_RenderGlyph32_Shaded(TTF_Font *font, uint32_t ch); 27 | 28 | const char *TTF_GetError (void); 29 | void TTF_ClearError (void); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /playwav/wave.h: -------------------------------------------------------------------------------- 1 | #ifndef __WAVE_H 2 | #define __WAVE_H 3 | 4 | struct waveinfo 5 | { 6 | unsigned long pos; 7 | unsigned long len; 8 | uint32_t rate; 9 | int stereo; 10 | int bit16; 11 | const char *opt25; 12 | const char *opt50; 13 | }; 14 | 15 | struct ocpfilehandle_t; 16 | struct cpifaceSessionAPI_t; 17 | 18 | OCP_INTERNAL unsigned char wpOpenPlayer (struct ocpfilehandle_t *fp, struct cpifaceSessionAPI_t *cpifaceSession); 19 | OCP_INTERNAL void wpClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 20 | OCP_INTERNAL void wpIdle (struct cpifaceSessionAPI_t *cpifaceSession); 21 | OCP_INTERNAL void wpSetLoop (unsigned char s); 22 | OCP_INTERNAL char wpLooped (void); 23 | OCP_INTERNAL void wpGetInfo (struct cpifaceSessionAPI_t *cpifaceSession, struct waveinfo *); 24 | OCP_INTERNAL uint32_t wpGetPos (struct cpifaceSessionAPI_t *cpifaceSession); 25 | OCP_INTERNAL void wpSetPos (struct cpifaceSessionAPI_t *cpifaceSession, uint32_t pos); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /playgmd/gmdtype.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYGMD_GMDTYPE_H 2 | #define PLAYGMD_GMDTYPE_H 1 3 | 4 | struct PluginInitAPI_t; 5 | OCP_INTERNAL int gmd_type_init (struct PluginInitAPI_t *API); 6 | 7 | struct PluginCloseAPI_t; 8 | OCP_INTERNAL void gmd_type_done (struct PluginCloseAPI_t *API); 9 | 10 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayer669; 11 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerAMS; 12 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerDMF; 13 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerMDL; 14 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerMTM; 15 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerOKT; 16 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerPTM; 17 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerS3M; 18 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerSTM; 19 | extern OCP_INTERNAL const struct cpifaceplayerstruct gmdPlayerULT; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /filesel/musicbrainz.h: -------------------------------------------------------------------------------- 1 | #ifndef MUSICBRAINZ_H 2 | #define MUSICBRAINZ_H 1 3 | 4 | #include "mdb.h" 5 | 6 | struct musicbrainz_database_h 7 | { 8 | char album[MDB_COMPOSER_LEN]; /* common for the entire CD */ 9 | uint32_t date[100]; 10 | char title[100][MDB_TITLE_LEN]; 11 | char artist[100][MDB_ARTIST_LEN]; 12 | }; 13 | 14 | /* toc needs to be string in this format: "1 18 284700 150 15862 33817 51905 71767 88997 102517 118750 137782 154112 158765 175650 182765 202162 217580 239225 248915 268307" */ 15 | void *musicbrainz_lookup_discid_init (const char *discid, const char *toc, struct musicbrainz_database_h **result); 16 | 17 | int musicbrainz_lookup_discid_iterate (void *token, struct musicbrainz_database_h **result); 18 | 19 | void musicbrainz_lookup_discid_cancel (void *token); 20 | 21 | void musicbrainz_database_h_free (struct musicbrainz_database_h *); 22 | 23 | struct configAPI_t; 24 | int musicbrainz_init (const struct configAPI_t *configAPI); 25 | 26 | void musicbrainz_done (void); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /filesel/filesystem-drive.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILESYSTEM_DRIVE_H 2 | #define _FILESYSTEM_DRIVE_H 1 3 | 4 | struct ocpdir_t; 5 | 6 | /* basedir->dirdb_ref is expected to be dirdbFindAndRef(DIRDB_NOPARENT, dmDrive) */ 7 | struct dmDrive 8 | { 9 | char drivename[13]; 10 | struct ocpdir_t *basedir; 11 | struct ocpdir_t *cwd; 12 | struct dmDrive *next; 13 | }; 14 | extern struct dmDrive *dmDrives; 15 | 16 | struct dmDrive *RegisterDrive(const char *dmDrive, struct ocpdir_t *basedir, struct ocpdir_t *cwd); 17 | void UnregisterDrive(struct dmDrive *drive); 18 | struct dmDrive *dmFindDrive(const char *dmDrive); /* to get the correct drive from a given string */ 19 | 20 | void filesystem_drive_init (void); 21 | void filesystem_drive_done (void); 22 | 23 | int filesystem_resolve_dirdb_dir (uint32_t ref, struct dmDrive **drive, struct ocpdir_t **dir); 24 | int filesystem_resolve_dirdb_file (uint32_t ref, struct dmDrive **drive, struct ocpfile_t **file); 25 | 26 | struct dmDrive *ocpdir_get_drive (struct ocpdir_t *dir); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /filesel/filesystem-playlist.h: -------------------------------------------------------------------------------- 1 | #ifndef FILESYSTEM_PLAYLIST_H 2 | #define FILESYSTEM_PLAYLIST_H 1 3 | 4 | struct ocpdir_t; 5 | struct ocpfile_t; 6 | struct playlist_instance_t; 7 | 8 | struct playlist_string_entry_t 9 | { 10 | char *string; 11 | int flags; /* can contain DIRDB_RESOLVE_DRIVE DIRDB_RESOLVE_TILDE_HOME */ 12 | }; 13 | 14 | struct playlist_instance_t 15 | { 16 | struct ocpdir_t head; 17 | struct playlist_instance_t *next; 18 | 19 | struct playlist_string_entry_t *string_data; 20 | int string_count; 21 | int string_size; 22 | int string_pos; /* increased by iterate until it matches count, then it resets and clears */ 23 | 24 | struct ocpfile_t **ocpfile_data; 25 | int ocpfile_count; 26 | int ocpfile_size; 27 | }; 28 | 29 | extern struct playlist_instance_t *playlist_root; 30 | 31 | struct playlist_instance_t *playlist_instance_allocate (struct ocpdir_t *parent, uint32_t dirdb_ref); 32 | 33 | /* steals the string */ 34 | void playlist_add_string (struct playlist_instance_t *self, char *string, const int flags); 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /playay/ayplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _AYPLAY_H 2 | #define _AYPLAY_H 3 | 4 | struct ayinfo 5 | { 6 | unsigned char filever, playerver; 7 | int track; 8 | int numtracks; 9 | const char *trackname; 10 | }; 11 | 12 | struct ay_driver_frame_state_t; /* sound.h */ 13 | struct ocpfilehandle_t; 14 | struct cpifaceSessionAPI_t; 15 | OCP_INTERNAL int ayOpenPlayer (struct ocpfilehandle_t *, struct cpifaceSessionAPI_t *cpifaceSession); 16 | OCP_INTERNAL void ayClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 17 | OCP_INTERNAL void ayIdle (struct cpifaceSessionAPI_t *cpifaceSession); 18 | OCP_INTERNAL void aySetLoop (uint8_t s); 19 | OCP_INTERNAL int ayIsLooped (void); 20 | OCP_INTERNAL void aySetMute (struct cpifaceSessionAPI_t *cpifaceSession, int ch, int mute); 21 | OCP_INTERNAL void ayGetInfo (struct ayinfo *); 22 | OCP_INTERNAL void ayGetChans (struct ay_driver_frame_state_t *); 23 | OCP_INTERNAL void ayStartSong (struct cpifaceSessionAPI_t *cpifaceSession, int song); 24 | OCP_INTERNAL void ayChanSetup (struct cpifaceSessionAPI_t *cpifaceSession); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /cpiface/Makefile-static: -------------------------------------------------------------------------------- 1 | GIF_O= 2 | ifeq ($(HAVE_LZW),1) 3 | GIF_O=gif.o 4 | endif 5 | 6 | cpiface_so=fft.o cpianal.o cpichan.o cpidots.o cpiface.o cpigraph.o cpiinst.o cpikube.o cpilinks.o cpimsg.o cpimvol.o cpiphase.o cpipic.o cpiptype.o cpiscope.o cpitext.o cpitrack.o mcpedit.o tga.o volctrl.o 7 | 8 | # libocp_so is linked by parent 9 | cpiface_libocp_so=cpikeyhelp.o jpeg.o $(GIF_O) png.o 10 | 11 | ifeq ($(HAVE_X11),1) 12 | NEED_CPIFONTDEBUG=1 13 | endif 14 | ifeq ($(HAVE_SDL),1) 15 | NEED_CPIFONTDEBUG=1 16 | endif 17 | ifeq ($(HAVE_SDL2),1) 18 | NEED_CPIFONTDEBUG=1 19 | endif 20 | ifeq ($(NEED_CPIFONTDEBUG),1) 21 | cpifontdebug_so = cpifontdebug.o 22 | CPIFONTDEBUG_SO = cpifontdebug$(LIB_SUFFIX) 23 | endif 24 | 25 | STATIC_LIBS += $(LIBJPEG_LIBS) $(LIBPNG_LIBS) 26 | 27 | ifeq ($(STATIC_CORE),1) 28 | STATIC_OBJECTS += $(patsubst %.o,cpiface/%.o,$(cpiface_so)) 29 | STATIC_OBJECTS += $(patsubst %.o,cpiface/%.o,$(cpifontdebug_so)) 30 | 31 | STATIC_LIBS += $(MATH_LIBS) 32 | endif 33 | 34 | LIBOCP_OBJECTS += $(patsubst %.o,cpiface/%.o,$(cpiface_libocp_so)) 35 | -------------------------------------------------------------------------------- /playsid/sidplayfp-config/config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef _SIDPLAY_CONFIG_H 2 | #define _SIDPLAY_CONFIG_H 3 | 4 | /* define if the compiler supports basic C++11 syntax */ 5 | #undef HAVE_CXX11 6 | #undef HAVE_CXX14 7 | #undef HAVE_CXX17 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_SIDPLAYFP_BUILDERS_EXSID_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_SIDPLAYFP_BUILDERS_RESID_H 20 | 21 | /* Define to 1 if you have the `strcasecmp' function. */ 22 | #undef HAVE_STRCASECMP 23 | 24 | /* Define to 1 if you have the `strncasecmp' function. */ 25 | #undef HAVE_STRNCASECMP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | #undef WORDS_BIGENDIAN 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /playym/ymplay.h: -------------------------------------------------------------------------------- 1 | #ifndef YMPLAY_H 2 | #define YMPLAY_H 1 3 | 4 | struct ocpfilehandle_t; 5 | struct cpifaceSessionAPI_t; 6 | class CYmMusic; 7 | 8 | OCP_INTERNAL void ymClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 9 | OCP_INTERNAL void ymMute (struct cpifaceSessionAPI_t *cpifaceSession, int i, int m); 10 | OCP_INTERNAL int ymOpenPlayer (struct ocpfilehandle_t *file, struct cpifaceSessionAPI_t *cpifaceSession); 11 | OCP_INTERNAL void ymSetLoop (int loop); 12 | OCP_INTERNAL int ymIsLooped (void); 13 | 14 | OCP_INTERNAL void ymIdle (struct cpifaceSessionAPI_t *cpifaceSession); 15 | 16 | extern OCP_INTERNAL CYmMusic *pMusic; 17 | 18 | struct channel_info_t 19 | { 20 | int frequency_a; 21 | int frequency_b; 22 | int frequency_c; 23 | int frequency_noise; 24 | int frequency_envelope; 25 | int envelope_shape; 26 | int mixer_control; 27 | int level_a; 28 | int level_b; 29 | int level_c; 30 | }; 31 | 32 | OCP_INTERNAL struct channel_info_t *ymRegisters (void); 33 | OCP_INTERNAL uint32_t ymGetPos (void); 34 | OCP_INTERNAL void ymSetPos (uint32_t pos); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /doc/cmdline.txt: -------------------------------------------------------------------------------- 1 | OpenCP command line help 2 | 3 | Usage: cp []* [@]* []* 4 | 5 | Options: 6 | 7 | -h : show this help 8 | -c : use specific configuration 9 | -f : fileselector settings 10 | r[0|1] : remove played files from module list 11 | o[0|1] : don't scramble module list order 12 | l[0|1] : loop modules 13 | -v : sound settings 14 | a{0..800} : set amplification 15 | v{0..100} : set volume 16 | b{-100..100} : set balance 17 | p{-100..100} : set panning 18 | r{-100..100} : set reverb 19 | c{-100..100} : set chorus 20 | s{0|1} : set surround 21 | f{0..2} : set filter (0=off, 1=AOI, 2=FOI) 22 | -s : device settings 23 | p : use specific player device 24 | w : use specific wavetable device 25 | r{0..64000} : sample at specific rate 26 | 8 : play/sample/mix as 8bit 27 | m : play/sample/mix mono 28 | 29 | Example : cp -fl0,r1 -va80,p50,f2 -spdevpdisk -sr48000 ftstar.xm 30 | (for nice HD rendering of modules) 31 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.16.5 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996-2021 Free Software Foundation, Inc. 4 | 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15 | m4_include([m4/ax_check_compile_flag.m4]) 16 | m4_include([m4/ax_cxx_compile_stdcxx.m4]) 17 | m4_include([m4/ax_cxx_compile_stdcxx_11.m4]) 18 | m4_include([m4/ax_cxx_compile_stdcxx_14.m4]) 19 | m4_include([m4/ax_cxx_compile_stdcxx_17.m4]) 20 | m4_include([m4/ax_prog_cc_for_build.m4]) 21 | m4_include([m4/ax_require_defined.m4]) 22 | m4_include([m4/ax_with_curses.m4]) 23 | m4_include([m4/pkg.m4]) 24 | m4_include([m4/sdl2.m4]) 25 | -------------------------------------------------------------------------------- /playopl/oplplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLAYOPL_H 2 | #define _PLAYOPL_H 1 3 | 4 | extern "C" 5 | { 6 | struct ocpfilehandle_t; 7 | struct cpifaceSessionAPI_t; 8 | } 9 | 10 | extern void oplClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 11 | extern int oplOpenPlayer (const char *filename /* needed for detection */, uint8_t *content /* data is stolen */, const size_t len, struct ocpfilehandle_t *file, struct cpifaceSessionAPI_t *cpifaceSession); 12 | extern void oplSetLoop(int); 13 | extern int oplIsLooped(void); 14 | extern void oplIdle (struct cpifaceSessionAPI_t *cpifaceSession); 15 | 16 | struct oplTuneInfo { 17 | int songs; 18 | int currentSong; 19 | char title[64]; 20 | char author[64]; 21 | }; 22 | 23 | extern void oplpGetGlobInfo(oplTuneInfo &si); 24 | extern void oplSetSong (struct cpifaceSessionAPI_t *cpifaceSession, int song); 25 | extern void oplMute (struct cpifaceSessionAPI_t *cpifaceSession, int i, int m); 26 | extern void OPLChanInit (struct cpifaceSessionAPI_t *cpifaceSession); 27 | 28 | struct oplStatus; 29 | extern struct oplStatus oplLastStatus; // Delayed data 30 | extern int oplLastPos; // Delayed data 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /playay/portmap.txt: -------------------------------------------------------------------------------- 1 | 16K/48K: 2 | 3 | ULA: all odd ports (even if specification said to use port 0x__fe), it is sensitive to (port & 0x0001) == 0 4 | bit 4 and 3: ___00___: 0.39V (v2), 0.34V (v3) 5 | ___01___: 0.73V (v2), 0.66V (v3) 6 | ___10___: 3.66V (v2), 3.56V (v3) 7 | ___11___: 3.79V (v2), 3.70V (v3) 8 | 9 | 128K: 10 | 11 | ULA: all odd ports (even if specification said to use port 0x__fe), it is sensitive to (port & 0x0001) == 0 12 | 13 | AY-3-8912 register: (official 0xfffd) (port & 0xC002)==0xC000 14 | data: (official 0xbffd) (port & 0xC002)==0x4000 15 | 16 | 17 | Timex TS2068: 18 | 19 | ULA: 0x__fe (same chip as in 48K model) 20 | 21 | AY-3-8912 register: (official 0xfff5) (port & 0x00ff)==0x00f5 22 | data: (official 0xbff6) (port & 0x00ff)==0x00f6 23 | 24 | 25 | CPC armstradt: 26 | 27 | PSG -> AY-3-8912: register: (official 0xf4__) (port & 0x0b)==0x0200 28 | data: (official 0xf5__) (port & 0x0b)==0x0000 29 | 30 | 31 | Fuller Audio Box: 32 | 33 | AY-3-8912 register: (port & 0x00ff)==0x003f 34 | data: (port & 0x00ff)==0x005f 35 | 36 | -------------------------------------------------------------------------------- /boot/plinkman_end.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * Part of Link Manager (plinkman.c) 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "config.h" 23 | #include "types.h" 24 | #include "plinkman.h" 25 | 26 | #ifdef SUPPORT_STATIC_PLUGINS 27 | DLLEXTINFO_END_PREFIX struct linkinfostruct staticdlls_end_of_list = {0}; 28 | #endif 29 | -------------------------------------------------------------------------------- /playtimidity/cpikaraoke.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLAYTIMIDITY_CPIKARAOKE_H 2 | #define _PLAYTIMIDITY_CPIKARAOKE_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | 6 | struct syllable_t 7 | { 8 | uint32_t timecode; 9 | unsigned int measuredwidth; 10 | char text[]; 11 | }; 12 | struct line_t 13 | { 14 | unsigned int is_paragraph; 15 | unsigned int syllables; 16 | unsigned int measuredwidth; 17 | struct syllable_t **syllable; 18 | }; 19 | struct lyric_t 20 | { 21 | unsigned int lines; 22 | struct line_t *line; 23 | }; 24 | 25 | OCP_INTERNAL int karaoke_new_line (struct lyric_t *lyric); 26 | 27 | OCP_INTERNAL int karaoke_new_paragraph (struct lyric_t *lyric); 28 | 29 | OCP_INTERNAL int karaoke_new_syllable (struct cpifaceSessionAPI_t *cpifaceSession, struct lyric_t *lyric, uint32_t timecode, const char *src, int length); 30 | 31 | OCP_INTERNAL void karaoke_clear (struct lyric_t *lyric); 32 | 33 | OCP_INTERNAL void cpiKaraokeInit (struct cpifaceSessionAPI_t *cpifaceSession, struct lyric_t *lyric); 34 | OCP_INTERNAL void cpiKaraokeDone (struct cpifaceSessionAPI_t *cpifaceSession); 35 | 36 | OCP_INTERNAL void cpiKaraokeSetTimeCode (struct cpifaceSessionAPI_t *cpifaceSession, uint32_t timecode); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /dev/deviplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEV_DEVIPLAY_H 2 | #define _DEV_DEVIPLAY_H 1 3 | 4 | struct plrDevAPI_t; 5 | struct ringbufferAPI_t; 6 | 7 | struct plrDriverAPI_t 8 | { 9 | const struct ringbufferAPI_t *ringbufferAPI; 10 | void (*GetRealMasterVolume) (int *l, int *r); /* default functions that can be used */ 11 | void (*GetMasterSample) (int16_t *s, uint32_t len, uint32_t rate, int opt); /* default functions that can be used */ 12 | void (*ConvertBufferFromStereo16BitSigned) (void *dstbuf, int16_t *srcbuf, int samples, int to16bit, int tosigned, int tostereo, int revstereo); 13 | }; 14 | 15 | struct plrDriver_t 16 | { 17 | char name[32]; /* includes the NULL termination */ 18 | char description[64]; /* includes the NULL termination */ 19 | 20 | int (*Detect) (const struct plrDriver_t *driver); /* 0 = driver not functional, 1 = driver is functional */ 21 | const struct plrDevAPI_t *(*Open) (const struct plrDriver_t *driver, const struct plrDriverAPI_t *plrDriverAPI); 22 | void (*Close) (const struct plrDriver_t *driver); 23 | }; 24 | extern void plrRegisterDriver (const struct plrDriver_t *driver); 25 | extern void plrUnregisterDriver(const struct plrDriver_t *driver); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /stuff/utf-8.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_UTF_8_H 2 | #define _STUFF_UTF_8_H 1 3 | 4 | #include 5 | 6 | /* returns non-zero if stream is broken... *length tells how many bytes was consumed, even if stream is broken */ 7 | uint32_t utf8_decode (const char *_src, size_t srclen, int *inc); 8 | 9 | /* returns number of characters needed, excluding zero-termination */ 10 | int utf8_encoded_length (uint32_t codepoint); 11 | 12 | /* returns number of characters used... up to 6 + NULL terminator */ 13 | int utf8_encode (char *dst, uint32_t code); 14 | 15 | void displaystr_utf8_overflowleft (uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len); 16 | 17 | /* zero-terminated fixed buffer */ 18 | /* return values: 19 | * -1 - cancelled 20 | * 0 - finished 21 | * 1 - call again 22 | */ 23 | int EditStringUTF8z(unsigned int y, unsigned int x, unsigned int w, int l, char *s); 24 | 25 | /* zero-terminated, forever long dynamic buffer */ 26 | int EditStringUTF8(unsigned int y, unsigned int x, unsigned int w, char **s); 27 | 28 | /* zero-terminated, forever long dynamic buffer */ 29 | int EditStringASCII(unsigned int y, unsigned int x, unsigned int w, char **s); 30 | 31 | char *utf8_casefold (const char *src); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /cpiface/mcpedit.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'24 Stian Skjelstad 4 | * 5 | * CPIFace output routines / key handlers for the MCP system 6 | */ 7 | 8 | #ifndef __MCPEDIT_H 9 | #define __MCPEDIT_H 10 | 11 | struct cpifaceSessionAPI_t; 12 | 13 | /* For the sliding pause effect, range 64 = normal speed, 1 = almost complete stop. 14 | * For complete stop with wavetable use mcpSet (-1, mcpMasterPause, 1) and for stream playback the stream has to send zero-data 15 | */ 16 | OCP_INTERNAL void mcpSetMasterPauseFadeParameters (struct cpifaceSessionAPI_t *cpifaceSession, int i); 17 | 18 | /* manipulates SetMasterPauseFadeParameters() and InPause */ 19 | OCP_INTERNAL void mcpTogglePauseFade (struct cpifaceSessionAPI_t *cpifaceSession); 20 | 21 | /* manipulates SetMasterPauseFadeParameters() and InPause */ 22 | OCP_INTERNAL void mcpTogglePause (struct cpifaceSessionAPI_t *cpifaceSession); 23 | 24 | enum mcpNormalizeType; /* cpiface.h */ 25 | OCP_INTERNAL void mcpNormalize (struct cpifaceSessionAPI_t *cpifaceSession, enum mcpNormalizeType Type); 26 | 27 | OCP_INTERNAL void mcpDoPauseFade (struct cpifaceSessionAPI_t *cpifaceSession); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /playgme/gmeplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _GMEPLAY_H 2 | #define _GMEPLAY_H 3 | 4 | struct moduletype; 5 | struct gmeinfo 6 | { 7 | int track; 8 | int numtracks; 9 | const char* system; 10 | const char* game; 11 | const char* song; 12 | const char* author; 13 | const char* copyright; 14 | const char* comment; 15 | const char* dumper; 16 | int length; 17 | int introlength; 18 | int looplength; 19 | int playlength; 20 | }; 21 | 22 | 23 | OCP_INTERNAL extern struct moduletype gme_mt; 24 | OCP_INTERNAL extern const char *gme_filename; 25 | 26 | struct ocpfilehandle_t; 27 | struct cpifaceSessionAPI_t; 28 | 29 | OCP_INTERNAL int gmeOpenPlayer (struct ocpfilehandle_t *, struct cpifaceSessionAPI_t *cpifaceSession); 30 | OCP_INTERNAL void gmeClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 31 | OCP_INTERNAL void gmeIdle (struct cpifaceSessionAPI_t *cpifaceSession); 32 | OCP_INTERNAL void gmeSetLoop (int s); 33 | OCP_INTERNAL int gmeIsLooped (void); 34 | OCP_INTERNAL void gmeGetInfo (struct gmeinfo *); 35 | OCP_INTERNAL void gmeStartSong (struct cpifaceSessionAPI_t *cpifaceSession, int song); 36 | 37 | OCP_INTERNAL void gmeInfoInit (struct cpifaceSessionAPI_t *cpifaceSession); 38 | OCP_INTERNAL void gmeInfoDone (struct cpifaceSessionAPI_t *cpifaceSession); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /help/cphelper.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) '94-'98 Niklas Beisert 3 | * 4 | * CP hypertext help viewer 5 | * 6 | * revision history: (please note changes here) 7 | * -fg980924 Fabian Giesen 8 | * -first version (mainly for wrappers) 9 | */ 10 | 11 | #ifndef _cphelper_h 12 | #define _cphelper_h 13 | 14 | typedef struct help_link { 15 | uint32_t posx, posy, len; 16 | void *ref; 17 | } help_link; 18 | 19 | typedef struct llink { 20 | uint32_t posx, posy, len; 21 | void *ref; 22 | struct llink *next; 23 | } link_list; 24 | 25 | typedef struct helppage { 26 | char name[128]; 27 | char desc[128]; 28 | char *data; 29 | uint16_t *rendered; 30 | int linkcount; 31 | help_link *links; 32 | uint32_t size, lines; 33 | } helppage; 34 | 35 | #define hlpErrOk 0 36 | #define hlpErrNoFile 1 37 | #define hlpErrBadFile 2 38 | #define hlpErrTooNew 3 39 | 40 | extern helppage *brDecodeRef(char *name); 41 | extern void brRenderPage(helppage *pg); 42 | extern void brSetPage(helppage *pg); 43 | extern void brDisplayHelp(void); 44 | extern void brSetWinStart(int fl); 45 | extern void brSetWinHeight(int h); 46 | extern int brHelpKey(uint16_t key); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /plugins/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | all: freverb$(LIB_SUFFIX) ireverb$(LIB_SUFFIX) 5 | 6 | freverb_so=freverb.o 7 | freverb$(LIB_SUFFIX): $(freverb_so) 8 | $(CC) $(SHARED_FLAGS) -o $@ $^ $(MATH_LIBS) 9 | 10 | ireverb_so=ireverb.o 11 | ireverb$(LIB_SUFFIX): $(ireverb_so) 12 | $(CC) $(SHARED_FLAGS) -o $@ $^ $(MATH_LIBS) 13 | 14 | clean: 15 | rm -f *.o *$(LIB_SUFFIX) 16 | 17 | install: 18 | mkdir -p "$(DESTDIR)$(LIBDIROCP)/autoload" 19 | $(CP) freverb$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload" 20 | $(CP) ireverb$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload" 21 | 22 | uninstall: 23 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/freverb$(LIB_SUFFIX)" 24 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/ireverb$(LIB_SUFFIX)" 25 | 26 | freverb.o: freverb.c \ 27 | ../config.h \ 28 | ../types.h \ 29 | ../boot/plinkman.h \ 30 | ../cpiface/cpiface.h \ 31 | ../cpiface/vol.h \ 32 | ../dev/mcp.h \ 33 | ../dev/postproc.h \ 34 | ../stuff/err.h \ 35 | ../stuff/imsrtns.h 36 | $(CC) -O $< -o $@ -c 37 | 38 | ireverb.o: ireverb.c \ 39 | ../config.h \ 40 | ../types.h \ 41 | ../boot/plinkman.h \ 42 | ../cpiface/cpiface.h \ 43 | ../cpiface/vol.h \ 44 | ../dev/mcp.h \ 45 | ../dev/postproc.h \ 46 | ../stuff/err.h \ 47 | ../stuff/imsrtns.h 48 | $(CC) -O $< -o $@ -c 49 | -------------------------------------------------------------------------------- /devw/dwmix.h: -------------------------------------------------------------------------------- 1 | #ifndef _DWMIX_H 2 | #define _DWMIX_H 3 | 4 | /* This is channel options */ 5 | #define MIXRQ_INTERPOLATE 1 6 | #define MIXRQ_INTERPOLATEMAX 2 7 | #define MIXRQ_PLAY16BIT 4 8 | #define MIXRQ_PLAYSTEREO 8 9 | 10 | #define MIXRQ_LOOPED 32 11 | #define MIXRQ_PINGPONGLOOP 64 12 | 13 | #define MIXRQ_PLAYING 128 14 | #define MIXRQ_MUTE 512 15 | 16 | struct channel 17 | { 18 | void *samp; 19 | union 20 | { 21 | int8_t *bit8; 22 | int16_t *bit16; 23 | int32_t *bit32; 24 | } realsamp; 25 | uint32_t length; 26 | uint32_t loopstart; 27 | uint32_t loopend; 28 | uint32_t replen; 29 | int32_t step; 30 | uint32_t pos; 31 | uint16_t fpos; 32 | uint16_t status; 33 | int32_t curvols[2][2]; /* negativ volume = panning */ 34 | int32_t dstvols[2][2]; /* -- " -- */ 35 | 36 | int32_t vol[2][2]; /* -- " -- */ 37 | int32_t orgvol[2]; /* -- " -- */ 38 | uint32_t orgrate; 39 | uint32_t orgfrq; 40 | uint32_t orgdiv; 41 | int volopt; /* only one flag: 0x01 srnd */ 42 | int orgvolx; /* 0 - 0x100 */ 43 | int orgpan; /* -0x80 - +0x7f */ 44 | int samptype; /* samptype&mcpSampLoop mcpSampSLoop mcpSampSBiDi mcpSamp16Bit mcpSampInterleavedStereo */ 45 | uint32_t orgloopstart; 46 | uint32_t orgloopend; 47 | uint32_t orgsloopstart; 48 | uint32_t orgsloopend; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /playgmd/gmdinst.h: -------------------------------------------------------------------------------- 1 | #ifndef __GMDINST_H 2 | #define __GMDINST_H 3 | 4 | enum 5 | { 6 | mpEnvLoop=1, mpEnvBiDi=2, mpEnvSLoop=4, mpEnvSBiDi=8 7 | }; 8 | 9 | struct gmdenvelope 10 | { 11 | uint8_t *env; 12 | uint16_t len; 13 | uint16_t loops, loope; 14 | uint16_t sloops, sloope; 15 | uint8_t type; 16 | uint8_t speed; 17 | }; 18 | 19 | struct gmdsample 20 | { 21 | char name[32]; 22 | uint16_t handle; 23 | int16_t normnote; 24 | int16_t stdvol; 25 | int16_t stdpan; 26 | uint16_t opt; 27 | #define MP_OFFSETDIV2 1 28 | uint16_t volfade; 29 | uint8_t pchint; 30 | uint16_t volenv; 31 | uint16_t panenv; 32 | uint16_t pchenv; 33 | uint8_t vibspeed; 34 | uint8_t vibtype; 35 | uint16_t vibrate; 36 | uint16_t vibdepth; 37 | uint16_t vibsweep; 38 | }; 39 | 40 | struct gmdinstrument 41 | { 42 | char name[32]; 43 | unsigned short samples[128]; 44 | }; 45 | 46 | struct sampleinfo; 47 | struct cpifaceSessionAPI_t; 48 | 49 | OCP_INTERNAL void gmdInstSetup (struct cpifaceSessionAPI_t *cpifaceSession, const struct gmdinstrument *ins, int nins, const struct gmdsample *smp, int nsmp, const struct sampleinfo *smpi, int nsmpi, int type, void (*MarkyBoy)(struct cpifaceSessionAPI_t *cpifaceSession, uint8_t *, uint8_t *)); 50 | OCP_INTERNAL void gmdInstClear (struct cpifaceSessionAPI_t *cpifaceSession); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /medialib/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | include Makefile-static 4 | 5 | ifeq ($(STATIC_CORE),1) 6 | all: $(medialib_so) 7 | else 8 | all: medialib$(LIB_SUFFIX) 9 | endif 10 | 11 | medialib$(LIB_SUFFIX): $(medialib_so) 12 | $(CC) $(SHARED_FLAGS) -o $@ $^ 13 | 14 | clean: 15 | rm -f *.o *$(LIB_SUFFIX) 16 | 17 | ifeq ($(STATIC_CORE),1) 18 | install: 19 | uninstall: 20 | else 21 | install: 22 | $(CP) medialib$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/90-medialib$(LIB_SUFFIX)" 23 | 24 | uninstall: 25 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/90-medialib$(LIB_SUFFIX)" 26 | endif 27 | 28 | medialib.o: medialib.c \ 29 | medialib-add.c \ 30 | medialib-listall.c \ 31 | medialib-refresh.c \ 32 | medialib-remove.c \ 33 | medialib-scan.c \ 34 | medialib-search.c \ 35 | ../config.h \ 36 | ../types.h \ 37 | ../boot/plinkman.h \ 38 | ../boot/psetting.h \ 39 | ../filesel/adbmeta.h \ 40 | ../filesel/dirdb.h \ 41 | ../filesel/filesystem.h \ 42 | ../filesel/filesystem-dir-mem.h \ 43 | ../filesel/filesystem-drive.h \ 44 | ../filesel/filesystem-file-dev.h \ 45 | ../filesel/modlist.h \ 46 | ../filesel/mdb.h \ 47 | ../filesel/pfilesel.h \ 48 | ../stuff/compat.h \ 49 | ../stuff/err.h \ 50 | ../stuff/framelock.h \ 51 | ../stuff/poutput.h \ 52 | ../stuff/utf-8.h 53 | $(CC) medialib.c -o $@ -c 54 | -------------------------------------------------------------------------------- /playmp2/mpplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _MPPLAY_H 2 | #define _MPPLAY_H 3 | 4 | struct mpeginfo 5 | { 6 | uint32_t pos; 7 | uint32_t len; 8 | uint32_t timelen; 9 | uint32_t rate; 10 | int stereo; 11 | int bit16; 12 | const char *opt25; 13 | const char *opt50; 14 | }; 15 | 16 | struct ID3_t; 17 | struct ocpfilehandle_t; 18 | 19 | struct cpifaceSessionAPI_t; 20 | extern OCP_INTERNAL int mpeg_Bitrate; /* bitrate of the last decoded frame */ 21 | OCP_INTERNAL int mpegOpenPlayer (struct ocpfilehandle_t *, struct cpifaceSessionAPI_t *cpifaceSession); 22 | OCP_INTERNAL void mpegClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 23 | OCP_INTERNAL void mpegIdle (struct cpifaceSessionAPI_t *cpifaceSession); 24 | OCP_INTERNAL void mpegSetLoop (uint8_t s); 25 | OCP_INTERNAL char mpegIsLooped (void); 26 | OCP_INTERNAL void mpegGetInfo (struct mpeginfo *); 27 | OCP_INTERNAL uint32_t mpegGetPos (void); 28 | OCP_INTERNAL void mpegSetPos (uint32_t pos); 29 | OCP_INTERNAL void mpegGetID3 (struct ID3_t **ID3); 30 | OCP_INTERNAL void ID3InfoInit (struct cpifaceSessionAPI_t *cpifaceSession); 31 | OCP_INTERNAL void ID3InfoDone (struct cpifaceSessionAPI_t *cpifaceSession); 32 | OCP_INTERNAL void ID3PicInit (struct cpifaceSessionAPI_t *cpifaceSession); 33 | OCP_INTERNAL void ID3PicDone (struct cpifaceSessionAPI_t *cpifaceSession); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /doc/texi/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../../ 2 | include $(TOPDIR)/Rules.make 3 | ifeq ($(HAVE_MAKEINFO),yes) 4 | endif 5 | 6 | ifeq ($(HAVE_MAKEINFO),yes) 7 | SOURCES=configuration.texi fileselector.texi player.texi starting.texi wap.texi faq.texi ocp.texi support.texi 8 | all: ocp.info.gz 9 | 10 | ocp.info.gz: $(SOURCES) 11 | rm -Rf ocp ocp_html ocp.info ocp.info.gz 12 | LC_ALL=POSIX makeinfo ocp.texi 13 | mv ocp ocp.info 14 | gzip -9 ocp.info 15 | LC_ALL=POSIX makeinfo --html ocp.texi 16 | @# compensate for that texinfo version 7.0 creates a directory named "ocp_html", while prior versions uses just "ocp" 17 | if [ ! -d ocp_html ]; then mv ocp ocp_html; fi 18 | 19 | install: all 20 | mkdir -p "$(DESTDIR)$(INFODIR)" 21 | ifeq ($(INSTALL_INFO),1) 22 | $(CP) ocp.info.gz "$(DESTDIR)$(INFODIR)" 23 | install-info --dir-file="$(DESTDIR)$(INFODIR)/dir" "$(DESTDIR)$(INFODIR)/ocp.info.gz" || true 24 | endif 25 | mkdir -p "$(DESTDIR)$(DOCDIR)/html" 26 | $(CP) -R ocp_html/* "$(DESTDIR)$(DOCDIR)/html" 27 | uninstall: 28 | install-info --delete --dir-file="$(DESTDIR)$(INFODIR)/dir" "$(DESTDIR)$(INFODIR)/ocp.info.gz" || true 29 | rm -f "$(DESTDIR)$(INFODIR)/ocp.info.gz" 30 | rm -Rf "$(DESTDIR)$(DOCDIR)/html" 31 | else 32 | all: 33 | 34 | install: 35 | 36 | uninstall: 37 | endif 38 | 39 | clean: 40 | rm -Rf ocp ocp.info ocp.info.gz html ocp_html 41 | -------------------------------------------------------------------------------- /playopl/oplNuked.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2005-'24 Stian Skjelstad 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #ifndef H_ADPLUG_OPLNUKEDH 20 | #define H_ADPLUG_OPLNUKEDH 21 | 22 | #include "adplug-git/src/opl.h" 23 | 24 | typedef struct _opl3_chip opl3_chip; 25 | 26 | class oplNuked: public Copl 27 | { 28 | public: 29 | oplNuked(int rate); 30 | virtual ~oplNuked(); 31 | 32 | void update(short *buf, int samples); 33 | void write(int reg, int val); 34 | void init(); 35 | 36 | private: 37 | opl3_chip *opl; 38 | int samplerate; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /playopl/oplWoody.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2005-'24 Stian Skjelstad 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #ifndef H_ADPLUG_OPLWOODYH 20 | #define H_ADPLUG_OPLWOODYH 21 | 22 | #include "adplug-git/src/opl.h" 23 | extern "C" { 24 | #include "adplug-git/src/woodyopl.h" 25 | } 26 | 27 | class oplWoody: public Copl 28 | { 29 | public: 30 | oplWoody(int rate); 31 | virtual ~oplWoody(); 32 | 33 | void update(short *buf, int samples); 34 | void write(int reg, int val); 35 | void init(); 36 | 37 | private: 38 | OPLChipClass opl; 39 | int samplerate; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /playym/ChangeLog: -------------------------------------------------------------------------------- 1 | - Use stdint.h on all non-windows platforms 2 | - Update Makefiles 3 | - Rename src/ui.c to src/ui.cpp (it uses c++ syntax) 4 | - Proper typecasting of parameters to printf 5 | - Avoid these: warning: operation on ‘pw’ may be undefined 6 | - Avoid signed vs unsignd compare 7 | - Constant strings should be respected 8 | - Variable declared twice made a volume-effect not work 9 | - Avoid multichar's 10 | - Avoid ambiguous else 11 | - Invalid loopframe could case invalid operations 12 | - Fail on bogus data 13 | - Added configure script 14 | - Added OSS support 15 | - update() call didn't wasn't 100% deterministic on register updates 16 | - Relayout the directory structure 17 | - Added man-pages 18 | 19 | v0.21a 20 | 15-March-2007 21 | 22 | - Fixed directory structure and install path for correct RPM packaging 23 | 24 | v0.21 25 | 06-March-2007 26 | 27 | - Added GNU/Linux 64bit compatibility (small changes in YmTypes.h, YmUserInterface.cpp files). Verified on RHEL v4 U4 x86_64 28 | - Removed not needed ;-) snd_pcm_hw_params_set_rate_resample function (added to alsa-lib since 1.0.9rc2) due to more portability (sound.cpp) 29 | - Added platform info in ym2wav & ymplayer 30 | 31 | v0.2 32 | 11-Jul-2006 33 | 34 | - Updated ST-Sound GPL library to version 1.2 35 | - Removed unneeded file player.cpp 36 | 37 | v0.1 38 | December 2005 39 | 40 | - Initial release 41 | 42 | -------------------------------------------------------------------------------- /m4/ax_require_defined.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_REQUIRE_DEFINED(MACRO) 8 | # 9 | # DESCRIPTION 10 | # 11 | # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have 12 | # been defined and thus are available for use. This avoids random issues 13 | # where a macro isn't expanded. Instead the configure script emits a 14 | # non-fatal: 15 | # 16 | # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found 17 | # 18 | # It's like AC_REQUIRE except it doesn't expand the required macro. 19 | # 20 | # Here's an example: 21 | # 22 | # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) 23 | # 24 | # LICENSE 25 | # 26 | # Copyright (c) 2014 Mike Frysinger 27 | # 28 | # Copying and distribution of this file, with or without modification, are 29 | # permitted in any medium without royalty provided the copyright notice 30 | # and this notice are preserved. This file is offered as-is, without any 31 | # warranty. 32 | 33 | #serial 2 34 | 35 | AC_DEFUN([AX_REQUIRE_DEFINED], [dnl 36 | m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) 37 | ])dnl AX_REQUIRE_DEFINED 38 | -------------------------------------------------------------------------------- /boot/compdate.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | /* OpenCP Module Player 3 | * copyright (c) 1994-'10 Niklas Beisert 4 | * copyright (c) 2004-'25 Stian Skjelstad 5 | * 6 | * strings specifiying the compilation date, time and author 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 | * 22 | * revision history: (please note changes here) 23 | * -nb980510 Niklas Beisert 24 | * -first release 25 | * -kb980717 Tammo Hinrichs 26 | * -added author string 27 | */ 28 | 29 | char compiledate[]=__DATE__; 30 | char compiletime[]=__TIME__; 31 | /*char compiledby[]=__AUTHOR__;*/ 32 | -------------------------------------------------------------------------------- /stuff/Makefile-static: -------------------------------------------------------------------------------- 1 | 2 | sets_so=sets.o 3 | poutput_so=console.o cp437.o latin1.o pfonts.o poutput.o 4 | poutput_so_libs=$(ICONV_LIBS) 5 | 6 | ifeq ($(LINUX),1) 7 | poutput_so+=poutput-vcsa.o poutput-fb.o 8 | endif 9 | 10 | ifeq ($(HAVE_CURSES),1) 11 | poutput_so+=poutput-curses.o 12 | poutput_so_libs+=$(NCURSES_LIBS) 13 | endif 14 | 15 | ifeq ($(HAVE_X11),1) 16 | poutput_so+=poutput-x11.o x11-common.o 17 | poutput_so_libs+=$(X11_LIBS) 18 | NEED_TTF=1 19 | endif 20 | 21 | ifeq ($(HAVE_SDL),1) 22 | poutput_so+=poutput-sdl.o 23 | poutput_so_libs+=$(SDL_LIBS) 24 | NEED_TTF=1 25 | endif 26 | 27 | ifeq ($(HAVE_SDL2),1) 28 | poutput_so+=poutput-sdl2.o 29 | poutput_so_libs+=$(SDL2_LIBS) 30 | NEED_TTF=1 31 | endif 32 | 33 | ifeq ($(NEED_TTF),1) 34 | poutput_so+=ttf.o poutput-swtext.o poutput-fontengine.o 35 | poutput_so_libs+=$(FREETYPE2_LIBS) 36 | endif 37 | 38 | # libocp_so is linked by parent 39 | stuff_libocp_so:=compat.o err.o framelock.o poll.o poutput-keyboard.o utf-8.o utf-16.o file.o 40 | 41 | ifeq ($(WINDOWS),1) 42 | stuff_libocp_so+=piperun-windows.o 43 | else 44 | stuff_libocp_so+=piperun-unix.o 45 | endif 46 | 47 | ifeq ($(STATIC_CORE),1) 48 | STATIC_OBJECTS += $(patsubst %.o,stuff/%.o,$(sets_so)) 49 | STATIC_OBJECTS += $(patsubst %.o,stuff/%.o,$(poutput_so)) 50 | STATIC_LIBS += $(poutput_so_libs) 51 | endif 52 | 53 | LIBOCP_OBJECTS += $(patsubst %.o,stuff/%.o,$(stuff_libocp_so)) 54 | -------------------------------------------------------------------------------- /dev/postproc.h: -------------------------------------------------------------------------------- 1 | #ifndef __POSTPROC_H 2 | #define __POSTPROC_H 1 3 | 4 | struct cpifaceSessionAPI_t; 5 | 6 | struct PostProcFPRegStruct 7 | { 8 | const char *name; 9 | void (*Process) (struct cpifaceSessionAPI_t *cpifaceSession, float *buffer, int len, int rate); 10 | void (*Init) (int rate); 11 | void (*Close) (void); 12 | const struct ocpvolregstruct *VolRegs; 13 | int (*ProcessKey) (uint16_t key); 14 | }; 15 | 16 | int mcpRegisterPostProcFP (const struct PostProcFPRegStruct *plugin); 17 | void mcpUnregisterPostProcFP (const struct PostProcFPRegStruct *plugin); 18 | const struct PostProcFPRegStruct *mcpFindPostProcFP (const char *name); 19 | void mcpListAllPostProcFP (const struct PostProcFPRegStruct ***postproc, int *count); 20 | 21 | struct PostProcIntegerRegStruct 22 | { 23 | const char *name; 24 | void (*Process) (struct cpifaceSessionAPI_t *cpifaceSession, int32_t *buffer, int len, int rate); 25 | void (*Init) (int rate); 26 | void (*Close) (void); 27 | const struct ocpvolregstruct *VolRegs; 28 | int (*ProcessKey) (uint16_t key); 29 | }; 30 | 31 | int mcpRegisterPostProcInteger (const struct PostProcIntegerRegStruct *plugin); 32 | void mcpUnregisterPostProcInteger (const struct PostProcIntegerRegStruct *plugin); 33 | const struct PostProcIntegerRegStruct *mcpFindPostProcInteger (const char *name); 34 | void mcpListAllPostProcInteger (const struct PostProcIntegerRegStruct ***postproc, int *count); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /playwav/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | all: playwav$(LIB_SUFFIX) 5 | 6 | clean: 7 | rm -f *.o *$(LIB_SUFFIX) 8 | 9 | install: 10 | $(CP) playwav$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/95-playwav$(LIB_SUFFIX)" 11 | 12 | uninstall: 13 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/95-playwav$(LIB_SUFFIX)" 14 | 15 | playwav_so=wavplay.o wavpplay.o wavtype.o 16 | playwav$(LIB_SUFFIX): $(playwav_so) 17 | $(CC) $(SHARED_FLAGS) -o $@ $^ 18 | 19 | wavplay.o: wavplay.c \ 20 | ../config.h \ 21 | ../types.h \ 22 | ../cpiface/cpiface.h \ 23 | ../dev/mcp.h \ 24 | ../dev/player.h \ 25 | ../dev/ringbuffer.h \ 26 | ../filesel/filesystem.h \ 27 | ../stuff/err.h \ 28 | ../stuff/imsrtns.h \ 29 | wave.h \ 30 | wavtype.h 31 | $(CC) wavplay.c -o $@ -c 32 | 33 | wavtype.o: wavtype.c \ 34 | ../config.h \ 35 | ../types.h \ 36 | ../boot/plinkman.h \ 37 | ../filesel/filesystem.h \ 38 | ../filesel/mdb.h \ 39 | ../filesel/pfilesel.h \ 40 | ../stuff/err.h \ 41 | wavtype.h 42 | $(CC) wavtype.c -o $@ -c 43 | 44 | wavpplay.o: wavpplay.c \ 45 | ../config.h \ 46 | ../types.h \ 47 | ../boot/plinkman.h \ 48 | ../boot/psetting.h \ 49 | ../cpiface/cpiface.h \ 50 | ../filesel/dirdb.h \ 51 | ../filesel/filesystem.h \ 52 | ../filesel/mdb.h \ 53 | ../filesel/pfilesel.h \ 54 | ../stuff/compat.h \ 55 | ../stuff/err.h \ 56 | ../stuff/poutput.h \ 57 | ../stuff/sets.h \ 58 | wave.h 59 | $(CC) wavpplay.c -o $@ -c 60 | -------------------------------------------------------------------------------- /help/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | include Makefile-static 4 | 5 | ifeq ($(STATIC_CORE),1) 6 | all: $(cphelper_so) $(cphlpif_so) 7 | else 8 | all: cphelper$(LIB_SUFFIX) cphlpif$(LIB_SUFFIX) 9 | endif 10 | 11 | clean: 12 | rm -f *$(LIB_SUFFIX) *.o 13 | 14 | ifeq ($(STATIC_CORE),1) 15 | install: 16 | uninstall: 17 | else 18 | install: 19 | $(CP) cphlpif$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/40-cphlpif$(LIB_SUFFIX)" 20 | $(CP) cphelper$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/20-cphelper$(LIB_SUFFIX)" 21 | 22 | uninstall: 23 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/40-cphlpif$(LIB_SUFFIX)" 24 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/20-cphelper$(LIB_SUFFIX)" 25 | endif 26 | 27 | cphelper.o: cphelper.c cphelper.h \ 28 | ../config.h \ 29 | ../boot/plinkman.h \ 30 | ../boot/psetting.h \ 31 | ../cpiface/cpiface.h \ 32 | ../filesel/dirdb.h \ 33 | ../filesel/filesystem.h \ 34 | ../stuff/err.h \ 35 | ../stuff/compat.h \ 36 | ../stuff/poutput.h \ 37 | ../types.h 38 | $(CC) cphelper.c -o $@ -c 39 | 40 | cphelper$(LIB_SUFFIX): $(cphelper_so) 41 | $(CC) $(SHARED_FLAGS) -o $@ $^ -lz 42 | 43 | cphlpif.o: cphlpif.c cphelper.h \ 44 | ../config.h \ 45 | ../types.h \ 46 | ../boot/plinkman.h \ 47 | ../stuff/poutput.h \ 48 | ../stuff/framelock.h \ 49 | ../cpiface/cpiface.h \ 50 | ../stuff/err.h 51 | $(CC) cphlpif.c -o $@ -c 52 | 53 | cphlpif$(LIB_SUFFIX): $(cphlpif_so) 54 | $(CC) $(SHARED_FLAGS) -o $@ $^ 55 | -------------------------------------------------------------------------------- /desktop/opencubicplayer.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Open Cubic Player 3 | GenericName=Music Player 4 | GenericName[fr]=Lecteur de musique 5 | Comment=Open Cubic Player @PACKAGE_VERSION@ for UNIX 6 | Comment[fr]=Open Cubic Player @PACKAGE_VERSION@ pour UNIX 7 | Keywords=music;audio;cubic;tracked;tracker;module;player;ocp; 8 | Exec=@BINDIR@/ocp %F 9 | Icon=opencubicplayer 10 | Terminal=false 11 | Type=Application 12 | Categories=AudioVideo;Audio;Player;Music; 13 | MimeType=audio/flac;audio/mp2;audio/mpeg;audio/ogg;audio/prs.sid;audio/x-a2m;audio/x-adl;audio/x-adlib-midi;audio/x-adtrack;audio/x-amd;audio/x-ams;audio/x-as3m;audio/x-ay;audio/x-bam;audio/x-bmf;audio/x-cff;audio/x-cmf;audio/x-coktel;audio/x-d00;audio/x-dfm;audio/x-dmf;audio/x-dmo;audio/x-dtm;audio/x-dro;audio/x-flac;audio/x-flac+ogg;audio/x-fmc;audio/x-gbs;audio/x-got;audio/x-gym;audio/x-herad;audio/x-hes;audio/x-hsc;audio/x-hsp;audio/x-imf;audio/x-it;audio/x-jbm;audio/x-ksm;audio/x-kss;audio/x-lds;audio/x-mad;audio/x-mkj;audio/x-msc;audio/x-mtk;audio/x-mtr;audio/x-mus;audio/x-nsf;audio/x-nsfe;audio/x-pis;audio/x-rac;audio/x-rad;audio/x-rix;audio/x-rol;audio/x-sa2;audio/x-sap;audio/x-sng;audio/x-sop;audio/x-u6m;audio/x-xad-bmf;audio/x-xad-flash;audio/x-xad-hybrid;audio/x-xad-hyp;audio/x-xad-psi;audio/x-xad-rat;audio/x-xsm;audio/x-spc;audio/x-stm;audio/x-mdl;audio/x-midi;audio/x-mod;audio/x-oggflac;audio/x-okt;audio/x-ptm;audio/x-s3m;audio/x-vgm;audio/x-vgz;audio/x-vorbis+ogg;audio/x-wav;audio/x-xm; 14 | -------------------------------------------------------------------------------- /playopl/oplKen.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2005-'24 Stian Skjelstad 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #ifndef H_ADPLUG_OPLKENH 20 | #define H_ADPLUG_OPLKENH 21 | 22 | #include "adplug-git/src/opl.h" 23 | extern "C" 24 | { 25 | #include "adplug-git/src/adlibemu.h" 26 | } 27 | 28 | class oplKen: public Copl 29 | { 30 | public: 31 | oplKen(int rate); 32 | virtual ~oplKen(); 33 | 34 | void update(short *buf, int samples); 35 | void write(int reg, int val); 36 | void init(); 37 | 38 | private: 39 | adlibemu_context ctx[2]; 40 | int samplerate; 41 | short *mixbuf0, 42 | *mixbuf1; 43 | int mixbufSamples; 44 | 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /devw/dwmixa.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * assembler routines for 8-bit MCP mixer 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | * 20 | * revision history: (please note changes here) 21 | * -nb980510 Niklas Beisert 22 | * -first release 23 | * -ss04???? Stian Skjelstad 24 | * -ported to gcc 25 | * -ss040908 Stian Skjelstad 26 | * -made it optimizesafe 27 | */ 28 | 29 | #include "config.h" 30 | #include "types.h" 31 | #include "dwmix.h" 32 | #include "dwmixa.h" 33 | 34 | #include "dev/mix.h" 35 | 36 | #include "dwmixa_c.c" 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *~ 3 | *.o 4 | *.so 5 | *.dll 6 | *.dylib 7 | *.a 8 | *.exe 9 | x86_64-w64-mingw32-install/ 10 | x86_64-w64-mingw32-prefix/ 11 | x86_64-w64-mingw32-src/ 12 | i686-w64-mingw32-install/ 13 | i686-w64-mingw32-prefix/ 14 | i686-w64-mingw32-src/ 15 | asm_emu/test-x86 16 | autom4te.cache/ 17 | config.h 18 | config.log 19 | config.status 20 | desktop/opencubicplayer.desktop 21 | dev/mchasm_test 22 | dev/ringbuffer-unit-test 23 | dev/smpman_asminctest 24 | devw/test-dwmixa 25 | devw/test-dwmixfa 26 | devw/test-dwmixqa 27 | doc/ocp.1 28 | doc/opencp.dox 29 | doc/texi/faq.texi 30 | doc/texi/install.texi 31 | doc/texi/ocp.texi 32 | doc/texi/ocp.info.gz 33 | doc/texi/ocp_html 34 | doc/texi/ocp.html 35 | filesel/adbmeta-test 36 | filesel/dirdb-test 37 | filesel/filesystem-bzip2-test 38 | filesel/filesystem-filehandle-cache-test 39 | filesel/filesystem-gzip-test 40 | filesel/filesystem-tar-test 41 | filesel/filesystem-textfile-test 42 | filesel/mdb-test 43 | goodies/helpc/ocphhc 44 | goodies/helpc/Makefile 45 | goodies/pack/Makefile 46 | goodies/pack/pack 47 | haiku/ocp.rdef 48 | haiku/ocp.rsrc 49 | /Makefile 50 | ocp 51 | ocp.hlp 52 | ocp.ini 53 | playgmi/calcnewt 54 | Rules.make 55 | mingw/ocp.rc 56 | mingw/ocp.res 57 | playay/dumpay 58 | playgmd/dumps3m 59 | playgmd/dumpstm 60 | playgmi/dumpmidi 61 | playhvl/dumpahx 62 | playmp2/dumpid3 63 | playsid/dumpsid 64 | playtimidity/calcnewt 65 | playtimidity/dumpmidi 66 | playxm/dumpmod 67 | stuff/compat-test 68 | stuff/pfonts-update 69 | -------------------------------------------------------------------------------- /playay/sound.h: -------------------------------------------------------------------------------- 1 | /* aylet 0.2, a .AY music file player. 2 | * Copyright (C) 2001 Russell Marks and Ian Collier. See main.c for licence. 3 | * 4 | * sound.h 5 | */ 6 | 7 | #define sound_freq playay_sound_freq 8 | 9 | struct ay_driver_frame_state_t 10 | { 11 | uint32_t clockrate; 12 | 13 | uint16_t channel_a_period; /* 0x0001 -> 0x0fff */ 14 | uint16_t channel_b_period; /* 0x0001 -> 0x0fff */ 15 | uint16_t channel_c_period; /* 0x0001 -> 0x0fff */ 16 | 17 | uint8_t noise_period; /* 0x01 -> 0x1f */ 18 | uint8_t mixer; /* __RRRTTT R=!random enable, T=!note enable.. R is mixed into T */ 19 | 20 | uint8_t amplitude_a; /* ___Evvvv E = use envelope, else vvvv=fixed value */ 21 | uint8_t amplitude_b; /* ___Evvvv E = use envelope, else vvvv=fixed value */ 22 | uint8_t amplitude_c; /* ___Evvvv E = use envelope, else vvvv=fixed value */ 23 | 24 | uint16_t envelope_period; 25 | uint8_t envelope_shape; /* ___ssss */ 26 | }; 27 | 28 | OCP_INTERNAL int sound_init (void); 29 | OCP_INTERNAL void sound_end (void); 30 | OCP_INTERNAL int sound_frame (struct ay_driver_frame_state_t *states); 31 | OCP_INTERNAL void sound_frame_blank (void); 32 | OCP_INTERNAL void sound_start_fade (int fadetime_in_sec); 33 | OCP_INTERNAL void sound_ay_write (int reg, int val, unsigned long tstates); 34 | OCP_INTERNAL void sound_ay_reset (void); 35 | OCP_INTERNAL void sound_ay_reset_cpc (void); 36 | OCP_INTERNAL void sound_beeper (int on, unsigned long tstates); 37 | extern OCP_INTERNAL unsigned int sound_freq; 38 | -------------------------------------------------------------------------------- /playcda/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | all: playcda$(LIB_SUFFIX) 5 | 6 | playcda_so=cdaplay.o cdapplay.o cdatype.o 7 | playcda$(LIB_SUFFIX): $(playcda_so) 8 | $(CC) $(SHARED_FLAGS) -o $@ $^ 9 | 10 | clean: 11 | rm -f *.o *$(LIB_SUFFIX) 12 | 13 | install: 14 | $(CP) playcda$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/95-playcda$(LIB_SUFFIX)" 15 | 16 | uninstall: 17 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/95-playcda$(LIB_SUFFIX)" 18 | 19 | cdatype.o: cdatype.c cdatype.h \ 20 | ../config.h \ 21 | ../types.h \ 22 | ../boot/plinkman.h \ 23 | ../filesel/mdb.h \ 24 | ../filesel/pfilesel.h \ 25 | ../stuff/err.h \ 26 | cdatype.h 27 | $(CC) cdatype.c -o $@ -c 28 | 29 | cdaplay.o: cdaplay.c cdaudio.h \ 30 | ../config.h \ 31 | ../types.h \ 32 | ../boot/plinkman.h \ 33 | cdaudio.h \ 34 | ../cpiface/cpiface.h \ 35 | ../dev/mcp.h \ 36 | ../dev/player.h \ 37 | ../dev/ringbuffer.h \ 38 | ../filesel/cdrom.h \ 39 | ../filesel/filesystem.h \ 40 | ../stuff/err.h \ 41 | ../stuff/imsrtns.h 42 | $(CC) cdaplay.c -o $@ -c 43 | 44 | cdapplay.o: cdapplay.c cdaudio.h \ 45 | ../config.h \ 46 | ../types.h \ 47 | ../boot/psetting.h \ 48 | ../cpiface/cpiface.h \ 49 | ../dev/player.h \ 50 | ../filesel/cdrom.h \ 51 | ../filesel/dirdb.h \ 52 | ../filesel/filesystem.h \ 53 | ../filesel/mdb.h \ 54 | ../filesel/pfilesel.h \ 55 | ../stuff/compat.h \ 56 | ../stuff/err.h \ 57 | ../stuff/poutput.h \ 58 | ../stuff/sets.h 59 | $(CC) cdapplay.c -o $@ -c 60 | -------------------------------------------------------------------------------- /stuff/pfonts.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * VGA fonts for graphic mode screen output 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -nb980510 Niklas Beisert 23 | * -first release 24 | * -ss040613 Stian Skjelstad 25 | * -patched in the analyser characters, so wo don't need to track fonts all 26 | * the time. 27 | */ 28 | 29 | #include "config.h" 30 | #include "types.h" 31 | #include "pfonts.h" 32 | 33 | #include "font8x8.inc.c" 34 | #include "font8x16.inc.c" 35 | #include "font16x32.inc.c" 36 | -------------------------------------------------------------------------------- /m4/ax_cxx_compile_stdcxx_14.m4: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html 3 | # ============================================================================= 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check for baseline language coverage in the compiler for the C++14 12 | # standard; if necessary, add switches to CXX and CXXCPP to enable 13 | # support. 14 | # 15 | # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX 16 | # macro with the version set to C++14. The two optional arguments are 17 | # forwarded literally as the second and third argument respectively. 18 | # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for 19 | # more information. If you want to use this macro, you also need to 20 | # download the ax_cxx_compile_stdcxx.m4 file. 21 | # 22 | # LICENSE 23 | # 24 | # Copyright (c) 2015 Moritz Klammler 25 | # 26 | # Copying and distribution of this file, with or without modification, are 27 | # permitted in any medium without royalty provided the copyright notice 28 | # and this notice are preserved. This file is offered as-is, without any 29 | # warranty. 30 | 31 | #serial 5 32 | 33 | AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) 34 | AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])]) 35 | -------------------------------------------------------------------------------- /filesel/modland.com/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../../ 2 | include $(TOPDIR)Rules.make 3 | include Makefile-static 4 | 5 | ifeq ($(STATIC_CORE),1) 6 | all: $(modland_com_so) 7 | else 8 | all: modland_com$(LIB_SUFFIX) 9 | endif 10 | 11 | clean: 12 | rm -f modland_com$(LIB_SUFFIX) *.o 13 | 14 | ifeq ($(STATIC_CORE),1) 15 | install: 16 | uninstall: 17 | else 18 | install: 19 | $(CP) modland_com$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/60-modland_com$(LIB_SUFFIX)" 20 | uninstall: 21 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/60-modland_com$(LIB_SUFFIX)" 22 | endif 23 | 24 | .PHONY: all clean install uninstall 25 | 26 | modland_com$(LIB_SUFFIX): $(modland_com_so) 27 | $(CC) $(SHARED_FLAGS) -o $@ $^ 28 | 29 | modland-com.o: \ 30 | modland-com.c \ 31 | modland-com-cachedir.c \ 32 | modland-com-dir.c \ 33 | modland-com-file.c \ 34 | modland-com-filedb.c \ 35 | modland-com-filehandle.c \ 36 | modland-com-initialize.c \ 37 | modland-com-mirrors.c \ 38 | modland-com-removecache.c \ 39 | modland-com-setup.c \ 40 | ../download.h \ 41 | ../../config.h \ 42 | ../../types.h \ 43 | ../../boot/plinkman.h \ 44 | ../../boot/psetting.h \ 45 | ../../filesel/dirdb.h \ 46 | ../../filesel/filesystem.h \ 47 | ../../filesel/filesystem-dir-mem.h \ 48 | ../../filesel/filesystem-drive.h \ 49 | ../../filesel/filesystem-file-dev.h \ 50 | ../../filesel/filesystem-textfile.h \ 51 | ../../stuff/err.h \ 52 | ../../stuff/file.h \ 53 | ../../stuff/framelock.h \ 54 | ../../stuff/poutput.h \ 55 | ../../stuff/utf-16.h 56 | $(CC) $< -o $@ -c 57 | -------------------------------------------------------------------------------- /dev/mix.h: -------------------------------------------------------------------------------- 1 | #ifndef __MIX_H 2 | #define __MIX_H 3 | 4 | struct mixchannel 5 | { 6 | union 7 | { 8 | int8_t *fmt8; 9 | int16_t *fmt16; 10 | float *fmtfloat; 11 | void *fmt; 12 | } realsamp; 13 | uint32_t length; 14 | uint32_t loopstart; 15 | uint32_t loopend; 16 | uint32_t replen; 17 | int32_t step; 18 | uint32_t pos; 19 | uint16_t fpos; 20 | uint16_t status; 21 | union 22 | { 23 | int16_t vols[2]; 24 | float volfs[2]; 25 | } vol; 26 | uint32_t *voltabs[2]; /* internal use by dev/mix.c and dev/mixasm.c */ 27 | }; 28 | 29 | struct cpifaceSessionAPI_t; /* cpiface.h */ 30 | struct PostProcFPRegStruct; 31 | struct PostProcIntegerRegStruct; 32 | 33 | struct mixAPI_t 34 | { 35 | int (*mixInit) (struct cpifaceSessionAPI_t *cpifaceSession, void (*getchan)(unsigned int ch, struct mixchannel *chn, uint32_t rate), int resamp, unsigned int chan, int amp); 36 | void (*mixClose) (struct cpifaceSessionAPI_t *cpifaceSession); 37 | void (*mixSetAmplify)(struct cpifaceSessionAPI_t *cpifaceSession, int amp); 38 | const struct PostProcFPRegStruct *(*mcpFindPostProcFP) (const char *name); 39 | const struct PostProcIntegerRegStruct *(*mcpFindPostProcInteger) (const char *name); 40 | }; 41 | extern const struct mixAPI_t *mixAPI; 42 | 43 | #define MIX_PLAYING 1 44 | #define MIX_MUTE 2 45 | #define MIX_LOOPED 4 46 | #define MIX_PINGPONGLOOP 8 47 | #define MIX_PLAY16BIT 16 48 | #define MIX_INTERPOLATE 32 49 | #define MIX_MAX 64 50 | #define MIX_PLAYFLOAT 128 51 | #define MIX_PLAYSTEREO 256 52 | #define MIX_ALL 511 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /devw/dwmixqa.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * assembler routines for Quality Mixer 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -nb980510 Niklas Beisert 23 | * -first release 24 | * -kb980717 Tammo Hinrichs 25 | * -some pentium optimization on inner loops 26 | * -kbwhenever Tammo Hinrichs 27 | * -used CS addressing here and there for more optimal cache usage 28 | * -ss04???? 29 | */ 30 | 31 | #include "config.h" 32 | #include 33 | #include "types.h" 34 | #include "dwmix.h" 35 | #include "dwmixqa.h" 36 | 37 | #include "dwmixqa_c.c" 38 | -------------------------------------------------------------------------------- /doc/texi/support.texi: -------------------------------------------------------------------------------- 1 | @node support 2 | @chapter Support 3 | The official internet homepage of OCP can be found under: 4 | @url{http://www.cubic.org/player} 5 | 6 | Please send any suggestions and bug reports via electronic mail to Tammo 7 | Hinrichs @url{opencp@@gmx.net} and comments about this documentation to Dirk Jagdmann 8 | @url{doj@@cubic.org}. 9 | 10 | If you encountered a bug in OCP please send 11 | a detailed bug report to Tammo Hinrichs. Many people complain about music 12 | files not being played properly (especially with module formats). Please keep 13 | in mind that the original tracking/sequencing program is @emph{always} the 14 | reference for correct playback. If a music file sound different compared to 15 | another player, please keep in mind that perhaps the other program does not 16 | play it correct. This is especially true for Amiga 4channel modules. As those 17 | files can be produced using various trackers (Noise-, Sound-, Protracker and 18 | many, many more) and sadly all of those trackers play slightly different, a 19 | general player like OCP can not play @emph{all} modules correctly. We try to 20 | emulate the behaviour of ProTracker 1.1b, so that most modules are 21 | played correctly. However certain features of one tracker permit another 22 | feature of a different player. 23 | 24 | @section The Team 25 | Currently the core team of OCP devolopers consists of 5 people: 26 | 27 | Tammo Hinrichs - main coder & ruler 28 | Felix Domke - coder 29 | Fabian Giesen - coder 30 | Dirk Jagdmann - generic support, this and that 31 | Stian Skjelstad - unix port 32 | -------------------------------------------------------------------------------- /m4/ax_cxx_compile_stdcxx_17.m4: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html 3 | # ============================================================================= 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check for baseline language coverage in the compiler for the C++17 12 | # standard; if necessary, add switches to CXX and CXXCPP to enable 13 | # support. 14 | # 15 | # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX 16 | # macro with the version set to C++17. The two optional arguments are 17 | # forwarded literally as the second and third argument respectively. 18 | # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for 19 | # more information. If you want to use this macro, you also need to 20 | # download the ax_cxx_compile_stdcxx.m4 file. 21 | # 22 | # LICENSE 23 | # 24 | # Copyright (c) 2015 Moritz Klammler 25 | # Copyright (c) 2016 Krzesimir Nowak 26 | # 27 | # Copying and distribution of this file, with or without modification, are 28 | # permitted in any medium without royalty provided the copyright notice 29 | # and this notice are preserved. This file is offered as-is, without any 30 | # warranty. 31 | 32 | #serial 2 33 | 34 | AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) 35 | AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])]) 36 | -------------------------------------------------------------------------------- /playtimidity/timidityplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMIDITYPLAY_H 2 | #define _TIMIDITYPLAY_H 3 | 4 | struct ocpfilehandle_t; 5 | struct notedotsdata; 6 | 7 | struct mglobinfo 8 | { 9 | uint32_t curtick; 10 | uint32_t ticknum; 11 | }; 12 | 13 | struct mchaninfo 14 | { 15 | char instrument[32]; 16 | uint8_t program; 17 | uint8_t bank_msb; 18 | uint8_t bank_lsb; 19 | 20 | uint8_t pan; 21 | uint8_t gvol; 22 | int16_t pitch; 23 | uint8_t reverb; 24 | uint8_t chorus; 25 | uint8_t notenum; 26 | uint8_t pedal; 27 | uint8_t note[32]; 28 | uint8_t vol[32]; 29 | uint8_t opt[32]; 30 | }; 31 | 32 | struct cpifaceSessionAPI_t; 33 | OCP_INTERNAL int timidityOpenPlayer (const char *path, uint8_t *buffer, size_t bufferlen, struct ocpfilehandle_t *file, struct cpifaceSessionAPI_t *cpifaceSession); 34 | OCP_INTERNAL void timidityClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 35 | OCP_INTERNAL void timidityIdle (struct cpifaceSessionAPI_t *cpifaceSession); 36 | OCP_INTERNAL void timiditySetLoop (uint8_t s); 37 | OCP_INTERNAL int timidityIsLooped (void); 38 | OCP_INTERNAL void timiditySetRelPos (int pos); 39 | OCP_INTERNAL void timidityRestart (void); 40 | OCP_INTERNAL void timidityGetGlobInfo (struct mglobinfo *); 41 | 42 | OCP_INTERNAL void timidityGetChanInfo (uint8_t ch, struct mchaninfo *ci); 43 | 44 | OCP_INTERNAL void timidityChanSetup (struct cpifaceSessionAPI_t *cpifaceSession); 45 | OCP_INTERNAL int timidityGetDots (struct cpifaceSessionAPI_t *cpifaceSession, struct notedotsdata *d, int max); 46 | OCP_INTERNAL void timidityMute (struct cpifaceSessionAPI_t *cpifaceSession, int ch, int m); 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /doc/ocp.1.in: -------------------------------------------------------------------------------- 1 | .TH OCP 1 "January 9, 2022" 2 | .SH NAME 3 | ocp \- music player 4 | .SH SYNOPSIS 5 | .B ocp 6 | .RI "[ options ] [ playlist ] [ modulename ]" 7 | .SH DESCRIPTION 8 | This manual page documents briefly the 9 | .B ocp 10 | command. 11 | .PP 12 | \fBocp\fP is a music player which can play music modules (ahx, mdl, it, s3m, 13 | xm, mod), wave, audio CD, sid, midi, mp3, adlib, flac, ym, and ogg vorbis. 14 | .PP 15 | The player has a built\-in file selector which can be configured using alt\-c. 16 | .PP 17 | At any time, press F1 to open the internal help-browser or ALT+k to see a list 18 | of the possible short-keys at your current view. 19 | .PP 20 | If ran with SDL output mode, some extra graphical effects are available. 21 | .SH OPTIONS 22 | .TP 23 | .IP \-h 24 | Show summary of options. 25 | .IP \-c 26 | Use specific configuration. 27 | .IP \-f 28 | Fileselector settings 29 | .IP \-v 30 | Sound settings 31 | .IP \-s 32 | Device settings 33 | .IP \-p 34 | Quit when playlist is empty. 35 | .SH EXAMPLE 36 | .PP 37 | \fBocp \-fl0,r1 \-vf2 \-spdevpdisk \-sr48000 fegolhuz.xm\fR 38 | .PP 39 | Renders the module to HD. 40 | .SH SEE ALSO 41 | .BR oggenc (1), 42 | .BR flac (1), 43 | .BR lame (1). 44 | 45 | info ocp 46 | .PP 47 | @DOCDIR@ 48 | .PP 49 | You can find a more detailed document about the original DOS version here at 50 | http://www.cubic.org/player/opencp.pdf . 51 | .SH AUTHOR 52 | Open Cubic Player was written by Niklas Beisert and ported to Linux 53 | by Stian Sebastian Skjelstad. 54 | .PP 55 | This manual page was written by G\[:u]rkan Myczko , 56 | for the Debian project (but may be used by others). 57 | -------------------------------------------------------------------------------- /playhvl/hvlpdots.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2019-'25 Stian Skjelstad 3 | * 4 | * HVLPlay note dots routines 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "config.h" 22 | #include "types.h" 23 | #include "cpiface/cpiface.h" 24 | #include "hvlplay.h" 25 | #include "hvlpdots.h" 26 | #include "player.h" 27 | 28 | OCP_INTERNAL int hvlGetDots (struct cpifaceSessionAPI_t *cpifaceSession, struct notedotsdata *d, int max) 29 | { 30 | int pos=0; 31 | int i; 32 | for (i=0; iht_Channels; i++) 33 | { 34 | struct hvl_chaninfo ci; 35 | 36 | hvlGetChanInfo (i, &ci); 37 | 38 | if (!ci.vol) 39 | continue; 40 | 41 | if (pos>=max) 42 | break; 43 | 44 | d[pos].voll=(ci.vol * 255-ci.pan) / 256; 45 | d[pos].volr=(ci.vol * ci.pan) / 256; 46 | d[pos].chan=i; 47 | d[pos].note=0x00800000 / ci.noteperiod; 48 | d[pos].col=32+(ci.ins&15);/* sustain */ 49 | pos++; 50 | } 51 | return pos; 52 | } 53 | -------------------------------------------------------------------------------- /dev/smpman_asminctest.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2004-'25 Stian Skjelstad 3 | * 4 | * Unit-test for "smpman_asminc.c" 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "config.h" 22 | 23 | #include 24 | 25 | static unsigned short abstab[0x200]; 26 | 27 | #include "smpman_asminc.c" 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | char *test="1982---suuuuuuuper test just for all the c00l guys out here"; 32 | int i; 33 | for (i=-0x100; i<0x100; i++) 34 | abstab[i+0x100]=i*i/16; 35 | 36 | fprintf(stderr, "getpitch(): "); 37 | if ((i=getpitch(test, 50))!=6347) 38 | { 39 | fprintf(stderr, "Failed (%d vs %d)\n", i, 8263); 40 | return -1; 41 | } 42 | fprintf(stderr, "ok\n"); 43 | 44 | fprintf(stderr, "getpitch16(): "); 45 | if ((i=getpitch16(test, 25))!=1886) 46 | { 47 | fprintf(stderr, "Failed (%d bs %d)\n", i, 1886); 48 | return -1; 49 | } 50 | fprintf(stderr, "ok\n"); 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /stuff/pagesize.inc.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * pagesize() call used from several plugins. Different unix variants provides 6 | * pagesize info in different ways.. sysconf, header-file, not mentioned 7 | * (4096 default fallback). 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | */ 23 | 24 | #include 25 | #include 26 | #ifndef PAGESIZE 27 | #define PAGESIZE 4096 28 | #endif 29 | 30 | static long pagesize(void) __attribute__((const)); 31 | static long pagesize(void) 32 | { 33 | static long retval=0; 34 | 35 | if (retval) 36 | return retval; 37 | #ifdef HAVE_SYSCONF 38 | #ifdef _SC_PAGESIZE 39 | retval = sysconf(_SC_PAGESIZE); 40 | if (retval>0) 41 | return retval; 42 | if (retval<0) 43 | perror("[compat] sysconf(_SC_PAGESIZE)"); 44 | #endif 45 | #endif 46 | retval = PAGESIZE; 47 | return retval; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /filesel/Makefile-static: -------------------------------------------------------------------------------- 1 | ifeq ($(CDROM_SUPPORT),1) 2 | CDROM_SO=cdrom$(LIB_SUFFIX) 3 | cdrom_so=cdrom.o 4 | endif 5 | 6 | pfilesel_so=\ 7 | adbmeta.o \ 8 | charsets.o \ 9 | cphlpfs.o \ 10 | dirdb.o \ 11 | download.o \ 12 | filesystem.o \ 13 | filesystem-ancient.o \ 14 | filesystem-bzip2.o \ 15 | filesystem-dir-mem.o \ 16 | filesystem-drive.o \ 17 | filesystem-file-dev.o \ 18 | filesystem-file-mem.o \ 19 | filesystem-filehandle-cache.o \ 20 | filesystem-gzip.o \ 21 | filesystem-pak.o \ 22 | filesystem-playlist.o \ 23 | filesystem-playlist-m3u.o \ 24 | filesystem-playlist-pls.o \ 25 | filesystem-setup.o \ 26 | filesystem-rpg.o \ 27 | filesystem-tar.o \ 28 | filesystem-textfile.o \ 29 | filesystem-z.o \ 30 | filesystem-zip.o \ 31 | fsptype.o \ 32 | mdb.o \ 33 | modlist.o \ 34 | musicbrainz.o \ 35 | pfilesel.o \ 36 | pfsmain.o 37 | 38 | ifeq ($(WINDOWS),1) 39 | pfilesel_so += filesystem-windows.o 40 | else 41 | pfilesel_so += filesystem-unix.o 42 | endif 43 | 44 | ifeq ($(STATIC_CORE),1) 45 | STATIC_OBJECTS += $(patsubst %.o,filesel/%.o,$(cdrom_so)) 46 | STATIC_OBJECTS += $(patsubst %.o,filesel/%.o,$(pfilesel_so)) 47 | STATIC_LIBS += -lz -lbz2 $(MATH_LIBS) $(PTHREAD_LIBS) $(LIBDISCID_LIBS) $(ICONV_LIBS) $(LIBCJSON_LIBS) $(LIBANCIENT_LIBS) 48 | ifeq ($(WINDOWS),1) 49 | STATIC_LIBS += -lshlwapi # due to PathMatchSpec() 50 | endif 51 | endif 52 | -------------------------------------------------------------------------------- /playopl/oplRetroWave.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2005-'24 Stian Skjelstad 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #ifndef H_ADPLUG_RETROWAVE_H 20 | #define H_ADPLUG_RETROWAVE_H 21 | 22 | #include "adplug-git/src/opl.h" 23 | 24 | struct cpifaceSessionAPI_t; 25 | 26 | class oplRetroWave: public Copl 27 | { 28 | public: 29 | oplRetroWave ( /* cpiDebug is splitted out, since we need to create this from oplconfig.c for testing */ 30 | void(*cpiDebug)(struct cpifaceSessionAPI_t *cpifaceSession, const char *fmt, ...), 31 | struct cpifaceSessionAPI_t *cpifaceSession, 32 | const char *device, 33 | int rate); 34 | virtual ~oplRetroWave(); 35 | int FailedToOpen; 36 | 37 | uint32_t ratescale = 0x00010000; 38 | void update(short *buf, int samples); 39 | void write(int reg, int val); 40 | void init(); 41 | 42 | private: 43 | int rate; 44 | unsigned int samples_rounded = 0; // update() brings the rounding error into the next call 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /filesel/download.h: -------------------------------------------------------------------------------- 1 | #ifndef OCP_DOWNLOAD_H 2 | #define OCP_DOWNLOAD_H 1 3 | 4 | struct configAPI_t; 5 | struct ocpfile_t; 6 | 7 | struct download_request_t 8 | { 9 | void *tag; 10 | 11 | const struct configAPI_t *configAPI; 12 | 13 | void *pipehandle; 14 | char stdoutbin[32]; 15 | char stderrbin[32]; 16 | 17 | int httpcode; /* we only accept 200 */ 18 | int errcode; /* exit-code from curl, if any */ 19 | const char *errmsg; 20 | 21 | char *tempheader_filepath; 22 | char *tempdata_filepath; 23 | char *tempheader_filename; 24 | char *tempdata_filename; 25 | 26 | /* result */ 27 | unsigned long ContentLength; // updated with filesize as curl downloads 28 | unsigned int Year; 29 | unsigned char Month; 30 | unsigned char Day; 31 | unsigned char Hour; 32 | unsigned char Minute; 33 | unsigned char Second; 34 | 35 | /* In windows, files can not be deleted while open, and debugging is easier if files are deleted first when closed */ 36 | int free; /* free requested from topside */ 37 | int wrapfilehandles; /* inhibits free from finialize */ 38 | }; 39 | 40 | struct download_request_t *download_request_spawn (const struct configAPI_t *configAPI, void *tag, const char *URL); /* "https://modland.com/allmods.zip" */ 41 | 42 | char *urlencode(const char *src); 43 | 44 | int download_request_iterate (struct download_request_t *req); /* repeat calling this until it returns zero */ 45 | 46 | void download_request_cancel (struct download_request_t *req); 47 | 48 | struct ocpfilehandle_t *download_request_getfilehandle (struct download_request_t *req); /* use with req->tempdata_filename */ 49 | 50 | void download_request_free (struct download_request_t *req); /* on Windows, do not call until all files are closed */ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /playgme/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | TARGETS=playgme$(LIB_SUFFIX) $(DUMPAY) 5 | 6 | all: $(TARGETS) 7 | 8 | clean: 9 | rm -f *.o *$(LIB_SUFFIX) 10 | 11 | install: 12 | $(CP) playgme$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/95-playgme$(LIB_SUFFIX)" 13 | 14 | uninstall: 15 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/95-playgme$(LIB_SUFFIX)" 16 | 17 | cpiinfo.o: cpiinfo.c \ 18 | ../config.h \ 19 | ../types.h \ 20 | ../cpiface/cpiface.h \ 21 | ../playgme/gmeplay.h \ 22 | ../stuff/poutput.h 23 | $(CC) $(LIBGME_CFLAGS) $< -o $@ -c 24 | 25 | gmeplay.o: gmeplay.c \ 26 | ../config.h \ 27 | ../types.h \ 28 | ../cpiface/cpiface.h \ 29 | ../dev/mcp.h \ 30 | ../dev/player.h \ 31 | ../dev/ringbuffer.h \ 32 | ../filesel/filesystem.h \ 33 | ../playgme/gmeplay.h \ 34 | ../stuff/err.h \ 35 | ../stuff/imsrtns.h 36 | $(CC) $(LIBGME_CFLAGS) $< -o $@ -c 37 | 38 | gmepplay.o: gmepplay.c \ 39 | ../config.h \ 40 | ../types.h \ 41 | ../boot/plinkman.h \ 42 | ../cpiface/cpiface.h \ 43 | ../dev/player.h \ 44 | ../filesel/dirdb.h \ 45 | ../filesel/filesystem.h \ 46 | ../filesel/mdb.h \ 47 | ../filesel/pfilesel.h \ 48 | ../playgme/gmeplay.h \ 49 | ../playgme/gmetype.h \ 50 | ../stuff/compat.h \ 51 | ../stuff/err.h \ 52 | ../stuff/poutput.h \ 53 | ../stuff/sets.h 54 | $(CC) $< -o $@ -c 55 | 56 | gmetype.o: gmetype.c \ 57 | ../config.h \ 58 | ../types.h \ 59 | ../boot/plinkman.h \ 60 | ../filesel/mdb.h \ 61 | ../filesel/pfilesel.h \ 62 | ../playgme/gmetype.h \ 63 | ../stuff/compat.h \ 64 | ../stuff/cp437.h \ 65 | ../stuff/err.h 66 | $(CC) $< -o $@ -c 67 | 68 | playgme_so=cpiinfo.o gmetype.o gmeplay.o gmepplay.o 69 | playgme$(LIB_SUFFIX): $(playgme_so) 70 | $(CC) $(SHARED_FLAGS) -o $@ $^ $(LIBGME_LIBS) -lz 71 | -------------------------------------------------------------------------------- /playopl/oplWoody.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Adplug - Replayer for many OPL2/OPL3 audio file formats. 3 | * Copyright (C) 1999 - 2006 Simon Peter, , et al. 4 | * 5 | * This file is based on Adplug Project: 6 | * wemuopl.h - Emulated OPL using the DOSBox OPL3 emulator 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #include "ocpemu.h" 24 | #include "oplWoody.h" 25 | 26 | extern "C" { 27 | #include "adplug-git/src/woodyopl.h" 28 | } 29 | 30 | oplWoody::oplWoody(int rate) : samplerate(rate) 31 | { 32 | opl.adlib_init (rate, /* stereo */ 2, /* 16bit */ 2); 33 | currType = TYPE_OPL3; 34 | } 35 | 36 | oplWoody::~oplWoody() 37 | { 38 | } 39 | 40 | void oplWoody::update(short *buf, int samples) 41 | { 42 | opl.adlib_getsample (buf, samples); 43 | } 44 | 45 | void oplWoody::write(int reg, int val) 46 | { 47 | opl.adlib_write ((currChip << 8) | reg, val); 48 | } 49 | 50 | void oplWoody::init() 51 | { 52 | opl.adlib_init (samplerate, /* stereo */ 2, /* 16bit */ 2); 53 | currChip = 0; 54 | } 55 | -------------------------------------------------------------------------------- /playopl/oplNuked.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Adplug - Replayer for many OPL2/OPL3 audio file formats. 3 | * Copyright (C) 1999 - 2006 Simon Peter, , et al. 4 | * 5 | * This file is based on Adplug Project: 6 | * nemuopl.cpp - Emulated OPL using the Nuked OPL3 emulator 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #include "ocpemu.h" 24 | #include "oplNuked.h" 25 | 26 | extern "C" { 27 | #include "adplug-git/src/nukedopl.h" 28 | } 29 | 30 | 31 | oplNuked::oplNuked(int rate) 32 | { 33 | opl = new opl3_chip(); 34 | OPL3_Reset(opl, rate); 35 | currType = TYPE_OPL3; 36 | samplerate = rate; 37 | } 38 | 39 | oplNuked::~oplNuked() 40 | { 41 | delete opl; 42 | } 43 | 44 | void oplNuked::update(short *buf, int samples) 45 | { 46 | OPL3_GenerateStream(opl, buf, samples); 47 | } 48 | 49 | void oplNuked::write(int reg, int val) 50 | { 51 | OPL3_WriteRegBuffered(opl, (currChip << 8) | reg, val); 52 | } 53 | 54 | void oplNuked::init() 55 | { 56 | OPL3_Reset(opl, samplerate); 57 | currChip = 0; 58 | } 59 | -------------------------------------------------------------------------------- /playay/main.h: -------------------------------------------------------------------------------- 1 | /* aylet 0.1, a .AY music file player. 2 | * Copyright (C) 2001 Russell Marks and Ian Collier. See main.c for licence. 3 | * 4 | * main.h 5 | */ 6 | 7 | #if 0 8 | enum cb_action_tag 9 | { 10 | cb_none, 11 | cb_quit, 12 | cb_highspeed, 13 | cb_prev_file, 14 | cb_next_file, 15 | cb_prev_track, 16 | cb_next_track, 17 | cb_play, 18 | cb_pause, 19 | cb_stop, 20 | cb_restart, 21 | cb_dec_stopafter, 22 | cb_inc_stopafter, 23 | cb_dec_fadetime, 24 | cb_inc_fadetime, 25 | cb_dec_vol, 26 | cb_inc_vol 27 | }; 28 | 29 | 30 | extern int action_callback(enum cb_action_tag action); 31 | #endif 32 | 33 | struct plrDevAPI_t; 34 | OCP_INTERNAL int ay_do_interrupt (const struct plrDevAPI_t *plrDevAPI); 35 | OCP_INTERNAL unsigned int ay_in(int h,int l); 36 | OCP_INTERNAL unsigned int ay_out(int h,int l,int a); 37 | 38 | extern OCP_INTERNAL unsigned char ay_mem[]; 39 | extern OCP_INTERNAL unsigned long ay_tstates,ay_tsmax; 40 | #if 0 41 | extern int highspeed,playing,paused,want_quit; 42 | extern int stopafter,fadetime; 43 | extern int use_ui,play_to_stdout; 44 | extern char **ay_filenames; 45 | extern int ay_file,ay_num_files; 46 | extern OCP_INTERNAL int ay_track; 47 | #endif 48 | 49 | struct aydata_tag 50 | { 51 | unsigned char *filedata; 52 | int filelen; 53 | struct ay_track_tag *tracks; 54 | 55 | int filever,playerver; 56 | unsigned char *authorstr,*miscstr; 57 | int num_tracks; 58 | int first_track; 59 | }; 60 | 61 | struct ay_track_tag 62 | { 63 | unsigned char *namestr; 64 | unsigned char *data; 65 | unsigned char *data_stacketc,*data_memblocks; 66 | int fadestart,fadelen; 67 | }; 68 | 69 | #if 0 70 | extern OCP_INTERNAL struct aydata_tag aydata; 71 | #endif 72 | 73 | struct time_tag { int min,sec,subsecframes; }; 74 | extern OCP_INTERNAL struct time_tag ay_tunetime; 75 | 76 | -------------------------------------------------------------------------------- /m4/ax_cxx_compile_stdcxx_11.m4: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html 3 | # ============================================================================= 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check for baseline language coverage in the compiler for the C++11 12 | # standard; if necessary, add switches to CXX and CXXCPP to enable 13 | # support. 14 | # 15 | # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX 16 | # macro with the version set to C++11. The two optional arguments are 17 | # forwarded literally as the second and third argument respectively. 18 | # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for 19 | # more information. If you want to use this macro, you also need to 20 | # download the ax_cxx_compile_stdcxx.m4 file. 21 | # 22 | # LICENSE 23 | # 24 | # Copyright (c) 2008 Benjamin Kosnik 25 | # Copyright (c) 2012 Zack Weinberg 26 | # Copyright (c) 2013 Roy Stogner 27 | # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov 28 | # Copyright (c) 2015 Paul Norman 29 | # Copyright (c) 2015 Moritz Klammler 30 | # 31 | # Copying and distribution of this file, with or without modification, are 32 | # permitted in any medium without royalty provided the copyright notice 33 | # and this notice are preserved. This file is offered as-is, without any 34 | # warranty. 35 | 36 | #serial 18 37 | 38 | AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) 39 | AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) 40 | -------------------------------------------------------------------------------- /stuff/poutput-fontengine.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_POUTOUT_FONTENGINE_H 2 | #define _STUFF_POUTOUT_FONTENGINE_H 1 3 | 4 | struct font_entry_8x8_t 5 | { 6 | uint32_t codepoint; 7 | //char code[6+1]; 8 | unsigned char width; 9 | /* for 8 lines font, we have have 1 bit per pixel */ 10 | unsigned char data[16]; /* we fit up to 16 by 8 pixels */ 11 | uint8_t score; 12 | }; 13 | 14 | struct font_entry_8x16_t 15 | { 16 | uint32_t codepoint; 17 | //char code[6+1]; 18 | unsigned char width; /* 8 or 16 */ 19 | /* for 16 lines font, we have have 1 bit per pixel */ 20 | unsigned char data[32]; /* we fit up to 16 by 16 pixels */ 21 | uint8_t score; 22 | }; 23 | 24 | struct font_entry_16x32_t 25 | { 26 | uint32_t codepoint; 27 | //char code[6+1]; 28 | unsigned char width; /* 8 or 16 */ 29 | /* for 16 lines font, we have have 1 bit per pixel */ 30 | unsigned char data[128]; /* we fit up to 32 by 32 pixels */ 31 | uint8_t score; 32 | }; 33 | 34 | extern struct font_entry_8x8_t cp437_8x8 [256]; 35 | extern struct font_entry_8x16_t cp437_8x16 [256]; 36 | extern struct font_entry_16x32_t cp437_16x32[256]; 37 | 38 | /* age the cache */ 39 | void fontengine_8x8_iterate (void); 40 | void fontengine_8x16_iterate (void); 41 | void fontengine_16x32_iterate (void); 42 | 43 | uint8_t *fontengine_8x8(uint32_t codepoint, int *width); 44 | uint8_t *fontengine_8x16(uint32_t codepoint, int *width); 45 | uint8_t *fontengine_16x32(uint32_t codepoint, int *width); 46 | 47 | /* used by fontdebug only */ 48 | int fontengine_8x8_forceunifont (uint32_t codepoint, int *width, uint8_t buffer[16]); 49 | int fontengine_8x16_forceunifont (uint32_t codepoint, int *width, uint8_t buffer[32]); 50 | int fontengine_16x32_forceunifont (uint32_t codepoint, int *width, uint8_t buffer[128]); 51 | 52 | int fontengine_init (void); 53 | 54 | void fontengine_done (void); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /playtimidity/interface.h: -------------------------------------------------------------------------------- 1 | /* interface.h. Generated from interface.h.in by configure. */ 2 | /* Define if you have EMACS interface. */ 3 | /* #undef IA_EMACS */ 4 | 5 | /* Define if you have GTK interface. */ 6 | /* #undef IA_GTK */ 7 | 8 | /* Define if you have KMIDI interface. */ 9 | /* #undef IA_KMIDI */ 10 | 11 | /* Define if you have MOTIF interface. */ 12 | /* #undef IA_MOTIF */ 13 | 14 | /* Define if you have NCURSES interface. */ 15 | /* #undef IA_NCURSES */ 16 | 17 | /* Define if you have PLUGIN interface. */ 18 | /* #undef IA_PLUGIN */ 19 | 20 | /* Define if you have SLANG interface. */ 21 | /* #undef IA_SLANG */ 22 | 23 | /* Define if you have TCLTK interface. */ 24 | /* #undef IA_TCLTK */ 25 | 26 | /* Define if you have VT100 interface. */ 27 | /* #undef IA_VT100 */ 28 | 29 | /* Define if you have XAW interface. */ 30 | /* #undef IA_XAW */ 31 | 32 | /* Define if you have XSKIN interface. */ 33 | /* #undef IA_XSKIN */ 34 | 35 | /* Define if you have DYNAMIC interface. */ 36 | /* #undef IA_DYNAMIC */ 37 | 38 | /* Define if you have Windows32 GUI interface. */ 39 | /* #undef IA_W32GUI */ 40 | 41 | /* Define if you have Windows GUI synthesizer mode interface. */ 42 | /* #undef IA_W32G_SYN */ 43 | 44 | /* Define if you have Remote MIDI interface. */ 45 | /* #undef IA_SERVER */ 46 | 47 | /* Define if you have Remote MIDI interface. */ 48 | /* #undef IA_ALSASEQ */ 49 | 50 | /* Define if you have Windows synthesizer mode interface. */ 51 | /* #undef IA_WINSYN */ 52 | 53 | /* Define if you have PortMIDI synthesizer mode interface. */ 54 | /* #undef IA_PORTMIDISYN */ 55 | 56 | /* Define if you have Windows named pipe synthesizer mode interface. */ 57 | /* #undef IA_NPSYN */ 58 | 59 | #if defined(IA_W32GUI) || defined(IA_W32G_SYN) 60 | #ifndef __W32READDIR__ 61 | #define __W32READDIR__ 62 | #endif 63 | #define URL_DIR_CACHE_ENABLE 64 | #define __W32G__ /* for Win32 GUI */ 65 | #endif 66 | -------------------------------------------------------------------------------- /playopl/oplSatoh.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2005-'24 Stian Skjelstad 3 | * 4 | * This file is based on AdPlug project, released under GPLv2 5 | * with permission from Simon Peter. 6 | * 7 | * Adplug - Replayer for many OPL2/OPL3 audio file formats. 8 | * Copyright (C) 1999 - 2004 Simon Peter, , et al. 9 | * emuopl.h - Emulated OPL, by Simon Peter 10 | * 11 | * File is changed in letting FM_OPL be public 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 | */ 27 | 28 | #ifndef H_ADPLUG_OPLSATOH 29 | #define H_ADPLUG_OPLSATOH 30 | 31 | #include "adplug-git/src/opl.h" 32 | extern "C" { 33 | #include "adplug-git/src/fmopl.h" 34 | } 35 | 36 | #include "ocpemu.h" 37 | 38 | class oplSatoh: public Copl 39 | { 40 | public: 41 | oplSatoh(int rate); // rate = sample rate 42 | virtual ~oplSatoh(); 43 | 44 | void update(short *buf, int samples); // fill buffer 45 | void write(int reg, int val); 46 | void init(); 47 | 48 | private: 49 | FM_OPL *opl[2]; // holds emulator data 50 | short *mixbuf0, 51 | *mixbuf1; 52 | int mixbufSamples; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /cpiface/cpiptype.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * CPIFace file type dectection routines for the file selector 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -kb980717 Tammo Hinrichs 23 | * -first release 24 | * -fd981119 Felix Domke 25 | * -added the really important 'NO_CPIFACE_IMPORT' 26 | */ 27 | 28 | #include "config.h" 29 | #include 30 | #include 31 | #include "types.h" 32 | #include "cpiptype.h" 33 | #include "filesel/mdb.h" 34 | 35 | static int cpiReadInfo(struct moduleinfostruct *m, struct ocpfilehandle_t *file, const char *buf, size_t len, const struct mdbReadInfoAPI_t *API) 36 | { 37 | if (!memcmp(buf, "CPANI\x1A\x00\x00", 8)) 38 | { 39 | strncpy(m->title,(char *)buf+8,31); 40 | if (!m->title[0]) 41 | { 42 | strcpy(m->title, "wuerfel mode animation"); 43 | } 44 | m->modtype.integer.i=MODULETYPE("ANI"); 45 | return 1; 46 | } 47 | return 0; 48 | } 49 | 50 | struct mdbreadinforegstruct cpiReadInfoReg = {"ANI", cpiReadInfo MDBREADINFOREGSTRUCT_TAIL}; 51 | -------------------------------------------------------------------------------- /boot/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | include Makefile-static 4 | 5 | ifeq ($(WINDOWS),1) 6 | UTF_O=utf-8.o utf-16.o 7 | endif 8 | 9 | all: $(boot_libocp_start_so) $(boot_libocp_so) $(boot_libocp_end_so) kickload.o $(UTF_O) 10 | 11 | clean: 12 | rm -f *.o *.a *$(LIB_SUFFIX) 13 | 14 | install: 15 | 16 | uninstall: 17 | 18 | compdate.o: compdate.c \ 19 | ../config.h 20 | $(CC) compdate.c -o $@ -c 21 | 22 | pmain.o: pmain.c pmain.h \ 23 | ../config.h \ 24 | ../types.h \ 25 | plinkman.h \ 26 | psetting.h \ 27 | ../stuff/err.h \ 28 | ../stuff/framelock.h \ 29 | ../stuff/poutput.h 30 | $(CC) pmain.c -o $@ -c 31 | 32 | psetting.o: psetting.c psetting.h \ 33 | ../config.h \ 34 | ../stuff/compat.h \ 35 | ../stuff/utf-16.h 36 | $(CC) psetting.c -o $@ -c 37 | 38 | plinkman.o: plinkman.c plinkman.h \ 39 | ../config.h \ 40 | ../types.h \ 41 | psetting.h \ 42 | ../stuff/compat.h \ 43 | ../stuff/utf-16.h 44 | $(CC) plinkman.c -o $@ -c 45 | 46 | plinkman_end.o: plinkman_end.c plinkman.h \ 47 | ../config.h \ 48 | ../types.h 49 | $(CC) plinkman_end.c -o $@ -c 50 | 51 | ifeq ($(WINDOWS),1) 52 | KICKLOAD_C=kickload-windows.c 53 | else 54 | KICKLOAD_C=kickload-unix.c 55 | endif 56 | 57 | kickload.o: $(KICKLOAD_C) \ 58 | ../config.h \ 59 | ../types.h \ 60 | ../boot/pmain.h \ 61 | ../boot/console.h \ 62 | ../stuff/poutput.h \ 63 | ../stuff/utf-16.h \ 64 | ../Rules.make 65 | $(CC) $< -o $@ -c 66 | 67 | console.o: console.c console.h \ 68 | ../config.h \ 69 | ../types.h \ 70 | ../cpiface/gif.h \ 71 | ../cpiface/jpeg.h \ 72 | ../cpiface/png.h \ 73 | ../stuff/framelock.h \ 74 | ../stuff/poutput.h \ 75 | ../stuff/poutput-keyboard.h \ 76 | ../stuff/utf-8.h 77 | $(CC) console.c -o $@ -c 78 | 79 | utf-8.o: ../stuff/utf-8.c \ 80 | ../config.h \ 81 | ../types.h \ 82 | ../stuff/utf-8.h 83 | $(CC) $< -DBOOT -o $@ -c 84 | 85 | utf-16.o: ../stuff/utf-16.c \ 86 | ../config.h \ 87 | ../types.h \ 88 | ../stuff/utf-16.h 89 | $(CC) $< -DBOOT -o $@ -c 90 | -------------------------------------------------------------------------------- /playogg/oggplay.h: -------------------------------------------------------------------------------- 1 | #ifndef __OGG_H 2 | #define __OGG_H 3 | 4 | /* ogg_int64_t */ 5 | #include 6 | 7 | struct ogginfo 8 | { 9 | ogg_int64_t pos; 10 | ogg_int64_t len; 11 | uint32_t rate; 12 | uint8_t stereo; 13 | uint8_t bit16; 14 | int bitrate; 15 | const char *opt25; 16 | const char *opt50; 17 | }; 18 | 19 | struct ogg_comment_t 20 | { 21 | char *title; 22 | int value_count; 23 | char *value[]; 24 | }; 25 | 26 | struct ogg_picture_t 27 | { 28 | uint32_t picture_type; 29 | char *description; 30 | 31 | uint16_t width; 32 | uint16_t height; 33 | uint8_t *data_bgra; 34 | 35 | uint16_t scaled_width; 36 | uint16_t scaled_height; 37 | uint8_t *scaled_data_bgra; 38 | }; 39 | 40 | extern OCP_INTERNAL struct ogg_comment_t **ogg_comments; 41 | extern OCP_INTERNAL int ogg_comments_count; 42 | extern OCP_INTERNAL struct ogg_picture_t *ogg_pictures; 43 | extern OCP_INTERNAL int ogg_pictures_count; 44 | 45 | struct ocpfilehandle_t; 46 | struct cpifaceSessionAPI_t; 47 | OCP_INTERNAL int oggOpenPlayer (struct ocpfilehandle_t *, struct cpifaceSessionAPI_t *cpifaceSession); 48 | OCP_INTERNAL void oggClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 49 | OCP_INTERNAL void oggIdle (struct cpifaceSessionAPI_t *cpifaceSession); 50 | OCP_INTERNAL void oggSetLoop (uint8_t s); 51 | OCP_INTERNAL char oggLooped (void); 52 | OCP_INTERNAL void oggGetInfo (struct cpifaceSessionAPI_t *cpifaceSession, struct ogginfo *); 53 | OCP_INTERNAL ogg_int64_t oggGetPos (struct cpifaceSessionAPI_t *cpifaceSession); 54 | OCP_INTERNAL void oggSetPos (struct cpifaceSessionAPI_t *cpifaceSession, ogg_int64_t pos); 55 | 56 | OCP_INTERNAL void OggInfoInit (struct cpifaceSessionAPI_t *cpifaceSession); 57 | OCP_INTERNAL void OggInfoDone (struct cpifaceSessionAPI_t *cpifaceSession); 58 | 59 | OCP_INTERNAL void OggPicInit (struct cpifaceSessionAPI_t *cpifaceSession); 60 | OCP_INTERNAL void OggPicDone (struct cpifaceSessionAPI_t *cpifaceSession); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /dev/player.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLAYER_H 2 | #define __PLAYER_H 3 | 4 | /* in the future we might add optional 5.1, 7.1, float etc - All devp drivers MUST atleast support PLR_STEREO_16BIT_SIGNED */ 5 | enum plrRequestFormat 6 | { 7 | PLR_STEREO_16BIT_SIGNED=1 8 | }; 9 | 10 | struct ocpfilehandle_t; 11 | 12 | struct cpifaceSessionAPI_t; /* cpiface.h */ 13 | 14 | struct ocpvolregstruct; /* vol.h */ 15 | 16 | struct plrDevAPI_t 17 | { 18 | unsigned int (*Idle)(void); /* returns the current BufferDelay - should be called periodically, usually at FPS rate - inserts pause-samples if needed */ 19 | void (*PeekBuffer)(void **buf1, unsigned int *length1, void **buf2, unsigned int *length2); /* used by analyzer, graphs etc - length given in samples */ 20 | int (*Play)(uint32_t *rate, enum plrRequestFormat *format, struct ocpfilehandle_t *source_file, struct cpifaceSessionAPI_t *cpifaceSession); // returns 0 on error - DiskWriter plugin uses source_file to name its output. Caller can suggest values in rate and format */ 21 | void (*GetBuffer)(void **buf, unsigned int *samples); 22 | uint32_t (*GetRate)(void); /* this call will probably disappear in the future */ 23 | 24 | /* positive numbers = samples in the past 25 | * 0 on the last sample commited 26 | * negative numbers = samples into the future 27 | */ 28 | void (*OnBufferCallback) (int samplesuntil, void (*callback)(void *arg, int samples_ago), void *arg); 29 | void (*CommitBuffer)(unsigned int samples); 30 | void (*Pause)(int pause); // driver will insert dummy samples as needed 31 | void (*Stop) (struct cpifaceSessionAPI_t *cpifaceSession); 32 | struct ocpvolregstruct *VolRegs; /* null if feature is not present */ 33 | int (*ProcessKey)(uint16_t); 34 | 35 | void (*GetStats)(uint64_t *committed, uint64_t *processed); 36 | }; 37 | 38 | extern const struct plrDevAPI_t *plrDevAPI; 39 | 40 | extern void plrGetRealMasterVolume(int *l, int *r); 41 | extern void plrGetMasterSample(int16_t *s, uint32_t len, uint32_t rate, int opt); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /playay/z80.h: -------------------------------------------------------------------------------- 1 | /* Miscellaneous definitions for xz80, copyright (C) 1994 Ian Collier. 2 | * 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software 15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 | */ 17 | 18 | #ifndef _Z80_H 19 | #define _Z80_H 1 20 | 21 | #define Z80_quit 1 22 | #define Z80_NMI 2 23 | #define Z80_reset 3 24 | #define Z80_load 4 25 | #define Z80_save 5 26 | #define Z80_log 6 27 | 28 | struct plrDevAPI_t; 29 | 30 | OCP_INTERNAL void ay_z80_init (const unsigned char *data, const unsigned char *stacketc); 31 | OCP_INTERNAL void ay_z80loop (const struct plrDevAPI_t *plrDevAPI); 32 | 33 | #define fetch(x) (ay_mem[x]) 34 | #define fetch2(x) ((fetch(((x)+1)&0xffff)<<8)|fetch(x)) 35 | 36 | #define store(x,y) do {\ 37 | ay_mem[x]=(y); \ 38 | } while(0) 39 | 40 | #define store2b(x,hi,lo) do {\ 41 | ay_mem[x]=lo; \ 42 | ay_mem[(x+1)&0xffff]=hi; \ 43 | } while(0) 44 | 45 | #define store2(x,y) store2b(x,(y)>>8,(y)&255) 46 | 47 | #ifdef __GNUC__ 48 | static inline void storefunc(uint16_t ad, uint8_t b){ 49 | store(ad,b); 50 | } 51 | #undef store 52 | #define store(x,y) storefunc(x,y) 53 | 54 | static inline void store2func(uint16_t ad,unsigned char b1,uint8_t b2){ 55 | store2b(ad,b1,b2); 56 | } 57 | #undef store2b 58 | #define store2b(x,hi,lo) store2func(x,hi,lo) 59 | #endif 60 | 61 | #define bc ((b<<8)|c) 62 | #define de ((d<<8)|e) 63 | #define hl ((h<<8)|l) 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /playcda/cdatype.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2005-'25 Stian Skjelstad 3 | * 4 | * .cda file type detection routines for the file selector 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "config.h" 22 | #include "types.h" 23 | #include "boot/plinkman.h" 24 | #include "filesel/mdb.h" 25 | #include "filesel/pfilesel.h" 26 | #include "stuff/err.h" 27 | #include "cdatype.h" 28 | 29 | static const char *CDA_description[] = 30 | { 31 | // | 32 | "CDA - CDROM Digital Audio, is a virtual file that links a cdrom audio", 33 | "track or complete disc to an actual device. The device can be both physical", 34 | "or virtual CDROM drive. Marking a random file in the filesystem with this", 35 | "filetype will not make it playable.", 36 | NULL 37 | }; 38 | 39 | OCP_INTERNAL int cda_type_init (struct PluginInitAPI_t *API) 40 | { 41 | struct moduletype mt; 42 | 43 | API->fsRegisterExt ("CDA"); 44 | 45 | mt.integer.i = MODULETYPE("CDA"); 46 | API->fsTypeRegister (mt, CDA_description, "plOpenCP", &cdaPlayer); 47 | 48 | return errOk; 49 | } 50 | 51 | OCP_INTERNAL void cda_type_done (struct PluginCloseAPI_t *API) 52 | { 53 | struct moduletype mt; 54 | 55 | mt.integer.i = MODULETYPE("CDA"); 56 | API->fsTypeUnregister (mt); 57 | } 58 | -------------------------------------------------------------------------------- /playgmd/gmdpdots.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * GMDPlay note dots routines 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -nb980510 Niklas Beisert 23 | * -first release 24 | */ 25 | 26 | #include "config.h" 27 | #include "types.h" 28 | #include "cpiface/cpiface.h" 29 | #include "dev/mcp.h" 30 | #include "gmdplay.h" 31 | #include "gmdpdots.h" 32 | 33 | OCP_INTERNAL int gmdGetDots (struct cpifaceSessionAPI_t *cpifaceSession, struct notedotsdata *d, int max) 34 | { 35 | int pos=0; 36 | int i; 37 | /* mod.channum == cpifaceSession->LogicalChannelCount */ 38 | for (i=0; i=max) 53 | break; 54 | d[pos].voll=vl; 55 | d[pos].volr=vr; 56 | d[pos].chan=i; 57 | d[pos].note=mpGetRealNote(cpifaceSession, i); 58 | d[pos].col=32+(ci.ins&15);/* sustain */ 59 | pos++; 60 | } 61 | return pos; 62 | } 63 | -------------------------------------------------------------------------------- /playflac/flacplay.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLACPLAY_H 2 | #define _FLACPLAY_H 3 | 4 | struct flacinfo 5 | { 6 | uint64_t pos; /* in source samples */ 7 | uint64_t len; /* in source samples */ 8 | uint32_t timelen; /* in seconds ETA */ 9 | uint32_t rate; /* output rate */ 10 | int stereo; 11 | int bits; 12 | uint32_t bitrate; 13 | char opt25[26]; 14 | char opt50[51]; 15 | }; 16 | 17 | struct flac_comment_t 18 | { 19 | char *title; 20 | int value_count; 21 | char *value[]; 22 | }; 23 | 24 | struct flac_picture_t 25 | { 26 | uint32_t picture_type; 27 | char *description; 28 | 29 | uint16_t width; 30 | uint16_t height; 31 | uint8_t *data_bgra; 32 | 33 | uint16_t scaled_width; 34 | uint16_t scaled_height; 35 | uint8_t *scaled_data_bgra; 36 | }; 37 | 38 | struct ocpfilehandle_t; 39 | 40 | OCP_INTERNAL void flacMetaDataLock (void); 41 | extern OCP_INTERNAL struct flac_comment_t **flac_comments; 42 | extern OCP_INTERNAL int flac_comments_count; 43 | extern OCP_INTERNAL struct flac_picture_t *flac_pictures; 44 | extern OCP_INTERNAL int flac_pictures_count; 45 | OCP_INTERNAL void flacMetaDataUnlock (void); 46 | 47 | struct cpifaceSessionAPI_t; 48 | OCP_INTERNAL int flacOpenPlayer (struct ocpfilehandle_t *, struct cpifaceSessionAPI_t *cpifaceSession); 49 | OCP_INTERNAL void flacClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 50 | OCP_INTERNAL void flacIdle (struct cpifaceSessionAPI_t *cpifaceSession); 51 | OCP_INTERNAL void flacSetLoop (uint8_t s); 52 | OCP_INTERNAL int flacIsLooped (void); 53 | OCP_INTERNAL void flacGetInfo (struct flacinfo *); 54 | OCP_INTERNAL uint64_t flacGetPos (struct cpifaceSessionAPI_t *cpifaceSession); 55 | OCP_INTERNAL void flacSetPos (uint64_t pos); 56 | 57 | OCP_INTERNAL void FlacInfoInit (struct cpifaceSessionAPI_t *cpifaceSession); 58 | OCP_INTERNAL void FlacInfoDone (struct cpifaceSessionAPI_t *cpifaceSession); 59 | 60 | OCP_INTERNAL void FlacPicInit (struct cpifaceSessionAPI_t *cpifaceSession); 61 | OCP_INTERNAL void FlacPicDone (struct cpifaceSessionAPI_t *cpifaceSession); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Original authors of Cubic Player is the Cubic Team (www.cubic.org) 2 | DOJ and Pascal really rocks on that kind of software, so all respect goes to 3 | those guys who made this player. 4 | 5 | Linux rewrite/porting is done by Stian Skjelstad (and hopefully a couple of 6 | other people soon). The player itself is just rewritten to Linux, and assembler 7 | stuff in wrapped into C instead of using external assembler. With time 8 | C-replacers will be availble as a start for those who intend to port this 9 | beyond to other architechures. Filehandling is more-or-less redone from 10 | scratch, with the old code-design in my mind. 11 | 12 | 13 | playay plugin contains modified code from the aylet project v0.5a. 14 | Copyright (C) 1994-2010 Russell Marks and Ian Collier 15 | Copyright (C) MAME 16 | 17 | 18 | playopl plugin contains: 19 | * some code from the original AdPlug project. This code has been released 20 | under GPLv2 with the permission from the original copyright holder. 21 | Copyright (C) 1999 - 2002 Simon Peter , et al. 22 | * a fork of the Adplug GIT master with modifications 23 | * a copy of the libbinio GIT master 24 | * a copy of the adplugdb GIT master 25 | 26 | playtimidity plugin contains a fork of TiMidity++ GIT master with modifications. 27 | Copyright (C) 1999-2004 Masanao Izumo 28 | Copyright (C) 1995 Tuukka Toivonen 29 | 30 | 31 | playhvl plugin contains code from Hively Tracker. Please see original code 32 | at https://github.com/pete-gordon/hivelytracker/tree/master/hvl2wav . 33 | Copyright (c) 2006-2018, Pete Gordon 34 | 35 | 36 | playym/ plugin contains code from ST-Sound v1.43. 37 | Copyright (c) 1995-2005 by Arnaud Carre 38 | Copyright (c) 1996 Kerwin F. Medina 39 | 40 | 41 | playsid/ setup dialog contains 42 | * code from RSA Data Security, Inc., MD5 message-digest algorithm 43 | Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. 44 | * a fork of the original libsidplayfp GIT master with modifications 45 | 46 | 47 | -- 48 | Stian Skjelstad 49 | -------------------------------------------------------------------------------- /stuff/imsrtns.h: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) '94-'98 Niklas Beisert 3 | * 4 | * DOS4GFIX initialisation handlers 5 | * 6 | * revision history: (please note changes here) 7 | * -nb980510 Niklas Beisert 8 | * -first release 9 | * -kb98???? Tammo Hinrichs (?) 10 | * -some bugfix(?) 11 | * -fd981205 Felix Domke 12 | * -KB's "bugfix" doesn't work with Watcom106 13 | * -ss040613 Stian Skjelstad 14 | * -Redone to use gcc assembler inline and posix libc 15 | * -ss040908 Stian Skjelstad 16 | * -Made the assembler inlines optimize-safe 17 | */ 18 | 19 | #ifndef IMSRTNS__H 20 | #define IMSRTNS__H 21 | 22 | /* Assembler optimization per cpu we can wait with.... */ 23 | 24 | static inline int32_t imuldiv(int32_t a,int32_t b,int32_t c) 25 | { 26 | int64_t temp = (int64_t)a*(int64_t)b; 27 | return temp/c; 28 | } 29 | 30 | static inline uint32_t umuldiv(uint32_t a,uint32_t b,uint32_t c) 31 | { 32 | uint64_t temp = (uint64_t)a*(uint64_t)b; 33 | return temp/c; 34 | } 35 | 36 | static inline int32_t imulshr16(int32_t a,int32_t b) 37 | { 38 | int64_t temp = (int64_t)a*(int64_t)b; 39 | return temp>>16; 40 | } 41 | 42 | static inline int32_t imulshr24(int32_t a,int32_t b) 43 | { 44 | int64_t temp = (int64_t)a*(int64_t)b; 45 | return temp>>24; 46 | } 47 | 48 | static inline int32_t imulshr32(int32_t a,int32_t b) 49 | { 50 | int64_t temp = (int64_t)a*(int64_t)b; 51 | return temp>>32; 52 | } 53 | 54 | static inline uint32_t umulshr16(uint32_t a,uint32_t b) 55 | { 56 | uint64_t temp = (uint64_t)a*(uint64_t)b; 57 | return temp>>16; 58 | } 59 | 60 | #define saturate(value,minvalue,maxvalue) (((value) < (minvalue)) ? (minvalue) : ((value) > (maxvalue)) ? (maxvalue) : (value)) 61 | 62 | #define umldivrnd(mul1, mul2, divby) umuldiv(mul1, mul2, divby) /* dirty */ 63 | 64 | #define memsetw(dst, what, len) {int i;uint16_t *tmp_dst=(uint16_t *)(dst);for(i=(len);i;i--)*tmp_dst++=(uint16_t)(what);} while(0) 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /stuff/poutput-swtext.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_POUTPUT_SWTEXT_H 2 | #define _STUFF_POUTPUT_SWTEXT_H 3 | 4 | /* These renders to plVidMem, so this virtual buffer need to be render-buffer for these helper functions to be used 5 | */ 6 | 7 | #if 0 8 | /* codepage is optional, to translate...*/ 9 | void swtext_displaystrattr_cpfont_8x8(uint16_t y, uint16_t x, const uint16_t *buf, uint16_t len, const uint8_t *codepage); 10 | 11 | void swtext_displaystr_cpfont_8x8(uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len, const uint8_t *codepage); 12 | #endif 13 | 14 | void swtext_displayvoid(uint16_t y, uint16_t x, uint16_t len); 15 | 16 | void swtext_displaystrattr_cp437(uint16_t y, uint16_t x, const uint16_t *buf, uint16_t len); 17 | 18 | void swtext_displaychr_cp437(uint16_t y, uint16_t x, uint8_t attr, char chr, uint16_t len); 19 | 20 | void swtext_displaystr_cp437(uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len); 21 | 22 | void swtext_displaystr_utf8(uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len); 23 | 24 | int swtext_measurestr_utf8 (const char *src, int srclen); 25 | 26 | void swtext_drawbar(uint16_t x, uint16_t yb, uint16_t yh, uint32_t hgt, uint32_t c); 27 | 28 | void swtext_idrawbar(uint16_t x, uint16_t yb, uint16_t yh, uint32_t hgt, uint32_t c); 29 | 30 | void swtext_setcur(uint16_t y, uint16_t x); 31 | 32 | void swtext_setcurshape(uint16_t shape); 33 | 34 | void swtext_cursor_inject(void); 35 | 36 | void swtext_cursor_eject(void); 37 | 38 | /* only used by fontdebug */ 39 | void swtext_displaycharattr_single8x8(uint16_t y, uint16_t x, uint8_t *cp, uint8_t attr); 40 | void swtext_displaycharattr_double8x8(uint16_t y, uint16_t x, uint8_t *cp, uint8_t attr); 41 | void swtext_displaycharattr_single8x16(uint16_t y, uint16_t x, uint8_t *cp, uint8_t attr); 42 | void swtext_displaycharattr_double8x16(uint16_t y, uint16_t x, uint8_t *cp, uint8_t attr); 43 | void swtext_displaycharattr_single16x32(uint16_t y, uint16_t x, uint8_t *cp, uint8_t attr); 44 | void swtext_displaycharattr_double16x32(uint16_t y, uint16_t x, uint8_t *cp, uint8_t attr); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /playogg/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | all: playogg$(LIB_SUFFIX) 5 | 6 | clean: 7 | rm -f *.o *$(LIB_SUFFIX) 8 | 9 | install: 10 | $(CP) playogg$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/95-playogg$(LIB_SUFFIX)" 11 | 12 | uninstall: 13 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/95-playogg$(LIB_SUFFIX)" 14 | 15 | playogg_so=cpiogginfo.o cpioggpic.o oggplay.o oggpplay.o oggtype.o 16 | playogg$(LIB_SUFFIX): $(playogg_so) 17 | $(CC) $(SHARED_FLAGS) $(LDFLAGS) -o $@ $^ $(OGG_LIBS) $(MATH_LIBS) $(VORBIS_LIBS) $(VORBISFILE_LIBS) $(LIBJPEG_LIBS) $(LIBPNG_LIBS) 18 | 19 | cpiogginfo.o: cpiogginfo.c \ 20 | ../config.h \ 21 | ../types.h \ 22 | ../cpiface/cpiface.h \ 23 | ../stuff/poutput.h \ 24 | oggplay.h 25 | $(CC) $< -o $@ $(VORBISFILE_CFLAGS) -c 26 | 27 | cpioggpic.o: cpioggpic.c \ 28 | ../config.h \ 29 | ../types.h \ 30 | ../boot/psetting.h \ 31 | ../cpiface/cpiface.h \ 32 | ../stuff/poutput.h \ 33 | oggplay.h 34 | $(CC) $< -o $@ $(VORBISFILE_CFLAGS) -c 35 | 36 | oggtype.o: oggtype.c \ 37 | ../config.h \ 38 | ../types.h \ 39 | ../boot/plinkman.h \ 40 | ../filesel/filesystem.h \ 41 | ../filesel/mdb.h \ 42 | ../filesel/pfilesel.h \ 43 | oggtype.h \ 44 | ../stuff/err.h 45 | $(CC) oggtype.c -o $@ -c 46 | 47 | oggplay.o: oggplay.c \ 48 | ../config.h \ 49 | ../types.h \ 50 | ../cpiface/cpiface.h \ 51 | ../dev/mcp.h \ 52 | ../dev/player.h \ 53 | ../dev/plrasm.h \ 54 | ../dev/ringbuffer.h \ 55 | ../filesel/filesystem.h \ 56 | oggplay.h \ 57 | ../stuff/imsrtns.h \ 58 | ../stuff/poutput.h 59 | $(CC) oggplay.c -o $@ $(OGG_CFLAGS) $(VORBIS_CFLAGS) $(VORBISFILE_CFLAGS) -c 60 | 61 | oggpplay.o: oggpplay.c \ 62 | ../config.h \ 63 | ../types.h \ 64 | ../boot/psetting.h \ 65 | ../boot/plinkman.h \ 66 | ../cpiface/cpiface.h \ 67 | ../dev/player.h \ 68 | ../filesel/dirdb.h \ 69 | ../filesel/filesystem.h \ 70 | ../filesel/mdb.h \ 71 | ../filesel/pfilesel.h \ 72 | oggplay.h \ 73 | oggtype.h \ 74 | ../stuff/compat.h \ 75 | ../stuff/err.h \ 76 | ../stuff/poutput.h \ 77 | ../stuff/sets.h 78 | $(CC) oggpplay.c -o $@ $(OGG_CFLAGS) $(VORBIS_CFLAGS) $(VORBISFILE_CFLAGS) -c 79 | -------------------------------------------------------------------------------- /devw/dwmixfa.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * assembler routines for FPU mixer 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -kbwhenever Tammo Hinrichs 23 | * -first release 24 | * -ryg990426 Fabian Giesen 25 | * -extreeeeem kbchangesapplying+sklavenarbeitverrichting 26 | * (was mir angst macht, ich finds nichmal schlimm) 27 | * -ryg990504 Fabian Giesen 28 | * -added float postprocs, the key to player realtimeruling 29 | * -kb990531 Tammo Hinrichs 30 | * -fixed mono playback 31 | * -cubic spline interpolation now works 32 | * -ss04???? Stian Skjelstad 33 | * -ported to gcc 34 | * -ss040908 Stian Skjelstad 35 | * -made it optimizesafe 36 | * 37 | * dominators und doc rooles geiler floating point mixer mit volume ramps 38 | * (die man gar nicht benutzen kann (kb sagt man kann). und mit 39 | * ultra-rauschabstand und viel geil interpolation. 40 | * wir sind besser als ihr... 41 | */ 42 | 43 | #include "config.h" 44 | #include "types.h" 45 | #include "dev/mcp.h" 46 | #include "dev/postproc.h" 47 | #include "dwmixfa.h" 48 | 49 | #include "dwmixfa_c.c" 50 | -------------------------------------------------------------------------------- /playtimidity/timiditypdots.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2005-'25 Stian Skjelstad 4 | * 5 | * GMIPlay note dots routines 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -nb980510 Niklas Beisert 23 | * -first release 24 | */ 25 | 26 | #include "config.h" 27 | #include "types.h" 28 | 29 | #include "dev/mcp.h" 30 | #include "timidityplay.h" 31 | #include "cpiface/cpiface.h" 32 | 33 | OCP_INTERNAL int timidityGetDots (struct cpifaceSessionAPI_t *cpifaceSession, struct notedotsdata *d, int max) 34 | { 35 | int i,j; 36 | int pos=0; 37 | /* cpifaceSession->LogicalChannelCount is fixed at 16 */ 38 | for (i=0; i<16; i++) 39 | { 40 | struct mchaninfo ci; 41 | 42 | if (pos>=max) 43 | break; 44 | /* timidityGetRealNoteVol(i, &ci);*/ 45 | timidityGetChanInfo(i, &ci); 46 | 47 | for (j=0; j=max) 52 | break; 53 | vl=ci.vol[j];//ci.voll[j]; 54 | vr=ci.vol[j];//ci.volr[j]; 55 | 56 | if (!vl&&!vr&&!ci.opt[j]) 57 | continue; 58 | 59 | d[pos].voll=vl<<1; 60 | d[pos].volr=vr<<1; 61 | d[pos].chan=i; 62 | d[pos].note=(ci.note[j]+12)*256; 63 | d[pos].col=(ci.program&15/*ci.ins[j]&15*/)+(ci.opt[j]?32:16); 64 | pos++; 65 | } 66 | } 67 | return pos; 68 | } 69 | -------------------------------------------------------------------------------- /cpiface/cpiface-private.h: -------------------------------------------------------------------------------- 1 | #ifndef _CPIFACE_PRIVATE_H 2 | #define _CPIFACE_PRIVATE_H 1 3 | 4 | #include "stuff/sets.h" 5 | 6 | struct cpiDebugPair_t 7 | { 8 | uint16_t offset; 9 | uint16_t length; 10 | uint8_t linebreak; 11 | }; 12 | 13 | struct cpifaceSessionPrivate_t 14 | { 15 | struct cpifaceSessionAPI_t Public; 16 | 17 | /* mcpedit */ 18 | struct settings mcpset; 19 | enum mcpNormalizeType mcpType; 20 | int MasterPauseFadeParameter; 21 | 22 | /* instrument visualizer */ 23 | struct insdisplaystruct Inst; 24 | int InstScroll; 25 | int InstFirstLine; 26 | int InstStartCol; 27 | int InstLength; 28 | int InstHeight; 29 | int InstWidth; 30 | 31 | int openStatus; // err.h 32 | 33 | /* cpiDebug */ 34 | char cpiDebug_bufbase[2048]; 35 | unsigned int cpiDebug_buffill; 36 | unsigned int cpiDebugLastWidth; 37 | struct cpiDebugPair_t cpiDebug_line[100]; 38 | unsigned int cpiDebug_lines; 39 | 40 | int_fast8_t mcpPauseFadeDirection; 41 | uint64_t mcpPauseTarget; 42 | 43 | uint64_t SongStart; 44 | }; 45 | 46 | extern OCP_INTERNAL struct cpifaceSessionPrivate_t cpifaceSessionAPI; 47 | 48 | OCP_INTERNAL void fftInit(void); 49 | 50 | OCP_INTERNAL void cpiAnalInit (void); 51 | OCP_INTERNAL void cpiAnalDone (void); 52 | OCP_INTERNAL void cpiChanInit (void); 53 | OCP_INTERNAL void cpiGraphInit (void); 54 | OCP_INTERNAL void cpiGraphDone (void); 55 | OCP_INTERNAL void cpiInstInit (void); 56 | OCP_INTERNAL void cpiWurfel2Init (const struct configAPI_t *configAPI); 57 | OCP_INTERNAL void cpiWurfel2Done (void); 58 | OCP_INTERNAL void cpiLinksInit (void); 59 | OCP_INTERNAL void cpiLinksDone (void); 60 | OCP_INTERNAL void cpiMVolInit (void); 61 | OCP_INTERNAL void cpiMVolDone (void); 62 | OCP_INTERNAL void cpiPhaseInit (void); 63 | OCP_INTERNAL void cpiPhaseDone (void); 64 | OCP_INTERNAL void cpiScopeInit (void); 65 | OCP_INTERNAL void cpiScopeDone (void); 66 | OCP_INTERNAL void cpiTrackInit (void); 67 | OCP_INTERNAL void cpiVolCtrlInit (void); 68 | OCP_INTERNAL void cpiVolCtrlDone (void); 69 | 70 | OCP_INTERNAL int mcpSetProcessKey (struct cpifaceSessionPrivate_t *f, uint16_t key); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /playflac/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.make 3 | 4 | ifeq ($(HAVE_FLAC),1) 5 | TARGETS=playflac$(LIB_SUFFIX) 6 | endif 7 | 8 | CFLAGS+=-fPIC 9 | 10 | all: $(TARGETS) 11 | 12 | flactest$(EXE_SUFFIX): flactest.c 13 | $(CC) -o $@ flactest.c $(FLAC_CFLAGS) $(FLAC_LIBS) 14 | 15 | clean: 16 | rm -f *.o *$(LIB_SUFFIX) flactest$(EXE_SUFFIX) 17 | 18 | install: 19 | ifeq ($(HAVE_FLAC),1) 20 | $(CP) playflac$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/95-playflac$(LIB_SUFFIX)" 21 | endif 22 | 23 | uninstall: 24 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/95-playflac$(LIB_SUFFIX)" 25 | 26 | cpiflacinfo.o: cpiflacinfo.c \ 27 | ../config.h \ 28 | ../types.h \ 29 | ../cpiface/cpiface.h \ 30 | ../stuff/poutput.h \ 31 | flacplay.h 32 | $(CC) $< -o $@ -c 33 | 34 | cpiflacpic.o: cpiflacpic.c \ 35 | ../config.h \ 36 | ../types.h \ 37 | ../boot/psetting.h \ 38 | ../cpiface/cpiface.h \ 39 | ../stuff/poutput.h \ 40 | flacplay.h 41 | $(CC) $< -o $@ -c 42 | 43 | flactype.o: flactype.c \ 44 | ../config.h \ 45 | ../types.h \ 46 | ../boot/plinkman.h \ 47 | ../filesel/mdb.h \ 48 | ../filesel/pfilesel.h \ 49 | ../stuff/err.h \ 50 | flactype.h 51 | $(CC) flactype.c -o $@ -c 52 | 53 | playflac_so=cpiflacinfo.o cpiflacpic.o flacpplay.o flacplay.o flactype.o 54 | playflac$(LIB_SUFFIX): $(playflac_so) 55 | $(CC) $(SHARED_FLAGS) $(LDFLAGS) -o $@ $^ $(FLAC_LIBS) $(LIBJPEG_LIBS) $(LIBPNG_LIBS) 56 | 57 | flacpplay.o: flacpplay.c \ 58 | ../config.h \ 59 | ../types.h \ 60 | ../boot/plinkman.h \ 61 | ../boot/psetting.h \ 62 | ../cpiface/cpiface.h \ 63 | ../dev/player.h \ 64 | ../filesel/dirdb.h \ 65 | ../filesel/filesystem.h \ 66 | ../filesel/pfilesel.h \ 67 | ../filesel/mdb.h \ 68 | flacplay.h \ 69 | flactype.h \ 70 | ../stuff/compat.h \ 71 | ../stuff/err.h \ 72 | ../stuff/poutput.h \ 73 | ../stuff/sets.h 74 | $(CC) flacpplay.c -o $@ $(FLAC_CFLAGS) -c 75 | 76 | flacplay.o: flacplay.c \ 77 | ../config.h \ 78 | ../types.h \ 79 | ../cpiface/cpiface.h \ 80 | ../dev/mcp.h \ 81 | ../dev/player.h \ 82 | ../dev/ringbuffer.h \ 83 | ../filesel/filesystem.h \ 84 | flacplay.h \ 85 | ../stuff/err.h \ 86 | ../stuff/imsrtns.h \ 87 | ../stuff/poutput.h 88 | $(CC) flacplay.c -o $@ $(FLAC_CFLAGS) -c 89 | -------------------------------------------------------------------------------- /playym/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)/Rules.make 3 | 4 | ifeq ($(HAVE_LZH),1) 5 | LZH_LIB:=-llzh 6 | else 7 | LZH_LIB:= 8 | endif 9 | 10 | all: lzh_dir stsoundlib_dir playym$(LIB_SUFFIX) 11 | 12 | .PHONY: all clean install uninstall lzh_dir stsoundlib_dir 13 | 14 | 15 | lzh_dir: 16 | ifeq ($(HAVE_LZH),1) 17 | $(MAKE) -C lzh all TOPDIR="../$(TOPDIR)" 18 | endif 19 | lzh/liblzh.a: lzh_dir 20 | 21 | 22 | stsoundlib_dir: 23 | $(MAKE) -C stsoundlib all TOPDIR="../$(TOPDIR)" 24 | stsoundlib/libym.a: stsoundlib_dir 25 | 26 | 27 | install: 28 | $(CP) playym$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/95-playym$(LIB_SUFFIX)" 29 | 30 | uninstall: 31 | $(RM) -f "$(DESTDIR)$(LIBDIROCP)/autoload/95-playym$(LIB_SUFFIX)" 32 | 33 | clean: 34 | $(MAKE) -C lzh clean TOPDIR="../$(TOPDIR)" 35 | $(MAKE) -C stsoundlib clean TOPDIR="../$(TOPDIR)" 36 | rm -f *.o *$(LIB_SUFFIX) 37 | 38 | playym_so=ympplay.o ymplay.o stsoundlib/libym.a ymtype.o 39 | ifeq ($(HAVE_LZH),1) 40 | playym_so+=lzh/liblzh.a 41 | endif 42 | playym$(LIB_SUFFIX): $(playym_so) 43 | $(CXX) $(SHARED_FLAGS) $(LDFLAGS) -o $@ $(playym_so) $(LZH_LIB) -lym -Llzh -Lstsoundlib 44 | 45 | ymtype.o: ymtype.cpp \ 46 | ../config.h \ 47 | ../types.h \ 48 | ../boot/plinkman.h \ 49 | ../filesel/filesystem.h \ 50 | ../filesel/mdb.h \ 51 | ../filesel/pfilesel.h \ 52 | ../stuff/err.h \ 53 | lzh/lzh.h \ 54 | ymtype.h 55 | $(CXX) ymtype.cpp -o $@ -c 56 | 57 | ympplay.o: ympplay.cpp \ 58 | ../config.h \ 59 | ../types.h \ 60 | ../boot/plinkman.h \ 61 | ../boot/psetting.h \ 62 | ../cpiface/cpiface.h \ 63 | ../dev/player.h \ 64 | ../filesel/dirdb.h \ 65 | ../filesel/filesystem.h \ 66 | ../filesel/mdb.h \ 67 | ../filesel/pfilesel.h \ 68 | ../stuff/compat.h \ 69 | ../stuff/poutput.h \ 70 | ../stuff/err.h \ 71 | ../stuff/sets.h \ 72 | stsoundlib/StSoundLibrary.h \ 73 | ymplay.h \ 74 | ymtype.h 75 | $(CXX) ympplay.cpp -o $@ -c 76 | 77 | ymplay.o: ymplay.cpp \ 78 | ../config.h \ 79 | ../types.h \ 80 | ../cpiface/cpiface.h \ 81 | ../dev/mcp.h \ 82 | ../dev/player.h \ 83 | ../dev/ringbuffer.h \ 84 | ../filesel/filesystem.h \ 85 | ../stuff/err.h \ 86 | ../stuff/imsrtns.h \ 87 | ymplay.h \ 88 | stsoundlib/YmMusic.h 89 | $(CXX) ymplay.cpp -o $@ -c 90 | -------------------------------------------------------------------------------- /filesel/filesystem-setup.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 2020-'25 Stian Skjelstad 3 | * 4 | * Code to handle the virtual drive SETUP: 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "config.h" 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "types.h" 27 | #include "dirdb.h" 28 | #include "filesystem.h" 29 | #include "filesystem-dir-mem.h" 30 | #include "filesystem-drive.h" 31 | #include "filesystem-setup.h" 32 | #include "pfilesel.h" 33 | 34 | struct dmDrive *dmSetup; 35 | struct ocpdir_mem_t *setup_root; 36 | 37 | void filesystem_setup_register (void) 38 | { 39 | struct ocpdir_t *t; 40 | setup_root = ocpdir_mem_alloc (0, "setup:"); 41 | if (!setup_root) 42 | { 43 | fprintf (stderr, "filesystem_setup_register(): out of memory!\n"); 44 | return; 45 | } 46 | 47 | t = ocpdir_mem_getdir_t (setup_root); 48 | dmSetup = RegisterDrive("setup:", t, t); 49 | t->unref (t); 50 | } 51 | 52 | void filesystem_setup_register_dir (struct ocpdir_t *dir) 53 | { 54 | ocpdir_mem_add_dir (setup_root, dir); 55 | } 56 | 57 | void filesystem_setup_unregister_dir (struct ocpdir_t *dir) 58 | { 59 | ocpdir_mem_remove_dir (setup_root, dir); 60 | } 61 | 62 | void filesystem_setup_register_file (struct ocpfile_t *file) 63 | { 64 | ocpdir_mem_add_file (setup_root, file); 65 | } 66 | 67 | void filesystem_setup_unregister_file (struct ocpfile_t *file) 68 | { 69 | ocpdir_mem_remove_file (setup_root, file); 70 | } 71 | -------------------------------------------------------------------------------- /filesel/cdfs/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../../ 2 | include $(TOPDIR)Rules.make 3 | include Makefile-static 4 | 5 | ifeq ($(STATIC_CORE),1) 6 | all: $(cdfs_so) 7 | else 8 | all: cdfs$(LIB_SUFFIX) 9 | endif 10 | 11 | clean: 12 | rm -f cdfs$(LIB_SUFFIX) *.o 13 | 14 | ifeq ($(STATIC_CORE),1) 15 | install: 16 | uninstall: 17 | else 18 | install: 19 | $(CP) cdfs$(LIB_SUFFIX) "$(DESTDIR)$(LIBDIROCP)/autoload/60-cdfs$(LIB_SUFFIX)" 20 | uninstall: 21 | rm -f "$(DESTDIR)$(LIBDIROCP)/autoload/60-cdfs$(LIB_SUFFIX)" 22 | endif 23 | 24 | .PHONY: all clean install uninstall 25 | 26 | cdfs$(LIB_SUFFIX): $(cdfs_so) 27 | $(CC) $(SHARED_FLAGS) $(ICONV_LIBS) -o $@ $^ $(LIBDISCID_LIBS) 28 | 29 | audio.o: \ 30 | audio.c \ 31 | ../../config.h \ 32 | ../../types.h \ 33 | audio.h \ 34 | ../musicbrainz.h \ 35 | cdfs.h 36 | $(CC) $< -o $@ -c $(LIBDISCID_CFLAGS) 37 | 38 | cdfs.o: \ 39 | cdfs.c \ 40 | ../../config.h \ 41 | ../../types.h \ 42 | cdfs.h \ 43 | iso9660.h \ 44 | ../dirdb.h \ 45 | ../filesystem.h \ 46 | ../mdb.h \ 47 | ../musicbrainz.h \ 48 | udf.h 49 | $(CC) $< -o $@ -c 50 | 51 | cue.o: \ 52 | cue.c \ 53 | cdfs.h \ 54 | cue.h \ 55 | ../filesystem.h \ 56 | wave.h 57 | $(CC) $< -o $@ -c 58 | 59 | iso9660.o: \ 60 | iso9660.c \ 61 | ../../config.h \ 62 | ../../types.h \ 63 | ElTorito.c \ 64 | susp.c \ 65 | amiga.c \ 66 | rockridge.c \ 67 | cdfs.h \ 68 | iso9660.h \ 69 | main.h 70 | $(CC) -o $@ $< -c 71 | 72 | main.o: \ 73 | main.c \ 74 | ../../config.h \ 75 | ../../types.h \ 76 | audio.h \ 77 | cdfs.h \ 78 | cue.h \ 79 | ../../boot/plinkman.h \ 80 | ../dirdb.h \ 81 | ../filesystem.h \ 82 | iso9660.h \ 83 | main.h \ 84 | ../../stuff/err.h \ 85 | toc.h \ 86 | udf.h 87 | $(CC) -o $@ $< -c 88 | 89 | toc.o: \ 90 | toc.c \ 91 | cdfs.h \ 92 | ../filesystem.h \ 93 | toc.h \ 94 | wave.h 95 | $(CC) $< -o $@ -c 96 | 97 | 98 | udf.o: \ 99 | udf.c \ 100 | ../../config.h \ 101 | ../../types.h \ 102 | cdfs.h \ 103 | main.h \ 104 | udf.h 105 | $(CC) -o $@ $< -c 106 | 107 | wave.o: \ 108 | wave.c \ 109 | ../../config.h \ 110 | ../../types.h \ 111 | ../dirdb.h \ 112 | ../filesystem.h \ 113 | wave.h 114 | $(CC) -o $@ $< -c 115 | -------------------------------------------------------------------------------- /dev/smpman_asminc.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * Assembler/C for the sample processing routines (compression, mixer 6 | * preparation etc) 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 | * 22 | * revision history: (please note changes here) 23 | * -ss040613 Stian Skjelstad 24 | * -first release (splitted out from smpman.cpp) 25 | * -rewrote assembler to gcc 26 | * -ss040908 Stian Skjelstad 27 | * -made assembler optimitize safe 28 | */ 29 | 30 | /* included from smpman.c */ 31 | 32 | static uint32_t getpitch16(const void *ptr, unsigned long len) 33 | { 34 | uint32_t retval=0; 35 | do { 36 | uint8_t dl, dh; 37 | dl=((uint8_t *)ptr)[1]^0x80; 38 | dh=((uint8_t *)ptr)[3]^0x80; 39 | if ((dh>dl)) 40 | { 41 | dl-=dh; 42 | dh=0; 43 | } else { 44 | dl-=dh; 45 | dh=1; 46 | } 47 | retval+=abstab[(dh<<8)+dl]; 48 | ptr=((uint8_t *)ptr)+2; 49 | } while (--len); 50 | return retval; 51 | } 52 | 53 | static uint32_t getpitch(const void *ptr, unsigned long len) 54 | { 55 | uint32_t retval=0; 56 | do { 57 | uint8_t dl, dh; 58 | dl=((int8_t *)ptr)[0]^0x80; 59 | dh=((int8_t *)ptr)[1]^0x80; 60 | if ((dh>dl)) 61 | { 62 | dl-=dh; 63 | dh=0; 64 | } else { 65 | dl-=dh; 66 | dh=1; 67 | } 68 | retval+=abstab[(dh<<8)+dl]; 69 | ptr=((int8_t *)ptr)+1; 70 | } while (--len); 71 | return retval; 72 | } 73 | -------------------------------------------------------------------------------- /playhvl/hvlplay.h: -------------------------------------------------------------------------------- 1 | #ifndef __HLVPLAY_H 2 | #define __HLVPLAY_H 1 3 | 4 | struct ocpfilehandle_t; 5 | struct hvl_tune; 6 | 7 | #define current_hvl_tune ht 8 | struct cpifaceSessionAPI_t; 9 | extern OCP_INTERNAL struct hvl_tune *current_hvl_tune; 10 | int OCP_INTERNAL hvlOpenPlayer (const uint8_t *mem, size_t memlen, struct ocpfilehandle_t *file, struct cpifaceSessionAPI_t *cpifaceSession); 11 | void OCP_INTERNAL hvlClosePlayer (struct cpifaceSessionAPI_t *cpifaceSession); 12 | void OCP_INTERNAL hvlIdle (struct cpifaceSessionAPI_t *cpifaceSession); 13 | void OCP_INTERNAL hvlSetLoop (uint8_t s); 14 | char OCP_INTERNAL hvlLooped (void); 15 | void OCP_INTERNAL hvlPrevSubSong (); 16 | void OCP_INTERNAL hvlRestartSong (); 17 | void OCP_INTERNAL hvlNextSubSong (); 18 | void OCP_INTERNAL hvlGetStats (int *row, int *rows, int *order, int *orders, int *subsong, int *subsongs, int *tempo, int *speedmult); 19 | void OCP_INTERNAL hvlMute (struct cpifaceSessionAPI_t *cpifaceSession, int ch, int m); 20 | 21 | /* This is for hvlpinst.c */ 22 | extern OCP_INTERNAL uint8_t plInstUsed[256]; 23 | 24 | 25 | /* This is for hvlpchan.c */ 26 | struct hvl_chaninfo 27 | { 28 | const char *name; /* should only be set if name is non-zero-length */ 29 | uint8_t vol; 30 | uint8_t notehit; /* none-zero if note is fresh */ 31 | uint8_t note; /* need to match syntax with plNoteStr[] */ 32 | uint16_t noteperiod; 33 | uint8_t pan; 34 | uint8_t pitchslide; 35 | uint8_t volslide; 36 | int16_t ins; 37 | uint8_t fx, fxparam; /* effect for given row */ 38 | uint8_t fxB, fxBparam; /* effect B for given row (HVL files only) */ 39 | uint8_t pfx, pfxparam; /* current effect for instrument internal playlist */ 40 | uint8_t pfxB, pfxBparam; /* current effect B for instrument internal playlist (HVL files only) */ 41 | uint8_t waveform; /* 0-3 */ 42 | uint8_t filter; /* 0x00 - 0x3f */ 43 | 44 | int muted; /* force-muted - TODO */ 45 | }; 46 | OCP_INTERNAL void hvlGetChanInfo (int chan, struct hvl_chaninfo *ci); 47 | OCP_INTERNAL void hvlGetChanVolume (struct cpifaceSessionAPI_t *cpifaceSession, int chan, int *l, int *r); 48 | 49 | OCP_INTERNAL int hvlGetChanSample (struct cpifaceSessionAPI_t *cpifaceSession, unsigned int ch, int16_t *s, unsigned int len, uint32_t rate, int opt); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /stuff/file.h: -------------------------------------------------------------------------------- 1 | #ifndef _STUFF_FILE_H 2 | #define _STUFF_FILE_H 3 | 4 | /* This is for making a single code-path for data-base read-out of data. It has read-ahead-cache */ 5 | typedef struct osfile_t osfile; 6 | 7 | struct osfile_t *osfile_open_readwrite (const char *pathname, int dolock, int mustcreate); /* returns NULL on error */ 8 | 9 | struct osfile_t *osfile_open_readonly (const char *pathname, int dolock); /* returns NULL on error */ 10 | 11 | void osfile_close (struct osfile_t *f); 12 | 13 | uint64_t osfile_getfilesize (struct osfile_t *f); 14 | 15 | uint64_t osfile_getpos (struct osfile_t *f); 16 | 17 | void osfile_setpos (struct osfile_t *f, uint64_t pos); 18 | 19 | void osfile_truncate_at (struct osfile_t *f, uint64_t pos); 20 | 21 | void osfile_purge_readahead_cache (struct osfile_t *f); 22 | int64_t osfile_purge_writeback_cache (struct osfile_t *f); 23 | 24 | int64_t osfile_write (struct osfile_t *f, const void *data, uint64_t size); /* returns < 0 on error (also for partial writes) */ 25 | 26 | int64_t osfile_read (struct osfile_t *f, void *data, uint64_t size); /* returns < 0 on error, can return partial data if hitting EOF */ 27 | 28 | struct osdir_size_t 29 | { 30 | uint_fast32_t directories_n; 31 | uint_fast32_t files_n; 32 | uint64_t files_size; 33 | void *internal; 34 | }; 35 | int osdir_size_start (struct osdir_size_t *, const char *path); /* returns -1 on error, otherwize 0 */ 36 | int osdir_size_iterate (struct osdir_size_t *); /* returns 1 if more iterations are needed, otherwize 0 */ 37 | void osdir_size_cancel (struct osdir_size_t *); 38 | 39 | int osdir_trash_available (const char *path); 40 | int osdir_trash_perform (const char *path); /* -1 on error, 0 on OK */ 41 | 42 | struct osdir_delete_t 43 | { 44 | uint_fast32_t removed_directories_n; 45 | uint_fast32_t removed_files_n; 46 | uint_fast32_t failed_directories_n; 47 | uint_fast32_t failed_files_n; 48 | void *internal; 49 | }; 50 | int osdir_delete_start (struct osdir_delete_t *, const char *path); /* returns -1 on error, otherwize 0 */ 51 | int osdir_delete_iterate (struct osdir_delete_t *); /* returns 1 if more iterations are needed, otherwize 0 */ 52 | void osdir_delete_cancel (struct osdir_delete_t *); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /playym/stsoundlib/digidrum.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | 3 | ST-Sound ( YM files player library ) 4 | 5 | Sample datas of some common YM music. ( YM2 format ) 6 | YM3 or greater uses sample data inside the music file. 7 | 8 | -----------------------------------------------------------------------------*/ 9 | 10 | /*----------------------------------------------------------------------------- 11 | * ST-Sound, ATARI-ST Music Emulator 12 | * Copyright (c) 1995-1999 Arnaud Carre ( http://leonard.oxg.free.fr ) 13 | * All rights reserved. 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in the 22 | * documentation and/or other materials provided with the distribution. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | * SUCH DAMAGE. 35 | * 36 | -----------------------------------------------------------------------------*/ 37 | 38 | #ifndef __DIGIDRUM__ 39 | #define __DIGIDRUM__ 40 | 41 | #define MAX_DIGIDRUM 40 42 | 43 | #define sampleAdress ymsampleAdress 44 | #define sampleLen ymsampleLen 45 | 46 | extern ymu8 * sampleAdress[MAX_DIGIDRUM]; 47 | extern ymu32 sampleLen[MAX_DIGIDRUM]; 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /filesel/cphlpfs.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Sebastian Skjelstad 4 | * 5 | * CP hypertext help viewer (Fileselector wrapper) 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -fg980924 Fabian Giesen 23 | * -first release 24 | */ 25 | 26 | #include "config.h" 27 | #include "types.h" 28 | #include "cphlpfs.h" 29 | #include "help/cphelper.h" 30 | #include "stuff/poutput.h" 31 | #include "stuff/framelock.h" 32 | 33 | int fsmode; 34 | 35 | /* ripped from fileselector */ 36 | 37 | 38 | /* the wrapper */ 39 | 40 | static int plHelpKey(unsigned short key) 41 | { 42 | switch(key) 43 | { 44 | case 'h': case 'H': case '?': case '!': case KEY_F(1): case KEY_ESC: case KEY_EXIT: 45 | fsmode=0; 46 | break; 47 | default: 48 | return brHelpKey(key); 49 | } 50 | return 1; 51 | } 52 | 53 | unsigned char fsHelp2(void) 54 | { 55 | helppage *cont; 56 | 57 | plSetTextMode(0); 58 | 59 | cont=brDecodeRef("Contents"); 60 | 61 | if (!cont) 62 | displaystr(1, 0, 0x04, "shit!", 5); 63 | 64 | brSetPage(cont); 65 | 66 | brSetWinStart(2); 67 | brSetWinHeight(plScrHeight-2); 68 | 69 | fsmode=1; 70 | 71 | while (fsmode) 72 | { 73 | unsigned short key; 74 | 75 | make_title ("opencp help", 0); 76 | 77 | brSetWinHeight(plScrHeight-2); 78 | 79 | brDisplayHelp(); 80 | 81 | while (!Console.KeyboardHit()) 82 | { 83 | framelock(); 84 | } 85 | key = Console.KeyboardGetChar(); 86 | 87 | plHelpKey(key); 88 | framelock(); 89 | }; 90 | 91 | return 1; 92 | } 93 | -------------------------------------------------------------------------------- /stuff/poll.c: -------------------------------------------------------------------------------- 1 | /* OpenCP Module Player 2 | * copyright (c) 1994-'10 Niklas Beisert 3 | * copyright (c) 2004-'25 Stian Skjelstad 4 | * 5 | * Systemtimer handlers 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * revision history: (please note changes here) 22 | * -nb980510 Niklas Beisert 23 | * -first release 24 | * -doj990328 Dirk Jagdmann 25 | * -changed interrupt access calls to calls from irq.h 26 | * -fd990518 Felix Domke 27 | * -added CLD after the tmOldTimer-call. 28 | * this removed the devwmix*-STRANGEBUG. (finally, i hope) 29 | * -fd990817 Felix Domke 30 | * -added tmSetSecure/tmReleaseSecure to ensure that timer is only 31 | * called when not "indos". needed for devpVXD (and some other maybe). 32 | * -ss040613 Stian Skjelstad 33 | * -Rewritten to use the posix itimer, and posix signals to fetch them 34 | * --ss040907 Stian Skjelstad 35 | * -Use gettimeofday() to calculate cpu-usage, since itimer() uses rounded off values 36 | */ 37 | 38 | #include "config.h" 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "types.h" 45 | #include "imsrtns.h" 46 | #include "poll.h" 47 | 48 | static void (*tmTimerRoutineSlave)()=NULL; 49 | 50 | void tmTimerHandler(void) 51 | { 52 | if (tmTimerRoutineSlave) 53 | tmTimerRoutineSlave(); 54 | } 55 | 56 | int pollInit(void (*f)(void)) 57 | { 58 | tmTimerRoutineSlave=f; 59 | return 1; 60 | } 61 | 62 | void pollClose(void) 63 | { 64 | tmTimerRoutineSlave=0; 65 | } 66 | -------------------------------------------------------------------------------- /filesel/modlist.h: -------------------------------------------------------------------------------- 1 | #ifndef _DIRLIST_H 2 | #define _DIRLIST_H 3 | 4 | struct ocpdir_t; 5 | struct ocpfile_t; 6 | 7 | struct modlistentry 8 | { 9 | char utf8_8_dot_3 [12*4+1]; /* UTF-8 ready */ 10 | char utf8_16_dot_3 [20*4+1]; /* UTF-8 ready */ 11 | char *utf8_casefolded; 12 | 13 | #define MODLIST_FLAG_DRV 1 14 | #define MODLIST_FLAG_DOTDOT 2 15 | #define MODLIST_FLAG_SCANNED 4 16 | #define MODLIST_FLAG_ISMOD 8 17 | int flags; 18 | 19 | uint32_t mdb_ref; 20 | struct ocpdir_t *dir; 21 | struct ocpfile_t *file; 22 | }; 23 | 24 | struct modlist 25 | { 26 | int *sortindex; /* presented order, and most API works on this list */ 27 | struct modlistentry *files; 28 | 29 | /* these are used by external */ 30 | unsigned int pos; /* position - will be zero if num is zero */ 31 | 32 | unsigned int max; /* current array size */ 33 | unsigned int num; /* entries used */ 34 | }; 35 | 36 | struct dmDrive; 37 | 38 | struct modlist *modlist_create(void); 39 | void modlist_free(struct modlist *modlist); 40 | void modlist_sort(struct modlist *modlist); 41 | void modlist_subsort_filesonly_groupdir (struct modlist *modlist, unsigned int pos, unsigned int length); /* sorts a slice of the list */ 42 | void modlist_append(struct modlist *modlist, struct modlistentry *entry); 43 | void modlist_append_dir (struct modlist *modlist, struct ocpdir_t *dir); 44 | void modlist_append_dotdot (struct modlist *modlist, struct ocpdir_t *dir); 45 | void modlist_append_drive (struct modlist *modlist, struct dmDrive *drive); 46 | void modlist_append_file (struct modlist *modlist, struct ocpfile_t *file, int ismod, int prescanhint, struct ocpfilehandle_t **retain); /* if file is stored SOLID, trigger a mdb scan if needed */ 47 | 48 | void modlist_swap(struct modlist *modlist, unsigned int index1, unsigned int index2); 49 | void modlist_clear(struct modlist *modlist); 50 | void modlist_remove(struct modlist *modlist, unsigned int index); /* by sortindex */ 51 | void modlist_remove_all_by_path(struct modlist *modlist, uint32_t ref); 52 | int modlist_find(struct modlist *modlist, const uint32_t path); 53 | int modlist_fuzzyfind(struct modlist *modlist, const char *filename); 54 | struct modlistentry *modlist_get(const struct modlist *modlist, unsigned int index); 55 | struct modlistentry *modlist_getcur(const struct modlist *modlist); /* does not Ref() */ 56 | void modlist_append_modlist(struct modlist *target, struct modlist *source); 57 | 58 | #endif 59 | --------------------------------------------------------------------------------