summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/inptport.h
Commit message (Collapse)AuthorAgeFilesLines
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance as a result of this change. Do not panic; report issues to the list in the short term and I will look into them. There are probably also some details I forgot to mention. Please ask questions if anything is not clear. NOTE: This is a major internal change to the way devices are handled in MAME. There is a small impact on drivers, but the bulk of the changes are to the devices themselves. Full documentation on the new device handling is in progress at http://mamedev.org/devwiki/index.php/MAME_Device_Basics Defined two new casting helpers: [Aaron Giles] downcast<type>(value) should be used for safe and efficient downcasting from a base class to a derived class. It wraps static_cast<> by adding an assert that a matching dynamic_cast<> returns the same result in debug builds. crosscast<type>(value) should be used for safe casting from one type to another in multiple inheritance scenarios. It compiles to a dynamic_cast<> plus an assert on the result. Since it does not optimize down to static_cast<>, you should prefer downcast<> over crosscast<> when you can. Redefined running_device to be a proper C++ class (now called device_t). Same for device_config (still called device_config). All devices and device_configs must now be derived from these base classes. This means each device type now has a pair of its own unique classes that describe the device. Drivers are encouraged to use the specific device types instead of the generic running_device or device_t classes. Drivers that have a state class defined in their header file are encouraged to use initializers off the constructor to locate devices. [Aaron Giles] Removed the following fields from the device and device configuration classes as they never were necessary or provided any use: device class, device family, source file, version, credits. [Aaron Giles] Added templatized variant of machine->device() which performs a downcast as part of the device fetch. Thus machine->device<timer_device>("timer") will locate a device named "timer", downcast it to a timer_device, and assert if the downcast fails. [Aaron Giles] Removed most publically accessible members of running_device/device_t in favor of inline accessor functions. The only remaining public member is machine. Thus all references to device->type are now device->type(), etc. [Aaron Giles] Created a number of device interface classes which are designed to be mix- ins for the device classes, providing specific extended functionality and information. There are standard interface classes for sound, execution, state, nvram, memory, and disassembly. Devices can opt into 0 or more of these classes. [Aaron Giles] Converted the classic CPU device to a standard device that uses the execution, state, memory, and disassembly interfaces. Used this new class (cpu_device) to implement the existing CPU device interface. In the future it will be possible to convert each CPU core to its own device type, but for now they are still all CPU devices with a cpu_type() that specifies exactly which kind of CPU. [Aaron Giles] Created a new header devlegcy.h which wraps the old device interface using some special template classes. To use these with an existing device, simply remove from the device header the DEVICE_GET_INFO() declaration and the #define mapping the ALL_CAPS name to the DEVICE_GET_INFO. In their place #include "devlegcy.h" and use the DECLARE_LEGACY_DEVICE() macro. In addition, there is a DECLARE_LEGACY_SOUND_DEVICE() macro for wrapping existing sound devices into new-style devices, and a DECLARE_LEGACY_NVRAM_DEVICE() for wrapping NVRAM devices. Also moved the token and inline_config members to the legacy device class, as these are not used in modern devices. [Aaron Giles] Converted the standard base devices (VIDEO_SCREEN, SPEAKER, and TIMER) from legacy devices to the new C++ style. Also renamed VIDEO_SCREEN to simply SCREEN. The various global functions that were previously used to access information or modify the state of these devices are now replaced by methods on the device classes. Specifically: video_screen_configure() == screen->configure() video_screen_set_visarea() == screen->set_visible_area() video_screen_update_partial() == screen->update_partial() video_screen_update_now() == screen->update_now() video_screen_get_vpos() == screen->vpos() video_screen_get_hpos() == screen->hpos() video_screen_get_vblank() == screen->vblank() video_screen_get_hblank() == screen->hblank() video_screen_get_width() == screen->width() video_screen_get_height() == screen->height() video_screen_get_visible_area() == screen->visible_area() video_screen_get_time_until_pos() == screen->time_until_pos() video_screen_get_time_until_vblank_start() == screen->time_until_vblank_start() video_screen_get_time_until_vblank_end() == screen->time_until_vblank_end() video_screen_get_time_until_update() == screen->time_until_update() video_screen_get_scan_period() == screen->scan_period() video_screen_get_frame_period() == screen->frame_period() video_screen_get_frame_number() == screen->frame_number() timer_device_adjust_oneshot() == timer->adjust() timer_device_adjust_periodic() == timer->adjust() timer_device_reset() == timer->reset() timer_device_enable() == timer->enable() timer_device_enabled() == timer->enabled() timer_device_get_param() == timer->param() timer_device_set_param() == timer->set_param() timer_device_get_ptr() == timer->get_ptr() timer_device_set_ptr() == timer->set_ptr() timer_device_timeelapsed() == timer->time_elapsed() timer_device_timeleft() == timer->time_left() timer_device_starttime() == timer->start_time() timer_device_firetime() == timer->fire_time() Updated all drivers that use the above functions to fetch the specific device type (timer_device or screen_device) and call the appropriate method. [Aaron Giles] Changed machine->primary_screen and the 'screen' parameter to VIDEO_UPDATE to specifically pass in a screen_device object. [Aaron Giles] Defined a new custom interface for the Z80 daisy chain. This interface behaves like the standard interfaces, and can be added to any device that implements the Z80 daisy chain behavior. Converted all existing Z80 daisy chain devices to new-style devices that inherit this interface. [Aaron Giles] Changed the way CPU state tables are built up. Previously, these were data structures defined by a CPU core which described all the registers and how to output them. This functionality is now part of the state interface and is implemented via the device_state_entry class. Updated all CPU cores which were using the old data structure to use the new form. The syntax is currently awkward, but will be cleaner for CPUs that are native new devices. [Aaron Giles] Converted the okim6295 and eeprom devices to the new model. These were necessary because they both require multiple interfaces to operate and it didn't make sense to create legacy device templates for these single cases. (okim6295 needs the sound interface and the memory interface, while eeprom requires both the nvram and memory interfaces). [Aaron Giles] Changed parameters in a few callback functions from pointers to references in situations where they are guaranteed to never be NULL. [Aaron Giles] Removed MDRV_CPU_FLAGS() which was only used for disabling a CPU. Changed it to MDRV_DEVICE_DISABLE() instead. Updated drivers. [Aaron Giles] Reorganized the token parsing for machine configurations. The core parsing code knows how to create/replace/remove devices, but all device token parsing is now handled in the device_config class, which in turn will make use of any interface classes or device-specific token handling for custom token processing. [Aaron Giles] Moved many validity checks out of validity.c and into the device interface classes. For example, address space validation is now part of the memory interface class. [Aaron Giles] Consolidated address space parameters (bus width, endianness, etc.) into a single address_space_config class. Updated all code that queried for address space parameters to use the new mechanism. [Aaron Giles]
* Increased number of coinslots to 12, and tilt inputs to 4, required by ↵ Angelo Salese2010-05-271-1/+11
| | | | in-progress gambling driver [David Haywood]
* Added a new input type IPT_KEYPAD for MESS, to distinguish between fully ↵ Fabio Priuli2010-04-051-0/+1
| | | | featured keyboards and keypad controllers [Fabio Priuli]
* Cleaned natural keyboard implementation (no credits) Miodrag Milanovic2010-02-141-18/+1
|
* Minor function rename. Aaron Giles2010-02-141-1/+1
|
* - Moved natural keyboard support from MESS to MAME Miodrag Milanovic2010-02-121-0/+66
| | | | - Moved OSD file functions and clipboard access functions into OSD core
* - Renamed GAME_COMPUTER_MODIFIED to GAME_UNOFFICIAL to mark unofficial ↵ Miodrag Milanovic2010-02-111-0/+2
| | | | | | | hardware modifications - Removed GAME_COMPUTER it is distinct by IPT_KEYBOARD - Added GAME_NO_SOUND_HW (to mark that there is no sound hardware) and marked drivers in dotrikun.c, minivadr.c and tgtpanic.c as such - Added GAME_CAN_SHARE_ROMS - to mark that there can be other driver using same ROM as this one but with different hardware (common in computer/console world)
* Cleanups and version bump. Aaron Giles2010-01-281-1/+1
|
* Created new template class tagged_list which manages a simple list Aaron Giles2010-01-171-37/+15
| | | | | | | | along with a tagmap. Changed memory regions, input ports, and devices to use this class. For devices, converted typenext and classnext fields into methods which dynamically search for the next item. Changed a number of macros to use the features of the class, removing the need for a bunch of helper functions.
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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!)
* Results of running the latest srcclean. Aaron Giles2009-12-281-7/+7
|
* Fixes so we can compile as C++ again. Aaron Giles2009-12-281-1/+1
|
* Removed old index-based DISCRETE_ADJUSTMENT, and renamed Aaron Giles2009-12-231-3/+0
| | | | | | DISCRETE_ADJUSTMENT_TAG to replace it. Updated all callers. Removed input_port_by_index, as it is no longer needed.
* Cleanups and version bump.mame0135u2 Aaron Giles2009-11-301-2/+2
|
* Added new module tagmap which is a simple hashed string map. Aaron Giles2009-11-231-7/+38
| | | | | | Updated device and input port lists to use the tagmap for tag searches. Also removed the whole "quark" thing from the validity checker in favor of using the tagmaps.
* added device support to the input system. internally this replaces ↵ smf-2009-11-201-1/+36
| | | | | | | | | | | | | | | PORT_CUSTOM/PORT_CHANGED, backward compatibility is achieved with an internal dummy device. added output lines (IPT_OUTPUT), which can be written using new input_port_write* functions or directly from a memory map using AM_WRITE_PORT converted adc083x to use io lines. adc08x chips are all hooked up using input/output ports reversed racing force steering wheel input and gas pedal, which is enough to get the game to boot. reversed steering wheel input on winding heat, the usa cabinets are however hooked up the other way. renamed adc0831_interface to adc083x_interface. fixed adc083x gnd input removed stray call logerror from adc083x.c fixed default adc083x sars value adc083x reset only affects outputs
* > -----Original Message----- Aaron Giles2009-10-011-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > From: Atari Ace [mailto:atari_ace@verizon.net] > Sent: Sunday, September 27, 2009 7:58 AM > To: submit@mamedev.org > Cc: atariace@hotmail.com > Subject: [patch] More _NAME macros > > Hi mamedev, > > MAME's idiom for function/data macros is to first implement > <name>_NAME, then implement the other macros in terms of the _NAME > macro. Then in principle only a single line needs editing to change > the naming convention. > > This patchset implements this idiom more completely. The first patch > adds some missing _NAME macros and fixes cases in source files that > should be using the macros. The second patch then changes header > files where the macros should have been used, but weren't. This > required changing the idiom for removing a machine driver function > pointer from MDRV_<FUNCTION>(NULL) to MDRV_<FUNCTION>(0), to avoid > problems with NULL being macro expanded. This actually unifies the > handling of all such cases, as we already had ipt_0 and driver_init_0. > It also required reworking the devtempl.h implementation in a way that > triggered a warning on MSVC about using empty macros, so vconv.c > needed to be updated. The third patch then renames all the _NAME and > _0 macros to verify that all the cases have been covered, so it isn't > intended to be applied. > > ~aa
* Added PORT_CROSSHAIR_MAPPER() allowing you to specify an alternate, ↵ Aaron Giles2009-09-071-0/+13
| | | | | | non-linear mapping function from the raw crosshair value to its position onscreen. [Aaron Giles]
* > From: Pugsy [mailto:pugsy@gmx.net] Aaron Giles2009-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > Sent: Sunday, August 30, 2009 6:00 PM > To: submit@mamedev.org > Cc: upstephh_wip@yahoo.com > Subject: Added display of cheat comments > > Hi > > One more cheat engine related change. This diff was made against u3 > with the last two diffs I sent > already applied. > > This patch reintroduces the display of the individual cheat comments, > in the old cheat engine this > worked by showing SET,ON or OFF in reverse video to show there was a > comment available which could > be displayed by pressing Shift + Enter. I've done things slightly > different though as I've added a > display comment key of SPACE along with a different way of showing that > a comment is available. > > It now works automatically as soon as you move over a cheat with a > comment it uses popmessage to > display the comment. As soon as you move or press any key (other than > space) it nulls the > popmessage, and by pressing space it will redisplay the comment which > is handy if the comment is a > lengthy one. > > To see it in action look at the bottom two cheats in mslug (or any > neogeo game for that matter). > > Martin 'Pugsy' Pugh > > > MAME Cheat File Maintainer http://mamecheat.co.uk > Gamebase64 Team Member http://www.gamebase64.com >
* Added a POKER_BET general input definition. Roberto Fresca2009-08-221-0/+1
| | | | | This is needed to mantain the standard inputs layout in the poker games. You'll need a clean compile after this addition.
* Added default input mappings for Hanafuda games. Updated most of the ↵ Fabio Priuli2009-08-041-0/+12
| | | | | Hanafuda games to use them. Like for Mahjong games, keys A->H are used. "Yes" is mapped to M, "No" is mapped to N.
* Added a stop4 input to slot default and remapped slot default keys to better ↵ Fabio Priuli2009-08-041-0/+1
| | | | suit Amcoe games.
* Added default input mappings for gambling / poker / slot games. Converted ↵ Fabio Priuli2009-08-021-0/+30
| | | | many drivers to use the new mappings.
* many DIPSW fixes [kanikani] Yasuhiro Ogawa2009-05-271-0/+7
| | | | - added DIPLOCATION to scontra and thunderx - added some DEF_STRs (Difficult, Very Difficult, etc.) and modified drivers using them
* Crosshair update Derrick Renaud2009-03-281-1/+0
| | | | | | | | | | | | | | | | | | * Added Crosshair Options menu - ability to individually enable/disable crosshairs - ability for them to automatically disappear after a set amount of time - ability to select crosshair graphic - all settings are saved in the cfg file * Removed F1 toggle for crosshairs * Added new command option -crsshairpath - store all selectable graphics here - see config.txt for further info OSD NOTE: render_load_png() has been changed to no longer force usage of the artwork directory. Do a search for "render_load_png(" and replace with "render_load_png(OPTION_ARTPATH, " if needed. ---------------------------- F1 is now free to use for something new. I was thinking it would be perfect for a context sensitive help file. Each menu item could have a help tag, that it would look up and display info from an HTML file.
* Many casts added to the core files, and various other tweaks Aaron Giles2009-03-121-0/+1
| | | | to make them compile as either C or C++.
* Converted the following drivers to the new device-based 6821 PIA: Aaron Giles2009-03-021-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - qix - mcr/williams - coinmstr - funworld - goldnpkr - jokrwild - nyny - r2dtank - spiders - tugboat Added new function memory_install_read_port_handler() to more easily allow you to install read handlers for ports based on tag. Removed input_port_read_handler8/16/32/64 functions, since they were really only used for getting a memory handler for a port by tag, and this is no longer necessary. Moved input port handlers to internal code in the memory system. Added port names to the taito8741 device pending its proper devicification. Removed all remaining uses of input_port_n_r() functions, and purged them from src/emu/machine/generic.
* Ok, this is The Big One. Aaron Giles2009-02-111-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please note: regression testing is in progress, but the first round of glaring regressions have already been taken care of. That said, there is likely to be a host of regressions as a result of this change. Also note: There are still a few rough edges in the interfaces. I will try to clean them up systematically once the basic system is working. All sound chips are now proper devices. Merged the sound chip interface into the device interface, removing any differences (such as the whole ALIASing concept). Modified every sound chip in the following ways: * updated to match the device interface * reduced read/write handlers down to the minimal number * added the use of get_safe_token() for ensuring correctness * other minor cleanup Removed the custom sound device. The additional work to just make custom sound cases into full devices is minimal, so I just converted them all over to be actual devices. Vastly simplified the sound interfaces, removing the ghastly sndti_* business and moving everyone over to using tags for sound identity. sndintrf, like cpuintrf, is now just a header file with no implementation. Modified each and every driver that references a sound chip: * all memory maps explicitly reference the targeted device via AM_DEVREAD/AM_DEVWRITE/AM_DEVREADWRITE * 16-bit and 32-bit accesses to 8-bit chips no longer use trampoline functions but instead use the 8-bit AM_DEVREAD/WRITE macros * all references to sound chips are now done via tags * note that these changes are brute force, not optimal; in many cases drivers should grab pointers to devices in MACHINE_START and stash them away
* 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.