Pasm munching squares help
Hi all
I am begginer is possible help me how to make simple munching square with pasm routine ? (for fast graphic and for my basic teaching with pasm)
See my simple example with spin.
Many many thanks help
Kamil
I am begginer is possible help me how to make simple munching square with pasm routine ? (for fast graphic and for my basic teaching with pasm)
See my simple example with spin.
Many many thanks help
Kamil
Comments
As you can see the Munching squares calculation is easy, just an XOR and an ADD.
The plot subroutine is a bit more challenging... and you have to pass the screen address to the PASM cog, fortunatly there is getter methode for that in the VGA code.
you can copy and paste this into the Prop-Tool.
Andy
Many many thanks this is working great :-)
And this is my start point to learn with pasm !
Simple question - is possible use modulo function in the pasm or must use modulo sub routine ?
Many thanks !
Kamil
What base modulo are you trying to do? If the base is constant, you can make a custom routine that will be a lot faster. If the base is a power of 2, it's as simple as ANDing your value with (base - 1).
Do exist simple modulo subroutine ?
It works only with positive numbers and max. a 16bit divisor, but if you need it for graphics this should not be a problem.
Andy
See my example XOR Fractal
30-7=23, 23-7=16, 16-7=9, 9-7=2
Next cmpsub will not be approved for subtraction and c-flag will not be set, result modulo=2
As you don't need to know how many times, un-roll the loop a little will speed it up most of the time
nice code. the second one is almost mean. love it!
Thanks!
Mike