[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/30] q800: implement additional machine id bits on VIA1 port A
|
From: |
Mark Cave-Ayland |
|
Subject: |
[PATCH 11/30] q800: implement additional machine id bits on VIA1 port A |
|
Date: |
Wed, 24 May 2023 22:10:45 +0100 |
Co-developed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/misc/mac_via.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index 076d18e5fd..f90a22a067 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -114,6 +114,9 @@
#define VIA1A_CPUID1 0x04 /* CPU id bit 0 on RBV, others */
#define VIA1A_CPUID2 0x10 /* CPU id bit 0 on RBV, others */
#define VIA1A_CPUID3 0x40 /* CPU id bit 0 on RBV, others */
+#define VIA1A_CPUID_MASK (VIA1A_CPUID0 | VIA1A_CPUID1 | \
+ VIA1A_CPUID2 | VIA1A_CPUID3)
+#define VIA1A_CPUID_Q800 (VIA1A_CPUID0 | VIA1A_CPUID2)
/*
* Info on VIA1B is from Macintosh Family Hardware & MkLinux.
@@ -871,9 +874,18 @@ static uint64_t mos6522_q800_via1_read(void *opaque,
hwaddr addr, unsigned size)
{
MOS6522Q800VIA1State *s = MOS6522_Q800_VIA1(opaque);
MOS6522State *ms = MOS6522(s);
+ uint64_t ret;
addr = (addr >> 9) & 0xf;
- return mos6522_read(ms, addr, size);
+ ret = mos6522_read(ms, addr, size);
+ switch (addr) {
+ case VIA_REG_A:
+ case VIA_REG_ANH:
+ /* Quadra 800 Id */
+ ret = (ret & ~VIA1A_CPUID_MASK) | VIA1A_CPUID_Q800;
+ break;
+ }
+ return ret;
}
static void mos6522_q800_via1_write(void *opaque, hwaddr addr, uint64_t val,
--
2.30.2
- [PATCH 07/30] q800: introduce mac-io container memory region, (continued)
- [PATCH 07/30] q800: introduce mac-io container memory region, Mark Cave-Ayland, 2023/05/24
- [PATCH 08/30] q800: reimplement mac-io region aliasing using IO memory region, Mark Cave-Ayland, 2023/05/24
- [PATCH 09/30] q800: add djMEMC memory controller, Mark Cave-Ayland, 2023/05/24
- [PATCH 10/30] q800: add machine id register, Mark Cave-Ayland, 2023/05/24
- [PATCH 12/30] q800: add IOSB subsystem, Mark Cave-Ayland, 2023/05/24
- [PATCH 11/30] q800: implement additional machine id bits on VIA1 port A,
Mark Cave-Ayland <=
- [PATCH 13/30] q800: allow accesses to RAM area even if less memory is available, Mark Cave-Ayland, 2023/05/24
- [PATCH 14/30] audio: add Apple Sound Chip (ASC) emulation, Mark Cave-Ayland, 2023/05/24
- [PATCH 15/30] asc: generate silence if FIFO empty but engine still running, Mark Cave-Ayland, 2023/05/24
- [PATCH 17/30] q800: add easc bool machine class property to switch between ASC and EASC, Mark Cave-Ayland, 2023/05/24