summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui.c
Commit message (Collapse)AuthorAgeFilesLines
* Moved src/emu/ui.? ==> src/emu/ui/ui.?, changed to follow MAME OOP ↵ Nathan Woods2014-01-291-2333/+0
| | | | conventions; we now have a ui_manager class
* Disable startup screens for JSMESS (the method we were previously using to ↵ Justin Kerk2014-01-281-0/+5
| | | | skip them had unwanted side-effects) (nw)
* Moved src/emu/uigfx.? ==> src/emu/ui/viewgfx.?, move C++-ifications Nathan Woods2014-01-251-449/+457
|
* More unglamorous cleanups Nathan Woods2014-01-191-6/+6
|
* More unglamourous changes (commenting, bool etc) Nathan Woods2014-01-171-1/+1
|
* Renamed uimenu.? ==> ui/menu.?, uimain.? ==> Jürgen Buchmüller2014-01-171-1/+2
| | | mainmenu.?/miscmenu.?/selgame.?
* Unglamorous changes from my UI rewrite Jürgen Buchmüller2014-01-171-12/+10
|
* Device-ified vector.c. (nw) Ivan Vangelista2013-11-011-7/+8
|
* preps for slider work (nw) Miodrag Milanovic2013-08-161-3/+10
|
* reduced tagmap lookups in ui_update_and_render() / changed ↵ Oliver Stöneberg2013-02-091-3/+3
| | | | ui_is_menu_active() to bool (nw)
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-22/+21
|
* Profiler rewrite; simplified, streamlined and less overhead. Nathan Woods2012-12-091-3/+2
|
* Clean-ups and version bumpmame0146u5 Miodrag Milanovic2012-08-201-2/+2
|
* Made UI mouse cursor optional (default is off for now), in games with ↵ Miodrag Milanovic2012-08-171-1/+1
| | | | clickable artwork cursor is visible, application is not taking mouse control anymore (no whatsnew)
* small optimization to ui_draw_text_full() (no whatsnew) Oliver Stöneberg2012-08-171-12/+13
|
* let's make it const (nw) Miodrag Milanovic2012-08-151-1/+1
|
* Added internal mouse cursor visible in menus and when clickable artwork is ↵ Miodrag Milanovic2012-08-151-1/+66
| | | | used [Miodrag Milanovic]
* ups (nw) Miodrag Milanovic2012-08-121-1/+1
|
* Display correct software load messages depending of supported attribute ↵ Miodrag Milanovic2012-08-121-1/+6
| | | | value (no whatsnew)
* Added GAME_IMPERFECT_KEYBOARD flag and changed ui.c to use that instead of ↵ Miodrag Milanovic2012-08-061-2/+3
| | | | displaying message for each driver with keyboard (no whatsnew)
* Sega 16-bit cleanup, part 1 (still more coming): Aaron Giles2012-08-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Converted FD1089/FD1094 into proper devices, derived from m68000. They now handle their own decryption and memory management, so we can remove all the calls for initialization/reset/etc. The key now lives as a 'key' subdevice under the CPU, and the FD1089/1094 are now specified just like any other CPU. * Removed the horrible s16fd and s24fd files. Good riddance. * Created a helper class for managing fd1094 decryption caches. * Converted the memory mapper into a new modern device and updated the segas16b, segaorun, and segas18 drivers to use it. Fixed ROM memory mapping so that the source ROMs can be loaded contiguously, removing a bunch of hacks. * Untangled the joined segas1x_state and split the states for each system into their own classes. Cleaned up some implementations. * Added support for member functions to be called as DRIVER_INIT functions. To do this, #define MODERN_DRIVER_INIT prior to #including "emu.h" and you will be required to specify a class and member function for your driver init. * Fully modernized the segas16b and segas18 drivers. New working games added ----------------------- GP Rider (Japan) [ShouTime, Charles MacDonald, Aaron Giles] Last Survivor [ShouTime, Charles MacDonald, Aaron Giles, 9ofzeven, TrevEB, Dr. Spankenstein, ghoolster, Surgeville, Tormod, Tjaberg, Waremonger] (Note: A couple games are still busted, but most are working. Will follow up with more updates.)
* PORT_ADJUSTER now accepts PORT_MINMAX as well. [Couriersud] Couriersud2012-07-221-1/+1
|
* Revert some changes committed by accident. No WN. Couriersud2012-05-261-241/+0
|
* Fix compile again - omitted a file, no WN Couriersud2012-05-261-0/+241
|
* ioport.c C++ conversion. Mostly internal changes, with no Aaron Giles2012-05-031-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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")
* Separated user gain from input gain. Added more functions to Aaron Giles2012-04-261-8/+5
| | | | | map inputs and devices to outputs in sound streams. Some general cleanups in the sound/streaming code.
* Created ioport_manager and moved the port list to it. Aaron Giles2012-04-221-2/+2
| | | | | | Removed global port lookups, now all lookups must be done through device_t::ioport().
* Fix display of driver name under MSVC. Some minor cleanup in that function. Aaron Giles2012-03-081-8/+7
|
* Added Driver display in both the game select UI as well as the gameinfo ↵ Scott Stone2012-03-031-2/+1
| | | | screens which should prove helpful. [Tafoid]
* Make all items connected to mixer inputs available in the UI, not just items Aaron Giles2012-02-281-4/+4
| | | | connected to speakers.
* Some cleanup of some observed #include redundancy from source files which ↵ Scott Stone2012-02-061-2/+0
| | | | use emu.h (nw)
* Fixed game info screen (no whatsnew) Miodrag Milanovic2012-01-301-13/+17
|
* Move devices into a proper hierarchy and handle naming Aaron Giles2012-01-241-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and paths consistently for devices, I/O ports, memory regions, memory banks, and memory shares. [Aaron Giles] NOTE: there are likely regressions lurking here, mostly due to devices not being properly found. I have temporarily added more logging to -verbose to help understand what's going on. Please let me know ASAP if anything that is being actively worked on got broken. As before, the driver device is the root device and all other devices are owned by it. Previously all devices were kept in a single master list, and the hierarchy was purely logical. With this change, each device owns its own list of subdevices, and the hierarchy is explicitly manifest. This means when a device is removed, all of its subdevices are automatically removed as well. A side effect of this is that walking the device list is no longer simple. To address this, a new set of iterator classes is provided, which walks the device tree in a depth first manner. There is a general device_iterator class for walking all devices, plus templates for a device_type_iterator and a device_interface_iterator which are used to build iterators for identifying only devices of a given type or with a given interface. Typedefs for commonly-used cases (e.g., screen_device_iterator, memory_interface_iterator) are provided. Iterators can also provide counts, and can perform indexed lookups. All device name lookups are now done relative to another device. The maching_config and running_machine classes now have a root_device() method to get the root of the hierarchy. The existing machine->device("name") is now equivalent to machine->root_device().subdevice("name"). A proper and normalized device path structure is now supported. Device names that start with a colon are treated as absolute paths from the root device. Device names can also use a caret (^) to refer to the owning device. Querying the device's tag() returns the device's full path from the root. A new method basetag() returns just the final tag. The new pathing system is built on top of the device_t::subtag() method, so anyone using that will automatically support the new pathing rules. Each device has its own internal map to cache successful lookups so that subsequent lookups should be very fast. Updated every place I could find that referenced devices, memory regions, I/O ports, memory banks and memory shares to leverage subtag/subdevice (or siblingtag/siblingdevice which are built on top). Removed the device_list class, as it doesn't apply any more. Moved some of its methods into running_machine instead. Simplified the device callback system since the new pathing can describe all of the special-case devices that were previously handled manually. Changed the core output function callbacks to be delegates. Completely rewrote the validity checking mechanism. The validity checker is now a proper C++ class, and temporarily takes over the error and warning outputs. All errors and warnings are collected during a session, and then output in a consistent manner, with an explicit driver and source file listed for each one, as well as additional device and/or I/O port contexts where appropriate. Validity checkers should no longer explicitly output this information, just the error, assuming that the context is provided. Rewrote the software_list_device as a modern device, getting rid of the software_list_config abstraction and simplifying things. Changed the way FLAC compiles so that it works like other external libraries, and also compiles successfully for MSVC builds.
* Fix several rendering issues with artwork, introduced in the Aaron Giles2012-01-161-2/+1
| | | | | | | recent changes. Also, did a pass through the code to take advantage of new methods available on rectangles.
* Major bitmap-related changes throughout the system. There are Aaron Giles2012-01-121-71/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | almost certainly some regressions lurking. Let me know if something seems busted. Bitmaps are now strongly typed based on format. bitmap_t still exists as an abstract base class, but it is almost never used. Instead, format-specific bitmap classes are provided: bitmap_ind8 == 8bpp indexed bitmap_ind16 == 16bpp indexed bitmap_ind32 == 32bpp indexed bitmap_ind64 == 64bpp indexed bitmap_rgb32 == 32bpp RGB bitmap_argb32 == 32bpp ARGB bitmap_yuy16 == 16bpp YUY For each format, a generic pix() method is provided which references pixels of the correct type. The old pix8/pix16/pix32/ pix64 methods still exist in the short term, but the only one available is the one that matches the bitmap's pixel size. Note also that the old RGB15 format bitmaps are no longer supported at all. Converted model1, megadriv, and stv drivers away from the RGB15 format bitmaps. New auto_bitmap_<type>_alloc() macros are provided for allocating the appropriate type of bitmap. Screen update functions now must specify the correct bitmap type as their input parameters. For static update functions the SCREEN_UPDATE macro is now replaced with SCREEN_UPDATE_RGB32 and SCREEN_UPDATE_IND16 macros. All existing drivers have been updated to use the correct macros. Screen update functions are now required for all screens; there is no longer any default behavior of copying a "default" bitmap to the screen (in fact the default bitmap has been deprecated). Use one of the following to specify your screen_update callback: MCFG_SCREEN_UPDATE_STATIC(name) - static functions MCFG_SCREEN_UPDATE_DRIVER(class, func) - driver members MCFG_SCREEN_UPDATE_DEVICE(tag, class, func) - device members Because the target bitmap format can now be deduced from the screen update function itself, the MCFG_SCREEN_FORMAT macro is no longer necessary, and has been removed. If you specify a screen update callback that takes a bitmap_ind16, then the screen will be configured to use a 16bpp indexed bitmap, and if you specify a callback that takes a bitmap_rgb32, then a 32bpp RGB bitmap will be provided. Extended the bitmap classes to support wrapping a subregion of another bitmap, and cleaner allocation/resetting. The preferred use of bitmaps now is to define them directly in drivers/devices and use allocate() or wrap() to set them up, rather than allocating them via auto_bitmap_*_alloc(). Several common devices needed overhauls or changes as a result of the above changes: * Reorganized the laserdisc base driver and all the laserdisc drivers as modern C++ devices, cleaning the code up considerably. Merged ldsound device into the laserdsc device since modern devices are flexible enough to handle it. * Reorganized the v9938 device as a modern C++ device. Removed v9938mod.c in favor of template functions in v9938.c directly. * Added independent ind16 and rgb32 callbacks for TMS340x0 devices. * All video devices are now hard-coded to either ind16 or rgb32 bitmaps. The most notable is the mc6845 which is rgb32, and required changes to a number of consumers. * Added screen_update methods to most video devices so they can be directly called via MCFG_SCREEN_UPDATE_DEVICE instead of creating tons of stub functions.
* Sync with MESS all credited there (no whatsnew) Miodrag Milanovic2011-12-121-10/+11
|
* Clean-ups and version bumpmame0144u1 Angelo Salese2011-11-271-2/+2
|
* Move per emulator constants info into separate class [Miodrag Milanovic] Miodrag Milanovic2011-11-171-10/+24
| | | | | out of log: This way it is possible to link two or more separated executables with different copyright/xml out/name/... in one compilation, just one step closer...
* Fixes for variable shadowing [Oliver Stöneberg] R. Belmont2011-07-211-1/+1
|
* fixed crash when running laser disc games smf-2011-06-261-33/+32
|
* clifront: fixed behaviour of confirm_quit when emulation is started from the ↵ Fabio Priuli2011-06-031-3/+0
| | | | | internal UI. no whatsnew. previous patch was not returning correctly to the internal menu after ESC
* emuopts: added confirm_quit option (defaults to off). when on, pressing ESC ↵ Fabio Priuli2011-06-031-1/+38
| | | | | | | | you are prompted with a 'confirm quit' screen rather than directly quit emulation. [MamePlus Team, Mamesick, Fabio Priuli] out of whatsnew: feel free to suggest a better quit message, if you don't like the one I added.
* (Finally found the time to finish this....) Aaron Giles2011-05-301-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Switch input ports to use function-based constructors instead of tokens. Aaron Giles2011-05-101-4/+4
| | | | | | | | | Remove the old tokenizing helpers. Add basic classes for ports, fields, settings, and dip locations as a first step. These will be fully cleaned up later. Added machine() method to field to hide all the necessary indirection. Changed custom/changed handlers into generic read/write handlers, and added wrappers to convert them to device read/write lines. [Aaron Giles]
* Switch to using delegates for some callbacks: Aaron Giles2011-04-271-1/+1
| | | | | | | | | | | | - non-device timer callbacks - machine state changing callbacks - configuration callbacks - per-screen VBLANK callbacks - DRC backend callbacks For the timer case only, I added wrappers for the old-style functions. Over time, drivers should switch to device timers instead, reducing the number of timers that are directly allocated through the scheduler.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing modern devices and the legacy wrappers to work in this environment. This in general greatly simplifies writing a modern device. [Aaron Giles] General notes: * some more cleanup probably needs to happen behind this change, but I needed to get it in before the next device modernization or import from MESS :) * new template function device_creator which automatically defines the static function that creates the device; use this instead of creating a static_alloc_device_config function * added device_stop() method which is called at around the time the previous device_t's destructor was called; if you auto_free anything, do it here because the machine is gone when the destructor is called * changed the static_set_* calls to pass a device_t & instead of a device_config * * for many devices, the static config structure member names over- lapped the device's names for devcb_* functions; in these cases the members in the interface were renamed to have a _cb suffix * changed the driver_enumerator to only cache 100 machine_configs because caching them all took a ton of memory; fortunately this implementation detail is completely hidden behind the driver_enumerator interface * got rid of the macros for creating derived classes; doing it manually is now clean enough that it isn't worth hiding the details in a macro
* (Big tangle of changes that all happened as I was looking into the ROM Aaron Giles2011-04-131-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loader rewrite, which is still in progress....) Replaced mamedriv.c with a new driver list mechanism that is generated by the build tools. The emulator core now expects the presence of a file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of driver names, one per line. C and C++ comments are still permitted. This file is parsed by a new build tool makelist which extracts the driver names, sorts them, and generates a file called drivlist.c, which is consumed by the core. [Aaron Giles] Added new osdcore function osd_malloc_array() which is identical to osd_malloc() but obviously hints that the underlying allocation is for an array. Updated all callers to use the appropriate form. Modified the Windows allocator to only use guard pages for array-style allocations, allowing us to enable them once again in debug builds. [Aaron Giles] Created new static class driver_list to wrap accesses to the list of available drivers. Improved speed of driver lookups by relying on the presorting done by makelist. [Aaron Giles] Created helper class driver_enumerator as a helper for iterating through the list of drivers. This class supports basic filtering and iteration, and also serves as a temporary cache of machine_configs. [Aaron Giles] Created cli_frontend object to wrap all the CLI handling code in clifront.c. Updated/simplified all the code to take advantage of the driver_enumerator. [Aaron Giles] Created media_auditor object to wrap all the auditing functions in audit.c. Updated all users to the new interface. Note that the new auditing mechanism is slightly out of sync with the romload code in terms of finding ROMs owned by devices, so it may mis-report some issues until the new ROM loading code is in. [Aaron Giles] Added concept of a per-device searchpath. For most devices, their searchpath is just the short name of the device. For driver_devices, the searchpath is driver[;parent[;bios]]. This searchpath will eventually be used by the rom loader to find ROMs. For now it is used by the media auditor only. [Aaron Giles] Created info_xml_creator object to wrap all the info generation functions in info.c. Converted the file to C++ and cleaned up the input processing code. [Aaron Giles] (not for whatsnew ... Known issues: auditing of CHDs appears busted, and debug builds report unfreed memory if you use the built-in game picker)
* BIG update. Aaron Giles2011-03-291-166/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 *)
* Cleanup of machine.h. Shuffled some fields around, and moved several Aaron Giles2011-03-281-25/+25
| | | | | | | | | | | | | to private member variables with accessors: machine->m_respool ==> machine->respool() machine->config ==> machine->config() machine->gamedrv ==> machine->system() machine->m_regionlist ==> machine->first_region() machine->sample_rate ==> machine->sample_rate() Also converted internal lists to use simple_list.
* make shift/alt+right work on channel volume sliders (fractions between 0 and ↵ Michaël Banaan Ananas2011-03-061-0/+4
| | | | 1 were always rounded down)