[hatari-devel] MSTE clock emulation

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

while looking at the code, i just noticed some quirks in the emulation of the MSTE clock (fffc20-fffc3f, in src/rtc.c).

First off, reading/writing to the minutes registers use some backup variables named fake_am/fake_amz when rtc_bank!=0. These are a bit mis-named, since the minutes registers have nothing to do with 12hr/24hr mode. The values accessed when rtc_bank==1 are the alarm settings.

Secondly, the mc146818 also has alarm registers for seconds & hours, although i'm not entirely sure wether they are implemented on real hardware. Existing TOS versions seem to only access the minutes.

Whats more serious though is that reading/writing to fffc35 affects the 12hr/24hr mode when rtc_bank!=0. This register is not handled at all, and should also affect what reading/writing the hour registers return. From what i've seen, bit0==1 in that address selects 24hr mode (initial value after reset), otherwise 12hr mode. At least EmuTOS and linux-68k would expect that address to return 1, otherwise they interpret the hour to be in 12hr format.

What i could not figure out is where the BCD/BIN bit could be read/written (the MSTE chip is the same as that in the TT, but the I/O mapping is rather different).

Another thing that i'm not entirely sure about is, that all values read from bank0 seem to have the high nibble set to 0xf on real hardware. This is done in some, but not all cases.

Greetings,
    Thorsten



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/