Commit Graph

34 Commits

Author SHA1 Message Date
hap
128640144a emu: correct some file headers (nw) 2020-06-19 12:38:41 +02:00
Vas Crabb
ace8e401fc srcclean (nw) 2019-07-28 14:31:16 +10:00
npwoods
d580d86073 Added ui_input_manager::[set_]presses_enabled() and exposed to LUA 2019-07-21 15:22:19 -04:00
Vas Crabb
b363e92b5d Don't process every character individually when searching - this reduces
lag if you keep typing while a big list is searched.

(nw) patch up German translation
2017-08-10 18:05:54 +10:00
Vas Crabb
96c9112785 general cleanup:
* move rarely-used output and pty interfaces out of emu.h
* consolidate and de-duplicate forward declarations, also remove some obsolete ones
* clean up more #include guard macros
* scope down a few more things

(nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h -
this will make it far easier to keep them in sync with declarations than having
them scattered through all the other files.
2017-05-23 15:01:11 +10:00
Vas Crabb
8179a84458 Introduce u8/u16/u32/u64/s8/s16/s32/s64
* New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h"
* Get rid of import of cstdint types to global namespace (C99 does this anyway)
* Remove the cstdint types from everything in emu
* Get rid of U64/S64 macros
* Fix a bug in dps16 caused by incorrect use of macro
* Fix debugcon not checking for "do " prefix case-insensitively
* Fix a lot of messed up tabulation
* More constexpr
* Fix up many __names
2016-11-19 05:38:48 +11:00
Miodrag Milanovic
a6bdefec8c more TRUE/FALSE cleanup (nw) 2016-10-22 16:37:12 +02:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
2016-10-22 13:13:17 +02:00
Miodrag Milanovic
23ad94073f use standard types uintptr_t, char16_t and char32_t instead of FPTR, utf16_char, unicode_char (nw) 2016-10-22 11:31:49 +02:00
AJR
ea43e9a386 Ioport refactoring and cleanups (nw)
- Completely move mouse hit testing down into the UI input module. This reduces some dependencies.
- Never return a null pointer from ioport_field::name() to prevent potential crashes. All anonymous inputs are classified as INPUT_CLASS_INTERNAL, so several frontend functions now check type_class instead.
- Correct a couple of typos.
2016-05-18 19:23:54 -04:00
dankan1890
1e3037baf7 ui: Re-enabled configuration menu for single-machine and added some options.
Adding handler for the right mouse button in the main menu, calls the machine configuration.
2016-04-15 17:48:05 +02:00
Dankan1890
701df7fe9e Initial import of MEWUI to MAME [Dankan1890] 2016-02-04 15:14:24 +01:00
Victor Vasiliev
b11f39e7a0 Do not handle any UI inputs immediately after state load/save
Before this change, if you try to save state to a bound which already
does something as a UI button, it will save state there and then
immediately execute the bound action (sometimes it would not happen).
So, if you have state to P, with default button it would pause the game
immediately after saving state (except sometimes it would not).
2016-02-02 16:18:57 -05:00
Miodrag Milanovic
b1d6f6d63f Cleanups and version bump 2016-01-27 08:12:00 +01:00
Miodrag Milanovic
2bdd459d61 fix clang build (nw) 2016-01-11 12:01:08 +01:00
Miodrag Milanovic
30c10f6f79 modernized ui_input_manager (nw) 2016-01-10 20:32:30 +01:00
Miodrag Milanovic
379581fb36 macro removal INLINE -> static inline (nw) 2015-12-12 08:58:57 +01:00
Miodrag Milanovic
6b04fd7f05 Added some for Nathan and some more for Nicola (nw) 2015-05-11 14:42:31 +02:00
Miodrag Milanovic
6d902a08bd Added dummy license headers for EMU section (nw) 2015-05-07 10:45:57 +02: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
Nathan Woods
24026e123e Merge of new menubar code 2014-04-12 20:52:03 +00:00
Nathan Woods
48621181d1 Moved src/emu/uigfx.? ==> src/emu/ui/viewgfx.?, move C++-ifications 2014-01-25 16:56:23 +00:00
Jürgen Buchmüller
571f51c7ab Unglamorous changes from my UI rewrite 2014-01-17 01:34:49 +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
Aaron Giles
2ad5072023 BIG update.
Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:

  space->machine->xxx   ==>  space->machine().xxx
  device->machine->yyy  ==>  device->machine().yyy

Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.

Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.

98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:

// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.

// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.

// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1

// replace machine-> with machine.
S: machine->
R: machine\.

// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1

// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
2011-03-29 15:50:04 +00:00
Aaron Giles
733b797a3d Split mame.c into mame.c and machine.c, the latter containing the
running_machine definition and implementation.

Moved global machine-level operations and accessors into methods on the
running_machine class. For the most part, this doesn't affect drivers
except for a few occasional bits:

  mame_get_phase() == machine->phase()
  add_reset_callback() == machine->add_notifier(MACHINE_NOTIFY_RESET, ...)
  add_exit_callback() == machine->add_notifier(MACHINE_NOTIFY_EXIT, ...)
  mame_get_base_datetime() == machine->base_datetime()
  mame_get_current_datetime() == machine->current_datetime()

Cleaned up the region_info class, removing most global region accessors
except for memory_region() and memory_region_length(). Again, this doesn't
generally affect drivers.
2010-06-30 03:46:21 +00:00
Couriersud
7b3fa34c6a Minor changes for internal render debugger
- ui_input_frame_update is now global 
- moved element_component from rendlay.c to rendlay.h
- added ability to rendlay.c to define "container" components. These simply provide a render_container. 

  I plan to remove the above again and simply use one container covering the whole render_target. This container will be rendered after the artwork and before the ui. For this to work, DViews need move and resize support. Render_targets will than be equivalent to virtual desktops.
2010-02-05 00:08:00 +00:00
Aaron Giles
4498faacd9 First round of an attempted cleanup of header files in the system.
- Created new central header "emu.h"; this should be included
    by pretty much any driver or device as the first include. This
    file in turn includes pretty much everything a driver or device
    will need, minus any other devices it references. Note that
    emu.h should *never* be included by another header file.
 - Updated all files in the core (src/emu) to use emu.h.
 - Removed a ton of redundant and poorly-tracked header includes
    from within other header files.
 - Temporarily changed driver.h to map to emu.h until we update
    files outside of the core.

Added class wrapper around tagmap so it can be directly included
and accessed within objects that need it. Updated all users to
embed tagmap objects and changed them to call through the class.

Added nicer functions for finding devices, ports, and regions in
a machine:

   machine->device("tag") -- return the named device, or NULL
   machine->port("tag") -- return the named port, or NULL
   machine->region("tag"[, &length[, &flags]]) -- return the
      named region and optionally its length and flags
      
Made the device tag an astring. This required touching a lot of 
code that printed the device to explicitly fetch the C-string
from it. (Thank you gcc for flagging that issue!)
2010-01-10 00:29:26 +00:00
Aaron Giles
91a1b8d634 NOTE: This change requires two new osd functions: osd_malloc() and
osd_free(). They take the same parameters as malloc() and free().

Renamed mamecore.h -> emucore.h.

New C++-aware memory manager, implemented in emualloc.*. This is a
simple manager that allows you to add any type of object to a
resource pool. Most commonly, allocated objects are added, and so
a set of allocation macros is provided to allow you to manage
objects in a particular pool:

  pool_alloc(p, t) = allocate object of type 't' and add to pool 'p'
  pool_alloc_clear(p, t) = same as above, but clear the memory first
  pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type
                              't' and add to pool 'p'
  pool_alloc_array_clear(p, t, c) = same, but with clearing
  pool_free(p, v) = free object 'v' and remove it from the pool

Note that pool_alloc[_clear] is roughly equivalent to "new t" and
pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also
note that pool_free works for single objects and arrays.

There is a single global_resource_pool defined which should be used
for any global allocations. It has equivalent macros to the pool_*
macros above that automatically target the global pool.

In addition, the memory module defines global new/delete overrides
that access file and line number parameters so that allocations can
be tracked. Currently this tracking is only done if MAME_DEBUG is
enabled. In debug builds, any unfreed memory will be printed at
the end of the session.

emualloc.h also has #defines to disable malloc/free/realloc/calloc.
Since emualloc.h is included by emucore.h, this means pretty much
all code within the emulator is forced to use the new allocators.
Although straight new/delete do work, their use is discouraged, as
any allocations made with them will not be tracked.

Changed the familar auto_alloc_* macros to map to the resource pool
model described above. The running_machine is now a class and contains
a resource pool which is automatically destructed upon deletion. If
you are a driver writer, all your allocations should be done with
auto_alloc_*.

Changed all drivers and files in the core using malloc/realloc or the 
old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros 
instead, or the global_alloc_* macros if necessary.

Added simple C++ wrappers for astring and bitmap_t, as these need
proper constructors/destructors to be used for auto_alloc_astring and
auto_alloc_bitmap.

Removed references to the winalloc prefix file. Most of its 
functionality has moved into the core, save for the guard page 
allocations, which are now implemented in osd_alloc and osd_free.
2010-01-08 06:05:29 +00:00
Aaron Giles
bd24fb23c1 Results of running the latest srcclean. 2009-12-28 09:04:00 +00:00
Aaron Giles
ec2639d221 OSD notice: you now need to report separate mouse up/mouse down events
for this new support to work.

Clickable input support. Mostly by Nathan. A few changes from the
proposal:

* as far as the layout is concerned, states are 0 (off) or 1 (on) and
   aren't impacted by the port's ACTIVE_HIGH or ACTIVE_LOW

* instead of checking each individual field for a hit, we look to see
   what is hit once per frame and then just check against that; this
   is faster, but does limit us to a single hit item

* added function input_field_by_tag_and_mask() to look up a particular
   input_field_config by tag and mask; this makes it possible to easily
   get the port default value or other information as necessary
2008-09-09 17:11:52 +00:00
Aaron Giles
5244807bf3 Cleanups. 2008-07-17 08:09:52 +00:00
Aaron Giles
d8715ab4ac Note: I have done some testing, but there are probably more bugs
lurking. If you run into anything odd, please let me know.

Added new module uiinput.c which manages input for the user interface.
The OSD is responsible for pushing mouse events and character events
to this interface in order to support mouse movement and text-based
input (currently only used for the select game menu). Added support
for navigating through the menus using the mouse. 
[Nathan Woods, Aaron Giles]

Redesigned the UI menus so that they can maintain a richer state. Now
the menus can be generated once and reused, rather than requiring them
to be regenerated on each frame. All menus also share a comment eventing
system and navigation through them is managed centrally. Rewrote all the 
menus to use the new system, apart from the cheat menus, which are now 
disabled. Reorganized the video menu to make it easier to understand.
[Aaron Giles]
2008-07-12 20:18:25 +00:00