Commit Graph

5625 Commits

Author SHA1 Message Date
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
stephena 41556196e4 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
2003-12-04 22:22:53 +00:00
stephena 083245cf9c Added the ability to dynamically switch which palette the emulator
uses to the SDL port.  Currently, the three choices are the current
Stella palette (standard), the palette from version 1.1 (original),
and the one from the z26 emulator (z26).

The '-palette <standard|original|z26>' option can be used from the
commandline, and Control-P can be used while within the emulator.

I haven't actually added the z26 palette yet, so when you switch to
that one, you get a blank screen.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@225 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-12-04 19:18:45 +00:00
stephena eaa92d3faf Moved some redundant code into the parent FrameBufferSDL class.
Added the Cyberstella icon to the SDL port.  No more ugly looking
'X' icon for Stella in Linux.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@224 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-12-03 18:11:25 +00:00
stephena f3402ce255 Show a message when the OpenGL filter type is changed in the SDL
OpenGL port.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@223 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-12-02 01:46:40 +00:00
stephena 8c52f29bfe Put some #ifdef's around code that was Linux/UNIX specific in the various
SDL FrameBuffer classes.  This is in preparation for the port of the SDL
version to Windows (which already runs quite well).

This may eventually be a replacement for Cyberstella ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@222 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-30 22:50:15 +00:00
stephena 8915cf50bf Added an in-game key 'Alf-f' to dynamically switch between filtering
modes in the OpenGL SDL port.

Updated the documentation with the changes to the SDL commandline
arguments.  Rewrote the Linux requirements and installation
procedures.

Merged all todo stuff into the Todo.txt file, and removed the
redundant CyberstellaTodo.txt.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@221 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-30 03:36:51 +00:00
stephena 4e8e332370 Completely (hopefully) removed all references to the registry stuff.
All Settings should now be saved in the stellarc file.

Activated all former settings in StellaConfig.  You can now select
different options from the config dialog box and actually have
them work in the emulation core.

Cleaned up the main file lister user interface a little.  Specifically,
when you resize the window, the internal file lister should resize
as well.  This one was bugging me for a long time.  There's still
some work to do when making the outer window smaller than the inner
one though.

Made first pass at the SoundWin32 code.  It now sounds *much* better
than it did before, but there's still some work left to do.  I've been
looking at other Windows Atari 2600 emulators (PCAE and Z26), and
I've noticed that while their sound generation is clear and doesn't
have pops, the pitch and latency is still off a bit.  The only time
I've ever heard it work correctly is in the Linux version of Stella,
and I'm trying hard to make Cyberstella work the same way.

