Difference between revisions of "K65 Tutorial 1"

From KK's Wiki
Jump to: navigation, search
(Created page with "<source lang="c" tabwidth="0" style="tab-size: 4;"> * Tutorial 01 - simple raster bar animation * *: var anim = 0x80; // RAM address alias // entry point block is dec...")
 
Line 1: Line 1:
<source lang="c" tabwidth="0" style="tab-size: 4;">
+
<source lang="c">
 
/*
 
/*
 
* Tutorial 01 - simple raster bar animation
 
* Tutorial 01 - simple raster bar animation

Revision as of 13:57, 11 December 2014

/*
*	Tutorial 01 - simple raster bar animation
*
*
*/
 
var anim = 0x80;	// RAM address alias
 
 
 
// entry point block is declared with "main"
main {
	init	// function/inline call (defined in _defs.k65)
 
	{
		sync1				// enter overscan (yes, we start here from end of display)
 
		// some free time here
 
		sync2				// trigger VSYNC
 
		// more free time here
 
		sync3				// display field start
 
		x=224				// that's LDX
		y=anim				// and that's LDY
		{
			wsync			// inline again, this time wait for horizontal blank
			cbg=y			// STY
			y++				// INY
			x--				// DEX
		}!=					// repeat (jump) if not zero/not equal (flag Z=0)
		cbg=a=0				// "p=q=r" is a shortcut for "q=r p=q" for any p/q/r
 
		anim++				// INC
 
	} always	// loop forever (jump)
}