fingolfin wrote:The advantage of using WRITE_BE_UINT16 is that the code still compiles on 10.2 / 10.3, so I'll stick with that.
Thanks for the clarification, I'm new to Macs and didn't know that.
Regarding the Intel ASM code, I've made some progress, although it doesn't work yet. Using the trial and error method I've found that the offsets used in the assembly code to retrieve function arguments need to be changed. Specifically, they need to be incremented by 12. So, where the previous code was:
Code: Select all
inbuffer equ 8
outbuffer equ 12
Xres equ 16
Yres equ 20
srcPitch equ 24
dstPitch equ 28
It needs to be changed to:
Code: Select all
inbuffer equ 20
outbuffer equ 24
Xres equ 28
Yres equ 32
srcPitch equ 36
dstPitch equ 40
To be honest, I don't know why this happens, or whether a magic arcane gcc flag can be used to make everything fit together properly. What I do know from running gdb on the modified code is that the function is called, the parameters are retrieved correctly, and the function returns to the right place in the C code. I've seen the assembly function being called a few times, but then the program crashes and it was too late to track it down. I'll try again tonight after work, but I thought this information could also be useful to someone more experienced.
Of course, the additional speed of the assembly optimizations is not required at all on these machines. I just hate unfinished problems