User Tools

Site Tools


notes:comporg:spring2025:virconref

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:spring2025:virconref [2025/02/27 16:25] – [ILT] wedgenotes:comporg:spring2025:virconref [2025/03/02 03:43] (current) – [GPU] tkastne1
Line 167: Line 167:
 ^  Type  ^  Port  ^  Name  ^  Description  | ^  Type  ^  Port  ^  Name  ^  Description  |
 |  OUT  |  0x200  |  GPU_Command  |  perform GPU operation  | |  OUT  |  0x200  |  GPU_Command  |  perform GPU operation  |
-|  ???   0x201  |  GPU_RemainingPixels  |  ???  |+|  IN   0x201  |  GPU_RemainingPixels  |  ???  | 
 +|  IN  |  0x202  |  GPU_ClearColor  |  obtain current clear color  |
 |  OUT  |  0x202  |  GPU_ClearColor  |  color to clear the screen with  | |  OUT  |  0x202  |  GPU_ClearColor  |  color to clear the screen with  |
-|  ???   0x203  |  GPU_MultiplyColor  |  ???  | +|  IN   0x203  |  GPU_MultiplyColor  |  obtain current color multiplier  | 
-|  ???   0x204  |  GPU_ActiveBlending  |  ???  |+|  OUT  |  0x203  |  GPU_MultiplyColor  |  color multiplier to draw sprites with  | 
 +|  IN  |  0x204  |  GPU_ActiveBlending  |  obtain current blending mode  | 
 +|  OUT   0x204  |  GPU_ActiveBlending  |  blending method to draw sprites with  |
 |  IN  |  0x204  |  GPU_SelectedTexture  |  obtain current selected texture  | |  IN  |  0x204  |  GPU_SelectedTexture  |  obtain current selected texture  |
 |  OUT  |  0x204  |  GPU_SelectedTexture  |  texture ID to select (-1 for BIOS)  | |  OUT  |  0x204  |  GPU_SelectedTexture  |  texture ID to select (-1 for BIOS)  |
 |  IN  |  0x205  |  GPU_SelectedRegion  |  obtain current selected region  | |  IN  |  0x205  |  GPU_SelectedRegion  |  obtain current selected region  |
 |  OUT  |  0x205  |  GPU_SelectedRegion  |  region ID to select  | |  OUT  |  0x205  |  GPU_SelectedRegion  |  region ID to select  |
 +|  IN  |  0x206  |  GPU_DrawingPointX  |  obtain X position to draw selected region  |
 |  OUT  |  0x206  |  GPU_DrawingPointX  |  set X position to draw selected region  | |  OUT  |  0x206  |  GPU_DrawingPointX  |  set X position to draw selected region  |
 +|  IN  |  0x207  |  GPU_DrawingPointY  |  obtain Y position to draw selected region  |
 |  OUT  |  0x207  |  GPU_DrawingPointY  |  set Y position to draw selected region  | |  OUT  |  0x207  |  GPU_DrawingPointY  |  set Y position to draw selected region  |
