Heya,
I'm trying to wait for a VSYNC to occur, so the title screen of my game won't flicker.
However, when setting the VSYNC bit of the EIN-register, it appears ISR is never set. Am I missing something?
My code:
#define EIN (*(u8*)0x9F26)
#define ISR (*(u8*)0x9F27)
#define VSYNC() \
{ EIN |= 1;\
while( !(ISR & 1) ); }
/* ... */
static void show_choices(TITLE *ttl)
{
u8 y,hand_pos;
while (1)
{
SET_TILE_STR(12, 14, "+--------------+", TITLE_COL_MENU);
SET_TILE_STR(12, 15, "| |", TITLE_COL_MENU);
for (y = 0; y < ttl->num_options; y++)
{
SET_TILE_STR(12, y+16,"| - |", TITLE_COL_MENU);
SET_TILE_STR(16, y+16,ttl->OPTIONS_STR[y], TITLE_COL_MENU);
}
SET_TILE_STR(12, y+16, "| |", TITLE_COL_MENU);
SET_TILE_STR(12, y+17, "+--------------+", TITLE_COL_MENU);
SET_TILE(13, hand_pos+16, '>', TITLE_COL_BG);
hand_pos = (hand_pos + 1) & 3;
VSYNC();
}
}
SET_TILE_STR and TILE_COL_*** are macros that deal with updating the tile maps, so they aren't important for this question. It's the VSYNC at the bottom that locks up the system...
EDIT: I realize this function is within a while-loop that never get escaped out of. However, that is intentional, as I'm still working on the title screen. The problem is that the VSYNC never occurs as far as the game is concerned.