~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/c64/c64parallel.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
 
41
41
static BYTE parallel_cable_cpu_value = 0xff;
42
 
static BYTE parallel_cable_drive0_value = 0xff;
43
 
static BYTE parallel_cable_drive1_value = 0xff;
44
 
 
45
 
 
46
 
void parallel_cable_drive0_write(BYTE data, int handshake)
 
42
static BYTE parallel_cable_drive_value[DRIVE_NUM] = { 0xff, 0xff, 0xff, 0xff };
 
43
 
 
44
 
 
45
static BYTE parallel_cable_value(void)
47
46
{
48
 
    if (handshake)
49
 
        ciacore_set_flag(machine_context.cia2);
50
 
    parallel_cable_drive0_value = data;
 
47
    unsigned int dnr;
 
48
    BYTE val;
 
49
 
 
50
    val = parallel_cable_cpu_value;
 
51
 
 
52
    for (dnr = 0; dnr < DRIVE_NUM; dnr++) {
 
53
        if (drive_context[dnr]->drive->enable
 
54
            && drive_context[dnr]->drive->parallel_cable_enabled)
 
55
            val &= parallel_cable_drive_value[dnr];
 
56
    }
 
57
 
 
58
    return val;
51
59
}
52
60
 
53
 
void parallel_cable_drive1_write(BYTE data, int handshake)
 
61
void parallel_cable_drive_write(BYTE data, int handshake, unsigned int dnr)
54
62
{
55
63
    if (handshake)
56
64
        ciacore_set_flag(machine_context.cia2);
57
 
    parallel_cable_drive1_value = data;
 
65
 
 
66
    parallel_cable_drive_value[dnr] = data;
58
67
}
59
68
 
60
69
BYTE parallel_cable_drive_read(int handshake)
61
70
{
62
71
    if (handshake)
63
72
        ciacore_set_flag(machine_context.cia2);
64
 
    return parallel_cable_cpu_value & parallel_cable_drive0_value
65
 
        & parallel_cable_drive1_value;
 
73
 
 
74
    return parallel_cable_value();
66
75
}
67
76
 
68
77
void parallel_cable_cpu_execute(void)
78
87
 
79
88
void parallel_cable_cpu_write(BYTE data)
80
89
{
81
 
    if (!(drive_context[0]->drive->enable)
82
 
        && !(drive_context[1]->drive->enable))
83
 
        return;
84
 
 
85
90
    parallel_cable_cpu_execute();
86
91
 
87
92
    parallel_cable_cpu_value = data;
89
94
 
90
95
BYTE parallel_cable_cpu_read(void)
91
96
{
92
 
    if (!(drive_context[0]->drive->enable)
93
 
        && !(drive_context[1]->drive->enable))
94
 
        return 0xff;
95
 
 
96
97
    parallel_cable_cpu_execute();
97
98
 
98
 
    return parallel_cable_cpu_value & parallel_cable_drive0_value
99
 
        & parallel_cable_drive1_value;
 
99
    return parallel_cable_value();
100
100
}
101
101
 
102
102
void parallel_cable_cpu_pulse(void)
103
103
{
104
104
    unsigned int dnr;
105
105
 
106
 
    if (!(drive_context[0]->drive->enable)
107
 
        && !(drive_context[1]->drive->enable))
108
 
        return;
109
 
 
110
106
    parallel_cable_cpu_execute();
111
107
 
112
108
    for (dnr = 0; dnr < DRIVE_NUM; dnr++) {