diff options
author | 2013-03-19 07:22:20 +0000 | |
---|---|---|
committer | 2013-03-19 07:22:20 +0000 | |
commit | 0e1f5ad25b25df7c2ec707ec45c544288eb3c683 (patch) | |
tree | eeef04fdf999692be30c25457fb9b329e1dbfdde /src/mess/machine | |
parent | 86614c802b9d611d83520fdb43388ae51d31f553 (diff) |
Cleanups and version bumpmame0148u2
Diffstat (limited to 'src/mess/machine')
60 files changed, 556 insertions, 569 deletions
diff --git a/src/mess/machine/3c505.c b/src/mess/machine/3c505.c index bc0eaccd28f..b7954077d71 100644 --- a/src/mess/machine/3c505.c +++ b/src/mess/machine/3c505.c @@ -400,7 +400,7 @@ void threecom3c505_device::data_buffer_fifo::reset() m_count = 0; } -int threecom3c505_device::data_buffer_fifo::put(const UINT8 data[], const int length) +int threecom3c505_device::data_buffer_fifo::put(const UINT8 data[], const int length) { UINT16 next_index = (m_put_index + 1) % m_size; @@ -659,11 +659,11 @@ void threecom3c505_device::do_receive_command() // preset receive response PCB memcpy(&m_response, &m_rcv_response, sizeof(m_rcv_response)); -// m_response.command = CMD_RECEIVE_PACKET_COMPLETE; // 0x38 -// m_response.length = 16; -// m_response.data.rcv_resp.buf_ofs = htole16(0); -// m_response.data.rcv_resp.buf_seg = htole16(0); -// m_response.data.rcv_resp.buf_len = htole16(buf_len); +// m_response.command = CMD_RECEIVE_PACKET_COMPLETE; // 0x38 +// m_response.length = 16; +// m_response.data.rcv_resp.buf_ofs = htole16(0); +// m_response.data.rcv_resp.buf_seg = htole16(0); +// m_response.data.rcv_resp.buf_len = htole16(buf_len); // htole16 and friends are not portable beyond Linux. It's named differently on *BSD and differently again on OS X. Avoid! m_response.data.rcv_resp.pkt_len = uint16_to_le(m_rx_data_buffer.get_length()); @@ -1129,7 +1129,7 @@ UINT8 threecom3c505_device::read_command_port() case CMD_TRANSMIT_PACKET_18_COMPLETE: m_netstat.tot_xmit++; - if (!send(m_tx_data_buffer.get_data(), m_tx_data_buffer.get_length())) + if (!send(m_tx_data_buffer.get_data(), m_tx_data_buffer.get_length())) { // FIXME: failed to send the Ethernet packet LOG(("read_command_port(): !!! failed to send Ethernet packet")); @@ -1216,7 +1216,7 @@ void threecom3c505_device::write_data_port(UINT8 data) } } else if (m_command_buffer[0] == CMD_TRANSMIT_PACKET || // - m_command_buffer[0] == CMD_TRANSMIT_PACKET_18) + m_command_buffer[0] == CMD_TRANSMIT_PACKET_18) { if (!m_tx_data_buffer.append(data)) { diff --git a/src/mess/machine/68561mpcc.c b/src/mess/machine/68561mpcc.c index 487b4d4abd4..ef29f95a98d 100644 --- a/src/mess/machine/68561mpcc.c +++ b/src/mess/machine/68561mpcc.c @@ -19,9 +19,9 @@ const device_type MPCC68561 = &device_creator<mpcc68561_t>; PARAMETERS ***************************************************************************/ -#define LOG_MPCC (1) +#define LOG_MPCC (1) -#if 0 // future +#if 0 // future /*************************************************************************** IMPLEMENTATION @@ -253,10 +253,10 @@ void mpcc68561_t::putreg(int ch, UINT8 data) switch (reg) { - case 0: // command register + case 0: // command register switch ((data >> 3) & 7) { - case 1: // select high registers (handled elsewhere) + case 1: // select high registers (handled elsewhere) break; case 2: // reset external and status IRQs @@ -268,7 +268,7 @@ void mpcc68561_t::putreg(int ch, UINT8 data) updateirqs(); break; - case 0: // nothing + case 0: // nothing case 3: // send SDLC abort case 4: // enable IRQ on next Rx byte case 6: // reset errors @@ -279,7 +279,7 @@ void mpcc68561_t::putreg(int ch, UINT8 data) } break; - case 1: // Tx/Rx IRQ and data transfer mode defintion + case 1: // Tx/Rx IRQ and data transfer mode defintion pChan->extIRQEnable = (data & 1); pChan->txIRQEnable = (data & 2) ? 1 : 0; pChan->rxIRQEnable = (data >> 3) & 3; @@ -301,7 +301,7 @@ void mpcc68561_t::putreg(int ch, UINT8 data) if (pChan->txEnable) { - pChan->reg_val[0] |= 0x04; // Tx empty + pChan->reg_val[0] |= 0x04; // Tx empty } break; @@ -317,10 +317,10 @@ void mpcc68561_t::putreg(int ch, UINT8 data) // channel reset command switch ((data>>6) & 3) { - case 0: // do nothing + case 0: // do nothing break; - case 1: // reset channel B + case 1: // reset channel B resetchannel(0); break; @@ -339,14 +339,14 @@ void mpcc68561_t::putreg(int ch, UINT8 data) } break; - case 10: // misc transmitter/receiver control bits - case 11: // clock mode control - case 12: // lower byte of baud rate gen - case 13: // upper byte of baud rate gen + case 10: // misc transmitter/receiver control bits + case 11: // clock mode control + case 12: // lower byte of baud rate gen + case 13: // upper byte of baud rate gen break; - case 14: // misc control bits - if (data & 0x01) // baud rate generator enable? + case 14: // misc control bits + if (data & 0x01) // baud rate generator enable? { int brconst = pChan->reg_val[13]<<8 | pChan->reg_val[14]; int rate = clock() / brconst; @@ -355,7 +355,7 @@ void mpcc68561_t::putreg(int ch, UINT8 data) } break; - case 15: // external/status interrupt control + case 15: // external/status interrupt control pChan->baudIRQEnable = (data & 2) ? 1 : 0; pChan->DCDEnable = (data & 8) ? 1 : 0; pChan->CTSEnable = (data & 0x20) ? 1 : 0; @@ -469,10 +469,10 @@ WRITE8_MEMBER( mpcc68561_t::reg_w ) if (pChan->reg_val[14] & 0x10) { pChan->rxData = data; - pChan->reg_val[0] |= 0x01; // Rx character available + pChan->reg_val[0] |= 0x01; // Rx character available } - pChan->reg_val[1] |= 0x01; // All sent - pChan->reg_val[0] |= 0x04; // Tx empty + pChan->reg_val[1] |= 0x01; // All sent + pChan->reg_val[0] |= 0x04; // Tx empty pChan->txUnderrun = 1; pChan->txIRQPending = 1; updateirqs(); diff --git a/src/mess/machine/68561mpcc.h b/src/mess/machine/68561mpcc.h index 591278df9d8..2d446a5ab5b 100644 --- a/src/mess/machine/68561mpcc.h +++ b/src/mess/machine/68561mpcc.h @@ -11,8 +11,8 @@ #ifndef __68561MPCC_H__ #define __68561MPCC_H__ -#define MCFG_MPCC68561_ADD(_tag, _clock, _intrq_cb) \ - MCFG_DEVICE_ADD(_tag, MPCC68561, _clock) \ +#define MCFG_MPCC68561_ADD(_tag, _clock, _intrq_cb) \ + MCFG_DEVICE_ADD(_tag, MPCC68561, _clock) \ downcast<mpcc68561_t *>(device)->set_intrq_cb(_intrq_cb); class mpcc68561_t : public device_t diff --git a/src/mess/machine/a2mockingboard.c b/src/mess/machine/a2mockingboard.c index 0c896f19d3a..9bbf80bd375 100644 --- a/src/mess/machine/a2mockingboard.c +++ b/src/mess/machine/a2mockingboard.c @@ -563,4 +563,3 @@ void a2bus_echoplus_device::write_c0nx(address_space &space, UINT8 offset, UINT8 break; } } - diff --git a/src/mess/machine/a2scsi.c b/src/mess/machine/a2scsi.c index ac0005d893a..a6599b10ca2 100644 --- a/src/mess/machine/a2scsi.c +++ b/src/mess/machine/a2scsi.c @@ -34,7 +34,7 @@ const device_type A2BUS_SCSI = &device_creator<a2bus_scsi_device>; #define SCSI_ROM_REGION "scsi_rom" -#define SCSI_BUS_TAG "scsibus" +#define SCSI_BUS_TAG "scsibus" #define SCSI_5380_TAG "scsibus:7:ncr5380" static const ncr5380n_interface ncr5380_interface = @@ -157,20 +157,20 @@ UINT8 a2bus_scsi_device::read_c0nx(address_space &space, UINT8 offset) case 5: case 6: case 7: -// printf("Read 5380 @ %x\n", offset); +// printf("Read 5380 @ %x\n", offset); return m_ncr5380->read(space, offset); break; - case 8: // read and DACK + case 8: // read and DACK return m_ncr5380->dma_r(); case 9: // our SCSI ID (normally 0x80 = 7) return (1<<7); - case 0xa: // RAM/ROM bank + case 0xa: // RAM/ROM bank return m_bank; - case 0xe: // DRQ status in bit 7 + case 0xe: // DRQ status in bit 7 return m_drq; default: @@ -198,11 +198,11 @@ void a2bus_scsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 dat case 5: case 6: case 7: -// printf("%02x to 5380 reg %x\n", data, offset); +// printf("%02x to 5380 reg %x\n", data, offset); m_ncr5380->write(space, offset, data); break; - case 8: // write and DACK + case 8: // write and DACK m_ncr5380->dma_w(data); break; @@ -224,23 +224,23 @@ void a2bus_scsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 dat m_rambank = ((data>>4) & 0x7) * 0x400; m_rombank = (data & 0xf) * 0x400; m_bank = data; -// printf("RAM bank to %x, ROM bank to %x\n", m_rambank, m_rombank); - m_816block = false; // does this reset block mode? +// printf("RAM bank to %x, ROM bank to %x\n", m_rambank, m_rombank); + m_816block = false; // does this reset block mode? break; - case 0xb: // reset 5380 -// printf("Resetting SCSI: %02x at %x\n", data, space.device().safe_pc()); + case 0xb: // reset 5380 +// printf("Resetting SCSI: %02x at %x\n", data, space.device().safe_pc()); m_ncr5380->reset(); m_816block = false; break; - case 0xc: // set IIgs block mode DMA + case 0xc: // set IIgs block mode DMA printf("%02x to block-mode DMA mode\n", data); m_816block = true; break; - case 0xd: // set Mac-style pseudo-DMA -// printf("%02x to pseudo-DMA mode\n", data); + case 0xd: // set Mac-style pseudo-DMA +// printf("%02x to pseudo-DMA mode\n", data); m_816block = false; break; @@ -263,7 +263,7 @@ UINT8 a2bus_scsi_device::read_cnxx(address_space &space, UINT8 offset) void a2bus_scsi_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) { // there are writes to cn0A, possibly misguided C0nA (bank select?) writes? -// printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc()); +// printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc()); } /*------------------------------------------------- @@ -276,7 +276,7 @@ UINT8 a2bus_scsi_device::read_c800(address_space &space, UINT16 offset) // bankswitched ROM at cc00-cfff if (offset < 0x400) { -// printf("Read RAM at %x = %02x\n", offset+m_rambank, m_ram[offset + m_rambank]); +// printf("Read RAM at %x = %02x\n", offset+m_rambank, m_ram[offset + m_rambank]); if (m_816block) { return m_ncr5380->dma_r(); @@ -297,7 +297,7 @@ void a2bus_scsi_device::write_c800(address_space &space, UINT16 offset, UINT8 da { if (offset < 0x400) { -// printf("%02x to RAM at %x\n", data, offset+m_rambank); +// printf("%02x to RAM at %x\n", data, offset+m_rambank); if (m_816block) { m_ncr5380->dma_w(data); diff --git a/src/mess/machine/a2ssc.c b/src/mess/machine/a2ssc.c index 5a0a648b494..5c5c13e39a1 100644 --- a/src/mess/machine/a2ssc.c +++ b/src/mess/machine/a2ssc.c @@ -26,7 +26,7 @@ const device_type A2BUS_SSC = &device_creator<a2bus_ssc_device>; #define SSC_ROM_REGION "ssc_rom" #define SSC_ACIA_TAG "ssc_acia" -#define SSC_RS232_TAG "ssc_rs232" +#define SSC_RS232_TAG "ssc_rs232" static SLOT_INTERFACE_START( rs232_devices ) SLOT_INTERFACE("serial_terminal", SERIAL_TERMINAL) diff --git a/src/mess/machine/a2zipdrive.c b/src/mess/machine/a2zipdrive.c index c3bdefe2a73..41a3e2db693 100644 --- a/src/mess/machine/a2zipdrive.c +++ b/src/mess/machine/a2zipdrive.c @@ -1,20 +1,20 @@ /********************************************************************* - - a2zipdrive.c + + a2zipdrive.c ZIP Technologies ZipDrive IDE card - + NOTE: No known dump exists of the formatter utility and the format of the custom partition record (block 0) that the card expects has not yet been determined, so this is largely untested and will work only with a drive dump from real h/w. - + PLEASE use it only on a backup copy of said dump and contact MESSdev if you have one! - + Partition block format: +0000: ASCII "Zip Technologies" - + *********************************************************************/ #include "a2zipdrive.h" @@ -119,9 +119,9 @@ UINT8 a2bus_zipdrivebase_device::read_c0nx(address_space &space, UINT8 offset) case 7: return ide_controller_r(m_ide, 0x1f0+offset, 1); - case 8: // data port + case 8: // data port m_lastdata = ide_controller_r(m_ide, 0x1f0, 2); -// printf("%04x @ IDE data\n", m_lastdata); +// printf("%04x @ IDE data\n", m_lastdata); return m_lastdata&0xff; case 9: @@ -144,7 +144,7 @@ void a2bus_zipdrivebase_device::write_c0nx(address_space &space, UINT8 offset, U { switch (offset) { - case 0: + case 0: case 1: case 2: case 3: @@ -152,17 +152,17 @@ void a2bus_zipdrivebase_device::write_c0nx(address_space &space, UINT8 offset, U case 5: case 6: case 7: -// printf("%02x to IDE controller @ %x\n", data, offset); +// printf("%02x to IDE controller @ %x\n", data, offset); ide_controller_w(m_ide, 0x1f0+offset, 1, data); break; case 8: -// printf("%02x to IDE data lo\n", data); +// printf("%02x to IDE data lo\n", data); m_lastdata = data; break; case 9: -// printf("%02x to IDE data hi\n", data); +// printf("%02x to IDE data hi\n", data); m_lastdata &= 0x00ff; m_lastdata |= (data << 8); ide_controller_w(m_ide, 0x1f0, 2, m_lastdata); @@ -196,4 +196,3 @@ UINT8 a2bus_zipdrivebase_device::read_c800(address_space &space, UINT16 offset) return m_rom[offset+0x1800]; } - diff --git a/src/mess/machine/a2zipdrive.h b/src/mess/machine/a2zipdrive.h index ac0006639ec..593987d623f 100644 --- a/src/mess/machine/a2zipdrive.h +++ b/src/mess/machine/a2zipdrive.h @@ -3,9 +3,9 @@ a2zipdrive.h ZIP Technologies ZipDrive IDE card - + See important NOTE at the top of a2zipdrive.c! - + *********************************************************************/ #ifndef __A2BUS_ZIPDRIVE__ diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c index 78e546d85dc..f8264aaa3db 100644 --- a/src/mess/machine/apollo.c +++ b/src/mess/machine/apollo.c @@ -440,7 +440,7 @@ READ8_MEMBER(apollo_state::apollo_dma_read_byte){ { SLOG1(("dma read byte at offset %x+%03x = %02x", page_offset, offset, data)); } -// logerror(" %02x", data); +// logerror(" %02x", data); return data; } @@ -460,7 +460,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_write_byte){ { SLOG1(("dma write byte at offset %x+%03x = %02x", page_offset, offset , data)); } -// logerror(" %02x", data); +// logerror(" %02x", data); } READ8_MEMBER(apollo_state::apollo_dma_read_word){ diff --git a/src/mess/machine/c1551.c b/src/mess/machine/c1551.c index 7a0cbb57a5d..d2c2d197877 100644 --- a/src/mess/machine/c1551.c +++ b/src/mess/machine/c1551.c @@ -480,7 +480,7 @@ void c1551_device::device_reset() m_maincpu->reset(); m_tpi0->reset(); - + m_exp->reset(); // initialize gate array diff --git a/src/mess/machine/c1571.c b/src/mess/machine/c1571.c index 97121f98b00..7e22b45aee6 100644 --- a/src/mess/machine/c1571.c +++ b/src/mess/machine/c1571.c @@ -817,7 +817,7 @@ static MACHINE_CONFIG_FRAGMENT( c1571cr ) MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf) //MCFG_MOS5710_ADD(M5710_TAG, XTAL_16MHz/16, 0) - + MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2) MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_interface) diff --git a/src/mess/machine/c64_ieee488.c b/src/mess/machine/c64_ieee488.c index b2685edccf7..63585540bba 100644 --- a/src/mess/machine/c64_ieee488.c +++ b/src/mess/machine/c64_ieee488.c @@ -156,7 +156,7 @@ static const tpi6525_interface tpi_intf = static MACHINE_CONFIG_FRAGMENT( c64_ieee488 ) MCFG_TPI6525_ADD(MOS6525_TAG, tpi_intf) - + MCFG_CBM_IEEE488_ADD(NULL) MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() MACHINE_CONFIG_END diff --git a/src/mess/machine/c64_midi_maplin.c b/src/mess/machine/c64_midi_maplin.c index 4f34a03d6e3..6fbf4405807 100644 --- a/src/mess/machine/c64_midi_maplin.c +++ b/src/mess/machine/c64_midi_maplin.c @@ -15,7 +15,7 @@ // MACROS/CONSTANTS //************************************************************************** -#define MC6850_TAG "mc6850" +#define MC6850_TAG "mc6850" @@ -48,7 +48,7 @@ WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::tx_out ) static ACIA6850_INTERFACE( acia_intf ) { 500000, - 0, // rx clock (we manually clock rx) + 0, // rx clock (we manually clock rx) DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, rx_in), DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_maplin_midi_cartridge_device, tx_out), DEVCB_NULL, @@ -69,8 +69,8 @@ SLOT_INTERFACE_END WRITE_LINE_MEMBER( c64_maplin_midi_cartridge_device::midi_rx_w ) { m_rx_state = state; - - for (int i = 0; i < 16; i++) // divider is set to 64 + + for (int i = 0; i < 16; i++) // divider is set to 64 { m_acia->rx_clock_in(); } @@ -92,7 +92,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; diff --git a/src/mess/machine/c64_midi_namesoft.c b/src/mess/machine/c64_midi_namesoft.c index 453a639571b..11309ac68df 100644 --- a/src/mess/machine/c64_midi_namesoft.c +++ b/src/mess/machine/c64_midi_namesoft.c @@ -15,7 +15,7 @@ // MACROS/CONSTANTS //************************************************************************** -#define MC6850_TAG "mc6850" +#define MC6850_TAG "mc6850" @@ -48,7 +48,7 @@ WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::tx_out ) static ACIA6850_INTERFACE( acia_intf ) { 500000, - 0, // rx clock (we manually clock rx) + 0, // rx clock (we manually clock rx) DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, rx_in), DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_namesoft_midi_cartridge_device, tx_out), DEVCB_NULL, @@ -69,8 +69,8 @@ SLOT_INTERFACE_END WRITE_LINE_MEMBER( c64_namesoft_midi_cartridge_device::midi_rx_w ) { m_rx_state = state; - - for (int i = 0; i < 16; i++) // divider is set to 16 + + for (int i = 0; i < 16; i++) // divider is set to 16 { m_acia->rx_clock_in(); } @@ -92,7 +92,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; diff --git a/src/mess/machine/c64_midi_passport.c b/src/mess/machine/c64_midi_passport.c index 8aed258f633..8a49ebffa8a 100644 --- a/src/mess/machine/c64_midi_passport.c +++ b/src/mess/machine/c64_midi_passport.c @@ -15,8 +15,8 @@ // MACROS/CONSTANTS //************************************************************************** -#define MC6840_TAG "mc6840" -#define MC6850_TAG "mc6850" +#define MC6840_TAG "mc6840" +#define MC6850_TAG "mc6850" @@ -71,7 +71,7 @@ WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::tx_out ) static ACIA6850_INTERFACE( acia_intf ) { 500000, - 0, // rx clock (we manually clock rx) + 0, // rx clock (we manually clock rx) DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, rx_in), DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_passport_midi_cartridge_device, tx_out), DEVCB_NULL, @@ -92,8 +92,8 @@ SLOT_INTERFACE_END WRITE_LINE_MEMBER( c64_passport_midi_cartridge_device::midi_rx_w ) { m_rx_state = state; - - for (int i = 0; i < 16; i++) // divider is set to 16 + + for (int i = 0; i < 16; i++) // divider is set to 16 { m_acia->rx_clock_in(); } @@ -115,7 +115,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; @@ -246,7 +246,7 @@ void c64_passport_midi_cartridge_device::c64_cd_w(address_space &space, offs_t o case 0x30: // Drum sync SET break; - + case 0x38: // Drum sync CLEAR break; diff --git a/src/mess/machine/c64_midi_sci.c b/src/mess/machine/c64_midi_sci.c index 4835915b892..1edb8fcf7d7 100644 --- a/src/mess/machine/c64_midi_sci.c +++ b/src/mess/machine/c64_midi_sci.c @@ -15,7 +15,7 @@ // MACROS/CONSTANTS //************************************************************************** -#define MC6850_TAG "mc6850" +#define MC6850_TAG "mc6850" @@ -48,7 +48,7 @@ WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::tx_out ) static ACIA6850_INTERFACE( acia_intf ) { 500000, - 0, // rx clock (we manually clock rx) + 0, // rx clock (we manually clock rx) DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, rx_in), DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_sequential_midi_cartridge_device, tx_out), DEVCB_NULL, @@ -69,8 +69,8 @@ SLOT_INTERFACE_END WRITE_LINE_MEMBER( c64_sequential_midi_cartridge_device::midi_rx_w ) { m_rx_state = state; - - for (int i = 0; i < 16; i++) // divider is set to 16 + + for (int i = 0; i < 16; i++) // divider is set to 16 { m_acia->rx_clock_in(); } @@ -92,7 +92,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; diff --git a/src/mess/machine/c64_midi_siel.c b/src/mess/machine/c64_midi_siel.c index 035f37e55d9..b936406359a 100644 --- a/src/mess/machine/c64_midi_siel.c +++ b/src/mess/machine/c64_midi_siel.c @@ -15,7 +15,7 @@ // MACROS/CONSTANTS //************************************************************************** -#define MC6850_TAG "mc6850" +#define MC6850_TAG "mc6850" @@ -48,7 +48,7 @@ WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::tx_out ) static ACIA6850_INTERFACE( acia_intf ) { XTAL_2MHz, - 0, // rx clock (we manually clock rx) + 0, // rx clock (we manually clock rx) DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, rx_in), DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_siel_midi_cartridge_device, tx_out), DEVCB_NULL, @@ -69,8 +69,8 @@ SLOT_INTERFACE_END WRITE_LINE_MEMBER( c64_siel_midi_cartridge_device::midi_rx_w ) { m_rx_state = state; - - for (int i = 0; i < 64; i++) // divider is set to 64 + + for (int i = 0; i < 64; i++) // divider is set to 64 { m_acia->rx_clock_in(); } @@ -92,7 +92,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; diff --git a/src/mess/machine/c64_tdos.c b/src/mess/machine/c64_tdos.c index dade459fc2c..7d58930e990 100644 --- a/src/mess/machine/c64_tdos.c +++ b/src/mess/machine/c64_tdos.c @@ -95,8 +95,8 @@ static MC6852_INTERFACE( ssda_intf ) static MACHINE_CONFIG_FRAGMENT( c64_tdos ) MCFG_MC6852_ADD(MC68A52P_TAG, XTAL_6_5MHz, ssda_intf) - - MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() + + MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() MACHINE_CONFIG_END diff --git a/src/mess/machine/c64_vic1011.c b/src/mess/machine/c64_vic1011.c index e796723c2ba..77954218905 100644 --- a/src/mess/machine/c64_vic1011.c +++ b/src/mess/machine/c64_vic1011.c @@ -93,18 +93,18 @@ void c64_vic1011_device::device_start() UINT8 c64_vic1011_device::c64_pb_r(address_space &space, offs_t offset) { /* - + bit description - + 0 Sin - 1 - 2 - 3 + 1 + 2 + 3 4 DCDin - 5 + 5 6 CTS 7 DSR - + */ UINT8 data = 0; @@ -125,18 +125,18 @@ UINT8 c64_vic1011_device::c64_pb_r(address_space &space, offs_t offset) void c64_vic1011_device::c64_pb_w(address_space &space, offs_t offset, UINT8 data) { /* - + bit description - - 0 + + 0 1 RTS 2 DTR - 3 - 4 + 3 + 4 5 DCDout - 6 - 7 - + 6 + 7 + */ m_rs232->rts_w(BIT(data, 1)); diff --git a/src/mess/machine/c64user.h b/src/mess/machine/c64user.h index 7fcdc2ec7f3..3088e901552 100644 --- a/src/mess/machine/c64user.h +++ b/src/mess/machine/c64user.h @@ -73,12 +73,12 @@ public: c64_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); template<class _reset> void set_reset_callback(_reset reset) { m_write_reset.set_callback(reset); } - + template<class _cnt, class _sp> void set_cia1_callbacks(_cnt cnt, _sp sp) { m_write_cnt1.set_callback(cnt); m_write_sp1.set_callback(sp); } - + template<class _cnt, class _sp, class _flag> void set_cia2_callbacks(_cnt cnt, _sp sp, _flag flag) { m_write_cnt2.set_callback(cnt); m_write_sp2.set_callback(sp); diff --git a/src/mess/machine/cococart.c b/src/mess/machine/cococart.c index a8b149472cc..da10ee3669d 100644 --- a/src/mess/machine/cococart.c +++ b/src/mess/machine/cococart.c @@ -50,7 +50,7 @@ void cococart_slot_device::device_start() { for(int i=0; i<TIMER_POOL; i++ ) { - m_cart_line.timer[i] = timer_alloc(TIMER_CART); + m_cart_line.timer[i] = timer_alloc(TIMER_CART); m_nmi_line.timer[i] = timer_alloc(TIMER_NMI); m_halt_line.timer[i] = timer_alloc(TIMER_HALT); } @@ -294,7 +294,7 @@ void cococart_slot_device::cart_set_line(cococart_line line, cococart_line_value break; case COCOCART_LINE_SOUND_ENABLE: - // do nothing for now + // do nothing for now break; } } diff --git a/src/mess/machine/gb_mbc.c b/src/mess/machine/gb_mbc.c index 2704823acc7..29ae1320fbb 100644 --- a/src/mess/machine/gb_mbc.c +++ b/src/mess/machine/gb_mbc.c @@ -132,7 +132,7 @@ void gb_rom_mbc_device::shared_reset() m_ram_bank = 0; m_ram_enable = 0; m_mode = 0; - + has_rumble = FALSE; has_timer = FALSE; has_battery = FALSE; @@ -173,7 +173,7 @@ void gb_rom_mbc6_device::device_reset() m_bank_6000 = 3; // correct default? m_latch1 = 0; // correct default? m_latch2 = 0; // correct default? - + m_latch_bank = 2; // correct default? m_latch_bank2 = 3; // correct default? m_ram_bank = 0; @@ -212,7 +212,7 @@ void gb_rom_sintax_device::device_start() void gb_rom_sintax_device::device_reset() { - shared_reset(); + shared_reset(); m_sintax_mode = 0; m_currentxor = 0; m_xor2 = 0; @@ -709,18 +709,18 @@ READ8_MEMBER(gb_rom_chongwu_device::read_rom) void gb_rom_sintax_device::set_xor_for_bank(UINT8 bank) { - switch (bank & 0x0f) + switch (bank & 0x0f) { - case 0x00: case 0x04: case 0x08: case 0x0c: + case 0x00: case 0x04: case 0x08: case 0x0c: m_currentxor = m_xor2; break; - case 0x01: case 0x05: case 0x09: case 0x0d: + case 0x01: case 0x05: case 0x09: case 0x0d: m_currentxor = m_xor3; break; - case 0x02: case 0x06: case 0x0a: case 0x0e: + case 0x02: case 0x06: case 0x0a: case 0x0e: m_currentxor = m_xor4; break; - case 0x03: case 0x07: case 0x0b: case 0x0f: + case 0x03: case 0x07: case 0x0b: case 0x0f: m_currentxor = m_xor5; break; } @@ -739,10 +739,10 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_bank) if (offset < 0x2000) m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0; else if (offset < 0x3000) - { + { set_xor_for_bank(data); - switch (m_sintax_mode & 0x0f) + switch (m_sintax_mode & 0x0f) { case 0x0d: data = BITSWAP8(data, 1,0,7,6,5,4,3,2); @@ -767,8 +767,8 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_bank) data = BITSWAP8(data, 2,3,0,1,6,7,4,5); // 5 and 6 unconfirmed break; } - m_latch_bank2 = (m_latch_bank2 & 0x100) | data; - } + m_latch_bank2 = (m_latch_bank2 & 0x100) | data; + } else if (offset < 0x4000) { m_latch_bank2 = (m_latch_bank2 & 0xff) | ((data & 0x01) << 8); @@ -785,13 +785,13 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_bank) if (!m_sintax_mode) { m_sintax_mode = data; - write_bank(space, 0x2000, 1); //force a fake bank switch + write_bank(space, 0x2000, 1); //force a fake bank switch } -// printf("sintax mode %x\n", m_sintax_mode & 0xf); +// printf("sintax mode %x\n", m_sintax_mode & 0xf); } else if (offset >= 0x7000) { - switch ((offset & 0x00f0) >> 4) + switch ((offset & 0x00f0) >> 4) { case 2: m_xor2 = data; @@ -803,14 +803,14 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_bank) m_xor4 = data; break; case 5: - m_xor5 = data; + m_xor5 = data; break; } - - if (m_currentxor == 0) - set_xor_for_bank(4); + + if (m_currentxor == 0) + set_xor_for_bank(4); } - + } READ8_MEMBER(gb_rom_sintax_device::read_ram) @@ -828,15 +828,15 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_ram) } /* - + Further MBC5 variants to emulate: - + Digimon 2 & Digimon 4 (Yong Yong) - + Digimon 2 writes at $2000 to select latch2 (data must be divided by 2, and 0 becomes 1), then writes to $2400 a series of values that the patched version does not write... Digimon 4 seems to share part of the $2000 behavior, but does not write to $2400... - + */ // MBC5 variant used by Digimon 2 (and maybe 4?) @@ -855,29 +855,29 @@ WRITE8_MEMBER(gb_rom_digimon_device::write_bank) m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0; else if (offset == 0x2000) { -// printf("written $02 %X at %X\n", data, offset); +// printf("written $02 %X at %X\n", data, offset); if (!data) data++; m_latch_bank2 = data/2; } else if (offset < 0x3000) { -// printf("written $03 %X at %X\n", data, offset); +// printf("written $03 %X at %X\n", data, offset); } else if (offset < 0x4000) { -// printf("written $04 %X at %X\n", data, offset); +// printf("written $04 %X at %X\n", data, offset); } else if (offset < 0x6000) { -// printf("written $05-$06 %X at %X\n", data, offset); +// printf("written $05-$06 %X at %X\n", data, offset); data &= 0x0f; if (has_rumble) data &= 0x7; m_ram_bank = data; } -// else -// printf("written $07 %X at %X\n", data, offset); +// else +// printf("written $07 %X at %X\n", data, offset); } READ8_MEMBER(gb_rom_digimon_device::read_ram) @@ -917,7 +917,7 @@ WRITE8_MEMBER(gb_rom_rockman8_device::write_bank) data = 1; if (data > 0xf) data -= 8; - + m_latch_bank2 = data; } } @@ -946,15 +946,15 @@ WRITE8_MEMBER(gb_rom_rockman8_device::write_ram) // 9th --> 0x0b // 10th --> 0x0c // 11th --> 0x0d -// 12th --> 0x0f +// 12th --> 0x0f // 13th --> 0x13 -// writing data to 0x2000-0x2fff switches bank according to the table below +// writing data to 0x2000-0x2fff switches bank according to the table below // (the value values corresponding to table[0x0f] is not confirmed, choices // 0,1,2,3,8,c,f freeze the game, while 4,5,6,7,b,d,0x13 work with glitches) static UINT8 smb3_table1[0x20] = { - 0x00,0x04,0x01,0x05, 0x02,0x06,0x03,0x05, 0x08,0x0c,0x03,0x0d, 0x03,0x0b,0x0b,0x08 /* original doc here put 0x0f (i.e. 11th unique bank) */, + 0x00,0x04,0x01,0x05, 0x02,0x06,0x03,0x05, 0x08,0x0c,0x03,0x0d, 0x03,0x0b,0x0b,0x08 /* original doc here put 0x0f (i.e. 11th unique bank) */, 0x05,0x06,0x0b,0x0d, 0x08,0x06,0x13,0x0b, 0x08,0x05,0x05,0x08, 0x0b,0x0d,0x06,0x05 }; @@ -975,7 +975,7 @@ READ8_MEMBER(gb_rom_sm3sp_device::read_rom) WRITE8_MEMBER(gb_rom_sm3sp_device::write_bank) { -// printf("write 0x%x at %x\n", data, offset); +// printf("write 0x%x at %x\n", data, offset); if (offset < 0x2000) return; else if (offset < 0x3000) @@ -992,20 +992,20 @@ WRITE8_MEMBER(gb_rom_sm3sp_device::write_bank) // 5bits only data &= 0x1f; - + m_latch_bank2 = smb3_table1[data]; if (m_mode) { switch (m_latch_bank2) { - case 0x02: m_latch_bank2 = 4; break; - case 0x03: m_latch_bank2 = 6; break; - case 0x04: m_latch_bank2 = 2; break; - case 0x05: m_latch_bank2 = 3; break; - case 0x06: m_latch_bank2 = 5; break; - case 0x0b: m_latch_bank2 = 0xd; break; - case 0x0c: m_latch_bank2 = 0xb; break; - case 0x0d: m_latch_bank2 = 0xc; break; + case 0x02: m_latch_bank2 = 4; break; + case 0x03: m_latch_bank2 = 6; break; + case 0x04: m_latch_bank2 = 2; break; + case 0x05: m_latch_bank2 = 3; break; + case 0x06: m_latch_bank2 = 5; break; + case 0x0b: m_latch_bank2 = 0xd; break; + case 0x0c: m_latch_bank2 = 0xb; break; + case 0x0d: m_latch_bank2 = 0xc; break; case 0x00: case 0x01: @@ -1019,14 +1019,14 @@ WRITE8_MEMBER(gb_rom_sm3sp_device::write_bank) } else if (offset < 0x5000) { -// printf("write $5 %X at %X\n", data, offset); +// printf("write $5 %X at %X\n", data, offset); //maybe rumble?? } else if (offset < 0x6000) { -// printf("write mode %x\n", data); +// printf("write mode %x\n", data); m_mode = BIT(data, 5); -// write_bank(space, 0x2000, 1); +// write_bank(space, 0x2000, 1); } } diff --git a/src/mess/machine/gb_mbc.h b/src/mess/machine/gb_mbc.h index 2d8ea0a1b26..7299d5ca48e 100644 --- a/src/mess/machine/gb_mbc.h +++ b/src/mess/machine/gb_mbc.h @@ -17,10 +17,10 @@ public: virtual void device_start() { shared_start(); }; virtual void device_reset() { shared_reset(); }; virtual void device_config_complete() { m_shortname = "gb_rom_mbc_base"; } - + void shared_start(); void shared_reset(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ8_MEMBER(read_ram); @@ -191,13 +191,13 @@ class gb_rom_sintax_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_sintax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "gb_rom_sintax"; } void set_xor_for_bank(UINT8 bank); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -215,12 +215,12 @@ class gb_rom_chongwu_device : public gb_rom_mbc5_device public: // construction/destruction gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "gb_rom_chongwu"; } - + virtual DECLARE_READ8_MEMBER(read_rom); UINT8 m_protection_checked; }; @@ -232,12 +232,12 @@ class gb_rom_digimon_device : public gb_rom_mbc5_device public: // construction/destruction gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start() { shared_start(); }; virtual void device_reset() { shared_reset(); }; virtual void device_config_complete() { m_shortname = "gb_rom_digimon"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -250,12 +250,12 @@ class gb_rom_rockman8_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start() { shared_start(); }; virtual void device_reset() { shared_reset(); }; virtual void device_config_complete() { m_shortname = "gb_rom_rockman8"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -270,12 +270,12 @@ class gb_rom_sm3sp_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start() { shared_start(); }; virtual void device_reset() { shared_reset(); }; virtual void device_config_complete() { m_shortname = "gb_rom_sm3sp"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); diff --git a/src/mess/machine/gb_rom.c b/src/mess/machine/gb_rom.c index 4937fb641be..e11e997ec6e 100644 --- a/src/mess/machine/gb_rom.c +++ b/src/mess/machine/gb_rom.c @@ -98,7 +98,7 @@ void gb_rom_device::shared_reset() m_ram_bank = 0; m_latch_bank = 0; m_latch_bank2 = 1; - + has_rumble = FALSE; has_timer = FALSE; has_battery = FALSE; @@ -142,7 +142,7 @@ void megaduck_rom_device::device_reset() m_ram_bank = 0; m_latch_bank = 0; m_latch_bank2 = 1; - + has_rumble = FALSE; has_timer = FALSE; has_battery = FALSE; diff --git a/src/mess/machine/gb_rom.h b/src/mess/machine/gb_rom.h index 1953824b584..66cb2bb4b68 100644 --- a/src/mess/machine/gb_rom.h +++ b/src/mess/machine/gb_rom.h @@ -18,10 +18,10 @@ public: virtual void device_start() { shared_start(); }; virtual void device_reset() { shared_reset(); }; virtual void device_config_complete() { m_shortname = "gb_rom"; } - + void shared_start(); void shared_reset(); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ8_MEMBER(read_ram); @@ -131,7 +131,7 @@ public: virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "megaduck_rom"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); diff --git a/src/mess/machine/gb_slot.c b/src/mess/machine/gb_slot.c index 122c9425536..c136f97f966 100644 --- a/src/mess/machine/gb_slot.c +++ b/src/mess/machine/gb_slot.c @@ -392,7 +392,7 @@ bool base_gb_cart_slot_device::call_load() if (strncmp((const char*)(ROM + 0x134), "DONKEYKONGLAND 2", 16) == 0 || strncmp((const char*)(ROM + 0x134), "DONKEYKONGLAND 3", 16) == 0) m_sgb_hack = 1; - + return IMAGE_INIT_PASS; } @@ -545,8 +545,8 @@ int base_gb_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) } if (count == 4876) { -// printf("Niutoude!\n"); -// type = GB_MBC_NIUTOUDE; +// printf("Niutoude!\n"); +// type = GB_MBC_NIUTOUDE; } if (count == 4138 || count == 4125) { @@ -556,7 +556,7 @@ int base_gb_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) type = GB_MBC_SINTAX; } } - + /* Check if we're dealing with the multigame variant of the MBC1 mapper */ if (type == GB_MBC_MBC1) { diff --git a/src/mess/machine/gb_slot.h b/src/mess/machine/gb_slot.h index b0915de5901..fe7ff000afa 100644 --- a/src/mess/machine/gb_slot.h +++ b/src/mess/machine/gb_slot.h @@ -147,7 +147,7 @@ public: virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); - + protected: // Donkey Kong Land 2 + 3 store SGB border tiles differently... this will be hopefully be removed when SGB is properly emulated! int m_sgb_hack; diff --git a/src/mess/machine/isa_com.c b/src/mess/machine/isa_com.c index ee3b438045e..c6e35ea6216 100644 --- a/src/mess/machine/isa_com.c +++ b/src/mess/machine/isa_com.c @@ -29,22 +29,22 @@ static const ins8250_interface genpc_com_interface[2]= DEVCB_NULL, DEVCB_NULL }/*, - { - DEVCB_DEVICE_LINE_MEMBER("serport2", serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, dtr_w), - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, rts_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_1), - DEVCB_NULL, - DEVCB_NULL - }, - { - DEVCB_DEVICE_LINE_MEMBER("serport3", serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, dtr_w), - DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, rts_w), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_2), - DEVCB_NULL, - DEVCB_NULL - }*/ + { + DEVCB_DEVICE_LINE_MEMBER("serport2", serial_port_device, tx), + DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, dtr_w), + DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, rts_w), + DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_1), + DEVCB_NULL, + DEVCB_NULL + }, + { + DEVCB_DEVICE_LINE_MEMBER("serport3", serial_port_device, tx), + DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, dtr_w), + DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, rts_w), + DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_2), + DEVCB_NULL, + DEVCB_NULL + }*/ }; static const rs232_port_interface serport_config[2] = @@ -63,20 +63,20 @@ static const rs232_port_interface serport_config[2] = DEVCB_DEVICE_LINE_MEMBER("uart_1", ins8250_uart_device, ri_w), DEVCB_DEVICE_LINE_MEMBER("uart_1", ins8250_uart_device, cts_w) }/*, - { - DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, rx_w), - DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, dcd_w), - DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, dsr_w), - DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, ri_w), - DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, cts_w) - }, - { - DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, rx_w), - DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, dcd_w), - DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, dsr_w), - DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, ri_w), - DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, cts_w) - }*/ + { + DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, rx_w), + DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, dcd_w), + DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, dsr_w), + DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, ri_w), + DEVCB_DEVICE_LINE_MEMBER("uart_2", ins8250_uart_device, cts_w) + }, + { + DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, rx_w), + DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, dcd_w), + DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, dsr_w), + DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, ri_w), + DEVCB_DEVICE_LINE_MEMBER("uart_3", ins8250_uart_device, cts_w) + }*/ }; static SLOT_INTERFACE_START(isa_com) @@ -143,8 +143,8 @@ void isa8_com_device::device_start() set_isa_device(); m_isa->install_device(0x03f8, 0x03ff, 0, 0, read8_delegate(FUNC(ins8250_device::ins8250_r), subdevice<ins8250_uart_device>("uart_0")), write8_delegate(FUNC(ins8250_device::ins8250_w), subdevice<ins8250_uart_device>("uart_0")) ); m_isa->install_device(0x02f8, 0x02ff, 0, 0, read8_delegate(FUNC(ins8250_device::ins8250_r), subdevice<ins8250_uart_device>("uart_1")), write8_delegate(FUNC(ins8250_device::ins8250_w), subdevice<ins8250_uart_device>("uart_1")) ); -// m_isa->install_device(0x03e8, 0x03ef, 0, 0, read8_delegate(FUNC(ins8250_device::ins8250_r), subdevice<ins8250_uart_device>("uart_2")), write8_delegate(FUNC(ins8250_device::ins8250_w), subdevice<ins8250_uart_device>("uart_2")) ); -// m_isa->install_device(0x02e8, 0x02ef, 0, 0, read8_delegate(FUNC(ins8250_device::ins8250_r), subdevice<ins8250_uart_device>("uart_3")), write8_delegate(FUNC(ins8250_device::ins8250_w), subdevice<ins8250_uart_device>("uart_3")) ); +// m_isa->install_device(0x03e8, 0x03ef, 0, 0, read8_delegate(FUNC(ins8250_device::ins8250_r), subdevice<ins8250_uart_device>("uart_2")), write8_delegate(FUNC(ins8250_device::ins8250_w), subdevice<ins8250_uart_device>("uart_2")) ); +// m_isa->install_device(0x02e8, 0x02ef, 0, 0, read8_delegate(FUNC(ins8250_device::ins8250_r), subdevice<ins8250_uart_device>("uart_3")), write8_delegate(FUNC(ins8250_device::ins8250_w), subdevice<ins8250_uart_device>("uart_3")) ); } //------------------------------------------------- @@ -158,12 +158,12 @@ void isa8_com_device::device_reset() static MACHINE_CONFIG_FRAGMENT( com_at_config ) MCFG_NS16450_ADD( "uart_0", genpc_com_interface[0], XTAL_1_8432MHz ) /* Verified: IBM P/N 6320947 Serial/Parallel card uses an NS16450N */ MCFG_NS16450_ADD( "uart_1", genpc_com_interface[1], XTAL_1_8432MHz ) -// MCFG_NS16450_ADD( "uart_2", genpc_com_interface[2], XTAL_1_8432MHz ) -// MCFG_NS16450_ADD( "uart_3", genpc_com_interface[3], XTAL_1_8432MHz ) +// MCFG_NS16450_ADD( "uart_2", genpc_com_interface[2], XTAL_1_8432MHz ) +// MCFG_NS16450_ADD( "uart_3", genpc_com_interface[3], XTAL_1_8432MHz ) MCFG_RS232_PORT_ADD( "serport0", serport_config[0], isa_com, "microsoft_mouse", NULL ) MCFG_RS232_PORT_ADD( "serport1", serport_config[1], isa_com, NULL, NULL ) -// MCFG_RS232_PORT_ADD( "serport2", serport_config[2], isa_com, NULL, NULL ) -// MCFG_RS232_PORT_ADD( "serport3", serport_config[3], isa_com, NULL, NULL ) +// MCFG_RS232_PORT_ADD( "serport2", serport_config[2], isa_com, NULL, NULL ) +// MCFG_RS232_PORT_ADD( "serport3", serport_config[3], isa_com, NULL, NULL ) MACHINE_CONFIG_END //************************************************************************** diff --git a/src/mess/machine/kc_rom.h b/src/mess/machine/kc_rom.h index 1149ca44f4f..1bf555ac9d5 100644 --- a/src/mess/machine/kc_rom.h +++ b/src/mess/machine/kc_rom.h @@ -29,7 +29,7 @@ protected: virtual void device_reset(); virtual void device_config_complete() { m_shortname = "kc_8k"; } virtual const rom_entry *device_rom_region() const; - + // kcexp_interface overrides virtual UINT8 module_id_r() { return 0xfb; } virtual void control_w(UINT8 data); diff --git a/src/mess/machine/mbee.c b/src/mess/machine/mbee.c index 0618f542cd9..739a93f0fee 100644 --- a/src/mess/machine/mbee.c +++ b/src/mess/machine/mbee.c @@ -853,4 +853,4 @@ QUICKLOAD_LOAD( mbee_z80bin ) } return IMAGE_INIT_PASS; -}
\ No newline at end of file +} diff --git a/src/mess/machine/md_rom.c b/src/mess/machine/md_rom.c index 96bcc2dd742..fcee9a946d5 100644 --- a/src/mess/machine/md_rom.c +++ b/src/mess/machine/md_rom.c @@ -764,7 +764,7 @@ WRITE16_MEMBER(md_rom_lion3_device::write) { if (offset >= 0x600000/2 && offset < 0x700000/2) { -// printf("protection write, offset %d data %d\n", offset & 0x7, data); +// printf("protection write, offset %d data %d\n", offset & 0x7, data); switch (offset & 0x7) { case 0x0: @@ -802,7 +802,7 @@ WRITE16_MEMBER(md_rom_lion3_device::write) | (BIT(m_reg[0], 0) << 7); break; } - + } if (offset >= 0x700000/2) m_bank = data & 0xff; @@ -974,7 +974,7 @@ READ16_MEMBER(md_rom_smw64_device::read) { // 0x000000-0x0fffff: lower 512KB ROM (up to 0x07ffff) + mirror // 0x600000-0x6fffff: internal hardware (up to 0x67ffff) + mirror - // Namely, + // Namely, // * 60xxx = bank1 of the upper 512KB ROM // * 61xxx = bank2 of the upper 512KB ROM // * 62xxx = alternate 4KB chunks of 0x0000 ~ 0xffff @@ -1004,30 +1004,30 @@ READ16_MEMBER(md_rom_smw64_device::read) case 0x0: case 0x2: case 0x4: - return m_reg[offset/2]; // DATA1, DATA2, DATA3 + return m_reg[offset/2]; // DATA1, DATA2, DATA3 case 0x1: case 0x3: case 0x5: - return m_reg[offset/2] + 1; // DATA1+1, DATA2+1, DATA3+1 + return m_reg[offset/2] + 1; // DATA1+1, DATA2+1, DATA3+1 case 0x6: - return m_reg[2] + 2; // DATA3+2 + return m_reg[2] + 2; // DATA3+2 case 0x7: - return m_reg[2] + 3; // DATA3+3 + return m_reg[2] + 3; // DATA3+3 } } if ((offset >= 0x670000/2) && (offset < 0x680000/2)) { UINT16 data = (m_ctrl[1] & 0x80) ? ((m_ctrl[2] & 0x40) ? (m_reg[4] & m_reg[5]) : (m_reg[4] ^ 0xff)) : 0x0000; - if (offset & 0x1) // odd offset, return lower 7 bits of the above + if (offset & 0x1) // odd offset, return lower 7 bits of the above return data & 0x7f; - else // even offset, return whole data above, but also update the regs if CTRL3 has 0x80 set + else // even offset, return whole data above, but also update the regs if CTRL3 has 0x80 set { - if (m_ctrl[2] & 0x80) // update regs if CTRL3 has bit7 set + if (m_ctrl[2] & 0x80) // update regs if CTRL3 has bit7 set { if (m_ctrl[2] & 0x20) - m_reg[2] = (m_reg[5] << 2) & 0xfc; // DATA3 + m_reg[2] = (m_reg[5] << 2) & 0xfc; // DATA3 else - m_reg[0] = ((m_reg[4] << 1) ^ m_reg[3]) & 0xfe; // DATA1 + m_reg[0] = ((m_reg[4] << 1) ^ m_reg[3]) & 0xfe; // DATA1 } return data; } @@ -1038,7 +1038,7 @@ READ16_MEMBER(md_rom_smw64_device::read) WRITE16_MEMBER(md_rom_smw64_device::write) { // 0x600000-0x6fffff: internal hardware (up to 0x67ffff) + mirror - // Namely, + // Namely, // * 62xxx/63xxx = unknown/unmapped // * 65xxx/66xxx = unknown/unmapped // * remaining ranges = CTRL/DATA @@ -1047,35 +1047,35 @@ WRITE16_MEMBER(md_rom_smw64_device::write) if (offset & 1) { if ((m_ctrl[0] & 7) == 0) - m_reg[0] = ((m_reg[0] ^ m_reg[3]) ^ data) & 0xfe; // DATA1 + m_reg[0] = ((m_reg[0] ^ m_reg[3]) ^ data) & 0xfe; // DATA1 if ((m_ctrl[0] & 7) == 1) - m_reg[1] = data & 0xfe; // DATA2 + m_reg[1] = data & 0xfe; // DATA2 if ((m_ctrl[0] & 7) == 7) - m_latch1 = 8 + ((data & 0x1c) >> 2); // ROM BANKSWITCH $61 - m_reg[3] = data; // DATA4 + m_latch1 = 8 + ((data & 0x1c) >> 2); // ROM BANKSWITCH $61 + m_reg[3] = data; // DATA4 } else - m_ctrl[0] = data; // CTRL1 + m_ctrl[0] = data; // CTRL1 } if ((offset >= 0x610000/2) && (offset < 0x620000/2)) { if (offset & 1) - m_ctrl[1] = data; // CTRL2 + m_ctrl[1] = data; // CTRL2 } if ((offset >= 0x640000/2) && (offset < 0x650000/2)) { if (offset & 1) - m_reg[5] = data; // DATA6 + m_reg[5] = data; // DATA6 else - m_reg[4] = data; // DATA5 + m_reg[4] = data; // DATA5 } if ((offset >= 0x670000/2) && (offset < 0x680000/2)) { if (!(offset & 1)) { - m_ctrl[2] = data; // CTRL3 + m_ctrl[2] = data; // CTRL3 if (m_ctrl[1] & 0x80) - m_latch0 = 8 + ((data & 0x1c) >> 2); // ROM BANKSWITCH $60 + m_latch0 = 8 + ((data & 0x1c) >> 2); // ROM BANKSWITCH $60 } } } @@ -1174,12 +1174,12 @@ READ16_MEMBER(md_rom_radica_device::read_a13) /*------------------------------------------------- BEGGAR PRINCE - This game uses cart which is the same as SEGA_SRAM + This game uses cart which is the same as SEGA_SRAM + bankswitch mechanism for first 256KB of the image: depending on bit7 of the value written at 0xe00/2, - accesses to 0x00000-0x3ffff go to the first 256KB + accesses to 0x00000-0x3ffff go to the first 256KB of ROM, or to the second to last 256KB chunk (usually - mapped to 0x380000-0x3bffff). SRAM is mapped at + mapped to 0x380000-0x3bffff). SRAM is mapped at the end of ROM. -------------------------------------------------*/ @@ -1199,7 +1199,7 @@ READ16_MEMBER(md_rom_beggarp_device::read) WRITE16_MEMBER(md_rom_beggarp_device::write) { if (offset >= 0x0e00/2 && offset < 0x0f00/2) - m_mode = BIT(data, 7); + m_mode = BIT(data, 7); if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active && !m_nvram_readonly) m_nvram[offset & 0x3fff] = data; @@ -1212,7 +1212,7 @@ WRITE16_MEMBER(md_rom_beggarp_device::write_a13) /* unsure if this is actually supposed to toggle or just switch on? yet to encounter game that uses this */ m_nvram_active = BIT(data, 0); m_nvram_readonly = BIT(data, 1); - + // since a lot of generic carts ends up here if loaded from fullpath // we turn on nvram (with m_nvram_handlers_installed) only if they toggle it on by writing here! if (m_nvram_active) @@ -1221,11 +1221,11 @@ WRITE16_MEMBER(md_rom_beggarp_device::write_a13) } /*------------------------------------------------- - LEGEND OF WUKONG - This game uses cart which is the same as SEGA_SRAM + LEGEND OF WUKONG + This game uses cart which is the same as SEGA_SRAM + bankswitch mechanism for last 128KB of the image: first 2MB of ROM is loaded in 0-0x200000 and - mirrored in 0x200000-0x400000, but depending on + mirrored in 0x200000-0x400000, but depending on bit7 of the value written at 0xe00/2 accesses to 0x200000-0x21ffff go either to the "physical" address (i.e. last 128K of ROM) or to the "memory" address @@ -1238,7 +1238,7 @@ READ16_MEMBER(md_rom_wukong_device::read) return m_nvram[offset - m_nvram_start/2]; // here can access both last 128K of the ROM and the first 128K, depending of bit7 of m_mode - if (offset >= 0x200000/2 && offset < 0x220000/2) + if (offset >= 0x200000/2 && offset < 0x220000/2) return !m_mode ? m_rom[offset] : m_rom[offset & 0xffff]; else if (offset < 0x400000/2) return m_rom[offset & 0xfffff]; @@ -1248,7 +1248,7 @@ READ16_MEMBER(md_rom_wukong_device::read) WRITE16_MEMBER(md_rom_wukong_device::write) { - if (offset < 0x100000/2) // it actually writes to 0xe00/2 + if (offset < 0x100000/2) // it actually writes to 0xe00/2 m_mode = BIT(data, 7); if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active && !m_nvram_readonly) @@ -1262,11 +1262,10 @@ WRITE16_MEMBER(md_rom_wukong_device::write_a13) /* unsure if this is actually supposed to toggle or just switch on? yet to encounter game that uses this */ m_nvram_active = BIT(data, 0); m_nvram_readonly = BIT(data, 1); - + // since a lot of generic carts ends up here if loaded from fullpath // we turn on nvram (with m_nvram_handlers_installed) only if they toggle it on by writing here! if (m_nvram_active) m_nvram_handlers_installed = 1; } } - diff --git a/src/mess/machine/md_rom.h b/src/mess/machine/md_rom.h index 08a7041c2fa..cbae06b70cd 100644 --- a/src/mess/machine/md_rom.h +++ b/src/mess/machine/md_rom.h @@ -90,15 +90,15 @@ class md_rom_cm2in1_device : public md_std_rom_device public: // construction/destruction md_rom_cm2in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "md_rom_cm2in1"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); - + private: int m_base; }; @@ -287,10 +287,10 @@ class md_rom_pokea_device : public md_std_rom_device public: // construction/destruction md_rom_pokea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_pokea"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read_a13); }; @@ -419,16 +419,16 @@ class md_rom_smw64_device : public md_std_rom_device public: // construction/destruction md_rom_smw64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "md_rom_smw64"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: UINT32 m_latch0, m_latch1; UINT16 m_reg[6]; @@ -537,12 +537,12 @@ class md_rom_beggarp_device : public md_std_rom_device public: // construction/destruction md_rom_beggarp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "md_rom_beggarp"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -559,17 +559,17 @@ class md_rom_wukong_device : public md_std_rom_device public: // construction/destruction md_rom_wukong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "md_rom_wukong"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); virtual DECLARE_WRITE16_MEMBER(write_a13); - + private: UINT8 m_mode; }; diff --git a/src/mess/machine/md_slot.c b/src/mess/machine/md_slot.c index b6a3a4d9950..0f83aac451b 100644 --- a/src/mess/machine/md_slot.c +++ b/src/mess/machine/md_slot.c @@ -640,7 +640,7 @@ void base_md_cart_slot_device::setup_nvram() case BEGGARP: m_cart->m_nvram_start = 0x400000; m_cart->m_nvram_end = m_cart->m_nvram_start + 0xffff; - m_cart->nvram_alloc(machine(), 0x8000); // 32K mirrored + m_cart->nvram_alloc(machine(), 0x8000); // 32K mirrored m_cart->m_nvram_active = 1; break; case WUKONG: diff --git a/src/mess/machine/md_slot.h b/src/mess/machine/md_slot.h index 40700fce9fa..a49c17ec121 100644 --- a/src/mess/machine/md_slot.h +++ b/src/mess/machine/md_slot.h @@ -162,11 +162,11 @@ public: // slot interface overrides virtual const char * get_default_card_software(const machine_config &config, emu_options &options); - + int load_list(); int load_nonlist(); int get_cart_type(UINT8 *ROM, UINT32 len); - + void setup_custom_mappers(); void setup_nvram(); void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } @@ -182,7 +182,7 @@ public: // TODO: this only needs to be public because megasvp copies rom into memory region, so we need to rework that code... //private: - + int m_type; device_md_cart_interface* m_cart; bool m_must_be_loaded; diff --git a/src/mess/machine/ncr5380n.c b/src/mess/machine/ncr5380n.c index 0d595877c28..e54a469949a 100644 --- a/src/mess/machine/ncr5380n.c +++ b/src/mess/machine/ncr5380n.c @@ -3,11 +3,11 @@ ncr5380n.c Implementation of the NCR 5380, aka the Zilog Z5380 - + TODO: - IRQs (Apple doesn't use 'em) - Target mode - + *********************************************************************/ #include "emu.h" @@ -93,7 +93,7 @@ void ncr5380n_device::device_config_complete() void ncr5380n_device::reset_soft() { state = IDLE; - scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); // clear any signals we're driving + scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); // clear any signals we're driving scsi_bus->ctrl_wait(scsi_refid, S_ALL, S_ALL); status = 0; drq = false; @@ -113,13 +113,13 @@ void ncr5380n_device::scsi_ctrl_changed() { UINT32 ctrl = scsi_bus->ctrl_r(); -// printf("scsi_ctrl_changed: lines now %x\n", ctrl); +// printf("scsi_ctrl_changed: lines now %x\n", ctrl); -/* if ((ctrl & (S_PHASE_MASK|S_SEL|S_BSY)) != last_phase) - { - printf("phase now %d, SEL %x BSY %x\n", ctrl & S_PHASE_MASK, ctrl & S_SEL, ctrl & S_BSY); - last_phase = (S_PHASE_MASK|S_SEL|S_BSY); - }*/ +/* if ((ctrl & (S_PHASE_MASK|S_SEL|S_BSY)) != last_phase) + { + printf("phase now %d, SEL %x BSY %x\n", ctrl & S_PHASE_MASK, ctrl & S_SEL, ctrl & S_BSY); + last_phase = (S_PHASE_MASK|S_SEL|S_BSY); + }*/ // recalculate phase match m_busstatus &= ~BAS_PHASEMATCH; @@ -133,7 +133,7 @@ void ncr5380n_device::scsi_ctrl_changed() // if BSY drops or the phase goes mismatch, that terminates the DMA if ((!(ctrl & S_BSY)) || !(m_busstatus & BAS_PHASEMATCH)) { -// printf("BSY dropped or phase mismatch during DMA, ending DMA\n"); +// printf("BSY dropped or phase mismatch during DMA, ending DMA\n"); m_mode &= ~MODE_DMA; m_busstatus |= BAS_ENDOFDMA; drq_clear(); @@ -178,7 +178,7 @@ void ncr5380n_device::step(bool timeout) int win; for(win=7; win>=0 && !(data & (1<<win)); win--); -// printf("data %02x win %02x scsi_id %02x\n", data, win, scsi_id); +// printf("data %02x win %02x scsi_id %02x\n", data, win, scsi_id); if(win != scsi_id) { scsi_bus->data_w(scsi_refid, 0); scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); @@ -270,21 +270,21 @@ void ncr5380n_device::recv_byte() void ncr5380n_device::function_bus_complete() { state = IDLE; -// istatus |= I_FUNCTION|I_BUS; +// istatus |= I_FUNCTION|I_BUS; check_irq(); } void ncr5380n_device::function_complete() { state = IDLE; -// istatus |= I_FUNCTION; +// istatus |= I_FUNCTION; check_irq(); } void ncr5380n_device::bus_complete() { state = IDLE; -// istatus |= I_BUS; +// istatus |= I_BUS; check_irq(); } @@ -327,7 +327,7 @@ WRITE8_MEMBER(ncr5380n_device::icmd_w) // asserting to drive the data bus? if ((data & IC_DBUS) && !(m_icommand & IC_DBUS)) { -// printf("%s: driving data bus with %02x\n", tag(), m_outdata); +// printf("%s: driving data bus with %02x\n", tag(), m_outdata); scsi_bus->data_w(scsi_refid, m_outdata); delay(2); } @@ -345,7 +345,7 @@ WRITE8_MEMBER(ncr5380n_device::icmd_w) (data & IC_SEL ? S_SEL : 0) | (data & IC_ATN ? S_ATN : 0); -// printf("%s: changing control lines %04x\n", tag(), newdata); +// printf("%s: changing control lines %04x\n", tag(), newdata); scsi_bus->ctrl_w(scsi_refid, newdata, S_RST|S_ACK|S_BSY|S_SEL|S_ATN); } @@ -360,22 +360,22 @@ READ8_MEMBER(ncr5380n_device::mode_r) WRITE8_MEMBER(ncr5380n_device::mode_w) { -// printf("%s: mode_w %02x (%08x)\n", tag(), data, space.device().safe_pc()); +// printf("%s: mode_w %02x (%08x)\n", tag(), data, space.device().safe_pc()); // arbitration bit being set? if ((data & MODE_ARBITRATE) && !(m_mode & MODE_ARBITRATE)) { - // if SEL is selected and the assert SEL bit in the initiator + // if SEL is selected and the assert SEL bit in the initiator // command register is clear, fail if ((scsi_bus->ctrl_r() & S_SEL) && !(m_icommand & IC_SEL)) { -// printf("arbitration lost, ctrl = %x, m_icommand&IC_SEL = %x\n", scsi_bus->ctrl_r(), m_icommand & IC_SEL); +// printf("arbitration lost, ctrl = %x, m_icommand&IC_SEL = %x\n", scsi_bus->ctrl_r(), m_icommand & IC_SEL); m_icommand &= ~IC_ARBITRATION; m_icommand |= IC_ARBLOST; } else { seq = 0; -// state = DISC_SEL_ARBITRATION; +// state = DISC_SEL_ARBITRATION; arbitrate(); } } @@ -385,13 +385,13 @@ WRITE8_MEMBER(ncr5380n_device::mode_w) READ8_MEMBER(ncr5380n_device::command_r) { -// logerror("%s: command_r %02x (%08x)\n", tag(), m_tcommand, space.device().safe_pc()); +// logerror("%s: command_r %02x (%08x)\n", tag(), m_tcommand, space.device().safe_pc()); return m_tcommand; } WRITE8_MEMBER(ncr5380n_device::command_w) { -// printf("%s: command_w %02x (%08x)\n", tag(), data, space.device().safe_pc()); +// printf("%s: command_w %02x (%08x)\n", tag(), data, space.device().safe_pc()); m_tcommand = data; // recalculate phase match @@ -425,7 +425,7 @@ void ncr5380n_device::check_irq() READ8_MEMBER(ncr5380n_device::status_r) { UINT32 ctrl = scsi_bus->ctrl_r(); - UINT8 res = status | + UINT8 res = status | (ctrl & S_RST ? ST_RST : 0) | (ctrl & S_BSY ? ST_BSY : 0) | (ctrl & S_REQ ? ST_REQ : 0) | @@ -434,7 +434,7 @@ READ8_MEMBER(ncr5380n_device::status_r) (ctrl & S_INP ? ST_IO : 0) | (ctrl & S_SEL ? ST_SEL : 0); -// printf("%s: status_r %02x (%08x)\n", tag(), res, space.device().safe_pc()); +// printf("%s: status_r %02x (%08x)\n", tag(), res, space.device().safe_pc()); return res; } @@ -449,7 +449,7 @@ READ8_MEMBER(ncr5380n_device::busandstatus_r) (ctrl & S_ATN ? BAS_ATN : 0) | (ctrl & S_ACK ? BAS_ACK : 0); -// printf("%s: busandstatus_r %02x (%08x)\n", tag(), res, space.device().safe_pc()); +// printf("%s: busandstatus_r %02x (%08x)\n", tag(), res, space.device().safe_pc()); return res; } @@ -477,7 +477,7 @@ READ8_MEMBER(ncr5380n_device::resetparityirq_r) WRITE8_MEMBER(ncr5380n_device::startdmainitrx_w) { -// printf("%02x to start dma initiator Rx\n", data); +// printf("%02x to start dma initiator Rx\n", data); recv_byte(); } @@ -509,7 +509,7 @@ UINT8 ncr5380n_device::dma_r() void ncr5380n_device::drq_set() { - if(!drq) + if(!drq) { drq = true; m_busstatus |= BAS_DMAREQUEST; @@ -520,7 +520,7 @@ void ncr5380n_device::drq_set() void ncr5380n_device::drq_clear() { - if(drq) + if(drq) { drq = false; m_busstatus &= ~BAS_DMAREQUEST; @@ -598,4 +598,3 @@ WRITE8_MEMBER(ncr5380n_device::write) break; } } - diff --git a/src/mess/machine/ncr5380n.h b/src/mess/machine/ncr5380n.h index 68ad91b9e87..43675e9838a 100644 --- a/src/mess/machine/ncr5380n.h +++ b/src/mess/machine/ncr5380n.h @@ -142,7 +142,7 @@ private: enum { BUS_BUSY, BUS_FREE_WAIT, BUS_FREE }; enum { - ST_RST = 0x80, + ST_RST = 0x80, ST_BSY = 0x40, ST_REQ = 0x20, ST_MSG = 0x10, @@ -151,7 +151,7 @@ private: ST_SEL = 0x02, ST_DBP = 0x01, - BAS_ENDOFDMA = 0x80, + BAS_ENDOFDMA = 0x80, BAS_DMAREQUEST = 0x40, BAS_PARITYERROR = 0x20, BAS_IRQACTIVE = 0x10, @@ -160,25 +160,25 @@ private: BAS_ATN = 0x02, BAS_ACK = 0x01, - IC_RST = 0x80, - IC_ARBITRATION = 0x40, - IC_ARBLOST = 0x20, - IC_ACK = 0x10, - IC_BSY = 0x08, - IC_SEL = 0x04, - IC_ATN = 0x02, - IC_DBUS = 0x01, - IC_PHASEMASK = 0x9e, - IC_WRITEMASK = 0x9f, - - MODE_BLOCKDMA = 0x80, - MODE_TARGET = 0x40, - MODE_PARITYCHK = 0x20, - MODE_PARITYIRQ = 0x10, - MODE_EOPIRQ = 0x08, - MODE_BSYIRQ = 0x04, - MODE_DMA = 0x02, - MODE_ARBITRATE = 0x01, + IC_RST = 0x80, + IC_ARBITRATION = 0x40, + IC_ARBLOST = 0x20, + IC_ACK = 0x10, + IC_BSY = 0x08, + IC_SEL = 0x04, + IC_ATN = 0x02, + IC_DBUS = 0x01, + IC_PHASEMASK = 0x9e, + IC_WRITEMASK = 0x9f, + + MODE_BLOCKDMA = 0x80, + MODE_TARGET = 0x40, + MODE_PARITYCHK = 0x20, + MODE_PARITYIRQ = 0x10, + MODE_EOPIRQ = 0x08, + MODE_BSYIRQ = 0x04, + MODE_DMA = 0x02, + MODE_ARBITRATE = 0x01, }; enum { DMA_NONE, DMA_IN, DMA_OUT }; diff --git a/src/mess/machine/ne1000.c b/src/mess/machine/ne1000.c index 71abec95905..4fcce641d5d 100644 --- a/src/mess/machine/ne1000.c +++ b/src/mess/machine/ne1000.c @@ -131,4 +131,3 @@ ioport_constructor ne1000_device::device_input_ports() const { return INPUT_PORTS_NAME(ne1000); } - diff --git a/src/mess/machine/nes_slot.c b/src/mess/machine/nes_slot.c index 4f66fb6382c..a7b41927894 100644 --- a/src/mess/machine/nes_slot.c +++ b/src/mess/machine/nes_slot.c @@ -163,12 +163,12 @@ void nes_cart_slot_device::device_start() void nes_cart_slot_device::device_config_complete() { // inherit a copy of the static data -// const nes_cart_interface *intf = reinterpret_cast<const nes_cart_interface *>(static_config()); -// if (intf != NULL) -// { -// *static_cast<nes_cart_interface *>(this) = *intf; -// } - +// const nes_cart_interface *intf = reinterpret_cast<const nes_cart_interface *>(static_config()); +// if (intf != NULL) +// { +// *static_cast<nes_cart_interface *>(this) = *intf; +// } + // set brief and instance name update_names(); } @@ -214,18 +214,18 @@ static const struct nes_cart_lines nes_cart_lines_table[] = static int nes_cart_get_line( const char *feature ) { const struct nes_cart_lines *nes_line = &nes_cart_lines_table[0]; - + if (feature == NULL) return 128; - + while (nes_line->tag) { if (strcmp(nes_line->tag, feature) == 0) break; - + nes_line++; } - + return nes_line->line; } @@ -237,51 +237,51 @@ bool nes_cart_slot_device::call_load() { if (m_cart) { - UINT32 vram_size = 0, prgram_size = 0, battery_size = 0, mapper_ram_size = 0, mapper_bram_size = 0; // helper for regions to alloc at the end + UINT32 vram_size = 0, prgram_size = 0, battery_size = 0, mapper_ram_size = 0, mapper_bram_size = 0; // helper for regions to alloc at the end if (software_entry() == NULL) { const char *mapinfo = NULL; int mapint1 = 0, mapint2 = 0, mapint3 = 0, mapint4 = 0; char magic[4]; - + /* Check first 4 bytes of the image to decide if it is UNIF or iNES */ /* Unfortunately, many .unf files have been released as .nes, so we cannot rely on extensions only */ memset(magic, '\0', sizeof(magic)); fread(magic, 4); - + if ((magic[0] == 'N') && (magic[1] == 'E') && (magic[2] == 'S')) /* If header starts with 'NES' it is iNES */ { UINT32 prg_size, vrom_size; UINT8 header[0x10]; UINT8 mapper, local_options; bool ines20 = FALSE, has_trainer = FALSE, prg16k; - + // check if the image is recognized by nes.hsi mapinfo = hashfile_extrainfo(*this); - + // image_extrainfo() resets the file position back to start. fseek(0, SEEK_SET); // read out the header fread(&header, 0x10); - + // SETUP step 1: getting PRG, VROM, VRAM sizes prg16k = (header[4] == 1); prg_size = prg16k ? 2 * 0x4000 : header[4] * 0x4000; vrom_size = header[5] * 0x2000; vram_size = 0x4000; - + // SETUP step 2: getting PCB and other settings mapper = (header[6] & 0xf0) >> 4; local_options = header[6] & 0x0f; - + switch (header[7] & 0xc) { case 0x4: case 0xc: // probably the header got corrupted: don't trust upper bits for mapper break; - + case 0x8: // it's iNES 2.0 format ines20 = TRUE; case 0x0: @@ -289,7 +289,7 @@ bool nes_cart_slot_device::call_load() mapper |= header[7] & 0xf0; break; } - + // use info from nes.hsi if available! if (mapinfo) { @@ -313,7 +313,7 @@ bool nes_cart_slot_device::call_load() { logerror("NES: No extrainfo found\n"); } - + // use extended iNES2.0 info if available! if (ines20) { @@ -322,7 +322,7 @@ bool nes_cart_slot_device::call_load() prg_size += ((header[9] & 0x0f) << 8) * 0x4000; vrom_size += ((header[9] & 0xf0) << 4) * 0x2000; } - + // SETUP step 3: storing the info needed for emulation m_pcb_id = nes_get_mmc_id(machine(), mapper); m_cart->set_mirroring(BIT(local_options, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); @@ -330,7 +330,7 @@ bool nes_cart_slot_device::call_load() battery_size = NES_BATTERY_SIZE; // with original iNES format we can only support 8K WRAM battery has_trainer = BIT(local_options, 2) ? TRUE : FALSE; m_cart->set_four_screen_vram(BIT(local_options, 3)); - + if (ines20) { // PRGRAM/BWRAM (not fully supported, also due to lack of 2.0 files) @@ -353,7 +353,7 @@ bool nes_cart_slot_device::call_load() // so its size has been added recently to the iNES format spec, but almost no image uses it prgram_size = header[8] ? header[8] * 0x2000 : 0x2000; } - + // a few mappers correspond to multiple PCBs, so we need a few additional checks and tweaks switch (m_pcb_id) { @@ -485,7 +485,7 @@ bool nes_cart_slot_device::call_load() break; //FIXME: we also have to fix Action 52 PRG loading somewhere... } - + // SETUP step 4: logging what we have found if (!ines20) { @@ -516,17 +516,17 @@ bool nes_cart_slot_device::call_load() logerror("-- CHR WRAM: %d\n", (header[11] & 0xf0) >> 4); logerror("-- TV System: %s\n", (header[12] & 2) ? "Both NTSC and PAL" : (header[12] & 1) ? "PAL" : "NTSC"); } - + // SETUP step 5: allocate pointers for PRG/VROM if (prg_size) m_cart->prg_alloc(machine(), prg_size); if (vrom_size) m_cart->vrom_alloc(machine(), vrom_size); - + if (has_trainer) fread(&m_cart->m_prgram[0x1000], 0x200); - - + + // SETUP step 6: at last load the data! // Read in the program chunks if (prg16k) @@ -540,7 +540,7 @@ bool nes_cart_slot_device::call_load() { FILE *prgout; char outname[255]; - + sprintf(outname, "%s.prg", filename()); prgout = fopen(outname, "wb"); if (prgout) @@ -548,21 +548,21 @@ bool nes_cart_slot_device::call_load() fwrite(m_cart->get_prg_base(), 1, 0x4000 * m_cart->get_prg_size(), prgout); mame_printf_error("Created PRG chunk\n"); } - + fclose(prgout); } #endif - + // Read in any chr chunks if (m_cart->get_vrom_size()) fread(m_cart->get_vrom_base(), m_cart->get_vrom_size()); - + #if SPLIT_CHR if (state->m_chr_chunks > 0) { FILE *chrout; char outname[255]; - + sprintf(outname, "%s.chr", filename()); chrout= fopen(outname, "wb"); if (chrout) @@ -584,29 +584,29 @@ bool nes_cart_slot_device::call_load() char magic2[4]; char unif_mapr[32]; // here we should store MAPR chunks bool mapr_chunk_found = FALSE, small_prg = FALSE; - + // allocate space to temporarily store PRG & CHR banks UINT8 *temp_prg = auto_alloc_array(machine(), UINT8, 256 * 0x4000); UINT8 *temp_chr = auto_alloc_array(machine(), UINT8, 256 * 0x2000); UINT8 temp_byte = 0; - + fread(&buffer, 4); unif_ver = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); logerror("Loaded game in UNIF format, version %d\n", unif_ver); - + if (size <= 0x20) { logerror("%s only contains the UNIF header and no data.\n", filename()); return IMAGE_INIT_FAIL; } - + do { fseek(read_length, SEEK_SET); - + memset(magic2, '\0', sizeof(magic2)); fread(&magic2, 4); - + /* We first run through the whole image to find a [MAPR] chunk. This is needed because, unfortunately, the MAPR chunk is not always the first chunk (see Super 24-in-1). When such a chunk is found, we set mapr_chunk_found=1 and @@ -619,11 +619,11 @@ bool nes_cart_slot_device::call_load() logerror("[MAPR] chunk found: "); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + if (chunk_length <= 0x20) fread(&unif_mapr, chunk_length); logerror("%s\n", unif_mapr); - + /* now that we found the MAPR chunk, we can go back to load other chunks */ fseek(0x20, SEEK_SET); read_length = 0x20; @@ -633,7 +633,7 @@ bool nes_cart_slot_device::call_load() logerror("Skip this chunk. We need a [MAPR] chunk before anything else.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } } @@ -647,7 +647,7 @@ bool nes_cart_slot_device::call_load() logerror("[MAPR] chunk found (in the 2nd run). Already loaded.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'R') && (magic2[1] == 'E') && (magic2[2] == 'A') && (magic2[3] == 'D')) @@ -655,7 +655,7 @@ bool nes_cart_slot_device::call_load() logerror("[READ] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'N') && (magic2[1] == 'A') && (magic2[2] == 'M') && (magic2[3] == 'E')) @@ -663,7 +663,7 @@ bool nes_cart_slot_device::call_load() logerror("[NAME] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'W') && (magic2[1] == 'R') && (magic2[2] == 'T') && (magic2[3] == 'R')) @@ -671,7 +671,7 @@ bool nes_cart_slot_device::call_load() logerror("[WRTR] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'T') && (magic2[1] == 'V') && (magic2[2] == 'C') && (magic2[3] == 'I')) @@ -679,10 +679,10 @@ bool nes_cart_slot_device::call_load() logerror("[TVCI] chunk found.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + fread(&temp_byte, 1); logerror("Television Standard : %s\n", (temp_byte == 0) ? "NTSC" : (temp_byte == 1) ? "PAL" : "Does not matter"); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'T') && (magic2[1] == 'V') && (magic2[2] == 'S') && (magic2[3] == 'C')) // is this the same as TVCI?? @@ -690,7 +690,7 @@ bool nes_cart_slot_device::call_load() logerror("[TVSC] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'D') && (magic2[1] == 'I') && (magic2[2] == 'N') && (magic2[3] == 'F')) @@ -698,7 +698,7 @@ bool nes_cart_slot_device::call_load() logerror("[DINF] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'C') && (magic2[1] == 'T') && (magic2[2] == 'R') && (magic2[3] == 'L')) @@ -706,7 +706,7 @@ bool nes_cart_slot_device::call_load() logerror("[CTRL] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'B') && (magic2[1] == 'A') && (magic2[2] == 'T') && (magic2[3] == 'R')) @@ -714,7 +714,7 @@ bool nes_cart_slot_device::call_load() logerror("[BATR] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'V') && (magic2[1] == 'R') && (magic2[2] == 'O') && (magic2[3] == 'R')) @@ -722,7 +722,7 @@ bool nes_cart_slot_device::call_load() logerror("[VROR] chunk found. No support yet.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'M') && (magic2[1] == 'I') && (magic2[2] == 'R') && (magic2[3] == 'R')) @@ -730,9 +730,9 @@ bool nes_cart_slot_device::call_load() logerror("[MIRR] chunk found.\n"); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + fread(&mirror, 1); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'P') && (magic2[1] == 'C') && (magic2[2] == 'K')) @@ -740,7 +740,7 @@ bool nes_cart_slot_device::call_load() logerror("[PCK%c] chunk found. No support yet.\n", magic2[3]); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'C') && (magic2[1] == 'C') && (magic2[2] == 'K')) @@ -748,7 +748,7 @@ bool nes_cart_slot_device::call_load() logerror("[CCK%c] chunk found. No support yet.\n", magic2[3]); fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); - + read_length += (chunk_length + 8); } else if ((magic2[0] == 'P') && (magic2[1] == 'R') && (magic2[2] == 'G')) @@ -757,7 +757,7 @@ bool nes_cart_slot_device::call_load() fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); prg_size += chunk_length; - + if (chunk_length / 0x4000) logerror("It consists of %d 16K-blocks.\n", chunk_length / 0x4000); else @@ -765,10 +765,10 @@ bool nes_cart_slot_device::call_load() small_prg = TRUE; logerror("This chunk is smaller than 16K: the emulation might have issues. Please report this file to the MESS forums.\n"); } - + /* Read in the program chunks */ fread(&temp_prg[prg_start], chunk_length); - + prg_start += chunk_length; read_length += (chunk_length + 8); } @@ -778,12 +778,12 @@ bool nes_cart_slot_device::call_load() fread(&buffer, 4); chunk_length = buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24); vrom_size += chunk_length; - + logerror("It consists of %d 8K-blocks.\n", chunk_length / 0x2000); - + /* Read in the vrom chunks */ fread(&temp_chr[chr_start], chunk_length); - + chr_start += chunk_length; read_length += (chunk_length + 8); } @@ -794,32 +794,32 @@ bool nes_cart_slot_device::call_load() } } } while (size > read_length); - + if (!mapr_chunk_found) { auto_free(machine(), temp_prg); auto_free(machine(), temp_chr); fatalerror("UNIF should have a [MAPR] chunk to work. Check if your image has been corrupted\n"); } - + if (!prg_start) { auto_free(machine(), temp_prg); auto_free(machine(), temp_chr); fatalerror("No PRG found. Please report the problem at MESS Board.\n"); } - + // SETUP step 2: getting PCB and other settings int pcb_id = 0, battery = 0, prgram = 0, vram_chunks = 0; unif_mapr_setup(unif_mapr, &pcb_id, &battery, &prgram, &vram_chunks); - + // SETUP step 3: storing the info needed for emulation m_pcb_id = pcb_id; if (battery) battery_size = NES_BATTERY_SIZE; // we should allow for smaller battery! prgram_size = prgram * 0x2000; vram_size = vram_chunks * 0x2000; - + m_cart->set_four_screen_vram(0); switch (mirror) { @@ -849,13 +849,13 @@ bool nes_cart_slot_device::call_load() m_cart->set_mirroring(PPU_MIRROR_HORZ); break; } - + // SETUP step 4: logging what we have found logerror("-- Board %s\n", unif_mapr); logerror("-- PRG 0x%x (%d x 16k chunks)\n", prg_size, prg_size / 0x4000); logerror("-- VROM 0x%x (%d x 8k chunks)\n", vrom_size, vrom_size / 0x2000); logerror("-- VRAM 0x%x (%d x 8k chunks)\n", vram_size, vram_size / 0x2000); - + // SETUP steps 5/6: allocate pointers for PRG/VROM and load the data! if (prg_size == 0x4000) { @@ -868,10 +868,10 @@ bool nes_cart_slot_device::call_load() m_cart->prg_alloc(machine(), prg_size); memcpy(m_cart->get_prg_base(), temp_prg, prg_size); } - + if (small_prg) // This is not supported yet, so warn users about this mame_printf_error("Loaded UNIF file with non-16k PRG chunk. This is not supported in MESS yet."); - + if (vrom_size) { m_cart->vrom_alloc(machine(), vrom_size); @@ -882,7 +882,7 @@ bool nes_cart_slot_device::call_load() { FILE *prgout; char outname[255]; - + sprintf(outname, "%s.prg", filename()); prgout = fopen(outname, "wb"); if (prgout) @@ -890,17 +890,17 @@ bool nes_cart_slot_device::call_load() fwrite(m_cart->get_prg_base(), 1, 0x4000 * m_cart->get_prg_size(), prgout); mame_printf_error("Created PRG chunk\n"); } - + fclose(prgout); } #endif - + #if SPLIT_CHR if (state->m_chr_chunks > 0) { FILE *chrout; char outname[255]; - + sprintf(outname, "%s.chr", filename()); chrout= fopen(outname, "wb"); if (chrout) @@ -929,47 +929,47 @@ bool nes_cart_slot_device::call_load() UINT32 vrom_size = get_software_region_length("chr"); UINT32 vram_size = get_software_region_length("vram"); vram_size += get_software_region_length("vram2"); - + // validate the xml fields if (!prg_size) fatalerror("No PRG entry for this software! Please check if the xml list got corrupted\n"); if (prg_size < 0x8000) fatalerror("PRG entry is too small! Please check if the xml list got corrupted\n"); - + // SETUP step 2: getting PCB and other settings if (get_feature("pcb")) m_pcb_id = nes_get_pcb_id(machine(), get_feature("pcb")); else m_pcb_id = NO_BOARD; - + // SETUP step 3: storing the info needed for emulation if (m_pcb_id == STD_TVROM || m_pcb_id == STD_DRROM || m_pcb_id == IREM_LROG017) m_cart->set_four_screen_vram(1); else m_cart->set_four_screen_vram(0); - + if (get_software_region("bwram") != NULL) battery_size = get_software_region_length("bwram"); - + if (m_pcb_id == BANDAI_LZ93EX) { // allocate the 24C01 or 24C02 EEPROM battery_size += 0x2000; } - + if (m_pcb_id == BANDAI_DATACH) { // allocate the 24C01 and 24C02 EEPROM battery_size += 0x4000; } - + if (get_software_region("wram") != NULL) prgram_size = get_software_region_length("wram"); if (get_software_region("mapper_ram") != NULL) mapper_ram_size = get_software_region_length("mapper_ram"); if (get_software_region("mapper_bram") != NULL) mapper_bram_size = get_software_region_length("mapper_bram"); - + if (get_feature("mirroring")) { const char *mirroring = get_feature("mirroring"); @@ -984,7 +984,7 @@ bool nes_cart_slot_device::call_load() } else m_cart->set_mirroring(PPU_MIRROR_NONE); - + /* Check for pins in specific boards which require them */ if (m_pcb_id == STD_CNROM) { @@ -999,13 +999,13 @@ bool nes_cart_slot_device::call_load() m_ce_state |= !strcmp(get_feature("chr-pin27"), "CE") ? 0x02 : 0; } } - + if (m_pcb_id == TAITO_X1_005 && get_feature("x1-pin17") != NULL && get_feature("x1-pin31") != NULL) { if (!strcmp(get_feature("x1-pin17"), "CIRAM A10") && !strcmp(get_feature("x1-pin31"), "NC")) m_pcb_id = TAITO_X1_005_A; } - + if (m_pcb_id == KONAMI_VRC2) { m_vrc_ls_prg_a = nes_cart_get_line(get_feature("vrc2-pin3")); @@ -1013,34 +1013,34 @@ bool nes_cart_slot_device::call_load() m_vrc_ls_chr = (nes_cart_get_line(get_feature("vrc2-pin21")) != 10) ? 1 : 0; // mame_printf_error("VRC-2, pin3: A%d, pin4: A%d, pin21: %s\n", state->m_vrc_ls_prg_a, state->m_vrc_ls_prg_b, state->m_vrc_ls_chr ? "NC" : "A10"); } - + if (m_pcb_id == KONAMI_VRC4) { m_vrc_ls_prg_a = nes_cart_get_line(get_feature("vrc4-pin3")); m_vrc_ls_prg_b = nes_cart_get_line(get_feature("vrc4-pin4")); // mame_printf_error("VRC-4, pin3: A%d, pin4: A%d\n", state->m_vrc_ls_prg_a, state->m_vrc_ls_prg_b); } - + if (m_pcb_id == KONAMI_VRC6) { m_vrc_ls_prg_a = nes_cart_get_line(get_feature("vrc6-pin9")); m_vrc_ls_prg_b = nes_cart_get_line(get_feature("vrc6-pin10")); // mame_printf_error("VRC-6, pin9: A%d, pin10: A%d\n", state->m_vrc_ls_prg_a, state->m_vrc_ls_prg_b); } - + /* Check for other misc board variants */ if (m_pcb_id == STD_SOROM) { if (get_feature("mmc1_type") != NULL && !strcmp(get_feature("mmc1_type"), "MMC1A")) m_pcb_id = STD_SOROM_A; // in MMC1-A PRG RAM is always enabled } - + if (m_pcb_id == STD_SXROM) { if (get_feature("mmc1_type") != NULL && !strcmp(get_feature("mmc1_type"), "MMC1A")) m_pcb_id = STD_SXROM_A; // in MMC1-A PRG RAM is always enabled } - + if (m_pcb_id == STD_NXROM || m_pcb_id == SUNSOFT_DCS) { if (get_software_region("minicart") != NULL) // check for dual minicart @@ -1049,7 +1049,7 @@ bool nes_cart_slot_device::call_load() // we shall load somewhere the minicart, but we still do not support this } } - + // SETUP step 4: logging what we have found logerror("Loaded game from softlist:\n"); logerror("-- PCB: %s", get_feature("pcb")); @@ -1060,7 +1060,7 @@ bool nes_cart_slot_device::call_load() logerror("-- VRAM 0x%x (%d x 8k chunks)\n", vram_size, vram_size / 0x2000); logerror("-- PRG NVWRAM: %d\n", m_cart->get_battery_size()); logerror("-- PRG WRAM: %d\n", m_cart->get_prgram_size()); - + // SETUP steps 5/6: allocate pointers for PRG/VROM and load the data! m_cart->prg_alloc(machine(), prg_size); memcpy(m_cart->get_prg_base(), get_software_region("prg"), prg_size); @@ -1070,7 +1070,7 @@ bool nes_cart_slot_device::call_load() memcpy(m_cart->get_vrom_base(), get_software_region("chr"), vrom_size); } } - + // Allocate the remaining pointer, when needed if (vram_size) m_cart->vram_alloc(machine(), vram_size); @@ -1078,7 +1078,7 @@ bool nes_cart_slot_device::call_load() m_cart->prgram_alloc(machine(), prgram_size); if (mapper_ram_size) m_cart->mapper_ram_alloc(machine(), mapper_ram_size); - + // Attempt to load a battery file for this ROM // A few boards have internal RAM with a battery (MMC6, Taito X1-005 & X1-017, etc.) if (battery_size || mapper_bram_size) @@ -1096,12 +1096,12 @@ bool nes_cart_slot_device::call_load() m_cart->mapper_bram_alloc(machine(), mapper_bram_size); memcpy(m_cart->get_mapper_bram_base(), temp_nvram + battery_size, mapper_bram_size); } - + if (temp_nvram) auto_free(machine(), temp_nvram); } } - + return IMAGE_INIT_PASS; } @@ -1122,7 +1122,7 @@ void nes_cart_slot_device::call_unload() memcpy(temp_nvram, m_cart->get_battery_base(), m_cart->get_battery_size()); if (m_cart->get_mapper_bram_size()) memcpy(temp_nvram + m_cart->get_battery_size(), m_cart->get_mapper_bram_base(), m_cart->get_mapper_bram_size()); - + battery_save(temp_nvram, tot_size); if (temp_nvram) auto_free(machine(), temp_nvram); @@ -1230,4 +1230,3 @@ nes_rom_device::nes_rom_device(const machine_config &mconfig, device_type type, void nes_rom_device::device_start() { } - diff --git a/src/mess/machine/nes_slot.h b/src/mess/machine/nes_slot.h index 5c5a86e0ed3..f7ab5fb601f 100644 --- a/src/mess/machine/nes_slot.h +++ b/src/mess/machine/nes_slot.h @@ -153,7 +153,7 @@ public: //private: - device_nes_cart_interface* m_cart; + device_nes_cart_interface* m_cart; int m_pcb_id; bool m_must_be_loaded; }; @@ -197,12 +197,12 @@ public: virtual void device_config_complete() { m_shortname = "nes_rom"; } // nescart_interface overrides -// virtual DECLARE_READ8_MEMBER(read_l); -// virtual DECLARE_READ8_MEMBER(read_m); -// virtual DECLARE_READ8_MEMBER(read_h); -// virtual DECLARE_WRITE8_MEMBER(write_l); -// virtual DECLARE_WRITE8_MEMBER(write_m); -// virtual DECLARE_WRITE8_MEMBER(write_h); +// virtual DECLARE_READ8_MEMBER(read_l); +// virtual DECLARE_READ8_MEMBER(read_m); +// virtual DECLARE_READ8_MEMBER(read_h); +// virtual DECLARE_WRITE8_MEMBER(write_l); +// virtual DECLARE_WRITE8_MEMBER(write_m); +// virtual DECLARE_WRITE8_MEMBER(write_h); }; // device type definition diff --git a/src/mess/machine/nes_unif.c b/src/mess/machine/nes_unif.c index 08d963ba7fc..cf801d6ac85 100644 --- a/src/mess/machine/nes_unif.c +++ b/src/mess/machine/nes_unif.c @@ -160,14 +160,14 @@ const unif *nes_unif_lookup( const char *board ) void unif_mapr_setup( const char *board, int *pcb_id, int *battery, int *prgram, int *vram_chunks ) { - const unif *unif_board = nes_unif_lookup(board); + const unif *unif_board = nes_unif_lookup(board); if (unif_board == NULL) fatalerror("Unknown UNIF board %s.\n", board); - + *pcb_id = unif_board->board_idx; - *battery = unif_board->nvwram; // we should implement battery banks based on the size of this... - *prgram = unif_board->wram; // we should implement WRAM banks based on the size of this... - + *battery = unif_board->nvwram; // we should implement battery banks based on the size of this... + *prgram = unif_board->wram; // we should implement WRAM banks based on the size of this... + if (unif_board->chrram <= CHRRAM_8) *vram_chunks = 1; else if (unif_board->chrram == CHRRAM_16) diff --git a/src/mess/machine/pet_64k.c b/src/mess/machine/pet_64k.c index 1b9b1c4f9fa..1381a533e7d 100644 --- a/src/mess/machine/pet_64k.c +++ b/src/mess/machine/pet_64k.c @@ -181,7 +181,7 @@ void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UIN case pet_expansion_slot_device::SELE: if (!BIT(m_ctrl, 6) || !BIT(offset, 11)) { - write_ram(offset, data); + write_ram(offset, data); sel = pet_expansion_slot_device::SEL_NONE; } break; diff --git a/src/mess/machine/petexp.h b/src/mess/machine/petexp.h index e21481ef7bc..0ac796f876a 100644 --- a/src/mess/machine/petexp.h +++ b/src/mess/machine/petexp.h @@ -72,7 +72,7 @@ public: UINT8 dma_bd_r(offs_t offset); void dma_bd_w(offs_t offset, UINT8 data); int phi2(); - + enum { SEL_NONE = -1, diff --git a/src/mess/machine/sns_bsx.c b/src/mess/machine/sns_bsx.c index 63750525839..9cf584c2ce9 100644 --- a/src/mess/machine/sns_bsx.c +++ b/src/mess/machine/sns_bsx.c @@ -64,7 +64,7 @@ void sns_rom_bsx_device::device_start() m_cart_regs[7] = 0x80; m_cart_regs[8] = 0x80; access_update(); - + save_item(NAME(m_cart_regs)); save_item(NAME(access_00_1f)); save_item(NAME(access_80_9f)); @@ -77,7 +77,7 @@ void sns_rom_bsx_device::device_start() } void sns_rom_bsx_device::device_reset() -{ +{ memset(m_pram, 0xff, sizeof(m_pram)); } @@ -104,7 +104,7 @@ void sns_rom_bsmempak_device::device_reset() m_command = 0; m_write_old = 0; m_write_new = 0; - + m_flash_enable = 0; m_read_enable = 0; m_write_enable = 0; diff --git a/src/mess/machine/sns_rom.c b/src/mess/machine/sns_rom.c index 61d43edeaca..a2af182741d 100644 --- a/src/mess/machine/sns_rom.c +++ b/src/mess/machine/sns_rom.c @@ -309,17 +309,17 @@ WRITE8_MEMBER( sns_rom_pokemon_device::chip_write ) } -// Tekken 2: It accesses the protection in a very strange way, always reading/writing the same data $f0 times, -// because each access must be repeated a couple of times to be registered (typically around 7-30 times) +// Tekken 2: It accesses the protection in a very strange way, always reading/writing the same data $f0 times, +// because each access must be repeated a couple of times to be registered (typically around 7-30 times) // They probably used a microcontroller here. -// The protection itself is accessed in banks $80-$bf. Accessing (read/write, doesn't matter) adress lines +// The protection itself is accessed in banks $80-$bf. Accessing (read/write, doesn't matter) adress lines // A8,A9,A10 in these banks in a certain sequence makes the mc return a 4bit value. [d4s] // Details on a possible algorythm behind the sequence of accesses were provided by nocash. Thanks! void sns_rom_tekken2_device::update_prot(UINT32 offset) { // accesses to [80-bf][8000-87ff] ranges update the protection value offset &= 0x7ff; - + switch (offset & 0x700) { case 0x000: @@ -328,22 +328,22 @@ void sns_rom_tekken2_device::update_prot(UINT32 offset) case 0x100: // used for read access break; - case 0x200: // BIT 0 + case 0x200: // BIT 0 m_prot |= 1; break; - case 0x300: // BIT 1 + case 0x300: // BIT 1 m_prot |= 2; break; - case 0x400: // BIT 2 + case 0x400: // BIT 2 m_prot |= 4; break; - case 0x500: // BIT 3 + case 0x500: // BIT 3 m_prot |= 8; break; - case 0x600: // DIRECTION + case 0x600: // DIRECTION m_prot |= 0x10; break; - case 0x700: // FUNCTION + case 0x700: // FUNCTION m_prot |= 0x20; break; } @@ -355,18 +355,18 @@ READ8_MEMBER( sns_rom_tekken2_device::chip_read ) if ((offset & 0x700) == 0x100) { - if (BIT(m_prot, 5)) // FUNCTION = 1 means Shift + if (BIT(m_prot, 5)) // FUNCTION = 1 means Shift { - if (BIT(m_prot, 4)) // DIRECTION = 1 means Right + if (BIT(m_prot, 4)) // DIRECTION = 1 means Right return (m_prot & 0x0f) >> 1; - else // DIRECTION = 0 means Left + else // DIRECTION = 0 means Left return (m_prot & 0x0f) << 1; } - else // FUNCTION = 0 means Add/Sub + else // FUNCTION = 0 means Add/Sub { - if (BIT(m_prot, 4)) // DIRECTION = 1 means Minus + if (BIT(m_prot, 4)) // DIRECTION = 1 means Minus return (m_prot & 0x0f) - 1; - else // DIRECTION = 0 means Plus + else // DIRECTION = 0 means Plus return (m_prot & 0x0f) + 1; } } @@ -380,7 +380,7 @@ WRITE8_MEMBER( sns_rom_tekken2_device::chip_write ) } -// Soul Blade: Adresses $xxx0-$xxx3 in banks $80-$bf always read $55, $0f, $aa, $f0. +// Soul Blade: Adresses $xxx0-$xxx3 in banks $80-$bf always read $55, $0f, $aa, $f0. // Banks $c0-$ff return open bus. READ8_MEMBER( sns_rom_soulblad_device::chip_read ) { @@ -407,7 +407,7 @@ READ8_MEMBER( sns_rom_soulblad_device::chip_read ) // Multicart pirate banking emulation // LoROM games, writes to [ff][ff00-ffff] control bankswitch -// The actual banks depends on the last 8bits of the address accessed. +// The actual banks depends on the last 8bits of the address accessed. // Type 1: bits0-4 of the address are used as base bank (256KB chunks) READ8_MEMBER(sns_rom_mcpirate1_device::read_l) @@ -424,7 +424,7 @@ READ8_MEMBER(sns_rom_mcpirate1_device::read_h) WRITE8_MEMBER( sns_rom_mcpirate1_device::chip_write ) { m_base_bank = offset & 0x1f; -// printf("offset %X data %X bank %X\n", offset, data, m_base_bank); +// printf("offset %X data %X bank %X\n", offset, data, m_base_bank); } // Type 2: bits0-3 & bit5 of the address are used as base bank (256KB chunks) @@ -442,7 +442,7 @@ READ8_MEMBER(sns_rom_mcpirate2_device::read_h) WRITE8_MEMBER( sns_rom_mcpirate2_device::chip_write ) { m_base_bank = (offset & 0x0f) | ((offset & 0x20) >> 1); -// printf("offset %X data %X bank %X\n", offset, data, m_base_bank); +// printf("offset %X data %X bank %X\n", offset, data, m_base_bank); } // Korean 20 in 1 collection with NES games @@ -488,7 +488,7 @@ WRITE8_MEMBER( sns_rom_20col_device::chip_write ) // [19] mario bros - 9b // [20] popeye - 9c m_base_bank = data & 0xdf; -// printf("offset %X data %X bank %X\n", offset, data, m_base_bank); +// printf("offset %X data %X bank %X\n", offset, data, m_base_bank); } @@ -502,7 +502,7 @@ READ8_MEMBER( sns_rom_banana_device::chip_read ) WRITE8_MEMBER( sns_rom_banana_device::chip_write ) { -// printf("write addr %X data %X\n", offset, data); +// printf("write addr %X data %X\n", offset, data); m_latch[0xf] = data; } @@ -515,5 +515,3 @@ WRITE8_MEMBER( sns_rom_bugs_device::chip_write ) { m_latch[offset & 0xff] = data; } - - diff --git a/src/mess/machine/sns_rom.h b/src/mess/machine/sns_rom.h index 2cded87bfbe..4170945e016 100644 --- a/src/mess/machine/sns_rom.h +++ b/src/mess/machine/sns_rom.h @@ -30,16 +30,16 @@ class sns_rom_obc1_device : public sns_rom_device public: // construction/destruction sns_rom_obc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "sns_rom_obc1"; } - + // additional reading and writing virtual DECLARE_READ8_MEMBER(chip_read); virtual DECLARE_WRITE8_MEMBER(chip_write); - + int m_address; int m_offset; int m_shift; @@ -74,12 +74,12 @@ class sns_rom_tekken2_device : public sns_rom_device public: // construction/destruction sns_rom_tekken2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "sns_rom_tekken2"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(chip_read); // protection device virtual DECLARE_WRITE8_MEMBER(chip_write); // protection device @@ -98,10 +98,10 @@ class sns_rom_soulblad_device : public sns_rom_device public: // construction/destruction sns_rom_soulblad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "sns_rom_soulblad"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(chip_read); // protection device }; @@ -113,12 +113,12 @@ class sns_rom_mcpirate1_device : public sns_rom_device public: // construction/destruction sns_rom_mcpirate1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "sns_rom_mcpirate1"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_l); virtual DECLARE_READ8_MEMBER(read_h); @@ -133,12 +133,12 @@ class sns_rom_mcpirate2_device : public sns_rom_device public: // construction/destruction sns_rom_mcpirate2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "sns_rom_mcpirate2"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_l); virtual DECLARE_READ8_MEMBER(read_h); @@ -153,11 +153,11 @@ class sns_rom_20col_device : public sns_rom_device public: // construction/destruction sns_rom_20col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "sns_rom_20col"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_l); virtual DECLARE_READ8_MEMBER(read_h); @@ -172,12 +172,12 @@ class sns_rom_banana_device : public sns_rom_device public: // construction/destruction sns_rom_banana_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides -// virtual void device_start(); -// virtual void device_reset(); +// virtual void device_start(); +// virtual void device_reset(); virtual void device_config_complete() { m_shortname = "sns_rom_banana"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(chip_read); // protection device virtual DECLARE_WRITE8_MEMBER(chip_write); // protection device @@ -191,12 +191,12 @@ class sns_rom_bugs_device : public sns_rom_device public: // construction/destruction sns_rom_bugs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_reset(); virtual void device_config_complete() { m_shortname = "sns_rom_bugslife"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(chip_read); // protection device virtual DECLARE_WRITE8_MEMBER(chip_write); // protection device diff --git a/src/mess/machine/sns_rom21.c b/src/mess/machine/sns_rom21.c index f6a746e299d..646d0c16a19 100644 --- a/src/mess/machine/sns_rom21.c +++ b/src/mess/machine/sns_rom21.c @@ -50,15 +50,15 @@ void sns_rom21_srtc_device::device_start() { save_item(NAME(m_mode)); save_item(NAME(m_index)); -// save_item(NAME(m_rtc_ram)); +// save_item(NAME(m_rtc_ram)); } void sns_rom21_srtc_device::device_reset() { m_mode = RTCM_Read; m_index = -1; -// memset(m_rtc_ram, 0, sizeof(m_rtc_ram)); - +// memset(m_rtc_ram, 0, sizeof(m_rtc_ram)); + // at this stage, rtc_ram is not yet allocated. this will be fixed when converting RTC to be a separate device. // update_time(); } diff --git a/src/mess/machine/sns_sdd1.c b/src/mess/machine/sns_sdd1.c index 166cd6bb1ae..c0487ee26d4 100644 --- a/src/mess/machine/sns_sdd1.c +++ b/src/mess/machine/sns_sdd1.c @@ -442,17 +442,17 @@ void sns_rom_sdd1_device::device_reset() { m_sdd1_enable = 0x00; m_xfer_enable = 0x00; - + m_mmc[0] = 0 << 20; m_mmc[1] = 1 << 20; m_mmc[2] = 2 << 20; m_mmc[3] = 3 << 20; - + for(int i = 0; i < 8; i++) { m_dma[i].addr = 0; m_dma[i].size = 0; - } + } } /*------------------------------------------------- @@ -604,4 +604,3 @@ WRITE8_MEMBER( sns_rom_sdd1_device::write_ram ) { m_nvram[offset & 0x1fff] = data; } - diff --git a/src/mess/machine/sns_sfx.c b/src/mess/machine/sns_sfx.c index 2be51bf9ec5..bc7be0b1baf 100644 --- a/src/mess/machine/sns_sfx.c +++ b/src/mess/machine/sns_sfx.c @@ -152,4 +152,3 @@ WRITE8_MEMBER( sns_rom_superfx_device::write_ram ) if (superfx_access_ram(m_superfx)) sfx_ram[offset & 0xfffff] = data; } - diff --git a/src/mess/machine/sns_slot.c b/src/mess/machine/sns_slot.c index 7a47da01a06..61d65403f1b 100644 --- a/src/mess/machine/sns_slot.c +++ b/src/mess/machine/sns_slot.c @@ -23,7 +23,7 @@ Notes about add-on detection and handling (useful for future addition of st018, cx4, etc.) =============================================================================================== - When loading from softlist, m_type would be enough to take care of add-on chips, because + When loading from softlist, m_type would be enough to take care of add-on chips, because the ones needing a CPU dump have it in the zipfile. However, to support these games also from fullpath, both with files having DSP data appended to the .sfc and with older dumps missing DSP data, a second variable is present in the SNES slot: m_addon. @@ -32,15 +32,15 @@ ones containing DSP dump as device roms, so it gets m_type as the main device should be used and if m_addon is ADDON_DSP* or ADDON_ST*, then it checks if the DSP data is appended or if m_type has to be switched to legacy type - - call_load needs to detect faulty dumps too, to alloc m_addon_bios and copy the data from - the correct place, so if m_addon is ADDON_DSP* or ADDON_ST* it checks whether DSP data is - appended or not: if it is, this data is copied to m_addon_bios; if not, then we are in + - call_load needs to detect faulty dumps too, to alloc m_addon_bios and copy the data from + the correct place, so if m_addon is ADDON_DSP* or ADDON_ST* it checks whether DSP data is + appended or not: if it is, this data is copied to m_addon_bios; if not, then we are in the legacy device case and data is copied from the device rom - After the cart has been loaded and emulation has started, only m_type is needed to later + After the cart has been loaded and emulation has started, only m_type is needed to later handlers installation and cart accesses - Also notice that, from softlist, DSP1, 1B, 2, 3 are treated as the same device, because they - all have the same I/O and the only difference (i.e. the DSP data) comes from the zipfile itself. + Also notice that, from softlist, DSP1, 1B, 2, 3 are treated as the same device, because they + all have the same I/O and the only difference (i.e. the DSP data) comes from the zipfile itself. OTOH, to support faulty dumps missing DSP content, we need separate legacy devices... @@ -808,13 +808,13 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath() } break; } - + // otherwise, we need to use the legacy versions including DSP dump in device romset if (!m_cart->get_addon_bios_size()) { astring region(m_cart->device().tag(), ":addon"); UINT8 *ROM = NULL; - + switch (m_addon) { case ADDON_DSP1: @@ -853,8 +853,8 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath() memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000); break; } - } - + } + } void base_sns_cart_slot_device::setup_nvram() @@ -1041,7 +1041,7 @@ const char * base_sns_cart_slot_device::get_default_card_software(const machine_ if (type == SNES_DSP_MODE21) type = SNES_DSP1_MODE21_LEG; else - type = SNES_DSP1_LEG; + type = SNES_DSP1_LEG; } break; case ADDON_DSP1B: diff --git a/src/mess/machine/sns_slot.h b/src/mess/machine/sns_slot.h index 9c4189d7686..51f2aa708d0 100644 --- a/src/mess/machine/sns_slot.h +++ b/src/mess/machine/sns_slot.h @@ -107,12 +107,12 @@ public: virtual ~device_sns_cart_interface(); // reading and writing - virtual DECLARE_READ8_MEMBER(read_l) { return 0xff; } // ROM access in range [00-7f] - virtual DECLARE_READ8_MEMBER(read_h) { return 0xff; } // ROM access in range [80-ff] - virtual DECLARE_READ8_MEMBER(read_ram) { UINT32 mask = m_nvram_size - 1; return m_nvram[offset & mask]; } // NVRAM access - virtual DECLARE_WRITE8_MEMBER(write_l) {} // used by carts with subslots - virtual DECLARE_WRITE8_MEMBER(write_h) {} // used by carts with subslots - virtual DECLARE_WRITE8_MEMBER(write_ram) { UINT32 mask = m_nvram_size - 1; m_nvram[offset & mask] = data; return; } // NVRAM access + virtual DECLARE_READ8_MEMBER(read_l) { return 0xff; } // ROM access in range [00-7f] + virtual DECLARE_READ8_MEMBER(read_h) { return 0xff; } // ROM access in range [80-ff] + virtual DECLARE_READ8_MEMBER(read_ram) { UINT32 mask = m_nvram_size - 1; return m_nvram[offset & mask]; } // NVRAM access + virtual DECLARE_WRITE8_MEMBER(write_l) {} // used by carts with subslots + virtual DECLARE_WRITE8_MEMBER(write_h) {} // used by carts with subslots + virtual DECLARE_WRITE8_MEMBER(write_ram) { UINT32 mask = m_nvram_size - 1; m_nvram[offset & mask] = data; return; } // NVRAM access virtual DECLARE_READ8_MEMBER(chip_read) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(chip_write) {} @@ -194,7 +194,7 @@ public: virtual DECLARE_READ8_MEMBER(chip_read); virtual DECLARE_WRITE8_MEMBER(chip_write); - // in order to support legacy dumps + add-on CPU dump appended at the end of the file, we + // in order to support legacy dumps + add-on CPU dump appended at the end of the file, we // check if the required data is present and update bank map accordingly void setup_addon_from_fullpath(); diff --git a/src/mess/machine/sns_spc7110.c b/src/mess/machine/sns_spc7110.c index 7fd037f26df..713a2ad4d5f 100644 --- a/src/mess/machine/sns_spc7110.c +++ b/src/mess/machine/sns_spc7110.c @@ -61,7 +61,7 @@ void sns_rom_spc7110_device::spc7110_start() m_r480a = 0x00; m_r480b = 0x00; m_r480c = 0x00; - + m_r4811 = 0x00; m_r4812 = 0x00; m_r4813 = 0x00; @@ -70,11 +70,11 @@ void sns_rom_spc7110_device::spc7110_start() m_r4816 = 0x00; m_r4817 = 0x00; m_r4818 = 0x00; - + m_r481x = 0x00; m_r4814_latch = 0; m_r4815_latch = 0; - + m_r4820 = 0x00; m_r4821 = 0x00; m_r4822 = 0x00; @@ -91,7 +91,7 @@ void sns_rom_spc7110_device::spc7110_start() m_r482d = 0x00; m_r482e = 0x00; m_r482f = 0x00; - + m_r4830 = 0x00; m_r4831 = 0; m_dx_offset = spc7110_datarom_addr(0 * 0x100000, 0x200000); // we would need the rom length here... @@ -100,7 +100,7 @@ void sns_rom_spc7110_device::spc7110_start() m_r4833 = 2; m_fx_offset = spc7110_datarom_addr(2 * 0x100000, 0x200000); // we would need the rom length here... m_r4834 = 0x00; - + m_r4840 = 0x00; m_r4841 = 0x00; m_r4842 = 0x00; @@ -167,19 +167,19 @@ void sns_rom_spc7110_device::device_start() void sns_rom_spc7110rtc_device::device_start() { spc7110_start(); - + // RTC m_rtc_state = RTCS_Inactive; m_rtc_mode = RTCM_Linear; m_rtc_index = 0; m_rtc_offset = 0; - + // at this stage, rtc_ram is not yet allocated. this will be fixed when converting RTC to be a separate device. // spc7110_update_time(0); // set basetime for RTC machine().current_datetime(m_rtc_basetime); - + save_item(NAME(m_rtc_state)); save_item(NAME(m_rtc_mode)); save_item(NAME(m_rtc_index)); @@ -936,7 +936,7 @@ void sns_rom_spc7110_device::spc7110_update_time(UINT8 offset) system_time curtime; machine().current_datetime(curtime); INT64 diff = curtime.time - m_rtc_basetime.time - offset; -// printf("diff %llx\n", diff); +// printf("diff %llx\n", diff); bool update = TRUE; // TEST: can we go beyond 24hrs of rounding?!? I doubt it will ever go beyond 3600, but I could be wrong... @@ -984,37 +984,37 @@ void sns_rom_spc7110_device::spc7110_update_time(UINT8 offset) UINT8 days = spc7110_months[month % 12]; // check for feb 29th - if (days == 28) + if (days == 28) { bool leap = FALSE; - if ((year % 4) == 0) + if ((year % 4) == 0) { if(year % 100 || !(year % 400)) leap = TRUE; } - if (leap) + if (leap) days++; } // are we below end of month? - if (day < days) + if (day < days) continue; // otherwise we have to increase month! day = 0; month++; // are we below end of year? - if (month < 12) + if (month < 12) continue; // otherwise we have to increase year! month = 0; year++; } - + day++; month++; year %= 100; - + m_rtc_ram[0] = second % 10; m_rtc_ram[1] = second / 10; m_rtc_ram[2] = minute % 10; @@ -1608,14 +1608,14 @@ READ8_MEMBER(sns_rom_spc7110_device::read_l) { if (offset < 0x400000) return m_rom[rom_bank_map[offset / 0x8000] * 0x8000 + (offset & 0x7fff)]; - + return 0xff; } READ8_MEMBER(sns_rom_spc7110_device::read_h) { UINT16 address = offset & 0xfffff; - + if (offset < 0x400000) return m_rom[rom_bank_map[offset / 0x8000] * 0x8000 + (offset & 0x7fff)]; else @@ -1634,7 +1634,7 @@ READ8_MEMBER(sns_rom_spc7110_device::read_h) break; } } - + return 0xff; } @@ -1648,4 +1648,3 @@ WRITE8_MEMBER( sns_rom_spc7110_device::write_ram ) { m_ram[offset & 0x1fff] = data; } - diff --git a/src/mess/machine/sns_upd.c b/src/mess/machine/sns_upd.c index 09c115556d2..f78a5ade6fc 100644 --- a/src/mess/machine/sns_upd.c +++ b/src/mess/machine/sns_upd.c @@ -237,7 +237,7 @@ READ8_MEMBER( sns_rom_setadsp_device::chip_read ) { if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000) m_upd96050->snesdsp_read((offset & 0x01) ? FALSE : TRUE); - + if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000) { UINT16 address = offset & 0xffff; @@ -518,4 +518,3 @@ const rom_entry *sns_rom_seta11dsp_legacy_device::device_rom_region() const { return ROM_NAME( snes_st011 ); } - diff --git a/src/mess/machine/sns_upd.h b/src/mess/machine/sns_upd.h index 4726ab587ce..f937aa0a10c 100644 --- a/src/mess/machine/sns_upd.h +++ b/src/mess/machine/sns_upd.h @@ -119,7 +119,7 @@ class sns_rom20_necdsp1_legacy_device : public sns_rom20_necdsp_device public: // construction/destruction sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "dsp1leg"; } virtual machine_config_constructor device_mconfig_additions() const; @@ -131,7 +131,7 @@ class sns_rom20_necdsp1b_legacy_device : public sns_rom20_necdsp_device public: // construction/destruction sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "dsp1bleg"; } virtual machine_config_constructor device_mconfig_additions() const; @@ -143,7 +143,7 @@ class sns_rom20_necdsp2_legacy_device : public sns_rom20_necdsp_device public: // construction/destruction sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "dsp2leg"; } virtual machine_config_constructor device_mconfig_additions() const; @@ -155,7 +155,7 @@ class sns_rom20_necdsp3_legacy_device : public sns_rom20_necdsp_device public: // construction/destruction sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "dsp3leg"; } virtual machine_config_constructor device_mconfig_additions() const; @@ -167,7 +167,7 @@ class sns_rom20_necdsp4_legacy_device : public sns_rom20_necdsp_device public: // construction/destruction sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "dsp4leg"; } virtual machine_config_constructor device_mconfig_additions() const; @@ -179,7 +179,7 @@ class sns_rom21_necdsp1_legacy_device : public sns_rom21_necdsp_device public: // construction/destruction sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "dsp1leg_hi"; } virtual machine_config_constructor device_mconfig_additions() const; @@ -191,7 +191,7 @@ class sns_rom_seta10dsp_legacy_device : public sns_rom_setadsp_device public: // construction/destruction sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "seta10leg"; } virtual machine_config_constructor device_mconfig_additions() const; diff --git a/src/mess/machine/super80.c b/src/mess/machine/super80.c index a694b932ee9..8f25391b1f4 100644 --- a/src/mess/machine/super80.c +++ b/src/mess/machine/super80.c @@ -253,4 +253,4 @@ QUICKLOAD_LOAD( super80 ) } return IMAGE_INIT_PASS; -}
\ No newline at end of file +} diff --git a/src/mess/machine/tandy2kb.c b/src/mess/machine/tandy2kb.c index 3212774f62d..530914ead2e 100644 --- a/src/mess/machine/tandy2kb.c +++ b/src/mess/machine/tandy2kb.c @@ -259,8 +259,8 @@ tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, //------------------------------------------------- void tandy2k_keyboard_device::device_config_complete() -{ - m_shortname = "tandy2kb"; +{ + m_shortname = "tandy2kb"; // inherit a copy of the static data const tandy2k_keyboard_interface *intf = reinterpret_cast<const tandy2k_keyboard_interface *>(static_config()); diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c index bbcc47d0ba4..6f4103ebabd 100644 --- a/src/mess/machine/thomflop.c +++ b/src/mess/machine/thomflop.c @@ -1937,4 +1937,3 @@ void thomson_state::thomson_index_callback(device_t *device, int state) break; } } - diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c index 3ebccf4cff9..312bca1d5e4 100644 --- a/src/mess/machine/thomson.c +++ b/src/mess/machine/thomson.c @@ -480,8 +480,8 @@ WRITE8_MEMBER( thomson_state::to7_timer_port_out ) thom_set_mode_point( data & 1 ); /* bit 0: video bank switch */ thom_set_caps_led( (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */ thom_set_border_color( ((data & 0x10) ? 1 : 0) | /* bits 4-6: border color */ - ((data & 0x20) ? 2 : 0) | - ((data & 0x40) ? 4 : 0) ); + ((data & 0x20) ? 2 : 0) | + ((data & 0x40) ? 4 : 0) ); } @@ -1571,9 +1571,9 @@ WRITE8_MEMBER( thomson_state::to770_timer_port_out ) thom_set_mode_point( data & 1 ); /* bit 0: video bank switch */ thom_set_caps_led( (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */ thom_set_border_color( ((data & 0x10) ? 1 : 0) | /* 4-bit border color */ - ((data & 0x20) ? 2 : 0) | - ((data & 0x40) ? 4 : 0) | - ((data & 0x04) ? 0 : 8) ); + ((data & 0x20) ? 2 : 0) | + ((data & 0x40) ? 4 : 0) | + ((data & 0x04) ? 0 : 8) ); } diff --git a/src/mess/machine/ti99/mecmouse.h b/src/mess/machine/ti99/mecmouse.h index 5481134d92d..895ffe07830 100644 --- a/src/mess/machine/ti99/mecmouse.h +++ b/src/mess/machine/ti99/mecmouse.h @@ -30,7 +30,7 @@ protected: virtual void device_reset(void); virtual ioport_constructor device_input_ports() const; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - + private: int m_last_select; bool m_read_y_axis; diff --git a/src/mess/machine/ti99/ti_fdc.h b/src/mess/machine/ti99/ti_fdc.h index b3fd1a8fe7e..5d1361e8a18 100644 --- a/src/mess/machine/ti99/ti_fdc.h +++ b/src/mess/machine/ti99/ti_fdc.h @@ -37,7 +37,7 @@ protected: virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - + private: void handle_hold(void); void set_all_geometries(floppy_type_t type); diff --git a/src/mess/machine/vic1011.c b/src/mess/machine/vic1011.c index 03640c6d5e5..6ca9048db7e 100644 --- a/src/mess/machine/vic1011.c +++ b/src/mess/machine/vic1011.c @@ -93,18 +93,18 @@ void vic1011_device::device_start() UINT8 vic1011_device::vic20_pb_r(address_space &space, offs_t offset) { /* - + bit description - + 0 Sin - 1 - 2 - 3 + 1 + 2 + 3 4 DCDin - 5 + 5 6 CTS 7 DSR - + */ UINT8 data = 0; @@ -125,18 +125,18 @@ UINT8 vic1011_device::vic20_pb_r(address_space &space, offs_t offset) void vic1011_device::vic20_pb_w(address_space &space, offs_t offset, UINT8 data) { /* - + bit description - - 0 + + 0 1 RTS 2 DTR - 3 - 4 + 3 + 4 5 DCDout - 6 - 7 - + 6 + 7 + */ m_rs232->rts_w(BIT(data, 1)); |