Commit Graph

5622 Commits

Author SHA1 Message Date
stephena 5b6f1c5f5e Reworked the OpenGL class yet again. I figured out how to fix the problems
in Windows without all the invasive changes, so I reverted most of it.

Snapshots are now fully working in both software/OpenGL and windowed/fullscreen
modes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@278 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-23 03:43:47 +00:00
stephena 6ddd117edf Moved the screen clearing code out of the texture creation method
and into the createscreen method.

Under Windows, it didn't matter, since createTextures() was called every
time createScreen() was.  Under Linux, createTextures() is only ever
called once.  Hence, the screen is never cleared.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@277 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-23 00:33:37 +00:00
stephena db6d064ebf Reworked the fullscreen OpenGL mode. Finally, Windows fullscreen OpenGL
works!

Still to do is scale the OpenGL text to the current screen size.  Right now,
it still shows up very small (and not centered).  Also, fullscreen OpenGL
snapshots aren't quite working right yet.  Both of these are easy to fix.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@276 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-23 00:15:32 +00:00
stephena 464972cc31 Added snapshot support for both software and OpenGL modes. Snapshots
are now created from the framebuffer() instead of directly from the
Mediasource.

Removed all snapshot-related code from the Console, since it didn't
really belong there.  A static snapshot object is now created each
time a snapshot is done (in the EventHandler).

These changes should make it easier for those ports (like MacOSX) that
have native PNG-saving support to not use *any* of the snapshot code
at all.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@275 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-20 23:30:48 +00:00
stephena 44584196ab Added fix that I forgot to include in the last commit.
The sound queue should be emptied before reloading the sound
registers, and the sound callback must not be called during this
time.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@274 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-20 01:12:12 +00:00
stephena 2d543a8af9 Fixed the state loading code wrt sound handling. The TIA sound register
queue is now cleared when a new state is loaded.  This should eliminate
the weird sounds that sometimes happened when a new state was loaded
(sound from the previous state was still playing).

Removed the '-paddle real' option from the description in the UNIX
commandline help code.  This option hasn't been used since Stella 1.2
and has been obsoleted by the Stelladaptor support.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@273 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-20 00:52:37 +00:00
stephena 2b64fd4217 Made the windows port create a 'state' directory to save state files
into if the directory didn't already exist.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@272 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-19 21:51:12 +00:00
markgrebe d877d0a95b This commit was generated by cvs2svn to compensate for changes in r269,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@270 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-16 02:30:32 +00:00
stephena e4c22f2815 Disabled switching to fullscreen mode in Windows when using OpenGL.
Something is seriously screwed up there, and I'm not even attempting
to get it working for this next release.

It seems that sometimes switching to fullscreen in Windows in software
mode causes crashes as well.  I really hate Windows ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@268 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-16 00:31:32 +00:00
markgrebe 7975fa9ce3 Updated Mac OSX specific sound generation for Brads new sound changes
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@267 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 19:22:45 +00:00
stephena 9e287b0e8c Fixed SDL_Quit() not being called on program exit.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@266 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 18:14:03 +00:00
bwmott d902a9b237 Added a few comments and updated the "high-water" mark for the sound
register queue so that it's based on the fragment size.  This should
help ensure the queue isn't cleared for larger fragment sizes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@265 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 17:14:25 +00:00
stephena 50767f4bb1 - Fixed some compile warnings under gcc.
- Adding better error checking to the mainSDL class (SDL_WasInit),
thanks to Joshua Rodman.

 - Removed the bufsize argument, since it's no longer used.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@264 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 16:51:15 +00:00
