Menu

#1920 Noise init does not match real 8580 SID chips

v3.x
pending-fixed
Dag Lem
None
ReSID
2023-10-29
2023-07-26
Fredrik
No

VICE version: > 2.4 r31587
OS: Windows 10

File simple.asm:
Inits the LFSR to a specific value, then runs the oscillator and stops it at a specific hard coded phase accu value and then samples and prints the output from the noise waveform.
Hold down space to repeat the process.

Printed value every time with real 8580 SIDs:
7F

Actual printed value every time in emulator:
VICE 2.4 r31587: 7F
VICE 3.7.1 r44372: Random value

File scan.asm:
Same process as in simple.asm but repeats the process automatically and stores the output from the noise waveform to memory for every $1000th phase accu value (skipping some in the beginning) for approx one half period.

Values in memory with real 8580 SIDs:
$2000-$2061: $3F
$2062-$2261: $7F
$2262-$2561: $ff
$2562-$2761: $fe
$2762-$27ef: $fc

Actual values in memory in emulator:
VICE 2.4 r31587: Same as with real SID above
VICE 3.7.1 r44372: Random values

These routines has been tested on at least 10 real 8580 SID chips and the result on all of them are consistent with VICE 2.4 r31587 but not with later VICE including VICE 3.7.1 r44372.

2 Attachments

Discussion

  • Querino

    Querino - 2023-07-26
     
    👍
    1
  • gpz

    gpz - 2023-07-27
    • assigned_to: Dag Lem
     
  • gpz

    gpz - 2023-07-27

    It would be good to have this tested on 6581s too - what does it show on these? AFAIK this part of the chip is all digital, so it should be the same...

     
  • Fredrik

    Fredrik - 2023-07-27

    I have tested these routines on one real 6581 and 6581 in VICE 2.4 r31587 and it produces the same result as 8580 but I have tested similar routines on other real 6581 and I think there are some 6581 that actually does not produce a stable result.

     

    Last edit: Fredrik 2023-07-27
  • gpz

    gpz - 2023-07-30

    For those unfamiliar with kickass, here are the binaries

     
    👍
    2
  • Leandro Nini

    Leandro Nini - 2023-08-09

    They're not random values, just different from what expected.

    From the schematics I'd say that when the test bit is set the writeback actually happens but only affects the latched value which becomes active once the test bit falls. So the code is still wrong as it was before the mentioned change.
    Unfortunately all my attempts to fix the shift register writeback and improve the testsuite results have failed miserably up to now.

     
  • Leandro Nini

    Leandro Nini - 2023-08-17

    Found the actual problem. It was there to fix a few tests of the noise writeback suite but it looks like the problem is elsewhere.

    --- a/src/resid/wave.cc
    +++ b/src/resid/wave.cc
    @@ -174,9 +174,11 @@ bool do_pre_writeback(reg8 waveform_prev, reg8 waveform, bool is6581)
         // no writeback without combined waveforms
         if (likely(waveform_prev <= 0x8))
             return false;
    +#if 0
         // This need more investigation
         if (waveform == 8)
             return false;
    +#endif
         if (waveform_prev == 0xc) {
             if (is6581)
                 return false;
    

    Too bad this breaks SID/noisewriteback/D1_+_81_wave_test.sid :(

     

    Last edit: Leandro Nini 2023-08-17
  • gpz

    gpz - 2023-08-19

    testprog adapted for the testbench (in SID/noiselfsrinit/), patch comitted in r44434

    @Fredrik please test again.... and don't hesitate to provide another test program if needed :)

     
    • Fredrik

      Fredrik - 2023-10-29

      Tested with r44434 and it works great! Good job!

       
  • gpz

    gpz - 2023-08-19
    • status: open --> pending-fixed
    • Port: GTK3 -->
     

Log in to post a comment.