Add quick translation of the readme
This commit is contained in:
parent
86539c6fac
commit
ba2cb227e0
731
README.md
731
README.md
@ -1,372 +1,375 @@
|
|||||||
ワンべぇ: WONBE, WonderWitch BASIC Environment
|
ONE Bee: WONBE, WonderWitch BASIC Environment
|
||||||
暫定マニュアル Ver 0.06
|
|
||||||
2001年1月29日
|
(Warning: this translation to english was done using google translate, some part of the document may mean nothing, proper translation will come later)
|
||||||
株式会社ピーデー
|
|
||||||
川俣 晶
|
Provisional manual Ver 0.06
|
||||||
|
January 29, 2001
|
||||||
|
People
|
||||||
|
Kawamata Akira
|
||||||
This software is distributed under GNU General Public License
|
This software is distributed under GNU General Public License
|
||||||
|
|
||||||
●これは何か?
|
● What is this?
|
||||||
ワンべぇは、WonderWitch上で使用できる小型BASICインタプリタです。
|
One way is a small BASIC interpreter that you can use on WonderWitch.
|
||||||
WonderWitch上ですべての機能が稼働し、シリアルケーブル経由で接続された一般の通信ソフトで操作します。デバッグ済みのプログラムを実行する場合は、シリアルケーブルも通信ソフトも必要ありません。
|
All functions operate on WonderWitch and operate with ordinary communication software connected via serial cable. When executing a debugged program, neither a serial cable nor communication software is necessary.
|
||||||
WonderWitchのテキスト画面を扱う最小限度のステートメント(cls,locate,print)と、最小限度のボタン入力機能(wait,scan)を持ち、簡易なミニゲームが書けます。
|
You can write simple mini games with minimum statement (cls, locate, print) handling WonderWitch's text screen and minimum button input function (wait, scan).
|
||||||
WonderSwan Color使用時には4色カラーモードが可能です。
|
When WonderSwan Color is used, 4 color mode is possible.
|
||||||
動作テスト用にWin32上で動くバイナリーもありますが、これは、BASIC本体の動作確認用と割り切ってください。
|
There is also a binary that runs on Win32 for the operation test, but please divide this for the operation check of BASIC body.
|
||||||
ドキュメントは、ちょっと見難いかもしれませんが、有志が見やすいものを作ってくれることを期待します。
|
The document may be a little difficult to see, but I hope that volunteers will make things that are easy to see.
|
||||||
|
|
||||||
●必要なもの
|
● What you need
|
||||||
・開発時
|
・ During development
|
||||||
WonderWitchのカートリッジとシリアルケーブル。38400bpsの無手順通信が可能な通信ソフトを持つパソコン等。
|
WonderWitch cartridge and serial cable. Personal computers with communication software capable of non-procedural communication at 38,400 bps.
|
||||||
・実行時
|
・runtime
|
||||||
ワンべぇと実行したプログラムを入れてあるWonderWitchのカートリッジのみ
|
Only the cartridge of WonderWitch containing the executed program with the one way
|
||||||
|
|
||||||
●準備
|
● Preparation
|
||||||
・TransMagicなどでワンべぇ(fonbe.fx)をWonderWitchに転送します。
|
・ Transfer one side (fonbe.fx) to WonderWitch with TransMagic etc.
|
||||||
・TransMagicなどの接続を切り、通信ソフトから38400bpsの無手順通信を開始します
|
・ Disconnect the TransMagic etc. and start the non-procedure communication at 38400 bps from the communication software
|
||||||
・WonderWitch上でワンべぇを実行します
|
・ Run one-speed on WonderWitch
|
||||||
・エントランスメニュー画面でY2を押します
|
・ Press Y2 on the entrance menu screen
|
||||||
・通信ソフトに、ワンべぇの名前が表示され、"*Ready"と出ます
|
・ The name of the one-piece is displayed in the communication software and "* Ready" appears
|
||||||
・これで準備完了です
|
・ You are now ready
|
||||||
・print "hello!"リターンと打ってWonderWitchの画面を見てください。文字が出ていれば正常です。
|
・ Print "hello!" Return and hit the WonderWitch screen. It is normal if letters appear.
|
||||||
|
|
||||||
●開発済みプログラムの実行
|
● Execution of developed programs
|
||||||
・WonderWitch上でワンべぇを実行します
|
・ Run one-speed on WonderWitch
|
||||||
・エントランスメニュー画面で実行したいファイルを選んでAボタンを押します
|
・ On the entrance menu screen, select the file you want to execute and press the A button
|
||||||
|
|
||||||
●開発環境の概要
|
● Overview of development environment
|
||||||
通常の行番号ベースのエディタが使えます。
|
You can use a normal line number based editor.
|
||||||
行番号に引き続いて1行を入力してリターンを押すと、プログラムに記録されます。
|
After entering one line following the line number and pressing return, it is recorded in the program.
|
||||||
行番号だけを入力してリターンを押すとその行は削除されます。
|
If you enter only the line number and press Return, the line will be deleted.
|
||||||
行番号無しで命令を入力すると即座に実行されます。
|
If you enter an instruction without a line number, it will be executed immediately.
|
||||||
編集はバックスペースによる1文字削除しか使えません。通信ソフトからホスト上のエディタにCOPY&PASTEして、エディタ上で編集してから、通信ソフトに貼り付けてワンべぇに送ると便利です。ただし、フロー制御が無いので、複数行まとめて貼り付けると文字落ちが生じます。張り付けは1行単位で行ってください。プログラムはホスト上で編集してあらかじめTransMagicなどで送信しておくのも有効な手段です。
|
Editing can only use one character deletion by backspace. COPY & PASTE from the communication software to the editor on the host, edit it on the editor, paste it on the communication software and send it to the one side is convenient. However, there is no flow control, so if you paste multiple lines at once, character dropout will occur. Please do sticking on a line-by-line basis. It is also effective to edit the program on the host and send it by TransMagic etc. beforehand.
|
||||||
現状では2Kバイト以上のプログラムを作成してもsaveコマンドで保存できません。listコマンドを実行してから通信ソフト上でCOPY&PASTEしてホスト上に保存してください。
|
Even if you create a program of 2 KB or more at present, you can not save with the save command. Execute the list command, COPY & PASTE on the communication software and save it on the host.
|
||||||
実行中は、STARTボタンを押すといつでも対話モードに戻れます。その後、contステートメントで実行を継続できます。
|
During execution, you can return to the interactive mode at any time by pressing the START button. You can then continue with the cont statement.
|
||||||
中間言語に翻訳してから処理するため、中間言語に翻訳できない場合は、入力直後にエラーが出ます。
|
Since it is processed after translating it into an intermediate language, if it can not be translated into an intermediate language, an error will be issued immediately after input.
|
||||||
|
|
||||||
●言語の概要
|
● Language overview
|
||||||
ごく軽いBASIC言語です。
|
It is a very light BASIC language.
|
||||||
昔あったTiny BASICに近い構文を持っています。
|
I have a syntax similar to Tiny BASIC that used to be.
|
||||||
データ型は、符号付き16bit整数だけです。
|
The data type is only a signed 16 bit integer.
|
||||||
定数は、-32767~32767の10進数か、0x0000~0xffffの16進数で記述できます。-32768は変数には記憶できますが、ソースには書けません。(-32767-1のように書いてください)
|
Constants can be described as decimal numbers from -32767 to 32767 or hexadecimal numbers from 0x0000 to 0xffff. - 32768 can be stored in variables, but it can not be written in source. (Please write like -32767-1)
|
||||||
変数は、グローバル変数として、A~Zのアルファベット大文字1文字のものが26個あります。
|
Variables have 26 alphabetic capital letters of A to Z as global variables.
|
||||||
ローカル変数として、a~zのアルファベット小文字1文字のものが26個あります。ローカル変数はgosubステートメントを実行したときに新しい領域が割り当てられ、returnステートメントを実行したときにgosubする前の領域が戻ってきます。
|
As local variables, there are 26 alphabet lowercase letters a through z. A local variable is allocated a new area when the gosub statement is executed and the area before gosub is returned when the return statement is executed.
|
||||||
配列変数は@(インデックス)という形式の1次元配列だけが使用できます。使用可能なサイズは、プログラム記憶領域(48Kバイト)の残りサイズに等しくなります。インデックスは0から始まります。(例: for i=0 to 9:print @(i):next)
|
Array variables can only be one-dimensional arrays of the form @ (index). The available size is equal to the remaining size of the program storage area (48 Kbytes). The index starts at 0. (Eg for i = 0 to 9: print @ (i): next)
|
||||||
演算子の優先順位は「単項演算子 > */ > +- > 比較演算子 > and,or,xor」となります。(比較演算子は、<と>と=で記述する演算子すべて)
|
Operator precedence is "unary operator> * /> + -> comparison operator> and, or, xor". (Comparison operator is all operators described with <and> and =)
|
||||||
計算順序は、括弧()を使って明示的に変更できます。
|
The calculation order can be changed explicitly with parentheses ().
|
||||||
オーバーフロー、アンダーフローのチェックはありません。溢れは無視されます。ただしゼロ除算はエラーになります。
|
There is no overflow or underflow check. Overflow is ignored. However, division by zero results in an error.
|
||||||
ステートメントなどのキーワードはすべてアルファベット小文字で入力します。大文字を使っても小文字になります。
|
Enter all keywords such as statements in lowercase alphabet. Even using uppercase letters will be lowercase.
|
||||||
|
|
||||||
● ステートメント一覧
|
● Statement list
|
||||||
|
|
||||||
変数 = 式
|
Variable = expression
|
||||||
式を計算して変数に代入します。letキーワードはサポートしていません。
|
Calculate the expression and assign it to the variable. The let keyword is not supported.
|
||||||
例: a=b+c
|
Example: a = b + c
|
||||||
|
|
||||||
if 式 then ステートメント列
|
if expression then statement column
|
||||||
式が0でなければステートメント列を実行します。0なら次の行から実行を継続します。elseはありません。
|
If the expression is not 0, execute the statement column. If it is 0, execution continues from the next line. There is no else.
|
||||||
例: if (a=0) and (b=1) then goto 200
|
For example: if (a = 0) and (b = 1) then goto 200
|
||||||
|
|
||||||
print [文字列|式|chr(式)][,|;]...
|
print [character string | expression | chr (expression)] [, |;] ... ...
|
||||||
WonderWitchのテキスト画面の現在のカーソル位置から文字を表示します。
|
Display characters from WonderWitch's text screen's current cursor position.
|
||||||
式の前後に空白文字が入ることはありません。
|
There is no space character before or after the expression.
|
||||||
chr(式)は、式の値を文字コードと見なして表示します。
|
chr (expression) displays the value of the expression as a character code and displays it.
|
||||||
制御コードは扱いませんので、WonderWitchのキャラクタージェネレータにあるすべての文字が表示できます。
|
Since control codes are not handled, all characters in WonderWitch's character generator can be displayed.
|
||||||
区切り文字の;は何もしません。,はタブストップ位置までカーソルを進めます。
|
The delimiter "; does nothing. ,, Advances the cursor to the tab stop position.
|
||||||
print文の最後は;または,で終わった場合は改行しません。
|
The end of the print statement ends with; or, it does not break a line.
|
||||||
例: print "計算結果=",chr(34);1+2;chr(34)
|
Example: print "calculation result =", chr (34); 1 + 2; chr (34)
|
||||||
|
|
||||||
locate 式,式
|
locate expression, expression
|
||||||
WonderWitchのテキスト画面の現在のカーソル位置を設定します。引数はx,yの順番です。
|
Set the current cursor position on the WonderWitch text screen. The arguments are in the order of x and y.
|
||||||
例: locate 10,10
|
Example: locate 10, 10
|
||||||
|
|
||||||
cls
|
cls
|
||||||
WonderWitchのテキスト画面を消去します。
|
Delete the WonderWitch text screen.
|
||||||
例: cls
|
Example: cls
|
||||||
|
|
||||||
goto 式
|
goto expression
|
||||||
式の行番号に飛びます。計算型goto文が可能です。つまり、goto A*100とすると、Aが1のきは100行目に。2のときは200行目に飛びます。
|
Jump to the line number of the formula. Calculated goto statements are possible. That is, if you set goto A * 100, A will be on the 100th line when the A is on. If it is 2, it jumps to line 200.
|
||||||
例: goto 100
|
Example: goto 100
|
||||||
|
|
||||||
gosub 式
|
gosub expression
|
||||||
スタックに現在位置とローカル変数を積んで、式の行番号に飛びます。gotoと同じく計算型gosubが可能です。
|
Put the current position and local variable on the stack and jump to the line number of the expression. Calculated gosub is possible as well as goto.
|
||||||
スタックはforと合わせて8レベルまでです。
|
The stack is up to 8 levels in combination with for.
|
||||||
例: gosub 100
|
Example: gosub 100
|
||||||
|
|
||||||
return
|
return
|
||||||
gosubがスタックに積んだ情報を取り出して、そこに処理を戻す。ローカル変数も戻る。
|
It retrieves the information gosub loaded on the stack and returns the processing to it. Also return local variables.
|
||||||
例: return
|
Example: return
|
||||||
|
|
||||||
for 変数=式 to 式
|
for variable = expression to expression
|
||||||
for 変数=式 to 式 step 式
|
for variable = expression to expression step expression
|
||||||
変数の値を変化させながらnextまで繰り返します。
|
Repeat until next while varying the value of the variable.
|
||||||
最後の変数の値が終値に一致せず、終値+ステップ値がオーバーフローする場合は無限ループする可能性があります。そのような値は指定しないように注意してください。
|
If the value of the last variable does not match the closing price and the closing price + step value overflows, there is a possibility of an infinite loop. Please be careful not to specify such a value.
|
||||||
例: for i=0 to 10 step 2
|
Example: for i = 0 to 10 step 2
|
||||||
|
|
||||||
next
|
next
|
||||||
forステートメントの位置に戻って動作を繰り返します。forステートメントで示した条件が満たされた場合は、nextの次に動作が進みます。nextの後に変数名を書くとエラーになります。
|
Go back to the position of the for statement and repeat the operation. If the condition indicated in the for statement is satisfied, the operation proceeds next. Writing the variable name after next will result in an error.
|
||||||
例: next
|
Example: next
|
||||||
|
|
||||||
end
|
end
|
||||||
プログラムの実行を終了します。
|
End program execution.
|
||||||
|
|
||||||
break
|
break
|
||||||
その位置で一時的に実行を中断します。contステートメントで実行を継続できます。
|
Temporarily suspend execution at that position. You can continue execution with the cont statement.
|
||||||
|
|
||||||
rem 文字列
|
rem String
|
||||||
'文字列
|
'String
|
||||||
コメントを記述します。後ろに:を置いてステートメントを続けることはできません。
|
Write a comment. You can not put a statement behind the statement:
|
||||||
例: rem これはテストプログラムです。
|
Example: rem This is a test program.
|
||||||
例: 'この式が座標を計算します
|
Example: 'This expression calculates coordinates
|
||||||
|
|
||||||
new
|
new
|
||||||
メモリ上のプログラムを消去します。
|
Erases the program in memory.
|
||||||
|
|
||||||
list [行番号][-][行番号]
|
list [line number] [-] [line number]
|
||||||
指定範囲の行番号のプログラムをリストします。すべて省略すると全行をリストします。
|
List programs with line numbers in the specified range. If omitted all the lines are listed.
|
||||||
|
|
||||||
run
|
run
|
||||||
run 式
|
run expression
|
||||||
run 文字列
|
run String
|
||||||
プログラムを実行します。それに先だって変数やスタックがクリアされます。
|
Execute the program. Prior to that, variables and stacks are cleared.
|
||||||
runはメモリ上のプログラムを先頭から。run 式は、式の行番号から。run 文字列は文字列のファイルを読み込んでそれを実行します。
|
run is from the top of the program in memory. The run expression is from the line number of the expression. The run string reads a string file and executes it.
|
||||||
例: run
|
Example: run
|
||||||
例: run 100
|
Example: run 100
|
||||||
例: run "test.wb"
|
Example: run "test.wb"
|
||||||
|
|
||||||
cont
|
cont
|
||||||
breakステートメントやSTARTボタンによるブレークによって停止した位置から実行を再開します。
|
Execution resumes from the position stopped by a break statement or a break by the START button.
|
||||||
|
|
||||||
save 文字列
|
save String
|
||||||
文字列をファイル名としてメモリ上のプログラムを保存します。保存されるのは内部表現ではなくテキスト形式です。
|
Save the program in memory with the string as the file name. It is saved in text format, not internal representation.
|
||||||
現在はWonderWitchのファイルシステムの制約上、2Kバイトを超えるファイルを保存できません。listコマンドで端末にリストを送ってそれをCOPY&PASTEして保存してください。
|
Currently, due to restrictions of WonderWitch's file system, files exceeding 2 K bytes can not be saved. Please send the list to the terminal with the list command, COPY & PASTE it and save it.
|
||||||
例: save "hello.wb"
|
Example: save "hello.wb"
|
||||||
|
|
||||||
load 文字列
|
load string
|
||||||
文字列をファイル名としてファイルからプログラムを読み込みます。読み込むのはテキスト形式で、改行はCRLFとLFのどちらでも可です。中間言語に翻訳できない行がある場合はそこで読み込みが中断されます。プログラムの実行中に使用した場合は実行は中断されます。
|
Load a program from a file with a string as a file name. It reads in text format, and line feed can be either CRLF or LF. If there are lines that can not be translated into an intermediate language, reading is interrupted there. Execution is interrupted when used during program execution.
|
||||||
例: load "hello.wb"
|
Example: load "hello.wb"
|
||||||
|
|
||||||
merge 文字列
|
merge string
|
||||||
メモリ上のプログラムにファイル上のプログラムを混ぜ合わせます。同じ行番号の行は読み込まれる方が優先されます。中間言語に翻訳できない行がある場合はそこで読み込みが中断されます。プログラムの実行中に使用した場合は実行は中断されます。
|
Mix the program in the file with the program in the memory. The line with the same line number will be given priority when it is read. If there are lines that can not be translated into an intermediate language, reading is interrupted there. Execution is interrupted when used during program execution.
|
||||||
例: load "merge.wb"
|
Example: load "merge.wb"
|
||||||
|
|
||||||
randomize 式
|
randomize expression
|
||||||
乱数の初期値を指定します。これを使わないと必ず同じ順序で乱数が発生します。引数には、システム変数tickを指定すると最適です。
|
Specify the initial value of the random number. If you do not use this, random numbers will always occur in the same order. For the argument, it is best to specify the system variable tick.
|
||||||
例: randomize tick
|
Example: randomize tick
|
||||||
|
|
||||||
exit
|
exit
|
||||||
ワンべぇを抜けてOSに戻ります。
|
I will go back to the OS by going through one page.
|
||||||
|
|
||||||
debug [文字列|式|chr(式)][,|;]...
|
debug [string | expression | chr (expression)] [, |;] ... ...
|
||||||
printステートメントと同等ですが、WonderWitchの画面ではなく、シリアルポートに送ります。単体で実行する場合には使えないデバッグ専用の機能です。
|
It is equivalent to the print statement but sends it to the serial port instead of the WonderWitch screen. It is a function dedicated to debugging that can not be used when executing by itself.
|
||||||
|
|
||||||
waitvb 式
|
waitvb expression
|
||||||
式の回数だけVBLANKを待ちます。待っている間はSTARTボタンによるブレークを受け付けなくなるので、指定できる値は750までと制限されています。750を超える値を指定するとエラーになります。
|
Wait for VBLANK for the number of expressions. While waiting, the START button break will not be accepted, so you can limit the value to 750. An error will occur if you specify a value greater than 750.
|
||||||
例: waitvb 75
|
Example: waitvb 75
|
||||||
|
|
||||||
files
|
files
|
||||||
カレントディレクトリのファイル一覧をシリアルポートに送ります。単体で実行する場合には使えないデバッグ専用の機能です。
|
Send the file list of the current directory to the serial port. It is a function dedicated to debugging that can not be used when executing by itself.
|
||||||
|
|
||||||
play 文字列
|
play String
|
||||||
引数の文字列をMMLとして再生します。使用可能にするには「● playステートメントを有効にする方法」を参照してください。
|
Play the argument string as MML. To enable it, see "How to activate the play statement".
|
||||||
例: play "cde"
|
Example: play "cde"
|
||||||
|
|
||||||
poke 式,式
|
poke expression, expression
|
||||||
最初の式をオフセット、2番目の式を値と見なし、システム変数defsegのセグメントに1バイトのメモリ書き込みを行います。
|
We regard the first expression as an offset, the second expression as a value, and write 1 byte of memory to the segment of the system variable defseg.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
注意:csegのセグメントはフラッシュメモリなのでpokeでは書き込めません。
|
Note: Since the segment of cseg is flash memory, it can not be written by poke.
|
||||||
|
|
||||||
call 式
|
call expression
|
||||||
式をオフセットと見なし、システム変数defsegのセグメントにマシン語レベルのサブルーチンコール(FAR)を行います。コールする前にシステム変数AX,BX,CX,DX,SI,DI,DS,ESがそれぞれのレジスタに設定されます。リターン後のレジスタ状態はシステム変数AX,BX,CX,DX,SI,DI,ESに保存されます。(注:DSは戻りません)
|
Assume the expression as an offset and do a machine language level subroutine call (FAR) on the segment of the system variable defseg. Before calling, the system variables AX, BX, CX, DX, SI, DI, DS, ES are set in their respective registers. The register state after return is saved in the system variables AX, BX, CX, DX, SI, DI, ES. (Note: DS will not return)
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
int 式
|
int expression
|
||||||
式を割り込み番号と見なし、マシン語レベルのシステム割り込み(int)を行います。WonderWitchのBIOSを呼び出すことができます。コールする前にシステム変数AX,BX,CX,DX,SI,DI,DS,ESがそれぞれのレジスタに設定されます。リターン後のレジスタ状態はシステム変数AX,BX,CX,DX,SI,DI,ESに保存されます。(注:DSは戻りません)
|
We regard the expression as an interrupt number and perform a system interrupt (int) at machine language level. You can call WonderWitch's BIOS. Before calling, the system variables AX, BX, CX, DX, SI, DI, DS, ES are set in their respective registers. The register state after return is saved in the system variables AX, BX, CX, DX, SI, DI, ES. (Note: DS will not return)
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
tron
|
tron
|
||||||
トレースモードをオンにします。トレースモードに入ると、新しい行の実行始めるごとに、行番号をデバッグコンソールに送信します。
|
Turn on trace mode. When entering trace mode, each time you start executing a new line, it sends the line number to the debug console.
|
||||||
|
|
||||||
troff
|
troff
|
||||||
トレースモードをオフにします。
|
Turn off trace mode.
|
||||||
|
|
||||||
colormode 式
|
colormode expression
|
||||||
カラーモードを設定します。WonderSwan Colorでのみ使用できます。
|
Set the color mode. Can be used only with WonderSwan Color.
|
||||||
式の値は以下の通りです。
|
The values ??of the expressions are as follows.
|
||||||
0x00 モノクロモード
|
0x00 monochrome mode
|
||||||
0x80 4色モード
|
0x80 4 color mode
|
||||||
0xC0 16色モード (設定できますがワンべぇの機能からは描画できません)
|
0xC0 16 color mode (It can be set but it can not be drawn from the function of the one side)
|
||||||
0xE0 16色PACKEDモード (設定できますがワンべぇの機能からは描画できません)
|
0xE0 16 color PACKED mode (It can be set but it can not be drawn from the function of the one side)
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
color 式,式
|
color expression, expression
|
||||||
描画する文字の色を指定します。最初の式が前景色のインデックス、2番目の式が背景色のインデックスです。それぞれ、0~3のみ指定できます。
|
Specify the color of the character to be drawn. The first expression is the index of the foreground color, and the second expression is the index of the background color. Only 0 to 3 can be specified, respectively.
|
||||||
実行開始時の初期状態はcolor 3,0に相当する状態です。
|
The initial state at the start of execution is the state corresponding to color 3,0.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
palette 式,式,式,式
|
palette expression, expression, expression, expression
|
||||||
パレットを指定します。最初の式が設定するパレットのインデックス(0~3)を指定します。2番目から4番目の式が、それぞれ、R,G,Bの値を示します。R,G,Bの値はそれぞれ0~15の範囲内です。
|
Specify the palette. Specify the index (0 to 3) of the palette set by the first expression. The second to fourth expressions indicate the values ??of R, G, B respectively. The values ??of R, G, and B are each in the range of 0 to 15.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
例: palette 0,15,0,0
|
Example: palette 0, 15, 0, 0
|
||||||
|
|
||||||
● 2項演算子
|
● Binary operator
|
||||||
+ - * / < > = <= >= <> and or xor
|
+ - * / <> = <=> = <> and or xor
|
||||||
|
|
||||||
● 単項演算子
|
● Unary operator
|
||||||
- not
|
not
|
||||||
|
|
||||||
● 関数
|
● Function
|
||||||
|
|
||||||
rnd(式)
|
rnd (expression)
|
||||||
0から式-1までの範囲の乱数を返します。
|
Returns a random number in the range from 0 to expression -1.
|
||||||
|
|
||||||
abs(式)
|
abs (expression)
|
||||||
式の絶対値を返します。
|
Returns the absolute value of an expression.
|
||||||
|
|
||||||
varptr(変数)
|
varptr (variable)
|
||||||
指定した変数のオフセットを返します。
|
Returns the offset of the specified variable.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
varseg(変数)
|
varseg (variable)
|
||||||
指定した変数のセグメントを返します。
|
Returns the segment of the specified variable.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
peek(式)
|
peek (expression)
|
||||||
式をオフセットと見なし、システム変数defsegのセグメントから1バイトのメモリ読み出しを行います。
|
We regard the expression as an offset and read 1 byte of memory from the segment of the system variable defseg.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
● システム変数 (読み書き可能)
|
● System variables (readable and writable)
|
||||||
|
|
||||||
ax,bx,cx,dx,si,di,ds,es
|
ax, bx, cx, dx, si, di, ds, es
|
||||||
callおよびintステートメントを使用する際にレジスタの値を指定したり、リターン後のレジスタの値を保存するために使用します。
|
It is used to specify the register value when call and int statements are used and to save the value of the register after return.
|
||||||
|
|
||||||
defseg
|
defseg
|
||||||
peek関数、poke,callステートメントで使用されるセグメント値を保持します。初期値はdsegの値となります。
|
It holds segment value used in peek function, poke, call statement. The initial value is the value of dseg.
|
||||||
|
|
||||||
● システム変数 (読み出しのみ)
|
● System variables (read only)
|
||||||
|
|
||||||
scan
|
scan
|
||||||
WonderSwanのボタンの状態を調べ、1個の整数値として返します。SCAN_で始まるシステム変数とandを取ることで、どのボタンが押されているかどうか判定できます。STARTボタンは実行中断になるので、これは扱えません。
|
It examines the state of WonderSwan's button and returns it as one integer value. You can determine which button is pressed by taking a system variable beginning with SCAN_ and and. Since the START button is suspended, this can not be handled.
|
||||||
|
|
||||||
wait
|
wait
|
||||||
WonderSwanのボタンが押されるまで待ち、その状態を1個の整数値として返します。SCAN_で始まるシステム変数とandを取ることで、どのボタンが押されたか判定できます。STARTボタンは実行中断になるので、これは扱えません。
|
Wait until the button of WonderSwan is pressed and return its state as one integer value. By taking the system variable beginning with SCAN_ and and, you can determine which button was pressed. Since the START button is suspended, this can not be handled.
|
||||||
|
|
||||||
scan_a
|
scan_a
|
||||||
scan_b
|
scan_b
|
||||||
scan_x1
|
scan_x1
|
||||||
scan_x2
|
scan_x2
|
||||||
scan_x3
|
scan_x 3
|
||||||
scan_x4
|
scan_x 4
|
||||||
scan_y1
|
scan_y1
|
||||||
scan_y2
|
scan_y 2
|
||||||
scan_y3
|
scan_y 3
|
||||||
scan_y4
|
scan_y 4
|
||||||
それぞれのボタンのマスク値を示す定数を返します。
|
Returns a constant indicating the mask value of each button.
|
||||||
Aボタンが押されているかどうかを調べるには、下記の例のように記述します。
|
To check whether the A button is pressed, write it as in the example below.
|
||||||
例: if scan and scna_a then print "Aボタンが押さている"
|
Example: if scan and scna_a then print "A button is pressed"
|
||||||
|
|
||||||
tick
|
tick
|
||||||
システムタイマーのtickを返します。ただし、本来のtick値は符号無し32bit整数であり、ここで得られるのは16bit符号あり整数であることに注意が必要です。はみ出たbitは捨てられます。
|
Returns the system timer tick. However, it is important to note that the original tick value is an unsigned 32 bit integer, and that obtained here is a 16 bit signed integer. The overflowing bits are thrown away.
|
||||||
|
|
||||||
dseg
|
dseg
|
||||||
実行中のDSセグメントレジスタの値を返します。変数やワンべぇプログラムの中間言語コードはすべてこのセグメントにあります。
|
Returns the value of the DS segment register being executed. Variables and intermediate language code of the program are all in this segment.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
cseg
|
cseg
|
||||||
実行中のCSセグメントレジスタの値を返します。ワンべぇのプログラム本体がこのセグメントにあります。
|
Returns the value of the CS segment register being executed. One program's main program is in this segment.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
sseg
|
sseg
|
||||||
実行中のSSセグメントレジスタの値を返します。マシン語スタックがこのセグメントにあります。
|
Returns the value of the running SS segment register. There is a machine language stack in this segment.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
hardarch
|
hardarch
|
||||||
現在実行中のWonderSwanがColorモデルかどうかを返します。モノクロWonderSwanなら0。WonderSwan Colorなら1になります。
|
Returns whether or not WonderSwan currently running is a Color model. 0 for monochrome WonderSwan. WonderSwan Color will be 1.
|
||||||
Win32版では機能しません。
|
It does not work with the Win32 version.
|
||||||
|
|
||||||
● ファイル保存時の拡張子
|
● File extension
|
||||||
ワンべぇのソースフィルは、".wb"で終わるファイル名にしておいて下さい。loadなどのコマンドでは拡張子に関係なく読み込めますが、エントランスメニューに表示されるのは".wb"で終わるファイル名だけです。
|
Please make sure that the source fillet of one bee is a file name ending with ". Wb". You can load with commands such as load regardless of the extension, but only the filename that ends with ".wb" is displayed in the entrance menu.
|
||||||
|
|
||||||
● playステートメントを有効にする方法
|
● How to activate the play statement
|
||||||
sound.ilを、/rom0に転送しておいてください。このファイルが無いとplayステートメントを使用しても音が出ません。sound.ilが無ければ音が出ないだけで、プログラムは実行されます。
|
Transfer sound.il to / rom0. Without this file, no sound will be emitted even if you use the play statement. If there is no sound.il, the sound is not produced, and the program is executed.
|
||||||
Win32版では、クジラ飛行机さん作の"テキスト音楽「サクラ」"に含まれるdsakura.dllを用いてMMLを再生することができます。このソフトは、http://www.text2music.com/より入手できます。dsakura.dllは環境変数pathの通ったディレクトリならどこに置いても構いません。必要ファイルはこのDLLのみです。dsakura.dllが無ければ音が出ないだけで、プログラムは実行されます。ただし、MMLの仕様が完全に同じではないことに注意してください。なお、Win32版ではplayステートメント実行時にカレントディレクトリに$$$.midというファイルを生成します。実行終了後には削除して構いません。
|
In the Win32 version, you can play MML using dsakura.dll included in "text music" Sakura "by whale flying machine.This software is available from http://www.text2music.com/ You can put dsakura.dll anywhere you go through the environment variable path.The only file you need is this DLL.If you do not have dsakura.dll, the program will just run with no sounds However, please note that the specification of MML is not exactly the same.In Win32 version, a file called $$$. Mid is generated in the current directory when the play statement is executed.Delete it after the execution does not matter.
|
||||||
|
|
||||||
● 配布規則
|
Distribution rules
|
||||||
このバージョンより、本ソフトは、GNU General Public License (GPL)に従うものとしました。詳細はhttp://www.gnu.org/にあります。
|
From this version, we assume that this software follows the GNU General Public License (GPL). Details are at http://www.gnu.org/.
|
||||||
要するに、誰でも、どんな目的にも使用して良いということです。ただし、本ソフトを売ってはいけません。また、ソースコードは必ず公開しなければなりません。商品の中に収録することは可ですが、本ソフトを利用者が自由にコピーして配布することを妨げてはなりません。
|
In short, anyone can use it for any purpose. However, you should not sell this software. In addition, source code must be released. It is possible to record it in the product, but you should not prevent the user from freely copying and distributing this software.
|
||||||
2000年12月現在、ソースコードは株式会社ピーデーの川俣晶(autumn@piedey.co.jp)が管理しています。有益なソースコードの修正をフィードバックしてくれれば、こちらのソースツリーに反映します。
|
As of December 2000, the source code is managed by PD Kawamata Akira (autumn@piedey.co.jp). If you feed back useful source code fixes, it will be reflected in this source tree.
|
||||||
|
|
||||||
● 余談
|
Digression
|
||||||
ワンべぇは、私こと川俣が、20世紀への感謝と決別の気持ちで作ったものです。つまり、私にとって、マイコン/パソコンに出会ったという事件こそが、20世紀最大のイベントであり、そこで大きな役割を果たした超小型インタプリタ言語達、Tiny BASIC、VTL、GAME、TL/1は大きな印象を私の中に残したのです。そして、当時、私はプログラム言語を自分で作りたくて、一生懸命研究を重ねていたのも、また事実です。結局、いくつものトイ言語を開発しました。必要とあれば実用言語も作りました。ENIXのTOKYOナンパストリートをFM-7からPC-8801に移植するときにはメモリ効率を上げるために整数型の小型インタプリタを作ったりもしました。しかし、最終的に構造化アセンブラの匂いを微かに含んだ自作のZ-80用アセンブラ開発システムAZASをもって自作言語の世界は終着駅を迎えたわけです。この時点で、明らかに、Tiny BASICのような言語を開発する意味がなかったのです。必要な性能を得るためには、アセンブラレベルの開発が不可欠だったためです。作ることはできたけれど、作る意味は既に無かったのです。そして、時代が16bitの時代に移ると共に、私も自作言語を使うのはやめて、出来の良い既存の処理系を使うようになりました。MASM 1.27~, Turbo Pascal 3.0, Turbo C 1.5~2.0, MS-C 6.0~, Visual BASIC 1.0~, JDK 1.02~などなど。しかし、ふと20世紀も終わる頃に振り返ると、右も左も分からない少年時代に憧れたあのシンプルなTiny BASICが思い出されたわけです。だから、これこそが私にとっての20世紀そのもの、という気持ちを込めて作ったのです。
|
My name is Mr. Kawamata made by gratitude and discretion for the 20th century. In other words, for me, the incident that I encountered a microcomputer / personal computer was the biggest event of the 20th century, and the very small interpreter languages ??Tiny BASIC, VTL, GAME, TL / 1 played a big role there, have a big impression I left it inside of me. And, at that time, I also wanted to make programming languages ??by themselves, and it was also true that I worked hard. After all, I developed several toy languages. I also made a practical language if necessary. When porting TOKYO Nanpa Street of ENIX from FM - 7 to PC - 8801, I also made an integer type compact interpreter to increase memory efficiency. However, with the assembler development system AZAS of my own Z-80 which finally contained the odor of structured assembler finely, the world of my own language came to the terminal station. Clearly, at this point there was no point in developing a language like Tiny BASIC. Assembler level development was indispensable to obtain the necessary performance. I could make it, but I had no meaning to make. And, as I moved to the era of 16 bit era, I stopped using my own language and started to use a pretty good existing processing system. MASM 1.27 ~, Turbo Pascal 3.0, Turbo C 1.5 ~ 2.0, MS - C 6.0 ~, Visual BASIC 1.0 ~, JDK 1.02 ~ etc etc etc. However, when I look back at the end of the 20th century, I remembered that simple Tiny BASIC that I admired in a boyhood when I do not know right or left. That's why I made it with the feeling that this is the 20th century for me.
|
||||||
そのような訳で、これにはある種の世代性があります。BASICでゲームを作るというと、MSXとかベーマガという世代もいるようですが、はっきり言って、この世代にはワンべぇは理解できないと思います。MSXに搭載されたBASICは、超高機能巨大BASICであって、Tiny BASICとはまったく世代が違うのです。PC-8801やFM-7まで遡れる世代でも、まだ分からないでしょう。結局のところ、これが分かるためには、パソコンがパソコンと呼ばれる前、マイコンと呼ばれ、ケースに収まっておらず基板が剥き出しの状態で売られていた時代まで遡る必要があります。つまりは、そういう時代、何かを得ようとすれば手作りの要素が入り込んで当たり前の時代のロマンへ捧げるものが、このワンべぇと言うことになります。そして、そのロマンを再現するにふさわしい土台として、WonderWitchという製品がこの時代に登場したことも、不思議な縁だと思います。
|
That is why there are certain generations. To make games with BASIC, there seem to be generations such as MSX and Baumaga, but clearly speaking, I think that one generation can not understand this generation. BASIC on MSX is an ultra-high-performance huge BASIC, and the generation is completely different from Tiny BASIC. Even in generations back to PC - 8801 and FM - 7, you will not know yet. After all, in order to understand this, before the PC is called a personal computer, it is called a microcomputer, it is necessary to go back to the era when the board was sold in a bare state without fitting in the case. In other words, in such a period, what you sacrifice for a romantic era when you try to gain something, a handmade element enters and it is said to be this one. And, as a foundation suitable for reproducing that romance, I think that a product named WonderWitch appeared in this era also is a mysterious edge.
|
||||||
というわけで、私がワンべぇ利用者に言いたいことは一つです。このロマンを分かち合ってくれ。つまり、気に入らないところは、どんどん改造してくれ。好き勝手に改造して使えることを保証するために、ソースはGPLにしてあります。
|
So, there is one thing I would like to say to a user. Share this romance. In other words, if you do not like it, remodel it quickly. In order to guarantee that it can be used by remodeling freely as you like, the source is GPL.
|
||||||
|
|
||||||
● 同梱ワンべぇプログラム
|
● Included one-page program
|
||||||
▼デモ
|
▼ Demo
|
||||||
colordemo.wb
|
colordemo.wb
|
||||||
カラー機能のデモ (これのみWonderSwanColor用)
|
Demo of color function (only for WonderSwanColor)
|
||||||
▼ゲーム
|
▼ Game
|
||||||
ctb.wb
|
ctb.wb
|
||||||
落ち物ゲーム
|
Fall game
|
||||||
janken.wb
|
janken.wb
|
||||||
ジャンケンゲーム
|
Janken game
|
||||||
shoot.wb
|
shoot.wb
|
||||||
シューティングゲーム
|
shooting game
|
||||||
star.wb
|
star.wb
|
||||||
STAR TREK風ゲーム"STAR WITCH" (同梱star.txt参照)
|
STAR TREK-like game "STAR WITCH" (see bundled star.txt)
|
||||||
プログラムの書き方の参考にどうぞ
|
Please refer to how to write the program
|
||||||
▼テスト
|
▼ Test
|
||||||
test.wb
|
test.wb
|
||||||
簡単なインタプリタの動作テスト
|
Simple interpreter operation test
|
||||||
testcall.wb
|
testcall.wb
|
||||||
callステートメントの動作テスト
|
Testing the operation of the call statement
|
||||||
testcont.wb
|
testcont.wb
|
||||||
contステートメントの動作テスト
|
Testing the behavior of the cont statement
|
||||||
testfor.wb
|
testfor.wb
|
||||||
forステートメントの動作テスト
|
Test operation of for statement
|
||||||
testgosub.wb
|
testgosub.wb
|
||||||
gosubステートメントの動作テスト
|
Testing the operation of the gosub statement
|
||||||
testif.wb
|
testif.wb
|
||||||
ifステートメントの動作テスト
|
Operation test of if statement
|
||||||
testint.wb
|
testint.wb
|
||||||
intステートメントの動作テスト
|
Testing the operation of int statements
|
||||||
testlocate.wb
|
testlocate.wb
|
||||||
locateステートメントの動作テスト
|
Testing the operation of the locate statement
|
||||||
testlongloop.wb
|
testlongloop.wb
|
||||||
STARTキーによる中断のテスト
|
Test of interruption by START key
|
||||||
testpeekpoke.wb
|
testpeekpoke.wb
|
||||||
peek関数pokeステートメントのテスト
|
peek function test poke statement
|
||||||
|
|
||||||
● 変更履歴
|
● Change history
|
||||||
|
|
||||||
2001年1月29日 Ver 0.06
|
January 29, 2001 Ver 0.06
|
||||||
・WonderSwan Colorの開発キットに移行
|
・ Transfer to WonderSwan Color development kit
|
||||||
・colormode, palette, colorステートメント、hardarchシステム変数を追加
|
・ Add colormode, palette, color statement, hardarch system variable
|
||||||
・ドキュメントに余談を追加
|
・ Add a digression to the document
|
||||||
|
|
||||||
2000年12月10日 Ver 0.05
|
December 10, 2000 Ver 0.05
|
||||||
・Hirotaka JOE Ohkuboさんの差分(0.04j4)をマージ play文が使用可能に (要sound.il)
|
・ Hirotaka JOE Ohkubo's difference (0.04j4) can be merged with play statement (sound.il required)
|
||||||
・?をキーワードdebugと見なす
|
・ Consider? As the keyword debug
|
||||||
・then直後が10進整数値ならgotoの省略を許す
|
・ Allow goto to be omitted if immediately after it is a decimal integer value
|
||||||
・マシン語関連機能の追加
|
・ Addition of machine language related functions
|
||||||
・tron/troffコマンドの追加(実行行番号の表示)
|
・ Add tron ??/ troff command (display execution line number)
|
||||||
|
|
||||||
2000年11月12日 Ver 0.04
|
November 12, 2000 Ver 0.04
|
||||||
・13など0x0dを含む行番号を削除しようとするとプログラムが壊れたバグを取った
|
・ When trying to delete a line number including 0x0d such as 13, the program took a broken bug
|
||||||
・処理系をTurbo C2.0からVisual C++ 1.51に変更
|
・ Change processing system from Turbo C2.0 to Visual C ++ 1.51
|
||||||
・ロード速度を大幅に改善
|
・ Significantly improved loading speed
|
||||||
・エントランスメニューは.wbのみ表示
|
・ Only the .wb entrance menu is displayed
|
||||||
・サンプルゲームSTAR WITCH(star.wb, star.txt)を添付
|
・ Sample game STAR WITCH (star.wb, star.txt) attached
|
||||||
|
|
||||||
2000年11月7日 Ver 0.03
|
November 7, 2000 Ver 0.03
|
||||||
・演算子の優先順位 単項演算子 > */ > +- > 比較演算子 > and,or,xor
|
・ Operator precedence order Unary operator> * /> + -> Comparison operator> and, or, xor
|
||||||
・比較演算子成立時の値を1から-1に変更
|
・ Change the value when the comparison operator is established from 1 to -1
|
||||||
・プロンプトをOKに変更
|
・ Change prompt to OK
|
||||||
・print/debugで負数が正数として出力されていたバグを解消
|
- Fixed a bug that negative numbers were output as positive numbers by print / debug
|
||||||
・forの終値がピッタリ一致しなくてもnextでループ脱出するように変更
|
・ Changed so that loop can escape in next even if for closing price does not match exactly
|
||||||
2000年11月7日 Ver 0.02 scan_XXが機能しないバグを取った
|
November 7, 2000 Ver 0.02 scan_XX took a bug that does not work
|
||||||
2000年11月6日 Ver 0.01 最初のバージョン
|
November 6, 2000 Ver 0.01 First version
|
||||||
|
|
||||||
● 問い合わせ先
|
● Contact Information
|
||||||
株式会社ピーデー http://www.piedey.co.jp/
|
Paiday Co., Ltd. http://www.piedey.co.jp/
|
||||||
川俣 晶 autumn@piedey.co.jp
|
Kawamata Akira autumn@piedey.co.jp
|
||||||
|
|
||||||
以上
|
that's all
|
||||||
Loading…
x
Reference in New Issue
Block a user