Commit Graph

974 Commits

Author SHA1 Message Date
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
stephena e6aa6391eb Added GUI widgets to InputDialog to change speed of paddle movement when
emulating paddles with the keyboard or joystick.  These slider widgets go
from 0 to 100 percent, and represent minimum (0) to maximum (100) speed.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@910 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-16 14:41:15 +00:00
stephena 514ff4ea9a Paddle emulation from the keyboard and joystick axis is working! Still
TODO is add a scale factor (for each paddle) to the GUI, so one can
adjust the speed/amount of movement.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@909 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-13 00:35:24 +00:00
stephena bde4172f50 Some work on paddle emulation using the joystick axis. This code
probably doesn't compile ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@908 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-12 19:04:03 +00:00
stephena 8d98f0611e Updated VC project for rearrangment of Array class.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@907 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-10 20:06:45 +00:00
stephena 3b5cd56ca4 Changed Serializer/Deserializer API in preparation for event recording.
Pressing 'Ctrl e' now starts/stops event recording (key is temporary and
will probably change).  An state file is then generated containing the
state when recording started, and the eventstream up to the point when
recording stopped.

Next I'll work on loading the event state file and replaying the events.
This one is a little harder, since it has to override EventHandler::poll()
and use events from the eventstream.  Hopefully rudimentary support will
be there by the end of the weekend.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@906 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-09 19:09:49 +00:00
stephena a1c490cd21 Moved the Array class from namespace GUI to Common, since it's used in
many places other than the GUI code.

As a diversion from the joystick stuff, I'm experimenting with event
recording.  Eventually, this will allow one to record a state + events,
and then load that INP file again.  When loaded, Stella will replay the
events, and you'll be able to see exactly what happened before.  Since
this is based on frames, the replaying can speed up and slow
down by changing the emulation framerate.  And it can be exited at any
point, and normal emulation can continue.  Or at least that's how I
want it to work.

A preliminary spec for the event stream is -X A B A B ... -X ...,
where X represents how many frames to wait, and 'A B' are event/value
pairs representing an event in Stella.  I think this is very similar
to the scheme that Thomas J. recently added to z26, so converting to
a Stella eventstream should be easy.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@905 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-09 01:16:14 +00:00
stephena eaca8d857b Disabled the analog joystick axis using actual analog values for
simulated paddles for now.  I got it working, but I'm not sure how
useful it will be.  Maybe it's better to just add joystick emulation
for paddle events, and not care whether the axis are digital or analog
(it would certainly be easier code-wise), using something like JoyMouse??


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@904 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-08 22:30:53 +00:00
stephena 2d91d70189 More work on the event handling. Added preliminary code to detect whether
an axis is analog or digital (but this may prove to be insufficient).
This will be useful for the paddle emulation code.  If a paddle event
is detected *and* the axis is analog, then the eventhandler will generate
true analog values, which are more accurate than digital.  Otherwise,
paddle events associated with a digital axis will have the analog values
emulated by use of a JoyMouse-type structure.

Eventually, this code can be extended to deal with other analog-type events
(lightgun, etc) or other analog axis (trackballs).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@903 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-08 19:01:38 +00:00
stephena d64aadbf94 Yet more work on remapping joystick axis events. It's now mostly
complete, since I can play a two player game of River Raid with one
gamepad (P1 using D-pad and button 0, P2 using analog stick and
button 1).  Still TODO is add support for remapping paddles, but
this will be quite easy.  After that, maybe the ability to use
keys for paddle movement.  This one is a bit harder, so I may leave
it for a future release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@902 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-08 01:12:07 +00:00
stephena 0662e27730 More updates for remapping joystick axis events. It seems the
infrastructure is now ready, but I can't test that yet since I don't
have a joystick at work :)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@901 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-07 20:46:49 +00:00
stephena 76a74c0577 Started support for remapping joystick axis other than 0/1 to any event
in the emulator, including paddle events.  Analog and digital sticks will
be supported.  Currently, axis handling is completely broken.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-07 02:33:56 +00:00
stephena b52198aeaa Added fixes for some ROM hacks as reported on AtariAge.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@899 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-12-06 00:03:22 +00:00
stephena 092e927cd1 Oops, forgot to load the cheat database when starting in ROM launcher mode.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@898 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-28 15:05:43 +00:00
stephena 2be35dd96f The CheatManager now supports adding new cheats, and editing existing
cheats.  There's still some error checking to do, to make sure that
cheats don't contain characters that are reserved for the cheat file
(comma, colon, quote, etc).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@897 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-27 22:37:25 +00:00
stephena ca22361007 More work on cheatcode support. The '-cheat' commandline argument now
works correctly, and inserts the cheats for whatever ROM happens to be
loaded.

The CheatCodeDialog now communicates with CheatManager, meaning that
cheats can be seen in the dialog, and enabled/disabled with their
respective checkboxes.  Still TODO is add support for adding/removing/
deleting cheats, and for one-shot cheats.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@896 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-27 15:48:06 +00:00
stephena ac914c699a More work on the CheatManager. Stella now reads from a user-specific
'stella.cht' file, where each line/record consists of a ROM md5sum
and a comma-separated list of cheats.  Each cheat is specified as a
colon-separated string, defined as "NAME:CODE:ENABLE".


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@895 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-27 00:17:16 +00:00
stephena 8e5cb83f60 Added more extensive GUI for cheatcode support, including a checklist
where each cheat can be toggled on or off.  Of course, it doesn't
actually do anything yet, since it isn't connected to the
CheatManager.  For now, input of cheats from the GUI is completely
disabled.  Commandline should still work, though.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@894 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-26 21:23:35 +00:00
stephena 49955806d8 Some minor fixes for the WinCE port.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@893 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-21 13:47:34 +00:00
stephena 127adbb5c6 Pass events generated by Stelladaptors directly to the emulation core,
instead of being possibly 'massaged' by EventHandler::handleEvent().
This should result in slightly faster operation, and also allow
more accurate emulation of the Stelladaptor joysticks (ie, pressing down
hard on a joystick and activating all four directions will do exactly
what a real 2600 would do).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@892 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-21 00:20:22 +00:00
knakos 4f9d97d330 name fixup for resources
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@891 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-20 21:57:23 +00:00
knakos daf3a02480 experimenting with font overrides.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@890 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-20 21:55:27 +00:00
knakos edb66d80fa keep up with changes in the core.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@889 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-20 21:54:01 +00:00
knakos 64f760d8b1 added vertical downsampling filter for landscape modes in smartphones.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@888 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-20 21:49:58 +00:00
knakos 58ce29e07c not a nice name for a file :)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@887 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-20 21:47:26 +00:00
stephena bbc84f687e More cleanups for the EventHandler. Changed some more IF statements to
switch/case, hopefully making things faster.

Fixed bug while in pause mode and commands still being processed when
they shouldn't be.

Fixed annoying long-standing bug with the emulation core receiving
both joystick left/right and/or up/down events at the same time.
This results in lockups in Astroblast, and 'losing' the gun in Berserk.
A real 2600 doesn't allow this, so we shouldn't emulate it either.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@886 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-20 01:04:04 +00:00