User Tools


reference:all_references

All references

Exclusive Commands for Direct Mode

NEW

Erase the program in all program slots

・Direct Mode only

Example

NEW

NEW ProgramSlot

Erase the program in the specified program slot

・Direct Mode only

Argument

ProgramSlot

Program slot to erase: 0-5

Example

NEW 3

LIST

Switch to edit mode

・Direct Mode only

Example

LIST

LIST [ProgramSlot:]LineNumber

Switch to Edit Mode and move the cursor to the specified line number of the specified program slot

・Direct Mode only

Arguments

ProgramSlot

Specify the program slot to edit

・When not specified, the program slot currently being edited is specified.

LineNumber

Specify the line number you want to edit

Example

LIST 20
LIST 2:20

LIST ERR

Switch to Edit Mode and move the cursor to the position where the error occurred immediately before.

・Direct Mode only

Example

LIST ERR

RUN

Execute the program in program slot 0.

・Direct Mode only
・Variables, SPFUNC and TFUNC settings are cleared.

Example

RUN

RUN ProgramSlot

Execute the program in the specified program slot.

・Direct Mode only
・The variable of the specified slot, SPFUNC, TFUNC setting contents are cleared.

Argument

ProgramSlot

Program slot to execute: 0-5

Example

RUN 1

CONT

Resume execution of a stopped program.

・Direct Mode only
・The program can be resumed from the position where program execution was interrupted with the STOP command or Break button.
・If program execution stops due to an error, it cannot be resumed.
・After program execution is interrupted, it cannot be resumed if the program is edited.
・It cannot be resumed if it is interrupted while waiting for input.

Example

CONT

TRACE

Execute only one command of a stopped program

・Direct Mode only
・The program can be resumed from the position where program execution was interrupted with the STOP command or Break button.
・If program execution stops due to an error, it cannot be executed.
・If you edit a program after interrupting program execution, it cannot be executed.
・It cannot be executed if it is interrupted while waiting for input.

Example

TRACE

BACKTRACE

Display subroutine and user-defined commands call history

・Direct Mode only
・Display the call history up to the point where program execution was interrupted by the STOP command or an error stop.
・Display a list of program slot numbers and line numbers.

Example

BACKTRACE

PROJECT "ProjectName"

Changing the current project

・Direct Mode only

Argument

ProjectName

The name of the project you want to make current project

・If you specify an empty string "", the workspace project will be selected.

Example

PROJECT "MYGAME" 

SUBRUN FileNameString

Load the specified program on the subprogram side and start execution as a subprogram

・Direct Mode only
・Sub interpreter variables, SPFUNC, and TFUNC settings are cleared.

Argument

FileNameString

File name string of the program to be loaded as a subprogram

SUBSTOP

Stop the running subprogram from the main program side

・Direct Mode only

SUBSHOW

Display the subprogram display

・Direct Mode only

SUBHIDE

Hide the subprogram display

・Direct Mode only

CLEAR

Initialize BASIC internal memory

・Direct Mode only

Example

CLEAR

Variables and Arrays Definitions, Operation Related Commands

VAR Variable[=Expression][,Variable[=Expression]...]
DIM Variable[=Expression][,Variable[=Expression]...]

Define variables explicitly

・Either VAR or DIM can be used.
・Multiple variables can be defined simultaneously by separating them with commas.

Arguments

VariableNames

・Alphanumeric characters and underscores (_) can be used for variable names.
・You cannot use numbers at the beginning.

Expression

・The result of the expression becomes the initial value of the variable.
・If the expression is not specified, :Int type zero, #:Real type zero, $:empty string is set as the initial value by the type symbol (/#/$) at the end of the variable name.
・If the expression is not specified and the variable name has no type symbol, the default numeric type zero is set as the initial value.

Example

VAR A=0,B,C
DIM B$

VAR ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]
DIM ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]

Create an array and set it to a variable

・Either VAR or DIM can be used.

Arguments

ArrayVariableName

・If a type symbol (%/#/$) is added at the end of a variable name, an Int array, Real array, and string array are created respectively.
・If the type symbol is not specified, a default numeric type array is created.

NumberOfElements

・Specify the number of array elements to be secured with [].
・The number of elements can be created up to a 4D array by separating them with commas.
・If the number of elements is not specified, a 1D array with zero elements is created.

Example

VAR ATR[4]
VAR DX[5],DY[5],DZ[5]
DIM POS$[10,5]
DIM IMAGE[]

VAR ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]=[Value1,Value2,...]
DIM ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]=[Value1,Value2,...]

Create an array, set the value of the element in advance and set it to the variable

・Either VAR or DIM can be used.

Arguments

ArrayVariableName

・If a type symbol (%/#/$) is added at the end of a variable name, an Int array, Real array, and string array are created respectively.
・If the type symbol is not specified, a default numeric type array is created.

NumberOfElements

Specify the number of array elements to be secured with []

・The number of elements can be created up to a 4D array by separating them with commas.
・If the number of elements is not specified, a 1D array with zero elements is created.

Value

List of values to set as initial values for array elements

・If the number of elements is not specified, the number of values is a 1D array of the number of elements.

Example

VAR ATR[4]=[1,2,3,4]
DIM POS$[10,5]=["X","Y","Z","W"]
DIM IMAGE[]=[0,1,2,3,4]

Variable = Expression

Substitute the result of an expression into a variable

・If OPTION STRICT is not defined, the variable is automatically defined when trying to assign to an undefined variable.
・If OPTION STRICT is defined, an Undefined Variable error will occur when trying to assign to an undefined variable.

Example

A=10
B=A*6
C[4]=A+B

SWAP Variable1,Variable2

Exchange values in two variables

Argument

Variable1,Variable2

Two variables whose values are to be exchanged

Example

SWAP A,B
SWAP A[5],B[2]

INC Variable[,Expression]

Add the result of the expression to the value in the variable

Arguments

Variable

Variable to manipulate

Expression

The value to add

・If not specified, it's 1.

Example

INC X
INC X,3

DEC Variable[,Expression]

Subtract the result of the expression from the value in the variable

Arguments

Variable

Variable to subtract

Expression

The value to subtract

・If not specified, it's 1.

Example

DEC X
DEC X,3

COPY(CopySourceArray[,CopySourceOffset[,NumberOfCopyElements]])

Copy an array

Arguments

CopySourceArray

Copy source array

・Only 1D arrays can be specified.

CopySourceOffset

First element number of copy source

・If not specified, it's 0.

NumberOfCopyElements

Number of elements to copy

・If not specified, the number of elements in the copy source array minus the copy source offset is specified.

Return Value

Copy result array

・In the case of string array, the string of each element is also copied.

COPY(CopySourceString[,CopySourceOffset[,NumberOfCopyCharacters]])

Copy the string

Arguments

CopySourceString

Copy source string

CopySourceOffset

Copy source start position

・If not specified, it's 0.

NumberOfCopyCharacters

Number of characters to copy

・If not specified, the number of characters in the copy source string minus the copy source offset is specified.

Return Value

Copy result string

COPY CopyDestinationArray[,CopyDestinationOffset],CopySourceArray[[,CopySourceOffset],NumberOfCopyElements]

Copy the contents of an array to another array

・For 1D arrays only, if the copy destination array has fewer elements than the copy source array, it is automatically expanded.
・The dimensions of the array are ignored for both the copy source and the copy destination.

Arguments

CopyDestinationArray

Copy destination array

CopyDestinationOffset

First element number of the copy destination

・If not specified, it's 0.

CopySourceArray

Copy source array

CopySourceOffset

First element number of copy source

・If not specified, it's 0.

NumberOfCopyElements

Number of elements to copy

・If not specified, the number of elements in the copy source array minus the copy source offset is specified.

Example

DIM SRC[10],DST[10]
COPY DST,SRC

COPY CopyDestinationArray[,CopyDestinationOffset],LabelString[,NumberOfCopyData]

Read DATA column into array

・Read the data defined by the DATA statement into the array.
・If the number of array elements is less than the number of copy data, only 1D arrays are automatically expanded if the number of elements in the copy destination array is insufficient.

Arguments

CopyDestinationArray

Copy destination array

CopyDestinationOffset

First element number of the copy destination

・If not specified, it's 0.

LabelString

Label name string indicating the DATA statement you want to read

・Reading starts from the DATA statement that appears first after the label name.

NumberOfCopyData

Number of data to be read

・An error occurs if the number of data that can be read is less than the value specified here.
・If not specified, the number of elements in the copy destination array is specified.

Example

DIM DST[5]
COPY DST,"@SRC" 
@SRC
DATA 5,1,1,2,4

COPY CopyDestinationStringVariable[,CopyDestinationOffset],CopySourceString[[,CopySourceOffset],NumberOfCopyCharacters]

Copy part or all of a string to another string variable

Arguments

CopyDestinationStringVariable

Copy destination string variable

CopyDestinationOffset

Copy start position

・If not specified, it's 0.

CopySourceString

Copy source string

CopySourceOffset

Copy source start position

・If not specified, it's 0.

NumberOfCopyCharacters

Number of characters to copy

・If not specified, the number of characters in the copy source string minus the copy source offset is specified.

Example

COPY A$,"12345" 

RINGCOPY CopyDestinationArray,CopyDestinationOffset,CopySourceArray[[,CopySourceOffset],NumberOfCopyElements]
RINGCOPY CopyDestinationArray,CopyDestinationOffset,CopySourceArray[[,CopySourceOffset],NumberOfCopyElements] OUT Variable

Recognize array as ring buffer and copy data to it

・Similar to the COPY command, the value between arrays is copied, but even if the number of copy elements at the copy source is larger than the copy destination, the number of elements is not expanded and the data is copied by folding back to the beginning of the array.
・You can specify up to a 2D array for both the copy destination and copy source. When a 2D array is specified, it is handled as a multi-channel ring buffer (or data).
・If a 2D array is specified for both the copy destination and the copy source, the number of channels (number of elements in the first dimension) must be the same.
・When the copy destination is 2D and the copy source is a 1D array, the copy source data is copied to all channels of the copy destination in the same way.
・Operation is not guaranteed if the copy destination and copy source are the same array.

Arguments

CopyDestinationArray

Array treated as a copy destination ring buffer

CopyDestinationOffset

Copy start position at the copy destination

CopySourceArray

Copy source array

CopySourceOffset

Copy start position at the copy source

・0, if not specified.

NumberOfCopyElements

Number of elements to copy

・If not specified, it's the number of elements in the copy source array.

Return Value

End position of copied data

・When handled as a ring buffer, the returned value is the next copy destination offset.

SORT [StartPosition,NumberOfElements,]Array1[,Array2,...]

Sort the array in ascending order

Arguments

StartPosition

Position to start sorting in Array1

・0, if not specified.

NumberOfElements

Number of elements to sort

・If not specified, it's the number of elements in Array1.

Array1

An array containing the numbers to sort

Array2

Array to be sorted in conjunction with the sorting result of Array1.

・Array 2 to 8 can be omitted.
・Array 2 to 8 can be string arrays.

Example

DIM WORK[10]
SORT 0,10,WORK

RSORT [StartPosition,NumberOfElements,]Array1[,Array2,...]

Sort the array in descending order

Arguments

StartPosition

Sort start position in Array1

・0, if not specified.

NumberOfElements

Number of elements to sort

・If not specified, it's the number of elements in Array1.

Array1

An array containing the numbers to sort

Array2

Array to be sorted in conjunction with the sorting result of Array1.

・Array 2 to 8 can be omitted.
・Array 2 to 8 can be string arrays.

Example

DIM WORK[10]
RSORT 0,10,WORK

PUSH Array,Expression

Add elements to the end of an array

・The number of elements increases by one.

Arguments

Array

The array to add the element to

Expression

The value of the element to add

Example

DIM WORK[10]
PUSH WORK,123

POP(Array)

Extract elements from the end of an array

・The number of elements reduces by one.

Argument

Array

The array whose elements are to be retrieved

Return Value

The value of the extracted element

Example

DIM WORK[10]
PUSH WORK,123
A=POP(WORK)

UNSHIFT Array,Expression

Add elements to the beginning of an array

・The number of elements increases by one.

Arguments

Array

The array to add the element to

Expression

The value of the element to add

Example

DIM WORK[10]
UNSHIFT WORK,123

SHIFT(Array)

Extract elements from the beginning of an array

・The number of elements reduces by one.

Argument

Array

The array whose elements are to be retrieved

Example

DIM WORK[10]
UNSHIFT WORK,123
A=SHIFT(WORK)

FILL Array,Value[,Offset[,NumberOfElements]]

Set all array contents to the specified value

・The array type may be an Int, Real or string.
・Partial change is possible by specifying offset and number of elements.

Arguments

Array

Array to overwrite values

Value

Number or string

Offset

The position at which to start writing the value

NumberOfElements

Number to write

Example

DIM WORK[10]
FILL WORK,0

TYPEOF(Value)

Find the value type

Argument

Value

The value whose type is to be examined

Return Value

Depending on the value type, one of the following numbers is returned:

0 Default Type #T_DEFAULT
1 Int type #T_INT
2 Real Type #T_REAL
3 String Type #T_STR
5 Int Array #T_INTARRAY
6 Real Array #T_REALARRAY
7 String Array #T_STRARRAY

・The default type is a special type that is set when an argument is not specified in a function/command call.

ARRAY%(NumberOfElements[,NumberOfElements...])
ARRAY#(NumberOfElements[,NumberOfElements...])
ARRAY$(NumberOfElements[,NumberOfElements...])

Create an array

・Use this when you want to create an array other than when defining a variable with VAR.
・ARRAY% creates an Int array, ARRAY# creates a Real array, and ARRAY$ creates a string array.

Argument

NumberOfElements[,NumberOfElements...]

Array dimensions and number of elements to create

Return Value

Created array

DIM(Array)
DIM(Array,Dimension)

Check the number of array dimensions and the number of elements in each dimension

Arguments

Array

The array to check

Dimension

Dimension to check the number of elements: 0 to 3

・If not specified, the number of array dimensions is returned.

Return Value

・If a dimension is specified, the number of elements in the specified dimension is returned.
・If the dimension is not specified, the number of array dimensions is returned.

Example

DIM WORK[10,20]
? DIM(WORK)
? DIM(WORK,0)
? DIM(WORK,1)

RESIZE Array,NumberOfElements[,NumberOfElements...]

Change the size of an array

・The numeric value 0 or an empty string is entered in the element of the extended part.

Arguments

Array

The array to resize

NumberOfElements

Number of elements after resizing

・You can change only the number of elements written first when defining an array.
・Dimensions cannot be changed.

INSERT Array,InsertionPosition[,NumberOfElements[,InitialValue]]

Insert elements into a 1D array

Arguments

Array

Array to increase elements

InsertionPosition

Element insertion position: 0 to the number of array elements

NumberOfElements

Number of elements to insert: positive number

・1, if not specified.

InitialValue

Insert element value

・If not specified, 0 for numeric arrays and empty string for character arrays.

REMOVE Array,DeletionPosition [,NumberOfElements]

Delete 1D array elements

Arguments

Array

The array to remove elements from

DeletionPosition

Element deletion position: 0 to number of array elements -1

NumberOfElements

Number of elements to delete: positive number

・1, if not specified.

FIND(Array,Value)

Search an array for a specified value and return the found position

Arguments

Array

Target array to search

・Multi-dimensional arrays can also be specified.

Value

The value to search for

Return Value

Found position

・If the value is not found, -1 is returned.

Example

DIM A[]=[1,2,3,4,5]
?FIND(A,3)

FIND Array,Value OUT Index1[,Index2...]

Search an array for a specified value and return the found position

Arguments

Array

Target array to search

・Multi-dimensional arrays can also be specified.

Value

The value to search for

Return Value

The index of the found position

・The number of returned values must be the same as the number of dimensions of the searched target array.
・If no value is found, -1 is returned for all return values.

Example

DIM A$[3,3]=["1","2","3","4","5","6","7","8","9"]
FIND A$, "4" OUT Y,X
?A$[Y,X]

INSPECT Value

Display detailed value information

・For type, value, and array, the number of elements and the values of all elements are displayed.
・For strings and string variables, the length of the string is also displayed.
・If the content of the string is too long, the rest is omitted.
・It can be abbreviated as ?? instead of using INSPECT.

Example

INSPECT A
?? "12345"*10

Control Commands

@Label

Identifier indicating the location of the program or data

・Define the jump destination specified by GOTO and GOSUB commands and the read destination of the READ command specified by the RESTORE command.
・The label is an identifier consisting of alphanumeric characters and underscore (_) with @ at the beginning.

Example

@MAINLOOP

GOTO @Label
GOTO String

Jump to the specified label position

Arguments

@Label

Jump destination label

String

You can also specify a string with a label name instead of a label.

・Program slot specification is possible in the format of "1:@LabelName".
・When specifying a program slot, make sure that the program in the target slot executable with the EXEC command in advance.

Example

GOTO @MAIN
JP$="@MAIN":GOTO JP$

GOSUB @Label
GOSUB String

Jump to the specified label position

・Unlike GOTO, the RETURN command returns to the next command of GOSUB.

Arguments

@Label

Jump destination label

String

You can also specify a string with a label name instead of a label.

・Program slot specification is possible in the format of "1:@LabelName".
・When specifying a program slot, make sure that the program in the target slot executable with the EXEC command in advance.

Example

GOSUB @SUB
JP$="@MAIN":GOSUB JP$

RETURN

Jump to the command following the GOSUB command used immediately before.

Example

RETURN

ON Expression GOTO @Label0,@Label1…

Branch to the label line corresponding to the value of the expression

Arguments

Expression

The jump destination is selected according to the value of the expression written here.

・The value must be numeric.

@Label0

Jump destination when the value of the expression is 0

@Label1

Jump destination when the value of the expression is 1

・Prepare as many destinations as you need.
・Strings cannot be used for the ON to GOTO labels.

Example

ON IDX GOTO @JMP_A,@JMP_B
PRINT OVER:END
@JMP_A
PRINT "IDX=0":END
@JMP_B
PRINT "IDX=1":END

ON Expression GOSUB @Label0,@Label1…

Branch to the label line corresponding to the value of the expression and return to the next command after ON GOSUB by using the RETURN command

Arguments

Expression

The jump destination is selected according to the value of the expression written here.

The value must be numeric.

@Label0

Jump destination when the value of the expression is 0

@Label1

Jump destination when the value of the expression is 1
:
・Prepare as many destinations as you need.
・Strings cannot be used for the ON to GOSUB labels.

Example

ON IDX GOSUB @SUB_A,@SUB_B
PRINT EXIT:END
@SUB_A
PRINT "IDX=0":RETURN
@SUB_B
PRINT "IDX=1":RETURN

ON BREAK GOTO @Label

Register the jump destination when the user tries to stop the program

・If you press the + Button during program execution, the program will normally stop. But, you use ON BREAK GOTO to jump to the specified label.
・Once you jump to the registered label, the registration is canceled.
・If the program stops due to an error, TRACE,STOP execution, forced stop by pressing + Button, programs start from the Top Menu, etc., it will not jump even if a label is registered.

Argument

@Label

Jump destination when program stops

Example

ON BREAK GOTO @FINISH
LOOP
ENDLOOP

@FINISH
PRINT "Stopped!" 

IF Expression THEN CodeBlock1
IF Expression THEN CodeBlock1 ELSE CodeBlock2

CodeBlock1 is executed when the value of the expression is true (other than 0)

If there is ELSE, execute CodeBlock2 when false (0)

・It's possible to not specify GOTO right after THEN and ELSE.

Example

IF A==1 THEN PRINT OK
IF A>1 THEN @JMP1 ELSE PRINT DATE$
@JMP1
END

IF Expression THEN [LineFeed] CodeBlock1 ENDIF
IF Expression THEN [LineFeed] CodeBlock1 ELSE [LineFeed] CodeBlock2 ENDIF

CodeBlock1 is executed when the value of the expression is true (other than 0)

If there is ELSE, execute CodeBlock2 when false (0)

・If a line feed occurs immediately after THEN or ELSE, multiple lines can be written in CodeBlock1 or CodeBlock2.
・When a line feed occurs immediately after THEN or ELSE, describe ENDIF at the end to clearly display the end of the IF statement.

Example

IF A==1 THEN
 PRINT "Congratulations" 
 BEEP 2
ELSE
 PRINT "Too bad" 
ENDIF

ELSEIF Expression THEN ...

Keywords for executing additional IF statements when conditions are not satisfied by IF statements

・By using ELSEIF instead of ELSE, it is possible to make a condition judgment after the condition is not satisfied.
・Note that the contents of the following code description change between ELSEIF and ELSE IF. The two codes in the example have the same meaning.

Example

IF A==1 THEN
 PRINT "Congratulations":BEEP 0
ELSEIF A==2 THEN 
 PRINT "Too bad" 
ELSE
 PRINT "So-so" 
ENDIF

IF A==1 THEN
 PRINT "Congratulations":BEEP 0
ELSE
 IF A==2 THEN 
  PRINT "Too bad" 
 ELSE
  PRINT "So-so" 
 ENDIF ' Required for ELSE IF
ENDIF

IF Expression GOTO @Label [ELSE CodeBlock]

Branch to label when expression is true (other than 0)

Notes on using character strings for labels

・Label strings can also be used for labels.
・Strings cannot be used when GOTO is not specified immediately after ELSE.

Bad) IF A==0 GOTO "@LABEL1" ELSE "@LABEL2"
Good) IF A==0 GOTO "@LABEL1" ELSE @LABEL2
Good) IF A==0 GOTO "@LABEL1" ELSE GOTO "@LABEL2"

Example

IF A==1 GOTO @MAIN
IF X<0 GOTO @JMP1 ELSE PRINT A$
IF Y==5 GOTO @JMP1 ELSE @JMP2
@JMP1
PRINT "@JMP1" 
@JMP2
PRINT "@JMP2" 
END

CASE Expression

Start conditional branch by CASE

・Terminate branch operation with ENDCASE.
・Branch conditions are specified by WHEN and OTHERWISE.

Argument

Expression

Expression referenced as a condition in CASE

・Used for comparison with the expression specified by WHEN.

Example

A=1
CASE A
WHEN 0: PRINT"A" 
WHEN 1: PRINT"B" 
OTHERWISE: PRINT"X" 
ENDCASE

WHEN Expression

Specify the branch condition in CASE to ENDCASE

・If the value of the expression specified by WHEN and the value of the expression specified by CASE are the same, jump to the next command after WHEN, and jump to the next WHEN or OTHERWISE if the values are different.
・When jumping to the next command to WHEN, jumps to ENDCASE when executed until just before the next WHEN.
・When WHEN is written continuously, it is treated as a group.
・In other words, when WHEN A:WHEN B is written, it means "when CASE value is A or B".
・It can only be used within CASE to ENDCASE.

Argument

Expression

Expression that becomes a branch condition

OTHERWISE

Specify what to do when none of the WHENs is correspond within CASE to ENDCASE

・If all WHEN is not correspond, jump to the next command of OTHERWISE.
・Process equivalent to ELSE in IF statement.
・WHEN cannot be used after OTHERWISE.

ENDCASE

Terminate conditional branch by CASE

・ENDCASE must be used after conditional branch is started with CASE.

LOOP

LOOP to ENDLOOP loop start keyword

・This command itself does nothing.
・When executing the ENDLOOP command, it jumps to the command immediately following the corresponding LOOP keyword.

Example

I=0
LOOP
 PRINT I;",";
 I=I+1
 IF I>100 THEN BREAK
ENDLOOP

ENDLOOP

Jump to the command immediately following the corresponding LOOP keyword

・Unlike other loop commands such as FOR, WHILE, and REPEAT, it continues to loop indefinitely.
・To break out of the loop, you need to use the BREAK command.

Example

I=0
LOOP
 PRINT I;",";
 I=I+1
 IF I>100 THEN BREAK
ENDLOOP

FOR LoopVariable=InitialValue TO EndValue
FOR LoopVariable=InitialValue TO EndValue STEP Increment

Repeat the process a specified number of times

・Place a NEXT command at the end of the process.
・If the condition is not met, it may not be executed even once.

Arguments

LoopVariable

Variable that is automatically updated on every loop

・Increment is added for each loop.

InitialValue

The value of the loop variable at the start of the loop

TO EndValue

The value of the loop variable that terminates the loop

・When the value of the loop variable exceeds this value, the loop is terminated.

STEP Increment

・An increment to add to the loop variable at the end of the loop.
・If not specified, 1 is used as the increment value.
・If a negative number is specified, the value can be looped in a decreasing direction.
・If the increment is a decimal, it may not be the intended number of times due to calculation error.

Example

FOR I=0 TO 9 STEP 2
 PRINT I;",";
NEXT

NEXT

Command indicating the end of a FOR loop

・Updates the corresponding FOR variable, jumps to the command immediately after FOR if it does not exceed the value of TO, and jumps to the command immediately after NEXT if it exceeds.
・If the FOR variable has STEP, add the value of STEP, and if there is no STEP, add 1.

Example

FOR I=0 TO 9 STEP 2
 PRINT I;",";
NEXT

WHILE Expression

If the calculation result of the expression is false (0), jumps to the command following the next WEND.

・If the expression is true (other than 0), jump to the next command after WHILE, and return to WHILE when the WEND command comes and calculate the expression again.

Example

A=0:B=4
WHILE A<B
 A=A+1
WEND

WEND

Jump to the previous WHILE command and execute again from WHILE.

Example

A=0:B=4
WHILE A<B
 A=A+1
WEND

REPEAT

REPEAT-UNTIL loop start command

・This command itself does nothing.
・When loop execution is continued with the UNTIL command, it jumps to the corresponding REPEAT command.

Example

A=0:B=4
REPEAT
 A=A+1
UNTIL A>B

UNTIL Expression

If the expression evaluates to false (0), jumps to the corresponding REPEAT command.

・If the evaluation result of the expression is true (other than 0), the loop is terminated and jumps to the next command after the UNTIL statement.
・Place a REPEAT command at the beginning of the loop.
・Unlike the WHILE command, the condition is judged after executing the in-loop code.

Example

A=0:B=4
REPEAT
 A=A+1
UNTIL A>B

CONTINUE

Force the next loop to start

・It can be used in LOOP-ENDLOOP, FOR-NEXT, WHILE-WEND, REPEAT-UNTIL.
・In a LOOP statement, jumps to LOOP when CONTINUE is executed.
・In the FOR statement, when CONTINUE is executed, the program jumps to FOR and the loop variable is updated.
・In the WHILE statement, jumps to WHILE when CONTINUE is executed.
・In the REPEAT statement, jumps to UNTIL when CONTINUE is executed.

Example

FOR I=0 TO 9
 IF I==1 THEN CONTINUE
 IF I==7 THEN BREAK
 PRINT I;",";
NEXT

BREAK

Escape the loop forcibly

・It can be used in LOOP-ENDLOOP, FOR-NEXT, WHILE-WEND, REPEAT-UNTIL.
・When BREAK is used, it jumps to the command immediately after the loop in all loop statements.

Example

FOR I=0 TO 9
 IF I==1 THEN CONTINUE
 IF I==7 THEN BREAK
 PRINT I;",";
NEXT

END

Quit the program

Example

END

STOP [DisplayString]

Suspending a running program

・Interrupted program slot: The line number is displayed.
・A program interrupted by STOP can be continued with the CONT command.

Argument

DisplayString

Specify a string to be displayed as a stop message

・Strings can be displayed up to 255 characters.
・If not specified, the stop message will not be displayed.

Example

STOP
STOP "Stopped" 

About DEF User-Defined Commands

Using DEF, you can define your own commands like the below

1) USER (no argument, no return value)
2) USER X,Y (with arguments, no return value)
3) A=USER(X) (with arguments, 1 return value)
4) USER X OUT A,B (with arguments, multiple return values)

DEF Common Rules

・The definition range is from DEF to END.
・Defined variables and labels in the DEF to END range cannot be used from outside the DEF (local variables).
・GOTO and GOSUB across the DEF to END range are not possible.
・By adding COMMON, you can define commands that can be used from outside the defined program slot.

DEF DefinitionName

Define a user-defined command with no arguments and no return value

Example

' Display characters
DEF FUNC
PRINT "SAMPLE" 
END
' Call
FUNC

DEF DefinitionName Parameter[,Parameter...]

Define a user-defined command with parameters and no return value

Parameter

If there are parameters that you want to pass to the function, specify the required parameter names separated by commas.

・The parameter name specified here can be used as a variable in DEF-END.

Example

' Display characters at the specified position
DEF FUNC2 X,Y
LOCATE X,Y
PRINT "SAMPLE" 
END
' Call
FUNC2 10,4

DEF FunctionName([Parameter[,Parameter...]])

Define a user-defined function (user-defined command with only one return value)

Parameter

If there are parameters that you want to pass to the function, specify the required parameter names separated by commas.

・The parameter name specified here can be used as a variable in DEF-END.

Return Value

When you want a value to return to the caller as a result, specify it as using the RETURN command in DEF-END. (description like RETURN ANS)

Example

'Addition
DEF ADD(X,Y)
RETURN X+Y
END

' Factorial calculation using recursion
DEF FACTORIAL(N)
IF N==1 THEN RETURN N
RETURN N*FACTORIAL(N-1)
END

