summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/inptport.h
Commit message (Collapse)AuthorAgeFilesLines
...
* 02688: DIP switch settings are not being stored in INP files. Aaron Giles2008-12-041-1/+1
| | | | | | | To fix this, I had to break old INP files. While I was in there, I added corefile support for compressing/decompressing data on the fly, and enabled it for INPs, meaning the newer format INPs are output and processed compressed.
* Terminology cleanup. "Machine" handlers are now "space" handlers. Aaron Giles2008-11-151-5/+5
|
* Removed unneeded keys by removing the constants. stephh2008-10-031-6/+0
| | | | | | | | Readded UI_ON_SCREEN_DISPLAY to be changed again in the "Inputs" menu as per Aaron's request. A clean build is required and cfg/default.cfg has to be deleted !
* Added mechanism to generically specify input port tags in place of Aaron Giles2008-10-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | machine/device handlers. Unfortunately, the implementation relies on sentinel values to distinguish a port tag versus a pointer to function code. However, since this is a very common situation, it will hopefully be worth the slight grossness. New macros are defined in inptport.h: DEVICE8_PORT(name) - use this to specify the name of a port to read wherever a read8_device_func would normally be used MACHINE8_PORT(name) - same as DEVICE8_PORT except it can be used wherever a read8_machine_func would normally be used IS_HANDLER_PORT(ptr) - accepts a read8_device_func or read8_machine_func and determines if it is an actual function or a reference to a port; intended for use by devices that accept DEVICE8_PORT-style functions CALL_DEVICE8_READ(ptr,device,offset) - either calls through the given read8_device_func, or calls input_port_read with the appropriate tag, depending on the result of IS_HANDLER_PORT; intended for use by devices that accept DEVICE8_PORT-style functions CALL_MACHINE8_READ(ptr,machine,offset) - same as CALL_DEVICE8_READ except for read8_machine_func Note that in order for these to be useful, the consumer of the function pointer must be enhanced to use the CALL_* macros above instead of directly calling through the function. So far, only the 8255 PPI is set up to do this, as part of the cleanup below. Also note that the sentinel value is currently 4 consecutive 0 bytes; this may need to change in the future, in either length or value, so it is important to stick to the macros above. 8255 PPI interface cleanup: - added MDRV_PPI8255_ADD, MDRV_PPI8255_RECONFIG and MDRV_PPI8255_REMOVE macros; updated all drivers to use them - changed callbacks to device read/write handlers intead of machine read/write handlers; updated all drivers accordingly - normalized function and variable names to be lower_under - removed a number of redundant interfaces from the galaxian/ scamble line of games LD-V1000: added some (compile-time removed) information about the ROM and memory map
* OSD notice: you now need to report separate mouse up/mouse down events Aaron Giles2008-09-091-0/+3
| | | | | | | | | | | | | | | | | | 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
* MESS-specific fixes Nathan Woods2008-08-201-0/+1
|
* This also includes a fix for the bug reported at the bottom. Aaron Giles2008-08-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: Fabio Priuli [mailto:doge.fabio@gmail.com] Subject: to simplify cischeat inputs Hi, the enclosed diff has a twofold effect on cischeat.c: on one side: it adds diplocations to bigrun, scudhamm, cischeat & f1gpstar on the other side: it removes the current hacky handling of f1gpstar coinage dips (check video/cischeat.c to see what I mean with hacky!) to use conditional ports instead. BUT in order to do this, I had to add more possible values for the PORTCOND in iptport.c. The problem is that f1gpstar has a set of coinage settings when you set the region to JPN or USA and another one when you set the region to EUR or FRA. To implement this I added the following self-explanatory new PORTCOND: ISLARGER (>), ISNOTLARGER (<=), ISSMALLER (<), ISNOTSMALLER (<=). Only two were really needed to implement f1gpstar dips, but the other two seemed costless to me while offering even more flexibility to the PORT_CONDITION macro. Also notice that the handling of conditional ports in 'TAB>Dip Switches' menu doesn't work well (in the current source, not affected by my patch) with contracted expressions like PORT_DIPUNKNOWN_DIPLOC: the wrong items remain listed in the UI menu even when you change the condition! If you leave the DEF_STR( Unknown ) with ON/OFF cases, everything is displayed correctly in the menu. However, I was not able to track down what part of code is responsible for this bug. Regards, Fabio Priuli
* NOTE: with this change, I have also removed PORT_START and renamed Aaron Giles2008-08-061-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PORT_START_TAG to PORT_START. From: Fabio Priuli [mailto:doge.fabio@gmail.com] Subject: let's say goodbye to untagged input ports ;) Hi, enclosed please find a few patches against 126u3 source * port01.diff -> port09.diff : these patches continues the cleanup of inputs in drivers starting with C (the remaining ones), D and E. No ambiguous situations this time, so I guess there should be no problem with the changes. Improvements include conditional dips added to dynduke and diplocations for chinagat, chqflag, circus, citycon, cloak, contra and dynduke * tag01.diff -> tag09.diff : these patches add tag to EVERY input port in drivers starting with F->Z. Notice that only tags are added, no AM_READ_PORT, nor PORT_INCLUDE (and I saw a lot of drivers would need it ;) ), nor other cleanups contained in the patches above. I'll keep cleaning input next week, probably, but at least we can definitely remove the untagged version of PORT_START :) Notice I was able to compile the source commenting out the definition of PORT_START, so I guess every occurrence is covered...
* Made input_port_read_indexed() private to machine/generic.c. Aaron Giles2008-07-241-3/+0
| | | | | Eventually it will probably disappear altogether. Fixed the two remaining instances.
* Note: I have done some testing, but there are probably more bugs Aaron Giles2008-07-121-10/+9
| | | | | | | | | | | | | | | | | | | 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]
* Added TOKEN_SKIP_* macros to tokenize.h. Aaron Giles2008-05-251-1/+1
| | | | | | | | | | | | Changed error reporting during input port detokenization to fill a buffer rather than fatalerror-ing immediately. Should now properly skip over any invalid tokens. Enhanced error detection during input port detokenization to catch duplicate bits. There are a lot of these! Updated initialization code to print errors and fatal only if the input ports were unable to be constructed at all.
* 01825: Toggling Tab menu works as F2 key in games with their service Aaron Giles2008-05-241-0/+5
| | | | | | | | | | | | | | | | | mode DIPs on the top of the menu Fixed behavior of toggle switches so that they don't lose their value when the UI is up. They also can now be used for multibit DIP switch settings in which case they toggle through all the options. New functions input_field_select_next_setting() and input_field_select_previous_setting() which can be used to iterate properly through DIP switches. Fixed the behavior for cases where conditional ports are in play (you could get stuck). Changed uimenu.c to call these instead of implementing its own. Changed uimenu.c so that hitting ENTER on a DIP switch resets it to its default value. This is analagous to how the OSD sliders behave.
* Restructured input port internals and cleaned up inptport.c: Aaron Giles2008-05-151-190/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Input ports are now maintained hierarchically. At the top level are input ports, which contain a list of fields. Each field represents one or more bits of the port. Certain fields such as DIP switches and configuration switches contain a list of settings, which can be selected. DIP switch fields can also contain a list of DIP switch locations. * Normalized behavior of port overrides (via PORT_INCLUDE or by defining multiple overlapping bits). All fields within a port are kept in strict increasing bit order, so altered DIP switches are now kept in the appropriate order. This addresses MAMETesters bug 01671. * Live port state is now fully separate from configured state. This is manifested in a similar way to devices, where a const list of ports can be managed either offline or live. Each port has a pointer to an opaque set of live state which is NULL when offline or valid when live. Each port also has a running_machine * which is also NULL when offline. * Because of this new arrangement, the conversion from tokens to a list of ports now requires reasonably complex memory allocation, so these port lists must be explicitly allocated and freed (they are not mantained by automatic resource allocation). * Custom and changed callbacks now take a pointer to a field config instead of a running machine. This provides more information about what field triggered the change notification. The machine can be found by referenced field->port->machine. * The inptport.c module has been cleaned up and many ambiguities resolved. Most of this is internal, though it did result in osd_customize_inputport_list() being changed to osd_customize_input_type_list(). The parameter to this function is now a linked list instead of an array, and the structures referenced have been reorganized somewhat. * Updated config.c to pass machine parameters to its callbacks. * Updated validity checks, XML output, and UI system to handle the new structures. * Moved large table of default input settings to a separate include file inpttype.h. * Removed gross hacks in trackfld and hyperspt NVRAM. These may be broken as a result.
* Added a MESS-specific "paste" command; used to paste clipboard data into MESS's Nathan Woods2008-05-031-0/+1
| | | | | natural keyboard
* MESS specific fix Nathan Woods2008-04-261-1/+1
|
* Added support for using smaller-sized memory handlers directly in Aaron Giles2008-04-141-2/+0
| | | | | | | | | | | | | | | memory maps. To do so, you either need to specify a shift amount (mapping to a particular subset of the bus) or SHIFT_PACKED, which maps a single larger sized read/write down to multiple reads or writes at the smaller size. Removed word-sized handlers from 6821pia.c. Updated drivers that needed them to use these new interfaces instead. Updated gaelco3d.c and itech8.c to remove the need for memconv.h by using this new feature. Re-removed input_port_set_digital_value().
* Changes from MESS: Nathan Woods2008-04-141-0/+2
| | | | | | | | | | | | | src/emu/cpu/m68000/m68kmame.c: src/emu/cpu/minx/minx.c: - Fixed compilation errors on CPU cores not enabled in MAME src/emu/inptport.c: src/emu/inptport.h: - Readded input_port_set_digital_value() (which is needed for natural keyboard inpout in MESS) - Added a running_machine parameter to inputx_update()
* Fix compile error on systems where time.h isn't automagically included. R. Belmont2008-04-121-1/+2
|
* MESS specific fix Nathan Woods2008-04-121-1/+1
|
* Renamed input port functions: Aaron Giles2008-04-061-3/+3
| | | | | | | | | readinputport -> input_port_read_indexed readinputportbytag -> input_port_read readinputportbytag_safe -> input_port_read_safe Added machine parameter to input port functions. Updated many drivers to accomplish this.
* 01609: Various - tested srmp4 (ssv.c), ttmahjng (route16.c), vsmahjng ↵ Aaron Giles2008-04-061-17/+13
| | | | | | | | | | | | | | | (vsnes,c), tokkae (konamigx.c), sf2 (cps1.c): INP playback loses sync quickly Rewrote INP recording from scratch, since all old INPs are broken anyways. Header now includes timestamp, which overrides the default time base for MAME's system time. Each frame recorded now gets a timestamp. Analog ports are recorded once per frame and interpolated. Analog port calculations are all done in fixed point for consistent results. A bunch of other minor tweaks in the input port code. There may still be a few changes to the final INP format (considering adding NVRAM data directly in the INP file, for example....) but this at least seems to work for the games I've tried.
* Converted special-case DIP switches (service, unknown, unused) into their Aaron Giles2008-03-281-42/+40
| | | | | own token type rather than expanding into other tokens. The reduces the number of redundant strings and data.
* Next batch of machine->screen[] removal Zsolt Vasvari2008-03-121-1/+0
|
* Fixing MESS-specific category tokenization Nathan Woods2008-03-121-1/+1
|
* MESS-specific fix Nathan Woods2008-03-101-2/+2
|
* Added running_machine * parameter to the front of all read/write handlers. Aaron Giles2008-03-051-4/+4
| | | | | | | | | | | | | | | | | | Updated all call-through handlers appropriately. Renamed read8_handler to read8_machine_func, replicating this pattern throughout. Defined new set of memory handler functions which are similar but which pass a const device_config * in place of the running_machine *. These are called read8_device_func, etc. Added macros READ8_DEVICE_HANDLER() for specifying functions of this type. Note that some plumbing still needs to happen in memory.c before this will work. This check-in should remove the need for the global Machine and in turn "deprecat.h" for a lot of drivers, but that work has not been done. On the flip side, some new accesses to the global Machine were added in the emu/ files. These should be addressed over time, but are smaller in number than the references in the driver.
* Added running_machine* to the CUSTOM_INPUT callback - updated drivers to use it Zsolt Vasvari2008-03-031-2/+2
|
* - Added PORT_CHANGED macro which calls a callback if the given port changes. Zsolt Vasvari2008-03-031-3/+16
| | | | | | | | Usage is very similar to PORT_CUSTOM. See the Astro Invader driver for an example - Removed input_port_set_changed_callback and converted all users to PORT_CHANGED The only difference between the old callback and the ones supplied by PORT_CHANGED is that values passed by PORT_CHANGED are normalized to start at bit 0, just like PORT_CUSTOM.
* - Moves all video timing logic from cpuexec.c to video.c Zsolt Vasvari2008-03-011-2/+1
| | | | | | | | | - Added a video_screen_register_vbl_cb() function for registering VBLANK callbanks - Changed inptport.c and debugcpu.c to make use the VBLANK callbacks - Added video_screen_get_time_until_vblank_start() - CCPU and anything using cpu_scalebyfcount() are currently broken - I did some fairly extensive testing, but this is a very signficant internal change, so some things may have broke
* Spacing and version bump.mame0123u3 Aaron Giles2008-02-281-5/+5
|
* Fixed typo. Aaron Giles2008-02-261-1/+1
|
* Added new module: tokenize.h. This centralizes the behavior of Aaron Giles2008-02-251-107/+106
| | | | | | tokenizing data structures, as currently used by the input port system. Redid the input port tokenization to be more compact and make use of the new macros.
* Pulled remaining vestiges of old-style colortables: Aaron Giles2008-02-191-26/+48
| | | | | | | | | | | | | * PALETTE_INIT no longer has a colortable parameter * removed game_colortable and remapped_colortable from machine_config * updated a few stragglers that still referenced these fields * removed tile_draw_colortable from tilemap.c (From Zsolt): Added support for the new colortable object in the palette viewer Changed the input port tokens to use a union instead of casting everything to FPTR. In the future, C99-enabled compilers will be able to achieve type safety with designated initializers.
* Moved cpu_getiloops() and cpu_scalebyfcount() to deprecat.h. Aaron Giles2008-01-291-4/+15
| | | | | | | | Added #include "deprecat.h" where necessary to make this happen. Cleaned up cpuexec.c/.h to latest core style. Cleaned up implementation of extended INP header in inptport.c. Removed external access to cycles_currently_ran(). Replaced use of cycles_currently_ran() in v9938 code with mame_rand(), since that is effectively the same thing. :)
* Corrected copy-paste error in comment Zsolt Vasvari2008-01-171-1/+1
|
* Fixed up LAI games to working status. Aaron Giles2008-01-161-0/+5
| | | | Added CUSTOM_INPUT macro for defining input port callbacks.
* Copyright cleanup: Aaron Giles2008-01-061-1/+1
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* Changed an unamed enumeration to a named one (input_seq_type) Nathan Woods2007-12-261-4/+4
|
* Changes for MAME 0.121u4.mame0121u4 Aaron Giles2007-12-171-2/+2
|
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+903