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

« back to all changes in this revision

Viewing changes to src/emu/machine/6526cia.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#include "emu.h"
11
11
#include "6526cia.h"
12
12
 
13
 
/***************************************************************************
14
 
    CONSTANTS
15
 
***************************************************************************/
 
13
 
 
14
 
 
15
//**************************************************************************
 
16
//  MACROS / CONSTANTS
 
17
//**************************************************************************
16
18
 
17
19
/* CIA registers */
18
20
#define CIA_PRA                 0
41
43
#define CIA_CRA_SPMODE  0x40
42
44
#define CIA_CRA_TODIN   0x80
43
45
 
 
46
 
 
47
 
44
48
//**************************************************************************
45
49
//  DEVICE CONFIGURATION
46
50
//**************************************************************************
47
51
 
48
 
 
49
 
//**************************************************************************
50
 
//  LIVE DEVICE
51
 
//**************************************************************************
52
 
 
53
52
// device type definition
54
53
const device_type MOS6526R1 = &device_creator<mos6526r1_device>;
55
54
const device_type MOS6526R2 = &device_creator<mos6526r2_device>;
56
55
const device_type MOS8520 = &device_creator<mos8520_device>;
57
56
 
 
57
 
 
58
 
 
59
//**************************************************************************
 
60
//  INLINE HELPERS
 
61
//**************************************************************************
 
62
 
 
63
inline attotime mos6526_device::cycles_to_time(int c)
 
64
{
 
65
        return attotime::from_hz(clock()) * c;
 
66
}
 
67
 
 
68
 
 
69
 
 
70
//**************************************************************************
 
71
//  LIVE DEVICE
 
72
//**************************************************************************
 
73
 
58
74
//-------------------------------------------------
59
75
//  mos6526_device - constructor
60
76
//-------------------------------------------------
174
190
        }
175
191
 
176
192
        /* setup timers */
 
193
        m_pc_timer = timer_alloc(TIMER_PC);
 
194
 
177
195
        for (int t = 0; t < (sizeof(m_timer) / sizeof(m_timer[0])); t++)
178
196
        {
179
197
                cia_timer *timer = &m_timer[t];
225
243
}
226
244
 
227
245
 
 
246
//-------------------------------------------------
 
247
//  device_timer - handler timer events
 
248
//-------------------------------------------------
 
249
 
 
250
void mos6526_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
 
251
{
 
252
        switch (id)
 
253
        {
 
254
        case TIMER_PC:
 
255
                m_out_pc_func(1);
 
256
                break;
 
257
        }
 
258
}
 
259
 
 
260
 
228
261
/*-------------------------------------------------
229
262
    set_port_mask_value
230
263
-------------------------------------------------*/
240
273
 
241
274
void mos6526_device::update_pc()
242
275
{
243
 
        /* this should really be one cycle long */
244
276
        m_out_pc_func(0);
245
 
        m_out_pc_func(1);
 
277
 
 
278
        m_pc_timer->adjust(cycles_to_time(1));
246
279
}
247
280
 
248
281
/*-------------------------------------------------