fixing hangul print functions

This commit is contained in:
minjaesong
2025-10-04 01:10:14 +09:00
parent 6222e9d8bd
commit 71102f1d70
3 changed files with 44 additions and 4 deletions

View File

@@ -155,7 +155,9 @@ let printHangul = (char) => {
if (i % 2 == 0)
con.curs_down()
else
cursReturn()
cursReturn()
//if (graphics.getCursorYX()[1] == 1) con.curs_down();
})
}
@@ -183,10 +185,18 @@ if (unicode.uniprint) {
let f = (c - 0xAC00) % 28
let char = toLineChar(i,p,f)
let w = Math.ceil(char.length / 2.0)|0
if (con.getyx()[1] + w > termw) println()
if (con.getyx()[1] + w > termw) print('\n\n');
printHangul(char)
}
}
])
unicode.uniprint.unshift([
c => 0x20 == c,
c => {
if (con.getyx()[1] >= termw) print('\n\n');
else print(' ')
}
])
}

View File

@@ -0,0 +1,30 @@
let status = 0
let workarea = sys.malloc(1920)
// install LOCHRROM
let hangulRomL = files.open("A:/tvdos/i18n/hang_lo.chr")
if (!hangulRomL.exists) {
printerrln("hang_lo.chr not found")
sys.free(workarea)
return status
}
hangulRomL.pread(workarea, 1920, 0)
for (let i = 0; i < 1920; i++) sys.poke(-133121 - i, sys.peek(workarea + i))
sys.poke(-1299460, 18)
// install HICHRROM
let hangulRomH = files.open("A:/tvdos/i18n/hang_hi.chr")
if (!hangulRomH.exists) {
printerrln("hang_hi.chr not found")
sys.free(workarea)
sys.poke(-1299460, 20) // clean up the crap
return status
}
hangulRomH.pread(workarea, 1920, 0)
for (let i = 0; i < 1920; i++) sys.poke(-133121 - i, sys.peek(workarea + i))
sys.poke(-1299460, 19)
sys.free(workarea)