Commit Graph

949 Commits

Author SHA1 Message Date
stephena ceac36923c Some fixes for 64-bit Linux. I just have to hear back from Mark wrt
the OSX port, and if it goes fine then dynamic OpenGL support will be done.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@960 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-14 23:50:43 +00:00
stephena 05c5225a6b A few minor fixes for Win32 and dynamic OpenGL. It seems the compilers
in Windows are a little more strict than Linux.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@959 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-14 22:29:34 +00:00
stephena 2c2b06226d Oops, forgot some configure stuff.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@958 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-14 21:45:22 +00:00
stephena b88d5ad3f6 First pass at dynamic OpenGL support. This means that OpenGL will no
longer be linked to the binary, but is opened at runtime.  This makes
automatic builds easier, so the nightly builds for Linux and Win32
should now support OpenGL.

Added 'gl_lib' commandline argument to change the OpenGL library to
use, but the defaults should work fine.

Everything works great in Linux; still TODO is test in Windows and OSX.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@957 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-14 21:36:29 +00:00
stephena 851d0356fe Hopefully this will fix the stella nightly automatic build failure.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@956 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-14 00:31:03 +00:00
stephena 53d70797d8 Phosphor effect now working for software render in 16/32 bit color modes;
still TODO for 24 bit mode.

I've benchmarked the CPU usage in Linux under 16/32 bit modes, and they're
within 1% of those for z26.  Not bad for C++ vs. assembly code :)  I still
need to test in Windows, which (ironically enough) tends to be slower than
Linux in graphics performance.

Note that CPU usage ranges from 6% (Linux/1x/software/phosphor/16bit) to
85% (Linux/3x/software/phosphor/32bit).  Using OpenGL, the usage is always
12%, whatever the zoom/color depth/phosphor.  I just love OpenGL ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@955 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-12 16:23:36 +00:00
stephena b4525b5ff7 Starting to convert software mode to use the phosphor effect; it's almost
completely broken right now.  I *really* hate software buffers.  Why
can't everyone have hardware support for zoom and color depth (aka OpenGL)?


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@954 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-11 20:28:07 +00:00
stephena 63275fc581 Remaining updates for phosphor settings for games that need it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@953 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-11 15:17:39 +00:00
stephena d784073016 Added ability to dynamically toggle phosphor effect, bound to the Alt-p key.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@952 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-11 14:13:19 +00:00
stephena a70171b28c Fix for GP2x (hopefully), whereby the screen contents from previous
modes weren't being erased.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@951 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-11 13:25:20 +00:00
stephena 18d42e0b5d Added 'Display.Phosphor' toggleswitch to GameInfoDialog.
Cleaned up stella.pro wrt to 'Keypad' vs. 'Keyboard'.  The manual says
Keyboard, so that's what we use.

Added 'Display.Phosphor' property for many ROMs which require it (thanks
to the z26 database).  This means it will be automatically used for those
ROMs.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@950 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-11 01:17:11 +00:00
stephena 3ca571fdd8 More work on the phosphor effect. It's now configurable from the
commandline.  Two new CL arguments have been added (but these might change):
1) -pp <yes|no>: sets the new 'Display.Phoshor' property
2) -ppblend <0-100>: sets the amount to blend in phosphor mode

Note that if 'pp' isn't set, then it won't matter what 'ppblend' is set to,
since phosphor won't be used at all.  Some performance tweaks are still
required, and software mode isn't yet supported.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@949 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-10 20:37:00 +00:00
stephena cd0fe79454 Added hacky define code until I make phosphor more configurable.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@948 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-10 02:22:38 +00:00
stephena a4d5738767 First pass at adding the z26 'phosphor effect', which is used in 30Hz
ROMs to eliminate flicker.  Right now is disabled by default, and when
enabled only works in OpenGL mode.  It's not yet configurable either,
so it's either on or off.  It looks like crap on ROMs that don't need it,
but is really nice for those that do.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@947 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-10 02:09:34 +00:00
stephena 24aa8c782f Second pass at joystick hat support. It seems to be working fine in
emulation mode, but it's somewhat sensitive in GUI navigation (could
be my cheap gamepad).

Remapping is mostly complete, except for assignment of hats to analog
events.  Some more thought is required for this one.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@946 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-09 19:30:04 +00:00
stephena 34e281d1b7 First pass at adding SDL joystick hat support to the EventHandler and
associated classes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@945 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-09 16:50:01 +00:00
stephena b7bd48782c Fixed missing include in Win32. Also, it looks like the removal of
joystick detection type speeds up the Windows port again.  It seems it's
the strangest things that slow down the code ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@944 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-09 01:13:26 +00:00
stephena f8e51876b5 Removed all reference to analog vs. digital joysticks, since we really
don't care what type they are (this is good, since the detection code
was crap anyway).  Events are now designated as being digital or analog.
If an event is analog and the stick also happens to be analog, then it
will get analog values; otherwise it won't.  Hopefully this will speed
up analog processing in Win32 (which I swear is the bane of my existence,
since every time I boot into Windows I feel my blood pressure rising :( )

Fixed typo which caused the joymap to be saved incorrectly.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@943 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-09 00:42:12 +00:00
stephena e545c973c5 Re-added 'joymouse' argument, and made sure that joystick navigation is
completely disabled when it's turned on.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@942 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-08 20:55:54 +00:00
stephena beab75c5b0 Turn off joymouse functionality by default. It still seems to cause
some problems in the OSX port.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@941 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-08 13:55:03 +00:00
stephena 07f320e1f1 Added GP2X port, thanks to Alex Zaballa. This is the first commit,
so I may have broken something.

Improved 'joystick is mouse' code in the GUI.  Also account for devices
where the D-pad sends button events instead of the normal axis events.

Treat joystick events as other types of controllers based on the
virtual port entry in stella.pro.  This means that mappings for a
joystick will emulate other devices when necessary, and should
help on 'small' devices with few inputs.

Added 'sp' developer commandline argument, which sets the
"Console.SwapPorts" property and swaps the arrangement of the
virtual ports.  Useful for games like "Raiders of the Lost Ark",
where the joysticks are normally swapped.  Updated stella.pro
for Raiders to use this property.

Moved ugly #ifdef code for screen dimensions out of FrameBuffer and
directly into the respective OSystemXXX classes.

Added 'freq', 'tiafreq' and 'clipvol' commandline arguments, which
affect the sound subsystem.  Note that none of these add new
functionality; they merely expose what were previously constants
in the code:
 - freq: sets sound sample output frequency
 - tiafreq: sets sound sample generation frequency
 - clipvol: clips volume to eliminate huge cracks when pausing sound


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@940 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-08 02:28:04 +00:00
markgrebe d3fdd90347 Updated Xcode project file for Stella 2.1_cvs changes
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@939 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-06 04:24:10 +00:00
stephena d5981b3b6e Some sound code fixes, adding the following commandline arguments (which
can also be set in the Settings class):

-freq    : sets the sound sample output frequency, defaults to 31400
-tiafreq : sets the sound sample generation frequency, defaults to 31400
-clipvol : boolean which toggles volume clipping, defaults to true

Some fixes to the 'joystick button is an axis' code, so that it actually
works in GUI mode.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@938 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-06 00:31:56 +00:00
optixx 4388d801e5 added -lGL to get psp build working with new sdl release
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@937 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-05 23:39:44 +00:00
stephena 98603c1e6c Extended event infrastructure so that setting default events is determined
by the system-specific OSystemXXX class.  This is accomplished by overriding
certain methods in OSystem, and removes the need for numerous #ifdef's in
EventHandler.  In simpler terms, pressing 'Defaults' in the EventMapper
now uses defaults which are custom-defined to the specific port.

Added ability for joystick buttons to emulate axis events (and therefore
act as mouse events) for the internal GUI.  Some devices such as PSP and
GP2X don't have a directional pad, and send directions as button events
instead of axis events.  By overriding a method in OSystem, one can now
specify which buttons (if any) to treat as directional.

Added ability to remap the 'increase/decrease volume' events.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@936 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-05 18:53:23 +00:00
stephena adc6354943 Added more complete support for in-GUI navigation with a joystick
for those dialogs that don't emulate the mouse (currently the Launcher
and Command dialogs).  Moving a joystick axis in such dialogs now repeats
the event until the axis is released (similar to key repeat).  Also,
the number of events is based on how long the axis is held.  So the
longer the axis is pressed, the faster events will be generated.

