Skip to content

Commit 96d5c4d

Browse files
mcaylandhuth
authored andcommitted
next-cube: move reset of next-rtc fields from next-pc to next-rtc
Signed-off-by: Mark Cave-Ayland <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Message-ID: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 4910069 commit 96d5c4d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

hw/m68k/next-cube.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,16 @@ static const MemoryRegionOps next_dummy_en_ops = {
10181018
.endianness = DEVICE_BIG_ENDIAN,
10191019
};
10201020

1021+
static void next_rtc_reset_hold(Object *obj, ResetType type)
1022+
{
1023+
NeXTRTC *rtc = NEXT_RTC(obj);
1024+
1025+
rtc->status = 0x90;
1026+
1027+
/* Load RTC RAM - TODO: provide possibility to load contents from file */
1028+
memcpy(rtc->ram, rtc_ram2, 32);
1029+
}
1030+
10211031
static const VMStateDescription next_rtc_vmstate = {
10221032
.name = "next-rtc",
10231033
.version_id = 3,
@@ -1037,9 +1047,11 @@ static const VMStateDescription next_rtc_vmstate = {
10371047
static void next_rtc_class_init(ObjectClass *klass, void *data)
10381048
{
10391049
DeviceClass *dc = DEVICE_CLASS(klass);
1050+
ResettableClass *rc = RESETTABLE_CLASS(klass);
10401051

10411052
dc->desc = "NeXT RTC";
10421053
dc->vmsd = &next_rtc_vmstate;
1054+
rc->phases.hold = next_rtc_reset_hold;
10431055
}
10441056

10451057
static const TypeInfo next_rtc_info = {
@@ -1072,11 +1084,6 @@ static void next_pc_reset_hold(Object *obj, ResetType type)
10721084
s->scr1 = 0x00011102;
10731085
s->scr2 = 0x00ff0c80;
10741086
s->old_scr2 = s->scr2;
1075-
1076-
s->rtc.status = 0x90;
1077-
1078-
/* Load RTC RAM - TODO: provide possibility to load contents from file */
1079-
memcpy(s->rtc.ram, rtc_ram2, 32);
10801087
}
10811088

10821089
static void next_pc_realize(DeviceState *dev, Error **errp)

0 commit comments

Comments
 (0)