VICE svn2rss single commit view

39811 by rhialto

Date:
Mon, 22 Feb 2021 19:40:22 +0100

Commit-Message:
Overhaul PET CB2 sound output sample generation.

- The shift register shifts left instead of right (i.e. msb first).
- When an output sample covers at most 1 shift register bit time, use a
direct generation algorithm instead of interpolation.
The interpolation doesn't have a constant volume over the whole range
of frequencies.
- Remove old cruft such as static uint8_t snddata[5] and name mysterious
constants.
- Add comments to fields of struct pet_sound_s.

Some little testing programs:

*** commodore basic 4.0 ***

31743 bytes free

ready.
100 poke 59467,16: rem enable shift register
110 poke 59466,15: rem waveform
120 for i = 0 to 255
130 poke 59464,i: rem shift timer
140 for j=1to40:next
150 next
160 for j=1to1000:next
170 poke 59467,0


100 poke 59467,16
110 poke 59466,15: rem 00001111
120 poke 59464,100
130 for i = 1 to 1000:next
140 poke 59466,51: rem 00110011
150 for i = 1 to 1000:next
160 poke 59466,85: rem 01010101
170 for i = 1 to 1000:next
900 poke 59467,0

Changed Files: