diff options
author | Max Horn | 2003-07-31 12:33:33 +0000 |
---|---|---|
committer | Max Horn | 2003-07-31 12:33:33 +0000 |
commit | 1b52e9f19cec1693dc9331b0d503aff07f507427 (patch) | |
tree | b58aeeb9e9156a9c3b7477c6116da3f78ee07675 | |
parent | f7ee6d2ce10fb215067ee1a32d4cb124aaa881af (diff) | |
download | scummvm-rg350-1b52e9f19cec1693dc9331b0d503aff07f507427.tar.gz scummvm-rg350-1b52e9f19cec1693dc9331b0d503aff07f507427.tar.bz2 scummvm-rg350-1b52e9f19cec1693dc9331b0d503aff07f507427.zip |
added new header file backends/intern.h; removed some stuff from common/system.h which is either only of interest to backends or code instantiating a backend (->backends/intern.h); also removed fmopl specific enums (->sound/fmopl.h)
svn-id: r9327
-rw-r--r-- | backends/gp32/gp32.h | 1 | ||||
-rw-r--r-- | backends/intern.h | 50 | ||||
-rw-r--r-- | backends/morphos/morphos.h | 1 | ||||
-rw-r--r-- | backends/sdl/sdl-common.h | 1 | ||||
-rw-r--r-- | backends/wince/wince.h | 2 | ||||
-rw-r--r-- | backends/x11/x11.cpp | 9 | ||||
-rw-r--r-- | common/gameDetector.cpp | 1 | ||||
-rw-r--r-- | common/system.h | 29 | ||||
-rw-r--r-- | sound/fmopl.h | 13 |
9 files changed, 71 insertions, 36 deletions
diff --git a/backends/gp32/gp32.h b/backends/gp32/gp32.h index 61ca9e7a37..b38912ccf2 100644 --- a/backends/gp32/gp32.h +++ b/backends/gp32/gp32.h @@ -19,6 +19,7 @@ */ +#include "backends/intern.h" #include "common/stdafx.h" #include "common/scummsys.h" #include "common/system.h" diff --git a/backends/intern.h b/backends/intern.h new file mode 100644 index 0000000000..1b4dae170f --- /dev/null +++ b/backends/intern.h @@ -0,0 +1,50 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001-2003 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef BACKENDS_INTERN_H +#define BACKENDS_INTERN_H + +#include "common/system.h" + +/* Factory functions. This means we don't have to include the headers for + * all backends. + */ +extern OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen, bool aspect_ratio); +extern OSystem *OSystem_NULL_create(); +extern OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen); +extern OSystem *OSystem_Dreamcast_create(); +extern OSystem *OSystem_WINCE3_create(); +extern OSystem *OSystem_X11_create(); +extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen); +extern OSystem *OSystem_GP32_create(int gfx_mode, bool full_screen); //ph0x +extern OSystem *OSystem_PALMOS_create(int gfx_mode); + + +#ifdef _WIN32_WCE +#define SAMPLES_PER_SEC_OLD 11025 +#define SAMPLES_PER_SEC_NEW 22050 +#else +//#define SAMPLES_PER_SEC 11025 +#define SAMPLES_PER_SEC 22050 +//#define SAMPLES_PER_SEC 44100 +#endif + +#endif diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h index ff4052f7bc..cb0e858528 100644 --- a/backends/morphos/morphos.h +++ b/backends/morphos/morphos.h @@ -31,6 +31,7 @@ #include <libraries/cdda.h> #include <proto/exec.h> +#include "backends/intern.h" #include "morphos_scaler.h" class OSystem_MorphOS : public OSystem diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 917d641b38..b1024d1f15 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -25,6 +25,7 @@ #include "stdafx.h" #include "scummsys.h" #include "system.h" +#include "backends/intern.h" #include <SDL.h> #include <SDL_thread.h> diff --git a/backends/wince/wince.h b/backends/wince/wince.h index 2bc05abf0e..4f85f6d459 100644 --- a/backends/wince/wince.h +++ b/backends/wince/wince.h @@ -20,7 +20,7 @@ */ #include "stdafx.h" -#include <assert.h> +#include "backends/intern.h" //#include "commctrl.h" diff --git a/backends/x11/x11.cpp b/backends/x11/x11.cpp index 026dbeb148..f146f02824 100644 --- a/backends/x11/x11.cpp +++ b/backends/x11/x11.cpp @@ -22,6 +22,7 @@ /* The bare pure X11 port done by Lionel 'BBrox' Ulmer */ +#include "backends/intern.h" #include "common/util.h" #include "common/engine.h" // Only #included for error() and warning() @@ -254,13 +255,13 @@ static void *sound_and_music_thread(void *params) error("Stereo mode not supported !\n"); exit(1); } - param = 22050; + param = SAMPLES_PER_SEC; if (ioctl(sound_fd, SNDCTL_DSP_SPEED, ¶m) == -1) { perror("Error in the SNDCTL_DSP_SPEED ioctl !\n"); exit(1); } - if (param != 22050) { - error("22050 kHz not supported !\n"); + if (param != SAMPLES_PER_SEC) { + error("%d kHz not supported !\n", SAMPLES_PER_SEC); exit(1); } if (ioctl(sound_fd, SNDCTL_DSP_GETOSPACE, &info) != 0) { @@ -788,7 +789,7 @@ uint32 OSystem_X11::property(int param, Property *value) { switch (param) { case PROP_GET_SAMPLE_RATE: - return 22050; + return SAMPLES_PER_SEC; case PROP_GET_FULLSCREEN: return 0; } diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index af2061a712..7ac15e925b 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -21,6 +21,7 @@ */ #include "stdafx.h" +#include "backends/intern.h" #include "sound/mididrv.h" #include "engine.h" #include "gameDetector.h" diff --git a/common/system.h b/common/system.h index aaf2df4cda..029206d263 100644 --- a/common/system.h +++ b/common/system.h @@ -362,33 +362,4 @@ public: //@} }; -/* Factory functions. This means we don't have to include the headers for - * all backends. - */ -extern OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen, bool aspect_ratio); -extern OSystem *OSystem_NULL_create(); -extern OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen); -extern OSystem *OSystem_Dreamcast_create(); -extern OSystem *OSystem_WINCE3_create(); -extern OSystem *OSystem_X11_create(); -extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen); -extern OSystem *OSystem_GP32_create(int gfx_mode, bool full_screen); //ph0x -extern OSystem *OSystem_PALMOS_create(int gfx_mode); - -#ifdef _WIN32_WCE -#define SAMPLES_PER_SEC_OLD 11025 -#define SAMPLES_PER_SEC_NEW 22050 -#else -//#define SAMPLES_PER_SEC 11025 -#define SAMPLES_PER_SEC 22050 -//#define SAMPLES_PER_SEC 44100 -#endif - -enum { - FMOPL_ENV_BITS_HQ = 16, - FMOPL_ENV_BITS_LQ = 8, - FMOPL_EG_ENT_HQ = 4096, - FMOPL_EG_ENT_LQ = 128 -}; - #endif diff --git a/sound/fmopl.h b/sound/fmopl.h index 8fbeb175e3..5faed21849 100644 --- a/sound/fmopl.h +++ b/sound/fmopl.h @@ -23,10 +23,19 @@ */ -#ifndef __FMOPL_H_ -#define __FMOPL_H_ +#ifndef FMOPL_H_ +#define FMOPL_H_ + #include "scummsys.h" +enum { + FMOPL_ENV_BITS_HQ = 16, + FMOPL_ENV_BITS_LQ = 8, + FMOPL_EG_ENT_HQ = 4096, + FMOPL_EG_ENT_LQ = 128 +}; + + typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec); typedef void (*OPL_IRQHANDLER)(int param,int irq); typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us); |