Datetime syscall fixed and compat macro introduced
This commit is contained in:
+2
-2
@@ -183,7 +183,7 @@ function ESOPExtensions() {
|
||||
return (Date.UTC(y, m, d) - Date.UTC(y, 0, 0)) / 86400000
|
||||
}
|
||||
|
||||
function fillDTbuf(addr) {
|
||||
function fillDTbuf(vm, addr) {
|
||||
var now = new Date(),
|
||||
year = now.getFullYear(),
|
||||
month = now.getMonth() + 1,
|
||||
@@ -213,7 +213,7 @@ function ESOPExtensions() {
|
||||
if(call === 0x00) //simulate writing a byte to the debug port
|
||||
console.log('[DBG] ' + ('00' + buf[1].toString(16)).slice(-2))
|
||||
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
|
||||
vm.active = false
|
||||
|
||||
Reference in New Issue
Block a user