poly880: move header file into driver

This commit is contained in:
hap 2021-04-28 00:09:53 +02:00
parent 1773a82cdd
commit 5f27fc8951
4 changed files with 80 additions and 91 deletions

View File

@ -4230,11 +4230,9 @@ files {
MAME_DIR .. "src/mame/machine/kc_keyb.h",
MAME_DIR .. "src/mame/video/kc.cpp",
MAME_DIR .. "src/mame/drivers/lc80.cpp",
MAME_DIR .. "src/mame/includes/lc80.h",
MAME_DIR .. "src/mame/drivers/mc8020.cpp",
MAME_DIR .. "src/mame/drivers/mc8030.cpp",
MAME_DIR .. "src/mame/drivers/poly880.cpp",
MAME_DIR .. "src/mame/includes/poly880.h",
MAME_DIR .. "src/mame/drivers/sc2.cpp",
}

View File

@ -38,9 +38,70 @@ TODO:
****************************************************************************/
#include "emu.h"
#include "includes/poly880.h"
#include "cpu/z80/z80.h"
#include "machine/z80daisy.h"
#include "imagedev/cassette.h"
#include "machine/z80pio.h"
#include "machine/z80ctc.h"
#include "machine/ram.h"
#include "sound/spkrdev.h"
#include "speaker.h"
#include "poly880.lh"
#define SCREEN_TAG "screen"
#define Z80_TAG "i1"
#define Z80CTC_TAG "i4"
#define Z80PIO1_TAG "i2"
#define Z80PIO2_TAG "i3"
class poly880_state : public driver_device
{
public:
poly880_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, Z80_TAG)
, m_cassette(*this, "cassette")
, m_ki(*this, "KI%u", 1U)
, m_speaker(*this, "speaker")
, m_digits(*this, "digit%u", 0U)
, m_nmi(false)
{ }
void poly880(machine_config &config);
void poly880s(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
private:
required_device<z80_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
required_ioport_array<3> m_ki;
required_device<speaker_sound_device> m_speaker;
output_finder<8> m_digits;
virtual void machine_start() override;
void cldig_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER( ctc_z0_w );
DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
void pio1_pa_w(uint8_t data);
uint8_t pio1_pb_r();
void pio1_pb_w(uint8_t data);
void update_display();
/* display state */
uint8_t m_digit;
uint8_t m_segment;
bool m_nmi;
void poly880_io(address_map &map);
void poly880_mem(address_map &map);
void poly880s_mem(address_map &map);
};
/* Read/Write Handlers */

View File

@ -1,70 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
#pragma once
#ifndef MAME_INCLUDES_POLY880_H
#define MAME_INCLUDES_POLY880_H
#include "cpu/z80/z80.h"
#include "machine/z80daisy.h"
#include "imagedev/cassette.h"
#include "machine/z80pio.h"
#include "machine/z80ctc.h"
#include "machine/ram.h"
#include "sound/spkrdev.h"
#include "speaker.h"
#define SCREEN_TAG "screen"
#define Z80_TAG "i1"
#define Z80CTC_TAG "i4"
#define Z80PIO1_TAG "i2"
#define Z80PIO2_TAG "i3"
class poly880_state : public driver_device
{
public:
poly880_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, Z80_TAG)
, m_cassette(*this, "cassette")
, m_ki(*this, "KI%u", 1U)
, m_speaker(*this, "speaker")
, m_digits(*this, "digit%u", 0U)
, m_nmi(false)
{ }
void poly880(machine_config &config);
void poly880s(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
private:
required_device<z80_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
required_ioport_array<3> m_ki;
required_device<speaker_sound_device> m_speaker;
output_finder<8> m_digits;
virtual void machine_start() override;
void cldig_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER( ctc_z0_w );
DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
void pio1_pa_w(uint8_t data);
uint8_t pio1_pb_r();
void pio1_pb_w(uint8_t data);
void update_display();
/* display state */
uint8_t m_digit;
uint8_t m_segment;
bool m_nmi;
void poly880_io(address_map &map);
void poly880_mem(address_map &map);
void poly880s_mem(address_map &map);
};
#endif

View File

@ -5,35 +5,35 @@ license:CC0
<mamelayout version="2">
<element name="digit" defstate="0">
<led7seg>
<color red="0" green="0.75" blue="0.0" />
<color red="0.4" green="1.0" blue="0" />
</led7seg>
</element>
<view name="Default Layout">
<view name="Internal Layout">
<!-- Led address display -->
<element name="digit0" ref="digit">
<bounds x="0" y="0" width="18" height="24" />
<bounds x="0" y="0" width="18" height="26" />
</element>
<element name="digit1" ref="digit">
<bounds x="18" y="0" width="18" height="24" />
<bounds x="18" y="0" width="18" height="26" />
</element>
<element name="digit2" ref="digit">
<bounds x="36" y="0" width="18" height="24" />
<bounds x="36" y="0" width="18" height="26" />
</element>
<element name="digit3" ref="digit">
<bounds x="54" y="0" width="18" height="24" />
<bounds x="54" y="0" width="18" height="26" />
</element>
<element name="digit4" ref="digit">
<bounds x="72" y="0" width="18" height="24" />
<bounds x="72" y="0" width="18" height="26" />
</element>
<element name="digit5" ref="digit">
<bounds x="90" y="0" width="18" height="24" />
<bounds x="90" y="0" width="18" height="26" />
</element>
<element name="digit6" ref="digit">
<bounds x="108" y="0" width="18" height="24" />
<bounds x="108" y="0" width="18" height="26" />
</element>
<element name="digit7" ref="digit">
<bounds x="126" y="0" width="18" height="24" />
<bounds x="126" y="0" width="18" height="26" />
</element>
</view>
</mamelayout>