' String inversion
DEF REVERSE$(T$)
VAR A$="" 'Local string
VAR L=LEN(T$) 'Local
WHILE L>0
 A$=A$+MID$(T$,L-1,1)
 DEC L
WEND
RETURN A$
END

' Call
PRINT ADD(10,5)
PRINT FACTORIAL(4)
PRINT REVERSE$("BASIC")

DEF CommandName[Parameter[,Parameter...]] OUT ReturnValue [,ReturnValue...]]

Define a user-defined command with multiple return values

Parameter

If there are parameters that you want to pass to the function, specify the required parameter names separated by commas.

・The parameter name specified here can be used as a variable in DEF-END.

Return Value

Describe as many variable names as you want to return as a result after OUT

・By storing a value to the variable specified here in DEF-END, the value can be returned to the caller.

Example

' Addition and multiplication
DEF CALCPM A,B OUT OP,OM
OP=A+B
OM=A*B
END

' Call
CALCPM 5,10 OUT P,M
PRINT P,M

DEF CommandName * [OUT *]

Define a user-defined command with variable-length parameters and variable-length return values

・It is possible to make only the parameter variable-length, or make the return value variable-length.

Parameter

You can declare that the number of parameters is variable-length by writing * (asterisk) after the command name.

・Use DEFARGC, DEFARG, TYPEOF to investigate the number, content, and type of parameters.

Return Value

Write * (asterisk) after OUT to declare that the number of return values is variable-length.

・You can use DEFOUTC and DEFOUT to investigate the number of return values and set the return value.

Example

DEF VARFUNC * OUT *
 FOR I=0 TO DEFOUTC()-1
  DEFOUT I, DEFARG(I)*2
 NEXT
END

About COMMON

A keyword used to define a user-defined command/function beyond the program slot

・When using a program between different program slots, execute it with EXEC first.

1) COMMON DEF USER
2) COMMON DEF USER(X)
3) COMMON DEF USER X OUT A,B

Example

COMMON DEF FOO(X,Y,Z)

RETURN Value

Set the return value of DEF and return to the caller

・Used when returning a value in a DEF command defined as a function type.

Example

DEF CALC(A,B)
 RETURN A*B
END
PRINT CALC(2,3)

END

Terminate DEF definition of a user-defined command/function

Example

DEF FUNC
 PRINT FUNC
END

DEFARGC()

Check the number of parameters of a user-defined command/function

・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length parameters.

Return Value

The number of parameters of a user-defined command/function

Example

DEF FOO X,Y
PRINT DEFARGC()
END

DEFARG(ParameterNumber)

Check the value of parameters of a user-defined command/function

・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length parameters.

Argument

ParameterNumber

Number of parameter to check

・Specify 0,1,2,3 ... sequentially from the first parameter.

Return Value

The value of the specified parameter

Example

DEF FOO X, Y
PRINT DEFARG(0) 'Returns X value
PRINT DEFARG(1) 'Returns Y value
END

DEFOUTC()

Check the number of return values of a user-defined command/function

・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length return value.

Return Value

Number of return values of a user-defined command/function

Example

DEF FOO OUT X,Y
PRINT DEFOUTC()
END

DEFOUT ReturnValueNumber,Value

Specify the return value of a user-defined command/function

・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length return value.

Parameters

ReturnValueNumber

Return number to be specified

・Specify 0,1,2,3 ... sequentially from the first return value.

Value

Value to be set in the specified return value

Example

DEF FOO OUT X,Y
DEFOUT 0,10 'Same meaning as X=10
DEFOUT 1,20 'Same meaning as Y=20
END

CALL CommandName[,Parameter...][ OUT Variable1[,Variable2...]]

Call a user-defined command with a specified name

Parameters

CommandName

・A string of the user-defined command name to be called.
・Program slot specification is possible in the format of "1:User-DefinedCommandName".
・Make the program in the target slot executable with the EXEC command in advance.

Parameter ~

Parameters required for the specified commands

Return Value

Describe as many variable names as you want to return as a result after OUT

Example

CALL "USERCD",X,Y OUT A,B
'
DEF USERCD X,Y OUT A,B
A=X+Y:B=X*Y
END

CALL(FunctionName[,Parameter...])

Call function with specified name

・Both built-in functions and user-defined functions can be specified.

Parameters

FunctionName

・A string of the user-defined function name to be called.
・Program slot specification is possible in the format of "1:User-DefinedFunctionName".
・Make the program in the target slot executable with the EXEC command in advance.

Parameter

Enumerate parameters required for specified function

Return Value

The value returned by the specified function

Example

A=CALL("USERFC",X,Y)
'
DEF USERFC(X,Y)
RETURN X*Y
END

CALL SPRITE
CALL TEXT

Call callback

・Calls the specified callback operation by SPFUNC and TFUNC all at once.
・Specified callback with SPFUNC is called with CALL SPRITE.
・Specified callback with TFUNC is called with CALL TEXT.
・The sprite management number and text screen ID related to the called callback can be obtained with CALLIDX().

Example

CALL SPRITE
CALL TEXT

Mathematics

INT(NumericValue)

Convert to Int type

・The decimal part is rounded toward zero.
・The result is an Int type.

Argument

NumericValue

The underlying numeric value

Return Value

Number converted to Int

Related

FLOOR: Round down, ROUND: Round off, CEIL: Round up

FLOAT(NumericValue)

Convert to Real type

・The result is a Real type.

Argument

NumericValue

The underlying numeric value

Return Value

Number converted to Real type

Related

INT:Integerization (Round toward zero)

FLOOR(NumericValue)

Round down decimal places

・Get the largest Int that does not exceed that number (floor function).
・FLOOR(12.5) is 12, FLOOR(-12.5) is -13.
・The result is all zeros after the decimal point, but it is a Real type.

Argument

NumericValue

The underlying numeric value

Return Value

The value with the fractional part rounded down

Related

INT:Integerization (Round toward zero), ROUND: Round off, CEIL: Round up

Example

A=FLOOR(12.345)

ROUND(NumericValue)

Round off the fractional part to the nearest Int

・The result is all zeros after the decimal point, but it is a Real type.
・ROUND(12.5) is 13, ROUND(-12.5) is -13.

Argument

NumericValue

The underlying numeric value

Return Value

The value with the fractional part rounded off

Related

INT:Integerization (Round toward zero), FLOOR: Round down, CEIL: Round up

Example

A=ROUND(12.345)

CEIL(NumericValue)

Round up after the decimal point

・Get the smallest Int that does not fall below that number (ceiling function).
・CEIL(12.5) is 13, CEIL(-12.5) is -12.
・The result is all zeros after the decimal point, but it is a Real type.

Argument

NumericValue

The underlying numeric value

Return Value

The value with the fractional part rounded off

Related

INT:Integerization (Round toward zero), ROUND: Round off, FLOOR: Round down

Example

A=CEIL(12.345)

ABS(NumericValue)

Get the absolute value

Argument

NumericValue

Numeric value for obtaining absolute value

Return Value

Absolute value

Example

A=ABS(-12.345)

SGN(NumericValue)

Get the sign

Argument

NumericValue

Numeric value to get sign

Return Value

Returns either 1, 0 or -1 depending on the sign of the argument

1 Positive Value
0 0
-1 Negative Value

Example

A=SGN(12.345)

MIN(NumericArray)

Get smallest value in a specified numeric array

Argument

NumericArray

Numeric array for checking minimum value

Return Value

Smallest number in numeric array

Example

DIM TMP[2]=[50,3]
A=MIN(TMP)

MIN(NumericValue,NumericValue[,NumericValue...])

Get the smallest value from multiple specified numbers

Argument

NumericValue

Arrange the numerical value whose minimum value is to be examined as argument

Return Value

Smallest number of arguments passed

Example

A=MIN(1,2,3,4)

MAX(NumericArray)

Get the largest value in a specified numeric array

Argument

NumericArray

Numeric array to get the maximum value

Return Value

Largest number in the numeric array

Example

DIM TMP[2]=[50,3]
A=MAX(TMP)

MAX(NumericValue,NumericValue[,NumericValue...])

Get the largest value from multiple specified numbers

Argument

NumericValue

Arrange the numerical value whose maximum value is to be examined as argument

Return Value

The largest number of arguments passed

Example

A=MAX(1,2,3,4)

RND([SeedID,]MaximumValue)

Get Int random number

Argument

SeedID

Random number series: 0 to 7

MaximumValue

Maximum number of random numbers to get

Return Value

A random Int between 0 and the maximum value -1.

Example

A=RND(100)

RNDF([SeedID])

Get a Real random number

Argument

SeedID

Random number series: 0 to 7

Return Value

A random Real number between 0 and 1

Example

A=RNDF()

RANDOMIZE SeedID [,SeedValue]

Initialize the random number sequence

Argument

SeedID

Type of random number series: 0 to 7

SeedValue

An Int value that selects a random number sequence

・The order of the values returned by RND and RNDF is determined by the seed value.
・If 0 is specified, the available entropy information is used as the seed value.
・If not specified, it's 0.

Example

RANDOMIZE 0

SQR(NumericValue)

Calculate the square root

Argument

NumericValue

Numeric value for obtaining the square root

Return Value

The calculated square root

Example

A=SQR(4)

EXP([NumericValue])

Calculates the power of e(BaseOfNaturalLogarithms)

Argument

NumericValue

Index number

・If not specified, the constant #EXP is returned.

Return Value

The calculated result

Example

A=EXP(2)

POW(NumericValue,Multiplier)

Calculate the power

Argument

NumericValue

Numeric value for calculating power

Multiplier

Power multiplier

Return Value

The calculated result

Example

A=POW(1,4)

LOG(NumericValue[,Base])

Calculate the logarithm

Argument

NumericValue

True number: Positive Real

Base

Base: Positive Real

・If not specified, the natural logarithm is calculated.

Return Value

The calculated result

Example

A=LOG(2,2)

RAD(NumericValue)

Convert angular units from degrees to radians

・It can be used in constant expressions.

Argument

NumericValue

Angle in degrees

Return Value

Angle in radians

Example

R=RAD(45)

DEG(NumericValue)

Convert angular units from radians to degrees

・It can be used in constant expressions.

Argument

NumericValue

Angle in radians

Return Value

Angle in degrees

Example

