Retrieving low/high order words (uFMOD related)

BlitzMax Forums/BlitzMax Beginners Area/Retrieving low/high order words (uFMOD related)

Sledge(Posted 2007) [#1]
I notice that uFMOD_GetStats() returns a single var from which you are supposed to extract right and left channel volume information in the form of the low-order word and high-order word respectively.

I understand about using upper and lower bits to hold separate numbers (having mistakenly thought ASM might be 'fun') but I must confess to having no idea what the related syntax in BlitzMax would be to process the GetStats() return value. What's the proper way to go about this chaps?


Sledge(Posted 2007) [#2]
Oh no I've stumped the forum! Do I get a prize?! :D


tonyg(Posted 2007) [#3]
shr and shl?


Who was John Galt?(Posted 2007) [#4]
Yeah something like,
int loword=int(longval & $FFFF)
int hiword=int((longval shr 16) & $FFFF)
(untested)


Sledge(Posted 2007) [#5]
Ah, so it *is* a shifting thing -- I thought there might be a built-in func to return the low/hi word. That's a lot of help chaps, much appreciated!