bwmott f4aced6c64 Removed bufsize argument to Sound creation and added framerate argument
to Console creation so the code works with the latest sound changes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@263 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 05:09:37 +00:00
bwmott 2e09e2c00c A fairly major rewrite of the class to improve the sound support. The
enhanced sound in games like Pitfall II and Quadrun should be working
now.  Also the overall sound in most has should be improved since the
TIA sound register writes and sample generation are somewhat synchronized.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@262 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 05:03:26 +00:00
bwmott 3d231acd53 Added new argument to constructor to pass in the desired frame rate
to the Console.  This information is needed by the SoundSDL class to
properly schedule the sound.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@261 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 04:59:40 +00:00
bwmott 21af97fb43 Minor change to invoke mute() method instead of pause() on the sound
object.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@260 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 04:57:17 +00:00
bwmott 69df04607e Added a volume setting function which allows the generated sample's
volume to be controlled.  There's some code for the Mac which will
need to be updated for this to work in that environment.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@259 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 04:56:29 +00:00
bwmott e08568a3d1 Restructured the Sound class to support the improved SoundSDL class.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@258 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 04:54:25 +00:00
bwmott f7d5d44594 Changed calls to the sound object so that the current CPU cycle is
passed when a TIA register is modified.  Also added code to stop a frame
once it reaches the maximum number of scanlines for the current TV
mode (i.e., PAL or NTSC).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@257 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 04:53:04 +00:00
bwmott 6af61c8b79 Modified the constant representing the 2600's CPU speed based on
information in the 2600 Field Service Manual


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@256 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-13 04:49:03 +00:00
stephena 4c15baa3b1 - Added Driving Controllers to the list of devices supported by the
Stelladaptor.

 - Thanks for Mark Grebe for this code.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-06-04 12:22:12 +00:00
stephena c9f9448e77 Integrated the Settings/SettingsWin32 classes into the StellaX frontend.
That means I was able to ditch the ugly INI file code, and use the Settings
classes directly.  It also means I don't have to pass many options to Stella
commandline program through commandline arguments, since they'll already
be in the config file.

This is the beginning of fully integrating the Stella commandline program
with the StellaX GUI.  It won't happen for this release, but in later
releases these may become one program again.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@254 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-28 23:16:26 +00:00
stephena 6f9618a4da Removed dependency of Console from the Settings class. It didn't make
sense for the Settings class to have to depend on Console, especially
since I plan to use the Settings class in the Windows frontend.

Removed the snapshot filename code from the individual SettingsXXX classes,
since it was redundant.  Instead, added a ::fileExists() method, which
is the only thing that was really platform-specific about the code
anyway.

Linux and Windows ports have been updated.  The Mac port will have to be
updated to work with this.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@253 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-28 22:07:57 +00:00
stephena af928f7dad Made the Driving class actually refer to Driving Controller events
instead of joystick events.

This bug has been present in the codebase for over 3 years (at least).
Thanks to Mark Grebe for pointing it out.

This means that you will no longer be able to use a gamepad/joystick
for both joystick *and* driving controller events at the same time;
you'll have to map a particular device to either an internal Atari
joystick *or* an internal Atari Driving Controller.

This also means that the Driving Controller remapping now actually
works.  Previously, it didn't do anything.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@252 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-28 19:08:12 +00:00
stephena 1753bb8b48 Removed the event mapping of 'Escape' ==> 'Quit Emulation' for the MacOSX
port, since Mac users are accustomed to using Control-Q instead.

To any Mac users who are testing the code at this point; you'll have to
delete your Stella config file for this change to take effect.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@251 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-28 18:25:19 +00:00
stephena 2f1d07c207 Some more code cleanups for the StellaX frontend. The configuration
dialog actually works now without crashing the program.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@250 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-27 22:02:35 +00:00
stephena a0f6eaa4ff Start of updating the StellaX binary for use with the commandline
Stella program.  Right now it doesn't do anything, but at least it
compiles :)

Since most options can be toggled at run-time in the Stella binary,
and most of those changes are saved by Stella itself, I'm probably
not going to add many options to StellaX (only the ones that can't
be changed through Stella itself).  The next version will hopefully
have more configurable options.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@249 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-26 22:04:15 +00:00
stephena 5ea4e02afc Updated the documentation. This means a new release is getting close ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@248 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-24 19:03:19 +00:00
stephena 19fc2e5a93 Fixed the makefile wrt latest changes to the codebase.
In the future, you should use the '-P' option to CVS update
or checkout to prune all the old directories which no longer contain
any files.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@247 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-24 17:49:43 +00:00
stephena 8b5bdd2340 More codebase cleanups.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@246 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-24 17:32:45 +00:00
stephena 469f00eefc Reorganized the codebase, since half the stuff here is obsolete.
It's still in the main CVS repository if you want it ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@245 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-24 17:18:23 +00:00
stephena d9c3b3eb60 - Fixed the PaddleOneFire event. Pressing the fire button on paddle 1
(second paddle on first Stelladaptor) actually generated a PaddleTwoFire
event.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@244 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-13 12:38:17 +00:00
stephena 5719fa117a - Added Stelladaptor support for joysticks and paddles. Since I don't
yet have a driving controller, I can't add support for it (donations would
be welcome :)

 - The buttons/axis events seem to work, but I really have to push
