07-11-2022, 06:26 PM
Next up is come code from the POV-Ray port:
Code: (Select All)
/' Get minimum/maximum of two values. '/
proc SYSTEM_BUS_T.POV_min(x as DBL, y as DBL) as DBL
return (iif(((x)>(y)),(y),(x)))
end proc
proc SYSTEM_BUS_T.POV_max(x as DBL, y as DBL) as DBL
return (iif(((x)<(y)),(y),(x)))
end proc
/' Get minimum/maximum of three values. '/
proc SYSTEM_BUS_T.POV_min3(x as DBL, y as DBL, z as DBL) as DBL
return iif(x < y , iif(x < z , x , z) , iif(y < z , y , z))
end proc
proc SYSTEM_BUS_T.POV_max3(x as DBL, y as DBL, z as DBL) as DBL
return iif(x > y , iif(x > z , x , z) , iif(y > z , y , z))
end proc
/' Absolute value of the long integer x. '/
proc SYSTEM_BUS_T.POV_labs(x as DBL) as long
return iif(((x)<0),-(x),(x))
end proc
/' Absolute value of the double x. '/
proc SYSTEM_BUS_T.POV_fabs(x as DBL) as DBL
return iif((x) < 0.0 , -(x) , (x))
end proc
/' Stuff for bounding boxes. '/
def SYSTEM_BUS_T.POV_Assign_BBox_Vect(d as DBL ptr, s as DBL ptr)
dim as SYSTEM_TYPE x = fun_pull() ' x = computer.cpU_mos6510->pull()
dim as SYSTEM_TYPE y = fun_pull() ' y = computer.cpU_mos6510->pull()
dim as SYSTEM_TYPE z = fun_pull() ' z = computer.cpU_mos6510->pull()
d[x] = s[x]: d[y] = s[y]: d[z] = s[z]
end def
def SYSTEM_BUS_T.POV_Make_BBox(BBox() as _BBOX,llx as _BBOX_VAL,lly as _BBOX_VAL,llz as _BBOX_VAL, _
lex as _BBOX_VAL,ley as _BBOX_VAL,lez as _BBOX_VAL)
dim as SYSTEM_TYPE x = fun_pull() ' x = computer.cpU_mos6510->pull()
dim as SYSTEM_TYPE y = fun_pull() ' y = computer.cpU_mos6510->pull()
dim as SYSTEM_TYPE z = fun_pull() ' z = computer.cpU_mos6510->pull()
BBox(x).Lower_Left = (llx)
BBox(y).Lower_Left = (lly)
BBox(z).Lower_Left = (llz)
BBox(x).Lengths = (lex)
BBox(y).Lengths = (ley)
BBox(z).Lengths = (lez)
end def