; vim: sts=4 sw=8 et ai fdm=marker syntax=asm ; ; fnordlicht firmware ; ; for additional information please ; see http://koeln.ccc.de/prozesse/running/fnordlicht ; ; (c) by Alexander Neumann ; and Lars Noschinski ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License version 2 as ; published by the Free Software Foundation. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; ; For more information on the GPL, please go to: ; http://www.gnu.org/copyleft/gpl.html ; hold the static script opcode macros ; static script handling ; ====================== .equ ChannelR = 0 .equ ChannelG = 1 .equ ChannelB = 2 ; macro: MACRO_NOP {{{ ; ================================================================================== ; call: MACRO_NOP .macro MACRO_NOP .db OpcodeNop, 0, 0, 0 .endmacro ; }}} ; macro: MACRO_FADE_CHANNEL {{{ ; ================================================================================== ; @0 @1 @2 @3 ; call: MACRO_FADE_CHANNEL [ch0|ch1|ch2] TargetBrightness SkipCycles BrightStep .macro MACRO_FADE_CHANNEL .db (OpcodeFadeChannel| @0 ), @1, @2, @3 .endmacro ; }}} ; macro: MACRO_FADE_CHANNELS {{{ ; ================================================================================== ; @0 @1 @2 ; call: MACRO_FADE_CHANNEL ch0Brigtness ch1Brightness ch2Brightness .macro MACRO_FADE_CHANNELS .db OpcodeFadeChannels, @0, @1, @2 .endmacro ; }}} ; macro: MACRO_JUMP {{{ ; ================================================================================== ; @0 ; call: MACRO_JUMP RelativeInstructionCount .macro MACRO_JUMP .db OpcodeJump, @0, 0, 0 .endmacro ; }}} ; macro: MACRO_SET_CHANNEL {{{ ; ================================================================================== ; @0 @1 ; call: MACRO_SET_CHANNEL [ch0|ch1|ch2] TargetBrightness .macro MACRO_SET_CHANNEL .db (OpcodeSetChannel| @0 ), @1, 0, 0 .endmacro ; }}} ; macro: MACRO_SLEEP {{{ ; ================================================================================== ; @0 ; call: MACRO_SLEEP delay (in 1/100 seconds, max 65535) .macro MACRO_SLEEP .db OpcodeSleep, low(@0), high(@0), 0 .endmacro ; }}} ; macro: MACRO_WAIT {{{ ; ================================================================================== ; @0 ; call: MACRO_WAIT Bitmask .macro MACRO_WAIT .db OpcodeWait, @0, 0, 0 .endmacro ; }}} ; macro: MACRO_CLEAR {{{ ; ================================================================================== ; ; call: MACRO_CLEAR .macro MACRO_CLEAR .db OpcodeClear, 0, 0, 0 .endmacro ; }}}