Commit Graph

8036 Commits

Author SHA1 Message Date
stephena 267a9edf25 We're getting closer to a simple user interface. The framework
is basically there.  All I need to do now is create methods that
actually draws text, boxes, cursors, etc.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@190 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-26 00:32:00 +00:00
stephena 1359d7a14f Beginnings of the user interface required to actually see
changes that are being made to key remapping.  I think that
the key remapping will work, but we won't know for sure
until the GUI is done and we can actually test it :)

The eventhandler depends on getting *KEYPRESS* events.
Specifically, a key press is not the same thing as a pressed
key :)  For example, the Windows and DOS ports scan the
keyboard and send the state 60 times per second.  So if a key
was pressed and held for 1 second, the Windows and DOS ports
will send 60 keypresses, when it should send only one.

Having a key pressed for 60 seconds IS NOT equivalent
to 60 keypresses.

This will have to be fixed in the frontend, most likely
by having 2 keyboard state arrays and only sending the
changes per update.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@189 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-25 16:20:34 +00:00
stephena fe9a77090e Updated Windows port for the recent changes to the Settings class.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@188 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-23 19:41:16 +00:00
stephena ab62868912 Added error checking to the Settings class. Now, only settings
specified in the program will be saved to the rcfile.  Previously,
*any* text in the rcfile was saved on exit, even bogus settings.

Also, any settings given from the commandline which are not meant
to be ever saved in the rcfile are now actually not saved.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@187 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-23 17:27:11 +00:00
stephena 4651f21bcd Changed the Settings class to act like Props class. Now it contains
properties of the <key, value> type.

This is a much cleaner approach, and it eliminates the problems of
object slicing experienced before (passing SettingsUNIX through a
Settings pointer, and then needing the stuff specific to SettingsUNIX,
requiring a cast).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@186 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-23 00:58:31 +00:00
stephena dd6d7f7981 Cyberstella finally compiles! After a year of inactivity, I decided that
someone had to look at the code and do something with it.

As of now, joysticks and mouse aren't working.  Settings aren't saved.
And sound support is patchy.  Definitely a work-in-progress.

It looks like I'll be the maintainer for this as well, at least until
we can find someone who is willing to take over full time.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@185 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-21 14:33:34 +00:00
stephena e25d504c02 The functionality of these files has been integrated into SettingsUNIX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@184 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-20 13:41:37 +00:00
stephena 63ea3d3e93 Eliminated requirement for two platform specific files wrt porting.
They both referred to each other, so it made more sense to only have
one file.

Porters will now only need to define their own SettingsXXX, derived from
Settings.hxx, for platform specific stuff.

Updated the X11 and SDL ports wrt to the previously mentioned stuff.
The next task will be to update the DOS port, which should be
incredibly easy (assuming I can get a stable DOS dev environment) ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@183 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-19 15:45:01 +00:00
stephena 14de7f7e62 Preparations for addition of the Snapshot class to the core.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@182 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-12 18:08:54 +00:00
stephena b1c31fdd1a X11 and SDL versions now fully compile and fully support the new
EventHandler class.  All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...

Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.

Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:

A port needs the following:

 - a main function which takes native events and converts to the core
   format, and generally acts as the dispatcher (mainXXX.cxx)

 - a specific frontend, derived from Frontend.hxx, which sets up port
   specific filename and locations (FrontendXXX.hxx)

 - a specific settings class, derived from Settings.hxx, which deals
   with settings/commandline arguments specific to that port (SettingsXXX.hxx)

 - probably some other stuff that I've forgotten


The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).

I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself.  And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on.  It never ends ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
stephena 68e30ca3f2 Ported X11 joystick handling to the new eventhandler class.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@180 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 00:13:39 +00:00
stephena b2f6fa4823 Partially ported the X11 version to the new eventhandler class. It now
compiles and runs, but I haven't done any testing yet.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@179 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-09 16:45:47 +00:00
stephena 3ab45a632d Initial support for key remapping is finally here. Now for the bad news:
1) It exists in the core, but only the SDL port is updated to use
it.  And the other ports don't even compile yet ...

2) The mappings for keyboard and joystick are saved in the rcfile, but
for reasons of efficiency and ease of programming, the format is somewhat
cryptic.  But the plan is to never have to edit the maps directly anyway.

3) There is no GUI in Stella to set the remapping.  This is the next
major thing to do, after I get the other ports to at least compile.

4) I haven't documented the format of the maps in the rcfile.  Its not
difficult to modify, just tedious.  If anyone is reading this and really
wants to know (or even cares), email me directly for instructions.

Enjoy :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@178 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-07 18:30:28 +00:00
stephena 21eb45ddf1 More code changes and reorganization for key remapping. The SDL version
now uses the EventHandler class and doesn't directly handle events itself.

