Page 1 of 1

Peek, Poke and Big / Little endians.

Posted: Mon Apr 01, 2019 11:16 pm
by evil
Maybe, I'm wrong, but shouldn't give

Code: Select all

AllocMem(1, 2)
Poke(1, 0, $100, #SHORT, TRUE)
DebugPrint (Peek (1, 0, #SHORT, TRUE))
DebugPrint(Peek(1, 0, #SHORT, FALSE))
d
ifferent values??

Best regards

George

Re: Peek, Poke and Big / Little endians.

Posted: Tue Apr 02, 2019 2:21 pm
by bitRocky
You used TRUE/FALSE as the "endian" argument, you should use the constants #BIGENDIAN, #NATIVEENDIAN or #LITTLEENDIAN.

Code: Select all

DebugPrint(HexStr(Peek(1, 0, #SHORT, #BIGENDIAN)))
DebugPrint(HexStr(Peek(1, 0, #SHORT, #LITTLEENDIAN)))

Re: Peek, Poke and Big / Little endians.

Posted: Tue Apr 02, 2019 10:56 pm
by evil
That doesnt help. All three constants return en error: Constant not found.

Also, the Guide says:

ne Optional. True, if you want to use native endian byte order.
(Defaults to FALSE) (V6.0)

At the moment, I use MemToTable() and TableToMem() as a workaround. They seem to work correct, when useing the EndianSwitch-argument.

Also I could use the then Math-function EndianSwap() That also works.

But As I need to look into Millions of Bytes, Every extrac command will slow down the function a lot...


Best regards

George

Re: Peek, Poke and Big / Little endians.

Posted: Wed Apr 03, 2019 1:14 am
by bitRocky
hmm, which Hollywood version are you using?
See here https://www.hollywood-mal.com/docs/html ... /Peek.html

Re: Peek, Poke and Big / Little endians.

Posted: Wed Apr 03, 2019 10:23 pm
by airsoftsoftwair
@evil: It's a Hollywood 8.0 feature... time to upgrade I guess :)

Re: Peek, Poke and Big / Little endians.

Posted: Thu Apr 04, 2019 8:06 am
by evil
I'm using the AmigaOS3-Version of Hollywood 7.1