Poke, PeekByte

BlitzMax Forums/BlitzMax Beginners Area/Poke, PeekByte

(tu) ENAY(Posted 2006) [#1]
Yep, I'm stuck with another OldBlitz->BlitzMax problem.

Poke and PeekByte have fewer params now, how do I convert my old Peek stuff into new school Blitzmax Peek? :)


Scienthsine(Posted 2006) [#2]
Uhhh no they don't.....
BPlus
-PeekByte(bank,offset)
-PokeByte bank,offset,value

BMax
-PeekByte( bank:TBank,offset )
-PokeByte( bank:TBank,offset,value )

0.o
"Or am I missing something here?" - Scienthsine


(tu) ENAY(Posted 2006) [#3]
Well I get 'too many function parameter' error when I copy and paste Blitz2D code into Blitzmax.

The commands in the Blitz2D code have 4 parameters attached to them.


CS_TBL(Posted 2006) [#4]
uhm ... can't recall stuff from that long aho .. but uhm..

4 ??

logically thinking, for poke you need
- a bank
- an adres
- a value

for peek you need:
- a bank
- an adres

The type is embedded in the command, so that's not an arguement.

So uhm.. what's that 4th param then??


Bremer(Posted 2006) [#5]
Could you show us the blitz2d code, because then it would be easier for us to come up with blitzmax example that does the same.


(tu) ENAY(Posted 2006) [#6]
DOH! Copy and paste error, I meant to say ReadBytes and WriteBytes that I'm converting in PeekByte, PokeByte. ReadBytes and WriteBytes have 4 params, as you say Peek and Poke Byte have 2 and 3.

I think it's all sorted now. Gah! Now I feel silly, feel free to give me a slap for being an idiot. :)

I deserve it.


Bremer(Posted 2006) [#7]
No problem, I think we have all been there. Glad you figured it out.