From 103121119d2761c841ed3247b6f428fa972b84a2 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 18 Jul 2002 08:22:18 +0000 Subject: [PATCH] changed cdrom->rbaudio --- arch/dos/Makefile.am | 2 +- arch/dos/{cdrom.c => rbaudio.c} | 11 +++++++---- arch/sdl/Makefile.am | 2 +- arch/sdl/{cdrom.c => rbaudio.c} | 21 +++++++-------------- include/rbaudio.h | 3 +-- main/Makefile.am | 2 +- main/cdrom.h | 13 ------------- main/gamecntl.c | 2 +- main/songs.c | 6 +++--- 9 files changed, 22 insertions(+), 40 deletions(-) rename arch/dos/{cdrom.c => rbaudio.c} (81%) rename arch/sdl/{cdrom.c => rbaudio.c} (79%) delete mode 100644 main/cdrom.h diff --git a/arch/dos/Makefile.am b/arch/dos/Makefile.am index 8df833ab..f96fa2df 100644 --- a/arch/dos/Makefile.am +++ b/arch/dos/Makefile.am @@ -5,7 +5,7 @@ noinst_LIBRARIES = libarch_dos.a INCLUDES = -I$(top_srcdir)/arch/include -I$(top_srcdir)/include -I$(top_srcdir)/main -I$(srcdir)/include libarch_dos_a_SOURCES = \ -cdrom.c digi.c dpmi.c findfile.c gr.c init.c ipx.c joyc.c joydefs.c key.c mouse.c vesa.c +digi.c dpmi.c findfile.c gr.c init.c ipx.c joyc.c joydefs.c key.c mouse.c rbaudio.c vesa.c SUFFIXES = .asm %.o: %.asm diff --git a/arch/dos/cdrom.c b/arch/dos/rbaudio.c similarity index 81% rename from arch/dos/cdrom.c rename to arch/dos/rbaudio.c index bb94ff95..dce0db47 100644 --- a/arch/dos/cdrom.c +++ b/arch/dos/rbaudio.c @@ -1,13 +1,16 @@ /* - * $Source: /cvs/cvsroot/d2x/arch/dos/cdrom.c,v $ - * $Revision: 1.3 $ + * $Source: /cvs/cvsroot/d2x/arch/dos/rbaudio.c,v $ + * $Revision: 1.1 $ * $Author: bradleyb $ - * $Date: 2001-10-25 08:25:33 $ + * $Date: 2002-07-18 08:22:18 $ * * DPH: This is the file where all the stub functions go. * The aim is to have nothing in here, eventually * * $Log: not supported by cvs2svn $ + * Revision 1.3 2001/10/25 08:25:33 bradleyb + * Finished moving stuff to arch/blah. I know, it's ugly, but It'll be easier to sync with d1x. + * * Revision 1.3 2001/01/31 14:04:45 bradleyb * Fix compiler warnings * @@ -25,7 +28,7 @@ #include "pstypes.h" #include "error.h" #include "args.h" - +#include "rbaudio.h" extern int Redbook_playing; static int initialised = 0; diff --git a/arch/sdl/Makefile.am b/arch/sdl/Makefile.am index cbee1a27..31981731 100644 --- a/arch/sdl/Makefile.am +++ b/arch/sdl/Makefile.am @@ -17,7 +17,7 @@ VIDEO_SRCS = gr.c endif libarch_sdl_a_SOURCES = ${JOYSTICK_SRCS} ${VIDEO_SRCS} ${INPUT_SRCS} \ -cdrom.c digi.c init.c timer.c +digi.c init.c rbaudio.c timer.c EXTRA_libarch_sdl_a_SOURCES = \ event.c gr.c joy.c joydefs.c key.c mouse.c diff --git a/arch/sdl/cdrom.c b/arch/sdl/rbaudio.c similarity index 79% rename from arch/sdl/cdrom.c rename to arch/sdl/rbaudio.c index e4018678..8ef74952 100644 --- a/arch/sdl/cdrom.c +++ b/arch/sdl/rbaudio.c @@ -1,15 +1,7 @@ +/* $Id: rbaudio.c,v 1.1 2002-07-18 08:22:18 bradleyb Exp $ */ /* - * $Source: /cvs/cvsroot/d2x/arch/sdl/cdrom.c,v $ - * $Revision: 1.1 $ - * $Author: bradleyb $ - * $Date: 2001-10-25 08:25:34 $ * - * DPH: This is the file where all the stub functions go. - * The aim is to have nothing in here, eventually - * - * $Log: not supported by cvs2svn $ - * Revision 1.3 2001/01/29 13:53:28 bradleyb - * Fixed build, minor fixes + * SDL CD Audio functions * */ @@ -24,7 +16,7 @@ #include "pstypes.h" #include "error.h" #include "args.h" - +#include "rbaudio.h" static SDL_CD *s_cd = NULL; extern int Redbook_playing; @@ -97,10 +89,11 @@ void RBAPause() SDL_CDPause(s_cd); } -void RBAResume() +int RBAResume() { - if (!initialised) return; + if (!initialised) return -1; SDL_CDResume(s_cd); + return 1; } int RBAGetNumberOfTracks() @@ -128,7 +121,7 @@ int RBAGetTrackNum() int RBAPeekPlayStatus() { - return 1; + return (SDL_CDStatus(s_cd) == CD_PLAYING); } int CD_blast_mixer() diff --git a/include/rbaudio.h b/include/rbaudio.h index 9692f147..d0834b12 100644 --- a/include/rbaudio.h +++ b/include/rbaudio.h @@ -25,8 +25,7 @@ typedef struct _RBACHANNELCTL { unsigned int out3in, out3vol; } RBACHANNELCTL; - -#if defined(__NT__) +#ifndef __MSDOS__ //defined(__NT__) extern void RBAInit(void); //drive a == 0, drive b == 1 #else extern void RBAInit(ubyte cd_drive_num); //drive a == 0, drive b == 1 diff --git a/main/Makefile.am b/main/Makefile.am index 8408e2f7..93a8fba6 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -51,7 +51,7 @@ ip_base.cpp ipclient.cpp EXTRA_DIST = ${EXTRA_SUBDIRS} \ descent.cfg inferno.ini \ link.bat \ -ai.h aistruct.h automap.h bm.h bmread.h cdrom.h cntrlcen.h collide.h \ +ai.h aistruct.h automap.h bm.h bmread.h cntrlcen.h collide.h \ compbit.h config.h controls.h credits.h desc_id.h desw.h digi.h effects.h \ endlevel.h fireball.h fuelcen.h fvi.h fvi_a.h game.h gamefont.h gamemine.h \ gamepal.h gamesave.h gameseg.h gameseq.h gamestat.h gauges.h hostage.h \ diff --git a/main/cdrom.h b/main/cdrom.h deleted file mode 100644 index 1a06c72d..00000000 --- a/main/cdrom.h +++ /dev/null @@ -1,13 +0,0 @@ -void RBAExit(); -void RBAInit(); -int RBAEnabled(); -void RBARegisterCD(); -int RBAPlayTrack(int a); -void RBAStop(); -void RBASetVolume(int a); -void RBAPause(); -void RBAResume(); -int RBAGetNumberOfTracks(); -int RBAPlayTracks(int tracknum,int something); -int RBAGetTrackNum(); -int RBAPeekPlayStatus(); diff --git a/main/gamecntl.c b/main/gamecntl.c index 3b4b887a..04da5df9 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -94,8 +94,8 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "piggy.h" #include "multibot.h" #include "ai.h" +#include "rbaudio.h" #include "switch.h" -#include "cdrom.h" #ifdef POLY_ACC #include "poly_acc.h" diff --git a/main/songs.c b/main/songs.c index 0e700acf..2e32ca3c 100644 --- a/main/songs.c +++ b/main/songs.c @@ -29,9 +29,9 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "mono.h" #include "cfile.h" #include "digi.h" +#include "rbaudio.h" #include "kconfig.h" #include "timer.h" -#include "cdrom.h" song_info Songs[MAX_NUM_SONGS]; int Songs_initialized = 0; @@ -121,7 +121,7 @@ void songs_init() } else // use redbook { - #if defined(WINDOWS) || defined(MACINTOSH) + #ifndef __MSDOS__ // defined(WINDOWS) || defined(MACINTOSH) RBAInit(); #else RBAInit(toupper(CDROM_dir[0]) - 'A'); @@ -180,7 +180,7 @@ int force_rb_register=0; void reinit_redbook() { - #if defined(WINDOWS) || defined(MACINTOSH) + #ifndef __MSDOS__ // defined(WINDOWS) || defined(MACINTOSH) RBAInit(); #else RBAInit(toupper(CDROM_dir[0]) - 'A'); -- 2.39.2