diff --git a/projects/examples/blank.usm b/projects/examples/blank.usm index 9278524..8e1ba44 100644 --- a/projects/examples/blank.usm +++ b/projects/examples/blank.usm @@ -12,6 +12,7 @@ |0150 ;Mouse { x 2 y 2 state 1 chord 1 } |0160 ;File { pad 8 name 2 length 2 load 2 save 2 } |0180 ;Audio { wave 2 envelope 2 pad 4 volume 1 pitch 1 play 1 value 2 delay 2 finish 1 } +|01a0 ;DateTime { year 2 month 1 day 1 hour 1 minute 1 second 1 dotw 1 doty 2 isdst 1 refresh 1 } |01F0 ;System { pad 8 r 2 g 2 b 2 } ( vectors ) diff --git a/projects/examples/dev.time.usm b/projects/examples/dev.time.usm index 921afcf..cc6ecfc 100644 --- a/projects/examples/dev.time.usm +++ b/projects/examples/dev.time.usm @@ -17,7 +17,7 @@ |0100 ;System { vector 2 pad 6 r 2 g 2 b 2 } |0120 ;Screen { vector 2 width 2 height 2 pad 2 x 2 y 2 color 1 } |0130 ;Sprite { vector 2 pad 6 x 2 y 2 addr 2 color 1 } -|01a0 ;Time { year 2 month 1 day 1 hour 1 minute 1 second 1 dow 1 doy 2 isdst 1 get 1 } +|01a0 ;DateTime { year 2 month 1 day 1 hour 1 minute 1 second 1 dotw 1 doty 2 isdst 1 refresh 1 } ( program ) @@ -30,11 +30,11 @@ BRK @FRAME - #00 =Time.get + #00 =DateTime.refresh ( only draw once per second ) - ~Time.second ~current.second NEQ #01 JNZ BRK - ~Time.second =current.second + ~DateTime.second ~current.second NEQ #01 JNZ BRK + ~DateTime.second =current.second ( clear ) #0080 SCALEX #0080 SCALEY ~needles.sx ~needles.sy #00 ,draw-line JSR2 @@ -42,13 +42,13 @@ BRK #0080 SCALEX #0080 SCALEY ~needles.hx ~needles.hy #00 ,draw-line JSR2 ( place ) - #00 ~Time.second #0002 MUL2 ,table ADD2 LDR2 + #00 ~DateTime.second #0002 MUL2 ,table ADD2 LDR2 #00 SWP SCALEY =needles.sy #00 SWP SCALEX =needles.sx - #00 ~Time.minute #0002 MUL2 ,table ADD2 LDR2 + #00 ~DateTime.minute #0002 MUL2 ,table ADD2 LDR2 #00 SWP #0004 DIV2 #0003 MUL2 #0020 ADD2 SCALEY =needles.my #00 SWP #0004 DIV2 #0003 MUL2 #0020 ADD2 SCALEX =needles.mx - #00 ~Time.hour 12HOURS #05 MUL #0002 MUL2 ,table ADD2 LDR2 + #00 ~DateTime.hour 12HOURS #05 MUL #0002 MUL2 ,table ADD2 LDR2 #00 SWP #0002 DIV2 #0040 ADD2 SCALEY =needles.hy #00 SWP #0002 DIV2 #0040 ADD2 SCALEX =needles.hx @@ -72,22 +72,22 @@ BRK ~Screen.height #0002 DIV2 #0048 ADD2 =Sprite.y ~Screen.width #0002 DIV2 DUP2 #0020 SUB2 =Sprite.x - ,font_hex #00 ~Time.hour #0a DIV #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~DateTime.hour #0a DIV #08 MUL ADD2 =Sprite.addr #02 =Sprite.color DUP2 #0018 SUB2 =Sprite.x - ,font_hex #00 ~Time.hour #0a MOD #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~DateTime.hour #0a MOD #08 MUL ADD2 =Sprite.addr #02 =Sprite.color DUP2 #0008 SUB2 =Sprite.x - ,font_hex #00 ~Time.minute #0a DIV #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~DateTime.minute #0a DIV #08 MUL ADD2 =Sprite.addr #02 =Sprite.color DUP2 =Sprite.x - ,font_hex #00 ~Time.minute #0a MOD #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~DateTime.minute #0a MOD #08 MUL ADD2 =Sprite.addr #02 =Sprite.color DUP2 #0010 ADD2 =Sprite.x - ,font_hex #00 ~Time.second #0a DIV #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~DateTime.second #0a DIV #08 MUL ADD2 =Sprite.addr #02 =Sprite.color DUP2 #0018 ADD2 =Sprite.x - ,font_hex #00 ~Time.second #0a MOD #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~DateTime.second #0a MOD #08 MUL ADD2 =Sprite.addr #02 =Sprite.color POP2 diff --git a/projects/software/neralie.usm b/projects/software/neralie.usm index 46fb23b..10c6409 100644 --- a/projects/software/neralie.usm +++ b/projects/software/neralie.usm @@ -15,7 +15,7 @@ |0110 ;Console { pad 8 char 1 byte 1 short 2 } |0120 ;Screen { vector 2 width 2 height 2 pad 2 x 2 y 2 color 1 } |0130 ;Sprite { pad 8 x 2 y 2 addr 2 color 1 } -|01a0 ;DateTime { year 2 month 1 day 1 hour 1 minute 1 second 1 dow 1 doy 2 isdst 1 pad 4 get 1 } +|01a0 ;DateTime { year 2 month 1 day 1 hour 1 minute 1 second 1 dotw 1 doty 2 isdst 1 pad 4 refresh 1 } ( program ) @@ -81,7 +81,7 @@ ~DateTime.year #07d6 SUB2 #000a ,modf JSR2 ,digit JSR2 ,digit JSR2 - ~DateTime.doy + ~DateTime.doty #000e ,modf JSR2 ^letter JSR #000a ,modf JSR2 ^digit JSR ^digit JSR @@ -185,7 +185,7 @@ ^$loop JMP @update-fps ( -- ) - #00 =DateTime.get + #00 =DateTime.refresh ~fps.next #01 ADD =fps.next ~DateTime.second ~fps.second NEQ JMP JMP2r ~DateTime.second =fps.second