Authors
Publication
Pub Details
Date
Pages
This program is quite simply a clock, it might be useful in many ways. Example in a game where you need a timer, or just to know the time while programming.
This clock works under interrupt, so you can use it at all time, even while programming!
It’s very simple to use, RANDOMIZE USR 65296 will start it, but the easiest way is to RANDOMIZE USR 64770 that will allow you to input the time using the keyboard (H-HOURS, M-MINUTES, S-SECONDS and ENTER when right time) and the clock will then be displayed at the upper right hand corner. The clock may be stopped by RANDOMIZE USR 65303.
Here is a list of all that can be modified to suit your needs.
- RANDOMIZE USR…65296 starts clock
- 64770 inputs time & starts clock
- 65303 stops clock
USEFUL POKES…6
- 4887,201 NO DISPLAY
- 64887,33 DISPLAY ON
- 64894,x color of clock (ATTR)
- 64858,60 TS2068
- 64858,50 ZX Spectrum
USEFUL PEEKS…
These can be POKEd so you may be able to change the time without USR 64770 (input).
- 64972 Hours (0-23)
- 64971 Minutes (0-59)
- 64970 Seconds (0-59)
WEIRD POKES…
- 64888 Color address
- 64902 Print position address
These 2 POKES are used to position the clock on the screen, I didn’t use the ROM to print on screen because it is too slow, so the color and the character are printed separately. To re-position the clock use this small program as a guide:
10 LET X=10
15 LET Y=10 (x=line, y=column)
20 PRINT AT X,Y;
30 LET A=PEEK 23684+256*PEEK 23685
40 POKE 64902,A-256*INT (A/256)
50 POKE 64903,INT (A/256)
60 LET A=X*32+Y+22528
70 POKE 64888,A-256*INT (A/256)
80 POKE 64889,INT (A/256)
Note that when there is no display (POKE 64887,201) the PEEKS of hours, minutes and seconds still work.