View Issue Details

IDProjectCategoryView StatusLast Update
0000700Spring engineGeneralpublic2007-12-09 21:28
ReporterKDR_11k Assigned ToKDR_11k  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Summary0000700: [patch] more CEG opcodes
DescriptionThis patch adds some new opcodes. It also introduces buffers that are used by most of these new codes. Buffers are basically 16 (I figure that's enough) float variables that can store data for later to allow the second operand of an opcode to be determined dynamically (before it had to be a constant). Buffer indices are 0-15. Buffer contents are not initialized so reading from a buffer without writing will yield unpredictable results (this might be what enables carrying a buffer value from one part of a vector to another though, in that case please keep it that weay).

New ops:
y# - Yank: Stores the running value in the buffer # and returns 0. The name comes from Vi's copy and paste operation.
x# - Multiply: Multiplies the value with the contents of buffer #.
a# - Add: Adds the contents of buffer #.
p# - Pow: Returns the #th power of the value.
q# - Buffer Pow: Like Pow but uses the contents of buffer # as the exponent.
Additional InformationExample of use:
pos=1 i.02 y1 d8 q1 y0 i.1 s1 x0,0,1.5808 i.1 s1 x0;

This describes (if used with a high count) a spiral with the minimum radius of 8*damage. Without these new codes only a ring with a fixed radius could be described.
Written out it's

x:
Value = 1
Add index * .02
Store in buffer 1, zero value
Add damage * 8
Value ^ buffer 1
Store in buffer 0, zero value
Add index * .1
Sine of amplitude 1, phase value
Multiply with buffer 0

y:
0

z:
Value = 1.5808 (pi/2)
Add index * .1
Multiply with buffer 0
TagsNo tags attached.
Attached Files
moarOpcodes.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

KDR_11k

2007-12-04 21:29

reporter   ~0001481

Ooops, forgot to mention the Sine for z in the example write-out...

KDR_11k

2007-12-09 21:28

reporter   ~0001484

Committed in r4969 with my new SVN privileges. Yay!

Issue History

Date Modified Username Field Change
2007-12-04 21:26 KDR_11k New Issue
2007-12-04 21:26 KDR_11k File Added: moarOpcodes.patch
2007-12-04 21:29 KDR_11k Note Added: 0001481
2007-12-09 21:27 KDR_11k Status new => assigned
2007-12-09 21:27 KDR_11k Assigned To => KDR_11k
2007-12-09 21:28 KDR_11k Note Added: 0001484
2007-12-09 21:28 KDR_11k Status assigned => resolved
2007-12-09 21:28 KDR_11k Resolution open => fixed