From 3faea5bc66bdc42b65b3cc4b5eeab96cd3536064 Mon Sep 17 00:00:00 2001 From: Wilbert Pol Date: Fri, 20 Dec 2013 19:01:28 +0000 Subject: [PATCH] (MESS) jtc.c: Moved driver state into the driver file (nw) --- .gitattributes | 1 - src/mess/drivers/jtc.c | 85 ++++++++++++++++++++++++++++++++++++++- src/mess/includes/jtc.h | 88 ----------------------------------------- 3 files changed, 84 insertions(+), 90 deletions(-) delete mode 100644 src/mess/includes/jtc.h diff --git a/.gitattributes b/.gitattributes index 0220172c966..eb5315f9c96 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7448,7 +7448,6 @@ src/mess/includes/hp48.h svneol=native#text/plain src/mess/includes/huebler.h svneol=native#text/plain src/mess/includes/hx20.h svneol=native#text/plain src/mess/includes/intv.h svneol=native#text/plain -src/mess/includes/jtc.h svneol=native#text/plain src/mess/includes/jupiter.h svneol=native#text/plain src/mess/includes/kaypro.h svneol=native#text/plain src/mess/includes/kc.h svneol=native#text/plain diff --git a/src/mess/drivers/jtc.c b/src/mess/drivers/jtc.c index 7e4f6172d5d..da2087f9d6f 100644 --- a/src/mess/drivers/jtc.c +++ b/src/mess/drivers/jtc.c @@ -6,7 +6,90 @@ ****************************************************************************/ -#include "includes/jtc.h" +#include "emu.h" +#include "cpu/z8/z8.h" +#include "imagedev/cassette.h" +#include "bus/centronics/ctronics.h" +#include "machine/ram.h" +#include "sound/speaker.h" +#include "sound/wave.h" + +#define SCREEN_TAG "screen" +#define UB8830D_TAG "ub8830d" +#define CENTRONICS_TAG "centronics" + +#define JTC_ES40_VIDEORAM_SIZE 0x2000 + +class jtc_state : public driver_device +{ +public: + jtc_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, UB8830D_TAG), + m_cassette(*this, "cassette"), + m_speaker(*this, "speaker"), + m_centronics(*this, CENTRONICS_TAG), + m_video_ram(*this, "video_ram"){ } + + required_device m_maincpu; + required_device m_cassette; + required_device m_speaker; + required_device m_centronics; + + virtual void machine_start(); + + virtual void video_start(); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + DECLARE_WRITE8_MEMBER( p2_w ); + DECLARE_READ8_MEMBER( p3_r ); + DECLARE_WRITE8_MEMBER( p3_w ); + DECLARE_PALETTE_INIT(jtc_es40); + optional_shared_ptr m_video_ram; +}; + + +class jtces88_state : public jtc_state +{ +public: + jtces88_state(const machine_config &mconfig, device_type type, const char *tag) + : jtc_state(mconfig, type, tag) + { } +}; + + +class jtces23_state : public jtc_state +{ +public: + jtces23_state(const machine_config &mconfig, device_type type, const char *tag) + : jtc_state(mconfig, type, tag) + { } + + virtual void video_start(); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; + + +class jtces40_state : public jtc_state +{ +public: + jtces40_state(const machine_config &mconfig, device_type type, const char *tag) + : jtc_state(mconfig, type, tag) + { } + + virtual void video_start(); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + DECLARE_READ8_MEMBER( videoram_r ); + DECLARE_WRITE8_MEMBER( videoram_w ); + DECLARE_WRITE8_MEMBER( banksel_w ); + + UINT8 m_video_bank; + UINT8 *m_color_ram_r; + UINT8 *m_color_ram_g; + UINT8 *m_color_ram_b; +}; + /* Read/Write Handlers */ diff --git a/src/mess/includes/jtc.h b/src/mess/includes/jtc.h deleted file mode 100644 index 7240532551f..00000000000 --- a/src/mess/includes/jtc.h +++ /dev/null @@ -1,88 +0,0 @@ -#pragma once - -#ifndef __JTC__ -#define __JTC__ - - -#include "emu.h" -#include "cpu/z8/z8.h" -#include "imagedev/cassette.h" -#include "bus/centronics/ctronics.h" -#include "machine/ram.h" -#include "sound/speaker.h" -#include "sound/wave.h" - -#define SCREEN_TAG "screen" -#define UB8830D_TAG "ub8830d" -#define CENTRONICS_TAG "centronics" - -#define JTC_ES40_VIDEORAM_SIZE 0x2000 - -class jtc_state : public driver_device -{ -public: - jtc_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, UB8830D_TAG), - m_cassette(*this, "cassette"), - m_speaker(*this, "speaker"), - m_centronics(*this, CENTRONICS_TAG), - m_video_ram(*this, "video_ram"){ } - - required_device m_maincpu; - required_device m_cassette; - required_device m_speaker; - required_device m_centronics; - - virtual void machine_start(); - - virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - DECLARE_WRITE8_MEMBER( p2_w ); - DECLARE_READ8_MEMBER( p3_r ); - DECLARE_WRITE8_MEMBER( p3_w ); - DECLARE_PALETTE_INIT(jtc_es40); - optional_shared_ptr m_video_ram; -}; - -class jtces88_state : public jtc_state -{ -public: - jtces88_state(const machine_config &mconfig, device_type type, const char *tag) - : jtc_state(mconfig, type, tag) - { } -}; - -class jtces23_state : public jtc_state -{ -public: - jtces23_state(const machine_config &mconfig, device_type type, const char *tag) - : jtc_state(mconfig, type, tag) - { } - - virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -}; - -class jtces40_state : public jtc_state -{ -public: - jtces40_state(const machine_config &mconfig, device_type type, const char *tag) - : jtc_state(mconfig, type, tag) - { } - - virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - DECLARE_READ8_MEMBER( videoram_r ); - DECLARE_WRITE8_MEMBER( videoram_w ); - DECLARE_WRITE8_MEMBER( banksel_w ); - - UINT8 m_video_bank; - UINT8 *m_color_ram_r; - UINT8 *m_color_ram_g; - UINT8 *m_color_ram_b; -}; - -#endif