A=DEG(0.5*#PI)

SIN(Angle)

Calculate the sine

Argument

Angle

Angle in radians

Return Value

The calculated sine value

Example

A=SIN(RAD(45))

COS(Angle)

Calculate the cosine

Argument

Angle

Angle in radians

Return Value

The calculated cosine value

Example

A=COS(RAD(45))

TAN(Angle)

Calculate the tangent

Argument

Angle

Angle in radians

Return Value

The calculated tangent value

Example

A=TAN(RAD(45))

ASIN(NumericValue)

Calculate the arc sine (inverse function of SIN)

Argument

NumericValue

-1.0 to 1.0

Return Value

The calculated angle (in radians)

Example

A=ASIN(0)

ACOS(NumericValue)

Calculate the arc cosine (inverse function of COS)

Argument

NumericValue

-1.0 to 1.0

Return Value

The calculated angle (in radians)

Example

A=ACOS(1)

ATAN(NumericValue)

Calculate the arc tangent (inverse function of TAN) (from numeric value)

Argument

NumericValue

Numeric value to calculate the angle

Return Value

The calculated angle (in radians)

Example

A=ATAN(1)

ATAN(CoordinateY,CoordinateX)

Calculate the arc tangent (inverse function of TAN) (from XY coordinates)

Argument

CoordinateY,X

Coordinate value to calculate the angle

・The direction from the origin is calculated as an angle.
・Pay attention to the order of arguments.

Return Value

The calculated angle (in radians)

Example

A=ATAN(1,1)

SINH(NumericValue)

Calculate the hyperbolic sine

Argument

NumericValue

Numeric value to calculate the hyperbolic sine

Return Value

The calculated hyperbolic sine

Example

A=SINH(1)

COSH(NumericValue)

Calculate the hyperbolic cosine

Argument

NumericValue

Numeric value to calculate the hyperbolic cosine

Return Value

The calculated hyperbolic cosine

Example

A=COSH(1)

TANH(NumericValue)

Calculate the hyperbolic tangent

Argument

NumericValue

Numeric value to calculate the hyperbolic tangent

Return value

The calculated hyperbolic tangent

Example

A=TANH(0.5)

CLASSIFY(NumericValue)

Judge normal numbers, infinity, and non-numeric values (NaN)

Argument

NumericValue

Number to check

Return Value

0 Normal Value
1 Infinity
2 NaN

Example

A=CLASSIFY(0.5)

String Operations

About array type references of strings

By using [], you can get one character in the string or replace the character at the specified position.

Example

A$="12345" 
A$[3] → "4" 
A$[3]="ABC" → "123ABC5" 

ASC(String)

Get the character code of the first character of the string

Argument

String

A string with the first character you want to check

Return Value

The character code of the specified character

Example

A=ASC("A")
X=ASC("XYZ")

CHR$(CharacterCode)

Return a character from a specified character code

・It can be used in constant expressions.

Argument

CharacterCode

Character code of the character you want to get

Return Value

One string corresponding to the character code

Example

S$=CHR$(65)

VAL(String)

Convert a string representing a number into a numeric value

Argument

String

String representing a number ("123" etc.)

Return Value

Numeric value interpreted from character string

Example

A=VAL("123")
F=VAL("-12.56")

STR$(NumericValue[,NumberOfDigits])

Convert numeric value to string

Arguments

NumericValue

The number you want to convert to a string

NumberOfDigits

Specified when you want to right align with the specified number of digits: 0 to 63

・If the number of digits of the numerical value is larger than the specified number of digits, the specification is ignored.
・When 0 is specified, no alignment is performed.
・0, if not specified.

Return Value

Converted string (123 → "123")

Example

S$=STR$(123)

HEX$(NumericValue[,NumberOfDigits])

Convert a numeric value to a hexadecimal string

Arguments

NumericValue

Numerica value to be converted to hexadecimal string

・If a Real is specified, the decimal part is rounded toward zero.

NumberOfDigits

Number of degits with a hexadecimal character string to be output: 0 to 8

・If a value of 1 or more is specified, a string with placing 0 at the beginning is returned.
・When 0 is specified, 0 is not placed at the beginning.
・0, if not specified.

Return Value

Conversion result hexadecimal string

Example

S$=HEX$(65535,4)

BIN$(NumericValue[,NumberOfDigits])

Convert a numeric value to a binary string

Arguments

NumericValue

Numeric value to convert to a binary string

・If a Real is specified, the decimal part is rounded toward zero.

NumberOfDigits

Number of digits with the a binary string to be output: 0 to 32

・If a value of 1 or more is specified, a string with placing 0 at the beginning is returned.
・When 0 is specified, 0 is not placed at the beginning.
・0, if not specified.

Return Value

Conversion result binary string

Example

S$=BIN$(65535,16)

FORMAT$(FormatString,Value,...)

Format the value into a string using the display format

Argument

FormatString

A string to be formatted and embedded

・Control the value formatting method by adding the following type specification or auxiliary specification after %.

%S Outputs the contents of a string variable
%D Decimal Int Output
%X Hexadecimal Int Output
%F Real Output
%B Binary Int Output
%% Output the Character %

Format string auxiliary specification

Format the output by specifying the following auxiliary specification after %

・Number of digits specification: Specify the number of digits (%8D,%4X)
・Specify the number of decimal places: The total number of digits, the number of digits in the decimal part (%8.2F)
・Blank padding: Specify a space character + number of digits (% 4D → "   0")
・Zero padding: Specify 0 + number of digits (%08D → "00000000")
・Left alignment: Specify -symbol + number of digits (%-8D)
・+Sign display: Specify +symbol + number of digits (%+8D)

Value

・Specify the value to be formatted and converted into a string as many arguments as the % specified in the format string (excluding %%).
・An error occurs if the % specification does not match with the type expected and the argument type.

Return Value

Generated string

Example

S$=FORMAT$("%06D",A)

LEN(String)
LEN(Array)

Get the number of characters in a string or the number of elements in an array

Argument

For String

A number of characters in a string you want to check

For Array

A number of elements in an array you want to check

Return Value

・For String: A number of characters
・For Array: A number of elements

Example

? LEN("ABC123")
DIM B[4]
? LEN(B)

LAST(String)
LAST(Array)

Return the subscript number at the end of a string or array

Argument

String or Array

String or array to check for the end

Return Value

Subscript number at the end

・For both strings and arrays, return the value obtained by subtracting 1 from the return value of the LEN function.

Example

DIM X[10]
FOR I=0 TO LAST(X)
 X[I]=I
NEXT

MID$(String,StartPosition [,NumberOfCharacters])

Get substring of the specified number of characters from specified position of the string

Arguments

String

Target string

StartPosition

Start position of the acquired string

NumberOfCharacters

Number of characters in the acquired string

・If not specified, the number of characters from the start position to the end of the string is specified.

Return Value

Obtained string

Example

S$=MID$("ABC",0,2)

LEFT$(String,NumberOfCharacters)

Get substrings of the specified number of characters from the beginning of the string

Arguments

String

Target string

NumberOfCharacters

Number of characters in the acquired string

Return value

Obtained string

Example

S$=LEFT$("ABC",2)

RIGHT$(String,NumberOfCharacters)

Get substring of the specified number of characters from the end of the string

Arguments

String

Target string

NumberOfCharacters

Number of characters in the acquired string

Return Value

Obtained string

Example

S$=RIGHT$("ABC",2)

INSTR(String,SearchString)
INSTR(StartPosition,String,SearchString)

Search the specified string in the string and return the position

Argument

StartingPosition

The position within the string to start the search

・If not specified, search from the beginning of the string.

String

Search target string

SearchString

The string to search for

Return Value

Found: Position in the string
Not found: -1

Example

A=INSTR(0,"ABC","B")

SUBST$(String,StartPosition,ReplacementString)
SUBST$(String,StartPosition,NumberOfCharacters,ReplacementString)

Create a new string by replacing part of the string

Arguments

String

Replace target string

StartPosition

Replacement start position

NumberOfCharacters

Number of characters to be replaced

・If not specified, all characters after the start position are replaced with the replacement string.

ReplacementString

Replace this string with the number of characters from the start position

Return Value

Replaced string

Example

A$=SUBST$("ABC",0,2,"XY")

DATE$()

Return current date as a string

Return Value

Current date string

・The format is "Year/Month/Day".

TIME$()

Return current time as a string

Return Value

Current time string

・The format is "Hour:Minute:Second".

Other

CONST #ConstantName=ConstantExpression[,#ConstantName=ConstantExpression]

Define constants

・You can define another constant by writing a comma after one definition.

ConstantName

・Constant names have the same format as variable names and begins with #.

ConstantExpression

・Numeric values, strings, other constants, CHR$, RGB, RGBF, HSV, HSVF, DEG, RAD functions, and their operations can be used as constant expressions.

Example

CONST #C1=1,#C2="ABC",#C3=RAD(180)
?#C1,#C2,#C3

ENUM #ConstantName[=ConstantExpression][,#ConstantName[=ConstantExpression]]

Define constants with sequential numbers

・Unlike CONST, only Int constants can be defined.
・Constant expressions can be omitted.
・If not specified, the set value +1 in the previous constant definition is used.

ConstantName

・Constant names have the same format as variable names and begins with '#'.

ConstantExpression

・Int, other Int constants, RGB, RGBF, HSV, HSVF, DEG, RAD, and their operations can be used for constant expressions.
・If the constant expression is a Real, the decimal part is rounded toward zero.
・If not specified, the set value +1 in the previous constant definition is used.

Example

ENUM #TYPE1=2,#TYPE2,#TYPE3
?#TYPE1,#TYPE2,#TYPE3

DATA ConstantExpression[,ConstantExpression...]

Define data to be read by the READ command

Argument

ConstantExpression

・Numeric values, strings, other constants, CHR$, RGB, RGBF, HSV, HSVF, DEG, RAD functions, and their operations can be used as constant expressions.
・If it is a constant expression, both numerical values and strings can be mixed.

Example

DATA 123,#C_RED,56,"SAMPLE"+CHR$(20)

READ Variable1[,Variable2...]

Read the value defined by the DATA command

・If there is no data that can be read, Out of data error occurs.

Argument

Variable

Variable to store information to be read (multiple variables can be specified)

・Get sequentially from the first DATA statement.
・Use the RESTORE command to change the DATA statement to be read.

Example

READ X,Y,Z,G$
DATA 200,120,0,"JAN" 
DATA 210,120,0,"FEB" 

RESTORE @Label
RESTORE String

Change the DATA statement read with the READ command

Argument

@Label

@LabelName added to the beginning of the DATA statement to be read

・When you put RESTORE "1:@LabelName" or/and the "Number:" before the label names, then it can refer to other program slots.
・When specifying a program slot, it is necessary to enable the program in the target program slot beforehand with the EXEC command.

String

・If a string is specified instead of a label, the value of the expression is considered as a label at runtime and the label is referenced.
・In addition to labels, each of the following strings has a special function.

"PUSH" Stops the READ reading position on the stack. The current READ reading position remains unchanged.
"POP" Set the READ reading position to the location where the reading occurred from the stack.
"BEGIN" Set the READ reading position to the beginning of a DATA statement in the program.
"Number:BEGIN" Set the READ reading position to the beginning of a DATA statement in the specified program slot.

Example

RESTORE @DATATOP
READ X,Y,Z,T$
@DATATOP
DATA 123,345,56,"SAMPLE" 

OPTION FunctionName

Set the program operation mode

Argument

FunctionName

STRICT Variable definition is mandatory and assignment to an undefined variable results in an error.
DEFINT The default value of the variable is set to the Int 0 instead of a Real. The default type for numeric arrays is an Int array.

Example

OPTION STRICT

WAIT [FrameCount]

Stop program execution until the specified frame count elapses

Argument

FrameCount

Specify elapsed frame count from the present time

・If 0 is specified, it does not stop.
・If not specified, it's 1.

Example

WAIT 60

VSYNC [FrameCount]

Stop program execution until the specified frame count elapses

・Unlike WAIT, specify the frame count from the previous VSYNC execution.

Argument

FrameCount

Specify elapsed frame count since the last VSYNC

・If 0 is specified, it does not stop.
・If not specified, it's 1.

Example

VSYNC 1

REM
'

Symbol for comment description

・REM or ' and after the end of the line are regarded as comments and they will be ignored.
・Comments do not affect program execution.

Example

' MAIN ROUTINE

TMREAD OUT H,M,S
TMREAD TimeString OUT H, M, S

Convert time string to number

Argument

TimeString

Time string in "HH:MM:SS" format

・HH is a numerical character from 00 to 23, MM and SS are numerical characters from 00 to 59.
・Current time is the default.

Return Value

H,M,S

H Variable that receives the hour
M Variable that receives the minute
S Variable that receives the second

Example

TMREAD "12:59:31" OUT H,M,S

DTREAD OUT Y,M,D[,W]
DTREAD DateString OUT Y,M,D[,W]

Convert date string to number

Argument

DateString

Date string in "YYYY/MM/DD" format

・YYYY is a numeric character from 0000 to 9999, MM is from 01 to 12, and DD is from 01 to 31.
・The default is the current date.

Return Value

Y,M,D,W

Y Variable that receives the year
M Variable that receives the month
D Variable that receives the day
W Variable that receives the day of the week (a number with Sunday as 0) (optional)

Example

DTREAD "2014/10/12" OUT Y,M,D

CHKLABEL(String[,Flag])

Check if a label with the same name as the specified string exists

Argument

String

The string to search for as a label

・CHKLABEL "1:@LabelName" can also check labels in other program slots.
・When specifying a program slot, the target program slot must be enabled with the EXEC command in advance.

Flag

Specify whether to search labels outside DEF when CHKLABEL is used in DEF

0 Search only in DEF
1 Search global labels if not in DEF

・0, if not specified.

Return Value

1 if it exists, 0 if not exist

Example

A=CHKLABEL("@MAIN")

CHKCALL(String)

Check if there is an command/function with the same name as the specified string

Argument

String

String to search for as an command/function

Return Value

1 if it exists, 0 if not exist

Example

A=CHKCALL("KEYCHECK")

CHKVAR(String)

Check if a variable with the same name as the specified string exists

Argument

String

String to search for as a variable

Return Value

1 if it exists, 0 if not exist

Example

A=CHKVAR("COUNTX")

DIALOG DisplayString[,SelectionType[,CaptionString[,TimeoutPeriod]]]

Display the dialog and wait until the button is pressed

・Pressed button information can be obtained with the RESULT function.
・1: OK, -1: Cancel, 0: Timeout

Argument

DisplayString

String to be displeday in the dialog

・Up to 256 characters can be displayed.
・If there is CHR$(10) or CHR$(13) in the display string, a line break will occur.

SelectionType

0 OK (Default)
1 No / Yes
2 Back / Next
3 Cancel / OK
4 Cancel / Execute
5 Next

・If not specified, it's 0.

CaptionString

String to be displayed in the caption field at the top of the dialog

・If the caption string is longer than 46 characters, only 46 characters are displayed.
・If not specified, "DIALOG" is displayed in the caption column.

TimeoutPeriod

Number of seconds before closing the dialog automatically

・If a negative value is specified, it is specified in frame count units.
・If 0 is specified, it waits until the user operates.
・If not specified, it's 0.

Example

DIALOG "Let's get started",5,"Scenario",-120

DIALOG(DisplayString,ButtonType[,CaptionString[,TimeoutPeriod]])

Display dialog and wait until touch or hardware button is pressed

Argument

DisplayString

String to be displayed in the dialog

・Up to 256 characters can be displayed.
・If there is CHR$(10) or CHR$(13) in the display string, a line break will occur.

ButtonType

bit0 X Button
bit1 B Button
bit2 Y Button
bit3 A Button
bit4 Up Button
bit5 Down Button
bit6 Left Button
bit7 Right Button
bit8 L Button
bit9 R Button
bit10 ZL Button
bit11 ZR Button
bit12 Press the L Stick
bit13 Press the R Stick
bit14 Any from A/B/X/Y Button
bit15 Any from Up/Down/Left/Right Button
bit16 Any button other than press the Stick
bit17 Touch Screen

・Specify the OR of the above bit values.
・Specifying zero causes an error.

CaptionString

String to be displayed in the caption field at the top of the dialog

・If the caption string is longer than 46 characters, only 46 characters are displayed.
・If not specified, "DIALOG" is displayed in the caption column.

TimeoutPeriod

Number of seconds before closing the dialog automatically

・If a negative value is specified, it is specified in frame count units.
・If 0 is specified, it waits until the user operates.
・If not specified, it's 0.

Return Value

Depending on the button pressed, it returns the value which becomes 1 corresponding to a bit value of the button type argument.

・Except for touch, the same value as BUTTON() is returned.
・0 is returned in case of timeout.

Example

R=DIALOG("ABXYLR/DirectionalKey/Touch",(1 << #B_ANY) OR (1 << 17),"Special",0)

DIALOG(InitialString,CaptionString[,MaximumNumberOfCharacters])

Display a dialog dedicated to file name input

Argument

InitialString

File name string set in advance as an input value

・An error occurs if characters that cannot be used in the file name are used.

CaptionString

The string to display in the caption

・If the caption string is longer than 39 characters, only 39 characters are displayed.

MaximumNumberOfCharacters

Up to 32 characters

Return Value

Obtained string

・If the return value of the RESULT function is -1, it'll be canceled (string invalid).

Example

T$=DIALOG("NEWNAME0","SAVE",14)

RESULT()

Get the execution result of some commands

・Returns the execution results of commands that require execution results such as DIALOG, file operation commands, and XCTRLSTYLE.
・Use after execution of an command that updates RESULT.

Return Value

Command execution result

・The result value varies depending on each command, but as a common element, 1 indicates success and 0 indicates failure in all commands.

CALLIDX()

Return the number associated with the callback

Return Value

The number associated with the callback

・For CALL SPRITE, the sprite ID that called the callback.
・For CALL TEXT, the text screen ID that called the callback.
・If you call outside the callback, a meaningless value is returned.

CLIPBOARD String

Set clipboard contents

Argument

String

String to be stored on the clipboard

Example

CLIPBOARD "Good morning" 

CLIPBOARD()

Get clipboard contents

Return Value

String in the clipboard

Example

PRINT CLIPBOARD()

KEY KeyNumber,String

Set the function key contents

・The contents set with Ctrl+F1 to F5 can be entered.

Arguments

KeyNumber

Function key number to register: 1 to 5

String

String to be registered in the function key

・The maximum length of the string is 256 characters.

Example

KEY 1,"PRINT" 

KEY(FunctionKeyNumber)

Get the contents of a function key

Argument

KeyNumber

Function key number for acquiring the contents: 1 to 5

Return Value

String registered in the function key

Example

A$=KEY(1)

FONTINFO CharacterCode,FontType OUT X,Y
FONTINFO String,FontType OUT X,Y

Get font storage coordinates

・Get the storage coordinates of the specified font in GRPF.

Arguments

CharacterCode

Character code of the character you want to check

・User-defined characters cannot be specified.

String

String that contains the first character you want to check

・Ignore characters other than the first character.
・User-defined characters cannot be specified.

FontType

The type of font you want to check

・8 or 16 can be specified.

Return Value

X,Y

Returns the coordinates where characters are stored in GRPF

FREEMEM()
FREEMEM OUT TotalFreeSpace,ContinuousFreeSpace

Get free memory space for strings and arrays

・The unit of capacity is bytes. SmileBASIC consumes 2 bytes per character, 4 bytes per Int array element, and 8 bytes per Real array element.
・When it's used in function format, the total free space is returned.

Return Value

TotalFreeSpace

Total size of unused memory

ContinuousFreeSpace

Size of unused memory that can be used at one time

MILLISEC()

Returns the elapsed time since launching SmileBASIC4

・Unit is milliseconds (1/1000th of a second)

Return Value

Elapsed time since startup

MAINCNT()

Return the elapsed time since launching SmileBASIC

・The time per frame count is about 1/60th of a second when no processing loss occurs.
・Used to measure how many times the display has been updated. Not suitable for accurate timekeeping.

Return Value

Frame count since startup

SYSPARAM(InformationNameString)
SYSPARAM InformationNameString OUT SettingValue1,SettingValue2
SYSPARAM InformationNameString,SettingValue

Get and set various information

Argument

SettingItemNameString

Specify the name of the item you want to get/set as a string

The item names that can be specified are as follows:

LANG Language name set in Nintendo Switch™ (Get)
SYSBEEP System UI sound effect playback flag (Set/Get)
TABSTEP Number of spaces inserted when using the TAB key in the editor (Get)
KEYREPEAT Setting menu on the key repeat value (Get)
MOUSECURSOR Mouse cursor display (Set/Get)
TVMODE Whether TV Mode (Get)
TOOL1 Tool 1 file name (Get)
TOOL2 Tool 2 file name (Get))
TOOL3 Tool 3 file name (Get)

・KEYREPEAT returns two values: repeat start and repeat interval

Return Value

Returns a value according to the item name

Example

PRINT SYSPARAM("LANG")
SYSPARAM "KEYREPEAT" OUT ST,IT

PERFBEGIN MeasurementNumber [,ColorCode]

Start execution time measurement

・Used in combination with the PERFEND command.

Arguments

MeasurementNumber

Number of measurement information to use: 0 to 7

ColorCode

Color when indicatng information on the performance gauge

・Optional

PERFEND MeasurementNumber

Finish the execution time measurement and register the result in the performance gauge

・If the same measurement number is specified and PERFBEGIN has not been called, correct measurement results cannot be obtained.

Argument

MeasurementNumber

Number of measurement information to use: 0 to 7

PERFEND(MeasurementNumber)

Finish the execution time measurement and register the result in the performance gauge

・If the same measurement number is specified and PERFBEGIN has not been called, correct measurement results cannot be obtained.
・When it's used as a function, the execution time between PERFBEGIN and PERFEND can be obtained.
・If the measurement time exceeds 2147 seconds, correct results will not be returned.

Argument

MeasurementNumber

Number of measurement information to use: 0 to 7

Return Value

Returns the elapsed time from PERFBEGIN to PERFEND in microseconds (1 millionth of a second)

METALOAD ["ProjectName"]

Load the metadata of the specified project

・Read the icons and descriptions of the specified project to the memory and makes them editable.

Argument

ProjectName

Project name string to be read
・If it is not specified, the current project will be read.

METAEDIT MetadataItems,SettingData

Set metadata items

Arguments

MetadataItems

Specify the metadata item to be set as a numeric value

0 Title
1 Description
2 Icon

SettingData

Specify the value to set

・The type and contents of the value differ for each metadata item number.
・For a title, set a string of up to 24 characters.
・For a description, set a string of up to 240 characters. Line feed with CHR$(10).
・For an icon, an icon image is designated by a numerical array with the number of elements 1600(Height40,Width40).

METAEDIT MetadataItem OUT SettingData

Get the currently set metadata item

Argument

MetadataItem

Specify the metadata item to be acquired as a numeric value

0 Title
1 Description
2 Icon

Return Value

SettingData

The returned value is different for each metadata item number.

・For a title, a string of up to 24 characters is returned.
・For a description, a string of maximum 24 characters x 10 lines is returned. Line feed with CHR$(10).
・For an icon, a 2D Int array with the number of elements 1600(Height40,Width40) is returned as an icon image.

METASAVE

Save metadata

・The metadata of the current project is rewritten.

Various Inputs

XCTRLSTYLE MaxNumberOfConnections,OperationStyle[,MotionSensorUseFlag,IRSensorUseFlag[,ConnectionDialogFlag]]

Set the maximum number of controllers connections, operation style, and functions

・Depending on the setting operation style, the types of controllers that can be connected, the expected Joy-Con holding method, the types of buttons and Stick that can be acquired, and the controller functions that can be used vary.
・The operation result on the connection confirmation display can be confirmed with the RESULT function (1: Success, -1: Cancel).
・Calls from subprograms are ignored.

Arguments

MaxNumberOfConnections

Specify the maximum number of controllers you want to connect

・The range of values that can be specified varies depending on the operation style.

Full 1 to 2
dual-controller grip 1 to 2
held horizontally 2 to 4
held vertically 2 to 4

OperationStyle

Operation style to be set: 0 to 3

Number Style Name Available Controllers
0 Full handheld mode, dual-controller grip, Pro Controller
1 dual-controller grip dual-controller grip
2 held horizontally Joy-Con (L)/(R) held horizontally, Pro Controller
3 held vertically Joy-Con (L)/(R) held vertically

MotionSensorUseFlag

Specify 1 if you want to use motion sensors (accelerometer, gyroscope) or 0 if you do not use it.

・0, if not specified.

IRSensorUseFlag

Specify 1 if you want to use IR Motion Camera, 0 if you do not use it.

・0, if not specified.
・When using IR Motion Camera, the operation style must be 1 (dual-controller grip).

ConnectionDialogFlag

Specify whether to always display the controller connection display

・If 1 is specified, the controller connection display will be displayed.
・If 0 is specified, the controller connection display is displayed only when the setting is changed.
・0, if not specified.

XCTRLSTYLE 0

Reset the controller operation style to the startup state

・If only 0 is specified, the controller operation style is reset to the startup state.
・Same as specifying XCTRLSTYLE 1,0,0,0.
・The operation result on the connection confirmation display can be confirmed with the RESULT function (1: Success, -1: Cancel).
・Calls from subprograms are ignored.

Argument

0 (zero)

Specify only numeric zero

・An error occurs if a different value is specified.

XCTRLSTYLE OUT MaxNumberOfConnections,OperationStyle

Obtaining the current maximum controller connections and operation style

Return Value

MaxNumberOfConnections

Maximum number of controllers that can be connected

Operation style

OperationStyle

0 Full
1 dual-controller grip
2 held horizontally
3 held vertically

CONTROLLER(ControllerID)

Check controller type and connection status

Argument

ControllerID

0 Default Controller
1 to 4 Normal Controller

・The normal controller ID corresponds to the number of player LED on the connected controllers.
・If the handheld mode controller can be used, the ID is always 1.
・The default controller combines the inputs of all connected controllers and always treats them as inputs equivalent to the handheld mode controller regardless of the currently set operation style.
・When using controller IDs 1 to 4, it is strongly recommended to set the operation style you want to use with the XCTRLSTYLE command in advance.

Return Value

0 Not Connected
1 handheld mode controller
2 Pro Controller
3 dual-controller grip
4 Joy-Con (L)
5 Joy-Con (R)

CONTROLLER ControllerID OUT ControllerType,MainColor,SubColor
CONTROLLER ControllerID OUT ControllerType,LeftMainColor,LeftSubColor,RightMainColor,RightSubColor

Check controller connection status and type

Argument

ControllerID

0 Default Controller
1 to 4 Normal Controller

・The normal controller ID corresponds to the number of player LED on the connected controllers.
・If the handheld mode controller can be used, the ID is always 1.
・The default controller combines the inputs of all connected controllers and always treats them as inputs equivalent to the handheld mode controller regardless of the currently set operation style.
・When using controller IDs 1 to 4, it is strongly recommended to set the operation style you want to use with the XCTRLSTYLE command in advance.

Return Value

Controller type

0 Not Connected
1 handheld mode controller
2 Pro Controller
3 dual-controller grip
4 Joy-Con (L)
5 Joy-Con (R)

MainColor,SubColor

Returns the controller color in two color codes, the main color and the sub color

・The obtained color code can be used as the color code for other drawing commands.
・If the controller is not connected, the main and sub will return black.

LeftMainColor,LeftSubColor,RightMainColor,RightSubColor

When dual-controller grip or handheld mode controller are used, the left and right controller colors can be acquired separately.

・Black is returned to the right main color and the right sub color when it is held horizontally and held vertically.

BUTTON(ControllerID,ButtonID[,FunctionID])

Get the operation status of a specific button on the controller

Arguments

ControllerID

ID of a controller to check

0 Default Controller
1 to 4 Normal Controller

・For details on the controller ID, refer to the help for the CONTROLLER function.

ButtonID

ID of a button to check

Correspondence between button ID and button is as follows

・Correspondence between button ID and button is different for each operation style.

Button ID Full, dual-controller grip held vertically held horizontally
#B_RUP X Button Up Button Up Button
#B_RDOWN B Button Down Button Down Button
#B_RLEFT Y Button Left Button Left Button
#B_RRIGHT A Button Right Button Right Button
#B_LUP Up Button
#B_LDOWN Down Button
#B_LLEFT Left Button
#B_LRIGHT Right Button
#B_L1
#B_SL
L SL SL
#B_R1
#B_SR
R SR SR
#B_L2
#B_S1
ZL L or R L or R
#B_R2
#B_S2
ZR ZL or ZR ZL or ZR
#B_LSTICK Press the L Stick Press the Stick Press the Stick
#B_RSTICK Press the R Stick
#B_RANY Any of A/B/X/Y Buttons
#B_LANY Any of Up/Down/Left/Right Buttons
#B_ANY Any Buttons other than Press the Stick

・The top, bottom, left and right of the directional buttons are the button positions relative to the direction with the controller. The vertically held “up” is the horizontally held “left”.

FunctionID

Type of condition you want to know

・0, if not specified.

0 Button is pressed
1 The moment the button is pressed (with BREPEAT support)
2 The moment the button is pressed (no BREPEAT support)
3 The moment the button is released

Return Value

1 if the specified button satisfies the specified function ID conditions, 0 otherwise

BUTTON(ControllerID)
BUTTON(ControllerID,-1[,FunctionID])

Acquire all button status of controller together

・If you only want to get the status of one button, see the help for another BUTTON function.

Arguments

ControllerID

ID of controller to check

0 Default Controller
1 to 4 Normal Controller

・For details on the controller ID, refer to the help for the CONTROLLER function.

-1

If button ID is specified to -1, all button states will be collected together.

・If only controller ID is specified, -1 is specified.

FunctionID

Type of condition you want to know

・0, if not specified.

0 Button is pressed
1 The moment the button is pressed (with BREPEAT support)
2 The moment the button is pressed (no BREPEAT support)
3 The moment the button is released

Return Value

The button state of the specified controller is returned with each bit.

To check if the button is pressed, you can write the following program

'To create a value with the bit corresponding to the button turned ON, shift 1 to the left (<<) by the button ID
'For example, if you want to check if #B_RLEFT is pressed
BTNBIT_RLEFT = 1 << #B_RLEFT
'Once the bit value is created, the result of the BUTTON function and the AND are calculated. If the result is other than 0, it is pressed.
IF (BUTTON(0) AND BTNBIT_RLEFT) !=0 THEN PRINT "Left Button" 

BREPEAT ButtonID,RepeatStartTime,RepeatInterval

Set the button repeat speed

・This affects the result when 1 is specified for the function ID of the BUTTON function.
・Affects all connected controllers.

Arguments

ButtonID

ID of the button which wants to set repeat speed

・For details on the button ID, refer to the help for the BUTTON function.

RepeatStartTime

Frame count from when the button starts to be pressed until repeat starts

RepeatInterval

Frame count from the occurrence of a repeat until the next repeat occurs

BREPEAT ButtonID OUT RepeatStartTime,RepeatInterval

Get button repeat speed

Argument

Button ID

ID of the button which wants to obtain repeat speed

・For details on the button ID, refer to the help for the BUTTON function.

Return Value

RepeatStartTime

Frame count from when the button starts to be pressed until repeat starts

RepeatInterval

Frame count from the occurrence of a repeat until the next repeat occurs

STICK ControllerID[,StickID] OUT X,Y

Check controller Stick status

Arguments

ControllerID

ID of controller to check

0 Default Controller
1 to 4 Normal Controller

・For details on the controller ID, refer to the help for the CONTROLLER function.

StickID

0 L Stick
1 R Stick

・0, if not specified.
・Specifying 1 when there is only one Stick does not cause an error, and 0 is returned for both X and Y.

Return Value

X,Y

Stick tilt information

・Left <-> Right 1.0<>1.0 in the horizontal direction (X).
・Up <-> Down 1.0<>1.0 in the vertical direction (Y).
・When no operation is performed, 0 is returned for both X and Y.

ACCEL ControllerID[,SensorID] OUT X,Y,Z

Acquire accelerometer information

・If the motion sensor is not enabled in XCTRLSTYLE, normal values will not be returned.

Arguments

ControllerID

ID of a controller you want to check: 1 to 4

・ControllerID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

SensorID

ID of sensor to check: 0 to 1

・A meaningful value with ID 1 is returned only when dual-controller grip is used.
・0, if not specified.

Return Value

X,Y,Z

Accelerometer value

・The unit is acceleration of gravity.
・X is the left/right directional button (right button direction is positive)
・Y is the up/down directional button (down button direction is positive)
・Z is perpendicular to the controller surface (upward is positive)

GYROV ControllerID [,SensorID] OUT X,Y,Z

Get angular velocity of gyroscope

・If the motion sensor is not enabled in XCTRLSTYLE, normal values will not be returned.

Arguments

ControllerID

ID of the controller you want to check: 1 to 4

・ControllerID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

SensorID

ID of sensor to check: 0 to 1

・ID 1 is valid only when dual-controller grip is used.
・0, if not specified.

Return value

X,Y,Z

Angular velocity of gyroscope around each axis

・The unit is radian/second.
・X is pitch.
・Y is roll.
・Z is yaw.
・The direction in which the right screw rotates in each positive direction is a positive value.

GYROA ControllerID [,SensorID] OUT X,Y,Z

Get the angle of gyroscope

・If the motion sensor is not enabled in XCTRLSTYLE, 0 will be returned to all.
・If you move the controller violently or continue to use it for a long time, errors will accumulate and the correct value will not be returned. So, it is necessary to reset the angle by calling the GYROSYNC command at the required timing.

Arguments

ControllerID

ID of the controller you want to check: 1 to 4

・ControllerID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

SensorID

ID of sensor to check: 0 to 1

・ID 1 is valid only when dual-controller grip is used.
・0, if not specified.

Return value

X, Y, Z

Gyroscope angle around each axis

・The unit is radian.
・X is pitch.
・Y is a roll.
・Z is yaw.
・The direction in which the right screw rotates in each positive direction is a positive value.

GYROSYNC ControllerID [,SensorID]

Reset the angle of gyroscope

・The controller posture immediately after calling the command is X:0,Y:0,Z:0.
・A maximum time of 1V count is required until the actual reset is performed after using the GYROSYNC command.

Arguments

ControllerID

Controller ID to be reset: 1 to 4

・Controller ID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

SensorID

ID of sensor to be reset: 0 to 1

・When it's other than dual-controller grip, even if 1 is specified, it is ignored.
・0, if not specified.

VIBRATE ControllerID [,LeftRightDesignation],VibrationPatternNumber

Vibrate the controller

・Calls from subprograms are ignored.

Arguments

ControllerID

Controller ID to be vibrated: 1 to 4

・ControllerID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

LeftRightDesignation

Specify left and right controller to vibrate

0 Left
1 Right

・If not specified, both left and right vibrate.
・In case of held vertically and held horizontally, even if 1 is specified, it is ignored.

VibrationPatternNumber

Preset vibration pattern number: 0 to 62

・Vibration stops when 0 is specified.

Example

VIBRATE 1,40
VIBRATE 1,0,1:VIBRATE 1,1,3

VIBRATE ControllerID [,LeftRightDesignation],LowBandFrequency,LowBandAmplitude,HighBandFrequency,HighBandAmplitude

Specify the frequency and amplitude to vibrate the controller

・Calls from subprograms are ignored.

Arguments

ControllerID

Controller ID to be vibrated: 1 to 4

・ControllerID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

LeftRightDesignation

Specify left and right controller to vibrate

0 Left
1 Right

・If not specified, both left and right vibrate.
・In case of held vertically and held horizontally, even if 1 is specified, it is ignored.

LowBandFrequency

Vibration frequency (Hz)

・Vibration stops when 0 is specified.

LowBandAmplitude

Vibration amplitude: -128.0 to 127.0

・Vibration stops when 0 is specified.

HighBandFrequency

Vibration frequency (Hz)

・Vibration stops when 0 is specified.

HighBandAmplitude

Vibration amplitude: -128.0 to 127.0

・Vibration stops when 0 is specified.

Example

VIBRATE 1,440,127,220,64

VIBRATE(ControllerID[,LeftRightDesignation])

Get controller vibration status

Arguments

ControllerID

Controller ID for acquiring vibration status: 1 to 4

・ControllerID 0 cannot be specified.
・For details on the controller ID, refer to the help for the CONTROLLER function.

LeftRightDesignation

Specify whether to acquire vibration status of left or right

0 Left
1 Right

・If not specified, the combined value of the left and right states is returned.
・In the case of held vertically and held horizontally, if 1 is specified, 0 is always returned.

Return Value

・If it is vibrating, it returns the vibration pattern number. If frequency/amplitude is directly specified, it returns 65535.
・0 when it's not vibrating.
・If the left / right designation is not specified except for held vertically or held horizontally, RightStateValue*65536+LeftStateValue is returned.
・If left and right designation is not specified for held vertically and held horizontally, only the left state value is returned.

Example

PRINT VIBRATE(1,0)

VIBRATE

Stop vibration of all controllers

・Calls from subprograms are ignored.

Example

VIBRATE

TOUCH [TouchID[,CoordinateSystemConversionFlag]] OUT TouchTime,X,Y[,TouchArea]

Return touch information on the touch screen

・The TOUCH function does not return a valid value in TV mode.

Arguments

TouchID

With multi-touch, you can specify up to 0, 1, 2, 3 ... and 9 in the order of the touch start point.

・0, if not specified.

CoordinateSystemConversionFlag

If 0 is specified, the touch coordinates are converted to the coordinates on the BASIC display where the touch coordinates are displayed, and touches outside the display are treated as untouched actions.

If 1 is specified, the touch coordinates on the entire LCD display are acquired regardless of the BASIC display.

・0, if not specified.

Return Value

TouchTime

Frame count from start of touch to present

・0 is returned when it's not touched.

X,Y

Coordinates when touched

・If it is not touched, a meaningless value is returned.

TouchArea

Touch area when touched

・If it is not touched, a meaningless value is returned.

MOUSE [CoordinateSystemConversionFlag] OUT X,Y [,Wheel]

Return mouse coordinate information

Arguments

CoordinateSystemConversionFlag

If 0 is specified, mouse coordinates are converted to the coordinates of the BASIC display on which they are displayed.

If 1 is specified, the mouse coordinates of the entire LCD display are acquired regardless of the BASIC display.

Return Value

X,Y

Current mouse coordinates

Wheel

Current wheel value

MOUSE X,Y[,CoordinateSystemConversionFlag]

Set mouse coordinates

Arguments

X,Y

Mouse coordinates to set

CoordinateSystemConversionFlag

If 0 is specified, X and Y are handled as BASIC display coordinates.

If 1 is specified, X and Y are handled as coordinates on the entire LCD display.

・0, if not specified.

MBUTTON()

Get all mouse button statuses together

・If you want to get the status of only one button, refer to another MBUTTON help page.

Argument

Return Value

Mouse button state is returned bit by bit

MBUTTON(ButtonID[,FunctionID])

Get the operation status of a specific mouse button

Argument

ButtonID

ID of a button you want to check

0 Left Button
1 Right Button
2 Center Button
3 Button 4
4 Button 5

FunctionID

Type of condition you want to know

0 Button is pressed
1 (Not Available)
2 The moment the button is pressed
3 The moment the button is released

・0, if not specified.

Return Value

1 if the specified button satisfies the specified function ID conditions, 0 otherwise

IRSTART ControllerID,IRRecognitionType

Start using the IR Motion Camera

・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Calls from subprograms are ignored.

Arguments

ControllerID

ID of the controller using the IR Motion Camera: 1 to 2

・For details on the controller ID, refer to the help for the CONTROLLER function.

IRRecognitionType

Specify the IR Motion Camera recognition method

0 Clustering Mode
1 Shooting Mode
2 Moment Mode

・Clustering mode recognizes bright areas as rectangles. A maximum of 16 areas can be recognized simultaneously.
・In the shooting mode, images captured by the IR Motion Camera are acquired as images.
・Data taken in the shooting mode can be displayed in IRSPRITE. Data cannot be retrieved into a BASIC program.
・Display capture is prohibited while the shooting mode is activated.
・In the moment mode, the imaging range is divided into 8x6 small areas, and each piece of recognition information is acquired.

IRSTART ControllerID,0,[LightingType],[Gain],[Exposure],[MinCluster],[MaxCluster],[MinBrightness]

Start using IR Motion Camera (Clustering mode detailed parameter setting type)

・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Calls from subprograms are ignored.

Arguments

ControllerID

ID of the controller using the IR Motion Camera: 1 to 2

・For details on the controller ID, refer to the help for the CONTROLLER function.

0

Specify 0 for the clustering mode

LightingType

Specify IR Motion Camera lighting

0 All (Far + Near)
1 For Long Range Only
2 For Short Range Only
3 Lighting Off

・0, if not specified.

Gain

IR Motion Camera shooting gain: 1 to 16

・2 is the default.

Exposure

IR Motion Camera exposure time: 7 to 600

・200 is the default.

MinCluster

Minimum area (number of pixels) that can be recognized as a cluster: 0 to 76800

・3 is the default.

MaxCluster

Maximum area (number of pixels) that can be recognized as a cluster: 0 to 76800

・76800 is the default.

MinBrightness

Minimum brightness to recognize as a cluster: 0 to 255

・150 is the default.

IRSTART ControllerID,1,[LightingType],[Gain],[Exposure],[ImageSize]

Start using the IR Motion Camera (shooting mode detailed parameter setting type)

・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Data taken in the shooting mode can be displayed in IRSPRITE. Data cannot be retrieved into a BASIC program.
・Display capture is prohibited while the shooting mode is activated.
・Calls from subprograms are ignored.

Arguments

ControllerID

ID of controller using IR Motion Camera: 1

・You can specify only 1 in the shooting mode.
・For details on the controller ID, refer to the help for the CONTROLLER function.

IRRecognitionType

Always specify 1 for the shooting mode

LightingType

Specify IR Camera lighting

0 All (Far + Near)
1 For Long Range Only
2 For Short Range Only
3 Lighting Off

・0, if not specified.

Gain

IR Motion Camera shooting gain: 1 to 16

・8 is the default.

Exposure

IR Motion Camera exposure time: 7 to 600

・300 is the default.

ImageSize

Specify the size of the shot image

0 320×240
1 160×120
2 80×60
3 40×30
4 20×15

・The larger the image size, the longer it takes to transfer. 320×240 for a minimum of 4 seconds, 4 times faster for each smaller size.
・2 is the default.

IRSTART ControllerID,2,[LightingType],[Gain],[Exposure]

Start using the IR Motion Camera (moment mode detailed parameter setting type)

・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Calls from subprograms are ignored.

Arguments

ControllerID

ID of the controller using the IR Motion Camera: 1 to 2

・For details on the controller ID, refer to the help for the CONTROLLER function.

2

Specify 2 for the moment mode

LightingType

Specify IR Motion Camera lighting

0 All (Far + Near)
1 For Long Range Only
2 For Short Range Only
3 Lighting Off

・0, if not specified.

Gain

IR Motion Camera shooting gain: 1 to 16

・8 is the default.

Exposure

IR Camera exposure time: 7 to 600

・300 is the default.

IRSTOP ControllerID

Stop using the IR Motion Camera

・Calls from subprograms are ignored.

Argument

ControllerID

ID of the controller that stops using the IR Motion Camera: 1 to 2

・For details on the controller ID, refer to the help for the CONTROLLER function.

IRSTATE(ControllerID)

Get IR Motion Camera starting status

Argument

ControllerID

ID of the controller that acquires the status of the IR Motion Camera: 1 to 2

・For details on the controller ID, refer to the help for the CONTROLLER function.

Return Value

IR Camera status

0 Not in Use
1 Stopped
2 Starting Clustering
3 Starting Shooting Mode
4 Starting Moment Mode

IRREAD ControllerID OUT SamplingNumber,NoiseLevel,NumberOfData,DataArray

Read IR Motion Camera recognition results

・It is necessary to start using the IR Motion Camera with IRSTART.

Argument

ControllerID

ID of the controller that reads the recognition result of the IR Motion Camera: 1 to 2

・For details on the controller ID, refer to the help for the CONTROLLER function.

Return Value

SamplingNumber

A number that increases by 1 each time new data is read

・If the same number is acquired continuously, it indicates that new data has not been received yet.

NoiseLevel

Noise level during recognition

・A value between 0 and 2 is returned. The smaller the value, the less noise and the more accurate the value is.

NumberOfData

The number of data contained in the data array

・In the clustering mode, the number of recognized clusters is displayed. The array contains information for each cluster.
・It's always 48 in the moment mode. The array contains information of each block obtained by dividing the imaging area into 8×6.

DataArray

An array containing the read recognition results

・A 2D array with a width of 8.
・The height contains a meaningful value from 0 to the number of data -1.
・The coordinate range is X: (0 to 320) Y: (0 to 240).
・The data format for the clustering mode is as follows.

0 Cluster X Coordinate
1 Cluster Y Coordinate
2 Cluster Width
3 Cluster Height
4 Number of Pixels in Cluster
5 Cluster Barycentric Coordinates X
6 Cluster Barycentric Coordinates Y
7 Average Cluster Brightness

・Data format in the moment mode is as follows.

0 Average Block Brightness
1 Block Barycentric Coordinates X
2 Block Barycentric Coordinates Y

IRSPRITE ControllerID,SpriteID

Paste motion IR Motion Camera image acquired in the shooting mode to sprite

・The captured image continues to be reflected in the specified sprite in real time.
・Sprites created with IRSPRITE can be handled in the same way as normal sprites. However, if SPPAGE is specified, it cannot be restored.
・Shooting data in the shooting mode cannot be acquired as BASIC data.
・Calls from subprograms are ignored.

Arguments

ControllerID

ID of controller with IR Motion Camera linked to sprite: 1

・Only 1 can be specified in IRSPRITE.
・For details on the controller ID, refer to the help for the CONTROLLER function.

SpriteID

Sprite ID to be linked to the shot image: 0 to 4095

KEYBOARD(ScanCode[,FunctionID])
KEYBOARD ScanCode [,FunctionID] OUT Result,ModifierKeyInformation

Get USB keyboard input information

・Return values are all zero when the USB keyboard is not connected.

Arguments

ScanCode

USB Usage ID of the key you want to check: 0 to 255

FunctionID

The type of condition you want to know.

0 Key is pressed
1 Cannot be used (if specified, zero is returned as the result)
2 The moment the key is pressed
3 The moment the key is released

・0, if not specified.

Return Value

Results

1 if the key is specified by the function ID, 0 if not

ModifierKeyInformation

Returns modifier key press information in bits

bit0 Windows Key
bit1 Shift Key
bit2 Ctrl Key
bit3 Alt Key

Various Inputs (Toy-Con)

XCTRLSTYLE MaxNumberOfConnections,100,Toy-ConTypeLeft1,Toy-ConTypeRight1[,ConnectionDialogFlag ]
XCTRLSTYLE MaxNumberOfConnections,100,Toy-ConTypeLeft1,Toy-ConTypeRight1,Toy-ConTypeLeft2,Toy-ConTypeRight2[,ConnectionDialogFlag ]

Configure Toy-Con connection settings

・When using Toy-Con, use an exclusive use style for the operation style.
・Information as a normal Joy-Con can be acquired as equivalent to dual-controller grip in BUTTON, STICK, ACCEL, GYROA, GYROV.
・IR Motion Camera commands cannot be used while Toy-Con is in use.
・The operation result on the connection confirmation display can be confirmed with the RESULT function (1:Success, -1:Cancel).
・Calls from subprograms are ignored.

Arguments

MaxNumberOfConnections

Specify the maximum number of controllers you want to connect: 1 to 2

100

When using Toy-Con, specify 100 for the operation style

Toy-ConType

Set the type of Toy-Con to be recognized separately

Left Right
0 Toy-Con Recognition OFF Toy-Con Recognition OFF
1 × Piano
2 × House
3 △ Motorbike △ Motorbike
4 △ Fishing Rod △ Fishing Rod
5 × Robot
6 Visor ×
7 △ Car △ Car
8 △ Plane △ Plane
9 △ Submarine △ Submarine
10 7,8,9 All of Them 7,8,9 All of Them

・Values marked with x cannot be specified.
・The visor can only be specified on the left.
・Piano, house and robot can only be specified on the right.
・Types marked with △ must be specified for both left and right.
・10 is automatically switched to 7,8,9 by attaching the Vehicle Toy-Con Key.

ConnectionDialogFlag

Specify whether to always show the controller connection display

・If 1 is specified, the controller connection display will be displayed.
・If 0 is specified, the controller connection display is displayed only when the setting is changed.
・0, if not specified.

TCPIANO ControllerID OUT RecognitionFlag[,KeyButtonInformation,DialType,DialRotationAngularVelocity]

Get Toy-Con Piano recognition information

・Sspecifying a Toy-Con type other than 1 in XCTRLSTYLE results in an error.
・Return values after key/button information can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not the Toy-Con Piano is recognized

・Recognizing with 1, 0 is not recognized.

KeyButtonInformation

Return key/button status of Toy-Con Piano bit by bit

The meaning of each bit is as follows:

bit0 C
bit1 C#
bit2 D
bit3 D#
bit4 E
bit5 F
bit6 F#
bit7 G
bit8 G#
bit9 A
bit10 A#
bit11 B
bit12 C (one octave above)
bit13 Load Button
bit14 Octave Up
bit15 Octave Down
bit16 Play Button
bit17 Record Button

DialType

Dial type inserted in Toy-Con

0 Not Inserted, Cannot be Recognized
1 Bold Line
2 Fine Line
3 Two Lines
4 Middle Line

DialRotationAngularVelocity

Rotational angular velocity when a dial is inserted

・One lap in the clockwise direction is 1.0, and one lap in the counterclockwise direction is -1.0.

TCROBOT ControllerID OUT RecognitionFlag,LimbInformationArray[,Pitch,Roll,Yaw]

Get recognition information of Toy-Con Robot

・An error occurs if XCTRLSTYLE is used without starting Toy-Con Robot recognition.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return a bit value indicating whether each slot of the Toy-Con Robot is recognized

・Recognizing each bit 1 but not 0.

bit0 Right Foot
bit1 Right Hand
bit2 Left Hand
bit3 Left Foot

LimbInformationArray

Return a 2D numeric array containing information for each slot

The meaning of Y and X when the array element is [Y, X] is as follows

Y=0 Right Foot
1 Right Hand
2 Left Hand
3 Left Foot
X=0 Corrected Detection Value: 0 to 1
1 Detection Value Before Correction: 0 to 320
2 Min Correction Value: 0 to 320
3 Max Correction Value: 0 to 320
4 Corresponding Cluster ID

Pitch,Roll,Yaw

Posture angle information with the Toy-Con Robot

・The unit of angle is radian.

Pitch Tilt back and forth. If Toy-Con is tilted to the back, it is positive (value increases)
Roll Tilt left and right. If Toy-Con is tilted to the left, it is positive
Yaw Hip rotation. Rotate counterclockwise to make positive

TCVISOR ControllerID OUT RecognitionFlag,Pitch,Roll,Yaw

Get visor recognition information of Toy-Con Robot

・An error occurs if XCTRLSTYLE is used without recognizing the Toy-Con Robot visor.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return 1 if the visor is recognized correctly, 0 if not.

Pitch,Roll,Yaw

Visor attitude angle information

・It is assumed that the visor is attached to the head.
・The unit of angle is radian.

Pitch Tilt of raising/lowering the visor. If Toy-Con is raised, it is positive (value increases)
Roll Left/right tilt of head. If you tilt your neck to the left, it is positive
Yaw Head rotation. Rotate counterclockwise to make positive

TCHOUSE ControllerID OUT RecognitionFlag,InformationArray

Get Toy-Con recognition information

・An error occurs if XCTRLSTYLE is used without starting Toy-Con recognition.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not Toy-Con is recognized. Recognizing with 1. Not recognized by 0

InformationArray

Return a 2D numeric array containing information about each slot

The meaning of Y and X when the array element is [Y, X] is as follows

Y=0 Bottom Slot
1 Left Slot
2 Right Slot

・The type of block inserted as follows is stored at X=0.

0 No Block
1 Crank Block
2 Button Block
3 Key Block
4 Cable 1
5 Cable 2

・After X=1, the following values are stored.

X Crank Block Button Block Key Block Other
1 Rotation Speed Flag Flag 0
2 0 Push Amount Twist Amount 0
3 0 0 Insertion Direction 0

・The rotation speed of the Crank Block is a value of -1 to 1, and is stationary at 0.
・Button Block flags are as follows.

bit0 Pressed
bit1 Moment of Pressing

・The push amount of Button Block is 0 to 1.0. 0 is not pressed at all.
・The Key Block flag is at the moment the knob is released with 1 and is not released with 0.
・The twist amount is 0 to 1.0. 0 is not twisted at all.
・Insertion direction is 0 or other, and displays whether the Key Block is inserted vertically or horizontally.

TCFISHING ControllerID OUT RecognitionFlag[,FishingRodYaw,FishingRodPitch,ReelSpeed,FishingRodYawAngle,FishingRodPitchAngle]

Get recognition information for Toy-Con Fishing Rod

・An error occurs if XCTRLSTYLE is used without starting to recognize Toy-Con Fishing Rod.
・Return values after fishing rod yaw can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not the Toy-Con Fishing Rod is recognized. Recognizing with 1. Not recognized by 0

・The recognition method is to mount the left and right Joy-Con on the Toy-Con Fishing Rod and keep it stationary until the recognition flag returns 1.

FishingRodYaw

Get the fishing rod's yaw (left and right angle) as a value between -1.0 and 1.0

・Left is a positive value, right is a negative value, 0 is center.
・Gradually return to 0 even if left and right are not moved.

FishingRodPitch

Get the fishing rod pitch (up and down angle) with a value between -1.0 and 1.0

・Upward is a positive value, downward is a negative value, 0 is horizontal.

ReelSpeed

Get reel winding speed

・Hold the fishing rod and turn it away from you, it'll be a positive value. When turn it towards you, it'll be a negative value, 0 is stationary.
・It becomes 1.0 in one round.

FishingRodYawAngle

Get the yaw (left and right angle) of the fishing rod in radians

・Left is positive value, right is negative value, 0 is center.
・Gradually return to 0 even if left and right are not moved.

FishingRodPitchAngle

Get the fishing rod pitch (up and down angle) in radians

・Upward is a positive value, downward is a negative value, 0 is horizontal.

TCBIKE ControllerID OUT RecognitionFlag[,HandleTilt,AccelAmount,AccelAngle,WheelieAngle]

Get the recognition information of Toy-Con Motorbike

・An error occurs if XCTRLSTYLE is used without recognizing the Toy-Con Motorbike.
・Return values after HandleTilt can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return whether or not the Toy-Con Motorbike is recognized and the state of the operation button as a bit value

0 Unrecognized
bit0 Recognizing
bit1 Brake Lever
bit2 Left Front Button
bit3 Right Front Button

・Recognition method is to put the left and right Joy-Con on the Toy-Con Motorbike and keep them stationary until the recognition flag returns a value other than 0.
・If it is not recognized, the button status is always 0.

HandleTilt

Get the amount of handlebar tilt with a value between -1.0 and 1.0

・Tilt to the left for positive values, tilt to the right for negative values, 0 for horizontal.

AccelAmount

Get the amount of accelerator twist with a value between 0 and 1.0

・Return 0 when not twisted.

AccelAngle

Get accelerator twist angle in radians

・Return 0 when not twisted.

WheelieAngle

Get the angle in radians when the Toy-Con Motorbike is facing up

TCCAR ControllerID OUT RecognitionFlag[,Accelerator,WheelInput[,WheelAngle,LeftLever,RightLever,Cord,SideLever,LeftGimmick,RightGimmick]

Get recognition information of Toy-Con Car

・An error occurs if 7 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return a bit value indicating whether the car Toy-Con is recognized and the state of the operation button.

0 Unrecognized
bit0 Recognizing
bit1 Vehicle Toy-Con Key Button

Accelerator

Toy-Con Pedal depression: 0 to 1.0

WheelInput

Wheel rotation amount: -1.0 to 1.0

・-1.0 is 180 degrees to the left, 1.0 is 180 degrees to the right, 0 is straight.
・The upper and lower limits are maintained even if the wheel is rotated 180 degrees or more.

WheelAngle

Wheel rotation angle: -0.5 to 0.5

・-0.5 is 180 degrees to the left, 0.5 is 180 degrees to the right, 0 is straight.
・The value is reversed when the wheel is rotated 180 degrees or more.

LeftLever

Operation amount of the left lever: 0 to 1.0

RightLever

Operation amount of the right lever: 0 to 1.0

Cord

Cord pull amount: 0 to 1.0

SideLever

Operation amount of the side lever: 0 to 1.0

LeftGimmick,RightGimmick

Gimmick dial position of the left and right lever: 0 to 4

TCPLANE ControllerID OUT RecognitionFlag[,Accelerator,StickX,StickY]

Get recognition information of Toy-Con Plane

・An error occurs if 8 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return the bit value of whether the operation Toy-Con Plane is recognized and the state of the operation button.

0 Unrecognized
bit0 Recognizing
bit1 Vehicle Toy-Con Key Button
bit2 Trigger Button

Accelerator

Toy-Con Pedal depression: 0 to 1.0

StickX

Tilt in the left and right direction of the Stick: -1.0 to 1.0

・-1.0 is all the way to the left, -1.0 is all the way to the right, 0 is center.

StickY

Tilt in the back and forth direction of the Stick: -1.0 to 1.0

・-1.0 is farthest from you, -1.0 is closest, 0 is center.

TCSUBM ControllerID, OUT RecognitionFlag[,Accelerator,LeftWheelAngle,RightWheelAngle]

Get recognition information of Toy-Con Submarine

・An error occurs if 9 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

RecognitionFlag

Return the bit value of whether or not Toy-Con Submarine is recognized and the state of the operation button.

0 Unrecognized
bit0 Recognizing
bit1 Vehicle Toy-Con Key Button
bit2 Toy-Con Submarine Button

Accelerator

Toy-Con Pedal depression: 0 to 1.0

LeftWheelAngle

Left wheel rotation angle: -0.5 to 0.5

・-0.5 indicates -180 degrees, 0.5 indicates 180 degrees.
・The value is reversed when the wheel is rotated 180 degrees or more.

RightWheelAngle

Right wheel rotation angle: -0.5 to 0.5

・-0.5 indicates -180 degrees, 0.5 indicates 180 degrees.
・The value is reversed when the wheel is rotated 180 degrees or more.

TCVEHICLE(ControllerID)

Return the currently recognized DriveKit Toy-Con type

・If XCTRLSTYLE is not set to use Toy-Con, an error occurs.

Argument

ControllerID

ID of the controller that acquires information: 1 to 2

Return Value

Toy-ConType

One of the following values:

0 Unrecognized
7 Car
8 Plane
9 Submarine

・Return a value other than 0 only when Toy-Con type 7, 8, 9, 10 is specified in XCTRLSTYLE.

Files

FILES ["FileType:"]
FILES "[FileType:] ProjectName"

Display a List of Files on the Console

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.

Arguments

FileType

Specify when you want to display a specific file type.

・If not specified, all files will be displayed.

ProjectName

The name of the project for which you want to get a list

・If not specified, a list of files in the current project will be displayed.

Example

FILES
FILES "TXT:PROJECT" 

FILES "//"

Display a List of Projects on the Console

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.

Argument

"//"

If "//" is specified, the project list is displayed.

Example

FILES "//" 

FILES(["FileType:"])
FILES("[FileType:] ProjectName")

Create an Array Containing a List of Files and Projects

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.

Arguments

FileType

Specify when you want to get a specific file type

・If not specified, all files are acquired.

ProjectName

The name of the project for which you want to get a list

・If not specified, get a list of files in the current project.

Return Value

A string array containing a list of files

Example

NAMETBL$ = FILES()
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT

FILES("//")

Create an Array Containing a List of Projects

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.

Argument

"//"

If "//" is specified, the project list is acquired.

Return Value

A string array containing a list of projects

Example

NAMETBL$ = FILES("//")
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT

FILES ["FileType:",]StringArray
FILES "[FileType:]ProjectName,StringArray

Get a List of Files in Array

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.

Arguments

FileType

Specify when you want to get a specific file type

ProjectName

The name of the project for which you want to get a list.

・If not specified, get a list of files in the current project.

StringArray

・A string array that stores the file names in the file list.
・In the case of a one-dimensional array, it is automatically expanded according to the number of acquired files.

Example

DIM NAMETBL$[]
FILES NAMETBL$
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT

FILES "//",StringArray

Get a List of Projects in Array

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.

Arguments

"//"

If "//" is specified, the project list is acquired.

StringArray

・A string array that stores the project names in the project list.
・In the case of a one-dimensional array, it is automatically expanded according to the number of acquired files.

Example

DIM NAMETBL$[]
FILES "//", NAMETBL$
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT

LOAD "[FileType:]FileName"[,Slot]

Load the Program

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

Only TXT can be specified as the file type

・If not specified, TXT is specified.

FileNameString

File name to read

Slot

Slot to read program: 0-3

・0, if not specified.

Example

LOAD "PROGNAME" 
LOAD "SUBPROG",1

LOADG "[FileType:]FileName",GraphicPage[,OX,OY]
LOADG "[FileType:]FileName",GraphicPage[,OX,OY] OUT Width,Height

Load Image Files

・When the offset is specified, the protruding part is ignored.
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

GRP, JPG or DAT can be specified

・If not specified, GRP is specified.
・If DAT is specified, files other than 2D Int arrays will result in an error.

FileNameString

File name to read

GraphicPages

Graphic pages for storing read image data: 0 to 5

OX,OY

Destination coordinates for an image

・If not specified, 0,0 is specified.

Return Value

Width,Height

The width and height of the loaded image data

Example

LOADG "GRPDATA",1
LOADG "DAT:DATA",2,0,64
LOADG "GRPDATA",2 OUT W,H

LOADV("FileType:FileName")

Read File Contents and Return as String or Array

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

DAT, TXT, GRP can be specified

・Cannot be omitted.

FileName

File name to read

Return Value

Contents of the read file

・If DAT and GRP are specified, it returns an array containing the data in the DAT and GRP files.
・If reading DAT and GRP files fails, it returns a 1D Int solution with 0 number of elements.
・When TXT is specified, it returns the string of the TXT file contents.
・If reading the TXT file fails, it returns an empty string.

Example

TX$=LOADV("TXT:MEMOFILE")
DT=LOADV("DAT:DATAFILE")

LOADV "FileType:FileName",Array

Read the Contents of a File into an Array

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

DAT, GRP can be specified

・Cannot be omitted.

FileName

File name to read

Array

Array variable that stores the read data

・The dimension of the array data stored in the file to be read must match the dimension of the target array.
・When specifying a string array, the data in the file must also be saved from the string array.
・The number of array elements is automatically expanded according to the information in the file.

Example

DIM MARRAY[]
LOADV "DAT:MDATA",MARRAY

SAVE "[FileType:]FileName"[,Slot]

Save the Program

・When overwriting, the file before overwriting is saved as @BACKUP.PRG.
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

Only TXT can be specified

・If not specified, TXT is specified.

FileName

File name to give to the program to save

Slot

Slot number for programs to save: 0-3

・0, if not specified.

Example

SAVE "TEST" 
SAVE "TEST2",2

SAVEG "[FileType:]FileName",GraphicPage[,StartPointX,StartPointY,Width,Height]

Save Graphic Page Contents to File

・When overwriting, the file before overwriting is saved as @BACKUP.GRP.
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

Only GRP can be specified

・If not specified, GRP is specified.

FileName

Name to give the save file

GraphicPages

Graphic pages to save: 0-5

StartPointX,StartPointY

Specify the upper left coordinate of the area you want to save (0 and 2047 for both X and Y)

・If not specified, 0,0 is specified.

Width,Height

Specify the size of the area you want to save (both width and height are 1 to 2048)

・An error occurs if the result of adding the start point X and width or the start point Y and height exceeds 2048.
・If not specified, 2048,2048 is specified.

Example

SAVEG "GRP:GAZOU",0
SAVEG "GAZOU_ICHIBU",3,100,100,300,300

SAVEG "JPG:FileName",GraphicPage[,StartPointX,StartPointY,Width,Height] [,CompressionAmount]

Save the Contents of a Graphic Page to a File in High Compression Format

・The high compression format can be saved in a smaller file than the normal compression format, but the image quality decreases each time when it is saved (lossy compression).
・When overwriting, the file before overwriting is saved as @BACKUP.JPG.
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

Only JPG can be specified

FileName

Name to give the save file

GraphicPages

Graphic pages to save: 0-5

StartPointX,StartPointY

Specify the upper left coordinate of the area you want to save (0 and 2047 for both X and Y)

・If not specified, 0,0 is specified.

Width,Height

Specify the size of the area you want to save (both width and height are 1 to 2048)

・An error occurs if the result of adding the start point X and width or the start point Y and height exceeds 2048.
・If not specified, 2048,2048 is specified.

CompressionAmount

Specify a value that represents the compression amount and image quality (1 to 100)

・The smaller the number, the higher the compression ratio, but the image quality decreases.
・The default is 60.

Example

SAVEG "JPG:GAZOU",0,80
SAVEG "JPG:GAZOU_ICHIBU",3,100,100,300,300

SAVEV "FileType:FileName",Variable

Save Variable Contents to File

・When overwriting, the file before overwriting is saved as @BACKUP.TXT or @BACKUP.DAT.
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

TXT, DAT, GRP can be specified

・Cannot be omitted.

FileName

Name to give to saved file

Variable

Variables that stores the data you want to save

・For TXT, specify a string variable.
・For DAT, specify an array. There are no restrictions on the type or dimension of the array.
・For GRP, specify a 2D Int array.

Example

SAVEV "TXT:MEMO",TX$
DIM MAP[10,10]
SAVEV "DAT:MAP",MAP
DIM IMG%[32,32]
SAVEV "GRP:IMG",IMG%

PROJECT()

Get the Current Project

Return Value

The name of the current project

EXEC "[FileType:]FileNameString"[,Slot]

Loading and Executing Programs

・Cannot be executed in DIRECT mode.
・The variables of the specified slot, SPFUNC, TFUNC setting contents will be cleared.
・If the currently executing slot is specified, the currently executing program will be replaced by the specified program, and execution will end at END of the specified program.
・If a slot other than the currently executing slot is specified, the program in the specified slot is executed, and when the END command is executed, it returns to the next command of EXEC.
・When specifying a slot, only the slot that is currently executing and the slot where there is no code that may be executed can be specified.

Arguments

FileType

Only TXT can be specified

・If not specified, TXT is specified.

FileName

File name of program to be read

Slot

Slot to read program

・If not specified, the currently executing slot is specified.

Example

EXEC "SAMPLE" 
EXEC "SBGED",1

EXEC Slot

Run the Program in the Specified Slot

・Cannot be executed in DIRECT mode.
・The variables of the specified slot, SPFUNC, TFUNC setting contents will be cleared.
・If the currently executing slot is specified, the currently executing program is executed again from the beginning.
・If a slot other than the currently executing slot is specified, the program in the specified slot is executed, and when the END command is executed, it returns to the next command of EXEC.
・When specifying a slot, only the slot that is currently executing and the slot where there is no code that may be executed can be specified.

Argument

Slot

Slot number of program to execute: 0-3

・The currently executing slot cannot be specified.

Example

EXEC 2

CHKFILE("[FileType:]FileNameString")

Check if the specified file exists

Arguments

FileType

File type to check

・If not specified, TXT is specified.

FileName

File name to check

Return Value

Returns 1 if it exists, 0 if it does not exist

Example

A=CHKFILE("SBATTACK")
B=CHKFILE("GRP:SBATTACK")

DELETE "[FileType:]FileName"

Deleting Files

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

The type of files you want to delete

・If not specified, TXT is specified.

FileName

File name to be deleted

Example

DELETE "TEST" 
DELETE "GRP:PICTURE" 

RENAME "[FileType1:]FileName1","[FileType2:]FileName2"

Rename the File

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType1

The type of file you want to rename

・If not specified, TXT is specified.

FileName1

The name of the file you want to rename

FileType2

File type of the destination file

・An error ocurrs if the file type is different from FileType1.
・If not specified, it'll be the same as FileType1.

FileName2

Destination file name

Example

RENAME "TEST1","TEST2" 
RENAME "GRP:PICTURE1","PICTURE2" 

Screen Control

ACLS
ACLS GRPSaveFlag,SPDEFSaveFlag,GRPFSaveFlag[,ANIMDEFSaveFlag]

Clear all display settings and return to the startup state

・If you specify arguments, you can save some settings without resetting them.

Arguments

GRPSaveFlag

If 1 is specified, the graphic page excluding the font page is saved without being cleared.

・0, if not specified.

SPDEFSaveFlag

If 1 is specified, it saves SPDEF contents.

・0, if not specified.

GRPFSaveFlag

If 1 is speciified, it saves without clearing the font page.

・0, if not specified.

ANIMDEFSaveFlag

If 1 is specified, the content defined by ANIMDEF is saved without being cleared.

・0, if not specified.

Example

'ACLS works almost the same as the following program
DEF ACLS KEEPGRP,KEEPSPDEF,KEEPGRPF
 VAR SCW=400,SCH=240

 XSCREEN SCW,SCH,2
 SPCLR
 BACKCOLOR &HFF000000
 FOR I=0 TO 3
  TSCREEN I,16,16:TPAGE I,4,1024,0
  TLAYER I,0:TOFS I,0,0,0:ATTR I,0
  COLOR I,#C_WHITE:CLS I
 NEXT
 TSCREEN #TCONSOLE,16,8:TPAGE #TCONSOLE,4,1024,0
 TLAYER #TCONSOLE, 0:TOFS #TCONSOLE,0,0,-4095:ATTR 0
 COLOR #C_WHITE:CLS
 IF !KEEPGRP THEN
  FOR I=0 TO 5:GTARGET I:GCLS:NEXT
  LOADG "GRP:#SYS/DEFGRP",4
 ENDIF
 IF !KEEPGRPF THEN
  LOADG "GRP:#SYS/DEFFONT",#GRPF
 ENDIF
 GTARGET 0
 GCOLOR #C_WHITE
 GCLIP 0,0,#GRPWIDTH-1,#GRPHEIGHT-1
 SPSET #GSPRITE,0,0,SCW,SCH,0,1
 SPPAGE #GSPRITE,0
 SPLAYER #GSPRITE,0
 SPOFS #GSPRITE,0,0,4095
 IF !KEEPSPDEF THEN
  SPDEF
 ENDIF
 ANIMDEF
 FOR I=0 TO 7:LAYER I:LFILTER I:LCLIP I:LMATRIX I:NEXT
 FADE 0
END

XSCREEN Width,Height[,SampleMagnification[,CompositeMode[,AspectRatio]]]

Set the display resolution

・The size of the console (text screen 4) is changed according to the width and height.
・Other text screen settings remain the same.
・Graphic page sprite settings are changed according to the width and height.

Arguments

Width,Height

Specify the display width and height in pixels

Width: 128 to 1280

Height: 128 to 720

・A number that can be divided by 4 can be specified for both width and height.

SampleMagnification

Pixels can be subdivided to express rotation and enlargement more smoothly.

・It can be specified 1 or more, the product of width multiplied by sample magnification should be up to 1280, and the product of height multiplied by sample magnification should be up to 720.
・1, if not specified.

Composition mode

Specify the drawing method when the BASIC display is finally combined with the indicating display

0 Bilinear
1 Smart Nearest Neighbor
2 Nearest Neighbor

・0 is smooth pixel corner, but the whole image is blurred.
・2 is a clear display as a whole, but the pixel corners are jagged.
・1 is between 0 and 2.
・0, if not specified.

AspectRatio

Display aspect ratio: 0.1 to 10

・Square at 1, vertical when smaller than 1, horizontal when larger than 1.
・If not specified, width / height is set.

XSCREEN OUT Width,Height [,SampleMagnification[,CompositeMode[,AspectRatio]]]

Get display resolution

Return Value

Width,Height

The width and height of the display (in pixels)

SampleMagnification

CompositeMode

AspectRatio

ANIMDEF DefinitionNumber,AnimationTarget,DataArray [,Loop]

Animation definition

・The defined animation can be used with SPANIM and TANIM commands.

Arguments

DefinitionNumber

Animation definition number: 0 to 1023

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the value, the sprite will be deleted when the animation ends.

DataArray

1D numeric array that stores animation data

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

DataArray

・Animation data is prepared in the following order in the numerical array (up to 32).
・Time1,Item1,[Item2,] Time2,Item1,[Item2,]...

Example

DIM PANIM[ 6 ]
PANIM[0]=-60 'frame(-60=smooth)
PANIM[1]=200 'offset X,Y
PANIM[2]=100
PANIM[3]=-30 'frame
PANIM[4]=50 'offset
PANIM[5]=20
ANIMDEF 0,"XY",PANIM

ANIMDEF DefinitionNumber,AnimationTarget,@Label[,Loop]
ANIMDEF DefinitionNumber,AnimationTarget,LabelString[,Loop]

Animation definition (specified with DATA command)

・The defined animation can be used with SPANIM and TANIM commands.

Arguments

DefinitionNumber

Animation definition number: 0 to 1023

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the value, the sprite will be deleted when the animation ends.

@Label

The first label of the DATA command that stores the animation data

LabelString

A string containing the label name can be specified instead of the label.

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Data

Animation data is prepared in the following order in the DATA instruction

DATA NumberOfKeyFrames(up to 32)
DATA Time1,Item1[,Item2]
DATA Time2,Item1[,Item2]
:

Example

@MOVDATA
DATA 2 'counter
DATA -60,200,100 'frame,offset
DATA -30,50,20 'frame,offset
ANIMDEF 0,"XY",@MOVDATA

ANIMDEF DefinitionNumber,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]

Animation definition (specify as direct arguments)

・The defined animation can be used with SPANIM and TANIM commands.

Arguments

DefinitionNumber

Animation definition number: 0 to 1023

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the value, the sprite will be deleted when the animation ends.

Time,Item

・Animation data itself (up to 32 as many as necessary).

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Example

ANIMDEF 0,"XY",-60,200,100,-30,50,20

ANIMDEF DefinitionNumber

Clear the animation of the specified definition number

Argument

DefinitionNumber

Animation definition number to clear: 0 to 1023

Example

ANIMDEF 0

ANIMDEF

Clear all animation definitions

Example

ANIMDEF

BACKCOLOR BackgroundColor

Set the background color of the BASIC display

Argument

BackgroundColor

Background color code

BACKCOLOR()

Get background color of the BASIC display

Return Value

Background color

Set background color code

FADE FadeColor

Apply a fade effect to the display

・The effect is the same as covering the entire display with a sprite filled with a fade color.

Argument

FadeColor

Fade color code

・The greater the alpha component, the darker the color.

FADE FadeColor,Time

Apply fade-in and fade-out effects

・Over time, change the fade color gradually from the current fade color to the specified color.

Arguments

FadeColor

Fade color code

・The greater the alpha component, the darker the color.
・If the alpha component is 255, it's fade out effect.
・If the alpha component is 0, it's fade-in effect.

Time

Specify the fade effect time with the frame count

・If there is no processing loss, 60 is 1 second.

FADE()

Get the current fade color

Return Value

Current fade color

・You can also get the color during fade-in/fade-out.

FADECHK()

Check if it's during fade-in/fade-out

Return Value

1 if it's during fade-in/fade-out, 0 if not

Text Screen Input/Output

CLS
CLS ScreenID

Clear the text screen

Argument

ScreenID

ID of text screen to delete: 0 to 4

・4 is the default.

Example

CLS
CLS 1

COLOR [ScreenID,]ColorCode

Set the drawing color of characters

・When this command is executed, the color of characters displayed in PRINT, TPRINT, INPUT, etc. will change.

Arguments

ScreenID

Text screen ID to specify the drawing color: 0 to 4

・4 is the default.

ColorCode

Character drawing color

・ARGB 8-bit color code
・See GCOLOR for details on color codes

Example

COLOR #C_WHITE
COLOR 1,#C_RED
COLOR RGB(128,192,64,64)

COLOR([ScreenID])

Get the drawing color of characters

・Get the current character drawing color.

Argument

ScreenID

ID of text screen to obtain drawing color: 0 to 4

・4 is the default.

Example

C=COLOR()
C1=COLOR(1)

LOCATE [CoordinateX],[CoordinateY]
LOCATE ScreenID,[CoordinateX],[CoordinateY]

Specify the character display coordinates to the text screen

・When this command is executed, the display coordinates of characters to be displayed in PRINT, TPRINT, INPUT, etc. will change.

Arguments

ScreenID

Text screen ID to specify display coordinates: 0 to 4

・4 is the default.

CoordinateX,CoordinateY

・Specify the coordinates to display characters.
・The number of characters that can be displayed depends on the screen size set in TSCREEN.

*If X or Y is not specified, the previous X and Y coordinates are maintained.

Example

LOCATE 20,15
LOCATE ,10
LOCATE 1,10,0

LOCATE [ScreenID] OUT CoordinateX,CoordinateY

Get character display coordinates

・Get the current character display coordinates.

Argument

ScreenID

Text screen ID to specify display coordinates: 0 to 4

・4 is the default.

Return Value

CoordinateX,CoordinateY

・Get the current character display coordinates.

Example

LOCATE OUT X,Y
LOCATE 1 OUT X1,Y1

PRINT [Expression[;Or,Expression...]]

Console character display

・If the expression is not specified, only line feed is performed.
・As an abbreviation, you may write '?'.
・PRINT displays on screen 4.
・TPRINT can specify the displayed destination screen.

Arguments

Expression

・Variables to be displayed, string variables, numeric values, strings

; (semicolon)

No line break at the end of display

, (comma)

・Displays a blank character without a line break after display.

Example

PRINT "RESULT(X,Y)=";DX*4+1,DY+1

TPRINT ScreenID[,Expression[;Or,Expression...]]

Character display on text screen

・If the expression is not specified, only line feed is performed.
・As an abbreviation, you may write 'T?'.
・Unlike PRINT, TPRINT can specify the displayed destination screen.

Arguments

ScreenID

ID of the screen that displays characters: 0 to 4

Expression

・Variables to be displayed, string variables, numeric values, strings
・Calculation formulas using arithmetic operations and functions can also be described (calculation results are displayed).

; (semicolon)

After display, it doesn't make a line break, and put the next display closely.

, (comma)

・After display, it doesn't make a line break, and open the next display at uniform space.

Example

TPRINT 1,CHR$(&HEA01);CHR$(&HEA02);

ATTR [ScreenID,]HorizontalFlip,VerticalFlip,Rotation
ATTR [ScreenID,]DisplayAttribute

Set the attributes of characters to be displayed on the text screen

・When this command is executed, the display attributes of characters displayed in PRINT, TPRINT, INPUT, etc. will change.

Arguments

ScreenID

Text screen ID to specify character display attributes: 0 to 4

・4 is the default.

HorizontalFlip

・Invert the displayed character left and right with 1.
・No inversion at 0.

VerticalFlip

・Invert the displayed characters up and down with 1.
・No inversion at 0.

Rotation

・Rotate 0, 90, 180, and 270 degrees with 0, 1, 2, and 3, respectively.

DisplayAttribute

・Set the horizontal flip, vertical flip, and rotation as a bit value.

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01
b02 Horizontal Flip (0=OFF, 1=ON)
b03 Vertical Flip (0=OFF, 1=ON)

Example

ATTR 0,0,1:PRINT "ABC" 
ATTR 2,8:TPRINT 2,"XYZ" 

ATTR [ScreenID] OUT HorizontalFlip,VerticalFlip,Rotation
ATTR( [ScreenID])

Get display character attribute of text screen

Argument

ScreenID

ID of the text screen that acquires the character display attribute: 0 to 4

・4 is the default.

Return Value

HorizontalFlip

・Invert the displayed character left and right with 1.
・No inversion at 0.

VerticalFlip

・Invert the displayed characters up and down with 1.
・No inversion at 0.

Rotation

・Rotate 0, 90, 180, and 270 degrees with 0, 1, 2, and 3, respectively.

DisplayAttribute

・Get the horizontal flip, vertical flip, and rotation as a bit value.

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01
b02 Horizontal Flip (0=OFF, 1=ON)
b03 Vertical Flip (0=OFF, 1=ON)

Example

ATTR OUT HREV,VREV,ROT
A2=ATTR(2)

SCROLL [ScreenID,]NumberOfCharactersX,NumberOfCharactersY

Scroll the contents of the text screen

・Shift the contents of the text screen in units of characters.
・Characters pushed out of the screen as a result of scrolling disappear.

Argument

ScreenID

ID of scrolling text screen: 0-4

・4 is the default.

NumberOfCharactersX

Number of scroll characters in horizontal direction

・Scroll left for positive values and right for negative values.

NumberOfCharactersY

Number of scroll characters in the vertical direction

・Scroll up with positive values and down with negative values.

Example

SCROLL 5,7
SCROLL 1,-1,0

CHKCHR([ScreenID,]CoordinatesX,Y)

Check the character code of the character displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

・4 is the default.

CoordinateX,Y

Coordinates in character units

Return Value

Character code of the character displayed at the specified coordinates

・If no character is displayed, zero is returned.

Example

CODE=CHKCHR(0,0)
CODE=CHKCHR(1,10,10)

CHKCHR [ScreenID,]CoordinateX,Y OUT CharacterCode,DisplayAttribute

Check the character code and display attributes of characters displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

・4 is the default.

CoordinateX,Y

Coordinates in character units

Return Value

CharacterCode

Character code of the character displayed at the specified coordinates

・If no character is displayed, zero is returned.

DisplayAttribute

Display attribute set at specified coordinates

・See ATTR cmmand.

Example

CHKCHR 0,0 OUT CH,AT
CHKCHR 1,10,10 OUT CH,AT

CHKCHR(ScreenID,CoordinatesX,Y,CoordinateConversionFlag)

Check the character code of the character displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

CoordinateX,Y

Coordinate to check character code

・The meaning of coordinates changes depending on the value of the next coordinate conversion flag.

CoordinateConversionFlag

Flag that specifies the coordinate system of coordinates X and Y

・In case of 0, it is interpreted as character unit coordinates (same as LOCATE coordinates).
・In case of 1, it is interpreted as display coordinates (same as TOFS etc.).
・In the case of display coordinates, the influence of LMATRIX is not considered.

Return value

Character code of the character displayed at the specified coordinates
・ If no character is displayed, zero is returned.

Example

CODE = CHKCHR (1,10,10,0)
CODE = CHKCHR (1,200,120,1)

CHKCHR ScreenID,CoordinatesX,Y,CoordinateConversionFlag OUT CharacterCode,DisplayAttribute

Check the character code and display attributes of characters displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

CoordinateX,Y

Coordinate to check character code

・The meaning of coordinates changes depending on the value of the next coordinate conversion flag.

CoordinateConversionFlag

Flag that specifies the coordinate system of coordinates X and Y

・In case of 0, it is interpreted as character unit coordinates (same as LOCATE coordinates).
・In case of 1, it is interpreted as screen coordinates (same as TOFS etc.).
・In the case of screen coordinates, the influence of LMATRIX is not considered.

Return Value

CharacterCode

Character code of the character displayed at the specified coordinates

・If no character is displayed, zero is returned.

DisplayAttribute

Display attribute set at specified coordinates

・See ATTR command.

Example

CHKCHR 1,10,10,0 OUT CH,AT
CHKCHR 1,200,120,1 OUT CH,AT

INPUT ["GuideString";]Variable[,Variable2...]

Enter numbers or strings from the keyboard

・Waiting for input until the ENTER key is entered.
・When the number of inputs is insufficient, “?Redo from start” is displayed and input again.
・Unlike other text screen commands, the text screen is fixed at 4.

Argument

GuideString

Guide message for input (optional)

・If the semicolon after the guide string is set to a comma, ? is not displayed.
・Only when using a semicolon, string variables can be used for the guide string.

Variable

Variable that receives input (numeric or string variable)

・When specifying multiple variables, separate them with a comma.

Example

INPUT "Input your name and age";NM$,AG

LINPUT ["GuideString";]StringVariable

Get string from keyboard

・Accepts "," etc. that cannot be input with the INPUT command.
・Waiting for input until the ENTER key is entered.
・Unlike other text screen commands, the text screen is fixed at 4.

Arguments

GuideString

Guide message for input (optional)

StringVariable

String variable that receives one line of input

Example

LINPUT "ADDRESS:";ADR$

INKEY$()
INKEY$(ControllerInputExclusionFlag)

Get one character entered from the keyboard

・Even if there is no input from the keyboard, it doesn't wait for input.
・When there is a preceding key input, it returns one character at a time from the oldest input.

Argument

ControllerInputExclusionFlag

・If 0 is specified, a part of the controller's button input is returned as a key input.
・If 1 is specified, the controller input is ignored.
・0, if not specified.

Correspondence between controller input and characters is as follows

+Control Pad Right CHR$(&H1C)
+Control Pad Left CHR$(&H1D)
+Control Pad Up CHR$(&H1E)
+Control Pad Down CHR$(&H1F)
A Button CHR$(&H0D)
Y Button CHR$(&H08)

Return

・Returns characters entered from the keyboard one by one.
・If there is no input, the empty string "" is returned.
・Special keys return the following characters.

Esc CHR$(&H1B)
Tab CHR$(&H09)
BackSpace CHR$(&H08)
Enter CHR$(&H0D)
Insert CHR$(&H1A)
Delete CHR$(&H10)
Home CHR$(&H02)
End CHR$(&H03)
PageUp CHR$(&H11)
PageDown CHR$(&H12)
CHR$(&H1C)
CHR$(&H1D)
CHR$(&H1E)
CHR$(&H1F)

Example

C$=INKEY$()
KBONLY$=INKEY$(1)

TSCREEN FontType[,CharacterSize]

Set the width of the console (text screen 4) and the font used for display

・The width and height are set by dividing the screen size by the character size.

Arguments

FontType

Type of font used for display: 8 to 64 (multiple of 8)

・If you specify 24 or more, only user-defined characters will be displayed.

FontSize

Character display size: 8 to 64

Example

TSCREEN 8

TSCREEN ScreenID,FontType,CharacterSize[,Width,Height]
TSCREEN ScreenID,FontType,Width,Height

Set text screen size and font used for display

Arguments

ScreenID

ID of text screen to set: 0 to 4

FontType

Type of font used for display: 8 to 64 (multiple of 8)

・If you specify 24 or more, only user-defined characters will be displayed.

FontSize

Character display size: 8 to 64

Width,Height

Specify text screen width and height in characters

・Width x height can be specified up to 32768.
・If the width and height not specified or 0 is specified, the current screen size divided by the character size is set.

Example

TSCREEN 1,16,16,100,100

TSCREEN [ScreenID] OUT FontType,CharacterSize,Width,Height

Get text screen size and font used for display

Argument

ScreenID

ID of text screen to delete: 0 to 4

・4 is the default.

Return Value

FontType

Type of font used for display: 8 to 64

FontSize

Character display size: 8 to 64

Width,Height

Text screen width and height

Example

TSCREEN OUT FONT,SIZE,W,H
TSCREEN 1 OUT FONT,SIZE,W,H

TPAGE [ScreenID,]GraphicPage,ReferenceOriginX,ReferenceOriginY

Set a reference graphic page for user-defined characters

・Set a graphic page that references a picture of user-defined characters and a reference origin.
・User-defined characters are 4096 characters from &HE800 to &HF7FF, and characters in this range refer to the place set by TPAGE as the font.
・Normal characters that are not user-defined characters cannot change the reference graphic page or reference origin.
・Calling TPAGE after indicating characters also affects the displayed characters.

Arguments

ScreenID

ID of text screen to set: 0 to 4

・4 is the default.

GraphicPage

Reference graphic page: -1 to 5

ReferenceOriginX,ReferenceOriginY

Reference origin coordinates in the graphic page

・For user-defined characters, refer to the range of 64x64 characters from the reference origin.
・If the font type is 8, it will be 512x512 pixels, if it is 16, it will be 1024x1024 pixels, if 32, it will be 2048x2048 pixels.

TPAGE [ScreenID] OUT GraphicPage,ReferenceOriginX,ReferenceOriginY

Get a reference graphic page for user-defined characters

Arguments

ScreenID

ID of the text screen to obtain reference information: 0 to 4

・4 is the default.

GraphicPage

Graphic page to refer to

ReferenceOriginX,ReferenceOriginY

Reference origin coordinates in the graphic page

TCOLOR ScreenID,ColorCode

Set the color to multiply the entire text screen

・COLOR sets the color in units of characters, whereas TCOLOR changes the overall color by multiplying the entire text screen by the specified color.

Arguments

ScreenID

ID of text screen to set: 0 to 4

ColorCode

Drawing color to set

・8-bit color code for each ARGB
・See GCOLOR

TCOLOR(ScreenID)

Get the color to multiply the entire text screen

Argument

ScreenID

ID of text screen to get color from: 0 to 4

Return Value

Drawing color set for the specified text screen

TLAYER ScreenID,LayerID

Set the layer to which the text screen belongs

Arguments

ScreenID

ID of text screen to set: 0 to 4

LayerID

ID of the layer to which the screen belongs: 0 to 7

TLAYER(ScreenID)

Get the layer to which the text screen belongs

Argument

ScreenID

ID of text screen to obtain layer ID: 0 to 4

Return Value

Layer ID to which the screen belongs

TPUT ScreenID,X,Y,CharacterCode[,DisplayAttribute]
TPUT ScreenID,X,Y,String[,DisplayAttribute]

Write a character at the specified coordinates on the text screen

Arguments

ScreenID

Text screen ID for writing characters: 0 to 4

X,Y

Coordinate to write character

CharacterCode

Character code of characters to write: 0 to 65535

・If you specify a character code that does not have a font, x is displayed.

String

A string containing the character to write

・Write the first character.

DisplayAttribute

Character display attribute

・Same display attributes as set by ATTR.
・If not specified, the display attribute set in ATTR is used.

TFILL ScreenID,StartPointX,StartPointY,EndPointX,EndPointY,CharacterCode[,DisplayAttribute]
TFILL ScreenID,StartPointX,StartPointY,EndPointX,EndPointY,String [,DisplayAttribute]

Fill the specified area of the text screen with the specified character/string

Arguments

ScreenID

Text screen ID for writing characters: 0 to 4

StartPointX,StartPointY,EndPointX,EndPointY

Range to write characters

・The upper left area is a rectangle surrounded by the StartPointX and StartPointY, and the lower right area is surrounded by the EndPointX and EndPointY.

CharacterCode

Character code of characters to write: 0 to 65535

・If you specify a character code that does not have a font, x is displayed.

String

A string containing the character to write

・The characters in the string fill from the upper left to the right. When they reach at the far right, step down one line and fill from the left end to the right.

DisplayAttribute

Character display attribute

・Same display attributes as set by ATTR.
・If not specified, the display attribute set in ATTR is used.

Example

TFILL 0,2,2,10,5,&HE810,#A_REVV
TFILL 0,2,6,11,10,"ABC" 

THOME ScreenID,HomeCoordinateX,HomeCoordinateY

Set the home coordinate (coordinate reference point) of the text screen

Home coordinates are used as the coordinate reference point of the TOFS command, TROT(Rotation) and TSCALE (scaling) center point

Arguments

ScreenID

ID of text screen to set: 0 to 4

HomeCoordinateX,HomeCoordinateY

Home coordinate to be set

・Depending on the hardware specifications, setting a Real may cause the reference font image to shift by one pixel.

THOME ScreenID OUT HomeCoordinateX,HomeCoordinateY

Get text screen home coordinates

Argument

ScreenID

ID of text screen to obtain: 0 to 4

Return Value

HomeCoordinateX,HomeCoordinateY

Home coordinate

TOFS ScreenID,X,Y[,Z]

Set text screen display coordinates

・The relationship between THOME and TOFS can be thought of as "take the coordinates on the text screen set with THOME to the coordinates on the display set with TOFS".

Arguments

ScreenID

ID of text screen to set: 0 to 4

X,Y

Display coordinates to be set

・Depending on the hardware specifications, setting a Real may cause the reference font image to shift by one pixel.

Z

Display priority: -4095 to 4095

・The smaller it is, the closer it is displayed.

TOFS ScreenID OUT X,Y[,Z]

Get text screen display coordinates

Argument

ScreenID

ID of text screen to obtain: 0 to 4

Return Value

X,Y

Display coordinates

Z

Display priority

TROT ScreenID,Angle

Set text screen rotation angle

・Rotate around the home position set in THOME.

Arguments

ScreenID

ID of text screen to set: 0 to 4

Angle

Rotation angle (degree)

・Depending on the hardware specifications, the reference font image may be shifted by 1 pixel depending on the setting angle.

TROT(ScreenID)

Get text screen rotation angle

Argument

ScreenID

ID of text screen to obtain: 0 to 4

Return Value

Rotation angle

TSCALE ScreenID,MagnificationX,MagnificationY

Enlarge/reduce the text screen

・Zoom in/out around the home position set in THOME.
・Zoom in with a value greater than 1.0 (2.0 makes double), reduce down with a value less than 1.0 (0.5 makes half).

Arguments

ScreenID

ID of text screen to set: 0 to 4

MagnificationX,MagnificationY

Set the magnification factor to horizontal (X) and vertical (Y)

・Depending on the hardware specifications, the reference font image may be shifted by 1 pixel depending on the setting value.

TSCALE ScreenID OUT MagnificationX,MagnificationY

Get the scale of the text screen

Arguments

ScreenID

ID of text screen to obtain: 0 to 4

MagnificationX,MagnificationY

Current zoom ratio

TSHOW ScreenID

Display text screen

Argument

ScreenID

Screen ID to display: 0 to 4

TSHOW(ScreenID)

Get text screen display status

Argument

ScreenID

Screen ID to get: 0 to 4

Return Value

Returns 1 if the text screen is displayed, otherwise 0.

THIDE ScreenID

Hide text screen

Argument

ScreenID

Screen ID to hide display: 0 to 4

THIDE(ScreenID)

Get text screen display status

Argument

ScreenID

Screen ID to get: 0 to 4

Return Value

Returns 0 if the text screen is displayed, otherwise 1.

TBLEND ScreenID,CompositeMethod

Set the text screen composition method

Arguments

ScreenID

Text screen ID to set the composition method: 0 to 4

CompositeMethod

Composition method to set: 0 to 1

・Normal composition with 0, additive composition with 1.

TBLEND(ScreenID)

Get text screen composition method

Argument

Screen ID

ID of the text screen to obtain the synthesis method: 0-4

Return value

Set synthesis method
・ Normal synthesis with 0, additive synthesis with 1.

TANIM ScreenID,AnimationTarget,DataArray[,Loop]

Set animation on the text screen (specified by array)

Text screen animation common specifications

・Animation is to set a value and wait for a specified time.
・The animation starts from the next frame after running TANIM.
・Accept up to 32 data for each target element.
・If a negative value is specified for time, linear interpolation is performed from the previous value.

Arguments

TextScreenID

ID of text screen to set animation: 0 to 4

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of text screen internal variable 7)

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・"I" and "UV" that can be used with SPANIM are ignored even if they are specified.

DataArray

1D numeric array that stores animation data

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

DataArray

・Anime data is prepared in the following order in the numerical array (up to 32).
・Time1,Item1,[Item2,] Time2,Item1,[Item2,]...

Example

DIM PANIM[ 6 ]
PANIM[0]=-60 'frame(-60=smooth)
PANIM[1]=200 'offset X,Y
PANIM[2]=100
PANIM[3]=-30 'frame
PANIM[4]=50 'offset
PANIM[5]=20
TANIM 0,"XY",PANIM

TANIM ScreenID,AnimationTarget,"@LabelString"[,Loop]

Set animation on the text screen (specified with DATA command)

Arguments

ScreenID

ID of text screen to set animation: 0 to 4

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of text screen internal variable 7)

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・"I" and "UV" that can be used with SPANIM are ignored even if they are specified.

