mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-11 07:14:04 +09:00
graphics: fixed pixels not plotting on non crt_color
This commit is contained in:
@@ -1,37 +1,26 @@
|
||||
con.curs_set(0)
|
||||
con.clear()
|
||||
let t=`${system.maxmem()>>>10} Kbytes System`
|
||||
// 0b_HL where H is top pixel
|
||||
// H-bits
|
||||
let imgh = [
|
||||
[252,0,3,0,0],
|
||||
[48,0,3,0,0],
|
||||
[51,239,191,102,255],
|
||||
[51,237,191,66,219],
|
||||
[52,45,161,126,219],
|
||||
[54,109,179,124,219]];
|
||||
// L-bits
|
||||
let imgl = [
|
||||
[252,0,3,0,0],
|
||||
[51,207,31,60,254],
|
||||
[48,109,191,66,219],
|
||||
[54,109,179,102,219],
|
||||
[52,45,161,96,219],
|
||||
[51,237,159,60,219]];
|
||||
let imgc = [32,220,223,219]
|
||||
for (let y=0;y<imgh.length;y++) {
|
||||
for (let x=0;x<imgh[0].length;x++) {
|
||||
for (let b=7;b>=0;b--) {
|
||||
con.mvaddch(y+1,1+x*8+7-b,imgc[(imgh[y][x]>>b&1)<<1|imgl[y][x]>>b&1])
|
||||
}}}
|
||||
let imageBits = gzip.decomp(base64.atob(
|
||||
"H4sICC62h2ACA3RhbmRlbV9sb2dvXzI0MC5iaW4AhdQ/bsMgGAXwh4hEhyisHSq5R+iYISpX6REydqhkjsZRfASPDJbJ449jQuxUspDsn2XD+z6wAMSIPjiECQOgAwcoIMwQNuoAQ+2TilZlrehbdeioJqspypeTqgfttrXLqhvVljO9qypq/IPqrLLRblcZQQi8oyqqClZwiI+6cdHPVYcdlUnHVmdc5aooypVV+iaS+lYnXMUr9dQjkk6LMsEt/YkRcKL8WlQPj+BO+NtW/vFZpc06Ununcan1S9r3rHL+X+3HgwpkHaim1bPglVSFqFzTpsZeWzWncUZRd+DLTg+HOskL8Jv1+ErtiZk7PaKu4I6W6n8jph+1S+pRd85dOX/Wq6h9UmOjTqg71kAsykD2dI4qnZ5R75RVexbirmWXGSuTTlGF0wH1Dt1R02pg81BtfTIYp5L6qFh0OVWe1NUnUtIb4Dr/QbAEAAA="
|
||||
))
|
||||
for (let y = 0; y < 40; y++) {
|
||||
for (let x = 0; x < 30; x++) {
|
||||
let octet = imageBits[y * 30 + x]
|
||||
for (let i = 0; i < 8; i++) {
|
||||
graphics.plotPixel(8*x + i, y+8, ((octet >>> (7 - i)) & 1 != 0) ? 255 : 239)
|
||||
}
|
||||
}
|
||||
}
|
||||
con.move(8,1+(40-t.length>>1))
|
||||
print(t)
|
||||
// wait arbitrary time
|
||||
for (let b=0;b<333333;b++) {
|
||||
for (let b=0;b<system.maxmem()*10;b++) {
|
||||
sys.poke(0,(Math.random()*255)|0)
|
||||
sys.poke(0,0)
|
||||
}
|
||||
con.clear();
|
||||
con.clear()
|
||||
graphics.clearPixels(255)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user