Finally added the required modifications to the SDL port for

compilation in Windows.  There's still some work to do in the
SettingsWin32 class, and tweaking of the sound, but it's pretty
close.  I think its the best that Stella has ever sounded on
Windows ...

I use the MingW32 environment with the Ming SDL libs from libsdl,org.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@226 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2003-12-04 22:22:53 +00:00
parent 083245cf9c
commit 41556196e4
7 changed files with 762 additions and 448 deletions

View File

@ -1,430 +1,448 @@
##============================================================================ ##============================================================================
## ##
## SSSS tt lll lll ## SSSS tt lll lll
## SS SS tt ll ll ## SS SS tt ll ll
## SS tttttt eeee ll ll aaaa ## SS tttttt eeee ll ll aaaa
## SSSS tt ee ee ll ll aa ## SSSS tt ee ee ll ll aa
## SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" ## SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
## SS SS tt ee ll ll aa aa ## SS SS tt ee ll ll aa aa
## SSSS ttt eeeee llll llll aaaaa ## SSSS ttt eeeee llll llll aaaaa
## ##
## Copyright (c) 1995-1999 by Bradford W. Mott ## Copyright (c) 1995-1999 by Bradford W. Mott
## ##
## See the file "license" for information on usage and redistribution of ## See the file "license" for information on usage and redistribution of
## this file, and for a DISCLAIMER OF ALL WARRANTIES. ## this file, and for a DISCLAIMER OF ALL WARRANTIES.
## ##
## $Id: makefile,v 1.45 2003-11-09 23:53:19 stephena Exp $ ## $Id: makefile,v 1.46 2003-12-04 22:22:53 stephena Exp $
##============================================================================ ##============================================================================
##============================================================================ ##============================================================================
## Development environment options ## Development environment options
## ##
## The following options are used during compiling. ## The following options are used during compiling.
## Comment a line out to disable that option, remove comment to enable it. ## Comment a line out to disable that option, remove comment to enable it.
##============================================================================ ##============================================================================
OPTIMIZATIONS = $(CXXFLAGS) -Wall -Wunused OPTIMIZATIONS = $(CXXFLAGS) -Wall -Wunused
### which sound drivers to compile for the SDL version ### which sound drivers to compile for the SDL version
### OSS is most compatible, SDL for platforms where OSS not available ### OSS is most compatible, SDL for platforms where OSS not available
### comment out all lines to completely disable sound ### comment out all lines to completely disable sound
### ###
#SOUND_ALSA = 1 #SOUND_ALSA = 1
SOUND_OSS = 1 #SOUND_OSS = 1
#SOUND_SDL = 1 SOUND_SDL = 1
### to include OpenGL video support (SDL) ### to include OpenGL video support (SDL)
# OPENGL_SUPPORT = 1 OPENGL_SUPPORT = 1
### to include joystick support (SDL) ### to include joystick support (SDL)
# JOYSTICK_SUPPORT = 1 JOYSTICK_SUPPORT = 1
### to include support for saving snapshots in png format ### to include support for saving snapshots in png format
### (requires PNG library) FIXME ### (requires PNG library) FIXME
### Only SDL port supported for now FIXME ### Only SDL port supported for now FIXME
# SNAPSHOT_SUPPORT = 1 # SNAPSHOT_SUPPORT = 1
### comment this out if your system doesn't ### comment this out if your system doesn't
### have the gettimeofday function ### have the gettimeofday function
HAVE_GETTIMEOFDAY = 1 #HAVE_GETTIMEOFDAY = 1
### to include support for game developers ### to include support for game developers
### enables some extra commandline options that allow the user ### enables some extra commandline options that allow the user
### to override some emulation defaults ### to override some emulation defaults
### Only SDL port supported for now ### Only SDL port supported for now
# DEVELOPER_SUPPORT = 1 DEVELOPER_SUPPORT = 1
### if your C++ compiler doesn't support the bool type ### if your C++ compiler doesn't support the bool type
# BSPF_BOOL = 1 # BSPF_BOOL = 1
### if your want some timing information displayed when you exit the program ### if your want some timing information displayed when you exit the program
# SHOW_TIMING = 1 # SHOW_TIMING = 1
### you want a 6507 trace written to stdout ### you want a 6507 trace written to stdout
# DEBUG = 1 # DEBUG = 1
##============================================================================ ##============================================================================
## All done, type make to get a list of frontends ## All done, type make to get a list of frontends
## No configurable options below this line ... ## No configurable options below this line ...
##============================================================================ ##============================================================================
CXX = g++ CXX = g++
LD = g++ LD = g++
LDFLAGS = LDFLAGS =
LDLIBS = LDLIBS =
OBJS.SDL = OBJS.SDL =
OPTS.SDL = OPTS.SDL =
LIBS.SDL = `sdl-config --libs` LIBS.SDL = `sdl-config --libs`
CFLAGS.SDL = `sdl-config --cflags` CFLAGS.SDL = `sdl-config --cflags`
OPTS.DOS = -DDOS=1 OPTS.DOS = -DDOS=1
SRC = .. SRC = ..
CORE = $(SRC)/emucore CORE = $(SRC)/emucore
UI = $(SRC)/ui UI = $(SRC)/ui
COMMON = $(SRC)/ui/common COMMON = $(SRC)/ui/common
INCLUDES = -I. -I$(CORE) -I$(CORE)/m6502/src -I$(CORE)/m6502/src/bspf/src -I$(COMMON) INCLUDES = -I. -I$(CORE) -I$(CORE)/m6502/src -I$(CORE)/m6502/src/bspf/src -I$(COMMON)
FLAGS = $(OPTIMIZATIONS) $(INCLUDES) $(SYS_INCLUDES) FLAGS = $(OPTIMIZATIONS) $(INCLUDES) $(SYS_INCLUDES)
## set the user-defined options ## set the user-defined options
ifdef BSPF_BOOL ifdef BSPF_BOOL
OPTS.DOS += -DBSPF_BOOL=1 OPTS.DOS += -DBSPF_BOOL=1
endif endif
ifdef SHOW_TIMING ifdef SHOW_TIMING
OPTS.SDL += -DSHOW_TIMING=1 OPTS.SDL += -DSHOW_TIMING=1
OPTS.DOS += -DSHOW_TIMING=1 OPTS.DOS += -DSHOW_TIMING=1
endif endif
ifdef DEBUG ifdef DEBUG
OPTS.SDL += -DDEBUG=1 OPTS.SDL += -DDEBUG=1
OPTS.DOS += -DDEBUG=1 OPTS.DOS += -DDEBUG=1
endif endif
ifdef JOYSTICK_SUPPORT ifdef JOYSTICK_SUPPORT
OPTS.SDL += -DHAVE_JOYSTICK=1 OPTS.SDL += -DHAVE_JOYSTICK=1
endif endif
ifdef SNAPSHOT_SUPPORT ifdef SNAPSHOT_SUPPORT
OBJS.SDL += Snapshot.o OBJS.SDL += Snapshot.o
OPTS.SDL += -DSNAPSHOT_SUPPORT=1 OPTS.SDL += -DSNAPSHOT_SUPPORT=1
LIBS.SDL += -lpng -lz LIBS.SDL += -lpng -lz
endif endif
ifdef HAVE_GETTIMEOFDAY ifdef HAVE_GETTIMEOFDAY
OPTS.SDL += -DHAVE_GETTIMEOFDAY=1 OPTS.SDL += -DHAVE_GETTIMEOFDAY=1
endif endif
ifdef DEVELOPER_SUPPORT ifdef DEVELOPER_SUPPORT
OPTS.SDL += -DDEVELOPER_SUPPORT=1 OPTS.SDL += -DDEVELOPER_SUPPORT=1
OPTS.DOS += -DDEVELOPER_SUPPORT=1 OPTS.DOS += -DDEVELOPER_SUPPORT=1
endif endif
ifeq ($(SOUND_OSS), 1) ifeq ($(sounD_OSS), 1)
OPTS.SDL += -DSOUND_OSS=1 OPTS.SDL += -DSOUND_OSS=1
OBJS.SDL += SoundOSS.o OBJS.SDL += SoundOSS.o
endif endif
ifeq ($(SOUND_SDL), 1) ifeq ($(SOUND_SDL), 1)
OPTS.SDL += -DSOUND_SDL=1 OPTS.SDL += -DSOUND_SDL=1
OBJS.SDL += SoundSDL.o OBJS.SDL += SoundSDL.o
endif endif
ifeq ($(SOUND_ALSA), 1) ifeq ($(SOUND_ALSA), 1)
OPTS.SDL += -DSOUND_ALSA=1 OPTS.SDL += -DSOUND_ALSA=1
OBJS.SDL += SoundALSA.o OBJS.SDL += SoundALSA.o
LIBS.SDL += -lasound LIBS.SDL += -lasound
endif endif
ifeq ($(OPENGL_SUPPORT), 1) ifeq ($(OPENGL_SUPPORT), 1)
OPTS.SDL += -DDISPLAY_OPENGL=1 OPTS.SDL += -DDISPLAY_OPENGL=1
OBJS.SDL += FrameBufferGL.o OBJS.SDL += FrameBufferGL.o
LIBS.SDL += -lGL -lGLU LIBS.SDL += -lopengl32
endif endif
default: default:
@echo "" @echo ""
@echo "To build Stella type: 'make <version>'" @echo "To build Stella type: 'make <version>'"
@echo "You should edit the makefile for extra options" @echo "You should edit the makefile for extra options"
@echo "" @echo ""
@echo "<version> is one of:" @echo "<version> is one of:"
@echo "" @echo ""
@echo " dos DOS version using DJGPP" @echo " dos DOS version using DJGPP"
@echo " linux-sdl Linux SDL version" @echo " linux-sdl Linux SDL version"
@echo "" @echo " win32-sdl Windows SDL version"
@echo "Hopefully new versions will be added soon!" @echo ""
@echo "" @echo "Hopefully new versions will be added soon!"
@echo ""
dos:
make stella.exe \ dos:
LD="gxx" \ make stella.exe \
CXX="gcc" \ LD="gxx" \
INCLUDES="$(INCLUDES) -I$(UI)/dos -I$(UI)/sound" \ CXX="gcc" \
OPTIONS="-DBSPF_DOS=1" \ INCLUDES="$(INCLUDES) -I$(UI)/dos -I$(UI)/sound" \
OPTIONS+="$(OPTS.DOS)" \ OPTIONS="-DBSPF_DOS=1" \
LDFLAGS="" \ OPTIONS+="$(OPTS.DOS)" \
LDLIBS="" \ LDFLAGS="" \
OBJS="mainDOS.o PCJoys.o SndDOS.o dos_sb.o vga.o" LDLIBS="" \
OBJS="mainDOS.o PCJoys.o SndDOS.o dos_sb.o vga.o"
linux-sdl:
make stella.sdl \ linux-sdl:
INCLUDES="$(INCLUDES) -I$(UI)/sdl -I$(UI)/sound" \ make stella.sdl \
SYS_INCLUDES="" \ INCLUDES="$(INCLUDES) -I$(UI)/sdl -I$(UI)/sound" \
OPTIONS="-DBSPF_UNIX=1 -DUNIX=1" \ SYS_INCLUDES="" \
OPTIONS+="$(OPTS.SDL)" \ OPTIONS="-DBSPF_UNIX=1 -DUNIX=1" \
LDFLAGS="-L/usr/X11R6/lib" \ OPTIONS+="$(OPTS.SDL)" \
LDFLAGS+="$(CFLAGS.SDL)" \ LDFLAGS="-L/usr/X11R6/lib" \
LDLIBS="-lX11 -lXext" \ LDFLAGS+="$(CFLAGS.SDL)" \
LDLIBS+="$(LIBS.SDL)" \ LDLIBS="-lX11 -lXext" \
OBJS="mainSDL.o SettingsUNIX.o FrameBufferSDL.o FrameBufferSoft.o" \ LDLIBS+="$(LIBS.SDL)" \
OBJS+="$(OBJS.SDL)" OBJS="mainSDL.o SettingsUNIX.o FrameBufferSDL.o FrameBufferSoft.o" \
OBJS+="$(OBJS.SDL)"
###############################################################################
## List of "core" object files win32-sdl:
############################################################################### make stella.sdl \
M6502_OBJS = D6502.o Device.o M6502.o M6502Low.o M6502Hi.o NullDev.o System.o INCLUDES="$(INCLUDES) -I$(UI)/sdl -I$(UI)/sound" \
SYS_INCLUDES="" \
CORE_OBJS = Booster.o Cart.o Cart2K.o Cart3F.o Cart4K.o CartAR.o CartDPC.o \ OPTIONS="-DBSPF_UNIX=1 -DWIN32" \
CartE0.o CartE7.o CartF4.o CartF4SC.o CartF6.o CartF6SC.o \ OPTIONS+="$(OPTS.SDL)" \
CartF8.o CartF8SC.o CartFASC.o CartFE.o CartMC.o CartCV.o \ LDFLAGS="" \
CartMB.o Console.o Control.o Driving.o \ LDFLAGS+="$(CFLAGS.SDL)" \
Event.o Joystick.o Keyboard.o M6532.o MD5.o MediaSrc.o Paddles.o \ LDLIBS="" \
Props.o PropsSet.o Random.o Sound.o Switches.o Settings.o TIA.o \ LDLIBS+="$(LIBS.SDL)" \
Serializer.o Deserializer.o TIASound.o EventHandler.o FrameBuffer.o \ OBJS="mainSDL.o SettingsWin32.o FrameBufferSDL.o FrameBufferSoft.o" \
$(M6502_OBJS) OBJS+="$(OBJS.SDL)"
stella.exe: $(CORE_OBJS) $(OBJS)
$(LD) -o a.exe *.o $(LDFLAGS) $(LDLIBS) ###############################################################################
exe2coff a.exe ## List of "core" object files
strip a ###############################################################################
del stella.exe M6502_OBJS = D6502.o Device.o M6502.o M6502Low.o M6502Hi.o NullDev.o System.o
copy /B $(DJGPP:\DJGPP.ENV=)\bin\pmodstub.exe+a stella.exe
del a CORE_OBJS = Booster.o Cart.o Cart2K.o Cart3F.o Cart4K.o CartAR.o CartDPC.o \
del a.exe CartE0.o CartE7.o CartF4.o CartF4SC.o CartF6.o CartF6SC.o \
CartF8.o CartF8SC.o CartFASC.o CartFE.o CartMC.o CartCV.o \
stella.sdl: $(CORE_OBJS) $(OBJS) CartMB.o Console.o Control.o Driving.o \
$(LD) -o stella.sdl $(CORE_OBJS) $(OBJS) $(LDFLAGS) $(LDLIBS) Event.o Joystick.o Keyboard.o M6532.o MD5.o MediaSrc.o Paddles.o \
Props.o PropsSet.o Random.o Sound.o Switches.o Settings.o TIA.o \
M6502Low.ins: $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4 Serializer.o Deserializer.o TIASound.o EventHandler.o FrameBuffer.o \
m4 $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4 > M6502Low.ins $(M6502_OBJS)
M6502Hi.ins: $(CORE)/m6502/src/M6502Hi.m4 $(CORE)/m6502/src/M6502.m4 stella.exe: $(CORE_OBJS) $(OBJS)
m4 $(CORE)/m6502/src/M6502Hi.m4 $(CORE)/m6502/src/M6502.m4 > M6502Hi.ins $(LD) -o a.exe *.o $(LDFLAGS) $(LDLIBS)
exe2coff a.exe
M6502Low.o: M6502Low.ins strip a
M6502Hi.o: M6502Hi.ins del stella.exe
copy /B $(DJGPP:\DJGPP.ENV=)\bin\pmodstub.exe+a stella.exe
cleandos: del a
del *.o del a.exe
del stella.exe
del M6502Low.ins stella.sdl: $(CORE_OBJS) $(OBJS)
del M6502Hi.ins $(LD) -o stella.sdl $(CORE_OBJS) $(OBJS) $(LDFLAGS) $(LDLIBS)
clean: M6502Low.ins: $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4
rm -f *.o stella stella.sdl stella.exe core m4 $(CORE)/m6502/src/M6502Low.m4 $(CORE)/m6502/src/M6502.m4 > M6502Low.ins
cleanall: clean M6502Hi.ins: $(CORE)/m6502/src/M6502Hi.m4 $(CORE)/m6502/src/M6502.m4
rm -f M6502Low.ins M6502Hi.ins m4 $(CORE)/m6502/src/M6502Hi.m4 $(CORE)/m6502/src/M6502.m4 > M6502Hi.ins
Driving.o: $(CORE)/Driving.cxx $(CORE)/Driving.hxx M6502Low.o: M6502Low.ins
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Driving.cxx M6502Hi.o: M6502Hi.ins
Event.o: $(CORE)/Event.cxx $(CORE)/Event.hxx cleandos:
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Event.cxx del *.o
del stella.exe
EventHandler.o: $(CORE)/EventHandler.cxx $(CORE)/EventHandler.hxx del M6502Low.ins
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/EventHandler.cxx del M6502Hi.ins
Control.o: $(CORE)/Control.cxx $(CORE)/Control.hxx clean:
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Control.cxx rm -f *.o stella stella.sdl stella.exe core
Joystick.o: $(CORE)/Joystick.cxx $(CORE)/Joystick.hxx cleanall: clean
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Joystick.cxx rm -f M6502Low.ins M6502Hi.ins
Keyboard.o: $(CORE)/Keyboard.cxx $(CORE)/Keyboard.hxx Driving.o: $(CORE)/Driving.cxx $(CORE)/Driving.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Keyboard.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Driving.cxx
Paddles.o: $(CORE)/Paddles.cxx $(CORE)/Paddles.hxx Event.o: $(CORE)/Event.cxx $(CORE)/Event.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Paddles.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Event.cxx
Booster.o: $(CORE)/Booster.cxx $(CORE)/Booster.hxx EventHandler.o: $(CORE)/EventHandler.cxx $(CORE)/EventHandler.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Booster.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/EventHandler.cxx
Cart.o: $(CORE)/Cart.cxx $(CORE)/Cart.hxx Control.o: $(CORE)/Control.cxx $(CORE)/Control.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Control.cxx
Cart2K.o: $(CORE)/Cart2K.cxx $(CORE)/Cart2K.hxx Joystick.o: $(CORE)/Joystick.cxx $(CORE)/Joystick.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart2K.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Joystick.cxx
Cart3F.o: $(CORE)/Cart3F.cxx $(CORE)/Cart3F.hxx Keyboard.o: $(CORE)/Keyboard.cxx $(CORE)/Keyboard.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart3F.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Keyboard.cxx
Cart4K.o: $(CORE)/Cart4K.cxx $(CORE)/Cart4K.hxx Paddles.o: $(CORE)/Paddles.cxx $(CORE)/Paddles.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart4K.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Paddles.cxx
CartAR.o: $(CORE)/CartAR.cxx $(CORE)/CartAR.hxx Booster.o: $(CORE)/Booster.cxx $(CORE)/Booster.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartAR.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Booster.cxx
CartDPC.o: $(CORE)/CartDPC.cxx $(CORE)/CartDPC.hxx Cart.o: $(CORE)/Cart.cxx $(CORE)/Cart.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartDPC.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart.cxx
CartE0.o: $(CORE)/CartE0.cxx $(CORE)/CartE0.hxx Cart2K.o: $(CORE)/Cart2K.cxx $(CORE)/Cart2K.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartE0.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart2K.cxx
CartE7.o: $(CORE)/CartE7.cxx $(CORE)/CartE7.hxx Cart3F.o: $(CORE)/Cart3F.cxx $(CORE)/Cart3F.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartE7.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart3F.cxx
CartF4.o: $(CORE)/CartF4.cxx $(CORE)/CartF4.hxx Cart4K.o: $(CORE)/Cart4K.cxx $(CORE)/Cart4K.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF4.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Cart4K.cxx
CartF4SC.o: $(CORE)/CartF4SC.cxx $(CORE)/CartF4SC.hxx CartAR.o: $(CORE)/CartAR.cxx $(CORE)/CartAR.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF4SC.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartAR.cxx
CartF6.o: $(CORE)/CartF6.cxx $(CORE)/CartF6.hxx CartDPC.o: $(CORE)/CartDPC.cxx $(CORE)/CartDPC.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF6.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartDPC.cxx
CartF6SC.o: $(CORE)/CartF6SC.cxx $(CORE)/CartF6SC.hxx CartE0.o: $(CORE)/CartE0.cxx $(CORE)/CartE0.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF6SC.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartE0.cxx
CartF8.o: $(CORE)/CartF8.cxx $(CORE)/CartF8.hxx CartE7.o: $(CORE)/CartE7.cxx $(CORE)/CartE7.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF8.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartE7.cxx
CartF8SC.o: $(CORE)/CartF8SC.cxx $(CORE)/CartF8SC.hxx CartF4.o: $(CORE)/CartF4.cxx $(CORE)/CartF4.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF8SC.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF4.cxx
CartFASC.o: $(CORE)/CartFASC.cxx $(CORE)/CartFASC.hxx CartF4SC.o: $(CORE)/CartF4SC.cxx $(CORE)/CartF4SC.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartFASC.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF4SC.cxx
CartFE.o: $(CORE)/CartFE.cxx $(CORE)/CartFE.hxx CartF6.o: $(CORE)/CartF6.cxx $(CORE)/CartF6.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartFE.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF6.cxx
CartMC.o: $(CORE)/CartMC.cxx $(CORE)/CartMC.hxx CartF6SC.o: $(CORE)/CartF6SC.cxx $(CORE)/CartF6SC.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartMC.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF6SC.cxx
CartMB.o: $(CORE)/CartMB.cxx $(CORE)/CartMB.hxx CartF8.o: $(CORE)/CartF8.cxx $(CORE)/CartF8.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartMB.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF8.cxx
CartCV.o: $(CORE)/CartCV.cxx $(CORE)/CartCV.hxx CartF8SC.o: $(CORE)/CartF8SC.cxx $(CORE)/CartF8SC.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartCV.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartF8SC.cxx
M6532.o: $(CORE)/M6532.cxx $(CORE)/M6532.hxx CartFASC.o: $(CORE)/CartFASC.cxx $(CORE)/CartFASC.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/M6532.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartFASC.cxx
TIA.o: $(CORE)/TIA.cxx $(CORE)/TIA.hxx CartFE.o: $(CORE)/CartFE.cxx $(CORE)/CartFE.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/TIA.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartFE.cxx
TIASound.o: $(CORE)/TIASound.c $(CORE)/TIASound.h CartMC.o: $(CORE)/CartMC.cxx $(CORE)/CartMC.hxx
$(CXX) -c -DWIN32 $(FLAGS) $(OPTIONS) $(CORE)/TIASound.c $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartMC.cxx
Console.o: $(CORE)/Console.cxx $(CORE)/Console.hxx CartMB.o: $(CORE)/CartMB.cxx $(CORE)/CartMB.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Console.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartMB.cxx
MD5.o: $(CORE)/MD5.cxx $(CORE)/MD5.hxx CartCV.o: $(CORE)/CartCV.cxx $(CORE)/CartCV.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/MD5.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/CartCV.cxx
MediaSrc.o: $(CORE)/MediaSrc.cxx $(CORE)/MediaSrc.hxx M6532.o: $(CORE)/M6532.cxx $(CORE)/M6532.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/MediaSrc.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/M6532.cxx
FrameBuffer.o: $(CORE)/FrameBuffer.cxx $(CORE)/FrameBuffer.hxx TIA.o: $(CORE)/TIA.cxx $(CORE)/TIA.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/FrameBuffer.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/TIA.cxx
PropsSet.o: $(CORE)/PropsSet.cxx $(CORE)/PropsSet.hxx TIASound.o: $(CORE)/TIASound.c $(CORE)/TIASound.h
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/PropsSet.cxx $(CXX) -c -DWIN32 $(FLAGS) $(OPTIONS) $(CORE)/TIASound.c
Props.o: $(CORE)/Props.cxx $(CORE)/Props.hxx Console.o: $(CORE)/Console.cxx $(CORE)/Console.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Props.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Console.cxx
Random.o: $(CORE)/Random.cxx $(CORE)/Random.hxx MD5.o: $(CORE)/MD5.cxx $(CORE)/MD5.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Random.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/MD5.cxx
Sound.o: $(CORE)/Sound.cxx $(CORE)/Sound.hxx MediaSrc.o: $(CORE)/MediaSrc.cxx $(CORE)/MediaSrc.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(CORE)/Sound.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/MediaSrc.cxx
Switches.o: $(CORE)/Switches.cxx $(CORE)/Switches.hxx FrameBuffer.o: $(CORE)/FrameBuffer.cxx $(CORE)/FrameBuffer.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Switches.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/FrameBuffer.cxx
Serializer.o: $(CORE)/Serializer.cxx $(CORE)/Serializer.hxx PropsSet.o: $(CORE)/PropsSet.cxx $(CORE)/PropsSet.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Serializer.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/PropsSet.cxx
Deserializer.o: $(CORE)/Deserializer.cxx $(CORE)/Deserializer.hxx Props.o: $(CORE)/Props.cxx $(CORE)/Props.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Deserializer.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Props.cxx
Settings.o: $(CORE)/Settings.cxx $(CORE)/Settings.hxx Random.o: $(CORE)/Random.cxx $(CORE)/Random.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(CORE)/Settings.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Random.cxx
SettingsUNIX.o: $(UI)/sdl/SettingsUNIX.cxx $(UI)/sdl/SettingsUNIX.hxx Sound.o: $(CORE)/Sound.cxx $(CORE)/Sound.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/SettingsUNIX.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(CORE)/Sound.cxx
Terminal.o: $(UI)/x11/Terminal.cxx $(UI)/x11/Terminal.hxx Switches.o: $(CORE)/Switches.cxx $(CORE)/Switches.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/x11/Terminal.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Switches.cxx
mainDOS.o: $(UI)/dos/mainDOS.cxx Serializer.o: $(CORE)/Serializer.cxx $(CORE)/Serializer.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/mainDOS.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Serializer.cxx
PCJoys.o: $(UI)/dos/PCJoys.cxx Deserializer.o: $(CORE)/Deserializer.cxx $(CORE)/Deserializer.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/PCJoys.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/Deserializer.cxx
SndDOS.o: $(UI)/dos/SndDOS.cxx Settings.o: $(CORE)/Settings.cxx $(CORE)/Settings.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/SndDOS.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(CORE)/Settings.cxx
dos_sb.o: $(UI)/dos/dos_sb.c SettingsUNIX.o: $(UI)/sdl/SettingsUNIX.cxx $(UI)/sdl/SettingsUNIX.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/dos_sb.c $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/SettingsUNIX.cxx
vga.o: $(UI)/dos/vga.cxx SettingsWin32.o: $(UI)/sdl/SettingsWin32.cxx $(UI)/sdl/SettingsWin32.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/vga.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/SettingsWin32.cxx
SoundALSA.o: $(UI)/sound/SoundALSA.cxx $(UI)/sound/SoundALSA.hxx Terminal.o: $(UI)/x11/Terminal.cxx $(UI)/x11/Terminal.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sound/SoundALSA.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/x11/Terminal.cxx
SoundOSS.o: $(UI)/sound/SoundOSS.cxx $(UI)/sound/SoundOSS.hxx mainDOS.o: $(UI)/dos/mainDOS.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sound/SoundOSS.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/mainDOS.cxx
SoundSDL.o: $(UI)/sound/SoundSDL.cxx $(UI)/sound/SoundSDL.hxx PCJoys.o: $(UI)/dos/PCJoys.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sound/SoundSDL.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/PCJoys.cxx
mainX11.o: $(UI)/x11/mainX11.cxx SndDOS.o: $(UI)/dos/SndDOS.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/x11/mainX11.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/SndDOS.cxx
mainSDL.o: $(UI)/sdl/mainSDL.cxx dos_sb.o: $(UI)/dos/dos_sb.c
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/mainSDL.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/dos_sb.c
RectList.o: $(UI)/sdl/RectList.cxx $(UI)/sdl/RectList.hxx vga.o: $(UI)/dos/vga.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/RectList.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(UI)/dos/vga.cxx
FrameBufferSDL.o: $(UI)/sdl/FrameBufferSDL.cxx $(UI)/sdl/FrameBufferSDL.hxx SoundALSA.o: $(UI)/sound/SoundALSA.cxx $(UI)/sound/SoundALSA.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/FrameBufferSDL.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sound/SoundALSA.cxx
FrameBufferSoft.o: $(UI)/sdl/FrameBufferSoft.cxx $(UI)/sdl/FrameBufferSoft.hxx SoundOSS.o: $(UI)/sound/SoundOSS.cxx $(UI)/sound/SoundOSS.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/FrameBufferSoft.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sound/SoundOSS.cxx
FrameBufferGL.o: $(UI)/sdl/FrameBufferGL.cxx $(UI)/sdl/FrameBufferGL.hxx SoundSDL.o: $(UI)/sound/SoundSDL.cxx $(UI)/sound/SoundSDL.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/FrameBufferGL.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sound/SoundSDL.cxx
Snapshot.o: $(UI)/common/Snapshot.cxx $(UI)/common/Snapshot.hxx mainX11.o: $(UI)/x11/mainX11.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/common/Snapshot.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/x11/mainX11.cxx
D6502.o: $(CORE)/m6502/src/D6502.cxx mainSDL.o: $(UI)/sdl/mainSDL.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/D6502.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/mainSDL.cxx
Device.o: $(CORE)/m6502/src/Device.cxx RectList.o: $(UI)/sdl/RectList.cxx $(UI)/sdl/RectList.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/Device.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/RectList.cxx
M6502.o: $(CORE)/m6502/src/M6502.cxx FrameBufferSDL.o: $(UI)/sdl/FrameBufferSDL.cxx $(UI)/sdl/FrameBufferSDL.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/M6502.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/FrameBufferSDL.cxx
M6502Low.o: $(CORE)/m6502/src/M6502Low.cxx FrameBufferSoft.o: $(UI)/sdl/FrameBufferSoft.cxx $(UI)/sdl/FrameBufferSoft.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/M6502Low.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/FrameBufferSoft.cxx
M6502Hi.o: $(CORE)/m6502/src/M6502Hi.cxx FrameBufferGL.o: $(UI)/sdl/FrameBufferGL.cxx $(UI)/sdl/FrameBufferGL.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/M6502Hi.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/sdl/FrameBufferGL.cxx
NullDev.o: $(CORE)/m6502/src/NullDev.cxx $(CORE)/m6502/src/NullDev.hxx Snapshot.o: $(UI)/common/Snapshot.cxx $(UI)/common/Snapshot.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/NullDev.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/common/Snapshot.cxx
System.o: $(CORE)/m6502/src/System.cxx $(CORE)/m6502/src/System.hxx D6502.o: $(CORE)/m6502/src/D6502.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/System.cxx $(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/D6502.cxx
Device.o: $(CORE)/m6502/src/Device.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/Device.cxx
M6502.o: $(CORE)/m6502/src/M6502.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/M6502.cxx
M6502Low.o: $(CORE)/m6502/src/M6502Low.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/M6502Low.cxx
M6502Hi.o: $(CORE)/m6502/src/M6502Hi.cxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/M6502Hi.cxx
NullDev.o: $(CORE)/m6502/src/NullDev.cxx $(CORE)/m6502/src/NullDev.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/NullDev.cxx
System.o: $(CORE)/m6502/src/System.cxx $(CORE)/m6502/src/System.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(CORE)/m6502/src/System.cxx

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FrameBufferSDL.cxx,v 1.8 2003-12-03 18:11:25 stephena Exp $ // $Id: FrameBufferSDL.cxx,v 1.9 2003-12-04 22:22:53 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -155,7 +155,7 @@ void FrameBufferSDL::grabMouse(bool grab)
uInt32 FrameBufferSDL::maxWindowSizeForScreen() uInt32 FrameBufferSDL::maxWindowSizeForScreen()
{ {
if(!x11Available) if(!x11Available)
return 3; return 4;
#ifdef UNIX #ifdef UNIX
// Otherwise, lock the screen and get the width and height // Otherwise, lock the screen and get the width and height
@ -186,6 +186,8 @@ uInt32 FrameBufferSDL::maxWindowSizeForScreen()
else else
return 1; return 1;
#endif #endif
return 4;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -0,0 +1,213 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-1999 by Bradford W. Mott
//
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: SettingsWin32.cxx,v 1.1 2003-12-04 22:22:53 stephena Exp $
//============================================================================
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "bspf.hxx"
#include "Console.hxx"
#include "EventHandler.hxx"
#include "StellaEvent.hxx"
#include "Settings.hxx"
#include "SettingsWin32.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SettingsWin32::SettingsWin32()
{
// First set variables that the parent class needs
myBaseDir = ".\\";
string stelladir = myBaseDir;
// if(access(stelladir.c_str(), R_OK|W_OK|X_OK) != 0 )
// mkdir(stelladir.c_str(), 0777);
myStateDir = stelladir + "state\\";
// if(access(myStateDir.c_str(), R_OK|W_OK|X_OK) != 0 )
// mkdir(myStateDir.c_str(), 0777);
myUserPropertiesFile = stelladir + "stella.pro";
mySystemPropertiesFile = stelladir + "stella.pro";
myUserConfigFile = stelladir + "stellarc";
mySystemConfigFile = stelladir + "stellarc";
// Set up the names of the input and output config files
mySettingsOutputFilename = myUserConfigFile;
// if(access(myUserConfigFile.c_str(), R_OK) == 0)
mySettingsInputFilename = myUserConfigFile;
// else
// mySettingsInputFilename = mySystemConfigFile;
mySnapshotFile = "";
myStateFile = "";
// Now create UNIX specific settings
set("video", "soft");
#ifdef DISPLAY_OPENGL
set("gl_filter", "nearest");
set("gl_aspect", "2");
#endif
set("sound", "sdl");
set("fullscreen", "false");
set("grabmouse", "false");
set("hidecursor", "false");
set("volume", "-1");
set("accurate", "false"); // Don't change this, or the sound will skip
#ifdef SNAPSHOT_SUPPORT
set("ssname", "romname");
set("ssdir", ".\\");
set("ssingle", "false");
#endif
set("joyleft", "0");
set("joyright", "1");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SettingsWin32::~SettingsWin32()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SettingsWin32::usage(string& message)
{
cout << endl
<< message << endl
<< endl
<< "Valid options are:" << endl
<< endl
<< " -video <type> Type is one of the following:\n"
<< " soft SDL software mode\n"
#ifdef DISPLAY_OPENGL
<< " gl SDL OpenGL mode\n"
<< endl
<< " -gl_filter <type> Type is one of the following:\n"
<< " nearest Normal scaling (GL_NEAREST)\n"
<< " linear Blurred scaling (GL_LINEAR)\n"
<< " -gl_aspect <number> Scale the width by the given amount\n"
<< endl
#endif
<< " -sound <type> Type is one of the following:\n"
<< " 0 Disables all sound generation\n"
#ifdef SOUND_ALSA
<< " alsa ALSA version 0.9 driver\n"
#endif
#ifdef SOUND_OSS
<< " oss Open Sound System driver\n"
#endif
#ifdef SOUND_SDL
<< " sdl Native SDL driver\n"
#endif
<< endl
<< " -framerate <number> Display the given number of frames per second\n"
<< " -zoom <size> Makes window be 'size' times normal\n"
<< " -fullscreen <0|1> Play the game in fullscreen mode\n"
<< " -grabmouse <0|1> Keeps the mouse in the game window\n"
<< " -hidecursor <0|1> Hides the mouse cursor in the game window\n"
<< " -volume <number> Set the volume (0 - 100)\n"
#ifdef HAVE_JOYSTICK
<< " -paddle <0|1|2|3|real> Indicates which paddle the mouse should emulate\n"
<< " or that real Atari 2600 paddles are being used\n"
<< " -joyleft <number> The joystick number representing the left controller\n"
<< " -joyright <number> The joystick number representing the right controller\n"
#else
<< " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate\n"
#endif
<< " -altpro <props file> Use the given properties file instead of stella.pro\n"
<< " -showinfo <0|1> Shows some game info\n"
<< " -accurate <0|1> Accurate game timing (uses more CPU)\n"
#ifdef SNAPSHOT_SUPPORT
<< " -ssdir <path> The directory to save snapshot files to\n"
<< " -ssname <name> How to name the snapshot (romname or md5sum)\n"
<< " -sssingle <0|1> Generate single snapshot instead of many\n"
#endif
<< endl
#ifdef DEVELOPER_SUPPORT
<< " DEVELOPER options (see Stella manual for details)\n"
<< " -Dformat Sets \"Display.Format\"\n"
<< " -Dxstart Sets \"Display.XStart\"\n"
<< " -Dwidth Sets \"Display.Width\"\n"
<< " -Dystart Sets \"Display.YStart\"\n"
<< " -Dheight Sets \"Display.Height\"\n"
<< " -mergeprops <0|1> Merge changed properties into properties file,\n"
<< " or save into a separate file\n"
#endif
<< endl;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string SettingsWin32::stateFilename(uInt32 state)
{
if(!myConsole)
return "";
ostringstream buf;
buf << myStateDir << myConsole->properties().get("Cartridge.MD5")
<< ".st" << state;
myStateFile = buf.str();
return myStateFile;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string SettingsWin32::snapshotFilename()
{
if(!myConsole)
return "";
string filename;
string path = getString("ssdir");
string theSnapshotName = getString("ssname");
if(theSnapshotName == "romname")
path = path + "/" + myConsole->properties().get("Cartridge.Name");
else if(theSnapshotName == "md5sum")
path = path + "/" + myConsole->properties().get("Cartridge.MD5");
// Replace all spaces in name with underscores
replace(path.begin(), path.end(), ' ', '_');
// Check whether we want multiple snapshots created
if(!getBool("sssingle"))
{
// Determine if the file already exists, checking each successive filename
// until one doesn't exist
filename = path + ".png";
if(access(filename.c_str(), F_OK) == 0 )
{
ostringstream buf;
for(uInt32 i = 1; ;++i)
{
buf.str("");
buf << path << "_" << i << ".png";
if(access(buf.str().c_str(), F_OK) == -1 )
break;
}
filename = buf.str();
}
}
else
filename = path + ".png";
mySnapshotFile = filename;
return mySnapshotFile;
}

View File

@ -0,0 +1,70 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-1999 by Bradford W. Mott
//
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: SettingsWin32.hxx,v 1.1 2003-12-04 22:22:53 stephena Exp $
//============================================================================
#ifndef SETTINGS_WIN32_HXX
#define SETTINGS_WIN32_HXX
#include "bspf.hxx"
class Console;
/**
This class defines Windows system specific settings.
@author Stephen Anthony
@version $Id: SettingsWin32.hxx,v 1.1 2003-12-04 22:22:53 stephena Exp $
*/
class SettingsWin32 : public Settings
{
public:
/**
Create a new UNIX settings object
*/
SettingsWin32();
/**
Destructor
*/
virtual ~SettingsWin32();
public:
/**
This method should be called to get the filename of a state file
given the state number.
@return String representing the full path of the state filename.
*/
virtual string stateFilename(uInt32 state);
/**
This method should be called to get the filename of a snapshot.
@return String representing the full path of the snapshot filename.
*/
virtual string snapshotFilename();
/**
Display the commandline settings for this UNIX version of Stella.
@param message A short message about this version of Stella
*/
virtual void usage(string& message);
};
#endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: mainSDL.cxx,v 1.63 2003-12-04 19:18:45 stephena Exp $ // $Id: mainSDL.cxx,v 1.64 2003-12-04 22:22:53 stephena Exp $
//============================================================================ //============================================================================
#include <fstream> #include <fstream>
@ -61,6 +61,10 @@
#include "SettingsUNIX.hxx" #include "SettingsUNIX.hxx"
#endif #endif
#ifdef WIN32
#include "SettingsWin32.hxx"
#endif
static void cleanup(); static void cleanup();
static bool setupJoystick(); static bool setupJoystick();
static void handleEvents(); static void handleEvents();
@ -664,6 +668,9 @@ int main(int argc, char* argv[])
{ {
#ifdef UNIX #ifdef UNIX
theSettings = new SettingsUNIX(); theSettings = new SettingsUNIX();
#endif
#ifdef WIN32
theSettings = new SettingsWin32();
#endif #endif
if(!theSettings) if(!theSettings)
{ {
@ -687,13 +694,13 @@ int main(int argc, char* argv[])
// Request that the SDL window be centered, if possible // Request that the SDL window be centered, if possible
// This will probably only work under Linux // This will probably only work under Linux
setenv("SDL_VIDEO_CENTERED", "1", 1); putenv("SDL_VIDEO_CENTERED");
// Get a pointer to the file which contains the cartridge ROM // Get a pointer to the file which contains the cartridge ROM
const char* file = argv[argc - 1]; const char* file = argv[argc - 1];
// Open the cartridge image and read it in // Open the cartridge image and read it in
ifstream in(file); ifstream in(file, ios_base::binary);
if(!in) if(!in)
{ {
cerr << "ERROR: Couldn't open " << file << "..." << endl; cerr << "ERROR: Couldn't open " << file << "..." << endl;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: SoundSDL.cxx,v 1.5 2003-11-19 15:57:11 stephena Exp $ // $Id: SoundSDL.cxx,v 1.6 2003-12-04 22:22:53 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -23,11 +23,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::SoundSDL() SoundSDL::SoundSDL()
: myCurrentVolume(SDL_MIX_MAXVOLUME), : myCurrentVolume(SDL_MIX_MAXVOLUME),
myFragmentSize(1024), myFragmentSize(2048),
myIsInitializedFlag(false), myIsInitializedFlag(false),
myIsMuted(false), myIsMuted(false),
mySampleRate(31400), mySampleRate(31400),
mySampleQueue(mySampleRate) mySampleQueueSize(8000),
mySampleQueue(mySampleQueueSize)//mySampleRate)
{ {
if(1) if(1)
{ {
@ -172,10 +173,10 @@ void SoundSDL::update()
SDL_LockAudio(); SDL_LockAudio();
// Move all of the generated samples into the our private sample queue // Move all of the generated samples into the our private sample queue
uInt8 buffer[4096]; uInt8 buffer[2048];
while(myMediaSource->numberOfAudioSamples() > 0) while(myMediaSource->numberOfAudioSamples() > 0)
{ {
uInt32 size = myMediaSource->dequeueAudioSamples(buffer, 4096); uInt32 size = myMediaSource->dequeueAudioSamples(buffer, 2048);
mySampleQueue.enqueue(buffer, size); mySampleQueue.enqueue(buffer, size);
} }
@ -184,7 +185,7 @@ void SoundSDL::update()
// Block until the sound thread has consumed all but 142 milliseconds // Block until the sound thread has consumed all but 142 milliseconds
// of the available audio samples // of the available audio samples
uInt32 leave = mySampleRate / 7; uInt32 left = mySampleRate / 3;
for(;;) for(;;)
{ {
uInt32 size = 0; uInt32 size = 0;
@ -193,12 +194,12 @@ void SoundSDL::update()
size = mySampleQueue.size(); size = mySampleQueue.size();
SDL_UnlockAudio(); SDL_UnlockAudio();
if(size <= leave) if(size < left)
{ {
break; break;
} }
SDL_Delay(5); SDL_Delay(1);
} }
} }
} }
@ -214,7 +215,7 @@ void SoundSDL::callback(void* udata, uInt8* stream, int len)
} }
// Don't use samples unless there's at least 76 milliseconds worth of data // Don't use samples unless there's at least 76 milliseconds worth of data
if(sound->mySampleQueue.size() < (sound->mySampleRate / 13)) if(sound->mySampleQueue.size() < (sound->mySampleRate / 16))
{ {
return; return;
} }
@ -224,11 +225,11 @@ void SoundSDL::callback(void* udata, uInt8* stream, int len)
if(sound->mySampleQueue.size() > 0) if(sound->mySampleQueue.size() > 0)
{ {
Int32 offset; Int32 offset;
uInt8 buffer[4096]; uInt8 buffer[2048];
for(offset = 0; (offset < len) && (sound->mySampleQueue.size() > 0); ) for(offset = 0; (offset < len) && (sound->mySampleQueue.size() > 0); )
{ {
uInt32 s = sound->mySampleQueue.dequeue(buffer, uInt32 s = sound->mySampleQueue.dequeue(buffer,
(4096 > (len - offset) ? (len - offset) : 4096)); (2048 > (len - offset) ? (len - offset) : 2048));
SDL_MixAudio(stream + offset, buffer, s, sound->myCurrentVolume); SDL_MixAudio(stream + offset, buffer, s, sound->myCurrentVolume);
offset += s; offset += s;
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: SoundSDL.hxx,v 1.5 2003-11-19 15:57:11 stephena Exp $ // $Id: SoundSDL.hxx,v 1.6 2003-12-04 22:22:53 stephena Exp $
//============================================================================ //============================================================================
#ifndef SOUNDSDL_HXX #ifndef SOUNDSDL_HXX
@ -29,7 +29,7 @@
This class implements the sound API for SDL. This class implements the sound API for SDL.
@author Stephen Anthony and Bradford W. Mott @author Stephen Anthony and Bradford W. Mott
@version $Id: SoundSDL.hxx,v 1.5 2003-11-19 15:57:11 stephena Exp $ @version $Id: SoundSDL.hxx,v 1.6 2003-12-04 22:22:53 stephena Exp $
*/ */
class SoundSDL : public Sound class SoundSDL : public Sound
{ {
@ -160,6 +160,9 @@ class SoundSDL : public Sound
// DSP sample rate // DSP sample rate
uInt32 mySampleRate; uInt32 mySampleRate;
// The sample queue size (which is auto-adapting)
uInt32 mySampleQueueSize;
// Queue which holds samples from the media source before they are played // Queue which holds samples from the media source before they are played
SampleQueue mySampleQueue; SampleQueue mySampleQueue;