User Tools

Site Tools


notes:comporg:spring2024:projects:def0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:comporg:spring2024:projects:def0 [2024/02/14 23:17] – [Loops] cburlingnotes: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, minY, maxX, maxY, hotspotX, hotspotY);
 +</code>
 +
 +Except that here, you have to input each coordinate value individually, including the hotspots.
 +
 +Getting only the necessary lines from the compiled code, defining a region would look like so:
 +<code asm>
 +out GPU_RegionMinX, R?
 +out GPU_RegionMinY, R?
 +. . .
 +out GPU_RegionHotSpotY, R?
 +</code>
 +
 +Where "R?" refers to the register that stores that specific coordinate.
 +
 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:
    "ieq" -> "integer equal to"    "ieq" -> "integer equal to"
    "ige" -> "integer greater than or equal to"    "ige" -> "integer greater than or equal to"
 +
 +    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.
notes/comporg/spring2024/projects/def0.1707952668.txt.gz · Last modified: 2024/02/14 23:17 by cburling