@LabelString

・The first label of the DATA command that stores the animation data.
・@Label name is enclosed in "" and specified as a string (or character variable).

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Data

Animation data is prepared in the following order in the DATA command

DATA NumberOfKeyFrames (up to 32)
DATA Time1,Item1[,Item2]
DATA Time2,Item1[,Item2]
:

Example

@MOVDATA
DATA 2 'counter
DATA -60,200,100 'frame,offset
DATA -30,50,20 'frame,offset
TANIM 0,"XY",@MOVDATA

TANIM ScreenID,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]

Set animation on the text screen (directly specified as an argument)

Argument

ScreenID

ID of text screen to set animation: 0 to 4

AnimationTarget

Numeric value or character string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of text screen variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・"I" and "UV" that can be used with SPANIM are ignored even if they are specified.

Time,Item

・Animation data itself (up to 32 as many as necessary).

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Example

TANIM 0,"XY",-60,200,100,-30,50,20

TANIM ScreenID,AnimationDefinitionNumber

Set the animation on the text screen (specified by the animation definition number)

Arguments

ScreenID

ID of text screen to set animation: 0 to 4

AnimationDefinitionNumber

Definition number already defined by ANIMDEF command: 0 to 1023

Example

ANIMDEF 0,"XY",-60,100,0
TANIM 0,0

