[hatari-devel] Falcon (bad)Patch but sound quality increased a lot

Laurent Sallafranque laurent.sallafranque at free.fr
Tue Jan 11 23:35:43 CET 2011


Interesting test :

> In the 3 patches you propose, I think the 1st one is not necessary. In 
> case SPCFLAG_EXTRA_CYCLES is set, we will add most of the time 4 
> cyles, so calling DSP_Run again just after 4 cycles might be counter 
> productive.
>

OK, I've removed the first one.

> I think the 2 patches before "#if 0" can be kept and the original last 
> call to DSP_Run should be changed from :
>
>
>         if (regs.spcflags) {
>             if (do_specialties ())
>                 return;
>         }
>
>         /* Run DSP 56k code if necessary */
>         if (bDspEnabled) {
>             DSP_Run( Cycles_GetCounter(CYCLES_COUNTER_CPU) );
>         }
>
> to
>         if (regs.spcflags) {
>             if (do_specialties ())
>                 return;
>
>             /* Run DSP 56k code if necessary */
>             if (bDspEnabled) {
>                 DSP_Run( Cycles_GetCounter(CYCLES_COUNTER_CPU) );
>             }
>         }
>
> -> No need to call DSP_Run again if M68000_AddCycles was not called by 
> do_specialties, because the cpu cycle counter would be the same since 
> the latest call to DSP_Run.
>

KO, if I test as you said, Eko_system crashes after a while and the 
transparent 3d ball effect doesn't appear.

If I keep the last original call to the DSP, the demo works until the end.
(I've done each test twice, changing from original code to your 
proposition every other time)

Laurent



> In the end, there would be 3 calls to DSP_Run : 1 would be made every 
> time, the 2 others only when there's an exception.
>
> Could you try this ? If that's OK I can commit a patch to do this 
> (this would not really impact emulator's performance)
>
>
> Of course, the final stage of this to get perfect emulation is to do 
> the same as WinUae in its most precise mode : each cpu instruction is 
> split into 4 cycles and all components (blitter, copper, dma sound, 
> ...) are called every 4 cycles to see if they need "to work" -> really 
> more cpu intensive.
>
>
> Nicolas
>
>
>
>>
>>
>> diff -r 1ea504dede73 src/uae-cpu/newcpu.c
>> --- a/src/uae-cpu/newcpu.c Tue Jan 11 21:08:35 2011 +0100
>> +++ b/src/uae-cpu/newcpu.c Tue Jan 11 22:09:16 2011 +0100
>> @@ -1737,6 +1737,13 @@
>> Cycles_SetCounter(CYCLES_COUNTER_CPU, 0); /* to measure the total number
>> of cycles spent in the cpu */
>>
>> M68000_AddCyclesWithPairing(cycles);
>> +
>> + /* Run DSP 56k code if necessary */
>> + if (bDspEnabled) {
>> + DSP_Run( Cycles_GetCounter(CYCLES_COUNTER_CPU) );
>> + Cycles_SetCounter(CYCLES_COUNTER_CPU, 0); /* to measure the total
>> number of cycles spent in the cpu */
>> + }
>> +
>> if (regs.spcflags & SPCFLAG_EXTRA_CYCLES) {
>> /* Add some extra cycles to simulate a wait state */
>> unset_special(SPCFLAG_EXTRA_CYCLES);
>> @@ -1744,6 +1751,12 @@
>> nWaitStateCycles = 0;
>> }
>>
>> + /* Run DSP 56k code if necessary */
>> + if (bDspEnabled) {
>> + DSP_Run( Cycles_GetCounter(CYCLES_COUNTER_CPU) );
>> + Cycles_SetCounter(CYCLES_COUNTER_CPU, 0); /* to measure the total
>> number of cycles spent in the cpu */
>> + }
>> +
>> #if 0
>> while (PendingInterruptCount <= 0 && PendingInterruptFunction)
>> CALL_VAR(PendingInterruptFunction);
>> @@ -1757,6 +1770,12 @@
>> {
>> CALL_VAR(PendingInterruptFunction); /* call the interrupt handler */
>> do_specialties_interrupt(false); /* test if there's an mfp/video
>> interrupt and add non pending jitter */
>> +
>> + /* Run DSP 56k code if necessary */
>> + if (bDspEnabled) {
>> + DSP_Run( Cycles_GetCounter(CYCLES_COUNTER_CPU) );
>> + Cycles_SetCounter(CYCLES_COUNTER_CPU, 0); /* to measure the total
>> number of cycles spent in the cpu */
>> + }
>> #if 0
>> if ( regs.spcflags & ( SPCFLAG_MFP | SPCFLAG_INT ) ) { /* only check
>> mfp/video interrupts */
>> if (do_specialties ()) /* check if this latest int has higher 
>> priority */
>>
>> _______________________________________________
>> hatari-devel mailing list
>> hatari-devel at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/hatari-devel
>
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel
>
>




More information about the hatari-devel mailing list