-|  ???   0x208  |  GPU_DrawingScaleX  |  sets X scaling with a float as input  | +|  IN  |  0x208  |  GPU_DrawingScaleX  |  obtain X scaling as a float  | 
-|  ???   0x209  |  GPU_DrawingScaleY  |  sets Y scaling with a float as input  | +|  OUT   0x208  |  GPU_DrawingScaleX  |  sets X scaling with a float as input  | 
-|  ???   0x20A  |  GPU_DrawingAngle  |  ???  |+|  IN  |  0x209  |  GPU_DrawingScaleY  |  obtain Y scaling as a float  | 
 +|  OUT   0x209  |  GPU_DrawingScaleY  |  sets Y scaling with a float as input  | 
 +|  IN   0x20A  |  GPU_DrawingAngle  |  obtain the sprite rotation as a float  | 
 +|  OUT  |  0x20A  |  GPU_DrawingAngle  |  sets the sprite rotation with a float as input  | 
 +|  IN  |  0x20B  |  GPU_RegionMinX  |  obtain Min X coordinate for region  |
 |  OUT  |  0x20B  |  GPU_RegionMinX  |  set Min X coordinate for region  | |  OUT  |  0x20B  |  GPU_RegionMinX  |  set Min X coordinate for region  |
 +|  IN  |  0x20C  |  GPU_RegionMinY  |  obtain Min Y coordinate for region  |
 |  OUT  |  0x20C  |  GPU_RegionMinY  |  set Min Y coordinate for region  | |  OUT  |  0x20C  |  GPU_RegionMinY  |  set Min Y coordinate for region  |
 +|  IN  |  0x20D  |  GPU_RegionMaxX  |  obtain Max X coordinate for region  |
 |  OUT  |  0x20D  |  GPU_RegionMaxX  |  set Max X coordinate for region  | |  OUT  |  0x20D  |  GPU_RegionMaxX  |  set Max X coordinate for region  |
 +|  IN  |  0x20E  |  GPU_RegionMaxY  |  obtain Max Y coordinate for region  |
 |  OUT  |  0x20E  |  GPU_RegionMaxY  |  set Max Y coordinate for region  | |  OUT  |  0x20E  |  GPU_RegionMaxY  |  set Max Y coordinate for region  |
 +|  IN  |  0x20F  |  GPU_RegionHotspotX  |  obtain region Hotspot X coordinate  |
 |  OUT  |  0x20F  |  GPU_RegionHotspotX  |  set region Hotspot X coordinate  | |  OUT  |  0x20F  |  GPU_RegionHotspotX  |  set region Hotspot X coordinate  |
 +|  IN  |  0x210  |  GPU_RegionHotspotY  |  obtain region Hotspot Y coordinate  |
 |  OUT  |  0x210  |  GPU_RegionHotspotY  |  set region Hotspot Y coordinate  | |  OUT  |  0x210  |  GPU_RegionHotspotY  |  set region Hotspot Y coordinate  |
                  
Line 461: Line 475:
  
 In this case, we are testing if the first operand is less than or equal to the second operand. In this case, we are testing if the first operand is less than or equal to the second operand.
- 
-===NOTE=== 
-For the purposes of comparisons and conditional jumps on Vircon32: 
- 
-  * true is 1 (technically non-zero) 
-  * false is 0 
- 
-There are six relational operations: 
- 
-  * is equal to 
-  * is not equal to 
-  * is less than 
-  * is than or equal to 
-  * is greater than 
-  * is greater than or equal to 
  
 ===Structure and variants=== ===Structure and variants===
Line 544: Line 543:
 ====LEA==== ====LEA====
 Load Effective Address of a memory position. Load Effective Address of a memory position.
