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:16] – [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.
Line 95: Line 118:
 jmp __label jmp __label
 </code>  </code> 
-where your label would be somethin akin to '_main_loop'+where your label would be somethin akin to ''_main_loop''
  
-You'd also need a label such like '_end_main_loop' which would hold your 'hlt' command+You'd also need a label such like ''_end_main_loop'' which would hold your ''hlt'' command
  
 =====TASK===== =====TASK=====
notes/comporg/spring2024/projects/def0.1707952614.txt.gz · Last modified: 2024/02/14 23:16 by cburling