summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/coco3.h
blob: ffcb05f77a9830d7f58d1cc37f5717ad814cba7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// license:BSD-3-Clause
// copyright-holders:Nathan Woods
/***************************************************************************

    coco3.h

    TRS-80 Radio Shack Color Computer 1/2 Family

***************************************************************************/

#pragma once

#ifndef MAME_INCLUDES_COCO3_H
#define MAME_INCLUDES_COCO3_H


#include "includes/coco12.h"
#include "video/gime.h"


//**************************************************************************
//  MACROS / CONSTANTS
//**************************************************************************

#define GIME_TAG                "gime"
#define VDG_TAG                 "vdg"
#define COMPOSITE_SCREEN_TAG    "composite"
#define RGB_SCREEN_TAG          "rgb"



//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

class coco3_state : public coco_state
{
public:
	coco3_state(const machine_config &mconfig, device_type type, const char *tag)
		: coco_state(mconfig, type, tag)
		, m_gime(*this, GIME_TAG) { }

	virtual DECLARE_WRITE8_MEMBER( ff20_write ) override;
	virtual DECLARE_READ8_MEMBER( ff40_read ) override;
	virtual DECLARE_WRITE8_MEMBER( ff40_write ) override;

	DECLARE_WRITE_LINE_MEMBER(gime_firq_w) { recalculate_firq(); }
	DECLARE_WRITE_LINE_MEMBER(gime_irq_w) { recalculate_irq(); }

	uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);

	void coco3p(machine_config &config);
	void coco3h(machine_config &config);
	void coco3dw1(machine_config &config);
	void coco3(machine_config &config);
	void coco3_mem(address_map &map);
protected:
	virtual void update_cart_base(uint8_t *cart_base) override;

	// interrupts
	virtual bool firq_get_line(void) override;
	virtual bool irq_get_line(void) override;

	// miscellaneous
	virtual void update_keyboard_input(uint8_t value, uint8_t z) override;
	virtual void cart_w(bool line) override;

private:
	required_device<gime_device> m_gime;
};

#endif // MAME_INCLUDES_COCO3_H