wonx/MANUAL
Hiroaki Sakai c0b964b4f4 Added dummy function of _asm_*().
Set FP_OFF ​(), FP_SEG() for the callback function at interrupt setting in WonderWitch
Adjust appropriately according to the setting method.  (Fit to wwterm)

UNIXTimer.c: UNIXTimer_Unpause()
((unix_timer -> pause == 1) && (unix_timer -> interrupt_in_pause == 0))
Fixed a bug that was not unix_timer-> pause--; when it was.
(It was not unposted when interrupt was not applied during pause)

Serial receive interrupt, keyboard interrupt added.  (corresponding to wwterm, operation confirmed)
Added UNIXSerialPort class.

With this, at WonderWitch,
com_intvector.callback = (void (near *) ()) FP_OFF ​​(com_handler);
com_intvector.cs = _ asm_inline ("\tmov \tax, cs");
com_intvector.ds = _ asm_inline ("\tmov \tax, ds");
sys_interrupt_set_hook (SYS_INT_RECEIVEREADY,
& com_intvector, & com_last_intvector);
Interrupt setting like that shown in Fig.

For warning, add WonX_Warning ().
Move WonX_Error () to WonX.c.

comm_send_string (), text_put_string (), text_put_substring () When executed
Fix output message.

Implement cursor display function.  (Add WWCursor class) (Do not blink. Display only)
When displaying the cursor, text information inside WWDisplay_DrawLCDPanel ()
Since we need to be able to read it, we will discontinue the WonXText class and add the WWText class
I moved to a member of the WWDisplay class.

In palette_get_color (), transparent color is displayed when executing WWPalette_GetMappedColors ()
Since it was not considered to be returned as -1, palette_get_color ()
Fixed a bug where return value was wrong value.

Character color palette, LCD color palette initial value, with WonderWitch
It was made to coincide with the initial value.

As a sample, add wwterm - b 05.  (Add wwterm target to Makefile)

Version 1.1 - from wonx-1.1.tar.gz
2018-03-07 23:07:04 +00:00

77 lines
3.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

WonX のプログラム構造についての解説です.
改造するときの参考にしてください.(ライセンスはGPLなので改造は自由です)
■ ファイル構成
WonX はオブジェクト指向で書いてあり,クラス単位でファイルを分けてあります.
ファイル自体は一つのクラスにつき3つずつあります.例えば X のウインドウを
管理するための XDisplay クラス用には,以下の3つのファイルがあります.
XDisplay.h ... 外部公開用ヘッダファイルXDisplay クラスを使用したい
ときには,このファイルを include する.
XDisplayP.h ... 外部に公開しないプライベートなヘッダファイル.
一般には include しない.デバッグ時などにメンバを直接
参照したいときに include するためのもの.
XDisplay.c ... メンバ関数などの本体.
クラスのメンバ変数は XDisplayP.h で定義してあるので,メンバを直接参照することは
できません.必ずアクセス用のメンバ関数を通して参照します.値の設定も同様です.
この他にdisp.c や text.c などのファイルがあります.これらは,
WonderWitch の互換関数です.
■ オブジェクトのツリー
オブジェクトは以下のようなツリー構造になっています.
┌─ WWColorMap
├─ WWPalette[16]
├─ WWCharacter[512]
┌─WWDisplay ─┼─ WWSprite[128]
┌─ WonXDisplay ──┤ ├─ WWScreen[2]
│ └─XDisplay ├─ WWLCDPanel
│ ├─ WWText
│ └─ WWCursor
│ ┌─ WWInterrupt
WonX ─┼─ WonXSystem ───┼─ WWTimer[3]
│ └─ UNIXTimer
│ ┌─ WWSerialPort
└─ WonXSerialPort ─┤
└─ UNIXSerialPort
WW という接頭語がつくクラスは WonderWitch 依存のものです.主に
WonderSwan の状態情報を格納します.
X という接頭語がつくクラスは X 依存のものUNIX という接頭語がつくクラスは
UNIX 依存のものです.
WonX という接頭語がつくクラスはそれらを統括するものです.
ツリー構造を理解したかったら,各クラスの *P.h ファイルのメンバの定義と,
*.c ファイルの *_Create() 関数を参照してください.
■ オブジェクトの生成
各クラスには,オブジェクトの生成用に,[クラス名]_Create() という
関数が用意されています.
WonX_Create() が呼ばれると,内部で WonXDisplay_Create(), WonXSystem_Create(),
WonXSerialPort_Create() が呼ばれ,子の WonXDisplay, WonXSystem,
WonXSerialPort オブジェクトが生成されます.
WonXDisplay_Create() が呼ばれると,内部で WWDisplay_Create(),
XDisplay_Create() が呼ばれ,... というように続いて,すべてのツリーか
生成されます.
オブジェクトを解放するときも同様なのですがWonX_Destroy() が
呼ばれるタイミングが無いため,あまりちゃんと書いてません.
WonderWitch 用の互換関数では,必ず先頭で,
if (!WonX_IsCreated()) WonX_Create();
のようなことをやっています.つまり,互換関数のどれかが最初に呼ばれたときに,
WonX オブジェクトのツリーが作成されます.
■ メンバ関数
クラスのメンバ関数は,[クラス名]_xxx() という名前になっています.
■ このファイルはここまでです