~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/emu/devcb.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        else if (config->type >= DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM) && config->type < DEVCB_TYPE_MEMORY(ADDRESS_SPACES) && config->readspace != NULL)
53
53
        {
54
54
                FPTR space = (FPTR)config->type - (FPTR)DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM);
55
 
                const device_config *cpu = cputag_get_cpu(device->machine, config->tag);
 
55
                const device_config *cpu;
 
56
 
 
57
                if (device->owner != NULL)
 
58
                        cpu = device_find_child_by_tag(device->owner, config->tag);
 
59
                else
 
60
                        cpu = cputag_get_cpu(device->machine, config->tag);
56
61
 
57
62
                if (cpu == NULL)
58
63
                        fatalerror("devcb_resolve_read_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
67
72
        /* device handlers */
68
73
        else if ((config->type == DEVCB_TYPE_DEVICE || config->type == DEVCB_TYPE_SELF) && (config->readline != NULL || config->readdevice != NULL))
69
74
        {
70
 
                resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
 
75
                /* locate the device */
 
76
                if (config->type == DEVCB_TYPE_SELF)
 
77
                        resolved->target = device;
 
78
                else if (device->owner != NULL)
 
79
                        resolved->target = device_find_child_by_tag(device->owner, config->tag);
 
80
                else
 
81
                        resolved->target = devtag_get_device(device->machine, config->tag);
 
82
 
71
83
                if (resolved->target == NULL)
72
84
                        fatalerror("devcb_resolve_read_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
73
85
 
114
126
        if (config->type >= DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM) && config->type < DEVCB_TYPE_MEMORY(ADDRESS_SPACES) && config->writespace != NULL)
115
127
        {
116
128
                FPTR space = (FPTR)config->type - (FPTR)DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM);
117
 
                const device_config *cpu = cputag_get_cpu(device->machine, config->tag);
 
129
                const device_config *cpu;
 
130
 
 
131
                if (device->owner != NULL)
 
132
                        cpu = device_find_child_by_tag(device->owner, config->tag);
 
133
                else
 
134
                        cpu = cputag_get_cpu(device->machine, config->tag);
118
135
 
119
136
                if (cpu == NULL)
120
137
                        fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
130
147
        else if (config->type >= DEVCB_TYPE_CPU_LINE(0) && config->type < DEVCB_TYPE_CPU_LINE(MAX_INPUT_LINES))
131
148
        {
132
149
                FPTR line = (FPTR)config->type - (FPTR)DEVCB_TYPE_CPU_LINE(0);
133
 
                const device_config *cpu = cputag_get_cpu(device->machine, config->tag);
 
150
                const device_config *cpu;
 
151
 
 
152
                if (device->owner != NULL)
 
153
                        cpu = device_find_child_by_tag(device->owner, config->tag);
 
154
                else
 
155
                        cpu = cputag_get_cpu(device->machine, config->tag);
134
156
 
135
157
                if (cpu == NULL)
136
158
                        fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
143
165
        /* device handlers */
144
166
        else if ((config->type == DEVCB_TYPE_DEVICE || config->type == DEVCB_TYPE_SELF) && (config->writeline != NULL || config->writedevice != NULL))
145
167
        {
146
 
                resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
 
168
                /* locate the device */
 
169
                if (config->type == DEVCB_TYPE_SELF)
 
170
                        resolved->target = device;
 
171
                else if (device->owner != NULL)
 
172
                        resolved->target = device_find_child_by_tag(device->owner, config->tag);
 
173
                else
 
174
                        resolved->target = devtag_get_device(device->machine, config->tag);
 
175
 
147
176
                if (resolved->target == NULL)
148
177
                        fatalerror("devcb_resolve_write_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
149
178