This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:comporg:spring2024:projects:def0 [2024/02/14 23:17] – [Loops] cburling | notes:comporg:spring2024:projects:def0 [2024/02/15 04:58] (current) – [Drawing Regions] rspringe | ||
---|---|---|---|
Line 45: | Line 45: | ||
=====Drawing Regions===== | =====Drawing Regions===== | ||
+ | Before a region can be drawn, its borders have to be defined within the texture file. | ||
+ | |||
+ | This is done similarly to the define_region functions in C: | ||
+ | <code C> | ||
+ | define_region(minX, | ||
+ | </ | ||
+ | |||
+ | Except that here, you have to input each coordinate value individually, | ||
+ | |||
+ | Getting only the necessary lines from the compiled code, defining a region would look like so: | ||
+ | <code asm> | ||
+ | out GPU_RegionMinX, | ||
+ | out GPU_RegionMinY, | ||
+ | . . . | ||
+ | out GPU_RegionHotSpotY, | ||
+ | </ | ||
+ | |||
+ | Where " | ||
+ | |||
To display your regions you have to say where you want to display the region. That is done by putting in values for X and Y into 2 different registers. Here is what that looks like: | To display your regions you have to say where you want to display the region. That is done by putting in values for X and Y into 2 different registers. Here is what that looks like: | ||
Line 83: | Line 102: | ||
" | " | ||
" | " | ||
+ | |||
+ | mov R0, 13 | ||
+ | ilt R0, 14 ; would set the value in R0 to 0 as the result of the comparison is true. | ||
+ | |||
*One needs to keep in mind that when these comparisons are passed, they are replaced with a resulting value, like 1 or 0. So do be careful when comparing a register to an integer or another register. | *One needs to keep in mind that when these comparisons are passed, they are replaced with a resulting value, like 1 or 0. So do be careful when comparing a register to an integer or another register. |