Note, this isn't a slam again PCAE or Z26, or saying that Linux
is superior to Windows (I'll leave that to another discussion ;).
It's just that Stella and the sound code were originally
developed under Linux, and that's where it seems to work best
(and I'm hoping this will change).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@220 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-24 23:56:10 +00:00
stephena 120dd7b268 Re-enabled saving of the event remappings to the rc-file.
Moved the refresh() method to FrameBuffer::refresh(), since
all ports may need it.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@219 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-24 14:51:06 +00:00
stephena 6aef328c60 Removed most of the Registry stuff and replaced it with
references to SettingsWin32.

Made many changes to FrameBufferWin32, cleaned up the code
and renamed variables.  I may only release fullscreen mode
for version 1.4, so I decided to clean it up a bit.

Enabled SettingsWin32 code.  Now you can save/load state
files.

Reorganized the base Settings class a bit.  It had a
dependency on a Console being created when it shouldn't
have.  As a result, any changes made to event remappings
won't be saved.  I'll fix it tomorrow; time for sleep ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@218 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-24 01:14:38 +00:00
stephena 0058d868a4 Made the lines on the menu boxes look a little better in the SDL
OpenGL port.

Added a FrameBufferSDL::refresh() method that's triggered when
the window needs to be redrawn (SDL_VIDEOEXPOSE event).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@217 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-23 20:54:59 +00:00
stephena 7efab7f29c Some further optimizations to the SDL OpenGL port. I've reduced maximum
CPU usage from 14% to approx. 10%.  While that may not seem like much,
it's actually a 28% improvement.

The only way for it to get much better is to switch to paletted OpenGL
textures, but since they aren't supported in all versions of OpenGL,
I may not even bother.

For reference, the software SDL port uses a maximum of 5% CPU.  I don't
see the OpenGL port ever getting that low.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@216 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-22 20:13:11 +00:00
stephena b4388d45c0 Updated the Cyberstella port wrt the recent Sound class
changes.

Added code to draw menus to FrameBufferWin32.  This will be
changed around soon, when I get to implementing the windowed
modes.  I added it now to make sure that remapping works from
the in-game GUI (it does!).

Most of the core features are now working.  I need to add
windowed mode (as mentioned above), then start cleaning up
the settings and getting rid of the registry crap ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@215 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-19 21:06:27 +00:00
stephena b15698ff2e Broke the dependency between the FrameBuffer and Sound classes
wrt to the MediaSource.

Previously, in the main run loop for a port, you had to call
FrameBuffer::update and then
Sound::updateSound(FrameBuffer::MediaSource).  Now, you can call
FrameBuffer::update() and then Sound::update().  But since the
ordering here is important, I've introduced a Console::update()
that does it all.  So the main run loop for each port just
got a bit simpler.

Also changed around the Snapshot class a bit.  All this is to
reinforce the fact that the MediaSource is owned by the core,
and the FrameBuffer, Sound, and Snapshot classes make use of
it.  Previously, it seemed as if the FrameBuffer owned the
MediaSource.

I'm finding all these little inconsistencies because of
writing the Porting.txt document, and trying to explain
why something is being done a certain way (and if I
can't explain it, I rewrite it).  So if for no other
reason, the Porting.txt document has already been
valuable.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@214 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-19 15:57:11 +00:00
stephena e123a4f22f Some cosmetic changes to the sound classes, in preparation
for a minor reorganization of Sound code (the update
performed in the main loop will eventually be done by
Console::update() only, instead of updating the display
and sound separately).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@213 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-18 21:39:02 +00:00
stephena 6a4af2b17a Some performance tweaks for the SDL OpenGL port. For reference,
I'm on a Celeron 766 with a crappy ATI card.  Under normal usage,
CPU usage has dropped from 60% to 8.5%.  But there is still a
slowdown when showing alpha-blended rectangles at the current
framerate.  I'm about to mark this up as being caused by the
crappy card and OpenGL implementation I'm using, so performance
may not get much better than this.  On my development system
(even before this latest patch), CPU usage never goes above 14%
(granted, that system is a P4-2.4 with GeForce4MX card).

I'll try to run on a similar system to this Celeron, but with
an NVidia card, and see if the ATI card drivers are actually
at fault.

But I really do think its the OpenGL drivers, since software
mode never uses more that 4% of the CPU, and that is at 1280x1024.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@212 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-18 15:04:17 +00:00
stephena 6983686e91 Added the ability to change the aspect ratio of the screen in the SDL
OpenGL port.  Normally, the window is double the native TIA frame
width, so we always get a ratio of 2.0 (2:1).

Now, if you're using OpenGL mode, the '-gl_aspect' commandline argument
can take a decimal number representing the ratio you want to use.
For example, normal TV mode would be 1.3333 (4:3).

Depending on the resolution you use, you can make the window look much
more like the original Atari.  I find that in 1600x1200 mode, an
aspect of 1.6 looks quite authentic.

This is only supported in the SDL OpenGL port for now, since changing
the aspect took only 1 line of code (I love 3D graphics :)  It may
never be supported in software SDL, since it is quite a bit harder
to do it in software.

Ditto for the Cyberstella DirectDraw7 code (it will probably never be
implemented, unless hardware scaling is available).  If/when I get
around to the Direct3D port, it will be trivial to do there as well.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@211 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-17 17:43:39 +00:00
stephena 77477bd297 Added DirectInput 8 joystick support. For now, up to 8
joysticks are used (the limit in the Stella core).  I only
have a single joystick on my development system so I
haven't yet actually checked if it works with multiple sticks.
I see no reason why it wouldn't.

Since remapping is now in the Stella core, we automatically
get joystick remapping.  The core GUI for changing events
hasn't been done yet (quite simple, but I'm waiting for the
FrameBuffer rewrite), but I've been successful in changing
the remapping directly in the stellarc file.

So one huge feature request has been completed (multiple
joysticks and event remapping),  Next I'll work on the
remaining oft-requested feature (windowed and fullscreen
mode in the same program, without a recompile).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@210 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-16 19:32:52 +00:00
stephena 35db4988ad It seems this file is needed for Visual Studio.NET.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@209 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-14 00:51:57 +00:00
stephena 6861331670 Added mouse support to the DirectInput class, and detection
of mouse events to MainWin32.

Removed the DI_Event type structures.  While it made the code
look nicer, we really didn't need the performance hit (however
small it may have been) of serializing and deserializing the
events.

Removed the rest of the framebuffer code from MainWin32.
Made sure the exit event (Escape) was sent to the core,
so that current settings could be saved.

Next I'll look at the joystick code (should be quite easy).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@208 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-14 00:47:35 +00:00
stephena 98d447fcbc Another small fix that I forgot to include.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@207 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-13 12:50:11 +00:00
stephena 7b72240fa2 A small fix that I forgot to include in the last commit.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@206 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-13 00:26:58 +00:00
stephena 24968d9976 First of all, I forgot to include the MainWin32 class before, so it
really didn't compile :)

And now for the changes.

1) I've updated the DirectInput class to DirectInput 8, and moved
to an event-based system, somewhat similar to SDL.  Only the
keyboard is supported for now, but adding joystick and mouse should
be quite easy.

