Skip to content

Commit

Permalink
hitach/bml3: hookup BAUD SEL [Robbbert]
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosa committed Oct 24, 2024
1 parent 26ce85d commit 68008cf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/mame/hitachi/bml3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Basic Master Level 3 (MB-689x) "Peach" (c) 1980 Hitachi
#include "bus/bml3/rtc.h"
#include "cpu/m6809/m6809.h"
#include "machine/6821pia.h"
#include "machine/clock.h"

#include "screen.h"
#include "softlist_dev.h"
Expand Down Expand Up @@ -212,7 +211,6 @@ void bml3_state::interlace_sel_w(u8 data)
crtc_change_clock();
}


u8 bml3_state::vram_r(offs_t offset)
{
// Bit 7 masks reading back to the latch
Expand Down Expand Up @@ -297,6 +295,19 @@ void bml3_state::remote_w(u8 data)
BIT(data, 7) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
}

// BAUD SEL - ACIA clock select 600/1200 baud
// (Misspelled as BANK SEL in the English documentation)
void bml3_state::baud_sel_w(u8 data)
{
m_baud_sel = BIT(data, 0);
m_acia_clock->set_unscaled_clock(m_baud_sel ? 19'200 : 9'600);
}

u8 bml3_state::baud_sel_r()
{
return m_baud_sel;
}

// KBNMI - Keyboard "Break" key non-maskable interrupt
u8 bml3_state::kbnmi_r()
{
Expand Down Expand Up @@ -373,11 +384,11 @@ void bml3_state::system_io(address_map &map)
map(0x00d4, 0x00d4).w(FUNC(bml3_state::time_mask_w));
map(0x00d5, 0x00d5).noprw(); // L/P ENBL - Light pen operation enable
map(0x00d6, 0x00d6).w(FUNC(bml3_state::interlace_sel_w));
// map(0x00d7, 0x00d7) BANK SEL - baud select
map(0x00d7, 0x00d7).rw(FUNC(bml3_state::baud_sel_r), FUNC(bml3_state::baud_sel_w));
map(0x00d8, 0x00d8).rw(FUNC(bml3_state::c_reg_sel_r), FUNC(bml3_state::c_reg_sel_w));
map(0x00e0, 0x00e0).rw(FUNC(bml3_state::kb_sel_r), FUNC(bml3_state::kb_sel_w));
// map(0x00e8, 0x00e8) bank register
// map(0x00e9, 0x00e9) IG mode register
// map(0x00e9, 0x00e9) IG mode register (Mark 5 only, below)
// map(0x00ea, 0x00ea) IG enable register

#if 0
Expand Down Expand Up @@ -863,9 +874,9 @@ void bml3_state::bml3(machine_config &config)
m_acia->rts_handler().set(FUNC(bml3_state::acia_rts_w));
m_acia->irq_handler().set(FUNC(bml3_state::acia_irq_w));

clock_device &acia_clock(CLOCK(config, "acia_clock", 9'600)); // 600 baud x 16(divider) = 9600
acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
acia_clock.signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));
CLOCK(config, m_acia_clock, 9'600); // 600 baud x 16(divider) = 9600
m_acia_clock->signal_handler().set(m_acia, FUNC(acia6850_device::write_txc));
m_acia_clock->signal_handler().append(m_acia, FUNC(acia6850_device::write_rxc));

CASSETTE(config, m_cassette);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED);
Expand Down
6 changes: 6 additions & 0 deletions src/mame/hitachi/bml3.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "bus/bml3/bml3bus.h"
#include "imagedev/cassette.h"
#include "machine/6850acia.h"
#include "machine/clock.h"
#include "machine/timer.h"
#include "sound/spkrdev.h"
#include "sound/ymopn.h"
Expand Down Expand Up @@ -72,6 +73,7 @@ class bml3_state : public driver_device
, m_speaker(*this, "speaker")
, m_ym2203(*this, "ym2203")
, m_acia(*this, "acia")
, m_acia_clock(*this, "acia_clock")
, m_io_keyboard(*this, "X%u", 0U)
{ }

Expand Down Expand Up @@ -111,6 +113,7 @@ class bml3_state : public driver_device
required_device<speaker_sound_device> m_speaker;
optional_device<ym2203_device> m_ym2203;
required_device<acia6850_device> m_acia;
required_device<clock_device> m_acia_clock;
//memory_view m_bank4;
required_ioport_array<4> m_io_keyboard;

Expand All @@ -119,6 +122,8 @@ class bml3_state : public driver_device
uint8_t kb_sel_r();
void kb_sel_w(u8 data);
void mode_sel_w(u8 data);
uint8_t baud_sel_r();
void baud_sel_w(u8 data);
void interlace_sel_w(u8 data);
[[maybe_unused]] uint8_t psg_latch_r();
[[maybe_unused]] void psg_latch_w(u8 data);
Expand Down Expand Up @@ -165,6 +170,7 @@ class bml3_state : public driver_device
u8 m_firq_mask = 0U;
u8 m_firq_status = 0U;
u8 m_nmi = 0U;
u8 m_baud_sel = 0U;
};

class bml3mk2_state : public bml3_state
Expand Down

0 comments on commit 68008cf

Please sign in to comment.