mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +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");
|
||||
};
|
||||
con.color_pair = function(fore, back) { // 0..255
|
||||
print("\x1B[38;5;"+fore+"m");
|
||||
print("\x1B[48;5;"+back+"m");
|
||||
// print("\x1B[38;5;"+fore+"m");
|
||||
// print("\x1B[48;5;"+back+"m");
|
||||
graphics.setTextFore(fore)
|
||||
graphics.setTextBack(back)
|
||||
};
|
||||
con.clear = function() {
|
||||
print("\x1B[2J");
|
||||
// print("\x1B[2J");
|
||||
graphics.clearText()
|
||||
};
|
||||
// @params arg 0 to hide, nonzero to show
|
||||
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) {
|
||||
getFirstGPU()?._loadbulk(fromAddr, toAddr, length)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user