#15856 - gobojacobs - Sun Feb 01, 2004 8:43 pm
Hey everyone.. relative newb to this forum, as well as the entire gba dev community. Just picked up VisualHAM and the DevKitAdvance, and was just trying to get a sprite to display. My code compiles, and BoycotAdvance will run it, but nothing happens. I assume there's just a tiny little error somewhere (not enabling a background, not copying a sprite to the right OAM spot, etc.), and was hoping you folks could steer me in the right direction.
I'm using the mygba.h header from the visual ham library. I haven't included thecheat.h (it was generated using pcx2sprite).
Any advice / recomendations would be greatly appreciated :) Thanks much, and enjoy the lovely weather (we got up to 10 today! woohoo!),
gobojacobs
I'm using the mygba.h header from the visual ham library. I haven't included thecheat.h (it was generated using pcx2sprite).
Code: |
#include "mygba.h" #include "thecheat.h" MULTIBOOT int main(void) { //set to mode 2, enable sprites, set the map to 1d M_DISCNT_BGMODE_SET(2); M_DISCNT_HBLOBJ_ENA; M_DISCNT_OBJMAP_1D; //move all of the sprites offscreen int i; for(i = 0; i < 128; i++) { TOOL_OAM_OBJ_SET_XPOS(i, 160); TOOL_OAM_OBJ_SET_YPOS(i, 240); } //set the pallete for(i = 0; i < 256; i++) { (MEM_PAL_OBJ_PTR)[i] = thecheatPalette[i]; } //load thecheat for(i = 0; i < 256 * 8; i++) { (MEM_OBJ_PTR)[i] = thecheatData[i]; } TOOL_OAM_OBJ_CREATE(0, 0, 50, 50, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0); while(1) { } return 0; } |
Any advice / recomendations would be greatly appreciated :) Thanks much, and enjoy the lovely weather (we got up to 10 today! woohoo!),
gobojacobs