aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-13 18:16:59 +0000
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-13 18:16:59 +0000
commit4143f3e09cf780fdd2f1461f19a4e63987a09660 (patch)
treeba5c7e8f861c4945adda661c15a5aec339eb711f /hw
parentcc53d26d4dd464bcd22c23892b3f6c6f0b3780a9 (diff)
Fix vm state save/load
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4742 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/cs4231a.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/cs4231a.c b/hw/cs4231a.c
index 898c37e9ea..a18a1424e8 100644
--- a/hw/cs4231a.c
+++ b/hw/cs4231a.c
@@ -601,17 +601,23 @@ static void cs_save(QEMUFile *f, void *opaque)
{
CSState *s = opaque;
unsigned int i;
+ uint32_t val;
for (i = 0; i < CS_REGS; i++)
qemu_put_be32s(f, &s->regs[i]);
qemu_put_buffer(f, s->dregs, CS_DREGS);
+ val = s->dma_running; qemu_put_be32s(f, &val);
+ val = s->audio_free; qemu_put_be32s(f, &val);
+ val = s->transferred; qemu_put_be32s(f, &val);
+ val = s->aci_counter; qemu_put_be32s(f, &val);
}
static int cs_load(QEMUFile *f, void *opaque, int version_id)
{
CSState *s = opaque;
unsigned int i;
+ uint32_t val, dma_running;
if (version_id > 1)
return -EINVAL;
@@ -620,6 +626,13 @@ static int cs_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be32s(f, &s->regs[i]);
qemu_get_buffer(f, s->dregs, CS_DREGS);
+
+ qemu_get_be32s(f, &dma_running);
+ qemu_get_be32s(f, &val); s->audio_free = val;
+ qemu_get_be32s(f, &val); s->transferred = val;
+ qemu_get_be32s(f, &val); s->aci_counter = val;
+ if (dma_running && (s->dregs[Interface_Configuration] & PEN))
+ cs_reset_voices (s, s->dregs[FS_And_Playback_Data_Format]);
return 0;
}