TANIM [ScreenID]

Clear the animation set in the text screen

Argument

ScreenID

ID of text screen to clear animation: 0 to 4

・If not specified, clear all screen animations.

Example

TANIM 0
TANIM

TSTOP [ScreenID]

Stop the text screen animation

Argument

ScreenID

Target text screen ID: 0 to 4

・If not specified, animation of all text screens is stopped.

Example

TSTOP

TSTART [ScreenID]

Start text screen animation

Argument

ScreenID

Target text screen ID: 0 to 4

・If not specified, start animation of all text screens.

Example

TSTART

TCHK(ScreenID)

Get text screen animation state

Argument

ScreenID

Target text screen ID: 0 to 4

Return Value

b00 XY Coordinates 1 #CHKXY
b01 Z Coordinate 2 #CHKZ
b02 Rotation 4 #CHKR
b03 Magnification XY 8 #CHKS
b04 Display Color 16 #CHKC
b05 Variable 32 #CHKV

Target assignment for each bit (when all are 0, animation is stopped)

Example

ST=TCHK(0)
'|b00|#CHKXY|
'|b01|#CHKZ|
'|b02|#CHKR|
'|b03|#CHKS|
'|b04|#CHKC|
'|b05|#CHKV|

TVAR ScreenID,VariableKey,Value
TVAR ScreenID,VariableKey

Write to text screen variables

・Cleared when program execution starts or ACLS is called.

Arguments

ScreenID

Target text screen ID: 0 to 4

VariableKey

The name of the text screen variable

・A string or Int can be given as a name.

Value

Value to be registered in internal variable

・Numerical values or strings can be registered.
・If not specified, the value associated with the variable key is deleted.

Example

TVAR 0,7,1
TVAR 0,"NAME","VALUE" 
TVAR 0,"NAME" 'Delete value

TVAR(ScreenID,VariableKey)

Get text screen variable

Argument

ScreenID

Target text screen ID: 0 to 4

InternalVariableNumber

The name of the text screen variable

・A string or Int can be given as a name.

Return Value

Value set by TVAR

・If no value is set with TVAR, the Int 0 is returned.

Example

V=TVAR(0,0)

TVAR ScreenID[,VariableKey]

Delete text screen variables

Argument

ScreenID

Target screen ID: 0 to 4

VariableKey

The name of the text screen variable to delete

・A string or Int can be given as a name.
・If not specified, all text screen variables in the specified screen are deleted.

Example

TVAR 0,7
TVAR 0,"NAME" 

TCOPY CopyDestinationScreenID[,CopySourceScreenID],StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY

Copy the character information in the text screen

Argument

CopyDestinationScreenID

Copy destination text screen ID: 0 to 4

CopySourceScreenID

Copy source text screen ID: 0 to 4

・If not specified, the same screen as the copy destination screen is specified.

StartPointX,Y,EndPointX,Y

Source start and end coordinates

TransferDestinationX,Y

Start point coordinates of the copy destination

TCOPY 4,0,0,9,9,10,10
TCOPY 4,1,0,0,9,9,10,10

TSAVE ReadoutScreenID,[X,Y,Width,Height,]TransferDestinationArray

Copy text screen character information to array

・Refer to TARRAY for the data structure in the array.

Argument

ReadoutScreenID

Text screen ID for retrieving character information: 0 to 4

X,Y,Width,Height

Start point X, Y coordinate, width, height of the copy source range

・If not specified, the entire text screen is specified.

TransferDestinationArray

Numeric array variable that stores character information

・If there are not enough elements in the array, it is automatically added only to the 1D array.

Example

DIM WORK%[]
TSAVE 4,WORK%

TLOAD WritingScreenID,[X,Y,Width,Height,]TransferSourceArray

Copy character information from array to text screen

・Refer to TARRAY for the data structure in the array.

Argument

WritingScreenID

Text screen ID for writing character information: 0 to 4

X,Y,Width,Height

Start point X, Y coordinate, width, height of writing range

・If not specified, the entire text screen is specified.

ImageArray

Numeric array containing character information

Example

DIM WORK%[]
TLOAD 4,WORK%

TARRAY(ScreenID)

Get an Int array representing the contents of text screen

・Text screen characters, attributes, and colors can be directly read and written as an Int type 2D array.
・Use TUPDATE to reflect the written result.

Argument

ScreenID

ID of the target screen to get the array: 0 to 4

Return Value

Int type 2D array representing the contents of the target screen

・The array size is [ScreenHeight,ScreenWidthx2].
・One character is represented by two elements. The first element contains the display attribute in the upper 16 bits, the character code in the lower 16 bits, and the display color in the second element.

Example

T=TARRAY(0)
T[0,0]=&HE810
PRINT HEX$(T[0,0])

TUPDATE ScreenID [,StartPointX,StartPointY,EndPointX,EndPointY]

Reflect the contents written by TARRAY in the display

・Since normal text screen commands internally perform processing equivalent to TUPDATE, using TUPDATE after executing a character display command has no effect.
・Even if TUPDATE is not used, it is automatically reflected when writing with another character display command near the update coordinates.

Arguments

ScreenID

ID of screen to reflect: 0 to 4

StartPointX,StartPointY,EndPointX,EndPointY

Start and end coordinates of the rectangular area to be reflected

・If not specified, the entire screen is updated.

T=TARRAY(0)
T[0,0]=&HE811
T[0,1]=#C_RED
TUPDATE 0

TFUNC ScreenID,"@Label"
TFUNC ScreenID,"UserDefinedCommandName"

Assign a callback process for each text screen

・It's a command for advanced users who need callback processing.
・You can specify either the label you want to jump with GOSUB or the name of the DEF command you want to execute.
・Callback processing of all text screens is executed at once by CALL TEXT.
・At the callback destination, the management number can be acquired using the CALLIDX function.

Argument

ScreenID

Target text screen ID: 0 to 4

@Label

Label of the processing destination to be called

UserDefinedCommandName

The name of the user-defined command to be called

Example

TFUNC 0,"@PROG" 
TFUNC 1,"USERDEF" 

TFUNC ScreenID

Clear callback processing assigned to text screen

Argument

ScreenID

Clear text screen ID: 0 to 4

Example

TFUNC 0

TCOORD ScreenID, ConvertSourceCoordinatesX,Y [,Mode] OUT ConvertResultCoordinatesX,Y

Convert display coordinates to text screen coordinates

Argument

ScreenID

ID of scrolling text screen: 0 to 4

CoordinateX,Y

Coordinate to check character code

・The meaning of coordinates changes depending on the value of the next mode.

Mode

Specify the coordinate conversion method: 0 to 2

0 Convert text screen coordinates (in dots) to display coordinates
1 Convert display coordinates to character coordinates on the text screen
2 Convert display coordinates to dot coordinates on the text screen

・0, if not specified.
・When using display coordinates, the effect of LMATRIX is not considered.

Return Value

ConvertResultCoordinatesX,Y

Coordinate value of conversion result

・The meaning of the coordinates returned depends on the mode value.

Example

TCOORD 1,10,10,0 OUT DX,DY
GPSET DX,DY,#C_WHITE

TCOORD 1,100,50,1 OUT CX,CY
LOCATE CX,CY:?"A" 

TCOORD 1,100,50,2 OUT SX,SY

Graphics

GTARGET DrawingTargetPage

Specifying the graphic drawing target page

Argument

DrawingTargetPage

0 to 5 GRP0 to GRP5

Example

GTARGET 0

GTARGET()

Get the current graphics drawing target page

Return Value

Drawing target page

Example

WP=GTARGET()

GCOLOR ColorCode

Specify graphic drawing color

Argument

ColorCode

・The color is expressed as an 8-digit hexadecimal number.
・Specify 2 digits each A, R, G and B like &HAARRGGBB.
・Specify 0 to 255 (&H00 to &HFF): A for transparency, R for red, G for green, and B for blue.
・A (transparency) of 0 is completely transparent and 255 is completely opaque.
・It can be specified easily using RGB functions or color constants starting with #C_.

Example

GCOLOR &HFF0A141E
GCOLOR RGB(255,10,20,30)
GCOLOR #C_BLUE

GCOLOR()

Get graphics drawing color

Return Value

Graphic drawing color

Example

C = GCOLOR()

RGB(R,G,B)
RGB(A,R,G,B)

Calculate color code from RGB values

Arguments

A

Transparency: 0 to 255
・255 is the default.

R,G,B

Color elements: R, G, B each 0 to 255

・Color examples

