Commit Graph

73 Commits

Author SHA1 Message Date
Sergey Svishchev
b05c038b77 Remove obsolete CapsLock hack. 2015-10-02 10:58:28 +03:00
Vas Crabb
8ea36b999d Move UI mode key out of SDL options into generic options 2015-06-15 13:58:04 +10:00
Miodrag Milanovic
db9f8ea39c did license settings for OG and Andrew, cleared up OSD part for licenses (nw) 2015-05-09 17:02:35 +02:00
Miodrag Milanovic
1a3af8b611 Added license headers to the rest of files (nw) 2015-05-07 10:52:45 +02:00
Miodrag Milanovic
da12f5356a bugix and sdl fix (nw) 2015-04-22 13:22:18 +02:00
Miodrag Milanovic
54f8b3ae5d moved all to std::string (nw) 2015-04-22 11:30:45 +02:00
Miodrag Milanovic
7faba31b1b There is no implicit conversion to char* in std::string (nw) 2015-04-12 08:05:43 +02:00
Miodrag Milanovic
6b36c7ab22 cstr() - > c_str() as preparation for move to std::string (nw) 2015-04-11 15:26:58 +02:00
couriersud
ed4d846b77 Fixed fullscreen toggling (SDL2) on OSX. Simplified multithreading
code-paths (via defines). (nw)
2015-02-23 02:33:44 +01:00
couriersud
d2ea4df4ad Make OpenGL renderer available in mainline build as well. This needs to
be explicitly enabled by specifying USE_OPENGL=1. More code alignment.
[Couriersud]
2015-02-22 01:14:37 +01:00
couriersud
d685f05949 sdl render operation moved towards the way window deals with renderers. 2015-02-08 16:07:22 +01:00
Justin Kerk
2756a23b1a Emscripten target now uses SDL2. [Justin Kerk] 2015-02-07 20:41:47 +00:00
couriersud
f3d3cbde44 Removed debug output from input.c. 2015-02-06 23:49:46 +01:00
couriersud
5d33de6aab Remove some passing around of running_machine where it is not needed.
(nw)
2015-02-05 01:58:55 +01:00
couriersud
dabb6b1799 Moved all window related code to window.c. (nw) 2015-02-05 01:06:37 +01:00
couriersud
84c053f76e Reowrked the -video soft driver so it works like accel and opengl. That
will enable the move of some now identical functions back to window.c.
(nw)
2015-02-03 19:31:11 +01:00
arbee
2e8389c978 Fix SDL build breakage (nw) 2015-02-02 21:55:20 -05:00
couriersud
e8b343f79e Fixed natural keyboard input on all platforms for SDL2 builds. (nw) 2015-02-03 00:35:04 +01:00
couriersud
786cd2af66 introduced concept of an osd_renderer. Changed draw code to
inherit from this interface. (nw)
2015-02-01 03:00:21 +01:00
couriersud
5848dc2013 More transition to "m_" members. (nw) 2015-01-31 23:58:22 +01:00
couriersud
d614721163 All private members for sdl_window_info now start with "m_". (nw) 2015-01-31 23:39:57 +01:00
Miodrag Milanovic
26e7a17b63 Cleanups and version bump 2015-01-28 09:20:10 +01:00
couriersud
b5558df1cf Removed some machine() references 2015-01-14 03:35:10 +01:00
couriersud
8da5cfa3dd Fixed two SDL2 bugs:
- Window height was 0 after a switch from fullscreen to windowed if 
  sdlmame was started in fullscreen
- Fixed -switchres. This is now working on Ubuntu 14.04 again.
  Performance will vary on your hardware and drivers and I suspect
  SDL to be partly broken.
2015-01-06 22:50:00 +01:00
Miodrag Milanovic
e6f78d5ed2 Cleanups and version bump 2014-12-31 07:53:27 +01:00
couriersud
42c969c07e Changed sdl_window_info to be closer to C++:
- Made some members private
- moved static functions into sdl_window_info
- extended work_param struct with constructors for better readability
2014-12-29 02:00:57 +01:00
Kyungdahm Yun
59b5d8b6a3 Use consistent logical ID for joystick registration log 2014-12-15 01:41:43 -08:00
jbu
f6ec0e0596 Add 4 7seg digits for the outputs 6, 7, 14 and 15. The remaining 22, 23, 30 and 31 are unused (nw) 2014-12-09 18:43:46 +01:00
Miodrag Milanovic
d034eefcb5 Merged in cleanup changes from osd branch (nw) 2014-04-26 13:35:06 +00:00
Miodrag Milanovic
f8f3d68187 -Made osd_interface base class for OSD and moved initialization for each subsystem in it as virtual calls. (nw)
-Moved midi handling in base class
-Cleaned running_machine of information of next machine
-All is cleaned after exiting of running_machine so debugger window is removed as well till next machine is started
-Made osdmini to compile
2014-04-25 07:31:27 +00:00
Miodrag Milanovic
452df5037b reverting to classic ui due to lot of issues, as much as I hate reverting some else code (nw) 2014-04-17 06:27:03 +00:00
Miodrag Milanovic
67663501d7 Moved eminline and related files into /src/osd since it's system related (nw)
Moved delegates into /src/lib/util to enable usage of delegates in other project parts

