・Direct Mode only
NEW
・Direct Mode only
Program slot to erase: 0-5
NEW 3
・Direct Mode only
LIST
・Direct Mode only
Specify the program slot to edit
・When not specified, the program slot currently being edited is specified.
Specify the line number you want to edit
LIST 20 LIST 2:20
・Direct Mode only
LIST ERR
・Direct Mode only
・Variables, SPFUNC and TFUNC settings are cleared.
RUN
・Direct Mode only
・The variable of the specified slot, SPFUNC, TFUNC setting contents are cleared.
Program slot to execute: 0-5
RUN 1
・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.
CONT
・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.
TRACE
・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.
BACKTRACE
・Direct Mode only
The name of the project you want to make current project
・If you specify an empty string "", the workspace project will be selected.
PROJECT "MYGAME"
・Direct Mode only
・Sub interpreter variables, SPFUNC, and TFUNC settings are cleared.
File name string of the program to be loaded as a subprogram
・Direct Mode only
・Direct Mode only
・Direct Mode only
・Direct Mode only
CLEAR
・Either VAR or DIM can be used.
・Multiple variables can be defined simultaneously by separating them with commas.
・Alphanumeric characters and underscores (_) can be used for variable names.
・You cannot use numbers at the beginning.
・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.
VAR A=0,B,C DIM B$
・Either VAR or DIM can be used.
・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.
・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.
VAR ATR[4] VAR DX[5],DY[5],DZ[5] DIM POS$[10,5] DIM IMAGE[]
・Either VAR or DIM can be used.
・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.
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.
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.
VAR ATR[4]=[1,2,3,4] DIM POS$[10,5]=["X","Y","Z","W"] DIM IMAGE[]=[0,1,2,3,4]
・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.
A=10 B=A*6 C[4]=A+B
Two variables whose values are to be exchanged
SWAP A,B SWAP A[5],B[2]
Variable to manipulate
The value to add
・If not specified, it's 1.
INC X INC X,3
Variable to subtract
The value to subtract
・If not specified, it's 1.
DEC X DEC X,3
Copy source array
・Only 1D arrays can be specified.
First element number of copy source
・If not specified, it's 0.
Number of elements to copy
・If not specified, the number of elements in the copy source array minus the copy source offset is specified.
Copy result array
・In the case of string array, the string of each element is also copied.
Copy source string
Copy source start position
・If not specified, it's 0.
Number of characters to copy
・If not specified, the number of characters in the copy source string minus the copy source offset is specified.
Copy result string
・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.
Copy destination array
First element number of the copy destination
・If not specified, it's 0.
Copy source array
First element number of copy source
・If not specified, it's 0.
Number of elements to copy
・If not specified, the number of elements in the copy source array minus the copy source offset is specified.
DIM SRC[10],DST[10] COPY DST,SRC
・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.
Copy destination array
First element number of the copy destination
・If not specified, it's 0.
Label name string indicating the DATA statement you want to read
・Reading starts from the DATA statement that appears first after the label name.
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.
DIM DST[5] COPY DST,"@SRC" @SRC DATA 5,1,1,2,4
Copy destination string variable
Copy start position
・If not specified, it's 0.
Copy source string
Copy source start position
・If not specified, it's 0.
Number of characters to copy
・If not specified, the number of characters in the copy source string minus the copy source offset is specified.
COPY A$,"12345"
・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.
Array treated as a copy destination ring buffer
Copy start position at the copy destination
Copy source array
Copy start position at the copy source
・0, if not specified.
Number of elements to copy
・If not specified, it's the number of elements in the copy source array.
End position of copied data
・When handled as a ring buffer, the returned value is the next copy destination offset.
Position to start sorting in Array1
・0, if not specified.
Number of elements to sort
・If not specified, it's the number of elements in Array1.
An array containing the numbers to sort
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.
DIM WORK[10] SORT 0,10,WORK
Sort start position in Array1
・0, if not specified.
Number of elements to sort
・If not specified, it's the number of elements in Array1.
An array containing the numbers to sort
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.
DIM WORK[10] RSORT 0,10,WORK
・The number of elements increases by one.
The array to add the element to
The value of the element to add
DIM WORK[10] PUSH WORK,123
・The number of elements reduces by one.
The array whose elements are to be retrieved
The value of the extracted element
DIM WORK[10] PUSH WORK,123 A=POP(WORK)
・The number of elements increases by one.
The array to add the element to
The value of the element to add
DIM WORK[10] UNSHIFT WORK,123
・The number of elements reduces by one.
The array whose elements are to be retrieved
DIM WORK[10] UNSHIFT WORK,123 A=SHIFT(WORK)
・The array type may be an Int, Real or string.
・Partial change is possible by specifying offset and number of elements.
Array to overwrite values
Number or string
The position at which to start writing the value
Number to write
DIM WORK[10] FILL WORK,0
The value whose type is to be examined
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.
・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.
Array dimensions and number of elements to create
Created array
The array to check
Dimension to check the number of elements: 0 to 3
・If not specified, the number of array dimensions is returned.
・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.
DIM WORK[10,20] ? DIM(WORK) ? DIM(WORK,0) ? DIM(WORK,1)
・The numeric value 0 or an empty string is entered in the element of the extended part.
The array to resize
Number of elements after resizing
・You can change only the number of elements written first when defining an array.
・Dimensions cannot be changed.
Array to increase elements
Element insertion position: 0 to the number of array elements
Number of elements to insert: positive number
・1, if not specified.
Insert element value
・If not specified, 0 for numeric arrays and empty string for character arrays.
The array to remove elements from
Element deletion position: 0 to number of array elements -1
Number of elements to delete: positive number
・1, if not specified.
Target array to search
・Multi-dimensional arrays can also be specified.
The value to search for
Found position
・If the value is not found, -1 is returned.
DIM A[]=[1,2,3,4,5] ?FIND(A,3)
Target array to search
・Multi-dimensional arrays can also be specified.
The value to search for
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.
DIM A$[3,3]=["1","2","3","4","5","6","7","8","9"] FIND A$, "4" OUT Y,X ?A$[Y,X]
・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.
INSPECT A ?? "12345"*10
・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.
@MAINLOOP
Jump destination label
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.
GOTO @MAIN JP$="@MAIN":GOTO JP$
・Unlike GOTO, the RETURN command returns to the next command of GOSUB.
Jump destination label
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.
GOSUB @SUB JP$="@MAIN":GOSUB JP$
RETURN
The jump destination is selected according to the value of the expression written here.
・The value must be numeric.
Jump destination when the value of the expression is 0
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.
ON IDX GOTO @JMP_A,@JMP_B PRINT OVER:END @JMP_A PRINT "IDX=0":END @JMP_B PRINT "IDX=1":END
The jump destination is selected according to the value of the expression written here.
The value must be numeric.
Jump destination when the value of the expression is 0
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.
ON IDX GOSUB @SUB_A,@SUB_B PRINT EXIT:END @SUB_A PRINT "IDX=0":RETURN @SUB_B PRINT "IDX=1":RETURN
・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.
Jump destination when program stops
ON BREAK GOTO @FINISH LOOP ENDLOOP @FINISH PRINT "Stopped!"
If there is ELSE, execute CodeBlock2 when false (0)
・It's possible to not specify GOTO right after THEN and ELSE.
IF A==1 THEN PRINT OK IF A>1 THEN @JMP1 ELSE PRINT DATE$ @JMP1 END
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.
IF A==1 THEN PRINT "Congratulations" BEEP 2 ELSE PRINT "Too bad" ENDIF
・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.
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
・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"
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
・Terminate branch operation with ENDCASE.
・Branch conditions are specified by WHEN and OTHERWISE.
Expression referenced as a condition in CASE
・Used for comparison with the expression specified by WHEN.
A=1 CASE A WHEN 0: PRINT"A" WHEN 1: PRINT"B" OTHERWISE: PRINT"X" 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.
Expression that becomes a branch condition
・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 must be used after conditional branch is started with CASE.
・This command itself does nothing.
・When executing the ENDLOOP command, it jumps to the command immediately following the corresponding LOOP keyword.
I=0 LOOP PRINT I;","; I=I+1 IF I>100 THEN BREAK ENDLOOP
・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.
I=0 LOOP PRINT I;","; I=I+1 IF I>100 THEN BREAK ENDLOOP
・Place a NEXT command at the end of the process.
・If the condition is not met, it may not be executed even once.
Variable that is automatically updated on every loop
・Increment is added for each loop.
The value of the loop variable at the start of the loop
The value of the loop variable that terminates the loop
・When the value of the loop variable exceeds this value, the loop is terminated.
・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.
FOR I=0 TO 9 STEP 2 PRINT I;","; NEXT
・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.
FOR I=0 TO 9 STEP 2 PRINT I;","; NEXT
・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.
A=0:B=4 WHILE A<B A=A+1 WEND
A=0:B=4 WHILE A<B A=A+1 WEND
・This command itself does nothing.
・When loop execution is continued with the UNTIL command, it jumps to the corresponding REPEAT command.
A=0:B=4 REPEAT A=A+1 UNTIL A>B
・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.
A=0:B=4 REPEAT A=A+1 UNTIL A>B
・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.
FOR I=0 TO 9 IF I==1 THEN CONTINUE IF I==7 THEN BREAK PRINT I;","; NEXT
・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.
FOR I=0 TO 9 IF I==1 THEN CONTINUE IF I==7 THEN BREAK PRINT I;","; NEXT
END
・Interrupted program slot: The line number is displayed.
・A program interrupted by STOP can be continued with the CONT command.
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.
STOP STOP "Stopped"
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)
・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.
' Display characters DEF FUNC PRINT "SAMPLE" END ' Call FUNC
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.
' Display characters at the specified position DEF FUNC2 X,Y LOCATE X,Y PRINT "SAMPLE" END ' Call FUNC2 10,4
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.
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)
'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")
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.
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.
' 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
・It is possible to make only the parameter variable-length, or make the return value variable-length.
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.
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.
DEF VARFUNC * OUT * FOR I=0 TO DEFOUTC()-1 DEFOUT I, DEFARG(I)*2 NEXT END
・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
COMMON DEF FOO(X,Y,Z)
・Used when returning a value in a DEF command defined as a function type.
DEF CALC(A,B) RETURN A*B END PRINT CALC(2,3)
DEF FUNC PRINT FUNC END
・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length parameters.
The number of parameters of a user-defined command/function
DEF FOO X,Y PRINT DEFARGC() END
・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length parameters.
Number of parameter to check
・Specify 0,1,2,3 ... sequentially from the first parameter.
The value of the specified parameter
DEF FOO X, Y PRINT DEFARG(0) 'Returns X value PRINT DEFARG(1) 'Returns Y value END
・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length return value.
Number of return values of a user-defined command/function
DEF FOO OUT X,Y PRINT DEFOUTC() END
・It can be used only within user-defined commands and functions.
・Convenient when combined with variable-length return value.
Return number to be specified
・Specify 0,1,2,3 ... sequentially from the first return value.
Value to be set in the specified return value
DEF FOO OUT X,Y DEFOUT 0,10 'Same meaning as X=10 DEFOUT 1,20 'Same meaning as Y=20 END
・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.
Parameters required for the specified commands
Describe as many variable names as you want to return as a result after OUT
CALL "USERCD",X,Y OUT A,B ' DEF USERCD X,Y OUT A,B A=X+Y:B=X*Y END
・Both built-in functions and user-defined functions can be specified.
・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.
Enumerate parameters required for specified function
The value returned by the specified function
A=CALL("USERFC",X,Y) ' DEF USERFC(X,Y) RETURN X*Y END
・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().
CALL SPRITE CALL TEXT
・The decimal part is rounded toward zero.
・The result is an Int type.
The underlying numeric value
Number converted to Int
FLOOR: Round down, ROUND: Round off, CEIL: Round up
・The result is a Real type.
The underlying numeric value
Number converted to Real type
INT:Integerization (Round toward zero)
・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.
The underlying numeric value
The value with the fractional part rounded down
INT:Integerization (Round toward zero), ROUND: Round off, CEIL: Round up
A=FLOOR(12.345)
・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.
The underlying numeric value
The value with the fractional part rounded off
INT:Integerization (Round toward zero), FLOOR: Round down, CEIL: Round up
A=ROUND(12.345)
・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.
The underlying numeric value
The value with the fractional part rounded off
INT:Integerization (Round toward zero), ROUND: Round off, FLOOR: Round down
A=CEIL(12.345)
Numeric value for obtaining absolute value
Absolute value
A=ABS(-12.345)
Numeric value to get sign
Returns either 1, 0 or -1 depending on the sign of the argument
1 | Positive Value |
0 | 0 |
-1 | Negative Value |
A=SGN(12.345)
Numeric array for checking minimum value
Smallest number in numeric array
DIM TMP[2]=[50,3] A=MIN(TMP)
Arrange the numerical value whose minimum value is to be examined as argument
Smallest number of arguments passed
A=MIN(1,2,3,4)
Numeric array to get the maximum value
Largest number in the numeric array
DIM TMP[2]=[50,3] A=MAX(TMP)
Arrange the numerical value whose maximum value is to be examined as argument
The largest number of arguments passed
A=MAX(1,2,3,4)
Random number series: 0 to 7
Maximum number of random numbers to get
A random Int between 0 and the maximum value -1.
A=RND(100)
Random number series: 0 to 7
A random Real number between 0 and 1
A=RNDF()
Type of random number series: 0 to 7
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.
RANDOMIZE 0
Numeric value for obtaining the square root
The calculated square root
A=SQR(4)
Index number
・If not specified, the constant #EXP is returned.
The calculated result
A=EXP(2)
Numeric value for calculating power
Power multiplier
The calculated result
A=POW(1,4)
True number: Positive Real
Base: Positive Real
・If not specified, the natural logarithm is calculated.
The calculated result
A=LOG(2,2)
・It can be used in constant expressions.
Angle in degrees
Angle in radians
R=RAD(45)
・It can be used in constant expressions.
Angle in radians
Angle in degrees
A=DEG(0.5*#PI)
Angle in radians
The calculated sine value
A=SIN(RAD(45))
Angle in radians
The calculated cosine value
A=COS(RAD(45))
Angle in radians
The calculated tangent value
A=TAN(RAD(45))
-1.0 to 1.0
The calculated angle (in radians)
A=ASIN(0)
-1.0 to 1.0
The calculated angle (in radians)
A=ACOS(1)
Numeric value to calculate the angle
The calculated angle (in radians)
A=ATAN(1)
Coordinate value to calculate the angle
・The direction from the origin is calculated as an angle.
・Pay attention to the order of arguments.
The calculated angle (in radians)
A=ATAN(1,1)
Numeric value to calculate the hyperbolic sine
The calculated hyperbolic sine
A=SINH(1)
Numeric value to calculate the hyperbolic cosine
The calculated hyperbolic cosine
A=COSH(1)
Numeric value to calculate the hyperbolic tangent
The calculated hyperbolic tangent
A=TANH(0.5)
Number to check
0 | Normal Value |
1 | Infinity |
2 | NaN |
A=CLASSIFY(0.5)
By using [], you can get one character in the string or replace the character at the specified position.
A$="12345" A$[3] → "4" A$[3]="ABC" → "123ABC5"
A string with the first character you want to check
The character code of the specified character
A=ASC("A") X=ASC("XYZ")
・It can be used in constant expressions.
Character code of the character you want to get
One string corresponding to the character code
S$=CHR$(65)
String representing a number ("123" etc.)
Numeric value interpreted from character string
A=VAL("123") F=VAL("-12.56")
The number you want to convert to a string
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.
Converted string (123 → "123")
S$=STR$(123)
Numerica value to be converted to hexadecimal string
・If a Real is specified, the decimal part is rounded toward zero.
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.
Conversion result hexadecimal string
S$=HEX$(65535,4)
Numeric value to convert to a binary string
・If a Real is specified, the decimal part is rounded toward zero.
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.
Conversion result binary string
S$=BIN$(65535,16)
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 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)
・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.
Generated string
S$=FORMAT$("%06D",A)
A number of characters in a string you want to check
A number of elements in an array you want to check
・For String: A number of characters
・For Array: A number of elements
? LEN("ABC123") DIM B[4] ? LEN(B)
String or array to check for the end
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.
DIM X[10] FOR I=0 TO LAST(X) X[I]=I NEXT
Target string
Start position of the acquired string
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.
Obtained string
S$=MID$("ABC",0,2)
Target string
Number of characters in the acquired string
Obtained string
S$=LEFT$("ABC",2)
Target string
Number of characters in the acquired string
Obtained string
S$=RIGHT$("ABC",2)
The position within the string to start the search
・If not specified, search from the beginning of the string.
Search target string
The string to search for
Found: Position in the string
Not found: -1
A=INSTR(0,"ABC","B")
Replace target string
Replacement start position
Number of characters to be replaced
・If not specified, all characters after the start position are replaced with the replacement string.
Replace this string with the number of characters from the start position
Replaced string
A$=SUBST$("ABC",0,2,"XY")
Current date string
・The format is "Year/Month/Day".
Current time string
・The format is "Hour:Minute:Second".
・You can define another constant by writing a comma after one definition.
・Constant names have the same format as variable names and begins with #.
・Numeric values, strings, other constants, CHR$, RGB, RGBF, HSV, HSVF, DEG, RAD functions, and their operations can be used as constant expressions.
CONST #C1=1,#C2="ABC",#C3=RAD(180) ?#C1,#C2,#C3
・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.
・Constant names have the same format as variable names and begins with '#'.
・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.
ENUM #TYPE1=2,#TYPE2,#TYPE3 ?#TYPE1,#TYPE2,#TYPE3
・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.
DATA 123,#C_RED,56,"SAMPLE"+CHR$(20)
・If there is no data that can be read, Out of data error occurs.
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.
READ X,Y,Z,G$ DATA 200,120,0,"JAN" DATA 210,120,0,"FEB"
@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.
・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. |
RESTORE @DATATOP READ X,Y,Z,T$ @DATATOP DATA 123,345,56,"SAMPLE"
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. |
OPTION STRICT
Specify elapsed frame count from the present time
・If 0 is specified, it does not stop.
・If not specified, it's 1.
WAIT 60
・Unlike WAIT, specify the frame count from the previous VSYNC execution.
Specify elapsed frame count since the last VSYNC
・If 0 is specified, it does not stop.
・If not specified, it's 1.
VSYNC 1
・REM or ' and after the end of the line are regarded as comments and they will be ignored.
・Comments do not affect program execution.
' MAIN ROUTINE
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.
H | Variable that receives the hour |
M | Variable that receives the minute |
S | Variable that receives the second |
TMREAD "12:59:31" OUT H,M,S
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.
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) |
DTREAD "2014/10/12" OUT Y,M,D
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.
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.
1 if it exists, 0 if not exist
A=CHKLABEL("@MAIN")
String to search for as an command/function
1 if it exists, 0 if not exist
A=CHKCALL("KEYCHECK")
String to search for as a variable
1 if it exists, 0 if not exist
A=CHKVAR("COUNTX")
・Pressed button information can be obtained with the RESULT function.
・1: OK, -1: Cancel, 0: Timeout
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.
0 | OK (Default) |
1 | No / Yes |
2 | Back / Next |
3 | Cancel / OK |
4 | Cancel / Execute |
5 | Next |
・If not specified, it's 0.
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.
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.
DIALOG "Let's get started",5,"Scenario",-120
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.
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.
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.
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.
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.
R=DIALOG("ABXYLR/DirectionalKey/Touch",(1 << #B_ANY) OR (1 << 17),"Special",0)
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.
The string to display in the caption
・If the caption string is longer than 39 characters, only 39 characters are displayed.
Up to 32 characters
Obtained string
・If the return value of the RESULT function is -1, it'll be canceled (string invalid).
T$=DIALOG("NEWNAME0","SAVE",14)
・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.
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.
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.
String to be stored on the clipboard
CLIPBOARD "Good morning"
String in the clipboard
PRINT CLIPBOARD()
・The contents set with Ctrl+F1 to F5 can be entered.
Function key number to register: 1 to 5
String to be registered in the function key
・The maximum length of the string is 256 characters.
KEY 1,"PRINT"
Function key number for acquiring the contents: 1 to 5
String registered in the function key
A$=KEY(1)
・Get the storage coordinates of the specified font in GRPF.
Character code of the character you want to check
・User-defined characters cannot be specified.
String that contains the first character you want to check
・Ignore characters other than the first character.
・User-defined characters cannot be specified.
The type of font you want to check
・8 or 16 can be specified.
Returns the coordinates where characters are stored in GRPF
・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.
Total size of unused memory
Size of unused memory that can be used at one time
・Unit is milliseconds (1/1000th of a second)
Elapsed time since startup
・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.
Frame count since startup
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
Returns a value according to the item name
PRINT SYSPARAM("LANG") SYSPARAM "KEYREPEAT" OUT ST,IT
・Used in combination with the PERFEND command.
Number of measurement information to use: 0 to 7
Color when indicatng information on the performance gauge
・Optional
・If the same measurement number is specified and PERFBEGIN has not been called, correct measurement results cannot be obtained.
Number of measurement information to use: 0 to 7
・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.
Number of measurement information to use: 0 to 7
Returns the elapsed time from PERFBEGIN to PERFEND in microseconds (1 millionth of a second)
・Read the icons and descriptions of the specified project to the memory and makes them editable.
Project name string to be read
・If it is not specified, the current project will be read.
Specify the metadata item to be set as a numeric value
0 | Title |
1 | Description |
2 | Icon |
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).
Specify the metadata item to be acquired as a numeric value
0 | Title |
1 | Description |
2 | Icon |
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.
・The metadata of the current project is rewritten.
・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.
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 |
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 |
Specify 1 if you want to use motion sensors (accelerometer, gyroscope) or 0 if you do not use it.
・0, if not specified.
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).
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.
・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.
Specify only numeric zero
・An error occurs if a different value is specified.
Maximum number of controllers that can be connected
OperationStyle
0 | Full |
1 | dual-controller grip |
2 | held horizontally |
3 | held vertically |
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.
0 | Not Connected |
1 | handheld mode controller |
2 | Pro Controller |
3 | dual-controller grip |
4 | Joy-Con (L) |
5 | Joy-Con (R) |
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.
0 | Not Connected |
1 | handheld mode controller |
2 | Pro Controller |
3 | dual-controller grip |
4 | Joy-Con (L) |
5 | Joy-Con (R) |
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.
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.
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.
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”.
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 |
1 if the specified button satisfies the specified function ID conditions, 0 otherwise
・If you only want to get the status of one button, see the help for another BUTTON function.
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.
If button ID is specified to -1, all button states will be collected together.
・If only controller ID is specified, -1 is specified.
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 |
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"
・This affects the result when 1 is specified for the function ID of the BUTTON function.
・Affects all connected controllers.
ID of the button which wants to set repeat speed
・For details on the button ID, refer to the help for the BUTTON function.
Frame count from when the button starts to be pressed until repeat starts
Frame count from the occurrence of a repeat until the next repeat occurs
ID of the button which wants to obtain repeat speed
・For details on the button ID, refer to the help for the BUTTON function.
Frame count from when the button starts to be pressed until repeat starts
Frame count from the occurrence of a repeat until the next repeat occurs
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.
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.
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.
・If the motion sensor is not enabled in XCTRLSTYLE, normal values will not be returned.
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.
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.
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)
・If the motion sensor is not enabled in XCTRLSTYLE, normal values will not be returned.
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.
ID of sensor to check: 0 to 1
・ID 1 is valid only when dual-controller grip is used.
・0, if not specified.
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.
・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.
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.
ID of sensor to check: 0 to 1
・ID 1 is valid only when dual-controller grip is used.
・0, if not specified.
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.
・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.
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.
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.
・Calls from subprograms are ignored.
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.
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.
Preset vibration pattern number: 0 to 62
・Vibration stops when 0 is specified.
VIBRATE 1,40 VIBRATE 1,0,1:VIBRATE 1,1,3
・Calls from subprograms are ignored.
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.
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.
Vibration frequency (Hz)
・Vibration stops when 0 is specified.
Vibration amplitude: -128.0 to 127.0
・Vibration stops when 0 is specified.
Vibration frequency (Hz)
・Vibration stops when 0 is specified.
Vibration amplitude: -128.0 to 127.0
・Vibration stops when 0 is specified.
VIBRATE 1,440,127,220,64
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.
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.
・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.
PRINT VIBRATE(1,0)
・Calls from subprograms are ignored.
VIBRATE
・The TOUCH function does not return a valid value in TV mode.
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.
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.
Frame count from start of touch to present
・0 is returned when it's not touched.
Coordinates when touched
・If it is not touched, a meaningless value is returned.
Touch area when touched
・If it is not touched, a meaningless value is returned.
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.
Current mouse coordinates
Current wheel value
Mouse coordinates to set
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.
・If you want to get the status of only one button, refer to another MBUTTON help page.
Mouse button state is returned bit by bit
ID of a button you want to check
0 | Left Button |
1 | Right Button |
2 | Center Button |
3 | Button 4 |
4 | Button 5 |
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.
1 if the specified button satisfies the specified function ID conditions, 0 otherwise
・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Calls from subprograms are ignored.
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.
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.
・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Calls from subprograms are ignored.
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.
Specify 0 for the clustering mode
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.
IR Motion Camera shooting gain: 1 to 16
・2 is the default.
IR Motion Camera exposure time: 7 to 600
・200 is the default.
Minimum area (number of pixels) that can be recognized as a cluster: 0 to 76800
・3 is the default.
Maximum area (number of pixels) that can be recognized as a cluster: 0 to 76800
・76800 is the default.
Minimum brightness to recognize as a cluster: 0 to 255
・150 is the default.
・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.
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.
Always specify 1 for the shooting mode
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.
IR Motion Camera shooting gain: 1 to 16
・8 is the default.
IR Motion Camera exposure time: 7 to 600
・300 is the default.
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.
・It is necessary to turn on the IR usage flag beforehand in XCTRLSTYLE.
・Calls from subprograms are ignored.
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.
Specify 2 for the moment mode
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.
IR Motion Camera shooting gain: 1 to 16
・8 is the default.
IR Camera exposure time: 7 to 600
・300 is the default.
・Calls from subprograms are ignored.
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.
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.
IR Camera status
0 | Not in Use |
1 | Stopped |
2 | Starting Clustering |
3 | Starting Shooting Mode |
4 | Starting Moment Mode |
・It is necessary to start using the IR Motion Camera with IRSTART.
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.
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.
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.
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.
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 |
・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.
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.
Sprite ID to be linked to the shot image: 0 to 4095
・Return values are all zero when the USB keyboard is not connected.
USB Usage ID of the key you want to check: 0 to 255
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.
1 if the key is specified by the function ID, 0 if not
Returns modifier key press information in bits
bit0 | Windows Key |
bit1 | Shift Key |
bit2 | Ctrl Key |
bit3 | Alt Key |
・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.
Specify the maximum number of controllers you want to connect: 1 to 2
When using Toy-Con, specify 100 for the operation style
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.
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.
・Sspecifying a Toy-Con type other than 1 in XCTRLSTYLE results in an error.
・Return values after key/button information can be omitted.
ID of the controller that acquires information: 1 to 2
Return whether or not the Toy-Con Piano is recognized
・Recognizing with 1, 0 is not recognized.
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 |
Dial type inserted in Toy-Con
0 | Not Inserted, Cannot be Recognized |
1 | Bold Line |
2 | Fine Line |
3 | Two Lines |
4 | Middle Line |
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.
・An error occurs if XCTRLSTYLE is used without starting Toy-Con Robot recognition.
ID of the controller that acquires information: 1 to 2
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 |
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 |
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 |
・An error occurs if XCTRLSTYLE is used without recognizing the Toy-Con Robot visor.
ID of the controller that acquires information: 1 to 2
Return 1 if the visor is recognized correctly, 0 if not.
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 |
・An error occurs if XCTRLSTYLE is used without starting Toy-Con recognition.
ID of the controller that acquires information: 1 to 2
Return whether or not Toy-Con is recognized. Recognizing with 1. Not recognized by 0
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.
・An error occurs if XCTRLSTYLE is used without starting to recognize Toy-Con Fishing Rod.
・Return values after fishing rod yaw can be omitted.
ID of the controller that acquires information: 1 to 2
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.
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.
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.
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.
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.
Get the fishing rod pitch (up and down angle) in radians
・Upward is a positive value, downward is a negative value, 0 is horizontal.
・An error occurs if XCTRLSTYLE is used without recognizing the Toy-Con Motorbike.
・Return values after HandleTilt can be omitted.
ID of the controller that acquires information: 1 to 2
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.
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.
Get the amount of accelerator twist with a value between 0 and 1.0
・Return 0 when not twisted.
Get accelerator twist angle in radians
・Return 0 when not twisted.
Get the angle in radians when the Toy-Con Motorbike is facing up
・An error occurs if 7 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.
ID of the controller that acquires information: 1 to 2
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 |
Toy-Con Pedal depression: 0 to 1.0
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.
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.
Operation amount of the left lever: 0 to 1.0
Operation amount of the right lever: 0 to 1.0
Cord pull amount: 0 to 1.0
Operation amount of the side lever: 0 to 1.0
Gimmick dial position of the left and right lever: 0 to 4
・An error occurs if 8 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.
ID of the controller that acquires information: 1 to 2
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 |
Toy-Con Pedal depression: 0 to 1.0
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.
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.
・An error occurs if 9 or 10 is not specified for Toy-Con type in XCTRLSTYLE.
・Return values after the accelerator can be omitted.
ID of the controller that acquires information: 1 to 2
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 |
Toy-Con Pedal depression: 0 to 1.0
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.
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.
・If XCTRLSTYLE is not set to use Toy-Con, an error occurs.
ID of the controller that acquires information: 1 to 2
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.
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.
Specify when you want to display a specific file type.
・If not specified, all files will be displayed.
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.
FILES FILES "TXT:PROJECT"
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.
If "//" is specified, the project list is displayed.
FILES "//"
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.
Specify when you want to get a specific file type
・If not specified, all files are acquired.
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.
A string array containing a list of files
NAMETBL$ = FILES() FOR I=0 TO LAST(NAMETBL$) ?NAMETBL$[I] NEXT
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.
If "//" is specified, the project list is acquired.
A string array containing a list of projects
NAMETBL$ = FILES("//") FOR I=0 TO LAST(NAMETBL$) ?NAMETBL$[I] NEXT
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.
Specify when you want to get a specific file type
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.
・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.
DIM NAMETBL$[] FILES NAMETBL$ FOR I=0 TO LAST(NAMETBL$) ?NAMETBL$[I] NEXT
・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success and 0 for failure.
If "//" is specified, the project list is acquired.
・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.
DIM NAMETBL$[] FILES "//", NAMETBL$ FOR I=0 TO LAST(NAMETBL$) ?NAMETBL$[I] NEXT
・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.
Only TXT can be specified as the file type
・If not specified, TXT is specified.
File name to read
Slot to read program: 0-3
・0, if not specified.
LOAD "PROGNAME" LOAD "SUBPROG",1
・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.
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.
File name to read
Graphic pages for storing read image data: 0 to 5
Destination coordinates for an image
・If not specified, 0,0 is specified.
The width and height of the loaded image data
LOADG "GRPDATA",1 LOADG "DAT:DATA",2,0,64 LOADG "GRPDATA",2 OUT W,H
・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.
DAT, TXT, GRP can be specified
・Cannot be omitted.
File name to read
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.
TX$=LOADV("TXT:MEMOFILE") DT=LOADV("DAT:DATAFILE")
・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.
DAT, GRP can be specified
・Cannot be omitted.
File name to read
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.
DIM MARRAY[] LOADV "DAT:MDATA",MARRAY
・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.
Only TXT can be specified
・If not specified, TXT is specified.
File name to give to the program to save
Slot number for programs to save: 0-3
・0, if not specified.
SAVE "TEST" SAVE "TEST2",2
・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.
Only GRP can be specified
・If not specified, GRP is specified.
Name to give the save file
Graphic pages to save: 0-5
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.
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.
SAVEG "GRP:GAZOU",0 SAVEG "GAZOU_ICHIBU",3,100,100,300,300
・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.
Only JPG can be specified
Name to give the save file
Graphic pages to save: 0-5
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.
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.
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.
SAVEG "JPG:GAZOU",0,80 SAVEG "JPG:GAZOU_ICHIBU",3,100,100,300,300
・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.
TXT, DAT, GRP can be specified
・Cannot be omitted.
Name to give to saved file
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.
SAVEV "TXT:MEMO",TX$ DIM MAP[10,10] SAVEV "DAT:MAP",MAP DIM IMG%[32,32] SAVEV "GRP:IMG",IMG%
The name of the current project
・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.
Only TXT can be specified
・If not specified, TXT is specified.
File name of program to be read
Slot to read program
・If not specified, the currently executing slot is specified.
EXEC "SAMPLE" EXEC "SBGED",1
・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.
Slot number of program to execute: 0-3
・The currently executing slot cannot be specified.
EXEC 2
File type to check
・If not specified, TXT is specified.
File name to check
Returns 1 if it exists, 0 if it does not exist
A=CHKFILE("SBATTACK") B=CHKFILE("GRP:SBATTACK")
・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.
The type of files you want to delete
・If not specified, TXT is specified.
File name to be deleted
DELETE "TEST" DELETE "GRP:PICTURE"
・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.
The type of file you want to rename
・If not specified, TXT is specified.
The name of the file you want to rename
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.
Destination file name
RENAME "TEST1","TEST2" RENAME "GRP:PICTURE1","PICTURE2"
・If you specify arguments, you can save some settings without resetting them.
If 1 is specified, the graphic page excluding the font page is saved without being cleared.
・0, if not specified.
If 1 is specified, it saves SPDEF contents.
・0, if not specified.
If 1 is speciified, it saves without clearing the font page.
・0, if not specified.
If 1 is specified, the content defined by ANIMDEF is saved without being cleared.
・0, if not specified.
'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
・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.
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.
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.
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.
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.
The width and height of the display (in pixels)
・The defined animation can be used with SPANIM and TANIM commands.
Animation definition number: 0 to 1023
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.
1D numeric array that stores animation data
Loop count: 1 or more
・Specify 0 to make an infinite loop.
・1, if not specified.
・Animation data is prepared in the following order in the numerical array (up to 32).
・Time1,Item1,[Item2,] Time2,Item1,[Item2,]...
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
・The defined animation can be used with SPANIM and TANIM commands.
Animation definition number: 0 to 1023
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.
The first label of the DATA command that stores the animation data
A string containing the label name can be specified instead of the label.
Loop count: 1 or more
・Specify 0 to make an infinite loop.
・1, if not specified.
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]
:
@MOVDATA DATA 2 'counter DATA -60,200,100 'frame,offset DATA -30,50,20 'frame,offset ANIMDEF 0,"XY",@MOVDATA
・The defined animation can be used with SPANIM and TANIM commands.
Animation definition number: 0 to 1023
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.
・Animation data itself (up to 32 as many as necessary).
Loop count: 1 or more
・Specify 0 to make an infinite loop.
・1, if not specified.
ANIMDEF 0,"XY",-60,200,100,-30,50,20
Animation definition number to clear: 0 to 1023
ANIMDEF 0
ANIMDEF
Background color code
Set background color code
・The effect is the same as covering the entire display with a sprite filled with a fade color.
Fade color code
・The greater the alpha component, the darker the color.
・Over time, change the fade color gradually from the current fade color to the specified color.
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.
Specify the fade effect time with the frame count
・If there is no processing loss, 60 is 1 second.
Current fade color
・You can also get the color during fade-in/fade-out.
1 if it's during fade-in/fade-out, 0 if not
ID of text screen to delete: 0 to 4
・4 is the default.
CLS CLS 1
・When this command is executed, the color of characters displayed in PRINT, TPRINT, INPUT, etc. will change.
Text screen ID to specify the drawing color: 0 to 4
・4 is the default.
Character drawing color
・ARGB 8-bit color code
・See GCOLOR for details on color codes
COLOR #C_WHITE COLOR 1,#C_RED COLOR RGB(128,192,64,64)
・Get the current character drawing color.
ID of text screen to obtain drawing color: 0 to 4
・4 is the default.
C=COLOR() C1=COLOR(1)
・When this command is executed, the display coordinates of characters to be displayed in PRINT, TPRINT, INPUT, etc. will change.
Text screen ID to specify display coordinates: 0 to 4
・4 is the default.
・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.
LOCATE 20,15 LOCATE ,10 LOCATE 1,10,0
・Get the current character display coordinates.
Text screen ID to specify display coordinates: 0 to 4
・4 is the default.
・Get the current character display coordinates.
LOCATE OUT X,Y LOCATE 1 OUT X1,Y1
・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.
・Variables to be displayed, string variables, numeric values, strings
No line break at the end of display
・Displays a blank character without a line break after display.
PRINT "RESULT(X,Y)=";DX*4+1,DY+1
・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.
ID of the screen that displays characters: 0 to 4
・Variables to be displayed, string variables, numeric values, strings
・Calculation formulas using arithmetic operations and functions can also be described (calculation results are displayed).
After display, it doesn't make a line break, and put the next display closely.
・After display, it doesn't make a line break, and open the next display at uniform space.
TPRINT 1,CHR$(&HEA01);CHR$(&HEA02);
・When this command is executed, the display attributes of characters displayed in PRINT, TPRINT, INPUT, etc. will change.
Text screen ID to specify character display attributes: 0 to 4
・4 is the default.
・Invert the displayed character left and right with 1.
・No inversion at 0.
・Invert the displayed characters up and down with 1.
・No inversion at 0.
・Rotate 0, 90, 180, and 270 degrees with 0, 1, 2, and 3, respectively.
・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) |
ATTR 0,0,1:PRINT "ABC" ATTR 2,8:TPRINT 2,"XYZ"
ID of the text screen that acquires the character display attribute: 0 to 4
・4 is the default.
・Invert the displayed character left and right with 1.
・No inversion at 0.
・Invert the displayed characters up and down with 1.
・No inversion at 0.
・Rotate 0, 90, 180, and 270 degrees with 0, 1, 2, and 3, respectively.
・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) |
ATTR OUT HREV,VREV,ROT A2=ATTR(2)
・Shift the contents of the text screen in units of characters.
・Characters pushed out of the screen as a result of scrolling disappear.
ID of scrolling text screen: 0-4
・4 is the default.
Number of scroll characters in horizontal direction
・Scroll left for positive values and right for negative values.
Number of scroll characters in the vertical direction
・Scroll up with positive values and down with negative values.
SCROLL 5,7 SCROLL 1,-1,0
ID of scrolling text screen: 0 to 4
・4 is the default.
Coordinates in character units
Character code of the character displayed at the specified coordinates
・If no character is displayed, zero is returned.
CODE=CHKCHR(0,0) CODE=CHKCHR(1,10,10)
ID of scrolling text screen: 0 to 4
・4 is the default.
Coordinates in character units
Character code of the character displayed at the specified coordinates
・If no character is displayed, zero is returned.
Display attribute set at specified coordinates
・See ATTR cmmand.
CHKCHR 0,0 OUT CH,AT CHKCHR 1,10,10 OUT CH,AT
ID of scrolling text screen: 0 to 4
Coordinate to check character code
・The meaning of coordinates changes depending on the value of the next coordinate conversion flag.
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.
Character code of the character displayed at the specified coordinates
・ If no character is displayed, zero is returned.
CODE = CHKCHR (1,10,10,0) CODE = CHKCHR (1,200,120,1)
ID of scrolling text screen: 0 to 4
Coordinate to check character code
・The meaning of coordinates changes depending on the value of the next coordinate conversion flag.
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.
Character code of the character displayed at the specified coordinates
・If no character is displayed, zero is returned.
Display attribute set at specified coordinates
・See ATTR command.
CHKCHR 1,10,10,0 OUT CH,AT CHKCHR 1,200,120,1 OUT CH,AT
・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.
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 that receives input (numeric or string variable)
・When specifying multiple variables, separate them with a comma.
INPUT "Input your name and age";NM$,AG
・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.
Guide message for input (optional)
String variable that receives one line of input
LINPUT "ADDRESS:";ADR$
・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.
・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) |
・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) |
C$=INKEY$() KBONLY$=INKEY$(1)
・The width and height are set by dividing the screen size by the character size.
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.
Character display size: 8 to 64
TSCREEN 8
ID of text screen to set: 0 to 4
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.
Character display size: 8 to 64
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.
TSCREEN 1,16,16,100,100
ID of text screen to delete: 0 to 4
・4 is the default.
Type of font used for display: 8 to 64
Character display size: 8 to 64
Text screen width and height
TSCREEN OUT FONT,SIZE,W,H TSCREEN 1 OUT FONT,SIZE,W,H
・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.
ID of text screen to set: 0 to 4
・4 is the default.
Reference graphic page: -1 to 5
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.
ID of the text screen to obtain reference information: 0 to 4
・4 is the default.
Graphic page to refer to
Reference origin coordinates in the graphic page
・COLOR sets the color in units of characters, whereas TCOLOR changes the overall color by multiplying the entire text screen by the specified color.
ID of text screen to set: 0 to 4
Drawing color to set
・8-bit color code for each ARGB
・See GCOLOR
ID of text screen to get color from: 0 to 4
Drawing color set for the specified text screen
ID of text screen to set: 0 to 4
ID of the layer to which the screen belongs: 0 to 7
ID of text screen to obtain layer ID: 0 to 4
Layer ID to which the screen belongs
Text screen ID for writing characters: 0 to 4
Coordinate to write character
Character code of characters to write: 0 to 65535
・If you specify a character code that does not have a font, x is displayed.
A string containing the character to write
・Write the first character.
Character display attribute
・Same display attributes as set by ATTR.
・If not specified, the display attribute set in ATTR is used.
Text screen ID for writing characters: 0 to 4
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.
Character code of characters to write: 0 to 65535
・If you specify a character code that does not have a font, x is displayed.
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.
Character display attribute
・Same display attributes as set by ATTR.
・If not specified, the display attribute set in ATTR is used.
TFILL 0,2,2,10,5,&HE810,#A_REVV TFILL 0,2,6,11,10,"ABC"
Home coordinates are used as the coordinate reference point of the TOFS command, TROT(Rotation) and TSCALE (scaling) center point
ID of text screen to set: 0 to 4
Home coordinate to be set
・Depending on the hardware specifications, setting a Real may cause the reference font image to shift by one pixel.
ID of text screen to obtain: 0 to 4
Home coordinate
・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".
ID of text screen to set: 0 to 4
Display coordinates to be set
・Depending on the hardware specifications, setting a Real may cause the reference font image to shift by one pixel.
Display priority: -4095 to 4095
・The smaller it is, the closer it is displayed.
ID of text screen to obtain: 0 to 4
Display coordinates
Display priority
・Rotate around the home position set in THOME.
ID of text screen to set: 0 to 4
Rotation angle (degree)
・Depending on the hardware specifications, the reference font image may be shifted by 1 pixel depending on the setting angle.
ID of text screen to obtain: 0 to 4
Rotation angle
・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).
ID of text screen to set: 0 to 4
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.
ID of text screen to obtain: 0 to 4
Current zoom ratio
Screen ID to display: 0 to 4
Screen ID to get: 0 to 4
Returns 1 if the text screen is displayed, otherwise 0.
Screen ID to hide display: 0 to 4
Screen ID to get: 0 to 4
Returns 0 if the text screen is displayed, otherwise 1.
Text screen ID to set the composition method: 0 to 4
Composition method to set: 0 to 1
・Normal composition with 0, additive composition with 1.
ID of the text screen to obtain the synthesis method: 0-4
Set synthesis method
・ Normal synthesis with 0, additive synthesis with 1.
・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.
ID of text screen to set animation: 0 to 4
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.
1D numeric array that stores animation data
Loop count: 1 or more
・Specify 0 to make an infinite loop.
・1, if not specified.
・Anime data is prepared in the following order in the numerical array (up to 32).
・Time1,Item1,[Item2,] Time2,Item1,[Item2,]...
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
ID of text screen to set animation: 0 to 4
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.
・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 count: 1 or more
・Specify 0 to make an infinite loop.
・1, if not specified.
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]
:
@MOVDATA DATA 2 'counter DATA -60,200,100 'frame,offset DATA -30,50,20 'frame,offset TANIM 0,"XY",@MOVDATA
ID of text screen to set animation: 0 to 4
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.
・Animation data itself (up to 32 as many as necessary).
Loop count: 1 or more
・Specify 0 to make an infinite loop.
・1, if not specified.
TANIM 0,"XY",-60,200,100,-30,50,20
ID of text screen to set animation: 0 to 4
Definition number already defined by ANIMDEF command: 0 to 1023
ANIMDEF 0,"XY",-60,100,0 TANIM 0,0
ID of text screen to clear animation: 0 to 4
・If not specified, clear all screen animations.
TANIM 0 TANIM
Target text screen ID: 0 to 4
・If not specified, animation of all text screens is stopped.
TSTOP
Target text screen ID: 0 to 4
・If not specified, start animation of all text screens.
TSTART
Target text screen ID: 0 to 4
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)
ST=TCHK(0) '|b00|#CHKXY| '|b01|#CHKZ| '|b02|#CHKR| '|b03|#CHKS| '|b04|#CHKC| '|b05|#CHKV|
・Cleared when program execution starts or ACLS is called.
Target text screen ID: 0 to 4
The name of the text screen variable
・A string or Int can be given as a name.
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.
TVAR 0,7,1 TVAR 0,"NAME","VALUE" TVAR 0,"NAME" 'Delete value
Target text screen ID: 0 to 4
The name of the text screen variable
・A string or Int can be given as a name.
Value set by TVAR
・If no value is set with TVAR, the Int 0 is returned.
V=TVAR(0,0)
Target screen ID: 0 to 4
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.
TVAR 0,7 TVAR 0,"NAME"
Copy destination text screen ID: 0 to 4
Copy source text screen ID: 0 to 4
・If not specified, the same screen as the copy destination screen is specified.
Source start and end coordinates
Start point coordinates of the copy destination
TCOPY 4,0,0,9,9,10,10 TCOPY 4,1,0,0,9,9,10,10
・Refer to TARRAY for the data structure in the array.
Text screen ID for retrieving character information: 0 to 4
Start point X, Y coordinate, width, height of the copy source range
・If not specified, the entire text screen is specified.
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.
DIM WORK%[] TSAVE 4,WORK%
・Refer to TARRAY for the data structure in the array.
Text screen ID for writing character information: 0 to 4
Start point X, Y coordinate, width, height of writing range
・If not specified, the entire text screen is specified.
Numeric array containing character information
DIM WORK%[] TLOAD 4,WORK%
・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.
ID of the target screen to get the array: 0 to 4
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.
T=TARRAY(0) T[0,0]=&HE810 PRINT HEX$(T[0,0])
・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.
ID of screen to reflect: 0 to 4
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
・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.
Target text screen ID: 0 to 4
Label of the processing destination to be called
The name of the user-defined command to be called
TFUNC 0,"@PROG" TFUNC 1,"USERDEF"
Clear text screen ID: 0 to 4
TFUNC 0
ID of scrolling text screen: 0 to 4
Coordinate to check character code
・The meaning of coordinates changes depending on the value of the next 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.
Coordinate value of conversion result
・The meaning of the coordinates returned depends on the mode value.
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
0 to 5 | GRP0 to GRP5 |
GTARGET 0
Drawing target page
WP=GTARGET()
・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_.
GCOLOR &HFF0A141E GCOLOR RGB(255,10,20,30) GCOLOR #C_BLUE
Graphic drawing color
C = GCOLOR()
Transparency: 0 to 255
・255 is the default.
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) |
Color code calculated from the argument
C1=RGB(0,100,200) C2=RGB(128,0,100,200)
Replacement source color code
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.
Color code calculated from the argument
C1=RGB(#C_RED, 127,,,) 'Translucent red C2=RGB(#C_BLUE,,255,,) 'Purple
ARGB 8-bit color code
・See GCOLOR for a description of color codes.
Variable that receives the transparency information of the specified color code
・Returns a value between 0 and 255.
Variable that receives the color component information of the specified color code
・Returns values between 0 and 255 respectively.
RGB C OUT R,G,B
Transparency: 0 to 1.0
・1.0 is the default.
Color elements: R, G, B each 0 to 1.0
Color code calculated from the argument
Replacement source color code
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.
Color code calculated from the argument
C1=RGBF(#C_RED, 0.5,,,) 'Translucent red C2=RGBF(#C_BLUE,,1.0,,) 'Purple
Color code to get the color component
・See GCOLOR for a description of color codes.
Variable that receives the transparency information of the specified color code
・Returns a value between 0 and 1.0
Variable that receives the color component information of the specified color code
・Returns values between 0 and 1.0 respectively.
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.
Color vividness (S): 0 to 255
・The smaller the number, the whitish.
Color brightness (V): 0 to 255
・0 indicates black and 255 indicates the brightest.
Transparency to be set in the return color code: 0 to 255
・255 is the default.
Color code equivalent to HSV value
GCLS HSV(100,100,100,100) FOR I=0 TO 360 GPSET I,10,HSV(I,255,255) NEXT
Color code to convert
・See GCOLOR for a description of color codes.
The hue of the specified color
・Returns a value between 0 and 360.
The saturation of the specified color
・Returns a value between 0 and 255.
The brightness of the specified color
・Returns a value between 0 and 255.
Transparency of the specified color
・Returns a value between 0 and 255.
HSV RGB(192,128,0) OUT H,S,V ?H,S,V
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.
Color vividness (S): 0 to 1
・The smaller the number, the whitish.
Color brightness (V): 0 to 1
・0 is black and 1 is the brightest.
Transparency to be set in the return color code: 0 to 1
・1 is the default.
Color code equivalent to HSV value
GCLS HSVF(0.4,0.4,0.4,0.4) FOR I=0 TO 360 GPSET I,10,HSVF(I/360,1,1) NEXT
Color code to convert
・See GCOLOR for a description of color codes.
The hue of the specified color
・Returns a value between 0 and 1.0.
The saturation of the specified color
・Returns a value between 0 and 1.0.
The brightness of the specified color
・Returns a value between 0 and 1.0.
Transparency of specified color
・Returns a value between 0 and 1.0.
HSVF RGB(192,128,0) OUT H,S,V ?H,S,V
・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.
The start point coordinates of the clipping area (both X and Y are 0 to 2047)
The end point coordinates of the clipping area (both X and Y are 0 to 2047)
GCLIP 100,100,200,200
The start point coordinates of the clipping region
The end point coordinates of the clipping region
GCLIP OUT LEFT,TOP,RIGHT,BOTTOM
・The range to be filled is the GCLIP setting range.
Color code used for filling
・See GCOLOR for a description of color codes.
・If not specified, it is filled with 0 (transparent color).
GCLS RGB(32,32,32)
The coordinates to get the color of
・If coordinates outside the graphic page range are specified, 0 is returned.
Pixel color code at specified coordinates
・See GCOLOR for a description of color codes.
C=GPGET(100,100)
Coordinates to hit the point
Point color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GPSET 100,50
Start point coordinates
End point coordinates
Line color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GLINE 0,0,399,239,RGB(0,255,255)
Center point coordinates
Circle radius (dot) 1 ~
Circle color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GCIRCLE 200,120,30
Center point coordinates
Circle radius (dot) 1 ~
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.
0 | Arc |
1 | Fan |
Arc color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GCIRCLE 200,120,30,0,45,1
Start point coordinates
End point coordinates
Rectangle color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GBOX 0,0,399,239
Start point coordinates
End point coordinates
Rectangle color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GFILL 0,0,399,239
・When the border color is not specified, the color range at the start point coordinates is painted.
Coordinates at which to start filling
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.
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.
GPAINT 200,120,RGB(255,0,0),RGB(0,0,0)
Default | Current Drawing Page |
0 to 5 | GRP0 to GRP5 |
Start point and end point coordinates of the copy source range
Start point coordinates of the copy destination range
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 |
GCOPY 0,0,0,100,100,200,100 ,1
Copy source graphic page: 0 to 5
Start point and end point coordinates of the copy source range
Start point coordinates of the copy destination range
Color code to multiply with the source pixel
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 |
GCOPY 0,0,0,100,100,200,100,#C_RED,1
Default | Current Drawing Page |
0 to 5 | GRP0 to GRP5 |
Start point X, Y coordinate, width, height of the copy source range
・If not specified, the current clipping area is used.
Array variable that stores the image
・If there are not enough elements in the array, it is automatically added only to the 1D array.
DIM WORK[0] GSAVE 0,0,0,512,512,WORK
Start point X, Y coordinate, width, height of the copy destination range
・If not specified, the current clipping area is used.
Numeric array that stores image data by GSAVE
Color code to multiply the image data in the image array
・If not specified, the image array is used as it is.
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 |
GLOAD 0,0,512,512,WORK,0 GLOAD WORK,#C_RED,0
Start point X, Y coordinate, width, height (dot) of the copy destination range
・If not specified, the current clipping area is used.
Numeric array containing images stored in indexed image format
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.
Color code to multiply the image data in the image array
・If not specified, the image array is used as it is.
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 |
GLOAD 0,0,512,512,WORK,PALETTE,0 GLOAD WORK,PALETTE,#C_BLUE,1
Vertex 1
Vertex 2
Vertex 3
Triangle color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GTRI 200,10,300,200,100,200
Display coordinates
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.
The type of font to reference: 8 or 16 can be specified.
・16 is the default.
Display magnification: 1 to 32767
・If not specified, 1,1 (the same size) is specified.
Text color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
GPUTCHR 10,10,"ABC" GPUTCHR 20,20,&H60
Display coordinates
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.
The type of font to reference: 8 or 16 can be specified.
・16 is the default.
Display magnification: 1 to 32767
・If not specified, 1,1 (the same size) is specified.
Text color to draw
・See GCOLOR for a description of color codes.
・If not specified, the color set in GCOLOR is used.
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.
Space between characters (in pixels): 0 to 64
・If not specified, it's 1.
GPUTCHRP 10,10,"ABC" GPUTCHRP 10,10,&H55
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.
The type of font to reference: 8 or 16 can be specified.
・16 is the default.
Display magnification: 1 to 32767
・If not specified, 1 (the same size) is specified.
Space between characters (in pixels): 0 to 64
・If not specified, it's 1.
The drawing width (pixels) when drawing with GPUTCHRP
W=GPUTCHRP("ABC") W2=GPUTCHRP(&H55,16,1,2)
・Graphic pages can be directly read and written as an Int type 2D array.
・Use GUPDATE to reflect the written results.
・Specify the target page to get the array.
0 to 5 | GRP0 to GRP5 |
An Int type 2D array representing the contents of the target page.
G=GARRAY(0) G[0,0]=#C_WHITE PRINT HEX$(G[100,100])
・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.
Graphic page to reflect
0 to 5 | GRP0 to GRP5 |
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.
G=GARRAY(0) G[0,0]=#C_WHITE GUPDATE 0
・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.
Graphic page to set: 0 to 5
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) |
Graphic page to retrieve settings: 0 to 5
Currently set sampling type
・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.
Sprite number to create: 0 to 4095
Definition number of template defined by SPDEF: 0 to 8191
Specify whether to display the created sprite
・Display with 1 and do not display with 0.
・1, if not specified.
SPSET 1,500
・Used when setting independently without using SPDEF value.
Sprite number to create: 0 to 4095
The coordinates on the graphic page of the referenced image
Sprite size: 0 to 2048
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.
Specify whether to display the created sprite
・Display with 1 and do not display with 0.
・1, if not specified.
SPSET 54,0,0,32,32,1,0
・Search for space in the entire sprite.
Definition number of the template defined by SPDEF: 0 to 8191
Specify whether to display the created sprite
・Display with 1 and do not display with 0.
・1, if not specified.
Generated sprite number: 0 to 4095
・When there is no space and cannot be generated, -1 is returned.
IX=SPSET(500)
・Search for space in the entire sprite.
The coordinates on the graphic page of the referenced image
Sprite size: 0 to 2048
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 |
Specify whether to display the created sprite
・Display with 1 and do not display with 0.
・1, if not specified.
Generated sprite number: 0 to 4095
・When there is no space and cannot be generated, -1 is returned.
IX=SPSET(0,0,32,32,1)
・Search for available space within the specified range.
Search range (0 to 4095)
・If the starting number is increased, the available numbers are searched in descending order.
Definition number of template defined by SPDEF: 0 to 8191
Specify whether to display the created sprite
・Display with 1 and do not display with 0.
・1, if not specified.
Generated sprite number: 0 to 4095
・When there is no space and cannot be generated, -1 is returned.
IX=SPSET(100,120, 500)
・ Search for available space within the specified range.
Search range (0 to 4095)
・If the starting number is increased, the available numbers are searched in descending order.
The coordinates on the graphic page of the referenced image
Sprite size: 0 to 2048
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 |
Specify whether to display the created sprite
・Display with 1 and do not display with 0.
・1, if not specified.
Generated sprite number: 0 to 4095
・When there is no space and cannot be generated, -1 is returned.
IX=SPSET(100,120, 0,0,32,32,1)
・Sprite for graphic page (4095) is not deleted.
SPCLR
・If you do not delete it after use, there will be no sprite space that can be specified with SPSET.
Sprite number to delete: 0 to 4095
SPCLR 56
Start number position of sprite range to delete: 0 to 4095
End number position of sprite range to delete: 0 to 4095
SPCLR 2,10
・Error when used before SPSET.
Sprite number to display: 0 to 4095
・Display with 1 and do not display with 0.
・1, if not specified.
SPSHOW 43 SPSHOW 44, #TRUE
・Error when used before SPSET.
Sprite number to check: 0 to 4095
Returns 1 if displayed, 0 if disappeared
S = SPSHOW(43)
・Just hiding the display, it does not delete the sprite.
・Error when used before SPSET.
Sprite number to hide display: 0 to 4095
・Display with 1 and do not display with 0.
・1, if not specified.
SPHIDE 43
・Error when used before SPSET.
Sprite number to check: 0 to 4095
Returns 0 if displayed, 1 if disappeared
H=SPHIDE(43)
・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.
Sprite number for setting the reference point: 0 to 4095
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.
SPHOME 34,16,16
・Error when used before SPSET.
Sprite number: 0 to 4095
Home coordinates
SPHOME 10 OUT HX,HY
・Error when used before SPSET.
Target sprite number: 0 to 4095
Display coordinates of sprite to be set
・Depending on the hardware specifications, setting a Real value may shift the reference image by one pixel.
Display priority: -4095 to 4095
・The smaller it is, the closer it is displayed.
SPOFS 23,50,80 SPOFS 23,,,1000 SPOFS 23,150,180,0
・Error when used before SPSET.
Target sprite number: 0 to 4095
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.
Sprite coordinates
Display priority
SPOFS 12 OUT X,Y,Z
・Error when used before SPSET.
Target sprite number: 0 to 4095
Rotation angle: 0 to 360 (clockwise)
・Depending on the hardware specifications, the reference image may be shifted by 1 pixel depending on the angle.
SPROT 23,45
・Error when used before SPSET.
Target sprite number: 0 to 4095
Sprite angle
DR=SPROT(23)
・SPCOL is executed first for the collision detection considering the scale.
・Error when used before SPSET.
Target sprite number: 0 to 4095
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.
SPSCALE 56,0.75, 0.75
・Error when used before SPSET.
Target sprite number: 0 to 4095
Sprite magnification
SPSCALE 45 OUT SX,SY
・Error when used before SPSET.
Target sprite number: 0 to 4095
・The actual display color is the value obtained by multiplying the original pixel color by the color code.
SPCOLOR 1,RGB(16, 255,0,0) 'A=16,R=255,G=0,B=0
・Error when used before SPSET.
Target sprite number: 0 to 4095
Color code set for sprite
C=SPCOLOR(1)
・Error when used before SPSET.
Sprite number whose definition is to be changed: 0 to 4095
Template number registered with SPDEF command: 0 to 8191
SPCHR 0,500
・Arguments other than the sprite number can be omitted.
・Error when used before SPSET.
Target sprite number: 0 to 4095
The coordinates on the graphic page of the referenced image
Sprite size: 0 to 2048
・If not specified, both W and H are 16.
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.
SPCHR 5,64,64,16,16,0 SPCHR 6,,,32,32,1 'UV skip
・Error when used before SPSET.
Target sprite number: 0 to 4095
The coordinates on the graphic page of the referenced image
Sprite image size
Sprite attributes
SPCHR 5 OUT U,V,W,H,ATR
・Error when used before SPSET.
Target sprite number: 0 to 4095
Character definition number of the specified sprite
DEFNO=SPCHR(5)
Target sprite number: 0 to 4095
-1 to 5
・The default sprite page is 4.
SPPAGE 100, 3
Target sprite number: 0 to 4095
Graphic page number: -1 to 5
P=SPPAGE(100)
-1 to 5 (GRP-1 to GRP5)
The initial sprite page is 4 (GRP4)
SPPAGE 3
Graphic page number: -1 to 5
P=SPPAGE()
Target sprite number: 0 to 4095
ID of the layer to which the sprite belongs: 0 to 7
SPLAYER 100,3
Target sprite number: 0 to 4095
Layer ID
P=SPLAYER(100)
0 to 7
・The initial layer ID is 0.
SPLAYER 3
Layer ID
P=SPLAYER()
Template definition number: 0 to 8191
The coordinates on the graphic page of the referenced image
Sprite size
・If not specified, both W and H are 16.
Sprite coordinate reference point
・If not specified, X and Y are 0.
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.
SPDEF 0,192,352,32,32,16,16,1
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.
Specify the definition start number: 0 to 8191
It is added for the definition position adjustment of the image (each 0 to 4095)
SPDEF SRCDATA SPDEF SRCDATA 256,0,256
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.
Specify the definition start number: 0 to 8191
It is added for the definition position adjustment of the image (each 0 to 4095)
SPDEF "@SRCDATA" SPDEF "@SRCDATA",256,0,256
Template definition number: 0 to 8191
The coordinates on the graphic page of the referenced image
Sprite definition image size
Reference point coordinates of sprite definition
Sprite definition attributes
SPDEF 2 OUT U,V,ATR
・Elements that do not need to be copied can be omitted (separator ',' comma is required).
・The argument part is used for adjustment after copying.
Template definition number: 0 to 8191
Definition number that becomes the copy source: 0 to 8191
The coordinates on the graphic page of the referenced image
The size of the sprite to define
・If not specified, both W and H are 16.
Sprite coordinate reference point
・If not specified, X and Y are 0.
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.
SPDEF 0,255,192,352,32,32,16,16,1 SPDEF 1,255,,,32,32,,,
SPDEF
・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.
Link source (child) sprite number: 0 to 4095
Link (parent) sprite number: 0 to 4095
・An error occurs if the descendant of the link source is specified.
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 |
SPLINK 15,4 SPLINK 2,0,3
・Error when used before SPSET.
Link source (child) sprite number: 0 to 4095
Type of link destination and link flag to be obtained.
0 | Parent |
1 | Child |
2 | Brother |
3 | LinkFlag |
・Default is 0.
Link number: 0 to 4095 (No link when -1)
'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
・Error when used before SPSET.
Sprite number to release link: 0 to 4095
SPUNLINK 15
・Error when used before SPSET.
・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).
Sprite number for setting animation: 0 to 4095
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.
1D numeric array that stores animation data
Loop count: (1 or more)
・If 0 is specified, an infinite loop is created.
・1, if not specified.
・Anime data is prepared in the following order in the numerical array (up to 32).
・Time1, Item1,[Item2,] Time2,Item1,[Item2,]...
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
・Error when used before SPSET.
Sprite number for setting animation: 0 to 4095
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.
・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 count: (1 or more)
・If 0 is specified, an infinite loop is created.
・1, if not specified.
Anime data is prepared in the following order in the DATA command
DATA NumberOfKeyFrames(UpTo32)
DATA Time1,Item1[,Item2]
DATA Time2,Item1[,Item 2]
:
@MOVDATA DATA 2 'counter DATA -60,200,100 'frame,offset DATA -30,50,20 'frame,offset SPSET 0,0 SPANIM 0,"XY",@MOVDATA
・Error when used before SPSET.
Sprite number for setting animation: 0 to 4095
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.
・Animation data itself (up to 32 as many as necessary).
Loop count: (1 or more)
・If 0 is specified, an infinite loop is created.
・1, if not specified.
SPSET 0,0 SPANIM 0,"XY",-60,200,100,-30,50,20
・Animation definitions defined with ANIMDEF can be specified.
・Error when used before SPSET.
Sprite number for setting animation: 0 to 4095
Definition number already defined by ANIMDEF command: 0 to 1023
ANIMDEF 0,"XY",-60,100,0 SPSET 0,0 SPANIM 0,0
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.
SPANIM 0 SPANIM
・Error when used before SPSET.
Target sprite number: 0 to 4095
・If not specified, all sprite animations are stopped.
SPSTOP
・An error if used before SPSET.
Target sprite number: 0 to 4095
・If not specified, start animation of all sprites.
SPSTART
・Error when used before SPSET.
Target sprite number: 0 to 4095
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)
ST=SPCHK(5) '|b00|#CHKXY| '|b01|#CHKZ| '|b02|#CHKR| '|b03|#CHKS| '|b04|#CHKC| '|b05|#CHKV| '|b06|#CHKUV| '|b07|#CHKI|
・All sprites have special variables called sprite variables.
・Sprite variables are cleared when program execution starts or when SPSET or SPCLR is called.
Target sprite number: 0 to 4095
The name of the sprite variable
・A string or Int can be given as a name.
Value to be registered in internal variable
・Numerical values or strings can be registered.
SPVAR 0,7,1 SPVAR 0,"NAME","VALUE"
Target sprite number: 0 to 4095
The name of the sprite variable: string or Int can be named.
Value registered with SPVAR
If no value is registered with SPVAR, the Int 0 is returned.
V=SPVAR(54,0)
Target sprite number: 0 to 4095
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.
SPVAR 0,7 SPVAR 0,"NAME"
・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.
Target sprite number: 0 to 4095
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.
SPCOL 3,1
・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.
Target sprite number: 0 to 4095
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.
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.
SPCOL 3,1,31 SPCOL 3,,31
・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.
Target sprite number: 0 to 4095
・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).
Detection area width and height: W, H (1 to 65535)
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.
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.
SPCOL 3,0,0,32,32,1,255 SPCOL 3,0,0,32,32,,255
・Error when used before SPSET.
Target sprite number: 0 to 4095
Scale support flag set in sprite
Collision mask value set for sprite
SPCOL 3 OUT SC,MSK
・Error when used before SPSET.
Target sprite number: 0 to 4095
Collision detection area start point coordinates
Collision detection area width and height
Scale support flag set in sprite
Collision detection mask value
SPCOL 3 OUT X,Y,W,H,SC,MSK
・Error when used before SPSET.
Target sprite number: 0 to 4095
・If not specified, it is automatically calculated as follows.
・Running SPANIM XY with linear interpolation: distance moved from the previous frame.
・Otherwise: 0,0
SPCOLVEC 93
・Call SPCOL in advance.
Sprite number to judge: 0 to 4095
Sprite range to detect (0 to 4095)
Collision sprite number (-1 if no collision)
H=SPHITSP(0)
・Call SPCOL in advance.
Sprite number to detect: 0 to 4095
Opponent sprite number: 0 to 4095
0=No Collision, 1=Collision
H=SPHITSP(0,34)
・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.
Collision sprite number (-1 if no collision)
H=SPHITSP(0) WHILE H>=0 H=SPHITSP() WEND
・Call SPCOL in advance.
Upper left coordinate of the rectangle to be detected
Width and height of the source rectangle
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.
Movement amount of the rectangle of the detecting source
Collision sprite number (-1 if no collision)
H=SPHITRC(0,0,16,16)
・Call SPCOL in advance.
Collision opponent sprite number: 0 to 4095
Upper left coordinate of the rectangle to be detected
Width and height of the source rectangle
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.
Movement amount of the rectangle of the detecting source
0=No Collision, 1=Collision
H=SPHITRC(1,0,0,16,16)
・Call SPCOL in advance.
Sprite range to detect (0 to 4095)
Upper left coordinate of the rectangle to be detected
Width and height of the detecting rectangle
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.
Movement amount of the rectangle of the detecting source
Collision sprite number (-1 if no collision)
H=SPHITRC(0,0,16,16)
・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.
Collision sprite number (-1 if no collision)
H=SPHITRC(0,0,16,16) WHILE (H >= 0) H=SPHITRC() WEND
・Collision time: Real between 0 and 1
・Coordinates at the time of detection + velocity x collision time coincides with the collision coordinates.
TM=SPHITINFO()
・Collision time: Real between 0 and 1
・Coordinates at the time of detection + velocity x collision time coincides with the collision coordinates.
Coordinate of object 1 at the time of collision
Coordinate of object 2 at the time of collision
SPHITINFO OUT TM,X1,Y1,X2,Y2
・Collision time: Real between 0 and 1
・Coordinates at the time of detection + velocity x collision time coincides with the collision coordinates.
Coordinate of object 1 at the time of collision
Object 1 velocity at impact
Coordinate of object 2 at the time of collision
Object 2 velocity at impact
SPHITINFO OUT TM,X1,Y1,VX1,VY1,X2,Y2,VX2,VY2
・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.
Target sprite number: 0 to 4095
Label of the processing destination to be called
The name of the user-defined command to be called
SPFUNC 0,"@PROG" SPFUNC 1,"USERDEF"
Sprite number to clear: 0 to 4095
SPFUNC 0
Target sprite number: 0 to 4095
0=Free, 1=in use
S=SPUSED(4)
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 value: -32768 to 32767 (semitones by 100)
・0, if not specified.
Playback volume: 0 to 127
・64 is the default.
Panpot: 0 (left) to 64 (center) to 127 (right)
・64 is the default.
BEEP 3
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 value: -32768 to 32767 (semitones by 100)
・0, if not specified.
Playback volume: 0 to 127
・64 is the default.
Panpot: 0 (left) to 64 (center) to 127 (right)
・64 is the default.
Handle to operate stop/volume/pitch/panpot after pronunciation: 0 to 15
H=BEEP(152)
Handle obtained by executing the BEEP command
Value of panpot to change: 0 (left) to 64 (center) to 127 (right)
H=BEEP(152) WAIT 60 BEEPPAN H,0
Handle obtained by executing the BEEP command
Value of pitch to change: -32768 to 32767
・Semitones by 100.
H=BEEP(152) WAIT 60 BEEPPIT H,1200
Handle obtained by executing the BEEP command
・If not specified, all sound effects are stopped.
Specify in seconds
・Real can be specified.
・Stop immediately with 0.
・0, if not specified.
BEEPSTOP H=BEEP(152) WAIT 60 BEEPSTOP H
Handle obtained by executing the BEEP command
Volume value to change: 0 to 127
H=BEEP(152) WAIT 60 BEEPVOL H,16
Music number: 128 to 255
・If not specified, all definitions are deleted.
BGMCLEAR
・Use BGMPAUSE to pause.
Track number to play: 0 to 15
・If not specified, all tracks are restarted.
Specify in seconds
・Real can be specified.
・Restart immediately with 0.
・0, if not specified.
BGMCONT
Target track number: 0 to 15
・If not specified, all tracks are the default.
Changing pitch value: -32768 to 32767
・Semitones by 100
BGMPITCH 0,100
Track number to play: 0 to 15
・0, if not specified.
・Preset sound source (0 to 73)
・User-defined (128 to 255)
・Playback volume: 0 to 127
・Fade-in time: 0 to 32767 seconds
BGMPLAY 128
・Playback by MML is performed on track 0.
・User-defined music number 255 is rewritten as an MML music.
Command string
BGMPLAY "T120O4L4CC8D8EE8F8GA8G8E2"
・Use BGMCONT to resume.
Track number to play: 0 to 15
・If not specified, all tracks are stopped.
Specify in seconds
・Real can be specified.
・Immediate stop with 0.
・0, if not specified.
BGMPAUSE
・The defined music can be played on BGMPLAY.
User-defined music number: 128 to 255
Command string
BGMSET 128,"CDEFG"
・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.
User-defined music number: 128 to 255
Label or label string with MML string registered in DATA
BGMSETD 128,"@MMLTOP"
Target track number: 0 to 15
・If not specified, all tracks are stopped.
Specify in seconds
・Real can be specified.
・Immediate stop with 0.
・0, if not specified.
BGMSTOP
Track number: 0 to 15
Variable number to set/get value: 0 to 7
The acquired variable value
BGMVAR 0,1,2 V=BGMVAR(0,1)
Track number to play: 0 to 15
・0, if not specified.
Volume to set: 0 to 127
BGMVOL 0,64
・Volume changes when effector is off. Use with the effector turned on.
Track number to set: 0 to 15
・0, if not specified.
Effector level to be set: 0 (dry) to 127 (wet)
BGMWET 0,64
0 | #EFCOFF | OFF |
1 | #EFCON | ON |
0: OFF
1: ON
EFCEN 0 S=EFCEN()
0 | #EFCOFF | OFF |
1 | #EFCBATH | Bath |
2 | #EFCCAVE | Cave |
3 | #EFCSPACE | Space |
EFCSET #EFCSPACE
0 | #EFCREFSROOM | Small Room |
1 | #EFCREFLROOM | Large Room |
2 | #EFCREFHALL | Hall |
3 | #EFCREFCAVE | Cave |
4 | #EFCREFNONE | No Reflections |
Reflected sound volume: 0.0 to 1.0
Time for reflected sound to decay: 0 to 300 (milliseconds)
0 | #EFCREVROOM | Room |
1 | #EFCREVHALL | Hall |
2 | #EFCREVMETAL | Metallic Corridor |
3 | #EFCREVCAVE | Cave |
4 | #EFCREVREV | Reverb |
Reverberation volume: 0.0-1.0
Reverberation decay time: 100-20000 (milliseconds)
Decay rate of reverberant treble: 0.1 to 1.0 (the lower the value, the faster the treble is attenuated)
Reverberant tone parameters: 0.0 to 1.0
Effector input volume: 0.0 to 1.0
EFCSET #EFCREFSROOM,1,100,#EFCREVROOM,1,20000,1,0.01,0.5
・Volume changes when effector is off. Use with the effector turned on.
Effect on BEEP: 0 (dry) to 127 (wet)
Effect on BGMPLAY: 0 (dry) to 127 (wet)
Effect on TALK: 0 (dry) to 127 (wet)
Effect on PCMSTREAM: 0 (dry) to 127 (wet)
EFCWET 64,64,64,64 EFCWET 0,0,127,0
PCMCONT
・Set which array index will be used for the next time PCM data is sent at regular intervals.
The index of the array specified by PCMSTREAM
PCMPOS 1024
-Returns the array index from which the next transmission of PCM data, which is performed at regular intervals, will be performed.
The index of the array specified by PCMSTREAM
PCMPOS OUT P
PCMSTOP
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.
Sampling frequency (Hz) of data to be reproduced: 1 to 192000
・The default is 48000.
DIM PCMDATA[2,48000] PCMSTREAM PCMDATA,48000
An array containing PCM data on the left side of stereo audio.
Arrays are treated as ring buffers and can be rewritten while playing.
An array containing PCM data on the right side of stereo audio.
Arrays are treated as ring buffers and can be rewritten while playing.
Sampling frequency (Hz) of data to be reproduced: 1 to 192000
・The default is 48000.
DIM PCML[48000],PCMR[48000] PCMSTREAM PCML,PCMR,48000
Specify the channel to set the volume
0 | #PVLEFT | Left |
1 | #PVRIGHT | Right |
Volume to set: -32767 to 32767 (Specifying a negative value reverses the phase.)
Number of output samples until the set volume is reached
・0, if not specified.
PCMVOL 0,0,48000
Specify the channel to set the volume
0 | #PVLEFT | Left |
1 | #PVRIGHT | Right |
・If not specified, it's both.
Volume to set: -32767 to 32767 (Specifying a negative value reverses the phase.)
PCMVOL 16384
Current left channel or monaural volume: -32767 to 32767
Current right channel volume: -32767 to 32767
PCMVOL OUT L,R
Recording complete/stop=0, Recording = 1
RECSTART 10 WHILE RECCHK():WEND
0 to RECLEN()-1
Left channel sample value
Right channel sample value
RECSTART 10 WHILE RECCHK():WEND FOR I=0 TO RECLEN()-1 RECDATA I OUT L,R NEXT
Buffer sample count
RECSTART 10 ? RECLEN() '480000
Sample position
RECSTART 10 WHILE RECCHK() ? RECPOS WEND
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.
Number of samples to be taken
・If not specified, it's the same value as RECPOS().
Top position to take out sample
・0, if not specified.
RECSTART 5 BGMPLAY 3 WHILE RECCHK():WEND BGMSTOP DIM BUF[2,1] RECSAVE BUF WAIT 60 PCMSTREAM BUF,48000 INPUT A$
・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.
Number of seconds to record: 0.1 to 60
RECSTART 5 BGMPLAY 3 WHILE RECCHK():WEND BGMSTOP DIM BUF[2,1] RECSAVE BUF WAIT 60 PCMSTREAM BUF,48000 INPUT A$
・Record at sampling frequency of 48KHz (no time limit).
・The buffer is prepared for 5 seconds.
・Use RECSTOP to stop recording.
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
RECSTART 10 WAIT 60*5 RECSTOP
・It can only be set within subprograms.
Balance to be set: 0 (sub side only) to 64 (main/sub equal) to 127 (main side only)
Time to reach the set balance: 0 to 32767 (seconds)
SNDMSBAL 0,3.5
Current balance
SNDMSBAL OUT B
・Settings from subprograms are ignored.
Volume to be set: 0 to 127
Time to reach the set volume: 0 to 32767 (seconds)
SNDMVOL 0,1.5
Current volume (changes within the specified time if it's fading)
V=SNDMVOL()
'BGM/BEEP/TALK SNDSTOP
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)
<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
TALK "<S128>Konnichiwa. Watashiha, PetitCom4 desu." TALK "$<S128>koqnichiwa######watashiwa##puchikoqfoodesu"
TALKSTOP
Instrument number for setting the waveform: 224 to 255
Time to increase the volume to maximum: 0 to 127 (faster as the value increases)
Time until the volume decreases from the maximum value to become constant: 0 to 127 (faster as the value increases)
Volume when extending the sound: 0 to 127 (louder as the value increases)
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.
"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
Specify the note number of the pitch of the defined waveform.
・The default is 69 ("O4A": A of octave 4).
WAVSET 224,127,0,0,127,"FF00"*8,69 BGMPLAY "@224O4A1"
・Version 3 compatibility mode
・Depending on sample length and reference pitch, correct pitch may not be produced.
Instrument number for setting the waveform: 224 to 255
Time to increase the volume to maximum: 0 to 127 (faster as the value increases)
Time until the volume decreases from the maximum value and becomes constant: 0 to 127 (faster as the value increases)
Volume when extending the sound: 0 to 127 (louder as the value increases)
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.
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)
Specify the note number of the pitch of the defined waveform.
・The default is 69 ("O4A": A of octave 4).
Specify the index of the top position of the waveform.
・0, if not specified.
Specify the index of the end position of the waveform.
・If not specified, it'll be the end of the array.
DIM W[2048] WAVSETA 224,127,0,0,127,W,69,0,2047 BGMPLAY "@224O4A1"
・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.
Instrument number for setting the waveform: 224 to 255
Time to increase the volume to maximum: 0 to 127 (faster as the value increases)
Time until the volume decreases from the maximum value and becomes constant: 0 to 127 (faster as the value increases)
Volume when extending the sound: 0 to 127 (louder as the value increases)
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.
A 1D array containing waveforms
・One element is treated as one signed 16-bit sample.
The note number of the pitch of the defined waveform
・The default is 69 ("O4A": A of octave 4).
The index of the top position of the loop of the waveform (with offset)
・0, if not specifiied.
The index of the loop end position of the waveform (with offset)
・If not specified, it'll be the end of the array.
Waveform sample frequency (in Hz): 1 to 96000
・The default is 28160.
The index of the reference start position of the array
・0, if not specified.
Specify whether to loop when playing waveform in BEEP
・0, if not specified (does not loop).
DIM W[2048] WAVSETA 224,127,0,0,127,W,69,1024,2047,44100,0,#false BGMPLAY "@224O4A1"
Number of the track whose playback status is to be acquired: 0 to 15
・0, if not specified.
0: Not Playing
1: Playing
R=BGMCHK(1) PRINT R
Command string
-1: Normal
0: Error (string position that caused an interpretation error)
R=CHKMML("T120O4L4CC8D8EE8F8GA8G8E2") PRINT R
FALSE=Stopped, TRUE=Playing
RET=TALKCHK()
・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
・Program slot to operate: 0-5
・An error will occur if the currently executing slot is specified.
・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.
PRGEDIT 0
・When used in function format, it returns the line number.
・An error occurs if source code operation is not started with PRGEDIT first.
・Program slot in operation
・Source code line number in operation
PRGEDIT OUT SLOT,LINE LINE=PRGEDIT()
・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.
・The source string of the current line (empty string if out of range)
A$=PRGGET$()
1 | Move Down One Line |
-1 | Move Up One Line |
・If not specified, it's 1.
・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.
R=PRGSEEK(1)
・If PRGGET$ returns an empty string, add a line.
The string that replaces the current line
PRGSET "'Comment"
・Insert multiple lines of string including line feed code CHR$(10).
・The source string to insert
1 | Insert After Current Line |
0 | Insert Before Current Line |
・If not specified, it's 0.
PRGINS "PRINT "+CHR$(34)+"HELLO"+CHR$(34)
Number of lines to delete
・When a negative value is entered, all of them are deleted.
・If not specified, it's 1.
PRGDEL
Program slot for acquiring the number of rows: 0-5
・If not specified, the currently executing program slot is specified.
0 | Number of Lines (default) |
1 | Number of Characters |
2 | Number of Empty Characters |
Value according to type
A=PRGSIZE(0)
・The specified file name by the LOAD/SAVE command is returned.
Program slot for acquiring file name: 0-5
・If not specified, the currently executing program slot is specified.
File name of the program loaded in the specified program slot
PRINT PRGNAME$(0)
・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.
Array that stores the results of applying the filter
Array containing the signals to which the filter is applied
Array containing filter coefficient
・The number of elements in the array must be 13 or more.
DIM OD[2,1000],ID[2,1000],FP[13] BQPARAM FP,#BQLPF,48000,8000,1/SQR(2) BIQUAD OD,ID,FP
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.
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 |
Sampling frequency of input signal
・0 is an error.
Filter cutoff frequency
Handle filter types, BPF/BSF/PEQ as bandwidth (unit: octave), and otherwise, QValue as smoothness of filter characteristics.
・0 is an error.
Amplification factor of filter (unit: db). The descriptions must be needed when the filter types, #BQLSF, #BQHSF and #BQPEQ, are used.
DIM OD[1000],ID[1000],FP[13] BQPARAM FP,#BQLSF,48000,8000,1/SQR(2),3.0 BIQUAD OD,ID,FP
・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.
Complex array of real and imaginary parts containing the result of the operation
Complex array of real and imaginary parts to operate on
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.
DIM iR[1024],iI[1024],WF[1024] DIM oR[1024],oI[1024] FFTWFN WF,3 FFT oR,oI,iR,iI,WF
・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.
Complex array of real and imaginary parts containing the result of the operation
Complex array of real and imaginary parts to operate on
DIM iR[1024],iI[1024] DIM oR[1024],oI[1024] IFFT oR,oI,iR,iI
Array containing the window function values
0 | #WFRECT | Rectangular Window |
1 | #WFHAMM | Humming Window |
2 | #WFHANN | Hanning Window |
3 | #WFBLKM | Blackman Window |
DIM WF[1024] FFTWFN WF,#WFHAMM
・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.
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) |
Numeric array for storing operation results
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.
・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.
Display offset on the main display of the sub display: -32768 to 32767
Display size of the sub display
・Width: 1 to 1280
・Height: 1 to 720
・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.
Specify 0 for the argument to turn off the indication.
・This command has meaning only within subprograms. When used from the main program or direct mode, 0,0 is returned.
Display offset on the main display of the sub display
Display size of the sub display
・This command has meaning only within subprograms. Nothing happens when used from the main program or direct mode.
Main interpreter status to be set
・Only 0 can be specified.
・It is not set when the current status is 3 or 4.
0 | Waiting in Direct Mode |
1 | Execution Suspended |
2 | Execution Stopped Due to Error |
3 | Running Program |
4 | Editing Program |
0 | Waiting in Direct Mode |
1 | Execution Suspended |
2 | Execution Stopped Due to Error |
3 | Running Program |
4 | Editing Program |
Current execution slot
Current edit slot
0 | Waiting in Direct Mode |
1 | Execution Suspended |
2 | Execution Stopped Due to Error |
3 | Running Program |
4 | Editing Program |
If an error has occurred, a value other than 0 is returned.
If the argument that occurred when the error occurred is known, a positive value is returned.
If an error has occurred, the program slot that occurred is returned.
If an error has occurred, the character position from the beginning of the generated source code is returned.
If an error has occurred, the line number in the source code that occurred is returned.
・This command is valid only in the sub interpreter.
Specify 0 when copying a program slot
Program slot ot the copy source main interpreter
Program slot of the copy destination sub interpreter
・This command is valid only in the sub interpreter.
Specify 1 when copying graphic page
Graphic page of the copy source main interpreter
Graphic page of the copy destination sub interpreter
・This command is valid only in the sub interpreter.
Specify 2 when copying SPDEF definitions
SPDEF definition number of the copy source main interpreter
SPDEF definition number of the copy destination sub interpreter
Specify 1 when copying graphic page
Graphic page of the copy source sub interpreter
Graphic page of the copy destination main interpreter
Specify 2 when copying SPDEF definition
SPDEF definition number of the copy source sub interpreter
SPDEF definition number of the copy destination main interpreter
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.
Content string of input line or specified input history
Interpreter type
0 | Main Interpreter |
1 | Sub Interpreter |
2 | UI Interpreter |
Parameter set at startup
・Programs that can be created by the user always return -1.
1 to get focus, 0 to transfer focus
Whether it has focus
・If it has, it returns 1. If it does not, it's 0.
Input string
・Maximum 64 characters
・Command for internal use only. Do not use.
String of command name at the cursor position
・If there is no command name, "DEFAULTHELPKEY" is returned.
An array that returns the number of rows
・The number of elements in the array is the number of pages.
・Command for internal use only. Do not use.
String of command name to get
An array that returns the number of rows
・The number of elements in the array is the number of pages.
・Command for internal use only. Do not use.
String of command name to get
Page number to get
Line number to get
Each value is a string of one line
・The array size is the number of lines.
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 |
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.
Code example string