Page 1 of 1
CHAN_F
Posted: Fri Jun 30, 2017 6:59 pm
by dilwyn
Having a blank moment: does anyone know of an extension to peek a floating point value from the extended channel definition block?
e.g. PRINT CHAN_F(#0,HEX("14A")
i.e. a floating point version of Simon Goodwin's CHAN_B%, CHAN_W% and CHAN_L functions which return byte, word and long word values.
Asked this in response to printing in Quanta mag the tip from Tobias about the aspect ratio being stored in channel variable pt_asprt equ $14a ; 6 bytes float pixel aspect ratio, how to read the values and change them to experiment with.
Re: CHAN_F
Posted: Fri Jun 30, 2017 7:38 pm
by tofro
Dilwyn,
a combination of DIY TK and Turbo Toolkit should help:
Code: Select all
PRINT PEEK_F(CHBASE(#x) + HEX("$14a"))
CHBASE comes with the "q" volume of DIY TK and returns the base address of a channel definition.
PEEK_F is a function from Turbo Toolkit and, well does what it says.
Cheers,
Tobias
Re: CHAN_F
Posted: Fri Jun 30, 2017 8:06 pm
by dilwyn
Thank you. I'll try that and pass on the results.
Re: CHAN_F
Posted: Sat Jul 01, 2017 8:21 am
by mk79
dilwyn wrote:Asked this in response to printing in Quanta mag the tip from Tobias about the aspect ratio being stored in channel variable pt_asprt equ $14a ; 6 bytes float pixel aspect ratio, how to read the values and change them to experiment with.
pt_asprt does not live in the CDB, but in the CON linkage block. You can play with it using the g-ratio extension:
http://members.upc.nl/b.spelten/ql/files/g_ratio.zip
Re: CHAN_F
Posted: Sat Jul 01, 2017 4:42 pm
by pjw
dilwyn wrote:
<>
e.g. PRINT CHAN_F(#0,HEX("14A")
i.e. a floating point version of Simon Goodwin's CHAN_B%, CHAN_W% and CHAN_L functions which return byte, word and long word values.
Try
Code: Select all
deffn CHAN_F(ch, ad)
ret FLT(chan_W%(#ch;ad), CHAN_L(#ch;ad+2))
enddef
:
deffn FLT(x, b)
IF b = 0 OR x = 0: ret 0
ret b * 2 ^ (x - 2079)
enddef
:
Re: CHAN_F
Posted: Sat Jul 01, 2017 6:13 pm
by dilwyn
mk79 wrote:dilwyn wrote:Asked this in response to printing in Quanta mag the tip from Tobias about the aspect ratio being stored in channel variable pt_asprt equ $14a ; 6 bytes float pixel aspect ratio, how to read the values and change them to experiment with.
pt_asprt does not live in the CDB, but in the CON linkage block. You can play with it using the g-ratio extension:
http://members.upc.nl/b.spelten/ql/files/g_ratio.zip
Thank you Marcel. I will print include this as additional information in the Helpline column in the next issue of Quanta - it's too late to change the current issue now.