Skip to content

Core Lua

There are various core Lua classes baked into the Alarmo's firmware, many of which are referenced by the core system Lua classes or a theme's Lua files.

Classes

Below are the various Lua classes as well as their associated methods.

App

These methods are accessible by most Lua classes that implement an app property.

For example, below is the setColor() method of the ComRect class, which uses its own app property to call the App:SetRectangleColor() method.

--
-- Sets the color of the rectangle
--
function ComRect:setColor(r, g, b, a)
    local name = self.parent.getName()
    self.app.SetRectangleColor(name, r, g, b, a)
end

Below is the full list of methods available in the App class.

Address Function Name
70027330 GetRandomIntMulti
70027454 EmitSound
70027470 EmitSoundWithHandle
7002748c SetSoundVolume
70027570 SetCurrentDateTime
700293c4 GetRandomNumber
70029416 GetRandomInt
70029484 GetInstalledPositionAngle
700294d8 GetInstalledPositionAngleIndex
7002952e GetInstalledPositionBedWidth
70029580 GetInstalledPositionDistance
700295d2 GetInstalledPositionBedKind
70029626 SetInstalledPositionAngleIndex
70029670 SetInstalledPositionBedWidth
70029704 SetInstalledPositionDistance
70029750 SetInstalledPositionBedKind
70029834 ApplyInstallPositionConfig
7002986a GetDopplerSensitivityMode
700298c0 SetDopplerSensitivityMode
700299a8 ApplyDopplerSensitivityMode
700299de SetFullColorLedColor
70029a44 SetFullColorLedBrightness
70029a92 SetFullColorLedMasterBrightness
70029ae0 SetLcdBrightness
70029b2e SetLcdBrightnessIndex
70029b78 GetLcdBrightnessIndex
70029bcc SetLcdBrightnessAutomaticControl
70029c16 IsLcdBrightnessAutomaticControl
70029c6e SetLcdLockLuxValue
70029cd6 SetLcdBrightnessUpperMost
70029d0e SetLcdLockBrightnessMode
70029d76 SetLcdOnAtTimeSignal
70029dae StartDoppler
70029de4 StopDoppler
70029e1a GetMoveLevel
70029e62 GetMoveDistanceByMoveLevel
70029eac IsMoved
70029f06 IsMovedSmall
70029f62 IsMovedLarge
70029fbe IsAbsenceByHeartbeat
7002a012 IsAbsenceByRespiration
7002a066 IsAbsenceDiscreet
7002a0ba IsLeftFromBed
7002a10e GetUserVsBedState
7002a156 GetUserVsBedVisibility
7002a19e IsOnBed
7002a1f8 GetDistanceInInterest
7002a24c GetFarthestDistanceInBedArea
7002a2a0 GetMoveDistance
7002a2ea GetMovePositionX
7002a33e GetMovePositionY
7002a392 IsValidSensorPosition
7002a3ec GetSensorAngle
7002a440 GetSensorDistance
7002a47e IsSitUp
7002a4d4 InitializeVisualizeParameter
7002a694 GetVisualizeUserStateType
7002a6dc GetTargetPixelX
7002a724 SetAchpTimespanFromPausedToEnd
7002a770 SetAchpTimespanFromStandbyToEnd
7002a7bc SetAchpTimespanFromSearchingToPaused
7002a808 SetAchpTimespanStillFromStandbyToPlayingWithoutReachingPlaying
7002a854 SetAchpTimespanStillFromStandbyToPlaying
7002a8a0 SetAchpTimespanStillForUserBecomeInvisible
7002a8ec SetAchpTimespanAbsenceByHeartbeatForUserBecomeVisible
7002a938 GetAchpAlarmState
7002a98c GetAchpAlarmRestartProgressRatio
7002a9e2 GetAchpIsKeepingAbsenceFromReset
7002aa3c AchpPrepare
7002aa74 AchpDestroy
7002aaac AchpCalc
7002aae4 AchpCalcWithoutUpdatingAlarmState
7002ab1c AchpFinishFanfare
7002ab54 FadeSound
7002aba0 IsSoundFinished
7002ac12 KillSound
7002ac5e GetSoundHandleCountMax
7002ac9a IsLoopSound
7002ad1e GetEventName
7002ad9a FadeAllEvents
7002add4 GetSystemVolumeCurveIndexMax
7002ae18 GetSystemVolumeCurveIndexMin
7002ae54 GetSystemVolumeCurveValue
7002aeba LoadThemeSE
7002af22 LoadEventEmitter
7002afd6 LoadAdditionalEventEmitter
7002b058 UnloadAdditionalEventEmitter
7002b090 EmitFCLed
7002b0f8 CreateRectangle
7002b1f0 SetRectangleDepth
7002b27e SetRectangleSize
7002b322 SetRectanglePosition
7002b394 SetRectangleColor
7002b43e SetRectangleDrawType
7002b55c DestroyRectangle
7002b5ba DestroyAllRectangles
7002b5f0 CreateCanvas
7002b874 DestroyCanvas
7002b93a SetFlag
7002ba20 ResetFlag
7002ba78 TestFlag
7002baf6 MoveTo
7002bb50 IsTriggered
7002bc5c IsHold
7002bcda IsReleased
7002bd58 IsNoInput
7002bdb2 ConsumeButtonInput
7002bdea GetDialStep
7002be40 GetDialDirection
7002be96 GetDialAngle
7002beec GetIlluminanceLux
7002bf40 GetIlluminanceVl
7002bf94 GetIlluminanceIr
7002bfe8 GetBatteryVoltage
7002c03c SetBatterySenseEnable
7002c0a4 GetBatterySenseEnable
7002c0fe GetUsbCcVoltage
7002c170 GetBatteryChargingPortType
7002c1c4 GetTypeCCurrentType
7002c218 ConvertHSVToRGB
7002c2d4 GetCurrentDate
7002c35a GetCurrentTime
7002c3b0 GetCurrentDateTime
7002c46e GetDayOfWeek
7002c4dc GetDaysInMonth
7002c54a IsValidDateTimeInCurrentTimeZone
7002c5d2 ResetTimer
7002c60a GetElapsedTimeSeconds
7002c65e GetElapsedTimeMilliSeconds
7002c6b4 ResetGlobalTimer
7002c6ec GetElapsedTimeSecondsGlobal
7002c740 PushScene
7002c7a8 TakeoverScene
7002c810 PopScene
7002c848 GetScene
7002c8a0 CleanUpForTransition
7002c8d8 StartSceneBlock
7002c940 GetParameterValueAsBool
7002c9c4 GetParameterValueAsFloat
7002ca42 GetParameterValueAsInt
7002cac2 RequestSystemShutdown
7002cafa GetBoardnumber
7002cb52 GetVersionNumber
7002cbb0 GetSystemVersionNumber
7002cc0a DisplayGitHash
7002cc42 GetFatalErrorCode
7002cc98 ClearFatalErrorCode
7002ccce SetSaveDataWritingSuspended
7002cd36 GetSunriseSunsetTime
7002ce7c GetNetwork

