Commit Graph

60134 Commits

Author SHA1 Message Date
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
Vas Crabb
27d0cb90ff (nw) well that was dumb - fix crashing ATA devices, slightly modernise some code 2018-07-07 09:37:57 +10:00
Vas Crabb
cecad654da remove more macros (nw) 2018-07-07 05:05:25 +10:00
Vas Crabb
c3fb11c2c9 devcb3
There are multiple issues with the current device callbacks:
* They always dispatch through a pointer-to-member
* Chained callbacks are a linked list so the branch unit can't predict the early
* There's a runtime decision made on the left/right shift direction
* There are runtime NULL checks on various objects
* Binding a lambda isn't practical
* Arbitrary transformations are not supported
* When chaining callbacks it isn't clear what the MCFG_DEVCB_ modifiers apply to
* It isn't possible to just append to a callback in derived configuration
* The macros need a magic, hidden local called devcb
* Moving code that uses the magic locals around is error-prone
* Writing the MCFG_ macros to make a device usable is a pain
* You can't discover applicable MCFG_ macros with intellisense
* Macros are not scoped
* Using an inappropriate macro isn't detected at compile time
* Lots of other things

This changeset overcomes the biggest obstacle to remving MCFG_ macros
altogether.  Essentially, to allow a devcb to be configured, call
.bind() and expose the result (a bind target for the callback).  Bind
target methods starting with "set" repace the current callbacks; methods
starting with "append" append to them.  You can't reconfigure a callback
after resolving it.  There's no need to use a macro matching the
handler signatures - use FUNC for everything.  Current device is implied
if no tag/finder is supplied (no need for explicit this).

Lambdas are supported, and the memory space and offset are optional.
These kinds of things work:
* .read_cb().set([this] () { return something; });
* .read_cb().set([this] (offs_t offset) { return ~offset; });
* .write_cb().set([this] (offs_t offset, u8 data) { m_array[offset] = data; });
* .write_cb().set([this] (int state) { some_var = state; });

Arbitrary transforms are allowed, and they can modify offset/mask for example:
* .read_cb().set(FUNC(my_state::handler)).transform([] (u8 data) { return bitswap<4>(data, 1, 3, 0, 2); });
* .read_cb().set(m_dev, FUNC(some_device::member)).transform([] (offs_t &offset, u8 data) { offset ^= 3; return data; });

It's possible to stack arbitrary transforms, at the cost of compile
time (the whole transform stack gets inlined at compile time).  Shifts
count as an arbitrary transform, but mask/exor does not.

Order of mask/shift/exor now matters.  Modifications are applied in the
specified order.  These are NOT EQUIVALENT:
* .read_cb().set(FUNC(my_state::handler)).mask(0x06).lshift(2);
* .read_cb().set(FUNC(my_state::handler)).lshift(2).mask(0x06);

The bit helper no longer reverses its behaviour for read callbacks, and
I/O ports are no longer aware of the field mask.  Binding a read
callback to no-op is not supported - specify a constant.  The GND and
VCC aliases have been removed intentionally - they're TTL-centric, and
were already being abused.

