]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
PCem PCI byte wide config reads and FM801 slot counting fixed.
authorToni Wilen <twilen@winuae.net>
Sat, 9 Jan 2021 15:01:14 +0000 (17:01 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 9 Jan 2021 15:01:14 +0000 (17:01 +0200)
include/pci_hw.h
pci.cpp

index 01f55b298cdab5f3510b0254f0edc9399174400f..0523199f1f4cd1b159b45d44bab254e67a3146e1 100644 (file)
@@ -116,7 +116,8 @@ struct pci_bridge
        uae_u8 acmemory_2[128];
        struct romconfig *rc;
        uae_u16 window;
-       int slot_cnt;
+       int log_slot_cnt;
+       int phys_slot_cnt;
 };
 
 extern void pci_irq_callback(struct pci_board_state *pcibs, bool irq);
diff --git a/pci.cpp b/pci.cpp
index 86e5f4f53b7757e91c547a0bf7f41c7a40ffe273..e8175e43804797d258cf0d8cde2ebf7f5e198313 100644 (file)
--- a/pci.cpp
+++ b/pci.cpp
@@ -118,10 +118,12 @@ static struct pci_board *pci_board_alloc(struct pci_config *config)
 
 struct pci_board_state *pci_board_add(struct pci_bridge *pcib, const struct pci_board *pci, int slot, int func, struct autoconfig_info *aci, void *userdata)
 {
-       struct pci_board_state *pcibs = &pcib->boards[pcib->slot_cnt];
-       pcib->slot_cnt++;
+       struct pci_board_state *pcibs = &pcib->boards[pcib->log_slot_cnt];
+       pcib->log_slot_cnt++;
+       if (!func)
+               pcib->phys_slot_cnt++;
        pcibs->board = pci;
-       pcibs->slot = slot < 0 ? pcib->slot_cnt : slot;
+       pcibs->slot = slot < 0 ? pcib->phys_slot_cnt : slot;
        pcibs->func = func;
        pcibs->bridge = pcib;
        pcibs->irq_callback = pci_irq_callback;
@@ -451,6 +453,9 @@ static uae_u8 *get_pci_config(uaecptr addr, int size, uae_u32 v, int *endianswap
                                c[off + 0] = pcibs->board->pci_get_config((off ^ 2) + 1);
                        }
                        *endianswap = 0;
+               } else {
+                       c[off] = pcibs->board->pci_get_config(off ^ 3);
+                       *endianswap = 0;
                }
        } else {
                create_config_data(pcibs);