Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Casio WK-1600/1800 #12957

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/src/sound.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1765,3 +1765,15 @@ if (SOUNDS["UPD65043GFU01"]~=null) then
MAME_DIR .. "src/devices/sound/upd65043gfu01.h",
}
end

---------------------------------------------------
-- Casio GT155
--@src/devices/sound/gt155.h,SOUNDS["GT155"] = true
---------------------------------------------------

if (SOUNDS["GT155"]~=null) then
files {
MAME_DIR .. "src/devices/sound/gt155.cpp",
MAME_DIR .. "src/devices/sound/gt155.h",
}
end
10 changes: 9 additions & 1 deletion src/devices/cpu/h8/h83048.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ h83048_device::h83048_device(const machine_config &mconfig, device_type type, co
m_timer16_3(*this, "timer16:3"),
m_timer16_4(*this, "timer16:4"),
m_watchdog(*this, "watchdog"),
m_tend_cb(*this),
m_ram_start(start),
m_syscr(0)
{
Expand Down Expand Up @@ -206,7 +207,12 @@ void h83048_device::device_add_mconfig(machine_config &config)

void h83048_device::execute_set_input(int inputnum, int state)
{
m_intc->set_input(inputnum, state);
if(inputnum == H8_INPUT_LINE_TEND0 || inputnum == H8_INPUT_LINE_TEND1)
m_tend_cb[inputnum - H8_INPUT_LINE_TEND0](state);
Comment on lines +210 to +211
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you got input lines piped straight to callbacks? That’s rather suspect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taken directly from other H8 devices that already implement TEND0/TEND1 (i.e. h83002_device, h83003_device)

else if(inputnum == H8_INPUT_LINE_DREQ0 || inputnum == H8_INPUT_LINE_DREQ1)
m_dma->set_input(inputnum, state);
else
m_intc->set_input(inputnum, state);
}

int h83048_device::trapa_setup()
Expand Down Expand Up @@ -284,6 +290,7 @@ void h83048_device::notify_standby(int state)
void h83048_device::device_start()
{
h8h_device::device_start();
m_dma_device = m_dma;
save_item(NAME(m_syscr));
}

Expand All @@ -301,6 +308,7 @@ u8 h83048_device::syscr_r()
void h83048_device::syscr_w(u8 data)
{
m_syscr = data;
m_intc->set_nmi_edge(BIT(data, 2));
update_irq_filter();
logerror("syscr = %02x\n", data);
}
7 changes: 6 additions & 1 deletion src/devices/cpu/h8/h83048.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
H8/3044 32K 2K
H8/3045 64K 2K
H8/3047 96K 4K
H8/3048 192K 4K
H8/3048 128K 4K

The 3394, 3396, and 3997 variants are the mask-rom versions.

Expand All @@ -35,6 +35,9 @@ class h83048_device : public h8h_device {
public:
h83048_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

auto tend0() { return m_tend_cb[0].bind(); }
auto tend1() { return m_tend_cb[1].bind(); }

auto read_port1() { return m_read_port [PORT_1].bind(); }
auto write_port1() { return m_write_port[PORT_1].bind(); }
auto read_port2() { return m_read_port [PORT_2].bind(); }
Expand Down Expand Up @@ -90,6 +93,8 @@ class h83048_device : public h8h_device {
required_device<h8h_timer16_channel_device> m_timer16_4;
required_device<h8_watchdog_device> m_watchdog;

devcb_write_line::array<2> m_tend_cb;

u32 m_ram_start;
u8 m_syscr;

Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/h8/h8_adc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void h8_adc_3337_device::mode_update()
m_trigger = m_adcr & 0x80 ? T_EXT : T_SOFT;

if(m_adcsr & 0x10) {
m_start_mode = ACTIVE | ROTATE;
m_start_mode = ACTIVE | REPEAT | ROTATE;
m_start_channel = m_adcsr & 4;
m_end_channel = m_adcsr & 7;
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/devices/cpu/h8/h8_dma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ void h8gen_dma_device::start_stop_test()

} else {
if(m_dmach[i >> 1] && (m_dmach[i >> 1]->m_state[i & 1].m_flags & h8_dma_state::ACTIVE)) {
logerror("forced abort %d\n", i);
exit(0);
logerror("%s: forced abort %d\n", machine().describe_context(), i);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/devices/cpu/h8/h8_dtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ void h8_dtc_device::writeback_done(int vector)
m_intc->internal_interrupt(vector);
} else {
logerror("Software dtc done\n");
exit(0);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/devices/machine/upd765.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,12 @@ void hd63266f_device::map(address_map &map)
map(0x2, 0x2).r(FUNC(hd63266f_device::extstat_r));
}

uint8_t hd63266f_device::get_st3(floppy_info &fi)
{
// wk1800 seems to expect TS to be inverted (or possibly the bit is actually something else?)
return upd765_family_device::get_st3(fi) ^ ST3_TS;
}

void hd63266f_device::soft_reset()
{
upd765_family_device::soft_reset();
Expand Down
1 change: 1 addition & 0 deletions src/devices/machine/upd765.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ class hd63266f_device : public upd765_family_device {
hd63266f_device(const machine_config &mconfig, const char *tag, device_t* owner, uint32_t clock);

virtual void map(address_map &map) override ATTR_COLD;
virtual uint8_t get_st3(floppy_info &fi) override;
auto inp_rd_callback() { return inp_cb.bind(); } // this is really the ts signal

void rate_w(u8 state) { state ? set_rate(500000) : set_rate(250000); }
Expand Down
Loading