From fd22eaeb3e1dc4f3b3ad9d7663d8d425df6eb34e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 26 Sep 2024 02:39:22 +1000 Subject: sega/megadriv_acbl.cpp, skeleton/zorbakbd.cpp: Sorted DIP switch options. Order coinage options from least to most generous, put off to the left of on. --- src/devices/cpu/arm7/arm7.cpp | 8 ++------ src/mame/igs/pgmcrypt.cpp | 12 ++++++------ src/mame/sega/megadriv_acbl.cpp | 30 +++++++++++++++--------------- src/mame/sega/megadriv_acbl.h | 16 ++++++++-------- src/mame/skeleton/zorbakbd.cpp | 6 +++--- 5 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp index 847c3eb3e60..4e9c74a6861 100644 --- a/src/devices/cpu/arm7/arm7.cpp +++ b/src/devices/cpu/arm7/arm7.cpp @@ -1460,12 +1460,10 @@ void arm7_cpu_device::execute_run() /* handle Thumb instructions if active */ if (T_IS_SET(m_r[eCPSR])) { - offs_t raddr; - pc = m_r[eR15]; // "In Thumb state, bit [0] is undefined and must be ignored. Bits [31:1] contain the PC." - raddr = pc & (~1); + offs_t const raddr = pc & ~uint32_t(1); if (!insn_fetch_thumb(raddr, insn)) { @@ -1477,12 +1475,10 @@ void arm7_cpu_device::execute_run() } else { - offs_t raddr; - /* load 32 bit instruction */ // "In ARM state, bits [1:0] of r15 are undefined and must be ignored. Bits [31:2] contain the PC." - raddr = pc & (~3); + offs_t const raddr = pc & ~uint32_t(3); if (!insn_fetch_arm(raddr, insn)) { diff --git a/src/mame/igs/pgmcrypt.cpp b/src/mame/igs/pgmcrypt.cpp index bf753b1b820..d243259bd32 100644 --- a/src/mame/igs/pgmcrypt.cpp +++ b/src/mame/igs/pgmcrypt.cpp @@ -30,19 +30,19 @@ #define IGS27_CRYPT1_ALT \ if ((i & 0x040080) != 0x000080) x ^= 0x0001; #define IGS27_CRYPT1_ALT2 \ - if ((i & 0x0480) != 0x0080) x ^= 0x0001; + if ((i & 0x000480) != 0x000080) x ^= 0x0001; #define IGS27_CRYPT2 \ if ((i & 0x104008) == 0x104008) x ^= 0x0002; #define IGS27_CRYPT2_ALT \ if ((i & 0x004008) == 0x004008) x ^= 0x0002; #define IGS27_CRYPT2_ALT2 \ - if((i & 0x004008) == 0x004008 && (i & 0x180000) != 0x000000) x ^= 0x0002; + if ((i & 0x004008) == 0x004008 && (i & 0x180000) != 0x000000) x ^= 0x0002; #define IGS27_CRYPT2_ALT3 \ - if((i & 0x84008) == 0x84008) x ^= 0x0002; + if ((i & 0x084008) == 0x084008) x ^= 0x0002; #define IGS27_CRYPT3 \ if ((i & 0x080030) == 0x080010) x ^= 0x0004; #define IGS27_CRYPT3_ALT \ - if((i & 0x000030) == 0x000010 && (i & 0x180000) != 0x080000) x ^= 0x0004; + if ((i & 0x000030) == 0x000010 && (i & 0x180000) != 0x080000) x ^= 0x0004; #define IGS27_CRYPT3_ALT2 \ if ((i & 0x000030) == 0x000010) x ^= 0x0004; // ket - due to address starting at 0 and not 100000/2! @@ -55,7 +55,7 @@ #define IGS27_CRYPT5 \ if ((i & 0x008100) == 0x008000) x ^= 0x0010; #define IGS27_CRYPT5_ALT \ - if ((i & 0x48100) == 0x48000) x ^= 0x0010; + if ((i & 0x048100) == 0x048000) x ^= 0x0010; #define IGS27_CRYPT6 \ if ((i & 0x002004) != 0x000004) x ^= 0x0020; #define IGS27_CRYPT6_ALT \ @@ -63,7 +63,7 @@ #define IGS27_CRYPT7 \ if ((i & 0x011800) != 0x010000) x ^= 0x0040; #define IGS27_CRYPT7_ALT \ - if ((i & 0x01800) != 0x00000) x ^= 0x0040; + if ((i & 0x001800) != 0x000000) x ^= 0x0040; #define IGS27_CRYPT8 \ if ((i & 0x004820) == 0x004820) x ^= 0x0080; #define IGS27_CRYPT8_ALT \ diff --git a/src/mame/sega/megadriv_acbl.cpp b/src/mame/sega/megadriv_acbl.cpp index d6f9a0dd06b..db0fc731fba 100644 --- a/src/mame/sega/megadriv_acbl.cpp +++ b/src/mame/sega/megadriv_acbl.cpp @@ -684,7 +684,7 @@ INPUT_PORTS_START( srmdb ) PORT_DIPSETTING( 0x00, "6" ) INPUT_PORTS_END -INPUT_PORTS_START( barekch ) // TODO: identify dips. PCB has 3 x 8-dip banks, but probably most unused +INPUT_PORTS_START( barekch ) // TODO: identify DIP switches. PCB has 3 x 8-switch banks, but probably most unused PORT_INCLUDE( md_common ) PORT_MODIFY("PAD1") @@ -806,24 +806,24 @@ INPUT_PORTS_END INPUT_PORTS_START( barek2 ) PORT_INCLUDE( md_common ) - PORT_START("dsw") + PORT_START("DSW") PORT_DIPNAME(0x0f, 0x0f, DEF_STR( Coinage )) + PORT_DIPSETTING( 0x05, DEF_STR( 6C_1C )) + PORT_DIPSETTING( 0x06, DEF_STR( 5C_1C )) + PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C )) + PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C )) + PORT_DIPSETTING( 0x01, DEF_STR( 8C_3C )) + PORT_DIPSETTING( 0x09, DEF_STR( 2C_1C )) + PORT_DIPSETTING( 0x02, DEF_STR( 5C_3C )) + PORT_DIPSETTING( 0x03, DEF_STR( 3C_2C )) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) // duplicate + PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C )) PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C )) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C )) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C )) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C )) PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C )) - PORT_DIPSETTING( 0x09, DEF_STR( 2C_1C )) - PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C )) - PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C )) - PORT_DIPSETTING( 0x06, DEF_STR( 5C_1C )) - PORT_DIPSETTING( 0x05, DEF_STR( 6C_1C )) - PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C )) - PORT_DIPSETTING( 0x03, DEF_STR( 3C_2C )) - PORT_DIPSETTING( 0x02, DEF_STR( 5C_3C )) - PORT_DIPSETTING( 0x01, DEF_STR( 8C_3C )) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) // duplicate PORT_DIPNAME(0x30, 0x30, DEF_STR( Lives )) PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "2" ) @@ -835,7 +835,7 @@ INPUT_PORTS_START( barek2 ) PORT_DIPSETTING( 0x40, DEF_STR( Hard )) PORT_DIPSETTING( 0x00, DEF_STR( Hardest )) - PORT_START("in0") + PORT_START("IN0") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN) @@ -966,9 +966,9 @@ void md_boot_mcu_state::md_boot_mcu(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &md_boot_mcu_state::md_boot_mcu_map); - PIC16C57(config, m_mcu, 4000000); // unknown clock + PIC16C57(config, m_mcu, 4'000'000); // unknown clock m_mcu->write_a().set(FUNC(md_boot_mcu_state::mcu_porta_w)); - m_mcu->read_b().set_ioport("in0"); + m_mcu->read_b().set_ioport("IN0"); m_mcu->write_b().set(FUNC(md_boot_mcu_state::mcu_portb_w)); m_mcu->read_c().set(FUNC(md_boot_mcu_state::mcu_portc_r)); m_mcu->write_c().set(FUNC(md_boot_mcu_state::mcu_portc_w)); diff --git a/src/mame/sega/megadriv_acbl.h b/src/mame/sega/megadriv_acbl.h index fb76dc57fa0..52e89303ce1 100644 --- a/src/mame/sega/megadriv_acbl.h +++ b/src/mame/sega/megadriv_acbl.h @@ -45,14 +45,14 @@ private: int m_aladmdb_mcu_port = 0; }; -// for games with emulated pic mcu +// for games with emulated PIC microcontroller class md_boot_mcu_state : public md_boot_state { public: md_boot_mcu_state(const machine_config &mconfig, device_type type, const char *tag) : md_boot_state(mconfig, type, tag), m_mcu(*this, "mcu"), - m_dsw(*this, "dsw") + m_dsw(*this, "DSW") { } void md_boot_mcu(machine_config &config); @@ -71,12 +71,12 @@ private: required_device m_mcu; required_ioport m_dsw; - uint8_t m_mcu_porta; - uint8_t m_mcu_portc; - uint8_t m_mcu_in_latch_msb; - uint8_t m_mcu_in_latch_lsb; - uint8_t m_mcu_out_latch_msb; - uint8_t m_mcu_out_latch_lsb; + uint8_t m_mcu_porta = 0; + uint8_t m_mcu_portc = 0; + uint8_t m_mcu_in_latch_msb = 0; + uint8_t m_mcu_in_latch_lsb = 0; + uint8_t m_mcu_out_latch_msb = 0; + uint8_t m_mcu_out_latch_lsb = 0; }; class md_sonic3bl_state : public md_boot_state diff --git a/src/mame/skeleton/zorbakbd.cpp b/src/mame/skeleton/zorbakbd.cpp index 35dc4c4c1cc..2b9aa446d4f 100644 --- a/src/mame/skeleton/zorbakbd.cpp +++ b/src/mame/skeleton/zorbakbd.cpp @@ -220,14 +220,14 @@ INPUT_PORTS_START(zorba_keyboard) PORT_DIPSETTING( 0x01, "6 (Normal)" ) PORT_DIPSETTING( 0x00, "7 (Dump Tables)" ) PORT_DIPNAME( 0x08, 0x08, "Key Repeat" ) PORT_DIPLOCATION("DIP:4") - PORT_DIPSETTING( 0x08, DEF_STR(On) ) PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x08, DEF_STR(On) ) PORT_DIPNAME( 0x10, 0x10, "Baud Rate" ) PORT_DIPLOCATION("DIP:5") - PORT_DIPSETTING( 0x10, "1200" ) PORT_DIPSETTING( 0x00, "300" ) + PORT_DIPSETTING( 0x10, "1200" ) PORT_DIPNAME( 0x20, 0x20, "Key Click" ) PORT_DIPLOCATION("DIP:6") - PORT_DIPSETTING( 0x20, DEF_STR(On) ) PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x20, DEF_STR(On) ) PORT_DIPNAME( 0x40, 0x40, "Synchronous Output" ) PORT_DIPLOCATION("DIP:7") PORT_DIPSETTING( 0x40, DEF_STR(Off) ) PORT_DIPSETTING( 0x00, DEF_STR(On) ) -- cgit v1.2.3