hard on the sticks for an event to register.  It's probably because of
the crappy controllers I have.  I'll test on a real 2600 when I get a
chance.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@243 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-11 19:42:55 +00:00
stephena 861bf5a21a - Added preliminary support for Stelladaptors. The first detected
Stelladaptor will act as the left joystick/paddles 0 and 1/left driving
controller.  The second detected Stelladaptor will act as the right
joystick/paddles 2 and 3/right driving controller.  Any other Stelladaptor
will be ignored.

 - Of course, since I don't actually have my Stelladaptor yet, only the
detection of Stelladaptors is present; the actual functioning is not done
yet (but I expect it will be quite easy to add it).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@242 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-05-06 00:06:20 +00:00
stephena ada3f7cf24 - Removed the 'joyleft' and 'joyright' arguments, since they never
really worked right anyway.

 - Stella now tries to open all joysticks you have (up to 4), and
they can then be remapped any way you want.

 - As of the previous cvs commit, all old state files are now
invalid.  Sorry, but it had to happen sometime (and it may happen
again).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@241 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-27 00:50:52 +00:00
stephena 6c3b06d19e - Added support for digital sound again. It didn't work as well as I
would have liked in the 1.3 release, and it still doesn't.  The background
music in Pitfall2 is there, but it's scratchy.  And in Quadrun, you only
hear one 'quadrun' instead of 'quadrun, quadrun, quadrun'.

 - For now, you can disable/enable it by (un)-commenting the line
'#define DIGITAL_SOUND' near the top of the SoundSDL.cxx file.

 - For those of you that care, here's the problem:
     Previously, the correct number of sound samples were created and
     the audio system had delays inserted to account for it.  Problem was,
     the delays were causing 'jumps' in the video rendering, since the
     sound code was delaying every frame.

     Now, the audio system only takes as many samples as is needed.  This
     eliminates the audio/video sync problems, since there are no delays
     at all.  But the problem now is that if more samples are generated
     than the audio system requires, some are lost and/or overwritten.
     I do place them in a queue, but the samples are being generated faster
     than they're being removed.  So things don't sound quite right.

 - At least that's what I think.  We need some way to combine both approaches,
so that the audio system only gets as many samples as it needs, but in *those*
samples, all the sound information up to that point must be present.  I guess
the samples will have to be mixed, or something.

 - If anyone has ANY suggestions at all, they would be greatly appreciated.

 - And for anyone who doesn't have a clue what I'm talking about, let me