- 
-===Addressing=== 
-LEA, like other data-centric instructions, makes use of various addressing modes: 
- 
-  * **register**: source/destination is an inbuilt CPU register 
-  * **immediate**: some literal constant (be it data or a memory address) 
-  * **indirect**: value isn't the data, but a memory address to where the data is. Think pointer dereference. It comes in 3 varieties: 
-  * **indexed**: an offset to some existing piece of data. 
-      * **immediate**: a literal constant (data or memory address) 
-      * **indexed**: used with immediate/register, but we can do additional math to get an offset from the address. Think pointer dereference on an array. 
-      * **register**: a CPU register 
- 
-Indirect processing is accomplished with the **<nowiki>[ ]</nowiki>** (square brackets) surrounding the value we wish to dereference (we're not interested in the direct thing, but indirectly in what that thing contains). 
  
 ===Structure and variants=== ===Structure and variants===
Line 765: Line 751:
 ===Structure and variants=== ===Structure and variants===
 ^  Variant  ^  Form  ^  Action  | ^  Variant  ^  Form  ^  Action  |
-|  1  |<nowiki>AND DSTREG, ImmediateValue</nowiki>  |<nowiki>DSTREG = DSTREG & ImmediateValue;</nowiki>  | +|  1  |<code asm>AND DSTREG, ImmediateValue</code>  |<code c>DSTREG = DSTREG & ImmediateValue;</code>  | 
-|  2  |<nowiki>AND DSTREG, SRCREG</nowiki>  |<nowiki>DSTREG = DSTREG & SRCREG;</nowiki>  |+|  2  |<code asm>AND DSTREG, SRCREG</code>  |<code c>DSTREG = DSTREG & SRCREG;</code>  |
  
 ===Description=== ===Description===
Line 785: Line 771:
 ===Structure and variants=== ===Structure and variants===
 ^  Variant  ^  Form  ^  Action  | ^  Variant  ^  Form  ^  Action  |
-|  1  |<nowiki>OR DSTREG, ImmediateValue</nowiki>  |<nowiki>DSTREG = DSTREG | ImmediateValue;</nowiki>  | +|  1  |<code asm>OR DSTREG, ImmediateValue</code>  |<code c>DSTREG = DSTREG | ImmediateValue;</code>  | 
-|  2  |<nowiki>OR DSTREG, SRCREG</nowiki>  |<nowiki>DSTREG = DSTREG | SRCREG;</nowiki>  |+|  2  |<code asm>OR DSTREG, SRCREG</code>  |<code c>DSTREG = DSTREG | SRCREG;</code>  |
  
 ===Description=== ===Description===
-OR performs a **Bitwise iOR** between each pair of respective bits in the 2 specified +OR performs a **Bitwise INCLUSIVE OR** between each pair of respective bits in the 2 specified operands. The result is stored in the first of them, which is always a register.
-operands. The result is stored in the first of them, which is always a register.+
  
 ====XOR==== ====XOR====
Line 805: Line 790:
 ===Structure and variants=== ===Structure and variants===
 ^  Variant  ^  Form  ^  Action  | ^  Variant  ^  Form  ^  Action  |
-|  1  |<nowiki>XOR DSTREG, ImmediateValue</nowiki>  |<nowiki>DSTREG = DSTREG ^ ImmediateValue;</nowiki>  | +|  1  |<code asm>XOR DSTREG, ImmediateValue</code>  |<code c>DSTREG = DSTREG ^ ImmediateValue;</code>  | 
-|  2  |<nowiki>XOR DSTREG, SRCREG</nowiki>  |<nowiki>DSTREG = DSTREG ^ SRCREG;</nowiki>  |+|  2  |<code asm>XOR DSTREG, SRCREG</code>  |<code c>DSTREG = DSTREG ^ SRCREG;</code>  |
  
 ===Description=== ===Description===
Line 829: Line 814:
  
 ===Structure and variants=== ===Structure and variants===
-  * <code>(Variant 1): SHL { Register1 }ImmediateValue }</code> +^  Variant  ^  Form  ^  Action 
-  <code>(Variant 2): SHL { Register1 }, { Register2 }</code> +|  1  |<code asm>SHL DSTREG, ImmediateValue</code>  |<code c>DSTREG = DSTREG << ImmediateValue;</code>  | 
- + 2  |<code asm>SHL DSTREG, SRCREG</code>  |<code c>DSTREG DSTREG << SRCREG;</code>  |
-===Processing actions=== +
-  <code>(Variant 1): Register1 = Register1 << ImmediateValue</code> +
-  <code>(Variant 2): Register1 Register1 << Register2</code>+
  
 ===Description=== ===Description===
 SHL performs an bit shift to the left in the specified register. The second operand is SHL performs an bit shift to the left in the specified register. The second operand is
-taken as an integer number of positions to shift. Shifting 0 positions has no effect, while +taken as an integer number of positions to shift. 
-negative values result in shifting right. The shift type is logical: in shifts left, overflow is + 
-discarded and zeroes are introduced as least significant bits. In shifts right, underflow is +Shifting 0 positions has no effect, while negative values result in shifting right. 
-discarded and zeroes are introduced as most significant bits.+ 
 +The shift type is logical: in shifts left, overflow is discarded and zeroes are introduced as least significant bits. 
 + 
 +In shifts right, underflow is discarded and zeroes are introduced as most significant bits.
  
  
notes/comporg/spring2025/virconref.1740673525.txt.gz · Last modified: 2025/02/27 16:25 by wedge