#23278 - mymateo - Fri Jul 09, 2004 6:10 am
I'm having some trouble. "What's New?" I should change my nick to Zombie 'cause I'm here picking brains just about every week with something new...
I want to use mode 1 to have 2 plain text backgrounds, and one rot/scale background. I plan on adding a spell to my Marle demo, and for that I need a blue circle to shoot out from behind Marle.
I have somewhat of a handle on actually scaling the background, and I can move the background left/right and up/down.
What it does: When I increase the scale/make the background bigger, it moves to the right and down. Or rather, it LOOKS like it does. What it's actually doing (I think) is the 0,0 point stays put and the rest stretches out.
What I want: I want to pick a point at 32,32 (pixels) and have that the center that it stretches out from.
Brendan Sechter has made a rot/scale demo ("sg_rot_demo.zip" in the sources -> GBA -> C/C++ section) that scales in this fashion. I have looked at the source, but I cannot for the life of me figure out how he manages it. I think he does something in this function...
... that moves his data around to scale the background and then move it so it looks like it scales out from the center.
But I really don't know, which is why I am asking for help again. Thanks everyone!
I want to use mode 1 to have 2 plain text backgrounds, and one rot/scale background. I plan on adding a spell to my Marle demo, and for that I need a blue circle to shoot out from behind Marle.
I have somewhat of a handle on actually scaling the background, and I can move the background left/right and up/down.
What it does: When I increase the scale/make the background bigger, it moves to the right and down. Or rather, it LOOKS like it does. What it's actually doing (I think) is the 0,0 point stays put and the rest stretches out.
What I want: I want to pick a point at 32,32 (pixels) and have that the center that it stretches out from.
Brendan Sechter has made a rot/scale demo ("sg_rot_demo.zip" in the sources -> GBA -> C/C++ section) that scales in this fashion. I have looked at the source, but I cannot for the life of me figure out how he manages it. I think he does something in this function...
Code: |
void swi_bg_affine_set(void *src, void *dest)
{ asm volatile ("mov r0,%0\nmov r1,%1\nmov r2,#1\nswi 0x0E0000\n" : /* No output */ : "r" (src), "r" (dest) : "r0", "r1", "r2", "memory"); } |
... that moves his data around to scale the background and then move it so it looks like it scales out from the center.
But I really don't know, which is why I am asking for help again. Thanks everyone!