2) I've (almost completely) moved the FrameBuffer stuff out of
MainWin32 and into FrameBufferWin32, where it actually belongs.

Next, I'll work on more code cleanups, and then I'll attempt
to switch to the experimental DirectDraw code (so we have
windowed *and* fullscreen modes dynamically).

All things considered, its coming together faster than I thought ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@205 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-13 00:25:07 +00:00
stephena 9d2e1cfcc0 Changed the behaviour of pause() wrt the FrameBuffer. Now the base
FrameBuffer class is paused, and *it* notifies the child class of
this event.  Previously, the code for pausing the parent class
had to be provided by the child, meaning that if the derived
classes of FrameBuffer didn't provide it, then the emulation
core would not pause.  This is exactly what happened to me
in the Windows version, and I spent 10 minutes trying to figure
out why pause wasn't working :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@204 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-12 19:36:25 +00:00
stephena 505a38057d Changed the font handling in the SDL OpenGL port. Previously, all 256
characters were stored in one texture, and pieces of that were carved
out when a particular character was needed.  That approach left visual
artifacts in GL_LINEAR mode because of the way OpenGL divides up
textures (clamped to [0,1]).

The new approach is to use 256 8x8 textures, and draw them separately.
It actually makes the drawText() and drawChar() methods much shorter.
This may be slightly slower than before, but since large numbers of
characters are only ever drawn when needed (versus at the current
framerate), I don't think the speed difference will be noticed.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@203 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-12 15:12:06 +00:00
stephena 34addb87c6 This is the first pass at getting the Cyberstella port working.
It now partially compiles again, but many features are still
missing.

Added a FrameBufferWin32 class.  This will eventually contain
DirectDraw windowed and fullscreen code, but for now it does
nothing.

Upgraded the project to Visual Studio .NET.  It will no longer
compile with VC++ 6.

Now for the parts that will definitely change:

1) Right now, the MainWin32 class is also acting as the FrameBuffer.
The relevant code will be moved to FrameBufferWin32.

2) The DirectInput class will be completely rewritten to use
DirectInput8.  Also, I'll be moving to event-based input where
the state is taken into account.  The rewrite will also allow
multiple joysticks, and selecting which joystick input device
is mapped to which internal Atari joystick.

3) The SettingsWin32 class does nothing ATM.  It will be expanded,
and will replace using the registry (the associated registry class
will be removed).

4) I haven't even looked at the sound yet.  I want to get all
other stuff working before I even attempt it.  It *did* make
some noise the last time I tried it, but something wasn't quite
right.

So, bottom line is that this compiles without sound, mouse,
joystick, windowed modes, and any of the 1.4 core enhancements.
But at least it compiles :)  I expect the extras to be worked
out quite soon (except for sound), since I've already done
most of the same thing in Linux.

And to potential porters; its still not ready, and you should
probably be looking at the SDL port anyway ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@202 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-11 18:55:39 +00:00
stephena fc96e5b0d8 Integrated the SDL software and OpenGL modes into stella.sdl.
You can now select the video backend with '-video soft' or
'-video gl'.

Cleaned up the menu text lines that were longer than the
current display width.  These lines are now truncated and
have a '...' appended to them.  The menu modes are now more
tolerant of display sizes.  So (for example), if some port
uses a 640 pixel wide framebuffer, the menu will now resize
and fully take advantage of all available space.

I've looked at the Windows code, but I still haven't mustered
the strength to work on it.  It will basically be a complete
rewrite of sound, video, and input classes.  And I'm not
looking forward to it ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@201 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-09 23:53:20 +00:00
stephena 8239748980 Huge changes across the map. Lets see if I can remember it all ...
There is now an SDL OpenGL port with filtering and alpha-blending.
It's a work in progress right now, but is already quite stable.
It's not as optimized as the software version yet, but this will
change as well.  For now, you have to compile the SDL version in
either normal software mode or OpenGL mode.  This will change
before the 1.4 release.

When entering menu mode, the emulation is now suspended.  And when
pause is pressed, you can't enter menu mode.  Because of these changes,
CPU use has dropped dramatically when viewing menus.  This will benefit
all ports, since menus are now redrawn only when necessary, instead of
at the current framerate.

For a reference, on a Pentium-IV 2.4GHz, the software SDL version
maxes CPU usage at 9%, and the SDL OpenGL version at 13.5%.  This is
at 60 fps and a zoomlevel of 4.  While some small improvements can
(possibly) be made to the OpenGL version, I think we'll soon be hitting
the glass ceiling.