Black RGB(0,0,0)
White RGB(255,255,255)
Light Gray RGB(224,224,224)
Gray RGB(128,128,128)
Dark Gray RGB(64,64,64)
Red RGB(255,0,0)
Pink RGB(255,96,208)
Purple RGB(160,32,255)
Light Blue RGB(80,208,255)
Blue RGB(0,32,255)
Yellow Green RGB(96,255,128)
Green RGB(0,192,0)
Yellow RGB(255,224,32)
Orange RGB(255,160,16)
Brown RGB(160,128,96)
Light Red RGB(255,208,160)

Return Value

Color code calculated from the argument

Example

C1=RGB(0,100,200)
C2=RGB(128,0,100,200)

RGB(ColorCode,[A],[R],[G],[B])

Replace each component of the color code

Arguments

ColorCode

Replacement source color code

A,R,G,B

Replace color component
・Specify a value between 0 and 255.
・If each one is not specified, the corresponding component of the replacement source color code is used as it is.

Return Value

Color code calculated from the argument

Example

C1=RGB(#C_RED, 127,,,) 'Translucent red
C2=RGB(#C_BLUE,,255,,) 'Purple

RGB ColorCode OUT R,G,B
RGB ColorCode OUT A,R,G,B

Get RGB components from color code

Argument

ColorCode

ARGB 8-bit color code

・See GCOLOR for a description of color codes.

Return Value

A

Variable that receives the transparency information of the specified color code

・Returns a value between 0 and 255.

R,G,B

Variable that receives the color component information of the specified color code

・Returns values between 0 and 255 respectively.

Example

RGB C OUT R,G,B

RGBF(R,G,B)
RGBF(A,R,G,B)

Calculate color code from floating point RGB values

Arguments

A

Transparency: 0 to 1.0

・1.0 is the default.

R,G,B

Color elements: R, G, B each 0 to 1.0

Return Value

Color code calculated from the argument

RGBF(ColorCode,[A],[R],[G],[B])

Replace each component of the color code

Arguments

ColorCode

Replacement source color code

A,R,G,B

Replace color component

・Specify a value between 0 and 1.0.
・If each one is not specified, the corresponding component of the replacement source color code is used as it is.

Return Value

Color code calculated from the argument

Example

C1=RGBF(#C_RED, 0.5,,,) 'Translucent red
C2=RGBF(#C_BLUE,,1.0,,) 'Purple

RGBF ColorCode OUT R,G,B
RGBF ColorCode OUT A,R,G,B

Get RGB components from color code (floating point version)

Argument

ColorCode

Color code to get the color component

・See GCOLOR for a description of color codes.

Return Value

A

Variable that receives the transparency information of the specified color code

・Returns a value between 0 and 1.0

R,G,B

Variable that receives the color component information of the specified color code

・Returns values between 0 and 1.0 respectively.

HSV(Hue,Saturation,Value[,Transparency])

Calculate color code from HSV value

Arguments

Hue

Color type (H): Positive value

・It is the same as the angle, and if it exceeds 360, it will be treated as the same color as 0.
・As the number increases, the color changes smoothly from red to yellow to green to blue to purple.

Saturation

Color vividness (S): 0 to 255

・The smaller the number, the whitish.

Value

Color brightness (V): 0 to 255

・0 indicates black and 255 indicates the brightest.

Transparency

Transparency to be set in the return color code: 0 to 255

・255 is the default.

Return Value

Color code equivalent to HSV value

Example

GCLS HSV(100,100,100,100)

FOR I=0 TO 360
GPSET I,10,HSV(I,255,255)
NEXT

HSV ColorCode OUT Hue,Saturation,Value[,Transparency]

Convert color code to HSV value

Argument

ColorCode

Color code to convert

・See GCOLOR for a description of color codes.

Return Value

Hue

The hue of the specified color

・Returns a value between 0 and 360.

Saturation

The saturation of the specified color

・Returns a value between 0 and 255.

Value

The brightness of the specified color

・Returns a value between 0 and 255.

Transparency

Transparency of the specified color

・Returns a value between 0 and 255.

Example

HSV RGB(192,128,0) OUT H,S,V
?H,S,V

HSVF(Hue,Saturation,Value[,Transparency])

Calculate color code from HSV value (floating point version)

Arguments

Hue

Color type (H): Positive value

・Specify the color type from 0 to 1.
・As the number increases, the color changes smoothly from red to yellow to green to blue to purple.
・When it exceeds 1, it returns to the same color as 0.

Saturation

Color vividness (S): 0 to 1

・The smaller the number, the whitish.

Value

Color brightness (V): 0 to 1

・0 is black and 1 is the brightest.

Transparency

Transparency to be set in the return color code: 0 to 1

・1 is the default.

Return Value

Color code equivalent to HSV value

Example

GCLS HSVF(0.4,0.4,0.4,0.4)

FOR I=0 TO 360
GPSET I,10,HSVF(I/360,1,1)
NEXT

HSVF ColorCode OUT Hue,Saturation,Value[,Transparency]

Convert color code to HSV value (floating point version)

Argument

ColorCode

Color code to convert

・See GCOLOR for a description of color codes.

Return Value

Hue

The hue of the specified color

・Returns a value between 0 and 1.0.

Saturation

The saturation of the specified color

・Returns a value between 0 and 1.0.

Value

The brightness of the specified color

・Returns a value between 0 and 1.0.

Transparency

Transparency of specified color

・Returns a value between 0 and 1.0.

Example

HSVF RGB(192,128,0) OUT H,S,V
?H,S,V

GCLIP [StartPointX,StartPointY,EndPointX,EndPointY]

Specify the writing clipping area of the graphic page

・When the clipping area is designated, the subsequent graphic drawing commands are operated only within the designated range.
・If all arguments are not specified, the entire graphic page is specified.

Argument

StartPointX,Y

The start point coordinates of the clipping area (both X and Y are 0 to 2047)

EndPointX,Y

The end point coordinates of the clipping area (both X and Y are 0 to 2047)

Example

GCLIP 100,100,200,200

GCLIP OUT StartPointX,StartPointY,EndPointX,EndPointY

Get the writing clipping area of graphic page

Return value

StartPointX,Y

The start point coordinates of the clipping region

EndPointX,Y

The end point coordinates of the clipping region

Example

GCLIP OUT LEFT,TOP,RIGHT,BOTTOM

GCLS [ColorCode]

Fill the graphic page with the specified color

・The range to be filled is the GCLIP setting range.

Argument

ColorCode

Color code used for filling

・See GCOLOR for a description of color codes.
・If not specified, it is filled with 0 (transparent color).

Example

GCLS RGB(32,32,32)

GPGET(CoordinateX,CoordinateY)

Get the color of the specified coordinates on the graphic page

Argument

CoordinateX,Y

The coordinates to get the color of

・If coordinates outside the graphic page range are specified, 0 is returned.

Return Value

Pixel color code at specified coordinates

・See GCOLOR for a description of color codes.

Example

C=GPGET(100,100)

GPSET CoordinateX,CoordinateY[,ColorCode[,DrawingMethod]]

Dots on the graphic page

Arguments

CoordinateX,Y

Coordinates to hit the point

ColorCode

Point color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GPSET 100,50

GLINE StartPointX,StartPointY,EndPointX,EndPointY[,ColorCode[,DrawingMethod]]

Draw a straight line on the graphic page

Arguments

StartPointX,Y

Start point coordinates

EndPointX,Y

End point coordinates

ColorCode

Line color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GLINE 0,0,399,239,RGB(0,255,255)

GCIRCLE CenterPointX,CenterPointY,Radius[,ColorCode [,DrawingMethod]]

Draw a circle on the graphic page

Arguments

CenterPointX,Y

Center point coordinates

Radius

Circle radius (dot) 1 ~

ColorCode

Circle color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GCIRCLE 200,120,30

GCIRCLE CenterPointX,CenterPointY,Radius,StartAngle,EndAngle,Flag[,ColorCode [,DrawingMethod]]

Draw an arc on the graphic page

Arguments

CenterPointX,Y

Center point coordinates

Radius

Circle radius (dot) 1 ~

StartAngle,EndAngle

Start angle and end angle of an arc

・The direction of the clock at 3 o'clock is 0 degree, and the angle advances clockwise.
・Values other than 0 to 360 are fixed to values within 0 to 360. For example, -20 has the same meaning as 340.

Flag

0 Arc
1 Fan

ColorCode

Arc color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GCIRCLE 200,120,30,0,45,1

GBOX StartPointX,StartPointY,EndPointX,EndPointY[,ColorCode[,DrawingMethod]]

Draw a rectangle on the graphic page

Arguments

StartPointX,Y

Start point coordinates

EndPointX,Y

End point coordinates

Color code

Rectangle color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GBOX 0,0,399,239

GFILL StartPointX,StartPointY,EndPointX,EndPointY[,ColorCode[,DrawingMethod]]

Draw a rectangle on the graphic page and fill it

Argument

StartPointX,Y

Start point coordinates

EndPointX,Y

End point coordinates

ColorCode

Rectangle color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GFILL 0,0,399,239

GPAINT StartPointX,StartPointY[,FillColor]
GPAINT StartPointX,StartPointY[,FillColor,BorderColor]

Fill the graphic page

・When the border color is not specified, the color range at the start point coordinates is painted.

Arguments

StartPointX,Y

Coordinates at which to start filling

FillColor

The color to use for the fill

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

BorderColor

The color to see as the border of the fill

・If not specified, all colors that are different from the fill color are seen as boundaries.

Example

GPAINT 200,120,RGB(255,0,0),RGB(0,0,0)

GCOPY [SourcePage,]StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY,DrawingMethod

Copy images from other graphic pages

Arguments

SourcePage

Default Current Drawing Page
0 to 5 GRP0 to GRP5

StartPointX,Y EndPointX,Y

Start point and end point coordinates of the copy source range

TransferDestinationX,Y

Start point coordinates of the copy destination range

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

Example

GCOPY 0,0,0,100,100,200,100 ,1

GCOPY SourcePage,StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY,ColorCode,DrawingMethod

Copy images from other graphic pages

Arguments

SourcePage

Copy source graphic page: 0 to 5

StartPointX,Y EndPointX,Y

Start point and end point coordinates of the copy source range

TransferDestinationX,Y

Start point coordinates of the copy destination range

ColorCode

Color code to multiply with the source pixel

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

Example

GCOPY 0,0,0,100,100,200,100,#C_RED,1

GSAVE [SourcePage,][X,Y,Width,Height,]DestinationArray

Copy image to array

Arguments

SourcePage

Default Current Drawing Page
0 to 5 GRP0 to GRP5

X,Y,Width,Height

Start point X, Y coordinate, width, height of the copy source range

・If not specified, the current clipping area is used.

DestinationArray

Array variable that stores the image

・If there are not enough elements in the array, it is automatically added only to the 1D array.

Example

DIM WORK[0]
GSAVE 0,0,0,512,512,WORK

GLOAD [X,Y,Width,Height,]ImageArray,DrawingMethod
GLOAD [X,Y,Width,Height,]ImageArray,ColorCode,DrawingMethod

Copy image data from array to graphic page

Arguments

X,Y,Width,Height

Start point X, Y coordinate, width, height of the copy destination range

・If not specified, the current clipping area is used.

ImageArray

Numeric array that stores image data by GSAVE

ColorCode

Color code to multiply the image data in the image array

・If not specified, the image array is used as it is.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

Example

GLOAD 0,0,512,512,WORK,0
GLOAD WORK,#C_RED,0

GLOAD [X,Y,Width,Height,]IndexImageArray,PaletteArray,DrawingMethod
GLOAD [X,Y,Width,Height,]IndexImageArray,PaletteArray,ColorCode,DrawingMethod

Copy image data to graphic page while converting color from index image array

Arguments

X,Y,Width,Height

Start point X, Y coordinate, width, height (dot) of the copy destination range

・If not specified, the current clipping area is used.

IndexImageArray

Numeric array containing images stored in indexed image format

PalletArray

Numeric array containing palette data

・The palette data is a numerical array having more elements than the maximum number used in the index image, and each element contains a color code corresponding to the numerical value in the index image.

ColorCode

Color code to multiply the image data in the image array

・If not specified, the image array is used as it is.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

Example

GLOAD 0,0,512,512,WORK,PALETTE,0
GLOAD WORK,PALETTE,#C_BLUE,1

GTRI X1,Y1,X2,Y2,X3,Y3[,ColorCode[,DrawingMethod]]

Draw a triangle on the graphic page and fill it

Arguments

X1,Y1

Vertex 1

X2,Y2

Vertex 2

X3,Y3

Vertex 3

ColorCode

Triangle color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GTRI 200,10,300,200,100,200

GPUTCHR X,Y,"String"[,FontType[,ColorCode[,DrawingMethod]]]
GPUTCHR X,Y,"String",FontType,ScaleX,ScaleY,ColorCode[,DrawingMethod]

Draw characters on the graphic page

Arguments

X,Y

Display coordinates

String

The string to display
・If an Int is specified instead of a string, the value is treated as a character code and calculates the drawing width for one character of the specified code.

FontType

The type of font to reference: 8 or 16 can be specified.

・16 is the default.

ScaleX,Y

Display magnification: 1 to 32767

・If not specified, 1,1 (the same size) is specified.

ColorCode

Text color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・0 is the default.

Example

GPUTCHR 10,10,"ABC" 
GPUTCHR 20,20,&H60

GPUTCHRP X,Y,"String"[,FontType[,ColorCode[,DrawingMethod]]]
GPUTCHRP X,Y,"String",FontType,ScaleX,ScaleY,ColorCode[,DrawingMethod[,CharacterSpacing]]

Draw proportional characters on graphic pages

Arguments

X,Y

Display coordinates

String

The string to display
・If an Int is specified instead of a string, the value is treated as a character code and calculates the drawing width for one character of the specified code.

FontType

The type of font to reference: 8 or 16 can be specified.

・16 is the default.

ScaleX,Y

Display magnification: 1 to 32767

・If not specified, 1,1 (the same size) is specified.

ColorCode

Text color to draw

・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.

DrawingMethod

0 Simple Drawing #G_NORMAL
1 Simple Drawing when transparency is not 0 #G_NORMAL2
2 Translucent Drawing #G_ALPHA
3 Translucent Drawing considering transparency of drawing destination #G_ALPHA2
4 Addition Drawing #G_ADD

・1 is the default.

CharacterSpacing

Space between characters (in pixels): 0 to 64
・If not specified, it's 1.

Example

GPUTCHRP 10,10,"ABC" 
GPUTCHRP 10,10,&H55

GPUTCHRP("String"[,FontType[,ScaleX[,CharacterSpacing]]])

Calculate the drawing width when drawing a string with GPUTCHRP

Arguments

String

The string to calculate the display width
・If an Int is specified instead of a string, the value is treated as a character code and calculates the drawing width for one character of the specified code.

FontType

The type of font to reference: 8 or 16 can be specified.

・16 is the default.

ScaleX

Display magnification: 1 to 32767

・If not specified, 1 (the same size) is specified.

CharacterSpacing

Space between characters (in pixels): 0 to 64
・If not specified, it's 1.

Return Value

The drawing width (pixels) when drawing with GPUTCHRP

Example

W=GPUTCHRP("ABC")
W2=GPUTCHRP(&H55,16,1,2)

GARRAY(GraphicPage)

Get an Int array representing the contents of a graphic page

・Graphic pages can be directly read and written as an Int type 2D array.
・Use GUPDATE to reflect the written results.

Argument

GraphicPage

・Specify the target page to get the array.

0 to 5 GRP0 to GRP5

Return Value

An Int type 2D array representing the contents of the target page.

Example

G=GARRAY(0)
G[0,0]=#C_WHITE
PRINT HEX$(G[100,100])

GUPDATE GraphicPage[,StartPointX,StartPointY,EndPointX,EndPointY]

Reflect the contents written by GARRAY in the display

・Since normal graphic drawing commands internally perform processing equivalent to GUPDATE, so using GUPDATE after executing drawing commands has no effect.
・Even if you don't use GUPDATE, it will be reflected automatically if you write with other drawing commands near the writing coordinates.

Arguments

GraphicPage

Graphic page to reflect

0 to 5 GRP0 to GRP5

StartPointX,StartPointY,EndPointX,EndPointY

Start and end coordinates of the rectangular area to be reflected (each 0 to 2047)

・Coordinate specification is handled as clue information, and the part that is outside the region may be updated.

Example

G=GARRAY(0)
G[0,0]=#C_WHITE
GUPDATE 0

GSAMPLE GraphicPage,SamplingType

Set the sampling method for graphic pages

・Sampling refers to determining which coordinates on the graphic page are referenced from the UV coordinates when referring to the color from the graphic page on a sprite or text screen.
・It cannot be changed to sprite units, text screen units, or layer units.

Arguments

GraphicPage

Graphic page to set: 0 to 5

SamplingType

0 Border (UV coordinates other than 0 to 2047 are transparent)
1 Repeat (treats the graphic page as if it was repeated outside 0-2047)

GSAMPLE(GraphicPage)

Get sampling method of graphic page

Argument

GraphicPage

Graphic page to retrieve settings: 0 to 5

Return Value

Currently set sampling type

Sprites

SPSET SpriteNumber,DefinitionNumber[,DisplayFlag]

Create sprites (using definition templates)

SPSET common elements

・A sprite can be used by SPSET.
・All attributes such as rotation is initialized by executing SPSET.
・The sprite variables are cleared.
・When using SPHIT collision detection, call SPCOL after SPSET.

Arguments

SpriteNumber

Sprite number to create: 0 to 4095

DefinitionNumber

Definition number of template defined by SPDEF: 0 to 8191

DisplayFlag

Specify whether to display the created sprite

・Display with 1 and do not display with 0.
・1, if not specified.

Example

SPSET 1,500

SPSET SpriteNumber,U,V,W,H[,Attribute[,DisplayFlag]]

Create sprite (specify image attribute etc. directly)

・Used when setting independently without using SPDEF value.

Arguments

SpriteNumber

Sprite number to create: 0 to 4095

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite size: 0 to 2048

Attributes

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01 ↓ #A_ROT0, #A_ROT90, #A_ROT0180, #A_ROT270
b02 Horizontal Reverse (0=OFF, 1=ON), #A_REVH
b03 Vertical Reverse (0=OFF, 1=ON), #A_REVV
b04 Additive Composite (0=OFF, 1=ON), #A_ADD

・0, if not specified.

DisplayFlag

Specify whether to display the created sprite

・Display with 1 and do not display with 0.
・1, if not specified.

Example

SPSET 54,0,0,32,32,1,0

SPSET(DefinitionNumber[,DisplayFlag])

Search for an available number, create a sprite, and return the number

・Search for space in the entire sprite.

Arguments

DefinitionNumber

Definition number of the template defined by SPDEF: 0 to 8191

DisplayFlag

Specify whether to display the created sprite

・Display with 1 and do not display with 0.
・1, if not specified.

Return Value

SpriteNumber

Generated sprite number: 0 to 4095

・When there is no space and cannot be generated, -1 is returned.

Example

IX=SPSET(500)

SPSET(U,V,W,H,Attribute[,DisplayFlag])

Search for an available number, create a sprite, and return the number

・Search for space in the entire sprite.

Arguments

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite size: 0 to 2048

Attributes

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01 ↓ #A_ROT0, #A_ROT90, #A_ROT0180, #A_ROT270
b02 Horizontal Reverse (0=OFF, 1=ON), #A_REVH
b03 Vertical Reverse (0=OFF, 1=ON), #A_REVV
b04 Additive Composite (0=OFF, 1=ON), #A_ADD

DisplayFlag

Specify whether to display the created sprite

・Display with 1 and do not display with 0.
・1, if not specified.

Return Value

SpriteNumber

Generated sprite number: 0 to 4095

・When there is no space and cannot be generated, -1 is returned.

Example

IX=SPSET(0,0,32,32,1)

SPSET(StartNumber,EndNumber,DefinitionNumber[,DisplayFlag])

Search for an available number, create a sprite, and return the number

・Search for available space within the specified range.

Arguments

StartNumber,EndNumber

Search range (0 to 4095)

・If the starting number is increased, the available numbers are searched in descending order.

DefinitionNumber

Definition number of template defined by SPDEF: 0 to 8191

DisplayFlag

Specify whether to display the created sprite

・Display with 1 and do not display with 0.
・1, if not specified.

Return Value

SpriteNumber

Generated sprite number: 0 to 4095

・When there is no space and cannot be generated, -1 is returned.

Example

IX=SPSET(100,120, 500)

SPSET(StartNumber,EndNumber,U,V,W,H,Attribute[,DisplayFlag])

Search for an available number, create a sprite, and return the number

・ Search for available space within the specified range.

Arguments

StartNumber,End Number

Search range (0 to 4095)

・If the starting number is increased, the available numbers are searched in descending order.

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite size: 0 to 2048

Attributes

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01 ↓ #A_ROT0, #A_ROT90, #A_ROT0180, #A_ROT270
b02 Horizontal Reverse (0=OFF, 1=ON), #A_REVH
b03 Vertical Reverse (0=OFF, 1=ON), #A_REVV
b04 Additive Composite (0=OFF, 1=ON), #A_ADD

DisplayFlag

Specify whether to display the created sprite

・Display with 1 and do not display with 0.
・1, if not specified.

Return Value

SpriteNumber

Generated sprite number: 0 to 4095

・When there is no space and cannot be generated, -1 is returned.

Example

IX=SPSET(100,120, 0,0,32,32,1)

SPCLR

Delete all sprites

・Sprite for graphic page (4095) is not deleted.

Example

SPCLR

SPCLR SpriteNumber

Delete the specified sprite

・If you do not delete it after use, there will be no sprite space that can be specified with SPSET.

Argument

SpriteNumber

Sprite number to delete: 0 to 4095

Example

SPCLR 56

SPCLR SpriteNumber1,SpriteNumber2

Delete sprite in specified range

Arguments

SpriteNumber1

Start number position of sprite range to delete: 0 to 4095

SpriteNumber2

End number position of sprite range to delete: 0 to 4095

Example

SPCLR 2,10

SPSHOW SpriteNumber
SPSHOW SpriteNumber,DisplayFlag

Display sprite

・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number to display: 0 to 4095

DisplayFlag

・Display with 1 and do not display with 0.
・1, if not specified.

Example

SPSHOW 43
SPSHOW 44, #TRUE

SPSHOW(SpriteNumber)

Get whether sprite is displayed

・Error when used before SPSET.

Argument

SpriteNumber

Sprite number to check: 0 to 4095

Return Value

Returns 1 if displayed, 0 if disappeared

Example

S = SPSHOW(43)

SPHIDE SpriteNumber
SPHIDE SpriteNumber,DisplayOffFlag

Hide sprite display

・Just hiding the display, it does not delete the sprite.
・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number to hide display: 0 to 4095

DisplayOffFlag

・Display with 1 and do not display with 0.
・1, if not specified.

Example

SPHIDE 43

SPHIDE(SpriteNumber)

Get whether sprite is off

・Error when used before SPSET.

Argument

SpriteNumber

Sprite number to check: 0 to 4095

Return Value

Returns 0 if displayed, 1 if disappeared

Example

H=SPHIDE(43)

SPHOME SpriteNumber,CoordinateX,CoordinateY

Specify the sprite's home coordinate (coordinate reference point)

・The home coordinates are used as reference points for SPOFS(Movement), SPROT(Rotation), and SPSCALE(Enlargement/Reduction).
・SPCOL (collision detection) uses the value of SPHOME as the default value when the starting point X and Y are not specified. For details, see the SPCOL description.
・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number for setting the reference point: 0 to 4095

CoordinateX,Y

Relative coordinates with the upper left corner of the sprite as the origin (0,0)

・Depending on the hardware specifications, setting a Real value may shift the reference image by one pixel.

Example

SPHOME 34,16,16

SPHOME SpriteNumber OUT HX,HY

Get home position of sprite

・Error when used before SPSET.

Argument

SpriteNumber

Sprite number: 0 to 4095

Return Value

HX,HY

Home coordinates

Example

SPHOME 10 OUT HX,HY

SPOFS SpriteNumber,[X],[Y][,Z]

Move the sprite

・Error when used before SPSET.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

X,Y

Display coordinates of sprite to be set

・Depending on the hardware specifications, setting a Real value may shift the reference image by one pixel.

Z

Display priority: -4095 to 4095

・The smaller it is, the closer it is displayed.

Example

SPOFS 23,50,80
SPOFS 23,,,1000
SPOFS 23,150,180,0

SPOFS SpriteNumber[,CoordinateSystemFlag] OUT X,Y[,Z]

Get display coordinates of sprite

・Error when used before SPSET.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

CoordinateSystemFlag

If 1, it returns absolute sprite coordinates.

If 0, it returns the sprite's relative coordinates.

・Relative coordinates mean the coordinates set in SPOFS.
・Absolute coordinates return the display coordinates on the layer.
・Both will have different coordinates when using SPLINK.
・0, if not specified.

Return Value

X,Y

Sprite coordinates

Z

Display priority

Example

SPOFS 12 OUT X,Y,Z

SPROT SpriteNumber,Angle

Rotate the sprite

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Angle

Rotation angle: 0 to 360 (clockwise)

・Depending on the hardware specifications, the reference image may be shifted by 1 pixel depending on the angle.

Example

SPROT 23,45

SPROT(SpriteNumber)

Get sprite rotation angle

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

DR

Sprite angle

Example

DR=SPROT(23)

SPSCALE SpriteNumber,MagnificationX,MagnificationY

Change the sprite scale (display magnification)

・SPCOL is executed first for the collision detection considering the scale.
・Error when used before SPSET.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

MagnificationX,Y

0.5 (50%) to 1.0 (100%) to 2.0 (200%) and more

・Depending on the hardware specifications, the reference image may be shifted by 1 pixel depending on the setting value.

Example

SPSCALE 56,0.75, 0.75

SPSCALE SpriteNumber OUT SX,SY

Get sprite display magnification

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

SX,SY

Sprite magnification

Example

SPSCALE 45 OUT SX,SY

SPCOLOR SpriteNumber,ColorCode

Set the sprite display color

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

ColorCode

・The actual display color is the value obtained by multiplying the original pixel color by the color code.

Example

SPCOLOR 1,RGB(16, 255,0,0) 'A=16,R=255,G=0,B=0

SPCOLOR(SpriteNumber)

Get the sprite display color

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

ColorCode

Color code set for sprite

Example

C=SPCOLOR(1)

SPCHR SpriteNumber,DefinitionNumber

Change sprite character definition

・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number whose definition is to be changed: 0 to 4095

DefinitionNumber

Template number registered with SPDEF command: 0 to 8191

Example

SPCHR 0,500

SPCHR SpriteNumber,[U],[V],[W],[H],[Attribute]

Change sprite character definition

・Arguments other than the sprite number can be omitted.
・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite size: 0 to 2048

・If not specified, both W and H are 16.

Attributes

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01 ↓ #A_ROT0, #A_ROT90, #A_ROT0180, #A_ROT270
b02 Horizontal Reverse (0=OFF, 1=ON), #A_REVH
b03 Vertical Reverse (0=OFF, 1=ON), #A_REVV
b04 Additive Composite (0=OFF, 1=ON), #A_ADD

・0, if not specified.

Example

SPCHR 5,64,64,16,16,0
SPCHR 6,,,32,32,1 'UV skip

SPCHR SpriteNumber OUT U,V[,W,H[,ATR]]

Get sprite character definition attributes

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite image size

ATR

Sprite attributes

Example

SPCHR 5 OUT U,V,W,H,ATR

SPCHR(SpriteNumber)

Get a sprite character definition number

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

DefinitionNumber

Character definition number of the specified sprite

Example

DEFNO=SPCHR(5)

SPPAGE SpriteNumber,GraphicPage

Set the reference graphic page of the specified sprite

Arguments

SpriteNumber

Target sprite number: 0 to 4095

GraphicPage

-1 to 5

・The default sprite page is 4.

Example

SPPAGE 100, 3

SPPAGE(SpriteNumber)

Get the reference graphic page of the specified sprite

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

Graphic page number: -1 to 5

Example

P=SPPAGE(100)

SPPAGE GraphicPage

Set the graphic page assigned to the sprite to be created

Argument

GraphicPage

-1 to 5 (GRP-1 to GRP5)

The initial sprite page is 4 (GRP4)

Example

SPPAGE 3

SPPAGE()

Get the graphic page assigned to the sprite to be created

Return Value

Graphic page number: -1 to 5

Example

P=SPPAGE()

SPLAYER SpriteNumber,LayerID

Set the layer to which the specified sprite belongs

Arguments

SpriteNumber

Target sprite number: 0 to 4095

LayerID

ID of the layer to which the sprite belongs: 0 to 7

Example

SPLAYER 100,3

SPLAYER(SpriteNumber)

Get the layer to which the specified sprite belongs

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

Layer ID

Example

P=SPLAYER(100)

SPLAYER LayerID

Set the layer to which the sprite to be created belongs

Argument

LayerID

0 to 7

・The initial layer ID is 0.

Example

SPLAYER 3

SPLAYER()

Get the layer to which the sprite to be created belongs

Return Value

Layer ID

Example

P=SPLAYER()

SPDEF DefinitionNumber,U,V[,W,H[,OriginX,OriginY]][,Attribute]

Create a character definition template for sprites

Arguments

DefinitionNumber

Template definition number: 0 to 8191

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite size

・If not specified, both W and H are 16.

OriginX,Y

Sprite coordinate reference point

・If not specified, X and Y are 0.

Attributes

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01 ↓ #A_ROT0, #A_ROT90, #A_ROT0180, #A_ROT270
b02 Horizontal Reverse (0=OFF, 1=ON), #A_REVH
b03 Vertical Reverse (0=OFF, 1=ON), #A_REVV
b04 Additive Composite (0=OFF, 1=ON), #A_ADD

・0, if not specified.

Example

SPDEF 0,192,352,32,32,16,16,1

SPDEF NumericArray[,DefinitionNumberOffset[,UOffset,VOffset]]

Create sprite character definition templates in batch from an array

Arguments

NumericArray

Numeric array that stores sprite template data

・There are seven elements: U, V, W, H, origin X, origin Y, and attribute.
・The number of elements must be a multiple of 7.
・"A number of elements divided by 7" sprite templates will be defined in order from 0.

DefinitionNumberOffset

Specify the definition start number: 0 to 8191

U,VOffset

It is added for the definition position adjustment of the image (each 0 to 4095)

Example

SPDEF SRCDATA
SPDEF SRCDATA 256,0,256

SPDEF "@LabelString"[,DefinitionNumberOffset[,UOffset,VOffset]]

Create sprite character definition templates in batch from DATA column

Arguments

@LabelString

DATA command label enumerating sprite template data

・@Label name must be enclosed in "" or specified with a string variable.
・The top data is the number of sprites to be defined, and then enumerate the data of each sprite (7 data per piece)
・The one data includes 7 items which are U, V, W, H, origin X, origin Y, and attribute.

DefinitionNumberOffset

Specify the definition start number: 0 to 8191

U,VOffset

It is added for the definition position adjustment of the image (each 0 to 4095)

Example

SPDEF "@SRCDATA" 
SPDEF "@SRCDATA",256,0,256

SPDEF DefinitionNumber OUT U,V[,W,H[,HX,HY]][,A]

Get attribute on character definition template of sprite

Argument

DefinitionNumber

Template definition number: 0 to 8191

Return Value

U,V

The coordinates on the graphic page of the referenced image

W,H

Sprite definition image size

HX,HY

Reference point coordinates of sprite definition

A

Sprite definition attributes

Example

SPDEF 2 OUT U,V,ATR

SPDEF DefinitionNumber,SourceDefinitionNumber,[U],[V],[W],[H],[OriginX],[OriginY],[Attribute]

Copy the sprite character definition template

・Elements that do not need to be copied can be omitted (separator ',' comma is required).
・The argument part is used for adjustment after copying.

Arguments

DefinitionNumber

Template definition number: 0 to 8191

SourceDefinitionNumber

Definition number that becomes the copy source: 0 to 8191

U,V

The coordinates on the graphic page of the referenced image

W,H

The size of the sprite to define

・If not specified, both W and H are 16.

OriginX,Y

Sprite coordinate reference point

・If not specified, X and Y are 0.

Attributes

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01 ↓ #A_ROT0, #A_ROT90, #A_ROT0180, #A_ROT270
b02 Horizontal Reverse (0=OFF, 1=ON), #A_REVH
b03 Vertical Reverse (0=OFF, 1=ON), #A_REVV
b04 Additive Composite (0=OFF, 1=ON), #A_ADD

・0, if not specified.

Example

SPDEF 0,255,192,352,32,32,16,16,1
SPDEF 1,255,,,32,32,,,

SPDEF

Return the sprite character definition template to the initial state

Example

SPDEF

SPLINK SpriteNumber,LinkDestinationSpriteNumber[,LinkFlag]

Link a sprite to another sprite

・When linked, the coordinates will follow the link destination (parent).
・The display coordinates and display priority of the child are relative coordinates based on the parent.
・Error when used before SPSET.

Arguments

SpriteNumber

Link source (child) sprite number: 0 to 4095

LinkSpriteNumber

Link (parent) sprite number: 0 to 4095

・An error occurs if the descendant of the link source is specified.

LinkFlags

Combination of bit values that specify which link destination (parent) attribute is inherited

・Specify when you want to inherit attributes other than display coordinates and display priority.
・If bit0 is specified, descendants are deleted 1V after the parent has been SPCLR.
・0, if not specified.

bit0 1 Display ON / OFF and Erase Timing
bit1 2 Rotation
bit2 4 Scaling
bit3 8 Color
bit4 16 Layer ID

Example

SPLINK 15,4
SPLINK 2,0,3

SPLINK(SpriteNumber[,LinkType])

Get the link number of the specified number sprite

・Error when used before SPSET.

Arguments

SpriteNumber

Link source (child) sprite number: 0 to 4095

LinkType

Type of link destination and link flag to be obtained.

0 Parent
1 Child
2 Brother
3 LinkFlag

・Default is 0.

Return Value

Link number: 0 to 4095 (No link when -1)

Example

'Pick up every child of the sprite PARENT
CHILD=SPLINK( PARENT,1 ) 'The first child
WHILE CHILD!=-1
CHILD=SPLINK( CHILD, 2 ) 'Get brothers in order
WEND

SPUNLINK SpriteNumber

Unlink sprites

・Error when used before SPSET.

Argument

SpriteNumber

Sprite number to release link: 0 to 4095

Example

SPUNLINK 15

SPANIM SpriteNumber,AnimationTarget,DataArray [,Loop]

Set animation for sprites

・Error when used before SPSET.

Sprite animation common specifications

・The set animation is played automatically.
・Animation is an operation of setting a value and waiting for a specified time.
・The animation starts from the next frame after executing SPANIM.
・Accept up to 32 data for each target element.
・If a negative value is specified for time, linear interpolation is performed from the previous value (moves smoothly).

Arguments

SpriteNumber

Sprite number for setting animation: 0 to 4095

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite internal variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the number, the sprite will be deleted when the animation ends.

DataArray

1D numeric array that stores animation data

Loop

Loop count: (1 or more)

・If 0 is specified, an infinite loop is created.
・1, if not specified.

DataArray

・Anime data is prepared in the following order in the numerical array (up to 32).
・Time1, Item1,[Item2,] Time2,Item1,[Item2,]...

Example

DIM PANIM[6]
PANIM[0]=-60 'frame(-60=smooth)
PANIM[1]=200 'offset X,Y
PANIM[2]=100
PANIM[3]=-30 'frame
PANIM[4]=50 'offset
PANIM[5]=20
SPSET 0,0
SPANIM 0,"XY",PANIM

SPANIM SpriteNumber,AnimationTarget,"@LabelString"[,Loop]

Set animation to sprite (specified with DATA command)

・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number for setting animation: 0 to 4095

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite internal variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the number, the sprite will be deleted when the animation ends.

@LabelString

・The first label of the DATA command that stores the animation data.
・@Label name is enclosed in "" and specified as a string (or character variable).

Loop

Loop count: (1 or more)

・If 0 is specified, an infinite loop is created.
・1, if not specified.

Data

Anime data is prepared in the following order in the DATA command

DATA NumberOfKeyFrames(UpTo32)
DATA Time1,Item1[,Item2]
DATA Time2,Item1[,Item 2]
:

Example

@MOVDATA
DATA 2 'counter
DATA -60,200,100 'frame,offset
DATA -30,50,20 'frame,offset
SPSET 0,0
SPANIM 0,"XY",@MOVDATA

SPANIM SpriteNumber,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]

Set animation for sprites (specify as direct argument)

・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number for setting animation: 0 to 4095

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of sprite internal variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・If you add "." to the end of the string or add 16 to the number, the sprite will be deleted when the animation ends.

Time,Item

・Animation data itself (up to 32 as many as necessary).

Loop

Loop count: (1 or more)

・If 0 is specified, an infinite loop is created.
・1, if not specified.

Example

SPSET 0,0
SPANIM 0,"XY",-60,200,100,-30,50,20

SPANIM SpriteNumber,AnimationDefinitionNumber

Set animation to sprite (specified by animation definition number)

・Animation definitions defined with ANIMDEF can be specified.
・Error when used before SPSET.

Arguments

SpriteNumber

Sprite number for setting animation: 0 to 4095

AnimationDefinitionNumber

Definition number already defined by ANIMDEF command: 0 to 1023

Example

ANIMDEF 0,"XY",-60,100,0
SPSET 0,0
SPANIM 0,0

SPANIM [SpriteNumber]

Clear sprite animation

Argument

SpriteNumber

Sprite number for clearing animation: 0 to 4095

・An error will occur if a number that is not SPSET is specified.
・If not specified, clear all sprite animations.

Example

SPANIM 0
SPANIM

SPSTOP [SpriteNumber]

Stop sprite animation

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

・If not specified, all sprite animations are stopped.

Example

SPSTOP

SPSTART [SpriteNumber]

Resume sprite animation

・An error if used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

・If not specified, start animation of all sprites.

Example

SPSTART

SPCHK(SpriteNumber)

Get animation state of sprite

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

b00 XY Coordinates 1 #CHKXY
b01 Z Coordinate 2 #CHKZ
b02 Rotation 4 #CHKR
b03 XY Magnification 8 #CHKS
b04 Display Color 16 #CHKC
b05 Variable 32 #CHKV
b06 UV Coordinates 64 #CHKUV
b07 Definition Number 128 #CHKI

Target assignment for each bit (when all are 0, animation is stopped)

Example

ST=SPCHK(5)
'|b00|#CHKXY|
'|b01|#CHKZ|
'|b02|#CHKR|
'|b03|#CHKS|
'|b04|#CHKC|
'|b05|#CHKV|
'|b06|#CHKUV|
'|b07|#CHKI|

SPVAR SpriteNumber,VariableKey,Value

Set sprite variables

・All sprites have special variables called sprite variables.
・Sprite variables are cleared when program execution starts or when SPSET or SPCLR is called.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

VariableKey

The name of the sprite variable

・A string or Int can be given as a name.

Value

Value to be registered in internal variable

・Numerical values or strings can be registered.

Example

SPVAR 0,7,1
SPVAR 0,"NAME","VALUE" 

SPVAR(SpriteNumber,VariableKey)

Read sprite variables

Arguments

SpriteNumber

Target sprite number: 0 to 4095

VariableKey

The name of the sprite variable: string or Int can be named.

Return Value

Value registered with SPVAR

If no value is registered with SPVAR, the Int 0 is returned.

Example

V=SPVAR(54,0)

SPVAR SpriteNumber[,VariableKey]

Delete sprite variables

Arguments

SpriteNumber

Target sprite number: 0 to 4095

VariableKey

The name of the sprite variable to delete

・A string or Int can be given as a name.
・If not specified, all sprite variables of the specified sprite are deleted.

Example

SPVAR 0,7
SPVAR 0,"NAME" 

SPCOL SpriteNumber[,ScaleSupport]

Set sprite collision detection attribute

・Be sure to call before using SPHIT command.
・Error when used before SPSET.
・If start point X and start point Y are not specified in SPCOL, then the information of SPHOME is used as start point X and start point Y. Even if SPHOME is changed afterwards, start point X and start point Y are not followed.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

ScaleSupport

When 1 is specified, the size of the collision detection changes according to the scale change in SPSCALE or SPANIM.

If 0 is specified, the size of collision detection will not change even if the scale is changed.

・0, if not specified.

Example

SPCOL 3,1

SPCOL SpriteNumber,[ScaleSupport],Mask

Set sprite collision detection attribute (with mask specification)

・Be sure to call before using SPHIT command.
・Error when used before SPSET.
・If start point X and start point Y are not specified in SPCOL, then the information of SPHOME is used as start point X and start point Y. Even if SPHOME is changed afterwards, start point X and start point Y are not followed.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

ScaleSupport

When 1 is specified, the size of the collision detection changes according to the scale change in SPSCALE or SPANIM.

If 0 is specified, the size of collision detection will not change even if the scale is changed.

・0, if not specified.

Mask

0 to &HFFFFFFFF(32bit)

・When the collision is detected, compare each other's bit of AND and if it is 0, it is regarded as not colliding.
・If not specifiied, it's &HFFFFFFFF.

Example

SPCOL 3,1,31
SPCOL 3,,31

SPCOL SpriteNumber,StartPointX,StartPointY,Width,Height[,ScaleSupport]
SPCOL SpriteNumber,StartPointX,StartPointY,Width,Height,[ScaleSupport],Mask

Set sprite collision detection attribute (with range specification)

・Be sure to call before using SPHIT commands.
・Error when used before SPSET.
・When the starting point X and Y are specified in SPCOL, the information of SPHOME is not used at all.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

StartPointX,Y

・Start point coordinates of detection area: X, Y (-32768 to 32767).
・Relative coordinates with the top left of the sprite as the origin (0,0).

Width,Height

Detection area width and height: W, H (1 to 65535)

ScaleSupport

When 1 is specified, the size of the collision detection changes according to the scale change in SPSCALE or SPANIM.

If 0 is specified, the size of collision detection will not change even if the scale is changed.

・0, if not specified.

Mask

0 to &HFFFFFFFF(32bit)

・When the collision is detected, compare each other's bit of AND and if it is 0, it is regarded as not colliding.
・If not specifiied, it's &HFFFFFFFF.

Example

SPCOL 3,0,0,32,32,1,255
SPCOL 3,0,0,32,32,,255

SPCOL SpriteNumber OUT ScaleSupport[,Mask]

Get sprite collision detection attribute (scale support and mask)

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

ScaleSupport

Scale support flag set in sprite

Mask

Collision mask value set for sprite

Example

SPCOL 3 OUT SC,MSK

SPCOL SpriteNumber OUT StartPointX,StartPointY,Width,Height[,ScaleSupport[,Mask]]

Get sprite collision detection attributes (all)

・Error when used before SPSET.

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

StartPointX,Y

Collision detection area start point coordinates

Width,Height

Collision detection area width and height

ScaleSupport

Scale support flag set in sprite

Mask

Collision detection mask value

Example

SPCOL 3 OUT X,Y,W,H,SC,MSK

SPCOLVEC SpriteNumber[,MovementAmountX,MovementAmountY]

Set the movement speed for sprite collision detection

・Error when used before SPSET.

Arguments

Sprite number

Target sprite number: 0 to 4095

MovementAmountX,MovementAmountY

・If not specified, it is automatically calculated as follows.
・Running SPANIM XY with linear interpolation: distance moved from the previous frame.

・Otherwise: 0,0

Example

SPCOLVEC 93

SPHITSP(SpriteNumber[,StartID,EndID])

Return sprite collision detection result

・Call SPCOL in advance.

Argument

SpriteNumber

Sprite number to judge: 0 to 4095

StartID,EndID

Sprite range to detect (0 to 4095)

Return Value

Collision sprite number (-1 if no collision)

Example

H=SPHITSP(0)

SPHITSP(SpriteNumber,OpponentSpriteNumber)

Return sprite collision detection result with specified sprite

・Call SPCOL in advance.

Argument

SpriteNumber

Sprite number to detect: 0 to 4095

OpponentSpriteNumber

Opponent sprite number: 0 to 4095

Return Value

0=No Collision, 1=Collision

Example

H=SPHITSP(0,34)

SPHITSP()

Return the sprite collision detection result from the previously set information

・If there are multiple collision destinations in SPHITSP with arguments, all collision destinations can be retrieved by calling again with the arguments omitted.
・Call SPCOL in advance.
・Call SPHITSP without omitting arguments in advance.

Return Value

Collision sprite number (-1 if no collision)

Example

H=SPHITSP(0)
WHILE H>=0
 H=SPHITSP()
WEND

SPHITRC(StartPointX,StartPointY,Width,Height[,[Mask],MovementAmountX,MovementAmountY])

Return collision detection result of moving rectangle and all sprites

・Call SPCOL in advance.

Arguments

StartPointX,Y

Upper left coordinate of the rectangle to be detected

Width,Height

Width and height of the source rectangle

Mask

0 to &HFFFFFFFF(32bit)

・When the collision is detected, compare each other's bit of AND and if it is 0, it is regarded as not colliding.
・If not specifiied, it's &HFFFFFFFF.

MovementAmountX,Y

Movement amount of the rectangle of the detecting source

Return Value

Collision sprite number (-1 if no collision)

Example

H=SPHITRC(0,0,16,16)

SPHITRC(SpriteNumber,StartPointX,StartPointY,Width,Height[,[Mask],MovementAmountX,MovementAmountY])

Return collision detection result of specified sprite and rectangle

・Call SPCOL in advance.

Arguments

SpriteNumber

Collision opponent sprite number: 0 to 4095

StartPointX,StartPointY

Upper left coordinate of the rectangle to be detected

Width,Height

Width and height of the source rectangle

Mask

0 to &HFFFFFFFF(32bit)

・When the collision is detected, compare each other's bit of AND and if it is 0, it is regarded as not colliding.
・If not specifiied, it's &HFFFFFFFF.

MovementAmountX,Y

Movement amount of the rectangle of the detecting source

Return Value

0=No Collision, 1=Collision

Example

H=SPHITRC(1,0,0,16,16)

SPHITRC(StartID,EndID,StartPointX,StartPointY,Width,Height[,[Mask],MovementAmountX,MovementAmountY])

Return the result of collision detection between a sprite in the specified range and a rectangle

・Call SPCOL in advance.

Arguments

StartID,EndID

Sprite range to detect (0 to 4095)

StartPointX,Y

Upper left coordinate of the rectangle to be detected

Width,Height

Width and height of the detecting rectangle

Mask

0 to &HFFFFFFFF(32bit)

・When the collision is detected, compare each other's bit of AND and if it is 0, it is regarded as not colliding.
・If not specifiied, it's &HFFFFFFFF.

MovementAmountX,Y

Movement amount of the rectangle of the detecting source

Return Value

Collision sprite number (-1 if no collision)

Example

H=SPHITRC(0,0,16,16)

SPHITRC()

Return the sprite collision detection result from the previously set information

・If there are multiple collision destinations in SPHITRC with arguments, you can retrieve all collision destinations by omitting the arguments and calling again.
・Call SPCOL in advance.

Return Value

Collision sprite number (-1 if no collision)

Example

H=SPHITRC(0,0,16,16)
WHILE (H >= 0)
 H=SPHITRC()
WEND

SPHITINFO()

Get the detailed information on collision detection results (collision time)

Return Value

Collision Time

・Collision time: Real between 0 and 1
・Coordinates at the time of detection + velocity x collision time coincides with the collision coordinates.

Example

TM=SPHITINFO()

SPHITINFO OUT TM,X1,Y1,X2,Y2

Get the detailed information of collision detection results (collision time and coordinates)

Return Value

TM

・Collision time: Real between 0 and 1
・Coordinates at the time of detection + velocity x collision time coincides with the collision coordinates.

X1,Y1

Coordinate of object 1 at the time of collision

X2,Y2

Coordinate of object 2 at the time of collision

Example

SPHITINFO OUT TM,X1,Y1,X2,Y2

SPHITINFO OUT TM,X1,Y1,VX1,VY1,X2,Y2,VX2,VY2

Get the detailed information of collision detection results (collision time, coordinates and velocity)

Return Value

Collision time

・Collision time: Real between 0 and 1
・Coordinates at the time of detection + velocity x collision time coincides with the collision coordinates.

X1,Y1

Coordinate of object 1 at the time of collision

VX1,VY1

Object 1 velocity at impact

X2,Y2

Coordinate of object 2 at the time of collision

VX2,VY2

Object 2 velocity at impact

Example

SPHITINFO OUT TM,X1,Y1,VX1,VY1,X2,Y2,VX2,VY2

SPFUNC SpriteNumber, "@Label"
SPFUNC SpriteNumber,"UserDefinedCommandName"

Assign callback processing for each sprite

・Commands for advanced users who need callback processing.
・You can specify either the label you want to jump with GOSUB or the name of the DEF command you want to execute.
・Callback processing of all sprites is executed at once by CALL SPRITE.
・At the callback destination, the number can be acquired with the CALLIDX () function.

Arguments

SpriteNumber

Target sprite number: 0 to 4095

@Label

Label of the processing destination to be called

UserDefinedCommandName

The name of the user-defined command to be called

Example

SPFUNC 0,"@PROG" 
SPFUNC 1,"USERDEF" 

SPFUNC SpriteNumber

Clear callback processing assigned to sprite

Argument

SpriteNumber

Sprite number to clear: 0 to 4095

Example

SPFUNC 0

SPUSED(SpriteNumber)

Check if specified sprite is used

Argument

SpriteNumber

Target sprite number: 0 to 4095

Return Value

0=Free, 1=in use

Example

S=SPUSED(4)
Error executing the include macro (Page not found)

Sound

BEEP [SoundEffectNumber[,[Pitch][,[Volume][,[Panpot]]]]]

Play simple warning and sound effects

Arguments

SoundEffectNumber

Sound type

Sound Effect Number Description
0 to 156 Preset Sounds
224 to 255 User Waveforms
256 to 383 BGM Sound Source

・0, if not specified.

Pitch

Pitch value: -32768 to 32767 (semitones by 100)

・0, if not specified.

Volume

Playback volume: 0 to 127

・64 is the default.

Panpot

Panpot: 0 (left) to 64 (center) to 127 (right)

・64 is the default.

Example

BEEP 3

BEEP([SoundEffectNumber[,[Pitch][,[Volume][,[Panpot]]]]])

Play simple warning and sound effects

Arguments

SoundEffectNumber

Sound type

Sound Effect Number Description
0 to 156 Preset Sounds
224 to 255 User Waveforms
256 to 383 BGM Sound Source

・0, if not specified.

Pitch

Pitch value: -32768 to 32767 (semitones by 100)

・0, if not specified.

Volume

Playback volume: 0 to 127

・64 is the default.

Panpot

Panpot: 0 (left) to 64 (center) to 127 (right)

・64 is the default.

Return Value

Handle

Handle to operate stop/volume/pitch/panpot after pronunciation: 0 to 15

Example

H=BEEP(152)

BEEPPAN Handle,Panpot

Change the sound effect panpot

Arguments

Handle

Handle obtained by executing the BEEP command

Panpot

Value of panpot to change: 0 (left) to 64 (center) to 127 (right)

Example

H=BEEP(152)
WAIT 60
BEEPPAN H,0

BEEPPIT Handle,Pitch

Change the pitch of sound effects

Arguments

Handle

Handle obtained by executing the BEEP command

Pitch

Value of pitch to change: -32768 to 32767

・Semitones by 100.

Example

H=BEEP(152)
WAIT 60
BEEPPIT H,1200

BEEPSTOP [Handle[,FadeTime]]

Stop sound effects

Arguments

Handle

Handle obtained by executing the BEEP command

・If not specified, all sound effects are stopped.

FadeTime

Specify in seconds

・Real can be specified.
・Stop immediately with 0.
・0, if not specified.

Example

BEEPSTOP

H=BEEP(152)
WAIT 60
BEEPSTOP H

BEEPVOL Handle,Volume

Change sound effect volume

Arguments

Handle

Handle obtained by executing the BEEP command

Volume

Volume value to change: 0 to 127

Example

H=BEEP(152)
WAIT 60
BEEPVOL H,16

BGMCLEAR [UserDefinedMusicNumber]

Delete user-defined music

Argument

UserDefinedMusicNumber

Music number: 128 to 255

・If not specified, all definitions are deleted.

Example

BGMCLEAR

BGMCONT [TrackNumber[,FadeTime]]

Resume music playback when paused

・Use BGMPAUSE to pause.

Arguments

TrackNumber

Track number to play: 0 to 15

・If not specified, all tracks are restarted.

FadeTime

Specify in seconds

・Real can be specified.
・Restart immediately with 0.
・0, if not specified.

Example

BGMCONT

BGMPITCH [TrackNumber,]Pitch

Change the reference pitch of the music being played

Arguments

TrackNumber

Target track number: 0 to 15

・If not specified, all tracks are the default.

Pitch

Changing pitch value: -32768 to 32767

・Semitones by 100

Example

BGMPITCH 0,100

BGMPLAY [TrackNumber,]MusicNumber[,Volume][,FadeTime]

Start playing the specified music

Arguments

TrackNumber

Track number to play: 0 to 15

・0, if not specified.

MusicNumber

・Preset sound source (0 to 73)
・User-defined (128 to 255)

Volume

・Playback volume: 0 to 127

FadeTime

・Fade-in time: 0 to 32767 seconds

Example

BGMPLAY 128

BGMPLAY MMLString

Start playing the specified MML data

・Playback by MML is performed on track 0.
・User-defined music number 255 is rewritten as an MML music.

Argument

MMLString

Command string

Example

BGMPLAY "T120O4L4CC8D8EE8F8GA8G8E2" 

BGMPAUSE [TrackNumber[,FadeTime]]

Pause music playback

・Use BGMCONT to resume.

Arguments

TrackNumber

Track number to play: 0 to 15

・If not specified, all tracks are stopped.

FadeTime

Specify in seconds

・Real can be specified.
・Immediate stop with 0.
・0, if not specified.

Example

BGMPAUSE

BGMSET UserDefinedMusicNumber,MMLString

Define user-defined music

・The defined music can be played on BGMPLAY.

Arguments

UserDefinedMusicNumber

User-defined music number: 128 to 255

MMLString

Command string

Example

BGMSET 128,"CDEFG" 

BGMSETD UserDefinedMusicNumber,@LabelString

Predefine user-defined music

・The defined music can be played on BGMPLAY.
・Register MML internally using DATA command (DATA "CDEFGAB").
・Define a numerical value of 0 at the end of DATA.

Arguments

UserDefinedMusicNumber

User-defined music number: 128 to 255

@LabelString

Label or label string with MML string registered in DATA

Example

BGMSETD 128,"@MMLTOP" 

BGMSTOP [TrackNumber[,FadeTime]]

Stop playing music

Arguments

TrackNumber

Target track number: 0 to 15

・If not specified, all tracks are stopped.

FadeTime

Specify in seconds

・Real can be specified.
・Immediate stop with 0.
・0, if not specified.

Example

BGMSTOP

BGMVAR TrackNumber,VariableNumber,Value
BGMVAR TrackNumber,VariableNumber OUT Variable

Set and get BGM track variable values

Arguments

TrackNumber

Track number: 0 to 15

VariableNumber

Variable number to set/get value: 0 to 7

Return Value

The acquired variable value

Example

BGMVAR 0,1,2
V=BGMVAR(0,1)

BGMVOL [TrackNumber,]Volume

Set the volume of the specified track

Arguments

TrackNumber

Track number to play: 0 to 15

・0, if not specified.

Volume

Volume to set: 0 to 127

Example

BGMVOL 0,64

BGMWET [TrackNumber,]Wet

Set the effector level for the specified track

・Volume changes when effector is off. Use with the effector turned on.

Arguments

TrackNumber

Track number to set: 0 to 15

・0, if not specified.

Wet

Effector level to be set: 0 (dry) to 127 (wet)

Example

BGMWET 0,64

EFCEN State
EFCEN OUT Variable

Set/get effector status

Argument

State

0 #EFCOFF OFF
1 #EFCON ON

Return Value

0: OFF
1: ON

Example

EFCEN 0
S=EFCEN()

EFCSET PresetNumber

Set effectors (preset designation)

Argument

PresetNumber

0 #EFCOFF OFF
1 #EFCBATH Bath
2 #EFCCAVE Cave
3 #EFCSPACE Space

Example

EFCSET #EFCSPACE

EFCSET ReflectionSoundMode,ReflectionSoundVolume,ReflectionSoundTime,EchoMode,EchoVolume,EchoTime,HighSoundAttenuationRate,EchoTone,InputVolume

Set effectors (detailed settings)

Arguments

ReflectionSoundMode

0 #EFCREFSROOM Small Room
1 #EFCREFLROOM Large Room
2 #EFCREFHALL Hall
3 #EFCREFCAVE Cave
4 #EFCREFNONE No Reflections

ReflectionSoundVolume

Reflected sound volume: 0.0 to 1.0

ReflectionSoundTime

Time for reflected sound to decay: 0 to 300 (milliseconds)

EchoMode

0 #EFCREVROOM Room
1 #EFCREVHALL Hall
2 #EFCREVMETAL Metallic Corridor
3 #EFCREVCAVE Cave
4 #EFCREVREV Reverb

EchoVolume

Reverberation volume: 0.0-1.0

EchoTime

Reverberation decay time: 100-20000 (milliseconds)

HighSoundAttenuationRate

Decay rate of reverberant treble: 0.1 to 1.0 (the lower the value, the faster the treble is attenuated)

EchoTone

Reverberant tone parameters: 0.0 to 1.0

InputVolume

Effector input volume: 0.0 to 1.0

Example

EFCSET #EFCREFSROOM,1,100,#EFCREVROOM,1,20000,1,0.01,0.5

EFCWET BEEPWet,BGMWet,TALKWet,PCMWet

Set effector wetness

・Volume changes when effector is off. Use with the effector turned on.

Arguments

BEEPWet

Effect on BEEP: 0 (dry) to 127 (wet)

BGMWet

Effect on BGMPLAY: 0 (dry) to 127 (wet)

TALKWet

Effect on TALK: 0 (dry) to 127 (wet)

PCMWet

Effect on PCMSTREAM: 0 (dry) to 127 (wet)

Example

EFCWET 64,64,64,64
EFCWET 0,0,127,0

PCMCONT

Resume PCM playback

Example

PCMCONT

PCMPOS PlaybackPosition

Set the PCM playback position

・Set which array index will be used for the next time PCM data is sent at regular intervals.

Argument

PlaybackPosition

The index of the array specified by PCMSTREAM

Example

PCMPOS 1024

PCMPOS OUT Variable

Get PCM playback position

-Returns the array index from which the next transmission of PCM data, which is performed at regular intervals, will be performed.

Return value

The index of the array specified by PCMSTREAM

Example

PCMPOS OUT P

PCMSTOP

Stop PCM playback

Example

PCMSTOP

PCMSTREAM PCMDataArray[,SamplingFrequency]

Start PCM playback

Arguments

PCMDataArray

An array containing PCM data. The 1D array is reproduced as monaural and the 2D array is reproduced as stereo sound.
Arrays are treated as ring buffers and can be rewritten while playing.

SamplingFrequency

Sampling frequency (Hz) of data to be reproduced: 1 to 192000

・The default is 48000.

Example

DIM PCMDATA[2,48000]
PCMSTREAM PCMDATA,48000

PCMSTREAM PCMDataArrayL,PCMDataArrayR[,SamplingFrequency]

Start PCM playback

Argument

PCMDataArrayL

An array containing PCM data on the left side of stereo audio.
Arrays are treated as ring buffers and can be rewritten while playing.

PCMDataArrayR

An array containing PCM data on the right side of stereo audio.
Arrays are treated as ring buffers and can be rewritten while playing.

SamplingFrequency

Sampling frequency (Hz) of data to be reproduced: 1 to 192000

・The default is 48000.

Example

DIM PCML[48000],PCMR[48000]
PCMSTREAM PCML,PCMR,48000

PCMVOL Channel,Volume[,NumberOfSamples]

Set the PCM volume

Arguments

Channel

Specify the channel to set the volume

0 #PVLEFT Left
1 #PVRIGHT Right

Volume

Volume to set: -32767 to 32767 (Specifying a negative value reverses the phase.)

NumberOfSamples

Number of output samples until the set volume is reached

・0, if not specified.

Example

PCMVOL 0,0,48000

PCMVOL [Channel,]Volume

Set the PCM volume

Arguments

Channel

Specify the channel to set the volume

0 #PVLEFT Left
1 #PVRIGHT Right

・If not specified, it's both.

Volume

Volume to set: -32767 to 32767 (Specifying a negative value reverses the phase.)

Example

PCMVOL 16384

PCMVOL OUT LeftVolume[,RightVolume]

Get PCM volume

Return Value

LeftVolume

Current left channel or monaural volume: -32767 to 32767

Right volume

Current right channel volume: -32767 to 32767

Example

PCMVOL OUT L,R

RECCHK OUT State

Get recording status by RECSTART

Return Value

Recording complete/stop=0, Recording = 1

Example

RECSTART 10
WHILE RECCHK():WEND

RECDATA SamplePosition OUT Left,Right

Extract sample values recorded with RECSTART

Argument

SamplePosition

0 to RECLEN()-1

Return Value

Left

Left channel sample value

Right

Right channel sample value

Example

RECSTART 10
WHILE RECCHK():WEND
FOR I=0 TO RECLEN()-1
  RECDATA I OUT L,R
NEXT

RECLEN()

Returns the number of buffer samples allocated by RECSTART

Return Value

Buffer sample count

Example

RECSTART 10
? RECLEN() '480000

RECPOS()

Returns the current sample position recorded with RECSTART

Return Value

Sample position

Example

RECSTART 10
WHILE RECCHK()
 ? RECPOS
WEND

RECSAVE Array[,SampleNumber][,SamplePosition]

Extract sample values recorded with RECSTART into an array

Arguments

Array

Specify a 1D array or a 2D array. The number of elements is adjusted automatically.

For a 1D array, the average value of the left and right samples. In the case of a 2D array, [0, x] is the left channel and [1, x] is the right channel sample value.

SampleNumber

Number of samples to be taken

・If not specified, it's the same value as RECPOS().

SamplePosition

Top position to take out sample

・0, if not specified.

Example

RECSTART 5
BGMPLAY 3
WHILE RECCHK():WEND
BGMSTOP
DIM BUF[2,1]
RECSAVE BUF
WAIT 60
PCMSTREAM BUF,48000
INPUT A$

RECSTART Time

Record sound played on BEEP/BGMPLAY/TALK

・Record at the sampling frequency 48KHz for the time given by the argument.
・Recording stops after the specified time.
・Use RECSTOP to stop during recording.

Argument

Time

Number of seconds to record: 0.1 to 60

Example

RECSTART 5
BGMPLAY 3
WHILE RECCHK():WEND
BGMSTOP
DIM BUF[2,1]
RECSAVE BUF
WAIT 60
PCMSTREAM BUF,48000
INPUT A$

RECSTART

Record sound played on BEEP/BGMPLAY/TALK

・Record at sampling frequency of 48KHz (no time limit).
・The buffer is prepared for 5 seconds.
・Use RECSTOP to stop recording.

Example

LENGTH=48000/3
DIM BUF[2,LENGTH]
PCMSTREAM BUF,48000
PCMVOL 0,16384
PCMVOL 1,16384
RECSTART
BGMPLAY 1
PPOS=0
WPOS=0
LOOP
 NPOS=RECPOS()
 IF PPOS!=NPOS THEN
  FOR I=PPOS to NPOS-1
   RECDATA I OUT L,R
   BUF[0,WPOS]=L
   BUF[1,WPOS]=R
   WPOS=(WPOS+1) mod LENGTH
  NEXT
  PPOS=NPOS
 ENDIF
ENDLOOP

RECSTOP

Stop recording with RECSTART

Example

RECSTART 10
WAIT 60*5
RECSTOP

SNDMSBAL Balance[,FadeTime]

Set the volume balance of the main/sub interpreter

・It can only be set within subprograms.

Arguments

Balance

Balance to be set: 0 (sub side only) to 64 (main/sub equal) to 127 (main side only)

FadeTime

Time to reach the set balance: 0 to 32767 (seconds)

Example

SNDMSBAL 0,3.5

SNDMSBAL OUT Balance

Obtaine the volume balance of the main/sub interpreter

Return Value

Current balance

Example

SNDMSBAL OUT B

SNDMVOL Volume[,FadeTime]

Set the overall sound volume

・Settings from subprograms are ignored.

Arguments

Volume

Volume to be set: 0 to 127

FadeTime

Time to reach the set volume: 0 to 32767 (seconds)

Example

SNDMVOL 0,1.5

SNDMVOL OUT Volume

Get the volume of the entire sound

Return Value

Current volume (changes within the specified time if it's fading)

Example

V=SNDMVOL()

SNDSTOP

Stop all sounds

Example

'BGM/BEEP/TALK
SNDSTOP

TALK String

Start speech synthesis according to the given string

Argument

Hiragana / Katakana / Punctuation marks or phoneme strings starting with $

  a b d e f g h i j k m n o p q(n) r s t u w y z
  by ch cl(hopping sound) dy gy hy ky my ny py sh ts
  #(0.1 second no sound)

In addition to the above, control strings starting with < and ending with >

<SValue> Speed: 0 (Fast) to 1024 (Slow) Standard: 128
<PValue> Pitch: 0 (High) to 1024 (Low) Standard: 128
<VValue> Volume: 0 (Little) to 128 (Loud) Standard: 128

Example

TALK "<S128>Konnichiwa. Watashiha, PetitCom4 desu." 
TALK "$<S128>koqnichiwa######watashiwa##puchikoqfoodesu" 

TALKSTOP

Stop speech synthesis

Example

TALKSTOP

WAVSET InstrumentNumber,Attack,Decay,Sustain,Release,DefinitionString[,ReferencePitch]

Set the instrument sound waveform

Arguments

InstrumentNumber

Instrument number for setting the waveform: 224 to 255

Attack

Time to increase the volume to maximum: 0 to 127 (faster as the value increases)

Decay

Time until the volume decreases from the maximum value to become constant: 0 to 127 (faster as the value increases)

Sustain

Volume when extending the sound: 0 to 127 (louder as the value increases)

Release

Time until volume decreases to 0: 0 to 127 (faster as the value increases)
・When the release is set to 0, the playback sound cannot be stopped with BGMSTOP, but it can be forcibly stopped with the SNDSTOP command.

DefinitionString

"00" to "FF" are continuously described as one sample of 8 bits (128 is subtracted and treated as a value of -128 to 127)

Specify with 16, 32, 64, 128, 256 and 512 samples

ReferencePitch

Specify the note number of the pitch of the defined waveform.

・The default is 69 ("O4A": A of octave 4).

Example

WAVSET 224,127,0,0,127,"FF00"*8,69
BGMPLAY "@224O4A1" 

WAVSETA InstrumentNumber,Attack,Decay,Sustain,Release,Array[,ReferencePitch][,WaveStart][,WaveEnd]

Set the instrument sound waveform

・Version 3 compatibility mode
・Depending on sample length and reference pitch, correct pitch may not be produced.

Arguments

InstrumentNumber

Instrument number for setting the waveform: 224 to 255

Attack

Time to increase the volume to maximum: 0 to 127 (faster as the value increases)

Decay

Time until the volume decreases from the maximum value and becomes constant: 0 to 127 (faster as the value increases)

Sustain

Volume when extending the sound: 0 to 127 (louder as the value increases)

Release

Time until volume decreases to 0: 0 to 127 (faster as the value increases)
・When the release is set to 0, the playback sound cannot be stopped with BGMSTOP, but it can be forcibly stopped with the SNDSTOP command.

Array

A 1D array containing waveforms
・One element is treated as one sample of 8 bits. (128 is subtracted and treated as a value of -128 to 127)

ReferencePitch

Specify the note number of the pitch of the defined waveform.

・The default is 69 ("O4A": A of octave 4).

WaveformStart

Specify the index of the top position of the waveform.

・0, if not specified.

WaveformEnd

Specify the index of the end position of the waveform.

・If not specified, it'll be the end of the array.

Example

DIM W[2048]
WAVSETA 224,127,0,0,127,W,69,0,2047
BGMPLAY "@224O4A1" 

WAVSETA InstrumentNumber,Attack,Decay,Sustain,Release,Array,ReferencePitch,LoopStart,LoopEnd,SampleFrequency[,Offset][,BEEPLoopFlag]

Set the instrument sound waveform

・Accommodates waveforms as long as the sound memory capacity allows (at a sample frequency of 48000Hz for about 80 seconds)
・Loop setting and sample frequency can be specified.
・Depending on the sample length, reference pitch, and sample frequency, the correct pitch may not be produced.

Arguments

InstrumentNumber

Instrument number for setting the waveform: 224 to 255

Attack

Time to increase the volume to maximum: 0 to 127 (faster as the value increases)

Decay

Time until the volume decreases from the maximum value and becomes constant: 0 to 127 (faster as the value increases)

Sustain

Volume when extending the sound: 0 to 127 (louder as the value increases)

Release

Time until volume decreases to 0: 0 to 127 (faster as the value increases)
・When the release is set to 0, the playback sound cannot be stopped with BGMSTOP, but it can be forcibly stopped with the SNDSTOP command.

Array

A 1D array containing waveforms
・One element is treated as one signed 16-bit sample.

ReferencePitch

The note number of the pitch of the defined waveform

・The default is 69 ("O4A": A of octave 4).

LoopStart

The index of the top position of the loop of the waveform (with offset)

・0, if not specifiied.

LoopEnd

The index of the loop end position of the waveform (with offset)

・If not specified, it'll be the end of the array.

SampleFrequency

Waveform sample frequency (in Hz): 1 to 96000

・The default is 28160.

Offset

The index of the reference start position of the array

・0, if not specified.

BEEPLoopFlag

Specify whether to loop when playing waveform in BEEP

・0, if not specified (does not loop).

Example

DIM W[2048]
WAVSETA 224,127,0,0,127,W,69,1024,2047,44100,0,#false
BGMPLAY "@224O4A1" 

BGMCHK [TrackNumber] OUT Variable

Return the music playback status of the specified track

Argument

TrackNumber

Number of the track whose playback status is to be acquired: 0 to 15

・0, if not specified.

Return Value

0: Not Playing
1: Playing

Example

R=BGMCHK(1)
PRINT R

CHKMML MMLString OUT Variable

Return whether the contents of the MML string can be correctly interpreted as MML

Argument

MMLString

Command string

Return Value

-1: Normal
0: Error (string position that caused an interpretation error)

Example

R=CHKMML("T120O4L4CC8D8EE8F8GA8G8E2")
PRINT R

TALKCHK OUT Variable

Check the speech synthesis status

Return Value

FALSE=Stopped, TRUE=Playing

Example

RET=TALKCHK()

Source Code Operation

PRGEDIT ProgramSlot[,LineNumber]

Start source code operation on the editor

・When the PRGEDIT command is executed, the editor wrapping mode is forcibly turned off.
・In the following cases, the PRGEDIT state is canceled and PRGEDIT must be executed again.
・When the contents of the target slot are changed by LOAD command or NEW command, etc.
・When the program is run
・When the wrapping mode is turned on in the editor

Arguments

ProgramSlot

・Program slot to operate: 0-5
・An error will occur if the currently executing slot is specified.

LineNumber

・The operation target line (the current line)
・If not specified, the first line becomes the current line.
・If -1 is specified for the line number, the last line becomes the current line.

Example

PRGEDIT 0

PRGEDIT()
PRGEDIT OUT [ProgramSlot,]LineNumber

Get source code information in operation

・When used in function format, it returns the line number.
・An error occurs if source code operation is not started with PRGEDIT first.

Return Value

ProgramSlot

・Program slot in operation

LineNumber

・Source code line number in operation

Example

PRGEDIT OUT SLOT,LINE
LINE=PRGEDIT()

PRGGET$([AutoSeekFlag])

Get one line of string for the current line

Argument

AutoSeekFlag

・When it's 1, PRGGET is called and the current line is acquired and automatically moved down one line. As a result, the source code can be acquired line by line by simply calling PRGGET.
・When it's 0, the current line is not moved automatically. The current line must be moved with PRGSEEK.
・If not specified, 1 is specified.

Return Value

・The source string of the current line (empty string if out of range)

Example

A$=PRGGET$()

PRGSEEK [MovementDirection]
PRGSEEK([MovementDirection])

Move the current line back and forth one line

Arguments

MovementDirection

1 Move Down One Line
-1 Move Up One Line

・If not specified, it's 1.

Return Value

・When used in the function format, 1 is returned if it can be moved, and 0 is returned if it is not possible to move forward from the first or last line.

Example

R=PRGSEEK(1)

PRGSET String

Replace the contents of the current line with the specified string

・If PRGGET$ returns an empty string, add a line.

Argument

String

The string that replaces the current line

Example

PRGSET "'Comment" 

PRGINS String [,Flag]

Insert a one line string into the current line

・Insert multiple lines of string including line feed code CHR$(10).

Arguments

String

・The source string to insert

Flag

1 Insert After Current Line
0 Insert Before Current Line

・If not specified, it's 0.

Example

PRGINS "PRINT "+CHR$(34)+"HELLO"+CHR$(34)

PRGDEL [NumberOfDeletedLines]

Delete the current line

Argument

NumberOfDeletedLines

Number of lines to delete

・When a negative value is entered, all of them are deleted.
・If not specified, it's 1.

Example

PRGDEL

PRGSIZE([ProgramSlot[,ValueTypeToGet]])

Get the number of lines of source code

Arguments

ProgramSlot

Program slot for acquiring the number of rows: 0-5

・If not specified, the currently executing program slot is specified.

ValueTypeToGet

0 Number of Lines (default)
1 Number of Characters
2 Number of Empty Characters

Return Value

Value according to type

Example

A=PRGSIZE(0)

PRGNAME$([ProgramSlot])

Get program file name

・The specified file name by the LOAD/SAVE command is returned.

Argument

ProgramSlot

Program slot for acquiring file name: 0-5

・If not specified, the currently executing program slot is specified.

Return Value

File name of the program loaded in the specified program slot

Example

PRINT PRGNAME$(0)

Advanced Calculations

BIQUAD OutputArray(OUT),InputArray(IN),FilterCoefficientArray(FP)

Apply biquadratic filter

・The following calculation is performed on all elements of the specified array. (0 <= t < len(IN))
OUT[t]=FP[0]*IN[t]+FP[1]*IN[t-1]+FP[2]*IN[t-2]-FP[3]*OUT[t-1]-FP[4]*OUT[t-2]
・If a 1D array is specified, it will be handled as monaural and if a 2D array is specified, it will be handled as stereo.
・If the array index is negative, use monaural or the value of FP[5..8] for the left channel and FP[9..12] for the right channel.
FP[5..12] value is updated at each execution.
・The filter coefficient array of the main characteristics such as a low-pass filter can be obtained with the BQPARAM command.

Arguments

OutputArray

Array that stores the results of applying the filter

InputArray

Array containing the signals to which the filter is applied

FilterCoefficientArray

Array containing filter coefficient

・The number of elements in the array must be 13 or more.

Example

DIM OD[2,1000],ID[2,1000],FP[13]
BQPARAM FP,#BQLPF,48000,8000,1/SQR(2)
BIQUAD OD,ID,FP 

BQPARAM FilterCoefficientArray,FilterType,SamplingFrequency,CutoffFrequency,QValueOrBandwidth[, AmplificationFactor]

Calculate filter coefficients of biquadratic filter

Arguments

FilterCoefficientArray

Array to store filter coefficient (length must be 13 or more)

・ [5..12] of the specified array is not changed even if this command is executed.

FilterType

0 #BQAPF All-Pass Filter Only the phase near the cutoff frequency changes
1 #BQLPF Low-Pass Filter Passes below the cutoff frequency
2 #BQHPF High-Pass Filter Passes frequencies above the cutoff frequency
3 #BQBPF Bandpass Filter Passes a specified frequency band centered on the cutoff frequency
4 #BQBSF Bandstop Filter Blocks the specified frequency band centered on the cutoff frequency
5 #BQLSF Low-Shelf Filter Amplifies the frequency below the cutoff frequency with the specified amplification factor
6 #BQHSF High-Shelf Filter Amplifies the frequency above the cutoff frequency with the specified amplification factor
7 #BQPEQ Peaking Equalizer Amplifies a specified frequency band centered on the cutoff frequency with a specified amplification factor

SamplingFrequency

Sampling frequency of input signal

・0 is an error.

CutoffFrequency

Filter cutoff frequency

QValueOrBandwidth

Handle filter types, BPF/BSF/PEQ as bandwidth (unit: octave), and otherwise, QValue as smoothness of filter characteristics.

・0 is an error.

AmplificationFactor

Amplification factor of filter (unit: db). The descriptions must be needed when the filter types, #BQLSF, #BQHSF and #BQPEQ, are used.

Example

DIM OD[1000],ID[1000],FP[13]
BQPARAM FP,#BQLSF,48000,8000,1/SQR(2),3.0
BIQUAD OD,ID,FP 

FFT OutputRealPartArray,OutputImaginaryPartArray,InputRealPartArray,InputImaginaryPartArray[,WindowFunctionValueArray]

Perform Fourier transform on complex array

・All specified arrays must have the same number of elements, and the number of elements must be 2 to the power of n.
・The output and input arrangement may be the same.

Arguments

OutputRealPartArray,OutputImaginaryPartArray

Complex array of real and imaginary parts containing the result of the operation

InputRealPartArray,InputImaginaryPartArray

Complex array of real and imaginary parts to operate on

WindowFunctionValueArray

Array containing the window function values

・If specified, the input complex number array is multiplied by the element value of the same index, and then the Fourier transform is performed.
・The window function value array can also be obtained with the FFTTWFN command.

Example

DIM iR[1024],iI[1024],WF[1024]
DIM oR[1024],oI[1024]
FFTWFN WF,3
FFT oR,oI,iR,iI,WF 

IFFT OutputRealPartArray,OutputImaginaryPartArray,InputRealPartArray,InputImaginaryPartArray

Perform inverse Fourier transform on complex array

・All specified arrays must have the same number of elements, and the number of elements must be 2 to the power of n.
・The output and input arrangement may be the same.

Arguments

OutputRealPartArray,OutputImaginaryPartArray

Complex array of real and imaginary parts containing the result of the operation

InputRealPartArray,InputImaginaryPartArray

Complex array of real and imaginary parts to operate on

Example

DIM iR[1024],iI[1024]
DIM oR[1024],oI[1024]
IFFT oR,oI,iR,iI 

FFTWFN Array,WindowFunctionType

Obtain window function value array

Arguments

Array

Array containing the window function values

WindowFunctionType

0 #WFRECT Rectangular Window
1 #WFHAMM Humming Window
2 #WFHANN Hanning Window
3 #WFBLKM Blackman Window

Example

DIM WF[1024]
FFTWFN WF,#WFHAMM

ARYOP OperationType,ResultStorageArray,Parameter1,Parameter2[,Parameter3]

Perform a batch operation on elements in an array

・From the beginning of the array to the end of the result storage array, the operation specified by the operation type is performed between each element, and the operation result is stored in the result storage array.
・If the number of elements in the parameter array is different from the number of elements in the result storage array, when it reaches the end of the array, return to the top of the array and refer to it repeatedly.

Argument

Operation type

0 #AOPADD Addition (p1+p2)
1 #AOPSUB Subtraction (p1-p2)
2 #AOPMUL Multiplication (p1*p2)
3 #AOPDIV Division (p1/p2)
4 #AOPMAD Sum of Products (p1*p2+p3)
5 #AOPLIP Linear Interpolation (p1*p3+p2*(1-p3))
6 #AOPCLP Clamp (Rounds the value of p1 within the range of p2<=x<=p3)

ResultStorageArray

Numeric array for storing operation results

Parameter1,Parameter2,Parameter3

Parameters 1, 2, and 3 can be specified as a numeric array or normal numeric value

・If a normal numerical value is specified, that numerical value is used for all element operations.

Subprogram

XSUBSCREEN DisplayOffsetX,DisplayOffsetY,Width,Height

Specify the display size of the subprogram display

・This command has meaning only within subprograms. Nothing happens when used from the main program or direct mode.
・The subprograms cannot show the display until this command is executed.
・XSUBSCREEN is a command to set the outline of the sub screen, and the BASIC display resolution in it must be set separately with XSCREEN.

Arguments

DisplayOffsetX,DisplayOffsetY

Display offset on the main display of the sub display: -32768 to 32767

Width,Height

Display size of the sub display

・Width: 1 to 1280
・Height: 1 to 720

XSUBSCREEN 0

Stop displaying the subprogram screen

・This command has meaning only within subprograms. Nothing happens when used from the main program or direct mode.
・When this command is executed, the subprogram disappears from the display.

Argument

0

Specify 0 for the argument to turn off the indication.

XSUBSCREEN OUT DisplayOffsetX,DisplayOffsetY,Width,Height

Get the display offset of the subprogram display

・This command has meaning only within subprograms. When used from the main program or direct mode, 0,0 is returned.

Return Value

DisplayOffsetX,DisplayOffsetY

Display offset on the main display of the sub display

Width,Height

Display size of the sub display

ENVSTAT Status

Set the status of the main interpreter

・This command has meaning only within subprograms. Nothing happens when used from the main program or direct mode.

Argument

Status

Main interpreter status to be set

・Only 0 can be specified.
・It is not set when the current status is 3 or 4.

ENVSTAT()

Get the status of the main interpreter

Return Value

0 Waiting in Direct Mode
1 Execution Suspended
2 Execution Stopped Due to Error
3 Running Program
4 Editing Program

ENVSTAT OUT Status,ExecutionSlot,EditSlot

Get the status of the main interpreter

Return Value

Status

0 Waiting in Direct Mode
1 Execution Suspended
2 Execution Stopped Due to Error
3 Running Program
4 Editing Program

ExecutionSlot

Current execution slot

EditSlot

Current edit slot

ENVSTAT OUT Status,ErrorNumber,ErrorArgumentNumber,ErrorSlot,ErrorCharacterPosition,ErrorLine

Get the status of the main interpreter

Return Value

Status

0 Waiting in Direct Mode
1 Execution Suspended
2 Execution Stopped Due to Error
3 Running Program
4 Editing Program

ErrorNumber

If an error has occurred, a value other than 0 is returned.

ErrorArgumentNumber

If the argument that occurred when the error occurred is known, a positive value is returned.

ErrorSlot

If an error has occurred, the program slot that occurred is returned.

ErrorCharacterPosition

If an error has occurred, the character position from the beginning of the generated source code is returned.

ErrorLine

If an error has occurred, the line number in the source code that occurred is returned.

ENVLOAD 0,MainID,SubID

Copy the contents of the program slot on the main interpreter to the program slot on the sub interpreter side

・This command is valid only in the sub interpreter.

Arguments

0

Specify 0 when copying a program slot

MainID

Program slot ot the copy source main interpreter

SubID

Program slot of the copy destination sub interpreter

ENVLOAD 1,MainID,SubID

Copy graphic page data on the main interpreter to the sub interpreter

・This command is valid only in the sub interpreter.

Arguments

1

Specify 1 when copying graphic page

MainID

Graphic page of the copy source main interpreter

SubID

Graphic page of the copy destination sub interpreter

ENVLOAD 2,MainID,SubID

Copy the SPDEF definition on the main interpreter to the sub interpreter side

・This command is valid only in the sub interpreter.

Arguments

2

Specify 2 when copying SPDEF definitions

MainID

SPDEF definition number of the copy source main interpreter

SubID

SPDEF definition number of the copy destination sub interpreter

ENVSAVE 1,SubID,MainID

Copy graphic page data on the sub interpreter to the main interpreter

Arguments

1

Specify 1 when copying graphic page

SubID

Graphic page of the copy source sub interpreter

MainID

Graphic page of the copy destination main interpreter

ENVSAVE 2,SubID,MainID

Copy the SPDEF definition on the sub interpreter to the main interpreter

Arguments

2

Specify 2 when copying SPDEF definition

SubID

SPDEF definition number of the copy source sub interpreter

MainID

SPDEF definition number of the copy destination main interpreter

ENVINPUT$([HistoryNumber])

Get the contents of console input line or input history of main interpreter

Argument

HistoryNumber

Number of input history to get. The larger the history, the more historical it will be: (0 to 32)

・If 0 is specified, the console line currently being input is acquired instead of the history.
・0, if not specified.

Return Value

Content string of input line or specified input history

ENVTYPE()
ENVTYPE OUT Type,Parameter

Get the interpreter on which the currently running program is operating

Return Value

Type

Interpreter type

0 Main Interpreter
1 Sub Interpreter
2 UI Interpreter

Parameter

Parameter set at startup

・Programs that can be created by the user always return -1.

ENVFOCUS Flag

Get and transfer focus

Argument

1 to get focus, 0 to transfer focus

ENVFOCUS()

Get focus status

Return Value

Whether it has focus

・If it has, it returns 1. If it does not, it's 0.

ENVPROJECT

Synchronize the sub interpreter work project with the main interpreter work project

PUSHKEY String

It is assumed that the specified string has been entered from the keyboard.

Argument

String

Input string

・Maximum 64 characters

HELPINFO OUT CommandNameString,NumericArray

Information of help data at the cursor position

・Command for internal use only. Do not use.

Return Value

CommandNameString

String of command name at the cursor position

・If there is no command name, "DEFAULTHELPKEY" is returned.

Array

An array that returns the number of rows

・The number of elements in the array is the number of pages.

HELPINFO CommandNameString OUT NumericArray

Help data information for command names

・Command for internal use only. Do not use.

Argument

CommandNameString

String of command name to get

Return Value

Array

An array that returns the number of rows

・The number of elements in the array is the number of pages.

HELPGET CommandNameString,PageNumber OUT LineStringArray,TagArray,AttributeNumericArray,CodeExampleString

Get help data

・Command for internal use only. Do not use.

Arguments

CommandNameString

String of command name to get

PageNumber

Page number to get

LineNumber

Line number to get

Return Value

LineStringArray

Each value is a string of one line

・The array size is the number of lines.

TagArray

The tag for each value is a number of indentations and color information.

・When HEAD is included in the internal information, it becomes a headline, and it is used for moving between headlines with PAGEUP/DOWN.
・The array size is the number of lines.

Value Description
0 Basic Line
1 You can see it by scrolling the title
2 Argument Headlines
3 Return Value Headlines
4 Other Headlines
5 Description directly under the title
6 Argument Subheadings
7 Return Value Subheadings
8 Other Subheadings

AttributeNumericArray

Attribute information for a specific string in a line

・The array is a 3D array, and the size of the array is the number of rows, the number of attributes per row, and the attribute number.
・Reference: ARRAY#(NumberOfRows,NumberOfAttributesPerRow,AttributeType)
・When the attribute number is 0 (position) and the acquired value is negative, each attribute information is invalid.

Index Description
0 Position
1 Length from Position
2 Color

・As the corresponding attribute increases, the structure in the array may change.

CodeExampleString

Code example string

reference/all_references.txt · Last modified: 2023/12/07 15:54 (external edit)

Page Tools