[hatari-devel] 68030 Debug mode and new CPU

Thomas Huth huth at users.berlios.de
Tue Feb 15 23:29:02 CET 2011


Am Tue, 15 Feb 2011 22:46:12 +0100
schrieb Nicolas Pomarède <npomarede at corp.free.fr>:

> > Only thing on Atari that I know to use stop instruction is EmuTOS.
> > Does anybody know anything else?
> >
> 
> A lot of demos are using stop. Its most common use is "stop $2300", 
> which will wait for the next VBL interrupt. It's a qucik way to have 
> code synchronised with VBL when you don't want to use $70.
> 
> Some demos are also using stop to wait for the next hbl/timer B to be 
> sure the colors will be changed at the exact position (+/- some
> jitter) or to remove bottom border.
> 
> That why in that case doing a sleep would be wrong, a video line is
> much shorter than 1 ms.

Sleeping there is certainly a bad idea, but maybe the loop can be
improved so that it does not take so long?
Currently we have:

    while (regs.spcflags & SPCFLAG_STOP) {
            ...
            M68000_AddCycles(4);
            while (PendingInterruptCount<=0 && PendingInterruptFunction) {
                /* 1st, we call the interrupt handler */
                CALL_VAR(PendingInterruptFunction)
                 ...
            }
    }

So this mainly decreases  PendingInterruptCount step by step ... maybe
it would be possible to do
           M68000_AddCycles(INT_CONVERT_FROM_INTERNAL(PendingInterruptCount,
                            INT_CPU_CYCLE)
instead, so that the first while loop is handled faster?
Then Hatari could sleep longer in the VBL handler instead...?
Just a though...
What do you think?

 Thomas



More information about the hatari-devel mailing list