diff options
Diffstat (limited to 'src/emu/machine')
| -rw-r--r-- | src/emu/machine/40105.c | 4 | ||||
| -rw-r--r-- | src/emu/machine/40105.h | 2 | ||||
| -rw-r--r-- | src/emu/machine/74148.c | 5 | ||||
| -rw-r--r-- | src/emu/machine/74153.c | 8 | ||||
| -rw-r--r-- | src/emu/machine/74153.h | 4 | ||||
| -rw-r--r-- | src/emu/machine/74181.h | 3 | ||||
| -rw-r--r-- | src/emu/machine/aicartc.c | 6 | ||||
| -rw-r--r-- | src/emu/machine/aicartc.h | 2 | ||||
| -rw-r--r-- | src/emu/machine/atahle.c | 2 | ||||
| -rw-r--r-- | src/emu/machine/ataintf.c | 2 | ||||
| -rw-r--r-- | src/emu/machine/eeprom.c | 18 | ||||
| -rw-r--r-- | src/emu/machine/eeprom.h | 24 | ||||
| -rw-r--r-- | src/emu/machine/eeprompar.c | 57 | ||||
| -rw-r--r-- | src/emu/machine/eeprompar.h | 3 | ||||
| -rw-r--r-- | src/emu/machine/eepromser.c | 283 | ||||
| -rw-r--r-- | src/emu/machine/eepromser.h | 64 | ||||
| -rw-r--r-- | src/emu/machine/generic.c | 1 | ||||
| -rw-r--r-- | src/emu/machine/mb87078.h | 4 | ||||
| -rw-r--r-- | src/emu/machine/s2636.c | 6 | ||||
| -rw-r--r-- | src/emu/machine/s2636.h | 8 | ||||
| -rw-r--r-- | src/emu/machine/smc91c9x.h | 6 | ||||
| -rw-r--r-- | src/emu/machine/wd_fdc.c | 2 |
22 files changed, 253 insertions, 261 deletions
diff --git a/src/emu/machine/40105.c b/src/emu/machine/40105.c index 9ef59e37c5e..3333053a57f 100644 --- a/src/emu/machine/40105.c +++ b/src/emu/machine/40105.c @@ -37,8 +37,8 @@ const device_type CMOS_40105 = &device_creator<cmos_40105_device>; cmos_40105_device::cmos_40105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, CMOS_40105, "40105", tag, owner, clock, "40105", __FILE__), - m_write_dir(*this), - m_write_dor(*this) + m_write_dir(*this), + m_write_dor(*this) { } diff --git a/src/emu/machine/40105.h b/src/emu/machine/40105.h index 0291d75b0b6..7786acee153 100644 --- a/src/emu/machine/40105.h +++ b/src/emu/machine/40105.h @@ -48,7 +48,7 @@ public: DECLARE_WRITE_LINE_MEMBER( si_w ); DECLARE_WRITE_LINE_MEMBER( so_w ); - + DECLARE_READ_LINE_MEMBER( dir_r ); DECLARE_READ_LINE_MEMBER( dor_r ); diff --git a/src/emu/machine/74148.c b/src/emu/machine/74148.c index 50c957b6321..ba9743ca0b2 100644 --- a/src/emu/machine/74148.c +++ b/src/emu/machine/74148.c @@ -70,12 +70,12 @@ void ttl74148_device::device_config_complete() const ttl74148_config *intf = reinterpret_cast<const ttl74148_config *>(static_config()); if (intf != NULL) *static_cast<ttl74148_config *>(this) = *intf; - + // or initialize to defaults if none provided else { } - + } //------------------------------------------------- @@ -100,7 +100,6 @@ void ttl74148_device::device_start() void ttl74148_device::device_reset() { - m_enable_input = 1; m_input_lines[0] = 1; m_input_lines[1] = 1; diff --git a/src/emu/machine/74153.c b/src/emu/machine/74153.c index a5e5de8ec56..9d21cfc6387 100644 --- a/src/emu/machine/74153.c +++ b/src/emu/machine/74153.c @@ -52,13 +52,13 @@ ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, m_input_lines[1][1] = 0; m_input_lines[1][2] = 0; m_input_lines[1][3] = 0; - + for (int i = 0; i < 2; i++) m_enable[i] = 0; - + for (int i = 0; i < 2; i++) m_output[i] = 0; - + for (int i = 0; i < 2; i++) m_last_output[i] = 0; } @@ -75,7 +75,7 @@ void ttl74153_device::device_config_complete() const ttl74153_config *intf = reinterpret_cast<const ttl74153_config *>(static_config()); if (intf != NULL) *static_cast<ttl74153_config *>(this) = *intf; - + // or initialize to defaults if none provided else { diff --git a/src/emu/machine/74153.h b/src/emu/machine/74153.h index 2973fee12c8..a23b4941df3 100644 --- a/src/emu/machine/74153.h +++ b/src/emu/machine/74153.h @@ -59,13 +59,13 @@ public: void input_line_w(int section, int input_line, int data); void enable_w(int section, int data); int output_r(int section); - + protected: // device-level overrides virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - + private: // internal state diff --git a/src/emu/machine/74181.h b/src/emu/machine/74181.h index 4eed4bc697c..b7e8a0efd6e 100644 --- a/src/emu/machine/74181.h +++ b/src/emu/machine/74181.h @@ -19,8 +19,7 @@ //************************************************************************** #define MCFG_TTL74181_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TTL74181, 0) \ - + MCFG_DEVICE_ADD(_tag, TTL74181, 0) //************************************************************************** // TYPE DEFINITIONS diff --git a/src/emu/machine/aicartc.c b/src/emu/machine/aicartc.c index ace57a368e8..5bd3323dff9 100644 --- a/src/emu/machine/aicartc.c +++ b/src/emu/machine/aicartc.c @@ -1,9 +1,9 @@ /*************************************************************************** - AICA-RTC sub-device + AICA-RTC sub-device - TODO: - - move this inside AICA sound core once that'll get modernized + TODO: + - move this inside AICA sound core once that'll get modernized ***************************************************************************/ diff --git a/src/emu/machine/aicartc.h b/src/emu/machine/aicartc.h index 7f72c0eb4b9..592cf9f4e09 100644 --- a/src/emu/machine/aicartc.h +++ b/src/emu/machine/aicartc.h @@ -25,7 +25,7 @@ Template for skeleton device // ======================> aicartc_device class aicartc_device : public device_t, - public device_rtc_interface + public device_rtc_interface { public: // construction/destruction diff --git a/src/emu/machine/atahle.c b/src/emu/machine/atahle.c index d94eb4fe4ea..6632b3753ee 100644 --- a/src/emu/machine/atahle.c +++ b/src/emu/machine/atahle.c @@ -239,7 +239,7 @@ bool ata_hle_device::set_dma_mode(int word) m_identify_buffer[word] |= 0x100 << (m_sector_count & 7); return true; } - + return false; } diff --git a/src/emu/machine/ataintf.c b/src/emu/machine/ataintf.c index 6082cf4d1ab..3c19c50e491 100644 --- a/src/emu/machine/ataintf.c +++ b/src/emu/machine/ataintf.c @@ -141,7 +141,7 @@ READ16_MEMBER( ata_interface_device::read_cs0 ) if (m_slot[i]->dev() != NULL) result &= m_slot[i]->dev()->read_cs0(space, offset, mem_mask); -// { static int last_status = -1; if (offset == 7 ) { if( result == last_status ) return last_status; last_status = result; } else last_status = -1; } +// { static int last_status = -1; if (offset == 7 ) { if( result == last_status ) return last_status; last_status = result; } else last_status = -1; } // printf( "read cs0 %04x %04x %04x\n", offset, result, mem_mask ); diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c index a12a8da293e..70cd543483a 100644 --- a/src/emu/machine/eeprom.c +++ b/src/emu/machine/eeprom.c @@ -87,10 +87,10 @@ eeprom_base_device::eeprom_base_device(const machine_config &mconfig, device_typ m_completion_time(attotime::zero) { // a 2ms write time is too long for rfjetsa - m_operation_time[WRITE_TIME] = attotime::from_usec(1750); - m_operation_time[WRITE_ALL_TIME] = attotime::from_usec(8000); - m_operation_time[ERASE_TIME] = attotime::from_usec(1000); - m_operation_time[ERASE_ALL_TIME] = attotime::from_usec(8000); + m_operation_time[WRITE_TIME] = attotime::from_usec(1750); + m_operation_time[WRITE_ALL_TIME] = attotime::from_usec(8000); + m_operation_time[ERASE_TIME] = attotime::from_usec(1000); + m_operation_time[ERASE_ALL_TIME] = attotime::from_usec(8000); } @@ -195,8 +195,8 @@ void eeprom_base_device::write(offs_t address, UINT32 data) //------------------------------------------------- // write_all - write data at all addresses -// (assumes an erase has previously been -// performed) +// (assumes an erase has previously been +// performed) //------------------------------------------------- void eeprom_base_device::write_all(UINT32 data) @@ -308,7 +308,7 @@ void eeprom_base_device::nvram_default() if (m_default_data.u8 != NULL) { mame_printf_verbose("Warning: Driver-specific EEPROM defaults are going away soon.\n"); - for (offs_t offs = 0; offs < m_default_data_size; offs++) + for (offs_t offs = 0; offs < m_default_data_size; offs++) { if (m_data_bits == 8) m_addrspace[0]->write_byte(offs, m_default_data.u8[offs]); @@ -385,8 +385,8 @@ UINT32 eeprom_base_device::internal_read(offs_t address) //------------------------------------------------- -// internal_write - write data at the given -// address +// internal_write - write data at the given +// address //------------------------------------------------- void eeprom_base_device::internal_write(offs_t address, UINT32 data) diff --git a/src/emu/machine/eeprom.h b/src/emu/machine/eeprom.h index e90228d7a55..fd851283e72 100644 --- a/src/emu/machine/eeprom.h +++ b/src/emu/machine/eeprom.h @@ -72,7 +72,7 @@ // ======================> eeprom_base_device -class eeprom_base_device : public device_t, +class eeprom_base_device : public device_t, public device_memory_interface, public device_nvram_interface { @@ -84,10 +84,10 @@ public: // timing constants enum timing_type { - WRITE_TIME, // default = 2ms - WRITE_ALL_TIME, // default = 8ms - ERASE_TIME, // default = 1ms - ERASE_ALL_TIME, // default = 8ms + WRITE_TIME, // default = 2ms + WRITE_ALL_TIME, // default = 8ms + ERASE_TIME, // default = 1ms + ERASE_ALL_TIME, // default = 8ms TIMING_COUNT }; @@ -104,10 +104,10 @@ public: void write_all(UINT32 data); void erase(offs_t address); void erase_all(); - + // status bool ready() const { return machine().time() >= m_completion_time; } - + protected: // device-level overrides virtual void device_validity_check(validity_checker &valid) const; @@ -127,18 +127,18 @@ protected: void internal_write(offs_t address, UINT32 data); // configuration state - UINT32 m_cells; - UINT8 m_address_bits; - UINT8 m_data_bits; + UINT32 m_cells; + UINT8 m_address_bits; + UINT8 m_data_bits; address_space_config m_space_config; generic_ptr m_default_data; UINT32 m_default_data_size; UINT32 m_default_value; bool m_default_value_set; - attotime m_operation_time[TIMING_COUNT]; + attotime m_operation_time[TIMING_COUNT]; // live state - attotime m_completion_time; + attotime m_completion_time; }; diff --git a/src/emu/machine/eeprompar.c b/src/emu/machine/eeprompar.c index b4417613c6d..0d730224df3 100644 --- a/src/emu/machine/eeprompar.c +++ b/src/emu/machine/eeprompar.c @@ -37,33 +37,33 @@ **************************************************************************** - Parallel EEPROMs are generally simpler than serial EEPROMs, though - they require more pins to provide the full set of address and data - lines necessary. They also require more pins the larger the EEPROM - is, whereas serial EEPROMs all share the same pinout regardless of - size. - - At a basic level, there are 5 sets of signals involved: - - * /CE = chip enable - * /OE = output enable - * /WE = write enable - * D0-Dn = data lines - * A0-An = address lines - - To access the chip, the various enable states must be asserted or - cleared. Note that these are generally active-low, so asserted means - pulled to GND, and cleared means pulled to Vcc: - - /CE /OE /WE Action - ASSERT ASSERT CLEAR Read (D0-Dn contain output data) - ASSERT CLEAR ASSERT Write/Erase (D0-Dn are input data) - - Erase is performed by doing a write with D0-Dn all set to 1. - - In general, it is slow to write or erase (9ms is quoted in the 2816A - datasheet, for example), and the /WE must be held low for the entire - write/erase duration in order to guarantee the data is written. + Parallel EEPROMs are generally simpler than serial EEPROMs, though + they require more pins to provide the full set of address and data + lines necessary. They also require more pins the larger the EEPROM + is, whereas serial EEPROMs all share the same pinout regardless of + size. + + At a basic level, there are 5 sets of signals involved: + + * /CE = chip enable + * /OE = output enable + * /WE = write enable + * D0-Dn = data lines + * A0-An = address lines + + To access the chip, the various enable states must be asserted or + cleared. Note that these are generally active-low, so asserted means + pulled to GND, and cleared means pulled to Vcc: + + /CE /OE /WE Action + ASSERT ASSERT CLEAR Read (D0-Dn contain output data) + ASSERT CLEAR ASSERT Write/Erase (D0-Dn are input data) + + Erase is performed by doing a write with D0-Dn all set to 1. + + In general, it is slow to write or erase (9ms is quoted in the 2816A + datasheet, for example), and the /WE must be held low for the entire + write/erase duration in order to guarantee the data is written. ***************************************************************************/ @@ -150,8 +150,7 @@ eeprom_parallel_##_lowercase##_device::eeprom_parallel_##_lowercase##_device(con { \ static_set_size(*this, _cells, _bits); \ }; \ -const device_type EEPROM_PARALLEL_##_uppercase = &device_creator<eeprom_parallel_##_lowercase##_device>; \ - +const device_type EEPROM_PARALLEL_##_uppercase = &device_creator<eeprom_parallel_##_lowercase##_device>; // standard 28XX class of 8-bit EEPROMs DEFINE_PARALLEL_EEPROM_DEVICE(28xx, 2804, 2804, 8, 512) DEFINE_PARALLEL_EEPROM_DEVICE(28xx, 2816, 2816, 8, 2048) diff --git a/src/emu/machine/eeprompar.h b/src/emu/machine/eeprompar.h index 83baf7c743a..aab0a6d8b4f 100644 --- a/src/emu/machine/eeprompar.h +++ b/src/emu/machine/eeprompar.h @@ -120,8 +120,7 @@ class eeprom_parallel_##_lowercase##_device : public eeprom_parallel_##_baseclas public: \ eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); \ }; \ -extern const device_type EEPROM_PARALLEL_##_uppercase; \ - +extern const device_type EEPROM_PARALLEL_##_uppercase; // standard 28XX class of 8-bit EEPROMs DECLARE_PARALLEL_EEPROM_DEVICE(28xx, 2804, 2804) DECLARE_PARALLEL_EEPROM_DEVICE(28xx, 2816, 2816) diff --git a/src/emu/machine/eepromser.c b/src/emu/machine/eepromser.c index a1180e49f4d..461e059273b 100644 --- a/src/emu/machine/eepromser.c +++ b/src/emu/machine/eepromser.c @@ -37,95 +37,95 @@ **************************************************************************** - Serial EEPROMs generally work the same across manufacturers and models, - varying largely by the size of the EEPROM and the packaging details. - - At a basic level, there are 5 signals involved: - - * CS = chip select - * CLK = serial data clock - * DI = serial data in - * DO = serial data out - * RDY/BUSY = ready (1) or busy (0) status - - Data is read or written via serial commands. A command is begun on a - low-to-high transition of the CS line, following by clocking a start - bit (1) on the DI line. After the start bit, subsequent clocks - assemble one of the following commands: - - Start Opcode Address Data - 1 01 aaaaaaaaa ddddddd WRITE data - 1 10 aaaaaaaaa READ data - 1 11 aaaaaaaaa ERASE data - 1 00 00xxxxxxx WREN = WRite ENable - 1 00 01xxxxxxx ddddddd WRAL = WRite ALl cells - 1 00 10xxxxxxx ERAL = ERase ALl cells - 1 00 11xxxxxxx WRDS = WRite DiSable - - The number of address bits (a) clocked varies based on the size of the - chip, though it does not always map 1:1 with the size of the chip. - For example, the 93C06 has 16 cells, which only needs 4 address bits; - but commands to the 93C06 require 6 address bits (the top two must - be 0). - - The number of data bits (d) clocked varies based on the chip and at - times on the state of a pin on the chip which selects between multiple - sizes (e.g., 8-bit versus 16-bit). - + Serial EEPROMs generally work the same across manufacturers and models, + varying largely by the size of the EEPROM and the packaging details. + + At a basic level, there are 5 signals involved: + + * CS = chip select + * CLK = serial data clock + * DI = serial data in + * DO = serial data out + * RDY/BUSY = ready (1) or busy (0) status + + Data is read or written via serial commands. A command is begun on a + low-to-high transition of the CS line, following by clocking a start + bit (1) on the DI line. After the start bit, subsequent clocks + assemble one of the following commands: + + Start Opcode Address Data + 1 01 aaaaaaaaa ddddddd WRITE data + 1 10 aaaaaaaaa READ data + 1 11 aaaaaaaaa ERASE data + 1 00 00xxxxxxx WREN = WRite ENable + 1 00 01xxxxxxx ddddddd WRAL = WRite ALl cells + 1 00 10xxxxxxx ERAL = ERase ALl cells + 1 00 11xxxxxxx WRDS = WRite DiSable + + The number of address bits (a) clocked varies based on the size of the + chip, though it does not always map 1:1 with the size of the chip. + For example, the 93C06 has 16 cells, which only needs 4 address bits; + but commands to the 93C06 require 6 address bits (the top two must + be 0). + + The number of data bits (d) clocked varies based on the chip and at + times on the state of a pin on the chip which selects between multiple + sizes (e.g., 8-bit versus 16-bit). + **************************************************************************** - Most EEPROMs are based on the 93Cxx design (and have similar part - designations): - - +--v--+ - CS |1 8| Vcc - CLK |2 7| NC - DI |3 6| NC - DO |4 5| GND - +-----+ - - Note the lack of a READY/BUSY pin. On the 93Cxx series, the DO pin - serves double-duty, returning READY/BUSY during a write/erase cycle, - and outputting data during a read cycle. - - Some manufacturers have released "enhanced" versions with additional - features: - - * Several manufacturers (ST) map pin 6 to "ORG", specifying the - logical organization of the data. Connecting ORG to ground - makes the EEPROM work as an 8-bit device, while connecting it - to Vcc makes it work as a 16-bit device with one less - address bit. - - * Other manufacturers (ST) have enhanced the read operations to - allow serially streaming more than one cell. Essentially, after - reading the first cell, keep CS high and keep clocking, and - data from following cells will be read as well. - - The ER5911 is only slightly different: - - +--v--+ - CS |1 8| Vcc - CLK |2 7| RDY/BUSY - DI |3 6| ORG - DO |4 5| GND - +-----+ - - Here we have an explicit RDY/BUSY signal, and the ORG flag as described - above. - - From a command perspective, the ER5911 is also slightly different: - - 93Cxx has ERASE command; this maps to WRITE on ER5911 - 93Cxx has WRITEALL command; no equivalent on ER5911 + Most EEPROMs are based on the 93Cxx design (and have similar part + designations): + + +--v--+ + CS |1 8| Vcc + CLK |2 7| NC + DI |3 6| NC + DO |4 5| GND + +-----+ + + Note the lack of a READY/BUSY pin. On the 93Cxx series, the DO pin + serves double-duty, returning READY/BUSY during a write/erase cycle, + and outputting data during a read cycle. + + Some manufacturers have released "enhanced" versions with additional + features: + + * Several manufacturers (ST) map pin 6 to "ORG", specifying the + logical organization of the data. Connecting ORG to ground + makes the EEPROM work as an 8-bit device, while connecting it + to Vcc makes it work as a 16-bit device with one less + address bit. + + * Other manufacturers (ST) have enhanced the read operations to + allow serially streaming more than one cell. Essentially, after + reading the first cell, keep CS high and keep clocking, and + data from following cells will be read as well. + + The ER5911 is only slightly different: + + +--v--+ + CS |1 8| Vcc + CLK |2 7| RDY/BUSY + DI |3 6| ORG + DO |4 5| GND + +-----+ + + Here we have an explicit RDY/BUSY signal, and the ORG flag as described + above. + + From a command perspective, the ER5911 is also slightly different: + + 93Cxx has ERASE command; this maps to WRITE on ER5911 + 93Cxx has WRITEALL command; no equivalent on ER5911 **************************************************************************** - Issues with: - - kickgoal.c - code seems wrong, clock logic writes 0-0-0 instead of 0-1-0 as expected - overdriv.c - drops CS, raises CS, keeps DI=1, triggering extraneous start bit - + Issues with: + + kickgoal.c - code seems wrong, clock logic writes 0-0-0 instead of 0-1-0 as expected + overdriv.c - drops CS, raises CS, keeps DI=1, triggering extraneous start bit + ***************************************************************************/ #include "emu.h" @@ -138,11 +138,11 @@ //************************************************************************** // logging levels: -// 0 = errors and warnings only -// 1 = commands -// 2 = state machine -// 3 = DI/DO/READY reads & writes -// 4 = all reads & writes +// 0 = errors and warnings only +// 1 = commands +// 2 = state machine +// 3 = DI/DO/READY reads & writes +// 4 = all reads & writes #define VERBOSE_PRINTF 0 #define VERBOSE_LOGERROR 0 @@ -195,7 +195,7 @@ eeprom_serial_base_device::eeprom_serial_base_device(const machine_config &mconf //------------------------------------------------- // static_set_address_bits - configuration helper // to set the number of address bits in the -// serial commands +// serial commands //------------------------------------------------- void eeprom_serial_base_device::static_set_address_bits(device_t &device, int addrbits) @@ -227,7 +227,7 @@ void eeprom_serial_base_device::device_start() // start the base class eeprom_base_device::device_start(); - + // save the current state save_item(NAME(m_state)); save_item(NAME(m_cs_state)); @@ -269,8 +269,8 @@ void eeprom_serial_base_device::device_reset() //************************************************************************** //------------------------------------------------- -// base_cs_write - set the state of the chip -// select (CS) line +// base_cs_write - set the state of the chip +// select (CS) line //------------------------------------------------- void eeprom_serial_base_device::base_cs_write(int state) @@ -280,10 +280,10 @@ void eeprom_serial_base_device::base_cs_write(int state) if (state == m_cs_state) return; - // set the new state + // set the new state LOG4((" cs_write(%d)\n", state)); m_cs_state = state; - + // remember the rising edge time so we don't process CLK signals at the same time if (state == ASSERT_LINE) m_last_cs_rising_edge_time = machine().time(); @@ -292,7 +292,7 @@ void eeprom_serial_base_device::base_cs_write(int state) //------------------------------------------------- -// base_clk_write - set the state of the clock +// base_clk_write - set the state of the clock // (CLK) line //------------------------------------------------- @@ -303,7 +303,7 @@ void eeprom_serial_base_device::base_clk_write(int state) if (state == m_clk_state) return; - // set the new state + // set the new state LOG4((" clk_write(%d)\n", state)); m_clk_state = state; handle_event((m_clk_state == ASSERT_LINE) ? EVENT_CLK_RISING_EDGE : EVENT_CLK_FALLING_EDGE); @@ -311,8 +311,8 @@ void eeprom_serial_base_device::base_clk_write(int state) //------------------------------------------------- -// base_di_write - set the state of the data input -// (DI) line +// base_di_write - set the state of the data input +// (DI) line //------------------------------------------------- void eeprom_serial_base_device::base_di_write(int state) @@ -325,7 +325,7 @@ void eeprom_serial_base_device::base_di_write(int state) //------------------------------------------------- -// base_do_read - read the state of the data +// base_do_read - read the state of the data // output (DO) line //------------------------------------------------- @@ -341,7 +341,7 @@ int eeprom_serial_base_device::base_do_read() //------------------------------------------------- -// base_ready_read - read the state of the +// base_ready_read - read the state of the // READY/BUSY line //------------------------------------------------- @@ -390,7 +390,7 @@ void eeprom_serial_base_device::set_state(eeprom_state newstate) //------------------------------------------------- // handle_event - handle an event via the state -// machine +// machine //------------------------------------------------- void eeprom_serial_base_device::handle_event(eeprom_event event) @@ -421,7 +421,7 @@ void eeprom_serial_base_device::handle_event(eeprom_event event) if (event == EVENT_CS_RISING_EDGE) set_state(STATE_WAIT_FOR_START_BIT); break; - + // CS is asserted; wait for rising clock with a 1 start bit; falling CS will reset us // note that because each bit is written independently, it is possible for us to receive // a false rising CLK edge at the exact same time as a rising CS edge; it appears we @@ -435,7 +435,7 @@ void eeprom_serial_base_device::handle_event(eeprom_event event) else if (event == EVENT_CS_FALLING_EDGE) set_state(STATE_IN_RESET); break; - + // CS is asserted; wait for a command to come through; falling CS will reset us case STATE_WAIT_FOR_COMMAND: if (event == EVENT_CLK_RISING_EDGE) @@ -448,13 +448,13 @@ void eeprom_serial_base_device::handle_event(eeprom_event event) else if (event == EVENT_CS_FALLING_EDGE) set_state(STATE_IN_RESET); break; - + // CS is asserted; reading data, clock the shift register; falling CS will reset us case STATE_READING_DATA: if (event == EVENT_CLK_RISING_EDGE) { int bit_index = m_bits_accum++; - + // wrapping the address on multi-read is required by pacslot(cave.c) if (bit_index % m_data_bits == 0 && (bit_index == 0 || m_streaming_enabled)) m_shift_register = read((m_address + m_bits_accum / m_data_bits) & ((1 << m_address_bits) - 1)) << (32 - m_data_bits); @@ -474,7 +474,7 @@ void eeprom_serial_base_device::handle_event(eeprom_event event) LOG0(("EEPROM: CS deasserted in READING_DATA after %d bits\n", m_bits_accum)); } break; - + // CS is asserted; waiting for data; clock data through until we accumulate enough; falling CS will reset us case STATE_WAIT_FOR_DATA: if (event == EVENT_CLK_RISING_EDGE) @@ -489,7 +489,7 @@ void eeprom_serial_base_device::handle_event(eeprom_event event) LOG0(("EEPROM: CS deasserted in STATE_WAIT_FOR_DATA after %d bits\n", m_bits_accum)); } break; - + // CS is asserted; waiting for completion; watch for CS falling case STATE_WAIT_FOR_COMPLETION: if (event == EVENT_CS_FALLING_EDGE) @@ -501,7 +501,7 @@ void eeprom_serial_base_device::handle_event(eeprom_event event) //------------------------------------------------- // execute_command - execute a command once we -// have enough bits for one +// have enough bits for one //------------------------------------------------- void eeprom_serial_base_device::execute_command() @@ -509,7 +509,7 @@ void eeprom_serial_base_device::execute_command() // parse into a generic command and reset the accumulator count parse_command_and_address(); m_bits_accum = 0; - + #if (VERBOSE_PRINTF > 0 || VERBOSE_LOGERROR > 0) // for debugging purposes static const struct { eeprom_command command; const char *string; } s_command_names[] = @@ -540,14 +540,14 @@ void eeprom_serial_base_device::execute_command() m_shift_register = 0; set_state(STATE_READING_DATA); break; - + // reset the shift register and wait for enough data to be clocked through case COMMAND_WRITE: case COMMAND_WRITEALL: m_shift_register = 0; set_state(STATE_WAIT_FOR_DATA); break; - + // erase the parsed address (unless locked) and wait for it to complete case COMMAND_ERASE: if (m_locked) @@ -559,19 +559,19 @@ void eeprom_serial_base_device::execute_command() erase(m_address); set_state(STATE_WAIT_FOR_COMPLETION); break; - + // lock the chip; return to IN_RESET state case COMMAND_LOCK: m_locked = true; set_state(STATE_IN_RESET); break; - + // unlock the chip; return to IN_RESET state case COMMAND_UNLOCK: m_locked = false; set_state(STATE_IN_RESET); break; - + // erase the entire chip (unless locked) and wait for it to complete case COMMAND_ERASEALL: if (m_locked) @@ -583,7 +583,7 @@ void eeprom_serial_base_device::execute_command() erase_all(); set_state(STATE_WAIT_FOR_COMPLETION); break; - + default: throw emu_fatalerror("execute_command called with invalid command %d\n", m_command); } @@ -591,8 +591,8 @@ void eeprom_serial_base_device::execute_command() //------------------------------------------------- -// execute_write_command - execute a write -// command after receiving the data bits +// execute_write_command - execute a write +// command after receiving the data bits //------------------------------------------------- void eeprom_serial_base_device::execute_write_command() @@ -627,7 +627,7 @@ void eeprom_serial_base_device::execute_write_command() break; // write the entire EEPROM with the same data; ERASEALL is required before so we - // AND against the already-present data + // AND against the already-present data case COMMAND_WRITEALL: if (m_locked) { @@ -638,7 +638,7 @@ void eeprom_serial_base_device::execute_write_command() write_all(m_shift_register); set_state(STATE_WAIT_FOR_COMPLETION); break; - + default: throw emu_fatalerror("execute_write_command called with invalid command %d\n", m_command); } @@ -661,8 +661,8 @@ eeprom_serial_93cxx_device::eeprom_serial_93cxx_device(const machine_config &mco //------------------------------------------------- -// parse_command_and_address - extract the -// command and address from a bitstream +// parse_command_and_address - extract the +// command and address from a bitstream //------------------------------------------------- void eeprom_serial_93cxx_device::parse_command_and_address() @@ -670,7 +670,7 @@ void eeprom_serial_93cxx_device::parse_command_and_address() // set the defaults m_command = COMMAND_INVALID; m_address = m_command_address_accum & ((1 << m_command_address_bits) - 1); - + // extract the command portion and handle it switch (m_command_address_accum >> m_command_address_bits) { @@ -678,16 +678,16 @@ void eeprom_serial_93cxx_device::parse_command_and_address() case 0: switch (m_address >> (m_command_address_bits - 2)) { - case 0: m_command = COMMAND_LOCK; break; - case 1: m_command = COMMAND_WRITEALL; break; - case 2: m_command = COMMAND_ERASEALL; break; - case 3: m_command = COMMAND_UNLOCK; break; + case 0: m_command = COMMAND_LOCK; break; + case 1: m_command = COMMAND_WRITEALL; break; + case 2: m_command = COMMAND_ERASEALL; break; + case 3: m_command = COMMAND_UNLOCK; break; } m_address = 0; break; - case 1: m_command = COMMAND_WRITE; break; - case 2: m_command = COMMAND_READ; break; - case 3: m_command = COMMAND_ERASE; break; + case 1: m_command = COMMAND_WRITE; break; + case 2: m_command = COMMAND_READ; break; + case 3: m_command = COMMAND_ERASE; break; } // warn about out-of-range addresses @@ -728,8 +728,8 @@ eeprom_serial_er5911_device::eeprom_serial_er5911_device(const machine_config &m //------------------------------------------------- -// parse_command_and_address - extract the -// command and address from a bitstream +// parse_command_and_address - extract the +// command and address from a bitstream //------------------------------------------------- void eeprom_serial_er5911_device::parse_command_and_address() @@ -737,7 +737,7 @@ void eeprom_serial_er5911_device::parse_command_and_address() // set the defaults m_command = COMMAND_INVALID; m_address = m_command_address_accum & ((1 << m_command_address_bits) - 1); - + // extract the command portion and handle it switch (m_command_address_accum >> m_command_address_bits) { @@ -745,16 +745,16 @@ void eeprom_serial_er5911_device::parse_command_and_address() case 0: switch (m_address >> (m_command_address_bits - 2)) { - case 0: m_command = COMMAND_LOCK; break; - case 1: m_command = COMMAND_INVALID; break; // not on ER5911 - case 2: m_command = COMMAND_ERASEALL; break; - case 3: m_command = COMMAND_UNLOCK; break; + case 0: m_command = COMMAND_LOCK; break; + case 1: m_command = COMMAND_INVALID; break; // not on ER5911 + case 2: m_command = COMMAND_ERASEALL; break; + case 3: m_command = COMMAND_UNLOCK; break; } m_address = 0; break; - case 1: m_command = COMMAND_WRITE; break; - case 2: m_command = COMMAND_READ; break; - case 3: m_command = COMMAND_WRITE; break; // WRITE instead of ERASE on ER5911 + case 1: m_command = COMMAND_WRITE; break; + case 2: m_command = COMMAND_READ; break; + case 3: m_command = COMMAND_WRITE; break; // WRITE instead of ERASE on ER5911 } // warn about out-of-range addresses @@ -793,8 +793,7 @@ eeprom_serial_##_lowercase##_##_bits##bit_device::eeprom_serial_##_lowercase##_# static_set_size(*this, _cells, _bits); \ static_set_address_bits(*this, _addrbits); \ }; \ -const device_type EEPROM_SERIAL_##_uppercase##_##_bits##BIT = &device_creator<eeprom_serial_##_lowercase##_##_bits##bit_device>; \ - +const device_type EEPROM_SERIAL_##_uppercase##_##_bits##BIT = &device_creator<eeprom_serial_##_lowercase##_##_bits##bit_device>; // standard 93CX6 class of 16-bit EEPROMs DEFINE_SERIAL_EEPROM_DEVICE(93cxx, 93c06, 93C06, 16, 16, 6) DEFINE_SERIAL_EEPROM_DEVICE(93cxx, 93c46, 93C46, 16, 64, 6) diff --git a/src/emu/machine/eepromser.h b/src/emu/machine/eepromser.h index 99caeab6b54..8a28d4fbe24 100644 --- a/src/emu/machine/eepromser.h +++ b/src/emu/machine/eepromser.h @@ -87,8 +87,7 @@ // optional enable for streaming reads #define MCFG_EEPROM_SERIAL_ENABLE_STREAMING() \ - eeprom_serial_base_device::static_enable_streaming(*device); \ - + eeprom_serial_base_device::static_enable_streaming(*device); // pass-throughs to the base class for setting default data #define MCFG_EEPROM_SERIAL_DATA MCFG_EEPROM_DATA #define MCFG_EEPROM_SERIAL_DEFAULT_VALUE MCFG_EEPROM_DEFAULT_VALUE @@ -112,14 +111,14 @@ public: // inline configuration helpers static void static_set_address_bits(device_t &device, int addrbits); static void static_enable_streaming(device_t &device); - + protected: // device-level overrides virtual void device_start(); virtual void device_reset(); - + // read interfaces differ between implementations - + // commands enum eeprom_command { @@ -143,7 +142,7 @@ protected: STATE_WAIT_FOR_DATA, STATE_WAIT_FOR_COMPLETION }; - + // events enum eeprom_event { @@ -158,34 +157,34 @@ protected: void handle_event(eeprom_event event); void execute_command(); void execute_write_command(); - + // subclass helpers void base_cs_write(int state); void base_clk_write(int state); void base_di_write(int state); int base_do_read(); int base_ready_read(); - + // subclass overrides virtual void parse_command_and_address() = 0; // configuration state - UINT8 m_command_address_bits; // number of address bits in a command - bool m_streaming_enabled; // true if streaming is enabled + UINT8 m_command_address_bits; // number of address bits in a command + bool m_streaming_enabled; // true if streaming is enabled // runtime state - eeprom_state m_state; // current internal state - UINT8 m_cs_state; // state of the CS line - attotime m_last_cs_rising_edge_time; // time of the last CS rising edge - UINT8 m_oe_state; // state of the OE line - UINT8 m_clk_state; // state of the CLK line - UINT8 m_di_state; // state of the DI line - bool m_locked; // are we locked against writes? - UINT32 m_bits_accum; // number of bits accumulated - UINT32 m_command_address_accum; // accumulator of command+address bits - eeprom_command m_command; // current command - UINT32 m_address; // current address extracted from command - UINT32 m_shift_register; // holds data coming in/going out + eeprom_state m_state; // current internal state + UINT8 m_cs_state; // state of the CS line + attotime m_last_cs_rising_edge_time; // time of the last CS rising edge + UINT8 m_oe_state; // state of the OE line + UINT8 m_clk_state; // state of the CLK line + UINT8 m_di_state; // state of the DI line + bool m_locked; // are we locked against writes? + UINT32 m_bits_accum; // number of bits accumulated + UINT32 m_command_address_accum; // accumulator of command+address bits + eeprom_command m_command; // current command + UINT32 m_address; // current address extracted from command + UINT32 m_shift_register; // holds data coming in/going out }; @@ -200,12 +199,12 @@ protected: public: // read handlers - DECLARE_READ_LINE_MEMBER(do_read); // combined DO+READY/BUSY + DECLARE_READ_LINE_MEMBER(do_read); // combined DO+READY/BUSY // write handlers - DECLARE_WRITE_LINE_MEMBER(cs_write); // CS signal (active high) - DECLARE_WRITE_LINE_MEMBER(clk_write); // CLK signal (active high) - DECLARE_WRITE_LINE_MEMBER(di_write); // DI + DECLARE_WRITE_LINE_MEMBER(cs_write); // CS signal (active high) + DECLARE_WRITE_LINE_MEMBER(clk_write); // CLK signal (active high) + DECLARE_WRITE_LINE_MEMBER(di_write); // DI protected: // subclass overrides @@ -223,13 +222,13 @@ protected: public: // read handlers - DECLARE_READ_LINE_MEMBER(do_read); // DO - DECLARE_READ_LINE_MEMBER(ready_read); // READY/BUSY only + DECLARE_READ_LINE_MEMBER(do_read); // DO + DECLARE_READ_LINE_MEMBER(ready_read); // READY/BUSY only // write handlers - DECLARE_WRITE_LINE_MEMBER(cs_write); // CS signal (active high) - DECLARE_WRITE_LINE_MEMBER(clk_write); // CLK signal (active high) - DECLARE_WRITE_LINE_MEMBER(di_write); // DI + DECLARE_WRITE_LINE_MEMBER(cs_write); // CS signal (active high) + DECLARE_WRITE_LINE_MEMBER(clk_write); // CLK signal (active high) + DECLARE_WRITE_LINE_MEMBER(di_write); // DI protected: // subclass overrides @@ -249,8 +248,7 @@ class eeprom_serial_##_lowercase##_##_bits##bit_device : public eeprom_serial_## public: \ eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); \ }; \ -extern const device_type EEPROM_SERIAL_##_uppercase##_##_bits##BIT; \ - +extern const device_type EEPROM_SERIAL_##_uppercase##_##_bits##BIT; // standard 93CX6 class of 16-bit EEPROMs DECLARE_SERIAL_EEPROM_DEVICE(93cxx, 93c06, 93C06, 16) DECLARE_SERIAL_EEPROM_DEVICE(93cxx, 93c46, 93C46, 16) diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c index 5b7d7267759..28049b5df32 100644 --- a/src/emu/machine/generic.c +++ b/src/emu/machine/generic.c @@ -558,4 +558,3 @@ void generic_pulse_irq_line(device_t *device, int irqline, int cycles) { device- // legacy INTERRUPT_GEN( irq2_line_hold ) { device->machine().driver_data()->irq2_line_hold(*device); } - diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h index 98d90fec44c..de92cc0c521 100644 --- a/src/emu/machine/mb87078.h +++ b/src/emu/machine/mb87078.h @@ -44,7 +44,7 @@ public: Range from 100 to 0. (100 = 0dB; 50 = -6dB; 0 = -infinity) This function is designed for use with MAME mixer_xxx() functions. */ int gain_percent_r(int channel); - + void gain_recalc(); protected: @@ -52,7 +52,7 @@ protected: virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - + private: // internal state int m_gain[4]; /* gain index 0-63,64,65 */ diff --git a/src/emu/machine/s2636.c b/src/emu/machine/s2636.c index fb143e0448d..121ed6e87ca 100644 --- a/src/emu/machine/s2636.c +++ b/src/emu/machine/s2636.c @@ -143,13 +143,13 @@ void s2636_device::device_start() save_pointer(NAME(m_work_ram), m_work_ram_size); save_item(NAME(*m_bitmap)); save_item(NAME(*m_collision_bitmap)); - - + + m_channel = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate(), this); save_item(NAME(m_size)); save_item(NAME(m_pos)); save_item(NAME(m_level)); - + for (int i = 0; i < 1; i++) save_item(NAME(m_reg[i]), i); } diff --git a/src/emu/machine/s2636.h b/src/emu/machine/s2636.h index ae49f117ee5..112fe5f9913 100644 --- a/src/emu/machine/s2636.h +++ b/src/emu/machine/s2636.h @@ -47,14 +47,14 @@ public: bitmap_ind16 &update( const rectangle &cliprect ); DECLARE_WRITE8_MEMBER( work_ram_w ); DECLARE_READ8_MEMBER( work_ram_r ); - + void soundport_w (int mode, int data); protected: // device-level overrides virtual void device_config_complete(); virtual void device_start(); - + // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); @@ -63,13 +63,13 @@ private: UINT8 *m_work_ram; bitmap_ind16 *m_bitmap; bitmap_ind16 *m_collision_bitmap; - + sound_stream *m_channel; UINT8 m_reg[1]; int m_size; int m_pos; unsigned m_level; - + int check_collision( int spriteno1, int spriteno2, const rectangle &cliprect ); }; diff --git a/src/emu/machine/smc91c9x.h b/src/emu/machine/smc91c9x.h index 0295a339b2b..6260a2264b9 100644 --- a/src/emu/machine/smc91c9x.h +++ b/src/emu/machine/smc91c9x.h @@ -35,13 +35,13 @@ public: DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); - + protected: // device-level overrides virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - + private: // internal state smc91c9x_irq_func m_irq_handler; @@ -64,7 +64,7 @@ private: /* counters */ UINT32 m_sent; UINT32 m_recd; - + void update_ethernet_irq(); void update_stats(); void finish_enqueue(int param); diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index b30f62ac2b5..76c37444535 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -1466,7 +1466,7 @@ void wd_fdc_t::live_run(attotime limit) if(cur_live.bit_counter & 15) break; int slot = (cur_live.bit_counter >> 4)-1; - // fprintf(stderr, "%s: slot[%d] = %02x crc = %04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc); + // fprintf(stderr, "%s: slot[%d] = %02x crc = %04x\n", tts(cur_live.tm).cstr(), slot, cur_live.data_reg, cur_live.crc); cur_live.idbuf[slot] = cur_live.data_reg; if(slot == 5) { live_delay(IDLE); |
