MACRO ADD_CYCLES cycles LDA cycleCount ; Add cycles to cycleCount(1 0) ADC #LO(cycles) STA cycleCount LDA cycleCount+1 ADC #HI(cycles) STA cycleCount+1 ENDMACROName: ADD_CYCLES [Show more] Type: Macro Category: Drawing the screen Summary: Add a specified number to the cycle count Deep dive: Drawing vector graphics using NES tilesContext: See this macro in context in the source code References: This macro is used as follows: * ClearBuffers uses ADD_CYCLES * ClearMemory uses ADD_CYCLES * ClearPlaneBuffers (Part 1 of 2) uses ADD_CYCLES * ClearPlaneBuffers (Part 2 of 2) uses ADD_CYCLES * ConsiderSendTiles uses ADD_CYCLES * SendBarPatts2ToPPU uses ADD_CYCLES * SendBarPattsToPPU uses ADD_CYCLES * SendNametableToPPU uses ADD_CYCLES * SendOtherBitplane uses ADD_CYCLES * SendPatternsToPPU (Part 1 of 6) uses ADD_CYCLES * SendPatternsToPPU (Part 3 of 6) uses ADD_CYCLES * SendPatternsToPPU (Part 5 of 6) uses ADD_CYCLES
The following macro is used to add cycles to the cycle count: ADD_CYCLES cycles The cycle count is stored in the variable cycleCount. This macro assumes that the C flag is clear.
Arguments: cycles The number of cycles to add to the cycle count C flag Must be clear for the addition to work
[X]
Variable cycleCount in workspace ZP
Counts the number of CPU cycles left in the current VBlank in the NMI handler
[X]