Commit Graph

106 Commits

Author SHA1 Message Date
Patrick Mackinlay
eed6108b15 z80scc: fix access to wr7' 2023-06-07 08:58:18 +07:00
MooglyGuy
c5a978bca7
Cleaned up logging across the codebase (GitHub #10183). (#11250) [Ryan Holtz]
* Converted various logging patterns to use logmacro.h consistently.
* Removed redefinitions of LOG_GENERAL.
* Use LOGMASKED in more places.
2023-05-23 15:41:27 +10:00
AJR
a738dc0739 z80scc: Make receive error logging conditional 2023-03-30 22:22:12 -04:00
Vas Crabb
0fab97a476 Fixed a few issues identified by Coverity:
* cpu/m6805: Removed unnecessary comparison that can't be true from
  'HC05 timer handler.
* machine/z80scc.cpp: Fixed flag test in logging.
* emu/devdelegate.h: Fixed use-after-move in functoid constructor.
* util/unzip.cpp: Fixed integer promotion issue in ZIP16 member header
  handling.
* util/xmlfile.cpp: Got rid of custom allocator functions that have
  alignment issues and no longer provide value.
* capcom/alien.cpp: Use machine().rand() for determinism.
* ensoniq/esqpanel.cpp: I/O stream eof() returns whether a read stopped
  short due to EOF, not whether the file pointer is at EOF.
* sega/sms.cpp: Fixed a few use-after-move errors.
* osd/modules/monitor: Fixed an apparent bug in what appears to be a
  setter member function.
2022-11-06 08:09:23 +11:00
Olivier Galibert
4f5bb1e9f7 Fix a number of uninitialized variables 2022-07-18 18:47:40 -04:00
Brice Onken
f079cbf8dc
machine/z80scc.cpp: Implemented /W//REQ and /DTR//REQ DMA request features. (#9952)
Adds support for using /W//REQ as the RX DMA pin, as well as the /DTR//REQ pin as the TX DMA pin, allowing software that uses both directions simultaneously to function.
2022-07-07 18:40:34 +10:00
MooglyGuy
1bc5484698
- Removed device_timer, device_timer_id, et al in favor of direct callback members. (#9788)
Primarily, this removes device_t::device_timer, device_t::timer_set,
device_t::synchronize, device_t::timer_expired, and device_timer_id.
Use of device_timer often resulted in unnecessary trampolining in
addition to switch/case overhead on a driver/device level, and
additional logic to manage delegated vs. ID-based timers on a core
level.  In the worst cases, devices were performing a switch/case with
only one valid case.

device_scheduler::timer_set is marked deprecated as the only remaining
direct uses are via the Lua engine and a few drivers that need
refactoring anyway.  The remaining uses occur via
device_scheduler::synchronize.

As a middle ground between the extremely short timer_alloc() and the
extremely long
machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(widget_device::contoso_tick), this)),
a helper function in device_t has been added which can be invoked with
the following syntax:
timer_alloc(FUNC(widget_device::contoso_tick), this)

- Additional changes/cleanups performed along the way:

- Converted to use logmacro:
 * src/devices/bus/ieee488/hp9895.cpp
 * src/devices/bus/ieee488/remote488.cpp
 * src/devices/bus/isa/hdc.cpp
 * src/devices/bus/isa/omti8621.cpp
 * src/devices/bus/isa/sc499.cpp
 * src/devices/bus/vip/vp550.cpp
 * src/devices/cpu/i86/i186.cpp
 * src/devices/cpu/lc8670/lc8670.cpp
 * src/devices/machine/68230pit.cpp
 * src/devices/machine/corvushd.cpp
 * src/devices/machine/ds1994.cpp
 * src/devices/machine/ticket.cpp
 * src/mame/audio/pinsnd88.cpp
 * src/mame/drivers/notetaker.cpp
 * src/mame/machine/asic65.cpp
 * src/mame/machine/rmnimbus.cpp
 * src/mame/machine/victor9k_fdc.cpp
 * src/mame/video/uv201.cpp

- Made usage of m_member prefix consistent:
 * src/devices/bus/isa/hdc.cpp
 * src/devices/bus/isa/omti8621.cpp
 * src/devices/bus/vme/vme_fccpu20.cpp
 * src/devices/machine/ds1386.cpp
 * src/devices/machine/i7220.cpp

- Spacing consistency pass:
 * src/devices/bus/isa/hdc.cpp
 * src/devices/bus/isa/omti8621.cpp
 * src/devices/bus/thomson/nanoresau.cpp
 * src/devices/bus/ti99/internal/992board.cpp
 * src/devices/bus/ti99/internal/genkbd.cpp
 * src/devices/bus/ti99/internal/joyport/handset.cpp
 * src/devices/bus/vme/vme_fccpu20.cpp
 * src/devices/cpu/i86/i186.cpp
 * src/devices/cpu/lc8670/lc8670.cpp
 * src/devices/machine/68230pit.cpp
 * src/devices/machine/cop452.cpp
 * src/devices/machine/corvushd.cpp
 * src/devices/machine/hp_dc100_tape.cpp
 * src/devices/machine/hp_taco.cpp
 * src/devices/machine/meters.cpp
 * src/devices/machine/microtch.cpp
 * src/devices/machine/phi.cpp
 * src/devices/video/ef9365.cpp
 * src/devices/video/v9938.cpp
 * src/mame/drivers/alphaskop41xx.cpp
 * src/mame/drivers/myb3k.cpp
 * src/mame/drivers/notetaker.cpp
 * src/mame/drivers/wpc_an.cpp
 * src/mame/machine/midikbd.cpp
 * src/mame/machine/rmnimbus.cpp
 * src/mame/machine/wpc_lamp.cpp
 * src/mame/machine/wpc_out.cpp

- Removed string-based ioport lookups:
 * src/devices/bus/ti99/internal/joyport/handset.cpp
 * src/devices/bus/ti99/internal/joyport/mecmouse.cpp
 * src/devices/bus/vme/vme_hcpu30.cpp
 * src/mame/machine/k7659kb.cpp
 * src/mame/machine/ti85.cpp

- Adjustments to grammar/wording in comments
 * src/devices/bus/sms_ctrl/lphaser.cpp
 * src/devices/bus/sms_ctrl/sports.cpp
 * src/devices/bus/snes/event.cpp
 * src/devices/bus/snes/sa1.cpp
 * src/devices/bus/thomson/nanoresau.cpp
 * src/devices/bus/z88/z88.cpp
 * src/devices/machine/ds1386.cpp
 * src/devices/machine/vic_pl192.cpp

- Favored BIT() macro for single-bit checks
 * src/devices/bus/ti99/internal/992board.cpp
 * src/devices/bus/ti99/joyport/handset.cpp
 * src/mame/drivers/notetaker.cpp
 * src/mame/machine/wpc_lamp.cpp
 * src/mame/machine/wpc_out.cpp

- Removed C89-style variable declarations when noticed
 * src/devices/bus/isa/hdc.cpp
 * src/devices/bus/sms_ctrl/lphaser.cpp
 * src/devices/bus/ti99/joyport/mecmouse.cpp
 * src/devices/machine/acorn_vidc.cpp
 * src/devices/sound/ymz280b.cpp
 * src/devices/video/vic4567.cpp

- Removed FUNCNAME to avoid compiler-specific #define checks in devices
 * src/devices/bus/vme/vme_fccpu20.cpp
 * src/devices/bus/vme/vme_hcpu30.cpp
 * src/devices/machine/68230pit.cpp
 * src/devices/machine/mc14411.cpp
 * src/mame/drivers/myb3k.cpp

