From d6d786c8f02569d3cf0f1f824500a4c351a72ce7 Mon Sep 17 00:00:00 2001 From: cam900 Date: Tue, 7 May 2019 11:54:25 +0900 Subject: [PATCH 1/2] galgames.cpp : Updates Use shared_ptr for OKI RAM, Add save states, Simplify handlers, Fix spacings, Reduce unnecessary lines, Use shorter / correct type values --- src/mame/drivers/galgames.cpp | 578 +++++++++++++++++----------------- 1 file changed, 294 insertions(+), 284 deletions(-) diff --git a/src/mame/drivers/galgames.cpp b/src/mame/drivers/galgames.cpp index f584bc10fe7..fdf61beda3c 100644 --- a/src/mame/drivers/galgames.cpp +++ b/src/mame/drivers/galgames.cpp @@ -68,33 +68,33 @@ class galgames_cart_device : public device_t, public device_rom_interface public: // construction/destruction - galgames_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint8_t cart) - : galgames_cart_device(mconfig, GALGAMES_CART, tag, owner, (uint32_t)0) + galgames_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, u8 cart) + : galgames_cart_device(mconfig, GALGAMES_CART, tag, owner, (u32)0) { set_cart(cart); } // static configuration - void set_cart(uint8_t cart) { m_cart = cart; } + void set_cart(u8 cart) { m_cart = cart; } void set_pic_bits(int clk, int in, int out, int dis); // ROM - DECLARE_READ16_MEMBER(rom_r) { return read_word(offset*2); } + u16 rom_r(offs_t offset) { return read_word(offset*2); } // EEPROM - DECLARE_READ8_MEMBER(eeprom_r); - DECLARE_WRITE8_MEMBER(eeprom_w); + u8 eeprom_r(); + void eeprom_w(u8 data); DECLARE_WRITE_LINE_MEMBER(eeprom_cs_write); // PIC - DECLARE_READ8_MEMBER(pic_status_r); - DECLARE_WRITE8_MEMBER(pic_data_w); - DECLARE_READ8_MEMBER(pic_data_r); + u8 pic_status_r(); + void pic_data_w(u8 data); + u8 pic_data_r(); void set_pic_reset_line(int state); - DECLARE_READ8_MEMBER(int_pic_data_r); - DECLARE_WRITE8_MEMBER(int_pic_data_w); - DECLARE_WRITE8_MEMBER(int_pic_bank_w); + u8 int_pic_data_r(); + void int_pic_data_w(u8 data); + void int_pic_bank_w(u8 data); protected: galgames_cart_device( @@ -102,16 +102,16 @@ protected: device_type type, const char *tag, device_t *owner, - uint32_t clock); + u32 clock); // device-level overrides - virtual void device_start() override { } + virtual void device_start() override; virtual void device_reset() override; virtual void rom_bank_updated() override { } bool is_selected(); - uint8_t m_cart; + u8 m_cart; // SLOT required_device m_slot; @@ -122,10 +122,10 @@ protected: // PIC optional_device m_pic; - uint8_t m_pic_iobits, m_pic_data, m_pic_data_rdy, m_pic_data_bit, m_pic_data_clk; - uint8_t m_pic_clk_mask, m_pic_in_mask, m_pic_out_mask, m_pic_dis_mask; + u8 m_pic_iobits, m_pic_data, m_pic_data_rdy, m_pic_data_bit, m_pic_data_clk; + u8 m_pic_clk_mask, m_pic_in_mask, m_pic_out_mask, m_pic_dis_mask; - void log_cart_comm(const char *text, uint8_t data); + void log_cart_comm(const char *text, u8 data); void pic_comm_reset(); }; @@ -139,8 +139,8 @@ class galgames_bios_cart_device : public galgames_cart_device { public: // construction/destruction - galgames_bios_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint8_t cart) - : galgames_cart_device(mconfig, GALGAMES_BIOS_CART, tag, owner, (uint32_t)0) + galgames_bios_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, u8 cart) + : galgames_cart_device(mconfig, GALGAMES_BIOS_CART, tag, owner, (u32)0) { set_cart(cart); } @@ -164,8 +164,8 @@ class galgames_starpak2_cart_device : public galgames_cart_device { public: // construction/destruction - galgames_starpak2_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint8_t cart) - : galgames_cart_device(mconfig, GALGAMES_STARPAK2_CART, tag, owner, (uint32_t)0) + galgames_starpak2_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, u8 cart) + : galgames_cart_device(mconfig, GALGAMES_STARPAK2_CART, tag, owner, (u32)0) { set_cart(cart); set_pic_bits(5, 4, 2, 1); @@ -194,8 +194,8 @@ class galgames_starpak3_cart_device : public galgames_cart_device { public: // construction/destruction - galgames_starpak3_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint8_t cart) - : galgames_cart_device(mconfig, GALGAMES_STARPAK3_CART, tag, owner, (uint32_t)0) + galgames_starpak3_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, u8 cart) + : galgames_cart_device(mconfig, GALGAMES_STARPAK3_CART, tag, owner, (u32)0) { set_cart(cart); set_pic_bits(0, 2, 3, 4); @@ -231,36 +231,36 @@ class galgames_slot_device : public device_t, public device_memory_interface { public: // construction/destruction - galgames_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + galgames_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); void slot_map(address_map &map); - DECLARE_READ16_MEMBER(read) { return m_space->read_word(offset * 2, mem_mask); } - DECLARE_WRITE16_MEMBER(write) { m_space->write_word(offset * 2, data, mem_mask); } + u16 read(offs_t offset, u16 mem_mask = ~0) { return m_space->read_word(offset * 2, mem_mask); } + void write(offs_t offset, u16 data, u16 mem_mask = ~0) { m_space->write_word(offset * 2, data, mem_mask); } // SLOT - DECLARE_WRITE8_MEMBER(cart_sel_w); - DECLARE_WRITE8_MEMBER(ram_sel_w); + void cart_sel_w(u8 data); + void ram_sel_w(u8 data); // ROM - DECLARE_READ16_MEMBER(rom0_r); - DECLARE_READ16_MEMBER(rom_r); - DECLARE_READ16_MEMBER(rom0_or_ram_r); - DECLARE_READ16_MEMBER(rom_or_ram_r); - DECLARE_WRITE16_MEMBER(ram_w); + u16 rom0_r(offs_t offset); + u16 rom_r(offs_t offset); + u16 rom0_or_ram_r(offs_t offset); + u16 rom_or_ram_r(offs_t offset); + void ram_w(offs_t offset, u16 data, u16 mem_mask = ~0); // PIC - DECLARE_READ8_MEMBER(pic_status_r); - DECLARE_WRITE8_MEMBER(pic_data_w); - DECLARE_READ8_MEMBER(pic_data_r); + u8 pic_status_r(); + void pic_data_w(u8 data); + u8 pic_data_r(); void set_pic_reset_line(int state); // EEPROM - DECLARE_READ8_MEMBER(eeprom_r); - DECLARE_WRITE8_MEMBER(eeprom_w); + u8 eeprom_r(); + void eeprom_w(u8 data); DECLARE_WRITE_LINE_MEMBER(eeprom_cs_write); - uint8_t get_cart() const { return m_cart; } + u8 get_cart() const { return m_cart; } protected: @@ -272,7 +272,7 @@ protected: address_space_config m_space_config; address_space *m_space; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_device m_cart0; @@ -286,7 +286,7 @@ protected: galgames_cart_device *m_carts[1+4]; - uint8_t m_cart; + u8 m_cart; bool m_is_ram_active; }; @@ -307,7 +307,7 @@ galgames_cart_device::galgames_cart_device( device_type type, const char *tag, device_t *owner, - uint32_t clock): + u32 clock): device_t(mconfig, type, tag, owner, clock), device_rom_interface(mconfig, *this, 21, ENDIANNESS_BIG, 16), m_cart(0), @@ -317,6 +317,16 @@ galgames_cart_device::galgames_cart_device( { } +void galgames_cart_device::device_start() +{ + save_item(NAME(m_cart)); + save_item(NAME(m_pic_iobits)); + save_item(NAME(m_pic_data)); + save_item(NAME(m_pic_data_rdy)); + save_item(NAME(m_pic_data_clk)); + save_item(NAME(m_pic_data_bit)); +} + void galgames_cart_device::device_reset() { pic_comm_reset(); @@ -340,12 +350,12 @@ void galgames_cart_device::set_pic_reset_line(int state) m_pic->set_input_line(INPUT_LINE_RESET, state); } -void galgames_cart_device::log_cart_comm(const char *text, uint8_t data) +void galgames_cart_device::log_cart_comm(const char *text, u8 data) { // logerror("%s: comm %-10s %02x - data:%02x bit:%02x rdy:%x clk:%02x\n", machine().describe_context(), -// text, data, m_pic_data, m_pic_data_bit, m_pic_data_rdy, m_pic_data_clk ); +// text, data, m_pic_data, m_pic_data_bit, m_pic_data_rdy, m_pic_data_clk ); -// logerror("%s: comm %-10s %02x\n", machine().describe_context(), text, data ); +// logerror("%s: comm %-10s %02x\n", machine().describe_context(), text, data); } void galgames_cart_device::pic_comm_reset() @@ -357,15 +367,15 @@ void galgames_cart_device::pic_comm_reset() // External PIC status and data interface -READ8_MEMBER(galgames_cart_device::pic_status_r) +u8 galgames_cart_device::pic_status_r() { // bit 7 = data from the cart PIC can be read return (is_selected() && (m_pic_data_rdy == 2)) ? 0x80 : 0; } -READ8_MEMBER(galgames_cart_device::pic_data_r) +u8 galgames_cart_device::pic_data_r() { - if (is_selected()) + if (is_selected() && (!machine().side_effects_disabled())) { m_pic_data_rdy = 0; return m_pic_data; @@ -373,7 +383,7 @@ READ8_MEMBER(galgames_cart_device::pic_data_r) return 0xff; } -WRITE8_MEMBER(galgames_cart_device::pic_data_w) +void galgames_cart_device::pic_data_w(u8 data) { if (is_selected()) { @@ -414,84 +424,83 @@ void galgames_cart_device::set_pic_bits(int clk, int in, int out, int dis) m_pic_dis_mask = 1 << dis; } -READ8_MEMBER(galgames_cart_device::int_pic_data_r) +u8 galgames_cart_device::int_pic_data_r() { - // clock - - uint8_t clk0 = m_pic_data_clk & 0x80; - m_pic_data_clk += 0x10; - uint8_t clk1 = m_pic_data_clk & 0x80; - - m_pic_iobits = (m_pic_iobits & (~m_pic_clk_mask)) | (clk1 ? m_pic_clk_mask : 0); - - // disabled - - bool disabled = !is_selected(); - m_pic_iobits = (m_pic_iobits & (~m_pic_dis_mask)) | (disabled ? m_pic_dis_mask : 0); - - // The PIC waits for a falling edge before reading the new input bit. - // It waits for a rising edge before setting the new output bit. - // Hence we shift the data on the falling edge of the clock. - - if (clk0 && !clk1) + if (!machine().side_effects_disabled()) { - uint8_t bit_in = 0; + // clock + u8 clk0 = m_pic_data_clk & 0x80; + m_pic_data_clk += 0x10; + u8 clk1 = m_pic_data_clk & 0x80; - if (m_pic_data_rdy == 1) + m_pic_iobits = (m_pic_iobits & (~m_pic_clk_mask)) | (clk1 ? m_pic_clk_mask : 0); + + // disabled + bool disabled = !is_selected(); + m_pic_iobits = (m_pic_iobits & (~m_pic_dis_mask)) | (disabled ? m_pic_dis_mask : 0); + + // The PIC waits for a falling edge before reading the new input bit. + // It waits for a rising edge before setting the new output bit. + // Hence we shift the data on the falling edge of the clock. + if (clk0 && !clk1) { - if (m_pic_data_bit == 0xff) - { - // first read bit must be 1 (sync) - bit_in = 1; - m_pic_data_bit = 7; - } - else - { - // read current bit and move to the next - bit_in = BIT(m_pic_data, m_pic_data_bit); - --m_pic_data_bit; + u8 bit_in = 0; + if (m_pic_data_rdy == 1) + { if (m_pic_data_bit == 0xff) { - m_pic_data_rdy = 0; - log_cart_comm("PIC should have READ", m_pic_data); - } - } - } - else if (m_pic_data_rdy == 0) - { - uint8_t bit_out = m_pic_iobits & m_pic_out_mask; - - if (m_pic_data_bit == 0xff) - { - // first written bit must be 1 (sync) - if (bit_out) + // first read bit must be 1 (sync) + bit_in = 1; m_pic_data_bit = 7; + } + else + { + // read current bit and move to the next + bit_in = BIT(m_pic_data, m_pic_data_bit); + --m_pic_data_bit; + + if (m_pic_data_bit == 0xff) + { + m_pic_data_rdy = 0; + log_cart_comm("PIC should have READ", m_pic_data); + } + } } - else + else if (m_pic_data_rdy == 0) { - // write current bit and move to the next - uint8_t mask = 1 << m_pic_data_bit; - m_pic_data = (m_pic_data & (~mask)) | (bit_out ? mask : 0); - --m_pic_data_bit; + u8 bit_out = m_pic_iobits & m_pic_out_mask; if (m_pic_data_bit == 0xff) { - m_pic_data_rdy = 2; - log_cart_comm("PIC should have WRITTEN", m_pic_data); + // first written bit must be 1 (sync) + if (bit_out) + m_pic_data_bit = 7; + } + else + { + // write current bit and move to the next + u8 mask = 1 << m_pic_data_bit; + m_pic_data = (m_pic_data & (~mask)) | (bit_out ? mask : 0); + --m_pic_data_bit; + + if (m_pic_data_bit == 0xff) + { + m_pic_data_rdy = 2; + log_cart_comm("PIC should have WRITTEN", m_pic_data); + } } } + + m_pic_iobits = (m_pic_iobits & (~m_pic_in_mask)) | (bit_in ? m_pic_in_mask : 0); } - m_pic_iobits = (m_pic_iobits & (~m_pic_in_mask)) | (bit_in ? m_pic_in_mask : 0); + // log_cart_comm("PIC READ", m_pic_iobits); } - -// log_cart_comm("PIC READ", m_pic_iobits); - return m_pic_iobits; } -WRITE8_MEMBER(galgames_cart_device::int_pic_data_w) +void galgames_cart_device::int_pic_data_w(u8 data) { m_pic_iobits = (m_pic_iobits & (~m_pic_out_mask)) | (data & m_pic_out_mask); @@ -503,21 +512,20 @@ galgame3, port A: bit 2 = bank lsb bit 3 = bank msb */ -WRITE8_MEMBER(galgames_cart_device::int_pic_bank_w) +void galgames_cart_device::int_pic_bank_w(u8 data) { set_rom_bank((data >> 2) & 3); } - // External EEPROM interface -READ8_MEMBER(galgames_cart_device::eeprom_r) +u8 galgames_cart_device::eeprom_r() { return (m_eeprom && m_eeprom->do_read()) ? 0x80 : 0x00; } -WRITE8_MEMBER(galgames_cart_device::eeprom_w) +void galgames_cart_device::eeprom_w(u8 data) { if (!m_eeprom) return; @@ -529,7 +537,7 @@ WRITE8_MEMBER(galgames_cart_device::eeprom_w) m_eeprom->di_write(data & 0x01); // clock line asserted: write latch or select next bit to read - m_eeprom->clk_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); + m_eeprom->clk_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE); } WRITE_LINE_MEMBER(galgames_cart_device::eeprom_cs_write) @@ -541,19 +549,17 @@ WRITE_LINE_MEMBER(galgames_cart_device::eeprom_cs_write) } - - // SLOT implementation void galgames_slot_device::slot_map(address_map &map) { - map( 0x000000, 0x1fffff ).r(FUNC(galgames_slot_device::rom0_r)); - map( 0x000000, 0x03ffff ).rw(FUNC(galgames_slot_device::rom0_or_ram_r), FUNC(galgames_slot_device::ram_w)).share("ram"); - map( 0x200000, 0x3fffff ).r(FUNC(galgames_slot_device::rom_r)); - map( 0x200000, 0x23ffff ).rw(FUNC(galgames_slot_device::rom_or_ram_r), FUNC(galgames_slot_device::ram_w)); + map(0x000000, 0x1fffff).r(FUNC(galgames_slot_device::rom0_r)); + map(0x000000, 0x03ffff).rw(FUNC(galgames_slot_device::rom0_or_ram_r), FUNC(galgames_slot_device::ram_w)).share("ram"); + map(0x200000, 0x3fffff).r(FUNC(galgames_slot_device::rom_r)); + map(0x200000, 0x23ffff).rw(FUNC(galgames_slot_device::rom_or_ram_r), FUNC(galgames_slot_device::ram_w)); } -galgames_slot_device::galgames_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : +galgames_slot_device::galgames_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, GALGAMES_SLOT, tag, owner, clock), device_memory_interface(mconfig, *this), m_space_config("slot_space", ENDIANNESS_BIG, 16,22, 0, address_map_constructor(FUNC(galgames_slot_device::slot_map), this)), @@ -575,6 +581,9 @@ void galgames_slot_device::device_start() m_carts[2] = m_cart2; m_carts[3] = m_cart3; m_carts[4] = m_cart4; + + save_item(NAME(m_cart)); + save_item(NAME(m_is_ram_active)); } void galgames_slot_device::device_reset() @@ -600,11 +609,11 @@ void galgames_slot_device::reset_eeproms_except(int cart) m_carts[i]->eeprom_cs_write((cart == i) ? ASSERT_LINE : CLEAR_LINE); } -WRITE8_MEMBER(galgames_slot_device::cart_sel_w) +void galgames_slot_device::cart_sel_w(u8 data) { // cart selection (0 1 2 3 4 7) - switch( data ) + switch (data) { case 0x07: // 7 resets all reset_eeproms_except(-1); @@ -629,7 +638,7 @@ WRITE8_MEMBER(galgames_slot_device::cart_sel_w) // Select RAM, reset PIC -WRITE8_MEMBER(galgames_slot_device::ram_sel_w) +void galgames_slot_device::ram_sel_w(u8 data) { // bit 3 = PIC reset (active low) set_pic_reset_line(BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE); @@ -644,42 +653,42 @@ WRITE8_MEMBER(galgames_slot_device::ram_sel_w) // External ROM read -READ16_MEMBER(galgames_slot_device::rom0_r) +u16 galgames_slot_device::rom0_r(offs_t offset) { - return m_carts[0]->rom_r(space, offset, mem_mask); + return m_carts[0]->rom_r(offset); } -READ16_MEMBER(galgames_slot_device::rom_r) +u16 galgames_slot_device::rom_r(offs_t offset) { - return m_carts[m_cart]->rom_r(space, offset, mem_mask); + return m_carts[m_cart]->rom_r(offset); } -READ16_MEMBER(galgames_slot_device::rom0_or_ram_r) +u16 galgames_slot_device::rom0_or_ram_r(offs_t offset) { - return m_is_ram_active ? m_ram[offset] : m_carts[0]->rom_r(space, offset, mem_mask); + return m_is_ram_active ? m_ram[offset] : m_carts[0]->rom_r(offset); } -READ16_MEMBER(galgames_slot_device::rom_or_ram_r) +u16 galgames_slot_device::rom_or_ram_r(offs_t offset) { - return !m_is_ram_active ? m_ram[offset] : m_carts[m_cart]->rom_r(space, offset, mem_mask); + return !m_is_ram_active ? m_ram[offset] : m_carts[m_cart]->rom_r(offset); } -WRITE16_MEMBER(galgames_slot_device::ram_w) +void galgames_slot_device::ram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(m_ram + offset); } // External PIC status and data interface -READ8_MEMBER(galgames_slot_device::pic_status_r) +u8 galgames_slot_device::pic_status_r() { - return m_carts[m_cart]->pic_status_r(space, offset, mem_mask); + return m_carts[m_cart]->pic_status_r(); } -READ8_MEMBER(galgames_slot_device::pic_data_r) +u8 galgames_slot_device::pic_data_r() { - return m_carts[m_cart]->pic_data_r(space, offset, mem_mask); + return m_carts[m_cart]->pic_data_r(); } -WRITE8_MEMBER(galgames_slot_device::pic_data_w) +void galgames_slot_device::pic_data_w(u8 data) { - m_carts[m_cart]->pic_data_w(space, offset, data, mem_mask); + m_carts[m_cart]->pic_data_w(data); } void galgames_slot_device::set_pic_reset_line(int state) @@ -689,13 +698,13 @@ void galgames_slot_device::set_pic_reset_line(int state) // External EEPROM interface -READ8_MEMBER(galgames_slot_device::eeprom_r) +u8 galgames_slot_device::eeprom_r() { - return m_carts[m_cart]->eeprom_r(space, offset, mem_mask); + return m_carts[m_cart]->eeprom_r(); } -WRITE8_MEMBER(galgames_slot_device::eeprom_w) +void galgames_slot_device::eeprom_w(u8 data) { - m_carts[m_cart]->eeprom_w(space, offset, data, mem_mask); + m_carts[m_cart]->eeprom_w(data); } WRITE_LINE_MEMBER(galgames_slot_device::eeprom_cs_write) { @@ -718,22 +727,23 @@ public: m_palette(*this, "palette"), m_blitter(*this, "blitter"), m_oki(*this, "oki"), - m_slot(*this, "slot") + m_slot(*this, "slot"), + m_okiram(*this, "okiram") { } DECLARE_WRITE_LINE_MEMBER(blitter_irq_callback); TIMER_DEVICE_CALLBACK_MEMBER(scanline_interrupt); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE16_MEMBER(galgames_palette_offset_w); - DECLARE_WRITE16_MEMBER(galgames_palette_data_w); + void palette_offset_w(u8 data); + void palette_data_w(u8 data); - DECLARE_READ16_MEMBER(galgames_okiram_r); - DECLARE_WRITE16_MEMBER(galgames_okiram_w); + u8 okiram_r(offs_t offset); + void okiram_w(offs_t offset, u8 data); - DECLARE_READ16_MEMBER(fpga_status_r); - DECLARE_WRITE16_MEMBER(outputs_w); + u16 fpga_status_r(); + void outputs_w(offs_t offset, u16 data, u16 mem_mask = ~0); void galgames_base(machine_config &config); void galgbios(machine_config &config); @@ -741,17 +751,22 @@ public: void galgame3(machine_config &config); void blitter_map(address_map &map); void galgames_map(address_map &map); + void oki_map(address_map &map); + protected: + virtual void video_start() override; + required_device m_maincpu; required_device m_screen; required_device m_palette; required_device m_blitter; required_device m_oki; required_device m_slot; + required_shared_ptr m_okiram; - uint32_t m_palette_offset; - uint8_t m_palette_index; - uint8_t m_palette_data[3]; + u8 m_palette_offset; + u8 m_palette_index; + u8 m_palette_data[3]; }; WRITE_LINE_MEMBER(galgames_state::blitter_irq_callback) @@ -766,7 +781,7 @@ WRITE_LINE_MEMBER(galgames_state::blitter_irq_callback) ***************************************************************************/ -uint32_t galgames_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 galgames_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); return m_blitter->screen_update(screen, bitmap, cliprect); @@ -774,28 +789,29 @@ uint32_t galgames_state::screen_update(screen_device &screen, bitmap_ind16 &bitm // BT481A Palette RAMDAC -WRITE16_MEMBER(galgames_state::galgames_palette_offset_w) +void galgames_state::palette_offset_w(u8 data) { - if (ACCESSING_BITS_0_7) + m_palette_offset = data & 0xff; + m_palette_index = 0; +} + +void galgames_state::palette_data_w(u8 data) +{ + m_palette_data[m_palette_index] = data & 0xff; + if (++m_palette_index == 3) { - m_palette_offset = data & 0xff; + for (int palette_base = 0; palette_base < 0x1000; palette_base += 0x100) + m_palette->set_pen_color(m_palette_offset + palette_base, rgb_t(m_palette_data[0], m_palette_data[1], m_palette_data[2])); m_palette_index = 0; + m_palette_offset++; } } -WRITE16_MEMBER(galgames_state::galgames_palette_data_w) + +void galgames_state::video_start() { - if (ACCESSING_BITS_0_7) - { - m_palette_data[m_palette_index] = data & 0xff; - if (++m_palette_index == 3) - { - int palette_base; - for (palette_base = 0; palette_base < 0x1000; palette_base += 0x100) - m_palette->set_pen_color(m_palette_offset + palette_base, rgb_t(m_palette_data[0], m_palette_data[1], m_palette_data[2])); - m_palette_index = 0; - m_palette_offset++; - } - } + save_item(NAME(m_palette_offset)); + save_item(NAME(m_palette_index)); + save_item(NAME(m_palette_data)); } /*************************************************************************** @@ -804,15 +820,14 @@ WRITE16_MEMBER(galgames_state::galgames_palette_data_w) ***************************************************************************/ -READ16_MEMBER(galgames_state::galgames_okiram_r) +u8 galgames_state::okiram_r(offs_t offset) { - return memregion("oki")->base()[offset] | 0xff00; + return m_okiram[offset]; } -WRITE16_MEMBER(galgames_state::galgames_okiram_w) +void galgames_state::okiram_w(offs_t offset, u8 data) { - if (ACCESSING_BITS_0_7) - memregion("oki")->base()[offset] = data & 0xff; + m_okiram[offset] = data; } /*************************************************************************** @@ -823,12 +838,12 @@ WRITE16_MEMBER(galgames_state::galgames_okiram_w) // Outputs -WRITE16_MEMBER(galgames_state::outputs_w) +void galgames_state::outputs_w(offs_t offset, u16 data, u16 mem_mask) { if (data & mem_mask & ~0x000f) logerror("%s: Unknown output bit written %04X\n", machine().describe_context(), data); - if ( ACCESSING_BITS_0_7 ) + if (ACCESSING_BITS_0_7) { // bit 0 & 1 : ? always on (may be trackball lights or coin lockouts) // bit 2 : coin counter @@ -841,7 +856,7 @@ WRITE16_MEMBER(galgames_state::outputs_w) // FPGA -READ16_MEMBER(galgames_state::fpga_status_r) +u16 galgames_state::fpga_status_r() { return 0x3; // Pass the check at PC = 0xfae & a later one } @@ -861,10 +876,10 @@ void galgames_state::galgames_map(address_map &map) map(0x900000, 0x900001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0xa00001, 0xa00001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xb00000, 0xb7ffff).rw(FUNC(galgames_state::galgames_okiram_r), FUNC(galgames_state::galgames_okiram_w)); // (only low bytes tested) 4x N341024SJ-15 + map(0xb00000, 0xb7ffff).rw(FUNC(galgames_state::okiram_r), FUNC(galgames_state::okiram_w)).umask16(0x00ff); // (only low bytes tested) 4x N341024SJ-15 - map(0xc00000, 0xc00001).w(FUNC(galgames_state::galgames_palette_offset_w)); - map(0xc00002, 0xc00003).w(FUNC(galgames_state::galgames_palette_data_w)); + map(0xc00001, 0xc00001).w(FUNC(galgames_state::palette_offset_w)); + map(0xc00003, 0xc00003).w(FUNC(galgames_state::palette_data_w)); map(0xd00000, 0xd00001).portr("TRACKBALL_1_X"); map(0xd00000, 0xd00001).nopw(); // bit 0: FPGA programming serial in (lsb first) @@ -887,57 +902,62 @@ void galgames_state::blitter_map(address_map &map) map(0x000000, 0x1fffff).r(":slot", FUNC(galgames_slot_device::rom_r)); } +void galgames_state::oki_map(address_map &map) +{ + map(0x00000, 0x3ffff).ram().share("okiram"); +} + /*************************************************************************** Input Ports ***************************************************************************/ -static INPUT_PORTS_START( galgames ) +static INPUT_PORTS_START(galgames) PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // Button A (right) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // Button B (left) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(1) // Button A (right) + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1) // Button B (left) + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_START("P2") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // Button A (right) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // Button B (left) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1) // DBA (coin) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2) // Button A (right) + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) // Button B (left) + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_SERVICE1) // DBA (coin) + PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_START("SYSTEM") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) // CS 1 (coin) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) // CS 2 (coin) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH,IPT_OTHER ) PORT_CODE(KEYCODE_F2) PORT_NAME("Service Mode (Coin Door)") PORT_TOGGLE - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_COIN1) // CS 1 (coin) + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_COIN2) // CS 2 (coin) + PORT_BIT(0x0004, IP_ACTIVE_HIGH,IPT_OTHER) PORT_CODE(KEYCODE_F2) PORT_NAME("Service Mode (Coin Door)") PORT_TOGGLE + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_START("TRACKBALL_1_X") - PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET + PORT_BIT(0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET PORT_START("TRACKBALL_1_Y") - PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET + PORT_BIT(0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET PORT_START("TRACKBALL_2_X") - PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET + PORT_BIT(0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET PORT_START("TRACKBALL_2_Y") - PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET + PORT_BIT(0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET INPUT_PORTS_END /*************************************************************************** @@ -958,7 +978,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(galgames_state::scanline_interrupt) // lev 2 triggered at the end of the blit } -int galgames_compute_addr(uint16_t reg_low, uint16_t reg_mid, uint16_t reg_high) +int galgames_compute_addr(u16 reg_low, u16 reg_mid, u16 reg_high) { return reg_low | (reg_mid << 16); } @@ -991,7 +1011,9 @@ void galgames_state::galgames_base(machine_config &config) // sound hardware SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(24'000'000) / 16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 not verified (voices in galgame4 seem ok) + OKIM6295(config, m_oki, XTAL(24'000'000) / 16, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified (voices in galgame4 seem ok) + m_oki->set_addrmap(0, &galgames_state::oki_map); + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); } void galgames_state::galgbios(machine_config &config) @@ -1072,33 +1094,30 @@ Copyright notice in rom states: Creative Electronics & Software Written by Keith ROMX_LOAD(name, offset, length, hash, ROM_SKIP(1) | ROM_BIOS(bios)) #define GALGAMES_BIOS_ROMS \ - ROM_SYSTEM_BIOS( 0, "1.90", "v1.90 12/01/98" ) \ - ROM_LOAD16_BYTE_BIOS( 0, "galaxy_u2__v1.90_12-01-98.u2", 0x000000, 0x100000, CRC(e51ff184) SHA1(aaa795f2c15ec29b3ceeb5c917b643db0dbb7083) ) \ - ROM_LOAD16_BYTE_BIOS( 0, "galaxy_u1__v1.90_12-01-98.u1", 0x000001, 0x100000, CRC(c6d7bc6d) SHA1(93c032f9aa38cbbdda59a8a25ff9f38f7ad9c760) ) \ + ROM_SYSTEM_BIOS(0, "1.90", "v1.90 12/01/98") \ + ROM_LOAD16_BYTE_BIOS(0, "galaxy_u2__v1.90_12-01-98.u2", 0x000000, 0x100000, CRC(e51ff184) SHA1(aaa795f2c15ec29b3ceeb5c917b643db0dbb7083)) \ + ROM_LOAD16_BYTE_BIOS(0, "galaxy_u1__v1.90_12-01-98.u1", 0x000001, 0x100000, CRC(c6d7bc6d) SHA1(93c032f9aa38cbbdda59a8a25ff9f38f7ad9c760)) \ \ - ROM_SYSTEM_BIOS( 1, "1.80", "v1.80 10/05/98" ) \ - ROM_LOAD16_BYTE_BIOS( 1, "galaxy_u2__v1.80_10-15-98.u2", 0x000000, 0x100000, CRC(73cff284) SHA1(e6f7d92999cdb478c21c3b65a04eade84299ac12) ) \ - ROM_LOAD16_BYTE_BIOS( 1, "galaxy_u1__v1.80_10-15-98.u1", 0x000001, 0x100000, CRC(e3ae423c) SHA1(66d1964845a99a5ed4b19b4135b55cde6b5fe295) ) + ROM_SYSTEM_BIOS(1, "1.80", "v1.80 10/05/98") \ + ROM_LOAD16_BYTE_BIOS(1, "galaxy_u2__v1.80_10-15-98.u2", 0x000000, 0x100000, CRC(73cff284) SHA1(e6f7d92999cdb478c21c3b65a04eade84299ac12)) \ + ROM_LOAD16_BYTE_BIOS(1, "galaxy_u1__v1.80_10-15-98.u1", 0x000001, 0x100000, CRC(e3ae423c) SHA1(66d1964845a99a5ed4b19b4135b55cde6b5fe295)) #define GALGAMES_MB_PALS \ - ROM_REGION( 0xa00, "pals", 0) \ - ROM_LOAD( "16v8h-blue.u24", 0x000, 0x117, NO_DUMP ) \ - ROM_LOAD( "16v8h-yellow.u25", 0x200, 0x117, NO_DUMP ) \ - ROM_LOAD( "16v8h-magenta.u26", 0x400, 0x117, NO_DUMP ) \ - ROM_LOAD( "16v8h-green.u27", 0x600, 0x117, NO_DUMP ) \ - ROM_LOAD( "16v8h-red.u45", 0x800, 0x117, NO_DUMP ) + ROM_REGION(0xa00, "pals", 0) \ + ROM_LOAD("16v8h-blue.u24", 0x000, 0x117, NO_DUMP) \ + ROM_LOAD("16v8h-yellow.u25", 0x200, 0x117, NO_DUMP) \ + ROM_LOAD("16v8h-magenta.u26", 0x400, 0x117, NO_DUMP) \ + ROM_LOAD("16v8h-green.u27", 0x600, 0x117, NO_DUMP) \ + ROM_LOAD("16v8h-red.u45", 0x800, 0x117, NO_DUMP) -ROM_START( galgbios ) - ROM_REGION16_BE( 0x200000, "cart0", 0 ) +ROM_START(galgbios) + ROM_REGION16_BE(0x200000, "cart0", 0) GALGAMES_BIOS_ROMS - ROM_REGION( 0x200000, "cart1", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart2", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart3", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart4", ROMREGION_ERASEFF ) - - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) - // RAM, filled by the 68000 and fed to the OKI + ROM_REGION(0x200000, "cart1", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart2", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart3", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart4", ROMREGION_ERASEFF) GALGAMES_MB_PALS ROM_END @@ -1120,23 +1139,20 @@ Board silkscreened 237-0209-00 ***************************************************************************/ -ROM_START( galgame2 ) - ROM_REGION16_BE( 0x200000, "cart0", 0 ) +ROM_START(galgame2) + ROM_REGION16_BE(0x200000, "cart0", 0) GALGAMES_BIOS_ROMS - ROM_REGION( 0x200000, "cart1", 0 ) - ROM_LOAD16_BYTE( "am29f800bb.u2", 0x000000, 0x100000, CRC(f43c0c54) SHA1(4a13946c3d173b0e4ab25b01849574fa3302b417) ) - ROM_LOAD16_BYTE( "am29f800bb.u1", 0x000001, 0x100000, CRC(b8c34a8b) SHA1(40d3b35f573d2bd2ae1c7d876c55fc436864fa3f) ) + ROM_REGION(0x200000, "cart1", 0) + ROM_LOAD16_BYTE("am29f800bb.u2", 0x000000, 0x100000, CRC(f43c0c54) SHA1(4a13946c3d173b0e4ab25b01849574fa3302b417)) + ROM_LOAD16_BYTE("am29f800bb.u1", 0x000001, 0x100000, CRC(b8c34a8b) SHA1(40d3b35f573d2bd2ae1c7d876c55fc436864fa3f)) - ROM_REGION( 0x2000, "cart1:pic", 0 ) - ROM_LOAD( "pic12c508.u4", 0x0000, 0x2000, CRC(bb253913) SHA1(eace069344da6dda7c05673e422876d130ed5d48) ) // includes config word at fff, hence size is 2*1000 + ROM_REGION(0x2000, "cart1:pic", 0) + ROM_LOAD("pic12c508.u4", 0x0000, 0x2000, CRC(bb253913) SHA1(eace069344da6dda7c05673e422876d130ed5d48)) // includes config word at fff, hence size is 2*1000 - ROM_REGION( 0x200000, "cart2", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart3", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart4", ROMREGION_ERASEFF ) - - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) - // RAM, filled by the 68000 and fed to the OKI + ROM_REGION(0x200000, "cart2", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart3", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart4", ROMREGION_ERASEFF) GALGAMES_MB_PALS ROM_END @@ -1158,23 +1174,20 @@ Board silkscreened 237-0228-00 ***************************************************************************/ -ROM_START( galgame3 ) - ROM_REGION16_BE( 0x200000, "cart0", 0 ) +ROM_START(galgame3) + ROM_REGION16_BE(0x200000, "cart0", 0) GALGAMES_BIOS_ROMS - ROM_REGION( 0x800000, "cart1", 0 ) - ROM_LOAD16_BYTE( "am29f032b.u2", 0x000000, 0x400000, CRC(a4ffc70a) SHA1(328c6ceef025af7ff5b7998df59a10d90c654d53) ) - ROM_LOAD16_BYTE( "am29f032b.u1", 0x000001, 0x400000, CRC(b0876751) SHA1(487f052989e4b2df2df2293b283e8e03ffc3ddf4) ) + ROM_REGION(0x800000, "cart1", 0) + ROM_LOAD16_BYTE("am29f032b.u2", 0x000000, 0x400000, CRC(a4ffc70a) SHA1(328c6ceef025af7ff5b7998df59a10d90c654d53)) + ROM_LOAD16_BYTE("am29f032b.u1", 0x000001, 0x400000, CRC(b0876751) SHA1(487f052989e4b2df2df2293b283e8e03ffc3ddf4)) - ROM_REGION( 0x800, "cart1:pic", 0 ) - ROM_LOAD( "pic16c56.u6", 0x000, 0x800, CRC(cf901ed8) SHA1(ebb2da0f50ba82a038f315aab7e6b20b9a1af3a1) ) + ROM_REGION(0x800, "cart1:pic", 0) + ROM_LOAD("pic16c56.u6", 0x000, 0x800, CRC(cf901ed8) SHA1(ebb2da0f50ba82a038f315aab7e6b20b9a1af3a1)) - ROM_REGION( 0x200000, "cart2", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart3", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart4", ROMREGION_ERASEFF ) - - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) - // RAM, filled by the 68000 and fed to the OKI + ROM_REGION(0x200000, "cart2", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart3", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart4", ROMREGION_ERASEFF) GALGAMES_MB_PALS ROM_END @@ -1186,35 +1199,32 @@ Galaxy Games StarPak 4 ***************************************************************************/ -ROM_START( galgame4 ) - ROM_REGION16_BE( 0x200000, "cart0", 0 ) +ROM_START(galgame4) + ROM_REGION16_BE(0x200000, "cart0", 0) GALGAMES_BIOS_ROMS - ROM_REGION( 0x800000, "cart1", 0 ) - ROM_LOAD16_BYTE( "sp4.u2", 0x000000, 0x100000, CRC(e51bc5e1) SHA1(dacf6cefd792713b34382b827952b66e2cb5c2b4) ) // JANUARY 12, 1998 - ROM_LOAD16_BYTE( "sp4.u1", 0x000001, 0x100000, CRC(695ab775) SHA1(e88d5f982df19e70be6124e6fdf20830475641e0) ) // "" - ROM_LOAD16_BYTE( "sp4.u6", 0x200000, 0x100000, CRC(7716895d) SHA1(8f86ffe2d94d3e756a3b7661d480e3a8c53cf178) ) - ROM_LOAD16_BYTE( "sp4.u5", 0x200001, 0x100000, CRC(6c699ba3) SHA1(f675997e1b808758f79a21b883161526242990b4) ) - ROM_LOAD16_BYTE( "sp4.u8", 0x400000, 0x100000, CRC(cdf45446) SHA1(da4e1667c7c47239e770018a7d3b8c1e4e2f4a63) ) - ROM_LOAD16_BYTE( "sp4.u7", 0x400001, 0x100000, CRC(813c46c8) SHA1(3fd4192ec7e8d5e6bfbc2a37d9b4bbebe6132b99) ) - ROM_LOAD16_BYTE( "sp4.u10", 0x600000, 0x100000, CRC(52dbf088) SHA1(da7c37366e884f40f1dea243d4aea0b2d2b314db) ) - ROM_LOAD16_BYTE( "sp4.u9", 0x600001, 0x100000, CRC(9ded1dc2) SHA1(5319edfccf47d02dfd3664cb3782cc2281c769c4) ) + ROM_REGION(0x800000, "cart1", 0) + ROM_LOAD16_BYTE("sp4.u2", 0x000000, 0x100000, CRC(e51bc5e1) SHA1(dacf6cefd792713b34382b827952b66e2cb5c2b4)) // JANUARY 12, 1998 + ROM_LOAD16_BYTE("sp4.u1", 0x000001, 0x100000, CRC(695ab775) SHA1(e88d5f982df19e70be6124e6fdf20830475641e0)) // "" + ROM_LOAD16_BYTE("sp4.u6", 0x200000, 0x100000, CRC(7716895d) SHA1(8f86ffe2d94d3e756a3b7661d480e3a8c53cf178)) + ROM_LOAD16_BYTE("sp4.u5", 0x200001, 0x100000, CRC(6c699ba3) SHA1(f675997e1b808758f79a21b883161526242990b4)) + ROM_LOAD16_BYTE("sp4.u8", 0x400000, 0x100000, CRC(cdf45446) SHA1(da4e1667c7c47239e770018a7d3b8c1e4e2f4a63)) + ROM_LOAD16_BYTE("sp4.u7", 0x400001, 0x100000, CRC(813c46c8) SHA1(3fd4192ec7e8d5e6bfbc2a37d9b4bbebe6132b99)) + ROM_LOAD16_BYTE("sp4.u10", 0x600000, 0x100000, CRC(52dbf088) SHA1(da7c37366e884f40f1dea243d4aea0b2d2b314db)) + ROM_LOAD16_BYTE("sp4.u9", 0x600001, 0x100000, CRC(9ded1dc2) SHA1(5319edfccf47d02dfd3664cb3782cc2281c769c4)) - ROM_REGION( 0x2000, "cart1:pic", 0 ) - ROM_LOAD( "sp4.pic", 0x000, 0x2000, CRC(008ef1ba) SHA1(4065fcf00922de3e629084f4f4815355f271c954) ) + ROM_REGION(0x2000, "cart1:pic", 0) + ROM_LOAD("sp4.pic", 0x000, 0x2000, CRC(008ef1ba) SHA1(4065fcf00922de3e629084f4f4815355f271c954)) - ROM_REGION( 0x200000, "cart2", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart3", ROMREGION_ERASEFF ) - ROM_REGION( 0x200000, "cart4", ROMREGION_ERASEFF ) - - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) - // RAM, filled by the 68000 and fed to the OKI + ROM_REGION(0x200000, "cart2", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart3", ROMREGION_ERASEFF) + ROM_REGION(0x200000, "cart4", ROMREGION_ERASEFF) GALGAMES_MB_PALS ROM_END -GAME( 1998, galgbios, 0, galgbios, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software", "Galaxy Games BIOS", MACHINE_IS_BIOS_ROOT ) -GAME( 1998, galgame2, galgbios, galgame2, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software / Namco", "Galaxy Games StarPak 2", 0 ) -GAME( 1998, galgame3, galgbios, galgame3, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software / Atari", "Galaxy Games StarPak 3", 0 ) -GAME( 1998, galgame4, galgbios, galgame3, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software", "Galaxy Games StarPak 4 (prototype)", MACHINE_IMPERFECT_GRAPHICS ) +GAME(1998, galgbios, 0, galgbios, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software", "Galaxy Games BIOS", MACHINE_IS_BIOS_ROOT) +GAME(1998, galgame2, galgbios, galgame2, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software / Namco", "Galaxy Games StarPak 2", 0) +GAME(1998, galgame3, galgbios, galgame3, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software / Atari", "Galaxy Games StarPak 3", 0) +GAME(1998, galgame4, galgbios, galgame3, galgames, galgames_state, empty_init, ROT0, "Creative Electronics & Software", "Galaxy Games StarPak 4 (prototype)", MACHINE_IMPERFECT_GRAPHICS) From f99e6409f17a4adf5add70ac0f643b7cf8bb384c Mon Sep 17 00:00:00 2001 From: cam900 Date: Tue, 7 May 2019 11:55:25 +0900 Subject: [PATCH 2/2] galgames.cpp : Fix debugger issue --- src/mame/drivers/galgames.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/galgames.cpp b/src/mame/drivers/galgames.cpp index fdf61beda3c..ac73beec1a9 100644 --- a/src/mame/drivers/galgames.cpp +++ b/src/mame/drivers/galgames.cpp @@ -375,9 +375,10 @@ u8 galgames_cart_device::pic_status_r() u8 galgames_cart_device::pic_data_r() { - if (is_selected() && (!machine().side_effects_disabled())) + if (is_selected()) { - m_pic_data_rdy = 0; + if (!machine().side_effects_disabled()) + m_pic_data_rdy = 0; return m_pic_data; } return 0xff;