Menu

#1038 CIA TOD incorrect time (time too slow)

v3.1
closed-invalid
nobody
CIA (3) TOD (1)
Linux
x64
2018-08-27
2018-08-27
No

Hello, I have come across an annoying problem with the "TOD" functionality. The time is correct only if an NTSC VIC-II and an NTSC computer model are selected. In other settings, time is counted for too slowly. The deviation is roughly 20%.

VICE version: 3.1 (GTK+)
OS: Ubuntu 18.04
Code used for checking:

!cpu 6510

TODhours = $DC0B
TODminutes = $DC0A
TODseconds = $DC09
TODtenths = $DC08

*=$C000
lda $DC0F
and #%.#######
sta $DC0F
lda #0
sta TODhours
sta TODminutes
sta TODtenths ;just to get TOD going again

lda TODhours
and #%...#....
lsr
lsr
lsr
lsr
pha ;HOURS H
lda TODhours
and #%....####
pha ;HOURS L

lda TODminutes
and #%.###....
lsr
lsr
lsr
lsr
pha ;MINUTES H
lda TODminutes
and #%....####
pha ;MINUTES L

lda TODseconds
and #%.###....
lsr
lsr
lsr
lsr
pha ;SECONDS H
lda TODseconds
and #%....####

bit TODtenths   ; just to get time info going again within the CIA.

ora #$30
sta 1031
pla
ora #$30
sta 1030
lda #":"
sta 1029
pla
ora #$30
sta 1028
pla
ora #$30
sta 1027
lda #":"
sta 1026
pla
ora #$30
sta 1025
pla
ora #$30
sta 1024
bne .testTOD

Discussion

  • Eduard Amorós

    Eduard Amorós - 2018-08-27

    Please CANCEL this bug request. I use a custom ROM that was not detecting properly PAL/NTSC and it was putting the wrong value in $DC0E. Sorry for taking your time.

     
  • Strobe

    Strobe - 2018-08-27
    • status: open --> closed-invalid
     
  • Strobe

    Strobe - 2018-08-27

    "Please CANCEL this bug request. I use a custom ROM that was not detecting properly PAL/NTSC and it was putting the wrong value in $DC0E. Sorry for taking your time."

     
  • gpz

    gpz - 2018-08-27

    just to add: the KERNAL never touches $DC0E - your code has to set the pal/ntsc bit all by yourself :)

     

Log in to post a comment.

MongoDB Logo MongoDB