From: Toni Wilen Date: Sat, 9 Jan 2021 15:01:14 +0000 (+0200) Subject: PCem PCI byte wide config reads and FM801 slot counting fixed. X-Git-Tag: 4900~213 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6dd0d6e975171a3b688114313828e8659c8086da;p=francis%2Fwinuae.git PCem PCI byte wide config reads and FM801 slot counting fixed. --- diff --git a/include/pci_hw.h b/include/pci_hw.h index 01f55b29..0523199f 100644 --- a/include/pci_hw.h +++ b/include/pci_hw.h @@ -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 86e5f4f5..e8175e43 100644 --- 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);