diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-06 22:36:34 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-06 22:36:34 +1000 |
| commit | 7a8d2bcd75d88a5429937bf551878c55e1dcf0fd (patch) | |
| tree | 81bc1f259fb8678513aa8b214df4ef72720bb585 /Chip/Bus.cs | |
| parent | 16f3cb74564cf7c19da6e13666c98aca36094716 (diff) | |
moved everything to seperate projects, and started compiler work + push and pop instructions added
Diffstat (limited to 'Chip/Bus.cs')
| -rw-r--r-- | Chip/Bus.cs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/Chip/Bus.cs b/Chip/Bus.cs deleted file mode 100644 index 3578ad6..0000000 --- a/Chip/Bus.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Q1Emu.Chip; - -using System.Collections.Generic; -using System.Linq; - -public class Bus : BusDevice -{ - public List<BusDevice> Devices; - - public Bus(u16 addressableStart, u16 addressableEnd) : base(addressableStart, addressableEnd) - { - this.Devices = []; - } - private BusDevice? GetDevice(u16 address) - { - BusDevice? device = this.Devices.FirstOrDefault(x => address >= x.AddressableStart && address < x.AddressableEnd); - return device; - } - - public override u8 Read(u16 address) - { - BusDevice? device = GetDevice(address); - if (device == null) - return 0; - - return device.Read(address); - } - - public override void Write(u16 address, u8 value) - { - BusDevice? device = GetDevice(address); - if (device == null) - return; - - device.Write(address, value); - } -}
\ No newline at end of file |