Moved mame_printf_* calls into /src/osd/osdcore.c and renamed them to osd_printf_* 

Changed mess.mak to display compilation of ymmu100.ppm nicely
2014-04-16 08:04:20 +00:00
Nathan Woods
24026e123e Merge of new menubar code 2014-04-12 20:52:03 +00:00
Aaron Giles
4ea9df02a1 Moved core template container classes up from emutempl.h to coretmpl.h:
[Aaron Giles]
 * these classes now no longer take a resource_pool; everything is
    managed globally -- this means that objects added to lists must be
    allocated with global_alloc
 * added new auto_pointer<> template which wraps a pointer and auto-frees
    it upon destruction; it also defaults to NULL so it doesn't need to
    be explicitly initialized
 * moved tagged_list template to tagmap.h

Redo of the low-level memory tracking system: [Aaron Giles]
 * moved low-level tracking out of emu\emualloc into lib\util\corealloc
    so it can be shared among all components and used by core libraries
 * global_alloc and friends no longer use a resource pool to track
    allocations; turns out this was a wholly redundant system that wasted
    a lot of memory
 * removed global_resource_pool entirely
 * added global_free_array to delete arrays allocated with 
    global_alloc_array
 * added tracking of object versus array allocation; we will now error
    if you use global_free on an array, or global_free_array on an object

Added new utility helper const_string_pool which can be used to 
efficiently accumulate strings that are not intended to be modified.
Used by updated makelist and software list code. [Aaron Giles]

Updated png2bdc and makelist tools to not leak memory and use more modern
techniques (no more MAX_DRIVERS in makelist, for example). [Aaron Giles]

Deprecated auto_strdup and removed all uses by way of caller-managed 
astrings and the software list rewrite. [Aaron Giles]

Rewrote software list management: [Aaron Giles]
 * removed the notion of a software_list that is separate from a
    software_list_device; they are one and the same now
 * moved several functions into device_image_interface since they really
    didn't belong in the core software list class
 * lots of simplification as a result of the above changes

Additional notes (no whatsnew):

Moved definition of FPTR to osdcomm.h.

Some changes happened in the OSD code to fix issues, especially regarding
freeing arrays. SDL folks may need to fix up some of these.

