i18n driver for tvdos

This commit is contained in:
minjaesong
2021-12-28 11:28:45 +09:00
parent 9c9f351197
commit 2ec0f6aa51
11 changed files with 47 additions and 43 deletions

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -11,8 +11,8 @@ let errorlevel = 0;
const termWidth = con.getmaxyx()[1];
const termHeight = con.getmaxyx()[0];
const welcome_text = (termWidth > 40) ? "TSVM Disk Operating System, version " + _TVDOS.VERSION
: "TSVM Disk Operating System " + _TVDOS.VERSION;
const welcome_text = (termWidth > 40) ? "TSVM 한글 DOS, 버전 " + _TVDOS.VERSION
: "TSVM 한글 DOS " + _TVDOS.VERSION;
const greetLeftPad = (termWidth - welcome_text.length - 6) >> 1;
const greetRightPad = termWidth - greetLeftPad - welcome_text.length - 6;
@@ -255,7 +255,7 @@ shell.coreutils = {
// check if path is valid
var dirOpenedStatus = filesystem.open(CURRENT_DRIVE, path.string, 'R');
var isDir = filesystem.isDirectory(CURRENT_DRIVE); // open a dir; if path is nonexistent, file won't actually be opened
if (!isDir) { printerrln("CHDIR failed for '"+path.string+"'"); return dirOpenedStatus; } // if file is not opened, IO error code will be returned
if (!isDir) { printerrln("디렉토리 '"+path.string+"'가 없습니다."); return dirOpenedStatus; } // if file is not opened, IO error code will be returned
shell_pwd = path.pwd;
},
@@ -270,7 +270,7 @@ shell.coreutils = {
// check if path is valid
var dirOpenedStatus = filesystem.open(CURRENT_DRIVE, path.string, 'W');
var mkdird = filesystem.mkDir(CURRENT_DRIVE);
if (!mkdird) { printerrln("MKDIR failed for '"+path.string+"'"); return dirOpenedStatus; }
if (!mkdird) { printerrln("디렉토리 생성 실패: '"+path.string+"'"); return dirOpenedStatus; }
},
cls: function(args) {
con.clear();
@@ -313,7 +313,7 @@ shell.coreutils = {
// if value is undefined, show what envvar[key] has
if (value === undefined) {
if (_TVDOS.variables[key] === undefined)
println("Environment variable '"+key+"' not found");
println("환경변수 '"+key+"'이(가) 없습니다.");
else
println(_TVDOS.variables[key])
}
@@ -331,7 +331,7 @@ shell.coreutils = {
// check if path is valid
var pathOpenedStatus = filesystem.open(CURRENT_DRIVE, pathstr, 'R');
if (pathOpenedStatus != 0) { printerrln("File not found"); return pathOpenedStatus; }
if (pathOpenedStatus != 0) { printerrln("파일이 없습니다"); return pathOpenedStatus; }
var port = filesystem._toPorts(CURRENT_DRIVE)[0]
com.sendMessage(port, "LIST");
@@ -341,7 +341,7 @@ shell.coreutils = {
var pathstr = (args[1] !== undefined) ? args[1] : shell.getPwdString();
var pathOpenedStatus = filesystem.open(CURRENT_DRIVE, pathstr, 'R');
if (pathOpenedStatus != 0) { printerrln("File not found"); return pathOpenedStatus; }
if (pathOpenedStatus != 0) { printerrln("파일이 없습니다"); return pathOpenedStatus; }
let contents = filesystem.readAll(CURRENT_DRIVE);
// TODO just print out what's there
print(contents);
@@ -393,7 +393,7 @@ shell.execute = function(line) {
}
if (!fileExists) {
printerrln('Bad command or filename: "'+cmd+'"');
printerrln('명령어 또는 파일 이름이 틀립니다: "'+cmd+'"');
return 127;
}
else {
@@ -480,7 +480,7 @@ if (exec_args[1] !== undefined) {
goInteractive = true;
}
else {
printerrln("Invalid switch: "+exec_args[1]);
printerrln("잘못된 스위치: "+exec_args[1]);
return 1;
}
}

View File

@@ -1,4 +1,35 @@
let status = 0
let workarea = sys.malloc(1920)
// install LOCHRROM
status = filesystem.open("A", "/tvdos/i18n/hang_lo.chr", "R")
if (status != 0) {
printerrln("hang_lo.chr not found")
sys.free(workarea)
return status
}
dma.comToRam(filesystem._toPorts("A")[0], 0, workarea, 1920)
for (let i = 0; i < 1920; i++) sys.poke(-1300607 - i, sys.peek(workarea + i))
sys.poke(-1299460, 18)
// install HICHRROM
status = filesystem.open("A", "/tvdos/i18n/hang_hi.chr", "R")
if (status != 0) {
printerrln("hang_hi.chr not found")
sys.free(workarea)
sys.poke(-1299460, 20) // clean up the crap
return status
}
dma.comToRam(filesystem._toPorts("A")[0], 0, workarea, 1920)
for (let i = 0; i < 1920; i++) sys.poke(-1300607 - i, sys.peek(workarea + i))
sys.poke(-1299460, 19)
sys.free(workarea)
graphics.setHalfrowMode(true)
/*
* A character is defined as one of:
* 1. [I,x] (Initial only)
@@ -167,23 +198,6 @@ let printComma = (char) => {
cursReturn()
}
/*let text = " 7 "
//con.clear()
//con.move(1,1)
unicode.utf8toCodepoints(text).forEach(cp=>{
if (0xAC00 <= cp && cp <= 0xD7A3) {
let i = ((cp - 0xAC00) / 588)|0
let p = ((cp - 0xAC00) / 28 % 21)|0
let f = (cp - 0xAC00) % 28
printHangul(toLineChar(i,p,f))
}
else {
print(String.fromCharCode(cp))
}
})*/
// load unicode module to the TVDOS
if (unicode.uniprint) {
unicode.uniprint.unshift([

View File

@@ -96,9 +96,7 @@ class GraphicsJSR223Delegate(val vm: VM) {
}
fun setCursorYX(cy: Int, cx: Int) {
getFirstGPU()?.let {
it.setCursorPos(cx - 1, cy - 1)
}
getFirstGPU()?.setCursorPos(cx - 1, cy - 1)
}
@@ -132,9 +130,7 @@ class GraphicsJSR223Delegate(val vm: VM) {
}
fun putSymbolAt(cy: Int, cx: Int, c: Int) {
getFirstGPU()?.let {
it.putChar(cx - 1, cy - 1, c.toByte())
}
getFirstGPU()?.putChar(cx - 1, cy - 1, c.toByte())
}
/*private fun GraphicsAdapter._loadbulk(fromAddr: Int, toAddr: Int, length: Int) {
@@ -153,6 +149,10 @@ class GraphicsJSR223Delegate(val vm: VM) {
)
}*/
fun setHalfrowMode(set: Boolean) {
getFirstGPU()?.halfrowMode = set
}
private fun GraphicsAdapter._loadSprite(spriteNum: Int, ptr: Int) {
UnsafeHelper.memcpy(
vm.usermem.ptr + ptr,

View File

@@ -115,7 +115,7 @@ open class GraphicsAdapter(private val assetsRoot: String, val vm: VM, val confi
private val memTextOffset = 2L + 2560 + 2560
private val TEXT_AREA_SIZE = TEXT_COLS * TEXT_ROWS
override var halfrowMode = true//false
override var halfrowMode = false
override var rawCursorPos: Int
get() = textArea.getShort(memTextCursorPosOffset).toInt()