Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Latest commit

 

History

History
167 lines (153 loc) · 7.71 KB

Constants.org

File metadata and controls

167 lines (153 loc) · 7.71 KB

Top | < Previous (Errors) | Next (PAGE NAME) >

Constants

This is a list of constants available in SmileBASIC as of version 3.6.0.

Console Text Color

Constants for the console text color. To be used in conjuction with COLOR.

Constant NameColorValue
#TBLACKBlack1
#TBLUEBlue9
#TCYANCyan13
#TGRAYGray14
#TLIMELime5
#TMAGENTAMagenta11
#TMAROONMaroon2
#TNAVYNavy Blue8
#TOLIVEOlive6
#TPURPLEPurple10
#TREDRed3
#TTEALTeal12
#TWHITEWhite15
#TYELLOWYellow7

Graphics Color

These are constants for onscreen graphics for SmileBASIC. These can be explicitly set in methods like GCOLOR.

Constant NameColorRGB ValueReal Value
#AQUAAquaRGB(0, 248, 248)-16713480
#BLACKBlackRGB(0, 0, 0)-16777216
#BLUEBlueRGB(0, 0, 248)-16776968
#CYANCyanRGB(0, 248, 248)-16713480
#FUCHSIAFuchsiaRGB(248, 0, 248)-524040
#GRAYGrayRGB(128, 128, 128)-8355712
#GREENGreenRGB(0, 128, 0)-1674448
#LIMELimeRGB(0, 248, 0)-16713728
#MAGENTAMagentaRGB(248, 0, 248)-524040
#MAROONMaroonRGB(128, 0, 0)-8388608
#NAVYNavy blueRGB(0, 0, 128)-16777088
#OLIVEOliveRGB(128, 128, 0)-8355840
#PURPLEPurpleRGB(128, 0, 128)-8388480
#REDRedRGB(248, 0, 0)-524288
#SILVERSilverRGB(192, 192, 192)-4144960
#TEALTealRGB(0, 128, 128)-16744320
#WHITEWhiteRGB(248, 248, 248)-460552
#YELLOWYellowRGB(248, 248, 0)-460800

Button IDs

When getting values from BUTTON(), these constants can be used to easily identify the IDs of the buttons.

VAR X% = BUTTON()
' Detect if the A button is currently being pushed down using #A.
IF X% AND #A THEN PRINT "A button is being pushed down."
Constant NameButtonValue
#AA16
#BB32
#XX64
#YY128
#LL256
#RR512
#UPUp on D-pad1
#DOWNDown on D-pad2
#LEFTLeft on D-pad4
#RIGHTRight on D-pad8
#ZLZL on Circle-Pad Pro or new 3DS4096
#ZRZR on Circle-Pad Pro or new 3DS2048

Background Tiles Attributes

When setting a tiles in backgrounds, attributes can be applied to the tiles to have them appear differently. Is used by adding them to tile IDs.

' Place a background tile that is horizontally flipped and is rotated 90 degrees using constants.
BGPUT 0, 0, 0, 13 + #BGREVH + #BGROT90
Constant NameAttribute DescriptionValue
#BGREVHHorizontal flip16384
#BGREVVVertical flip32768
#BGROT00 degree rotation0
#BGROT9090 degree rotation4096
#BGROT180180 degree rotation8192
#BGROT270270 degree rotation12288

Sprite Character Attributes

When setting the character for sprites, attributes can be applied to sprites to have them appear differently. Typically used with SPCHR.

' Use constants to define a sprite that is displayed and is flipped horizontally
SPCHR 0, 0, 0, 16, 16, #SPSHOW + #SPREVH
Constant NameAttribute DescriptionValue
#SPREVHHorizontal flip8
#SPREVVVertical flip16
#SPROT00 degree rotation0
#SPROT9090 degree rotation2
#SPROT180180 degree rotation4
#SPROT270270 degree rotation6
#SPSHOWDisplay the sprite1

Sprite Animation Checks

These can be used to identify what types of animations are happening for a certain sprite with SPCHK.

Constant NameAnimation TypeValue
#CHKXYXY-coordinates1
#CHKZZ-coordinates2
#CHKUVUV-coordinates4
#CHKIDefinition number8
#CHKRRotation16
#CHKSMagnification XY32
#CHKCDisplay color64
#CHKVVariable128

ARYOP Operations

Requires Sound Processing DLC

These are constants that state the type of operation to be done with ARYOP.

' Use #AOPMUL constant to define doing multiplication between the arrays.
ARYOP #AOPMUL, OW, P1, P2
Constant NameOperation TypeValue
#AOPADDAddition0
#AOPSUBSubtraction1
#AOPMULMultiplication2
#AOPDIVDivision3
#AOPMADProduct-Sum4
#AOPLIPLinear interpolation5
#AOPCLPClamping6

FFTWFN Window Function Types

Requires Sound Processing DLC

These are constants that state the type of operation to be done with FFTWFN.

Constant NameOperation TypeValue
#WFRECTRectangular window0
#WFHAMMHamming window1
#WFHANNHanning window2
#WFBLKMBlackman window3

BQPARAM Filtering Types

Requires Sound Processing DLC

These are constants that state the type of filtering to be done with BQPARAM.

Constant NameFiltering TypeValue
#BQAPFAll pass filter0
#BQLPFLow pass filter1
#BQHPFHigh pass filter2
#BQBPFBandpass filter3
#BQBSFBand stop filter4
#BQLSFLow shelf filter5
#BQHSFHigh shelf filter6
#BQPEQPeaking equalizer7

PCMVOL Channel Control

Requires Sound Processing DLC

These are constants to select the channel to control with PCMVOL.

Constant NameChannelValue
#PVLEFTLeft0
#PVRIGHTRight1

Top | < Previous (Errors) | Next (PAGE NAME) >