Release 0.9.1-3 with RetroBrowser, PPC audio, XP diagnostics and LP64 repair

This commit is contained in:
2026-11-29 13:41:59 +00:00
parent 15fde09e9e
commit 679dada6ec
117 changed files with 2473 additions and 63 deletions

4
browser/protocol.mjs Normal file
View File

@@ -0,0 +1,4 @@
export const T={HELLO:1,AUTH:2,READY:3,NAV:4,MOUSE:5,KEY:6,FRAME:7,AUDIO:8,STATUS:9,ERROR:10,RESIZE:11,BACK:12,FORWARD:13,RELOAD:14,STOP:15,TEXT:16,PING:17,PONG:18};
export function packet(type,body=Buffer.alloc(0),seq=0){if(!Buffer.isBuffer(body))body=Buffer.from(body);const h=Buffer.alloc(16);h.write('RBP1');h.writeUInt16BE(1,4);h.writeUInt16BE(type,6);h.writeUInt32BE(body.length,8);h.writeUInt32BE(seq>>>0,12);return Buffer.concat([h,body]);}
export class Parser{constructor(fn,max=65536){this.fn=fn;this.max=max;this.buf=Buffer.alloc(0);} feed(b){this.buf=Buffer.concat([this.buf,b]);while(this.buf.length>=16){if(this.buf.toString('ascii',0,4)!=='RBP1'||this.buf.readUInt16BE(4)!==1)throw Error('RBP header');const n=this.buf.readUInt32BE(8);if(n>this.max)throw Error('RBP size');if(this.buf.length<16+n)return;const t=this.buf.readUInt16BE(6),p=this.buf.subarray(16,16+n);this.buf=this.buf.subarray(16+n);this.fn(t,p);}}}
export function rle565(raw){let out=Buffer.alloc(raw.length*2),j=0;for(let i=0;i<raw.length;){const p=raw.readUInt16LE(i);let n=1;while(n<65535&&i+n*2<raw.length&&raw.readUInt16LE(i+n*2)===p)n++;out.writeUInt16BE(n,j);out.writeUInt16BE(p,j+2);j+=4;i+=n*2;}return out.subarray(0,j);}