Other quirks have been preserved, including write logger only logging
when the data is non-zero (quite unhelpful in many of the cases where
it's used).  Legacy syntax is still supported for simple cases, but will
be phased out.  New devices should not have MCFG_ macros.

I don't think I've missed any fundamental issues, but if I've broken
something, let me know.
2018-07-07 02:40:29 +10:00
Patrick Mackinlay
5d9e33b786 nscsi: add support for CD-ROMs with 512-byte blocks (#3727)
* nscsi: add support for CD-ROMs with 512-byte blocks

Older UNIX workstations used SCSI CD-ROM drives with 512-byte logical blocks instead of the now standard 2048. This change makes the block size configurable, and adds logic to translate logical blocks to/from the underlying 2048 byte sectors as needed.

* add support for 512-byte logical blocks
* logmacro.h logging (turned on by default to retain current behaviour)
* added stub for "prevent/allow medium removal" command
* removed some unnecessary state
* minor fix for nscsi_hd "inquiry" command

* minor changes (nw)

* doh (nw)

* this too (nw)
2018-07-06 09:31:29 -04:00
Vas Crabb
ab0f99373d cleanup (nw) 2018-07-06 20:55:59 +10:00
Robbbert
7285b74fc6 (nw) Fixed the build.... hopefully 2018-07-06 20:21:08 +10:00
Patrick Mackinlay
06700b3c52 clipper: minor bugfix (nw) (#3731)
This enables SoftPC to run.
2018-07-06 11:11:13 +02:00
mooglyguy
f3ccd1f7f2 -ps2sony: Various DMA and SIF bug fixes, initial OSDSYS ELF transfers to IOP now, but EE and IOP hang immediately thereafter. nw 2018-07-05 19:04:50 +02:00
Ivan Vangelista
8fe31f857d mappy.cpp: timer_set removal (nw) 2018-07-05 17:07:20 +02:00
Ivan Vangelista
c709bebef0 jangou.cpp: slight improvements to luckygrl decryption (nw) 2018-07-05 16:59:00 +02:00
Ivan Vangelista
009d3f8b1c microtan: device_finder and other minor clean-ups (nw) 2018-07-05 16:54:17 +02:00
Patrick Mackinlay
7bee6e6f1e interpro: CLIX boots (on the ip2000) (#3730)
Too many changes to describe in detail. A rewrite of the interrupt and dma code in the ioga, and fixes to the cpu and mmu were the most important things.
2018-07-05 16:22:05 +02:00
Vas Crabb
d4e6275690 misc cleanup and stuff to make macro removal easier (nw) 2018-07-05 23:05:45 +10:00
ajrhacker
827fbdbc1e
Merge pull request #3728 from pmackinlay/ncr5390
ncr5390: dma fixes again (nw)
2018-07-05 07:59:12 -04:00
mooglyguy
cd4c3b694e ps2sony: Disable debug printing, nw 2018-07-05 13:32:59 +02:00
mooglyguy
9d509bd29c Fix divtlb crash, nw 2018-07-05 13:14:18 +02:00
mooglyguy
ba4f99c559 ps2sony: Added skeleton DMAC, INTC, and SIF devices, nw 2018-07-05 13:14:17 +02:00
Patrick Mackinlay
391f5c9f90 ncr5390: dma fixes again (nw)
After reversing myself on this several times before, I hope I've now finally got it right.
* function/bus complete should proceed when the fifo is empty, to allow devices to send less data than indicated in the transfer count
* raise drq when tcounter = 0 (meaning 65536 bytes)
2018-07-05 15:53:04 +07:00
AJR
790009096b apple2gs.cpp: A neater way of handling shared RAM (nw) 2018-07-04 23:32:29 -04:00
AJR
015d55d8f7 Fix validation of pippin (nw) 2018-07-04 23:27:32 -04:00
arbee
1bb565da36 apple2gs: more savestate fixups (nw) 2018-07-04 19:58:25 -04:00
arbee
dc654b8b0f es5503: fixed bad playback of synthLAB sampled-attack looped-sustain instruments [R. Belmont] 2018-07-04 16:59:04 -04:00
arbee
4cd311a25d apple2gs: fixed save state issues with new driver (nw) 2018-07-04 16:11:46 -04:00
Olivier Galibert
fe6851a2d5 68000: stop the cpu on recursive berr (nw) 2018-07-04 21:14:30 +02:00
arbee
3a482682cc apple2gs: fixed issues with Jam Session and ACS Demo Disk #2 [R. Belmont] 2018-07-04 12:09:50 -04:00
Olivier Galibert
5725df5542 *DUH* (nw) 2018-07-04 16:44:43 +02:00
Ivan Vangelista
8b9bf4ed75
goldstar.cpp: feverch has a 3rd SN76489 (nw) 2018-07-04 14:00:21 +02:00
AJR
f7e5fbdd2e mac.cpp, macpci.cpp: Eliminate machine().device (nw)
undrfire.h: Fix minor mistake (nw)
2018-07-04 07:54:22 -04:00
AJR
8190d3b13e megazone: Eliminate machine().device (nw) 2018-07-04 07:24:36 -04:00
Vas Crabb
5ba14be3b9 misc cleanup (nw) 2018-07-04 21:17:38 +10:00
Ivan Vangelista
9d1b5aa941
goldstar.cpp: fixed my typo, feverch doesn't have multiplexed inputs (nw) 2018-07-04 12:02:48 +02:00
Olivier Galibert
5d04fdd06a Ensure split accesses are always done in increasing addresses order (nw) 2018-07-04 10:07:40 +02:00
Robbbert
0ae1c2aaa5 (nw) fixed validation error 2018-07-04 17:57:55 +10:00
Robbbert
f3b71f071b (nw) protected is needed for derived classes 2018-07-04 17:30:09 +10:00
braintro
a227a38081 tatsumi.cpp: Fix minor commit issue (nw) 2018-07-03 23:08:17 -05:00
braintro
2da8a8e2ae new non-working clone: Apache 3 (rev E)
New Non-Working Clone Added
------------------------------------------
Apache 3 (rev E) [coolmod, The Dumping Union]
2018-07-03 23:04:20 -05:00
braintro
073fa31435 new non-working clone: Apache 3 (rev E)
New Non-Working Clone Added
---------------------------------------------
Apache 3 (rev E) [coolmod, The Dumping Union]
2018-07-03 22:54:15 -05:00
arbee
a47801d773 It helps to commit the latest local version (nw) 2018-07-03 21:32:34 -04:00
arbee
7bb3edcb23 And forgot a file (nw) 2018-07-03 21:22:17 -04:00
arbee
e019d58dfe apple2gs: rewritten driver using bankdev. [R. Belmont] 2018-07-03 21:15:50 -04:00
Ivan Vangelista
927623bb18 new not working machine
--------------------------------
Fever Chance [GoneMad]
2018-07-03 18:50:17 +02:00
Vas Crabb
5931e88686 misc cleanup and devcb3 prep (nw) 2018-07-03 22:07:08 +10:00
AJR
3094b15507 usgames.cpp: More specific CPU type (nw) 2018-07-03 00:46:51 -04:00
R. Belmont
b0b61683d1
Merge pull request #3708 from FakeShemp/st
Add new ST floppy dump
2018-07-02 14:57:20 -04:00
R. Belmont
a9dbfa677f
Merge pull request #3719 from UED-Wayder/x68k_1
x68k_flop: fix redump "bgelmntt" and "gradius2d"
2018-07-02 14:49:25 -04:00
cam900
595512e60e drgnmst.cpp : Cleanups, Reduce duplicates (#3705)
Add PALETTE_DECODER for palette
2018-07-03 04:11:47 +10:00
Vas Crabb
2971f4cdbf emu.h must be the first thing in a compilation unit and nowhere else, or behaviour becomes inconsistent between MSVC and GCC due to how pre-compiled headers are handled in MAME (nw) 2018-07-03 04:05:39 +10:00
cam900
87a57056a2 silkroad.cpp : Cleanup duplicates, ACCESSING_BITS, Reduce unused (#3713) 2018-07-03 03:25:58 +10:00
Vas Crabb
7da0bb19d6 misc cleanup and compile fix for superqix.cpp (nw) 2018-07-03 03:18:42 +10:00