Specifically, what I expect to happen is that when the screen changes to the sound test, the number shows a value of 1, and changes when you press Left or Right. But what really happens is that when the screen changes, the number does not show up until I press Left or Right.
Here is the segment of code I'm using for the sprite, for reference:
Code: Select all
pal_spr(palData);//set palette for sprites
sprXPosition=15;
sprYPosition=15;
ppu_waitnmi(); // wait 1 frame
oam_clear(); // just in case this is why the number doesn't appear at first
sprite=oam_spr(sprXPosition,sprYPosition,0x7C,0,sprite); // create sprite
while(1)
{
controllerInput=pad_trigger(0);
if(controllerInput&PAD_LEFT)
{
if(SoundNumber>0) --SoundNumber;
oam_clear(); // clear OAM so numbers do not overlap
sprite=oam_spr(sprXPosition,sprYPosition,0x7C+SoundNumber,0,sprite);
}
if(controllerInput&PAD_RIGHT)
{
if (SoundNumber<11) ++SoundNumber;
oam_clear(); // clear OAM so numbers do not overlap
sprite=oam_spr(sprXPosition,sprYPosition,0x7C+SoundNumber,0,sprite); // redraw number to reflect current sound ID
}
if(controllerInput&PAD_A) sfx_play(SoundNumber,0);
if(controllerInput&PAD_B) break;