Skip to content

Commit fcf0edf

Browse files
committed
brainchild/pls1000.cpp: add left column inputs and sound
1 parent b2ac41d commit fcf0edf

File tree

2 files changed

+41
-14
lines changed

2 files changed

+41
-14
lines changed

hash/pls1000_cart.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
license:CC0-1.0
55
66
TODO:
7-
- bootstrap checks at boot if cart has $5a05 on it, if that check fails it tries for $03 on second
8-
byte. Compatibility/version flags for an earlier system?
7+
- system bootstrap checks if cart has 0x5a05 as first word, if that check fails it tries for $03
8+
on second byte. Compatibility/version flag for an earlier system?
99
1010
-->
1111
<softwarelist name="pls1000_cart" description="Brainchild PLS-1000 cartridges">
1212

1313
<software name="decmath" supported="no">
14-
<description>Decimal Math</description>
14+
<!-- Compile date 8/16/1995 -->
15+
<description>Decimal Math (v2.83)</description>
1516
<year>1995</year>
1617
<publisher>Brainchild</publisher>
1718
<!-- Published under license from Skills Bank Corporation -->

src/mame/brainchild/pls1000.cpp

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Brainchild PLS-1000 "Personal Learning System"
77
TODO:
88
- I/O;
99
- Stuck on cart loading;
10-
- Sound (DAC1BIT?)
10+
- DAC1BIT usage is assumed;
1111
1212
===================================================================================================
1313
@@ -25,9 +25,10 @@ two knobs at console bottom sides, VR1/VR2
2525
#include "bus/generic/carts.h"
2626
#include "cpu/m68000/m68000.h"
2727
#include "machine/mc68328.h"
28+
#include "sound/dac.h"
2829
#include "video/mc68328lcd.h"
2930

30-
//#include "speaker.h"
31+
#include "speaker.h"
3132
#include "screen.h"
3233
#include "softlist_dev.h"
3334

@@ -42,6 +43,7 @@ class pls1000_state : public driver_device
4243
, m_lcdctrl(*this, "lcdctrl")
4344
, m_screen(*this, "screen")
4445
, m_cart(*this, "cart")
46+
, m_in_portd(*this, "PORTD")
4547
{ }
4648

4749
void pls1000(machine_config &config);
@@ -50,10 +52,11 @@ class pls1000_state : public driver_device
5052
void main_map(address_map &map) ATTR_COLD;
5153

5254
private:
53-
required_device<mc68328_base_device> m_maincpu;
55+
required_device<mc68328_device> m_maincpu;
5456
required_device<mc68328_lcd_device> m_lcdctrl;
5557
required_device<screen_device> m_screen;
5658
required_device<generic_slot_device> m_cart;
59+
required_ioport m_in_portd;
5760

5861
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5962

@@ -72,7 +75,21 @@ void pls1000_state::main_map(address_map &map)
7275
map(0x800000, 0x83ffff).r(m_cart, FUNC(generic_slot_device::read16_rom));
7376
}
7477

78+
// two columns on console sides:
79+
// A-B-C-D-E then "Explain" in orange text on left side
80+
// page right-page left-scroll up-scroll down-asterisk (*) then "Menu" in orange text on right side
81+
7582
static INPUT_PORTS_START( pls1000 )
83+
PORT_START("PORTD")
84+
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("A")
85+
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B")
86+
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("C")
87+
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("D")
88+
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("E")
89+
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Explain")
90+
PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
91+
92+
// TODO: right column
7693
INPUT_PORTS_END
7794

7895
void pls1000_state::pls1000(machine_config &config)
@@ -81,19 +98,29 @@ void pls1000_state::pls1000(machine_config &config)
8198
MC68328(config, m_maincpu, 32768*506); // MC68328PV16VA
8299
m_maincpu->set_addrmap(AS_PROGRAM, &pls1000_state::main_map);
83100

84-
// TODO: I/O ports
101+
m_maincpu->in_port_d<0>().set_ioport(m_in_portd).bit(0);
102+
m_maincpu->in_port_d<1>().set_ioport(m_in_portd).bit(1);
103+
m_maincpu->in_port_d<2>().set_ioport(m_in_portd).bit(2);
104+
m_maincpu->in_port_d<3>().set_ioport(m_in_portd).bit(3);
105+
m_maincpu->in_port_d<4>().set_ioport(m_in_portd).bit(4);
106+
m_maincpu->in_port_d<5>().set_ioport(m_in_portd).bit(5);
107+
m_maincpu->in_port_d<6>().set_ioport(m_in_portd).bit(6);
108+
m_maincpu->in_port_d<7>().set_ioport(m_in_portd).bit(7);
109+
110+
// TODO: other I/O ports (J r/w at startup)
85111

86112
m_maincpu->out_flm().set(m_lcdctrl, FUNC(mc68328_lcd_device::flm_w));
87113
m_maincpu->out_llp().set(m_lcdctrl, FUNC(mc68328_lcd_device::llp_w));
88114
m_maincpu->out_lsclk().set(m_lcdctrl, FUNC(mc68328_lcd_device::lsclk_w));
89115
m_maincpu->out_ld().set(m_lcdctrl, FUNC(mc68328_lcd_device::ld_w));
90116
m_maincpu->set_lcd_info_changed(m_lcdctrl, FUNC(mc68328_lcd_device::lcd_info_changed));
91117

92-
// TODO: check vertical
118+
m_maincpu->out_pwm().set("dac", FUNC(dac_bit_interface::write));
119+
93120
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
94121
m_screen->set_refresh_hz(60);
95-
m_screen->set_size(240, 144);
96-
m_screen->set_visarea(0, 240 - 1, 0, 144 - 1);
122+
m_screen->set_size(240, 128);
123+
m_screen->set_visarea(0, 240 - 1, 0, 128 - 1);
97124
m_screen->set_screen_update(FUNC(pls1000_state::screen_update));
98125

99126
MC68328_LCD(config, m_lcdctrl, 0);
@@ -106,9 +133,8 @@ void pls1000_state::pls1000(machine_config &config)
106133

107134
SOFTWARE_LIST(config, "cart_list").set_original("pls1000_cart");
108135

109-
110-
// SPEAKER(config, "speaker").front_center();
111-
// DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25);
136+
SPEAKER(config, "speaker").front_center();
137+
DAC_1BIT(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25);
112138
}
113139

114140

@@ -121,5 +147,5 @@ ROM_END
121147

122148
} // anonymous namespace
123149

124-
CONS( 1998, pls1000, 0, 0, pls1000, pls1000, pls1000_state, empty_init, "Brainchild", "PLS-1000", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
150+
CONS( 1998, pls1000, 0, 0, pls1000, pls1000, pls1000_state, empty_init, "Brainchild", "PLS-1000", MACHINE_NOT_WORKING )
125151

0 commit comments

Comments
 (0)