Commit Graph

56 Commits

Author SHA1 Message Date
cracyc
ff808d1af4 i8089: channel priorities [Carl]
i8251: fix rx (nw)
z80dart: fix rx (nw)
imd_dsk: fix free array crash (nw)
(mess) isbc_215g: hdd seeks (nw)
2014-03-12 21:43:05 +00:00
Michaël Banaan Ananas
17b7a9d36c fix array out of bounds access 2014-02-26 21:14:48 +00:00
smf-
36ea0b6253 Removed diserial connect(). Converted thomson, mc1502 & wangpc to use DEVCB2 instead. [smf] 2014-02-24 13:52:14 +00:00
smf-
61424105fb Changed parity & stop bits to an enum (you can now pass in 1.5). I've updated the uarts that were testing for 1.5 stop bits to pass that in, but there are probably others & 1.5 stop bits is converted to 2 by diserial. However the 68681 requires stop bits to be specified in clocks, so this will change in the future. Replaced synchronous flag with start bit count, as some uarts can use a start bit in synchronous mode & that whether there is a start bit is all the flag is currently controlling. Updated rs232 terminal to allow startbits, stop bits 1.5 to be specified (although that is currently not supported by diserial) and individual transmit and receive baud rates. [smf] 2014-01-13 11:20:45 +00:00
smf-
d208600d68 moved variables (nw) 2014-01-10 16:42:04 +00:00
smf-
45f17e9c0f Call set_data_frame() before stc_rcv_rate() in a few more places, as since r26274 there is random behaviour if you don't [smf] 2014-01-10 16:24:51 +00:00
smf-
fa006a2c7c fixed Z80DART parity selection [smf] 2014-01-08 22:37:42 +00:00
smf-
d1848fa894 It makes more sense to mask out the errors that are going to be brought in from the error mask rather than throw all the other bits away. However I haven't seen any documentation for Z80DART that says there is an error FIFO at all. [smf] 2014-01-08 01:34:20 +00:00
smf-
e9aa1c9a03 Sets RR1_ALL_SENT on reset, previously it relied on tra_complete() being called after reset. It's no longer called if there has been no data sent. 2014-01-08 00:44:56 +00:00
cracyc
0e95be33ee z80dart: add priority and irq vector for 8274 (nw) 2013-12-29 23:36:53 +00:00
Miodrag Milanovic
ca546caa6e Cleanups and version bump 2013-12-24 07:24:51 +00:00
smf-
25b08cec6b replaced read rx callback in Z80DART (and clones) with a write handler, which allows multiple chips to be connected together without using glue methods. [smf] 2013-12-22 22:05:13 +00:00
Olivier Galibert
671ba32470 diserial: Remove defines, cleanup clocks/timers, add sync support [O. Galibert] 2013-11-18 21:05:30 +00:00
Curt Coder
252fc882a8 Lessen log pollution. (nw) 2013-11-16 11:55:03 +00:00
Curt Coder
846c70bee9 License tags. (nw) 2013-10-16 13:38:21 +00:00
Miodrag Milanovic
e533a04f2e changed rest of devices (except cpu cores) to have shortname and sourcefile (nw) 2013-06-21 14:44:06 +00:00
Miodrag Milanovic
16f5234d43 Cleanups and version bump 2013-06-11 07:16:42 +00:00
Curt Coder
779d07a706 (MESS) superslv: Fixed regression. (nw) 2013-06-02 20:07:23 +00:00
cracyc
94d818b894 (mess) qx10kbd: update to use z80dart (nw) 2013-05-28 21:34:06 +00:00
Curt Coder
0884496d2b z80dart: Cleanup. (nw) 2013-05-28 13:43:50 +00:00
Curt Coder
52a48842f0 z80dart: Refactored z80dart_channel to implement device_serial_interface. (nw) 2013-05-28 12:28:01 +00:00
Curt Coder
ebccb44079 z80dart: Refactored dart_channel to be of device_t kin. (nw) 2013-05-28 11:18:50 +00:00
Curt Coder
ca5f8908f5 (MESS) Refactored drivers to use z80dart.c instead of z80sio.c, the easy part. (nw) 2013-05-27 20:10:47 +00:00
Curt Coder
0584bb9d5a z80dart: Merged in uPD7201 and modernized the interface. [Curt Coder] 2013-05-27 14:02:08 +00:00
Curt Coder
fba6bce6c6 z80dart: Added modern register accessors. (nw) 2013-02-02 17:20:28 +00:00
Miodrag Milanovic
0e19f641d3 Cleanups and version bump 2013-01-11 07:32:46 +00:00
Curt Coder
1568a656f8 (MESS) bw12, xerox820, wangpc: Fixed floppy. [Curt Coder] 2013-01-09 17:56:14 +00:00
Aaron Giles
cc16777cce Memory handler normalization, part 1.
READ/WRITE_DEVICE*_HANDLERs are now passed an
address_space &, and the 8-bit variants get a mem_mask
as well. This means they are now directly compatible
with the member function delegates. Added a generic
address space to the driver_device that can be used
when no specific address space is available. Also
added DECLARE_READ/WRITE_DEVICE*_HANDLER macros to
declare device callbacks with default mem_mask
parameters. [Aaron Giles]
2012-09-17 07:43:37 +00:00
Curt Coder
9adfcb84bd Fixed Z80DART FIFO starting index. [Curt Coder] 2011-09-29 14:10:13 +00:00
Curt Coder
79d92d00a1 Exposed the Z80 DART interrupt vector to non-Z80 users. [Curt Coder] 2011-09-26 15:41:02 +00:00
Aaron Giles
722631601e Reimplemented devcb using delegates and classes. Unified the logic
for identifying targets and simplified the code. [Aaron Giles]

