mirror of
https://github.com/irmen/prog8.git
synced 2025-01-26 19:30:59 +00:00
fix example
This commit is contained in:
parent
4ffb194847
commit
c2205e473a
@ -1,6 +1,7 @@
|
||||
; CommanderX16 text clock example!
|
||||
; make sure to compile with the cx16 compiler target.
|
||||
|
||||
%import cx16textio
|
||||
%zeropage basicsafe
|
||||
|
||||
main {
|
||||
@ -9,7 +10,7 @@ main {
|
||||
|
||||
cx16.r0L = 2020 - 1900
|
||||
cx16.r0H = 8
|
||||
cx16.r1L = 26
|
||||
cx16.r1L = 27
|
||||
cx16.r1H = 19
|
||||
cx16.r2L = 16
|
||||
cx16.r2H = 0
|
||||
@ -22,7 +23,7 @@ main {
|
||||
|
||||
repeat {
|
||||
c64.CHROUT(19) ; HOME
|
||||
screen.print(" yyyy-mm-dd HH:MM:SS.jj\n\n")
|
||||
txt.print("\n yyyy-mm-dd HH:MM:SS.jj\n\n")
|
||||
cx16.clock_get_date_time()
|
||||
c64.CHROUT(' ')
|
||||
print_date()
|
||||
@ -32,33 +33,33 @@ main {
|
||||
}
|
||||
|
||||
sub print_date() {
|
||||
screen.print_uw(1900 + cx16.r0L)
|
||||
txt.print_uw(1900 + cx16.r0L)
|
||||
c64.CHROUT('-')
|
||||
if cx16.r0H < 10
|
||||
c64.CHROUT('0')
|
||||
screen.print_ub(cx16.r0H)
|
||||
txt.print_ub(cx16.r0H)
|
||||
c64.CHROUT('-')
|
||||
if cx16.r1L < 10
|
||||
c64.CHROUT('0')
|
||||
screen.print_ub(cx16.r1L)
|
||||
txt.print_ub(cx16.r1L)
|
||||
}
|
||||
|
||||
sub print_time() {
|
||||
if cx16.r1H < 10
|
||||
c64.CHROUT('0')
|
||||
screen.print_ub(cx16.r1H)
|
||||
txt.print_ub(cx16.r1H)
|
||||
c64.CHROUT(':')
|
||||
if cx16.r2L < 10
|
||||
c64.CHROUT('0')
|
||||
screen.print_ub(cx16.r2L)
|
||||
txt.print_ub(cx16.r2L)
|
||||
c64.CHROUT(':')
|
||||
if cx16.r2H < 10
|
||||
c64.CHROUT('0')
|
||||
screen.print_ub(cx16.r2H)
|
||||
txt.print_ub(cx16.r2H)
|
||||
c64.CHROUT('.')
|
||||
if cx16.r3L < 10
|
||||
c64.CHROUT('0')
|
||||
screen.print_ub(cx16.r3L)
|
||||
txt.print_ub(cx16.r3L)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user