aze 2004-11-11 at 06:55pm 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 2004-11-11 at 07:34pm 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 2004-11-11 at 08:24pm yes it is that:
//set the calc in low-power-mode (wakes cpu only up for grayscale, keypress, amstimer, clock)
pokeIO(0x600005, 0b10111);
aze 2004-11-12 at 10:39am 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 2004-11-12 at 06:58pm but it will be executed when the AI1 triggers
I will try something else
aze 2004-11-14 at 04:40pm according to my tests, move.b #%0, $600005 stops instantly the calculator
PpHd 2004-11-15 at 04:15pm If you are under Kernel Mode, kernel_idle(); does the job too.