Datetime syscall fixed and compat macro introduced

This commit is contained in:
Luxferre
2022-07-31 18:37:56 +03:00
parent f2bad1455f
commit cf6a6e4259
4 changed files with 37 additions and 8 deletions
+2 -2
View File
@@ -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