The LauncherDialog now handles its own joystick axis events, which
are described as follows:
 - Axis up/down (on any stick) move up and down through the game list.
 - Axis left/right moves between the 4 buttons on the bottom (play,
   options, reload, quit).
 - The buttons are now highlighted to indicate that they're focusable.
   So the cursor keys can also be used to move between them.

Still TODO is deal with analog joystick axis events.  The analog nature
of these types of joysticks should really be ignored by the GUI.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@935 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-01-04 01:24:17 +00:00
stephena 2f16788aaa Fixed errors in state/eventstream loading and saving; it should now
be much more robust.

Updated VC.net project with latest files.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@934 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-29 21:16:28 +00:00
stephena 98c94e4b24 Found the bug wrt eventstream loading; the eventloop wasn't processing
all the events for the given frame.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@933 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-29 01:40:41 +00:00
stephena 989c58ebfd Preliminary support for playing back recorded eventstream files. It's
currently buggy, in that it doesn't seem to play back what was actually
recorded :)  But it seems that each time I play back the state file, the
same things happen, so at least I know it's deterministic that way.  I just
need to figure out which is being done incorrectly, the save or the load.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@932 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-29 01:25:07 +00:00
stephena 1f426d245f Some changes wrt to event recordings. Created EventStreamer class to deal
with all related event recording/loading stuff, since it really didn't
belong in either the EventHandler or Event classes.  Loading a previously
saved eventstream now loads the ROM state as well.  All that's left to
do (for basic functionality) is for the EventHandler to poll the
EventStreamer for events, and then pass them directly to the Event class.

Still TODO is decide on a GUI for all this, and what it means to 'interrupt'
an eventstream (should we just stop the load, delay processing of it,
lock out all user input until the stream is finished, etc).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@931 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-28 22:56:36 +00:00
knakos c2e6893cd6 added paddle 0 emulation for smartphones
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@930 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-27 22:27:59 +00:00
knakos c0bcff5797 keep up with changes in the core.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@929 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-27 22:26:39 +00:00
knakos 5f95ed458f backlight always on in emulator
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@928 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-27 22:22:27 +00:00
knakos c68dd1bddd added paddle 0 emulation for smartphones
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@927 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-27 22:19:04 +00:00
knakos 5a1210efa5 fixed forgotten cut+paste screen drawing bug (minydim)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@926 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-27 22:17:55 +00:00
stephena d76781c5ed Fixed some issues I forgot in the last commit. When mapping an event,
the first event seen is now used.  So that means once 'Map' is pressed
in the EventMapper, you can no longer move the cursor using the joystick
axis; that axis event will be remapped to whatever action your remapping.