Work on the Porting.txt document is progressing, and I estimate it to
be 45% complete.

The Windows version still doesn't compile, and I still haven't looked
at it.  Rest assured that it will be done before 1.4.  There will be
a simultaneous release, even if the Linux versions are finished.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@200 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-06 22:22:33 +00:00
stephena d098cb1207 Too many changes to list here specifically.
The major changes are a stabilization of the core code.  There should
be much fewer major core changes from now on.

Updated the SDL port to the latest core changes.  Next I'll start on the
Windows port.

There are still many optimizations left to do.  Specifically, when using
the SDL port on a Pentium4 2.4GHz, normal mode results in 4% CPU usage,
while menu mode makes it jump to 46%.  This must be improved.

The porters guide is a work-in-progress, and not yet available.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@199 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-10-26 19:40:39 +00:00
stephena c7233b35b0 Too many changes to document here. The codebase is currently
heavily broken pending a rewrite of the Framebuffer class.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@198 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-10-17 18:02:16 +00:00
stephena aa2a397b6c Cleaned up the UserInterface class a little.
Added arrows for user feedback in the key remapping section of the
UserInterface class.  Still have to indicate which key is being
remapped, though.

Added another menu to the main menu (of the GUI) called
'Character Set', showing the font being used.  I found it useful
for determining what particular character to use when coding
the GUI, but I don't know if it will remain in the final release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@197 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-10-01 19:01:02 +00:00
stephena bcd76bddfc Extended joystick enumerations. The core event handling now supports
8 joysticks with 20 buttons (and 2 axis) each.  That should be more than
enough for now (famous last words).

Of course, this doesn't mean that whatever system you run Stella under
can have 8 joysticks with 20 buttons.  It means that *IF* your system
does have a 20-button joystick, then Stella can handle it without
a recompile.

This was mainly included for those people that have gamepads with
hats, throttles, etc.  There shouldn't be more than 20 of those
per gamepad, so each would be mapped to a button.

For now, the event handling core only knows about buttons and
left/right, up/down axis events (which can be considered a button
as well).  It will be up to the frontends to map whatever your
gamepad has (hat, wheel, etc.) to something that Stella can
understand (a button).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@196 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-30 18:46:12 +00:00
stephena 87ba3c0b1e Finished adding remappings to the user interface. All remappable
events can now be remapped from the GUI.

Added joystick support for remapping.

Updated EventHandler with defaults for every remappable event
in Stella.

Updated the manual with changes to the key mappings.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@195 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-30 01:22:45 +00:00
stephena bbd7a69179 Added all typical keys from a 104-key keyboard to the StellaEvent class.
Updated the SDL port to bind to those keys.

Cleaned up the SDL port event handling method a bit.  By the time I'm
finished, I hope that almost all event mapping/lookups will be constant
time by using simple array lookup.

Next thing to do is to add all possible remappings to the UserInterface,
get the joystick remapping working, and then get to the Windows port.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@194 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-29 18:10:56 +00:00
stephena 4b7a2c475c The first version of a GUI for event remapping is here!
Now for the things that aren't finished yet:

 - Only the most basic functions can be remapped.  If you
erase the mapping for those that can't yet be remapped,
you'll have to delete the 'keymap' line from stellarc and
start over.

 - Core events can only be remapped to other keys on the keyboard.
I haven't got the joystick remapping working yet (but it should
be easy to do).

 - The TIA needs to be modified to show 320 pixels horizontally.
Right now, I'm using 8 pixel-width fonts on a framebuffer of
160 pixels, so there's not a lot of horizontal real estate.
So text will probably overwrite other stuff.  This is cosmetic,
and WILL be fixed.

 - Modification of the TIA will break every frontends rendering
code.  It had to be done sometime ...

 - I haven't yet added any user feedback mechanism for the user.  So when
you go into remap mode and are about to remap a key, you won't
know it :)  I'll be adding arrows (like in XMAME) ...

I've added a "Game Information" menu, which shows things like Game name,
manufacturer, rarity, type, etc.  Basically stuff from the stella.pro file.
It has no purpose other than for coolness :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@193 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-28 21:59:24 +00:00
stephena b9f5cbb1fe Some more interface-related stuff. I realized that the last commit
didn't compile.  This one does.

Removed reference to TIA::showMessage, and added
UserInterface::showMessage, since it was always meant to be a
GUI element.  Having it in the TIA class was a temporary hack.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@192 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-26 22:39:36 +00:00
stephena dbe02b2af4 Yet more changes to the user interface. Its beginning to come together.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@191 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-26 17:35:05 +00:00
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