mirror of
https://github.com/holub/mame
synced 2025-06-06 21:03:47 +03:00
enmirage: use PWM device to get readable LED messages [R. Belmont]
This commit is contained in:
parent
5c3f7a9a6d
commit
9955eed5d2
@ -51,6 +51,7 @@
|
||||
#include "machine/wd_fdc.h"
|
||||
#include "formats/esq8_dsk.h"
|
||||
#include "sound/es5503.h"
|
||||
#include "video/pwm.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include "mirage.lh"
|
||||
@ -61,10 +62,10 @@ public:
|
||||
enmirage_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_display(*this, "display"),
|
||||
m_fdc(*this, "wd1772"),
|
||||
m_floppy_connector(*this, "wd1772:0"),
|
||||
m_via(*this, "via6522"),
|
||||
m_digits(*this, "digit%u", 0U)
|
||||
m_via(*this, "via6522")
|
||||
{
|
||||
}
|
||||
|
||||
@ -76,7 +77,6 @@ private:
|
||||
|
||||
DECLARE_FLOPPY_FORMATS( floppy_formats );
|
||||
|
||||
uint32_t screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE8_MEMBER(mirage_via_write_porta);
|
||||
DECLARE_WRITE8_MEMBER(mirage_via_write_portb);
|
||||
DECLARE_WRITE_LINE_MEMBER(mirage_doc_irq);
|
||||
@ -85,19 +85,14 @@ private:
|
||||
void mirage_map(address_map &map);
|
||||
|
||||
virtual void machine_reset() override;
|
||||
virtual void machine_start() override { m_digits.resolve(); }
|
||||
virtual void video_start() override;
|
||||
|
||||
required_device<mc6809e_device> m_maincpu;
|
||||
required_device<pwm_display_device> m_display;
|
||||
required_device<wd1772_device> m_fdc;
|
||||
required_device<floppy_connector> m_floppy_connector;
|
||||
required_device<via6522_device> m_via;
|
||||
|
||||
int last_sndram_bank;
|
||||
|
||||
uint8_t m_l_segs, m_r_segs;
|
||||
int m_l_hi, m_r_hi;
|
||||
output_finder<2> m_digits;
|
||||
};
|
||||
|
||||
FLOPPY_FORMATS_MEMBER( enmirage_state::floppy_formats )
|
||||
@ -119,15 +114,6 @@ READ8_MEMBER(enmirage_state::mirage_adc_read)
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
void enmirage_state::video_start()
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t enmirage_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void enmirage_state::machine_reset()
|
||||
{
|
||||
last_sndram_bank = 0;
|
||||
@ -153,50 +139,8 @@ void enmirage_state::mirage_map(address_map &map)
|
||||
// bits 5/6/7 keypad rows 0/1/2 return
|
||||
WRITE8_MEMBER(enmirage_state::mirage_via_write_porta)
|
||||
{
|
||||
uint8_t seg = data & 7;
|
||||
static const int segconv[8] =
|
||||
{
|
||||
16, 8, 32, 2, 1, 64, 128, 4
|
||||
};
|
||||
|
||||
// printf("PA: %02x (PC=%x)\n", data, m_maincpu->pc());
|
||||
|
||||
// left LED selected?
|
||||
if ((data & 0x10) == 0x10)
|
||||
{
|
||||
// if the segment number is lower than last time, we've
|
||||
// started a new refresh cycle
|
||||
if ((seg < m_l_hi) || (seg == 0))
|
||||
{
|
||||
m_l_segs = segconv[seg];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_l_segs |= segconv[seg];
|
||||
}
|
||||
|
||||
m_l_hi = seg;
|
||||
m_digits[0] = m_l_segs;
|
||||
// printf("L LED: seg %d (hi %d conv %02x, %02x)\n", seg, m_l_hi, segconv[seg], m_l_segs);
|
||||
}
|
||||
// right LED selected?
|
||||
if ((data & 0x08) == 0x08)
|
||||
{
|
||||
// if the segment number is lower than last time, we've
|
||||
// started a new refresh cycle
|
||||
if ((seg < m_r_hi) || (seg == 0))
|
||||
{
|
||||
m_r_segs = segconv[seg];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_r_segs |= segconv[seg];
|
||||
}
|
||||
|
||||
m_r_hi = seg;
|
||||
m_digits[1] = m_r_segs;
|
||||
// printf("R LED: seg %d (hi %d conv %02x, %02x)\n", seg, m_r_hi, segconv[seg], m_r_segs);
|
||||
}
|
||||
u8 segdata = data & 7;
|
||||
m_display->matrix(((data >> 3) & 3) ^ 3, (1<<segdata));
|
||||
}
|
||||
|
||||
// port B:
|
||||
@ -226,8 +170,6 @@ void enmirage_state::mirage(machine_config &config)
|
||||
MC6809E(config, m_maincpu, 2000000);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &enmirage_state::mirage_map);
|
||||
|
||||
config.set_default_layout(layout_mirage);
|
||||
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
es5503_device &es5503(ES5503(config, "es5503", 7000000));
|
||||
@ -242,6 +184,10 @@ void enmirage_state::mirage(machine_config &config)
|
||||
m_via->writepb_handler().set(FUNC(enmirage_state::mirage_via_write_portb));
|
||||
m_via->irq_handler().set_inputline(m_maincpu, M6809_IRQ_LINE);
|
||||
|
||||
PWM_DISPLAY(config, m_display).set_size(2, 8);
|
||||
m_display->set_segmask(0x3, 0xff);
|
||||
config.set_default_layout(layout_mirage);
|
||||
|
||||
acia6850_device &acia6850(ACIA6850(config, "acia6850", 0));
|
||||
acia6850.irq_handler().set_inputline(m_maincpu, M6809_FIRQ_LINE);
|
||||
|
||||
@ -272,9 +218,6 @@ void enmirage_state::init_mirage()
|
||||
floppy->ss_w(0);
|
||||
}
|
||||
|
||||
m_l_hi = m_r_hi = 9;
|
||||
m_l_segs = m_r_segs = 0;
|
||||
|
||||
// port A: front panel
|
||||
m_via->write_pa0(0);
|
||||
m_via->write_pa1(0);
|
||||
@ -294,8 +237,8 @@ void enmirage_state::init_mirage()
|
||||
m_via->write_pb3(0);
|
||||
m_via->write_pb4(0);
|
||||
m_via->write_pb5(1);
|
||||
m_via->write_pb6(1);
|
||||
m_via->write_pb6(0); // how to determine if a disk is inserted?
|
||||
m_via->write_pb7(0);
|
||||
}
|
||||
|
||||
CONS( 1984, enmirage, 0, 0, mirage, mirage, enmirage_state, init_mirage, "Ensoniq", "Ensoniq Mirage", MACHINE_NOT_WORKING )
|
||||
CONS( 1984, enmirage, 0, 0, mirage, mirage, enmirage_state, init_mirage, "Ensoniq", "Mirage", MACHINE_NOT_WORKING )
|
||||
|
Loading…
Reference in New Issue
Block a user