Hi,
I ended up doing it with a couple of methods, but it would be nice if someone had a simpler way.
Here's what the methods look like:
I ended up doing it with a couple of methods, but it would be nice if someone had a simpler way.
Here's what the methods look like:
Method toBank:TBank(buf:TBank) If buf = Null buf = CreateBank(33*4 + 40) Else ResizeBank(buf,33*4 + 40) EndIf For Local i:Int = 0 To 39 PokeByte(buf,i,lcName[i]) Next PokeInt(buf,40,lcOptions) PokeInt(buf,44,lcStatus) PokeInt(buf,48,lcLocks) PokeInt(buf,52,lcMsgBase) PokeInt(buf,56,lcDevice) etc...
Method fromBank(buf:TBank) If buf <> Null For Local i:Int = 0 To 39 lcName[i] = PeekByte(buf,i) Next lcOptions = PeekInt(buf,40) lcStatus = PeekInt(buf,44) lcLocks = PeekInt(buf,48) lcMsgBase = PeekInt(buf,52) lcDevice = PeekInt(buf,56) etc...And then I use BankBuf() to pass the byte ptr to the c stuff, and convert back afterwards. Like this:
Local tempbank:TBank = CreateBank() context.toBank(tempbank) WTInfo(WTI_DEFSYSCTX,0,BankBuf(tempbank)) context.fromBank(tempbank)