Disabled double-clicking in EventMapper activating remap mode, since it
causes problems when using joystick buttons as mouse clicks.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@925 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-24 22:50:53 +00:00
stephena 2a8d708620 Added joystick is mouse navigation back, but placed it in DialogContainer
(where it really belongs).  So the GUI is fully navigable using the joystick.
Joystick axes emulate mouse movement, and joystick buttons emulate a left
mouse click.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@924 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-24 22:09:36 +00:00
stephena 8a74c4776e Fixed segfault/false assert when the cartridge type is undefined. Stella
will now either exit gracefully (when launching a ROM from the commandline),
or continue running (when in ROM launcher mode) when attempting to use an
undefined cartridge type.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@923 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-23 20:48:50 +00:00
stephena 34c7c24e47 Yet more fixes for tab related focusing issues. I think that's the end
of it.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-21 19:31:18 +00:00
stephena e1e492f622 Finally fixed widget focus issue with the EventMappingWidget and the
TabWidget.  The fix is not as clean as I'd like, since it basically
checks for a certain case only (a hack).  The TabWidget really does
cause a lot of problems, but for now I just work around it.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@921 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-21 01:50:16 +00:00
stephena 34284d0af9 More fixes for the Dialog focus issues.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@920 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-20 19:05:16 +00:00
stephena b1439714dc Fixed bug whereby remapping a joystick axis to a digital event didn't
erase that axis from the analog assignment (if it was also assigned to
an analog event).

Started work on intelligent focusing in the InputTextDialog, but it
requires some more work on the focusing the Dialog class (which is really
sort of a mess).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@919 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-20 00:56:31 +00:00
stephena 978c97c2d0 Removed the ability to emulate the mouse cursor with the joystick while
in GUI menu mode.  The code was too troublesome to fix, and navigating
a GUI with a joystick simulating a mouse is a broken concept anyway.

In place of joy-is-mouse navigation, added the ability to use the cursor
keys or joysticks axes to 'tab' between different focused objects in
GUI mode.  This is much more intuitive, and is how navigation works in
a mouse-less, game console based system.  Also, any joystick button (or
enter/space keys) activate the currently focused item.

For now, only the CommandDialog can be accessed this way.  It really
only makes sense here anyway, since many GUI objects in the other menus
really need access to a keyboard and mouse, and if you have those, one
can already navigate the menu.

Overall, this should make arcade cabinet style access much easier.  One
can map the CommandDialog to a joystick button, navigate with the joystick
axes, and select an item with any joystick button.  So Stella can be
started, play a game, and then exit, all by just using the joystick.  It
also solves quite a few usability problems for the WinCE and PSP ports.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@918 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-19 02:19:49 +00:00
stephena f3299a4296 Added properties entry for Rocky and Bullwinkle ROM.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@917 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-18 22:37:23 +00:00
stephena 2564e924ba Updates for VC.net project.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@916 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-18 22:28:06 +00:00
stephena e3b7a56833 Added error checking for cheat names and codes. The '"' and ':' characters
are stripped, since they have special meaning in the cheat file.

Added support for one-shot cheats.  Basically these work exactly the same
way as normal cheats, but they are only evaluated once, and are never
saved.

Cleaned up the IFDEF mess for FrameBuffer and Sound objects in OSystem class
by creating a MediaFactory class that deals with it.  This might seem like
just moving the problem elsewhere, but it does help remove the clutter in
OSystem, and make compiling slightly faster whenever the FrameBuffer classes
are changed.  No porter should ever have to touch the emulation core classes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@915 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-18 18:37:03 +00:00
stephena 9888b78f19 Fixed problem with 'sticky' mappings of joysticks axes and analog events.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@914 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-18 14:15:53 +00:00
stephena 37bf0dc029 Added mapping of analog joystick axes to paddle events.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@913 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-17 22:48:24 +00:00
stephena 0f90b07e1a Now that the 'reinterpret_cast' operator has been removed from Stella,
we can also remove RTTI support.  This may result in a slightly smaller
binary.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@912 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-17 01:26:58 +00:00
stephena 3d760c8238 Some fixes to the Serializer/Deserializer classes wrt portability.
After this, hopefully state (and eventstream) files will be portable
between different platforms, even those differing in endian-ness and
bit length.  Ints are now stored and retrieved in little endian format
and are 4 bytes long.  So state files should still work on 32-bit x86 Linux,
but old state files will no longer be valid for 64-bit or non-x86 systems.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@911 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-17 01:23:07 +00:00