I have some further ideas but this is a good midway point.
2011-05-02 03:32:58 +00:00
Aaron Giles
919913f118 Collapsed device_config and device_t into one class. Updated all
existing modern devices and the legacy wrappers to work in this
environment. This in general greatly simplifies writing a modern
device. [Aaron Giles]

General notes:
 * some more cleanup probably needs to happen behind this change,
   but I needed to get it in before the next device modernization 
   or import from MESS  :)

 * new template function device_creator which automatically defines
   the static function that creates the device; use this instead of
   creating a static_alloc_device_config function

 * added device_stop() method which is called at around the time
   the previous device_t's destructor was called; if you auto_free
   anything, do it here because the machine is gone when the 
   destructor is called

 * changed the static_set_* calls to pass a device_t & instead of
   a device_config *

 * for many devices, the static config structure member names over-
   lapped the device's names for devcb_* functions; in these cases
   the members in the interface were renamed to have a _cb suffix

 * changed the driver_enumerator to only cache 100 machine_configs
   because caching them all took a ton of memory; fortunately this
   implementation detail is completely hidden behind the 
   driver_enumerator interface

 * got rid of the macros for creating derived classes; doing it
   manually is now clean enough that it isn't worth hiding the
   details in a macro
2011-04-27 05:11:18 +00:00
Aaron Giles
fecfc465df Switch from m_machine to machine() everywhere. In some cases this
meant adding a machine() accessor but it's worth it for consistency.
This will allow future changes from reference to pointer to happen
transparently for devices. [Aaron Giles]

Simple S&R:
m_machine( *[^ (!=;])
machine()\1
2011-04-18 20:06:43 +00:00
Aaron Giles
2ad5072023 BIG update.
Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:

  space->machine->xxx   ==>  space->machine().xxx
  device->machine->yyy  ==>  device->machine().yyy

Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.

Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.

98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:

// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.

// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.

// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1

// replace machine-> with machine.
S: machine->
R: machine\.

// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1

// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
2011-03-29 15:50:04 +00:00
Curt Coder
ceeafcbcb9 Fixed Z80-DART transmit word length. [Curt Coder] 2011-03-14 13:27:59 +00:00
Miodrag Milanovic
fd5b5140a5 Removed short name as parameter from device_config this way it is not mandatory any more.
Most of files is rolled back to previous state. (no whatsnew)
2011-02-11 10:10:39 +00:00
Miodrag Milanovic
601056b130 - Added shortname to devices in order to make ROM loading per device possible. [Miodrag Milanovic]
- Updated all devices containing ROM regions to have short names and all modern devices too
- Created new validation to check existence of short name if device contain ROM region defined
2011-02-10 19:08:37 +00:00
Aaron Giles
a38c67f27b Get rid of state_save_register_device_* macros in favor of direct
calls on the device object.

Regex used:

state_save_register_device_item( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\6\),\5\4\7\)

state_save_register_device_item_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\6\),\5\4\7\)

