~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to mess/src/mess/video/pecom.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
        Pecom driver by Miodrag Milanovic
4
 
 
5
 
        08/11/2008 Preliminary driver.
6
 
 
7
 
****************************************************************************/
8
 
 
9
 
#include "emu.h"
10
 
#include "sound/cdp1869.h"
11
 
#include "sound/wave.h"
12
 
#include "cpu/cosmac/cosmac.h"
13
 
#include "includes/pecom.h"
14
 
 
15
 
WRITE8_HANDLER( pecom_cdp1869_w )
16
 
{
17
 
        pecom_state *state = space->machine().driver_data<pecom_state>();
18
 
 
19
 
        UINT16 ma = state->m_cdp1802->get_memory_address();
20
 
 
21
 
        switch (offset + 3)
22
 
        {
23
 
        case 3:
24
 
                state->m_cdp1869->out3_w(*space, ma, data);
25
 
                break;
26
 
 
27
 
        case 4:
28
 
                state->m_cdp1869->out4_w(*space, ma, data);
29
 
                break;
30
 
 
31
 
        case 5:
32
 
                state->m_cdp1869->out5_w(*space, ma, data);
33
 
                break;
34
 
 
35
 
        case 6:
36
 
                state->m_cdp1869->out6_w(*space, ma, data);
37
 
                break;
38
 
 
39
 
        case 7:
40
 
                state->m_cdp1869->out7_w(*space, ma, data);
41
 
                break;
42
 
        }
43
 
}
44
 
 
45
 
static ADDRESS_MAP_START( cdp1869_page_ram, AS_0, 8 )
46
 
        AM_RANGE(0x000, 0x3ff) AM_MIRROR(0x400) AM_RAM
47
 
ADDRESS_MAP_END
48
 
 
49
 
static CDP1869_CHAR_RAM_READ( pecom_char_ram_r )
50
 
{
51
 
        pecom_state *state = device->machine().driver_data<pecom_state>();
52
 
 
53
 
        UINT8 column = pmd & 0x7f;
54
 
        UINT16 charaddr = (column << 4) | cma;
55
 
 
56
 
        return state->m_charram[charaddr];
57
 
}
58
 
 
59
 
static CDP1869_CHAR_RAM_WRITE( pecom_char_ram_w )
60
 
{
61
 
        pecom_state *state = device->machine().driver_data<pecom_state>();
62
 
 
63
 
        UINT8 column = pmd & 0x7f;
64
 
        UINT16 charaddr = (column << 4) | cma;
65
 
 
66
 
        state->m_charram[charaddr] = data;
67
 
}
68
 
 
69
 
static CDP1869_PCB_READ( pecom_pcb_r )
70
 
{
71
 
        return BIT(pmd, 7);
72
 
}
73
 
 
74
 
static WRITE_LINE_DEVICE_HANDLER( pecom_prd_w )
75
 
{
76
 
        pecom_state *driver_state = device->machine().driver_data<pecom_state>();
77
 
 
78
 
        // every other PRD triggers a DMAOUT request
79
 
        if (driver_state->m_dma)
80
 
        {
81
 
                cputag_set_input_line(device->machine(), CDP1802_TAG, COSMAC_INPUT_LINE_DMAOUT, HOLD_LINE);
82
 
        }
83
 
 
84
 
        driver_state->m_dma = !driver_state->m_dma;
85
 
}
86
 
 
87
 
static CDP1869_INTERFACE( pecom_cdp1869_intf )
88
 
{
89
 
        SCREEN_TAG,
90
 
        CDP1869_COLOR_CLK_PAL,
91
 
        CDP1869_PAL,
92
 
        pecom_pcb_r,
93
 
        pecom_char_ram_r,
94
 
        pecom_char_ram_w,
95
 
        DEVCB_LINE(pecom_prd_w)
96
 
};
97
 
 
98
 
static VIDEO_START( pecom )
99
 
{
100
 
        pecom_state *state = machine.driver_data<pecom_state>();
101
 
 
102
 
        /* allocate memory */
103
 
        state->m_charram = auto_alloc_array(machine, UINT8, PECOM_CHAR_RAM_SIZE);
104
 
 
105
 
        /* register for state saving */
106
 
        state->save_item(NAME(state->m_reset));
107
 
        state->save_item(NAME(state->m_dma));
108
 
        state->save_pointer(NAME(state->m_charram), PECOM_CHAR_RAM_SIZE);
109
 
}
110
 
 
111
 
static SCREEN_UPDATE( pecom )
112
 
{
113
 
        pecom_state *state = screen->machine().driver_data<pecom_state>();
114
 
 
115
 
        state->m_cdp1869->update_screen(bitmap, cliprect);
116
 
 
117
 
        return 0;
118
 
}
119
 
 
120
 
MACHINE_CONFIG_FRAGMENT( pecom_video )
121
 
        MCFG_CDP1869_SCREEN_PAL_ADD(SCREEN_TAG, CDP1869_DOT_CLK_PAL)
122
 
        MCFG_SCREEN_UPDATE(pecom)
123
 
 
124
 
        MCFG_VIDEO_START(pecom)
125
 
 
126
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
127
 
 
128
 
        MCFG_CDP1869_ADD(CDP1869_TAG, CDP1869_DOT_CLK_PAL, pecom_cdp1869_intf, cdp1869_page_ram)
129
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
130
 
        MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
131
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
132
 
MACHINE_CONFIG_END