Canvas

Address Function Name
7001dd2c SetPosition
7001de52 SetDepth
7001de9e Clear
7001ded6 Fill
7001df9e DrawRect
7001e0e2 CopyImageFromLayoutImage

Network

Address Function Name
700229ac SetEnableWlanAsync
70022abc IsCompletedEnableWlan
70022b6c ScanApAsync
70022ba4 IsCompletedScanAp
70022c04 GetScanApCount
70022c62 GetApRssi
70022cd0 GetApSignalLevel
70022d3e GetApSsid
70022dba GetApSecurityType
70022e28 GetNetworkStatusAsync
70022e60 IsCompletedGetNeworkStatus
70022ec0 GetNetworkControlState
70022f16 GetConnectionState
70022f6a GetSignalLevel
70022fc0 GetMacAddress
70023018 GetSsid
70023070 GetSecurityType
700230c6 IsAutoSelectSecurityType
7002311a GetSignalStrength
70023170 GetIpAddress
700231c8 GetSubnetMask
70023220 GetDefaultGateway
70023278 GetDnsServerAddress
700232f4 GetMtuSize
70023334 GetDefaultMtuSize
70023372 GetIpConfigType
700233b2 SetSsid
70023476 SetPassphrase
700234e6 SetSecurityType
700235cc SetAutoSelectSecurityType
70023618 TrySetIpConfigDhcp
70023776 TrySetIpConfigStatic
70023906 WaitAllAsyncRequest
70023964 SetNetworkEnabled
700239cc SetNetworkSettings
70023a04 ResetNetworkSettings
70023a3c ClearNetworkSettings
70023a74 CommitNetworkSettings
70023aac ImportNetworkSettings
70023ae4 SetNetworkServiceRequestEnabled
70023b4c IsNetworkServiceRequestEnabled
70023ba6 GetConnectionErrorCode
70023bfc GetNetworkControlSettingsErrorCode
70023c52 GetNetworkControlConnectionErrorCode
70023ca8 GetNetworkConnectionTimeoutSeconds
70023cfe HttpGracefulShutdown
70023d36 IsCompletedHttpGracefulShutdown
70023d90 StartInternetConnectionTest
70023dc8 IsCompletedInternetConnectionTest
70023e1c GetInternetConnectionTestErrorCode
70023e72 CalcInternetConnectionTest
70023eae PerformNetworkTimeAdjust
70023ee6 IsCompletedNetworkTimeAdjust
70023f40 GetMainFirmwareUpdate
70023fbc GetLinkNintendoAccount
70024038 GetDownloadTheme

