mirror of
https://github.com/silenty4ng/k5web
synced 2025-04-01 21:25:02 +00:00
update
This commit is contained in:
parent
a78e16644f
commit
6df014f878
3 changed files with 39 additions and 11 deletions
BIN
public/new_font_h.bin
Normal file
BIN
public/new_font_h.bin
Normal file
Binary file not shown.
BIN
public/new_font_k.bin
Normal file
BIN
public/new_font_k.bin
Normal file
Binary file not shown.
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue