hw/m68k/next-cube: Avoid static RTC variables and introduce control register
commitcd4fc142074f47fdcc850676a13d29bb3facc100
authorThomas Huth <huth@tuxfamily.org>
Sat, 21 Sep 2019 09:17:38 +0000 (21 11:17 +0200)
committerThomas Huth <thuth@redhat.com>
Tue, 1 Oct 2019 09:42:27 +0000 (1 11:42 +0200)
tree084c41dba9682b5245106f1a219a2e375f84d3db
parent343143a6651bb440a1661fbaf163ef6d9b05721a
hw/m68k/next-cube: Avoid static RTC variables and introduce control register

Coverity currently complains that the "if (0x00 & (0x80 >> (phase - 8))"
in next-cube.c can never be true. Right it is. The "0x00" is meant as value
of the control register of the RTC, which is currently not implemented yet.
Thus, let's add a register variable for this now. However, the RTC
registers are currently defined as static variables in nextscr2_write(),
which is quite ugly. Thus let's also move the RTC variables to the main
machine state instead. In the long run, we should likely even refactor
the whole RTC code into a separate device in a separate file, but that's
something for calm winter nights later... as a first step, cleaning up
the static variables and shutting up the warning from Coverity should
be sufficient.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190921091738.26953-1-huth@tuxfamily.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
hw/m68k/next-cube.c