mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
i18n driver for tvdos
This commit is contained in:
10
.idea/runConfigurations.xml
generated
10
.idea/runConfigurations.xml
generated
@@ -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 |
BIN
assets/FontROM7x14_HANGUL_DISASM.png
Normal file
BIN
assets/FontROM7x14_HANGUL_DISASM.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -11,8 +11,8 @@ let errorlevel = 0;
|
|||||||
|
|
||||||
const termWidth = con.getmaxyx()[1];
|
const termWidth = con.getmaxyx()[1];
|
||||||
const termHeight = con.getmaxyx()[0];
|
const termHeight = con.getmaxyx()[0];
|
||||||
const welcome_text = (termWidth > 40) ? "TSVM Disk Operating System, version " + _TVDOS.VERSION
|
const welcome_text = (termWidth > 40) ? "TSVM 한글 DOS, 버전 " + _TVDOS.VERSION
|
||||||
: "TSVM Disk Operating System " + _TVDOS.VERSION;
|
: "TSVM 한글 DOS " + _TVDOS.VERSION;
|
||||||
const greetLeftPad = (termWidth - welcome_text.length - 6) >> 1;
|
const greetLeftPad = (termWidth - welcome_text.length - 6) >> 1;
|
||||||
const greetRightPad = termWidth - greetLeftPad - welcome_text.length - 6;
|
const greetRightPad = termWidth - greetLeftPad - welcome_text.length - 6;
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ shell.coreutils = {
|
|||||||
// check if path is valid
|
// check if path is valid
|
||||||
var dirOpenedStatus = filesystem.open(CURRENT_DRIVE, path.string, 'R');
|
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
|
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;
|
shell_pwd = path.pwd;
|
||||||
},
|
},
|
||||||
@@ -270,7 +270,7 @@ shell.coreutils = {
|
|||||||
// check if path is valid
|
// check if path is valid
|
||||||
var dirOpenedStatus = filesystem.open(CURRENT_DRIVE, path.string, 'W');
|
var dirOpenedStatus = filesystem.open(CURRENT_DRIVE, path.string, 'W');
|
||||||
var mkdird = filesystem.mkDir(CURRENT_DRIVE);
|
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) {
|
cls: function(args) {
|
||||||
con.clear();
|
con.clear();
|
||||||
@@ -313,7 +313,7 @@ shell.coreutils = {
|
|||||||
// if value is undefined, show what envvar[key] has
|
// if value is undefined, show what envvar[key] has
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
if (_TVDOS.variables[key] === undefined)
|
if (_TVDOS.variables[key] === undefined)
|
||||||
println("Environment variable '"+key+"' not found");
|
println("환경변수 '"+key+"'이(가) 없습니다.");
|
||||||
else
|
else
|
||||||
println(_TVDOS.variables[key])
|
println(_TVDOS.variables[key])
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ shell.coreutils = {
|
|||||||
|
|
||||||
// check if path is valid
|
// check if path is valid
|
||||||
var pathOpenedStatus = filesystem.open(CURRENT_DRIVE, pathstr, 'R');
|
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]
|
var port = filesystem._toPorts(CURRENT_DRIVE)[0]
|
||||||
com.sendMessage(port, "LIST");
|
com.sendMessage(port, "LIST");
|
||||||
@@ -341,7 +341,7 @@ shell.coreutils = {
|
|||||||
var pathstr = (args[1] !== undefined) ? args[1] : shell.getPwdString();
|
var pathstr = (args[1] !== undefined) ? args[1] : shell.getPwdString();
|
||||||
|
|
||||||
var pathOpenedStatus = filesystem.open(CURRENT_DRIVE, pathstr, 'R');
|
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);
|
let contents = filesystem.readAll(CURRENT_DRIVE);
|
||||||
// TODO just print out what's there
|
// TODO just print out what's there
|
||||||
print(contents);
|
print(contents);
|
||||||
@@ -393,7 +393,7 @@ shell.execute = function(line) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!fileExists) {
|
if (!fileExists) {
|
||||||
printerrln('Bad command or filename: "'+cmd+'"');
|
printerrln('명령어 또는 파일 이름이 틀립니다: "'+cmd+'"');
|
||||||
return 127;
|
return 127;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -480,7 +480,7 @@ if (exec_args[1] !== undefined) {
|
|||||||
goInteractive = true;
|
goInteractive = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printerrln("Invalid switch: "+exec_args[1]);
|
printerrln("잘못된 스위치: "+exec_args[1]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
* A character is defined as one of:
|
||||||
* 1. [I,x] (Initial only)
|
* 1. [I,x] (Initial only)
|
||||||
@@ -167,23 +198,6 @@ let printComma = (char) => {
|
|||||||
cursReturn()
|
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
|
// load unicode module to the TVDOS
|
||||||
if (unicode.uniprint) {
|
if (unicode.uniprint) {
|
||||||
unicode.uniprint.unshift([
|
unicode.uniprint.unshift([
|
||||||
@@ -96,9 +96,7 @@ class GraphicsJSR223Delegate(val vm: VM) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun setCursorYX(cy: Int, cx: Int) {
|
fun setCursorYX(cy: Int, cx: Int) {
|
||||||
getFirstGPU()?.let {
|
getFirstGPU()?.setCursorPos(cx - 1, cy - 1)
|
||||||
it.setCursorPos(cx - 1, cy - 1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,9 +130,7 @@ class GraphicsJSR223Delegate(val vm: VM) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun putSymbolAt(cy: Int, cx: Int, c: Int) {
|
fun putSymbolAt(cy: Int, cx: Int, c: Int) {
|
||||||
getFirstGPU()?.let {
|
getFirstGPU()?.putChar(cx - 1, cy - 1, c.toByte())
|
||||||
it.putChar(cx - 1, cy - 1, c.toByte())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private fun GraphicsAdapter._loadbulk(fromAddr: Int, toAddr: Int, length: Int) {
|
/*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) {
|
private fun GraphicsAdapter._loadSprite(spriteNum: Int, ptr: Int) {
|
||||||
UnsafeHelper.memcpy(
|
UnsafeHelper.memcpy(
|
||||||
vm.usermem.ptr + ptr,
|
vm.usermem.ptr + ptr,
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ open class GraphicsAdapter(private val assetsRoot: String, val vm: VM, val confi
|
|||||||
private val memTextOffset = 2L + 2560 + 2560
|
private val memTextOffset = 2L + 2560 + 2560
|
||||||
private val TEXT_AREA_SIZE = TEXT_COLS * TEXT_ROWS
|
private val TEXT_AREA_SIZE = TEXT_COLS * TEXT_ROWS
|
||||||
|
|
||||||
override var halfrowMode = true//false
|
override var halfrowMode = false
|
||||||
|
|
||||||
override var rawCursorPos: Int
|
override var rawCursorPos: Int
|
||||||
get() = textArea.getShort(memTextCursorPosOffset).toInt()
|
get() = textArea.getShort(memTextCursorPosOffset).toInt()
|
||||||
|
|||||||
Reference in New Issue
Block a user