diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/assets/FontROM7x14.png b/assets/FontROM7x14.png index 2a16cd9..ac140a0 100644 Binary files a/assets/FontROM7x14.png and b/assets/FontROM7x14.png differ diff --git a/assets/FontROM7x14_437.png b/assets/FontROM7x14_437.png deleted file mode 100644 index ac140a0..0000000 Binary files a/assets/FontROM7x14_437.png and /dev/null differ diff --git a/assets/FontROM7x14_HANGUL.png b/assets/FontROM7x14_HANGUL.png index 39409f5..2a16cd9 100644 Binary files a/assets/FontROM7x14_HANGUL.png and b/assets/FontROM7x14_HANGUL.png differ diff --git a/assets/FontROM7x14_HANGUL_DISASM.png b/assets/FontROM7x14_HANGUL_DISASM.png new file mode 100644 index 0000000..39409f5 Binary files /dev/null and b/assets/FontROM7x14_HANGUL_DISASM.png differ diff --git a/assets/disk0/tvdos/bin/commandko.js b/assets/disk0/tvdos/bin/commandko.js index dbfeab9..af608f4 100644 --- a/assets/disk0/tvdos/bin/commandko.js +++ b/assets/disk0/tvdos/bin/commandko.js @@ -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; } } diff --git a/assets/hangul_high.chr b/assets/disk0/tvdos/i18n/hang_hi.chr similarity index 100% rename from assets/hangul_high.chr rename to assets/disk0/tvdos/i18n/hang_hi.chr diff --git a/assets/hangul_low.chr b/assets/disk0/tvdos/i18n/hang_lo.chr similarity index 100% rename from assets/hangul_low.chr rename to assets/disk0/tvdos/i18n/hang_lo.chr diff --git a/assets/disk0/home/hangasm.js b/assets/disk0/tvdos/i18n/korean.js similarity index 82% rename from assets/disk0/home/hangasm.js rename to assets/disk0/tvdos/i18n/korean.js index 38f6039..487f7a3 100644 --- a/assets/disk0/home/hangasm.js +++ b/assets/disk0/tvdos/i18n/korean.js @@ -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([ diff --git a/tsvm_core/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt b/tsvm_core/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt index 32d6eb4..201187a 100644 --- a/tsvm_core/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt +++ b/tsvm_core/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt @@ -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, diff --git a/tsvm_core/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt b/tsvm_core/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt index 272bada..5584590 100644 --- a/tsvm_core/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt +++ b/tsvm_core/src/net/torvald/tsvm/peripheral/GraphicsAdapter.kt @@ -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()