Commit Graph

1205 Commits

Author SHA1 Message Date
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
stephena 764aee30ba Some OS/2 related changes I missed in the previous commit.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@885 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-19 22:31:51 +00:00
stephena ac1dbc31cc Reworked the mapping of joysticks yet again. After some thought, it
made no sense to restrict Stella to only work with two joysticks, since
there's no reason one couldn't use four devices, with each one emulating
a paddle (once I get paddle remapping done).  So I've removed that
restriction, and also removed the 'leftport' and 'rightport' arguments.

The one case where remapping a joystick *does* make sense is for
multiple Stelladaptors.  In that case, there might only be one
Stelladaptor installed, but you'd like it to emulate the right virtual
port.  Previously this wasn't possible, but now it is with the addition
of the 'sa1' and 'sa2' commandline arguments.  These arguments accept
either 'left' or 'right', specifying which virtual port to emulate.

Updated the InputDialog virtual device tab for remapping Stelladaptors.

Shortened some keynames in EventHandler, so that the actual character is
used (for example, ? instead of QUESTION).

Some fixes for the OS/2 port.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@884 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-19 22:26:14 +00:00
optixx 976b1551e7 enabled joymouse by default
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@883 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-15 22:24:32 +00:00
optixx adc48f72b8 added new -lpsputility to reflect changes in pspsdk build system
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@882 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-15 22:23:36 +00:00
stephena 4b3ed7a63d More work on virtual ports in the InputDialog. You can now use the GUI
to select which joysticks are mapped to which virtual port.

Some work on the mouse/paddle emulation.  It now uses a slider instead
of a dropdown widget.  Added slider for paddle sensitivity, but it's
not tied to the core yet, and doesn't do anything.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@881 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-14 17:01:19 +00:00
stephena 532a9a6184 Updates for VC.net project.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@880 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-13 22:42:29 +00:00
stephena cc668b22bc Reworked EventMappingDialog, turning it into one tab in the new
InputDialog.  This new class will include all things related to Stella
input.  For now, the old eventmapper is on one tab, and the 'mouse is
paddle' setting is on the other.  The latter tab will be expanded to
include SDL to Stella joystick enumeration (currently done by the
leftport and rightport commandline arguments), as well as the ability
to set mouse sensitivity for paddle emulation.

Note, there's still a bug in the interaction between the eventmapper
tab and focusing on the event list.  Focusing only takes effect after
switching to a new tab, then back to the remapper.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@879 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-13 22:25:47 +00:00
stephena 2d2bd5f62d Added ability for cartridge frying to be remapped.
Fixed bug where Escape key (by default assigned to enter Launcher)
couldn't be remapped to anything else.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@878 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-13 16:17:10 +00:00
stephena fb79186648 Fixes for Win32 VC.net project.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@877 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-13 03:55:24 +00:00
stephena ec87b299d5 Fixed errors in compilation when excluding cheatcode support. Also,
the executable will now be slightly smaller in this case.

Moved common 'type()' method from children of the Controller
base class back to the parent.  There was no need to have separate
methods for each different type.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@876 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-12 22:59:20 +00:00
stephena 8c2eaadaa1 Reworked joystick handling wrt Stelladaptor support; it should work a
little faster than before, and it makes the code much easier to understand.

Made Stelladaptor devices only send events based on which type of
controller is connected to the emulated port (Joystick, Paddles, Driving).
Since we can't detect which type of controller is attached to a
Stelladaptor, previously the code just sent events for all three types.
This causes problems with some games that don't know how to deal with
events that cannot possibly happen at the same time on a real machine
(ie, paddle 0 *and* joystick 0 being operated).

Added code to 'swallow' garbage events generated when Stella is first
launched, usually caused by jitter in the joystick or mouse.  This fixes
some weird problems with internal Stella events being set before we
even enter the main gaming loop.

Still TODO is add support for joystick hats and trackballs, once I can
locate a device which has these items.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@875 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-12 22:04:57 +00:00
stephena 429cc63d1d Added new Cheat infrastructure. Ram-based cheats are now supported.
Currently they must be 4 hex characters long, and do not support
compare before writing (direct-write, not compare-write).  These
codes are also executed per-frame.

Changed 'cheetah' commandline/debugger argument to 'cheat', and any type
of cheat may be specified here.  Currently supported are 4 char RAM,
6 char Cheetah, and 8 char Stella extended Cheetah.

Still TODO is add load/save of cheats, add one-shot and compare-write
cheats, and finally add a dialog to do all this from within Stella.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@874 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-11 21:44:19 +00:00
stephena d76d9247c2 Fixed bug where pressing the keys to enter menu, commandmenu or debugger
were accessible from the launcher, and were causing a segfault when pressed.

Fixed bug where 'mouse is paddle xxx' number wasn't being set when
starting Stella for the first time.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@873 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-01 16:32:27 +00:00
stephena 0d41f9dc5c First pass at EventHandler refactoring, cleaning up some redundant code.
Added 'leftport' and 'rightport' commandline arguments, which specify
which SDL joystick devices to use for each port.  These arguments are
basically indices into the internal SDL joystick array.  Joystick
handling has changed somewhat, in that there are now only ever two
joysticks used by Stella (J0 - left and J1 - right).  The port
arguments serve to specify which stick is J0, and which is J1.
This means the tie between SDL enumeration of joysticks is broken,
and (for example) a Stelladaptor which has SDL index of 1 (second
stick found) can emulate the left 2600 port, and an SDL joystick 0 can
emulate the right 2600 port.  This fixes a long-standing bug whereby the
only way to break SDL joystick enumeration was to remap all associated
events in the Event Mapper.

Still TODO is add joystick hat/ball detection to the event handler, and
allow those events to be remapped (perhaps to emulate the paddles).
Also TODO is add a GUI for selecting the joystick ports from a list of
SDL joysticks.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@872 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-10-30 20:29:56 +00:00
stephena 27b2d92b8a Oops, fixed obvious typo.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@871 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-10-29 18:26:46 +00:00
stephena 8fc9ee8522 Updated RPM spec file for locating X11 libraries.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@870 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-10-29 18:25:15 +00:00
stephena c60cf5495d Some fixes for compilation on 64-bit systems. Fixed mixing of long/int
types in state file handling.  Added '--x-libraries' option to configure,
to specify different locations for X11 (only affects UNIX port).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@869 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-10-29 18:11:29 +00:00
stephena 9db2d71cda Fixed '-break' commandline argument causing segfaults.
Fixed bug with Cheetah codes not working from the commandline or prompt.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@868 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-10-27 19:15:14 +00:00
stephena 6785b1fdd3 Oops, reverted compiler optimization flags, since don't exist on all
compilers and don't apply to non-x86 machines.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@866 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-10-25 21:21:15 +00:00