From 201b0936bbd2d2ed85b7ab02e28a1a51c71815f0 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 19 Aug 2022 00:22:09 +1000 Subject: Cleanup of various recently-changed files. --- src/devices/cpu/pic16c5x/pic16c5x.cpp | 42 ++++----- src/devices/machine/spifi3.cpp | 14 +-- src/mame/misc/magicard.cpp | 157 ++++++++++++++++++---------------- src/mame/sony_news/cxd8442q.cpp | 6 +- src/mame/sony_news/cxd8452aq.cpp | 18 ++-- src/mame/sony_news/dmac3.cpp | 4 +- 6 files changed, 125 insertions(+), 116 deletions(-) diff --git a/src/devices/cpu/pic16c5x/pic16c5x.cpp b/src/devices/cpu/pic16c5x/pic16c5x.cpp index ee1dcabc4fd..43d7c4ae095 100644 --- a/src/devices/cpu/pic16c5x/pic16c5x.cpp +++ b/src/devices/cpu/pic16c5x/pic16c5x.cpp @@ -273,7 +273,7 @@ void pic16c5x_device::update_internalram_ptr() * Shortcuts ************************************************************************/ -#define CLR(flagreg, flag) ( flagreg &= (uint8_t)(~flag) ) +#define CLR(flagreg, flag) ( flagreg &= uint8_t(~flag) ) #define SET(flagreg, flag) ( flagreg |= flag ) @@ -292,7 +292,7 @@ void pic16c5x_device::CALCULATE_Z_FLAG() void pic16c5x_device::CALCULATE_ADD_CARRY() { - if ((uint8_t)(m_old_data) > (uint8_t)(m_ALU)) { + if (uint8_t(m_old_data) > uint8_t(m_ALU)) { SET(STATUS, C_FLAG); } else { @@ -302,7 +302,7 @@ void pic16c5x_device::CALCULATE_ADD_CARRY() void pic16c5x_device::CALCULATE_ADD_DIGITCARRY() { - if (((uint8_t)(m_old_data) & 0x0f) > ((uint8_t)(m_ALU) & 0x0f)) { + if ((uint8_t(m_old_data) & 0x0f) > (uint8_t(m_ALU) & 0x0f)) { SET(STATUS, DC_FLAG); } else { @@ -312,7 +312,7 @@ void pic16c5x_device::CALCULATE_ADD_DIGITCARRY() void pic16c5x_device::CALCULATE_SUB_CARRY() { - if ((uint8_t)(m_old_data) < (uint8_t)(m_ALU)) { + if (uint8_t(m_old_data) < uint8_t(m_ALU)) { CLR(STATUS, C_FLAG); } else { @@ -322,7 +322,7 @@ void pic16c5x_device::CALCULATE_SUB_CARRY() void pic16c5x_device::CALCULATE_SUB_DIGITCARRY() { - if (((uint8_t)(m_old_data) & 0x0f) < ((uint8_t)(m_ALU) & 0x0f)) { + if ((uint8_t(m_old_data) & 0x0f) < (uint8_t(m_ALU) & 0x0f)) { CLR(STATUS, DC_FLAG); } else { @@ -365,7 +365,7 @@ uint8_t pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory * case 0: /* Not an actual register, so return 0 */ data = 0; break; - case 4: data = (FSR | (uint8_t)(~m_picRAMmask)); + case 4: data = (FSR | uint8_t(~m_picRAMmask)); break; case 5: /* read port A */ if (m_picmodel == 0x1650) { @@ -377,7 +377,7 @@ uint8_t pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory * else { data = m_read_a(PIC16C5x_PORTA, 0xff); data &= m_TRISA; - data |= ((uint8_t)(~m_TRISA) & PORTA); + data |= (uint8_t(~m_TRISA) & PORTA); data &= 0x0f; /* 4-bit port (only lower 4 bits used) */ } break; @@ -388,7 +388,7 @@ uint8_t pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory * else if (m_picmodel != 0x1655) { /* B is output-only on 1655 */ data = m_read_b(PIC16C5x_PORTB, 0xff); data &= m_TRISB; - data |= ((uint8_t)(~m_TRISB) & PORTB); + data |= (uint8_t(~m_TRISB) & PORTB); } break; case 7: /* read port C */ @@ -398,7 +398,7 @@ uint8_t pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory * else if ((m_picmodel == 0x16C55) || (m_picmodel == 0x16C57)) { data = m_read_c(PIC16C5x_PORTC, 0xff); data &= m_TRISC; - data |= ((uint8_t)(~m_TRISC) & PORTC); + data |= (uint8_t(~m_TRISC) & PORTC); } else { /* PIC16C54, PIC16C56, PIC16C58 */ data = M_RDRAM(addr); @@ -441,9 +441,9 @@ void pic16c5x_device::STORE_REGFILE(offs_t addr, uint8_t data) /* Write to in case 2: PCL = data; m_PC = ((STATUS & PA_REG) << 4) | data; break; - case 3: STATUS = (STATUS & (TO_FLAG | PD_FLAG)) | (data & (uint8_t)(~(TO_FLAG | PD_FLAG))); + case 3: STATUS = (STATUS & (TO_FLAG | PD_FLAG)) | (data & uint8_t(~(TO_FLAG | PD_FLAG))); break; - case 4: FSR = (data | (uint8_t)(~m_picRAMmask)); + case 4: FSR = (data | uint8_t(~m_picRAMmask)); break; case 5: /* write port A */ if (m_picmodel == 0x1650) { @@ -451,7 +451,7 @@ void pic16c5x_device::STORE_REGFILE(offs_t addr, uint8_t data) /* Write to in } else if (m_picmodel != 0x1655) { /* A is input-only on 1655 */ data &= 0x0f; /* 4-bit port (only lower 4 bits used) */ - m_write_a(PIC16C5x_PORTA, data & (uint8_t)(~m_TRISA) & 0x0f, (uint8_t)(~m_TRISA) & 0x0f); + m_write_a(PIC16C5x_PORTA, data & uint8_t(~m_TRISA) & 0x0f, uint8_t(~m_TRISA) & 0x0f); } PORTA = data; break; @@ -460,7 +460,7 @@ void pic16c5x_device::STORE_REGFILE(offs_t addr, uint8_t data) /* Write to in m_write_b(PIC16C5x_PORTB, data, 0xff); } else { - m_write_b(PIC16C5x_PORTB, data & (uint8_t)(~m_TRISB), (uint8_t)(~m_TRISB)); + m_write_b(PIC16C5x_PORTB, data & uint8_t(~m_TRISB), uint8_t(~m_TRISB)); } PORTB = data; break; @@ -469,7 +469,7 @@ void pic16c5x_device::STORE_REGFILE(offs_t addr, uint8_t data) /* Write to in m_write_c(PIC16C5x_PORTC, data, 0xff); } else if ((m_picmodel == 0x16C55) || (m_picmodel == 0x16C57)) { - m_write_c(PIC16C5x_PORTC, data & (uint8_t)(~m_TRISC), (uint8_t)(~m_TRISC)); + m_write_c(PIC16C5x_PORTC, data & uint8_t(~m_TRISC), uint8_t(~m_TRISC)); } PORTC = data; /* also writes to RAM */ break; @@ -608,7 +608,7 @@ void pic16c5x_device::clrwdt() void pic16c5x_device::comf() { - m_ALU = (uint8_t)(~(GET_REGFILE(ADDR))); + m_ALU = uint8_t(~(GET_REGFILE(ADDR))); STORE_RESULT(ADDR, m_ALU); CALCULATE_Z_FLAG(); } @@ -758,12 +758,12 @@ void pic16c5x_device::tris() switch(m_opcode.b.l & 0x7) { case 5: if (m_TRISA == m_W) break; - else { m_TRISA = m_W | 0xf0; m_write_a(PIC16C5x_PORTA, PORTA & (uint8_t)(~m_TRISA) & 0x0f, (uint8_t)(~m_TRISA) & 0x0f); break; } + else { m_TRISA = m_W | 0xf0; m_write_a(PIC16C5x_PORTA, PORTA & uint8_t(~m_TRISA) & 0x0f, uint8_t(~m_TRISA) & 0x0f); break; } case 6: if (m_TRISB == m_W) break; - else { m_TRISB = m_W; m_write_b(PIC16C5x_PORTB, PORTB & (uint8_t)(~m_TRISB), (uint8_t)(~m_TRISB)); break; } + else { m_TRISB = m_W; m_write_b(PIC16C5x_PORTB, PORTB & uint8_t(~m_TRISB), uint8_t(~m_TRISB)); break; } case 7: if ((m_picmodel == 0x16C55) || (m_picmodel == 0x16C57)) { if (m_TRISC == m_W) break; - else { m_TRISC = m_W; m_write_c(PIC16C5x_PORTC, PORTC & (uint8_t)(~m_TRISC), (uint8_t)(~m_TRISC)); break; } + else { m_TRISC = m_W; m_write_c(PIC16C5x_PORTC, PORTC & uint8_t(~m_TRISC), uint8_t(~m_TRISC)); break; } } else { illegal(); break; @@ -976,7 +976,7 @@ void pic16c5x_device::state_import(const device_state_entry &entry) PORTD = m_debugger_temp; break; case PIC16C5x_FSR: - FSR = ((m_debugger_temp & m_picRAMmask) | (uint8_t)(~m_picRAMmask)); + FSR = ((m_debugger_temp & m_picRAMmask) | uint8_t(~m_picRAMmask)); break; case PIC16C5x_PSCL: m_prescaler = m_debugger_temp; @@ -1007,7 +1007,7 @@ void pic16c5x_device::state_export(const device_state_entry &entry) m_debugger_temp = PORTD; break; case PIC16C5x_FSR: - m_debugger_temp = ((FSR) & m_picRAMmask) | (uint8_t)(~m_picRAMmask); + m_debugger_temp = ((FSR) & m_picRAMmask) | uint8_t(~m_picRAMmask); break; } } @@ -1050,7 +1050,7 @@ void pic16c5x_device::pic16c5x_reset_regs() m_TRISC = 0xff; m_OPTION = (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); PCL = 0xff; - FSR |= (uint8_t)(~m_picRAMmask); + FSR |= uint8_t(~m_picRAMmask); m_prescaler = 0; m_delay_timer = 0; m_inst_cycles = 0; diff --git a/src/devices/machine/spifi3.cpp b/src/devices/machine/spifi3.cpp index 0e6d2f0b697..d7a2b40719c 100644 --- a/src/devices/machine/spifi3.cpp +++ b/src/devices/machine/spifi3.cpp @@ -250,13 +250,13 @@ namespace } } -spifi3_device::spifi3_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) - : nscsi_device(mconfig, SPIFI3, tag, owner, clock), - nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF), - m_even_fifo(), - m_odd_fifo(), - m_irq_handler(*this), - m_drq_handler(*this) +spifi3_device::spifi3_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : + nscsi_device(mconfig, SPIFI3, tag, owner, clock), + nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF), + m_even_fifo(), + m_odd_fifo(), + m_irq_handler(*this), + m_drq_handler(*this) { } diff --git a/src/mame/misc/magicard.cpp b/src/mame/misc/magicard.cpp index 24e270a61f7..13205c12bff 100644 --- a/src/mame/misc/magicard.cpp +++ b/src/mame/misc/magicard.cpp @@ -13,11 +13,11 @@ - Verify RAM config on PCBs; - I/Os; - UART; - - hook-up pic16f84 when emulation available + - hook-up PIC16F84 when emulation available - hotslots, quingo: sets up 68070 timer chs 1 & 2, currently unsupported; - bigdeal0: locks with 68070 continually executing address error exception - - determine what drives int1_w. (It's rtc on boards with rtc) (Not all games use this) - - Correct memory map - at the moment rom is mapped to several address spaces for + - determine what drives int1_w. (It's RTC on boards with RTC) (Not all games use this) + - Correct memory map - at the moment ROM is mapped to several address spaces for all games. This is probably wrong. - dallaspk produces white noise after some sounds. @@ -205,6 +205,8 @@ #define CLOCK_B XTAL(8'000'000) #define CLOCK_C XTAL(19'660'800) +namespace { + enum { I2C_CPU = 0, @@ -226,6 +228,14 @@ public: void magicard_base(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + uint32_t screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void ramdac_map(address_map &map); + void dram_w(offs_t offset, uint16_t data, uint16_t mem_mask); uint16_t dram_r(offs_t offset, uint16_t mem_mask); void mcu_dram_w(offs_t offset, uint16_t data, uint16_t mem_mask); @@ -236,10 +246,14 @@ public: DECLARE_WRITE_LINE_MEMBER(cpu_int1); -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(scc66470_irq); + DECLARE_WRITE_LINE_MEMBER(cpu_i2c_scl); + DECLARE_WRITE_LINE_MEMBER(cpu_i2c_sda_write); + DECLARE_READ_LINE_MEMBER(cpu_i2c_sda_read); + + void update_sda(uint8_t device, uint8_t state); + void update_scl(uint8_t device, uint8_t state); + required_device m_maincpu; required_device m_screen; required_device m_palette; @@ -249,19 +263,10 @@ protected: uint8_t m_sda_state; uint8_t m_scl_state; - void ramdac_map(address_map &map); - - DECLARE_WRITE_LINE_MEMBER(scc66470_irq); - DECLARE_WRITE_LINE_MEMBER(cpu_i2c_scl); - DECLARE_WRITE_LINE_MEMBER(cpu_i2c_sda_write); - DECLARE_READ_LINE_MEMBER(cpu_i2c_sda_read); - - void update_sda(uint8_t device, uint8_t state); - void update_scl(uint8_t device, uint8_t state); - private: void scc66470_map(address_map &map); - std::unique_ptrm_dram; + + std::unique_ptr m_dram; }; @@ -282,16 +287,16 @@ protected: virtual void machine_start() override; private: - required_device m_nvram; - required_device m_ds1207; - - std::unique_ptr m_nvram8; - void magicard_map(address_map &map); uint8_t nvram_r(offs_t offset); void nvram_w(offs_t offset, uint8_t data); uint8_t read_ds1207(offs_t offset); void write_ds1207(offs_t offset, uint8_t data); + + required_device m_nvram; + required_device m_ds1207; + + std::unique_ptr m_nvram8; }; class hotslots_state : public magicard_base_state @@ -311,10 +316,6 @@ public: void puzzleme(machine_config &config); private: - optional_device m_ds2401; - optional_device m_ds1207; - required_device m_rtc; - void hotslots_map_base(address_map &map); void hotslots_map(address_map &map); void puzzleme_map(address_map &map); @@ -324,11 +325,15 @@ private: void output_w(offs_t offset, uint16_t data); DECLARE_WRITE_LINE_MEMBER(cpu_int1); + + optional_device m_ds2401; + optional_device m_ds1207; + required_device m_rtc; }; void magicard_base_state::machine_start() { - m_dram = make_unique_clear(0x80000/2); + m_dram = make_unique_clear(0x80000/2); save_pointer(NAME(m_dram), 0x80000/2); save_item(NAME(m_sda_state)); save_item(NAME(m_scl_state)); @@ -337,7 +342,7 @@ void magicard_base_state::machine_start() void magicard_state::machine_start() { magicard_base_state::machine_start(); - m_nvram8 = std::make_unique(16384); + m_nvram8 = std::make_unique(16384); m_nvram->set_base(m_nvram8.get(),16384); } @@ -479,14 +484,14 @@ void hotslots_state::output_w(offs_t offset, uint16_t data) void magicard_state::magicard_map(address_map &map) { map(0x00000000, 0x001fffff).m(m_scc66470, FUNC(scc66470_device::map)); - map(0x00000000, 0x0017ffff).rw(FUNC(magicard_base_state::mcu_dram_r), FUNC(magicard_base_state::mcu_dram_w)); + map(0x00000000, 0x0017ffff).rw(FUNC(magicard_state::mcu_dram_r), FUNC(magicard_state::mcu_dram_w)); map(0x00180000, 0x001dffff).rom().region("maincpu", 0); // boot vectors point here map(0x001e0000, 0x001e7fff).rw(FUNC(magicard_state::nvram_r), FUNC(magicard_state::nvram_w)).umask16(0x00ff); map(0x00200000, 0x003fffff).rw(m_scc66470, FUNC(scc66470_device::ipa_r), FUNC(scc66470_device::ipa_w)); /* 001ffc00-001ffdff System I/O */ map(0x001ffc00, 0x001ffc01).portr("SW0"); map(0x001ffc40, 0x001ffc41).portr("SW1"); - map(0x001ffc80, 0x001ffc81).w( FUNC(magicard_base_state::output_w)); + map(0x001ffc80, 0x001ffc81).w( FUNC(magicard_state::output_w)); map(0x001ffd01, 0x001ffd01).w("ramdac", FUNC(ramdac_device::index_w)); map(0x001ffd03, 0x001ffd03).w("ramdac", FUNC(ramdac_device::pal_w)); map(0x001ffd05, 0x001ffd05).w("ramdac", FUNC(ramdac_device::mask_w)); @@ -499,7 +504,7 @@ void magicard_state::magicard_map(address_map &map) void hotslots_state::hotslots_map_base(address_map &map) { map(0x00000000, 0x001fffff).m(m_scc66470, FUNC(scc66470_device::map)); - map(0x00000000, 0x0017ffff).rw(FUNC(magicard_base_state::mcu_dram_r), FUNC(magicard_base_state::mcu_dram_w)); + map(0x00000000, 0x0017ffff).rw(FUNC(hotslots_state::mcu_dram_r), FUNC(hotslots_state::mcu_dram_w)); map(0x00180000, 0x001ffbff).rom().region("maincpu", 0); // boot vectors point here map(0x00200000, 0x003fffff).rw(m_scc66470, FUNC(scc66470_device::ipa_r), FUNC(scc66470_device::ipa_w)); map(0x00600000, 0x0067fbff).rom().region("maincpu", 0); // boot vectors point here @@ -540,29 +545,29 @@ static INPUT_PORTS_START( magicard ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Remote 2") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Remote 1") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Remote 2") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Remote 1") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet/Clear/Collect") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet/Clear/Collect") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Hold 5") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Rental Book Keeping") PORT_TOGGLE - PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Owner Book Keeping") + PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_TOGGLE PORT_NAME("Rental Book Keeping") + PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Owner Book Keeping") - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Hold 4") - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2") - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Pay Out") - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hopper Count") PORT_CODE(KEYCODE_W) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Accounting 3") PORT_TOGGLE + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Pay Out") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hopper Count") PORT_CODE(KEYCODE_Q) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_TOGGLE PORT_NAME("Accounting 3") PORT_START("SW1") PORT_DIPNAME( 0x80, 0x80, "Hopper" ) PORT_DIPLOCATION("DIP 1:1") @@ -592,14 +597,14 @@ static INPUT_PORTS_START( magicard ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hopper Full") PORT_CODE(KEYCODE_A) PORT_TOGGLE - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 9") - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 8") - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 7") - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 6") - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 5") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) PORT_NAME("Door Switch") PORT_TOGGLE - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Clear Credit") PORT_CODE(KEYCODE_J) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_TOGGLE PORT_NAME("Hopper Full") PORT_CODE(KEYCODE_A) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 9") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 8") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 7") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 6") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_NAME("Reserve In 5") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) PORT_TOGGLE PORT_NAME("Door Switch") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Clear Credit") PORT_CODE(KEYCODE_J) INPUT_PORTS_END @@ -619,15 +624,15 @@ static INPUT_PORTS_START( puzzleme ) PORT_START("SW0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Remote") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Remote") PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Clear") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Show All Book Keeping") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Clear") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Show All Book Keeping") PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Rental Book Keeping") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Owner Book Keeping") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Rental Book Keeping") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Owner Book Keeping") PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) @@ -662,10 +667,10 @@ static INPUT_PORTS_START( lucky7i ) PORT_MODIFY("SW0") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Win Plan Scroll/Collect") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Einsatz") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start/Gamble") - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Rental Book Keeping") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Win Plan Scroll/Collect") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Einsatz") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start/Gamble") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Rental Book Keeping") PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -704,7 +709,7 @@ static INPUT_PORTS_START( lucky7i ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Attendant Collect") PORT_CODE(KEYCODE_A) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Attendant Collect") INPUT_PORTS_END @@ -758,8 +763,8 @@ INPUT_PORTS_END void magicard_base_state::machine_reset() { - uint16_t *src = (uint16_t*)memregion("maincpu")->base(); - m_scc66470->set_vectors( src ); + uint16_t *const src = (uint16_t *)memregion("maincpu")->base(); + m_scc66470->set_vectors(src); m_sda_state = 0; m_scl_state = 0; @@ -777,7 +782,7 @@ WRITE_LINE_MEMBER(magicard_base_state::scc66470_irq) WRITE_LINE_MEMBER(magicard_base_state::cpu_int1) { - // todo: is this used by games on magicard hardware ? + // TODO: is this used by games on magicard hardware ? m_maincpu->int1_w(1); m_maincpu->int1_w(0); } @@ -866,7 +871,7 @@ void magicard_state::magicard(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &magicard_state::magicard_map); - m_screen->screen_vblank().set(FUNC(magicard_base_state::cpu_int1)); + m_screen->screen_vblank().set(FUNC(magicard_state::cpu_int1)); SAA1099(config, "saa", CLOCK_B).add_route(ALL_OUTPUTS, "mono", 1.0); @@ -880,8 +885,8 @@ void magicard_state::magicard_pic54(machine_config &config) magicard(config); pic16c54_device &pic(PIC16C54(config, "pic16c54", 3686400)); // correct? - pic.read_b().set(FUNC(magicard_base_state::pic_portb_r)); - pic.write_b().set(FUNC(magicard_base_state::pic_portb_w)); + pic.read_b().set(FUNC(magicard_state::pic_portb_r)); + pic.write_b().set(FUNC(magicard_state::pic_portb_w)); } void magicard_state::unkte06(machine_config &config) @@ -889,8 +894,8 @@ void magicard_state::unkte06(machine_config &config) magicard(config); pic16c56_device &pic(PIC16C56(config, "pic16c56", 3686400)); // correct? - pic.read_b().set(FUNC(magicard_base_state::pic_portb_r)); - pic.write_b().set(FUNC(magicard_base_state::pic_portb_w)); + pic.read_b().set(FUNC(magicard_state::pic_portb_r)); + pic.write_b().set(FUNC(magicard_state::pic_portb_w)); } uint8_t magicard_base_state::pic_portb_r() @@ -931,8 +936,8 @@ void hotslots_state::hotslots_pic54(machine_config &config) hotslots(config); pic16c54_device &pic(PIC16C54(config, "pic16c54", 3686400)); // correct? - pic.read_b().set(FUNC(magicard_base_state::pic_portb_r)); - pic.write_b().set(FUNC(magicard_base_state::pic_portb_w)); + pic.read_b().set(FUNC(hotslots_state::pic_portb_r)); + pic.write_b().set(FUNC(hotslots_state::pic_portb_w)); } void hotslots_state::magicle(machine_config &config) @@ -949,8 +954,8 @@ void hotslots_state::puzzleme(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &hotslots_state::puzzleme_map); pic16c54_device &pic(PIC16C54(config, "pic16c54", 3686400)); // correct? - pic.read_b().set(FUNC(magicard_base_state::pic_portb_r)); - pic.write_b().set(FUNC(magicard_base_state::pic_portb_w)); + pic.read_b().set(FUNC(hotslots_state::pic_portb_r)); + pic.write_b().set(FUNC(hotslots_state::pic_portb_w)); I2C_24C02(config, m_i2cmem).set_e0(1); @@ -2151,6 +2156,8 @@ ROM_START( kajotcrd ) ROM_LOAD( "ds2401", 0x000000, 0x000008, BAD_DUMP CRC(3f87b999) SHA1(29649749d521ced9dc7ef1d0d6ddb9a8beea360f) ) // created to match game ROM_END +} // anonymous namespace + /************************* * Game Drivers * diff --git a/src/mame/sony_news/cxd8442q.cpp b/src/mame/sony_news/cxd8442q.cpp index 5997ca100b4..f0beb0ae0b5 100644 --- a/src/mame/sony_news/cxd8442q.cpp +++ b/src/mame/sony_news/cxd8442q.cpp @@ -56,9 +56,9 @@ namespace } } -cxd8442q_device::cxd8442q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, CXD8442Q, tag, owner, clock), out_irq(*this), - fifo_channels{{ *this }, { *this }, { *this }, { *this }} +cxd8442q_device::cxd8442q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, CXD8442Q, tag, owner, clock), out_irq(*this), + fifo_channels{{ *this }, { *this }, { *this }, { *this }} { } diff --git a/src/mame/sony_news/cxd8452aq.cpp b/src/mame/sony_news/cxd8452aq.cpp index 8501e0c3a93..3e93d96d75b 100644 --- a/src/mame/sony_news/cxd8452aq.cpp +++ b/src/mame/sony_news/cxd8452aq.cpp @@ -43,14 +43,16 @@ namespace static constexpr int DMA_TIMER = 100; } -cxd8452aq_device::cxd8452aq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, CXD8452AQ, tag, owner, clock), - device_memory_interface(mconfig, *this), - main_bus_config("main_bus", ENDIANNESS_BIG, 32, 32, 0), - sonic_config("sonic", ENDIANNESS_BIG, 32, 32, 0, address_map_constructor(FUNC(cxd8452aq_device::sonic_bus_map), this)), - m_irq_handler(*this), - m_apbus_virt_to_phys_callback(*this), - m_bus(*this, finder_base::DUMMY_TAG, -1, 64) {} +cxd8452aq_device::cxd8452aq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, CXD8452AQ, tag, owner, clock), + device_memory_interface(mconfig, *this), + main_bus_config("main_bus", ENDIANNESS_BIG, 32, 32, 0), + sonic_config("sonic", ENDIANNESS_BIG, 32, 32, 0, address_map_constructor(FUNC(cxd8452aq_device::sonic_bus_map), this)), + m_irq_handler(*this), + m_apbus_virt_to_phys_callback(*this), + m_bus(*this, finder_base::DUMMY_TAG, -1, 64) +{ +} void cxd8452aq_device::map(address_map &map) { diff --git a/src/mame/sony_news/dmac3.cpp b/src/mame/sony_news/dmac3.cpp index f5879f2cdf7..cc240117dca 100644 --- a/src/mame/sony_news/dmac3.cpp +++ b/src/mame/sony_news/dmac3.cpp @@ -17,8 +17,8 @@ DEFINE_DEVICE_TYPE(DMAC3, dmac3_device, "dmac3", "Sony CXD8403Q DMAC3 DMA Controller") -dmac3_device::dmac3_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) - : device_t(mconfig, DMAC3, tag, owner, clock), m_bus(*this, finder_base::DUMMY_TAG, -1, 64), +dmac3_device::dmac3_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : + device_t(mconfig, DMAC3, tag, owner, clock), m_bus(*this, finder_base::DUMMY_TAG, -1, 64), m_irq_handler(*this), m_dma_r(*this), m_dma_w(*this), -- cgit v1.2.3