state_save_register_device_item_2d_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\6\),\5\4\7\)

state_save_register_device_item_bitmap( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\)
\3->save_item\1\(\2NAME\(\*\6\),\5\4\7\)

state_save_register_device_item_pointer( *)\(( *)([^,]+), *([^,]+),( *)([^,]+), *([^ )]+)( *)\)
\3->save_pointer\1\(\2NAME\(\6\),\5\7,\5\4\8\)

this->save_
save_

(save_item[^;]+), *0( *)\);
\1\2\);

(save_pointer[^;]+), *0( *)\);
\1\2\);
2011-02-09 05:51:04 +00:00
Aaron Giles
feb6e77be3 As promised, the bulk update of timer calls:
timer_adjust_oneshot(t,...)  => t->adjust(...)
timer_adjust_periodic(t,...) => t->adjust(...)
timer_reset(t,...)           => t->reset(...)
timer_enable(t,...)          => t->enable(...)
timer_enabled(t)             => t->enabled()
timer_get_param(t)           => t->param()
timer_get_ptr(t)             => t->ptr()
timer_set_param(t,...)       => t->set_param(...)
timer_set_ptr(t)             => t->set_ptr(...)
timer_timeelapsed(t)         => t->elapsed()
timer_timeleft(t)            => t->remaining()
timer_starttime(t)           => t->start()
timer_firetime(t)            => t->expire()

Also remove some stray legacy cpuexec* macros that were 
lurking in schedule.h):

cpuexec_describe_context(m)     => m->describe_context()
cpuexec_boost_interleave(m,...) => m->scheduler().boot_interleave(...)
cpuexec_trigger(m,...)          => m->scheduler().trigger(...)
cpuexec_triggertime(m,...)      => m->scheduler().trigger(...)

Specific regex'es used:

timer_adjust_oneshot( *)\(( *)([^,;]+), *
\3->adjust\1\(\2

timer_adjust_periodic( *)\(( *)([^,;]+), *
\3->adjust\1\(\2

(->adjust.*), *0( *)\)
\1\2\)

timer_reset( *)\(( *)([^,;]+), *
\3->reset\1\(\2

(->reset *\(.*)attotime::never
\1

timer_enable( *)\(( *)([^,;]+), *
\3->enable\1\(\2

timer_enabled( *)\(( *)([^,;)]+)\)
\3->enabled\1\(\2\)

timer_get_param( *)\(( *)([^,;)]+)\)
\3->param\1\(\2\)

timer_get_ptr( *)\(( *)([^,;)]+)\)
\3->ptr\1\(\2\)

timer_timeelapsed( *)\(( *)([^,;)]+)\)
\3->elapsed\1\(\2\)

timer_timeleft( *)\(( *)([^,;)]+)\)
\3->remaining\1\(\2\)

timer_starttime( *)\(( *)([^,;)]+)\)
\3->start\1\(\2\)

timer_firetime( *)\(( *)([^,;)]+)\)
\3->expire\1\(\2\)