- Removed unecessary member prefixes/suffixes
 * src/devices/video/ef9340_1.cpp
 * src/mame/drivers/fuukifg2.cpp
 * src/mame/drivers/fuukifg3.cpp
 * src/mame/drivers/intv.cpp
 * src/mame/drivers/simpsons.cpp
 * src/mame/drivers/socrates.cpp
 * src/mame/drivers/special_gambl.cpp
 * src/mame/drivers/sprint4.cpp
 * src/mame/drivers/ti990_10.cpp
 * src/mame/drivers/tubep.cpp
 * src/mame/drivers/vectrex.cpp
 * src/mame/drivers/wpc_an.cpp
 * src/mame/drivers/wpc_dot.cpp
 * src/mame/drivers/wpc_flip1.cpp
 * src/mame/drivers/wpc_flip2.cpp
 * src/mame/machine/z80ne.cpp
 * src/mame/video/rollerg.cpp

- Switched to lower-case hex constants
 * src/devices/video/ef9365.cpp
 * src/mame/machine/rmnimbus.cpp

- Re-ordered driver overrides and function members
 * src/mame/drivers/boxer.cpp
 * src/mame/drivers/eurocom2.cpp
 * src/mame/drivers/exidy.cpp
 * src/mame/drivers/gpworld.cpp
 * src/mame/drivers/h19.cpp
 * src/mame/drivers/ibmpcjr.cpp
 * src/mame/drivers/mekd5.cpp
 * src/mame/drivers/mgolf.cpp
 * src/mame/drivers/myb3k.cpp
 * src/mame/drivers/nightmare.cpp
 * src/mame/drivers/notetaker.cpp
 * src/mame/drivers/ptcsol.cpp
 * src/mame/drivers/pwrview.cpp
 * src/mame/drivers/rabbit.cpp
 * src/mame/drivers/sitcom.cpp
 * src/mame/drivers/socrates.cpp
 * src/mame/drivers/sprint4.cpp
 * src/mame/drivers/techno.cpp
 * src/mame/drivers/thayers.cpp
 * src/mame/drivers/ti990_10.cpp
 * src/mame/drivers/ti990_4.cpp
 * src/mame/drivers/tv912.cpp
 * src/mame/drivers/tv990.cpp
 * src/mame/drivers/uchroma68.cpp
 * src/mame/drivers/vk100.cpp
 * src/mame/drivers/votrhv.cpp
 * src/mame/drivers/wicat.cpp
 * src/mame/drivers/wpc_an.cpp
 * src/mame/includes/abc80.h
 * src/mame/includes/asterix.h
 * src/mame/includes/fuukifg2.h
 * src/mame/includes/fuukifg3.h
 * src/mame/includes/gunbustr.h
 * src/mame/includes/intv.h
 * src/mame/includes/namcona1.h
 * src/mame/includes/newbrain.h
 * src/mame/includes/poly.h
 * src/mame/includes/prof80.h
 * src/mame/includes/rollerg.h
 * src/mame/includes/s11.h
 * src/mame/includes/segahang.h
 * src/mame/includes/simpsons.h
 * src/mame/includes/spacefb.h
 * src/mame/includes/tandy2k.h
 * src/mame/includes/trucocl.h
 * src/mame/includes/tubebp.h
 * src/mame/includes/vidbrain.h
 * src/mame/includes/wolfpack.h
 * src/mame/includes/wpc_dot.h

- Made capitalization consistent on class members
 * src/devices/machine/meters.cpp
 * src/mame/drivers/namcona1.cpp
 * src/mame/drivers/notetaker.cpp

-src/devices/bus/isa/hdc.cpp:
 * Removed fixed-size std::vector in favor of std::unique_ptr

-src/devices/bus/isa/s3virge.cpp:
 * Moved unusually large (for a header) functions into .cpp from header

-src/devices/bus/vip/vp550.cpp
 * Switched to required_device_array to simplify code paths

-src/devices/machine/arm_iomd.cpp
 * Added initializers to constructor
 * Favored std::size over fixed static sizes

-src/devices/machine/ds1386.cpp
 * Moved register #defines into header enums

-src/devices/machine/mc68901.cpp
 * Removed unnecessary parameters and emu_timer::enable calls

-src/devices/machine/mccs1850.cpp
 * Removed inline overuse

-src/devices/machine/meters.cpp
 * Removed unused members