Network.DownloadTheme

Address Function Name
700248f8 Calc
70024990 RequestCheckUpdate
700249c8 IsCheckCompleted
70024a6c GetCheckErrorCode
70024ac2 IsAvailableUpdate
70024b1c GetUpdateThemeCount
70024b72 GetUpdateThemeId
70024bee RequestDownload
70024c26 IsDownloadCompleted
70024c80 GetDownloadErrorCode
70024cd6 GetDownloadReceivedBytes
70024d2c GetDownloadTotalBytes
70024d82 GetDownloadSpeedBytes
70024dd8 Cancel

Network.LinkNintendoAccount

Address Function Name
70024550 Calc
700245e8 LinkRequest
70024620 DeviceInitializeRequest
70024658 CheckIsLinkedRequest
70024690 IsReadyLinkUrl
70024734 GetLinkUrl
7002478c GetErrorCode
700247e2 IsCompleted
7002483c IsLinked
70024896 Reset

Network.MainFirmwareUpdate

Address Function Name
700240de Calc
70024178 RequestCheckLatestUpdate
700241b0 IsCheckCompleted
70024254 GetCheckErrorCode
700242aa IsNeedsLatestUpdate
70024304 RequestDownloadLatestUpdate
7002433c IsDownloadCompleted
70024396 GetDownloadErrorCode
700243ec GetDownloadReceivedBytes
70024442 GetDownloadTotalBytes
70024498 GetDownloadSpeedBytes
700244ee Cancel

ShiroAchievement

Address Function Name
7003d624 TestAchievementFlag
7003d714 SetAchievementFlag
7003d750 ResetAchievementFlag
7003d78c GetFirstTutorialCompletedIndex
7003d7d2 SaveFirstTutorialCompletedIndex
7003d80a MarkFirstTutorialCompleted
7003d830 ResetFirstTutorialCompleted

ShiroAlarmConfig

Address Function Name
7003da74 GetAlarmTime
7003daac GetAlarmThemeIndex
7003dade GetAlarmSceneIndex
7003db04 SaveAlarmTheme
7003db94 SaveAlarmDayModeOn
7003dbdc SaveAlarmDayModeOff
7003dc26 SaveAlarmDayModeCustom
7003dd16 GetSceneSelectMode
7003dd3c SaveSceneSelectMode
7003e006 IsAlarmEnabled
7003e050 SaveAlarmTime
7003e08c GetAlarmThemeId
7003e0d4 GetAlarmVolumeIndex
7003e11a SaveAlarmVolumeIndex
7003e152 GetAlarmMode
7003e198 SaveAlarmMode
7003e264 IsAlarmEnabledOn
7003e59c GetAlarmDayMode
7003e670 GetAlarmStartSectionName
7003e6b6 ResetAlarmStartSectionName

ShiroBedTime

Address Function Name
700404f4 IsBedSoundEnabled
70040520 SetBedSoundEnabled
70040588 GetBedTime
700405bc SetBedTime
70040620 GetVolumeIndex
70040646 SetVolumeIndex
700406a4 TestBedSoundAvailable
700406ea IsBedTimeAlreadyCompleted
70040722 TestIsBedTimeNow
700407c0 TestWithinBedTimeStart

ShiroCalender

Address Function Name
70034e5c SetCurrentDateTime
70035086 GetCurrentTime
700350fe GetCurrentDate
70035146 GetCurrentDateTime
700351fe GetDayOfWeek
7003525c CalculateDate

ShiroCoroutineUtil

Address Function Name
700c5290 WaitUntil
700c52ea Wait
700c5324 Loop

ShiroDev

Address Function Name
70039b0a RegisterPerfStatsEntryName
70039b44 BeginRecord
70039b6a EndRecord
70039b90 EndRecordWithLog

ShiroDevConfig

