Framework problems

BlitzMax Forums/BlitzMax Programming/Framework problems

Kev(Posted 2007) [#1]
Hi

when using Framework ie... 'Framework BRL.System'

i first incbin a file in my module, then i do a comparison between this incbin file in a bank that ive put there using LoadBank() and the byte code obtaind from a function pointer in a c function call included using Import.

now if no Framework is used this comparison is correct and matched byte for byte. BUT using Framework the comparison does not.

the strange thing is that its the incbin byte data thats become corrupt. any ideas why this would be?

and finaly i do a .bmx scan with Framework Assistant, this tells me i only need 'Framework BRL.System'

kev


FOODy(Posted 2007) [#2]
For "incbin::" Support you need the BRL.RamStream Module.


Kev(Posted 2007) [#3]
havin looked at it more its not the data in the bank thats corrupt, its the data return from casting the c function address.

so this is what i have without without using Framework, these match.

(c call) 00000055 : (IsBank) 00000055
(c call) 00000089 : (IsBank) 00000089
(c call) 000000E5 : (IsBank) 000000E5
(c call) 0000008D : (IsBank) 0000008D
(c call) 00000045 : (IsBank) 00000045
(c call) 00000008 : (IsBank) 00000008
(c call) 000000A3 : (IsBank) 000000A3
(c call) 00000000 : (IsBank) 00000000
(c call) 0000009E : (IsBank) 0000009E
(c call) 00000054 : (IsBank) 00000054
(c call) 00000000 : (IsBank) 00000000
(c call) 000000FF : (IsBank) 000000FF
(c call) 00000010 : (IsBank) 00000010
(c call) 0000005D : (IsBank) 0000005D
(c call) 000000C3 : (IsBank) 000000C3


now this is with framework, these dont match.

(c call) 00000055 : (IsBank) 00000055
(c call) 00000089 : (IsBank) 00000089
(c call) 000000E5 : (IsBank) 000000E5
(c call) 0000008D : (IsBank) 0000008D
(c call) 00000045 : (IsBank) 00000045
(c call) 00000008 : (IsBank) 00000008
(c call) 000000A3 : (IsBank) 000000A3
(c call) 00000040 : (IsBank) 00000000
(c call) 00000022 : (IsBank) 0000009E
(c call) 00000042 : (IsBank) 00000054
(c call) 00000000 : (IsBank) 00000000
(c call) 000000FF : (IsBank) 000000FF
(c call) 00000010 : (IsBank) 00000010
(c call) 0000005D : (IsBank) 0000005D
(c call) 000000C3 : (IsBank) 000000C3


i cast the c function using this, where callsmc is a c defined function using extern. i use SuperStrict and also notice they dont match when debug mode is also on and i dont use Framework

Local call_addr:Byte Ptr = Byte Ptr callsmc 


i obtain the byte data like this call_addr[asm_loop], what am i doing wrong? i would think its possable to do this as its working without Framework

any ideas

kev


Kev(Posted 2007) [#4]
nevermind i fixed it, it works like it should now.

kev


Dreamora(Posted 2007) [#5]
What was the reason for the problem? Or how did you fix it?


Kev(Posted 2007) [#6]
i ended up obtaining the address i needed from the stack, when passing param to c function there pushed onto stack. the problem was not with the way i was casting the c function address but the way i was obtaining the passed param.

kev


Dreamora(Posted 2007) [#7]
ah ok