summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc/internal
Commit message (Expand)AuthorAgeFilesLines
* Cleaned up boilerplate for more slot devices. Vas Crabb2026-03-231-6/+3
* acorn/bbc.cpp: Split drivers by motherboard into bbcb.cpp, bbcbp.cpp, bbcm.cp... Nigel Barnes2025-08-212-3/+3
* m6502: add g65sc02 subtypes hap2024-12-141-1/+1
* srcclean and cleanup Vas Crabb2024-11-241-3/+4
* emu/ioport.h: Made syntax for configuring callbacks more consistent. Vas Crabb2024-10-181-1/+1
* Added ATTR_COLD to common lifecycle methods for many files in src/devices. (#... holub2024-09-2718-71/+71
* Move format #includes out of header files AJR2023-10-122-3/+2
* mc146818: Split non-direct read and write handlers into more hardware-accurat... AJR2023-10-092-9/+6
* misc mcfg: remove pia6821 clock freq param, hap2023-09-201-2/+2
* emu/devcb.h: Eliminated the need to call resolve() on callbacks. (#11333) Vas Crabb2023-06-171-4/+0
* emu/device.h: Removed device (READ|WRITE)_LINE_MEMBER in favor of explicit fu... MooglyGuy2023-06-014-11/+11
* m68000: split the header to make future semi-indenpendant implementations sane Olivier Galibert2022-09-301-1/+1
* bus/bbc/internal/cumana68k: Add default MFM floppy formats. Nigel Barnes2022-05-201-0/+1
* removed some unnecessary 6821 readca1_handler/readca2_handler/readcb1_handler... smf-2022-05-181-2/+1
* bus/bbc/internal: Added the Memex-B20 board. Nigel Barnes2022-05-153-0/+161
* Revert initialisation of device members in headers. Vas Crabb2022-04-0311-20/+20
* init vars for coverity (bus/a-l) Robbbert2022-04-0211-20/+20
* bbc_integrab: Added earlier ROM release. Nigel Barnes2022-03-201-2/+4
* we32kram.cpp: Added version 1.06 of the RAM board ROM. Nigel Barnes2022-02-191-2/+4
* More #include future-proofing AJR2022-01-061-0/+1
* bbc_cumana68k: Initialise members. Nigel Barnes2021-05-092-31/+11
* floppies: Turn the format arrays into function calls. Create a default "mfm"... Olivier Galibert2021-03-022-4/+5
* bus/a1bus, bus/a2bus, bus/acorn, bus/bbc: Simplify handler signatures (nw) AJR2020-06-072-4/+4
* another bunch of READ* / WRITE* macros removal (nw) Ivan Vangelista2020-05-202-4/+4
* bus/bbc/internal/cumana68k: Improved interrupt handling, some software now bo... Nigel Barnes2020-03-214-56/+103
* input_buffer, output_latch, z80dma: Eliminate now-unnecessary bus_r and bus_w... AJR2020-03-181-2/+2
* bus/bbc/internal/we32kram: Added Shadow RAM 2.20 ROM as BIOS option (nw) Nigel Barnes2020-03-151-4/+6
* srcclean and indentation cleanup (nw) Vas Crabb2019-11-243-19/+19
* bbc_cumana68k: Remove trampolines and cleanup (nw) Nigel Barnes2019-11-163-180/+151
* bbc_cumana68k: Remove software list reference (nw) Nigel Barnes2019-11-071-1/+1
* bbc_raven20: Fix sha1 (nw) Nigel Barnes2019-11-071-2/+2
* Fix clang unused private field errors (nw) AJR2019-11-061-2/+0
* bbcb: Added many internal ROM/RAM expansion boards from Aries, ATPL, Computec... Nigel Barnes2019-11-0633-0/+4996
* bbc.cpp: Replaced ROM/RAM memory banks with handlers to allow access from int... Nigel Barnes2019-11-062-0/+281
">tag, owner, clock), m_read_callback(*this), m_write_callback(*this), m_father(*this, finder_base::DUMMY_TAG), m_siblings_count(0) { std::fill(std::begin(m_siblings), std::end(m_siblings), nullptr); std::fill(std::begin(m_siblings_busnum), std::end(m_siblings_busnum), 0); } /*************************************************************************** INLINE FUNCTIONS ***************************************************************************/ uint32_t pci_bus_legacy_device::read(offs_t offset, uint32_t mem_mask) { uint32_t result = 0xffffffff; int function, reg; offset %= 2; switch (offset) { case 0: result = m_address; break; case 1: if (m_devicenum != -1) { pci_bus_legacy_read_delegate &read = m_busnumaddr->m_read_callback[m_devicenum]; if (!read.isnull()) { function = (m_address >> 8) & 0x07; reg = (m_address >> 0) & 0xfc; result = read(function, reg, mem_mask); } } break; } LOG("read('%s'): offset=%d result=0x%08X\n", tag(), offset, result); return result; } pci_bus_legacy_device *pci_bus_legacy_device::pci_search_bustree(int busnum, int devicenum, pci_bus_legacy_device *pcibus) { int a; pci_bus_legacy_device *ret; if (pcibus->m_busnum == busnum) { return pcibus; } for (a = 0; a < pcibus->m_siblings_count; a++) { ret = pci_search_bustree(busnum, devicenum, pcibus->m_siblings[a]); if (ret != nullptr) return ret; } return nullptr; } void pci_bus_legacy_device::write(offs_t offset, uint32_t data, uint32_t mem_mask) { offset %= 2; LOG("write('%s'): offset=%d data=0x%08X\n", tag(), offset, data); switch (offset) { case 0: m_address = data; /* lookup current device */ if (m_address & 0x80000000) { int busnum = (m_address >> 16) & 0xff; int devicenum = (m_address >> 11) & 0x1f; m_busnumaddr = pci_search_bustree(busnum, devicenum, this); if (m_busnumaddr != nullptr) { m_busnumber = busnum; m_devicenum = devicenum; } else m_devicenum = -1; LOG(" bus:%d device:%d\n", busnum, devicenum); } break; case 1: if (m_devicenum != -1) { pci_bus_legacy_write_delegate &write = m_busnumaddr->m_write_callback[m_devicenum]; if (!write.isnull()) { int function = (m_address >> 8) & 0x07; int reg = (m_address >> 0) & 0xfc; write(function, reg, data, mem_mask); } LOG(" function:%d register:%d\n", (m_address >> 8) & 0x07, (m_address >> 0) & 0xfc); } break; } } uint64_t pci_bus_legacy_device::read_64be(offs_t offset, uint64_t mem_mask) { uint64_t result = 0; mem_mask = swapendian_int64(mem_mask); if (ACCESSING_BITS_0_31) result |= (uint64_t)read(offset * 2 + 0, mem_mask >> 0) << 0; if (ACCESSING_BITS_32_63) result |= (uint64_t)read(offset * 2 + 1, mem_mask >> 32) << 32; return swapendian_int64(result); } void pci_bus_legacy_device::write_64be(offs_t offset, uint64_t data, uint64_t mem_mask) { data = swapendian_int64(data); mem_mask = swapendian_int64(mem_mask); if (ACCESSING_BITS_0_31) write(offset * 2 + 0, data >> 0, mem_mask >> 0); if (ACCESSING_BITS_32_63) write(offset * 2 + 1, data >> 32, mem_mask >> 32); } void pci_bus_legacy_device::add_sibling(pci_bus_legacy_device *sibling, int busnum) { m_siblings[m_siblings_count] = sibling; m_siblings_busnum[m_siblings_count] = busnum; m_siblings_count++; } //------------------------------------------------- // device_post_load - handle updating after a // restore //------------------------------------------------- void pci_bus_legacy_device::device_post_load() { if (m_devicenum != -1) { m_busnumaddr = pci_search_bustree(m_busnumber, m_devicenum, this); } } //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void pci_bus_legacy_device::device_start() { /* store a pointer back to the device */ m_devicenum = -1; /* find all our device callbacks */ m_read_callback.resolve_all(); m_write_callback.resolve_all(); if (m_father.found()) m_father->add_sibling(this, m_busnum); /* register pci states */ save_item(NAME(m_address)); save_item(NAME(m_devicenum)); save_item(NAME(m_busnum)); } //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- void pci_bus_legacy_device::device_reset() { /* reset the drive state */ m_devicenum = -1; m_address = 0; }