Device config fix, phase 1.
This commit is contained in:
23
src/device.c
23
src/device.c
@@ -339,6 +339,29 @@ device_available(const device_t *d)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
device_has_config(const device_t *d)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
if (d == NULL)
|
||||
return 0;
|
||||
|
||||
if (d->config == NULL)
|
||||
return 0;
|
||||
|
||||
config = d->config;
|
||||
|
||||
while (config->type != -1) {
|
||||
if (config->type != CONFIG_MAC)
|
||||
c++;
|
||||
config++;
|
||||
}
|
||||
|
||||
return (c > 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
device_poll(const device_t *d, int x, int y, int z, int b)
|
||||
{
|
||||
|
@@ -147,6 +147,7 @@ extern void device_register_pci_slot(const device_t *d, int device, int type, i
|
||||
extern void device_speed_changed(void);
|
||||
extern void device_force_redraw(void);
|
||||
extern void device_get_name(const device_t *d, int bus, char *name);
|
||||
extern int device_has_config(const device_t *d);
|
||||
|
||||
extern int device_is_valid(const device_t *, int m);
|
||||
|
||||
|
@@ -364,7 +364,7 @@ video_card_has_config(int card)
|
||||
{
|
||||
if (video_cards[card].device == NULL) return(0);
|
||||
|
||||
return(video_cards[card].device->config ? 1 : 0);
|
||||
return(device_has_config(video_cards[card].device) ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user