~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/mess/machine/ti990.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
 
    machine/ti990.c
3
 
 
4
 
    Emulation for a few generic aspects of TI990
5
 
*/
6
 
 
7
 
#include "emu.h"
8
 
#include "ti990.h"
9
 
 
10
 
/*
11
 
    Interrupt priority encoder.  Actually part of the CPU board.
12
 
*/
13
 
static UINT16 intlines;
14
 
 
15
 
void ti990_reset_int(void)
16
 
{
17
 
        intlines = 0;
18
 
}
19
 
 
20
 
void ti990_set_int_line(running_machine &machine, int line, int state)
21
 
{
22
 
        int level;
23
 
 
24
 
 
25
 
        if (state)
26
 
                intlines |= (1 << line);
27
 
        else
28
 
                intlines &= ~ (1 << line);
29
 
 
30
 
        if (intlines)
31
 
        {
32
 
                for (level = 0; ! (intlines & (1 << level)); level++)
33
 
                        ;
34
 
                cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, level);    /* interrupt it, baby */
35
 
        }
36
 
        else
37
 
                cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
38
 
}
39
 
 
40
 
void ti990_set_int2(device_t *device, int state)
41
 
{
42
 
        ti990_set_int_line(device->machine(), 2, state);
43
 
}
44
 
 
45
 
void ti990_set_int3(running_machine &machine, int state)
46
 
{
47
 
        ti990_set_int_line(machine, 3, state);
48
 
}
49
 
 
50
 
void ti990_set_int6(running_machine &machine, int state)
51
 
{
52
 
        ti990_set_int_line(machine, 6, state);
53
 
}
54
 
 
55
 
void ti990_set_int7(running_machine &machine, int state)
56
 
{
57
 
        ti990_set_int_line(machine, 7, state);
58
 
}
59
 
 
60
 
void ti990_set_int9(running_machine &machine, int state)
61
 
{
62
 
        ti990_set_int_line(machine, 9, state);
63
 
}
64
 
 
65
 
void ti990_set_int10(running_machine &machine, int state)
66
 
{
67
 
        ti990_set_int_line(machine, 10, state);
68
 
}
69
 
 
70
 
void ti990_set_int13(running_machine &machine, int state)
71
 
{
72
 
        ti990_set_int_line(machine, 13, state);
73
 
}
74
 
 
75
 
/*
76
 
    hold and debounce load line (emulation is inaccurate)
77
 
*/
78
 
 
79
 
static TIMER_CALLBACK(clear_load)
80
 
{
81
 
        cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
82
 
}
83
 
 
84
 
void ti990_hold_load(running_machine &machine)
85
 
{
86
 
        cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
87
 
        machine.scheduler().timer_set(attotime::from_msec(100), FUNC(clear_load));
88
 
}
89
 
 
90
 
/*
91
 
    line interrupt
92
 
*/
93
 
 
94
 
/* ckon_state: 1 if line clock active (RTCLR flip-flop on TI990/10 schematics -
95
 
SMI sheet 4) */
96
 
static char ckon_state;
97
 
 
98
 
void ti990_line_interrupt(running_machine &machine)
99
 
{
100
 
        if (ckon_state)
101
 
                ti990_set_int_line(machine, 5, 1);
102
 
}
103
 
 
104
 
void ti990_ckon_ckof_callback(device_t *device, int state)
105
 
{
106
 
        ckon_state = state;
107
 
        if (! ckon_state)
108
 
                ti990_set_int_line(device->machine(), 5, 0);
109
 
}
110
 
 
111
 
 
112
 
 
113
 
/*
114
 
    Control panel emulation
115
 
 
116
 
    three panel types
117
 
    * operator panel
118
 
    * programmer panel
119
 
    * MDU (external unit connected instead of the control panel, as seen in
120
 
      945401-9701 p. 2-5 though 2-15)
121
 
 
122
 
    Operator panel:
123
 
    * Power led
124
 
    * Fault led
125
 
    * Off/On/Load switch
126
 
 
127
 
    Programmer panel:
128
 
    * 16 status light, 32 switches, IDLE, RUN leds
129
 
    * interface to a low-level debugger in ROMs
130
 
 
131
 
    * MDU:
132
 
    * includes a programmer panel, a tape unit, and a few parts
133
 
      (diagnostic tape, diagnostic ROMs, etc.)
134
 
 
135
 
    CRU output:
136
 
    0-7: lights 0-7
137
 
    8: increment scan
138
 
    9: clear scan (according to 990 handbook)
139
 
    A: run light (additionally sets all data LEDs to 1s, the scan count to 0b10 and enables the HALT/SIE switch)
140
 
    B: fault light
141
 
    C: Memory Error Interrupt clear
142
 
    D: Start panel timer
143
 
    E: Set SIE function (interrupt after 2 instructions are executed)
144
 
    F: flag (according to 990 handbook)
145
 
 
146
 
    input :
147
 
    0-7: switches 0-7 (or data from MDU tape)
148
 
    8: scan count bit 1
149
 
    9: scan count bit 0
150
 
    A: timer active
151
 
    B: programmer panel not present or locked
152
 
    C: char in MDU tape unit buffer?
153
 
    D: unused?
154
 
    E: if 0, MDU unit present
155
 
    F: flag (according to 990 handbook)
156
 
*/
157
 
 
158
 
 READ8_HANDLER ( ti990_panel_read )
159
 
{
160
 
        if (offset == 1)
161
 
                return 0x48;
162
 
 
163
 
        return 0;
164
 
}
165
 
 
166
 
WRITE8_HANDLER ( ti990_panel_write )
167
 
{
168
 
}
169
 
 
170
 
 
171
 
/*
172
 
    CPU board soft reset (RSET instruction)
173
 
*/
174
 
void ti990_cpuboard_reset(void)
175
 
{
176
 
        ckon_state = 0;
177
 
}