Datetime syscall fixed and compat macro introduced
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
|00 @Control [ &framevec $2 &io $2 &random $1 &status $1 &sound $1 &syscall $1 ]
|
|00 @Control [ &framevec $2 &io $2 &random $1 &status $1 &sound $1 &syscall $1 ]
|
||||||
|
|
||||||
|
|c0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &dst $1 ]
|
||||||
|
|
||||||
( control block macros )
|
( control block macros )
|
||||||
|
|
||||||
%SETSCRVEC { .Control/framevec DEO2 }
|
%SETSCRVEC { .Control/framevec DEO2 }
|
||||||
@@ -24,6 +26,10 @@
|
|||||||
%DBGBYTE { DUP DBG }
|
%DBGBYTE { DUP DBG }
|
||||||
( val* -- val* )
|
( val* -- val* )
|
||||||
%DBGSHORT { DUP2 SWP DBG DBG }
|
%DBGSHORT { DUP2 SWP DBG DBG }
|
||||||
|
( addr* -- addr* )
|
||||||
|
%DATETIME { DUP2 #46 SYS SWP SYS SYS }
|
||||||
|
( load date and time into #00c0 similarly to Varvara or SPARTA specs )
|
||||||
|
%DATETIME-COMPAT { #c000 #46 SYS SYS SYS }
|
||||||
|
|
||||||
( input helper macros )
|
( input helper macros )
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,26 @@
|
|||||||
INC2 ,&loop JMP
|
INC2 ,&loop JMP
|
||||||
&eof POP2 JMP2r
|
&eof POP2 JMP2r
|
||||||
|
|
||||||
|
( convert true hex short value to BCD - up to 9999 represented by #270f coded into #9999 )
|
||||||
|
|
||||||
|
( convert BCD to hex value )
|
||||||
|
|
||||||
|
( output decimal short )
|
||||||
|
@print-dec ( x y value* -- x y )
|
||||||
|
STH2 ( value* -- )
|
||||||
|
#00 ,&zero STR
|
||||||
|
#2710 ,&parse JSR
|
||||||
|
#03e8 ,&parse JSR
|
||||||
|
#0064 ,&parse JSR
|
||||||
|
#000a ,&parse JSR
|
||||||
|
,&emit JSR POP
|
||||||
|
STH2r
|
||||||
|
JMP2r
|
||||||
|
&parse DIV2k DUP ,&emit JSR MUL2 SUB2 JMP2r
|
||||||
|
&emit
|
||||||
|
DUP [ LIT &zero $1 ] #0000 EQU2 ,&skip JCN
|
||||||
|
#01 ,&zero STR DUP #30 ADD STH2r ROT ;putc STH2 JSR2 &skip POP JMP2r
|
||||||
|
|
||||||
( nanofont glyphs for ESOP, courtesy of Michaelangel007 )
|
( nanofont glyphs for ESOP, courtesy of Michaelangel007 )
|
||||||
|
|
||||||
@nanofont
|
@nanofont
|
||||||
|
|||||||
+9
-6
@@ -4,22 +4,25 @@
|
|||||||
|
|
||||||
|0100
|
|0100
|
||||||
;on-frame SETSCRVEC
|
;on-frame SETSCRVEC
|
||||||
#10 #12
|
#1a #20 ( mv-x mv-y )
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-frame
|
@on-frame
|
||||||
|
DATETIME-COMPAT ( get datetime info into #00c0 )
|
||||||
|
#10 #12 ( year-x year-y -- )
|
||||||
|
.DateTime/year LDZ2 ( year-x year-y year* -- )
|
||||||
|
;print-dec JSR2 ( mv-x mv-y year-x year-y -- )
|
||||||
|
POP2 ( mv-x mv-y -- )
|
||||||
;moveme ;draw-str JSR2
|
;moveme ;draw-str JSR2
|
||||||
NIP #10 SWP ( reset x coordinate )
|
SWP #20 SUB SWP ( restore x coord between frames )
|
||||||
;&adv KP-A JMPKEY
|
;&adv KP-A JMPKEY
|
||||||
;&back KP-B JMPKEY
|
;&back KP-B JMPKEY
|
||||||
BRK
|
BRK
|
||||||
&adv
|
&adv
|
||||||
#fa DBG
|
SWP INC DBGBYTE SWP
|
||||||
DEC
|
|
||||||
BRK
|
BRK
|
||||||
&back
|
&back
|
||||||
#fb DBG
|
SWP DEC DBGBYTE SWP
|
||||||
INC
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@moveme "MOVE 20 "ME! 00
|
@moveme "MOVE 20 "ME! 00
|
||||||
|
|||||||
+2
-2
@@ -183,7 +183,7 @@ function ESOPExtensions() {
|
|||||||
return (Date.UTC(y, m, d) - Date.UTC(y, 0, 0)) / 86400000
|
return (Date.UTC(y, m, d) - Date.UTC(y, 0, 0)) / 86400000
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillDTbuf(addr) {
|
function fillDTbuf(vm, addr) {
|
||||||
var now = new Date(),
|
var now = new Date(),
|
||||||
year = now.getFullYear(),
|
year = now.getFullYear(),
|
||||||
month = now.getMonth() + 1,
|
month = now.getMonth() + 1,
|
||||||
@@ -213,7 +213,7 @@ function ESOPExtensions() {
|
|||||||
if(call === 0x00) //simulate writing a byte to the debug port
|
if(call === 0x00) //simulate writing a byte to the debug port
|
||||||
console.log('[DBG] ' + ('00' + buf[1].toString(16)).slice(-2))
|
console.log('[DBG] ' + ('00' + buf[1].toString(16)).slice(-2))
|
||||||
else if(call === 0x06) { //read datetime info into 10 bytes starting from addr
|
else if(call === 0x06) { //read datetime info into 10 bytes starting from addr
|
||||||
fillDTbuf((buf[1]<<8)|buf[2])
|
fillDTbuf(vm, (buf[1]<<8)|buf[2])
|
||||||
}
|
}
|
||||||
else if(call === 0x1f) //halt call, required for all implementations
|
else if(call === 0x1f) //halt call, required for all implementations
|
||||||
vm.active = false
|
vm.active = false
|
||||||
|
|||||||
Reference in New Issue
Block a user