Jump to content
IGNORED

The Cheater Clock


Recommended Posts

I made my own clock on for the Atari and provide the executable and the Assembly listing. I name it the cheater clock because all it does is look at the rtclock adress 20 ($14) and advance the Counter one second up til 99 minutes and 59 Seconds. It adjust timing for PAL and NTSC machines. It seem to be fairly accurate , but not exactly real time clock..

 

Cheaterclock.XEX

 

The Listing in Assembler:

 

; Cheater clock

*=12288 ; set adress for program

SDMCTL = 559 ; Can turn on and off Antic (needed when creating display list)
SDLSTL = 560 ; Shadow display list pointer low - Antic må vite hvor den nye display listen er
SDLSTH = 561 ; Shadow display list pointer high 


     
 ; Here is some equates

SECONDS = 1600
TENSEC =   1601
MINUTES = 1602
TENMIN  = 1603 


     
     
     LDX #1 
     STX TENMIN ; set 1 here or the ten minute number get out of sync

     LDA #0
     
     
     STA SDMCTL ;TURN ANTIC OFF
     LDA #0 ; LOW BYTE
     STA SDLSTL ; store low byte of display list adress
     LDA #144 ; HIGHBYTE
     STA SDLSTH ;store high byte of display list adress
     LDA #34
     STA SDMCTL ; ... Turn on Antic again

    

    ; set some colors
     
     LDX #12
     STX 710
     LDX #24
     STX 708
     LDX #34
      STX 709
     LDX #58
     STX 711
     LDX #60
     STX 712
     
     ;put the clock on screen before it starts
     
     LDX #16
     STX 40220
     STX 40219
     STX 40217
     STX 40216
     LDX #26     
     STX 40218
    
START
     LDX 53268 ; check for pal atari
     CPX #1
     BEQ PAL
     LDX 20
     CPX #60  ;check rtclock to advance time 1 second ntsc
     BCC START
     JMP NTSC
PAL     
     LDX 20
     CPX #50  ; check rtclok to advance time 1 second pal
     BCC START
NTSC
     
     LDX #0
     STX 20          ;reset rtclock when wanted number is reached
     LDX TENSEC ;check if tenseconds is = 5 to advance minute counter
     CPX #5
     BEQ CHTENSEC     
CONT
     
     LDX SECONDS
     CPX #10
     BEQ TENSEC2
     LDA SECONDS
     CLC
     ADC #16
     STA 40220
     INC SECONDS
     JMP START

TENSEC2
     LDA TENSEC
     ADC #16
     STA 40219
     INC TENSEC
     LDX #1
     STX SECONDS
     LDX #16
     STX 40220
     
     JMP START

CHTENSEC
     LDX SECONDS ; check if seconds = 9 to advance minute counter
     CPX #10
     BEQ SETZ     
     JMP CONT

     
MINUTE2
     LDA MINUTES
     ADC #16
     STA 40217
     INC MINUTES
     LDX #0
     STX TENSEC
     JMP CONT


SETZ
     LDX MINUTES
     CPX #9
     BEQ MINUTEC
CONTR
     LDX #1 ;reset seconds counter
     STX SECONDS
     LDX #0 ; SLOPPY CODE ADJUSTMENT
     STX TENSEC
     LDX #16
     STX 40220 ; put zeroes on screen
     STX 40219
     INC MINUTES
     CLC
     LDA MINUTES
     ADC #16
     STA 40217 ; put minutes on screen
     
     JMP START
MINUTEC
     LDX #16
     STX 40217
     INC TENMIN
     CLC
     LDA TENMIN
     ADC #15
     STA 40216 ; put tenminutes on screen
     LDX #0
     STX MINUTES
     DEC MINUTES ; decrease one for sloppy coding
     JMP CONTR

; The Display list for GR.0
*=36864
Mylist

.Byte 112,112,112 ; three blank lines
.byte 66,64,156 ; first is lms command two other is for screen adress (Adress off display list) high byte,lowbyte  = low byte,highbyte = 39936
.byte 2,2,2,2,2,2,2,2,2,2,2,2
.byte 2,2,2,2,2,2,2,2,2,2,2 ; 23 times antic mode 2 lines = Basic mode 0
.byte 65,144,0 ; first is jump on vertical blank instructions,2 other is the adress low byte first. the adress for the display list itself

 

 

Edited by Grevle
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...