aze Le 11/11/2004 à 18:55 I would like to use idle in a grayscale game
there is a loop in my code which waits for the AI1 to trigger in order to synchronize every frame (i think this loop takes 50% of each frame's time)
I tried this :
while(AI1_Counter < 5)
idle();
AI1_counter = 0;
But as it's writtem in tigcc help, it interfers with the grayscales until I press a key
After that, it works fine
Is there a way to prevent idle from interfering with graycales ?
or do you have any idea to reduce the power consumption in this loop ?
hibou Le 11/11/2004 à 19:34 you should use the pokeIO function. I think Kevin has already gave the solution in the forum.
In some of my source files, I have that : you should verify it is correct :
pokeIO(0x600005,0b10111)
mhubi Le 11/11/2004 à 20:24 yes it is that:
//set the calc in low-power-mode (wakes cpu only up for grayscale, keypress, amstimer, clock)
pokeIO(0x600005, 0b10111);
aze Le 12/11/2004 à 10:39 Allright, I'll try that
but does the calculator fall asleep just after this instruction, or is there a small delay (as in _rowread) ?
I don't know, try to put some code just after the move.b #%10101,$60005 (something like move.w #$FFFF,$4C00).

« Quand le dernier arbre sera abattu, la dernière rivière empoisonnée, le dernier poisson capturé, alors vous découvrirez que l'argent ne se mange pas
. »
aze Le 12/11/2004 à 18:58 but it will be executed when the AI1 triggers
I will try something else
aze Le 14/11/2004 à 16:40 according to my tests, move.b #%0, $600005 stops instantly the calculator
PpHd Le 15/11/2004 à 16:15 If you are under Kernel Mode, kernel_idle(); does the job too.