The following devices still are using tokens and should be modernized
(I found them because they kept their token as void * and tried to
delete it, which you can't):

namco_52xx_device (mame/audio/namco52.c)
namco_54xx_device (mame/audio/namco54.c)
namco_06xx_device (mame/machine/namco06.c)
namco_50xx_device (mame/machine/namco50.c)
namco_51xx_device (mame/machine/namco51.c)
namco_53xx_device (mame/machine/namco53.c)
voodoo_device (emu/video/voodoo.c)
mos6581_device (emu/sound/mos6581.c)
aica_device (emu/sound/aica.c)
scsp_device (emu/sound/scsp.c)
dmadac_sound_device (emu/sound/dmadac.c)
s3c2440_device (emu/machine/s3c2440.c)
wd1770_device (emu/machine/wd17xx.c)
latch8_device (emu/machine/latch8.c)
duart68681_device (emu/machine/68681.c)
s3c2400_device (emu/machine/s3c2400.c)
s3c2410_device (emu/machine/s3c2410.c)
strataflash_device (mess/machine/strata.c)
hd63450_device (mess/machine/hd63450.c)
tap_990_device (mess/machine/ti99/990_tap.c)
omti8621_device (mess/machine/omti8621.c)
vdt911_device (mess/video/911_vdt.c)
apollo_graphics_15i (mess/video/apollo.c)
asr733_device (mess/video/733_asr.c)
2014-03-11 15:54:58 +00:00
Nathan Woods
fb7edb68c6 Moved src/emu/ui.? ==> src/emu/ui/ui.?, changed to follow MAME OOP conventions; we now have a ui_manager class 2014-01-29 11:47:56 +00:00
Miodrag Milanovic
44d5c1b8ab Cleanups and version bump 2013-11-05 06:59:51 +00:00
Justin Kerk
cdc51864b0 Upstream changes needed to compile JSMESS [Justin Kerk, John Vilk, Justin de Vesine]
Out of whatsnew: there are still a few files being worked on, and the build scripts which are currently set up outside of the MAME source hierarchy. Always open to cleaner ways of doing things.
2013-11-03 01:42:33 +00:00
Alex W. Jackson
9998681885 SDL: Fix SDL1 build (nw) 2013-10-26 11:57:38 +00:00
R. Belmont
8679ca14bc SDL: Fix joystick to work with final SDL 2.0 (nw) 2013-10-26 03:16:12 +00:00
Miodrag Milanovic
0e19f641d3 Cleanups and version bump 2013-01-11 07:32:46 +00:00
Aaron Giles
ab97dc30ef First pass at modernizing struct definitions. 2012-09-15 21:47:30 +00:00
Miodrag Milanovic
19179ec9b6 Clean-ups and version bump 2012-07-30 07:55:43 +00:00
R. Belmont
beba639471 SDL: Use XInput to allow multiple lightguns on Linux/*BSD targets. [Markus Rathgeb, based on a patch by SpritesMods.com] 2012-07-25 01:32:48 +00:00
Aaron Giles
2a88e54278 ioport.c C++ conversion. Mostly internal changes, with no
intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.

For member functions, this is actually simpler/cleaner:

  value = ioport("tag")->read()

For legacy functions which have a driver_data state, it goes:

  value = state->ioport("tag")->read()

For other legacy functions, they need to fetch the root device:

  value = machine.root_device().ioport("tag")->read()

The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.

Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:

input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)

input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)

(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->

(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->

input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)

IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
2012-05-03 09:00:08 +00:00
Couriersud
ebe89a47d3 Fixed testkeys to work with SDL2.0. Keymaps can now contain SDL1.3 and SDL2.0 mappings. Updated km-de.txt as an example. [Couriersud] 2012-02-16 01:38:13 +00:00
Couriersud
19c3217408 Added support for (track)balls to osd/sdl. [Couriersud]
To test it, I used my Logitech Trackball (normally a mouse) and configured it as a joystick.

Prerequisites:

- Locate your linux input device for the trackball. In my case that's /dev/input/event3
- "sudo chmod a+r /dev/input/event3"
- "export SDL_JOYSTICK_DEVICE=/dev/input/event3"

This forces sdl to recognize the trackball as a input device.

-mame64 missile -nomouse -w

Configure the trackball axis. Make sure the mouse pointer is outside the window and window still has keyboard focus - most modern window manager should support this. 

Quit and restart with

-mame64 missile -mouse -now

to hide the mouse. Voila. Works.
2012-02-15 21:40:35 +00:00
Couriersud
5344166555 updated sdl os-core to compile against stock SDL-2.0 [couriersud].
- The SDL team has moved from 1.3 to 2.0. At the same time, changes were made to allow SDL1.2 and SDL2.0 to coexist. All SDL2.0 include files are now in /usr/include/SDL2.
- Added sdlinc.h to avoid having tons of #ifdef .. #include in the code.
- Scalemode is no longer a per-window setting
- Fixed a bug in YUV rendering.
- Use SDL_GetClipboard (SDL2.0)
- Updated README_SDL20.txt

Currently, SDL 2.0 is only supported on *nix. Volunteers welcome.
2012-02-12 20:59:24 +00:00
Aaron Giles
e532e74a8a Should fix osd keys. 2011-05-30 20:58:55 +00:00
Aaron Giles
665d213ee4 (Finally found the time to finish this....)
Low-level input upgrade. Classes now exist for input_codes, input_items,
input_devices, and input_seqs. Also created an input_manager class to
hold machine-global state and made it accessible via machine.input().
Expanded the device index range (0-255, up from 0-16), and the OSD can
now specify the device index explicitly if they can better keep the 
indexes from varying run-to-run. [Aaron Giles]

Note that I've built and run SDL on Windows, but not all the code paths
were exercised. If you use mice/joysticks extensively double-check them
to be sure it all still works as expected.

This is mainly an OSD and core change. The only thing impacting drivers
is if they query for specific keys for debugging. The following S&Rs
took care of most of that:

S: input_code_pressed( *)\(( *)([^, ]+) *, *
R: \3\.input\(\)\.code_pressed\1\(\2

S: input_code_pressed_once( *)\(( *)([^, ]+) *, *
R: \3\.input\(\)\.code_pressed_once\1\(\2
2011-05-30 19:07:19 +00:00
Miodrag Milanovic
96b402e8e1 Fixed typo in sdl/input.c (no whatsnew) 2011-04-28 11:51:06 +00:00