Address Function Name
7003e878 IsDemoModeEnabled
7003e8ae SetDemoModeEnabled
7003e938 IsDebugIndicatorEnabled
7003e97a SetDebugIndicatorEnabled
7003e9aa IsShptLoggingEnabled
7003e9ec SetShptLoggingEnabled
7003ea1c GetDebugTimeSkipMode
7003ea4a SetDebugTimeSkipMode
7003eb0c IsSoundWarningAndErrorAsAssert
7003eb4e SetSoundWarningAndErrorAsAssert
7003eb7e IsMovementRecordUploadEnabled
7003ebc0 SetMovementRecordUploadEnabled

ShiroLayout

Address Function Name
7002eeb8 GetLayoutByKey
7002dbb8 LoadLayout
7002dbd4 UnloadLayout
7002ef1c UnloadAllLayouts
7002ef42 SetViewportDepth
7002dbf8 WaitLoadComplete
7002dc32 WaitActivate
7002dc6c IsLoadCompleted
7002eff6 FlushLayoutCache
7002f01c ForceLayoutCleanUp

ShiroLayout.Image

Address Function Name
7002e218 Is
7002e2e2 IsText
7002e33c GetName
7002e3aa GetGlobalPosition
7002e3fa GetLocalPosition
7002e44a GetDefaultLocalPosition
7002e49a GetDefaultDepth
7002e4f0 GetImageWidth
7002e546 GetImageHeight
7002e59c GetCropLeft

ShiroLayout.LayoutLoader

Address Function Name
7002df30 GetImageCount
7002dfdc GetImageByIndex
7002e0d4 FindImage
7002e150 GetGlobalPosition
7002e1a0 SetGlobalPosition

ShiroMovementRecord

Address Function Name
70040b60 GetRecordOfADay
70040ca0 SetEnabled
70040e32 IsEnabled

ShiroMovementRecord.RecordOfADay

Address Function Name
70040a8c GetRecordCount
70040ac6 GetMovementSeconds
70040b1e HasAnyMovedRecord

ShiroNetworkConfig

Address Function Name
70041a40 IsWlanEnabled
70041a8a GetSsid
70041ad2 GetPassphrase
70041b1a GetSecurityType
70041b60 GetMtuSize
70041ba6 GetDefaultMtuSize
70041bd6 GetIpConfigType
70041c1c GetIpAddress
70041c64 GetSubnetMask
70041cac GetDefaultGateway
70041cf4 GetDnsAddress
70041d4e GetWlanSignalLevel

ShiroNetworkServiceConfig

Address Function Name
70041fa6 GetServerEnvironment
70041fec GetUpdateChannel
70042032 IsLinkedNa
7004207c IsDeviceInitialized
700420c6 SetServerEnvironment
70042106 SetUpdateChannel
70042146 SetLinkedNa
70042180 SetDeviceInitialized

ShiroNotification

Address Function Name
70040fe4 GetNotificationCount
7004100e PeekTopNotificationType
70041038 ConsumeTopNotification
7004106a TryConsumePresentNotification
700410da TryConsumeInternetNotification
7004115a TryGetInternetNotification
700411b8 TryGetTutorialNotification
70041212 TryGetHelpNotification
7004125e ClearNotifications
7004156a PushPresentNotification
700415ac HasNotification

ShiroSystemConfig

Address Function Name
700425f4 GetSystemSeVolumeIndex
70042626 SaveSystemSeVolumeIndex
70042e9c IsDialDirectionNormal
70042ee6 SaveDialDirectionNormal
70042f20 GetLcdBrightnessIndex
70042f66 SaveLcdBrightnessIndex
70042f9e ChangeLcdBrightnessIndexWithoutSave
70042fd6 IsLcdAutoBrightnessEnabled
70043020 SaveLcdAutoBrightnessEnabled
7004305a ChangeLcdAutoBrightnessEnabledWithoutSave
70043094 IsLcdAutoBrightnessByMovementEnabled
700430de SaveLcdAutoBrightnessByMovementEnabled
70043118 ChangeLcdAutoBrightnessByMovementEnabledWithoutSave
70043152 IsFullColorLedEnabled
7004319c SaveFullColorLedEnabled
700431d6 ChangeFullColorLedEnabledWithoutSave
70043210 GetCurrentLocale
70043256 GetCurrentLocaleStr
7004329e GetCurrentLanguage
700432e4 GetCurrentLanguageStr
7004332c ChangeCurrentLocale
700434b8 ChangeCurrentLocaleWithoutSave
700434fa GetCurrentRegion
70043540 GetCurrentRegionStr
70043588 GetTimeZone
700435d0 ChangeTimeZone
70043612 ChangeTimeZoneWithoutSave
70043654 GetDateFormatType
7004369a SetDateFormatType
70043764 GetTimeFormatType
700437aa SetTimeFormatType
70043874 IsNetworkTimeAdjustEnabled
700438be SaveNetworkTimeAdjustEnabled
700438f8 IsFirstBootAfterFwUpdated
70043942 SaveFirstBootAfterFwUpdated
7004397c IsFirstBootAfterThemeInstalled
700439c6 SaveFirstBootAfterThemeInstalled
70043a00 GetMenuSceneBootType
70043a46 ChangeMenuSceneBootTypeWithoutSave
70043b10 AddNextBootMountTheme
70043b52 GetNextBootMountThemeCount
70043b98 GetNextBootMountTheme
70043bf2 ClearNextBootMountTheme
70043c18 IsAlarmSceneRunning
70043c62 SaveAlarmSceneRunning
70043c9c DeleteSaveData

