Skip to content

Commit

Permalink
roland/roland_d70.cpp: Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuavas authored Jan 7, 2025
1 parent 7a0dadb commit 3723f98
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions src/mame/roland/roland_d70.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@
namespace {

// unscramble address: ROM dump offset -> proper (descrambled) offset
#define UNSCRAMBLE_ADDR_INT(_offset) \
bitswap<19>(_offset, 18, 17, 15, 14, 16, 12, 11, 7, 9, 13, 10, 8, 3, 2, 1, 6, 4, 5, 0)
template <typename T>
constexpr auto UNSCRAMBLE_ADDR_INT(T offset)
{
return bitswap<19>(offset, 18, 17, 15, 14, 16, 12, 11, 7, 9, 13, 10, 8, 3, 2, 1, 6, 4, 5, 0);
}
// scramble address: proper offset -> ROM dump offset
#define SCRAMBLE_ADDR_INT(_offset) \
bitswap<19>(_offset, 18, 17, 14, 16, 15, 9, 13, 12, 8, 10, 7, 11, 3, 1, 2, 6, 5, 4, 0)
template <typename T>
constexpr auto SCRAMBLE_ADDR_INT(T offset)
{
return bitswap<19>(offset, 18, 17, 14, 16, 15, 9, 13, 12, 8, 10, 7, 11, 3, 1, 2, 6, 5, 4, 0);
}

#define UNSCRAMBLE_DATA(_data) bitswap<8>(_data, 1, 2, 7, 3, 5, 0, 4, 6)
constexpr u8 UNSCRAMBLE_DATA(u8 data) { return bitswap<8>(data, 1, 2, 7, 3, 5, 0, 4, 6); }

// Bitmasks for the display board interface via PORT1
static constexpr u8 CONT_MASK = 0b10000000;
Expand Down Expand Up @@ -132,7 +138,8 @@ static INPUT_PORTS_START(d70)
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Effect/Ctrl") PORT_CODE(KEYCODE_M)
INPUT_PORTS_END

class roland_d70_state : public driver_device {
class roland_d70_state : public driver_device
{
public:
roland_d70_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
Expand All @@ -157,15 +164,15 @@ class roland_d70_state : public driver_device {
{
}

void d70(machine_config &config);
void init_d70();
void d70(machine_config &config) ATTR_COLD;
void init_d70() ATTR_COLD;

protected:
virtual void machine_start() override ATTR_COLD;

private:
void lcd_map(address_map &map) ATTR_COLD;
void lcd_palette(palette_device &palette) const;
void lcd_palette(palette_device &palette) const ATTR_COLD;

void bank_w(u8 data);
u8 ksga_io_r(offs_t offset);
Expand Down Expand Up @@ -193,8 +200,8 @@ class roland_d70_state : public driver_device {

void d70_map(address_map &map) ATTR_COLD;

void descramble_rom_internal(u8 *dst, const u8 *src);
void descramble_rom_external(u8 *dst, const u8 *src);
void descramble_rom_internal(u8 *dst, const u8 *src) ATTR_COLD;
void descramble_rom_external(u8 *dst, const u8 *src) ATTR_COLD;

memory_view m_bank_view;
memory_share_creator<u16> m_ram;
Expand Down Expand Up @@ -510,13 +517,13 @@ void roland_d70_state::descramble_rom_internal(u8 *dst, const u8 *src) {

ROM_START(d70)
ROM_REGION(0x20000, "maincpu", 0)
ROM_DEFAULT_BIOS("v1.19")
ROM_SYSTEM_BIOS( 0, "v1.19", "Version 1.19 - March 9, 1993" )
ROM_SYSTEM_BIOS( 1, "v1.16", "Version 1.16 - January 28, 1991" )
ROM_SYSTEM_BIOS( 2, "v1.14", "Version 1.14 - September 20, 1990" )
ROM_SYSTEM_BIOS( 3, "v1.12", "Version 1.12 - August 8, 1990" )
ROM_SYSTEM_BIOS( 4, "v1.10", "Version 1.10 - April 19, 1990" )
ROM_SYSTEM_BIOS( 5, "v1.00", "Version 1.00 - March 10, 1990" )
ROM_DEFAULT_BIOS("v119")
ROM_SYSTEM_BIOS( 0, "v119", "Version 1.19 - March 9, 1993" )
ROM_SYSTEM_BIOS( 1, "v116", "Version 1.16 - January 28, 1991" )
ROM_SYSTEM_BIOS( 2, "v114", "Version 1.14 - September 20, 1990" )
ROM_SYSTEM_BIOS( 3, "v112", "Version 1.12 - August 8, 1990" )
ROM_SYSTEM_BIOS( 4, "v110", "Version 1.10 - April 19, 1990" )
ROM_SYSTEM_BIOS( 5, "v100", "Version 1.00 - March 10, 1990" )

ROMX_LOAD("roland_d70_v1.19_a_even.ic4", 0, 0x10000, CRC(95fcf250) SHA1(174962eb42f56aaf936aeca4db77228bf19ec97a), ROM_BIOS(0) | ROM_SKIP(1) )
ROMX_LOAD("roland_d70_v1.19_b_odd.ic9", 1, 0x10000, CRC(a14f0ce1) SHA1(9ef2d62b1be5c38b9fa0072a5889b8ab0e47623e), ROM_BIOS(0) | ROM_SKIP(1) )
Expand Down

0 comments on commit 3723f98

Please sign in to comment.