-src/devices/machine/mos6526.cpp
 * Removed inline overuse

-src/devices/machine/nsc810.cpp
 * Converted to arrays rather than individually-numbered members

-src/devices/machine/pxa255.cpp
 * Simplified DMA transfer code

-src/devices/machine/saa1043.cpp
 * Removed extraneous members in favor of resolve_all_safe

-src/devices/machine/vic_pl192.cpp
 * Shifted constructors, start-up, and maps to be at the top of the source file

-src/devices/machine/z8536.cpp
 * Removed stray uses of device_timer_id

-src/devices/sound/cdp1869.cpp
 * Removed inline overuse

-src/devices/sound/mos7360.cpp
 * Converted to arrays rather than individually-numbered members

-src/emu/device.cpp
 * Removed ID-based timer_alloc
 * Removed timer_set
 * Removed synchronize
 * Removed timer_expired
 * Added shorthand timer_alloc to avoid lengthy machine().scheduler().timer_alloc() calls

-src/emu/schedule.cpp
 * Removed now-unused m_id and m_device members

-src/mame/audio/alesis.cpp
 * Added initializers to constructor

-src/mame/drivers/alto2.cpp
 * Removed custom-named driver init in favor of driver_init override
 * Removed octal constant in favor of more standard hex

-src/mame/drivers/astinvad.cpp
 * Fixed 'kamizake' typo

-src/mame/drivers/tm990189.cpp
 * Removed unnecessary machine reset override

-src/mame/drivers/unichamp.cpp
 * Removed custom-named driver init in favor of driver_init override

-src/mame/drivers/votrhv.cpp
 * Fixed ROM_LOAD macros and region() usage in memory maps

-src/mame/machine/victor9k_fdc.cpp
 * Made bracing style consistent across the file

-src/mame/video/gime.cpp
 * Removed unnecessary void specifiers in function prototypes
2022-06-04 17:14:21 +10:00
Vas Crabb
6ff40e09bd Micscellaneous cleanup/fixes:
machine/z80scc.cpp: Fixed a cast-to-bool that broke detection of changes
to one register bit.

formats/fsmeta.cpp: Use visitors with variants where it makes sense.

docs: Updated minimum required SDL version to 2.0.6 for all targets,
added note that Python 3 is included with Xcode and updated instructions
for downloading stand-alone Python 3 for macOS.

ksys573.cpp: Don't create an insane number of textures for fghtmn and
pnchman internal artwork.