ShiroText

Address Function Name
7002f3b0 BeginTextRendering
70030362 ForceTextCleanUp
7002f40a EndTextRendering
7002fe3c PrintText
7002ffec PrintColoredText
7002f432 GetTextSize
700301da RemoveText
7003021c RemoveAllText
7002f4ac EnableScrollableTextRegion
7002f500 DisableScrollableTextRegion
7002f520 GetLocalizedText

ShiroText.TextRenderer

Address Function Name
7002f728 SetText
7002f7f0 GetTextLength
7002f830 SetFontSize
7002f87c SetTextColor
7002f8e4 SetTextColorAt
7002f990 SetPosition
7002f9e2 SetDepth
7002fa2e SetIsVisible
7002fa7a SetHorizontalAlign
7002fb60 SetVerticalAlign
7002fc48 SetStrokeWidth

ShiroTheme

Address Function Name
700447e4 GetInstalledThemeCount
7004482a GetInstalledThemeIdByIndex
70044884 GetInstalledThemeIdByHash
700448e4 GetInstalledThemeIndex
70044948 GetInstalledThemeMajorVersion
700449ac GetInstalledThemeMinorVersion
70044a10 GetInstalledThemeMicroVersion

ShiroTimeSignal

Address Function Name
70043dcc IsEnabled
70043df8 SetEnabled
70043e4a GetVolumeIndex
70043e70 SetVolumeIndex
70043ecc TestTimeSignalShouldBegin

ShiroUserRecord

Address Function Name
7003ef30 MarkBedSoundCompleted
7003ef8a MarkBedSoundSkipped
7003efd4 MarkBedTimeTriggered
7003f06c IsUnusedAlarmScene
7003f0c2 MarkAlarmSceneUsed
7003f174 FindAlarmRecordAt
7003f220 GetAlarmSettingTimeAt
7003f298 FindBedTimeRecordAt
7003f364 GetBedTimeSettingTimeAt
7003f3dc GetMeanLeaveSecondsIn
7003f4dc GetMeanBedTimeIn
7003fdec ReportAlarmResult
7003ffce ClearBedSoundFlag
7003fff4 ClearUserRecord
7004001a SetEnabled
70040054 IsEnabled

ShiroUtil

Address Function Name
70034960 CalcHash
700349a2 ClampInt
700349e6 ClampDouble
70034a38 Lerp
70034ad8 PrintInfo
70034afc PrintWarn
70034b20 PrintError
70034b44 LogInfo
70034b68 LogWarn
70034b8c LogError
70034bb0 PerformFullGc

ShiroViewport

Address Function Name
700306b4 LoadDynamicLayout
700306d0 AttachDynamicLayer
70030a7a GetSize
70030b20 GetCroppedSize
70030b90 SetPosition
70030c34 SetAlpha
70030c80 SetScale
70030cce BakeScaledImage
70030d42 SetMirrorX
70030daa SetDepth
70030df6 SetVisibility
7003122a PreloadLayoutCache
70031288 PreloadDynamicLayout
7003135e AttachDynamicQRCodeLayer
700314ac GetDynamicLayer
7003155a DetachDynamicLayer
700315c0 GetDynamicLayerSize
700316d6 SetDynamicLayerPosition
700317c4 SetDynamicLayerAlpha
700318a2 SetDynamicLayerScale
7003197e SetDynamicLayerMirrorX
70031a64 SetDynamicLayerDepth
70031ae0 SetDynamicLayerVisibility
70031b5e DestroyDynamicLayer
70031bc4 DestroyAllDynamicLayers
70031c06 GetViewportDepth
70031c62 CopyWithAlphaMask

(More Coming Soon)

Work in progress

This page is currently under development.

Feel free to follow @KernelEquinox to get notified about site and documentation updates as they happen.