say I really &&%*(&* hate sound programming.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@240 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-26 17:27:32 +00:00
stephena 87277a770f Fixed some state problems with (un)grabbing the mouse and showing/hiding
the cursor.  It should now work correctly.

Thanks to Mark Grebe for the suggestions.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@239 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-26 12:49:46 +00:00
stephena cc9a03f512 - Beginings of support for MacOS X. That's right boys and girls, there's
an OSX port on the way.

 - Added z26 palette support.  Use Control-P to switch between the three
available color palettes.

 - Special thanks go to Mark Grebe for all the above changes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@238 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-21 16:27:34 +00:00
stephena 27c957b45f - Changed back to updating sound per-scanline from per-frame. It doesn't
seem to add any more overhead, and it's theoretically supposed to sound better
(jury's still out on that one).

 - Added a patch that fixes compiling under OS X with Fink (thanks to Julian
Squires).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@237 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-20 21:08:03 +00:00
stephena dfdfc9a139 Changed the current version string to 1.4_cvs, since it isn't actually
1.4 final yet.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@236 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-16 13:10:37 +00:00
stephena d64aacef70 Fixed the palette problems in 24/32 bit OpenGL video modes.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@235 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-15 22:52:43 +00:00
stephena 0591a92fa7 Moved some OpenGL init code around in the FramebufferGL class. This fixes
the annoying flashing that was happening in Linux.  Hopefully it will fix
the Windows GL code as well ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@234 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-15 21:27:31 +00:00
stephena fa5d1f97ac - When switching to fullscreen OpenGL mode, only use some predefined, common
resolutions.  Fixes the problem in Linux of getting weird refresh rates,
and will hopefully fix the fullscreen OpenGL Windows problems as well.

 - Removed the option of automatically pausing when toggling fullscreen/
windowed mode since it was getting on my nerves :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@233 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-12 23:28:43 +00:00
stephena 1f45ed9744 - Major changes across the board with respect to sound. The sound code
has basically been reverted to 1.2 functionality.  The good news is that
the video and audio are always in sync, even in Windows.  The bad news
is that we've lost advanced sound in Pitfall2.  I know what's required to
fix it, but I'm seriously considering doing a new release and waiting
until the release after that to fix it.  Right now (with release 1.3),
most games have laggy sound, even under Linux, but the background music
in Pitfall2 is there.  I'd rather do a new release with Pitfall2 not
completely working, but having everything else working great, than wait
another month or two.  I'm sure most people will agree ...

 - The Windows port has some slight popping every now and then.  Damn, I
really hate Windows sound programming.  It just can't handle low-latency
sound generation as well as Linux (shameless plug).

 - Added options '-fragsize' and '-bufsize', which set the sound fragment
and buffer sizes, respectively.  They're currently set to 512 and 1536,
and this seems to work best.

 - Fixed an error in calling 'putenv' in mainSDL.  Now the Windows port
actually starts with the game window centered.

 - Finally, IMHO (baring Pitfall2) Stella now works better wrt A/V sync
on Linux than z26 does on Windows (a bit of friendly competition :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@232 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-04 02:03:15 +00:00
stephena 7c5ebdddf3 - Added an option to the makefile to specify the number of CPU's to use
with 'make -jN' when compiling on SMP or distcc-based machines.  Defaults
to 1 CPU, and most people won't need to touch it.

 - Cleaned up some sound related build options in the makefile.  Now
there is only one sound option (SDL, since the codebase is standardizing
on SDL), and the OSS and ALSA drivers are being discontinued.

 - Moved the settings that were specific to Linux SDL port to the emucore
Settings class, since they are now relevant to all SDL ports (including
Windows).

 - Reworked the sound selection code in mainSDL.  Now the '-sound'
commandline and ini-file argument is a boolean, representing whether
sound is enabled or disabled.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@231 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-03 18:54:23 +00:00
stephena b6325d98a0 I've finally started development on Stella again ...
Many changes to the makefile representing the 'SDL-ification' of the
Stella codebase.  Now there are 4 make options which should be
self-explanatory: "linux, linux-gl, win32, win32-gl".

The codebase now compiles under Linux (with gcc) and Windows (with MinGW)
from the same makefile without any editing or modifications.  So there
is finally full cross-platform support.

Next step is to fix the small OpenGL regressions in Windows, and finally
move to the dreaded sound code.  Then a new release ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@230 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2004-04-03 03:06:45 +00:00
stephena 8524727d42 Moved some more redundant code from the SDL child classes to the
parent class.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@229 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-12-10 18:58:56 +00:00
stephena eddc10294d All changes are to the SDL version.
Made emulator pause when toggling between windowed and fullscreen
modes.

Added code for the TEXTURES_ARE_LOST definition.  In Windows, when
changing the window size or toggling fullscreen/windowed modes, the
OpenGL textures are lost and must be reloaded.  This now works.

Fixed a long-standing bug in snapshot files.  I made sure they were
opened in binary mode.  That wasn't required in Linux.  Sometimes
developing multi-platform code can really work the bugs out.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@228 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-12-06 00:17:29 +00:00
stephena 1457853110 Some more cleanups wrt the sharing of the SDL codebase between
Linux and Windows.

Reworked the Makefile (again).  Now you have to edit it and select
which system you are using for the SDL port (linux or windows),
then start compilation with 'make sdl'.

The makefile is starting to get harder to manage, and with the
explosion of features, I'm looking into moving to a configure
script (autoconf and automake) for a future release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@227 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-12-05 19:51:09 +00:00