view level1/modules/clock2_harris.asm @ 2897:260116065a2f lwtools-port

arcadepak: Add empty_smash.txt and empty_thexder.txt dummy files This was done in default branch in commit 9b29d654db13 but did not get into the lwtools branch. We'll probably do this differently later, but for now I'll just pick this solution. At this point everything I have spotted of useful changes in the default branch has been pushed to the lwtools branch. I have cherry-picked changes both ways in order to make a merge easier, but a real merge will probably not be useful. I did try it out and waded through merge conflicts and diff'ed the result with current lwtools branch, so I am pretty sure nothing useful will be lost.
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 11 Jan 2014 18:20:09 +0100
parents f389c6bca482
children
line wrap: on
line source

********************************************************************
* Clock2 - Harris RTC Driver
*
* $Id$
*
* Edt/Rev  YYYY/MM/DD  Modified by
* Comment
* ------------------------------------------------------------------
*   1      2004/08/18  Boisy G. Pitre
* Separated clock2 modules for source clarity.

         nam   Clock2    
         ttl   Harris RTC Driver

         ifp1            
         use   defsfile  
         endc            

tylg     set   Sbrtn+Objct
atrv     set   ReEnt+rev
rev      set   $00
edition  set   1

RTC.Base equ   $FF60      Base address for clock

         mod   eom,name,tylg,atrv,JmpTable,RTC.Base

name     fcs   "Clock2"
         fcb   edition

         IFNE  MPIFlag   
SlotSlct fcb   MPI.Slot-1 Slot constant for MPI select code
         ENDC            

JmpTable                 
         rts
         nop             
         nop             
         bra   GetTime   
         nop             
         lbra  SetTime   


GetTime  pshs  cc        
         orcc  #IntMasks  Disable interrupts

         ldu   M$Mem,pcr  Get base address
         ldy   #D.Time    Pointer to time in system map

         lda   #%00001100 Init command register (Normal,Int. Disabled,
         sta   $11,u      Run,24-hour mode, 32kHz)

         lda   ,u         Read base address to set-up clock regs for read
         lda   6,u        Get year
         sta   ,y+       
         lda   4,u        Get month
         sta   ,y+       
         lda   5,u        Get day
         sta   ,y+       
         lda   1,u        Get hour
         sta   ,y+       
         lda   2,u        Get minute
         sta   ,y+       
         lda   3,u        Get second
         sta   ,y+       

         puls  cc,pc      Re-enable interrupts


SetTime  pshs  cc        
         orcc  #IntMasks  Disable interrupts

         ldu   M$Mem,pcr  Get base address
         ldy   #D.Time    Pointer to time in system map

         lda   #%00000100 Init command register (Normal,Int. Disabled,
         sta   $11,u      STOP clock,24-hour mode, 32kHz)

         lda   ,y+        Get year
         sta   6,u       
         lda   ,y+        Get month
         sta   4,u       
         lda   ,y+        Get day
         sta   5,u       
         lda   ,y+        Get hour
         sta   1,u       
         lda   ,y+        Get minute
         sta   2,u       
         lda   ,y         Get second
         sta   3,u       

         lda   #%00001100 Init command register (Normal,Int. Disabled,
         sta   $11,u      START clock,24-hour mode, 32kHz)

         puls  cc,pc      Re-enable interrupts


         emod            
eom      equ   *         
         end