All thats left for key remapping is to create load/save methods for the
event arrays.  Of course, to actually change events from within the
emulator will require a GUI, which I haven't even started yet :)  The GUI
will have to wait until the graphics rewrite, where we go to a full
320x200 framebuffer (versus the 160x200 one we have now).

In the meantime, remapping will be configurable from the rcfile only.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@177 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-06 21:17:48 +00:00
stephena 06a673592f Yet more code reorganization in preparation for key remapping.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@176 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-05 18:02:58 +00:00
stephena 3d45e5801e Some more code cleanups related to key remapping. I think we may
lose the ability for Shift-F10 to cycle downwards through the
available states.

One other thing; the current CVS source won't compile for X11 or DOS,
and not everything works in SDL.  This can't be helped, as I'm fixing
the frontends one at a time.

Windows hasn't been able to compile for quite some time, and unless
someone looks at it soon, its going to get a serious case of bit-rot ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@175 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-04 23:23:06 +00:00
stephena 69bb79776d Beginning of huge reorganization of some code to make the frontends
easier to manage, and to enable key-remapping.

After these changes are complete, the EventHandler and Settings
classes will be merged into the core and no longer optional.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@174 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-04 16:50:48 +00:00
stephena f8cf40361c Beginning of support for key remapping in the core. For now, only the
SDL version has been changed (not fully), and it doesn't actually do
any remapping yet :)

The new class 'EventHandler' will receive all events and will dispatch
them to the core.  The frontends will no longer deal with events
directly, but will convert them from native format (SDL, X, DOS, etc.)
to core events.  The actual remapping will be taken care of in the core,
and each frontend will never know about it.

For those frontends that don't wish to take advantage of core remapping,
they can still use the 'Event' class directly.

Eventually, this will be extended to the joystick code as well, but I
don't think it would be wise to remap the mouse.

One thing that has changed is that it will no longer be possible for
one key event to activate more than one core event.  It doesn't make
sense to do it, and I'm not sure the original code actually worked
anyway.  One core event can be mapped to more that one key event,
however (Joystick fire 0 could be activated by Joy button 0, Space,
Left Ctrl, etc).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@173 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-03 20:10:58 +00:00
stephena ec407e7c60 Applied patch from Daniel Richard G. (with modifications) concerning the
default behaviour of the volume settings.  Now, if no volume settings
have been specified, this means that changing the volume is disabled,
and the volume won't be changed on program start or exit.  Specifying '-1'
for the volume will have the same effect.

This is the new default behaviour.  If you want a different volume, you
now have to specify it.

Updated the documentation concerning using '-volume -1'.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@172 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-25 03:12:55 +00:00
bwmott 69d189c15f Updated text files with information for the 1.3 release.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@170 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 19:07:04 +00:00
bwmott 9fa22953d9 Updated documentation for the 1.3 release.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@169 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 19:02:48 +00:00
bwmott 1c69f95546 Voch's latest stella.pro file.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@168 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 05:23:51 +00:00
bwmott 7c1c6549f4 Add vga.o target for DOS port.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@167 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 05:20:18 +00:00
bwmott 2b0b275655 A number of changes have been made to the DOS code:
* Variables and functions accessed during interrupt service routines
    are properly locked to ensure they are in physical memory.

  * The emulation can be synchronized with the VSYNC of the video
    card instead of using the system timer.  The is the default
    behavior when running under Windows NT/2000/XP since the DJGPP
    system timer functions do not operate correctly under these
    operating systems.

  * New routines have been added to setup the graphics modes.  The
    new modes should run at 60Hz instead of the standard 70Hz for
    the 320x200 mode.

  * The stella profile is search for in the current working directory
    as well as the $STELLA_HOME directory.

  * When loading a ROM it is looked for in the current working directory,
    $STELLA_HOME/ROMS, and finally $STELLA_HOME.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@166 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 05:17:42 +00:00
