mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 23:04:04 +09:00
making con.color_pair to not use ANSI escape sequences which made fsh to run blazingly fast
This commit is contained in:
@@ -493,11 +493,14 @@ con.color_back = function(n) { // 0..7; -1 for transparent
|
|||||||
print("\x1B["+(((n|0) % 8)+40)+"m");
|
print("\x1B["+(((n|0) % 8)+40)+"m");
|
||||||
};
|
};
|
||||||
con.color_pair = function(fore, back) { // 0..255
|
con.color_pair = function(fore, back) { // 0..255
|
||||||
print("\x1B[38;5;"+fore+"m");
|
// print("\x1B[38;5;"+fore+"m");
|
||||||
print("\x1B[48;5;"+back+"m");
|
// print("\x1B[48;5;"+back+"m");
|
||||||
|
graphics.setTextFore(fore)
|
||||||
|
graphics.setTextBack(back)
|
||||||
};
|
};
|
||||||
con.clear = function() {
|
con.clear = function() {
|
||||||
print("\x1B[2J");
|
// print("\x1B[2J");
|
||||||
|
graphics.clearText()
|
||||||
};
|
};
|
||||||
// @params arg 0 to hide, nonzero to show
|
// @params arg 0 to hide, nonzero to show
|
||||||
con.curs_set = function(arg) {
|
con.curs_set = function(arg) {
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ class GraphicsJSR223Delegate(val vm: VM) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setTextFore(b: Int) {
|
||||||
|
getFirstGPU()?.let { it.ttyFore = b }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setTextBack(b: Int) {
|
||||||
|
getFirstGPU()?.let { it.ttyBack = b }
|
||||||
|
}
|
||||||
|
|
||||||
/*fun loadBulk(fromAddr: Int, toAddr: Int, length: Int) {
|
/*fun loadBulk(fromAddr: Int, toAddr: Int, length: Int) {
|
||||||
getFirstGPU()?._loadbulk(fromAddr, toAddr, length)
|
getFirstGPU()?._loadbulk(fromAddr, toAddr, length)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user