Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Jul 27, 2024
2 parents 594cf97 + aaae6d6 commit 92277df
Show file tree
Hide file tree
Showing 27 changed files with 9,241 additions and 1,700 deletions.
52 changes: 52 additions & 0 deletions hash/easy_karaoke_cart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,56 @@ license:CC0-1.0
</part>
</software>

<!--
Bare Necessities The Jungle Book
Call Me, Beep Me Kim Possible
Hakuna Matata The Lion King
Home Beauty and the Beast - Musical
Oo-De-Lally Robin Hood
Put It Together Cinderella
So This Is Love Cinderella
What Dreams Are Made Of Lizzie McGuire
You Can Fly! You Can Fly! You Can Fly! Peter Pan
You'll Be In My Heart Tarzan
-->
<software name="dkp2" supported="no">
<description>Disney Princess 10-Song Karaoke Cartridge II (DK-P2)</description>
<year>2003</year>
<publisher>IVL Technologies / Memcorp Inc / Disney</publisher>
<part name="cart" interface="easy_karaoke_cart">
<dataarea name="rom" size="0x80000">
<rom name="dk-p2.bin" size="0x80000" crc="d9d340c5" sha1="da906d7f22a2ea8bc62171c833985b81d71410a3" />
</dataarea>
<dataarea name="mcu" size="0x2000">
<rom name="IC89LV52A-24PQ.U1" size="0x2000" status="nodump" />
</dataarea>
</part>
</software>

<!--
Cruella De Vil 101 Dalmations
He's A Tramp Lady And The Tramp
I Wan'na Be Like You (The Monkey Song) The Jungle Book
If I Didn't Have You Monsters Inc.
It's A Small World New York World's Fair
Open Your Eyes (To Love) Lizzie McGuire
Part Of Your World The Little Mermaid
Something There Beauty and the Beast
You've Got A Friend In Me Toy Story
Zip-A-Dee-Do-Dah Song of the South
-->
<software name="dkp3" supported="no">
<description>Disney Princess 10-Song Karaoke Cartridge III (DK-P3)</description>
<year>2003</year>
<publisher>IVL Technologies / Memcorp Inc / Disney</publisher>
<part name="cart" interface="easy_karaoke_cart">
<dataarea name="rom" size="0x80000">
<rom name="dk-p3.bin" size="0x80000" crc="2c9ec515" sha1="0efb1b7f513cc27084a3ef7c18290456f903decd" />
</dataarea>
<dataarea name="mcu" size="0x2000">
<rom name="IC89LV52A-24PQ.U1" size="0x2000" status="nodump" />
</dataarea>
</part>
</software>

</softwarelist>
1 change: 1 addition & 0 deletions scripts/src/cpu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ end
if CPUS["XA"] then
files {
MAME_DIR .. "src/devices/cpu/xa/xa.cpp",
MAME_DIR .. "src/devices/cpu/xa/xa_ops.cpp",
MAME_DIR .. "src/devices/cpu/xa/xa.h",
}
end
Expand Down
47 changes: 31 additions & 16 deletions src/devices/bus/hp_dio/hp98620.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace {

class dio16_98620_device :
public device_t,
public device_execute_interface,
public bus::hp_dio::device_dio16_card_interface
{
public:
Expand All @@ -29,12 +30,14 @@ class dio16_98620_device :
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void execute_run() override;

uint16_t dma_r(offs_t offset);
void dma_w(offs_t offset, uint16_t data);

void irq_w(int state);

int m_icount;
private:

static constexpr int REG0_RESET_ARM_INT = 0x00;
Expand Down Expand Up @@ -96,7 +99,7 @@ class dio16_98620_device :
void dmar0_in(int state) override;
void dmar1_in(int state) override;

void dma_transfer(int channel);
bool dma_transfer(int channel);
void update_irq();
void update_ctrl(const int channel, const uint16_t data, const bool is_1tq4);

Expand Down Expand Up @@ -134,7 +137,9 @@ dio16_98620_device::dio16_98620_device(const machine_config &mconfig, const char

dio16_98620_device::dio16_98620_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t{mconfig, type, tag, owner, clock},
device_execute_interface{mconfig, *this},
device_dio16_card_interface{mconfig, *this},
m_icount{0},
m_installed_io{false},
m_control{0},
m_data{0},
Expand All @@ -143,9 +148,23 @@ dio16_98620_device::dio16_98620_device(const machine_config &mconfig, device_typ
{
}

void dio16_98620_device::execute_run()
{
bool busy0, busy1;

do {
busy0 = dma_transfer(0);
busy1 = dma_transfer(1);
if (!busy0 && !busy1)
suspend(SUSPEND_REASON_TRIGGER, 1);
} while(--m_icount > 0);
}

void dio16_98620_device::device_start()
{
m_installed_io = false;
set_icountptr(m_icount);
set_clock(10_MHz_XTAL);

save_item(STRUCT_MEMBER(m_regs, address));
save_item(STRUCT_MEMBER(m_regs, tc));
Expand Down Expand Up @@ -389,6 +408,7 @@ void dio16_98620_device::dma_w(offs_t offset, uint16_t data)
LOG("%s: unknown register write: %02X\n", __FUNCTION__, offset << 1);
break;
}
trigger(0);
}

void dio16_98620_device::update_irq()
Expand All @@ -409,16 +429,18 @@ void dio16_98620_device::update_irq()
(m_regs[1].irq_level == 7 && m_regs[1].irq && m_regs[1].ie));
}

void dio16_98620_device::dma_transfer(int channel)
bool dio16_98620_device::dma_transfer(int channel)
{
assert(channel < 2);

if (!(m_regs[channel].armed))
return;
return false;

LOG("dma_transfer %s: tc %d/%d\n", m_regs[channel].dma_out ? "out" : "in",
m_regs[channel].tc, m_regs[channel].subcount);
if (!m_dmar[channel])
return false;

LOG("dma_transfer %s: tc %d/%d\n", m_regs[channel].dma_out ? "out" : "in",
m_regs[channel].tc, m_regs[channel].subcount);

if (m_regs[channel].dma_out) {
dmack_w_out(channel, program_space().read_byte(m_regs[channel].address++));
Expand All @@ -435,34 +457,27 @@ void dio16_98620_device::dma_transfer(int channel)
m_regs[channel].irq = true;
update_irq();
}
return;
return false;
}

m_regs[channel].subcount = m_regs[channel].tsz;
}

m_regs[channel].subcount--;
return true;
}

void dio16_98620_device::dmar0_in(int state)
{
LOG("%s: %d\n", __FUNCTION__, state);
m_dmar[0] = state;
if (!state)
return;

dma_transfer(0);
trigger(0);
}

void dio16_98620_device::dmar1_in(int state)
{
LOG("%s: %d\n", __FUNCTION__, state);
m_dmar[1] = state;

if (!state)
return;

dma_transfer(1);
trigger(0);
}

} // anonymous namespace
Expand Down
Loading

0 comments on commit 92277df

Please sign in to comment.