arduino_midi_player/Midi/music-box-arduino-master/UpdateTick.inc
2025-03-24 14:30:56 +08:00

33 lines
600 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "SynthCore.h"
#include "AsmCommon.h"
.section .bss
.global currentTick
currentTick:
.skip 4
.global decayGenTick
decayGenTick:
.skip 1
.section .text
UpdateTick:
sec
lds t0l,currentTick
adc t0l,zero
sts currentTick,t0l
lds t0l,currentTick+1
adc t0l,zero
sts currentTick+1,t0l
lds t0l,currentTick+2
adc t0l,zero
sts currentTick+2,t0l
lds t0l,currentTick+3
adc t0l,zero
sts currentTick+3,t0l
lds t0l,decayGenTick
cpi t0l,DECAY_TIME_FACTOR
brsh updateDecayGenTickEnd ; BRSH Branch if Same or Higher (Unsigned)
inc t0l
sts decayGenTick,t0l
updateDecayGenTickEnd: