create-fcdev 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fcdev",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "创建 fcdev 项目:npm create fcdev,在空目录生成 6502 兼容机程序的开发结构与示例",
5
5
  "license": "Apache-2.0",
6
6
  "author": "sungbin <sungbin@3578.cn>",
@@ -31,3 +31,18 @@ DOS 启动后按两次回车跳过日期与时间提示,在提示符下输入
31
31
  | --- | --- |
32
32
  | `src/hello.c` | 示例程序:显示一行英文和一行中文,等待按键后返回 DOS |
33
33
  | `fcdev.json` | fcdev 配置:目标 sb2000,程序名 hello |
34
+
35
+ ## 查阅接口
36
+
37
+ 运行库把 DOS 的系统调用封装成了 C 函数(文字、键盘手柄鼠标、文件目录、软驱、显示、声音等),头文件是 `sb2000.h`。随时查询:
38
+
39
+ ```bash
40
+ npx fcdev api # 列出全部模块
41
+ npx fcdev api file # 看模块里的函数
42
+ npx fcdev api sb_file_open # 看一个函数的完整文档
43
+ npx fcdev api '$7B' # 看用到某个系统调用的函数
44
+ ```
45
+
46
+ ## 程序超过 16K
47
+
48
+ 在 `fcdev.json` 里加 `"targetOptions": { "banks": 库页个数 }`,把部分函数用 `SB_BANK_BEGIN(n)` 与 `SB_BANK_END()` 放进库页,声明处用 `SB_BANK_CALLS_BEGIN(n)` 与 `SB_BANK_CALLS_END()` 包起来,调用时自动换页。函数的用法用 `npx fcdev api bank` 查,写法与限制见 `node_modules/fcdev/targets/sb2000/include/sb2000-bank.h` 文件头的说明。