timer_set_param( *)\(( *)([^,;]+), *
\3->set_param\1\(\2

timer_set_ptr( *)\(( *)([^,;]+), *
\3->set_ptr\1\(\2

cpuexec_describe_context( *)\(( *)([^,;)]+)\)
\3->describe_context\1\(\2\)

\&m_machine->describe_context
m_machine.describe_context

cpuexec_boost_interleave( *)\(( *)([^,;]+), *
\3->scheduler().boost_interleave\1\(\2

cpuexec_trigger( *)\(( *)([^,;]+), *
\3->scheduler().trigger\1\(\2

cpuexec_triggertime( *)\(( *)([^,;]+), *
\3->scheduler().trigger\1\(\2
2011-02-06 21:23:00 +00:00
Aaron Giles
0e627f1a54 Convert emu_timers to objects. Move implementation and management of
timers into the scheduler. Retain TIMER devices as a separate wrapper
in timer.c/.h. Inline wrappers are currently provided for all timer
operations; a future update will bulk clean these up.

Rather than using macros which hide generation of a string-ified name
for callback functions, the new methods require passing both a function
pointer plus a name string. A new macro FUNC() can be used to output
both, and another macro MFUNC() can be used to output a stub-wrapped
class member as a callback.

Also added a time() method on the machine, so that machine->time() gives
the current emulated time. A wrapper for timer_get_time is currently
provided but will be bulk replaced in the future.

For this update, convert all classic timer_alloc, timer_set, 
timer_pulse, and timer_call_after_resynch calls into method calls on 
the scheduler. 

For new device timers, added methods to the device_t class that make 
creating and managing these much simpler. Modern devices were updated
to use these.

Here are the regexes used; some manual cleanup (compiler-caught) will
be needed since regex doesn't handle nested parentheses cleanly

1. Convert timer_call_after_resynch calls
timer_call_after_resynch( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().synchronize\1\(\2FUNC(\6), \5, \4\)

2. Clean up trailing 0, NULL parameters
(synchronize[^;]+), 0, NULL\)
\1)

3. Clean up trailing NULL parameters
(synchronize[^;]+), NULL\)
\1)

4. Clean up completely empty parameter lists
synchronize\(FUNC\(NULL\)\)
synchronize()

5. Convert timer_set calls
timer_set( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_set\1\(\2\4, FUNC(\7), \6, \5\)

6. Clean up trailing 0, NULL parameters
(timer_set[^;]+), 0, NULL\)
\1)

7. Clean up trailing NULL parameters
(timer_set[^;]+), NULL\)
\1)

8. Convert timer_set calls
timer_pulse( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_pulse\1\(\2\4, FUNC(\7), \6, \5\)

9. Clean up trailing 0, NULL parameters
(timer_pulse[^;]+), 0, NULL\)
\1)

10. Clean up trailing NULL parameters
(timer_pulse[^;]+), NULL\)
\1)

11. Convert timer_alloc calls
timer_alloc( *)\(( *)([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_alloc\1\(\2FUNC(\4), \5\)

12. Clean up trailing NULL parameters
(timer_alloc[^;]+), NULL\)
\1)

13. Clean up trailing 0 parameters
(timer_alloc[^;]+), 0\)
\1)

14. Fix oddities introduced
\&m_machine->scheduler()
m_machine.scheduler()
2011-02-06 07:15:01 +00:00
Aaron Giles
f534d245c0 Attotime bulk conversion step:
attotime_zero                 => attotime::zero
attotime_never                => attotime::never
ATTOTIME_IN_SEC(s)            => attotime::from_seconds(s)
ATTOTIME_IN_MSEC(m)           => attotime::from_msec(m)
ATTOTIME_IN_USEC(u)           => attotime::from_usec(u)
ATTOTIME_IN_NSEC(n)           => attotime::from_nsec(n)
ATTOTIME_IN_HZ(h)             => attotime::from_hz(h)

Also, changed the following MCFG macros to require a full
attotime specification:

MCFG_TIMER_ADD_PERIODIC
MCFG_QUANTUM_TIME
MCFG_WATCHDOG_TIME_INIT
2011-02-03 09:06:34 +00:00
Wilbert Pol
c8d7056b48 z80dart.c:
- The channel B modified interrupt vector can be read immediately after setting it.
- Reading from a read register other than 0 also masks out the register index.  [Wilbert Pol]
2010-12-26 08:19:09 +00:00
Curt Coder
638d008bc6 Z80DART changes: [Curt Coder]
- fixed asynchronous transmit mode
- fixed channel A interrupt vector
- improved logging
2010-12-21 20:56:55 +00:00
Aaron Giles
499a0d4161 Move device definitions out of the bottom of the file. They can be
declared with other variables at the top.
2010-09-19 20:57:20 +00:00
Aaron Giles
0e672ba6eb Cleanups and version bump. 2010-08-30 15:20:58 +00:00
Curt Coder
dff1e360a9 Z80DART changes: [Curt Coder]
- added SIO specific constants
- added sync character write registers
2010-08-22 15:29:52 +00:00
Curt Coder
6791eb9adb Expanded the Z80-DART interface to allow future implementation of Z80-SIO features: [Curt Coder]
- added separate clock inputs for channel B
- added SYNC inputs/outputs for both channels
2010-08-21 00:03:37 +00:00
Curt Coder
b5fabb049d Clear Z80 DART interrupts at constructor time. [Curt Coder] 2010-08-20 16:15:41 +00:00
Aaron Giles
30662dcdef Cleanups and version bump. 2010-07-06 17:30:28 +00:00
Miodrag Milanovic
63e8e8fe98 Modified way device_type constants are defined in order to get unidasm compile [Miodrag Milanovic] 2010-06-29 09:02:17 +00:00