Brisk VM2 how to...

Blitz3D Forums/Blitz3D Programming/Brisk VM2 how to...

_33(Posted 2008) [#1]
I wish to know if the VM and Blitz3D have intricate links between them in order to play with memory space reserved with banks or from texture or image address space?


Koriolis(Posted 2008) [#2]
I am not sure to understand your question. What would like to be able to do exactly?


_33(Posted 2008) [#3]
From the VM, I would like to access data in read and write from a Blitz3d bank.


Koriolis(Posted 2008) [#4]
BriskVM let's you expose whatever you want to scripts, so all you would have to do is expose the corresponding functions (CreateBank, PeekInt and so on) to the scripts, and you're done.
The manual explains how to expose functions to the scripts (look up the chapter named "customizing your command set").


_33(Posted 2008) [#5]
So, what you're saying is, that blitz3d will interpret the commands anyway, with the same type of invoker as seen in the demos (ie. Function BVM_Invoke%)? Say if I have massive memory manipulation of banks using blitz peek and poke, wouldn't that be much slower in such a case than original blitz code (massive Select Case statement, various BVM_PopInt, BVM_PopFloat)?


Koriolis(Posted 2008) [#6]
Yes. Although BriskVM is relatively fast, this will necessarily be slower. Scripts are best to be used for high level code, and in this area the speed hit can be neglected. On the contrary, doing massively CPU intensive computations in scripts is a bad idea. So it all depends on how complex and repeated your bank accesses wil be.
In any case, if you're unsure you can use the trial verison of BriskVM to see if it's fast enogh for what you plan to do.


_33(Posted 2008) [#7]
Very true, thanks for the very honest answer. What I need to do is I need my engine to access scripts that handle bank data. The bank data contains character based page data (ascii code, color code, alpha, etc etc.... 25 layers of them). Pages can be of any character size really, but I like chunky pixels, so let's say 40x30. In such case 1200 bytes per page layer, manipulated 30 times a second. Since I do effects, I can have many pages at the same time being manipulated, so this can be augmented a number of folds (system limit is 32 pages). So I am looking for the fastest way to manipulate bank data using a script language.


Koriolis(Posted 2008) [#8]
Well the first thing to look at is do you realy need to manipulate each character individually? Since I don't know what you are trying to achieve I really can't tell, but maybe there's a way to a go a little bit higher level? Very much like a 3d engine would expose functions to handle entities rather than function to draw single polygons, you may be able to find higher level primitives.
If not, I can only advice once again to try for youself using the triel version (the speed of the trial version is very close to the speed of the full version). You should be able to knock up some benchmark relatively quickly. Just use some of the demos as a starting point, add the bank handling funciton to the command set, and modify the script to do your bank manipulations.


_33(Posted 2008) [#9]
oh I have all sorts of functions for all sorts of things. Thanks again Koriolis, cheers. I think I'll stick to Blitz3d for the low level data manipulation. Maybe I'll get to a way of making higher level accesses from a script language, see how I could manage this in a flexible way.