diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2023-10-04 09:37:50 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2023-10-06 10:33:43 +0200 |
commit | 0f03047c1b09fcccf16bcf1c2d8d9e375155adfd (patch) | |
tree | 05eaf8fbac8c44490ceaa455e9d953b116a1e971 /hw/misc | |
parent | e993af36a7bf2d1299f932098c9b19766626d7d8 (diff) | |
download | qemu-0f03047c1b09fcccf16bcf1c2d8d9e375155adfd.zip qemu-0f03047c1b09fcccf16bcf1c2d8d9e375155adfd.tar.gz qemu-0f03047c1b09fcccf16bcf1c2d8d9e375155adfd.tar.bz2 |
q800: implement additional machine id bits on VIA1 port A
Co-developed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231004083806.757242-5-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/misc')
-rw-r--r-- | hw/misc/mac_via.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index f84cc68..e87a1b8 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. @@ -872,9 +875,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, |