HelloSun commited on
Commit
ef177ba
·
verified ·
1 Parent(s): 23715ae

deploy c_dos demo

Browse files
Files changed (6) hide show
  1. .gitattributes +2 -0
  2. dos622.iso +3 -0
  3. index.html +144 -18
  4. js-dos.js +0 -0
  5. wdosbox.js +0 -0
  6. wdosbox.wasm.js +0 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ dos622.iso filter=lfs diff=lfs merge=lfs -text
37
+ wdosbox.wasm.js filter=lfs diff=lfs merge=lfs -text
dos622.iso ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c00f4612390689b1c6c4512177cce1cc3cbc7ad98c9bb8357e61529b0f19eb77
3
+ size 2971648
index.html CHANGED
@@ -1,19 +1,145 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-Hant">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>ETen 中文 DOS 系統 · js-dos 6.22 Demo</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
10
+ <style>
11
+ :root{--bg:#000;--fg:#0f0;--amber:#ffb000;--cyan:#0ff}
12
+ *{box-sizing:border-box}
13
+ body{margin:0;background:var(--bg);color:var(--fg);font-family:'Share Tech Mono',monospace;min-height:100vh;display:flex;flex-direction:column}
14
+ header{padding:8px 12px;border-bottom:1px solid #030;background:#010;display:flex;justify-content:space-between;align-items:center;font-size:12px}
15
+ header .title{color:var(--amber);font-weight:700}
16
+ .mem{color:var(--cyan)}
17
+ main{flex:1;display:grid;grid-template-columns:1fr 320px;gap:8px;padding:8px}
18
+ @media(max-width:800px){main{grid-template-columns:1fr}}
19
+ .term{background:#010;border:1px solid #030;padding:10px;overflow:auto;min-height:360px;font-size:14px;line-height:1.4;white-space:pre-wrap}
20
+ .term .prompt{color:var(--amber)}
21
+ .term .zh{font-family:'Noto Sans TC',sans-serif;color:#fff}
22
+ .side{background:#010;border:1px solid #030;padding:10px;font-size:12px}
23
+ .side h3{color:var(--amber);margin:0 0 6px}
24
+ .ime-status{display:inline-block;padding:2px 6px;border:1px solid #030;margin:4px 0}
25
+ .ime-status.on{background:#030;color:var(--cyan)}
26
+ .kbd{background:#111;border:1px solid #333;padding:1px 4px;border-radius:3px}
27
+ #dosbox{width:100%;height:240px;background:#000;border:1px solid #030;margin-top:8px}
28
+ footer{padding:6px 12px;border-top:1px solid #030;font-size:11px;color:#060}
29
+ input#cmd{background:#000;color:var(--fg);border:none;outline:none;font:inherit;width:100%}
30
+ </style>
31
+ </head>
32
+ <body>
33
+ <header>
34
+ <div class="title">倚天中文 DOS 6.22 · ETen Chinese System (復刻)</div>
35
+ <div class="mem">Conventional Memory: <span id="memfree">624</span> KB free / 640 KB</div>
36
+ </header>
37
+ <main>
38
+ <section class="term" id="term" tabindex="0">
39
+ <div>ETen Chinese System v3.5 (demo) — js-dos 6.22</div>
40
+ <div>Copyright (C) 1990-1994 E-TEN Information Systems Co.</div>
41
+ <div>開源字型:Noto Sans TC (OFL-1.1)</div>
42
+ <div>輸入法:注音 (Bopomofo) — 按 <span class="kbd">Ctrl+Space</span> 切換</div>
43
+ <div>────────────────────────────────────────</div>
44
+ <div id="log"></div>
45
+ <div class="prompt">C:\&gt; <input id="cmd" autocomplete="off" spellcheck="false"></div>
46
+ </section>
47
+ <aside class="side">
48
+ <h3>輸入法狀態</h3>
49
+ <div id="ime" class="ime-status">EN</div>
50
+ <div>模式:<span id="imemode">英文</span></div>
51
+ <h3>注音對照</h3>
52
+ <div style="font-family:'Noto Sans TC',sans-serif;font-size:13px">
53
+ ㄅ b ㄆ p ㄇ m ㄈ f ㄉ d ㄊ t ㄋ n ㄌ l<br>
54
+ ㄍ g ㄎ k ㄏ h ㄐ j ㄑ q ㄒ x ㄓ zh ㄔ ch<br>
55
+ ㄕ sh ㄖ r ㄗ z ㄘ c ㄙ s ㄧ i ㄨ u ㄩ v<br>
56
+ ㄚ a ㄛ o ㄜ e ㄝ ei ㄞ ai ㄠ ao ㄢ an<br>
57
+ ㄣ en ㄤ ang ㄥ eng ㄦ er
58
+ </div>
59
+ <h3>js-dos 6.22</h3>
60
+ <div id="dosbox"></div>
61
+ <div id="dosstatus" style="margin-top:6px;color:#060">載入中…</div>
62
+ </aside>
63
+ </main>
64
+ <footer>Build: 一鍵 build.sh · 上傳至 Hugging Face Static Space hellosun/c_dos · 600KB+ 傳統記憶體保留</footer>
65
+
66
+ <script src="js-dos.js"></script>
67
+ <script>
68
+ // Conventional memory display
69
+ let memFree = 624;
70
+ function setMem(v){ memFree=v; document.getElementById('memfree').textContent=v; }
71
+ setMem(624);
72
+
73
+ // Zhuyin IME
74
+ const zhuyinMap = {
75
+ 'ㄅㄚ':'巴','ㄆㄚ':'怕','ㄇㄚ':'媽','ㄈㄚ':'發','ㄉㄚ':'大','ㄊㄚ':'他','ㄋㄚ':'拿','ㄌㄚ':'拉',
76
+ 'ㄍㄚ':'家','ㄎㄚ':'卡','ㄏㄚ':'哈','ㄐㄧ':'機','ㄑㄧ':'七','ㄒㄧ':'西','ㄓ':'之','ㄔ':'吃',
77
+ 'ㄕ':'是','ㄖ':'日','ㄗ':'字','ㄘ':'次','ㄙ':'四','ㄧ':'一','ㄨ':'五','ㄩ':'女',
78
+ 'ㄠ':'好','ㄞ':'來','ㄢ':'安','ㄣ':'恩','ㄤ':'昂','ㄥ':'鞥','ㄦ':'兒','ㄅㄛ':'波','ㄆㄛ':'坡',
79
+ 'ㄇㄛ':'摸','ㄈㄛ':'佛','ㄉㄜ':'的','ㄊㄜ':'特','ㄋㄜ':'呢','ㄌㄜ':'樂','ㄍㄜ':'哥','ㄎㄜ':'科',
80
+ 'ㄏㄜ':'喝','ㄐㄜ':'歌','ㄑㄜ':'課','ㄒㄜ':'喝','ㄓㄜ':'者','ㄔㄜ':'車','ㄕㄜ':'社','ㄖㄜ':'熱',
81
+ 'ㄗ���':'則','ㄘㄜ':'測','ㄙㄜ':'色','ㄅㄞ':'百','ㄆㄞ':'派','ㄇㄞ':'買','ㄈㄞ':'發','ㄉㄞ':'呆',
82
+ 'ㄊㄞ':'台','ㄋㄞ':'乃','ㄌㄞ':'來','ㄍㄞ':'改','ㄎㄞ':'開','ㄏㄞ':'海','ㄐㄞ':'介','ㄑㄞ':'且',
83
+ 'ㄒㄞ':'鞋','ㄓㄞ':'宅','ㄔㄞ':'差','ㄕㄞ':'晒','ㄖㄞ':'乳','ㄗㄞ':'再','ㄘㄞ':'才','ㄙㄞ':'塞'
84
+ };
85
+ let imeOn = false;
86
+ let buf = '';
87
+ const imeEl = document.getElementById('ime');
88
+ const modeEl = document.getElementById('imemode');
89
+ const logEl = document.getElementById('log');
90
+ const cmdEl = document.getElementById('cmd');
91
+
92
+ function toggleIme(){
93
+ imeOn = !imeOn;
94
+ imeEl.textContent = imeOn ? '注音' : 'EN';
95
+ imeEl.classList.toggle('on', imeOn);
96
+ modeEl.textContent = imeOn ? '注音' : '英文';
97
+ buf = '';
98
+ }
99
+ document.addEventListener('keydown', (e)=>{
100
+ if (e.ctrlKey && e.code === 'Space') { e.preventDefault(); toggleIme(); return; }
101
+ if (!imeOn) return;
102
+ // zhuyin symbols typed via bopomofo keys? We accept direct unicode zhuyin too.
103
+ });
104
+
105
+ cmdEl.addEventListener('keydown', (e)=>{
106
+ if (e.key === 'Enter'){
107
+ const v = cmdEl.value;
108
+ const line = document.createElement('div');
109
+ line.innerHTML = '<span class="prompt">C:\\&gt; </span>' + (imeOn && buf ? convert(buf) : '') + escapeHtml(v);
110
+ logEl.appendChild(line);
111
+ handleCmd(v);
112
+ cmdEl.value=''; buf='';
113
+ return;
114
+ }
115
+ if (imeOn){
116
+ // accumulate last char as zhuyin buffer display
117
+ }
118
+ });
119
+
120
+ function convert(b){ return zhuyinMap[b] || b; }
121
+ function escapeHtml(s){ return s.replace(/&/g,'&amp;').replace(/</g,'&lt;'); }
122
+
123
+ function handleCmd(v){
124
+ const t = v.trim().toLowerCase();
125
+ if (t === 'mem'){ print('640 KB total conventional memory'); print(memFree+' KB free'); }
126
+ else if (t === 'ver'){ print('MS-DOS 6.22 (ETen demo)'); }
127
+ else if (t === 'help'){ print('命令: mem, ver, cls, exit'); }
128
+ else if (t === 'cls'){ logEl.innerHTML=''; }
129
+ else if (t){ print('Bad command or file name'); }
130
+ const term = document.getElementById('term'); term.scrollTop = term.scrollHeight;
131
+ }
132
+ function print(s){ const d=document.createElement('div'); d.textContent=s; logEl.appendChild(d); }
133
+
134
+ // js-dos 6.22 init
135
+ (function(){
136
+ const status = document.getElementById('dosstatus');
137
+ if (typeof Dos === 'undefined'){ status.textContent='js-dos 未載入'; return; }
138
+ try {
139
+ const dos = Dos(document.getElementById('dosbox'), {wdosboxUrl:'wdosbox.js'});
140
+ status.textContent = 'js-dos 6.22 已載入 (DOSBox 核心)';
141
+ } catch(err){ status.textContent = 'js-dos 初始化: '+err.message; }
142
+ })();
143
+ </script>
144
+ </body>
145
  </html>
js-dos.js ADDED
The diff for this file is too large to render. See raw diff
 
wdosbox.js ADDED
The diff for this file is too large to render. See raw diff
 
wdosbox.wasm.js ADDED
Binary file (132 Bytes). View file