Previous 199869 Revisions Next

r26676 Friday 20th December, 2013 at 19:01:28 UTC by Wilbert Pol
(MESS) jtc.c: Moved driver state into the driver file (nw)
[src/mess/drivers]jtc.c
[src/mess/includes]jtc.h

trunk/src/mess/drivers/jtc.c
r26675r26676
66
77****************************************************************************/
88
9#include "includes/jtc.h"
9#include "emu.h"
10#include "cpu/z8/z8.h"
11#include "imagedev/cassette.h"
12#include "bus/centronics/ctronics.h"
13#include "machine/ram.h"
14#include "sound/speaker.h"
15#include "sound/wave.h"
1016
17#define SCREEN_TAG      "screen"
18#define UB8830D_TAG     "ub8830d"
19#define CENTRONICS_TAG  "centronics"
20
21#define JTC_ES40_VIDEORAM_SIZE  0x2000
22
23class jtc_state : public driver_device
24{
25public:
26   jtc_state(const machine_config &mconfig, device_type type, const char *tag)
27      : driver_device(mconfig, type, tag),
28         m_maincpu(*this, UB8830D_TAG),
29         m_cassette(*this, "cassette"),
30         m_speaker(*this, "speaker"),
31         m_centronics(*this, CENTRONICS_TAG),
32      m_video_ram(*this, "video_ram"){ }
33
34   required_device<cpu_device> m_maincpu;
35   required_device<cassette_image_device> m_cassette;
36   required_device<speaker_sound_device> m_speaker;
37   required_device<centronics_device> m_centronics;
38
39   virtual void machine_start();
40
41   virtual void video_start();
42   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43
44   DECLARE_WRITE8_MEMBER( p2_w );
45   DECLARE_READ8_MEMBER( p3_r );
46   DECLARE_WRITE8_MEMBER( p3_w );
47   DECLARE_PALETTE_INIT(jtc_es40);
48   optional_shared_ptr<UINT8> m_video_ram;
49};
50
51
52class jtces88_state : public jtc_state
53{
54public:
55   jtces88_state(const machine_config &mconfig, device_type type, const char *tag)
56      : jtc_state(mconfig, type, tag)
57   { }
58};
59
60
61class jtces23_state : public jtc_state
62{
63public:
64   jtces23_state(const machine_config &mconfig, device_type type, const char *tag)
65      : jtc_state(mconfig, type, tag)
66   { }
67
68   virtual void video_start();
69   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
70};
71
72
73class jtces40_state : public jtc_state
74{
75public:
76   jtces40_state(const machine_config &mconfig, device_type type, const char *tag)
77      : jtc_state(mconfig, type, tag)
78   { }
79
80   virtual void video_start();
81   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
82
83   DECLARE_READ8_MEMBER( videoram_r );
84   DECLARE_WRITE8_MEMBER( videoram_w );
85   DECLARE_WRITE8_MEMBER( banksel_w );
86
87   UINT8 m_video_bank;
88   UINT8 *m_color_ram_r;
89   UINT8 *m_color_ram_g;
90   UINT8 *m_color_ram_b;
91};
92
93
1194/* Read/Write Handlers */
1295
1396WRITE8_MEMBER( jtc_state::p2_w )
trunk/src/mess/includes/jtc.h
r26675r26676
1#pragma once
2
3#ifndef __JTC__
4#define __JTC__
5
6
7#include "emu.h"
8#include "cpu/z8/z8.h"
9#include "imagedev/cassette.h"
10#include "bus/centronics/ctronics.h"
11#include "machine/ram.h"
12#include "sound/speaker.h"
13#include "sound/wave.h"
14
15#define SCREEN_TAG      "screen"
16#define UB8830D_TAG     "ub8830d"
17#define CENTRONICS_TAG  "centronics"
18
19#define JTC_ES40_VIDEORAM_SIZE  0x2000
20
21class jtc_state : public driver_device
22{
23public:
24   jtc_state(const machine_config &mconfig, device_type type, const char *tag)
25      : driver_device(mconfig, type, tag),
26         m_maincpu(*this, UB8830D_TAG),
27         m_cassette(*this, "cassette"),
28         m_speaker(*this, "speaker"),
29         m_centronics(*this, CENTRONICS_TAG),
30      m_video_ram(*this, "video_ram"){ }
31
32   required_device<cpu_device> m_maincpu;
33   required_device<cassette_image_device> m_cassette;
34   required_device<speaker_sound_device> m_speaker;
35   required_device<centronics_device> m_centronics;
36
37   virtual void machine_start();
38
39   virtual void video_start();
40   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41
42   DECLARE_WRITE8_MEMBER( p2_w );
43   DECLARE_READ8_MEMBER( p3_r );
44   DECLARE_WRITE8_MEMBER( p3_w );
45   DECLARE_PALETTE_INIT(jtc_es40);
46   optional_shared_ptr<UINT8> m_video_ram;
47};
48
49class jtces88_state : public jtc_state
50{
51public:
52   jtces88_state(const machine_config &mconfig, device_type type, const char *tag)
53      : jtc_state(mconfig, type, tag)
54   { }
55};
56
57class jtces23_state : public jtc_state
58{
59public:
60   jtces23_state(const machine_config &mconfig, device_type type, const char *tag)
61      : jtc_state(mconfig, type, tag)
62   { }
63
64   virtual void video_start();
65   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
66};
67
68class jtces40_state : public jtc_state
69{
70public:
71   jtces40_state(const machine_config &mconfig, device_type type, const char *tag)
72      : jtc_state(mconfig, type, tag)
73   { }
74
75   virtual void video_start();
76   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
77
78   DECLARE_READ8_MEMBER( videoram_r );
79   DECLARE_WRITE8_MEMBER( videoram_w );
80   DECLARE_WRITE8_MEMBER( banksel_w );
81
82   UINT8 m_video_bank;
83   UINT8 *m_color_ram_r;
84   UINT8 *m_color_ram_g;
85   UINT8 *m_color_ram_b;
86};
87
88#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team