[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 17/30] q800: add easc bool machine class property to switch betwe
|
From: |
Mark Cave-Ayland |
|
Subject: |
[PATCH 17/30] q800: add easc bool machine class property to switch between ASC and EASC |
|
Date: |
Wed, 24 May 2023 22:10:51 +0100 |
This determines whether the Apple Sound Chip (ASC) is set to enhanced mode
(default) or to original mode. The real Q800 hardware used an EASC chip however
a lot of older software only works with the older ASC chip.
Adding this as a machine parameter allows QEMU to be used as an developer aid
for testing and migrating code from ASC to EASC.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/m68k/q800.c | 30 +++++++++++++++++++++++++++++-
include/hw/m68k/q800.h | 1 +
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index ed862f9e9d..1af1a06f64 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -710,7 +710,8 @@ static void q800_machine_init(MachineState *machine)
/* Apple Sound Chip */
dev = qdev_new(TYPE_ASC);
- qdev_prop_set_uint8(dev, "asctype", ASC_TYPE_EASC);
+ qdev_prop_set_uint8(dev, "asctype", m->easc ? ASC_TYPE_EASC
+ : ASC_TYPE_ASC);
sysbus = SYS_BUS_DEVICE(dev);
sysbus_realize_and_unref(sysbus, &error_fatal);
memory_region_add_subregion(&m->macio, ASC_BASE - IO_BASE,
@@ -886,6 +887,28 @@ static void q800_machine_init(MachineState *machine)
}
}
+static bool q800_get_easc(Object *obj, Error **errp)
+{
+ Q800MachineState *ms = Q800_MACHINE(obj);
+
+ return ms->easc;
+}
+
+static void q800_set_easc(Object *obj, bool value, Error **errp)
+{
+ Q800MachineState *ms = Q800_MACHINE(obj);
+
+ ms->easc = value;
+}
+
+static void q800_init(Object *obj)
+{
+ Q800MachineState *ms = Q800_MACHINE(obj);
+
+ /* Default to EASC */
+ ms->easc = true;
+}
+
static GlobalProperty hw_compat_q800[] = {
{ "scsi-hd", "quirk_mode_page_vendor_specific_apple", "on" },
{ "scsi-hd", "vendor", " SEAGATE" },
@@ -912,11 +935,16 @@ static void q800_machine_class_init(ObjectClass *oc, void
*data)
mc->block_default_type = IF_SCSI;
mc->default_ram_id = "m68k_mac.ram";
compat_props_add(mc->compat_props, hw_compat_q800, hw_compat_q800_len);
+
+ object_class_property_add_bool(oc, "easc", q800_get_easc, q800_set_easc);
+ object_class_property_set_description(oc, "easc",
+ "Set to off to use ASC rather than EASC");
}
static const TypeInfo q800_machine_typeinfo = {
.name = MACHINE_TYPE_NAME("q800"),
.parent = TYPE_MACHINE,
+ .instance_init = q800_init,
.instance_size = sizeof(Q800MachineState),
.class_init = q800_machine_class_init,
};
diff --git a/include/hw/m68k/q800.h b/include/hw/m68k/q800.h
index 0602d07d3d..0144be5e6e 100644
--- a/include/hw/m68k/q800.h
+++ b/include/hw/m68k/q800.h
@@ -30,6 +30,7 @@
struct Q800MachineState {
MachineState parent_obj;
+ bool easc;
M68kCPU *cpu;
MemoryRegion rom;
DeviceState *glue;
--
2.30.2
- [PATCH 12/30] q800: add IOSB subsystem, (continued)
- [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, 2023/05/24
- [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 <=
- [PATCH 19/30] swim: split into separate IWM and ISM register blocks, Mark Cave-Ayland, 2023/05/24
- [PATCH 18/30] swim: add trace events for IWM and ISM registers, Mark Cave-Ayland, 2023/05/24
- [PATCH 22/30] mac_via: fix rtc command decoding from PRAM addresses 0x0 to 0xf, Mark Cave-Ayland, 2023/05/24
- [PATCH 21/30] mac_via: work around underflow in TimeDBRA timing loop in SETUPTIMEK, Mark Cave-Ayland, 2023/05/24
- [PATCH 23/30] mac_via: fix rtc command decoding for the PRAM seconds registers, Mark Cave-Ayland, 2023/05/24