#17247 - hakanyuksel - Fri Mar 05, 2004 12:22 am
I am trying to rotate a 64x64 sprite in mode 0. When I enable sprite rotation the sprite become a solid one color 64x64(I tried 16x16 it is still happening) box. I dont know why does it happen. I have read all the documents on the web,
I am using HAM and my code is here:
#include <math.h>
#include "memory.h"
#include "graphics.h"
#include "data.h"
#include "game.h"
#include "keyboard.h"
volatile const int __gba_multiboot = 1;
int main(void)
{
unsigned short *sprite_attribute_memory = ( unsigned short* ) 0x7000000
*( unsigned short* ) 0x4000000 = (1<<12)|(1<<6);
copy_data_to_vram(); // I copy the sprite data and palet to vram here
wait_vblank();
sprite_attribute_memory[ 0 ] = SPR_COLOR_256 |(1<<8);
sprite_attribute_memory[ 1 ] = SPR_SIZE_64;
sprite_attribute_memory[ 2 ] = 0;
sprite_attribute_memory[ 6 ] = cos_table[100]>>8;
sprite_attribute_memory[ 7 ] = sin_table[100]>>8;
sprite_attribute_memory[ 14] = -sin_table[100]>>8;
sprite_attribute_memory[ 15] = cos_table[100]>>8;
while(1) {}
return 0;
}
_________________
--------------------
Hakan Yuksel
3TE GAmes
www.3tegames.com
I am using HAM and my code is here:
#include <math.h>
#include "memory.h"
#include "graphics.h"
#include "data.h"
#include "game.h"
#include "keyboard.h"
volatile const int __gba_multiboot = 1;
int main(void)
{
unsigned short *sprite_attribute_memory = ( unsigned short* ) 0x7000000
*( unsigned short* ) 0x4000000 = (1<<12)|(1<<6);
copy_data_to_vram(); // I copy the sprite data and palet to vram here
wait_vblank();
sprite_attribute_memory[ 0 ] = SPR_COLOR_256 |(1<<8);
sprite_attribute_memory[ 1 ] = SPR_SIZE_64;
sprite_attribute_memory[ 2 ] = 0;
sprite_attribute_memory[ 6 ] = cos_table[100]>>8;
sprite_attribute_memory[ 7 ] = sin_table[100]>>8;
sprite_attribute_memory[ 14] = -sin_table[100]>>8;
sprite_attribute_memory[ 15] = cos_table[100]>>8;
while(1) {}
return 0;
}
_________________
--------------------
Hakan Yuksel
3TE GAmes
www.3tegames.com