summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/sh
Commit message (Collapse)AuthorAgeFilesLines
...
* emumem: A little more speedup. cache and specific change syntax, and are ↵ Olivier Galibert2020-05-254-18/+23
| | | | | | | | | | | | | | | | not pointers anymore [O. Galibert] The last(?) two changes are: - Add a template parameter to everything (theoretically the address space width, in practice a level derived from it to keep as much compatibility between widths as possible) so that the shift size becomes a constant. - Change the syntax of declaring and initializing the caches and specifics so that they're embedded in the owner device. Solves lifetime issues and also removes one indirection (looking up the base dispatch pointer through the cache/specific pointer).
* devices/cpu: simplified some handlers (nw) Ivan Vangelista2020-03-312-28/+28
|
* remove unnecessary SuperH 3/4 timers restarts MetalliC2020-02-251-34/+32
|
* srcclean, manual adjustments (nw) Vas Crabb2020-01-261-1/+1
|
* sh4.cpp: disable timers at reset (nw) yz70s2020-01-141-0/+14
|
* sh3: handle INTEVT register MetalliC2019-12-223-27/+35
|
* cpu\sh2: initialize stuff (nw) Ivan Vangelista2019-12-142-55/+57
|
* Make many device_execute_interface functions noexcept, including the ↵ AJR2019-11-092-9/+9
| | | | | | | | "information" overrides. This also covers several time-related functions in attotime, running_machine and emu_timer. (nw) m6805: Calculate min_cycles and max_cycles once at device_start time (Nw) attotime: Add as_khz and as_mhz (nw)
* sh2: implement watchdog timer MetalliC2019-11-073-1/+58
|
* Make devdelegate more like devcb for configuration. This is a Vas Crabb2019-10-262-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fundamental change to show device delegates are configured. Device delegates are now aware of the current device during configuration and will resolve string tags relative to it. This means that device delegates need a device to be supplied on construction so they can find the machine configuration object. There's a one-dimensional array helper to make it easier to construct arrays of device delegates with the same owner. (I didn't make an n-dimensional one because I didn't hit a use case, but it would be a simple addition.) There's no more bind_relative_to member - just call resolve() like you would for a devcb. There's also no need to cast nullptr when creating a late bind device delegate. The flip side is that for an overloaded or non-capturing lambda you'll need to cast to the desired type. There is one less conditional branch in the hot path for calls for delegates bound to a function pointer of member function pointer. This comes at the cost of one additional unconditional branch in the hot path for calls to delegates bound to functoids (lambdas, functions that don't take an object reference, other callable objects). This applies to all delegates, not just device delegates. Address spaces will now print an error message if a late bind error is encountered while installing a handler. This will give the range and address range, hopefully making it easier to guess which memory map is faulty. For the simple case of allowing a device_delegate member to be configured, use a member like this: template <typename... T> void set_foo(T &&...args) { m_foo_cb.set(std::forward<T>(args)...); } For a case where different delegates need to be used depending on the function signature, see src/emu/screen.h (the screen update function setters). Device delegates now take a target specification and function pointer. The target may be: * Target omitted, implying the current device being configured. This can only be used during configuration. It will work as long as the current device is not removed/replaced. * A tag string relative to the current device being configured. This can only be used during configuration. It will not be callable until .resolve() is called. It will work as long as the current device is not removed/replaced. * A device finder (required_device/optional_device). The delegate will late bind to the current target of the device finder. It will not be callable until .resolve() is called. It will work properly if the target device is replaced, as long as the device finder's base object isn't removed/replaced. * A reference to an object. It will be callable immediately. It will work as long as the target object is not removed/replaced. The target types and restrictions are pretty similar to what you already have on object finders and devcb, so it shouldn't cause any surprises. Note that dereferencing a device finder will changes the effect. To illustrate this: ... required_device<some_device> m_dev; ... m_dev(*this, "dev") ... // will late bind to "dev" relative to *this // will work if "dev" hasn't been created yet or is replaced later // won't work if *this is removed/replaced // won't be callable until resolve() is called cb1.set(m_dev, FUNC(some_device::w)); ... // will bind to current target of m_dev // will not work if m_dev is not resolved // will not work if "dev" is replaced later // will be callable immediately cb2.set(*m_dev, FUNC(some_device::w)); ... The order of the target and name has been reversed for functoids (lambdas and other callable objects). This allows the NAME macro to be used on lambdas and functoids. For example: foo.set_something(NAME([this] (u8 data) { m_something = data; })); I realise the diagnostic messages get ugly if you use NAME on a large lambda. You can still give a literal name, you just have to place it after the lambda rather than before. This is uglier, but it's intentional. I'm trying to drive developers away from a certain style. While it's nice that you can put half the driver code in the memory map, it detracts from readability. It's hard to visualise the memory range mappings if the memory map functions are punctuated by large lambdas. There's also slightly higher overhead for calling a delegate bound to a functoid. If the code is prettier for trivial lambdas but uglier for non-trivial lambdas in address maps, it will hopefully steer people away from putting non-trivial lambdas in memory maps. There were some devices that were converted from using plain delegates without adding bind_relative_to calls. I fixed some of them (e.g. LaserDisc) but I probably missed some. These will likely crash on unresolved delegate calls. There are some devices that reset delegates at configuration complete or start time, preventing them from being set up during configuration (e.g. src/devices/video/ppu2c0x.cpp and src/devices/machine/68307.cpp). This goes against the design principles of how device delegates should be used, but I didn't change them because I don't trust myself to find all the places they're used. I've definitely broken some stuff with this (I know about asterix), so report issues and bear with me until I get it all fixed.
* (nw) removed every remaining AM_ macro I could find in comments, but one in ↵ Ivan Vangelista2019-10-103-8/+8
| | | | emu\memarray.h cause I didn't want to cause a full recompile for this (nw)
* sh2.cpp/sh4.cpp: Don't emit fast RAM accesses when the debugger is enabled ↵ Philip Bennett2019-09-242-88/+94
| | | | [Phil Bennett]
* SH2 clock multiplier docs MetalliC2019-08-293-8/+21
|
* srcclean (nw) Vas Crabb2019-06-233-48/+48
|
* mega32x.cpp: refactor and convert read/write handlers to 16-bit space ↵ Angelo Salese2019-06-222-7/+7
| | | | [Angelo Salese]
* sh2.cpp: first pass over SH7604 SoC refactoring [Angelo Salese] Angelo Salese2019-06-214-419/+1012
| | | | * Fixed division unit overflow flag clearance;
* (nw) Clean up the mess on master Vas Crabb2019-03-261-1/+1
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-1/+1
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* sh2: Fix interpreter for cps3 [O. Galibert] Olivier Galibert2019-01-191-1/+1
|
* -sh2, sh4, sat_ctrl: Removed MCFG, nw mooglyguy2018-12-094-101/+44
| | | | | | | | | | | | -ticket: Added separate hopper_device, nw -aristmk6, atvtrack, cps3, cv1k, hikaru, saturn, sh4robot, stv: Removed MACHINE_CONFIG, nw -sat_ctrl/multitap, segatap: Refactored to use required_devicee_array, removed MACHINE_CONFIG, simplified code, nw -mega32x: Removed code duplication, eliminated MACHINE_CONFIG, nw -vegaeo: Removed machine().device, nw
* -mb86235, sh7604, sharc: Removed MCFG macros, nw mooglyguy2018-12-093-21/+0
| | | | -gticlub, model2, n64, nwk-tr: Removed MACHINE_CONFIG macros, nw
* as if millions of this pointers suddenly cried out in terror, and were ↵ Vas Crabb2018-06-084-28/+28
| | | | | | | suddenly silenced * streamline templates in addrmap.h * get rid of overloads on read/write member names - this will become even more important in the near future
* srcclean (nw) Vas Crabb2018-05-271-1/+1
|
* diexec: Interrupt API changes (nw) AJR2018-05-182-1/+3
| | | | | | - PULSE_LINE is no longer a value. Existing uses have been changed to pulse_input_line with attotime::zero as the second argument. - Formerly only INPUT_LINE_NMI and INPUT_LINE_RESET were allowed with PULSE_LINE. INPUT_LINE_NMI no longer receives special handling; instead, CPU devices must specify which of their input lines are edge-triggered and thus may be used with zero-width pulses by overriding the execute_input_edge_triggered predicate. INPUT_LINE_RESET is still special-cased, however. - execute_default_irq_vector now allows a different default vector to be specified for each input line. This added flexibility may or may not prove useful.
* D'oh. (nw) arbee2018-05-161-0/+7
|
* sh4drc: optimize FPU CMP instructions (nw) arbee2018-05-161-20/+8
|
* sh4drc: fix SR damage in new CMP implementations (nw) arbee2018-05-151-4/+12
|
* Start killing off non-diexec PULSE_LINE hacks (nw) AJR2018-05-155-18/+7
|
* sh4drc: remove remaining CALLC from FRCHG (nw) arbee2018-05-151-5/+13
|
* sh4drc: optimized some of the previously implemented UML (nw) arbee2018-05-141-23/+11
|
* sh4drc: UML implementations of FSTS, FLOAT, FTRC, FNEG, FABS, FSCHG, and ↵ arbee2018-05-141-46/+76
| | | | FRCHG [R. Belmont]
* sh4drc: UML implementations of FLDI0, FLDI1, FCMP_EQ, and FCMP_GT [R. Belmont] arbee2018-05-131-28/+54
|
* emumem: Rename direct_read_handler to memory_access_cache. Parametrize the ↵ Olivier Galibert2018-05-116-28/+65
| | | | template on more information (data width, endianness) to make it possible to turn it into an handler cache eventually, and not just a memory block cache. Make it capable of large and unaligned accesses. [O. Galibert]
* Make MCFG_DEVICE_ADD and callable device types more flexible: Vas Crabb2018-05-042-6/+11
| | | | | | | | | | | | | | | | | | | | | * Allows defaulted clocks (see subtle example with vboy) * Allows additional constructors (see RS232 port in tranz330) * Allows use of device finder in place of tag in MCFG_DEVICE_ADD * Requires out-of-line destructor for devices using incomplete types * Requires XTAL or explicit u32 for clocks for devices with private types Devices must still define the standard constructor. When writing additional constructors, be aware that the constructor runs before device_add_mconfig in the context of the existing device, not the new device. See osborne1, zorba, tranz330, and vboy for examples of this in use. Compilation is a bit slower, but this is temporary while refactoring is in progress. Eliminated the need for MCFG_SOUND_ROUTE_EX. Removed macros from slot option configuration - they just obfuscated code and slowed it down with needless dynamic casts, but didn't actually simplify it.
* srcclean (nw) Vas Crabb2018-04-222-9/+9
|
* maps: Finish devices/cpu (nw) Olivier Galibert2018-04-205-55/+64
|
* sh4drc: 8 more UML conversions (nw) arbee2018-04-151-50/+9
|
* sh4drc: UML version of FMAC, fixed possible error in previous FPU conversion ↵ arbee2018-04-153-69/+69
| | | | (nw)
* sh4drc: 3 more trivial UML conversions (nw) arbee2018-04-151-21/+6
|
* sh4drc: UML implementations of FADD, FSUB, FMUL, and FDIV. [R. Belmont] arbee2018-04-145-327/+361
|
* Reshuffle some stuff: Vas Crabb2018-03-283-5/+5
| | | | | | * Move around the debugger hooks to get a small but measurable performance increase * Remove emucore from external tools * Improve performance of DSP16 interpreter a little by generating six variants of execution loop
* don't pass so many naked pointers around (nw) Vas Crabb2018-03-257-391/+364
|
* reduce scope of stuff with different definitions across CPUs (nw) Vas Crabb2018-03-201-23/+31
|
* Blind faith fixed long names for almost all CPUs (nw) angelosa2018-03-152-7/+7
| | | | mb86235.cpp: renamed pcs_ptr into pcp, and added a file for future interpreter core (nw)
* destaticify initializations (nw) (#3289) wilbertpol2018-03-042-32/+32
| | | | | | * destaticify initializations (nw) * fix this->set_screen (nw)
* API change: Memory maps are now methods of the owner class [O. Galibert] Olivier Galibert2018-02-1210-17/+22
| | | | | Also, a lot more freedom happened, that's going to be more visible soon.
* API change: Memory maps are now "last entry wins" [O. Galibert] Olivier Galibert2018-01-311-2/+2
| | | | | | | This allows for the much more natural "import another map and patch it" structure, or "cover a whole region then punch holes in it". Our previous first-entry-wins rule was always a surprise to newcomers, and oldcomers too.
* xtal.h is dead, long live to xtal.cpp [O. Galibert] Olivier Galibert2018-01-231-0/+1
|
* API Change: Machine configs are now a method of the owner class, and the ↵ Olivier Galibert2018-01-171-3/+3
| | | | | | | | | | prototype is simplified [O. Galibert] Beware, the device context does not follow in MCFG_FRAGMENT_ADD anymore due to the prototype change. So creating a device then configuring through a fragment doesn't work as-is. The simplest solution is just to add a MCFG_DEVICE_MODIFY at the start of the fragment with the correct tag.
* Extended time! All space.device() removed from comments (nw) Olivier Galibert2018-01-051-1/+1
|