1
0
Fork 0
mirror of https://github.com/silenty4ng/k5web synced 2025-04-01 21:25:02 +00:00
This commit is contained in:
Silent YANG 2024-01-31 23:54:53 +08:00
parent a78e16644f
commit 6df014f878
3 changed files with 39 additions and 11 deletions

BIN
public/new_font_h.bin Normal file

Binary file not shown.

BIN
public/new_font_k.bin Normal file

Binary file not shown.

View file

@ -66,22 +66,50 @@ const restore = async(type: any = 1) => {
switch(type){
case 1:
fontPacket = await fetch('/old_font.bin')
const reader = fontPacket.body.getReader();
const chunks = [];
while(true) {
const {done, value} = await reader.read();
if (done) {
break;
}
chunks.push(...value)
}
const binary = new Uint8Array(chunks)
await restoreRange(0x02000, binary)
break
case 2:
fontPacket = await fetch('/new_font_k.bin')
const reader = fontPacket.body.getReader();
const chunks = [];
while(true) {
const {done, value} = await reader.read();
if (done) {
break;
}
chunks.push(...value)
}
const binary = new Uint8Array(chunks)
await restoreRange(0x02480, binary)
break
case 3:
fontPacket = await fetch('/new_font_h.bin')
const reader = fontPacket.body.getReader();
const chunks = [];
while(true) {
const {done, value} = await reader.read();
if (done) {
break;
}
chunks.push(...value)
}
const binary = new Uint8Array(chunks)
await restoreRange(0x02480, binary)
break
default:
alert('TODO')
return
}
const reader = fontPacket.body.getReader();
const chunks = [];
while(true) {
const {done, value} = await reader.read();
if (done) {
break;
}
chunks.push(...value)
}
const binary = new Uint8Array(chunks)
await restoreRange(0x02000, binary)
}
</script>