Device config fix, phase 1.

This commit is contained in:
OBattler
2022-04-04 18:11:39 +02:00
parent 3fe794c59b
commit 3cec306ecf
3 changed files with 25 additions and 1 deletions

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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);
}