Skip to content

Commit

Permalink
hitachi/bmjr.cpp: hookup cassette software list
Browse files Browse the repository at this point in the history
New working software list items
-------------------------------
bmjr_cass: Wilwesp [Gaming Alexandria]
  • Loading branch information
angelosa committed Sep 18, 2024
1 parent 5d27671 commit df90a55
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
22 changes: 22 additions & 0 deletions hash/bmjr_cass.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
<!--
license:CC0-1.0
-->
<softwarelist name="bmjr_cass" description="Hitachi Basic Master Jr. cassettes">

<!-- TODO: compatible with Basic Master LV2 too -->
<software name="wilwesp" supported="yes">
<!-- Capitalized as WILWESP on Micom Basic printout, wILwESP in-game -->
<description>Wilwesp</description>
<year>1984</year>
<publisher>Micom BASIC</publisher>
<info name="usage" value="LOAD WILWSP then RUN" />
<info name="author" value="Orange Juice"/>
<part name="cass" interface="bmjr_cass">
<dataarea name="cass" size="23584812">
<rom name="wilwesp.wav" size="23584812" crc="d46d46e6" sha1="32494926110bdb015e85d18dff2ea7b2f6d58580"/>
</dataarea>
</part>
</software>
</softwarelist>
29 changes: 17 additions & 12 deletions src/mame/hitachi/bmjr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Basic Master Jr. (MB-6885) (c) 1982? Hitachi

#include "emupal.h"
#include "screen.h"
#include "softlist_dev.h"
#include "speaker.h"


Expand All @@ -37,7 +38,7 @@ class bmjr_state : public driver_device
bmjr_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_cass(*this, "cassette")
, m_cassette(*this, "cassette")
, m_dac(*this, "dac")
, m_work_ram(*this, "work_ram")
, m_basic_view(*this, "basic_view")
Expand All @@ -61,7 +62,7 @@ class bmjr_state : public driver_device
void main_map(address_map &map);

required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cass;
required_device<cassette_image_device> m_cassette;
required_device<dac_5bit_binary_weighted_device> m_dac;
required_shared_ptr<u8> m_work_ram;
memory_view m_basic_view;
Expand Down Expand Up @@ -172,7 +173,7 @@ u8 bmjr_state::timer_r()
TIMER_DEVICE_CALLBACK_MEMBER( bmjr_state::kansas_r )
{
/* cassette - turn pulses into a bit */
bool cass_ws = (m_cass->input() > +0.04) ? 1 : 0;
bool cass_ws = (m_cassette->input() > +0.04) ? 1 : 0;
m_casscnt++;

if (cass_ws != m_cassold)
Expand All @@ -190,7 +191,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( bmjr_state::kansas_r )

u8 bmjr_state::tape_r()
{
//m_cass->change_state(CASSETTE_PLAY,CASSETTE_MASK_UISTATE);
//m_cassette->change_state(CASSETTE_PLAY,CASSETTE_MASK_UISTATE);

return m_cassbit ? 0xff : 0x00;
}
Expand All @@ -203,23 +204,23 @@ void bmjr_state::tape_w(u8 data)
}
else
{
//m_cass->change_state(CASSETTE_RECORD,CASSETTE_MASK_UISTATE);
m_cass->output(BIT(data, 0) ? -1.0 : +1.0);
//m_cassette->change_state(CASSETTE_RECORD,CASSETTE_MASK_UISTATE);
m_cassette->output(BIT(data, 0) ? -1.0 : +1.0);
}
}

u8 bmjr_state::tape_stop_r()
{
m_tape_switch = 0;
//m_cass->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE);
m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
//m_cassette->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE);
m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
return 0x01;
}

u8 bmjr_state::tape_start_r()
{
m_tape_switch = 1;
m_cass->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
m_cassette->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
return 0x01;
}

Expand Down Expand Up @@ -452,7 +453,7 @@ void bmjr_state::machine_reset()
//m_beep->set_state(0);
m_tape_switch = 0;
m_key_select = 0;
m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
m_cassette->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
m_bank_mode = 0;
m_basic_view.select(0);
m_printer_view.select(0);
Expand All @@ -469,8 +470,10 @@ void bmjr_state::bmjr(machine_config &config)
m_maincpu->set_vblank_int("screen", FUNC(bmjr_state::irq0_line_hold));

// TRQ237/TRQ359
CASSETTE(config, m_cass);
m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
CASSETTE(config, m_cassette);
m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
m_cassette->set_interface("bmjr_cass");

TIMER(config, "kansas_r").configure_periodic(FUNC(bmjr_state::kansas_r), attotime::from_hz(40000));

screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
Expand All @@ -487,6 +490,8 @@ void bmjr_state::bmjr(machine_config &config)
SPEAKER(config, "mono").front_center();
// TODO: unknown DAC type, likely connected to discrete circuitry.
DAC_5BIT_BINARY_WEIGHTED(config, m_dac).add_route(ALL_OUTPUTS, "mono", 0.25);

SOFTWARE_LIST(config, "cass_list").set_original("bmjr_cass");
}

/* ROM definition */
Expand Down

0 comments on commit df90a55

Please sign in to comment.