Tidied another batch of slot machine layouts.
2022-04-30 06:42:09 +10:00
MooglyGuy
a068e3d7a2
Addressed performance loss from recent z80scc changes (#9629) [Ryan Holtz]
z80scc: Removed unused Z80SCC_USE_LOCAL_BRG and simplified
WR15_ZEROCOUNT usage to reduce the likelihood of needless timer
activation.

mips3drc: Additional micro-optimizations to generate_checksum_block.
2022-04-26 22:53:54 +10:00
ksherlock
54b1e34d36
z80scc: add support for WR15_ZEROCOUNT interrupts (MT 8239). (#9604) 2022-04-21 18:42:33 -04:00
Paul-Arnold
209b0bf704
rastersp.cpp: Added Football Crazy game. (#9383)
* machine/53c7xx.cpp: DFE bit is not reset when status register is read.
* cpu/i386: Fixed multiple issues with breakpoint emulation.
* machine/bacta_datalogger.cpp: Prevent continuous transmission of 0xff.
* machine/z80scc.cpp: Fixed incorrect setting of baud rate due to uninitialised variables.

New working machines
--------------
Football Crazy (Video Quiz) [Paul-Arnold]
2022-03-30 02:25:03 +11:00
AJR
ca79d71af4 Remove void *ptr parameter from emu_timer, timer_device and all related callbacks 2022-01-26 08:56:03 -05:00
Patrick Mackinlay
8a2de2875a z80scc: implement local loopback 2021-05-24 12:30:06 +07:00
Patrick Mackinlay
f891a3c757 z80scc: there's only one wr2 2021-02-01 16:38:22 +07:00
Patrick Mackinlay
02198d069b z80scc: tidy logging a little bit 2021-02-01 16:36:24 +07:00
Dirk Best
2908f3b1cd z80scc: Fix vector modification in high bits 2020-10-03 10:14:32 +02:00
Patrick Mackinlay
963a2c166d z80scc: clear IUS not IP (nw) 2020-05-08 14:26:19 +07:00
Patrick Mackinlay
505e8a4310 z80scc: don't invent data (nw) 2020-05-06 13:42:52 +07:00
Patrick Mackinlay
ed8e70a2fc z80scc: test the correct bit (nw) 2020-04-17 10:48:20 +07:00
Ivan Vangelista
1aea20ce3e devices/machine: simplified handlers for various devices (nw) 2020-03-24 19:21:34 +01:00
Vas Crabb
601034c8d7 devcb.cpp: syntactic sugar for constructing/resolving arrays of callbacks (nw)
Saves a lot of typing { *this }, { *this }...  Could be applied in more places,
I just did a few devices to demonstrate it.
2020-02-05 12:41:58 +11:00
AJR
c92a21ebb9 z80scc: Read/write handler cleanups (nw)
- Simplify handler signatures
- Rename cd_ab_r/w and ba_cd_inv_r/w to dc_ab_r/w and ab_dc_r/w to be more hardware-accurate
- Eliminate cd_ba_r/w and ba_cd_r/w (no legitimate uses in existing code)

mvme162: Fix SCC addressing (nw)

Note that the SCC's address inputs are A/~B and D/~C, rather than the Z80 SIO's B/~A and C/~D.
2019-06-12 19:51:03 -04:00
AJR
94b2eb8f27 z80scc: Reduce gratuitous logging (nw) 2019-05-30 19:00:40 -04:00
Vas Crabb
97b6717027 (nw) Clean up the mess on master
This effectively reverts b380514764 and
c24473ddff, restoring the state at
598cd52272.

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.
2019-03-26 11:13:37 +11:00
andreasnaive
b380514764 Revert "conflict resolution (nw)"
This reverts commit c24473ddff, reversing
changes made to 009cba4fb8.
2019-03-25 23:13:40 +01:00
MooglyGuy
22f6e038b2 -src/devices/machine: Random MCFG and MACHINE_CONFIG removals, nw 2019-02-03 03:32:48 +01:00
Patrick Mackinlay
14a623f407 z80scc: don't spam interrupt state (nw) 2019-01-10 17:34:09 +07:00
mooglyguy
27ee4f3915 -sun4: Added a sun4c MMU device. Currently wraps the functionality of S4-buffer, S4-cache, and S4-MMU, will eventually be split. [Ryan Holtz]
-sun4: Significant optimization, from 150% -> 330% unthrottled on an i7-5930K. [Ryan Holtz]
2018-09-22 19:41:10 +02:00
Ivan Vangelista
21c7546c91 z80scc.cpp, z80sio.cpp: deMCFGfied; 8530scc.cpp: removed macros which weren't already needed (nw) 2018-08-27 18:17:39 +02:00
Patrick Mackinlay
cbbfc0eb83 interpro: headless configuration working (#3849)
* interpro: headless boot working

These fixes enable booting and CLIX installation on headless InterServe systems (InterPro systems without graphics) using a VT100 or VT220 compatible terminal on serial port 2 (0 for ip6000). It's now possible to install and boot CLIX on the ip6000 system, as this works around the issues with the incomplete graphics hardware support in the driver.
* interpro: tidy serial configuration, add missing control lines
* ioga: fix serial dma
* z80scc: update /WREQ when transmitter is enabled/disabled, use 0 for assert state of active low output
* softlist: added 60x0 CLIX root floppies

* z80scc: tidy (nw)
2018-08-14 00:12:21 +10:00
Robbbert
6168192b53 Z80SCC : fixed zbus access ; c900 : used Z80SCC for the terminal 2018-08-11 01:09:42 +10:00
Patrick Mackinlay
d7eea22d29 z80scc: serial control signal fixes
* /CTS, /DCD and /SYNC are active low lines represented as 1's in rr0 when asserted
* immediately deassert /RTS in some circumstances
* fix rr1 "all sent" status handling
* there is no ring indicator input line
* generate interrupts for /SYNC input
2018-08-09 14:10:18 +07:00
arbee
1c800e0b96 z80scc: Clear tranmitter interrupt if a written byte fills the FIFO. Fixes Apple IIgs problems without breaking Intergraph. [pmackinlay, R. Belmont] 2018-07-06 23:48:15 -04:00
arbee
44bc4d6bc3 z80scc: fix transmit interrupt behavior that was locking up the Apple IIgs [R. Belmont] 2018-07-01 17:39:57 -04:00
Patrick Mackinlay
cf754198f5 z80scc: actually clear interrupt state (nw) 2018-06-04 19:29:17 +07:00
AJR
6652225def z80scc: Remove generic device type (which nothing was using) and custom MCFG_SCCXXXX_ADD macros (nw) 2018-05-27 16:57:25 -04:00
AJR
0ba652e723 diexec: Interrupt API changes (nw)
- 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.
2018-05-18 13:40:29 -04:00
Vas Crabb
aecf472210 fixup (nw) 2018-01-28 00:37:09 +11:00
Vas Crabb
4b7016ddc9 (nw) don't get hit by the bus - remove unnecessary reset calls, improve error checking 2018-01-27 23:55:45 +11:00
Olivier Galibert
d469cc04bc API Change: Machine configs are now a method of the owner class, and the 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.
2018-01-17 16:11:18 +01:00
Joakim Larsson Edstrom
91b4e5af0b z80scc: general cleanup part III 2017-11-21 13:53:08 +01:00
Joakim Larsson Edstrom
846e5d67c1 z80scc: general cleanup and backport of z80sio improvements part II 2017-11-20 02:00:20 +01:00
Joakim Larsson Edstrom
2e9b62d4bd z80scc: general cleanup and backport of z80sio improvements part I 2017-11-20 00:02:03 +01:00
Vas Crabb
4c29419cab srcclean (nw) 2017-10-22 12:34:30 +11:00
Vas Crabb
7980558cc1 z80scc: fix interrupt mask generation [Patrick Mackinlay] 2017-10-17 21:36:45 +11:00
Joakim Larsson Edstrom
8c87cbae37 z80sio/z80scc: now returns cpu specific default vector when no interrupt found to acknowledge 2017-09-21 14:19:46 +02:00
Vas Crabb
c5c3012634 Cleaned up serial, matrix keyboard and TI-8x link protocol interfaces:
* Switched to delegate timers
 - Frees implementations from having to call timer method
 - Eliminates risk of ID conflicts with implementations/other interfaces
* Moved save state registration to interface post start
 - Plays nicely with device_missing_dependencies exceptions
 - Frees implementation from having to call save state registration method
 - Improves save state support in devices that neglected to call method
2017-07-11 02:31:42 +10:00
Patrick Mackinlay
33b04cec42 z80scc: basic wait/dma request support (#2441)
* improved initiator transfer information logic
* split transfer count/counter
* added rudimentary 53c90a/53c94 support
* reworked initiator transfer information state machine: should now support all scsi phases
* improved handling of dma/non-dma commands
* added an undocumented hack to make InterPro work
* match updated 5390 device
* inherit memory map
* z80scc: basic wait/dma request implementation
* z80scc: renamed WRDY to WREQ to match datasheet, minor touch-up
2017-07-06 17:00:31 +10:00
Ted Green
ae850a9d66 z80scc: Move rearming of tx interrupt from tx buffer write to transmit complete when using WR0_RESET_TX_INT. (nw) 2017-06-05 11:53:32 -06:00
R. Belmont
0a4ea6bfc7 Merge pull request #2344 from JoakimLarsson/scc_rx_int3
Added support for resetting RX interrupts/status by reading Rx FIFO t…
2017-06-02 22:05:49 -04:00