summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/delegate.h
Commit message (Collapse)AuthorAgeFilesLines
* Moved eminline and related files into /src/osd since it's system related (nw) Miodrag Milanovic2014-04-161-942/+0
| | | | | | | | 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
* Cleanups and version bumpmame0153 Miodrag Milanovic2014-04-071-4/+4
|
* upd3301: devcb2 & delegate. (nw) Curt Coder2014-04-041-16/+59
|
* delegate: These go to eleven. [Curt Coder] Curt Coder2014-04-041-16/+121
|
* The Emscripten fastcomp backend needs the same delegate fix, thanks for the ↵ Justin Kerk2014-03-301-0/+2
| | | | clue micko (nw)
* making code compiles and work on mingw 32 bit on versions 4.7.x and 4.8.x (nw) Miodrag Milanovic2014-03-301-1/+6
|
* esrip sys converted to use devcb2 and delegates (nw) Miodrag Milanovic2014-03-291-13/+118
| | | | | | | Also added support to delegates with up to 8 params out of whatsnet: note that old code did not take care of mem_mask that caused me troubles debugging this
* added dumped eeprom to jclub2 sets, allowing game ID check to pass [ANY] David Haywood2014-03-191-1/+5
| | | | | h63484.c compile fix [external] add centronics bus to tiny.mak to fix tiny compile [external] added compile time check for 64-bit intel compiler to delegate.h (to prevent assert(sizeof(mfp) <= sizeof(m_rawdata)); ) [external]
* Bulk convert files that already had standard BSD license in my name Aaron Giles2013-10-161-31/+2
| | | | to new license tagged form.
* duh (nw) Olivier Galibert2013-06-081-1/+0
|
* naomi video: Pretend-modernize the powervr2 [O. Galibert] Olivier Galibert2013-06-081-1/+3
|
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-90/+90
|
* Clean-ups and version bumpmame0147u2 Miodrag Milanovic2012-10-301-9/+9
|
* And a final cleanup/merging of delegate classes. Aaron Giles2012-10-161-240/+198
|
* Intermediate delegate WIP as I shuffle things around. Aaron Giles2012-10-151-140/+60
| | | | | This is just a point-in-time, "it compiles and seems to work like before" checkpoint.
* A little more unification of delegate types. Aaron Giles2012-10-151-157/+187
|
* Created a base class delegate_common_base for all delegate Aaron Giles2012-10-141-85/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | types. Created a binding_type_exception which is thrown when a bind attempt fails due to mismatched types. Added helper templates to driver_device to wrap legacy device read/write handlers into driver_device member functions. This should help move some things forward until more common code is converted into proper devices. Introduce new module devcb2 which contains modernized versions of devcb. Compared to previous implementation this one is simpler overall, trampolining calls through a single internal set of adapter functions. The new versions are also designed to be specified in the machine_config rather than in structures, so they are no longer simple POD types. Additional new/changed features: * reads and writes can map to delegates for line or 8/16/32/64-bit * reads and writes can map to an I/O port * reads can be mapped to a constant value, with or without logging * writes can be mapped to a device's input line * all reads/writes can have a shift, mask, and/or xor applied * devices can opt to make the functions safe-if-NULL when resolving * only member function types are supported Rewrote the YM2151 interface to be fully modernized, and removed the ym2151_interface struct in favor of inline configs using the new devcb2 mechanism. In many cases, removed no longer needed trampolines, instead taking advantage of direct support for input line writes.
* Moved device_delegates into their own files. Employed a Aaron Giles2012-09-261-6/+4
| | | | | | | | | | | | | non-templatized helper class so that the code can live co-located, rather than invading device.h. Changed the read/write delegates to derive from device_delegate. Updated the address map macros to create these properly. Removed remnants of the old AM_BASE/SIZE macros from the memory system.
* mess sync (nw) Olivier Galibert2012-01-231-0/+3
|
* Clean-ups and version bumpmame0144u6 Angelo Salese2012-01-151-2/+2
|
* Some cleanup of the previous change. Added new template Aaron Giles2012-01-131-28/+58
| | | | | | | | | | device_delegate which wraps a regular delegate and includes a string pointer to a device tag, which can be simply resolved later. Converted the screen_update delegates to to be based on this. Changed the mechanism by which screen formats are auto-deduced. Converted SCREEN_EOF to use these delegates as well, so now there is MCFG_SCREEN_EOF_STATIC/ DRIVER/DEVICE just like MCFG_SCREEN_UPDATE.
* Add support for 5 parameter delegate functions. Aaron Giles2011-11-211-33/+68
|
* Cleanups and version bumpmame0142u4 Angelo Salese2011-05-241-3/+3
|
* Readd type checking to late-binding delegates. This is generally used in Aaron Giles2011-05-111-63/+72
| | | | | | | | | | | | a limited capacity (e.g., for devices), but the existing copy-and-rebind code would just cast the bound object without verifying the pointer was of the correct type or pointing to the correct class in the hierarchy. Objects that are late-bound must be derived from the delegate_late_bind class at some point so that a dynamic_cast from delegate_late_bind to the appropriate type succeeds. Updated the address map and custom NVRAM handlers to do the right thing with their re-binding.
* Remove legacy trampolines in the 7474 device and fix Aaron Giles2011-05-051-20/+20
| | | | | some undefined behavior in the process. Should fix reported issues in systems using the 7474.
* devcb.h: removed inline configuration macros for devcb; they frighten me Aaron Giles2011-05-041-2/+26
| | | | delegate.h: added static creators for static variants as well
* Add labels to devcb callbacks. Add static creation template function Aaron Giles2011-05-041-0/+14
| | | | to delegates.
* Converted presave/postload functions to delegates. In a lot of Aaron Giles2011-04-301-2/+2
| | | | | | cases, we can get rid of the postload function entirely and just call directly to the target function. Drivers eventually should just override device_postload() instead of registering for callbacks.
* Latest delegate changes removed the need for bindable_object, so Aaron Giles2011-04-291-72/+28
| | | | get rid of it across the board.
* Cleanups again Angelo Salese2011-04-181-16/+16
|
* Delegates 2.0 implementation. Resdesigned how delegates work to make Aaron Giles2011-04-161-916/+404
| | | | | | | | | | | | | | | | | | | | | them more flexible and simpler to use. Got rid of the proto_delegates altogether in favor of supporting delegates that are bound to NULL objects. Added a front-end template that supports "natural" syntax favored by libraries like boost. Added support for static functions that take reference parameters instead of pointer parameters for the object type. Updated all delegate users in the system to the new syntax. [Aaron Giles] Changed the DIRECT_UPDATE_HANDLER to take a machine reference like everything else in the system. Updated all users. [Aaron Giles] Changed the FUNC() macro to automatically put an & in front of the item passed. In general this works transparently, however it does have the nice side-effect of catching situations where a variable is passed instead of a function name. Fixed those cases to push the naming upstream so that the name is now provided properly. Also added a FUNC_NULL macro since FUNC(NULL) no longer works. [Aaron Giles]
* Fix compiling on older GCCs (including OS X PowerPC) [Aaron Giles] R. Belmont2010-09-041-5/+5
|
* Cleanups and version bump.mame0139u2 Aaron Giles2010-08-301-159/+159
|
* Remove a level of indirection when calling m68000 memory handlers. Aaron Giles2010-08-191-3/+3
|
* Massive memory system change. This is another step along the path toward Aaron Giles2010-08-191-0/+1209
supporting cleaner implementations of drivers in the explicitly OO world. Expect a follow-on of several more changes to clean up from this one, which deliberately tried to avoid touching much driver code. Converted address_space to a class, and moved most members behind accessor methods, apart from space->machine and space->cpu. Removed external references to 8le/8be/16le/16be/32le/32be/64le/64be. All external access is now done via virtual functions read_byte()/read_word()/etc. Moved differentiation between the endianness and the bus width internal to memory.c, and also added a new axis to support small/large address spaces, which allows for faster lookups on spaces smaller than 18 bits. Provided methods for most global memory operations within the new address_space class. These will be bulk converted in a future update, but for now there are inline wrappers to hide this change from existing callers. Created new module delegate.h which implements C++ delegates in a form that works for MAME. Details are in the opening comment. Delegates allow member functions of certain classes to be used as callbacks, which will hopefully be the beginning of the end of fetching the driver_data field in most callbacks. All classes that host delegates must derive from bindable_object. Today, all devices and driver_data do implicitly via their base class. Defined delegates for read/write handlers. The new delegates are always passed an address_space reference, along with offset, data, and mask. Delegates can refer to methods either in the driver_data class or in a device class. To specify a callback in an address map, just use AM_READ_MEMBER(class, member). In fact, all existing AM_ macros that take read/write handlers can now accept delegates in their place. Delegates that are specified in an address map are proto-delegates which have no object; they are bound to their object when the corresponding address_space is created. Added machine->m_nonspecific_space which can be passed as the required address_space parameter to the new read/write methods in legacy situations where the space is not provided. Eventually this can go away but we will need it for a while yet. Added methods to the new address_space class to dynamically install delegates just like you can dynamically install handlers today. Delegates installed this way must be pre-bound to their object. Moved beathead's read/write handlers into members of beathead_state as an example of using the new delegates. This provides examples of both static (via an address_map) and dynamic (via install_handler calls) mapping using delegates. Added read/write member functions to okim6295_device as an example of using delegates to call devices. Updated audio/williams.c as a single example of calling the device via its member function callbacks. These will be bulk updated in a future update, and the old global callbacks removed. Changed the DIRECT_UPDATE_CALLBACKs into delegates as well. Updated all users to the new function format. Added methods on direct_read_data for configuring the parameters in a standard way to make the implementation clearer. Created a simple_list template container class for managing the common singly-linked lists we use all over in the project. Many other internal changes in memory.c, mostly involving restructuring the code into proper classes.