Skip to content
Draft
Changes from 3 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
14 changes: 11 additions & 3 deletions src/mame/misc/marywu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ class marywu_state : public driver_device
void ay1_port_b_w(uint8_t data);
void ay2_port_a_w(uint8_t data);
void ay2_port_b_w(uint8_t data);
uint8_t keyboard_r();
void p3_port_w(uint8_t data);
uint8_t keyboard_r();
void data_map(address_map &map) ATTR_COLD;
void program_map(address_map &map) ATTR_COLD;

uint8_t m_selected_7seg_module = 0;

output_finder<32> m_digits;
output_finder<30> m_leds;
output_finder<40> m_leds;
required_ioport_array<4> m_inputs;
};

Expand Down Expand Up @@ -127,10 +128,16 @@ void marywu_state::ay2_port_a_w(uint8_t data)
void marywu_state::ay2_port_b_w(uint8_t data)
{
// we only have 30 LEDs. The last 2 bits in this port are unused.
for (uint8_t i = 0; i < 6; i++)
for (uint8_t i = 0; i < 8; i++)
m_leds[i + 24] = BIT(data, i);
}

void marywu_state::p3_port_w(uint8_t data) // 1 led are used.
{
for (uint8_t i = 0; i < 0; i++)
Copy link
Contributor

Choose a reason for hiding this comment

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

This causes the loop to be executed zero times, defeating the whole purpose of adding this as a callback.

Since external memory is hooked up to the MOVX space, it's unlikely P36 and P37 are used to drive LEDs, but some of the lower 6 bits might be.

m_leds[i + 32] = BIT(data, i);
}

void marywu_state::multiplex_7seg_w(uint8_t data)
{
m_selected_7seg_module = data;
Expand Down Expand Up @@ -190,6 +197,7 @@ void marywu_state::marywu(machine_config &config)
maincpu.set_addrmap(AS_DATA, &marywu_state::data_map);
//TODO: figure out what each bit is mapped to in the 80c31 ports P1 and P3
maincpu.port_in_cb<1>().set_ioport("P1");
maincpu.port_out_cb<3>().set(FUNC(p3_port_w)); // Seem to be LED output. start blinking if error occured.

NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);

Expand Down
Loading