bwmott 2a66c0ea9a Updated the fragment size and the high water mark for the sample queue
so that sound works better under Windows NT/2000/XP systems.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@165 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 05:09:21 +00:00
bwmott 28572bbff3 Modified the autodetect routine to include a search for 3F style
bankswitching as suggested by Adam Wozniak.  This allows most of
the demos/homebrew games being created using this method to work
without a stella.pro file entry.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@164 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-02-17 04:59:54 +00:00
bwmott 8d530f38a2 Added state saving and loading using the F9, F10, and F11 keys. The
game state is stored in a 'state' sub-directory of the current working
directory or in a 'state' sub-directory of the directory specified by
the 'STELLA_HOME' environment variable if it is set.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@163 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-01-08 05:19:07 +00:00
bwmott 7ca813cc1b Fixed a bug reported by Erik Eid in the stella@biglist.com during August
2002 regarding the difficulty switches being reversed.  It looks like
this bug was introduced in the 1.0 release of Stella (only took 4 years
to find and fix it :-)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@162 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-16 06:24:18 +00:00
bwmott 897604d379 Added code to the bankswitching type auto-detect method so that ROMs
which are 10,495 or 10,240 bytes in length are considered to be DPC
based games.  This should allow hacks of Pitfall II to work.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@161 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-15 05:49:04 +00:00
bwmott ab92e184cd Updated the default value for the "Display.Height" property from 38 to 34.
Looks like this works better for games when the stella.pro file is missing.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@160 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-15 05:13:19 +00:00
bwmott 280d42d0e4 Changed the timer so that it has a random value after a reset. This fixes
the issue with the robots in Berzerk always appearing in the same pattern
when the game starts.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@159 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-15 04:58:14 +00:00
bwmott 603f72d9b4 Added code so that the "Cartridge.MD5" property is always set once the
console is created.  If properties are not found for the ROM then the
MD5 value will be set to the MD5 value of the ROM.  This allows the
"-showinfo" command line option to display the MD5 checksum of unknown
games...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@158 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-15 04:40:55 +00:00
bwmott 890db3b3e5 Fixed a bug regarding resizing the window using the '-' and '=' keys. The
call to resize the window needed to be after the call which tells the
window manager the maximum size of the window.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@157 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-15 04:10:56 +00:00
stephena c41a53ac7c Some small code cleanups in preparation for the 1.3 release.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@156 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-05 16:46:14 +00:00
stephena fd2dc1e33b Fixed bug in the saving of pictures with a PAL palette.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@155 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-05 16:44:56 +00:00
stephena bbc5ada9e6 Added an error function that prints an error and frees any resources.
Removes some duplication of code.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@154 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-05 16:43:57 +00:00
stephena 1dea24d7cc Using -showinfo 0 will not show any non-urgent messages. Errors are still
shown, and cannot be turned off.

Barring any errors encountered in memory allocation (etc.), using
-showinfo 0 will not output ANYTHING to the console.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@153 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-01 17:06:18 +00:00
stephena 39516ebe4e Documentation for the latest changes that were made.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@152 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-01 16:24:24 +00:00
stephena 79769a946c Fixed load/save state support for the few remaining Cartridge types.
Some of these haven't been extensively tested, so YMMV.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@151 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-01 15:59:47 +00:00
stephena 45d2942722 Updated makefile to selectively build ALSA backend into X11 and SDL ports.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@150 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-01 02:14:01 +00:00
stephena 00515a2ba2 Updated X11 and SDL ports to make use of the new ALSA sound backend.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@149 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-01 02:13:14 +00:00
stephena 9feac30d84 Added ALSA v0.9 API sound backend to the X11 and SDL versions.
This is BETA code and should be thoroughly tested.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@148 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-12-01 02:12:26 +00:00
bwmott 22b69558ce Fixed some typos in the loading of the sound registers in the state
loading routine.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@147 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-19 04:33:48 +00:00
bwmott c1043e2dc9 Added code to handle the music mode data fetchers in the DPC chip so that
all of the Pitfall II music is played now that the TIA sound routines can
handle it.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@146 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-19 04:29:21 +00:00
stephena ca438890ff Updated the manual with the latest code changes.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@145 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-13 16:41:24 +00:00
stephena 6a8a689e85 Created a new Sound class that does almost nothing :) Useful for
compiling (or running) Stella with no sound support whatsoever.

Added ability to compile multiple sound backends into the X11 and SDL
versions, and to dynamically select from among them at run-time.  For
now, the X11 version can't use the SDL sound core.  This is in
preparation for the ALSA sound backend, which may or may not make it
into Stella 1.3.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@144 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-13 16:19:21 +00:00
bwmott 39dd0d716f Changed the upper and lower bounds on the sample queue so that there's
a little more room for error.  Also added a call to SDL_Delay in the
blocking section of the updateSound method so that it doesn't hog the CPU.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@143 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-13 05:01:31 +00:00
bwmott f9c3e778c8 Updated the DOS port to use the new sound routines in the core. Also
switched to a new set of low-level Sound Blaster routines which appear
to provide better Sound Blaster support and the ability to auto-detect
sound card settings.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@142 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-13 03:47:55 +00:00
stephena b93d8d186d When saving snapshots, now the messages are printed to the screen (instead
of stderr).

Fixed the X11 version wrt to merging changes into the main properties file.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@141 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-12 01:50:06 +00:00
stephena b2fdecf86e Removed unnecessary reference to <algorithm>.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@140 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2002-11-12 01:02:16 +00:00