mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
less CPU demanding InputStrobing
This commit is contained in:
@@ -964,8 +964,10 @@ input.withEvent = function(callback) {
|
||||
inputwork.stroboStatus = 0;
|
||||
inputwork.repeatCount = 0;
|
||||
|
||||
if (keys[0] == 0)
|
||||
if (keys[0] == 0) {
|
||||
inputwork.keyChanged = false;
|
||||
sys.sleep(25)
|
||||
}
|
||||
|
||||
if (keyChanged) {
|
||||
//callback(["key_change", keysToStr(arrayDiff(keys, inputwork.oldKeys)), inputwork.repeatCount].concat(keys));
|
||||
@@ -977,7 +979,7 @@ input.withEvent = function(callback) {
|
||||
}
|
||||
}
|
||||
else if (inputwork.stroboStatus % 2 == 1 && sys.nanoTime() - inputwork.stroboTime < inputwork.stroboDelays[inputwork.stroboStatus]) {
|
||||
sys.spin();
|
||||
sys.sleep(25);
|
||||
}
|
||||
else {
|
||||
inputwork.stroboStatus += 1;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
println("DEPRECATION NOTICE: MP3 Playback function will be removed for following reason")
|
||||
println("\tMP3 does not really fit in the time TSVM targets to emulate")
|
||||
return 1
|
||||
|
||||
|
||||
const Mp3 = require('mp3dec')
|
||||
const pcm = require("pcm")
|
||||
const interactive = exec_args[2] && exec_args[2].toLowerCase() == "/i"
|
||||
@@ -114,7 +119,6 @@ let readPtr = sys.malloc(8000)
|
||||
let decodePtr = sys.malloc(12000)
|
||||
|
||||
function bytesToSec(i) {
|
||||
// using fixed value: FRAME_SIZE(216) bytes for 36 ms on sampling rate 32000 Hz
|
||||
return i / (FRAME_SIZE * 1000 / bufRealTimeLen)
|
||||
}
|
||||
function secToReadable(n) {
|
||||
|
||||
@@ -557,13 +557,16 @@ Address & RW & Description \\
|
||||
-39 & RW & Text Input Stream control. Write nonzero value to open it. The Keyboard Input Buffer will be cleared whenever the Input Stream is opened. \\
|
||||
-40 & WO & Latch Keyboard and Mouse input \\
|
||||
-41..-48 & RO & List of pressed keys (latched by -40) \\
|
||||
-49 & RO & System Flags A (code{0b r000 000t}, where r: RESET button held, t: STOP button held) \\
|
||||
-49 & RO & System Flags A (\code{0b r000 000t}, where r: RESET button held, t: STOP button held) \\
|
||||
-50..-52 & RO & Unused System Flags \\
|
||||
-65..-68 & RO & Size of the Scratchpad Memory \\
|
||||
-69 & WO & Counter Latch (\code{0b01}--Uptime, \code{0b10}--RTC) \\
|
||||
-73..-80 & RO & System Uptime in nanoseconds (latched by -69) \\
|
||||
-81..-88 & RO & RTC in nanoseconds (latched by -69) \\
|
||||
-89 & RW & ROM Mapping \\
|
||||
-90 & RW & Power Management Flags (\code{0b P000 b0ca}), where P: CPU halted, b: the device is battery-operated, c: a battery is detected, a: the battery is charging \\
|
||||
-91 & RO & BMS Battery Percentage \\
|
||||
-92 & RO & BMS Battery Voltage multiplied by 10 \\
|
||||
-1025..-2048 & RW & Reserved for the integrated peripherals \\
|
||||
-4077..-20480 & $ \ast $ & See \ref{comm-mmio} \\
|
||||
-65537..-131072 & RO & Contents in the mapped ROM
|
||||
|
||||
@@ -82,11 +82,17 @@ This chapter will only briefly list and describe the applications.
|
||||
\1\dossynopsis{edit}[file]{The interactive full-screen text editor.}
|
||||
\1\dossynopsis{encodeipf}[1/2 imagefile ipffile]{Encodes the given image file (.jpg, .png, .bmp, .tga) to the IPF format using the graphics hardware.}
|
||||
\1\dossynopsis{false}{Returns errorlevel 1 upon execution.}
|
||||
\1\dossynopsis{geturl}[url]{Reads contents on the web address and store it to the disk. Requires Internet adapter.}
|
||||
\1\dossynopsis{hexdump}[file]{Prints out the contents of a file in hexadecimal view. Supports pipe.}
|
||||
\1\dossynopsis{less}[file]{Allows user to read the long text, even if they are wider and/or taller than the screen. Supports pipe.}
|
||||
\1\dossynopsis{playmov}[file]{Plays tsvmmov-formatted video. Use /i flag for playback control.}
|
||||
\1\dossynopsis{playmp2}[file]{Plays MP2 (MPEG-1 Audio Layer II) formatted audio. Use /i flag for playback control.}
|
||||
\1\dossynopsis{playpcm}[file]{Plays raw PCM audio. Use /i flag for playback control.}
|
||||
\1\dossynopsis{playwav}[file]{Plays linear PCM/ADPCM audio. Use /i flag for playback control.}
|
||||
\1\dossynopsis{printfile}[file]{Prints out the contents of a textfile with line numbers. Useful for making descriptive screenshots.}
|
||||
\1\dossynopsis{touch}[file]{Updates a file's modification date. New file will be created if the specified file does not exist.}
|
||||
\1\dossynopsis{true}{Returns errorlevel 0 upon execution.}
|
||||
\1\dossynopsis{zfm}{Z File Manager. A two-panel graphical user interface to navigate the system using arrow keys. Hit Z to switch panels.}
|
||||
\end{outline}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user