We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

DSP1/Rotate: Difference between revisions

From SnesLab
Jump to: navigation, search
(added opcode)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Rotate''' is a DSP1 command.
{| class="wikitable" style="float:right;clear:right;width:15%"
{| class="wikitable" style="float:right;clear:right;width:15%"
!colspan="8"|Basic Info
!colspan="8"|Basic Info
Line 6: Line 4:
|'''Opcode'''
|'''Opcode'''
|0C
|0C
|+
|'''Speed'''
|64 cycles
8.6 μs
|}
|}
'''Rotate''' is a [[DSP1]] command that rotates a two-dimensional point counterclockwise about the origin.  Page 3-2-1 of the manual states that Rotate takes 65 cycles, which is one more than the sum on page 3-5-8.
=== Input Parameters ===
* '''θ''' is the angle of rotation about the Z axis
* '''x1''' is the x coordinate before rotation
* '''y1''' is the x coordinate before rotation
=== Output Parameters ===
* '''x2''' is the x coordinate after rotation
* '''y2''' is the y coordinate after rotation
=== See Also ===
* [[Polar]]


=== References ===
=== References ===
* https://archive.org/details/SNESDevManual/book2/page/n298
* subparagraph 5.3.1 on [https://archive.org/details/SNESDevManual/book2/page/n298 Page 3-5-8 of Book II] of the official Super Nintendo development manual
* paragraph 6.8 on [https://archive.org/details/SNESDevManual/book2/page/n324 page 3-6-1 of Book II], lbid.
* https://github.com/bsnes-emu/bsnes/blob/master/bsnes/sfc/coprocessor/dsp1/dsp1emu.cpp#L436
 
[[Category:DSP1]]
[[Category:Coordinate Calculation Commands]]

Latest revision as of 05:08, 10 January 2024

Basic Info
Opcode 0C
Speed 64 cycles

8.6 μs

Rotate is a DSP1 command that rotates a two-dimensional point counterclockwise about the origin. Page 3-2-1 of the manual states that Rotate takes 65 cycles, which is one more than the sum on page 3-5-8.

Input Parameters

  • θ is the angle of rotation about the Z axis
  • x1 is the x coordinate before rotation
  • y1 is the x coordinate before rotation

Output Parameters

  • x2 is the x coordinate after rotation
  • y2 is the y coordinate after rotation

See Also

References